#1  
Old 6th September 2014, 12:12 AM
Tarek701's Avatar
Tarek701 Tarek701 is offline
Member
 
Join Date: Mar 2009
Posts: 58
Exclamation Running SM64 on 16K EEPROM?

So, I was trying out to use 16K EEPROM instead of 4K. Obviously it didn't work again and so I took out Nemu64, debugged a bit and found the subroutines to write 1 block (8 byte) to EEPROM. Now, the eeprom however is completely filled and unusable for new stuff. So, I wanted to have it 16K EEPROM. However, this didn't work. Once I started my SM64 in PJ64, I just saw black (no error, nothing) I then researched again and found out that it's another checksum which deals with this. Checksum Subroutine.

Code:
ADDIU SP, SP, $FFF8
SH R0, $0006 (SP)
ADDIU AT, R0, $0002
SLT A2, AT, A1
BEQ A2, R0, $000342FC
ADDIU A1, A1, $FFFF
LHU T6, $0006 (SP)
LBU T7, $0000 (A0)
ADDIU A0, A0, $0001
ADDU T8, T6, T7
SH T8, $0006 (SP)
ADDIU AT, R0, $0002
SLT A2, AT, A1
BNEZ A2, $000342D8
ADDIU A1, A1, $FFFF
BEQ R0, R0, $0003430C
LHU V0, $0006 (SP)
BEQ R0, R0, $0003430C
NOP
JR RA
The A3 before seems to be "0x200" which is 512 bytes and actually is 4K EEPROM.
__________________
==========================
Familiar with MIPS r4300i ASM, Basic stuff in C.
Reply With Quote
  #2  
Old 6th September 2014, 01:00 AM
bryc bryc is offline
Junior Member
 
Join Date: Jun 2011
Posts: 9
Default

Not understanding what this is about, unless you're trying to mod the game. The game is designed to use only 512 bytes (4K) of Eeprom.

Do you got the offsets for that routine?
Reply With Quote
  #3  
Old 6th September 2014, 01:16 AM
Tarek701's Avatar
Tarek701 Tarek701 is offline
Member
 
Join Date: Mar 2009
Posts: 58
Default

Quote:
Originally Posted by bryc View Post
Not understanding what this is about, unless you're trying to mod the game. The game is designed to use only 512 bytes (4K) of Eeprom.

Do you got the offsets for that routine?
Yes, I'm trying to mod the game, but I'm not exactly sure if it's something to do with the emulator or with the game.

The checksum routine above is on:
802792C0 (RAM)

In ROM:
0x802792C0 - 0x80245000 = 0x342C0 (ROM).

I've discovered that A3 (from a prior) function is always 0x200 on eeprom-related stuff. 0x200 in decimal is 512, which means that A3 may be the current size of the eeprom.

I debugged it and got this:
0x00034A04: ADDIU A1, R0, $0200
0x00034A14: ADDIU A1, R0, $0200

(A1 is later added to A3)

I changed them to 0x800, didn't work, still black on sm64. I changed them to 0x700 (like the size of the donkey kong 64 eeprom, which is 1.75kb big), also still black on sm64.
__________________
==========================
Familiar with MIPS r4300i ASM, Basic stuff in C.

Last edited by Tarek701; 6th September 2014 at 01:20 AM.
Reply With Quote
  #4  
Old 15th December 2014, 07:30 PM
Tarek701's Avatar
Tarek701 Tarek701 is offline
Member
 
Join Date: Mar 2009
Posts: 58
Default

(Pretty old, but posting my discoveries)
Nevermind, I found the in-game functions.

subroutine Address to write to EEPROM is:
0x80328AF0

Read on n64devkit Site (which I got and leaked here):
http://n64devkit.square7.ch/n64man/os/osEepromWrite.htm

(Basically you have to consider, that a EEPROM Block is 8 bytes long)

And subroutine address to read EEPROM is:
0x80329150

Also, the same. You read 8 byte blocks.

Yes, this was my main goal. So, in short:
There's no need to run SM64 on 16K or anything.
__________________
==========================
Familiar with MIPS r4300i ASM, Basic stuff in C.
Reply With Quote
Reply

Tags
assembly, eeprom, extension, hacking, sm64

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 05:42 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.