summaryrefslogtreecommitdiff
path: root/scripts/route18gate.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/route18gate.asm
parent4e4e72d02a5a202daea3a73363d2a4c3ba34e724 (diff)
Pull map scripts out of main.asm
Diffstat (limited to 'scripts/route18gate.asm')
-rwxr-xr-xscripts/route18gate.asm112
1 files changed, 112 insertions, 0 deletions
diff --git a/scripts/route18gate.asm b/scripts/route18gate.asm
new file mode 100755
index 00000000..d55ed412
--- /dev/null
+++ b/scripts/route18gate.asm
@@ -0,0 +1,112 @@
+Route18GateScript: ; 49876 (12:5876)
+ ld hl, $d732
+ res 5, [hl]
+ call EnableAutoTextBoxDrawing
+ ld a, [W_ROUTE18GATECURSCRIPT]
+ ld hl, Route18GateScriptPointers
+ jp CallFunctionInTable
+
+Route18GateScriptPointers: ; 49887 (12:5887)
+ dw Route18GateScript0
+ dw Route18GateScript1
+ dw Route18GateScript2
+ dw Route18GateScript3
+
+Route18GateScript0: ; 4988f (12:588f)
+ call Func_49755
+ ret nz
+ ld hl, CoordsData_498cc
+ call ArePlayerCoordsInArray
+ ret nc
+ ld a, $2
+ ld [$ff8c], a
+ call DisplayTextID
+ xor a
+ ld [H_CURRENTPRESSEDBUTTONS], a
+ ld a, [$cd3d]
+ cp $1
+ jr z, .asm_498c6 ; 0x498a9 $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_ROUTE18GATECURSCRIPT], a
+ ret
+.asm_498c6
+ ld a, $2
+ ld [W_ROUTE18GATECURSCRIPT], a
+ ret
+
+CoordsData_498cc: ; 498cc (12:58cc)
+ db $03,$04
+ db $04,$04
+ db $05,$04
+ db $06,$04
+ db $FF
+
+Route18GateScript1: ; 498d5 (12:58d5)
+ ld a, [$cd38]
+ and a
+ ret nz
+ ld a, $f0
+ ld [wJoypadForbiddenButtonsMask], a
+
+Route18GateScript2: ; 498df (12:58df)
+ 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_ROUTE18GATECURSCRIPT], a
+ ret
+
+Route18GateScript3: ; 498f9 (12:58f9)
+ ld a, [$cd38]
+ and a
+ ret nz
+ xor a
+ ld [wJoypadForbiddenButtonsMask], a
+ ld hl, $d730
+ res 7, [hl]
+ ld a, $0
+ ld [W_ROUTE18GATECURSCRIPT], a
+ ret
+
+Route18GateTextPointers: ; 4990d (12:590d)
+ dw Route18GateText1
+ dw Route18GateText2
+
+Route18GateText1: ; 49911 (12:5911)
+ db $08 ; asm
+ call Func_49755
+ jr z, .asm_3c84d ; 0x49915
+ ld hl, Route18GateText_4992d
+ call PrintText
+ jr .asm_a8410 ; 0x4991d
+.asm_3c84d ; 0x4991f
+ ld hl, Route18GateText_49928
+ call PrintText
+.asm_a8410 ; 0x49925
+ jp TextScriptEnd
+
+Route18GateText_49928: ; 49928 (12:5928)
+ TX_FAR _Route18GateText_49928
+ db "@"
+
+Route18GateText_4992d: ; 4992d (12:592d)
+ TX_FAR _Route18GateText_4992d
+ db "@"
+
+Route18GateText2: ; 49932 (12:5932)
+ TX_FAR _Route18GateText_49932
+ db "@"