mirror of
https://github.com/pret/pmd-red.git
synced 2025-02-25 23:55:41 +00:00

This decision was made to reduce the complexity of using .include whilst juggling with tools/scaninc and tools/preproc: - tools/scaninc doesn't apply the proper search rules for .include (it assumes #include behavior). In particular, it doesn't consider paths starting from $PWD, and doesn't scan the included files as a result. - .include had to be processed before #include by preproc in many cases, as code was being included that had to be preprocessed by CPP (think of #define). This contradicts standard GCC behavior. To make include paths consistent across the asm/ data/ and src/ directories, the following files were moved: - constants/ → include/asm/constants/ - asm/macros/ → include/asm/macros/ - asm/macros.inc → include/asm/macros.inc - include/macros/m4a.inc → include/asm/macros/m4a.inc As part of the necessary changes for this to work, the scaninc method in the makefile was improved to generate .d files that don't choke when files are missing.
77 lines
1.2 KiB
ArmAsm
77 lines
1.2 KiB
ArmAsm
#include "asm/constants/gba_constants.inc"
|
|
#include "asm/macros.inc"
|
|
|
|
.syntax unified
|
|
|
|
.text
|
|
|
|
thumb_func_start sub_8038440
|
|
sub_8038440:
|
|
push {r4,r5,lr}
|
|
movs r5, 0
|
|
ldr r0, _080384B0
|
|
ldr r0, [r0]
|
|
mov r12, r0
|
|
movs r3, 0xD4
|
|
lsls r3, 1
|
|
add r3, r12
|
|
ldrh r1, [r3]
|
|
ldr r0, _080384B4
|
|
ands r0, r1
|
|
ldr r1, _080384B8
|
|
ands r0, r1
|
|
ldr r4, _080384BC
|
|
ands r0, r4
|
|
ldr r1, _080384C0
|
|
ands r0, r1
|
|
ldr r1, _080384C4
|
|
ands r0, r1
|
|
movs r2, 0x80
|
|
lsls r2, 7
|
|
ldr r1, _080384C8
|
|
ands r0, r1
|
|
orrs r0, r2
|
|
strh r0, [r3]
|
|
movs r2, 0xFC
|
|
lsls r2, 2
|
|
ldrh r1, [r3, 0x4]
|
|
movs r0, 0xFC
|
|
lsls r0, 8
|
|
ands r0, r1
|
|
orrs r0, r2
|
|
ands r0, r4
|
|
movs r2, 0xF
|
|
movs r4, 0xF0
|
|
lsls r4, 8
|
|
ldr r1, _080384CC
|
|
ands r0, r1
|
|
orrs r0, r4
|
|
strh r0, [r3, 0x4]
|
|
movs r0, 0x70
|
|
strh r0, [r3, 0x2]
|
|
movs r1, 0xE0
|
|
lsls r1, 3
|
|
ldrh r0, [r3, 0x6]
|
|
ands r2, r0
|
|
orrs r2, r1
|
|
strh r2, [r3, 0x6]
|
|
movs r0, 0xD8
|
|
lsls r0, 1
|
|
add r0, r12
|
|
str r5, [r0]
|
|
pop {r4,r5}
|
|
pop {r0}
|
|
bx r0
|
|
.align 2, 0
|
|
_080384B0: .4byte gUnknown_203B360
|
|
_080384B4: .4byte 0x0000feff
|
|
_080384B8: .4byte 0x0000fdff
|
|
_080384BC: .4byte 0x0000f3ff
|
|
_080384C0: .4byte 0x0000efff
|
|
_080384C4: .4byte 0x0000dfff
|
|
_080384C8: .4byte 0x00003fff
|
|
_080384CC: .4byte 0x00000fff
|
|
thumb_func_end sub_8038440
|
|
|
|
.align 2,0
|