From 25c9858c47096ca30a93f733521fc842872ea42c Mon Sep 17 00:00:00 2001 From: Michael Steil Date: Mon, 13 Oct 2008 20:44:36 +0000 Subject: [PATCH] ... --- NOTES.txt | 1 + defines_kbd.s | 1 + defines_kim.s | 1 + defines_microtan.s | 11 +++++-- flow.s | 24 ++++++++++++--- input.s | 2 +- microtan_loadsave.s | 74 +++++++++++++++++++++++++++++++++++++++++++++ print.s | 11 ++++--- 8 files changed, 113 insertions(+), 12 deletions(-) create mode 100644 microtan_loadsave.s diff --git a/NOTES.txt b/NOTES.txt index 823c8fd..0e60aa3 100644 --- a/NOTES.txt +++ b/NOTES.txt @@ -5,3 +5,4 @@ AppleSoft I 1977 1.1 N Y Apple CONFIG_11 KIM BASIC 1977 1.1 N Y - CONFIG_11A Commodore BASIC 2 1979 Y Y CBM CONFIG_2 KBD BASIC 1980 Y N KBD +MicroTAN 1980 Y Y - \ No newline at end of file diff --git a/defines_kbd.s b/defines_kbd.s index ffee7b9..d53c3ca 100644 --- a/defines_kbd.s +++ b/defines_kbd.s @@ -3,6 +3,7 @@ CONFIG_SMALL := 1 CONFIG_2 := 1 CBM2_KBD := 1 KIM_KBD := 1 +KBD_MICROTAN := 1 CONFIG_11 := 1 CONFIG_11A := 1 CONFIG_SAFE_NAMENOTFOUND := 1 diff --git a/defines_kim.s b/defines_kim.s index 36ca712..8d04246 100644 --- a/defines_kim.s +++ b/defines_kim.s @@ -6,6 +6,7 @@ CBM2_KIM_APPLE := 1 ; OUTDO difference KIM_APPLE := 1 CONFIG_NULL := 1 CONFIG_PRINT_CR := 1 ; print CR when line end reached +KIM_MICROTAN := 1 CRLF_1 := $0D CRLF_2 := $0A diff --git a/defines_microtan.s b/defines_microtan.s index 554803e..af4bb7e 100644 --- a/defines_microtan.s +++ b/defines_microtan.s @@ -5,6 +5,8 @@ CONFIG_SAFE_NAMENOTFOUND := 1 CBM2_KIM_APPLE := 1 ; OUTDO difference KIM_APPLE := 1 CBM2_MICROTAN := 1 +KBD_MICROTAN := 1 +KIM_MICROTAN := 1 CONFIG_2 := 1 @@ -52,11 +54,16 @@ MONCOUT := $1EA0 STACK_TOP := $FE SPACE_FOR_GOSUB := $3E -NULL_MAX := $F2 ; probably different in original version; the image I have seems to be modified; see PDF +NULL_MAX := $F0 ; probably different in original version; the image I have seems to be modified; see PDF RAMSTART2 := $AAAA USR := $AAAA SAVE := $AAAA LOAD := $AAAA -LE21C := $AAAA \ No newline at end of file +LE21C := $AAAA +LC3F0 := $AAAA +LFE73 := $AAAA +LFE75 := $AAAA +LFDFA := $AAAA +LE219 := $AAAA diff --git a/flow.s b/flow.s index 20d8d6e..2069349 100644 --- a/flow.s +++ b/flow.s @@ -82,13 +82,13 @@ NEWSTT: jsr ISCNTC lda TXTPTR ldy TXTPTR+1 -.ifdef CONFIG_2 +.ifdef CBM2_KBD cpy #>INPUTBUFFER .endif .ifdef CBM2 nop .endif -.ifdef CONFIG_2 +.ifdef CBM2_KBD beq LC6D4 .else beq L2683 @@ -179,7 +179,7 @@ SYNERR1: .endif .ifdef CONFIG_2 LC721: -.ifdef KBD +.ifdef KBD_MICROTAN cmp #$45 .else cmp #$4B @@ -206,11 +206,11 @@ SETDA: sty DATPTR+1 RET2: rts -.ifndef CONFIG_CBM_ALL ; ---------------------------------------------------------------------------- ; SEE IF CONTROL-C TYPED ; ---------------------------------------------------------------------------- +.ifndef CONFIG_CBM_ALL ISCNTC: .endif .ifdef KBD @@ -251,6 +251,17 @@ L0ECC: clc cmp #$03 .endif +.ifdef MICROTAN + lda $01 + cmp #$03 + beq LC6EF + lda #$01 + rts +LC6EF: + nop + nop + cmp #$03 +.endif ; ---------------------------------------------------------------------------- ; "STOP" STATEMENT @@ -267,7 +278,7 @@ END2: bne RET1 lda TXTPTR ldy TXTPTR+1 -.ifdef CONFIG_2 +.ifdef CBM2_KBD ldx CURLIN+1 inx .endif @@ -363,6 +374,9 @@ CLEAR: .ifdef KIM .include "kim_loadsave.s" .endif +.ifdef MICROTAN +.include "microtan_loadsave.s" +.endif ; ---------------------------------------------------------------------------- ; "RUN" COMMAND diff --git a/input.s b/input.s index dd33323..b214830 100644 --- a/input.s +++ b/input.s @@ -186,7 +186,7 @@ GETC: READ: ldx DATPTR ldy DATPTR+1 -.ifdef CONFIG_2 +.ifdef CBM2_KBD lda #$98 ; AppleSoft, too .byte $2C L2ABE: diff --git a/microtan_loadsave.s b/microtan_loadsave.s new file mode 100644 index 0000000..1371b6c --- /dev/null +++ b/microtan_loadsave.s @@ -0,0 +1,74 @@ +.segment "CODE" + + ldy #$00 + beq LC74D +LC74B: + ldy #$01 +LC74D: + ldx #$4C +LC74F: + lda $13,x + pha + dex + bpl LC74F + ldx #$03 +LC757: + lda $9A,x + sta $1C,x + dex + bpl LC757 + jmp LE219 + nop + nop + nop +LC764: + tya + pha + ldy $03 + lda #$FF + sta ($0A),y + pla + tay + jsr LFDFA + lda $01 + jsr LC7A5 + rts + .byte "DED" + .byte $0D,$0A + .byte "OK" + .byte $0D,$0A,$00 + .byte "SAVED" + .byte $0D,$0A,$00 +LC789: + jsr LC74B + ldx #$FF + tsx + lda #$4F + jsr LFE75 + lda #$4B + jsr LFE75 + jsr LFE73 + lda $9C + tax + ldy $9D + jmp LC3F0 + nop +LC7A5: + pha + cmp #$0A + beq LC7AD + jsr LFE75 +LC7AD: + tya + pha + ldy $03 + lda #$20 + sta ($0A),y + pla + tay + pla + rts + inc $8A17 + stx $9C + sty $9D + jmp LC3F0 diff --git a/print.s b/print.s index aca67b3..d63263d 100644 --- a/print.s +++ b/print.s @@ -86,6 +86,9 @@ L29B9: sty INPUTBUFFER,x ldx #LINNUM+1 .endif + .ifdef MICROTAN + bne LE882 + .endif .endif .ifdef CONFIG_FILE lda Z03 @@ -289,7 +292,7 @@ OUTDO: bit Z14 bmi L2A56 .endif -.ifndef CONFIG_2 +.ifndef CBM2_KBD pha .endif .ifdef CBM1 @@ -335,10 +338,10 @@ L2A4C: inc POSX .endif L2A4E: -.ifndef CONFIG_2 +.ifndef CBM2_KBD pla .endif -.ifdef KIM +.ifdef KIM_MICROTAN sty DIMFLG .endif .ifdef CONFIG_IO_MSB @@ -348,7 +351,7 @@ L2A4E: .ifdef CONFIG_IO_MSB and #$7F .endif -.ifdef KIM +.ifdef KIM_MICROTAN ldy DIMFLG .endif .ifdef OSI