Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 560815e

Browse files
committed
microtan work
1 parent 8334c8b commit 560815e

21 files changed

Lines changed: 187 additions & 56 deletions

NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ Commodore BASIC 1 1977 Y Y CBM
33
OSI BASIC 1977 1.0 REV 3.2 Y N -
44
AppleSoft I 1977 1.1 N Y Apple CONFIG_11
55
KIM BASIC 1977 1.1 N Y - CONFIG_11A
6-
Commodore BASIC 2 1979 Y Y CBM
6+
Commodore BASIC 2 1979 Y Y CBM CONFIG_2
77
KBD BASIC 1980 Y N KBD

array.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ NEG32768:
2828
; ----------------------------------------------------------------------------
2929
MAKINT:
3030
jsr CHRGET
31-
.ifdef CBM2_KBD
31+
.ifdef CONFIG_2
3232
jsr FRMEVL
3333
.else
3434
jsr FRMNUM
@@ -39,7 +39,7 @@ MAKINT:
3939
; MUST BE POSITIVE AND LESS THAN 32768
4040
; ----------------------------------------------------------------------------
4141
MKINT:
42-
.ifdef CBM2_KBD
42+
.ifdef CONFIG_2
4343
jsr CHKNUM
4444
.endif
4545
lda FACSIGN

defines.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ CBM2 := 1
1616
.elseif .def(kbdbasic)
1717
KBD := 1
1818
.include "defines_kbd.s"
19+
.elseif .def(microtan)
20+
MICROTAN := 1
21+
.include "defines_microtan.s"
1922
.endif
2023

2124
.ifdef CONFIG_SMALL

defines_cbm.s

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ CONFIG_INPUTBUFFER_ORDER := 1 ; ldx/ldy or ldy/ldx
1313
CONFIG_CBM_ALL := 1
1414
CONFIG_11 := 1
1515
CONFIG_11A := 1
16+
CONFIG_2 := 1
1617
CBM2_KBD := 1
18+
CBM2_MICROTAN := 1
1719
CBM2_KIM := 1
1820
CBM2_APPLE := 1
1921
CBM2_KIM_APPLE := 1 ; OUTDO difference
@@ -25,6 +27,7 @@ CONFIG_DATAFLAG := 1
2527
; common:
2628
CONFIG_FILE := 1; support PRINT#, INPUT#, GET#, CMD
2729
CONFIG_NO_CR := 1; terminal doesn't need explicit CRs on line ends
30+
CONFIG_NO_LINE_EDITING := 1; support for "@", "_", BEL etc.
2831

2932
CRLF_1 := $0D
3033
CRLF_2 := $0A
@@ -94,6 +97,7 @@ Z18 := $0007
9497
GOGIVEAYF := $0008
9598
Z03 := $000E;3 ; same
9699
LINNUM := $0011;0008
100+
97101
Z96 := $00E8-82
98102
POSX := $0118-82
99103
TXPSV = LASTOP

defines_kbd.s

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
CONFIG_SCRTCH_ORDER := 1
22
CONFIG_SMALL := 1
3+
CONFIG_2 := 1
34
CBM2_KBD := 1
45
KIM_KBD := 1
56
CONFIG_11 := 1

defines_microtan.s

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
KIM_KBD := 1
2+
CONFIG_11 := 1
3+
CONFIG_11A := 1
4+
CONFIG_SAFE_NAMENOTFOUND := 1
5+
CBM2_KIM_APPLE := 1 ; OUTDO difference
6+
KIM_APPLE := 1
7+
CBM2_MICROTAN := 1
8+
9+
CONFIG_2 := 1
10+
11+
CONFIG_NULL := 1
12+
CONFIG_PRINT_CR := 1 ; print CR when line end reached
13+
14+
CRLF_1 := $0D
15+
CRLF_2 := $0A
16+
17+
ZP_START = $85
18+
19+
JMPADRS = DSCLEN + 1
20+
LOWTRX = LOWTR
21+
22+
Z00 := $0000
23+
L0001 := $0001
24+
L0002 := $0002
25+
GOWARM := $0003
26+
GOSTROUT := $0006
27+
GOGIVEAYF := $0008
28+
29+
CHARAC := $000A+$1A
30+
ENDCHR := $000B+$1A
31+
EOLPNTR := $000C+$1A
32+
DIMFLG := $000D+$1A
33+
VALTYP := $000E+$1A
34+
DATAFLG := $0010+$1A
35+
SUBFLG := $0011+$1A
36+
INPUTFLG := $0012+$1A
37+
CPRMASK := $0013+$1A
38+
Z14 := $0014+$1A ; Ctrl+O flag
39+
Z15 := $0015+$1A
40+
POSX := $0016+$1A
41+
Z17 := $0017+$1A
42+
Z18 := $0018+$1A
43+
LINNUM := $0019+$1A
44+
TXPSV := $0019+$1A
45+
INPUTBUFFER := $001B+$1A
46+
INPUTBUFFERX := $0000
47+
48+
L1800 := $1800
49+
L1873 := $1873
50+
MONRDKEY := $1E5A
51+
MONCOUT := $1EA0
52+
53+
STACK_TOP := $FE
54+
SPACE_FOR_GOSUB := $3E
55+
NULL_MAX := $F2 ; probably different in original version; the image I have seems to be modified; see PDF
56+
57+
58+
RAMSTART2 := $AAAA
59+
USR := $AAAA
60+
SAVE := $AAAA
61+
LOAD := $AAAA
62+
LE21C := $AAAA

eval.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ GERR:
1919
beq JERROR
2020
NEXT3:
2121
txs
22-
.ifndef CBM2_KBD
22+
.ifndef CONFIG_2
2323
inx
2424
inx
2525
inx
2626
inx
2727
.endif
2828
txa
29-
.ifdef CBM2_KBD
29+
.ifdef CONFIG_2
3030
clc
3131
adc #$04
3232
pha

float.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,7 @@ DECTBL_END:
16831683
.byte $FF,$FF,$FD,$A8
16841684
.byte $00,$00,$00,$3C
16851685
.endif
1686-
.ifdef CBM2_KBD
1686+
.ifdef CONFIG_2
16871687
C_ZERO = CON_HALF + 2
16881688
.endif
16891689

flow.s

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ NEWSTT:
8282
jsr ISCNTC
8383
lda TXTPTR
8484
ldy TXTPTR+1
85-
.ifdef CBM2_KBD
85+
.ifdef CONFIG_2
8686
cpy #>INPUTBUFFER
8787
.endif
8888
.ifdef CBM2
8989
nop
9090
.endif
91-
.ifdef CBM2_KBD
91+
.ifdef CONFIG_2
9292
beq LC6D4
9393
.else
9494
beq L2683
@@ -112,7 +112,7 @@ LA5DC:
112112
ldy #$02
113113
lda (TXTPTR),y
114114
clc
115-
.ifdef CBM2_KBD
115+
.ifdef CONFIG_2
116116
jeq L2701
117117
.else
118118
beq L2701
@@ -156,7 +156,7 @@ EXECUTE_STATEMENT1:
156156
bcc LET1
157157
.endif
158158
cmp #NUM_TOKENS
159-
.ifdef CBM2_KBD
159+
.ifdef CONFIG_2
160160
bcs LC721
161161
.else
162162
bcs SYNERR1
@@ -177,7 +177,7 @@ COLON:
177177
SYNERR1:
178178
jmp SYNERR
179179
.endif
180-
.ifdef CBM2_KBD
180+
.ifdef CONFIG_2
181181
LC721:
182182
.ifdef KBD
183183
cmp #$45
@@ -267,7 +267,7 @@ END2:
267267
bne RET1
268268
lda TXTPTR
269269
ldy TXTPTR+1
270-
.ifdef CBM2_KBD
270+
.ifdef CONFIG_2
271271
ldx CURLIN+1
272272
inx
273273
.endif
@@ -444,7 +444,7 @@ L281E:
444444
POP:
445445
bne L281E
446446
lda #$FF
447-
.ifdef CBM2_KBD
447+
.ifdef CONFIG_2
448448
sta FORPNT+1 ; bugfix, wrong in AppleSoft
449449
.else
450450
sta FORPNT

init.s

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ COLD_START2:
9595
.endif
9696
sta Z18
9797
.endif
98-
.ifdef CBM2_KBD
98+
.ifdef CONFIG_2
9999
lda #$28
100100
sta $0F
101101
lda #$1E
@@ -116,7 +116,7 @@ L4098:
116116
sta STRNG2+1,x
117117
dex
118118
bne L4098
119-
.ifdef CBM2_KBD
119+
.ifdef CONFIG_2
120120
lda #$03
121121
sta DSCLEN
122122
.endif
@@ -135,7 +135,7 @@ L4098:
135135
.endif
136136
pha
137137
sta Z14
138-
.ifdef CBM2_KBD
138+
.ifdef CONFIG_2
139139
inx
140140
stx $01FD
141141
stx $01FC
@@ -172,17 +172,17 @@ L4098:
172172
tay
173173
bne L40EE
174174
.endif
175-
.ifndef CBM2_KBD
175+
.ifndef CONFIG_2
176176
lda #<RAMSTART2
177177
.endif
178178
ldy #>RAMSTART2
179-
.ifdef CBM2_KBD
179+
.ifdef CONFIG_2
180180
sta $28
181181
sty $29
182182
.endif
183183
sta LINNUM
184184
sty LINNUM+1
185-
.ifdef CBM2_KBD
185+
.ifdef CONFIG_2
186186
tay
187187
.else
188188
ldy #$00
@@ -196,11 +196,11 @@ L40D7:
196196
cmp #$80
197197
beq L40FA
198198
.endif
199-
.ifdef CBM2_KBD
199+
.ifdef CONFIG_2
200200
bmi L40FA
201201
.endif
202202
L40DD:
203-
.ifdef CBM2_KBD
203+
.ifdef CONFIG_2
204204
lda #$55
205205
.else
206206
lda #$92
@@ -317,15 +317,15 @@ L4183:
317317
tya
318318
sta (TXTTAB),y
319319
inc TXTTAB
320-
.ifndef CBM2_KBD
320+
.ifndef CONFIG_2
321321
bne L4192
322322
inc TXTTAB+1
323323
L4192:
324324
.endif
325325
lda TXTTAB
326326
ldy TXTTAB+1
327327
jsr REASON
328-
.ifdef CBM2_KBD
328+
.ifdef CONFIG_2
329329
lda #<QT_BASIC
330330
ldy #>QT_BASIC
331331
jsr STROUT
@@ -392,7 +392,7 @@ QT_BYTES_FREE:
392392
.ifndef CBM_APPLE
393393
.byte $0D,$0A,$0D,$0A
394394
.endif
395-
.ifdef CBM2_KBD
395+
.ifdef CONFIG_2
396396
.byte $0D,$00
397397
.endif
398398
.ifdef APPLE

0 commit comments

Comments
 (0)