This commit is contained in:
Michael Steil 2008-10-16 07:42:48 +00:00
parent 1cb253d099
commit 166063e7fc
11 changed files with 56 additions and 50 deletions

View File

@ -1,4 +1,3 @@
* use linker magic to compile files separately
* convert messy init code into completely different
files without ifdefs (not much in common!)
* move all machine specific code into separate files

View File

@ -21,6 +21,8 @@ CBM2_APPLE := 1
CBM2_KIM_APPLE := 1 ; OUTDO difference
CBM_APPLE := 1
CONFIG_DATAFLAG := 1
CONFIG_EASTER_EGG := 1
; CONFIG_SMALL := 1 ; test :-)
; INPUTBUFFER > $0100
.endif

View File

@ -43,6 +43,9 @@ Z14 := $000F;64 ; Ctrl+O flag
JMPADRS := $0093;A1
LOWTRX := $0094;AA ; $AB also EXPSGN?
Z96 := $0096
L06FE := $06FE
L0207 := $0207
L020A := $020A

View File

@ -31,7 +31,7 @@ FSUBT:
; ----------------------------------------------------------------------------
; Commodore BASIC V2 Easter Egg
; ----------------------------------------------------------------------------
.ifdef CBM2
.ifdef CONFIG_EASTER_EGG
EASTER_EGG:
lda $11
cmp #<6502

View File

@ -155,7 +155,7 @@ LCB0C:
NXIN:
.ifdef KBD
jsr LFDDA
jsr INLIN
bmi RTS20
pla
jmp LE86C

View File

@ -26,23 +26,23 @@
OUTQUESSP:
jsr OUTQUES
jmp OUTSP
LFDDA:
INLIN:
ldy #$FF
LFDDC:
iny
LFDDD:
jsr LF43B
cmp #$03
jsr GETLN
cmp #$03 ; CTRL+C
beq LFDF7
cmp #$20
bcs LFDEC
bcs LFDEC ; no control char
sbc #$09
bne LFDDD
LFDEC:
sta INPUTBUFFER,y
tax
bne LFDDC
jsr LE882
jsr CRDO2
ldy #$06
LFDF7:
tax

View File

@ -210,7 +210,7 @@ L2963:
lda (DSCPTR),y
sta (FORPNT),y
rts
.ifdef CONFIG_CBM_ALL
.ifdef CONFIG_FILE
PRINTH:
jsr CMD
jmp LCAD6

View File

@ -27,7 +27,7 @@ LF43A:
rts
; ----------------------------------------------------------------------------
LF43B:
GETLN:
ldx #$5D
LF43D:
txa

2
poke.s
View File

@ -98,7 +98,7 @@ WAIT:
stx FORPNT
ldx #$00
jsr CHRGOT
.ifdef CBM2
.ifdef CONFIG_EASTER_EGG
beq EASTER_EGG
.else
beq L3628

View File

@ -87,7 +87,7 @@ L29B9:
ldx #LINNUM+1
.endif
.ifdef MICROTAN
bne LE882
bne CRDO2
.endif
.endif
.ifdef CONFIG_FILE
@ -109,7 +109,7 @@ LC9D8:
sta POSX
.endif
jsr OUTDO
LE882:
CRDO2:
lda #CRLF_2
jsr OUTDO

View File

@ -66,7 +66,7 @@ RESTART:
L2351X:
jsr OKPRT
L2351:
jsr LFDDA
jsr INLIN
LE28E:
bpl RESTART
.else
@ -85,6 +85,9 @@ L2351:
sty TXTPTR+1
jsr CHRGET
.ifdef CONFIG_11
; bug in pre-1.1: CHRGET sets Z on '\0'
; and ':' - a line starting with ':' in
; direct mode gets ignored
tax
.endif
.ifdef KBD
@ -109,42 +112,42 @@ NUMBERED_LINE:
jsr FNDLIN2
lda JMPADRS+1
sta LOWTR
sta $96
sta Z96
lda JMPADRS+2
sta LOWTR+1
sta $97
lda $13
sta $06FE
lda $14
sta $06FF
inc $13
sta Z96+1
lda LINNUM
sta L06FE
lda LINNUM+1
sta L06FE+1
inc LINNUM
bne LE2D2
inc $14
inc LINNUM+1
bne LE2D2
jmp SYNERR
LE2D2:
jsr LF457
ldx #$96
jsr LE4D4
ldx #Z96
jsr CMPJMPADRS
bcs LE2FD
LE2DC:
ldx #$00
lda (JMPADRS+1,x)
sta ($96,x)
sta (Z96,x)
inc JMPADRS+1
bne LE2E8
inc JMPADRS+2
LE2E8:
inc $96
inc Z96
bne LE2EE
inc $97
inc Z96+1
LE2EE:
ldx #$2B
jsr LE4D4
ldx #VARTAB
jsr CMPJMPADRS
bne LE2DC
lda $96
lda Z96
sta VARTAB
lda $97
lda Z96+1
sta VARTAB+1
LE2FD:
jsr SETPTRS
@ -356,8 +359,9 @@ L2423:
; ----------------------------------------------------------------------------
; READ A LINE, AND STRIP OFF SIGN BITS
; ----------------------------------------------------------------------------
.ifndef KBD
INLIN:
.ifdef APPLE
.ifdef APPLE
ldx #$DD
INLIN1:
stx $33
@ -371,11 +375,8 @@ L0C32:
ldx #<INPUTBUFFER-1
ldy #>INPUTBUFFER-1
rts
.endif
.endif
.ifndef KBD
.ifndef APPLE
ldx #$00
INLIN2:
@ -389,26 +390,26 @@ INLIN2:
.ifndef CONFIG_NO_LINE_EDITING
cmp #$20 ; line editing
bcc INLIN2
.ifdef MICROTAN
.ifdef MICROTAN
cmp #$80
.else
.else
cmp #$7D
.endif
.endif
bcs INLIN2
cmp #$40 ; @
beq L2423
.ifdef MICROTAN
.ifdef MICROTAN
cmp #$7F ; _
.else
.else
cmp #$5F ; _
.endif
.endif
beq L2420
L2443:
.ifdef MICROTAN
.ifdef MICROTAN
cpx #$4F
.else
.else
cpx #$47
.endif
.endif
bcs L244C
.endif
sta INPUTBUFFER,x
@ -631,8 +632,8 @@ LE444:
LE461:
jmp SYNERR
LE464:
stx $13
stx $14
stx LINNUM
stx LINNUM+1
.else
lda TXTTAB
ldx TXTTAB+1
@ -784,11 +785,12 @@ LE4C4:
adc #$08
sta $0504
rts
LE4D4:
lda $01,x
CMPJMPADRS:
lda 1,x
cmp JMPADRS+2
bne LE4DE
lda $00,x
lda 0,x
cmp JMPADRS+1
LE4DE:
rts