remove VIC20 target

This commit is contained in:
nino-porcino 2022-02-07 09:26:32 +01:00
parent 10ce1dfd31
commit 36f2dcf255
7 changed files with 28 additions and 119 deletions

View File

@ -247,7 +247,6 @@ of the KickC compiler:
- `apple1` - `apple1`
- `apple1_jukebox` - `apple1_jukebox`
- `vic20`
#### Target "apple1" #### Target "apple1"
@ -287,10 +286,3 @@ $0000-$00FF zero page: holds some C program variables
$0280-$0FFF RAM: C program "Data" segment $0280-$0FFF RAM: C program "Data" segment
$4000-$7581 ROM: C program "Code" segment $4000-$7581 ROM: C program "Code" segment
$7582-$7FFF ROM: C program "Data" segment (startup values) $7582-$7FFF ROM: C program "Data" segment (startup values)
#### Target "vic20"
This target has been used during the development of the library
where a custom made VIC-20 emulator was interfaced with
an emulated TMS9918, thus allowing running tests when
the real Apple-1 machine was not available.

View File

@ -1,8 +0,0 @@
// Commodore VIC 20 8k executable PRG file
.file [name="%O", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$1201]
.segmentdef Code [start=%P]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(%E)

View File

@ -1,14 +0,0 @@
{
"description": "Commodore VIC 20 8K executable PRG file",
"extension": "prg",
"link": "vic20_8k.ld",
"start_address": "0x120d",
"cpu": "MOS6502X",
"interrupt": "rom_min_vic20",
"emulator": "echo",
"defines": {
"__VIC20__": 1,
"VIC20": 1,
"__KICKC__": 1
}
}

View File

@ -14,36 +14,23 @@
#pragma zp_reserve(0x2B) // MODE $00=XAM, $7F=STOR, $AE=BLOCK XAM #pragma zp_reserve(0x2B) // MODE $00=XAM, $7F=STOR, $AE=BLOCK XAM
#endif #endif
#ifdef APPLE1 // APPLE1
// APPLE1 const word WOZMON = 0xFF1F; // enters monitor
const word WOZMON = 0xFF1F; // enters monitor const word ECHO = 0xFFEF; // output ascii character in A (A not destroyed)
const word ECHO = 0xFFEF; // output ascii character in A (A not destroyed) const word PRBYTE = 0xFFDC; // print hex byte in A (A destroyed)
const word PRBYTE = 0xFFDC; // print hex byte in A (A destroyed) const word KEY_DATA = 0xd010; // read key
const word KEY_DATA = 0xd010; // read key const word KEY_CTRL = 0xd011; // control port
const word KEY_CTRL = 0xd011; // control port const word TERM_DATA = 0xd012; // write ascii
const word TERM_DATA = 0xd012; // write ascii const word TERM_CTRL = 0xd013; // control port
const word TERM_CTRL = 0xd013; // control port const word INBUFFER = 0x0200; // woz monitor input buffer
const word INBUFFER = 0x0200; // woz monitor input buffer const word INBUFSIZE = 0x80; // woz monitor input buffer size
const word INBUFSIZE = 0x80; // woz monitor input buffer size
#else
// VIC20
const word ECHO = 0xFFD2; // chrout routine in kernal rom
const word GETIN = 0xFFE4; // GETIN keyboard read routine
#endif
// prints a hex byte using the WOZMON routine // prints a hex byte using the WOZMON routine
void woz_print_hex(byte c) { void woz_print_hex(byte c) {
#ifdef APPLE1 asm {
asm { lda c
lda c jsr PRBYTE
jsr PRBYTE };
};
#else
asm {
lda c
jsr ECHO
};
#endif
} }
// print hex word // print hex word
@ -68,65 +55,32 @@ void woz_puts(byte *s) {
// returns to WOZMON prompt // returns to WOZMON prompt
void woz_mon() { void woz_mon() {
#ifdef APPLE1 asm {
asm { jmp WOZMON
jmp WOZMON }
}
#endif
} }
// returns nonzero if a key has been pressed // returns nonzero if a key has been pressed
inline byte apple1_iskeypressed() { inline byte apple1_iskeypressed() {
#ifdef APPLE1 return PEEK(KEY_CTRL) & 0x80;
return PEEK(KEY_CTRL) & 0x80;
#else
return 0;
#endif
} }
// blocking keyboard read // blocking keyboard read
// reads a key from the apple-1 keyboard // reads a key from the apple-1 keyboard
byte apple1_getkey() { byte apple1_getkey() {
#ifdef APPLE1 asm {
asm { __wait:
__wait: lda KEY_CTRL
lda KEY_CTRL bpl __wait
bpl __wait }
} return PEEK(KEY_DATA) & 0x7f;
return PEEK(KEY_DATA) & 0x7f;
#else
byte key;
byte const *keyptr = &key;
kickasm(uses keyptr, uses GETIN) {{
__wait:
jsr GETIN
cmp #0
beq __wait
sta keyptr
}}
return key;
#endif
} }
// non blocking keyboard read // non blocking keyboard read
// reads a key and return 0 if no key is pressed // reads a key and return 0 if no key is pressed
byte apple1_readkey() { byte apple1_readkey() {
#ifdef APPLE1 if((PEEK(KEY_CTRL) & 0x80)==0) return 0;
if((PEEK(KEY_CTRL) & 0x80)==0) return 0; else return PEEK(KEY_DATA) & 0x7f;
else return PEEK(KEY_DATA) & 0x7f;
#else
byte key;
byte const *keyptr = &key;
kickasm(uses keyptr, uses GETIN) {{
jsr GETIN
cmp #0
bne __keypress
lda #0
__keypress:
sta keyptr
}}
return key;
#endif
} }
void apple1_input_line(byte *buffer, byte max) { void apple1_input_line(byte *buffer, byte max) {
@ -162,8 +116,6 @@ void apple1_input_line(byte *buffer, byte max) {
buffer[x]=0; buffer[x]=0;
} }
#ifdef APPLE1
#include <stdlib.h> // for memcpy #include <stdlib.h> // for memcpy
#define LOWRAM_START 0x280 #define LOWRAM_START 0x280
@ -175,6 +127,5 @@ inline void apple1_eprom_init() {
// copy the initializaton data from ROM to lowram where "Data" segment is allocated // copy the initializaton data from ROM to lowram where "Data" segment is allocated
memcpy((byte *)LOWRAM_START, (byte *)DATAINCODE, LOWRAM_SIZE); memcpy((byte *)LOWRAM_START, (byte *)DATAINCODE, LOWRAM_SIZE);
} }
#endif
#endif #endif

View File

@ -67,11 +67,7 @@ void screen1_prepare() {
} }
} }
#ifdef VIC20
#define CHR_BACKSPACE 20
#else
#define CHR_BACKSPACE 8 #define CHR_BACKSPACE 8
#endif
#define CHR_HOME 11 #define CHR_HOME 11
#define CHR_CLS 12 #define CHR_CLS 12

View File

@ -3,10 +3,6 @@
@SET TARGET=%1 @SET TARGET=%1
@SET TMS9918=..\.. @SET TMS9918=..\..
@echo ======================== VIC20 ===================================================
call kickc -includedir %TMS9918%\lib -targetdir %TMS9918%\kickc\ -t vic20_8k %TARGET%.c -o out\%TARGET%_vic20.prg -e
copy out\%TARGET%.prg out\%TARGET%_vic20.prg
@echo ======================== APPLE 1 JUKEBOX ================================================= @echo ======================== APPLE 1 JUKEBOX =================================================
call kickc -includedir %TMS9918%\lib -targetdir %TMS9918%\kickc\ -t apple1_jukebox %TARGET%.c -o out\%TARGET%.prg -e call kickc -includedir %TMS9918%\lib -targetdir %TMS9918%\kickc\ -t apple1_jukebox %TARGET%.c -o out\%TARGET%.prg -e
call node %TMS9918%\tools\mkeprom out out\%TARGET%_jukebox.bin call node %TMS9918%\tools\mkeprom out out\%TARGET%_jukebox.bin

View File

@ -5,10 +5,6 @@ TMS9918=../..
mkdir -p out mkdir -p out
echo ======================== VIC20 ===================================================
kickc.sh -includedir ${TMS9918}/lib -targetdir ${TMS9918}/kickc/ -t vic20_8k ${TARGET}.c -o out/${TARGET}_vic20.prg -e
cp out/${TARGET}.prg out/${TARGET}_vic20.prg
echo ======================== APPLE 1 JUKEBOX ================================================= echo ======================== APPLE 1 JUKEBOX =================================================
kickc.sh -includedir ${TMS9918}/lib -targetdir ${TMS9918}/kickc/ -t apple1_jukebox ${TARGET}.c -o out/${TARGET}.prg -e kickc.sh -includedir ${TMS9918}/lib -targetdir ${TMS9918}/kickc/ -t apple1_jukebox ${TARGET}.c -o out/${TARGET}.prg -e
node ${TMS9918}/tools/mkeprom out out/${TARGET}_jukebox.bin node ${TMS9918}/tools/mkeprom out out/${TARGET}_jukebox.bin