From 281d93018b5ba784cb1fdf6679b4f21dc97fbf5d Mon Sep 17 00:00:00 2001 From: Michael Steil Date: Mon, 13 Oct 2008 10:18:55 +0000 Subject: [PATCH] cleanup --- defines_apple.s | 2 +- defines_cbm.s | 3 ++- msbasic.s | 2 -- poke.s | 2 ++ print.s | 66 +++++++++++++++++++++++++------------------------ 5 files changed, 39 insertions(+), 36 deletions(-) diff --git a/defines_apple.s b/defines_apple.s index 3e73a7f..ab5ae1d 100644 --- a/defines_apple.s +++ b/defines_apple.s @@ -7,7 +7,7 @@ CBM_APPLE := 1 KIM_APPLE := 1 CONFIG_SCRTCH_ORDER := 1 CONFIG_PRINT_CR := 1 ; print CR when line end reached -CONFIG_IO_MSB := 1 ; IO is 7 bit, MSB may be randomly set +CONFIG_IO_MSB := 1 ; all I/O has bit #7 set ; INPUTBUFFER > $0100 CRLF_1 := $0D diff --git a/defines_cbm.s b/defines_cbm.s index 6fc8665..6ec7664 100644 --- a/defines_cbm.s +++ b/defines_cbm.s @@ -6,6 +6,7 @@ CBM_APPLE := 1 CONFIG_DATAFLAG := 1 CONFIG_BUG_GET_ERROR := 1; treat GET error like READ error CONFIG_PRINTNULLS := 1; whether PRINTNULLS does anything +CONFIG_SPC_IS_CRSR_RIGHT := 1; always print CRSR RIGHT for SPC() (otherwise only for screen output) ; minor: just code order CONFIG_INPUTBUFFER_ORDER := 1 ; ldx/ldy or ldy/ldx .else @@ -45,7 +46,7 @@ GOSTROUT := $0006 GOGIVEAYF := $0008 Z15 := $0004 -POSX := $0005 +POSX := $0005 Z17 := $0006 Z18 := $0007 LINNUM := $0008 diff --git a/msbasic.s b/msbasic.s index d4075e0..d0060bd 100644 --- a/msbasic.s +++ b/msbasic.s @@ -25,9 +25,7 @@ .include "misc2.s" .include "string.s" .include "misc3.s" -.ifndef KBD .include "poke.s" -.endif .include "float.s" .include "chrget.s" .include "rnd.s" diff --git a/poke.s b/poke.s index 0a54840..d4ebd4d 100644 --- a/poke.s +++ b/poke.s @@ -1,5 +1,6 @@ .segment "CODE" +.ifndef KBD ; ---------------------------------------------------------------------------- ; "PEEK" FUNCTION ; ---------------------------------------------------------------------------- @@ -74,3 +75,4 @@ L362C: beq L362C RTS3: rts +.endif /* KBD */ diff --git a/print.s b/print.s index b013f3c..8a86469 100644 --- a/print.s +++ b/print.s @@ -184,31 +184,29 @@ L29F5: .endif jsr GTBYTC cmp #')' -.ifndef CONFIG_11A -.ifdef APPLE +.ifdef CONFIG_11A + .ifdef CBM2_KBD + bne SYNERR4 + .else + jne SYNERR + .endif + plp + bcc L2A09 +.else + .ifdef APPLE beq L1185 jmp SYNERR L1185: -.else + .else bne SYNERR4 -.endif + .endif pla cmp #TOKEN_TAB -.ifdef APPLE + .ifdef APPLE bne L2A09 -.else + .else bne L2A0A -.endif -.else -.ifdef CBM2_KBD - bne SYNERR4 -.else - beq @1 - jmp SYNERR -@1: -.endif - plp ;; XXX c64 has this - bcc L2A09 + .endif .endif txa sbc POSX @@ -267,15 +265,15 @@ L2A22: jmp L2A22 ; ---------------------------------------------------------------------------- OUTSP: -.ifdef CBM2 - lda $0E +.ifdef CONFIG_FILE + .ifndef CONFIG_SPC_IS_CRSR_RIGHT + lda Z03 beq LCA40 lda #$20 .byte $2C LCA40: -.endif -.ifdef CONFIG_CBM_ALL - lda #$1D + .endif + lda #$1D ; CRSR RIGHT .else lda #$20 .endif @@ -295,18 +293,18 @@ OUTDO: pha .endif .ifdef CBM1 - cmp #$1D + cmp #$1D ; CRSR RIGHT beq LCA6A - cmp #$9D + cmp #$9D ; CRSR LEFT beq LCA5A - cmp #$14 + cmp #$14 ; DEL bne LCA64 LCA5A: - lda $05 + lda POSX beq L2A4E lda Z03 bne L2A4E - dec $05 + dec POSX LCA64: and #$7F .endif @@ -324,13 +322,13 @@ LCA6A: lda POSX cmp Z17 bne L2A4C -.ifdef APPLE + .ifdef APPLE nop ; PATCH! nop ; don't print CR nop -.else + .else jsr CRDO -.endif + .endif L2A4C: .endif .ifndef CONFIG_CBM_ALL @@ -343,11 +341,11 @@ L2A4E: .ifdef KIM sty DIMFLG .endif -.ifdef APPLE +.ifdef CONFIG_IO_MSB ora #$80 .endif jsr MONCOUT -.ifdef APPLE +.ifdef CONFIG_IO_MSB and #$7F .endif .ifdef KIM @@ -363,6 +361,10 @@ L2A56: and #$FF LE8F2: rts + +; ---------------------------------------------------------------------------- +; ??? +; ---------------------------------------------------------------------------- .ifdef KBD LE8F3: pha