Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOROM games not loading/saving PRG RAM (WRAM) correctly #178

Closed
koitsu opened this issue May 10, 2016 · 13 comments
Closed

SOROM games not loading/saving PRG RAM (WRAM) correctly #178

koitsu opened this issue May 10, 2016 · 13 comments

Comments

@koitsu
Copy link
Contributor

koitsu commented May 10, 2016

There are 3 Koei games (Romance of the Three Kingdoms, Nobunaga's Ambition, and Genghis Khan), all of which are SOROM games, whose native save capability (i.e. PRG RAM/WRAM) doesn't appear to work correctly. After saving, when power-cycling and attempting to load saved data, the games will simply say "No saved data".

It's suspected that the reason this doesn't work is that Nestopia is either loading or saving the wrong 8KB PRG RAM page. Specific to SOROM boards, we have this, per the nesdev wiki -- note the last line:

SOROM uses a similar method, using the second-highest CHR bank select line to choose between two 8KB PRG RAM chips. Of chip 0 and chip 1, only chip 1 is battery backed.

I don't have a patch for this because the PRG RAM/WRAM and save file code is very complex, so I'm not even sure where the problem lies.

Steps to reproduce:

  1. Make sure there's no existing .sav file
  2. Run NestopiaUE
  3. Load Genghis Khan (Genghis Khan (U).nes -- CRC 2225C20F)
  4. Start the game, e.g.: Mongol Conquest, set parameters automatically, view no princes, etc.
  5. Choose Pass (to move to the next season)
  6. Choose Other, then Save; wait for message "Data saved"
  7. Power-cycle the emulator via Machine menu (or exit/restart emulator)
  8. Choose "Load daved data"

It's hard to tell from the .sav file if the data stored is correct or not (e.g. character names in ASCII are there, but that could be data from PRG RAM page 0 rather than 1; unsure!), so it's difficult to determine if the issue is with loading, or with saving.

Discussion thread: http://forums.nesdev.com/viewtopic.php?f=3&t=14205
SxROM details: http://wiki.nesdev.com/w/index.php/SxROM
HVC-SOROM games: http://bootgod.dyndns.org:7777/search.php?unif=HVC-SOROM
NES-SOROM games: http://bootgod.dyndns.org:7777/search.php?unif=NES-SOROM

@dragon2snow
Copy link

using nstdatabase.xml

@joepogo
Copy link
Contributor

joepogo commented May 10, 2016

So, how to fix this dragon2snow?

@dragon2snow
Copy link

dragon2snow commented May 10, 2016

try two solution:
1.using nstdatabase.xml
<game> <cartridge system="NES-NTSC" dump="ok" crc="2225C20F" sha1="209911D7BD15ABB7BEF2E35A473DF725B6738CD7"> <board mapper="1"> <prg size="256k" /> <vram size="8k" /> <wram size="16k" /> <wram size="16k" battery="1" /> <chip type="MMC1B2" /> </board> </cartridge> </game>

2.SOROM
STD_SOROM = MakeId< 1, 256, 0, 16, 16, CRM_8, NMT_H, 0 >::ID,

@joepogo
Copy link
Contributor

joepogo commented May 10, 2016

Thank you, if we opt for solution 2. Then what file is that in the source? I will probably add that entry into the database as well.

@koitsu
Copy link
Contributor Author

koitsu commented May 10, 2016

For the 2nd solution, it would be source/core/board/NstBoard.hpp. I still don't know which is the "proper" solution, nor have I verified either of them work.

My concern with the 2nd solution is, just at first glance (I have not looked at how that enum is being used), that it increases the PRG RAM size to 16KB in some manner. Does this mean 16KB gets written to the .sav file? If so, I don't see how that's accurate -- information clearly shows that only PRG RAM page 1 is battery-backed, and each page is 8KB.

@joepogo
Copy link
Contributor

joepogo commented May 11, 2016

Ill give these a try when I get home. have you tried either one of these koitsu yet?

@koitsu
Copy link
Contributor Author

koitsu commented May 11, 2016

Nope; I don't have a VM built for Visual Studio projects.

@dragon2snow
Copy link

I've only been provide test solution, but is not accurate, I don't want to promise

@joepogo
Copy link
Contributor

joepogo commented May 12, 2016

So really, neither route is accurate?

@joepogo
Copy link
Contributor

joepogo commented Aug 24, 2016

Wouldn't the easy way to fix this just be to edit these three games entries in the nestopia database.xml file to save?

@joepogo
Copy link
Contributor

joepogo commented Aug 29, 2016

Correction, editing the xml is definitely not the way to do it and hacking up the xml to save in 32kb is NOT correct either.

Looks like save and load functionality will need to be looked at in NST board for MMC1 i think instead.

@dragon2snow
Copy link

100% working...

@joepogo
Copy link
Contributor

joepogo commented Aug 29, 2016

So, what did you do dragon to fix? How?

@0ldsk00l 0ldsk00l locked as resolved and limited conversation to collaborators Feb 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants