mirror of
https://github.com/mist64/msbasic.git
synced 2024-06-04 17:29:32 +00:00
Add a vm6502 variant
This commit is contained in:
parent
c15c84741a
commit
6c2a5aeb44
|
@ -25,6 +25,9 @@ AIM65 := 1
|
|||
.elseif .def(sym1)
|
||||
SYM1 := 1
|
||||
.include "defines_sym1.s"
|
||||
.elseif .def(vm6502)
|
||||
VM6502 := 1
|
||||
.include "defines_vm6502.s"
|
||||
.endif
|
||||
|
||||
.ifdef CONFIG_2C
|
||||
|
|
22
defines_vm6502.s
Normal file
22
defines_vm6502.s
Normal file
|
@ -0,0 +1,22 @@
|
|||
; Inspired by https://github.com/beneater/msbasic
|
||||
|
||||
; configuration
|
||||
CONFIG_2A := 1
|
||||
|
||||
CONFIG_SCRTCH_ORDER := 2
|
||||
|
||||
; zero page
|
||||
ZP_START1 = $00
|
||||
ZP_START2 = $0A
|
||||
ZP_START3 = $60
|
||||
ZP_START4 = $6B
|
||||
|
||||
; extra/override ZP variables
|
||||
USR := GORESTART
|
||||
|
||||
; constants
|
||||
SPACE_FOR_GOSUB := $3E
|
||||
STACK_TOP := $FA
|
||||
WIDTH := 40
|
||||
WIDTH2 := 30
|
||||
RAMSTART2 := $0400
|
6
extra.s
6
extra.s
|
@ -24,6 +24,10 @@
|
|||
.include "aim65_extra.s"
|
||||
.endif
|
||||
|
||||
.ifdef VM6502
|
||||
.include "vm6502_extra.s"
|
||||
.endif
|
||||
|
||||
.ifdef SYM1
|
||||
.byte 0,0,0
|
||||
.endif
|
||||
.endif
|
||||
|
|
3
header.s
3
header.s
|
@ -11,3 +11,6 @@
|
|||
.ifdef SYM1
|
||||
jmp PR_WRITTEN_BY
|
||||
.endif
|
||||
.ifdef VM6502
|
||||
jmp COLD_START
|
||||
.endif
|
||||
|
|
3
iscntc.s
3
iscntc.s
|
@ -26,4 +26,7 @@
|
|||
.ifdef SYM1
|
||||
.include "sym1_iscntc.s"
|
||||
.endif
|
||||
.ifdef VM6502
|
||||
.include "vm6502_iscntc.s"
|
||||
.endif
|
||||
;!!! runs into "STOP"
|
2
make.sh
2
make.sh
|
@ -2,7 +2,7 @@ if [ ! -d tmp ]; then
|
|||
mkdir tmp
|
||||
fi
|
||||
|
||||
for i in cbmbasic1 cbmbasic2 kbdbasic osi kb9 applesoft microtan aim65 sym1; do
|
||||
for i in cbmbasic1 cbmbasic2 kbdbasic osi kb9 applesoft microtan aim65 sym1 vm6502; do
|
||||
|
||||
echo $i
|
||||
ca65 -D $i msbasic.s -o tmp/$i.o &&
|
||||
|
|
19
vm6502.cfg
Normal file
19
vm6502.cfg
Normal file
|
@ -0,0 +1,19 @@
|
|||
MEMORY {
|
||||
ZP: start = $0000, size = $0100, type = rw;
|
||||
BASROM: start = $C000, size = $3F00, fill = no, file = %O;
|
||||
DUMMY: start = $0000, size = $00FF, file = "";
|
||||
}
|
||||
|
||||
SEGMENTS {
|
||||
ZEROPAGE: load = ZP, type = zp;
|
||||
HEADER: load = BASROM, type = ro;
|
||||
VECTORS: load = BASROM, type = ro;
|
||||
KEYWORDS: load = BASROM, type = ro;
|
||||
ERROR: load = BASROM, type = ro;
|
||||
CODE: load = BASROM, type = ro;
|
||||
CHRGET: load = BASROM, type = ro;
|
||||
INIT: load = BASROM, type = ro;
|
||||
EXTRA: load = BASROM, type = ro;
|
||||
DUMMY: load = DUMMY; # don't include
|
||||
}
|
||||
|
49
vm6502_extra.s
Normal file
49
vm6502_extra.s
Normal file
|
@ -0,0 +1,49 @@
|
|||
; Inspired by https://github.com/beneater/msbasic
|
||||
|
||||
; TODO implement
|
||||
|
||||
LOAD:
|
||||
rts
|
||||
|
||||
SAVE:
|
||||
rts
|
||||
|
||||
|
||||
; On return, carry flag indicates whether a key was pressed
|
||||
; If a key was pressed, the key value will be in the A register
|
||||
;
|
||||
; Modifies: flags, A
|
||||
MONRDKEY:
|
||||
CHRIN:
|
||||
; lda ACIA_STATUS
|
||||
; and #$08
|
||||
; beq @no_keypressed
|
||||
; lda ACIA_DATA
|
||||
; jsr CHROUT ; echo
|
||||
; sec
|
||||
; rts
|
||||
;@no_keypressed:
|
||||
clc
|
||||
rts
|
||||
|
||||
|
||||
; Output a character (from the A register)
|
||||
;
|
||||
; Modifies: flags
|
||||
MONCOUT:
|
||||
CHROUT:
|
||||
; pha
|
||||
; sta ACIA_DATA
|
||||
; lda #$FF
|
||||
;@txdelay: dec
|
||||
; bne @txdelay
|
||||
; pla
|
||||
rts
|
||||
|
||||
; TODO set up reset vector
|
||||
|
||||
;.segment "RESETVEC"
|
||||
; .word $0F00 ; NMI vector
|
||||
; .word RESET ; RESET vector
|
||||
; .word $0000 ; IRQ vector
|
||||
|
17
vm6502_iscntc.s
Normal file
17
vm6502_iscntc.s
Normal file
|
@ -0,0 +1,17 @@
|
|||
; Inspired by https://github.com/beneater/msbasic
|
||||
|
||||
; TODO implement
|
||||
|
||||
ISCNTC:
|
||||
; jsr MONRDKEY
|
||||
; bcc not_cntc
|
||||
; cmp #3
|
||||
; bne not_cntc
|
||||
; jmp is_cntc
|
||||
;
|
||||
;not_cntc:
|
||||
rts
|
||||
|
||||
;is_cntc:
|
||||
; ; Fall through
|
||||
|
Loading…
Reference in New Issue
Block a user