Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix on autolevel when essential fix isn't used #469

Merged
merged 2 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

.equ MagClassTable, MagCharTable+4

@r0 = Base res total | Must be 0xB during return
@r0 = Base res total
@r2 = Level Count | Preserve
@r3 = Character Data (Overwritten by jump)
@r3 = Character Data | Preserve (Overwritten by jump)
@r4 = Unit Pointer | Preserve

@Revert r3 to orginal value
Expand All @@ -19,14 +19,14 @@ strb r0, [r4, #0x19] @Store base luck total

@Get char base magic
ldrb r0, [r3, #0x4] @r0 = Character index
lsl r0, #0x1 @Multiply by size of MagCharTable entry
lsl r0, #0x1 @Multiply by 2 (size of MagCharTable entry)
ldr r3, MagCharTable
ldrb r0, [r3, r0] @r0 = Char base magic

@Get class base magic
ldr r1, [r4, #0x4] @r1 = Class Data pointer
ldrb r1, [r1, #0x4] @r1 = Class index
lsl r1, #0x2 @Multiply by size of MagClassTable entry
lsl r1, #0x2 @Multiply by 4 (size of MagClassTable entry)
ldr r3, MagClassTable
ldrb r1, [r3, r1] @r1 = Class base magic

Expand All @@ -36,11 +36,11 @@ mov r1, #0x3A @r1 = Unit magic offset
strb r0, [r4, r1] @Store base magic total

@Cleanup
mov r0, #0xB @Set r0 before return
ldr r3, [r4] @r3 = Character Data pointer

@Return
ldr r3, =ReturnAddress
bx r3
ldr r1, =ReturnAddress
bx r1

.ltorg
MagCharTable:
Expand Down