; 6502bench SourceGen v1.7.3
PLAYER_Genaa .eq $01 {const}
item_honeyLamp .eq $02 {const}
PLAYER_Herd .eq $02 {const}
RWTSCMD_write .eq $02 {const}
item_wand .eq $03 {const}
PLAYER_Pomma .eq $03 {const}
PLAYER_Charn .eq $04 {const}
item_shuba .eq $07 {const}
item_beak .eq $09 {const}
item_rope .eq $0b {const}
item_templeKey .eq $0c {const}
LASTKEY .eq $02 ;last key pressed via chkkey
temp08 .eq $08
temp11_textlo .eq $11 ; often used to hold text page address of tile (lo)
playerX .eq $19 ; tile X of player
playerY .eq $1a ; tile Y of player
MAPPOS .eq $1b ; playfield position
MAPHALF .eq $1c ; playfield half (top/bottom); like top bit of MAPPOS
PLAYER .eq $20 ;active player (0-4)
dayNum .eq $22 ; day number (1-based)
levelSpirit .eq $23 ; level of spirit
levelFood .eq $24 ; level of food, max limit-1
levelRest .eq $25 ; level of rest, max limit-1
limitSpirit .eq $27 ; spirit limit
MON_BASL .eq $28 ;base address for text output (lo)
limitFood .eq $2a ; not shown, levelStamina/2 + 1
limitRest .eq $2b ; not shown, levelStamina/2 + 1
maxWeight .eq $2c ; max weight you can carry
homePos .eq $2d ; used when teleporting player home
homeHalf .eq $2e ; used when teleporting player home
homeX .eq $2f ; used when teleporting player home
homeY .eq $30 ; used when teleporting player home
MON_INVFLAG .eq $32 ;text mask (255=normal, 127=flash, 63=inv)
MON_PROMPT .eq $33 ;prompt character
spokeTo .eq $37 ; spoke to or bought from NPC while on this screen
fallaKeyOffered .eq $38 ; if D'Ol Falla's key has been offered (?)
suppressSound0 .eq $39 ; $FF=suppress sound 0 for 1 call, set on inventory menu entry
litLamp .eq $3a ; slot number of lit lamp, or 0 if unlit
gainSpirit .eq $3f ; spirit gained so far, modulo 5
MON_A3H .eq $41 ;general purpose
MON_A4L .eq $42 ;general purpose
lampFuel .eq $44 ; number of rooms left in lamp; 00..13
MON_A5H .eq $45 ;general purpose
temp49 .eq $49 ; used only in $A7F3
SOUNDFLG .eq $4a ;0 = sound off, 1 = on
HTAB .eq $64 ; horiz text pos (next line at +$28)
INSIDE .eq $67 ; Are we inside? Toggled when entering a door, or set manually on teleport.
zp6b_npcHere .eq $6b ; NPC is on this screen? (0=no, 1=yes)
npcX .eq $6c ; NPC X location on this screen
npcY .eq $6d ; NPC Y location on this screen
npcFacing .eq $6f ; NPC facing direction on this screen
WEIGHT .eq $70 ; current item weight carried (< limitWeight)
temp75 .eq $75
temp76 .eq $76
selItemSlot .eq $77 ; last selected item slot (00..FE or FF)
selItemNum .eq $78 ; last selected item number (01..0E)
waitMelody .eq $83 ; always 0, but could be interrupt placeholder
VIRTBTN .eq $84 ; virtual button press, used only in kbd handler
XDIR .eq $85 ;last x dir pressed, -1 (left) or 1 (right)
YDIR .eq $86 ;last y dir pressed, -1 (up) or 1 (down)
TICKING .eq $87 ; 1 if timer is ticking, 0 if paused
temp89 .eq $89 {addr/2}
FACING .eq $95 ;FF=left, 01=right facing
MOVING .eq $a2 ;1=moving,0=stationary
XMOVFLG .eq $af
YMOVFLG .eq $b0 ;FF=up,01=down (edge at end of action)
JOYFLG .eq $b1 ;01 = joystick, 00 = kbd
foodRestTimer .eq $b8 ; remaining time until food/rest decreases
DEMOWAIT .eq $c0 ; number of frames to wait
DEMOLAST .eq $c1 ; latched movement byte
DEMOPTR .eq $c2 ; ptr to current demo byte
DEMOFLG .eq $c4 ; 00 = game, 01 = demo mode
DEMOTEXT .eq $c8 ; demo text to show (1..5, or 0 = none)
QUEST .eq $da ; quest (save slot) 0..4
tileUnder .eq $e3 ; 0, 1 tile under player's feet
ySolid .eq $f0 ; selected tile is solid ground
STACK_npc_offer .eq $0100 ; vector -- bytes corrupt
STACK_need_energy .eq $0103 ; vector -- bytes corrupt
RWTSBUF .eq $0200 {addr/256} ; 256-byte sector r/w buffer
RWTSBUF_npc .eq $02e1 ; nonzero if NPC is present; may contain data in top 4 bits
RWTSBUF_npc_speak_top1 .eq $02e8 ; NPC spoken msg part 1 (variant 1)
RWTSBUF_npc_speak_bot1 .eq $02e9 ; NPC spoken msg part 2 (variant 1)
RWTSBUF_npc_pense_emot1 .eq $02ea ; NPC pense emotion number (variant 1), 1-based
RWTSBUF_npc_pense_mesg1 .eq $02eb ; NPC pense message number (variant 1), 1-based
RWTSBUF_npc_speak_top2 .eq $02ec ; NPC spoken msg part 1 (variant 2)
RWTSBUF_npc_speak_bot2 .eq $02ed ; NPC spoken msg part 2 (variant 2)
RWTSBUF_npc_pense_emot2 .eq $02ee ; NPC pense emotion number (variant 2), 1-based
RWTSBUF_npc_pense_mesg2 .eq $02ef ; NPC pense message number (variant 2), 1-based
RWTSBUF_npcnum .eq $02f1 ; NPC number (00..??) ; $49 raamo
RWTSBUF_npctype .eq $02f2 ; 0 offers item, 1 animal, $d0 dol falla, $40 gain level, $20-$2f ??, $c0 door 1, $c1 door 2, $e0-$ef,
RWTS_IOB_track .eq $0304
RWTS_IOB_sector .eq $0305
RWTS_IOB_command .eq $030c
DIRECT_RWTS .eq $0315
GAME1_messages .eq $0a00
GAME1_power_gained .eq $1b00
GAME1_BITTAB0 .eq $1db8
GAME1_BITTAB5 .eq $1dbd
GAME1_BITTAB7 .eq $1dbf
GAME1_melodies_lo .eq $1e20
GAME1_melodies_hi .eq $1e30
GAME2_drawtile .eq $6003
GAME2_cleartext .eq $6006
GAME2_PRNTSTR .eq $600c
GAME2_printchar .eq $600f
GAME2_delay1 .eq $6012
GAME2_swapzp8 .eq $6015
GAME2_read_playfield .eq $601e
GAME2_read_0900 .eq $6021
GAME2_intro .eq $6027
GAME2_copypages .eq $6030
GAME2_clearpages .eq $6033
GAME2_delay2 .eq $6036
GAME2_player_init .eq $6039
GAME2_init_item_state .eq $603f
GAME2_calc_hires_textpos .eq $6042
GAME2_writetile .eq $6045
GAME2_draw_player .eq $6b03
GAME2_ongoing_input .eq $6b09
GAME2_redraw_player .eq $6b0c
GAME2_tile_at_xy .eq $6b1e
GAME2_win_game .eq $6b24
GAME2_chkkey .eq $6b27
GAME2_menu_input .eq $6b2a
GAME2_slot_to_item .eq $7703
GAME2_message_wait .eq $7706
GAME2_await_button_up .eq $770c
GAME2_print_item_desc .eq $770f
GAME2_lose_weight .eq $7712
GAME2_txtpos_to_addr .eq $7721
state_npc1 .eq $b200
state_npc .eq $b280 ; per npc bitfield; 7=gained a level from this NPC; 0..6=last spoken daynum or 0..4=time of day (NPC $E0..$EF)
itemStateCol .eq $b400 {addr/256} ; 256 column tile positions, one per item
itemState .eq $b500 {addr/256} ; 7=mappos high bit, 6=in world, 5=in inv, 4..0=map row
inv_token .eq $b56c {addr/75}
KBD .eq $c000 ;R last key pressed + 128
KBDSTRB .eq $c010 ;RW keyboard strobe
SPKR .eq $c030 ;RW toggle speaker
TXTCLR .eq $c050 ;RW display graphics
MIXCLR .eq $c052 ;RW display full screen
TXTPAGE2 .eq $c055 ;RW display page 2 (or read/write aux mem)
HIRES .eq $c057 ;RW display hi-res graphics
.org $9600
; External vectors
9600: 4c 06 96 SCRN_demo_handler jmp demo_handler
9603: 4c e0 96 SCRN_show_demo_text jmp show_demo_text ;show demo text in A
; Called when DEMOFLG is 1. This calls back into the main input handler, to
; check if you pressed a key to exit the demo. There is a demo data stream
; parser afterward that reads a byte from ($C2) and executes some action, like a
; delay, melody, or movement.
9606: a9 00 demo_handler lda #$00
9608: 85 c4 sta DEMOFLG ;turn off demo mode temporarily
960a: a5 b0 lda YMOVFLG ;save $af/$b0
960c: 48 pha
960d: a5 af lda XMOVFLG
960f: 48 pha
9610: 20 09 6b jsr GAME2_ongoing_input ;call input handler in normal mode
9613: a8 tay ;preserve return val
9614: 68 pla ;restore $af/$b0
9615: 85 af sta XMOVFLG
9617: 68 pla
9618: 85 b0 sta YMOVFLG
961a: a9 00 lda #$00
961c: 85 a2 sta MOVING
961e: 85 84 sta VIRTBTN
9620: 85 85 sta XDIR
9622: 85 86 sta YDIR
9624: a9 01 lda #$01
9626: 85 c4 sta DEMOFLG
9628: 98 tya ;return val from $6b09
9629: f0 09 beq L9634
962b: a9 00 lda #$00
962d: 85 87 sta TICKING
962f: a9 ff lda #$ff
9631: 85 c6 sta $c6
9633: 60 rts
9634: c6 c0 L9634 dec DEMOWAIT ;time for next action when 0
9636: f0 03 beq read_demo_byte ;if time for next action
9638: a5 c1 lda DEMOLAST ;last movement byte still active
963a: 60 rts
NOTE: Below may implement a demo command parser
963b: a0 00 read_demo_byte ldy #$00
963d: b1 c2 lda (DEMOPTR),y
963f: 30 03 bmi demo_command ;negative value, command
9641: 4c d6 96 jmp demo_movement ;positive, movement
9644: c9 ff demo_command cmp #$ff ;$ff = end of demo :(
9646: d0 07 bne demo_c0
9648: a9 00 lda #$00 ;clear demo flag
964a: 85 c4 sta DEMOFLG
964c: a9 ff lda #$ff ;return to BIT tree
964e: 60 rts
964f: c9 c0 demo_c0 cmp #$c0 ;$c0 xx == play melody
9651: d0 0e bne demo_c1
9653: 20 d9 96 jsr inc_demo_ptr
9656: b1 c2 lda (DEMOPTR),y ;next byte is melody #
9658: 20 00 b6 jsr SCRN_play_melody
965b: 20 d9 96 jsr inc_demo_ptr
965e: 4c 3b 96 jmp read_demo_byte
9661: c9 c1 demo_c1 cmp #$c1 ;$c1 == delay
9663: d0 0e bne demo_c2
9665: a2 fa ldx #$fa
9667: 20 36 60 jsr GAME2_delay2
966a: a9 01 lda #$01
966c: 85 c0 sta DEMOWAIT ;next byte in 1 frame
966e: a9 1f lda #$1f
9670: 4c d9 96 jmp inc_demo_ptr
9673: c9 c2 demo_c2 cmp #$c2 ;$c2 xx == long delay
9675: d0 17 bne demo_c3
9677: 20 d9 96 jsr inc_demo_ptr
967a: b1 c2 lda (DEMOPTR),y ;next byte is length of delay
967c: 85 c0 sta DEMOWAIT ;$c0 is used as a temp here
967e: a2 fa @loop ldx #$fa
9680: 20 36 60 jsr GAME2_delay2 ;unclear why we need to delay the cpu
9683: c6 c0 dec DEMOWAIT
9685: d0 f7 bne @loop
9687: e6 c0 inc DEMOWAIT ;next byte in 1 frame
9689: a9 1f lda #$1f ;note bit 4 is set here, for BIT tests
968b: 4c d9 96 jmp inc_demo_ptr
968e: c9 c3 demo_c3 cmp #$c3 ;$c3 xx == ??
9690: d0 0e bne demo_c4
9692: 20 d9 96 jsr inc_demo_ptr
9695: b1 c2 lda (DEMOPTR),y
9697: 85 c6 sta $c6
9699: a9 00 lda #$00
969b: 85 87 sta TICKING
969d: a9 1f lda #$1f
969f: 60 rts
96a0: c9 c4 demo_c4 cmp #$c4 ;$c4 xx == ??
96a2: d0 13 bne demo_c5
96a4: 20 d9 96 jsr inc_demo_ptr
96a7: b1 c2 lda (DEMOPTR),y
96a9: 85 c8 sta DEMOTEXT
96ab: a9 00 lda #$00
96ad: 85 87 sta TICKING
96af: a9 1f lda #$1f ;bit 4 set
96b1: c8 iny
96b2: 84 c0 sty DEMOWAIT ;$c0=1
96b4: 4c d9 96 jmp inc_demo_ptr
96b7: c9 c5 demo_c5 cmp #$c5 ;$c5 == ??
96b9: d0 0d bne demo_move_and_wait
96bb: a9 01 lda #$01
96bd: 85 08 sta temp08
96bf: 85 65 sta $65
96c1: 85 c0 sta DEMOWAIT
96c3: a9 1f lda #$1f ;bit 4 set
96c5: 4c d9 96 jmp inc_demo_ptr
; For any other negative value (not C0..C5 or FF), store the next demo byte in
; the delay counter, store the value in $C1, and return the value in A. This
; value will be a movement code. In effect, the movement is executed and and the
; simulation executes for A frames before reading the next byte. The movement is
; latched in $C1 and will be returned from future frames in wait state.
96c8: 85 c1 demo_move_and_wait sta DEMOLAST
96ca: 20 d9 96 jsr inc_demo_ptr
96cd: b1 c2 lda (DEMOPTR),y
96cf: 85 c0 sta DEMOWAIT
96d1: a5 c1 lda DEMOLAST
96d3: 4c d9 96 jmp inc_demo_ptr
; Positive movement byte in A. A is returned to caller (the input handler BIT
; tests). When the movement byte is positive, there is no following delay byte;
; the command is executed and the next byte is read on the next frame.
96d6: c8 demo_movement iny ;y always 0
96d7: 84 c0 sty DEMOWAIT ;next byte in 1 frame
96d9: e6 c2 inc_demo_ptr inc DEMOPTR ;next demo byte
96db: d0 02 bne @done
96dd: e6 c3 inc DEMOPTR+1 ;hi byte
96df: 60 @done rts ;when jmp'ed to, returns to input handler
; Show demo text A in text area, for A = 1..5. If A=5, just clears text.
96e0: c9 05 show_demo_text cmp #$05
96e2: d0 04 bne @demo_text_1
96e4: 20 06 60 jsr GAME2_cleartext
96e7: 60 rts
96e8: c9 01 @demo_text_1 cmp #$01
96ea: d0 45 bne @demo_text_2
96ec: 20 0c 60 jsr GAME2_PRNTSTR
96ef: 0c .dd1 $0c
96f0: d7 c9 ce c4+ .str ↑“WINDHAM CLASSICS”
9700: ff .dd1 $ff
9701: 20 0c 60 jsr GAME2_PRNTSTR
9704: 33 .dd1 $33
9705: c3 cf d0 d9+ .str ↑“COPYRIGHT (C) 1984”
9717: ff .dd1 $ff
9718: 20 0c 60 jsr GAME2_PRNTSTR
971b: 5b .dd1 $5b
971c: c1 cc cc a0+ .str ↑“ALL RIGHTS RESERVED”
972f: ff .dd1 $ff
9730: 60 rts
9731: c9 02 @demo_text_2 cmp #$02
9733: f0 03 beq @text2
9735: 4c da 97 jmp @demo_text_3
9738: 20 0c 60 @text2 jsr GAME2_PRNTSTR
973b: 01 .dd1 $01 ;maybe begin string or formatting byte
973c: c3 c8 cf cf+ .str ↑“CHOOSE TO BE ERDLING OR KINDAR, MALE OR FEMALE, CHILD OR A”
+ “DULT. SET FORTH TO SOLVE THE RIDDLE OF THE PROPHESY AND”
+ “ SAVE GREEN-SKY FROM DESTRUCTION.”
97d8: ff .dd1 $ff
97d9: 60 rts
97da: c9 03 @demo_text_3 cmp #$03
97dc: f0 03 beq @text3
97de: 4c 80 98 jmp @demo_text_4
97e1: 20 0c 60 @text3 jsr GAME2_PRNTSTR
97e4: 01 .dd1 $01
97e5: d3 c5 c5 cb+ .str ↑“SEEK EVERYWHERE, FROM THE THIN FRONDS OF THE ROOF-TREES TO ”
+ “THE DARK TUNNELS THAT LIE BELOW THE ROOT. ESCAPE THE LUR”
+ “KING EVIL OF NEKOM AND SALITE.”
987e: ff .dd1 $ff
987f: 60 rts
9880: 20 0c 60 @demo_text_4 jsr GAME2_PRNTSTR
9883: 01 .dd1 $01
9884: d4 cf a0 c4+ .str ↑“TO DO THIS YOU MUST GROW STRONG IN BODY AND SPIRIT. ”
+ “PEACE AND JOY TO YOU QUESTER. MAY YOU FIND THE HIDDEN ”
98fc: ff .dd1 $ff
98fd: 4c a2 9b jmp secret_and_save_greensky ;jumps right over this next data area
NOTE: Unknown data. Does not seem to be referenced.
9900: c0 01 9f 04+ .junk 674
secret_and_save_greensky
9ba2: 20 0c 60 jsr GAME2_PRNTSTR
9ba5: 79 .dd1 $79
9ba6: d3 c5 c3 d2+ .str ↑“SECRET AND SAVE GREEN-SKY.”
9bc0: ff .dd1 $ff
9bc1: 60 rts
9bc2: af .dd1 $af ;junk
; The BIT operands below refer to code, not data. Given that, and since this
; resembles a simpler version of the input handling code in GAME2, this could be
; vestigial code.
9bc3: a9 00 lda #$00
9bc5: 85 85 sta XDIR
9bc7: 85 86 sta YDIR
9bc9: 85 a2 sta MOVING
9bcb: 85 84 sta VIRTBTN
9bcd: a5 c4 lda DEMOFLG
9bcf: f0 32 beq SCRN_grunspreke
9bd1: 20 00 96 jsr SCRN_demo_handler
9bd4: 2c f1 76 bit $76f1
9bd7: d0 04 bne L9BDD
9bd9: e6 85 inc XDIR
9bdb: e6 a2 inc MOVING
9bdd: 2c f0 76 L9BDD bit $76f0
9be0: d0 04 bne L9BE6
9be2: c6 85 dec XDIR
9be4: e6 a2 inc MOVING
9be6: 2c ef 76 L9BE6 bit $76ef
9be9: d0 04 bne L9BEF
9beb: e6 86 inc YDIR
9bed: e6 a2 inc MOVING
9bef: 2c ee 76 L9BEF bit $76ee
9bf2: d0 04 bne L9BF8
9bf4: c6 86 dec YDIR
9bf6: e6 a2 inc MOVING
9bf8: 2c f2 76 L9BF8 bit $76f2
9bfb: d0 03 bne SCRN_heal
9bfd: a9 01 lda #$01
9bff: 60 rts
; External vector time
9c00: 4c f5 a4 SCRN_heal jmp heal
9c03: 4c 44 a5 SCRN_grunspreke jmp grunspreke
9c06: 4c e4 a5 SCRN_kiniport jmp kiniport
9c09: 4c 75 a1 SCRN_use jmp use
9c0c: 4c 61 9c SCRN_speak jmp speak
9c0f: 4c 5b 9d SCRN_pense jmp pense
9c12: 4c 63 9e SCRN_buy jmp buy
9c15: 4c fe 9e SCRN_sell jmp sell
9c18: 4c 6c a0 SCRN_offer jmp offer
9c1b: 4c f3 a7 SCRN_drawtile_store jmp drawtile_and_store ;draw tile in A and store to text screen
9c1e: 4c 46 9d SCRN_triumph_melody jmp play_random_triumph_melody
********************************************************************************
* Print NPC emotion/message (message number in A) at position X. *
* The message number is 1-based. *
* Message 0 is invalid and caller should display "NO RESPONSE". *
********************************************************************************
tempMsgNum .var $08 {addr/1} ;message number
tempStrPtr .var $09 {addr/2} ;ptr to start of cur msg
tempStrIdx .var $7a {addr/1} ;index into string
9c21: 86 64 print_npc_message stx HTAB ;X is the horiz text pos
9c23: 85 08 sta tempMsgNum ;$08 holds A on entry
9c25: a9 00 lda #$00
9c27: 85 7a sta tempStrIdx
9c29: a9 00 lda #<GAME1_messages
9c2b: 85 09 sta tempStrPtr
9c2d: a9 0a lda #>GAME1_messages
9c2f: 85 0a sta tempStrPtr+1
9c31: a0 00 @start_msg ldy #$00
9c33: c6 08 dec tempMsgNum
9c35: f0 17 beq @print ;reached desired message; print
9c37: b1 09 @nextchar lda (tempStrPtr),y
9c39: c9 ff cmp #$ff
9c3b: f0 03 beq @end_msg
9c3d: c8 iny
9c3e: d0 f7 bne @nextchar
9c40: c8 @end_msg iny
9c41: 98 tya ;y=len
9c42: 18 clc ;advance 16-bit msg ptr by last msg len
9c43: 65 09 adc tempStrPtr
9c45: 90 02 bcc @nocarry
9c47: e6 0a inc tempStrPtr+1
9c49: 85 09 @nocarry sta tempStrPtr
9c4b: 4c 31 9c jmp @start_msg
; Prints the desired message found above.
9c4e: a4 7a @print ldy tempStrIdx
9c50: b1 09 lda (tempStrPtr),y
9c52: c9 ff cmp #$ff ;read bytes until $FF terminator
9c54: f0 0a beq @rts
9c56: 20 0f 60 jsr GAME2_printchar
9c59: e6 64 inc HTAB
9c5b: e6 7a inc tempStrIdx
9c5d: 4c 4e 9c jmp @print
9c60: 60 @rts rts
• Clear variables
9c61: 20 06 60 speak jsr GAME2_cleartext
9c64: ad e1 02 lda RWTSBUF_npc
9c67: d0 18 bne @npc_present
9c69: 20 0c 60 @speak_with_whom jsr GAME2_PRNTSTR
9c6c: 01 .dd1 $01
9c6d: d3 d0 c5 c1+ .str ↑“SPEAK WITH WHOM?”
9c7d: ff .dd1 $ff
9c7e: 4c 06 77 jmp GAME2_message_wait
9c81: 20 14 a0 @npc_present jsr check_npc_in_range
9c84: 90 e3 bcc @speak_with_whom
9c86: 20 65 a0 jsr compare_alignment?
9c89: 90 39 bcc @speak_ok
9c8b: ad f2 02 lda RWTSBUF_npctype ;0 if NPC offers an item
9c8e: d0 34 bne @speak_ok
9c90: 20 00 01 jsr STACK_npc_offer ;NPC offers you an item (if available)
9c93: ae f1 02 ldx RWTSBUF_npcnum
9c96: bd 80 b2 lda state_npc,x
9c99: 29 7f and #$7f ;bits 0..6 last day we spoke to this NPC
9c9b: c5 22 cmp dayNum ;was item already taken today?
9c9d: d0 25 bne @speak_ok ;no, speak normally to NPC
9c9f: 20 0c 60 jsr GAME2_PRNTSTR ;yes, npc says slow down
9ca2: 01 .dd1 $01
9ca3: c3 cf cd c5+ .str ↑“COME BACK TOMORROW, MY FRIEND”
9cc0: ff .dd1 $ff
9cc1: 4c 06 77 jmp GAME2_message_wait
9cc4: 20 65 a0 @speak_ok jsr compare_alignment?
9cc7: 90 0a bcc @variant2
9cc9: ad e9 02 lda RWTSBUF_npc_speak_bot1 ;spoken message variant #1 part 2
9ccc: 48 pha
9ccd: ad e8 02 lda RWTSBUF_npc_speak_top1 ;spoken message variant #1 part 1
9cd0: 4c da 9c jmp @chkmsg
9cd3: ad ed 02 @variant2 lda RWTSBUF_npc_speak_bot2 ;spoken message variant #2 part 2
9cd6: 48 pha
9cd7: ad ec 02 lda RWTSBUF_npc_speak_top2 ;spoken message variant #2 part 1
9cda: d0 04 @chkmsg bne @do_msg
9cdc: 68 pla
9cdd: 4c 3f a0 jmp no_response_1 ;null message, no response
9ce0: a2 01 @do_msg ldx #$01 ;screen pos 1 -- top msg
9ce2: 20 21 9c jsr print_npc_message
9ce5: 68 pla
9ce6: f0 05 beq @update_state ;bottom message may be missing, ignore if so
9ce8: a2 29 ldx #$29 ;print bottom message, if any
9cea: 20 21 9c jsr print_npc_message
9ced: ae f1 02 @update_state ldx RWTSBUF_npcnum
9cf0: bd 80 b2 lda state_npc,x
9cf3: 29 80 and #$80 ;update bits 0..6 with current day number
9cf5: 05 22 ora dayNum ;indicating we spoke to NPC today
9cf7: 9d 80 b2 sta state_npc,x ;used e.g. when checking if item was taken today
9cfa: 20 65 a0 jsr compare_alignment?
9cfd: 90 1e bcc L9D1D
9cff: ad f2 02 lda RWTSBUF_npctype
9d02: f0 15 beq @spoketo
NOTE: Special handling for NPC type speaking.
9d04: c9 40 cmp #$40
9d06: f0 11 beq @spoketo
9d08: 29 f0 and #$f0
9d0a: c9 20 cmp #$20
9d0c: f0 0b beq @spoketo
9d0e: ad f2 02 lda RWTSBUF_npctype
9d11: c9 d0 cmp #$d0
9d13: d0 08 bne L9D1D
9d15: a9 01 lda #$01
9d17: 85 38 sta fallaKeyOffered
9d19: a9 01 @spoketo lda #$01 ;some npcs do this
9d1b: 85 37 sta spokeTo
9d1d: ad f2 02 L9D1D lda RWTSBUF_npctype
9d20: c9 40 cmp #$40 ;NPC type $40 gains us a level the 1st time we speak
9d22: d0 1f bne @return
9d24: ae f1 02 ldx RWTSBUF_npcnum
9d27: bd 80 b2 lda state_npc,x
9d2a: 2c bf 1d bit GAME1_BITTAB7 ;did we gain a level by speaking to npc earlier?
9d2d: d0 14 bne @return ;yes, return
9d2f: 09 80 ora #$80 ;no, level up
9d31: 9d 80 b2 sta state_npc,x ;record this NPC was spoken to
9d34: 18 clc
9d35: a5 27 lda limitSpirit ;gain 5 spirit
9d37: 69 05 adc #$05
9d39: 85 27 sta limitSpirit
9d3b: 85 23 sta levelSpirit ;fill spirit
9d3d: 20 46 9d jsr play_random_triumph_melody ;celebrate
9d40: 20 00 1b jsr GAME1_power_gained ;gain a level
9d43: 4c 06 77 @return jmp GAME2_message_wait
play_random_triumph_melody
9d46: a2 c0 ldx #$c0
9d48: 20 12 60 jsr GAME2_delay1
9d4b: 20 21 60 jsr GAME2_read_0900 ;pseudo-random choice of melody, probably
9d4e: 29 07 and #$07
9d50: 18 clc
9d51: 69 02 adc #$02
9d53: 20 00 b6 jsr SCRN_play_melody
9d56: a5 83 @loop lda waitMelody ;again, probably vestigial interrupt checking
9d58: d0 fc bne @loop
9d5a: 60 rts
9d5b: 20 06 60 pense jsr GAME2_cleartext
9d5e: ad e1 02 lda RWTSBUF_npc ;npc present?
9d61: d0 13 bne @npc_present
9d63: 20 0c 60 jsr GAME2_PRNTSTR
9d66: 01 .dd1 $01
9d67: d0 c5 ce d3+ .str ↑“PENSE WHOM?”
9d72: ff .dd1 $ff
9d73: 4c 06 77 jmp GAME2_message_wait
9d76: a5 27 @npc_present lda limitSpirit
9d78: c9 05 cmp #$05 ;pense emotion requires 5 spirit limit
9d7a: b0 21 bcs @spirit_limit_ok
9d7c: 20 0c 60 jsr GAME2_PRNTSTR
9d7f: 01 .dd1 $01
9d80: d9 cf d5 a0+ .str ↑“YOU LACK THE SPIRIT SKILL” ;duplicate code at $A7D2
9d99: ff .dd1 $ff
9d9a: 4c 06 77 jmp GAME2_message_wait
9d9d: a5 23 @spirit_limit_ok lda levelSpirit
9d9f: d0 23 bne @spirit_level_ok ;pense emotion consumes 1 spirit point
9da1: 20 0c 60 jsr GAME2_PRNTSTR
9da4: 01 .dd1 $01
9da5: d9 cf d5 a0+ .str ↑“YOU NEED MORE SPIRIT ENERGY” ;duplicate code at $0103/$0160 (but this one works)
9dc0: ff .dd1 $ff
9dc1: 4c 06 77 jmp GAME2_message_wait
9dc4: 20 0c 60 @spirit_level_ok jsr GAME2_PRNTSTR
9dc7: 01 .dd1 $01
9dc8: c5 cd cf d4+ .str ↑“EMOTION:”
9dd0: ff .dd1 $ff
9dd1: 20 65 a0 jsr compare_alignment?
9dd4: 90 08 bcc @emotion2
9dd6: ad ea 02 lda RWTSBUF_npc_pense_emot1 ;npc emotion #1 (1-based)
9dd9: d0 0b bne @pense_message
9ddb: 4c 3f a0 jmp no_response_1
9dde: ad ee 02 @emotion2 lda RWTSBUF_npc_pense_emot2 ;npc emotion #2 (1-based)
9de1: d0 03 bne @pense_message
9de3: 4c 3f a0 jmp no_response_1
9de6: a2 0a @pense_message ldx #$0a ;location on screen
9de8: 20 21 9c jsr print_npc_message
9deb: c6 23 dec levelSpirit ;use one point of spirit
9ded: a5 27 lda limitSpirit
9def: c9 0a cmp #$0a ;pense msg needs 10 limit (but no more cast points)
9df1: b0 03 bcs @spirit_limit_ok
9df3: 4c 06 77 @pense_message_failed jmp GAME2_message_wait ;can't pense messages, display nothing and continue
9df6: a5 23 @spirit_limit_ok lda levelSpirit
9df8: f0 f9 beq @pense_message_failed
9dfa: 20 14 a0 jsr check_npc_in_range ;msg must be in range, emotion works from anywhere
9dfd: 90 f4 bcc @pense_message_failed
9dff: ad f2 02 lda RWTSBUF_npctype
9e02: c9 01 cmp #$01
9e04: d0 0b bne @pense_message_ok
9e06: ae f1 02 ldx RWTSBUF_npcnum ;this is an animal
9e09: bd 80 b2 lda state_npc,x ;check if we've pensed it already
9e0c: 2c bf 1d bit GAME1_BITTAB7
9e0f: d0 e2 bne @pense_message_failed ;we have, no response
9e11: 20 0c 60 @pense_message_ok jsr GAME2_PRNTSTR ;message worked, may still get NO RESPONSE
9e14: 51 .dd1 $51
9e15: cd c5 d3 d3+ .str ↑“MESSAGE:”
9e1d: ff .dd1 $ff
9e1e: 20 65 a0 jsr compare_alignment? ;will return 1 of 2 messages, or no response
9e21: 90 08 bcc @variant2
9e23: ad eb 02 lda RWTSBUF_npc_pense_mesg1 ;npc message #1 (1-based)
9e26: d0 0b bne @print_pense_message
9e28: 4c 52 a0 jmp no_response_2
9e2b: ad ef 02 @variant2 lda RWTSBUF_npc_pense_mesg2 ;npc message #2 (1-based)
9e2e: d0 03 bne @print_pense_message
9e30: 4c 52 a0 jmp no_response_2
9e33: a2 79 @print_pense_message ldx #$79 ;location on screen
9e35: 20 21 9c jsr print_npc_message
9e38: c6 23 dec levelSpirit
9e3a: ad f2 02 lda RWTSBUF_npctype
9e3d: c9 01 cmp #$01
9e3f: d0 1f bne @ret
; Pensing a new animal causes a gain of 1 spirit limit; record when this happens
; and if it happens 5 times, refill spirit and gain a level. (Recording running
; gain is a cheap, but probably unnecessarily optimized, way to check the new
; limitSpirit is divisible by 5.)
9e41: ae f1 02 ldx RWTSBUF_npcnum ;our pense caused us to gain 1 spirit limit!
9e44: bd 80 b2 lda state_npc,x
9e47: 09 80 ora #$80
9e49: 9d 80 b2 sta state_npc,x
9e4c: e6 27 inc limitSpirit
9e4e: a5 27 lda limitSpirit
9e50: 85 23 sta levelSpirit
9e52: 20 46 9d jsr play_random_triumph_melody
9e55: e6 3f inc gainSpirit ;running counter of spirit increases, modulo 5
9e57: a5 3f lda gainSpirit ;(major events that add 5 don't affect this counter)
9e59: c9 05 cmp #$05 ;have we gained 1 point 5 times?
9e5b: d0 03 bne @ret
9e5d: 20 00 1b jsr GAME1_power_gained ;yes, gain a level (also resets gainSpirit to 0)
9e60: 4c 06 77 @ret jmp GAME2_message_wait
9e63: 20 06 60 buy jsr GAME2_cleartext
9e66: 20 e9 9f jsr check_merchant_here
9e69: 20 14 a0 jsr check_npc_in_range
9e6c: b0 03 bcs L9E71
9e6e: 4c 3f a0 jmp no_response_1
9e71: a2 4a L9E71 ldx #$4a
9e73: bd 6c b5 @loop lda inv_token,x
9e76: 2c bd 1d bit GAME1_BITTAB5
9e79: d0 1f bne @check_weight
9e7b: ca dex
9e7c: 10 f5 bpl @loop
9e7e: 20 0c 60 jsr GAME2_PRNTSTR
9e81: 01 .dd1 $01
9e82: d9 cf d5 a0+ .str ↑“YOU NEED MORE TOKENS”
9e96: ff .dd1 $ff
9e97: 4c 06 77 jmp GAME2_message_wait
9e9a: a5 70 @check_weight lda WEIGHT
9e9c: 18 clc
9e9d: 69 04 adc #$04 ;I guess everything weighs 4?
9e9f: c5 2c cmp maxWeight
9ea1: 90 27 bcc @underweight
9ea3: 20 0c 60 jsr GAME2_PRNTSTR
9ea6: 01 .dd1 $01
9ea7: d3 cf d2 d2+ .str ↑“SORRY, YOU'RE CARRYING TOO MUCH”
9ec6: ff .dd1 $ff
9ec7: 4c 06 77 jmp GAME2_message_wait
9eca: a9 00 @underweight lda #$00
9ecc: 9d 6c b5 sta inv_token,x
9ecf: a0 08 ldy #$08
9ed1: 20 12 77 jsr GAME2_lose_weight ;but why discard weight here
9ed4: a9 01 lda #$01
9ed6: 85 37 sta spokeTo ;maybe the take flag?
9ed8: 20 0c 60 jsr GAME2_PRNTSTR
9edb: 01 .dd1 $01
9edc: d4 c1 cb c5+ .str ↑“TAKE WHICHEVER ONE PLEASES YOU”
9efa: ff .dd1 $ff
9efb: 4c 06 77 jmp GAME2_message_wait
tempItemSlot .var $77 {addr/1}
tempItemNum .var $78 {addr/1}
9efe: 20 06 60 sell jsr GAME2_cleartext
9f01: 20 e9 9f jsr check_merchant_here
9f04: 20 14 a0 jsr check_npc_in_range
9f07: b0 03 bcs @what_to_sell
9f09: 4c 3f a0 jmp no_response_1
9f0c: 20 0c 60 @what_to_sell jsr GAME2_PRNTSTR
9f0f: 01 .dd1 $01
9f10: d7 c8 c1 d4+ .str ↑“WHAT WILL YOU SELL?”
9f23: ff .dd1 $ff
9f24: a9 ff lda #$ff
9f26: 85 77 sta tempItemSlot
9f28: 85 78 sta tempItemNum
9f2a: 85 39 sta suppressSound0
9f2c: 20 0c 77 jsr GAME2_await_button_up
9f2f: e6 77 @next_item inc tempItemSlot ;loop over slots $00..$FE
9f31: a6 77 ldx tempItemSlot
9f33: e0 ff cpx #$ff ;slot $FF is "NOTHING"
9f35: d0 1a bne @some_item
9f37: 86 78 stx tempItemNum
9f39: 20 0c 60 jsr GAME2_PRNTSTR
9f3c: 16 .dd1 $16
9f3d: ce cf d4 c8+ .str ↑“NOTHING ”
9f4d: ff .dd1 $ff
9f4e: 4c 6f 9f jmp @beep
9f51: bd 00 b5 @some_item lda itemState,x
9f54: 2c bd 1d bit GAME1_BITTAB5 ;in inventory?
9f57: f0 d6 beq @next_item ;no, skip
9f59: 8a txa
9f5a: 20 03 77 jsr GAME2_slot_to_item
9f5d: c4 78 cpy tempItemNum
9f5f: f0 ce beq @next_item
9f61: b9 da 9f lda sellable_items,y ;is item saleable?
9f64: f0 c9 beq @next_item ;no, skip it
9f66: 84 78 sty tempItemNum
9f68: a9 16 lda #$16
9f6a: 85 64 sta HTAB
9f6c: 20 0f 77 jsr GAME2_print_item_desc
9f6f: 20 06 b6 @beep jsr SCRN_play_sound_0 ;beep
9f72: 20 2a 6b @loop jsr GAME2_menu_input
9f75: d0 07 bne @sold ;button pressed
9f77: a5 86 lda YDIR
9f79: 10 f7 bpl @loop ;didn't press up, loop
9f7b: 4c 2f 9f jmp @next_item
9f7e: 20 06 60 @sold jsr GAME2_cleartext
9f81: a6 77 ldx tempItemSlot
9f83: e0 ff cpx #$ff ;NOTHING?
9f85: d0 01 bne L9F88 ;selected something, branch
9f87: 60 rts ;nothing, just return
NOTE: Unsure what #$4A is for relating to item state
9f88: a2 4a L9F88 ldx #$4a ;?
9f8a: bd 6c b5 @loop lda inv_token,x
9f8d: f0 1d beq @sell_it
9f8f: ca dex
9f90: 10 f8 bpl @loop
9f92: 20 0c 60 jsr GAME2_PRNTSTR
9f95: 01 .dd1 $01
9f96: c9 a7 cd a0+ .str ↑“I'M NOT INTERESTED”
9fa8: ff .dd1 $ff
9fa9: 4c 06 77 jmp GAME2_message_wait
9fac: a9 60 @sell_it lda #$60 ;?
9fae: 9d 6c b5 sta inv_token,x
9fb1: a6 77 ldx tempItemSlot
9fb3: a9 00 lda #$00
9fb5: 9d 00 b5 sta itemState,x ;clear item; permanently burned
9fb8: 8a txa
9fb9: 20 03 77 jsr GAME2_slot_to_item
9fbc: 20 12 77 jsr GAME2_lose_weight
9fbf: e6 70 inc WEIGHT ;obtained token weighs 1
9fc1: 20 0c 60 jsr GAME2_PRNTSTR
9fc4: 01 .dd1 $01
9fc5: c8 c5 d2 c5+ .str ↑“HERE'S YOUR TOKEN”
9fd6: ff .dd1 $ff
9fd7: 4c 06 77 jmp GAME2_message_wait
; Sellable items. One entry per item, $01 if we can sell it.
; Below we annotate the non-sellable items.
9fda: 00 sellable_items .dd1 $00 ;item 0 ignored
9fdb: 00 .dd1 $00 ;spirit lamp
9fdc: 01 .dd1 $01
9fdd: 00 .dd1 $00 ;wand
9fde: 01 .dd1 $01
9fdf: 01 .dd1 $01
9fe0: 01 .dd1 $01
9fe1: 01 .dd1 $01
9fe2: 00 .dd1 $00 ;token
9fe3: 01 .dd1 $01
9fe4: 01 .dd1 $01
9fe5: 01 .dd1 $01
9fe6: 00 .dd1 $00 ;key
9fe7: 00 .dd1 $00 ;key
9fe8: 00 .dd1 $00 ;elixer
• Clear variables
9fe9: ad f2 02 check_merchant_here lda RWTSBUF_npctype
9fec: c9 80 cmp #$80
9fee: f0 23 beq @rts
9ff0: 20 0c 60 jsr GAME2_PRNTSTR
9ff3: 01 .dd1 $01
9ff4: d4 c8 c5 d2+ .str ↑“THERE IS NO MERCHANT HERE”
a00d: ff .dd1 $ff
a00e: 68 pla
a00f: 68 pla
a010: 4c 06 77 jmp GAME2_message_wait
a013: 60 @rts rts
; Check if NPC is in range for normal speech (1-2 tiles), as well as facing you,
; and set the carry flag if so.
a014: a5 19 check_npc_in_range lda playerX
a016: 18 clc
a017: 65 95 adc FACING
a019: c5 6c cmp npcX ;is NPC standing 1 tile away
a01b: f0 07 beq @x_ok
a01d: 18 clc
a01e: 65 95 adc FACING
a020: c5 6c cmp npcX ;or 2 away
a022: d0 19 bne @clc
a024: a4 1a @x_ok ldy playerY
a026: c4 6d cpy npcY
a028: f0 0b beq LA035
a02a: c8 iny
a02b: c4 6d cpy npcY
a02d: f0 06 beq LA035
a02f: 88 dey
a030: 88 dey
a031: c4 6d cpy npcY
a033: d0 08 bne @clc
a035: a5 95 LA035 lda FACING
a037: c5 6f cmp npcFacing
a039: f0 02 beq @clc ;facing same dir, reject
a03b: 38 sec ;we're good
a03c: 60 rts
a03d: 18 @clc clc
a03e: 60 rts
a03f: 20 0c 60 no_response_1 jsr GAME2_PRNTSTR
a042: 0f .dd1 $0f
a043: ce cf a0 d2+ .str ↑“NO RESPONSE”
a04e: ff .dd1 $ff
a04f: 4c 06 77 jmp GAME2_message_wait
a052: 20 0c 60 no_response_2 jsr GAME2_PRNTSTR
a055: 5a .dd1 $5a
a056: ce cf a0 d2+ .str ↑“NO RESPONSE”
a061: ff .dd1 $ff
a062: 4c 06 77 jmp GAME2_message_wait
********************************************************************************
* $45 and $46 come from $02E2 ($45 is the lower 4 bits, and $46 is the upper 4 *
* bits >> 4). This data always exists at $02E2, so these are effectively *
* precomputed temps for this map screen. *
* *
* $28 comes from the character stats, loaded at init time and never modified. *
* *
* Empirically (based on map data), $46 will always be $00 (meaning $28) or $01 *
* (meaning $29). $45 will be $00..$04 (never $05). *
* Based on player stats, $28/$29 are always $00,$02,$03, or $05 (never $04 or *
* $01). *
* *
* The caller does a BCC (<) on the result so it is natural that $28/$29 do not *
* exactly match $45. *
* *
* Callers deal with NO RESPONSE etc. so it's possible this is alignment- *
* related, although it is more fine-grained than the binary races. *
********************************************************************************
a065: a6 45 compare_alignment? ldx MON_A5H
a067: b5 28 lda MON_BASL,x
a069: c5 46 cmp $46
a06b: 60 rts
a06c: 20 06 60 offer jsr GAME2_cleartext
a06f: ad e1 02 lda RWTSBUF_npc
a072: d0 16 bne offer_what
a074: 20 0c 60 @noone jsr GAME2_PRNTSTR
a077: 01 .dd1 $01
a078: cf c6 c6 c5+ .str ↑“OFFER TO WHOM?”
a086: ff .dd1 $ff
a087: 4c 06 77 jmp GAME2_message_wait
a08a: 20 14 a0 offer_what jsr check_npc_in_range
a08d: 90 e5 bcc @noone
a08f: 20 0c 60 jsr GAME2_PRNTSTR
a092: 01 .dd1 $01
a093: cf c6 c6 c5+ .str ↑“OFFER WHAT?”
a09e: ff .dd1 $ff
a09f: a9 ff lda #$ff
a0a1: 85 77 sta selItemSlot
a0a3: 85 39 sta suppressSound0
a0a5: 85 78 sta selItemNum
a0a7: 20 0c 77 jsr GAME2_await_button_up
a0aa: e6 77 LA0AA inc selItemSlot
a0ac: a6 77 ldx selItemSlot
a0ae: e0 ff cpx #$ff
a0b0: d0 1a bne LA0CC
a0b2: 86 78 stx selItemNum
a0b4: 20 0c 60 jsr GAME2_PRNTSTR
a0b7: 0e .dd1 $0e
a0b8: ce cf d4 c8+ .str ↑“NOTHING ”
a0c8: ff .dd1 $ff
a0c9: 4c e5 a0 jmp LA0E5
a0cc: bd 00 b5 LA0CC lda itemState,x
a0cf: 2c bd 1d bit GAME1_BITTAB5
a0d2: f0 d6 beq LA0AA
a0d4: 8a txa
a0d5: 20 03 77 jsr GAME2_slot_to_item
a0d8: c4 78 cpy selItemNum
a0da: f0 ce beq LA0AA
a0dc: 84 78 sty selItemNum
a0de: a9 0e lda #$0e
a0e0: 85 64 sta HTAB
a0e2: 20 0f 77 jsr GAME2_print_item_desc
a0e5: 20 06 b6 LA0E5 jsr SCRN_play_sound_0
a0e8: 20 2a 6b LA0E8 jsr GAME2_menu_input
a0eb: d0 07 bne LA0F4
a0ed: a5 86 lda YDIR
a0ef: 10 f7 bpl LA0E8
a0f1: 4c aa a0 jmp LA0AA
a0f4: 20 06 60 LA0F4 jsr GAME2_cleartext
a0f7: a6 77 ldx selItemSlot
a0f9: e0 ff cpx #$ff
a0fb: d0 03 bne LA100
a0fd: 4c 06 77 jmp GAME2_message_wait
a100: a4 78 LA100 ldy selItemNum
a102: ad f1 02 lda RWTSBUF_npcnum
a105: c9 49 cmp #$49
a107: f0 22 beq offer_raamo ;getting warmer
a109: c9 34 cmp #$34
a10b: f0 2e beq LA13B
a10d: c9 35 cmp #$35
a10f: f0 3d beq LA14E
a111: 4c 3f a0 jmp no_response_1
a114: 20 0c 60 @will_not_help jsr GAME2_PRNTSTR
a117: 01 .dd1 $01
a118: d4 c8 c1 d4+ .str ↑“THAT WON'T HELP”
a127: ff .dd1 $ff
a128: 4c 06 77 jmp GAME2_message_wait
; Spoiler ahead: Offer Raamo a shuba or a rope to win.
a12b: c0 07 offer_raamo cpy #item_shuba
a12d: f0 04 beq @win
a12f: c0 0b cpy #item_rope
a131: d0 e1 bne @will_not_help
a133: 20 24 6b @win jsr GAME2_win_game ;that was easy
a136: 68 pla
a137: 68 pla
a138: 4c 40 a8 jmp SCRN_warm_start
a13b: c0 0a LA13B cpy #$0a
a13d: d0 d5 bne @will_not_help
a13f: e6 41 inc MON_A3H
a141: a5 41 lda MON_A3H
a143: c9 02 cmp #$02
a145: d0 0b bne LA152
a147: a9 80 lda #$80
a149: 8d 34 b2 sta $b234
a14c: d0 04 bne LA152
a14e: c0 08 LA14E cpy #$08
a150: d0 c2 bne @will_not_help
a152: a9 01 LA152 lda #$01
a154: 85 42 sta MON_A4L
a156: a9 00 lda #$00
a158: a6 77 ldx selItemSlot
a15a: 9d 00 b5 sta itemState,x
a15d: 20 12 77 jsr GAME2_lose_weight
a160: 20 0c 60 jsr GAME2_PRNTSTR
a163: 01 .dd1 $01
a164: d9 cf d5 a0+ .str ↑“YOU MAY ENTER”
a171: ff .dd1 $ff
a172: 4c 06 77 jmp GAME2_message_wait
a175: 20 06 60 use jsr GAME2_cleartext
a178: 20 0c 60 jsr GAME2_PRNTSTR
a17b: 01 .dd1 $01
a17c: d5 d3 c5 a0+ .str ↑“USE WHAT?”
a185: ff .dd1 $ff
a186: a9 ff lda #$ff
a188: 85 77 sta selItemSlot
a18a: 85 78 sta selItemNum
a18c: 85 39 sta suppressSound0
a18e: 20 0c 77 jsr GAME2_await_button_up
a191: e6 77 LA191 inc selItemSlot
a193: a6 77 ldx selItemSlot
a195: e0 ff cpx #$ff
a197: d0 1a bne LA1B3
a199: 86 78 stx selItemNum
a19b: 20 0c 60 jsr GAME2_PRNTSTR
a19e: 0c .dd1 $0c
a19f: ce cf d4 c8+ .str ↑“NOTHING ”
a1af: ff .dd1 $ff
a1b0: 4c d0 a1 jmp LA1D0
a1b3: bd 00 b5 LA1B3 lda itemState,x
a1b6: 29 20 and #$20
a1b8: f0 d7 beq LA191
a1ba: 8a txa
a1bb: 20 03 77 jsr GAME2_slot_to_item
a1be: b9 df a1 lda LA1DF,y
a1c1: f0 ce beq LA191
a1c3: c4 78 cpy selItemNum
a1c5: f0 ca beq LA191
a1c7: 84 78 sty selItemNum
a1c9: a9 0c lda #$0c
a1cb: 85 64 sta HTAB
a1cd: 20 0f 77 jsr GAME2_print_item_desc
a1d0: 20 06 b6 LA1D0 jsr SCRN_play_sound_0
a1d3: 20 2a 6b LA1D3 jsr GAME2_menu_input
a1d6: d0 16 bne use_item
a1d8: a5 86 lda YDIR
a1da: 10 f7 bpl LA1D3
a1dc: 4c 91 a1 jmp LA191
a1df: 00 LA1DF .dd1 $00
a1e0: 00 .dd1 $00
a1e1: 01 .dd1 $01
a1e2: 01 .dd1 $01
a1e3: 00 00 00 00+ .fill 5,$00
a1e8: 01 .dd1 $01
a1e9: 00 .dd1 $00
a1ea: 01 .dd1 $01
a1eb: 01 .dd1 $01
a1ec: 01 .dd1 $01
a1ed: 00 .dd1 $00
a1ee: 20 06 60 use_item jsr GAME2_cleartext
a1f1: a5 77 lda selItemSlot
a1f3: c9 ff cmp #$ff ;nothing
a1f5: d0 01 bne use_lamp
a1f7: 60 rts
a1f8: a5 78 use_lamp lda selItemNum
a1fa: c9 02 cmp #item_honeyLamp
a1fc: d0 4d bne use_wand
a1fe: a5 3a lda litLamp
a200: f0 20 beq light_lamp
a202: 20 0c 60 jsr GAME2_PRNTSTR
a205: 01 .dd1 $01
a206: d9 cf d5 d2+ .str ↑“YOUR LAMP IS ALREADY LIT”
a21e: ff .dd1 $ff
a21f: 4c 06 77 jmp GAME2_message_wait
a222: a5 77 light_lamp lda selItemSlot
a224: 85 3a sta litLamp
a226: 20 21 60 jsr GAME2_read_0900 ;pseudo-random bytes
a229: 29 03 and #$03
a22b: 18 clc
a22c: 69 0a adc #$0a ;10..13
a22e: 85 44 sta lampFuel
a230: 20 0c 60 jsr GAME2_PRNTSTR
a233: 01 .dd1 $01
a234: d9 cf d5 d2+ .str ↑“YOUR LAMP IS LIT”
a244: ff .dd1 $ff
a245: 20 4b 60 jsr $604b
a248: 4c 06 77 jmp GAME2_message_wait
a24b: c9 03 use_wand cmp #item_wand
a24d: d0 4d bne @check_beak
a24f: 20 81 a4 jsr LA481
a252: b0 0b bcs @wand_cuts_swiftly
a254: a9 1c lda #$1c
a256: 85 08 sta temp08
a258: 20 44 a4 jsr LA444
a25b: a5 76 lda temp76
a25d: f0 1d beq @wand_is_useless
a25f: 20 0c 60 @wand_cuts_swiftly jsr GAME2_PRNTSTR
a262: 01 .dd1 $01
a263: d4 c8 c5 a0+ .str ↑“THE WAND CUTS SWIFTLY”
a278: ff .dd1 $ff
a279: 4c 06 77 jmp GAME2_message_wait
a27c: 20 0c 60 @wand_is_useless jsr GAME2_PRNTSTR
a27f: 01 .dd1 $01
a280: d4 c8 c5 a0+ .str ↑“THE WAND IS USELESS HERE”
a298: ff .dd1 $ff
a299: 4c 06 77 jmp GAME2_message_wait
a29c: c9 09 @check_beak cmp #item_beak
a29e: f0 03 beq use_trencher_beak
a2a0: 4c 30 a3 jmp @check_rope
a2a3: a9 1c use_trencher_beak lda #$1c
a2a5: 85 08 sta temp08
a2a7: 20 44 a4 jsr LA444
a2aa: a5 76 lda temp76
a2ac: f0 23 beq @trencher_beak_useless
a2ae: 20 21 60 jsr GAME2_read_0900
a2b1: c9 f0 cmp #$f0
a2b3: b0 45 bcs @trencher_beak_breaks
a2b5: 20 0c 60 jsr GAME2_PRNTSTR
a2b8: 01 .dd1 $01
a2b9: d4 c8 c5 a0+ .str ↑“THE BEAK CUTS SLOWLY”
a2cd: ff .dd1 $ff
a2ce: 4c 06 77 jmp GAME2_message_wait
@trencher_beak_useless
a2d1: 20 0c 60 jsr GAME2_PRNTSTR
a2d4: 01 .dd1 $01
a2d5: d4 c8 c5 a0+ .str ↑“THE TRENCHER BEAK IS USELESS HERE”
a2f6: ff .dd1 $ff
a2f7: 4c 06 77 jmp GAME2_message_wait
a2fa: a9 00 @trencher_beak_breaks lda #$00
a2fc: a6 77 ldx selItemSlot
a2fe: 9d 00 b5 sta itemState,x
a301: 20 0c 60 jsr GAME2_PRNTSTR
a304: 01 .dd1 $01
a305: d4 c8 c5 a0+ .str ↑“THE TRENCHER BEAK BREAKS”
a31d: ff .dd1 $ff
a31e: a2 07 ldx #$07
a320: 20 03 b6 jsr SCRN_play_sound
a323: a2 ff ldx #$ff
a325: 20 12 60 jsr GAME2_delay1
a328: a0 09 ldy #$09
a32a: 20 12 77 jsr GAME2_lose_weight
a32d: 4c 06 77 jmp GAME2_message_wait
a330: c9 0b @check_rope cmp #item_rope
a332: f0 03 beq use_rope
a334: 4c c0 a3 jmp use_temple_key
a337: a9 00 use_rope lda #$00
a339: 85 75 sta temp75
a33b: a9 01 lda #$01
a33d: 85 08 sta temp08
a33f: a5 19 lda playerX
a341: 20 84 a3 jsr LA384
a344: a5 76 lda temp76
a346: d0 20 bne LA368
a348: 20 0c 60 jsr GAME2_PRNTSTR
a34b: 01 .dd1 $01
a34c: d4 c8 c5 a0+ .str ↑“THE ROPE IS USELESS HERE”
a364: ff .dd1 $ff
a365: 4c 06 77 jmp GAME2_message_wait
a368: a9 e0 LA368 lda #$e0
a36a: 85 75 sta temp75
a36c: a9 00 lda #$00
a36e: 85 08 sta temp08
a370: a5 19 lda playerX
a372: 20 87 a3 jsr LA387
a375: a9 00 lda #$00
a377: a6 77 ldx selItemSlot
a379: 9d 00 b5 sta itemState,x
a37c: a0 0b ldy #$0b
a37e: 20 12 77 jsr GAME2_lose_weight
a381: 4c 06 77 jmp GAME2_message_wait
a384: 18 LA384 clc
a385: 65 95 adc FACING
a387: 18 LA387 clc
a388: 65 95 adc FACING
a38a: 85 05 sta $05
a38c: a6 1a ldx playerY
a38e: e8 inx
a38f: 86 06 stx $06
a391: a9 00 lda #$00
a393: 85 76 sta temp76
a395: a6 05 LA395 ldx $05
a397: 30 22 bmi LA3BB
a399: e0 28 cpx #$28
a39b: b0 1e bcs LA3BB
a39d: a4 06 ldy $06
a39f: 20 1e 6b jsr GAME2_tile_at_xy
a3a2: f0 04 beq LA3A8
a3a4: a5 08 lda temp08
a3a6: d0 12 bne LA3BA
a3a8: a5 75 LA3A8 lda temp75
a3aa: 20 f3 a7 jsr drawtile_and_store
a3ad: a5 05 lda $05
a3af: 18 clc
a3b0: 65 95 adc FACING
a3b2: 85 05 sta $05
a3b4: e6 76 inc temp76
a3b6: e6 08 inc temp08
a3b8: d0 db bne LA395
a3ba: 60 LA3BA rts
a3bb: a9 00 LA3BB lda #$00
a3bd: 85 76 sta temp76
a3bf: 60 rts
a3c0: c9 0c use_temple_key cmp #item_templeKey
a3c2: d0 3a bne use_falla_key?
a3c4: a5 1b lda MAPPOS
a3c6: c9 4a cmp #$4a
a3c8: d0 04 bne LA3CE
a3ca: a5 1c lda MAPHALF
a3cc: f0 11 beq key_is_useless_here
a3ce: a9 08 LA3CE lda #$08
a3d0: 85 08 sta temp08
a3d2: 20 44 a4 jsr LA444
a3d5: a5 76 lda temp76
a3d7: f0 06 beq key_is_useless_here
a3d9: 20 46 9d jsr play_random_triumph_melody
a3dc: 4c 06 77 jmp GAME2_message_wait
a3df: 20 0c 60 key_is_useless_here jsr GAME2_PRNTSTR
a3e2: 01 .dd1 $01
a3e3: d4 c8 c5 a0+ .str ↑“THE KEY IS USELESS HERE”
a3fa: ff .dd1 $ff
a3fb: 4c 06 77 jmp GAME2_message_wait
a3fe: a5 1b use_falla_key? lda MAPPOS
a400: c9 4a cmp #$4a
a402: d0 db bne key_is_useless_here
a404: a5 1c lda MAPHALF
a406: d0 d7 bne key_is_useless_here
a408: a9 08 lda #$08
a40a: 85 08 sta temp08
a40c: 20 44 a4 jsr LA444
a40f: a5 76 lda temp76
a411: f0 cc beq key_is_useless_here
a413: a5 95 lda FACING
a415: 30 2a bmi LA441
a417: 20 0c 60 jsr GAME2_PRNTSTR
a41a: 01 .dd1 $01
a41b: c5 ce d4 c5+ .str ↑“ENTER THE CHAMBER OF THE FORGOTTEN”
a43d: ff .dd1 $ff
a43e: 20 46 9d jsr play_random_triumph_melody
a441: 4c 06 77 LA441 jmp GAME2_message_wait
a444: a5 19 LA444 lda playerX
a446: 18 clc
a447: 65 95 adc FACING
a449: 85 05 sta $05
a44b: a5 1a lda playerY
a44d: 85 06 sta $06
a44f: a9 00 lda #$00
a451: 85 76 sta temp76
a453: 20 5e a4 jsr LA45E
a456: a5 19 lda playerX
a458: 85 05 sta $05
a45a: a5 1a lda playerY
a45c: 85 06 sta $06
a45e: a9 05 LA45E lda #$05
a460: 85 75 sta temp75
a462: a6 05 LA462 ldx $05
a464: a4 06 ldy $06
a466: 20 1e 6b jsr GAME2_tile_at_xy
a469: c5 08 cmp temp08
a46b: d0 07 bne LA474
a46d: a9 00 lda #$00
a46f: 20 f3 a7 jsr drawtile_and_store
a472: e6 76 inc temp76
a474: c6 06 LA474 dec $06
a476: c6 75 dec temp75
a478: d0 e8 bne LA462
a47a: 20 15 6b jsr $6b15
a47d: 20 03 6b jsr GAME2_draw_player
a480: 60 rts
a481: ae f1 02 LA481 ldx RWTSBUF_npcnum
a484: f0 6d beq LA4F3
a486: bd 00 b2 lda state_npc1,x
a489: 2c bf 1d bit GAME1_BITTAB7
a48c: d0 65 bne LA4F3
a48e: a5 19 lda playerX
a490: c5 6c cmp npcX
a492: f0 0e beq LA4A2
a494: 18 clc
a495: 65 95 adc FACING
a497: c5 6c cmp npcX
a499: f0 07 beq LA4A2
a49b: 18 clc
a49c: 65 95 adc FACING
a49e: c5 6c cmp npcX
a4a0: d0 51 bne LA4F3
a4a2: a4 1a LA4A2 ldy playerY
a4a4: c4 6d cpy npcY
a4a6: f0 0b beq LA4B3
a4a8: 88 dey
a4a9: c4 6d cpy npcY
a4ab: f0 06 beq LA4B3
a4ad: c8 iny
a4ae: c8 iny
a4af: c4 6d cpy npcY
a4b1: d0 40 bne LA4F3
a4b3: bd 00 b2 LA4B3 lda state_npc1,x
a4b6: 09 80 ora #$80
a4b8: 9d 00 b2 sta state_npc1,x
a4bb: a9 03 lda #$03
a4bd: 20 1b 6b jsr $6b1b
a4c0: 20 03 6b jsr GAME2_draw_player
a4c3: a2 01 ldx #$01
a4c5: 20 03 b6 jsr SCRN_play_sound
a4c8: a0 01 ldy #$01
a4ca: a5 6a lda $6a
a4cc: c9 0a cmp #$0a
a4ce: f0 04 beq LA4D4
a4d0: c9 06 cmp #$06
a4d2: b0 02 bcs LA4D6
a4d4: a0 05 LA4D4 ldy #$05
a4d6: 84 11 LA4D6 sty temp11_textlo ;temp reused for a bit
a4d8: a5 27 lda limitSpirit
a4da: 38 sec
a4db: e5 11 sbc temp11_textlo
a4dd: b0 02 bcs LA4E1
a4df: a9 00 lda #$00
a4e1: 85 27 LA4E1 sta limitSpirit
a4e3: a9 00 lda #$00
a4e5: 85 23 sta levelSpirit
a4e7: a9 00 lda #$00
a4e9: 85 6b sta zp6b_npcHere
a4eb: a9 32 lda #$32 ;spirited away?
a4ed: 85 6c sta npcX
a4ef: 85 6d sta npcY
a4f1: 38 sec
a4f2: 60 rts
a4f3: 18 LA4F3 clc
a4f4: 60 rts
a4f5: 20 06 60 heal jsr GAME2_cleartext
a4f8: a5 27 lda limitSpirit
a4fa: c9 0f cmp #15
a4fc: b0 03 bcs @check_spirit_level
a4fe: 4c d2 a7 jmp you_lack_spirit_skill
a501: a5 23 @check_spirit_level lda levelSpirit
a503: 38 sec
a504: e9 05 sbc #$05
a506: b0 03 bcs @heal_ok
a508: 4c 03 01 jmp STACK_need_energy ;jumps into illegal instruction
a50b: 85 23 @heal_ok sta levelSpirit
a50d: 18 clc
a50e: a5 24 lda levelFood
a510: 69 02 adc #$02
a512: c5 2a cmp limitFood
a514: 90 04 bcc LA51A
a516: a6 2a ldx limitFood
a518: ca dex
a519: 8a txa
a51a: 85 24 LA51A sta levelFood
a51c: 18 clc
a51d: a5 25 lda levelRest
a51f: 69 02 adc #$02
a521: c5 2b cmp limitRest
a523: 90 04 bcc @you_heal_yourself
a525: a6 2b ldx limitRest
a527: ca dex
a528: 8a txa
a529: 85 25 @you_heal_yourself sta levelRest
a52b: 20 0c 60 jsr GAME2_PRNTSTR
a52e: 01 .dd1 $01
a52f: d9 cf d5 a0+ .str ↑“YOU HEAL YOURSELF”
a540: ff .dd1 $ff
a541: 4c 06 77 jmp GAME2_message_wait
a544: 20 06 60 grunspreke jsr GAME2_cleartext
a547: a5 27 lda limitSpirit
a549: c9 14 cmp #20
a54b: b0 03 bcs LA550
a54d: 4c d2 a7 jmp you_lack_spirit_skill
a550: a5 23 LA550 lda levelSpirit
a552: 38 sec
a553: e9 02 sbc #$02
a555: b0 03 bcs LA55A
a557: 4c 03 01 jmp STACK_need_energy
a55a: a5 60 LA55A lda $60
a55c: f0 26 beq LA584
a55e: 20 0c 60 LA55E jsr GAME2_PRNTSTR
a561: 01 .dd1 $01
a562: c7 d2 d5 ce+ .str ↑“GRUNSPREKING DOESN'T WORK HERE”
a580: ff .dd1 $ff
a581: 4c 06 77 jmp GAME2_message_wait
a584: 20 0f 6b LA584 jsr $6b0f
a587: a5 e3 lda tileUnder
a589: c9 df cmp #$df
a58b: f0 08 beq LA595
a58d: c9 02 cmp #$02
a58f: 90 cd bcc LA55E
a591: c9 07 cmp #$07
a593: b0 c9 bcs LA55E
a595: a5 19 LA595 lda playerX
a597: 18 clc
a598: 65 95 adc FACING
a59a: 85 05 sta $05
a59c: 30 c0 bmi LA55E
a59e: c9 28 cmp #$28
a5a0: b0 bc bcs LA55E
a5a2: aa tax
a5a3: a4 1a ldy playerY
a5a5: c8 iny
a5a6: 84 06 sty $06
a5a8: 20 1e 6b jsr GAME2_tile_at_xy
a5ab: c9 df cmp #$df
a5ad: f0 af beq LA55E
a5af: c9 02 cmp #$02
a5b1: 90 04 bcc LA5B7
a5b3: c9 07 cmp #$07
a5b5: 90 a7 bcc LA55E
a5b7: a0 00 LA5B7 ldy #$00
a5b9: a9 df lda #$df
a5bb: 20 f3 a7 jsr drawtile_and_store
a5be: 18 clc
a5bf: a9 18 lda #$18
a5c1: 65 8a adc temp89+1
a5c3: 85 8a sta temp89+1
a5c5: a9 09 lda #$09
a5c7: a5 23 lda levelSpirit
a5c9: 38 sec
a5ca: e9 02 sbc #$02
a5cc: 85 23 sta levelSpirit
a5ce: 20 0c 60 jsr GAME2_PRNTSTR
a5d1: 01 .dd1 $01
a5d2: d4 c8 c5 a0+ .str ↑“THE LIMB GROWS”
a5e0: ff .dd1 $ff
a5e1: 4c 06 77 jmp GAME2_message_wait
a5e4: 20 06 60 kiniport jsr GAME2_cleartext
a5e7: a5 27 lda limitSpirit
a5e9: c9 19 cmp #25
a5eb: b0 03 bcs @check_spirit_level
a5ed: 4c d2 a7 jmp you_lack_spirit_skill
a5f0: a5 23 @check_spirit_level lda levelSpirit
a5f2: c9 05 cmp #$05
a5f4: b0 03 bcs @kiniport_what
a5f6: 4c 03 01 jmp STACK_need_energy
a5f9: 20 c2 a7 @kiniport_what jsr LA7C2
a5fc: 20 0c 60 jsr GAME2_PRNTSTR
a5ff: 01 .dd1 $01
a600: d7 c8 c1 d4+ .str ↑“WHAT DO YOU WANT TO KINIPORT?”
a61d: ff .dd1 $ff
a61e: 20 0c 77 jsr GAME2_await_button_up
a621: 20 8c a7 jsr LA78C
a624: 20 06 60 jsr GAME2_cleartext
a627: a6 19 ldx playerX
a629: e4 31 cpx $31
a62b: f0 03 beq LA630
a62d: 4c b2 a6 jmp LA6B2
a630: a4 1a LA630 ldy playerY
a632: c4 32 cpy MON_INVFLAG
a634: f0 0d beq kiniport_body
a636: 88 dey
a637: c4 32 cpy MON_INVFLAG
a639: f0 08 beq kiniport_body
a63b: 88 dey
a63c: c4 32 cpy MON_INVFLAG
a63e: f0 03 beq kiniport_body
a640: 4c b2 a6 jmp LA6B2
a643: a5 27 kiniport_body lda limitSpirit
a645: c9 1e cmp #30
a647: b0 06 bcs @check_spirit_level
a649: 20 ce a7 jsr LA7CE
a64c: 4c d2 a7 jmp you_lack_spirit_skill
a64f: a5 23 @check_spirit_level lda levelSpirit
a651: c9 0a cmp #10
a653: b0 06 bcs kiniport_body_where
a655: 20 ce a7 jsr LA7CE
a658: 4c 03 01 jmp STACK_need_energy
a65b: 20 0c 60 kiniport_body_where jsr GAME2_PRNTSTR
a65e: 01 .dd1 $01
a65f: cb c9 ce c9+ .str ↑“KINIPORT YOUR BODY WHERE?”
a678: ff .dd1 $ff
a679: 20 0c 77 LA679 jsr GAME2_await_button_up
a67c: 20 8c a7 jsr LA78C
a67f: a6 31 ldx $31
a681: a4 32 ldy MON_INVFLAG
a683: c8 iny
a684: 20 1e 6b jsr GAME2_tile_at_xy
a687: 20 12 6b jsr $6b12
a68a: a5 f0 lda ySolid
a68c: f0 eb beq LA679
a68e: a6 31 ldx $31
a690: a4 32 ldy MON_INVFLAG
a692: 20 1e 6b jsr GAME2_tile_at_xy
a695: 20 78 a7 jsr LA778
a698: b0 df bcs LA679
a69a: a5 31 lda $31
a69c: 85 19 sta playerX
a69e: a5 32 lda MON_INVFLAG
a6a0: 85 1a sta playerY
a6a2: 20 0c 6b jsr GAME2_redraw_player
a6a5: 20 ce a7 jsr LA7CE
a6a8: a5 23 lda levelSpirit
a6aa: 38 sec
a6ab: e9 0a sbc #$0a
a6ad: 85 23 sta levelSpirit
a6af: 4c 06 60 jmp GAME2_cleartext
a6b2: a6 31 LA6B2 ldx $31
a6b4: a4 32 ldy MON_INVFLAG
a6b6: 20 1e 6b jsr GAME2_tile_at_xy
a6b9: c9 e1 cmp #$e1
a6bb: b0 22 bcs LA6DF
a6bd: 20 0c 60 jsr GAME2_PRNTSTR
a6c0: 01 .dd1 $01
a6c1: d9 cf d5 a0+ .str ↑“YOU CAN'T KINIPORT THAT”
a6d8: ff .dd1 $ff
a6d9: 20 ce a7 jsr LA7CE
a6dc: 4c 06 77 jmp GAME2_message_wait
a6df: 2c b8 1d LA6DF bit GAME1_BITTAB0
a6e2: d0 02 bne LA6E6
a6e4: c6 31 dec $31
a6e6: a5 31 LA6E6 lda $31
a6e8: 85 08 sta temp08
a6ea: a5 32 lda MON_INVFLAG
a6ec: 85 65 sta $65
a6ee: 20 15 77 jsr $7715
a6f1: 85 33 sta MON_PROMPT
a6f3: 20 0c 60 jsr GAME2_PRNTSTR
a6f6: 01 .dd1 $01
a6f7: cb c9 ce c9+ .str ↑“KINIPORT THE OBJECT WHERE?”
a711: ff .dd1 $ff
a712: 20 0c 77 LA712 jsr GAME2_await_button_up
a715: 20 8c a7 jsr LA78C
a718: a6 31 ldx $31
a71a: a4 32 ldy MON_INVFLAG
a71c: 20 1e 6b jsr GAME2_tile_at_xy
a71f: 20 74 a7 jsr LA774
a722: b0 ee bcs LA712
a724: a6 31 ldx $31
a726: e8 inx
a727: a4 32 ldy MON_INVFLAG
a729: 20 1e 6b jsr GAME2_tile_at_xy
a72c: 20 74 a7 jsr LA774
a72f: b0 e1 bcs LA712
a731: a6 31 ldx $31
a733: a4 32 ldy MON_INVFLAG
a735: c8 iny
a736: 20 1e 6b jsr GAME2_tile_at_xy
a739: 20 12 6b jsr $6b12
a73c: a5 f0 lda ySolid
a73e: f0 d2 beq LA712
a740: a6 31 ldx $31
a742: e0 27 cpx #$27
a744: f0 cc beq LA712
a746: a6 33 ldx MON_PROMPT
a748: bd 00 b5 lda itemState,x
a74b: 09 20 ora #$20
a74d: 9d 00 b5 sta itemState,x
a750: 20 24 77 jsr $7724
a753: a6 33 ldx MON_PROMPT
a755: a5 31 lda $31
a757: 9d 00 b4 sta itemStateCol,x
a75a: bd 00 b5 lda itemState,x
a75d: 29 c0 and #$c0
a75f: 05 32 ora MON_INVFLAG
a761: 9d 00 b5 sta itemState,x
a764: 20 24 77 jsr $7724
a767: 20 ce a7 jsr LA7CE
a76a: a5 23 lda levelSpirit
a76c: 38 sec
a76d: e9 05 sbc #$05
a76f: 85 23 sta levelSpirit
a771: 4c 06 60 jmp GAME2_cleartext
a774: c9 e1 LA774 cmp #$e1
a776: b0 12 bcs LA78A
a778: c9 07 LA778 cmp #$07
a77a: f0 0e beq LA78A
a77c: c9 52 cmp #$52
a77e: f0 0a beq LA78A
a780: c9 1c cmp #$1c
a782: f0 06 beq LA78A
a784: c9 08 cmp #$08
a786: f0 02 beq LA78A
a788: 18 clc
a789: 60 rts
a78a: 38 LA78A sec
a78b: 60 rts
a78c: 20 2a 6b LA78C jsr GAME2_menu_input
a78f: f0 05 beq LA796
a791: a2 00 ldx #$00
a793: 4c 03 b6 jmp SCRN_play_sound
a796: a5 a2 LA796 lda MOVING
a798: f0 f2 beq LA78C
a79a: 20 1c a8 jsr LA81C
a79d: 18 clc
a79e: a5 85 lda XDIR
a7a0: 65 31 adc $31
a7a2: 30 06 bmi LA7AA
a7a4: c9 28 cmp #$28
a7a6: b0 02 bcs LA7AA
a7a8: 85 31 sta $31
a7aa: 18 LA7AA clc
a7ab: a5 86 lda YDIR
a7ad: 65 32 adc MON_INVFLAG
a7af: 30 06 bmi LA7B7
a7b1: c9 13 cmp #$13
a7b3: b0 02 bcs LA7B7
a7b5: 85 32 sta MON_INVFLAG
a7b7: 20 02 a8 LA7B7 jsr LA802
a7ba: a2 32 ldx #$32
a7bc: 20 12 60 jsr GAME2_delay1
a7bf: 4c 8c a7 jmp LA78C
a7c2: a5 19 LA7C2 lda playerX
a7c4: 85 31 sta $31
a7c6: a5 1a lda playerY
a7c8: 85 32 sta MON_INVFLAG
a7ca: 20 02 a8 jsr LA802
a7cd: 60 rts
a7ce: 20 1c a8 LA7CE jsr LA81C
a7d1: 60 rts
a7d2: 20 0c 60 you_lack_spirit_skill jsr GAME2_PRNTSTR
a7d5: 01 .dd1 $01
a7d6: d9 cf d5 a0+ .str ↑“YOU LACK THE SPIRIT SKILL”
a7ef: ff .dd1 $ff
a7f0: 4c 06 77 jmp GAME2_message_wait
; Draw tile in A to hires screen at (TXTCOL,TXTROW), and store it to the text
; screen at that same position.
a7f3: 85 49 drawtile_and_store sta temp49 ;temp save, used only here
a7f5: 20 03 60 jsr GAME2_drawtile ;write tile in A to hires
a7f8: 20 21 77 jsr GAME2_txtpos_to_addr ;get text addr of tile in $11
a7fb: a5 49 lda temp49
a7fd: a0 00 ldy #$00
a7ff: 91 11 sta (temp11_textlo),y ;store tile to text page
a801: 60 rts
a802: a5 31 LA802 lda $31
a804: 85 05 sta $05
a806: a5 32 lda MON_INVFLAG
a808: 85 06 sta $06
a80a: a9 34 lda #$34
a80c: 85 16 sta $16
a80e: a9 a8 lda #$a8
a810: 85 17 sta $17
a812: a9 ff lda #$ff
a814: 85 18 sta $18
a816: 20 42 60 jsr GAME2_calc_hires_textpos
a819: 4c 45 60 jmp GAME2_writetile
a81c: a5 31 LA81C lda $31
a81e: 85 05 sta $05
a820: a5 32 lda MON_INVFLAG
a822: 85 06 sta $06
a824: 20 21 77 jsr GAME2_txtpos_to_addr
a827: a0 00 ldy #$00
a829: b1 11 lda (temp11_textlo),y
a82b: 20 03 60 jsr GAME2_drawtile
a82e: 20 03 6b jsr GAME2_draw_player
a831: 4c 15 6b jmp $6b15
a834: 7f .dd1 $7f
a835: 7f .dd1 $7f
a836: 63 63 63 63 .str “cccc”
a83a: 7f .dd1 $7f
a83b: 7f .dd1 $7f
a83c: 45 4e 20 20 .str “EN ”
a840: 4c 63 a8 SCRN_warm_start jmp warm_start
a843: 4c .dd1 $4c
a844: 1d .dd1 $1d
a845: ae .dd1 $ae
a846: 4c 50 a8 start_vec jmp cold_start ;set hires and warm start
a849: 4c c9 ae SCRN_sound_status jmp sound_status
a84c: 4c f2 ae jmp LAEF2 ;may be unused
a84f: 60 rts rts
a850: a9 40 cold_start lda #$40
a852: a2 20 ldx #$20
a854: 20 33 60 jsr GAME2_clearpages ;Clear hires page 2 (was SCREEN)
a857: ad 50 c0 lda TXTCLR
a85a: ad 52 c0 lda MIXCLR
a85d: ad 55 c0 lda TXTPAGE2
a860: ad 57 c0 lda HIRES ;Set hires page 2 fullscreen
a863: a9 00 warm_start lda #$00
a865: 85 83 sta waitMelody
NOTE: how is $d0 set ... zp swap? set to 0 on startup. when set to $80, it skips
the demo and goes direct to menu. after demo it is set to $01. I don't notice
any difference between $d0 == ff and $d0 == 80.
a867: a5 d0 lda $d0
a869: 30 11 bmi @d0_neg
a86b: d0 0b bne @d0_pos_nonzero
a86d: a9 0d lda #$0d ;$d0 == 0
a86f: 85 c9 sta $c9
a871: a9 01 lda #$01
a873: 85 d0 sta $d0 ;$d0 == 1
a875: 4c 27 60 jmp GAME2_intro
a878: a9 ff @d0_pos_nonzero lda #$ff ;when $d0 = $01..7f, set to $ff
a87a: 85 d0 sta $d0 ;$d0 now guaranteed to be $80..$ff
a87c: a9 00 @d0_neg lda #$00
a87e: 85 c9 sta $c9
a880: 85 c4 sta DEMOFLG
a882: 20 06 60 jsr GAME2_cleartext
a885: a9 01 lda #$01
a887: 20 4f a8 jsr rts ;nop??
a88a: a5 1b lda MAPPOS
a88c: 85 d2 sta $d2
a88e: a5 1c lda MAPHALF
a890: 85 d3 sta $d3
a892: a9 9d lda #$9d
a894: 85 1b sta MAPPOS
a896: a9 00 lda #$00
a898: 85 1c sta MAPHALF
a89a: 20 1e 60 jsr GAME2_read_playfield
a89d: 20 b1 ad LA89D jsr LADB1
a8a0: 20 bd ad jsr LADBD
a8a3: 20 0c 77 jsr GAME2_await_button_up
a8a6: 20 2a 6b LA8A6 jsr GAME2_menu_input
a8a9: d0 2a bne start_quest
a8ab: a5 86 lda YDIR
a8ad: f0 f7 beq LA8A6
a8af: 10 09 bpl LA8BA
a8b1: a5 d7 lda $d7
a8b3: f0 f1 beq LA8A6
a8b5: c6 d7 dec $d7
a8b7: 4c c2 a8 jmp LA8C2
a8ba: a5 d7 LA8BA lda $d7
a8bc: c9 03 cmp #$03
a8be: f0 e6 beq LA8A6
a8c0: e6 d7 inc $d7
a8c2: 20 b1 ad LA8C2 jsr LADB1
a8c5: 20 bd ad jsr LADBD
a8c8: a2 00 ldx #$00
a8ca: 20 03 b6 jsr SCRN_play_sound
a8cd: a2 50 ldx #$50
a8cf: 20 12 60 jsr GAME2_delay1
a8d2: 4c a6 a8 jmp LA8A6
a8d5: a5 d7 start_quest lda $d7
a8d7: d0 03 bne continue_quest
a8d9: 4c ed a8 jmp init_choose_player
a8dc: c9 01 continue_quest cmp #$01
a8de: d0 03 bne storage_disk
a8e0: 4c 4c ab jmp continue_quest0
a8e3: c9 02 storage_disk cmp #$02
a8e5: d0 03 bne sample_quest
a8e7: 4c 74 ab jmp save_load_menu
a8ea: 4c a6 ad sample_quest jmp do_sample_quest ;sample quest?
a8ed: a5 d4 init_choose_player lda $d4
a8ef: 85 d5 sta $d5
a8f1: a5 20 lda PLAYER
a8f3: 85 d4 sta $d4
a8f5: 20 06 60 jsr GAME2_cleartext
; Display current player choice (in $d4).
a8f8: 20 0c 60 choose_player jsr GAME2_PRNTSTR
a8fb: 07 .dd1 $07
a8fc: c3 c8 cf cf+ .str ↑“CHOOSE YOUR PLAYER:”
a90f: ff .dd1 $ff
; if ($d4 == 0) {
; print NERIC -- A KINDAR BORN YOUNG MAN
; } else if ($d4 == 1) {
; print GENAA -- A KINDAR BORN YOUNG WOMAN
; } ... else {
; print RETURN TO MENU
; }
a910: a5 d4 choose_neric lda $d4 ;player choice 0..5
a912: d0 54 bne choose_genaa
a914: 20 0c 60 jsr GAME2_PRNTSTR
a917: 1c .dd1 $1c
a918: ce c5 d2 c9+ .str ↑“NERIC”
a91d: ff .dd1 $ff
a91e: 20 0c 60 jsr GAME2_PRNTSTR
a921: 51 .dd1 $51
a922: c1 a0 cb c9+ .str ↑“A KINDAR-BORN YOUNG MAN ”
a93b: ff .dd1 $ff
a93c: 20 0c 60 jsr GAME2_PRNTSTR
a93f: 79 .dd1 $79
a940: d3 d4 d2 cf+ .str ↑“STRONG--IMPULSIVE--MODERATE SPIRIT ”
a964: ff .dd1 $ff
a965: 4c de aa jmp do_player_choice
a968: c9 01 choose_genaa cmp #PLAYER_Genaa
a96a: d0 54 bne choose_herd
a96c: 20 0c 60 jsr GAME2_PRNTSTR
a96f: 1c .dd1 $1c
a970: c7 c5 ce c1+ .str ↑“GENAA”
a975: ff .dd1 $ff
a976: 20 0c 60 jsr GAME2_PRNTSTR
a979: 51 .dd1 $51
a97a: c1 a0 cb c9+ .str ↑“A KINDAR-BORN YOUNG WOMAN”
a993: ff .dd1 $ff
a994: 20 0c 60 jsr GAME2_PRNTSTR
a997: 79 .dd1 $79
a998: d3 d4 d2 cf+ .str ↑“STRONG--CHARISMATIC--NO SPIRIT SKILL”
a9bc: ff .dd1 $ff
a9bd: 4c de aa jmp do_player_choice
a9c0: c9 02 choose_herd cmp #PLAYER_Herd
a9c2: d0 54 bne choose_pomma
a9c4: 20 0c 60 jsr GAME2_PRNTSTR
a9c7: 1c .dd1 $1c
a9c8: c8 c5 d2 c4+ .str ↑“HERD ”
a9cd: ff .dd1 $ff
a9ce: 20 0c 60 jsr GAME2_PRNTSTR
a9d1: 51 .dd1 $51
a9d2: c1 a0 c3 c1+ .str ↑“A CAVERN-BORN ERDLING ”
a9eb: ff .dd1 $ff
a9ec: 20 0c 60 jsr GAME2_PRNTSTR
a9ef: 79 .dd1 $79
a9f0: d3 d4 d2 cf+ .str ↑“STRONG--RATIONAL--MODERATE SPIRIT ”
aa14: ff .dd1 $ff
aa15: 4c de aa jmp do_player_choice
aa18: c9 03 choose_pomma cmp #PLAYER_Pomma
aa1a: d0 54 bne choose_charn
aa1c: 20 0c 60 jsr GAME2_PRNTSTR
aa1f: 1c .dd1 $1c
aa20: d0 cf cd cd+ .str ↑“POMMA”
aa25: ff .dd1 $ff
aa26: 20 0c 60 jsr GAME2_PRNTSTR
aa29: 51 .dd1 $51
aa2a: c1 a0 cb c9+ .str ↑“A KINDAR GIRL-CHILD ”
aa43: ff .dd1 $ff
aa44: 20 0c 60 jsr GAME2_PRNTSTR
aa47: 79 .dd1 $79
aa48: c4 c5 cc c9+ .str ↑“DELICATE--GREATLY SPIRIT GIFTED ”
aa6c: ff .dd1 $ff
aa6d: 4c de aa jmp do_player_choice
aa70: c9 04 choose_charn cmp #PLAYER_Charn
aa72: d0 54 bne choose_noone
aa74: 20 0c 60 jsr GAME2_PRNTSTR
aa77: 1c .dd1 $1c
aa78: c3 c8 c1 d2+ .str ↑“CHARN”
aa7d: ff .dd1 $ff
aa7e: 20 0c 60 jsr GAME2_PRNTSTR
aa81: 51 .dd1 $51
aa82: c1 ce a0 c5+ .str ↑“AN ERDLING BOY-CHILD ”
aa9b: ff .dd1 $ff
aa9c: 20 0c 60 jsr GAME2_PRNTSTR
aa9f: 79 .dd1 $79
aaa0: d3 d4 d5 d2+ .str ↑“STURDY--ALERT--MODERATE SPIRIT GIFT ”
aac4: ff .dd1 $ff
aac5: 4c de aa jmp do_player_choice
aac8: 20 06 60 choose_noone jsr GAME2_cleartext
aacb: 20 0c 60 jsr GAME2_PRNTSTR
aace: 0c .dd1 $0c
aacf: d2 c5 d4 d5+ .str ↑“RETURN TO MENU”
aadd: ff .dd1 $ff
aade: a2 01 do_player_choice ldx #$01 ;play sound 1 (high pitched beep)
aae0: 20 03 b6 jsr SCRN_play_sound
aae3: a2 a0 ldx #$a0
aae5: 20 12 60 jsr GAME2_delay1
NOTE:
aae8: 20 0c 77 jsr GAME2_await_button_up ;GAME2 menu vec
aaeb: 20 2a 6b @loop jsr GAME2_menu_input ;GAME2 vec
aaee: d0 12 bne LAB02
aaf0: a5 86 lda YDIR
aaf2: 10 f7 bpl @loop
aaf4: a6 d4 ldx $d4 ;move down 1 menu row
aaf6: e8 inx
aaf7: e0 06 cpx #$06 ;past end of menu?
aaf9: d0 02 bne @next
aafb: a2 00 ldx #$00 ;wrap around to neric
aafd: 86 d4 @next stx $d4
aaff: 4c f8 a8 jmp choose_player
ab02: 20 06 60 LAB02 jsr GAME2_cleartext
ab05: a5 d4 lda $d4
ab07: c9 05 cmp #$05
ab09: d0 07 bne LAB12
ab0b: a5 d5 lda $d5
ab0d: 85 d4 sta $d4
ab0f: 4c 9d a8 jmp LA89D
ab12: c5 20 LAB12 cmp PLAYER
ab14: f0 03 beq LAB19
ab16: 20 1d ae jsr read_char_data
ab19: 20 3f 60 LAB19 jsr GAME2_init_item_state
ab1c: a9 b2 lda #$b2
ab1e: a2 01 ldx #$01
ab20: 20 33 60 jsr GAME2_clearpages
ab23: 20 39 60 jsr GAME2_player_init
ab26: a9 ff lda #$ff
ab28: 85 b8 sta foodRestTimer
ab2a: a5 2d lda homePos
ab2c: 85 1b sta MAPPOS
ab2e: a5 2e lda homeHalf
ab30: 85 1c sta MAPHALF
ab32: a9 01 lda #$01
ab34: 85 67 sta INSIDE
ab36: a5 2f lda homeX
ab38: 85 31 sta $31
ab3a: a5 30 lda homeY
ab3c: 85 32 sta MON_INVFLAG
ab3e: a9 00 lda #$00
ab40: 85 6b sta zp6b_npcHere
ab42: 20 1e 60 jsr GAME2_read_playfield
ab45: a9 01 lda #$01
ab47: 85 ba sta $ba
ab49: 4c 3c 60 jmp $603c
ab4c: a5 ba continue_quest0 lda $ba
ab4e: d0 03 bne LAB53
ab50: 4c a6 a8 jmp LA8A6 ;jump back to start quest
ab53: 20 06 60 LAB53 jsr GAME2_cleartext
ab56: a5 d4 lda $d4
ab58: c5 20 cmp PLAYER
ab5a: f0 05 beq LAB61
ab5c: 85 20 sta PLAYER
ab5e: 20 1d ae jsr read_char_data
ab61: a9 01 LAB61 lda #$01
ab63: 20 21 6b jsr $6b21
ab66: a5 d2 lda $d2
ab68: 85 1b sta MAPPOS
ab6a: a5 d3 lda $d3
ab6c: 85 1c sta MAPHALF
ab6e: 20 2a 60 jsr $602a
ab71: 4c 2d 60 jmp $602d
ab74: 20 06 60 save_load_menu jsr GAME2_cleartext
ab77: 20 0c 60 save_load_menu0 jsr GAME2_PRNTSTR
ab7a: 01 .dd1 $01
ab7b: a0 d3 c1 d6+ .str ↑“ SAVE GAME LOAD GAME RETURN TO MENU ”
aba1: ff .dd1 $ff
aba2: a9 01 lda #$01
aba4: 85 66 sta $66
aba6: a5 d6 lda $d6
aba8: d0 13 bne @load_game
abaa: 20 0c 60 jsr GAME2_PRNTSTR
abad: 01 .dd1 $01
abae: a0 d3 c1 d6+ .str ↑“ SAVE GAME ”
abb9: ff .dd1 $ff
abba: 4c e9 ab jmp LABE9
abbd: c9 01 @load_game cmp #$01
abbf: d0 13 bne @return_to_menu
abc1: 20 0c 60 jsr GAME2_PRNTSTR
abc4: 0c .dd1 $0c
abc5: a0 cc cf c1+ .str ↑“ LOAD GAME ”
abd0: ff .dd1 $ff
abd1: 4c e9 ab jmp LABE9
abd4: 20 0c 60 @return_to_menu jsr GAME2_PRNTSTR
abd7: 17 .dd1 $17
abd8: a0 d2 c5 d4+ .str ↑“ RETURN TO MENU ”
abe8: ff .dd1 $ff
abe9: a2 01 LABE9 ldx #$01
abeb: 20 03 b6 jsr SCRN_play_sound
abee: a2 a0 ldx #$a0
abf0: 20 12 60 jsr GAME2_delay1
abf3: 20 0c 77 jsr GAME2_await_button_up
abf6: 20 2a 6b LABF6 jsr GAME2_menu_input
abf9: d0 12 bne LAC0D
abfb: a5 85 lda XDIR
abfd: f0 f7 beq LABF6
abff: 18 clc
ac00: 65 d6 adc $d6
ac02: 30 f2 bmi LABF6
ac04: c9 03 cmp #$03
ac06: f0 ee beq LABF6
ac08: 85 d6 sta $d6
ac0a: 4c 77 ab jmp save_load_menu0
ac0d: a5 d6 LAC0D lda $d6
ac0f: d0 0a bne LAC1B
ac11: a5 ba lda $ba
ac13: d0 10 bne select_save_quest
ac15: 20 06 60 jsr GAME2_cleartext
ac18: 4c 9d a8 jmp LA89D
ac1b: c9 01 LAC1B cmp #$01
ac1d: f0 06 beq select_save_quest
ac1f: 20 06 60 jsr GAME2_cleartext
ac22: 4c 9d a8 jmp LA89D
ac25: 20 0c 60 select_save_quest jsr GAME2_PRNTSTR
ac28: 59 .dd1 $59
ac29: a0 d1 d5 c5+ .str ↑“ QUEST 1 2 3 4 5 ”
ac40: ff .dd1 $ff
ac41: a9 01 lda #$01
ac43: 85 66 sta $66
ac45: a5 da lda QUEST
ac47: d0 0b bne quest_2
ac49: 20 0c 60 jsr GAME2_PRNTSTR
ac4c: 61 .dd1 $61
ac4d: a0 b1 a0 .str ↑“ 1 ”
ac50: ff .dd1 $ff
ac51: 4c 89 ac jmp LAC89
ac54: c9 01 quest_2 cmp #$01
ac56: d0 0b bne quest_3
ac58: 20 0c 60 jsr GAME2_PRNTSTR
ac5b: 64 .dd1 $64
ac5c: a0 b2 a0 .str ↑“ 2 ”
ac5f: ff .dd1 $ff
ac60: 4c 89 ac jmp LAC89
ac63: c9 02 quest_3 cmp #$02
ac65: d0 0b bne quest_4
ac67: 20 0c 60 jsr GAME2_PRNTSTR
ac6a: 67 .dd1 $67
ac6b: a0 b3 a0 .str ↑“ 3 ”
ac6e: ff .dd1 $ff
ac6f: 4c 89 ac jmp LAC89
ac72: c9 03 quest_4 cmp #$03
ac74: d0 0b bne quest_5
ac76: 20 0c 60 jsr GAME2_PRNTSTR
ac79: 6a .dd1 $6a
ac7a: a0 b4 a0 .str ↑“ 4 ”
ac7d: ff .dd1 $ff
ac7e: 4c 89 ac jmp LAC89
ac81: 20 0c 60 quest_5 jsr GAME2_PRNTSTR
ac84: 6d .dd1 $6d
ac85: a0 b5 a0 .str ↑“ 5 ”
ac88: ff .dd1 $ff
ac89: a2 00 LAC89 ldx #$00
ac8b: 20 03 b6 jsr SCRN_play_sound
ac8e: a2 80 ldx #$80
ac90: 20 12 60 jsr GAME2_delay1
ac93: 20 0c 77 jsr GAME2_await_button_up
ac96: 20 2a 6b LAC96 jsr GAME2_menu_input
ac99: d0 12 bne insert_storage_disk
ac9b: a5 85 lda XDIR
ac9d: f0 f7 beq LAC96
ac9f: 18 clc
aca0: 65 da adc QUEST
aca2: 30 f2 bmi LAC96
aca4: c9 05 cmp #$05
aca6: f0 ee beq LAC96
aca8: 85 da sta QUEST
acaa: 4c 25 ac jmp select_save_quest
acad: 20 06 60 insert_storage_disk jsr GAME2_cleartext
acb0: 20 0c 60 jsr GAME2_PRNTSTR
acb3: 01 .dd1 $01
acb4: c9 ce d3 c5+ .str ↑“INSERT STORAGE DISK - PRESS TRIGGER”
acd7: ff .dd1 $ff
acd8: a2 01 ldx #$01
acda: 20 03 b6 jsr SCRN_play_sound
acdd: a2 a0 ldx #$a0
acdf: 20 12 60 jsr GAME2_delay1
ace2: 20 0c 77 jsr GAME2_await_button_up
ace5: 20 2a 6b @again jsr GAME2_menu_input
ace8: f0 fb beq @again
acea: a5 da lda QUEST
acec: 18 clc
aced: 69 30 adc #$30
acef: 20 06 60 jsr GAME2_cleartext
acf2: a5 d6 lda $d6
acf4: f0 03 beq save_game_data
acf6: 4c 45 ad jmp load_game_data
; Writes game data to storage disk. Copies game data from the 5 pages $B2..$B5
; and page $00 to the RWTS buffer at $0200, and writes it to sectors $00..$04 of
; a single track $01..$05 (depending on the save slot or "quest").
sect .var $08 {addr/1} ;current sector
acf9: a5 d2 save_game_data lda $d2
acfb: 85 1b sta MAPPOS
acfd: a5 d3 lda $d3
acff: 85 1c sta MAPHALF
ad01: a9 02 lda #RWTSCMD_write ;WRITE
ad03: 8d 0c 03 sta RWTS_IOB_command
ad06: a9 00 lda #$00
ad08: 8d 05 03 sta RWTS_IOB_sector
ad0b: 85 08 sta sect
ad0d: a6 da ldx QUEST ;selected save slot
ad0f: bd 3b ad lda save_track,x
ad12: 8d 04 03 sta RWTS_IOB_track
ad15: a6 08 @loop ldx sect
ad17: bd 40 ad lda pages_to_save,x ;copy page $B2,$B3,$B4,$B5,$00
ad1a: a2 01 ldx #$01 ;(1 page)
ad1c: a0 02 ldy #>RWTSBUF ;copy to $200
ad1e: 20 30 60 jsr GAME2_copypages
ad21: 20 15 60 jsr GAME2_swapzp8 ;preserve zp
ad24: 20 15 03 jsr DIRECT_RWTS ;write the sector
ad27: 20 15 60 jsr GAME2_swapzp8 ;restore zp
ad2a: ee 05 03 inc RWTS_IOB_sector ;next sector and page
ad2d: e6 08 inc sect
ad2f: a5 08 lda sect
ad31: c9 05 cmp #$05 ;have we copied all 5 pages
ad33: d0 e0 bne @loop ;no, loop
ad35: 20 98 ae jsr insert_side_2_trig
ad38: 4c 9d a8 jmp LA89D
ad3b: 01 02 03 04+ save_track .bulk 0102030405
ad40: b2 b3 b4 b5+ pages_to_save .bulk b2b3b4b500
; Load save game data. Read sectors $00..$04 of single track $01..$05 (indexed
; by quest #) into page $b2..$b5 and $00. Preserve the user's current settings
; of sound on/off and joystick/keyboard in page $00. If the loaded game is using
; a different player, load their sprite data as well.
ad45: a5 20 load_game_data lda PLAYER ;save critical flags which
ad47: 48 pha ;may differ in loaded zero page
ad48: a5 b1 lda JOYFLG
ad4a: 48 pha
ad4b: a5 4a lda SOUNDFLG
ad4d: 48 pha
ad4e: a9 01 lda #$01 ;READ
ad50: 8d 0c 03 sta RWTS_IOB_command
ad53: a6 da ldx QUEST ;which save slot
ad55: bd 3b ad lda save_track,x
ad58: 8d 04 03 sta RWTS_IOB_track
ad5b: a9 00 lda #$00
ad5d: 8d 05 03 sta RWTS_IOB_sector
ad60: 85 08 sta sect
ad62: 20 15 60 @loop jsr GAME2_swapzp8
ad65: 20 15 03 jsr DIRECT_RWTS
ad68: 20 15 60 jsr GAME2_swapzp8
ad6b: a6 08 ldx sect
ad6d: bd 40 ad lda pages_to_save,x
ad70: f0 10 beq @restore_zp ;zero page (always last loaded)
ad72: a8 tay
ad73: a9 02 lda #>RWTSBUF ;copy a page from sector buffer
ad75: a2 01 ldx #$01
ad77: 20 30 60 jsr GAME2_copypages
ad7a: ee 05 03 inc RWTS_IOB_sector
ad7d: e6 08 inc sect
ad7f: 4c 62 ad jmp @loop
; Continuing from load_game_data...
ad82: a0 00 @restore_zp ldy #$00 ;restore zero page data
ad84: b9 00 02 @loop lda RWTSBUF,y ;from read sector
ad87: 99 00 00 sta $0000,y
ad8a: c8 iny
ad8b: d0 f7 bne @loop
ad8d: 68 pla ;restore 3 saved flags
ad8e: 85 4a sta SOUNDFLG
ad90: 68 pla
ad91: 85 b1 sta JOYFLG
ad93: 68 pla
ad94: c5 20 cmp PLAYER ;is the save using the active character?
ad96: f0 08 beq @load_done ;yes, done loading data
ad98: 85 20 sta PLAYER ;no, update character
ad9a: 20 1d ae jsr read_char_data ;and read their data
ad9d: 4c 9d a8 jmp LA89D
ada0: 20 98 ae @load_done jsr insert_side_2_trig ;swap game disk back in
ada3: 4c 9d a8 jmp LA89D
ada6: a9 0d do_sample_quest lda #$0d
ada8: 85 c9 sta $c9
adaa: a9 00 lda #$00
adac: 85 ba sta $ba
adae: 4c 27 60 jmp GAME2_intro
adb1: 20 c5 ad LADB1 jsr print_start_game
adb4: 20 dd ad jsr print_continue
adb7: 20 f5 ad jsr print_disk_storage
adba: 4c 09 ae jmp print_sample_quest
adbd: a9 01 LADBD lda #$01 ;this extra code is here for highlighting
adbf: 85 66 sta $66
adc1: a5 d7 lda $d7
adc3: d0 14 bne LADD9
adc5: 20 0c 60 print_start_game jsr GAME2_PRNTSTR
adc8: 0d .dd1 $0d
adc9: a0 a0 d3 d4+ .str ↑“ START GAME ”
add7: ff .dd1 $ff
add8: 60 rts
add9: c9 01 LADD9 cmp #$01
addb: d0 14 bne LADF1
addd: 20 0c 60 print_continue jsr GAME2_PRNTSTR
ade0: 35 .dd1 $35
ade1: a0 a0 a0 c3+ .str ↑“ CONTINUE ”
adef: ff .dd1 $ff
adf0: 60 rts
adf1: c9 02 LADF1 cmp #$02
adf3: d0 14 bne print_sample_quest
adf5: 20 0c 60 print_disk_storage jsr GAME2_PRNTSTR
adf8: 5d .dd1 $5d
adf9: a0 c4 c9 d3+ .str ↑“ DISK STORAGE ”
ae07: ff .dd1 $ff
ae08: 60 rts
ae09: 20 0c 60 print_sample_quest jsr GAME2_PRNTSTR
ae0c: 85 .dd1 $85
ae0d: a0 d3 c1 cd+ .str ↑“ SAMPLE QUEST ”
ae1b: ff .dd1 $ff
ae1c: 60 rts
; This prompts to insert side 1, then reads game data from a single track
; $05..$09 (based on selected character), sectors $00..$0B into $2000..$2BFF.
; This explains the orphaned sectors on T05..09 on side 1, and why the character
; is invisible if these sectors are left out. Neric's data (character 0) is
; preloaded as part of GAME1, available during the demo, and you are not
; prompted if you select him.
readpage .var $dc {addr/1} ;current sector
ae1d: 20 06 60 read_char_data jsr GAME2_cleartext
ae20: 20 0c 60 jsr GAME2_PRNTSTR
ae23: 01 .dd1 $01
ae24: a0 a0 a0 c9+ .str ↑“ INSERT SIDE 1 - PRESS TRIGGER”
ae44: ff .dd1 $ff
ae45: a2 ff ldx #$ff
ae47: 20 12 60 jsr GAME2_delay1
ae4a: 20 0c 77 jsr GAME2_await_button_up
ae4d: 20 0c 77 jsr GAME2_await_button_up
ae50: 20 2a 6b @again jsr GAME2_menu_input
ae53: f0 fb beq @again
ae55: 20 06 60 jsr GAME2_cleartext
ae58: a4 d4 ldy $d4 ;selected character
ae5a: b9 93 ae lda char_tracks,y ;track 05..09
ae5d: 8d 04 03 sta RWTS_IOB_track
ae60: a9 00 lda #$00
ae62: 8d 05 03 sta RWTS_IOB_sector
ae65: a9 01 lda #$01 ;read
ae67: 8d 0c 03 sta RWTS_IOB_command
ae6a: a9 20 lda #$20
ae6c: 85 dc sta readpage
ae6e: 20 15 60 @loop jsr GAME2_swapzp8
ae71: 20 15 03 jsr DIRECT_RWTS
ae74: 20 15 60 jsr GAME2_swapzp8
ae77: a9 02 lda #$02
ae79: a4 dc ldy readpage
ae7b: a2 01 ldx #$01
ae7d: 20 30 60 jsr GAME2_copypages
ae80: ee 05 03 inc RWTS_IOB_sector
ae83: e6 dc inc readpage
ae85: a5 dc lda readpage
ae87: c9 2c cmp #$2c ;read into page $20..$2B?
ae89: d0 e3 bne @loop ;no, read more
ae8b: a5 d4 lda $d4
ae8d: 85 20 sta PLAYER
ae8f: 20 98 ae jsr insert_side_2_trig
ae92: 60 rts
ae93: 05 06 07 08+ char_tracks .bulk 0506070809
ae98: 20 0c 60 insert_side_2_trig jsr GAME2_PRNTSTR
ae9b: 01 .dd1 $01
ae9c: a0 a0 a0 c9+ .str ↑“ INSERT SIDE 2 - PRESS TRIGGER”
aebc: ff .dd1 $ff
aebd: 20 0c 77 jsr GAME2_await_button_up
aec0: 20 2a 6b LAEC0 jsr GAME2_menu_input
aec3: f0 fb beq LAEC0
aec5: 20 06 60 jsr GAME2_cleartext
aec8: 60 rts
aec9: 20 06 60 sound_status jsr GAME2_cleartext
aecc: 20 0c 60 jsr GAME2_PRNTSTR
aecf: 0c .dd1 $0c
aed0: d3 cf d5 ce+ .str ↑“SOUND IS NOW O”
aede: ff .dd1 $ff
aedf: a5 4a lda SOUNDFLG
aee1: d0 08 bne @sound_is_on
aee3: 20 0c 60 jsr GAME2_PRNTSTR
aee6: 1a .dd1 $1a
aee7: c6 c6 .str ↑“FF”
aee9: ff .dd1 $ff
aeea: 60 rts
aeeb: 20 0c 60 @sound_is_on jsr GAME2_PRNTSTR
aeee: 1a .dd1 $1a
aeef: ce .str ↑“N”
aef0: ff .dd1 $ff
aef1: 60 rts
aef2: 20 2d 6b LAEF2 jsr $6b2d ;GAME2 jmp vec
aef5: 20 21 6b jsr $6b21 ;GAME2 jmp vec
aef8: 60 rts
aef9: 08 cd 02 23+ .junk 7
.org $b600
; External vectors
b600: 4c 0c b6 SCRN_play_melody jmp play_melody ;A=?
b603: 4c 45 b6 SCRN_play_sound jmp play_sound
b606: 4c 93 b6 SCRN_play_sound_0 jmp play_sound_0
b609: 4c dc b6 SCRN_chkkey jmp chkkey ;from $6b27
b60c: aa play_melody tax
b60d: a5 4a lda SOUNDFLG ;flag? if non-zero, continue with next subroutine
b60f: d0 06 bne play_melody_
b611: a2 14 ldx #$14
b613: 20 12 60 jsr GAME2_delay1
b616: 60 rts
; Plays melody specified by X, where X := 00..0A. Like play_sound, but with an
; extra level of indirection -- X now indexes into a sound address table to
; select a sound data stream, which is composed of pairs of X,Y sound
; components, terminated by $ff. The game is frozen during this time.
;
; play_sound by contrast plays a single X,Y sound indexed by X. My theory is the
; game may iterate through X values and repeatedly call play_sound, which allows
; this stream to be played without freezing the game, so it might be a footstep.
idx .var $4d {addr/1}
addrtbl .var $4e {addr/2} ;address table
b617: bd 20 1e play_melody_ lda GAME1_melodies_lo,x ;X was A on vector entry. X:=$00..$0A
b61a: 85 4e sta addrtbl
b61c: bd 30 1e lda GAME1_melodies_hi,x
b61f: 85 4f sta addrtbl+1
b621: a9 00 lda #$00
b623: 85 4d sta idx ;index into addrtbl data
b625: a4 4d @note ldy idx
b627: b1 4e lda (addrtbl),y
b629: c9 ff cmp #$ff ;items are terminated with $ff
b62b: f0 17 beq @rts
b62d: 20 b0 b6 jsr @next_addrtbl ;y=y+1 and bumps addrtbl hi on wrap
b630: aa tax
b631: b1 4e lda (addrtbl),y
b633: 20 b0 b6 jsr @next_addrtbl ;y=y+1 and bumps addrtbl hi on wrap
b636: 84 4d sty idx ;preserve Y for loop
b638: a8 tay
b639: 20 b7 b6 jsr play_tone ;must take X (1st addrtbl byte) & Y (2nd addrtbl byte)
b63c: a9 64 lda #$64
b63e: 20 d0 b6 jsr delayAA ;delay $64*$64 = 10000 times
b641: 4c 25 b6 jmp @note
b644: 60 @rts rts
; X is the sound # to play, indexed into sound_data_Y. If this value is $ff, it
; plays the hardcoded sample 1. Otherwise, sound_data_Y is used as the Y
; component and sound_data_X is used as the X component to play what is possibly
; a tone.
;
; It's possible this is one long sample, played over time by iterating X from 0
; to 13.
b645: a5 4a play_sound lda SOUNDFLG ;Is sound on?
b647: d0 06 bne @play_sound ;yes, play sound
b649: a2 14 ldx #$14 ;no, short delay and continue
b64b: 20 12 60 jsr GAME2_delay1
b64e: 60 rts
b64f: bd 72 b6 @play_sound lda sound_data_Y,x
b652: f0 1d beq @rts
b654: 30 08 bmi play_sample_1
b656: a8 tay
b657: bd 80 b6 lda sound_data_X,x
b65a: aa tax
b65b: 4c b7 b6 jmp play_tone
; Hardcoded to play sample_data_1. Simply clicks the speaker once for each byte,
; and delays proportional to the byte value, before the next click.
b65e: a2 00 play_sample_1 ldx #$00
b660: ad 30 c0 @click lda SPKR
b663: bd 8e b6 lda sample_data_1,x ;delay between speaker clicks
b666: f0 09 beq @rts ;or terminate on 0
b668: 38 @dec sec
b669: e9 01 sbc #$01
b66b: d0 fb bne @dec
b66d: e8 inx
b66e: 4c 60 b6 jmp @click
b671: 60 @rts rts
b672: 1e sound_data_Y .dd1 $1e
b673: 3c .dd1 $3c
b674: ff .dd1 $ff
b675: ff .dd1 $ff
b676: ff .dd1 $ff
b677: ff .dd1 $ff
b678: 1e .dd1 $1e
b679: 64 .dd1 $64
b67a: 0a .dd1 $0a
b67b: 00 .dd1 $00
b67c: 3c .dd1 $3c
b67d: 14 .dd1 $14
b67e: 3c .dd1 $3c
b67f: 1e .dd1 $1e
b680: 2f sound_data_X .dd1 $2f
b681: 72 .dd1 $72
b682: 00 .dd1 $00
b683: 00 .dd1 $00
b684: 00 .dd1 $00
b685: 00 .dd1 $00
b686: ce .dd1 $ce
b687: d9 .dd1 $d9
b688: 23 .dd1 $23
b689: 00 .dd1 $00
b68a: 48 .dd1 $48
b68b: 23 .dd1 $23
b68c: 17 .dd1 $17
b68d: 1f .dd1 $1f
b68e: 5f 20 3c 80+ sample_data_1 .bulk 5f203c8000 ;5 clicks with delay values
b693: a5 4a play_sound_0 lda SOUNDFLG ;is sound on?
b695: d0 06 bne try_play_sound_0 ;yes, play it
b697: a2 64 ldx #$64 ;no, delay (somewhat longer)
b699: 20 12 60 jsr GAME2_delay1
b69c: 60 rts
; This plays sound 0 as long as $39 is not #$FF, and always sets $39 to 0. It is
; set to $FF on inventory menu entry (eating, selling, buying) in order to
; suppress the beep that normally occurs during item display.
b69d: a5 39 try_play_sound_0 lda suppressSound0 ;set to $FF when entering sell, buy or similar menu
b69f: 30 05 bmi @notqueued
b6a1: a2 00 ldx #$00
b6a3: 20 45 b6 jsr play_sound ;play sound 0 (X=0)
b6a6: a2 a0 @notqueued ldx #$a0
b6a8: 20 12 60 jsr GAME2_delay1
b6ab: a9 00 lda #$00
b6ad: 85 39 sta suppressSound0
b6af: 60 rts
b6b0: c8 @next_addrtbl iny
b6b1: f0 01 beq @inc_addrtbl_hi
b6b3: 60 rts
b6b4: e6 4f @inc_addrtbl_hi inc addrtbl+1
b6b6: 60 rts
; Appears to play a note or sound based on values in X and Y
ytmp .var $4b {addr/1}
xtmp .var $4c {addr/1}
b6b7: 86 4c play_tone stx xtmp
b6b9: 84 4b sty ytmp
b6bb: a0 00 ldy #$00
b6bd: ad 30 c0 @click lda SPKR
b6c0: 88 LB6C0 dey
b6c1: d0 04 bne LB6C7
b6c3: c6 4b dec ytmp
b6c5: f0 08 beq @rts
b6c7: ca LB6C7 dex
b6c8: d0 f6 bne LB6C0
b6ca: a6 4c ldx xtmp
b6cc: 4c bd b6 jmp @click
b6cf: 60 @rts rts
; Delay loop -- will delay A * A times. A is 0 on exit.
b6d0: 38 delayAA sec
b6d1: 48 @dec pha
b6d2: e9 01 @dec2 sbc #$01
b6d4: d0 fc bne @dec2
b6d6: 68 pla
b6d7: e9 01 sbc #$01
b6d9: d0 f6 bne @dec
b6db: 60 rts
; Checks for a latched keypress and returns it both in A and in $02; returns
; #$00 if no key was pressed. This only works for uppercase ($C0-DF), control
; chars ($80-9F), and spacebar ($A0). Lowercase is treated as uppercase, numbers
; and punctuation generally convert to control chars.
;
; There is a tiny delay before checking for keypress. This routine is used
; during gameplay and this delay affects (subtly) how fast the game plays. Set
; to $01 and the game plays a smidge faster, to $60 and you walk pretty slow.
b6dc: a2 0c chkkey ldx #$0c ;called from B609 vector
b6de: 20 12 60 jsr GAME2_delay1 ;delay
b6e1: ad 00 c0 lda KBD ;read key and clear strobe
b6e4: 8d 10 c0 sta KBDSTRB
b6e7: 10 0b bpl @nokey ;if high bit unset, no keypress
b6e9: 29 df and #$df ;convert to uppercase
b6eb: c9 80 cmp #$80 ;is it a space?
b6ed: d0 02 bne @done ;no, return verbatim
b6ef: 09 20 ora #$20 ;yes, promote to $A0
b6f1: 85 02 @done sta LASTKEY
b6f3: 60 rts
b6f4: a9 00 @nokey lda #$00 ;no keypress, return $00
b6f6: 85 02 sta LASTKEY
b6f8: 60 rts
b6f9: f0 10 e8 e4+ .junk 7
.org $0900
NOTE: This page gets copied to $0900 during setup, but is not code.
0900: ff a5 61 bd+ SCREEN_0900 .bulk ffa561bdf968c695256779a8d04edec7
0910: 7a 27 f6 57+ .bulk 7a27f657b8f880a6dc691aa44debbc14
0920: a3 76 5f dd+ .bulk a3765fdd3aec9775fba99858feb54c96
0930: 01 4b 24 c5+ .bulk 014b24c52fa777cf39070856d14ff562
0940: df 1e 6d 99+ .bulk df1e6d99ee1923a26622602e4a45306a
0950: 1d e1 5e 46+ .bulk 1de15e467b2974013bed50aa65ce7f31
0960: 32 0d 94 00+ .bulk 320d9400388afab781bee90ee2289a8e
0970: f4 40 6e 18+ .bulk f4406e18db0647c30c78ea5513b66b05
0980: c2 b9 c9 0a+ .bulk c2b9c90a63ef6cd5516ebb4871211b37
0990: 2d 96 2c 5d+ .bulk 2d962c5d124487268c3cac8f1752ab7c
09a0: da 33 78 93+ .bulk da33789302cd1c72c8098d34d2ad0f9b
09b0: e3 53 e7 3d+ .bulk e353e73d64d93fcc897e03c420888b0a
09c0: ae 2b 6f 82+ .bulk ae2b6f82d82a54c086f0901ff37dfd49
09d0: a1 04 a0 b4+ .bulk a104a0b4350bb97043c19c10e69de33e
09e0: be cb b3 91+ .bulk becbb391ffb4e5a016d636af9e42d311
09f0: b0 e4 85 b1+ .bulk b0e485b141b2f1f75bfc92f259baaacf
.org $5b00
********************************************************************************
* Copy SCREEN from $4000..$6000 into high memory at $9600..$B600, $5900..FF to *
* $B600, and $5A00..FF to $0900, to free up hires screen 2. Prompt the user to *
* insert disk side 2, then clear the logo. *
* *
* Continue execution in high memory at $A846. *
* *
* Note that $AF00 is a copy of $B600, and $B000 is a copy of $0900. *
********************************************************************************
5b00: 4c 03 5b setup jmp setup1
5b03: 20 15 60 setup1 jsr GAME2_swapzp8 ;Save zero page to $800
5b06: a9 00 lda #$00 ; (page zero)
5b08: a2 01 ldx #$01 ; (one page)
5b0a: 20 33 60 jsr GAME2_clearpages ;Clear zero page
5b0d: a9 02 lda #$02
5b0f: 85 13 sta $13 ;?
5b11: a9 01 lda #$01
5b13: 85 4a sta SOUNDFLG ;?
5b15: a9 40 lda #$40 ;Src page $40
5b17: a2 20 ldx #$20 ;for $20 pages
5b19: a0 96 ldy #$96 ;Dst page $96
5b1b: 20 30 60 jsr GAME2_copypages ;Copy $4000..$5FFF to $9600..B5FF
5b1e: a9 59 lda #$59
5b20: a2 01 ldx #$01
5b22: a0 b6 ldy #$b6
NOTE: $AF00 and $B600 are now duplicate pages.
5b24: 20 30 60 jsr GAME2_copypages ;Copy $5900..$59FF to $B600..B6FF
; Clear bit 7 and set bit 6 for the text string insert_side_2, making it flash.
5b27: a2 1c ldx #$1c ;len $1D bytes (BPL)
5b29: bd ab 5b @loop lda insert_side_2,x
5b2c: 29 7f and #$7f
5b2e: 09 40 ora #$40
5b30: 9d ab 5b sta insert_side_2,x
5b33: ca dex
5b34: 10 f3 bpl @loop ;when x >= 0
; Copy 4 lines (40*4 bytes) from side_2_msg to text screen lines 20-23. The text
; addresses are hardcoded ($650,$6d0,$750,$7d0).
src .var $03 {addr/2}
lines .var $08 {addr/1} ;# of lines copied
dst .var $11 {addr/2}
5b36: a9 a6 lda #<side_2_msg
5b38: 85 03 sta src
5b3a: a9 5b lda #>side_2_msg
5b3c: 85 04 sta src+1
5b3e: a2 00 ldx #$00
5b40: 86 08 stx lines
5b42: bd 9e 5b writeln lda textbotlo,x ;Pointer to text line addresses
5b45: 85 11 sta dst
5b47: bd a2 5b lda textbothi,x
5b4a: 85 12 sta dst+1
5b4c: a0 00 ldy #$00
5b4e: a2 00 ldx #$00
5b50: a1 03 @line lda (src,x) ;Copy byte to screen
5b52: 91 11 sta (dst),y
5b54: e6 03 inc src
5b56: d0 02 bne @next
5b58: e6 04 inc src+1 ;src high byte wrapped
5b5a: c8 @next iny
5b5b: c0 28 cpy #$28 ;40 chars copied?
5b5d: d0 f1 bne @line ;no, stay on this line
5b5f: e6 08 inc lines
5b61: a6 08 ldx lines
5b63: e0 04 cpx #$04 ;did we write 4 lines yet?
5b65: d0 db bne writeln ;no, write next line
5b67: 20 27 6b @key jsr GAME2_chkkey ;get keypress in A
5b6a: f0 fb beq @key ;until a key is pressed
5b6c: a2 01 ldx #$01 ;joystick flag (01)
5b6e: c9 ca cmp #‘J’ | $80
5b70: f0 06 beq @jkflag ;J pressed, store flag
5b72: a2 00 ldx #$00 ;keyboard flag (00)
5b74: c9 cb cmp #‘K’ | $80
5b76: d0 ef bne @key ;invalid key, retry
5b78: 86 b1 @jkflag stx JOYFLG ;01 = Joystick, 00 = Keyboard
5b7a: a9 5a lda #$5a
5b7c: a2 01 ldx #$01
5b7e: a0 09 ldy #$09
5b80: 20 30 60 jsr GAME2_copypages ;Copy $5A00..$5AFF to $0900..$09FF.
; Clear GR lines 1-20 to black, removing logo.
5b83: a2 13 ldx #$13 ;lines 1-20
5b85: bd 46 5c @clrline lda textlo,x
5b88: 85 11 sta dst
5b8a: bd 5e 5c lda texthi,x
5b8d: 85 12 sta dst+1
5b8f: a0 27 ldy #$27 ;clear 40-char line
5b91: a9 00 lda #$00
5b93: 91 11 @clrchar sta (dst),y
5b95: 88 dey
5b96: 10 fb bpl @clrchar
5b98: ca dex
5b99: 10 ea bpl @clrline
5b9b: 4c 46 a8 jmp start_vec ;continue in high memory
; Addresses for last 4 lines of text page 1. Note these are included in the 24
; lines of textlo/hi, so this is redundant.
5b9e: 50 textbotlo .dd1 $50
5b9f: d0 .dd1 $d0
5ba0: 50 .dd1 $50
5ba1: d0 .dd1 $d0
5ba2: 06 textbothi .dd1 $06
5ba3: 06 .dd1 $06
5ba4: 07 .dd1 $07
5ba5: 07 .dd1 $07
; 40*4 bytes (4 lines) of text for side 2 & press K/J msg etc.
5ba6: a0 a0 a0 a0+ side_2_msg .str ↑“ ”
5bab: a0 a0 c9 a0+ insert_side_2 .str ↑“ I N S E R T S I D E 2 ”
5bc8: a0 a0 a0 a0+ .str ↑“ PRESS 'K'”
+ “ FOR KEYBOARD GAME PRESS 'J' FOR JOYSTICK GAME ”
+ “ ”
; Addresses for the 24 lines on text page 1.
5c46: 00 80 00 80+ textlo .bulk 008000800080008028a828a828a828a8
5c56: 50 d0 50 d0+ .bulk 50d050d050d050d0
5c5e: 04 04 05 05+ texthi .bulk 04040505060607070404050506060707
5c6e: 04 04 05 05+ .bulk 0404050506060707
.org $f000
********************************************************************************
* The rest of this file is junk. There is some unused code, followed by source *
* code/variable names, which we've seen several times in other junk areas. *
* *
* We set org arbitrarily outside the $B200-$B5FF area, since we handle these *
* game storage areas in a project symbol file; otherwise this junk data would *
* take precedence in operands. *
********************************************************************************
f000: 00 85 af 85+ .junk 123
NOTE: Example variable names can be found in this junk area
f07b: 20 21 60 c9+ .junk 783