Jump to content
IGNORED

DS99/4a - Emulator for the DS/DSi


wavemotion

Recommended Posts

Okay... I now properly "bank" the strange 8K games like Mancala, Tutankham, etc. Those should all load and play properly on the next build.  

I've noticed the keyboard is a little glitchy... sometimes it's non-responsive when I hear a 'click' (emulator key click.. not a TI click) and sometimes it doesn't do the emulator click but the TI accepts the button.  I know what that is and will fix it now. 

  • Like 4
Link to comment
Share on other sites

4 hours ago, llabnip said:

I gave a 1 hour read of TI99Sim and Classic99's handling of disks and most of it was over my head - I was surprised that the codebase for filesystem support is larger than the actual core CPU chip stuff. That was depressing.

It doesn't have to be... a console emulator probably should only support disk images, which was a direction I did NOT want to take in Classic99. Keep your life very simple and emulator the disk controller card - it will then handle all the file format details and you need only provide a sector read and sector write. Go one step simpler and support only the sector dumps (not the track dumps), and you should be able to provide a very thin layer indeed. Check Classic99's TICCDisk.cpp for some hints (and remember it's part of a much more complicated system that you don't need).

 

EDIT: Just to follow up - I looked at TICCDisk to see what advice I was giving you, and I want to note it's even simpler than what you see there. Classic99 uses its own DSR and swaps in the disk controller only when it needs to - after it's determined a lot of information about the call.

All you need to do on your side is load the TI controller DSR at >4000, enable/disable it based on the bit at CRU address >1100 (which is 0x880 at the 9901 level), handle the sector read/write using the PC hacks I used in Classic99 (unless you want to emulate the controller IC), and software will take care of all the rest. All the code I have in there for dealing with types of calls and detecting which drive and all that goes away, it's a side effect of my patching the controller into the emulator's disk system, instead of the other way around ;)


To be brutally honest, if you have no intention of running other expansion cards, you could probably leave the DSR enabled all the time and ignore CRU, and it'll still work fine. ;)

 

 

Edited by Tursi
  • Like 3
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, llabnip said:

Okay... I now properly "bank" the strange 8K games like Mancala, Tutankham, etc. Those should all load and play properly on the next build.  

Be aware that Tut can be flakey on the best of systems. I'm not sure we ever 100% sorted out why.

 

  • Like 1
Link to comment
Share on other sites

42 minutes ago, Tursi said:

It doesn't have to be... a console emulator probably should only support disk images, which was a direction I did NOT want to take in Classic99. Keep your life very simple and emulator the disk controller card - it will then handle all the file format details and you need only provide a sector read and sector write. Go one step simpler and support only the sector dumps (not the track dumps), and you should be able to provide a very thin layer indeed. Check Classic99's TICCDisk.cpp for some hints (and remember it's part of a much more complicated system that you don't need).

That's encouraging! And sounds like something I can manage short-term.  I notice WriteTICCCRU() is not called - I assume because it would only really support 1 disk in this mode and the CRU writes wouldn't produce anything useful?

 

Edit: I just saw your edit :)  Ok... sounds pretty simple!  I'll give it a go...  

 

My goal, to be honest, is that people can play a Scott Adam's adventure on their DS handheld or Tunnels of Doom (which can be done via the hacked ToD without need of loading...).  If this TI Disk DSR does the trick, that's probably all I'll ever want to support for the little handheld.

Edited by llabnip
  • Like 3
Link to comment
Share on other sites

Progress!  I added the basic CRU handler at >1100 (system crashed if I didn't swap the DSR in/out) and some dummy register read handling to mostly report that everything is OK and Instead of 'Device Not Found', I now get "File Not Found" !

 

Next up is adding in real register read/write and see if I can't at least attempt to read a sector.

 

image.thumb.png.54410a3a77034071374f7e83fdd3a8b6.png

  • Like 5
Link to comment
Share on other sites

5 hours ago, llabnip said:

Progress!  I added the basic CRU handler at >1100 (system crashed if I didn't swap the DSR in/out) and some dummy register read handling to mostly report that everything is OK and Instead of 'Device Not Found', I now get "File Not Found" !

 

Next up is adding in real register read/write and see if I can't at least attempt to read a sector.

 

image.thumb.png.54410a3a77034071374f7e83fdd3a8b6.png

DSK1.ADVENTURE   not DSK1.  

It needs the filename

  • Like 1
Link to comment
Share on other sites

Its been about 10 years ago that i sold all my classic Nintendo and Sega stuff. Back when i was still doing DS homebrew, it was with Datel's Games n Music. I remember DS Linux, and thinking how neat that was. Never would have thought a TI emulator would be available. Almost makes me want to go get a DS again just to try this out. 🙂

Edited by jrhodes
  • Like 7
Link to comment
Share on other sites

13 hours ago, llabnip said:

Okay... I now properly "bank" the strange 8K games like Mancala, Tutankham, etc. Those should all load and play properly on the next build.  

 

I've found a couple of SSS that have problems (now I'm testing with V0.3):

 

Return to Pirate's Island: blank screen at boot screen. This could be related to bank switching, so maybe it's already fixed with your current build;

- Congo Bongo. You need to pass the first level. At second level you'll see some garbage with sprites. This seems a tipical issue, found also with MiSTer core. If it could be of any help to find the fix, this is the link on github where I have reported the problems for the core (github ti99 fpga).

 

I've noticed that there is no more the option for diagonals setup for joystick in the menu. Are now set to 8 directions by default?

 

 

  • Like 2
Link to comment
Share on other sites

Victory!  Thanks @Tursi!  A very thin layer indeed... DSR loaded with implementation for read and write registers plus Sector Read (don't have write yet).

image.png.7305117a95b6335fa8c4a63f58db6b94.png

35 minutes ago, tmop69 said:

I've found a couple of SSS that have problems (now I'm testing with V0.3):

 

Return to Pirate's Island: blank screen at boot screen. This could be related to bank switching, so maybe it's already fixed with your current build;

- Congo Bongo. You need to pass the first level. At second level you'll see some garbage with sprites. This seems a tipical issue, found also with MiSTer core. If it could be of any help to find the fix, this is the link on github where I have reported the problems for the core (github ti99 fpga).

 

I've noticed that there is no more the option for diagonals setup for joystick in the menu. Are now set to 8 directions by default?

 

 

I did check in 0.3a with the fixes for the bank switching loads... My C/G of RtPI seems to work fine but I'll test the SSS version today.

 

I'll add Congo Bongo to the list to look at...

 

Yeah, options got cleaned up for 0.3 - I left 20 spares for future improvements. I didn't have the diagonals implemented yet anyway so I pulled it off the menu. We handle UP/DN/LEFT/RIGHT and combinations that make sense (i.e. UP-LEFT for diagonals).  0.3a also fixes the keyboard glitches and keys now repeat properly - a much more solid experience.

 

 I've also added high score support for all games... you can store 10 scores per game (and it remembers your initials). 

 

Finally starting to shine :)

 

I have a lot of cleanup on the UI for disk handling and then I'll tackle the Speech Synth... then Tomy Tutor support :)

 

image.thumb.png.1f88db867d2a4290f609114b7b13b946.png

 

  • Like 5
  • Thanks 2
Link to comment
Share on other sites

5 hours ago, jrhodes said:

Its been about 10 years ago that i sold all my classic Nintendo and Sega stuff. Back when i was still doing DS homebrew, it was with Datel's Games n Music. I remember DS Linux, and thinking how neat that was. Never would have thought a TI emulator would be available. Almost makes me want to go get a DS again just to try this out. 🙂

If you do pick up a DS, my strongest recommendation is for a DSi XL/LL (the LL is just the Japanese version of the LL). The DSi has an SD card slot so you don't need to do anything other than put an exploit on some old SD card you have lying around and you're up and running Twilight Menu++ which will launch all sorts of homebrews including all 7 of my emulators. The XL/LL also has a "slower" LCD which seems to hold onto the pixels longer - almost simulating the old phosphor fade of a TV (the DS-Lite is second best in terms of fade... the original smaller DSi fades too quickly and sometimes very thin lines or bullets will be hard to see).  With Twilight Menu++ or similar launching software, the DSi will unlock the poorly commercially used 2X CPU speed that makes the homebrews really fly. The DSi also has a pixel-perfect 256x192 matching the TI VDP chip so you get exactly 1:1 pixel output in almost the right aspect ratio.  In short, you'll be able to play more than 10,000 classic 8-bit and 16-bit games.  The XL/LL run about US&75 but you can often get one under $50 if you're willing to look for defects... i.e. one that has a broken game cart reader. You don't need to play regular cart games  - you're only interested in the mostly commercially unused SD card slot on the side. 

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

15 hours ago, Tursi said:

It doesn't have to be... a console emulator probably should only support disk images, which was a direction I did NOT want to take in Classic99.

Absolutely! FIAD files are a blessing on the PC, allowing direct usage of OBJ or tokenized BASIC created on the PC, but are absolutely dispensible on a handheld game-console, where you consume existing programs. Using TiDir, TIImageTool or xdm to move files to a disk-image as a one-time action is really no problem.

  • Like 2
Link to comment
Share on other sites

10 hours ago, tmop69 said:

- Congo Bongo. You need to pass the first level. At second level you'll see some garbage with sprites. This seems a tipical issue, found also with MiSTer core. If it could be of any help to find the fix, this is the link on github where I have reported the problems for the core (github ti99 fpga).

Congo Bongo is one of the rare games that relies on the RAM mirrors in main memory. I had them disabled as it bought me a couple frames of speed to not have to mask and deal with that. Sigh... I'm at the point now where there are a few "special" games that need things like IDLE support, mirrored RAM, etc. I will probably have 2 cores... one 'FAST' and the other 'ACCURATE' and let the user change them based on the game. I can auto-detect the games I know about via file CRC and auto-set reasonable defaults. I hate to slow down the emulator (which is already marginal on the older DS hardware) for a few games. 

 

Meanwhile, the disk support is coming along nicely. You can now mount and unmount a .DSK file and the emulator supports the standard TI Disk controller at SS/SD (90KB) and DS/SD (180KB) which covers most anything someone would want to play on the little handheld.

image.thumb.png.c9cca502f98334b4d9394ba815762139.png

 

I need to add a read/write indicator on screen as a few games seem to load a bit slowly.

  • Like 6
Link to comment
Share on other sites

9 minutes ago, PeteE said:

I got it to work on my DSLite. Speed seems not too bad, is there a way to show the FPS?

Is that what I think it is you're playing? ... on emulated TI-99/4A???!!  Now that is something I'd like to check out.

 

(Sorry for the thread derail :) )

Edited by WhataKowinkydink
  • Like 1
Link to comment
Share on other sites

3 hours ago, PeteE said:

I got it to work on my DSLite. Speed seems not too bad, is there a way to show the FPS?20230108_205410.thumb.jpg.400e623f193e1ab8a27dcfd0e08d2349.jpg

Yes, just load the game. Before running it, go in Options menu and the first choice permits to show/hide the fps. Set it to On, then run the game. You'll see fps on the top-left on the bottom screen.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Version 0.4 is ready:  https://github.com/wavemotion-dave/DS994a

 

V0.4: 9-Jan-2023 by wavemotion-dave

  • Added .DSK support for 90K and 180K disks (read and write both work but write doesn't yet persist back to SD card). Use the Cassette icon in the lower left of the keyboard to mount disks.
  • Added High Score support for 10 scores per game. Use the new 'HI' button on the main keyboard.
  • Fixed loading of 8K "banked" games (Tuthankam, Mancala, etc).
  • Fixed right-side border rendering for "TEXT MODE" games (Adventure, Zork, etc).
  • Added new option to mirror console RAM. This is more accurate but slows down the emulation. Congo Bongo needs this to render level 2+ properly.
  • Added new option to turn on alpha-lock by default (useful for text adventure games)
  • Games that were hanging looking for Speech Synthesis module no longer freeze up (no voice yet but you can play them).
  • Keyboard is much less glitchy. Keys repeat properly and presses click properly and generally it's more solid all-around.
  • Other minor cleanups as time permitted.

 

Preliminary disk handling is included - you will need to have the TI Disk controller ROM in /roms/bios.  This is often called simply "disk.bin" but given that there are other emulators using the same name, please rename to 994adisk.bin to match the other console ROMs. In short, if you want a fully functional DS99/4a you would have the following 3 console ROMs in /data/bios:

* db8f33e5	994aROM.bin (8K)
* af5c2449	994aGROM.bin (24K)
* 8f7df93f	994aDISK.bin (8K) - this is needed only if you want .DSK support

To mount a disk you use the little cassette icon (yes, the irony here is not lost on me) in the lower left of the keyboard.

 

One last note... this is the first version that has lost a frame or two of performance. Slight, yes, but... but this is the cost of additional emulation accuracy. I'll get those frames back (and more!) with some optimization in the near future.

Edited by llabnip
Format...
  • Like 4
  • Thanks 2
Link to comment
Share on other sites

On 1/8/2023 at 6:16 AM, llabnip said:

If you do pick up a DS, my strongest recommendation is for a DSi XL/LL (the LL is just the Japanese version of the LL). The DSi has an SD card slot so you don't need to do anything other than put an exploit on some old SD card you have lying around and you're up and running Twilight Menu++ which will launch all sorts of homebrews including all 7 of my emulators. The XL/LL also has a "slower" LCD which seems to hold onto the pixels longer - almost simulating the old phosphor fade of a TV (the DS-Lite is second best in terms of fade... the original smaller DSi fades too quickly and sometimes very thin lines or bullets will be hard to see).  With Twilight Menu++ or similar launching software, the DSi will unlock the poorly commercially used 2X CPU speed that makes the homebrews really fly. The DSi also has a pixel-perfect 256x192 matching the TI VDP chip so you get exactly 1:1 pixel output in almost the right aspect ratio.  In short, you'll be able to play more than 10,000 classic 8-bit and 16-bit games.  The XL/LL run about US&75 but you can often get one under $50 if you're willing to look for defects... i.e. one that has a broken game cart reader. You don't need to play regular cart games  - you're only interested in the mostly commercially unused SD card slot on the side. 

So, I have a 3DS that has Twilight Menu++ already installed on it.  Are there any instructions about how to add this emulator (and the others you have) onto it?  Just wondering as someone put together the 3DS for me and I will have to augment it further on my own.  Sorry, I know that these are probably not so great questions I am asking, but seeing as how the Ti99/4a was our family's first home computer I would like to get back to exploring its software titles more that what I was able to do in the past.  Many thanks in advance for your and/or anyone else's assistance.

  • Like 1
Link to comment
Share on other sites

16 minutes ago, Hwlngmad said:

So, I have a 3DS that has Twilight Menu++ already installed on it.  Are there any instructions about how to add this emulator (and the others you have) onto it?  Just wondering as someone put together the 3DS for me and I will have to augment it further on my own.  Sorry, I know that these are probably not so great questions I am asking, but seeing as how the Ti99/4a was our family's first home computer I would like to get back to exploring its software titles more that what I was able to do in the past.  Many thanks in advance for your and/or anyone else's assistance.

No problem - it's pretty easy if you've already got TWL++ installed.

 

The instructions are contained in the readme at https://github.com/wavemotion-dave/DS994a  and I'll repeat the latest instructions here:

Installation :

  • You will need the two console BIOS files as described below. Place both .bin BIOS files into /roms/bios (you can just make the directory on your SD card).
  • You will also need the emulator itself. You can get this from the GitHub page - the only file you need here is DS994a.nds (the .nds is a Nintendo executable file). You can put this anywhere - most people put the .nds file into the root of the SD card.
  • If you want to play disk based games (Adventure, Tunnels of Doom, etc) you will need 994adisk.bin (often just named disk.bin but you need to rename it and put it into /roms/bios).
  • You will need games to play... right now the emulator supports C/D/G files and '8' non-inverted files. Basically just try loading a file to see if it works... the ROMs should have a .bin extension.
  • Recommend you put your game ROMs into /roms/ti99 as the emulator will default to that directory. That's where the cool kids keep them.
  • Recommend you put any disks needed (.dsk files) into the same directory as your ROMs until I can get a better file manager worked out.

BIOS Files :

Here are the BIOS file CRC32 hashes I'm using with all of my testing - seek these out if you want maximum compatibility. Place these into /roms/bios

* db8f33e5	994aROM.bin (8K)
* af5c2449	994aGROM.bin (24K)
* 8f7df93f	994aDISK.bin (8K) - this is needed only if you want .DSK support

All 7 of my emulators will operate basically the same... some don't need a BIOS and some do... the readme always tells you what to name it (and they always go in /roms/bios).

 

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

I spent my lunch putting as much of the TMS9900 CPU emulation into fast memory as I could. The DS has 16K of fast data memory (DTCM) and 32K of fast instruction memory (ITCM) and I was able to squeeze about half of the most common opcodes into fast memory... this gave me a solid 8-10% speedup across the board!  I decided to release 0.4a immediately as the logic is the same but it executes faster.  

 

With the recent emulation accuracy improvements, a game like TI Invaders had dropped from 62 fps (unthrottled) to 60 fps on the older DS-Lite handheld. With the new memory optimizations, it's up to 65 fps and as fast as ever!  

 

On the DSi and above running at 2x the CPU speed, a game like TI Invaders runs at 103 fps. Why is it not 2x 65 fps (=130 fps)... because like the TI99/4a, the DS is hampered by some odd downgraded bus handling (32-bit CPU but many peripherals are on the other side of a 16-bit bus) and video memory isn't any faster. 

 

I'll need all the CPU power I can get on the old handheld to deal with Speech processing.

Edited by llabnip
  • Like 3
Link to comment
Share on other sites

Just now, Asmusr said:

Is it possible to update directly from the DS?

I don't know if you can update the SD card in the DS/DSi wirelessly... but @SpiceWare (who has been a big proponent of StellaDS and has helped popularize it beyond the relative obscurity it was destined for) did figure out how to transfer files onto his SD card via some (homebrew?) software on the 3DS (running Twilight Menu++).  He might be able to illuminate. 

Link to comment
Share on other sites

7 minutes ago, llabnip said:

I don't know if you can update the SD card in the DS/DSi wirelessly... but @SpiceWare (who has been a big proponent of StellaDS and has helped popularize it beyond the relative obscurity it was destined for) did figure out how to transfer files onto his SD card via some (homebrew?) software on the 3DS (running Twilight Menu++).  He might be able to illuminate. 

I have something called Universal Updater that can update lots of homebrew software, including Twilight Menu++. Could it be integrated with that?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...