;============================================================================ ; Faxanadu (U).nes ; ; PRG12 ($8000 - $bfff) ;============================================================================
.segment "PRG12" .reloc [8000]00.byte $00; [0]: [8001]00.byte $00; [1]: [8002]00.byte $00; [2]: [8003]00.byte $00; [3]: [8004]00.byte $00; [4]: [8005]c0.byte $c0; [5]: [8006]bf.byte $bf; [6]: [8007]bf.byte $bf; [7]: [8008]bf.byte $bf; [8]: [8009]bf.byte $bf; [9]: [800a]bf.byte $bf; [10]: [800b]bf.byte $bf; [11]: [800c]bf.byte $bf; [12]: [800d]bf.byte $bf; [13]: [800e]bf.byte $bf; [14]: [800f]bf.byte $bf; [15]: [8010]bf.byte $bf; [16]: [8011]bf.byte $bf; [17]: [8012]bf.byte $bf; [18]: [8013]bf.byte $bf; [19]: [8014]bf.byte $bf; [20]: [8015]bf.byte $bf; [21]: [8016]cf.byte $cf; [22]: [8017]00.byte $00; [23]: [8018]00.byte $00; [24]: [8019]00.byte $00; [25]: [801a]00.byte $00; [26]: [801b]00.byte $00; [27]: [801c]c0.byte $c0; [0]: [801d]bf.byte $bf; [1]: [801e]bf.byte $bf; [2]: [801f]bf.byte $bf; [3]: [8020]bf.byte $bf; [4]: [8021]ce.byte $ce; [5]: [8022]00.byte $00; [6]: [8023]00.byte $00; [7]: [8024]00.byte $00; [8]: [8025]c8.byte $c8; [9]: [8026]00.byte $00; [10]: [8027]00.byte $00; [11]: [8028]00.byte $00; [12]: [8029]be.byte $be; [13]: [802a]b9.byte $b9; [14]: [802b]ac.byte $ac; [15]: [802c]b3.byte $b3; [16]: [802d]b4.byte $b4; [17]: [802e]00.byte $00; [18]: [802f]00.byte $00; [19]: [8030]bc.byte $bc; [20]: [8031]00.byte $00; [21]: [8032]cd.byte $cd; [22]: [8033]bf.byte $bf; [23]: [8034]bf.byte $bf; [24]: [8035]bf.byte $bf; [25]: [8036]bf.byte $bf; [26]: [8037]cf.byte $cf; [27]: [8038]cb.byte $cb; [0]: [8039]00.byte $00; [1]: [803a]c8.byte $c8; [2]: [803b]00.byte $00; [3]: [803c]00.byte $00; [4]: [803d]00.byte $00; [5]: [803e]00.byte $00; [6]: [803f]bc.byte $bc; [7]: [8040]cc.byte $cc; [8]: [8041]00.byte $00; [9]: [8042]00.byte $00; [10]: [8043]c1.byte $c1; [11]: [8044]c2.byte $c2; [12]: [8045]00.byte $00; [13]: [8046]ab.byte $ab; [14]: [8047]ac.byte $ac; [15]: [8048]b3.byte $b3; [16]: [8049]b4.byte $b4; [17]: [804a]bc.byte $bc; [18]: [804b]00.byte $00; [19]: [804c]00.byte $00; [20]: [804d]00.byte $00; [21]: [804e]00.byte $00; [22]: [804f]00.byte $00; [23]: [8050]00.byte $00; [24]: [8051]00.byte $00; [25]: [8052]00.byte $00; [26]: [8053]cb.byte $cb; [27]: [8054]cb.byte $cb; [0]: [8055]00.byte $00; [1]: [8056]01.byte $01; [2]: [8057]02.byte $02; [3]: [8058]03.byte $03; [4]: [8059]00.byte $00; [5]: [805a]00.byte $00; [6]: [805b]00.byte $00; [7]: [805c]00.byte $00; [8]: [805d]00.byte $00; [9]: [805e]d0.byte $d0; [10]: [805f]d1.byte $d1; [11]: [8060]d2.byte $d2; [12]: [8061]d0.byte $d0; [13]: [8062]ab.byte $ab; [14]: [8063]ac.byte $ac; [15]: [8064]b3.byte $b3; [16]: [8065]b4.byte $b4; [17]: [8066]c8.byte $c8; [18]: [8067]00.byte $00; [19]: [8068]00.byte $00; [20]: [8069]c8.byte $c8; [21]: [806a]00.byte $00; [22]: [806b]00.byte $00; [23]: [806c]9d.byte $9d; [24]: [806d]9e.byte $9e; [25]: [806e]9f.byte $9f; [26]: [806f]cb.byte $cb; [27]: [8070]cb.byte $cb; [0]: [8071]10.byte $10; [1]: [8072]11.byte $11; [2]: [8073]12.byte $12; [3]: [8074]13.byte $13; [4]: [8075]14.byte $14; [5]: [8076]15.byte $15; [6]: [8077]bc.byte $bc; [7]: [8078]00.byte $00; [8]: [8079]d0.byte $d0; [9]: [807a]b5.byte $b5; [10]: [807b]b6.byte $b6; [11]: [807c]b7.byte $b7; [12]: [807d]b8.byte $b8; [13]: [807e]b6.byte $b6; [14]: [807f]b8.byte $b8; [15]: [8080]b3.byte $b3; [16]: [8081]b4.byte $b4; [17]: [8082]00.byte $00; [18]: [8083]c8.byte $c8; [19]: [8084]00.byte $00; [20]: [8085]9c.byte $9c; [21]: [8086]a0.byte $a0; [22]: [8087]a1.byte $a1; [23]: [8088]a2.byte $a2; [24]: [8089]a3.byte $a3; [25]: [808a]a4.byte $a4; [26]: [808b]cb.byte $cb; [27]: [808c]cb.byte $cb; [0]: [808d]20.byte $20; [1]: [808e]21.byte $21; [2]: [808f]22.byte $22; [3]: [8090]23.byte $23; [4]: [8091]24.byte $24; [5]: [8092]25.byte $25; [6]: [8093]26.byte $26; [7]: [8094]27.byte $27; [8]: [8095]c9.byte $c9; [9]: [8096]ca.byte $ca; [10]: [8097]c9.byte $c9; [11]: [8098]ca.byte $ca; [12]: [8099]ca.byte $ca; [13]: [809a]ca.byte $ca; [14]: [809b]ca.byte $ca; [15]: [809c]b3.byte $b3; [16]: [809d]b4.byte $b4; [17]: [809e]bc.byte $bc; [18]: [809f]2a.byte $2a; [19]: [80a0]2b.byte $2b; [20]: [80a1]a5.byte $a5; [21]: [80a2]a6.byte $a6; [22]: [80a3]a7.byte $a7; [23]: [80a4]a8.byte $a8; [24]: [80a5]a9.byte $a9; [25]: [80a6]aa.byte $aa; [26]: [80a7]cb.byte $cb; [27]: [80a8]cb.byte $cb; [0]: [80a9]30.byte $30; [1]: [80aa]31.byte $31; [2]: [80ab]32.byte $32; [3]: [80ac]33.byte $33; [4]: [80ad]34.byte $34; [5]: [80ae]35.byte $35; [6]: [80af]36.byte $36; [7]: [80b0]37.byte $37; [8]: [80b1]38.byte $38; [9]: [80b2]39.byte $39; [10]: [80b3]ad.byte $ad; [11]: [80b4]ad.byte $ad; [12]: [80b5]ae.byte $ae; [13]: [80b6]ad.byte $ad; [14]: [80b7]3e.byte $3e; [15]: [80b8]3f.byte $3f; [16]: [80b9]04.byte $04; [17]: [80ba]05.byte $05; [18]: [80bb]06.byte $06; [19]: [80bc]07.byte $07; [20]: [80bd]08.byte $08; [21]: [80be]09.byte $09; [22]: [80bf]0a.byte $0a; [23]: [80c0]00.byte $00; [24]: [80c1]0b.byte $0b; [25]: [80c2]0c.byte $0c; [26]: [80c3]cb.byte $cb; [27]: [80c4]cb.byte $cb; [0]: [80c5]00.byte $00; [1]: [80c6]00.byte $00; [2]: [80c7]42.byte $42; [3]: [80c8]43.byte $43; [4]: [80c9]44.byte $44; [5]: [80ca]45.byte $45; [6]: [80cb]46.byte $46; [7]: [80cc]47.byte $47; [8]: [80cd]48.byte $48; [9]: [80ce]49.byte $49; [10]: [80cf]4a.byte $4a; [11]: [80d0]4b.byte $4b; [12]: [80d1]4c.byte $4c; [13]: [80d2]4d.byte $4d; [14]: [80d3]4e.byte $4e; [15]: [80d4]4f.byte $4f; [16]: [80d5]0d.byte $0d; [17]: [80d6]0e.byte $0e; [18]: [80d7]0f.byte $0f; [19]: [80d8]16.byte $16; [20]: [80d9]17.byte $17; [21]: [80da]18.byte $18; [22]: [80db]19.byte $19; [23]: [80dc]1a.byte $1a; [24]: [80dd]1b.byte $1b; [25]: [80de]00.byte $00; [26]: [80df]cb.byte $cb; [27]: [80e0]cb.byte $cb; [0]: [80e1]00.byte $00; [1]: [80e2]00.byte $00; [2]: [80e3]52.byte $52; [3]: [80e4]53.byte $53; [4]: [80e5]54.byte $54; [5]: [80e6]55.byte $55; [6]: [80e7]56.byte $56; [7]: [80e8]57.byte $57; [8]: [80e9]58.byte $58; [9]: [80ea]59.byte $59; [10]: [80eb]5a.byte $5a; [11]: [80ec]5b.byte $5b; [12]: [80ed]5c.byte $5c; [13]: [80ee]5d.byte $5d; [14]: [80ef]5e.byte $5e; [15]: [80f0]5f.byte $5f; [16]: [80f1]1d.byte $1d; [17]: [80f2]1e.byte $1e; [18]: [80f3]1f.byte $1f; [19]: [80f4]28.byte $28; [20]: [80f5]29.byte $29; [21]: [80f6]2c.byte $2c; [22]: [80f7]2d.byte $2d; [23]: [80f8]2e.byte $2e; [24]: [80f9]2f.byte $2f; [25]: [80fa]00.byte $00; [26]: [80fb]cb.byte $cb; [27]: [80fc]cb.byte $cb; [0]: [80fd]00.byte $00; [1]: [80fe]bc.byte $bc; [2]: [80ff]62.byte $62; [3]: [8100]63.byte $63; [4]: [8101]64.byte $64; [5]: [8102]65.byte $65; [6]: [8103]66.byte $66; [7]: [8104]67.byte $67; [8]: [8105]68.byte $68; [9]: [8106]69.byte $69; [10]: [8107]6a.byte $6a; [11]: [8108]6b.byte $6b; [12]: [8109]6c.byte $6c; [13]: [810a]6d.byte $6d; [14]: [810b]6e.byte $6e; [15]: [810c]6f.byte $6f; [16]: [810d]3a.byte $3a; [17]: [810e]3b.byte $3b; [18]: [810f]3c.byte $3c; [19]: [8110]3d.byte $3d; [20]: [8111]40.byte $40; [21]: [8112]41.byte $41; [22]: [8113]50.byte $50; [23]: [8114]51.byte $51; [24]: [8115]60.byte $60; [25]: [8116]00.byte $00; [26]: [8117]cb.byte $cb; [27]: [8118]cb.byte $cb; [0]: [8119]00.byte $00; [1]: [811a]00.byte $00; [2]: [811b]72.byte $72; [3]: [811c]73.byte $73; [4]: [811d]74.byte $74; [5]: [811e]75.byte $75; [6]: [811f]76.byte $76; [7]: [8120]77.byte $77; [8]: [8121]78.byte $78; [9]: [8122]79.byte $79; [10]: [8123]7a.byte $7a; [11]: [8124]7b.byte $7b; [12]: [8125]7c.byte $7c; [13]: [8126]7d.byte $7d; [14]: [8127]7e.byte $7e; [15]: [8128]7f.byte $7f; [16]: [8129]61.byte $61; [17]: [812a]70.byte $70; [18]: [812b]71.byte $71; [19]: [812c]80.byte $80; [20]: [812d]90.byte $90; [21]: [812e]91.byte $91; [22]: [812f]92.byte $92; [23]: [8130]93.byte $93; [24]: [8131]00.byte $00; [25]: [8132]00.byte $00; [26]: [8133]cb.byte $cb; [27]: [8134]cb.byte $cb; [0]: [8135]00.byte $00; [1]: [8136]81.byte $81; [2]: [8137]82.byte $82; [3]: [8138]83.byte $83; [4]: [8139]84.byte $84; [5]: [813a]85.byte $85; [6]: [813b]86.byte $86; [7]: [813c]83.byte $83; [8]: [813d]88.byte $88; [9]: [813e]89.byte $89; [10]: [813f]83.byte $83; [11]: [8140]8b.byte $8b; [12]: [8141]8c.byte $8c; [13]: [8142]8d.byte $8d; [14]: [8143]8e.byte $8e; [15]: [8144]8f.byte $8f; [16]: [8145]94.byte $94; [17]: [8146]95.byte $95; [18]: [8147]96.byte $96; [19]: [8148]97.byte $97; [20]: [8149]98.byte $98; [21]: [814a]83.byte $83; [22]: [814b]9a.byte $9a; [23]: [814c]9b.byte $9b; [24]: [814d]f3.byte $f3; [25]: [814e]ec.byte $ec; [26]: [814f]cb.byte $cb; [27]: [8150]cb.byte $cb; [0]: [8151]bc.byte $bc; [1]: [8152]00.byte $00; [2]: [8153]00.byte $00; [3]: [8154]bc.byte $bc; [4]: [8155]bc.byte $bc; [5]: [8156]bc.byte $bc; [6]: [8157]00.byte $00; [7]: [8158]c1.byte $c1; [8]: [8159]d3.byte $d3; [9]: [815a]00.byte $00; [10]: [815b]00.byte $00; [11]: [815c]00.byte $00; [12]: [815d]00.byte $00; [13]: [815e]c4.byte $c4; [14]: [815f]c5.byte $c5; [15]: [8160]b3.byte $b3; [16]: [8161]b4.byte $b4; [17]: [8162]00.byte $00; [18]: [8163]00.byte $00; [19]: [8164]00.byte $00; [20]: [8165]00.byte $00; [21]: [8166]00.byte $00; [22]: [8167]00.byte $00; [23]: [8168]00.byte $00; [24]: [8169]bc.byte $bc; [25]: [816a]00.byte $00; [26]: [816b]cb.byte $cb; [27]: [816c]cb.byte $cb; [0]: [816d]bb.byte $bb; [1]: [816e]d3.byte $d3; [2]: [816f]d3.byte $d3; [3]: [8170]c6.byte $c6; [4]: [8171]c7.byte $c7; [5]: [8172]cf.byte $cf; [6]: [8173]d0.byte $d0; [7]: [8174]d1.byte $d1; [8]: [8175]b7.byte $b7; [9]: [8176]b8.byte $b8; [10]: [8177]00.byte $00; [11]: [8178]c8.byte $c8; [12]: [8179]00.byte $00; [13]: [817a]d4.byte $d4; [14]: [817b]b1.byte $b1; [15]: [817c]b3.byte $b3; [16]: [817d]b4.byte $b4; [17]: [817e]c8.byte $c8; [18]: [817f]00.byte $00; [19]: [8180]c1.byte $c1; [20]: [8181]d3.byte $d3; [21]: [8182]00.byte $00; [22]: [8183]00.byte $00; [23]: [8184]d2.byte $d2; [24]: [8185]d3.byte $d3; [25]: [8186]c6.byte $c6; [26]: [8187]cb.byte $cb; [27]: [8188]cd.byte $cd; [0]: [8189]bf.byte $bf; [1]: [818a]bf.byte $bf; [2]: [818b]bf.byte $bf; [3]: [818c]cf.byte $cf; [4]: [818d]af.byte $af; [5]: [818e]bf.byte $bf; [6]: [818f]b0.byte $b0; [7]: [8190]b0.byte $b0; [8]: [8191]af.byte $af; [9]: [8192]bf.byte $bf; [10]: [8193]cf.byte $cf; [11]: [8194]c6.byte $c6; [12]: [8195]c7.byte $c7; [13]: [8196]99.byte $99; [14]: [8197]8a.byte $8a; [15]: [8198]87.byte $87; [16]: [8199]c3.byte $c3; [17]: [819a]bb.byte $bb; [18]: [819b]d0.byte $d0; [19]: [819c]d1.byte $d1; [20]: [819d]b7.byte $b7; [21]: [819e]b8.byte $b8; [22]: [819f]c0.byte $c0; [23]: [81a0]bf.byte $bf; [24]: [81a1]bf.byte $bf; [25]: [81a2]bf.byte $bf; [26]: [81a3]ce.byte $ce; [27]: [81a4]00.byte $00; [0]: [81a5]00.byte $00; [1]: [81a6]00.byte $00; [2]: [81a7]00.byte $00; [3]: [81a8]cd.byte $cd; [4]: [81a9]bf.byte $bf; [5]: [81aa]bf.byte $bf; [6]: [81ab]bf.byte $bf; [7]: [81ac]bf.byte $bf; [8]: [81ad]bf.byte $bf; [9]: [81ae]bf.byte $bf; [10]: [81af]bd.byte $bd; [11]: [81b0]af.byte $af; [12]: [81b1]b2.byte $b2; [13]: [81b2]b2.byte $b2; [14]: [81b3]b0.byte $b0; [15]: [81b4]bd.byte $bd; [16]: [81b5]af.byte $af; [17]: [81b6]bf.byte $bf; [18]: [81b7]b0.byte $b0; [19]: [81b8]bf.byte $bf; [20]: [81b9]af.byte $af; [21]: [81ba]bf.byte $bf; [22]: [81bb]ce.byte $ce; [23]: [81bc]00.byte $00; [24]: [81bd]00.byte $00; [25]: [81be]00.byte $00; [26]: [81bf]00.byte $00; [27]:
;============================================================================ ; Set the textbox coordinates and dimensions for an NPC. ; ; The textbox will always be set at: ; ; X = 10 ; Width = 20 ; Height = 8 ; ; If there's a portrait, or the player is high up on the screen: ; ; Y = 16 ; ; Otherwise, if the player is on the ground: ; ; Y = 6 ; ; INPUTS: ; Player_PosY: ; The Y position for the player. ; ; Temp_0201: ; The loaded IScript portrait ID. ; ; OUTPUTS: ; TextBox_X: ; The new X position of the textbox. ; ; TextBox_Y: ; The new Y position of the textbox. ; ; TextBox_Width: ; The new width of the textbox. ; ; TextBox_Height: ; The new height of the textbox. ; ; XREFS: ; IScripts_CloseCurrentTextBox ; TextBox_OpenForNPC ;============================================================================
[81c0]TextBox_SetCoordsForNPC: [81c0]a9 0aLDA #$0a [81c2]8d 08 02STA a:TextBox_X; Textbox X = 10 [81c5]a9 14LDA #$14 [81c7]8d 0a 02STA a:TextBox_Width; Textbox width = 20 [81ca]a9 08LDA #$08 [81cc]8d 0b 02STA a:TextBox_Height; Textbox height = 8
; ; Check if there's a portrait shown. ;
[81cf]ad 01 02LDA a:Temp_0201; Load the portrait ID from the IScript. [81d2]30 08BMI @_hasPortrait; If set, jump.
; ; There's no portrait. Set it based on the player's Y position. ; ; If the player is around the ground area, set it at Y = 6. ; ; If the player is higher up on the screen, move it downward to ; Y = 16 (same as the portrait). ;
[81d4]a0 06LDY #$06; Textbox Y = 6 [81d6]a5 a1LDA Player_PosY; Check the player's Y position. [81d8]c9 40CMP #$40; Is it >= 64? [81da]b0 02BCS @_setYAndReturn; If so, jump to return. [81dc]@_hasPortrait: [81dc]a0 10LDY #$10; Textbox Y = 16 [81de]@_setYAndReturn: [81de]8c 09 02STY a:TextBox_Y; Set the textbox Y position. [81e1]60RTS
;============================================================================ ; Open a textbox for NPC dialogue. ; ; This positions the textbox and fills it with temporary ; placeholder text in preparation for drawing the NPC's ; message text. ; ; INPUTS: ; See falls through. ; ; OUTPUTS: ; See falls through. ; ; CALLS: ; TextBox_SetCoordsForNPC ; TextBox_Open ; ; FALLS THROUGH: ; IScripts_PositionAndFillPlaceholderText ; ; XREFS: ; IScriptAction_ShowSellMenu ; IScripts_Begin ; Maybe_Shop_DrawTextBox ;============================================================================
[81e2]TextBox_OpenForNPC: [81e2]20 c0 81JSR TextBox_SetCoordsForNPC; Set textbox coordinates for an NPC dialogue. [81e5]20 f1 8eJSR TextBox_Open; Open the textbox.
; ; v-- Fall through --v ;
;============================================================================ ; Position the text X/Y position in a textbox and fill with placeholder text. ; ; This is done in preparation for clearing out a textbox and ; removing it from the screen. ; ; INPUTS: ; TextBox_X: ; The textbox X position. ; ; TextBox_Y: ; The textbox Y position. ; ; OUTPUTS: ; TextBox_ContentsX: ; The text X position. ; ; TextBox_ContentsY: ; The text Y position. ; ; CALLS: ; IScripts_FillPlaceholderText ; ; XREFS: ; IScriptAction_AddInventoryItem ; IScriptAction_ShowQuestionMessage ;============================================================================
[81e8]IScripts_PositionAndFillPlaceholderText:
; ; Set the X position for text within the textbox. ;
[81e8]ad 08 02LDA a:TextBox_X; Load the textbox X. [81eb]18CLC [81ec]69 02ADC #$02; Add 2. [81ee]85 eaSTA TextBox_ContentsX; Set as the text draw X position.
; ; Set the Y position for text within the textbox. ;
[81f0]ad 09 02LDA a:TextBox_Y; Load the textbox Y. [81f3]18CLC [81f4]69 02ADC #$02; Add 2. [81f6]85 ebSTA TextBox_ContentsY; Set as the text draw Y position.
; ; Fill with placeholder text. ;
[81f8]4c 10 99JMP IScripts_FillPlaceholderText; Fill the textbox.
;============================================================================ ; Close the opened textbox for the IScript. ; ; INPUTS: ; None. ; ; OUTPUTS: ; None. ; ; CALLS: ; TextBox_Close ; TextBox_SetCoordsForNPC ; ; XREFS: ; IScriptAction_EndScript ;============================================================================
[81fb]IScripts_CloseCurrentTextBox: [81fb]20 c0 81JSR TextBox_SetCoordsForNPC; Set textbox coordinates for an NPC dialogue. [81fe]4c 02 90JMP TextBox_Close; Close the textbox.
;============================================================================ ; Set the textbox coordinates for a portrait. ; ; INPUTS: ; None. ; ; OUTPUTS: ; TextBox_X: ; The new X coordinate. ; ; TextBox_Y: ; The new Y coordinate. ; ; TextBox_Width: ; The new width. ; ; TextBox_Height: ; The new height. ; ; XREFS: ; DEADCODE_TextBox_ClosePortrait ; IScripts_OpenForPortrait ;============================================================================
[8201]TextBox_SetCoordsForPortrait: [8201]a9 02LDA #$02 [8203]8d 08 02STA a:TextBox_X; X = 2 [8206]a9 0eLDA #$0e [8208]8d 09 02STA a:TextBox_Y; Y = 14 [820b]a9 08LDA #$08 [820d]8d 0a 02STA a:TextBox_Width; Width = 8 [8210]a9 0aLDA #$0a [8212]8d 0b 02STA a:TextBox_Height; Height = 10 [8215]60RTS
;============================================================================ ; Set the sprite X, Y position to the interior of the portrait frame. ; ; This position is relative to the top of the playable screen (below ; the HUD). ; ; INPUTS: ; None ; ; OUTPUTS: ; Arg_DrawSprite_PosX: ; The X position to draw into (0x18) ; ; Arg_DrawSprite_PosY: ; The Y position to draw into (0x58) ; ; XREFS: ; IScripts_UpdatePortraitAnimation ;============================================================================
[8216]IScripts_SetPortraitSpriteXY: [8216]a2 18LDX #$18 [8218]86 27STX Arg_DrawSprite_PosX; Draw X = 24 [821a]a2 58LDX #$58 [821c]86 28STX Arg_DrawSprite_PosY; Draw Y = 88 [821e]60RTS
;============================================================================ ; Open a textbox frame for a portrait. ; ; This positions the textbox at the position and size ; for a portrait in preparation for drawing the portrait ; picture. ; ; INPUTS: ; None. ; ; OUTPUTS: ; None. ; ; CALLS: ; TextBox_SetCoordsForNPC ; TextBox_SetCoordsForPortrait ; ; XREFS: ; IScripts_Begin ;============================================================================
[821f]IScripts_OpenForPortrait: [821f]20 01 82JSR TextBox_SetCoordsForPortrait; Set textbox coordinates for the portrait. [8222]4c f1 8eJMP TextBox_Open; Open the textbox.
;============================================================================ ; DEADCODE: Close a portrait textbox. ;============================================================================
[8225]DEADCODE_TextBox_ClosePortrait: [8225]20 01 82JSR TextBox_SetCoordsForPortrait [8228]4c 02 90JMP TextBox_Close
;============================================================================ ; Close the textbox for both the portrait and textbox. ; ; This effectively closes both textboxes on the screen at ; once by taking the entire dimensions of both and replacing ; them with the screen's tiles. ; ; NOTE: ; Based on the DEADCODE function above, this used to be ; split into portrait-specific and dialogue-specific ; textbox closing logic, but they likely determined this ; was faster or cheaper. ; ; INPUTS: ; None. ; ; OUTPUTS: ; TextBox_X: ; TextBox_Y: ; TextBox_Width: ; TextBox_Height: ; Clobbered. ; ; CALLS: ; TextBox_Close ; ; XREFS: ; IScriptAction_EndScript ;============================================================================
[822b]TextBox_ClearForPortraitAndText: [822b]a9 02LDA #$02 [822d]8d 08 02STA a:TextBox_X; X = 2 [8230]a9 08LDA #$08 [8232]8d 09 02STA a:TextBox_Y; Y = 8 [8235]a9 1eLDA #$1e [8237]8d 0a 02STA a:TextBox_Width; Width = 30 [823a]a9 14LDA #$14 [823c]8d 0b 02STA a:TextBox_Height; Height = 20 [823f]4c 02 90JMP TextBox_Close; Close the textbox.
;============================================================================ ; Begin running an IScript. ; ; This will start loading the IScript to run. Based on ; that script, this may display a portrait for an entity. ; ; Once loaded, a text window will be shown and the first ; action of the script will be executed. ; ; INPUTS: ; A: ; The entrypoint offset of the IScript to run. ; ; ISCRIPT_ADDRS_U: ; ISCRIPT_ADDRS_L: ; The lookup table of IScript entrypoints. ; ; OUTPUTS: ; IScriptOrCHRAddr: ; IScriptOrCHRAddr+1: ; The read address for the IScript. ; ; Temp_0201: ; The entity ID of the IScript, for portrait ; display. ; ; Temp_0200: ; The IScript entrypoint index. ; ; IScriptOffset: ; The byte offset into the script. ; ; CALLS: ; IScripts_LoadPortraitTiles ; IScripts_OpenForPortrait ; TextBox_OpenForNPC ; IScripts_LoadByte ; ; XREFS: ; Player_CheckHandlePressUpOnNPC ; Game_UnlockDoorWithUsableItem ; Player_PickUpBattleHelmet ; Player_PickUpBattleSuit ; Player_PickUpBlackOnyx ; Player_PickUpDragonSlayer ; Player_PickUpElixir ; Player_PickUpGlove ; Player_PickUpHourGlass ; Player_PickUpMattock ; Player_PickUpOintment ; Player_PickUpRedPotion ; Player_PickUpWingBoots ; Player_UseHourGlass ; Player_UseMattock ; Player_UseRedPotion ; Player_UseWingBoots ;============================================================================
[8242]IScripts_Begin:
; ; If this is 0xFF, map to the "Remember Your Mantra." ;
[8242]c9 ffCMP #$ff; Compare the start offset to 0xFF. [8244]d0 02BNE @_loadScript; If equal, jump. [8246]a9 1fLDA #$1f; Set the start offset to 0x1F.
; ; Load the script address from the table. ;
[8248]@_loadScript: [8248]8d 00 02STA a:Temp_0200; Store the index temporarily. [824b]aaTAX; X = A [824c]bd 6b 9fLDA a:ISCRIPT_ADDRS_L,X; Load the lower byte of the IScript address. [824f]85 dbSTA IScriptOrCHRAddr; Store as the lower byte. [8251]bd 03 a0LDA a:ISCRIPT_ADDRS_U,X; Load the upper byte of the IScript address. [8254]85 dcSTA IScriptOrCHRAddr_U; Store as the upper byte. [8256]a0 00LDY #$00; Y = 0 (start offset in the script). [8258]b1 dbLDA (IScriptOrCHRAddr),Y; Load the first byte of the script (portrait ID). [825a]8d 01 02STA a:Temp_0201; Store it for the duration of the script. [825d]10 08BPL @_continueScript; If not a portrait ID, jump.
; ; Begin showing the portrait information. ;
[825f]29 7fAND #$7f; Keep the portrait ID bits. [8261]20 4d f2JSR IScripts_LoadPortraitTiles; Draw the portrait image. [8264]20 1f 82JSR IScripts_OpenForPortrait; Draw the portrait frame. [8267]@_continueScript: [8267]20 e2 81JSR TextBox_OpenForNPC; Open the text window. [826a]a9 01LDA #$01 [826c]85 ddSTA IScriptOffset; Set IScript offset to 1.
; ; v-- Fall through --v ;
;============================================================================ ; Invoke the next action listed in an IScript. ; ; This will load the action byte, look up the action ; handler, and then run it. The handler will be ; responsible for loading any further bytes and ; advancing the script. ; ; INPUTS: ; IScriptActions_U: ; IScriptActions_L: ; Address table for the IScript action handlers. ; ; OUTPUTS: ; A: ; Address of the handler, pushed to the stack. ; ; CALLS: ; IScripts_LoadByte ; ; XREFS: ; IScriptAction_AddGold ; IScriptAction_AddInventoryItem ; IScriptAction_ConsumeItem ; IScriptAction_OpenShop ; IScriptAction_SetQuestComplete ; IScriptAction_SetSpawnPoint ; IScriptAction_ShowMessage ; IScriptAction_ShowPassword ; IScriptAction_ShowQuestionMessage ; IScriptAction_ShowSellMenu ; IScriptAction_ShowUnskippableMessage ; IScriptAction_SpendGold ; IScripts_JumpToNextAddr ; IScripts_SkipAddrAndInvoke ; thunk_IScripts_InvokeNextAction ;============================================================================
[826e]IScripts_InvokeNextAction: [826e]20 a4 87JSR IScripts_LoadByte; Load the script ID [8271]aaTAX; Store the byte in X and load from the offset table. [8272]bd 93 82LDA a:IScriptActions_U,X; Fetch the upper script offset [8275]48PHA; Push the upper offset to the stack [8276]bd 7b 82LDA a:IScriptActions_L,X; Fetch the lower script offset [8279]48PHA; Push the lower offset to the stack [827a]60RTS
;============================================================================ ; Addresses for the IScript action handlers. ; ; XREFS: ; IScripts_InvokeNextAction ;============================================================================
; ; XREFS: ; IScripts_InvokeNextAction ;
[827b]IScriptActions_L: [827b]b3.byte $b3; [0]: End Script action
; ; XREFS: ; IScripts_InvokeNextAction ;
[827c]IScriptActions_L_1_: [827c]c4.byte $c4; [1]: Show Unskippable Message action [827d]ee.byte $ee; [2]: Show Question Message action [827e]d8.byte $d8; [3]: Show Message action [827f]25.byte $25; [4]: Check/Update Player Title action [8280]5a.byte $5a; [5]: Spend Gold action [8281]90.byte $90; [6]: Set Spawn Point action [8282]9e.byte $9e; [7]: Add Inventory Item action [8283]d7.byte $d7; [8]: Open Shop action [8284]24.byte $24; [9]: Add Gold action [8285]7f.byte $7f; [10]: Add MP action [8286]d0.byte $d0; [11]: If Quest Completed action [8287]f5.byte $f5; [12]: If Player Has Title action [8288]1e.byte $1e; [13]: If Player Has Gold action [8289]e5.byte $e5; [14]: Set Quest Complete action [828a]2f.byte $2f; [15]: Show Buy/Sell Menu action [828b]56.byte $56; [16]: Consume Item action [828c]5f.byte $5f; [17]: Show Sell Menu action [828d]17.byte $17; [18]: If Player Has Item action [828e]ae.byte $ae; [19]: Add HP action [828f]36.byte $36; [20]: Show Password action [8290]ad.byte $ad; [21]: Finish Game action [8291]07.byte $07; [22]: Show Message and If Dismissed action [8292]aa.byte $aa; [23]: Jump To Script Address action
; ; XREFS: ; IScripts_InvokeNextAction ;
[8293]IScriptActions_U: [8293]82.byte $82; [0]: End Script action
; ; XREFS: ; IScripts_InvokeNextAction ;
[8294]IScriptActions_U_1_: [8294]82.byte $82; [1]: Show Unskippable Message action [8295]82.byte $82; [2]: Show Question Message action [8296]82.byte $82; [3]: Show Message action [8297]87.byte $87; [4]: Check/Update Player Title action [8298]83.byte $83; [5]: Spend Gold action [8299]83.byte $83; [6]: Set Spawn Point action [829a]83.byte $83; [7]: Add Inventory Item action [829b]83.byte $83; [8]: Open Shop action [829c]85.byte $85; [9]: Add Gold action [829d]85.byte $85; [10]: Add MP action [829e]85.byte $85; [11]: If Quest Completed action [829f]85.byte $85; [12]: If Player Has Title action [82a0]86.byte $86; [13]: If Player Has Gold action [82a1]85.byte $85; [14]: Set Quest Complete action [82a2]86.byte $86; [15]: Show Buy/Sell Menu action [82a3]86.byte $86; [16]: Consume Item action [82a4]86.byte $86; [17]: Show Sell Menu action [82a5]87.byte $87; [18]: If Player Has Item action [82a6]85.byte $85; [19]: Add HP action [82a7]87.byte $87; [20]: Show Password action [82a8]82.byte $82; [21]: Finish Game action [82a9]83.byte $83; [22]: Show Message and If Dismissed action [82aa]82.byte $82; [23]: Jump To Script Address action
;============================================================================ ; IScript Action $17: Jump to Address ; ; This will immediately jump to the specified address. ; ; Script Parameters: ; ; 1. Jump address (2 bytes) ; ; XREFS: ; IScriptActions_L [$PRG12::8292] ;============================================================================
[82ab]IScriptAction_Jump: [82ab]4c 03 86JMP IScripts_JumpToNextAddr; Jump to the next address specified in the script.
;============================================================================ ; IScript Action $15: Finish Game ; ; This will immediately finish the game, showing ; the outro screen and victory music. ; ; Script Parameters: ; None. ; ; XREFS: ; IScriptActions_L [$PRG12::8290] ;============================================================================
[82ae]IScriptAction_FinishGame: [82ae]20 32 a9JSR SplashAnimation_RunOutro; Show the outro animation. [82b1]4c 13 c9JMP Game_Init; Re-initialize the game.
;============================================================================ ; IScript Action $00: End Script ; ; This will close the textbox, if one is opened, and ; finish processing the script. ; ; Script Parameters: ; None. ; ; XREFS: ; IScriptAction_OpenShop ; IScriptAction_ShowBuySellMenu ; IScriptAction_ShowMessage ; IScriptAction_ShowQuestionMessage ; IScriptAction_ShowSellMenu ; IScriptActions_L [$PRG12::827b] ; IScripts_ShowFinalMessage ;============================================================================
[82b4]IScriptAction_EndScript: [82b4]20 b0 87JSR IScripts_UpdatePortraitAnimation; Update the portrait animation. [82b7]ad 01 02LDA a:Temp_0201; Load the portrait ID. [82ba]10 06BPL @_noPortrait; If a portrait ID is not set, jump. [82bc]20 81 f2JSR IScripts_ClearPortraitImage; Clear the portrait image. [82bf]4c 2b 82JMP TextBox_ClearForPortraitAndText; Clear the portrait frame. [82c2]@_noPortrait: [82c2]4c fb 81JMP IScripts_CloseCurrentTextBox; Clear the current textbox.
;============================================================================ ; IScript Action $01: Show Unskippable Message ; ; Displays a message in a text box, with an optional ; portrait depending on the script's Entity ID. ; ; This message cannot be skipped by pressing the B ; button. It's used for important messages, like the ; game's intro. ; ; Script Parameters: ; ; 1. Message ID (1 byte) ; ; XREFS: ; IScriptActions_L [$PRG12::827c] ;============================================================================
[82c5]IScriptAction_ShowUnskippableMessage:
; ; Load the message to display. ;
[82c5]20 a4 87JSR IScripts_LoadByte; Load the next byte as the message ID. [82c8]20 f5 f3JSR Messages_Load; Load the message.
; ; Draw the characters one-by-one until the message is done. ;
[82cb]@_loop: [82cb]20 b0 87JSR IScripts_UpdatePortraitAnimation; Update the portrait animation. [82ce]20 66 f4JSR TextBox_ShowNextChar; Draw the next character in the textbox. [82d1]20 2a 99JSR TextBox_CheckShouldContinue; Check if the message should continue. [82d4]90 f5BCC @_loop; If so, loop.
; ; Done showing the textbox. Invoke the next action. ;
[82d6]4c 6e 82JMP IScripts_InvokeNextAction; Invoke the next action in the script.
;============================================================================ ; IScript Action $03: Show Message ; ; Displays a message in a text box, with an optional ; portrait depending on the script's Entity ID. ; ; This message can be skipped at any point by pressing ; the B button. ; ; Script Parameters: ; ; 1. Message ID (1 byte) ; ; XREFS: ; IScriptActions_L [$PRG12::827e] ;============================================================================
[82d9]IScriptAction_ShowMessage:
; ; Load the message to display. ;
[82d9]20 a4 87JSR IScripts_LoadByte; Load the next byte as the message ID. [82dc]20 f5 f3JSR Messages_Load; Load the message.
; ; Draw the characters one-by-one until the message is done. ;
[82df]@_writeLoop: [82df]20 b0 87JSR IScripts_UpdatePortraitAnimation; Update the portrait animation. [82e2]20 66 f4JSR TextBox_ShowNextChar; Draw the next character in the textbox. [82e5]20 56 99JSR TextBox_CheckShouldContinueOrDismissMessage; Check if the message is done or continued.
; ; Check if the player has dismissed the message by pressing B, ; or if the message has finished. ;
[82e8]b0 caBCS IScriptAction_EndScript; If dismissed (C=1), end the script. [82ea]d0 f3BNE @_writeLoop; If not done writing (Z=1), loop.
; ; Done showing the textbox. Invoke the next action. ;
[82ec]4c 6e 82JMP IScripts_InvokeNextAction; Invoke the next action in the script.
;============================================================================ ; IScript Action $02: Show Question Message ; ; Tihs displays a message in a text box, with an ; optional portrait depending on the script's Entity ID. ; ; The message will terminate with a flashing "?" at the ; bottom-center of the dialogue, indicating a question ; for the player. ; ; This message can be skipped at any point by pressing ; the B button. ; ; Script Parameters: ; ; 1. Message ID (1 byte) ; ; XREFS: ; IScriptActions_L [$PRG12::827d] ;============================================================================
[82ef]IScriptAction_ShowQuestionMessage: [82ef]20 a4 87JSR IScripts_LoadByte; Load the message ID parameer. [82f2]20 f5 f3JSR Messages_Load; Load the message string. [82f5]@_messageLoop: [82f5]20 b0 87JSR IScripts_UpdatePortraitAnimation; Update the portrait animation. [82f8]20 66 f4JSR TextBox_ShowNextChar; Show the next character in the textbox. [82fb]20 80 99JSR TextBox_CheckShouldContinueOrDismissQuestion; Check whether to continue or dismiss. [82fe]b0 b4BCS IScriptAction_EndScript; If dismissed (C=1), end the script. [8300]d0 f3BNE @_messageLoop; Else, if message text remains (Z=1), loop.
; ; The message finished. Fill up the textbox with hidden ; placeholder text and move on to the next action. ;
[8302]20 e8 81JSR IScripts_PositionAndFillPlaceholderText [8305]4c 6e 82JMP IScripts_InvokeNextAction; Invoke the next action in the script.
;============================================================================ ; IScript Action $16: Show Question Message then Check If Completed ; ; Tihs displays a message in a text box, with an ; optional portrait depending on the script's Entity ID. ; ; This message can be skipped at any point by pressing ; the B button. ; ; If the message is dismissed, continue on with the script. ; ; If the message completed, load the next address parameter ; and jump to it. ; ; This is not used in the shipped game. ; ; Script Parameters: ; ; 1. Message ID (1 byte) ; 2. Jump Address if Completed (2 bytes) ; ; XREFS: ; IScriptActions_L [$PRG12::8291] ;============================================================================
[8308]IScriptAction_ShowQuestionMessageCheckIfDismissed: [8308]20 a4 87JSR IScripts_LoadByte; Load the message ID parameer. [830b]20 f5 f3JSR Messages_Load; Load the message string. [830e]@_messageLoop: [830e]20 b0 87JSR IScripts_UpdatePortraitAnimation; Update the portrait animation. [8311]20 66 f4JSR TextBox_ShowNextChar; Show the next character in the textbox. [8314]20 80 99JSR TextBox_CheckShouldContinueOrDismissQuestion; Check whether to continue or dismiss. [8317]b0 05BCS @_messageDismissed; If dismissed (C=1), jump to continue this script. [8319]d0 f3BNE @_messageLoop; Else, if message text remains (Z=1), loop.
; ; The message finished. Load the next parameter as an ; address and jump to it. ;
[831b]4c 03 86JMP IScripts_JumpToNextAddr; Else, if completed, jump to the next address specified in the script.
; ; The message was dismissed. Move on to the next action in ; this script. ;
[831e]@_messageDismissed: [831e]4c 16 86JMP IScripts_SkipAddrAndInvoke; Invoke the next action in the script.
;============================================================================ ; Progressively subtract gold from the player. ; ; This will subtract the code, animating the reduction ; of gold from the status screen. ; ; 10 gold will be subtracted at a time from the player. ; The values passed in will be used as a separate counter ; for how much gold is remaining to subtract. ; ; INPUTS: ; Temp_0203: ; Lower byte of the gold amount to subtract. ; ; Temp_0203: ; Upper byte of the gold amount to subtract. ; ; OUTPUTS: ; Temp_Int24: ; Temp_Int24+1: ; Temp_0202: ; Temp_0203: ; Clobbered. ; ; CALLS: ; IScripts_UpdatePortraitAnimation ; Player_SubtractGold ; ; XREFS: ; IScriptAction_OpenShop ; IScriptAction_SpendGold ; IScripts_ProgressivelySubtractGold ;============================================================================
[8321]IScripts_ProgressivelySubtractGold: [8321]20 b0 87JSR IScripts_UpdatePortraitAnimation; Update the portrait animation. [8324]ad 03 02LDA a:Temp_0203; Load the upper byte of the gold amount. [8327]30 2cBMI @_subtractLowerByte; If the upper byte is 0, jump. [8329]0d 02 02ORA a:Temp_0202; OR with the lower byte. [832c]f0 1fBEQ @_subtractUpperByte; If neither has a value, jump.
; ; Subtract 10 from the counter of gold remaining to take. ; If at any point we underflow the lower byte, subtract 1 ; from the upper byte. ;
[832e]ad 02 02LDA a:Temp_0202; Load the lower byte of gold. [8331]38SEC [8332]e9 0aSBC #$0a; Subtract 10. [8334]8d 02 02STA a:Temp_0202; And store as the lower byte. [8337]ad 03 02LDA a:Temp_0203; Load the upper byte of gold. [833a]e9 00SBC #$00; If the lower is now < 0, subtract 1 from upper. [833c]8d 03 02STA a:Temp_0203; And store it.
; ; Remove 10 gold from the player. ;
[833f]a9 0aLDA #$0a; A = 10 [8341]85 ecSTA Temp_Int24; Store as the lower byte to subtract. [8343]a9 00LDA #$00; A = 0 [8345]85 edSTA Temp_Int24_M; Store as the upper byte to subtract. [8347]20 a5 f9JSR Player_SubtractGold; Subtract the gold from the player. [834a]4c 21 83JMP IScripts_ProgressivelySubtractGold; And loop. [834d]@_subtractUpperByte: [834d]ce 03 02DEC a:Temp_0203; Subtract 1 from the upper byte. [8350]a9 3cLDA #$3c; Use 60 for the lower byte. [8352]8d 02 02STA a:Temp_0202; And store it. [8355]@_subtractLowerByte: [8355]ce 02 02DEC a:Temp_0202; Subtract 1 from the lower byte. [8358]d0 c7BNE IScripts_ProgressivelySubtractGold; If not 0, loop. [835a]60RTS; Else, we're done. Return.
;============================================================================ ; IScript Action $05: Spend Gold ; ; This takes the specified amount of gold away from the player. ; ; Script Parameters: ; ; 1. Gold amount (2 bytes) ; ; XREFS: ; IScriptActions_L [$PRG12::8280] ;============================================================================
[835b]IScriptAction_SpendGold:
; ; Load the gold amount parameters for the script. ;
[835b]20 a4 87JSR IScripts_LoadByte; Load the lower byte of the gold amount. [835e]8d 02 02STA a:Temp_0202; Store it. [8361]20 a4 87JSR IScripts_LoadByte; Load the upper byte of the gold amount. [8364]8d 03 02STA a:Temp_0203; Store it [8367]ad 02 02LDA a:Temp_0202; Load the lower byte again. [836a]85 ecSTA Temp_Int24; Store it in Temp_Int24 for comparison. [836c]ad 03 02LDA a:Temp_0203; Lower the upper byte again. [836f]85 edSTA Temp_Int24_M; And store it in Temp_Int24 for comparison.
; ; Validate that there's enough money. If there is, spend ; it. If not, display an error message. ;
[8371]20 dc 87JSR IScripts_CheckEnoughMoney; Check if there's enough money to pay. [8374]90 06BCC IScripts_ShowNotEnoughMoney; If not, show the Not Enough Money message. [8376]20 21 83JSR IScripts_ProgressivelySubtractGold; Progressively subtract the gold, animating it. [8379]4c 6e 82JMP IScripts_InvokeNextAction; Invoke the next action in the script.
;============================================================================ ; Show that the player doesn't have enough money. ; ; This will progressively show this in a textbox, and ; then end the script. ; ; INPUTS: ; None. ; ; OUTPUTS: ; None. ; ; CALLS: ; Messages_Load ; IScripts_UpdatePortraitAnimation ; TextBox_ShowNextChar ; TextBox_CheckShouldContinueOrDismissMessage ; IScriptAction_EndScript ; ; XREFS: ; IScriptAction_OpenShop ; IScriptAction_SpendGold ;============================================================================
[837c]IScripts_ShowNotEnoughMoney:
; ; Display the Not Enough Money message. ;
[837c]a9 03LDA #$03; Set the message ID.
; ; v-- Fall through --v ;
;============================================================================ ; Show a message for shop purposes, ending the script once finished. ; ; This will show the message and, once dismissed or ; completed, end the current IScript. ; ; INPUTS: ; A: ; The ID of the message to show. ; ; OUTPUTS: ; None. ; ; CALLS: ; IScriptAction_EndScript ; IScripts_UpdatePortraitAnimation ; Messages_Load ; TextBox_ShowNextChar ; TextBox_CheckShouldContinueOrDismissMessage ; ; ; XREFS: ; IScriptAction_OpenShop ; IScriptAction_ShowSellMenu ;============================================================================
[837e]IScripts_ShowFinalMessage: [837e]20 f5 f3JSR Messages_Load; Load the message string.
; ; Progressively write the message. ;
[8381]@_messageLoop: [8381]20 b0 87JSR IScripts_UpdatePortraitAnimation; Update the portrait animation. [8384]20 66 f4JSR TextBox_ShowNextChar; Show the next character in the textbox. [8387]20 56 99JSR TextBox_CheckShouldContinueOrDismissMessage; Check whether to continue or dismiss. [838a]b0 02BCS @_endScript; If dismissed, end the script. [838c]d0 f3BNE @_messageLoop; Else, if the message is not finished, loop. [838e]@_endScript: [838e]4c b4 82JMP IScriptAction_EndScript; End processing of the script.
;============================================================================ ; IScript Action $06: Set Spawn Point ; ; Sets the spawn point to the specified temple ID. ; ; Only the furthest temple will be set. If backtracking, ; to an earlier spawn point, then ew spawn point will ; not be set. ; ; Script Parameters: ; ; 1. Temple ID (1 byte) ; ; XREFS: ; IScriptActions_L [$PRG12::8281] ;============================================================================
[8391]IScriptAction_SetSpawnPoint: [8391]20 a4 87JSR IScripts_LoadByte; Load the temple/area ID. [8394]cd 39 04CMP a:TempleSpawnPoint; Compare against the current spawn point. [8397]90 03BCC @_nextAction; If the older spawn point is further in the game, don't update. [8399]8d 39 04STA a:TempleSpawnPoint; Else, set the new spawn point. [839c]@_nextAction: [839c]4c 6e 82JMP IScripts_InvokeNextAction; Invoke the next action in the script.
;============================================================================ ; IScript Action $07: Adds an item with the specified ID to the player's ; inventory. ; ; This will show a textbox with the item's image and name, ; waiting for the player to press a button to dismiss it. ; ; Script Parameters: ; ; 1. Item ID (1 byte) ; ; XREFS: ; IScriptActions_L [$PRG12::8282] ;============================================================================
[839f]IScriptAction_AddInventoryItem: [839f]20 a4 87JSR IScripts_LoadByte; Load the item ID parameter. [83a2]48PHA; Push to the stack, twice. [83a3]48PHA [83a4]20 f7 9aJSR Player_AddToInventory; Add the item to the inventory.
; ; Begin showing the textbox indicating the added item. ; ; The text position will be inset 1 from the standard text ; position (2 blocks in from the textbox border), allowing ; room for the item image. ;
[83a7]20 c1 8eJSR IScriptAction_AddInventoryItem_ClearTextBox; Clear the textbox and prepare for showing the item. [83aa]ae 08 02LDX a:TextBox_X; X = Textbox X location. [83ad]e8INX; X += 2 [83ae]e8INX [83af]86 eaSTX TextBox_ContentsX; Store as the text X position. [83b1]ae 09 02LDX a:TextBox_Y; X = Textbox Y position. [83b4]e8INX; X += 2 [83b5]e8INX [83b6]86 ebSTX TextBox_ContentsY; Store as the text Y position.
; ; Draw the item image and name in the textbox. ;
[83b8]68PLA; Pull the item ID from the stack. [83b9]a2 00LDX #$00; X = 0 [83bb]20 58 8cJSR TextBox_DrawItemImage; Draw the item image. [83be]e6 ebINC TextBox_ContentsY; Text Y position += 3 [83c0]e6 ebINC TextBox_ContentsY [83c2]e6 ebINC TextBox_ContentsY [83c4]68PLA; Pull the item ID from the stack. [83c5]20 36 8cJSR TextBox_DrawItemName; Draw the item name.
; ; Update any portrait and textbox terminators until a ; button is pressed. ;
[83c8]@_textboxLoop: [83c8]20 b0 87JSR IScripts_UpdatePortraitAnimation; Update the portrait animation. [83cb]20 be 99JSR TextBox_DrawUpArrowTerminatorSymbol; Draw the Up arrow terminator symbol. [83ce]a5 19LDA Joy1_ChangedButtonMask; Load any changed controller buttons. [83d0]10 f6BPL @_textboxLoop; If not pressed, loop.
; ; Prepare to clear out the textbox and then invoke the next ; action in the script. ;
[83d2]20 e8 81JSR IScripts_PositionAndFillPlaceholderText; Fill the textbox with invisible placeholder text. [83d5]4c 6e 82JMP IScripts_InvokeNextAction; Invoke the next action in the script.
;============================================================================ ; IScript Action $08: Open Shop ; ; This will load an address for shop item data, and then ; display the items in a box. ; ; Script Parameters: ; ; 1. The address of the shop items (2 bytes) ; ; XREFS: ; IScriptActions_L [$PRG12::8283] ;============================================================================
[83d8]IScriptAction_OpenShop: [83d8]a9 14LDA #$14; "What would you like?" [83da]20 f5 f3JSR Messages_Load; Load the message. [83dd]@LAB_PRG12__83dd: [83dd]20 b0 87JSR IScripts_UpdatePortraitAnimation; Update the portrait animation. [83e0]20 66 f4JSR TextBox_ShowNextChar; Show the next character in the textbox. [83e3]20 56 99JSR TextBox_CheckShouldContinueOrDismissMessage; Check whether to continue displaying the message or if the user pressed to dismiss. [83e6]b0 17BCS @_endScript; If they pressed to dismiss, end the script. [83e8]d0 f3BNE @LAB_PRG12__83dd [83ea]20 a4 87JSR IScripts_LoadByte [83ed]85 ecSTA Temp_Int24; Probably shop inventory table [83ef]20 a4 87JSR IScripts_LoadByte [83f2]85 edSTA Temp_Int24_M [83f4]20 01 85JSR Shop_Populate [83f7]20 f8 99JSR Shop_Draw [83fa]20 ed 84JSR IScripts_WaitForMenuInput [83fd]90 03BCC @LAB_PRG12__8402 [83ff]@_endScript: [83ff]4c b4 82JMP IScriptAction_EndScript [8402]@LAB_PRG12__8402: [8402]20 82 84JSR Shop_GetPlayerHasSelectedItem [8405]b0 62BCS @LAB_PRG12__8469 [8407]ae 1e 02LDX a:Menu_CursorPos [840a]bd 20 02LDA a:DataArray,X [840d]c9 80CMP #$80 [840f]f0 28BEQ @LAB_PRG12__8439 [8411]c9 81CMP #$81 [8413]f0 24BEQ @LAB_PRG12__8439 [8415]c9 82CMP #$82 [8417]f0 20BEQ @LAB_PRG12__8439 [8419]c9 83CMP #$83 [841b]f0 1cBEQ @LAB_PRG12__8439 [841d]c9 92CMP #$92 [841f]f0 18BEQ @LAB_PRG12__8439 [8421]c9 8aCMP #$8a [8423]f0 14BEQ @LAB_PRG12__8439 [8425]c9 93CMP #$93 [8427]f0 10BEQ @LAB_PRG12__8439 [8429]c9 94CMP #$94 [842b]f0 0cBEQ @LAB_PRG12__8439 [842d]20 85 f7JSR Player_GetInventoryIndexForItem [8430]aaTAX [8431]bd c2 03LDA a:NumberOfWeapons,X; Number of weapons in the player's inventory. [8434]dd 7d 84CMP a:MAX_INVENTORY_SLOTS,X [8437]f0 30BEQ @LAB_PRG12__8469 [8439]@LAB_PRG12__8439: [8439]ae 1e 02LDX a:Menu_CursorPos [843c]bd 28 02LDA a:ShopItemCostsL,X [843f]85 ecSTA Temp_Int24 [8441]8d 02 02STA a:Temp_0202 [8444]bd 30 02LDA a:ShopItemCostsU,X [8447]85 edSTA Temp_Int24_M [8449]8d 03 02STA a:Temp_0203 [844c]20 dc 87JSR IScripts_CheckEnoughMoney [844f]b0 06BCS @LAB_PRG12__8457 [8451]20 71 84JSR Maybe_Shop_DrawTextBox [8454]4c 7c 83JMP IScripts_ShowNotEnoughMoney [8457]@LAB_PRG12__8457: [8457]ae 1e 02LDX a:Menu_CursorPos [845a]bd 20 02LDA a:DataArray,X [845d]20 f7 9aJSR Player_AddToInventory [8460]20 21 83JSR IScripts_ProgressivelySubtractGold [8463]20 71 84JSR Maybe_Shop_DrawTextBox [8466]4c 6e 82JMP IScripts_InvokeNextAction [8469]@LAB_PRG12__8469: [8469]20 71 84JSR Maybe_Shop_DrawTextBox [846c]a9 06LDA #$06 [846e]4c 7e 83JMP IScripts_ShowFinalMessage
;============================================================================ ; TODO: Document Maybe_Shop_DrawTextBox ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; IScriptAction_OpenShop ;============================================================================
[8471]Maybe_Shop_DrawTextBox: [8471]20 b0 87JSR IScripts_UpdatePortraitAnimation [8474]20 b0 87JSR IScripts_UpdatePortraitAnimation [8477]20 02 90JSR TextBox_Close [847a]4c e2 81JMP TextBox_OpenForNPC
; ; XREFS: ; IScriptAction_OpenShop ; Player_AddToInventory ;
[847d]MAX_INVENTORY_SLOTS: [847d]04.byte $04; [0]: Max weapons [847e]04.byte $04; [1]: Max armor [847f]04.byte $04; [2]: Max shields [8480]04.byte $04; [3]: Max spells [8481]08.byte $08; [4]: Max consumable items
;============================================================================ ; TODO: Document Shop_GetPlayerHasSelectedItem ; ; INPUTS: ; None. ; ; OUTPUTS: ; C ; ; XREFS: ; IScriptAction_OpenShop ;============================================================================
[8482]Shop_GetPlayerHasSelectedItem: [8482]ae 1e 02LDX a:Menu_CursorPos [8485]bd 20 02LDA a:DataArray,X [8488]10 35BPL @LAB_PRG12__84bf [848a]a2 00LDX #$00 [848c]c9 80CMP #$80 [848e]f0 25BEQ @LAB_PRG12__84b5 [8490]e8INX [8491]c9 81CMP #$81 [8493]f0 20BEQ @LAB_PRG12__84b5 [8495]e8INX [8496]c9 82CMP #$82 [8498]f0 1bBEQ @LAB_PRG12__84b5 [849a]e8INX [849b]c9 83CMP #$83 [849d]f0 16BEQ @LAB_PRG12__84b5 [849f]e8INX [84a0]c9 92CMP #$92 [84a2]f0 11BEQ @LAB_PRG12__84b5 [84a4]e8INX [84a5]c9 8aCMP #$8a [84a7]f0 0cBEQ @LAB_PRG12__84b5 [84a9]e8INX [84aa]c9 93CMP #$93 [84ac]f0 07BEQ @LAB_PRG12__84b5 [84ae]e8INX [84af]c9 94CMP #$94 [84b1]f0 02BEQ @LAB_PRG12__84b5 [84b3]@LAB_PRG12__84b3: [84b3]18CLC [84b4]60RTS [84b5]@LAB_PRG12__84b5: [84b5]ad 2c 04LDA a:SpecialItems [84b8]3d e5 84AND a:BYTE_ARRAY_PRG12__84e5,X [84bb]f0 f6BEQ @LAB_PRG12__84b3 [84bd]@LAB_PRG12__84bd: [84bd]38SEC [84be]60RTS [84bf]@LAB_PRG12__84bf: [84bf]48PHA [84c0]20 85 f7JSR Player_GetInventoryIndexForItem [84c3]aaTAX [84c4]bd 29 9bLDA a:INVENTORY_CATEGORY_L,X [84c7]85 ecSTA Temp_Int24 [84c9]bd 2e 9bLDA a:INVENTORY_CATEGORY_U,X [84cc]85 edSTA Temp_Int24_M [84ce]68PLA [84cf]29 1fAND #$1f [84d1]dd bd 03CMP a:SelectedWeapon,X [84d4]f0 e7BEQ @LAB_PRG12__84bd [84d6]bc c2 03LDY a:NumberOfWeapons,X [84d9]f0 d8BEQ @LAB_PRG12__84b3 [84db]88DEY [84dc]@LAB_PRG12__84dc: [84dc]d1 ecCMP (Temp_Int24),Y [84de]f0 ddBEQ @LAB_PRG12__84bd [84e0]88DEY [84e1]10 f9BPL @LAB_PRG12__84dc [84e3]18CLC [84e4]60RTS
; ; XREFS: ; Shop_GetPlayerHasSelectedItem ;
[84e5]BYTE_ARRAY_PRG12__84e5: [84e5]80.byte $80; [0]:
; ; XREFS: ; Shop_GetPlayerHasSelectedItem ;
[84e6]BYTE_ARRAY_PRG12__84e5_1_: [84e6]40.byte $40; [1]:
; ; XREFS: ; Shop_GetPlayerHasSelectedItem ;
[84e7]BYTE_ARRAY_PRG12__84e5_2_: [84e7]20.byte $20; [2]:
; ; XREFS: ; Shop_GetPlayerHasSelectedItem ;
[84e8]BYTE_ARRAY_PRG12__84e5_3_: [84e8]10.byte $10; [3]:
; ; XREFS: ; Shop_GetPlayerHasSelectedItem ;
[84e9]BYTE_ARRAY_PRG12__84e5_4_: [84e9]08.byte $08; [4]:
; ; XREFS: ; Shop_GetPlayerHasSelectedItem ;
[84ea]BYTE_ARRAY_PRG12__84e5_5_: [84ea]04.byte $04; [5]:
; ; XREFS: ; Shop_GetPlayerHasSelectedItem ;
[84eb]BYTE_ARRAY_PRG12__84e5_6_: [84eb]02.byte $02; [6]:
; ; XREFS: ; Shop_GetPlayerHasSelectedItem ;
[84ec]BYTE_ARRAY_PRG12__84e5_7_: [84ec]01.byte $01; [7]:
;============================================================================ ; TODO: Document IScripts_WaitForMenuInput ; ; INPUTS: ; None. ; ; OUTPUTS: ; C ; ; XREFS: ; IScriptAction_OpenShop ; IScriptAction_ShowSellMenu ; IScripts_WaitForMenuInput ;============================================================================
[84ed]IScripts_WaitForMenuInput: [84ed]20 b0 87JSR IScripts_UpdatePortraitAnimation; Update the portrait animation. [84f0]20 56 90JSR Menu_UpdateAndDraw; Update and draw the menu. [84f3]a5 19LDA Joy1_ChangedButtonMask; Load the controller 1 button mask. [84f5]30 06BMI @_returnFalse; If "A" is pressed, jump to return false. [84f7]0aASL A; Shift "B" into bit 7. [84f8]30 05BMI @_returnTrue; If "B" is pressed, jump to return true. [84fa]4c ed 84JMP IScripts_WaitForMenuInput; Loop. [84fd]@_returnFalse: [84fd]18CLC [84fe]60RTS [84ff]@_returnTrue: [84ff]38SEC [8500]60RTS
;============================================================================ ; Populate the items in the menu. ; ; This will take the menus stored in the address indicated ; in Temp_Int24 and Temp_Int24+1. It will ; loop through ; these, adding the items and costs to the menu state. ; ; INPUTS: ; Temp_Int24: ; Temp_Int24+1: ; The address of the menu items to load. ; ; OUTPUTS: ; Arg_StringsCount: ; Position of the last menu item. ; ; Menu_CursorPos: ; Start position of the cursor (0). ; ; DataArray: ; The populated list of items. ; ; ShopItemCostsL: ; ShopItemCostsU: ; The populated costs for each item. ; ; XREFS: ; IScriptAction_OpenShop ;============================================================================
[8501]Shop_Populate: [8501]a0 00LDY #$00; Y = 0 (loop counter) [8503]a2 00LDX #$00; X = 0 (menu position counter) [8505]8e 1e 02STX a:Menu_CursorPos; Cusor position = 0
; ; Fetch the menu item at this index. ;
[8508]@_populateLoop: [8508]b1 ecLDA (Temp_Int24),Y; A = Menu item at Y.
; ; Check if we're on the last item. ;
[850a]c9 ffCMP #$ff; Check if it's 0xFF (the menu terminator). [850c]f0 13BEQ @_finish; If so, we're done.
; ; Store the item. ;
[850e]9d 20 02STA a:DataArray,X; Store the item in the menu. [8511]c8INY; Y++
; ; Store the cost. ;
[8512]b1 ecLDA (Temp_Int24),Y; Load the lower byte of the item cost. [8514]9d 28 02STA a:ShopItemCostsL,X; Store it. [8517]c8INY; Y++ [8518]b1 ecLDA (Temp_Int24),Y; Load the upper byte of the item cost. [851a]9d 30 02STA a:ShopItemCostsU,X; Store it.
; ; Increment our counters. ;
[851d]c8INY; Y++ [851e]e8INX; X++ [851f]d0 e7BNE @_populateLoop; If we're not done, loop. [8521]@_finish: [8521]8e 1f 02STX a:Arg_StringsCount; Set the last menu position. [8524]60RTS
;============================================================================ ; IScript action to add gold. ; ; This will load the lower and middle bytes of gold and ; progressively fill up the player's gold counter. ; ; It will then invoke the next action in the script. ; ; XREFS: ; IScriptActions_L [$PRG12::8284] ;============================================================================
[8525]IScriptAction_AddGold: [8525]20 a4 87JSR IScripts_LoadByte; Load the lower byte for the gold amount. [8528]8d 02 02STA a:Temp_0202; Store it. [852b]20 a4 87JSR IScripts_LoadByte; Load the upper byte for the gold amount. [852e]8d 03 02STA a:Temp_0203; Store it. [8531]20 37 85JSR IScripts_ProgressivelyAddGold; Progressively add gold. [8534]4c 6e 82JMP IScripts_InvokeNextAction; Invoke the next action.
;============================================================================ ; TODO: Document IScripts_ProgressivelyAddGold ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; IScriptAction_AddGold ; IScriptAction_ShowSellMenu ; IScripts_ProgressivelyAddGold ;============================================================================
[8537]IScripts_ProgressivelyAddGold: [8537]20 b0 87JSR IScripts_UpdatePortraitAnimation [853a]ad 03 02LDA a:Temp_0203 [853d]30 2fBMI @LAB_PRG12__856e [853f]0d 02 02ORA a:Temp_0202 [8542]f0 22BEQ @LAB_PRG12__8566 [8544]20 74 85JSR IScripts_PlayGoldChangeSound [8547]ad 02 02LDA a:Temp_0202 [854a]38SEC [854b]e9 0aSBC #$0a [854d]8d 02 02STA a:Temp_0202 [8550]ad 03 02LDA a:Temp_0203 [8553]e9 00SBC #$00 [8555]8d 03 02STA a:Temp_0203 [8558]a9 0aLDA #$0a [855a]85 ecSTA Temp_Int24 [855c]a9 00LDA #$00 [855e]85 edSTA Temp_Int24_M [8560]20 c1 f9JSR Player_AddGold [8563]4c 37 85JMP IScripts_ProgressivelyAddGold [8566]@LAB_PRG12__8566: [8566]ce 03 02DEC a:Temp_0203 [8569]a9 3cLDA #$3c [856b]8d 02 02STA a:Temp_0202 [856e]@LAB_PRG12__856e: [856e]ce 02 02DEC a:Temp_0202 [8571]d0 c4BNE IScripts_ProgressivelyAddGold [8573]60RTS
;============================================================================ ; Play the gold change sound every 7 ticks. ; ; INPUTS: ; InterruptCounter: ; The interrupt counter to control timing of sounds. ; ; OUTPUTS: ; None ; ; XREFS: ; IScripts_ProgressivelyAddGold ;============================================================================
[8574]IScripts_PlayGoldChangeSound: [8574]a5 1aLDA InterruptCounter; Load the interrupt counter. [8576]29 03AND #$03; Check if we're ready to play a sound. [8578]d0 05BNE @_return; If not, return.
; ; We're ready to play the sound. ;
[857a]a9 19LDA #$19; 0x19 == Change gold amount sound [857c]20 e4 d0JSR Sound_PlayEffect; Play the sound. [857f]@_return: [857f]60RTS
;============================================================================ ; IScript action for adding MP. ; ; This will read the first byte as the MP amount. ; ; If this is under the MP cap, it will begin the process of ; progressively adding MP to the user, animating filling up ; the HP. ; ; XREFS: ; IScriptActions_L [$PRG12::8285] ;============================================================================
[8580]IScriptAction_AddMP: [8580]20 a4 87JSR IScripts_LoadByte; Load the MP amount from the script. [8583]8d 06 02STA a:IScript_HPOrMPValueToAdd; Store in the variable to fill MP up to. [8586]ad 9a 03LDA a:Player_MP; Load the currently-added MP value we're filling from. [8589]c9 50CMP #$50; Compare to the cap. [858b]b0 13BCS thunk_IScripts_InvokeNextAction; If at or over, we're done. Jump to invoke the next action. [858d]@_fillLoop: [858d]20 b0 87JSR IScripts_UpdatePortraitAnimation [8590]20 a3 85JSR IScripts_PlayFillingSound; Play the sound for filling a bit of MP. [8593]ae 9a 03LDX a:Player_MP; X = Remaining value to add. [8596]e8INX; X++ [8597]8aTXA; A = X [8598]20 85 faJSR Player_SetMP; Set the current mana points. [859b]ce 06 02DEC a:IScript_HPOrMPValueToAdd; Decrement the remaining value to add. [859e]d0 edBNE @_fillLoop; If we're not done, loop.
; ; v-- Fall through --v ;
;============================================================================ ; Thunk for invoking the next IScript action. ; ; This is here so that other code can jump to it cleanly. ; ; XREFS: ; IScriptAction_AddHP ; IScriptAction_AddMP ;============================================================================
[85a0]thunk_IScripts_InvokeNextAction: [85a0]4c 6e 82JMP IScripts_InvokeNextAction
;============================================================================ ; Play a sound when filling the HP or MP bar. ; ; This will play every 7 ticks. ; ; INPUTS: ; None ; ; OUTPUTS: ; None ; ; XREFS: ; IScriptAction_AddHP ; IScriptAction_AddMP ;============================================================================
[85a3]IScripts_PlayFillingSound: [85a3]a5 1aLDA InterruptCounter [85a5]29 03AND #$03 [85a7]d0 05BNE RETURN_85AE [85a9]a9 13LDA #$13 [85ab]20 e4 d0JSR Sound_PlayEffect
; ; XREFS: ; IScripts_PlayFillingSound ;
[85ae]RETURN_85AE: [85ae]60RTS
;============================================================================ ; IScript action for adding HP. ; ; This will read the first byte as the HP amount. ; ; If this is under the HP cap, it will begin the process of ; progressively adding HP to the user, animating filling up ; the HP. ; ; NOTE: If you look at the last couple instructions, it may ; seem it's falling through to ; IScriptAction_IfQuestCompleted. ; ; This does not happen. The combination of BEQ and BNE ; ensures we jump to an IScripts_InvokeNextAction ; and ; ends. ; ; XREFS: ; IScriptActions_L [$PRG12::828e] ;============================================================================
[85af]IScriptAction_AddHP: [85af]20 a4 87JSR IScripts_LoadByte; Load the HP value to add. [85b2]8d 06 02STA a:IScript_HPOrMPValueToAdd; Store in the variable to fill HP up to. [85b5]ad 99 03LDA a:Temp_AddedHPValue; Load the currently-added HP value we're filling from. [85b8]c9 50CMP #$50; Compare against the cap of 80. [85ba]b0 e4BCS thunk_IScripts_InvokeNextAction; If over, we're done. Invoke the next action. [85bc]@_fillLoop: [85bc]20 b0 87JSR IScripts_UpdatePortraitAnimation [85bf]20 a3 85JSR IScripts_PlayFillingSound; Play the sound for filling a bit of HP. [85c2]ae 99 03LDX a:Temp_AddedHPValue; X = Remaining value to add [85c5]e8INX; X++ [85c6]8aTXA; A = X [85c7]20 75 faJSR UI_DrawPlayerHPValue; Draw the next bit of health. [85ca]ce 06 02DEC a:IScript_HPOrMPValueToAdd; Decrement the remaining amount to add. [85cd]d0 edBNE @_fillLoop; If there's more to add, loop. [85cf]f0 cfBEQ thunk_IScripts_InvokeNextAction; Else, invoke the next action.
; ; X-- Does not fall through -- Terminates at branches above --X ;
;============================================================================ ; IScript action for a conditional check based on completed quests. ; ; This will read the next byte representing a quest index. ; ; If the player has completed the quests in the bitmask, ; this will read the next 2-byte address and jump to the ; script at that location. ; ; If they have not completed the quests, this will skip the ; address and invoke the following action. ; ; NOTE: This only checks the 3 least-significant bits of the ; quests bitmask. ; ; XREFS: ; IScriptActions_L [$PRG12::8286] ;============================================================================
[85d1]IScriptAction_IfQuestCompleted: [85d1]20 a4 87JSR IScripts_LoadByte; Load the next byte as the quest index into our table. [85d4]aaTAX; X = result [85d5]ad 2d 04LDA a:Quests; Load the current player quests. [85d8]3d e2 85AND a:ISCRIPTS_QUEST_BITS-1,X; AND it to the bitmask at the given index. [85db]d0 03BNE @_hasQuestCompleted [85dd]4c 16 86JMP IScripts_SkipAddrAndInvoke; Skip 2 bytes and invoke the following action. [85e0]@_hasQuestCompleted: [85e0]4c 03 86JMP IScripts_JumpToNextAddr [85e3]ISCRIPTS_QUEST_BITS: [85e3]01 02 04.byte $01,$02,$04; byte
;============================================================================ ; IScript action for marking a quest as complete. ; ; This will read the next byte as a quest bitmask value ; and set it. ; ; It will then invoke the following action. ; ; XREFS: ; IScriptActions_L [$PRG12::8289] ;============================================================================
[85e6]IScriptAction_SetQuestComplete: [85e6]20 a4 87JSR IScripts_LoadByte; Load the next byte as the quest index into our table. [85e9]aaTAX; X = result [85ea]ad 2d 04LDA a:Quests; Load the current player quests. [85ed]1d e2 85ORA a:ISCRIPTS_QUEST_BITS-1,X; OR it with the bit for this index. [85f0]8d 2d 04STA a:Quests; Store as the new quests bitmask. [85f3]4c 6e 82JMP IScripts_InvokeNextAction; Invoke the next action.
;============================================================================ ; IScript action for a conditional check based on a player title. ; ; This will read the next byte as a player title. ; ; If the player has reached that title, this will read ; the next 2-byte address and jump to the script at that ; location. ; ; If not, this will skip the 2 bytes and invoke the ; following action. ; ; XREFS: ; IScriptActions_L [$PRG12::8287] ;============================================================================
[85f6]IScriptAction_IfPlayerHasTitle: [85f6]20 a4 87JSR IScripts_LoadByte; Load the next byte as the player title to check. [85f9]cd 37 04CMP a:PlayerTitle; Compare to the current player title. [85fc]f0 05BEQ IScripts_JumpToNextAddr; If <=, jump to the script address in the next argument. [85fe]90 03BCC IScripts_JumpToNextAddr [8600]4c 16 86JMP IScripts_SkipAddrAndInvoke; Else, skip the address and invoke the next action.
;============================================================================ ; Jump to the next address found in an IScript. ; ; This will read the next 2-byte address and jump to the ; script at that location. ; ; INPUTS: ; None ; ; OUTPUTS: ; None ; ; XREFS: ; IScriptAction_CheckUpdatePlayerTitle ; IScriptAction_IfPlayerHasGold ; IScriptAction_IfPlayerHasItem ; IScriptAction_IfPlayerHasTitle ; IScriptAction_IfQuestCompleted ; IScriptAction_Jump ; IScriptAction_ShowBuySellMenu ; IScriptAction_ShowQuestionMessageCheckIfDismissed ;============================================================================
[8603]IScripts_JumpToNextAddr:
; ; Load the next two event bytes and use that as the ; address for the next event to invoke. ; ; The logic here is doing a bit more than it has to. ; It loads the lower byte, push it, then pop it, then ; store it. It should just store it. ;
[8603]20 a4 87JSR IScripts_LoadByte; Load the next byte as the lower byte of the script address. [8606]48PHA; Push to the stack. [8607]20 a4 87JSR IScripts_LoadByte; Load the next byte as the upper byte of the script address. [860a]85 dcSTA IScriptOrCHRAddr_U; Store it. [860c]68PLA; Pop the lower byte. [860d]85 dbSTA IScriptOrCHRAddr; Store it. [860f]a9 00LDA #$00; A = 0. [8611]85 ddSTA IScriptOffset; Store as the new script offset. [8613]4c 6e 82JMP IScripts_InvokeNextAction; Invoke the action at that address
;============================================================================ ; Skip the next 2-byte address and invoke the next IScript action. ; ; XREFS: ; IScriptAction_CheckUpdatePlayerTitle ; IScriptAction_IfPlayerHasGold ; IScriptAction_IfPlayerHasItem ; IScriptAction_IfPlayerHasTitle ; IScriptAction_IfQuestCompleted ; IScriptAction_ShowBuySellMenu ; IScriptAction_ShowQuestionMessageCheckIfDismissed ;============================================================================
[8616]IScripts_SkipAddrAndInvoke: [8616]20 a4 87JSR IScripts_LoadByte; Load 2 bytes and throw them out. [8619]20 a4 87JSR IScripts_LoadByte [861c]4c 6e 82JMP IScripts_InvokeNextAction; Invoke the next action.
;============================================================================ ; IScript action for a conditional check based on gold. ; ; If the player has any gold, the next 2-byte address will ; be read and this will jump to the script at that location. ; ; If the player has no gold, the next 2 bytes will be skipped ; and the following action will be invoked. ; ; XREFS: ; IScriptActions_L [$PRG12::8288] ;============================================================================
[861f]IScriptAction_IfPlayerHasGold: [861f]ad 92 03LDA a:Gold; Load the lower byte of the player's gold. [8622]0d 93 03ORA a:Gold_M; OR with the medium byte. [8625]0d 94 03ORA a:Gold_U; And the upper byte. [8628]d0 03BNE @_hasGold; If there's any value set, jump. [862a]4c 16 86JMP IScripts_SkipAddrAndInvoke; Else, skip the next 2 bytes and invoke the following action. [862d]@_hasGold: [862d]4c 03 86JMP IScripts_JumpToNextAddr; The player has gold, so jump to the next listed address.
;============================================================================ ; IScript action for showing the Buy/Sell menu. ; ; This will first display the "Come here to buy or sell?" ; message. It'll listen for a choice. ; ; If the player chose "Buy", the next 2-byte address will ; be read from the script and this will jump to that ; address. ; ; If the player chose "Sell", this will skip the address ; and execute the next script action. ; ; XREFS: ; IScriptActions_L [$PRG12::828a] ;============================================================================
[8630]IScriptAction_ShowBuySellMenu:
; ; Display the next "Come here to buy or sell?" message. ;
[8630]a9 10LDA #$10; 0x10 == "Did you come here to buy and sell?" [8632]20 e9 f3JSR IScripts_LoadAndShowMessage; Load and show that message in its entirety.
; ; Set 2 strings for the menu. ;
[8635]a9 02LDA #$02; Queue 2 strings to draw. [8637]8d 1f 02STA a:Arg_StringsCount; Set it.
; ; Set the start cursor position to Buy. ;
[863a]a9 00LDA #$00; Set the start cursor position to 0. [863c]8d 1e 02STA a:Menu_CursorPos
; ; Render the menu and wait for button changes. ;
[863f]@_loop: [863f]20 b0 87JSR IScripts_UpdatePortraitAnimation; Update the portrait animation. [8642]20 56 90JSR Menu_UpdateAndDraw; Update and draw the menu. [8645]a5 19LDA Joy1_ChangedButtonMask; Load the changed button mask. [8647]30 06BMI @_choiceMade; If the A button was pressed, jump.
; ; Check any button presses since the last iteration. ;
[8649]0aASL A; Increment the bit to check in the button mask. [864a]10 f3BPL @_loop; If any other button was pressed, loop.
; ; End the script. ;
[864c]4c b4 82JMP IScriptAction_EndScript
; ; Perform the next action based on the choice. ;
[864f]@_choiceMade: [864f]ad 1e 02LDA a:Menu_CursorPos; Check the cursor position. [8652]f0 afBEQ IScripts_JumpToNextAddr; If it's the first item, jump to the next address in the script. [8654]4c 16 86JMP IScripts_SkipAddrAndInvoke; Else, skip the address and invoke the next action.
;============================================================================ ; IScript action for consuming a player's item. ; ; This will load the next byte as an inventory item type ; and remove it from the player's inventory. ; ; It will then invoke the next action in the script. ; ; XREFS: ; IScriptActions_L [$PRG12::828b] ;============================================================================
[8657]IScriptAction_ConsumeItem: [8657]20 a4 87JSR IScripts_LoadByte; Load the next byte as the item ID. [865a]20 6a 9aJSR Player_RemoveItem; Remove the item from the player's inventory. [865d]4c 6e 82JMP IScripts_InvokeNextAction; Invoke the next action.
;============================================================================ ; TODO: Document IScriptAction_ShowSellMenu ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; IScriptActions_L [$PRG12::828c] ;============================================================================
[8660]IScriptAction_ShowSellMenu: [8660]20 a4 87JSR IScripts_LoadByte [8663]85 ecSTA Temp_Int24 [8665]20 a4 87JSR IScripts_LoadByte [8668]85 edSTA Temp_Int24_M [866a]a9 00LDA #$00 [866c]8d 1f 02STA a:Arg_StringsCount [866f]a2 04LDX #$04 [8671]@LAB_PRG12__8671: [8671]bc c2 03LDY a:NumberOfWeapons,X [8674]f0 41BEQ @LAB_PRG12__86b7 [8676]8aTXA [8677]48PHA [8678]20 8b f7JSR Player_GetInventoryBitForIndex [867b]8d 05 02STA a:Maybe_Shop_InventoryBitmask [867e]bd 29 9bLDA a:INVENTORY_CATEGORY_L,X [8681]85 eeSTA Temp_Int24_U [8683]bd 2e 9bLDA a:INVENTORY_CATEGORY_U,X [8686]85 efSTA Temp_0xEF [8688]88DEY [8689]@LAB_PRG12__8689: [8689]98TYA [868a]48PHA [868b]b1 eeLDA (Temp_Int24_U),Y [868d]0d 05 02ORA a:Maybe_Shop_InventoryBitmask [8690]aaTAX [8691]20 04 87JSR IScripts_SellMenu_Something8704 [8694]d0 1aBNE @LAB_PRG12__86b0 [8696]ae 1f 02LDX a:Arg_StringsCount [8699]9d 20 02STA a:DataArray,X [869c]c8INY [869d]b1 ecLDA (Temp_Int24),Y [869f]9d 28 02STA a:ShopItemCostsL,X [86a2]c8INY [86a3]b1 ecLDA (Temp_Int24),Y [86a5]4aLSR A [86a6]7e 28 02ROR a:ShopItemCostsL,X [86a9]9d 30 02STA a:ShopItemCostsU,X [86ac]e8INX [86ad]8e 1f 02STX a:Arg_StringsCount [86b0]@LAB_PRG12__86b0: [86b0]68PLA [86b1]a8TAY [86b2]88DEY [86b3]10 d4BPL @LAB_PRG12__8689 [86b5]68PLA [86b6]aaTAX [86b7]@LAB_PRG12__86b7: [86b7]e8INX [86b8]e0 05CPX #$05 [86ba]d0 b5BNE @LAB_PRG12__8671 [86bc]ad 1f 02LDA a:Arg_StringsCount [86bf]d0 05BNE @LAB_PRG12__86c6 [86c1]a9 12LDA #$12 [86c3]4c 7e 83JMP IScripts_ShowFinalMessage [86c6]@LAB_PRG12__86c6: [86c6]a9 13LDA #$13 [86c8]20 f5 f3JSR Messages_Load [86cb]@LAB_PRG12__86cb: [86cb]20 b0 87JSR IScripts_UpdatePortraitAnimation [86ce]20 66 f4JSR TextBox_ShowNextChar [86d1]20 56 99JSR TextBox_CheckShouldContinueOrDismissMessage [86d4]b0 2bBCS @_endScript [86d6]d0 f3BNE @LAB_PRG12__86cb [86d8]20 f8 99JSR Shop_Draw [86db]20 ed 84JSR IScripts_WaitForMenuInput [86de]b0 21BCS @_endScript [86e0]ae 1e 02LDX a:Menu_CursorPos [86e3]bd 28 02LDA a:ShopItemCostsL,X [86e6]8d 02 02STA a:Temp_0202 [86e9]bd 30 02LDA a:ShopItemCostsU,X [86ec]8d 03 02STA a:Temp_0203 [86ef]bd 20 02LDA a:DataArray,X [86f2]20 6a 9aJSR Player_RemoveItem [86f5]20 37 85JSR IScripts_ProgressivelyAddGold [86f8]20 02 90JSR TextBox_Close [86fb]20 e2 81JSR TextBox_OpenForNPC [86fe]4c 6e 82JMP IScripts_InvokeNextAction [8701]@_endScript: [8701]4c b4 82JMP IScriptAction_EndScript
;============================================================================ ; TODO: Document IScripts_SellMenu_Something8704 ; ; INPUTS: ; X ; ; OUTPUTS: ; TODO ; ; XREFS: ; IScriptAction_ShowSellMenu ;============================================================================
[8704]IScripts_SellMenu_Something8704: [8704]a0 00LDY #$00 [8706]@_loop: [8706]b1 ecLDA (Temp_Int24),Y [8708]c9 ffCMP #$ff [870a]f0 0aBEQ @LAB_PRG12__8716 [870c]8aTXA [870d]d1 ecCMP (Temp_Int24),Y [870f]f0 06BEQ @_return [8711]c8INY [8712]c8INY [8713]c8INY [8714]d0 f0BNE @_loop [8716]@LAB_PRG12__8716: [8716]aaTAX [8717]@_return: [8717]60RTS
;============================================================================ ; IScript Action $12: If Player Has Item. ; ; This will load the next byte as an inventory item type. ; ; If the player has the item, the next 2-byte address will ; be loaded and this will jump to that address. ; ; If the item is not in the inventory, the address will ; be skipped and the following action will be invoked. ; ; Script Parameters: ; ; 1. Item ID (1 byte) ; 2. Jump address (2 bytes) ; ; XREFS: ; IScriptActions_L [$PRG12::828d] ;============================================================================
[8718]IScriptAction_IfPlayerHasItem: [8718]20 a4 87JSR IScripts_LoadByte; Load the next byte as the item ID. [871b]20 f7 8cJSR Player_LacksItem; Check if the player lacks this item. [871e]90 03BCC @_invokeElse; If they have it, jump.
; ; The player does not have the item. ;
[8720]4c 16 86JMP IScripts_SkipAddrAndInvoke; Skip the next 2 bytes and invoke the following action.
; ; The player has the item. ;
[8723]@_invokeElse: [8723]4c 03 86JMP IScripts_JumpToNextAddr; Jump to the next address in the script.
;============================================================================ ; IScript Action $04: Check and Update Player Title ; ; If the player was eligible for a new title, their title ; will be increased and the next 2-byte address in the ; script be loaded and this will jump to that address. ; ; If not, the address will be skipped and the next action ; will be invoked. ; ; Script Parameters: ; ; 1. If-Updated Jump Address (2 bytes) ; ; XREFS: ; IScriptActions_L [$PRG12::827f] ;============================================================================
[8726]IScriptAction_CheckUpdatePlayerTitle: [8726]ad ed 04LDA a:NextPlayerTitle; Load the next player title. [8729]cd 37 04CMP a:PlayerTitle; Compare against the current title. [872c]f0 06BEQ @_invokeElse; If they're the same, jump.
; ; The player title is not a match. Update it. ;
[872e]8d 37 04STA a:PlayerTitle; Advance the player title. [8731]4c 03 86JMP IScripts_JumpToNextAddr; Read the next 2 bytes as an address and jump to it.
; ; The player already has that title. ;
[8734]@_invokeElse: [8734]4c 16 86JMP IScripts_SkipAddrAndInvoke; Skip the next 2 bytes and invoke the following action.
;============================================================================ ; IScript Action $14: Show Password ; ; This is used when interacting with Gurus. The current ; state of the game will be encoded as a password and ; displayed. ; ; Script Parameters: ; None. ; ; XREFS: ; IScriptActions_L [$PRG12::828f] ;============================================================================
[8737]IScriptAction_ShowPassword: [8737]20 e5 96JSR Password_GenerateStateAndReset; Generate the password state. [873a]20 34 f4JSR TextBox_ClearPasswordSize; Clear the textbox. [873d]a9 00LDA #$00 [873f]8d 07 02STA a:IScripts_Unused_207; DEADCODE: Set to 0. [8742]@_charLoop: [8742]20 b0 87JSR IScripts_UpdatePortraitAnimation; Update the portrait animation. [8745]20 57 87JSR PasswordScreen_ShowNextChar; Show the next character in the password. [8748]90 f8BCC @_charLoop; If not done, loop. [874a]@_portraitLoop: [874a]20 b0 87JSR IScripts_UpdatePortraitAnimation; Update the portrait animation. [874d]20 be 99JSR TextBox_DrawUpArrowTerminatorSymbol; Draw the Up Arrow in the textbox. [8750]a5 19LDA Joy1_ChangedButtonMask; A = Changed button mask [8752]10 f6BPL @_portraitLoop; If not dismissed, loop. [8754]4c 6e 82JMP IScripts_InvokeNextAction; Invoke the next action in the script.
;============================================================================ ; Show the next character of a password. ; ; This will fetch the next 6 bits of a password and look ; that up in the character display lookup table. ; ; INPUTS: ; PASSWORD_ENTERED_CHARS ; The lookup table of characters. ; ; OUTPUTS: ; C: ; 1 if finished with the password. ; 0 if there are characters remaining. ; ; CALLS: ; Password_GetNext6Bits ; TextBox_ShowMessage ; ; XREFS: ; IScriptAction_ShowPassword ;============================================================================
[8757]PasswordScreen_ShowNextChar: [8757]20 f1 96JSR Password_GetNext6Bits; Get the next 6 bits of password state for the character offset. [875a]08PHP; Push flags to stack. [875b]a8TAY; Y = A (index) [875c]b9 64 87LDA a:PASSWORD_ENTERED_CHARS,Y; A = character at index Y [875f]20 ff f4JSR TextBox_ShowMessage; Show the character in the textbox. [8762]28PLP; Pop flags. [8763]60RTS
;============================================================================ ; List of password characters by index. ; ; XREFS: ; PasswordScreen_DrawAtCursorPosition ; PasswordScreen_ShowNextChar ;============================================================================
; ; XREFS: ; PasswordScreen_DrawAtCursorPosition ; PasswordScreen_ShowNextChar ;
[8764]PASSWORD_ENTERED_CHARS: [8764]41 42 43 44 45 46 47 48.byte "ABCDEFGH"; char [876c]49 4a 4b 4c 4d 4e 4f 50.byte "IJKLMNOP"; char [8774]51 52 53 54 55 56 57 58.byte "QRSTUVWX"; char [877c]59 5a 61 62 63 64 65 66.byte "YZabcdef"; char [8784]67 68 69 6a 6b 6c 6d 6e.byte "ghijklmn"; char [878c]6f 70 71 72 73 74 75 76.byte "opqrstuv"; char [8794]77 78 79 7a 30 31 32 33.byte "wxyz0123"; char [879c]34 35 36 37 38 39 2c 3f.byte "456789,?"; char
;============================================================================ ; Load the next byte from the IScript. ; ; This will load the byte and update the offset. ; ; If the offset wraps around from 0xFF to 0, the upper ; bound of the address will wrap. ; ; INPUTS: ; IScriptOrCHRAddr: ; The start address of the script to read from. ; ; IScriptOffset: ; The offset within the script. ; ; OUTPUTS: ; A: ; The resulting byte. ; ; XREFS: ; IScriptAction_AddGold ; IScriptAction_AddHP ; IScriptAction_AddInventoryItem ; IScriptAction_AddMP ; IScriptAction_ConsumeItem ; IScriptAction_IfPlayerHasItem ; IScriptAction_IfPlayerHasTitle ; IScriptAction_IfQuestCompleted ; IScriptAction_OpenShop ; IScriptAction_SetQuestComplete ; IScriptAction_SetSpawnPoint ; IScriptAction_ShowMessage ; IScriptAction_ShowQuestionMessage ; IScriptAction_ShowQuestionMessageCheckIfDismissed ; IScriptAction_ShowSellMenu ; IScriptAction_ShowUnskippableMessage ; IScriptAction_SpendGold ; IScripts_InvokeNextAction ; IScripts_JumpToNextAddr ; IScripts_SkipAddrAndInvoke ;============================================================================
[87a4]IScripts_LoadByte: [87a4]a4 ddLDY IScriptOffset; Y = current event offset [87a6]b1 dbLDA (IScriptOrCHRAddr),Y; A = byte in the script at the offset [87a8]c8INY; Y++ [87a9]d0 02BNE @_incOffset; If byte is not 0, update event and return.
; ; The offset wrapped from 0xFF to 0. Update the upper byte ; of the script address for the next read. ;
[87ab]e6 dcINC IScriptOrCHRAddr_U; Increment the address [87ad]@_incOffset: [87ad]84 ddSTY IScriptOffset; Set new offset
; ; XREFS: ; IScripts_UpdatePortraitAnimation ;
[87af]RETURN_87AF: [87af]60RTS
;============================================================================ ; Update the portrait animation during message display. ; ; This will redraw the screen in a frozen state, and then ; compute what frame of animation to show for the portrait. ; ; If there's no message to display, or the drawing of the ; message finished, then portrait frame 0 will be shown. ; Otherwise, the frame will be based on the animation counter, ; using frames 0..2. ; ; INPUTS: ; InterruptCounter: ; The current interrupt counter. ; ; MessageID: ; The currently-displaying message ID. ; ; Temp_0201: ; The portrait ID. ; ; TextBox_MessagePaused: ; The message display ended flag. ; ; OUTPUTS: ; None. ; ; CALLS: ; Game_DrawScreenInFrozenState ; Screen_ResetSpritesForGamePlay ; IScripts_DrawPortraitAnimationFrame ; IScripts_SetPortraitSpriteXY ; WaitForNextFrame ; ; XREFS: ; IScriptAction_AddHP ; IScriptAction_AddInventoryItem ; IScriptAction_AddMP ; IScriptAction_EndScript ; IScriptAction_OpenShop ; IScriptAction_ShowBuySellMenu ; IScriptAction_ShowMessage ; IScriptAction_ShowPassword ; IScriptAction_ShowQuestionMessage ; IScriptAction_ShowQuestionMessageCheckIfDismissed ; IScriptAction_ShowSellMenu ; IScriptAction_ShowUnskippableMessage ; IScripts_ProgressivelyAddGold ; IScripts_ProgressivelySubtractGold ; IScripts_ShowFinalMessage ; IScripts_WaitForMenuInput ; Maybe_Shop_DrawTextBox ;============================================================================
[87b0]IScripts_UpdatePortraitAnimation: [87b0]20 25 caJSR WaitForNextFrame; Wait for the next frame. [87b3]20 47 cbJSR Screen_ResetSpritesForGamePlay; Set up state for a screen draw. [87b6]20 46 dcJSR Game_DrawScreenInFrozenState; Draw the screen in a frozen animation state. [87b9]ad 01 02LDA a:Temp_0201; Load the portrait ID. [87bc]10 f1BPL RETURN_87AF; If no portrait, return. [87be]4c c1 87JMP @_updatePortrait; Else, jump to update portrait (oddly, since we could fall through). [87c1]@_updatePortrait: [87c1]ad 13 02LDA a:MessageID; Load the current message ID. [87c4]f0 0eBEQ @_messageIsUnset; If unset, jump. [87c6]ad 15 02LDA a:TextBox_MessagePaused; Load the message-ended flag. [87c9]d0 09BNE @_messageIsUnset; If the message ended, jump.
; ; The message is still animating, so choose the next ; animation frame. ;
[87cb]a5 1aLDA InterruptCounter; Load the interrupt counter. [87cd]4aLSR A; Divide by 8. [87ce]4aLSR A [87cf]4aLSR A [87d0]29 03AND #$03; Keep bits 0-1 as the new animation frame. [87d2]10 02BPL @_drawFrame; Jump to finish the update.
; ; There's no message to continue showing, so freeze the ; animation to frame 0. ;
[87d4]@_messageIsUnset: [87d4]a9 00LDA #$00; Force animation frame to 0. [87d6]@_drawFrame: [87d6]20 16 82JSR IScripts_SetPortraitSpriteXY; Set the X/Y location for the portrait sprite. [87d9]4c 9b f2JMP IScripts_DrawPortraitAnimationFrame; Draw the computed animation frame.
;============================================================================ ; Check if the user has enough money. ; ; This will determine a result based on the values stored ; in GoldMRequired and GoldLRequired. ; ; If Gold_U is at all set, it's assumed the player has ; enough money, because all checks are under this amount. ; ; Else, if Gold_M has more than the requested amount, or ; is equal and Gold_L has more, then the player has enough. ; ; INPUTS: ; Temp_Int24: ; Temp_Int24+1: ; The amount of gold required for a true result. ; ; Gold: ; Gold_M: ; Gold_U: ; The amount of gold the player has. ; ; OUTPUTS: ; C: ; 1 if the player has enough gold. ; 0 if the player does not.; ; ; XREFS: ; IScriptAction_OpenShop ; IScriptAction_SpendGold ;============================================================================
[87dc]IScripts_CheckEnoughMoney:
; ; Check the upper byte of the gold. ;
[87dc]ad 94 03LDA a:Gold_U; Load the upper byte of the player's gold amount. [87df]c9 00CMP #$00; Is it 0? [87e1]d0 0cBNE @_return; If no, return. CMP set Carry as our result.
; ; Check the middle byte of the gold. ;
[87e3]ad 93 03LDA a:Gold_M; Load the middle byte of the player's gold amount. [87e6]c5 edCMP Temp_Int24_M; Compare to the required amount. [87e8]d0 05BNE @_return; If not 0, return. CMP set Carry as our result.
; ; Check the lower byte of the gold. ;
[87ea]ad 92 03LDA a:Gold; Load the lower byte of the gold amount. [87ed]c5 ecCMP Temp_Int24; Compare to get our final result as the Carry flag. [87ef]@_return: [87ef]60RTS
;============================================================================ ; Return a pixel X position for the current textbox position. ; ; INPUTS: ; TextBox_X: ; The textbox X position. ; ; OUTPUTS: ; A: ; The pixel X position. ; ; XREFS: ; Menu_UpdateAndDraw ;============================================================================
[87f0]TextBox_GetXPixelCoord: [87f0]ad 08 02LDA a:TextBox_X; Load the X tile position. [87f3]0aASL A; Multiply by 8 to convert to a pixel position. [87f4]0aASL A [87f5]0aASL A [87f6]60RTS; Return it.
;============================================================================ ; Return a pixel Y position for the current textbox position. ; ; INPUTS: ; TextBox_Y: ; The textbox Y position. ; ; OUTPUTS: ; A: ; The pixel Y position. ; ; XREFS: ; Menu_UpdateAndDraw ;============================================================================
[87f7]TextBox_GetYPixelCoord: [87f7]ad 09 02LDA a:TextBox_Y; Load the Y tile position. [87fa]0aASL A; Multiply by 8 to convert to a pixel position. [87fb]0aASL A [87fc]0aASL A [87fd]60RTS; Return it.
;============================================================================ ; TODO: Document TextBox_GetNextAttributeDataOffset ; ; INPUTS: ; None. ; ; OUTPUTS: ; A ; ; XREFS: ; TextBox_FillBackground ; TextBox_SetNextAttributeData ;============================================================================
[87fe]TextBox_GetNextAttributeDataOffset: [87fe]a5 ebLDA TextBox_ContentsY [8800]0aASL A [8801]0aASL A [8802]29 f8AND #$f8 [8804]85 edSTA Temp_Int24_M [8806]a5 eaLDA TextBox_ContentsX [8808]4aLSR A [8809]05 edORA Temp_Int24_M [880b]85 edSTA Temp_Int24_M [880d]60RTS
;============================================================================ ; TODO: Document TextBox_SetNextAttributeData ; ; INPUTS: ; A ; ; OUTPUTS: ; TODO ; ; XREFS: ; TextBox_FillBackground ;============================================================================
[880e]TextBox_SetNextAttributeData: [880e]85 ecSTA Temp_Int24 [8810]20 fe 87JSR TextBox_GetNextAttributeDataOffset [8813]aaTAX [8814]a5 ebLDA TextBox_ContentsY [8816]4aLSR A [8817]b0 29BCS @LAB_PRG12__8842 [8819]a5 eaLDA TextBox_ContentsX [881b]4aLSR A [881c]b0 11BCS @LAB_PRG12__882f [881e]bd 42 02LDA a:TextBox_AttributeData,X [8821]29 fcAND #$fc [8823]85 edSTA Temp_Int24_M [8825]a5 ecLDA Temp_Int24 [8827]29 03AND #$03 [8829]05 edORA Temp_Int24_M [882b]9d 42 02STA a:TextBox_AttributeData,X [882e]60RTS [882f]@LAB_PRG12__882f: [882f]bd 42 02LDA a:TextBox_AttributeData,X [8832]29 f3AND #$f3 [8834]85 edSTA Temp_Int24_M [8836]a5 ecLDA Temp_Int24 [8838]0aASL A [8839]0aASL A [883a]29 0cAND #$0c [883c]05 edORA Temp_Int24_M [883e]9d 42 02STA a:TextBox_AttributeData,X [8841]60RTS [8842]@LAB_PRG12__8842: [8842]a5 eaLDA TextBox_ContentsX [8844]4aLSR A [8845]b0 15BCS @LAB_PRG12__885c [8847]bd 42 02LDA a:TextBox_AttributeData,X [884a]29 cfAND #$cf [884c]85 edSTA Temp_Int24_M [884e]a5 ecLDA Temp_Int24 [8850]0aASL A [8851]0aASL A [8852]0aASL A [8853]0aASL A [8854]29 30AND #$30 [8856]05 edORA Temp_Int24_M [8858]9d 42 02STA a:TextBox_AttributeData,X [885b]60RTS [885c]@LAB_PRG12__885c: [885c]bd 42 02LDA a:TextBox_AttributeData,X [885f]29 3fAND #$3f [8861]85 edSTA Temp_Int24_M [8863]a5 ecLDA Temp_Int24 [8865]0aASL A [8866]0aASL A [8867]0aASL A [8868]0aASL A [8869]0aASL A [886a]0aASL A [886b]29 c0AND #$c0 [886d]05 edORA Temp_Int24_M [886f]9d 42 02STA a:TextBox_AttributeData,X [8872]60RTS [8873]PLAYER_TOP_MENU_ITEM_STRINGS: [8873]06 57 45 41 50 4f 4e 20.byte $06,"WEAPON "; char [887b]20 20 20 20 20 20 20 20.byte " "; char [8883]05 41 52 4d 4f 52 20 20.byte $05,"ARMOR "; char [888b]20 20 20 20 20 20 20 20.byte " "; char [8893]06 53 48 49 45 4c 44 20.byte $06,"SHIELD "; char [889b]20 20 20 20 20 20 20 20.byte " "; char [88a3]05 4d 41 47 49 43 20 20.byte $05,"MAGIC "; char [88ab]20 20 20 20 20 20 20 20.byte " "; char [88b3]04 49 54 45 4d 20 20 20.byte $04,"ITEM "; char [88bb]20 20 20 20 20 20 20 20.byte " "; char [88c3]06 50 4c 41 59 45 52 20.byte $06,"PLAYER "; char [88cb]20 20 20 20 20 20 20 20.byte " "; char
; ; XREFS: ; PlayerMenu_ShowStatusMenu ;
[88d3]PLAYER_STATUS_MENU_STRINGS: [88d3]09 20 20 20 20 52 41 4e.byte $09," RAN"; char [88db]4b 3a 20 20 20 20 20 20.byte "K: "; char [88e3]09 4e 45 58 54 20 45 58.byte $09,"NEXT EX"; char [88eb]50 3a 20 20 20 20 20 20.byte "P: "; char [88f3]09 57 45 41 50 4f 4e 3a.byte $09,"WEAPON:"; char [88fb]20 20 20 20 20 20 20 20.byte " "; char [8903]09 20 41 52 4d 4f 52 3a.byte $09," ARMOR:"; char [890b]20 20 20 20 20 20 20 20.byte " "; char [8913]09 53 48 49 45 4c 44 3a.byte $09,"SHIELD:"; char [891b]20 20 20 20 20 20 20 20.byte " "; char [8923]09 20 4d 41 47 49 43 3a.byte $09," MAGIC:"; char [892b]20 20 20 20 20 20 20 20.byte " "; char [8933]09 20 20 49 54 45 4d 3a.byte $09," ITEM:"; char [893b]20 20 20 20 20 20 20 20.byte " "; char [8943]PLAYER_STATUS_MENU_TITLES: [8943]09 4e 4f 56 49 43 45 20.byte $09,"NOVICE "; char [894b]20 20 20 20 20 20 20 20.byte " "; char [8953]09 41 53 50 49 52 41 4e.byte $09,"ASPIRAN"; char [895b]54 20 20 20 20 20 20 20.byte "T "; char [8963]09 42 41 54 54 4c 45 52.byte $09,"BATTLER"; char [896b]20 20 20 20 20 20 20 20.byte " "; char [8973]09 46 49 47 48 54 45 52.byte $09,"FIGHTER"; char [897b]20 20 20 20 20 20 20 20.byte " "; char [8983]09 41 44 45 50 54 20 20.byte $09,"ADEPT "; char [898b]20 20 20 20 20 20 20 20.byte " "; char [8993]09 43 48 45 56 41 4c 49.byte $09,"CHEVALI"; char [899b]45 52 20 20 20 20 20 20.byte "ER "; char [89a3]09 56 45 54 45 52 41 4e.byte $09,"VETERAN"; char [89ab]20 20 20 20 20 20 20 20.byte " "; char [89b3]09 57 41 52 52 49 4f 52.byte $09,"WARRIOR"; char [89bb]20 20 20 20 20 20 20 20.byte " "; char [89c3]09 53 57 4f 52 44 4d 41.byte $09,"SWORDMA"; char [89cb]4e 20 20 20 20 20 20 20.byte "N "; char [89d3]09 48 45 52 4f 20 20 20.byte $09,"HERO "; char [89db]20 20 20 20 20 20 20 20.byte " "; char [89e3]09 53 4f 4c 44 49 45 52.byte $09,"SOLDIER"; char [89eb]20 20 20 20 20 20 20 20.byte " "; char [89f3]09 4d 59 52 4d 49 44 4f.byte $09,"MYRMIDO"; char [89fb]4e 20 20 20 20 20 20 20.byte "N "; char [8a03]09 43 48 41 4d 50 49 4f.byte $09,"CHAMPIO"; char [8a0b]4e 20 20 20 20 20 20 20.byte "N "; char [8a13]09 53 55 50 45 52 48 45.byte $09,"SUPERHE"; char [8a1b]52 4f 20 20 20 20 20 20.byte "RO "; char [8a23]09 50 41 4c 41 44 49 4e.byte $09,"PALADIN"; char [8a2b]20 20 20 20 20 20 20 20.byte " "; char [8a33]09 4c 4f 52 44 20 20 20.byte $09,"LORD "; char [8a3b]20 20 20 20 20 20 20 20.byte " "; char [8a43]NO_INVENTORY_ITEM_STRINGS: [8a43]09 4e 4f 20 57 45 41 50.byte $09,"NO WEAP"; char [8a4b]4f 4e 20 20 20 20 20 20.byte "ON "; char [8a53]09 4e 4f 20 41 52 4d 4f.byte $09,"NO ARMO"; char [8a5b]52 20 20 20 20 20 20 20.byte "R "; char [8a63]09 4e 4f 20 53 48 49 45.byte $09,"NO SHIE"; char [8a6b]4c 44 20 20 20 20 20 20.byte "LD "; char [8a73]09 4e 4f 20 4d 41 47 49.byte $09,"NO MAGI"; char [8a7b]43 20 20 20 20 20 20 20.byte "C "; char [8a83]09 4e 4f 20 49 54 45 4d.byte $09,"NO ITEM"; char [8a8b]20 20 20 20 20 20 20 20.byte " "; char
;============================================================================ ; TODO: Document PlayerMenu_Show ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; GameLoop_CheckShowPlayerMenu ;============================================================================
[8a93]PlayerMenu_Show: [8a93]a9 06LDA #$06 [8a95]8d 1f 02STA a:Arg_StringsCount [8a98]a9 00LDA #$00 [8a9a]8d 1e 02STA a:Menu_CursorPos [8a9d]a9 02LDA #$02 [8a9f]8d 08 02STA a:TextBox_X [8aa2]a9 06LDA #$06 [8aa4]8d 09 02STA a:TextBox_Y [8aa7]a9 0aLDA #$0a [8aa9]8d 0a 02STA a:TextBox_Width [8aac]a9 0eLDA #$0e [8aae]8d 0b 02STA a:TextBox_Height [8ab1]a9 18LDA #$18 [8ab3]20 e4 d0JSR Sound_PlayEffect [8ab6]20 f1 8eJSR TextBox_Open [8ab9]a9 73LDA #<PLAYER_TOP_MENU_ITEM_STRINGS [8abb]85 ecSTA Temp_Int24 [8abd]a9 88LDA #>PLAYER_TOP_MENU_ITEM_STRINGS [8abf]85 edSTA Temp_Int24_M [8ac1]a2 00LDX #$00 [8ac3]8e 20 02STX a:DataArray [8ac6]e8INX [8ac7]8e 21 02STX a:DataArray_1_ [8aca]e8INX [8acb]8e 22 02STX a:DataArray_2_ [8ace]e8INX [8acf]8e 23 02STX a:DataArray_3_ [8ad2]e8INX [8ad3]8e 24 02STX a:DataArray_4_ [8ad6]e8INX [8ad7]8e 25 02STX a:DataArray_5_ [8ada]20 6b 8eJSR PlayerMenu_DrawStringLines [8add]@_inputLoop: [8add]20 25 caJSR WaitForNextFrame [8ae0]20 47 cbJSR Screen_ResetSpritesForGamePlay [8ae3]20 56 90JSR Menu_UpdateAndDraw [8ae6]a5 19LDA Joy1_ChangedButtonMask [8ae8]30 06BMI @_loadMenuIDs [8aea]0aASL A [8aeb]10 f0BPL @_inputLoop [8aed]4c 02 90JMP TextBox_Close [8af0]@_loadMenuIDs: [8af0]ae 1e 02LDX a:Menu_CursorPos [8af3]e0 05CPX #$05 [8af5]d0 03BNE PlayerMenu_ShowSubmenu [8af7]4c 5a 8dJMP PlayerMenu_ShowStatusMenu
;============================================================================ ; TODO: Document PlayerMenu_ShowSubmenu ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; PlayerMenu_Show ;============================================================================
[8afa]PlayerMenu_ShowSubmenu: [8afa]a9 04LDA #$04 [8afc]8d 08 02STA a:TextBox_X [8aff]a9 08LDA #$08 [8b01]8d 09 02STA a:TextBox_Y [8b04]a9 14LDA #$14 [8b06]8d 0a 02STA a:TextBox_Width [8b09]a9 12LDA #$12 [8b0b]8d 0b 02STA a:TextBox_Height [8b0e]20 f1 8eJSR TextBox_Open [8b11]ae 1e 02LDX a:Menu_CursorPos [8b14]8e 0e 02STX a:PlayerMenu_SelectedInventory [8b17]bd c2 03LDA a:NumberOfWeapons,X [8b1a]d0 33BNE PlayerMenu_ShowInventoryMenu [8b1c]ad 08 02LDA a:TextBox_X [8b1f]18CLC [8b20]69 02ADC #$02 [8b22]85 eaSTA TextBox_ContentsX [8b24]ad 09 02LDA a:TextBox_Y [8b27]18CLC [8b28]69 02ADC #$02 [8b2a]85 ebSTA TextBox_ContentsY [8b2c]20 04 f8JSR PPU_SetAddrForTextBoxPos [8b2f]a9 43LDA #<NO_INVENTORY_ITEM_STRINGS [8b31]85 ecSTA Temp_Int24 [8b33]a9 8aLDA #>NO_INVENTORY_ITEM_STRINGS [8b35]85 edSTA Temp_Int24_M [8b37]ad 1e 02LDA a:Menu_CursorPos [8b3a]20 8c f7JSR Math_MultiplyBy16 [8b3d]a8TAY [8b3e]20 9b 8eJSR UI_DrawString [8b41]@_inputLoop: [8b41]20 25 caJSR WaitForNextFrame [8b44]20 47 cbJSR Screen_ResetSpritesForGamePlay [8b47]a5 19LDA Joy1_ChangedButtonMask [8b49]0aASL A [8b4a]10 f5BPL @_inputLoop [8b4c]4c ed 8bJMP PlayerMenu_Close
;============================================================================ ; TODO: Document PlayerMenu_ShowInventoryMenu ; ; INPUTS: ; A ; X ; ; OUTPUTS: ; TODO ; ; XREFS: ; PlayerMenu_ShowSubmenu ;============================================================================
[8b4f]PlayerMenu_ShowInventoryMenu: [8b4f]8d 1f 02STA a:Arg_StringsCount [8b52]bd 29 9bLDA a:INVENTORY_CATEGORY_L,X [8b55]85 ecSTA Temp_Int24 [8b57]bd 2e 9bLDA a:INVENTORY_CATEGORY_U,X [8b5a]85 edSTA Temp_Int24_M [8b5c]a0 00LDY #$00 [8b5e]@_loadMenuIDs: [8b5e]b1 ecLDA (Temp_Int24),Y [8b60]99 20 02STA a:DataArray,Y [8b63]c8INY [8b64]cc 1f 02CPY a:Arg_StringsCount [8b67]d0 f5BNE @_loadMenuIDs [8b69]20 04 8cJSR PlayerMenu_DrawInventoryItems [8b6c]a9 00LDA #$00 [8b6e]8d 1e 02STA a:Menu_CursorPos; Set the menu cursor position to 0.
; ; v-- Fall through --v ;
;============================================================================ ; TODO: Document PlayerMenu_HandleInventoryMenuInput ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; PlayerMenu_HandleInvalidChoice ; PlayerMenu_HandleInventoryMenuInput ;============================================================================
[8b71]PlayerMenu_HandleInventoryMenuInput:
; ; Wait for input on the menu. ;
[8b71]20 25 caJSR WaitForNextFrame; Wait for the next frame. [8b74]20 47 cbJSR Screen_ResetSpritesForGamePlay; Set up draw state. [8b77]20 56 90JSR Menu_UpdateAndDraw; Update and draw the menu. [8b7a]a5 19LDA Joy1_ChangedButtonMask; Check for a changed button. [8b7c]30 05BMI @_hasInput; If the the "A" button is pressed, jump to handle input. [8b7e]0aASL A; Shift the button mask left. [8b7f]30 6cBMI PlayerMenu_Close; If the "B" button is pressed, close the menu. [8b81]10 eeBPL PlayerMenu_HandleInventoryMenuInput [8b83]@_hasInput: [8b83]ad 24 00LDA a:Area_CurrentArea; Load the current area. [8b86]c9 04CMP #$04; Is the player inside/in a place where they can't equip? [8b88]f0 5bBEQ PlayerMenu_HandleInvalidChoice; If so, it's an invalid choice.
; ; The player is in an area where they can equip. See if ; this inventory allows equipping (only Magic and Item). ;
[8b8a]ad 0e 02LDA a:PlayerMenu_SelectedInventory; Load the selected inventory index. [8b8d]c9 03CMP #$03; Is it the Magic or Item inventory? [8b8f]b0 3dBCS PlayerMenu_EquipItem; If so, always allow equipping the item.
; ; Check the selected weapon and see if it's the Dragon Slayer ; (which also implies the Battle Suit and Battle Helmet). ; ; If they have these, they cannot select a new item. If they ; don't, they can. ;
[8b91]ad bd 03LDA a:SelectedWeapon; Load the selected weapon. [8b94]c9 03CMP #$03; Is it the Dragon Slayer? [8b96]f0 4dBEQ PlayerMenu_HandleInvalidChoice; If not, it's an invalid choice. [8b98]ae 1e 02LDX a:Menu_CursorPos; X = Menu cursor position. [8b9b]bd 20 02LDA a:DataArray,X; A = Item ID at the cursor position. [8b9e]c9 03CMP #$03; Is the item ID 3 (Dragon Slayer)? [8ba0]d0 2cBNE PlayerMenu_EquipItem; If not, proceed to equip the item normally.
; ; The player selected a Dragon Slayer, Battle Suit, or Battle ; Helmet. Check if they have all three, and if so, they'll all ; be equipped. ; ; First, check for the Dragon Slayer. ;
[8ba2]a9 03LDA #$03; 0x03 == Dragon Slayer [8ba4]20 f7 8cJSR Player_LacksItem; Does the player have it? [8ba7]b0 3cBCS PlayerMenu_HandleInvalidChoice; If not, it's an invalid choice.
; ; They have the Dragon Slayer. Check for the Battle Suit. ;
[8ba9]a9 23LDA #$23; 0x23 == Battle Suit. [8bab]20 f7 8cJSR Player_LacksItem; Does the player have it? [8bae]b0 35BCS PlayerMenu_HandleInvalidChoice; If not, it's an invalid choice.
; ; They have the Dragon Slayer and Battle Suit. Check for the ; Battle Helmet. ;
[8bb0]a9 43LDA #$43; 0x43 == Battle Helmet. [8bb2]20 f7 8cJSR Player_LacksItem; Does the player have it? [8bb5]b0 2eBCS PlayerMenu_HandleInvalidChoice; If not, it's an invalid choice.
; ; They have all three. Equip them all and close the menu. ;
[8bb7]a9 08LDA #$08; 0x08 == Item Pick-Up sound. [8bb9]20 e4 d0JSR Sound_PlayEffect; Play it. [8bbc]a9 03LDA #$03; 0x03 == Dragon Slayer. [8bbe]20 a9 8cJSR Player_Equip; Equip it. [8bc1]a9 23LDA #$23; 0x23 == Battle Suit. [8bc3]20 a9 8cJSR Player_Equip; Equip it. [8bc6]a9 43LDA #$43; 0x43 == Battle Helmet. [8bc8]20 a9 8cJSR Player_Equip; Equip it. [8bcb]4c ed 8bJMP PlayerMenu_Close; Close the Player Menu.
;============================================================================ ; TODO: Document PlayerMenu_EquipItem ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; PlayerMenu_HandleInventoryMenuInput ;============================================================================
[8bce]PlayerMenu_EquipItem: [8bce]a9 08LDA #$08; 0x08 == Item pick-up sound. [8bd0]20 e4 d0JSR Sound_PlayEffect; Play it. [8bd3]ae 1e 02LDX a:Menu_CursorPos; X = Menu cursor position. [8bd6]ad 0e 02LDA a:PlayerMenu_SelectedInventory; A = Selected inventory. [8bd9]20 8b f7JSR Player_GetInventoryBitForIndex; Get the inventory bits. [8bdc]1d 20 02ORA a:DataArray,X; OR it with the selected item index as an item ID. [8bdf]20 a9 8cJSR Player_Equip; Equip the resulting item. [8be2]4c ed 8bJMP PlayerMenu_Close; Close the Player Menu.
;============================================================================ ; TODO: Document PlayerMenu_HandleInvalidChoice ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; PlayerMenu_HandleInventoryMenuInput ;============================================================================
[8be5]PlayerMenu_HandleInvalidChoice: [8be5]a9 0dLDA #$0d; 0x0D == Invalid Choice sound effect. [8be7]20 e4 d0JSR Sound_PlayEffect; Play it. [8bea]4c 71 8bJMP PlayerMenu_HandleInventoryMenuInput; Resume handling of the inventory menu.
;============================================================================ ; Close the Player Menu. ; ; INPUTS: ; None. ; ; OUTPUTS: ; TextBox_X: ; TextBox_Y: ; TextBox_Width: ; TextBox_Height: ; Clobbered. ; ; CALLS: ; TextBox_Close ; ; XREFS: ; PlayerMenu_EquipItem ; PlayerMenu_HandleInventoryMenuInput ; PlayerMenu_ShowSubmenu ;============================================================================
[8bed]PlayerMenu_Close: [8bed]a9 02LDA #$02 [8bef]8d 08 02STA a:TextBox_X; Set box X coordinate to 2. [8bf2]a9 06LDA #$06 [8bf4]8d 09 02STA a:TextBox_Y; Set box Y coordinate to 6. [8bf7]a9 16LDA #$16 [8bf9]8d 0a 02STA a:TextBox_Width; Set box width to 22. [8bfc]a9 14LDA #$14 [8bfe]8d 0b 02STA a:TextBox_Height; Set box height to 20. [8c01]4c 02 90JMP TextBox_Close; Close the Player Menu.
;============================================================================ ; TODO: Document PlayerMenu_DrawInventoryItems ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; PlayerMenu_ShowInventoryMenu ;============================================================================
[8c04]PlayerMenu_DrawInventoryItems: [8c04]ad 09 02LDA a:TextBox_Y [8c07]85 ebSTA TextBox_ContentsY [8c09]a2 00LDX #$00 [8c0b]@LAB_PRG12__8c0b: [8c0b]8aTXA [8c0c]48PHA [8c0d]e6 ebINC TextBox_ContentsY [8c0f]ac 08 02LDY a:TextBox_X [8c12]c8INY [8c13]c8INY [8c14]84 eaSTY TextBox_ContentsX [8c16]ad 0e 02LDA a:PlayerMenu_SelectedInventory [8c19]20 8b f7JSR Player_GetInventoryBitForIndex [8c1c]1d 20 02ORA a:DataArray,X [8c1f]48PHA [8c20]20 58 8cJSR TextBox_DrawItemImage [8c23]68PLA [8c24]e6 ebINC TextBox_ContentsY [8c26]e6 eaINC TextBox_ContentsX [8c28]e6 eaINC TextBox_ContentsX [8c2a]20 36 8cJSR TextBox_DrawItemName [8c2d]68PLA [8c2e]aaTAX [8c2f]e8INX [8c30]ec 1f 02CPX a:Arg_StringsCount [8c33]d0 d6BNE @LAB_PRG12__8c0b [8c35]60RTS
;============================================================================ ; TODO: Document TextBox_DrawItemName ; ; INPUTS: ; A ; ; OUTPUTS: ; TODO ; ; XREFS: ; IScriptAction_AddInventoryItem ; PlayerMenu_DrawInventoryItems ; PlayerMenu_ShowStatusMenu ; Shop_Draw ;============================================================================
[8c36]TextBox_DrawItemName: [8c36]48PHA [8c37]48PHA [8c38]20 04 f8JSR PPU_SetAddrForTextBoxPos [8c3b]68PLA [8c3c]20 85 f7JSR Player_GetInventoryIndexForItem [8c3f]aaTAX [8c40]bd 33 9bLDA a:ITEM_NAME_CATEGORIES_L,X [8c43]85 ecSTA Temp_Int24 [8c45]bd 38 9bLDA a:ITEM_NAME_CATEGORIES_U,X [8c48]85 edSTA Temp_Int24_M [8c4a]68PLA [8c4b]29 1fAND #$1f [8c4d]20 8c f7JSR Math_MultiplyBy16 [8c50]90 02BCC @LAB_PRG12__8c54 [8c52]e6 edINC Temp_Int24_M [8c54]@LAB_PRG12__8c54: [8c54]a8TAY [8c55]4c 9b 8eJMP UI_DrawString
;============================================================================ ; Draw the image for an item in a textbox. ; ; This is used when acquiring an item. The image's tileset ; will be queued into the PPU buffer, followed by the ; indexes of the tiles to draw for the item. ; ; These will be positioned within the textbox where the first ; character of text would normally be. ; ; INPUTS: ; A: ; The ID of the item to draw. ; ; X: ; The offset within the loaded PPU tiles containing ; the tiles to display. Each value represents a ; 4-tile span of 64 bytes. ; ; OUTPUTS: ; PPU_TargetAddr: ; Clobbered. ; ; CALLS: ; PPU_SetAddrForTextBoxPos ; PPU_IncrementAddrBy32 ; PPUBuffer_QueueCommandOrLength ; PPUBuffer_Set ; TextBox_LoadItemSourceTiles ; ; XREFS: ; IScriptAction_AddInventoryItem ; PlayerMenu_DrawInventoryItems ; PlayerMenu_ShowStatusMenu ; Shop_Draw ;============================================================================
[8c58]TextBox_DrawItemImage:
; ; Save the registers temporarily. ;
[8c58]85 ecSTA Temp_Int24; Store the item ID temporarily. [8c5a]98TYA; A = Y [8c5b]48PHA; Push to the stack. [8c5c]8aTXA; A = X [8c5d]48PHA; Push to the stack.
; ; Set the target PPU address to load tiles into. The following ; code is equivalent to: ; ; addr = $1400 + (index * 64) ; ; 64 is the number of bytes for a full item image ; (8 bytes * 4 tiles). This will be used again below. ;
[8c5e]a9 00LDA #$00; A = 0 [8c60]85 e8STA PPU_TargetAddr; Set as the lower byte. [8c62]8aTXA; A = X (item index) [8c63]48PHA; Push to the stack, twice. [8c64]48PHA [8c65]4aLSR A; C = bit0(index) [8c66]66 e8ROR PPU_TargetAddr; If C == 0, then set to 0. Else, set to 0x80. [8c68]4aLSR A; A = itemID >> 2 C = bit1(index) [8c69]66 e8ROR PPU_TargetAddr; Set to (bit1(index) << 7) | (bit0(index) << 6. == (index & 3) * 64. [8c6b]69 14ADC #$14; A = 0x14 + C. [8c6d]85 e9STA PPU_TargetAddr_U; Set as the upper byte.
; ; Queue the address for the source tiles for the item into the ; PPU at the address above. The indexes following this will be ; relative to that address. ;
[8c6f]a5 ecLDA Temp_Int24; Load the item ID. [8c71]20 18 fcJSR TextBox_LoadItemSourceTiles; Load the source tiles address in the PPU.
; ; Position the image where the text would normally go. ;
[8c74]20 04 f8JSR PPU_SetAddrForTextBoxPos; Set the draw position for the image.
; ; Draw the top two tiles of the image in the PPU buffer. ; ; There are: ; ; Tile1 = 64 + (itemID * 16) ; Tile2 = Tile1 + 1 ; ; (16 == 8 bytes * 2 tiles) ;
[8c77]a9 02LDA #$02; A = 2 (tiles) [8c79]20 dc cfJSR PPUBuffer_QueueCommandOrLength; Write the length to the PPU buffer. [8c7c]68PLA; Pull the index from the stack. [8c7d]0aASL A; Multiply by 16. [8c7e]0aASL A [8c7f]69 40ADC #$40; Add 64 + C. [8c81]20 45 f8JSR PPUBuffer_Set; Add to the PPU buffer. [8c84]18CLC [8c85]69 01ADC #$01; Add 1. [8c87]20 45 f8JSR PPUBuffer_Set; Add to the PPU buffer.
; ; Advane to the target address to the next position (bottom ; 2 tiles of the image). ;
[8c8a]86 20STX PPUBuffer_WriteOffset; Store the new PPU buffer write offset. [8c8c]20 26 f8JSR PPU_IncrementAddrBy32; Increment the PPU address by 32.
; ; Draw the second part of the image in the PPU buffer. ; ; There are: ; ; Tile3 = 66 + (index * 16) ; Tile4 = Tile3 + 1 ; ; (16 == 8 bytes * 2 tiles) ;
[8c8f]a9 02LDA #$02; A = 2 (tiles) [8c91]20 dc cfJSR PPUBuffer_QueueCommandOrLength; Write the length to the PPU buffer. [8c94]68PLA; Pull the index from the stack. [8c95]0aASL A; Multiply by 16. [8c96]0aASL A [8c97]69 42ADC #$42; Add 66 + C. [8c99]20 45 f8JSR PPUBuffer_Set; Add left tile index the PPU buffer. [8c9c]18CLC [8c9d]69 01ADC #$01; Add 1. [8c9f]20 45 f8JSR PPUBuffer_Set; Add right tile to the PPU buffer. [8ca2]86 20STX PPUBuffer_WriteOffset; Store the new PPU buffer write offset.
; ; Restore the registers saved at the top of the function. ;
[8ca4]68PLA; Pop the X register value. [8ca5]aaTAX; Set it back on X. [8ca6]68PLA; Pop the Y register value. [8ca7]a8TAY; Set it back on Y. [8ca8]60RTS; And return.
;============================================================================ ; Equip an item from the inventory. ; ; INPUTS: ; A: ; The inventory item, with bits set indicating the ; inventory. ; ; SelectedWeapon ; The starting range of inventories to look up ; items from. ; ; OUTPUTS: ; Temp_EquipingItem: ; Temp_PrevInventoryItem: ; Clobbered. ; ; CALLS: ; Player_AddToInventory ; Player_GetInventoryIndexForItem ; Player_RemoveItem ; Player_SetArmor ; Player_SetItem ; Player_SetMagic ; Player_SetShield ; Player_SetWeapon ; ; XREFS: ; PlayerMenu_EquipItem ; PlayerMenu_HandleInventoryMenuInput ;============================================================================
[8ca9]Player_Equip:
; ; Calculate the target inventory and store the old and ; new items temporary. ;
[8ca9]8d 10 02STA a:Temp_EquipingItem; Store the item that we're equipping. [8cac]20 85 f7JSR Player_GetInventoryIndexForItem; Compute the inventory index of the item. [8caf]aaTAX; Set X = the inventory index we computed [8cb0]bd bd 03LDA a:SelectedWeapon,X; Get the current item in the target inventory. [8cb3]8d 11 02STA a:Temp_PrevInventoryItem; Store the old item we're unequipping.
; ; Unequip the old item. ;
[8cb6]ad 10 02LDA a:Temp_EquipingItem [8cb9]20 6a 9aJSR Player_RemoveItem; Unequip the old item. [8cbc]ad 11 02LDA a:Temp_PrevInventoryItem; Load back the previous item.
; ; Only add to the inventory if we didn't already have one. ;
[8cbf]30 0bBMI @_inInventory; Branch if we don't need to add to the inventory. [8cc1]ad 10 02LDA a:Temp_EquipingItem; Load the item we're equipping. [8cc4]29 e0AND #$e0; Clear out all but the inventory bits. [8cc6]0d 11 02ORA a:Temp_PrevInventoryItem; Add the item's value. [8cc9]20 f7 9aJSR Player_AddToInventory; Now add to the inventory. [8ccc]@_inInventory: [8ccc]ad 10 02LDA a:Temp_EquipingItem
; ; Set the normalized value within the inventory. ;
[8ccf]20 85 f7JSR Player_GetInventoryIndexForItem; Calculate the inventory slot again. [8cd2]a8TAY; Set Y = inventory slot [8cd3]ad 10 02LDA a:Temp_EquipingItem; Set A = new item [8cd6]29 1fAND #$1f; Clear out the inventory bits, yielding the item value. [8cd8]88DEY [8cd9]f0 0cBEQ @_isArmor; Check if it's armor. [8cdb]88DEY [8cdc]f0 0cBEQ @_isShield; Check if it's a shield. [8cde]88DEY [8cdf]f0 0cBEQ @_isMagic; Check if it's magic. [8ce1]88DEY [8ce2]f0 0cBEQ @_isItem; Check if it's an item.
; ; Inventory 0 (weapons) ;
[8ce4]4c ec edJMP Player_SetWeapon; Set the current weapon.
; ; Inventory 1 (armor) ;
[8ce7]@_isArmor: [8ce7]4c 05 eeJMP Player_SetArmor; Set the current armor.
; ; Inventory 2 (shield) ;
[8cea]@_isShield: [8cea]4c 0d eeJMP Player_SetShield; Set the current shield.
; ; Inventory 3 (magic) ;
[8ced]@_isMagic: [8ced]4c f3 8cJMP Player_SetMagic; Set the current magic.
; ; Inventory 4 (normal items) ;
[8cf0]@_isItem: [8cf0]4c 0b fcJMP Player_SetItem; Set the current item.
;============================================================================ ; Set the player's current magic spell. ; ; INPUTS: ; A: ; The magic spell to set. ; ; OUTPUTS: ; SelectedMagic: ; The updated magic spell. ; ; XREFS: ; Player_Equip ;============================================================================
[8cf3]Player_SetMagic: [8cf3]8d c0 03STA a:SelectedMagic; Store the provided A value as the selected magic. [8cf6]60RTS
;============================================================================ ; Return whether the player lacks an item in the inventory. ; ; This will inspect the inventory bits of the item (the 3 ; most significant bits), using the remaining bits as the ; value of the item in the inventory. ; ; INPUTS: ; A: ; The item index with inventory bits to check. ; ; NumberOfWeapons: ; The starting range of inventory counters, ; indexed by inventory IDs. ; ; SelectedWeapon: ; The starting range of selected item memory, ; indexed by the inventory IDs. ; ; WeaponInventory: ; The starting range of inventories, indexed ; by the inventory IDs. ; ; INVENTORY_CATEGORY_U: ; INVENTORY_CATEGORY_L: ; A lookup table of inventory ID to address. ; ; SPECIAL_ITEM_BITMASKS: ; A lookup table of item indexes to special items ; bitmasks. ; ; OUTPUTS: ; C: ; 1 if the item is not in the inventory. ; 0 if it is. ; ; Temp_Int24: ; Temp_Int24+1: ; Clobbered. ; ; CALLS: ; Player_GetInventoryIndexForItem ; ; XREFS: ; IScriptAction_IfPlayerHasItem ; PlayerMenu_HandleInventoryMenuInput ;============================================================================
[8cf7]Player_LacksItem:
; ; Check if this is a special item. ; ; Each special item type will be converted into an index in ; the SPECIAL_ITEMS_BITMASKS lookup table. ; ; If the matching bit is set, the item exists, so return false. ;
[8cf7]a2 00LDX #$00; X will be our lookup table index. [8cf9]c9 80CMP #$80; Check Ring of Elf. [8cfb]f0 4bBEQ @_specialItemMatched [8cfd]e8INX; X++ [8cfe]c9 81CMP #$81; Check Ring of Ruby. [8d00]f0 46BEQ @_specialItemMatched [8d02]e8INX; X++ [8d03]c9 82CMP #$82; Check Ring of Dworf. [8d05]f0 41BEQ @_specialItemMatched [8d07]e8INX; X++ [8d08]c9 83CMP #$83; Check Demon's Ring. [8d0a]f0 3cBEQ @_specialItemMatched [8d0c]e8INX; X++ [8d0d]c9 92CMP #$92; Check Elixir. [8d0f]f0 37BEQ @_specialItemMatched [8d11]e8INX; X++ [8d12]c9 8aCMP #$8a; Check Magical Rod. [8d14]f0 32BEQ @_specialItemMatched [8d16]e8INX; X++ [8d17]c9 93CMP #$93; Check Pendant. [8d19]f0 2dBEQ @_specialItemMatched [8d1b]e8INX; X++ [8d1c]c9 94CMP #$94; Check Black Onyx. [8d1e]f0 28BEQ @_specialItemMatched [8d20]48PHA; Push the item value on the stack. [8d21]20 85 f7JSR Player_GetInventoryIndexForItem; Get the inventory for the item. [8d24]a8TAY; Set Y = inventory. [8d25]b9 29 9bLDA a:INVENTORY_CATEGORY_L,Y [8d28]85 ecSTA Temp_Int24 [8d2a]b9 2e 9bLDA a:INVENTORY_CATEGORY_U,Y [8d2d]85 edSTA Temp_Int24_M
; ; Check if this item is currently equipped. ; ; If so, we'll be returning false (we don't lack it). ;
[8d2f]68PLA; Pull the item into A [8d30]29 1fAND #$1f; Clear out the inventory bits, leaving the item value. [8d32]d9 bd 03CMP a:Inventories,Y; Get the inventory index from Y. [8d35]f0 19BEQ @_returnFalse; If this item is currently set, return false.
; ; Check the number of items in the target inventory. ; ; If the number is 0, we definitely lack the item. ;
[8d37]be c2 03LDX a:NumberOfWeapons,Y; Set X = inventory item count. [8d3a]f0 0aBEQ @_returnTrue; If 0, we lack the item.
; ; Loop through all items in the inventory to see if ; we have this item. ;
[8d3c]a0 00LDY #$00; Set Y = 0 for the loop counter
; ; Check the item at the address to see if it matches this one. ; ; If so, we don't lack the item. ;
[8d3e]@_checkInventoryLoop: [8d3e]d1 ecCMP (Temp_Int24),Y; Check the inventory address at this index. [8d40]f0 0eBEQ @_returnFalse; If it's a match, we don't lack the item. Return false. [8d42]c8INY; Y++. [8d43]caDEX; Reduce the number of items left to check. [8d44]d0 f8BNE @_checkInventoryLoop; Next loop.
; ; The item could not be found. The player lacks the item. ;
[8d46]@_returnTrue: [8d46]38SEC; Set for a true result. [8d47]60RTS [8d48]@_specialItemMatched: [8d48]ad 2c 04LDA a:SpecialItems; Load the player's Special Items bitmask. [8d4b]3d 52 8dAND a:SPECIAL_ITEMS_BITMASKS,X; Clear the bit for the matched item. [8d4e]f0 f6BEQ @_returnTrue [8d50]@_returnFalse: [8d50]18CLC; Clear for a false result. [8d51]60RTS
;============================================================================ ; A mapping of item IDs to Special Items bitmasks. ; ; XREFS: ; Player_LacksItem ;============================================================================
; ; XREFS: ; Player_LacksItem ;
[8d52]SPECIAL_ITEMS_BITMASKS: [8d52]80.byte $80; [0]: Ring of Elf
; ; XREFS: ; Player_LacksItem ;
[8d53]SPECIAL_ITEMS_BITMASKS_1_: [8d53]40.byte $40; [1]: Ring of Ruby
; ; XREFS: ; Player_LacksItem ;
[8d54]SPECIAL_ITEMS_BITMASKS_2_: [8d54]20.byte $20; [2]: Ring of Dworf
; ; XREFS: ; Player_LacksItem ;
[8d55]SPECIAL_ITEMS_BITMASKS_3_: [8d55]10.byte $10; [3]: Demon's Ring
; ; XREFS: ; Player_LacksItem ;
[8d56]SPECIAL_ITEMS_BITMASKS_4_: [8d56]08.byte $08; [4]: Elixir
; ; XREFS: ; Player_LacksItem ;
[8d57]SPECIAL_ITEMS_BITMASKS_5_: [8d57]04.byte $04; [5]: Magical Rod
; ; XREFS: ; Player_LacksItem ;
[8d58]SPECIAL_ITEMS_BITMASKS_6_: [8d58]02.byte $02; [6]: Pendant
; ; XREFS: ; Player_LacksItem ;
[8d59]SPECIAL_ITEMS_BITMASKS_7_: [8d59]01.byte $01; [7]: Black Onyx
;============================================================================ ; Show the player's status in the Player Menu. ; ; INPUTS: ; NextPlayerTitle: ; The next title to reach. ; ; SelectedWeapon: ; The start of the range of selected items. ; ; SpecialItems: ; The player's special items bitmask. ; ; Joy1_ChangedButtonMask: ; Changed button bitmask for controller 1. ; ; OUTPUTS: ; Arg_StringsCount: ; DataArray: ; Temp_Int24: ; Temp_Int24+1: ; $ee: ; TextBox_X: ; TextBox_Y: ; TextBox_Width: ; TextBox_Height: ; TextBox_ContentsX: ; TextBox_ContentsY: ; Clobbered. ; ; CALLS: ; Screen_ResetSpritesForGamePlay ; Player_GetInventoryBitForIndex ; PPU_SetAddrForTextBoxPos ; TextBox_Close ; TextBox_DrawItemImage ; TextBox_DrawItemName ; TextBox_DrawZeroPaddedNumber ; UI_DrawString ; PlayerMenu_DrawStringLines ; WaitForNextFrame ; ; XREFS: ; PlayerMenu_Show ;============================================================================
[8d5a]PlayerMenu_ShowStatusMenu:
; ; Position and open the textbox for the player status. ;
[8d5a]a9 04LDA #$04 [8d5c]8d 08 02STA a:TextBox_X; Set textbox X coordinate to 4. [8d5f]a9 08LDA #$08 [8d61]8d 09 02STA a:TextBox_Y; Set textbox Y coordinate to 8. [8d64]a9 1aLDA #$1a [8d66]8d 0a 02STA a:TextBox_Width; Set textbox width to 26. [8d69]a9 10LDA #$10 [8d6b]8d 0b 02STA a:TextBox_Height; Set textbox height to 16. [8d6e]20 f1 8eJSR TextBox_Open; Open the textbox.
; ; Prepare to draw 7 strings from ; (PLAYER_STATUS_MENU_STRINGS) ; in the textbox. ;
[8d71]a9 07LDA #$07 [8d73]8d 1f 02STA a:Arg_StringsCount; Prepare to draw 7 rows of strings. [8d76]a9 d3LDA #<PLAYER_STATUS_MENU_STRINGS; Lower byte of text strings. [8d78]85 ecSTA Temp_Int24; Store it. [8d7a]a9 88LDA #>PLAYER_STATUS_MENU_STRINGS; Upper byte of text strings. [8d7c]85 edSTA Temp_Int24_M; Store it. [8d7e]a2 00LDX #$00; X = 0 (index counter). [8d80]8e 20 02STX a:DataArray; Draw string 1 ("RANK:"). [8d83]e8INX [8d84]8e 21 02STX a:DataArray_1_; Draw string 2 ("NEXT EXP:"). [8d87]e8INX [8d88]8e 22 02STX a:DataArray_2_; Draw string 3 ("WEAPON:"). [8d8b]e8INX [8d8c]8e 23 02STX a:DataArray_3_; Draw string 4 ("ARMOR:"). [8d8f]e8INX [8d90]8e 24 02STX a:DataArray_4_; Draw string 5 ("SHIELD:"). [8d93]e8INX [8d94]8e 25 02STX a:DataArray_5_; Draw string 6 ("MAGIC:"). [8d97]e8INX [8d98]8e 26 02STX a:DataArray_6_; Draw string 7 ("ITEM:"). [8d9b]20 6b 8eJSR PlayerMenu_DrawStringLines; Draw the strings in the textbox.
; ; Prepare to draw the player rank/title. ; ; Strings will be loaded from PLAYER_STATUS_MENU_TITLES. ;
[8d9e]ad 08 02LDA a:TextBox_X; Get the textbox X coordinate. [8da1]18CLC [8da2]69 0bADC #$0b; Add 11. [8da4]85 eaSTA TextBox_ContentsX; Set as the draw X coordinate. [8da6]ad 09 02LDA a:TextBox_Y; Get the textbox Y coordinate. [8da9]18CLC [8daa]69 02ADC #$02; Add 2. [8dac]85 ebSTA TextBox_ContentsY; Set as the draw Y coordinate. [8dae]20 04 f8JSR PPU_SetAddrForTextBoxPos; Set this as the PPU draw position. [8db1]ad 37 04LDA a:PlayerTitle; Load the player title. [8db4]20 8c f7JSR Math_MultiplyBy16; Multiply by 16 to get an index into the strings. [8db7]a8TAY; Y = A (result) [8db8]a9 43LDA #<PLAYER_STATUS_MENU_TITLES; Lower byte of Player Title strings. [8dba]85 ecSTA Temp_Int24; Store it. [8dbc]a9 89LDA #>PLAYER_STATUS_MENU_TITLES; Upper byte of Player Title strings. [8dbe]85 edSTA Temp_Int24_M; Store it. [8dc0]20 9b 8eJSR UI_DrawString; Draw the string.
; ; Prepare to draw the player's experience. ;
[8dc3]e6 ebINC TextBox_ContentsY; Go down to 2 rows. [8dc5]e6 ebINC TextBox_ContentsY [8dc7]ad ed 04LDA a:NextPlayerTitle; Load the next possible title. [8dca]c9 0fCMP #$0f; Is it >= 15 (the last available title))? [8dcc]b0 15BCS @_drawSelectedItems; If so, leave this blank and draw items.
; ; Look up the experience in the lookup table in bank 15. ; ; Note that we're starting our offset 2 bytes before the ; lookup table. This is because our X will actually be a ; 1-based index, normalized to 0-based in the lookup table. ; Each entry is a word. ;
[8dce]0aASL A; Convert the title index to a word boundary. [8dcf]aaTAX; X = A (result). [8dd0]bd 49 f7LDA a:PLAYER_TITLE_EXP_NEEDED,X; Load the lower byte of the amount of experience needed for the next level. [8dd3]85 ecSTA Temp_Int24; Store it. [8dd5]bd 4a f7LDA a:PLAYER_TITLE_EXP_NEEDED+1,X; Load the middle byte. [8dd8]85 edSTA Temp_Int24_M; Store it. [8dda]a9 00LDA #$00; Upper byte is always 0. [8ddc]85 eeSTA Temp_Int24_U; Store it. [8dde]a0 05LDY #$05; 5 = Maximum number of digits. [8de0]20 03 faJSR TextBox_DrawZeroPaddedNumber; Draw the number zero-padded.
; ; Draw the selected items. ; ; In order, this will draw images and text for: ; ; 1. Weapon ; 2. Armor ; 3. Shield ; 4. Magic ;
[8de3]@_drawSelectedItems: [8de3]a2 00LDX #$00; X = 0 (loop counter). [8de5]@_drawSelectedItemsLoop: [8de5]8aTXA; A = X (loop counter) [8de6]48PHA; Push it to the stack. [8de7]e6 ebINC TextBox_ContentsY; Increment the draw Y coordinate by 2. [8de9]e6 ebINC TextBox_ContentsY [8deb]bd bd 03LDA a:SelectedWeapon,X; Load the selected item for this type. [8dee]30 1fBMI @_nextInventory; If unset, advance to the next.
; ; There's a selected item of this type. Load the information. ;
[8df0]ad 08 02LDA a:TextBox_X; Load the textbox X coordinate. [8df3]18CLC [8df4]69 09ADC #$09; Add 9 (image X coordinate). [8df6]85 eaSTA TextBox_ContentsX; Store as the draw X coordinate. [8df8]8aTXA; A = X (loop counter). [8df9]20 8b f7JSR Player_GetInventoryBitForIndex; Get the inventory bit for this index. [8dfc]1d bd 03ORA a:SelectedWeapon,X; OR with the item value, yielding an inventory-backed item ID. [8dff]48PHA; Push it to the stack.
; ; Position the image and draw it. ;
[8e00]c6 ebDEC TextBox_ContentsY; Go up a row for the start of the image. [8e02]20 58 8cJSR TextBox_DrawItemImage; Draw the image there.
; ; Position the item name text and draw it. ;
[8e05]e6 ebINC TextBox_ContentsY; Go down 1 rows. [8e07]e6 eaINC TextBox_ContentsX; Go right 2 rows for the text. [8e09]e6 eaINC TextBox_ContentsX [8e0b]68PLA; Pop the item ID. [8e0c]20 36 8cJSR TextBox_DrawItemName; Draw the name of the item. [8e0f]@_nextInventory: [8e0f]68PLA; Pop the X coordinate. [8e10]aaTAX; Set it back on X. [8e11]e8INX; X++ [8e12]e0 04CPX #$04; Is it 4 (last inventory type)? [8e14]d0 cfBNE @_drawSelectedItemsLoop; If not, loop.
; ; Prepare to draw the special items (up to 8 in total). ;
[8e16]ad 08 02LDA a:TextBox_X; Load the textbox's X location. [8e19]18CLC [8e1a]69 09ADC #$09; Add 9 (image X coordinate). [8e1c]85 eaSTA TextBox_ContentsX; Store it as the draw X coordinate. [8e1e]e6 ebINC TextBox_ContentsY; Increment the draw Y coordinate. [8e20]a2 00LDX #$00; X = 0 (loop counter) [8e22]ad 2c 04LDA a:SpecialItems; A = Special items bitmask
; ; Draw in a loop. ;
[8e25]@_drawSpecialItemLoop: [8e25]0aASL A; Shift the left-most bit into C. [8e26]90 10BCC @_nextSpecialItem; If not set, skip to the next item. [8e28]48PHA; Push the remaining bits to the stack. [8e29]8aTXA; A = X (loop counter). [8e2a]48PHA; Push the loop counter to the stack. [8e2b]bd 63 8eLDA a:SPECIAL_ITEM_TILE_START_IDS,X; Load the tile start ID for this item. [8e2e]e8INX; X += 4 (number of item image tiles). [8e2f]e8INX [8e30]e8INX [8e31]e8INX [8e32]20 58 8cJSR TextBox_DrawItemImage; Draw the image. [8e35]68PLA; Pop the loop counter. [8e36]aaTAX; X = A (restore it) [8e37]68PLA; Pop the remaining bits. [8e38]@_nextSpecialItem: [8e38]e6 eaINC TextBox_ContentsX; Advance the X position by 2 tiles. [8e3a]e6 eaINC TextBox_ContentsX [8e3c]e8INX; X++ (loop counter) [8e3d]e0 08CPX #$08; Is it 8? [8e3f]d0 e4BNE @_drawSpecialItemLoop; If not, loop.
; ; Draw the menu, freezing gameplay until dismissed. ;
[8e41]@_waitForInputLoop: [8e41]20 25 caJSR WaitForNextFrame; Wait for the next frame. [8e44]20 47 cbJSR Screen_ResetSpritesForGamePlay; Draw with screen state paused. [8e47]a5 19LDA Joy1_ChangedButtonMask; Load the changed button mask. [8e49]0aASL A; Shift the "A" button state into N. [8e4a]10 f5BPL @_waitForInputLoop; If not pressed/set, loop.
; ; Close the Status textbox. ;
[8e4c]a9 02LDA #$02 [8e4e]8d 08 02STA a:TextBox_X; Set the textbox X to 2. [8e51]a9 06LDA #$06 [8e53]8d 09 02STA a:TextBox_Y; Set the textbox Y to 6. [8e56]a9 1cLDA #$1c [8e58]8d 0a 02STA a:TextBox_Width; Set the textbox width to 28. [8e5b]a9 12LDA #$12 [8e5d]8d 0b 02STA a:TextBox_Height; Set the textbox height to 18. [8e60]4c 02 90JMP TextBox_Close; Close the textbox at those dimensions.
;============================================================================ ; Start locations within loaded drawn item tiles in the PPU. ; ; XREFS: ; PlayerMenu_ShowStatusMenu ;============================================================================
; ; XREFS: ; PlayerMenu_ShowStatusMenu ;
[8e63]SPECIAL_ITEM_TILE_START_IDS: [8e63]80.byte $80; [0]: [8e64]81.byte $81; [1]: [8e65]82.byte $82; [2]: [8e66]83.byte $83; [3]: [8e67]92.byte $92; [4]: [8e68]8a.byte $8a; [5]: [8e69]93.byte $93; [6]: [8e6a]94.byte $94; [7]:
;============================================================================ ; TODO: Document PlayerMenu_DrawStringLines ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; PlayerMenu_Show ; PlayerMenu_ShowStatusMenu ;============================================================================
[8e6b]PlayerMenu_DrawStringLines: [8e6b]ad 08 02LDA a:TextBox_X [8e6e]18CLC [8e6f]69 02ADC #$02 [8e71]85 eaSTA TextBox_ContentsX [8e73]ad 09 02LDA a:TextBox_Y [8e76]18CLC [8e77]69 02ADC #$02 [8e79]85 ebSTA TextBox_ContentsY [8e7b]20 04 f8JSR PPU_SetAddrForTextBoxPos [8e7e]a2 00LDX #$00 [8e80]@_drawLinesLoop: [8e80]8aTXA [8e81]48PHA [8e82]bd 20 02LDA a:DataArray,X [8e85]0aASL A [8e86]0aASL A [8e87]0aASL A [8e88]0aASL A [8e89]a8TAY [8e8a]20 9b 8eJSR UI_DrawString [8e8d]a9 40LDA #$40 [8e8f]20 28 f8JSR PPU_IncrementAddrBy [8e92]68PLA [8e93]aaTAX [8e94]e8INX [8e95]ec 1f 02CPX a:Arg_StringsCount [8e98]d0 e6BNE @_drawLinesLoop [8e9a]60RTS
;============================================================================ ; Draw a length-prefixed string to the PPU. ; ; This will draw a string stored in Temp_Int24. The ; first byte must be the length of the string, and the ; remaining are ASCII characters for the string. ; ; INPUTS: ; X: ; The PPU buffer offset to write to. ; ; Y: ; The starting offset into the loaded string buffer. ; ; Temp_Int24: ; The loaded address containing the string at the ; offset. ; ; OUTPUTS: ; PPUBuffer_WriteOffset: ; The new upper bounds of the PPU buffer. ; ; Temp_Int24: ; Clobbered. ; ; CALLS: ; Strings_ASCIIToIndex ; PPUBuffer_Set ; PPUBuffer_QueueCommandOrLength ; ; XREFS: ; PlayerMenu_DrawStringLines ; PlayerMenu_ShowStatusMenu ; PlayerMenu_ShowSubmenu ; TextBox_DrawItemName ;============================================================================
[8e9b]UI_DrawString:
; ; Load the length of the string and prepare to draw. ;
[8e9b]b1 ecLDA (Temp_Int24),Y; Load the length value from the loaded string. [8e9d]85 eeSTA Temp_Int24_U; Store it. [8e9f]c8INY; Y++ (character offset) [8ea0]20 dc cfJSR PPUBuffer_QueueCommandOrLength; Queue drawing up to the length.
; ; Begin drawing each character. ;
[8ea3]@_drawLoop: [8ea3]b1 ecLDA (Temp_Int24),Y; Load the next character. [8ea5]20 b3 8eJSR Strings_ASCIIToIndex; Conver the ASCII value to a tile index. [8ea8]c8INY; Y++ (character offset) [8ea9]20 45 f8JSR PPUBuffer_Set; Set that in the PPU buffer. [8eac]c6 eeDEC Temp_Int24_U; Decrement loop counter. [8eae]d0 f3BNE @_drawLoop; If we're not done, loop. [8eb0]86 20STX PPUBuffer_WriteOffset; Store the new PPU buffer upper bounds. [8eb2]60RTS
;============================================================================ ; Return an alphanumeric/symbol tile index from an ASCII value. ; ; INPUTS: ; A: ; The ASCII value to normalize. ; ; OUTPUTS: ; A: ; The normalized value. ; ; XREFS: ; UI_DrawString ;============================================================================
[8eb3]Strings_ASCIIToIndex: [8eb3]c9 20CMP #$20; Is this a space? [8eb5]f0 07BEQ @_isSpace; If so, jump. [8eb7]c9 41CMP #$41; Is this >= "A"? [8eb9]90 05BCC @_return; If not, return. [8ebb]e9 31SBC #$31; Convert to an index. [8ebd]60RTS [8ebe]@_isSpace: [8ebe]a9 00LDA #$00; Convert a space to an index of 0. [8ec0]@_return: [8ec0]60RTS
;============================================================================ ; TODO: Document IScriptAction_AddInventoryItem_ClearTextBox ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; IScriptAction_AddInventoryItem ;============================================================================
[8ec1]IScriptAction_AddInventoryItem_ClearTextBox: [8ec1]ae 08 02LDX a:TextBox_X [8ec4]e8INX [8ec5]86 eaSTX TextBox_ContentsX [8ec7]ae 09 02LDX a:TextBox_Y [8eca]e8INX [8ecb]86 ebSTX TextBox_ContentsY [8ecd]20 04 f8JSR PPU_SetAddrForTextBoxPos [8ed0]ae 0b 02LDX a:TextBox_Height [8ed3]@_clearLoop: [8ed3]8aTXA [8ed4]48PHA [8ed5]ad 0a 02LDA a:TextBox_Width [8ed8]a8TAY [8ed9]38SEC [8eda]e9 02SBC #$02 [8edc]20 dc cfJSR PPUBuffer_QueueCommandOrLength [8edf]a9 00LDA #$00 [8ee1]20 39 f8JSR TextBox_FillPPUBufferForTextWidth [8ee4]86 20STX PPUBuffer_WriteOffset [8ee6]20 26 f8JSR PPU_IncrementAddrBy32 [8ee9]68PLA [8eea]aaTAX [8eeb]caDEX [8eec]e0 02CPX #$02 [8eee]d0 e3BNE @_clearLoop [8ef0]60RTS
;============================================================================ ; TODO: Document TextBox_Open ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; IScripts_OpenForPortrait ; PlayerMenu_Show ; PlayerMenu_ShowStatusMenu ; PlayerMenu_ShowSubmenu ; Shop_Draw ; TextBox_OpenForNPC ;============================================================================
[8ef1]TextBox_Open:
; ; Draw the top row of the box's frame. ;
[8ef1]ad 08 02LDA a:TextBox_X [8ef4]85 eaSTA TextBox_ContentsX [8ef6]ad 09 02LDA a:TextBox_Y [8ef9]85 ebSTA TextBox_ContentsY [8efb]20 04 f8JSR PPU_SetAddrForTextBoxPos [8efe]20 32 f8JSR TextBox_QueuePPUBufferTextBoxLength [8f01]a9 01LDA #$01 [8f03]20 45 f8JSR PPUBuffer_Set [8f06]a9 02LDA #$02 [8f08]20 39 f8JSR TextBox_FillPPUBufferForTextWidth [8f0b]a9 03LDA #$03 [8f0d]20 45 f8JSR PPUBuffer_Set [8f10]86 20STX PPUBuffer_WriteOffset [8f12]20 26 f8JSR PPU_IncrementAddrBy32
; ; Draw the sides of the box's frame. ;
[8f15]ac 0b 02LDY a:TextBox_Height [8f18]@_drawFrameSides: [8f18]98TYA [8f19]48PHA [8f1a]20 32 f8JSR TextBox_QueuePPUBufferTextBoxLength [8f1d]a9 04LDA #$04 [8f1f]20 45 f8JSR PPUBuffer_Set [8f22]a9 00LDA #$00 [8f24]20 39 f8JSR TextBox_FillPPUBufferForTextWidth [8f27]a9 04LDA #$04 [8f29]20 45 f8JSR PPUBuffer_Set [8f2c]86 20STX PPUBuffer_WriteOffset [8f2e]20 26 f8JSR PPU_IncrementAddrBy32 [8f31]68PLA [8f32]a8TAY [8f33]88DEY [8f34]c0 02CPY #$02 [8f36]d0 e0BNE @_drawFrameSides
; ; Draw the bottom of the box's frame. ;
[8f38]20 32 f8JSR TextBox_QueuePPUBufferTextBoxLength [8f3b]a9 05LDA #$05 [8f3d]20 45 f8JSR PPUBuffer_Set [8f40]a9 02LDA #$02 [8f42]20 39 f8JSR TextBox_FillPPUBufferForTextWidth [8f45]a9 06LDA #$06 [8f47]20 45 f8JSR PPUBuffer_Set [8f4a]86 20STX PPUBuffer_WriteOffset [8f4c]a9 00LDA #$00
; ; Set state on the box and fill in the background. ;
[8f4e]8d 0c 02STA a:TextBox_Closed
; ; v-- Fall through --v ;
;============================================================================ ; TODO: Document TextBox_FillBackground ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; TextBox_Close ;============================================================================
[8f51]TextBox_FillBackground: [8f51]ad 08 02LDA a:TextBox_X [8f54]4aLSR A [8f55]85 eaSTA TextBox_ContentsX [8f57]ad 09 02LDA a:TextBox_Y [8f5a]4aLSR A [8f5b]85 ebSTA TextBox_ContentsY [8f5d]ac 0b 02LDY a:TextBox_Height [8f60]@_fillYLoop: [8f60]98TYA [8f61]48PHA [8f62]a5 eaLDA TextBox_ContentsX [8f64]48PHA [8f65]ac 0a 02LDY a:TextBox_Width [8f68]@_fillXLoop: [8f68]20 f6 8fJSR TextBox_GetBackgroundAttributeData [8f6b]20 0e 88JSR TextBox_SetNextAttributeData [8f6e]e6 eaINC TextBox_ContentsX [8f70]88DEY [8f71]88DEY [8f72]d0 f4BNE @_fillXLoop [8f74]68PLA [8f75]85 eaSTA TextBox_ContentsX [8f77]e6 ebINC TextBox_ContentsY [8f79]68PLA [8f7a]a8TAY [8f7b]88DEY [8f7c]88DEY [8f7d]d0 e1BNE @_fillYLoop [8f7f]ad 08 02LDA a:TextBox_X [8f82]4aLSR A [8f83]85 eaSTA TextBox_ContentsX [8f85]ad 09 02LDA a:TextBox_Y [8f88]4aLSR A [8f89]85 ebSTA TextBox_ContentsY [8f8b]20 fe 87JSR TextBox_GetNextAttributeDataOffset [8f8e]a8TAY [8f8f]29 3fAND #$3f [8f91]09 c0ORA #$c0 [8f93]85 e8STA PPU_TargetAddr [8f95]a5 0dLDA PPU_ScrollScreen [8f97]29 01AND #$01 [8f99]0aASL A [8f9a]0aASL A [8f9b]09 23ORA #$23 [8f9d]85 e9STA PPU_TargetAddr_U [8f9f]ad 08 02LDA a:TextBox_X [8fa2]4aLSR A [8fa3]4aLSR A [8fa4]85 eaSTA TextBox_ContentsX [8fa6]ad 08 02LDA a:TextBox_X [8fa9]18CLC [8faa]6d 0a 02ADC a:TextBox_Width [8fad]38SEC [8fae]e9 01SBC #$01 [8fb0]4aLSR A [8fb1]4aLSR A [8fb2]38SEC [8fb3]e5 eaSBC TextBox_ContentsX [8fb5]85 eaSTA TextBox_ContentsX [8fb7]e6 eaINC TextBox_ContentsX [8fb9]ad 09 02LDA a:TextBox_Y [8fbc]4aLSR A [8fbd]4aLSR A [8fbe]85 ebSTA TextBox_ContentsY [8fc0]ad 09 02LDA a:TextBox_Y [8fc3]18CLC [8fc4]6d 0b 02ADC a:TextBox_Height [8fc7]38SEC [8fc8]e9 01SBC #$01 [8fca]4aLSR A [8fcb]4aLSR A [8fcc]38SEC [8fcd]e5 ebSBC TextBox_ContentsY [8fcf]85 ebSTA TextBox_ContentsY [8fd1]e6 ebINC TextBox_ContentsY
; ; Loop through all the rows of text. ;
[8fd3]@_drawRowsLoop: [8fd3]98TYA [8fd4]48PHA [8fd5]a5 eaLDA TextBox_ContentsX [8fd7]85 ecSTA Temp_Int24 [8fd9]20 dc cfJSR PPUBuffer_QueueCommandOrLength
; ; Loop through all the columns of text. ;
[8fdc]@_drawColsLoop: [8fdc]b9 42 02LDA a:TextBox_AttributeData,Y [8fdf]c8INY [8fe0]20 45 f8JSR PPUBuffer_Set [8fe3]c6 ecDEC Temp_Int24 [8fe5]d0 f5BNE @_drawColsLoop [8fe7]86 20STX PPUBuffer_WriteOffset [8fe9]20 22 f8JSR PPU_IncrementAddrBy8 [8fec]68PLA [8fed]18CLC [8fee]69 08ADC #$08 [8ff0]a8TAY [8ff1]c6 ebDEC TextBox_ContentsY [8ff3]d0 deBNE @_drawRowsLoop [8ff5]60RTS
;============================================================================ ; Return the background PPU attribute data for the textbox at an offset. ; ; If the textbox is closed, this will use the tile behind ; the textbox. ; ; If the textbox is open, it will use the HUD background. ; ; INPUTS: ; Y: ; The offset into the screen. ; ; UI_AttributeDataIndex: ; The attribute data for the HUD/textbox background. ; ; TextBox_Closed: ; Whether the textbox is closed. ; ; OUTPUTS: ; A: ; The attribute data to draw at the offset. ; ; CALLS: ; TextBox_GetBackingAttributeData ; ; XREFS: ; TextBox_FillBackground ;============================================================================
[8ff6]TextBox_GetBackgroundAttributeData: [8ff6]ad 0c 02LDA a:TextBox_Closed; Is the textbox open or closed? [8ff9]f0 03BEQ @_isOpen; If open, jump.
; ; The textbox is closed. Return the attribute of the background ; area behind it. ;
[8ffb]4c 91 f7JMP TextBox_GetBackingAttributeData; Return the attribute data behind the textbox.
; ; The textbox is open. Return the attribute for the textbox ; background color. ;
[8ffe]@_isOpen: [8ffe]ad 8d 03LDA a:UI_AttributeDataIndex; Return the attribute data for the background of the textbox. [9001]60RTS
;============================================================================ ; TODO: Document TextBox_Close ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; DEADCODE_TextBox_ClosePortrait ; IScriptAction_ShowSellMenu ; IScripts_CloseCurrentTextBox ; Maybe_Shop_DrawTextBox ; PlayerMenu_Close ; PlayerMenu_Show ; PlayerMenu_ShowStatusMenu ; TextBox_ClearForPortraitAndText ;============================================================================
[9002]TextBox_Close: [9002]a9 01LDA #$01 [9004]8d 0c 02STA a:TextBox_Closed [9007]20 51 8fJSR TextBox_FillBackground [900a]ad 08 02LDA a:TextBox_X [900d]85 eaSTA TextBox_ContentsX [900f]ad 09 02LDA a:TextBox_Y [9012]85 ebSTA TextBox_ContentsY [9014]20 04 f8JSR PPU_SetAddrForTextBoxPos [9017]ac 0b 02LDY a:TextBox_Height [901a]@_closeYLoop: [901a]98TYA [901b]48PHA [901c]a5 eaLDA TextBox_ContentsX [901e]48PHA [901f]ad 0a 02LDA a:TextBox_Width [9022]a8TAY [9023]20 dc cfJSR PPUBuffer_QueueCommandOrLength [9026]@_closeXLoop: [9026]20 b7 f7JSR Textbox_Maybe_GetAreaBehindTextbox [9029]20 45 f8JSR PPUBuffer_Set [902c]e6 eaINC TextBox_ContentsX [902e]88DEY [902f]d0 f5BNE @_closeXLoop [9031]86 20STX PPUBuffer_WriteOffset [9033]68PLA [9034]85 eaSTA TextBox_ContentsX [9036]68PLA [9037]a8TAY [9038]e6 ebINC TextBox_ContentsY [903a]20 26 f8JSR PPU_IncrementAddrBy32 [903d]88DEY [903e]d0 daBNE @_closeYLoop [9040]60RTS
;============================================================================ ; DEADCODE ;============================================================================
[9041]DEADCODE_FUN_PRG12__9041: [9041]a9 05LDA #$05 [9043]85 eaSTA TextBox_ContentsX [9045]20 dc cfJSR PPUBuffer_QueueCommandOrLength [9048]@LAB_PRG12__9048: [9048]b9 42 02LDA a:TextBox_AttributeData,Y [904b]c8INY [904c]20 45 f8JSR PPUBuffer_Set [904f]c6 eaDEC TextBox_ContentsX [9051]d0 f5BNE @LAB_PRG12__9048 [9053]86 20STX PPUBuffer_WriteOffset [9055]60RTS
;============================================================================ ; TODO: Document Menu_UpdateAndDraw ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; IScriptAction_ShowBuySellMenu ; IScripts_WaitForMenuInput ; PlayerMenu_HandleInventoryMenuInput ; PlayerMenu_Show ;============================================================================
[9056]Menu_UpdateAndDraw: [9056]a5 19LDA Joy1_ChangedButtonMask; A = changed button mask. [9058]29 08AND #$08; Is Up pressed? [905a]d0 36BNE @_handleCursorUp; If so, jump.
; ; Up was not pressed. Check Down. ;
[905c]a5 19LDA Joy1_ChangedButtonMask; A = changed button mask. [905e]29 04AND #$04; Is Down pressed? [9060]f0 13BEQ @_showSelectionCursor; If so, jump.
; ; Neither Up nor Down was pressed. ;
[9062]ae 1e 02LDX a:Menu_CursorPos; X = Menu cursor position. [9065]e8INX; X++ [9066]ec 1f 02CPX a:Arg_StringsCount; Compare to the last available position. [9069]d0 02BNE @_moveCursor; If it changed, jump. [906b]a2 00LDX #$00; Move to the first item. [906d]@_moveCursor: [906d]8e 1e 02STX a:Menu_CursorPos; Set the new cursor position. [9070]a9 0bLDA #$0b; 0xB = Cursor movement sound effect. [9072]20 e4 d0JSR Sound_PlayEffect; Play the sound effect.
; ; Draw the selection cursor for a shop. ; ; This will draw the selection cursor, pointing to the Buy/Sell ; item or the item in a shop. ; ; First, compute the X position of the cursor. ;
[9075]@_showSelectionCursor: [9075]20 f0 87JSR TextBox_GetXPixelCoord; Get the X pixel position of the textbox. [9078]69 08ADC #$08; Add 8 (offset). [907a]aaTAX; X = result.
; ; Compute the Y position of the cursor. ; ; This will be: ; ; TextBox_Y_Pixels + (16 * CursorPos) - 32. ;
[907b]20 f7 87JSR TextBox_GetYPixelCoord; Get the Y pixel position of the textbox. [907e]69 10ADC #$10; Add 16. [9080]85 ecSTA Temp_Int24; Store it temporarily. [9082]ad 1e 02LDA a:Menu_CursorPos; A = cursor position. [9085]20 8c f7JSR Math_MultiplyBy16; A = A * 16 (2 tile height) [9088]65 ecADC Temp_Int24; A = A + our Y value. [908a]e9 20SBC #$20; A = A - 32 (padding and nudging up a tile). [908c]a8TAY; Y = result.
; ; Draw the selection symbol. ;
[908d]a9 adLDA #$ad; A = 0xAD (right arrow symbol). [908f]4c a7 fcJMP UI_DrawPromptInputSymbol; Draw the symbol.
; ; The player pressed the Up button on the controller. ; Move the cursor up. ;
[9092]@_handleCursorUp: [9092]ae 1e 02LDX a:Menu_CursorPos; X = Menu cursor position.
; ; Set up a loop to move the cursor to a viable spot. ; ; Note that we have two possibilities here, based on ; Arg_StringsCount: ; ; 1. It has a non-0 value, in which case we stay in this ; cursor loop and handle cursor movement. ; ; This is the case with textbox menus and shops. ; ; 2. It has a 0 value, in which case we're going to fall ; through to more advanced input. ; ; This is only used in the password screen. ;
[9095]@_cursorLoop: [9095]caDEX; X-- [9096]10 d5BPL @_moveCursor; If < 0, jump. [9098]ae 1f 02LDX a:Arg_StringsCount; X = Last available position. [909b]10 f8BPL @_cursorLoop; If < 0, loop. Else, fall through (only for the password screen).
; ; v-- Fall through --v ;
;============================================================================ ; TODO: Document PasswordScreen_Show ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ;============================================================================
[909d]PasswordScreen_Show: [909d]20 f7 caJSR PPU_WaitUntilFlushed [90a0]a9 10LDA #$10 [90a2]8d 06 20STA a:PPUADDR [90a5]a9 00LDA #$00 [90a7]8d 06 20STA a:PPUADDR [90aa]a0 10LDY #$10 [90ac]20 b2 fcJSR PPU_FillData [90af]20 a5 f3JSR PPU_LoadGlyphsForStrings [90b2]a0 1fLDY #$1f [90b4]@LAB_PRG12__90b4: [90b4]b9 04 92LDA a:PASSWORD_SCREEN_PALETTE,Y [90b7]99 93 02STA a:Screen_PaletteData_Tiles,Y [90ba]88DEY [90bb]10 f7BPL @LAB_PRG12__90b4 [90bd]20 90 d0JSR PPUBuffer_WritePalette [90c0]20 b9 fcJSR PPU_ClearAllTilemaps
; ; Set the position to the first character of the first row of ; the password screen. This starts at $2128. ; ; Then draw the field (16 characters). ;
[90c3]a9 21LDA #$21 [90c5]8d 06 20STA a:PPUADDR [90c8]a9 28LDA #$28 [90ca]8d 06 20STA a:PPUADDR [90cd]a9 5fLDA #$5f [90cf]a0 10LDY #$10 [90d1]20 b2 fcJSR PPU_FillData
; ; Now do the same for the second row of the password input at ; $2148. ;
[90d4]a9 21LDA #$21 [90d6]8d 06 20STA a:PPUADDR [90d9]a9 48LDA #$48 [90db]8d 06 20STA a:PPUADDR [90de]a9 5fLDA #$5f [90e0]a0 10LDY #$10 [90e2]20 b2 fcJSR PPU_FillData
; ; Begin drawing all the available password characters. ;
[90e5]a0 00LDY #$00
; ; Set the cursor position for the start of the row of ; available password characters based on the first two ; bytes of the current offset into INPUT_CHARS. ;
[90e7]@_startRow: [90e7]b9 24 92LDA a:INPUT_CHARS,Y [90ea]8d 06 20STA a:PPUADDR [90ed]c8INY [90ee]b9 24 92LDA a:INPUT_CHARS,Y [90f1]8d 06 20STA a:PPUADDR [90f4]c8INY
; ; Every row has 25 characters (this includes spaces between ; visible characters). Loop through each character draw it ; on the current row. ;
[90f5]a2 19LDX #$19 [90f7]@_writePasswordCharsLoop: [90f7]b9 24 92LDA a:INPUT_CHARS,Y [90fa]8d 07 20STA a:PPUDATA [90fd]c8INY [90fe]caDEX [90ff]d0 f6BNE @_writePasswordCharsLoop [9101]c0 a2CPY #$a2 [9103]d0 e2BNE @_startRow
; ; Begin writing the top row: "Enter your mantra." ; This starts at PPU position $20A5. ; ; The string is at STRING_ENTER_YOUR_MANTRA. ;
[9105]a9 20LDA #$20 [9107]8d 06 20STA a:PPUADDR [910a]a9 a5LDA #$a5 [910c]8d 06 20STA a:PPUADDR [910f]a9 ecLDA #<STRING_ENTER_YOUR_MANTRA [9111]85 ecSTA Temp_Int24 [9113]a9 91LDA #>STRING_ENTER_YOUR_MANTRA [9115]85 edSTA Temp_Int24_M [9117]20 0e 9eJSR UI_DrawText
; ; Set the initial password to 32 characters of empty (0xFF). ; ; This is in Password_EnteredChars. ;
[911a]a9 20LDA #$20 [911c]8d 65 06STA a:Password_MaxChars [911f]aaTAX [9120]caDEX [9121]a9 ffLDA #$ff [9123]@LAB_PRG12__9123: [9123]9d 00 06STA a:ScreenBuffer,X [9126]caDEX [9127]10 faBPL @LAB_PRG12__9123 [9129]a9 00LDA #$00 [912b]8d 66 06STA a:Password_EnteredCharsLength [912e]8d 64 06STA a:Password_FieldCursorPos [9131]8d 62 06STA a:Password_CursorCol [9134]8d 63 06STA a:Password_CursorRow [9137]8d c2 04STA a:Password_DPadBits [913a]8d c3 04STA a:Password_CounterBeforeAutoRepeatMove
; ; Handle password input. ;
[913d]20 27 cbJSR Screen_ResetForNonGame
; ; v-- Fall through --v ;
;============================================================================ ; TODO: Document PasswordScreen_WaitForInput ; ; INPUTS: ; X ; ; OUTPUTS: ; TODO ; ; XREFS: ; PasswordScreen_9175 ; PasswordScreen_HandleInput ; PasswordScreen_HandleWrongPasswordAndWaitForInput ; PasswordScreen_WaitForInput ;============================================================================
[9140]PasswordScreen_WaitForInput: [9140]20 25 caJSR WaitForNextFrame [9143]20 4f cbJSR Screen_ResetSpritesForNonGame [9146]20 05 94JSR PasswordScreen_DrawAndHandleInputLoop [9149]90 f5BCC PasswordScreen_WaitForInput [914b]c9 83CMP #$83 [914d]d0 2cBNE PasswordScreen_HandleInput
; ; This is the END code. ;
[914f]ad 66 06LDA a:Password_EnteredCharsLength [9152]f0 21BEQ PasswordScreen_9175 [9154]20 50 98JSR Password_Maybe_CheckPasswordLength [9157]b0 06BCS PasswordScreen_HandleWrongPasswordAndWaitForInput [9159]20 e9 95JSR Password_Load [915c]b0 01BCS PasswordScreen_HandleWrongPasswordAndWaitForInput [915e]60RTS
;============================================================================ ; TODO: Document PasswordScreen_HandleWrongPasswordAndWaitForInput ; ; INPUTS: ; X ; ; OUTPUTS: ; TODO ; ; XREFS: ; PasswordScreen_WaitForInput ;============================================================================
[915f]PasswordScreen_HandleWrongPasswordAndWaitForInput: [915f]20 41 93JSR Sound_PlayInputSound [9162]@_handleWrongPassword: [9162]20 25 caJSR WaitForNextFrame [9165]20 4f cbJSR Screen_ResetSpritesForNonGame [9168]20 85 91JSR PasswordScreen_WriteWrongPassword [916b]a5 19LDA Joy1_ChangedButtonMask [916d]10 f3BPL @_handleWrongPassword [916f]20 81 91JSR PasswordScreen_WriteEnterYourMantra [9172]4c 40 91JMP PasswordScreen_WaitForInput
;============================================================================ ; TODO: Document PasswordScreen_9175 ; ; INPUTS: ; X ; ; OUTPUTS: ; TODO ; ; XREFS: ; PasswordScreen_WaitForInput ;============================================================================
[9175]PasswordScreen_9175: [9175]20 41 93JSR Sound_PlayInputSound; Play the character input sound. [9178]4c 40 91JMP PasswordScreen_WaitForInput; Wait for input.
;============================================================================ ; TODO: Document PasswordScreen_HandleInput ; ; INPUTS: ; A ; X ; ; OUTPUTS: ; TODO ; ; XREFS: ; PasswordScreen_WaitForInput ;============================================================================
[917b]PasswordScreen_HandleInput: [917b]20 12 93JSR PasswordScreen_HandleInputChar; Handle the character. [917e]4c 40 91JMP PasswordScreen_WaitForInput; Wait again for input.
;============================================================================ ; Write the "Enter your mantra" message. ; ; INPUTS: ; X: ; Destination offset into the PPU buffer. ; ; InterruptCounter: ; The game interrupt counter. ; ; PASSWORD_MESSAGE_STRINGS_U: ; PASSWORD_MESSAGE_STRINGS_U: ; The lookup table of message strings. ; ; OUTPUTS: ; PPUBuffer_WriteOffset: ; New upper bounds of the PPU buffer. ; ; PPU_TargetAddr: ; PPU_TargetAddr+1: ; Temp_Int24: ; Temp_Int24+1: ; Clobbered. ; ; CALLS: ; PPUBuffer_QueueCommandOrLength ; PPUBuffer_WriteFromTemp ; ; XREFS: ; PasswordScreen_HandleWrongPasswordAndWaitForInput ;============================================================================
[9181]PasswordScreen_WriteEnterYourMantra: [9181]a0 02LDY #$02; 2 = "Enter your mantra" [9183]d0 10BNE PasswordScreen_DrawMessage; Draw it.
; ; X-- We should never fall through here --X ;
;============================================================================ ; Write the message stating that the password was wrong. ; ; This will display in a blinking form, alternating between ; empty spaces and the message. ; ; INPUTS: ; X: ; Destination offset into the PPU buffer. ; ; InterruptCounter: ; The game interrupt counter. ; ; PASSWORD_MESSAGE_STRINGS_U: ; PASSWORD_MESSAGE_STRINGS_U: ; The lookup table of message strings. ; ; OUTPUTS: ; PPU_TargetAddr: ; PPU_TargetAddr+1: ; Temp_Int24: ; Temp_Int24+1: ; Clobbered. ; ; CALLS: ; PPUBuffer_QueueCommandOrLength ; PPUBuffer_WriteFromTemp ; ; XREFS: ; PasswordScreen_HandleWrongPasswordAndWaitForInput ;============================================================================
[9185]PasswordScreen_WriteWrongPassword: [9185]a5 1aLDA InterruptCounter; Load the interrupt counter. [9187]29 1fAND #$1f; Check if we're on an animation frame. [9189]d0 2cBNE RETURN_91B7; If not, return.
; ; Calculate the string index based on the frame. ;
[918b]a5 1aLDA InterruptCounter; Load the interrupt counter again. [918d]4aLSR A; Compute a message index based on the interval. [918e]4aLSR A [918f]4aLSR A [9190]4aLSR A [9191]4aLSR A [9192]29 01AND #$01 [9194]a8TAY; Y = message string index
; ; v-- Fall through --v ;
;============================================================================ ; Draw a message on the password screen. ; ; INPUTS: ; Y: ; The message ID. This is one of: ; ; 0 = "Mantra is in the wrong" ; 1 = Blank spaces (to blink a message) ; 2 = " Enter your mantra. " ; ; PASSWORD_MESSAGE_STRINGS_L: ; PASSWORD_MESSAGE_STRINGS_U: ; The available message strings table. ; ; OUTPUTS: ; PPUBuffer_WriteOffset: ; The new write offset for the PPU buffer. ; ; PPU_TargetAddr: ; PPU_TargetAddr+1: ; Clobbered. ; ; CALLS: ; PPUBuffer_QueueCommandOrLength ; PPUBuffer_WriteFromTemp ; ; XREFS: ; PasswordScreen_WriteEnterYourMantra ;============================================================================
[9195]PasswordScreen_DrawMessage:
; ; Load the message string. ;
[9195]b9 b8 91LDA a:PASSWORD_MESSAGE_STRINGS_L,Y; Load the lower byte of the string address. [9198]85 ecSTA Temp_Int24; Store that. [919a]b9 bb 91LDA a:PASSWORD_MESSAGE_STRINGS_U,Y; Load the upper byte of the string address. [919d]85 edSTA Temp_Int24_M; Store that.
; ; Set the PPU tile address to 0x20A5. ;
[919f]a9 20LDA #$20 [91a1]85 e9STA PPU_TargetAddr_U; Upper byte = 0x20 [91a3]a9 a5LDA #$a5 [91a5]85 e8STA PPU_TargetAddr; Lower byte = 0xA5
; ; Queue up a string of 23 characters. ;
[91a7]a9 17LDA #$17 [91a9]20 dc cfJSR PPUBuffer_QueueCommandOrLength; Queue 23 characters to draw.
; ; Begin the draw loop. ;
[91ac]a0 00LDY #$00; Y = 0 (loop counter) [91ae]@LAB_PRG12__91ae: [91ae]20 42 f8JSR PPUBuffer_WriteFromTemp; Put the next character from our loaded string into the PPU buffer. [91b1]c0 17CPY #$17; Have we written 23 characters? [91b3]d0 f9BNE @LAB_PRG12__91ae; If not, loop. [91b5]86 20STX PPUBuffer_WriteOffset; Store the new upper bounds of the PPU buffer.
; ; XREFS: ; PasswordScreen_WriteWrongPassword ;
[91b7]RETURN_91B7: [91b7]60RTS
;============================================================================ ; Lookup table for password screen strings. ; ; XREFS: ; PasswordScreen_DrawMessage ;============================================================================
; ; XREFS: ; PasswordScreen_DrawMessage ;
[91b8]PASSWORD_MESSAGE_STRINGS_L: [91b8]be.byte <STRING_MANTRA_IN_THE_WRONG; [0]: [0]: [91b9]d5.byte <STRING_PASSWORD_SPACES; [0]: [1]: [91ba]ec.byte <STRING_ENTER_YOUR_MANTRA; [0]: [2]:
; ; XREFS: ; PasswordScreen_DrawMessage ;
[91bb]PASSWORD_MESSAGE_STRINGS_U: [91bb]91.byte >STRING_MANTRA_IN_THE_WRONG; [0]: [91bc]91.byte >STRING_PASSWORD_SPACES; [1]: [91bd]91.byte >STRING_ENTER_YOUR_MANTRA; [2]:
;============================================================================ ; String: "Mantra is in the wrong." ; ; This is used whenever an incorrect password was entered. ; ; XREFS: ; PASSWORD_MESSAGE_STRINGS_L [$PRG12::91b8] ; PASSWORD_MESSAGE_STRINGS_U [$PRG12::91bb] ;============================================================================
; ; XREFS: ; PASSWORD_MESSAGE_STRINGS_L [$PRG12::91b8] ; PASSWORD_MESSAGE_STRINGS_U [$PRG12::91bb] ;
[91be]STRING_MANTRA_IN_THE_WRONG: [91be]4d 61 6e 74 72 61 20 69.byte "Mantra i"; char [91c6]73 20 69 6e 20 74 68 65.byte "s in the"; char [91ce]20 77 72 6f 6e 67 2e.byte " wrong."; char
;============================================================================ ; String: Empty spaces ; ; This is part of the blink animation for the invalid password text. ; ; XREFS: ; PASSWORD_MESSAGE_STRINGS_L [$PRG12::91b9] ; PASSWORD_MESSAGE_STRINGS_U [$PRG12::91bc] ;============================================================================
; ; XREFS: ; PASSWORD_MESSAGE_STRINGS_L [$PRG12::91b9] ; PASSWORD_MESSAGE_STRINGS_U [$PRG12::91bc] ;
[91d5]STRING_PASSWORD_SPACES: [91d5]20 20 20 20 20 20 20 20.byte " "; char [91dd]20 20 20 20 20 20 20 20.byte " "; char [91e5]20 20 20 20 20 20 20.byte " "; char
;============================================================================ ; String: "Enter your mantra." ; ; This is shown at the top of the password screen. ; ; XREFS: ; PASSWORD_MESSAGE_STRINGS_L [$PRG12::91ba] ; PASSWORD_MESSAGE_STRINGS_U [$PRG12::91bd] ;============================================================================
; ; XREFS: ; PASSWORD_MESSAGE_STRINGS_L [$PRG12::91ba] ; PASSWORD_MESSAGE_STRINGS_U [$PRG12::91bd] ;
[91ec]STRING_ENTER_YOUR_MANTRA: [91ec]20 20 45 6e 74 65 72 20.byte " Enter "; char [91f4]79 6f 75 72 20 6d 61 6e.byte "your man"; char [91fc]74 72 61 2e 20 20 20 00.byte "tra. ",$00; char
;============================================================================ ; Palette data for the password screen. ; ; XREFS: ; PasswordScreen_Show ;============================================================================
; ; XREFS: ; PasswordScreen_Show ;
[9204]PASSWORD_SCREEN_PALETTE: [9204]0f.byte $0f; [0]: [9205]00.byte $00; [1]: [9206]10.byte $10; [2]: [9207]20.byte $20; [3]: [9208]0f.byte $0f; [4]: [9209]00.byte $00; [5]: [920a]10.byte $10; [6]: [920b]20.byte $20; [7]: [920c]0f.byte $0f; [8]: [920d]00.byte $00; [9]: [920e]10.byte $10; [10]: [920f]20.byte $20; [11]: [9210]0f.byte $0f; [12]: [9211]0f.byte $0f; [13]: [9212]0f.byte $0f; [14]: [9213]0f.byte $0f; [15]: [9214]0f.byte $0f; [16]: [9215]0f.byte $0f; [17]: [9216]27.byte $27; [18]: [9217]30.byte $30; [19]: [9218]0f.byte $0f; [20]: [9219]06.byte $06; [21]: [921a]16.byte $16; [22]: [921b]26.byte $26; [23]: [921c]0f.byte $0f; [24]: [921d]06.byte $06; [25]: [921e]16.byte $16; [26]: [921f]26.byte $26; [27]: [9220]0f.byte $0f; [28]: [9221]0f.byte $0f; [29]: [9222]0f.byte $0f; [30]: [9223]0f.byte $0f; [31]:
;============================================================================ ; Available list of input characters for the password screen, broken down by ; row. ; ; XREFS: ; PasswordScreen_Show ;============================================================================
; ; XREFS: ; PasswordScreen_Show ;
[9224]INPUT_CHARS: [9224]21.byte $21; [0]: [0]: [9225]c4.byte $c4; [0]: [1]: [9226]41.byte "A"; char
; ; XREFS: ; PasswordScreen_Show ;
[9227]INPUT_CHARS_chars_1_: [9227]20 42 20 43 20 44 20 45.byte " B C D E"; char [922f]20 46 20 47 20 48 20 49.byte " F G H I"; char [9237]20 4a 20 4b 20 4c 20 4d.byte " J K L M"; char [923f]22.byte $22; [1]: [0]: [9240]04.byte $04; [1]: [1]: [9241]4e 20 4f 20 50 20 51 20.byte "N O P Q "; char [9249]52 20 53 20 54 20 55 20.byte "R S T U "; char [9251]56 20 57 20 58 20 59 20.byte "V W X Y "; char [9259]5a.byte "Z"; char [925a]22.byte $22; [2]: [0]: [925b]44.byte $44; [2]: [1]: [925c]61 20 62 20 63 20 64 20.byte "a b c d "; char [9264]65 20 66 20 67 20 68 20.byte "e f g h "; char [926c]69 20 6a 20 6b 20 6c 20.byte "i j k l "; char [9274]6d.byte "m"; char [9275]22.byte $22; [3]: [0]: [9276]84.byte $84; [3]: [1]: [9277]6e 20 6f 20 70 20 71 20.byte "n o p q "; char [927f]72 20 73 20 74 20 75 20.byte "r s t u "; char [9287]76 20 77 20 78 20 79 20.byte "v w x y "; char [928f]7a.byte "z"; char [9290]22.byte $22; [4]: [0]: [9291]c4.byte $c4; [4]: [1]: [9292]30 20 31 20 32 20 33 20.byte "0 1 2 3 "; char [929a]34 20 35 20 36 20 37 20.byte "4 5 6 7 "; char [92a2]38 20 39 20 2c 20 3f 20.byte "8 9 , ? "; char [92aa]20.byte " "; char [92ab]23.byte $23; [5]: [0]: [92ac]04.byte $04; [5]: [1]: [92ad]7b 7c 7d 20 7e 7c 7f 20.byte "{|} ~|",$7f," "; char [92b5]44 45 4c 20 45 4e 44 20.byte "DEL END "; char [92bd]20 20 20 20 20 20 20 20.byte " "; char [92c5]20.byte " "; char
;============================================================================ ; PPU tile positions for each input character cursor position. ; ; XREFS: ; PasswordScreen_WriteCharTile ;============================================================================
; ; XREFS: ; PasswordScreen_WriteCharTile ;
[92c6]PASSWORD_CURSOR_START_PPU_ADDRS_L: [92c6]28.byte $28; [0]: [92c7]48.byte $48; [1]:
; ; XREFS: ; PasswordScreen_WriteCharTile ;
[92c8]PASSWORD_CURSOR_START_PPU_ADDRS_U: [92c8]21.byte $21; [0]: [92c9]21.byte $21; [1]:
;============================================================================ ; TODO: Document PasswordScreen_DrawPasswordFieldCursor ; ; INPUTS: ; X ; ; OUTPUTS: ; TODO ; ; XREFS: ; PasswordScreen_DrawAndHandleInputLoop ;============================================================================
[92ca]PasswordScreen_DrawPasswordFieldCursor:
; ; Only proceed if the interrupt counter's lower nibble is set. ;
[92ca]a5 1aLDA InterruptCounter; Load the interrupt counter. [92cc]29 0fAND #$0f; Keep the lower nibble. [92ce]d0 41BNE RETURN_9311; If > 0, return.
; ; Check whether to draw the character or the cursor. ;
[92d0]a5 1aLDA InterruptCounter; Load the interrupt counter. [92d2]29 10AND #$10; Is bit 5 set? [92d4]f0 05BEQ PasswordScreen_DrawAtCursorPosition; If set, jump to write the character.
; ; Draw the cursor. ;
[92d6]a9 60LDA #$60; 0x60 == Solid block (cursor) [92d8]4c ed 92JMP PasswordScreen_WriteCharTile; Draw it.
;============================================================================ ; Draw the character at the current cursor position. ; ; If the cursor's on a position without an inputted ; character, a "_" will be drawn instead. ; ; This jumps/falls through to ; PasswordScreen_WriteCharTile. ; ; INPUTS: ; Password_FieldCursorPos: ; The cursor position. ; ; ScreenBuffer: ; The entered characters buffer. ; ; PASSWORD_ENTERED_CHARS: ; The lookup table of character codes to display tiles. ; ; OUTPUTS: ; See fall-through. ; ; CALLS: ; PasswordScreen_WriteCharTile ; ; XREFS: ; PasswordScreen_DrawPasswordFieldCursor ; PasswordScreen_HandleDeleteAtCursor ; PasswordScreen_HandleDeleteLastChar ; PasswordScreen_HandleInputChar ; PasswordScreen_HandleMoveCursorLeft ; PasswordScreen_HandleMoveCursorRight ;============================================================================
[92db]PasswordScreen_DrawAtCursorPosition:
; ; Check the character at the cursor position. ;
[92db]ae 64 06LDX a:Password_FieldCursorPos; X = Cursor position. [92de]bd 00 06LDA a:ScreenBuffer,X; A = Character at that position. [92e1]c9 ffCMP #$ff; Is it 0xFF (unset)? [92e3]f0 06BEQ @_writeBlankChar; If not, jump.
; ; There's no character at this position. ;
[92e5]aaTAX; X = A (character offset) [92e6]bd 64 87LDA a:PASSWORD_ENTERED_CHARS,X; Get the character value for that offset. [92e9]10 02BPL PasswordScreen_WriteCharTile; Write it. [92eb]@_writeBlankChar: [92eb]a9 5fLDA #$5f; 0x5F == "_" (blank) character
; ; v-- Fall through --v ;
;============================================================================ ; Write the tile for the given character to the PPU buffer. ; ; INPUTS: ; A: ; The index of the character in the password tiles ; table. ; ; Password_FieldCursorPos: ; The 0-based index of the cursor in the password ; field. ; ; PASSWORD_CURSOR_START_PPU_ADDRS_U: ; PASSWORD_CURSOR_START_PPU_ADDRS_L: ; The address lookup tables for the character tiles. ; ; OUTPUTS: ; PPUBuffer_WriteOffset: ; The updated write offset for the PPU buffer. ; ; PPU_TargetAddr: ; PPU_TargetAddr+1: ; Clobbered. ; ; CALLS: ; PPUBuffer_QueueCommandOrLength ; PPUBuffer_Set ; ; XREFS: ; PasswordScreen_DrawAtCursorPosition ; PasswordScreen_DrawPasswordFieldCursor ;============================================================================
[92ed]PasswordScreen_WriteCharTile: [92ed]48PHA; Push the tile value to the stack.
; ; Determine the index to draw to for the cursor position. ;
[92ee]ad 64 06LDA a:Password_FieldCursorPos; Load the cursor position in the password field. [92f1]4aLSR A; Divide by 16. [92f2]4aLSR A [92f3]4aLSR A [92f4]4aLSR A
; ; Look up the PPU address for that index. ;
[92f5]a8TAY; Y = A [92f6]b9 c8 92LDA a:PASSWORD_CURSOR_START_PPU_ADDRS_U,Y; A = Upper byte of the PPU address for this position. [92f9]85 e9STA PPU_TargetAddr_U; Store it. [92fb]ad 64 06LDA a:Password_FieldCursorPos; Load the cursor position again. [92fe]29 0fAND #$0f; Keep the lower nibble. [9300]18CLC [9301]79 c6 92ADC a:PASSWORD_CURSOR_START_PPU_ADDRS_L,Y; Add the lower byte of the PPU address. [9304]85 e8STA PPU_TargetAddr; Store as the target address to write to.
; ; Write to the PPU buffer. ;
[9306]a9 01LDA #$01; A = 1 (write length) [9308]20 dc cfJSR PPUBuffer_QueueCommandOrLength; Queue the length. [930b]68PLA; Pull the caller-provided tile value. [930c]20 45 f8JSR PPUBuffer_Set; Write the tile to the buffer. [930f]86 20STX PPUBuffer_WriteOffset; Update the write offset.
; ; XREFS: ; PasswordScreen_DrawPasswordFieldCursor ;
[9311]RETURN_9311: [9311]60RTS
;============================================================================ ; TODO: Document PasswordScreen_HandleInputChar ; ; INPUTS: ; A ; ; OUTPUTS: ; TODO ; ; XREFS: ; PasswordScreen_HandleInput ;============================================================================
[9312]PasswordScreen_HandleInputChar: [9312]aaTAX; X = A [9313]30 3cBMI PasswordScreen_HandleMoveCursorOrDelete; If a special character, jump to handle it.
; ; Place the character in the buffer. ;
[9315]ae 64 06LDX a:Password_FieldCursorPos; X = Current cursor position. [9318]9d 00 06STA a:ScreenBuffer,X; Store in the screen buffer. [931b]20 db 92JSR PasswordScreen_DrawAtCursorPosition; Write the character.
; ; Advance the cursor position by one. ;
[931e]ae 64 06LDX a:Password_FieldCursorPos; X = Cursor position again. [9321]e8INX; X++
; ; Check if the maximum number of characters have been entered. ;
[9322]ec 65 06CPX a:Password_MaxChars; Has it reached the max number of characters? [9325]f0 0fBEQ @_maxCharsReached; If so, jump. [9327]caDEX; X-- [9328]ec 66 06CPX a:Password_EnteredCharsLength; Was the cursor at the end of the entered characters? [932b]d0 03BNE @_advanceCursorPos; If not, jump.
; ; The cursor was at the end of the password. Advance the ; number of entered characters. ;
[932d]ee 66 06INC a:Password_EnteredCharsLength; Increment the entered chars length. [9330]@_advanceCursorPos: [9330]ee 64 06INC a:Password_FieldCursorPos; Increment the cursor position. [9333]4c db 92JMP PasswordScreen_DrawAtCursorPosition; Write the character.
; ; The max number of characters was reached. Move the cursor ; back to the start of the field and write the character. ;
[9336]@_maxCharsReached: [9336]8e 66 06STX a:Password_EnteredCharsLength; Store the new entered password length. [9339]a9 00LDA #$00 [933b]8d 64 06STA a:Password_FieldCursorPos; Reset the cursor position to 0. [933e]4c db 92JMP PasswordScreen_DrawAtCursorPosition; Write the character.
;============================================================================ ; Play the Character Input sound. ; ; INPUTS: ; None ; ; OUTPUTS: ; None ; ; CALLS: ; Sound_PlayEffect ; ; XREFS: ; PasswordScreen_9175 ; PasswordScreen_HandleMoveCursorRight ; PasswordScreen_HandleWrongPasswordAndWaitForInput ;============================================================================
[9341]Sound_PlayInputSound: [9341]48PHA; Push A to the stack. [9342]a9 0dLDA #$0d; 0xD == Character Input sound [9344]20 e4 d0JSR Sound_PlayEffect; Play the sound effect. [9347]68PLA; Pop A from the stack. [9348]60RTS
;============================================================================ ; Play the Move Cursor sound. ; ; INPUTS: ; None ; ; OUTPUTS: ; None ; ; CALLS: ; Sound_PlayEffect ; ; XREFS: ; Password_HandleDPadInput ;============================================================================
[9349]Sound_PlayMoveCursorSound: [9349]48PHA; Push A to the stack. [934a]a9 0bLDA #$0b; 0xB == Cursor Movement sound. [934c]20 e4 d0JSR Sound_PlayEffect; Play the sound effect. [934f]68PLA; Pop A from the stack.
; ; XREFS: ; PasswordScreen_HandleMoveCursorOrDelete ;
[9350]RETURN_9350: [9350]60RTS
;============================================================================ ; TODO: Document PasswordScreen_HandleMoveCursorOrDelete ; ; INPUTS: ; A ; ; OUTPUTS: ; TODO ; ; XREFS: ; PasswordScreen_HandleInputChar ;============================================================================
[9351]PasswordScreen_HandleMoveCursorOrDelete:
; ; Check if this is Move Left (0x81). ;
[9351]c9 81CMP #$81; Is this Move Left? [9353]f0 0bBEQ PasswordScreen_HandleMoveCursorLeft; If so, jump to handle Move Left.
; ; Check if this is Move Right (0x80). ;
[9355]c9 80CMP #$80; Is this Move Right? [9357]f0 2dBEQ PasswordScreen_HandleMoveCursorRight; If so, jump to handle Move Right.
; ; Check if this is Delete Character (0x82). ;
[9359]c9 82CMP #$82; Is this DEL? [935b]d0 f3BNE RETURN_9350; If not, return. [935d]4c b4 93JMP PasswordScreen_HandleDeleteAtCursor; Else, jump to handle DEL.
;============================================================================ ; TODO: Document PasswordScreen_HandleMoveCursorLeft ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; PasswordScreen_HandleMoveCursorOrDelete ;============================================================================
[9360]PasswordScreen_HandleMoveCursorLeft:
; ; Check if there are any entered characters. ;
[9360]ad 66 06LDA a:Password_EnteredCharsLength; Is the password field empty? [9363]f0 4cBEQ Call_Sound_PlayInputSound; If so, play the input sound and return.
; ; There are entered characters. Check if we're at the ; beginning of the password. ;
[9365]ae 64 06LDX a:Password_FieldCursorPos; Is the cursor position > 0? [9368]d0 13BNE @LAB_PRG12__937d; If so, jump.
; ; The cursor is at the beginning of the password. ;
[936a]20 db 92JSR PasswordScreen_DrawAtCursorPosition [936d]ad 66 06LDA a:Password_EnteredCharsLength; Get the number of entered characters. [9370]8d 64 06STA a:Password_FieldCursorPos; Set the cursor position to the end of it. [9373]cd 65 06CMP a:Password_MaxChars [9376]d0 0bBNE @LAB_PRG12__9383 [9378]ce 64 06DEC a:Password_FieldCursorPos [937b]d0 06BNE @LAB_PRG12__9383 [937d]@LAB_PRG12__937d: [937d]20 db 92JSR PasswordScreen_DrawAtCursorPosition [9380]ce 64 06DEC a:Password_FieldCursorPos [9383]@LAB_PRG12__9383: [9383]4c db 92JMP PasswordScreen_DrawAtCursorPosition
;============================================================================ ; TODO: Document PasswordScreen_HandleMoveCursorRight ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; PasswordScreen_HandleMoveCursorOrDelete ;============================================================================
[9386]PasswordScreen_HandleMoveCursorRight: [9386]ad 66 06LDA a:Password_EnteredCharsLength [9389]f0 26BEQ Call_Sound_PlayInputSound [938b]ae 64 06LDX a:Password_FieldCursorPos [938e]ec 66 06CPX a:Password_EnteredCharsLength [9391]f0 0bBEQ @LAB_PRG12__939e [9393]e8INX [9394]ec 66 06CPX a:Password_EnteredCharsLength [9397]d0 0fBNE @_writeAndAdvanceCursor [9399]ec 65 06CPX a:Password_MaxChars [939c]d0 0aBNE @_writeAndAdvanceCursor [939e]@LAB_PRG12__939e: [939e]20 db 92JSR PasswordScreen_DrawAtCursorPosition [93a1]a9 00LDA #$00 [93a3]8d 64 06STA a:Password_FieldCursorPos [93a6]f0 06BEQ @_writeAtCursor [93a8]@_writeAndAdvanceCursor: [93a8]20 db 92JSR PasswordScreen_DrawAtCursorPosition [93ab]ee 64 06INC a:Password_FieldCursorPos [93ae]@_writeAtCursor: [93ae]4c db 92JMP PasswordScreen_DrawAtCursorPosition
; ; XREFS: ; PasswordScreen_HandleDeleteLastChar ; PasswordScreen_HandleMoveCursorLeft ; PasswordScreen_HandleMoveCursorRight ;
[93b1]Call_Sound_PlayInputSound: [93b1]4c 41 93JMP Sound_PlayInputSound
;============================================================================ ; TODO: Document PasswordScreen_HandleDeleteAtCursor ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; PasswordScreen_HandleMoveCursorOrDelete ;============================================================================
[93b4]PasswordScreen_HandleDeleteAtCursor: [93b4]ad 64 06LDA a:Password_FieldCursorPos [93b7]cd 66 06CMP a:Password_EnteredCharsLength [93ba]f0 30BEQ PasswordScreen_HandleDeleteLastChar [93bc]48PHA [93bd]@_loop: [93bd]ae 64 06LDX a:Password_FieldCursorPos [93c0]e8INX [93c1]ec 66 06CPX a:Password_EnteredCharsLength [93c4]f0 11BEQ @LAB_PRG12__93d7 [93c6]ae 64 06LDX a:Password_FieldCursorPos [93c9]bd 01 06LDA a:DAT_0601,X [93cc]9d 00 06STA a:ScreenBuffer,X [93cf]20 db 92JSR PasswordScreen_DrawAtCursorPosition [93d2]ee 64 06INC a:Password_FieldCursorPos [93d5]d0 e6BNE @_loop [93d7]@LAB_PRG12__93d7: [93d7]ae 64 06LDX a:Password_FieldCursorPos [93da]a9 ffLDA #$ff [93dc]9d 00 06STA a:ScreenBuffer,X [93df]20 db 92JSR PasswordScreen_DrawAtCursorPosition [93e2]ce 66 06DEC a:Password_EnteredCharsLength [93e5]68PLA [93e6]8d 64 06STA a:Password_FieldCursorPos [93e9]4c db 92JMP PasswordScreen_DrawAtCursorPosition
;============================================================================ ; TODO: Document PasswordScreen_HandleDeleteLastChar ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; PasswordScreen_HandleDeleteAtCursor ;============================================================================
[93ec]PasswordScreen_HandleDeleteLastChar: [93ec]ae 64 06LDX a:Password_FieldCursorPos [93ef]f0 c0BEQ Call_Sound_PlayInputSound [93f1]20 db 92JSR PasswordScreen_DrawAtCursorPosition [93f4]ce 64 06DEC a:Password_FieldCursorPos [93f7]ce 66 06DEC a:Password_EnteredCharsLength [93fa]ae 64 06LDX a:Password_FieldCursorPos [93fd]a9 ffLDA #$ff [93ff]9d 00 06STA a:ScreenBuffer,X [9402]4c db 92JMP PasswordScreen_DrawAtCursorPosition
;============================================================================ ; TODO: Document PasswordScreen_DrawAndHandleInputLoop ; ; INPUTS: ; X ; ; OUTPUTS: ; C ; ; XREFS: ; PasswordScreen_WaitForInput ;============================================================================
[9405]PasswordScreen_DrawAndHandleInputLoop: [9405]20 ca 92JSR PasswordScreen_DrawPasswordFieldCursor [9408]20 c8 94JSR Password_HandleDPadInput [940b]20 4f 95JSR PasswordScreen_DrawSelectionCursor [940e]a5 19LDA Joy1_ChangedButtonMask [9410]30 04BMI @LAB_PRG12__9416
; ; Return whether the "A" button was pressed. ;
[9412]0aASL A [9413]30 0dBMI @LAB_PRG12__9422 [9415]60RTS [9416]@LAB_PRG12__9416: [9416]48PHA [9417]a9 0eLDA #$0e [9419]20 e4 d0JSR Sound_PlayEffect [941c]68PLA [941d]20 26 94JSR PasswordScreen_IsCursorSpotInvalid [9420]38SEC [9421]60RTS [9422]@LAB_PRG12__9422: [9422]a9 81LDA #$81 [9424]38SEC [9425]60RTS
;============================================================================ ; Return whether the cursor position is in an invalid spot. ; ; If the cursor is in a spot not containing an input ; character, this will set Carry to 1. ; ; INPUTS: ; Password_CursorCol: ; The current cursor column. ; ; Password_CursorRow: ; The current cursor row. ; ; PASSWORD_VALUES_FOR_CURSOR_POS: ; The password input values for each cursor ; position. ; ; OUTPUTS: ; C: ; 0 = The cursor spot is valid. ; 1 = The cursor spot is invalid. ; ; XREFS: ; PasswordScreen_DrawAndHandleInputLoop ; Password_HandleDPadInput ;============================================================================
[9426]PasswordScreen_IsCursorSpotInvalid:
; ; Calculate an offset into ; PASSWORD_VALUES_FOR_CURSOR_POS. ; ; This starts with: ; ; offset = (row * 2) + (row * 4) ; ; There are 13 columns in a row. The above gives us an ; offset into the characters for that row. So: ; ; 0 * 12 == 0 ; 1 * 12 == 12 ; ; XXX TODO ;
[9426]ad 63 06LDA a:Password_CursorRow; A = Cursor row. [9429]0aASL A; A = A * 2 [942a]6d 63 06ADC a:Password_CursorRow; A++ [942d]0aASL A [942e]0aASL A [942f]6d 63 06ADC a:Password_CursorRow [9432]6d 62 06ADC a:Password_CursorCol
; ; Load the value from that entry in the table. ;
[9435]aaTAX [9436]bd 3c 94LDA a:PASSWORD_VALUES_FOR_CURSOR_POS,X
; ; See if that is 0xFF, which maps to values like DEL, END, ; arrows. If so, the result is false. ;
[9439]c9 ffCMP #$ff [943b]60RTS
; ; XREFS: ; PasswordScreen_IsCursorSpotInvalid ;
[943c]PASSWORD_VALUES_FOR_CURSOR_POS: [943c]00.byte $00; [0]: [943d]01.byte $01; [1]: [943e]02.byte $02; [2]: [943f]03.byte $03; [3]: [9440]04.byte $04; [4]: [9441]05.byte $05; [5]: [9442]06.byte $06; [6]: [9443]07.byte $07; [7]: [9444]08.byte $08; [8]: [9445]09.byte $09; [9]: [9446]0a.byte $0a; [10]: [9447]0b.byte $0b; [11]: [9448]0c.byte $0c; [12]: [9449]0d.byte $0d; [13]: [944a]0e.byte $0e; [14]: [944b]0f.byte $0f; [15]: [944c]10.byte $10; [16]: [944d]11.byte $11; [17]: [944e]12.byte $12; [18]: [944f]13.byte $13; [19]: [9450]14.byte $14; [20]: [9451]15.byte $15; [21]: [9452]16.byte $16; [22]: [9453]17.byte $17; [23]: [9454]18.byte $18; [24]: [9455]19.byte $19; [25]: [9456]1a.byte $1a; [26]: [9457]1b.byte $1b; [27]: [9458]1c.byte $1c; [28]: [9459]1d.byte $1d; [29]: [945a]1e.byte $1e; [30]: [945b]1f.byte $1f; [31]: [945c]20.byte $20; [32]: [945d]21.byte $21; [33]: [945e]22.byte $22; [34]: [945f]23.byte $23; [35]: [9460]24.byte $24; [36]: [9461]25.byte $25; [37]: [9462]26.byte $26; [38]: [9463]27.byte $27; [39]: [9464]28.byte $28; [40]: [9465]29.byte $29; [41]: [9466]2a.byte $2a; [42]: [9467]2b.byte $2b; [43]: [9468]2c.byte $2c; [44]: [9469]2d.byte $2d; [45]: [946a]2e.byte $2e; [46]: [946b]2f.byte $2f; [47]: [946c]30.byte $30; [48]: [946d]31.byte $31; [49]: [946e]32.byte $32; [50]: [946f]33.byte $33; [51]: [9470]34.byte $34; [52]: [9471]35.byte $35; [53]: [9472]36.byte $36; [54]: [9473]37.byte $37; [55]: [9474]38.byte $38; [56]: [9475]39.byte $39; [57]: [9476]3a.byte $3a; [58]: [9477]3b.byte $3b; [59]: [9478]3c.byte $3c; [60]: [9479]3d.byte $3d; [61]: [947a]3e.byte $3e; [62]: [947b]3f.byte $3f; [63]: [947c]ff.byte $ff; [64]: [947d]80.byte $80; [65]: [947e]81.byte $81; [66]: [947f]82.byte $82; [67]: [9480]83.byte $83; [68]: [9481]ff.byte $ff; [69]: [9482]ff.byte $ff; [70]: [9483]ff.byte $ff; [71]: [9484]ff.byte $ff; [72]: [9485]ff.byte $ff; [73]: [9486]ff.byte $ff; [74]: [9487]ff.byte $ff; [75]: [9488]ff.byte $ff; [76]: [9489]ff.byte $ff; [77]:
;============================================================================ ; Get the DPad bits for cursor movement, with auto-repeat. ; ; This will return a bitmask of the DPad bits from ; controller 1. If a button is being held down, it ; will wait a short period of time and then begin ; auto-repeating input at regular intervals (but not ; continuously per-call). ; ; INPUTS: ; Joy1_ButtonMask: ; All the pressed buttons. ; ; Joy1_ChangedButtonMask: ; The newly-pressed buttons. ; ; OUTPUTS: ; Password_CounterBeforeAutoRepeatMove: ; A counter used to wait before auto-repeating ; the next button. ; ; A: ; Password_DPadBits: ; The current DPad bits. ; ; XREFS: ; Password_HandleDPadInput ;============================================================================
[948a]PasswordScreen_GetDPadBits:
; ; Check if there have been any changes to the directional ; button presses since we were last called. ;
[948a]a5 19LDA Joy1_ChangedButtonMask [948c]29 0fAND #$0f [948e]d0 29BNE @_handleAutoRepeat
; ; There were no new changes to buttons. Check whether any ; directional buttons were already being held down. ;
[9490]a5 16LDA Joy1_ButtonMask [9492]29 0fAND #$0f [9494]f0 2cBEQ @_stopAutoRepeat [9496]cd c2 04CMP a:Password_DPadBits [9499]d0 27BNE @_stopAutoRepeat
; ; A direction key has been held down. We're now going to ; begin considering moving in that direction until the ; player changes directions or stops holding down the ; button. ; ; Here's how this works: ; ; 1. This will start at 0 and count up until it gets to 0x29. ; ; 2. Once it hits that, it will switch to 0x80 and immediately ; return the directional button mask, telling the caller ; it can move one space. ; ; 3. It will then count up until it hits 0x85. Until it hits ; that, it won't return any directional button masks. This ; serves as a delay between movements. ; ; 4. Once it hits 0x85, it'll drop back to 0x80 and begin again. ;
[949b]ae c3 04LDX a:Password_CounterBeforeAutoRepeatMove [949e]10 0eBPL @_updateAndCheckAutoRepeatCounter [94a0]ee c3 04INC a:Password_CounterBeforeAutoRepeatMove [94a3]e8INX [94a4]e0 86CPX #$86 [94a6]d0 0eBNE @_incCounter [94a8]@_resetAutoRepeatCounter: [94a8]a2 80LDX #$80 [94aa]8e c3 04STX a:Password_CounterBeforeAutoRepeatMove [94ad]60RTS [94ae]@_updateAndCheckAutoRepeatCounter: [94ae]ee c3 04INC a:Password_CounterBeforeAutoRepeatMove [94b1]e8INX [94b2]e0 2aCPX #$2a [94b4]f0 f2BEQ @_resetAutoRepeatCounter [94b6]@_incCounter: [94b6]a9 00LDA #$00 [94b8]60RTS
; ; A new direction has been held down. Store it and return it, ; moving the cursor. ;
[94b9]@_handleAutoRepeat: [94b9]8d c2 04STA a:Password_DPadBits [94bc]a2 00LDX #$00 [94be]8e c3 04STX a:Password_CounterBeforeAutoRepeatMove [94c1]60RTS
; ; No direction buttons are being pressed, or the direction ; has changed. Stop moving the cursor. ;
[94c2]@_stopAutoRepeat: [94c2]a9 00LDA #$00 [94c4]8d c2 04STA a:Password_DPadBits [94c7]60RTS
;============================================================================ ; Handle DPad input on the password screen. ; ; This will listen for Up, Down, Left, or Right button ; presses, moving the cursor as appropriate. ; ; The cursor will be positioned to the correct spot on the ; new row or column, wrapping or repositioning if needed ; to ensure it's on a valid input location. ; ; There's special handling for the 5th row, which has ; the directional arrows, DEL, and END, all of which take ; up 2 tiles. All other rows have an input taking 1 tile and ; space between. ; ; INPUTS: ; Password_CursorCol: ; The current cursor column. ; ; Password_CursorRow: ; The current cursor row. ; ; OUTPUTS: ; Password_CursorCol: ; The updated cursor column. ; ; Password_CursorRow: ; The updated cursor row. ; ; CALLS: ; PasswordScreen_GetDPadBits ; PasswordScreen_IsCursorSpotInvalid ; PasswordScreen_UpdateCursorMovedFromLastRow ; PasswordScreen_UpdateCursorMovedToLastRow ; Sound_PlayMoveCursorSound ; ; XREFS: ; PasswordScreen_DrawAndHandleInputLoop ;============================================================================
[94c8]Password_HandleDPadInput: [94c8]20 8a 94JSR PasswordScreen_GetDPadBits; Get the DPad bits.
; ; Only consider the bitmask bits, which shouldn't be ; necessary since PasswordScreen_GetDPadBits ; already does this. ;
[94cb]29 0fAND #$0f; Keep the lower nibble (DPad bits -- redundant). [94cd]f0 28BEQ @_return; If nothing is pressed, return.
; ; We can move in a direction. Play a sound and figure ; out which direction we're moving. ;
[94cf]20 49 93JSR Sound_PlayMoveCursorSound; Play the cursor movement sound.
; ; Move the cursor right, handling wrapping. ;
[94d2]4aLSR A; Shift the "Right" bit into Carry. [94d3]b0 51BCS @_moveRight; If set, handle moving right. [94d5]4aLSR A; Shift the "Left" bit into Carry. [94d6]b0 3dBCS @_moveLeft; if set, handle moving left. [94d8]4aLSR A; Shift the "Down" bit into Carry. [94d9]b0 1dBCS @_moveDown; If set, handle moving down.
; ; We're moving one row up. ;
[94db]@_moveUp: [94db]ae 63 06LDX a:Password_CursorRow; X = Cursor row [94de]caDEX; X-- (move up) [94df]10 07BPL @_checkRow4; If the new row is <= 4, jump to handle it.
; ; The cursor wrapped up to row 5. ;
[94e1]20 39 95JSR PasswordScreen_UpdateCursorMovedToLastRow; Handle moving to row 5. [94e4]a2 05LDX #$05; Set the new row as 5. [94e6]d0 07BNE @_updateCursorRow
; ; Check if this is row 4 (moving from arrows/DEL/END). ;
[94e8]@_checkRow4: [94e8]e0 04CPX #$04; Is the new row < 4? [94ea]d0 03BNE @_updateCursorRow; If so, move the cursor there.
; ; Cursor moved from row 5 to 4 (numeric, symbols). ;
[94ec]20 45 95JSR PasswordScreen_UpdateCursorMovedFromLastRow; Handle moving away from row 5.
; ; Update the cursor row and check if the new spot is valid. ; ; This handles the case where we move to row 4, which has a ; blank spot in the last column. If we'd be putting the ; cursor there, move up again one more row. ;
[94ef]@_updateCursorRow: [94ef]8e 63 06STX a:Password_CursorRow; Set the new cursor row. [94f2]20 26 94JSR PasswordScreen_IsCursorSpotInvalid; Check if the destination spot is valid. [94f5]b0 e4BCS @_moveUp; If not, move up one row. [94f7]@_return: [94f7]60RTS
; ; We're moving one row down. ;
[94f8]@_moveDown: [94f8]ae 63 06LDX a:Password_CursorRow; X = Cursor row [94fb]e8INX; X++ (move down) [94fc]e0 05CPX #$05; Did we move to row 5? [94fe]f0 09BEQ @_moveDownToRow5; If so, jump to handle it specially.
; ; The cursor moved down to row < 5. ;
[9500]90 0aBCC @_updateCursorRowDown; Move the cursor down a row.
; ; We've moved down past the last row. We'll be wrapping. ;
[9502]20 45 95JSR PasswordScreen_UpdateCursorMovedFromLastRow; Handle moving from the last row. [9505]a2 00LDX #$00; X = 0 (new row) [9507]f0 03BEQ @_updateCursorRowDown; Move the cursor there.
; ; We're on the final row, with the arrows, DEL, and END. ; We have to ensure the cursor position is a multiple of 2, ; since each of these take 2 character positions. ;
[9509]@_moveDownToRow5: [9509]20 39 95JSR PasswordScreen_UpdateCursorMovedToLastRow; Handle moving to the last row.
; ; Save the new row position. ;
[950c]@_updateCursorRowDown: [950c]8e 63 06STX a:Password_CursorRow; Store the new cursor row.
; ; Keep running this logic while the cursor is wrapping ; vertically so we end up with a proper row and column ; offset. ;
[950f]20 26 94JSR PasswordScreen_IsCursorSpotInvalid; Check if the new position is invalid. [9512]b0 e4BCS @_moveDown; If so, move down one more row (looping as necessary). [9514]60RTS; And return.
; ; Move the cursor left, handling wrapping and repositioning ; if on an invalid spot. ;
[9515]@_moveLeft: [9515]ae 62 06LDX a:Password_CursorCol; X = Cursor column [9518]caDEX; X-- (move left) [9519]10 02BPL @_updateCursorColRight; If >= 0, jump to move right.
; ; We're wrapping from the left to the right. ;
[951b]a2 0cLDX #$0c; Set the cursor to column 12. [951d]@_updateCursorColRight: [951d]8e 62 06STX a:Password_CursorCol; Store the new cursor column. [9520]20 26 94JSR PasswordScreen_IsCursorSpotInvalid; Check if the new position is invalid. [9523]b0 f0BCS @_moveLeft; If so, move left again. [9525]60RTS; And return.
; ; Move the cursor right, handling wrapping and repositioning ; if on an invalid spot. ;
[9526]@_moveRight: [9526]ae 62 06LDX a:Password_CursorCol; X = Cursor column. [9529]e8INX; X++ (move right) [952a]e0 0dCPX #$0d; Is the new position < 13? [952c]90 02BCC @_updateCursorColLeft; If so, jump to move left.
; ; We're wrapping from the right to the left. ;
[952e]a2 00LDX #$00; X = 0 (new cursor position). [9530]@_updateCursorColLeft: [9530]8e 62 06STX a:Password_CursorCol; Store the new cursor position. [9533]20 26 94JSR PasswordScreen_IsCursorSpotInvalid; Check if the new position is invalid. [9536]b0 eeBCS @_moveRight; If so, move right again (looping as needed). [9538]60RTS; And return.
;============================================================================ ; Update the cursor column for the bottom row of the password screen. ; ; When the cursor is on the bottom row, the cursor doesn't ; move one step at a time, it moves 2. The reason is that ; the arrows, DEL, and END are all 2 characters. ; ; INPUTS: ; Password_CursorCol: ; The current cursor column position. ; ; OUTPUTS: ; Password_CursorCol: ; The normalized cursor position. ; ; XREFS: ; Password_HandleDPadInput ;============================================================================
[9539]PasswordScreen_UpdateCursorMovedToLastRow: [9539]ad 62 06LDA a:Password_CursorCol; Load the cursor column. [953c]c9 08CMP #$08; Is it >= 8? (invalid position) [953e]b0 04BCS RETURN_9544; If so, return. [9540]4aLSR A; Else, divide by 2 (each symbol is 2 tiles).
; ; v-- Fall through --v ;
;============================================================================ ; Set the cursor column in the password input grid. ; ; INPUTS: ; A: ; The cursor column. ; ; OUTPUTS: ; Password_CursorCol: ; The updated cursor column. ; ; XREFS: ; PasswordScreen_UpdateCursorMovedFromLastRow ;============================================================================
[9541]PasswordScreen_SetCursorCol: [9541]8d 62 06STA a:Password_CursorCol; Set the cursor position.
; ; XREFS: ; PasswordScreen_UpdateCursorMovedFromLastRow ; PasswordScreen_UpdateCursorMovedToLastRow ;
[9544]RETURN_9544: [9544]60RTS
;============================================================================ ; Handle moving the cursor away from the last input row. ; ; This is called either when moving up from the row or down ; from the row (wrapping around to the top). ; ; The cursor position may be normalized to fit in a matching ; column on the destination row. The hand will then be ; redrawn. ; ; There's some protection against invalid positions, which ; in theory should not happen (at least with the US release). ; ; INPUTS: ; Password_CursorCol: ; The current cursor column. ; ; OUTPUTS: ; Password_CursorCol: ; The updated cursor column. ; ; CALLS: ; UI_DrawPromptInputSymbol ; ; XREFS: ; Password_HandleDPadInput ;============================================================================
[9545]PasswordScreen_UpdateCursorMovedFromLastRow: [9545]ad 62 06LDA a:Password_CursorCol; Load the cursor column. [9548]c9 04CMP #$04; Is it >= 4? (invalid position) [954a]b0 f8BCS RETURN_9544; If so, return. [954c]0aASL A; Else, multiply by 2 (each symbol is 2 tiles). [954d]90 f2BCC PasswordScreen_SetCursorCol; If the new position is invalid, reset the cursor position.
; ; v-- Fall through --v ;
;============================================================================ ; Draw the selection cursor on the password screen. ; ; This will draw the cursor at the given cursor position on ; the screen. This is drawn every frame. ; ; INPUTS: ; InterruptCounter: ; The current interrupt counter, used to rate limit ; updates. ; ; Password_CursorCol: ; The tile X position of the cursor. ; ; Password_CursorRow: ; The tile Y position of the cursor. ; ; OUTPUTS: ; None. ; ; CALLS: ; UI_DrawPromptInputSymbol ; ; XREFS: ; PasswordScreen_DrawAndHandleInputLoop ;============================================================================
[954f]PasswordScreen_DrawSelectionCursor: [954f]ad 62 06LDA a:Password_CursorCol; A = cursor column. [9552]ae 63 06LDX a:Password_CursorRow; X = cursor row. [9555]e0 05CPX #$05; Is the row 5 (arrows, delete, end)? [9557]d0 01BNE @_setSymbolPos; If not, jump.
; ; This is row 5, containing the back/forward arrows, ; DEL, and END. ; ; Each symbol takes 2 columns, so we'll start by multiplying ; the cursor by 2 so we always jump 2 at a time. ;
[9559]0aASL A; Multiply the column by 2.
; ; Compute an X position for the symbol. ;
[955a]@_setSymbolPos: [955a]0aASL A; Convert to pixel position (2 tile width: 16). [955b]0aASL A [955c]0aASL A [955d]0aASL A [955e]69 20ADC #$20; Add 32 (left padding). [9560]aaTAX; X = result.
; ; Compute a Y position for the symbol. ;
[9561]ad 63 06LDA a:Password_CursorRow; A = cursor row. [9564]0aASL A; Convert to pixel position (2 tile height: 16). [9565]0aASL A [9566]0aASL A [9567]0aASL A [9568]69 55ADC #$55; Add 85 (start of first row). [956a]a8TAY; Y = result. [956b]a9 e4LDA #$e4; A = 0xE4 (hand symbol) [956d]4c a7 fcJMP UI_DrawPromptInputSymbol; Draw the symbol.
;============================================================================ ; Set the starting game state for the player. ; ; This will place them in Eolis, with all basic stats, ; no gold, no experience, no inventory. ; ; INPUTS: ; None ; ; OUTPUTS: ; TempleSpawnPoint: ; PlayerTitle: ; SpecialItems: ; Quests: ; NumberOfWeapons: ; NumberOfArmors: ; NumberOfShields: ; NumberOfMagicSpells: ; NumberOfItems: ; NextPlayerTitle: ; Gold: ; Gold_M: ; Gold_U: ; 0 ; ; SelectedWeapon: ; SelectedArmor: ; SelectedShield: ; SelectedMagic: ; SelectedItem: ; 0xFF ; ; XREFS: ; Game_ShowStartScreen ;============================================================================
[9570]Player_SetStartGameState: [9570]a9 00LDA #$00 [9572]8d 39 04STA a:TempleSpawnPoint; Set the temple spawn to 0. [9575]8d 37 04STA a:PlayerTitle; Set the player title to 0 (Novice). [9578]8d 2c 04STA a:SpecialItems; Clear the special items. [957b]8d 2d 04STA a:Quests; Clear the quests. [957e]a2 ffLDX #$ff [9580]8e bd 03STX a:SelectedWeapon; Clear the selected weapon. [9583]8d be 03STA a:SelectedArmor; Clear the selected armor. [9586]8e bf 03STX a:SelectedShield; Clear the selected shield. [9589]8e c0 03STX a:SelectedMagic; Clear the selected magic. [958c]8e c1 03STX a:SelectedItem; Clear the selected item. [958f]8d c2 03STA a:NumberOfWeapons; Set the number of weapons to 0. [9592]8d c3 03STA a:NumberOfArmors; Set the number of armor to 0. [9595]8d c4 03STA a:NumberOfShields; Set the number of shields to 0. [9598]8d c5 03STA a:NumberOfMagicSpells; Set the number of magic spells to 0. [959b]8d c6 03STA a:NumberOfItems; Set the number of items to 0. [959e]8d 90 03STA a:Experience; Set the experience to 0. [95a1]8d 91 03STA a:Experience_U [95a4]8d 92 03STA a:Gold; Set the gold to 0. [95a7]8d 93 03STA a:Gold_M [95aa]8d 94 03STA a:Gold_U [95ad]8d ed 04STA a:NextPlayerTitle; Set the next player title to 0 (Novice). [95b0]60RTS
;============================================================================ ; Set the initial experience and gold based on the title. ; ; This will set initial experience and gold for the player ; based on their title. This is used after starting from a ; password. ; ; INPUTS: ; PlayerTitle: ; The player's title. ; ; PLAYER_TITLE_EXP_NEEDED: ; Lookup table for the experience, based on title ; index. ; ; PLAYER_TITLE_GOLD: ; Lookup table for the gold, based on title index. ; ; OUTPUTS: ; NextPlayerTitle: ; The next player title. ; ; Experience: ; Experience_U: ; The player's new starting experience. ; ; Gold: ; Gold_M: ; Gold_U: ; The player's new starting gold. ; ; XREFS: ; Game_ShowStartScreen ;============================================================================
[95b1]Player_SetInitialExpAndGold:
; ; Set the next player title as the current. ;
[95b1]ad 37 04LDA a:PlayerTitle; Load the current player title. [95b4]8d ed 04STA a:NextPlayerTitle; Set it as the next. [95b7]f0 20BEQ @_isNovice; If it's 0 (Novice), jump.
; ; Generate an offset into the gold and experience arrays. ;
[95b9]0aASL A; Multiply by 2 to generate an offset into the lookup tables. [95ba]aaTAX; X = A
; ; Set the player's experience. ; ; Note that this looks up starting at an offset 2 bytes ; *before* the lookup table. This is because this code ; is always working with an X starting at 2, which becomes ; effectively 0 in the lookup table. ; ; These tables are in bank 15. ;
[95bb]bd 47 f7LDA a:PLAYER_TITLE_EXP_NEEDED-2,X; Load the lower byte of experience for the title. [95be]8d 90 03STA a:Experience; Set it as the player's experience. [95c1]bd 48 f7LDA a:PLAYER_TITLE_EXP_NEEDED-1,X; Load the uper byte of experience for the title. [95c4]8d 91 03STA a:Experience_U; Set it as the player's experience.
; ; Set the player's gold. ; ; The same off-by-2 trick is being used for this lookup table. ;
[95c7]bd 65 f7LDA a:PLAYER_TITLE_GOLD-2,X; Load the lower byte of gold. [95ca]8d 92 03STA a:Gold; Set it. [95cd]bd 66 f7LDA a:PLAYER_TITLE_GOLD-1,X; Load the middle byte of gold. [95d0]8d 93 03STA a:Gold_M; Set it. [95d3]a9 00LDA #$00; Set the upper byte to 0. [95d5]8d 94 03STA a:Gold_U [95d8]60RTS
; ; The player is Novice. Set experience and gold to 0. ;
[95d9]@_isNovice: [95d9]8d 90 03STA a:Experience; Set experience to 0. [95dc]8d 91 03STA a:Experience_U [95df]8d 92 03STA a:Gold; Set gold to 0. [95e2]8d 93 03STA a:Gold_M [95e5]8d 94 03STA a:Gold_U [95e8]60RTS
;============================================================================ ; Load from the calculated password state. ; ; This will decode all the state stored by the password into ; memory, performing validation to ensure that there's no ; corruption. ; ; If the state is invalid, C will be set to 1, triggering ; a Bad Password failure message. ; ; INPUTS: ; None ; ; OUTPUTS: ; C: ; 0 = Successfully loaded password state. ; 1 = Error with password state. ; ; NumberOfArmors: ; NumberOfItems: ; NumberOfMagicSpells: ; NumberOfShields: ; NumberOfWeapons: ; PlayerTitle: ; Quests: ; SelectedArmor: ; SelectedMagic: ; SelectedItem: ; SelectedShield: ; SelectedWeapon: ; TempleSpawnPoint: ; SpecialItems: ; The new state loaded from the password. ; ; Password_ByteCounter: ; Password_BitCounter: ; $ee: ; Temp_0xEF: ; Clobbered. ; ; CALLS: ; Password_DecodeValue ; Password_DecodeValueList ; Password_DecodeValueOrUnset ; ; XREFS: ; PasswordScreen_WaitForInput ;============================================================================
[95e9]Password_Load:
; ; Clear the state counters. ;
[95e9]a2 00LDX #$00 [95eb]8e c9 04STX a:Password_ByteCounter; Clear the byte counter. [95ee]8e ca 04STX a:Password_BitCounter; Clear the bit counter.
; ; Decode the start and checksum values (13 bits total) and throw ; them away. ;
[95f1]a0 0dLDY #$0d; Y = 13 bits [95f3]20 e9 98JSR Password_DecodeValue; Decode the checksum.
; ; Decode the temple spawn point (3 bits). ;
[95f6]a0 03LDY #$03; Y = 3 bits [95f8]20 e9 98JSR Password_DecodeValue; Decode the spawn point. [95fb]8d 39 04STA a:TempleSpawnPoint; And store it.
; ; Decode the player title (4 bits). ;
[95fe]a0 04LDY #$04; Y = 4 bits [9600]20 e9 98JSR Password_DecodeValue; Decode the player title. [9603]8d 37 04STA a:PlayerTitle; And store it.
; ; Decode the special items bitmask (8 bits). ;
[9606]a0 08LDY #$08; Y = 8 bits [9608]20 e9 98JSR Password_DecodeValue; Decode the special items bitmask. [960b]8d 2c 04STA a:SpecialItems; And store it.
; ; Decode the quests bitmask (8 bits). ;
[960e]a0 08LDY #$08; Y = 8 bits [9610]20 e9 98JSR Password_DecodeValue; Decode the quests bitmask. [9613]8d 2d 04STA a:Quests; And store it.
; ; Decode the selected weapon (2 bits). ;
[9616]a0 02LDY #$02; Y = 2 bits [9618]20 b0 96JSR Password_DecodeValueOrUnset; Decode the selected weapon. [961b]8d bd 03STA a:SelectedWeapon; And store it.
; ; Decode the selected armor (2 bits). ;
[961e]a0 02LDY #$02; Y = 2 bits [9620]20 b0 96JSR Password_DecodeValueOrUnset; Decode the selected armor. [9623]8d be 03STA a:SelectedArmor; And store it.
; ; Decode the selected shield (2 bits). ;
[9626]a0 02LDY #$02; Y = 2 bits [9628]20 b0 96JSR Password_DecodeValueOrUnset; Decode the selected shield. [962b]8d bf 03STA a:SelectedShield; And store it.
; ; Decode the selected magic spell (3 bits). ;
[962e]a0 03LDY #$03; Y = 3 bits [9630]20 b0 96JSR Password_DecodeValueOrUnset; Decode the selected magic spell. [9633]8d c0 03STA a:SelectedMagic; And store it.
; ; Decode the selected item (5 bits). ;
[9636]a0 05LDY #$05; Y = 5 bits [9638]20 b0 96JSR Password_DecodeValueOrUnset; Decode the selected item. [963b]8d c1 03STA a:SelectedItem; And store it.
; ; Decode the weapon inventory into WeaponInventory. ;
[963e]a9 9dLDA #<WeaponInventory; Lower byte of inventory. [9640]85 eeSTA Temp_Int24_U; Store it. [9642]a9 03LDA #>WeaponInventory; Upper byte of inventory. [9644]85 efSTA Temp_0xEF; Store it. [9646]a0 03LDY #$03; Y = 3 bits for items. [9648]a2 02LDX #$02; X = 2 bits for max count. [964a]20 c2 96JSR Password_DecodeValueList; Decode the weapon inventory.
; ; Check if under the allowed number of weapons. If too many, ; bail with error. ;
[964d]c9 05CMP #$05; Has this exceeded the inventory size? [964f]b0 5dBCS @_returnTrue; If so, return with failure. [9651]8d c2 03STA a:NumberOfWeapons; Else, store the weapon count.
; ; Decode the armor inventory into ArmorInventory. ;
[9654]a9 a1LDA #<ArmorInventory; Lower byte of inventory. [9656]85 eeSTA Temp_Int24_U; Store it. [9658]a9 03LDA #>ArmorInventory; Upper byte of inventory. [965a]85 efSTA Temp_0xEF; Store it. [965c]a0 03LDY #$03; Y = 3 bits for items. [965e]a2 02LDX #$02; X = 2 bits for max count. [9660]20 c2 96JSR Password_DecodeValueList; Decode the armor inventory.
; ; Check if under the allowed number of armors. If too many, ; bail with error. ;
[9663]c9 05CMP #$05; Has this exceeded the inventory size? [9665]b0 47BCS @_returnTrue; If so, return with failure. [9667]8d c3 03STA a:NumberOfArmors; Else, store the armor count.
; ; Decode the shield inventory into ShieldInventory. ;
[966a]a9 a5LDA #<ShieldInventory; Lower byte of inventory. [966c]85 eeSTA Temp_Int24_U; Store it. [966e]a9 03LDA #>ShieldInventory; Upper byte of inventory. [9670]85 efSTA Temp_0xEF; Store it. [9672]a0 03LDY #$03; Y = 3 bits for items. [9674]a2 02LDX #$02; X = 2 bits for max count. [9676]20 c2 96JSR Password_DecodeValueList; Decode the shield inventory.
; ; Check if under the allowed number of shields. If too many, ; bail with error. ;
[9679]c9 05CMP #$05; Has this exceeded the inventory size? [967b]b0 31BCS @_returnTrue; If so, return with failure. [967d]8d c4 03STA a:NumberOfShields; Else, store the shield count.
; ; Decode the magic inventory into MagicInventory. ;
[9680]a9 a9LDA #<MagicInventory; Lower byte of inventory. [9682]85 eeSTA Temp_Int24_U; Store it. [9684]a9 03LDA #>MagicInventory; Upper byte of inventory. [9686]85 efSTA Temp_0xEF; Store it. [9688]a0 03LDY #$03; Y = 3 bits for items. [968a]a2 03LDX #$03; X = 3 bits for max count. [968c]20 c2 96JSR Password_DecodeValueList; Decode the magic inventory.
; ; Check if under the allowed number of magic spells. If too ; many, bail with error. ;
[968f]c9 05CMP #$05; Has this exceeded the inventory size? [9691]b0 1bBCS @_returnTrue; If so, return with failure. [9693]8d c5 03STA a:NumberOfMagicSpells; Else, store the magic count.
; ; Decode the items inventory into ItemInventory. ;
[9696]a9 adLDA #<ItemInventory; Lower byte of inventory. [9698]85 eeSTA Temp_Int24_U; Store it. [969a]a9 03LDA #>ItemInventory; Upper byte of inventory. [969c]85 efSTA Temp_0xEF; Store it. [969e]a0 04LDY #$04; Y = 4 bits for items. [96a0]a2 05LDX #$05; X = 5 bits for max count. [96a2]20 c2 96JSR Password_DecodeValueList; Decode the item inventory.
; ; Check if under the allowed number of items. If too many, ; bail with error. ;
[96a5]c9 09CMP #$09; Has this exceeded the inventory size? [96a7]b0 05BCS @_returnTrue; If so, return with failure. [96a9]8d c6 03STA a:NumberOfItems; Else, store the item count. [96ac]18CLC; Set C = 0 for success. [96ad]60RTS; And return it.
; ; The state was corrupted or invalid. Return a fail result. ;
[96ae]@_returnTrue: [96ae]38SEC; Set C = 0 for failure. [96af]60RTS; And return it.
;============================================================================ ; Decode an optional value that may be unset. ; ; This will decode a 1 bit flag indicating if a value is ; set. ; ; If the flag is 1, a value is set, and will be decoded and ; returned. ; ; If the flag is 0, an unset value (0xFF) will be returned. ; ; INPUTS: ; Y: ; The storage size of the value in bits. ; ; OUTPUTS: ; A: ; The decoded value, or 0xFF if unset. ; ; CALLS: ; Password_DecodeValue ; ; XREFS: ; Password_Load ;============================================================================
[96b0]Password_DecodeValueOrUnset: [96b0]98TYA; A = Y (number of bits) [96b1]48PHA; Push it to the stack. [96b2]a0 01LDY #$01; Y = 1 [96b4]20 e9 98JSR Password_DecodeValue; Decode the set/unset flag. [96b7]4aLSR A; Shift into Carry. [96b8]68PLA; Pop our saved Y (number of bits). [96b9]a8TAY; Set back into Y. [96ba]90 03BCC @_returnUnset; If the flag was 0, jump to return unset.
; ; The value is set. Decode it. ;
[96bc]4c e9 98JMP Password_DecodeValue; Decode the value and return it.
; ; The value was not set. Return 0xFF. ;
[96bf]@_returnUnset: [96bf]a9 ffLDA #$ff; A = 0xFF (unset value). [96c1]60RTS; And return it.
;============================================================================ ; Decode a list of values from a password. ; ; INPUTS: ; X: ; The number of bits used to store an item. ; ; Y: ; The number of bits used to store the list length. ; ; OUTPUTS: ; A: ; The number of items read. ; ; $ee: ; The decoded items. ; ; Password_TempA: ; Password_TempX: ; Clobbered. ; ; CALLS: ; Password_DecodeValue ; ; XREFS: ; Password_Load ;============================================================================
[96c2]Password_DecodeValueList: [96c2]8e c7 04STX a:Password_TempX; Store X temporarily.
; ; Decode the length count. ;
[96c5]20 e9 98JSR Password_DecodeValue; Decode the next value. [96c8]8d c8 04STA a:Password_TempA; Store the result temporarily. [96cb]f0 17BEQ @_return; If it's 0 (no items), return 0.
; ; The list has at least 1 item. Iterate through the items. ;
[96cd]a0 00LDY #$00; Y = 0 (loop counter). [96cf]@_loop: [96cf]98TYA; A = Y [96d0]48PHA; Push the loop counter to the stack.
; ; Read an item from the list. ;
[96d1]ac c7 04LDY a:Password_TempX; Y = number of item bits to read. [96d4]20 e9 98JSR Password_DecodeValue; Decode the item value. [96d7]aaTAX; X = resulting item value [96d8]68PLA; Pop the loop counter. [96d9]a8TAY; Y = loop counter
; ; Store the resulting item in our buffer. ;
[96da]8aTXA; A = item value [96db]91 eeSTA (Temp_Int24_U),Y; Store in our decode buffer. [96dd]c8INY; Y++ [96de]cc c8 04CPY a:Password_TempA; Have we read all the items? [96e1]d0 ecBNE @_loop; If not, loop.
; ; We're done! Return the number of items. ;
[96e3]98TYA; A = Y (loop counter, result) [96e4]@_return: [96e4]60RTS; And return it.
;============================================================================ ; Generate the full password byte state for the game and reset. ; ; This wraps Password_GenerateState and then resets ; counters. ; See that method for details and other outputs. ; ; INPUTS: ; None. ; ; OUTPUTS: ; Password_EncodedState: ; The resulting computed password state. ; ; Password_ByteCounter: ; Password_BitCounter: ; Internal, and clobbered. ; ; CALLS: ; Password_GenerateState ; ; XREFS: ; IScriptAction_ShowPassword ;============================================================================
[96e5]Password_GenerateStateAndReset: [96e5]20 fe 96JSR Password_GenerateState; Generate the password state.
; ; Reset the state. ;
[96e8]a2 00LDX #$00 [96ea]8e c9 04STX a:Password_ByteCounter; Reset byte counter to 0. [96ed]8e ca 04STX a:Password_BitCounter; Reset bit counter to 0. [96f0]60RTS
;============================================================================ ; Return the next 6 bits from the encoded password state. ; ; INPUTS: ; Password_6BitCount: ; The number of 6 bit values remaining. ; ; OUTPUTS: ; A: ; The decoded value. ; ; C: ; 0 = Data remaining to read. ; 1 = Data has been read. ; ; Password_6BitCount: ; The decremented number of 6 bit values remaining. ; ; CALLS: ; Password_DecodeValue ; ; XREFS: ; PasswordScreen_ShowNextChar ;============================================================================
[96f1]Password_GetNext6Bits: [96f1]a0 06LDY #$06 [96f3]20 e9 98JSR Password_DecodeValue; Decode the next 6 bits. [96f6]18CLC [96f7]ce cb 04DEC a:Password_6BitCount; Decrement the 6 bit counter. [96fa]d0 01BNE @_return; If > 0, set C=0 and jump to return. [96fc]38SEC; Set C=1. [96fd]@_return: [96fd]60RTS
;============================================================================ ; Generate the full password byte state for the game. ; ; This generates the password state based on the game state, ; prior to building the readable alphanumeric/symbolic ; password. ; ; This is done by encoding an initial but incomplete ; password state, which contains all the saved game ; elements (spawn point, items, weapons, armor, etc.) ; but does not contain some of the initial validation ; state (checksum and a 6-bit-length data counter). ; ; Then it calculates the 6-bit length data counter based ; on that, which will go into the final password. ; ; The state is reset and password state is generated again. ; This time, the first 5 bits of the second byte is ; populated with the 6-bit data counter, following by the ; game state, followed by padding bits to round up to the ; nearest byte. ; ; The checksum is then stored in the first byte. ; ; INPUTS: ; None. ; ; OUTPUTS: ; Password_EncodedState: ; The resulting computed password state. ; ; Password_ByteCounter: ; Password_BitCounter: ; Password_Checksum: ; Internal, and clobbered. ; ; CALLS: ; Password_EncodeValue ; Password_EncodeGameState ; ; XREFS: ; Password_GenerateStateAndReset ;============================================================================
[96fe]Password_GenerateState:
; ; Reset all the encoding state. ;
[96fe]a2 00LDX #$00 [9700]8e c9 04STX a:Password_ByteCounter; Reset byte counter to 0. [9703]8e ca 04STX a:Password_BitCounter; Reset bit counter to 0. [9706]8e cc 04STX a:Password_Checksum; Reset checksum to 0.
; ; Place 0x00 in the first byte. ;
[9709]a0 08LDY #$08; Y = 8 (value storage size in bits) [970b]a9 00LDA #$00; A = 0 (value) [970d]20 a7 98JSR Password_EncodeValue; Encode it.
; ; Place 0x00 in the first 5 bits of the second byte. ;
[9710]a0 05LDY #$05; Y = 5 (value storage size in bits) [9712]a9 00LDA #$00; A = 0 (value) [9714]20 a7 98JSR Password_EncodeValue; Encode it.
; ; Save all the game state into the remaining bits and ; progress the checksum. ;
[9717]20 6c 97JSR Password_EncodeGameState; Encode the game state.
; ; Begin resetting state again for another run, but now using ; the calculated values as part of the final state. ; ; First, generate the total bits placed in the state as: ; ; total_bits = total_bytes * 8 + remaining_bits; ; ; If total_bytes == 32: // End of password state ; total_bits--; ;
[971a]ad c9 04LDA a:Password_ByteCounter; Multiply the current state byte index by 8, and track carry. [971d]0aASL A [971e]0aASL A [971f]0aASL A [9720]6d ca 04ADC a:Password_BitCounter; Add the current bit counter within the final byte - the carry.
; ; Begin our 6-bit count loop. ; ; Roughly: ; ; result = ceil(total_bits / 6) ;
[9723]a2 00LDX #$00; X = 0 (Loop counter) [9725]@_6BitCountLoop: [9725]e8INX; X++ [9726]38SEC; X = 1 [9727]e9 06SBC #$06; A -= 6 [9729]f0 02BEQ @_resetLoop; If 0, break out of the loop. [972b]b0 f8BCS @_6BitCountLoop; Else, loop.
; ; Store the final expected 6 bit counter for the password state. ;
[972d]@_resetLoop: [972d]8e cb 04STX a:Password_6BitCount; X = 6-bit counter
; ; Reset for a new password generation using the counter. ;
[9730]a2 00LDX #$00 [9732]8e c9 04STX a:Password_ByteCounter; Reset byte counter to 0. [9735]8e ca 04STX a:Password_BitCounter; Reset bit counter to 0. [9738]8e cc 04STX a:Password_Checksum; Reset checksum to 0.
; ; Encode the blank checksum. ;
[973b]a0 08LDY #$08; Y = 8 (value storage size in bits) [973d]a9 00LDA #$00; A = 0 (checksum value) [973f]20 a7 98JSR Password_EncodeValue; Encode the checksum value.
; ; Encode the 6-bit counter. ;
[9742]a0 05LDY #$05; Y = 5 (value storage size in bits) [9744]ad cb 04LDA a:Password_6BitCount; A = 6 bit count value [9747]20 a7 98JSR Password_EncodeValue; Encode the value.
; ; Encode the game state again. ;
[974a]20 6c 97JSR Password_EncodeGameState; Encode the game state. [974d]4c 57 97JMP @_fillPaddedBits
; ; Encode a padding bits for any remaining bits. ;
[9750]@_fillPaddedBitsLoop: [9750]a0 01LDY #$01; Y = 1 (value storage size in bits) [9752]a9 00LDA #$00; A = 0 (value) [9754]20 a7 98JSR Password_EncodeValue; Encode the padding. [9757]@_fillPaddedBits: [9757]ad ca 04LDA a:Password_BitCounter; A = current bit offset [975a]d0 f4BNE @_fillPaddedBitsLoop; If not 0, add our padding bit.
; ; Set the last byte to 0. ;
[975c]ae c9 04LDX a:Password_ByteCounter; X = byte counter [975f]a9 00LDA #$00; A = 0 [9761]9d cd 04STA a:Password_EncodedState,X; Store as the final byte value.
; ; Set the checksum. ;
[9764]38SEC [9765]ed cc 04SBC a:Password_Checksum; Negate the checksum. [9768]8d cd 04STA a:Password_EncodedState; Store as the first byte of the encoded state. [976b]60RTS
;============================================================================ ; Encode game state for the new password. ; ; INPUTS: ; NumberOfArmors: ; The number of armor items to encode. ; ; NumberOfItems: ; The number of items to encode. ; ; NumberOfMagicSpells: ; The number of magic spells to encode. ; ; NumberOfShields: ; The number of shields to encode. ; ; NumberOfWeapons: ; The number of weapons to encode. ; ; PlayerTitle: ; The player title to encode. ; ; Quests: ; The quests to encode. ; ; SelectedArmor: ; The selected armor to encode. ; ; SelectedItem: ; The selected item to encode. ; ; SelectedMagic: ; The selected magic to encode. ; ; SelectedShield: ; The selected shield to encode. ; ; SelectedWeapon: ; The selected weapon to encode. ; ; SpecialItems: ; The special items to encode. ; ; TempleSpawnPoint: ; The temple spawn point to encode. ; ; ArmorInventory: ; The armor inventory items to encode. ; ; ItemInventory: ; The consumable inventory items to encode. ; ; MagicInventory: ; The magic inventory items to encode. ; ; ShieldInventory: ; The shield inventory items to encode. ; ; WeaponInventory: ; The weapon inventory items to encode. ; ; OUTPUTS: ; None. ; ; CALLS: ; Password_EncodeValue ; Password_EncodeValueList ; Password_EncodeValueOrUnset ; ; XREFS: ; Password_GenerateState ;============================================================================
[976c]Password_EncodeGameState:
; ; Encode the temple spawn point. ;
[976c]ad 39 04LDA a:TempleSpawnPoint; A = Temple spawn point. [976f]a0 03LDY #$03; Y = 3 (storage size in bits) [9771]20 a7 98JSR Password_EncodeValue; Encode the spawn point.
; ; Encode the player's title. ;
[9774]ad 37 04LDA a:PlayerTitle; A = Player title. [9777]a0 04LDY #$04; Y = 4 (storage size in bits) [9779]20 a7 98JSR Password_EncodeValue; Encode the title.
; ; Encode the player's special items bitmask. ;
[977c]ad 2c 04LDA a:SpecialItems; A = Special items bitmask. [977f]a0 08LDY #$08; Y = 8 (storage size in bits) [9781]20 a7 98JSR Password_EncodeValue; Encode the special items bitmask.
; ; Encode the completed quests. ;
[9784]ad 2d 04LDA a:Quests; A = Quests bitmask. [9787]a0 08LDY #$08; Y = 8 (storage size in bits) [9789]20 a7 98JSR Password_EncodeValue; Encode the quests bitmask.
; ; Encode the selected weapon. ;
[978c]ad bd 03LDA a:SelectedWeapon; A = Selected weapon. [978f]a0 02LDY #$02; Y = 2 (storage size in bits) [9791]20 0f 98JSR Password_EncodeValueOrUnset; Encode the selected weapon.
; ; Encode the selected armor. ;
[9794]ad be 03LDA a:SelectedArmor; A = Selected armor. [9797]a0 02LDY #$02; Y = 2 (storage size in bits) [9799]20 0f 98JSR Password_EncodeValueOrUnset; Encode the selected armor.
; ; Encode the selected shield. ;
[979c]ad bf 03LDA a:SelectedShield; A = Selected shield. [979f]a0 02LDY #$02; Y = 2 (storage size in bits) [97a1]20 0f 98JSR Password_EncodeValueOrUnset; Encode the selected shield.
; ; Encode the selected magic spell. ;
[97a4]ad c0 03LDA a:SelectedMagic; A = Selected magic. [97a7]a0 03LDY #$03; Y = 3 (storage size in bits) [97a9]20 0f 98JSR Password_EncodeValueOrUnset; Encode the selected magic.
; ; Encode the selected item. ;
[97ac]ad c1 03LDA a:SelectedItem; A = Selected item. [97af]a0 05LDY #$05; Y = 5 (storage size in bits) [97b1]20 0f 98JSR Password_EncodeValueOrUnset; Encode the selected item.
; ; Set the value to write to the address of ; Player_ShieldPositionY+1 ; ; This hard-codes $039D. ;
[97b4]a9 9dLDA #$9d [97b6]85 eeSTA Temp_Int24_U [97b8]a9 03LDA #$03 [97ba]85 efSTA Temp_0xEF
; ; Encode the weapon inventory. ;
[97bc]a0 03LDY #$03; Y = 3 (storage size in bits) [97be]a2 02LDX #$02; X = 2 (start offset) [97c0]ad c2 03LDA a:NumberOfWeapons; A = Number of weapons. [97c3]20 2a 98JSR Password_EncodeValueList; Encode the weapon inventory.
; ; Set the value to write to the address of 0x3a1. ; ; This hard-codes $03A1. ;
[97c6]a9 a1LDA #$a1 [97c8]85 eeSTA Temp_Int24_U [97ca]a9 03LDA #$03 [97cc]85 efSTA Temp_0xEF
; ; Encode the armor inventory. ;
[97ce]a0 03LDY #$03; Y = 3 (storage size in bits) [97d0]a2 02LDX #$02; X = 2 (start offset) [97d2]ad c3 03LDA a:NumberOfArmors; A = Number of armors. [97d5]20 2a 98JSR Password_EncodeValueList; Encode the armor inventory.
; ; Set the value to write to the address of 0x3a5. ; ; This hard-codes $03A5. ;
[97d8]a9 a5LDA #$a5 [97da]85 eeSTA Temp_Int24_U [97dc]a9 03LDA #$03 [97de]85 efSTA Temp_0xEF
; ; Encode the shield inventory. ;
[97e0]a0 03LDY #$03; Y = 3 (storage size in bits) [97e2]a2 02LDX #$02; X = 2 (start offset) [97e4]ad c4 03LDA a:NumberOfShields; A = Number of shields. [97e7]20 2a 98JSR Password_EncodeValueList; Encode the shield inventory.
; ; Set the value to write to the address of 0x3a9. ; ; This hard-codes $03A9. ;
[97ea]a9 a9LDA #$a9 [97ec]85 eeSTA Temp_Int24_U [97ee]a9 03LDA #$03 [97f0]85 efSTA Temp_0xEF
; ; Encode the magic inventory. ;
[97f2]a0 03LDY #$03; Y = 3 (storage size in bits) [97f4]a2 03LDX #$03; X = 3 (start offset) [97f6]ad c5 03LDA a:NumberOfMagicSpells; A = Number of magic spells. [97f9]20 2a 98JSR Password_EncodeValueList; Encode the magic inventory.
; ; Set the value to write to the address of 0x3ad. ; ; This hard-codes $03AD. ;
[97fc]a9 adLDA #$ad [97fe]85 eeSTA Temp_Int24_U [9800]a9 03LDA #$03 [9802]85 efSTA Temp_0xEF
; ; Encode the item inventory. ;
[9804]a0 04LDY #$04; Y = 4 (storage size in bits) [9806]a2 05LDX #$05; X = 5 (start offset) [9808]ad c6 03LDA a:NumberOfItems; A = Number of items. [980b]20 2a 98JSR Password_EncodeValueList; Encode the item inventory. [980e]60RTS
;============================================================================ ; Encode a Set/Unset state and a value if set. ; ; If the value is 0xFF, this will encode just 1 bit, an Unset ; value (0). ; ; Otherwise, this will encode a Set bit (1) and the value. ; ; INPUTS: ; A: ; The value to encode (or 0xFF). ; ; X: ; The start offset. ; ; Y: ; The storage size of the value in bits. ; ; OUTPUTS: ; X: ; The new offset. ; ; CALLS: ; Password_EncodeValue ; ; XREFS: ; Password_EncodeGameState ;============================================================================
[980f]Password_EncodeValueOrUnset: [980f]c9 ffCMP #$ff; Is the value to encode 0xFF? [9811]f0 10BEQ @_isUnset; If so, then jump.
; ; The value is set. First, push our value and storage size ; to the stack. ;
[9813]48PHA; Push the value to the stack. [9814]98TYA; A = Y (storage size in bits) [9815]48PHA; Push the value to the stack.
; ; Encode the Set flag. ;
[9816]a0 01LDY #$01; Y = 1 (storage size in bits) [9818]a9 01LDA #$01; A = 1 (set) [981a]20 a7 98JSR Password_EncodeValue; Encode the value.
; ; Encode the value. ;
[981d]68PLA; Pop the storage size in bits. [981e]a8TAY; Y = result [981f]68PLA; Pop the value. [9820]4c a7 98JMP Password_EncodeValue; Encode the value.
; ; The value is unset. Encode only the unset state. ;
[9823]@_isUnset: [9823]a0 01LDY #$01; Y = 1 (storage size in bits) [9825]a9 00LDA #$00; A = 0 (unset) [9827]4c a7 98JMP Password_EncodeValue; Encode the value.
;============================================================================ ; Encode a list of values for state in the password. ; ; INPUTS: ; A: ; The number of values to encode. ; ; Y: ; The number of bits of storage used to encode ; the state. ; ; OUTPUTS: ; Password_TempA: ; Password_TempX: ; Password_TempY: ; Clobbered. ; ; CALLS: ; Password_EncodeValue ; ; XREFS: ; Password_EncodeGameState ;============================================================================
[982a]Password_EncodeValueList: [982a]f0 21BEQ @_encodeValue; If empty, just encode the value directly.
; ; Store A, X, and Y so we can work with these variables. ;
[982c]8d c8 04STA a:Password_TempA; Password_TempA = A [982f]8c c6 04STY a:Password_TempY; Password_TempY = Y [9832]8e c7 04STX a:Password_TempX; Password_TempX = X
; ; Encode the number of entries as a value. Roughly: ; ; Password_EncodeValue(numEntries, startOffset, numBits) ;
[9835]20 a7 98JSR Password_EncodeValue; Encode that value.
; ; Prepare for the loop. ; ; Y is our counter. ; Password_TempA is our upper bounds. ;
[9838]a0 00LDY #$00; Y = 0 (loop counter) [983a]@_loop: [983a]98TYA; A = Y [983b]48PHA; Push A to stack
; ; Encode a value from the list. Roughly: ; ; Password_EncodeValue(entryList[Y], X, numBits) ;
[983c]b1 eeLDA (Temp_Int24_U),Y; A = value at bits offset [983e]ac c7 04LDY a:Password_TempX; Y = Password_TempX (num bits) [9841]20 a7 98JSR Password_EncodeValue; Encode this value.
; ; We're done encoding. See if we've reached the end ; of the encoding loop. ;
[9844]68PLA; Pop A from stack [9845]a8TAY; Y = A [9846]c8INY; Y++ [9847]cc c8 04CPY a:Password_TempA; If Y != Password_TempA ... [984a]d0 eeBNE @_loop; ... Loop. [984c]60RTS [984d]@_encodeValue: [984d]4c a7 98JMP Password_EncodeValue
;============================================================================ ; TODO: Document Password_Maybe_CheckPasswordLength ; ; INPUTS: ; None. ; ; OUTPUTS: ; C ; ; XREFS: ; PasswordScreen_WaitForInput ;============================================================================
[9850]Password_Maybe_CheckPasswordLength: [9850]a2 00LDX #$00 [9852]8e c9 04STX a:Password_ByteCounter [9855]8e ca 04STX a:Password_BitCounter [9858]8e cc 04STX a:Password_Checksum [985b]a0 06LDY #$06 [985d]bd 00 06LDA a:ScreenBuffer,X [9860]20 a7 98JSR Password_EncodeValue [9863]e8INX [9864]a0 06LDY #$06 [9866]bd 00 06LDA a:ScreenBuffer,X [9869]20 a7 98JSR Password_EncodeValue [986c]e8INX [986d]a0 06LDY #$06 [986f]bd 00 06LDA a:ScreenBuffer,X [9872]20 a7 98JSR Password_EncodeValue [9875]e8INX [9876]ad ce 04LDA a:Password_EncodedState_1_ [9879]4aLSR A [987a]4aLSR A [987b]4aLSR A [987c]cd 66 06CMP a:Password_EnteredCharsLength [987f]d0 24BNE @_returnTrue [9881]@LAB_PRG12__9881: [9881]a0 06LDY #$06 [9883]bd 00 06LDA a:ScreenBuffer,X [9886]20 a7 98JSR Password_EncodeValue [9889]e8INX [988a]ec 66 06CPX a:Password_EnteredCharsLength [988d]d0 f2BNE @LAB_PRG12__9881 [988f]@LAB_PRG12__988f: [988f]ad ca 04LDA a:Password_BitCounter [9892]f0 0aBEQ @LAB_PRG12__989e [9894]a0 01LDY #$01 [9896]a9 00LDA #$00 [9898]20 a7 98JSR Password_EncodeValue [989b]4c 8f 98JMP @LAB_PRG12__988f [989e]@LAB_PRG12__989e: [989e]ad cc 04LDA a:Password_Checksum [98a1]d0 02BNE @_returnTrue [98a3]18CLC [98a4]60RTS [98a5]@_returnTrue: [98a5]38SEC [98a6]60RTS
;============================================================================ ; TODO: Document Password_EncodeValue ; ; INPUTS: ; A ; Y ; ; OUTPUTS: ; TODO ; ; XREFS: ; Password_EncodeGameState ; Password_EncodeValueList ; Password_EncodeValueOrUnset ; Password_GenerateState ; Password_Maybe_CheckPasswordLength ;============================================================================
[98a7]Password_EncodeValue: [98a7]85 ecSTA Temp_Int24; Temp_Int24 = A (character code value) [98a9]8aTXA; A = X (character code offset) [98aa]48PHA; Push A to stack, saving it.
; ; Determine the number of bits we'll be using as an ; offset in our math below. ; ; This will be 8 - Y. ; ; If that is > 0, we'll do looped math below to ; calculate a source bit offset, storing in Temp_Int24. ; ; If it's 0, we'll skip the math and keep ; Temp_Int24 = A (the character code value). ;
[98ab]84 edSTY Temp_Int24_M; Temp_Int24+1 = Y (number of bits) [98ad]a9 08LDA #$08; A = 8 (bits in a byte) [98af]38SEC; C = 1 [98b0]e5 edSBC Temp_Int24_M; A = 8 - Temp_Int24+1 - (1 - C) = 8 - Temp_Int24+1 = 8 - Y If overflow, C = 0 [98b2]f0 08BEQ @_loop2; If A == 0, skip the bit offset math. [98b4]85 edSTA Temp_Int24_M; Temp_Int24+1 = A (our loop counter; remaining bits)
; ; Do: ; ; Temp_Int24 = Temp_Int24 * (2 to the ; power of Temp_Int24+1) ; ; Or, rather: ; ; bitPos = charCode * (2 to the power of (8 - numBits)) ; ; We're effectively taking a 0-based character code (A-Za-z0-9) ; into the entered password and we're getting a source bit offset ; using increments of (8 - numBits), which for value-to-ASCII ; encoding (for example) will be 8 - 6 = 2. ;
[98b6]@_loop1: [98b6]06 ecASL Temp_Int24; Temp_Int24 *= 2 If overflow, C = 1 [98b8]c6 edDEC Temp_Int24_M; Temp_Int24+1-- [98ba]d0 faBNE @_loop1; If Temp_Int24+1 != 0, loop.
; ; Encode the character. ;
[98bc]@_loop2: [98bc]ae c9 04LDX a:Password_ByteCounter; X = index of the character to encode
; ; Advance our source bit position, multipying by 2 and ; OR'ing the carry flag from above. ;
[98bf]26 ecROL Temp_Int24; Temp_Int24 = Temp_Int24 * 2 | C If overflow, C = 1
; ; Store a new computed value at the dest offset (X, or ; Password_ByteCounter). This will be the stored value * 2, ; OR'd with the carry bit from the calculation above. ;
[98c1]3e cd 04ROL a:Password_EncodedState,X; Dest value = Dest value * 2 | C If overflow, C = 1
; ; Advance the bit position. ; ; If we're at the end of the byte, jump to advance ; the destination byte position and reset the bit counter. ;
[98c4]ee ca 04INC a:Password_BitCounter; Password_BitCounter++ [98c7]ae ca 04LDX a:Password_BitCounter; X = Password_BitCounter [98ca]e0 08CPX #$08; If X != 8... [98cc]d0 15BNE @_nextLoop; ... Jump
; ; We finished processing the byte. We can now update the ; checksum, reset the destination byte, and reset the dest ; bit counter. ;
[98ce]ae c9 04LDX a:Password_ByteCounter; X = Computed byte index [98d1]bd cd 04LDA a:Password_EncodedState,X; A = Dest value
; ; Update the checksum value. ; ; The checksum is the sum of the character values computed. ;
[98d4]18CLC; C = 0 [98d5]6d cc 04ADC a:Password_Checksum; Password_Checksum += A (dest value) If overflow, C = 1 [98d8]8d cc 04STA a:Password_Checksum
; ; Increment the destination index and reset the bit counter. ;
[98db]ee c9 04INC a:Password_ByteCounter [98de]a2 00LDX #$00 [98e0]8e ca 04STX a:Password_BitCounter [98e3]@_nextLoop: [98e3]88DEY; Y-- [98e4]d0 d6BNE @_loop2; If not 0, loop.
; ; Restore the original value for X. This won't be modified. ;
[98e6]68PLA; Pull A from stack. [98e7]aaTAX; X = A. This is our result. [98e8]60RTS
;============================================================================ ; TODO: Document Password_DecodeValue ; ; INPUTS: ; Y ; ; OUTPUTS: ; A ; ; XREFS: ; Password_DecodeValueList ; Password_DecodeValueOrUnset ; Password_GetNext6Bits ; Password_Load ;============================================================================
[98e9]Password_DecodeValue: [98e9]8aTXA [98ea]48PHA [98eb]a9 00LDA #$00 [98ed]@LAB_PRG12__98ed: [98ed]ae c9 04LDX a:Password_ByteCounter [98f0]1e cd 04ASL a:Password_EncodedState,X [98f3]2aROL A [98f4]ee ca 04INC a:Password_BitCounter [98f7]ae ca 04LDX a:Password_BitCounter [98fa]e0 08CPX #$08 [98fc]d0 08BNE @LAB_PRG12__9906 [98fe]ee c9 04INC a:Password_ByteCounter [9901]a2 00LDX #$00 [9903]8e ca 04STX a:Password_BitCounter [9906]@LAB_PRG12__9906: [9906]88DEY [9907]d0 e4BNE @LAB_PRG12__98ed [9909]85 ecSTA Temp_Int24 [990b]68PLA [990c]aaTAX [990d]a5 ecLDA Temp_Int24 [990f]60RTS
;============================================================================ ; Fill a textbox with 4 lines of placeholder text. ; ; This will first clear any existing text tiles and then ; place 4 rows of placeholder text (letters and characters), ; ensuring the size and coordinates of the finished textbox. ; ; The text will not be displayed. ; ; INPUTS: ; None. ; ; OUTPUTS: ; None. ; ; CALLS: ; TextBox_ClearTextTiles ; TextBox_FillPlaceholderTextAtLineWithStartChar ; PPU_SetAddrForTextBoxPos ; ; XREFS: ; IScripts_PositionAndFillPlaceholderText ;============================================================================
[9910]IScripts_FillPlaceholderText:
; ; Clear the textbox and prepare to write to it. ;
[9910]20 4a f4JSR TextBox_ClearTextTiles; Clear the existing text tiles. [9913]20 04 f8JSR PPU_SetAddrForTextBoxPos; Set the PPU address for the text position to write to.
; ; Write 4 lines of arbitrary characters. ;
[9916]a0 40LDY #$40 [9918]20 d9 f5JSR TextBox_FillPlaceholderTextAtLineWithStartChar; Write "@ABCDEFGHIJKLMNO" [991b]a0 50LDY #$50 [991d]20 d9 f5JSR TextBox_FillPlaceholderTextAtLineWithStartChar; Write "PQRSTUVWXYZ[\]^_" [9920]a0 60LDY #$60 [9922]20 d9 f5JSR TextBox_FillPlaceholderTextAtLineWithStartChar; Write "`abcdefghijklmno" [9925]a0 70LDY #$70 [9927]4c d9 f5JMP TextBox_FillPlaceholderTextAtLineWithStartChar; Write "pqrstuvwxyz{|}~."
;============================================================================ ; TODO: Document TextBox_CheckShouldContinue ; ; INPUTS: ; None. ; ; OUTPUTS: ; C ; ; XREFS: ; IScriptAction_ShowUnskippableMessage ;============================================================================
[992a]TextBox_CheckShouldContinue: [992a]ad 13 02LDA a:MessageID [992d]d0 09BNE @LAB_PRG12__9938
; ; There is no message ID set. ;
[992f]20 be 99JSR TextBox_DrawUpArrowTerminatorSymbol [9932]a5 19LDA Joy1_ChangedButtonMask [9934]10 11BPL @LAB_PRG12__9947 [9936]38SEC [9937]60RTS [9938]@LAB_PRG12__9938: [9938]ad 15 02LDA a:TextBox_MessagePaused [993b]f0 0aBEQ @LAB_PRG12__9947
; ; An existing message has ended. ;
[993d]20 a1 99JSR TextBox_DrawDownArrowTerminatorSymbol [9940]a5 19LDA Joy1_ChangedButtonMask [9942]10 03BPL @LAB_PRG12__9947 [9944]20 49 99JSR TextBox_PrepareContinueMessage [9947]@LAB_PRG12__9947: [9947]18CLC [9948]60RTS
;============================================================================ ; TODO: Document TextBox_PrepareContinueMessage ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; TextBox_CheckForDismiss ; TextBox_CheckShouldContinue ; TextBox_CheckShouldContinueOrDismissQuestion ;============================================================================
[9949]TextBox_PrepareContinueMessage: [9949]a9 00LDA #$00 [994b]8d 15 02STA a:TextBox_MessagePaused [994e]a9 04LDA #$04 [9950]8d 1b 02STA a:Unused_Arg_Text_NumLines [9953]4c 39 f5JMP TextBox_ShowMessage_Prepare4Lines
;============================================================================ ; Check if the message should be continued or dismissed. ; ; INPUTS: ; MessageID: ; The ID of the message being displayed. ; ; Joy1_ChangedButtonMask: ; The newly-pressed buttons. ; ; OUTPUTS: ; A: ; Clobbered. ; ; C: ; 0 = Don't dismiss (B not pressed) ; 1 = Dismiss (B pressed) ; ; Z: ; 0 = Message finished ; 1 = Continue writing message ; ; CALLS: ; TextBox_CheckForDismiss ; TextBox_DrawUpArrowTerminatorSymbol ; TextBox_SetContinueWriteMessage ; ; XREFS: ; IScriptAction_OpenShop ; IScriptAction_ShowMessage ; IScriptAction_ShowSellMenu ; IScripts_ShowFinalMessage ;============================================================================
[9956]TextBox_CheckShouldContinueOrDismissMessage: [9956]ad 13 02LDA a:MessageID; Load the message ID. [9959]d0 0eBNE TextBox_CheckForDismiss; If set, check if the message is dismissed and return the result. [995b]20 be 99JSR TextBox_DrawUpArrowTerminatorSymbol; Draw the Up arrow terminator symbol.
; ; The message is unloaded, so it finished. Check if the ; player has pressed the B button to close the textbox. ;
[995e]a5 19LDA Joy1_ChangedButtonMask; Load the changed button mask. [9960]30 1aBMI TextBox_SetContinueWriteMessage; If A is pressed, continue writing. Else, check for dismiss.
; ; v-- Fall through --v ;
;============================================================================ ; Dismiss the textbox if B is pressed, else continue on. ; ; INPUTS: ; Joy1_ChangedButtonMask: ; The changed buttons on controller 1. ; ; OUTPUTS: ; A: ; Set to 1 (continue if not dismissed). ; ; C: ; 0 = B not pressed (don't dismiss). ; 1 = B pressed (dismiss). ; ; Z: ; Set to 0 (don't wait for input). ; ; XREFS: ; TextBox_CheckForDismiss ; TextBox_CheckShouldContinueOrDismissQuestion ;============================================================================
[9962]TextBox_DismissIfBElseContinue: [9962]a5 19LDA Joy1_ChangedButtonMask; Load the changed button mask. [9964]0aASL A; Shift the B button flag into Carry. [9965]0aASL A [9966]a9 01LDA #$01; Set A=1 to indicate to continue if not dismissed. [9968]60RTS; Return.
;============================================================================ ; Check if the message has been dismissed. ; ; The message will be dismissed if it's: ; ; 1. Not paused, and ; 2. B is pressed, and ; 3. A is not pressed. ; ; INPUTS: ; Joy1_ChangedButtonMask: ; The joystick button changed mask. ; ; TextBox_MessagePaused: ; Whether the message has been paused. ; ; OUTPUTS: ; A: ; Clobbered. ; ; C: ; 0 = Not dismissed. ; 1 = Dismissed. ; ; Z: ; Set to 0 (message finished). ; ; CALLS: ; TextBox_DrawDownArrowTerminatorSymbol ; TextBox_DismissIfBElseContinue ; TextBox_PrepareContinueMessage ; ; XREFS: ; TextBox_CheckShouldContinueOrDismissMessage ;============================================================================
[9969]TextBox_CheckForDismiss:
; ; Check if the message is dismissed. This will be the case ; if the B button is pressed and the message is not paused. ;
[9969]ad 15 02LDA a:TextBox_MessagePaused; Is the message paused? [996c]f0 f4BEQ TextBox_DismissIfBElseContinue; If not, dismiss if B is pressed, else continue. [996e]20 a1 99JSR TextBox_DrawDownArrowTerminatorSymbol; Draw the down arrow terminator symbol. [9971]a5 19LDA Joy1_ChangedButtonMask; Is the A button pressed?
; ; Check if the player pressed A to continue or B to dismiss. ;
[9973]10 edBPL TextBox_DismissIfBElseContinue; If not, dismiss if B is pressed.
; ; A was pressed. Continue the message. ;
[9975]20 49 99JSR TextBox_PrepareContinueMessage; Continue the message. [9978]18CLC; Set C=0 to indicate not dismissed. [9979]a9 01LDA #$01; Set A=1 to indicate to continue. [997b]60RTS; And return.
;============================================================================ ; Set state indicating the message should continue to display. ; ; INPUTS: ; None. ; ; OUTPUTS: ; A: ; Clobbered. ; ; C: ; Set to 0 (not dismissed). ; ; Z: ; Set to 1 (continue writing). ; ; XREFS: ; TextBox_CheckShouldContinueOrDismissMessage ; TextBox_CheckShouldContinueOrDismissQuestion ;============================================================================
[997c]TextBox_SetContinueWriteMessage: [997c]18CLC [997d]a9 00LDA #$00 [997f]60RTS
;============================================================================ ; TODO: Document TextBox_CheckShouldContinueOrDismissQuestion ; ; INPUTS: ; None. ; ; OUTPUTS: ; C ; ; XREFS: ; IScriptAction_ShowQuestionMessage ; IScriptAction_ShowQuestionMessageCheckIfDismissed ;============================================================================
[9980]TextBox_CheckShouldContinueOrDismissQuestion: [9980]ad 13 02LDA a:MessageID [9983]d0 09BNE @LAB_PRG12__998e [9985]20 db 99JSR TextBox_DrawQuestionMarkTerminatorSymbol [9988]a5 19LDA Joy1_ChangedButtonMask [998a]30 f0BMI TextBox_SetContinueWriteMessage [998c]10 d4BPL TextBox_DismissIfBElseContinue [998e]@LAB_PRG12__998e: [998e]ad 15 02LDA a:TextBox_MessagePaused [9991]f0 cfBEQ TextBox_DismissIfBElseContinue [9993]20 a1 99JSR TextBox_DrawDownArrowTerminatorSymbol [9996]a5 19LDA Joy1_ChangedButtonMask [9998]10 c8BPL TextBox_DismissIfBElseContinue [999a]20 49 99JSR TextBox_PrepareContinueMessage [999d]18CLC; Set C=0 to indicate not dismissed. [999e]a9 01LDA #$01; Set A=1 to indicate to continue.
; ; XREFS: ; TextBox_DrawDownArrowTerminatorSymbol ; TextBox_DrawQuestionMarkTerminatorSymbol ; TextBox_DrawUpArrowTerminatorSymbol ;
[99a0]RETURN_99A0: [99a0]60RTS
;============================================================================ ; Draw the down arrow terminator symbol. ; ; This will draw the down arrow symbol at the bottom of the ; textbox. ; ; The symbol will appear to flash due to the textbox being ; redrawn in-between viable interrupt-based updates. ; ; INPUTS: ; InterruptCounter: ; The current interrupt counter, used to rate limit ; updates. ; ; TextBox_X: ; The tile X position of the textbox. ; ; TextBox_Y: ; The tile Y position of the textbox. ; ; OUTPUTS: ; None. ; ; CALLS: ; UI_DrawPromptInputSymbol ; ; XREFS: ; TextBox_CheckForDismiss ; TextBox_CheckShouldContinue ; TextBox_CheckShouldContinueOrDismissQuestion ;============================================================================
[99a1]TextBox_DrawDownArrowTerminatorSymbol: [99a1]a5 1aLDA InterruptCounter; Load the interrupt counter. [99a3]29 10AND #$10; Is bit 5 set? [99a5]f0 f9BEQ RETURN_99A0; If not, return (allowing it to clear).
; ; Compute an X position for the symbol. ;
[99a7]ad 08 02LDA a:TextBox_X; Load the textbox X coordinate. [99aa]0aASL A; Convert to a pixel position. [99ab]0aASL A [99ac]0aASL A [99ad]69 4cADC #$4c; Add 76. [99af]aaTAX; X = result.
; ; Compute a Y position for the symbol. ;
[99b0]ad 09 02LDA a:TextBox_Y; Load the textbox Y coordinate. [99b3]0aASL A; Convert to a pixel position. [99b4]0aASL A [99b5]0aASL A [99b6]69 10ADC #$10; Add 16. [99b8]a8TAY; Y = result.
; ; Draw the symbol. ;
[99b9]a9 e5LDA #$e5; A = 0xE5 (animation frame offset). [99bb]4c a7 fcJMP UI_DrawPromptInputSymbol; Draw the symbol.
;============================================================================ ; Draw the up arrow terminator symbol. ; ; This will draw the up arrow symbol at the bottom-right of ; the textbox. This is used for the Guru, Add Inventory Item, ; and other textboxes. ; ; The symbol will appear to flash due to the textbox being ; redrawn in-between viable interrupt-based updates. ; ; INPUTS: ; InterruptCounter: ; The current interrupt counter, used to rate limit ; updates. ; ; TextBox_X: ; The tile X position of the textbox. ; ; TextBox_Y: ; The tile Y position of the textbox. ; ; OUTPUTS: ; None. ; ; CALLS: ; UI_DrawPromptInputSymbol ; ; XREFS: ; IScriptAction_AddInventoryItem ; IScriptAction_ShowPassword ; TextBox_CheckShouldContinue ; TextBox_CheckShouldContinueOrDismissMessage ;============================================================================
[99be]TextBox_DrawUpArrowTerminatorSymbol: [99be]a5 1aLDA InterruptCounter; Load the interrupt counter. [99c0]29 10AND #$10; Is bit 5 set? [99c2]f0 dcBEQ RETURN_99A0; If not, return (allowing it to clear).
; ; Compute an X position for the symbol. ;
[99c4]ad 08 02LDA a:TextBox_X; Load the textbox X coordinate. [99c7]0aASL A; Convert to a pixel position. [99c8]0aASL A [99c9]0aASL A [99ca]69 8eADC #$8e; Add 142. [99cc]aaTAX; X = result.
; ; Compute a Y position for the symbol. ;
[99cd]ad 09 02LDA a:TextBox_Y; Load the textbox Y coordinate. [99d0]0aASL A; Convert to a pixel position. [99d1]0aASL A [99d2]0aASL A [99d3]69 0eADC #$0e; Add 14. [99d5]a8TAY; Y = result.
; ; Draw the symbol. ;
[99d6]a9 e6LDA #$e6; A = 0xE6 (up arrow symbol). [99d8]4c a7 fcJMP UI_DrawPromptInputSymbol; Draw the symbol.
;============================================================================ ; Draw the question mark terminator symbol. ; ; This will draw the question mark symbol at the ; bottom-right of the textbox. This is used for the Guru, ; Add Inventory Item, and other textboxes. ; ; The symbol will appear to flash due to the textbox being ; redrawn in-between viable interrupt-based updates. ; ; INPUTS: ; InterruptCounter: ; The current interrupt counter, used to rate limit ; updates. ; ; TextBox_X: ; The tile X position of the textbox. ; ; TextBox_Y: ; The tile Y position of the textbox. ; ; OUTPUTS: ; None. ; ; CALLS: ; UI_DrawPromptInputSymbol ; ; XREFS: ; TextBox_CheckShouldContinueOrDismissQuestion ;============================================================================
[99db]TextBox_DrawQuestionMarkTerminatorSymbol: [99db]a5 1aLDA InterruptCounter; Load the interrupt counter. [99dd]29 10AND #$10; Is bit 5 set? [99df]f0 bfBEQ RETURN_99A0; If not, return (allowing it to clear).
; ; Compute an X position for the symbol. ;
[99e1]ad 08 02LDA a:TextBox_X; Load the textbox X coordinate. [99e4]0aASL A; Convert to a pixel position. [99e5]0aASL A [99e6]0aASL A [99e7]69 4cADC #$4c; Add 76. [99e9]aaTAX; X = result.
; ; Compute a Y position for the symbol. ;
[99ea]ad 09 02LDA a:TextBox_Y; Load the textbox Y coordinate. [99ed]0aASL A; Convert to a pixel position. [99ee]0aASL A [99ef]0aASL A [99f0]69 10ADC #$10; Add 16. [99f2]a8TAY; Y = result.
; ; Draw the symbol. ;
[99f3]a9 e7LDA #$e7; A = 0xE7 (question mark symbol) [99f5]4c a7 fcJMP UI_DrawPromptInputSymbol; Draw the symbol.
;============================================================================ ; TODO: Document Shop_Draw ; ; INPUTS: ; Y ; ; OUTPUTS: ; TODO ; ; XREFS: ; IScriptAction_OpenShop ; IScriptAction_ShowSellMenu ;============================================================================
[99f8]Shop_Draw: [99f8]a9 0aLDA #$0a [99fa]8d 08 02STA a:TextBox_X [99fd]a9 08LDA #$08 [99ff]8d 09 02STA a:TextBox_Y [9a02]a9 14LDA #$14 [9a04]8d 0a 02STA a:TextBox_Width [9a07]a9 14LDA #$14 [9a09]8d 0b 02STA a:TextBox_Height [9a0c]20 f1 8eJSR TextBox_Open [9a0f]ad 09 02LDA a:TextBox_Y [9a12]18CLC [9a13]69 02ADC #$02 [9a15]85 ebSTA TextBox_ContentsY [9a17]a2 00LDX #$00 [9a19]8e 1e 02STX a:Menu_CursorPos [9a1c]@LAB_PRG12__9a1c: [9a1c]8aTXA [9a1d]48PHA [9a1e]ad 08 02LDA a:TextBox_X [9a21]18CLC [9a22]69 02ADC #$02 [9a24]85 eaSTA TextBox_ContentsX [9a26]8aTXA [9a27]48PHA [9a28]bd 20 02LDA a:DataArray,X [9a2b]20 58 8cJSR TextBox_DrawItemImage [9a2e]68PLA [9a2f]aaTAX [9a30]bd 30 02LDA a:ShopItemCostsU,X [9a33]48PHA [9a34]bd 28 02LDA a:ShopItemCostsL,X [9a37]48PHA [9a38]ad 08 02LDA a:TextBox_X [9a3b]18CLC [9a3c]69 05ADC #$05 [9a3e]85 eaSTA TextBox_ContentsX [9a40]bd 20 02LDA a:DataArray,X [9a43]20 36 8cJSR TextBox_DrawItemName [9a46]68PLA [9a47]85 ecSTA Temp_Int24 [9a49]68PLA [9a4a]85 edSTA Temp_Int24_M [9a4c]a9 00LDA #$00 [9a4e]85 eeSTA Temp_Int24_U [9a50]ad 08 02LDA a:TextBox_X [9a53]18CLC [9a54]69 0dADC #$0d [9a56]85 eaSTA TextBox_ContentsX [9a58]e6 ebINC TextBox_ContentsY [9a5a]a0 05LDY #$05 [9a5c]20 26 faJSR UI_DrawDigitsNoLeadingZeroes [9a5f]e6 ebINC TextBox_ContentsY [9a61]68PLA [9a62]aaTAX [9a63]e8INX [9a64]ec 1f 02CPX a:Arg_StringsCount [9a67]d0 b3BNE @LAB_PRG12__9a1c [9a69]60RTS
;============================================================================ ; TODO: Document Player_RemoveItem ; ; INPUTS: ; A ; ; OUTPUTS: ; TODO ; ; XREFS: ; IScriptAction_ConsumeItem ; IScriptAction_ShowSellMenu ; Player_Equip ;============================================================================
[9a6a]Player_RemoveItem: [9a6a]a2 00LDX #$00 [9a6c]c9 80CMP #$80 [9a6e]f0 5bBEQ @_isSpecialItem [9a70]e8INX [9a71]c9 81CMP #$81 [9a73]f0 56BEQ @_isSpecialItem [9a75]e8INX [9a76]c9 82CMP #$82 [9a78]f0 51BEQ @_isSpecialItem [9a7a]e8INX [9a7b]c9 83CMP #$83 [9a7d]f0 4cBEQ @_isSpecialItem [9a7f]e8INX [9a80]c9 92CMP #$92 [9a82]f0 47BEQ @_isSpecialItem [9a84]e8INX [9a85]c9 8aCMP #$8a [9a87]f0 42BEQ @_isSpecialItem [9a89]e8INX [9a8a]c9 93CMP #$93 [9a8c]f0 3dBEQ @_isSpecialItem [9a8e]e8INX [9a8f]c9 94CMP #$94 [9a91]f0 38BEQ @_isSpecialItem [9a93]85 eeSTA Temp_Int24_U [9a95]20 85 f7JSR Player_GetInventoryIndexForItem [9a98]aaTAX [9a99]bd c2 03LDA a:NumberOfWeapons,X [9a9c]f0 2cBEQ @_return [9a9e]85 efSTA Temp_0xEF [9aa0]bd 29 9bLDA a:INVENTORY_CATEGORY_L,X [9aa3]85 ecSTA Temp_Int24 [9aa5]bd 2e 9bLDA a:INVENTORY_CATEGORY_U,X [9aa8]85 edSTA Temp_Int24_M [9aaa]a0 00LDY #$00 [9aac]a5 eeLDA Temp_Int24_U [9aae]29 1fAND #$1f [9ab0]@_inventoryCheckLoop: [9ab0]d1 ecCMP (Temp_Int24),Y [9ab2]f0 06BEQ @_moveInventoryLoop [9ab4]c8INY [9ab5]c4 efCPY Temp_0xEF [9ab7]d0 f7BNE @_inventoryCheckLoop [9ab9]60RTS [9aba]@_moveInventoryLoop: [9aba]c8INY [9abb]c4 efCPY Temp_0xEF [9abd]f0 08BEQ @_updateCountAndReturn [9abf]b1 ecLDA (Temp_Int24),Y [9ac1]88DEY [9ac2]91 ecSTA (Temp_Int24),Y [9ac4]c8INY [9ac5]d0 f3BNE @_moveInventoryLoop [9ac7]@_updateCountAndReturn: [9ac7]de c2 03DEC a:NumberOfWeapons,X [9aca]@_return: [9aca]60RTS [9acb]@_isSpecialItem: [9acb]ad 2c 04LDA a:SpecialItems [9ace]3d d5 9aAND a:SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS,X [9ad1]8d 2c 04STA a:SpecialItems [9ad4]60RTS
; ; XREFS: ; Player_RemoveItem ;
[9ad5]SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS: [9ad5]7f.byte $7f; [0]: Clear Ring of Elf
; ; XREFS: ; Player_RemoveItem ;
[9ad6]SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS_1_: [9ad6]bf.byte $bf; [1]: Clear Ring of Ruby
; ; XREFS: ; Player_RemoveItem ;
[9ad7]SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS_2_: [9ad7]df.byte $df; [2]: Clear Ring of Dworf
; ; XREFS: ; Player_RemoveItem ;
[9ad8]SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS_3_: [9ad8]ef.byte $ef; [3]: Clear Demon's Ring
; ; XREFS: ; Player_RemoveItem ;
[9ad9]SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS_4_: [9ad9]f7.byte $f7; [4]: Clear Elixir
; ; XREFS: ; Player_RemoveItem ;
[9ada]SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS_5_: [9ada]fb.byte $fb; [5]: Clear Magical Rod
; ; XREFS: ; Player_RemoveItem ;
[9adb]SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS_6_: [9adb]fd.byte $fd; [6]: Clear Pendant
; ; XREFS: ; Player_RemoveItem ;
[9adc]SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS_7_: [9adc]fe.byte $fe; [7]: Clear Black Onyx [9add]SPECIAL_ITEM_IDS: [9add]80.byte SPECIAL_RING_OF_ELF; [0]: [9ade]81.byte SPECIAL_RING_OF_RUBY; [1]: [9adf]82.byte SPECIAL_RING_OF_DWORF; [2]: [9ae0]83.byte SPECIAL_DEMONS_RING; [3]: [9ae1]92.byte SPECIAL_ELIXIR; [4]: [9ae2]8a.byte SPECIAL_MAGICAL_ROD; [5]:
; ; XREFS: ; Player_AddToInventory ;
[9ae3]SPECIAL_ITEM_IDS_6_: [9ae3]93.byte SPECIAL_PENDANT; [6]:
; ; XREFS: ; Player_AddToInventory ;
[9ae4]SPECIAL_ITEM_IDS_7_: [9ae4]94.byte SPECIAL_BLACK_ONYX; [7]: [9ae5]SPECIAL_ITEM_BITMASKS: [9ae5]80.byte $80; [0]: [9ae6]40.byte $40; [1]: [9ae7]20.byte $20; [2]: [9ae8]10.byte $10; [3]: [9ae9]08.byte $08; [4]: [9aea]04.byte $04; [5]: [9aeb]02.byte $02; [6]:
; ; XREFS: ; Player_AddSpecialItem ;
[9aec]BYTE_PRG12__9aec: [9aec]01.byte $01; byte
;============================================================================ ; TODO: Document Player_AddSpecialItem ; ; INPUTS: ; X ; ; OUTPUTS: ; TODO ; ; XREFS: ; Player_AddToInventory ;============================================================================
[9aed]Player_AddSpecialItem: [9aed]ad 2c 04LDA a:SpecialItems [9af0]1d e5 9aORA a:SPECIAL_ITEM_BITMASKS,X [9af3]8d 2c 04STA a:SpecialItems [9af6]60RTS
;============================================================================ ; TODO: Document Player_AddToInventory ; ; INPUTS: ; A ; ; OUTPUTS: ; TODO ; ; XREFS: ; IScriptAction_AddInventoryItem ; IScriptAction_OpenShop ; Player_Equip ;============================================================================
[9af7]Player_AddToInventory: [9af7]a2 07LDX #$07; i = 7; Loop through item bits. [9af9]@_checkSpecialItems: [9af9]dd dd 9aCMP a:SPECIAL_ITEM_IDS,X; Check if this is a special, non-consumable item [9afc]f0 efBEQ Player_AddSpecialItem; If this is a special item... [9afe]caDEX; Next i [9aff]10 f8BPL @_checkSpecialItems [9b01]85 eeSTA Temp_Int24_U [9b03]20 85 f7JSR Player_GetInventoryIndexForItem; Convert the item ID to a category. [9b06]aaTAX [9b07]bd 29 9bLDA a:INVENTORY_CATEGORY_L,X [9b0a]85 ecSTA Temp_Int24 [9b0c]bd 2e 9bLDA a:INVENTORY_CATEGORY_U,X [9b0f]85 edSTA Temp_Int24_M
; ; Check if the maximum has been reached for the inventory category. ;
[9b11]bd c2 03LDA a:NumberOfWeapons,X; Load the number of items in the inventory category [9b14]dd 7d 84CMP a:MAX_INVENTORY_SLOTS,X; Check if the max has been hit [9b17]d0 03BNE @_addItem [9b19]de c2 03DEC a:NumberOfWeapons,X; The max has been hit. Remove one. [9b1c]@_addItem: [9b1c]bc c2 03LDY a:NumberOfWeapons,X [9b1f]a5 eeLDA Temp_Int24_U [9b21]29 1fAND #$1f [9b23]91 ecSTA (Temp_Int24),Y [9b25]fe c2 03INC a:NumberOfWeapons,X; Increase the length of the inventory [9b28]60RTS
;============================================================================ ; Lower nibble lookup table for inventory category addresses ; ; XREFS: ; PlayerMenu_ShowInventoryMenu ; Player_AddToInventory ; Player_LacksItem ; Player_RemoveItem ; Shop_GetPlayerHasSelectedItem ;============================================================================
; ; XREFS: ; PlayerMenu_ShowInventoryMenu ; Player_AddToInventory ; Player_LacksItem ; Player_RemoveItem ; Shop_GetPlayerHasSelectedItem ;
[9b29]INVENTORY_CATEGORY_L: [9b29]9d.byte $9d; [0]: Weapons [9b2a]a1.byte $a1; [1]: Armor [9b2b]a5.byte $a5; [2]: Shields [9b2c]a9.byte $a9; [3]: Magic
; ; XREFS: ; IScriptAction_ShowSellMenu ;
[9b2d]INVENTORY_CATEGORY_L_4_: [9b2d]ad.byte $ad; [4]: Items
;============================================================================ ; Upper nibble lookup table for inventory category addresses ; ; XREFS: ; PlayerMenu_ShowInventoryMenu ; Player_AddToInventory ; Player_LacksItem ; Player_RemoveItem ; Shop_GetPlayerHasSelectedItem ;============================================================================
; ; XREFS: ; PlayerMenu_ShowInventoryMenu ; Player_AddToInventory ; Player_LacksItem ; Player_RemoveItem ; Shop_GetPlayerHasSelectedItem ;
[9b2e]INVENTORY_CATEGORY_U: [9b2e]03.byte $03; [0]: Weapons [9b2f]03.byte $03; [1]: Armor [9b30]03.byte $03; [2]: Shields [9b31]03.byte $03; [3]: Magic
; ; XREFS: ; IScriptAction_ShowSellMenu ;
[9b32]INVENTORY_CATEGORY_U_4_: [9b32]03.byte $03; [4]: Special
; ; XREFS: ; TextBox_DrawItemName ;
[9b33]ITEM_NAME_CATEGORIES_L: [9b33]3d.byte <ITEM_NAMES_WEAPONS; [0]: [9b34]7d.byte <ITEM_NAMES_ARMOR; [1]: [9b35]bd.byte <ITEM_NAMES_SHIELDS; [2]: [9b36]fd.byte <ITEM_NAMES_MAGIC; [3]: [9b37]4d.byte <ITEM_NAMES_KEYS; [4]:
; ; XREFS: ; TextBox_DrawItemName ;
[9b38]ITEM_NAME_CATEGORIES_U: [9b38]9b.byte >ITEM_NAMES_WEAPONS; [0]: [9b39]9b.byte >ITEM_NAMES_ARMOR; [1]: [9b3a]9b.byte >ITEM_NAMES_SHIELDS; [2]: [9b3b]9b.byte >ITEM_NAMES_MAGIC; [3]: [9b3c]9c.byte >ITEM_NAMES_KEYS; [4]:
; ; XREFS: ; ITEM_NAME_CATEGORIES_L [$PRG12::9b33] ; ITEM_NAME_CATEGORIES_U [$PRG12::9b38] ;
[9b3d]ITEM_NAMES_WEAPONS: [9b3d]0d 48 41 4e 44 20 44 41.byte $0d,"HAND DA"; char [9b45]47 47 45 52 20 20 20 20.byte "GGER "; char [9b4d]0d 4c 4f 4e 47 20 53 57.byte $0d,"LONG SW"; char [9b55]4f 52 44 20 20 20 20 20.byte "ORD "; char [9b5d]0d 47 49 41 4e 54 20 42.byte $0d,"GIANT B"; char [9b65]4c 41 44 45 20 20 20 20.byte "LADE "; char [9b6d]0d 44 52 41 47 4f 4e 20.byte $0d,"DRAGON "; char [9b75]53 4c 41 59 45 52 20 20.byte "SLAYER "; char
; ; XREFS: ; ITEM_NAME_CATEGORIES_L [$PRG12::9b34] ; ITEM_NAME_CATEGORIES_U [$PRG12::9b39] ;
[9b7d]ITEM_NAMES_ARMOR: [9b7d]0d 4c 45 41 54 48 45 52.byte $0d,"LEATHER"; char [9b85]20 41 52 4d 4f 52 20 20.byte " ARMOR "; char [9b8d]0d 53 54 55 44 44 45 44.byte $0d,"STUDDED"; char [9b95]20 4d 41 49 4c 20 20 20.byte " MAIL "; char [9b9d]0d 46 55 4c 4c 20 50 4c.byte $0d,"FULL PL"; char [9ba5]41 54 45 20 20 20 20 20.byte "ATE "; char [9bad]0d 42 41 54 54 4c 45 20.byte $0d,"BATTLE "; char [9bb5]53 55 49 54 20 20 20 20.byte "SUIT "; char
; ; XREFS: ; ITEM_NAME_CATEGORIES_L [$PRG12::9b35] ; ITEM_NAME_CATEGORIES_U [$PRG12::9b3a] ;
[9bbd]ITEM_NAMES_SHIELDS: [9bbd]0d 53 4d 41 4c 4c 20 53.byte $0d,"SMALL S"; char [9bc5]48 49 45 4c 44 20 20 20.byte "HIELD "; char [9bcd]0d 4c 41 52 47 45 20 53.byte $0d,"LARGE S"; char [9bd5]48 49 45 4c 44 20 20 20.byte "HIELD "; char [9bdd]0d 4d 41 47 49 43 20 53.byte $0d,"MAGIC S"; char [9be5]48 49 45 4c 44 20 20 20.byte "HIELD "; char [9bed]0d 42 41 54 54 4c 45 20.byte $0d,"BATTLE "; char [9bf5]48 45 4c 4d 45 54 20 20.byte "HELMET "; char
; ; XREFS: ; ITEM_NAME_CATEGORIES_L [$PRG12::9b36] ; ITEM_NAME_CATEGORIES_U [$PRG12::9b3b] ;
[9bfd]ITEM_NAMES_MAGIC: [9bfd]0d 44 45 4c 55 47 45 20.byte $0d,"DELUGE "; char [9c05]20 20 20 20 20 20 20 20.byte " "; char [9c0d]0d 54 48 55 4e 44 45 52.byte $0d,"THUNDER"; char [9c15]20 20 20 20 20 20 20 20.byte " "; char [9c1d]0d 46 49 52 45 20 20 20.byte $0d,"FIRE "; char [9c25]20 20 20 20 20 20 20 20.byte " "; char [9c2d]0d 44 45 41 54 48 20 20.byte $0d,"DEATH "; char [9c35]20 20 20 20 20 20 20 20.byte " "; char [9c3d]0d 54 49 4c 54 45 20 20.byte $0d,"TILTE "; char [9c45]20 20 20 20 20 20 20 20.byte " "; char
; ; XREFS: ; ITEM_NAME_CATEGORIES_L [$PRG12::9b37] ; ITEM_NAME_CATEGORIES_U [$PRG12::9b3c] ;
[9c4d]ITEM_NAMES_KEYS: [9c4d]0d 52 49 4e 47 20 4f 46.byte $0d,"RING OF"; char [9c55]20 45 4c 46 20 20 20 20.byte " ELF "; char [9c5d]0d 52 55 42 59 20 52 49.byte $0d,"RUBY RI"; char [9c65]4e 47 20 20 20 20 20 20.byte "NG "; char [9c6d]0d 52 49 4e 47 20 4f 46.byte $0d,"RING OF"; char [9c75]20 44 57 4f 52 46 20 20.byte " DWORF "; char [9c7d]0d 44 45 4d 4f 4e 53 20.byte $0d,"DEMONS "; char [9c85]52 49 4e 47 20 20 20 20.byte "RING "; char [9c8d]0d 4b 45 59 20 41 20 20.byte $0d,"KEY A "; char [9c95]20 20 20 20 20 20 20 20.byte " "; char [9c9d]0d 4b 45 59 20 4b 20 20.byte $0d,"KEY K "; char [9ca5]20 20 20 20 20 20 20 20.byte " "; char [9cad]0d 4b 45 59 20 51 20 20.byte $0d,"KEY Q "; char [9cb5]20 20 20 20 20 20 20 20.byte " "; char [9cbd]0d 4b 45 59 20 4a 20 20.byte $0d,"KEY J "; char [9cc5]20 20 20 20 20 20 20 20.byte " "; char [9ccd]0d 4b 45 59 20 4a 4f 20.byte $0d,"KEY JO "; char [9cd5]20 20 20 20 20 20 20 20.byte " "; char [9cdd]0d 4d 41 54 54 4f 43 4b.byte $0d,"MATTOCK"; char [9ce5]20 20 20 20 20 20 20 20.byte " "; char [9ced]0d 52 4f 44 20 20 20 20.byte $0d,"ROD "; char [9cf5]20 20 20 20 20 20 20 20.byte " "; char [9cfd]0d 43 52 59 53 54 41 4c.byte $0d,"CRYSTAL"; char [9d05]20 20 20 20 20 20 20 20.byte " "; char [9d0d]0d 4c 41 4d 50 20 20 20.byte $0d,"LAMP "; char [9d15]20 20 20 20 20 20 20 20.byte " "; char [9d1d]0d 48 4f 55 52 20 47 4c.byte $0d,"HOUR GL"; char [9d25]41 53 53 20 20 20 20 20.byte "ASS "; char [9d2d]0d 42 4f 4f 4b 20 20 20.byte $0d,"BOOK "; char [9d35]20 20 20 20 20 20 20 20.byte " "; char [9d3d]0d 57 49 4e 47 20 42 4f.byte $0d,"WING BO"; char [9d45]4f 54 53 20 20 20 20 20.byte "OTS "; char [9d4d]0d 52 45 44 20 50 4f 54.byte $0d,"RED POT"; char [9d55]49 4f 4e 20 20 20 20 20.byte "ION "; char [9d5d]0d 42 4c 41 43 4b 20 50.byte $0d,"BLACK P"; char [9d65]4f 54 49 4f 4e 20 20 20.byte "OTION "; char [9d6d]0d 45 4c 49 58 49 52 20.byte $0d,"ELIXIR "; char [9d75]20 20 20 20 20 20 20 20.byte " "; char [9d7d]0d 50 45 4e 44 41 4e 54.byte $0d,"PENDANT"; char [9d85]20 20 20 20 20 20 20 20.byte " "; char [9d8d]0d 42 4c 41 43 4b 20 4f.byte $0d,"BLACK O"; char [9d95]4e 49 58 20 20 20 20 20.byte "NIX "; char [9d9d]0d 46 49 52 45 20 43 52.byte $0d,"FIRE CR"; char [9da5]59 53 54 41 4c 20 20 20.byte "YSTAL "; char
; ; XREFS: ; StartScreen_Draw ;
[9dad]STARTSCREEEN_PALETTE_SPRITES: [9dad]0f.byte $0f; [0]: [9dae]00.byte $00; [1]: [9daf]10.byte $10; [2]: [9db0]20.byte $20; [3]: [9db1]0f.byte $0f; [4]: [9db2]00.byte $00; [5]: [9db3]10.byte $10; [6]: [9db4]20.byte $20; [7]: [9db5]0f.byte $0f; [8]: [9db6]00.byte $00; [9]: [9db7]10.byte $10; [10]: [9db8]20.byte $20; [11]: [9db9]0f.byte $0f; [12]: [9dba]00.byte $00; [13]: [9dbb]10.byte $10; [14]: [9dbc]20.byte $20; [15]: [9dbd]TEXT_TILES_START: [9dbd]f2.byte $f2; [0]: S [9dbe]f3.byte $f3; [1]: T [9dbf]e0.byte $e0; [2]: A [9dc0]f1.byte $f1; [3]: R [9dc1]f3.byte $f3; [4]: T [9dc2]00.byte $00; [5]: \0 [9dc3]TEXT_TILES_CONTINUE: [9dc3]e2.byte $e2; [0]: C [9dc4]ee.byte $ee; [1]: O [9dc5]ed.byte $ed; [2]: N [9dc6]f3.byte $f3; [3]: T [9dc7]e8.byte $e8; [4]: I [9dc8]ed.byte $ed; [5]: N [9dc9]f4.byte $f4; [6]: U [9dca]e4.byte $e4; [7]: E [9dcb]00.byte $00; [8]: \0 [9dcc]TEXT_TILES_COPYRIGHT_1998_HUDSON_SOFT: [9dcc]fa.byte $fa; [0]: (C) [9dcd]20.byte $20; [1]: [9dce]d7.byte $d7; [2]: 1 [9dcf]df.byte $df; [3]: 9 [9dd0]de.byte $de; [4]: 9 [9dd1]de.byte $de; [5]: 8 [9dd2]20.byte $20; [6]: [9dd3]e7.byte $e7; [7]: H [9dd4]f4.byte $f4; [8]: U [9dd5]e3.byte $e3; [9]: D [9dd6]f2.byte $f2; [10]: S [9dd7]ee.byte $ee; [11]: O [9dd8]ed.byte $ed; [12]: N [9dd9]20.byte $20; [13]: [9dda]f2.byte $f2; [14]: S [9ddb]ee.byte $ee; [15]: O [9ddc]e5.byte $e5; [16]: F [9ddd]f3.byte $f3; [17]: T [9dde]00.byte $00; [18]: \0 [9ddf]TEXT_TILES_UNDER_LICENSE_FROM_FALCOM: [9ddf]f4.byte $f4; [0]: U [9de0]ed.byte $ed; [1]: N [9de1]e3.byte $e3; [2]: D [9de2]e4.byte $e4; [3]: E [9de3]f1.byte $f1; [4]: R [9de4]20.byte $20; [5]: [9de5]eb.byte $eb; [6]: L [9de6]e8.byte $e8; [7]: I [9de7]e2.byte $e2; [8]: C [9de8]e4.byte $e4; [9]: E [9de9]ed.byte $ed; [10]: N [9dea]f2.byte $f2; [11]: S [9deb]e4.byte $e4; [12]: E [9dec]20.byte $20; [13]: [9ded]e5.byte $e5; [14]: F [9dee]f1.byte $f1; [15]: R [9def]ee.byte $ee; [16]: O [9df0]ec.byte $ec; [17]: M [9df1]20.byte $20; [18]: [9df2]e5.byte $e5; [19]: F [9df3]e0.byte $e0; [20]: A [9df4]eb.byte $eb; [21]: L [9df5]e2.byte $e2; [22]: C [9df6]ee.byte $ee; [23]: O [9df7]ec.byte $ec; [24]: M [9df8]00.byte $00; [25]: \0 [9df9]TEXT_TILES_LICENSED_TO_NINTENDO: [9df9]eb.byte $eb; [0]: L [9dfa]e8.byte $e8; [1]: I [9dfb]e2.byte $e2; [2]: C [9dfc]e4.byte $e4; [3]: E [9dfd]ed.byte $ed; [4]: N [9dfe]f2.byte $f2; [5]: S [9dff]e4.byte $e4; [6]: E [9e00]e3.byte $e3; [7]: D [9e01]20.byte $20; [8]: [9e02]f3.byte $f3; [9]: T [9e03]ee.byte $ee; [10]: O [9e04]20.byte $20; [11]: [9e05]ed.byte $ed; [12]: N [9e06]e8.byte $e8; [13]: I [9e07]ed.byte $ed; [14]: N [9e08]f3.byte $f3; [15]: T [9e09]e4.byte $e4; [16]: E [9e0a]ed.byte $ed; [17]: N [9e0b]e3.byte $e3; [18]: D [9e0c]ee.byte $ee; [19]: O [9e0d]00.byte $00; [20]: \0
;============================================================================ ; TODO: Document UI_DrawText ; ; INPUTS: ; None. ; ; OUTPUTS: ; A ; ; XREFS: ; PasswordScreen_Show ; StartScreen_Draw ;============================================================================
[9e0e]UI_DrawText: [9e0e]a0 00LDY #$00 [9e10]@_loop: [9e10]b1 ecLDA (Temp_Int24),Y [9e12]f0 0cBEQ @_return [9e14]c9 20CMP #$20 [9e16]d0 02BNE @_writePPUData [9e18]a9 00LDA #$00 [9e1a]@_writePPUData: [9e1a]8d 07 20STA a:PPUDATA [9e1d]c8INY [9e1e]d0 f0BNE @_loop [9e20]@_return: [9e20]60RTS
;============================================================================ ; TODO: Document StartScreen_Draw ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ;============================================================================
[9e21]StartScreen_Draw: [9e21]20 f7 caJSR PPU_WaitUntilFlushed
; ; Write 224 Faxanadu logo tiles ; ; From: CHR ROM: Bank 10, 0x8E00: CHR_FAXANADU_LOGO ; To: CHR RAM: 0x1000 ;
[9e24]a9 00LDA #<CHR_FAXANADU_LOGO [9e26]85 dbSTA IScriptOrCHRAddr [9e28]a9 8eLDA #>CHR_FAXANADU_LOGO [9e2a]85 dcSTA IScriptOrCHRAddr_U [9e2c]a9 00LDA #$00 [9e2e]85 e8STA PPU_TargetAddr [9e30]a9 10LDA #$10 [9e32]85 e9STA PPU_TargetAddr_U [9e34]a2 0aLDX #$0a [9e36]a0 e0LDY #$e0 [9e38]20 9e f8JSR PPU_WriteTilesFromCHRRAM
; ; Write 27 letter tiles: ; ; From: CHR ROM: Bank 10, 0x8240: CHR_LETTERS ; To: CHR RAM: 0x1E00 ;
[9e3b]a9 40LDA #<CHR_LETTERS [9e3d]85 dbSTA IScriptOrCHRAddr [9e3f]a9 82LDA #>CHR_LETTERS [9e41]85 dcSTA IScriptOrCHRAddr_U [9e43]a9 00LDA #$00 [9e45]85 e8STA PPU_TargetAddr [9e47]a9 1eLDA #$1e [9e49]85 e9STA PPU_TargetAddr_U [9e4b]a2 0aLDX #$0a [9e4d]a0 1bLDY #$1b [9e4f]20 9e f8JSR PPU_WriteTilesFromCHRRAM
; ; Write 10 number tiles: ; ; From: CHR ROM: Bank 10, 0x8440: CHR_NUMBERS ; To: CHR RAM: 0x1D60 ;
[9e52]a9 40LDA #<CHR_NUMBERS [9e54]85 dbSTA IScriptOrCHRAddr [9e56]a9 84LDA #>CHR_NUMBERS [9e58]85 dcSTA IScriptOrCHRAddr_U [9e5a]a9 60LDA #$60 [9e5c]85 e8STA PPU_TargetAddr [9e5e]a9 1dLDA #$1d [9e60]85 e9STA PPU_TargetAddr_U [9e62]a2 0aLDX #$0a [9e64]a0 0aLDY #$0a [9e66]20 9e f8JSR PPU_WriteTilesFromCHRRAM [9e69]20 b9 fcJSR PPU_ClearAllTilemaps
; ; Write 4 attribute values ; ; From: Bank 10, 0x9B60: PRG10:9B60 ; To: Attribute table: 0x23C0 ;
[9e6c]a9 60LDA #<START_SCREEN_PPU_ATTRIBUTES [9e6e]85 dbSTA IScriptOrCHRAddr [9e70]a9 9bLDA #>START_SCREEN_PPU_ATTRIBUTES [9e72]85 dcSTA IScriptOrCHRAddr_U [9e74]a9 c0LDA #$c0 [9e76]85 e8STA PPU_TargetAddr [9e78]a9 23LDA #$23 [9e7a]85 e9STA PPU_TargetAddr_U [9e7c]a2 0aLDX #$0a [9e7e]a0 04LDY #$04 [9e80]20 9e f8JSR PPU_WriteTilesFromCHRRAM
; ; Set to top-left of bordered Faxanadu logo (0x2042) and draw ; the tiles. ; ; Copy from the CHR RAM we populated earlier, drawing from the ; bottom row to the top. ;
[9e83]a9 20LDA #$20 [9e85]8d 06 20STA a:PPUADDR [9e88]a9 42LDA #$42 [9e8a]8d 06 20STA a:PPUADDR [9e8d]a9 00LDA #$00 [9e8f]85 ecSTA Temp_Int24 [9e91]a9 80LDA #>START_SCREEN_LOGO_TILES [9e93]85 edSTA Temp_Int24_M [9e95]a0 00LDY #$00 [9e97]a9 10LDA #<START_SCREEN_LOGO_TILES [9e99]85 eeSTA Temp_Int24_U [9e9b]@LAB_PRG12__9e9b: [9e9b]a2 1cLDX #$1c [9e9d]@LAB_PRG12__9e9d: [9e9d]b1 ecLDA (Temp_Int24),Y [9e9f]8d 07 20STA a:PPUDATA [9ea2]c8INY [9ea3]d0 02BNE @LAB_PRG12__9ea7 [9ea5]e6 edINC Temp_Int24_M [9ea7]@LAB_PRG12__9ea7: [9ea7]caDEX [9ea8]d0 f3BNE @LAB_PRG12__9e9d [9eaa]a9 00LDA #$00 [9eac]8d 07 20STA a:PPUDATA [9eaf]8d 07 20STA a:PPUDATA [9eb2]8d 07 20STA a:PPUDATA [9eb5]8d 07 20STA a:PPUDATA [9eb8]c6 eeDEC Temp_Int24_U [9eba]d0 dfBNE @LAB_PRG12__9e9b [9ebc]a9 00LDA #$00 [9ebe]8d 87 06STA a:DAT_0687
; ; Set position to the start of "START" (0x2288) and ; draw the text tiles. ;
[9ec1]a9 22LDA #$22 [9ec3]8d 06 20STA a:PPUADDR [9ec6]a9 88LDA #$88 [9ec8]8d 06 20STA a:PPUADDR [9ecb]a9 bdLDA #<TEXT_TILES_START [9ecd]85 ecSTA Temp_Int24 [9ecf]a9 9dLDA #>TEXT_TILES_START [9ed1]85 edSTA Temp_Int24_M [9ed3]20 0e 9eJSR UI_DrawText
; ; Set position to the start of "CONTINUE" (0x2290) and ; draw the text tiles. ;
[9ed6]a9 22LDA #$22 [9ed8]8d 06 20STA a:PPUADDR [9edb]a9 90LDA #$90 [9edd]8d 06 20STA a:PPUADDR [9ee0]a9 c3LDA #<TEXT_TILES_CONTINUE [9ee2]85 ecSTA Temp_Int24 [9ee4]a9 9dLDA #>TEXT_TILES_CONTINUE [9ee6]85 edSTA Temp_Int24_M [9ee8]20 0e 9eJSR UI_DrawText
; ; Set position to the start of "(C) 1988 Hudson Soft" (0x22E7) ; and draw the text tiles. ;
[9eeb]a9 22LDA #$22 [9eed]8d 06 20STA a:PPUADDR [9ef0]a9 e7LDA #$e7 [9ef2]8d 06 20STA a:PPUADDR [9ef5]a9 ccLDA #<TEXT_TILES_COPYRIGHT_1998_HUDSON_SOFT [9ef7]85 ecSTA Temp_Int24 [9ef9]a9 9dLDA #>TEXT_TILES_COPYRIGHT_1998_HUDSON_SOFT [9efb]85 edSTA Temp_Int24_M [9efd]20 0e 9eJSR UI_DrawText
; ; Set position to the start of "Under license from Falcom" (0x2423) ; and draw the text tiles. ;
[9f00]a9 23LDA #$23 [9f02]8d 06 20STA a:PPUADDR [9f05]a9 24LDA #$24 [9f07]8d 06 20STA a:PPUADDR [9f0a]a9 dfLDA #<TEXT_TILES_UNDER_LICENSE_FROM_FALCOM [9f0c]85 ecSTA Temp_Int24 [9f0e]a9 9dLDA #>TEXT_TILES_UNDER_LICENSE_FROM_FALCOM [9f10]85 edSTA Temp_Int24_M [9f12]20 0e 9eJSR UI_DrawText
; ; Set position to the start of "Licensed to Nintendo" (0x2366) ; and draw the text tiles. ;
[9f15]a9 23LDA #$23 [9f17]8d 06 20STA a:PPUADDR [9f1a]a9 66LDA #$66 [9f1c]8d 06 20STA a:PPUADDR [9f1f]a9 f9LDA #<TEXT_TILES_LICENSED_TO_NINTENDO [9f21]85 ecSTA Temp_Int24 [9f23]a9 9dLDA #>TEXT_TILES_LICENSED_TO_NINTENDO [9f25]85 edSTA Temp_Int24_M [9f27]20 0e 9eJSR UI_DrawText [9f2a]a9 10LDA #$10 [9f2c]20 3b d0JSR Screen_LoadUIPalette [9f2f]a2 0fLDX #$0f [9f31]@LAB_PRG12__9f31: [9f31]bd ad 9dLDA a:STARTSCREEEN_PALETTE_SPRITES,X [9f34]9d a3 02STA a:Screen_PaletteData_Sprites,X [9f37]caDEX [9f38]10 f7BPL @LAB_PRG12__9f31 [9f3a]20 90 d0JSR PPUBuffer_WritePalette [9f3d]a9 01LDA #$01 [9f3f]85 faSTA Music_Current [9f41]4c 27 cbJMP Screen_ResetForNonGame
;============================================================================ ; TODO: Document StartScreen_CheckHandleInput ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ;============================================================================
[9f44]StartScreen_CheckHandleInput: [9f44]a5 19LDA Joy1_ChangedButtonMask [9f46]29 20AND #$20 [9f48]f0 0dBEQ @LAB_PRG12__9f57 [9f4a]ad 87 06LDA a:DAT_0687 [9f4d]49 01EOR #$01 [9f4f]8d 87 06STA a:DAT_0687 [9f52]a9 0bLDA #$0b [9f54]20 e4 d0JSR Sound_PlayEffect [9f57]@LAB_PRG12__9f57: [9f57]a0 00LDY #$00 [9f59]ad 87 06LDA a:DAT_0687 [9f5c]f0 01BEQ @_drawCurrentItemSymbol [9f5e]c8INY
; ; Draw the symbol used to show the current menu item selection. ;
[9f5f]@_drawCurrentItemSymbol: [9f5f]be 69 9fLDX a:BYTE_ARRAY_PRG12__9f69,Y; X = menu item X position. [9f62]a0 7eLDY #$7e; Y = 126. [9f64]a9 adLDA #$ad; A = 0xAD (right arrow symbol) [9f66]4c a7 fcJMP UI_DrawPromptInputSymbol; Draw the symbol.
; ; XREFS: ; StartScreen_CheckHandleInput ;
[9f69]BYTE_ARRAY_PRG12__9f69: [9f69]34.byte $34; [0]: [9f6a]74.byte $74; [1]:
;============================================================================ ; Lower bytes of IScript addresses by entrypoint index. ;============================================================================
[9f6b]ISCRIPT_ADDRS_L: [9f6b]9f.byte <ISCRIPT_INTRO; [0]: [9f6c]a3.byte <ISCRIPT_EOLIS_WALKING_MAN_01; [1]: [9f6d]ad.byte <ISCRIPT_MARK_OF_JACK; [2]: [9f6e]b1.byte <ISCRIPT_EOLIS_WALKING_WOMAN_01; [3]: [9f6f]bc.byte <ISCRIPT_EOLIS_GURU; [4]: [9f70]c9.byte <ISCRIPT_EOLIS_WALKING_WOMAN_02; [5]: [9f71]d3.byte <ISCRIPT_EOLIS_SMOKING_MAN; [6]: [9f72]dd.byte <ISCRIPT_EOLIS_KINGS_GUARD; [7]: [9f73]50.byte <ISCRIPT_EOLIS_KING; [8]: [9f74]ee.byte <ISCRIPT_A0EE; [9]: [9f75]f8.byte <ISCRIPT_A0F8; [10]: [9f76]a1.byte <ISCRIPT_EOLIS_MEAT_SHOP; [11]: [9f77]fc.byte <ISCRIPT_EOLIS_KEY_SHOP; [12]: [9f78]7a.byte <ISCRIPT_EOLIS_TOOL_SHOP; [13]: [9f79]5d.byte <ISCRIPT_EOLIS_MARTIAL_ARTS_MAGIC_SHOP; [14]: [9f7a]02.byte <ISCRIPT_EOLIS_MARTIAL_ARTIST; [15]: [9f7b]0b.byte <ISCRIPT_A10B; [16]: [9f7c]16.byte <ISCRIPT_A116; [17]: [9f7d]21.byte <ISCRIPT_A121; [18]: [9f7e]2c.byte <ISCRIPT_A12C; [19]: [9f7f]37.byte <ISCRIPT_A137; [20]: [9f80]a2.byte <ISCRIPT_APOLUNE_DOCTOR; [21]: [9f81]3b.byte <ISCRIPT_A13B; [22]: [9f82]46.byte <ISCRIPT_A146; [23]: [9f83]51.byte <ISCRIPT_A151; [24]: [9f84]8c.byte <ISCRIPT_APOLUNE_TOOL_SHOP; [25]: [9f85]0e.byte <ISCRIPT_APOLUNE_KEY_SHOP; [26]: [9f86]55.byte <ISCRIPT_A155; [27]: [9f87]03.byte <ISCRIPT_APOLUNE_GURU; [28]: [9f88]9e.byte <ISCRIPT_BEFORE_APOLUNE_TOOL_SHOP; [29]: [9f89]9f.byte <ISCRIPT_INTRO; [30]:
; ; XREFS: ; IScripts_Begin ;
[9f8a]ISCRIPT_ADDRS_L_31_: [9f8a]9b.byte <ISCRIPT_REMEMBER_YOUR_MANTRA; [31]: [9f8b]57.byte <ISCRIPT_FOREPAW_GREETER; [32]: [9f8c]62.byte <ISCRIPT_A162; [33]: [9f8d]6d.byte <ISCRIPT_A16D; [34]: [9f8e]78.byte <ISCRIPT_A178; [35]: [9f8f]8a.byte <ISCRIPT_A18A; [36]: [9f90]9e.byte <ISCRIPT_SPRING_OF_SKY; [37]: [9f91]ab.byte <ISCRIPT_SPRING_OF_TRUNK; [38]: [9f92]c3.byte <ISCRIPT_A1C3; [39]: [9f93]b0.byte <ISCRIPT_FOREPAW_TOOL_SHOP; [40]: [9f94]0c.byte <ISCRIPT_FOREPAW_GURU; [41]: [9f95]b1.byte <ISCRIPT_FOREPAW_DOCTOR; [42]: [9f96]20.byte <ISCRIPT_FOREPAW_KEY_SHOP; [43]: [9f97]ae.byte <ISCRIPT_FOREPAW_MEAT_SHOP; [44]: [9f98]9f.byte <ISCRIPT_INTRO; [45]: [9f99]9f.byte <ISCRIPT_INTRO; [46]: [9f9a]9f.byte <ISCRIPT_INTRO; [47]: [9f9b]d9.byte <ISCRIPT_A1D9; [48]: [9f9c]e4.byte <ISCRIPT_A1E4; [49]: [9f9d]ef.byte <ISCRIPT_A1EF; [50]: [9f9e]fa.byte <ISCRIPT_A1FA; [51]: [9f9f]05.byte <ISCRIPT_A205; [52]: [9fa0]10.byte <ISCRIPT_OVERWORLD_MIST_HOUSE_MAN; [53]: [9fa1]1b.byte <ISCRIPT_OVERWORLD_MIST_HOUSE_WOMAN; [54]: [9fa2]26.byte <ISCRIPT_A226; [55]: [9fa3]c0.byte <ISCRIPT_MASCON_DOCTOR; [56]: [9fa4]c2.byte <ISCRIPT_MASCON_TOOL_SHOP; [57]: [9fa5]bb.byte <ISCRIPT_MASCON_MEAT_SHOP; [58]: [9fa6]32.byte <ISCRIPT_MASCON_KEY_SHOP; [59]: [9fa7]d4.byte <ISCRIPT_AFTER_MASCON_TOOL_SHOP; [60]: [9fa8]15.byte <ISCRIPT_MASCON_GURU; [61]: [9fa9]9f.byte <ISCRIPT_INTRO; [62]: [9faa]9f.byte <ISCRIPT_INTRO; [63]: [9fab]31.byte <ISCRIPT_A231; [64]: [9fac]3c.byte <ISCRIPT_A23C; [65]: [9fad]47.byte <ISCRIPT_A247; [66]: [9fae]52.byte <ISCRIPT_A252; [67]: [9faf]66.byte <ISCRIPT_A266; [68]: [9fb0]71.byte <ISCRIPT_A271; [69]: [9fb1]7c.byte <ISCRIPT_A27C; [70]: [9fb2]cf.byte <ISCRIPT_VICTIM_DOCTOR; [71]: [9fb3]e6.byte <ISCRIPT_VICTIM_TOOL_SHOP; [72]: [9fb4]c8.byte <ISCRIPT_VICTIM_MEAT_SHOP; [73]: [9fb5]44.byte <ISCRIPT_VICTIM_KEY_SHOP; [74]: [9fb6]68.byte <ISCRIPT_AFTER_VICTIM_MAGIC_SHOP; [75]: [9fb7]1e.byte <ISCRIPT_VICTIM_GURU; [76]: [9fb8]9f.byte <ISCRIPT_INTRO; [77]: [9fb9]9f.byte <ISCRIPT_INTRO; [78]: [9fba]9f.byte <ISCRIPT_INTRO; [79]: [9fbb]90.byte <ISCRIPT_A290; [80]: [9fbc]9b.byte <ISCRIPT_A29B; [81]: [9fbd]a6.byte <ISCRIPT_A2A6; [82]: [9fbe]b8.byte <ISCRIPT_A2B8; [83]: [9fbf]c3.byte <ISCRIPT_A2C3; [84]: [9fc0]27.byte <ISCRIPT_CONFLATE_GURU; [85]: [9fc1]de.byte <ISCRIPT_CONFLATE_DOCTOR; [86]: [9fc2]f8.byte <ISCRIPT_CONFLATE_TOOL_SHOP; [87]: [9fc3]d5.byte <ISCRIPT_CONFLATE_MEAT_SHOP; [88]: [9fc4]9f.byte <ISCRIPT_INTRO; [89]: [9fc5]9f.byte <ISCRIPT_INTRO; [90]: [9fc6]9f.byte <ISCRIPT_INTRO; [91]: [9fc7]9f.byte <ISCRIPT_INTRO; [92]: [9fc8]9f.byte <ISCRIPT_INTRO; [93]: [9fc9]9f.byte <ISCRIPT_INTRO; [94]: [9fca]9f.byte <ISCRIPT_INTRO; [95]: [9fcb]ce.byte <ISCRIPT_A2CE; [96]: [9fcc]d9.byte <ISCRIPT_A2D9; [97]: [9fcd]e4.byte <ISCRIPT_A2E4; [98]: [9fce]ef.byte <ISCRIPT_A2EF; [99]: [9fcf]fa.byte <ISCRIPT_A2FA; [100]: [9fd0]05.byte <ISCRIPT_A305; [101]: [9fd1]0a.byte <ISCRIPT_DAYBREAK_TOOL_SHOP; [102]: [9fd2]e2.byte <ISCRIPT_DAYBREAK_MEAT_SHOP; [103]: [9fd3]56.byte <ISCRIPT_DAYBREAK_KEY_SHOP; [104]: [9fd4]3d.byte <ISCRIPT_DAYBREAK_GURU; [105]: [9fd5]9f.byte <ISCRIPT_INTRO; [106]: [9fd6]9f.byte <ISCRIPT_INTRO; [107]: [9fd7]9f.byte <ISCRIPT_INTRO; [108]: [9fd8]9f.byte <ISCRIPT_INTRO; [109]: [9fd9]9f.byte <ISCRIPT_INTRO; [110]: [9fda]9f.byte <ISCRIPT_INTRO; [111]: [9fdb]10.byte <ISCRIPT_A310; [112]: [9fdc]1b.byte <ISCRIPT_OVERWORLD_HOUSE_MAN; [113]: [9fdd]26.byte <ISCRIPT_OVERWORLD_HOUSE_WOMAN; [114]: [9fde]31.byte <ISCRIPT_A331; [115]: [9fdf]3c.byte <ISCRIPT_FRATERNAL_GURU; [116]: [9fe0]1c.byte <ISCRIPT_DARTMOOR_TOOL_SHOP; [117]: [9fe1]ef.byte <ISCRIPT_DARTMOOR_MEAT_SHOP; [118]: [9fe2]68.byte <ISCRIPT_DARTMOOR_KEY_SHOP; [119]: [9fe3]46.byte <ISCRIPT_GURU_FINAL; [120]: [9fe4]4f.byte <ISCRIPT_KING_END_GAME; [121]: [9fe5]ed.byte <ISCRIPT_DARTMOOR_DOCTOR; [122]: [9fe6]54.byte <ISCRIPT_MARK_OF_QUEEN; [123]: [9fe7]58.byte <ISCRIPT_MARK_OF_KING; [124]: [9fe8]5c.byte <ISCRIPT_MARK_OF_ACE; [125]: [9fe9]60.byte <ISCRIPT_MARK_OF_JOKER; [126]: [9fea]64.byte <ISCRIPT_NEED_RING_FOR_DOOR; [127]: [9feb]68.byte <ISCRIPT_USED_RED_POTION; [128]: [9fec]6c.byte <ISCRIPT_USED_MATTOCK; [129]: [9fed]70.byte <ISCRIPT_USED_HOURGLASS; [130]: [9fee]74.byte <ISCRIPT_USED_WINGBOOTS; [131]: [9fef]78.byte <ISCRIPT_USED_KEY; [132]: [9ff0]7c.byte <ISCRIPT_USED_ELIXIR; [133]: [9ff1]80.byte <ISCRIPT_GOT_ELIXIR; [134]: [9ff2]84.byte <ISCRIPT_GOT_RED_POTION; [135]: [9ff3]88.byte <ISCRIPT_GOT_MATTOCK; [136]: [9ff4]8c.byte <ISCRIPT_GOT_WINGBOOTS; [137]: [9ff5]90.byte <ISCRIPT_GOT_HOURGLASS; [138]: [9ff6]94.byte <ISCRIPT_GOT_BATTLE_SUIT; [139]: [9ff7]98.byte <ISCRIPT_GOT_BATTLE_HELMET; [140]: [9ff8]9c.byte <ISCRIPT_GOT_DRAGON_SLAYER; [141]: [9ff9]a0.byte <ISCRIPT_GOT_BLACK_ONYX; [142]: [9ffa]a4.byte <ISCRIPT_GOT_PENDANT; [143]: [9ffb]a8.byte <ISCRIPT_GOT_MAGICAL_ROD; [144]: [9ffc]ac.byte <ISCRIPT_TOUCHED_POISON; [145]: [9ffd]b0.byte <ISCRIPT_GOT_POWER_GLOVE; [146]: [9ffe]b4.byte <ISCRIPT_POWER_GLOVE_GONE; [147]: [9fff]b8.byte <ISCRIPT_OINTMENT_USED; [148]: [a000]bc.byte <ISCRIPT_OINTMENT_GONE; [149]: [a001]c0.byte <ISCRIPT_WINGBOOTS_GONE; [150]: [a002]c4.byte <ISCRIPT_HOURGLASS_GONE; [151]:
;============================================================================ ; Upper bytes of IScript addresses by entrypoint index. ;============================================================================
[a003]ISCRIPT_ADDRS_U: [a003]a0.byte >ISCRIPT_INTRO; [0]: [a004]a0.byte >ISCRIPT_EOLIS_WALKING_MAN_01; [1]: [a005]a0.byte >ISCRIPT_MARK_OF_JACK; [2]: [a006]a0.byte >ISCRIPT_EOLIS_WALKING_WOMAN_01; [3]: [a007]a0.byte >ISCRIPT_EOLIS_GURU; [4]: [a008]a0.byte >ISCRIPT_EOLIS_WALKING_WOMAN_02; [5]: [a009]a0.byte >ISCRIPT_EOLIS_SMOKING_MAN; [6]: [a00a]a0.byte >ISCRIPT_EOLIS_KINGS_GUARD; [7]: [a00b]a3.byte >ISCRIPT_EOLIS_KING; [8]: [a00c]a0.byte >ISCRIPT_A0EE; [9]: [a00d]a0.byte >ISCRIPT_A0F8; [10]: [a00e]a4.byte >ISCRIPT_EOLIS_MEAT_SHOP; [11]: [a00f]a4.byte >ISCRIPT_EOLIS_KEY_SHOP; [12]: [a010]a3.byte >ISCRIPT_EOLIS_TOOL_SHOP; [13]: [a011]a3.byte >ISCRIPT_EOLIS_MARTIAL_ARTS_MAGIC_SHOP; [14]: [a012]a1.byte >ISCRIPT_EOLIS_MARTIAL_ARTIST; [15]: [a013]a1.byte >ISCRIPT_A10B; [16]: [a014]a1.byte >ISCRIPT_A116; [17]: [a015]a1.byte >ISCRIPT_A121; [18]: [a016]a1.byte >ISCRIPT_A12C; [19]: [a017]a1.byte >ISCRIPT_A137; [20]: [a018]a5.byte >ISCRIPT_APOLUNE_DOCTOR; [21]: [a019]a1.byte >ISCRIPT_A13B; [22]: [a01a]a1.byte >ISCRIPT_A146; [23]: [a01b]a1.byte >ISCRIPT_A151; [24]: [a01c]a3.byte >ISCRIPT_APOLUNE_TOOL_SHOP; [25]: [a01d]a5.byte >ISCRIPT_APOLUNE_KEY_SHOP; [26]: [a01e]a1.byte >ISCRIPT_A155; [27]: [a01f]a6.byte >ISCRIPT_APOLUNE_GURU; [28]: [a020]a3.byte >ISCRIPT_BEFORE_APOLUNE_TOOL_SHOP; [29]: [a021]a0.byte >ISCRIPT_INTRO; [30]:
; ; XREFS: ; IScripts_Begin ;
[a022]ISCRIPT_ADDRS_U_31_: [a022]a0.byte >ISCRIPT_REMEMBER_YOUR_MANTRA; [31]: [a023]a1.byte >ISCRIPT_FOREPAW_GREETER; [32]: [a024]a1.byte >ISCRIPT_A162; [33]: [a025]a1.byte >ISCRIPT_A16D; [34]: [a026]a1.byte >ISCRIPT_A178; [35]: [a027]a1.byte >ISCRIPT_A18A; [36]: [a028]a1.byte >ISCRIPT_SPRING_OF_SKY; [37]: [a029]a1.byte >ISCRIPT_SPRING_OF_TRUNK; [38]: [a02a]a1.byte >ISCRIPT_A1C3; [39]: [a02b]a3.byte >ISCRIPT_FOREPAW_TOOL_SHOP; [40]: [a02c]a6.byte >ISCRIPT_FOREPAW_GURU; [41]: [a02d]a5.byte >ISCRIPT_FOREPAW_DOCTOR; [42]: [a02e]a5.byte >ISCRIPT_FOREPAW_KEY_SHOP; [43]: [a02f]a4.byte >ISCRIPT_FOREPAW_MEAT_SHOP; [44]: [a030]a0.byte >ISCRIPT_INTRO; [45]: [a031]a0.byte >ISCRIPT_INTRO; [46]: [a032]a0.byte >ISCRIPT_INTRO; [47]: [a033]a1.byte >ISCRIPT_A1D9; [48]: [a034]a1.byte >ISCRIPT_A1E4; [49]: [a035]a1.byte >ISCRIPT_A1EF; [50]: [a036]a1.byte >ISCRIPT_A1FA; [51]: [a037]a2.byte >ISCRIPT_A205; [52]: [a038]a2.byte >ISCRIPT_OVERWORLD_MIST_HOUSE_MAN; [53]: [a039]a2.byte >ISCRIPT_OVERWORLD_MIST_HOUSE_WOMAN; [54]: [a03a]a2.byte >ISCRIPT_A226; [55]: [a03b]a5.byte >ISCRIPT_MASCON_DOCTOR; [56]: [a03c]a3.byte >ISCRIPT_MASCON_TOOL_SHOP; [57]: [a03d]a4.byte >ISCRIPT_MASCON_MEAT_SHOP; [58]: [a03e]a5.byte >ISCRIPT_MASCON_KEY_SHOP; [59]: [a03f]a3.byte >ISCRIPT_AFTER_MASCON_TOOL_SHOP; [60]: [a040]a6.byte >ISCRIPT_MASCON_GURU; [61]: [a041]a0.byte >ISCRIPT_INTRO; [62]: [a042]a0.byte >ISCRIPT_INTRO; [63]: [a043]a2.byte >ISCRIPT_A231; [64]: [a044]a2.byte >ISCRIPT_A23C; [65]: [a045]a2.byte >ISCRIPT_A247; [66]: [a046]a2.byte >ISCRIPT_A252; [67]: [a047]a2.byte >ISCRIPT_A266; [68]: [a048]a2.byte >ISCRIPT_A271; [69]: [a049]a2.byte >ISCRIPT_A27C; [70]: [a04a]a5.byte >ISCRIPT_VICTIM_DOCTOR; [71]: [a04b]a3.byte >ISCRIPT_VICTIM_TOOL_SHOP; [72]: [a04c]a4.byte >ISCRIPT_VICTIM_MEAT_SHOP; [73]: [a04d]a5.byte >ISCRIPT_VICTIM_KEY_SHOP; [74]: [a04e]a3.byte >ISCRIPT_AFTER_VICTIM_MAGIC_SHOP; [75]: [a04f]a6.byte >ISCRIPT_VICTIM_GURU; [76]: [a050]a0.byte >ISCRIPT_INTRO; [77]: [a051]a0.byte >ISCRIPT_INTRO; [78]: [a052]a0.byte >ISCRIPT_INTRO; [79]: [a053]a2.byte >ISCRIPT_A290; [80]: [a054]a2.byte >ISCRIPT_A29B; [81]: [a055]a2.byte >ISCRIPT_A2A6; [82]: [a056]a2.byte >ISCRIPT_A2B8; [83]: [a057]a2.byte >ISCRIPT_A2C3; [84]: [a058]a6.byte >ISCRIPT_CONFLATE_GURU; [85]: [a059]a5.byte >ISCRIPT_CONFLATE_DOCTOR; [86]: [a05a]a3.byte >ISCRIPT_CONFLATE_TOOL_SHOP; [87]: [a05b]a4.byte >ISCRIPT_CONFLATE_MEAT_SHOP; [88]: [a05c]a0.byte >ISCRIPT_INTRO; [89]: [a05d]a0.byte >ISCRIPT_INTRO; [90]: [a05e]a0.byte >ISCRIPT_INTRO; [91]: [a05f]a0.byte >ISCRIPT_INTRO; [92]: [a060]a0.byte >ISCRIPT_INTRO; [93]: [a061]a0.byte >ISCRIPT_INTRO; [94]: [a062]a0.byte >ISCRIPT_INTRO; [95]: [a063]a2.byte >ISCRIPT_A2CE; [96]: [a064]a2.byte >ISCRIPT_A2D9; [97]: [a065]a2.byte >ISCRIPT_A2E4; [98]: [a066]a2.byte >ISCRIPT_A2EF; [99]: [a067]a2.byte >ISCRIPT_A2FA; [100]: [a068]a3.byte >ISCRIPT_A305; [101]: [a069]a4.byte >ISCRIPT_DAYBREAK_TOOL_SHOP; [102]: [a06a]a4.byte >ISCRIPT_DAYBREAK_MEAT_SHOP; [103]: [a06b]a5.byte >ISCRIPT_DAYBREAK_KEY_SHOP; [104]: [a06c]a6.byte >ISCRIPT_DAYBREAK_GURU; [105]: [a06d]a0.byte >ISCRIPT_INTRO; [106]: [a06e]a0.byte >ISCRIPT_INTRO; [107]: [a06f]a0.byte >ISCRIPT_INTRO; [108]: [a070]a0.byte >ISCRIPT_INTRO; [109]: [a071]a0.byte >ISCRIPT_INTRO; [110]: [a072]a0.byte >ISCRIPT_INTRO; [111]: [a073]a3.byte >ISCRIPT_A310; [112]: [a074]a3.byte >ISCRIPT_OVERWORLD_HOUSE_MAN; [113]: [a075]a3.byte >ISCRIPT_OVERWORLD_HOUSE_WOMAN; [114]: [a076]a3.byte >ISCRIPT_A331; [115]: [a077]a3.byte >ISCRIPT_FRATERNAL_GURU; [116]: [a078]a4.byte >ISCRIPT_DARTMOOR_TOOL_SHOP; [117]: [a079]a4.byte >ISCRIPT_DARTMOOR_MEAT_SHOP; [118]: [a07a]a5.byte >ISCRIPT_DARTMOOR_KEY_SHOP; [119]: [a07b]a6.byte >ISCRIPT_GURU_FINAL; [120]: [a07c]a6.byte >ISCRIPT_KING_END_GAME; [121]: [a07d]a5.byte >ISCRIPT_DARTMOOR_DOCTOR; [122]: [a07e]a6.byte >ISCRIPT_MARK_OF_QUEEN; [123]: [a07f]a6.byte >ISCRIPT_MARK_OF_KING; [124]: [a080]a6.byte >ISCRIPT_MARK_OF_ACE; [125]: [a081]a6.byte >ISCRIPT_MARK_OF_JOKER; [126]: [a082]a6.byte >ISCRIPT_NEED_RING_FOR_DOOR; [127]: [a083]a6.byte >ISCRIPT_USED_RED_POTION; [128]: [a084]a6.byte >ISCRIPT_USED_MATTOCK; [129]: [a085]a6.byte >ISCRIPT_USED_HOURGLASS; [130]: [a086]a6.byte >ISCRIPT_USED_WINGBOOTS; [131]: [a087]a6.byte >ISCRIPT_USED_KEY; [132]: [a088]a6.byte >ISCRIPT_USED_ELIXIR; [133]: [a089]a6.byte >ISCRIPT_GOT_ELIXIR; [134]: [a08a]a6.byte >ISCRIPT_GOT_RED_POTION; [135]: [a08b]a6.byte >ISCRIPT_GOT_MATTOCK; [136]: [a08c]a6.byte >ISCRIPT_GOT_WINGBOOTS; [137]: [a08d]a6.byte >ISCRIPT_GOT_HOURGLASS; [138]: [a08e]a6.byte >ISCRIPT_GOT_BATTLE_SUIT; [139]: [a08f]a6.byte >ISCRIPT_GOT_BATTLE_HELMET; [140]: [a090]a6.byte >ISCRIPT_GOT_DRAGON_SLAYER; [141]: [a091]a6.byte >ISCRIPT_GOT_BLACK_ONYX; [142]: [a092]a6.byte >ISCRIPT_GOT_PENDANT; [143]: [a093]a6.byte >ISCRIPT_GOT_MAGICAL_ROD; [144]: [a094]a6.byte >ISCRIPT_TOUCHED_POISON; [145]: [a095]a6.byte >ISCRIPT_GOT_POWER_GLOVE; [146]: [a096]a6.byte >ISCRIPT_POWER_GLOVE_GONE; [147]: [a097]a6.byte >ISCRIPT_OINTMENT_USED; [148]: [a098]a6.byte >ISCRIPT_OINTMENT_GONE; [149]: [a099]a6.byte >ISCRIPT_WINGBOOTS_GONE; [150]: [a09a]a6.byte >ISCRIPT_HOURGLASS_GONE; [151]:
;============================================================================ ; Death screen. ; ; "Don't have negative thoughts. Remember your mantra." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f8a] ; ISCRIPT_ADDRS_U [$PRG12::a022] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f8a] ; ISCRIPT_ADDRS_U [$PRG12::a022] ;
[a09b]ISCRIPT_REMEMBER_YOUR_MANTRA: [a09b]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a09c]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Show MESSAGE_REMEMBER_YOUR_MANTRA. [a09d]24.byte MESSAGEID_REMEMBER_YOUR_MANTRA; Message [a09e]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; The intro message at the start of the game. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f6b] ; ISCRIPT_ADDRS_L [$PRG12::9f89] ; ISCRIPT_ADDRS_L [$PRG12::9f98] ; ISCRIPT_ADDRS_L [$PRG12::9f99] ; ISCRIPT_ADDRS_L [$PRG12::9f9a] ; ISCRIPT_ADDRS_L [$PRG12::9fa9] ; ISCRIPT_ADDRS_L [$PRG12::9faa] ; ISCRIPT_ADDRS_L [$PRG12::9fb8] ; ISCRIPT_ADDRS_L [$PRG12::9fb9] ; ISCRIPT_ADDRS_L [$PRG12::9fba] ; ISCRIPT_ADDRS_L [$PRG12::9fc4] ; ISCRIPT_ADDRS_L [$PRG12::9fc5] ; ISCRIPT_ADDRS_L [$PRG12::9fc6] ; ISCRIPT_ADDRS_L [$PRG12::9fc7] ; ISCRIPT_ADDRS_L [$PRG12::9fc8] ; ISCRIPT_ADDRS_L [$PRG12::9fc9] ; ISCRIPT_ADDRS_L [$PRG12::9fca] ; ISCRIPT_ADDRS_L [$PRG12::9fd5] ; ISCRIPT_ADDRS_L [$PRG12::9fd6] ; ISCRIPT_ADDRS_L [$PRG12::9fd7] ; ISCRIPT_ADDRS_L [$PRG12::9fd8] ; ISCRIPT_ADDRS_L [$PRG12::9fd9] ; ISCRIPT_ADDRS_L [$PRG12::9fda] ; ISCRIPT_ADDRS_U [$PRG12::a003] ; ISCRIPT_ADDRS_U [$PRG12::a021] ; ISCRIPT_ADDRS_U [$PRG12::a030] ; ISCRIPT_ADDRS_U [$PRG12::a031] ; ISCRIPT_ADDRS_U [$PRG12::a032] ; ISCRIPT_ADDRS_U [$PRG12::a041] ; ISCRIPT_ADDRS_U [$PRG12::a042] ; ISCRIPT_ADDRS_U [$PRG12::a050] ; ISCRIPT_ADDRS_U [$PRG12::a051] ; ISCRIPT_ADDRS_U [$PRG12::a052] ; ISCRIPT_ADDRS_U [$PRG12::a05c] ; ISCRIPT_ADDRS_U [$PRG12::a05d] ; ISCRIPT_ADDRS_U [$PRG12::a05e] ; ISCRIPT_ADDRS_U [$PRG12::a05f] ; ISCRIPT_ADDRS_U [$PRG12::a060] ; ISCRIPT_ADDRS_U [$PRG12::a061] ; ISCRIPT_ADDRS_U [$PRG12::a062] ; ISCRIPT_ADDRS_U [$PRG12::a06d] ; ISCRIPT_ADDRS_U [$PRG12::a06e] ; ISCRIPT_ADDRS_U [$PRG12::a06f] ; ISCRIPT_ADDRS_U [$PRG12::a070] ; ISCRIPT_ADDRS_U [$PRG12::a071] ; ISCRIPT_ADDRS_U [$PRG12::a072] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f6b] ; ISCRIPT_ADDRS_L [$PRG12::9f89] ; ISCRIPT_ADDRS_L [$PRG12::9f98] ; ISCRIPT_ADDRS_L [$PRG12::9f99] ; ISCRIPT_ADDRS_L [$PRG12::9f9a] ; ISCRIPT_ADDRS_L [$PRG12::9fa9] ; ISCRIPT_ADDRS_L [$PRG12::9faa] ; ISCRIPT_ADDRS_L [$PRG12::9fb8] ; ISCRIPT_ADDRS_L [$PRG12::9fb9] ; ISCRIPT_ADDRS_L [$PRG12::9fba] ; ISCRIPT_ADDRS_L [$PRG12::9fc4] ; ISCRIPT_ADDRS_L [$PRG12::9fc5] ; ISCRIPT_ADDRS_L [$PRG12::9fc6] ; ISCRIPT_ADDRS_L [$PRG12::9fc7] ; ISCRIPT_ADDRS_L [$PRG12::9fc8] ; ISCRIPT_ADDRS_L [$PRG12::9fc9] ; ISCRIPT_ADDRS_L [$PRG12::9fca] ; ISCRIPT_ADDRS_L [$PRG12::9fd5] ; ISCRIPT_ADDRS_L [$PRG12::9fd6] ; ISCRIPT_ADDRS_L [$PRG12::9fd7] ; ISCRIPT_ADDRS_L [$PRG12::9fd8] ; ISCRIPT_ADDRS_L [$PRG12::9fd9] ; ISCRIPT_ADDRS_L [$PRG12::9fda] ; ISCRIPT_ADDRS_U [$PRG12::a003] ; ISCRIPT_ADDRS_U [$PRG12::a021] ; ISCRIPT_ADDRS_U [$PRG12::a030] ; ISCRIPT_ADDRS_U [$PRG12::a031] ; ISCRIPT_ADDRS_U [$PRG12::a032] ; ISCRIPT_ADDRS_U [$PRG12::a041] ; ISCRIPT_ADDRS_U [$PRG12::a042] ; ISCRIPT_ADDRS_U [$PRG12::a050] ; ISCRIPT_ADDRS_U [$PRG12::a051] ; ISCRIPT_ADDRS_U [$PRG12::a052] ; ISCRIPT_ADDRS_U [$PRG12::a05c] ; ISCRIPT_ADDRS_U [$PRG12::a05d] ; ISCRIPT_ADDRS_U [$PRG12::a05e] ; ISCRIPT_ADDRS_U [$PRG12::a05f] ; ISCRIPT_ADDRS_U [$PRG12::a060] ; ISCRIPT_ADDRS_U [$PRG12::a061] ; ISCRIPT_ADDRS_U [$PRG12::a062] ; ISCRIPT_ADDRS_U [$PRG12::a06d] ; ISCRIPT_ADDRS_U [$PRG12::a06e] ; ISCRIPT_ADDRS_U [$PRG12::a06f] ; ISCRIPT_ADDRS_U [$PRG12::a070] ; ISCRIPT_ADDRS_U [$PRG12::a071] ; ISCRIPT_ADDRS_U [$PRG12::a072] ;
[a09f]ISCRIPT_INTRO: [a09f]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic textbox. [a0a0]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Show MESSAGE_INTRO. [a0a1]26.byte MESSAGEID_INTRO; Message [a0a2]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Walking man shown when you enter the first town. ; ; If the player has no gold, they'll be told to see ; the king. Otherwise, they're given directions to ; Apolune. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f6c] ; ISCRIPT_ADDRS_U [$PRG12::a004] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f6c] ; ISCRIPT_ADDRS_U [$PRG12::a004] ;
[a0a3]ISCRIPT_EOLIS_WALKING_MAN_01: [a0a3]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic textbox. [a0a4]0d.byte ISCRIPT_ACTION_CHECK_GOLD; Check if the player has any gold. [a0a5]aa a0pointer @_ISCRIPT_NPC_FIRST_WALKING_MAN_GO_TO_APOLUNE; If yes, then jump. [a0a7]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_GO_SEE_KING. [a0a8]27.byte MESSAGEID_GO_SEE_KING; Message [a0a9]00.byte ISCRIPT_ACTION_END; End. [a0aa]@_ISCRIPT_NPC_FIRST_WALKING_MAN_GO_TO_APOLUNE: [a0aa]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DIRECTIONS_APOLUNE. [a0ab]28.byte MESSAGEID_DIRECTIONS_APOLUNE; Message [a0ac]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; "There is a mark of Jack by the key hole." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f6d] ; ISCRIPT_ADDRS_U [$PRG12::a005] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f6d] ; ISCRIPT_ADDRS_U [$PRG12::a005] ;
[a0ad]ISCRIPT_MARK_OF_JACK: [a0ad]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic textbox. [a0ae]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_MARK_OF_JACK. [a0af]29.byte MESSAGEID_MARK_OF_JACK; Message [a0b0]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f6e] ; ISCRIPT_ADDRS_U [$PRG12::a006] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f6e] ; ISCRIPT_ADDRS_U [$PRG12::a006] ;
[a0b1]ISCRIPT_EOLIS_WALKING_WOMAN_01: [a0b1]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic textbox. [a0b2]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Ring of Elf. [a0b3]80.byte SPECIAL_RING_OF_ELF; InventoryItem [a0b4]b9 a0pointer @_ISCRIPT_A081_HAS_RING; If yes, jump. [a0b6]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THIS_IS_EOLIS. [a0b7]2a.byte MESSAGEID_THIS_IS_EOLIS; Message [a0b8]00.byte ISCRIPT_ACTION_END; End. [a0b9]@_ISCRIPT_A081_HAS_RING: [a0b9]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_LOOK_FOR_RINGS. [a0ba]2b.byte MESSAGEID_LOOK_FOR_RINGS; Message [a0bb]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the guru in Eolis. ; ; If the player does not have the Ring of Elf, they will ; be given the ring and told to talk to the King. ; ; If they do have it, they will be told to talk to gurus ; to get a title. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f6f] ; ISCRIPT_ADDRS_U [$PRG12::a007] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f6f] ; ISCRIPT_ADDRS_U [$PRG12::a007] ;
[a0bc]ISCRIPT_EOLIS_GURU: [a0bc]81.byte ISCRIPT_ENTITY_GURU; Show the Guru portrait text box. [a0bd]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Ring of Elf. [a0be]80.byte SPECIAL_RING_OF_ELF; InventoryItem [a0bf]c6 a0pointer @_ISCRIPT_GURU_EOLIS_HAS_RING; If yes, then jump. [a0c1]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_TAKE_RING_TO_KING. [a0c2]2c.byte MESSAGEID_TAKE_RING_TO_KING; Message [a0c3]07.byte ISCRIPT_ACTION_ADD_ITEM; Add the Ring of Elf to the inventory. [a0c4]80.byte SPECIAL_RING_OF_ELF; InventoryItem [a0c5]00.byte ISCRIPT_ACTION_END; End. [a0c6]@_ISCRIPT_GURU_EOLIS_HAS_RING: [a0c6]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_VISIT_GURUS_GET_TITLE. [a0c7]2d.byte MESSAGEID_VISIT_GURUS_GET_TITLE; Message [a0c8]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f70] ; ISCRIPT_ADDRS_U [$PRG12::a008] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f70] ; ISCRIPT_ADDRS_U [$PRG12::a008] ;
[a0c9]ISCRIPT_EOLIS_WALKING_WOMAN_02: [a0c9]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a0ca]0d.byte ISCRIPT_ACTION_CHECK_GOLD; Check if the player has any gold. [a0cb]d0 a0pointer @_ISCRIPT_A0C9_HAS_GOLD; If yes, jump. [a0cd]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_LAST_WELL_ALMOST_DRY. [a0ce]2e.byte MESSAGEID_LAST_WELL_ALMOST_DRY; Message [a0cf]00.byte ISCRIPT_ACTION_END; End. [a0d0]@_ISCRIPT_A0C9_HAS_GOLD: [a0d0]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THIS_IS_FOREPAW. [a0d1]2f.byte MESSAGEID_THIS_IS_FOREPAW; Message [a0d2]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the smoking man in Eolis. ; ; If the player has any gold, they'll be asked if they ; have a weapon. ; ; If they don't have gold, they'll be told that there ; are dwarves here in town. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f71] ; ISCRIPT_ADDRS_U [$PRG12::a009] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f71] ; ISCRIPT_ADDRS_U [$PRG12::a009] ;
[a0d3]ISCRIPT_EOLIS_SMOKING_MAN: [a0d3]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a0d4]0d.byte ISCRIPT_ACTION_CHECK_GOLD; Check if the player has any gold. [a0d5]da a0pointer @_ISCRIPT_NPC_SMOKING_MAN_HAS_GOLD; If yes, jump. [a0d7]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DWARVES_ARE_HERE. [a0d8]30.byte MESSAGEID_DWARVES_ARE_HERE; Message [a0d9]00.byte ISCRIPT_ACTION_END; End. [a0da]@_ISCRIPT_NPC_SMOKING_MAN_HAS_GOLD: [a0da]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DO_YOU_HAVE_WEAPON. [a0db]31.byte MESSAGEID_DO_YOU_HAVE_WEAPON; Message [a0dc]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the King's guard. ; ; If the player does not have the Ring of Elf, he'll ; say the player can't go in. ; ; If the player does have it, but no gold, he'll say the ; King is waiting. ; ; If they have the ring and gold, he'll wish the player ; luck. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f72] ; ISCRIPT_ADDRS_U [$PRG12::a00a] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f72] ; ISCRIPT_ADDRS_U [$PRG12::a00a] ;
[a0dd]ISCRIPT_EOLIS_KINGS_GUARD: [a0dd]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a0de]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Ring of Elf. [a0df]80.byte SPECIAL_RING_OF_ELF; InventoryItem [a0e0]e5 a0pointer @_ISCRIPT_KINGS_GUARD_HAS_RING; If yes, jump. [a0e2]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_CANT_LET_YOU_GO. [a0e3]32.byte MESSAGEID_CANT_LET_YOU_GO; Message [a0e4]00.byte ISCRIPT_ACTION_END; End. [a0e5]@_ISCRIPT_KINGS_GUARD_HAS_RING: [a0e5]0d.byte ISCRIPT_ACTION_CHECK_GOLD; Check if the player has any gold. [a0e6]eb a0pointer @_ISCRIPT_KINGS_GUARD_HAS_GOLD; If yes, then jump. [a0e8]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_KING_IS_WAITING. [a0e9]33.byte MESSAGEID_KING_IS_WAITING; Message [a0ea]00.byte ISCRIPT_ACTION_END; End. [a0eb]@_ISCRIPT_KINGS_GUARD_HAS_GOLD: [a0eb]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_GOOD_LUCK. [a0ec]34.byte MESSAGEID_GOOD_LUCK; Message [a0ed]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f74] ; ISCRIPT_ADDRS_U [$PRG12::a00c] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f74] ; ISCRIPT_ADDRS_U [$PRG12::a00c] ;
[a0ee]ISCRIPT_A0EE: [a0ee]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a0ef]0d.byte ISCRIPT_ACTION_CHECK_GOLD; Check if the player has any gold. [a0f0]f5 a0pointer @_ISCRIPT_A0EE_HAS_GOLD; If yes, jump. [a0f2]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DWARVES_ROBBING_ELVES. [a0f3]37.byte MESSAGEID_DWARVES_ROBBING_ELVES; Message [a0f4]00.byte ISCRIPT_ACTION_END; End. [a0f5]@_ISCRIPT_A0EE_HAS_GOLD: [a0f5]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_METEORITE_EXPOSITION. [a0f6]38.byte MESSAGEID_METEORITE_EXPOSITION; Message [a0f7]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f75] ; ISCRIPT_ADDRS_U [$PRG12::a00d] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f75] ; ISCRIPT_ADDRS_U [$PRG12::a00d] ;
[a0f8]ISCRIPT_A0F8: [a0f8]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a0f9]0d.byte ISCRIPT_ACTION_CHECK_GOLD; Check if the player has any gold. [a0fa]ff a0pointer @_ISCRIPT_A0F8_HAS_GOLD; If yes, jump. [a0fc]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_LISTEN_TO_PEOPLE. [a0fd]39.byte MESSAGEID_LISTEN_TO_PEOPLE; Message [a0fe]00.byte ISCRIPT_ACTION_END; End. [a0ff]@_ISCRIPT_A0F8_HAS_GOLD: [a0ff]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_TRY_TOO_HARD_2. [a100]3a.byte MESSAGEID_DONT_TRY_TOO_HARD_2; Message [a101]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Eolis Martial Artist. ; ; The player will be offered 40HP for 200G. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f7a] ; ISCRIPT_ADDRS_U [$PRG12::a012] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f7a] ; ISCRIPT_ADDRS_U [$PRG12::a012] ;
[a102]ISCRIPT_EOLIS_MARTIAL_ARTIST: [a102]82.byte ISCRIPT_ENTITY_MARTIAL_ARTIST; Show a Martial Artist portrait text box. [a103]02.byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show a dismissible MESSAGE_MARTIAL_ARTS_200G. [a104]19.byte MESSAGEID_MARTIAL_ARTS_200G; Message [a105]05.byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 200G. [a106]c8 00.word $00c8; ushort [a108]13.byte ISCRIPT_ACTION_ADD_HP; Add 40HP. [a109]28.byte $28; byte [a10a]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f7b] ; ISCRIPT_ADDRS_U [$PRG12::a013] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f7b] ; ISCRIPT_ADDRS_U [$PRG12::a013] ;
[a10b]ISCRIPT_A10B: [a10b]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a10c]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Small Shield. [a10d]40.byte SHIELD_SMALL; InventoryItem [a10e]13 a1pointer @_ISCRIPT_A10B_HAS_SMALL_SHIELD; If yes, jump. [a110]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_WELCOME_TO_APOLUNE. [a111]3b.byte MESSAGEID_WELCOME_TO_APOLUNE; Message [a112]00.byte ISCRIPT_ACTION_END; End. [a113]@_ISCRIPT_A10B_HAS_SMALL_SHIELD: [a113]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DIRECTIONS_FOREPAW. [a114]3c.byte MESSAGEID_DIRECTIONS_FOREPAW; Message [a115]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f7c] ; ISCRIPT_ADDRS_U [$PRG12::a014] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f7c] ; ISCRIPT_ADDRS_U [$PRG12::a014] ;
[a116]ISCRIPT_A116: [a116]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a117]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Small Shield. [a118]40.byte SHIELD_SMALL; InventoryItem [a119]1e a1pointer @_ISCRIPT_A116_HAS_SMALL_SHIELD; If yes, jump. [a11b]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DIRECTIONS_TO_TRUNK. [a11c]3d.byte MESSAGEID_DIRECTIONS_TO_TRUNK; Message [a11d]00.byte ISCRIPT_ACTION_END; End. [a11e]@_ISCRIPT_A116_HAS_SMALL_SHIELD: [a11e]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_GOOD_LUCK_2. [a11f]3e.byte MESSAGEID_GOOD_LUCK_2; Message [a120]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f7d] ; ISCRIPT_ADDRS_U [$PRG12::a015] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f7d] ; ISCRIPT_ADDRS_U [$PRG12::a015] ;
[a121]ISCRIPT_A121: [a121]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a122]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Small Shield. [a123]40.byte SHIELD_SMALL; InventoryItem [a124]29 a1pointer @_ISCRIPT_A121_HAS_SMALL_SHIELD; If yes, jump. [a126]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_SHOULD_HAVE_SHIELD. [a127]3f.byte MESSAGEID_SHOULD_HAVE_SHIELD; Message [a128]00.byte ISCRIPT_ACTION_END; End. [a129]@_ISCRIPT_A121_HAS_SMALL_SHIELD: [a129]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_MATTOCK_IN_TOWER. [a12a]40.byte MESSAGEID_MATTOCK_IN_TOWER; Message [a12b]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f7e] ; ISCRIPT_ADDRS_U [$PRG12::a016] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f7e] ; ISCRIPT_ADDRS_U [$PRG12::a016] ;
[a12c]ISCRIPT_A12C: [a12c]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a12d]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Small Shield. [a12e]40.byte SHIELD_SMALL; InventoryItem [a12f]34 a1pointer @_ISCRIPT_A12C_HAS_SMALL_SHIELD; If yes, jump. [a131]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_BLOCKED_PASSAGE. [a132]41.byte MESSAGEID_BLOCKED_PASSAGE; Message [a133]00.byte ISCRIPT_ACTION_END; End. [a134]@_ISCRIPT_A12C_HAS_SMALL_SHIELD: [a134]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_MATTOCK_BREAKS_WALL. [a135]42.byte MESSAGEID_MATTOCK_BREAKS_WALL; Message [a136]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f7f] ; ISCRIPT_ADDRS_U [$PRG12::a017] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f7f] ; ISCRIPT_ADDRS_U [$PRG12::a017] ;
[a137]ISCRIPT_A137: [a137]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a138]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_YOU_NEED_KEY. [a139]43.byte MESSAGEID_YOU_NEED_KEY; Message [a13a]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f81] ; ISCRIPT_ADDRS_U [$PRG12::a019] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f81] ; ISCRIPT_ADDRS_U [$PRG12::a019] ;
[a13b]ISCRIPT_A13B: [a13b]85.byte ISCRIPT_ENTITY_NURSE; IScriptEntity [a13c]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Small Shield. [a13d]40.byte SHIELD_SMALL; InventoryItem [a13e]43 a1pointer @_ISCRIPT_A13B_HAS_SMALL_SHIELD; If yes, jump. [a140]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DOCTOR_CAN_HELP. [a141]45.byte MESSAGEID_DOCTOR_CAN_HELP; Message [a142]00.byte ISCRIPT_ACTION_END; End. [a143]@_ISCRIPT_A13B_HAS_SMALL_SHIELD: [a143]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_POISON_IS_BAD. [a144]46.byte MESSAGEID_POISON_IS_BAD; Message [a145]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f82] ; ISCRIPT_ADDRS_U [$PRG12::a01a] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f82] ; ISCRIPT_ADDRS_U [$PRG12::a01a] ;
[a146]ISCRIPT_A146: [a146]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a147]0c.byte ISCRIPT_ACTION_CHECK_PLAYER_RANK; Check if the player has reached Aspirant yet. [a148]01.byte RANK_ASPIRANT; PlayerTitle [a149]4e a1pointer @_ISCRIPT_A146_HAS_ASPIRANT; If yes, jump. [a14b]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_LEARN_MANTRAS. [a14c]47.byte MESSAGEID_LEARN_MANTRAS; Message [a14d]00.byte ISCRIPT_ACTION_END; End. [a14e]@_ISCRIPT_A146_HAS_ASPIRANT: [a14e]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_SECRET_GURU_IN_TOWER. [a14f]48.byte MESSAGEID_SECRET_GURU_IN_TOWER; Message [a150]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f83] ; ISCRIPT_ADDRS_U [$PRG12::a01b] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f83] ; ISCRIPT_ADDRS_U [$PRG12::a01b] ;
[a151]ISCRIPT_A151: [a151]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a152]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_CARRY_ITEMS. [a153]49.byte MESSAGEID_CARRY_ITEMS; Message [a154]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; An empty interaction. ; ; This immediately terminates. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f86] ; ISCRIPT_ADDRS_U [$PRG12::a01e] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f86] ; ISCRIPT_ADDRS_U [$PRG12::a01e] ;
[a155]ISCRIPT_A155: [a155]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a156]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f8b] ; ISCRIPT_ADDRS_U [$PRG12::a023] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f8b] ; ISCRIPT_ADDRS_U [$PRG12::a023] ;
[a157]ISCRIPT_FOREPAW_GREETER: [a157]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a158]0b.byte ISCRIPT_ACTION_CHECK_QUEST; Check if the player has completed the Spring of Trunk quest. [a159]01.byte QUEST_SPRING_OF_TRUNK; Quests [a15a]5f a1pointer @_ISCRIPT_FOREPAW_GREETER_SPRING_OF_TRUNK_COMPLETE; If yes, jump. [a15c]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_WELCOME_TO_FOREPAW. [a15d]4a.byte MESSAGEID_WELCOME_TO_FOREPAW; Message [a15e]00.byte ISCRIPT_ACTION_END; End. [a15f]@_ISCRIPT_FOREPAW_GREETER_SPRING_OF_TRUNK_COMPLETE: [a15f]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_FOUNTAIN_WILL_FLOW_TO_TOWN. [a160]4b.byte MESSAGEID_FOUNTAIN_WILL_FLOW_TO_TOWN; Message [a161]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f8c] ; ISCRIPT_ADDRS_U [$PRG12::a024] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f8c] ; ISCRIPT_ADDRS_U [$PRG12::a024] ;
[a162]ISCRIPT_A162: [a162]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a163]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Ring of Ruby. [a164]81.byte SPECIAL_RING_OF_RUBY; InventoryItem [a165]6a a1pointer @_ISCRIPT_A162_HAS_RING_OF_RUBY; If yes, jump. [a167]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_FIND_3_SPRINGS. [a168]4c.byte MESSAGEID_FIND_3_SPRINGS; Message [a169]00.byte ISCRIPT_ACTION_END; End. [a16a]@_ISCRIPT_A162_HAS_RING_OF_RUBY: [a16a]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_WATER_IS_FLOWING. [a16b]4d.byte MESSAGEID_WATER_IS_FLOWING; Message [a16c]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f8d] ; ISCRIPT_ADDRS_U [$PRG12::a025] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f8d] ; ISCRIPT_ADDRS_U [$PRG12::a025] ;
[a16d]ISCRIPT_A16D: [a16d]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a16e]0b.byte ISCRIPT_ACTION_CHECK_QUEST; Check if the player has completed the Spring of Trunk quest. [a16f]01.byte QUEST_SPRING_OF_TRUNK; Quests [a170]75 a1pointer @_ISCRIPT_A175; If yes, jump. [a172]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_FOUNTAIN_IN_SKY. [a173]4e.byte MESSAGEID_FOUNTAIN_IN_SKY; Message [a174]00.byte ISCRIPT_ACTION_END; End. [a175]@_ISCRIPT_A175: [a175]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_PUSH_FOUNTAIN_ROCK. [a176]4f.byte MESSAGEID_PUSH_FOUNTAIN_ROCK; Message [a177]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f8e] ; ISCRIPT_ADDRS_U [$PRG12::a026] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f8e] ; ISCRIPT_ADDRS_U [$PRG12::a026] ;
[a178]ISCRIPT_A178: [a178]85.byte ISCRIPT_ENTITY_NURSE; IScriptEntity [a179]0b.byte ISCRIPT_ACTION_CHECK_QUEST; Check if the player has completed the Spring of Trunk quest. [a17a]01.byte QUEST_SPRING_OF_TRUNK; Quests [a17b]80 a1pointer @_ISCRIPT_A178_SPRING_OF_TRUNK_COMPLETED; If yes, jump. [a17d]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_SPRING_IN_TOWER. [a17e]50.byte MESSAGEID_SPRING_IN_TOWER; Message [a17f]00.byte ISCRIPT_ACTION_END; End. [a180]@_ISCRIPT_A178_SPRING_OF_TRUNK_COMPLETED: [a180]0b.byte ISCRIPT_ACTION_CHECK_QUEST; Check if the player has completed the Spring of Sky quest. [a181]02.byte QUEST_SPRING_OF_SKY; Quests [a182]87 a1pointer @_ISCRIPT_A178_SPRING_OF_SKY_COMPLETED; If yes, jump. [a184]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_WINGBOOTS_IN_TOWER. [a185]51.byte MESSAGEID_WINGBOOTS_IN_TOWER; Message [a186]00.byte ISCRIPT_ACTION_END; End. [a187]@_ISCRIPT_A178_SPRING_OF_SKY_COMPLETED: [a187]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DIRECTIONS_TO_MASCON. [a188]52.byte MESSAGEID_DIRECTIONS_TO_MASCON; Message [a189]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f8f] ; ISCRIPT_ADDRS_U [$PRG12::a027] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f8f] ; ISCRIPT_ADDRS_U [$PRG12::a027] ;
[a18a]ISCRIPT_A18A: [a18a]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a18b]0b.byte ISCRIPT_ACTION_CHECK_QUEST; Check if the Spring of Sky quest is complete. [a18c]02.byte QUEST_SPRING_OF_SKY; Quests [a18d]92 a1pointer @_ISCRIPT_A18A_IS_COMPLETE; If yes, jump. [a18f]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_FOUNTAIN_IN_SKY_HINT. [a190]54.byte MESSAGEID_FOUNTAIN_IN_SKY_HINT; Message [a191]00.byte ISCRIPT_ACTION_END; End. [a192]@_ISCRIPT_A18A_IS_COMPLETE: [a192]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Joker key. [a193]88.byte KEY_JO; InventoryItem [a194]9b a1pointer @_ISCRIPT_A192_HAS_JOKER; If yes, jump. [a196]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_USE_THIS_KEY_FOR_FIRST_SPRING. [a197]55.byte MESSAGEID_USE_THIS_KEY_FOR_FIRST_SPRING; Message [a198]07.byte ISCRIPT_ACTION_ADD_ITEM; Add the Joker key to the inventory. [a199]88.byte KEY_JO; InventoryItem [a19a]00.byte ISCRIPT_ACTION_END; End. [a19b]@_ISCRIPT_A192_HAS_JOKER: [a19b]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Show MESSAGE_GET_JOKER_OR_COME_BACK. [a19c]56.byte MESSAGEID_GET_JOKER_OR_COME_BACK; Message [a19d]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Spring of Sky man. ; ; He's asleep. Must talk to him twice to wake him up, which ; completes that quest. ; ; With a second interaction, he'll tell you to find a key ; and reach the fountain. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f90] ; ISCRIPT_ADDRS_U [$PRG12::a028] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f90] ; ISCRIPT_ADDRS_U [$PRG12::a028] ;
[a19e]ISCRIPT_SPRING_OF_SKY: [a19e]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a19f]0b.byte ISCRIPT_ACTION_CHECK_QUEST; Check if the Spring of Sky quest is complete. [a1a0]02.byte QUEST_SPRING_OF_SKY; Quests [a1a1]a8 a1pointer @_ISCRIPT_SPRING_OF_SKY_IS_COMPLETE; If it has, jump. [a1a3]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_HO_HO_HO_ZZZ. [a1a4]57.byte MESSAGEID_HO_HO_HO_ZZZ; Message [a1a5]0e.byte ISCRIPT_ACTION_SET_QUEST_COMPLETE; Mark the Springs man as woken up. [a1a6]02.byte QUEST_SPRING_OF_SKY; Quests [a1a7]00.byte ISCRIPT_ACTION_END; End [a1a8]@_ISCRIPT_SPRING_OF_SKY_IS_COMPLETE: [a1a8]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_GET_KEY_FIND_FOUNTAIN. [a1a9]58.byte MESSAGEID_GET_KEY_FIND_FOUNTAIN; Message [a1aa]00.byte ISCRIPT_ACTION_END; End
;============================================================================ ; Interaction with the Spring of Trunk man. ; ; If the quest was not complete, he'll explain that you ; need the Elixir. If the player already has it, it will ; get consumed and the quest will be complete. Otherwise, ; he'll say to come back with the medicine. ; ; If the quest was already complete, he'll say to find the ; poison in Mascon. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f91] ; ISCRIPT_ADDRS_U [$PRG12::a029] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f91] ; ISCRIPT_ADDRS_U [$PRG12::a029] ;
[a1ab]ISCRIPT_SPRING_OF_TRUNK: [a1ab]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a1ac]0b.byte ISCRIPT_ACTION_CHECK_QUEST; Check if the Spring of Trunk quest is complete. [a1ad]01.byte QUEST_SPRING_OF_TRUNK; Quests [a1ae]c0 a1pointer @_ISCRIPT_SPRING_OF_TRUNK_IS_COMPLETE; If yes, jump. [a1b0]02.byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Else, show MESSAGE_THIS_IS_SPRING_OF_TRUNK_GET_ELIXIR. [a1b1]59.byte MESSAGEID_THIS_IS_SPRING_OF_TRUNK_GET_ELIXIR; Message [a1b2]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Elixir. [a1b3]92.byte SPECIAL_ELIXIR; InventoryItem [a1b4]b9 a1pointer @_ISCRIPT_SPRING_OF_TRUNK_HAS_ELIXIR; If yes, jump. [a1b6]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_COME_BACK_WITH_MEDICINE. [a1b7]5b.byte MESSAGEID_COME_BACK_WITH_MEDICINE; Message [a1b8]00.byte ISCRIPT_ACTION_END; End. [a1b9]@_ISCRIPT_SPRING_OF_TRUNK_HAS_ELIXIR: [a1b9]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Show MESSAGE_2_MORE_SPRINGS. [a1ba]5a.byte MESSAGEID_2_MORE_SPRINGS; Message [a1bb]10.byte ISCRIPT_ACTION_CONSUME_ITEM; Consume the player's Elixir. [a1bc]92.byte SPECIAL_ELIXIR; InventoryItem [a1bd]0e.byte ISCRIPT_ACTION_SET_QUEST_COMPLETE; Mark the Spring of Trunk as complete. [a1be]01.byte QUEST_SPRING_OF_TRUNK; Quests [a1bf]00.byte ISCRIPT_ACTION_END; End. [a1c0]@_ISCRIPT_SPRING_OF_TRUNK_IS_COMPLETE: [a1c0]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_FIND_POISON_IN_MASCON. [a1c1]5c.byte MESSAGEID_FIND_POISON_IN_MASCON; Message [a1c2]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f92] ; ISCRIPT_ADDRS_U [$PRG12::a02a] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f92] ; ISCRIPT_ADDRS_U [$PRG12::a02a] ;
[a1c3]ISCRIPT_A1C3: [a1c3]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box [a1c4]0b.byte ISCRIPT_ACTION_CHECK_QUEST; Check if all spring quests are complete. [a1c5]03.byte $03; Quests [a1c6]cd a1pointer @_ISCRIPT_A1C3_COMPLETED_SPRINGS; If so, jump. [a1c8]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_WILL_REVIVE_SPRING [a1c9]5d.byte MESSAGEID_WILL_REVIVE_SPRING; Message [a1ca]0e.byte ISCRIPT_ACTION_SET_QUEST_COMPLETE; Mark all spring quests as complete. [a1cb]03.byte $03; Quests [a1cc]00.byte ISCRIPT_ACTION_END; End. [a1cd]@_ISCRIPT_A1C3_COMPLETED_SPRINGS: [a1cd]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Ring of Ruby. [a1ce]81.byte SPECIAL_RING_OF_RUBY; InventoryItem [a1cf]d6 a1pointer @_ISCRIPT_A1CD_HAS_RING_OF_RUBY; If so, jump. [a1d1]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_GIVING_RING_OF_RUBY [a1d2]5e.byte MESSAGEID_GIVING_RING_OF_RUBY; Message [a1d3]07.byte ISCRIPT_ACTION_ADD_ITEM; Give the player the Ring of Ruby. [a1d4]81.byte SPECIAL_RING_OF_RUBY; InventoryItem [a1d5]00.byte ISCRIPT_ACTION_END; End. [a1d6]@_ISCRIPT_A1CD_HAS_RING_OF_RUBY: [a1d6]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_TRUST_YOUR_POWER [a1d7]5f.byte MESSAGEID_TRUST_YOUR_POWER; Message [a1d8]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f9b] ; ISCRIPT_ADDRS_U [$PRG12::a033] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f9b] ; ISCRIPT_ADDRS_U [$PRG12::a033] ;
[a1d9]ISCRIPT_A1D9: [a1d9]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a1da]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Large Shield. [a1db]41.byte SHIELD_LARGE; InventoryItem [a1dc]e1 a1pointer @_ISCRIPT_A1D9_HAS_LARGE_SHIELD; If so, jump. [a1de]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_WELCOME_TO_MASCON [a1df]60.byte MESSAGEID_WELCOME_TO_MASCON; Message [a1e0]00.byte ISCRIPT_ACTION_END; End. [a1e1]@_ISCRIPT_A1D9_HAS_LARGE_SHIELD: [a1e1]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_PREPARE_BEFORE_FOREPAW. [a1e2]61.byte MESSAGEID_PREPARE_BEFORE_FOREPAW; Message [a1e3]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f9c] ; ISCRIPT_ADDRS_U [$PRG12::a034] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f9c] ; ISCRIPT_ADDRS_U [$PRG12::a034] ;
[a1e4]ISCRIPT_A1E4: [a1e4]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a1e5]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Pendant. [a1e6]93.byte SPECIAL_PENDANT; InventoryItem [a1e7]ec a1pointer @_ISCRIPT_A1E4_HAS_PENDANT; If so, jump. [a1e9]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_METEORITE_BECOMES_POISON [a1ea]62.byte MESSAGEID_METEORITE_BECOMES_POISON; Message [a1eb]00.byte ISCRIPT_ACTION_END; End. [a1ec]@_ISCRIPT_A1E4_HAS_PENDANT: [a1ec]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DID_YOU_GET_PENDANT. [a1ed]63.byte MESSAGEID_DID_YOU_GET_PENDANT; Message [a1ee]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f9d] ; ISCRIPT_ADDRS_U [$PRG12::a035] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f9d] ; ISCRIPT_ADDRS_U [$PRG12::a035] ;
[a1ef]ISCRIPT_A1EF: [a1ef]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a1f0]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Large Shield. [a1f1]41.byte SHIELD_LARGE; InventoryItem [a1f2]f7 a1pointer @_ISCRIPT_A1EF_HAS_SHIELD; If so, branch. [a1f4]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_STORES_OUTSIDE_TOWN [a1f5]64.byte MESSAGEID_STORES_OUTSIDE_TOWN; Message [a1f6]00.byte ISCRIPT_ACTION_END; End. [a1f7]@_ISCRIPT_A1EF_HAS_SHIELD: [a1f7]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THIS_IS_LARGE_SHIELD. [a1f8]65.byte MESSAGEID_THIS_IS_LARGE_SHIELD; Message [a1f9]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f9e] ; ISCRIPT_ADDRS_U [$PRG12::a036] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f9e] ; ISCRIPT_ADDRS_U [$PRG12::a036] ;
[a1fa]ISCRIPT_A1FA: [a1fa]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a1fb]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Fire magic. [a1fc]62.byte MAGIC_FIRE; InventoryItem [a1fd]02 a2pointer @_ISCRIPT_A1FA_HAS_FIRE; If so, jump. [a1ff]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DIRECTIONS_TO_SUFFER. [a200]66.byte MESSAGEID_DIRECTIONS_TO_SUFFER; Message [a201]00.byte ISCRIPT_ACTION_END; End. [a202]@_ISCRIPT_A1FA_HAS_FIRE: [a202]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_NEED_WING_BOOTS_FOR_MIST. [a203]67.byte MESSAGEID_NEED_WING_BOOTS_FOR_MIST; Message [a204]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f9f] ; ISCRIPT_ADDRS_U [$PRG12::a037] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f9f] ; ISCRIPT_ADDRS_U [$PRG12::a037] ;
[a205]ISCRIPT_A205: [a205]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a206]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Fire magic. [a207]62.byte MAGIC_FIRE; InventoryItem [a208]0d a2pointer @_ISCRIPT_A205_HAS_FIRE; If so, jump. [a20a]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_WELCOME_TO_MIST [a20b]68.byte MESSAGEID_WELCOME_TO_MIST; Message [a20c]00.byte ISCRIPT_ACTION_END; End. [a20d]@_ISCRIPT_A205_HAS_FIRE: [a20d]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_HOUSE_OUTSIDE_ABANDONED. [a20e]69.byte MESSAGEID_HOUSE_OUTSIDE_ABANDONED; Message [a20f]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with a man sitting in a house in the Mist part of the ; Overworld. ; ; This house is nested in the bottom-right of the ; overworld part of the Mist area. ; ; If the player has the Fire magic, he'll say that it's ; best you keep the pendant. Otherwise, he'll say you'll ; reach the town of Suffer soon. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa0] ; ISCRIPT_ADDRS_U [$PRG12::a038] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa0] ; ISCRIPT_ADDRS_U [$PRG12::a038] ;
[a210]ISCRIPT_OVERWORLD_MIST_HOUSE_MAN: [a210]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a211]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Pendant. [a212]93.byte SPECIAL_PENDANT; InventoryItem [a213]18 a2pointer @_ISCRIPT_OVERWORLD_MIST_HOUSE_MAN_HAS_PENDANT; If so, jump. [a215]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_TOWER_OF_SUFFER_SOON. [a216]6a.byte MESSAGEID_TOWER_OF_SUFFER_SOON; Message [a217]00.byte ISCRIPT_ACTION_END; End. [a218]@_ISCRIPT_OVERWORLD_MIST_HOUSE_MAN_HAS_PENDANT: [a218]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_KEEP_PENDANT. [a219]6b.byte MESSAGEID_KEEP_PENDANT; Message [a21a]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with a woman walking in a house in the Mist part of the ; Overworld. ; ; This house is nested in the bottom-right of the ; overworld part of the Mist area. ; ; If the player has the Pendant, she'll say that the ; Meteorite has moved. Otherwise, she'll say that the ; dwarves are chanting to the meteorite. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa1] ; ISCRIPT_ADDRS_U [$PRG12::a039] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa1] ; ISCRIPT_ADDRS_U [$PRG12::a039] ;
[a21b]ISCRIPT_OVERWORLD_MIST_HOUSE_WOMAN: [a21b]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a21c]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Pendant. [a21d]93.byte SPECIAL_PENDANT; InventoryItem [a21e]23 a2pointer @_ISCRIPT_OVERWORLD_MIST_HOUSE_WOMAN_HAS_PENDANT; If so, jump. [a220]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DWARVES_CHANTING. [a221]6c.byte MESSAGEID_DWARVES_CHANTING; Message [a222]00.byte ISCRIPT_ACTION_END; End. [a223]@_ISCRIPT_OVERWORLD_MIST_HOUSE_WOMAN_HAS_PENDANT: [a223]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_METEORITE_WAS_MOVED. [a224]6d.byte MESSAGEID_METEORITE_WAS_MOVED; Message [a225]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa2] ; ISCRIPT_ADDRS_U [$PRG12::a03a] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa2] ; ISCRIPT_ADDRS_U [$PRG12::a03a] ;
[a226]ISCRIPT_A226: [a226]85.byte ISCRIPT_ENTITY_NURSE; XXX Show a portrait box [a227]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Hour Glass. [a228]8d.byte ITEM_HOUR_GLASS; InventoryItem [a229]2e a2pointer @_ISCRIPT_A226_HAS_HOURGLASS; If so, jump. [a22b]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_HOUR_GLASS. [a22c]6e.byte MESSAGEID_HOUR_GLASS; Message [a22d]00.byte ISCRIPT_ACTION_END; End. [a22e]@_ISCRIPT_A226_HAS_HOURGLASS: [a22e]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_HOUR_GLASS_USES_ENERGY. [a22f]6f.byte MESSAGEID_HOUR_GLASS_USES_ENERGY; Message [a230]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fab] ; ISCRIPT_ADDRS_U [$PRG12::a043] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fab] ; ISCRIPT_ADDRS_U [$PRG12::a043] ;
[a231]ISCRIPT_A231: [a231]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a232]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Thunder magic. [a233]61.byte MAGIC_THUNDER; InventoryItem [a234]39 a2pointer @_ISCRIPT_A231_HAS_THUNDER; If so, jump. [a236]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_WELCOME_TO_VICTIM. [a237]70.byte MESSAGEID_WELCOME_TO_VICTIM; Message [a238]00.byte ISCRIPT_ACTION_END; End. [a239]@_ISCRIPT_A231_HAS_THUNDER: [a239]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DANGEROUS_WITHOUT_MAGIC. [a23a]71.byte MESSAGEID_DANGEROUS_WITHOUT_MAGIC; Message [a23b]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fac] ; ISCRIPT_ADDRS_U [$PRG12::a044] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fac] ; ISCRIPT_ADDRS_U [$PRG12::a044] ;
[a23c]ISCRIPT_A23C: [a23c]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a23d]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Thunder magic. [a23e]61.byte MAGIC_THUNDER; InventoryItem [a23f]44 a2pointer @_ISCRIPT_A23C_HAS_THUNDER; If so, jump. [a241]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_MAGIC_CONSUMES_POWER. [a242]7b.byte MESSAGEID_MAGIC_CONSUMES_POWER; Message [a243]00.byte ISCRIPT_ACTION_END; End. [a244]@_ISCRIPT_A23C_HAS_THUNDER: [a244]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_METEORITE_BECOMES_BLACK_ONYX. [a245]7c.byte MESSAGEID_METEORITE_BECOMES_BLACK_ONYX; Message [a246]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fad] ; ISCRIPT_ADDRS_U [$PRG12::a045] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fad] ; ISCRIPT_ADDRS_U [$PRG12::a045] ;
[a247]ISCRIPT_A247: [a247]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a248]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Thunder magic. [a249]61.byte MAGIC_THUNDER; InventoryItem [a24a]4f a2pointer @_ISCRIPT_A247_HAS_THUNDER; If so, jump. [a24c]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_MAGIC_HALL_OUTSIDE_TOWN. [a24d]72.byte MESSAGEID_MAGIC_HALL_OUTSIDE_TOWN; Message [a24e]00.byte ISCRIPT_ACTION_END; End. [a24f]@_ISCRIPT_A247_HAS_THUNDER: [a24f]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_MAGIC_CANE. [a250]73.byte MESSAGEID_MAGIC_CANE; Message [a251]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fae] ; ISCRIPT_ADDRS_U [$PRG12::a046] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fae] ; ISCRIPT_ADDRS_U [$PRG12::a046] ;
[a252]ISCRIPT_A252: [a252]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a253]0c.byte ISCRIPT_ACTION_CHECK_PLAYER_RANK; Check if the Player has at least the Soldier rank. [a254]0a.byte RANK_SOLDIER; PlayerTitle [a255]5a a2pointer @_ISCRIPT_A252_HAS_RANK; If so, jump. [a257]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_GO_TO_CAPITAL. [a258]74.byte MESSAGEID_GO_TO_CAPITAL; Message [a259]00.byte ISCRIPT_ACTION_END; End. [a25a]@_ISCRIPT_A252_HAS_RANK: [a25a]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Full Plate armor. [a25b]22.byte ARMOR_FULL_PLATE; InventoryItem [a25c]63 a2pointer @_ISCRIPT_A252_HAS_ARMOR; If so, jump. [a25e]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_GOT_ARMOR_FOR_BOTTLE. [a25f]75.byte MESSAGEID_GOT_ARMOR_FOR_BOTTLE; Message [a260]07.byte ISCRIPT_ACTION_ADD_ITEM; Add the full plate to the inventory. [a261]22.byte ARMOR_FULL_PLATE; InventoryItem [a262]00.byte ISCRIPT_ACTION_END; End. [a263]@_ISCRIPT_A252_HAS_ARMOR: [a263]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_ILL_HAVE_DRINK. [a264]76.byte MESSAGEID_ILL_HAVE_DRINK; Message [a265]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9faf] ; ISCRIPT_ADDRS_U [$PRG12::a047] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9faf] ; ISCRIPT_ADDRS_U [$PRG12::a047] ;
[a266]ISCRIPT_A266: [a266]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a267]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Thunder magic. [a268]61.byte MAGIC_THUNDER; InventoryItem [a269]6e a2pointer @_ISCRIPT_A266_HAS_THUNDER; If so, jump. [a26b]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_IM_LOST. [a26c]77.byte MESSAGEID_IM_LOST; Message [a26d]00.byte ISCRIPT_ACTION_END; End. [a26e]@_ISCRIPT_A266_HAS_THUNDER: [a26e]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_IM_LOST_MAGIC_DOES_NOT_WORK. [a26f]78.byte MESSAGEID_IM_LOST_MAGIC_DOES_NOT_WORK; Message [a270]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fb0] ; ISCRIPT_ADDRS_U [$PRG12::a048] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fb0] ; ISCRIPT_ADDRS_U [$PRG12::a048] ;
[a271]ISCRIPT_A271: [a271]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a272]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Thunder magic. [a273]61.byte MAGIC_THUNDER; InventoryItem [a274]79 a2pointer @_ISCRIPT_A271_HAS_THUNDER; If so, branch. [a276]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_MAGIC_OF_JUSTICE_OR_DESTRUCTION. [a277]79.byte MESSAGEID_MAGIC_OF_JUSTICE_OR_DESTRUCTION; Message [a278]00.byte ISCRIPT_ACTION_END; End. [a279]@_ISCRIPT_A271_HAS_THUNDER: [a279]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_MAGIC_INDIVIDUAL_POWERS. [a27a]7a.byte MESSAGEID_MAGIC_INDIVIDUAL_POWERS; Message [a27b]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fb1] ; ISCRIPT_ADDRS_U [$PRG12::a049] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fb1] ; ISCRIPT_ADDRS_U [$PRG12::a049] ;
[a27c]ISCRIPT_A27C: [a27c]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a27d]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Black Onyx. [a27e]94.byte SPECIAL_BLACK_ONYX; InventoryItem [a27f]84 a2pointer @_ISCRIPT_A27C_HAS_BLACK_ONYX; If so, jump. [a281]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DIRECTIONS_TO_TOWER_OF_MIST. [a282]7d.byte MESSAGEID_DIRECTIONS_TO_TOWER_OF_MIST; Message [a283]00.byte ISCRIPT_ACTION_END; End. [a284]@_ISCRIPT_A27C_HAS_BLACK_ONYX: [a284]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the "A" key. [a285]84.byte KEY_A; InventoryItem [a286]8d a2pointer @_ISCRIPT_A27C_HAS_KEY; If so, jump. [a288]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_USE_KEY_FOR_CONFLATE. [a289]7e.byte MESSAGEID_USE_KEY_FOR_CONFLATE; Message [a28a]07.byte ISCRIPT_ACTION_ADD_ITEM; Add the "A" key to the inventory. [a28b]84.byte KEY_A; InventoryItem [a28c]00.byte ISCRIPT_ACTION_END; End. [a28d]@_ISCRIPT_A27C_HAS_KEY: [a28d]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_YOU_NEED_KEY_ACE. [a28e]7f.byte MESSAGEID_YOU_NEED_KEY_ACE; Message [a28f]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fbb] ; ISCRIPT_ADDRS_U [$PRG12::a053] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fbb] ; ISCRIPT_ADDRS_U [$PRG12::a053] ;
[a290]ISCRIPT_A290: [a290]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic textbox. [a291]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Giant Blade. [a292]02.byte WEAPON_GIANT_BLADE; InventoryItem [a293]98 a2pointer @_ISCRIPT_A290_HAS_GIANT_BLADE; If so, jump. [a295]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_WELCOME_TO_CONFLATE. [a296]80.byte MESSAGEID_WELCOME_TO_CONFLATE; Message [a297]00.byte ISCRIPT_ACTION_END; End. [a298]@_ISCRIPT_A290_HAS_GIANT_BLADE: [a298]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_LEGENDARY_SHIELD_HELMET. [a299]81.byte MESSAGEID_LEGENDARY_SHIELD_HELMET; Message [a29a]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fbc] ; ISCRIPT_ADDRS_U [$PRG12::a054] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fbc] ; ISCRIPT_ADDRS_U [$PRG12::a054] ;
[a29b]ISCRIPT_A29B: [a29b]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a29c]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Giant Blade. [a29d]02.byte WEAPON_GIANT_BLADE; InventoryItem [a29e]a3 a2pointer @_ISCRIPT_A29B_HAS_GIANT_BLADE; If so, jump. [a2a0]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_TOWN_SURROUNDED_BY_DOORS. [a2a1]82.byte MESSAGEID_TOWN_SURROUNDED_BY_DOORS; Message [a2a2]00.byte ISCRIPT_ACTION_END; End. [a2a3]@_ISCRIPT_A29B_HAS_GIANT_BLADE: [a2a3]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_SEE_GURU_AFTER_SHIELD_HELMET. [a2a4]83.byte MESSAGEID_SEE_GURU_AFTER_SHIELD_HELMET; Message [a2a5]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fbd] ; ISCRIPT_ADDRS_U [$PRG12::a055] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fbd] ; ISCRIPT_ADDRS_U [$PRG12::a055] ;
[a2a6]ISCRIPT_A2A6: [a2a6]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a2a7]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Ring of Dworf. [a2a8]82.byte SPECIAL_RING_OF_DWORF; InventoryItem [a2a9]ae a2pointer @_ISCRIPT_A2A6_HAS_RING_OF_DWORF; If so, jump. [a2ab]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_GUARDIAN_OF_GURU. [a2ac]84.byte MESSAGEID_GUARDIAN_OF_GURU; Message [a2ad]00.byte ISCRIPT_ACTION_END; End. [a2ae]@_ISCRIPT_A2A6_HAS_RING_OF_DWORF: [a2ae]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Magical Rod. [a2af]8a.byte SPECIAL_MAGICAL_ROD; InventoryItem [a2b0]b5 a2pointer @_ISCRIPT_A2A6_HAS_MAGICAL_ROD; If so, jump. [a2b2]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_SOMETHING_YOU_CAN_GET. [a2b3]85.byte MESSAGEID_SOMETHING_YOU_CAN_GET; Message [a2b4]00.byte ISCRIPT_ACTION_END; End. [a2b5]@_ISCRIPT_A2A6_HAS_MAGICAL_ROD: [a2b5]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_RELY_ON_MAGIC_FINAL_BATTLE. [a2b6]86.byte MESSAGEID_DONT_RELY_ON_MAGIC_FINAL_BATTLE; Message [a2b7]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fbe] ; ISCRIPT_ADDRS_U [$PRG12::a056] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fbe] ; ISCRIPT_ADDRS_U [$PRG12::a056] ;
[a2b8]ISCRIPT_A2B8: [a2b8]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a2b9]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Battle Helmet. [a2ba]43.byte SHIELD_BATTLE_HELMET; InventoryItem [a2bb]c0 a2pointer @_ISCRIPT_A2B8_HAS_BATTLE_HELMET; If so, jump. [a2bd]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_USED_TO_TRADE_WITH_DWARVES. [a2be]87.byte MESSAGEID_USED_TO_TRADE_WITH_DWARVES; Message [a2bf]00.byte ISCRIPT_ACTION_END; End. [a2c0]@_ISCRIPT_A2B8_HAS_BATTLE_HELMET: [a2c0]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_USED_TO_BE_SKILLED. [a2c1]88.byte MESSAGEID_USED_TO_BE_SKILLED; Message [a2c2]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fbf] ; ISCRIPT_ADDRS_U [$PRG12::a057] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fbf] ; ISCRIPT_ADDRS_U [$PRG12::a057] ;
[a2c3]ISCRIPT_A2C3: [a2c3]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a2c4]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Battle Helmet. [a2c5]43.byte SHIELD_BATTLE_HELMET; InventoryItem [a2c6]cb a2pointer @_ISCRIPT_A2C3_HAS_BATTLE_HELMET; If so, jump. [a2c8]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_USED_TO_VISIT_DWARVES. [a2c9]89.byte MESSAGEID_USED_TO_VISIT_DWARVES; Message [a2ca]00.byte ISCRIPT_ACTION_END; End. [a2cb]@_ISCRIPT_A2C3_HAS_BATTLE_HELMET: [a2cb]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_AM_PICKPOCKET. [a2cc]8a.byte MESSAGEID_I_AM_PICKPOCKET; Message [a2cd]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fcb] ; ISCRIPT_ADDRS_U [$PRG12::a063] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fcb] ; ISCRIPT_ADDRS_U [$PRG12::a063] ;
[a2ce]ISCRIPT_A2CE: [a2ce]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a2cf]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Tilte magic. [a2d0]64.byte MAGIC_TILTE; InventoryItem [a2d1]d6 a2pointer @_ISCRIPT_A2CE_HAS_TILTE; If so, jump. [a2d3]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DIRECTIONS_DAYBREAK. [a2d4]8d.byte MESSAGEID_DIRECTIONS_DAYBREAK; Message [a2d5]00.byte ISCRIPT_ACTION_END; End. [a2d6]@_ISCRIPT_A2CE_HAS_TILTE: [a2d6]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_FRIENDS_IN_DARTMOOR. [a2d7]8e.byte MESSAGEID_FRIENDS_IN_DARTMOOR; Message [a2d8]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fcc] ; ISCRIPT_ADDRS_U [$PRG12::a064] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fcc] ; ISCRIPT_ADDRS_U [$PRG12::a064] ;
[a2d9]ISCRIPT_A2D9: [a2d9]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a2da]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Battle Suit. [a2db]23.byte ARMOR_BATTLE_SUIT; InventoryItem [a2dc]e1 a2pointer @_ISCRIPT_A2D9_HAS_BATTLE_SUIT; If so, jump. [a2de]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_LOOK_FOR_BATTLE_SUIT. [a2df]8f.byte MESSAGEID_LOOK_FOR_BATTLE_SUIT; Message [a2e0]00.byte ISCRIPT_ACTION_END; End. [a2e1]@_ISCRIPT_A2D9_HAS_BATTLE_SUIT: [a2e1]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_FIND_MAGIC_CANE. [a2e2]90.byte MESSAGEID_FIND_MAGIC_CANE; Message [a2e3]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XXX Check if easter egg? ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fcd] ; ISCRIPT_ADDRS_U [$PRG12::a065] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fcd] ; ISCRIPT_ADDRS_U [$PRG12::a065] ;
[a2e4]ISCRIPT_A2E4: [a2e4]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a2e5]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Ring of Dworf. [a2e6]82.byte SPECIAL_RING_OF_DWORF; InventoryItem [a2e7]ec a2pointer @_ISCRIPT_A2E4_HAS_RING_OF_DWORF; If so, jump. [a2e9]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_YOU_ARE_FAMOUS_GOOD_LOOKING. [a2ea]91.byte MESSAGEID_YOU_ARE_FAMOUS_GOOD_LOOKING; Message [a2eb]00.byte ISCRIPT_ACTION_END; End. [a2ec]@_ISCRIPT_A2E4_HAS_RING_OF_DWORF: [a2ec]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_AUTOGRAPH. [a2ed]92.byte MESSAGEID_AUTOGRAPH; Message [a2ee]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fce] ; ISCRIPT_ADDRS_U [$PRG12::a066] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fce] ; ISCRIPT_ADDRS_U [$PRG12::a066] ;
[a2ef]ISCRIPT_A2EF: [a2ef]85.byte ISCRIPT_ENTITY_NURSE; XXX Show a portrait text box [a2f0]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Battle Suit. [a2f1]23.byte ARMOR_BATTLE_SUIT; InventoryItem [a2f2]f7 a2pointer @_ISCRIPT_A2EF_HAS_BATTLE_SUIT; If so, jump. [a2f4]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_WHEN_TAKE_BATH. [a2f5]93.byte MESSAGEID_WHEN_TAKE_BATH; Message [a2f6]00.byte ISCRIPT_ACTION_END; End. [a2f7]@_ISCRIPT_A2EF_HAS_BATTLE_SUIT: [a2f7]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_GURU_CONFLATE_HAS_RING_DWARVES. [a2f8]94.byte MESSAGEID_GURU_CONFLATE_HAS_RING_DWARVES; Message [a2f9]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fcf] ; ISCRIPT_ADDRS_U [$PRG12::a067] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fcf] ; ISCRIPT_ADDRS_U [$PRG12::a067] ;
[a2fa]ISCRIPT_A2FA: [a2fa]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a2fb]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Battle Suit. [a2fc]23.byte ARMOR_BATTLE_SUIT; InventoryItem [a2fd]02 a3pointer @_ISCRIPT_A2FA_HAS_BATTLE_SUIT; If so, jump. [a2ff]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DID_YOU_GET_BATTLE_SUIT. [a300]95.byte MESSAGEID_DID_YOU_GET_BATTLE_SUIT; Message [a301]00.byte ISCRIPT_ACTION_END; End. [a302]@_ISCRIPT_A2FA_HAS_BATTLE_SUIT: [a302]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show, MESSAGE_DARTMORE_IS_MAZE. [a303]96.byte MESSAGEID_DARTMORE_IS_MAZE; Message [a304]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fd0] ; ISCRIPT_ADDRS_U [$PRG12::a068] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fd0] ; ISCRIPT_ADDRS_U [$PRG12::a068] ;
[a305]ISCRIPT_A305: [a305]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a306]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Battle Suit. [a307]23.byte ARMOR_BATTLE_SUIT; InventoryItem [a308]0d a3pointer @_ISCRIPT_A305_HAS_BATTLE_SUIT; If so, jump. [a30a]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_IS_FIRST_VISIT_TO_STORE. [a30b]97.byte MESSAGEID_IS_FIRST_VISIT_TO_STORE; Message [a30c]00.byte ISCRIPT_ACTION_END; End. [a30d]@_ISCRIPT_A305_HAS_BATTLE_SUIT: [a30d]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_MAGIC_CANE_ABOVE_TOWER. [a30e]98.byte MESSAGEID_MAGIC_CANE_ABOVE_TOWER; Message [a30f]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fdb] ; ISCRIPT_ADDRS_U [$PRG12::a073] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fdb] ; ISCRIPT_ADDRS_U [$PRG12::a073] ;
[a310]ISCRIPT_A310: [a310]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a311]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Dragon Slayer. [a312]03.byte WEAPON_DRAGON_SLAYER; InventoryItem [a313]18 a3pointer @_ISCRIPT_A310_HAS_DRAGON_SLAYER; If so, jump. [a315]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DIRECTIONS_TO_FRATERNAL. [a316]99.byte MESSAGEID_DIRECTIONS_TO_FRATERNAL; Message [a317]00.byte ISCRIPT_ACTION_END; End. [a318]@_ISCRIPT_A310_HAS_DRAGON_SLAYER: [a318]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_YOU_NEED_DEMONS_RING. [a319]9a.byte MESSAGEID_YOU_NEED_DEMONS_RING; Message [a31a]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with a man sitting in a house in the overworld. ; ; This is in the bottom-left of an area otherwise full of ; enemy houses, 4 screens to the left of the Evil Fortress ; entrance. Exterior looks like a castle. ; ; If the player has the Dragon Slayer, he'll say to defeat ; evil with it. If not, he'll say that King Grieve has it. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fdc] ; ISCRIPT_ADDRS_U [$PRG12::a074] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fdc] ; ISCRIPT_ADDRS_U [$PRG12::a074] ;
[a31b]ISCRIPT_OVERWORLD_HOUSE_MAN: [a31b]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a31c]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Dragon Slayer. [a31d]03.byte WEAPON_DRAGON_SLAYER; InventoryItem [a31e]23 a3pointer @_ISCRIPT_OVERWORLD_HOUSE_MAN_HAS_DRAGON_SLAYER; If so, jump. [a320]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_KING_GRIEVE_HAS_DRAGON_SLAYER. [a321]9b.byte MESSAGEID_KING_GRIEVE_HAS_DRAGON_SLAYER; Message [a322]00.byte ISCRIPT_ACTION_END; End. [a323]@_ISCRIPT_OVERWORLD_HOUSE_MAN_HAS_DRAGON_SLAYER: [a323]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DEFEAT_EVIL_WITH_DRAGON_SLAYER. [a324]9c.byte MESSAGEID_DEFEAT_EVIL_WITH_DRAGON_SLAYER; Message [a325]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with a woman walking in a house in the overworld. ; ; This is in the bottom-left of an area otherwise full of ; enemy houses, 4 screens to the left of the Evil Fortress ; entrance. Exterior looks like a castle. ; ; If the player has the Dragon Slayer, she'll say that the ; Guru has the Demon's Ring. Otherwise, she'll say to find ; the Guru in Castle Fraternal. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fdd] ; ISCRIPT_ADDRS_U [$PRG12::a075] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fdd] ; ISCRIPT_ADDRS_U [$PRG12::a075] ;
[a326]ISCRIPT_OVERWORLD_HOUSE_WOMAN: [a326]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a327]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Dragon Slayer. [a328]03.byte WEAPON_DRAGON_SLAYER; InventoryItem [a329]2e a3pointer @_ISCRIPT_OVERWORLD_HOUSE_WOMAN_HAS_DRAGON_SLAYER; If so, jump. [a32b]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_GO_TO_FRATERNAL_GURU. [a32c]9d.byte MESSAGEID_GO_TO_FRATERNAL_GURU; Message [a32d]00.byte ISCRIPT_ACTION_END; End. [a32e]@_ISCRIPT_OVERWORLD_HOUSE_WOMAN_HAS_DRAGON_SLAYER: [a32e]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_GURU_HAS_DEMONS_RING. [a32f]9e.byte MESSAGEID_GURU_HAS_DEMONS_RING; Message [a330]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; TODO ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fde] ; ISCRIPT_ADDRS_U [$PRG12::a076] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fde] ; ISCRIPT_ADDRS_U [$PRG12::a076] ;
[a331]ISCRIPT_A331: [a331]00.byte ISCRIPT_ENTITY_GENERIC; Show a generic text box. [a332]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Dragon Slayer. [a333]03.byte WEAPON_DRAGON_SLAYER; InventoryItem [a334]39 a3pointer @_ISCRIPT_A331_HAS_DRAGON_SLAYER; If so, jump. [a336]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_SEARCH_CASTLE_FOR_GURU. [a337]9f.byte MESSAGEID_SEARCH_CASTLE_FOR_GURU; Message [a338]00.byte ISCRIPT_ACTION_END; End. [a339]@_ISCRIPT_A331_HAS_DRAGON_SLAYER: [a339]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_EVIL_IMMUNE_TO_MAGIC. [a33a]a0.byte MESSAGEID_EVIL_IMMUNE_TO_MAGIC; Message [a33b]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Guru of Castle Fraternal. ; ; If the player has both the Dragon Slayer sword ; and the Demon's Ring, the Guru will say he'll ; meditate for you. ; ; If the player has the Dragon Slayer but not the ; Demon's Ring, the player will receive the Demon's Ring ; and tell you King Grieve has been defeated and to use ; the ring to reach the final boss. ; ; If the player doesn't have the Dragon Slayer, the ; Guru will give exposition on the meteorite. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fdf] ; ISCRIPT_ADDRS_U [$PRG12::a077] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fdf] ; ISCRIPT_ADDRS_U [$PRG12::a077] ;
[a33c]ISCRIPT_FRATERNAL_GURU: [a33c]81.byte ISCRIPT_ENTITY_GURU; Show the Guru portrait text box. [a33d]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Dragon Slayer. [a33e]03.byte WEAPON_DRAGON_SLAYER; InventoryItem [a33f]44 a3pointer @_ISCRIPT_A33C_HAS_DRAGON_SLAYER; If so, jump. [a341]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_METEORITE_EXPOSITION_2. [a342]a1.byte MESSAGEID_METEORITE_EXPOSITION_2; Message [a343]00.byte ISCRIPT_ACTION_END; End. [a344]@_ISCRIPT_A33C_HAS_DRAGON_SLAYER: [a344]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Demon's Ring. [a345]83.byte SPECIAL_DEMONS_RING; InventoryItem [a346]4d a3pointer @_ISCRIPT_A33C_HAS_DEMONS_RING; If so, jump. [a348]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_DEFEATED_KING_GRIEVE. [a349]a2.byte MESSAGEID_DEFEATED_KING_GRIEVE; Message [a34a]07.byte ISCRIPT_ACTION_ADD_ITEM; Add the Demon's Ring to the inventory. [a34b]83.byte SPECIAL_DEMONS_RING; InventoryItem [a34c]00.byte ISCRIPT_ACTION_END; End. [a34d]@_ISCRIPT_A33C_HAS_DEMONS_RING: [a34d]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_ILL_MEDITATE_FOR_YOU. [a34e]a3.byte MESSAGEID_ILL_MEDITATE_FOR_YOU; Message [a34f]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the King. ; ; If the player has no gold, the King will say some ; exposition and give 1500G. ; ; If the player already has gold, the King will say there's ; nothing more he can do to help. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f73] ; ISCRIPT_ADDRS_U [$PRG12::a00b] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f73] ; ISCRIPT_ADDRS_U [$PRG12::a00b] ;
[a350]ISCRIPT_EOLIS_KING: [a350]80.byte ISCRIPT_ENTITY_KING; Show the King portrait text box. [a351]0d.byte ISCRIPT_ACTION_CHECK_GOLD; Check if the player has gold. [a352]5a a3pointer @_ISCRIPT_NPC_KING_FOLLOW_UP_HAS_GOLD; If so, jump. [a354]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_KING_EXPOSITION. [a355]35.byte MESSAGEID_KING_EXPOSITION; Message [a356]09.byte ISCRIPT_ACTION_ADD_GOLD; Add 1500 gold. [a357]dc 05.word $05dc; ushort [a359]00.byte ISCRIPT_ACTION_END; End. [a35a]@_ISCRIPT_NPC_KING_FOLLOW_UP_HAS_GOLD: [a35a]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_NOTHING_MORE_TO_HELP. [a35b]36.byte MESSAGEID_NOTHING_MORE_TO_HELP; Message [a35c]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction for Eolis Martial Arts / Magic Shop. ; ; The Martial Artist/Magician will give 40MP for 200G. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f79] ; ISCRIPT_ADDRS_U [$PRG12::a011] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f79] ; ISCRIPT_ADDRS_U [$PRG12::a011] ;
[a35d]ISCRIPT_EOLIS_MARTIAL_ARTS_MAGIC_SHOP: [a35d]83.byte ISCRIPT_ENTITY_MAGICIAN; Show the Magician portrait text box. [a35e]02.byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show a dismissible MESSAGE_MAGIC_200G. [a35f]15.byte MESSAGEID_MAGIC_200G; Message [a360]05.byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 200G. [a361]c8 00.word $00c8; ushort [a363]0a.byte ISCRIPT_ACTION_ADD_MP; Add 40MP. [a364]28.byte $28; byte [a365]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Show MESSAGE_WATCH_POWER_LEVEL. [a366]16.byte MESSAGEID_WATCH_POWER_LEVEL; Message [a367]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction for the after-Victim Magic Shop. ; ; The Magician will sell Fire magic for 3000G. ; ; If the player already has Fire, he will say magic ; can be used for justice or destruction depending on ; who uses it. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fb6] ; ISCRIPT_ADDRS_U [$PRG12::a04e] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fb6] ; ISCRIPT_ADDRS_U [$PRG12::a04e] ;
[a368]ISCRIPT_AFTER_VICTIM_MAGIC_SHOP: [a368]83.byte ISCRIPT_ENTITY_MAGICIAN; Show the Magician portrait text box. [a369]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Fire magic. [a36a]62.byte MAGIC_FIRE; InventoryItem [a36b]77 a3pointer @_ISCRIPT_AFTER_VICTIM_MAGIC_SHOP_HAS_FIRE; If so, jump. [a36d]02.byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Else, show a dismissible MESSAGE_MAGIC_FIRE_3000G. [a36e]17.byte MESSAGEID_MAGIC_FIRE_3000G; Message [a36f]05.byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 3000G. [a370]b8 0b.word $0bb8; ushort [a372]07.byte ISCRIPT_ACTION_ADD_ITEM; Add the Fire magic to the inventory. [a373]62.byte MAGIC_FIRE; InventoryItem [a374]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Show MESSAGE_MAGIC_OF_JUSTICE_OR_DESTRUCTION. [a375]79.byte MESSAGEID_MAGIC_OF_JUSTICE_OR_DESTRUCTION; Message [a376]00.byte ISCRIPT_ACTION_END; End. [a377]@_ISCRIPT_AFTER_VICTIM_MAGIC_SHOP_HAS_FIRE: [a377]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_RELY_ON_MAGIC. [a378]18.byte MESSAGEID_DONT_RELY_ON_MAGIC; Message [a379]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Eolis Tool Shop. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f78] ; ISCRIPT_ADDRS_U [$PRG12::a010] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f78] ; ISCRIPT_ADDRS_U [$PRG12::a010] ;
[a37a]ISCRIPT_EOLIS_TOOL_SHOP: [a37a]89.byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box. [a37b]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS. [a37c]0f.byte MESSAGEID_I_SELL_TOOLS; Message [a37d]0f.byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu. [a37e]86 a3pointer @_ISCRIPT_EOLIS_TOOL_SHOP_BUY; If Buy, jump. [a380]11.byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu. [a381]2e a4pointer EOLIS_TOOL_SHOP_ITEMS; EOLIS_TOOL_SHOP_ITEMS [a383]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a384]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a385]00.byte ISCRIPT_ACTION_END; End. [a386]@_ISCRIPT_EOLIS_TOOL_SHOP_BUY: [a386]08.byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu. [a387]2e a4pointer EOLIS_TOOL_SHOP_ITEMS; EOLIS_TOOL_SHOP_ITEMS [a389]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a38a]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a38b]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Apolune Tool Shop. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f84] ; ISCRIPT_ADDRS_U [$PRG12::a01c] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f84] ; ISCRIPT_ADDRS_U [$PRG12::a01c] ;
[a38c]ISCRIPT_APOLUNE_TOOL_SHOP: [a38c]89.byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box. [a38d]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS. [a38e]0f.byte MESSAGEID_I_SELL_TOOLS; Message [a38f]0f.byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu. [a390]98 a3pointer @_ISCRIPT_APOLUNE_TOOL_SHOP_BUY; If Buy, jump. [a392]11.byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu. [a393]3b a4pointer APOLUNE_TOOL_SHOP_ITEMS; APOLUNE_TOOL_SHOP_ITEMS [a395]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a396]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a397]00.byte ISCRIPT_ACTION_END; End. [a398]@_ISCRIPT_APOLUNE_TOOL_SHOP_BUY: [a398]08.byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu. [a399]3b a4pointer APOLUNE_TOOL_SHOP_ITEMS; Choose Buy [a39b]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a39c]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a39d]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Before-Apolune Tool Shop. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f88] ; ISCRIPT_ADDRS_U [$PRG12::a020] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f88] ; ISCRIPT_ADDRS_U [$PRG12::a020] ;
[a39e]ISCRIPT_BEFORE_APOLUNE_TOOL_SHOP: [a39e]89.byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box. [a39f]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS. [a3a0]0f.byte MESSAGEID_I_SELL_TOOLS; Message [a3a1]0f.byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu. [a3a2]aa a3pointer @_ISCRIPT_BEFORE_APOLUNE_TOOL_SHOP_BUY; If Buy, jump. [a3a4]11.byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu. [a3a5]48 a4pointer BEFORE_APOLUNE_TOOL_SHOP_ITEMS; BEFORE_APOLUNE_TOOL_SHOP_ITEMS [a3a7]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a3a8]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a3a9]00.byte ISCRIPT_ACTION_END; End. [a3aa]@_ISCRIPT_BEFORE_APOLUNE_TOOL_SHOP_BUY: [a3aa]08.byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu. [a3ab]48 a4pointer BEFORE_APOLUNE_TOOL_SHOP_ITEMS; BEFORE_APOLUNE_TOOL_SHOP_ITEMS [a3ad]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a3ae]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a3af]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Forepaw Tool Shop. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f93] ; ISCRIPT_ADDRS_U [$PRG12::a02b] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f93] ; ISCRIPT_ADDRS_U [$PRG12::a02b] ;
[a3b0]ISCRIPT_FOREPAW_TOOL_SHOP: [a3b0]89.byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box. [a3b1]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS. [a3b2]0f.byte MESSAGEID_I_SELL_TOOLS; Message [a3b3]0f.byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu. [a3b4]bc a3pointer @_ISCRIPT_FOREPAW_TOOL_SHOP_BUY; If Buy, jump. [a3b6]11.byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu. [a3b7]4f a4pointer FOREPAW_TOOL_SHOP_ITEMS; FOREPAW_TOOL_SHOP_ITEMS [a3b9]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a3ba]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a3bb]00.byte ISCRIPT_ACTION_END; End. [a3bc]@_ISCRIPT_FOREPAW_TOOL_SHOP_BUY: [a3bc]08.byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu. [a3bd]4f a4pointer FOREPAW_TOOL_SHOP_ITEMS; FOREPAW_TOOL_SHOP_ITEMS [a3bf]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a3c0]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a3c1]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Mascon Tool Shop. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa4] ; ISCRIPT_ADDRS_U [$PRG12::a03c] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa4] ; ISCRIPT_ADDRS_U [$PRG12::a03c] ;
[a3c2]ISCRIPT_MASCON_TOOL_SHOP: [a3c2]89.byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box. [a3c3]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS. [a3c4]0f.byte MESSAGEID_I_SELL_TOOLS; Message [a3c5]0f.byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu. [a3c6]ce a3pointer @_ISCRIPT_MASCON_TOOL_SHOP_BUY; If Buy, jump. [a3c8]11.byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu. [a3c9]5f a4pointer MASCON_TOOL_SHOP_ITEMS; MASCON_TOOL_SHOP_ITEMS [a3cb]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a3cc]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a3cd]00.byte ISCRIPT_ACTION_END; End. [a3ce]@_ISCRIPT_MASCON_TOOL_SHOP_BUY: [a3ce]08.byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu. [a3cf]5f a4pointer MASCON_TOOL_SHOP_ITEMS; MASCON_TOOL_SHOP_ITEMS [a3d1]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a3d2]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a3d3]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the After-Mascon Tool Shop. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa7] ; ISCRIPT_ADDRS_U [$PRG12::a03f] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa7] ; ISCRIPT_ADDRS_U [$PRG12::a03f] ;
[a3d4]ISCRIPT_AFTER_MASCON_TOOL_SHOP: [a3d4]89.byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box. [a3d5]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS. [a3d6]0f.byte MESSAGEID_I_SELL_TOOLS; Message [a3d7]0f.byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu. [a3d8]e0 a3pointer @_ISCRIPT_AFTER_MASCON_TOOL_SHOP_BUY; If Buy, jump. [a3da]11.byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu. [a3db]6c a4pointer AFTER_MASCON_TOOL_SHOP_ITEMS; AFTER_MASCON_TOOL_SHOP_ITEMS [a3dd]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a3de]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a3df]00.byte ISCRIPT_ACTION_END; End. [a3e0]@_ISCRIPT_AFTER_MASCON_TOOL_SHOP_BUY: [a3e0]08.byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu. [a3e1]6c a4pointer AFTER_MASCON_TOOL_SHOP_ITEMS; AFTER_MASCON_TOOL_SHOP_ITEMS [a3e3]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a3e4]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a3e5]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Victim Tool Shop. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fb3] ; ISCRIPT_ADDRS_U [$PRG12::a04b] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fb3] ; ISCRIPT_ADDRS_U [$PRG12::a04b] ;
[a3e6]ISCRIPT_VICTIM_TOOL_SHOP: [a3e6]89.byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box. [a3e7]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS. [a3e8]0f.byte MESSAGEID_I_SELL_TOOLS; Message [a3e9]0f.byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu. [a3ea]f2 a3pointer @_ISCRIPT_VICTIM_TOOL_SHOP_BUY; If Buy, jump. [a3ec]11.byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu. [a3ed]79 a4pointer VICTIM_TOOL_SHOP_ITEMS; VICTIM_TOOL_SHOP_ITEMS [a3ef]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a3f0]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a3f1]00.byte ISCRIPT_ACTION_END; End. [a3f2]@_ISCRIPT_VICTIM_TOOL_SHOP_BUY: [a3f2]08.byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu. [a3f3]79 a4pointer VICTIM_TOOL_SHOP_ITEMS; VICTIM_TOOL_SHOP_ITEMS [a3f5]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a3f6]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a3f7]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Conflate Tool Shop. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fc2] ; ISCRIPT_ADDRS_U [$PRG12::a05a] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fc2] ; ISCRIPT_ADDRS_U [$PRG12::a05a] ;
[a3f8]ISCRIPT_CONFLATE_TOOL_SHOP: [a3f8]89.byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box. [a3f9]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS. [a3fa]0f.byte MESSAGEID_I_SELL_TOOLS; Message [a3fb]0f.byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu. [a3fc]04 a4pointer @_ISCRIPT_CONFLATE_TOOL_SHOP_BUY; If Buy, jump. [a3fe]11.byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu. [a3ff]83 a4pointer CONFLATE_TOOL_SHOP_ITEMS; CONFLATE_TOOL_SHOP_ITEMS [a401]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a402]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a403]00.byte ISCRIPT_ACTION_END; End. [a404]@_ISCRIPT_CONFLATE_TOOL_SHOP_BUY: [a404]08.byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu. [a405]83 a4pointer CONFLATE_TOOL_SHOP_ITEMS; CONFLATE_TOOL_SHOP_ITEMS [a407]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a408]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a409]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Daybreak Tool Shop. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fd1] ; ISCRIPT_ADDRS_U [$PRG12::a069] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fd1] ; ISCRIPT_ADDRS_U [$PRG12::a069] ;
[a40a]ISCRIPT_DAYBREAK_TOOL_SHOP: [a40a]89.byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box. [a40b]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS. [a40c]0f.byte MESSAGEID_I_SELL_TOOLS; Message [a40d]0f.byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu. [a40e]16 a4pointer @_ISCRIPT_DAYBREAK_TOOL_SHOP_BUY; If Buy, jump. [a410]11.byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu. [a411]90 a4pointer DAYBREAK_TOOL_SHOP_ITEMS; DAYBREAK_TOOL_SHOP_ITEMS [a413]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a414]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a415]00.byte ISCRIPT_ACTION_END; End. [a416]@_ISCRIPT_DAYBREAK_TOOL_SHOP_BUY: [a416]08.byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu. [a417]90 a4pointer DAYBREAK_TOOL_SHOP_ITEMS; DAYBREAK_TOOL_SHOP_ITEMS [a419]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a41a]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a41b]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Dartmoor Tool Shop. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe0] ; ISCRIPT_ADDRS_U [$PRG12::a078] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe0] ; ISCRIPT_ADDRS_U [$PRG12::a078] ;
[a41c]ISCRIPT_DARTMOOR_TOOL_SHOP: [a41c]89.byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box. [a41d]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS. [a41e]0f.byte MESSAGEID_I_SELL_TOOLS; Message [a41f]0f.byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu. [a420]28 a4pointer @_ISCRIPT_DARTMOOR_TOOL_SHOP_BUY; If Buy, jump. [a422]11.byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu. [a423]9a a4pointer DARTMOOR_TOOL_SHOP_ITEMS; DARTMOOR_TOOL_SHOP_ITEMS [a425]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a426]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a427]00.byte ISCRIPT_ACTION_END; End. [a428]@_ISCRIPT_DARTMOOR_TOOL_SHOP_BUY: [a428]08.byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu. [a429]9a a4pointer DARTMOOR_TOOL_SHOP_ITEMS; DARTMOOR_TOOL_SHOP_ITEMS [a42b]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a42c]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a42d]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Eolis Tool Shop Items. ; ; * Hand Dagger: 400G ; * Red Potion: 160G ; * Elixir: 320G ; * Deluge: 400G ;============================================================================
[a42e]EOLIS_TOOL_SHOP_ITEMS: [a42e]00.byte WEAPON_HAND_DAGGER; InventoryItem [a42f]90 01.word $0190; ushort [a431]90.byte ITEM_RED_POTION; InventoryItem [a432]a0 00.word $00a0; ushort [a434]92.byte SPECIAL_ELIXIR; InventoryItem [a435]40 01.word $0140; ushort [a437]60.byte MAGIC_DELUGE; InventoryItem [a438]90 01.word $0190; ushort [a43a]ff.byte $ff; byte
;============================================================================ ; Apolune Tool Shop Items. ; ; * Small Shield: 800G ; * Hand Dagger: 500G ; * Deluge: 500G ; * Red Potion: 300G ;============================================================================
[a43b]APOLUNE_TOOL_SHOP_ITEMS: [a43b]40.byte SHIELD_SMALL; InventoryItem [a43c]20 03.word $0320; ushort [a43e]00.byte WEAPON_HAND_DAGGER; InventoryItem [a43f]f4 01.word $01f4; ushort [a441]60.byte MAGIC_DELUGE; InventoryItem [a442]f4 01.word $01f4; ushort [a444]90.byte ITEM_RED_POTION; InventoryItem [a445]2c 01.word $012c; ushort [a447]ff.byte $ff; byte
;============================================================================ ; Before Apolune Tool Shop Items. ; ; * Magic Shield: 7600G ; * Death: 12500G ;============================================================================
[a448]BEFORE_APOLUNE_TOOL_SHOP_ITEMS: [a448]42.byte SHIELD_MAGIC; InventoryItem [a449]b0 1d.word $1db0; ushort [a44b]63.byte MAGIC_DEATH; InventoryItem [a44c]d4 30.word $30d4; ushort [a44e]ff.byte $ff; byte
;============================================================================ ; Forepaw Tool Shop Items. ; ; * Long Sword: 1600G ; * Studded Mail: 2500G ; * Small Shield: 1100G ; * Red Potion: 400G ; * Wing Boots: 2800G ;============================================================================
[a44f]FOREPAW_TOOL_SHOP_ITEMS: [a44f]01.byte WEAPON_LONG_SWORD; InventoryItem [a450]40 06.word $0640; ushort [a452]21.byte ARMOR_STUDDED_MAIL; InventoryItem [a453]c4 09.word $09c4; ushort [a455]40.byte SHIELD_SMALL; InventoryItem [a456]4c 04.word $044c; ushort [a458]90.byte ITEM_RED_POTION; InventoryItem [a459]90 01.word $0190; ushort [a45b]8f.byte ITEM_WING_BOOTS; InventoryItem [a45c]f0 0a.word $0af0; ushort [a45e]ff.byte $ff; byte
;============================================================================ ; Mascon Tool Shop Items: ; ; * Large Shield: 3500G ; * Thunder: 1200G ; * Mattock: 800G ; * Red Potion: 600G ;============================================================================
[a45f]MASCON_TOOL_SHOP_ITEMS: [a45f]41.byte SHIELD_LARGE; InventoryItem [a460]ac 0d.word $0dac; ushort [a462]61.byte MAGIC_THUNDER; InventoryItem [a463]b0 04.word $04b0; ushort [a465]89.byte MATTOCK; InventoryItem [a466]20 03.word $0320; ushort [a468]90.byte ITEM_RED_POTION; InventoryItem [a469]58 02.word $0258; ushort [a46b]ff.byte $ff; byte
;============================================================================ ; After Mascon Tool Shop Items. ; ; * Death: 9800G ; * Hour Glass: 5600G ; * Elixir: 4300G ; * Red Potion: 300G ;============================================================================
[a46c]AFTER_MASCON_TOOL_SHOP_ITEMS: [a46c]63.byte MAGIC_DEATH; InventoryItem [a46d]48 26.word $2648; ushort [a46f]8d.byte ITEM_HOUR_GLASS; InventoryItem [a470]e0 15.word $15e0; ushort [a472]92.byte SPECIAL_ELIXIR; InventoryItem [a473]cc 10.word $10cc; ushort [a475]90.byte ITEM_RED_POTION; InventoryItem [a476]2c 01.word $012c; ushort [a478]ff.byte $ff; byte
;============================================================================ ; Victim Tool Shop Items. ; ; * Full Plate: 5200G ; * Mattock: 1200G ; * Red Potion: 800G ;============================================================================
[a479]VICTIM_TOOL_SHOP_ITEMS: [a479]22.byte ARMOR_FULL_PLATE; InventoryItem [a47a]50 14.word $1450; ushort [a47c]89.byte MATTOCK; InventoryItem [a47d]b0 04.word $04b0; ushort [a47f]90.byte ITEM_RED_POTION; InventoryItem [a480]20 03.word $0320; ushort [a482]ff.byte $ff; byte
;============================================================================ ; Conflate Tool Shop Items: ; ; * Giant Blade: 8500G ; * Magic Shield: 9800G ; * Wing Boots: 5500G ; * Red Potion: 1000G ;============================================================================
[a483]CONFLATE_TOOL_SHOP_ITEMS: [a483]02.byte WEAPON_GIANT_BLADE; InventoryItem [a484]34 21.word $2134; ushort [a486]42.byte SHIELD_MAGIC; InventoryItem [a487]48 26.word $2648; ushort [a489]8f.byte ITEM_WING_BOOTS; InventoryItem [a48a]7c 15.word $157c; ushort [a48c]90.byte ITEM_RED_POTION; InventoryItem [a48d]e8 03.word $03e8; ushort [a48f]ff.byte $ff; byte
;============================================================================ ; Daybreak Tool Shop Items. ; ; * Tilte: 15000G ; * Giant Blade: 11500G ; * Red Potion: 1200G ;============================================================================
[a490]DAYBREAK_TOOL_SHOP_ITEMS: [a490]64.byte MAGIC_TILTE; InventoryItem [a491]98 3a.word $3a98; ushort [a493]02.byte WEAPON_GIANT_BLADE; InventoryItem [a494]ec 2c.word $2cec; ushort [a496]90.byte ITEM_RED_POTION; InventoryItem [a497]b0 04.word $04b0; ushort [a499]ff.byte $ff; byte
;============================================================================ ; Dartmoor Tool Shop Items. ; ; * Giant Blade: 13000G ; * Red Potion: 2000G ;============================================================================
[a49a]DARTMOOR_TOOL_SHOP_ITEMS: [a49a]02.byte WEAPON_GIANT_BLADE; InventoryItem [a49b]c8 32.word $32c8; ushort [a49d]90.byte ITEM_RED_POTION; InventoryItem [a49e]d0 07.word $07d0; ushort [a4a0]ff.byte $ff; byte
;============================================================================ ; Interaction with the Eolis Meat Shop. ; ; The shop keeper will offer 30HP and 30MP for 50G. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f76] ; ISCRIPT_ADDRS_U [$PRG12::a00e] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f76] ; ISCRIPT_ADDRS_U [$PRG12::a00e] ;
[a4a1]ISCRIPT_EOLIS_MEAT_SHOP: [a4a1]88.byte ISCRIPT_ENTITY_MEAT_SALESMAN; Show the meat shop salesman portrait text box. [a4a2]02.byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show MESSAGE_DRIED_MEAT_50G. [a4a3]07.byte MESSAGEID_DRIED_MEAT_50G; Message [a4a4]05.byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 50G. [a4a5]32 00.word $0032; ushort [a4a7]13.byte ISCRIPT_ACTION_ADD_HP; Add 30HP. [a4a8]1e.byte $1e; byte [a4a9]0a.byte ISCRIPT_ACTION_ADD_MP; Add 30MP. [a4aa]1e.byte $1e; byte [a4ab]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a4ac]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a4ad]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Forepaw Meat Shop. ; ; The shop keeper will offer 30HP and 30MP for 150G. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f97] ; ISCRIPT_ADDRS_U [$PRG12::a02f] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f97] ; ISCRIPT_ADDRS_U [$PRG12::a02f] ;
[a4ae]ISCRIPT_FOREPAW_MEAT_SHOP: [a4ae]88.byte ISCRIPT_ENTITY_MEAT_SALESMAN; Show the meat shop salesman portrait text box. [a4af]02.byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show MESSAGE_DRIED_MEAT_150G. [a4b0]08.byte MESSAGEID_DRIED_MEAT_150G; Message [a4b1]05.byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 150G. [a4b2]96 00.word $0096; ushort [a4b4]13.byte ISCRIPT_ACTION_ADD_HP; Add 30HP. [a4b5]1e.byte $1e; byte [a4b6]0a.byte ISCRIPT_ACTION_ADD_MP; Add 30MP. [a4b7]1e.byte $1e; byte [a4b8]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a4b9]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a4ba]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Mascon Meat Shop. ; ; The shop keeper will offer 30HP and 30MP for 180G. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa5] ; ISCRIPT_ADDRS_U [$PRG12::a03d] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa5] ; ISCRIPT_ADDRS_U [$PRG12::a03d] ;
[a4bb]ISCRIPT_MASCON_MEAT_SHOP: [a4bb]88.byte ISCRIPT_ENTITY_MEAT_SALESMAN; Show the meat shop salesman portrait text box. [a4bc]02.byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show MESSAGE_DRIED_MEAT_180G. [a4bd]09.byte MESSAGEID_DRIED_MEAT_180G; Message [a4be]05.byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 180G. [a4bf]b4 00.word $00b4; ushort [a4c1]13.byte ISCRIPT_ACTION_ADD_HP; Add 30HP. [a4c2]1e.byte $1e; byte [a4c3]0a.byte ISCRIPT_ACTION_ADD_MP; Add 30MP. [a4c4]1e.byte $1e; byte [a4c5]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a4c6]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a4c7]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Victim Meat Shop. ; ; The shop keeper will offer 30HP and 30MP for 250G. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fb4] ; ISCRIPT_ADDRS_U [$PRG12::a04c] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fb4] ; ISCRIPT_ADDRS_U [$PRG12::a04c] ;
[a4c8]ISCRIPT_VICTIM_MEAT_SHOP: [a4c8]88.byte ISCRIPT_ENTITY_MEAT_SALESMAN; Show the meat shop salesman portrait text box. [a4c9]02.byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show MESSAGE_DRIED_MEAT_250G. [a4ca]0a.byte MESSAGEID_DRIED_MEAT_250G; Message [a4cb]05.byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 250G. [a4cc]fa 00.word $00fa; ushort [a4ce]13.byte ISCRIPT_ACTION_ADD_HP; Add 30HP. [a4cf]1e.byte $1e; byte [a4d0]0a.byte ISCRIPT_ACTION_ADD_MP; Add 30MP. [a4d1]1e.byte $1e; byte [a4d2]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a4d3]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a4d4]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Conflate Meat Shop. ; ; The shop keeper will offer 30HP and 30MP for 350G. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fc3] ; ISCRIPT_ADDRS_U [$PRG12::a05b] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fc3] ; ISCRIPT_ADDRS_U [$PRG12::a05b] ;
[a4d5]ISCRIPT_CONFLATE_MEAT_SHOP: [a4d5]88.byte ISCRIPT_ENTITY_MEAT_SALESMAN; Show the meat shop salesman portrait text box. [a4d6]02.byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show MESSAGE_DRIED_MEAT_350G. [a4d7]0b.byte MESSAGEID_DRIED_MEAT_350G; Message [a4d8]05.byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 350G. [a4d9]5e 01.word $015e; ushort [a4db]13.byte ISCRIPT_ACTION_ADD_HP; Add 30HP. [a4dc]1e.byte $1e; byte [a4dd]0a.byte ISCRIPT_ACTION_ADD_MP; Add 30MP. [a4de]1e.byte $1e; byte [a4df]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a4e0]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a4e1]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Daybreak Meat Shop. ; ; The shop keeper will offer 30HP and 30MP for 500G. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fd2] ; ISCRIPT_ADDRS_U [$PRG12::a06a] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fd2] ; ISCRIPT_ADDRS_U [$PRG12::a06a] ;
[a4e2]ISCRIPT_DAYBREAK_MEAT_SHOP: [a4e2]88.byte ISCRIPT_ENTITY_MEAT_SALESMAN; Show the meat shop salesman portrait text box. [a4e3]02.byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show MESSAGE_DRIED_MEAT_500G. [a4e4]0c.byte MESSAGEID_DRIED_MEAT_500G; Message [a4e5]05.byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 500G. [a4e6]f4 01.word $01f4; ushort [a4e8]13.byte ISCRIPT_ACTION_ADD_HP; Add 30HP. [a4e9]1e.byte $1e; byte [a4ea]0a.byte ISCRIPT_ACTION_ADD_MP; Add 30MP. [a4eb]1e.byte $1e; byte [a4ec]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a4ed]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a4ee]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Dartmoor Meat Shop. ; ; The shop keeper will offer 30HP and 30MP for 800G. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe1] ; ISCRIPT_ADDRS_U [$PRG12::a079] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe1] ; ISCRIPT_ADDRS_U [$PRG12::a079] ;
[a4ef]ISCRIPT_DARTMOOR_MEAT_SHOP: [a4ef]88.byte ISCRIPT_ENTITY_MEAT_SALESMAN; Show the meat shop salesman portrait text box. [a4f0]02.byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show MESSAGE_DRIED_MEAT_800G. [a4f1]0d.byte MESSAGEID_DRIED_MEAT_800G; Message [a4f2]05.byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 800G. [a4f3]20 03.word $0320; ushort [a4f5]13.byte ISCRIPT_ACTION_ADD_HP; Add 30HP. [a4f6]1e.byte $1e; byte [a4f7]0a.byte ISCRIPT_ACTION_ADD_MP; Add 30MP. [a4f8]1e.byte $1e; byte [a4f9]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a4fa]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a4fb]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Eolis Key Shop. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f77] ; ISCRIPT_ADDRS_U [$PRG12::a00f] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f77] ; ISCRIPT_ADDRS_U [$PRG12::a00f] ;
[a4fc]ISCRIPT_EOLIS_KEY_SHOP: [a4fc]8a.byte ISCRIPT_ENTITY_KEY_SALESMAN; Show the key salesman portrait text box. [a4fd]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_KEYS. [a4fe]0e.byte MESSAGEID_I_SELL_KEYS; Message [a4ff]0f.byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu. [a500]08 a5pointer @_ISCRIPT_EOLIS_KEY_SHOP_BUY; If Buy was chosen, jump. [a502]11.byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell was chosen, show the sell menu. [a503]7a a5pointer EOLIS_KEY_SHOP_ITEMS; EOLIS_KEY_SHOP_ITEMS [a505]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a506]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a507]00.byte ISCRIPT_ACTION_END; End. [a508]@_ISCRIPT_EOLIS_KEY_SHOP_BUY: [a508]08.byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu. [a509]7a a5pointer EOLIS_KEY_SHOP_ITEMS; EOLIS_KEY_SHOP_ITEMS [a50b]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a50c]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a50d]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Apolune Key Shop. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f85] ; ISCRIPT_ADDRS_U [$PRG12::a01d] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f85] ; ISCRIPT_ADDRS_U [$PRG12::a01d] ;
[a50e]ISCRIPT_APOLUNE_KEY_SHOP: [a50e]8a.byte ISCRIPT_ENTITY_KEY_SALESMAN; Show the key salesman portrait text box. [a50f]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_KEYS. [a510]0e.byte MESSAGEID_I_SELL_KEYS; Message [a511]0f.byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu. [a512]1a a5pointer @_ISCRIPT_APOLUNE_KEY_SHOP_BUY; If Buy was chosen, jump. [a514]11.byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell was chosen, show the sell menu. [a515]7e a5pointer APOLUNE_KEY_SHOP_ITEMS; APOLUNE_KEY_SHOP_ITEMS [a517]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a518]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a519]00.byte ISCRIPT_ACTION_END; End. [a51a]@_ISCRIPT_APOLUNE_KEY_SHOP_BUY: [a51a]08.byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu. [a51b]7e a5pointer APOLUNE_KEY_SHOP_ITEMS; APOLUNE_KEY_SHOP_ITEMS [a51d]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a51e]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a51f]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Forepaw Key Shop. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f96] ; ISCRIPT_ADDRS_U [$PRG12::a02e] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f96] ; ISCRIPT_ADDRS_U [$PRG12::a02e] ;
[a520]ISCRIPT_FOREPAW_KEY_SHOP: [a520]8a.byte ISCRIPT_ENTITY_KEY_SALESMAN; Show the key salesman portrait text box. [a521]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_KEYS. [a522]0e.byte MESSAGEID_I_SELL_KEYS; Message [a523]0f.byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu. [a524]2c a5pointer @_ISCRIPT_FOREPAW_KEY_SHOP_BUY; If Buy was chosen, jump. [a526]11.byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell was chosen, show the sell menu. [a527]82 a5pointer FOREPAW_KEY_SHOP_ITEMS; FOREPAW_KEY_SHOP_ITEMS [a529]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a52a]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a52b]00.byte ISCRIPT_ACTION_END; End. [a52c]@_ISCRIPT_FOREPAW_KEY_SHOP_BUY: [a52c]08.byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu. [a52d]82 a5pointer FOREPAW_KEY_SHOP_ITEMS; FOREPAW_KEY_SHOP_ITEMS [a52f]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a530]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a531]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Mascon Key Shop. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa6] ; ISCRIPT_ADDRS_U [$PRG12::a03e] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa6] ; ISCRIPT_ADDRS_U [$PRG12::a03e] ;
[a532]ISCRIPT_MASCON_KEY_SHOP: [a532]8a.byte ISCRIPT_ENTITY_KEY_SALESMAN; Show the key salesman portrait text box. [a533]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_KEYS. [a534]0e.byte MESSAGEID_I_SELL_KEYS; Message [a535]0f.byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu. [a536]3e a5pointer @_ISCRIPT_MASCONE_KEY_SHOP_BUY; If Buy was chosen, jump. [a538]11.byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell was chosen, show the sell menu. [a539]89 a5pointer MACONE_KEY_SHOP_ITEMS; MACONE_KEY_SHOP_ITEMS [a53b]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a53c]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a53d]00.byte ISCRIPT_ACTION_END; End. [a53e]@_ISCRIPT_MASCONE_KEY_SHOP_BUY: [a53e]08.byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu. [a53f]89 a5pointer MACONE_KEY_SHOP_ITEMS; MACONE_KEY_SHOP_ITEMS [a541]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a542]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a543]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Victim Key Shop. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fb5] ; ISCRIPT_ADDRS_U [$PRG12::a04d] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fb5] ; ISCRIPT_ADDRS_U [$PRG12::a04d] ;
[a544]ISCRIPT_VICTIM_KEY_SHOP: [a544]8a.byte ISCRIPT_ENTITY_KEY_SALESMAN; Show the key salesman portrait text box. [a545]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_KEYS. [a546]0e.byte MESSAGEID_I_SELL_KEYS; Message [a547]0f.byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu. [a548]50 a5pointer @_ISCRIPT_VICTIM_KEY_SHOP_BUY; If Buy was chosen, jump. [a54a]11.byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell was chosen, show the sell menu. [a54b]90 a5pointer VICTIM_KEY_SHOP_ITEMS; VICTIM_KEY_SHOP_ITEMS [a54d]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a54e]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a54f]00.byte ISCRIPT_ACTION_END; End. [a550]@_ISCRIPT_VICTIM_KEY_SHOP_BUY: [a550]08.byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu. [a551]90 a5pointer VICTIM_KEY_SHOP_ITEMS; VICTIM_KEY_SHOP_ITEMS [a553]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a554]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a555]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Daybreak Key Shop. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fd3] ; ISCRIPT_ADDRS_U [$PRG12::a06b] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fd3] ; ISCRIPT_ADDRS_U [$PRG12::a06b] ;
[a556]ISCRIPT_DAYBREAK_KEY_SHOP: [a556]8a.byte ISCRIPT_ENTITY_KEY_SALESMAN; Show the key salesman portrait text box. [a557]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_KEYS. [a558]0e.byte MESSAGEID_I_SELL_KEYS; Message [a559]0f.byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu. [a55a]62 a5pointer @_ISCRIPT_DAYBREAK_KEY_SHOP_BUY; If Buy was chosen, jump. [a55c]11.byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell was chosen, show the sell menu. [a55d]97 a5pointer DAYBREAK_KEY_SHOP_ITEMS; DAYBREAK_KEY_SHOP_ITEMS [a55f]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a560]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a561]00.byte ISCRIPT_ACTION_END; End. [a562]@_ISCRIPT_DAYBREAK_KEY_SHOP_BUY: [a562]08.byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu. [a563]97 a5pointer DAYBREAK_KEY_SHOP_ITEMS; DAYBREAK_KEY_SHOP_ITEMS [a565]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a566]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a567]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the Dartmoor Key Shop. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe2] ; ISCRIPT_ADDRS_U [$PRG12::a07a] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe2] ; ISCRIPT_ADDRS_U [$PRG12::a07a] ;
[a568]ISCRIPT_DARTMOOR_KEY_SHOP: [a568]8a.byte ISCRIPT_ENTITY_KEY_SALESMAN; Show the key salesman portrait text box. [a569]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_KEYS. [a56a]0e.byte MESSAGEID_I_SELL_KEYS; Message [a56b]0f.byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu. [a56c]74 a5pointer @_ISCRIPT_DARTMOOR_KEY_SHOP_BUY; If Buy was chosen, jump. [a56e]11.byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell was chosen, show the sell menu. [a56f]9e a5pointer DARTMOOR_KEY_SHOP_ITEMS; DARTMOOR_KEY_SHOP_ITEMS [a571]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a572]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a573]00.byte ISCRIPT_ACTION_END; End. [a574]@_ISCRIPT_DARTMOOR_KEY_SHOP_BUY: [a574]08.byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu. [a575]9e a5pointer DARTMOOR_KEY_SHOP_ITEMS; DARTMOOR_KEY_SHOP_ITEMS [a577]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING. [a578]02.byte MESSAGEID_THANK_YOU_FOR_SHOPPING; Message [a579]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Eolis Key Shop Items ; ; * "J" Key: 100G ;============================================================================
[a57a]EOLIS_KEY_SHOP_ITEMS: [a57a]87.byte KEY_J; InventoryItem [a57b]64 00.word $0064; ushort [a57d]ff.byte $ff; byte
;============================================================================ ; Apolune Key Shop ; ; * "J" Key: 140G ;============================================================================
[a57e]APOLUNE_KEY_SHOP_ITEMS: [a57e]87.byte KEY_J; InventoryItem [a57f]8c 00.word $008c; ushort [a581]ff.byte $ff; byte
;============================================================================ ; Forepaw Key Shop Items ; ; * "J" Key: 200G ; * "Q" Key: 500G ;============================================================================
[a582]FOREPAW_KEY_SHOP_ITEMS: [a582]87.byte KEY_J; InventoryItem [a583]c8 00.word $00c8; ushort [a585]86.byte KEY_Q; InventoryItem [a586]f4 01.word $01f4; ushort [a588]ff.byte $ff; byte
;============================================================================ ; Mascone Key Shop Items ; ; * "J" Key: 500G ; * "Q" Key: 600G ;============================================================================
[a589]MACONE_KEY_SHOP_ITEMS: [a589]87.byte KEY_J; InventoryItem [a58a]f4 01.word $01f4; ushort [a58c]86.byte KEY_Q; InventoryItem [a58d]58 02.word $0258; ushort [a58f]ff.byte $ff; byte
;============================================================================ ; Victim Key Shop Items ; ; * "K" Key: 1500G ; * "Q" Key: 1200G ;============================================================================
[a590]VICTIM_KEY_SHOP_ITEMS: [a590]85.byte KEY_K; InventoryItem [a591]dc 05.word $05dc; ushort [a593]86.byte KEY_Q; InventoryItem [a594]b0 04.word $04b0; ushort [a596]ff.byte $ff; byte
;============================================================================ ; Daybreak Key Shop Items ; ; * "K" Key: 1200G ; * "Q" Key: 1000G ;============================================================================
[a597]DAYBREAK_KEY_SHOP_ITEMS: [a597]85.byte KEY_K; InventoryItem [a598]b0 04.word $04b0; ushort [a59a]86.byte KEY_Q; InventoryItem [a59b]e8 03.word $03e8; ushort [a59d]ff.byte $ff; byte
;============================================================================ ; Dartmoor Key Shop Items ; ; * "K" Key - 1300G ;============================================================================
[a59e]DARTMOOR_KEY_SHOP_ITEMS: [a59e]85.byte KEY_K; InventoryItem [a59f]14 05.word $0514; ushort [a5a1]ff.byte $ff; byte
;============================================================================ ; Interaction with the doctor of Apolune. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f80] ; ISCRIPT_ADDRS_U [$PRG12::a018] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f80] ; ISCRIPT_ADDRS_U [$PRG12::a018] ;
[a5a2]ISCRIPT_APOLUNE_DOCTOR: [a5a2]84.byte ISCRIPT_ENTITY_DOCTOR; Show the Doctor portrait text box. [a5a3]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DO_YOU_WANT_TREATMENT. [a5a4]1a.byte MESSAGEID_DO_YOU_WANT_TREATMENT; Message [a5a5]02.byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show a dismissible MESSAGE_250G_PLEASE. [a5a6]1c.byte MESSAGEID_250G_PLEASE; Message [a5a7]05.byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay gold. [a5a8]fa 00.word $00fa; ushort [a5aa]13.byte ISCRIPT_ACTION_ADD_HP; Add 80HP. [a5ab]50.byte $50; byte [a5ac]0a.byte ISCRIPT_ACTION_ADD_MP; Add 80MP. [a5ad]50.byte $50; byte [a5ae]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_TRY_TOO_HARD. [a5af]1b.byte MESSAGEID_DONT_TRY_TOO_HARD; Message [a5b0]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the doctor of Forepaw. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f95] ; ISCRIPT_ADDRS_U [$PRG12::a02d] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f95] ; ISCRIPT_ADDRS_U [$PRG12::a02d] ;
[a5b1]ISCRIPT_FOREPAW_DOCTOR: [a5b1]84.byte ISCRIPT_ENTITY_DOCTOR; Show the Doctor portrait text box. [a5b2]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DO_YOU_WANT_TREATMENT. [a5b3]1a.byte MESSAGEID_DO_YOU_WANT_TREATMENT; Message [a5b4]02.byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show a dismissible MESSAGE_500G_PLEASE. [a5b5]1d.byte MESSAGEID_500G_PLEASE; Message [a5b6]05.byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay gold. [a5b7]f4 01.word $01f4; ushort [a5b9]13.byte ISCRIPT_ACTION_ADD_HP; Add 80HP. [a5ba]50.byte $50; byte [a5bb]0a.byte ISCRIPT_ACTION_ADD_MP; Add 80MP. [a5bc]50.byte $50; byte [a5bd]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_TRY_TOO_HARD. [a5be]1b.byte MESSAGEID_DONT_TRY_TOO_HARD; Message [a5bf]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the doctor of Mascon. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa3] ; ISCRIPT_ADDRS_U [$PRG12::a03b] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa3] ; ISCRIPT_ADDRS_U [$PRG12::a03b] ;
[a5c0]ISCRIPT_MASCON_DOCTOR: [a5c0]84.byte ISCRIPT_ENTITY_DOCTOR; Show the Doctor portrait text box. [a5c1]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DO_YOU_WANT_TREATMENT. [a5c2]1a.byte MESSAGEID_DO_YOU_WANT_TREATMENT; Message [a5c3]02.byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show a dismissible MESSAGE_1000G_PLEASE. [a5c4]1e.byte MESSAGEID_1000G_PLEASE; Message [a5c5]05.byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay gold. [a5c6]e8 03.word $03e8; ushort [a5c8]13.byte ISCRIPT_ACTION_ADD_HP; Add 80HP. [a5c9]50.byte $50; byte [a5ca]0a.byte ISCRIPT_ACTION_ADD_MP; Add 80MP. [a5cb]50.byte $50; byte [a5cc]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_TRY_TOO_HARD. [a5cd]1b.byte MESSAGEID_DONT_TRY_TOO_HARD; Message [a5ce]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the doctor of Victim. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fb2] ; ISCRIPT_ADDRS_U [$PRG12::a04a] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fb2] ; ISCRIPT_ADDRS_U [$PRG12::a04a] ;
[a5cf]ISCRIPT_VICTIM_DOCTOR: [a5cf]84.byte ISCRIPT_ENTITY_DOCTOR; Show the Doctor portrait text box. [a5d0]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DO_YOU_WANT_TREATMENT. [a5d1]1a.byte MESSAGEID_DO_YOU_WANT_TREATMENT; Message [a5d2]02.byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show a dismissible MESSAGE_2500G_PLEASE. [a5d3]1f.byte MESSAGEID_2500G_PLEASE; Message [a5d4]05.byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay gold. [a5d5]c4 09.word $09c4; ushort [a5d7]13.byte ISCRIPT_ACTION_ADD_HP; Add 80HP. [a5d8]50.byte $50; byte [a5d9]0a.byte ISCRIPT_ACTION_ADD_MP; Add 80MP. [a5da]50.byte $50; byte [a5db]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_TRY_TOO_HARD. [a5dc]1b.byte MESSAGEID_DONT_TRY_TOO_HARD; Message [a5dd]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the doctor of Conflate. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fc1] ; ISCRIPT_ADDRS_U [$PRG12::a059] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fc1] ; ISCRIPT_ADDRS_U [$PRG12::a059] ;
[a5de]ISCRIPT_CONFLATE_DOCTOR: [a5de]84.byte ISCRIPT_ENTITY_DOCTOR; Show the Doctor portrait text box. [a5df]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DO_YOU_WANT_TREATMENT. [a5e0]1a.byte MESSAGEID_DO_YOU_WANT_TREATMENT; Message [a5e1]02.byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show a dismissible MESSAGE_1800G_PLEASE. [a5e2]20.byte MESSAGEID_1800G_PLEASE; Message [a5e3]05.byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay gold. [a5e4]08 07.word $0708; ushort [a5e6]13.byte ISCRIPT_ACTION_ADD_HP; Add 80HP. [a5e7]50.byte $50; byte [a5e8]0a.byte ISCRIPT_ACTION_ADD_MP; Add 80MP. [a5e9]50.byte $50; byte [a5ea]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_TRY_TOO_HARD. [a5eb]1b.byte MESSAGEID_DONT_TRY_TOO_HARD; Message [a5ec]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the doctor of Dartmoor. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe5] ; ISCRIPT_ADDRS_U [$PRG12::a07d] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe5] ; ISCRIPT_ADDRS_U [$PRG12::a07d] ;
[a5ed]ISCRIPT_DARTMOOR_DOCTOR: [a5ed]84.byte ISCRIPT_ENTITY_DOCTOR; Show the Doctor portrait text box. [a5ee]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DO_YOU_WANT_TREATMENT. [a5ef]1a.byte MESSAGEID_DO_YOU_WANT_TREATMENT; Message [a5f0]02.byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show a dismissible MESSAGE_3000G_PLEASE. [a5f1]21.byte MESSAGEID_3000G_PLEASE; Message [a5f2]05.byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay gold. [a5f3]b8 0b.word $0bb8; ushort [a5f5]13.byte ISCRIPT_ACTION_ADD_HP; Add 80HP. [a5f6]50.byte $50; byte [a5f7]0a.byte ISCRIPT_ACTION_ADD_MP; Add 80MP. [a5f8]50.byte $50; byte [a5f9]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_TRY_TOO_HARD. [a5fa]1b.byte MESSAGEID_DONT_TRY_TOO_HARD; Message [a5fb]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Common script for a player's new password at a temple. ;============================================================================
[a5fc]ISCRIPT_COMMON_GURU_PASSWORD: [a5fc]03.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_MEDITATE_WITH_YOU. [a5fd]22.byte MESSAGEID_MEDITATE_WITH_YOU; Message [a5fe]14.byte ISCRIPT_ACTION_SHOW_PASSWORD; Generate and show a new password. [a5ff]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Common script for a player's new rank at a temple. ;============================================================================
[a600]ISCRIPT_COMMON_GURU_NEW_RANK: [a600]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Show MESSAGE_NEW_TITLE. [a601]23.byte MESSAGEID_NEW_TITLE; Message [a602]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the guru of Apolune. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f87] ; ISCRIPT_ADDRS_U [$PRG12::a01f] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f87] ; ISCRIPT_ADDRS_U [$PRG12::a01f] ;
[a603]ISCRIPT_APOLUNE_GURU: [a603]81.byte ISCRIPT_ENTITY_GURU; Display a Guru portrait text box. [a604]06.byte ISCRIPT_ACTION_SET_SPAWN_POINT; Set the spawn point to the temple of Apolune. [a605]01.byte TEMPLE_APOLUNE; Temple [a606]04.byte ISCRIPT_ACTION_CHECK_UPDATE_PLAYER_TITLE; Check the player rank and update if needed. [a607]00 a6pointer ISCRIPT_COMMON_GURU_NEW_RANK; If set, jump to show the new rank. [a609]17.byte ISCRIPT_ACTION_JUMP; Else, jump to show the new password. [a60a]fc a5pointer ISCRIPT_COMMON_GURU_PASSWORD; ISCRIPT_COMMON_GURU_PASSWORD
;============================================================================ ; Interaction with the guru of Forepaw. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f94] ; ISCRIPT_ADDRS_U [$PRG12::a02c] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9f94] ; ISCRIPT_ADDRS_U [$PRG12::a02c] ;
[a60c]ISCRIPT_FOREPAW_GURU: [a60c]81.byte ISCRIPT_ENTITY_GURU; Display a Guru portrait text box. [a60d]06.byte ISCRIPT_ACTION_SET_SPAWN_POINT; Set the spawn point to the temple of Forepaw. [a60e]02.byte TEMPLE_FOREPAW; Temple [a60f]04.byte ISCRIPT_ACTION_CHECK_UPDATE_PLAYER_TITLE; Check the player rank and update if needed. [a610]00 a6pointer ISCRIPT_COMMON_GURU_NEW_RANK; If set, jump to show the new rank. [a612]17.byte ISCRIPT_ACTION_JUMP; Else, jump to show the new password. [a613]fc a5pointer ISCRIPT_COMMON_GURU_PASSWORD; ISCRIPT_COMMON_GURU_PASSWORD
;============================================================================ ; Interaction with the guru of Mascon. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa8] ; ISCRIPT_ADDRS_U [$PRG12::a040] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fa8] ; ISCRIPT_ADDRS_U [$PRG12::a040] ;
[a615]ISCRIPT_MASCON_GURU: [a615]81.byte ISCRIPT_ENTITY_GURU; Display a Guru portrait text box. [a616]06.byte ISCRIPT_ACTION_SET_SPAWN_POINT; Set the spawn point to the temple of Mascon. [a617]03.byte TEMPLE_MASCON; Temple [a618]04.byte ISCRIPT_ACTION_CHECK_UPDATE_PLAYER_TITLE; Check the player rank and update if needed. [a619]00 a6pointer ISCRIPT_COMMON_GURU_NEW_RANK; If set, jump to show the new rank. [a61b]17.byte ISCRIPT_ACTION_JUMP; Else, jump to show the new password. [a61c]fc a5pointer ISCRIPT_COMMON_GURU_PASSWORD; ISCRIPT_COMMON_GURU_PASSWORD
;============================================================================ ; Interaction with the guru of Victim. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fb7] ; ISCRIPT_ADDRS_U [$PRG12::a04f] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fb7] ; ISCRIPT_ADDRS_U [$PRG12::a04f] ;
[a61e]ISCRIPT_VICTIM_GURU: [a61e]81.byte ISCRIPT_ENTITY_GURU; Display a Guru portrait text box. [a61f]06.byte ISCRIPT_ACTION_SET_SPAWN_POINT; Set the spawn point to the temple of Victim. [a620]04.byte TEMPLE_VICTIM; Temple [a621]04.byte ISCRIPT_ACTION_CHECK_UPDATE_PLAYER_TITLE; Check the player rank and update if needed. [a622]00 a6pointer ISCRIPT_COMMON_GURU_NEW_RANK; If set, jump to show the new rank. [a624]17.byte ISCRIPT_ACTION_JUMP; Else, jump to show the new password. [a625]fc a5pointer ISCRIPT_COMMON_GURU_PASSWORD; ISCRIPT_COMMON_GURU_PASSWORD
;============================================================================ ; Interaction with the guru of Conflate. ; ; This guru will check if the player has the Battle Suit ; and Ring of Dworf. ; ; If they have the Battle Suit but not Ring of Dworf, ; the player will receive the ring and be given directions ; to Dartmore. ; ; Otherwise, they'll get the normal Guru behavior. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fc0] ; ISCRIPT_ADDRS_U [$PRG12::a058] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fc0] ; ISCRIPT_ADDRS_U [$PRG12::a058] ;
[a627]ISCRIPT_CONFLATE_GURU: [a627]81.byte ISCRIPT_ENTITY_GURU; Display a Guru portrait text box. [a628]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Battle Suit. [a629]23.byte ARMOR_BATTLE_SUIT; InventoryItem [a62a]34 a6pointer @_ISCRIPT_GURU_CONFLATE_HAS_BATTLE_SUIT; If so, jump. [a62c]@_ISCRIPT_GURU_CONFLATE_DEFAULT: [a62c]06.byte ISCRIPT_ACTION_SET_SPAWN_POINT; Set the spawn point to the temple of Conflate. [a62d]05.byte TEMPLE_CONFLATE; Temple [a62e]04.byte ISCRIPT_ACTION_CHECK_UPDATE_PLAYER_TITLE; Check the player rank and update if needed. [a62f]00 a6pointer ISCRIPT_COMMON_GURU_NEW_RANK; If set, jump to show the new rank. [a631]17.byte ISCRIPT_ACTION_JUMP; Else, jump to show the new password. [a632]fc a5pointer ISCRIPT_COMMON_GURU_PASSWORD; ISCRIPT_COMMON_GURU_PASSWORD [a634]@_ISCRIPT_GURU_CONFLATE_HAS_BATTLE_SUIT: [a634]12.byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Ring of Dworf. [a635]82.byte SPECIAL_RING_OF_DWORF; InventoryItem [a636]2c a6pointer @_ISCRIPT_GURU_CONFLATE_DEFAULT; If so, jump to normal guru behavior. [a638]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Show MESSAGE_DIRECTIONS_DARTMORE. [a639]8c.byte MESSAGEID_DIRECTIONS_DARTMORE; Message [a63a]07.byte ISCRIPT_ACTION_ADD_ITEM; Add the Ring of Dworf to the inventory. [a63b]82.byte SPECIAL_RING_OF_DWORF; InventoryItem [a63c]00.byte ISCRIPT_ACTION_END; End.
;============================================================================ ; Interaction with the guru of Daybreak. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fd4] ; ISCRIPT_ADDRS_U [$PRG12::a06c] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fd4] ; ISCRIPT_ADDRS_U [$PRG12::a06c] ;
[a63d]ISCRIPT_DAYBREAK_GURU: [a63d]81.byte ISCRIPT_ENTITY_GURU; Display a Guru portrait text box. [a63e]06.byte ISCRIPT_ACTION_SET_SPAWN_POINT; Set the spawn point to the Daybreak temple. [a63f]06.byte TEMPLE_DAYBREAK; Temple [a640]04.byte ISCRIPT_ACTION_CHECK_UPDATE_PLAYER_TITLE; Check the player rank and update if needed. [a641]00 a6pointer ISCRIPT_COMMON_GURU_NEW_RANK; If set, jump to show the new rank. [a643]17.byte ISCRIPT_ACTION_JUMP; Else, jump to show the new password. [a644]fc a5pointer ISCRIPT_COMMON_GURU_PASSWORD; ISCRIPT_COMMON_GURU_PASSWORD
;============================================================================ ; Interaction with the guru of the final temple. ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe3] ; ISCRIPT_ADDRS_U [$PRG12::a07b] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe3] ; ISCRIPT_ADDRS_U [$PRG12::a07b] ;
[a646]ISCRIPT_GURU_FINAL: [a646]81.byte ISCRIPT_ENTITY_GURU; Display a Guru portrait text box. [a647]06.byte ISCRIPT_ACTION_SET_SPAWN_POINT; Set the spawn point to the final temple. [a648]07.byte TEMPLE_FINAL; Temple [a649]04.byte ISCRIPT_ACTION_CHECK_UPDATE_PLAYER_TITLE; Check the player rank and update if needed. [a64a]00 a6pointer ISCRIPT_COMMON_GURU_NEW_RANK; If set, jump to show the new rank. [a64c]17.byte ISCRIPT_ACTION_JUMP; Else, jump to show the new password. [a64d]fc a5pointer ISCRIPT_COMMON_GURU_PASSWORD; ISCRIPT_COMMON_GURU_PASSWORD
;============================================================================ ; "Glad you're back." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe4] ; ISCRIPT_ADDRS_U [$PRG12::a07c] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe4] ; ISCRIPT_ADDRS_U [$PRG12::a07c] ;
[a64f]ISCRIPT_KING_END_GAME: [a64f]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a650]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a651]a4.byte MESSAGEID_GLAD_YOURE_BACK; Message [a652]15.byte ISCRIPT_ACTION_END_GAME; IScriptAction [a653]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "There is the mark of Queen by the key hole." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe6] ; ISCRIPT_ADDRS_U [$PRG12::a07e] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe6] ; ISCRIPT_ADDRS_U [$PRG12::a07e] ;
[a654]ISCRIPT_MARK_OF_QUEEN: [a654]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a655]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a656]a5.byte MESSAGEID_MARK_OF_QUEEN; Message [a657]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "There is the mark of King by the key hole." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe7] ; ISCRIPT_ADDRS_U [$PRG12::a07f] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe7] ; ISCRIPT_ADDRS_U [$PRG12::a07f] ;
[a658]ISCRIPT_MARK_OF_KING: [a658]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a659]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a65a]a6.byte MESSAGEID_MARK_OF_KING; Message [a65b]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "There is the mark of Ace by the key hole." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe8] ; ISCRIPT_ADDRS_U [$PRG12::a080] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe8] ; ISCRIPT_ADDRS_U [$PRG12::a080] ;
[a65c]ISCRIPT_MARK_OF_ACE: [a65c]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a65d]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a65e]a7.byte MESSAGEID_MARK_OF_ACE; Message [a65f]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "There is the mark of Joker by the key hole." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe9] ; ISCRIPT_ADDRS_U [$PRG12::a081] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fe9] ; ISCRIPT_ADDRS_U [$PRG12::a081] ;
[a660]ISCRIPT_MARK_OF_JOKER: [a660]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a661]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a662]a8.byte MESSAGEID_MARK_OF_JOKER; Message [a663]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "Do you need a ring to open a door?" ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fea] ; ISCRIPT_ADDRS_U [$PRG12::a082] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fea] ; ISCRIPT_ADDRS_U [$PRG12::a082] ;
[a664]ISCRIPT_NEED_RING_FOR_DOOR: [a664]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a665]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a666]a9.byte MESSAGEID_NEED_RING_FOR_DOOR; Message [a667]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I've used Red Potion." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9feb] ; ISCRIPT_ADDRS_U [$PRG12::a083] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9feb] ; ISCRIPT_ADDRS_U [$PRG12::a083] ;
[a668]ISCRIPT_USED_RED_POTION: [a668]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a669]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a66a]aa.byte MESSAGEID_USED_RED_POTION; Message [a66b]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I've used Mattock." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fec] ; ISCRIPT_ADDRS_U [$PRG12::a084] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fec] ; ISCRIPT_ADDRS_U [$PRG12::a084] ;
[a66c]ISCRIPT_USED_MATTOCK: [a66c]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a66d]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a66e]ab.byte MESSAGEID_USED_MATTOCK; Message [a66f]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I've used Hour Glass." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fed] ; ISCRIPT_ADDRS_U [$PRG12::a085] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fed] ; ISCRIPT_ADDRS_U [$PRG12::a085] ;
[a670]ISCRIPT_USED_HOURGLASS: [a670]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a671]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a672]ac.byte MESSAGEID_USED_HOURGLASS; Message [a673]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I've used Wing Boots." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fee] ; ISCRIPT_ADDRS_U [$PRG12::a086] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fee] ; ISCRIPT_ADDRS_U [$PRG12::a086] ;
[a674]ISCRIPT_USED_WINGBOOTS: [a674]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a675]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a676]ad.byte MESSAGEID_USED_WINGBOOTS; Message [a677]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I've used key." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fef] ; ISCRIPT_ADDRS_U [$PRG12::a087] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fef] ; ISCRIPT_ADDRS_U [$PRG12::a087] ;
[a678]ISCRIPT_USED_KEY: [a678]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a679]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a67a]ae.byte MESSAGEID_USED_KEY; Message [a67b]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I've used Elixir." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff0] ; ISCRIPT_ADDRS_U [$PRG12::a088] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff0] ; ISCRIPT_ADDRS_U [$PRG12::a088] ;
[a67c]ISCRIPT_USED_ELIXIR: [a67c]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a67d]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a67e]af.byte MESSAGEID_USED_ELIXIR; Message [a67f]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I'm holding Elixir." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff1] ; ISCRIPT_ADDRS_U [$PRG12::a089] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff1] ; ISCRIPT_ADDRS_U [$PRG12::a089] ;
[a680]ISCRIPT_GOT_ELIXIR: [a680]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a681]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a682]b0.byte MESSAGEID_HOLDING_ELIXIR; Message [a683]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I'm holding Red Potion." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff2] ; ISCRIPT_ADDRS_U [$PRG12::a08a] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff2] ; ISCRIPT_ADDRS_U [$PRG12::a08a] ;
[a684]ISCRIPT_GOT_RED_POTION: [a684]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a685]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a686]b1.byte MESSAGEID_HOLDING_RED_POTION; Message [a687]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I'm holding Mattock." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff3] ; ISCRIPT_ADDRS_U [$PRG12::a08b] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff3] ; ISCRIPT_ADDRS_U [$PRG12::a08b] ;
[a688]ISCRIPT_GOT_MATTOCK: [a688]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a689]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a68a]b2.byte MESSAGEID_HOLDING_MATTOCK; Message [a68b]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I'm holding Wing Boots." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff4] ; ISCRIPT_ADDRS_U [$PRG12::a08c] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff4] ; ISCRIPT_ADDRS_U [$PRG12::a08c] ;
[a68c]ISCRIPT_GOT_WINGBOOTS: [a68c]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a68d]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a68e]b3.byte MESSAGEID_HOLDING_WINGBOOTS; Message [a68f]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I'm holding Hour Glass." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff5] ; ISCRIPT_ADDRS_U [$PRG12::a08d] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff5] ; ISCRIPT_ADDRS_U [$PRG12::a08d] ;
[a690]ISCRIPT_GOT_HOURGLASS: [a690]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a691]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a692]b4.byte MESSAGEID_HOLDING_HOURGLASS; Message [a693]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I've got the Battle Suit." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff6] ; ISCRIPT_ADDRS_U [$PRG12::a08e] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff6] ; ISCRIPT_ADDRS_U [$PRG12::a08e] ;
[a694]ISCRIPT_GOT_BATTLE_SUIT: [a694]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a695]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a696]b5.byte MESSAGEID_GOT_BATTLE_SUIT; Message [a697]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I've got the Battle Helmet." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff7] ; ISCRIPT_ADDRS_U [$PRG12::a08f] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff7] ; ISCRIPT_ADDRS_U [$PRG12::a08f] ;
[a698]ISCRIPT_GOT_BATTLE_HELMET: [a698]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a699]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a69a]b6.byte MESSAGEID_GOT_BATTLE_HELMET; Message [a69b]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I've got the Dragon Slayer." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff8] ; ISCRIPT_ADDRS_U [$PRG12::a090] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff8] ; ISCRIPT_ADDRS_U [$PRG12::a090] ;
[a69c]ISCRIPT_GOT_DRAGON_SLAYER: [a69c]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a69d]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a69e]b7.byte MESSAGEID_GOT_DRAGON_SLAYER; Message [a69f]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I've got the Black Onyx." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff9] ; ISCRIPT_ADDRS_U [$PRG12::a091] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ff9] ; ISCRIPT_ADDRS_U [$PRG12::a091] ;
[a6a0]ISCRIPT_GOT_BLACK_ONYX: [a6a0]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a6a1]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a6a2]b8.byte MESSAGEID_GOT_BLACK_ONYX; Message [a6a3]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I've got the Pendant." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ffa] ; ISCRIPT_ADDRS_U [$PRG12::a092] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ffa] ; ISCRIPT_ADDRS_U [$PRG12::a092] ;
[a6a4]ISCRIPT_GOT_PENDANT: [a6a4]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a6a5]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a6a6]b9.byte MESSAGEID_GOT_PENDANT; Message [a6a7]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I've got the Magical Rod." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ffb] ; ISCRIPT_ADDRS_U [$PRG12::a093] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ffb] ; ISCRIPT_ADDRS_U [$PRG12::a093] ;
[a6a8]ISCRIPT_GOT_MAGICAL_ROD: [a6a8]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a6a9]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a6aa]ba.byte MESSAGEID_GOT_MAGICAL_ROD; Message [a6ab]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I've touched Poison." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ffc] ; ISCRIPT_ADDRS_U [$PRG12::a094] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ffc] ; ISCRIPT_ADDRS_U [$PRG12::a094] ;
[a6ac]ISCRIPT_TOUCHED_POISON: [a6ac]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a6ad]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a6ae]bb.byte MESSAGEID_TOUCHED_POISON; Message [a6af]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "The glove increases offensive power." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ffd] ; ISCRIPT_ADDRS_U [$PRG12::a095] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ffd] ; ISCRIPT_ADDRS_U [$PRG12::a095] ;
[a6b0]ISCRIPT_GOT_POWER_GLOVE: [a6b0]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a6b1]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a6b2]bc.byte MESSAGEID_GLOVE_INCREASES_POWER; Message [a6b3]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "The power of the Glove is gone." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ffe] ; ISCRIPT_ADDRS_U [$PRG12::a096] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9ffe] ; ISCRIPT_ADDRS_U [$PRG12::a096] ;
[a6b4]ISCRIPT_POWER_GLOVE_GONE: [a6b4]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a6b5]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a6b6]bd.byte MESSAGEID_POWER_GLOVE_IS_GONE; Message [a6b7]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "I am free from injury because of the Ointment." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fff] ; ISCRIPT_ADDRS_U [$PRG12::a097] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::9fff] ; ISCRIPT_ADDRS_U [$PRG12::a097] ;
[a6b8]ISCRIPT_OINTMENT_USED: [a6b8]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a6b9]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a6ba]be.byte MESSAGEID_USED_OINTMENT; Message [a6bb]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "The power of the Ointment is gone." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::a000] ; ISCRIPT_ADDRS_U [$PRG12::a098] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::a000] ; ISCRIPT_ADDRS_U [$PRG12::a098] ;
[a6bc]ISCRIPT_OINTMENT_GONE: [a6bc]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a6bd]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a6be]bf.byte MESSAGEID_OINTMENT_GONE; Message [a6bf]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "The power of the Wing Boots is gone." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::a001] ; ISCRIPT_ADDRS_U [$PRG12::a099] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::a001] ; ISCRIPT_ADDRS_U [$PRG12::a099] ;
[a6c0]ISCRIPT_WINGBOOTS_GONE: [a6c0]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a6c1]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a6c2]c0.byte MESSAGEID_WINGBOOTS_GONE; Message [a6c3]00.byte ISCRIPT_ACTION_END; IScriptAction
;============================================================================ ; "The power of the Hour Glass is gone." ; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::a002] ; ISCRIPT_ADDRS_U [$PRG12::a09a] ;============================================================================
; ; XREFS: ; ISCRIPT_ADDRS_L [$PRG12::a002] ; ISCRIPT_ADDRS_U [$PRG12::a09a] ;
[a6c4]ISCRIPT_HOURGLASS_GONE: [a6c4]00.byte ISCRIPT_ENTITY_GENERIC; IScriptEntity [a6c5]01.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; IScriptAction [a6c6]c1.byte MESSAGEID_HOURGLASS_GONE; Message [a6c7]00.byte ISCRIPT_ACTION_END; IScriptAction
; ; XREFS: ; SPLASHANIM_PALETTE_L [$PRG12::a72c] ;
[a6c8]SPLASHANIM_INTRO_PALETTE: [a6c8]0f.byte $0f; [0]: [a6c9]07.byte $07; [1]: [a6ca]17.byte $17; [2]: [a6cb]27.byte $27; [3]: [a6cc]0f.byte $0f; [4]: [a6cd]27.byte $27; [5]: [a6ce]17.byte $17; [6]: [a6cf]27.byte $27; [7]: [a6d0]0f.byte $0f; [8]: [a6d1]0c.byte $0c; [9]: [a6d2]17.byte $17; [10]: [a6d3]10.byte $10; [11]: [a6d4]0f.byte $0f; [12]: [a6d5]0c.byte $0c; [13]: [a6d6]17.byte $17; [14]: [a6d7]27.byte $27; [15]: [a6d8]0f.byte $0f; [16]: [a6d9]17.byte $17; [17]: [a6da]26.byte $26; [18]: [a6db]30.byte $30; [19]: [a6dc]0f.byte $0f; [20]: [a6dd]17.byte $17; [21]: [a6de]26.byte $26; [22]: [a6df]30.byte $30; [23]: [a6e0]0f.byte $0f; [24]: [a6e1]17.byte $17; [25]: [a6e2]26.byte $26; [26]: [a6e3]30.byte $30; [27]: [a6e4]0f.byte $0f; [28]: [a6e5]17.byte $17; [29]: [a6e6]26.byte $26; [30]: [a6e7]30.byte $30; [31]:
; ; XREFS: ; SPLASHANIM_PALETTE_L [$PRG12::a72d] ;
[a6e8]SPLASHANIM_OUTRO_PALETTE: [a6e8]0f.byte $0f; [0]: [a6e9]17.byte $17; [1]: [a6ea]27.byte $27; [2]: [a6eb]37.byte $37; [3]: [a6ec]0f.byte $0f; [4]: [a6ed]37.byte $37; [5]: [a6ee]19.byte $19; [6]: [a6ef]29.byte $29; [7]: [a6f0]0f.byte $0f; [8]: [a6f1]1c.byte $1c; [9]: [a6f2]19.byte $19; [10]: [a6f3]30.byte $30; [11]: [a6f4]0f.byte $0f; [12]: [a6f5]1c.byte $1c; [13]: [a6f6]27.byte $27; [14]: [a6f7]37.byte $37; [15]: [a6f8]0f.byte $0f; [16]: [a6f9]17.byte $17; [17]: [a6fa]26.byte $26; [18]: [a6fb]30.byte $30; [19]: [a6fc]0f.byte $0f; [20]: [a6fd]1c.byte $1c; [21]: [a6fe]2c.byte $2c; [22]: [a6ff]30.byte $30; [23]: [a700]0f.byte $0f; [24]: [a701]17.byte $17; [25]: [a702]26.byte $26; [26]: [a703]30.byte $30; [27]: [a704]0f.byte $0f; [28]: [a705]17.byte $17; [29]: [a706]26.byte $26; [30]: [a707]30.byte $30; [31]:
;============================================================================ ; TODO: Document SplashAnimation_Intro_SomethingA708 ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; SplashAnimation_RunIntro ;============================================================================
[a708]SplashAnimation_Intro_SomethingA708: [a708]ee a4 06INC a:SplashAnimation_PaletteStage [a70b]ad a4 06LDA a:SplashAnimation_PaletteStage [a70e]29 07AND #$07 [a710]d0 15BNE @LAB_PRG12__a727 [a712]a0 1fLDY #$1f [a714]@LAB_PRG12__a714: [a714]b9 93 02LDA a:Screen_PaletteData_Tiles,Y [a717]38SEC [a718]e9 10SBC #$10 [a71a]10 02BPL @LAB_PRG12__a71e [a71c]a9 0fLDA #$0f [a71e]@LAB_PRG12__a71e: [a71e]99 93 02STA a:Screen_PaletteData_Tiles,Y [a721]88DEY [a722]10 f0BPL @LAB_PRG12__a714 [a724]4c 90 d0JMP PPUBuffer_WritePalette [a727]@LAB_PRG12__a727: [a727]60RTS
; ; XREFS: ; SplashAnimation_DrawScenery ;
[a728]SPLASHANIM_CHR_L: [a728]a0.byte $a0; [0]: Intro [a729]a0.byte $a0; [1]: Outro
; ; XREFS: ; SplashAnimation_DrawScenery ;
[a72a]SPLASHANIM_CHR_U: [a72a]ac.byte $ac; [0]: Intro [a72b]b0.byte $b0; [1]: Outro
; ; XREFS: ; SplashAnimation_DrawScenery ;
[a72c]SPLASHANIM_PALETTE_L: [a72c]c8.byte $c8; [0]: Intro [a72d]e8.byte $e8; [1]: Outro
; ; XREFS: ; SplashAnimation_DrawScenery ;
[a72e]SPLASHANIM_PALETTE_U: [a72e]a6.byte $a6; [0]: Intro [a72f]a6.byte $a6; [1]: Outro
;============================================================================ ; TODO: Document SplashAnimation_DrawScenery ; ; INPUTS: ; A ; ; OUTPUTS: ; TODO ; ; XREFS: ; SplashAnimation_RunIntro ; SplashAnimation_RunOutro ;============================================================================
[a730]SplashAnimation_DrawScenery: [a730]8d a5 06STA a:SplashAnimation_SceneIndex [a733]20 f7 caJSR PPU_WaitUntilFlushed [a736]a9 a0LDA #<INTRO_ANIM_PLAYER_TILES [a738]85 dbSTA IScriptOrCHRAddr [a73a]a9 9bLDA #>INTRO_ANIM_PLAYER_TILES [a73c]85 dcSTA IScriptOrCHRAddr_U [a73e]a9 00LDA #$00 [a740]85 e8STA PPU_TargetAddr [a742]a9 00LDA #$00 [a744]85 e9STA PPU_TargetAddr_U [a746]a2 0aLDX #$0a [a748]a0 90LDY #$90; Bank 10 [a74a]20 9e f8JSR PPU_WriteTilesFromCHRRAM [a74d]a9 a0LDA #<INTRO_ANIM_BACKGROUND_TILES [a74f]85 dbSTA IScriptOrCHRAddr [a751]a9 a4LDA #>INTRO_ANIM_BACKGROUND_TILES [a753]85 dcSTA IScriptOrCHRAddr_U [a755]a9 00LDA #$00 [a757]85 e8STA PPU_TargetAddr [a759]a9 18LDA #$18 [a75b]85 e9STA PPU_TargetAddr_U [a75d]a2 0aLDX #$0a [a75f]a0 80LDY #$80 [a761]20 9e f8JSR PPU_WriteTilesFromCHRRAM [a764]ae a5 06LDX a:SplashAnimation_SceneIndex [a767]bd 28 a7LDA a:SPLASHANIM_CHR_L,X [a76a]85 dbSTA IScriptOrCHRAddr [a76c]bd 2a a7LDA a:SPLASHANIM_CHR_U,X [a76f]85 dcSTA IScriptOrCHRAddr_U [a771]a9 20LDA #$20 [a773]85 e9STA PPU_TargetAddr_U [a775]a9 00LDA #$00 [a777]85 e8STA PPU_TargetAddr [a779]a2 0aLDX #$0a [a77b]a0 40LDY #$40 [a77d]20 9e f8JSR PPU_WriteTilesFromCHRRAM [a780]ae a5 06LDX a:SplashAnimation_SceneIndex [a783]bd 2c a7LDA a:SPLASHANIM_PALETTE_L,X [a786]85 ecSTA Temp_Int24 [a788]bd 2e a7LDA a:SPLASHANIM_PALETTE_U,X [a78b]85 edSTA Temp_Int24_M [a78d]a0 1fLDY #$1f [a78f]@_paletteLoop: [a78f]b1 ecLDA (Temp_Int24),Y [a791]99 93 02STA a:Screen_PaletteData_Tiles,Y [a794]88DEY [a795]10 f8BPL @_paletteLoop [a797]4c 90 d0JMP PPUBuffer_WritePalette
;============================================================================ ; TODO: Document SplashAnimation_RunIntro ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; Game_ShowStartScreen ;============================================================================
[a79a]SplashAnimation_RunIntro: [a79a]a9 00LDA #$00 [a79c]20 30 a7JSR SplashAnimation_DrawScenery [a79f]20 13 a8JSR Maybe_SplashAnimation_InitIntroState [a7a2]a9 00LDA #$00 [a7a4]8d a4 06STA a:SplashAnimation_PaletteStage [a7a7]a9 00LDA #$00 [a7a9]85 faSTA Music_Current [a7ab]20 27 cbJSR Screen_ResetForNonGame [a7ae]@LAB_PRG12__a7ae: [a7ae]20 25 caJSR WaitForNextFrame [a7b1]20 4f cbJSR Screen_ResetSpritesForNonGame [a7b4]20 83 aaJSR SplashAnimation_SomethingUpdateState [a7b7]20 cf a7JSR SplashAnimation_Maybe_CalcPlayerAnimState [a7ba]20 be a8JSR SplashAnimation_Maybe_AnimPlayerStep [a7bd]ae 8d 06LDX a:IntroAnimation_PlayerSizeCounter [a7c0]e0 04CPX #$04 [a7c2]d0 eaBNE @LAB_PRG12__a7ae [a7c4]20 08 a7JSR SplashAnimation_Intro_SomethingA708 [a7c7]ad a4 06LDA a:SplashAnimation_PaletteStage [a7ca]c9 20CMP #$20 [a7cc]d0 e0BNE @LAB_PRG12__a7ae [a7ce]60RTS
;============================================================================ ; TODO: Document SplashAnimation_Maybe_CalcPlayerAnimState ; ; INPUTS: ; A ; ; OUTPUTS: ; TODO ; ; XREFS: ; SplashAnimation_RunIntro ;============================================================================
[a7cf]SplashAnimation_Maybe_CalcPlayerAnimState: [a7cf]a0 07LDY #$07 [a7d1]20 72 a8JSR SplashAnimation_Maybe_NextAnimState1 [a7d4]a0 07LDY #$07 [a7d6]20 98 a8JSR SplashAnimation_Maybe_NextAnimState2 [a7d9]ae 8d 06LDX a:IntroAnimation_PlayerSizeCounter [a7dc]dd 59 a8CMP a:BYTE_ARRAY_PRG12__a859,X [a7df]b0 0fBCS RETURN_A7F0 [a7e1]ee 8d 06INC a:IntroAnimation_PlayerSizeCounter [a7e4]bd 5e a8LDA a:BYTE_ARRAY_PRG12__a85e,X [a7e7]8d 92 06STA a:SplashAnimation_0692 [a7ea]bd 62 a8LDA a:BYTE_ARRAY_PRG12__a862,X [a7ed]8d 93 06STA a:SplashAnimation_0693
; ; XREFS: ; SplashAnimation_Maybe_CalcPlayerAnimSize ; SplashAnimation_Maybe_CalcPlayerAnimState ;
[a7f0]RETURN_A7F0: [a7f0]60RTS
;============================================================================ ; TODO: Document SplashAnimation_Maybe_CalcPlayerAnimSize ; ; INPUTS: ; A ; ; OUTPUTS: ; TODO ; ; XREFS: ; SplashAnimation_RunOutro ;============================================================================
[a7f1]SplashAnimation_Maybe_CalcPlayerAnimSize: [a7f1]a0 07LDY #$07 [a7f3]20 72 a8JSR SplashAnimation_Maybe_NextAnimState1 [a7f6]a0 07LDY #$07 [a7f8]20 98 a8JSR SplashAnimation_Maybe_NextAnimState2 [a7fb]ae 8d 06LDX a:IntroAnimation_PlayerSizeCounter [a7fe]dd 66 a8CMP a:BYTE_ARRAY_PRG12__a866,X [a801]90 edBCC RETURN_A7F0 [a803]ee 8d 06INC a:IntroAnimation_PlayerSizeCounter [a806]bd 6a a8LDA a:BYTE_ARRAY_PRG12__a86a,X [a809]8d 92 06STA a:SplashAnimation_0692 [a80c]bd 6e a8LDA a:BYTE_ARRAY_PRG12__a86e,X [a80f]8d 93 06STA a:SplashAnimation_0693 [a812]60RTS
;============================================================================ ; TODO: Document Maybe_SplashAnimation_InitIntroState ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; SplashAnimation_RunIntro ;============================================================================
[a813]Maybe_SplashAnimation_InitIntroState: [a813]a9 18LDA #$18 [a815]8d 8e 06STA a:SplashAnimation_068e [a818]a9 ffLDA #$ff [a81a]8d 8f 06STA a:SplashAnimation_068f [a81d]a9 00LDA #$00 [a81f]8d 8c 06STA a:SplashAnimation_068c [a822]8d 8d 06STA a:IntroAnimation_PlayerSizeCounter [a825]8d 90 06STA a:SplashAnimation_0690 [a828]8d 91 06STA a:SplashAnimation_0691 [a82b]a9 20LDA #$20 [a82d]8d 92 06STA a:SplashAnimation_0692 [a830]a9 e0LDA #$e0 [a832]8d 93 06STA a:SplashAnimation_0693 [a835]60RTS
;============================================================================ ; TODO: Document Maybe_SplashAnimation_InitOutroState ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; SplashAnimation_RunOutro ;============================================================================
[a836]Maybe_SplashAnimation_InitOutroState: [a836]a9 70LDA #$70 [a838]8d 8e 06STA a:SplashAnimation_068e [a83b]a9 aeLDA #$ae [a83d]8d 8f 06STA a:SplashAnimation_068f [a840]a9 00LDA #$00 [a842]8d 8c 06STA a:SplashAnimation_068c [a845]8d 8d 06STA a:IntroAnimation_PlayerSizeCounter [a848]8d 90 06STA a:SplashAnimation_0690 [a84b]8d 91 06STA a:SplashAnimation_0691 [a84e]a9 fdLDA #$fd [a850]8d 92 06STA a:SplashAnimation_0692 [a853]a9 01LDA #$01 [a855]8d 93 06STA a:SplashAnimation_0693 [a858]60RTS
; ; XREFS: ; SplashAnimation_Maybe_CalcPlayerAnimState ;
[a859]BYTE_ARRAY_PRG12__a859: [a859]cc.byte $cc; [0]: [a85a]bc.byte $bc; [1]: [a85b]b4.byte $b4; [2]: [a85c]b0.byte $b0; [3]: [a85d]00.byte $00; [4]:
; ; XREFS: ; SplashAnimation_Maybe_CalcPlayerAnimState ;
[a85e]BYTE_ARRAY_PRG12__a85e: [a85e]11.byte $11; [0]: [a85f]0a.byte $0a; [1]: [a860]05.byte $05; [2]: [a861]03.byte $03; [3]:
; ; XREFS: ; SplashAnimation_Maybe_CalcPlayerAnimState ;
[a862]BYTE_ARRAY_PRG12__a862: [a862]f0.byte $f0; [0]: [a863]f8.byte $f8; [1]: [a864]fd.byte $fd; [2]: [a865]ff.byte $ff; [3]:
; ; XREFS: ; SplashAnimation_Maybe_CalcPlayerAnimSize ;
[a866]BYTE_ARRAY_PRG12__a866: [a866]b0.byte $b0; [0]: [a867]b4.byte $b4; [1]: [a868]bc.byte $bc; [2]: [a869]cc.byte $cc; [3]:
; ; XREFS: ; SplashAnimation_Maybe_CalcPlayerAnimSize ;
[a86a]BYTE_ARRAY_PRG12__a86a: [a86a]fb.byte $fb; [0]: [a86b]f6.byte $f6; [1]: [a86c]ef.byte $ef; [2]: [a86d]e0.byte $e0; [3]:
; ; XREFS: ; SplashAnimation_Maybe_CalcPlayerAnimSize ;
[a86e]BYTE_ARRAY_PRG12__a86e: [a86e]03.byte $03; [0]: [a86f]08.byte $08; [1]: [a870]10.byte $10; [2]: [a871]20.byte $20; [3]:
;============================================================================ ; TODO: Document SplashAnimation_Maybe_NextAnimState1 ; ; INPUTS: ; Y ; ; OUTPUTS: ; TODO ; ; XREFS: ; SplashAnimation_Maybe_CalcPlayerAnimSize ; SplashAnimation_Maybe_CalcPlayerAnimState ;============================================================================
[a872]SplashAnimation_Maybe_NextAnimState1: [a872]a9 00LDA #$00 [a874]85 ecSTA Temp_Int24 [a876]ad 92 06LDA a:SplashAnimation_0692 [a879]@LAB_PRG12__a879: [a879]85 edSTA Temp_Int24_M [a87b]26 edROL Temp_Int24_M [a87d]6aROR A [a87e]66 ecROR Temp_Int24 [a880]88DEY [a881]d0 f6BNE @LAB_PRG12__a879 [a883]18CLC [a884]85 edSTA Temp_Int24_M [a886]a5 ecLDA Temp_Int24 [a888]18CLC [a889]6d 90 06ADC a:SplashAnimation_0690 [a88c]8d 90 06STA a:SplashAnimation_0690 [a88f]a5 edLDA Temp_Int24_M [a891]6d 8e 06ADC a:SplashAnimation_068e [a894]8d 8e 06STA a:SplashAnimation_068e [a897]60RTS
;============================================================================ ; TODO: Document SplashAnimation_Maybe_NextAnimState2 ; ; INPUTS: ; Y ; ; OUTPUTS: ; TODO ; ; XREFS: ; SplashAnimation_Maybe_CalcPlayerAnimSize ; SplashAnimation_Maybe_CalcPlayerAnimState ;============================================================================
[a898]SplashAnimation_Maybe_NextAnimState2: [a898]a9 00LDA #$00 [a89a]85 ecSTA Temp_Int24 [a89c]ad 93 06LDA a:SplashAnimation_0693 [a89f]@LAB_PRG12__a89f: [a89f]85 edSTA Temp_Int24_M [a8a1]26 edROL Temp_Int24_M [a8a3]6aROR A [a8a4]66 ecROR Temp_Int24 [a8a6]88DEY [a8a7]d0 f6BNE @LAB_PRG12__a89f [a8a9]18CLC [a8aa]85 edSTA Temp_Int24_M [a8ac]a5 ecLDA Temp_Int24 [a8ae]18CLC [a8af]6d 91 06ADC a:SplashAnimation_0691 [a8b2]8d 91 06STA a:SplashAnimation_0691 [a8b5]a5 edLDA Temp_Int24_M [a8b7]6d 8f 06ADC a:SplashAnimation_068f [a8ba]8d 8f 06STA a:SplashAnimation_068f [a8bd]60RTS
;============================================================================ ; TODO: Document SplashAnimation_Maybe_AnimPlayerStep ; ; INPUTS: ; X ; ; OUTPUTS: ; TODO ; ; XREFS: ; SplashAnimation_RunIntro ;============================================================================
[a8be]SplashAnimation_Maybe_AnimPlayerStep: [a8be]20 0f a9JSR SplashAnimation_A90F [a8c1]ac 8d 06LDY a:IntroAnimation_PlayerSizeCounter [a8c4]c0 03CPY #$03 [a8c6]b0 10BCS @LAB_PRG12__a8d8 [a8c8]29 01AND #$01 [a8ca]d0 0cBNE @LAB_PRG12__a8d8 [a8cc]ad 8c 06LDA a:SplashAnimation_068c [a8cf]29 0fAND #$0f [a8d1]d0 05BNE @LAB_PRG12__a8d8 [a8d3]a9 15LDA #$15 [a8d5]20 e4 d0JSR Sound_PlayEffect [a8d8]@LAB_PRG12__a8d8: [a8d8]bd de a8LDA a:BYTE_ARRAY_PRG12__a8de,X [a8db]4c 94 aaJMP SplashAnimation_FuncAA94
; ; XREFS: ; SplashAnimation_Maybe_AnimPlayerStep ;
[a8de]BYTE_ARRAY_PRG12__a8de: [a8de]00.byte $00; [0]: [a8df]01.byte $01; [1]: [a8e0]02.byte $02; [2]: [a8e1]01.byte $01; [3]: [a8e2]03.byte $03; [4]: [a8e3]04.byte $04; [5]: [a8e4]05.byte $05; [6]: [a8e5]04.byte $04; [7]: [a8e6]06.byte $06; [8]: [a8e7]06.byte $06; [9]: [a8e8]07.byte $07; [10]: [a8e9]07.byte $07; [11]: [a8ea]08.byte $08; [12]: [a8eb]08.byte $08; [13]: [a8ec]09.byte $09; [14]: [a8ed]09.byte $09; [15]: [a8ee]0a.byte $0a; [16]: [a8ef]0a.byte $0a; [17]: [a8f0]0b.byte $0b; [18]: [a8f1]0b.byte $0b; [19]:
;============================================================================ ; TODO: Document SplashAnimation_OutroFuncAF82 ; ; INPUTS: ; X ; ; OUTPUTS: ; TODO ; ; XREFS: ; SplashAnimation_RunOutro ;============================================================================
[a8f2]SplashAnimation_OutroFuncAF82: [a8f2]20 0f a9JSR SplashAnimation_A90F [a8f5]bd fb a8LDA a:BYTE_ARRAY_PRG12__a8fb,X [a8f8]4c 94 aaJMP SplashAnimation_FuncAA94
; ; XREFS: ; SplashAnimation_OutroFuncAF82 ;
[a8fb]BYTE_ARRAY_PRG12__a8fb: [a8fb]0c.byte $0c; [0]: [a8fc]0c.byte $0c; [1]: [a8fd]0d.byte $0d; [2]: [a8fe]0d.byte $0d; [3]: [a8ff]0e.byte $0e; [4]: [a900]0e.byte $0e; [5]: [a901]0f.byte $0f; [6]: [a902]0f.byte $0f; [7]: [a903]10.byte $10; [8]: [a904]10.byte $10; [9]: [a905]11.byte $11; [10]: [a906]11.byte $11; [11]: [a907]12.byte $12; [12]: [a908]13.byte $13; [13]: [a909]14.byte $14; [14]: [a90a]13.byte $13; [15]: [a90b]15.byte $15; [16]: [a90c]16.byte $16; [17]: [a90d]17.byte $17; [18]: [a90e]16.byte $16; [19]:
;============================================================================ ; TODO: Document SplashAnimation_A90F ; ; INPUTS: ; None. ; ; OUTPUTS: ; A ; ; XREFS: ; SplashAnimation_Maybe_AnimPlayerStep ; SplashAnimation_OutroFuncAF82 ;============================================================================
[a90f]SplashAnimation_A90F: [a90f]ad 8e 06LDA a:SplashAnimation_068e [a912]8d 89 06STA a:SplashAnimation_0689 [a915]ad 8f 06LDA a:SplashAnimation_068f [a918]8d 8a 06STA a:SplashAnimation_068a [a91b]ad 8c 06LDA a:SplashAnimation_068c [a91e]ee 8c 06INC a:SplashAnimation_068c [a921]4aLSR A [a922]4aLSR A [a923]4aLSR A [a924]4aLSR A [a925]29 03AND #$03 [a927]85 ecSTA Temp_Int24 [a929]ad 8d 06LDA a:IntroAnimation_PlayerSizeCounter [a92c]0aASL A [a92d]0aASL A [a92e]05 ecORA Temp_Int24 [a930]aaTAX [a931]60RTS
;============================================================================ ; TODO: Document SplashAnimation_RunOutro ; ; INPUTS: ; X ; ; OUTPUTS: ; TODO ; ; XREFS: ; IScriptAction_FinishGame ;============================================================================
[a932]SplashAnimation_RunOutro: [a932]a9 01LDA #$01 [a934]20 30 a7JSR SplashAnimation_DrawScenery [a937]20 36 a8JSR Maybe_SplashAnimation_InitOutroState [a93a]20 9c a9JSR SplashAnimation_SomethingOutro_A99C [a93d]a9 0cLDA #$0c [a93f]85 faSTA Music_Current [a941]20 27 cbJSR Screen_ResetForNonGame [a944]@LAB_PRG12__a944: [a944]20 25 caJSR WaitForNextFrame [a947]20 4f cbJSR Screen_ResetSpritesForNonGame [a94a]20 83 aaJSR SplashAnimation_SomethingUpdateState [a94d]20 f1 a7JSR SplashAnimation_Maybe_CalcPlayerAnimSize [a950]20 f2 a8JSR SplashAnimation_OutroFuncAF82 [a953]20 c9 a9JSR SplashAnimation_SomethingOutroA9C9 [a956]20 f2 a9JSR SplashAnimation_SomethingA9F2 [a959]20 6c aaJSR SplashAnimation_UpdateOutro [a95c]ad 8f 06LDA a:SplashAnimation_068f [a95f]c9 faCMP #$fa [a961]90 e1BCC @LAB_PRG12__a944 [a963]@LAB_PRG12__a963: [a963]20 25 caJSR WaitForNextFrame [a966]20 4f cbJSR Screen_ResetSpritesForNonGame [a969]20 83 aaJSR SplashAnimation_SomethingUpdateState [a96c]20 c9 a9JSR SplashAnimation_SomethingOutroA9C9 [a96f]20 f2 a9JSR SplashAnimation_SomethingA9F2 [a972]20 6c aaJSR SplashAnimation_UpdateOutro [a975]a5 faLDA Music_Current [a977]d0 eaBNE @LAB_PRG12__a963 [a979]a9 10LDA #$10 [a97b]85 1aSTA InterruptCounter [a97d]@LAB_PRG12__a97d: [a97d]20 25 caJSR WaitForNextFrame [a980]20 4f cbJSR Screen_ResetSpritesForNonGame [a983]20 83 aaJSR SplashAnimation_SomethingUpdateState [a986]20 c9 a9JSR SplashAnimation_SomethingOutroA9C9 [a989]20 f2 a9JSR SplashAnimation_SomethingA9F2 [a98c]20 6c aaJSR SplashAnimation_UpdateOutro [a98f]a5 1aLDA InterruptCounter [a991]d0 eaBNE @LAB_PRG12__a97d [a993]60RTS
; ; XREFS: ; SpashAnimation_SomethingOutro_a9a2 ;
[a994]BYTE_ARRAY_PRG12__a994: [a994]d8.byte $d8; [0]:
; ; XREFS: ; SpashAnimation_SomethingOutro_a9a2 ;
[a995]BYTE_ARRAY_PRG12__a994_1_: [a995]e0.byte $e0; [1]:
; ; XREFS: ; SpashAnimation_SomethingOutro_a9a2 ;
[a996]BYTE_ARRAY_PRG12__a996: [a996]c2.byte $c2; [0]:
; ; XREFS: ; SpashAnimation_SomethingOutro_a9a2 ;
[a997]BYTE_ARRAY_PRG12__a996_1_: [a997]d0.byte $d0; [1]:
; ; XREFS: ; SpashAnimation_SomethingOutro_a9a2 ;
[a998]BYTE_ARRAY_PRG12__a998: [a998]ff.byte $ff; [0]:
; ; XREFS: ; SpashAnimation_SomethingOutro_a9a2 ;
[a999]BYTE_ARRAY_PRG12__a998_1_: [a999]ff.byte $ff; [1]:
; ; XREFS: ; SpashAnimation_SomethingOutro_a9a2 ;
[a99a]BYTE_ARRAY_PRG12__a99a: [a99a]00.byte $00; [0]:
; ; XREFS: ; SpashAnimation_SomethingOutro_a9a2 ;
[a99b]BYTE_ARRAY_PRG12__a99a_1_: [a99b]01.byte $01; [1]:
;============================================================================ ; TODO: Document SplashAnimation_SomethingOutro_A99C ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; SplashAnimation_RunOutro ;============================================================================
[a99c]SplashAnimation_SomethingOutro_A99C: [a99c]a2 00LDX #$00 [a99e]20 a2 a9JSR SpashAnimation_SomethingOutro_a9a2 [a9a1]e8INX
; ; v-- Fall through --v ;
;============================================================================ ; TODO: Document SpashAnimation_SomethingOutro_a9a2 ; ; INPUTS: ; X ; ; OUTPUTS: ; TODO ; ; XREFS: ; SplashAnimation_SomethingOutro_A99C ;============================================================================
[a9a2]SpashAnimation_SomethingOutro_a9a2: [a9a2]a9 00LDA #$00 [a9a4]9d 94 06STA a:SplashAnimation_0694,X [a9a7]9d 96 06STA a:SplashAnimation_0696,X [a9aa]9d 9c 06STA a:SplashAnimation_069c,X [a9ad]9d 9e 06STA a:SplashAnimation_069e,X [a9b0]bd 94 a9LDA a:BYTE_ARRAY_PRG12__a994,X [a9b3]9d 98 06STA a:SplashAnimation_0698,X [a9b6]bd 96 a9LDA a:BYTE_ARRAY_PRG12__a996,X [a9b9]9d 9a 06STA a:SplashAnimation_069a,X [a9bc]bd 98 a9LDA a:BYTE_ARRAY_PRG12__a998,X [a9bf]9d a0 06STA a:SplashAnimation_06a0,X [a9c2]bd 9a a9LDA a:BYTE_ARRAY_PRG12__a99a,X [a9c5]9d a2 06STA a:SplashAnimation_06a2,X [a9c8]60RTS
;============================================================================ ; TODO: Document SplashAnimation_SomethingOutroA9C9 ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; SplashAnimation_RunOutro ;============================================================================
[a9c9]SplashAnimation_SomethingOutroA9C9: [a9c9]a2 00LDX #$00 [a9cb]20 cf a9JSR @LAB_PRG12__a9cf [a9ce]e8INX [a9cf]@LAB_PRG12__a9cf: [a9cf]a0 01LDY #$01 [a9d1]20 20 aaJSR SpashAnimation_SomethingOutro_aa20 [a9d4]a0 01LDY #$01 [a9d6]20 46 aaJSR SpashAnimation_SomethingOutro_aa46 [a9d9]bc 96 06LDY a:SplashAnimation_0696,X [a9dc]c8INY [a9dd]c0 08CPY #$08 [a9df]d0 0cBNE @LAB_PRG12__a9ed [a9e1]fe 94 06INC a:SplashAnimation_0694,X [a9e4]bd 94 06LDA a:SplashAnimation_0694,X [a9e7]c9 0aCMP #$0a [a9e9]f0 b7BEQ SpashAnimation_SomethingOutro_a9a2 [a9eb]a0 00LDY #$00 [a9ed]@LAB_PRG12__a9ed: [a9ed]98TYA [a9ee]9d 96 06STA a:SplashAnimation_0696,X [a9f1]RETURN_A9F1: [a9f1]60RTS
;============================================================================ ; TODO: Document SplashAnimation_SomethingA9F2 ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; SplashAnimation_RunOutro ;============================================================================
[a9f2]SplashAnimation_SomethingA9F2: [a9f2]a2 00LDX #$00 [a9f4]20 f8 a9JSR @LAB_PRG12__a9f8 [a9f7]e8INX [a9f8]@LAB_PRG12__a9f8: [a9f8]bd 94 06LDA a:SplashAnimation_0694,X [a9fb]c9 03CMP #$03 [a9fd]b0 f2BCS RETURN_A9F1 [a9ff]bd 98 06LDA a:SplashAnimation_0698,X [aa02]8d 89 06STA a:SplashAnimation_0689 [aa05]bd 9a 06LDA a:SplashAnimation_069a,X [aa08]8d 8a 06STA a:SplashAnimation_068a [aa0b]8aTXA [aa0c]0aASL A [aa0d]0aASL A [aa0e]1d 94 06ORA a:SplashAnimation_0694,X [aa11]a8TAY [aa12]b9 18 aaLDA a:BYTE_ARRAY_PRG12__aa18,Y [aa15]4c 94 aaJMP SplashAnimation_FuncAA94 [aa18]BYTE_ARRAY_PRG12__aa18: [aa18]1a.byte $1a; [0]: [aa19]1b.byte $1b; [1]: [aa1a]1c.byte $1c; [2]: [aa1b]00.byte $00; [3]: [aa1c]1d.byte $1d; [4]: [aa1d]1e.byte $1e; [5]: [aa1e]1f.byte $1f; [6]: [aa1f]00.byte $00; [7]:
;============================================================================ ; TODO: Document SpashAnimation_SomethingOutro_aa20 ; ; INPUTS: ; X ; Y ; ; OUTPUTS: ; TODO ;============================================================================
[aa20]SpashAnimation_SomethingOutro_aa20: [aa20]a9 00LDA #$00 [aa22]85 ecSTA Temp_Int24 [aa24]bd a0 06LDA a:SplashAnimation_06a0,X [aa27]@LAB_PRG12__aa27: [aa27]85 edSTA Temp_Int24_M [aa29]26 edROL Temp_Int24_M [aa2b]6aROR A [aa2c]66 ecROR Temp_Int24 [aa2e]88DEY [aa2f]d0 f6BNE @LAB_PRG12__aa27 [aa31]18CLC [aa32]85 edSTA Temp_Int24_M [aa34]a5 ecLDA Temp_Int24 [aa36]18CLC [aa37]7d 9c 06ADC a:SplashAnimation_069c,X [aa3a]9d 9c 06STA a:SplashAnimation_069c,X [aa3d]a5 edLDA Temp_Int24_M [aa3f]7d 98 06ADC a:SplashAnimation_0698,X [aa42]9d 98 06STA a:SplashAnimation_0698,X [aa45]60RTS
;============================================================================ ; TODO: Document SpashAnimation_SomethingOutro_aa46 ; ; INPUTS: ; X ; Y ; ; OUTPUTS: ; TODO ;============================================================================
[aa46]SpashAnimation_SomethingOutro_aa46: [aa46]a9 00LDA #$00 [aa48]85 ecSTA Temp_Int24 [aa4a]bd a2 06LDA a:SplashAnimation_06a2,X [aa4d]@LAB_PRG12__aa4d: [aa4d]85 edSTA Temp_Int24_M [aa4f]26 edROL Temp_Int24_M [aa51]6aROR A [aa52]66 ecROR Temp_Int24 [aa54]88DEY [aa55]d0 f6BNE @LAB_PRG12__aa4d [aa57]18CLC [aa58]85 edSTA Temp_Int24_M [aa5a]a5 ecLDA Temp_Int24 [aa5c]18CLC [aa5d]7d 9e 06ADC a:SplashAnimation_069e,X [aa60]9d 9e 06STA a:SplashAnimation_069e,X [aa63]a5 edLDA Temp_Int24_M [aa65]7d 9a 06ADC a:SplashAnimation_069a,X [aa68]9d 9a 06STA a:SplashAnimation_069a,X [aa6b]60RTS
;============================================================================ ; TODO: Document SplashAnimation_UpdateOutro ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; SplashAnimation_RunOutro ;============================================================================
[aa6c]SplashAnimation_UpdateOutro: [aa6c]a9 e0LDA #$e0 [aa6e]8d 89 06STA a:SplashAnimation_0689 [aa71]a9 78LDA #$78 [aa73]8d 8a 06STA a:SplashAnimation_068a [aa76]a5 1aLDA InterruptCounter [aa78]29 10AND #$10 [aa7a]4aLSR A [aa7b]4aLSR A [aa7c]4aLSR A [aa7d]4aLSR A [aa7e]69 18ADC #$18 [aa80]4c 94 aaJMP SplashAnimation_FuncAA94
;============================================================================ ; TODO: Document SplashAnimation_SomethingUpdateState ; ; INPUTS: ; None. ; ; OUTPUTS: ; TODO ; ; XREFS: ; SplashAnimation_RunIntro ; SplashAnimation_RunOutro ;============================================================================
[aa83]SplashAnimation_SomethingUpdateState: [aa83]a2 00LDX #$00 [aa85]a9 f0LDA #$f0 [aa87]@LAB_PRG12__aa87: [aa87]9d 00 07STA a:SPRITE_0_RANGE_1_START,X [aa8a]e8INX [aa8b]e8INX [aa8c]e8INX [aa8d]e8INX [aa8e]d0 f7BNE @LAB_PRG12__aa87 [aa90]8e 88 06STX a:SplashAnimation_Something_SpriteOffset [aa93]60RTS
;============================================================================ ; TODO: Document SplashAnimation_FuncAA94 ; ; INPUTS: ; A ; X ; ; OUTPUTS: ; A ; ; XREFS: ; SplashAnimation_Maybe_AnimPlayerStep ; SplashAnimation_OutroFuncAF82 ; SplashAnimation_UpdateOutro ;============================================================================
[aa94]SplashAnimation_FuncAA94: [aa94]a8TAY [aa95]b9 17 abLDA a:BYTE_ARRAY_PRG12__ab17,Y [aa98]85 ecSTA Temp_Int24 [aa9a]b9 37 abLDA a:BYTE_ARRAY_PRG12__ab37,Y [aa9d]85 edSTA Temp_Int24_M [aa9f]a0 00LDY #$00 [aaa1]ad 89 06LDA a:SplashAnimation_0689 [aaa4]18CLC [aaa5]71 ecADC (Temp_Int24),Y [aaa7]8d 89 06STA a:SplashAnimation_0689 [aaaa]c8INY [aaab]ad 8a 06LDA a:SplashAnimation_068a [aaae]18CLC [aaaf]71 ecADC (Temp_Int24),Y [aab1]c9 f0CMP #$f0 [aab3]b0 61BCS @_return [aab5]8d 8a 06STA a:SplashAnimation_068a [aab8]c8INY [aab9]b1 ecLDA (Temp_Int24),Y [aabb]8d 8b 06STA a:DAT_068b [aabe]c8INY [aabf]b1 ecLDA (Temp_Int24),Y [aac1]85 ebSTA TextBox_ContentsY [aac3]c8INY [aac4]8aTXA [aac5]48PHA [aac6]ae 88 06LDX a:SplashAnimation_Something_SpriteOffset [aac9]@LAB_PRG12__aac9: [aac9]ad 8b 06LDA a:DAT_068b [aacc]85 eeSTA Temp_Int24_U [aace]ad 89 06LDA a:SplashAnimation_0689 [aad1]85 eaSTA TextBox_ContentsX [aad3]@LAB_PRG12__aad3: [aad3]b1 ecLDA (Temp_Int24),Y [aad5]c8INY [aad6]c9 ffCMP #$ff [aad8]f0 1fBEQ @LAB_PRG12__aaf9 [aada]9d 01 07STA a:SPRITE0_TILE,X [aadd]ad 8a 06LDA a:SplashAnimation_068a [aae0]c9 f0CMP #$f0 [aae2]b0 2dBCS @LAB_PRG12__ab11 [aae4]ad 8a 06LDA a:SplashAnimation_068a [aae7]9d 00 07STA a:SPRITE_0_RANGE_1_START,X [aaea]b1 ecLDA (Temp_Int24),Y [aaec]c8INY [aaed]9d 02 07STA a:SPRITE0_ATTRS,X [aaf0]a5 eaLDA TextBox_ContentsX [aaf2]9d 03 07STA a:SPRITE0_X,X [aaf5]e8INX [aaf6]e8INX [aaf7]e8INX [aaf8]e8INX [aaf9]@LAB_PRG12__aaf9: [aaf9]a5 eaLDA TextBox_ContentsX [aafb]18CLC [aafc]69 08ADC #$08 [aafe]85 eaSTA TextBox_ContentsX [ab00]c6 eeDEC Temp_Int24_U [ab02]d0 cfBNE @LAB_PRG12__aad3 [ab04]ad 8a 06LDA a:SplashAnimation_068a [ab07]18CLC [ab08]69 08ADC #$08 [ab0a]8d 8a 06STA a:SplashAnimation_068a [ab0d]c6 ebDEC TextBox_ContentsY [ab0f]d0 b8BNE @LAB_PRG12__aac9 [ab11]@LAB_PRG12__ab11: [ab11]8e 88 06STX a:SplashAnimation_Something_SpriteOffset [ab14]68PLA [ab15]aaTAX [ab16]@_return: [ab16]60RTS
; ; XREFS: ; SplashAnimation_FuncAA94 ;
[ab17]BYTE_ARRAY_PRG12__ab17: [ab17]57.byte $57; [0]: [ab18]6f.byte $6f; [1]: [ab19]87.byte $87; [2]: [ab1a]9f.byte $9f; [3]: [ab1b]b3.byte $b3; [4]: [ab1c]c7.byte $c7; [5]: [ab1d]db.byte $db; [6]: [ab1e]eb.byte $eb; [7]: [ab1f]fb.byte $fb; [8]: [ab20]05.byte $05; [9]: [ab21]0f.byte $0f; [10]: [ab22]17.byte $17; [11]: [ab23]1f.byte $1f; [12]: [ab24]27.byte $27; [13]: [ab25]2f.byte $2f; [14]: [ab26]39.byte $39; [15]: [ab27]43.byte $43; [16]: [ab28]53.byte $53; [17]: [ab29]63.byte $63; [18]: [ab2a]77.byte $77; [19]: [ab2b]8b.byte $8b; [20]: [ab2c]9f.byte $9f; [21]: [ab2d]b7.byte $b7; [22]: [ab2e]cf.byte $cf; [23]: [ab2f]e7.byte $e7; [24]: [ab30]26.byte $26; [25]: [ab31]65.byte $65; [26]: [ab32]6b.byte $6b; [27]: [ab33]71.byte $71; [28]: [ab34]77.byte $77; [29]: [ab35]7d.byte $7d; [30]: [ab36]83.byte $83; [31]:
; ; XREFS: ; SplashAnimation_FuncAA94 ;
[ab37]BYTE_ARRAY_PRG12__ab37: [ab37]ab.byte $ab; [0]: [ab38]ab.byte $ab; [1]: [ab39]ab.byte $ab; [2]: [ab3a]ab.byte $ab; [3]: [ab3b]ab.byte $ab; [4]: [ab3c]ab.byte $ab; [5]: [ab3d]ab.byte $ab; [6]: [ab3e]ab.byte $ab; [7]: [ab3f]ab.byte $ab; [8]: [ab40]ac.byte $ac; [9]: [ab41]ac.byte $ac; [10]: [ab42]ac.byte $ac; [11]: [ab43]ac.byte $ac; [12]: [ab44]ac.byte $ac; [13]: [ab45]ac.byte $ac; [14]: [ab46]ac.byte $ac; [15]: [ab47]ac.byte $ac; [16]: [ab48]ac.byte $ac; [17]: [ab49]ac.byte $ac; [18]: [ab4a]ac.byte $ac; [19]: [ab4b]ac.byte $ac; [20]: [ab4c]ac.byte $ac; [21]: [ab4d]ac.byte $ac; [22]: [ab4e]ac.byte $ac; [23]: [ab4f]ac.byte $ac; [24]: [ab50]ad.byte $ad; [25]: [ab51]ad.byte $ad; [26]: [ab52]ad.byte $ad; [27]: [ab53]ad.byte $ad; [28]: [ab54]ad.byte $ad; [29]: [ab55]ad.byte $ad; [30]: [ab56]ad.byte $ad; [31]: [ab57]f8.byte $f8; [0]: [ab58]ec.byte $ec; [1]: [ab59]02.byte $02; [2]: [ab5a]05.byte $05; [3]: [ab5b]46.byte $46; [4]: [ab5c]00.byte $00; [5]: [ab5d]47.byte $47; [6]: [ab5e]00.byte $00; [7]: [ab5f]48.byte $48; [8]: [ab60]00.byte $00; [9]: [ab61]49.byte $49; [10]: [ab62]00.byte $00; [11]: [ab63]4a.byte $4a; [12]: [ab64]00.byte $00; [13]: [ab65]4b.byte $4b; [14]: [ab66]00.byte $00; [15]: [ab67]4c.byte $4c; [16]: [ab68]00.byte $00; [17]: [ab69]4d.byte $4d; [18]: [ab6a]00.byte $00; [19]: [ab6b]4e.byte $4e; [20]: [ab6c]00.byte $00; [21]: [ab6d]4f.byte $4f; [22]: [ab6e]00.byte $00; [23]: [ab6f]f8.byte $f8; [0]: [ab70]ec.byte $ec; [1]: [ab71]02.byte $02; [2]: [ab72]05.byte $05; [3]: [ab73]50.byte $50; [4]: [ab74]00.byte $00; [5]: [ab75]51.byte $51; [6]: [ab76]00.byte $00; [7]: [ab77]52.byte $52; [8]: [ab78]00.byte $00; [9]: [ab79]53.byte $53; [10]: [ab7a]00.byte $00; [11]: [ab7b]54.byte $54; [12]: [ab7c]00.byte $00; [13]: [ab7d]55.byte $55; [14]: [ab7e]00.byte $00; [15]: [ab7f]56.byte $56; [16]: [ab80]00.byte $00; [17]: [ab81]57.byte $57; [18]: [ab82]00.byte $00; [19]: [ab83]58.byte $58; [20]: [ab84]00.byte $00; [21]: [ab85]59.byte $59; [22]: [ab86]00.byte $00; [23]: [ab87]f8.byte $f8; [0]: [ab88]ec.byte $ec; [1]: [ab89]02.byte $02; [2]: [ab8a]05.byte $05; [3]: [ab8b]46.byte $46; [4]: [ab8c]00.byte $00; [5]: [ab8d]47.byte $47; [6]: [ab8e]00.byte $00; [7]: [ab8f]5a.byte $5a; [8]: [ab90]00.byte $00; [9]: [ab91]5b.byte $5b; [10]: [ab92]00.byte $00; [11]: [ab93]5c.byte $5c; [12]: [ab94]00.byte $00; [13]: [ab95]5d.byte $5d; [14]: [ab96]00.byte $00; [15]: [ab97]5e.byte $5e; [16]: [ab98]00.byte $00; [17]: [ab99]5f.byte $5f; [18]: [ab9a]00.byte $00; [19]: [ab9b]60.byte $60; [20]: [ab9c]00.byte $00; [21]: [ab9d]61.byte $61; [22]: [ab9e]00.byte $00; [23]: [ab9f]f8.byte $f8; [0]: [aba0]f0.byte $f0; [1]: [aba1]02.byte $02; [2]: [aba2]04.byte $04; [3]: [aba3]62.byte $62; [4]: [aba4]00.byte $00; [5]: [aba5]63.byte $63; [6]: [aba6]00.byte $00; [7]: [aba7]64.byte $64; [8]: [aba8]00.byte $00; [9]: [aba9]65.byte $65; [10]: [abaa]00.byte $00; [11]: [abab]66.byte $66; [12]: [abac]00.byte $00; [13]: [abad]67.byte $67; [14]: [abae]00.byte $00; [15]: [abaf]68.byte $68; [16]: [abb0]00.byte $00; [17]: [abb1]69.byte $69; [18]: [abb2]00.byte $00; [19]: [abb3]f8.byte $f8; [0]: [abb4]f0.byte $f0; [1]: [abb5]02.byte $02; [2]: [abb6]04.byte $04; [3]: [abb7]62.byte $62; [4]: [abb8]00.byte $00; [5]: [abb9]63.byte $63; [6]: [abba]00.byte $00; [7]: [abbb]70.byte $70; [8]: [abbc]00.byte $00; [9]: [abbd]71.byte $71; [10]: [abbe]00.byte $00; [11]: [abbf]72.byte $72; [12]: [abc0]00.byte $00; [13]: [abc1]73.byte $73; [14]: [abc2]00.byte $00; [15]: [abc3]74.byte $74; [16]: [abc4]00.byte $00; [17]: [abc5]75.byte $75; [18]: [abc6]00.byte $00; [19]: [abc7]f8.byte $f8; [0]: [abc8]f0.byte $f0; [1]: [abc9]02.byte $02; [2]: [abca]04.byte $04; [3]: [abcb]62.byte $62; [4]: [abcc]00.byte $00; [5]: [abcd]63.byte $63; [6]: [abce]00.byte $00; [7]: [abcf]6a.byte $6a; [8]: [abd0]00.byte $00; [9]: [abd1]6b.byte $6b; [10]: [abd2]00.byte $00; [11]: [abd3]6c.byte $6c; [12]: [abd4]00.byte $00; [13]: [abd5]6d.byte $6d; [14]: [abd6]00.byte $00; [15]: [abd7]6e.byte $6e; [16]: [abd8]00.byte $00; [17]: [abd9]6f.byte $6f; [18]: [abda]00.byte $00; [19]: [abdb]f8.byte $f8; [0]: [abdc]f4.byte $f4; [1]: [abdd]02.byte $02; [2]: [abde]03.byte $03; [3]: [abdf]76.byte $76; [4]: [abe0]00.byte $00; [5]: [abe1]77.byte $77; [6]: [abe2]00.byte $00; [7]: [abe3]78.byte $78; [8]: [abe4]00.byte $00; [9]: [abe5]79.byte $79; [10]: [abe6]00.byte $00; [11]: [abe7]34.byte $34; [12]: [abe8]00.byte $00; [13]: [abe9]7b.byte $7b; [14]: [abea]00.byte $00; [15]: [abeb]f8.byte $f8; [0]: [abec]f4.byte $f4; [1]: [abed]02.byte $02; [2]: [abee]03.byte $03; [3]: [abef]76.byte $76; [4]: [abf0]00.byte $00; [5]: [abf1]77.byte $77; [6]: [abf2]00.byte $00; [7]: [abf3]7c.byte $7c; [8]: [abf4]00.byte $00; [9]: [abf5]7d.byte $7d; [10]: [abf6]00.byte $00; [11]: [abf7]3a.byte $3a; [12]: [abf8]00.byte $00; [13]: [abf9]7f.byte $7f; [14]: [abfa]00.byte $00; [15]: [abfb]fc.byte $fc; [0]: [abfc]f4.byte $f4; [1]: [abfd]01.byte $01; [2]: [abfe]03.byte $03; [3]: [abff]36.byte $36; [4]: [ac00]00.byte $00; [5]: [ac01]3d.byte $3d; [6]: [ac02]00.byte $00; [7]: [ac03]3e.byte $3e; [8]: [ac04]00.byte $00; [9]: [ac05]fc.byte $fc; [0]: [ac06]f4.byte $f4; [1]: [ac07]01.byte $01; [2]: [ac08]03.byte $03; [3]: [ac09]37.byte $37; [4]: [ac0a]00.byte $00; [5]: [ac0b]40.byte $40; [6]: [ac0c]00.byte $00; [7]: [ac0d]41.byte $41; [8]: [ac0e]00.byte $00; [9]: [ac0f]fc.byte $fc; [0]: [ac10]f8.byte $f8; [1]: [ac11]01.byte $01; [2]: [ac12]02.byte $02; [3]: [ac13]7a.byte $7a; [4]: [ac14]00.byte $00; [5]: [ac15]43.byte $43; [6]: [ac16]00.byte $00; [7]: [ac17]fc.byte $fc; [0]: [ac18]f8.byte $f8; [1]: [ac19]01.byte $01; [2]: [ac1a]02.byte $02; [3]: [ac1b]7e.byte $7e; [4]: [ac1c]00.byte $00; [5]: [ac1d]45.byte $45; [6]: [ac1e]00.byte $00; [7]: [ac1f]fc.byte $fc; [0]: [ac20]f8.byte $f8; [1]: [ac21]01.byte $01; [2]: [ac22]02.byte $02; [3]: [ac23]42.byte $42; [4]: [ac24]00.byte $00; [5]: [ac25]43.byte $43; [6]: [ac26]00.byte $00; [7]: [ac27]fc.byte $fc; [0]: [ac28]f8.byte $f8; [1]: [ac29]01.byte $01; [2]: [ac2a]02.byte $02; [3]: [ac2b]44.byte $44; [4]: [ac2c]00.byte $00; [5]: [ac2d]45.byte $45; [6]: [ac2e]00.byte $00; [7]: [ac2f]fc.byte $fc; [0]: [ac30]f4.byte $f4; [1]: [ac31]01.byte $01; [2]: [ac32]03.byte $03; [3]: [ac33]3c.byte $3c; [4]: [ac34]00.byte $00; [5]: [ac35]3d.byte $3d; [6]: [ac36]00.byte $00; [7]: [ac37]3e.byte $3e; [8]: [ac38]00.byte $00; [9]: [ac39]fc.byte $fc; [0]: [ac3a]f4.byte $f4; [1]: [ac3b]01.byte $01; [2]: [ac3c]03.byte $03; [3]: [ac3d]3f.byte $3f; [4]: [ac3e]00.byte $00; [5]: [ac3f]40.byte $40; [6]: [ac40]00.byte $00; [7]: [ac41]41.byte $41; [8]: [ac42]00.byte $00; [9]: [ac43]f8.byte $f8; [0]: [ac44]f4.byte $f4; [1]: [ac45]02.byte $02; [0]: [ac46]03.byte $03; [1]: [ac47]30.byte $30; [2]: [ac48]00.byte $00; [3]: [ac49]31.byte $31; [4]: [ac4a]00.byte $00; [5]: [ac4b]32.byte $32; [6]: [ac4c]00.byte $00; [7]: [ac4d]33.byte $33; [8]: [ac4e]00.byte $00; [9]: [ac4f]34.byte $34; [10]: [ac50]00.byte $00; [11]: [ac51]35.byte $35; [12]: [ac52]00.byte $00; [13]: [ac53]f8.byte $f8; [0]: [ac54]f4.byte $f4; [1]: [ac55]02.byte $02; [2]: [ac56]03.byte $03; [3]: [ac57]30.byte $30; [4]: [ac58]00.byte $00; [5]: [ac59]31.byte $31; [6]: [ac5a]00.byte $00; [7]: [ac5b]38.byte $38; [8]: [ac5c]00.byte $00; [9]: [ac5d]39.byte $39; [10]: [ac5e]00.byte $00; [11]: [ac5f]3a.byte $3a; [12]: [ac60]00.byte $00; [13]: [ac61]3b.byte $3b; [14]: [ac62]00.byte $00; [15]: [ac63]f8.byte $f8; [0]: [ac64]f0.byte $f0; [1]: [ac65]02.byte $02; [2]: [ac66]04.byte $04; [3]: [ac67]1c.byte $1c; [4]: [ac68]00.byte $00; [5]: [ac69]1d.byte $1d; [6]: [ac6a]00.byte $00; [7]: [ac6b]1e.byte $1e; [8]: [ac6c]00.byte $00; [9]: [ac6d]1f.byte $1f; [10]: [ac6e]00.byte $00; [11]: [ac6f]20.byte $20; [12]: [ac70]00.byte $00; [13]: [ac71]21.byte $21; [14]: [ac72]00.byte $00; [15]: [ac73]22.byte $22; [16]: [ac74]00.byte $00; [17]: [ac75]23.byte $23; [18]: [ac76]00.byte $00; [19]: [ac77]f8.byte $f8; [0]: [ac78]f0.byte $f0; [1]: [ac79]02.byte $02; [2]: [ac7a]04.byte $04; [3]: [ac7b]1c.byte $1c; [4]: [ac7c]00.byte $00; [5]: [ac7d]1d.byte $1d; [6]: [ac7e]00.byte $00; [7]: [ac7f]2a.byte $2a; [8]: [ac80]00.byte $00; [9]: [ac81]2b.byte $2b; [10]: [ac82]00.byte $00; [11]: [ac83]2c.byte $2c; [12]: [ac84]00.byte $00; [13]: [ac85]2d.byte $2d; [14]: [ac86]00.byte $00; [15]: [ac87]2e.byte $2e; [16]: [ac88]00.byte $00; [17]: [ac89]2f.byte $2f; [18]: [ac8a]00.byte $00; [19]: [ac8b]f8.byte $f8; [0]: [ac8c]f0.byte $f0; [1]: [ac8d]02.byte $02; [2]: [ac8e]04.byte $04; [3]: [ac8f]1c.byte $1c; [4]: [ac90]00.byte $00; [5]: [ac91]1d.byte $1d; [6]: [ac92]00.byte $00; [7]: [ac93]24.byte $24; [8]: [ac94]00.byte $00; [9]: [ac95]25.byte $25; [10]: [ac96]00.byte $00; [11]: [ac97]26.byte $26; [12]: [ac98]00.byte $00; [13]: [ac99]27.byte $27; [14]: [ac9a]00.byte $00; [15]: [ac9b]28.byte $28; [16]: [ac9c]00.byte $00; [17]: [ac9d]29.byte $29; [18]: [ac9e]00.byte $00; [19]: [ac9f]f8.byte $f8; [0]: [aca0]ec.byte $ec; [1]: [aca1]02.byte $02; [2]: [aca2]05.byte $05; [3]: [aca3]00.byte $00; [4]: [aca4]00.byte $00; [5]: [aca5]01.byte $01; [6]: [aca6]00.byte $00; [7]: [aca7]02.byte $02; [8]: [aca8]00.byte $00; [9]: [aca9]03.byte $03; [10]: [acaa]00.byte $00; [11]: [acab]04.byte $04; [12]: [acac]00.byte $00; [13]: [acad]05.byte $05; [14]: [acae]00.byte $00; [15]: [acaf]06.byte $06; [16]: [acb0]00.byte $00; [17]: [acb1]07.byte $07; [18]: [acb2]00.byte $00; [19]: [acb3]08.byte $08; [20]: [acb4]00.byte $00; [21]: [acb5]09.byte $09; [22]: [acb6]00.byte $00; [23]: [acb7]f8.byte $f8; [0]: [acb8]ec.byte $ec; [1]: [acb9]02.byte $02; [2]: [acba]05.byte $05; [3]: [acbb]0a.byte $0a; [4]: [acbc]00.byte $00; [5]: [acbd]0b.byte $0b; [6]: [acbe]00.byte $00; [7]: [acbf]0c.byte $0c; [8]: [acc0]00.byte $00; [9]: [acc1]0d.byte $0d; [10]: [acc2]00.byte $00; [11]: [acc3]0e.byte $0e; [12]: [acc4]00.byte $00; [13]: [acc5]0f.byte $0f; [14]: [acc6]00.byte $00; [15]: [acc7]10.byte $10; [16]: [acc8]00.byte $00; [17]: [acc9]11.byte $11; [18]: [acca]00.byte $00; [19]: [accb]12.byte $12; [20]: [accc]00.byte $00; [21]: [accd]13.byte $13; [22]: [acce]00.byte $00; [23]: [accf]f8.byte $f8; [0]: [acd0]ec.byte $ec; [1]: [acd1]02.byte $02; [2]: [acd2]05.byte $05; [3]: [acd3]00.byte $00; [4]: [acd4]00.byte $00; [5]: [acd5]01.byte $01; [6]: [acd6]00.byte $00; [7]: [acd7]14.byte $14; [8]: [acd8]00.byte $00; [9]: [acd9]15.byte $15; [10]: [acda]00.byte $00; [11]: [acdb]16.byte $16; [12]: [acdc]00.byte $00; [13]: [acdd]17.byte $17; [14]: [acde]00.byte $00; [15]: [acdf]18.byte $18; [16]: [ace0]00.byte $00; [17]: [ace1]19.byte $19; [18]: [ace2]00.byte $00; [19]: [ace3]1a.byte $1a; [20]: [ace4]00.byte $00; [21]: [ace5]1b.byte $1b; [22]: [ace6]00.byte $00; [23]: [ace7]00.byte $00; [0]: [ace8]00.byte $00; [1]: [ace9]04.byte $04; [2]: [acea]0b.byte $0b; [3]: [aceb]ff.byte $ff; [4]: [acec]80.byte $80; [5]: [aced]01.byte $01; [6]: [acee]83.byte $83; [7]: [acef]01.byte $01; [8]: [acf0]83.byte $83; [9]: [acf1]01.byte $01; [10]: [acf2]ff.byte $ff; [11]: [acf3]81.byte $81; [12]: [acf4]01.byte $01; [13]: [acf5]8e.byte $8e; [14]: [acf6]01.byte $01; [15]: [acf7]ff.byte $ff; [16]: [acf8]ff.byte $ff; [17]: [acf9]81.byte $81; [18]: [acfa]01.byte $01; [19]: [acfb]ff.byte $ff; [20]: [acfc]ff.byte $ff; [21]: [acfd]ff.byte $ff; [22]: [acfe]81.byte $81; [23]: [acff]01.byte $01; [24]: [ad00]ff.byte $ff; [25]: [ad01]ff.byte $ff; [26]: [ad02]ff.byte $ff; [27]: [ad03]81.byte $81; [28]: [ad04]01.byte $01; [29]: [ad05]ff.byte $ff; [30]: [ad06]ff.byte $ff; [31]: [ad07]ff.byte $ff; [32]: [ad08]81.byte $81; [33]: [ad09]01.byte $01; [34]: [ad0a]ff.byte $ff; [35]: [ad0b]ff.byte $ff; [36]: [ad0c]ff.byte $ff; [37]: [ad0d]81.byte $81; [38]: [ad0e]01.byte $01; [39]: [ad0f]ff.byte $ff; [40]: [ad10]ff.byte $ff; [41]: [ad11]ff.byte $ff; [42]: [ad12]81.byte $81; [43]: [ad13]01.byte $01; [44]: [ad14]ff.byte $ff; [45]: [ad15]ff.byte $ff; [46]: [ad16]ff.byte $ff; [47]: [ad17]81.byte $81; [48]: [ad18]01.byte $01; [49]: [ad19]ff.byte $ff; [50]: [ad1a]ff.byte $ff; [51]: [ad1b]84.byte $84; [52]: [ad1c]01.byte $01; [53]: [ad1d]85.byte $85; [54]: [ad1e]01.byte $01; [55]: [ad1f]ff.byte $ff; [56]: [ad20]ff.byte $ff; [57]: [ad21]ff.byte $ff; [58]: [ad22]8f.byte $8f; [59]: [ad23]01.byte $01; [60]: [ad24]ff.byte $ff; [61]: [ad25]ff.byte $ff; [62]: [ad26]00.byte $00; [0]: [ad27]00.byte $00; [1]: [ad28]04.byte $04; [2]: [ad29]0b.byte $0b; [3]: [ad2a]ff.byte $ff; [4]: [ad2b]82.byte $82; [5]: [ad2c]01.byte $01; [6]: [ad2d]83.byte $83; [7]: [ad2e]81.byte $81; [8]: [ad2f]83.byte $83; [9]: [ad30]81.byte $81; [10]: [ad31]ff.byte $ff; [11]: [ad32]81.byte $81; [12]: [ad33]41.byte $41; [13]: [ad34]8e.byte $8e; [14]: [ad35]01.byte $01; [15]: [ad36]ff.byte $ff; [16]: [ad37]ff.byte $ff; [17]: [ad38]81.byte $81; [18]: [ad39]41.byte $41; [19]: [ad3a]ff.byte $ff; [20]: [ad3b]ff.byte $ff; [21]: [ad3c]ff.byte $ff; [22]: [ad3d]81.byte $81; [23]: [ad3e]41.byte $41; [24]: [ad3f]ff.byte $ff; [25]: [ad40]ff.byte $ff; [26]: [ad41]ff.byte $ff; [27]: [ad42]81.byte $81; [28]: [ad43]41.byte $41; [29]: [ad44]ff.byte $ff; [30]: [ad45]ff.byte $ff; [31]: [ad46]ff.byte $ff; [32]: [ad47]81.byte $81; [33]: [ad48]41.byte $41; [34]: [ad49]ff.byte $ff; [35]: [ad4a]ff.byte $ff; [36]: [ad4b]ff.byte $ff; [37]: [ad4c]81.byte $81; [38]: [ad4d]41.byte $41; [39]: [ad4e]ff.byte $ff; [40]: [ad4f]ff.byte $ff; [41]: [ad50]ff.byte $ff; [42]: [ad51]81.byte $81; [43]: [ad52]41.byte $41; [44]: [ad53]ff.byte $ff; [45]: [ad54]ff.byte $ff; [46]: [ad55]ff.byte $ff; [47]: [ad56]81.byte $81; [48]: [ad57]41.byte $41; [49]: [ad58]ff.byte $ff; [50]: [ad59]ff.byte $ff; [51]: [ad5a]86.byte $86; [52]: [ad5b]01.byte $01; [53]: [ad5c]87.byte $87; [54]: [ad5d]41.byte $41; [55]: [ad5e]ff.byte $ff; [56]: [ad5f]ff.byte $ff; [57]: [ad60]ff.byte $ff; [58]: [ad61]8f.byte $8f; [59]: [ad62]41.byte $41; [60]: [ad63]ff.byte $ff; [61]: [ad64]ff.byte $ff; [62]: [ad65]00.byte $00; [0]: [ad66]00.byte $00; [1]: [ad67]01.byte $01; [2]: [ad68]01.byte $01; [3]: [ad69]88.byte $88; [4]: [ad6a]01.byte $01; [5]: [ad6b]00.byte $00; [0]: [ad6c]00.byte $00; [1]: [ad6d]01.byte $01; [2]: [ad6e]01.byte $01; [3]: [ad6f]89.byte $89; [4]: [ad70]01.byte $01; [5]: [ad71]00.byte $00; [0]: [ad72]00.byte $00; [1]: [ad73]01.byte $01; [2]: [ad74]01.byte $01; [3]: [ad75]8a.byte $8a; [4]: [ad76]01.byte $01; [5]: [ad77]00.byte $00; [0]: [ad78]00.byte $00; [1]: [ad79]01.byte $01; [2]: [ad7a]01.byte $01; [3]: [ad7b]8b.byte $8b; [4]: [ad7c]01.byte $01; [5]: [ad7d]00.byte $00; [0]: [ad7e]00.byte $00; [1]: [ad7f]01.byte $01; [2]: [ad80]01.byte $01; [3]: [ad81]8c.byte $8c; [4]: [ad82]01.byte $01; [5]: [ad83]00.byte $00; [0]: [ad84]00.byte $00; [1]: [ad85]01.byte $01; [2]: [ad86]01.byte $01; [3]: [ad87]8d.byte $8d; [4]: [ad88]01.byte $01; [5]: [ad89]80.byte $80; [6]: [ad8a]ff.byte $ff; [7]: [ad8b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ad93]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ad9b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ada3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [adab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [adb3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [adbb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [adc3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [adcb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [add3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [addb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ade3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [adeb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [adf3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [adfb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae03]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae0b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae13]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae1b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae23]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae2b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae33]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae3b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae43]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae4b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae53]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae5b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae63]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae6b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae73]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae7b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae83]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae8b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae93]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ae9b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [aea3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [aeab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [aeb3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [aebb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [aec3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [aecb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [aed3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [aedb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [aee3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [aeeb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [aef3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [aefb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af03]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af0b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af13]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af1b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af23]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af2b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af33]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af3b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af43]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af4b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af53]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af5b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af63]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af6b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af73]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af7b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af83]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af8b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af93]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [af9b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [afa3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [afab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [afb3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [afbb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [afc3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [afcb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [afd3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [afdb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [afe3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [afeb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [aff3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [affb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b003]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b00b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b013]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b01b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b023]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b02b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b033]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b03b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b043]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b04b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b053]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b05b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b063]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b06b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b073]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b07b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b083]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b08b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b093]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b09b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b0a3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b0ab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b0b3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b0bb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b0c3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b0cb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b0d3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b0db]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b0e3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b0eb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b0f3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b0fb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b103]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b10b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b113]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b11b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b123]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b12b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b133]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b13b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b143]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b14b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b153]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b15b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b163]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b16b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b173]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b17b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b183]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b18b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b193]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b19b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b1a3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b1ab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b1b3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b1bb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b1c3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b1cb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b1d3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b1db]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b1e3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b1eb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b1f3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b1fb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b203]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b20b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b213]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b21b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b223]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b22b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b233]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b23b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b243]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b24b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b253]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b25b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b263]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b26b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b273]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b27b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b283]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b28b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b293]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b29b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b2a3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b2ab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b2b3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b2bb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b2c3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b2cb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b2d3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b2db]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b2e3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b2eb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b2f3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b2fb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b303]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b30b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b313]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b31b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b323]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b32b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b333]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b33b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b343]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b34b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b353]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b35b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b363]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b36b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b373]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b37b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b383]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b38b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b393]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b39b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b3a3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b3ab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b3b3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b3bb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b3c3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b3cb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b3d3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b3db]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b3e3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b3eb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b3f3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b3fb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b403]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b40b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b413]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b41b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b423]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b42b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b433]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b43b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b443]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b44b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b453]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b45b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b463]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b46b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b473]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b47b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b483]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b48b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b493]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b49b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b4a3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b4ab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b4b3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b4bb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b4c3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b4cb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b4d3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b4db]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b4e3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b4eb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b4f3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b4fb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b503]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b50b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b513]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b51b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b523]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b52b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b533]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b53b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b543]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b54b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b553]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b55b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b563]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b56b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b573]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b57b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b583]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b58b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b593]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b59b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b5a3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b5ab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b5b3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b5bb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b5c3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b5cb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b5d3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b5db]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b5e3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b5eb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b5f3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b5fb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b603]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b60b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b613]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b61b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b623]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b62b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b633]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b63b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b643]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b64b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b653]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b65b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b663]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b66b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b673]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b67b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b683]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b68b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b693]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b69b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b6a3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b6ab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b6b3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b6bb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b6c3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b6cb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b6d3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b6db]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b6e3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b6eb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b6f3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b6fb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b703]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b70b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b713]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b71b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b723]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b72b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b733]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b73b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b743]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b74b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b753]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b75b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b763]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b76b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b773]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b77b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b783]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b78b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b793]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b79b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b7a3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b7ab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b7b3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b7bb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b7c3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b7cb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b7d3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b7db]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b7e3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b7eb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b7f3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b7fb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b803]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b80b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b813]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b81b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b823]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b82b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b833]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b83b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b843]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b84b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b853]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b85b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b863]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b86b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b873]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b87b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b883]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b88b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b893]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b89b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b8a3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b8ab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b8b3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b8bb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b8c3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b8cb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b8d3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b8db]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b8e3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b8eb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b8f3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b8fb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b903]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b90b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b913]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b91b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b923]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b92b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b933]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b93b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b943]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b94b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b953]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b95b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b963]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b96b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b973]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b97b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b983]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b98b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b993]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b99b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b9a3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b9ab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b9b3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b9bb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b9c3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b9cb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b9d3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b9db]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b9e3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b9eb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b9f3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [b9fb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba03]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba0b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba13]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba1b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba23]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba2b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba33]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba3b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba43]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba4b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba53]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba5b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba63]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba6b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba73]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba7b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba83]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba8b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba93]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [ba9b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [baa3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [baab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bab3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [babb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bac3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bacb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bad3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [badb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bae3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [baeb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [baf3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bafb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb03]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb0b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb13]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb1b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb23]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb2b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb33]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb3b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb43]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb4b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb53]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb5b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb63]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb6b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb73]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb7b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb83]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb8b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb93]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bb9b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bba3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bbab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bbb3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bbbb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bbc3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bbcb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bbd3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bbdb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bbe3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bbeb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bbf3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bbfb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc03]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc0b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc13]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc1b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc23]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc2b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc33]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc3b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc43]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc4b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc53]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc5b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc63]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc6b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc73]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc7b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc83]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc8b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc93]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bc9b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bca3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bcab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bcb3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bcbb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bcc3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bccb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bcd3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bcdb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bce3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bceb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bcf3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bcfb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd03]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd0b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd13]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd1b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd23]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd2b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd33]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd3b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd43]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd4b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd53]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd5b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd63]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd6b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd73]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd7b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd83]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd8b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd93]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bd9b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bda3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bdab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bdb3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bdbb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bdc3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bdcb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bdd3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bddb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bde3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bdeb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bdf3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bdfb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be03]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be0b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be13]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be1b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be23]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be2b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be33]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be3b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be43]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be4b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be53]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be5b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be63]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be6b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be73]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be7b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be83]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be8b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be93]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [be9b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bea3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [beab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [beb3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bebb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bec3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [becb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bed3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bedb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bee3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [beeb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bef3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [befb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf03]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf0b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf13]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf1b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf23]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf2b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf33]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf3b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf43]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf4b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf53]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf5b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf63]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf6b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf73]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf7b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf83]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf8b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf93]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bf9b]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bfa3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bfab]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bfb3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bfbb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bfc3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bfcb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bfd3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bfdb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bfe3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bfeb]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bff3]ff ff ff ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; undefined [bffb]ff ff ff ff ff.byte $ff,$ff,$ff,$ff,$ff; undefined