diff --git a/dos33.inc b/dos33.inc new file mode 100644 index 0000000..e297aeb --- /dev/null +++ b/dos33.inc @@ -0,0 +1,8 @@ + .word __MAIN ; 2 byte BLOAD address + .word __END - __MAIN ; 2 byte BLOAD size + .org __MAIN ; .org must come after header else offsets are wrong + +; Can't save filenames with * or - in them, hangs DOS3.3 +; SAVE * COPY FOO.BAS CON +; SAVE -- COPY FOO.BAS CON + diff --git a/hgrbyte.s b/hgrbyte.s new file mode 100644 index 0000000..c6ccdf6 --- /dev/null +++ b/hgrbyte.s @@ -0,0 +1,150 @@ + __MAIN = $08F4 + .include "dos33.inc" + +; HGR Byte Inspector +; Michael Pohoreski +; Version 1 - Barebones but it works +; +; Keys: +; +; ESC to Quit, else use arrow keys to move the cursor +; <- +; -> +; Up Arrow +; Down Arrow +; +; Can resume with 910G$ + + GBASL = $26 + GBASH = $27 + val = $F0 + col = $F1 + row = $E2 ; used by Applesoft HGR.row + HGRPAGE = $E6 ; used by Applesoft HGR.page + + CH = $24 ; text cursor column + CV = $25 ; text cursor row + + HPOSN = $F411 ; A=row, Y,X=col update GBASL GBASH + VTAB = $FC22 ; A=row + HOME = $FC58 + COUT = $FDED + PR_HEX = $FDD3 + PRBYTE = $FDDA + + KEYBOARD = $C000 + KEYSTROBE = $C010 + + .org $8F4 +HgrByteInspector: + JSR HOME + BIT $C050 + BIT $C053 + BIT $C057 + LDA #0 + STA val + STA col + STA row + STA GBASL + LDA #$20 + STA GBASH + STA HGRPAGE +Cursor: + LDY #0 ; Update pointer to sceeen + LDX #0 + LDA row + JSR HPOSN ; A=row, Y,X=col X->E0 Y->E1 +GetKey: + LDY col + LDA (GBASL),Y + STA val + JSR XorByte + LDA KEYBOARD + BPL GetKey + STA KEYSTROBE + LDX #nKeys-1 +FindKey: + CMP aKeys, X + BEQ GotKey + DEX + BPL FindKey +BadKey: + BMI Cursor +GotKey: + LDA #>GotKey + PHA + LDA Func, X + PHA +Done: RTS +MoveL: DEC col + BPL Cursor +MoveR: INC col + LDA col + CMP #40 + BCS MoveL + BCC Cursor +MoveU: DEC row + BPL Cursor +MoveD: INC row + LDA row + CMP #192 + BCS MoveU + BCC Cursor + +aKeys: + .byte $88 ; <- + .byte $95 ; -> + .byte $8B ; Up arrow + .byte $8A ; Down arrow + .byte $9B ; Esc +eKeys: +nKeys = eKeys - aKeys ; + +Func: + .byte