DOS Emulator with Debugger / Memory View

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

rludlamjr
Posts: 7
Joined: Tue Mar 02, 2021 8:03 am

DOS Emulator with Debugger / Memory View

Post by rludlamjr »

Hi all,
I'm working on a new homebrew NES game and part of what I'm hoping to do is develop in DOS on my old 486 with a CRT using CA65 ASM (yes, I know, kind of dumb but really enjoyable for me). I have everything working well so far, but haven't found a good DOS emulator that has debugging and a live view of memory. Nesticle will show the register states and dump the memory, but I was hoping for something more like what FCEUX has. Any ideas? Tough to find these old files sometimes so any help would be appreciated.

Thanks!
roland
User avatar
Ben Boldt
Posts: 1149
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: DOS Emulator with Debugger / Memory View

Post by Ben Boldt »

DOSBox is a pretty popular DOS emulator and it apparently has a debugger. I haven't used the debugger myself. Have you checked that out?
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: DOS Emulator with Debugger / Memory View

Post by NewRisingSun »

I think the poster is looking for a NES emulator that runs under DOS that allows you to debug NES games, not for an emulator that emulates DOS. I am not aware of any such emulator existing though.
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: DOS Emulator with Debugger / Memory View

Post by Dwedit »

486 is awfully old to be developing on...
NESticle does have those very limited debug features.
FWNES has a text mode debugger if you want to try it out, but its system requirements may be too high for a 486.

Are you using HXDOS by any chance? That will run some Win32 programs. 7-zip console version works perfectly under HXDOS.
Last edited by Dwedit on Tue Aug 30, 2022 11:00 am, edited 2 times in total.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: DOS Emulator with Debugger / Memory View

Post by lidnariq »

Theoretically LoopyNES for DOS had a debugger, but I haven't tried it
User avatar
Ben Boldt
Posts: 1149
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: DOS Emulator with Debugger / Memory View

Post by Ben Boldt »

NewRisingSun wrote: Mon Aug 29, 2022 1:20 pm I think the poster is looking for a NES emulator that runs under DOS that allows you to debug NES games, not for an emulator that emulates DOS. I am not aware of any such emulator existing though.
LOL I totally read that wrong!
User avatar
Gilbert
Posts: 564
Joined: Sun Dec 12, 2010 10:27 pm
Location: Hong Kong
Contact:

Re: DOS Emulator with Debugger / Memory View

Post by Gilbert »

I remembered Rocknes dropped the DOS version in a quite late release (around 10 years ago I think and that's modern enough IMO), but I don't remember whether it has those debug features. You may hunt down the latest DOS version to see whether it helps.
User avatar
TmEE
Posts: 960
Joined: Wed Feb 13, 2008 9:10 am
Location: Norway (50 and 60Hz compatible :P)
Contact:

Re: DOS Emulator with Debugger / Memory View

Post by TmEE »

I actually remember using DOS version of Rocknes when it was "new", and it required very powerful hardware compared to a 486. I had a PIII at a time and it struggled to run games smoothly. On a 486 I had, only Nesticle ran well enough to be able to actually play games. Debugging functions were not of interest to me then though...
Last edited by TmEE on Tue Aug 30, 2022 8:45 am, edited 1 time in total.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: DOS Emulator with Debugger / Memory View

Post by NewRisingSun »

Is there any particular advantage to developing a game on a 486 under DOS? Why not develop and debug a game on a modern system, and then test-play the finished ROM file with LoopyNES or Nesticle on that 486?

(I actually like bringing up old Nesticle on my trusty old PII-450 from 1998 and playing a few NES titles, once a year or so. In addition to the nostalgia of playing NES games during the 1980s, there is another nostalgia of playing NES games during the early days of NES emulation.)
rludlamjr
Posts: 7
Joined: Tue Mar 02, 2021 8:03 am

Re: DOS Emulator with Debugger / Memory View

Post by rludlamjr »

Hey guys, thanks for the great replies! if anyone has links to loopynes and rocknes for DOS let me know - I haven't been able to find the older builds for rocknes, only the new win ones.

As far as why goes, yeah, I know there are easier ways to do this, (and probably will have to resort to a newer system at times), but I am enjoying the nostalgia and challenge of using older hardware for developing for older hardware. Using a CRT is a bonus too (though admittedly still much higher res than a tv).
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: DOS Emulator with Debugger / Memory View

Post by Dwedit »

I suggest saving yourself the trouble and use a development environment that makes sense. Just use Mesen or something for debugging, and use the ancient computer for non-debug testing.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
none
Posts: 117
Joined: Thu Sep 03, 2020 1:09 am

Re: DOS Emulator with Debugger / Memory View

Post by none »

I remember no$gba had some debugging feature, so I'd guess that no$nes is similar, I didn't actually try it out though.
User avatar
Ben Boldt
Posts: 1149
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: DOS Emulator with Debugger / Memory View

Post by Ben Boldt »

How do you suppose Galoob developed game genie codes? I am not sure they could have even used an emulator at that time. It might be interesting to go down that path.
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: DOS Emulator with Debugger / Memory View

Post by Dwedit »

If you haven't seen it yet, there's a video where General Computer Corp talks about how they created their elaborate hack of Pac Man to make Crazy Otto (Later Ms. Pac Man).

https://www.youtube.com/watch?v=rhM8NAMW_VQ
About 9:39 in the video, they talk about their setup they used for Missile Command (6502), the GenRad 6502 Emulator, selling for $25,000 in 1981.
Then at 19:17, they talk about their setup they used for Pac Man (Z80), the Tektronix 8550 Z80 Emulator. Probably just as expensive as the GenRad.

Did Codemasters use things like that to develop Game Genie codes? Who knows. But those things were around at the time.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
Ben Boldt
Posts: 1149
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: DOS Emulator with Debugger / Memory View

Post by Ben Boldt »

Even with modern tools, it would be a pretty big undertaking to make the Game Genie code book. It kind of amazes me how that book could exist back then.

Nowadays, we typically watch for RAM changes to find cheats. We find the RAM location that represents the number of lives left (for example). And we stop there, freezing the RAM to some specific value. Since Game Genie codes are ROM-only, you then have to find where the ROM code writes to that RAM, which can be done with breakpoints in emulators.

Thinking back to what was available, once you know the RAM location, you can definitely build a hardware flag to find the ROM addresses that access a specific RAM location. You don't need an emulator with breakpoints for that part. Basically you XOR the address bus with the known RAM address. You put an XOR gate with each address bit, with the known bit of the address, then AND together all of the XORs. When the signal goes high, the address matches. So you know that something read or wrote that RAM address. The addresses right before that would have been fetching the instruction directly from ROM that did it. So, a logic analyzer + XOR gates can do the breakpoint thing without any emulator. You can even take apart the Nintendo and cartridge and use the real CPU-A15 and the PRG-ROM address bits directly so you can narrow down the ROM page. So I can see where that could point you to spots in ROM to experiment with and make codes.

But how do you find the RAM location to begin with? Is that something that the $25,000 6502 emulator can help with? Or did they possibly approach it a different way that didn't start with finding RAM locations? RAM searching seems like the only reasonable way to quickly fill up a book with codes.
Post Reply