UnclePunch
Smash Ace
- Joined
- Nov 9, 2014
- Messages
- 673
The dol included contains code to load the file "codes.txt" from the iso during startup and parse the ASCII to create a conventional hex gecko codelist in memory. The codehandler is run after the codes from the .txt have been parsed so there is a minimal impact on performace (if any) due to not calculating offsets and running codehandler code every frame.
Download v1.0 (SSBM v1.02 .dol)
The structure of the code.txt file is near exact to that of Dolphin's gecko .ini format. Here's some examples of various accepted formats by the txt loader:
_______________________________
Here is the code I used to load the .txt into RAM
Download v1.0 (SSBM v1.02 .dol)
The structure of the code.txt file is near exact to that of Dolphin's gecko .ini format. Here's some examples of various accepted formats by the txt loader:
Code:
$Codename Here [Creator Here]
0402f47c 38000004
$Codename Here [Creator Here]
*this code does something
0402f47c 38000004
$Codename Here [Creator Here]
*this code does something
0402f47c 38000004 #this codeline something
$Codename Here [Creator Here]
*this code does something
0402f47c 38000004 #this codeline something
0402f47c 38000004 #the codeline waaay down here does something
Here is the code I used to load the .txt into RAM
Code:
]#########################
## LOAD FILE FROM DISC ##
#########################
#LoadFileFromDisc
#r3 = file name ASCII
#returns start of file in memory in r3 and file length in r5
mflr r0
stw r0, 0x0004 (sp)
stwu sp, -0x0020 (sp)
stw r31, 0x001C (sp)
stw r30, 0x0018 (sp)
stw r29, 0x0014 (sp)
mr r29, r3
branchl r12,0x800163D8
addi r0, r3, 31
rlwinm r4, r0, 0, 0, 26
li r3, 0
branchl r12,0x80015BD0
addi r31, r3, 0
li r3, 0
li r4, 68
branchl r12,0x80015BD0
addi r30, r3, 0
addi r3, r29, 0
addi r4, r31, 0
addi r5, sp, 12
branchl r12,0x8001668C
lwz r5, 0x000C (sp)
addi r3, r31, 0
addi r4, r30, 0
lwz r0, 0x0024 (sp)
lwz r31, 0x001C (sp)
lwz r30, 0x0018 (sp)
lwz r29, 0x0014 (sp)
addi sp, sp, 32
mtlr r0
blr
Last edited: