N64 homebrew cartridge can not save sram.

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
N64 homebrew cartridge can not save sram.
by on (#202765)
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.
Re: N64 homebrew cartridge can not save sram.
by on (#202815)
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.
Re: N64 homebrew cartridge can not save sram.
by on (#202836)
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:
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) [!]";
Re: N64 homebrew cartridge can not save sram.
by on (#202851)
At this point, I'd compare to a known-good save from e.g. an emulator.
Re: N64 homebrew cartridge can not save sram.
by on (#202873)
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.
Re: N64 homebrew cartridge can not save sram.
by on (#202881)
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)
Re: N64 homebrew cartridge can not save sram.
by on (#202889)
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.
Re: N64 homebrew cartridge can not save sram.
by on (#203100)
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.
Re: N64 homebrew cartridge can not save sram.
by on (#203130)
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.
Re: N64 homebrew cartridge can not save sram.
by on (#203134)
byemu wrote:
BTW, I solved the sram problem.
What was wrong?
Re: N64 homebrew cartridge can not save sram.
by on (#203135)
lidnariq wrote:
byemu wrote:
BTW, I solved the sram problem.
What was wrong?

SRAM logic not same as ROM logic.