MiSTer NES Core

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, spiny, Greenious, Sorgelig, Moderator Team

GreyRogue
Atari maniac
Atari maniac
Posts: 89
Joined: Thu Mar 22, 2018 3:50 am

MiSTer NES Core

Postby GreyRogue » Sun Oct 28, 2018 7:45 pm

I've just pulled in Loopy's PowerPak mappers from the nes-dev forums. Audio works in mapper 69 (Sunsoft-5B=Gimmick). Added support for mappers 24/26 (VRC6 with sound), 19 (Namco 106/163 with sound) and 20 (Famicom Disk System with sound). I only tested with the PowerPak FDS BIOS. I suspect it doesn't work with the original. Save support is not currently implemented on the FDS. Hold select to pause auto disk swap, just like the PowerPak. You can turn on/off internal/external audio to hear each individually. To load FDS, load the BIOS, then an FDS image. FDS with and without header should both work, but I only tested without.

Pull request created.

Loopy did all of the hard work on this.

NegSol
Captain Atari
Captain Atari
Posts: 267
Joined: Sat Dec 05, 2015 9:22 pm

Re: MiSTer NES Core

Postby NegSol » Sun Oct 28, 2018 8:10 pm

Great news! Thank you! :cheers:

User avatar
thgill
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 142
Joined: Sat May 17, 2008 8:10 pm
Location: Cincinnati, OH

Re: MiSTer NES Core

Postby thgill » Sun Oct 28, 2018 9:01 pm

Excellent!
Like retro computers, game consoles and other obsolete junk? Check out Todd's Nerd Cave on YouTube

vanfanel
Atari freak
Atari freak
Posts: 53
Joined: Tue Oct 09, 2018 10:19 pm

Re: MiSTer NES Core

Postby vanfanel » Mon Oct 29, 2018 12:03 am

GreyRogue wrote:Added support for mappers 24/26 (VRC6 with sound)


Wohoooo!! Castlevania III Japanese, here we go!!! :cheers: :cheers:

Thanks, GreyRogue!!! This is great news!!!

User avatar
Newsdee
Atari God
Atari God
Posts: 1224
Joined: Fri Sep 19, 2014 8:40 am

Re: MiSTer NES Core

Postby Newsdee » Mon Oct 29, 2018 12:07 am

This is great'! FDS supporr was one of the features missing from the core. With this and more mappers, plus save support for non-FDS roms, the core has matured a lot. Thanks for all your hard work! (and let's not forget Loopy, Sebdel, and others who also contributed to this code base)

hyperterminal
Atari maniac
Atari maniac
Posts: 89
Joined: Sun Jul 09, 2017 1:43 pm

Re: MiSTer NES Core

Postby hyperterminal » Mon Oct 29, 2018 4:17 am

Thank you for this great update.

Would it be possible to add an option for an increased sprite limit of 16? This would help against sprite flickering. The PC Engine and SMS Core already have such an option.

Another improvement would be to add Nintendo VS support.

A first and easy step (as there is already a palette selection option) would be to add the Arcade palettes of the different VS PPUs.

They can be downloaded from here:
http://atariage.com/forums/topic/242970 ... try3884369

Here is a test rom that might help with the development:
https://forums.nesdev.com/viewtopic.php ... 92#p127592

PhantombrainM
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 110
Joined: Fri Mar 16, 2018 9:10 am

Re: MiSTer NES Core

Postby PhantombrainM » Mon Oct 29, 2018 10:36 am

Thank you to everyone! The MISTer is already so great! Its so fornicating fun! Can't pronounce it enough!! And it's all open source and open for the whole world forever. I love it!

By the way, PAL Support would be nice too. Some games behave a little bit different in NTSC regarding timing compared to Europe which I'm used to.
Two beer or not two beer? - Shakesbeer.

berighteous
Atarian
Atarian
Posts: 3
Joined: Fri Oct 19, 2018 6:58 am

Re: MiSTer NES Core

Postby berighteous » Tue Oct 30, 2018 7:56 pm

I just downloaded the core and tried with a bunch of .NES roms that work in all my other emulators and I'm getting nothing. black or colorsed screen. Am I missing a bios file or something?

vanfanel
Atari freak
Atari freak
Posts: 53
Joined: Tue Oct 09, 2018 10:19 pm

Re: MiSTer NES Core

Postby vanfanel » Tue Oct 30, 2018 9:09 pm

PhantombrainM wrote:Its so fornicating fun!


:shrug: :lol:

rattboi
Atarian
Atarian
Posts: 2
Joined: Wed Oct 17, 2018 6:59 pm

Re: MiSTer NES Core

Postby rattboi » Wed Oct 31, 2018 9:11 pm

Question: does the lite build work right now?

I'm trying to get set up to do some NES core work, but I'm only getting a black screen and after a while it reboots itself when I try to compile NES-lite.qsf using Quartus Lite 18.1.

I went back a few months in the commit history and got the same thing from those builds too though.

vanfanel
Atari freak
Atari freak
Posts: 53
Joined: Tue Oct 09, 2018 10:19 pm

Re: MiSTer NES Core

Postby vanfanel » Wed Oct 31, 2018 9:58 pm

@GreyRogue: any chance that Mario patched like this gets to work on the NES core?

https://www.romhacking.net/hacks/4180/

Currently it only shows a black screen. This may be the most awesome NES hack I have ever seen! And I don't believe it uses a new mapper, it may be a simple issue...

GreyRogue
Atari maniac
Atari maniac
Posts: 89
Joined: Thu Mar 22, 2018 3:50 am

Re: MiSTer NES Core

Postby GreyRogue » Thu Nov 01, 2018 12:13 am

vanfanel wrote:@GreyRogue: any chance that Mario patched like this gets to work on the NES core?

https://www.romhacking.net/hacks/4180/

Currently it only shows a black screen. This may be the most awesome NES hack I have ever seen! And I don't believe it uses a new mapper, it may be a simple issue...

The hack uses mapper 24, which is one of the ones I just added. It seems to work for me. It should be in the next release if you aren't setup to build yourself.

Edit: Well...maybe works is the wrong word. It runs, but there appear to be issues. Is the hack confirmed to work on real hardware? There could be issues with the mapper as well.

GreyRogue
Atari maniac
Atari maniac
Posts: 89
Joined: Thu Mar 22, 2018 3:50 am

Re: MiSTer NES Core

Postby GreyRogue » Thu Nov 01, 2018 12:30 am

GreyRogue wrote:
vanfanel wrote:@GreyRogue: any chance that Mario patched like this gets to work on the NES core?

https://www.romhacking.net/hacks/4180/

Currently it only shows a black screen. This may be the most awesome NES hack I have ever seen! And I don't believe it uses a new mapper, it may be a simple issue...

The hack uses mapper 24, which is one of the ones I just added. It seems to work for me. It should be in the next release if you aren't setup to build yourself.

Edit: Well...maybe works is the wrong word. It runs, but there appear to be issues. Is the hack confirmed to work on real hardware? There could be issues with the mapper as well.


Edit2: Just tried on my PowerPak and don't see the same issues. So either I missed something in connecting the mapper, or there's something else wrong with the main NES core.

GreyRogue
Atari maniac
Atari maniac
Posts: 89
Joined: Thu Mar 22, 2018 3:50 am

Re: MiSTer NES Core

Postby GreyRogue » Thu Nov 01, 2018 12:30 am

GreyRogue wrote:
GreyRogue wrote:
vanfanel wrote:@GreyRogue: any chance that Mario patched like this gets to work on the NES core?

https://www.romhacking.net/hacks/4180/

Currently it only shows a black screen. This may be the most awesome NES hack I have ever seen! And I don't believe it uses a new mapper, it may be a simple issue...

The hack uses mapper 24, which is one of the ones I just added. It seems to work for me. It should be in the next release if you aren't setup to build yourself.

Edit: Well...maybe works is the wrong word. It runs, but there appear to be issues. Is the hack confirmed to work on real hardware? There could be issues with the mapper as well.

Edit2: Just tried on my PowerPak and don't see the same issues. So either I missed something in connecting the mapper, or there's something else wrong with the main NES core.

slowmo310
Retro freak
Retro freak
Posts: 16
Joined: Mon Oct 15, 2018 6:41 pm

Re: MiSTer NES Core

Postby slowmo310 » Thu Nov 01, 2018 12:31 am

berighteous wrote:I just downloaded the core and tried with a bunch of .NES roms that work in all my other emulators and I'm getting nothing. black or colorsed screen. Am I missing a bios file or something?

Are you using the SRam module? Nes core requires it.

vanfanel
Atari freak
Atari freak
Posts: 53
Joined: Tue Oct 09, 2018 10:19 pm

Re: MiSTer NES Core

Postby vanfanel » Thu Nov 01, 2018 11:07 am

GreyRogue wrote:
Edit2: Just tried on my PowerPak and don't see the same issues. So either I missed something in connecting the mapper, or there's something else wrong with the main NES core.


Ow! So they use mapper 24 for this! And so convenient that you just added it... I hope it can eventually work. It's awesome to play Super Mario Bros. with a friend.
I though the main core was more or less "complete", lacking some mappers only.

GreyRogue
Atari maniac
Atari maniac
Posts: 89
Joined: Thu Mar 22, 2018 3:50 am

Re: MiSTer NES Core

Postby GreyRogue » Sat Nov 03, 2018 8:38 pm

vanfanel wrote:
GreyRogue wrote:
Edit2: Just tried on my PowerPak and don't see the same issues. So either I missed something in connecting the mapper, or there's something else wrong with the main NES core.


Ow! So they use mapper 24 for this! And so convenient that you just added it... I hope it can eventually work. It's awesome to play Super Mario Bros. with a friend.
I though the main core was more or less "complete", lacking some mappers only.

Found it. Unofficial opcode 0xCB (AXS #i) is used by this hack. The microcode for the instruction in the CPU was incorrect. I fixed it, and the sprite issues I was seeing work correctly now. Running some test ROMs point to some potential issues with several other unofficial opcodes: 0x0B, 0x2B, 0x4B, 0x6B, 0xAB, 0x9C and 0x9E.

Fixed in my latest check-in.

User avatar
Newsdee
Atari God
Atari God
Posts: 1224
Joined: Fri Sep 19, 2014 8:40 am

Re: MiSTer NES Core

Postby Newsdee » Sun Nov 04, 2018 1:49 am

Would it be complex to allow larger ROM sizes?

There are some homebrew games that use MMC5 and more memory than commercial games, such as Legend of Link:
https://www.romhacking.net/hacks/2136/

These work on real hardware but only because they use a custom cart.

vanfanel
Atari freak
Atari freak
Posts: 53
Joined: Tue Oct 09, 2018 10:19 pm

Re: MiSTer NES Core

Postby vanfanel » Sun Nov 04, 2018 11:11 am

GreyRogue wrote:Found it. Unofficial opcode 0xCB (AXS #i) is used by this hack. The microcode for the instruction in the CPU was incorrect. I fixed it, and the sprite issues I was seeing work correctly now. Running some test ROMs point to some potential issues with several other unofficial opcodes: 0x0B, 0x2B, 0x4B, 0x6B, 0xAB, 0x9C and 0x9E.

Fixed in my latest check-in.


Woho!!! I can't wait for the new release!!! :D
About the remaining opcodes (0x0B, 0x2B, 0x4B, 0x6B, 0xAB, 0x9C, 0x9E), are they used by any know games?

GreyRogue
Atari maniac
Atari maniac
Posts: 89
Joined: Thu Mar 22, 2018 3:50 am

Re: MiSTer NES Core

Postby GreyRogue » Sun Nov 04, 2018 5:22 pm

Newsdee wrote:Would it be complex to allow larger ROM sizes?

There are some homebrew games that use MMC5 and more memory than commercial games, such as Legend of Link:
https://www.romhacking.net/hacks/2136/

These work on real hardware but only because they use a custom cart.

The core is already set up to use 1MB each for PRG and CHR. Technically more, depending on the mapper. This could be increased by using more address lines throughout the core, but this isn't the issue with Legend of Link. There is a bug in the MMC5 mapper RAM select. I fixed it in my fork, and it now runs, but there are graphical issues. Saving will not work, as it doesn't use the typical save RAM address. I need to decide how to handle this (probably just change the mapper to match the others).

GreyRogue
Atari maniac
Atari maniac
Posts: 89
Joined: Thu Mar 22, 2018 3:50 am

Re: MiSTer NES Core

Postby GreyRogue » Sun Nov 04, 2018 6:33 pm

GreyRogue wrote:Saving will not work, as it doesn't use the typical save RAM address. I need to decide how to handle this (probably just change the mapper to match the others).

Changed to match other mappers. Saving appears to work. This only saves 32K of data (as that is how much the core currently allows). If any data is saved to the high 32K, it won't be saved. Needs testing. Keep in mind data may be lost when playing until this is tested more.

I currently don't know what's causing the title screen graphics error. FCEUX does the same thing. The scrolling text/graphics after the title screen work, so I assume the game won't have the game breaking issue at the Ganon fight described on the RomHacking site page.

Jeebs
Atarian
Atarian
Posts: 5
Joined: Sun Nov 04, 2018 1:59 pm

Re: MiSTer NES Core

Postby Jeebs » Sun Nov 04, 2018 7:24 pm

Is it possible to add in options to remove Sprite limits for games that have bad flicker? I believe the PCE core has an option for extra sprites.

I've been working on adding in extra Palette options like Smooth FBX but I'm struggling with converting the 8bit Hex over to what looks like 5bit Hex in the video.sv file. Any suggestions?

GreyRogue
Atari maniac
Atari maniac
Posts: 89
Joined: Thu Mar 22, 2018 3:50 am

Re: MiSTer NES Core

Postby GreyRogue » Sun Nov 04, 2018 8:41 pm

Jeebs wrote:Is it possible to add in options to remove Sprite limits for games that have bad flicker? I believe the PCE core has an option for extra sprites.

I did it for Master System. This is more complicated but probably possible. I've been looking at it, but no guarantees. Somebody else might get it before me anyway.
I've been working on adding in extra Palette options like Smooth FBX but I'm struggling with converting the 8bit Hex over to what looks like 5bit Hex in the video.sv file. Any suggestions?

You mean like these:

Code: Select all

// FCEUX palette
wire [15:0] pal_fcelut[64] = '{
   'h39ce, 'h4464, 'h5400, 'h4c08, 'h3811, 'h0815, 'h0014, 'h002f,
   'h00a8, 'h0100, 'h0140, 'h08e0, 'h2ce3, 'h0000, 'h0000, 'h0000,
   'h5ef7, 'h75c0, 'h74e4, 'h7810, 'h5c17, 'h2c1c, 'h00bb, 'h0539,
   'h01d1, 'h0240, 'h02a0, 'h1e40, 'h4600, 'h0000, 'h0000, 'h0000,
   'h7fff, 'h7ee7, 'h7e4b, 'h7e28, 'h7dfe, 'h59df, 'h31df, 'h1e7f,
   'h1efe, 'h0b50, 'h2769, 'h4feb, 'h6fa0, 'h3def, 'h0000, 'h0000,
   'h7fff, 'h7f95, 'h7f58, 'h7f3a, 'h7f1f, 'h6f1f, 'h5aff, 'h577f,
   'h539f, 'h53fc, 'h5fd5, 'h67f6, 'h7bf3, 'h6318, 'h0000, 'h0000
};


Those are 16 bit values. If the ones you have are 8 bit, just add two 0s to the end.
Edit: Technically, you could get more complicated than just appending 0s, but it will get you started.

GreyRogue
Atari maniac
Atari maniac
Posts: 89
Joined: Thu Mar 22, 2018 3:50 am

Re: MiSTer NES Core

Postby GreyRogue » Mon Nov 05, 2018 1:33 pm

GreyRogue wrote:
I've been working on adding in extra Palette options like Smooth FBX but I'm struggling with converting the 8bit Hex over to what looks like 5bit Hex in the video.sv file. Any suggestions?

You mean like these:

Code: Select all

// FCEUX palette
wire [15:0] pal_fcelut[64] = '{
   'h39ce, 'h4464, 'h5400, 'h4c08, 'h3811, 'h0815, 'h0014, 'h002f,
   'h00a8, 'h0100, 'h0140, 'h08e0, 'h2ce3, 'h0000, 'h0000, 'h0000,
   'h5ef7, 'h75c0, 'h74e4, 'h7810, 'h5c17, 'h2c1c, 'h00bb, 'h0539,
   'h01d1, 'h0240, 'h02a0, 'h1e40, 'h4600, 'h0000, 'h0000, 'h0000,
   'h7fff, 'h7ee7, 'h7e4b, 'h7e28, 'h7dfe, 'h59df, 'h31df, 'h1e7f,
   'h1efe, 'h0b50, 'h2769, 'h4feb, 'h6fa0, 'h3def, 'h0000, 'h0000,
   'h7fff, 'h7f95, 'h7f58, 'h7f3a, 'h7f1f, 'h6f1f, 'h5aff, 'h577f,
   'h539f, 'h53fc, 'h5fd5, 'h67f6, 'h7bf3, 'h6318, 'h0000, 'h0000
};


Those are 16 bit values. If the ones you have are 8 bit, just add two 0s to the end.
Edit: Technically, you could get more complicated than just appending 0s, but it will get you started.

Sorry this is just plain wrong. You had it correct, 5 bits per color. Appending 0s only works on individual colors, not palettes. Sorry. Brain malfunction on my part.
From the code:

Code: Select all

wire  [4:0] vga_r   = pixel_v[4:0];
wire  [4:0] vga_g   = pixel_v[9:5];
wire  [4:0] vga_b   = pixel_v[14:10];

So just shift the top 5 blue bits by 10 bits, add top 5 green shifted by 5 and add top 5 red.
Sorry again about my mistake.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3138
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: MiSTer NES Core

Postby Sorgelig » Fri Nov 09, 2018 10:44 am

I've switched CPU to well-known and tested T65 model.
Please test it. My quick test show it's working, though i'm not sure about undocumented opcodes. As far as i know they are implemented.

Somewhere cpu_cycle_counter signal is used as a clock which is really bad thing. I couldn't find where it's used yet. Need to fix this and change posedge to negedge in nes.v line 159 as cpu_cycle_counter is part of clock enablers.


Return to “MiSTer”

Who is online

Users browsing this forum: enginesol and 5 guests