diff options
author | anmart <andrewrmartinek@gmail.com> | 2016-06-13 19:50:52 -0400 |
---|---|---|
committer | anmart <andrewrmartinek@gmail.com> | 2016-06-13 19:50:52 -0400 |
commit | 8bfb38d813af48ed872443e90caaa3b32acca844 (patch) | |
tree | 89124cd4be27e402ec2010ca657df588202308f4 /src | |
parent | 23e89e5fdfab3d1fe5dc57c675397722559e407e (diff) |
Added a basic overworld scripting system to help disassemble scripts.
Diffstat (limited to 'src')
-rwxr-xr-x | src/constants.asm | 1 | ||||
-rwxr-xr-x | src/constants/overworld_script_constants.asm | 106 | ||||
-rwxr-xr-x | src/engine/bank3.asm | 17 | ||||
-rwxr-xr-x | src/engine/bank4.asm | 4 | ||||
-rwxr-xr-x | src/macros.asm | 25 |
5 files changed, 150 insertions, 3 deletions
diff --git a/src/constants.asm b/src/constants.asm index 3cf9cd1..fb199f6 100755 --- a/src/constants.asm +++ b/src/constants.asm @@ -9,3 +9,4 @@ INCLUDE "constants/card_data_constants.asm" INCLUDE "constants/misc_constants.asm" INCLUDE "constants/hardware_constants.asm" INCLUDE "constants/sgb_constants.asm" +INCLUDE "constants/overworld_script_constants.asm"
\ No newline at end of file diff --git a/src/constants/overworld_script_constants.asm b/src/constants/overworld_script_constants.asm new file mode 100755 index 0000000..2306c38 --- /dev/null +++ b/src/constants/overworld_script_constants.asm @@ -0,0 +1,106 @@ +start_script EQUS "rst $20" + +Func_ccbe_0 EQU $00 +Func_ccc6_index EQU $01 +Func_ccd4_index EQU $02 +Func_ccdc_index EQU $03 +Func_cce9_index EQU $04 +Func_cd01_index EQU $05 +Func_cd83_index EQU $06 +Func_cda8_index EQU $07 +Func_cdb9_index EQU $08 +Func_cdcb_index EQU $09 +Func_ce26_index EQU $0a +Func_ce84_index EQU $0b +Func_ce8a_index EQU $0c +Func_cf0c_index EQU $0d +Func_cf12_index EQU $0e +Func_cf3f_index EQU $0f +Func_cf4c_index EQU $10 +Func_cf53_index EQU $11 +Func_cf7b_index EQU $12 +Func_cf2d_index EQU $13 +Func_cf96_index EQU $14 +Func_cfc6_index EQU $15 +Func_cfd4_index EQU $16 +Func_d00b_index EQU $17 +Func_d025_index EQU $18 +Func_d032_index EQU $19 +Func_d03f_index EQU $1a +Func_d049_index EQU $1b +Func_d04f_index EQU $1c +Func_d055_index EQU $1d +OWScript_MovePlayer_index EQU $1e +Func_cee2_index EQU $1f +Func_d080_index EQU $20 +Func_d088_index EQU $21 +Func_d095_index EQU $22 +Func_d0be_index EQU $23 +Func_d0ce_index EQU $24 +Func_d0d9_index EQU $25 +Func_d0f2_index EQU $26 +Func_ce4a_index EQU $27 +Func_ceba_index EQU $28 +Func_d103_index EQU $29 +Func_d125_index EQU $2a +Func_d135_index EQU $2b +Func_d16b_index EQU $2c +Func_cd4f_index EQU $2d +Func_cd94_index EQU $2e +Func_ce52_index EQU $2f +Func_cdd8_index EQU $30 +Func_cdf5_index EQU $31 +Func_d195_index EQU $32 +Func_d1ad_index EQU $33 +Func_d1b3_index EQU $34 +Func_cccc_index EQU $35 +Func_d244_index EQU $36 +Func_d24c_index EQU $37 +DeckMachine_d336_index EQU $38 +Func_d271_index EQU $39 +Func_d36d_index EQU $3a +Func_ce6f_index EQU $3b +Func_d209_index EQU $3c +Func_d38f_index EQU $3d +Func_d396_index EQU $3e +Func_cd76_index EQU $3f +Func_d39d_index EQU $40 +Func_d3b9_index EQU $41 +Func_d3c9_index EQU $42 +Func_d3d1_index EQU $43 +Func_d3d4_index EQU $44 +Func_d3e0_index EQU $45 +Func_d3fe_index EQU $46 +Func_d408_index EQU $47 +Func_d40f_index EQU $48 +Func_d416_index EQU $49 +Func_d423_index EQU $4a +Func_d429_index EQU $4b +Func_d41d_index EQU $4c +Func_d42f_index EQU $4d +Func_d435_index EQU $4e +Func_cce4_index EQU $4f +Func_d2f6_index EQU $50 +Func_d317_index EQU $51 +Func_d43d_index EQU $52 +Func_ccbe_53 EQU $53 +Func_ccbe_54 EQU $54 +Func_ccbe_55 EQU $55 +Func_ccbe_56 EQU $56 +Func_ccbe_57 EQU $57 +Func_d44a_index EQU $58 +Func_d460_index EQU $59 +Func_d47b_index EQU $5a +Func_d484_index EQU $5b +Func_d49e_index EQU $5c +Func_d4a6_index EQU $5d +Func_d4ae_index EQU $5e +Func_d4bc_index EQU $5f +Func_d4c3_index EQU $60 +Func_d4ca_index EQU $61 +Func_d4df_index EQU $62 +Func_d452_index EQU $63 +Func_ccbe_64 EQU $64 +Func_ccbe_65 EQU $65 +Func_ccbe_66 EQU $66 +Func_ccbe_67 EQU $67
\ No newline at end of file diff --git a/src/engine/bank3.asm b/src/engine/bank3.asm index 2879afb..991fc92 100755 --- a/src/engine/bank3.asm +++ b/src/engine/bank3.asm @@ -2899,7 +2899,22 @@ asm_d4e6 jp IncreaseOWScriptPointerBy4 ; 0xd4ec -INCBIN "baserom.gbc",$d4ec,$f580 - $d4ec +INCBIN "baserom.gbc",$d4ec,$d753 - $d4ec + +; move to it's own file after we know where scripts start and end + start_script + run_script OWScript_MovePlayer, $0, $2 + run_script OWScript_MovePlayer, $0, $2 + run_script OWScript_MovePlayer, $0, $2 + run_script OWScript_MovePlayer, $0, $2 + run_script OWScript_MovePlayer, $0, $2 + run_script OWScript_MovePlayer, $0, $2 + run_script OWScript_MovePlayer, $0, $2 + run_script OWScript_MovePlayer, $0, $2 + run_script OWScript_MovePlayer, $0, $2 + ; there are more but the scripts haven't been disassembled + +INCBIN "baserom.gbc",$d76f,$f580 - $d76f Func_f580: ; f580 (3:7580) call Func_ca69 diff --git a/src/engine/bank4.asm b/src/engine/bank4.asm index a3fee53..c810209 100755 --- a/src/engine/bank4.asm +++ b/src/engine/bank4.asm @@ -962,7 +962,7 @@ INCLUDE "data/unknownNPCData.asm" INCBIN "baserom.gbc",$11f4e,$1217b - $11f4e - +owsCons = 0 OverworldScriptTable: ; 1217b (4:617b) dw Func_ccbe dw Func_ccc6 ; seems to end conversation with mason and starts bringing aid over @@ -1017,7 +1017,7 @@ OverworldScriptTable: ; 1217b (4:617b) dw Func_d195 dw Func_d1ad dw Func_d1b3 - dw Func_cccc ; Ends dialoge. Seems to do it after player answers the "start fight?" question. + dw Func_cccc ; Ends dialogue but seems to be more of a loading thing. it's used to load mason's lab, i bet it's used to load battles + in general dw Func_d244 dw Func_d24c dw DeckMachine_d336 diff --git a/src/macros.asm b/src/macros.asm index 5a79e0b..874c473 100755 --- a/src/macros.asm +++ b/src/macros.asm @@ -403,3 +403,28 @@ move_data_struct: MACRO \1Unknown1:: db \1Unknown2:: db ENDM + +run_script: MACRO + db \1_index + if(_NARG > 1) + + rept (_NARG + -1) + shift + db \1 + endr + + endc +ENDM + +; for the repeated functions on the table, need to specify which one, unfortunately +run_scriptx: MACRO + db \1 + if(_NARG > 1) + + rept (_NARG + -1) + shift + db \1 + endr + + endc +ENDM |