Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Calculator Emulator

Author
Message
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Nov 2007 23:04 Edited at: 27th Nov 2007 23:06
I made this emulator because I've been learning to program on my calculator and wanted to show my games on the forums.
Since I posted it up in geek culture all they've talked about is calculators so I was hoping you guys would be more help.

I'm very happy with how it looks, although two things are bothering me; when a result is displayed on a calculator it is aligned to the right side of the screen, how do I do that? And although my input routine works, it is very "klunky" and slow to respond.
If you want to exit a menu, input 0

This was completely written on the fly so any tips on how to tidy/speed things up are more than welcome

If you are going to help, please bear in mind that this is a calculator emulator, it is designed to port any calculator game not just this one.
For example: I only use inputs of 0,1,2 and 3 in this program so you might suggest checking the keystates for those keys instead of using the keyboard buffer, but you would have to include 4,5,6,7,8 and 9 so that other games that use those keys would still work.

Thanks in advance,

~OBese

[edit]
Before any of you flame me, this game uses Gotos because it was made on a calculator and ported to DB.

"You must be someone's friend to make comments about them." - MySpace lied.
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 28th Nov 2007 01:35
Hi,

I looked at your code. The last I heard was a function call within a function is slow. It could be cause for the slowness of the program.

Maybe change some of the functions that you are calling inside of other functions to goto or gosub and see if that speeds it up.

I like using functions a lot, but for some reason depending on the code, it just doesn't work right sometimes.

If I'm wrong about a function call within a function, someone please feel free to correct me.

3.0 Ghtz/1GB DDR400 Ram/NVidia 7600 GS OC 512MB AGP Graphics/100GB Maxtor Sata Drive/Dark Basic Pro 6.6

No one cares how much you know until they know how much you care.
TheDark
17
Years of Service
User Offline
Joined: 22nd Nov 2007
Location:
Posted: 28th Nov 2007 02:13
I don't know how to help, but I'm new, and I think it's pretty cool that you're programming games for calculators.

http://en.wikipedia.org/wiki/Main_Page
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 28th Nov 2007 02:49
right alignment with left side cut off (just the display is cut, not the string)



Enjoy your day.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 28th Nov 2007 03:40
thanks latch
I'm thinking of eventually making the screen out of pixels and hardcoding the characters like my calculator has
Would that work the same way?
got any tips for doing that type of thing?

anyone play the game?

"You must be someone's friend to make comments about them." - MySpace lied.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 28th Nov 2007 04:05
If you create a custom font it would work the sane way. But if you were using pixels, i.e. images, the idea's the same, you'd just be using the size of images that represented the text size.

But if it's written for the calculator, I don't know how you would handle either unless it has the same sophistication with image and font placement as in DB.

I'm guessing the functions you're implementing in DB are to emulate those on the calculator that don't natively exist in DB. If the desired result, for example, is to clear the screen and output a few lines, you don't have to try and do it the same way the calculator does it, you can use the advanced features of DB. You only have to create a procedure or a function that ties to the command from the calculator, but it can be as advanced as you want since you are porting it to DB. Don't get too hung up on making DB behave like the calculator, concentrate more on how you can use DBs commands to run the calculator script without modification. Instead of redrawing the same screen, off the bat have a function that creates a bitmap offscreen that can just be copied whenever an update is needed.

Why not just use a CLS and paste the image of your screen instead of erasing each line and then redrawing it?

Enjoy your day.
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 28th Nov 2007 21:24
You know, when I first saw the title of this thread my first thought was 'That's an OBese87 thread, surely'.


Sudoku arts, the rabi and Nancy DrewG
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 28th Nov 2007 22:54
Quote: "You know, when I first saw the title of this thread my first thought was 'That's an OBese87 thread, surely'."

haha

"You must be someone's friend to make comments about them." - MySpace lied.
aluseus GOD
18
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 28th Nov 2007 23:04
it doesn't work in dbpro

alus.portbb.com go there.
Quote: A book. I hate books. book is stupid. I know that I need codes but I dont know the codes -zenicanin14 the stupidest user in the world
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 28th Nov 2007 23:19
Quote: "it doesn't work in dbpro "

really?
If it displays the small green screen and main menu it might just be my input routine that is a little slow.
Is there an error?

"You must be someone's friend to make comments about them." - MySpace lied.
aluseus GOD
18
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 28th Nov 2007 23:34
It could be just me of course... I have a lousy compiler that gives a ton of bugs...
Yes, there is an error.

alus.portbb.com go there.
Quote: A book. I hate books. book is stupid. I know that I need codes but I dont know the codes -zenicanin14 the stupidest user in the world
Sinani201
18
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 29th Nov 2007 02:30
i don't get how it works. I get the little green menu screen, I type a menu number, press enter, but nothing happens!

Seriously, how do you make the little blue text come up below your message?
aluseus GOD
18
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 29th Nov 2007 02:58
user function call must include set of brackets.
Oh yeah, I haven't tested it, but if you need more than just a green color...
RGB(173,190,140) works pretty good for a white color.
RGB(90,97,57) work for a calculator black.

alus.portbb.com go there.
Quote: A book. I hate books. book is stupid. I know that I need codes but I dont know the codes -zenicanin14 the stupidest user in the world
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Nov 2007 13:25
hmm... the functions that don't return variables work fine in DBC without brackets, they might be screwing up DBP
You are pressing ENTER and not RETURN right?
Here's a version with brackets everywhere


"You must be someone's friend to make comments about them." - MySpace lied.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 2nd Dec 2007 19:44
Oh the label headings too!
OK I'll sort that out for you guys

"You must be someone's friend to make comments about them." - MySpace lied.
Sinani201
18
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 2nd Dec 2007 19:59
can someone please tell me how this works? I'm stuck on the first menu screen.

Seriously, how do you make the little blue text come up below your message?
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 2nd Dec 2007 20:35
press a number key firmly, if nothing comes up keep pressing it until the number comes up below the menu options (sorry the input is really bad)
then press ENTER on the numpad
that's all you need to know, the game is pretty simple

The idea is you start of committing petty crimes, starting with mugging, once your good at that you can move up to robbing shops, and then on to stealing cars (GTA).

Once you have enough money you can organise a bank heist; You'll need at least one gangster and a car to commit a heist.
Go into the heist menu and hire some gangsters, 4 is the maximum and best. Next go into the car menu, if you already have a car from GTA you can use that but if you don't you'll have to buy one from here, You can even sell cars for half their value which will gain you more than robbing a shop

Once you have a gang and a car you can commit the heist. If successful, heists can gain from #1000 to #6000!

If you were successful you'll have enough money to plan another heist without needing to commit petty crimes

"You must be someone's friend to make comments about them." - MySpace lied.
Sinani201
18
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 2nd Dec 2007 21:02
when I press ENTER, nothing happens!

Seriously, how do you make the little blue text come up below your message?
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 2nd Dec 2007 21:28
So you run the program
the main menu comes up
you press a key
the number comes up below the menu
and when you hit enter nothing happens?

I don't understand that as the enter key is being checked as a key and not in the keyboard buffer.
Can anyone help me with keyboard buffer entry, it should surely be faster than reading input strings

"You must be someone's friend to make comments about them." - MySpace lied.
Sinani201
18
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 4th Dec 2007 04:54
Yup, that's my problem! does it work for anyone else?

Seriously, how do you make the little blue text come up below your message?
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 4th Dec 2007 21:22
are you sure the menu doesn't change, they look pretty similar

"You must be someone's friend to make comments about them." - MySpace lied.

Login to post a reply

Server time is: 2025-06-05 18:13:37
Your offset time is: 2025-06-05 18:13:37