mirror of
https://github.com/mist64/msbasic.git
synced 2024-06-11 00:29:31 +00:00
cleanup
This commit is contained in:
parent
3c270eded7
commit
ecdc58ddbb
|
@ -7,6 +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
|
||||
; INPUTBUFFER > $0100
|
||||
|
||||
ZP_START = $55
|
||||
|
|
|
@ -5,6 +5,9 @@ CBM1_APPLE := 1
|
|||
CBM_APPLE := 1
|
||||
CONFIG_DATAFLAG := 1
|
||||
CONFIG_BUG_GET_ERROR := 1; treat GET error like READ error
|
||||
CONFIG_PRINTNULLS := 1; whether PRINTNULLS does anything
|
||||
; minor: just code order
|
||||
CONFIG_INPUTBUFFER_ORDER := 1 ; ldx/ldy or ldy/ldx
|
||||
.else
|
||||
CONFIG_CBM_ALL := 1
|
||||
CONFIG_11 := 1
|
||||
|
@ -20,7 +23,7 @@ CONFIG_DATAFLAG := 1
|
|||
|
||||
; common:
|
||||
CONFIG_FILE := 1; support PRINT#, INPUT#, GET#, CMD
|
||||
|
||||
CONFIG_NO_CR := 1; terminal doesn't need explicit CRs on line ends
|
||||
|
||||
.ifdef CBM1
|
||||
ZP_START = $65
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
CONFIG_SMALL := 1
|
||||
CONFIG_SCRTCH_ORDER := 1
|
||||
CONFIG_NULL := 1
|
||||
CONFIG_PRINT_CR := 1 ; print CR when line end reached
|
||||
CONFIG_DATAFLAG := 1
|
||||
|
||||
; minor: just code order
|
||||
CONFIG_SCRTCH_ORDER := 1
|
||||
|
||||
ZP_START = $65
|
||||
|
||||
JMPADRS = DSCLEN + 1
|
||||
|
|
2
init.s
2
init.s
|
@ -125,7 +125,7 @@ L4098:
|
|||
sta Z03
|
||||
.endif
|
||||
sta LASTPT+1
|
||||
.if .defined(CONFIG_NULL) || .defined(CBM1)
|
||||
.if .defined(CONFIG_NULL) || .defined(CONFIG_PRINTNULLS)
|
||||
sta Z15
|
||||
.endif
|
||||
.ifndef CONFIG_11
|
||||
|
|
69
input.s
69
input.s
|
@ -29,7 +29,7 @@ L2A67:
|
|||
SYNERR4:
|
||||
jmp SYNERR
|
||||
RESPERR:
|
||||
.ifdef CONFIG_CBM_ALL
|
||||
.ifdef CONFIG_FILE
|
||||
lda Z03
|
||||
beq LCA8F
|
||||
ldx #ERR_BADDATA
|
||||
|
@ -43,7 +43,7 @@ LCA8F:
|
|||
ldy OLDTEXT+1
|
||||
sta TXTPTR
|
||||
sty TXTPTR+1
|
||||
LE920:
|
||||
RTS20:
|
||||
rts
|
||||
|
||||
; ----------------------------------------------------------------------------
|
||||
|
@ -128,10 +128,8 @@ LCAF8:
|
|||
.endif
|
||||
.ifdef KBD
|
||||
bmi L2ABE
|
||||
.endif
|
||||
|
||||
.ifndef KBD
|
||||
.ifdef CONFIG_FILE
|
||||
.else
|
||||
.ifdef CONFIG_FILE
|
||||
lda Z03
|
||||
beq LCB0C
|
||||
lda Z96
|
||||
|
@ -140,38 +138,41 @@ LCAF8:
|
|||
jsr LCAD6
|
||||
jmp DATA
|
||||
LCB0C:
|
||||
.endif
|
||||
.endif
|
||||
lda INPUTBUFFER
|
||||
bne L2ABE
|
||||
.ifdef CONFIG_FILE
|
||||
.ifdef CONFIG_FILE
|
||||
lda Z03
|
||||
bne LCAF8
|
||||
.endif
|
||||
.ifdef CONFIG_CBM1_PATCHES
|
||||
.endif
|
||||
.ifdef CONFIG_CBM1_PATCHES
|
||||
jmp PATCH1
|
||||
.else
|
||||
.else
|
||||
clc
|
||||
jmp CONTROL_C_TYPED
|
||||
.endif
|
||||
.endif
|
||||
.endif
|
||||
|
||||
NXIN:
|
||||
.ifdef KBD
|
||||
jsr LFDDA
|
||||
bmi LE920
|
||||
bmi RTS20
|
||||
pla
|
||||
jmp LE86C
|
||||
.endif
|
||||
.ifndef KBD
|
||||
.ifdef CONFIG_FILE
|
||||
.else
|
||||
.ifdef CONFIG_FILE
|
||||
lda Z03
|
||||
bne LCB21
|
||||
.endif
|
||||
jsr OUTQUES
|
||||
.endif
|
||||
jsr OUTQUES ; '?'
|
||||
jsr OUTSP
|
||||
LCB21:
|
||||
jmp INLIN
|
||||
.endif /* KBD */
|
||||
.endif
|
||||
|
||||
; ----------------------------------------------------------------------------
|
||||
; "GETC" STATEMENT
|
||||
; ----------------------------------------------------------------------------
|
||||
.ifdef KBD
|
||||
GETC:
|
||||
jsr CONINT
|
||||
|
@ -223,25 +224,25 @@ PROCESS_INPUT_ITEM:
|
|||
jsr CHRGOT
|
||||
bne INSTART
|
||||
bit INPUTFLG
|
||||
.ifndef CONFIG_SMALL
|
||||
.ifndef CONFIG_SMALL ; GET
|
||||
bvc L2AF0
|
||||
jsr MONRDKEY
|
||||
.ifdef APPLE
|
||||
.ifdef CONFIG_IO_MSB
|
||||
and #$7F
|
||||
.endif
|
||||
.endif
|
||||
sta INPUTBUFFER
|
||||
.ifdef CBM1
|
||||
.ifdef CONFIG_INPUTBUFFER_ORDER
|
||||
ldy #>(INPUTBUFFER-1)
|
||||
ldx #<(INPUTBUFFER-1)
|
||||
.else
|
||||
.else
|
||||
ldx #<(INPUTBUFFER-1)
|
||||
ldy #>(INPUTBUFFER-1)
|
||||
.endif
|
||||
.endif
|
||||
bne L2AF8
|
||||
L2AF0:
|
||||
.endif
|
||||
bmi FINDATA
|
||||
.ifdef CONFIG_CBM_ALL
|
||||
.ifdef CONFIG_FILE
|
||||
lda Z03
|
||||
bne LCB64
|
||||
.endif
|
||||
|
@ -261,20 +262,20 @@ INSTART:
|
|||
jsr CHRGET
|
||||
bit VALTYP
|
||||
bpl L2B34
|
||||
.ifndef CONFIG_SMALL
|
||||
.ifndef CONFIG_SMALL ; GET
|
||||
bit INPUTFLG
|
||||
bvc L2B10
|
||||
.ifdef CONFIG_CBM1_PATCHES
|
||||
.ifdef CONFIG_CBM1_PATCHES
|
||||
lda #$00
|
||||
jsr PATCH4
|
||||
nop
|
||||
.else
|
||||
.else
|
||||
inx
|
||||
stx TXTPTR
|
||||
lda #$00
|
||||
sta CHARAC
|
||||
beq L2B1C
|
||||
.endif
|
||||
.endif
|
||||
L2B10:
|
||||
.endif
|
||||
sta CHARAC
|
||||
|
@ -359,17 +360,17 @@ INPDONE:
|
|||
lda INPTR
|
||||
ldy INPTR+1
|
||||
ldx INPUTFLG
|
||||
.ifdef OSI
|
||||
beq L2B94
|
||||
.ifdef OSI ; CONFIG_SMALL && !CONFIG_11
|
||||
beq L2B94 ; INPUT
|
||||
.else
|
||||
bpl L2B94
|
||||
bpl L2B94; INPUT or GET
|
||||
.endif
|
||||
jmp SETDA
|
||||
L2B94:
|
||||
ldy #$00
|
||||
lda (INPTR),y
|
||||
beq L2BA1
|
||||
.ifdef CONFIG_CBM_ALL
|
||||
.ifdef CONFIG_FILE
|
||||
lda Z03
|
||||
bne L2BA1
|
||||
.endif
|
||||
|
|
62
print.s
62
print.s
|
@ -16,10 +16,12 @@ PRINT2:
|
|||
beq L29F5
|
||||
cmp #TOKEN_SPC
|
||||
.ifdef CBM2_KBD
|
||||
clc
|
||||
clc ; also AppleSoft II
|
||||
.endif
|
||||
beq L29F5
|
||||
cmp #','
|
||||
; Pre-KIM had no CLC. KIM added the CLC
|
||||
; here. Post-KIM moved the CLC up...
|
||||
.ifdef KIM
|
||||
clc
|
||||
.endif
|
||||
|
@ -31,16 +33,16 @@ PRINT2:
|
|||
bmi PRSTRING
|
||||
jsr FOUT
|
||||
jsr STRLIT
|
||||
.ifndef CONFIG_CBM_ALL
|
||||
.ifndef CONFIG_NO_CR
|
||||
ldy #$00
|
||||
lda (FAC_LAST-1),y
|
||||
clc
|
||||
adc Z16
|
||||
.ifdef KBD
|
||||
.ifdef KBD
|
||||
cmp #$28
|
||||
.else
|
||||
.else
|
||||
cmp Z17
|
||||
.endif
|
||||
.endif
|
||||
bcc L29B1
|
||||
jsr CRDO
|
||||
L29B1:
|
||||
|
@ -48,6 +50,8 @@ L29B1:
|
|||
jsr STRPRT
|
||||
.ifdef KBD
|
||||
jmp L297E
|
||||
|
||||
; PATCHES
|
||||
LE86C:
|
||||
pla
|
||||
jmp CONTROL_C_TYPED
|
||||
|
@ -74,47 +78,53 @@ PRINTNULLS:
|
|||
jsr OUTSP
|
||||
bne L297E
|
||||
L29B9:
|
||||
.ifdef CBM2
|
||||
.ifdef CBM2
|
||||
lda #$00
|
||||
sta INPUTBUFFER,x
|
||||
ldx #<(INPUTBUFFER-1)
|
||||
ldy #>(INPUTBUFFER-1)
|
||||
.else
|
||||
.ifndef APPLE
|
||||
.else
|
||||
.ifndef APPLE
|
||||
ldy #$00
|
||||
sty INPUTBUFFER,x
|
||||
ldx #LINNUM+1
|
||||
.endif
|
||||
.endif
|
||||
.ifdef CONFIG_CBM_ALL
|
||||
.endif
|
||||
.endif
|
||||
.ifdef CONFIG_CBM_ALL
|
||||
lda Z03
|
||||
bne L29DD
|
||||
LC9D2:
|
||||
.endif
|
||||
.endif
|
||||
CRDO:
|
||||
.ifdef CBM1
|
||||
.ifdef CBM1
|
||||
lda Z03
|
||||
bne LC9D8
|
||||
sta $05
|
||||
LC9D8:
|
||||
.endif
|
||||
.endif
|
||||
lda #$0D
|
||||
.ifndef CONFIG_CBM_ALL
|
||||
.ifndef CONFIG_CBM_ALL
|
||||
sta Z16
|
||||
.endif
|
||||
.endif
|
||||
jsr OUTDO
|
||||
.ifdef APPLE
|
||||
.ifdef APPLE
|
||||
lda #$80
|
||||
.else
|
||||
.else
|
||||
lda #$0A
|
||||
.endif
|
||||
.endif
|
||||
jsr OUTDO
|
||||
.endif
|
||||
.ifndef KBD
|
||||
PRINTNULLS:
|
||||
.ifdef CBM1
|
||||
.if .def(CONFIG_NULL) || .def(CONFIG_PRINTNULLS)
|
||||
.ifdef CONFIG_FILE
|
||||
; Although there is no statement for it,
|
||||
; CBM1 had NULL support and ignores
|
||||
; it when not targeting the screem,
|
||||
; CBM2 dropped it completely.
|
||||
lda Z03
|
||||
bne L29DD
|
||||
.endif
|
||||
.if .def(CONFIG_NULL) || .def(CBM1)
|
||||
.endif
|
||||
txa
|
||||
pha
|
||||
ldx Z15
|
||||
|
@ -128,13 +138,13 @@ L29D9:
|
|||
stx Z16
|
||||
pla
|
||||
tax
|
||||
.else
|
||||
.ifdef APPLE
|
||||
.else
|
||||
.ifdef APPLE
|
||||
lda #$00
|
||||
sta $50
|
||||
.endif
|
||||
.endif
|
||||
eor #$FF
|
||||
.endif
|
||||
.endif
|
||||
.endif
|
||||
L29DD:
|
||||
rts
|
||||
|
|
6
token.s
6
token.s
|
@ -4,7 +4,7 @@
|
|||
keyword_rts "FOR", FOR
|
||||
keyword_rts "NEXT", NEXT
|
||||
keyword_rts "DATA", DATA
|
||||
.ifdef CONFIG_CBM_ALL
|
||||
.ifdef CONFIG_FILE
|
||||
keyword_rts "INPUT#", INPUTH
|
||||
.endif
|
||||
keyword_rts "INPUT", INPUT
|
||||
|
@ -50,7 +50,7 @@
|
|||
.else
|
||||
keyword_rts "POKE", POKE
|
||||
.endif
|
||||
.ifdef CONFIG_CBM_ALL
|
||||
.ifdef CONFIG_FILE
|
||||
keyword_rts "PRINT#", PRINTH
|
||||
.endif
|
||||
keyword_rts "PRINT", PRINT, TOKEN_PRINT
|
||||
|
@ -61,7 +61,7 @@
|
|||
.else
|
||||
keyword_rts "CLEAR", CLEAR
|
||||
.endif
|
||||
.ifdef CONFIG_CBM_ALL
|
||||
.ifdef CONFIG_FILE
|
||||
keyword_rts "CMD", CMD
|
||||
keyword_rts "SYS", SYS
|
||||
keyword_rts "OPEN", OPEN
|
||||
|
|
Loading…
Reference in New Issue
Block a user