It is currently Mon Aug 21, 2017 2:49 pm

All times are UTC - 7 hours



Forum rules


1. NO BLATANT PIRACY. This includes reproducing homebrew less than 10 years old, with the exception of free software.
2. No advertising your reproductions, with the exception of free software.
3. Be nice. See RFC 1855 if you aren't sure what this means.



Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sat Nov 05, 2016 12:31 am 
Offline

Joined: Wed Aug 21, 2013 5:00 pm
Posts: 16
I am attempting to modify a ETROM to hold 2 - 256k SRAM chips so I can build a copy of the new updated Legend of Link by infidelity that has 3 separate save files. I know that an EWROM has the 256 SRAM but on this nesdev wiki page ( http://wiki.nesdev.com/w/index.php/ExROM ) it says at the bottom that the ETROM can be modified by using the SL15 solder pad instead of the CL15. I've got everything built but what's happening is when I try to select through the three save files only two of them will work. The third file freezes the game up. You can select between files 1 and 2 without any issues and they save fine. But when you try to select the third file it scrambles the screen, or blacks out the screen.

Does anyone have any idea what would be causing this to happen ?

If you need any further info please let me know.

And thank you , in advance , for your time and help.


Top
 Profile  
 
PostPosted: Sat Nov 05, 2016 1:53 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6042
Location: Seattle
Unfortunately, I did my best to determine the function of NES-ETROM CL15/SL15 based on pictures of the front and back (hence the "some unknown pin on the MMC5" bit)

So, if it's easy enough for you to program a new ROM, I could write a simple test ROM that would verify what's going on with RAM.

... Also, it really looks like Infidelity's LoZ1 MMC5 hack expects a single 32K RAM in slot one. You say you swapped both 8 KiB RAMs for two 32 KiB RAMs and changed the jumper, so nothing's obvious there... Could you verify that what I wrote about CL15/SL15 does what the wiki says it does?


Top
 Profile  
 
PostPosted: Sat Nov 05, 2016 2:21 am 
Offline

Joined: Wed Aug 21, 2013 5:00 pm
Posts: 16
Yes , I can do that. I'll post back here ASAP.


Top
 Profile  
 
PostPosted: Sat Nov 05, 2016 4:31 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6042
Location: Seattle
... thinking a little more about the behavior you describe, maybe my observation about PRG RAM A14 being connected is what's wrong ?

Infidelity wrote that the crash comes from trying to switch between banks 0 and 1-or-2 and having that fail ( http://acmlm.kafuka.org/board/thread.ph ... 703#163703 ) ... so if it only crashes on slot 2, that could be equivalent to only finding 16 KiB of RAM??


Top
 Profile  
 
PostPosted: Sat Nov 05, 2016 4:37 am 
Offline

Joined: Wed Aug 21, 2013 5:00 pm
Posts: 16
Ok. I've checked both ways and this is what I've got.

CL15 - SRAM26 to MMC5 83 (PRG RAM + CE)

SL15 - SRAM26 to MMC5 69 ( PRG RAM A13)

Hope that helps. Let me know if you need anything else.


Also, I am the one who built the copy for Infidelity using a EWROM. the wierd thing about that one was that it did this exact same thing at first. I recycled the game about 6 times and it quit freezing and started working correctly. He has told me it is still working fine. I have no answer on how it started working at all. It was freezing just like this and then it just quit.


Top
 Profile  
 
PostPosted: Sat Nov 05, 2016 4:44 am 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 241
I just want to explain how my sram works in this game, in regards to MMC5. But first a brief explanation to how the original Legend of Zelda works.

First, The Legend of Zelda heavily uses $6000-$7FFF for PRG-RAM, since 3 quarters of the $C000-$FFFF rom bank are occupied with DPCM samples.

With The Legend of Link, I use the MMC5 mapper which allows me to have 4 individual SRAM pages, 2000 bytes each.

The MMC5 uses the register $5113, to swap out the SRAM pages. Since my game only uses 3 save files, I only use the first 6000 bytes. (3 SRAM pages of 2000 bytes each)

Now here is how I accomplish creating the additional 2 SRAM pages without crashing the rom (at least on all 3 major PC emulators FCEUX, Nestopia & Nintendulator)

After you exit the title screen, the 1st sram page gets all of the PRG-RAM installed, and various other values. This is how the original Zelda does this. Now, once the SRAM page is finished being stored, the rom is then supposed to initiate the Registration Screen. In my game, I create a sub routine to custom asm, to prepare the creation of the other 2 SRAM pages. What I do, is copy the first byte of the first address of Page 0 in $5113, and then I swap out Page 0 to Page 1, and then I paste the value to the same address in Page 1, then I swap out Page 1 and load Page 2 and then paste the same value to the same address within Page 2. Then I bring back Page 0, load the next value from the next address, and I repeat this entire process until all 2000 bytes from Page 0 have been copied into Page's 1 & 2.

The end result, is this file i'm linking for all to see. http://www.filedropper.com/zelda-thelegendoflink You need a hex viewing program to see it. But this file shows 2 carbon copies of the first 2000 bytes, when the registration screen comes on.

$0-$1FFF SRAM Page 0 $5113 mmc5 (File 1)
$2000-$3FFF SRAM Page 1 $5113 mmc5 (File 2)
$4000-$5FFF SRAM Page 2 $5113 mmc5 (File 3)
$6000-$7FFF BLANK. NOT IN USE.

So when on the registration screen after all has been created, you cycle through the files with the D-PAD. When on File 1, that's showing the first 2000 bytes of the SRAM/mmc5's $5113, which is occupying the NES's $6000-$7FFF addresses. When you select File 2, the game swaps out mmc5's $5113's Page 0, to Page 1, which is $2000-$3FFF in the SRAM, and then has that occupying the NES's $6000-$7FFF addresses. When you select File 3, the game swaps out the mmc5's $5113's Page 1, to Page 2, which is $4000-$5FFF in the SRAM, and then has that occupying the NESs $6000-$7FFF addresses.

I've done extensive tests with this on all 3 PC emulators. All 3 emulators store, swap, save, load, everything correctly.

I hope this information helps in regards to real MMC5 hardware. :-)


Last edited by infidelity on Sat Nov 05, 2016 5:10 am, edited 6 times in total.

Top
 Profile  
 
PostPosted: Sat Nov 05, 2016 4:47 am 
Offline

Joined: Wed Aug 21, 2013 5:00 pm
Posts: 16
lidnariq wrote:
... thinking a little more about the behavior you describe, maybe my observation about PRG RAM A14 being connected is what's wrong ?

Infidelity wrote that the crash comes from trying to switch between banks 0 and 1-or-2 and having that fail ( http://acmlm.kafuka.org/board/thread.ph ... 703#163703 ) ... so if it only crashes on slot 2, that could be equivalent to only finding 16 KiB of RAM??



I don't think so. I've lifted pin 1 of the SRAM (A14) and it would only save one file. It would select between 1 and 2 but it was only 1 file. I saved the name "AAA" in slot 1 but it would show up in slot 2 too. So that was telling me that it wasn't recognizing any more than the one file. And when doing that file 3 would still freeze.


Top
 Profile  
 
PostPosted: Sat Nov 05, 2016 4:58 am 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 241
lidnariq wrote:
... thinking a little more about the behavior you describe, maybe my observation about PRG RAM A14 being connected is what's wrong ?

Infidelity wrote that the crash comes from trying to switch between banks 0 and 1-or-2 and having that fail ( http://acmlm.kafuka.org/board/thread.ph ... 703#163703 ) ... so if it only crashes on slot 2, that could be equivalent to only finding 16 KiB of RAM??


I was explaining a scenario for a crash.

"If the MMC5 $5113 is swapping, and nothing has been written to the new page by the time it is swapped into $6000-$7FFF, then the game will crash."

If you swap in a blank 2000 byte page into $6000-$7FFF, the game will instantly crash. This is due to the massive amount of PRG-RAM that is going on to run the game. When you have nothing but 00's occupying $6000-$7FFF, then all of the PRG-RAM is gone, and when the game returns to wherever within $6000-$7FFF, the game will instantly crash.


Top
 Profile  
 
PostPosted: Sat Nov 05, 2016 5:15 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6042
Location: Seattle
To make sure I understand: because LoZ1 is an FDS port, it copies data and code from PRG-ROM into PRG-RAM. If it tries to execute stuff in PRG-RAM before the MMC5 bankswitching duplication has happened, that will cause a crash.

So when does the duplication process happen? What would lead to this race condition where it tries to swap banks before the code has been correctly duplicated?

Does the program data/code in $6000-$7FFF (as opposed to the save game) ever change? (edit: listing the files in the FDS version insinuate the answer is no: only two images have a load chunk below $8000, and one of those looks like the save game initializer) Would Mbumstead's observation of "it crashing on the EWROM repro for the first six power cycles" be consistent with the hypothesis that: it doesn't change, and correctly seeding the RAM is all that's necessary to prevent crashes?

(Also, I assume when you write "2000 bytes" you meant "$2000 bytes"?)


Top
 Profile  
 
PostPosted: Sat Nov 05, 2016 8:59 am 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 241
Yes the $6000-$7FFF is copied from ROM and stored to RAM, and certain values will get switched and altered, like level construction of the dungeons, palettes, various other values, like the HP power o links sword.

Idk the exact location of my sub routine, I'm away from my laptop. But I feel what your trying to ask is vearing off topic.


Top
 Profile  
 
PostPosted: Mon Nov 21, 2016 3:45 am 
Offline

Joined: Mon Oct 21, 2013 11:32 pm
Posts: 18
I also made repro with 32KB and it have same problems with save-freezes.
Does anybody resolve it with real HW?


Top
 Profile  
 
PostPosted: Mon Jan 02, 2017 2:19 am 
Offline

Joined: Mon Oct 21, 2013 11:32 pm
Posts: 18
Freezes between save selects becouse SRAM filled with FF (when it empty). I solder battery to sram, write 00 (and also sav file from emulator) - no freezes between selects. But when i power off and power on famicom - game dont boot. I read sram to save file. Save file in attach.


Attachments:
Legend of Zelda_.zip [6.36 KiB]
Downloaded 33 times
Top
 Profile  
 
PostPosted: Tue Jan 03, 2017 12:10 am 
Offline

Joined: Sun Oct 16, 2016 1:03 pm
Posts: 9
Have the same problem with an EWROM. Freezes in save select. After that it freezes everytime earlier (in the intro).
Still haven't figured it out yet.


Top
 Profile  
 
PostPosted: Mon Jan 09, 2017 5:53 pm 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 241
I think I solved the issue. Waiting for confirmation before I release a revision, that my adjustments work on real hw now.


Top
 Profile  
 
PostPosted: Wed Jan 11, 2017 3:16 am 
Offline

Joined: Sun Oct 16, 2016 1:03 pm
Posts: 9
Awesome, if you want I can also test it, I have a socketed board ready atm.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group