mirror of
https://github.com/pret/pmd-red.git
synced 2026-09-26 19:08:58 -05:00
2336
asm/ground_sprite.s
2336
asm/ground_sprite.s
File diff suppressed because it is too large
Load Diff
487
data/data_8115F5C_1.s
Normal file
487
data/data_8115F5C_1.s
Normal file
@@ -0,0 +1,487 @@
|
||||
.section .rodata
|
||||
|
||||
.align 2
|
||||
|
||||
.string "pksdir0\0"
|
||||
.align 2,0
|
||||
|
||||
.global gGroundLivesCallbacks
|
||||
gGroundLivesCallbacks: @ 8117F10
|
||||
.byte 0x01, 0x00, 0x00, 0x00
|
||||
.4byte CallbackLivesGetIndex
|
||||
.4byte CallbackLivesGetSize
|
||||
.4byte CallbackLivesGetHitboxCenter
|
||||
.4byte CallbackLivesGetPosHeightAndUnk
|
||||
.4byte CallbackLivesGetDirection
|
||||
.4byte CallbackLivesGetFlags
|
||||
.4byte CallbackLivesSetHitboxPos
|
||||
.4byte CallbackLivesSetPositionBounds
|
||||
.4byte CallbackLivesMoveReal
|
||||
.4byte CallbackLivesSetPosHeight
|
||||
.4byte CallbackLivesSetDirection
|
||||
.4byte CallbackLivesSetEventIndex
|
||||
.4byte nullsub_211
|
||||
.4byte CallbackLivesSetUnk_80AB194
|
||||
.4byte CallbackLivesSetFlags
|
||||
.4byte CallbackLivesClearFlags
|
||||
.4byte CallbackLivesSpriteRelated_80AB238
|
||||
.4byte CallbackLivesMoveRelative
|
||||
.4byte CallbackLivesSpriteRelatedCheck_80AB1C0
|
||||
.4byte CallbackLivesSpriteRelated_80AB1E4
|
||||
|
||||
.global gUnknown_8117F64
|
||||
gUnknown_8117F64: @ 8117F64
|
||||
@ replacing .incbin "baserom.gba", 0x117F64, 0x6A
|
||||
.byte 0xff, 0xff, 0x00, 0x08, 0x00, 0x03, 0x00, 0x03, 0x07, 0x08, 0x00, 0x08, 0x05, 0x08, 0x02, 0x03
|
||||
.byte 0x06, 0x03, 0x0b, 0x08, 0x07, 0x03, 0x06, 0x10, 0x02, 0x10, 0x01, 0x10, 0x08, 0x10, 0x0c, 0x10
|
||||
.byte 0x09, 0x10, 0x0a, 0x10, 0x03, 0x10, 0x04, 0x10, 0x03, 0x08, 0x04, 0x08, 0x0d, 0x10, 0x0e, 0x10
|
||||
.byte 0x0f, 0x10, 0x10, 0x10, 0x11, 0x10, 0x12, 0x10, 0x13, 0x10, 0x14, 0x10, 0x0d, 0x08, 0x0e, 0x08
|
||||
.byte 0x0f, 0x08, 0x10, 0x08, 0x11, 0x08, 0x12, 0x08, 0x13, 0x08, 0x14, 0x08, 0x0d, 0x08, 0x0e, 0x10
|
||||
.byte 0x0f, 0x10, 0x10, 0x10, 0x11, 0x10, 0x12, 0x08, 0x13, 0x10, 0x14, 0x10, 0x15, 0x10, 0x16, 0x10
|
||||
.byte 0x17, 0x10, 0x18, 0x08, 0x19, 0x10, 0x1a, 0x08, 0x1b, 0x08
|
||||
|
||||
.global gUnknown_8117FCE
|
||||
gUnknown_8117FCE: @ 8117FCE
|
||||
@ replacing .incbin "baserom.gba", 0x117FCE, 0x22
|
||||
.byte 0x19, 0x00, 0x34, 0x00, 0x85, 0x00, 0x45, 0x01, 0x07, 0x00, 0x9e, 0x00, 0x1b, 0x01, 0x36, 0x00
|
||||
.byte 0x04, 0x00, 0x18, 0x01, 0x9b, 0x00, 0x68, 0x00, 0x42, 0x00, 0x01, 0x00, 0x98, 0x00, 0x15, 0x01
|
||||
.byte 0x00, 0x00
|
||||
|
||||
.global gUnknown_8117FF0
|
||||
gUnknown_8117FF0: @ 8117FF0
|
||||
@ replacing .incbin "baserom.gba", 0x117FF0, 0x20
|
||||
.byte 0x00, 0x06, 0x00, 0x00, 0x41, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x41, 0x04, 0x00, 0x00
|
||||
.byte 0x00, 0x06, 0x00, 0x00, 0x41, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x41, 0x04, 0x00, 0x00
|
||||
|
||||
.global gUnknown_8118010
|
||||
gUnknown_8118010: @ 8118010
|
||||
@ replacing .incbin "baserom.gba", 0x118010, 0x20
|
||||
.byte 0x00, 0x20, 0x00, 0x00, 0xb1, 0x16, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0xb1, 0x16, 0x00, 0x00
|
||||
.byte 0x00, 0x20, 0x00, 0x00, 0xb1, 0x16, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0xb1, 0x16, 0x00, 0x00
|
||||
|
||||
.global gUnknown_8118030
|
||||
gUnknown_8118030: @ 8118030
|
||||
@ replacing .incbin "baserom.gba", 0x118030, 0x20
|
||||
.byte 0x00, 0x08, 0x00, 0x00, 0xac, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0xac, 0x05, 0x00, 0x00
|
||||
.byte 0x00, 0x08, 0x00, 0x00, 0xac, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0xac, 0x05, 0x00, 0x00
|
||||
|
||||
.global gUnknown_8118050
|
||||
gUnknown_8118050: @ 8118050
|
||||
.byte 0x00, 0x14, 0x00, 0x00
|
||||
.byte 0x00, 0x14, 0x00, 0x00
|
||||
.byte 0x00, 0x18, 0x00, 0x00
|
||||
|
||||
.global GroundLivesFile_Text
|
||||
GroundLivesFile_Text: @ Text
|
||||
.string "../ground/ground_lives.c\0"
|
||||
.align 2,0
|
||||
|
||||
.global GroundLives_Select_Text
|
||||
GroundLives_Text: @ Text
|
||||
.string "GroundLives_Select\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_811808C
|
||||
gUnknown_811808C: @ 811808C
|
||||
.4byte GroundLivesFile_Text
|
||||
.byte 0x1E, 0x02, 0x00, 0x00
|
||||
.4byte GroundLives_Text
|
||||
|
||||
.global gUnknown_8118098
|
||||
gUnknown_8118098: @ 8118098
|
||||
.string "GroundLives Select %3d %3d %3d\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_81180BC
|
||||
gUnknown_81180BC: @ 81180BC
|
||||
.string "GroundLives Cancel %3d %3d\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_81180D8
|
||||
gUnknown_81180D8: @ 81180D8
|
||||
.string "GroundLives CancelBlank\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_81180F0
|
||||
gUnknown_81180F0: @ 81180F0
|
||||
.byte 0x5F, 0x00
|
||||
.byte 0x22, 0x00
|
||||
.byte 0x10, 0x00
|
||||
.byte 0x13, 0x00
|
||||
.byte 0x1B, 0x00
|
||||
.byte 0x29, 0x00
|
||||
|
||||
.global gUnknown_81180FC
|
||||
gUnknown_81180FC: @ 81180FC
|
||||
@ replacing .incbin "baserom.gba", 0x1180FC, 0x20
|
||||
.byte 0x19, 0x00, 0x34, 0x00, 0x85, 0x00, 0x45, 0x01, 0x07, 0x00, 0x9e, 0x00, 0x1b, 0x01, 0x36, 0x00
|
||||
.byte 0x04, 0x00, 0x18, 0x01, 0x9b, 0x00, 0x68, 0x00, 0x42, 0x00, 0x01, 0x00, 0x98, 0x00, 0x15, 0x01
|
||||
|
||||
.global gUnknown_811811C
|
||||
gUnknown_811811C: @ 811811C
|
||||
.string "GroundLive Add id %3d kind %3d type %3d group %3d sector %3d\0"
|
||||
.align 2,0
|
||||
|
||||
.global GroundLives_Add_Text
|
||||
GroundLives_Add_Text: @ Add
|
||||
.string "GroundLives_Add\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_8118170
|
||||
gUnknown_8118170: @ 8118170
|
||||
.4byte GroundLivesFile_Text
|
||||
.byte 0x89, 0x05, 0x00, 0x00
|
||||
.4byte GroundLives_Add_Text
|
||||
|
||||
.global gUnknown_811817C
|
||||
gUnknown_811817C: @ 811817C
|
||||
.4byte GroundLivesFile_Text
|
||||
.byte 0xb4, 0x05, 0x00, 0x00
|
||||
.4byte GroundLives_Add_Text
|
||||
|
||||
.global gUnknown_8118188
|
||||
gUnknown_8118188: @ 8118188
|
||||
.4byte GroundLivesFile_Text
|
||||
.byte 0xba, 0x05, 0x00, 0x00
|
||||
.4byte GroundLives_Add_Text
|
||||
|
||||
.global gUnknown_8118194
|
||||
gUnknown_8118194: @ 8118194
|
||||
.string "GroundLives Delete id %3d\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_81181B0
|
||||
gUnknown_81181B0: @ 81181B0
|
||||
.string "GroundLives Execute %3d kind %3d %p\0"
|
||||
.align 2,0
|
||||
|
||||
.global GroundLives_ExecuteScript_Text
|
||||
GroundLives_ExecuteScript_Text: @ ExecuteScript
|
||||
.string "GroundLives_ExecuteScript\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_81181F4
|
||||
gUnknown_81181F4: @ 81181F4
|
||||
.4byte GroundLivesFile_Text
|
||||
.byte 0xa7, 0x06, 0x00, 0x00
|
||||
.4byte GroundLives_ExecuteScript_Text
|
||||
|
||||
.global ExecutePlayerScript_Text
|
||||
ExecutePlayerScript_Text: @ Text
|
||||
.string "_ExecutePlayerScript\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_8118218
|
||||
gUnknown_8118218: @ 8118218
|
||||
.4byte GroundLivesFile_Text
|
||||
.byte 0xC8, 0x06, 0x00, 0x00
|
||||
.4byte ExecutePlayerScript_Text
|
||||
|
||||
.global ExecutePlayerScriptActionLives_Text
|
||||
ExecutePlayerScriptActionLives_Text: @ Text
|
||||
.string "GroundLives_ExecutePlayerScriptActionLives\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_8118250
|
||||
gUnknown_8118250: @ 8118250
|
||||
.4byte GroundLivesFile_Text
|
||||
.byte 0xF9, 0x06, 0x00, 0x00
|
||||
.4byte ExecutePlayerScriptActionLives_Text
|
||||
|
||||
.global gGroundLives_InvalidityText
|
||||
gGroundLives_InvalidityText: @ 811825C
|
||||
.string "{COLOR RED_W}invalidity{RESET}\0"
|
||||
.align 2,0
|
||||
|
||||
.global GroundLives_ActionText
|
||||
GroundLives_ActionText: @ ActionText
|
||||
.string "GroundLives_Action\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_8118280
|
||||
gUnknown_8118280: @ 8118280
|
||||
.4byte GroundLivesFile_Text
|
||||
.byte 0xA2, 0x11, 0x00, 0x00
|
||||
.4byte GroundLives_ActionText
|
||||
|
||||
.global gUnknown_811828C
|
||||
gUnknown_811828C: @ 811828C
|
||||
.4byte GroundLivesFile_Text
|
||||
.byte 0x0E, 0x12, 0x00, 0x00
|
||||
.4byte GroundLives_ActionText
|
||||
.string "pksdir0\0"
|
||||
.align 2,0
|
||||
|
||||
.global gGroundObjectCallbacks
|
||||
gGroundObjectCallbacks: @ 81182A0
|
||||
@ replacing .incbin "baserom.gba", 0x1182A0, 0x54
|
||||
.byte 0x02, 0x00, 0x00, 0x00
|
||||
.4byte CallbackObjectGetIndex
|
||||
.4byte CallbackObjectGetSize
|
||||
.4byte CallbackObjectGetHitboxCenter
|
||||
.4byte CallbackObjectGetPosHeightAndUnk
|
||||
.4byte CallbackObjectGetDirection
|
||||
.4byte CallbackObjectGetFlags
|
||||
.4byte CallbackObjectSetHitboxPos
|
||||
.4byte CallbackObjectSetPositionBounds
|
||||
.4byte CallbackObjectMoveReal
|
||||
.4byte CallbackObjectSetPosHeight
|
||||
.4byte CallbackObjectSetDirection
|
||||
.4byte CallbackObjectSetEventIndex
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.4byte CallbackObjectSetUnk_80AC998
|
||||
.4byte CallbackObjectSetFlags
|
||||
.4byte CallbackObjectClearFlags
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.4byte CallbackObjectMoveRelative
|
||||
.4byte CallbackObjectSpriteRelatedCheck_80AC9B8
|
||||
.4byte CallbackObjectSpriteRelated_80AC9DC
|
||||
|
||||
.global gUnknown_81182F4
|
||||
gUnknown_81182F4: @ 81182F4
|
||||
.byte 0xF6, 0x0, 0x9F, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x34, 0x83, 0x11, 0x8, 0xF4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xDB, 0x0, 0x78, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xE7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
|
||||
|
||||
.global GroundObjectFile_Text
|
||||
GroundObjectFile_Text: @ Text
|
||||
|
||||
.global gUnknown_8118334
|
||||
gUnknown_8118334: @ 8118334
|
||||
.string "../ground/ground_object.c"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_8118350
|
||||
gUnknown_8118350: @ 8118350
|
||||
@ replacing .incbin "baserom.gba", 0x118350, 0x50
|
||||
.byte 0xf6, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.4byte gUnknown_8118334
|
||||
.byte 0x54, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0xdb, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0xe7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_81183A0
|
||||
gUnknown_81183A0: @ 81183A0
|
||||
.byte 0xFF, 0xFF, 0x0, 0x8, 0x1, 0x8, 0x0, 0x10, 0x1, 0x10, 0x2, 0x10, 0x3, 0x10, 0x0, 0x8, 0x1, 0x8, 0x2, 0x8, 0x3, 0x8, 0x4, 0x8, 0x5, 0x8, 0x6, 0x8, 0x7, 0x8, 0x8, 0x8, 0x9, 0x8, 0xA, 0x8, 0xB, 0x8, 0xC, 0x8, 0xD, 0x8, 0xE, 0x8, 0xF, 0x8, 0x0, 0x0
|
||||
|
||||
.global GroundObject_Select_Text
|
||||
GroundObject_Select_Text: @ Select
|
||||
.string "GroundObject_Select"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_81183E4
|
||||
gUnknown_81183E4: @ 81183E4
|
||||
.4byte GroundObjectFile_Text
|
||||
.4byte 0x126
|
||||
.4byte GroundObject_Select_Text
|
||||
|
||||
.global gUnknown_81183F0
|
||||
gUnknown_81183F0: @ 81183F0
|
||||
.string "GroundObject Select %3d %3d %3d\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_8118414
|
||||
gUnknown_8118414: @ 8118414
|
||||
.string "GroundObject Cancel %3d\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_811842C
|
||||
gUnknown_811842C: @ 811842C
|
||||
.string "GroundObject CancelBlank\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_8118448
|
||||
gUnknown_8118448: @ 8118448
|
||||
.string "GroundObject Add id %3d kind %3d[%3d] type %3d group %3d sector %3d\0"
|
||||
.align 2,0
|
||||
|
||||
.global GroundObject_AddText
|
||||
GroundObject_AddText: @ AddText
|
||||
.string "GroundObject_Add\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_81184A4
|
||||
gUnknown_81184A4: @ 81184A4
|
||||
.4byte GroundObjectFile_Text
|
||||
.4byte 0x283
|
||||
.4byte GroundObject_AddText
|
||||
|
||||
.global gUnknown_81184B0
|
||||
gUnknown_81184B0: @ 81184B0
|
||||
.string "GroundObject Delete id %3d\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_81184CC
|
||||
gUnknown_81184CC: @ 81184CC
|
||||
.string "GroundObject Execute %3d \0"
|
||||
.align 2,0
|
||||
|
||||
.global GroundObject_ExecuteScript_Text
|
||||
GroundObject_ExecuteScript_Text: @ ExecuteScript
|
||||
.string "GroundObject_ExecuteScript\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_8118504
|
||||
gUnknown_8118504: @ 8118504
|
||||
.4byte GroundObjectFile_Text
|
||||
.4byte 0x303
|
||||
.4byte GroundObject_ExecuteScript_Text
|
||||
|
||||
.global GroundObject_Action_Text
|
||||
GroundObject_Action_Text: @ Action
|
||||
.string "GroundObject_Action\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_8118524
|
||||
gUnknown_8118524: @ 8118524
|
||||
.4byte GroundObjectFile_Text
|
||||
.4byte 0x60D
|
||||
.4byte GroundObject_Action_Text
|
||||
|
||||
.global gUnknown_8118530
|
||||
gUnknown_8118530: @ 8118530
|
||||
.4byte GroundObjectFile_Text
|
||||
.4byte 0x617
|
||||
.4byte GroundObject_Action_Text
|
||||
.string "pksdir0\0"
|
||||
.align 2,0
|
||||
|
||||
.global gGroundEffectCallbacks
|
||||
gGroundEffectCallbacks: @ 8118544
|
||||
@ replacing .incbin "baserom.gba", 0x118544, 0xAE
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.4byte CallbackEffectGetIndex
|
||||
.4byte CallbackEffectGetSize
|
||||
.4byte CallbackEffectGetHitboxCenter
|
||||
.4byte CallbackEffectGetPosHeightAndUnk
|
||||
.4byte CallbackEffectGetDirection
|
||||
.4byte CallbackEffectGetFlags
|
||||
.4byte CallbackEffectSetHitboxPos
|
||||
.4byte CallbackEffectSetPositionBounds
|
||||
.4byte CallbackEffectMoveReal
|
||||
.4byte CallbackEffectSetPosHeight
|
||||
.4byte CallbackEffectSetDirection
|
||||
.4byte CallbackEffectSetEventIndex
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.4byte CallbackEffectSetUnk_80AD670
|
||||
.4byte CallbackEffectSetFlags
|
||||
.4byte CallbackEffectClearFlags
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.4byte CallbackEffectMoveRelative
|
||||
.4byte CallbackEffectSpriteRelatedCheck_80AD690
|
||||
.4byte CallbackEffectSpriteRelated_80AD6B4
|
||||
.byte 0xf6, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.4byte gUnknown_81185D8
|
||||
.byte 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
.global gUnknown_81185D8
|
||||
gUnknown_81185D8: @ 81185D8
|
||||
.string "../ground/ground_effect.c\0"
|
||||
|
||||
.global gUnknown_81185F2
|
||||
gUnknown_81185F2: @ 81185F2
|
||||
@ replacing .incbin "baserom.gba", 0x1185F2, 0x1E
|
||||
.byte 0xff, 0xff, 0x00, 0x08, 0x01, 0x08, 0x00, 0x10, 0x00, 0x00
|
||||
|
||||
.global gUnknown_81185FC
|
||||
gUnknown_81185FC: @ 81185FC
|
||||
.string "GroundEffect_Select\0"
|
||||
.align 2, 0
|
||||
|
||||
.global gUnknown_8118610
|
||||
gUnknown_8118610: @ 8118610
|
||||
.4byte gUnknown_81185D8
|
||||
.4byte 0x106
|
||||
.4byte gUnknown_81185FC
|
||||
|
||||
.global gUnknown_811861C
|
||||
gUnknown_811861C: @ 811861C
|
||||
.string "GroundEffect Select %3d %3d %3d"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_8118640
|
||||
gUnknown_8118640: @ 8118640
|
||||
.string "GroundEffect Cancel %3d"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_8118658
|
||||
gUnknown_8118658: @ 8118658
|
||||
.string "GroundEffect CancelBlank\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_8118674
|
||||
gUnknown_8118674: @ 8118674
|
||||
@ replacing .incbin "baserom.gba", 0x118674, 0x58
|
||||
.string "GroundEffect Add id %3d kind %3d type %3d group %3d sector %3d\0"
|
||||
.align 2, 0
|
||||
|
||||
.global gUnknown_81186B8
|
||||
gUnknown_81186B8: @ 81186B8
|
||||
.string "GroundEffect_Add\0"
|
||||
.align 2, 0
|
||||
|
||||
.global gUnknown_81186CC
|
||||
gUnknown_81186CC: @ 81186CC
|
||||
@ replacing .incbin "baserom.gba", 0x1186CC, 0xC
|
||||
.4byte gUnknown_81185D8
|
||||
.byte 0x10, 0x02, 0x00, 0x00
|
||||
.4byte gUnknown_81186B8
|
||||
|
||||
.global gUnknown_81186D8
|
||||
gUnknown_81186D8: @ 81186D8
|
||||
.string "GroundEffect Delete id %3d"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_81186F4
|
||||
gUnknown_81186F4: @ 81186F4
|
||||
.string "GroundEffect Execute %3d "
|
||||
.align 2,0
|
||||
|
||||
.global GroundEffect_ExecuteScript_Text
|
||||
GroundEffect_ExecuteScript_Text: @ ExecuteScript
|
||||
.string "GroundEffect_ExecuteScript"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_811872C
|
||||
gUnknown_811872C: @ 811872C
|
||||
.4byte gUnknown_81185D8
|
||||
.4byte 0x290
|
||||
.4byte GroundEffect_ExecuteScript_Text
|
||||
|
||||
.global GroundEffect_Action_Text
|
||||
GroundEffect_Action_Text: @ Action
|
||||
.string "GroundEffect_Action\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_811874C
|
||||
gUnknown_811874C: @ 811874C
|
||||
.4byte gUnknown_81185D8
|
||||
.4byte 0x560
|
||||
.4byte GroundEffect_Action_Text
|
||||
|
||||
.global gUnknown_8118758
|
||||
gUnknown_8118758: @ 8118758
|
||||
.4byte gUnknown_81185D8
|
||||
.4byte 0x56A
|
||||
.4byte GroundEffect_Action_Text
|
||||
.string "pksdir0\0"
|
||||
.align 2,0
|
||||
@ Ground Link
|
||||
|
||||
.global GroundLink_FileText
|
||||
GroundLink_FileText: @ FileText
|
||||
.string "../ground/ground_link.c\0"
|
||||
.align 2,0
|
||||
|
||||
.global GroundLink_SelectText
|
||||
GroundLink_SelectText: @ SelectText
|
||||
.string "GroundLink_Select\0"
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_8118798
|
||||
gUnknown_8118798: @ 8118798
|
||||
.4byte GroundLink_FileText
|
||||
.byte 0x4D, 0x00, 0x00, 0x00
|
||||
.4byte GroundLink_SelectText
|
||||
File diff suppressed because it is too large
Load Diff
9
data/pksdir_6.s
Normal file
9
data/pksdir_6.s
Normal file
@@ -0,0 +1,9 @@
|
||||
.section .rodata
|
||||
|
||||
.align 2, 0
|
||||
|
||||
|
||||
@ ???
|
||||
.string "pksdir0\0"
|
||||
.align 2, 0
|
||||
|
||||
@@ -9,6 +9,13 @@ typedef struct DebugLocation
|
||||
/* 0x8 */ const u8 *func;
|
||||
} DebugLocation;
|
||||
|
||||
// Macros for easier FatalError handling. FATAL_ERROR should be used as it gets the file, line and function name from gcc, however for matching purposes we always explicitly use FATAL_ERROR_ARGS
|
||||
|
||||
#define DEBUG_LOC_PTR(file, line, func)((&((DebugLocation){file, line, func})))
|
||||
|
||||
#define FATAL_ERROR_ARGS(file, line, str, ...) FatalError(DEBUG_LOC_PTR(file, line, __func__), str, __VA_ARGS__ )
|
||||
#define FATAL_ERROR(str, ...) FATAL_ERROR_ARGS(__FILE__, __LINE__, str, __VA_ARGS__)
|
||||
|
||||
void FatalError(const DebugLocation *debug, const char *text, ...) NORETURN;
|
||||
void Log(u8 num, const u8 *text, ...);
|
||||
void NDS_DebugInit(void);
|
||||
|
||||
@@ -1,12 +1,49 @@
|
||||
#ifndef GUARD_GROUND_SPRITE_H
|
||||
#define GUARD_GROUND_SPRITE_H
|
||||
|
||||
#include "structs/axdata.h"
|
||||
#include "structs/sprite_oam.h"
|
||||
#include "structs/str_position.h"
|
||||
|
||||
// TODO: Clean up these structs
|
||||
|
||||
struct UnkGroundSpriteSubStructx48
|
||||
{
|
||||
s16 unk0;
|
||||
u16 unk2;
|
||||
axmain *axmain;
|
||||
};
|
||||
|
||||
// size: 0x80 (probably the last sub-struct of GroundLives)
|
||||
struct UnkGroundSpriteStruct
|
||||
{
|
||||
axdata axdata;
|
||||
unkStruct_2039DB0 unk3C;
|
||||
struct UnkGroundSpriteSubStructx48 unk48;
|
||||
u16 flags_0x50;
|
||||
s16 unk52;
|
||||
OpenedFile *unk54;
|
||||
s16 unk58;
|
||||
u8 unk5A;
|
||||
s32 unk5C;
|
||||
s32 unk60;
|
||||
s16 unk64;
|
||||
s16 unk66;
|
||||
u16 unk68;
|
||||
s16 unk6A;
|
||||
u16 unk6C;
|
||||
s16 unk6E;
|
||||
u8 unk70;
|
||||
PixelPos unk74;
|
||||
s32 unk7C;
|
||||
};
|
||||
|
||||
// size: 0xC
|
||||
typedef struct unkStruct_3001B7C_sub0
|
||||
{
|
||||
u32 unk0;
|
||||
s32 unk4;
|
||||
u32 unk8;
|
||||
struct UnkGroundSpriteStruct *unk8;
|
||||
} unkStruct_3001B7C_sub0;
|
||||
|
||||
// size: 0x4
|
||||
@@ -16,13 +53,24 @@ typedef struct unkStruct_3001B7C_sub108
|
||||
s16 unk2;
|
||||
} unkStruct_3001B7C_sub108;
|
||||
|
||||
#define UNK_3001B7C_SUB0_COUNT 22
|
||||
#define UNK_3001B7C_SUB108_COUNT 2
|
||||
|
||||
// size: 0x110
|
||||
typedef struct unkStruct_3001B7C
|
||||
{
|
||||
unkStruct_3001B7C_sub0 unk0[22];
|
||||
unkStruct_3001B7C_sub108 unk108[2];
|
||||
unkStruct_3001B7C_sub0 unk0[UNK_3001B7C_SUB0_COUNT];
|
||||
unkStruct_3001B7C_sub108 unk108[UNK_3001B7C_SUB108_COUNT];
|
||||
} unkStruct_3001B7C;
|
||||
|
||||
void GroundSprite_Reset(s16);
|
||||
void GroundSprite_Reset(s32);
|
||||
void GroundSprite_ExtendPaletteAdd(struct UnkGroundSpriteStruct *ptr, u16);
|
||||
void GroundSprite_ExtendPaletteDelete(struct UnkGroundSpriteStruct *ptr);
|
||||
void sub_80A67CC(struct UnkGroundSpriteStruct *ptr, struct UnkGroundSpriteSubStructx48 *a1, s32 a2);
|
||||
void sub_80A68A0(struct UnkGroundSpriteStruct *ptr);
|
||||
void sub_80A6EFC(struct UnkGroundSpriteStruct *ptr, s32 a1_, s32 a2_);
|
||||
void sub_80A7040(struct UnkGroundSpriteStruct *ptr, s32 a1_, s32 a2_, s32 a3);
|
||||
bool8 sub_80A7094(struct UnkGroundSpriteStruct *ptr, PixelPos *r10, PixelPos *posArg, s32 a3);
|
||||
bool8 sub_80A7310(struct UnkGroundSpriteStruct *ptr, PixelPos *posArg1, PixelPos *posArg2, s32 a3);
|
||||
|
||||
#endif // GUARD_GROUND_SPRITE_H
|
||||
#endif // GUARD_GROUND_SPRITE_H
|
||||
|
||||
15
include/ground_sprite_data.h
Normal file
15
include/ground_sprite_data.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef GUARD_GROUND_SPRITE_DATA_H
|
||||
#define GUARD_GROUND_SPRITE_DATA_H
|
||||
|
||||
struct GroundObjectKind
|
||||
{
|
||||
s8 unk0;
|
||||
u16 unk2;
|
||||
const char *fileName;
|
||||
};
|
||||
|
||||
extern const char *const gUnknown_81178F4[];
|
||||
extern const struct GroundObjectKind gGroundObjectKinds[];
|
||||
extern const struct GroundObjectKind gUnknown_8117E8C[];
|
||||
|
||||
#endif // GUARD_GROUND_SPRITE_DATA_H
|
||||
@@ -53,7 +53,7 @@ void sub_8005180(void);
|
||||
void sub_8005304(void);
|
||||
void sub_8005610(OpenedFile *, s32 vramIdx, s32 brightness, const RGB *ramp);
|
||||
const RGB *sub_8005674(const EfoFileData *, s32 vramIdx);
|
||||
void sub_800569C(DungeonPos *, axObject *, u8);
|
||||
void sub_800569C(DungeonPos *, axdata *, u8);
|
||||
void sub_8005700(DungeonPos *, axObject *);
|
||||
void sub_8005770(s32, const RGB *color, s32 brightness, const RGB *ramp);
|
||||
|
||||
|
||||
@@ -100,32 +100,6 @@ typedef struct axObject
|
||||
} info;
|
||||
} axObject;
|
||||
|
||||
// size: 0x80? (assuming it's the last sub-struct of GroundLives)
|
||||
typedef struct axPokemon
|
||||
{
|
||||
axObject obj;
|
||||
/* 0x4C */ axmain *axmain;
|
||||
u16 flags_0x50;
|
||||
s16 unk52;
|
||||
u8 fill54[0x58 - 0x54];
|
||||
u16 unk58;
|
||||
u8 unk5A;
|
||||
// 1b padding
|
||||
s32 unk5C;
|
||||
s32 unk60;
|
||||
u8 fill64[0x66 - 0x64];
|
||||
s16 unk66;
|
||||
s16 unk68;
|
||||
s16 unk6A;
|
||||
u16 unk6C;
|
||||
u16 unk6E;
|
||||
u8 unk70;
|
||||
u8 fill71[0x74 - 0x71];
|
||||
s32 unk74;
|
||||
s32 unk78;
|
||||
s32 unk7C;
|
||||
} axPokemon;
|
||||
|
||||
typedef struct Palette256
|
||||
{
|
||||
RGB pal[256];
|
||||
|
||||
@@ -346,8 +346,10 @@ SECTIONS {
|
||||
asm/code_80A59DC.o(.text);
|
||||
src/ground_map_2.o(.text);
|
||||
src/ground_sprite.o(.text);
|
||||
asm/ground_sprite.o(.text);
|
||||
src/code_80A7714.o(.text);
|
||||
src/ground_sprite_data.o(.text);
|
||||
src/ground_sprite_monster.o(.text);
|
||||
src/ground_sprite_util.o(.text);
|
||||
src/ground_script_file.o(.text);
|
||||
src/ground_lives.o(.text);
|
||||
asm/ground_lives.o(.text);
|
||||
src/ground_object.o(.text);
|
||||
@@ -696,6 +698,13 @@ SECTIONS {
|
||||
data/data_8115F5C.o(.rodata);
|
||||
src/code_809A560.o(.rodata);
|
||||
data/data_8115F5C_2.o(.rodata);
|
||||
src/ground_sprite.o(.rodata);
|
||||
src/ground_sprite_data.o(.rodata);
|
||||
src/ground_sprite_monster.o(.rodata);
|
||||
src/ground_sprite_util.o(.rodata);
|
||||
data/pksdir_6.o(.rodata);
|
||||
src/ground_script_file.o(.rodata);
|
||||
data/data_8115F5C_1.o(.rodata);
|
||||
src/ground_event.o(.rodata);
|
||||
src/unk_dungeon_load_maybe.o(.rodata);
|
||||
data/data_8115F5C_3.o(.rodata);
|
||||
|
||||
@@ -100,7 +100,7 @@ static void sub_8040C4C(Entity *entity, Move *move, bool32 a2)
|
||||
s32 r2 = sub_800E710(apparentId, sub_80412E0(move->id, GetApparentWeather(entity), TRUE));
|
||||
|
||||
if (r2 != -1) {
|
||||
sub_800569C(&sp.unk8, &entity->axObj, r2);
|
||||
sub_800569C(&sp.unk8, &entity->axObj.axdata, r2);
|
||||
}
|
||||
else {
|
||||
sp.unk8 = (DungeonPos) {0};
|
||||
@@ -252,7 +252,7 @@ static void sub_8041038(struct UnkStruct_8040094 *a0, Entity *entity, Move *move
|
||||
s32 r2 = sub_800E710(entInfo->apparentID, sub_80412E0(move->id, GetApparentWeather(entity), a2));
|
||||
|
||||
if (r2 != -1) {
|
||||
sub_800569C(&a0->unk8, &entity->axObj, r2);
|
||||
sub_800569C(&a0->unk8, &entity->axObj.axdata, r2);
|
||||
}
|
||||
else {
|
||||
a0->unk8 = (DungeonPos) {0};
|
||||
@@ -312,7 +312,7 @@ void sub_8041168(Entity *entity, Entity *entity2, Move *move, DungeonPos *pos)
|
||||
var2 = sub_800ECA4(var)->unk1c;
|
||||
if (var2 != -1) {
|
||||
if (EntityIsValid(entity2)) {
|
||||
sub_800569C(&sp.unk8, &entity2->axObj, var2);
|
||||
sub_800569C(&sp.unk8, &entity2->axObj.axdata, var2);
|
||||
}
|
||||
else {
|
||||
sp.unk8 = (DungeonPos) {0};
|
||||
|
||||
@@ -229,7 +229,7 @@ s32 sub_8041550(Entity *entity, s32 a1, u8 a2, u8 a3, s32 a4, u8 a5)
|
||||
sub_804178C(a4 == 2);
|
||||
}
|
||||
|
||||
sub_800569C(&pos, &entity->axObj, a3);
|
||||
sub_800569C(&pos, &entity->axObj.axdata, a3);
|
||||
if (pos.x != 99 && pos.y != 99) {
|
||||
pixelPos.x = entity->pixelPos.x + (pos.x << 8);
|
||||
pixelPos.y = (entity->pixelPos.y + (pos.y << 8)) - entInfo->unk174.raw;
|
||||
@@ -1718,7 +1718,7 @@ void sub_8042EC8(Entity *a0, s32 a1)
|
||||
|
||||
if (strPtr->unk8 != -1) {
|
||||
sub_800569C(&sp4,
|
||||
&a0->axObj,
|
||||
&a0->axObj.axdata,
|
||||
strPtr->unk8);
|
||||
}
|
||||
|
||||
|
||||
@@ -1489,7 +1489,7 @@ s32 sub_80861F8(s32 param_1,Entity *param_2,bool32 param_3)
|
||||
pos.y = 0;
|
||||
uStack_38 = sub_800E700(param_1Copy);
|
||||
if (uStack_38 != -1) {
|
||||
sub_800569C(&pos, ¶m_2->axObj, uStack_38);
|
||||
sub_800569C(&pos, ¶m_2->axObj.axdata, uStack_38);
|
||||
}
|
||||
stack.unk0 = param_1Copy;
|
||||
stack.unk4 = 0;
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "structs/axdata.h"
|
||||
|
||||
extern void sub_80A68A0(u32);
|
||||
extern void sub_80A7094(axPokemon *, u32, u32, u32);
|
||||
extern void sub_80A7310(axPokemon *, u32, u32, u32);
|
||||
extern void ResetCurrentScriptFile();
|
||||
|
||||
static EWRAM_DATA s16 sUnknown_2039DE0 = {0};
|
||||
|
||||
extern const struct GroundScriptHeader gNullGroundScript;
|
||||
extern const struct GroundScriptHeader *gMapScriptTable[]; // 811E2F8
|
||||
|
||||
void sub_80A7714(u32 a0)
|
||||
{
|
||||
sub_80A68A0(a0);
|
||||
}
|
||||
|
||||
void sub_80A7720(axPokemon *a0, u32 a1, u32 a2)
|
||||
{
|
||||
sub_80A7094(a0, 0, a1, a2);
|
||||
sub_80A7310(a0, a1, 0, a2);
|
||||
}
|
||||
|
||||
void sub_80A7744(void)
|
||||
{
|
||||
sUnknown_2039DE0 = -1;
|
||||
}
|
||||
|
||||
void sub_80A7754(void)
|
||||
{
|
||||
sUnknown_2039DE0 = -1;
|
||||
}
|
||||
|
||||
void SetCurrentScriptFile(s16 a0)
|
||||
{
|
||||
s32 temp = a0;
|
||||
|
||||
ResetCurrentScriptFile();
|
||||
|
||||
if (temp != -1)
|
||||
sUnknown_2039DE0 = temp;
|
||||
}
|
||||
|
||||
void ResetCurrentScriptFile(void)
|
||||
{
|
||||
if (sUnknown_2039DE0 != -1)
|
||||
sUnknown_2039DE0 = -1;
|
||||
}
|
||||
|
||||
bool8 ChangeScriptFile(s16 a0)
|
||||
{
|
||||
s32 temp;
|
||||
s32 temp2;
|
||||
temp = a0;
|
||||
temp2 = temp;
|
||||
if (sUnknown_2039DE0 != temp) {
|
||||
if (temp < 0)
|
||||
ResetCurrentScriptFile();
|
||||
else
|
||||
SetCurrentScriptFile(temp2);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
const struct GroundScriptHeader *GetGroundScript(s16 a0)
|
||||
{
|
||||
if (a0 != -1)
|
||||
return gMapScriptTable[a0];
|
||||
else
|
||||
return &gNullGroundScript;
|
||||
}
|
||||
@@ -175,7 +175,3 @@ const struct GroundEventTableEntry gGroundEnterLookupTable[58] = {
|
||||
{ 161, 57},
|
||||
{ -1, 0},
|
||||
};
|
||||
|
||||
ALIGNED(4) const u8 gScenarioCalcLogString[] = "SCENARIO CALC [%3d] %4d %4d -> %4d %4d";
|
||||
|
||||
ALIGNED(4) const u8 EventFlagFile_Text[] = "../main/event_flag.c";
|
||||
|
||||
@@ -567,7 +567,7 @@ s32 sub_8056564(Entity *entity, DungeonPos *pos, Move *move, s32 r4)
|
||||
DungeonRunFrameActions(0x5E);
|
||||
someRetVal = sub_800E710(entInfo->apparentID, sub_80412E0(move->id, GetApparentWeather(entity), 1));
|
||||
if (someRetVal != -1) {
|
||||
sub_800569C(&unkSp1.unk8, &entity->axObj, someRetVal);
|
||||
sub_800569C(&unkSp1.unk8, &entity->axObj.axdata, someRetVal);
|
||||
}
|
||||
else {
|
||||
unkSp1.unk8 = (DungeonPos) {0};
|
||||
|
||||
@@ -463,7 +463,7 @@ void ScenarioCalc(s16 param_1,s32 param_2,s32 param_3)
|
||||
|
||||
param_1_s32 = param_1;
|
||||
GetScriptVarScenario(param_1_s32,&local_18,&local_14);
|
||||
Log(6,gScenarioCalcLogString,param_1_s32,local_18,local_14,param_2,param_3); // SCENARIO CALC [%3d] %4d %4d -> %4d %4d
|
||||
Log(6,"SCENARIO CALC [%3d] %4d %4d -> %4d %4d",param_1_s32,local_18,local_14,param_2,param_3);
|
||||
if ((param_1_s32 == 3) && ((param_2 != local_18 || (param_3 != local_14)))) {
|
||||
SetScriptVarValue(NULL,CLEAR_COUNT,0);
|
||||
}
|
||||
@@ -650,14 +650,6 @@ void sub_8001D88(void)
|
||||
}
|
||||
}
|
||||
|
||||
ALIGNED(4) static const u8 sFlagCalc_Text[] = "_FlagCalc";
|
||||
|
||||
static const DebugLocation sFlagCalcDebugLocation = {
|
||||
EventFlagFile_Text,
|
||||
0x551,
|
||||
sFlagCalc_Text
|
||||
};
|
||||
|
||||
// arm9.bin::0200EC08
|
||||
s32 _FlagCalc(s32 param_1, s32 param_2, enum FlagCalcOperation operation)
|
||||
{
|
||||
@@ -687,18 +679,10 @@ s32 _FlagCalc(s32 param_1, s32 param_2, enum FlagCalcOperation operation)
|
||||
case CALC_RANDOM:
|
||||
return OtherRandInt(param_2);
|
||||
default:
|
||||
FatalError(&sFlagCalcDebugLocation,"event flag expansion error %d", operation); // event flag expansion error %d
|
||||
FATAL_ERROR_ARGS("../main/event_flag.c", 1361, "event flag expansion error %d", operation);
|
||||
}
|
||||
}
|
||||
|
||||
ALIGNED(4) static const u8 sFlagJudge_Text[] = "_FlagJudge";
|
||||
|
||||
static const DebugLocation sFlagJudgeDebugLocation = {
|
||||
EventFlagFile_Text,
|
||||
0x57C,
|
||||
sFlagJudge_Text
|
||||
};
|
||||
|
||||
// arm9.bin::0200EAE4
|
||||
bool8 _FlagJudge(s32 param_1, s32 param_2, enum FlagJudgeOperation operation)
|
||||
{
|
||||
@@ -726,7 +710,7 @@ bool8 _FlagJudge(s32 param_1, s32 param_2, enum FlagJudgeOperation operation)
|
||||
case JUDGE_BIT_SET:
|
||||
return param_1 >> (param_2) & 1;
|
||||
default:
|
||||
FatalError(&sFlagJudgeDebugLocation,"event flag rule error %d", operation); // event flag rule error %d
|
||||
FATAL_ERROR_ARGS("../main/event_flag.c", 1404, "event flag rule error %d", operation);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -144,8 +144,6 @@ struct TestStruct
|
||||
s32 unk4;
|
||||
};
|
||||
|
||||
extern struct TestStruct sUnknown; // Todo: figure out or guess what this variable could be.
|
||||
|
||||
s32 GroundEvent_Add(s32 id, const GroundEventData *eventData, s32 group, s32 sector)
|
||||
{
|
||||
s32 i;
|
||||
@@ -194,11 +192,7 @@ s32 GroundEvent_Add(s32 id, const GroundEventData *eventData, s32 group, s32 sec
|
||||
break;
|
||||
}
|
||||
|
||||
// The line below effectively does nothing(it's not even generated in the asm, agbcc ignores it, but changes regalloc...), because 'r' is overwritten in the next two instructions, however it is REQUIRED to match. Only discovered, because it's present in Blue's asm.
|
||||
r = sUnknown;
|
||||
|
||||
r.unk0 = eventData->kind << 11;
|
||||
r.unk4 = eventData->unk1 << 11;
|
||||
r = (struct TestStruct) {eventData->kind << 11, eventData->unk1 << 11};
|
||||
SetUnkInGroundEvent(&eventData->pos, sp);
|
||||
|
||||
ptr->unkC = sp[0];
|
||||
|
||||
@@ -245,8 +245,6 @@ void sub_80AC1B0(s16, s32);
|
||||
void sub_80AD0C8(s16, s32);
|
||||
s32 sub_80A5984();
|
||||
void sub_80A59A0(s32, s32 *, u16);
|
||||
void GroundSprite_ExtendPaletteAdd(u32, u16);
|
||||
void GroundSprite_ExtendPaletteDelete(u32);
|
||||
extern void sub_80997F4(u16, u16);
|
||||
s32 sub_809CFE8(u16 param_1);
|
||||
extern bool8 sub_80A579C(PixelPos *a0, PixelPos *a1);
|
||||
@@ -3157,7 +3155,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
if (dungLocation.id == DUNGEON_HOWLING_FOREST_2 && ret == 0x104) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
ret2 = sub_80A90C8((action->unkC).arr[1]);
|
||||
InlineStrcpy(text, gFriendAreaDialogue[ret2]);
|
||||
if (ScriptPrintText(0, 1, text) != 0)
|
||||
@@ -3184,7 +3182,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
return sub_8097640() ? 1 : 0;
|
||||
break;
|
||||
case 0xE:
|
||||
{
|
||||
{
|
||||
s32 index;
|
||||
for(index = 0x11; index < NUM_DUNGEON_MAZE; index++)
|
||||
{
|
||||
@@ -3218,11 +3216,11 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
case 0x13:
|
||||
{
|
||||
PokemonStruct1 *ptr;
|
||||
|
||||
|
||||
ptr = sub_80A8D54(r2);
|
||||
if(ptr)
|
||||
return PokemonFlag2(ptr);
|
||||
@@ -3244,7 +3242,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
r4 = (r3 << 8);
|
||||
action->callbacks->getHitboxCenter(action->parentObject, &sp_318);
|
||||
sub_80A8FD8(r5, &sp_320);
|
||||
|
||||
|
||||
if(sp_318.x - r4 <= sp_320.x
|
||||
&& sp_318.x + r4 >= sp_320.x
|
||||
&& sp_318.y - r4 <= sp_320.y
|
||||
@@ -3282,8 +3280,8 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
PokemonStruct1 sp_2c;
|
||||
PokemonStruct1 *ptr;
|
||||
s32 index;
|
||||
|
||||
|
||||
|
||||
|
||||
UnlockFriendArea(GetFriendArea(MONSTER_MAGNEMITE));
|
||||
sp_4 = gUnknown_8116710;
|
||||
sub_808D144(&sp_2c, &sp_4);
|
||||
@@ -3308,7 +3306,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
PokemonStruct1 *pokemon;
|
||||
struct unkStruct_808D144 sp_84;
|
||||
PokemonStruct1 sp_ac;
|
||||
|
||||
|
||||
UnlockFriendArea(GetFriendArea(MONSTER_ABSOL));
|
||||
sp_84 = gUnknown_8116738;
|
||||
sub_808D144(&sp_ac, &sp_84);
|
||||
@@ -3335,14 +3333,14 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
case 0x1E:
|
||||
sub_80A8F50(gUnknown_2039D98, 0x7C, POKEMON_NAME_LENGTH);
|
||||
return 0;
|
||||
|
||||
|
||||
case 0x1F:
|
||||
{
|
||||
PokemonStruct1 *pokemon;
|
||||
s32 index;
|
||||
struct unkStruct_808D144 sp_108;
|
||||
PokemonStruct1 sp_130;
|
||||
|
||||
|
||||
sp_108 = gUnknown_8116760;
|
||||
sub_808D144(&sp_130, &sp_108);
|
||||
pokemon = sub_808D1DC(&sp_130);
|
||||
@@ -3354,7 +3352,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
sub_80922B4(gFormatBuffer_Names[r2], gUnknown_2039D98, POKEMON_NAME_LENGTH);
|
||||
IncrementAdventureNumJoined();
|
||||
return 0;
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -3379,7 +3377,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case 0x21:
|
||||
if(HasRecruitedMon(MONSTER_ARTICUNO))
|
||||
@@ -3390,7 +3388,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
case 0x22:
|
||||
{
|
||||
PokemonStruct1 *pokemon = GetPlayerPokemonStruct();
|
||||
|
||||
|
||||
if(pokemon->speciesNum != MONSTER_ARTICUNO && pokemon->speciesNum != MONSTER_ZAPDOS && pokemon->speciesNum != MONSTER_MOLTRES)
|
||||
return 1;
|
||||
}
|
||||
@@ -3415,7 +3413,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
s32 index;
|
||||
struct unkStruct_808D144 sp_188;
|
||||
PokemonStruct1 sp_1b0;
|
||||
|
||||
|
||||
if(!GetFriendAreaStatus(GetFriendArea(MONSTER_LATIOS)))
|
||||
UnlockFriendArea(GetFriendArea(MONSTER_LATIOS));
|
||||
sp_188 = gUnknown_8116794;
|
||||
@@ -3429,7 +3427,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
IncrementAdventureNumJoined();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case 0x26:
|
||||
sub_80A8F50(gUnknown_2039D98, 0x7A, POKEMON_NAME_LENGTH);
|
||||
@@ -3440,7 +3438,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
s32 index;
|
||||
struct unkStruct_808D144 sp_208;
|
||||
PokemonStruct1 sp_230;
|
||||
|
||||
|
||||
sp_208 = gUnknown_81167BC;
|
||||
sub_808D144(&sp_230, &sp_208);
|
||||
pokemon = sub_808D1DC(&sp_230);
|
||||
@@ -3463,7 +3461,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
if(IsNotMoneyOrUsedTMItem(id))
|
||||
if(gTeamInventoryRef->teamStorage[id] < 999)
|
||||
gTeamInventoryRef->teamStorage[id] += 1;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3527,7 +3525,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
|| indexS16 == MONSTER_REGICE
|
||||
|| indexS16 == MONSTER_REGISTEEL
|
||||
|| indexS16 == MONSTER_CELEBI
|
||||
)
|
||||
)
|
||||
continue;
|
||||
if(!IsExclusivePokemonUnlocked(index)) continue;
|
||||
if(GetFriendAreaStatus(GetFriendArea(index))) {
|
||||
@@ -3540,7 +3538,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
if (r4 < 0)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
SetScriptVarValue(NULL, NEW_FRIEND_KIND, index);
|
||||
WriteFriendAreaName(gFormatBuffer_FriendArea, GetFriendArea(index), FALSE);
|
||||
if (GetFriendAreaStatus(GetFriendArea(index)) != 0)
|
||||
@@ -3552,7 +3550,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
{
|
||||
s32 id = (s16) GetScriptVarValue(0, NEW_FRIEND_KIND);
|
||||
WriteFriendAreaName(gFormatBuffer_FriendArea,(GetFriendArea(id)), FALSE);
|
||||
if (id == 0)
|
||||
if (id == 0)
|
||||
return 0;
|
||||
else if(GetFriendAreaStatus(GetFriendArea(id)) != 0)
|
||||
return 1;
|
||||
@@ -3572,15 +3570,15 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
s32 id = (s16) GetScriptVarValue(0, NEW_FRIEND_KIND);
|
||||
s32 matchMe = id;
|
||||
WriteFriendAreaName(gFormatBuffer_FriendArea,(GetFriendArea((s16) id)), FALSE);
|
||||
if(id == 0)
|
||||
if(id == 0)
|
||||
return 0;
|
||||
|
||||
|
||||
if(!GetFriendAreaStatus(GetFriendArea(id)))
|
||||
UnlockFriendArea(GetFriendArea(id));
|
||||
pokemon = sub_808D2E8(matchMe, NULL ,ITEM_NOTHING, &gUnknown_81167E8, MOVE_NOTHING);
|
||||
if(pokemon == NULL)
|
||||
return 0;
|
||||
|
||||
|
||||
for(index = 0; index < POKEMON_NAME_LENGTH; index++)
|
||||
pokemon->name[index] = gUnknown_2039D98[index];
|
||||
IncrementAdventureNumJoined();
|
||||
@@ -3632,7 +3630,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
return 0;
|
||||
|
||||
case 0x32:
|
||||
{
|
||||
{
|
||||
struct unkStruct_808D144 sp_288;
|
||||
PokemonStruct1 sp_2b0;
|
||||
sp_288 = gUnknown_811681C;
|
||||
@@ -3654,7 +3652,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
{
|
||||
if(OtherRandInt(0x100) == 0)
|
||||
{
|
||||
SetScriptVarArrayValue(0, EVENT_GONBE, 0, 4);
|
||||
SetScriptVarArrayValue(0, EVENT_GONBE, 0, 4);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
@@ -3663,7 +3661,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
||||
case 0x34:
|
||||
{
|
||||
s32 index;
|
||||
@@ -3677,7 +3675,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
if(IsNotMoneyOrUsedTMItem(id))
|
||||
if(gTeamInventoryRef->teamStorage[id] < 999)
|
||||
gTeamInventoryRef->teamStorage[id] += 1;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3760,7 +3758,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
PixelPos sp_348;
|
||||
PixelPos sp_350;
|
||||
PixelPos sp_358;
|
||||
|
||||
|
||||
sp_308.kind = 1;
|
||||
sp_308.unk1 = 0;
|
||||
sp_308.width = 1;
|
||||
@@ -3815,7 +3813,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
if(held & B_BUTTON) {
|
||||
to = 4;
|
||||
}
|
||||
|
||||
|
||||
for(index = 0; index < to; index++)
|
||||
{
|
||||
if(action->callbacks->moveRelative(action->parentObject, &sp_368) != 0)
|
||||
@@ -3827,13 +3825,13 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
action->callbacks->moveRelative(action->parentObject, &pixelPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 0x40:
|
||||
sub_80993C0(r2 == 0 ? 0 : 1);
|
||||
return 0;
|
||||
@@ -3848,7 +3846,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
return 0;
|
||||
case 0x43:
|
||||
gUnknown_2039DA8 = GetCurrentBGSong();
|
||||
if(gUnknown_2039DA8 != STOP_BGM)
|
||||
if(gUnknown_2039DA8 != STOP_BGM)
|
||||
return 1;
|
||||
return 0;
|
||||
case 0x44:
|
||||
@@ -3892,7 +3890,7 @@ s32 sub_80A14E8(Action *action, u8 idx, u32 r2, s32 r3)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void GroundScript_Unlock(void)
|
||||
void GroundScript_Unlock(void)
|
||||
{
|
||||
s32 index;
|
||||
bool8 cond;
|
||||
|
||||
61
src/ground_script_file.c
Normal file
61
src/ground_script_file.c
Normal file
@@ -0,0 +1,61 @@
|
||||
#include "global.h"
|
||||
#include "globaldata.h"
|
||||
#include "ground_script.h"
|
||||
|
||||
static EWRAM_DATA s16 sScriptFileId = {0};
|
||||
|
||||
extern const struct GroundScriptHeader *gMapScriptTable[]; // 811E2F8
|
||||
|
||||
static void ResetCurrentScriptFile(void);
|
||||
|
||||
void sub_80A7744(void)
|
||||
{
|
||||
sScriptFileId = -1;
|
||||
}
|
||||
|
||||
void sub_80A7754(void)
|
||||
{
|
||||
sScriptFileId = -1;
|
||||
}
|
||||
|
||||
void SetCurrentScriptFile(s16 a0)
|
||||
{
|
||||
s32 temp = a0;
|
||||
|
||||
ResetCurrentScriptFile();
|
||||
|
||||
if (temp != -1)
|
||||
sScriptFileId = temp;
|
||||
}
|
||||
|
||||
void ResetCurrentScriptFile(void)
|
||||
{
|
||||
if (sScriptFileId != -1)
|
||||
sScriptFileId = -1;
|
||||
}
|
||||
|
||||
bool8 ChangeScriptFile(s16 a0)
|
||||
{
|
||||
s32 temp;
|
||||
s32 temp2;
|
||||
temp = a0;
|
||||
temp2 = temp;
|
||||
if (sScriptFileId != temp) {
|
||||
if (temp < 0)
|
||||
ResetCurrentScriptFile();
|
||||
else
|
||||
SetCurrentScriptFile(temp2);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static const struct GroundScriptHeader sNullGroundScript = {0};
|
||||
|
||||
const struct GroundScriptHeader *GetGroundScript(s16 a0)
|
||||
{
|
||||
if (a0 != -1)
|
||||
return gMapScriptTable[a0];
|
||||
else
|
||||
return &sNullGroundScript;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "gba/defines.h"
|
||||
#include "global.h"
|
||||
#include "globaldata.h"
|
||||
#include "structs/axdata.h"
|
||||
#include "code_800DAC0.h"
|
||||
#include "debug.h"
|
||||
@@ -7,27 +7,23 @@
|
||||
#include "file_system.h"
|
||||
#include "ground_map_1.h"
|
||||
#include "ground_sprite.h"
|
||||
#include "ground_sprite_data.h"
|
||||
#include "memory.h"
|
||||
#include "sprite.h"
|
||||
#include "code_800ED38.h"
|
||||
|
||||
IWRAM_INIT unkStruct_3001B7C *gUnknown_3001B7C = {NULL};
|
||||
static IWRAM_INIT unkStruct_3001B7C *gUnknown_3001B7C = {NULL};
|
||||
|
||||
EWRAM_DATA unkStruct_2039DB0 gUnknown_2039DB0 = {0};
|
||||
EWRAM_DATA u32 sUnknown_2039DBC = {0}; // Unused, for alignment
|
||||
EWRAM_DATA unkStruct_2039DB0 gUnknown_2039DC0 = {0};
|
||||
EWRAM_DATA u16 gUnknown_2039DCC = {0};
|
||||
EWRAM_DATA u16 gUnknown_2039DCE = {0};
|
||||
EWRAM_DATA u8 gUnknown_2039DD0 = {0};
|
||||
EWRAM_DATA u8 gUnknown_2039DD1[3] = {0, 0, 0}; // Unused, for alignment
|
||||
EWRAM_DATA u32 gUnknown_2039DD4 = {0};
|
||||
static EWRAM_DATA unkStruct_2039DB0 gUnknown_2039DB0 = {0};
|
||||
UNUSED static EWRAM_DATA u32 sUnknown_2039DBC = {0}; // Unused, for alignment
|
||||
static EWRAM_DATA unkStruct_2039DB0 gUnknown_2039DC0 = {0};
|
||||
static EWRAM_DATA u16 gUnknown_2039DCC = {0};
|
||||
static EWRAM_DATA u16 gUnknown_2039DCE = {0};
|
||||
static EWRAM_DATA u8 gUnknown_2039DD0 = {0};
|
||||
static EWRAM_DATA u32 gUnknown_2039DD4 = {0};
|
||||
static EWRAM_DATA PixelPos gUnknown_2039DD8 = {0};
|
||||
|
||||
EWRAM_INIT OpenedFile *gUnknown_203B4B4 = {NULL};
|
||||
|
||||
// data_8115F5C.s
|
||||
extern const u8 gUnknown_81177CC[];
|
||||
extern const u8 gUnknown_81177D8[];
|
||||
extern const u8 gUnknown_81177EC[];
|
||||
extern const u8 *gUnknown_81178F4[];
|
||||
static EWRAM_INIT OpenedFile *gUnknown_203B4B4 = {NULL};
|
||||
|
||||
// code_8098BDC.s
|
||||
extern void sub_809971C(u16, const u8 *, s16);
|
||||
@@ -35,8 +31,17 @@ extern void sub_80997F4(u16, u16);
|
||||
// pokemon_2.s
|
||||
extern void InitShadowSprites(u32, u32);
|
||||
|
||||
// ground_sprite.s
|
||||
extern void sub_80A6460(void);
|
||||
extern void sub_80ABA7C(void);
|
||||
extern void sub_80ACAD4(void);
|
||||
extern void sub_80AD7AC(void);
|
||||
extern void sub_800E970(void);
|
||||
extern u8 sub_809D248(PixelPos *r0);
|
||||
|
||||
static bool8 sub_80A68F8(struct UnkGroundSpriteStruct *ptr, struct UnkGroundSpriteSubStructx48 *a1, s32 a2);
|
||||
static bool8 sub_80A6CF4(struct UnkGroundSpriteSubStructx48 *a0);
|
||||
static void sub_80A69FC(struct UnkGroundSpriteStruct *ptr);
|
||||
static void sub_80A6460(void);
|
||||
static void sub_80A72B8(struct UnkGroundSpriteStruct *ptr, bool8 a1);
|
||||
|
||||
void sub_80A62F0(void)
|
||||
{
|
||||
@@ -46,7 +51,7 @@ void sub_80A62F0(void)
|
||||
s32 r6;
|
||||
|
||||
gUnknown_3001B7C = MemoryAlloc(sizeof(unkStruct_3001B7C), 6);
|
||||
gUnknown_203B4B4 = OpenFileAndGetFileDataPtr(gUnknown_81177CC, &gDungeonFileArchive);
|
||||
gUnknown_203B4B4 = OpenFileAndGetFileDataPtr("etcfonta", &gDungeonFileArchive);
|
||||
|
||||
sub_800DAC0(1);
|
||||
|
||||
@@ -71,53 +76,45 @@ void sub_80A62F0(void)
|
||||
GroundSprite_Reset(-1);
|
||||
}
|
||||
|
||||
void GroundSprite_Reset(s16 a0)
|
||||
void GroundSprite_Reset(s32 a0)
|
||||
{
|
||||
s32 uVar2;
|
||||
unkStruct_2039DB0 *bee;
|
||||
unkStruct_2039DB0 *see;
|
||||
s32 uVar2 = (s16) a0;
|
||||
|
||||
uVar2 = a0;
|
||||
|
||||
Log(0, gUnknown_81177D8);
|
||||
Log(0, "GroundSprite Reset");
|
||||
gUnknown_2039DCC = 0;
|
||||
gUnknown_2039DCE = 0;
|
||||
sub_80A6460();
|
||||
|
||||
InitShadowSprites(496, sub_80A4D48(uVar2) ? 3 : 2);
|
||||
sub_8004E8C(&gUnknown_2039DB0);
|
||||
sub_8004E8C(&gUnknown_2039DC0);
|
||||
|
||||
bee = &gUnknown_2039DB0;
|
||||
sub_8004E8C(bee);
|
||||
see = &gUnknown_2039DC0;
|
||||
sub_8004E8C(see);
|
||||
|
||||
see->unk4 &= ~(0x400 | 0x800);
|
||||
see->unkA &= ~(0x400 | 0x800);
|
||||
see->unkA |= 0x800;
|
||||
gUnknown_2039DC0.unk4 &= ~(0x400 | 0x800);
|
||||
gUnknown_2039DC0.unkA &= ~(0x400 | 0x800);
|
||||
gUnknown_2039DC0.unkA |= 0x800;
|
||||
|
||||
if (sub_80A4D48(a0)) {
|
||||
bee->unk4 &= ~(0x400 | 0x800);
|
||||
bee->unkA &= ~(0x400 | 0x800);
|
||||
bee->unkA |= (0x400 | 0x800);
|
||||
gUnknown_2039DB0.unk4 &= ~(0x400 | 0x800);
|
||||
gUnknown_2039DB0.unkA &= ~(0x400 | 0x800);
|
||||
gUnknown_2039DB0.unkA |= (0x400 | 0x800);
|
||||
}
|
||||
else {
|
||||
bee->unk4 &= ~(0x400 | 0x800);
|
||||
bee->unkA &= ~(0x400 | 0x800);
|
||||
bee->unkA |= 0x800;
|
||||
gUnknown_2039DB0.unk4 &= ~(0x400 | 0x800);
|
||||
gUnknown_2039DB0.unkA &= ~(0x400 | 0x800);
|
||||
gUnknown_2039DB0.unkA |= 0x800;
|
||||
}
|
||||
|
||||
ResetSprites(TRUE);
|
||||
nullsub_10(TRUE);
|
||||
}
|
||||
|
||||
void sub_80A6460(void)
|
||||
static void sub_80A6460(void)
|
||||
{
|
||||
OpenedFile *file;
|
||||
s32 i;
|
||||
const u8 *data;
|
||||
u16 something;
|
||||
|
||||
file = OpenFileAndGetFileDataPtr(gUnknown_81177EC, &gMonsterFileArchive);
|
||||
file = OpenFileAndGetFileDataPtr("palet", &gMonsterFileArchive);
|
||||
|
||||
something = 0x100;
|
||||
data = file->data;
|
||||
@@ -131,7 +128,7 @@ void sub_80A6460(void)
|
||||
CloseFile(file);
|
||||
}
|
||||
|
||||
void sub_80A64A4(void)
|
||||
UNUSED static void sub_80A64A4(void)
|
||||
{
|
||||
const u8 *r2;
|
||||
u16 r4;
|
||||
@@ -147,7 +144,7 @@ void sub_80A64A4(void)
|
||||
r7 = gUnknown_3001B7C->unk108;
|
||||
sub_80A6460();
|
||||
|
||||
for (i = 0; i < 2; i++, r7++)
|
||||
for (i = 0; i < UNK_3001B7C_SUB108_COUNT; i++, r7++)
|
||||
{
|
||||
if (r7->unk2 > 0) {
|
||||
r5 = r7->unk0;
|
||||
@@ -156,11 +153,12 @@ void sub_80A64A4(void)
|
||||
|
||||
flag = r5 & 0x200;
|
||||
if (flag) {
|
||||
file = OpenFileAndGetFileDataPtr(gUnknown_81177EC, &gMonsterFileArchive);
|
||||
file = OpenFileAndGetFileDataPtr("palet", &gMonsterFileArchive);
|
||||
r2 = file->data + (r5 & 0xFF) * 0x40;
|
||||
}
|
||||
else {
|
||||
file = OpenFileAndGetFileDataPtr((r5 & 0xFF)[gUnknown_81178F4], &gOrnamentFileArchive);
|
||||
u32 id = r5 & 0xFF;
|
||||
file = OpenFileAndGetFileDataPtr(id[gUnknown_81178F4], &gOrnamentFileArchive);
|
||||
r2 = file->data;
|
||||
}
|
||||
|
||||
@@ -201,7 +199,702 @@ UNUSED static u16 sub_80A65D8(u16 *a0)
|
||||
return a0[40];
|
||||
}
|
||||
|
||||
u16 sub_80A65E0(u32 a0)
|
||||
static u16 sub_80A65E0(u32 a0)
|
||||
{
|
||||
return (a0 >> 16) & 0x337F;
|
||||
}
|
||||
|
||||
static void sub_80A65F0(struct UnkGroundSpriteStruct *ptr, u16 a1)
|
||||
{
|
||||
ptr->flags_0x50 = a1;
|
||||
ptr->unk6A = ((a1 & 4) ? 0x40 : 0) - ((a1 & 2) ? 0x40 : 0) + ((a1 & 1) ? 0x8 : 0) + 0x40;
|
||||
|
||||
if (ptr->flags_0x50 & 0x8) {
|
||||
ptr->unk3C = gUnknown_2039DC0;
|
||||
}
|
||||
else {
|
||||
ptr->unk3C = gUnknown_2039DB0;
|
||||
}
|
||||
|
||||
if (ptr->flags_0x50 & 0x20) {
|
||||
ptr->unk3C.unk0 &= 0xF3FF;
|
||||
ptr->unk3C.unk6 &= 0xF3FF;
|
||||
ptr->unk3C.unk6 |= 0x400;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80A6688(struct UnkGroundSpriteStruct *ptr, s32 a0)
|
||||
{
|
||||
sub_80A65F0(ptr, sub_80A65E0(a0));
|
||||
}
|
||||
|
||||
bool8 SpriteHasPokemonSize_80A66A4(struct UnkGroundSpriteStruct *ptr)
|
||||
{
|
||||
return (ptr->unk48.unk0 > 0);
|
||||
}
|
||||
|
||||
UNUSED static bool8 sub_80A66BC(struct UnkGroundSpriteStruct *ptr)
|
||||
{
|
||||
if (ptr->unk52 >= 0)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_80A66D4(struct UnkGroundSpriteStruct *ptr)
|
||||
{
|
||||
if (ptr->unk52 < 0 && ptr->unk48.unk0 > 0)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_80A66F8(struct UnkGroundSpriteStruct *ptr)
|
||||
{
|
||||
if (ptr->unk52 >= 0 && !(ptr->axdata.flags & 0x2000)) {
|
||||
return (ptr->axdata.flags & 0x8000) != 0;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_80A671C(struct UnkGroundSpriteStruct *ptr)
|
||||
{
|
||||
if (ptr->unk58 != 0) {
|
||||
if (ptr->unk58 == 0x1C0)
|
||||
return TRUE;
|
||||
if (ptr->unk5C == -1)
|
||||
return TRUE;
|
||||
if (sub_800E9E4(ptr->unk5C))
|
||||
return TRUE;
|
||||
ptr->unk5C = -1;
|
||||
ptr->unk58 = 0;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 IsOnscreen_80A675C(struct UnkGroundSpriteStruct *ptr, PixelPos *pixPosArg)
|
||||
{
|
||||
PixelPos result;
|
||||
PixelPos pixelPos;
|
||||
|
||||
if (sub_809D248(&pixelPos)) {
|
||||
result.x = (pixPosArg->x / 256) - pixelPos.x;
|
||||
result.y = (pixPosArg->y / 256) - pixelPos.y;
|
||||
}
|
||||
else {
|
||||
result.x = (pixPosArg->x / 256);
|
||||
result.y = (pixPosArg->y / 256);
|
||||
}
|
||||
|
||||
if (result.x >= -64 && result.x <= 303 && result.y >= -16 && result.y <= 207) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_80A67CC(struct UnkGroundSpriteStruct *ptr, struct UnkGroundSpriteSubStructx48 *a1, s32 a2)
|
||||
{
|
||||
bool8 r7;
|
||||
|
||||
if (a1 != NULL && a1->unk0 > 0) {
|
||||
r7 = TRUE;
|
||||
}
|
||||
else {
|
||||
r7 = FALSE;
|
||||
}
|
||||
|
||||
sub_80A65F0(ptr, sub_80A65E0(a2));
|
||||
ptr->unk74.x = 0;
|
||||
ptr->unk74.y = 0;
|
||||
ptr->unk7C = -1;
|
||||
ptr->unk70 = 0;
|
||||
ptr->unk6C = 0;
|
||||
ptr->unk6E = 0;
|
||||
ptr->unk52 = -1;
|
||||
ptr->unk54 = NULL;
|
||||
ptr->unk64 = 0;
|
||||
ptr->unk66 = -1;
|
||||
ptr->unk68 = 0;
|
||||
ptr->unk58 = 0;
|
||||
ptr->unk5A = 0xFF;
|
||||
ptr->unk5C = -1;
|
||||
ptr->unk60 = -1;
|
||||
if (r7) {
|
||||
ptr->unk48 = *a1;
|
||||
if (!sub_80A68F8(ptr, &ptr->unk48, -1) && !(ptr->flags_0x50 & 0x1000) && sub_80A6CF4(&ptr->unk48)) {
|
||||
sub_80A68F8(ptr, &ptr->unk48, -1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ptr->unk48.unk0 = -1;
|
||||
ptr->unk48.unk2 = 0;
|
||||
ptr->unk48.axmain = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80A68A0(struct UnkGroundSpriteStruct *ptr)
|
||||
{
|
||||
if ((ptr->flags_0x50 & 0x200) && ptr->unk58 != 0 && ptr->unk5C != -1) {
|
||||
sub_800DC14(ptr->unk5C);
|
||||
}
|
||||
if (ptr->unk54 != NULL) {
|
||||
CloseFile(ptr->unk54);
|
||||
ptr->unk54 = NULL;
|
||||
}
|
||||
sub_80A69FC(ptr);
|
||||
}
|
||||
|
||||
// I guess the code inside the loop was commented out or under an ifdef.
|
||||
UNUSED static void sub_80A68E8(void)
|
||||
{
|
||||
s32 i;
|
||||
for (i = 0; i < UNK_3001B7C_SUB0_COUNT; i++) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
static bool8 sub_80A68F8(struct UnkGroundSpriteStruct *ptr, struct UnkGroundSpriteSubStructx48 *a1, s32 a2)
|
||||
{
|
||||
s32 id, count;
|
||||
unkStruct_3001B7C_sub0 *unkPtr = &gUnknown_3001B7C->unk0[0];
|
||||
|
||||
if (a1->unk0 >= a2) {
|
||||
a2 = a1->unk0;
|
||||
count = 0;
|
||||
for (id = 0; id < UNK_3001B7C_SUB0_COUNT; id = (s16)(id + 1), unkPtr++) {
|
||||
if (unkPtr->unk0 == 0) {
|
||||
if (++count >= a2) {
|
||||
unkPtr -= count - 1;
|
||||
id = (s16) (id - (count - 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
count = 0;
|
||||
id = UNK_3001B7C_SUB0_COUNT - 1;
|
||||
unkPtr = &gUnknown_3001B7C->unk0[UNK_3001B7C_SUB0_COUNT - 1];
|
||||
for (; id >= 0; id = (s16)(id - 1), unkPtr--) {
|
||||
if (unkPtr->unk0 == 0) {
|
||||
if (++count >= a2) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count >= a2) {
|
||||
s32 i;
|
||||
ptr->unk52 = id;
|
||||
ptr->unk64 = a2;
|
||||
unkPtr->unk0 = 1;
|
||||
unkPtr->unk8 = ptr;
|
||||
GroundSprite_ExtendPaletteAdd(ptr, a1->unk2);
|
||||
for (i = 1; i < a2; i++) {
|
||||
unkPtr[i].unk0 = 2;
|
||||
}
|
||||
|
||||
gUnknown_2039DD4 -= a2;
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
gUnknown_2039DD0 = 0;
|
||||
ptr->unk7C = -1;
|
||||
ptr->unk70 = 0;
|
||||
ptr->unk52 = -1;
|
||||
ptr->unk64 = 0;
|
||||
ptr->unk6C = 0;
|
||||
ptr->unk6E = 0;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80A69FC(struct UnkGroundSpriteStruct *ptr)
|
||||
{
|
||||
s32 id = ptr->unk52;
|
||||
unkStruct_3001B7C_sub0 *unkPtr = &gUnknown_3001B7C->unk0[id];
|
||||
|
||||
if (id >= 0) {
|
||||
GroundSprite_ExtendPaletteDelete(ptr);
|
||||
unkPtr->unk8 = NULL;
|
||||
unkPtr->unk0 = 0;
|
||||
unkPtr++;
|
||||
gUnknown_2039DD4++;
|
||||
id = (s16)(id + 1);
|
||||
for (; id < UNK_3001B7C_SUB0_COUNT && unkPtr->unk0 == 2; id = (s16)(id + 1)) {
|
||||
unkPtr->unk0 = 0;
|
||||
unkPtr++;
|
||||
gUnknown_2039DD4++;
|
||||
}
|
||||
|
||||
ptr->unk52 = -1;
|
||||
ptr->unk64 = 0;
|
||||
gUnknown_2039DD0 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void GroundSprite_ExtendPaletteAdd(struct UnkGroundSpriteStruct *ptr, u16 a1)
|
||||
{
|
||||
OpenedFile *file;
|
||||
s32 r8;
|
||||
unkStruct_3001B7C_sub108 *sub108Ptr;
|
||||
u16 var_28;
|
||||
u16 var_24;
|
||||
u16 r6;
|
||||
const void *r7;
|
||||
s32 r2;
|
||||
|
||||
if (a1 & (0x100 | 0x200)) {
|
||||
if (a1 & 0x400) {
|
||||
sub108Ptr = &gUnknown_3001B7C->unk108[1];
|
||||
if (sub108Ptr->unk0 == a1) {
|
||||
sub108Ptr->unk2++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
r8 = 0;
|
||||
sub108Ptr = &gUnknown_3001B7C->unk108[0];
|
||||
for (; r8 < UNK_3001B7C_SUB108_COUNT; r8++, sub108Ptr++) {
|
||||
if (sub108Ptr->unk0 == a1) {
|
||||
u16 r1 = r8 + 29;
|
||||
sub108Ptr->unk2++;
|
||||
if (ptr != NULL) {
|
||||
ptr->unk68 = r1 - 16;
|
||||
}
|
||||
Log(0, "extend palette %3d[%3d] %04x up %04x", r8, r1, r1 - 16, a1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (a1 & 0x400) {
|
||||
r8 = 1;
|
||||
sub108Ptr = &gUnknown_3001B7C->unk108[1];
|
||||
if (sub108Ptr->unk2 > 0) {
|
||||
FATAL_ERROR_ARGS("../ground/ground_sprite.c", 1008, "extend palette buffer error %08x", a1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
r8 = 0;
|
||||
sub108Ptr = &gUnknown_3001B7C->unk108[0];
|
||||
for (; r8 < UNK_3001B7C_SUB108_COUNT; r8++, sub108Ptr++) {
|
||||
if (sub108Ptr->unk2 <= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (r8 >= UNK_3001B7C_SUB108_COUNT) {
|
||||
FATAL_ERROR_ARGS("../ground/ground_sprite.c", 1016, "extend palette buffer error %08x", a1);
|
||||
}
|
||||
}
|
||||
|
||||
var_28 = r8 + 29;
|
||||
var_24 = (r8 * 16) + 464;
|
||||
if (a1 & 0x200) {
|
||||
file = OpenFileAndGetFileDataPtr("palet", &gMonsterFileArchive);
|
||||
r7 = file->data;
|
||||
r7 += (a1 & 0xFF) * 64;
|
||||
}
|
||||
else {
|
||||
u32 id = a1 & 0xff;
|
||||
file = OpenFileAndGetFileDataPtr(id[gUnknown_81178F4], &gOrnamentFileArchive);
|
||||
r7 = file->data;
|
||||
}
|
||||
|
||||
if (a1 & 0x1000) {
|
||||
r6 = 1;
|
||||
}
|
||||
else {
|
||||
r6 = 0;
|
||||
}
|
||||
|
||||
if (a1 & 0x2000) {
|
||||
r6 |= 2;
|
||||
}
|
||||
|
||||
sub_80997F4(var_28, r6);
|
||||
sub_809971C(var_24, r7, 16);
|
||||
sub108Ptr->unk0 = a1;
|
||||
sub108Ptr->unk2 = 1;
|
||||
r2 = var_28 - 16;
|
||||
if (ptr != NULL) {
|
||||
ptr->unk68 = r2;
|
||||
}
|
||||
Log(0, "extend palette %3d[%3d] %04x set %04x %04x", r8, var_28, r2, a1, r6);
|
||||
if (file != NULL) {
|
||||
CloseFile(file);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ptr != NULL) {
|
||||
ptr->unk68 = a1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GroundSprite_ExtendPaletteDelete(struct UnkGroundSpriteStruct *ptr)
|
||||
{
|
||||
s32 r5;
|
||||
unkStruct_3001B7C_sub108 *sub108Ptr;
|
||||
|
||||
if (ptr != NULL) {
|
||||
r5 = ptr->unk68 - 13;
|
||||
if (r5 < 0)
|
||||
return;
|
||||
}
|
||||
else {
|
||||
r5 = 1;
|
||||
}
|
||||
|
||||
sub108Ptr = &gUnknown_3001B7C->unk108[r5];
|
||||
if (ptr != NULL) {
|
||||
ptr->unk68 = 0;
|
||||
}
|
||||
|
||||
if (--sub108Ptr->unk2 <= 0) {
|
||||
Log(0, "extend palette %3d delete %04x", r5, sub108Ptr->unk0);
|
||||
sub108Ptr->unk0 = 0;
|
||||
sub108Ptr->unk2 = 0;
|
||||
sub_80997F4(r5 + 29, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static bool8 sub_80A6CF4(struct UnkGroundSpriteSubStructx48 *a0)
|
||||
{
|
||||
struct UnkGroundSpriteStruct *spArray[UNK_3001B7C_SUB0_COUNT];
|
||||
s32 i;
|
||||
unkStruct_3001B7C_sub0 *sub0Ptr;
|
||||
PixelPos pixelPos;
|
||||
s32 count = 0;
|
||||
s32 r9 = a0->unk0;
|
||||
s32 r10 = 0;
|
||||
s32 var_28 = -1;
|
||||
s32 var_24 = -1;
|
||||
|
||||
sub_809D248(&pixelPos);
|
||||
for (i = 0, sub0Ptr = &gUnknown_3001B7C->unk0[0]; i < UNK_3001B7C_SUB0_COUNT; i = (s16)(i+1), sub0Ptr++) {
|
||||
if (sub0Ptr->unk0 == 1) {
|
||||
struct UnkGroundSpriteStruct *ptr = sub0Ptr->unk8;
|
||||
|
||||
if (!(ptr->flags_0x50 & 0x2000) && ptr->unk7C >= 0) {
|
||||
PixelPos resultPos;
|
||||
resultPos.x = (ptr->unk74.x / 256) - pixelPos.x;
|
||||
resultPos.y = (ptr->unk74.y / 256) - pixelPos.y;
|
||||
|
||||
if (resultPos.y > 0) {
|
||||
ptr->unk7C = 0x28 + resultPos.y;
|
||||
}
|
||||
else {
|
||||
ptr->unk7C = 0x28 - resultPos.y;
|
||||
}
|
||||
|
||||
if (resultPos.x > 0) {
|
||||
if (resultPos.x > ptr->unk7C) {
|
||||
ptr->unk7C = resultPos.x;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (-resultPos.x > ptr->unk7C) {
|
||||
ptr->unk7C = -resultPos.x;
|
||||
}
|
||||
}
|
||||
|
||||
r10 += ptr->unk48.unk0;
|
||||
if (ptr->unk48.unk0 >= r9 && var_24 < ptr->unk7C) {
|
||||
var_28 = count;
|
||||
var_24 = ptr->unk7C;
|
||||
}
|
||||
spArray[count++] = ptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (r10 < r9)
|
||||
return FALSE;
|
||||
if (var_28 >= 0) {
|
||||
sub_80A69FC(spArray[var_28]);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
while (count > 0) {
|
||||
s32 i;
|
||||
s32 r5 = -1;
|
||||
s32 r3 = -1;
|
||||
s32 r6 = 0;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
if (r3 < spArray[i]->unk7C) {
|
||||
r5 = count; // This looks like a mistake to me? I believe it should be r5 = i instead, however I cannot verify the behavior in-game as I can't find where, if anywhere, this function runs.
|
||||
r3 = spArray[i]->unk7C;
|
||||
}
|
||||
}
|
||||
sub_80A69FC(spArray[r5]);
|
||||
|
||||
count--;
|
||||
for (i = r5; i < count; i++) {
|
||||
spArray[i] = spArray[i + 1];
|
||||
}
|
||||
|
||||
for (i = 0, sub0Ptr = &gUnknown_3001B7C->unk0[0]; i < UNK_3001B7C_SUB0_COUNT; i++, sub0Ptr++) {
|
||||
if (sub0Ptr->unk0 == 0) {
|
||||
if (++r6 >= r9) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
r6 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_80A6E68(void)
|
||||
{
|
||||
ResetSprites(FALSE);
|
||||
nullsub_10(FALSE);
|
||||
sub_800E970();
|
||||
}
|
||||
|
||||
void sub_80A6E80(void)
|
||||
{
|
||||
DungeonPos pos;
|
||||
|
||||
if (!sub_809D248(&gUnknown_2039DD8)) {
|
||||
gUnknown_2039DD8.x = 0;
|
||||
gUnknown_2039DD8.y = 0;
|
||||
}
|
||||
sub_80ABA7C();
|
||||
sub_80ACAD4();
|
||||
sub_80AD7AC();
|
||||
pos.x = gUnknown_2039DD8.x;
|
||||
pos.y = gUnknown_2039DD8.y;
|
||||
sub_800E90C(&pos);
|
||||
sub_8005180();
|
||||
nullsub_12();
|
||||
}
|
||||
|
||||
void sub_80A6EC8(struct UnkGroundSpriteStruct *ptr, s32 a1)
|
||||
{
|
||||
if (ptr->unk52 > 0) {
|
||||
if (a1 <= ptr->unk48.unk0) {
|
||||
a1 = ptr->unk48.unk0;
|
||||
}
|
||||
if (ptr->unk64 != a1) {
|
||||
ptr->unk66 = a1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80A6EFC(struct UnkGroundSpriteStruct *ptr, s32 a1_, s32 a2_)
|
||||
{
|
||||
s32 flagResult;
|
||||
unkStruct_3001B7C_sub0 *sub0Ptr;
|
||||
s32 a1 = (s16) a1_;
|
||||
s32 a2 = (s8) a2_;
|
||||
|
||||
if (ptr->unk52 < 0) {
|
||||
if (ptr->unk66 >= 0) {
|
||||
if (!sub_80A68F8(ptr, &ptr->unk48, ptr->unk66))
|
||||
return;
|
||||
ptr->unk66 = -1;
|
||||
}
|
||||
else {
|
||||
if (ptr->unk48.unk0 <= 0)
|
||||
return;
|
||||
if (!sub_80A68F8(ptr, &ptr->unk48, -1))
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ptr->unk66 >= 0) {
|
||||
sub_80A69FC(ptr);
|
||||
if (!sub_80A68F8(ptr, &ptr->unk48, ptr->unk66))
|
||||
return;
|
||||
ptr->unk66 = -1;
|
||||
}
|
||||
}
|
||||
|
||||
// s16 memes...
|
||||
flagResult = a1 & 0x400;
|
||||
if ((s16)flagResult) {
|
||||
ptr->axdata.flags &= ~(0x1000);
|
||||
return;
|
||||
}
|
||||
|
||||
sub0Ptr = &gUnknown_3001B7C->unk0[ptr->unk52];
|
||||
ptr->unk70 = 1;
|
||||
ptr->unk7C = -1;
|
||||
switch ((a1 & 0x700)) {
|
||||
case 0x300:
|
||||
ptr->unk6C = 0;
|
||||
break;
|
||||
case 0x100:
|
||||
ptr->unk6C = 0x80;
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
ptr->unk6C = 0x100;
|
||||
break;
|
||||
case 0x200:
|
||||
ptr->unk6C = 0x200;
|
||||
break;
|
||||
}
|
||||
|
||||
ptr->unk6E = 0;
|
||||
AxResInit(&ptr->axdata, ptr->unk48.axmain, (a1 & 0xFF) + a2 / 8, a2 & 7, sub0Ptr->unk4, 0, ((u16)a1 & 0x800) != 0);
|
||||
}
|
||||
|
||||
void sub_80A7040(struct UnkGroundSpriteStruct *ptr, s32 a1_, s32 a2_, s32 a3)
|
||||
{
|
||||
s32 a1 = (s16) a1_;
|
||||
s32 a2 = (s8) a2_;
|
||||
|
||||
if (!(ptr->flags_0x50 & 0x200))
|
||||
return;
|
||||
|
||||
if (a1 == 0 || a1 == 0x1C0) {
|
||||
if (sub_80A671C(ptr)) {
|
||||
ptr->unk58 = 0x1C0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
ptr->unk58 = a1;
|
||||
ptr->unk5A = a2;
|
||||
ptr->unk60 = a3;
|
||||
}
|
||||
}
|
||||
|
||||
bool8 sub_80A7094(struct UnkGroundSpriteStruct *ptr, PixelPos *r10, PixelPos *posArg, s32 a3)
|
||||
{
|
||||
PixelPos resultPos;
|
||||
s32 unkY;
|
||||
|
||||
ptr->unk74 = *posArg;
|
||||
ptr->unk7C = 0;
|
||||
if (ptr->flags_0x50 & 0x200 && ptr->unk58 != 0) {
|
||||
if (ptr->unk58 == 0x1C0) {
|
||||
if (ptr->unk5C != -1) {
|
||||
sub_800DC14(ptr->unk5C);
|
||||
ptr->unk5C = -1;
|
||||
}
|
||||
ptr->unk58 = 0;
|
||||
}
|
||||
else if (ptr->unk5C == -1) {
|
||||
unkStruct_2039DB0 unkSubStruct = {0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0};
|
||||
unkStruct_80416E0 unkStruct;
|
||||
|
||||
sub_800EE5C(ptr->unk58);
|
||||
sub_800EF64();
|
||||
unkStruct.unk0 = ptr->unk58;
|
||||
unkStruct.unk4 = 0;
|
||||
unkStruct.dir = (s8) ptr->unk5A;
|
||||
unkStruct.x = posArg->x / 256;
|
||||
unkStruct.y = posArg->y / 256;
|
||||
unkStruct.unk10 = 0;
|
||||
unkStruct.unk12 = 0;
|
||||
unkStruct.unk14 = -1;
|
||||
unkStruct.unk18 = 0;
|
||||
unkStruct.unk1C = unkSubStruct;
|
||||
ptr->unk5C = sub_800E890(&unkStruct);
|
||||
}
|
||||
else if (!sub_800E9E4(ptr->unk5C)) {
|
||||
ptr->unk5C = -1;
|
||||
ptr->unk58 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (ptr->unk52 < 0)
|
||||
return FALSE;
|
||||
if (ptr->flags_0x50 & 0x40)
|
||||
return FALSE;
|
||||
|
||||
resultPos = (PixelPos) {(posArg->x / 256) - gUnknown_2039DD8.x, (posArg->y / 256) - gUnknown_2039DD8.y};
|
||||
unkY = resultPos.y - (a3 / 256);
|
||||
if (resultPos.x >= -64 && resultPos.x <= 303 && resultPos.y >= -16 && resultPos.y <= 207 && unkY >= -16 && unkY <= 207) {
|
||||
if ((ptr->flags_0x50 & 0x10) && (gUnknown_2039DCC & 1)) {
|
||||
sub_80A72B8(ptr, FALSE);
|
||||
DoAxFrame_800558C(&ptr->axdata, 304, 208, 0, ptr->unk68, &ptr->unk3C);
|
||||
ptr->unk70 = 0;
|
||||
return FALSE;
|
||||
}
|
||||
else {
|
||||
sub_80A72B8(ptr, ptr->unk70);
|
||||
DoAxFrame_800558C(&ptr->axdata, resultPos.x, unkY, resultPos.y + ptr->unk6A, ptr->unk68, &ptr->unk3C);
|
||||
ptr->unk70 = 0;
|
||||
if (r10 != NULL) {
|
||||
*r10 = resultPos;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (ptr->unk70 != 0) {
|
||||
sub_80A72B8(ptr, TRUE);
|
||||
DoAxFrame_800558C(&ptr->axdata, 304, 208, 0, ptr->unk68, &ptr->unk3C);
|
||||
ptr->unk70 = 0;
|
||||
return FALSE;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80A72B8(struct UnkGroundSpriteStruct *ptr, bool8 a1)
|
||||
{
|
||||
if (a1) {
|
||||
ptr->unk6E = 0;
|
||||
RunAxAnimationFrame(&ptr->axdata);
|
||||
}
|
||||
else {
|
||||
ptr->unk6E += ptr->unk6C;
|
||||
while (ptr->unk6E >= 0x100) {
|
||||
ptr->unk6E -= 0x100;
|
||||
RunAxAnimationFrame(&ptr->axdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool8 sub_80A7310(struct UnkGroundSpriteStruct *ptr, PixelPos *posArg1, PixelPos *posArg2, s32 a3)
|
||||
{
|
||||
if (ptr->flags_0x50 & 0x200 && ptr->unk5C != -1) {
|
||||
DungeonPos pos;
|
||||
s32 r7;
|
||||
|
||||
pos.x = posArg1->x / 256;
|
||||
pos.y = posArg1->y / 256;
|
||||
r7 = (pos.y - gUnknown_2039DD8.y) + ptr->unk6A + 2;
|
||||
pos.y -= a3 / 256;
|
||||
if (posArg2 != NULL) {
|
||||
pos.x += posArg2->x;
|
||||
pos.y += posArg2->y;
|
||||
}
|
||||
|
||||
sub_800E8AC(ptr->unk5C, &pos, NULL, r7, &ptr->unk3C);
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80A73EC(void)
|
||||
{
|
||||
CopySpritesToOam();
|
||||
nullsub_13();
|
||||
sub_8005304();
|
||||
nullsub_14();
|
||||
gUnknown_2039DCC++;
|
||||
if (++gUnknown_2039DCE > 11) {
|
||||
gUnknown_2039DCE = 0;
|
||||
}
|
||||
}
|
||||
|
||||
127
src/ground_sprite_data.c
Normal file
127
src/ground_sprite_data.c
Normal file
@@ -0,0 +1,127 @@
|
||||
#include "global.h"
|
||||
#include "globaldata.h"
|
||||
#include "ground_sprite_data.h"
|
||||
|
||||
const char *const gUnknown_81178F4[] = {
|
||||
"flag00c",
|
||||
"flag01c",
|
||||
"flag02c",
|
||||
"flag03c",
|
||||
"flag04c",
|
||||
"flag05c",
|
||||
"flag06c",
|
||||
"flag07c",
|
||||
"flag08c",
|
||||
"flag09c",
|
||||
"flag10c",
|
||||
"flag11c",
|
||||
"flag12c",
|
||||
"flag13c",
|
||||
"flag14c",
|
||||
"flag15c",
|
||||
"flag16c",
|
||||
"flag100c",
|
||||
"flag101c",
|
||||
"flag102c",
|
||||
"flag103c",
|
||||
"flag104c",
|
||||
"flag105c",
|
||||
"flag106c",
|
||||
"flag107c",
|
||||
"flag108c",
|
||||
"flag109c",
|
||||
"flag110c",
|
||||
"flag111c",
|
||||
"flag112c",
|
||||
"flag113c",
|
||||
"flag114c",
|
||||
"titleopc",
|
||||
"titlebgc",
|
||||
"stoneimc",
|
||||
NULL
|
||||
};
|
||||
|
||||
const struct GroundObjectKind gGroundObjectKinds[] = {
|
||||
{ -1, 0x000, NULL }, // many dummy/unused entries
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
|
||||
{ 1, 0x100, "flag00p" },
|
||||
{ 1, 0x100, "flag00p" },
|
||||
{ 1, 0x101, "flag01p" },
|
||||
{ 1, 0x102, "flag02p" },
|
||||
{ 1, 0x103, "flag03p" },
|
||||
{ 1, 0x104, "flag04p" },
|
||||
{ 1, 0x105, "flag05p" },
|
||||
{ 1, 0x106, "flag06p" },
|
||||
{ 1, 0x107, "flag07p" },
|
||||
{ 1, 0x108, "flag08p" },
|
||||
{ 1, 0x109, "flag09p" },
|
||||
{ 1, 0x10A, "flag10p" },
|
||||
{ 1, 0x10B, "flag11p" },
|
||||
{ 1, 0x10C, "flag12p" },
|
||||
{ 1, 0x10D, "flag13p" },
|
||||
{ 1, 0x10E, "flag14p" },
|
||||
{ 1, 0x10F, "flag15p" },
|
||||
{ 1, 0x110, "flag16p" },
|
||||
{ 1, 0x111, "flag100p" },
|
||||
{ 1, 0x112, "flag101p" },
|
||||
{ 1, 0x113, "flag102p" },
|
||||
{ 1, 0x114, "flag103p" },
|
||||
{ 1, 0x115, "flag104p" },
|
||||
{ 1, 0x116, "flag105p" },
|
||||
{ 1, 0x117, "flag106p" },
|
||||
{ 1, 0x118, "flag107p" },
|
||||
{ 1, 0x119, "flag108p" },
|
||||
{ 1, 0x11A, "flag109p" },
|
||||
{ 1, 0x11B, "flag110p" },
|
||||
{ 1, 0x11C, "flag111p" },
|
||||
{ 1, 0x11D, "flag112p" },
|
||||
{ 1, 0x11E, "flag113p" },
|
||||
{ 1, 0x11F, "flag114p" },
|
||||
{ 6, 0x120, "titleop1" },
|
||||
{ 1, 0x120, "titleop2" },
|
||||
{ 4, 0x121, "titlebg1" },
|
||||
{ 1, 0x006, "npc01p" },
|
||||
{ 1, 0x006, "npc02p" },
|
||||
{ 1, 0x005, "npc03p" },
|
||||
{ 1, 0x006, "npc04p" },
|
||||
{ 1, 0x000, "item01p" },
|
||||
{ -1, 0x000, NULL }
|
||||
};
|
||||
|
||||
// Dummy trailing list
|
||||
const struct GroundObjectKind gUnknown_8117E8C[] = {
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
{ -1, 0x000, NULL },
|
||||
};
|
||||
95
src/ground_sprite_monster.c
Normal file
95
src/ground_sprite_monster.c
Normal file
@@ -0,0 +1,95 @@
|
||||
#include "global.h"
|
||||
#include "globaldata.h"
|
||||
#include "def_filearchives.h"
|
||||
#include "file_system.h"
|
||||
#include "ground_sprite.h"
|
||||
#include "sprite.h"
|
||||
#include "pokemon.h"
|
||||
|
||||
extern s32 sub_800E700(s32);
|
||||
extern bool8 AddShadowSprite(s32 species, DungeonPos* a2, axdata* a3);
|
||||
|
||||
void sub_80A7428(struct UnkGroundSpriteStruct *ptr, s32 a1_, s32 monsterId_, s32 a3)
|
||||
{
|
||||
u8 name[12];
|
||||
OpenedFile *file;
|
||||
struct UnkGroundSpriteSubStructx48 spStruct;
|
||||
s32 a1 = (s16) a1_;
|
||||
// s16 memes strike again...
|
||||
s32 monsterId = (s16) monsterId_;
|
||||
s32 monsterIdS16 = (s16) monsterId;
|
||||
|
||||
sprintf(name, "ax%03d", monsterIdS16);
|
||||
file = OpenFile(name, &gMonsterFileArchive);
|
||||
GetFileDataPtr(file, 0); // Unused return value
|
||||
spStruct.unk0 = GetBodySize(monsterId);
|
||||
if (monsterId == MONSTER_STATUE) {
|
||||
spStruct.unk2 = 0x122;
|
||||
}
|
||||
else {
|
||||
bool32 kecleonShop = (a1 == 71);
|
||||
spStruct.unk2 = GetPokemonOverworldPalette(monsterId, kecleonShop);
|
||||
}
|
||||
spStruct.axmain = (axmain *) file->data;
|
||||
sub_80A67CC(ptr, &spStruct, a3);
|
||||
ptr->unk54 = file;
|
||||
if (ptr->unk52 >= 0) {
|
||||
sub_80A6EFC(ptr, 0x300, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80A74E4(struct UnkGroundSpriteStruct *ptr)
|
||||
{
|
||||
sub_80A68A0(ptr);
|
||||
}
|
||||
|
||||
void sub_80A74F0(struct UnkGroundSpriteStruct *ptr, s32 a1_, s32 a2_, s32 a3)
|
||||
{
|
||||
s32 a1 = (s16) a1_;
|
||||
s32 a2 = (s8) a2_;
|
||||
|
||||
if (a3 < 0) {
|
||||
if (a1 != 0x1C0) {
|
||||
a3 = sub_800E700(a1);
|
||||
}
|
||||
else {
|
||||
a3 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
sub_80A7040(ptr, a1, a2, a3);
|
||||
}
|
||||
|
||||
void sub_80A7524(struct UnkGroundSpriteStruct *ptr, s32 monsterId_, PixelPos *pixelPosArg, s32 a3)
|
||||
{
|
||||
PixelPos pixelPosSp;
|
||||
DungeonPos pos;
|
||||
|
||||
s32 monsterId = (s16) monsterId_;
|
||||
if (sub_80A7094(ptr, &pixelPosSp, pixelPosArg, a3)) {
|
||||
if (ptr->unk5C != -1) {
|
||||
PixelPos pixelPosSp2;
|
||||
switch (ptr->unk60) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
sub_800569C(&pos, &ptr->axdata, ptr->unk60);
|
||||
pixelPosSp2.x = pos.x;
|
||||
pixelPosSp2.y = pos.y;
|
||||
sub_80A7310(ptr, pixelPosArg, &pixelPosSp2, a3);
|
||||
break;
|
||||
default:
|
||||
sub_80A7310(ptr, pixelPosArg, NULL, a3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ptr->flags_0x50 & 0x100) {
|
||||
DungeonPos shadowPos = {pixelPosSp.x, pixelPosSp.y};
|
||||
AddShadowSprite(monsterId, &shadowPos, &ptr->axdata);
|
||||
}
|
||||
sub_80A7310(ptr, pixelPosArg, NULL, a3);
|
||||
}
|
||||
}
|
||||
|
||||
77
src/ground_sprite_util.c
Normal file
77
src/ground_sprite_util.c
Normal file
@@ -0,0 +1,77 @@
|
||||
#include "global.h"
|
||||
#include "globaldata.h"
|
||||
#include "def_filearchives.h"
|
||||
#include "file_system.h"
|
||||
#include "ground_sprite.h"
|
||||
#include "ground_sprite_data.h"
|
||||
|
||||
void sub_80A75CC(struct UnkGroundSpriteStruct *ptr, s32 unused, s32 a2_, s32 a3)
|
||||
{
|
||||
struct UnkGroundSpriteSubStructx48 sp;
|
||||
s32 a2 = (s16) a2_;
|
||||
const struct GroundObjectKind *objKind = &gGroundObjectKinds[a2];
|
||||
OpenedFile *file = NULL;
|
||||
|
||||
sp.unk0 = objKind->unk0;
|
||||
sp.unk2 = objKind->unk2;
|
||||
if (objKind->fileName != 0) {
|
||||
file = OpenFile(objKind->fileName, &gOrnamentFileArchive);
|
||||
GetFileDataPtr(file, 0);
|
||||
sp.axmain = (axmain *) file->data;
|
||||
}
|
||||
else {
|
||||
sp.axmain = NULL;
|
||||
}
|
||||
sub_80A67CC(ptr, &sp, a3);
|
||||
ptr->unk54 = file;
|
||||
if (ptr->unk52 >= 0) {
|
||||
sub_80A6EFC(ptr, 0x800, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80A7658(struct UnkGroundSpriteStruct *ptr)
|
||||
{
|
||||
sub_80A68A0(ptr);
|
||||
}
|
||||
|
||||
void sub_80A7664(struct UnkGroundSpriteStruct *ptr, PixelPos *pixelPos, s32 a2)
|
||||
{
|
||||
sub_80A7094(ptr, NULL, pixelPos, a2);
|
||||
sub_80A7310(ptr, pixelPos, NULL, a2);
|
||||
}
|
||||
|
||||
// Identical to sub_80A75CC, except uses a different table.
|
||||
void sub_80A7688(struct UnkGroundSpriteStruct *ptr, s32 unused, s32 a2_, s32 a3)
|
||||
{
|
||||
struct UnkGroundSpriteSubStructx48 sp;
|
||||
s32 a2 = (s16) a2_;
|
||||
const struct GroundObjectKind *objKind = &gUnknown_8117E8C[a2];
|
||||
OpenedFile *file = NULL;
|
||||
|
||||
sp.unk0 = objKind->unk0;
|
||||
sp.unk2 = objKind->unk2;
|
||||
if (objKind->fileName != 0) {
|
||||
file = OpenFile(objKind->fileName, &gOrnamentFileArchive);
|
||||
GetFileDataPtr(file, 0);
|
||||
sp.axmain = (axmain *) file->data;
|
||||
}
|
||||
else {
|
||||
sp.axmain = NULL;
|
||||
}
|
||||
sub_80A67CC(ptr, &sp, a3);
|
||||
ptr->unk54 = file;
|
||||
if (ptr->unk52 >= 0) {
|
||||
sub_80A6EFC(ptr, 0x800, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80A7714(struct UnkGroundSpriteStruct *ptr)
|
||||
{
|
||||
sub_80A68A0(ptr);
|
||||
}
|
||||
|
||||
void sub_80A7720(struct UnkGroundSpriteStruct *ptr, PixelPos *pixelPos, s32 a2)
|
||||
{
|
||||
sub_80A7094(ptr, NULL, pixelPos, a2);
|
||||
sub_80A7310(ptr, pixelPos, NULL, a2);
|
||||
}
|
||||
46
src/memory.c
46
src/memory.c
@@ -71,8 +71,6 @@ static HeapDescriptor *DoCreateSubHeap(struct unkMemoryStruct *a, u32 b);
|
||||
static void *DoAlloc(HeapDescriptor *heap, s32 size, u32 a2);
|
||||
static void InitHeapInternal(void);
|
||||
|
||||
ALIGNED(4) static const char sFileNameText[] = "../system/memory_locate.c";
|
||||
|
||||
void InitHeap(void)
|
||||
{
|
||||
InitHeapInternal();
|
||||
@@ -325,14 +323,6 @@ static s32 MemorySearchFromBack(HeapDescriptor *heap, s32 atb, s32 size)
|
||||
return -1;
|
||||
}
|
||||
|
||||
ALIGNED(4) static const char sText_LocateSetFront[] = "_LocateSetFront";
|
||||
static const DebugLocation sLocateSetFrontDebugLocation =
|
||||
{
|
||||
.file = sFileNameText,
|
||||
.line = 581,
|
||||
.func = sText_LocateSetFront
|
||||
};
|
||||
|
||||
static struct HeapFreeListElement * _LocateSetFront(HeapDescriptor *heap, s32 index, s32 atb, s32 size, s32 group)
|
||||
{
|
||||
s32 i;
|
||||
@@ -352,7 +342,7 @@ static struct HeapFreeListElement * _LocateSetFront(HeapDescriptor *heap, s32 in
|
||||
|
||||
heap->freeCount++;
|
||||
if (heap->freeCount > heap->freeListLength) {
|
||||
FatalError(&sLocateSetFrontDebugLocation, "Memory Locate sprit max over [%3d/%3d]", heap->freeCount, heap->freeListLength);
|
||||
FATAL_ERROR_ARGS("../system/memory_locate.c", 581, "Memory Locate sprit max over [%3d/%3d]", heap->freeCount, heap->freeListLength);
|
||||
}
|
||||
|
||||
block = &heap->freeList[index + 1];
|
||||
@@ -369,14 +359,6 @@ static struct HeapFreeListElement * _LocateSetFront(HeapDescriptor *heap, s32 in
|
||||
return curr;
|
||||
}
|
||||
|
||||
ALIGNED(4) static const char sText_LocateSetBack[] = "_LocateSetBack";
|
||||
static const DebugLocation sLocateSetBackDebugLocation =
|
||||
{
|
||||
.file = sFileNameText,
|
||||
.line = 673,
|
||||
.func = sText_LocateSetBack
|
||||
};
|
||||
|
||||
static struct HeapFreeListElement * _LocateSetBack(HeapDescriptor *heap, s32 index, s32 atb, s32 size, s32 group)
|
||||
{
|
||||
s32 i;
|
||||
@@ -397,7 +379,7 @@ static struct HeapFreeListElement * _LocateSetBack(HeapDescriptor *heap, s32 ind
|
||||
|
||||
heap->freeCount++;
|
||||
if (heap->freeCount > heap->freeListLength) {
|
||||
FatalError(&sLocateSetBackDebugLocation, "Memory Locate sprit max over [%3d/%3d]", heap->freeCount, heap->freeListLength);
|
||||
FATAL_ERROR_ARGS("../system/memory_locate.c", 673, "Memory Locate sprit max over [%3d/%3d]", heap->freeCount, heap->freeListLength);
|
||||
}
|
||||
|
||||
curr->block.size -= sizeAligned;
|
||||
@@ -415,14 +397,6 @@ static struct HeapFreeListElement * _LocateSetBack(HeapDescriptor *heap, s32 ind
|
||||
return curr;
|
||||
}
|
||||
|
||||
ALIGNED(4) static const char sText_LocateSet[] = "_LocateSet";
|
||||
static const DebugLocation sLocateSetDebugLocation =
|
||||
{
|
||||
.file = sFileNameText,
|
||||
.line = 812,
|
||||
.func = sText_LocateSet
|
||||
};
|
||||
|
||||
static void * _LocateSet(HeapDescriptor *heap, s32 size, s32 group)
|
||||
{
|
||||
s32 index;
|
||||
@@ -454,9 +428,8 @@ static void * _LocateSet(HeapDescriptor *heap, s32 size, s32 group)
|
||||
}
|
||||
|
||||
error:
|
||||
FatalError(&sLocateSetDebugLocation,
|
||||
"Memroy LocateSet [%p] buffer %8x size can't locate\n atb %02x grp %3d ",
|
||||
heap, size, atb, group);
|
||||
FATAL_ERROR_ARGS("../system/memory_locate.c", 812, "Memroy LocateSet [%p] buffer %8x size can't locate\n atb %02x grp %3d ",
|
||||
heap, size, atb, group);
|
||||
}
|
||||
|
||||
// arm9.bin::02010DE0
|
||||
@@ -470,8 +443,6 @@ void MemoryFree(void *a)
|
||||
DoFree(&sMainHeapDescriptor, a);
|
||||
}
|
||||
|
||||
ALIGNED(4) static const char sText_MemoryLocate_LocalCreate[] = "MemoryLocate_LocalCreate";
|
||||
|
||||
UNUSED static HeapDescriptor *MemoryLocate_LocalCreate(HeapDescriptor *parentHeap, u32 size, u32 param_3, u32 group)
|
||||
{
|
||||
s32 index;
|
||||
@@ -485,12 +456,7 @@ UNUSED static HeapDescriptor *MemoryLocate_LocalCreate(HeapDescriptor *parentHea
|
||||
index = MemorySearchFromBack(parentHeap, 9, size);
|
||||
|
||||
if (index < 0) {
|
||||
static const DebugLocation debugInfo = {
|
||||
.file = sFileNameText,
|
||||
.line = 1109,
|
||||
.func = sText_MemoryLocate_LocalCreate
|
||||
};
|
||||
FatalError(&debugInfo, "Memroy LocalCreate buffer %08x size can't locate", size);
|
||||
FATAL_ERROR_ARGS("../system/memory_locate.c", 1109, "Memroy LocalCreate buffer %08x size can't locate", size);
|
||||
}
|
||||
|
||||
foundSet = _LocateSetBack(parentHeap, index, 9, size, group);
|
||||
@@ -609,4 +575,4 @@ UNUSED static void nullsub_141(void)
|
||||
UNUSED static void nullsub_142(void)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
12
src/sprite.c
12
src/sprite.c
@@ -647,7 +647,7 @@ const RGB *sub_8005674(const EfoFileData *a0, s32 vramIdx)
|
||||
}
|
||||
|
||||
// arm9.bin::02001894
|
||||
void sub_800569C(DungeonPos *a0, axObject *a1, u8 a2)
|
||||
void sub_800569C(DungeonPos *a0, axdata *a1, u8 a2)
|
||||
{
|
||||
DungeonPos *ptr;
|
||||
DungeonPos *ptr2;
|
||||
@@ -656,11 +656,11 @@ void sub_800569C(DungeonPos *a0, axObject *a1, u8 a2)
|
||||
a0->x = 0;
|
||||
a0->y = 0;
|
||||
|
||||
if (!(a1->axdata.flags >> 15) || a2 >= 4)
|
||||
if (!(a1->flags >> 15) || a2 >= 4)
|
||||
return;
|
||||
|
||||
if (a1->axdata.positions != NULL) {
|
||||
ptr = &((DungeonPos*)a1->axdata.positions)[a1->axdata.sub1.poseId * 4];
|
||||
if (a1->positions != NULL) {
|
||||
ptr = &((DungeonPos*)a1->positions)[a1->sub1.poseId * 4];
|
||||
ptr2 = &ptr[a2];
|
||||
if (*&ptr2->x == 99 && *&ptr2->y == 99) {
|
||||
a0->x = 99;
|
||||
@@ -668,8 +668,8 @@ void sub_800569C(DungeonPos *a0, axObject *a1, u8 a2)
|
||||
}
|
||||
else {
|
||||
ptr3 = &ptr[a2];
|
||||
a0->x = a1->axdata.sub1.offset.x + ptr3->x;
|
||||
a0->y = a1->axdata.sub1.offset.y + ptr3->y;
|
||||
a0->x = a1->sub1.offset.x + ptr3->x;
|
||||
a0->y = a1->sub1.offset.y + ptr3->y;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -167,8 +167,4 @@ gUnknown_2039DA8: /* 2039DA8 (sub_80A14E8) */
|
||||
.space 0x8
|
||||
|
||||
.include "src/ground_sprite.o"
|
||||
|
||||
gUnknown_2039DD8: /* 2039DD8 (sub_80A6E80 - sub_80A7310) */
|
||||
.space 0x8
|
||||
|
||||
.include "src/code_80A7714.o"
|
||||
.include "src/ground_script_file.o"
|
||||
|
||||
Reference in New Issue
Block a user