mirror of
https://github.com/mist64/msbasic.git
synced 2024-12-22 08:29:21 +00:00
cleanup
This commit is contained in:
parent
987db105cc
commit
3c64e1acab
3
TODO.txt
3
TODO.txt
@ -8,4 +8,5 @@
|
||||
* check all .ifdef OSI; they might be .ifdef CONFIG_SMALL
|
||||
* check for KBD whether it's CONFIG_2 && CONFIG_SMALL (float
|
||||
etc.)
|
||||
* there must be no platform ifdefs in generic files
|
||||
* there must be no platform ifdefs in generic files
|
||||
* reconstruct pre-CBM1, i.e. CBM1 without the patches
|
@ -1,6 +1,6 @@
|
||||
.if .def(cbmbasic1)
|
||||
CBM1 := 1
|
||||
.include "defines_cbm.s"
|
||||
.include "defines_cbm1.s"
|
||||
.elseif .def(osi)
|
||||
OSI := 1
|
||||
.include "defines_osi.s"
|
||||
@ -12,7 +12,7 @@ KIM := 1
|
||||
.include "defines_kim.s"
|
||||
.elseif .def(cbmbasic2)
|
||||
CBM2 := 1
|
||||
.include "defines_cbm.s"
|
||||
.include "defines_cbm2.s"
|
||||
.elseif .def(kbdbasic)
|
||||
KBD := 1
|
||||
.include "defines_kbd.s"
|
||||
|
81
defines_cbm1.s
Normal file
81
defines_cbm1.s
Normal file
@ -0,0 +1,81 @@
|
||||
; oldest known version, no CONFIG_n
|
||||
;CONFIG_CBM1_PATCHES := 1 ; ** don't turn off! **
|
||||
;CONFIG_CBM_ALL := 1
|
||||
;CONFIG_DATAFLG := 1
|
||||
;CONFIG_EASTER_EGG := 1
|
||||
;CONFIG_FILE := 1; support PRINT#, INPUT#, GET#, CMD
|
||||
;CONFIG_IO_MSB := 1 ; all I/O has bit #7 set
|
||||
;CONFIG_MONCOUT_DESTROYS_Y := 1
|
||||
;CONFIG_NO_CR := 1; terminal doesn't need explicit CRs on line ends
|
||||
;CONFIG_NO_LINE_EDITING := 1; support for "@", "_", BEL etc.
|
||||
;CONFIG_NO_POKE := 1
|
||||
;CONFIG_NO_READ_Y_IS_ZERO_HACK := 1
|
||||
;CONFIG_NULL := 1
|
||||
;CONFIG_PEEK_SAVE_LINNUM := 1
|
||||
;CONFIG_PRINTNULLS := 1; whether PRINTNULLS does anything
|
||||
;CONFIG_PRINT_CR := 1 ; print CR when line end reached
|
||||
;CONFIG_RAM := 1
|
||||
;CONFIG_ROR_WORKAROUND := 1
|
||||
;CONFIG_SAFE_NAMENOTFOUND := 1
|
||||
;CONFIG_SCRTCH_ORDER := 1
|
||||
;CONFIG_SCRTCH_ORDER := 2
|
||||
;CONFIG_SCRTCH_ORDER := 3
|
||||
;CONFIG_SMALL := 1
|
||||
;CONFIG_SPC_IS_CRSR_RIGHT := 1; always print CRSR RIGHT for SPC() (otherwise only for screen output)
|
||||
|
||||
; configuration
|
||||
; oldest known version, no CONFIG_n
|
||||
|
||||
CONFIG_CBM_ALL := 1
|
||||
|
||||
CONFIG_FILE := 1; support PRINT#, INPUT#, GET#, CMD
|
||||
CONFIG_NO_CR := 1; terminal doesn't need explicit CRs on line ends
|
||||
CONFIG_NO_LINE_EDITING := 1; support for "@", "_", BEL etc.
|
||||
CONFIG_SCRTCH_ORDER := 2
|
||||
|
||||
CONFIG_CBM1_PATCHES := 1 ; ** don't turn off! **
|
||||
CONFIG_DATAFLG := 1
|
||||
CONFIG_PRINTNULLS := 1; whether PRINTNULLS does anything
|
||||
CONFIG_SPC_IS_CRSR_RIGHT := 1; always print CRSR RIGHT for SPC() (otherwise only for screen output)
|
||||
|
||||
; zero page
|
||||
ZP_START0 = $00
|
||||
ZP_START0A = $04
|
||||
ZP_START1 = $5A
|
||||
ZP_START2 = $65
|
||||
|
||||
; extra ZP variables
|
||||
CURDVC := $0003
|
||||
Z96 := $020C
|
||||
USR := GORESTART
|
||||
|
||||
|
||||
; constants
|
||||
SPACE_FOR_GOSUB := $36
|
||||
STACK_TOP := $FC
|
||||
NULL_MAX := $0A
|
||||
MAX_EXPON := 12 ; XXX override
|
||||
|
||||
RAMSTART2 := $0400
|
||||
|
||||
; magic memory locations
|
||||
ENTROPY = $9044
|
||||
|
||||
; monitor functions
|
||||
OPEN := $FFC0
|
||||
CLOSE := $FFC3
|
||||
CHKIN := $FFC6
|
||||
CHKOUT := $FFC9
|
||||
CLRCH := $FFCC
|
||||
CHRIN := $FFCF
|
||||
CHROUT := $FFD2
|
||||
LOAD := $FFD5
|
||||
SAVE := $FFD8
|
||||
VERIFY := $FFDB
|
||||
SYS := $FFDE
|
||||
ISCNTC := $FFE1
|
||||
GETIN := $FFE4
|
||||
CLALL := $FFE7
|
||||
LE7F3 := $E7F3; for CBM1
|
||||
MONCOUT := CHROUT
|
||||
MONRDKEY := GETIN
|
@ -1,5 +1,4 @@
|
||||
; configuration
|
||||
; common:
|
||||
CONFIG_CBM_ALL := 1
|
||||
|
||||
CONFIG_FILE := 1; support PRINT#, INPUT#, GET#, CMD
|
||||
@ -7,34 +6,12 @@ CONFIG_NO_CR := 1; terminal doesn't need explicit CRs on line ends
|
||||
CONFIG_NO_LINE_EDITING := 1; support for "@", "_", BEL etc.
|
||||
CONFIG_SCRTCH_ORDER := 2
|
||||
|
||||
.ifdef CBM1
|
||||
CONFIG_BUG_GET_ERROR := 1; treat GET error like READ error
|
||||
CONFIG_CBM1_PATCHES := 1 ; ** don't turn off! **
|
||||
CONFIG_DATAFLAG := 1
|
||||
CONFIG_PRINTNULLS := 1; whether PRINTNULLS does anything
|
||||
CONFIG_SPC_IS_CRSR_RIGHT := 1; always print CRSR RIGHT for SPC() (otherwise only for screen output)
|
||||
.else
|
||||
CONFIG_2A := 1
|
||||
|
||||
CONFIG_DATAFLAG := 1
|
||||
CONFIG_DATAFLG := 1
|
||||
CONFIG_EASTER_EGG := 1
|
||||
CONFIG_NO_READ_Y_IS_ZERO_HACK := 1
|
||||
CONFIG_PEEK_SAVE_LINNUM := 1
|
||||
.endif
|
||||
|
||||
.ifdef CBM1
|
||||
; zero page
|
||||
ZP_START0 = $00
|
||||
ZP_START0A = $04
|
||||
ZP_START1 = $5A
|
||||
ZP_START2 = $65
|
||||
|
||||
; extra ZP variables
|
||||
Z03 := $0003
|
||||
Z96 := $020C
|
||||
USR := GORESTART
|
||||
|
||||
.else
|
||||
|
||||
; zero page
|
||||
ZP_START0 = $00
|
||||
@ -43,7 +20,7 @@ ZP_START1 = $03
|
||||
ZP_START2 = $13
|
||||
|
||||
; extra/override ZP variables
|
||||
Z03 := $000E
|
||||
CURDVC := $000E
|
||||
Z96 := $0096
|
||||
POSX := $00C6
|
||||
TXPSV := LASTOP
|
||||
@ -52,29 +29,16 @@ USR := GORESTART ; XXX
|
||||
; inputbuffer
|
||||
INPUTBUFFER := $0200
|
||||
|
||||
.endif
|
||||
|
||||
; constants
|
||||
.ifdef CBM1
|
||||
SPACE_FOR_GOSUB := $36
|
||||
STACK_TOP := $FC
|
||||
NULL_MAX := $0A
|
||||
MAX_EXPON := 12 ; XXX override
|
||||
.else
|
||||
SPACE_FOR_GOSUB := $3E
|
||||
STACK_TOP := $FA
|
||||
WIDTH := 40
|
||||
WIDTH2 := 30
|
||||
.endif
|
||||
|
||||
RAMSTART2 := $0400
|
||||
|
||||
; magic memory locations
|
||||
.ifdef CBM1
|
||||
ENTROPY = $9044
|
||||
.else
|
||||
ENTROPY = $E844
|
||||
.endif
|
||||
|
||||
; monitor functions
|
||||
OPEN := $FFC0
|
@ -1,7 +1,7 @@
|
||||
; configuration
|
||||
CONFIG_10A := 1
|
||||
|
||||
CONFIG_DATAFLAG := 1
|
||||
CONFIG_DATAFLG := 1
|
||||
CONFIG_NULL := 1
|
||||
CONFIG_PRINT_CR := 1 ; print CR when line end reached
|
||||
CONFIG_SCRTCH_ORDER := 3
|
||||
|
2
init.s
2
init.s
@ -120,7 +120,7 @@ L4098:
|
||||
txa
|
||||
sta SHIFTSIGNEXT
|
||||
.ifdef CONFIG_CBM_ALL
|
||||
sta Z03
|
||||
sta CURDVC
|
||||
.endif
|
||||
sta LASTPT+1
|
||||
.if .defined(CONFIG_NULL) || .defined(CONFIG_PRINTNULLS)
|
||||
|
2
inline.s
2
inline.s
@ -93,7 +93,7 @@ L2453:
|
||||
GETLN:
|
||||
.ifdef CONFIG_FILE
|
||||
jsr CHRIN
|
||||
ldy Z03
|
||||
ldy CURDVC
|
||||
bne L2465
|
||||
.else
|
||||
jsr MONRDKEY
|
||||
|
26
input.s
26
input.s
@ -9,7 +9,9 @@ INPUTERR:
|
||||
lda INPUTFLG
|
||||
beq RESPERR ; INPUT
|
||||
.ifndef CONFIG_SMALL
|
||||
.ifndef CONFIG_BUG_GET_ERROR
|
||||
.ifdef CONFIG_10A
|
||||
; without this, it treats GET errors
|
||||
; like READ errors
|
||||
bmi L2A63 ; READ
|
||||
ldy #$FF ; GET
|
||||
bne L2A67
|
||||
@ -30,7 +32,7 @@ SYNERR4:
|
||||
jmp SYNERR
|
||||
RESPERR:
|
||||
.ifdef CONFIG_FILE
|
||||
lda Z03
|
||||
lda CURDVC
|
||||
beq LCA8F
|
||||
ldx #ERR_BADDATA
|
||||
jmp ERROR
|
||||
@ -61,7 +63,7 @@ GET:
|
||||
lda #','
|
||||
jsr SYNCHR
|
||||
jsr CHKIN
|
||||
stx Z03
|
||||
stx CURDVC
|
||||
LCAB6:
|
||||
.endif
|
||||
ldx #<(INPUTBUFFER+1)
|
||||
@ -76,7 +78,7 @@ LCAB6:
|
||||
jsr PROCESS_INPUT_LIST
|
||||
; CBM: if GET#, then switch input back
|
||||
.ifdef CONFIG_FILE
|
||||
ldx Z03
|
||||
ldx CURDVC
|
||||
bne LCAD8
|
||||
.endif
|
||||
rts
|
||||
@ -91,14 +93,14 @@ INPUTH:
|
||||
lda #$2C
|
||||
jsr SYNCHR
|
||||
jsr CHKIN
|
||||
stx Z03
|
||||
stx CURDVC
|
||||
jsr L2A9E
|
||||
LCAD6:
|
||||
lda Z03
|
||||
lda CURDVC
|
||||
LCAD8:
|
||||
jsr CLRCH
|
||||
ldx #$00
|
||||
stx Z03
|
||||
stx CURDVC
|
||||
rts
|
||||
LCAE0:
|
||||
.endif
|
||||
@ -130,7 +132,7 @@ LCAF8:
|
||||
bmi L2ABE
|
||||
.else
|
||||
.ifdef CONFIG_FILE
|
||||
lda Z03
|
||||
lda CURDVC
|
||||
beq LCB0C
|
||||
lda Z96
|
||||
and #$02
|
||||
@ -142,7 +144,7 @@ LCB0C:
|
||||
lda INPUTBUFFER
|
||||
bne L2ABE
|
||||
.ifdef CONFIG_FILE
|
||||
lda Z03
|
||||
lda CURDVC
|
||||
bne LCAF8
|
||||
.endif
|
||||
.ifdef CONFIG_CBM1_PATCHES
|
||||
@ -161,7 +163,7 @@ NXIN:
|
||||
jmp LE86C
|
||||
.else
|
||||
.ifdef CONFIG_FILE
|
||||
lda Z03
|
||||
lda CURDVC
|
||||
bne LCB21
|
||||
.endif
|
||||
jsr OUTQUES ; '?'
|
||||
@ -265,7 +267,7 @@ L2AF0:
|
||||
.endif
|
||||
bmi FINDATA
|
||||
.ifdef CONFIG_FILE
|
||||
lda Z03
|
||||
lda CURDVC
|
||||
bne LCB64
|
||||
.endif
|
||||
.ifdef KBD
|
||||
@ -393,7 +395,7 @@ L2B94:
|
||||
lda (INPTR),y
|
||||
beq L2BA1
|
||||
.ifdef CONFIG_FILE
|
||||
lda Z03
|
||||
lda CURDVC
|
||||
bne L2BA1
|
||||
.endif
|
||||
lda #<ERREXTRA
|
||||
|
2
misc1.s
2
misc1.s
@ -222,7 +222,7 @@ CMD:
|
||||
LC98F:
|
||||
php
|
||||
jsr CHKOUT
|
||||
stx Z03
|
||||
stx CURDVC
|
||||
plp
|
||||
jmp PRINT
|
||||
.endif
|
||||
|
12
print.s
12
print.s
@ -91,7 +91,7 @@ L29B9:
|
||||
.endif
|
||||
.endif
|
||||
.ifdef CONFIG_FILE
|
||||
lda Z03
|
||||
lda CURDVC
|
||||
bne L29DD
|
||||
.endif
|
||||
.endif
|
||||
@ -99,7 +99,7 @@ L29B9:
|
||||
|
||||
CRDO:
|
||||
.if .def(CONFIG_PRINTNULLS) && .def(CONFIG_FILE)
|
||||
lda Z03
|
||||
lda CURDVC
|
||||
bne LC9D8
|
||||
sta $05
|
||||
LC9D8:
|
||||
@ -125,7 +125,7 @@ PRINTNULLS:
|
||||
; CBM1 had NULL support and ignores
|
||||
; it when not targeting the screen,
|
||||
; CBM2 dropped it completely.
|
||||
lda Z03
|
||||
lda CURDVC
|
||||
bne L29DD
|
||||
.endif
|
||||
txa
|
||||
@ -270,7 +270,7 @@ L2A22:
|
||||
OUTSP:
|
||||
.ifdef CONFIG_FILE
|
||||
.ifndef CONFIG_SPC_IS_CRSR_RIGHT
|
||||
lda Z03
|
||||
lda CURDVC
|
||||
beq LCA40
|
||||
lda #$20
|
||||
.byte $2C
|
||||
@ -306,7 +306,7 @@ OUTDO:
|
||||
LCA5A:
|
||||
lda POSX
|
||||
beq L2A4E
|
||||
lda Z03
|
||||
lda CURDVC
|
||||
bne L2A4E
|
||||
dec POSX
|
||||
LCA64:
|
||||
@ -318,7 +318,7 @@ LCA64:
|
||||
.endif
|
||||
LCA6A:
|
||||
.ifdef CONFIG_CBM1_PATCHES
|
||||
lda Z03
|
||||
lda CURDVC
|
||||
jsr PATCH6
|
||||
nop
|
||||
.endif
|
||||
|
10
program.s
10
program.s
@ -21,11 +21,11 @@ MEMERR:
|
||||
ERROR:
|
||||
lsr Z14
|
||||
.ifdef CONFIG_FILE
|
||||
lda Z03 ; output
|
||||
lda CURDVC ; output
|
||||
beq LC366 ; is screen
|
||||
jsr CLRCH ; otherwise redirect output back to screen
|
||||
lda #$00
|
||||
sta Z03
|
||||
sta CURDVC
|
||||
LC366:
|
||||
.endif
|
||||
jsr CRDO
|
||||
@ -695,7 +695,7 @@ L25A6:
|
||||
L25A6X:
|
||||
.endif
|
||||
ldy #$01
|
||||
.ifdef CONFIG_DATAFLAG
|
||||
.ifdef CONFIG_DATAFLG
|
||||
sty DATAFLG
|
||||
.endif
|
||||
lda (LOWTRX),y
|
||||
@ -730,7 +730,7 @@ L25CA:
|
||||
and #$7F
|
||||
L25CE:
|
||||
jsr OUTDO
|
||||
.ifdef CONFIG_DATAFLAG
|
||||
.ifdef CONFIG_DATAFLG
|
||||
cmp #$22
|
||||
bne LA519
|
||||
lda DATAFLG
|
||||
@ -760,7 +760,7 @@ L25E5:
|
||||
jmp RESTART
|
||||
L25E8:
|
||||
bpl L25CE
|
||||
.ifdef CONFIG_DATAFLAG
|
||||
.ifdef CONFIG_DATAFLG
|
||||
cmp #$FF
|
||||
beq L25CE
|
||||
bit DATAFLG
|
||||
|
Loading…
Reference in New Issue
Block a user