Author Topic: The Last Mission SDL Remake (native+dingux)  (Read 16658 times)

dmitry_smagin (OP)

  • *
  • Posts: 417
The Last Mission SDL Remake (native+dingux)
« on: March 20, 2011, 12:11:04 pm »
The Last Mission SDL Remake for Native OS and Dingux

Hi, everybody! Here's my replica of the classic game The Last Mission. The graphics now is redrawn in 256 color palette, the sound is adlib-emulation. The sound yet is not completely finished. Anyway, please try and test it.


Description from MobyGames.com:
The Last Mission is a side-view arcade game without scrolling (viewpoint moves from screen to screen) with map of big dimensions. The game takes its inspiration from games such as Underwurlde and Starquake.

You control a tank-like robot which can be divided in two: you rotate caterpillar and head-canyon, and the head part can fly off on its own. However,the head can only survive separately for a short amount of time, and your restart position is dictated by the location of the body, even if the head has moved forward through further screens. Therefore, the difficulty of the game was in making it possible to advance with the assembled robot's two parts.







Download version 0.6 (sources, dingux, dingoo OS, dos32, windows and linux binaries): last-mission-0.6.zip - 0.61MB

Mirror on OpenHandhelds: last-mission-0.6.zip - 0.61MB

Controls:
For Dingoo A320 use:
D-PAD   - move
A/B/X/Y   - fire
START   - start game or pause
SELECT   - quit
L      - toggle fullscreen upscale: no/coarse/bilinear
R      - toggle frameskip: 0/1

QUESTION: While porting this game I've encountered the following problem. Sources contain a lot of pointer arythmetic and pointer casting whila accessing data at arbitrary addresses. When simple bytes are addressed, everything works, but if casting to int or short, Dingoo hangs. As far as I understand, this occurs when reading non-aligned ints and MIPS architecture doesn't like it. So, is there any solution to this? For now sources are patched in an ugly form but work.

Post updated 18 March 2012
« Last Edit: March 18, 2012, 12:36:33 pm by d_smagin »
GCW-Zero prototype, Dingoo a320, Ritmix rzx-50, Dingoo a380, Xperia Play

clach04

Re: The Last Mission Dingoo SDL Remake for Native OS
« Reply #1 on: March 21, 2011, 08:16:16 pm »
I've not had chance to play with your release but thank you for releasing this!

QUESTION: While porting this game I've encountered the following problem. Sources contain a lot of pointer arythmetic and pointer casting whila accessing data at arbitrary addresses. When simple bytes are addressed, everything works, but if casting to int or short, Dingoo hangs. As far as I understand, this occurs when reading non-aligned ints and MIPS architecture doesn't like it. So, is there any solution to this? For now sources are patched in an ugly form but work.

The phenomenon you are experiencing is called byte alignment, google for more info, Wikipedia has an ok article on this http://en.wikipedia.org/wiki/Data_structure_alignment . Apologies for the quick reply but it is my lunch break and I don't have time for a full answer. There are multiple ways to address this but one "quick" way is to add "#ifdef BYTE_ALIGNED" checks and do things like:


Code: [Select]
void *myptr=.....;
short my_2_byte_int=0;
...
memcpy(&my_2_byte_int, myptr, sizeof(my_2_byte_int));

... use my_2_byte_int to get in value, then if changes, copy back.....

repeat for 4 byte ints floats, structs, etc.

Hope that helps get you started, again there are other ways to handle this, this is just one that is easy to do and understand.

Alignment is not specific to MIPS, for example SPARC (Sun/Oracle cpus).

clach04

Re: The Last Mission Dingoo SDL Remake for Native OS
« Reply #2 on: March 23, 2011, 01:08:28 am »
I had a play last night, it is a fun little puzzler.

The only thing that was a problem for me was the sound, I was in bed and it was really loud. It would be great if there was volume control and/or an option to disable the sound. If there is an option I couldn't work it out  :-[

dmitry_smagin (OP)

  • *
  • Posts: 417
Re: The Last Mission Dingoo SDL Remake for Native OS
« Reply #3 on: March 24, 2011, 08:09:57 pm »
Thanks for advice.
I'll make sound volume adjustable a bit later.

For now a little update (23 March 2011): "demo" mode added when the Dingoo plays on its own for some time. Just wait at title screen half a minute. Select button exits demo mode.
GCW-Zero prototype, Dingoo a320, Ritmix rzx-50, Dingoo a380, Xperia Play

Tabaluga_FX

  • *
  • Posts: 28
Re: The Last Mission Dingoo SDL Remake for Native OS
« Reply #4 on: March 25, 2011, 07:52:29 pm »
Help. I can't download it from zShare - please add another mirror.

Thanks.

best regards

dmitry_smagin (OP)

  • *
  • Posts: 417
Re: The Last Mission Dingoo SDL Remake for Native OS
« Reply #5 on: March 26, 2011, 08:13:10 am »
Ok, I added a mirror on Mediafire, see first post.
« Last Edit: March 26, 2011, 10:12:45 am by d_smagin »
GCW-Zero prototype, Dingoo a320, Ritmix rzx-50, Dingoo a380, Xperia Play

Tabaluga_FX

  • *
  • Posts: 28
Re: The Last Mission Dingoo SDL Remake for Native OS
« Reply #6 on: March 26, 2011, 05:17:16 pm »
Thanks for the mirror - download completed without any errors.

best regards

clach04

Re: The Last Mission Dingoo SDL Remake for Native OS
« Reply #7 on: March 27, 2011, 12:47:38 am »
I'd recommend setting up a project site somewhere, there are many different options. The 2 I like are http://code.google.com and http://bitbucket.com. You can set a new project up in about 2 mins :-)

You get both source code hosting and download space. There is also a wiki option too.

nightc1

  • Guest
Re: The Last Mission Dingoo SDL Remake for Native OS
« Reply #8 on: April 13, 2011, 02:32:46 pm »
Played the game a little today and it's pretty fun.  Good job thus far.

dmitry_smagin (OP)

  • *
  • Posts: 417
Re: The Last Mission Dingoo SDL Remake for Native OS
« Reply #9 on: November 16, 2011, 08:03:24 am »
Hi.
I've updated the first post. With various small modifications and cleanups i've compiled The Last Mission for DOS32, Windows, Windows SDL, Linux SDL and Dingoo OS. Full sources included.

Perhaps, someone will try compiling it for Dingux or OpenDingux??

Thanks.
« Last Edit: November 17, 2011, 11:27:35 am by d_smagin »
GCW-Zero prototype, Dingoo a320, Ritmix rzx-50, Dingoo a380, Xperia Play

zear

  • * Moderator
  • Posts: 2378
Re: The Last Mission Dingoo SDL Remake for Native OS
« Reply #10 on: November 19, 2011, 03:54:51 pm »
Perhaps, someone will try compiling it for Dingux or OpenDingux??
Just saying i'm working on it.
Already got it running on OpenDingux, but want to do something else before I release it.

zear

  • * Moderator
  • Posts: 2378
Re: The Last Mission Dingoo SDL Remake for Native OS
« Reply #11 on: November 25, 2011, 09:25:10 pm »
Dingux port is out:
http://dl.openhandhelds.org/cgi-bin/dingoo.cgi?0,0,0,0,30,542

The download includes the source code.

To d_smagin:
I've added joystick support and compiled the game for gp2x and caanoo, unfortunately the game crashes on these devices right after the intro screen. I had no time to debug that yet.

dmitry_smagin (OP)

  • *
  • Posts: 417
Re: The Last Mission Dingoo SDL Remake for Native OS
« Reply #12 on: November 26, 2011, 01:55:01 pm »
Thanks, zear, your help is appreciated.

I'll incorporate the changes you've made. Now i'm working on coloring all the graphics to 256 color palette (to retain retro feel) and the half is done for now. Also i'm planning to add more sound effects.

As for the hangups, they may occur during sound subsystem initializing, i'll investigate on that, cause sound problems prevent this game from stable work on NT4 (yes, i'm testing it on that oldie, just for fun).

EDIT: wait, zear, if program hangs AFTER intro screen, it may be because the floating-point arithmetic is used for rotating logo. On Dingoo, as far as i remember, floating point emulation is used (-msoft-float). Maybe gp2x and Caanoo can't do floats as well, i don't own such apparati to test it.
« Last Edit: November 26, 2011, 07:27:59 pm by d_smagin »
GCW-Zero prototype, Dingoo a320, Ritmix rzx-50, Dingoo a380, Xperia Play

zear

  • * Moderator
  • Posts: 2378
Re: The Last Mission Dingoo SDL Remake for Native OS
« Reply #13 on: November 26, 2011, 11:44:20 pm »
EDIT: wait, zear, if program hangs AFTER intro screen, it may be because the floating-point arithmetic is used for rotating logo. On Dingoo, as far as i remember, floating point emulation is used (-msoft-float). Maybe gp2x and Caanoo can't do floats as well, i don't own such apparati to test it.
The rotating logo shows up fine. The game crashes right when it should start the actual level.

dmitry_smagin (OP)

  • *
  • Posts: 417
Re: The Last Mission SDL Remake (native+dingux)
« Reply #14 on: March 18, 2012, 12:18:56 pm »
The version 0.6 is out!

What's new:
- MORE COLORZ! All the graphics is redrawn in 256 color palette (MSX2 version is taken as an example)
- certain floors, ceilings and electric wires kill the flying turet again, now the game is as hardcore as original
- intro music remix of the original theme
- the game is now supposed to work with Dingoo a320, a320e, a380 and Ritmix rzx-50 (turn OFF A320 compatibility mode). the game tries sequentially 480x272, 400x240 and 320x240 resolutions and chooses whatever available 
- fullscreen bilinear or bresenham upscaling from 320x200 to 480x272 or 400x240 (left shoulder turns it on/off)
- frameskip 0/1 (right shoulder)

last-mission-0.6.zip
last-mission-0.6.zip
« Last Edit: March 18, 2012, 12:37:07 pm by d_smagin »
GCW-Zero prototype, Dingoo a320, Ritmix rzx-50, Dingoo a380, Xperia Play