Code Monkey home page Code Monkey logo

nes_mister's Introduction

This is an FPGA implementation of the NES/Famicom based on FPGANES by Ludvig Strigeus and ported to MiSTer.

Features

  • Supports saves for most games
  • Savestates
  • Supports NTSC, PAL, and Dendy system types
  • FDS Support with expansion audio
  • Multiple Palette options
  • Zapper, Powerpad, Microphone, and Miracle Piano support
  • Supports four players
  • Setting for increasing sprite per line by 8
  • Supports up to 32 cheat codes
  • Supports NSF Player
  • Supports expansion audio from mappers including VRC6 & 7, MMC5, Namco 163 and Sunsoft 5b
  • Supports many popular mappers including VRC1-7, MMC0-5, and many more (see below)
  • Supports large games such as Legend of Link and Rockman Minus Infinity

Installation

Copy the NES_*.rbf file to the directory or subdirectory of /media/fat/. Create a games/NES/ directory on the root of the SD card (/media/fat/games/NES/), and place NES roms (*.nes) inside this NES directory. The ROMs must have an iNES or NES2.0 header, which most already do. NES2.0 headers are preferred for the best accuracy. To have an NES or FDS game ROM load automatically upon starting the core, place it in the NES directory named as boot1.rom or boot2.rom, respectively.

  • boot0.rom = FDS BIOS file. Will be used for any FDS images loaded
  • boot1.rom = NES Cart file. Can be used with boot0.rom (BIOS) in place
  • boot2.rom = FDS image file. Requires boot0.rom (BIOS). Use a blank FDS (header only) to boot the FDS BIOS without a disk image.
  • boot3.rom = PAL file. It can be used to set your default custom palette. Save the menu option on "Custom" to apply immediately.

Famicom Disk System Usage

Before loading *.FDS files, you must first load the official, unpatched FDS BIOS. The BIOS file should be renamed to boot0.rom and placed in the same folder as the ROMs (NES). Alternatively, it can be loaded from the OSD if boot0.rom doesn't exist. After loading the core and the bios you may select an FDS image. By default, the NES core will swap disk sides for you automatically. To suppress this behavior, hold the FDS button on the player 1 controller. The "Disk Swap" OSD option manually controls the disk side. Each button press increments the disk side. Press and hold the fds button to eject and increment the disk side in this mode. Some games only work correctly in manual disk swap mode, and require holding the FDS button for up to a few seconds (Gall Force,...).

Extra Sprites

This feature will double the number of sprites drawn per scanlines, decreasing the flickering sprites that NES is known for. Some games relied on the 8 sprite behavior to work correctly, such as Simon's Quest swamps. Other mappers may be impacted by using extra sprites. While it works well in most games, glitches may occur with this enabled.

Saving and Loading

The battery backed RAM (Save RAM) for the NES does not write to disk automatically. After saving in your game, you must then write the RAM to the SD card by selecting Save Backup RAM from the menu. If you do not save your RAM to disk, the contents will be lost next time you restart the core or switch games. Alternatively you can enable to Autosave option from the OSD menu, and if you do your games will be recorded to disk every time you open the OSD menu. FDS saving uses the same method as for cartridge RAM saves. Save RAM is stored as a .sav file based on the NES/FDS filename in /media/fat/saves/NES/. Examples:
Metroid (Japan) (Rev 3).fds -> Metroid (Japan) (Rev 3).sav
Legend of Zelda, The (USA) (Rev 1).nes -> Legend of Zelda, The (USA) (Rev 1).sav

Savestates

Core provides 4 slots to save and restore the state (FDS not supported). Those can be saved to SDCard or reside only in memory for temporary use(OSD Option). Usage with either Keyboard, Gamepad mappable button or OSD. Save states are stored as .ss files in /media/fat/savestates/NES/, with an underscore and the save slot number (1,2,3,4) preceding .ss. Example (save slot 1): Metroid (USA).nes -> Metroid (USA)_1.ss

Keyboard Hotkeys for save states:

  • Alt-F1..F4 - save the state
  • F1...F4 - restore

Gamepad:

  • Savestatebutton+Left or Right switches the savestate slot
  • Savestatebutton+Start+Down saves to the selected slot
  • Savestatebutton+Start+Up loads from the selected slot

Zapper Support

The "Zapper" (aka Light Gun) can be used via two methods. You can select Peripheral: Zapper(Mouse) to use your mouse to aim and shoot with the left button. This mode uses relative mouse motion, so devices that rely on absolute coordinates will not work via this method. Alternatively, you can choose Zapper(Joy) to use the Analog stick to aim, and the defined Trigger button to fire. Guns such as Aimtrak have joystick modes which may be compatible with this method.

Miracle Piano Support

The Miracle Piano is a MIDI keyboard compatible with the Miracle Piano Education System cart. To use it with SNAC, no further settings are needed. To use it with midilink, in the System Settings, set the UART connection to use MIDI. The piano will then be connected on controller port 1 as expected. The primary controller will automatically be assigned to port 2 as the cart expects. The header for the ROM file should be set to NES 2.0 with controller type (0xF) set to the Miracle Piano (0x19).

Supported Mappers

#
0 1 2 3 4 5 7 9 10 11 12 13 15
16 18 19 FDS 21 22 23 24 25 26 27 28 30 31
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
96 97 99 100 101 104 105 107 108 109 110 111
112 113 114 115 116 117 118 119 120 122 123 125 126 127
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
160 161 162 163 164 165 166 167 168 169 171 172 173
180 181 182 183 184 185 186 187 188 189 190 191
192 193 194 195 196 198 199 200 201 202 203 204 205 206 207
208 209 210 211 212 213 214 215 216 217 218 222
224 225 226 227 228 229 230 231 232 233 234 235 236 237
240 241 242 243 244 245 246 248 249 250 251 252 254 255
--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
268 413 547 --- --- --- --- --- --- --- --- --- --- --- --- ---

Key: Supported+Save state, Supported, Not Supported. Mappers that are not existent or not useful are blank.

nes_mister's People

Contributors

birdybro avatar cr4zymanz0r avatar frederic-mahe avatar greyrogue avatar hackshed avatar james-f2 avatar kitrinx avatar mikes11 avatar mirkorean avatar mlc4050 avatar neurorulez avatar nikitalita avatar paulb-nl avatar retrocaster avatar robertpeip avatar sorgelig avatar theypsilon avatar tjanas avatar zreport avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nes_mister's Issues

NES 2019/27/06 release FDS disk switching issues A/B Error 07

Since the new release, some FDS games are unable to properly switch over to another side.
Tested it out using the following games:

Adeian no Tsue
Kaettekita Mario Bros
Gall Force
Yume Koujou Doki Doki Panic

Pressing the FDS button when prompted to, gives the Err 07 message. Same goes for when the disk change is set to automatic.

For reference, NES 2019/05/10 was able to load the first two with no problem. Was there a recent change to the FDS disk switching?

Core doesn't show any picture on my 4K TV half the time

Hey there,

So I have my MiSTer hooked via HDMI on my Samsung 4K/UHD TV (UN55KU6290). Most of the time, this core will not show me any picture when loading any game, I'll only see the MiSTer interface when I hit the menu button. I'll hear a game play with the sound going through the HDMI, but no picture. It will however display via VGA on an old monitor that I've hooked via the IO board.

So ya, I get a blank image on my TV while the sound passes through but I do get the picture on my monitor. Sometime, after playing around with a bunch of different cores that work every time (SNES, Genesis, PC-Engine), it will eventually display on my TV , but that's on rare occasion.

I get a similar with the Master System core and more often with the GameBoy core. Any idea of what's going on and how to fix it?

Thank you

Extra Sprites?

Would it be possible to add an extra sprites support option similar to the PCE Core to help with some games that have bad blinking?

Default location option for FDSBIOS.bin

In addition to being able to load FDSBIOS.bin manually, could a default location for it be set? So if you load an .FDS ROM and the core knows that FDSBIOS.bin is in /NES, it could boot the BIOS first to save the user from having to load it manually each time.

Another location possibility could be /bootrom

Classic Concentration

This game has some graphical glitches after you first match two pieces. I'll try to grab some screenshots and post them here.

HDMI screen flickering

with NES_20180524.rbf the screen flickers for me over HDMI. I tried on two different TVs. I also tried different roms. With the previous release (NES_20180305.rbf) everything looks fine. I don't know which commit could have caused it.

Ring King mapper 206

Loads with black screen and music playing
Then the fighters sprites appear with no background graphics

20190703_175049-Ring King (USA)

50Hz EU ROMS

It would be very nice if you can choose between running EU or US/Japan-ROMs (50/60Hz) in the mainmenu (like minimig). EU-ROMs runs too fast (about 20%)

Tengen Atari Hard Driving prototype ingame graphics garbled.

http://www.lostlevels.org/hard-drivin/

This game never got published officially but looks creative programming running a 3d like game like Hard Drivin on NES.

Emulators even Mesen have the road tearing
image

OG hardware is not supposed to have it.

MiSTer NES core has garbled graphics - only dashboard looks ok.

According to discussions here it looks like mapper 64 / 158, both of which are implemented - the link below solves the wiring needed to be done to make the repro cart, maybe this will help to get the game running on MiSTer as well?:
http://forums.nesdev.com/viewtopic.php?p=125092&fbclid=IwAR17QkVRCSWshpsh1qu4LgceOI4ls_98a-pkUh9r4BEjJvkGonpy0JVaGdM#p125092

Thanks a ton for the great core.

Huge Insect (Unlicensed) will not fully start

This game tends to have a few graphical glitches even on real hardware, but on the MiSTer currently, the round will not fully start. You can start a game, and the music will play and you can move the spray can around and shoot, but the round will never actually start. (no enemies appear)

Not sure if this is applicable, but apparently someone was having the exact same issue with their software emulator on nesdev and documented how they fixed it here:

https://forums.nesdev.com/viewtopic.php?f=3&t=12407

Battletoads/Double Dragon glitches at the end of stage 1

The first stage of Battletoads/Double Dragon plays perfectly until you get to the stage 1 boss, then the game completely glitches out and becomes unplayable. I tried multiple times to see if it was rng, but it happens every time.
img_9952

Startropics can't register name

This happens no matter what ROM is used, haven't seen anyone report of it not working so I am wondering if it's just me. Emulators often had the problem with non hacked roms but even the newer musicfix ones do the same.

Tecmo Bowl

I've tried several different Roms and this game doesn't seem to load.

Random issues when loading new games (after other games were previously loaded)

Core: 190121

Some games exhibit strange behavior if loaded after other games were loaded. It's almost as if there still some data left in memory/registers/whatever that interferes with the new game. Here's some examples:

Akumajo Densetsu (Japan) (encountered frequently)
Game only loads a single screen of garbage graphical data then never proceeds.

Batman: Return of the Joker, hung music note (encountered once)
Immediately once the game is loaded there is a constant tone that plays throughout the game.

Rolling Thunder (USA) (Unl)

For reference, I'm aware that this is probably just an unsupported mapper.

Game displays heavily corrupted tiles almost immediately, first on the title screen, then in-game. There is supposed to be text at the bottom of the play field and the colors also look wrong (blue door, for example).

Linked Youtube LP for reference:
https://www.youtube.com/watch?v=_LwUwrWfY1s

See attached screen shots.
20190611_183504-Rolling Thunder (USA) (Unl)
20190611_183512-Rolling Thunder (USA) (Unl)
20190611_183738-Rolling Thunder (USA) (Unl)

VRC7 audio (Lagrange Point) is inaccurate

Core 190409
In the intro music right after you name your character, roughly 15 seconds into the music there is a popping noise that is not present (or at the very least, extremely dampened) on the real cart's audio.
Here's a recording of it on original hardware vs MiSTer: https://drive.google.com/file/d/1Ds94BdIA5Hy7uLJuRPnCht6fbG2fJ9ck/view?usp=sharing

I'm not sure if this if just needs a low or high pass filter, or if there's more to it. Also, I'm unsure if the VRC7 volume is too low or not. I had to amplify it quite a bit to get it closer to the recording of the volume from the AV Famicom (but that could just be how the AV Famicom mixes cart expansion audio).

FDS Disk Change/Loading Issues 7-19-19

I tried out a few FDS games today and ran into some problems. I tried both manual and auto disk change modes.

Cannot Detect Disk Change:
Michael English Daibouken
Elements of the Shaolin Fist - Ankoku no Maou
Koneko Monogatari

Stuck at Now Loading:
Kineko - Kinetic Connection - The Monitor Puzzle

Stuck at black screen:
Silviana - Ai Ippai no Boukensya

All the other FDS games work great so far!

Sdram needed?

Is it at all possible to have the games utilize the DDR instead of a required Sdram add on? I thought it was strange seeing core of like Genesis and PCE using the DDR and the NES doesn't. Just curious.

Castlevania III graphical corruption

Core: 19.01.21

If you let the intro play, the story text has graphics in some portion (such as the whip) that are garbled until they're on the screen for a little bit. When you start a game and pick up the whip power-up, it garbles the whole screen for a second. This only seems to happen if you let the intro play until you see the garbled intro graphics.

YPbPr - Rolling/unstable image issue on CRT's (NTSC)

Last night I hooked up my MiSTer for the first time via the new I/O board I got. I am using an VGA to YPbPr cable. I also setup the MiSTer.ini file to include YPbPr output. With the NES core, I get a rolling image on both my Sony CRT and my PVM. However, the video captures fine without any rolling via my internal Micomsoft capture card which is also capturing the YPbPr signal (I have Extron Crosspoint switches).

So there is something that the NES core is outputting that my CRT's do not like but that my capture card corrects. I do not get this issue with the Genesis, TurboGrafx or SMS cores. I also do not see the issue via HDMI out for any core.

I know that analog video out isn't a huge priority but I figured I'd create an issue for tracking for a possible solve down the line.

Example video: https://www.youtube.com/watch?v=N77U3pke3iw

Example image: https://cdn.discordapp.com/attachments/497146208297680907/509192111711715338/IMG_20181105_202719.jpg

Coeff Build

I tried to port the Coeff changes(From the Genesis Core) to this Core. While it did work I noticed there was sprite flickering in dark areas. Any idea what would cause that?

Audio humming (DMC channel bug?)

It seems like PCM samples can cause an audiable hum after playback.

One good example: Start up the game Blades of Steel. Right after you hear the sample saying the name of the game, a low frequency hum (200 Hz:ish?) can be heard, and it doesn't stop until you reset the core.

Palette Options

Would it be possible to add/edit the Palettes within video.sv? I see it's using a couple from http://www.firebrandx.com/nespalette.html. The Smooth(FBX) is a popular and good Palette for the NES. I poked around to see if I could add this but I couldn't figure out how to get the values for the video.sv file.

Any suggestions on where/how to get these values?

Randomly changing hsync position

When I cycle through NTSC, PAL, Dendy, I can see that it randomly change horizontal position sometimes on a CRT.
Cycling through them again may or may not fix pal horizontal position.

Can it be related to the PLL clock done recently?
This does not happen on the snes core with the new pal pll code, only on the nes core.
This is not my TV, since it doesn't happen with other cores, only the nes core.

@Kitrinx
Sometimes in NTSC mode, it cuts the left column of pixels in the Grid test pattern in 240pee, on HDMI too!
Happens after cycling through the regions (System Type).
edit:
Happens on the NES_PAL test build on Discord before the PLL changes.
So it is something related to changing regions.

Bomberman - brown bricks

I am getting this too when scrolling to the right but it also happens with builds before this change. It seems it is caused by something after June 15th because with that build it doesn't happen.

Also those blocks are all background tiles. The only sprites are Bomberman and the enemies.

60110760-48365980-9775-11e9-852c-b864061836b1

Just Breed (MMC5) audio has super high pitched portions

Core 190409
At the very least one of the early music tracks in the game has a very high pitched portion that doesn't "seem" correct. I don't have an original cart of the game to compare against. (It would be helpful if someone with the original cart could confirm)
Here's a recording of it from the NES core: https://cdn.discordapp.com/attachments/497145588446396416/565682993235230730/JB.flac

The first portion is the music playing normally and you might or might not hear it easily depending on your speakers/headphones/ears. It then cuts over to only play the MMC5 audio where it can be clearly heard.

Battletoads & Double Dragon - Mapper AxROM glitchy pixels

https://wiki.nesdev.com/w/index.php/AxROM

Can be seen in the top row of pixels in Battletoads or Battletoads & Double Dragon in the intro demos.
Both these cartridges use AOROM which according to the link above has some "bus conflicts".

No visible pixel glitches in Mesen emulator with these games.
I don't know if that happens on real hardware with real cartridge.
I have Everdrive N8 but it has FPGA emulated mappers too, so it's not a good reference.

Asterix (Europe exclusive) heavy graphical corruption

Asterix has heavy graphical corruption once you get into stage 1. It is highly likely this is because the core doesn't seem to have any options to simulate a PAL NES. The game also has graphical corruption on a real NTSC NES.

Some Games works incorrect

GoodNES v3.23b Roms
Mapper#32 Major League (J) [!].nes (d8dfd3d1) Outfield area incorrect
Mapper#33 Power Blazer (J) [!].nes (2b17a194) start game, background tank Graphic broken
Mapper#33 Takeshi no Sengoku Fuuunji (J) [!].nes (5c80a4a2) Graphic broken
Mapper#68 Maharaja (J) [!].nes (b9083fde) Graphic broken
Mapper#80 Fudou Myouou Den (J) [!].nes (6e1f3c62) Graphic broken

[Feature Request] Overclocking

A great feature would be the ability to overclock the NES to enhance games (not accurately of course). Something like what Mesen, Nestopia UE, or FCEUX has would be amazing. Here is a demonstration of it in action in FCEUX:

https://www.youtube.com/watch?v=VzQE4pLjhg4


I opened a bounty for this starting at $30 here:
https://www.bountysource.com/issues/75624079-feature-request-overclocking

Please add to the pot, if you'd like to see whoever implement this get at least a little something for their hard work! :D

Contra visual errors when dvi_mode=8 set

I have tested over 100 games on the NES core, and all of them work fine in the default video mode, and with dvi_mode set to '8 - 1920x1080@60', with the exception of Contra.

When loading Contra in 1920x1080@60, there are graphical errors on the loading screen, and then when the first stage begins, the entire screen as garbled graphics, and gameplay is not possible. Returning back to the default dvi_mode fixes this issue completely.

I have not been able to replicate this on any other games, or any other cores.

Captain Saver (Japan) Background tiles corrupted in stages

Select any stage and you will see corrupted tiles that are not there on console. Note that the US version, Power Blade 2 runs as intended, however that version uses MMC3 while this one uses Mapper 033, described in

https://wiki.nesdev.com/w/index.php/Talk:INES_Mapper_033

EDIT: Also note that Bubble Bobble 2 (Japan) also breaks on Round 8. There are some logs in the background that should be scrolling from left to right, but they don't appear to scroll on MiSTer currently. I bring this up in the same issue because this wiki entry leads me to believe the 2 bugs are related

Overscan adjustment possibly?

I noticed that some text was getting cut off from Tecmo Superbowl on the left hand side as seen below.

vlcsnap-2018-12-31-13h05m08s196

I made my own build after tweaking video.sv and changing

HBlank <= (hc > (256-8)) || (hc<9); to HBlank <= (hc > (256-8)) || (hc<7);

vlcsnap-2018-12-31-13h04m19s812

I don't know if that screws up the resolution at all but if the math checks out it might be worth changing if what I did is correct.

FDS audio is inaccurate

Core: 190121

The FDS audio is inaccurate/wrong. One noteable example is in Almana no Kiseki. For lack of a better word, some of the music "flutters". That doesn't happen on original hardware. Here's a video of what it should sound like: https://www.youtube.com/watch?v=usCCn_dnl4I
Compare the intro and 1st level themes in the video to how they sound in the FPGA core.

Default button mappings are backwards

NES controllers are traditionally B on the left, A on the right.
Currently the primary "OK" button is mapping to A, and the "Cancel/back" button is mapping to B.

This can be remapped to be positioned correctly, but then the OSD functions are reversed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.