This commit is contained in:
Michael Steil 2008-10-07 09:18:22 +00:00
parent 9179ccde67
commit 3d5ff392b0
3 changed files with 68 additions and 10 deletions

5
TODO.txt Normal file
View File

@ -0,0 +1,5 @@
* split into files
* use linker magic to compile files separately
* use C enum for zero page
* convert messy init code into completely different
files without ifdefs (not much in common!)

View File

@ -217,6 +217,3 @@ MONRDKEY := GETIN
L0011 := $AA
LC392 := $AAAAA
LC71E := $AAAAA

View File

@ -571,7 +571,7 @@ L23D6:
sty HIGHDS+1 sty HIGHDS+1
jsr BLTU jsr BLTU
.ifdef CBM2 .ifdef CBM2
lda L0011 lda $11
ldy $12 ldy $12
sta $01FE sta $01FE
sty $01FF sty $01FF
@ -591,7 +591,7 @@ FIX_LINKS:
jsr SETPTRS jsr SETPTRS
.ifdef CBM2 .ifdef CBM2
jsr LC442 jsr LC442
jmp $AAAA; XXX LC392 jmp L2351
LC442: LC442:
.endif .endif
lda TXTTAB lda TXTTAB
@ -800,7 +800,11 @@ L24C1:
bne L246C bne L246C
sta ENDCHR sta ENDCHR
L24C8: L24C8:
.ifdef CBM2
lda $0200,x
.else
lda Z00,x lda Z00,x
.endif
beq L24AC beq L24AC
cmp ENDCHR cmp ENDCHR
beq L24AC beq L24AC
@ -818,7 +822,11 @@ L24DB:
bpl L24DB bpl L24DB
lda TOKEN_NAME_TABLE,y lda TOKEN_NAME_TABLE,y
bne L2498 bne L2498
.ifdef CBM2
lda $0200,x
.else
lda Z00,x lda Z00,x
.endif
bpl L24AA bpl L24AA
L24EA: L24EA:
sta INPUTBUFFER-3,y sta INPUTBUFFER-3,y
@ -6067,6 +6075,12 @@ COLD_START2:
lda #$38 lda #$38
sta Z18 sta Z18
.endif .endif
.ifdef CBM2
lda #$28
sta $0F
lda #$1E
sta $10
.endif
.ifdef OSI .ifdef OSI
ldx #GENERIC_CHRGET_END-GENERIC_CHRGET ldx #GENERIC_CHRGET_END-GENERIC_CHRGET
.else .else
@ -6077,25 +6091,37 @@ L4098:
sta STRNG2+1,x sta STRNG2+1,x
dex dex
bne L4098 bne L4098
.ifdef CBM2
lda #$03
sta DSCLEN
.endif
txa txa
sta SHIFTSIGNEXT sta SHIFTSIGNEXT
.ifdef CBM .ifdef CBM
sta Z03 sta Z03
.endif .endif
sta LASTPT+1 sta LASTPT+1
.ifndef CBM2
sta Z15 sta Z15
.endif
.ifndef CONFIG_2 .ifndef CONFIG_2
sta Z16 sta Z16
.endif .endif
pha pha
sta Z14 sta Z14
.ifdef CBM2
inx
stx $01FD
stx $01FC
.else
lda #$03 lda #$03
sta DSCLEN sta DSCLEN
.ifndef CONFIG_2 .ifndef KIM
lda #$2C lda #$2C
sta LINNUM+1 sta LINNUM+1
.endif .endif
jsr CRDO jsr CRDO
.endif
ldx #TEMPST ldx #TEMPST
stx TEMPPT stx TEMPPT
.ifndef CBM .ifndef CBM
@ -6111,20 +6137,33 @@ L4098:
tay tay
bne L40EE bne L40EE
.endif .endif
.ifndef CBM2
lda #<RAMSTART2 lda #<RAMSTART2
.endif
ldy #>RAMSTART2 ldy #>RAMSTART2
.ifdef CBM2
sta $28
sty $29
.endif
sta LINNUM sta LINNUM
sty LINNUM+1 sty LINNUM+1
.ifdef CBM2
tay
.else
ldy #$00 ldy #$00
.endif
L40D7: L40D7:
inc LINNUM inc LINNUM
bne L40DD bne L40DD
inc LINNUM+1 inc LINNUM+1
.ifdef CBM .ifdef CBM1
lda $09 lda $09
cmp #$80 cmp #$80
beq L40FA beq L40FA
.endif .endif
.ifdef CBM2
bmi L40FA
.endif
L40DD: L40DD:
lda #$92 lda #$92
sta (LINNUM),y sta (LINNUM),y
@ -6140,7 +6179,7 @@ L40DD:
beq L40D7 beq L40D7
bne L40FA bne L40FA
.endif .endif
.ifdef CONFIG_2 .ifdef KIM
bne L40FA bne L40FA
beq L40D7 beq L40D7
.endif .endif
@ -6233,13 +6272,21 @@ L4183:
tya tya
sta (TXTTAB),y sta (TXTTAB),y
inc TXTTAB inc TXTTAB
.ifndef CBM2
bne L4192 bne L4192
inc TXTTAB+1 inc TXTTAB+1
L4192: L4192:
.endif
lda TXTTAB lda TXTTAB
ldy TXTTAB+1 ldy TXTTAB+1
jsr REASON jsr REASON
.ifdef CBM2
lda #<QT_BASIC
ldy #>QT_BASIC
jsr STROUT
.else
jsr CRDO jsr CRDO
.endif
lda MEMSIZ lda MEMSIZ
sec sec
sbc TXTTAB sbc TXTTAB
@ -6293,6 +6340,10 @@ QT_BYTES_FREE:
.ifndef CBM .ifndef CBM
.byte $0D,$0A,$0D,$0A .byte $0D,$0A,$0D,$0A
.endif .endif
.ifdef CBM2
.byte $0D,$00
.endif
QT_BASIC:
.ifdef OSI .ifdef OSI
.byte "OSI 6502 BASIC VERSION 1.0 REV " .byte "OSI 6502 BASIC VERSION 1.0 REV "
.byte "3.2" .byte "3.2"
@ -6300,11 +6351,16 @@ QT_BYTES_FREE:
.ifdef KIM .ifdef KIM
.byte "MOS TECH 6502 BASIC V1.1" .byte "MOS TECH 6502 BASIC V1.1"
.endif .endif
.ifdef CBM .ifdef CBM1
.byte $13 .byte $13
.byte "*** COMMODORE BASIC ***" .byte "*** COMMODORE BASIC ***"
.byte $11,$11,$11,$00 .byte $11,$11,$11,$00
.else .endif
.ifdef CBM2
.byte "### COMMODORE BASIC ###"
.byte $0D,$0D,$00
.endif
.ifndef CBM
.byte $0D,$0A .byte $0D,$0A
.byte "COPYRIGHT 1977 BY MICROSOFT CO." .byte "COPYRIGHT 1977 BY MICROSOFT CO."
.byte $0D,$0A,$00 .byte $0D,$0A,$00