-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.asm
149 lines (131 loc) · 4.48 KB
/
main.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
.psp
; Syscalls
sceIoOpen equ 0x0890B938
sceIoRead equ 0x0890B908
sceIoClose equ 0x0890B918
sceIoWrite equ 0x0890B8F8
sceIoMkdir equ 0x0890BC80
sceKernelIcacheInvalidateAll equ 0x0890BB30
sceKernelDcacheWritebackInvalidateAll equ 0x0890BB38
memcpy equ 0x0880CD4C
strcpy equ 0x0880FB30
strcat equ 0x0880F90C
strcmp equ 0x0880FAC4
; Memory regions
;Preload
PreloadDataStore equ 0x089C7510
PreloaderExec equ 0x089C7530
PreloadFileCache equ 0x08B6E880 ; Size - 1589248
;Modload
MLFileBin equ 0x08A35510 ; Size - 832
MLConfigBin equ 0x08A35850 ; Size - 64
; DataStore = DataBlock+nativePSP = 128 bytes
; DataBlock allocation:
; 0x0 - FileID (0x2)
; 0x4 - File Address (0x4)
; 0x8 - FileSize (0x4)
; 0xC - Currently interacted carve amount remaining (0x1)
MLDataBlock equ 0x08A35890 ; Size - 80
MLnativePSP equ 0x08A358E0 ; size - 48
ModloaderCode equ 0x08A35910 ; modload.bin location
; Set a macro for adjusting addresses to uncached
.macro vla,dest,value
la dest,value + 0x40000000
.endmacro
.macro vj,value
j value + 0x40000000
.endmacro
; Main binary
.open "binary/EBOOT.BIN","build/ISO_ROOT/PSP_GAME/SYSDIR/EBOOT.BIN",0x08801A4C
.include "patches/boot.asm"
.include "modloader/preloader_init.asm"
.close
; Main Menu
.open "binary/overlay/demo_task.ovl","build/data_in/0043",0x09A5A580
.include "patches/demo_task.asm"
.close
; New Game Menu
.open "binary/overlay/edit_task.ovl","build/data_in/0044",0x09A5A580
.include "patches/edit_task.asm"
.close
; Continue Menu
.open "binary/overlay/cont_task.ovl","build/data_in/0045",0x09A5A580
.include "patches/cont_task.asm"
.close
; Options Menu
.open "binary/overlay/option_task.ovl","build/data_in/0046",0x09A5A580
.include "patches/option_task.asm"
.close
; Gallery Menu
.open "binary/overlay/gallery_task.ovl","build/data_in/0047",0x09A5A580
.include "patches/gallery_task.asm"
.close
; Lobby Task (village/guildhall)
.open "binary/overlay/lobby_task.ovl","build/data_in/0050",0x09A5A580
.include "patches/lobby_task.asm"
.close
; Game Task (in-quest)
.open "binary/overlay/game_task.ovl","build/data_in/0051",0x09A5A580
.include "patches/game_task.asm"
.close
; Training Hall
.open "binary/overlay/arcade_task.ovl","build/data_in/0053",0x09A5A580
.include "patches/arcade_task.asm"
.close
; Game Sub
.open "binary/overlay/game_sub.ovl","build/data_in/0056",0x09C14280
.include "patches/game_sub.asm"
.close
.createfile "build/ISO_ROOT/FUC/PRELOAD.BIN",PreloaderExec-0x4
preloader_start:
.word preloader_end-preloader_start-0x4
.include "modloader/preloader_exec.asm"
PreloadRTN:
; Clear caches
jal sceKernelIcacheInvalidateAll
nop
jal sceKernelDcacheWritebackInvalidateAll
nop
li v0,0x0
; Restore reg
lw s0,0x1C(sp)
lw a1,0x18(sp)
lw v1,0x14(sp)
move a0,s0
jal 0x0884F7B0
addiu sp,sp,0x20
j PreloaderInitHook+8
nop
preloader_end:
.close
.createfile "build/ISO_ROOT/FUC/MODLOAD.BIN",ModloaderCode-0x4
modloader_start:
.word modloader_end-modloader_start-0x4
.include "modloader/fileidgen.asm"
.include "modloader/fileops.asm"
; Mods
.include "mods/nativePSP_toggle.asm"
.include "mods/questloader.asm"
.include "mods/hold_gather.asm"
.include "mods/guildhall.asm"
.include "mods/hh_rework.asm"
modloader_end:
.close
.createfile "build/ISO_ROOT/FUC/CONFIG.BIN",0x0
.area 64,0
; Version string, also found in preloader_exec.
.ascii "DEBUG ENG " ; Version (add a space at the end, limit 12 characters total)
.align 0x10
.db 0x0 ; 0x10 - File replacer toggle
.db 0x1 ; 0x11 - Save region (0x0:JP, 0x1:US, 0x2:EU)
.db 0x0 ; 0x12 - True raw flag
.db 0x0 ; 0x13 - Dos audio
.dh 0x3F5F ; 0x14 - FoV value
.db 0x3 ; 0x16 - Vertical snap start position
.db 0x0 ; 0x17 - Minimap scale
.db 0x0 ; 0x18 - HH rework toggle
.db 0x0 ; 0x19 - Early Lao kill toggle
.db 0x0 ; 0x1A - Full chest guildhall (offline)
.db 0x0 ; 0x1B - Guildhall drink buff
.endarea
.close