summaryrefslogtreecommitdiff
path: root/scripts/route16gate.asm
diff options
context:
space:
mode:
authorU-Fish-PC\Daniel <corrnondacqb@yahoo.com>2014-05-18 14:19:10 -0400
committerU-Fish-PC\Daniel <corrnondacqb@yahoo.com>2014-05-18 14:19:10 -0400
commit24c01b09bb2b617812bd826d1cf9ab5e3ec6a023 (patch)
tree07d2ed81b23de081f2003d9f8d50170344dd5ada /scripts/route16gate.asm
parent4e4e72d02a5a202daea3a73363d2a4c3ba34e724 (diff)
Pull map scripts out of main.asm
Diffstat (limited to 'scripts/route16gate.asm')
-rwxr-xr-xscripts/route16gate.asm121
1 files changed, 121 insertions, 0 deletions
diff --git a/scripts/route16gate.asm b/scripts/route16gate.asm
new file mode 100755
index 00000000..5131a1ff
--- /dev/null
+++ b/scripts/route16gate.asm
@@ -0,0 +1,121 @@
+Route16GateScript: ; 496be (12:56be)
+ ld hl, $d732
+ res 5, [hl]
+ call EnableAutoTextBoxDrawing
+ ld a, [W_ROUTE16GATECURSCRIPT]
+ ld hl, Route16GateScriptPointers
+ jp CallFunctionInTable
+
+Route16GateScriptPointers: ; 496cf (12:56cf)
+ dw Route16GateScript0
+ dw Route16GateScript1
+ dw Route16GateScript2
+ dw Route16GateScript3
+
+Route16GateScript0: ; 496d7 (12:56d7)
+ call Func_49755
+ ret nz
+ ld hl, CoordsData_49714
+ call ArePlayerCoordsInArray
+ ret nc
+ ld a, $3
+ ld [$ff8c], a
+ call DisplayTextID
+ xor a
+ ld [H_CURRENTPRESSEDBUTTONS], a
+ ld a, [$cd3d]
+ cp $1
+ jr z, .asm_4970e ; 0x496f1 $1b
+ ld a, [$cd3d]
+ dec a
+ ld [$cd38], a
+ ld b, $0
+ ld c, a
+ ld a, $40
+ ld hl, $ccd3
+ call FillMemory
+ call Func_3486
+ ld a, $1
+ ld [W_ROUTE16GATECURSCRIPT], a
+ ret
+.asm_4970e
+ ld a, $2
+ ld [W_ROUTE16GATECURSCRIPT], a
+ ret
+
+CoordsData_49714: ; 49714 (12:5714)
+ db $07,$04
+ db $08,$04
+ db $09,$04
+ db $0A,$04
+ db $FF
+
+Route16GateScript1: ; 4971d (12:571d)
+ ld a, [$cd38]
+ and a
+ ret nz
+ ld a, $f0
+ ld [wJoypadForbiddenButtonsMask], a
+
+Route16GateScript2: ; 49727 (12:5727)
+ ld a, $1
+ ld [H_SPRITEHEIGHT], a
+ call DisplayTextID
+ ld a, $1
+ ld [$cd38], a
+ ld a, $10
+ ld [$ccd3], a
+ call Func_3486
+ ld a, $3
+ ld [W_ROUTE16GATECURSCRIPT], a
+ ret
+
+Route16GateScript3: ; 49741 (12:5741)
+ ld a, [$cd38]
+ and a
+ ret nz
+ xor a
+ ld [wJoypadForbiddenButtonsMask], a
+ ld hl, $d730
+ res 7, [hl]
+ ld a, $0
+ ld [W_ROUTE16GATECURSCRIPT], a
+ ret
+
+Func_49755: ; 49755 (12:5755)
+ ld b, BICYCLE
+ jp IsItemInBag
+
+Route16GateTextPointers: ; 4975a (12:575a)
+ dw Route16GateText1
+ dw Route16GateText2
+ dw Route16GateText3
+
+Route16GateText1: ; 49760 (12:5760)
+ db $08 ; asm
+ call Func_49755
+ jr z, .asm_0bdf3 ; 0x49764
+ ld hl, Route16GateText_4977c
+ call PrintText
+ jr .asm_56c9d ; 0x4976c
+.asm_0bdf3 ; 0x4976e
+ ld hl, Route16GateText_49777
+ call PrintText
+.asm_56c9d ; 0x49774
+ jp TextScriptEnd
+
+Route16GateText_49777: ; 49777 (12:5777)
+ TX_FAR _Route16GateText_49777
+ db "@"
+
+Route16GateText_4977c: ; 4977c (12:577c)
+ TX_FAR _Route16GateText_4977c
+ db "@"
+
+Route16GateText3: ; 49781 (12:5781)
+ TX_FAR _Route16GateText_49781
+ db "@"
+
+Route16GateText2: ; 49786 (12:5786)
+ TX_FAR _Route16GateText2
+ db "@"