mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
clean bg and core function names
This commit is contained in:
parent
d9995eae1a
commit
4339dc18fc
9929
asm/emerald.s
9929
asm/emerald.s
File diff suppressed because it is too large
Load Diff
665
asm/gpu_bg.s
665
asm/gpu_bg.s
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
thumb_func_start lcd_io_copy_queue_clean
|
||||
; void lcd_io_copy_queue_clean()
|
||||
lcd_io_copy_queue_clean: ; 8000FE4
|
||||
thumb_func_start InitGpuRegManager
|
||||
; void InitGpuRegManager()
|
||||
InitGpuRegManager: ; 8000FE4
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
@ -37,11 +37,11 @@ lcd_io_copy_queue_clean: ; 8000FE4
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end lcd_io_copy_queue_clean
|
||||
thumb_func_end InitGpuRegManager
|
||||
|
||||
thumb_func_start lcd_io_buffer_to_hardware
|
||||
; void lcd_io_buffer_to_hardware(u8 reg)
|
||||
lcd_io_buffer_to_hardware: ; 800103C
|
||||
thumb_func_start CopyBufferedValueToGpuReg
|
||||
; void CopyBufferedValueToGpuReg(u8 reg)
|
||||
CopyBufferedValueToGpuReg: ; 800103C
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
@ -71,11 +71,11 @@ lcd_io_buffer_to_hardware: ; 800103C
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end lcd_io_buffer_to_hardware
|
||||
thumb_func_end CopyBufferedValueToGpuReg
|
||||
|
||||
thumb_func_start lcd_io_copy_queue_process
|
||||
; void lcd_io_copy_queue_process()
|
||||
lcd_io_copy_queue_process: ; 8001080
|
||||
thumb_func_start CopyBufferedValuesToGpuRegs
|
||||
; void CopyBufferedValuesToGpuRegs()
|
||||
CopyBufferedValuesToGpuRegs: ; 8001080
|
||||
push {r4,r5,lr}
|
||||
ldr r0, =0x030008d8
|
||||
ldrb r0, [r0]
|
||||
@ -88,7 +88,7 @@ lcd_io_copy_queue_process: ; 8001080
|
||||
ldrb r0, [r4]
|
||||
cmp r0, 0xFF
|
||||
beq @080010A4
|
||||
bl lcd_io_buffer_to_hardware
|
||||
bl CopyBufferedValueToGpuReg
|
||||
movs r0, 0xFF
|
||||
strb r0, [r4]
|
||||
adds r5, 0x1
|
||||
@ -99,11 +99,11 @@ lcd_io_copy_queue_process: ; 8001080
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end lcd_io_copy_queue_process
|
||||
thumb_func_end CopyBufferedValuesToGpuRegs
|
||||
|
||||
thumb_func_start lcd_io_set
|
||||
; void lcd_io_set(u8 reg, u16 value)
|
||||
lcd_io_set: ; 80010B4
|
||||
thumb_func_start SetGpuReg
|
||||
; void SetGpuReg(u8 reg, u16 value)
|
||||
SetGpuReg: ; 80010B4
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
@ -132,7 +132,7 @@ lcd_io_set: ; 80010B4
|
||||
beq @080010FE
|
||||
@080010E8:
|
||||
adds r0, r4, 0
|
||||
bl lcd_io_buffer_to_hardware
|
||||
bl CopyBufferedValueToGpuReg
|
||||
b @08001130
|
||||
.pool
|
||||
@080010F8:
|
||||
@ -172,11 +172,11 @@ lcd_io_set: ; 80010B4
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end lcd_io_set
|
||||
thumb_func_end SetGpuReg
|
||||
|
||||
thumb_func_start lcd_io_set_forced_blank
|
||||
; void lcd_io_set_forced_blank(u8 reg, u16 value)
|
||||
lcd_io_set_forced_blank: ; 8001140
|
||||
thumb_func_start SetGpuReg_ScreenOff
|
||||
; void SetGpuReg_ScreenOff(u8 reg, u16 value)
|
||||
SetGpuReg_ScreenOff: ; 8001140
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
@ -195,7 +195,7 @@ lcd_io_set_forced_blank: ; 8001140
|
||||
cmp r0, 0
|
||||
beq @08001176
|
||||
adds r0, r4, 0
|
||||
bl lcd_io_buffer_to_hardware
|
||||
bl CopyBufferedValueToGpuReg
|
||||
b @080011A8
|
||||
.pool
|
||||
@08001170:
|
||||
@ -235,11 +235,11 @@ lcd_io_set_forced_blank: ; 8001140
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end lcd_io_set_forced_blank
|
||||
thumb_func_end SetGpuReg_ScreenOff
|
||||
|
||||
thumb_func_start lcd_io_get
|
||||
; u16 lcd_io_get(u8 reg)
|
||||
lcd_io_get: ; 80011B8
|
||||
thumb_func_start GetGpuReg
|
||||
; u16 GetGpuReg(u8 reg)
|
||||
GetGpuReg: ; 80011B8
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
@ -265,11 +265,11 @@ lcd_io_get: ; 80011B8
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end lcd_io_get
|
||||
thumb_func_end GetGpuReg
|
||||
|
||||
thumb_func_start lcd_io_set_bits
|
||||
; void lcd_io_set_bits(u8 reg, u16 mask)
|
||||
lcd_io_set_bits: ; 80011E8
|
||||
thumb_func_start SetGpuRegBits
|
||||
; void SetGpuRegBits(u8 reg, u16 mask)
|
||||
SetGpuRegBits: ; 80011E8
|
||||
push {lr}
|
||||
adds r2, r1, 0
|
||||
lsls r0, 24
|
||||
@ -280,15 +280,15 @@ lcd_io_set_bits: ; 80011E8
|
||||
orrs r1, r2
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end lcd_io_set_bits
|
||||
thumb_func_end SetGpuRegBits
|
||||
|
||||
thumb_func_start lcd_io_clear_bits
|
||||
; void lcd_io_clear_bits(u8 reg, u16 mask)
|
||||
lcd_io_clear_bits: ; 8001208
|
||||
thumb_func_start ResetGpuRegBits
|
||||
; void ResetGpuRegBits(u8 reg, u16 mask)
|
||||
ResetGpuRegBits: ; 8001208
|
||||
push {lr}
|
||||
adds r2, r1, 0
|
||||
lsls r0, 24
|
||||
@ -299,15 +299,15 @@ lcd_io_clear_bits: ; 8001208
|
||||
ldrh r1, [r1]
|
||||
lsrs r2, 16
|
||||
bics r1, r2
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end lcd_io_clear_bits
|
||||
thumb_func_end ResetGpuRegBits
|
||||
|
||||
thumb_func_start update_hardware_IE
|
||||
; void update_hardware_IE()
|
||||
update_hardware_IE: ; 8001228
|
||||
thumb_func_start SyncIEReg
|
||||
; void SyncIEReg()
|
||||
SyncIEReg: ; 8001228
|
||||
push {r4,r5,lr}
|
||||
ldr r5, =0x030008d9
|
||||
ldrb r0, [r5]
|
||||
@ -328,11 +328,11 @@ update_hardware_IE: ; 8001228
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end update_hardware_IE
|
||||
thumb_func_end SyncIEReg
|
||||
|
||||
thumb_func_start enable_irqs
|
||||
; void enable_irqs(u16 value)
|
||||
enable_irqs: ; 800125C
|
||||
thumb_func_start EnableInterrupts
|
||||
; void EnableInterrupts(u16 mask)
|
||||
EnableInterrupts: ; 800125C
|
||||
push {r4,lr}
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
@ -343,18 +343,18 @@ enable_irqs: ; 800125C
|
||||
ldr r1, =0x030008d9
|
||||
movs r0, 0x1
|
||||
strb r0, [r1]
|
||||
bl update_hardware_IE
|
||||
bl SyncIEReg
|
||||
ldrh r0, [r4]
|
||||
bl dispstat_set_vblank_hblank_irqs
|
||||
bl SetDispstatVBlankHBlankInterrupts
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end enable_irqs
|
||||
thumb_func_end EnableInterrupts
|
||||
|
||||
thumb_func_start disable_irqs
|
||||
; void disable_irqs(u16 value)
|
||||
disable_irqs: ; 8001288
|
||||
thumb_func_start DisableInterrupts
|
||||
; void DisableInterrupts(u16 mask)
|
||||
DisableInterrupts: ; 8001288
|
||||
push {r4,lr}
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
@ -365,24 +365,24 @@ disable_irqs: ; 8001288
|
||||
ldr r1, =0x030008d9
|
||||
movs r0, 0x1
|
||||
strb r0, [r1]
|
||||
bl update_hardware_IE
|
||||
bl SyncIEReg
|
||||
ldrh r0, [r4]
|
||||
bl dispstat_set_vblank_hblank_irqs
|
||||
bl SetDispstatVBlankHBlankInterrupts
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end disable_irqs
|
||||
thumb_func_end DisableInterrupts
|
||||
|
||||
thumb_func_start dispstat_set_vblank_hblank_irqs
|
||||
; void dispstat_set_vblank_hblank_irqs(u16 value)
|
||||
dispstat_set_vblank_hblank_irqs: ; 80012B4
|
||||
thumb_func_start SetDispstatVBlankHBlankInterrupts
|
||||
; void SetDispstatVBlankHBlankInterrupts(u16 mask)
|
||||
SetDispstatVBlankHBlankInterrupts: ; 80012B4
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
movs r0, 0x4
|
||||
bl lcd_io_get
|
||||
bl GetGpuReg
|
||||
movs r2, 0x18
|
||||
ands r2, r0
|
||||
movs r1, 0x1
|
||||
@ -402,9 +402,9 @@ dispstat_set_vblank_hblank_irqs: ; 80012B4
|
||||
cmp r2, r1
|
||||
beq @080012EA
|
||||
movs r0, 0x4
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
@080012EA:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end dispstat_set_vblank_hblank_irqs
|
||||
thumb_func_end SetDispstatVBlankHBlankInterrupts
|
||||
|
221
asm/main.s
221
asm/main.s
@ -10,27 +10,27 @@ Main:
|
||||
ldr r2, =0x00007fff
|
||||
adds r0, r2, 0
|
||||
strh r0, [r1]
|
||||
bl lcd_io_copy_queue_clean
|
||||
bl InitGpuRegManager
|
||||
ldr r1, =0x04000204
|
||||
ldr r3, =0x00004014
|
||||
adds r0, r3, 0
|
||||
strh r0, [r1]
|
||||
bl init_keypad_data
|
||||
bl init_irq_handler
|
||||
bl InitKeypadData
|
||||
bl InitIntrHandlers
|
||||
bl m4aSoundInit
|
||||
bl lcd_enable_vcount_irq_at_150px
|
||||
bl EnableVCountIntrAtLine150
|
||||
bl sub_800E6D0
|
||||
bl GameFreakRTC_Init
|
||||
bl flash_timeout_start_on_timer_2_when_flash_present
|
||||
bl init_saveblock_ptrs_and_set_copyright_callback2
|
||||
bl CheckForFlashMemory
|
||||
bl InitVariablesAndSetCopyrightScreenCallback
|
||||
bl sound_sources_off
|
||||
bl ClearDma3Requests
|
||||
bl gpu_init_bgs
|
||||
bl ResetBgs
|
||||
bl SetDefaultFontsPointer
|
||||
ldr r0, =0x02000000
|
||||
movs r1, 0xE0
|
||||
lsls r1, 9
|
||||
bl init_malloc
|
||||
bl InitHeap
|
||||
ldr r0, =0x03002700
|
||||
movs r4, 0
|
||||
strb r4, [r0]
|
||||
@ -39,7 +39,7 @@ Main:
|
||||
cmp r0, 0x1
|
||||
beq @08000414
|
||||
movs r0, 0
|
||||
bl set_callback2
|
||||
bl SetMainCallback2
|
||||
@08000414:
|
||||
ldr r2, =0x030022b4
|
||||
strb r4, [r2]
|
||||
@ -53,7 +53,7 @@ Main:
|
||||
mov r8, r0
|
||||
adds r6, r2, 0
|
||||
@0800042A:
|
||||
bl load_keys
|
||||
bl ReadKeypad
|
||||
ldr r0, =0x03002700
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0
|
||||
@ -69,13 +69,13 @@ Main:
|
||||
bne @08000454
|
||||
bl rfu_REQ_stopMode
|
||||
bl rfu_waitREQComplete
|
||||
bl do_reset
|
||||
bl Reset
|
||||
@08000454:
|
||||
bl sub_8087634
|
||||
cmp r0, 0x1
|
||||
bne @0800048C
|
||||
strb r0, [r6]
|
||||
bl call_callbacks_wrapper
|
||||
bl HandleLinkConnectionAndCallMainCallbacks
|
||||
movs r0, 0
|
||||
strb r0, [r6]
|
||||
b @080004B2
|
||||
@ -84,7 +84,7 @@ Main:
|
||||
ldr r5, =0x030022b4
|
||||
movs r0, 0
|
||||
strb r0, [r5]
|
||||
bl call_callbacks_wrapper
|
||||
bl HandleLinkConnectionAndCallMainCallbacks
|
||||
bl sub_80875C8
|
||||
adds r4, r0, 0
|
||||
cmp r4, 0x1
|
||||
@ -93,34 +93,34 @@ Main:
|
||||
strh r0, [r7, 0x2E]
|
||||
bl copy_queue_clear
|
||||
strb r4, [r5]
|
||||
bl call_callbacks_wrapper
|
||||
bl HandleLinkConnectionAndCallMainCallbacks
|
||||
mov r2, r8
|
||||
strb r2, [r5]
|
||||
@080004B2:
|
||||
bl gametime_increment
|
||||
bl sound_something
|
||||
bl wait_for_vblank
|
||||
bl WaitForVBlankIntr
|
||||
b @0800042A
|
||||
.pool
|
||||
thumb_func_end Main
|
||||
|
||||
thumb_func_start call_callbacks_wrapper
|
||||
; void call_callbacks_wrapper()
|
||||
call_callbacks_wrapper: ; 80004C4
|
||||
thumb_func_start HandleLinkConnectionAndCallMainCallbacks
|
||||
; void HandleLinkConnectionAndCallMainCallbacks()
|
||||
HandleLinkConnectionAndCallMainCallbacks: ; 80004C4
|
||||
push {lr}
|
||||
bl sub_800B40C
|
||||
bl HandleLinkConnection
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne @080004D4
|
||||
bl call_callbacks
|
||||
bl CallMainCallbacks
|
||||
@080004D4:
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end call_callbacks_wrapper
|
||||
thumb_func_end HandleLinkConnectionAndCallMainCallbacks
|
||||
|
||||
thumb_func_start init_saveblock_ptrs_and_set_copyright_callback2
|
||||
; void init_saveblock_ptrs_and_set_copyright_callback2()
|
||||
init_saveblock_ptrs_and_set_copyright_callback2: ; 80004D8
|
||||
thumb_func_start InitVariablesAndSetCopyrightScreenCallback
|
||||
; void InitVariablesAndSetCopyrightScreenCallback()
|
||||
InitVariablesAndSetCopyrightScreenCallback: ; 80004D8
|
||||
push {lr}
|
||||
ldr r2, =0x030022c0
|
||||
movs r0, 0
|
||||
@ -130,7 +130,7 @@ init_saveblock_ptrs_and_set_copyright_callback2: ; 80004D8
|
||||
str r0, [r2, 0x24]
|
||||
str r0, [r2]
|
||||
ldr r0, =c2_copyright_1
|
||||
bl set_callback2
|
||||
bl SetMainCallback2
|
||||
ldr r1, =0x03005d90
|
||||
ldr r0, =0x02024a54
|
||||
str r0, [r1]
|
||||
@ -140,11 +140,11 @@ init_saveblock_ptrs_and_set_copyright_callback2: ; 80004D8
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end init_saveblock_ptrs_and_set_copyright_callback2
|
||||
thumb_func_end InitVariablesAndSetCopyrightScreenCallback
|
||||
|
||||
thumb_func_start call_callbacks
|
||||
; void call_callbacks()
|
||||
call_callbacks: ; 800051C
|
||||
thumb_func_start CallMainCallbacks
|
||||
; void CallMainCallbacks()
|
||||
CallMainCallbacks: ; 800051C
|
||||
push {r4,lr}
|
||||
ldr r4, =0x030022c0
|
||||
ldr r0, [r4]
|
||||
@ -161,11 +161,11 @@ call_callbacks: ; 800051C
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end call_callbacks
|
||||
thumb_func_end CallMainCallbacks
|
||||
|
||||
thumb_func_start set_callback2
|
||||
; void set_callback2(void ( *func)())
|
||||
set_callback2: ; 8000540
|
||||
thumb_func_start SetMainCallback2
|
||||
; void SetMainCallback2(void ( *func)())
|
||||
SetMainCallback2: ; 8000540
|
||||
ldr r1, =0x030022c0
|
||||
str r0, [r1, 0x4]
|
||||
movs r0, 0x87
|
||||
@ -175,21 +175,21 @@ set_callback2: ; 8000540
|
||||
strb r0, [r1]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end set_callback2
|
||||
thumb_func_end SetMainCallback2
|
||||
|
||||
thumb_func_start start_timer1
|
||||
; void start_timer1()
|
||||
start_timer1: ; 8000554
|
||||
thumb_func_start StartTimer1
|
||||
; void StartTimer1()
|
||||
StartTimer1: ; 8000554
|
||||
ldr r1, =0x04000106
|
||||
movs r0, 0x80
|
||||
strh r0, [r1]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end start_timer1
|
||||
thumb_func_end StartTimer1
|
||||
|
||||
thumb_func_start set_rand_seed_and_trainer_id_hi
|
||||
; void set_rand_seed_and_trainer_id_hi()
|
||||
set_rand_seed_and_trainer_id_hi: ; 8000560
|
||||
thumb_func_start SetRngAndSetTrainerId
|
||||
; void SetRngAndSetTrainerId()
|
||||
SetRngAndSetTrainerId: ; 8000560
|
||||
push {r4,lr}
|
||||
ldr r0, =0x04000104
|
||||
ldrh r4, [r0]
|
||||
@ -204,23 +204,23 @@ set_rand_seed_and_trainer_id_hi: ; 8000560
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end set_rand_seed_and_trainer_id_hi
|
||||
thumb_func_end SetRngAndSetTrainerId
|
||||
|
||||
thumb_func_start get_trainer_id_hi
|
||||
; u16 get_trainer_id_hi()
|
||||
get_trainer_id_hi: ; 8000588
|
||||
thumb_func_start GetTrainerId
|
||||
; u16 GetTrainerId()
|
||||
GetTrainerId: ; 8000588
|
||||
ldr r0, =0x02020000
|
||||
ldrh r0, [r0]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end get_trainer_id_hi
|
||||
thumb_func_end GetTrainerId
|
||||
|
||||
thumb_func_start lcd_enable_vcount_irq_at_150px
|
||||
; void lcd_enable_vcount_irq_at_150px()
|
||||
lcd_enable_vcount_irq_at_150px: ; 8000594
|
||||
thumb_func_start EnableVCountIntrAtLine150
|
||||
; void EnableVCountIntrAtLine150()
|
||||
EnableVCountIntrAtLine150: ; 8000594
|
||||
push {lr}
|
||||
movs r0, 0x4
|
||||
bl lcd_io_get
|
||||
bl GetGpuReg
|
||||
movs r1, 0xFF
|
||||
ands r1, r0
|
||||
movs r2, 0x96
|
||||
@ -230,16 +230,16 @@ lcd_enable_vcount_irq_at_150px: ; 8000594
|
||||
movs r0, 0x20
|
||||
orrs r1, r0
|
||||
movs r0, 0x4
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x4
|
||||
bl enable_irqs
|
||||
bl EnableInterrupts
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end lcd_enable_vcount_irq_at_150px
|
||||
thumb_func_end EnableVCountIntrAtLine150
|
||||
|
||||
thumb_func_start init_keypad_data
|
||||
; void init_keypad_data()
|
||||
init_keypad_data: ; 80005BC
|
||||
thumb_func_start InitKeypadData
|
||||
; void InitKeypadData()
|
||||
InitKeypadData: ; 80005BC
|
||||
ldr r1, =0x030026fc
|
||||
movs r0, 0x5
|
||||
strh r0, [r1]
|
||||
@ -255,11 +255,11 @@ init_keypad_data: ; 80005BC
|
||||
strh r0, [r1, 0x2A]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end init_keypad_data
|
||||
thumb_func_end InitKeypadData
|
||||
|
||||
thumb_func_start load_keys
|
||||
; void load_keys()
|
||||
load_keys: ; 80005E4
|
||||
thumb_func_start ReadKeypad
|
||||
; void ReadKeypad()
|
||||
ReadKeypad: ; 80005E4
|
||||
push {lr}
|
||||
ldr r0, =0x04000130
|
||||
ldrh r1, [r0]
|
||||
@ -334,11 +334,11 @@ load_keys: ; 80005E4
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end load_keys
|
||||
thumb_func_end ReadKeypad
|
||||
|
||||
thumb_func_start init_irq_handler
|
||||
; void init_irq_handler()
|
||||
init_irq_handler: ; 8000684
|
||||
thumb_func_start InitIntrHandlers
|
||||
; void InitIntrHandlers()
|
||||
InitIntrHandlers: ; 8000684
|
||||
push {r4,r5,lr}
|
||||
ldr r5, =InterruptMain
|
||||
ldr r4, =0x03002750
|
||||
@ -364,17 +364,17 @@ init_irq_handler: ; 8000684
|
||||
movs r0, 0
|
||||
bl SetHBlankCallback
|
||||
movs r0, 0
|
||||
bl set_serial_callback
|
||||
bl SetSerialCallback
|
||||
ldr r1, =0x04000208
|
||||
movs r0, 0x1
|
||||
strh r0, [r1]
|
||||
movs r0, 0x1
|
||||
bl enable_irqs
|
||||
bl EnableInterrupts
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end init_irq_handler
|
||||
thumb_func_end InitIntrHandlers
|
||||
|
||||
thumb_func_start SetVBlankCallback
|
||||
; void SetVBlankCallback(void ( *func)())
|
||||
@ -395,6 +395,7 @@ SetHBlankCallback: ; 80006FC
|
||||
thumb_func_end SetHBlankCallback
|
||||
|
||||
thumb_func_start SetVCountCallback
|
||||
; void SetVCountCallback(void ( *func)())
|
||||
SetVCountCallback: ; 8000708
|
||||
ldr r1, =0x030022c0
|
||||
str r0, [r1, 0x14]
|
||||
@ -402,30 +403,30 @@ SetVCountCallback: ; 8000708
|
||||
.pool
|
||||
thumb_func_end SetVCountCallback
|
||||
|
||||
thumb_func_start restore_serial_timer3_irq_handlers
|
||||
; void restore_serial_timer3_irq_handlers()
|
||||
restore_serial_timer3_irq_handlers: ; 8000714
|
||||
thumb_func_start RestoreSerialTimer3IntrHandlers
|
||||
; void RestoreSerialTimer3IntrHandlers()
|
||||
RestoreSerialTimer3IntrHandlers: ; 8000714
|
||||
ldr r0, =0x03002710
|
||||
ldr r1, =irq_serial
|
||||
ldr r1, =SerialIntr
|
||||
str r1, [r0, 0x4]
|
||||
ldr r1, =irq_timer3
|
||||
ldr r1, =Timer3Intr
|
||||
str r1, [r0, 0x8]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end restore_serial_timer3_irq_handlers
|
||||
thumb_func_end RestoreSerialTimer3IntrHandlers
|
||||
|
||||
thumb_func_start set_serial_callback
|
||||
; void set_serial_callback(void ( *func)())
|
||||
set_serial_callback: ; 800072C
|
||||
thumb_func_start SetSerialCallback
|
||||
; void SetSerialCallback(void ( *func)())
|
||||
SetSerialCallback: ; 800072C
|
||||
ldr r1, =0x030022c0
|
||||
str r0, [r1, 0x18]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end set_serial_callback
|
||||
thumb_func_end SetSerialCallback
|
||||
|
||||
thumb_func_start irq_vblank
|
||||
; void irq_vblank()
|
||||
irq_vblank: ; 8000738
|
||||
thumb_func_start VBlankIntr
|
||||
; void VBlankIntr()
|
||||
VBlankIntr: ; 8000738
|
||||
push {r4,lr}
|
||||
ldr r0, =0x030030fc
|
||||
ldrb r0, [r0]
|
||||
@ -466,7 +467,7 @@ irq_vblank: ; 8000738
|
||||
ldr r0, [r4, 0x24]
|
||||
adds r0, 0x1
|
||||
str r0, [r4, 0x24]
|
||||
bl lcd_io_copy_queue_process
|
||||
bl CopyBufferedValuesToGpuRegs
|
||||
bl ProcessDma3Requests
|
||||
ldr r1, =0x03002f50
|
||||
ldr r0, =0x03006380
|
||||
@ -505,11 +506,11 @@ irq_vblank: ; 8000738
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end irq_vblank
|
||||
thumb_func_end VBlankIntr
|
||||
|
||||
thumb_func_start flash_timeout_start_on_timer_2
|
||||
; void flash_timeout_start_on_timer_2()
|
||||
flash_timeout_start_on_timer_2: ; 8000800
|
||||
thumb_func_start StartFlashMemoryTimer
|
||||
; void StartFlashMemoryTimer()
|
||||
StartFlashMemoryTimer: ; 8000800
|
||||
push {lr}
|
||||
ldr r1, =0x0300272c
|
||||
movs r0, 0x2
|
||||
@ -517,11 +518,11 @@ flash_timeout_start_on_timer_2: ; 8000800
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end flash_timeout_start_on_timer_2
|
||||
thumb_func_end StartFlashMemoryTimer
|
||||
|
||||
thumb_func_start irq_hblank
|
||||
; void irq_hblank()
|
||||
irq_hblank: ; 8000814
|
||||
thumb_func_start HBlankIntr
|
||||
; void HBlankIntr()
|
||||
HBlankIntr: ; 8000814
|
||||
push {r4,lr}
|
||||
ldr r4, =0x030022c0
|
||||
ldr r0, [r4, 0x10]
|
||||
@ -542,11 +543,11 @@ irq_hblank: ; 8000814
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end irq_hblank
|
||||
thumb_func_end HBlankIntr
|
||||
|
||||
thumb_func_start irq_vcount
|
||||
; void irq_vcount()
|
||||
irq_vcount: ; 8000844
|
||||
thumb_func_start VCountIntr
|
||||
; void VCountIntr()
|
||||
VCountIntr: ; 8000844
|
||||
push {r4,lr}
|
||||
ldr r4, =0x030022c0
|
||||
ldr r0, [r4, 0x14]
|
||||
@ -568,11 +569,11 @@ irq_vcount: ; 8000844
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end irq_vcount
|
||||
thumb_func_end VCountIntr
|
||||
|
||||
thumb_func_start irq_serial
|
||||
; void irq_serial()
|
||||
irq_serial: ; 8000878
|
||||
thumb_func_start SerialIntr
|
||||
; void SerialIntr()
|
||||
SerialIntr: ; 8000878
|
||||
push {r4,lr}
|
||||
ldr r4, =0x030022c0
|
||||
ldr r0, [r4, 0x18]
|
||||
@ -593,17 +594,17 @@ irq_serial: ; 8000878
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end irq_serial
|
||||
thumb_func_end SerialIntr
|
||||
|
||||
thumb_func_start irq_other
|
||||
; void irq_other()
|
||||
irq_other: ; 80008A8
|
||||
thumb_func_start DummyIntrHandler
|
||||
; void DummyIntrHandler()
|
||||
DummyIntrHandler: ; 80008A8
|
||||
bx lr
|
||||
thumb_func_end irq_other
|
||||
thumb_func_end DummyIntrHandler
|
||||
|
||||
thumb_func_start wait_for_vblank
|
||||
; void wait_for_vblank()
|
||||
wait_for_vblank: ; 80008AC
|
||||
thumb_func_start WaitForVBlankIntr
|
||||
; void WaitForVBlankIntr()
|
||||
WaitForVBlankIntr: ; 80008AC
|
||||
push {lr}
|
||||
ldr r2, =0x030022c0
|
||||
ldrh r1, [r2, 0x1C]
|
||||
@ -627,7 +628,7 @@ wait_for_vblank: ; 80008AC
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end wait_for_vblank
|
||||
thumb_func_end WaitForVBlankIntr
|
||||
|
||||
thumb_func_start sub_80008DC
|
||||
sub_80008DC: ; 80008DC
|
||||
@ -646,9 +647,9 @@ sub_80008E8: ; 80008E8
|
||||
.pool
|
||||
thumb_func_end sub_80008E8
|
||||
|
||||
thumb_func_start do_reset
|
||||
; void do_reset()
|
||||
do_reset: ; 80008F4
|
||||
thumb_func_start Reset
|
||||
; void Reset()
|
||||
Reset: ; 80008F4
|
||||
push {r4,lr}
|
||||
ldr r1, =0x04000208
|
||||
movs r0, 0
|
||||
@ -692,7 +693,7 @@ do_reset: ; 80008F4
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end do_reset
|
||||
thumb_func_end Reset
|
||||
|
||||
thumb_func_start sub_8000964
|
||||
sub_8000964: ; 8000964
|
||||
|
321
asm/main_menu.s
321
asm/main_menu.s
@ -53,34 +53,34 @@ InitMainMenu: ; 802F6F4
|
||||
bl SetVBlankCallback
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0xC
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0xA
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x8
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x18
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x1A
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x14
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x16
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x10
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x12
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
add r1, sp, 0x4
|
||||
movs r0, 0
|
||||
strh r0, [r1]
|
||||
@ -146,27 +146,27 @@ InitMainMenu: ; 802F6F4
|
||||
bl pal_fade_maybe
|
||||
@0802F7FE:
|
||||
movs r0, 0
|
||||
bl gpu_reset_bgs_and_dma3_busy_flags
|
||||
bl ResetBgsAndClearDma3BusyFlags
|
||||
ldr r1, =gUnknown_082FF0E8
|
||||
movs r0, 0
|
||||
movs r2, 0x2
|
||||
bl bg_vram_setup
|
||||
bl InitBgsFromTemplates
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl bg_change_x_offset
|
||||
bl ChangeBgX
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl bg_change_y_offset
|
||||
bl ChangeBgY
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl bg_change_x_offset
|
||||
bl ChangeBgX
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl bg_change_y_offset
|
||||
bl ChangeBgY
|
||||
ldr r0, =gUnknown_082FF038
|
||||
bl InitWindows
|
||||
bl DeactivateAllTextPrinters
|
||||
@ -175,39 +175,39 @@ InitMainMenu: ; 802F6F4
|
||||
bl LoadMainMenuWindowFrameTiles
|
||||
movs r0, 0x40
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x44
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x48
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x4A
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x50
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x52
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x54
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x1
|
||||
bl enable_irqs
|
||||
bl EnableInterrupts
|
||||
ldr r0, =VBlankCB_MainMenu
|
||||
bl SetVBlankCallback
|
||||
ldr r0, =CB2_MainMenu
|
||||
bl set_callback2
|
||||
bl SetMainCallback2
|
||||
movs r1, 0xC1
|
||||
lsls r1, 6
|
||||
movs r0, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0
|
||||
bl gpu_sync_bg_show
|
||||
bl ShowBg
|
||||
movs r0, 0x1
|
||||
bl gpu_sync_bg_hide
|
||||
bl HideBg
|
||||
ldr r0, =Task_MainMenuCheckSaveFile
|
||||
movs r1, 0
|
||||
bl AddTask
|
||||
@ -245,25 +245,25 @@ Task_MainMenuCheckSaveFile: ; 802F8D8
|
||||
@0802F900:
|
||||
movs r0, 0x40
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x44
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x48
|
||||
movs r1, 0x11
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x4A
|
||||
movs r1, 0x31
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x50
|
||||
movs r1, 0xC1
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x52
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x54
|
||||
movs r1, 0x7
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
bl sub_80093CC
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
@ -453,25 +453,25 @@ Task_MainMenuCheckBattery: ; 802FAB0
|
||||
bne @0802FB3C
|
||||
movs r0, 0x40
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x44
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x48
|
||||
movs r1, 0x11
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x4A
|
||||
movs r1, 0x31
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x50
|
||||
movs r1, 0xC1
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x52
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x54
|
||||
movs r1, 0x7
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
bl GameFreakRTC_GetErrorFlags
|
||||
movs r1, 0xFF
|
||||
lsls r1, 4
|
||||
@ -567,25 +567,25 @@ Task_DisplayMainMenu: ; 802FBA4
|
||||
@0802FBCE:
|
||||
movs r0, 0x40
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x44
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x48
|
||||
movs r1, 0x11
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x4A
|
||||
movs r1, 0x31
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x50
|
||||
movs r1, 0xC1
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x52
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x54
|
||||
movs r1, 0x7
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
add r0, sp, 0xC
|
||||
strh r4, [r0]
|
||||
movs r1, 0xFE
|
||||
@ -1001,11 +1001,11 @@ Task_DisplayMainMenu: ; 802FBA4
|
||||
movs r0, 0
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x1
|
||||
bl bg_change_y_offset
|
||||
bl ChangeBgY
|
||||
movs r0, 0x1
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x1
|
||||
bl bg_change_y_offset
|
||||
bl ChangeBgY
|
||||
movs r0, 0x1
|
||||
strh r0, [r6, 0x1C]
|
||||
movs r2, 0x1A
|
||||
@ -1113,10 +1113,10 @@ HandleMainMenuInput: ; 80300E0
|
||||
bl pal_fade_maybe
|
||||
movs r0, 0x40
|
||||
movs r1, 0xF0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x44
|
||||
movs r1, 0xA0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
adds r0, r7, 0
|
||||
subs r0, 0x8
|
||||
adds r0, r4, r0
|
||||
@ -1148,11 +1148,11 @@ HandleMainMenuInput: ; 80300E0
|
||||
movs r0, 0
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x2
|
||||
bl bg_change_y_offset
|
||||
bl ChangeBgY
|
||||
movs r0, 0x1
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x2
|
||||
bl bg_change_y_offset
|
||||
bl ChangeBgY
|
||||
movs r2, 0x1A
|
||||
ldrsh r1, [r5, r2]
|
||||
lsls r0, r1, 2
|
||||
@ -1195,11 +1195,11 @@ HandleMainMenuInput: ; 80300E0
|
||||
movs r0, 0
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x1
|
||||
bl bg_change_y_offset
|
||||
bl ChangeBgY
|
||||
movs r0, 0x1
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x1
|
||||
bl bg_change_y_offset
|
||||
bl ChangeBgY
|
||||
ldr r2, =0x03005e00
|
||||
movs r0, 0x1A
|
||||
ldrsh r1, [r5, r0]
|
||||
@ -1431,11 +1431,11 @@ Task_HandleMainMenuAPressed: ; 803027C
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl bg_change_y_offset
|
||||
bl ChangeBgY
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl bg_change_y_offset
|
||||
bl ChangeBgY
|
||||
cmp r5, 0x6
|
||||
bhi @0803041C
|
||||
lsls r0, r5, 2
|
||||
@ -1494,7 +1494,7 @@ Task_HandleMainMenuAPressed: ; 803027C
|
||||
@08030488:
|
||||
ldr r0, =sub_801867C
|
||||
@0803048A:
|
||||
bl set_callback2
|
||||
bl SetMainCallback2
|
||||
adds r0, r6, 0
|
||||
bl remove_task
|
||||
b @08030514
|
||||
@ -1519,22 +1519,22 @@ Task_HandleMainMenuAPressed: ; 803027C
|
||||
strh r1, [r0]
|
||||
movs r0, 0x18
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x1A
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x14
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x16
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x10
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x12
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
str r4, [sp]
|
||||
@ -1602,7 +1602,7 @@ Task_HandleMainMenuBPressed: ; 8030544
|
||||
strh r4, [r0]
|
||||
bl FreeAllWindowBuffers
|
||||
ldr r0, =c2_title_screen_1
|
||||
bl set_callback2
|
||||
bl SetMainCallback2
|
||||
adds r0, r5, 0
|
||||
bl remove_task
|
||||
@0803058C:
|
||||
@ -1649,7 +1649,7 @@ Task_DisplayMainMenuInvalidActionError: ; 80305A4
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl bg_fill_tilemap_rect
|
||||
bl FillBgTileMapBufferRect_Palette0
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, 0x1
|
||||
@ -1743,7 +1743,7 @@ HighlightSelectedMainMenuItem: ; 8030698
|
||||
lsrs r6, r2, 16
|
||||
ldr r1, =0x000009e7
|
||||
movs r0, 0x40
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
cmp r5, 0x1
|
||||
beq @080306DC
|
||||
cmp r5, 0x1
|
||||
@ -1855,13 +1855,13 @@ HighlightSelectedMainMenuItem: ; 8030698
|
||||
ldr r1, =0x0000819f
|
||||
@0803078E:
|
||||
movs r0, 0x44
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
b @080307A4
|
||||
.pool
|
||||
@0803079C:
|
||||
ldr r1, =0x0000819f
|
||||
movs r0, 0x44
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
@080307A4:
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
@ -1879,34 +1879,34 @@ task_new_game_prof_birch_speech_1: ; 80307B0
|
||||
lsrs r4, 24
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r1, 0x82
|
||||
lsls r1, 5
|
||||
movs r0, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
ldr r0, =gUnknown_082FF0F0
|
||||
bl bg_init_bg_config_2_from_bg_config_3
|
||||
bl InitBgFromTemplate
|
||||
movs r0, 0x40
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x44
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x48
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x4A
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x50
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x52
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x54
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
ldr r0, =gUnknown_082FED3C
|
||||
movs r1, 0xC0
|
||||
lsls r1, 19
|
||||
@ -1927,7 +1927,7 @@ task_new_game_prof_birch_speech_1: ; 80307B0
|
||||
bl gpu_pal_allocator_reset
|
||||
bl dp13_810BB8C
|
||||
adds r0, r4, 0
|
||||
bl sub_803192C
|
||||
bl AddBirchSpeechObjects
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
movs r5, 0
|
||||
@ -1953,9 +1953,9 @@ task_new_game_prof_birch_speech_1: ; 80307B0
|
||||
lsls r0, 1
|
||||
bl song_play_for_text
|
||||
movs r0, 0
|
||||
bl gpu_sync_bg_show
|
||||
bl ShowBg
|
||||
movs r0, 0x1
|
||||
bl gpu_sync_bg_show
|
||||
bl ShowBg
|
||||
add sp, 0x4
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
@ -2430,7 +2430,7 @@ task_new_game_prof_birch_speech_8: ; 8030C90
|
||||
strh r0, [r2, 0x10]
|
||||
ldrh r1, [r2, 0x10]
|
||||
movs r0, 0x14
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
b @08030CC8
|
||||
.pool
|
||||
@08030CC0:
|
||||
@ -3102,7 +3102,7 @@ task_new_game_prof_birch_speech_part2_5: ; 8031220
|
||||
strh r0, [r1, 0x10]
|
||||
ldrh r1, [r1, 0x10]
|
||||
movs r0, 0x14
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
b @08031250
|
||||
.pool
|
||||
@0803124C:
|
||||
@ -3544,7 +3544,7 @@ task_new_game_prof_birch_speech_part2_11: ; 80315BC
|
||||
movs r1, 0x82
|
||||
lsls r1, 5
|
||||
movs r0, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
ldr r0, =0xffff0000
|
||||
ldr r1, =0x0000ffff
|
||||
str r1, [sp]
|
||||
@ -3583,7 +3583,7 @@ task_new_game_prof_birch_speech_part2_12: ; 8031630
|
||||
bl sub_818D820
|
||||
bl dp13_810BB8C
|
||||
ldr r0, =c2_new_game
|
||||
bl set_callback2
|
||||
bl SetMainCallback2
|
||||
adds r0, r4, 0
|
||||
bl remove_task
|
||||
@08031666:
|
||||
@ -3598,49 +3598,49 @@ new_game_prof_birch_speech_part2_start: ; 8031678
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0xC
|
||||
movs r0, 0
|
||||
bl gpu_reset_bgs_and_dma3_busy_flags
|
||||
bl ResetBgsAndClearDma3BusyFlags
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r1, 0x82
|
||||
lsls r1, 5
|
||||
movs r0, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
ldr r1, =gUnknown_082FF0E8
|
||||
movs r0, 0
|
||||
movs r2, 0x2
|
||||
bl bg_vram_setup
|
||||
bl InitBgsFromTemplates
|
||||
ldr r0, =gUnknown_082FF0F0
|
||||
bl bg_init_bg_config_2_from_bg_config_3
|
||||
bl InitBgFromTemplate
|
||||
movs r0, 0
|
||||
bl SetVBlankCallback
|
||||
movs r0, 0xC
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0xA
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x8
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x18
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x1A
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x14
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x16
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x10
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x12
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
add r0, sp, 0x4
|
||||
movs r4, 0
|
||||
strh r4, [r0]
|
||||
@ -3706,7 +3706,7 @@ new_game_prof_birch_speech_part2_start: ; 8031678
|
||||
bl gpu_pal_allocator_reset
|
||||
bl dp13_810BB8C
|
||||
adds r0, r5, 0
|
||||
bl sub_803192C
|
||||
bl AddBirchSpeechObjects
|
||||
ldr r0, =0x03005d90
|
||||
ldr r0, [r0]
|
||||
ldrb r0, [r0, 0x8]
|
||||
@ -3744,7 +3744,7 @@ new_game_prof_birch_speech_part2_start: ; 8031678
|
||||
strh r3, [r0, 0xC]
|
||||
ldr r1, =0x0000ffc4
|
||||
movs r0, 0x14
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
str r4, [sp]
|
||||
@ -3754,29 +3754,29 @@ new_game_prof_birch_speech_part2_start: ; 8031678
|
||||
bl pal_fade_maybe
|
||||
movs r0, 0x40
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x44
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x48
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x4A
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x50
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x52
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x54
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0
|
||||
bl gpu_sync_bg_show
|
||||
bl ShowBg
|
||||
movs r0, 0x1
|
||||
bl gpu_sync_bg_show
|
||||
bl ShowBg
|
||||
ldr r3, =0x04000208
|
||||
ldrh r2, [r3]
|
||||
strh r4, [r3]
|
||||
@ -3789,7 +3789,7 @@ new_game_prof_birch_speech_part2_start: ; 8031678
|
||||
ldr r0, =VBlankCB_MainMenu
|
||||
bl SetVBlankCallback
|
||||
ldr r0, =CB2_MainMenu
|
||||
bl set_callback2
|
||||
bl SetMainCallback2
|
||||
ldr r0, =gUnknown_082FF080
|
||||
bl InitWindows
|
||||
movs r0, 0
|
||||
@ -3861,8 +3861,9 @@ sub_80318F4: ; 80318F4
|
||||
.pool
|
||||
thumb_func_end sub_80318F4
|
||||
|
||||
thumb_func_start sub_803192C
|
||||
sub_803192C: ; 803192C
|
||||
thumb_func_start AddBirchSpeechObjects
|
||||
; void AddBirchSpeechObjects(u8 taskId)
|
||||
AddBirchSpeechObjects: ; 803192C
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
@ -3875,7 +3876,7 @@ sub_803192C: ; 803192C
|
||||
movs r0, 0x88
|
||||
movs r1, 0x3C
|
||||
movs r2, 0x1
|
||||
bl sub_80B5F44
|
||||
bl AddNewGameBirchObject
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r1, =0x02020630
|
||||
@ -3932,7 +3933,7 @@ sub_803192C: ; 803192C
|
||||
strb r1, [r2]
|
||||
strh r0, [r5, 0x1A]
|
||||
movs r0, 0x3C
|
||||
bl sub_806EFF0
|
||||
bl TrainerClassToTrainerPic
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r4, =0x0201c000
|
||||
@ -3962,7 +3963,7 @@ sub_803192C: ; 803192C
|
||||
strb r1, [r2, 0x5]
|
||||
strh r0, [r5, 0x1C]
|
||||
movs r0, 0x3F
|
||||
bl sub_806EFF0
|
||||
bl TrainerClassToTrainerPic
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r1, =0x0201c000
|
||||
@ -4002,10 +4003,10 @@ sub_803192C: ; 803192C
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_803192C
|
||||
thumb_func_end AddBirchSpeechObjects
|
||||
|
||||
thumb_func_start waterfall_4_check_if_can_continue
|
||||
waterfall_4_check_if_can_continue: ; 8031A5C
|
||||
thumb_func_start sub_8031A5C
|
||||
sub_8031A5C: ; 8031A5C
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
@ -4055,12 +4056,12 @@ waterfall_4_check_if_can_continue: ; 8031A5C
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
movs r0, 0x52
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
@08031AC4:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end waterfall_4_check_if_can_continue
|
||||
thumb_func_end sub_8031A5C
|
||||
|
||||
thumb_func_start sub_8031ACC
|
||||
sub_8031ACC: ; 8031ACC
|
||||
@ -4076,13 +4077,13 @@ sub_8031ACC: ; 8031ACC
|
||||
movs r1, 0x94
|
||||
lsls r1, 2
|
||||
movs r0, 0x50
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x52
|
||||
movs r1, 0x10
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x54
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
ldr r0, =0x03005e00
|
||||
mov r8, r0
|
||||
lsls r0, r4, 2
|
||||
@ -4091,7 +4092,7 @@ sub_8031ACC: ; 8031ACC
|
||||
add r0, r8
|
||||
movs r6, 0
|
||||
strh r6, [r0, 0x12]
|
||||
ldr r0, =waterfall_4_check_if_can_continue
|
||||
ldr r0, =sub_8031A5C
|
||||
movs r1, 0
|
||||
bl AddTask
|
||||
lsls r0, 24
|
||||
@ -4165,7 +4166,7 @@ sub_8031B3C: ; 8031B3C
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
movs r0, 0x52
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
@08031BA4:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
@ -4186,14 +4187,14 @@ sub_8031BAC: ; 8031BAC
|
||||
movs r1, 0x94
|
||||
lsls r1, 2
|
||||
movs r0, 0x50
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r1, 0x80
|
||||
lsls r1, 5
|
||||
movs r0, 0x52
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
movs r0, 0x54
|
||||
movs r1, 0
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
ldr r0, =0x03005e00
|
||||
mov r8, r0
|
||||
lsls r0, r4, 2
|
||||
@ -4512,10 +4513,10 @@ CreateMainMenuErrorWindow: ; 8031E18
|
||||
bl DrawMainMenuWindowFrame
|
||||
ldr r1, =0x000009e7
|
||||
movs r0, 0x40
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
ldr r1, =0x0000719f
|
||||
movs r0, 0x44
|
||||
bl lcd_io_set
|
||||
bl SetGpuReg
|
||||
add sp, 0xC
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
@ -4781,7 +4782,7 @@ LoadMainMenuWindowFrameTiles: ; 80320A4
|
||||
lsls r2, 1
|
||||
adds r0, r4, 0
|
||||
adds r3, r5, 0
|
||||
bl gpu_copy_bg_tile_pattern_data_to_vram
|
||||
bl LoadBgTiles
|
||||
ldr r0, [r6]
|
||||
ldrb r0, [r0, 0x14]
|
||||
lsrs r0, 3
|
||||
@ -4857,7 +4858,7 @@ DrawMainMenuWindowFrame: ; 80320EC
|
||||
movs r7, 0x2
|
||||
mov r8, r7
|
||||
str r7, [sp, 0x8]
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
ldrb r0, [r4]
|
||||
ldrb r2, [r4, 0x1]
|
||||
ldrb r3, [r4, 0x2]
|
||||
@ -4869,7 +4870,7 @@ DrawMainMenuWindowFrame: ; 80320EC
|
||||
str r5, [sp, 0x4]
|
||||
str r7, [sp, 0x8]
|
||||
mov r1, r9
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
ldrb r0, [r4]
|
||||
ldrb r2, [r4, 0x3]
|
||||
ldrb r1, [r4, 0x1]
|
||||
@ -4884,7 +4885,7 @@ DrawMainMenuWindowFrame: ; 80320EC
|
||||
str r5, [sp, 0x4]
|
||||
str r7, [sp, 0x8]
|
||||
mov r1, r10
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
ldrb r0, [r4]
|
||||
ldrb r2, [r4, 0x1]
|
||||
subs r2, 0x1
|
||||
@ -4896,7 +4897,7 @@ DrawMainMenuWindowFrame: ; 80320EC
|
||||
str r1, [sp, 0x4]
|
||||
str r7, [sp, 0x8]
|
||||
ldr r1, [sp, 0x18]
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
ldrb r0, [r4]
|
||||
ldrb r2, [r4, 0x3]
|
||||
ldrb r7, [r4, 0x1]
|
||||
@ -4910,7 +4911,7 @@ DrawMainMenuWindowFrame: ; 80320EC
|
||||
mov r1, r8
|
||||
str r1, [sp, 0x8]
|
||||
ldr r1, [sp, 0xC]
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
ldrb r0, [r4]
|
||||
ldrb r2, [r4, 0x1]
|
||||
subs r2, 0x1
|
||||
@ -4926,7 +4927,7 @@ DrawMainMenuWindowFrame: ; 80320EC
|
||||
mov r1, r8
|
||||
str r1, [sp, 0x8]
|
||||
ldr r1, [sp, 0x10]
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
ldrb r0, [r4]
|
||||
ldrb r2, [r4, 0x1]
|
||||
ldrb r3, [r4, 0x4]
|
||||
@ -4940,7 +4941,7 @@ DrawMainMenuWindowFrame: ; 80320EC
|
||||
mov r1, r8
|
||||
str r1, [sp, 0x8]
|
||||
ldr r1, [sp, 0x14]
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
ldrb r0, [r4]
|
||||
ldrb r2, [r4, 0x3]
|
||||
ldrb r7, [r4, 0x1]
|
||||
@ -4957,9 +4958,9 @@ DrawMainMenuWindowFrame: ; 80320EC
|
||||
mov r7, r8
|
||||
str r7, [sp, 0x8]
|
||||
adds r1, r6, 0
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
ldrb r0, [r4]
|
||||
bl gpu_copy_wram_bg_tilemap_to_vram
|
||||
bl CopyBgTileMapBufferToVram
|
||||
add sp, 0x1C
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
@ -4999,9 +5000,9 @@ sub_8032250: ; 8032250
|
||||
movs r1, 0x2
|
||||
str r1, [sp, 0x8]
|
||||
movs r1, 0
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
ldrb r0, [r6]
|
||||
bl gpu_copy_wram_bg_tilemap_to_vram
|
||||
bl CopyBgTileMapBufferToVram
|
||||
add sp, 0xC
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
@ -5040,7 +5041,7 @@ sub_8032298: ; 8032298
|
||||
movs r1, 0
|
||||
adds r2, r4, 0
|
||||
adds r3, r5, 0
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
add sp, 0xC
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
@ -5297,7 +5298,7 @@ sub_8032474: ; 8032474
|
||||
movs r1, 0xFD
|
||||
ldr r2, [sp, 0x14]
|
||||
adds r3, r5, 0
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
ldr r0, [sp, 0xC]
|
||||
subs r0, 0x1
|
||||
lsls r2, r0, 24
|
||||
@ -5309,7 +5310,7 @@ sub_8032474: ; 8032474
|
||||
mov r0, r8
|
||||
movs r1, 0xFF
|
||||
adds r3, r5, 0
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
movs r1, 0x80
|
||||
lsls r1, 1
|
||||
mov r0, r9
|
||||
@ -5319,7 +5320,7 @@ sub_8032474: ; 8032474
|
||||
mov r0, r8
|
||||
ldr r2, [sp, 0xC]
|
||||
adds r3, r5, 0
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
ldr r1, =0x00000101
|
||||
ldr r7, [sp, 0xC]
|
||||
add r7, r9
|
||||
@ -5332,7 +5333,7 @@ sub_8032474: ; 8032474
|
||||
str r6, [sp, 0x8]
|
||||
mov r0, r8
|
||||
adds r3, r5, 0
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
movs r1, 0x81
|
||||
lsls r1, 1
|
||||
lsls r2, r7, 24
|
||||
@ -5343,7 +5344,7 @@ sub_8032474: ; 8032474
|
||||
mov r0, r8
|
||||
adds r2, r7, 0
|
||||
adds r3, r5, 0
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
ldr r1, =0x00000103
|
||||
str r4, [sp]
|
||||
movs r5, 0x5
|
||||
@ -5352,7 +5353,7 @@ sub_8032474: ; 8032474
|
||||
mov r0, r8
|
||||
ldr r2, [sp, 0x14]
|
||||
mov r3, r10
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
ldr r1, =0x00000105
|
||||
mov r0, r9
|
||||
adds r0, 0x1
|
||||
@ -5364,7 +5365,7 @@ sub_8032474: ; 8032474
|
||||
mov r0, r8
|
||||
ldr r2, [sp, 0x18]
|
||||
mov r3, r10
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
movs r1, 0x83
|
||||
lsls r1, 1
|
||||
str r4, [sp]
|
||||
@ -5373,7 +5374,7 @@ sub_8032474: ; 8032474
|
||||
mov r0, r8
|
||||
adds r2, r7, 0
|
||||
mov r3, r10
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
ldr r1, =0x000008fd
|
||||
ldr r2, [sp, 0x10]
|
||||
add r10, r2
|
||||
@ -5387,7 +5388,7 @@ sub_8032474: ; 8032474
|
||||
mov r0, r8
|
||||
ldr r2, [sp, 0x14]
|
||||
mov r3, r10
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
ldr r1, =0x000008ff
|
||||
str r4, [sp]
|
||||
str r4, [sp, 0x4]
|
||||
@ -5395,7 +5396,7 @@ sub_8032474: ; 8032474
|
||||
mov r0, r8
|
||||
ldr r2, [sp, 0x18]
|
||||
mov r3, r10
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
movs r1, 0x90
|
||||
lsls r1, 4
|
||||
movs r2, 0x1
|
||||
@ -5410,7 +5411,7 @@ sub_8032474: ; 8032474
|
||||
mov r0, r8
|
||||
ldr r2, [sp, 0xC]
|
||||
mov r3, r10
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
ldr r1, =0x00000901
|
||||
str r4, [sp]
|
||||
str r4, [sp, 0x4]
|
||||
@ -5418,7 +5419,7 @@ sub_8032474: ; 8032474
|
||||
mov r0, r8
|
||||
ldr r2, [sp, 0x1C]
|
||||
mov r3, r10
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
ldr r1, =0x00000902
|
||||
str r4, [sp]
|
||||
str r4, [sp, 0x4]
|
||||
@ -5426,7 +5427,7 @@ sub_8032474: ; 8032474
|
||||
mov r0, r8
|
||||
adds r2, r7, 0
|
||||
mov r3, r10
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
add sp, 0x20
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
|
114
asm/malloc.s
114
asm/malloc.s
@ -1,6 +1,6 @@
|
||||
thumb_func_start malloc_header
|
||||
; void malloc_header(struct memblk *blk, struct memblk *prev, struct memblk *next, u32 size)
|
||||
malloc_header: ; 8000988
|
||||
thumb_func_start PutMemBlockHeader
|
||||
; void PutMemBlockHeader(struct MemBlock *block, struct MemBlock *prev, struct MemBlock *next, u32 size)
|
||||
PutMemBlockHeader: ; 8000988
|
||||
push {r4,lr}
|
||||
movs r4, 0
|
||||
strh r4, [r0]
|
||||
@ -13,24 +13,24 @@ malloc_header: ; 8000988
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end malloc_header
|
||||
thumb_func_end PutMemBlockHeader
|
||||
|
||||
thumb_func_start malloc_unlinked_header
|
||||
; void malloc_unlinked_header(struct memblk *blk, u32 size)
|
||||
malloc_unlinked_header: ; 80009A4
|
||||
thumb_func_start PutFirstMemBlockHeader
|
||||
; void PutFirstMemBlockHeader(struct MemBlock *block, u32 size)
|
||||
PutFirstMemBlockHeader: ; 80009A4
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
adds r3, r1, 0
|
||||
subs r3, 0x10
|
||||
adds r1, r2, 0
|
||||
bl malloc_header
|
||||
bl PutMemBlockHeader
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end malloc_unlinked_header
|
||||
thumb_func_end PutFirstMemBlockHeader
|
||||
|
||||
thumb_func_start malloc_core
|
||||
; void *malloc_core(struct memblk *head, u32 size)
|
||||
malloc_core: ; 80009B8
|
||||
thumb_func_start AllocInternal
|
||||
; void *AllocInternal(struct MemBlock *head, u32 size)
|
||||
AllocInternal: ; 80009B8
|
||||
push {r4-r6,lr}
|
||||
adds r4, r0, 0
|
||||
adds r6, r4, 0
|
||||
@ -66,7 +66,7 @@ malloc_core: ; 80009B8
|
||||
ldr r2, [r4, 0xC]
|
||||
adds r0, r5, 0
|
||||
adds r1, r4, 0
|
||||
bl malloc_header
|
||||
bl PutMemBlockHeader
|
||||
str r5, [r4, 0xC]
|
||||
ldr r0, [r5, 0xC]
|
||||
cmp r0, r6
|
||||
@ -88,11 +88,11 @@ malloc_core: ; 80009B8
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end malloc_core
|
||||
thumb_func_end AllocInternal
|
||||
|
||||
thumb_func_start free_core
|
||||
; void free_core(struct memblk *head, struct memblk *node)
|
||||
free_core: ; 8000A20
|
||||
thumb_func_start FreeInternal
|
||||
; void FreeInternal(struct MemBlock *head, struct MemBlock *node)
|
||||
FreeInternal: ; 8000A20
|
||||
push {r4,r5,lr}
|
||||
cmp r1, 0
|
||||
beq @08000A7C
|
||||
@ -145,15 +145,15 @@ free_core: ; 8000A20
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end free_core
|
||||
thumb_func_end FreeInternal
|
||||
|
||||
thumb_func_start malloc_core_and_clear
|
||||
; void *malloc_core_and_clear(struct memblk *head, unsigned int size)
|
||||
malloc_core_and_clear: ; 8000A84
|
||||
thumb_func_start AllocZeroedInternal
|
||||
; void *AllocZeroedInternal(struct MemBlock *head, u32 size)
|
||||
AllocZeroedInternal: ; 8000A84
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0x4
|
||||
adds r4, r1, 0
|
||||
bl malloc_core
|
||||
bl AllocInternal
|
||||
adds r5, r0, 0
|
||||
cmp r5, 0
|
||||
beq @08000AB8
|
||||
@ -181,11 +181,11 @@ malloc_core_and_clear: ; 8000A84
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end malloc_core_and_clear
|
||||
thumb_func_end AllocZeroedInternal
|
||||
|
||||
thumb_func_start check_memblk_core
|
||||
; _BOOL4 check_memblk_core(struct memblk *head, struct memblk *node)
|
||||
check_memblk_core: ; 8000AC4
|
||||
thumb_func_start CheckMemBlockInternal
|
||||
; BOOL CheckMemBlockInternal(struct MemBlock *head, struct MemBlock *node)
|
||||
CheckMemBlockInternal: ; 8000AC4
|
||||
push {r4,r5,lr}
|
||||
adds r5, r0, 0
|
||||
adds r3, r1, 0
|
||||
@ -233,77 +233,77 @@ check_memblk_core: ; 8000AC4
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end check_memblk_core
|
||||
thumb_func_end CheckMemBlockInternal
|
||||
|
||||
thumb_func_start init_malloc
|
||||
; void init_malloc(u32 heapStart, u32 heapSize)
|
||||
init_malloc: ; 8000B1C
|
||||
thumb_func_start InitHeap
|
||||
; void InitHeap(void *heapStart, u32 heapSize)
|
||||
InitHeap: ; 8000B1C
|
||||
push {lr}
|
||||
ldr r2, =0x03000004
|
||||
str r0, [r2]
|
||||
ldr r2, =0x03000008
|
||||
str r1, [r2]
|
||||
bl malloc_unlinked_header
|
||||
bl PutFirstMemBlockHeader
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end init_malloc
|
||||
thumb_func_end InitHeap
|
||||
|
||||
thumb_func_start malloc
|
||||
; void *malloc(u32 size)
|
||||
malloc: ; 8000B38
|
||||
thumb_func_start Alloc
|
||||
; void *Alloc(u32 size)
|
||||
Alloc: ; 8000B38
|
||||
push {lr}
|
||||
adds r1, r0, 0
|
||||
ldr r0, =0x03000004
|
||||
ldr r0, [r0]
|
||||
bl malloc_core
|
||||
bl AllocInternal
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end malloc
|
||||
thumb_func_end Alloc
|
||||
|
||||
thumb_func_start malloc_and_clear
|
||||
; void *malloc_and_clear(u32 size)
|
||||
malloc_and_clear: ; 8000B4C
|
||||
thumb_func_start AllocZeroed
|
||||
; void *AllocZeroed(u32 size)
|
||||
AllocZeroed: ; 8000B4C
|
||||
push {lr}
|
||||
adds r1, r0, 0
|
||||
ldr r0, =0x03000004
|
||||
ldr r0, [r0]
|
||||
bl malloc_core_and_clear
|
||||
bl AllocZeroedInternal
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end malloc_and_clear
|
||||
thumb_func_end AllocZeroed
|
||||
|
||||
thumb_func_start free
|
||||
; void free(void *ptr)
|
||||
free: ; 8000B60
|
||||
thumb_func_start Free
|
||||
; void Free(void *pointer)
|
||||
Free: ; 8000B60
|
||||
push {lr}
|
||||
adds r1, r0, 0
|
||||
ldr r0, =0x03000004
|
||||
ldr r0, [r0]
|
||||
bl free_core
|
||||
bl FreeInternal
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end free
|
||||
thumb_func_end Free
|
||||
|
||||
thumb_func_start check_memblk
|
||||
; _BOOL4 check_memblk(struct memblk *node)
|
||||
check_memblk: ; 8000B74
|
||||
thumb_func_start CheckMemBlock
|
||||
; BOOL CheckMemBlock(struct MemBlock *node)
|
||||
CheckMemBlock: ; 8000B74
|
||||
push {lr}
|
||||
adds r1, r0, 0
|
||||
ldr r0, =0x03000004
|
||||
ldr r0, [r0]
|
||||
bl check_memblk_core
|
||||
bl CheckMemBlockInternal
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end check_memblk
|
||||
thumb_func_end CheckMemBlock
|
||||
|
||||
thumb_func_start check_all_memblks
|
||||
; _BOOL4 check_all_memblks()
|
||||
check_all_memblks: ; 8000B88
|
||||
thumb_func_start CheckHeap
|
||||
; BOOL CheckHeap()
|
||||
CheckHeap: ; 8000B88
|
||||
push {r4,r5,lr}
|
||||
ldr r0, =0x03000004
|
||||
ldr r4, [r0]
|
||||
@ -312,7 +312,7 @@ check_all_memblks: ; 8000B88
|
||||
ldr r0, [r5]
|
||||
adds r1, r4, 0
|
||||
adds r1, 0x10
|
||||
bl check_memblk_core
|
||||
bl CheckMemBlockInternal
|
||||
cmp r0, 0
|
||||
beq @08000BB0
|
||||
ldr r4, [r4, 0xC]
|
||||
@ -328,4 +328,4 @@ check_all_memblks: ; 8000B88
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end check_all_memblks
|
||||
thumb_func_end CheckHeap
|
||||
|
@ -1,6 +1,6 @@
|
||||
thumb_func_start BlitSurface4BitWithoutColorKey
|
||||
; void BlitSurface4BitWithoutColorKey(struct Surface *src, struct Surface *dest, u16 srcX, u16 srcY, u16 destX, u16 destY, u16 width, u16 height)
|
||||
BlitSurface4BitWithoutColorKey: ; 8002BDC
|
||||
thumb_func_start BlitBitmapRect4BitWithoutColorKey
|
||||
; void BlitBitmapRect4BitWithoutColorKey(struct Bitmap *src, struct Bitmap *dest, u16 srcX, u16 srcY, u16 destX, u16 destY, u16 width, u16 height)
|
||||
BlitBitmapRect4BitWithoutColorKey: ; 8002BDC
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
@ -27,18 +27,18 @@ BlitSurface4BitWithoutColorKey: ; 8002BDC
|
||||
str r7, [sp, 0xC]
|
||||
movs r4, 0xFF
|
||||
str r4, [sp, 0x10]
|
||||
bl BlitSurface4Bit
|
||||
bl BlitBitmapRect4Bit
|
||||
add sp, 0x14
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end BlitSurface4BitWithoutColorKey
|
||||
thumb_func_end BlitBitmapRect4BitWithoutColorKey
|
||||
|
||||
thumb_func_start BlitSurface4Bit
|
||||
; void BlitSurface4Bit(struct Surface *src, struct Surface *dest, u16 srcX, u16 srcY, u16 destX, u16 destY, u16 width, u16 height, u8 colorKey)
|
||||
BlitSurface4Bit: ; 8002C20
|
||||
thumb_func_start BlitBitmapRect4Bit
|
||||
; void BlitBitmapRect4Bit(struct Bitmap *src, struct Bitmap *dest, u16 srcX, u16 srcY, u16 destX, u16 destY, u16 width, u16 height, u8 colorKey)
|
||||
BlitBitmapRect4Bit: ; 8002C20
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
@ -289,11 +289,11 @@ BlitSurface4Bit: ; 8002C20
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end BlitSurface4Bit
|
||||
thumb_func_end BlitBitmapRect4Bit
|
||||
|
||||
thumb_func_start FillSurfaceRect4Bit
|
||||
; void FillSurfaceRect4Bit(struct Surface *surface, u16 x, u16 y, u16 width, u16 height, u8 fillValue)
|
||||
FillSurfaceRect4Bit: ; 8002E00
|
||||
thumb_func_start FillBitmapRect4Bit
|
||||
; void FillBitmapRect4Bit(struct Bitmap *surface, u16 x, u16 y, u16 width, u16 height, u8 fillValue)
|
||||
FillBitmapRect4Bit: ; 8002E00
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
@ -401,11 +401,11 @@ FillSurfaceRect4Bit: ; 8002E00
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end FillSurfaceRect4Bit
|
||||
thumb_func_end FillBitmapRect4Bit
|
||||
|
||||
thumb_func_start BlitSurface4BitTo8Bit
|
||||
; void BlitSurface4BitTo8Bit(struct Surface *src, struct Surface *dest, u16 srcX, u16 srcY, u16 destX, u16 destY, u16 width, u16 height, u8 colorKey, u8 paletteOffset)
|
||||
BlitSurface4BitTo8Bit: ; 8002EC8
|
||||
thumb_func_start BlitBitmapRect4BitTo8Bit
|
||||
; void BlitBitmapRect4BitTo8Bit(struct Bitmap *src, struct Bitmap *dest, u16 srcX, u16 srcY, u16 destX, u16 destY, u16 width, u16 height, u8 colorKey, u8 paletteOffset)
|
||||
BlitBitmapRect4BitTo8Bit: ; 8002EC8
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
@ -718,11 +718,11 @@ BlitSurface4BitTo8Bit: ; 8002EC8
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end BlitSurface4BitTo8Bit
|
||||
thumb_func_end BlitBitmapRect4BitTo8Bit
|
||||
|
||||
thumb_func_start FillSurfaceRect8Bit
|
||||
; void FillSurfaceRect8Bit(struct Surface *surface, u16 x, u16 y, u16 width, u16 height, u8 fillValue)
|
||||
FillSurfaceRect8Bit: ; 8003118
|
||||
thumb_func_start FillBitmapRect8Bit
|
||||
; void FillBitmapRect8Bit(struct Bitmap *surface, u16 x, u16 y, u16 width, u16 height, u8 fillValue)
|
||||
FillBitmapRect8Bit: ; 8003118
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
@ -811,4 +811,4 @@ FillSurfaceRect8Bit: ; 8003118
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end FillSurfaceRect8Bit
|
||||
thumb_func_end FillBitmapRect8Bit
|
||||
|
@ -1789,7 +1789,7 @@ ClearTextSpan: ; 80052C8
|
||||
lsrs r0, 24
|
||||
str r0, [sp, 0x4]
|
||||
add r0, sp, 0x8
|
||||
bl FillSurfaceRect4Bit
|
||||
bl FillBitmapRect4Bit
|
||||
@0800531E:
|
||||
add sp, 0x10
|
||||
pop {r4-r6}
|
||||
@ -2158,7 +2158,7 @@ TextPrinterDrawDownArrow: ; 8005528
|
||||
str r2, [sp, 0x14]
|
||||
adds r1, r7, 0
|
||||
movs r2, 0
|
||||
bl BlitSurfaceRectToWindow
|
||||
bl BlitBitmapRectToWindow
|
||||
ldrb r0, [r5, 0x4]
|
||||
movs r1, 0x2
|
||||
bl CopyWindowToVram
|
||||
@ -2396,7 +2396,7 @@ DrawDownArrow: ; 80056E0
|
||||
adds r0, r5, 0
|
||||
adds r1, r6, 0
|
||||
movs r2, 0
|
||||
bl BlitSurfaceRectToWindow
|
||||
bl BlitBitmapRectToWindow
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x2
|
||||
bl CopyWindowToVram
|
||||
@ -3849,7 +3849,7 @@ DrawKeypadIcon: ; 80062E8
|
||||
adds r1, r5, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl BlitSurfaceRectToWindow
|
||||
bl BlitBitmapRectToWindow
|
||||
adds r0, r4, 0
|
||||
add sp, 0x18
|
||||
pop {r4,r5}
|
||||
|
138
asm/window.s
138
asm/window.s
@ -20,7 +20,7 @@ InitWindows: ; 80031C0
|
||||
mov r1, r8
|
||||
lsls r0, r1, 24
|
||||
lsrs r0, 24
|
||||
bl bg_get_tilemap
|
||||
bl GetBgTileMap
|
||||
cmp r0, 0
|
||||
beq @080031E4
|
||||
ldr r0, =nullsub_8
|
||||
@ -74,7 +74,7 @@ InitWindows: ; 80031C0
|
||||
adds r0, r7, 0
|
||||
movs r1, 0
|
||||
movs r3, 0
|
||||
bl do_nothing
|
||||
bl DummiedOutFireRedLeafGreenTileAllocFunc
|
||||
str r0, [sp]
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
@ -97,14 +97,14 @@ InitWindows: ; 80031C0
|
||||
bne @080032CA
|
||||
adds r0, r7, 0
|
||||
movs r1, 0x8
|
||||
bl bg_get_field
|
||||
bl GetBgAttribute
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
ldr r0, =0x0000ffff
|
||||
cmp r5, r0
|
||||
beq @080032CA
|
||||
adds r0, r5, 0
|
||||
bl malloc_and_clear
|
||||
bl AllocZeroed
|
||||
adds r4, r0, 0
|
||||
cmp r4, 0
|
||||
bne @080032A8
|
||||
@ -129,14 +129,14 @@ InitWindows: ; 80031C0
|
||||
str r4, [r0]
|
||||
adds r0, r7, 0
|
||||
adds r1, r4, 0
|
||||
bl bg_set_tilemap
|
||||
bl SetBgTileMap
|
||||
@080032CA:
|
||||
ldrb r1, [r6, 0x3]
|
||||
ldrb r0, [r6, 0x4]
|
||||
muls r0, r1
|
||||
lsls r0, 21
|
||||
lsrs r0, 16
|
||||
bl malloc_and_clear
|
||||
bl AllocZeroed
|
||||
adds r4, r0, 0
|
||||
cmp r4, 0
|
||||
bne @0800330C
|
||||
@ -153,7 +153,7 @@ InitWindows: ; 80031C0
|
||||
cmp r1, r0
|
||||
beq @08003250
|
||||
adds r0, r1, 0
|
||||
bl free
|
||||
bl Free
|
||||
str r4, [r5]
|
||||
b @08003250
|
||||
.pool
|
||||
@ -183,7 +183,7 @@ InitWindows: ; 80031C0
|
||||
adds r0, r7, 0
|
||||
ldr r1, [sp]
|
||||
movs r3, 0x1
|
||||
bl do_nothing
|
||||
bl DummiedOutFireRedLeafGreenTileAllocFunc
|
||||
@08003342:
|
||||
adds r6, 0x8
|
||||
ldr r0, [sp, 0x4]
|
||||
@ -262,7 +262,7 @@ AddWindow: ; 8003380
|
||||
adds r0, r7, 0
|
||||
movs r1, 0
|
||||
movs r3, 0
|
||||
bl do_nothing
|
||||
bl DummiedOutFireRedLeafGreenTileAllocFunc
|
||||
mov r9, r0
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
@ -279,14 +279,14 @@ AddWindow: ; 8003380
|
||||
bne @08003432
|
||||
adds r0, r7, 0
|
||||
movs r1, 0x8
|
||||
bl bg_get_field
|
||||
bl GetBgAttribute
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
ldr r0, =0x0000ffff
|
||||
cmp r5, r0
|
||||
beq @08003432
|
||||
adds r0, r5, 0
|
||||
bl malloc_and_clear
|
||||
bl AllocZeroed
|
||||
adds r4, r0, 0
|
||||
cmp r4, 0
|
||||
beq @0800346A
|
||||
@ -307,7 +307,7 @@ AddWindow: ; 8003380
|
||||
str r4, [r0]
|
||||
adds r0, r7, 0
|
||||
adds r1, r4, 0
|
||||
bl bg_set_tilemap
|
||||
bl SetBgTileMap
|
||||
@08003432:
|
||||
mov r2, r8
|
||||
ldrb r1, [r2, 0x3]
|
||||
@ -315,7 +315,7 @@ AddWindow: ; 8003380
|
||||
muls r0, r1
|
||||
lsls r0, 21
|
||||
lsrs r0, 16
|
||||
bl malloc_and_clear
|
||||
bl AllocZeroed
|
||||
adds r4, r0, 0
|
||||
cmp r4, 0
|
||||
bne @08003484
|
||||
@ -332,7 +332,7 @@ AddWindow: ; 8003380
|
||||
cmp r1, r0
|
||||
beq @0800346A
|
||||
adds r0, r1, 0
|
||||
bl free
|
||||
bl Free
|
||||
str r4, [r5]
|
||||
@0800346A:
|
||||
movs r0, 0xFF
|
||||
@ -366,7 +366,7 @@ AddWindow: ; 8003380
|
||||
adds r0, r7, 0
|
||||
mov r1, r9
|
||||
movs r3, 0x1
|
||||
bl do_nothing
|
||||
bl DummiedOutFireRedLeafGreenTileAllocFunc
|
||||
@080034BE:
|
||||
adds r0, r6, 0
|
||||
@080034C0:
|
||||
@ -419,7 +419,7 @@ AddWindowWithoutTileMap: ; 80034D8
|
||||
muls r2, r0
|
||||
adds r0, r6, 0
|
||||
movs r1, 0
|
||||
bl do_nothing
|
||||
bl DummiedOutFireRedLeafGreenTileAllocFunc
|
||||
adds r3, r0, 0
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
@ -451,7 +451,7 @@ AddWindowWithoutTileMap: ; 80034D8
|
||||
adds r0, r6, 0
|
||||
adds r1, r3, 0
|
||||
movs r3, 0x1
|
||||
bl do_nothing
|
||||
bl DummiedOutFireRedLeafGreenTileAllocFunc
|
||||
@08003562:
|
||||
adds r0, r4, 0
|
||||
@08003564:
|
||||
@ -484,7 +484,7 @@ RemoveWindow: ; 8003574
|
||||
muls r2, r0
|
||||
adds r0, r3, 0
|
||||
movs r3, 0x2
|
||||
bl do_nothing
|
||||
bl DummiedOutFireRedLeafGreenTileAllocFunc
|
||||
@080035A0:
|
||||
ldr r0, =gDummyWindowTemplate
|
||||
ldr r1, [r0, 0x4]
|
||||
@ -505,7 +505,7 @@ RemoveWindow: ; 8003574
|
||||
cmp r1, r0
|
||||
beq @080035CE
|
||||
adds r0, r1, 0
|
||||
bl free
|
||||
bl Free
|
||||
str r5, [r4]
|
||||
@080035CE:
|
||||
ldr r1, =0x02020004
|
||||
@ -517,7 +517,7 @@ RemoveWindow: ; 8003574
|
||||
ldr r0, [r4]
|
||||
cmp r0, 0
|
||||
beq @080035E8
|
||||
bl free
|
||||
bl Free
|
||||
movs r0, 0
|
||||
str r0, [r4]
|
||||
@080035E8:
|
||||
@ -541,7 +541,7 @@ FreeAllWindowBuffers: ; 8003604
|
||||
cmp r1, r0
|
||||
beq @08003620
|
||||
adds r0, r1, 0
|
||||
bl free
|
||||
bl Free
|
||||
movs r0, 0
|
||||
str r0, [r4]
|
||||
@08003620:
|
||||
@ -558,7 +558,7 @@ FreeAllWindowBuffers: ; 8003604
|
||||
ldr r0, [r4]
|
||||
cmp r0, 0
|
||||
beq @0800363E
|
||||
bl free
|
||||
bl Free
|
||||
str r6, [r4]
|
||||
@0800363E:
|
||||
adds r4, 0xC
|
||||
@ -610,7 +610,7 @@ CopyWindowToVram: ; 8003658
|
||||
@0800369A:
|
||||
mov r0, sp
|
||||
ldrb r0, [r0]
|
||||
bl gpu_copy_wram_bg_tilemap_to_vram
|
||||
bl CopyBgTileMapBufferToVram
|
||||
b @080036CE
|
||||
@080036A4:
|
||||
mov r0, sp
|
||||
@ -619,7 +619,7 @@ CopyWindowToVram: ; 8003658
|
||||
mov r2, sp
|
||||
ldrh r3, [r2, 0x6]
|
||||
adds r2, r4, 0
|
||||
bl gpu_copy_bg_tile_pattern_data_to_vram
|
||||
bl LoadBgTiles
|
||||
b @080036CE
|
||||
@080036B6:
|
||||
mov r0, sp
|
||||
@ -628,10 +628,10 @@ CopyWindowToVram: ; 8003658
|
||||
mov r2, sp
|
||||
ldrh r3, [r2, 0x6]
|
||||
adds r2, r4, 0
|
||||
bl gpu_copy_bg_tile_pattern_data_to_vram
|
||||
bl LoadBgTiles
|
||||
mov r0, sp
|
||||
ldrb r0, [r0]
|
||||
bl gpu_copy_wram_bg_tilemap_to_vram
|
||||
bl CopyBgTileMapBufferToVram
|
||||
@080036CE:
|
||||
add sp, 0xC
|
||||
pop {r4-r6}
|
||||
@ -692,7 +692,7 @@ CopyWindowRectToVram: ; 80036D8
|
||||
@08003736:
|
||||
mov r0, sp
|
||||
ldrb r0, [r0]
|
||||
bl gpu_copy_wram_bg_tilemap_to_vram
|
||||
bl CopyBgTileMapBufferToVram
|
||||
b @08003782
|
||||
@08003740:
|
||||
mov r0, sp
|
||||
@ -707,7 +707,7 @@ CopyWindowRectToVram: ; 80036D8
|
||||
adds r3, r4
|
||||
lsls r3, 16
|
||||
lsrs r3, 16
|
||||
bl gpu_copy_bg_tile_pattern_data_to_vram
|
||||
bl LoadBgTiles
|
||||
b @08003782
|
||||
@0800375E:
|
||||
mov r0, sp
|
||||
@ -722,10 +722,10 @@ CopyWindowRectToVram: ; 80036D8
|
||||
adds r3, r4
|
||||
lsls r3, 16
|
||||
lsrs r3, 16
|
||||
bl gpu_copy_bg_tile_pattern_data_to_vram
|
||||
bl LoadBgTiles
|
||||
mov r0, sp
|
||||
ldrb r0, [r0]
|
||||
bl gpu_copy_wram_bg_tilemap_to_vram
|
||||
bl CopyBgTileMapBufferToVram
|
||||
@08003782:
|
||||
add sp, 0xC
|
||||
pop {r4-r7}
|
||||
@ -751,7 +751,7 @@ PutWindowTileMap: ; 800378C
|
||||
add r0, sp, 0x10
|
||||
ldrb r0, [r0]
|
||||
movs r1, 0xA
|
||||
bl bg_get_field
|
||||
bl GetBgAttribute
|
||||
adds r1, r0, 0
|
||||
add r0, sp, 0x10
|
||||
ldrh r0, [r0, 0x6]
|
||||
@ -775,7 +775,7 @@ PutWindowTileMap: ; 800378C
|
||||
str r4, [sp, 0x8]
|
||||
movs r4, 0x1
|
||||
str r4, [sp, 0xC]
|
||||
bl bg_write_sequence_to_wram_tile_map_rect
|
||||
bl WriteSequenceToBgTileMapBuffer
|
||||
add sp, 0x1C
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
@ -784,7 +784,7 @@ PutWindowTileMap: ; 800378C
|
||||
thumb_func_end PutWindowTileMap
|
||||
|
||||
thumb_func_start PutWindowRectTileMapOverridePalette
|
||||
; void PutWindowRectTileMapOverridePalette(u8 windowId, u8 x, u8 y, u8 width, u8 height, u8 paletteSlot)
|
||||
; void PutWindowRectTileMapOverridePalette(u8 windowId, u8 x, u8 y, u8 width, u8 height, u8 palette)
|
||||
PutWindowRectTileMapOverridePalette: ; 80037EC
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
@ -822,7 +822,7 @@ PutWindowRectTileMapOverridePalette: ; 80037EC
|
||||
add r0, sp, 0x10
|
||||
ldrb r0, [r0]
|
||||
movs r1, 0xA
|
||||
bl bg_get_field
|
||||
bl GetBgAttribute
|
||||
add r2, sp, 0x10
|
||||
adds r1, r2, 0
|
||||
ldrb r1, [r1, 0x3]
|
||||
@ -858,7 +858,7 @@ PutWindowRectTileMapOverridePalette: ; 80037EC
|
||||
str r1, [sp, 0x8]
|
||||
str r7, [sp, 0xC]
|
||||
adds r1, r6, 0
|
||||
bl bg_write_sequence_to_wram_tile_map_rect
|
||||
bl WriteSequenceToBgTileMapBuffer
|
||||
ldrb r0, [r4, 0x3]
|
||||
adds r0, r6, r0
|
||||
lsls r0, 16
|
||||
@ -910,7 +910,7 @@ ClearWindowTileMap: ; 80038A4
|
||||
add r4, sp, 0xC
|
||||
ldrb r4, [r4, 0x5]
|
||||
str r4, [sp, 0x8]
|
||||
bl Bg_FillWramTileMapRectWithTileAndPalette
|
||||
bl FillBgTileMapBufferRect
|
||||
add sp, 0x18
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
@ -953,7 +953,7 @@ PutWindowRectTileMap: ; 80038F4
|
||||
add r0, sp, 0x10
|
||||
ldrb r0, [r0]
|
||||
movs r1, 0xA
|
||||
bl bg_get_field
|
||||
bl GetBgAttribute
|
||||
add r2, sp, 0x10
|
||||
adds r1, r2, 0
|
||||
ldrb r1, [r1, 0x3]
|
||||
@ -989,7 +989,7 @@ PutWindowRectTileMap: ; 80038F4
|
||||
str r1, [sp, 0x8]
|
||||
str r7, [sp, 0xC]
|
||||
adds r1, r6, 0
|
||||
bl bg_write_sequence_to_wram_tile_map_rect
|
||||
bl WriteSequenceToBgTileMapBuffer
|
||||
ldrb r0, [r4, 0x3]
|
||||
adds r0, r6, r0
|
||||
lsls r0, 16
|
||||
@ -1009,9 +1009,9 @@ PutWindowRectTileMap: ; 80038F4
|
||||
.pool
|
||||
thumb_func_end PutWindowRectTileMap
|
||||
|
||||
thumb_func_start BlitSurfaceToWindow
|
||||
; void BlitSurfaceToWindow(u8 windowId, u8 *pixels, u16 x, u16 y, u16 width, u16 height)
|
||||
BlitSurfaceToWindow: ; 80039A4
|
||||
thumb_func_start BlitBitmapToWindow
|
||||
; void BlitBitmapToWindow(u8 windowId, u8 *pixels, u16 x, u16 y, u16 width, u16 height)
|
||||
BlitBitmapToWindow: ; 80039A4
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0x18
|
||||
ldr r4, [sp, 0x24]
|
||||
@ -1034,16 +1034,16 @@ BlitSurfaceToWindow: ; 80039A4
|
||||
str r5, [sp, 0x14]
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl BlitSurfaceRectToWindow
|
||||
bl BlitBitmapRectToWindow
|
||||
add sp, 0x18
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end BlitSurfaceToWindow
|
||||
thumb_func_end BlitBitmapToWindow
|
||||
|
||||
thumb_func_start BlitSurfaceRectToWindow
|
||||
; void BlitSurfaceRectToWindow(u8 rbox_id, u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight)
|
||||
BlitSurfaceRectToWindow: ; 80039DC
|
||||
thumb_func_start BlitBitmapRectToWindow
|
||||
; void BlitBitmapRectToWindow(u8 rbox_id, u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight)
|
||||
BlitBitmapRectToWindow: ; 80039DC
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
@ -1123,7 +1123,7 @@ BlitSurfaceRectToWindow: ; 80039DC
|
||||
movs r0, 0
|
||||
str r0, [sp, 0x10]
|
||||
add r0, sp, 0x14
|
||||
bl BlitSurface4Bit
|
||||
bl BlitBitmapRect4Bit
|
||||
add sp, 0x24
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
@ -1133,11 +1133,11 @@ BlitSurfaceRectToWindow: ; 80039DC
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end BlitSurfaceRectToWindow
|
||||
thumb_func_end BlitBitmapRectToWindow
|
||||
|
||||
thumb_func_start BlitSurfaceRectToWindowWithColorKey
|
||||
; void BlitSurfaceRectToWindowWithColorKey(u8 rbox_id, u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 colorKey)
|
||||
BlitSurfaceRectToWindowWithColorKey: ; 8003A9C
|
||||
thumb_func_start BlitBitmapRectToWindowWithColorKey
|
||||
; void BlitBitmapRectToWindowWithColorKey(u8 rbox_id, u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 colorKey)
|
||||
BlitBitmapRectToWindowWithColorKey: ; 8003A9C
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
@ -1221,7 +1221,7 @@ BlitSurfaceRectToWindowWithColorKey: ; 8003A9C
|
||||
ldr r6, [sp, 0x24]
|
||||
str r6, [sp, 0x10]
|
||||
add r0, sp, 0x14
|
||||
bl BlitSurface4Bit
|
||||
bl BlitBitmapRect4Bit
|
||||
add sp, 0x28
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
@ -1231,7 +1231,7 @@ BlitSurfaceRectToWindowWithColorKey: ; 8003A9C
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end BlitSurfaceRectToWindowWithColorKey
|
||||
thumb_func_end BlitBitmapRectToWindowWithColorKey
|
||||
|
||||
thumb_func_start FillWindowPixelRect
|
||||
; void FillWindowPixelRect(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height)
|
||||
@ -1290,7 +1290,7 @@ FillWindowPixelRect: ; 8003B64
|
||||
add r0, sp, 0x8
|
||||
adds r1, r2, 0
|
||||
mov r2, r9
|
||||
bl FillSurfaceRect4Bit
|
||||
bl FillBitmapRect4Bit
|
||||
add sp, 0x10
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
@ -2218,14 +2218,14 @@ AddWindow8Bit: ; 8004260
|
||||
bne @080042EA
|
||||
adds r0, r7, 0
|
||||
movs r1, 0x8
|
||||
bl bg_get_field
|
||||
bl GetBgAttribute
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
ldr r0, =0x0000ffff
|
||||
cmp r5, r0
|
||||
beq @080042EA
|
||||
adds r0, r5, 0
|
||||
bl malloc
|
||||
bl Alloc
|
||||
adds r4, r0, 0
|
||||
cmp r4, 0
|
||||
beq @08004322
|
||||
@ -2247,7 +2247,7 @@ AddWindow8Bit: ; 8004260
|
||||
str r4, [r0]
|
||||
adds r0, r7, 0
|
||||
adds r1, r4, 0
|
||||
bl bg_set_tilemap
|
||||
bl SetBgTileMap
|
||||
@080042EA:
|
||||
mov r2, r9
|
||||
ldrb r1, [r2, 0x3]
|
||||
@ -2255,7 +2255,7 @@ AddWindow8Bit: ; 8004260
|
||||
muls r0, r1
|
||||
lsls r0, 22
|
||||
lsrs r0, 16
|
||||
bl malloc
|
||||
bl Alloc
|
||||
adds r4, r0, 0
|
||||
cmp r4, 0
|
||||
bne @08004338
|
||||
@ -2272,7 +2272,7 @@ AddWindow8Bit: ; 8004260
|
||||
cmp r1, r0
|
||||
beq @08004322
|
||||
adds r0, r1, 0
|
||||
bl free
|
||||
bl Free
|
||||
str r4, [r5]
|
||||
@08004322:
|
||||
movs r0, 0xFF
|
||||
@ -2400,7 +2400,7 @@ FillWindowPixelRect8Bit: ; 80043A8
|
||||
add r0, sp, 0x8
|
||||
adds r1, r2, 0
|
||||
mov r2, r9
|
||||
bl FillSurfaceRect8Bit
|
||||
bl FillBitmapRect8Bit
|
||||
add sp, 0x10
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
@ -2411,9 +2411,9 @@ FillWindowPixelRect8Bit: ; 80043A8
|
||||
.pool
|
||||
thumb_func_end FillWindowPixelRect8Bit
|
||||
|
||||
thumb_func_start BlitSurfaceRectToWindow4BitTo8Bit
|
||||
; void BlitSurfaceRectToWindow4BitTo8Bit(u8 rbox_id, u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 paletteOffset)
|
||||
BlitSurfaceRectToWindow4BitTo8Bit: ; 8004434
|
||||
thumb_func_start BlitBitmapRectToWindow4BitTo8Bit
|
||||
; void BlitBitmapRectToWindow4BitTo8Bit(u8 rbox_id, u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 paletteOffset)
|
||||
BlitBitmapRectToWindow4BitTo8Bit: ; 8004434
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
@ -2499,7 +2499,7 @@ BlitSurfaceRectToWindow4BitTo8Bit: ; 8004434
|
||||
ldr r6, [sp, 0x28]
|
||||
str r6, [sp, 0x14]
|
||||
add r0, sp, 0x18
|
||||
bl BlitSurface4BitTo8Bit
|
||||
bl BlitBitmapRect4BitTo8Bit
|
||||
add sp, 0x2C
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
@ -2509,7 +2509,7 @@ BlitSurfaceRectToWindow4BitTo8Bit: ; 8004434
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end BlitSurfaceRectToWindow4BitTo8Bit
|
||||
thumb_func_end BlitBitmapRectToWindow4BitTo8Bit
|
||||
|
||||
thumb_func_start CopyWindowToVram8Bit
|
||||
; void CopyWindowToVram8Bit(u8 windowId, u8 mode)
|
||||
@ -2547,24 +2547,24 @@ CopyWindowToVram8Bit: ; 8004500
|
||||
b @08004570
|
||||
@08004546:
|
||||
ldrb r0, [r3]
|
||||
bl gpu_copy_wram_bg_tilemap_to_vram
|
||||
bl CopyBgTileMapBufferToVram
|
||||
b @08004570
|
||||
@0800454E:
|
||||
ldrb r0, [r3]
|
||||
ldr r1, [r3, 0x8]
|
||||
ldrh r2, [r4]
|
||||
ldrh r3, [r3, 0x6]
|
||||
bl gpu_copy_bg_tile_pattern_data_to_vram
|
||||
bl LoadBgTiles
|
||||
b @08004570
|
||||
@0800455C:
|
||||
ldrb r0, [r3]
|
||||
ldr r1, [r3, 0x8]
|
||||
ldrh r2, [r4]
|
||||
ldrh r3, [r3, 0x6]
|
||||
bl gpu_copy_bg_tile_pattern_data_to_vram
|
||||
bl LoadBgTiles
|
||||
ldr r0, [r6]
|
||||
ldrb r0, [r0]
|
||||
bl gpu_copy_wram_bg_tilemap_to_vram
|
||||
bl CopyBgTileMapBufferToVram
|
||||
@08004570:
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
|
28
data/data2.s
28
data/data2.s
@ -16,20 +16,20 @@ gUnknown_82E9531: ; 82E9531
|
||||
.align 2, 0
|
||||
|
||||
gRomInterruptTable: ; 82E9548
|
||||
.4byte irq_vcount+1
|
||||
.4byte irq_serial+1
|
||||
.4byte irq_timer3+1
|
||||
.4byte irq_hblank+1
|
||||
.4byte irq_vblank+1
|
||||
.4byte irq_other+1
|
||||
.4byte irq_other+1
|
||||
.4byte irq_other+1
|
||||
.4byte irq_other+1
|
||||
.4byte irq_other+1
|
||||
.4byte irq_other+1
|
||||
.4byte irq_other+1
|
||||
.4byte irq_other+1
|
||||
.4byte irq_other+1
|
||||
.4byte VCountIntr
|
||||
.4byte SerialIntr
|
||||
.4byte Timer3Intr
|
||||
.4byte HBlankIntr
|
||||
.4byte VBlankIntr
|
||||
.4byte DummyIntrHandler
|
||||
.4byte DummyIntrHandler
|
||||
.4byte DummyIntrHandler
|
||||
.4byte DummyIntrHandler
|
||||
.4byte DummyIntrHandler
|
||||
.4byte DummyIntrHandler
|
||||
.4byte DummyIntrHandler
|
||||
.4byte DummyIntrHandler
|
||||
.4byte DummyIntrHandler
|
||||
|
||||
gBgConfigZeroValue: ; 82E9580
|
||||
.4byte 0
|
||||
|
Loading…
Reference in New Issue
Block a user