gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS homebrew announcements > Wolfenstein 3D DS --> R.O.T.T (Rise of the Triad)

#136148 - Diddl - Sun Jul 29, 2007 6:43 pm

@Lazy1

Two great ports, dsdoom and wolf3d for NDS are done fine. Is it possible to do this for ROTT also?



one of my favourite 3d shooter was Rott: klick

The engine is an enhanced variant of the Wolfenstein 3D engine. Wolf3d was developed by a Team, which is splitted into ID Software and Apogee (3d Realms).

ID Software was developing Wolf3d to Doom engine. Apogee made ROTT after Wolf3d (and later duke3d).

The Sources are available. There is a SDL port from ROTT for windows. Maybe this SDL port is a good base for a NDS port? Dsdoom also use SDL, does it?

#136153 - Diddl - Sun Jul 29, 2007 7:43 pm

I have source code of rott ports for Dreamcast, GP2x and this Icculus Linux port. I upload it if anyone want it.

Especially this GP2X port should be a good base for NDS cause of similar hardware?

#136157 - Lazy1 - Sun Jul 29, 2007 8:49 pm

I'm not sure, I was thinking of doing something original for my next project.

#136195 - Dood77 - Mon Jul 30, 2007 12:17 am

Never heard of that game, looks cool though. I would download it if it was ported... But something original in the way of an FPS would be killer!
_________________
If I use a term wrong or something then feel free to correct, I?m not much of a programmer.

Original DS Phat obtained on day of release + flashme v7
Supercard: miniSD, Kingston 1GB, Kingston 2GB
Ralink chipset PCI NIC

#136205 - Tockit - Mon Jul 30, 2007 2:32 am

I played it WAY back when. it was marginal, for a FPS.
I remember really enjoying it the first time, but when I went back and played it a few years later, I was disapointed, and seemed to remember it being better.


personaly, I'd prefere to have a solid running version of duke3D on DS - 30+ framerate, and sound. (music is whatever, but sound is essential.... how are you supposed to tell if you're actually peeing in the toilet or not?)
possibly wifi..? no, too greedy. duke3d's multiplayer protocol is SHYTE from what I recall.

or something original...? OOOO!
_________________
-01011101001010101010 (frank)

#136353 - phanboy_iv - Tue Jul 31, 2007 9:05 pm

ROTT was a very odd, but enjoyable game. The wolfenstein 3D engine it used
was heavily modified, though.

#136387 - OOPMan - Wed Aug 01, 2007 8:59 am

This topic has been discussed before and the game sources are available, but no one has actually stepped up to the task of getting it done.
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#136389 - Diddl - Wed Aug 01, 2007 9:41 am

OOPMan wrote:
This topic has been discussed before and the game sources are available, but no one has actually stepped up to the task of getting it done.


which sources are available? rott sources for a nds port? where?

#136424 - AaronBlood10 - Wed Aug 01, 2007 4:41 pm

I guess that would be pretty cool. The graphics engine on this looks a lot better than the original game. Multiplayer would be fun.
_________________
Animation program for the DS in progress
actionanimation.blogspot.com

#136425 - Metaluna - Wed Aug 01, 2007 5:00 pm

phanboy_iv wrote:
ROTT was a very odd, but enjoyable game. The wolfenstein 3D engine it used
was heavily modified, though.


It's a completely different engine designed by the great Ken Silverman (later responsible for Build engine used in Duke Nukem 3D). The 3D engine is not based on Wolfenstein 3D, but on the very first game by Ken Silverman : Ken's Labyrinth

#136426 - matriculated - Wed Aug 01, 2007 5:19 pm

I think you're confusing Duke3D with ROTT. Duke3D was by Ken Silverman. ROTT is indeed a enhancement of the Wolf3D engine. Check out wikipedia. I think there's even a cheat code that allows you to play Wolf3D in the ROTT engine.

#136433 - Lazy1 - Wed Aug 01, 2007 7:37 pm

The Duke3D sources are a nightmare, consider yourselves warned... :)
As for ROTT, porting SDL to NDS is easy enough. If someone wants to try porting it I can pass on the wolf3d ds sources if it helps any.

#136442 - benzingermany - Wed Aug 01, 2007 9:11 pm

I remember there was a mobileduke version for the zodiac.
But i don t know, if anyone got the sources or could do anything with this.

#138575 - MP2E - Sat Aug 25, 2007 9:49 pm

Really it wouldn't be all that hard to port ROTT to the DS since SDL got ported to ds already. Maybe I'll attempt it, but don't expect much from me. I'm a noob when it comes to nds programming.

#138577 - Lazy1 - Sat Aug 25, 2007 10:14 pm

The thing about porting something to the DS is that it's just too specialized to rely on a library like SDL for something like ROTT.
If you are going to invest any time in it at all you might as well go all the way.

#138597 - Jakeohagan - Sun Aug 26, 2007 10:14 am

thats a super good point and for some encouragement

ROTT epic win.
_________________
God Speed

#138615 - Diddl - Sun Aug 26, 2007 7:01 pm

There are two ROTT ports for win32. one of them is fully based on SDL lib: WinRott 1.26. I have ported it from Visual C7 to Pelles C so I know it.

The other port is WinRott 2.24 and the way was away from SDL to direct x. So maybe WinRott 1.26 is the best base for a DS port cause it works with SDL.


I have found a third ROTT port, it's a port for a mashine very similar to NDS, - it's a ROTT port for GP2x. GP2X is based on devkitpro so maybe it's very simple to make a DS port from this one.


If anyone needs one of this three ports (source code) I can give him.

#138703 - MP2E - Tue Aug 28, 2007 2:00 am

There is also this port which is platform independent which uses SDL:
http://icculus.org/rott/ I don't think it would be difficult to port this one.

#138751 - Diddl - Tue Aug 28, 2007 6:45 pm

MP2E wrote:
There is also this port which is platform independent which uses SDL:
http://icculus.org/rott/ I don't think it would be difficult to port this one.


checked out, revision 222. I give a look on it.

#138764 - Diddl - Tue Aug 28, 2007 9:46 pm

after hours of work icculus compiles fine with devkitpro r20. but now there are many open references while linking. icculus uses an audiolib which isn't available for NDS??

#138823 - MP2E - Wed Aug 29, 2007 1:42 pm

Does it work besides the sound though?

#138827 - Diddl - Wed Aug 29, 2007 3:06 pm

not yet. I solved all compiler errors and went sleeping. today after work I will try to solve this linker errors.

#138841 - Diddl - Wed Aug 29, 2007 6:59 pm

is it possible? such a simple function like itoa(), normally defined in every stdlib.h is missing in devkitpro???

#138842 - kusma - Wed Aug 29, 2007 7:12 pm

As itoa() is non-standard, yes. That is very possible.

#138844 - tepples - Wed Aug 29, 2007 7:22 pm

Diddl wrote:
is it possible? such a simple function like itoa(), normally defined in every stdlib.h is missing in devkitpro???

The function itoa() is not part of ISO C. Implementations of the C standard library are not required to implement functions that are not part of ISO C. You can use siprintf() instead, as in the following (untested) code:
Code:
char *itoa (int value, char *dst, int base) {
  const char *format;
  switch (base) {
  case 8:
    format = "%o";
    break;
  case 10:
    format = "%d";
    break;
  case 16:
    format = "%x";
    break;
  default:
    // sprintf and siprintf supports only bases 8, 10, and 16
    assert(0);
  }
  siprintf(str, format, value);
  return dst;
}

_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#138850 - Diddl - Wed Aug 29, 2007 8:37 pm

thanks for your help.


another thing, I am surprised the order of lib files makes a big difference if a function in lib_a calls a function in lib_b! I'm not sure but I don't believe it is so in other compiler environments (for example visual C)?

#138853 - Diddl - Wed Aug 29, 2007 9:12 pm

Now only a few open references are remaining: `pow'`sin'`log'`exp' `sqrt'

this mathematical functions are not in the devkitpro lib? is there a free source for this functions or a free lib available for arm9?

#138855 - tepples - Wed Aug 29, 2007 10:07 pm

Diddl wrote:
Now only a few open references are remaining: `pow'`sin'`log'`exp' `sqrt'

Three things to check for, in order:
  1. #include <math.h>
  2. Add -lm when you link. This brings in the library libm.a, which ordinarily implements the functions of math.h. In wintermute's DS makefile, you can try specifying this in the LIBS variable, around line 41: change -lnds9 to -lnds9 -lm
  3. An ARM9 CPU is like a 486SX2/66: it has no FPU. Therefore, sin(), log(), exp(), and sqrt() are done in (slow) software. Once you have the program running, consider profiling the parts that use 'float' or 'double' data types to see if you can replace them with fixed-point arithmetic.

_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#138856 - Diddl - Wed Aug 29, 2007 10:18 pm

many thanks to you tepples!

DSrott compiles and links fine now. first .nds file is build. tomorrow I will add some startup code from dsdoom source and maybe first running tests.

#138863 - thedopefish - Thu Aug 30, 2007 12:09 am

I just noticed this thread. Figures, as earlier today I managed to get my ROTT port running on the DS. I didn't realize anyone else was working on it. Oh well.

http://vespenegas.com/rott.html
_________________
#include <sig.h>

#138864 - kusma - Thu Aug 30, 2007 12:22 am

thedopefish wrote:
http://vespenegas.com/rott.html

Awesome, but the download-link for the NDS doesn't seem to work...

#138888 - Diddl - Thu Aug 30, 2007 7:22 am

at .nds file a 404 appears. but sources are ok to download.

I don't know anyone already is working on a port even though I have searched for it.

#138903 - thedopefish - Thu Aug 30, 2007 1:32 pm

Oops. That's what I get for shuffling files around at the last minute. Download link should be fixed now.
I've also added a .ZIP with everything you need, to make it easier to get up and running.
_________________
#include <sig.h>

#138917 - Diddl - Thu Aug 30, 2007 7:01 pm

Hi Dopefish, wonderful wonderful!!!

A dream comes true! My most favorite 3d shooter from this time runs on my NDS.

I love this port. I was not sure it is possible cause they spoke about 8MB RAM. But it runs nearly perfect. I am thrilled about your work.

Do you continue this work to get sound and maybe music running also?

#138926 - thedopefish - Thu Aug 30, 2007 9:21 pm

New version up that fixes saving/loading, and improved touchscreen support.

Diddl: Glad to hear it's working for you. If you're able to make any progress on the sound, that would be fantastic.

About the RAM: the original system requirements claimed a 386DX/40 with 4MB, recommended 8MB. It's a tight squeeze on the DS though--without trying to optimize the memory usage at all, I've only got about 100KB free.
_________________
#include <sig.h>

#138927 - Metaluna - Thu Aug 30, 2007 9:32 pm

As a matter of fact, I owned a 386DX-40 with 4MB, and I remember playing ROTT on it, but I had to lower the screen size in order to have a smooth gameplay. ^^

Now, I'm really amazed to be able to play it on my DS thanks to you!

#138928 - Doom5 - Thu Aug 30, 2007 9:56 pm

VGA games also just didn't have any 2d acceleration hardware available to them. Everything was just blitted(sp?) to the screen, requiring more cpu processing power, and memory, correct?

#138946 - tepples - Fri Aug 31, 2007 1:32 am

But does this port use the 3D hardware yet? If it's SDL based, it probably uses the same software 3D engine that the PC version uses. Changing this to use GL and moving the textures out of main RAM into VRAM banks A-D might free up some main RAM.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#138956 - Diddl - Fri Aug 31, 2007 7:26 am

tepples wrote:
But does this port use the 3D hardware yet? If it's SDL based, it probably uses the same software 3D engine that the PC version uses. Changing this to use GL and moving the textures out of main RAM into VRAM banks A-D might free up some main RAM.


There already a GL version of Rott exists (WinRottGL) as a open source Port.

#138980 - Doom5 - Fri Aug 31, 2007 12:17 pm

I found another OPL2/OPL3 emulator besides the one in the MAME sources. This one is by Ken Silverman, famous for Ken's Labyrinth and the BUILD engine here http://www.advsys.net/ken/ksmsongs.zip

Might be fast enough to run on the Arm 7?

#138985 - Diddl - Fri Aug 31, 2007 1:43 pm

looks good, this ksmwin utility source ("emulates adlib hardware on windows") sounds good. maybe exactly what we need for Rott music.

#138989 - Doom5 - Fri Aug 31, 2007 2:22 pm

Diddl wrote:
looks good, this ksmwin utility source ("emulates adlib hardware on windows") sounds good. maybe exactly what we need for Rott music.


Could possibly either use the utility source to convert the adlib samples to adpcm, then have wolf3d DS play them, or if the conversion engine is fast enough to emulate the adlib hardware in realtime on the arm7, that would be far cleaner.

#138991 - Diddl - Fri Aug 31, 2007 2:26 pm

sounds cool with the windows player. like my good old adlib.

i will try to make it run on our ARM7 with a fifo to ARM9 so all adlib register work as a real adlib. so the original gamecode simply can used for playing the music.

hope that 33MHz are enough for a fm synthese - opl3 emulation.

#139011 - Diddl - Fri Aug 31, 2007 6:44 pm

This windows player doesn't run on a modern 32 bit c compiler. It is compilable and it is playing - ANYTHING. but it sounds not in the same manner as this .exe file from the archive.

maybe cause integers are 32 bit and not 16 bit wide? I don't understand the code, but I will analyse it a while.

#139025 - Diddl - Fri Aug 31, 2007 8:31 pm

there is assembler code in it. why? could anyone translate this x86 code into C or ARM assembler?

Code:
   static _inline void clipit8 (float f, int32_t a)
{
   _asm
   {
      mov edi, a
      fld dword ptr f
      fadd dword ptr fakeadd
      fstp dword ptr fpuasm
      mov eax, fpuasm
      test eax, 0x007fff00
      jz short skipit
      shr eax, 16
      xor eax, -1
skipit: mov byte ptr [edi], al
   }
}

static _inline void clipit16 (float f, int32_t a)
{
   _asm
   {
      mov eax, a
      fld dword ptr f
      fist word ptr [eax]
      cmp word ptr [eax], 0x8000
      jne short skipit2
      fst dword ptr [fpuasm]
      cmp fpuasm, 0x80000000
      sbb word ptr [eax], 0
skipit2: fstp st
   }
}

#139028 - Sunray - Fri Aug 31, 2007 9:07 pm

If you get rid of all floats it might be fast enough.

#139036 - thedopefish - Fri Aug 31, 2007 10:21 pm

New version up (0.4), this one supports the registered version of ROTT.

There's now separate .NDS file for shareware vs registered versions.

If you own the full game, you just need to copy your DARKWAR.* files to the /ROTT directory. If you don't want to keep the shareware version (it's a different level set, so you might want to), you can remove the HUNTBGIN.* files.
_________________
#include <sig.h>

#139048 - Doom5 - Sat Sep 01, 2007 12:30 am

Diddl wrote:
there is assembler code in it. why? could anyone translate this x86 code into C or ARM assembler?

Code:
   static _inline void clipit8 (float f, int32_t a)
{
   _asm
   {
      mov edi, a
      fld dword ptr f
      fadd dword ptr fakeadd
      fstp dword ptr fpuasm
      mov eax, fpuasm
      test eax, 0x007fff00
      jz short skipit
      shr eax, 16
      xor eax, -1
skipit: mov byte ptr [edi], al
   }
}

static _inline void clipit16 (float f, int32_t a)
{
   _asm
   {
      mov eax, a
      fld dword ptr f
      fist word ptr [eax]
      cmp word ptr [eax], 0x8000
      jne short skipit2
      fst dword ptr [fpuasm]
      cmp fpuasm, 0x80000000
      sbb word ptr [eax], 0
skipit2: fstp st
   }
}



Shouldn't you be looking at the adlibemu.c? There's really no point at looking at the windows and dos player source code.

#139065 - Diddl - Sat Sep 01, 2007 10:53 am

this assembler code comes from adlibemu.c. if we want to port this code to ARM7 we need to port this x86 assembler code also.

#139066 - Diddl - Sat Sep 01, 2007 10:57 am

thedopefish wrote:

There's now separate .NDS file for shareware vs registered versions.


Nice that now registered is working also. Maybe we need a third version for extreme rott or we need a small wad selection menu like dsdoom has.

all is working perfectly now. v0.2 had a problem with timed gates but v0.3 is ok. I have tested first four shareware levels including nearly all hidden rooms.

#139172 - Tockit - Mon Sep 03, 2007 2:35 am

thedopefish wrote:
New version up that fixes saving/loading, and improved touchscreen support.


I can't seem to get the touchscreen mouse-looking to work on neither my r4tf nor my m3 perfect. I found it in the options, but when it is enabled, you can only strafe left and right, with no turning.
_________________
-01011101001010101010 (frank)

#139187 - Diddl - Mon Sep 03, 2007 8:03 am

you have to configure the keycodes for up and down in the options menu.

#139248 - Tockit - Mon Sep 03, 2007 11:21 pm

Diddl wrote:
you have to configure the keycodes for up and down in the options menu.


I'm sorry, could you be more specific..?
hopefully lots more..
_________________
-01011101001010101010 (frank)

#139313 - thedopefish - Tue Sep 04, 2007 2:39 pm

By default, the mouse in ROTT controls turning left/right and walking forward/backward (like in Wolf3D and Doom).

The "mouselook mode" option I added changes this, so that moving the mouse only adjusts your aim (like is common in most FPS games newer than Quake 1). Mouselook mode also remaps left and right on the D-pad to strafing instead of turning, so that the arrow keys control all your movement while the mouse controls all your aiming.

You can remap all the buttons in either mode by going to Customize Keyboard in the options menu. NOTE: if you screw up the controls too bad, you can always delete the CONFIG.ROT file on your memory card, and the next time you start the game it will reset to the default controls.
_________________
#include <sig.h>

#139314 - kusma - Tue Sep 04, 2007 3:07 pm

Here's the code for clipit8 with some comments:

Code:
static _inline void clipit8 (float f, int32_t a) /* a is actually a pointer (bad coding practice) */
{
   _asm
   {
      mov edi, a

      /* do an fpu-add and store the floating-point value */
      fld dword ptr f
      fadd dword ptr fakeadd /* the value of "fakeadd" is most likely quite high, to force a given exponent. Not robust for values of f above fakeadd, but this is extremely unlikely to happen */
      fstp dword ptr fpuasm
      mov eax, fpuasm
      
      /* check top mantissa bits (only want lower 8, exponent already set by the previous value) */
      test eax, 0x007fff00
      jz short skipit /* no clipping needed */

      /* clip sample. I haven't yet figured out this part... */
      shr eax, 16
      xor eax, -1

skipit: mov byte ptr [edi], al /* return bottom 8 bits */
   }
}


Anyway, something like this should do for a c-version:

Code:
static inline void clipit8(float f, u8 *addr)
{
   union {
      float f;
      u32 i;
   } u;
   
   f += fakeadd;
   u.f = f;
   if (0 != u.i & 0x007fff00)
   {
      u.i = (u.i >> 16) ^ -1;
   }
   *addr = u.i;
}


edit: I've got the rest now. The value of fakeadd should be ~2^24, and the shift+xor is some really clever bit-trickery :)

edit2: After looking at the 16bit version, I believe I made an error; It seems like the data is NOT in a 0..1 (or -1..1) range as I assumed. The fakeadd-value might be something entirely different :)

#139366 - Diddl - Wed Sep 05, 2007 7:19 am

I see you give your best effort. I think it's worth the trouble. It would be very nice for some nds ports to have a OPL2 emulation, cause many games were working with adlib sound.

I thank you for your work! hope it will be possible to do it.

#139381 - Tockit - Wed Sep 05, 2007 5:17 pm

thedopefish wrote:
By default, the mouse in ROTT controls turning left/right and walking forward/backward (like in Wolf3D and Doom).

The "mouselook mode" option I added changes this, so that moving the mouse only adjusts your aim (like is common in most FPS games newer than Quake 1). Mouselook mode also remaps left and right on the D-pad to strafing instead of turning, so that the arrow keys control all your movement while the mouse controls all your aiming.

You can remap all the buttons in either mode by going to Customize Keyboard in the options menu. NOTE: if you screw up the controls too bad, you can always delete the CONFIG.ROT file on your memory card, and the next time you start the game it will reset to the default controls.


I most definitely understand this all - the problem I'm having is that when I set the "mouselook" mode to "on", I get no response from my touch screen. no turning, or looking up and down. I'm left with only my d-pad to strafe and walk forward/backward. same results on both my r4 and m3 perfect. has anyone gotten the touchscreen to work with this port? is this tested?
_________________
-01011101001010101010 (frank)

#139384 - Diddl - Wed Sep 05, 2007 5:35 pm

Tockit wrote:
has anyone gotten the touchscreen to work with this port? is this tested?


no, it doesn#t work for me at 0.4 version

#139390 - emuflux - Wed Sep 05, 2007 8:24 pm

I had to register just to say a big THANK YOU for RoTT on the DS.

I can't wait for sound support and keep up the great work!

#139403 - Lazy1 - Wed Sep 05, 2007 9:57 pm

I'm not sure how ROTT does music but since you have a GPL license you can always go the route of MP3s.
What I plan on doing for Wolfenstein is to try to get in contact with someone at ID to get permission for me to re-license Wolfenstein 3D DS under the GPL.
When that is done I will add an MP3 decoder and provide tools for converting the game music to MP3, alternatively your own music could be used in place.

No luck finding any email address on their site, one comes close but that is for licensing game engines to companies.

#139404 - thedopefish - Wed Sep 05, 2007 10:32 pm

The mouselook option does work for me (though I've got a number of builds lying around, and it might not be working in the 0.4 release). I'll see if I can fix that up for the next version.

I'd also like to say that I'm making some progress on supporting sound effects. Nothing ready to release yet, but it's looking promising.

ROTT's music is in MIDI format. I'd like to be able to use it directly, since that's the cleanest solution (and doesn't require any extra files on your memory card). However if that doesn't work out I am able to extract the files, run them through timidity on my desktop, and convert to MP3 or whatever. Audio isn't really my forte (especially on the DS), so if anyone has any suggestions (or better yet, source code) for how to implement music, please let me know.
_________________
#include <sig.h>

#139445 - Diddl - Thu Sep 06, 2007 7:35 am

rott music is not clean midi, it's a OPL2 data stream. most old dos games used this kond of music, cause former sound hardware mostly supports adlib sound chip.

timidy is ported to NDS with this SDL-mixer lib from GPF. it doesn't work for me in the moment but I am working on this things. maybe timidy need too much performance for our NDS.

maybe we get this OPL2 emulator working. with this OPL emu all games like wolfenstein, doom and rott has music!

#139499 - Diddl - Thu Sep 06, 2007 8:59 pm

this is the solution for the adlibemu:

Code:
static void clipit8(float f,unsigned char *a) {
    f/=256.0;
    f+=128.0;
    if (f>254.5) *a=255;
    else if (f<0.5) *a=0;
    else *a=f;
}

static void clipit16(float f,short *a) {
    if (f>32766.5) *a=32767;
    else if (f<-32767.5) *a=-32768;
    else *a=f;
}

#139504 - Doom5 - Thu Sep 06, 2007 9:51 pm

Good work Diddl! If you can get it implemented, that would be fantastic. If not, Lazy1, had already tried getting the MAME opl2 emulator to work with Wolf3d, but it was too slow.

I can't imagine it being difficult for him to try Ken Silverman's emulator instead.

#139656 - Diddl - Sat Sep 08, 2007 5:29 pm

This KSM player now run on my NDS. But NDS math functions are too slow. for samplerate of only 11KHz and 1 channel (mono) the calculation of the sample buffer take more time than playing it. And it runs at ARM9 in the moment! The ARM7 take a lot more time for this.

But now it would be possible to calculate all music files to pcm16 files by the nds itself. After program start it checks for this files and if not existing (first time start) it calculates the files.

#139670 - MechaBouncer - Sat Sep 08, 2007 8:12 pm

So it converts it on the DS itself? Ingenious! But does that mean that you can delete the original files after they're converted so that they're not taking up extra space?
_________________
Cobalt/Black NDSL
CycloDS Evolution (firmware 1.55 BETA 3) and EZFlash 3-in-1
Kingston SD-C02G JAPAN 2GB MicroSD
MoonShell 1.71, DSOrganize 3.1129, QuakeDS Pre3, ScummVM DS 0.11.1, Pocket Physics 0.6, OpenTyrian DS 0.3

#139673 - Doom5 - Sat Sep 08, 2007 8:15 pm

Diddl wrote:
This KSM player now run on my NDS. But NDS math functions are too slow. for samplerate of only 11KHz and 1 channel (mono) the calculation of the sample buffer take more time than playing it. And it runs at ARM9 in the moment! The ARM7 take a lot more time for this.

But now it would be possible to calculate all music files to pcm16 files by the nds itself. After program start it checks for this files and if not existing (first time start) it calculates the files.


Sounds like a good solution! The program could prompt you once, asking you if you want music support, and it would tell you that it would need to process the music files, but only on the first run. There could also be the option of a pc conversion program.

Great news! :)

Would any arm assembley/lookup tables help with ARM's deficiencies?

#139675 - Diddl - Sat Sep 08, 2007 8:42 pm

MechaBouncer wrote:
So it converts it on the DS itself? Ingenious! But does that mean that you can delete the original files after they're converted so that they're not taking up extra space?


this makes no sense cause KSM are the better format than PCM, it needs a lot less space. PCM is the only way cause ARM has no math sub processor.

KSM is like a source file, no one would delete the source file.

this KSM was only a example to show if fm modulation can or cannot be done in real time.

Doom5 wrote:
Sounds like a good solution! The program could prompt you once, asking you if you want music support, and it would tell you that it would need to process the music files, but only on the first run. There could also be the option of a pc conversion program.

yes, first time you start dsdoom, rott or wolfenstein3d we could extract music from wad file for later use.

Doom5 wrote:
Would any arm assembley/lookup tables help with ARM's deficiencies?

maybe, for me not possible to do anything in assembler ... :-(

but maybe it would help to change all float in long integer or to make tables for math calculation.

#139689 - Lazy1 - Sat Sep 08, 2007 10:25 pm

Seems like a lot of work for something that won't be too fast.
I suggest you do something like I will be doing for Wolfenstein...

PC:
1) Extract music (getimfs tool)
2) Emulate music (imf2raw tool)
3) Convert music to adpcm (sox, ffmpeg, ect...)

NDS7:
1) Decode adpcm stream
2) Play adpcm stream

At 22KHz the music sounds fine in adpcm format and the filesize is about 1MB for a minute long song.
This way you can also let users supply their own music.

You even have a headstart since you can use almost any GPL MP3 decoder, there is even code on this forum to do so.

#139745 - HtheB - Sun Sep 09, 2007 6:59 pm

Lazy1 wrote:
porting SDL to NDS is easy enough.
Check out this cutie then :)


Streets of Rage Remake
(Uses SDL ;) )


Check this out:
http://bombergames.net/

http://bombergames.net/forum/viewtopic.php?t=1012
_________________
check out my projects:
http://www.HtheB.com
Donations are welcome ^^

#140243 - thedopefish - Fri Sep 14, 2007 7:54 pm

Good news, Triad fans.

I just posted a new version with sound support.

As an added bonus, you can even have music too. I took roughly the same approach Lazy1 described: extracting the music from the game, and converting it to ADPCM on a PC. I've noticed a few glitches with the music playback (which are probably fixable), but it seems to work pretty well. Unfortunately it does require a bit of extra work, and more space on your SD/CF card. Please see the website and/or Readme file for full details.

I can confirm that the touchscreen mouselook option is working in this release (at least for me). If any of you are still having problems with it, let me know.

Get it at the usual place,
http://vespenegas.com/rott.html
_________________
#include <sig.h>

#140254 - Diddl - Fri Sep 14, 2007 8:58 pm

Really great, very nice job! Rott makes fun without sound. But Rott make much more fun WITH SOUND!

Music doesnt work perfectly but it works. Registered version makes a terrible sound if music of shareware exists and you start a new game. Sometimes the game crashes while pressing select (menu doesn't come in this case).

Sometimes sound doesn't appear. for example broken glass. Then after a while it comes back. Too less sound channels?


Thank you for this great build 0.5.

#140256 - Lazy1 - Fri Sep 14, 2007 9:00 pm

Good work on getting music.
Unfortunately I cannot use your code but ADPCM decoders are easy enough to write :)

Though I wonder why you are decoding it on the arm9.

#140281 - thedopefish - Sat Sep 15, 2007 12:17 am

My original thought was to do the decoding on the ARM7 (and I'd prefer it that way), but it was easier for me to get it working this way, and I've got enough CPU power to spare on the ARM9.
_________________
#include <sig.h>

#140300 - matriculated - Sat Sep 15, 2007 4:55 am

Version .5 is working great! Thank you for porting this - I bought this game long ago but never got around to playing it because Doom was so fun.

The stylus control is really good - I wish the Doom port had this!

Is it normal that some graphics are being displayed improperly? Eg. The bottom half of the spinning Apogee logo in the begining is solid black. The cutscene pictures after picking a difficulty level are cut off about 2/3 of the way down - you can still see the difficulty level menu but the colour palette is messed up.

Maybe it's my copy of the game...

#140326 - Diddl - Sat Sep 15, 2007 10:36 am

This crash problem is a z_alloc() problem. On registered level 4 episode 1 you only have to run some rooms and then go into the menu with <Sel> ==> crash with an z_malloc() error and player position and angle.


Could we use a slot 2 ram expansion? there are 16MB and 32MB expansions and all is better than only 4MB main memory.

#140354 - thedopefish - Sat Sep 15, 2007 4:09 pm

matriculated wrote:
Is it normal that some graphics are being displayed improperly? Eg. The bottom half of the spinning Apogee logo in the begining is solid black. The cutscene pictures after picking a difficulty level are cut off about 2/3 of the way down - you can still see the difficulty level menu but the colour palette is messed up.


Those are known issues. I'm not quite sure what the cause is, but it's unobtrusive enough that I haven't spent any time trying to track it down.

Diddl wrote:
This crash problem is a z_alloc() problem. On registered level 4 episode 1 you only have to run some rooms and then go into the menu with <Sel> ==> crash with an z_malloc() error and player position and angle.


I've gotten a handful of Z_Malloc() crashes in the past few days as well. I am pushing the memory limit with this port, but it should be possible to run with just 4MB. I'll try shuffling some things around and see what I can do. At the very least, it would be better to shut down music or something like that in a low memory situation, rather than crash.
_________________
#include <sig.h>

#140371 - Lazy1 - Sat Sep 15, 2007 8:00 pm

I assume that ROTT renders to a 320x240 memory buffer which is then copied to the screen...
It would take a lot of work, but changing the resolution to 256x192 would save quite a bit of memory and give a nice speed boost.

#140563 - NorQue - Mon Sep 17, 2007 4:22 pm

Just wanted to note that ROTTDS didn't work with my Supercard Lite using the regular sclt.dldi, but it worked quite fine with barni's scrb.dldi from here.

Before I used to get this Error message:
Code:
Could not find an end time for a clock linked item at x=1 y=93 Episode = 1
Area = 1

#140936 - thedopefish - Thu Sep 20, 2007 8:46 pm

New version out that should fix (or at least help with) the out-of-memory errors.

http://vespenegas.com/rott.html
_________________
#include <sig.h>

#140943 - Diddl - Thu Sep 20, 2007 9:09 pm

thedopefish wrote:
New version out that should fix (or at least help with) the out-of-memory errors.


fine, will test it tomorrow.


EDIT: it wasn't possible for me to wait so long. it works great, no more z_malloc() error and maybe better sound. and yes, less grafic failure - no rectangle below apogee logo.

#146646 - thedopefish - Fri Dec 07, 2007 5:37 am

It's been a while since my last update, so I figured it's time to put out a new release. This one adds MissileCam support and improves music playback.

I was hoping to get networking in for this release as well, but I've hit a roadblock and didn't feel like delaying the other changes any longer.

Get it at the usual place.
_________________
#include <sig.h>

#146698 - Diddl - Fri Dec 07, 2007 9:39 pm

very good news. I had a fear you don't continue this wonderful project.


It would be nice to have cheat codes. I have played 27 levels (all 3 episodes) with every secret place.

I cannot continue to episode 4 cause this black robot at the end of the last e3 level. cannot beat this black robot. e4 would be cool, I tested it on my PC.