MSE NES emulation

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Alegend45
Posts: 43
Joined: Thu Mar 29, 2012 6:10 pm

MSE NES emulation

Post by Alegend45 »

Hello. I have created a NES emulator, but I need some help (Especially when trying to get mappers to work, PPU emulation, APU emulation). It's also part of a multi-system emulator called MSE, but anyways, here's the source link:
https://github.com/Alegend45/MSE
snarfblam
Posts: 143
Joined: Fri May 13, 2011 7:36 pm

Post by snarfblam »

Skilled NesDevers would probably be more inclined to help if you were more specific about what you're having trouble with. Or are you just asking people to chip in and code for you?
User avatar
Zepper
Formerly Fx3
Posts: 3264
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Post by Zepper »

Before considering developing your own NES emulator, ask yourself if your efforts may be better spent helping out those who already have emulators in development!
Alegend45
Posts: 43
Joined: Thu Mar 29, 2012 6:10 pm

Post by Alegend45 »

Well, it's not just NES, but others, only starting with NES. Also, I'm having trouble extending my framework to emulating not just the CPU, but also the PPU, APU, and mappers. So far, I only have a partial CPU, and mapper 0 implemented.

For example, I'm having trouble extending my single fread of a 32K bank of ROM, into a mapper-conscious loading function...
User avatar
MottZilla
Posts: 2835
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

What are you having trouble doing? Do you just not know what to do?

The iNES header will tell you how many PRG and CHR banks exist and you just load the data into memory. Most mappers are very simple to handle. Only a few get a bit more complicated.

But it sounds like you're trying to make a NES emulator and just don't know what to do, which is fine, but you need to ask questions or be more specific about what you don't understand.
Alegend45
Posts: 43
Joined: Thu Mar 29, 2012 6:10 pm

Post by Alegend45 »

Well, I have just now made some progress with mapper 2, but on mapper 1, or MMC1, I'm having trouble understanding how I am supposed to duplicate the effect of writing 1 bit at a time, into 5-bit registers. Also, I have no idea where to start on PPU or APU emulation. Console programs are my main specialty.
User avatar
MottZilla
Posts: 2835
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

What is so hard about it? You have a counter that determines how many bits have been written into the shift register. When it overflows (all 5bits written) you write to the internal register associated with the address written to. And if anytime the reset bit is written to, you reset your counter.

What is more confusing about MMC1 is there are some games that use MMC1 in odd configurations like SXROM where CHR registers are repurposed for having more than 256K of PRG-ROM and/or more than 8K of PRG-RAM. MMC6 is kind of annoying too since only 2 games use it and it doesn't behave like the MMC3 exactly but as far as iNES mapper numbers are concerned it should.
User avatar
thefox
Posts: 3139
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Post by thefox »

All you seem to have is a bare bones 6502 emulator. I would hardly classify that as a NES emulator at this point. Also if you need to ask such simple questions this early in the development process, it's unlikely you'll ever be able to finish your emulator. Making a multi emulator system doesn't sound like a realistic goal either given your progress so far.

Not trying to be a dick, just stating the truth.
User avatar
Zepper
Formerly Fx3
Posts: 3264
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Post by Zepper »

thefox wrote:Not trying to be a dick, just stating the truth.
Agreed. Perhaps, in short words, enthusiastic... but fails.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Mednafen has the right approach, in my opinion: a common front-end for multiple existing freely licensed emulator cores.
Alegend45
Posts: 43
Joined: Thu Mar 29, 2012 6:10 pm

Post by Alegend45 »

thefox, you have a point there. Honestly though, I seem to be the best with mappers.
Near
Founder of higan project
Posts: 1553
Joined: Mon Mar 27, 2006 5:23 pm

Post by Near »

tepples wrote:Mednafen has the right approach, in my opinion: a common front-end for multiple existing freely licensed emulator cores.
Important to add that Ryphecha (the author) writes her own cores as well, and thus has experience with fixing the cores she imports. Just slapping a bunch of other emulators into one GUI is interesting, but it's been done to death already as well.

I really have to agree with Zepper and thefox. If the NES is difficult, then emulating other systems (other than perhaps the Chip8) is only going to get worse.

However, the NES is a great place to start learning. Keep at it for 5-10 years and who knows what you can create.
User avatar
MottZilla
Posts: 2835
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

I would agree that the NES is probably the easiest console to get games emulated, because you don't have to be that precise to get alot of games to run. And there aren't a lot of complicated details, atleast not required to play the majority of software.

It also is one of the most fun to emulate due to the library of many great games.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

I'm told the original Game Boy is even easier because fewer games rely on exact cycle timing due to the MMC5-style scanline counter in the Game Boy's PPU.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

But the Z80 is tougher to simulate than the 6502...
Post Reply