N64 homebrew cartridge can not save sram.

Discussion of development of software for any "obsolete" computer or video game system.
Post Reply
User avatar
byemu
Posts: 295
Joined: Mon Sep 05, 2011 5:56 pm
Contact:

N64 homebrew cartridge can not save sram.

Post by byemu » Sat Aug 19, 2017 3:58 am

This is my n64 homebrew cartridge,I have flash a n64 game called biohazard2.
Image
But in game, can not save sram.
when I read 32k sram from cartridge, 32k data only the first 4byte show BIO2, others data is all 0x00.
Last edited by byemu on Sat Aug 19, 2017 4:09 am, edited 2 times in total.

lidnariq
Posts: 9676
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: N64 homebrew cartridge can not save sram.

Post by lidnariq » Sat Aug 19, 2017 3:33 pm

Do you have the source for the logic in the MAX2 ?

More-or-less the only other thing you could do would be to compare a known good save to the wrong values you're getting.

User avatar
byemu
Posts: 295
Joined: Mon Sep 05, 2011 5:56 pm
Contact:

Re: N64 homebrew cartridge can not save sram.

Post by byemu » Sun Aug 20, 2017 12:51 am

lidnariq wrote:Do you have the source for the logic in the MAX2 ?

More-or-less the only other thing you could do would be to compare a known good save to the wrong values you're getting.
This is core mycode:

Code: Select all

assign enable_rom  = m_address[30:27]==4'b0001 ? aleh : 1'b1;//0x10000000
assign enable_sram = m_address[30:26]==5'b00001 ? aleh : 1'b1 ;//0x08000000
It's work on game "Ogre Battle 64 - Person of Lordly Caliber (U) (V1.0) [!]";

lidnariq
Posts: 9676
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: N64 homebrew cartridge can not save sram.

Post by lidnariq » Sun Aug 20, 2017 11:00 am

At this point, I'd compare to a known-good save from e.g. an emulator.

User avatar
byemu
Posts: 295
Joined: Mon Sep 05, 2011 5:56 pm
Contact:

Re: N64 homebrew cartridge can not save sram.

Post by byemu » Sun Aug 20, 2017 4:30 pm

lidnariq wrote:At this point, I'd compare to a known-good save from e.g. an emulator.
Maybe it's depend on the CIC, but I'm not sure.

lidnariq
Posts: 9676
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: N64 homebrew cartridge can not save sram.

Post by lidnariq » Sun Aug 20, 2017 5:51 pm

If it were the wrong CIC, that would prevent booting altogether ... unless it both needs, and you have, a bad implementation of the 6105.

(The hash of the first 4 KiB of the cart ROM has to match the hash presented by the CIC or else the PIF goes into an infinite loop. If the hash does match, then it passes off execution in those 4 KiB)

User avatar
byemu
Posts: 295
Joined: Mon Sep 05, 2011 5:56 pm
Contact:

Re: N64 homebrew cartridge can not save sram.

Post by byemu » Sun Aug 20, 2017 8:26 pm

lidnariq wrote:If it were the wrong CIC, that would prevent booting altogether ... unless it both needs, and you have, a bad implementation of the 6105.

(The hash of the first 4 KiB of the cart ROM has to match the hash presented by the CIC or else the PIF goes into an infinite loop. If the hash does match, then it passes off execution in those 4 KiB)
1 How to change a homebrew rom to a spencified cic(ex: 6105,only boot on a 6105cic).
2 My verilog code is wrong.

lidnariq
Posts: 9676
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: N64 homebrew cartridge can not save sram.

Post by lidnariq » Wed Aug 23, 2017 8:35 am

The x101 and x102 boot sectors can be just directly interchanged; the other three CICs each do something different and can't be easily swapped.

Flashcarts like the everdrive64 reimplement the boot sectors in order to allow running everything as though it were on a 6102/7101.

User avatar
byemu
Posts: 295
Joined: Mon Sep 05, 2011 5:56 pm
Contact:

Re: N64 homebrew cartridge can not save sram.

Post by byemu » Wed Aug 23, 2017 7:32 pm

lidnariq wrote:The x101 and x102 boot sectors can be just directly interchanged; the other three CICs each do something different and can't be easily swapped.

Flashcarts like the everdrive64 reimplement the boot sectors in order to allow running everything as though it were on a 6102/7101.
Maybe need a bootemu, first will boot to bootemu,next swap the rom section via mmc,then boot to gamerom.

BTW, I solved the sram problem.

lidnariq
Posts: 9676
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: N64 homebrew cartridge can not save sram.

Post by lidnariq » Wed Aug 23, 2017 9:06 pm

byemu wrote:BTW, I solved the sram problem.
What was wrong?

User avatar
byemu
Posts: 295
Joined: Mon Sep 05, 2011 5:56 pm
Contact:

Re: N64 homebrew cartridge can not save sram.

Post by byemu » Wed Aug 23, 2017 9:27 pm

lidnariq wrote:
byemu wrote:BTW, I solved the sram problem.
What was wrong?
SRAM logic not same as ROM logic.

Post Reply