Migrated from xkas to armips
This commit is contained in:
parent
4682020e8b
commit
07eb279677
|
@ -7,19 +7,12 @@
|
|||
*.bak
|
||||
Thumbs.db
|
||||
snapshots/
|
||||
xkas/
|
||||
new/
|
||||
notes/
|
||||
resize/
|
||||
ignore/
|
||||
workingold/
|
||||
mother12/
|
||||
vwf_src/
|
||||
temp/
|
||||
fresh/
|
||||
working/*.asm
|
||||
working/*.bin
|
||||
xkas-symbols.sym
|
||||
armips.exe
|
||||
armips-symbols.sym
|
||||
m12.sym
|
||||
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
|
|
|
@ -26,4 +26,4 @@ Some screenshots:
|
|||
![](./screenshots/itshappening2.png) ![](./screenshots/itshappening4.png) ![](./screenshots/itshappening5.png) ![](./screenshots/m2-status2.png)
|
||||
|
||||
### Dependencies
|
||||
If you want to just use the graphical tool to help with the translation, you just need .NET 4.5.1. If you want to actually compile the hack code and test it out, you will need a copy of xkas. Unfortunately I have no idea where I got my copy (my version seems to be much newer than anything I can find on Google) and the program author hasn't uploaded any copies either. The game also crashes horribly 99% of the time in its current state, so there's no point in trying it. I might post the xkas binary once the hack is in a playable state.
|
||||
If you want to just use the graphical tool to help with the translation, you just need .NET 4.5.1. If you want to actually compile the hack code and test it out, you will need [armips](https://github.com/Kingcom/armips). The game also crashes horribly 99% of the time in its current state, so there's no point in trying it.
|
||||
|
|
|
@ -71,7 +71,8 @@ namespace ScriptTool
|
|||
|
||||
using (IncludeFile = File.CreateText(Path.Combine(options.WorkingDirectory, "m12-includes.asm")))
|
||||
{
|
||||
IncludeFile.WriteLine("arch gba.thumb");
|
||||
IncludeFile.WriteLine(".gba");
|
||||
IncludeFile.WriteLine(".open \"../m12.gba\",0x8000000");
|
||||
|
||||
// Compile main string tables
|
||||
if (options.DoMainText)
|
||||
|
@ -84,6 +85,8 @@ namespace ScriptTool
|
|||
{
|
||||
CompileM12Misc();
|
||||
}
|
||||
|
||||
IncludeFile.WriteLine(".close");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -376,7 +379,7 @@ namespace ScriptTool
|
|||
|
||||
using (var labelAsmFile = File.CreateText(Path.Combine(options.WorkingDirectory, "m12-main-strings.asm")))
|
||||
{
|
||||
labelAsmFile.WriteLine(String.Format("org ${0:X}; incbin m12-main-strings.bin", baseAddress | 0x8000000));
|
||||
labelAsmFile.WriteLine(String.Format(".org 0x{0:X} :: .incbin \"m12-main-strings.bin\"", baseAddress | 0x8000000));
|
||||
labelAsmFile.WriteLine();
|
||||
|
||||
foreach (var file in labelFiles)
|
||||
|
@ -386,13 +389,13 @@ namespace ScriptTool
|
|||
|
||||
foreach (var stringRef in mainStringRefs)
|
||||
{
|
||||
labelAsmFile.WriteLine(String.Format("org ${0:X}; dd ${1:X8}",
|
||||
labelAsmFile.WriteLine(String.Format(".org 0x{0:X} :: dw 0x{1:X8}",
|
||||
stringRef.PointerLocation | 0x8000000, m12Compiler.AddressMap[stringRef.Label] | 0x8000000));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IncludeFile.WriteLine("incsrc m12-main-strings.asm");
|
||||
IncludeFile.WriteLine(".include \"m12-main-strings.asm\"");
|
||||
}
|
||||
|
||||
static void CompileM12Misc()
|
||||
|
@ -428,7 +431,7 @@ namespace ScriptTool
|
|||
IncludeFile.WriteLine("// Fix pointers to \"PSI \"");
|
||||
foreach (var address in updateAddresses)
|
||||
{
|
||||
IncludeFile.WriteLine(String.Format("org ${0:X}; dd ${1:X8}",
|
||||
IncludeFile.WriteLine(String.Format(".org 0x{0:X} :: dw 0x{1:X8}",
|
||||
address | 0x8000000, psiPointer | 0x8000000));
|
||||
}
|
||||
|
||||
|
@ -452,14 +455,14 @@ namespace ScriptTool
|
|||
using (var offsetFile = File.CreateText(Path.Combine(options.WorkingDirectory, name + ".asm")))
|
||||
{
|
||||
// Include the binfile
|
||||
offsetFile.WriteLine(String.Format("org ${0:X}; incbin {1}.bin",
|
||||
offsetFile.WriteLine(String.Format(".org 0x{0:X} :: .incbin \"{1}.bin\"",
|
||||
baseAddress | 0x8000000, name));
|
||||
offsetFile.WriteLine();
|
||||
|
||||
// Compile all strings
|
||||
foreach (var str in stringCollection.StringRefs.OrderBy(s => s.Index))
|
||||
{
|
||||
offsetFile.WriteLine(String.Format("org ${0:X}; dd ${1:X8}",
|
||||
offsetFile.WriteLine(String.Format(".org 0x{0:X} :: dw 0x{1:X8}",
|
||||
str.OffsetLocation | 0x8000000, referenceAddress - stringCollection.StringsLocation));
|
||||
|
||||
m12Compiler.CompileString(str.New, buffer, ref referenceAddress, ebCharLookup);
|
||||
|
@ -470,7 +473,7 @@ namespace ScriptTool
|
|||
File.WriteAllBytes(Path.Combine(options.WorkingDirectory, name + ".bin"), buffer.ToArray());
|
||||
|
||||
// Add to the include file
|
||||
IncludeFile.WriteLine("incsrc " + name + ".asm");
|
||||
IncludeFile.WriteLine(".include \"" + name + ".asm\"");
|
||||
}
|
||||
|
||||
static IList<int> CompileM12FixedStringCollection(string name, ref int referenceAddress)
|
||||
|
@ -487,14 +490,14 @@ namespace ScriptTool
|
|||
using (var offsetFile = File.CreateText(Path.Combine(options.WorkingDirectory, name + ".asm")))
|
||||
{
|
||||
// Include the binfile
|
||||
offsetFile.WriteLine(String.Format("org ${0:X}; incbin {1}.bin",
|
||||
offsetFile.WriteLine(String.Format(".org 0x{0:X} :: .incbin \"{1}.bin\"",
|
||||
baseAddress | 0x8000000, name));
|
||||
offsetFile.WriteLine();
|
||||
|
||||
// Update table pointers
|
||||
foreach (int tablePointer in stringCollection.TablePointers)
|
||||
{
|
||||
offsetFile.WriteLine(String.Format("org ${0:X}; dd ${1:X8}",
|
||||
offsetFile.WriteLine(String.Format(".org 0x{0:X} :: dw 0x{1:X8}",
|
||||
tablePointer | 0x8000000, baseAddress | 0x8000000));
|
||||
}
|
||||
|
||||
|
@ -510,7 +513,7 @@ namespace ScriptTool
|
|||
File.WriteAllBytes(Path.Combine(options.WorkingDirectory, name + ".bin"), buffer.ToArray());
|
||||
|
||||
// Add to the include file
|
||||
IncludeFile.WriteLine("incsrc " + name + ".asm");
|
||||
IncludeFile.WriteLine(".include \"" + name + ".asm\"");
|
||||
|
||||
return newPointers;
|
||||
}
|
||||
|
@ -530,7 +533,7 @@ namespace ScriptTool
|
|||
using (var offsetFile = File.CreateText(Path.Combine(options.WorkingDirectory, name + ".asm")))
|
||||
{
|
||||
// Include the binfile
|
||||
offsetFile.WriteLine(String.Format("org ${0:X}; incbin {1}.bin",
|
||||
offsetFile.WriteLine(String.Format(".org 0x{0:X} :: .incbin \"{1}.bin\"",
|
||||
baseAddress | 0x8000000, name));
|
||||
offsetFile.WriteLine();
|
||||
|
||||
|
@ -540,7 +543,7 @@ namespace ScriptTool
|
|||
{
|
||||
foreach (int ptr in str.PointerLocations)
|
||||
{
|
||||
offsetFile.WriteLine(String.Format("org ${0:X}; dd ${1:X8}",
|
||||
offsetFile.WriteLine(String.Format(".org 0x{0:X} :: dw 0x{1:X8}",
|
||||
ptr | 0x8000000, referenceAddress | 0x8000000));
|
||||
}
|
||||
|
||||
|
@ -553,7 +556,7 @@ namespace ScriptTool
|
|||
File.WriteAllBytes(Path.Combine(options.WorkingDirectory, name + ".bin"), buffer.ToArray());
|
||||
|
||||
// Add to the include file
|
||||
IncludeFile.WriteLine("incsrc " + name + ".asm");
|
||||
IncludeFile.WriteLine(".include \"" + name + ".asm\"");
|
||||
|
||||
return stringAddresses;
|
||||
}
|
||||
|
@ -571,7 +574,7 @@ namespace ScriptTool
|
|||
using (var offsetFile = File.CreateText(Path.Combine(options.WorkingDirectory, name + ".asm")))
|
||||
{
|
||||
// Include the binfile
|
||||
offsetFile.WriteLine(String.Format("org ${0:X}; incbin {1}.bin",
|
||||
offsetFile.WriteLine(String.Format(".org 0x{0:X} :: .incbin \"{1}.bin\"",
|
||||
baseAddress | 0x8000000, name));
|
||||
offsetFile.WriteLine();
|
||||
|
||||
|
@ -583,7 +586,7 @@ namespace ScriptTool
|
|||
|
||||
foreach (int ptr in str.PointerLocations)
|
||||
{
|
||||
offsetFile.WriteLine(String.Format("org ${0:X}; dd ${1:X8}",
|
||||
offsetFile.WriteLine(String.Format(".org 0x{0:X} :: dw 0x{1:X8}",
|
||||
ptr | 0x8000000, referenceAddress | 0x8000000));
|
||||
}
|
||||
|
||||
|
@ -598,7 +601,7 @@ namespace ScriptTool
|
|||
File.WriteAllBytes(Path.Combine(options.WorkingDirectory, name + ".bin"), buffer.ToArray());
|
||||
|
||||
// Add to the include file
|
||||
IncludeFile.WriteLine("incsrc " + name + ".asm");
|
||||
IncludeFile.WriteLine(".include \"" + name + ".asm\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
copy /Y m12fresh.gba m12.gba
|
||||
xkas\xkas.exe m12.gba m2-hack.asm xkas-symbols.sym
|
||||
armips.exe m2-hack.asm -sym armips-symbols.sym
|
||||
pushd working
|
||||
..\xkas\xkas.exe ..\m12.gba m12-includes.asm
|
||||
..\armips.exe m12-includes.asm
|
||||
popd
|
||||
resize m12.gba 16777216
|
||||
SymbolTableBuilder\SymbolTableBuilder\bin\Debug\symbols.exe m12.sym m12-symbols.sym xkas-symbols.sym
|
||||
SymbolTableBuilder\SymbolTableBuilder\bin\Debug\symbols.exe m12.sym m12-symbols.sym armips-symbols.sym
|
||||
pause
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
m2_customcodes:
|
||||
|
||||
//==============================================================================
|
||||
// void parse(int code, char* parserAddress, WINDOW* window)
|
||||
// In:
|
||||
|
@ -10,84 +8,81 @@ m2_customcodes:
|
|||
// r0: control code length (0 if not matched)
|
||||
//==============================================================================
|
||||
|
||||
.parse:
|
||||
customcodes_parse:
|
||||
|
||||
push {r1-r5,lr}
|
||||
mov r3,#0
|
||||
mov r3,0
|
||||
mov r4,r0
|
||||
|
||||
//--------------------------------
|
||||
// 60 FF XX: Add XX pixels to the renderer
|
||||
cmp r4,#0x60
|
||||
bne +
|
||||
mov r3,#3
|
||||
cmp r4,0x60
|
||||
bne @@next
|
||||
mov r3,3
|
||||
|
||||
// Get the current X offset
|
||||
ldrh r4,[r2,#2]
|
||||
ldrh r4,[r2,2]
|
||||
|
||||
// Get the current X tile
|
||||
ldrh r5,[r2,#0x2A]
|
||||
ldrh r5,[r2,0x2A]
|
||||
|
||||
lsl r5,r5,#3
|
||||
lsl r5,r5,3
|
||||
add r4,r4,r5 // Current X location (in pixels)
|
||||
|
||||
// Get the value to add
|
||||
ldrb r5,[r1,#2] // Control code parameter
|
||||
ldrb r5,[r1,2] // Control code parameter
|
||||
add r4,r4,r5 // New X location
|
||||
|
||||
// Store the pixel offset of the new location
|
||||
.store_x:
|
||||
lsl r5,r4,#29
|
||||
lsr r5,r5,#29
|
||||
strh r5,[r2,#2]
|
||||
@@store_x:
|
||||
lsl r5,r4,29
|
||||
lsr r5,r5,29
|
||||
strh r5,[r2,2]
|
||||
|
||||
// Store the X tile of the new location
|
||||
lsr r4,r4,#3
|
||||
strh r4,[r2,#0x2A]
|
||||
b .parse_end
|
||||
lsr r4,r4,3
|
||||
strh r4,[r2,0x2A]
|
||||
b @@end
|
||||
|
||||
+
|
||||
@@next:
|
||||
|
||||
//--------------------------------
|
||||
// 5F FF XX: Set the X value of the renderer
|
||||
cmp r4,#0x5F
|
||||
bne +
|
||||
mov r3,#3
|
||||
cmp r4,0x5F
|
||||
bne @@next2
|
||||
mov r3,3
|
||||
|
||||
// Get the new X value
|
||||
ldrb r4,[r1,#2]
|
||||
b .store_x
|
||||
ldrb r4,[r1,2]
|
||||
b @@store_x
|
||||
|
||||
+
|
||||
@@next2:
|
||||
|
||||
//--------------------------------
|
||||
// 5E FF XX: Load value into memory
|
||||
cmp r4,#0x5E
|
||||
bne +
|
||||
mov r3,#3
|
||||
cmp r4,0x5E
|
||||
bne @@end
|
||||
mov r3,3
|
||||
|
||||
// Get the argument
|
||||
ldrb r4,[r1,#2]
|
||||
cmp r4,#1
|
||||
bne .parse_5e_next01
|
||||
ldrb r4,[r1,2]
|
||||
cmp r4,1
|
||||
bne @@end
|
||||
|
||||
// 01: load enemy plurality
|
||||
ldr r1,=#0x2025038
|
||||
ldrb r1,[r1,#0] // number of enemies at start of battle
|
||||
cmp r1,#4
|
||||
blt .parse_5e_01_small
|
||||
mov r1,#3
|
||||
.parse_5e_01_small:
|
||||
ldr r1,=0x2025038
|
||||
ldrb r1,[r1,0] // number of enemies at start of battle
|
||||
cmp r1,4
|
||||
blt @@small
|
||||
mov r1,3
|
||||
@@small:
|
||||
mov r0,r1 // the jump table is 1-indexed
|
||||
mov r4,r3
|
||||
bl $80A334C // store to window memory
|
||||
bl 0x80A334C // store to window memory
|
||||
mov r3,r4
|
||||
|
||||
.parse_5e_next01:
|
||||
|
||||
+
|
||||
|
||||
//--------------------------------
|
||||
.parse_end:
|
||||
@@end:
|
||||
mov r0,r3
|
||||
pop {r1-r5,pc}
|
||||
.pool
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
m2_formatting:
|
||||
|
||||
|
||||
//==============================================================================
|
||||
// http://en.wikipedia.org/wiki/Double_dabble
|
||||
// int bin_to_bcd(int binary)
|
||||
|
@ -11,112 +8,112 @@ m2_formatting:
|
|||
// r1: amount of digits used
|
||||
//==============================================================================
|
||||
|
||||
.bin_to_bcd:
|
||||
bin_to_bcd:
|
||||
|
||||
push {r2-r7,lr}
|
||||
mov r2,r8
|
||||
mov r3,r9
|
||||
push {r2-r3}
|
||||
|
||||
lsl r0,r0,#5
|
||||
mov r1,#0
|
||||
mov r3,#27
|
||||
mov r4,#3
|
||||
lsl r4,r4,#8
|
||||
lsl r5,r4,#4
|
||||
lsl r6,r5,#4
|
||||
lsl r7,r6,#12
|
||||
lsl r0,r0,5
|
||||
mov r1,0
|
||||
mov r3,27
|
||||
mov r4,3
|
||||
lsl r4,r4,8
|
||||
lsl r5,r4,4
|
||||
lsl r6,r5,4
|
||||
lsl r7,r6,12
|
||||
mov r9,r7
|
||||
lsl r7,r6,#8
|
||||
lsl r7,r6,8
|
||||
mov r8,r7
|
||||
lsl r7,r6,#4
|
||||
lsl r7,r6,4
|
||||
|
||||
//--------------------------------
|
||||
-
|
||||
@@prev:
|
||||
|
||||
// Ones
|
||||
lsl r2,r1,#28
|
||||
lsr r2,r2,#28
|
||||
cmp r2,#5
|
||||
bcc +
|
||||
add r1,r1,#3
|
||||
+
|
||||
lsl r2,r1,28
|
||||
lsr r2,r2,28
|
||||
cmp r2,5
|
||||
bcc @@next
|
||||
add r1,r1,3
|
||||
@@next:
|
||||
|
||||
// Tens
|
||||
lsl r2,r1,#24
|
||||
lsr r2,r2,#28
|
||||
cmp r2,#5
|
||||
bcc +
|
||||
add r1,#0x30
|
||||
+
|
||||
lsl r2,r1,24
|
||||
lsr r2,r2,28
|
||||
cmp r2,5
|
||||
bcc @@next2
|
||||
add r1,0x30
|
||||
@@next2:
|
||||
|
||||
// Hundreds
|
||||
lsl r2,r1,#20
|
||||
lsr r2,r2,#28
|
||||
cmp r2,#5
|
||||
bcc +
|
||||
lsl r2,r1,20
|
||||
lsr r2,r2,28
|
||||
cmp r2,5
|
||||
bcc @@next3
|
||||
add r1,r1,r4
|
||||
+
|
||||
@@next3:
|
||||
|
||||
// Thousands
|
||||
lsl r2,r1,#16
|
||||
lsr r2,r2,#28
|
||||
cmp r2,#5
|
||||
bcc +
|
||||
lsl r2,r1,16
|
||||
lsr r2,r2,28
|
||||
cmp r2,5
|
||||
bcc @@next4
|
||||
add r1,r1,r5
|
||||
+
|
||||
@@next4:
|
||||
|
||||
// Ten-thousands
|
||||
lsl r2,r1,#12
|
||||
lsr r2,r2,#28
|
||||
cmp r2,#5
|
||||
bcc +
|
||||
lsl r2,r1,12
|
||||
lsr r2,r2,28
|
||||
cmp r2,5
|
||||
bcc @@next5
|
||||
add r1,r1,r6
|
||||
+
|
||||
@@next5:
|
||||
|
||||
// Hundred-thousands
|
||||
lsl r2,r1,#8
|
||||
lsr r2,r2,#28
|
||||
cmp r2,#5
|
||||
bcc +
|
||||
lsl r2,r1,8
|
||||
lsr r2,r2,28
|
||||
cmp r2,5
|
||||
bcc @@next6
|
||||
add r1,r1,r7
|
||||
+
|
||||
@@next6:
|
||||
|
||||
// Millions
|
||||
lsl r2,r1,#4
|
||||
lsr r2,r2,#28
|
||||
cmp r2,#5
|
||||
bcc +
|
||||
lsl r2,r1,4
|
||||
lsr r2,r2,28
|
||||
cmp r2,5
|
||||
bcc @@next7
|
||||
add r1,r8
|
||||
+
|
||||
@@next7:
|
||||
|
||||
// Ten-millions
|
||||
lsr r2,r2,#28
|
||||
cmp r2,#5
|
||||
bcc +
|
||||
lsr r2,r2,28
|
||||
cmp r2,5
|
||||
bcc @@next8
|
||||
add r1,r9
|
||||
+
|
||||
@@next8:
|
||||
|
||||
// Shift
|
||||
lsl r1,r1,#1
|
||||
lsl r1,r1,1
|
||||
tst r0,r0
|
||||
bpl +
|
||||
add r1,r1,#1
|
||||
+
|
||||
lsl r0,r0,#1
|
||||
sub r3,r3,#1
|
||||
bne -
|
||||
bpl @@next9
|
||||
add r1,r1,1
|
||||
@@next9:
|
||||
lsl r0,r0,1
|
||||
sub r3,r3,1
|
||||
bne @@prev
|
||||
mov r0,r1
|
||||
|
||||
//--------------------------------
|
||||
// Check how many digits are used
|
||||
mov r3,#1
|
||||
-
|
||||
lsr r1,r1,#4
|
||||
beq +
|
||||
add r3,r3,#1
|
||||
b -
|
||||
+
|
||||
mov r3,1
|
||||
@@prev2:
|
||||
lsr r1,r1,4
|
||||
beq @@next10
|
||||
add r3,r3,1
|
||||
b @@prev2
|
||||
@@next10:
|
||||
|
||||
//--------------------------------
|
||||
mov r1,r3
|
||||
|
@ -134,65 +131,65 @@ pop {r2-r7,pc}
|
|||
// r0: binary number
|
||||
//==============================================================================
|
||||
|
||||
.bcd_to_bin:
|
||||
bcd_to_bin:
|
||||
|
||||
push {r1-r4,lr}
|
||||
mov r1,#0
|
||||
mov r2,#10
|
||||
mov r3,#1
|
||||
mov r1,0
|
||||
mov r2,10
|
||||
mov r3,1
|
||||
|
||||
//--------------------------------
|
||||
// Ones
|
||||
lsl r4,r0,#28
|
||||
lsr r4,r4,#28
|
||||
lsl r4,r0,28
|
||||
lsr r4,r4,28
|
||||
mul r4,r3
|
||||
add r1,r1,r4
|
||||
mul r3,r2
|
||||
|
||||
// Tens
|
||||
lsl r4,r0,#24
|
||||
lsr r4,r4,#28
|
||||
lsl r4,r0,24
|
||||
lsr r4,r4,28
|
||||
mul r4,r3
|
||||
add r1,r1,r4
|
||||
mul r3,r2
|
||||
|
||||
// Hundreds
|
||||
lsl r4,r0,#20
|
||||
lsr r4,r4,#28
|
||||
lsl r4,r0,20
|
||||
lsr r4,r4,28
|
||||
mul r4,r3
|
||||
add r1,r1,r4
|
||||
mul r3,r2
|
||||
|
||||
// Thousands
|
||||
lsl r4,r0,#16
|
||||
lsr r4,r4,#28
|
||||
lsl r4,r0,16
|
||||
lsr r4,r4,28
|
||||
mul r4,r3
|
||||
add r1,r1,r4
|
||||
mul r3,r2
|
||||
|
||||
// Ten-thousands
|
||||
lsl r4,r0,#12
|
||||
lsr r4,r4,#28
|
||||
lsl r4,r0,12
|
||||
lsr r4,r4,28
|
||||
mul r4,r3
|
||||
add r1,r1,r4
|
||||
mul r3,r2
|
||||
|
||||
// Hundred-thousands
|
||||
lsl r4,r0,#8
|
||||
lsr r4,r4,#28
|
||||
lsl r4,r0,8
|
||||
lsr r4,r4,28
|
||||
mul r4,r3
|
||||
add r1,r1,r4
|
||||
mul r3,r2
|
||||
|
||||
// Millions
|
||||
lsl r4,r0,#4
|
||||
lsr r4,r4,#28
|
||||
lsl r4,r0,4
|
||||
lsr r4,r4,28
|
||||
mul r4,r3
|
||||
add r1,r1,r4
|
||||
mul r3,r2
|
||||
|
||||
// Ten-millions
|
||||
lsr r4,r0,#28
|
||||
lsr r4,r0,28
|
||||
mul r4,r3
|
||||
add r1,r1,r4
|
||||
|
||||
|
@ -211,7 +208,7 @@ pop {r1-r4,pc}
|
|||
// r0: = digits - (digits rendered) - 1
|
||||
//==============================================================================
|
||||
|
||||
.format_cash:
|
||||
format_cash:
|
||||
|
||||
push {r1-r7,lr}
|
||||
mov r4,r1
|
||||
|
@ -219,57 +216,57 @@ mov r6,r2
|
|||
|
||||
//--------------------------------
|
||||
// Figure out how many digits we need
|
||||
bl .bin_to_bcd
|
||||
bl bin_to_bcd
|
||||
mov r5,r1
|
||||
mov r7,r1
|
||||
|
||||
// The window is 56 pixels wide:
|
||||
// each digit uses 6 pixels, the $ sign uses 6, and the
|
||||
// each digit uses 6 pixels, the 0x sign uses 6, and the
|
||||
// double-zero uses 8
|
||||
mov r2,#42 // = 56 - 6 - 8
|
||||
lsl r3,r1,#2
|
||||
mov r2,42 // = 56 - 6 - 8
|
||||
lsl r3,r1,2
|
||||
add r3,r3,r1
|
||||
add r1,r1,r3 // r1 *= 6
|
||||
sub r1,r2,r1 // r1 = 42 - r1
|
||||
|
||||
// Store the control code to the output
|
||||
mov r2,#0x5F
|
||||
strb r2,[r4,#0]
|
||||
mov r2,#0xFF
|
||||
strb r2,[r4,#1]
|
||||
strb r1,[r4,#2]
|
||||
mov r2,0x5F
|
||||
strb r2,[r4,0]
|
||||
mov r2,0xFF
|
||||
strb r2,[r4,1]
|
||||
strb r1,[r4,2]
|
||||
|
||||
// Store the dollar sign
|
||||
mov r2,#0x54
|
||||
strb r2,[r4,#3]
|
||||
add r4,r4,#4
|
||||
mov r2,0x54
|
||||
strb r2,[r4,3]
|
||||
add r4,r4,4
|
||||
|
||||
// Store the digits to the output
|
||||
mov r2,#8
|
||||
mov r2,8
|
||||
sub r2,r2,r5
|
||||
lsl r2,r2,#2
|
||||
lsl r2,r2,2
|
||||
lsl r0,r2 // Now the number is pushed to the left of the register
|
||||
|
||||
-
|
||||
lsr r1,r0,#28 // Get the left-most digit
|
||||
add r1,#0x60 // Integer-to-char
|
||||
strb r1,[r4,#0]
|
||||
add r4,r4,#1
|
||||
lsl r0,r0,#4
|
||||
sub r5,r5,#1
|
||||
bne -
|
||||
@@prev:
|
||||
lsr r1,r0,28 // Get the left-most digit
|
||||
add r1,0x60 // Integer-to-char
|
||||
strb r1,[r4,0]
|
||||
add r4,r4,1
|
||||
lsl r0,r0,4
|
||||
sub r5,r5,1
|
||||
bne @@prev
|
||||
|
||||
// Store the double-zero sign
|
||||
mov r1,#0x56
|
||||
strb r1,[r4,#0]
|
||||
mov r1,0x56
|
||||
strb r1,[r4,0]
|
||||
|
||||
// Store the end code
|
||||
mov r1,#0
|
||||
strb r1,[r4,#1]
|
||||
mov r1,#0xFF
|
||||
strb r1,[r4,#2]
|
||||
mov r1,0
|
||||
strb r1,[r4,1]
|
||||
mov r1,0xFF
|
||||
strb r1,[r4,2]
|
||||
|
||||
//--------------------------------
|
||||
sub r5,r6,r7
|
||||
sub r0,r5,#1
|
||||
sub r0,r5,1
|
||||
pop {r1-r7,pc}
|
||||
|
|
483
m2-hack.asm
483
m2-hack.asm
|
@ -1,28 +1,29 @@
|
|||
arch gba.thumb
|
||||
.gba
|
||||
.open "m12.gba",0x8000000
|
||||
|
||||
//==============================================================================
|
||||
// Relocation hacks
|
||||
//==============================================================================
|
||||
|
||||
// Move the weird box font from 0xFCE6C
|
||||
org $80B3274; dd m2_font_relocate
|
||||
.org 0x80B3274 :: dw m2_font_relocate
|
||||
|
||||
|
||||
//==============================================================================
|
||||
// Font hacks
|
||||
//==============================================================================
|
||||
|
||||
org $8AFED84; incbin m2-mainfont1-empty.bin
|
||||
org $8B0F424; incbin m2-mainfont2-empty.bin
|
||||
org $8B13424; incbin m2-mainfont3-empty.bin
|
||||
org $8B088A4; incbin m2-shifted-cursor.bin
|
||||
.org 0x8AFED84 :: .incbin "m2-mainfont1-empty.bin"
|
||||
.org 0x8B0F424 :: .incbin "m2-mainfont2-empty.bin"
|
||||
.org 0x8B13424 :: .incbin "m2-mainfont3-empty.bin"
|
||||
.org 0x8B088A4 :: .incbin "m2-shifted-cursor.bin"
|
||||
|
||||
// Greek letters
|
||||
org $8B1B907; db $8B // alpha
|
||||
org $8B1B90A; db $8C // beta
|
||||
org $8B1B90D; db $8D // gamma
|
||||
org $8B1B910; db $8E // sigma
|
||||
org $8B1B913; db $8F // omega
|
||||
.org 0x8B1B907 :: db 0x8B // alpha
|
||||
.org 0x8B1B90A :: db 0x8C // beta
|
||||
.org 0x8B1B90D :: db 0x8D // gamma
|
||||
.org 0x8B1B910 :: db 0x8E // sigma
|
||||
.org 0x8B1B913 :: db 0x8F // omega
|
||||
|
||||
|
||||
//==============================================================================
|
||||
|
@ -30,227 +31,227 @@ org $8B1B913; db $8F // omega
|
|||
//==============================================================================
|
||||
|
||||
// 32- to 16-bit access change for window flags
|
||||
org $80BE16A; strh r2,[r4,#0]
|
||||
org $80BE1FA; strh r2,[r6,#0]
|
||||
org $80BE222; strh r6,[r1,#0]
|
||||
.org 0x80BE16A :: strh r2,[r4,0]
|
||||
.org 0x80BE1FA :: strh r2,[r6,0]
|
||||
.org 0x80BE222 :: strh r6,[r1,0]
|
||||
|
||||
// PSI class window size
|
||||
org $80B7820
|
||||
mov r1,#4
|
||||
mov r2,#1
|
||||
mov r3,#6
|
||||
.org 0x80B7820
|
||||
mov r1,4
|
||||
mov r2,1
|
||||
mov r3,6
|
||||
|
||||
//---------------------------------------------------------
|
||||
// C0A5C hacks (status window)
|
||||
//---------------------------------------------------------
|
||||
|
||||
incsrc m2-status-initial.asm
|
||||
incsrc m2-status-switch.asm
|
||||
.include "m2-status-initial.asm"
|
||||
.include "m2-status-switch.asm"
|
||||
|
||||
//---------------------------------------------------------
|
||||
// BAC18 hacks (status window switching)
|
||||
//---------------------------------------------------------
|
||||
|
||||
org $80BACFC; bl m2_vwf_entries.bac18_redraw_status
|
||||
org $80BADE6; bl m2_vwf_entries.bac18_redraw_status
|
||||
org $80BACEE; bl m2_vwf_entries.bac18_clear_psi
|
||||
org $80BADC8
|
||||
bl m2_vwf_entries.bac18_check_button
|
||||
b $80BADD8
|
||||
.org 0x80BACFC :: bl bac18_redraw_status
|
||||
.org 0x80BADE6 :: bl bac18_redraw_status
|
||||
.org 0x80BACEE :: bl bac18_clear_psi
|
||||
.org 0x80BADC8
|
||||
bl bac18_check_button
|
||||
b 0x80BADD8
|
||||
|
||||
//---------------------------------------------------------
|
||||
// BAEF8 hacks (equip window)
|
||||
//---------------------------------------------------------
|
||||
|
||||
// Erase offense change
|
||||
define erase_offense "mov r0,#0xC; mov r1,#0xB; mov r2,#4; bl m2_vwf.print_blankstr"
|
||||
org $80BB216; {erase_offense}
|
||||
org $80BB38C; {erase_offense}
|
||||
org $80BB4C6; {erase_offense}
|
||||
org $80BB5FC; {erase_offense}
|
||||
org $80BBAAE; {erase_offense}
|
||||
org $80BBBF6; {erase_offense}
|
||||
org $80BBD54; {erase_offense}
|
||||
erase_offense equ mov r0,0xC :: mov r1,0xB :: mov r2,4 :: bl print_blankstr
|
||||
.org 0x80BB216 :: erase_offense
|
||||
.org 0x80BB38C :: erase_offense
|
||||
.org 0x80BB4C6 :: erase_offense
|
||||
.org 0x80BB5FC :: erase_offense
|
||||
.org 0x80BBAAE :: erase_offense
|
||||
.org 0x80BBBF6 :: erase_offense
|
||||
.org 0x80BBD54 :: erase_offense
|
||||
|
||||
// Erase defense change
|
||||
define erase_defense "mov r0,#0xC; mov r1,#0xD; mov r2,#4; bl m2_vwf.print_blankstr"
|
||||
org $80BB226; {erase_defense}
|
||||
org $80BBABE; {erase_defense}
|
||||
org $80BBC06; {erase_defense}
|
||||
org $80BBD64; {erase_defense}
|
||||
erase_defense equ mov r0,0xC :: mov r1,0xD :: mov r2,4 :: bl print_blankstr
|
||||
.org 0x80BB226 :: erase_defense
|
||||
.org 0x80BBABE :: erase_defense
|
||||
.org 0x80BBC06 :: erase_defense
|
||||
.org 0x80BBD64 :: erase_defense
|
||||
|
||||
// Erase offense/defense after changing equipment
|
||||
org $80BB3E2; bl m2_vwf_entries.baef8_reequip_erase
|
||||
org $80BB518; bl m2_vwf_entries.baef8_reequip_erase
|
||||
org $80BBB12; bl m2_vwf_entries.baef8_reequip_erase
|
||||
org $80BBC70; bl m2_vwf_entries.baef8_reequip_erase
|
||||
.org 0x80BB3E2 :: bl baef8_reequip_erase
|
||||
.org 0x80BB518 :: bl baef8_reequip_erase
|
||||
.org 0x80BBB12 :: bl baef8_reequip_erase
|
||||
.org 0x80BBC70 :: bl baef8_reequip_erase
|
||||
|
||||
//---------------------------------------------------------
|
||||
// C5500 hacks (equip window switching)
|
||||
//---------------------------------------------------------
|
||||
|
||||
// Clear offense/defense changes when moving cursor
|
||||
org $80C5AA2; bl m2_vwf_entries.c5500_clear_up
|
||||
org $80C5B12; bl m2_vwf_entries.c5500_clear_down
|
||||
.org 0x80C5AA2 :: bl c5500_clear_up
|
||||
.org 0x80C5B12 :: bl c5500_clear_down
|
||||
|
||||
// Don't draw equip icon
|
||||
org $80C5A1A; nop
|
||||
org $80C5A28; nop
|
||||
.org 0x80C5A1A :: nop
|
||||
.org 0x80C5A28 :: nop
|
||||
|
||||
//---------------------------------------------------------
|
||||
// C1FBC hacks (PSI window)
|
||||
//---------------------------------------------------------
|
||||
|
||||
org $80C203E; mov r1,#0x14 // new PSI name entry length
|
||||
org $80C21B4; mov r1,#0x14
|
||||
org $80C224A; mov r1,#0x14
|
||||
org $80C229E; mov r1,#0x14
|
||||
.org 0x80C203E :: mov r1,0x14 // new PSI name entry length
|
||||
.org 0x80C21B4 :: mov r1,0x14
|
||||
.org 0x80C224A :: mov r1,0x14
|
||||
.org 0x80C229E :: mov r1,0x14
|
||||
|
||||
// Draw PSI Rockin
|
||||
org $80C2192
|
||||
.org 0x80C2192
|
||||
mov r2,r8
|
||||
str r2,[sp,#0]
|
||||
mov r2,#0xFD
|
||||
lsl r2,r2,#1
|
||||
str r2,[sp,0]
|
||||
mov r2,0xFD
|
||||
lsl r2,r2,1
|
||||
add r0,r6,r2
|
||||
mov r1,#0x71
|
||||
mov r2,#8
|
||||
bl m2_vwf.print_string
|
||||
mov r1,0x71
|
||||
mov r2,8
|
||||
bl print_string
|
||||
|
||||
//---------------------------------------------------------
|
||||
// C239C hacks (print PSI name)
|
||||
//---------------------------------------------------------
|
||||
|
||||
org $80C23AA; lsr r2,r2,#0xD // tiles-to-pixels
|
||||
org $80C23AE; lsr r6,r3,#0xD // tiles-to-pixels
|
||||
org $80C23CE; bl m2_vwf_entries.c239c_print_psi; nop; nop; nop
|
||||
org $80C23DA; add r4,#17 // pixel width of "PSI "
|
||||
org $80C23F0; bl m2_vwf.print_string_hlight_pixels // print rockin'
|
||||
org $80C2402; mov r0,#3; lsl r0,r0,#0x10 // pixel width of space
|
||||
org $80C242E; mov r0,#0x14 // new PSI name entry length
|
||||
org $80C2448
|
||||
bl m2_vwf.print_string_hlight_pixels // print PSI name
|
||||
mov r2,r1 // record X width
|
||||
add r2,#3 // add a space
|
||||
org $80C2468; bl m2_vwf.print_string_hlight_pixels
|
||||
.org 0x80C23AA :: lsr r2,r2,0xD // tiles-to-pixels
|
||||
.org 0x80C23AE :: lsr r6,r3,0xD // tiles-to-pixels
|
||||
.org 0x80C23CE :: bl c239c_print_psi :: nop :: nop :: nop
|
||||
.org 0x80C23DA :: add r4,17 // pixel width of "PSI "
|
||||
.org 0x80C23F0 :: bl print_string_hlight_pixels // print rockin'
|
||||
.org 0x80C2402 :: mov r0,3 :: lsl r0,r0,0x10 // pixel width of space
|
||||
.org 0x80C242E :: mov r0,0x14 // new PSI name entry length
|
||||
.org 0x80C2448
|
||||
bl print_string_hlight_pixels // print PSI name
|
||||
mov r2,r1 // record X width
|
||||
add r2,3 // add a space
|
||||
.org 0x80C2468 :: bl print_string_hlight_pixels
|
||||
|
||||
//---------------------------------------------------------
|
||||
// C438C hacks (PSI window cursor movement)
|
||||
//---------------------------------------------------------
|
||||
|
||||
org $80C4580; bl m2_vwf_entries.c438c_moveup
|
||||
org $80C4642; bl m2_vwf_entries.c438c_movedown
|
||||
org $80C4768; bl m2_vwf_entries.c438c_moveright
|
||||
org $80C48B2; bl m2_vwf_entries.c438c_moveleft
|
||||
.org 0x80C4580 :: bl c438c_moveup
|
||||
.org 0x80C4642 :: bl c438c_movedown
|
||||
.org 0x80C4768 :: bl c438c_moveright
|
||||
.org 0x80C48B2 :: bl c438c_moveleft
|
||||
|
||||
//---------------------------------------------------------
|
||||
// PSI target window hacks
|
||||
//---------------------------------------------------------
|
||||
|
||||
// PSI target length hack
|
||||
org $80B8B12; mov r0,#0x14
|
||||
org $80C24EE; mov r1,#0x14
|
||||
.org 0x80B8B12 :: mov r0,0x14
|
||||
.org 0x80C24EE :: mov r1,0x14
|
||||
|
||||
// Fix PSI target offset calculation
|
||||
org $80B8B08
|
||||
mov r1,#100
|
||||
.org 0x80B8B08
|
||||
mov r1,100
|
||||
mul r1,r2
|
||||
nop
|
||||
nop
|
||||
|
||||
// Make PP cost use correct number values
|
||||
org $80CA732
|
||||
add r1,#0x60
|
||||
.org 0x80CA732
|
||||
add r1,0x60
|
||||
|
||||
// Make PP cost use the correct space value if there's only one digit
|
||||
org $80CA712
|
||||
mov r0,#0x50
|
||||
.org 0x80CA712
|
||||
mov r0,0x50
|
||||
|
||||
//---------------------------------------------------------
|
||||
// B8BBC hacks (PSI window)
|
||||
//---------------------------------------------------------
|
||||
|
||||
// Redraw main menu when exiting PSI target window
|
||||
org $80B8E3A; bl m2_vwf_entries.b8bbc_redraw_menu_2to1
|
||||
.org 0x80B8E3A :: bl b8bbc_redraw_menu_2to1
|
||||
|
||||
// Redraw main menu when entering PSI target window
|
||||
org $80B8CF8; bl m2_vwf_entries.b8bbc_redraw_menu_13to2 // 1 to 2
|
||||
org $80B920C; bl m2_vwf_entries.b8bbc_redraw_menu_13to2 // 3 to 2
|
||||
.org 0x80B8CF8 :: bl b8bbc_redraw_menu_13to2 // 1 to 2
|
||||
.org 0x80B920C :: bl b8bbc_redraw_menu_13to2 // 3 to 2
|
||||
|
||||
//---------------------------------------------------------
|
||||
// C4B2C hacks (Equip window render)
|
||||
//---------------------------------------------------------
|
||||
|
||||
// Start equipment at the 6th tile instead of 5th
|
||||
org $80C4C96; mov r2,#6 // Weapon
|
||||
org $80C4D1C; mov r2,#6 // Body
|
||||
org $80C4DA4; mov r2,#6 // Arms
|
||||
org $80C4E2C; mov r2,#6 // Other
|
||||
.org 0x80C4C96 :: mov r2,6 // Weapon
|
||||
.org 0x80C4D1C :: mov r2,6 // Body
|
||||
.org 0x80C4DA4 :: mov r2,6 // Arms
|
||||
.org 0x80C4E2C :: mov r2,6 // Other
|
||||
|
||||
// Only render (None) if necessary
|
||||
org $80C4C0C
|
||||
bl m2_vwf_entries.c4b2c_skip_nones
|
||||
b $80C4C58
|
||||
.org 0x80C4C0C
|
||||
bl c4b2c_skip_nones
|
||||
b 0x80C4C58
|
||||
|
||||
// Don't render equip symbols
|
||||
org $80C4CD0; nop
|
||||
org $80C4CDE; nop
|
||||
org $80C4D58; nop
|
||||
org $80C4D66; nop
|
||||
org $80C4DE0; nop
|
||||
org $80C4DEE; nop
|
||||
org $80C4E68; nop
|
||||
org $80C4E76; nop
|
||||
.org 0x80C4CD0 :: nop
|
||||
.org 0x80C4CDE :: nop
|
||||
.org 0x80C4D58 :: nop
|
||||
.org 0x80C4D66 :: nop
|
||||
.org 0x80C4DE0 :: nop
|
||||
.org 0x80C4DEE :: nop
|
||||
.org 0x80C4E68 :: nop
|
||||
.org 0x80C4E76 :: nop
|
||||
|
||||
// Widen the who/where/etc window
|
||||
org $80B77B4; mov r3,#5
|
||||
org $80BA9E2; mov r3,#5
|
||||
.org 0x80B77B4 :: mov r3,5
|
||||
.org 0x80BA9E2 :: mov r3,5
|
||||
|
||||
//---------------------------------------------------------
|
||||
// C4B2C hacks (Equip window loop)
|
||||
//---------------------------------------------------------
|
||||
|
||||
org $80C4F80; bl m2_vwf_entries.c4b2c_clear_left
|
||||
org $80C4F84; bl m2_vwf_entries.c4b2c_clear_right
|
||||
.org 0x80C4F80 :: bl c4b2c_clear_left
|
||||
.org 0x80C4F84 :: bl c4b2c_clear_right
|
||||
|
||||
//---------------------------------------------------------
|
||||
// C980C hacks (main character printing)
|
||||
//---------------------------------------------------------
|
||||
|
||||
// Reset pixel X during scroll
|
||||
org $80C9858; bl m2_vwf_entries.c980c_resetx_newline
|
||||
org $80C9BF0; bl m2_vwf_entries.c980c_resetx_scroll
|
||||
org $80C9D18; bl m2_vwf_entries.c980c_resetx_newline
|
||||
org $80CA336; bl m2_vwf_entries.c980c_resetx_newline
|
||||
.org 0x80C9858 :: bl c980c_resetx_newline
|
||||
.org 0x80C9BF0 :: bl c980c_resetx_scroll
|
||||
.org 0x80C9D18 :: bl c980c_resetx_newline
|
||||
.org 0x80CA336 :: bl c980c_resetx_newline
|
||||
|
||||
// Reset pixel X during a newline
|
||||
org $80C9CC4
|
||||
bl m2_vwf_entries.c980c_resetx_newline
|
||||
.org 0x80C9CC4
|
||||
bl c980c_resetx_newline
|
||||
|
||||
// Other reset X
|
||||
org $80C9D62; bl m2_vwf_entries.c980c_resetx_other
|
||||
org $80C9D76; bl m2_vwf_entries.c980c_resetx_other2
|
||||
org $80C9EEC; bl m2_vwf_entries.c980c_resetx_other3
|
||||
org $80C9F34; bl m2_vwf_entries.c980c_resetx_other3
|
||||
org $80CA204; bl m2_vwf_entries.c980c_resetx_other4
|
||||
org $80CA274; bl m2_vwf_entries.c980c_resetx_other4
|
||||
org $80CA30E; bl m2_vwf_entries.c980c_resetx_newline
|
||||
.org 0x80C9D62 :: bl c980c_resetx_other
|
||||
.org 0x80C9D76 :: bl c980c_resetx_other2
|
||||
.org 0x80C9EEC :: bl c980c_resetx_other3
|
||||
.org 0x80C9F34 :: bl c980c_resetx_other3
|
||||
.org 0x80CA204 :: bl c980c_resetx_other4
|
||||
.org 0x80CA274 :: bl c980c_resetx_other4
|
||||
.org 0x80CA30E :: bl c980c_resetx_newline
|
||||
|
||||
// Custom codes check
|
||||
org $80CA2BC
|
||||
bl m2_vwf_entries.c980c_custom_codes
|
||||
.org 0x80CA2BC
|
||||
bl c980c_custom_codes
|
||||
|
||||
// Reset pixel X when redrawing the window
|
||||
org $80CA2E6
|
||||
bl m2_vwf_entries.c980c_resetx
|
||||
.org 0x80CA2E6
|
||||
bl c980c_resetx
|
||||
|
||||
// Welding entry
|
||||
org $80CA448
|
||||
bl m2_vwf_entries.c980c_weld_entry
|
||||
b $80CA46C
|
||||
.org 0x80CA448
|
||||
bl c980c_weld_entry
|
||||
b 0x80CA46C
|
||||
|
||||
// Disable X coordinate incrementing
|
||||
org $80CA48E
|
||||
.org 0x80CA48E
|
||||
nop
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -258,146 +259,146 @@ nop
|
|||
//---------------------------------------------------------
|
||||
|
||||
// Custom codes check
|
||||
org $80C90A2
|
||||
bl m2_vwf_entries.c8ffc_custom_codes
|
||||
.org 0x80C90A2
|
||||
bl c8ffc_custom_codes
|
||||
|
||||
// Welding entry
|
||||
org $80C9114
|
||||
bl m2_vwf_entries.c8ffc_weld_entry
|
||||
b $80C9144
|
||||
.org 0x80C9114
|
||||
bl c8ffc_weld_entry
|
||||
b 0x80C9144
|
||||
|
||||
// Integer-to-char changes
|
||||
org $80CA67C; mov r3,#0x50 // space
|
||||
org $80CA69C; mov r2,#0x60 // zero
|
||||
org $80CA78A; mov r0,#0x60 // zero
|
||||
org $80CA7AC; mov r2,#0x69 // nine
|
||||
org $80CA7EC; sub r1,#0xA0
|
||||
.org 0x80CA67C :: mov r3,0x50 // space
|
||||
.org 0x80CA69C :: mov r2,0x60 // zero
|
||||
.org 0x80CA78A :: mov r0,0x60 // zero
|
||||
.org 0x80CA7AC :: mov r2,0x69 // nine
|
||||
.org 0x80CA7EC :: sub r1,0xA0
|
||||
|
||||
//---------------------------------------------------------
|
||||
// C87D0 hacks (draw blank window)
|
||||
//---------------------------------------------------------
|
||||
|
||||
org $80C87DC
|
||||
bl m2_vwf_entries.c87d0_clear_entry
|
||||
.org 0x80C87DC
|
||||
bl c87d0_clear_entry
|
||||
|
||||
//---------------------------------------------------------
|
||||
// C9634 hacks (string printing)
|
||||
//---------------------------------------------------------
|
||||
|
||||
org $80C967E
|
||||
bl m2_vwf_entries.c9634_resetx
|
||||
.org 0x80C967E
|
||||
bl c9634_resetx
|
||||
|
||||
//---------------------------------------------------------
|
||||
// C96F0 hacks (string printing with highlight)
|
||||
//---------------------------------------------------------
|
||||
|
||||
org $80C9714
|
||||
lsl r3,r3,#1 // change from row coords to tile coords
|
||||
ldrh r1,[r0,#0x22]
|
||||
.org 0x80C9714
|
||||
lsl r3,r3,1 // change from row coords to tile coords
|
||||
ldrh r1,[r0,0x22]
|
||||
add r1,r1,r2
|
||||
lsl r1,r1,#3 // r1 = tile_x * 8
|
||||
ldrh r2,[r0,#0x24]
|
||||
lsl r1,r1,3 // r1 = tile_x * 8
|
||||
ldrh r2,[r0,0x24]
|
||||
add r2,r2,r3
|
||||
lsl r2,r2,#3 // r2 = tile_y * 8
|
||||
lsl r2,r2,3 // r2 = tile_y * 8
|
||||
mov r0,r6
|
||||
bl m2_vwf.print_string
|
||||
bl print_string
|
||||
mov r7,r0
|
||||
b $80C9788
|
||||
b 0x80C9788
|
||||
|
||||
//---------------------------------------------------------
|
||||
// CA4BC hacks (scroll text)
|
||||
//---------------------------------------------------------
|
||||
|
||||
org $80CA55E; bl m2_vwf_entries.ca4bc_erase_tile_short
|
||||
org $80CA60E; bl m2_vwf_entries.ca4bc_copy_tile_up
|
||||
org $80CA626; bl m2_vwf_entries.ca4bc_erase_tile
|
||||
.org 0x80CA55E :: bl ca4bc_erase_tile_short
|
||||
.org 0x80CA60E :: bl ca4bc_copy_tile_up
|
||||
.org 0x80CA626 :: bl ca4bc_erase_tile
|
||||
|
||||
//---------------------------------------------------------
|
||||
// D2E94 hacks (print party character name)
|
||||
//---------------------------------------------------------
|
||||
|
||||
org $80D2F24
|
||||
.org 0x80D2F24
|
||||
mov r1,r6
|
||||
mov r2,r7
|
||||
mov r0,r4
|
||||
bl m2_vwf.weld_entry
|
||||
b $80D2F52
|
||||
bl weld_entry
|
||||
b 0x80D2F52
|
||||
|
||||
// Disable X increment
|
||||
org $80D2F5A; nop
|
||||
.org 0x80D2F5A :: nop
|
||||
|
||||
//---------------------------------------------------------
|
||||
// D2FA0 hacks (print item)
|
||||
//---------------------------------------------------------
|
||||
|
||||
org $80D3044
|
||||
.org 0x80D3044
|
||||
mov r0,r4
|
||||
mov r1,r6
|
||||
bl m2_vwf.weld_entry
|
||||
b $80D3072
|
||||
bl weld_entry
|
||||
b 0x80D3072
|
||||
|
||||
// Disable X increment
|
||||
org $80D307A; nop
|
||||
.org 0x80D307A :: nop
|
||||
|
||||
//---------------------------------------------------------
|
||||
// D30C4 hacks (print number)
|
||||
//---------------------------------------------------------
|
||||
|
||||
org $80D314A
|
||||
.org 0x80D314A
|
||||
mov r0,r5
|
||||
mov r1,r7
|
||||
bl m2_vwf.weld_entry
|
||||
b $80D3178
|
||||
bl weld_entry
|
||||
b 0x80D3178
|
||||
|
||||
// Disable X increment
|
||||
org $80D3180; nop
|
||||
.org 0x80D3180 :: nop
|
||||
|
||||
//---------------------------------------------------------
|
||||
// D332C hacks (print name)
|
||||
//---------------------------------------------------------
|
||||
|
||||
org $80D34E8
|
||||
.org 0x80D34E8
|
||||
mov r0,r5
|
||||
mov r1,r4
|
||||
bl m2_vwf.weld_entry
|
||||
b $80D3514
|
||||
bl weld_entry
|
||||
b 0x80D3514
|
||||
|
||||
// Disable X increment
|
||||
org $80D351A; nop
|
||||
.org 0x80D351A :: nop
|
||||
|
||||
//---------------------------------------------------------
|
||||
// D3934 hacks (print PSI name)
|
||||
//---------------------------------------------------------
|
||||
|
||||
org $80D39BA; mov r0,#0x14 // PSI name length
|
||||
.org 0x80D39BA :: mov r0,0x14 // PSI name length
|
||||
|
||||
// Weld entry
|
||||
org $80D39E2
|
||||
.org 0x80D39E2
|
||||
mov r0,r4
|
||||
mov r1,r5
|
||||
bl m2_vwf.weld_entry
|
||||
b $80D3A14
|
||||
bl weld_entry
|
||||
b 0x80D3A14
|
||||
|
||||
// Print a space before the Greek letter
|
||||
org $80D39D4; bl m2_vwf_entries.d3934_print_space
|
||||
.org 0x80D39D4 :: bl d3934_print_space
|
||||
|
||||
// Battle command hacks
|
||||
org $8B1F4C8; db $11 // Extend command window width two tiles (Normal)
|
||||
org $8B1F4CC; db $16 // Extend command window width two tiles (Paula paralyzed leader)
|
||||
org $80D7A56; mov r1,#4 // Move PSI class window left one tile
|
||||
org $80D7A5A; mov r3,#6 // Extend PSI class window width one tile
|
||||
org $80DC038; add r5,#0x30 // String address calculation
|
||||
org $80DC0A8; add r1,#0x60 // String address calculation
|
||||
.org 0x8B1F4C8 :: db 0x11 // Extend command window width two tiles (Normal)
|
||||
.org 0x8B1F4CC :: db 0x16 // Extend command window width two tiles (Paula paralyzed leader)
|
||||
.org 0x80D7A56 :: mov r1,4 // Move PSI class window left one tile
|
||||
.org 0x80D7A5A :: mov r3,6 // Extend PSI class window width one tile
|
||||
.org 0x80DC038 :: add r5,0x30 // String address calculation
|
||||
.org 0x80DC0A8 :: add r1,0x60 // String address calculation
|
||||
|
||||
org $80DC27C; lsl r1,r2,#4; nop // String address calculation
|
||||
org $80DC2AC; lsl r1,r2,#4; nop // String address calculation
|
||||
.org 0x80DC27C :: lsl r1,r2,4 :: nop // String address calculation
|
||||
.org 0x80DC2AC :: lsl r1,r2,4 :: nop // String address calculation
|
||||
|
||||
org $80DCC36; mov r2,#2 // "to X" position
|
||||
org $80DCCE0; mov r2,#2 // "to the Front Row" position
|
||||
.org 0x80DCC36 :: mov r2,2 // "to X" position
|
||||
.org 0x80DCCE0 :: mov r2,2 // "to the Front Row" position
|
||||
|
||||
org $80E079E; bl m2_vwf_entries.e06ec_clear_window
|
||||
org $80E0888; bl m2_vwf_entries.e06ec_redraw_psi
|
||||
org $80E0A16; bl m2_vwf_entries.e06ec_redraw_bash_psi
|
||||
.org 0x80E079E :: bl e06ec_clear_window
|
||||
.org 0x80E0888 :: bl e06ec_redraw_psi
|
||||
.org 0x80E0A16 :: bl e06ec_redraw_bash_psi
|
||||
|
||||
//---------------------------------------------------------
|
||||
// BD918 hacks (battle setup)
|
||||
|
@ -410,119 +411,113 @@ org $80E0A16; bl m2_vwf_entries.e06ec_redraw_bash_psi
|
|||
// and target strings on the heap. The game only allocates 16 each.
|
||||
// Goal: allocate an extra 128 bytes and fix all the offsets to the user/target
|
||||
// strings. We'll store the user string at +0x4C0 and the target string at +0x500.
|
||||
org $80BD97A; mov r0,#0xA8 // malloc an extra 128 bytes for longer user/target strings
|
||||
.org 0x80BD97A :: mov r0,0xA8 // malloc an extra 128 bytes for longer user/target strings
|
||||
|
||||
// Fix user/target pointers
|
||||
org $80C9942; bl m2_vwf_entries.c980c_user_pointer
|
||||
org $80C9954; bl m2_vwf_entries.c980c_target_pointer
|
||||
org $80EBFDC; bl m2_vwf_entries.ebfd4_user_pointer; b $80EBFFA
|
||||
org $80EC004; push {lr}; bl m2_vwf_entries.ec004_user_pointer
|
||||
org $80EC018; bl m2_vwf_entries.ec010_target_pointer; b $80EC038
|
||||
org $80EC046; push {lr}; bl m2_vwf_entries.ec046_target_pointer
|
||||
.org 0x80C9942 :: bl c980c_user_pointer
|
||||
.org 0x80C9954 :: bl c980c_target_pointer
|
||||
.org 0x80EBFDC :: bl ebfd4_user_pointer :: b 0x80EBFFA
|
||||
.org 0x80EC004 :: push {lr} :: bl ec004_user_pointer
|
||||
.org 0x80EC018 :: bl ec010_target_pointer :: b 0x80EC038
|
||||
.org 0x80EC046 :: push {lr} :: bl ec046_target_pointer
|
||||
|
||||
// Length fixes
|
||||
org $80DAE02; add sp,#-0x40
|
||||
org $80DAE08; mov r2,#0x3E
|
||||
org $80DAE38; mov r2,#0x3A
|
||||
org $80DAEA2; mov r1,#0x3E
|
||||
org $80DAEDE; add sp,#0x40
|
||||
.org 0x80DAE02 :: add sp,-0x40
|
||||
.org 0x80DAE08 :: mov r2,0x3E
|
||||
.org 0x80DAE38 :: mov r2,0x3A
|
||||
.org 0x80DAEA2 :: mov r1,0x3E
|
||||
.org 0x80DAEDE :: add sp,0x40
|
||||
|
||||
org $80DB04E; add sp,#-0x40
|
||||
org $80DB058; mov r2,#0x3E
|
||||
org $80DB08C; mov r2,#0x3A
|
||||
org $80DB116; mov r1,#0x3E
|
||||
org $80DB15A; add sp,#0x40
|
||||
.org 0x80DB04E :: add sp,-0x40
|
||||
.org 0x80DB058 :: mov r2,0x3E
|
||||
.org 0x80DB08C :: mov r2,0x3A
|
||||
.org 0x80DB116 :: mov r1,0x3E
|
||||
.org 0x80DB15A :: add sp,0x40
|
||||
|
||||
org $80DCD02; add sp,#-0x40
|
||||
org $80DCD0C; mov r2,#0x3C
|
||||
org $80DCD64; mov r2,#0x3A
|
||||
org $80DCDA2; mov r1,#0x3E
|
||||
org $80DCDA8; add sp,#0x40
|
||||
.org 0x80DCD02 :: add sp,-0x40
|
||||
.org 0x80DCD0C :: mov r2,0x3C
|
||||
.org 0x80DCD64 :: mov r2,0x3A
|
||||
.org 0x80DCDA2 :: mov r1,0x3E
|
||||
.org 0x80DCDA8 :: add sp,0x40
|
||||
|
||||
// Add a space between enemy name and letter
|
||||
org $80DCD94; bl m2_vwf_entries.dcd00_enemy_letter
|
||||
org $80DCD9A; strb r0,[r5,#2]
|
||||
org $80DCD9E; strb r0,[r5,#3]
|
||||
.org 0x80DCD94 :: bl dcd00_enemy_letter
|
||||
.org 0x80DCD9A :: strb r0,[r5,2]
|
||||
.org 0x80DCD9E :: strb r0,[r5,3]
|
||||
|
||||
org $80DAE7E; bl m2_vwf_entries.dae00_enemy_letter
|
||||
org $80DAE84; strb r0,[r4,#2]
|
||||
org $80DAE88; strb r0,[r4,#3]
|
||||
.org 0x80DAE7E :: bl dae00_enemy_letter
|
||||
.org 0x80DAE84 :: strb r0,[r4,2]
|
||||
.org 0x80DAE88 :: strb r0,[r4,3]
|
||||
|
||||
org $80DB0CE; bl m2_vwf_entries.dae00_enemy_letter
|
||||
org $80DB0D2; strb r5,[r4,#2]
|
||||
org $80DB0D6; strb r0,[r4,#3]
|
||||
.org 0x80DB0CE :: bl dae00_enemy_letter
|
||||
.org 0x80DB0D2 :: strb r5,[r4,2]
|
||||
.org 0x80DB0D6 :: strb r0,[r4,3]
|
||||
|
||||
// "The" flag checks
|
||||
org $80DB084; bl m2_vwf_entries.db04c_theflag; nop; nop
|
||||
.org 0x80DB084 :: bl db04c_theflag :: nop :: nop
|
||||
|
||||
// Ignore the hard-coded Japanese "and cohorts"
|
||||
org $80DB0E6; b $80DB0FE
|
||||
.org 0x80DB0E6 :: b 0x80DB0FE
|
||||
|
||||
|
||||
//==============================================================================
|
||||
// Data files
|
||||
//==============================================================================
|
||||
|
||||
org $8B2C000
|
||||
.org 0x8B2C000
|
||||
|
||||
// Box font relocation
|
||||
m2_font_relocate:
|
||||
incbin m2-font-relocate.bin
|
||||
.incbin "m2-font-relocate.bin"
|
||||
|
||||
// Co-ordinate table
|
||||
m2_coord_table:
|
||||
incbin m2-coord-table.bin
|
||||
.incbin "m2-coord-table.bin"
|
||||
|
||||
// EB fonts
|
||||
m2_font_table:
|
||||
dd m2_font_main
|
||||
dd m2_font_saturn
|
||||
dw m2_font_main
|
||||
dw m2_font_saturn
|
||||
|
||||
m2_font_main:
|
||||
incbin m2-font-main.bin
|
||||
.incbin "m2-font-main.bin"
|
||||
|
||||
m2_font_saturn:
|
||||
incbin m2-font-saturn.bin
|
||||
.incbin "m2-font-saturn.bin"
|
||||
|
||||
// EB font heights
|
||||
m2_height_table:
|
||||
db $02, $02, $01, $00 // last byte for alignment
|
||||
db 0x02, 0x02, 0x01, 0x00 // last byte for alignment
|
||||
|
||||
// EB font widths
|
||||
m2_widths_table:
|
||||
dd m2_widths_main
|
||||
dd m2_widths_saturn
|
||||
dw m2_widths_main
|
||||
dw m2_widths_saturn
|
||||
|
||||
m2_widths_main:
|
||||
incbin m2-widths-main.bin
|
||||
.incbin "m2-widths-main.bin"
|
||||
|
||||
m2_widths_saturn:
|
||||
// tbd
|
||||
|
||||
m2_bits_to_nybbles:
|
||||
incbin m2-bits-to-nybbles.bin
|
||||
.incbin "m2-bits-to-nybbles.bin"
|
||||
|
||||
m2_nybbles_to_bits:
|
||||
incbin m2-nybbles-to-bits.bin
|
||||
.incbin "m2-nybbles-to-bits.bin"
|
||||
|
||||
m2_enemy_attributes:
|
||||
incbin m2-enemy-attributes.bin
|
||||
|
||||
|
||||
//==============================================================================
|
||||
// Misc
|
||||
//==============================================================================
|
||||
|
||||
org $2027FC0
|
||||
m2_custom_wram:
|
||||
.incbin "m2-enemy-attributes.bin"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
// Code files
|
||||
//==============================================================================
|
||||
|
||||
org $80FCE6C
|
||||
incsrc m2-vwf.asm
|
||||
incsrc m2-vwf-entries.asm
|
||||
incsrc m2-formatting.asm
|
||||
incsrc m2-customcodes.asm
|
||||
.org 0x80FCE6C
|
||||
.include "m2-vwf.asm"
|
||||
.include "m2-vwf-entries.asm"
|
||||
.include "m2-formatting.asm"
|
||||
.include "m2-customcodes.asm"
|
||||
|
||||
.close
|
||||
|
|
|
@ -1,227 +1,227 @@
|
|||
// Level
|
||||
org $80C0BAE
|
||||
mov r0,#5
|
||||
mov r1,#1
|
||||
mov r2,#3
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r3,#6
|
||||
.org 0x80C0BAE
|
||||
mov r0,5
|
||||
mov r1,1
|
||||
mov r2,3
|
||||
bl print_blankstr
|
||||
mov r3,6
|
||||
mul r3,r4
|
||||
mov r2,#56
|
||||
mov r2,56
|
||||
sub r2,r2,r3
|
||||
|
||||
org $80C0BC6
|
||||
mov r3,#8
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C0BC6
|
||||
mov r3,8
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Max HP
|
||||
org $80C0C06
|
||||
mov r0,#0x10
|
||||
mov r1,#7
|
||||
mov r2,#3
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r5,#6
|
||||
.org 0x80C0C06
|
||||
mov r0,0x10
|
||||
mov r1,7
|
||||
mov r2,3
|
||||
bl print_blankstr
|
||||
mov r5,6
|
||||
mul r4,r5
|
||||
mov r5,#147
|
||||
mov r5,147
|
||||
sub r4,r5,r4
|
||||
|
||||
org $80C0C20
|
||||
mov r3,#56
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C0C20
|
||||
mov r3,56
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Current HP
|
||||
org $80C0C62
|
||||
mov r0,#0xC
|
||||
mov r1,#7
|
||||
mov r2,#3
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r5,#6
|
||||
.org 0x80C0C62
|
||||
mov r0,0xC
|
||||
mov r1,7
|
||||
mov r2,3
|
||||
bl print_blankstr
|
||||
mov r5,6
|
||||
mul r4,r5
|
||||
mov r5,#120
|
||||
mov r5,120
|
||||
sub r4,r5,r4
|
||||
|
||||
org $80C0C7C
|
||||
mov r3,#56
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C0C7C
|
||||
mov r3,56
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Max PP
|
||||
org $80C0CBE
|
||||
mov r0,#0x10
|
||||
mov r1,#9
|
||||
mov r2,#3
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r0,#6
|
||||
.org 0x80C0CBE
|
||||
mov r0,0x10
|
||||
mov r1,9
|
||||
mov r2,3
|
||||
bl print_blankstr
|
||||
mov r0,6
|
||||
mul r4,r0
|
||||
mov r0,#147
|
||||
mov r0,147
|
||||
sub r4,r0,r4
|
||||
|
||||
org $80C0CD8
|
||||
mov r3,#72
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C0CD8
|
||||
mov r3,72
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Current PP
|
||||
org $80C0D1A
|
||||
mov r0,#0xC
|
||||
mov r1,#9
|
||||
mov r2,#3
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r5,#6
|
||||
.org 0x80C0D1A
|
||||
mov r0,0xC
|
||||
mov r1,9
|
||||
mov r2,3
|
||||
bl print_blankstr
|
||||
mov r5,6
|
||||
mul r4,r5
|
||||
mov r5,#120
|
||||
mov r5,120
|
||||
|
||||
org $80C0D30
|
||||
.org 0x80C0D30
|
||||
sub r2,r5,r4
|
||||
mov r3,#72
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
mov r3,72
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Total exp
|
||||
org $80C0D78
|
||||
mov r0,#0xC
|
||||
mov r1,#0xB
|
||||
mov r2,#7
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r1,#6
|
||||
.org 0x80C0D78
|
||||
mov r0,0xC
|
||||
mov r1,0xB
|
||||
mov r2,7
|
||||
bl print_blankstr
|
||||
mov r1,6
|
||||
mul r4,r1
|
||||
mov r1,#147
|
||||
mov r1,147
|
||||
sub r4,r1,r4
|
||||
|
||||
org $80C0D92
|
||||
mov r3,#88
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C0D92
|
||||
mov r3,88
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Exp to next level
|
||||
org $80C0DF8
|
||||
mov r0,#2
|
||||
mov r1,#0xD
|
||||
mov r2,#6
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r3,#6
|
||||
.org 0x80C0DF8
|
||||
mov r0,2
|
||||
mov r1,0xD
|
||||
mov r2,6
|
||||
bl print_blankstr
|
||||
mov r3,6
|
||||
mul r4,r3
|
||||
mov r3,#61
|
||||
mov r3,61
|
||||
sub r4,r3,r4
|
||||
|
||||
org $80C0E12
|
||||
mov r3,#104
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C0E12
|
||||
mov r3,104
|
||||
bl c0a5c_printstr
|
||||
|
||||
org $80C0E38
|
||||
mov r0,#2
|
||||
mov r1,#0xD
|
||||
mov r2,#6
|
||||
bl m2_vwf.print_blankstr
|
||||
.org 0x80C0E38
|
||||
mov r0,2
|
||||
mov r1,0xD
|
||||
mov r2,6
|
||||
bl print_blankstr
|
||||
|
||||
// Offense
|
||||
org $80C0E86
|
||||
mov r0,#0x19
|
||||
mov r1,#1
|
||||
mov r2,#4
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r6,#6
|
||||
.org 0x80C0E86
|
||||
mov r0,0x19
|
||||
mov r1,1
|
||||
mov r2,4
|
||||
bl print_blankstr
|
||||
mov r6,6
|
||||
mul r4,r6
|
||||
mov r6,#225
|
||||
mov r6,225
|
||||
sub r4,r6,r4
|
||||
|
||||
org $80C0EA0
|
||||
mov r3,#8
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C0EA0
|
||||
mov r3,8
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Defense
|
||||
org $80C0EE0
|
||||
mov r0,#0x19
|
||||
mov r1,#3
|
||||
mov r2,#4
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r2,#6
|
||||
.org 0x80C0EE0
|
||||
mov r0,0x19
|
||||
mov r1,3
|
||||
mov r2,4
|
||||
bl print_blankstr
|
||||
mov r2,6
|
||||
mul r4,r2
|
||||
sub r4,r6,r4
|
||||
|
||||
org $80C0EF8
|
||||
mov r3,#24
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C0EF8
|
||||
mov r3,24
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Speed
|
||||
org $80C0F38
|
||||
mov r0,#0x19
|
||||
mov r1,#5
|
||||
mov r2,#4
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r2,#6
|
||||
.org 0x80C0F38
|
||||
mov r0,0x19
|
||||
mov r1,5
|
||||
mov r2,4
|
||||
bl print_blankstr
|
||||
mov r2,6
|
||||
mul r4,r2
|
||||
sub r4,r6,r4
|
||||
|
||||
org $80C0F50
|
||||
mov r3,#40
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C0F50
|
||||
mov r3,40
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Guts
|
||||
org $80C0F90
|
||||
mov r0,#0x19
|
||||
mov r1,#7
|
||||
mov r2,#4
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r2,#6
|
||||
.org 0x80C0F90
|
||||
mov r0,0x19
|
||||
mov r1,7
|
||||
mov r2,4
|
||||
bl print_blankstr
|
||||
mov r2,6
|
||||
mul r4,r2
|
||||
sub r4,r6,r4
|
||||
|
||||
org $80C0FA8
|
||||
mov r3,#56
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C0FA8
|
||||
mov r3,56
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Vitality
|
||||
org $80C0FE8
|
||||
mov r0,#0x19
|
||||
mov r1,#9
|
||||
mov r2,#4
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r2,#6
|
||||
.org 0x80C0FE8
|
||||
mov r0,0x19
|
||||
mov r1,9
|
||||
mov r2,4
|
||||
bl print_blankstr
|
||||
mov r2,6
|
||||
mul r4,r2
|
||||
sub r4,r6,r4
|
||||
|
||||
org $80C1000
|
||||
mov r3,#72
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C1000
|
||||
mov r3,72
|
||||
bl c0a5c_printstr
|
||||
|
||||
// IQ
|
||||
org $80C1040
|
||||
mov r0,#0x19
|
||||
mov r1,#0xB
|
||||
mov r2,#4
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r2,#6
|
||||
.org 0x80C1040
|
||||
mov r0,0x19
|
||||
mov r1,0xB
|
||||
mov r2,4
|
||||
bl print_blankstr
|
||||
mov r2,6
|
||||
mul r4,r2
|
||||
sub r4,r6,r4
|
||||
|
||||
org $80C1058
|
||||
mov r3,#88
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C1058
|
||||
mov r3,88
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Luck
|
||||
org $80C1098
|
||||
mov r0,#0x19
|
||||
mov r1,#0xD
|
||||
mov r2,#4
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r2,#6
|
||||
.org 0x80C1098
|
||||
mov r0,0x19
|
||||
mov r1,0xD
|
||||
mov r2,4
|
||||
bl print_blankstr
|
||||
mov r2,6
|
||||
mul r4,r2
|
||||
sub r6,r6,r4
|
||||
|
||||
org $80C10B0
|
||||
mov r3,#104
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C10B0
|
||||
mov r3,104
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Press A for PSI info
|
||||
org $80C10C0
|
||||
bl m2_vwf_entries.c0a5c_psi_info_blank
|
||||
b $80C10FA
|
||||
.org 0x80C10C0
|
||||
bl c0a5c_psi_info_blank
|
||||
b 0x80C10FA
|
||||
|
||||
org $80C10F2
|
||||
mov r2,#44
|
||||
mov r3,#120
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C10F2
|
||||
mov r2,44
|
||||
mov r3,120
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Ailment
|
||||
org $80C10FE
|
||||
mov r0,#1
|
||||
mov r1,#3
|
||||
mov r2,#10
|
||||
bl m2_vwf.print_blankstr
|
||||
b $80C1116
|
||||
.org 0x80C10FE
|
||||
mov r0,1
|
||||
mov r1,3
|
||||
mov r2,10
|
||||
bl print_blankstr
|
||||
b 0x80C1116
|
||||
|
|
|
@ -1,227 +1,227 @@
|
|||
// Level
|
||||
org $80C1392
|
||||
mov r0,#5
|
||||
mov r1,#1
|
||||
mov r2,#3
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r3,#6
|
||||
.org 0x80C1392
|
||||
mov r0,5
|
||||
mov r1,1
|
||||
mov r2,3
|
||||
bl print_blankstr
|
||||
mov r3,6
|
||||
mul r3,r4
|
||||
mov r2,#56
|
||||
mov r2,56
|
||||
sub r2,r2,r3
|
||||
|
||||
org $80C13AA
|
||||
mov r3,#8
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C13AA
|
||||
mov r3,8
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Max HP
|
||||
org $80C13EC
|
||||
mov r0,#0x10
|
||||
mov r1,#7
|
||||
mov r2,#3
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r3,#6
|
||||
.org 0x80C13EC
|
||||
mov r0,0x10
|
||||
mov r1,7
|
||||
mov r2,3
|
||||
bl print_blankstr
|
||||
mov r3,6
|
||||
mul r4,r3
|
||||
mov r3,#147
|
||||
mov r3,147
|
||||
sub r4,r3,r4
|
||||
|
||||
org $80C1406
|
||||
mov r3,#56
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C1406
|
||||
mov r3,56
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Current HP
|
||||
org $80C1448
|
||||
mov r0,#0xC
|
||||
mov r1,#7
|
||||
mov r2,#3
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r3,#6
|
||||
.org 0x80C1448
|
||||
mov r0,0xC
|
||||
mov r1,7
|
||||
mov r2,3
|
||||
bl print_blankstr
|
||||
mov r3,6
|
||||
mul r4,r3
|
||||
mov r3,#120
|
||||
mov r3,120
|
||||
sub r4,r3,r4
|
||||
|
||||
org $80C1462
|
||||
mov r3,#56
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C1462
|
||||
mov r3,56
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Max PP
|
||||
org $80C14A4
|
||||
mov r0,#0x10
|
||||
mov r1,#9
|
||||
mov r2,#3
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r0,#6
|
||||
.org 0x80C14A4
|
||||
mov r0,0x10
|
||||
mov r1,9
|
||||
mov r2,3
|
||||
bl print_blankstr
|
||||
mov r0,6
|
||||
mul r4,r0
|
||||
mov r0,#147
|
||||
mov r0,147
|
||||
sub r4,r0,r4
|
||||
|
||||
org $80C14BE
|
||||
mov r3,#72
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C14BE
|
||||
mov r3,72
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Current PP
|
||||
org $80C1500
|
||||
mov r0,#0xC
|
||||
mov r1,#9
|
||||
mov r2,#3
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r3,#6
|
||||
.org 0x80C1500
|
||||
mov r0,0xC
|
||||
mov r1,9
|
||||
mov r2,3
|
||||
bl print_blankstr
|
||||
mov r3,6
|
||||
mul r4,r3
|
||||
mov r3,#120
|
||||
mov r3,120
|
||||
|
||||
org $80C1516
|
||||
.org 0x80C1516
|
||||
sub r2,r3,r4
|
||||
mov r3,#72
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
mov r3,72
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Total exp
|
||||
org $80C1560
|
||||
mov r0,#0xC
|
||||
mov r1,#0xB
|
||||
mov r2,#7
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r1,#6
|
||||
.org 0x80C1560
|
||||
mov r0,0xC
|
||||
mov r1,0xB
|
||||
mov r2,7
|
||||
bl print_blankstr
|
||||
mov r1,6
|
||||
mul r4,r1
|
||||
mov r1,#147
|
||||
mov r1,147
|
||||
sub r4,r1,r4
|
||||
|
||||
org $80C157A
|
||||
mov r3,#88
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C157A
|
||||
mov r3,88
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Exp to next level
|
||||
org $80C15E2
|
||||
mov r0,#2
|
||||
mov r1,#0xD
|
||||
mov r2,#6
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r0,#6
|
||||
.org 0x80C15E2
|
||||
mov r0,2
|
||||
mov r1,0xD
|
||||
mov r2,6
|
||||
bl print_blankstr
|
||||
mov r0,6
|
||||
mul r4,r0
|
||||
mov r0,#61
|
||||
mov r0,61
|
||||
sub r4,r0,r4
|
||||
|
||||
org $80C15FC
|
||||
mov r3,#104
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C15FC
|
||||
mov r3,104
|
||||
bl c0a5c_printstr
|
||||
|
||||
org $80C1624
|
||||
mov r0,#2
|
||||
mov r1,#0xD
|
||||
mov r2,#6
|
||||
bl m2_vwf.print_blankstr
|
||||
.org 0x80C1624
|
||||
mov r0,2
|
||||
mov r1,0xD
|
||||
mov r2,6
|
||||
bl print_blankstr
|
||||
|
||||
// Offense
|
||||
org $80C1672
|
||||
mov r0,#0x19
|
||||
mov r1,#1
|
||||
mov r2,#4
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r6,#6
|
||||
.org 0x80C1672
|
||||
mov r0,0x19
|
||||
mov r1,1
|
||||
mov r2,4
|
||||
bl print_blankstr
|
||||
mov r6,6
|
||||
mul r4,r6
|
||||
mov r6,#225
|
||||
mov r6,225
|
||||
sub r4,r6,r4
|
||||
|
||||
org $80C168C
|
||||
mov r3,#8
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C168C
|
||||
mov r3,8
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Defense
|
||||
org $80C16CC
|
||||
mov r0,#0x19
|
||||
mov r1,#3
|
||||
mov r2,#4
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r2,#6
|
||||
.org 0x80C16CC
|
||||
mov r0,0x19
|
||||
mov r1,3
|
||||
mov r2,4
|
||||
bl print_blankstr
|
||||
mov r2,6
|
||||
mul r4,r2
|
||||
sub r4,r6,r4
|
||||
|
||||
org $80C16E4
|
||||
mov r3,#24
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C16E4
|
||||
mov r3,24
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Speed
|
||||
org $80C1724
|
||||
mov r0,#0x19
|
||||
mov r1,#5
|
||||
mov r2,#4
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r2,#6
|
||||
.org 0x80C1724
|
||||
mov r0,0x19
|
||||
mov r1,5
|
||||
mov r2,4
|
||||
bl print_blankstr
|
||||
mov r2,6
|
||||
mul r4,r2
|
||||
sub r4,r6,r4
|
||||
|
||||
org $80C173C
|
||||
mov r3,#40
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C173C
|
||||
mov r3,40
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Guts
|
||||
org $80C177C
|
||||
mov r0,#0x19
|
||||
mov r1,#7
|
||||
mov r2,#4
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r2,#6
|
||||
.org 0x80C177C
|
||||
mov r0,0x19
|
||||
mov r1,7
|
||||
mov r2,4
|
||||
bl print_blankstr
|
||||
mov r2,6
|
||||
mul r4,r2
|
||||
sub r4,r6,r4
|
||||
|
||||
org $80C1794
|
||||
mov r3,#56
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C1794
|
||||
mov r3,56
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Vitality
|
||||
org $80C17D4
|
||||
mov r0,#0x19
|
||||
mov r1,#9
|
||||
mov r2,#4
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r2,#6
|
||||
.org 0x80C17D4
|
||||
mov r0,0x19
|
||||
mov r1,9
|
||||
mov r2,4
|
||||
bl print_blankstr
|
||||
mov r2,6
|
||||
mul r4,r2
|
||||
sub r4,r6,r4
|
||||
|
||||
org $80C17EC
|
||||
mov r3,#72
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C17EC
|
||||
mov r3,72
|
||||
bl c0a5c_printstr
|
||||
|
||||
// IQ
|
||||
org $80C182C
|
||||
mov r0,#0x19
|
||||
mov r1,#0xB
|
||||
mov r2,#4
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r2,#6
|
||||
.org 0x80C182C
|
||||
mov r0,0x19
|
||||
mov r1,0xB
|
||||
mov r2,4
|
||||
bl print_blankstr
|
||||
mov r2,6
|
||||
mul r4,r2
|
||||
sub r4,r6,r4
|
||||
|
||||
org $80C1844
|
||||
mov r3,#88
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C1844
|
||||
mov r3,88
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Luck
|
||||
org $80C1884
|
||||
mov r0,#0x19
|
||||
mov r1,#0xD
|
||||
mov r2,#4
|
||||
bl m2_vwf.print_blankstr
|
||||
mov r2,#6
|
||||
.org 0x80C1884
|
||||
mov r0,0x19
|
||||
mov r1,0xD
|
||||
mov r2,4
|
||||
bl print_blankstr
|
||||
mov r2,6
|
||||
mul r4,r2
|
||||
sub r6,r6,r4
|
||||
|
||||
org $80C189C
|
||||
mov r3,#104
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C189C
|
||||
mov r3,104
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Press A for PSI info
|
||||
org $80C18AC
|
||||
bl m2_vwf_entries.c0a5c_psi_info_blank
|
||||
b $80C18E2
|
||||
.org 0x80C18AC
|
||||
bl c0a5c_psi_info_blank
|
||||
b 0x80C18E2
|
||||
|
||||
org $80C18DA
|
||||
mov r2,#44
|
||||
mov r3,#120
|
||||
bl m2_vwf_entries.c0a5c_printstr
|
||||
.org 0x80C18DA
|
||||
mov r2,44
|
||||
mov r3,120
|
||||
bl c0a5c_printstr
|
||||
|
||||
// Ailment
|
||||
org $80C18E2
|
||||
mov r0,#1
|
||||
mov r1,#3
|
||||
mov r2,#10
|
||||
bl m2_vwf.print_blankstr
|
||||
b $80C18FA
|
||||
.org 0x80C18E2
|
||||
mov r0,1
|
||||
mov r1,3
|
||||
mov r2,10
|
||||
bl print_blankstr
|
||||
b 0x80C18FA
|
||||
|
|
File diff suppressed because it is too large
Load Diff
701
m2-vwf.asm
701
m2-vwf.asm
File diff suppressed because it is too large
Load Diff
BIN
resize.exe
BIN
resize.exe
Binary file not shown.
Loading…
Reference in New Issue