summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpikalaxalt <PikalaxALT@gmail.com>2016-05-29 14:14:29 -0400
committerpikalaxalt <PikalaxALT@gmail.com>2016-05-29 14:14:29 -0400
commit9c380e8de747392f4a8308863ac6a49c47f700d8 (patch)
treeb245c36af89d166d7a5aba37eba640051b1eabd7
parent287fc9855f4a569eaa5ea3914d7f8ed951e18318 (diff)
Museum 1F local scripts
-rw-r--r--data/map_header_banks.asm2
-rw-r--r--data/map_header_pointers.asm2
-rwxr-xr-xmain.asm11
-rwxr-xr-xscripts/museum1f.asm203
4 files changed, 22 insertions, 196 deletions
diff --git a/data/map_header_banks.asm b/data/map_header_banks.asm
index fe3a1db1..eae8a657 100644
--- a/data/map_header_banks.asm
+++ b/data/map_header_banks.asm
@@ -52,7 +52,7 @@ MapHeaderBanks:: ; fc3e4 (3f:43e4)
db BANK(Route2Gate_h)
db BANK(ViridianForestEntrance_h)
db BANK(ViridianForest_h)
- db $17 ; db BANK(Museum1F_h)
+ db BANK(Museum1F_h)
db $17 ; db BANK(Museum2F_h)
db $17 ; db BANK(PewterGym_h)
db $07 ; db BANK(PewterHouse1_h)
diff --git a/data/map_header_pointers.asm b/data/map_header_pointers.asm
index 930ce54a..dcf13fd1 100644
--- a/data/map_header_pointers.asm
+++ b/data/map_header_pointers.asm
@@ -52,7 +52,7 @@ MapHeaderPointers:: ; fc1f2 (3f:41f2)
dw Route2Gate_h
dw ViridianForestEntrance_h ;id=50
dw ViridianForest_h
- dw $40e3 ; dw Museum1F_h
+ dw Museum1F_h
dw $41b4 ; dw Museum2F_h
dw $4257 ; dw PewterGym_h
dw $4e30 ; dw PewterHouse1_h
diff --git a/main.asm b/main.asm
index 0d13baf2..0b5d37f0 100755
--- a/main.asm
+++ b/main.asm
@@ -1045,7 +1045,9 @@ SECTION "bank17",ROMX,BANK[$17]
dr $5c000,$5c010
RedsHouse2FBlocks:
INCBIN "maps/redshouse2f.blk"
- dr $5c020,$5c090
+Museum1FBlocks:
+INCBIN "maps/museum1f.blk"
+ dr $5c048,$5c090
ViridianForestEntranceBlocks:
ViridianForestExitBlocks:
Route2GateBlocks:
@@ -1054,7 +1056,12 @@ INCBIN "maps/viridianforestentrance.blk"
INCLUDE "data/mapHeaders/redshouse2f.asm"
INCLUDE "scripts/redshouse2f.asm"
INCLUDE "data/mapObjects/redshouse2f.asm"
- dr $5c0d4,$5d485
+ dr $5c0d4,$5c0e3
+
+INCLUDE "data/mapHeaders/museum1f.asm"
+INCLUDE "scripts/museum1f.asm"
+INCLUDE "data/mapObjects/museum1f.asm"
+ dr $5c1b4,$5d485
INCLUDE "data/mapHeaders/viridianforestexit.asm"
INCLUDE "scripts/viridianforestexit.asm"
diff --git a/scripts/museum1f.asm b/scripts/museum1f.asm
index ae5a2b42..75c0d74e 100755
--- a/scripts/museum1f.asm
+++ b/scripts/museum1f.asm
@@ -5,7 +5,8 @@ Museum1FScript: ; 5c0f7 (17:40f7)
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, Museum1FScriptPointers
ld a, [W_MUSEUM1FCURSCRIPT]
- jp JumpTable
+ call JumpTable
+ ret
Museum1FScriptPointers: ; 5c109 (17:4109)
dw Museum1FScript0
@@ -40,207 +41,25 @@ Museum1FTextPointers: ; 5c12b (17:412b)
Museum1FText1: ; 5c135 (17:4135)
TX_ASM
- ld a, [wYCoord]
- cp $4
- jr nz, .asm_8774b
- ld a, [wXCoord]
- cp $d
- jp z, Museum1FScript_5c1f9
- jr .asm_b8709
-.asm_8774b
- cp $3
- jr nz, .asm_d49e7
- ld a, [wXCoord]
- cp $c
- jp z, Museum1FScript_5c1f9
-.asm_d49e7
- CheckEvent EVENT_BOUGHT_MUSEUM_TICKET
- jr nz, .asm_31a16
- ld hl, Museum1FText_5c23d
- call PrintText
- jp Museum1FScriptEnd
-.asm_b8709
- CheckEvent EVENT_BOUGHT_MUSEUM_TICKET
- jr z, .asm_3ded4
-.asm_31a16
- ld hl, Museum1FText_5c242
- call PrintText
- jp Museum1FScriptEnd
-.asm_3ded4
- ld a, MONEY_BOX
- ld [wTextBoxID], a
- call DisplayTextBoxID
- xor a
- ld [hJoyHeld], a
- ld hl, Museum1FText_5c21f
- call PrintText
- call YesNoChoice
- ld a, [wCurrentMenuItem]
- and a
- jr nz, .asm_de133
- xor a
- ld [hMoney], a
- ld [hMoney + 1], a
- ld a, $50
- ld [hMoney + 2], a
- call HasEnoughMoney
- jr nc, .asm_0f3e3
- ld hl, Museum1FText_5c229
- call PrintText
- jp .asm_de133
-.asm_0f3e3
- ld hl, Museum1FText_5c224
- call PrintText
- SetEvent EVENT_BOUGHT_MUSEUM_TICKET
- xor a
- ld [wPriceTemp], a
- ld [wPriceTemp + 1], a
- ld a, $50
- ld [wPriceTemp + 2], a
- ld hl, wPriceTemp + 2
- ld de, wPlayerMoney + 2
- ld c, $3
- predef SubBCDPredef
- ld a, MONEY_BOX
- ld [wTextBoxID], a
- call DisplayTextBoxID
- ld a, SFX_PURCHASE
- call PlaySoundWaitForCurrent
- call WaitForSoundToFinish
- jr .asm_0b094
-.asm_de133
- ld hl, Museum1FText_5c21a
- call PrintText
- ld a, $1
- ld [wSimulatedJoypadStatesIndex], a
- ld a, D_DOWN
- ld [wSimulatedJoypadStatesEnd], a
- call StartSimulatingJoypadStates
- call UpdateSprites
- jr Museum1FScriptEnd
-.asm_0b094
- ld a, $1
- ld [W_MUSEUM1FCURSCRIPT], a
- jr Museum1FScriptEnd
-
-Museum1FScript_5c1f9: ; 5c1f9 (17:41f9)
- ld hl, Museum1FText_5c22e
- call PrintText
- call YesNoChoice
- ld a, [wCurrentMenuItem]
- cp $0
- jr nz, .asm_d1144
- ld hl, Museum1FText_5c233
- call PrintText
- jr Museum1FScriptEnd
-.asm_d1144
- ld hl, Museum1FText_5c238
- call PrintText
-Museum1FScriptEnd: ; 5c217 (17:4217)
+ callba Func_f1c1b
jp TextScriptEnd
-Museum1FText_5c21a: ; 5c21a (17:421a)
- TX_FAR _Museum1FText_5c21a
- db "@"
-
-Museum1FText_5c21f: ; 5c21f (17:421f)
- TX_FAR _Museum1FText_5c21f
- db "@"
-
-Museum1FText_5c224: ; 5c224 (17:4224)
- TX_FAR _Museum1FText_5c224
- db "@"
-
-Museum1FText_5c229: ; 5c229 (17:4229)
- TX_FAR _Museum1FText_5c229
- db "@"
-
-Museum1FText_5c22e: ; 5c22e (17:422e)
- TX_FAR _Museum1FText_5c22e
- db "@"
-
-Museum1FText_5c233: ; 5c233 (17:4233)
- TX_FAR _Museum1FText_5c233
- db "@"
-
-Museum1FText_5c238: ; 5c238 (17:4238)
- TX_FAR _Museum1FText_5c238
- db "@"
-
-Museum1FText_5c23d: ; 5c23d (17:423d)
- TX_FAR _Museum1FText_5c23d
- db "@"
-
-Museum1FText_5c242: ; 5c242 (17:4242)
- TX_FAR _Museum1FText_5c242
- db "@"
-
-Museum1FText2: ; 5c247 (17:4247)
+Museum1FText2: ; 5c135 (17:4135)
TX_ASM
- ld hl, Museum1FText_5c251
- call PrintText
+ callba Func_f1d2a
jp TextScriptEnd
-Museum1FText_5c251: ; 5c251 (17:4251)
- TX_FAR _Museum1FText_5c251
- db "@"
-
-Museum1FText3: ; 5c256 (17:4256)
+Museum1FText3: ; 5c135 (17:4135)
TX_ASM
- CheckEvent EVENT_GOT_OLD_AMBER
- jr nz, .asm_5c285
- ld hl, Museum1FText_5c28e
- call PrintText
- lb bc, OLD_AMBER, 1
- call GiveItem
- jr nc, .BagFull
- SetEvent EVENT_GOT_OLD_AMBER
- ld a, HS_OLD_AMBER
- ld [wMissableObjectIndex], a
- predef HideObject
- ld hl, ReceivedOldAmberText
- jr .asm_5c288
-.BagFull
- ld hl, Museum1FText_5c29e
- jr .asm_5c288
-.asm_5c285
- ld hl, Museum1FText_5c299
-.asm_5c288
- call PrintText
+ callba Func_f1d36
jp TextScriptEnd
-Museum1FText_5c28e: ; 5c28e (17:428e)
- TX_FAR _Museum1FText_5c28e
- db "@"
-
-ReceivedOldAmberText: ; 5c293 (17:4293)
- TX_FAR _ReceivedOldAmberText
- db $0B, "@"
-
-Museum1FText_5c299: ; 5c299 (17:4299)
- TX_FAR _Museum1FText_5c299
- db "@"
-
-Museum1FText_5c29e: ; 5c29e (17:429e)
- TX_FAR _Museum1FText_5c29e
- db "@"
-
-Museum1FText4: ; 5c2a3 (17:42a3)
+Museum1FText4: ; 5c135 (17:4135)
TX_ASM
- ld hl, Museum1FText_5c2ad
- call PrintText
+ callba Func_f1d80
jp TextScriptEnd
-Museum1FText_5c2ad: ; 5c2ad (17:42ad)
- TX_FAR _Museum1FText_5c2ad
- db "@"
-
-Museum1FText5: ; 5c2b2 (17:42b2)
+Museum1FText5: ; 5c135 (17:4135)
TX_ASM
- ld hl, Museum1FText_5c2bc
- call PrintText
+ callba Func_f1d8c
jp TextScriptEnd
-
-Museum1FText_5c2bc: ; 5c2bc (17:42bc)
- TX_FAR _Museum1FText_5c2bc
- db "@"