;============================================================================
; Faxanadu (U).nes
;
; PRG12 ($8000 - $bfff)
;============================================================================
.segment "PRG12"
.ORG $8000
[8000].byte $00; [0]:
[8001].byte $00; [1]:
[8002].byte $00; [2]:
[8003].byte $00; [3]:
[8004].byte $00; [4]:
[8005].byte $c0; [5]:
[8006].byte $bf; [6]:
[8007].byte $bf; [7]:
[8008].byte $bf; [8]:
[8009].byte $bf; [9]:
[800a].byte $bf; [10]:
[800b].byte $bf; [11]:
[800c].byte $bf; [12]:
[800d].byte $bf; [13]:
[800e].byte $bf; [14]:
[800f].byte $bf; [15]:
[8010].byte $bf; [16]:
[8011].byte $bf; [17]:
[8012].byte $bf; [18]:
[8013].byte $bf; [19]:
[8014].byte $bf; [20]:
[8015].byte $bf; [21]:
[8016].byte $cf; [22]:
[8017].byte $00; [23]:
[8018].byte $00; [24]:
[8019].byte $00; [25]:
[801a].byte $00; [26]:
[801b].byte $00; [27]:
[801c].byte $c0; [0]:
[801d].byte $bf; [1]:
[801e].byte $bf; [2]:
[801f].byte $bf; [3]:
[8020].byte $bf; [4]:
[8021].byte $ce; [5]:
[8022].byte $00; [6]:
[8023].byte $00; [7]:
[8024].byte $00; [8]:
[8025].byte $c8; [9]:
[8026].byte $00; [10]:
[8027].byte $00; [11]:
[8028].byte $00; [12]:
[8029].byte $be; [13]:
[802a].byte $b9; [14]:
[802b].byte $ac; [15]:
[802c].byte $b3; [16]:
[802d].byte $b4; [17]:
[802e].byte $00; [18]:
[802f].byte $00; [19]:
[8030].byte $bc; [20]:
[8031].byte $00; [21]:
[8032].byte $cd; [22]:
[8033].byte $bf; [23]:
[8034].byte $bf; [24]:
[8035].byte $bf; [25]:
[8036].byte $bf; [26]:
[8037].byte $cf; [27]:
[8038].byte $cb; [0]:
[8039].byte $00; [1]:
[803a].byte $c8; [2]:
[803b].byte $00; [3]:
[803c].byte $00; [4]:
[803d].byte $00; [5]:
[803e].byte $00; [6]:
[803f].byte $bc; [7]:
[8040].byte $cc; [8]:
[8041].byte $00; [9]:
[8042].byte $00; [10]:
[8043].byte $c1; [11]:
[8044].byte $c2; [12]:
[8045].byte $00; [13]:
[8046].byte $ab; [14]:
[8047].byte $ac; [15]:
[8048].byte $b3; [16]:
[8049].byte $b4; [17]:
[804a].byte $bc; [18]:
[804b].byte $00; [19]:
[804c].byte $00; [20]:
[804d].byte $00; [21]:
[804e].byte $00; [22]:
[804f].byte $00; [23]:
[8050].byte $00; [24]:
[8051].byte $00; [25]:
[8052].byte $00; [26]:
[8053].byte $cb; [27]:
[8054].byte $cb; [0]:
[8055].byte $00; [1]:
[8056].byte $01; [2]:
[8057].byte $02; [3]:
[8058].byte $03; [4]:
[8059].byte $00; [5]:
[805a].byte $00; [6]:
[805b].byte $00; [7]:
[805c].byte $00; [8]:
[805d].byte $00; [9]:
[805e].byte $d0; [10]:
[805f].byte $d1; [11]:
[8060].byte $d2; [12]:
[8061].byte $d0; [13]:
[8062].byte $ab; [14]:
[8063].byte $ac; [15]:
[8064].byte $b3; [16]:
[8065].byte $b4; [17]:
[8066].byte $c8; [18]:
[8067].byte $00; [19]:
[8068].byte $00; [20]:
[8069].byte $c8; [21]:
[806a].byte $00; [22]:
[806b].byte $00; [23]:
[806c].byte $9d; [24]:
[806d].byte $9e; [25]:
[806e].byte $9f; [26]:
[806f].byte $cb; [27]:
[8070].byte $cb; [0]:
[8071].byte $10; [1]:
[8072].byte $11; [2]:
[8073].byte $12; [3]:
[8074].byte $13; [4]:
[8075].byte $14; [5]:
[8076].byte $15; [6]:
[8077].byte $bc; [7]:
[8078].byte $00; [8]:
[8079].byte $d0; [9]:
[807a].byte $b5; [10]:
[807b].byte $b6; [11]:
[807c].byte $b7; [12]:
[807d].byte $b8; [13]:
[807e].byte $b6; [14]:
[807f].byte $b8; [15]:
[8080].byte $b3; [16]:
[8081].byte $b4; [17]:
[8082].byte $00; [18]:
[8083].byte $c8; [19]:
[8084].byte $00; [20]:
[8085].byte $9c; [21]:
[8086].byte $a0; [22]:
[8087].byte $a1; [23]:
[8088].byte $a2; [24]:
[8089].byte $a3; [25]:
[808a].byte $a4; [26]:
[808b].byte $cb; [27]:
[808c].byte $cb; [0]:
[808d].byte $20; [1]:
[808e].byte $21; [2]:
[808f].byte $22; [3]:
[8090].byte $23; [4]:
[8091].byte $24; [5]:
[8092].byte $25; [6]:
[8093].byte $26; [7]:
[8094].byte $27; [8]:
[8095].byte $c9; [9]:
[8096].byte $ca; [10]:
[8097].byte $c9; [11]:
[8098].byte $ca; [12]:
[8099].byte $ca; [13]:
[809a].byte $ca; [14]:
[809b].byte $ca; [15]:
[809c].byte $b3; [16]:
[809d].byte $b4; [17]:
[809e].byte $bc; [18]:
[809f].byte $2a; [19]:
[80a0].byte $2b; [20]:
[80a1].byte $a5; [21]:
[80a2].byte $a6; [22]:
[80a3].byte $a7; [23]:
[80a4].byte $a8; [24]:
[80a5].byte $a9; [25]:
[80a6].byte $aa; [26]:
[80a7].byte $cb; [27]:
[80a8].byte $cb; [0]:
[80a9].byte $30; [1]:
[80aa].byte $31; [2]:
[80ab].byte $32; [3]:
[80ac].byte $33; [4]:
[80ad].byte $34; [5]:
[80ae].byte $35; [6]:
[80af].byte $36; [7]:
[80b0].byte $37; [8]:
[80b1].byte $38; [9]:
[80b2].byte $39; [10]:
[80b3].byte $ad; [11]:
[80b4].byte $ad; [12]:
[80b5].byte $ae; [13]:
[80b6].byte $ad; [14]:
[80b7].byte $3e; [15]:
[80b8].byte $3f; [16]:
[80b9].byte $04; [17]:
[80ba].byte $05; [18]:
[80bb].byte $06; [19]:
[80bc].byte $07; [20]:
[80bd].byte $08; [21]:
[80be].byte $09; [22]:
[80bf].byte $0a; [23]:
[80c0].byte $00; [24]:
[80c1].byte $0b; [25]:
[80c2].byte $0c; [26]:
[80c3].byte $cb; [27]:
[80c4].byte $cb; [0]:
[80c5].byte $00; [1]:
[80c6].byte $00; [2]:
[80c7].byte $42; [3]:
[80c8].byte $43; [4]:
[80c9].byte $44; [5]:
[80ca].byte $45; [6]:
[80cb].byte $46; [7]:
[80cc].byte $47; [8]:
[80cd].byte $48; [9]:
[80ce].byte $49; [10]:
[80cf].byte $4a; [11]:
[80d0].byte $4b; [12]:
[80d1].byte $4c; [13]:
[80d2].byte $4d; [14]:
[80d3].byte $4e; [15]:
[80d4].byte $4f; [16]:
[80d5].byte $0d; [17]:
[80d6].byte $0e; [18]:
[80d7].byte $0f; [19]:
[80d8].byte $16; [20]:
[80d9].byte $17; [21]:
[80da].byte $18; [22]:
[80db].byte $19; [23]:
[80dc].byte $1a; [24]:
[80dd].byte $1b; [25]:
[80de].byte $00; [26]:
[80df].byte $cb; [27]:
[80e0].byte $cb; [0]:
[80e1].byte $00; [1]:
[80e2].byte $00; [2]:
[80e3].byte $52; [3]:
[80e4].byte $53; [4]:
[80e5].byte $54; [5]:
[80e6].byte $55; [6]:
[80e7].byte $56; [7]:
[80e8].byte $57; [8]:
[80e9].byte $58; [9]:
[80ea].byte $59; [10]:
[80eb].byte $5a; [11]:
[80ec].byte $5b; [12]:
[80ed].byte $5c; [13]:
[80ee].byte $5d; [14]:
[80ef].byte $5e; [15]:
[80f0].byte $5f; [16]:
[80f1].byte $1d; [17]:
[80f2].byte $1e; [18]:
[80f3].byte $1f; [19]:
[80f4].byte $28; [20]:
[80f5].byte $29; [21]:
[80f6].byte $2c; [22]:
[80f7].byte $2d; [23]:
[80f8].byte $2e; [24]:
[80f9].byte $2f; [25]:
[80fa].byte $00; [26]:
[80fb].byte $cb; [27]:
[80fc].byte $cb; [0]:
[80fd].byte $00; [1]:
[80fe].byte $bc; [2]:
[80ff].byte $62; [3]:
[8100].byte $63; [4]:
[8101].byte $64; [5]:
[8102].byte $65; [6]:
[8103].byte $66; [7]:
[8104].byte $67; [8]:
[8105].byte $68; [9]:
[8106].byte $69; [10]:
[8107].byte $6a; [11]:
[8108].byte $6b; [12]:
[8109].byte $6c; [13]:
[810a].byte $6d; [14]:
[810b].byte $6e; [15]:
[810c].byte $6f; [16]:
[810d].byte $3a; [17]:
[810e].byte $3b; [18]:
[810f].byte $3c; [19]:
[8110].byte $3d; [20]:
[8111].byte $40; [21]:
[8112].byte $41; [22]:
[8113].byte $50; [23]:
[8114].byte $51; [24]:
[8115].byte $60; [25]:
[8116].byte $00; [26]:
[8117].byte $cb; [27]:
[8118].byte $cb; [0]:
[8119].byte $00; [1]:
[811a].byte $00; [2]:
[811b].byte $72; [3]:
[811c].byte $73; [4]:
[811d].byte $74; [5]:
[811e].byte $75; [6]:
[811f].byte $76; [7]:
[8120].byte $77; [8]:
[8121].byte $78; [9]:
[8122].byte $79; [10]:
[8123].byte $7a; [11]:
[8124].byte $7b; [12]:
[8125].byte $7c; [13]:
[8126].byte $7d; [14]:
[8127].byte $7e; [15]:
[8128].byte $7f; [16]:
[8129].byte $61; [17]:
[812a].byte $70; [18]:
[812b].byte $71; [19]:
[812c].byte $80; [20]:
[812d].byte $90; [21]:
[812e].byte $91; [22]:
[812f].byte $92; [23]:
[8130].byte $93; [24]:
[8131].byte $00; [25]:
[8132].byte $00; [26]:
[8133].byte $cb; [27]:
[8134].byte $cb; [0]:
[8135].byte $00; [1]:
[8136].byte $81; [2]:
[8137].byte $82; [3]:
[8138].byte $83; [4]:
[8139].byte $84; [5]:
[813a].byte $85; [6]:
[813b].byte $86; [7]:
[813c].byte $83; [8]:
[813d].byte $88; [9]:
[813e].byte $89; [10]:
[813f].byte $83; [11]:
[8140].byte $8b; [12]:
[8141].byte $8c; [13]:
[8142].byte $8d; [14]:
[8143].byte $8e; [15]:
[8144].byte $8f; [16]:
[8145].byte $94; [17]:
[8146].byte $95; [18]:
[8147].byte $96; [19]:
[8148].byte $97; [20]:
[8149].byte $98; [21]:
[814a].byte $83; [22]:
[814b].byte $9a; [23]:
[814c].byte $9b; [24]:
[814d].byte $f3; [25]:
[814e].byte $ec; [26]:
[814f].byte $cb; [27]:
[8150].byte $cb; [0]:
[8151].byte $bc; [1]:
[8152].byte $00; [2]:
[8153].byte $00; [3]:
[8154].byte $bc; [4]:
[8155].byte $bc; [5]:
[8156].byte $bc; [6]:
[8157].byte $00; [7]:
[8158].byte $c1; [8]:
[8159].byte $d3; [9]:
[815a].byte $00; [10]:
[815b].byte $00; [11]:
[815c].byte $00; [12]:
[815d].byte $00; [13]:
[815e].byte $c4; [14]:
[815f].byte $c5; [15]:
[8160].byte $b3; [16]:
[8161].byte $b4; [17]:
[8162].byte $00; [18]:
[8163].byte $00; [19]:
[8164].byte $00; [20]:
[8165].byte $00; [21]:
[8166].byte $00; [22]:
[8167].byte $00; [23]:
[8168].byte $00; [24]:
[8169].byte $bc; [25]:
[816a].byte $00; [26]:
[816b].byte $cb; [27]:
[816c].byte $cb; [0]:
[816d].byte $bb; [1]:
[816e].byte $d3; [2]:
[816f].byte $d3; [3]:
[8170].byte $c6; [4]:
[8171].byte $c7; [5]:
[8172].byte $cf; [6]:
[8173].byte $d0; [7]:
[8174].byte $d1; [8]:
[8175].byte $b7; [9]:
[8176].byte $b8; [10]:
[8177].byte $00; [11]:
[8178].byte $c8; [12]:
[8179].byte $00; [13]:
[817a].byte $d4; [14]:
[817b].byte $b1; [15]:
[817c].byte $b3; [16]:
[817d].byte $b4; [17]:
[817e].byte $c8; [18]:
[817f].byte $00; [19]:
[8180].byte $c1; [20]:
[8181].byte $d3; [21]:
[8182].byte $00; [22]:
[8183].byte $00; [23]:
[8184].byte $d2; [24]:
[8185].byte $d3; [25]:
[8186].byte $c6; [26]:
[8187].byte $cb; [27]:
[8188].byte $cd; [0]:
[8189].byte $bf; [1]:
[818a].byte $bf; [2]:
[818b].byte $bf; [3]:
[818c].byte $cf; [4]:
[818d].byte $af; [5]:
[818e].byte $bf; [6]:
[818f].byte $b0; [7]:
[8190].byte $b0; [8]:
[8191].byte $af; [9]:
[8192].byte $bf; [10]:
[8193].byte $cf; [11]:
[8194].byte $c6; [12]:
[8195].byte $c7; [13]:
[8196].byte $99; [14]:
[8197].byte $8a; [15]:
[8198].byte $87; [16]:
[8199].byte $c3; [17]:
[819a].byte $bb; [18]:
[819b].byte $d0; [19]:
[819c].byte $d1; [20]:
[819d].byte $b7; [21]:
[819e].byte $b8; [22]:
[819f].byte $c0; [23]:
[81a0].byte $bf; [24]:
[81a1].byte $bf; [25]:
[81a2].byte $bf; [26]:
[81a3].byte $ce; [27]:
[81a4].byte $00; [0]:
[81a5].byte $00; [1]:
[81a6].byte $00; [2]:
[81a7].byte $00; [3]:
[81a8].byte $cd; [4]:
[81a9].byte $bf; [5]:
[81aa].byte $bf; [6]:
[81ab].byte $bf; [7]:
[81ac].byte $bf; [8]:
[81ad].byte $bf; [9]:
[81ae].byte $bf; [10]:
[81af].byte $bd; [11]:
[81b0].byte $af; [12]:
[81b1].byte $b2; [13]:
[81b2].byte $b2; [14]:
[81b3].byte $b0; [15]:
[81b4].byte $bd; [16]:
[81b5].byte $af; [17]:
[81b6].byte $bf; [18]:
[81b7].byte $b0; [19]:
[81b8].byte $bf; [20]:
[81b9].byte $af; [21]:
[81ba].byte $bf; [22]:
[81bb].byte $ce; [23]:
[81bc].byte $00; [24]:
[81bd].byte $00; [25]:
[81be].byte $00; [26]:
[81bf].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]
[81c0]LDA #$0a
[81c2]STA a:TextBox_X; Textbox X = 10
[81c5]LDA #$14
[81c7]STA a:TextBox_Width; Textbox width = 20
[81ca]LDA #$08
[81cc]STA a:TextBox_Height; Textbox height = 8
;
; Check if there's a portrait shown.
;
[81cf]LDA a:Temp_0201; Load the portrait ID from the IScript.
[81d2]BMI @_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]LDY #$06; Textbox Y = 6
[81d6]LDA Player_PosY; Check the player's Y position.
[81d8]CMP #$40; Is it >= 64?
[81da]BCS @_setYAndReturn; If so, jump to return.
[81dc]@_hasPortrait:; [$81dc]
[81dc]LDY #$10; Textbox Y = 16
[81de]@_setYAndReturn:; [$81de]
[81de]STY a:TextBox_Y; Set the textbox Y position.
[81e1]RTS
[81e2]TextBox_OpenForNPC:; [$81e2]
[81e2]JSR TextBox_SetCoordsForNPC; Set textbox coordinates for an NPC dialogue.
[81e5]JSR TextBox_Open; Open the textbox.
;
; v-- Fall through --v
;
[81e8]IScripts_PositionAndFillPlaceholderText:; [$81e8]
;
; Set the X position for text within the textbox.
;
[81e8]LDA a:TextBox_X; Load the textbox X.
[81eb]CLC
[81ec]ADC #$02; Add 2.
[81ee]STA TextBox_ContentsX; Set as the text draw X position.
;
; Set the Y position for text within the textbox.
;
[81f0]LDA a:TextBox_Y; Load the textbox Y.
[81f3]CLC
[81f4]ADC #$02; Add 2.
[81f6]STA TextBox_ContentsY; Set as the text draw Y position.
;
; Fill with placeholder text.
;
[81f8]JMP 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]
[81fb]JSR TextBox_SetCoordsForNPC; Set textbox coordinates for an NPC dialogue.
[81fe]JMP TextBox_Close; Close the textbox.
[8201]TextBox_SetCoordsForPortrait:; [$8201]
[8201]LDA #$02
[8203]STA a:TextBox_X; X = 2
[8206]LDA #$0e
[8208]STA a:TextBox_Y; Y = 14
[820b]LDA #$08
[820d]STA a:TextBox_Width; Width = 8
[8210]LDA #$0a
[8212]STA a:TextBox_Height; Height = 10
[8215]RTS
;============================================================================
; 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]
[8216]LDX #$18
[8218]STX Arg_DrawSprite_PosX; Draw X = 24
[821a]LDX #$58
[821c]STX Arg_DrawSprite_PosY; Draw Y = 88
[821e]RTS
;============================================================================
; 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]
[821f]JSR TextBox_SetCoordsForPortrait; Set textbox coordinates for the portrait.
[8222]JMP TextBox_Open; Open the textbox.
;============================================================================
; TODO: Document DEADCODE_TextBox_ClosePortrait
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;============================================================================
[8225]DEADCODE_TextBox_ClosePortrait:; [$8225]
[8225]JSR TextBox_SetCoordsForPortrait
[8228]JMP 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.
;
; 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]
[822b]LDA #$02
[822d]STA a:TextBox_X; X = 2
[8230]LDA #$08
[8232]STA a:TextBox_Y; Y = 8
[8235]LDA #$1e
[8237]STA a:TextBox_Width; Width = 30
[823a]LDA #$14
[823c]STA a:TextBox_Height; Height = 20
[823f]JMP TextBox_Close; Close the textbox.
[8242]IScripts_Begin:; [$8242]
;
; If this is 0xFF, map to the "Remember Your Mantra."
;
[8242]CMP #$ff; Compare the start offset to 0xFF.
[8244]BNE @_loadScript; If equal, jump.
[8246]LDA #$1f; Set the start offset to 0x1F.
;
; Load the script address from the table.
;
[8248]@_loadScript:; [$8248]
[8248]STA a:Temp_0200; Store the index temporarily.
[824b]TAX; X = A
[824c]LDA ISCRIPT_ADDRS_L,X; Load the lower byte of the IScript address.
[824f]STA IScriptOrCHRAddr; Store as the lower byte.
[8251]LDA ISCRIPT_ADDRS_U,X; Load the upper byte of the IScript address.
[8254]STA IScriptOrCHRAddr_U; Store as the upper byte.
[8256]LDY #$00; Y = 0 (start offset in the script).
[8258]LDA (IScriptOrCHRAddr),Y; Load the first byte of the script (portrait ID).
[825a]STA a:Temp_0201; Store it for the duration of the script.
[825d]BPL @_continueScript; If not a portrait ID, jump.
;
; Begin showing the portrait information.
;
[825f]AND #$7f; Keep the portrait ID bits.
[8261]JSR IScripts_LoadPortraitTiles; Draw the portrait image.
[8264]JSR IScripts_OpenForPortrait; Draw the portrait frame.
[8267]@_continueScript:; [$8267]
[8267]JSR TextBox_OpenForNPC; Open the text window.
[826a]LDA #$01
[826c]STA IScriptOffset; Set IScript offset to 1.
;
; v-- Fall through --v
;
[826e]IScripts_InvokeNextAction:; [$826e]
[826e]JSR IScripts_LoadByte; Load the script ID
[8271]TAX; Store the byte in X and load from the offset table.
[8272]LDA IScriptActions_U,X; Fetch the upper script offset
[8275]PHA; Push the upper offset to the stack
[8276]LDA IScriptActions_L,X; Fetch the lower script offset
[8279]PHA; Push the lower offset to the stack
[827a]RTS
;============================================================================
; Addresses for the IScript action handlers.
;
; XREFS:
;
IScripts_InvokeNextAction
;============================================================================
[827b]IScriptActions_L:; [$827b]
[827b].byte $b3; [0]: End Script action
[827c]IScriptActions_L_1_:; [$827c]
[827c].byte $c4; [1]: Show Unskippable Message action
[827d].byte $ee; [2]: Show Question Message action
[827e].byte $d8; [3]: Show Message action
[827f].byte $25; [4]: Check/Update Player Title action
[8280].byte $5a; [5]: Spend Gold action
[8281].byte $90; [6]: Set Spawn Point action
[8282].byte $9e; [7]: Add Inventory Item action
[8283].byte $d7; [8]: Open Shop action
[8284].byte $24; [9]: Add Gold action
[8285].byte $7f; [10]: Add MP action
[8286].byte $d0; [11]: If Quest Completed action
[8287].byte $f5; [12]: If Player Has Title action
[8288].byte $1e; [13]: If Player Has Gold action
[8289].byte $e5; [14]: Set Quest Complete action
[828a].byte $2f; [15]: Show Buy/Sell Menu action
[828b].byte $56; [16]: Consume Item action
[828c].byte $5f; [17]: Show Sell Menu action
[828d].byte $17; [18]: If Player Has Item action
[828e].byte $ae; [19]: Add HP action
[828f].byte $36; [20]: Show Password action
[8290].byte $ad; [21]: Finish Game action
[8291].byte $07; [22]: Show Message and If Dismissed action
[8292].byte $aa; [23]: Jump To Script Address action
[8293]IScriptActions_U:; [$8293]
[8293].byte $82; [0]: End Script action
[8294]IScriptActions_U_1_:; [$8294]
[8294].byte $82; [1]: Show Unskippable Message action
[8295].byte $82; [2]: Show Question Message action
[8296].byte $82; [3]: Show Message action
[8297].byte $87; [4]: Check/Update Player Title action
[8298].byte $83; [5]: Spend Gold action
[8299].byte $83; [6]: Set Spawn Point action
[829a].byte $83; [7]: Add Inventory Item action
[829b].byte $83; [8]: Open Shop action
[829c].byte $85; [9]: Add Gold action
[829d].byte $85; [10]: Add MP action
[829e].byte $85; [11]: If Quest Completed action
[829f].byte $85; [12]: If Player Has Title action
[82a0].byte $86; [13]: If Player Has Gold action
[82a1].byte $85; [14]: Set Quest Complete action
[82a2].byte $86; [15]: Show Buy/Sell Menu action
[82a3].byte $86; [16]: Consume Item action
[82a4].byte $86; [17]: Show Sell Menu action
[82a5].byte $87; [18]: If Player Has Item action
[82a6].byte $85; [19]: Add HP action
[82a7].byte $87; [20]: Show Password action
[82a8].byte $82; [21]: Finish Game action
[82a9].byte $83; [22]: Show Message and If Dismissed action
[82aa].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]
[82ab]JMP 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]
[82ae]JSR SplashAnimation_RunOutro; Show the outro animation.
[82b1]JMP Game_Init; Re-initialize the game.
[82b4]IScriptAction_EndScript:; [$82b4]
[82b4]JSR IScripts_UpdatePortraitAnimation; Update the portrait animation.
[82b7]LDA a:Temp_0201; Load the portrait ID.
[82ba]BPL @_noPortrait; If a portrait ID is not set, jump.
[82bc]JSR IScripts_ClearPortraitImage; Clear the portrait image.
[82bf]JMP TextBox_ClearForPortraitAndText; Clear the portrait frame.
[82c2]@_noPortrait:; [$82c2]
[82c2]JMP 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:; [$82c5]
;
; Load the message to display.
;
[82c5]JSR IScripts_LoadByte; Load the next byte as the message ID.
[82c8]JSR Messages_Load; Load the message.
;
; Draw the characters one-by-one until the message is done.
;
[82cb]@_loop:; [$82cb]
[82cb]JSR IScripts_UpdatePortraitAnimation; Update the portrait animation.
[82ce]JSR TextBox_ShowNextChar; Draw the next character in the textbox.
[82d1]JSR TextBox_CheckShouldContinue; Check if the message should continue.
[82d4]BCC @_loop; If so, loop.
;
; Done showing the textbox. Invoke the next action.
;
[82d6]JMP 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:; [$82d9]
;
; Load the message to display.
;
[82d9]JSR IScripts_LoadByte; Load the next byte as the message ID.
[82dc]JSR Messages_Load; Load the message.
;
; Draw the characters one-by-one until the message is done.
;
[82df]@_loop:; [$82df]
[82df]JSR IScripts_UpdatePortraitAnimation; Update the portrait animation.
[82e2]JSR TextBox_ShowNextChar; Draw the next character in the textbox.
[82e5]JSR TextBox_CheckShouldContinueOrDismissMessage; Check if the message is done or continued.
[82e8]BCS IScriptAction_EndScript; If dismissed, end the script.
[82ea]BNE @_loop; If not done, loop.
;
; Done showing the textbox. Invoke the next action.
;
[82ec]JMP 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]
[82ef]JSR IScripts_LoadByte; Load the message ID parameer.
[82f2]JSR Messages_Load; Load the message string.
[82f5]@_messageLoop:; [$82f5]
[82f5]JSR IScripts_UpdatePortraitAnimation; Update the portrait animation.
[82f8]JSR TextBox_ShowNextChar; Show the next character in the textbox.
[82fb]JSR TextBox_CheckShouldContinueOrDismissQuestion; Check whether to continue or dismiss.
[82fe]BCS IScriptAction_EndScript; If dismissed, end the script.
[8300]BNE @_messageLoop; Else, if message text remains, loop.
;
; The message finished. Fill up the textbox with hidden
; placeholder text and move on to the next action.
;
[8302]JSR IScripts_PositionAndFillPlaceholderText
[8305]JMP 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]
[8308]JSR IScripts_LoadByte; Load the message ID parameer.
[830b]JSR Messages_Load; Load the message string.
[830e]@_messageLoop:; [$830e]
[830e]JSR IScripts_UpdatePortraitAnimation; Update the portrait animation.
[8311]JSR TextBox_ShowNextChar; Show the next character in the textbox.
[8314]JSR TextBox_CheckShouldContinueOrDismissQuestion; Check whether to continue or dismiss.
[8317]BCS @_messageDismissed; If dismissed, jump to continue this script.
[8319]BNE @_messageLoop; Else, if message text remains, loop.
;
; The message finished. Load the next parameter as an
; address and jump to it.
;
[831b]JMP 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]
[831e]JMP IScripts_SkipAddrAndInvoke; Invoke the next action in the script.
[8321]IScripts_ProgressivelySubtractGold:; [$8321]
[8321]JSR IScripts_UpdatePortraitAnimation; Update the portrait animation.
[8324]LDA a:Temp_0203; Load the upper byte of the gold amount.
[8327]BMI @_subtractLowerByte; If the upper byte is 0, jump.
[8329]ORA a:Temp_0202; OR with the lower byte.
[832c]BEQ @_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]LDA a:Temp_0202; Load the lower byte of gold.
[8331]SEC
[8332]SBC #$0a; Subtract 10.
[8334]STA a:Temp_0202; And store as the lower byte.
[8337]LDA a:Temp_0203; Load the upper byte of gold.
[833a]SBC #$00; If the lower is now < 0, subtract 1 from upper.
[833c]STA a:Temp_0203; And store it.
;
; Remove 10 gold from the player.
;
[833f]LDA #$0a; A = 10
[8341]STA Temp_Int24; Store as the lower byte to subtract.
[8343]LDA #$00; A = 0
[8345]STA Temp_Int24_M; Store as the upper byte to subtract.
[8347]JSR Player_SubtractGold; Subtract the gold from the player.
[834a]JMP IScripts_ProgressivelySubtractGold; And loop.
[834d]@_subtractUpperByte:; [$834d]
[834d]DEC a:Temp_0203; Subtract 1 from the upper byte.
[8350]LDA #$3c; Use 60 for the lower byte.
[8352]STA a:Temp_0202; And store it.
[8355]@_subtractLowerByte:; [$8355]
[8355]DEC a:Temp_0202; Subtract 1 from the lower byte.
[8358]BNE IScripts_ProgressivelySubtractGold; If not 0, loop.
[835a]RTS; 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:; [$835b]
;
; Load the gold amount parameters for the script.
;
[835b]JSR IScripts_LoadByte; Load the lower byte of the gold amount.
[835e]STA a:Temp_0202; Store it.
[8361]JSR IScripts_LoadByte; Load the upper byte of the gold amount.
[8364]STA a:Temp_0203; Store it
[8367]LDA a:Temp_0202; Load the lower byte again.
[836a]STA Temp_Int24; Store it in Temp_Int24 for comparison.
[836c]LDA a:Temp_0203; Lower the upper byte again.
[836f]STA 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]JSR IScripts_CheckEnoughMoney; Check if there's enough money to pay.
[8374]BCC IScripts_ShowNotEnoughMoney; If not, show the Not Enough Money message.
[8376]JSR IScripts_ProgressivelySubtractGold; Progressively subtract the gold, animating it.
[8379]JMP IScripts_InvokeNextAction; Invoke the next action in the script.
[837c]IScripts_ShowNotEnoughMoney:; [$837c]
;
; Display the Not Enough Money message.
;
[837c]LDA #$03; Set the message ID.
;
; v-- Fall through --v
;
[837e]IScripts_ShowFinalMessage:; [$837e]
[837e]JSR Messages_Load; Load the message string.
;
; Progressively write the message.
;
[8381]@_messageLoop:; [$8381]
[8381]JSR IScripts_UpdatePortraitAnimation; Update the portrait animation.
[8384]JSR TextBox_ShowNextChar; Show the next character in the textbox.
[8387]JSR TextBox_CheckShouldContinueOrDismissMessage; Check whether to continue or dismiss.
[838a]BCS @_endScript; If dismissed, end the script.
[838c]BNE @_messageLoop; Else, if the message is not finished, loop.
[838e]@_endScript:; [$838e]
[838e]JMP 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]
[8391]JSR IScripts_LoadByte; Load the temple/area ID.
[8394]CMP a:TempleSpawnPoint; Compare against the current spawn point.
[8397]BCC @_nextAction; If the older spawn point is further in the game, don't update.
[8399]STA a:TempleSpawnPoint; Else, set the new spawn point.
[839c]@_nextAction:; [$839c]
[839c]JMP 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]
[839f]JSR IScripts_LoadByte; Load the item ID parameter.
[83a2]PHA; Push to the stack, twice.
[83a3]PHA
[83a4]JSR 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]JSR IScriptAction_AddInventoryItem_ClearTextBox; Clear the textbox and prepare for showing the item.
[83aa]LDX a:TextBox_X; X = Textbox X location.
[83ad]INX; X += 2
[83ae]INX
[83af]STX TextBox_ContentsX; Store as the text X position.
[83b1]LDX a:TextBox_Y; X = Textbox Y position.
[83b4]INX; X += 2
[83b5]INX
[83b6]STX TextBox_ContentsY; Store as the text Y position.
;
; Draw the item image and name in the textbox.
;
[83b8]PLA; Pull the item ID from the stack.
[83b9]LDX #$00; X = 0
[83bb]JSR TextBox_DrawItemImage; Draw the item image.
[83be]INC TextBox_ContentsY; Text Y position += 3
[83c0]INC TextBox_ContentsY
[83c2]INC TextBox_ContentsY
[83c4]PLA; Pull the item ID from the stack.
[83c5]JSR TextBox_DrawItemName; Draw the item name.
;
; Update any portrait and textbox terminators until a
; button is pressed.
;
[83c8]@_textboxLoop:; [$83c8]
[83c8]JSR IScripts_UpdatePortraitAnimation; Update the portrait animation.
[83cb]JSR TextBox_DrawUpArrowTerminatorSymbol; Draw the Up arrow terminator symbol.
[83ce]LDA Joy1_ChangedButtonMask; Load any changed controller buttons.
[83d0]BPL @_textboxLoop; If not pressed, loop.
;
; Prepare to clear out the textbox and then invoke the next
; action in the script.
;
[83d2]JSR IScripts_PositionAndFillPlaceholderText; Fill the textbox with invisible placeholder text.
[83d5]JMP 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]
[83d8]LDA #$14; "What would you like?"
[83da]JSR Messages_Load
[83dd]@LAB_PRG12__83dd:; [$83dd]
[83dd]JSR IScripts_UpdatePortraitAnimation
[83e0]JSR TextBox_ShowNextChar
[83e3]JSR TextBox_CheckShouldContinueOrDismissMessage
[83e6]BCS @_endScript
[83e8]BNE @LAB_PRG12__83dd
[83ea]JSR IScripts_LoadByte
[83ed]STA Temp_Int24; Probably shop inventory table
[83ef]JSR IScripts_LoadByte
[83f2]STA Temp_Int24_M
[83f4]JSR Shop_Populate
[83f7]JSR Shop_Draw
[83fa]JSR IScripts_WaitForMenuInput
[83fd]BCC @LAB_PRG12__8402
[83ff]@_endScript:; [$83ff]
[83ff]JMP IScriptAction_EndScript
[8402]@LAB_PRG12__8402:; [$8402]
[8402]JSR Shop_GetPlayerHasSelectedItem
[8405]BCS @LAB_PRG12__8469
[8407]LDX a:Menu_CursorPos
[840a]LDA DataArray,X
[840d]CMP #$80
[840f]BEQ @LAB_PRG12__8439
[8411]CMP #$81
[8413]BEQ @LAB_PRG12__8439
[8415]CMP #$82
[8417]BEQ @LAB_PRG12__8439
[8419]CMP #$83
[841b]BEQ @LAB_PRG12__8439
[841d]CMP #$92
[841f]BEQ @LAB_PRG12__8439
[8421]CMP #$8a
[8423]BEQ @LAB_PRG12__8439
[8425]CMP #$93
[8427]BEQ @LAB_PRG12__8439
[8429]CMP #$94
[842b]BEQ @LAB_PRG12__8439
[842d]JSR Player_GetInventoryIndexForItem
[8430]TAX
[8431]LDA NumberOfWeapons,X; Number of weapons in the player's inventory.
[8434]CMP MAX_INVENTORY_SLOTS,X
[8437]BEQ @LAB_PRG12__8469
[8439]@LAB_PRG12__8439:; [$8439]
[8439]LDX a:Menu_CursorPos
[843c]LDA ShopItemCostsL,X
[843f]STA Temp_Int24
[8441]STA a:Temp_0202
[8444]LDA ShopItemCostsU,X
[8447]STA Temp_Int24_M
[8449]STA a:Temp_0203
[844c]JSR IScripts_CheckEnoughMoney
[844f]BCS @LAB_PRG12__8457
[8451]JSR Maybe_Shop_DrawTextBox
[8454]JMP IScripts_ShowNotEnoughMoney
[8457]@LAB_PRG12__8457:; [$8457]
[8457]LDX a:Menu_CursorPos
[845a]LDA DataArray,X
[845d]JSR Player_AddToInventory
[8460]JSR IScripts_ProgressivelySubtractGold
[8463]JSR Maybe_Shop_DrawTextBox
[8466]JMP IScripts_InvokeNextAction
[8469]@LAB_PRG12__8469:; [$8469]
[8469]JSR Maybe_Shop_DrawTextBox
[846c]LDA #$06
[846e]JMP IScripts_ShowFinalMessage
;============================================================================
; TODO: Document Maybe_Shop_DrawTextBox
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
IScriptAction_OpenShop
;============================================================================
[8471]Maybe_Shop_DrawTextBox:; [$8471]
[8471]JSR IScripts_UpdatePortraitAnimation
[8474]JSR IScripts_UpdatePortraitAnimation
[8477]JSR TextBox_Close
[847a]JMP TextBox_OpenForNPC
[847d]MAX_INVENTORY_SLOTS:; [$847d]
[847d].byte $04; [0]: Max weapons
[847e].byte $04; [1]: Max armor
[847f].byte $04; [2]: Max shields
[8480].byte $04; [3]: Max spells
[8481].byte $08; [4]: Max consumable items
;============================================================================
; TODO: Document Shop_GetPlayerHasSelectedItem
;
; INPUTS:
; None.
;
; OUTPUTS:
; C
;
; XREFS:
;
IScriptAction_OpenShop
;============================================================================
[8482]Shop_GetPlayerHasSelectedItem:; [$8482]
[8482]LDX a:Menu_CursorPos
[8485]LDA DataArray,X
[8488]BPL @LAB_PRG12__84bf
[848a]LDX #$00
[848c]CMP #$80
[848e]BEQ @LAB_PRG12__84b5
[8490]INX
[8491]CMP #$81
[8493]BEQ @LAB_PRG12__84b5
[8495]INX
[8496]CMP #$82
[8498]BEQ @LAB_PRG12__84b5
[849a]INX
[849b]CMP #$83
[849d]BEQ @LAB_PRG12__84b5
[849f]INX
[84a0]CMP #$92
[84a2]BEQ @LAB_PRG12__84b5
[84a4]INX
[84a5]CMP #$8a
[84a7]BEQ @LAB_PRG12__84b5
[84a9]INX
[84aa]CMP #$93
[84ac]BEQ @LAB_PRG12__84b5
[84ae]INX
[84af]CMP #$94
[84b1]BEQ @LAB_PRG12__84b5
[84b3]@LAB_PRG12__84b3:; [$84b3]
[84b3]CLC
[84b4]RTS
[84b5]@LAB_PRG12__84b5:; [$84b5]
[84b5]LDA a:SpecialItems
[84b8]AND BYTE_ARRAY_PRG12__84e5,X
[84bb]BEQ @LAB_PRG12__84b3
[84bd]@LAB_PRG12__84bd:; [$84bd]
[84bd]SEC
[84be]RTS
[84bf]@LAB_PRG12__84bf:; [$84bf]
[84bf]PHA
[84c0]JSR Player_GetInventoryIndexForItem
[84c3]TAX
[84c4]LDA INVENTORY_CATEGORY_L,X
[84c7]STA Temp_Int24
[84c9]LDA INVENTORY_CATEGORY_U,X
[84cc]STA Temp_Int24_M
[84ce]PLA
[84cf]AND #$1f
[84d1]CMP SelectedWeapon,X
[84d4]BEQ @LAB_PRG12__84bd
[84d6]LDY NumberOfWeapons,X
[84d9]BEQ @LAB_PRG12__84b3
[84db]DEY
[84dc]@LAB_PRG12__84dc:; [$84dc]
[84dc]CMP (Temp_Int24),Y
[84de]BEQ @LAB_PRG12__84bd
[84e0]DEY
[84e1]BPL @LAB_PRG12__84dc
[84e3]CLC
[84e4]RTS
[84e5]BYTE_ARRAY_PRG12__84e5:; [$84e5]
[84e5].byte $80; [0]:
[84e6]BYTE_ARRAY_PRG12__84e5_1_:; [$84e6]
[84e6].byte $40; [1]:
[84e7]BYTE_ARRAY_PRG12__84e5_2_:; [$84e7]
[84e7].byte $20; [2]:
[84e8]BYTE_ARRAY_PRG12__84e5_3_:; [$84e8]
[84e8].byte $10; [3]:
[84e9]BYTE_ARRAY_PRG12__84e5_4_:; [$84e9]
[84e9].byte $08; [4]:
[84ea]BYTE_ARRAY_PRG12__84e5_5_:; [$84ea]
[84ea].byte $04; [5]:
[84eb]BYTE_ARRAY_PRG12__84e5_6_:; [$84eb]
[84eb].byte $02; [6]:
[84ec]BYTE_ARRAY_PRG12__84e5_7_:; [$84ec]
[84ec].byte $01; [7]:
[84ed]IScripts_WaitForMenuInput:; [$84ed]
[84ed]JSR IScripts_UpdatePortraitAnimation
[84f0]JSR Menu_UpdateAndDraw
[84f3]LDA Joy1_ChangedButtonMask
[84f5]BMI @_returnFalse
[84f7]ASL A
[84f8]BMI @_returnTrue
[84fa]JMP IScripts_WaitForMenuInput
[84fd]@_returnFalse:; [$84fd]
[84fd]CLC
[84fe]RTS
[84ff]@_returnTrue:; [$84ff]
[84ff]SEC
[8500]RTS
;============================================================================
; 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]
[8501]LDY #$00; Y = 0 (loop counter)
[8503]LDX #$00; X = 0 (menu position counter)
[8505]STX a:Menu_CursorPos; Cusor position = 0
;
; Fetch the menu item at this index.
;
[8508]@_populateLoop:; [$8508]
[8508]LDA (Temp_Int24),Y; A = Menu item at Y.
;
; Check if we're on the last item.
;
[850a]CMP #$ff; Check if it's 0xFF (the menu terminator).
[850c]BEQ @_finish; If so, we're done.
;
; Store the item.
;
[850e]STA DataArray,X; Store the item in the menu.
[8511]INY; Y++
;
; Store the cost.
;
[8512]LDA (Temp_Int24),Y; Load the lower byte of the item cost.
[8514]STA ShopItemCostsL,X; Store it.
[8517]INY; Y++
[8518]LDA (Temp_Int24),Y; Load the upper byte of the item cost.
[851a]STA ShopItemCostsU,X; Store it.
;
; Increment our counters.
;
[851d]INY; Y++
[851e]INX; X++
[851f]BNE @_populateLoop; If we're not done, loop.
[8521]@_finish:; [$8521]
[8521]STX a:Arg_StringsCount; Set the last menu position.
[8524]RTS
;============================================================================
; 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]
[8525]JSR IScripts_LoadByte; Load the lower byte for the gold amount.
[8528]STA a:Temp_0202; Store it.
[852b]JSR IScripts_LoadByte; Load the upper byte for the gold amount.
[852e]STA a:Temp_0203; Store it.
[8531]JSR IScripts_ProgressivelyAddGold; Progressively add gold.
[8534]JMP IScripts_InvokeNextAction; Invoke the next action.
[8537]IScripts_ProgressivelyAddGold:; [$8537]
[8537]JSR IScripts_UpdatePortraitAnimation
[853a]LDA a:Temp_0203
[853d]BMI @LAB_PRG12__856e
[853f]ORA a:Temp_0202
[8542]BEQ @LAB_PRG12__8566
[8544]JSR IScripts_PlayGoldChangeSound
[8547]LDA a:Temp_0202
[854a]SEC
[854b]SBC #$0a
[854d]STA a:Temp_0202
[8550]LDA a:Temp_0203
[8553]SBC #$00
[8555]STA a:Temp_0203
[8558]LDA #$0a
[855a]STA Temp_Int24
[855c]LDA #$00
[855e]STA Temp_Int24_M
[8560]JSR Player_AddGold
[8563]JMP IScripts_ProgressivelyAddGold
[8566]@LAB_PRG12__8566:; [$8566]
[8566]DEC a:Temp_0203
[8569]LDA #$3c
[856b]STA a:Temp_0202
[856e]@LAB_PRG12__856e:; [$856e]
[856e]DEC a:Temp_0202
[8571]BNE IScripts_ProgressivelyAddGold
[8573]RTS
;============================================================================
; 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]
[8574]LDA InterruptCounter; Load the interrupt counter.
[8576]AND #$03; Check if we're ready to play a sound.
[8578]BNE @_return; If not, return.
;
; We're ready to play the sound.
;
[857a]LDA #$19; 0x19 == Change gold amount sound
[857c]JSR Sound_PlayEffect; Play the sound.
[857f]@_return:; [$857f]
[857f]RTS
;============================================================================
; 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]
[8580]JSR IScripts_LoadByte; Load the MP amount from the script.
[8583]STA a:IScript_HPOrMPValueToAdd; Store in the variable to fill MP up to.
[8586]LDA a:Player_MP; Load the currently-added MP value we're filling from.
[8589]CMP #$50; Compare to the cap.
[858b]BCS thunk_IScripts_InvokeNextAction; If at or over, we're done. Jump to invoke the next action.
[858d]@_fillLoop:; [$858d]
[858d]JSR IScripts_UpdatePortraitAnimation
[8590]JSR IScripts_PlayFillingSound; Play the sound for filling a bit of MP.
[8593]LDX a:Player_MP; X = Remaining value to add.
[8596]INX; X++
[8597]TXA; A = X
[8598]JSR Player_SetMP; Set the current mana points.
[859b]DEC a:IScript_HPOrMPValueToAdd; Decrement the remaining value to add.
[859e]BNE @_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]
[85a0]JMP 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]
[85a3]LDA InterruptCounter
[85a5]AND #$03
[85a7]BNE RETURN_85AE
[85a9]LDA #$13
[85ab]JSR Sound_PlayEffect
[85ae]RETURN_85AE:; [$85ae]
[85ae]RTS
;============================================================================
; 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]
[85af]JSR IScripts_LoadByte; Load the HP value to add.
[85b2]STA a:IScript_HPOrMPValueToAdd; Store in the variable to fill HP up to.
[85b5]LDA a:Temp_AddedHPValue; Load the currently-added HP value we're filling from.
[85b8]CMP #$50; Compare against the cap of 80.
[85ba]BCS thunk_IScripts_InvokeNextAction; If over, we're done. Invoke the next action.
[85bc]@_fillLoop:; [$85bc]
[85bc]JSR IScripts_UpdatePortraitAnimation
[85bf]JSR IScripts_PlayFillingSound; Play the sound for filling a bit of HP.
[85c2]LDX a:Temp_AddedHPValue; X = Remaining value to add
[85c5]INX; X++
[85c6]TXA; A = X
[85c7]JSR UI_DrawPlayerHPValue; Draw the next bit of health.
[85ca]DEC a:IScript_HPOrMPValueToAdd; Decrement the remaining amount to add.
[85cd]BNE @_fillLoop; If there's more to add, loop.
[85cf]BEQ 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]
[85d1]JSR IScripts_LoadByte; Load the next byte as the quest index into our table.
[85d4]TAX; X = result
[85d5]LDA a:Quests; Load the current player quests.
[85d8]AND ISCRIPTS_QUEST_BITS-1,X; AND it to the bitmask at the given index.
[85db]BNE @_hasQuestCompleted
[85dd]JMP IScripts_SkipAddrAndInvoke; Skip 2 bytes and invoke the following action.
[85e0]@_hasQuestCompleted:; [$85e0]
[85e0]JMP IScripts_JumpToNextAddr
[85e3]ISCRIPTS_QUEST_BITS:; [$85e3]
[85e3].byte $01,$02,$04; [$85e3] 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]
[85e6]JSR IScripts_LoadByte; Load the next byte as the quest index into our table.
[85e9]TAX; X = result
[85ea]LDA a:Quests; Load the current player quests.
[85ed]ORA ISCRIPTS_QUEST_BITS-1,X; OR it with the bit for this index.
[85f0]STA a:Quests; Store as the new quests bitmask.
[85f3]JMP 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]
[85f6]JSR IScripts_LoadByte; Load the next byte as the player title to check.
[85f9]CMP a:PlayerTitle; Compare to the current player title.
[85fc]BEQ IScripts_JumpToNextAddr; If <=, jump to the script address in the next argument.
[85fe]BCC IScripts_JumpToNextAddr
[8600]JMP IScripts_SkipAddrAndInvoke; Else, skip the address and invoke the next action.
[8603]IScripts_JumpToNextAddr:; [$8603]
;
; 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]JSR IScripts_LoadByte; Load the next byte as the lower byte of the script address.
[8606]PHA; Push to the stack.
[8607]JSR IScripts_LoadByte; Load the next byte as the upper byte of the script address.
[860a]STA IScriptOrCHRAddr_U; Store it.
[860c]PLA; Pop the lower byte.
[860d]STA IScriptOrCHRAddr; Store it.
[860f]LDA #$00; A = 0.
[8611]STA IScriptOffset; Store as the new script offset.
[8613]JMP IScripts_InvokeNextAction; Invoke the action at that address
[8616]IScripts_SkipAddrAndInvoke:; [$8616]
[8616]JSR IScripts_LoadByte; Load 2 bytes and throw them out.
[8619]JSR IScripts_LoadByte
[861c]JMP 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]
[861f]LDA a:Gold; Load the lower byte of the player's gold.
[8622]ORA a:Gold_M; OR with the medium byte.
[8625]ORA a:Gold_U; And the upper byte.
[8628]BNE @_hasGold; If there's any value set, jump.
[862a]JMP IScripts_SkipAddrAndInvoke; Else, skip the next 2 bytes and invoke the following action.
[862d]@_hasGold:; [$862d]
[862d]JMP 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:; [$8630]
;
; Display the next "Come here to buy or sell?" message.
;
[8630]LDA #$10; 0x10 == "Did you come here to buy and sell?"
[8632]JSR IScripts_LoadAndShowMessage; Load and show that message in its entirety.
;
; Set 2 strings for the menu.
;
[8635]LDA #$02; Queue 2 strings to draw.
[8637]STA a:Arg_StringsCount; Set it.
;
; Set the start cursor position to Buy.
;
[863a]LDA #$00; Set the start cursor position to 0.
[863c]STA a:Menu_CursorPos
;
; Render the menu and wait for button changes.
;
[863f]@_loop:; [$863f]
[863f]JSR IScripts_UpdatePortraitAnimation; Update the portrait animation.
[8642]JSR Menu_UpdateAndDraw; Update and draw the menu.
[8645]LDA Joy1_ChangedButtonMask; Load the changed button mask.
[8647]BMI @_choiceMade; If the A button was pressed, jump.
;
; Check any button presses since the last iteration.
;
[8649]ASL A; Increment the bit to check in the button mask.
[864a]BPL @_loop; If any other button was pressed, loop.
;
; End the script.
;
[864c]JMP IScriptAction_EndScript
;
; Perform the next action based on the choice.
;
[864f]@_choiceMade:; [$864f]
[864f]LDA a:Menu_CursorPos; Check the cursor position.
[8652]BEQ IScripts_JumpToNextAddr; If it's the first item, jump to the next address in the script.
[8654]JMP 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]
[8657]JSR IScripts_LoadByte; Load the next byte as the item ID.
[865a]JSR Player_RemoveItem; Remove the item from the player's inventory.
[865d]JMP IScripts_InvokeNextAction; Invoke the next action.
;============================================================================
; TODO: Document IScriptAction_ShowSellMenu
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
IScriptActions_L [$PRG12::828c]
;============================================================================
[8660]IScriptAction_ShowSellMenu:; [$8660]
[8660]JSR IScripts_LoadByte
[8663]STA Temp_Int24
[8665]JSR IScripts_LoadByte
[8668]STA Temp_Int24_M
[866a]LDA #$00
[866c]STA a:Arg_StringsCount
[866f]LDX #$04
[8671]@LAB_PRG12__8671:; [$8671]
[8671]LDY NumberOfWeapons,X
[8674]BEQ @LAB_PRG12__86b7
[8676]TXA
[8677]PHA
[8678]JSR Player_GetInventoryBitForIndex
[867b]STA a:Maybe_Shop_InventoryBitmask
[867e]LDA INVENTORY_CATEGORY_L,X
[8681]STA Temp_Int24_U
[8683]LDA INVENTORY_CATEGORY_U,X
[8686]STA Maybe_Temp4
[8688]DEY
[8689]@LAB_PRG12__8689:; [$8689]
[8689]TYA
[868a]PHA
[868b]LDA (Temp_Int24_U),Y
[868d]ORA a:Maybe_Shop_InventoryBitmask
[8690]TAX
[8691]JSR IScripts_SellMenu_Something8704
[8694]BNE @LAB_PRG12__86b0
[8696]LDX a:Arg_StringsCount
[8699]STA DataArray,X
[869c]INY
[869d]LDA (Temp_Int24),Y
[869f]STA ShopItemCostsL,X
[86a2]INY
[86a3]LDA (Temp_Int24),Y
[86a5]LSR A
[86a6]ROR ShopItemCostsL,X
[86a9]STA ShopItemCostsU,X
[86ac]INX
[86ad]STX a:Arg_StringsCount
[86b0]@LAB_PRG12__86b0:; [$86b0]
[86b0]PLA
[86b1]TAY
[86b2]DEY
[86b3]BPL @LAB_PRG12__8689
[86b5]PLA
[86b6]TAX
[86b7]@LAB_PRG12__86b7:; [$86b7]
[86b7]INX
[86b8]CPX #$05
[86ba]BNE @LAB_PRG12__8671
[86bc]LDA a:Arg_StringsCount
[86bf]BNE @LAB_PRG12__86c6
[86c1]LDA #$12
[86c3]JMP IScripts_ShowFinalMessage
[86c6]@LAB_PRG12__86c6:; [$86c6]
[86c6]LDA #$13
[86c8]JSR Messages_Load
[86cb]@LAB_PRG12__86cb:; [$86cb]
[86cb]JSR IScripts_UpdatePortraitAnimation
[86ce]JSR TextBox_ShowNextChar
[86d1]JSR TextBox_CheckShouldContinueOrDismissMessage
[86d4]BCS @_endScript
[86d6]BNE @LAB_PRG12__86cb
[86d8]JSR Shop_Draw
[86db]JSR IScripts_WaitForMenuInput
[86de]BCS @_endScript
[86e0]LDX a:Menu_CursorPos
[86e3]LDA ShopItemCostsL,X
[86e6]STA a:Temp_0202
[86e9]LDA ShopItemCostsU,X
[86ec]STA a:Temp_0203
[86ef]LDA DataArray,X
[86f2]JSR Player_RemoveItem
[86f5]JSR IScripts_ProgressivelyAddGold
[86f8]JSR TextBox_Close
[86fb]JSR TextBox_OpenForNPC
[86fe]JMP IScripts_InvokeNextAction
[8701]@_endScript:; [$8701]
[8701]JMP IScriptAction_EndScript
;============================================================================
; TODO: Document IScripts_SellMenu_Something8704
;
; INPUTS:
; X
;
; OUTPUTS:
; TODO
;
; XREFS:
;
IScriptAction_ShowSellMenu
;============================================================================
[8704]IScripts_SellMenu_Something8704:; [$8704]
[8704]LDY #$00
[8706]@_loop:; [$8706]
[8706]LDA (Temp_Int24),Y
[8708]CMP #$ff
[870a]BEQ @LAB_PRG12__8716
[870c]TXA
[870d]CMP (Temp_Int24),Y
[870f]BEQ @_return
[8711]INY
[8712]INY
[8713]INY
[8714]BNE @_loop
[8716]@LAB_PRG12__8716:; [$8716]
[8716]TAX
[8717]@_return:; [$8717]
[8717]RTS
;============================================================================
; 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]
[8718]JSR IScripts_LoadByte; Load the next byte as the item ID.
[871b]JSR Player_LacksItem; Check if the player lacks this item.
[871e]BCC @_invokeElse; If they have it, jump.
;
; The player does not have the item.
;
[8720]JMP IScripts_SkipAddrAndInvoke; Skip the next 2 bytes and invoke the following action.
;
; The player has the item.
;
[8723]@_invokeElse:; [$8723]
[8723]JMP 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]
[8726]LDA a:NextPlayerTitle; Load the next player title.
[8729]CMP a:PlayerTitle; Compare against the current title.
[872c]BEQ @_invokeElse; If they're the same, jump.
;
; The player title is not a match. Update it.
;
[872e]STA a:PlayerTitle; Advance the player title.
[8731]JMP IScripts_JumpToNextAddr; Read the next 2 bytes as an address and jump to it.
;
; The player already has that title.
;
[8734]@_invokeElse:; [$8734]
[8734]JMP 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]
[8737]JSR Password_GenerateStateAndReset; Generate the password state.
[873a]JSR TextBox_ClearPasswordSize; Clear the textbox.
[873d]LDA #$00
[873f]STA a:IScripts_Unused_207; DEADCODE: Set to 0.
[8742]@_charLoop:; [$8742]
[8742]JSR IScripts_UpdatePortraitAnimation; Update the portrait animation.
[8745]JSR PasswordScreen_ShowNextChar; Show the next character in the password.
[8748]BCC @_charLoop; If not done, loop.
[874a]@_portraitLoop:; [$874a]
[874a]JSR IScripts_UpdatePortraitAnimation; Update the portrait animation.
[874d]JSR TextBox_DrawUpArrowTerminatorSymbol; Draw the Up Arrow in the textbox.
[8750]LDA Joy1_ChangedButtonMask; A = Changed button mask
[8752]BPL @_portraitLoop; If not dismissed, loop.
[8754]JMP 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]
[8757]JSR Password_GetNext6Bits; Get the next 6 bits of password state for the character offset.
[875a]PHP; Push flags to stack.
[875b]TAY; Y = A (index)
[875c]LDA PASSWORD_ENTERED_CHARS,Y; A = character at index Y
[875f]JSR TextBox_ShowMessage; Show the character in the textbox.
[8762]PLP; Pop flags.
[8763]RTS
[8764]PASSWORD_ENTERED_CHARS:; [$8764]
[8764].byte "ABCDEFGH"; [$8764] char
[876c].byte "IJKLMNOP"; [$876c] char
[8774].byte "QRSTUVWX"; [$8774] char
[877c].byte "YZabcdef"; [$877c] char
[8784].byte "ghijklmn"; [$8784] char
[878c].byte "opqrstuv"; [$878c] char
[8794].byte "wxyz0123"; [$8794] char
[879c].byte "456789,?"; [$879c] char
[87a4]IScripts_LoadByte:; [$87a4]
[87a4]LDY IScriptOffset; Y = current event offset
[87a6]LDA (IScriptOrCHRAddr),Y; A = byte in the script at the offset
[87a8]INY; Y++
[87a9]BNE @_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]INC IScriptOrCHRAddr_U; Increment the address
[87ad]@_incOffset:; [$87ad]
[87ad]STY IScriptOffset; Set new offset
[87af]RETURN_87AF:; [$87af]
[87af]RTS
[87b0]IScripts_UpdatePortraitAnimation:; [$87b0]
[87b0]JSR WaitForNextFrame; Wait for the next frame.
[87b3]JSR Screen_ResetSpritesForGamePlay; Set up state for a screen draw.
[87b6]JSR Game_DrawScreenInFrozenState; Draw the screen in a frozen animation state.
[87b9]LDA a:Temp_0201; Load the portrait ID.
[87bc]BPL RETURN_87AF; If no portrait, return.
[87be]JMP @_updatePortrait; Else, jump to update portrait (oddly, since we could fall through).
[87c1]@_updatePortrait:; [$87c1]
[87c1]LDA a:MessageID; Load the current message ID.
[87c4]BEQ @_messageIsUnset; If unset, jump.
[87c6]LDA a:TextBox_MessagePaused; Load the message-ended flag.
[87c9]BNE @_messageIsUnset; If the message ended, jump.
;
; The message is still animating, so choose the next
; animation frame.
;
[87cb]LDA InterruptCounter; Load the interrupt counter.
[87cd]LSR A; Divide by 8.
[87ce]LSR A
[87cf]LSR A
[87d0]AND #$03; Keep bits 0-1 as the new animation frame.
[87d2]BPL @_drawFrame; Jump to finish the update.
;
; There's no message to continue showing, so freeze the
; animation to frame 0.
;
[87d4]@_messageIsUnset:; [$87d4]
[87d4]LDA #$00; Force animation frame to 0.
[87d6]@_drawFrame:; [$87d6]
[87d6]JSR IScripts_SetPortraitSpriteXY; Set the X/Y location for the portrait sprite.
[87d9]JMP 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:; [$87dc]
;
; Check the upper byte of the gold.
;
[87dc]LDA a:Gold_U; Load the upper byte of the player's gold amount.
[87df]CMP #$00; Is it 0?
[87e1]BNE @_return; If no, return. CMP set Carry as our result.
;
; Check the middle byte of the gold.
;
[87e3]LDA a:Gold_M; Load the middle byte of the player's gold amount.
[87e6]CMP Temp_Int24_M; Compare to the required amount.
[87e8]BNE @_return; If not 0, return. CMP set Carry as our result.
;
; Check the lower byte of the gold.
;
[87ea]LDA a:Gold; Load the lower byte of the gold amount.
[87ed]CMP Temp_Int24; Compare to get our final result as the Carry flag.
[87ef]@_return:; [$87ef]
[87ef]RTS
;============================================================================
; 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]
[87f0]LDA a:TextBox_X; Load the X tile position.
[87f3]ASL A; Multiply by 8 to convert to a pixel position.
[87f4]ASL A
[87f5]ASL A
[87f6]RTS; 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]
[87f7]LDA a:TextBox_Y; Load the Y tile position.
[87fa]ASL A; Multiply by 8 to convert to a pixel position.
[87fb]ASL A
[87fc]ASL A
[87fd]RTS; Return it.
;============================================================================
; TODO: Document TextBox_GetNextAttributeDataOffset
;
; INPUTS:
; None.
;
; OUTPUTS:
; A
;
; XREFS:
;
TextBox_FillBackground
;
TextBox_SetNextAttributeData
;============================================================================
[87fe]TextBox_GetNextAttributeDataOffset:; [$87fe]
[87fe]LDA TextBox_ContentsY
[8800]ASL A
[8801]ASL A
[8802]AND #$f8
[8804]STA Temp_Int24_M
[8806]LDA TextBox_ContentsX
[8808]LSR A
[8809]ORA Temp_Int24_M
[880b]STA Temp_Int24_M
[880d]RTS
;============================================================================
; TODO: Document TextBox_SetNextAttributeData
;
; INPUTS:
; A
;
; OUTPUTS:
; TODO
;
; XREFS:
;
TextBox_FillBackground
;============================================================================
[880e]TextBox_SetNextAttributeData:; [$880e]
[880e]STA Temp_Int24
[8810]JSR TextBox_GetNextAttributeDataOffset
[8813]TAX
[8814]LDA TextBox_ContentsY
[8816]LSR A
[8817]BCS @LAB_PRG12__8842
[8819]LDA TextBox_ContentsX
[881b]LSR A
[881c]BCS @LAB_PRG12__882f
[881e]LDA TextBox_AttributeData,X
[8821]AND #$fc
[8823]STA Temp_Int24_M
[8825]LDA Temp_Int24
[8827]AND #$03
[8829]ORA Temp_Int24_M
[882b]STA TextBox_AttributeData,X
[882e]RTS
[882f]@LAB_PRG12__882f:; [$882f]
[882f]LDA TextBox_AttributeData,X
[8832]AND #$f3
[8834]STA Temp_Int24_M
[8836]LDA Temp_Int24
[8838]ASL A
[8839]ASL A
[883a]AND #$0c
[883c]ORA Temp_Int24_M
[883e]STA TextBox_AttributeData,X
[8841]RTS
[8842]@LAB_PRG12__8842:; [$8842]
[8842]LDA TextBox_ContentsX
[8844]LSR A
[8845]BCS @LAB_PRG12__885c
[8847]LDA TextBox_AttributeData,X
[884a]AND #$cf
[884c]STA Temp_Int24_M
[884e]LDA Temp_Int24
[8850]ASL A
[8851]ASL A
[8852]ASL A
[8853]ASL A
[8854]AND #$30
[8856]ORA Temp_Int24_M
[8858]STA TextBox_AttributeData,X
[885b]RTS
[885c]@LAB_PRG12__885c:; [$885c]
[885c]LDA TextBox_AttributeData,X
[885f]AND #$3f
[8861]STA Temp_Int24_M
[8863]LDA Temp_Int24
[8865]ASL A
[8866]ASL A
[8867]ASL A
[8868]ASL A
[8869]ASL A
[886a]ASL A
[886b]AND #$c0
[886d]ORA Temp_Int24_M
[886f]STA TextBox_AttributeData,X
[8872]RTS
[8873]PLAYER_TOP_MENU_ITEM_STRINGS:; [$8873]
[8873].byte $06,"WEAPON "; [$8873] char
[887b].byte " "; [$887b] char
[8883].byte $05,"ARMOR "; [$8883] char
[888b].byte " "; [$888b] char
[8893].byte $06,"SHIELD "; [$8893] char
[889b].byte " "; [$889b] char
[88a3].byte $05,"MAGIC "; [$88a3] char
[88ab].byte " "; [$88ab] char
[88b3].byte $04,"ITEM "; [$88b3] char
[88bb].byte " "; [$88bb] char
[88c3].byte $06,"PLAYER "; [$88c3] char
[88cb].byte " "; [$88cb] char
[88d3]PLAYER_STATUS_MENU_STRINGS:; [$88d3]
[88d3].byte $09," RAN"; [$88d3] char
[88db].byte "K: "; [$88db] char
[88e3].byte $09,"NEXT EX"; [$88e3] char
[88eb].byte "P: "; [$88eb] char
[88f3].byte $09,"WEAPON:"; [$88f3] char
[88fb].byte " "; [$88fb] char
[8903].byte $09," ARMOR:"; [$8903] char
[890b].byte " "; [$890b] char
[8913].byte $09,"SHIELD:"; [$8913] char
[891b].byte " "; [$891b] char
[8923].byte $09," MAGIC:"; [$8923] char
[892b].byte " "; [$892b] char
[8933].byte $09," ITEM:"; [$8933] char
[893b].byte " "; [$893b] char
[8943]PLAYER_STATUS_MENU_TITLES:; [$8943]
[8943].byte $09,"NOVICE "; [$8943] char
[894b].byte " "; [$894b] char
[8953].byte $09,"ASPIRAN"; [$8953] char
[895b].byte "T "; [$895b] char
[8963].byte $09,"BATTLER"; [$8963] char
[896b].byte " "; [$896b] char
[8973].byte $09,"FIGHTER"; [$8973] char
[897b].byte " "; [$897b] char
[8983].byte $09,"ADEPT "; [$8983] char
[898b].byte " "; [$898b] char
[8993].byte $09,"CHEVALI"; [$8993] char
[899b].byte "ER "; [$899b] char
[89a3].byte $09,"VETERAN"; [$89a3] char
[89ab].byte " "; [$89ab] char
[89b3].byte $09,"WARRIOR"; [$89b3] char
[89bb].byte " "; [$89bb] char
[89c3].byte $09,"SWORDMA"; [$89c3] char
[89cb].byte "N "; [$89cb] char
[89d3].byte $09,"HERO "; [$89d3] char
[89db].byte " "; [$89db] char
[89e3].byte $09,"SOLDIER"; [$89e3] char
[89eb].byte " "; [$89eb] char
[89f3].byte $09,"MYRMIDO"; [$89f3] char
[89fb].byte "N "; [$89fb] char
[8a03].byte $09,"CHAMPIO"; [$8a03] char
[8a0b].byte "N "; [$8a0b] char
[8a13].byte $09,"SUPERHE"; [$8a13] char
[8a1b].byte "RO "; [$8a1b] char
[8a23].byte $09,"PALADIN"; [$8a23] char
[8a2b].byte " "; [$8a2b] char
[8a33].byte $09,"LORD "; [$8a33] char
[8a3b].byte " "; [$8a3b] char
[8a43].byte $09,"NO WEAP"; [$8a43] char
[8a4b].byte "ON "; [$8a4b] char
[8a53].byte $09,"NO ARMO"; [$8a53] char
[8a5b].byte "R "; [$8a5b] char
[8a63].byte $09,"NO SHIE"; [$8a63] char
[8a6b].byte "LD "; [$8a6b] char
[8a73].byte $09,"NO MAGI"; [$8a73] char
[8a7b].byte "C "; [$8a7b] char
[8a83].byte $09,"NO ITEM"; [$8a83] char
[8a8b].byte " "; [$8a8b] char
;============================================================================
; TODO: Document PlayerMenu_Show
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
GameLoop_CheckShowPlayerMenu
;============================================================================
[8a93]PlayerMenu_Show:; [$8a93]
[8a93]LDA #$06
[8a95]STA a:Arg_StringsCount
[8a98]LDA #$00
[8a9a]STA a:Menu_CursorPos
[8a9d]LDA #$02
[8a9f]STA a:TextBox_X
[8aa2]LDA #$06
[8aa4]STA a:TextBox_Y
[8aa7]LDA #$0a
[8aa9]STA a:TextBox_Width
[8aac]LDA #$0e
[8aae]STA a:TextBox_Height
[8ab1]LDA #$18
[8ab3]JSR Sound_PlayEffect
[8ab6]JSR TextBox_Open
[8ab9]LDA #$73
[8abb]STA Temp_Int24
[8abd]LDA #$88
[8abf]STA Temp_Int24_M
[8ac1]LDX #$00
[8ac3]STX a:DataArray
[8ac6]INX
[8ac7]STX a:DataArray_1_
[8aca]INX
[8acb]STX a:DataArray_2_
[8ace]INX
[8acf]STX a:DataArray_3_
[8ad2]INX
[8ad3]STX a:DataArray_4_
[8ad6]INX
[8ad7]STX a:DataArray_5_
[8ada]JSR PlayerMenu_DrawStringLines
[8add]@_inputLoop:; [$8add]
[8add]JSR WaitForNextFrame
[8ae0]JSR Screen_ResetSpritesForGamePlay
[8ae3]JSR Menu_UpdateAndDraw
[8ae6]LDA Joy1_ChangedButtonMask
[8ae8]BMI @_loadMenuIDs
[8aea]ASL A
[8aeb]BPL @_inputLoop
[8aed]JMP TextBox_Close
[8af0]@_loadMenuIDs:; [$8af0]
[8af0]LDX a:Menu_CursorPos
[8af3]CPX #$05
[8af5]BNE PlayerMenu_ShowSubmenu
[8af7]JMP PlayerMenu_ShowStatusMenu
;============================================================================
; TODO: Document PlayerMenu_ShowSubmenu
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
PlayerMenu_Show
;============================================================================
[8afa]PlayerMenu_ShowSubmenu:; [$8afa]
[8afa]LDA #$04
[8afc]STA a:TextBox_X
[8aff]LDA #$08
[8b01]STA a:TextBox_Y
[8b04]LDA #$14
[8b06]STA a:TextBox_Width
[8b09]LDA #$12
[8b0b]STA a:TextBox_Height
[8b0e]JSR TextBox_Open
[8b11]LDX a:Menu_CursorPos
[8b14]STX a:PlayerMenu_SelectedInventory
[8b17]LDA NumberOfWeapons,X
[8b1a]BNE PlayerMenu_ShowInventoryMenu
[8b1c]LDA a:TextBox_X
[8b1f]CLC
[8b20]ADC #$02
[8b22]STA TextBox_ContentsX
[8b24]LDA a:TextBox_Y
[8b27]CLC
[8b28]ADC #$02
[8b2a]STA TextBox_ContentsY
[8b2c]JSR PPU_SetAddrForTextBoxPos
[8b2f]LDA #$43
[8b31]STA Temp_Int24
[8b33]LDA #$8a
[8b35]STA Temp_Int24_M
[8b37]LDA a:Menu_CursorPos
[8b3a]JSR Math_MultiplyBy16
[8b3d]TAY
[8b3e]JSR UI_DrawString
[8b41]@_inputLoop:; [$8b41]
[8b41]JSR WaitForNextFrame
[8b44]JSR Screen_ResetSpritesForGamePlay
[8b47]LDA Joy1_ChangedButtonMask
[8b49]ASL A
[8b4a]BPL @_inputLoop
[8b4c]JMP PlayerMenu_Close
;============================================================================
; TODO: Document PlayerMenu_ShowInventoryMenu
;
; INPUTS:
; A
; X
;
; OUTPUTS:
; TODO
;
; XREFS:
;
PlayerMenu_ShowSubmenu
;============================================================================
[8b4f]PlayerMenu_ShowInventoryMenu:; [$8b4f]
[8b4f]STA a:Arg_StringsCount
[8b52]LDA INVENTORY_CATEGORY_L,X
[8b55]STA Temp_Int24
[8b57]LDA INVENTORY_CATEGORY_U,X
[8b5a]STA Temp_Int24_M
[8b5c]LDY #$00
[8b5e]@_loadMenuIDs:; [$8b5e]
[8b5e]LDA (Temp_Int24),Y
[8b60]STA DataArray,Y
[8b63]INY
[8b64]CPY a:Arg_StringsCount
[8b67]BNE @_loadMenuIDs
[8b69]JSR PlayerMenu_DrawInventoryItems
[8b6c]LDA #$00
[8b6e]STA 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:; [$8b71]
;
; Wait for input on the menu.
;
[8b71]JSR WaitForNextFrame; Wait for the next frame.
[8b74]JSR Screen_ResetSpritesForGamePlay; Set up draw state.
[8b77]JSR Menu_UpdateAndDraw; Update and draw the menu.
[8b7a]LDA Joy1_ChangedButtonMask; Check for a changed button.
[8b7c]BMI @_hasInput; If the the "A" button is pressed, jump to handle input.
[8b7e]ASL A; Shift the button mask left.
[8b7f]BMI PlayerMenu_Close; If the "B" button is pressed, close the menu.
[8b81]BPL PlayerMenu_HandleInventoryMenuInput
[8b83]@_hasInput:; [$8b83]
[8b83]LDA a:Area_CurrentArea; Load the current area.
[8b86]CMP #$04; Is the player inside/in a place where they can't equip?
[8b88]BEQ 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]LDA a:PlayerMenu_SelectedInventory; Load the selected inventory index.
[8b8d]CMP #$03; Is it the Magic or Item inventory?
[8b8f]BCS 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]LDA a:SelectedWeapon; Load the selected weapon.
[8b94]CMP #$03; Is it the Dragon Slayer?
[8b96]BEQ PlayerMenu_HandleInvalidChoice; If not, it's an invalid choice.
[8b98]LDX a:Menu_CursorPos; X = Menu cursor position.
[8b9b]LDA DataArray,X; A = Item ID at the cursor position.
[8b9e]CMP #$03; Is the item ID 3 (Dragon Slayer)?
[8ba0]BNE 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]LDA #$03; 0x03 == Dragon Slayer
[8ba4]JSR Player_LacksItem; Does the player have it?
[8ba7]BCS PlayerMenu_HandleInvalidChoice; If not, it's an invalid choice.
;
; They have the Dragon Slayer. Check for the Battle Suit.
;
[8ba9]LDA #$23; 0x23 == Battle Suit.
[8bab]JSR Player_LacksItem; Does the player have it?
[8bae]BCS PlayerMenu_HandleInvalidChoice; If not, it's an invalid choice.
;
; They have the Dragon Slayer and Battle Suit. Check for the
; Battle Helmet.
;
[8bb0]LDA #$43; 0x43 == Battle Helmet.
[8bb2]JSR Player_LacksItem; Does the player have it?
[8bb5]BCS PlayerMenu_HandleInvalidChoice; If not, it's an invalid choice.
;
; They have all three. Equip them all and close the menu.
;
[8bb7]LDA #$08; 0x08 == Item Pick-Up sound.
[8bb9]JSR Sound_PlayEffect; Play it.
[8bbc]LDA #$03; 0x03 == Dragon Slayer.
[8bbe]JSR Player_Equip; Equip it.
[8bc1]LDA #$23; 0x23 == Battle Suit.
[8bc3]JSR Player_Equip; Equip it.
[8bc6]LDA #$43; 0x43 == Battle Helmet.
[8bc8]JSR Player_Equip; Equip it.
[8bcb]JMP PlayerMenu_Close; Close the Player Menu.
;============================================================================
; TODO: Document PlayerMenu_EquipItem
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
PlayerMenu_HandleInventoryMenuInput
;============================================================================
[8bce]PlayerMenu_EquipItem:; [$8bce]
[8bce]LDA #$08; 0x08 == Item pick-up sound.
[8bd0]JSR Sound_PlayEffect; Play it.
[8bd3]LDX a:Menu_CursorPos; X = Menu cursor position.
[8bd6]LDA a:PlayerMenu_SelectedInventory; A = Selected inventory.
[8bd9]JSR Player_GetInventoryBitForIndex; Get the inventory bits.
[8bdc]ORA DataArray,X; OR it with the selected item index as an item ID.
[8bdf]JSR Player_Equip; Equip the resulting item.
[8be2]JMP PlayerMenu_Close; Close the Player Menu.
;============================================================================
; TODO: Document PlayerMenu_HandleInvalidChoice
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
PlayerMenu_HandleInventoryMenuInput
;============================================================================
[8be5]PlayerMenu_HandleInvalidChoice:; [$8be5]
[8be5]LDA #$0d; 0x0D == Invalid Choice sound effect.
[8be7]JSR Sound_PlayEffect; Play it.
[8bea]JMP PlayerMenu_HandleInventoryMenuInput; Resume handling of the inventory menu.
[8bed]PlayerMenu_Close:; [$8bed]
[8bed]LDA #$02
[8bef]STA a:TextBox_X; Set box X coordinate to 2.
[8bf2]LDA #$06
[8bf4]STA a:TextBox_Y; Set box Y coordinate to 6.
[8bf7]LDA #$16
[8bf9]STA a:TextBox_Width; Set box width to 22.
[8bfc]LDA #$14
[8bfe]STA a:TextBox_Height; Set box height to 20.
[8c01]JMP TextBox_Close; Close the Player Menu.
;============================================================================
; TODO: Document PlayerMenu_DrawInventoryItems
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
PlayerMenu_ShowInventoryMenu
;============================================================================
[8c04]PlayerMenu_DrawInventoryItems:; [$8c04]
[8c04]LDA a:TextBox_Y
[8c07]STA TextBox_ContentsY
[8c09]LDX #$00
[8c0b]@LAB_PRG12__8c0b:; [$8c0b]
[8c0b]TXA
[8c0c]PHA
[8c0d]INC TextBox_ContentsY
[8c0f]LDY a:TextBox_X
[8c12]INY
[8c13]INY
[8c14]STY TextBox_ContentsX
[8c16]LDA a:PlayerMenu_SelectedInventory
[8c19]JSR Player_GetInventoryBitForIndex
[8c1c]ORA DataArray,X
[8c1f]PHA
[8c20]JSR TextBox_DrawItemImage
[8c23]PLA
[8c24]INC TextBox_ContentsY
[8c26]INC TextBox_ContentsX
[8c28]INC TextBox_ContentsX
[8c2a]JSR TextBox_DrawItemName
[8c2d]PLA
[8c2e]TAX
[8c2f]INX
[8c30]CPX a:Arg_StringsCount
[8c33]BNE @LAB_PRG12__8c0b
[8c35]RTS
[8c36]TextBox_DrawItemName:; [$8c36]
[8c36]PHA
[8c37]PHA
[8c38]JSR PPU_SetAddrForTextBoxPos
[8c3b]PLA
[8c3c]JSR Player_GetInventoryIndexForItem
[8c3f]TAX
[8c40]LDA ITEM_NAME_CATEGORIES_L,X
[8c43]STA Temp_Int24
[8c45]LDA ITEM_NAME_CATEGORIES_U,X
[8c48]STA Temp_Int24_M
[8c4a]PLA
[8c4b]AND #$1f
[8c4d]JSR Math_MultiplyBy16
[8c50]BCC @LAB_PRG12__8c54
[8c52]INC Temp_Int24_M
[8c54]@LAB_PRG12__8c54:; [$8c54]
[8c54]TAY
[8c55]JMP UI_DrawString
[8c58]TextBox_DrawItemImage:; [$8c58]
;
; Save the registers temporarily.
;
[8c58]STA Temp_Int24; Store the item ID temporarily.
[8c5a]TYA; A = Y
[8c5b]PHA; Push to the stack.
[8c5c]TXA; A = X
[8c5d]PHA; 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]LDA #$00; A = 0
[8c60]STA PPU_TargetAddr; Set as the lower byte.
[8c62]TXA; A = X (item index)
[8c63]PHA; Push to the stack, twice.
[8c64]PHA
[8c65]LSR A; C = bit0(index)
[8c66]ROR PPU_TargetAddr; If C == 0, then set to 0.
Else, set to 0x80.
[8c68]LSR A; A = itemID >> 2
C = bit1(index)
[8c69]ROR PPU_TargetAddr; Set to (bit1(index) << 7) | (bit0(index) << 6.
== (index & 3) * 64.
[8c6b]ADC #$14; A = 0x14 + C.
[8c6d]STA 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]LDA Temp_Int24; Load the item ID.
[8c71]JSR TextBox_LoadItemSourceTiles; Load the source tiles address in the PPU.
;
; Position the image where the text would normally go.
;
[8c74]JSR 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]LDA #$02; A = 2 (tiles)
[8c79]JSR PPUBuffer_QueueCommandOrLength; Write the length to the PPU buffer.
[8c7c]PLA; Pull the index from the stack.
[8c7d]ASL A; Multiply by 16.
[8c7e]ASL A
[8c7f]ADC #$40; Add 64 + C.
[8c81]JSR PPUBuffer_Set; Add to the PPU buffer.
[8c84]CLC
[8c85]ADC #$01; Add 1.
[8c87]JSR PPUBuffer_Set; Add to the PPU buffer.
;
; Advane to the target address to the next position (bottom
; 2 tiles of the image).
;
[8c8a]STX PPUBuffer_WriteOffset; Store the new PPU buffer write offset.
[8c8c]JSR 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]LDA #$02; A = 2 (tiles)
[8c91]JSR PPUBuffer_QueueCommandOrLength; Write the length to the PPU buffer.
[8c94]PLA; Pull the index from the stack.
[8c95]ASL A; Multiply by 16.
[8c96]ASL A
[8c97]ADC #$42; Add 66 + C.
[8c99]JSR PPUBuffer_Set; Add left tile index the PPU buffer.
[8c9c]CLC
[8c9d]ADC #$01; Add 1.
[8c9f]JSR PPUBuffer_Set; Add right tile to the PPU buffer.
[8ca2]STX PPUBuffer_WriteOffset; Store the new PPU buffer write offset.
;
; Restore the registers saved at the top of the function.
;
[8ca4]PLA; Pop the X register value.
[8ca5]TAX; Set it back on X.
[8ca6]PLA; Pop the Y register value.
[8ca7]TAY; Set it back on Y.
[8ca8]RTS; And return.
[8ca9]Player_Equip:; [$8ca9]
;
; Calculate the target inventory and store the old and
; new items temporary.
;
[8ca9]STA a:Temp_EquipingItem; Store the item that we're equipping.
[8cac]JSR Player_GetInventoryIndexForItem; Compute the inventory index of the item.
[8caf]TAX; Set X = the inventory index we computed
[8cb0]LDA SelectedWeapon,X; Get the current item in the target inventory.
[8cb3]STA a:Temp_PrevInventoryItem; Store the old item we're unequipping.
;
; Unequip the old item.
;
[8cb6]LDA a:Temp_EquipingItem
[8cb9]JSR Player_RemoveItem; Unequip the old item.
[8cbc]LDA a:Temp_PrevInventoryItem; Load back the previous item.
;
; Only add to the inventory if we didn't already have one.
;
[8cbf]BMI @_inInventory; Branch if we don't need to add to the inventory.
[8cc1]LDA a:Temp_EquipingItem; Load the item we're equipping.
[8cc4]AND #$e0; Clear out all but the inventory bits.
[8cc6]ORA a:Temp_PrevInventoryItem; Add the item's value.
[8cc9]JSR Player_AddToInventory; Now add to the inventory.
[8ccc]@_inInventory:; [$8ccc]
[8ccc]LDA a:Temp_EquipingItem
;
; Set the normalized value within the inventory.
;
[8ccf]JSR Player_GetInventoryIndexForItem; Calculate the inventory slot again.
[8cd2]TAY; Set Y = inventory slot
[8cd3]LDA a:Temp_EquipingItem; Set A = new item
[8cd6]AND #$1f; Clear out the inventory bits, yielding the item value.
[8cd8]DEY
[8cd9]BEQ @_isArmor; Check if it's armor.
[8cdb]DEY
[8cdc]BEQ @_isShield; Check if it's a shield.
[8cde]DEY
[8cdf]BEQ @_isMagic; Check if it's magic.
[8ce1]DEY
[8ce2]BEQ @_isItem; Check if it's an item.
;
; Inventory 0 (weapons)
;
[8ce4]JMP Player_SetWeapon; Set the current weapon.
;
; Inventory 1 (armor)
;
[8ce7]@_isArmor:; [$8ce7]
[8ce7]JMP Player_SetArmor; Set the current armor.
;
; Inventory 2 (shield)
;
[8cea]@_isShield:; [$8cea]
[8cea]JMP Player_SetShield; Set the current shield.
;
; Inventory 3 (magic)
;
[8ced]@_isMagic:; [$8ced]
[8ced]JMP Player_SetMagic; Set the current magic.
;
; Inventory 4 (normal items)
;
[8cf0]@_isItem:; [$8cf0]
[8cf0]JMP 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]
[8cf3]STA a:SelectedMagic; Store the provided A value as the selected magic.
[8cf6]RTS
;============================================================================
; 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:; [$8cf7]
;
; 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]LDX #$00; X will be our lookup table index.
[8cf9]CMP #$80; Check Ring of Elf.
[8cfb]BEQ @_specialItemMatched
[8cfd]INX; X++
[8cfe]CMP #$81; Check Ring of Ruby.
[8d00]BEQ @_specialItemMatched
[8d02]INX; X++
[8d03]CMP #$82; Check Ring of Dworf.
[8d05]BEQ @_specialItemMatched
[8d07]INX; X++
[8d08]CMP #$83; Check Demon's Ring.
[8d0a]BEQ @_specialItemMatched
[8d0c]INX; X++
[8d0d]CMP #$92; Check Elixir.
[8d0f]BEQ @_specialItemMatched
[8d11]INX; X++
[8d12]CMP #$8a; Check Magical Rod.
[8d14]BEQ @_specialItemMatched
[8d16]INX; X++
[8d17]CMP #$93; Check Pendant.
[8d19]BEQ @_specialItemMatched
[8d1b]INX; X++
[8d1c]CMP #$94; Check Black Onyx.
[8d1e]BEQ @_specialItemMatched
[8d20]PHA; Push the item value on the stack.
[8d21]JSR Player_GetInventoryIndexForItem; Get the inventory for the item.
[8d24]TAY; Set Y = inventory.
[8d25]LDA INVENTORY_CATEGORY_L,Y
[8d28]STA Temp_Int24
[8d2a]LDA INVENTORY_CATEGORY_U,Y
[8d2d]STA Temp_Int24_M
;
; Check if this item is currently equipped.
;
; If so, we'll be returning false (we don't lack it).
;
[8d2f]PLA; Pull the item into A
[8d30]AND #$1f; Clear out the inventory bits, leaving the item value.
[8d32]CMP SelectedWeapon,Y; Get the inventory index from Y.
[8d35]BEQ @_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]LDX NumberOfWeapons,Y; Set X = inventory item count.
[8d3a]BEQ @_returnTrue; If 0, we lack the item.
;
; Loop through all items in the inventory to see if
; we have this item.
;
[8d3c]LDY #$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]
[8d3e]CMP (Temp_Int24),Y; Check the inventory address at this index.
[8d40]BEQ @_returnFalse; If it's a match, we don't lack the item. Return false.
[8d42]INY; Y++.
[8d43]DEX; Reduce the number of items left to check.
[8d44]BNE @_checkInventoryLoop; Next loop.
;
; The item could not be found. The player lacks the item.
;
[8d46]@_returnTrue:; [$8d46]
[8d46]SEC; Set for a true result.
[8d47]RTS
[8d48]@_specialItemMatched:; [$8d48]
[8d48]LDA a:SpecialItems; Load the player's Special Items bitmask.
[8d4b]AND SPECIAL_ITEMS_BITMASKS,X; Clear the bit for the matched item.
[8d4e]BEQ @_returnTrue
[8d50]@_returnFalse:; [$8d50]
[8d50]CLC; Clear for a false result.
[8d51]RTS
;============================================================================
; A mapping of item IDs to Special Items bitmasks.
;
; XREFS:
;
Player_LacksItem
;============================================================================
[8d52]SPECIAL_ITEMS_BITMASKS:; [$8d52]
[8d52].byte $80; [0]: Ring of Elf
[8d53]SPECIAL_ITEMS_BITMASKS_1_:; [$8d53]
[8d53].byte $40; [1]: Ring of Ruby
[8d54]SPECIAL_ITEMS_BITMASKS_2_:; [$8d54]
[8d54].byte $20; [2]: Ring of Dworf
[8d55]SPECIAL_ITEMS_BITMASKS_3_:; [$8d55]
[8d55].byte $10; [3]: Demon's Ring
[8d56]SPECIAL_ITEMS_BITMASKS_4_:; [$8d56]
[8d56].byte $08; [4]: Elixir
[8d57]SPECIAL_ITEMS_BITMASKS_5_:; [$8d57]
[8d57].byte $04; [5]: Magical Rod
[8d58]SPECIAL_ITEMS_BITMASKS_6_:; [$8d58]
[8d58].byte $02; [6]: Pendant
[8d59]SPECIAL_ITEMS_BITMASKS_7_:; [$8d59]
[8d59].byte $01; [7]: Black Onyx
[8d5a]PlayerMenu_ShowStatusMenu:; [$8d5a]
;
; Position and open the textbox for the player status.
;
[8d5a]LDA #$04
[8d5c]STA a:TextBox_X; Set textbox X coordinate to 4.
[8d5f]LDA #$08
[8d61]STA a:TextBox_Y; Set textbox Y coordinate to 8.
[8d64]LDA #$1a
[8d66]STA a:TextBox_Width; Set textbox width to 26.
[8d69]LDA #$10
[8d6b]STA a:TextBox_Height; Set textbox height to 16.
[8d6e]JSR TextBox_Open; Open the textbox.
[8d71]LDA #$07
[8d73]STA a:Arg_StringsCount; Prepare to draw 7 rows of strings.
[8d76]LDA #$d3; 0xD3 = lower byte of text strings.
[8d78]STA Temp_Int24; Store it.
[8d7a]LDA #$88; 0x88 = upper byte of text strings.
[8d7c]STA Temp_Int24_M; Store it.
[8d7e]LDX #$00; X = 0 (index counter).
[8d80]STX a:DataArray; Draw string 1 ("RANK:").
[8d83]INX
[8d84]STX a:DataArray_1_; Draw string 2 ("NEXT EXP:").
[8d87]INX
[8d88]STX a:DataArray_2_; Draw string 3 ("WEAPON:").
[8d8b]INX
[8d8c]STX a:DataArray_3_; Draw string 4 ("ARMOR:").
[8d8f]INX
[8d90]STX a:DataArray_4_; Draw string 5 ("SHIELD:").
[8d93]INX
[8d94]STX a:DataArray_5_; Draw string 6 ("MAGIC:").
[8d97]INX
[8d98]STX a:DataArray_6_; Draw string 7 ("ITEM:").
[8d9b]JSR PlayerMenu_DrawStringLines; Draw the strings in the textbox.
[8d9e]LDA a:TextBox_X; Get the textbox X coordinate.
[8da1]CLC
[8da2]ADC #$0b; Add 11.
[8da4]STA TextBox_ContentsX; Set as the draw X coordinate.
[8da6]LDA a:TextBox_Y; Get the textbox Y coordinate.
[8da9]CLC
[8daa]ADC #$02; Add 2.
[8dac]STA TextBox_ContentsY; Set as the draw Y coordinate.
[8dae]JSR PPU_SetAddrForTextBoxPos; Set this as the PPU draw position.
[8db1]LDA a:PlayerTitle; Load the player title.
[8db4]JSR Math_MultiplyBy16; Multiply by 16 to get an index into the strings.
[8db7]TAY; Y = A (result)
[8db8]LDA #$43; 0x43 == lower byte of Player Title strings.
[8dba]STA Temp_Int24; Store it.
[8dbc]LDA #$89; 0x89 == upper byte of Player Title strings.
[8dbe]STA Temp_Int24_M; Store it.
[8dc0]JSR UI_DrawString; Draw the string.
;
; Prepare to draw the player's experience.
;
[8dc3]INC TextBox_ContentsY; Go down to 2 rows.
[8dc5]INC TextBox_ContentsY
[8dc7]LDA a:NextPlayerTitle; Load the next possible title.
[8dca]CMP #$0f; Is it >= 15 (the last available title))?
[8dcc]BCS @_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]ASL A; Convert the title index to a word boundary.
[8dcf]TAX; X = A (result).
[8dd0]LDA $f749,X; Load the lower byte of the amount of experience needed for the next level.
[8dd3]STA Temp_Int24; Store it.
[8dd5]LDA $f74a,X; Load the middle byte.
[8dd8]STA Temp_Int24_M; Store it.
[8dda]LDA #$00; Upper byte is always 0.
[8ddc]STA Temp_Int24_U; Store it.
[8dde]LDY #$05; 5 = Maximum number of digits.
[8de0]JSR 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]
[8de3]LDX #$00; X = 0 (loop counter).
[8de5]@_drawSelectedItemsLoop:; [$8de5]
[8de5]TXA; A = X (loop counter)
[8de6]PHA; Push it to the stack.
[8de7]INC TextBox_ContentsY; Increment the draw Y coordinate by 2.
[8de9]INC TextBox_ContentsY
[8deb]LDA SelectedWeapon,X; Load the selected item for this type.
[8dee]BMI @_nextInventory; If unset, advance to the next.
;
; There's a selected item of this type. Load the information.
;
[8df0]LDA a:TextBox_X; Load the textbox X coordinate.
[8df3]CLC
[8df4]ADC #$09; Add 9 (image X coordinate).
[8df6]STA TextBox_ContentsX; Store as the draw X coordinate.
[8df8]TXA; A = X (loop counter).
[8df9]JSR Player_GetInventoryBitForIndex; Get the inventory bit for this index.
[8dfc]ORA SelectedWeapon,X; OR with the item value, yielding an inventory-backed item ID.
[8dff]PHA; Push it to the stack.
;
; Position the image and draw it.
;
[8e00]DEC TextBox_ContentsY; Go up a row for the start of the image.
[8e02]JSR TextBox_DrawItemImage; Draw the image there.
;
; Position the item name text and draw it.
;
[8e05]INC TextBox_ContentsY; Go down 1 rows.
[8e07]INC TextBox_ContentsX; Go right 2 rows for the text.
[8e09]INC TextBox_ContentsX
[8e0b]PLA; Pop the item ID.
[8e0c]JSR TextBox_DrawItemName; Draw the name of the item.
[8e0f]@_nextInventory:; [$8e0f]
[8e0f]PLA; Pop the X coordinate.
[8e10]TAX; Set it back on X.
[8e11]INX; X++
[8e12]CPX #$04; Is it 4 (last inventory type)?
[8e14]BNE @_drawSelectedItemsLoop; If not, loop.
;
; Prepare to draw the special items (up to 8 in total).
;
[8e16]LDA a:TextBox_X; Load the textbox's X location.
[8e19]CLC
[8e1a]ADC #$09; Add 9 (image X coordinate).
[8e1c]STA TextBox_ContentsX; Store it as the draw X coordinate.
[8e1e]INC TextBox_ContentsY; Increment the draw Y coordinate.
[8e20]LDX #$00; X = 0 (loop counter)
[8e22]LDA a:SpecialItems; A = Special items bitmask
;
; Draw in a loop.
;
[8e25]@_drawSpecialItemLoop:; [$8e25]
[8e25]ASL A; Shift the left-most bit into C.
[8e26]BCC @_nextSpecialItem; If not set, skip to the next item.
[8e28]PHA; Push the remaining bits to the stack.
[8e29]TXA; A = X (loop counter).
[8e2a]PHA; Push the loop counter to the stack.
[8e2b]LDA SPECIAL_ITEM_TILE_START_IDS,X; Load the tile start ID for this item.
[8e2e]INX; X += 4 (number of item image tiles).
[8e2f]INX
[8e30]INX
[8e31]INX
[8e32]JSR TextBox_DrawItemImage; Draw the image.
[8e35]PLA; Pop the loop counter.
[8e36]TAX; X = A (restore it)
[8e37]PLA; Pop the remaining bits.
[8e38]@_nextSpecialItem:; [$8e38]
[8e38]INC TextBox_ContentsX; Advance the X position by 2 tiles.
[8e3a]INC TextBox_ContentsX
[8e3c]INX; X++ (loop counter)
[8e3d]CPX #$08; Is it 8?
[8e3f]BNE @_drawSpecialItemLoop; If not, loop.
;
; Draw the menu, freezing gameplay until dismissed.
;
[8e41]@_waitForInputLoop:; [$8e41]
[8e41]JSR WaitForNextFrame; Wait for the next frame.
[8e44]JSR Screen_ResetSpritesForGamePlay; Draw with screen state paused.
[8e47]LDA Joy1_ChangedButtonMask; Load the changed button mask.
[8e49]ASL A; Shift the "A" button state into N.
[8e4a]BPL @_waitForInputLoop; If not pressed/set, loop.
;
; Close the Status textbox.
;
[8e4c]LDA #$02
[8e4e]STA a:TextBox_X; Set the textbox X to 2.
[8e51]LDA #$06
[8e53]STA a:TextBox_Y; Set the textbox Y to 6.
[8e56]LDA #$1c
[8e58]STA a:TextBox_Width; Set the textbox width to 28.
[8e5b]LDA #$12
[8e5d]STA a:TextBox_Height; Set the textbox height to 18.
[8e60]JMP TextBox_Close; Close the textbox at those dimensions.
;============================================================================
; Start locations within loaded drawn item tiles in the PPU.
;
; XREFS:
;
PlayerMenu_ShowStatusMenu
;============================================================================
[8e63]SPECIAL_ITEM_TILE_START_IDS:; [$8e63]
[8e63].byte $80; [0]:
[8e64].byte $81; [1]:
[8e65].byte $82; [2]:
[8e66].byte $83; [3]:
[8e67].byte $92; [4]:
[8e68].byte $8a; [5]:
[8e69].byte $93; [6]:
[8e6a].byte $94; [7]:
;============================================================================
; TODO: Document PlayerMenu_DrawStringLines
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
PlayerMenu_Show
;
PlayerMenu_ShowStatusMenu
;============================================================================
[8e6b]PlayerMenu_DrawStringLines:; [$8e6b]
[8e6b]LDA a:TextBox_X
[8e6e]CLC
[8e6f]ADC #$02
[8e71]STA TextBox_ContentsX
[8e73]LDA a:TextBox_Y
[8e76]CLC
[8e77]ADC #$02
[8e79]STA TextBox_ContentsY
[8e7b]JSR PPU_SetAddrForTextBoxPos
[8e7e]LDX #$00
[8e80]@_drawLinesLoop:; [$8e80]
[8e80]TXA
[8e81]PHA
[8e82]LDA DataArray,X
[8e85]ASL A
[8e86]ASL A
[8e87]ASL A
[8e88]ASL A
[8e89]TAY
[8e8a]JSR UI_DrawString
[8e8d]LDA #$40
[8e8f]JSR PPU_IncrementAddrBy
[8e92]PLA
[8e93]TAX
[8e94]INX
[8e95]CPX a:Arg_StringsCount
[8e98]BNE @_drawLinesLoop
[8e9a]RTS
[8e9b]UI_DrawString:; [$8e9b]
;
; Load the length of the string and prepare to draw.
;
[8e9b]LDA (Temp_Int24),Y; Load the length value from the loaded string.
[8e9d]STA Temp_Int24_U; Store it.
[8e9f]INY; Y++ (character offset)
[8ea0]JSR PPUBuffer_QueueCommandOrLength; Queue drawing up to the length.
;
; Begin drawing each character.
;
[8ea3]@_drawLoop:; [$8ea3]
[8ea3]LDA (Temp_Int24),Y; Load the next character.
[8ea5]JSR Strings_ASCIIToIndex; Conver the ASCII value to a tile index.
[8ea8]INY; Y++ (character offset)
[8ea9]JSR PPUBuffer_Set; Set that in the PPU buffer.
[8eac]DEC Temp_Int24_U; Decrement loop counter.
[8eae]BNE @_drawLoop; If we're not done, loop.
[8eb0]STX PPUBuffer_WriteOffset; Store the new PPU buffer upper bounds.
[8eb2]RTS
;============================================================================
; 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]
[8eb3]CMP #$20; Is this a space?
[8eb5]BEQ @_isSpace; If so, jump.
[8eb7]CMP #$41; Is this >= "A"?
[8eb9]BCC @_return; If not, return.
[8ebb]SBC #$31; Convert to an index.
[8ebd]RTS
[8ebe]@_isSpace:; [$8ebe]
[8ebe]LDA #$00; Convert a space to an index of 0.
[8ec0]@_return:; [$8ec0]
[8ec0]RTS
;============================================================================
; TODO: Document IScriptAction_AddInventoryItem_ClearTextBox
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
IScriptAction_AddInventoryItem
;============================================================================
[8ec1]IScriptAction_AddInventoryItem_ClearTextBox:; [$8ec1]
[8ec1]LDX a:TextBox_X
[8ec4]INX
[8ec5]STX TextBox_ContentsX
[8ec7]LDX a:TextBox_Y
[8eca]INX
[8ecb]STX TextBox_ContentsY
[8ecd]JSR PPU_SetAddrForTextBoxPos
[8ed0]LDX a:TextBox_Height
[8ed3]@_clearLoop:; [$8ed3]
[8ed3]TXA
[8ed4]PHA
[8ed5]LDA a:TextBox_Width
[8ed8]TAY
[8ed9]SEC
[8eda]SBC #$02
[8edc]JSR PPUBuffer_QueueCommandOrLength
[8edf]LDA #$00
[8ee1]JSR TextBox_FillPPUBufferForTextWidth
[8ee4]STX PPUBuffer_WriteOffset
[8ee6]JSR PPU_IncrementAddrBy32
[8ee9]PLA
[8eea]TAX
[8eeb]DEX
[8eec]CPX #$02
[8eee]BNE @_clearLoop
[8ef0]RTS
[8ef1]TextBox_Open:; [$8ef1]
;
; Draw the top row of the box's frame.
;
[8ef1]LDA a:TextBox_X
[8ef4]STA TextBox_ContentsX
[8ef6]LDA a:TextBox_Y
[8ef9]STA TextBox_ContentsY
[8efb]JSR PPU_SetAddrForTextBoxPos
[8efe]JSR TextBox_QueuePPUBufferTextBoxLength
[8f01]LDA #$01
[8f03]JSR PPUBuffer_Set
[8f06]LDA #$02
[8f08]JSR TextBox_FillPPUBufferForTextWidth
[8f0b]LDA #$03
[8f0d]JSR PPUBuffer_Set
[8f10]STX PPUBuffer_WriteOffset
[8f12]JSR PPU_IncrementAddrBy32
;
; Draw the sides of the box's frame.
;
[8f15]LDY a:TextBox_Height
[8f18]@_drawFrameSides:; [$8f18]
[8f18]TYA
[8f19]PHA
[8f1a]JSR TextBox_QueuePPUBufferTextBoxLength
[8f1d]LDA #$04
[8f1f]JSR PPUBuffer_Set
[8f22]LDA #$00
[8f24]JSR TextBox_FillPPUBufferForTextWidth
[8f27]LDA #$04
[8f29]JSR PPUBuffer_Set
[8f2c]STX PPUBuffer_WriteOffset
[8f2e]JSR PPU_IncrementAddrBy32
[8f31]PLA
[8f32]TAY
[8f33]DEY
[8f34]CPY #$02
[8f36]BNE @_drawFrameSides
;
; Draw the bottom of the box's frame.
;
[8f38]JSR TextBox_QueuePPUBufferTextBoxLength
[8f3b]LDA #$05
[8f3d]JSR PPUBuffer_Set
[8f40]LDA #$02
[8f42]JSR TextBox_FillPPUBufferForTextWidth
[8f45]LDA #$06
[8f47]JSR PPUBuffer_Set
[8f4a]STX PPUBuffer_WriteOffset
[8f4c]LDA #$00
;
; Set state on the box and fill in the background.
;
[8f4e]STA a:TextBox_Closed
;
; v-- Fall through --v
;
;============================================================================
; TODO: Document TextBox_FillBackground
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
TextBox_Close
;============================================================================
[8f51]TextBox_FillBackground:; [$8f51]
[8f51]LDA a:TextBox_X
[8f54]LSR A
[8f55]STA TextBox_ContentsX
[8f57]LDA a:TextBox_Y
[8f5a]LSR A
[8f5b]STA TextBox_ContentsY
[8f5d]LDY a:TextBox_Height
[8f60]@_fillYLoop:; [$8f60]
[8f60]TYA
[8f61]PHA
[8f62]LDA TextBox_ContentsX
[8f64]PHA
[8f65]LDY a:TextBox_Width
[8f68]@_fillXLoop:; [$8f68]
[8f68]JSR TextBox_GetBackgroundAttributeData
[8f6b]JSR TextBox_SetNextAttributeData
[8f6e]INC TextBox_ContentsX
[8f70]DEY
[8f71]DEY
[8f72]BNE @_fillXLoop
[8f74]PLA
[8f75]STA TextBox_ContentsX
[8f77]INC TextBox_ContentsY
[8f79]PLA
[8f7a]TAY
[8f7b]DEY
[8f7c]DEY
[8f7d]BNE @_fillYLoop
[8f7f]LDA a:TextBox_X
[8f82]LSR A
[8f83]STA TextBox_ContentsX
[8f85]LDA a:TextBox_Y
[8f88]LSR A
[8f89]STA TextBox_ContentsY
[8f8b]JSR TextBox_GetNextAttributeDataOffset
[8f8e]TAY
[8f8f]AND #$3f
[8f91]ORA #$c0
[8f93]STA PPU_TargetAddr
[8f95]LDA PPU_ScrollScreen
[8f97]AND #$01
[8f99]ASL A
[8f9a]ASL A
[8f9b]ORA #$23
[8f9d]STA PPU_TargetAddr_U
[8f9f]LDA a:TextBox_X
[8fa2]LSR A
[8fa3]LSR A
[8fa4]STA TextBox_ContentsX
[8fa6]LDA a:TextBox_X
[8fa9]CLC
[8faa]ADC a:TextBox_Width
[8fad]SEC
[8fae]SBC #$01
[8fb0]LSR A
[8fb1]LSR A
[8fb2]SEC
[8fb3]SBC TextBox_ContentsX
[8fb5]STA TextBox_ContentsX
[8fb7]INC TextBox_ContentsX
[8fb9]LDA a:TextBox_Y
[8fbc]LSR A
[8fbd]LSR A
[8fbe]STA TextBox_ContentsY
[8fc0]LDA a:TextBox_Y
[8fc3]CLC
[8fc4]ADC a:TextBox_Height
[8fc7]SEC
[8fc8]SBC #$01
[8fca]LSR A
[8fcb]LSR A
[8fcc]SEC
[8fcd]SBC TextBox_ContentsY
[8fcf]STA TextBox_ContentsY
[8fd1]INC TextBox_ContentsY
;
; Loop through all the rows of text.
;
[8fd3]@_drawRowsLoop:; [$8fd3]
[8fd3]TYA
[8fd4]PHA
[8fd5]LDA TextBox_ContentsX
[8fd7]STA Temp_Int24
[8fd9]JSR PPUBuffer_QueueCommandOrLength
;
; Loop through all the columns of text.
;
[8fdc]@_drawColsLoop:; [$8fdc]
[8fdc]LDA TextBox_AttributeData,Y
[8fdf]INY
[8fe0]JSR PPUBuffer_Set
[8fe3]DEC Temp_Int24
[8fe5]BNE @_drawColsLoop
[8fe7]STX PPUBuffer_WriteOffset
[8fe9]JSR PPU_IncrementAddrBy8
[8fec]PLA
[8fed]CLC
[8fee]ADC #$08
[8ff0]TAY
[8ff1]DEC TextBox_ContentsY
[8ff3]BNE @_drawRowsLoop
[8ff5]RTS
;============================================================================
; 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]
[8ff6]LDA a:TextBox_Closed; Is the textbox open or closed?
[8ff9]BEQ @_isOpen; If open, jump.
;
; The textbox is closed. Return the attribute of the background
; area behind it.
;
[8ffb]JMP TextBox_GetBackingAttributeData; Return the attribute data behind the textbox.
;
; The textbox is open. Return the attribute for the textbox
; background color.
;
[8ffe]@_isOpen:; [$8ffe]
[8ffe]LDA a:UI_AttributeDataIndex; Return the attribute data for the background of the textbox.
[9001]RTS
[9002]TextBox_Close:; [$9002]
[9002]LDA #$01
[9004]STA a:TextBox_Closed
[9007]JSR TextBox_FillBackground
[900a]LDA a:TextBox_X
[900d]STA TextBox_ContentsX
[900f]LDA a:TextBox_Y
[9012]STA TextBox_ContentsY
[9014]JSR PPU_SetAddrForTextBoxPos
[9017]LDY a:TextBox_Height
[901a]@_closeYLoop:; [$901a]
[901a]TYA
[901b]PHA
[901c]LDA TextBox_ContentsX
[901e]PHA
[901f]LDA a:TextBox_Width
[9022]TAY
[9023]JSR PPUBuffer_QueueCommandOrLength
[9026]@_closeXLoop:; [$9026]
[9026]JSR Textbox_Maybe_GetAreaBehindTextbox
[9029]JSR PPUBuffer_Set
[902c]INC TextBox_ContentsX
[902e]DEY
[902f]BNE @_closeXLoop
[9031]STX PPUBuffer_WriteOffset
[9033]PLA
[9034]STA TextBox_ContentsX
[9036]PLA
[9037]TAY
[9038]INC TextBox_ContentsY
[903a]JSR PPU_IncrementAddrBy32
[903d]DEY
[903e]BNE @_closeYLoop
[9040]RTS
;============================================================================
; DEADCODE
;============================================================================
[9041]DEADCODE_FUN_PRG12__9041:; [$9041]
[9041]LDA #$05
[9043]STA TextBox_ContentsX
[9045]JSR PPUBuffer_QueueCommandOrLength
[9048]@LAB_PRG12__9048:; [$9048]
[9048]LDA TextBox_AttributeData,Y
[904b]INY
[904c]JSR PPUBuffer_Set
[904f]DEC TextBox_ContentsX
[9051]BNE @LAB_PRG12__9048
[9053]STX PPUBuffer_WriteOffset
[9055]RTS
[9056]Menu_UpdateAndDraw:; [$9056]
[9056]LDA Joy1_ChangedButtonMask; A = changed button mask.
[9058]AND #$08; Is Up pressed?
[905a]BNE @_handleCursorUp; If so, jump.
;
; Up was not pressed. Check Down.
;
[905c]LDA Joy1_ChangedButtonMask; A = changed button mask.
[905e]AND #$04; Is Down pressed?
[9060]BEQ @_showSelectionCursor; If so, jump.
;
; Neither Up nor Down was pressed.
;
[9062]LDX a:Menu_CursorPos; X = Menu cursor position.
[9065]INX; X++
[9066]CPX a:Arg_StringsCount; Compare to the last available position.
[9069]BNE @_moveCursor; If it changed, jump.
[906b]LDX #$00; Move to the first item.
[906d]@_moveCursor:; [$906d]
[906d]STX a:Menu_CursorPos; Set the new cursor position.
[9070]LDA #$0b; 0xB = Cursor movement sound effect.
[9072]JSR 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]
[9075]JSR TextBox_GetXPixelCoord; Get the X pixel position of the textbox.
[9078]ADC #$08; Add 8 (offset).
[907a]TAX; X = result.
;
; Compute the Y position of the cursor.
;
; This will be:
;
; TextBox_Y_Pixels + (16 * CursorPos) - 32.
;
[907b]JSR TextBox_GetYPixelCoord; Get the Y pixel position of the textbox.
[907e]ADC #$10; Add 16.
[9080]STA Temp_Int24; Store it temporarily.
[9082]LDA a:Menu_CursorPos; A = cursor position.
[9085]JSR Math_MultiplyBy16; A = A * 16 (2 tile height)
[9088]ADC Temp_Int24; A = A + our Y value.
[908a]SBC #$20; A = A - 32 (padding and nudging up a tile).
[908c]TAY; Y = result.
;
; Draw the selection symbol.
;
[908d]LDA #$ad; A = 0xAD (right arrow symbol).
[908f]JMP UI_DrawPromptInputSymbol; Draw the symbol.
;
; The player pressed the Up button on the controller.
; Move the cursor up.
;
[9092]@_handleCursorUp:; [$9092]
[9092]LDX 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]
[9095]DEX; X--
[9096]BPL @_moveCursor; If < 0, jump.
[9098]LDX a:Arg_StringsCount; X = Last available position.
[909b]BPL @_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]
[909d]JSR PPU_WaitUntilFlushed
[90a0]LDA #$10
[90a2]STA a:PPUADDR
[90a5]LDA #$00
[90a7]STA a:PPUADDR
[90aa]LDY #$10
[90ac]JSR PPU_FillData
[90af]JSR PPU_LoadGlyphsForStrings
[90b2]LDY #$1f
[90b4]@LAB_PRG12__90b4:; [$90b4]
[90b4]LDA PASSWORD_SCREEN_PALETTE,Y
[90b7]STA Screen_PaletteData_Tiles,Y
[90ba]DEY
[90bb]BPL @LAB_PRG12__90b4
[90bd]JSR PPUBuffer_WritePalette
[90c0]JSR 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]LDA #$21
[90c5]STA a:PPUADDR
[90c8]LDA #$28
[90ca]STA a:PPUADDR
[90cd]LDA #$5f
[90cf]LDY #$10
[90d1]JSR PPU_FillData
;
; Now do the same for the second row of the password input at
; $2148.
;
[90d4]LDA #$21
[90d6]STA a:PPUADDR
[90d9]LDA #$48
[90db]STA a:PPUADDR
[90de]LDA #$5f
[90e0]LDY #$10
[90e2]JSR PPU_FillData
;
; Begin drawing all the available password characters.
;
[90e5]LDY #$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]
[90e7]LDA INPUT_CHARS,Y
[90ea]STA a:PPUADDR
[90ed]INY
[90ee]LDA INPUT_CHARS,Y
[90f1]STA a:PPUADDR
[90f4]INY
;
; Every row has 25 characters (this includes spaces between
; visible characters). Loop through each character draw it
; on the current row.
;
[90f5]LDX #$19
[90f7]@_writePasswordCharsLoop:; [$90f7]
[90f7]LDA INPUT_CHARS,Y
[90fa]STA a:PPUDATA
[90fd]INY
[90fe]DEX
[90ff]BNE @_writePasswordCharsLoop
[9101]CPY #$a2
[9103]BNE @_startRow
;
; Begin writing the top row: "Enter your mantra."
; This starts at PPU position $20A5.
;
; The string is at
STRING_ENTER_YOUR_MANTRA.
;
[9105]LDA #$20
[9107]STA a:PPUADDR
[910a]LDA #$a5
[910c]STA a:PPUADDR
[910f]LDA #$ec
[9111]STA Temp_Int24
[9113]LDA #$91
[9115]STA Temp_Int24_M
[9117]JSR UI_DrawText
;
; Set the initial password to 32 characters of empty (0xFF).
;
; This is in Password_EnteredChars.
;
[911a]LDA #$20
[911c]STA a:Password_MaxChars
[911f]TAX
[9120]DEX
[9121]LDA #$ff
[9123]@LAB_PRG12__9123:; [$9123]
[9123]STA ScreenBuffer,X
[9126]DEX
[9127]BPL @LAB_PRG12__9123
[9129]LDA #$00
[912b]STA a:Password_EnteredCharsLength
[912e]STA a:Password_FieldCursorPos
[9131]STA a:Password_CursorCol
[9134]STA a:Password_CursorRow
[9137]STA a:Password_DPadBits
[913a]STA a:Password_CounterBeforeAutoRepeatMove
;
; Handle password input.
;
[913d]JSR Screen_ResetForNonGame
;
; v-- Fall through --v
;
[9140]PasswordScreen_WaitForInput:; [$9140]
[9140]JSR WaitForNextFrame
[9143]JSR Screen_ResetSpritesForNonGame
[9146]JSR PasswordScreen_DrawAndHandleInputLoop
[9149]BCC PasswordScreen_WaitForInput
[914b]CMP #$83
[914d]BNE PasswordScreen_HandleInput
;
; This is the END code.
;
[914f]LDA a:Password_EnteredCharsLength
[9152]BEQ PasswordScreen_9175
[9154]JSR Password_Maybe_CheckPasswordLength
[9157]BCS PasswordScreen_HandleWrongPasswordAndWaitForInput
[9159]JSR Password_Load
[915c]BCS PasswordScreen_HandleWrongPasswordAndWaitForInput
[915e]RTS
;============================================================================
; TODO: Document PasswordScreen_HandleWrongPasswordAndWaitForInput
;
; INPUTS:
; X
;
; OUTPUTS:
; TODO
;
; XREFS:
;
PasswordScreen_WaitForInput
;============================================================================
[915f]PasswordScreen_HandleWrongPasswordAndWaitForInput:; [$915f]
[915f]JSR Sound_PlayInputSound
[9162]@_handleWrongPassword:; [$9162]
[9162]JSR WaitForNextFrame
[9165]JSR Screen_ResetSpritesForNonGame
[9168]JSR PasswordScreen_WriteWrongPassword
[916b]LDA Joy1_ChangedButtonMask
[916d]BPL @_handleWrongPassword
[916f]JSR PasswordScreen_WriteEnterYourMantra
[9172]JMP PasswordScreen_WaitForInput
;============================================================================
; TODO: Document PasswordScreen_9175
;
; INPUTS:
; X
;
; OUTPUTS:
; TODO
;
; XREFS:
;
PasswordScreen_WaitForInput
;============================================================================
[9175]PasswordScreen_9175:; [$9175]
[9175]JSR Sound_PlayInputSound; Play the character input sound.
[9178]JMP PasswordScreen_WaitForInput; Wait for input.
;============================================================================
; TODO: Document PasswordScreen_HandleInput
;
; INPUTS:
; A
; X
;
; OUTPUTS:
; TODO
;
; XREFS:
;
PasswordScreen_WaitForInput
;============================================================================
[917b]PasswordScreen_HandleInput:; [$917b]
[917b]JSR PasswordScreen_HandleInputChar; Handle the character.
[917e]JMP PasswordScreen_WaitForInput; Wait again for input.
[9181]PasswordScreen_WriteEnterYourMantra:; [$9181]
[9181]LDY #$02; 2 = "Enter your mantra"
[9183]BNE PasswordScreen_DrawMessage; Draw it.
;
; X-- We should never fall through here --X
;
[9185]PasswordScreen_WriteWrongPassword:; [$9185]
[9185]LDA InterruptCounter; Load the interrupt counter.
[9187]AND #$1f; Check if we're on an animation frame.
[9189]BNE RETURN_91B7; If not, return.
;
; Calculate the string index based on the frame.
;
[918b]LDA InterruptCounter; Load the interrupt counter again.
[918d]LSR A; Compute a message index based on the interval.
[918e]LSR A
[918f]LSR A
[9190]LSR A
[9191]LSR A
[9192]AND #$01
[9194]TAY; Y = message string index
;
; v-- Fall through --v
;
[9195]PasswordScreen_DrawMessage:; [$9195]
;
; Load the message string.
;
[9195]LDA PASSWORD_MESSAGE_STRINGS_L,Y; Load the lower byte of the string address.
[9198]STA Temp_Int24; Store that.
[919a]LDA PASSWORD_MESSAGE_STRINGS_U,Y; Load the upper byte of the string address.
[919d]STA Temp_Int24_M; Store that.
;
; Set the PPU tile address to 0x20A5.
;
[919f]LDA #$20
[91a1]STA PPU_TargetAddr_U; Upper byte = 0x20
[91a3]LDA #$a5
[91a5]STA PPU_TargetAddr; Lower byte = 0xA5
;
; Queue up a string of 23 characters.
;
[91a7]LDA #$17
[91a9]JSR PPUBuffer_QueueCommandOrLength; Queue 23 characters to draw.
;
; Begin the draw loop.
;
[91ac]LDY #$00; Y = 0 (loop counter)
[91ae]@LAB_PRG12__91ae:; [$91ae]
[91ae]JSR PPUBuffer_WriteFromTemp; Put the next character from our loaded string into the PPU buffer.
[91b1]CPY #$17; Have we written 23 characters?
[91b3]BNE @LAB_PRG12__91ae; If not, loop.
[91b5]STX PPUBuffer_WriteOffset; Store the new upper bounds of the PPU buffer.
[91b7]RETURN_91B7:; [$91b7]
[91b7]RTS
;============================================================================
; Lookup table for password screen strings.
;
; XREFS:
;
PasswordScreen_DrawMessage
;============================================================================
[91b8]PASSWORD_MESSAGE_STRINGS_L:; [$91b8]
[91b8].byte $be; [0]:
[91b9].byte $d5; [1]:
[91ba].byte $ec; [2]:
[91bb]PASSWORD_MESSAGE_STRINGS_U:; [$91bb]
[91bb].byte $91; [0]:
[91bc].byte $91; [1]:
[91bd].byte $91; [2]:
;============================================================================
; String: "Mantra is in the wrong."
;
; This is used whenever an incorrect password was entered.
;
; XREFS:
;
PASSWORD_MESSAGE_STRINGS_L [$PRG12::91b8]
;============================================================================
[91be]STRING_MANTRA_IN_THE_WRONG:; [$91be]
[91be].byte "Mantra i"; [$91be] char
[91c6].byte "s in the"; [$91c6] char
[91ce].byte " wrong."; [$91ce] char
;============================================================================
; String: Empty spaces
;
; This is part of the blink animation for the invalid password text.
;
; XREFS:
;
PASSWORD_MESSAGE_STRINGS_L [$PRG12::91b9]
;============================================================================
[91d5]STRING_PASSWORD_SPACES:; [$91d5]
[91d5].byte " "; [$91d5] char
[91dd].byte " "; [$91dd] char
[91e5].byte " "; [$91e5] char
;============================================================================
; String: "Enter your mantra."
;
; This is shown at the top of the password screen.
;
; XREFS:
;
PASSWORD_MESSAGE_STRINGS_L [$PRG12::91ba]
;============================================================================
[91ec]STRING_ENTER_YOUR_MANTRA:; [$91ec]
[91ec].byte " Enter "; [$91ec] char
[91f4].byte "your man"; [$91f4] char
[91fc].byte "tra. ",$00; [$91fc] char
;============================================================================
; Palette data for the password screen.
;============================================================================
[9204]PASSWORD_SCREEN_PALETTE:; [$9204]
[9204].byte $0f; [0]:
[9205].byte $00; [1]:
[9206].byte $10; [2]:
[9207].byte $20; [3]:
[9208].byte $0f; [4]:
[9209].byte $00; [5]:
[920a].byte $10; [6]:
[920b].byte $20; [7]:
[920c].byte $0f; [8]:
[920d].byte $00; [9]:
[920e].byte $10; [10]:
[920f].byte $20; [11]:
[9210].byte $0f; [12]:
[9211].byte $0f; [13]:
[9212].byte $0f; [14]:
[9213].byte $0f; [15]:
[9214].byte $0f; [16]:
[9215].byte $0f; [17]:
[9216].byte $27; [18]:
[9217].byte $30; [19]:
[9218].byte $0f; [20]:
[9219].byte $06; [21]:
[921a].byte $16; [22]:
[921b].byte $26; [23]:
[921c].byte $0f; [24]:
[921d].byte $06; [25]:
[921e].byte $16; [26]:
[921f].byte $26; [27]:
[9220].byte $0f; [28]:
[9221].byte $0f; [29]:
[9222]PASSWORD_SCREEN_PALETTE_30_:; [$9222]
[9222].byte $0f; [30]:
[9223]PASSWORD_SCREEN_PALETTE_31_:; [$9223]
[9223].byte $0f; [31]:
;============================================================================
; Available list of input characters for the password screen, broken down by
; row.
;
; XREFS:
;
PasswordScreen_Show
;============================================================================
[9224]INPUT_CHARS:; [$9224]
[9224].byte $21; [0]: [0]:
[9225]INPUT_CHARS_ppuAddr_1_:; [$9225]
[9225].byte $c4; [0]: [1]:
[9226]INPUT_CHARS_chars:; [$9226]
[9226].byte "A"; [$9226] char
[9227]INPUT_CHARS_chars_1_:; [$9227]
[9227].byte " "; [$9227] char
[9228]INPUT_CHARS_chars_2_:; [$9228]
[9228].byte "B"; [$9228] char
[9229]INPUT_CHARS_chars_3_:; [$9229]
[9229].byte " C D E F"; [$9229] char
[9231].byte " G H I J"; [$9231] char
[9239].byte " K L M"; [$9239] char
.byte $22; [1]: [0]:
[9240].byte $04; [1]: [1]:
[9241].byte "N O P Q "; [$9241] char
[9249].byte "R S T U "; [$9249] char
[9251].byte "V W X Y "; [$9251] char
[9259].byte "Z"; [$9259] char
.byte $22; [2]: [0]:
[925b].byte $44; [2]: [1]:
[925c].byte "a b c d "; [$925c] char
[9264].byte "e f g h "; [$9264] char
[926c].byte "i j k l "; [$926c] char
[9274].byte "m"; [$9274] char
.byte $22; [3]: [0]:
[9276].byte $84; [3]: [1]:
[9277].byte "n o p q "; [$9277] char
[927f].byte "r s t u "; [$927f] char
[9287].byte "v w x y "; [$9287] char
[928f].byte "z"; [$928f] char
.byte $22; [4]: [0]:
[9291].byte $c4; [4]: [1]:
[9292].byte "0 1 2 3 "; [$9292] char
[929a].byte "4 5 6 7 "; [$929a] char
[92a2].byte "8 9 , ? "; [$92a2] char
[92aa].byte " "; [$92aa] char
.byte $23; [5]: [0]:
[92ac].byte $04; [5]: [1]:
[92ad].byte "{|} ~|",$7f," "; [$92ad] char
[92b5].byte "DEL END "; [$92b5] char
[92bd].byte " "; [$92bd] char
[92c5].byte " "; [$92c5] char
;============================================================================
; PPU tile positions for each input character cursor position.
;
; XREFS:
;
PasswordScreen_WriteCharTile
;============================================================================
[92c6]PASSWORD_CURSOR_START_PPU_ADDRS_L:; [$92c6]
[92c6].byte $28; [0]:
[92c7].byte $48; [1]:
[92c8]PASSWORD_CURSOR_START_PPU_ADDRS_U:; [$92c8]
[92c8].byte $21; [0]:
[92c9].byte $21; [1]:
;============================================================================
; TODO: Document PasswordScreen_DrawPasswordFieldCursor
;
; INPUTS:
; X
;
; OUTPUTS:
; TODO
;
; XREFS:
;
PasswordScreen_DrawAndHandleInputLoop
;============================================================================
[92ca]PasswordScreen_DrawPasswordFieldCursor:; [$92ca]
;
; Only proceed if the interrupt counter's lower nibble is set.
;
[92ca]LDA InterruptCounter; Load the interrupt counter.
[92cc]AND #$0f; Keep the lower nibble.
[92ce]BNE RETURN_9311; If > 0, return.
;
; Check whether to draw the character or the cursor.
;
[92d0]LDA InterruptCounter; Load the interrupt counter.
[92d2]AND #$10; Is bit 5 set?
[92d4]BEQ PasswordScreen_DrawAtCursorPosition; If set, jump to write the character.
;
; Draw the cursor.
;
[92d6]LDA #$60; 0x60 == Solid block (cursor)
[92d8]JMP PasswordScreen_WriteCharTile; Draw it.
[92db]PasswordScreen_DrawAtCursorPosition:; [$92db]
;
; Check the character at the cursor position.
;
[92db]LDX a:Password_FieldCursorPos; X = Cursor position.
[92de]LDA ScreenBuffer,X; A = Character at that position.
[92e1]CMP #$ff; Is it 0xFF (unset)?
[92e3]BEQ @_writeBlankChar; If not, jump.
;
; There's no character at this position.
;
[92e5]TAX; X = A (character offset)
[92e6]LDA PASSWORD_ENTERED_CHARS,X; Get the character value for that offset.
[92e9]BPL PasswordScreen_WriteCharTile; Write it.
[92eb]@_writeBlankChar:; [$92eb]
[92eb]LDA #$5f; 0x5F == "_" (blank) character
;
; v-- Fall through --v
;
[92ed]PasswordScreen_WriteCharTile:; [$92ed]
[92ed]PHA; Push the tile value to the stack.
;
; Determine the index to draw to for the cursor position.
;
[92ee]LDA a:Password_FieldCursorPos; Load the cursor position in the password field.
[92f1]LSR A; Divide by 16.
[92f2]LSR A
[92f3]LSR A
[92f4]LSR A
;
; Look up the PPU address for that index.
;
[92f5]TAY; Y = A
[92f6]LDA PASSWORD_CURSOR_START_PPU_ADDRS_U,Y; A = Upper byte of the PPU address for this position.
[92f9]STA PPU_TargetAddr_U; Store it.
[92fb]LDA a:Password_FieldCursorPos; Load the cursor position again.
[92fe]AND #$0f; Keep the lower nibble.
[9300]CLC
[9301]ADC PASSWORD_CURSOR_START_PPU_ADDRS_L,Y; Add the lower byte of the PPU address.
[9304]STA PPU_TargetAddr; Store as the target address to write to.
;
; Write to the PPU buffer.
;
[9306]LDA #$01; A = 1 (write length)
[9308]JSR PPUBuffer_QueueCommandOrLength; Queue the length.
[930b]PLA; Pull the caller-provided tile value.
[930c]JSR PPUBuffer_Set; Write the tile to the buffer.
[930f]STX PPUBuffer_WriteOffset; Update the write offset.
[9311]RETURN_9311:; [$9311]
[9311]RTS
;============================================================================
; TODO: Document PasswordScreen_HandleInputChar
;
; INPUTS:
; A
;
; OUTPUTS:
; TODO
;
; XREFS:
;
PasswordScreen_HandleInput
;============================================================================
[9312]PasswordScreen_HandleInputChar:; [$9312]
[9312]TAX; X = A
[9313]BMI PasswordScreen_HandleMoveCursorOrDelete; If a special character, jump to handle it.
;
; Place the character in the buffer.
;
[9315]LDX a:Password_FieldCursorPos; X = Current cursor position.
[9318]STA ScreenBuffer,X; Store in the screen buffer.
[931b]JSR PasswordScreen_DrawAtCursorPosition; Write the character.
;
; Advance the cursor position by one.
;
[931e]LDX a:Password_FieldCursorPos; X = Cursor position again.
[9321]INX; X++
;
; Check if the maximum number of characters have been entered.
;
[9322]CPX a:Password_MaxChars; Has it reached the max number of characters?
[9325]BEQ @_maxCharsReached; If so, jump.
[9327]DEX; X--
[9328]CPX a:Password_EnteredCharsLength; Was the cursor at the end of the entered characters?
[932b]BNE @_advanceCursorPos; If not, jump.
;
; The cursor was at the end of the password. Advance the
; number of entered characters.
;
[932d]INC a:Password_EnteredCharsLength; Increment the entered chars length.
[9330]@_advanceCursorPos:; [$9330]
[9330]INC a:Password_FieldCursorPos; Increment the cursor position.
[9333]JMP 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]
[9336]STX a:Password_EnteredCharsLength; Store the new entered password length.
[9339]LDA #$00
[933b]STA a:Password_FieldCursorPos; Reset the cursor position to 0.
[933e]JMP PasswordScreen_DrawAtCursorPosition; Write the character.
[9341]Sound_PlayInputSound:; [$9341]
[9341]PHA; Push A to the stack.
[9342]LDA #$0d; 0xD == Character Input sound
[9344]JSR Sound_PlayEffect; Play the sound effect.
[9347]PLA; Pop A from the stack.
[9348]RTS
;============================================================================
; Play the Move Cursor sound.
;
; INPUTS:
; None
;
; OUTPUTS:
; None
;
; CALLS:
;
Sound_PlayEffect
;
; XREFS:
;
Password_HandleDPadInput
;============================================================================
[9349]Sound_PlayMoveCursorSound:; [$9349]
[9349]PHA; Push A to the stack.
[934a]LDA #$0b; 0xB == Cursor Movement sound.
[934c]JSR Sound_PlayEffect; Play the sound effect.
[934f]PLA; Pop A from the stack.
[9350]RETURN_9350:; [$9350]
[9350]RTS
;============================================================================
; TODO: Document PasswordScreen_HandleMoveCursorOrDelete
;
; INPUTS:
; A
;
; OUTPUTS:
; TODO
;
; XREFS:
;
PasswordScreen_HandleInputChar
;============================================================================
[9351]PasswordScreen_HandleMoveCursorOrDelete:; [$9351]
;
; Check if this is Move Left (0x81).
;
[9351]CMP #$81; Is this Move Left?
[9353]BEQ PasswordScreen_HandleMoveCursorLeft; If so, jump to handle Move Left.
;
; Check if this is Move Right (0x80).
;
[9355]CMP #$80; Is this Move Right?
[9357]BEQ PasswordScreen_HandleMoveCursorRight; If so, jump to handle Move Right.
;
; Check if this is Delete Character (0x82).
;
[9359]CMP #$82; Is this DEL?
[935b]BNE RETURN_9350; If not, return.
[935d]JMP PasswordScreen_HandleDeleteAtCursor; Else, jump to handle DEL.
;============================================================================
; TODO: Document PasswordScreen_HandleMoveCursorLeft
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
PasswordScreen_HandleMoveCursorOrDelete
;============================================================================
[9360]PasswordScreen_HandleMoveCursorLeft:; [$9360]
;
; Check if there are any entered characters.
;
[9360]LDA a:Password_EnteredCharsLength; Is the password field empty?
[9363]BEQ 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]LDX a:Password_FieldCursorPos; Is the cursor position > 0?
[9368]BNE @LAB_PRG12__937d; If so, jump.
;
; The cursor is at the beginning of the password.
;
[936a]JSR PasswordScreen_DrawAtCursorPosition
[936d]LDA a:Password_EnteredCharsLength; Get the number of entered characters.
[9370]STA a:Password_FieldCursorPos; Set the cursor position to the end of it.
[9373]CMP a:Password_MaxChars
[9376]BNE @LAB_PRG12__9383
[9378]DEC a:Password_FieldCursorPos
[937b]BNE @LAB_PRG12__9383
[937d]@LAB_PRG12__937d:; [$937d]
[937d]JSR PasswordScreen_DrawAtCursorPosition
[9380]DEC a:Password_FieldCursorPos
[9383]@LAB_PRG12__9383:; [$9383]
[9383]JMP PasswordScreen_DrawAtCursorPosition
;============================================================================
; TODO: Document PasswordScreen_HandleMoveCursorRight
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
PasswordScreen_HandleMoveCursorOrDelete
;============================================================================
[9386]PasswordScreen_HandleMoveCursorRight:; [$9386]
[9386]LDA a:Password_EnteredCharsLength
[9389]BEQ Call_Sound_PlayInputSound
[938b]LDX a:Password_FieldCursorPos
[938e]CPX a:Password_EnteredCharsLength
[9391]BEQ @LAB_PRG12__939e
[9393]INX
[9394]CPX a:Password_EnteredCharsLength
[9397]BNE @_writeAndAdvanceCursor
[9399]CPX a:Password_MaxChars
[939c]BNE @_writeAndAdvanceCursor
[939e]@LAB_PRG12__939e:; [$939e]
[939e]JSR PasswordScreen_DrawAtCursorPosition
[93a1]LDA #$00
[93a3]STA a:Password_FieldCursorPos
[93a6]BEQ @_writeAtCursor
[93a8]@_writeAndAdvanceCursor:; [$93a8]
[93a8]JSR PasswordScreen_DrawAtCursorPosition
[93ab]INC a:Password_FieldCursorPos
[93ae]@_writeAtCursor:; [$93ae]
[93ae]JMP PasswordScreen_DrawAtCursorPosition
[93b1]Call_Sound_PlayInputSound:; [$93b1]
[93b1]JMP Sound_PlayInputSound
;============================================================================
; TODO: Document PasswordScreen_HandleDeleteAtCursor
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
PasswordScreen_HandleMoveCursorOrDelete
;============================================================================
[93b4]PasswordScreen_HandleDeleteAtCursor:; [$93b4]
[93b4]LDA a:Password_FieldCursorPos
[93b7]CMP a:Password_EnteredCharsLength
[93ba]BEQ PasswordScreen_HandleDeleteLastChar
[93bc]PHA
[93bd]@_loop:; [$93bd]
[93bd]LDX a:Password_FieldCursorPos
[93c0]INX
[93c1]CPX a:Password_EnteredCharsLength
[93c4]BEQ @LAB_PRG12__93d7
[93c6]LDX a:Password_FieldCursorPos
[93c9]LDA DAT_0601,X
[93cc]STA ScreenBuffer,X
[93cf]JSR PasswordScreen_DrawAtCursorPosition
[93d2]INC a:Password_FieldCursorPos
[93d5]BNE @_loop
[93d7]@LAB_PRG12__93d7:; [$93d7]
[93d7]LDX a:Password_FieldCursorPos
[93da]LDA #$ff
[93dc]STA ScreenBuffer,X
[93df]JSR PasswordScreen_DrawAtCursorPosition
[93e2]DEC a:Password_EnteredCharsLength
[93e5]PLA
[93e6]STA a:Password_FieldCursorPos
[93e9]JMP PasswordScreen_DrawAtCursorPosition
;============================================================================
; TODO: Document PasswordScreen_HandleDeleteLastChar
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
PasswordScreen_HandleDeleteAtCursor
;============================================================================
[93ec]PasswordScreen_HandleDeleteLastChar:; [$93ec]
[93ec]LDX a:Password_FieldCursorPos
[93ef]BEQ Call_Sound_PlayInputSound
[93f1]JSR PasswordScreen_DrawAtCursorPosition
[93f4]DEC a:Password_FieldCursorPos
[93f7]DEC a:Password_EnteredCharsLength
[93fa]LDX a:Password_FieldCursorPos
[93fd]LDA #$ff
[93ff]STA ScreenBuffer,X
[9402]JMP PasswordScreen_DrawAtCursorPosition
;============================================================================
; TODO: Document PasswordScreen_DrawAndHandleInputLoop
;
; INPUTS:
; X
;
; OUTPUTS:
; C
;
; XREFS:
;
PasswordScreen_WaitForInput
;============================================================================
[9405]PasswordScreen_DrawAndHandleInputLoop:; [$9405]
[9405]JSR PasswordScreen_DrawPasswordFieldCursor
[9408]JSR Password_HandleDPadInput
[940b]JSR PasswordScreen_DrawSelectionCursor
[940e]LDA Joy1_ChangedButtonMask
[9410]BMI @LAB_PRG12__9416
;
; Return whether the "A" button was pressed.
;
[9412]ASL A
[9413]BMI @LAB_PRG12__9422
[9415]RTS
[9416]@LAB_PRG12__9416:; [$9416]
[9416]PHA
[9417]LDA #$0e
[9419]JSR Sound_PlayEffect
[941c]PLA
[941d]JSR PasswordScreen_IsCursorSpotInvalid
[9420]SEC
[9421]RTS
[9422]@LAB_PRG12__9422:; [$9422]
[9422]LDA #$81
[9424]SEC
[9425]RTS
;============================================================================
; 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:; [$9426]
;
; 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]LDA a:Password_CursorRow; A = Cursor row.
[9429]ASL A; A = A * 2
[942a]ADC a:Password_CursorRow; A++
[942d]ASL A
[942e]ASL A
[942f]ADC a:Password_CursorRow
[9432]ADC a:Password_CursorCol
;
; Load the value from that entry in the table.
;
[9435]TAX
[9436]LDA 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]CMP #$ff
[943b]RTS
[943c]PASSWORD_VALUES_FOR_CURSOR_POS:; [$943c]
[943c].byte $00; [0]:
[943d].byte $01; [1]:
[943e].byte $02; [2]:
[943f].byte $03; [3]:
[9440].byte $04; [4]:
[9441].byte $05; [5]:
[9442].byte $06; [6]:
[9443].byte $07; [7]:
[9444].byte $08; [8]:
[9445].byte $09; [9]:
[9446].byte $0a; [10]:
[9447].byte $0b; [11]:
[9448].byte $0c; [12]:
[9449].byte $0d; [13]:
[944a].byte $0e; [14]:
[944b].byte $0f; [15]:
[944c].byte $10; [16]:
[944d].byte $11; [17]:
[944e].byte $12; [18]:
[944f].byte $13; [19]:
[9450].byte $14; [20]:
[9451].byte $15; [21]:
[9452].byte $16; [22]:
[9453].byte $17; [23]:
[9454].byte $18; [24]:
[9455].byte $19; [25]:
[9456].byte $1a; [26]:
[9457].byte $1b; [27]:
[9458].byte $1c; [28]:
[9459].byte $1d; [29]:
[945a].byte $1e; [30]:
[945b].byte $1f; [31]:
[945c].byte $20; [32]:
[945d].byte $21; [33]:
[945e].byte $22; [34]:
[945f].byte $23; [35]:
[9460].byte $24; [36]:
[9461].byte $25; [37]:
[9462].byte $26; [38]:
[9463].byte $27; [39]:
[9464].byte $28; [40]:
[9465].byte $29; [41]:
[9466].byte $2a; [42]:
[9467].byte $2b; [43]:
[9468].byte $2c; [44]:
[9469].byte $2d; [45]:
[946a].byte $2e; [46]:
[946b].byte $2f; [47]:
[946c].byte $30; [48]:
[946d].byte $31; [49]:
[946e].byte $32; [50]:
[946f].byte $33; [51]:
[9470].byte $34; [52]:
[9471].byte $35; [53]:
[9472].byte $36; [54]:
[9473].byte $37; [55]:
[9474].byte $38; [56]:
[9475].byte $39; [57]:
[9476].byte $3a; [58]:
[9477].byte $3b; [59]:
[9478].byte $3c; [60]:
[9479].byte $3d; [61]:
[947a].byte $3e; [62]:
[947b].byte $3f; [63]:
[947c].byte $ff; [64]:
[947d].byte $80; [65]:
[947e].byte $81; [66]:
[947f].byte $82; [67]:
[9480].byte $83; [68]:
[9481].byte $ff; [69]:
[9482].byte $ff; [70]:
[9483].byte $ff; [71]:
[9484].byte $ff; [72]:
[9485].byte $ff; [73]:
[9486].byte $ff; [74]:
[9487].byte $ff; [75]:
[9488].byte $ff; [76]:
[9489].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:; [$948a]
;
; Check if there have been any changes to the directional
; button presses since we were last called.
;
[948a]LDA Joy1_ChangedButtonMask
[948c]AND #$0f
[948e]BNE @_handleAutoRepeat
;
; There were no new changes to buttons. Check whether any
; directional buttons were already being held down.
;
[9490]LDA Joy1_ButtonMask
[9492]AND #$0f
[9494]BEQ @_stopAutoRepeat
[9496]CMP a:Password_DPadBits
[9499]BNE @_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]LDX a:Password_CounterBeforeAutoRepeatMove
[949e]BPL @_updateAndCheckAutoRepeatCounter
[94a0]INC a:Password_CounterBeforeAutoRepeatMove
[94a3]INX
[94a4]CPX #$86
[94a6]BNE @_incCounter
[94a8]@_resetAutoRepeatCounter:; [$94a8]
[94a8]LDX #$80
[94aa]STX a:Password_CounterBeforeAutoRepeatMove
[94ad]RTS
[94ae]@_updateAndCheckAutoRepeatCounter:; [$94ae]
[94ae]INC a:Password_CounterBeforeAutoRepeatMove
[94b1]INX
[94b2]CPX #$2a
[94b4]BEQ @_resetAutoRepeatCounter
[94b6]@_incCounter:; [$94b6]
[94b6]LDA #$00
[94b8]RTS
;
; A new direction has been held down. Store it and return it,
; moving the cursor.
;
[94b9]@_handleAutoRepeat:; [$94b9]
[94b9]STA a:Password_DPadBits
[94bc]LDX #$00
[94be]STX a:Password_CounterBeforeAutoRepeatMove
[94c1]RTS
;
; No direction buttons are being pressed, or the direction
; has changed. Stop moving the cursor.
;
[94c2]@_stopAutoRepeat:; [$94c2]
[94c2]LDA #$00
[94c4]STA a:Password_DPadBits
[94c7]RTS
[94c8]Password_HandleDPadInput:; [$94c8]
[94c8]JSR PasswordScreen_GetDPadBits; Get the DPad bits.
[94cb]AND #$0f; Keep the lower nibble (DPad bits -- redundant).
[94cd]BEQ @_return; If nothing is pressed, return.
;
; We can move in a direction. Play a sound and figure
; out which direction we're moving.
;
[94cf]JSR Sound_PlayMoveCursorSound; Play the cursor movement sound.
;
; Move the cursor right, handling wrapping.
;
[94d2]LSR A; Shift the "Right" bit into Carry.
[94d3]BCS @_moveRight; If set, handle moving right.
[94d5]LSR A; Shift the "Left" bit into Carry.
[94d6]BCS @_moveLeft; if set, handle moving left.
[94d8]LSR A; Shift the "Down" bit into Carry.
[94d9]BCS @_moveDown; If set, handle moving down.
;
; We're moving one row up.
;
[94db]@_moveUp:; [$94db]
[94db]LDX a:Password_CursorRow; X = Cursor row
[94de]DEX; X-- (move up)
[94df]BPL @_checkRow4; If the new row is <= 4, jump to handle it.
;
; The cursor wrapped up to row 5.
;
[94e1]JSR PasswordScreen_UpdateCursorMovedToLastRow; Handle moving to row 5.
[94e4]LDX #$05; Set the new row as 5.
[94e6]BNE @_updateCursorRow
;
; Check if this is row 4 (moving from arrows/DEL/END).
;
[94e8]@_checkRow4:; [$94e8]
[94e8]CPX #$04; Is the new row < 4?
[94ea]BNE @_updateCursorRow; If so, move the cursor there.
;
; Cursor moved from row 5 to 4 (numeric, symbols).
;
[94ec]JSR 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]
[94ef]STX a:Password_CursorRow; Set the new cursor row.
[94f2]JSR PasswordScreen_IsCursorSpotInvalid; Check if the destination spot is valid.
[94f5]BCS @_moveUp; If not, move up one row.
[94f7]@_return:; [$94f7]
[94f7]RTS
;
; We're moving one row down.
;
[94f8]@_moveDown:; [$94f8]
[94f8]LDX a:Password_CursorRow; X = Cursor row
[94fb]INX; X++ (move down)
[94fc]CPX #$05; Did we move to row 5?
[94fe]BEQ @_moveDownToRow5; If so, jump to handle it specially.
;
; The cursor moved down to row < 5.
;
[9500]BCC @_updateCursorRowDown; Move the cursor down a row.
;
; We've moved down past the last row. We'll be wrapping.
;
[9502]JSR PasswordScreen_UpdateCursorMovedFromLastRow; Handle moving from the last row.
[9505]LDX #$00; X = 0 (new row)
[9507]BEQ @_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]
[9509]JSR PasswordScreen_UpdateCursorMovedToLastRow; Handle moving to the last row.
;
; Save the new row position.
;
[950c]@_updateCursorRowDown:; [$950c]
[950c]STX 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]JSR PasswordScreen_IsCursorSpotInvalid; Check if the new position is invalid.
[9512]BCS @_moveDown; If so, move down one more row (looping as necessary).
[9514]RTS; And return.
;
; Move the cursor left, handling wrapping and repositioning
; if on an invalid spot.
;
[9515]@_moveLeft:; [$9515]
[9515]LDX a:Password_CursorCol; X = Cursor column
[9518]DEX; X-- (move left)
[9519]BPL @_updateCursorColRight; If >= 0, jump to move right.
;
; We're wrapping from the left to the right.
;
[951b]LDX #$0c; Set the cursor to column 12.
[951d]@_updateCursorColRight:; [$951d]
[951d]STX a:Password_CursorCol; Store the new cursor column.
[9520]JSR PasswordScreen_IsCursorSpotInvalid; Check if the new position is invalid.
[9523]BCS @_moveLeft; If so, move left again.
[9525]RTS; And return.
;
; Move the cursor right, handling wrapping and repositioning
; if on an invalid spot.
;
[9526]@_moveRight:; [$9526]
[9526]LDX a:Password_CursorCol; X = Cursor column.
[9529]INX; X++ (move right)
[952a]CPX #$0d; Is the new position < 13?
[952c]BCC @_updateCursorColLeft; If so, jump to move left.
;
; We're wrapping from the right to the left.
;
[952e]LDX #$00; X = 0 (new cursor position).
[9530]@_updateCursorColLeft:; [$9530]
[9530]STX a:Password_CursorCol; Store the new cursor position.
[9533]JSR PasswordScreen_IsCursorSpotInvalid; Check if the new position is invalid.
[9536]BCS @_moveRight; If so, move right again (looping as needed).
[9538]RTS; 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]
[9539]LDA a:Password_CursorCol; Load the cursor column.
[953c]CMP #$08; Is it >= 8? (invalid position)
[953e]BCS RETURN_9544; If so, return.
[9540]LSR 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]
[9541]STA a:Password_CursorCol; Set the cursor position.
[9544]RETURN_9544:; [$9544]
[9544]RTS
;============================================================================
; 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]
[9545]LDA a:Password_CursorCol; Load the cursor column.
[9548]CMP #$04; Is it >= 4? (invalid position)
[954a]BCS RETURN_9544; If so, return.
[954c]ASL A; Else, multiply by 2 (each symbol is 2 tiles).
[954d]BCC 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]
[954f]LDA a:Password_CursorCol; A = cursor column.
[9552]LDX a:Password_CursorRow; X = cursor row.
[9555]CPX #$05; Is the row 5 (arrows, delete, end)?
[9557]BNE @_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]ASL A; Multiply the column by 2.
;
; Compute an X position for the symbol.
;
[955a]@_setSymbolPos:; [$955a]
[955a]ASL A; Convert to pixel position (2 tile width: 16).
[955b]ASL A
[955c]ASL A
[955d]ASL A
[955e]ADC #$20; Add 32 (left padding).
[9560]TAX; X = result.
;
; Compute a Y position for the symbol.
;
[9561]LDA a:Password_CursorRow; A = cursor row.
[9564]ASL A; Convert to pixel position (2 tile height: 16).
[9565]ASL A
[9566]ASL A
[9567]ASL A
[9568]ADC #$55; Add 85 (start of first row).
[956a]TAY; Y = result.
[956b]LDA #$e4; A = 0xE4 (hand symbol)
[956d]JMP UI_DrawPromptInputSymbol; Draw the symbol.
[9570]Player_SetStartGameState:; [$9570]
[9570]LDA #$00
[9572]STA a:TempleSpawnPoint; Set the temple spawn to 0.
[9575]STA a:PlayerTitle; Set the player title to 0 (Novice).
[9578]STA a:SpecialItems; Clear the special items.
[957b]STA a:Quests; Clear the quests.
[957e]LDX #$ff
[9580]STX a:SelectedWeapon; Clear the selected weapon.
[9583]STA a:SelectedArmor; Clear the selected armor.
[9586]STX a:SelectedShield; Clear the selected shield.
[9589]STX a:SelectedMagic; Clear the selected magic.
[958c]STX a:SelectedItem; Clear the selected item.
[958f]STA a:NumberOfWeapons; Set the number of weapons to 0.
[9592]STA a:NumberOfArmors; Set the number of armor to 0.
[9595]STA a:NumberOfShields; Set the number of shields to 0.
[9598]STA a:NumberOfMagicSpells; Set the number of magic spells to 0.
[959b]STA a:NumberOfItems; Set the number of items to 0.
[959e]STA a:Experience; Set the experience to 0.
[95a1]STA a:Experience_U
[95a4]STA a:Gold; Set the gold to 0.
[95a7]STA a:Gold_M
[95aa]STA a:Gold_U
[95ad]STA a:NextPlayerTitle; Set the next player title to 0 (Novice).
[95b0]RTS
;============================================================================
; 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:; [$95b1]
;
; Set the next player title as the current.
;
[95b1]LDA a:PlayerTitle; Load the current player title.
[95b4]STA a:NextPlayerTitle; Set it as the next.
[95b7]BEQ @_isNovice; If it's 0 (Novice), jump.
;
; Generate an offset into the gold and experience arrays.
;
[95b9]ASL A; Multiply by 2 to generate an offset into the lookup tables.
[95ba]TAX; 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]LDA $f747,X; Load the lower byte of experience for the title.
[95be]STA a:Experience; Set it as the player's experience.
[95c1]LDA $f748,X; Load the uper byte of experience for the title.
[95c4]STA 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]LDA $f765,X; Load the lower byte of gold.
[95ca]STA a:Gold; Set it.
[95cd]LDA $f766,X; Load the middle byte of gold.
[95d0]STA a:Gold_M; Set it.
[95d3]LDA #$00; Set the upper byte to 0.
[95d5]STA a:Gold_U
[95d8]RTS
;
; The player is Novice. Set experience and gold to 0.
;
[95d9]@_isNovice:; [$95d9]
[95d9]STA a:Experience; Set experience to 0.
[95dc]STA a:Experience_U
[95df]STA a:Gold; Set gold to 0.
[95e2]STA a:Gold_M
[95e5]STA a:Gold_U
[95e8]RTS
[95e9]Password_Load:; [$95e9]
;
; Clear the state counters.
;
[95e9]LDX #$00
[95eb]STX a:Password_ByteCounter; Clear the byte counter.
[95ee]STX a:Password_BitCounter; Clear the bit counter.
;
; Decode the start and checksum values (13 bits total) and throw
; them away.
;
[95f1]LDY #$0d; Y = 13 bits
[95f3]JSR Password_DecodeValue; Decode the checksum.
;
; Decode the temple spawn point (3 bits).
;
[95f6]LDY #$03; Y = 3 bits
[95f8]JSR Password_DecodeValue; Decode the spawn point.
[95fb]STA a:TempleSpawnPoint; And store it.
;
; Decode the player title (4 bits).
;
[95fe]LDY #$04; Y = 4 bits
[9600]JSR Password_DecodeValue; Decode the player title.
[9603]STA a:PlayerTitle; And store it.
;
; Decode the special items bitmask (8 bits).
;
[9606]LDY #$08; Y = 8 bits
[9608]JSR Password_DecodeValue; Decode the special items bitmask.
[960b]STA a:SpecialItems; And store it.
;
; Decode the quests bitmask (8 bits).
;
[960e]LDY #$08; Y = 8 bits
[9610]JSR Password_DecodeValue; Decode the quests bitmask.
[9613]STA a:Quests; And store it.
;
; Decode the selected weapon (2 bits).
;
[9616]LDY #$02; Y = 2 bits
[9618]JSR Password_DecodeValueOrUnset; Decode the selected weapon.
[961b]STA a:SelectedWeapon; And store it.
;
; Decode the selected armor (2 bits).
;
[961e]LDY #$02; Y = 2 bits
[9620]JSR Password_DecodeValueOrUnset; Decode the selected armor.
[9623]STA a:SelectedArmor; And store it.
;
; Decode the selected shield (2 bits).
;
[9626]LDY #$02; Y = 2 bits
[9628]JSR Password_DecodeValueOrUnset; Decode the selected shield.
[962b]STA a:SelectedShield; And store it.
;
; Decode the selected magic spell (3 bits).
;
[962e]LDY #$03; Y = 3 bits
[9630]JSR Password_DecodeValueOrUnset; Decode the selected magic spell.
[9633]STA a:SelectedMagic; And store it.
;
; Decode the selected item (5 bits).
;
[9636]LDY #$05; Y = 5 bits
[9638]JSR Password_DecodeValueOrUnset; Decode the selected item.
[963b]STA a:SelectedItem; And store it.
[963e]LDA #$9d; 0x9D == Lower byte of inventory.
[9640]STA Temp_Int24_U; Store it.
[9642]LDA #$03; 0x03 == Upper byte of inventory.
[9644]STA Maybe_Temp4; Store it.
[9646]LDY #$03; Y = 3 bits for items.
[9648]LDX #$02; X = 2 bits for max count.
[964a]JSR Password_DecodeValueList; Decode the weapon inventory.
;
; Check if under the allowed number of weapons. If too many,
; bail with error.
;
[964d]CMP #$05; Has this exceeded the inventory size?
[964f]BCS @_returnTrue; If so, return with failure.
[9651]STA a:NumberOfWeapons; Else, store the weapon count.
[9654]LDA #$a1; 0xA1 == Lower byte of inventory.
[9656]STA Temp_Int24_U; Store it.
[9658]LDA #$03; 0x03 == Upper byte of inventory.
[965a]STA Maybe_Temp4; Store it.
[965c]LDY #$03; Y = 3 bits for items.
[965e]LDX #$02; X = 2 bits for max count.
[9660]JSR Password_DecodeValueList; Decode the armor inventory.
;
; Check if under the allowed number of armors. If too many,
; bail with error.
;
[9663]CMP #$05; Has this exceeded the inventory size?
[9665]BCS @_returnTrue; If so, return with failure.
[9667]STA a:NumberOfArmors; Else, store the armor count.
[966a]LDA #$a5; 0xA5 == Lower byte of inventory.
[966c]STA Temp_Int24_U; Store it.
[966e]LDA #$03; 0x03 == Upper byte of inventory.
[9670]STA Maybe_Temp4; Store it.
[9672]LDY #$03; Y = 3 bits for items.
[9674]LDX #$02; X = 2 bits for max count.
[9676]JSR Password_DecodeValueList; Decode the shield inventory.
;
; Check if under the allowed number of shields. If too many,
; bail with error.
;
[9679]CMP #$05; Has this exceeded the inventory size?
[967b]BCS @_returnTrue; If so, return with failure.
[967d]STA a:NumberOfShields; Else, store the shield count.
[9680]LDA #$a9; 0xA9 == Lower byte of inventory.
[9682]STA Temp_Int24_U; Store it.
[9684]LDA #$03; 0x03 == Upper byte of inventory.
[9686]STA Maybe_Temp4; Store it.
[9688]LDY #$03; Y = 3 bits for items.
[968a]LDX #$03; X = 3 bits for max count.
[968c]JSR Password_DecodeValueList; Decode the magic inventory.
;
; Check if under the allowed number of magic spells. If too
; many, bail with error.
;
[968f]CMP #$05; Has this exceeded the inventory size?
[9691]BCS @_returnTrue; If so, return with failure.
[9693]STA a:NumberOfMagicSpells; Else, store the magic count.
[9696]LDA #$ad; 0xAD == Lower byte of inventory.
[9698]STA Temp_Int24_U; Store it.
[969a]LDA #$03; 0x03 == Upper byte of inventory.
[969c]STA Maybe_Temp4; Store it.
[969e]LDY #$04; Y = 4 bits for items.
[96a0]LDX #$05; X = 5 bits for max count.
[96a2]JSR Password_DecodeValueList; Decode the item inventory.
;
; Check if under the allowed number of items. If too many,
; bail with error.
;
[96a5]CMP #$09; Has this exceeded the inventory size?
[96a7]BCS @_returnTrue; If so, return with failure.
[96a9]STA a:NumberOfItems; Else, store the item count.
[96ac]CLC; Set C = 0 for success.
[96ad]RTS; And return it.
;
; The state was corrupted or invalid. Return a fail result.
;
[96ae]@_returnTrue:; [$96ae]
[96ae]SEC; Set C = 0 for failure.
[96af]RTS; 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]
[96b0]TYA; A = Y (number of bits)
[96b1]PHA; Push it to the stack.
[96b2]LDY #$01; Y = 1
[96b4]JSR Password_DecodeValue; Decode the set/unset flag.
[96b7]LSR A; Shift into Carry.
[96b8]PLA; Pop our saved Y (number of bits).
[96b9]TAY; Set back into Y.
[96ba]BCC @_returnUnset; If the flag was 0, jump to return unset.
;
; The value is set. Decode it.
;
[96bc]JMP Password_DecodeValue; Decode the value and return it.
;
; The value was not set. Return 0xFF.
;
[96bf]@_returnUnset:; [$96bf]
[96bf]LDA #$ff; A = 0xFF (unset value).
[96c1]RTS; 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]
[96c2]STX a:Password_TempX; Store X temporarily.
;
; Decode the length count.
;
[96c5]JSR Password_DecodeValue; Decode the next value.
[96c8]STA a:Password_TempA; Store the result temporarily.
[96cb]BEQ @_return; If it's 0 (no items), return 0.
;
; The list has at least 1 item. Iterate through the items.
;
[96cd]LDY #$00; Y = 0 (loop counter).
[96cf]@_loop:; [$96cf]
[96cf]TYA; A = Y
[96d0]PHA; Push the loop counter to the stack.
;
; Read an item from the list.
;
[96d1]LDY a:Password_TempX; Y = number of item bits to read.
[96d4]JSR Password_DecodeValue; Decode the item value.
[96d7]TAX; X = resulting item value
[96d8]PLA; Pop the loop counter.
[96d9]TAY; Y = loop counter
;
; Store the resulting item in our buffer.
;
[96da]TXA; A = item value
[96db]STA (Temp_Int24_U),Y; Store in our decode buffer.
[96dd]INY; Y++
[96de]CPY a:Password_TempA; Have we read all the items?
[96e1]BNE @_loop; If not, loop.
;
; We're done! Return the number of items.
;
[96e3]TYA; A = Y (loop counter, result)
[96e4]@_return:; [$96e4]
[96e4]RTS; And return it.
[96e5]Password_GenerateStateAndReset:; [$96e5]
[96e5]JSR Password_GenerateState; Generate the password state.
;
; Reset the state.
;
[96e8]LDX #$00
[96ea]STX a:Password_ByteCounter; Reset byte counter to 0.
[96ed]STX a:Password_BitCounter; Reset bit counter to 0.
[96f0]RTS
;============================================================================
; 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]
[96f1]LDY #$06
[96f3]JSR Password_DecodeValue; Decode the next 6 bits.
[96f6]CLC
[96f7]DEC a:Password_6BitCount; Decrement the 6 bit counter.
[96fa]BNE @_return; If > 0, set C=0 and jump to return.
[96fc]SEC; Set C=1.
[96fd]@_return:; [$96fd]
[96fd]RTS
;============================================================================
; 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:; [$96fe]
;
; Reset all the encoding state.
;
[96fe]LDX #$00
[9700]STX a:Password_ByteCounter; Reset byte counter to 0.
[9703]STX a:Password_BitCounter; Reset bit counter to 0.
[9706]STX a:Password_Checksum; Reset checksum to 0.
;
; Place 0x00 in the first byte.
;
[9709]LDY #$08; Y = 8 (value storage size in bits)
[970b]LDA #$00; A = 0 (value)
[970d]JSR Password_EncodeValue; Encode it.
;
; Place 0x00 in the first 5 bits of the second byte.
;
[9710]LDY #$05; Y = 5 (value storage size in bits)
[9712]LDA #$00; A = 0 (value)
[9714]JSR Password_EncodeValue; Encode it.
;
; Save all the game state into the remaining bits and
; progress the checksum.
;
[9717]JSR 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]LDA a:Password_ByteCounter; Multiply the current state byte index by 8, and track carry.
[971d]ASL A
[971e]ASL A
[971f]ASL A
[9720]ADC 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]LDX #$00; X = 0 (Loop counter)
[9725]@_6BitCountLoop:; [$9725]
[9725]INX; X++
[9726]SEC; X = 1
[9727]SBC #$06; A -= 6
[9729]BEQ @_resetLoop; If 0, break out of the loop.
[972b]BCS @_6BitCountLoop; Else, loop.
;
; Store the final expected 6 bit counter for the password state.
;
[972d]@_resetLoop:; [$972d]
[972d]STX a:Password_6BitCount; X = 6-bit counter
;
; Reset for a new password generation using the counter.
;
[9730]LDX #$00
[9732]STX a:Password_ByteCounter; Reset byte counter to 0.
[9735]STX a:Password_BitCounter; Reset bit counter to 0.
[9738]STX a:Password_Checksum; Reset checksum to 0.
;
; Encode the blank checksum.
;
[973b]LDY #$08; Y = 8 (value storage size in bits)
[973d]LDA #$00; A = 0 (checksum value)
[973f]JSR Password_EncodeValue; Encode the checksum value.
;
; Encode the 6-bit counter.
;
[9742]LDY #$05; Y = 5 (value storage size in bits)
[9744]LDA a:Password_6BitCount; A = 6 bit count value
[9747]JSR Password_EncodeValue; Encode the value.
;
; Encode the game state again.
;
[974a]JSR Password_EncodeGameState; Encode the game state.
[974d]JMP @_fillPaddedBits
;
; Encode a padding bits for any remaining bits.
;
[9750]@_fillPaddedBitsLoop:; [$9750]
[9750]LDY #$01; Y = 1 (value storage size in bits)
[9752]LDA #$00; A = 0 (value)
[9754]JSR Password_EncodeValue; Encode the padding.
[9757]@_fillPaddedBits:; [$9757]
[9757]LDA a:Password_BitCounter; A = current bit offset
[975a]BNE @_fillPaddedBitsLoop; If not 0, add our padding bit.
;
; Set the last byte to 0.
;
[975c]LDX a:Password_ByteCounter; X = byte counter
[975f]LDA #$00; A = 0
[9761]STA Password_EncodedState,X; Store as the final byte value.
;
; Set the checksum.
;
[9764]SEC
[9765]SBC a:Password_Checksum; Negate the checksum.
[9768]STA a:Password_EncodedState; Store as the first byte of the encoded state.
[976b]RTS
[976c]Password_EncodeGameState:; [$976c]
;
; Encode the temple spawn point.
;
[976c]LDA a:TempleSpawnPoint; A = Temple spawn point.
[976f]LDY #$03; Y = 3 (storage size in bits)
[9771]JSR Password_EncodeValue; Encode the spawn point.
;
; Encode the player's title.
;
[9774]LDA a:PlayerTitle; A = Player title.
[9777]LDY #$04; Y = 4 (storage size in bits)
[9779]JSR Password_EncodeValue; Encode the title.
;
; Encode the player's special items bitmask.
;
[977c]LDA a:SpecialItems; A = Special items bitmask.
[977f]LDY #$08; Y = 8 (storage size in bits)
[9781]JSR Password_EncodeValue; Encode the special items bitmask.
;
; Encode the completed quests.
;
[9784]LDA a:Quests; A = Quests bitmask.
[9787]LDY #$08; Y = 8 (storage size in bits)
[9789]JSR Password_EncodeValue; Encode the quests bitmask.
;
; Encode the selected weapon.
;
[978c]LDA a:SelectedWeapon; A = Selected weapon.
[978f]LDY #$02; Y = 2 (storage size in bits)
[9791]JSR Password_EncodeValueOrUnset; Encode the selected weapon.
;
; Encode the selected armor.
;
[9794]LDA a:SelectedArmor; A = Selected armor.
[9797]LDY #$02; Y = 2 (storage size in bits)
[9799]JSR Password_EncodeValueOrUnset; Encode the selected armor.
;
; Encode the selected shield.
;
[979c]LDA a:SelectedShield; A = Selected shield.
[979f]LDY #$02; Y = 2 (storage size in bits)
[97a1]JSR Password_EncodeValueOrUnset; Encode the selected shield.
;
; Encode the selected magic spell.
;
[97a4]LDA a:SelectedMagic; A = Selected magic.
[97a7]LDY #$03; Y = 3 (storage size in bits)
[97a9]JSR Password_EncodeValueOrUnset; Encode the selected magic.
;
; Encode the selected item.
;
[97ac]LDA a:SelectedItem; A = Selected item.
[97af]LDY #$05; Y = 5 (storage size in bits)
[97b1]JSR Password_EncodeValueOrUnset; Encode the selected item.
[97b4]LDA #$9d
[97b6]STA Temp_Int24_U
[97b8]LDA #$03
[97ba]STA Maybe_Temp4
;
; Encode the weapon inventory.
;
[97bc]LDY #$03; Y = 3 (storage size in bits)
[97be]LDX #$02; X = 2 (start offset)
[97c0]LDA a:NumberOfWeapons; A = Number of weapons.
[97c3]JSR Password_EncodeValueList; Encode the weapon inventory.
;
; Set the value to write to the address of 0x3a1.
;
; This hard-codes $03A1.
;
[97c6]LDA #$a1
[97c8]STA Temp_Int24_U
[97ca]LDA #$03
[97cc]STA Maybe_Temp4
;
; Encode the armor inventory.
;
[97ce]LDY #$03; Y = 3 (storage size in bits)
[97d0]LDX #$02; X = 2 (start offset)
[97d2]LDA a:NumberOfArmors; A = Number of armors.
[97d5]JSR Password_EncodeValueList; Encode the armor inventory.
;
; Set the value to write to the address of 0x3a5.
;
; This hard-codes $03A5.
;
[97d8]LDA #$a5
[97da]STA Temp_Int24_U
[97dc]LDA #$03
[97de]STA Maybe_Temp4
;
; Encode the shield inventory.
;
[97e0]LDY #$03; Y = 3 (storage size in bits)
[97e2]LDX #$02; X = 2 (start offset)
[97e4]LDA a:NumberOfShields; A = Number of shields.
[97e7]JSR Password_EncodeValueList; Encode the shield inventory.
;
; Set the value to write to the address of 0x3a9.
;
; This hard-codes $03A9.
;
[97ea]LDA #$a9
[97ec]STA Temp_Int24_U
[97ee]LDA #$03
[97f0]STA Maybe_Temp4
;
; Encode the magic inventory.
;
[97f2]LDY #$03; Y = 3 (storage size in bits)
[97f4]LDX #$03; X = 3 (start offset)
[97f6]LDA a:NumberOfMagicSpells; A = Number of magic spells.
[97f9]JSR Password_EncodeValueList; Encode the magic inventory.
;
; Set the value to write to the address of 0x3ad.
;
; This hard-codes $03AD.
;
[97fc]LDA #$ad
[97fe]STA Temp_Int24_U
[9800]LDA #$03
[9802]STA Maybe_Temp4
;
; Encode the item inventory.
;
[9804]LDY #$04; Y = 4 (storage size in bits)
[9806]LDX #$05; X = 5 (start offset)
[9808]LDA a:NumberOfItems; A = Number of items.
[980b]JSR Password_EncodeValueList; Encode the item inventory.
[980e]RTS
;============================================================================
; 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]
[980f]CMP #$ff; Is the value to encode 0xFF?
[9811]BEQ @_isUnset; If so, then jump.
;
; The value is set. First, push our value and storage size
; to the stack.
;
[9813]PHA; Push the value to the stack.
[9814]TYA; A = Y (storage size in bits)
[9815]PHA; Push the value to the stack.
;
; Encode the Set flag.
;
[9816]LDY #$01; Y = 1 (storage size in bits)
[9818]LDA #$01; A = 1 (set)
[981a]JSR Password_EncodeValue; Encode the value.
;
; Encode the value.
;
[981d]PLA; Pop the storage size in bits.
[981e]TAY; Y = result
[981f]PLA; Pop the value.
[9820]JMP Password_EncodeValue; Encode the value.
;
; The value is unset. Encode only the unset state.
;
[9823]@_isUnset:; [$9823]
[9823]LDY #$01; Y = 1 (storage size in bits)
[9825]LDA #$00; A = 0 (unset)
[9827]JMP 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]
[982a]BEQ @_encodeValue; If empty, just encode the value directly.
;
; Store A, X, and Y so we can work with these variables.
;
[982c]STA a:Password_TempA; Password_TempA = A
[982f]STY a:Password_TempY; Password_TempY = Y
[9832]STX a:Password_TempX; Password_TempX = X
;
; Encode the number of entries as a value. Roughly:
;
;
Password_EncodeValue(numEntries, startOffset, numBits)
;
[9835]JSR Password_EncodeValue; Encode that value.
;
; Prepare for the loop.
;
; Y is our counter.
;
Password_TempA is our upper bounds.
;
[9838]LDY #$00; Y = 0 (loop counter)
[983a]@_loop:; [$983a]
[983a]TYA; A = Y
[983b]PHA; Push A to stack
[983c]LDA (Temp_Int24_U),Y; A = value at bits offset
[983e]LDY a:Password_TempX; Y = Password_TempX (num bits)
[9841]JSR Password_EncodeValue; Encode this value.
;
; We're done encoding. See if we've reached the end
; of the encoding loop.
;
[9844]PLA; Pop A from stack
[9845]TAY; Y = A
[9846]INY; Y++
[9847]CPY a:Password_TempA; If Y != Password_TempA ...
[984a]BNE @_loop; ... Loop.
[984c]RTS
[984d]@_encodeValue:; [$984d]
[984d]JMP Password_EncodeValue
;============================================================================
; TODO: Document Password_Maybe_CheckPasswordLength
;
; INPUTS:
; None.
;
; OUTPUTS:
; C
;
; XREFS:
;
PasswordScreen_WaitForInput
;============================================================================
[9850]Password_Maybe_CheckPasswordLength:; [$9850]
[9850]LDX #$00
[9852]STX a:Password_ByteCounter
[9855]STX a:Password_BitCounter
[9858]STX a:Password_Checksum
[985b]LDY #$06
[985d]LDA ScreenBuffer,X
[9860]JSR Password_EncodeValue
[9863]INX
[9864]LDY #$06
[9866]LDA ScreenBuffer,X
[9869]JSR Password_EncodeValue
[986c]INX
[986d]LDY #$06
[986f]LDA ScreenBuffer,X
[9872]JSR Password_EncodeValue
[9875]INX
[9876]LDA a:Password_EncodedState_1_
[9879]LSR A
[987a]LSR A
[987b]LSR A
[987c]CMP a:Password_EnteredCharsLength
[987f]BNE @_returnTrue
[9881]@LAB_PRG12__9881:; [$9881]
[9881]LDY #$06
[9883]LDA ScreenBuffer,X
[9886]JSR Password_EncodeValue
[9889]INX
[988a]CPX a:Password_EnteredCharsLength
[988d]BNE @LAB_PRG12__9881
[988f]@LAB_PRG12__988f:; [$988f]
[988f]LDA a:Password_BitCounter
[9892]BEQ @LAB_PRG12__989e
[9894]LDY #$01
[9896]LDA #$00
[9898]JSR Password_EncodeValue
[989b]JMP @LAB_PRG12__988f
[989e]@LAB_PRG12__989e:; [$989e]
[989e]LDA a:Password_Checksum
[98a1]BNE @_returnTrue
[98a3]CLC
[98a4]RTS
[98a5]@_returnTrue:; [$98a5]
[98a5]SEC
[98a6]RTS
[98a7]Password_EncodeValue:; [$98a7]
[98a7]STA Temp_Int24; Temp_Int24 = A (character code value)
[98a9]TXA; A = X (character code offset)
[98aa]PHA; 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]STY Temp_Int24_M; Temp_Int24+1 = Y (number of bits)
[98ad]LDA #$08; A = 8 (bits in a byte)
[98af]SEC; C = 1
[98b0]SBC Temp_Int24_M; A = 8 - Temp_Int24+1 - (1 - C)
= 8 - Temp_Int24+1
= 8 - Y
If overflow, C = 0
[98b2]BEQ @_loop2; If A == 0, skip the bit offset math.
[98b4]STA 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]
[98b6]ASL Temp_Int24; Temp_Int24 *= 2
If overflow, C = 1
[98b8]DEC Temp_Int24_M; Temp_Int24+1--
[98ba]BNE @_loop1; If Temp_Int24+1 != 0, loop.
;
; Encode the character.
;
[98bc]@_loop2:; [$98bc]
[98bc]LDX 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]ROL 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]ROL 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]INC a:Password_BitCounter; Password_BitCounter++
[98c7]LDX a:Password_BitCounter; X = Password_BitCounter
[98ca]CPX #$08; If X != 8...
[98cc]BNE @_nextLoop; ... Jump
;
; We finished processing the byte. We can now update the
; checksum, reset the destination byte, and reset the dest
; bit counter.
;
[98ce]LDX a:Password_ByteCounter; X = Computed byte index
[98d1]LDA Password_EncodedState,X; A = Dest value
;
; Update the checksum value.
;
; The checksum is the sum of the character values computed.
;
[98d4]CLC; C = 0
[98d5]ADC a:Password_Checksum; Password_Checksum += A (dest value)
If overflow, C = 1
[98d8]STA a:Password_Checksum
;
; Increment the destination index and reset the bit counter.
;
[98db]INC a:Password_ByteCounter
[98de]LDX #$00
[98e0]STX a:Password_BitCounter
[98e3]@_nextLoop:; [$98e3]
[98e3]DEY; Y--
[98e4]BNE @_loop2; If not 0, loop.
;
; Restore the original value for X. This won't be modified.
;
[98e6]PLA; Pull A from stack.
[98e7]TAX; X = A. This is our result.
[98e8]RTS
[98e9]Password_DecodeValue:; [$98e9]
[98e9]TXA
[98ea]PHA
[98eb]LDA #$00
[98ed]@LAB_PRG12__98ed:; [$98ed]
[98ed]LDX a:Password_ByteCounter
[98f0]ASL Password_EncodedState,X
[98f3]ROL A
[98f4]INC a:Password_BitCounter
[98f7]LDX a:Password_BitCounter
[98fa]CPX #$08
[98fc]BNE @LAB_PRG12__9906
[98fe]INC a:Password_ByteCounter
[9901]LDX #$00
[9903]STX a:Password_BitCounter
[9906]@LAB_PRG12__9906:; [$9906]
[9906]DEY
[9907]BNE @LAB_PRG12__98ed
[9909]STA Temp_Int24
[990b]PLA
[990c]TAX
[990d]LDA Temp_Int24
[990f]RTS
[9910]IScripts_FillPlaceholderText:; [$9910]
;
; Clear the textbox and prepare to write to it.
;
[9910]JSR TextBox_ClearTextTiles; Clear the existing text tiles.
[9913]JSR PPU_SetAddrForTextBoxPos; Set the PPU address for the text position to write to.
;
; Write 4 lines of arbitrary characters.
;
[9916]LDY #$40
[9918]JSR TextBox_FillPlaceholderTextAtLineWithStartChar; Write "@ABCDEFGHIJKLMNO"
[991b]LDY #$50
[991d]JSR TextBox_FillPlaceholderTextAtLineWithStartChar; Write "PQRSTUVWXYZ[\]^_"
[9920]LDY #$60
[9922]JSR TextBox_FillPlaceholderTextAtLineWithStartChar; Write "`abcdefghijklmno"
[9925]LDY #$70
[9927]JMP TextBox_FillPlaceholderTextAtLineWithStartChar; Write "pqrstuvwxyz{|}~."
;============================================================================
; TODO: Document TextBox_CheckShouldContinue
;
; INPUTS:
; None.
;
; OUTPUTS:
; C
;
; XREFS:
;
IScriptAction_ShowUnskippableMessage
;============================================================================
[992a]TextBox_CheckShouldContinue:; [$992a]
[992a]LDA a:MessageID
[992d]BNE @LAB_PRG12__9938
;
; There is no message ID set.
;
[992f]JSR TextBox_DrawUpArrowTerminatorSymbol
[9932]LDA Joy1_ChangedButtonMask
[9934]BPL @LAB_PRG12__9947
[9936]SEC
[9937]RTS
[9938]@LAB_PRG12__9938:; [$9938]
[9938]LDA a:TextBox_MessagePaused
[993b]BEQ @LAB_PRG12__9947
;
; An existing message has ended.
;
[993d]JSR TextBox_DrawDownArrowTerminatorSymbol
[9940]LDA Joy1_ChangedButtonMask
[9942]BPL @LAB_PRG12__9947
[9944]JSR TextBox_PrepareContinueMessage
[9947]@LAB_PRG12__9947:; [$9947]
[9947]CLC
[9948]RTS
[9949]TextBox_PrepareContinueMessage:; [$9949]
[9949]LDA #$00
[994b]STA a:TextBox_MessagePaused
[994e]LDA #$04
[9950]STA a:Unused_Arg_Text_NumLines
[9953]JMP TextBox_ShowMessage_Prepare4Lines
[9956]TextBox_CheckShouldContinueOrDismissMessage:; [$9956]
[9956]LDA a:MessageID
[9959]BNE TextBox_CheckForDismiss
[995b]JSR TextBox_DrawUpArrowTerminatorSymbol
[995e]LDA Joy1_ChangedButtonMask
[9960]BMI IScripts_ReturnFalse
;
; v-- Fall through --v
;
;============================================================================
; Return whether the B button was pressed.
;
; This is used to dismiss textboxes.
;
; INPUTS:
;
Joy1_ChangedButtonMask:
; The changed buttons on controller 1.
;
; OUTPUTS:
; A:
; Set to 1.
;
; C:
; 0 = Not pressed.
; 1 = Pressed.
;
; XREFS:
;
TextBox_CheckForDismiss
;
TextBox_CheckShouldContinueOrDismissQuestion
;============================================================================
[9962]TextBox_IsBPressed:; [$9962]
[9962]LDA Joy1_ChangedButtonMask; Load the changed button mask.
[9964]ASL A; Shift B into Carry.
[9965]ASL A
[9966]LDA #$01; A = 1
[9968]RTS; Return.
;============================================================================
; TODO: Document TextBox_CheckForDismiss
;
; INPUTS:
; None.
;
; OUTPUTS:
; C
;
; XREFS:
;
TextBox_CheckShouldContinueOrDismissMessage
;============================================================================
[9969]TextBox_CheckForDismiss:; [$9969]
[9969]LDA a:TextBox_MessagePaused
[996c]BEQ TextBox_IsBPressed
[996e]JSR TextBox_DrawDownArrowTerminatorSymbol
[9971]LDA Joy1_ChangedButtonMask
[9973]BPL TextBox_IsBPressed
[9975]JSR TextBox_PrepareContinueMessage
[9978]CLC
[9979]LDA #$01
[997b]RTS
[997c]IScripts_ReturnFalse:; [$997c]
[997c]CLC
[997d]LDA #$00
[997f]RTS
[9980]TextBox_CheckShouldContinueOrDismissQuestion:; [$9980]
[9980]LDA a:MessageID
[9983]BNE @LAB_PRG12__998e
[9985]JSR TextBox_DrawQuestionMarkTerminatorSymbol
[9988]LDA Joy1_ChangedButtonMask
[998a]BMI IScripts_ReturnFalse
[998c]BPL TextBox_IsBPressed
[998e]@LAB_PRG12__998e:; [$998e]
[998e]LDA a:TextBox_MessagePaused
[9991]BEQ TextBox_IsBPressed
[9993]JSR TextBox_DrawDownArrowTerminatorSymbol
[9996]LDA Joy1_ChangedButtonMask
[9998]BPL TextBox_IsBPressed
[999a]JSR TextBox_PrepareContinueMessage
[999d]CLC
[999e]LDA #$01
[99a0]RETURN_99A0:; [$99a0]
[99a0]RTS
[99a1]TextBox_DrawDownArrowTerminatorSymbol:; [$99a1]
[99a1]LDA InterruptCounter; Load the interrupt counter.
[99a3]AND #$10; Is bit 5 set?
[99a5]BEQ RETURN_99A0; If not, return (allowing it to clear).
;
; Compute an X position for the symbol.
;
[99a7]LDA a:TextBox_X; Load the textbox X coordinate.
[99aa]ASL A; Convert to a pixel position.
[99ab]ASL A
[99ac]ASL A
[99ad]ADC #$4c; Add 76.
[99af]TAX; X = result.
;
; Compute a Y position for the symbol.
;
[99b0]LDA a:TextBox_Y; Load the textbox Y coordinate.
[99b3]ASL A; Convert to a pixel position.
[99b4]ASL A
[99b5]ASL A
[99b6]ADC #$10; Add 16.
[99b8]TAY; Y = result.
;
; Draw the symbol.
;
[99b9]LDA #$e5; A = 0xE5 (animation frame offset).
[99bb]JMP UI_DrawPromptInputSymbol; Draw the symbol.
[99be]TextBox_DrawUpArrowTerminatorSymbol:; [$99be]
[99be]LDA InterruptCounter; Load the interrupt counter.
[99c0]AND #$10; Is bit 5 set?
[99c2]BEQ RETURN_99A0; If not, return (allowing it to clear).
;
; Compute an X position for the symbol.
;
[99c4]LDA a:TextBox_X; Load the textbox X coordinate.
[99c7]ASL A; Convert to a pixel position.
[99c8]ASL A
[99c9]ASL A
[99ca]ADC #$8e; Add 142.
[99cc]TAX; X = result.
;
; Compute a Y position for the symbol.
;
[99cd]LDA a:TextBox_Y; Load the textbox Y coordinate.
[99d0]ASL A; Convert to a pixel position.
[99d1]ASL A
[99d2]ASL A
[99d3]ADC #$0e; Add 14.
[99d5]TAY; Y = result.
;
; Draw the symbol.
;
[99d6]LDA #$e6; A = 0xE6 (up arrow symbol).
[99d8]JMP 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]
[99db]LDA InterruptCounter; Load the interrupt counter.
[99dd]AND #$10; Is bit 5 set?
[99df]BEQ RETURN_99A0; If not, return (allowing it to clear).
;
; Compute an X position for the symbol.
;
[99e1]LDA a:TextBox_X; Load the textbox X coordinate.
[99e4]ASL A; Convert to a pixel position.
[99e5]ASL A
[99e6]ASL A
[99e7]ADC #$4c; Add 76.
[99e9]TAX; X = result.
;
; Compute a Y position for the symbol.
;
[99ea]LDA a:TextBox_Y; Load the textbox Y coordinate.
[99ed]ASL A; Convert to a pixel position.
[99ee]ASL A
[99ef]ASL A
[99f0]ADC #$10; Add 16.
[99f2]TAY; Y = result.
;
; Draw the symbol.
;
[99f3]LDA #$e7; A = 0xE7 (question mark symbol)
[99f5]JMP UI_DrawPromptInputSymbol; Draw the symbol.
;============================================================================
; TODO: Document Shop_Draw
;
; INPUTS:
; Y
;
; OUTPUTS:
; TODO
;
; XREFS:
;
IScriptAction_OpenShop
;
IScriptAction_ShowSellMenu
;============================================================================
[99f8]Shop_Draw:; [$99f8]
[99f8]LDA #$0a
[99fa]STA a:TextBox_X
[99fd]LDA #$08
[99ff]STA a:TextBox_Y
[9a02]LDA #$14
[9a04]STA a:TextBox_Width
[9a07]LDA #$14
[9a09]STA a:TextBox_Height
[9a0c]JSR TextBox_Open
[9a0f]LDA a:TextBox_Y
[9a12]CLC
[9a13]ADC #$02
[9a15]STA TextBox_ContentsY
[9a17]LDX #$00
[9a19]STX a:Menu_CursorPos
[9a1c]@LAB_PRG12__9a1c:; [$9a1c]
[9a1c]TXA
[9a1d]PHA
[9a1e]LDA a:TextBox_X
[9a21]CLC
[9a22]ADC #$02
[9a24]STA TextBox_ContentsX
[9a26]TXA
[9a27]PHA
[9a28]LDA DataArray,X
[9a2b]JSR TextBox_DrawItemImage
[9a2e]PLA
[9a2f]TAX
[9a30]LDA ShopItemCostsU,X
[9a33]PHA
[9a34]LDA ShopItemCostsL,X
[9a37]PHA
[9a38]LDA a:TextBox_X
[9a3b]CLC
[9a3c]ADC #$05
[9a3e]STA TextBox_ContentsX
[9a40]LDA DataArray,X
[9a43]JSR TextBox_DrawItemName
[9a46]PLA
[9a47]STA Temp_Int24
[9a49]PLA
[9a4a]STA Temp_Int24_M
[9a4c]LDA #$00
[9a4e]STA Temp_Int24_U
[9a50]LDA a:TextBox_X
[9a53]CLC
[9a54]ADC #$0d
[9a56]STA TextBox_ContentsX
[9a58]INC TextBox_ContentsY
[9a5a]LDY #$05
[9a5c]JSR UI_DrawDigitsNoLeadingZeroes
[9a5f]INC TextBox_ContentsY
[9a61]PLA
[9a62]TAX
[9a63]INX
[9a64]CPX a:Arg_StringsCount
[9a67]BNE @LAB_PRG12__9a1c
[9a69]RTS
[9a6a]Player_RemoveItem:; [$9a6a]
[9a6a]LDX #$00
[9a6c]CMP #$80
[9a6e]BEQ @_isSpecialItem
[9a70]INX
[9a71]CMP #$81
[9a73]BEQ @_isSpecialItem
[9a75]INX
[9a76]CMP #$82
[9a78]BEQ @_isSpecialItem
[9a7a]INX
[9a7b]CMP #$83
[9a7d]BEQ @_isSpecialItem
[9a7f]INX
[9a80]CMP #$92
[9a82]BEQ @_isSpecialItem
[9a84]INX
[9a85]CMP #$8a
[9a87]BEQ @_isSpecialItem
[9a89]INX
[9a8a]CMP #$93
[9a8c]BEQ @_isSpecialItem
[9a8e]INX
[9a8f]CMP #$94
[9a91]BEQ @_isSpecialItem
[9a93]STA Temp_Int24_U
[9a95]JSR Player_GetInventoryIndexForItem
[9a98]TAX
[9a99]LDA NumberOfWeapons,X
[9a9c]BEQ @_return
[9a9e]STA Maybe_Temp4
[9aa0]LDA INVENTORY_CATEGORY_L,X
[9aa3]STA Temp_Int24
[9aa5]LDA INVENTORY_CATEGORY_U,X
[9aa8]STA Temp_Int24_M
[9aaa]LDY #$00
[9aac]LDA Temp_Int24_U
[9aae]AND #$1f
[9ab0]@_inventoryCheckLoop:; [$9ab0]
[9ab0]CMP (Temp_Int24),Y
[9ab2]BEQ @_moveInventoryLoop
[9ab4]INY
[9ab5]CPY Maybe_Temp4
[9ab7]BNE @_inventoryCheckLoop
[9ab9]RTS
[9aba]@_moveInventoryLoop:; [$9aba]
[9aba]INY
[9abb]CPY Maybe_Temp4
[9abd]BEQ @_updateCountAndReturn
[9abf]LDA (Temp_Int24),Y
[9ac1]DEY
[9ac2]STA (Temp_Int24),Y
[9ac4]INY
[9ac5]BNE @_moveInventoryLoop
[9ac7]@_updateCountAndReturn:; [$9ac7]
[9ac7]DEC NumberOfWeapons,X
[9aca]@_return:; [$9aca]
[9aca]RTS
[9acb]@_isSpecialItem:; [$9acb]
[9acb]LDA a:SpecialItems
[9ace]AND SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS,X
[9ad1]STA a:SpecialItems
[9ad4]RTS
[9ad5]SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS:; [$9ad5]
[9ad5].byte $7f; [0]: Clear Ring of Elf
[9ad6]SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS_1_:; [$9ad6]
[9ad6].byte $bf; [1]: Clear Ring of Ruby
[9ad7]SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS_2_:; [$9ad7]
[9ad7].byte $df; [2]: Clear Ring of Dworf
[9ad8]SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS_3_:; [$9ad8]
[9ad8].byte $ef; [3]: Clear Demon's Ring
[9ad9]SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS_4_:; [$9ad9]
[9ad9].byte $f7; [4]: Clear Elixir
[9ada]SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS_5_:; [$9ada]
[9ada].byte $fb; [5]: Clear Magical Rod
[9adb]SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS_6_:; [$9adb]
[9adb].byte $fd; [6]: Clear Pendant
[9adc]SHOP_ITEM_TO_CLEAR_SPECIAL_ITEM_BITS_7_:; [$9adc]
[9adc].byte $fe; [7]: Clear Black Onyx
[9add]SPECIAL_ITEM_IDS:; [$9add]
[9add].byte SPECIAL_RING_OF_ELF; [0]:
[9ade].byte SPECIAL_RING_OF_RUBY; [1]:
[9adf].byte SPECIAL_RING_OF_DWORF; [2]:
[9ae0].byte SPECIAL_DEMONS_RING; [3]:
[9ae1].byte SPECIAL_ELIXIR; [4]:
[9ae2].byte SPECIAL_MAGICAL_ROD; [5]:
[9ae3]SPECIAL_ITEM_IDS_6_:; [$9ae3]
[9ae3].byte SPECIAL_PENDANT; [6]:
[9ae4]SPECIAL_ITEM_IDS_7_:; [$9ae4]
[9ae4].byte SPECIAL_BLACK_ONYX; [7]:
[9ae5]SPECIAL_ITEM_BITMASKS:; [$9ae5]
[9ae5].byte $80; [0]:
[9ae6].byte $40; [1]:
[9ae7].byte $20; [2]:
[9ae8].byte $10; [3]:
[9ae9].byte $08; [4]:
[9aea].byte $04; [5]:
[9aeb].byte $02; [6]:
[9aec]BYTE_PRG12__9aec:; [$9aec]
[9aec].byte $01; [$9aec] byte
;============================================================================
; TODO: Document Player_AddSpecialItem
;
; INPUTS:
; X
;
; OUTPUTS:
; TODO
;
; XREFS:
;
Player_AddToInventory
;============================================================================
[9aed]Player_AddSpecialItem:; [$9aed]
[9aed]LDA a:SpecialItems
[9af0]ORA SPECIAL_ITEM_BITMASKS,X
[9af3]STA a:SpecialItems
[9af6]RTS
[9af7]Player_AddToInventory:; [$9af7]
[9af7]LDX #$07; i = 7; Loop through item bits.
[9af9]@_checkSpecialItems:; [$9af9]
[9af9]CMP SPECIAL_ITEM_IDS,X; Check if this is a special, non-consumable item
[9afc]BEQ Player_AddSpecialItem; If this is a special item...
[9afe]DEX; Next i
[9aff]BPL @_checkSpecialItems
[9b01]STA Temp_Int24_U
[9b03]JSR Player_GetInventoryIndexForItem; Convert the item ID to a category.
[9b06]TAX
[9b07]LDA INVENTORY_CATEGORY_L,X
[9b0a]STA Temp_Int24
[9b0c]LDA INVENTORY_CATEGORY_U,X
[9b0f]STA Temp_Int24_M
;
; Check if the maximum has been reached for the inventory category.
;
[9b11]LDA NumberOfWeapons,X; Load the number of items in the inventory category
[9b14]CMP MAX_INVENTORY_SLOTS,X; Check if the max has been hit
[9b17]BNE @_addItem
[9b19]DEC NumberOfWeapons,X; The max has been hit. Remove one.
[9b1c]@_addItem:; [$9b1c]
[9b1c]LDY NumberOfWeapons,X
[9b1f]LDA Temp_Int24_U
[9b21]AND #$1f
[9b23]STA (Temp_Int24),Y
[9b25]INC NumberOfWeapons,X; Increase the length of the inventory
[9b28]RTS
[9b29]INVENTORY_CATEGORY_L:; [$9b29]
[9b29].byte $9d; [0]: Weapons
[9b2a].byte $a1; [1]: Armor
[9b2b].byte $a5; [2]: Shields
[9b2c].byte $a9; [3]: Magic
[9b2d]INVENTORY_CATEGORY_L_4_:; [$9b2d]
[9b2d].byte $ad; [4]: Items
[9b2e]INVENTORY_CATEGORY_U:; [$9b2e]
[9b2e].byte $03; [0]: Weapons
[9b2f].byte $03; [1]: Armor
[9b30].byte $03; [2]: Shields
[9b31].byte $03; [3]: Magic
[9b32]INVENTORY_CATEGORY_U_4_:; [$9b32]
[9b32].byte $03; [4]: Special
[9b33]ITEM_NAME_CATEGORIES_L:; [$9b33]
[9b33].byte <ITEM_NAMES_WEAPONS; [0]:
[9b34].byte <ITEM_NAMES_ARMOR; [1]:
[9b35].byte <ITEM_NAMES_SHIELDS; [2]:
[9b36].byte <ITEM_NAMES_MAGIC; [3]:
[9b37].byte <ITEM_NAMES_KEYS; [4]:
[9b38]ITEM_NAME_CATEGORIES_U:; [$9b38]
[9b38].byte >ITEM_NAMES_WEAPONS; [0]:
[9b39].byte >ITEM_NAMES_ARMOR; [1]:
[9b3a].byte >ITEM_NAMES_SHIELDS; [2]:
[9b3b].byte >ITEM_NAMES_MAGIC; [3]:
[9b3c].byte >ITEM_NAMES_KEYS; [4]:
[9b3d]ITEM_NAMES_WEAPONS:; [$9b3d]
[9b3d].byte $0d,"HAND DA"; [$9b3d] char
[9b45].byte "GGER "; [$9b45] char
[9b4d].byte $0d,"LONG SW"; [$9b4d] char
[9b55].byte "ORD "; [$9b55] char
[9b5d].byte $0d,"GIANT B"; [$9b5d] char
[9b65].byte "LADE "; [$9b65] char
[9b6d].byte $0d,"DRAGON "; [$9b6d] char
[9b75].byte "SLAYER "; [$9b75] char
[9b7d]ITEM_NAMES_ARMOR:; [$9b7d]
[9b7d].byte $0d,"LEATHER"; [$9b7d] char
[9b85].byte " ARMOR "; [$9b85] char
[9b8d].byte $0d,"STUDDED"; [$9b8d] char
[9b95].byte " MAIL "; [$9b95] char
[9b9d].byte $0d,"FULL PL"; [$9b9d] char
[9ba5].byte "ATE "; [$9ba5] char
[9bad].byte $0d,"BATTLE "; [$9bad] char
[9bb5].byte "SUIT "; [$9bb5] char
[9bbd]ITEM_NAMES_SHIELDS:; [$9bbd]
[9bbd].byte $0d,"SMALL S"; [$9bbd] char
[9bc5].byte "HIELD "; [$9bc5] char
[9bcd].byte $0d,"LARGE S"; [$9bcd] char
[9bd5].byte "HIELD "; [$9bd5] char
[9bdd].byte $0d,"MAGIC S"; [$9bdd] char
[9be5].byte "HIELD "; [$9be5] char
[9bed].byte $0d,"BATTLE "; [$9bed] char
[9bf5].byte "HELMET "; [$9bf5] char
[9bfd]ITEM_NAMES_MAGIC:; [$9bfd]
[9bfd].byte $0d,"DELUGE "; [$9bfd] char
[9c05].byte " "; [$9c05] char
[9c0d].byte $0d,"THUNDER"; [$9c0d] char
[9c15].byte " "; [$9c15] char
[9c1d].byte $0d,"FIRE "; [$9c1d] char
[9c25].byte " "; [$9c25] char
[9c2d].byte $0d,"DEATH "; [$9c2d] char
[9c35].byte " "; [$9c35] char
[9c3d].byte $0d,"TILTE "; [$9c3d] char
[9c45].byte " "; [$9c45] char
[9c4d]ITEM_NAMES_KEYS:; [$9c4d]
[9c4d].byte $0d,"RING OF"; [$9c4d] char
[9c55].byte " ELF "; [$9c55] char
[9c5d].byte $0d,"RUBY RI"; [$9c5d] char
[9c65].byte "NG "; [$9c65] char
[9c6d].byte $0d,"RING OF"; [$9c6d] char
[9c75].byte " DWORF "; [$9c75] char
[9c7d].byte $0d,"DEMONS "; [$9c7d] char
[9c85].byte "RING "; [$9c85] char
[9c8d].byte $0d,"KEY A "; [$9c8d] char
[9c95].byte " "; [$9c95] char
[9c9d].byte $0d,"KEY K "; [$9c9d] char
[9ca5].byte " "; [$9ca5] char
[9cad].byte $0d,"KEY Q "; [$9cad] char
[9cb5].byte " "; [$9cb5] char
[9cbd].byte $0d,"KEY J "; [$9cbd] char
[9cc5].byte " "; [$9cc5] char
[9ccd].byte $0d,"KEY JO "; [$9ccd] char
[9cd5].byte " "; [$9cd5] char
[9cdd].byte $0d,"MATTOCK"; [$9cdd] char
[9ce5].byte " "; [$9ce5] char
[9ced].byte $0d,"ROD "; [$9ced] char
[9cf5].byte " "; [$9cf5] char
[9cfd].byte $0d,"CRYSTAL"; [$9cfd] char
[9d05].byte " "; [$9d05] char
[9d0d].byte $0d,"LAMP "; [$9d0d] char
[9d15].byte " "; [$9d15] char
[9d1d].byte $0d,"HOUR GL"; [$9d1d] char
[9d25].byte "ASS "; [$9d25] char
[9d2d].byte $0d,"BOOK "; [$9d2d] char
[9d35].byte " "; [$9d35] char
[9d3d].byte $0d,"WING BO"; [$9d3d] char
[9d45].byte "OTS "; [$9d45] char
[9d4d].byte $0d,"RED POT"; [$9d4d] char
[9d55].byte "ION "; [$9d55] char
[9d5d].byte $0d,"BLACK P"; [$9d5d] char
[9d65].byte "OTION "; [$9d65] char
[9d6d].byte $0d,"ELIXIR "; [$9d6d] char
[9d75].byte " "; [$9d75] char
[9d7d].byte $0d,"PENDANT"; [$9d7d] char
[9d85].byte " "; [$9d85] char
[9d8d].byte $0d,"BLACK O"; [$9d8d] char
[9d95].byte "NIX "; [$9d95] char
[9d9d].byte $0d,"FIRE CR"; [$9d9d] char
[9da5].byte "YSTAL "; [$9da5] char
[9dad]STARTSCREEEN_PALETTE_SPRITES:; [$9dad]
[9dad].byte $0f; [0]:
[9dae].byte $00; [1]:
[9daf].byte $10; [2]:
[9db0].byte $20; [3]:
[9db1].byte $0f; [4]:
[9db2].byte $00; [5]:
[9db3].byte $10; [6]:
[9db4].byte $20; [7]:
[9db5].byte $0f; [8]:
[9db6].byte $00; [9]:
[9db7].byte $10; [10]:
[9db8].byte $20; [11]:
[9db9].byte $0f; [12]:
[9dba].byte $00; [13]:
[9dbb]STARTSCREEEN_PALETTE_SPRITES_14_:; [$9dbb]
[9dbb].byte $10; [14]:
[9dbc]STARTSCREEEN_PALETTE_SPRITES_15_:; [$9dbc]
[9dbc].byte $20; [15]:
[9dbd]TEXT_TILES_START:; [$9dbd]
[9dbd].byte $f2; [0]: S
[9dbe].byte $f3; [1]: T
[9dbf].byte $e0; [2]: A
[9dc0].byte $f1; [3]: R
[9dc1].byte $f3; [4]: T
[9dc2].byte $00; [5]: \0
[9dc3]TEXT_TILES_CONTINUE:; [$9dc3]
[9dc3].byte $e2; [0]: C
[9dc4].byte $ee; [1]: O
[9dc5].byte $ed; [2]: N
[9dc6].byte $f3; [3]: T
[9dc7].byte $e8; [4]: I
[9dc8].byte $ed; [5]: N
[9dc9].byte $f4; [6]: U
[9dca].byte $e4; [7]: E
[9dcb].byte $00; [8]: \0
[9dcc]TEXT_TILES_COPYRIGHT_1998_HUDSON_SOFT:; [$9dcc]
[9dcc].byte $fa; [0]: (C)
[9dcd].byte $20; [1]:
[9dce].byte $d7; [2]: 1
[9dcf].byte $df; [3]: 9
[9dd0].byte $de; [4]: 9
[9dd1].byte $de; [5]: 8
[9dd2].byte $20; [6]:
[9dd3].byte $e7; [7]: H
[9dd4].byte $f4; [8]: U
[9dd5].byte $e3; [9]: D
[9dd6].byte $f2; [10]: S
[9dd7].byte $ee; [11]: O
[9dd8].byte $ed; [12]: N
[9dd9].byte $20; [13]:
[9dda].byte $f2; [14]: S
[9ddb].byte $ee; [15]: O
[9ddc].byte $e5; [16]: F
[9ddd].byte $f3; [17]: T
[9dde].byte $00; [18]: \0
[9ddf]TEXT_TILES_UNDER_LICENSE_FROM_FALCOM:; [$9ddf]
[9ddf].byte $f4; [0]: U
[9de0].byte $ed; [1]: N
[9de1].byte $e3; [2]: D
[9de2].byte $e4; [3]: E
[9de3].byte $f1; [4]: R
[9de4].byte $20; [5]:
[9de5].byte $eb; [6]: L
[9de6].byte $e8; [7]: I
[9de7].byte $e2; [8]: C
[9de8].byte $e4; [9]: E
[9de9].byte $ed; [10]: N
[9dea].byte $f2; [11]: S
[9deb].byte $e4; [12]: E
[9dec].byte $20; [13]:
[9ded].byte $e5; [14]: F
[9dee].byte $f1; [15]: R
[9def].byte $ee; [16]: O
[9df0].byte $ec; [17]: M
[9df1].byte $20; [18]:
[9df2].byte $e5; [19]: F
[9df3].byte $e0; [20]: A
[9df4].byte $eb; [21]: L
[9df5].byte $e2; [22]: C
[9df6].byte $ee; [23]: O
[9df7].byte $ec; [24]: M
[9df8].byte $00; [25]: \0
[9df9]TEXT_TILES_LICENSED_TO_NINTENDO:; [$9df9]
[9df9].byte $eb; [0]: L
[9dfa].byte $e8; [1]: I
[9dfb].byte $e2; [2]: C
[9dfc].byte $e4; [3]: E
[9dfd].byte $ed; [4]: N
[9dfe].byte $f2; [5]: S
[9dff].byte $e4; [6]: E
[9e00].byte $e3; [7]: D
[9e01].byte $20; [8]:
[9e02].byte $f3; [9]: T
[9e03].byte $ee; [10]: O
[9e04].byte $20; [11]:
[9e05].byte $ed; [12]: N
[9e06].byte $e8; [13]: I
[9e07].byte $ed; [14]: N
[9e08].byte $f3; [15]: T
[9e09].byte $e4; [16]: E
[9e0a].byte $ed; [17]: N
[9e0b].byte $e3; [18]: D
[9e0c].byte $ee; [19]: O
[9e0d].byte $00; [20]: \0
;============================================================================
; TODO: Document UI_DrawText
;
; INPUTS:
; None.
;
; OUTPUTS:
; A
;
; XREFS:
;
PasswordScreen_Show
;
StartScreen_Draw
;============================================================================
[9e0e]UI_DrawText:; [$9e0e]
[9e0e]LDY #$00
[9e10]@_loop:; [$9e10]
[9e10]LDA (Temp_Int24),Y
[9e12]BEQ @_return
[9e14]CMP #$20
[9e16]BNE @_writePPUData
[9e18]LDA #$00
[9e1a]@_writePPUData:; [$9e1a]
[9e1a]STA a:PPUDATA
[9e1d]INY
[9e1e]BNE @_loop
[9e20]@_return:; [$9e20]
[9e20]RTS
;============================================================================
; TODO: Document StartScreen_Draw
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;============================================================================
[9e21]StartScreen_Draw:; [$9e21]
[9e21]JSR PPU_WaitUntilFlushed
;
; Write 224 Faxanadu logo tiles
;
; From: CHR ROM: Bank 10, 0x8E00:
CHR_FAXANADU_LOGO
; To: CHR RAM: 0x1000
;
[9e24]LDA #$00
[9e26]STA IScriptOrCHRAddr
[9e28]LDA #$8e
[9e2a]STA IScriptOrCHRAddr_U
[9e2c]LDA #$00
[9e2e]STA PPU_TargetAddr
[9e30]LDA #$10
[9e32]STA PPU_TargetAddr_U
[9e34]LDX #$0a
[9e36]LDY #$e0
[9e38]JSR PPU_WriteTilesFromCHRRAM
;
; Write 27 letter tiles:
;
; From: CHR ROM: Bank 10, 0x8240:
CHR_LETTERS
; To: CHR RAM: 0x1E00
;
[9e3b]LDA #$40
[9e3d]STA IScriptOrCHRAddr
[9e3f]LDA #$82
[9e41]STA IScriptOrCHRAddr_U
[9e43]LDA #$00
[9e45]STA PPU_TargetAddr
[9e47]LDA #$1e
[9e49]STA PPU_TargetAddr_U
[9e4b]LDX #$0a
[9e4d]LDY #$1b
[9e4f]JSR PPU_WriteTilesFromCHRRAM
;
; Write 10 number tiles:
;
; From: CHR ROM: Bank 10, 0x8440:
CHR_NUMBERS
; To: CHR RAM: 0x1D60
;
[9e52]LDA #$40
[9e54]STA IScriptOrCHRAddr
[9e56]LDA #$84
[9e58]STA IScriptOrCHRAddr_U
[9e5a]LDA #$60
[9e5c]STA PPU_TargetAddr
[9e5e]LDA #$1d
[9e60]STA PPU_TargetAddr_U
[9e62]LDX #$0a
[9e64]LDY #$0a
[9e66]JSR PPU_WriteTilesFromCHRRAM
[9e69]JSR PPU_ClearAllTilemaps
;
; Write 4 attribute values
;
; From: Bank 10, 0x9B60: PRG10:9B60
; To: Attribute table: 0x23C0
;
[9e6c]LDA #$60
[9e6e]STA IScriptOrCHRAddr
[9e70]LDA #$9b
[9e72]STA IScriptOrCHRAddr_U
[9e74]LDA #$c0
[9e76]STA PPU_TargetAddr
[9e78]LDA #$23
[9e7a]STA PPU_TargetAddr_U
[9e7c]LDX #$0a
[9e7e]LDY #$04
[9e80]JSR 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]LDA #$20
[9e85]STA a:PPUADDR
[9e88]LDA #$42
[9e8a]STA a:PPUADDR
[9e8d]LDA #$00
[9e8f]STA Temp_Int24
[9e91]LDA #$80
[9e93]STA Temp_Int24_M
[9e95]LDY #$00
[9e97]LDA #$10
[9e99]STA Temp_Int24_U
[9e9b]@LAB_PRG12__9e9b:; [$9e9b]
[9e9b]LDX #$1c
[9e9d]@LAB_PRG12__9e9d:; [$9e9d]
[9e9d]LDA (Temp_Int24),Y
[9e9f]STA a:PPUDATA
[9ea2]INY
[9ea3]BNE @LAB_PRG12__9ea7
[9ea5]INC Temp_Int24_M
[9ea7]@LAB_PRG12__9ea7:; [$9ea7]
[9ea7]DEX
[9ea8]BNE @LAB_PRG12__9e9d
[9eaa]LDA #$00
[9eac]STA a:PPUDATA
[9eaf]STA a:PPUDATA
[9eb2]STA a:PPUDATA
[9eb5]STA a:PPUDATA
[9eb8]DEC Temp_Int24_U
[9eba]BNE @LAB_PRG12__9e9b
[9ebc]LDA #$00
[9ebe]STA a:DAT_0687
;
; Set position to the start of "START" (0x2288) and
; draw the text tiles.
;
[9ec1]LDA #$22
[9ec3]STA a:PPUADDR
[9ec6]LDA #$88
[9ec8]STA a:PPUADDR
[9ecb]LDA #$bd
[9ecd]STA Temp_Int24
[9ecf]LDA #$9d
[9ed1]STA Temp_Int24_M
[9ed3]JSR UI_DrawText
;
; Set position to the start of "CONTINUE" (0x2290) and
; draw the text tiles.
;
[9ed6]LDA #$22
[9ed8]STA a:PPUADDR
[9edb]LDA #$90
[9edd]STA a:PPUADDR
[9ee0]LDA #$c3
[9ee2]STA Temp_Int24
[9ee4]LDA #$9d
[9ee6]STA Temp_Int24_M
[9ee8]JSR UI_DrawText
;
; Set position to the start of "(C) 1988 Hudson Soft" (0x22E7)
; and draw the text tiles.
;
[9eeb]LDA #$22
[9eed]STA a:PPUADDR
[9ef0]LDA #$e7
[9ef2]STA a:PPUADDR
[9ef5]LDA #$cc
[9ef7]STA Temp_Int24
[9ef9]LDA #$9d
[9efb]STA Temp_Int24_M
[9efd]JSR UI_DrawText
;
; Set position to the start of "Under license from Falcom" (0x2423)
; and draw the text tiles.
;
[9f00]LDA #$23
[9f02]STA a:PPUADDR
[9f05]LDA #$24
[9f07]STA a:PPUADDR
[9f0a]LDA #$df
[9f0c]STA Temp_Int24
[9f0e]LDA #$9d
[9f10]STA Temp_Int24_M
[9f12]JSR UI_DrawText
;
; Set position to the start of "Licensed to Nintendo" (0x2366)
; and draw the text tiles.
;
[9f15]LDA #$23
[9f17]STA a:PPUADDR
[9f1a]LDA #$66
[9f1c]STA a:PPUADDR
[9f1f]LDA #$f9
[9f21]STA Temp_Int24
[9f23]LDA #$9d
[9f25]STA Temp_Int24_M
[9f27]JSR UI_DrawText
[9f2a]LDA #$10
[9f2c]JSR Screen_LoadUIPalette
[9f2f]LDX #$0f
[9f31]@LAB_PRG12__9f31:; [$9f31]
[9f31]LDA STARTSCREEEN_PALETTE_SPRITES,X
[9f34]STA Screen_PaletteData_Sprites,X
[9f37]DEX
[9f38]BPL @LAB_PRG12__9f31
[9f3a]JSR PPUBuffer_WritePalette
[9f3d]LDA #$01
[9f3f]STA Music_Current
[9f41]JMP Screen_ResetForNonGame
;============================================================================
; TODO: Document StartScreen_CheckHandleInput
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;============================================================================
[9f44]StartScreen_CheckHandleInput:; [$9f44]
[9f44]LDA Joy1_ChangedButtonMask
[9f46]AND #$20
[9f48]BEQ @LAB_PRG12__9f57
[9f4a]LDA a:DAT_0687
[9f4d]EOR #$01
[9f4f]STA a:DAT_0687
[9f52]LDA #$0b
[9f54]JSR Sound_PlayEffect
[9f57]@LAB_PRG12__9f57:; [$9f57]
[9f57]LDY #$00
[9f59]LDA a:DAT_0687
[9f5c]BEQ @_drawCurrentItemSymbol
[9f5e]INY
;
; Draw the symbol used to show the current menu item selection.
;
[9f5f]@_drawCurrentItemSymbol:; [$9f5f]
[9f5f]LDX BYTE_ARRAY_PRG12__9f69,Y; X = menu item X position.
[9f62]LDY #$7e; Y = 126.
[9f64]LDA #$ad; A = 0xAD (right arrow symbol)
[9f66]JMP UI_DrawPromptInputSymbol; Draw the symbol.
[9f69]BYTE_ARRAY_PRG12__9f69:; [$9f69]
[9f69].byte $34; [0]:
[9f6a]BYTE_ARRAY_PRG12__9f69_1_:; [$9f6a]
[9f6a].byte $74; [1]:
;============================================================================
; Lower bytes of IScript addresses by entrypoint index.
;============================================================================
[9f6b]ISCRIPT_ADDRS_L:; [$9f6b]
[9f6b].byte $9f; [0]:
[9f6c].byte $a3; [1]:
[9f6d].byte $ad; [2]:
[9f6e].byte $b1; [3]:
[9f6f].byte $bc; [4]:
[9f70].byte $c9; [5]:
[9f71].byte $d3; [6]:
[9f72].byte $dd; [7]:
[9f73].byte $50; [8]:
[9f74].byte $ee; [9]:
[9f75].byte $f8; [10]:
[9f76].byte $a1; [11]:
[9f77].byte $fc; [12]:
[9f78].byte $7a; [13]:
[9f79].byte $5d; [14]:
[9f7a].byte $02; [15]:
[9f7b].byte $0b; [16]:
[9f7c].byte $16; [17]:
[9f7d].byte $21; [18]:
[9f7e].byte $2c; [19]:
[9f7f].byte $37; [20]:
[9f80].byte $a2; [21]:
[9f81].byte $3b; [22]:
[9f82].byte $46; [23]:
[9f83].byte $51; [24]:
[9f84].byte $8c; [25]:
[9f85].byte $0e; [26]:
[9f86].byte $55; [27]:
[9f87].byte $03; [28]:
[9f88].byte $9e; [29]:
[9f89].byte $9f; [30]:
[9f8a]ISCRIPT_ADDRS_L_31_:; [$9f8a]
[9f8a].byte $9b; [31]:
[9f8b].byte $57; [32]:
[9f8c].byte $62; [33]:
[9f8d].byte $6d; [34]:
[9f8e].byte $78; [35]:
[9f8f].byte $8a; [36]:
[9f90].byte $9e; [37]:
[9f91].byte $ab; [38]:
[9f92].byte $c3; [39]:
[9f93].byte $b0; [40]:
[9f94].byte $0c; [41]:
[9f95].byte $b1; [42]:
[9f96].byte $20; [43]:
[9f97].byte $ae; [44]:
[9f98].byte $9f; [45]:
[9f99].byte $9f; [46]:
[9f9a].byte $9f; [47]:
[9f9b].byte $d9; [48]:
[9f9c].byte $e4; [49]:
[9f9d].byte $ef; [50]:
[9f9e].byte $fa; [51]:
[9f9f].byte $05; [52]:
[9fa0].byte $10; [53]:
[9fa1].byte $1b; [54]:
[9fa2].byte $26; [55]:
[9fa3].byte $c0; [56]:
[9fa4].byte $c2; [57]:
[9fa5].byte $bb; [58]:
[9fa6].byte $32; [59]:
[9fa7].byte $d4; [60]:
[9fa8].byte $15; [61]:
[9fa9].byte $9f; [62]:
[9faa].byte $9f; [63]:
[9fab].byte $31; [64]:
[9fac].byte $3c; [65]:
[9fad].byte $47; [66]:
[9fae].byte $52; [67]:
[9faf].byte $66; [68]:
[9fb0].byte $71; [69]:
[9fb1].byte $7c; [70]:
[9fb2].byte $cf; [71]:
[9fb3].byte $e6; [72]:
[9fb4].byte $c8; [73]:
[9fb5].byte $44; [74]:
[9fb6].byte $68; [75]:
[9fb7].byte $1e; [76]:
[9fb8].byte $9f; [77]:
[9fb9].byte $9f; [78]:
[9fba].byte $9f; [79]:
[9fbb].byte $90; [80]:
[9fbc].byte $9b; [81]:
[9fbd].byte $a6; [82]:
[9fbe].byte $b8; [83]:
[9fbf].byte $c3; [84]:
[9fc0].byte $27; [85]:
[9fc1].byte $de; [86]:
[9fc2].byte $f8; [87]:
[9fc3].byte $d5; [88]:
[9fc4].byte $9f; [89]:
[9fc5].byte $9f; [90]:
[9fc6].byte $9f; [91]:
[9fc7].byte $9f; [92]:
[9fc8].byte $9f; [93]:
[9fc9].byte $9f; [94]:
[9fca].byte $9f; [95]:
[9fcb].byte $ce; [96]:
[9fcc].byte $d9; [97]:
[9fcd].byte $e4; [98]:
[9fce].byte $ef; [99]:
[9fcf].byte $fa; [100]:
[9fd0].byte $05; [101]:
[9fd1].byte $0a; [102]:
[9fd2].byte $e2; [103]:
[9fd3].byte $56; [104]:
[9fd4].byte $3d; [105]:
[9fd5].byte $9f; [106]:
[9fd6].byte $9f; [107]:
[9fd7].byte $9f; [108]:
[9fd8].byte $9f; [109]:
[9fd9].byte $9f; [110]:
[9fda].byte $9f; [111]:
[9fdb].byte $10; [112]:
[9fdc].byte $1b; [113]:
[9fdd].byte $26; [114]:
[9fde].byte $31; [115]:
[9fdf].byte $3c; [116]:
[9fe0].byte $1c; [117]:
[9fe1].byte $ef; [118]:
[9fe2].byte $68; [119]:
[9fe3].byte $46; [120]:
[9fe4].byte $4f; [121]:
[9fe5].byte $ed; [122]:
[9fe6].byte $54; [123]:
[9fe7].byte $58; [124]:
[9fe8].byte $5c; [125]:
[9fe9].byte $60; [126]:
[9fea].byte $64; [127]:
[9feb].byte $68; [128]:
[9fec].byte $6c; [129]:
[9fed].byte $70; [130]:
[9fee].byte $74; [131]:
[9fef].byte $78; [132]:
[9ff0].byte $7c; [133]:
[9ff1].byte $80; [134]:
[9ff2].byte $84; [135]:
[9ff3].byte $88; [136]:
[9ff4].byte $8c; [137]:
[9ff5].byte $90; [138]:
[9ff6].byte $94; [139]:
[9ff7].byte $98; [140]:
[9ff8].byte $9c; [141]:
[9ff9].byte $a0; [142]:
[9ffa].byte $a4; [143]:
[9ffb].byte $a8; [144]:
[9ffc].byte $ac; [145]:
[9ffd].byte $b0; [146]:
[9ffe].byte $b4; [147]:
[9fff].byte $b8; [148]:
[a000].byte $bc; [149]:
[a001].byte $c0; [150]:
[a002].byte $c4; [151]:
;============================================================================
; Upper bytes of IScript addresses by entrypoint index.
;============================================================================
[a003]ISCRIPT_ADDRS_U:; [$a003]
[a003].byte $a0; [0]:
[a004].byte $a0; [1]:
[a005].byte $a0; [2]:
[a006].byte $a0; [3]:
[a007].byte $a0; [4]:
[a008].byte $a0; [5]:
[a009].byte $a0; [6]:
[a00a].byte $a0; [7]:
[a00b].byte $a3; [8]:
[a00c].byte $a0; [9]:
[a00d].byte $a0; [10]:
[a00e].byte $a4; [11]:
[a00f].byte $a4; [12]:
[a010].byte $a3; [13]:
[a011].byte $a3; [14]:
[a012].byte $a1; [15]:
[a013].byte $a1; [16]:
[a014].byte $a1; [17]:
[a015].byte $a1; [18]:
[a016].byte $a1; [19]:
[a017].byte $a1; [20]:
[a018].byte $a5; [21]:
[a019].byte $a1; [22]:
[a01a].byte $a1; [23]:
[a01b].byte $a1; [24]:
[a01c].byte $a3; [25]:
[a01d].byte $a5; [26]:
[a01e].byte $a1; [27]:
[a01f].byte $a6; [28]:
[a020].byte $a3; [29]:
[a021].byte $a0; [30]:
[a022]ISCRIPT_ADDRS_U_31_:; [$a022]
[a022].byte $a0; [31]:
[a023].byte $a1; [32]:
[a024].byte $a1; [33]:
[a025].byte $a1; [34]:
[a026].byte $a1; [35]:
[a027].byte $a1; [36]:
[a028].byte $a1; [37]:
[a029].byte $a1; [38]:
[a02a].byte $a1; [39]:
[a02b].byte $a3; [40]:
[a02c].byte $a6; [41]:
[a02d].byte $a5; [42]:
[a02e].byte $a5; [43]:
[a02f].byte $a4; [44]:
[a030].byte $a0; [45]:
[a031].byte $a0; [46]:
[a032].byte $a0; [47]:
[a033].byte $a1; [48]:
[a034].byte $a1; [49]:
[a035].byte $a1; [50]:
[a036].byte $a1; [51]:
[a037].byte $a2; [52]:
[a038].byte $a2; [53]:
[a039].byte $a2; [54]:
[a03a].byte $a2; [55]:
[a03b].byte $a5; [56]:
[a03c].byte $a3; [57]:
[a03d].byte $a4; [58]:
[a03e].byte $a5; [59]:
[a03f].byte $a3; [60]:
[a040].byte $a6; [61]:
[a041].byte $a0; [62]:
[a042].byte $a0; [63]:
[a043].byte $a2; [64]:
[a044].byte $a2; [65]:
[a045].byte $a2; [66]:
[a046].byte $a2; [67]:
[a047].byte $a2; [68]:
[a048].byte $a2; [69]:
[a049].byte $a2; [70]:
[a04a].byte $a5; [71]:
[a04b].byte $a3; [72]:
[a04c].byte $a4; [73]:
[a04d].byte $a5; [74]:
[a04e].byte $a3; [75]:
[a04f].byte $a6; [76]:
[a050].byte $a0; [77]:
[a051].byte $a0; [78]:
[a052].byte $a0; [79]:
[a053].byte $a2; [80]:
[a054].byte $a2; [81]:
[a055].byte $a2; [82]:
[a056].byte $a2; [83]:
[a057].byte $a2; [84]:
[a058].byte $a6; [85]:
[a059].byte $a5; [86]:
[a05a].byte $a3; [87]:
[a05b].byte $a4; [88]:
[a05c].byte $a0; [89]:
[a05d].byte $a0; [90]:
[a05e].byte $a0; [91]:
[a05f].byte $a0; [92]:
[a060].byte $a0; [93]:
[a061].byte $a0; [94]:
[a062].byte $a0; [95]:
[a063].byte $a2; [96]:
[a064].byte $a2; [97]:
[a065].byte $a2; [98]:
[a066].byte $a2; [99]:
[a067].byte $a2; [100]:
[a068].byte $a3; [101]:
[a069].byte $a4; [102]:
[a06a].byte $a4; [103]:
[a06b].byte $a5; [104]:
[a06c].byte $a6; [105]:
[a06d].byte $a0; [106]:
[a06e].byte $a0; [107]:
[a06f].byte $a0; [108]:
[a070].byte $a0; [109]:
[a071].byte $a0; [110]:
[a072].byte $a0; [111]:
[a073].byte $a3; [112]:
[a074].byte $a3; [113]:
[a075].byte $a3; [114]:
[a076].byte $a3; [115]:
[a077].byte $a3; [116]:
[a078].byte $a4; [117]:
[a079].byte $a4; [118]:
[a07a].byte $a5; [119]:
[a07b].byte $a6; [120]:
[a07c].byte $a6; [121]:
[a07d].byte $a5; [122]:
[a07e].byte $a6; [123]:
[a07f].byte $a6; [124]:
[a080].byte $a6; [125]:
[a081].byte $a6; [126]:
[a082].byte $a6; [127]:
[a083].byte $a6; [128]:
[a084].byte $a6; [129]:
[a085].byte $a6; [130]:
[a086].byte $a6; [131]:
[a087].byte $a6; [132]:
[a088].byte $a6; [133]:
[a089].byte $a6; [134]:
[a08a].byte $a6; [135]:
[a08b].byte $a6; [136]:
[a08c].byte $a6; [137]:
[a08d].byte $a6; [138]:
[a08e].byte $a6; [139]:
[a08f].byte $a6; [140]:
[a090].byte $a6; [141]:
[a091].byte $a6; [142]:
[a092].byte $a6; [143]:
[a093].byte $a6; [144]:
[a094].byte $a6; [145]:
[a095].byte $a6; [146]:
[a096].byte $a6; [147]:
[a097].byte $a6; [148]:
[a098].byte $a6; [149]:
[a099].byte $a6; [150]:
[a09a].byte $a6; [151]:
;============================================================================
; Death screen.
;
; "Don't have negative thoughts. Remember your mantra."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f8a]
;============================================================================
[a09b]ISCRIPT_REMEMBER_YOUR_MANTRA:; [$a09b]
[a09b].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a09c].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Show MESSAGE_REMEMBER_YOUR_MANTRA.
[a09d].byte MESSAGEID_REMEMBER_YOUR_MANTRA; [$a09d] Message
[a09e].byte ISCRIPT_ACTION_END; End.
[a09f]ISCRIPT_INTRO:; [$a09f]
[a09f].byte ISCRIPT_ENTITY_GENERIC; Show a generic textbox.
[a0a0].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Show MESSAGE_INTRO.
[a0a1].byte MESSAGEID_INTRO; [$a0a1] Message
[a0a2].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]
;============================================================================
[a0a3]ISCRIPT_EOLIS_WALKING_MAN_1:; [$a0a3]
[a0a3].byte ISCRIPT_ENTITY_GENERIC; Show a generic textbox.
[a0a4].byte ISCRIPT_ACTION_CHECK_GOLD; Check if the player has any gold.
[a0a5].word @_ISCRIPT_NPC_FIRST_WALKING_MAN_GO_TO_APOLUNE; If yes, then jump.
[a0a7].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_GO_SEE_KING.
[a0a8].byte MESSAGEID_GO_SEE_KING; [$a0a8] Message
[a0a9].byte ISCRIPT_ACTION_END; End.
[a0aa]@_ISCRIPT_NPC_FIRST_WALKING_MAN_GO_TO_APOLUNE:; [$a0aa]
[a0aa].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DIRECTIONS_APOLUNE.
[a0ab].byte MESSAGEID_DIRECTIONS_APOLUNE; [$a0ab] Message
[a0ac].byte ISCRIPT_ACTION_END; End.
;============================================================================
; "There is a mark of Jack by the key hole."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f6d]
;============================================================================
[a0ad]ISCRIPT_MARK_OF_JACK:; [$a0ad]
[a0ad].byte ISCRIPT_ENTITY_GENERIC; Show a generic textbox.
[a0ae].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_MARK_OF_JACK.
[a0af].byte MESSAGEID_MARK_OF_JACK; [$a0af] Message
[a0b0].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f6e]
;============================================================================
[a0b1]ISCRIPT_EOLIS_WALKING_WOMAN_1:; [$a0b1]
[a0b1].byte ISCRIPT_ENTITY_GENERIC; Show a generic textbox.
[a0b2].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Ring of Elf.
[a0b3].byte SPECIAL_RING_OF_ELF; [$a0b3] InventoryItem
[a0b4].word @_ISCRIPT_A081_HAS_RING; If yes, jump.
[a0b6].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THIS_IS_EOLIS.
[a0b7].byte MESSAGEID_THIS_IS_EOLIS; [$a0b7] Message
[a0b8].byte ISCRIPT_ACTION_END; End.
[a0b9]@_ISCRIPT_A081_HAS_RING:; [$a0b9]
[a0b9].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_LOOK_FOR_RINGS.
[a0ba].byte MESSAGEID_LOOK_FOR_RINGS; [$a0ba] Message
[a0bb].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]
;============================================================================
[a0bc]ISCRIPT_EOLIS_GURU:; [$a0bc]
[a0bc].byte ISCRIPT_ENTITY_GURU; Show the Guru portrait text box.
[a0bd].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Ring of Elf.
[a0be].byte SPECIAL_RING_OF_ELF; [$a0be] InventoryItem
[a0bf].word @_ISCRIPT_GURU_EOLIS_HAS_RING; If yes, then jump.
[a0c1].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_TAKE_RING_TO_KING.
[a0c2].byte MESSAGEID_TAKE_RING_TO_KING; [$a0c2] Message
[a0c3].byte ISCRIPT_ACTION_ADD_ITEM; Add the Ring of Elf to the inventory.
[a0c4].byte SPECIAL_RING_OF_ELF; [$a0c4] InventoryItem
[a0c5].byte ISCRIPT_ACTION_END; End.
[a0c6]@_ISCRIPT_GURU_EOLIS_HAS_RING:; [$a0c6]
[a0c6].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_VISIT_GURUS_GET_TITLE.
[a0c7].byte MESSAGEID_VISIT_GURUS_GET_TITLE; [$a0c7] Message
[a0c8].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f70]
;============================================================================
[a0c9]ISCRIPT_EOLIS_WALKING_WOMAN_2:; [$a0c9]
[a0c9].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a0ca].byte ISCRIPT_ACTION_CHECK_GOLD; Check if the player has any gold.
[a0cb].word @_ISCRIPT_A0C9_HAS_GOLD; If yes, jump.
[a0cd].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_LAST_WELL_ALMOST_DRY.
[a0ce].byte MESSAGEID_LAST_WELL_ALMOST_DRY; [$a0ce] Message
[a0cf].byte ISCRIPT_ACTION_END; End.
[a0d0]@_ISCRIPT_A0C9_HAS_GOLD:; [$a0d0]
[a0d0].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THIS_IS_FOREPAW.
[a0d1].byte MESSAGEID_THIS_IS_FOREPAW; [$a0d1] Message
[a0d2].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]
;============================================================================
[a0d3]ISCRIPT_EOLIS_SMOKING_MAN:; [$a0d3]
[a0d3].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a0d4].byte ISCRIPT_ACTION_CHECK_GOLD; Check if the player has any gold.
[a0d5].word @_ISCRIPT_NPC_SMOKING_MAN_HAS_GOLD; If yes, jump.
[a0d7].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DWARVES_ARE_HERE.
[a0d8].byte MESSAGEID_DWARVES_ARE_HERE; [$a0d8] Message
[a0d9].byte ISCRIPT_ACTION_END; End.
[a0da]@_ISCRIPT_NPC_SMOKING_MAN_HAS_GOLD:; [$a0da]
[a0da].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DO_YOU_HAVE_WEAPON.
[a0db].byte MESSAGEID_DO_YOU_HAVE_WEAPON; [$a0db] Message
[a0dc].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]
;============================================================================
[a0dd]ISCRIPT_EOLIS_KINGS_GUARD:; [$a0dd]
[a0dd].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a0de].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Ring of Elf.
[a0df].byte SPECIAL_RING_OF_ELF; [$a0df] InventoryItem
[a0e0].word @_ISCRIPT_KINGS_GUARD_HAS_RING; If yes, jump.
[a0e2].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_CANT_LET_YOU_GO.
[a0e3].byte MESSAGEID_CANT_LET_YOU_GO; [$a0e3] Message
[a0e4].byte ISCRIPT_ACTION_END; End.
[a0e5]@_ISCRIPT_KINGS_GUARD_HAS_RING:; [$a0e5]
[a0e5].byte ISCRIPT_ACTION_CHECK_GOLD; Check if the player has any gold.
[a0e6].word @_ISCRIPT_KINGS_GUARD_HAS_GOLD; If yes, then jump.
[a0e8].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_KING_IS_WAITING.
[a0e9].byte MESSAGEID_KING_IS_WAITING; [$a0e9] Message
[a0ea].byte ISCRIPT_ACTION_END; End.
[a0eb]@_ISCRIPT_KINGS_GUARD_HAS_GOLD:; [$a0eb]
[a0eb].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_GOOD_LUCK.
[a0ec].byte MESSAGEID_GOOD_LUCK; [$a0ec] Message
[a0ed].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f74]
;============================================================================
[a0ee]ISCRIPT_A0EE:; [$a0ee]
[a0ee].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a0ef].byte ISCRIPT_ACTION_CHECK_GOLD; Check if the player has any gold.
[a0f0].word @_ISCRIPT_A0EE_HAS_GOLD; If yes, jump.
[a0f2].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DWARVES_ROBBING_ELVES.
[a0f3].byte MESSAGEID_DWARVES_ROBBING_ELVES; [$a0f3] Message
[a0f4].byte ISCRIPT_ACTION_END; End.
[a0f5]@_ISCRIPT_A0EE_HAS_GOLD:; [$a0f5]
[a0f5].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_METEORITE_EXPOSITION.
[a0f6].byte MESSAGEID_METEORITE_EXPOSITION; [$a0f6] Message
[a0f7].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f75]
;============================================================================
[a0f8]ISCRIPT_A0F8:; [$a0f8]
[a0f8].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a0f9].byte ISCRIPT_ACTION_CHECK_GOLD; Check if the player has any gold.
[a0fa].word @_ISCRIPT_A0F8_HAS_GOLD; If yes, jump.
[a0fc].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_LISTEN_TO_PEOPLE.
[a0fd].byte MESSAGEID_LISTEN_TO_PEOPLE; [$a0fd] Message
[a0fe].byte ISCRIPT_ACTION_END; End.
[a0ff]@_ISCRIPT_A0F8_HAS_GOLD:; [$a0ff]
[a0ff].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_TRY_TOO_HARD_2.
[a100].byte MESSAGEID_DONT_TRY_TOO_HARD_2; [$a100] Message
[a101].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]
;============================================================================
[a102]ISCRIPT_EOLIS_MARTIAL_ARTIST:; [$a102]
[a102].byte ISCRIPT_ENTITY_MARTIAL_ARTIST; Show a Martial Artist portrait text box.
[a103].byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show a dismissible MESSAGE_MARTIAL_ARTS_200G.
[a104].byte MESSAGEID_MARTIAL_ARTS_200G; [$a104] Message
[a105].byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 200G.
[a106].word $00c8; [$a106] ushort
.byte ISCRIPT_ACTION_ADD_HP; Add 40HP.
[a109].byte $28; [$a109] byte
.byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f7b]
;============================================================================
[a10b]ISCRIPT_A10B:; [$a10b]
[a10b].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a10c].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Small Shield.
[a10d].byte SHIELD_SMALL; [$a10d] InventoryItem
[a10e].word @_ISCRIPT_A10B_HAS_SMALL_SHIELD; If yes, jump.
[a110].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_WELCOME_TO_APOLUNE.
[a111].byte MESSAGEID_WELCOME_TO_APOLUNE; [$a111] Message
[a112].byte ISCRIPT_ACTION_END; End.
[a113]@_ISCRIPT_A10B_HAS_SMALL_SHIELD:; [$a113]
[a113].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DIRECTIONS_FOREPAW.
[a114].byte MESSAGEID_DIRECTIONS_FOREPAW; [$a114] Message
[a115].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f7c]
;============================================================================
[a116]ISCRIPT_A116:; [$a116]
[a116].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a117].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Small Shield.
[a118].byte SHIELD_SMALL; [$a118] InventoryItem
[a119].word @_ISCRIPT_A116_HAS_SMALL_SHIELD; If yes, jump.
[a11b].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DIRECTIONS_TO_TRUNK.
[a11c].byte MESSAGEID_DIRECTIONS_TO_TRUNK; [$a11c] Message
[a11d].byte ISCRIPT_ACTION_END; End.
[a11e]@_ISCRIPT_A116_HAS_SMALL_SHIELD:; [$a11e]
[a11e].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_GOOD_LUCK_2.
[a11f].byte MESSAGEID_GOOD_LUCK_2; [$a11f] Message
[a120].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f7d]
;============================================================================
[a121]ISCRIPT_A121:; [$a121]
[a121].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a122].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Small Shield.
[a123].byte SHIELD_SMALL; [$a123] InventoryItem
[a124].word @_ISCRIPT_A121_HAS_SMALL_SHIELD; If yes, jump.
[a126].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_SHOULD_HAVE_SHIELD.
[a127].byte MESSAGEID_SHOULD_HAVE_SHIELD; [$a127] Message
[a128].byte ISCRIPT_ACTION_END; End.
[a129]@_ISCRIPT_A121_HAS_SMALL_SHIELD:; [$a129]
[a129].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_MATTOCK_IN_TOWER.
[a12a].byte MESSAGEID_MATTOCK_IN_TOWER; [$a12a] Message
[a12b].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f7e]
;============================================================================
[a12c]ISCRIPT_A12C:; [$a12c]
[a12c].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a12d].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Small Shield.
[a12e].byte SHIELD_SMALL; [$a12e] InventoryItem
[a12f].word @_ISCRIPT_A12C_HAS_SMALL_SHIELD; If yes, jump.
[a131].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_BLOCKED_PASSAGE.
[a132].byte MESSAGEID_BLOCKED_PASSAGE; [$a132] Message
[a133].byte ISCRIPT_ACTION_END; End.
[a134]@_ISCRIPT_A12C_HAS_SMALL_SHIELD:; [$a134]
[a134].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_MATTOCK_BREAKS_WALL.
[a135].byte MESSAGEID_MATTOCK_BREAKS_WALL; [$a135] Message
[a136].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f7f]
;============================================================================
[a137]ISCRIPT_A137:; [$a137]
[a137].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a138].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_YOU_NEED_KEY.
[a139].byte MESSAGEID_YOU_NEED_KEY; [$a139] Message
[a13a].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f81]
;============================================================================
[a13b]ISCRIPT_A13B:; [$a13b]
[a13b].byte ISCRIPT_ENTITY_NURSE; [$a13b] IScriptEntity
[a13c].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Small Shield.
[a13d].byte SHIELD_SMALL; [$a13d] InventoryItem
[a13e].word @_ISCRIPT_A13B_HAS_SMALL_SHIELD; If yes, jump.
[a140].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DOCTOR_CAN_HELP.
[a141].byte MESSAGEID_DOCTOR_CAN_HELP; [$a141] Message
[a142].byte ISCRIPT_ACTION_END; End.
[a143]@_ISCRIPT_A13B_HAS_SMALL_SHIELD:; [$a143]
[a143].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_POISON_IS_BAD.
[a144].byte MESSAGEID_POISON_IS_BAD; [$a144] Message
[a145].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f82]
;============================================================================
[a146]ISCRIPT_A146:; [$a146]
[a146].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a147].byte ISCRIPT_ACTION_CHECK_PLAYER_RANK; Check if the player has reached Aspirant yet.
[a148].byte RANK_ASPIRANT; [$a148] PlayerTitle
[a149].word @_ISCRIPT_A146_HAS_ASPIRANT; If yes, jump.
[a14b].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_LEARN_MANTRAS.
[a14c].byte MESSAGEID_LEARN_MANTRAS; [$a14c] Message
[a14d].byte ISCRIPT_ACTION_END; End.
[a14e]@_ISCRIPT_A146_HAS_ASPIRANT:; [$a14e]
[a14e].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_SECRET_GURU_IN_TOWER.
[a14f].byte MESSAGEID_SECRET_GURU_IN_TOWER; [$a14f] Message
[a150].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f83]
;============================================================================
[a151]ISCRIPT_A151:; [$a151]
[a151].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a152].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_CARRY_ITEMS.
[a153].byte MESSAGEID_CARRY_ITEMS; [$a153] Message
[a154].byte ISCRIPT_ACTION_END; End.
;============================================================================
; An empty interaction.
;
; This immediately terminates.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f86]
;============================================================================
[a155]ISCRIPT_A155:; [$a155]
[a155].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a156].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f8b]
;============================================================================
[a157]ISCRIPT_FOREPAW_GREETER:; [$a157]
[a157].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a158].byte ISCRIPT_ACTION_CHECK_QUEST; Check if the player has completed the Spring of Trunk quest.
[a159].byte QUEST_SPRING_OF_TRUNK; [$a159] Quests
[a15a].word @_ISCRIPT_FOREPAW_GREETER_SPRING_OF_TRUNK_COMPLETE; If yes, jump.
[a15c].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_WELCOME_TO_FOREPAW.
[a15d].byte MESSAGEID_WELCOME_TO_FOREPAW; [$a15d] Message
[a15e].byte ISCRIPT_ACTION_END; End.
[a15f]@_ISCRIPT_FOREPAW_GREETER_SPRING_OF_TRUNK_COMPLETE:; [$a15f]
[a15f].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_FOUNTAIN_WILL_FLOW_TO_TOWN.
[a160].byte MESSAGEID_FOUNTAIN_WILL_FLOW_TO_TOWN; [$a160] Message
[a161].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f8c]
;============================================================================
[a162]ISCRIPT_A162:; [$a162]
[a162].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a163].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Ring of Ruby.
[a164].byte SPECIAL_RING_OF_RUBY; [$a164] InventoryItem
[a165].word @_ISCRIPT_A162_HAS_RING_OF_RUBY; If yes, jump.
[a167].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_FIND_3_SPRINGS.
[a168].byte MESSAGEID_FIND_3_SPRINGS; [$a168] Message
[a169].byte ISCRIPT_ACTION_END; End.
[a16a]@_ISCRIPT_A162_HAS_RING_OF_RUBY:; [$a16a]
[a16a].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_WATER_IS_FLOWING.
[a16b].byte MESSAGEID_WATER_IS_FLOWING; [$a16b] Message
[a16c].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f8d]
;============================================================================
[a16d]ISCRIPT_A16D:; [$a16d]
[a16d].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a16e].byte ISCRIPT_ACTION_CHECK_QUEST; Check if the player has completed the Spring of Trunk quest.
[a16f].byte QUEST_SPRING_OF_TRUNK; [$a16f] Quests
[a170].word @_ISCRIPT_A175; If yes, jump.
[a172].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_FOUNTAIN_IN_SKY.
[a173].byte MESSAGEID_FOUNTAIN_IN_SKY; [$a173] Message
[a174].byte ISCRIPT_ACTION_END; End.
[a175]@_ISCRIPT_A175:; [$a175]
[a175].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_PUSH_FOUNTAIN_ROCK.
[a176].byte MESSAGEID_PUSH_FOUNTAIN_ROCK; [$a176] Message
[a177].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f8e]
;============================================================================
[a178]ISCRIPT_A178:; [$a178]
[a178].byte ISCRIPT_ENTITY_NURSE; [$a178] IScriptEntity
[a179].byte ISCRIPT_ACTION_CHECK_QUEST; Check if the player has completed the Spring of Trunk quest.
[a17a].byte QUEST_SPRING_OF_TRUNK; [$a17a] Quests
[a17b].word @_ISCRIPT_A178_SPRING_OF_TRUNK_COMPLETED; If yes, jump.
[a17d].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_SPRING_IN_TOWER.
[a17e].byte MESSAGEID_SPRING_IN_TOWER; [$a17e] Message
[a17f].byte ISCRIPT_ACTION_END; End.
[a180]@_ISCRIPT_A178_SPRING_OF_TRUNK_COMPLETED:; [$a180]
[a180].byte ISCRIPT_ACTION_CHECK_QUEST; Check if the player has completed the Spring of Sky quest.
[a181].byte QUEST_SPRING_OF_SKY; [$a181] Quests
[a182].word @_ISCRIPT_A178_SPRING_OF_SKY_COMPLETED; If yes, jump.
[a184].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_WINGBOOTS_IN_TOWER.
[a185].byte MESSAGEID_WINGBOOTS_IN_TOWER; [$a185] Message
[a186].byte ISCRIPT_ACTION_END; End.
[a187]@_ISCRIPT_A178_SPRING_OF_SKY_COMPLETED:; [$a187]
[a187].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DIRECTIONS_TO_MASCON.
[a188].byte MESSAGEID_DIRECTIONS_TO_MASCON; [$a188] Message
[a189].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f8f]
;============================================================================
[a18a]ISCRIPT_A18A:; [$a18a]
[a18a].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a18b].byte ISCRIPT_ACTION_CHECK_QUEST; Check if the Spring of Sky quest is complete.
[a18c].byte QUEST_SPRING_OF_SKY; [$a18c] Quests
[a18d].word @_ISCRIPT_A18A_IS_COMPLETE; If yes, jump.
[a18f].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_FOUNTAIN_IN_SKY_HINT.
[a190].byte MESSAGEID_FOUNTAIN_IN_SKY_HINT; [$a190] Message
[a191].byte ISCRIPT_ACTION_END; End.
[a192]@_ISCRIPT_A18A_IS_COMPLETE:; [$a192]
[a192].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Joker key.
[a193].byte KEY_JO; [$a193] InventoryItem
[a194].word @_ISCRIPT_A192_HAS_JOKER; If yes, jump.
[a196].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_USE_THIS_KEY_FOR_FIRST_SPRING.
[a197].byte MESSAGEID_USE_THIS_KEY_FOR_FIRST_SPRING; [$a197] Message
[a198].byte ISCRIPT_ACTION_ADD_ITEM; Add the Joker key to the inventory.
[a199].byte KEY_JO; [$a199] InventoryItem
[a19a].byte ISCRIPT_ACTION_END; End.
[a19b]@_ISCRIPT_A192_HAS_JOKER:; [$a19b]
[a19b].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Show MESSAGE_GET_JOKER_OR_COME_BACK.
[a19c].byte MESSAGEID_GET_JOKER_OR_COME_BACK; [$a19c] Message
[a19d].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]
;============================================================================
[a19e]ISCRIPT_SPRING_OF_SKY:; [$a19e]
[a19e].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a19f].byte ISCRIPT_ACTION_CHECK_QUEST; Check if the Spring of Sky quest is complete.
[a1a0].byte QUEST_SPRING_OF_SKY; [$a1a0] Quests
[a1a1].word @_ISCRIPT_SPRING_OF_SKY_IS_COMPLETE; If it has, jump.
[a1a3].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_HO_HO_HO_ZZZ.
[a1a4].byte MESSAGEID_HO_HO_HO_ZZZ; [$a1a4] Message
[a1a5].byte ISCRIPT_ACTION_SET_QUEST_COMPLETE; Mark the Springs man as woken up.
[a1a6].byte QUEST_SPRING_OF_SKY; [$a1a6] Quests
[a1a7].byte ISCRIPT_ACTION_END; End
[a1a8]@_ISCRIPT_SPRING_OF_SKY_IS_COMPLETE:; [$a1a8]
[a1a8].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_GET_KEY_FIND_FOUNTAIN.
[a1a9].byte MESSAGEID_GET_KEY_FIND_FOUNTAIN; [$a1a9] Message
[a1aa].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]
;============================================================================
[a1ab]ISCRIPT_SPRING_OF_TRUNK:; [$a1ab]
[a1ab].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a1ac].byte ISCRIPT_ACTION_CHECK_QUEST; Check if the Spring of Trunk quest is complete.
[a1ad].byte QUEST_SPRING_OF_TRUNK; [$a1ad] Quests
[a1ae].word @_ISCRIPT_SPRING_OF_TRUNK_IS_COMPLETE; If yes, jump.
[a1b0].byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Else, show MESSAGE_THIS_IS_SPRING_OF_TRUNK_GET_ELIXIR.
[a1b1].byte MESSAGEID_THIS_IS_SPRING_OF_TRUNK_GET_ELIXIR; [$a1b1] Message
[a1b2].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Elixir.
[a1b3].byte SPECIAL_ELIXIR; [$a1b3] InventoryItem
[a1b4].word @_ISCRIPT_SPRING_OF_TRUNK_HAS_ELIXIR; If yes, jump.
[a1b6].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_COME_BACK_WITH_MEDICINE.
[a1b7].byte MESSAGEID_COME_BACK_WITH_MEDICINE; [$a1b7] Message
[a1b8].byte ISCRIPT_ACTION_END; End.
[a1b9]@_ISCRIPT_SPRING_OF_TRUNK_HAS_ELIXIR:; [$a1b9]
[a1b9].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Show MESSAGE_2_MORE_SPRINGS.
[a1ba].byte MESSAGEID_2_MORE_SPRINGS; [$a1ba] Message
[a1bb].byte ISCRIPT_ACTION_CONSUME_ITEM; Consume the player's Elixir.
[a1bc].byte SPECIAL_ELIXIR; [$a1bc] InventoryItem
[a1bd].byte ISCRIPT_ACTION_SET_QUEST_COMPLETE; Mark the Spring of Trunk as complete.
[a1be].byte QUEST_SPRING_OF_TRUNK; [$a1be] Quests
[a1bf].byte ISCRIPT_ACTION_END; End.
[a1c0]@_ISCRIPT_SPRING_OF_TRUNK_IS_COMPLETE:; [$a1c0]
[a1c0].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_FIND_POISON_IN_MASCON.
[a1c1].byte MESSAGEID_FIND_POISON_IN_MASCON; [$a1c1] Message
[a1c2].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f92]
;============================================================================
[a1c3]ISCRIPT_A1C3:; [$a1c3]
[a1c3].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box
[a1c4].byte ISCRIPT_ACTION_CHECK_QUEST; Check if all spring quests are complete.
[a1c5].byte $03; [$a1c5] Quests
[a1c6].word @_ISCRIPT_A1C3_COMPLETED_SPRINGS; If so, jump.
[a1c8].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_WILL_REVIVE_SPRING
[a1c9].byte MESSAGEID_WILL_REVIVE_SPRING; [$a1c9] Message
[a1ca].byte ISCRIPT_ACTION_SET_QUEST_COMPLETE; Mark all spring quests as complete.
[a1cb].byte $03; [$a1cb] Quests
[a1cc].byte ISCRIPT_ACTION_END; End.
[a1cd]@_ISCRIPT_A1C3_COMPLETED_SPRINGS:; [$a1cd]
[a1cd].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Ring of Ruby.
[a1ce].byte SPECIAL_RING_OF_RUBY; [$a1ce] InventoryItem
[a1cf].word @_ISCRIPT_A1CD_HAS_RING_OF_RUBY; If so, jump.
[a1d1].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_GIVING_RING_OF_RUBY
[a1d2].byte MESSAGEID_GIVING_RING_OF_RUBY; [$a1d2] Message
[a1d3].byte ISCRIPT_ACTION_ADD_ITEM; Give the player the Ring of Ruby.
[a1d4].byte SPECIAL_RING_OF_RUBY; [$a1d4] InventoryItem
[a1d5].byte ISCRIPT_ACTION_END; End.
[a1d6]@_ISCRIPT_A1CD_HAS_RING_OF_RUBY:; [$a1d6]
[a1d6].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_TRUST_YOUR_POWER
[a1d7].byte MESSAGEID_TRUST_YOUR_POWER; [$a1d7] Message
[a1d8].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f9b]
;============================================================================
[a1d9]ISCRIPT_A1D9:; [$a1d9]
[a1d9].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a1da].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Large Shield.
[a1db].byte SHIELD_LARGE; [$a1db] InventoryItem
[a1dc].word @_ISCRIPT_A1D9_HAS_LARGE_SHIELD; If so, jump.
[a1de].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_WELCOME_TO_MASCON
[a1df].byte MESSAGEID_WELCOME_TO_MASCON; [$a1df] Message
[a1e0].byte ISCRIPT_ACTION_END; End.
[a1e1]@_ISCRIPT_A1D9_HAS_LARGE_SHIELD:; [$a1e1]
[a1e1].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_PREPARE_BEFORE_FOREPAW.
[a1e2].byte MESSAGEID_PREPARE_BEFORE_FOREPAW; [$a1e2] Message
[a1e3].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f9c]
;============================================================================
[a1e4]ISCRIPT_A1E4:; [$a1e4]
[a1e4].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a1e5].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Pendant.
[a1e6].byte SPECIAL_PENDANT; [$a1e6] InventoryItem
[a1e7].word @_ISCRIPT_A1E4_HAS_PENDANT; If so, jump.
[a1e9].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_METEORITE_BECOMES_POISON
[a1ea].byte MESSAGEID_METEORITE_BECOMES_POISON; [$a1ea] Message
[a1eb].byte ISCRIPT_ACTION_END; End.
[a1ec]@_ISCRIPT_A1E4_HAS_PENDANT:; [$a1ec]
[a1ec].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DID_YOU_GET_PENDANT.
[a1ed].byte MESSAGEID_DID_YOU_GET_PENDANT; [$a1ed] Message
[a1ee].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f9d]
;============================================================================
[a1ef]ISCRIPT_A1EF:; [$a1ef]
[a1ef].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a1f0].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Large Shield.
[a1f1].byte SHIELD_LARGE; [$a1f1] InventoryItem
[a1f2].word @_ISCRIPT_A1EF_HAS_SHIELD; If so, branch.
[a1f4].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_STORES_OUTSIDE_TOWN
[a1f5].byte MESSAGEID_STORES_OUTSIDE_TOWN; [$a1f5] Message
[a1f6].byte ISCRIPT_ACTION_END; End.
[a1f7]@_ISCRIPT_A1EF_HAS_SHIELD:; [$a1f7]
[a1f7].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THIS_IS_LARGE_SHIELD.
[a1f8].byte MESSAGEID_THIS_IS_LARGE_SHIELD; [$a1f8] Message
[a1f9].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f9e]
;============================================================================
[a1fa]ISCRIPT_A1FA:; [$a1fa]
[a1fa].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a1fb].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Fire magic.
[a1fc].byte MAGIC_FIRE; [$a1fc] InventoryItem
[a1fd].word @_ISCRIPT_A1FA_HAS_FIRE; If so, jump.
[a1ff].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DIRECTIONS_TO_SUFFER.
[a200].byte MESSAGEID_DIRECTIONS_TO_SUFFER; [$a200] Message
[a201].byte ISCRIPT_ACTION_END; End.
[a202]@_ISCRIPT_A1FA_HAS_FIRE:; [$a202]
[a202].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_NEED_WING_BOOTS_FOR_MIST.
[a203].byte MESSAGEID_NEED_WING_BOOTS_FOR_MIST; [$a203] Message
[a204].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f9f]
;============================================================================
[a205]ISCRIPT_A205:; [$a205]
[a205].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a206].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Fire magic.
[a207].byte MAGIC_FIRE; [$a207] InventoryItem
[a208].word @_ISCRIPT_A205_HAS_FIRE; If so, jump.
[a20a].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_WELCOME_TO_MIST
[a20b].byte MESSAGEID_WELCOME_TO_MIST; [$a20b] Message
[a20c].byte ISCRIPT_ACTION_END; End.
[a20d]@_ISCRIPT_A205_HAS_FIRE:; [$a20d]
[a20d].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_HOUSE_OUTSIDE_ABANDONED.
[a20e].byte MESSAGEID_HOUSE_OUTSIDE_ABANDONED; [$a20e] Message
[a20f].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]
;============================================================================
[a210]ISCRIPT_OVERWORLD_MIST_HOUSE_MAN:; [$a210]
[a210].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a211].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Pendant.
[a212].byte SPECIAL_PENDANT; [$a212] InventoryItem
[a213].word @_ISCRIPT_OVERWORLD_MIST_HOUSE_MAN_HAS_PENDANT; If so, jump.
[a215].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_TOWER_OF_SUFFER_SOON.
[a216].byte MESSAGEID_TOWER_OF_SUFFER_SOON; [$a216] Message
[a217].byte ISCRIPT_ACTION_END; End.
[a218]@_ISCRIPT_OVERWORLD_MIST_HOUSE_MAN_HAS_PENDANT:; [$a218]
[a218].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_KEEP_PENDANT.
[a219].byte MESSAGEID_KEEP_PENDANT; [$a219] Message
[a21a].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]
;============================================================================
[a21b]ISCRIPT_OVERWORLD_MIST_HOUSE_WOMAN:; [$a21b]
[a21b].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a21c].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Pendant.
[a21d].byte SPECIAL_PENDANT; [$a21d] InventoryItem
[a21e].word @_ISCRIPT_OVERWORLD_MIST_HOUSE_WOMAN_HAS_PENDANT; If so, jump.
[a220].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DWARVES_CHANTING.
[a221].byte MESSAGEID_DWARVES_CHANTING; [$a221] Message
[a222].byte ISCRIPT_ACTION_END; End.
[a223]@_ISCRIPT_OVERWORLD_MIST_HOUSE_WOMAN_HAS_PENDANT:; [$a223]
[a223].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_METEORITE_WAS_MOVED.
[a224].byte MESSAGEID_METEORITE_WAS_MOVED; [$a224] Message
[a225].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fa2]
;============================================================================
[a226]ISCRIPT_A226:; [$a226]
[a226].byte ISCRIPT_ENTITY_NURSE; XXX Show a portrait box
[a227].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Hour Glass.
[a228].byte ITEM_HOUR_GLASS; [$a228] InventoryItem
[a229].word @_ISCRIPT_A226_HAS_HOURGLASS; If so, jump.
[a22b].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_HOUR_GLASS.
[a22c].byte MESSAGEID_HOUR_GLASS; [$a22c] Message
[a22d].byte ISCRIPT_ACTION_END; End.
[a22e]@_ISCRIPT_A226_HAS_HOURGLASS:; [$a22e]
[a22e].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_HOUR_GLASS_USES_ENERGY.
[a22f].byte MESSAGEID_HOUR_GLASS_USES_ENERGY; [$a22f] Message
[a230].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fab]
;============================================================================
[a231]ISCRIPT_A231:; [$a231]
[a231].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a232].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Thunder magic.
[a233].byte MAGIC_THUNDER; [$a233] InventoryItem
[a234].word @_ISCRIPT_A231_HAS_THUNDER; If so, jump.
[a236].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_WELCOME_TO_VICTIM.
[a237].byte MESSAGEID_WELCOME_TO_VICTIM; [$a237] Message
[a238].byte ISCRIPT_ACTION_END; End.
[a239]@_ISCRIPT_A231_HAS_THUNDER:; [$a239]
[a239].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DANGEROUS_WITHOUT_MAGIC.
[a23a].byte MESSAGEID_DANGEROUS_WITHOUT_MAGIC; [$a23a] Message
[a23b].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fac]
;============================================================================
[a23c]ISCRIPT_A23C:; [$a23c]
[a23c].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a23d].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Thunder magic.
[a23e].byte MAGIC_THUNDER; [$a23e] InventoryItem
[a23f].word @_ISCRIPT_A23C_HAS_THUNDER; If so, jump.
[a241].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_MAGIC_CONSUMES_POWER.
[a242].byte MESSAGEID_MAGIC_CONSUMES_POWER; [$a242] Message
[a243].byte ISCRIPT_ACTION_END; End.
[a244]@_ISCRIPT_A23C_HAS_THUNDER:; [$a244]
[a244].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_METEORITE_BECOMES_BLACK_ONYX.
[a245].byte MESSAGEID_METEORITE_BECOMES_BLACK_ONYX; [$a245] Message
[a246].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fad]
;============================================================================
[a247]ISCRIPT_A247:; [$a247]
[a247].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a248].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Thunder magic.
[a249].byte MAGIC_THUNDER; [$a249] InventoryItem
[a24a].word @_ISCRIPT_A247_HAS_THUNDER; If so, jump.
[a24c].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_MAGIC_HALL_OUTSIDE_TOWN.
[a24d].byte MESSAGEID_MAGIC_HALL_OUTSIDE_TOWN; [$a24d] Message
[a24e].byte ISCRIPT_ACTION_END; End.
[a24f]@_ISCRIPT_A247_HAS_THUNDER:; [$a24f]
[a24f].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_MAGIC_CANE.
[a250].byte MESSAGEID_MAGIC_CANE; [$a250] Message
[a251].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fae]
;============================================================================
[a252]ISCRIPT_A252:; [$a252]
[a252].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a253].byte ISCRIPT_ACTION_CHECK_PLAYER_RANK; Check if the Player has at least the Soldier rank.
[a254].byte RANK_SOLDIER; [$a254] PlayerTitle
[a255].word @_ISCRIPT_A252_HAS_RANK; If so, jump.
[a257].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_GO_TO_CAPITAL.
[a258].byte MESSAGEID_GO_TO_CAPITAL; [$a258] Message
[a259].byte ISCRIPT_ACTION_END; End.
[a25a]@_ISCRIPT_A252_HAS_RANK:; [$a25a]
[a25a].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Full Plate armor.
[a25b].byte ARMOR_FULL_PLATE; [$a25b] InventoryItem
[a25c].word @_ISCRIPT_A252_HAS_ARMOR; If so, jump.
[a25e].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_GOT_ARMOR_FOR_BOTTLE.
[a25f].byte MESSAGEID_GOT_ARMOR_FOR_BOTTLE; [$a25f] Message
[a260].byte ISCRIPT_ACTION_ADD_ITEM; Add the full plate to the inventory.
[a261].byte ARMOR_FULL_PLATE; [$a261] InventoryItem
[a262].byte ISCRIPT_ACTION_END; End.
[a263]@_ISCRIPT_A252_HAS_ARMOR:; [$a263]
[a263].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_ILL_HAVE_DRINK.
[a264].byte MESSAGEID_ILL_HAVE_DRINK; [$a264] Message
[a265].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9faf]
;============================================================================
[a266]ISCRIPT_A266:; [$a266]
[a266].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a267].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Thunder magic.
[a268].byte MAGIC_THUNDER; [$a268] InventoryItem
[a269].word @_ISCRIPT_A266_HAS_THUNDER; If so, jump.
[a26b].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_IM_LOST.
[a26c].byte MESSAGEID_IM_LOST; [$a26c] Message
[a26d].byte ISCRIPT_ACTION_END; End.
[a26e]@_ISCRIPT_A266_HAS_THUNDER:; [$a26e]
[a26e].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_IM_LOST_MAGIC_DOES_NOT_WORK.
[a26f].byte MESSAGEID_IM_LOST_MAGIC_DOES_NOT_WORK; [$a26f] Message
[a270].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fb0]
;============================================================================
[a271]ISCRIPT_A271:; [$a271]
[a271].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a272].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Thunder magic.
[a273].byte MAGIC_THUNDER; [$a273] InventoryItem
[a274].word @_ISCRIPT_A271_HAS_THUNDER; If so, branch.
[a276].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_MAGIC_OF_JUSTICE_OR_DESTRUCTION.
[a277].byte MESSAGEID_MAGIC_OF_JUSTICE_OR_DESTRUCTION; [$a277] Message
[a278].byte ISCRIPT_ACTION_END; End.
[a279]@_ISCRIPT_A271_HAS_THUNDER:; [$a279]
[a279].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_MAGIC_INDIVIDUAL_POWERS.
[a27a].byte MESSAGEID_MAGIC_INDIVIDUAL_POWERS; [$a27a] Message
[a27b].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fb1]
;============================================================================
[a27c]ISCRIPT_A27C:; [$a27c]
[a27c].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a27d].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Black Onyx.
[a27e].byte SPECIAL_BLACK_ONYX; [$a27e] InventoryItem
[a27f].word @_ISCRIPT_A27C_HAS_BLACK_ONYX; If so, jump.
[a281].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DIRECTIONS_TO_TOWER_OF_MIST.
[a282].byte MESSAGEID_DIRECTIONS_TO_TOWER_OF_MIST; [$a282] Message
[a283].byte ISCRIPT_ACTION_END; End.
[a284]@_ISCRIPT_A27C_HAS_BLACK_ONYX:; [$a284]
[a284].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the "A" key.
[a285].byte KEY_A; [$a285] InventoryItem
[a286].word @_ISCRIPT_A27C_HAS_KEY; If so, jump.
[a288].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_USE_KEY_FOR_CONFLATE.
[a289].byte MESSAGEID_USE_KEY_FOR_CONFLATE; [$a289] Message
[a28a].byte ISCRIPT_ACTION_ADD_ITEM; Add the "A" key to the inventory.
[a28b].byte KEY_A; [$a28b] InventoryItem
[a28c].byte ISCRIPT_ACTION_END; End.
[a28d]@_ISCRIPT_A27C_HAS_KEY:; [$a28d]
[a28d].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_YOU_NEED_KEY_ACE.
[a28e].byte MESSAGEID_YOU_NEED_KEY_ACE; [$a28e] Message
[a28f].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fbb]
;============================================================================
[a290]ISCRIPT_A290:; [$a290]
[a290].byte ISCRIPT_ENTITY_GENERIC; Show a generic textbox.
[a291].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Giant Blade.
[a292].byte WEAPON_GIANT_BLADE; [$a292] InventoryItem
[a293].word @_ISCRIPT_A290_HAS_GIANT_BLADE; If so, jump.
[a295].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_WELCOME_TO_CONFLATE.
[a296].byte MESSAGEID_WELCOME_TO_CONFLATE; [$a296] Message
[a297].byte ISCRIPT_ACTION_END; End.
[a298]@_ISCRIPT_A290_HAS_GIANT_BLADE:; [$a298]
[a298].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_LEGENDARY_SHIELD_HELMET.
[a299].byte MESSAGEID_LEGENDARY_SHIELD_HELMET; [$a299] Message
[a29a].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fbc]
;============================================================================
[a29b]ISCRIPT_A29B:; [$a29b]
[a29b].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a29c].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Giant Blade.
[a29d].byte WEAPON_GIANT_BLADE; [$a29d] InventoryItem
[a29e].word @_ISCRIPT_A29B_HAS_GIANT_BLADE; If so, jump.
[a2a0].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_TOWN_SURROUNDED_BY_DOORS.
[a2a1].byte MESSAGEID_TOWN_SURROUNDED_BY_DOORS; [$a2a1] Message
[a2a2].byte ISCRIPT_ACTION_END; End.
[a2a3]@_ISCRIPT_A29B_HAS_GIANT_BLADE:; [$a2a3]
[a2a3].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_SEE_GURU_AFTER_SHIELD_HELMET.
[a2a4].byte MESSAGEID_SEE_GURU_AFTER_SHIELD_HELMET; [$a2a4] Message
[a2a5].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fbd]
;============================================================================
[a2a6]ISCRIPT_A2A6:; [$a2a6]
[a2a6].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a2a7].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Ring of Dworf.
[a2a8].byte SPECIAL_RING_OF_DWORF; [$a2a8] InventoryItem
[a2a9].word @_ISCRIPT_A2A6_HAS_RING_OF_DWORF; If so, jump.
[a2ab].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_GUARDIAN_OF_GURU.
[a2ac].byte MESSAGEID_GUARDIAN_OF_GURU; [$a2ac] Message
[a2ad].byte ISCRIPT_ACTION_END; End.
[a2ae]@_ISCRIPT_A2A6_HAS_RING_OF_DWORF:; [$a2ae]
[a2ae].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Magical Rod.
[a2af].byte SPECIAL_MAGICAL_ROD; [$a2af] InventoryItem
[a2b0].word @_ISCRIPT_A2A6_HAS_MAGICAL_ROD; If so, jump.
[a2b2].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_SOMETHING_YOU_CAN_GET.
[a2b3].byte MESSAGEID_SOMETHING_YOU_CAN_GET; [$a2b3] Message
[a2b4].byte ISCRIPT_ACTION_END; End.
[a2b5]@_ISCRIPT_A2A6_HAS_MAGICAL_ROD:; [$a2b5]
[a2b5].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_RELY_ON_MAGIC_FINAL_BATTLE.
[a2b6].byte MESSAGEID_DONT_RELY_ON_MAGIC_FINAL_BATTLE; [$a2b6] Message
[a2b7].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fbe]
;============================================================================
[a2b8]ISCRIPT_A2B8:; [$a2b8]
[a2b8].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a2b9].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Battle Helmet.
[a2ba].byte SHIELD_BATTLE_HELMET; [$a2ba] InventoryItem
[a2bb].word @_ISCRIPT_A2B8_HAS_BATTLE_HELMET; If so, jump.
[a2bd].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_USED_TO_TRADE_WITH_DWARVES.
[a2be].byte MESSAGEID_USED_TO_TRADE_WITH_DWARVES; [$a2be] Message
[a2bf].byte ISCRIPT_ACTION_END; End.
[a2c0]@_ISCRIPT_A2B8_HAS_BATTLE_HELMET:; [$a2c0]
[a2c0].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_USED_TO_BE_SKILLED.
[a2c1].byte MESSAGEID_USED_TO_BE_SKILLED; [$a2c1] Message
[a2c2].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fbf]
;============================================================================
[a2c3]ISCRIPT_A2C3:; [$a2c3]
[a2c3].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a2c4].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Battle Helmet.
[a2c5].byte SHIELD_BATTLE_HELMET; [$a2c5] InventoryItem
[a2c6].word @_ISCRIPT_A2C3_HAS_BATTLE_HELMET; If so, jump.
[a2c8].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_USED_TO_VISIT_DWARVES.
[a2c9].byte MESSAGEID_USED_TO_VISIT_DWARVES; [$a2c9] Message
[a2ca].byte ISCRIPT_ACTION_END; End.
[a2cb]@_ISCRIPT_A2C3_HAS_BATTLE_HELMET:; [$a2cb]
[a2cb].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_AM_PICKPOCKET.
[a2cc].byte MESSAGEID_I_AM_PICKPOCKET; [$a2cc] Message
[a2cd].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fcb]
;============================================================================
[a2ce]ISCRIPT_A2CE:; [$a2ce]
[a2ce].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a2cf].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Tilte magic.
[a2d0].byte MAGIC_TILTE; [$a2d0] InventoryItem
[a2d1].word @_ISCRIPT_A2CE_HAS_TILTE; If so, jump.
[a2d3].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DIRECTIONS_DAYBREAK.
[a2d4].byte MESSAGEID_DIRECTIONS_DAYBREAK; [$a2d4] Message
[a2d5].byte ISCRIPT_ACTION_END; End.
[a2d6]@_ISCRIPT_A2CE_HAS_TILTE:; [$a2d6]
[a2d6].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_FRIENDS_IN_DARTMOOR.
[a2d7].byte MESSAGEID_FRIENDS_IN_DARTMOOR; [$a2d7] Message
[a2d8].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fcc]
;============================================================================
[a2d9]ISCRIPT_A2D9:; [$a2d9]
[a2d9].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a2da].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Battle Suit.
[a2db].byte ARMOR_BATTLE_SUIT; [$a2db] InventoryItem
[a2dc].word @_ISCRIPT_A2D9_HAS_BATTLE_SUIT; If so, jump.
[a2de].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_LOOK_FOR_BATTLE_SUIT.
[a2df].byte MESSAGEID_LOOK_FOR_BATTLE_SUIT; [$a2df] Message
[a2e0].byte ISCRIPT_ACTION_END; End.
[a2e1]@_ISCRIPT_A2D9_HAS_BATTLE_SUIT:; [$a2e1]
[a2e1].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_FIND_MAGIC_CANE.
[a2e2].byte MESSAGEID_FIND_MAGIC_CANE; [$a2e2] Message
[a2e3].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XXX Check if easter egg?
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fcd]
;============================================================================
[a2e4]ISCRIPT_A2E4:; [$a2e4]
[a2e4].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a2e5].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Ring of Dworf.
[a2e6].byte SPECIAL_RING_OF_DWORF; [$a2e6] InventoryItem
[a2e7].word @_ISCRIPT_A2E4_HAS_RING_OF_DWORF; If so, jump.
[a2e9].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_YOU_ARE_FAMOUS_GOOD_LOOKING.
[a2ea].byte MESSAGEID_YOU_ARE_FAMOUS_GOOD_LOOKING; [$a2ea] Message
[a2eb].byte ISCRIPT_ACTION_END; End.
[a2ec]@_ISCRIPT_A2E4_HAS_RING_OF_DWORF:; [$a2ec]
[a2ec].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_AUTOGRAPH.
[a2ed].byte MESSAGEID_AUTOGRAPH; [$a2ed] Message
[a2ee].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fce]
;============================================================================
[a2ef]ISCRIPT_A2EF:; [$a2ef]
[a2ef].byte ISCRIPT_ENTITY_NURSE; XXX Show a portrait text box
[a2f0].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Battle Suit.
[a2f1].byte ARMOR_BATTLE_SUIT; [$a2f1] InventoryItem
[a2f2].word @_ISCRIPT_A2EF_HAS_BATTLE_SUIT; If so, jump.
[a2f4].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_WHEN_TAKE_BATH.
[a2f5].byte MESSAGEID_WHEN_TAKE_BATH; [$a2f5] Message
[a2f6].byte ISCRIPT_ACTION_END; End.
[a2f7]@_ISCRIPT_A2EF_HAS_BATTLE_SUIT:; [$a2f7]
[a2f7].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_GURU_CONFLATE_HAS_RING_DWARVES.
[a2f8].byte MESSAGEID_GURU_CONFLATE_HAS_RING_DWARVES; [$a2f8] Message
[a2f9].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fcf]
;============================================================================
[a2fa]ISCRIPT_A2FA:; [$a2fa]
[a2fa].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a2fb].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Battle Suit.
[a2fc].byte ARMOR_BATTLE_SUIT; [$a2fc] InventoryItem
[a2fd].word @_ISCRIPT_A2FA_HAS_BATTLE_SUIT; If so, jump.
[a2ff].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DID_YOU_GET_BATTLE_SUIT.
[a300].byte MESSAGEID_DID_YOU_GET_BATTLE_SUIT; [$a300] Message
[a301].byte ISCRIPT_ACTION_END; End.
[a302]@_ISCRIPT_A2FA_HAS_BATTLE_SUIT:; [$a302]
[a302].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show, MESSAGE_DARTMORE_IS_MAZE.
[a303].byte MESSAGEID_DARTMORE_IS_MAZE; [$a303] Message
[a304].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fd0]
;============================================================================
[a305]ISCRIPT_A305:; [$a305]
[a305].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a306].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Battle Suit.
[a307].byte ARMOR_BATTLE_SUIT; [$a307] InventoryItem
[a308].word @_ISCRIPT_A305_HAS_BATTLE_SUIT; If so, jump.
[a30a].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_IS_FIRST_VISIT_TO_STORE.
[a30b].byte MESSAGEID_IS_FIRST_VISIT_TO_STORE; [$a30b] Message
[a30c].byte ISCRIPT_ACTION_END; End.
[a30d]@_ISCRIPT_A305_HAS_BATTLE_SUIT:; [$a30d]
[a30d].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_MAGIC_CANE_ABOVE_TOWER.
[a30e].byte MESSAGEID_MAGIC_CANE_ABOVE_TOWER; [$a30e] Message
[a30f].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fdb]
;============================================================================
[a310]ISCRIPT_A310:; [$a310]
[a310].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a311].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Dragon Slayer.
[a312].byte WEAPON_DRAGON_SLAYER; [$a312] InventoryItem
[a313].word @_ISCRIPT_A310_HAS_DRAGON_SLAYER; If so, jump.
[a315].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_DIRECTIONS_TO_FRATERNAL.
[a316].byte MESSAGEID_DIRECTIONS_TO_FRATERNAL; [$a316] Message
[a317].byte ISCRIPT_ACTION_END; End.
[a318]@_ISCRIPT_A310_HAS_DRAGON_SLAYER:; [$a318]
[a318].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_YOU_NEED_DEMONS_RING.
[a319].byte MESSAGEID_YOU_NEED_DEMONS_RING; [$a319] Message
[a31a].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]
;============================================================================
[a31b]ISCRIPT_OVERWORLD_HOUSE_MAN:; [$a31b]
[a31b].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a31c].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Dragon Slayer.
[a31d].byte WEAPON_DRAGON_SLAYER; [$a31d] InventoryItem
[a31e].word @_ISCRIPT_OVERWORLD_HOUSE_MAN_HAS_DRAGON_SLAYER; If so, jump.
[a320].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_KING_GRIEVE_HAS_DRAGON_SLAYER.
[a321].byte MESSAGEID_KING_GRIEVE_HAS_DRAGON_SLAYER; [$a321] Message
[a322].byte ISCRIPT_ACTION_END; End.
[a323]@_ISCRIPT_OVERWORLD_HOUSE_MAN_HAS_DRAGON_SLAYER:; [$a323]
[a323].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DEFEAT_EVIL_WITH_DRAGON_SLAYER.
[a324].byte MESSAGEID_DEFEAT_EVIL_WITH_DRAGON_SLAYER; [$a324] Message
[a325].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]
;============================================================================
[a326]ISCRIPT_OVERWORLD_HOUSE_WOMAN:; [$a326]
[a326].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a327].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Dragon Slayer.
[a328].byte WEAPON_DRAGON_SLAYER; [$a328] InventoryItem
[a329].word @_ISCRIPT_OVERWORLD_HOUSE_WOMAN_HAS_DRAGON_SLAYER; If so, jump.
[a32b].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_GO_TO_FRATERNAL_GURU.
[a32c].byte MESSAGEID_GO_TO_FRATERNAL_GURU; [$a32c] Message
[a32d].byte ISCRIPT_ACTION_END; End.
[a32e]@_ISCRIPT_OVERWORLD_HOUSE_WOMAN_HAS_DRAGON_SLAYER:; [$a32e]
[a32e].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_GURU_HAS_DEMONS_RING.
[a32f].byte MESSAGEID_GURU_HAS_DEMONS_RING; [$a32f] Message
[a330].byte ISCRIPT_ACTION_END; End.
;============================================================================
; TODO
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fde]
;============================================================================
[a331]ISCRIPT_A331:; [$a331]
[a331].byte ISCRIPT_ENTITY_GENERIC; Show a generic text box.
[a332].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Dragon Slayer.
[a333].byte WEAPON_DRAGON_SLAYER; [$a333] InventoryItem
[a334].word @_ISCRIPT_A331_HAS_DRAGON_SLAYER; If so, jump.
[a336].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_SEARCH_CASTLE_FOR_GURU.
[a337].byte MESSAGEID_SEARCH_CASTLE_FOR_GURU; [$a337] Message
[a338].byte ISCRIPT_ACTION_END; End.
[a339]@_ISCRIPT_A331_HAS_DRAGON_SLAYER:; [$a339]
[a339].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_EVIL_IMMUNE_TO_MAGIC.
[a33a].byte MESSAGEID_EVIL_IMMUNE_TO_MAGIC; [$a33a] Message
[a33b].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]
;============================================================================
[a33c]ISCRIPT_FRATERNAL_GURU:; [$a33c]
[a33c].byte ISCRIPT_ENTITY_GURU; Show the Guru portrait text box.
[a33d].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Dragon Slayer.
[a33e].byte WEAPON_DRAGON_SLAYER; [$a33e] InventoryItem
[a33f].word @_ISCRIPT_A33C_HAS_DRAGON_SLAYER; If so, jump.
[a341].byte ISCRIPT_ACTION_SHOW_MESSAGE; Else, show MESSAGE_METEORITE_EXPOSITION_2.
[a342].byte MESSAGEID_METEORITE_EXPOSITION_2; [$a342] Message
[a343].byte ISCRIPT_ACTION_END; End.
[a344]@_ISCRIPT_A33C_HAS_DRAGON_SLAYER:; [$a344]
[a344].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Demon's Ring.
[a345].byte SPECIAL_DEMONS_RING; [$a345] InventoryItem
[a346].word @_ISCRIPT_A33C_HAS_DEMONS_RING; If so, jump.
[a348].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_DEFEATED_KING_GRIEVE.
[a349].byte MESSAGEID_DEFEATED_KING_GRIEVE; [$a349] Message
[a34a].byte ISCRIPT_ACTION_ADD_ITEM; Add the Demon's Ring to the inventory.
[a34b].byte SPECIAL_DEMONS_RING; [$a34b] InventoryItem
[a34c].byte ISCRIPT_ACTION_END; End.
[a34d]@_ISCRIPT_A33C_HAS_DEMONS_RING:; [$a34d]
[a34d].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_ILL_MEDITATE_FOR_YOU.
[a34e].byte MESSAGEID_ILL_MEDITATE_FOR_YOU; [$a34e] Message
[a34f].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]
;============================================================================
[a350]ISCRIPT_EOLIS_KING:; [$a350]
[a350].byte ISCRIPT_ENTITY_KING; Show the King portrait text box.
[a351].byte ISCRIPT_ACTION_CHECK_GOLD; Check if the player has gold.
[a352].word @_ISCRIPT_NPC_KING_FOLLOW_UP_HAS_GOLD; If so, jump.
[a354].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Else, show MESSAGE_KING_EXPOSITION.
[a355].byte MESSAGEID_KING_EXPOSITION; [$a355] Message
[a356].byte ISCRIPT_ACTION_ADD_GOLD; Add 1500 gold.
[a357].word $05dc; [$a357] ushort
.byte ISCRIPT_ACTION_END; End.
[a35a]@_ISCRIPT_NPC_KING_FOLLOW_UP_HAS_GOLD:; [$a35a]
[a35a].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_NOTHING_MORE_TO_HELP.
[a35b].byte MESSAGEID_NOTHING_MORE_TO_HELP; [$a35b] Message
[a35c].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]
;============================================================================
[a35d]ISCRIPT_EOLIS_MARTIAL_ARTS_MAGIC_SHOP:; [$a35d]
[a35d].byte ISCRIPT_ENTITY_MAGICIAN; Show the Magician portrait text box.
[a35e].byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show a dismissible MESSAGE_MAGIC_200G.
[a35f].byte MESSAGEID_MAGIC_200G; [$a35f] Message
[a360].byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 200G.
[a361].word $00c8; [$a361] ushort
.byte ISCRIPT_ACTION_ADD_MP; Add 40MP.
[a364].byte $28; [$a364] byte
.byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Show MESSAGE_WATCH_POWER_LEVEL.
[a366].byte MESSAGEID_WATCH_POWER_LEVEL; [$a366] Message
[a367].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]
;============================================================================
[a368]ISCRIPT_AFTER_VICTIM_MAGIC_SHOP:; [$a368]
[a368].byte ISCRIPT_ENTITY_MAGICIAN; Show the Magician portrait text box.
[a369].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Fire magic.
[a36a].byte MAGIC_FIRE; [$a36a] InventoryItem
[a36b].word @_ISCRIPT_AFTER_VICTIM_MAGIC_SHOP_HAS_FIRE; If so, jump.
[a36d].byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Else, show a dismissible MESSAGE_MAGIC_FIRE_3000G.
[a36e].byte MESSAGEID_MAGIC_FIRE_3000G; [$a36e] Message
[a36f].byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 3000G.
[a370].word $0bb8; [$a370] ushort
.byte ISCRIPT_ACTION_ADD_ITEM; Add the Fire magic to the inventory.
[a373].byte MAGIC_FIRE; [$a373] InventoryItem
[a374].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Show MESSAGE_MAGIC_OF_JUSTICE_OR_DESTRUCTION.
[a375].byte MESSAGEID_MAGIC_OF_JUSTICE_OR_DESTRUCTION; [$a375] Message
[a376].byte ISCRIPT_ACTION_END; End.
[a377]@_ISCRIPT_AFTER_VICTIM_MAGIC_SHOP_HAS_FIRE:; [$a377]
[a377].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_RELY_ON_MAGIC.
[a378].byte MESSAGEID_DONT_RELY_ON_MAGIC; [$a378] Message
[a379].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the Eolis Tool Shop.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f78]
;============================================================================
[a37a]ISCRIPT_EOLIS_TOOL_SHOP:; [$a37a]
[a37a].byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box.
[a37b].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS.
[a37c].byte MESSAGEID_I_SELL_TOOLS; [$a37c] Message
[a37d].byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu.
[a37e].word @_ISCRIPT_EOLIS_TOOL_SHOP_BUY; If Buy, jump.
[a380].byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu.
[a381].word EOLIS_TOOL_SHOP_ITEMS; EOLIS_TOOL_SHOP_ITEMS [$PRG12::a381]
[a383].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a384].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a384] Message
[a385].byte ISCRIPT_ACTION_END; End.
[a386]@_ISCRIPT_EOLIS_TOOL_SHOP_BUY:; [$a386]
[a386].byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu.
[a387].word EOLIS_TOOL_SHOP_ITEMS; EOLIS_TOOL_SHOP_ITEMS [$PRG12::a387]
[a389].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a38a].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a38a] Message
[a38b].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the Apolune Tool Shop.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f84]
;============================================================================
[a38c]ISCRIPT_APOLUNE_TOOL_SHOP:; [$a38c]
[a38c].byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box.
[a38d].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS.
[a38e].byte MESSAGEID_I_SELL_TOOLS; [$a38e] Message
[a38f].byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu.
[a390].word @_ISCRIPT_APOLUNE_TOOL_SHOP_BUY; If Buy, jump.
[a392].byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu.
[a393].word APOLUNE_TOOL_SHOP_ITEMS; APOLUNE_TOOL_SHOP_ITEMS [$PRG12::a393]
[a395].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a396].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a396] Message
[a397].byte ISCRIPT_ACTION_END; End.
[a398]@_ISCRIPT_APOLUNE_TOOL_SHOP_BUY:; [$a398]
[a398].byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu.
[a399].word APOLUNE_TOOL_SHOP_ITEMS; Choose Buy
[a39b].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a39c].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a39c] Message
[a39d].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the Before-Apolune Tool Shop.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f88]
;============================================================================
[a39e]ISCRIPT_BEFORE_APOLUNE_TOOL_SHOP:; [$a39e]
[a39e].byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box.
[a39f].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS.
[a3a0].byte MESSAGEID_I_SELL_TOOLS; [$a3a0] Message
[a3a1].byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu.
[a3a2].word @_ISCRIPT_BEFORE_APOLUNE_TOOL_SHOP_BUY; If Buy, jump.
[a3a4].byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu.
[a3a5].word BEFORE_APOLUNE_TOOL_SHOP_ITEMS; BEFORE_APOLUNE_TOOL_SHOP_ITEMS [$PRG12::a3a5]
[a3a7].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a3a8].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a3a8] Message
[a3a9].byte ISCRIPT_ACTION_END; End.
[a3aa]@_ISCRIPT_BEFORE_APOLUNE_TOOL_SHOP_BUY:; [$a3aa]
[a3aa].byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu.
[a3ab].word BEFORE_APOLUNE_TOOL_SHOP_ITEMS; BEFORE_APOLUNE_TOOL_SHOP_ITEMS [$PRG12::a3ab]
[a3ad].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a3ae].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a3ae] Message
[a3af].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the Forepaw Tool Shop.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f93]
;============================================================================
[a3b0]ISCRIPT_FOREPAW_TOOL_SHOP:; [$a3b0]
[a3b0].byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box.
[a3b1].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS.
[a3b2].byte MESSAGEID_I_SELL_TOOLS; [$a3b2] Message
[a3b3].byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu.
[a3b4].word @_ISCRIPT_FOREPAW_TOOL_SHOP_BUY; If Buy, jump.
[a3b6].byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu.
[a3b7].word FOREPAW_TOOL_SHOP_ITEMS; FOREPAW_TOOL_SHOP_ITEMS [$PRG12::a3b7]
[a3b9].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a3ba].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a3ba] Message
[a3bb].byte ISCRIPT_ACTION_END; End.
[a3bc]@_ISCRIPT_FOREPAW_TOOL_SHOP_BUY:; [$a3bc]
[a3bc].byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu.
[a3bd].word FOREPAW_TOOL_SHOP_ITEMS; FOREPAW_TOOL_SHOP_ITEMS [$PRG12::a3bd]
[a3bf].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a3c0].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a3c0] Message
[a3c1].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the Mascon Tool Shop.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fa4]
;============================================================================
[a3c2]ISCRIPT_MASCON_TOOL_SHOP:; [$a3c2]
[a3c2].byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box.
[a3c3].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS.
[a3c4].byte MESSAGEID_I_SELL_TOOLS; [$a3c4] Message
[a3c5].byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu.
[a3c6].word @_ISCRIPT_MASCON_TOOL_SHOP_BUY; If Buy, jump.
[a3c8].byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu.
[a3c9].word MASCON_TOOL_SHOP_ITEMS; MASCON_TOOL_SHOP_ITEMS [$PRG12::a3c9]
[a3cb].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a3cc].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a3cc] Message
[a3cd].byte ISCRIPT_ACTION_END; End.
[a3ce]@_ISCRIPT_MASCON_TOOL_SHOP_BUY:; [$a3ce]
[a3ce].byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu.
[a3cf].word MASCON_TOOL_SHOP_ITEMS; MASCON_TOOL_SHOP_ITEMS [$PRG12::a3cf]
[a3d1].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a3d2].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a3d2] Message
[a3d3].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the After-Mascon Tool Shop.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fa7]
;============================================================================
[a3d4]ISCRIPT_AFTER_MASCON_TOOL_SHOP:; [$a3d4]
[a3d4].byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box.
[a3d5].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS.
[a3d6].byte MESSAGEID_I_SELL_TOOLS; [$a3d6] Message
[a3d7].byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu.
[a3d8].word @_ISCRIPT_AFTER_MASCON_TOOL_SHOP_BUY; If Buy, jump.
[a3da].byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu.
[a3db].word AFTER_MASCON_TOOL_SHOP_ITEMS; AFTER_MASCON_TOOL_SHOP_ITEMS [$PRG12::a3db]
[a3dd].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a3de].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a3de] Message
[a3df].byte ISCRIPT_ACTION_END; End.
[a3e0]@_ISCRIPT_AFTER_MASCON_TOOL_SHOP_BUY:; [$a3e0]
[a3e0].byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu.
[a3e1].word AFTER_MASCON_TOOL_SHOP_ITEMS; AFTER_MASCON_TOOL_SHOP_ITEMS [$PRG12::a3e1]
[a3e3].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a3e4].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a3e4] Message
[a3e5].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the Victim Tool Shop.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fb3]
;============================================================================
[a3e6]ISCRIPT_VICTIM_TOOL_SHOP:; [$a3e6]
[a3e6].byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box.
[a3e7].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS.
[a3e8].byte MESSAGEID_I_SELL_TOOLS; [$a3e8] Message
[a3e9].byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu.
[a3ea].word @_ISCRIPT_VICTIM_TOOL_SHOP_BUY; If Buy, jump.
[a3ec].byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu.
[a3ed].word VICTIM_TOOL_SHOP_ITEMS; VICTIM_TOOL_SHOP_ITEMS [$PRG12::a3ed]
[a3ef].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a3f0].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a3f0] Message
[a3f1].byte ISCRIPT_ACTION_END; End.
[a3f2]@_ISCRIPT_VICTIM_TOOL_SHOP_BUY:; [$a3f2]
[a3f2].byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu.
[a3f3].word VICTIM_TOOL_SHOP_ITEMS; VICTIM_TOOL_SHOP_ITEMS [$PRG12::a3f3]
[a3f5].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a3f6].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a3f6] Message
[a3f7].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the Conflate Tool Shop.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fc2]
;============================================================================
[a3f8]ISCRIPT_CONFLATE_TOOL_SHOP:; [$a3f8]
[a3f8].byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box.
[a3f9].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS.
[a3fa].byte MESSAGEID_I_SELL_TOOLS; [$a3fa] Message
[a3fb].byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu.
[a3fc].word @_ISCRIPT_CONFLATE_TOOL_SHOP_BUY; If Buy, jump.
[a3fe].byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu.
[a3ff].word CONFLATE_TOOL_SHOP_ITEMS; CONFLATE_TOOL_SHOP_ITEMS [$PRG12::a3ff]
[a401].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a402].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a402] Message
[a403].byte ISCRIPT_ACTION_END; End.
[a404]@_ISCRIPT_CONFLATE_TOOL_SHOP_BUY:; [$a404]
[a404].byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu.
[a405].word CONFLATE_TOOL_SHOP_ITEMS; CONFLATE_TOOL_SHOP_ITEMS [$PRG12::a405]
[a407].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a408].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a408] Message
[a409].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the Daybreak Tool Shop.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fd1]
;============================================================================
[a40a]ISCRIPT_DAYBREAK_TOOL_SHOP:; [$a40a]
[a40a].byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box.
[a40b].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS.
[a40c].byte MESSAGEID_I_SELL_TOOLS; [$a40c] Message
[a40d].byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu.
[a40e].word @_ISCRIPT_DAYBREAK_TOOL_SHOP_BUY; If Buy, jump.
[a410].byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu.
[a411].word DAYBREAK_TOOL_SHOP_ITEMS; DAYBREAK_TOOL_SHOP_ITEMS [$PRG12::a411]
[a413].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a414].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a414] Message
[a415].byte ISCRIPT_ACTION_END; End.
[a416]@_ISCRIPT_DAYBREAK_TOOL_SHOP_BUY:; [$a416]
[a416].byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu.
[a417].word DAYBREAK_TOOL_SHOP_ITEMS; DAYBREAK_TOOL_SHOP_ITEMS [$PRG12::a417]
[a419].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a41a].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a41a] Message
[a41b].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the Dartmoor Tool Shop.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fe0]
;============================================================================
[a41c]ISCRIPT_DARTMOOR_TOOL_SHOP:; [$a41c]
[a41c].byte ISCRIPT_ENTITY_TOOLS_SALESMAN; Show the tools salesman portrait text box.
[a41d].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_TOOLS.
[a41e].byte MESSAGEID_I_SELL_TOOLS; [$a41e] Message
[a41f].byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu.
[a420].word @_ISCRIPT_DARTMOOR_TOOL_SHOP_BUY; If Buy, jump.
[a422].byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell, show the sell menu.
[a423].word DARTMOOR_TOOL_SHOP_ITEMS; DARTMOOR_TOOL_SHOP_ITEMS [$PRG12::a423]
[a425].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a426].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a426] Message
[a427].byte ISCRIPT_ACTION_END; End.
[a428]@_ISCRIPT_DARTMOOR_TOOL_SHOP_BUY:; [$a428]
[a428].byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu.
[a429].word DARTMOOR_TOOL_SHOP_ITEMS; DARTMOOR_TOOL_SHOP_ITEMS [$PRG12::a429]
[a42b].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a42c].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a42c] Message
[a42d].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]
[a42e].byte WEAPON_HAND_DAGGER; [$a42e] InventoryItem
[a42f].word $0190; [$a42f] ushort
.byte ITEM_RED_POTION
[a432].word $00a0; [$a432] ushort
.byte SPECIAL_ELIXIR
[a435].word $0140; [$a435] ushort
.byte MAGIC_DELUGE
[a438].word $0190; [$a438] ushort
.byte $ff
;============================================================================
; Apolune Tool Shop Items.
;
; * Small Shield: 800G
; * Hand Dagger: 500G
; * Deluge: 500G
; * Red Potion: 300G
;============================================================================
[a43b]APOLUNE_TOOL_SHOP_ITEMS:; [$a43b]
[a43b].byte SHIELD_SMALL; [$a43b] InventoryItem
[a43c].word $0320; [$a43c] ushort
.byte WEAPON_HAND_DAGGER
[a43f].word $01f4; [$a43f] ushort
.byte MAGIC_DELUGE
[a442].word $01f4; [$a442] ushort
.byte ITEM_RED_POTION
[a445].word $012c; [$a445] ushort
.byte $ff
;============================================================================
; Before Apolune Tool Shop Items.
;
; * Magic Shield: 7600G
; * Death: 12500G
;============================================================================
[a448]BEFORE_APOLUNE_TOOL_SHOP_ITEMS:; [$a448]
[a448].byte SHIELD_MAGIC; [$a448] InventoryItem
[a449].word $1db0; [$a449] ushort
.byte MAGIC_DEATH
[a44c].word $30d4; [$a44c] ushort
.byte $ff
;============================================================================
; 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]
[a44f].byte WEAPON_LONG_SWORD; [$a44f] InventoryItem
[a450].word $0640; [$a450] ushort
.byte ARMOR_STUDDED_MAIL
[a453].word $09c4; [$a453] ushort
.byte SHIELD_SMALL
[a456].word $044c; [$a456] ushort
.byte ITEM_RED_POTION
[a459].word $0190; [$a459] ushort
.byte ITEM_WING_BOOTS
[a45c].word $0af0; [$a45c] ushort
.byte $ff
;============================================================================
; Mascon Tool Shop Items:
;
; * Large Shield: 3500G
; * Thunder: 1200G
; * Mattock: 800G
; * Red Potion: 600G
;============================================================================
[a45f]MASCON_TOOL_SHOP_ITEMS:; [$a45f]
[a45f].byte SHIELD_LARGE; [$a45f] InventoryItem
[a460].word $0dac; [$a460] ushort
.byte MAGIC_THUNDER
[a463].word $04b0; [$a463] ushort
.byte MATTOCK
[a466].word $0320; [$a466] ushort
.byte ITEM_RED_POTION
[a469].word $0258; [$a469] ushort
.byte $ff
;============================================================================
; After Mascon Tool Shop Items.
;
; * Death: 9800G
; * Hour Glass: 5600G
; * Elixir: 4300G
; * Red Potion: 300G
;============================================================================
[a46c]AFTER_MASCON_TOOL_SHOP_ITEMS:; [$a46c]
[a46c].byte MAGIC_DEATH; [$a46c] InventoryItem
[a46d].word $2648; [$a46d] ushort
.byte ITEM_HOUR_GLASS
[a470].word $15e0; [$a470] ushort
.byte SPECIAL_ELIXIR
[a473].word $10cc; [$a473] ushort
.byte ITEM_RED_POTION
[a476].word $012c; [$a476] ushort
.byte $ff
;============================================================================
; Victim Tool Shop Items.
;
; * Full Plate: 5200G
; * Mattock: 1200G
; * Red Potion: 800G
;============================================================================
[a479]VICTIM_TOOL_SHOP_ITEMS:; [$a479]
[a479].byte ARMOR_FULL_PLATE; [$a479] InventoryItem
[a47a].word $1450; [$a47a] ushort
.byte MATTOCK
[a47d].word $04b0; [$a47d] ushort
.byte ITEM_RED_POTION
[a480].word $0320; [$a480] ushort
.byte $ff
;============================================================================
; Conflate Tool Shop Items:
;
; * Giant Blade: 8500G
; * Magic Shield: 9800G
; * Wing Boots: 5500G
; * Red Potion: 1000G
;============================================================================
[a483]CONFLATE_TOOL_SHOP_ITEMS:; [$a483]
[a483].byte WEAPON_GIANT_BLADE; [$a483] InventoryItem
[a484].word $2134; [$a484] ushort
.byte SHIELD_MAGIC
[a487].word $2648; [$a487] ushort
.byte ITEM_WING_BOOTS
[a48a].word $157c; [$a48a] ushort
.byte ITEM_RED_POTION
[a48d].word $03e8; [$a48d] ushort
.byte $ff
;============================================================================
; Daybreak Tool Shop Items.
;
; * Tilte: 15000G
; * Giant Blade: 11500G
; * Red Potion: 1200G
;============================================================================
[a490]DAYBREAK_TOOL_SHOP_ITEMS:; [$a490]
[a490].byte MAGIC_TILTE; [$a490] InventoryItem
[a491].word $3a98; [$a491] ushort
.byte WEAPON_GIANT_BLADE
[a494].word $2cec; [$a494] ushort
.byte ITEM_RED_POTION
[a497].word $04b0; [$a497] ushort
.byte $ff
;============================================================================
; Dartmoor Tool Shop Items.
;
; * Giant Blade: 13000G
; * Red Potion: 2000G
;============================================================================
[a49a]DARTMOOR_TOOL_SHOP_ITEMS:; [$a49a]
[a49a].byte WEAPON_GIANT_BLADE; [$a49a] InventoryItem
[a49b].word $32c8; [$a49b] ushort
.byte ITEM_RED_POTION
[a49e].word $07d0; [$a49e] ushort
.byte $ff
;============================================================================
; Interaction with the Eolis Meat Shop.
;
; The shop keeper will offer 30HP and 30MP for 50G.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f76]
;============================================================================
[a4a1]ISCRIPT_EOLIS_MEAT_SHOP:; [$a4a1]
[a4a1].byte ISCRIPT_ENTITY_MEAT_SALESMAN; Show the meat shop salesman portrait text box.
[a4a2].byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show MESSAGE_DRIED_MEAT_50G.
[a4a3].byte MESSAGEID_DRIED_MEAT_50G; [$a4a3] Message
[a4a4].byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 50G.
[a4a5].word $0032; [$a4a5] ushort
.byte ISCRIPT_ACTION_ADD_HP; Add 30HP.
[a4a8].byte $1e; [$a4a8] byte
.byte ISCRIPT_ACTION_ADD_MP; Add 30MP.
[a4aa].byte $1e; [$a4aa] byte
.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a4ac].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a4ac] Message
[a4ad].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]
;============================================================================
[a4ae]ISCRIPT_FOREPAW_MEAT_SHOP:; [$a4ae]
[a4ae].byte ISCRIPT_ENTITY_MEAT_SALESMAN; Show the meat shop salesman portrait text box.
[a4af].byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show MESSAGE_DRIED_MEAT_150G.
[a4b0].byte MESSAGEID_DRIED_MEAT_150G; [$a4b0] Message
[a4b1].byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 150G.
[a4b2].word $0096; [$a4b2] ushort
.byte ISCRIPT_ACTION_ADD_HP; Add 30HP.
[a4b5].byte $1e; [$a4b5] byte
.byte ISCRIPT_ACTION_ADD_MP; Add 30MP.
[a4b7].byte $1e; [$a4b7] byte
.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a4b9].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a4b9] Message
[a4ba].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]
;============================================================================
[a4bb]ISCRIPT_MASCON_MEAT_SHOP:; [$a4bb]
[a4bb].byte ISCRIPT_ENTITY_MEAT_SALESMAN; Show the meat shop salesman portrait text box.
[a4bc].byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show MESSAGE_DRIED_MEAT_180G.
[a4bd].byte MESSAGEID_DRIED_MEAT_180G; [$a4bd] Message
[a4be].byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 180G.
[a4bf].word $00b4; [$a4bf] ushort
.byte ISCRIPT_ACTION_ADD_HP; Add 30HP.
[a4c2].byte $1e; [$a4c2] byte
.byte ISCRIPT_ACTION_ADD_MP; Add 30MP.
[a4c4].byte $1e; [$a4c4] byte
.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a4c6].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a4c6] Message
[a4c7].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]
;============================================================================
[a4c8]ISCRIPT_VICTIM_MEAT_SHOP:; [$a4c8]
[a4c8].byte ISCRIPT_ENTITY_MEAT_SALESMAN; Show the meat shop salesman portrait text box.
[a4c9].byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show MESSAGE_DRIED_MEAT_250G.
[a4ca].byte MESSAGEID_DRIED_MEAT_250G; [$a4ca] Message
[a4cb].byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 250G.
[a4cc].word $00fa; [$a4cc] ushort
.byte ISCRIPT_ACTION_ADD_HP; Add 30HP.
[a4cf].byte $1e; [$a4cf] byte
.byte ISCRIPT_ACTION_ADD_MP; Add 30MP.
[a4d1].byte $1e; [$a4d1] byte
.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a4d3].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a4d3] Message
[a4d4].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]
;============================================================================
[a4d5]ISCRIPT_CONFLATE_MEAT_SHOP:; [$a4d5]
[a4d5].byte ISCRIPT_ENTITY_MEAT_SALESMAN; Show the meat shop salesman portrait text box.
[a4d6].byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show MESSAGE_DRIED_MEAT_350G.
[a4d7].byte MESSAGEID_DRIED_MEAT_350G; [$a4d7] Message
[a4d8].byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 350G.
[a4d9].word $015e; [$a4d9] ushort
.byte ISCRIPT_ACTION_ADD_HP; Add 30HP.
[a4dc].byte $1e; [$a4dc] byte
.byte ISCRIPT_ACTION_ADD_MP; Add 30MP.
[a4de].byte $1e; [$a4de] byte
.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a4e0].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a4e0] Message
[a4e1].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]
;============================================================================
[a4e2]ISCRIPT_DAYBREAK_MEAT_SHOP:; [$a4e2]
[a4e2].byte ISCRIPT_ENTITY_MEAT_SALESMAN; Show the meat shop salesman portrait text box.
[a4e3].byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show MESSAGE_DRIED_MEAT_500G.
[a4e4].byte MESSAGEID_DRIED_MEAT_500G; [$a4e4] Message
[a4e5].byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 500G.
[a4e6].word $01f4; [$a4e6] ushort
.byte ISCRIPT_ACTION_ADD_HP; Add 30HP.
[a4e9].byte $1e; [$a4e9] byte
.byte ISCRIPT_ACTION_ADD_MP; Add 30MP.
[a4eb].byte $1e; [$a4eb] byte
.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a4ed].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a4ed] Message
[a4ee].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]
;============================================================================
[a4ef]ISCRIPT_DARTMOOR_MEAT_SHOP:; [$a4ef]
[a4ef].byte ISCRIPT_ENTITY_MEAT_SALESMAN; Show the meat shop salesman portrait text box.
[a4f0].byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show MESSAGE_DRIED_MEAT_800G.
[a4f1].byte MESSAGEID_DRIED_MEAT_800G; [$a4f1] Message
[a4f2].byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay 800G.
[a4f3].word $0320; [$a4f3] ushort
.byte ISCRIPT_ACTION_ADD_HP; Add 30HP.
[a4f6].byte $1e; [$a4f6] byte
.byte ISCRIPT_ACTION_ADD_MP; Add 30MP.
[a4f8].byte $1e; [$a4f8] byte
.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a4fa].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a4fa] Message
[a4fb].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the Eolis Key Shop.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f77]
;============================================================================
[a4fc]ISCRIPT_EOLIS_KEY_SHOP:; [$a4fc]
[a4fc].byte ISCRIPT_ENTITY_KEY_SALESMAN; Show the key salesman portrait text box.
[a4fd].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_KEYS.
[a4fe].byte MESSAGEID_I_SELL_KEYS; [$a4fe] Message
[a4ff].byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu.
[a500].word @_ISCRIPT_EOLIS_KEY_SHOP_BUY; If Buy was chosen, jump.
[a502].byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell was chosen, show the sell menu.
[a503].word EOLIS_KEY_SHOP_ITEMS; EOLIS_KEY_SHOP_ITEMS [$PRG12::a503]
[a505].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a506].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a506] Message
[a507].byte ISCRIPT_ACTION_END; End.
[a508]@_ISCRIPT_EOLIS_KEY_SHOP_BUY:; [$a508]
[a508].byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu.
[a509].word EOLIS_KEY_SHOP_ITEMS; EOLIS_KEY_SHOP_ITEMS [$PRG12::a509]
[a50b].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a50c].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a50c] Message
[a50d].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the Apolune Key Shop.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f85]
;============================================================================
[a50e]ISCRIPT_APOLUNE_KEY_SHOP:; [$a50e]
[a50e].byte ISCRIPT_ENTITY_KEY_SALESMAN; Show the key salesman portrait text box.
[a50f].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_KEYS.
[a510].byte MESSAGEID_I_SELL_KEYS; [$a510] Message
[a511].byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu.
[a512].word @_ISCRIPT_APOLUNE_KEY_SHOP_BUY; If Buy was chosen, jump.
[a514].byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell was chosen, show the sell menu.
[a515].word APOLUNE_KEY_SHOP_ITEMS; APOLUNE_KEY_SHOP_ITEMS [$PRG12::a515]
[a517].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a518].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a518] Message
[a519].byte ISCRIPT_ACTION_END; End.
[a51a]@_ISCRIPT_APOLUNE_KEY_SHOP_BUY:; [$a51a]
[a51a].byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu.
[a51b].word APOLUNE_KEY_SHOP_ITEMS; APOLUNE_KEY_SHOP_ITEMS [$PRG12::a51b]
[a51d].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a51e].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a51e] Message
[a51f].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the Forepaw Key Shop.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f96]
;============================================================================
[a520]ISCRIPT_FOREPAW_KEY_SHOP:; [$a520]
[a520].byte ISCRIPT_ENTITY_KEY_SALESMAN; Show the key salesman portrait text box.
[a521].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_KEYS.
[a522].byte MESSAGEID_I_SELL_KEYS; [$a522] Message
[a523].byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu.
[a524].word @_ISCRIPT_FOREPAW_KEY_SHOP_BUY; If Buy was chosen, jump.
[a526].byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell was chosen, show the sell menu.
[a527].word FOREPAW_KEY_SHOP_ITEMS; FOREPAW_KEY_SHOP_ITEMS [$PRG12::a527]
[a529].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a52a].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a52a] Message
[a52b].byte ISCRIPT_ACTION_END; End.
[a52c]@_ISCRIPT_FOREPAW_KEY_SHOP_BUY:; [$a52c]
[a52c].byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu.
[a52d].word FOREPAW_KEY_SHOP_ITEMS; FOREPAW_KEY_SHOP_ITEMS [$PRG12::a52d]
[a52f].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a530].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a530] Message
[a531].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the Mascon Key Shop.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fa6]
;============================================================================
[a532]ISCRIPT_MASCON_KEY_SHOP:; [$a532]
[a532].byte ISCRIPT_ENTITY_KEY_SALESMAN; Show the key salesman portrait text box.
[a533].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_KEYS.
[a534].byte MESSAGEID_I_SELL_KEYS; [$a534] Message
[a535].byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu.
[a536].word @_ISCRIPT_MASCONE_KEY_SHOP_BUY; If Buy was chosen, jump.
[a538].byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell was chosen, show the sell menu.
[a539].word MACONE_KEY_SHOP_ITEMS; MACONE_KEY_SHOP_ITEMS [$PRG12::a539]
[a53b].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a53c].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a53c] Message
[a53d].byte ISCRIPT_ACTION_END; End.
[a53e]@_ISCRIPT_MASCONE_KEY_SHOP_BUY:; [$a53e]
[a53e].byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu.
[a53f].word MACONE_KEY_SHOP_ITEMS; MACONE_KEY_SHOP_ITEMS [$PRG12::a53f]
[a541].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a542].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a542] Message
[a543].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the Victim Key Shop.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fb5]
;============================================================================
[a544]ISCRIPT_VICTIM_KEY_SHOP:; [$a544]
[a544].byte ISCRIPT_ENTITY_KEY_SALESMAN; Show the key salesman portrait text box.
[a545].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_KEYS.
[a546].byte MESSAGEID_I_SELL_KEYS; [$a546] Message
[a547].byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu.
[a548].word @_ISCRIPT_VICTIM_KEY_SHOP_BUY; If Buy was chosen, jump.
[a54a].byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell was chosen, show the sell menu.
[a54b].word VICTIM_KEY_SHOP_ITEMS; VICTIM_KEY_SHOP_ITEMS [$PRG12::a54b]
[a54d].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a54e].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a54e] Message
[a54f].byte ISCRIPT_ACTION_END; End.
[a550]@_ISCRIPT_VICTIM_KEY_SHOP_BUY:; [$a550]
[a550].byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu.
[a551].word VICTIM_KEY_SHOP_ITEMS; VICTIM_KEY_SHOP_ITEMS [$PRG12::a551]
[a553].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a554].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a554] Message
[a555].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the Daybreak Key Shop.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fd3]
;============================================================================
[a556]ISCRIPT_DAYBREAK_KEY_SHOP:; [$a556]
[a556].byte ISCRIPT_ENTITY_KEY_SALESMAN; Show the key salesman portrait text box.
[a557].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_KEYS.
[a558].byte MESSAGEID_I_SELL_KEYS; [$a558] Message
[a559].byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu.
[a55a].word @_ISCRIPT_DAYBREAK_KEY_SHOP_BUY; If Buy was chosen, jump.
[a55c].byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell was chosen, show the sell menu.
[a55d].word DAYBREAK_KEY_SHOP_ITEMS; DAYBREAK_KEY_SHOP_ITEMS [$PRG12::a55d]
[a55f].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a560].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a560] Message
[a561].byte ISCRIPT_ACTION_END; End.
[a562]@_ISCRIPT_DAYBREAK_KEY_SHOP_BUY:; [$a562]
[a562].byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu.
[a563].word DAYBREAK_KEY_SHOP_ITEMS; DAYBREAK_KEY_SHOP_ITEMS [$PRG12::a563]
[a565].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a566].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a566] Message
[a567].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the Dartmoor Key Shop.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fe2]
;============================================================================
[a568]ISCRIPT_DARTMOOR_KEY_SHOP:; [$a568]
[a568].byte ISCRIPT_ENTITY_KEY_SALESMAN; Show the key salesman portrait text box.
[a569].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_I_SELL_KEYS.
[a56a].byte MESSAGEID_I_SELL_KEYS; [$a56a] Message
[a56b].byte ISCRIPT_ACTION_SHOW_BUY_SELL_MENU; Show the Buy/Sell menu.
[a56c].word @_ISCRIPT_DARTMOOR_KEY_SHOP_BUY; If Buy was chosen, jump.
[a56e].byte ISCRIPT_ACTION_SHOW_SELL_MENU; If Sell was chosen, show the sell menu.
[a56f].word DARTMOOR_KEY_SHOP_ITEMS; DARTMOOR_KEY_SHOP_ITEMS [$PRG12::a56f]
[a571].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a572].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a572] Message
[a573].byte ISCRIPT_ACTION_END; End.
[a574]@_ISCRIPT_DARTMOOR_KEY_SHOP_BUY:; [$a574]
[a574].byte ISCRIPT_ACTION_OPEN_SHOP; Open the Buy shop menu.
[a575].word DARTMOOR_KEY_SHOP_ITEMS; DARTMOOR_KEY_SHOP_ITEMS [$PRG12::a575]
[a577].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_THANK_YOU_FOR_SHOPPING.
[a578].byte MESSAGEID_THANK_YOU_FOR_SHOPPING; [$a578] Message
[a579].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Eolis Key Shop Items
;
; * "J" Key: 100G
;============================================================================
[a57a]EOLIS_KEY_SHOP_ITEMS:; [$a57a]
[a57a].byte KEY_J; [$a57a] InventoryItem
[a57b].word $0064; [$a57b] ushort
.byte $ff
;============================================================================
; Apolune Key Shop
;
; * "J" Key: 140G
;============================================================================
[a57e]APOLUNE_KEY_SHOP_ITEMS:; [$a57e]
[a57e].byte KEY_J; [$a57e] InventoryItem
[a57f].word $008c; [$a57f] ushort
.byte $ff
;============================================================================
; Forepaw Key Shop Items
;
; * "J" Key: 200G
; * "Q" Key: 500G
;============================================================================
[a582]FOREPAW_KEY_SHOP_ITEMS:; [$a582]
[a582].byte KEY_J; [$a582] InventoryItem
[a583].word $00c8; [$a583] ushort
.byte KEY_Q
[a586].word $01f4; [$a586] ushort
.byte $ff
;============================================================================
; Mascone Key Shop Items
;
; * "J" Key: 500G
; * "Q" Key: 600G
;============================================================================
[a589]MACONE_KEY_SHOP_ITEMS:; [$a589]
[a589].byte KEY_J; [$a589] InventoryItem
[a58a].word $01f4; [$a58a] ushort
.byte KEY_Q
[a58d].word $0258; [$a58d] ushort
.byte $ff
;============================================================================
; Victim Key Shop Items
;
; * "K" Key: 1500G
; * "Q" Key: 1200G
;============================================================================
[a590]VICTIM_KEY_SHOP_ITEMS:; [$a590]
[a590].byte KEY_K; [$a590] InventoryItem
[a591].word $05dc; [$a591] ushort
.byte KEY_Q
[a594].word $04b0; [$a594] ushort
.byte $ff
;============================================================================
; Daybreak Key Shop Items
;
; * "K" Key: 1200G
; * "Q" Key: 1000G
;============================================================================
[a597]DAYBREAK_KEY_SHOP_ITEMS:; [$a597]
[a597].byte KEY_K; [$a597] InventoryItem
[a598].word $04b0; [$a598] ushort
.byte KEY_Q
[a59b].word $03e8; [$a59b] ushort
.byte $ff
;============================================================================
; Dartmoor Key Shop Items
;
; * "K" Key - 1300G
;============================================================================
[a59e]DARTMOOR_KEY_SHOP_ITEMS:; [$a59e]
[a59e].byte KEY_K; [$a59e] InventoryItem
[a59f].word $0514; [$a59f] ushort
.byte $ff
;============================================================================
; Interaction with the doctor of Apolune.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f80]
;============================================================================
[a5a2]ISCRIPT_APOLUNE_DOCTOR:; [$a5a2]
[a5a2].byte ISCRIPT_ENTITY_DOCTOR; Show the Doctor portrait text box.
[a5a3].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DO_YOU_WANT_TREATMENT.
[a5a4].byte MESSAGEID_DO_YOU_WANT_TREATMENT; [$a5a4] Message
[a5a5].byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show a dismissible MESSAGE_250G_PLEASE.
[a5a6].byte MESSAGEID_250G_PLEASE; [$a5a6] Message
[a5a7].byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay gold.
[a5a8].word $00fa; [$a5a8] ushort
.byte ISCRIPT_ACTION_ADD_HP; Add 80HP.
[a5ab].byte $50; [$a5ab] byte
.byte ISCRIPT_ACTION_ADD_MP; Add 80MP.
[a5ad].byte $50; [$a5ad] byte
.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_TRY_TOO_HARD.
[a5af].byte MESSAGEID_DONT_TRY_TOO_HARD; [$a5af] Message
[a5b0].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the doctor of Forepaw.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f95]
;============================================================================
[a5b1]ISCRIPT_FOREPAW_DOCTOR:; [$a5b1]
[a5b1].byte ISCRIPT_ENTITY_DOCTOR; Show the Doctor portrait text box.
[a5b2].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DO_YOU_WANT_TREATMENT.
[a5b3].byte MESSAGEID_DO_YOU_WANT_TREATMENT; [$a5b3] Message
[a5b4].byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show a dismissible MESSAGE_500G_PLEASE.
[a5b5].byte MESSAGEID_500G_PLEASE; [$a5b5] Message
[a5b6].byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay gold.
[a5b7].word $01f4; [$a5b7] ushort
.byte ISCRIPT_ACTION_ADD_HP; Add 80HP.
[a5ba].byte $50; [$a5ba] byte
.byte ISCRIPT_ACTION_ADD_MP; Add 80MP.
[a5bc].byte $50; [$a5bc] byte
.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_TRY_TOO_HARD.
[a5be].byte MESSAGEID_DONT_TRY_TOO_HARD; [$a5be] Message
[a5bf].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the doctor of Mascon.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fa3]
;============================================================================
[a5c0]ISCRIPT_MASCON_DOCTOR:; [$a5c0]
[a5c0].byte ISCRIPT_ENTITY_DOCTOR; Show the Doctor portrait text box.
[a5c1].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DO_YOU_WANT_TREATMENT.
[a5c2].byte MESSAGEID_DO_YOU_WANT_TREATMENT; [$a5c2] Message
[a5c3].byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show a dismissible MESSAGE_1000G_PLEASE.
[a5c4].byte MESSAGEID_1000G_PLEASE; [$a5c4] Message
[a5c5].byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay gold.
[a5c6].word $03e8; [$a5c6] ushort
.byte ISCRIPT_ACTION_ADD_HP; Add 80HP.
[a5c9].byte $50; [$a5c9] byte
.byte ISCRIPT_ACTION_ADD_MP; Add 80MP.
[a5cb].byte $50; [$a5cb] byte
.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_TRY_TOO_HARD.
[a5cd].byte MESSAGEID_DONT_TRY_TOO_HARD; [$a5cd] Message
[a5ce].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the doctor of Victim.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fb2]
;============================================================================
[a5cf]ISCRIPT_VICTIM_DOCTOR:; [$a5cf]
[a5cf].byte ISCRIPT_ENTITY_DOCTOR; Show the Doctor portrait text box.
[a5d0].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DO_YOU_WANT_TREATMENT.
[a5d1].byte MESSAGEID_DO_YOU_WANT_TREATMENT; [$a5d1] Message
[a5d2].byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show a dismissible MESSAGE_2500G_PLEASE.
[a5d3].byte MESSAGEID_2500G_PLEASE; [$a5d3] Message
[a5d4].byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay gold.
[a5d5].word $09c4; [$a5d5] ushort
.byte ISCRIPT_ACTION_ADD_HP; Add 80HP.
[a5d8].byte $50; [$a5d8] byte
.byte ISCRIPT_ACTION_ADD_MP; Add 80MP.
[a5da].byte $50; [$a5da] byte
.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_TRY_TOO_HARD.
[a5dc].byte MESSAGEID_DONT_TRY_TOO_HARD; [$a5dc] Message
[a5dd].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the doctor of Conflate.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fc1]
;============================================================================
[a5de]ISCRIPT_CONFLATE_DOCTOR:; [$a5de]
[a5de].byte ISCRIPT_ENTITY_DOCTOR; Show the Doctor portrait text box.
[a5df].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DO_YOU_WANT_TREATMENT.
[a5e0].byte MESSAGEID_DO_YOU_WANT_TREATMENT; [$a5e0] Message
[a5e1].byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show a dismissible MESSAGE_1800G_PLEASE.
[a5e2].byte MESSAGEID_1800G_PLEASE; [$a5e2] Message
[a5e3].byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay gold.
[a5e4].word $0708; [$a5e4] ushort
.byte ISCRIPT_ACTION_ADD_HP; Add 80HP.
[a5e7].byte $50; [$a5e7] byte
.byte ISCRIPT_ACTION_ADD_MP; Add 80MP.
[a5e9].byte $50; [$a5e9] byte
.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_TRY_TOO_HARD.
[a5eb].byte MESSAGEID_DONT_TRY_TOO_HARD; [$a5eb] Message
[a5ec].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the doctor of Dartmoor.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fe5]
;============================================================================
[a5ed]ISCRIPT_DARTMOOR_DOCTOR:; [$a5ed]
[a5ed].byte ISCRIPT_ENTITY_DOCTOR; Show the Doctor portrait text box.
[a5ee].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DO_YOU_WANT_TREATMENT.
[a5ef].byte MESSAGEID_DO_YOU_WANT_TREATMENT; [$a5ef] Message
[a5f0].byte ISCRIPT_ACTION_SHOW_QUESTION_MESSAGE; Show a dismissible MESSAGE_3000G_PLEASE.
[a5f1].byte MESSAGEID_3000G_PLEASE; [$a5f1] Message
[a5f2].byte ISCRIPT_ACTION_PAY_GOLD; If not dismissed, pay gold.
[a5f3].word $0bb8; [$a5f3] ushort
.byte ISCRIPT_ACTION_ADD_HP; Add 80HP.
[a5f6].byte $50; [$a5f6] byte
.byte ISCRIPT_ACTION_ADD_MP; Add 80MP.
[a5f8].byte $50; [$a5f8] byte
.byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_DONT_TRY_TOO_HARD.
[a5fa].byte MESSAGEID_DONT_TRY_TOO_HARD; [$a5fa] Message
[a5fb].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Common script for a player's new password at a temple.
;============================================================================
[a5fc]ISCRIPT_COMMON_GURU_PASSWORD:; [$a5fc]
[a5fc].byte ISCRIPT_ACTION_SHOW_MESSAGE; Show MESSAGE_MEDITATE_WITH_YOU.
[a5fd].byte MESSAGEID_MEDITATE_WITH_YOU; [$a5fd] Message
[a5fe].byte ISCRIPT_ACTION_SHOW_PASSWORD; Generate and show a new password.
[a5ff].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Common script for a player's new rank at a temple.
;============================================================================
[a600]ISCRIPT_COMMON_GURU_NEW_RANK:; [$a600]
[a600].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Show MESSAGE_NEW_TITLE.
[a601].byte MESSAGEID_NEW_TITLE; [$a601] Message
[a602].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the guru of Apolune.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f87]
;============================================================================
[a603]ISCRIPT_APOLUNE_GURU:; [$a603]
[a603].byte ISCRIPT_ENTITY_GURU; Display a Guru portrait text box.
[a604].byte ISCRIPT_ACTION_SET_SPAWN_POINT; Set the spawn point to the temple of Apolune.
[a605].byte TEMPLE_APOLUNE; [$a605] Temple
[a606].byte ISCRIPT_ACTION_CHECK_UPDATE_PLAYER_TITLE; Check the player rank and update if needed.
[a607].word ISCRIPT_COMMON_GURU_NEW_RANK; If set, jump to show the new rank.
[a609].byte ISCRIPT_ACTION_JUMP; Else, jump to show the new password.
[a60a].word ISCRIPT_COMMON_GURU_PASSWORD; ISCRIPT_COMMON_GURU_PASSWORD [$PRG12::a60a]
;============================================================================
; Interaction with the guru of Forepaw.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9f94]
;============================================================================
[a60c]ISCRIPT_FOREPAW_GURU:; [$a60c]
[a60c].byte ISCRIPT_ENTITY_GURU; Display a Guru portrait text box.
[a60d].byte ISCRIPT_ACTION_SET_SPAWN_POINT; Set the spawn point to the temple of Forepaw.
[a60e].byte TEMPLE_FOREPAW; [$a60e] Temple
[a60f].byte ISCRIPT_ACTION_CHECK_UPDATE_PLAYER_TITLE; Check the player rank and update if needed.
[a610].word ISCRIPT_COMMON_GURU_NEW_RANK; If set, jump to show the new rank.
[a612].byte ISCRIPT_ACTION_JUMP; Else, jump to show the new password.
[a613].word ISCRIPT_COMMON_GURU_PASSWORD; ISCRIPT_COMMON_GURU_PASSWORD [$PRG12::a613]
;============================================================================
; Interaction with the guru of Mascon.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fa8]
;============================================================================
[a615]ISCRIPT_MASCON_GURU:; [$a615]
[a615].byte ISCRIPT_ENTITY_GURU; Display a Guru portrait text box.
[a616].byte ISCRIPT_ACTION_SET_SPAWN_POINT; Set the spawn point to the temple of Mascon.
[a617].byte TEMPLE_MASCON; [$a617] Temple
[a618].byte ISCRIPT_ACTION_CHECK_UPDATE_PLAYER_TITLE; Check the player rank and update if needed.
[a619].word ISCRIPT_COMMON_GURU_NEW_RANK; If set, jump to show the new rank.
[a61b].byte ISCRIPT_ACTION_JUMP; Else, jump to show the new password.
[a61c].word ISCRIPT_COMMON_GURU_PASSWORD; ISCRIPT_COMMON_GURU_PASSWORD [$PRG12::a61c]
;============================================================================
; Interaction with the guru of Victim.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fb7]
;============================================================================
[a61e]ISCRIPT_VICTIM_GURU:; [$a61e]
[a61e].byte ISCRIPT_ENTITY_GURU; Display a Guru portrait text box.
[a61f].byte ISCRIPT_ACTION_SET_SPAWN_POINT; Set the spawn point to the temple of Victim.
[a620].byte TEMPLE_VICTIM; [$a620] Temple
[a621].byte ISCRIPT_ACTION_CHECK_UPDATE_PLAYER_TITLE; Check the player rank and update if needed.
[a622].word ISCRIPT_COMMON_GURU_NEW_RANK; If set, jump to show the new rank.
[a624].byte ISCRIPT_ACTION_JUMP; Else, jump to show the new password.
[a625].word ISCRIPT_COMMON_GURU_PASSWORD; ISCRIPT_COMMON_GURU_PASSWORD [$PRG12::a625]
;============================================================================
; 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]
;============================================================================
[a627]ISCRIPT_CONFLATE_GURU:; [$a627]
[a627].byte ISCRIPT_ENTITY_GURU; Display a Guru portrait text box.
[a628].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Battle Suit.
[a629].byte ARMOR_BATTLE_SUIT; [$a629] InventoryItem
[a62a].word @_ISCRIPT_GURU_CONFLATE_HAS_BATTLE_SUIT; If so, jump.
[a62c]@_ISCRIPT_GURU_CONFLATE_DEFAULT:; [$a62c]
[a62c].byte ISCRIPT_ACTION_SET_SPAWN_POINT; Set the spawn point to the temple of Conflate.
[a62d].byte TEMPLE_CONFLATE; [$a62d] Temple
[a62e].byte ISCRIPT_ACTION_CHECK_UPDATE_PLAYER_TITLE; Check the player rank and update if needed.
[a62f].word ISCRIPT_COMMON_GURU_NEW_RANK; If set, jump to show the new rank.
[a631].byte ISCRIPT_ACTION_JUMP; Else, jump to show the new password.
[a632].word ISCRIPT_COMMON_GURU_PASSWORD; ISCRIPT_COMMON_GURU_PASSWORD [$PRG12::a632]
[a634]@_ISCRIPT_GURU_CONFLATE_HAS_BATTLE_SUIT:; [$a634]
[a634].byte ISCRIPT_ACTION_CHECK_FOR_ITEM; Check if the player has the Ring of Dworf.
[a635].byte SPECIAL_RING_OF_DWORF; [$a635] InventoryItem
[a636].word @_ISCRIPT_GURU_CONFLATE_DEFAULT; If so, jump to normal guru behavior.
[a638].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; Show MESSAGE_DIRECTIONS_DARTMORE.
[a639].byte MESSAGEID_DIRECTIONS_DARTMORE; [$a639] Message
[a63a].byte ISCRIPT_ACTION_ADD_ITEM; Add the Ring of Dworf to the inventory.
[a63b].byte SPECIAL_RING_OF_DWORF; [$a63b] InventoryItem
[a63c].byte ISCRIPT_ACTION_END; End.
;============================================================================
; Interaction with the guru of Daybreak.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fd4]
;============================================================================
[a63d]ISCRIPT_DAYBREAK_GURU:; [$a63d]
[a63d].byte ISCRIPT_ENTITY_GURU; Display a Guru portrait text box.
[a63e].byte ISCRIPT_ACTION_SET_SPAWN_POINT; Set the spawn point to the Daybreak temple.
[a63f].byte TEMPLE_DAYBREAK; [$a63f] Temple
[a640].byte ISCRIPT_ACTION_CHECK_UPDATE_PLAYER_TITLE; Check the player rank and update if needed.
[a641].word ISCRIPT_COMMON_GURU_NEW_RANK; If set, jump to show the new rank.
[a643].byte ISCRIPT_ACTION_JUMP; Else, jump to show the new password.
[a644].word ISCRIPT_COMMON_GURU_PASSWORD; ISCRIPT_COMMON_GURU_PASSWORD [$PRG12::a644]
;============================================================================
; Interaction with the guru of the final temple.
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fe3]
;============================================================================
[a646]ISCRIPT_GURU_FINAL:; [$a646]
[a646].byte ISCRIPT_ENTITY_GURU; Display a Guru portrait text box.
[a647].byte ISCRIPT_ACTION_SET_SPAWN_POINT; Set the spawn point to the final temple.
[a648].byte TEMPLE_FINAL; [$a648] Temple
[a649].byte ISCRIPT_ACTION_CHECK_UPDATE_PLAYER_TITLE; Check the player rank and update if needed.
[a64a].word ISCRIPT_COMMON_GURU_NEW_RANK; If set, jump to show the new rank.
[a64c].byte ISCRIPT_ACTION_JUMP; Else, jump to show the new password.
[a64d].word ISCRIPT_COMMON_GURU_PASSWORD; ISCRIPT_COMMON_GURU_PASSWORD [$PRG12::a64d]
;============================================================================
; "Glad you're back."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fe4]
;============================================================================
[a64f]ISCRIPT_KING_END_GAME:; [$a64f]
[a64f].byte ISCRIPT_ENTITY_GENERIC; [$a64f] IScriptEntity
[a650].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a650] IScriptAction
[a651].byte MESSAGEID_GLAD_YOURE_BACK; [$a651] Message
[a652].byte ISCRIPT_ACTION_END_GAME; [$a652] IScriptAction
[a653].byte ISCRIPT_ACTION_END; [$a653] IScriptAction
;============================================================================
; "There is the mark of Queen by the key hole."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fe6]
;============================================================================
[a654]ISCRIPT_MARK_OF_QUEEN:; [$a654]
[a654].byte ISCRIPT_ENTITY_GENERIC; [$a654] IScriptEntity
[a655].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a655] IScriptAction
[a656].byte MESSAGEID_MARK_OF_QUEEN; [$a656] Message
[a657].byte ISCRIPT_ACTION_END; [$a657] IScriptAction
;============================================================================
; "There is the mark of King by the key hole."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fe7]
;============================================================================
[a658]ISCRIPT_MARK_OF_KING:; [$a658]
[a658].byte ISCRIPT_ENTITY_GENERIC; [$a658] IScriptEntity
[a659].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a659] IScriptAction
[a65a].byte MESSAGEID_MARK_OF_KING; [$a65a] Message
[a65b].byte ISCRIPT_ACTION_END; [$a65b] IScriptAction
;============================================================================
; "There is the mark of Ace by the key hole."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fe8]
;============================================================================
[a65c]ISCRIPT_MARK_OF_ACE:; [$a65c]
[a65c].byte ISCRIPT_ENTITY_GENERIC; [$a65c] IScriptEntity
[a65d].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a65d] IScriptAction
[a65e].byte MESSAGEID_MARK_OF_ACE; [$a65e] Message
[a65f].byte ISCRIPT_ACTION_END; [$a65f] IScriptAction
;============================================================================
; "There is the mark of Joker by the key hole."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fe9]
;============================================================================
[a660]ISCRIPT_MARK_OF_JOKER:; [$a660]
[a660].byte ISCRIPT_ENTITY_GENERIC; [$a660] IScriptEntity
[a661].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a661] IScriptAction
[a662].byte MESSAGEID_MARK_OF_JOKER; [$a662] Message
[a663].byte ISCRIPT_ACTION_END; [$a663] IScriptAction
;============================================================================
; "Do you need a ring to open a door?"
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fea]
;============================================================================
[a664]ISCRIPT_NEED_RING_FOR_DOOR:; [$a664]
[a664].byte ISCRIPT_ENTITY_GENERIC; [$a664] IScriptEntity
[a665].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a665] IScriptAction
[a666].byte MESSAGEID_NEED_RING_FOR_DOOR; [$a666] Message
[a667].byte ISCRIPT_ACTION_END; [$a667] IScriptAction
;============================================================================
; "I've used Red Potion."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9feb]
;============================================================================
[a668]ISCRIPT_USED_RED_POTION:; [$a668]
[a668].byte ISCRIPT_ENTITY_GENERIC; [$a668] IScriptEntity
[a669].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a669] IScriptAction
[a66a].byte MESSAGEID_USED_RED_POTION; [$a66a] Message
[a66b].byte ISCRIPT_ACTION_END; [$a66b] IScriptAction
;============================================================================
; "I've used Mattock."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fec]
;============================================================================
[a66c]ISCRIPT_USED_MATTOCK:; [$a66c]
[a66c].byte ISCRIPT_ENTITY_GENERIC; [$a66c] IScriptEntity
[a66d].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a66d] IScriptAction
[a66e].byte MESSAGEID_USED_MATTOCK; [$a66e] Message
[a66f].byte ISCRIPT_ACTION_END; [$a66f] IScriptAction
;============================================================================
; "I've used Hour Glass."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fed]
;============================================================================
[a670]ISCRIPT_USED_HOURGLASS:; [$a670]
[a670].byte ISCRIPT_ENTITY_GENERIC; [$a670] IScriptEntity
[a671].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a671] IScriptAction
[a672].byte MESSAGEID_USED_HOURGLASS; [$a672] Message
[a673].byte ISCRIPT_ACTION_END; [$a673] IScriptAction
;============================================================================
; "I've used Wing Boots."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fee]
;============================================================================
[a674]ISCRIPT_USED_WINGBOOTS:; [$a674]
[a674].byte ISCRIPT_ENTITY_GENERIC; [$a674] IScriptEntity
[a675].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a675] IScriptAction
[a676].byte MESSAGEID_USED_WINGBOOTS; [$a676] Message
[a677].byte ISCRIPT_ACTION_END; [$a677] IScriptAction
;============================================================================
; "I've used key."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fef]
;============================================================================
[a678]ISCRIPT_USED_KEY:; [$a678]
[a678].byte ISCRIPT_ENTITY_GENERIC; [$a678] IScriptEntity
[a679].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a679] IScriptAction
[a67a].byte MESSAGEID_USED_KEY; [$a67a] Message
[a67b].byte ISCRIPT_ACTION_END; [$a67b] IScriptAction
;============================================================================
; "I've used Elixir."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9ff0]
;============================================================================
[a67c]ISCRIPT_USED_ELIXIR:; [$a67c]
[a67c].byte ISCRIPT_ENTITY_GENERIC; [$a67c] IScriptEntity
[a67d].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a67d] IScriptAction
[a67e].byte MESSAGEID_USED_ELIXIR; [$a67e] Message
[a67f].byte ISCRIPT_ACTION_END; [$a67f] IScriptAction
;============================================================================
; "I'm holding Elixir."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9ff1]
;============================================================================
[a680]ISCRIPT_GOT_ELIXIR:; [$a680]
[a680].byte ISCRIPT_ENTITY_GENERIC; [$a680] IScriptEntity
[a681].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a681] IScriptAction
[a682].byte MESSAGEID_HOLDING_ELIXIR; [$a682] Message
[a683].byte ISCRIPT_ACTION_END; [$a683] IScriptAction
;============================================================================
; "I'm holding Red Potion."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9ff2]
;============================================================================
[a684]ISCRIPT_GOT_RED_POTION:; [$a684]
[a684].byte ISCRIPT_ENTITY_GENERIC; [$a684] IScriptEntity
[a685].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a685] IScriptAction
[a686].byte MESSAGEID_HOLDING_RED_POTION; [$a686] Message
[a687].byte ISCRIPT_ACTION_END; [$a687] IScriptAction
;============================================================================
; "I'm holding Mattock."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9ff3]
;============================================================================
[a688]ISCRIPT_GOT_MATTOCK:; [$a688]
[a688].byte ISCRIPT_ENTITY_GENERIC; [$a688] IScriptEntity
[a689].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a689] IScriptAction
[a68a].byte MESSAGEID_HOLDING_MATTOCK; [$a68a] Message
[a68b].byte ISCRIPT_ACTION_END; [$a68b] IScriptAction
;============================================================================
; "I'm holding Wing Boots."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9ff4]
;============================================================================
[a68c]ISCRIPT_GOT_WINGBOOTS:; [$a68c]
[a68c].byte ISCRIPT_ENTITY_GENERIC; [$a68c] IScriptEntity
[a68d].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a68d] IScriptAction
[a68e].byte MESSAGEID_HOLDING_WINGBOOTS; [$a68e] Message
[a68f].byte ISCRIPT_ACTION_END; [$a68f] IScriptAction
;============================================================================
; "I'm holding Hour Glass."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9ff5]
;============================================================================
[a690]ISCRIPT_GOT_HOURGLASS:; [$a690]
[a690].byte ISCRIPT_ENTITY_GENERIC; [$a690] IScriptEntity
[a691].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a691] IScriptAction
[a692].byte MESSAGEID_HOLDING_HOURGLASS; [$a692] Message
[a693].byte ISCRIPT_ACTION_END; [$a693] IScriptAction
;============================================================================
; "I've got the Battle Suit."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9ff6]
;============================================================================
[a694]ISCRIPT_GOT_BATTLE_SUIT:; [$a694]
[a694].byte ISCRIPT_ENTITY_GENERIC; [$a694] IScriptEntity
[a695].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a695] IScriptAction
[a696].byte MESSAGEID_GOT_BATTLE_SUIT; [$a696] Message
[a697].byte ISCRIPT_ACTION_END; [$a697] IScriptAction
;============================================================================
; "I've got the Battle Helmet."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9ff7]
;============================================================================
[a698]ISCRIPT_GOT_BATTLE_HELMET:; [$a698]
[a698].byte ISCRIPT_ENTITY_GENERIC; [$a698] IScriptEntity
[a699].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a699] IScriptAction
[a69a].byte MESSAGEID_GOT_BATTLE_HELMET; [$a69a] Message
[a69b].byte ISCRIPT_ACTION_END; [$a69b] IScriptAction
;============================================================================
; "I've got the Dragon Slayer."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9ff8]
;============================================================================
[a69c]ISCRIPT_GOT_DRAGON_SLAYER:; [$a69c]
[a69c].byte ISCRIPT_ENTITY_GENERIC; [$a69c] IScriptEntity
[a69d].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a69d] IScriptAction
[a69e].byte MESSAGEID_GOT_DRAGON_SLAYER; [$a69e] Message
[a69f].byte ISCRIPT_ACTION_END; [$a69f] IScriptAction
;============================================================================
; "I've got the Black Onyx."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9ff9]
;============================================================================
[a6a0]ISCRIPT_GOT_BLACK_ONYX:; [$a6a0]
[a6a0].byte ISCRIPT_ENTITY_GENERIC; [$a6a0] IScriptEntity
[a6a1].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a6a1] IScriptAction
[a6a2].byte MESSAGEID_GOT_BLACK_ONYX; [$a6a2] Message
[a6a3].byte ISCRIPT_ACTION_END; [$a6a3] IScriptAction
;============================================================================
; "I've got the Pendant."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9ffa]
;============================================================================
[a6a4]ISCRIPT_GOT_PENDANT:; [$a6a4]
[a6a4].byte ISCRIPT_ENTITY_GENERIC; [$a6a4] IScriptEntity
[a6a5].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a6a5] IScriptAction
[a6a6].byte MESSAGEID_GOT_PENDANT; [$a6a6] Message
[a6a7].byte ISCRIPT_ACTION_END; [$a6a7] IScriptAction
;============================================================================
; "I've got the Magical Rod."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9ffb]
;============================================================================
[a6a8]ISCRIPT_GOT_MAGICAL_ROD:; [$a6a8]
[a6a8].byte ISCRIPT_ENTITY_GENERIC; [$a6a8] IScriptEntity
[a6a9].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a6a9] IScriptAction
[a6aa].byte MESSAGEID_GOT_MAGICAL_ROD; [$a6aa] Message
[a6ab].byte ISCRIPT_ACTION_END; [$a6ab] IScriptAction
;============================================================================
; "I've touched Poison."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9ffc]
;============================================================================
[a6ac]ISCRIPT_TOUCHED_POISON:; [$a6ac]
[a6ac].byte ISCRIPT_ENTITY_GENERIC; [$a6ac] IScriptEntity
[a6ad].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a6ad] IScriptAction
[a6ae].byte MESSAGEID_TOUCHED_POISON; [$a6ae] Message
[a6af].byte ISCRIPT_ACTION_END; [$a6af] IScriptAction
;============================================================================
; "The glove increases offensive power."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9ffd]
;============================================================================
[a6b0]ISCRIPT_GOT_POWER_GLOVE:; [$a6b0]
[a6b0].byte ISCRIPT_ENTITY_GENERIC; [$a6b0] IScriptEntity
[a6b1].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a6b1] IScriptAction
[a6b2].byte MESSAGEID_GLOVE_INCREASES_POWER; [$a6b2] Message
[a6b3].byte ISCRIPT_ACTION_END; [$a6b3] IScriptAction
;============================================================================
; "The power of the Glove is gone."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9ffe]
;============================================================================
[a6b4]ISCRIPT_POWER_GLOVE_GONE:; [$a6b4]
[a6b4].byte ISCRIPT_ENTITY_GENERIC; [$a6b4] IScriptEntity
[a6b5].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a6b5] IScriptAction
[a6b6].byte MESSAGEID_POWER_GLOVE_IS_GONE; [$a6b6] Message
[a6b7].byte ISCRIPT_ACTION_END; [$a6b7] IScriptAction
;============================================================================
; "I am free from injury because of the Ointment."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::9fff]
;============================================================================
[a6b8]ISCRIPT_OINTMENT_USED:; [$a6b8]
[a6b8].byte ISCRIPT_ENTITY_GENERIC; [$a6b8] IScriptEntity
[a6b9].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a6b9] IScriptAction
[a6ba].byte MESSAGEID_USED_OINTMENT; [$a6ba] Message
[a6bb].byte ISCRIPT_ACTION_END; [$a6bb] IScriptAction
;============================================================================
; "The power of the Ointment is gone."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::a000]
;============================================================================
[a6bc]ISCRIPT_OINTMENT_GONE:; [$a6bc]
[a6bc].byte ISCRIPT_ENTITY_GENERIC; [$a6bc] IScriptEntity
[a6bd].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a6bd] IScriptAction
[a6be].byte MESSAGEID_OINTMENT_GONE; [$a6be] Message
[a6bf].byte ISCRIPT_ACTION_END; [$a6bf] IScriptAction
;============================================================================
; "The power of the Wing Boots is gone."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::a001]
;============================================================================
[a6c0]ISCRIPT_WINGBOOTS_GONE:; [$a6c0]
[a6c0].byte ISCRIPT_ENTITY_GENERIC; [$a6c0] IScriptEntity
[a6c1].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a6c1] IScriptAction
[a6c2].byte MESSAGEID_WINGBOOTS_GONE; [$a6c2] Message
[a6c3].byte ISCRIPT_ACTION_END; [$a6c3] IScriptAction
;============================================================================
; "The power of the Hour Glass is gone."
;
; XREFS:
;
ISCRIPT_ADDRS_L [$PRG12::a002]
;============================================================================
[a6c4]ISCRIPT_HOURGLASS_GONE:; [$a6c4]
[a6c4].byte ISCRIPT_ENTITY_GENERIC; [$a6c4] IScriptEntity
[a6c5].byte ISCRIPT_ACTION_SHOW_UNSKIPPABLE_MESSAGE; [$a6c5] IScriptAction
[a6c6].byte MESSAGEID_HOURGLASS_GONE; [$a6c6] Message
[a6c7].byte ISCRIPT_ACTION_END; [$a6c7] IScriptAction
[a6c8]SPLASHANIM_INTRO_PALETTE:; [$a6c8]
[a6c8].byte $0f; [0]:
[a6c9].byte $07; [1]:
[a6ca].byte $17; [2]:
[a6cb].byte $27; [3]:
[a6cc].byte $0f; [4]:
[a6cd].byte $27; [5]:
[a6ce].byte $17; [6]:
[a6cf].byte $27; [7]:
[a6d0].byte $0f; [8]:
[a6d1].byte $0c; [9]:
[a6d2].byte $17; [10]:
[a6d3].byte $10; [11]:
[a6d4].byte $0f; [12]:
[a6d5].byte $0c; [13]:
[a6d6].byte $17; [14]:
[a6d7].byte $27; [15]:
[a6d8].byte $0f; [16]:
[a6d9].byte $17; [17]:
[a6da].byte $26; [18]:
[a6db].byte $30; [19]:
[a6dc].byte $0f; [20]:
[a6dd].byte $17; [21]:
[a6de].byte $26; [22]:
[a6df].byte $30; [23]:
[a6e0].byte $0f; [24]:
[a6e1].byte $17; [25]:
[a6e2].byte $26; [26]:
[a6e3].byte $30; [27]:
[a6e4].byte $0f; [28]:
[a6e5].byte $17; [29]:
[a6e6].byte $26; [30]:
[a6e7].byte $30; [31]:
[a6e8]SPLASHANIM_OUTRO_PALETTE:; [$a6e8]
[a6e8].byte $0f; [0]:
[a6e9].byte $17; [1]:
[a6ea].byte $27; [2]:
[a6eb].byte $37; [3]:
[a6ec].byte $0f; [4]:
[a6ed].byte $37; [5]:
[a6ee].byte $19; [6]:
[a6ef].byte $29; [7]:
[a6f0].byte $0f; [8]:
[a6f1].byte $1c; [9]:
[a6f2].byte $19; [10]:
[a6f3].byte $30; [11]:
[a6f4].byte $0f; [12]:
[a6f5].byte $1c; [13]:
[a6f6].byte $27; [14]:
[a6f7].byte $37; [15]:
[a6f8].byte $0f; [16]:
[a6f9].byte $17; [17]:
[a6fa].byte $26; [18]:
[a6fb].byte $30; [19]:
[a6fc].byte $0f; [20]:
[a6fd].byte $1c; [21]:
[a6fe].byte $2c; [22]:
[a6ff].byte $30; [23]:
[a700].byte $0f; [24]:
[a701].byte $17; [25]:
[a702].byte $26; [26]:
[a703].byte $30; [27]:
[a704].byte $0f; [28]:
[a705].byte $17; [29]:
[a706].byte $26; [30]:
[a707].byte $30; [31]:
;============================================================================
; TODO: Document SplashAnimation_Intro_SomethingA708
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
SplashAnimation_RunIntro
;============================================================================
[a708]SplashAnimation_Intro_SomethingA708:; [$a708]
[a708]INC a:SplashAnimation_PaletteStage
[a70b]LDA a:SplashAnimation_PaletteStage
[a70e]AND #$07
[a710]BNE @LAB_PRG12__a727
[a712]LDY #$1f
[a714]@LAB_PRG12__a714:; [$a714]
[a714]LDA Screen_PaletteData_Tiles,Y
[a717]SEC
[a718]SBC #$10
[a71a]BPL @LAB_PRG12__a71e
[a71c]LDA #$0f
[a71e]@LAB_PRG12__a71e:; [$a71e]
[a71e]STA Screen_PaletteData_Tiles,Y
[a721]DEY
[a722]BPL @LAB_PRG12__a714
[a724]JMP PPUBuffer_WritePalette
[a727]@LAB_PRG12__a727:; [$a727]
[a727]RTS
[a728]SPLASHANIM_CHR_L:; [$a728]
[a728].byte $a0; [0]: Intro
[a729].byte $a0; [1]: Outro
[a72a]SPLASHANIM_CHR_U:; [$a72a]
[a72a].byte $ac; [0]: Intro
[a72b].byte $b0; [1]: Outro
[a72c]SPLASHANIM_PALETTE_L:; [$a72c]
[a72c].byte $c8; [0]: Intro
[a72d].byte $e8; [1]: Outro
[a72e]SPLASHANIM_PALETTE_U:; [$a72e]
[a72e].byte $a6; [0]: Intro
[a72f].byte $a6; [1]: Outro
;============================================================================
; TODO: Document SplashAnimation_DrawScenery
;
; INPUTS:
; A
;
; OUTPUTS:
; TODO
;
; XREFS:
;
SplashAnimation_RunIntro
;
SplashAnimation_RunOutro
;============================================================================
[a730]SplashAnimation_DrawScenery:; [$a730]
[a730]STA a:SplashAnimation_SceneIndex
[a733]JSR PPU_WaitUntilFlushed
[a736]LDA #$a0
[a738]STA IScriptOrCHRAddr
[a73a]LDA #$9b
[a73c]STA IScriptOrCHRAddr_U
[a73e]LDA #$00
[a740]STA PPU_TargetAddr
[a742]LDA #$00
[a744]STA PPU_TargetAddr_U
[a746]LDX #$0a
[a748]LDY #$90
[a74a]JSR PPU_WriteTilesFromCHRRAM
[a74d]LDA #$a0
[a74f]STA IScriptOrCHRAddr
[a751]LDA #$a4
[a753]STA IScriptOrCHRAddr_U
[a755]LDA #$00
[a757]STA PPU_TargetAddr
[a759]LDA #$18
[a75b]STA PPU_TargetAddr_U
[a75d]LDX #$0a
[a75f]LDY #$80
[a761]JSR PPU_WriteTilesFromCHRRAM
[a764]LDX a:SplashAnimation_SceneIndex
[a767]LDA SPLASHANIM_CHR_L,X
[a76a]STA IScriptOrCHRAddr
[a76c]LDA SPLASHANIM_CHR_U,X
[a76f]STA IScriptOrCHRAddr_U
[a771]LDA #$20
[a773]STA PPU_TargetAddr_U
[a775]LDA #$00
[a777]STA PPU_TargetAddr
[a779]LDX #$0a
[a77b]LDY #$40
[a77d]JSR PPU_WriteTilesFromCHRRAM
[a780]LDX a:SplashAnimation_SceneIndex
[a783]LDA SPLASHANIM_PALETTE_L,X
[a786]STA Temp_Int24
[a788]LDA SPLASHANIM_PALETTE_U,X
[a78b]STA Temp_Int24_M
[a78d]LDY #$1f
[a78f]@_paletteLoop:; [$a78f]
[a78f]LDA (Temp_Int24),Y
[a791]STA Screen_PaletteData_Tiles,Y
[a794]DEY
[a795]BPL @_paletteLoop
[a797]JMP PPUBuffer_WritePalette
;============================================================================
; TODO: Document SplashAnimation_RunIntro
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
Game_ShowStartScreen
;============================================================================
[a79a]SplashAnimation_RunIntro:; [$a79a]
[a79a]LDA #$00
[a79c]JSR SplashAnimation_DrawScenery
[a79f]JSR Maybe_SplashAnimation_InitIntroState
[a7a2]LDA #$00
[a7a4]STA a:SplashAnimation_PaletteStage
[a7a7]LDA #$00
[a7a9]STA Music_Current
[a7ab]JSR Screen_ResetForNonGame
[a7ae]@LAB_PRG12__a7ae:; [$a7ae]
[a7ae]JSR WaitForNextFrame
[a7b1]JSR Screen_ResetSpritesForNonGame
[a7b4]JSR SplashAnimation_SomethingUpdateState
[a7b7]JSR SplashAnimation_Maybe_CalcPlayerAnimState
[a7ba]JSR SplashAnimation_Maybe_AnimPlayerStep
[a7bd]LDX a:IntroAnimation_PlayerSizeCounter
[a7c0]CPX #$04
[a7c2]BNE @LAB_PRG12__a7ae
[a7c4]JSR SplashAnimation_Intro_SomethingA708
[a7c7]LDA a:SplashAnimation_PaletteStage
[a7ca]CMP #$20
[a7cc]BNE @LAB_PRG12__a7ae
[a7ce]RTS
;============================================================================
; TODO: Document SplashAnimation_Maybe_CalcPlayerAnimState
;
; INPUTS:
; A
;
; OUTPUTS:
; TODO
;
; XREFS:
;
SplashAnimation_RunIntro
;============================================================================
[a7cf]SplashAnimation_Maybe_CalcPlayerAnimState:; [$a7cf]
[a7cf]LDY #$07
[a7d1]JSR SplashAnimation_Maybe_NextAnimState1
[a7d4]LDY #$07
[a7d6]JSR SplashAnimation_Maybe_NextAnimState2
[a7d9]LDX a:IntroAnimation_PlayerSizeCounter
[a7dc]CMP BYTE_ARRAY_PRG12__a859,X
[a7df]BCS RETURN_A7F0
[a7e1]INC a:IntroAnimation_PlayerSizeCounter
[a7e4]LDA BYTE_ARRAY_PRG12__a85e,X
[a7e7]STA a:SplashAnimation_0692
[a7ea]LDA BYTE_ARRAY_PRG12__a862,X
[a7ed]STA a:SplashAnimation_0693
[a7f0]RETURN_A7F0:; [$a7f0]
[a7f0]RTS
;============================================================================
; TODO: Document SplashAnimation_Maybe_CalcPlayerAnimSize
;
; INPUTS:
; A
;
; OUTPUTS:
; TODO
;
; XREFS:
;
SplashAnimation_RunOutro
;============================================================================
[a7f1]SplashAnimation_Maybe_CalcPlayerAnimSize:; [$a7f1]
[a7f1]LDY #$07
[a7f3]JSR SplashAnimation_Maybe_NextAnimState1
[a7f6]LDY #$07
[a7f8]JSR SplashAnimation_Maybe_NextAnimState2
[a7fb]LDX a:IntroAnimation_PlayerSizeCounter
[a7fe]CMP BYTE_ARRAY_PRG12__a866,X
[a801]BCC RETURN_A7F0
[a803]INC a:IntroAnimation_PlayerSizeCounter
[a806]LDA BYTE_ARRAY_PRG12__a86a,X
[a809]STA a:SplashAnimation_0692
[a80c]LDA BYTE_ARRAY_PRG12__a86e,X
[a80f]STA a:SplashAnimation_0693
[a812]RTS
;============================================================================
; TODO: Document Maybe_SplashAnimation_InitIntroState
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
SplashAnimation_RunIntro
;============================================================================
[a813]Maybe_SplashAnimation_InitIntroState:; [$a813]
[a813]LDA #$18
[a815]STA a:SplashAnimation_068e
[a818]LDA #$ff
[a81a]STA a:SplashAnimation_068f
[a81d]LDA #$00
[a81f]STA a:SplashAnimation_068c
[a822]STA a:IntroAnimation_PlayerSizeCounter
[a825]STA a:SplashAnimation_0690
[a828]STA a:SplashAnimation_0691
[a82b]LDA #$20
[a82d]STA a:SplashAnimation_0692
[a830]LDA #$e0
[a832]STA a:SplashAnimation_0693
[a835]RTS
;============================================================================
; TODO: Document Maybe_SplashAnimation_InitOutroState
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
SplashAnimation_RunOutro
;============================================================================
[a836]Maybe_SplashAnimation_InitOutroState:; [$a836]
[a836]LDA #$70
[a838]STA a:SplashAnimation_068e
[a83b]LDA #$ae
[a83d]STA a:SplashAnimation_068f
[a840]LDA #$00
[a842]STA a:SplashAnimation_068c
[a845]STA a:IntroAnimation_PlayerSizeCounter
[a848]STA a:SplashAnimation_0690
[a84b]STA a:SplashAnimation_0691
[a84e]LDA #$fd
[a850]STA a:SplashAnimation_0692
[a853]LDA #$01
[a855]STA a:SplashAnimation_0693
[a858]RTS
[a859]BYTE_ARRAY_PRG12__a859:; [$a859]
[a859].byte $cc; [0]:
[a85a].byte $bc; [1]:
[a85b].byte $b4; [2]:
[a85c].byte $b0; [3]:
[a85d].byte $00; [4]:
[a85e]BYTE_ARRAY_PRG12__a85e:; [$a85e]
[a85e].byte $11; [0]:
[a85f].byte $0a; [1]:
[a860].byte $05; [2]:
[a861].byte $03; [3]:
[a862]BYTE_ARRAY_PRG12__a862:; [$a862]
[a862].byte $f0; [0]:
[a863].byte $f8; [1]:
[a864].byte $fd; [2]:
[a865].byte $ff; [3]:
[a866]BYTE_ARRAY_PRG12__a866:; [$a866]
[a866].byte $b0; [0]:
[a867].byte $b4; [1]:
[a868].byte $bc; [2]:
[a869].byte $cc; [3]:
[a86a]BYTE_ARRAY_PRG12__a86a:; [$a86a]
[a86a].byte $fb; [0]:
[a86b].byte $f6; [1]:
[a86c].byte $ef; [2]:
[a86d].byte $e0; [3]:
[a86e]BYTE_ARRAY_PRG12__a86e:; [$a86e]
[a86e].byte $03; [0]:
[a86f].byte $08; [1]:
[a870].byte $10; [2]:
[a871].byte $20; [3]:
[a872]SplashAnimation_Maybe_NextAnimState1:; [$a872]
[a872]LDA #$00
[a874]STA Temp_Int24
[a876]LDA a:SplashAnimation_0692
[a879]@LAB_PRG12__a879:; [$a879]
[a879]STA Temp_Int24_M
[a87b]ROL Temp_Int24_M
[a87d]ROR A
[a87e]ROR Temp_Int24
[a880]DEY
[a881]BNE @LAB_PRG12__a879
[a883]CLC
[a884]STA Temp_Int24_M
[a886]LDA Temp_Int24
[a888]CLC
[a889]ADC a:SplashAnimation_0690
[a88c]STA a:SplashAnimation_0690
[a88f]LDA Temp_Int24_M
[a891]ADC a:SplashAnimation_068e
[a894]STA a:SplashAnimation_068e
[a897]RTS
[a898]SplashAnimation_Maybe_NextAnimState2:; [$a898]
[a898]LDA #$00
[a89a]STA Temp_Int24
[a89c]LDA a:SplashAnimation_0693
[a89f]@LAB_PRG12__a89f:; [$a89f]
[a89f]STA Temp_Int24_M
[a8a1]ROL Temp_Int24_M
[a8a3]ROR A
[a8a4]ROR Temp_Int24
[a8a6]DEY
[a8a7]BNE @LAB_PRG12__a89f
[a8a9]CLC
[a8aa]STA Temp_Int24_M
[a8ac]LDA Temp_Int24
[a8ae]CLC
[a8af]ADC a:SplashAnimation_0691
[a8b2]STA a:SplashAnimation_0691
[a8b5]LDA Temp_Int24_M
[a8b7]ADC a:SplashAnimation_068f
[a8ba]STA a:SplashAnimation_068f
[a8bd]RTS
;============================================================================
; TODO: Document SplashAnimation_Maybe_AnimPlayerStep
;
; INPUTS:
; X
;
; OUTPUTS:
; TODO
;
; XREFS:
;
SplashAnimation_RunIntro
;============================================================================
[a8be]SplashAnimation_Maybe_AnimPlayerStep:; [$a8be]
[a8be]JSR SplashAnimation_A90F
[a8c1]LDY a:IntroAnimation_PlayerSizeCounter
[a8c4]CPY #$03
[a8c6]BCS @LAB_PRG12__a8d8
[a8c8]AND #$01
[a8ca]BNE @LAB_PRG12__a8d8
[a8cc]LDA a:SplashAnimation_068c
[a8cf]AND #$0f
[a8d1]BNE @LAB_PRG12__a8d8
[a8d3]LDA #$15
[a8d5]JSR Sound_PlayEffect
[a8d8]@LAB_PRG12__a8d8:; [$a8d8]
[a8d8]LDA BYTE_ARRAY_PRG12__a8de,X
[a8db]JMP SplashAnimation_FuncAA94
[a8de]BYTE_ARRAY_PRG12__a8de:; [$a8de]
[a8de].byte $00; [0]:
[a8df].byte $01; [1]:
[a8e0].byte $02; [2]:
[a8e1].byte $01; [3]:
[a8e2].byte $03; [4]:
[a8e3].byte $04; [5]:
[a8e4].byte $05; [6]:
[a8e5].byte $04; [7]:
[a8e6].byte $06; [8]:
[a8e7].byte $06; [9]:
[a8e8].byte $07; [10]:
[a8e9].byte $07; [11]:
[a8ea].byte $08; [12]:
[a8eb].byte $08; [13]:
[a8ec].byte $09; [14]:
[a8ed].byte $09; [15]:
[a8ee].byte $0a; [16]:
[a8ef].byte $0a; [17]:
[a8f0].byte $0b; [18]:
[a8f1].byte $0b; [19]:
;============================================================================
; TODO: Document SplashAnimation_OutroFuncAF82
;
; INPUTS:
; X
;
; OUTPUTS:
; TODO
;
; XREFS:
;
SplashAnimation_RunOutro
;============================================================================
[a8f2]SplashAnimation_OutroFuncAF82:; [$a8f2]
[a8f2]JSR SplashAnimation_A90F
[a8f5]LDA BYTE_ARRAY_PRG12__a8fb,X
[a8f8]JMP SplashAnimation_FuncAA94
[a8fb]BYTE_ARRAY_PRG12__a8fb:; [$a8fb]
[a8fb].byte $0c; [0]:
[a8fc].byte $0c; [1]:
[a8fd].byte $0d; [2]:
[a8fe].byte $0d; [3]:
[a8ff].byte $0e; [4]:
[a900].byte $0e; [5]:
[a901].byte $0f; [6]:
[a902].byte $0f; [7]:
[a903].byte $10; [8]:
[a904].byte $10; [9]:
[a905].byte $11; [10]:
[a906].byte $11; [11]:
[a907].byte $12; [12]:
[a908].byte $13; [13]:
[a909].byte $14; [14]:
[a90a].byte $13; [15]:
[a90b].byte $15; [16]:
[a90c].byte $16; [17]:
[a90d].byte $17; [18]:
[a90e].byte $16; [19]:
[a90f]SplashAnimation_A90F:; [$a90f]
[a90f]LDA a:SplashAnimation_068e
[a912]STA a:SplashAnimation_0689
[a915]LDA a:SplashAnimation_068f
[a918]STA a:SplashAnimation_068a
[a91b]LDA a:SplashAnimation_068c
[a91e]INC a:SplashAnimation_068c
[a921]LSR A
[a922]LSR A
[a923]LSR A
[a924]LSR A
[a925]AND #$03
[a927]STA Temp_Int24
[a929]LDA a:IntroAnimation_PlayerSizeCounter
[a92c]ASL A
[a92d]ASL A
[a92e]ORA Temp_Int24
[a930]TAX
[a931]RTS
;============================================================================
; TODO: Document SplashAnimation_RunOutro
;
; INPUTS:
; X
;
; OUTPUTS:
; TODO
;
; XREFS:
;
IScriptAction_FinishGame
;============================================================================
[a932]SplashAnimation_RunOutro:; [$a932]
[a932]LDA #$01
[a934]JSR SplashAnimation_DrawScenery
[a937]JSR Maybe_SplashAnimation_InitOutroState
[a93a]JSR SplashAnimation_SomethingOutro_A99C
[a93d]LDA #$0c
[a93f]STA Music_Current
[a941]JSR Screen_ResetForNonGame
[a944]@LAB_PRG12__a944:; [$a944]
[a944]JSR WaitForNextFrame
[a947]JSR Screen_ResetSpritesForNonGame
[a94a]JSR SplashAnimation_SomethingUpdateState
[a94d]JSR SplashAnimation_Maybe_CalcPlayerAnimSize
[a950]JSR SplashAnimation_OutroFuncAF82
[a953]JSR SplashAnimation_SomethingOutroA9C9
[a956]JSR SplashAnimation_SomethingA9F2
[a959]JSR SplashAnimation_UpdateOutro
[a95c]LDA a:SplashAnimation_068f
[a95f]CMP #$fa
[a961]BCC @LAB_PRG12__a944
[a963]@LAB_PRG12__a963:; [$a963]
[a963]JSR WaitForNextFrame
[a966]JSR Screen_ResetSpritesForNonGame
[a969]JSR SplashAnimation_SomethingUpdateState
[a96c]JSR SplashAnimation_SomethingOutroA9C9
[a96f]JSR SplashAnimation_SomethingA9F2
[a972]JSR SplashAnimation_UpdateOutro
[a975]LDA Music_Current
[a977]BNE @LAB_PRG12__a963
[a979]LDA #$10
[a97b]STA InterruptCounter
[a97d]@LAB_PRG12__a97d:; [$a97d]
[a97d]JSR WaitForNextFrame
[a980]JSR Screen_ResetSpritesForNonGame
[a983]JSR SplashAnimation_SomethingUpdateState
[a986]JSR SplashAnimation_SomethingOutroA9C9
[a989]JSR SplashAnimation_SomethingA9F2
[a98c]JSR SplashAnimation_UpdateOutro
[a98f]LDA InterruptCounter
[a991]BNE @LAB_PRG12__a97d
[a993]RTS
[a994]BYTE_ARRAY_PRG12__a994:; [$a994]
[a994].byte $d8; [0]:
[a995]BYTE_ARRAY_PRG12__a994_1_:; [$a995]
[a995].byte $e0; [1]:
[a996]BYTE_ARRAY_PRG12__a996:; [$a996]
[a996].byte $c2; [0]:
[a997]BYTE_ARRAY_PRG12__a996_1_:; [$a997]
[a997].byte $d0; [1]:
[a998]BYTE_ARRAY_PRG12__a998:; [$a998]
[a998].byte $ff; [0]:
[a999]BYTE_ARRAY_PRG12__a998_1_:; [$a999]
[a999].byte $ff; [1]:
[a99a]BYTE_ARRAY_PRG12__a99a:; [$a99a]
[a99a].byte $00; [0]:
[a99b]BYTE_ARRAY_PRG12__a99a_1_:; [$a99b]
[a99b].byte $01; [1]:
;============================================================================
; TODO: Document SplashAnimation_SomethingOutro_A99C
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
SplashAnimation_RunOutro
;============================================================================
[a99c]SplashAnimation_SomethingOutro_A99C:; [$a99c]
[a99c]LDX #$00
[a99e]JSR SpashAnimation_SomethingOutro_a9a2
[a9a1]INX
;
; v-- Fall through --v
;
;============================================================================
; TODO: Document SpashAnimation_SomethingOutro_a9a2
;
; INPUTS:
; X
;
; OUTPUTS:
; TODO
;
; XREFS:
;
SplashAnimation_SomethingOutro_A99C
;============================================================================
[a9a2]SpashAnimation_SomethingOutro_a9a2:; [$a9a2]
[a9a2]LDA #$00
[a9a4]STA SplashAnimation_0694,X
[a9a7]STA SplashAnimation_0696,X
[a9aa]STA SplashAnimation_069c,X
[a9ad]STA SplashAnimation_069e,X
[a9b0]LDA BYTE_ARRAY_PRG12__a994,X
[a9b3]STA SplashAnimation_0698,X
[a9b6]LDA BYTE_ARRAY_PRG12__a996,X
[a9b9]STA SplashAnimation_069a,X
[a9bc]LDA BYTE_ARRAY_PRG12__a998,X
[a9bf]STA SplashAnimation_06a0,X
[a9c2]LDA BYTE_ARRAY_PRG12__a99a,X
[a9c5]STA SplashAnimation_06a2,X
[a9c8]RTS
;============================================================================
; TODO: Document SplashAnimation_SomethingOutroA9C9
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
SplashAnimation_RunOutro
;============================================================================
[a9c9]SplashAnimation_SomethingOutroA9C9:; [$a9c9]
[a9c9]LDX #$00
[a9cb]JSR @LAB_PRG12__a9cf
[a9ce]INX
[a9cf]@LAB_PRG12__a9cf:; [$a9cf]
[a9cf]LDY #$01
[a9d1]JSR SpashAnimation_SomethingOutro_aa20
[a9d4]LDY #$01
[a9d6]JSR SpashAnimation_SomethingOutro_aa46
[a9d9]LDY SplashAnimation_0696,X
[a9dc]INY
[a9dd]CPY #$08
[a9df]BNE @LAB_PRG12__a9ed
[a9e1]INC SplashAnimation_0694,X
[a9e4]LDA SplashAnimation_0694,X
[a9e7]CMP #$0a
[a9e9]BEQ SpashAnimation_SomethingOutro_a9a2
[a9eb]LDY #$00
[a9ed]@LAB_PRG12__a9ed:; [$a9ed]
[a9ed]TYA
[a9ee]STA SplashAnimation_0696,X
[a9f1]RETURN_A9F1:; [$a9f1]
[a9f1]RTS
;============================================================================
; TODO: Document SplashAnimation_SomethingA9F2
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
SplashAnimation_RunOutro
;============================================================================
[a9f2]SplashAnimation_SomethingA9F2:; [$a9f2]
[a9f2]LDX #$00
[a9f4]JSR @LAB_PRG12__a9f8
[a9f7]INX
[a9f8]@LAB_PRG12__a9f8:; [$a9f8]
[a9f8]LDA SplashAnimation_0694,X
[a9fb]CMP #$03
[a9fd]BCS RETURN_A9F1
[a9ff]LDA SplashAnimation_0698,X
[aa02]STA a:SplashAnimation_0689
[aa05]LDA SplashAnimation_069a,X
[aa08]STA a:SplashAnimation_068a
[aa0b]TXA
[aa0c]ASL A
[aa0d]ASL A
[aa0e]ORA SplashAnimation_0694,X
[aa11]TAY
[aa12]LDA BYTE_ARRAY_PRG12__aa18,Y
[aa15]JMP SplashAnimation_FuncAA94
[aa18]BYTE_ARRAY_PRG12__aa18:; [$aa18]
[aa18].byte $1a; [0]:
[aa19].byte $1b; [1]:
[aa1a].byte $1c; [2]:
[aa1b].byte $00; [3]:
[aa1c].byte $1d; [4]:
[aa1d].byte $1e; [5]:
[aa1e].byte $1f; [6]:
[aa1f].byte $00; [7]:
;============================================================================
; TODO: Document SpashAnimation_SomethingOutro_aa20
;
; INPUTS:
; X
; Y
;
; OUTPUTS:
; TODO
;============================================================================
[aa20]SpashAnimation_SomethingOutro_aa20:; [$aa20]
[aa20]LDA #$00
[aa22]STA Temp_Int24
[aa24]LDA SplashAnimation_06a0,X
[aa27]@LAB_PRG12__aa27:; [$aa27]
[aa27]STA Temp_Int24_M
[aa29]ROL Temp_Int24_M
[aa2b]ROR A
[aa2c]ROR Temp_Int24
[aa2e]DEY
[aa2f]BNE @LAB_PRG12__aa27
[aa31]CLC
[aa32]STA Temp_Int24_M
[aa34]LDA Temp_Int24
[aa36]CLC
[aa37]ADC SplashAnimation_069c,X
[aa3a]STA SplashAnimation_069c,X
[aa3d]LDA Temp_Int24_M
[aa3f]ADC SplashAnimation_0698,X
[aa42]STA SplashAnimation_0698,X
[aa45]RTS
;============================================================================
; TODO: Document SpashAnimation_SomethingOutro_aa46
;
; INPUTS:
; X
; Y
;
; OUTPUTS:
; TODO
;============================================================================
[aa46]SpashAnimation_SomethingOutro_aa46:; [$aa46]
[aa46]LDA #$00
[aa48]STA Temp_Int24
[aa4a]LDA SplashAnimation_06a2,X
[aa4d]@LAB_PRG12__aa4d:; [$aa4d]
[aa4d]STA Temp_Int24_M
[aa4f]ROL Temp_Int24_M
[aa51]ROR A
[aa52]ROR Temp_Int24
[aa54]DEY
[aa55]BNE @LAB_PRG12__aa4d
[aa57]CLC
[aa58]STA Temp_Int24_M
[aa5a]LDA Temp_Int24
[aa5c]CLC
[aa5d]ADC SplashAnimation_069e,X
[aa60]STA SplashAnimation_069e,X
[aa63]LDA Temp_Int24_M
[aa65]ADC SplashAnimation_069a,X
[aa68]STA SplashAnimation_069a,X
[aa6b]RTS
;============================================================================
; TODO: Document SplashAnimation_UpdateOutro
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
SplashAnimation_RunOutro
;============================================================================
[aa6c]SplashAnimation_UpdateOutro:; [$aa6c]
[aa6c]LDA #$e0
[aa6e]STA a:SplashAnimation_0689
[aa71]LDA #$78
[aa73]STA a:SplashAnimation_068a
[aa76]LDA InterruptCounter
[aa78]AND #$10
[aa7a]LSR A
[aa7b]LSR A
[aa7c]LSR A
[aa7d]LSR A
[aa7e]ADC #$18
[aa80]JMP SplashAnimation_FuncAA94
;============================================================================
; TODO: Document SplashAnimation_SomethingUpdateState
;
; INPUTS:
; None.
;
; OUTPUTS:
; TODO
;
; XREFS:
;
SplashAnimation_RunIntro
;
SplashAnimation_RunOutro
;============================================================================
[aa83]SplashAnimation_SomethingUpdateState:; [$aa83]
[aa83]LDX #$00
[aa85]LDA #$f0
[aa87]@LAB_PRG12__aa87:; [$aa87]
[aa87]STA SPRITE_0_RANGE_1_START,X
[aa8a]INX
[aa8b]INX
[aa8c]INX
[aa8d]INX
[aa8e]BNE @LAB_PRG12__aa87
[aa90]STX a:SplashAnimation_0688
[aa93]RTS
[aa94]SplashAnimation_FuncAA94:; [$aa94]
[aa94]TAY
[aa95]LDA BYTE_ARRAY_PRG12__ab17,Y
[aa98]STA Temp_Int24
[aa9a]LDA BYTE_ARRAY_PRG12__ab37,Y
[aa9d]STA Temp_Int24_M
[aa9f]LDY #$00
[aaa1]LDA a:SplashAnimation_0689
[aaa4]CLC
[aaa5]ADC (Temp_Int24),Y
[aaa7]STA a:SplashAnimation_0689
[aaaa]INY
[aaab]LDA a:SplashAnimation_068a
[aaae]CLC
[aaaf]ADC (Temp_Int24),Y
[aab1]CMP #$f0
[aab3]BCS @_return
[aab5]STA a:SplashAnimation_068a
[aab8]INY
[aab9]LDA (Temp_Int24),Y
[aabb]STA a:DAT_068b
[aabe]INY
[aabf]LDA (Temp_Int24),Y
[aac1]STA TextBox_ContentsY
[aac3]INY
[aac4]TXA
[aac5]PHA
[aac6]LDX a:SplashAnimation_0688
[aac9]@LAB_PRG12__aac9:; [$aac9]
[aac9]LDA a:DAT_068b
[aacc]STA Temp_Int24_U
[aace]LDA a:SplashAnimation_0689
[aad1]STA TextBox_ContentsX
[aad3]@LAB_PRG12__aad3:; [$aad3]
[aad3]LDA (Temp_Int24),Y
[aad5]INY
[aad6]CMP #$ff
[aad8]BEQ @LAB_PRG12__aaf9
[aada]STA SPRITE0_TILE,X
[aadd]LDA a:SplashAnimation_068a
[aae0]CMP #$f0
[aae2]BCS @LAB_PRG12__ab11
[aae4]LDA a:SplashAnimation_068a
[aae7]STA SPRITE_0_RANGE_1_START,X
[aaea]LDA (Temp_Int24),Y
[aaec]INY
[aaed]STA SPRITE0_ATTRS,X
[aaf0]LDA TextBox_ContentsX
[aaf2]STA SPRITE0_X,X
[aaf5]INX
[aaf6]INX
[aaf7]INX
[aaf8]INX
[aaf9]@LAB_PRG12__aaf9:; [$aaf9]
[aaf9]LDA TextBox_ContentsX
[aafb]CLC
[aafc]ADC #$08
[aafe]STA TextBox_ContentsX
[ab00]DEC Temp_Int24_U
[ab02]BNE @LAB_PRG12__aad3
[ab04]LDA a:SplashAnimation_068a
[ab07]CLC
[ab08]ADC #$08
[ab0a]STA a:SplashAnimation_068a
[ab0d]DEC TextBox_ContentsY
[ab0f]BNE @LAB_PRG12__aac9
[ab11]@LAB_PRG12__ab11:; [$ab11]
[ab11]STX a:SplashAnimation_0688
[ab14]PLA
[ab15]TAX
[ab16]@_return:; [$ab16]
[ab16]RTS
[ab17]BYTE_ARRAY_PRG12__ab17:; [$ab17]
[ab17].byte $57; [0]:
[ab18].byte $6f; [1]:
[ab19].byte $87; [2]:
[ab1a].byte $9f; [3]:
[ab1b].byte $b3; [4]:
[ab1c].byte $c7; [5]:
[ab1d].byte $db; [6]:
[ab1e].byte $eb; [7]:
[ab1f].byte $fb; [8]:
[ab20].byte $05; [9]:
[ab21].byte $0f; [10]:
[ab22].byte $17; [11]:
[ab23].byte $1f; [12]:
[ab24].byte $27; [13]:
[ab25].byte $2f; [14]:
[ab26].byte $39; [15]:
[ab27].byte $43; [16]:
[ab28].byte $53; [17]:
[ab29].byte $63; [18]:
[ab2a].byte $77; [19]:
[ab2b].byte $8b; [20]:
[ab2c].byte $9f; [21]:
[ab2d].byte $b7; [22]:
[ab2e].byte $cf; [23]:
[ab2f].byte $e7; [24]:
[ab30].byte $26; [25]:
[ab31].byte $65; [26]:
[ab32].byte $6b; [27]:
[ab33].byte $71; [28]:
[ab34].byte $77; [29]:
[ab35].byte $7d; [30]:
[ab36].byte $83; [31]:
[ab37]BYTE_ARRAY_PRG12__ab37:; [$ab37]
[ab37].byte $ab; [0]:
[ab38].byte $ab; [1]:
[ab39].byte $ab; [2]:
[ab3a].byte $ab; [3]:
[ab3b].byte $ab; [4]:
[ab3c].byte $ab; [5]:
[ab3d].byte $ab; [6]:
[ab3e].byte $ab; [7]:
[ab3f].byte $ab; [8]:
[ab40].byte $ac; [9]:
[ab41].byte $ac; [10]:
[ab42].byte $ac; [11]:
[ab43].byte $ac; [12]:
[ab44].byte $ac; [13]:
[ab45].byte $ac; [14]:
[ab46].byte $ac; [15]:
[ab47].byte $ac; [16]:
[ab48].byte $ac; [17]:
[ab49].byte $ac; [18]:
[ab4a].byte $ac; [19]:
[ab4b].byte $ac; [20]:
[ab4c].byte $ac; [21]:
[ab4d].byte $ac; [22]:
[ab4e].byte $ac; [23]:
[ab4f].byte $ac; [24]:
[ab50].byte $ad; [25]:
[ab51].byte $ad; [26]:
[ab52].byte $ad; [27]:
[ab53].byte $ad; [28]:
[ab54].byte $ad; [29]:
[ab55].byte $ad; [30]:
[ab56].byte $ad; [31]:
[ab57].byte $f8; [0]:
[ab58].byte $ec; [1]:
[ab59].byte $02; [2]:
[ab5a].byte $05; [3]:
[ab5b].byte $46; [4]:
[ab5c].byte $00; [5]:
[ab5d].byte $47; [6]:
[ab5e].byte $00; [7]:
[ab5f].byte $48; [8]:
[ab60].byte $00; [9]:
[ab61].byte $49; [10]:
[ab62].byte $00; [11]:
[ab63].byte $4a; [12]:
[ab64].byte $00; [13]:
[ab65].byte $4b; [14]:
[ab66].byte $00; [15]:
[ab67].byte $4c; [16]:
[ab68].byte $00; [17]:
[ab69].byte $4d; [18]:
[ab6a].byte $00; [19]:
[ab6b].byte $4e; [20]:
[ab6c].byte $00; [21]:
[ab6d].byte $4f; [22]:
[ab6e].byte $00; [23]:
[ab6f].byte $f8; [0]:
[ab70].byte $ec; [1]:
[ab71].byte $02; [2]:
[ab72].byte $05; [3]:
[ab73].byte $50; [4]:
[ab74].byte $00; [5]:
[ab75].byte $51; [6]:
[ab76].byte $00; [7]:
[ab77].byte $52; [8]:
[ab78].byte $00; [9]:
[ab79].byte $53; [10]:
[ab7a].byte $00; [11]:
[ab7b].byte $54; [12]:
[ab7c].byte $00; [13]:
[ab7d].byte $55; [14]:
[ab7e].byte $00; [15]:
[ab7f].byte $56; [16]:
[ab80].byte $00; [17]:
[ab81].byte $57; [18]:
[ab82].byte $00; [19]:
[ab83].byte $58; [20]:
[ab84].byte $00; [21]:
[ab85].byte $59; [22]:
[ab86].byte $00; [23]:
[ab87].byte $f8; [0]:
[ab88].byte $ec; [1]:
[ab89].byte $02; [2]:
[ab8a].byte $05; [3]:
[ab8b].byte $46; [4]:
[ab8c].byte $00; [5]:
[ab8d].byte $47; [6]:
[ab8e].byte $00; [7]:
[ab8f].byte $5a; [8]:
[ab90].byte $00; [9]:
[ab91].byte $5b; [10]:
[ab92].byte $00; [11]:
[ab93].byte $5c; [12]:
[ab94].byte $00; [13]:
[ab95].byte $5d; [14]:
[ab96].byte $00; [15]:
[ab97].byte $5e; [16]:
[ab98].byte $00; [17]:
[ab99].byte $5f; [18]:
[ab9a].byte $00; [19]:
[ab9b].byte $60; [20]:
[ab9c].byte $00; [21]:
[ab9d].byte $61; [22]:
[ab9e].byte $00; [23]:
[ab9f].byte $f8; [0]:
[aba0].byte $f0; [1]:
[aba1].byte $02; [2]:
[aba2].byte $04; [3]:
[aba3].byte $62; [4]:
[aba4].byte $00; [5]:
[aba5].byte $63; [6]:
[aba6].byte $00; [7]:
[aba7].byte $64; [8]:
[aba8].byte $00; [9]:
[aba9].byte $65; [10]:
[abaa].byte $00; [11]:
[abab].byte $66; [12]:
[abac].byte $00; [13]:
[abad].byte $67; [14]:
[abae].byte $00; [15]:
[abaf].byte $68; [16]:
[abb0].byte $00; [17]:
[abb1].byte $69; [18]:
[abb2].byte $00; [19]:
[abb3].byte $f8; [0]:
[abb4].byte $f0; [1]:
[abb5].byte $02; [2]:
[abb6].byte $04; [3]:
[abb7].byte $62; [4]:
[abb8].byte $00; [5]:
[abb9].byte $63; [6]:
[abba].byte $00; [7]:
[abbb].byte $70; [8]:
[abbc].byte $00; [9]:
[abbd].byte $71; [10]:
[abbe].byte $00; [11]:
[abbf].byte $72; [12]:
[abc0].byte $00; [13]:
[abc1].byte $73; [14]:
[abc2].byte $00; [15]:
[abc3].byte $74; [16]:
[abc4].byte $00; [17]:
[abc5].byte $75; [18]:
[abc6].byte $00; [19]:
[abc7].byte $f8; [0]:
[abc8].byte $f0; [1]:
[abc9].byte $02; [2]:
[abca].byte $04; [3]:
[abcb].byte $62; [4]:
[abcc].byte $00; [5]:
[abcd].byte $63; [6]:
[abce].byte $00; [7]:
[abcf].byte $6a; [8]:
[abd0].byte $00; [9]:
[abd1].byte $6b; [10]:
[abd2].byte $00; [11]:
[abd3].byte $6c; [12]:
[abd4].byte $00; [13]:
[abd5].byte $6d; [14]:
[abd6].byte $00; [15]:
[abd7].byte $6e; [16]:
[abd8].byte $00; [17]:
[abd9].byte $6f; [18]:
[abda].byte $00; [19]:
[abdb].byte $f8; [0]:
[abdc].byte $f4; [1]:
[abdd].byte $02; [2]:
[abde].byte $03; [3]:
[abdf].byte $76; [4]:
[abe0].byte $00; [5]:
[abe1].byte $77; [6]:
[abe2].byte $00; [7]:
[abe3].byte $78; [8]:
[abe4].byte $00; [9]:
[abe5].byte $79; [10]:
[abe6].byte $00; [11]:
[abe7].byte $34; [12]:
[abe8].byte $00; [13]:
[abe9].byte $7b; [14]:
[abea].byte $00; [15]:
[abeb].byte $f8; [0]:
[abec].byte $f4; [1]:
[abed].byte $02; [2]:
[abee].byte $03; [3]:
[abef].byte $76; [4]:
[abf0].byte $00; [5]:
[abf1].byte $77; [6]:
[abf2].byte $00; [7]:
[abf3].byte $7c; [8]:
[abf4].byte $00; [9]:
[abf5].byte $7d; [10]:
[abf6].byte $00; [11]:
[abf7].byte $3a; [12]:
[abf8].byte $00; [13]:
[abf9].byte $7f; [14]:
[abfa].byte $00; [15]:
[abfb].byte $fc; [0]:
[abfc].byte $f4; [1]:
[abfd].byte $01; [2]:
[abfe].byte $03; [3]:
[abff].byte $36; [4]:
[ac00].byte $00; [5]:
[ac01].byte $3d; [6]:
[ac02].byte $00; [7]:
[ac03].byte $3e; [8]:
[ac04].byte $00; [9]:
[ac05].byte $fc; [0]:
[ac06].byte $f4; [1]:
[ac07].byte $01; [2]:
[ac08].byte $03; [3]:
[ac09].byte $37; [4]:
[ac0a].byte $00; [5]:
[ac0b].byte $40; [6]:
[ac0c].byte $00; [7]:
[ac0d].byte $41; [8]:
[ac0e].byte $00; [9]:
[ac0f].byte $fc; [0]:
[ac10].byte $f8; [1]:
[ac11].byte $01; [2]:
[ac12].byte $02; [3]:
[ac13].byte $7a; [4]:
[ac14].byte $00; [5]:
[ac15].byte $43; [6]:
[ac16].byte $00; [7]:
[ac17].byte $fc; [0]:
[ac18].byte $f8; [1]:
[ac19].byte $01; [2]:
[ac1a].byte $02; [3]:
[ac1b].byte $7e; [4]:
[ac1c].byte $00; [5]:
[ac1d].byte $45; [6]:
[ac1e].byte $00; [7]:
[ac1f].byte $fc; [0]:
[ac20].byte $f8; [1]:
[ac21].byte $01; [2]:
[ac22].byte $02; [3]:
[ac23].byte $42; [4]:
[ac24].byte $00; [5]:
[ac25].byte $43; [6]:
[ac26].byte $00; [7]:
[ac27].byte $fc; [0]:
[ac28].byte $f8; [1]:
[ac29].byte $01; [2]:
[ac2a].byte $02; [3]:
[ac2b].byte $44; [4]:
[ac2c].byte $00; [5]:
[ac2d].byte $45; [6]:
[ac2e].byte $00; [7]:
[ac2f].byte $fc; [0]:
[ac30].byte $f4; [1]:
[ac31].byte $01; [2]:
[ac32].byte $03; [3]:
[ac33].byte $3c; [4]:
[ac34].byte $00; [5]:
[ac35].byte $3d; [6]:
[ac36].byte $00; [7]:
[ac37].byte $3e; [8]:
[ac38].byte $00; [9]:
[ac39].byte $fc; [0]:
[ac3a].byte $f4; [1]:
[ac3b].byte $01; [2]:
[ac3c].byte $03; [3]:
[ac3d].byte $3f; [4]:
[ac3e].byte $00; [5]:
[ac3f].byte $40; [6]:
[ac40].byte $00; [7]:
[ac41].byte $41; [8]:
[ac42].byte $00; [9]:
[ac43].byte $f8; [0]:
[ac44].byte $f4; [1]:
[ac45].byte $02; [0]:
[ac46].byte $03; [1]:
[ac47].byte $30; [2]:
[ac48].byte $00; [3]:
[ac49].byte $31; [4]:
[ac4a].byte $00; [5]:
[ac4b].byte $32; [6]:
[ac4c].byte $00; [7]:
[ac4d].byte $33; [8]:
[ac4e].byte $00; [9]:
[ac4f].byte $34; [10]:
[ac50].byte $00; [11]:
[ac51].byte $35; [12]:
[ac52].byte $00; [13]:
[ac53].byte $f8; [0]:
[ac54].byte $f4; [1]:
[ac55].byte $02; [2]:
[ac56].byte $03; [3]:
[ac57].byte $30; [4]:
[ac58].byte $00; [5]:
[ac59].byte $31; [6]:
[ac5a].byte $00; [7]:
[ac5b].byte $38; [8]:
[ac5c].byte $00; [9]:
[ac5d].byte $39; [10]:
[ac5e].byte $00; [11]:
[ac5f].byte $3a; [12]:
[ac60].byte $00; [13]:
[ac61].byte $3b; [14]:
[ac62].byte $00; [15]:
[ac63].byte $f8; [0]:
[ac64].byte $f0; [1]:
[ac65].byte $02; [2]:
[ac66].byte $04; [3]:
[ac67].byte $1c; [4]:
[ac68].byte $00; [5]:
[ac69].byte $1d; [6]:
[ac6a].byte $00; [7]:
[ac6b].byte $1e; [8]:
[ac6c].byte $00; [9]:
[ac6d].byte $1f; [10]:
[ac6e].byte $00; [11]:
[ac6f].byte $20; [12]:
[ac70].byte $00; [13]:
[ac71].byte $21; [14]:
[ac72].byte $00; [15]:
[ac73].byte $22; [16]:
[ac74].byte $00; [17]:
[ac75].byte $23; [18]:
[ac76].byte $00; [19]:
[ac77].byte $f8; [0]:
[ac78].byte $f0; [1]:
[ac79].byte $02; [2]:
[ac7a].byte $04; [3]:
[ac7b].byte $1c; [4]:
[ac7c].byte $00; [5]:
[ac7d].byte $1d; [6]:
[ac7e].byte $00; [7]:
[ac7f].byte $2a; [8]:
[ac80].byte $00; [9]:
[ac81].byte $2b; [10]:
[ac82].byte $00; [11]:
[ac83].byte $2c; [12]:
[ac84].byte $00; [13]:
[ac85].byte $2d; [14]:
[ac86].byte $00; [15]:
[ac87].byte $2e; [16]:
[ac88].byte $00; [17]:
[ac89].byte $2f; [18]:
[ac8a].byte $00; [19]:
[ac8b].byte $f8; [0]:
[ac8c].byte $f0; [1]:
[ac8d].byte $02; [2]:
[ac8e].byte $04; [3]:
[ac8f].byte $1c; [4]:
[ac90].byte $00; [5]:
[ac91].byte $1d; [6]:
[ac92].byte $00; [7]:
[ac93].byte $24; [8]:
[ac94].byte $00; [9]:
[ac95].byte $25; [10]:
[ac96].byte $00; [11]:
[ac97].byte $26; [12]:
[ac98].byte $00; [13]:
[ac99].byte $27; [14]:
[ac9a].byte $00; [15]:
[ac9b].byte $28; [16]:
[ac9c].byte $00; [17]:
[ac9d].byte $29; [18]:
[ac9e].byte $00; [19]:
[ac9f].byte $f8; [0]:
[aca0].byte $ec; [1]:
[aca1].byte $02; [2]:
[aca2].byte $05; [3]:
[aca3].byte $00; [4]:
[aca4].byte $00; [5]:
[aca5].byte $01; [6]:
[aca6].byte $00; [7]:
[aca7].byte $02; [8]:
[aca8].byte $00; [9]:
[aca9].byte $03; [10]:
[acaa].byte $00; [11]:
[acab].byte $04; [12]:
[acac].byte $00; [13]:
[acad].byte $05; [14]:
[acae].byte $00; [15]:
[acaf].byte $06; [16]:
[acb0].byte $00; [17]:
[acb1].byte $07; [18]:
[acb2].byte $00; [19]:
[acb3].byte $08; [20]:
[acb4].byte $00; [21]:
[acb5].byte $09; [22]:
[acb6].byte $00; [23]:
[acb7].byte $f8; [0]:
[acb8].byte $ec; [1]:
[acb9].byte $02; [2]:
[acba].byte $05; [3]:
[acbb].byte $0a; [4]:
[acbc].byte $00; [5]:
[acbd].byte $0b; [6]:
[acbe].byte $00; [7]:
[acbf].byte $0c; [8]:
[acc0].byte $00; [9]:
[acc1].byte $0d; [10]:
[acc2].byte $00; [11]:
[acc3].byte $0e; [12]:
[acc4].byte $00; [13]:
[acc5].byte $0f; [14]:
[acc6].byte $00; [15]:
[acc7].byte $10; [16]:
[acc8].byte $00; [17]:
[acc9].byte $11; [18]:
[acca].byte $00; [19]:
[accb].byte $12; [20]:
[accc].byte $00; [21]:
[accd].byte $13; [22]:
[acce].byte $00; [23]:
[accf].byte $f8; [0]:
[acd0].byte $ec; [1]:
[acd1].byte $02; [2]:
[acd2].byte $05; [3]:
[acd3].byte $00; [4]:
[acd4].byte $00; [5]:
[acd5].byte $01; [6]:
[acd6].byte $00; [7]:
[acd7].byte $14; [8]:
[acd8].byte $00; [9]:
[acd9].byte $15; [10]:
[acda].byte $00; [11]:
[acdb].byte $16; [12]:
[acdc].byte $00; [13]:
[acdd].byte $17; [14]:
[acde].byte $00; [15]:
[acdf].byte $18; [16]:
[ace0].byte $00; [17]:
[ace1].byte $19; [18]:
[ace2].byte $00; [19]:
[ace3].byte $1a; [20]:
[ace4].byte $00; [21]:
[ace5].byte $1b; [22]:
[ace6].byte $00; [23]:
[ace7].byte $00; [0]:
[ace8].byte $00; [1]:
[ace9].byte $04; [2]:
[acea].byte $0b; [3]:
[aceb].byte $ff; [4]:
[acec].byte $80; [5]:
[aced].byte $01; [6]:
[acee].byte $83; [7]:
[acef].byte $01; [8]:
[acf0].byte $83; [9]:
[acf1].byte $01; [10]:
[acf2].byte $ff; [11]:
[acf3].byte $81; [12]:
[acf4].byte $01; [13]:
[acf5].byte $8e; [14]:
[acf6].byte $01; [15]:
[acf7].byte $ff; [16]:
[acf8].byte $ff; [17]:
[acf9].byte $81; [18]:
[acfa].byte $01; [19]:
[acfb].byte $ff; [20]:
[acfc].byte $ff; [21]:
[acfd].byte $ff; [22]:
[acfe].byte $81; [23]:
[acff].byte $01; [24]:
[ad00].byte $ff; [25]:
[ad01].byte $ff; [26]:
[ad02].byte $ff; [27]:
[ad03].byte $81; [28]:
[ad04].byte $01; [29]:
[ad05].byte $ff; [30]:
[ad06].byte $ff; [31]:
[ad07].byte $ff; [32]:
[ad08].byte $81; [33]:
[ad09].byte $01; [34]:
[ad0a].byte $ff; [35]:
[ad0b].byte $ff; [36]:
[ad0c].byte $ff; [37]:
[ad0d].byte $81; [38]:
[ad0e].byte $01; [39]:
[ad0f].byte $ff; [40]:
[ad10].byte $ff; [41]:
[ad11].byte $ff; [42]:
[ad12].byte $81; [43]:
[ad13].byte $01; [44]:
[ad14].byte $ff; [45]:
[ad15].byte $ff; [46]:
[ad16].byte $ff; [47]:
[ad17].byte $81; [48]:
[ad18].byte $01; [49]:
[ad19].byte $ff; [50]:
[ad1a].byte $ff; [51]:
[ad1b].byte $84; [52]:
[ad1c].byte $01; [53]:
[ad1d].byte $85; [54]:
[ad1e].byte $01; [55]:
[ad1f].byte $ff; [56]:
[ad20].byte $ff; [57]:
[ad21].byte $ff; [58]:
[ad22].byte $8f; [59]:
[ad23].byte $01; [60]:
[ad24].byte $ff; [61]:
[ad25].byte $ff; [62]:
[ad26].byte $00; [0]:
[ad27].byte $00; [1]:
[ad28].byte $04; [2]:
[ad29].byte $0b; [3]:
[ad2a].byte $ff; [4]:
[ad2b].byte $82; [5]:
[ad2c].byte $01; [6]:
[ad2d].byte $83; [7]:
[ad2e].byte $81; [8]:
[ad2f].byte $83; [9]:
[ad30].byte $81; [10]:
[ad31].byte $ff; [11]:
[ad32].byte $81; [12]:
[ad33].byte $41; [13]:
[ad34].byte $8e; [14]:
[ad35].byte $01; [15]:
[ad36].byte $ff; [16]:
[ad37].byte $ff; [17]:
[ad38].byte $81; [18]:
[ad39].byte $41; [19]:
[ad3a].byte $ff; [20]:
[ad3b].byte $ff; [21]:
[ad3c].byte $ff; [22]:
[ad3d].byte $81; [23]:
[ad3e].byte $41; [24]:
[ad3f].byte $ff; [25]:
[ad40].byte $ff; [26]:
[ad41].byte $ff; [27]:
[ad42].byte $81; [28]:
[ad43].byte $41; [29]:
[ad44].byte $ff; [30]:
[ad45].byte $ff; [31]:
[ad46].byte $ff; [32]:
[ad47].byte $81; [33]:
[ad48].byte $41; [34]:
[ad49].byte $ff; [35]:
[ad4a].byte $ff; [36]:
[ad4b].byte $ff; [37]:
[ad4c].byte $81; [38]:
[ad4d].byte $41; [39]:
[ad4e].byte $ff; [40]:
[ad4f].byte $ff; [41]:
[ad50].byte $ff; [42]:
[ad51].byte $81; [43]:
[ad52].byte $41; [44]:
[ad53].byte $ff; [45]:
[ad54].byte $ff; [46]:
[ad55].byte $ff; [47]:
[ad56].byte $81; [48]:
[ad57].byte $41; [49]:
[ad58].byte $ff; [50]:
[ad59].byte $ff; [51]:
[ad5a].byte $86; [52]:
[ad5b].byte $01; [53]:
[ad5c].byte $87; [54]:
[ad5d].byte $41; [55]:
[ad5e].byte $ff; [56]:
[ad5f].byte $ff; [57]:
[ad60].byte $ff; [58]:
[ad61].byte $8f; [59]:
[ad62].byte $41; [60]:
[ad63].byte $ff; [61]:
[ad64].byte $ff; [62]:
[ad65].byte $00; [0]:
[ad66].byte $00; [1]:
[ad67].byte $01; [2]:
[ad68].byte $01; [3]:
[ad69].byte $88; [4]:
[ad6a].byte $01; [5]:
[ad6b].byte $00; [0]:
[ad6c].byte $00; [1]:
[ad6d].byte $01; [2]:
[ad6e].byte $01; [3]:
[ad6f].byte $89; [4]:
[ad70].byte $01; [5]:
[ad71].byte $00; [0]:
[ad72].byte $00; [1]:
[ad73].byte $01; [2]:
[ad74].byte $01; [3]:
[ad75].byte $8a; [4]:
[ad76].byte $01; [5]:
[ad77].byte $00; [0]:
[ad78].byte $00; [1]:
[ad79].byte $01; [2]:
[ad7a].byte $01; [3]:
[ad7b].byte $8b; [4]:
[ad7c].byte $01; [5]:
[ad7d].byte $00; [0]:
[ad7e].byte $00; [1]:
[ad7f].byte $01; [2]:
[ad80].byte $01; [3]:
[ad81].byte $8c; [4]:
[ad82].byte $01; [5]:
[ad83].byte $00; [0]:
[ad84].byte $00; [1]:
[ad85].byte $01; [2]:
[ad86].byte $01; [3]:
[ad87].byte $8d; [4]:
[ad88].byte $01; [5]:
[ad89].byte $80; [6]:
[ad8a].byte $ff; [7]:
[ad8b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ad8b] undefined
[ad93].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ad93] undefined
[ad9b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ad9b] undefined
[ada3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ada3] undefined
[adab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$adab] undefined
[adb3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$adb3] undefined
[adbb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$adbb] undefined
[adc3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$adc3] undefined
[adcb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$adcb] undefined
[add3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$add3] undefined
[addb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$addb] undefined
[ade3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ade3] undefined
[adeb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$adeb] undefined
[adf3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$adf3] undefined
[adfb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$adfb] undefined
[ae03].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae03] undefined
[ae0b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae0b] undefined
[ae13].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae13] undefined
[ae1b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae1b] undefined
[ae23].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae23] undefined
[ae2b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae2b] undefined
[ae33].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae33] undefined
[ae3b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae3b] undefined
[ae43].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae43] undefined
[ae4b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae4b] undefined
[ae53].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae53] undefined
[ae5b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae5b] undefined
[ae63].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae63] undefined
[ae6b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae6b] undefined
[ae73].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae73] undefined
[ae7b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae7b] undefined
[ae83].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae83] undefined
[ae8b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae8b] undefined
[ae93].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae93] undefined
[ae9b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ae9b] undefined
[aea3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$aea3] undefined
[aeab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$aeab] undefined
[aeb3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$aeb3] undefined
[aebb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$aebb] undefined
[aec3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$aec3] undefined
[aecb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$aecb] undefined
[aed3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$aed3] undefined
[aedb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$aedb] undefined
[aee3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$aee3] undefined
[aeeb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$aeeb] undefined
[aef3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$aef3] undefined
[aefb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$aefb] undefined
[af03].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af03] undefined
[af0b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af0b] undefined
[af13].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af13] undefined
[af1b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af1b] undefined
[af23].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af23] undefined
[af2b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af2b] undefined
[af33].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af33] undefined
[af3b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af3b] undefined
[af43].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af43] undefined
[af4b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af4b] undefined
[af53].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af53] undefined
[af5b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af5b] undefined
[af63].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af63] undefined
[af6b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af6b] undefined
[af73].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af73] undefined
[af7b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af7b] undefined
[af83].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af83] undefined
[af8b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af8b] undefined
[af93].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af93] undefined
[af9b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$af9b] undefined
[afa3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$afa3] undefined
[afab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$afab] undefined
[afb3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$afb3] undefined
[afbb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$afbb] undefined
[afc3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$afc3] undefined
[afcb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$afcb] undefined
[afd3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$afd3] undefined
[afdb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$afdb] undefined
[afe3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$afe3] undefined
[afeb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$afeb] undefined
[aff3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$aff3] undefined
[affb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$affb] undefined
[b003].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b003] undefined
[b00b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b00b] undefined
[b013].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b013] undefined
[b01b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b01b] undefined
[b023].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b023] undefined
[b02b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b02b] undefined
[b033].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b033] undefined
[b03b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b03b] undefined
[b043].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b043] undefined
[b04b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b04b] undefined
[b053].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b053] undefined
[b05b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b05b] undefined
[b063].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b063] undefined
[b06b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b06b] undefined
[b073].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b073] undefined
[b07b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b07b] undefined
[b083].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b083] undefined
[b08b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b08b] undefined
[b093].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b093] undefined
[b09b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b09b] undefined
[b0a3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b0a3] undefined
[b0ab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b0ab] undefined
[b0b3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b0b3] undefined
[b0bb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b0bb] undefined
[b0c3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b0c3] undefined
[b0cb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b0cb] undefined
[b0d3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b0d3] undefined
[b0db].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b0db] undefined
[b0e3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b0e3] undefined
[b0eb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b0eb] undefined
[b0f3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b0f3] undefined
[b0fb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b0fb] undefined
[b103].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b103] undefined
[b10b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b10b] undefined
[b113].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b113] undefined
[b11b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b11b] undefined
[b123].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b123] undefined
[b12b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b12b] undefined
[b133].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b133] undefined
[b13b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b13b] undefined
[b143].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b143] undefined
[b14b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b14b] undefined
[b153].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b153] undefined
[b15b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b15b] undefined
[b163].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b163] undefined
[b16b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b16b] undefined
[b173].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b173] undefined
[b17b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b17b] undefined
[b183].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b183] undefined
[b18b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b18b] undefined
[b193].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b193] undefined
[b19b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b19b] undefined
[b1a3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b1a3] undefined
[b1ab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b1ab] undefined
[b1b3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b1b3] undefined
[b1bb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b1bb] undefined
[b1c3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b1c3] undefined
[b1cb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b1cb] undefined
[b1d3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b1d3] undefined
[b1db].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b1db] undefined
[b1e3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b1e3] undefined
[b1eb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b1eb] undefined
[b1f3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b1f3] undefined
[b1fb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b1fb] undefined
[b203].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b203] undefined
[b20b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b20b] undefined
[b213].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b213] undefined
[b21b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b21b] undefined
[b223].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b223] undefined
[b22b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b22b] undefined
[b233].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b233] undefined
[b23b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b23b] undefined
[b243].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b243] undefined
[b24b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b24b] undefined
[b253].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b253] undefined
[b25b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b25b] undefined
[b263].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b263] undefined
[b26b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b26b] undefined
[b273].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b273] undefined
[b27b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b27b] undefined
[b283].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b283] undefined
[b28b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b28b] undefined
[b293].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b293] undefined
[b29b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b29b] undefined
[b2a3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b2a3] undefined
[b2ab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b2ab] undefined
[b2b3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b2b3] undefined
[b2bb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b2bb] undefined
[b2c3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b2c3] undefined
[b2cb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b2cb] undefined
[b2d3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b2d3] undefined
[b2db].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b2db] undefined
[b2e3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b2e3] undefined
[b2eb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b2eb] undefined
[b2f3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b2f3] undefined
[b2fb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b2fb] undefined
[b303].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b303] undefined
[b30b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b30b] undefined
[b313].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b313] undefined
[b31b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b31b] undefined
[b323].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b323] undefined
[b32b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b32b] undefined
[b333].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b333] undefined
[b33b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b33b] undefined
[b343].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b343] undefined
[b34b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b34b] undefined
[b353].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b353] undefined
[b35b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b35b] undefined
[b363].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b363] undefined
[b36b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b36b] undefined
[b373].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b373] undefined
[b37b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b37b] undefined
[b383].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b383] undefined
[b38b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b38b] undefined
[b393].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b393] undefined
[b39b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b39b] undefined
[b3a3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b3a3] undefined
[b3ab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b3ab] undefined
[b3b3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b3b3] undefined
[b3bb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b3bb] undefined
[b3c3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b3c3] undefined
[b3cb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b3cb] undefined
[b3d3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b3d3] undefined
[b3db].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b3db] undefined
[b3e3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b3e3] undefined
[b3eb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b3eb] undefined
[b3f3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b3f3] undefined
[b3fb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b3fb] undefined
[b403].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b403] undefined
[b40b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b40b] undefined
[b413].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b413] undefined
[b41b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b41b] undefined
[b423].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b423] undefined
[b42b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b42b] undefined
[b433].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b433] undefined
[b43b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b43b] undefined
[b443].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b443] undefined
[b44b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b44b] undefined
[b453].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b453] undefined
[b45b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b45b] undefined
[b463].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b463] undefined
[b46b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b46b] undefined
[b473].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b473] undefined
[b47b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b47b] undefined
[b483].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b483] undefined
[b48b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b48b] undefined
[b493].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b493] undefined
[b49b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b49b] undefined
[b4a3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b4a3] undefined
[b4ab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b4ab] undefined
[b4b3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b4b3] undefined
[b4bb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b4bb] undefined
[b4c3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b4c3] undefined
[b4cb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b4cb] undefined
[b4d3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b4d3] undefined
[b4db].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b4db] undefined
[b4e3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b4e3] undefined
[b4eb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b4eb] undefined
[b4f3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b4f3] undefined
[b4fb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b4fb] undefined
[b503].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b503] undefined
[b50b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b50b] undefined
[b513].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b513] undefined
[b51b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b51b] undefined
[b523].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b523] undefined
[b52b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b52b] undefined
[b533].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b533] undefined
[b53b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b53b] undefined
[b543].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b543] undefined
[b54b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b54b] undefined
[b553].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b553] undefined
[b55b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b55b] undefined
[b563].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b563] undefined
[b56b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b56b] undefined
[b573].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b573] undefined
[b57b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b57b] undefined
[b583].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b583] undefined
[b58b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b58b] undefined
[b593].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b593] undefined
[b59b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b59b] undefined
[b5a3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b5a3] undefined
[b5ab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b5ab] undefined
[b5b3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b5b3] undefined
[b5bb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b5bb] undefined
[b5c3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b5c3] undefined
[b5cb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b5cb] undefined
[b5d3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b5d3] undefined
[b5db].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b5db] undefined
[b5e3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b5e3] undefined
[b5eb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b5eb] undefined
[b5f3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b5f3] undefined
[b5fb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b5fb] undefined
[b603].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b603] undefined
[b60b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b60b] undefined
[b613].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b613] undefined
[b61b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b61b] undefined
[b623].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b623] undefined
[b62b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b62b] undefined
[b633].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b633] undefined
[b63b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b63b] undefined
[b643].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b643] undefined
[b64b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b64b] undefined
[b653].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b653] undefined
[b65b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b65b] undefined
[b663].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b663] undefined
[b66b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b66b] undefined
[b673].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b673] undefined
[b67b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b67b] undefined
[b683].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b683] undefined
[b68b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b68b] undefined
[b693].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b693] undefined
[b69b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b69b] undefined
[b6a3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b6a3] undefined
[b6ab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b6ab] undefined
[b6b3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b6b3] undefined
[b6bb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b6bb] undefined
[b6c3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b6c3] undefined
[b6cb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b6cb] undefined
[b6d3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b6d3] undefined
[b6db].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b6db] undefined
[b6e3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b6e3] undefined
[b6eb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b6eb] undefined
[b6f3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b6f3] undefined
[b6fb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b6fb] undefined
[b703].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b703] undefined
[b70b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b70b] undefined
[b713].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b713] undefined
[b71b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b71b] undefined
[b723].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b723] undefined
[b72b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b72b] undefined
[b733].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b733] undefined
[b73b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b73b] undefined
[b743].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b743] undefined
[b74b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b74b] undefined
[b753].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b753] undefined
[b75b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b75b] undefined
[b763].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b763] undefined
[b76b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b76b] undefined
[b773].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b773] undefined
[b77b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b77b] undefined
[b783].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b783] undefined
[b78b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b78b] undefined
[b793].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b793] undefined
[b79b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b79b] undefined
[b7a3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b7a3] undefined
[b7ab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b7ab] undefined
[b7b3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b7b3] undefined
[b7bb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b7bb] undefined
[b7c3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b7c3] undefined
[b7cb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b7cb] undefined
[b7d3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b7d3] undefined
[b7db].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b7db] undefined
[b7e3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b7e3] undefined
[b7eb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b7eb] undefined
[b7f3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b7f3] undefined
[b7fb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b7fb] undefined
[b803].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b803] undefined
[b80b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b80b] undefined
[b813].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b813] undefined
[b81b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b81b] undefined
[b823].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b823] undefined
[b82b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b82b] undefined
[b833].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b833] undefined
[b83b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b83b] undefined
[b843].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b843] undefined
[b84b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b84b] undefined
[b853].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b853] undefined
[b85b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b85b] undefined
[b863].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b863] undefined
[b86b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b86b] undefined
[b873].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b873] undefined
[b87b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b87b] undefined
[b883].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b883] undefined
[b88b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b88b] undefined
[b893].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b893] undefined
[b89b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b89b] undefined
[b8a3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b8a3] undefined
[b8ab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b8ab] undefined
[b8b3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b8b3] undefined
[b8bb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b8bb] undefined
[b8c3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b8c3] undefined
[b8cb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b8cb] undefined
[b8d3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b8d3] undefined
[b8db].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b8db] undefined
[b8e3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b8e3] undefined
[b8eb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b8eb] undefined
[b8f3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b8f3] undefined
[b8fb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b8fb] undefined
[b903].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b903] undefined
[b90b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b90b] undefined
[b913].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b913] undefined
[b91b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b91b] undefined
[b923].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b923] undefined
[b92b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b92b] undefined
[b933].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b933] undefined
[b93b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b93b] undefined
[b943].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b943] undefined
[b94b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b94b] undefined
[b953].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b953] undefined
[b95b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b95b] undefined
[b963].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b963] undefined
[b96b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b96b] undefined
[b973].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b973] undefined
[b97b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b97b] undefined
[b983].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b983] undefined
[b98b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b98b] undefined
[b993].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b993] undefined
[b99b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b99b] undefined
[b9a3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b9a3] undefined
[b9ab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b9ab] undefined
[b9b3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b9b3] undefined
[b9bb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b9bb] undefined
[b9c3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b9c3] undefined
[b9cb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b9cb] undefined
[b9d3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b9d3] undefined
[b9db].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b9db] undefined
[b9e3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b9e3] undefined
[b9eb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b9eb] undefined
[b9f3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b9f3] undefined
[b9fb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$b9fb] undefined
[ba03].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba03] undefined
[ba0b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba0b] undefined
[ba13].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba13] undefined
[ba1b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba1b] undefined
[ba23].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba23] undefined
[ba2b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba2b] undefined
[ba33].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba33] undefined
[ba3b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba3b] undefined
[ba43].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba43] undefined
[ba4b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba4b] undefined
[ba53].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba53] undefined
[ba5b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba5b] undefined
[ba63].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba63] undefined
[ba6b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba6b] undefined
[ba73].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba73] undefined
[ba7b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba7b] undefined
[ba83].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba83] undefined
[ba8b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba8b] undefined
[ba93].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba93] undefined
[ba9b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$ba9b] undefined
[baa3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$baa3] undefined
[baab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$baab] undefined
[bab3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bab3] undefined
[babb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$babb] undefined
[bac3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bac3] undefined
[bacb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bacb] undefined
[bad3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bad3] undefined
[badb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$badb] undefined
[bae3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bae3] undefined
[baeb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$baeb] undefined
[baf3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$baf3] undefined
[bafb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bafb] undefined
[bb03].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb03] undefined
[bb0b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb0b] undefined
[bb13].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb13] undefined
[bb1b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb1b] undefined
[bb23].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb23] undefined
[bb2b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb2b] undefined
[bb33].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb33] undefined
[bb3b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb3b] undefined
[bb43].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb43] undefined
[bb4b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb4b] undefined
[bb53].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb53] undefined
[bb5b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb5b] undefined
[bb63].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb63] undefined
[bb6b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb6b] undefined
[bb73].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb73] undefined
[bb7b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb7b] undefined
[bb83].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb83] undefined
[bb8b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb8b] undefined
[bb93].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb93] undefined
[bb9b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bb9b] undefined
[bba3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bba3] undefined
[bbab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bbab] undefined
[bbb3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bbb3] undefined
[bbbb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bbbb] undefined
[bbc3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bbc3] undefined
[bbcb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bbcb] undefined
[bbd3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bbd3] undefined
[bbdb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bbdb] undefined
[bbe3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bbe3] undefined
[bbeb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bbeb] undefined
[bbf3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bbf3] undefined
[bbfb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bbfb] undefined
[bc03].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc03] undefined
[bc0b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc0b] undefined
[bc13].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc13] undefined
[bc1b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc1b] undefined
[bc23].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc23] undefined
[bc2b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc2b] undefined
[bc33].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc33] undefined
[bc3b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc3b] undefined
[bc43].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc43] undefined
[bc4b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc4b] undefined
[bc53].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc53] undefined
[bc5b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc5b] undefined
[bc63].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc63] undefined
[bc6b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc6b] undefined
[bc73].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc73] undefined
[bc7b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc7b] undefined
[bc83].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc83] undefined
[bc8b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc8b] undefined
[bc93].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc93] undefined
[bc9b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bc9b] undefined
[bca3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bca3] undefined
[bcab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bcab] undefined
[bcb3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bcb3] undefined
[bcbb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bcbb] undefined
[bcc3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bcc3] undefined
[bccb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bccb] undefined
[bcd3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bcd3] undefined
[bcdb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bcdb] undefined
[bce3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bce3] undefined
[bceb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bceb] undefined
[bcf3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bcf3] undefined
[bcfb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bcfb] undefined
[bd03].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd03] undefined
[bd0b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd0b] undefined
[bd13].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd13] undefined
[bd1b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd1b] undefined
[bd23].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd23] undefined
[bd2b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd2b] undefined
[bd33].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd33] undefined
[bd3b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd3b] undefined
[bd43].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd43] undefined
[bd4b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd4b] undefined
[bd53].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd53] undefined
[bd5b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd5b] undefined
[bd63].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd63] undefined
[bd6b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd6b] undefined
[bd73].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd73] undefined
[bd7b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd7b] undefined
[bd83].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd83] undefined
[bd8b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd8b] undefined
[bd93].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd93] undefined
[bd9b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bd9b] undefined
[bda3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bda3] undefined
[bdab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bdab] undefined
[bdb3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bdb3] undefined
[bdbb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bdbb] undefined
[bdc3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bdc3] undefined
[bdcb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bdcb] undefined
[bdd3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bdd3] undefined
[bddb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bddb] undefined
[bde3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bde3] undefined
[bdeb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bdeb] undefined
[bdf3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bdf3] undefined
[bdfb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bdfb] undefined
[be03].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be03] undefined
[be0b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be0b] undefined
[be13].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be13] undefined
[be1b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be1b] undefined
[be23].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be23] undefined
[be2b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be2b] undefined
[be33].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be33] undefined
[be3b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be3b] undefined
[be43].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be43] undefined
[be4b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be4b] undefined
[be53].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be53] undefined
[be5b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be5b] undefined
[be63].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be63] undefined
[be6b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be6b] undefined
[be73].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be73] undefined
[be7b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be7b] undefined
[be83].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be83] undefined
[be8b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be8b] undefined
[be93].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be93] undefined
[be9b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$be9b] undefined
[bea3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bea3] undefined
[beab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$beab] undefined
[beb3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$beb3] undefined
[bebb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bebb] undefined
[bec3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bec3] undefined
[becb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$becb] undefined
[bed3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bed3] undefined
[bedb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bedb] undefined
[bee3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bee3] undefined
[beeb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$beeb] undefined
[bef3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bef3] undefined
[befb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$befb] undefined
[bf03].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf03] undefined
[bf0b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf0b] undefined
[bf13].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf13] undefined
[bf1b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf1b] undefined
[bf23].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf23] undefined
[bf2b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf2b] undefined
[bf33].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf33] undefined
[bf3b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf3b] undefined
[bf43].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf43] undefined
[bf4b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf4b] undefined
[bf53].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf53] undefined
[bf5b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf5b] undefined
[bf63].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf63] undefined
[bf6b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf6b] undefined
[bf73].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf73] undefined
[bf7b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf7b] undefined
[bf83].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf83] undefined
[bf8b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf8b] undefined
[bf93].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf93] undefined
[bf9b].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bf9b] undefined
[bfa3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bfa3] undefined
[bfab].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bfab] undefined
[bfb3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bfb3] undefined
[bfbb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bfbb] undefined
[bfc3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bfc3] undefined
[bfcb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bfcb] undefined
[bfd3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bfd3] undefined
[bfdb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bfdb] undefined
[bfe3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bfe3] undefined
[bfeb].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bfeb] undefined
[bff3].byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff; [$bff3] undefined
[bffb].byte $ff,$ff,$ff,$ff,$ff; [$bffb] undefined