Is it possible to play a cart on an emulator?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

CKY-2K/Clay Man
Posts: 214
Joined: Sun Apr 01, 2007 2:10 pm

Is it possible to play a cart on an emulator?

Post by CKY-2K/Clay Man »

Is it possible to run a cartridge on an emulator on your computer in theory?
Image
Here to at least get an idea of how the NES works. I mean I know alot of the basic things, but this place'll help me grasp more how NES functions.
Major respect to NES developers.
User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku »

Yes with a cartridge bus<->computer bus bridge.
Last edited by kyuusaku on Thu Apr 29, 2010 3:03 pm, edited 1 time in total.
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

That's what you're doing every time you play a game, though the "computer" is a combination of your PC, your cable modem, the Internet, and similar on the side of whoever originally dumped it. I take it you mean run the cartridge on an emulator which accesses the cartridge as the emulated game does. That can be done. An emulator could be modified to use one of those parallel port-based cartridge dumpers for every access.
User avatar
Zepper
Formerly Fx3
Posts: 3264
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Post by Zepper »

- Looks pointless...?
ReaperSMS
Posts: 174
Joined: Sun Sep 19, 2004 11:07 pm

Post by ReaperSMS »

I don't think you can run the pport things fast enough for that to really be viable, short of dumping it to memory ahead of time, which'd require knowing the mapper numbers.

Supporting IRQs properly probably isn't doable either, especially MMC3 ones.
User avatar
Super-Hampster
Posts: 185
Joined: Fri May 12, 2006 4:40 pm

Post by Super-Hampster »

There's the retrode. www.retrode.org
Not NES but it proves it can be done.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

blargg wrote:That's what you're doing every time you play a game, though the "computer" is a combination of your PC, your cable modem, the Internet, and similar on the side of whoever originally dumped it.
The step with the Internet and a remote dumper is what ROM copyright owners rightly complain about. It's legal under United States law if you use your own dumper (17 USC 117) but not if you use someone else's dumper. One problem is that the NES has two buses, and Retrode doesn't appear to directly support that.
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

Ahhh, I see. Even just the NES CPU access memory at 1.79 MB/sec. But you'd have to communicate the 16-bit address along with the data to be written/read over the parallel port, requiring 3 times that bandwidth at minimum. And then there's the PPU...
ReaperSMS
Posts: 174
Joined: Sun Sep 19, 2004 11:07 pm

Post by ReaperSMS »

and polling the IRQ line properly
and broadcasting *every* ppu access over the thing to keep the MMC3 counter correct
and toggling M2 at 1.79MHz to keep the various cpu cycle based counters working
etc

Some sort of magical add-in card might do it, but there'd be a lot of complications to get sorted out in pipelining the reads and dealing with the clock domain issues, and that's after the (admittedly somewhat trivial) problem of level conversion.
User avatar
Memblers
Site Admin
Posts: 3901
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

The Retrode seems to be simpler than that. I think basically all it has to do is read the whole cartridge sequentially a single time. After that the device would probably do nothing except wait for the emulator to write a save file.

CopyNES can do that already, but it's not conveniently automated like that. You also have to know what mapper you're dealing with, which is mostly a problem unique to the NES because of the hundreds of different boards.

That's way easier too than making some kind of super high-speed add-on card for a PC (though it would be cool).
User avatar
MottZilla
Posts: 2835
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

Something like Retrode is the most practical if you want to use real cartridges. I guess for NES or SNES games with special chips it would be cool if you could somehow use them but I've heard that's impractical.

I wonder if they will make a Retrode for the NES. I suppose it'd be alittle harder with the mappers particularly if you were to support people using adapters for Famicom cartridges.
HJRodrigo
Posts: 71
Joined: Tue Sep 15, 2009 5:01 pm

Post by HJRodrigo »

MottZilla wrote:Something like Retrode is the most practical if you want to use real cartridges. I guess for NES or SNES games with special chips it would be cool if you could somehow use them but I've heard that's impractical.
I agree, that would be neat. Then the emulator would just focus on the base system and not memory maps and such, that have nothing to do with base hardware. Then most people could run bsnes at full speed since it no longer needs to emulate the cartridges.
ReaperSMS
Posts: 174
Joined: Sun Sep 19, 2004 11:07 pm

Post by ReaperSMS »

The vast majority of the CPU time bsnes uses does not have to do with the cartridge. I'd go out on a limb and suggest that cartridge mapping emulation (outside of ones using the SA-1, or SuperFX) is almost completely negligible compared to PPU/SPC-700 time.
User avatar
MottZilla
Posts: 2835
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

HJRodrigo wrote:I agree, that would be neat. Then the emulator would just focus on the base system and not memory maps and such, that have nothing to do with base hardware. Then most people could run bsnes at full speed since it no longer needs to emulate the cartridges.
"Emulating the cartridges" isn't something that impacts emulation performance. Infact attempting to directly use the original cartridge would be terrible because of the inability to really interface with it in real time. It would be nifty if you could use the cartridges in real time yes, but there is nothing to be gained from it other than if you could use the original mappers for NES, or the coprocessors in SNES. But that would be an issue for some as precise console eumlation may be needed for some of these chips like MMC5 for NES and SA-1 for SNES.

ReaperSMS is right. The reason BSNES is so demanding is there is alot of processing time for the CPU,PPU,SPC, etc. Accessing the memory of the cartridge is hardly anything at all.
HJRodrigo
Posts: 71
Joined: Tue Sep 15, 2009 5:01 pm

Post by HJRodrigo »

MottZilla wrote:
HJRodrigo wrote:I agree, that would be neat. Then the emulator would just focus on the base system and not memory maps and such, that have nothing to do with base hardware. Then most people could run bsnes at full speed since it no longer needs to emulate the cartridges.
"Emulating the cartridges" isn't something that impacts emulation performance. Infact attempting to directly use the original cartridge would be terrible because of the inability to really interface with it in real time. It would be nifty if you could use the cartridges in real time yes, but there is nothing to be gained from it other than if you could use the original mappers for NES, or the coprocessors in SNES. But that would be an issue for some as precise console eumlation may be needed for some of these chips like MMC5 for NES and SA-1 for SNES.

ReaperSMS is right. The reason BSNES is so demanding is there is alot of processing time for the CPU,PPU,SPC, etc. Accessing the memory of the cartridge is hardly anything at all.
Real time reading of the cart is the whole point ;), if it is not real time one might as well just dump the rom. bsnes system requirements increased when he added the ability to play one of these special chips. So saying ""Emulating the cartridges" isn't something that impacts emulation performance" isn't accurate at all. Some may have a minimal effect, but logically adding any more instructions to a code will have some effect.
Post Reply