Jump to content
IGNORED

DS99/4a - Emulator for the DS/DSi


wavemotion

Recommended Posts

4 minutes ago, Sergioz82 said:

I had a lot of garbage I didn't even remember why it was in there..

I haven't used the DS in years, so same here ... I can't tell you what I configured years ago, but I remember that in the Launcher configuration is a "Run mode". I activated "Patch" there to run homebrew.

 

Where can I see which version of the OS I am running?

 

Link to comment
Share on other sites

11 minutes ago, SteveB said:

I haven't used the DS in years, so same here ... I can't tell you what I configured years ago, but I remember that in the Launcher configuration is a "Run mode". I activated "Patch" there to run homebrew.

 

Where can I see which version of the OS I am running?

 

I checked, patch mode is active.

 

I have no idea where you can see the version. If you still have the original cd maybe there's a changelog of something. 

 

I don't know what mine was either. I know now just because it's the zip name :)

Edited by Sergioz82
Link to comment
Share on other sites

An update... spent most of the long weekend (it's a holiday here in the US for me today) working on the core re-write. I'm about 30 hours in with 10 hours each day.  The TMS9901 peripheral IO is 100% re-written and the TMS9900 CPU is about 30% re-written. I've converted to a jump-table and am using the cycle timing and status table handling from Classic99 with some neat ideas from @PeteE's BuLWiP. Otherwise I'm using the TMS9900 data manual to figure things out.  Every time I make progress, I stumble on a new bug that needs squishing... but it's always two steps forward even if sometimes it's one step backwards.

 

If anyone wants a private build to help me ferret out defects, please let me know.  I figure I'm about a week away from a re-written CPU ... I'm calling it DS99-TurboCore :)  No... not really. Though it is catchy in a dull-witted way.

 

Let's hope I have some energy after this re-write to work on other features. Right now I'm burning out a bit.

Edited by llabnip
  • Like 5
  • Thanks 4
Link to comment
Share on other sites

Guys... are there any acid-test ROMs to help test TMS9900 opcodes?  I think the re-write is going well, then some random game has a problem and I have to backtrack looking at what I did wrong and it usually comes down to some odd handling of some instruction.  I'm using a set of ROMs that I think is hitting the emulation pretty hard, but would be great if there was a tester that could be run. Obviously if some basic instructions aren't working, the test program itself wouldn't run... but I'm beyond that and am looking for edge cases. 

  • Like 1
Link to comment
Share on other sites

Link to comment
Share on other sites

@PeteE - the CPU tests are brilliant!  Just what I needed... I found and fixed no fewer than 7 issues - mostly cut and paste as I build up my instruction set and then copy paste (e.g. dec is really like s=subtract) but sometimes byte-to-word versions have different flag treatment (mostly around the parity bit for byte versions of the instruction).  This probably saved me dozens of hours of debug!

 

 

image.thumb.png.ebf8f233d6b76fd38518dc54d803025f.png

  • Like 8
Link to comment
Share on other sites

Thanks @Ksarul - that works!

 

Sounds like there isn't much in the way of 1MB carts out there ... 

 

Which leaves me with a question. Supporting a 512K cart I've still got 512K of easily available general RAM (plus some extra for new features I want to add).

 

Assuming you (a hypothetical you... basically anyone reading this) had 512K of RAM to play with, what would you utilize it for?  Extra cart space seems not very useful. Maybe SAMS? Or some kind of UBERGROM support? Or some combo?  Or something I've not yet read about?  I'm a little hesitant on something like SAMS since the very few things that seem to take advantage of it tend to utilize larger disks (360K) and right now I'm only able to support the original TI controller and 90/180K.  

 

Mostly looking for advice on how to best allocate this extra chunk of memory.  Any thoughts welcome.

 

  • Like 3
Link to comment
Share on other sites

13 minutes ago, llabnip said:

Thanks @Ksarul - that works!

 

Sounds like there isn't much in the way of 1MB carts out there ... 

 

Which leaves me with a question. Supporting a 512K cart I've still got 512K of easily available general RAM (plus some extra for new features I want to add).

 

Assuming you (a hypothetical you... basically anyone reading this) had 512K of RAM to play with, what would you utilize it for?  Extra cart space seems not very useful. Maybe SAMS? Or some kind of UBERGROM support? Or some combo?  Or something I've not yet read about?  I'm a little hesitant on something like SAMS since the very few things that seem to take advantage of it tend to utilize larger disks (360K) and right now I'm only able to support the original TI controller and 90/180K.  

 

Mostly looking for advice on how to best allocate this extra chunk of memory.  Any thoughts welcome.

 

With SAMS you'll add support for some SSS that requires it. Add the Gram Kracker if you want to support a card used in '80s. Fun, but not really needed.

 

  • Like 2
Link to comment
Share on other sites

4 hours ago, llabnip said:

Thanks @Ksarul - that works!

 

Sounds like there isn't much in the way of 1MB carts out there ... 

 

Which leaves me with a question. Supporting a 512K cart I've still got 512K of easily available general RAM (plus some extra for new features I want to add).

 

Assuming you (a hypothetical you... basically anyone reading this) had 512K of RAM to play with, what would you utilize it for?  Extra cart space seems not very useful. Maybe SAMS? Or some kind of UBERGROM support? Or some combo?  Or something I've not yet read about?  I'm a little hesitant on something like SAMS since the very few things that seem to take advantage of it tend to utilize larger disks (360K) and right now I'm only able to support the original TI controller and 90/180K.  

 

Mostly looking for advice on how to best allocate this extra chunk of memory.  Any thoughts welcome.

 

512k is fine for 99% of carts.. the only ones that use more are multicarts and ones that use more than 1mb (dragon's lair and bad apple both of which need LOTS more)

sams support is better 

tipi would be cool too 

  • Like 4
Link to comment
Share on other sites

Ok... last night I added SuperCart 8K, Mini-Memory 4K and preliminary SAMS support.

 

The SC8 and MM4 are working fine... the SAMS seemed to be working fine at 128K, 256K and 512K via @jedimatt42's excellent memory checker 2.2a:

 

image.thumb.png.717cb7de82252e25031ed141e344e85b.png

 

However... when I run something like Dungeons of Asgard, it quickly fails (if I disable SAMS I get the "128K Memory Required" (or similar)).

 

I can see the memory test hammering banks... it tries to enable unused banks and I properly return 0xFF on fetches there... With DOA, I see it try to enable memory banks and then it fails.

 

Let me ask a basic question... does the 'pass-thru' mode just utilize the first 32K of the SAMS memory (i.e. 'normal memory expansion') or does it really pass-thru to the system (where I should... maybe return 0xFF if I didn't have anything mapped in >2000 low area or >A000 high area)?

 

Any thoughts of any kind - a small clue goes a long way on debug!

 

 

  • Like 3
Link to comment
Share on other sites

28 minutes ago, llabnip said:

Let me ask a basic question... does the 'pass-thru' mode just utilize the first 32K of the SAMS memory (i.e. 'normal memory expansion') or does it really pass-thru to the system (where I should... maybe return 0xFF if I didn't have anything mapped in >2000 low area or >A000 high area)?

 

The pass-through or transparent mode:

Bank   Description
-----  -----------
>0002  4K @ >2000
>0003  4K @ >3000
>000A  4K @ >A000
>000B  4K @ >B000
>000C  4K @ >C000
>000D  4K @ >D000
>000E  4K @ >E000
>000F  4K @ >F000

 

Thierry’s site has a pretty detailed discussion. @FALCOR4, @Ksarul, and a few others will have more detailed information than I.

 

...lee

  • Like 3
Link to comment
Share on other sites

Holy hell, @Asmusr - that's impressive!  It pushes my poor little DSi to the point of almost melting :)

 

It didn't run at 128K but did at 256K... which I assume is the minimum SAMS memory needed?  I mainly ask because I've had to do the SAMS memory the "hard way". The right way would be to just adjust a map pointer to index into the right spot of expanded memory whenever a memory read takes place... but that comes at a cost in performance on my little handheld (the same cost I incurred with banked cart handling).  Since so few games require SAMS memory, I instead actually move 4K blocks in and out of main memory - this keeps non SAMS games running bullet-fast even on the oldest DS 67MHz CPUs. 

 

Dungeons of Asgard runs fine - well over 60 frames per second unthrottled. 

 

Texcaster is a lot more up and down... from 50-70 frames per second rendering on the DSi depending on what's being drawn. And I hear the music slow down in spots... though maybe the game itself is causing that.

 

Anyway, I have 128K of semi-fast memory available and although I'll probably support the SAMS at 512K... only the first 128K will be fast and the other 384K will be slower... still, it should work! And for games like DOA, the entire game will be in fast memory.

 

By the way - DOA is right up my alley. Love it so far!

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

It is done.

 

I'm pleased (and tired!) to release version 0.6 at: https://github.com/wavemotion-dave/DS994a

 

It took more than 50 hours of re-write but the CPU core has been replaced. When I started this whole project (pre version 0.1), Tunnels of Doom was running at less than 50 fps.  When I started the core re-write (post version 0.5), I had optimized the core such that ToD was running at 100 fps (unthrottled).  After the core re-write:

 

image.png.baaee681a5116547b1d847be0ea65425.png

 

I'm not a Rocket-Surgeon, but that's a solid 20% speed improvement.  98% of the games should run at full speed now on the older DS hardware (even via R4 flash cart). 

 

I've also made a number of improvements to the disk system and added some new memory expansion options because... why not.

 

V0.6: 21-Jan-2023 by wavemotion-dave

  • Re-write of the CPU core. It's 20% smaller and 20% faster.
  • Added ability to list disk contents so you can see what programs are on it.
  • Added write-backing of .DSK files. When disk contents change, the file is written out in the background.
  • Added SAMS 512K expanded memory support - must be enabled in OPTIONS on a per-game basis.
  • Added new cartridge types to support SuperCart 8K, MiniMemory 4K and Milton Bradley MBX carts (with and without special 1K RAM).
  • New splash screen... new logo icon... a fresh start!

I'd like to thank all the fine folks here at AA who have been supporting this hobby project on the DS - most especially @Tursi who was kind enough to let me crib a bit of the CPU code (though I did try to write as much of the core myself as possible). 

 

If you use this emulator, please report any bugs or other odd behaviors. There's almost no chance I didn't introduce something odd with the re-write...

 

Time to sit on the couch and nap for the day.. waking up just long enough to enjoy a few games of Tunnels of Doom on the venerable DS handheld. 

image.png.af66922d8ebee6cbf69d770e7a1e4cef.png

 

Edited by llabnip
  • Like 4
  • Thanks 6
Link to comment
Share on other sites

20 hours ago, llabnip said:

Texcaster is a lot more up and down... from 50-70 frames per second rendering on the DSi depending on what's being drawn. And I hear the music slow down in spots... though maybe the game itself is causing that.

I don't think there's any slow down on real hardware. Also note that the sky/ground textures are missing, and most of the monsters, I think, because there is only 512K SAMS (1M required).

  • Like 3
Link to comment
Share on other sites

8 minutes ago, Asmusr said:

I don't think there's any slow down on real hardware. Also note that the sky/ground textures are missing, and most of the monsters, I think, because there is only 512K SAMS (1M required).

Ah! Okay...  I can actually support a 1MB SAMS but it chews up most of the rest of my memory resources on the oldest DS hardware. On the DSi, Nintendo gave 4x the RAM (16MB vs 4MB) and I'd have plenty of space to handle that... so the SAMS 1MB might be relegated to the DSi and above (2DS/3DS) and the SAMS 512K would be the max on the older DS hardware.  That's probably not a bad compromise.  So many people have an old DS lying around that they (or their kids) haven't used in a decade+ ... so I always try to support the oldest hardware I can.

  • Like 5
Link to comment
Share on other sites

40 minutes ago, llabnip said:

Ah! Okay...  I can actually support a 1MB SAMS but it chews up most of the rest of my memory resources on the oldest DS hardware. On the DSi, Nintendo gave 4x the RAM (16MB vs 4MB) and I'd have plenty of space to handle that... so the SAMS 1MB might be relegated to the DSi and above (2DS/3DS) and the SAMS 512K would be the max on the older DS hardware.  That's probably not a bad compromise.  So many people have an old DS lying around that they (or their kids) haven't used in a decade+ ... so I always try to support the oldest hardware I can.

For me that would be fine since I have a 3DS. 🙂

  • Like 4
Link to comment
Share on other sites

20 minutes ago, Asmusr said:

For me that would be fine since I have a 3DS. 🙂

If you're running via Twilight Menu++ or similar menu launcher, you would have full access to the extended 16MB of DSi memory - and yes, it would be fine :)

 

If you're running via an R4 cart or similar and not via Twilight Menu++ the homebrews will always run in DS legacy mode with only 4MB usable.  I never quite understood why this was... 

 

Anyway - I woke from a brief nap to play Dungeons of Asgard and realized very quickly that it needed the > key to descend. And I didn't include that on the stock keyboard graphic... shame on me!  So it wasn't really Dungeons of Asgard but just Asgard.   

I've fixed that and added the few missing TI keys with 0.6a that I just checked in.

 

Back to playing... and napping...

Edited by llabnip
  • Like 3
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...