mirror of
https://github.com/pret/pmd-red.git
synced 2026-04-24 23:17:03 -05:00
Match sub_803DF60 and sub_803E02C
This commit is contained in:
parent
13854d268f
commit
fd127911d0
|
|
@ -2,121 +2,6 @@
|
|||
.section .rodata
|
||||
#.incbin "baserom.gba", 0xF59C4, 0x4
|
||||
|
||||
|
||||
|
||||
.global gUnknown_80F5F70
|
||||
gUnknown_80F5F70: @ 80F5F70
|
||||
@ replacing .incbin "baserom.gba", 0xF5F70, 0x3C
|
||||
.byte 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0x0c, 0x00, 0x0c, 0x00
|
||||
.byte 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00
|
||||
.byte 0x0d, 0x00, 0x0d, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00
|
||||
.byte 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0x0c, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80F5FAC
|
||||
gUnknown_80F5FAC: @ 80F5FAC
|
||||
@ replacing .incbin "baserom.gba", 0xF5FAC, 0x130
|
||||
.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
||||
.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
||||
.byte 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
||||
.byte 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00
|
||||
.byte 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
||||
.byte 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80F60DC
|
||||
gUnknown_80F60DC: @ 80F60DC
|
||||
@ replacing .incbin "baserom.gba", 0xF60DC, 0x1C
|
||||
.byte 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00
|
||||
.byte 0x04, 0x00, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00
|
||||
|
||||
.global gUnknown_80F60F8
|
||||
gUnknown_80F60F8: @ 80F60F8
|
||||
@ replacing .incbin "baserom.gba", 0x000f60f8, 0x8
|
||||
.string "banrpal\0"
|
||||
|
||||
.global gUnknown_80F6100
|
||||
gUnknown_80F6100: @ 80F6100
|
||||
@ replacing .incbin "baserom.gba", 0x000f6100, 0x8
|
||||
.string "banfont\0"
|
||||
|
||||
.global gUnknown_80F6108
|
||||
gUnknown_80F6108: @ 80F6108
|
||||
@ replacing .incbin "baserom.gba", 0x000f6108, 0x4
|
||||
.byte 0x23, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80F610C
|
||||
gUnknown_80F610C: @ 80F610C
|
||||
@ replacing .incbin "baserom.gba", 0x000f610c, 0x4
|
||||
.byte 0x42, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80F6110
|
||||
gUnknown_80F6110: @ 80F6110
|
||||
@ replacing .incbin "baserom.gba", 0x000f6110, 0x8
|
||||
.string "%s%c%cF\0"
|
||||
|
||||
.global gUnknown_80F6118
|
||||
gUnknown_80F6118: @ 80F6118
|
||||
@ replacing .incbin "baserom.gba", 0x000f6118, 0x8
|
||||
.string "%s%cF\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80F6120
|
||||
gUnknown_80F6120: @ 80F6120
|
||||
@ replacing .incbin "baserom.gba", 0x000f6120, 0x88
|
||||
.byte 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00
|
||||
.byte 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x0c, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
|
||||
.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x14, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00
|
||||
.byte 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x18, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x1c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00
|
||||
.string "pksdir0\0"
|
||||
|
||||
.global gUnknown_80F61A8
|
||||
gUnknown_80F61A8: @ 80F61A8
|
||||
@ replacing .incbin "baserom.gba", 0x000f61a8, 0x8
|
||||
.string "itempat\0"
|
||||
|
||||
.global gUnknown_80F61B0
|
||||
gUnknown_80F61B0: @ 80F61B0
|
||||
@ replacing .incbin "baserom.gba", 0x000f61b0, 0x8
|
||||
.string "etcfont\0"
|
||||
|
||||
.global gUnknown_80F61B8
|
||||
gUnknown_80F61B8: @ 80F61B8
|
||||
@ replacing .incbin "baserom.gba", 0x000f61b8, 0xc
|
||||
.string "etcfonta\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80F61C4
|
||||
gUnknown_80F61C4: @ 80F61C4
|
||||
@ replacing .incbin "baserom.gba", 0x000f61c4, 0x8
|
||||
.string "levfont\0"
|
||||
|
||||
.global gUnknown_80F61CC
|
||||
gUnknown_80F61CC: @ 80F61CC
|
||||
@ replacing .incbin "baserom.gba", 0x000f61cc, 0x8
|
||||
.string "hp5font\0"
|
||||
|
||||
.global gUnknown_80F61D4
|
||||
gUnknown_80F61D4: @ 80F61D4
|
||||
@ replacing .incbin "baserom.gba", 0x000f61d4, 0x8
|
||||
.string "colvec\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80F61DC
|
||||
gUnknown_80F61DC: @ 80F61DC
|
||||
@ replacing .incbin "baserom.gba", 0x000f61dc, 0x10
|
||||
.string "trappat\0"
|
||||
.string "pksdir0\0"
|
||||
|
||||
.global gUnknown_80F61EC
|
||||
|
|
|
|||
83
data/data_80F59C8_1.s
Normal file
83
data/data_80F59C8_1.s
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
#include "constants/status.h"
|
||||
.section .rodata
|
||||
#.incbin "baserom.gba", 0xF59C4, 0x4
|
||||
|
||||
|
||||
|
||||
.global gUnknown_80F5F70
|
||||
gUnknown_80F5F70: @ 80F5F70
|
||||
@ replacing .incbin "baserom.gba", 0xF5F70, 0x3C
|
||||
.byte 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0x0c, 0x00, 0x0c, 0x00
|
||||
.byte 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00
|
||||
.byte 0x0d, 0x00, 0x0d, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00
|
||||
.byte 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0x0c, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80F5FAC
|
||||
gUnknown_80F5FAC: @ 80F5FAC
|
||||
@ replacing .incbin "baserom.gba", 0xF5FAC, 0x130
|
||||
.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
||||
.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
||||
.byte 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
||||
.byte 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00
|
||||
.byte 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
||||
.byte 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80F60DC
|
||||
gUnknown_80F60DC: @ 80F60DC
|
||||
@ replacing .incbin "baserom.gba", 0xF60DC, 0x1C
|
||||
.byte 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00
|
||||
.byte 0x04, 0x00, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00
|
||||
|
||||
.global gUnknown_80F60F8
|
||||
gUnknown_80F60F8: @ 80F60F8
|
||||
@ replacing .incbin "baserom.gba", 0x000f60f8, 0x8
|
||||
.string "banrpal\0"
|
||||
|
||||
.global gUnknown_80F6100
|
||||
gUnknown_80F6100: @ 80F6100
|
||||
@ replacing .incbin "baserom.gba", 0x000f6100, 0x8
|
||||
.string "banfont\0"
|
||||
|
||||
.global gUnknown_80F6108
|
||||
gUnknown_80F6108: @ 80F6108
|
||||
@ replacing .incbin "baserom.gba", 0x000f6108, 0x4
|
||||
.byte 0x23, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80F610C
|
||||
gUnknown_80F610C: @ 80F610C
|
||||
@ replacing .incbin "baserom.gba", 0x000f610c, 0x4
|
||||
.byte 0x42, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_80F6110
|
||||
gUnknown_80F6110: @ 80F6110
|
||||
@ replacing .incbin "baserom.gba", 0x000f6110, 0x8
|
||||
.string "%s%c%cF\0"
|
||||
|
||||
.global gUnknown_80F6118
|
||||
gUnknown_80F6118: @ 80F6118
|
||||
@ replacing .incbin "baserom.gba", 0x000f6118, 0x8
|
||||
.string "%s%cF\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_80F6120
|
||||
gUnknown_80F6120: @ 80F6120
|
||||
@ replacing .incbin "baserom.gba", 0x000f6120, 0x88
|
||||
.byte 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00
|
||||
.byte 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x0c, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
|
||||
.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x14, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00
|
||||
.byte 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x18, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x1c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00
|
||||
.string "pksdir0\0"
|
||||
|
||||
|
|
@ -329,6 +329,8 @@ typedef struct unkDungeon57C
|
|||
} unkDungeon57C;
|
||||
|
||||
#define COLOR_RAMP_COUNT 256
|
||||
#define UNK12A18_ARR_COUNT 29
|
||||
#define UNK12A18_ARR_COUNT_2 9
|
||||
|
||||
// size: 0x1CEDC
|
||||
typedef struct Dungeon
|
||||
|
|
@ -415,13 +417,8 @@ typedef struct Dungeon
|
|||
/* 0x10844 */ s16 naturalJunctionListCounts[MAX_ROOM_COUNT];
|
||||
/* 0x10884 */ DungeonPos naturalJunctionList[MAX_ROOM_COUNT][MAX_ROOM_COUNT]; // Arrays of room exits for each room.
|
||||
u16 unk11884[250][9];
|
||||
u16 unk12A18[20][9];
|
||||
u16 unk12B80[9];
|
||||
u16 unk12B92[36];
|
||||
u16 unk12BDA[9];
|
||||
u16 unk12BEC[9];
|
||||
u16 unk12BFE[19];
|
||||
u8 unk12C24[0x930];
|
||||
u16 unk12A18[UNK12A18_ARR_COUNT][UNK12A18_ARR_COUNT_2];
|
||||
u8 ALIGNED(4) unk12C24[0x930];
|
||||
u16 unk13554[10];
|
||||
OpenedFile *unk13568;
|
||||
u8 unk1356C;
|
||||
|
|
|
|||
|
|
@ -529,6 +529,8 @@ SECTIONS {
|
|||
src/dungeon_ai_movement.o(.rodata);
|
||||
data/data_80F4D44.o(.rodata);
|
||||
src/dungeon_config.o(.rodata);
|
||||
data/data_80F59C8_1.o(.rodata);
|
||||
src/code_803D110.o(.rodata);
|
||||
data/data_80F59C8.o(.rodata);
|
||||
src/dungeon_message.o(.rodata);
|
||||
src/dungeon_move.o(.rodata);
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
#include "text.h"
|
||||
#include "constants/dungeon.h"
|
||||
|
||||
extern void sub_803E13C(void);
|
||||
extern void sub_80901D8(DungeonLocation *param_1,DungeonLocation *param_2);
|
||||
extern s32 sub_80902C8(u8 dungeon);
|
||||
extern void sub_808E9C4(UnkDungeonGlobal_unk1CD98 *r0, s16 r1);
|
||||
|
|
@ -27,9 +28,10 @@ extern const char gUnknown_80F6108[];
|
|||
extern const char gUnknown_80F610C[];
|
||||
extern const char gUnknown_80F6110[];
|
||||
extern const char gUnknown_80F6118[];
|
||||
extern const char gUnknown_80F61A8[];
|
||||
extern const u32 gUnknown_80F6120[];
|
||||
extern const u16 gUnknown_80F5F70[];
|
||||
|
||||
extern RGB gUnknown_202ECA4[];
|
||||
extern struct FileArchive gDungeonFileArchive;
|
||||
extern OpenedFile *gDungeonNameBannerPalette;
|
||||
extern OpenedFile *gDungeonNameBannerFontFile;
|
||||
|
|
@ -518,253 +520,100 @@ struct UnkStruct_sub_803DC6C *sub_803DEC8(s32 chr)
|
|||
return ret;
|
||||
};
|
||||
|
||||
/*
|
||||
I'm leaving this as it is, because I'm not sure how to generate the ldmia asm instruction. Maybe once the file's data format is better understood.
|
||||
struct FileSub_803DF60Struct
|
||||
struct FileStruct2
|
||||
{
|
||||
s32 count;
|
||||
void *unkPtr;
|
||||
u8 array[0];
|
||||
};
|
||||
|
||||
struct OpenedFile_sub_803DF60
|
||||
struct FileStruct
|
||||
{
|
||||
File *file;
|
||||
struct FileSub_803DF60Struct **strPtr;
|
||||
struct FileStruct2 *ptr;
|
||||
struct u8 *ptr2;
|
||||
};
|
||||
|
||||
void sub_803DF60(void)
|
||||
{
|
||||
u8 *vram;
|
||||
s32 i;
|
||||
struct OpenedFile_sub_803DF60 *file = (void*) OpenFileAndGetFileDataPtr(gUnknown_80F61A8, &gDungeonFileArchive);
|
||||
struct FileSub_803DF60Struct r5 = **file->strPtr;
|
||||
const void *src;
|
||||
OpenedFile *file;
|
||||
|
||||
for (i = 0; i < r5.count; i++) {
|
||||
CpuCopy((void *)VRAM + 0x13400 + i * 0x20, r5.unkPtr + i * 0x20, 0x20);
|
||||
file = OpenFileAndGetFileDataPtr("itempat", &gDungeonFileArchive);
|
||||
src = ((struct FileStruct *)(file->data))->ptr;
|
||||
i = ((struct FileStruct2 *)(src))->count;
|
||||
src = ((struct FileStruct2 *)(src))->array;
|
||||
vram = OBJ_VRAM0 + 0x3400;
|
||||
while (i != 0)
|
||||
{
|
||||
CpuCopy(vram, src, 0x20);
|
||||
vram += 0x20;
|
||||
src += 0x20;
|
||||
i--;
|
||||
}
|
||||
|
||||
CloseFile(file);
|
||||
|
||||
file = OpenFileAndGetFileDataPtr("etcfont", &gDungeonFileArchive);
|
||||
src = ((struct FileStruct2 *)(file->data));
|
||||
i = ((struct FileStruct2 *)(src))->count;
|
||||
src = ((struct FileStruct2 *)(src))->array;
|
||||
vram = OBJ_VRAM0 + 0x4000;
|
||||
while (i != 0)
|
||||
{
|
||||
CpuCopy(vram, src, 0x20);
|
||||
vram += 0x20;
|
||||
src += 0x20;
|
||||
i--;
|
||||
}
|
||||
CloseFile(file);
|
||||
|
||||
gUnknown_202EC94 = OpenFileAndGetFileDataPtr("etcfonta", &gDungeonFileArchive);
|
||||
gUnknown_202EC98 = OpenFileAndGetFileDataPtr("levfont", &gDungeonFileArchive);
|
||||
gUnknown_202EC9C = OpenFileAndGetFileDataPtr("hp5font", &gDungeonFileArchive);
|
||||
gUnknown_202ECA0 = OpenFileAndGetFileDataPtr("colvec", &gDungeonFileArchive);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
NAKED void sub_803DF60(void)
|
||||
void sub_803E02C(void)
|
||||
{
|
||||
asm_unified(" push {r4-r7,lr}\n"
|
||||
" ldr r0, _0803DFF8\n"
|
||||
" ldr r1, _0803DFFC\n"
|
||||
" bl OpenFileAndGetFileDataPtr\n"
|
||||
" adds r7, r0, 0\n"
|
||||
" ldr r0, [r7, 0x4]\n"
|
||||
" ldr r5, [r0]\n"
|
||||
" ldm r5!, {r4}\n"
|
||||
" ldr r6, _0803E000\n"
|
||||
" cmp r4, 0\n"
|
||||
" beq _0803DF8C\n"
|
||||
"_0803DF78:\n"
|
||||
" adds r0, r6, 0\n"
|
||||
" adds r1, r5, 0\n"
|
||||
" movs r2, 0x20\n"
|
||||
" bl CpuCopy\n"
|
||||
" adds r6, 0x20\n"
|
||||
" adds r5, 0x20\n"
|
||||
" subs r4, 0x1\n"
|
||||
" cmp r4, 0\n"
|
||||
" bne _0803DF78\n"
|
||||
"_0803DF8C:\n"
|
||||
" adds r0, r7, 0\n"
|
||||
" bl CloseFile\n"
|
||||
" ldr r0, _0803E004\n"
|
||||
" ldr r1, _0803DFFC\n"
|
||||
" bl OpenFileAndGetFileDataPtr\n"
|
||||
" adds r7, r0, 0\n"
|
||||
" ldr r5, [r7, 0x4]\n"
|
||||
" ldm r5!, {r4}\n"
|
||||
" ldr r6, _0803E008\n"
|
||||
" cmp r4, 0\n"
|
||||
" beq _0803DFBA\n"
|
||||
"_0803DFA6:\n"
|
||||
" adds r0, r6, 0\n"
|
||||
" adds r1, r5, 0\n"
|
||||
" movs r2, 0x20\n"
|
||||
" bl CpuCopy\n"
|
||||
" adds r6, 0x20\n"
|
||||
" adds r5, 0x20\n"
|
||||
" subs r4, 0x1\n"
|
||||
" cmp r4, 0\n"
|
||||
" bne _0803DFA6\n"
|
||||
"_0803DFBA:\n"
|
||||
" adds r0, r7, 0\n"
|
||||
" bl CloseFile\n"
|
||||
" ldr r0, _0803E00C\n"
|
||||
" ldr r4, _0803DFFC\n"
|
||||
" adds r1, r4, 0\n"
|
||||
" bl OpenFileAndGetFileDataPtr\n"
|
||||
" ldr r1, _0803E010\n"
|
||||
" str r0, [r1]\n"
|
||||
" ldr r0, _0803E014\n"
|
||||
" adds r1, r4, 0\n"
|
||||
" bl OpenFileAndGetFileDataPtr\n"
|
||||
" ldr r1, _0803E018\n"
|
||||
" str r0, [r1]\n"
|
||||
" ldr r0, _0803E01C\n"
|
||||
" adds r1, r4, 0\n"
|
||||
" bl OpenFileAndGetFileDataPtr\n"
|
||||
" ldr r1, _0803E020\n"
|
||||
" str r0, [r1]\n"
|
||||
" ldr r0, _0803E024\n"
|
||||
" adds r1, r4, 0\n"
|
||||
" bl OpenFileAndGetFileDataPtr\n"
|
||||
" ldr r1, _0803E028\n"
|
||||
" str r0, [r1]\n"
|
||||
" pop {r4-r7}\n"
|
||||
" pop {r0}\n"
|
||||
" bx r0\n"
|
||||
" .align 2, 0\n"
|
||||
"_0803DFF8: .4byte gUnknown_80F61A8\n"
|
||||
"_0803DFFC: .4byte gDungeonFileArchive\n"
|
||||
"_0803E000: .4byte 0x06013400\n"
|
||||
"_0803E004: .4byte gUnknown_80F61B0\n"
|
||||
"_0803E008: .4byte 0x06014000\n"
|
||||
"_0803E00C: .4byte gUnknown_80F61B8\n"
|
||||
"_0803E010: .4byte gUnknown_202EC94\n"
|
||||
"_0803E014: .4byte gUnknown_80F61C4\n"
|
||||
"_0803E018: .4byte gUnknown_202EC98\n"
|
||||
"_0803E01C: .4byte gUnknown_80F61CC\n"
|
||||
"_0803E020: .4byte gUnknown_202EC9C\n"
|
||||
"_0803E024: .4byte gUnknown_80F61D4\n"
|
||||
"_0803E028: .4byte gUnknown_202ECA0\n");
|
||||
}
|
||||
u8 *vram;
|
||||
s32 i, j, r6;
|
||||
const void *src;
|
||||
OpenedFile *file;
|
||||
u8 fileName[12];
|
||||
|
||||
NAKED void sub_803E02C(void)
|
||||
{
|
||||
asm_unified( "push {r4-r7,lr}\n"
|
||||
" mov r7, r9\n"
|
||||
" mov r6, r8\n"
|
||||
" push {r6,r7}\n"
|
||||
" sub sp, 0xC\n"
|
||||
" bl sub_803E13C\n"
|
||||
" mov r1, sp\n"
|
||||
" ldr r0, _0803E118\n"
|
||||
" ldm r0!, {r2,r3}\n"
|
||||
" stm r1!, {r2,r3}\n"
|
||||
" ldr r1, _0803E11C\n"
|
||||
" mov r0, sp\n"
|
||||
" bl OpenFileAndGetFileDataPtr\n"
|
||||
" adds r7, r0, 0\n"
|
||||
" ldr r0, [r7, 0x4]\n"
|
||||
" ldr r5, [r0]\n"
|
||||
" ldm r5!, {r4}\n"
|
||||
" ldr r6, _0803E120\n"
|
||||
" cmp r4, 0\n"
|
||||
" beq _0803E06C\n"
|
||||
"_0803E058:\n"
|
||||
" adds r0, r6, 0\n"
|
||||
" adds r1, r5, 0\n"
|
||||
" movs r2, 0x20\n"
|
||||
" bl CpuCopy\n"
|
||||
" adds r6, 0x20\n"
|
||||
" adds r5, 0x20\n"
|
||||
" subs r4, 0x1\n"
|
||||
" cmp r4, 0\n"
|
||||
" bne _0803E058\n"
|
||||
"_0803E06C:\n"
|
||||
" ldr r0, _0803E124\n"
|
||||
" ldr r1, [r7, 0x4]\n"
|
||||
" ldr r1, [r1, 0x4]\n"
|
||||
" movs r2, 0x80\n"
|
||||
" bl CpuCopy\n"
|
||||
" adds r0, r7, 0\n"
|
||||
" bl CloseFile\n"
|
||||
" movs r6, 0x80\n"
|
||||
" lsls r6, 2\n"
|
||||
" movs r4, 0\n"
|
||||
" ldr r0, _0803E128\n"
|
||||
" mov r9, r0\n"
|
||||
" ldr r1, _0803E12C\n"
|
||||
" mov r12, r1\n"
|
||||
" movs r7, 0\n"
|
||||
" ldr r2, _0803E130\n"
|
||||
" mov r8, r2\n"
|
||||
"_0803E092:\n"
|
||||
" mov r3, r12\n"
|
||||
" ldrh r0, [r3]\n"
|
||||
" lsls r5, r0, 12\n"
|
||||
" adds r2, r7, 0\n"
|
||||
" movs r3, 0x8\n"
|
||||
"_0803E09C:\n"
|
||||
" mov r0, r9\n"
|
||||
" ldr r1, [r0]\n"
|
||||
" add r1, r8\n"
|
||||
" adds r1, r2\n"
|
||||
" adds r0, r5, 0\n"
|
||||
" orrs r0, r6\n"
|
||||
" strh r0, [r1]\n"
|
||||
" adds r6, 0x1\n"
|
||||
" adds r2, 0x2\n"
|
||||
" subs r3, 0x1\n"
|
||||
" cmp r3, 0\n"
|
||||
" bge _0803E09C\n"
|
||||
" movs r1, 0x2\n"
|
||||
" add r12, r1\n"
|
||||
" adds r7, 0x12\n"
|
||||
" adds r4, 0x1\n"
|
||||
" cmp r4, 0x1C\n"
|
||||
" ble _0803E092\n"
|
||||
" movs r4, 0\n"
|
||||
" ldr r5, _0803E128\n"
|
||||
" ldr r3, _0803E134\n"
|
||||
" movs r2, 0xC0\n"
|
||||
" lsls r2, 8\n"
|
||||
"_0803E0CA:\n"
|
||||
" ldr r0, [r5]\n"
|
||||
" lsls r1, r4, 1\n"
|
||||
" adds r0, r3\n"
|
||||
" adds r0, r1\n"
|
||||
" strh r2, [r0]\n"
|
||||
" adds r4, 0x1\n"
|
||||
" cmp r4, 0x8\n"
|
||||
" ble _0803E0CA\n"
|
||||
" movs r4, 0\n"
|
||||
" ldr r2, _0803E128\n"
|
||||
" movs r6, 0xBE\n"
|
||||
" lsls r6, 1\n"
|
||||
" ldr r5, _0803E138\n"
|
||||
" movs r3, 0xBF\n"
|
||||
" lsls r3, 1\n"
|
||||
"_0803E0E8:\n"
|
||||
" ldr r0, [r2]\n"
|
||||
" lsls r1, r4, 2\n"
|
||||
" adds r0, r1\n"
|
||||
" adds r0, r6\n"
|
||||
" strb r4, [r0]\n"
|
||||
" ldr r0, [r2]\n"
|
||||
" adds r0, r1\n"
|
||||
" adds r0, r5\n"
|
||||
" strb r4, [r0]\n"
|
||||
" ldr r0, [r2]\n"
|
||||
" adds r0, r1\n"
|
||||
" adds r0, r3\n"
|
||||
" strb r4, [r0]\n"
|
||||
" adds r4, 0x1\n"
|
||||
" cmp r4, 0xFF\n"
|
||||
" ble _0803E0E8\n"
|
||||
" add sp, 0xC\n"
|
||||
" pop {r3,r4}\n"
|
||||
" mov r8, r3\n"
|
||||
" mov r9, r4\n"
|
||||
" pop {r4-r7}\n"
|
||||
" pop {r0}\n"
|
||||
" bx r0\n"
|
||||
" .align 2, 0\n"
|
||||
"_0803E118: .4byte gUnknown_80F61DC\n"
|
||||
"_0803E11C: .4byte gDungeonFileArchive\n"
|
||||
"_0803E120: .4byte 0x0600c000\n"
|
||||
"_0803E124: .4byte gUnknown_202ECA4\n"
|
||||
"_0803E128: .4byte gDungeon\n"
|
||||
"_0803E12C: .4byte gUnknown_80F5F70\n"
|
||||
"_0803E130: .4byte 0x00012a18\n"
|
||||
"_0803E134: .4byte 0x00013554\n"
|
||||
"_0803E138: .4byte 0x0000017d\n");
|
||||
sub_803E13C();
|
||||
strcpy(fileName, "trappat");
|
||||
file = OpenFileAndGetFileDataPtr(fileName, &gDungeonFileArchive);
|
||||
|
||||
src = ((struct FileStruct *)(file->data))->ptr;
|
||||
i = ((struct FileStruct2 *)(src))->count;
|
||||
src = ((struct FileStruct2 *)(src))->array;
|
||||
vram = (void *) VRAM + 0xC000;
|
||||
while (i != 0)
|
||||
{
|
||||
CpuCopy(vram, src, 0x20);
|
||||
vram += 0x20;
|
||||
src += 0x20;
|
||||
i--;
|
||||
}
|
||||
CpuCopy(gUnknown_202ECA4, ((struct FileStruct *)(file->data))->ptr2, 0x80);
|
||||
CloseFile(file);
|
||||
|
||||
r6 = 0x200;
|
||||
for (i = 0; i < UNK12A18_ARR_COUNT; i++) {
|
||||
for (j = 0; j < UNK12A18_ARR_COUNT_2; j++) {
|
||||
gDungeon->unk12A18[i][j] = (gUnknown_80F5F70[i] << 0xC) | r6;
|
||||
r6++;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < 9; i++) {
|
||||
gDungeon->unk13554[i] = 0xC000;
|
||||
}
|
||||
for (i = 0; i < COLOR_RAMP_COUNT; i++) {
|
||||
gDungeon->colorRamp[i].r = i;
|
||||
gDungeon->colorRamp[i].g = i;
|
||||
gDungeon->colorRamp[i].b = i;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_803E13C(void)
|
||||
|
|
|
|||
|
|
@ -469,16 +469,16 @@ void sub_8049ED4(void)
|
|||
r7 = r10 + (r8 * 3);
|
||||
tile = GetTile(var_48, var_44);
|
||||
if (tile->terrainType & TERRAIN_TYPE_UNK_x1000) {
|
||||
src = &dungeon->unk12BEC[r7];
|
||||
src = &dungeon->unk12A18[26][r7];
|
||||
}
|
||||
else if (tile->terrainType & TERRAIN_TYPE_SHOP) {
|
||||
src = &dungeon->unk12BDA[r7];
|
||||
src = &dungeon->unk12A18[25][r7];
|
||||
}
|
||||
else if (hallucinating) {
|
||||
src = &dungeon->unk11884[tile->unk8][r7];
|
||||
}
|
||||
else if (tile->spawnOrVisibilityFlags & 4) {
|
||||
src = &dungeon->unk12BFE[r7];
|
||||
src = &dungeon->unk12A18[27][r7];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -514,16 +514,16 @@ void sub_8049ED4(void)
|
|||
r7 = r10;
|
||||
tile = GetTile(var_48, var_44);
|
||||
if (tile->terrainType & TERRAIN_TYPE_SHOP) {
|
||||
src = &dungeon->unk12BDA[r7];
|
||||
src = &dungeon->unk12A18[25][r7];
|
||||
}
|
||||
else if (tile->terrainType & TERRAIN_TYPE_UNK_x1000) {
|
||||
src = &dungeon->unk12BEC[r7];
|
||||
src = &dungeon->unk12A18[26][r7];
|
||||
}
|
||||
else if (hallucinating) {
|
||||
src = &dungeon->unk11884[tile->unk8][r7];
|
||||
}
|
||||
else if (tile->spawnOrVisibilityFlags & 4) {
|
||||
src = &dungeon->unk12BFE[r7];
|
||||
src = &dungeon->unk12A18[27][r7];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -587,10 +587,10 @@ void sub_804A1F0(s32 a0, s32 a1)
|
|||
r6 = var_28 + r8 * 3;
|
||||
tile = GetTile(var_2C, r10);
|
||||
if (tile->terrainType & TERRAIN_TYPE_SHOP) {
|
||||
src = &dungeon->unk12BDA[r6];
|
||||
src = &dungeon->unk12A18[25][r6];
|
||||
}
|
||||
else if (tile->terrainType & TERRAIN_TYPE_UNK_x1000) {
|
||||
src = &dungeon->unk12BEC[r6];
|
||||
src = &dungeon->unk12A18[26][r6];
|
||||
}
|
||||
else if (hallucinating) {
|
||||
src = &dungeon->unk11884[tile->unk8][r6];
|
||||
|
|
@ -628,10 +628,10 @@ void sub_804A1F0(s32 a0, s32 a1)
|
|||
r6 = var_28;
|
||||
tile = GetTile(var_2C, r10);
|
||||
if (tile->terrainType & TERRAIN_TYPE_SHOP) {
|
||||
src = &dungeon->unk12BDA[r6];
|
||||
src = &dungeon->unk12A18[25][r6];
|
||||
}
|
||||
else if (tile->terrainType & TERRAIN_TYPE_UNK_x1000) {
|
||||
src = &dungeon->unk12BEC[r6];
|
||||
src = &dungeon->unk12A18[26][r6];
|
||||
}
|
||||
else if (hallucinating) {
|
||||
src = &dungeon->unk11884[tile->unk8][r6];
|
||||
|
|
@ -688,10 +688,10 @@ void sub_804A49C(s32 a0, s32 a1)
|
|||
r6 = r9 + var_28 * 3;
|
||||
tile = GetTile(r10, var_2C);
|
||||
if (tile->terrainType & TERRAIN_TYPE_SHOP) {
|
||||
src = &dungeon->unk12BDA[r6];
|
||||
src = &dungeon->unk12A18[25][r6];
|
||||
}
|
||||
else if (tile->terrainType & TERRAIN_TYPE_UNK_x1000) {
|
||||
src = &dungeon->unk12BEC[r6];
|
||||
src = &dungeon->unk12A18[26][r6];
|
||||
}
|
||||
else if (hallucinating) {
|
||||
src = &dungeon->unk11884[tile->unk8][r6];
|
||||
|
|
@ -729,10 +729,10 @@ void sub_804A49C(s32 a0, s32 a1)
|
|||
r6 = var_28 * 3;
|
||||
tile = GetTile(r10, var_2C);
|
||||
if (tile->terrainType & TERRAIN_TYPE_SHOP) {
|
||||
src = &dungeon->unk12BDA[r6];
|
||||
src = &dungeon->unk12A18[25][r6];
|
||||
}
|
||||
else if (tile->terrainType & TERRAIN_TYPE_UNK_x1000) {
|
||||
src = &dungeon->unk12BEC[r6];
|
||||
src = &dungeon->unk12A18[26][r6];
|
||||
}
|
||||
else if (hallucinating) {
|
||||
src = &dungeon->unk11884[tile->unk8][r6];
|
||||
|
|
@ -803,7 +803,7 @@ void sub_804A728(DungeonPos *pos, s32 a1, u8 a2, u8 a3)
|
|||
var_48.y = r9;
|
||||
if (a2 != 0) {
|
||||
if (r10 == pos->x && r9 == pos->y) {
|
||||
src = &dungeon->unk12B92[r5];
|
||||
src = &dungeon->unk12A18[21][r5];
|
||||
}
|
||||
else {
|
||||
src = &dungeon->unk13554[r5];
|
||||
|
|
@ -816,14 +816,14 @@ void sub_804A728(DungeonPos *pos, s32 a1, u8 a2, u8 a3)
|
|||
}
|
||||
if (k == 6) {
|
||||
if (gGameOptionsRef->gridEnable) {
|
||||
src = &dungeon->unk12B80[r5];
|
||||
src = &dungeon->unk12A18[20][r5];
|
||||
}
|
||||
else {
|
||||
src = &dungeon->unk13554[r5];
|
||||
}
|
||||
}
|
||||
else {
|
||||
src = &dungeon->unk12B92[r5];
|
||||
src = &dungeon->unk12A18[21][r5];
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -845,7 +845,7 @@ void sub_804A728(DungeonPos *pos, s32 a1, u8 a2, u8 a3)
|
|||
var_48.y = r9;
|
||||
if (a2 != 0) {
|
||||
if (r10 == pos->x && r9 == pos->y) {
|
||||
src = &dungeon->unk12B92[r5];
|
||||
src = &dungeon->unk12A18[21][r5];
|
||||
}
|
||||
else {
|
||||
src = &dungeon->unk13554[r5];
|
||||
|
|
@ -858,14 +858,14 @@ void sub_804A728(DungeonPos *pos, s32 a1, u8 a2, u8 a3)
|
|||
}
|
||||
if (k == 6) {
|
||||
if (gGameOptionsRef->gridEnable) {
|
||||
src = &dungeon->unk12B80[r5];
|
||||
src = &dungeon->unk12A18[20][r5];
|
||||
}
|
||||
else {
|
||||
src = &dungeon->unk13554[r5];
|
||||
}
|
||||
}
|
||||
else {
|
||||
src = &dungeon->unk12B92[r5];
|
||||
src = &dungeon->unk12A18[21][r5];
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user