;For Subroutine AddressL = $02 ;Txt Start Address low byte AddressH = $03 ;Txt Start Address high byte PrintLook = $04 ;$00 if a new description is required ;Adventure Values RoomPos = $10;Your Position in the game Room1DoorState = $11 ;Door 1 open = $FF, closed = $00 KeyState = $12 ;Key in Inventory ? TorchState = $13 ;Torch in inventory ? DaggerState = $14 ;Dagger in Inventory ? Room5State = $15 ;LIGHT in Room5 ? Paralysis = $16 ;Paralysis State ;******** Text Buffers ********* BUF = $0200 ;$200-$27F ;*** Compare user BUF and txt address *** ;param BUF user buffer starting address ;param AddressL, AddressH from a txt address ;EOF charactere for txt is % = 0x25 ;return Accumulator with 0x00 if false, 0xFF if true COMPARE: LDY #$FF ;reset index COMPIT: INY LDA (AddressL),Y ;load charac CMP #$25 ;EOF ? BEQ COMPTRUE ;Yes, branch to true ADC #$7F ;Add Bit7 to compare kbd output CMP BUF,Y ;Compare with user buffer BEQ COMPIT ;Ok,continue comparison LDA #$00 ;Result false RTS COMPTRUE: LDA #$FF ;Result true RTS