GP2X Asteroids


dwelch

Member
Joined
Jul 7, 2006
Messages
119
I improved upon my 6502 or specifically Asteroids translation to C, and from there compiled it for the GP2X.
Translation was probably not necessary for this platform...Anyway, it outruns the frame rate of the unit already so if you go into the lcd settings and change the refresh rate settings you can control the speed of the game.

Sound is not supported at this time.

I am not interested in distrubuting the roms at this time so I am not offering a final binary, you acquire the rom files (same files used by MAME), from there build.bat will take care of the rest. See the README.TXT file in

http://www.dwelch.com/gp2x/ASTEROIDS_20061031a.7z
or
http://www.gigasize.com/get.php/150411/arm...IDS20061031a.7z

Both are 7zip files, I assume any good zip program can handle 7zip. The first link is just the translation stuff. The second includes my gcc cross compiler. I am pretty sure the GPH gcc will not work. The gigasize link is about 10Mbytes and includes the files in the dwelch.com link.

A windows version is also part of this. You will need MinGW to build. See the README.TXT file.

Note the 6502 rom is translated. The vector graphics processor is emulated. I still want to change that at some point. Since the program generates the vector graphics binaries at run time you cannot translate. But the rocks and ships and such are just subroutines in rom, so you dont have to draw lines to draw the rocks, you could figure them out pre-runtime and hardcode sprites. This would improve performance on a performance starved platform like the GBA or even iPod, for the GP2X, even with full vector emulation and unoptimized line draws, it already outruns real-time. For now the vector graphics is limited using a generic line draw.
 
Sounds great, any chance you could do a screen-shot or movie-demo .. I mean, its interesting, but I don't have anything I can run build.bat on right now, alas (build.sh would be do'able, tho'!)
 
Sounds great, any chance you could do a screen-shot or movie-demo .. I mean, its interesting, but I don't have anything I can run build.bat on right now, alas (build.sh would be do'able, tho'!)

How about a time limited playable demo?
http://www.dwelch.com/gp2x/DEMO20061031a.7z

Copy the two files to an sd card and execute the gpe file. Depending on your frame rate you will get a couple-three minutes then it hangs. You get 5000 screen updates.

My score was at 3250 when it hung on a one time play-test (not claiming to be any good at the game, cause I am not).

I assume a linux/sdl fan could easily port this without needing my arm gcc build environment.
Trans.c other than having a large switch statement should build with most compilers, certainly gcc and visual c. Use it plus the rom files to create game.c and rom.h.
Keep gmain.c game.c rom.h and dvg.c. Look for SetPixel and page_flip() in video.c and replace them with your favorite page flipping code. And repplace do_keys() in gmain.c and you are set for any platform. Might be a few printfs() to handle or get rid of.
I maintain a frame buffer, on a page flip zero it out (black) and then fill it in with white pixels using SetPixel before the next page flip, super simple.

I am not real happy with my keyboard layout right now, but I hate the joystick so it is what it is, and the source is there to try other configurations. I think I prefer thrust to be near the rotate controls. In windows on the pc keyboard the right hand does rotate and thrust and left fires just fine, on the gp2x for some reason it feels backward...Maybe my thumbs are cross wired to the wrong side of the brain.



Oh, man I forgot my web server doesnt like 7zip files, here are plain old zip files:

http://www.dwelch.com/gp2x/DEMO20061031a.zip

http://www.dwelch.com/gp2x/ASTEROIDS_20061031a.zip
 
Last edited by a moderator:
Back
Top