Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Happybobjr on February 05, 2011, 08:03:06 pm

Title: Rocket Ninja Cyborg
Post by: Happybobjr on February 05, 2011, 08:03:06 pm
I am attempting it in axe and basic with UsbDrv8x.
(also holing high score or the month)
http://www.eiswuxe.de/games/rocket-ninja-cyborg/

I figure i will have many questions so I night as well make a topic.

:P
Question.  How could i relay a byte of info between a basic program and it's asm (axe) subprograms?

Edit:  could i use
Getcalc("varX")+8->Q
Title: Re: Rocket Ninja Cyborg
Post by: FinaleTI on February 05, 2011, 08:10:16 pm
If you wanna reference a real var in Axe try this:
Code: [Select]
GetCalc("varX")->P
float{P-2}->Q
I believe that could be optimized to:
Code: [Select]
GetCalc("varX")
float{-2}->Q
but I could be wrong.
Title: Re: Rocket Ninja Cyborg
Post by: Happybobjr on February 05, 2011, 08:17:08 pm
thank you.

Why -2?

Edit: It's not working for me
Title: Re: Rocket Ninja Cyborg
Post by: FinaleTI on February 05, 2011, 08:36:02 pm
I don't exactly remember why, but you have to subtract 2 from the pointer before converting it to or from a float in order to reference it with Axe.
Title: Re: Rocket Ninja Cyborg
Post by: Binder News on February 05, 2011, 08:56:48 pm
That's because Axe returns the pointer+2 to account for the size bytes present in most programs/appvars. However, because floats are always 9 bytes large, they don't have those extra 2 bytes.
Title: Re: Rocket Ninja Cyborg
Post by: DJ Omnimaga on February 06, 2011, 02:12:12 am
Hmm that would be a nice game indeed. Darl181 had a jetpack style engine if I remember but there were no platforms and such.
Title: Re: Rocket Ninja Cyborg
Post by: Binder News on February 06, 2011, 09:02:06 am
vertical and horizontal velocity engines FTW!
Title: Re: Rocket Ninja Cyborg
Post by: Happybobjr on February 06, 2011, 10:46:27 am
I was unable to figure out how to transfer data between the basic part and the axe part.
I am also not familiar how to call usbdrv8x through asm.

I think since I have it working, even if it's slow, I will keep it the way it is.  Then I will fix it if i get everything else coded.
This is looking even more possible now that i am starting to feel better.