mirror of
https://github.com/jscrane/Apple1.git
synced 2025-01-02 12:31:08 +00:00
initial support for pi pico
This commit is contained in:
parent
0d40d7008b
commit
de511a2346
53
Apple1.ino
53
Apple1.ino
@ -54,7 +54,10 @@ void reset() {
|
||||
dsp.status("Reset failed");
|
||||
return;
|
||||
}
|
||||
io.start();
|
||||
if (!io.start()) {
|
||||
dsp.status("IO Start failed");
|
||||
return;
|
||||
}
|
||||
#if defined(KRUSADER)
|
||||
dsp.status("Krusader: F000R / Basic: E000R");
|
||||
#else
|
||||
@ -62,6 +65,15 @@ void reset() {
|
||||
#endif
|
||||
}
|
||||
|
||||
static const char *open(const char *filename) {
|
||||
if (filename) {
|
||||
dsp.status(filename);
|
||||
return filename;
|
||||
}
|
||||
dsp.status("No file");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void function_key(uint8_t fn) {
|
||||
static const char *filename;
|
||||
|
||||
@ -70,20 +82,18 @@ void function_key(uint8_t fn) {
|
||||
reset();
|
||||
break;
|
||||
case 2:
|
||||
filename = io.files.advance();
|
||||
dsp.status(filename);
|
||||
filename = open(io.files.advance());
|
||||
break;
|
||||
case 3:
|
||||
filename = io.files.rewind();
|
||||
dsp.status(filename);
|
||||
filename = open(io.files.rewind());
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
io.load();
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
dsp.status(io.files.checkpoint());
|
||||
break;
|
||||
case 7:
|
||||
case 8:
|
||||
if (filename)
|
||||
io.files.restore(filename);
|
||||
break;
|
||||
@ -94,27 +104,24 @@ void function_key(uint8_t fn) {
|
||||
}
|
||||
|
||||
void setup() {
|
||||
#if defined(DEBUGGING) || defined(CPU_DEBUG)
|
||||
Serial.begin(TERMINAL_SPEED);
|
||||
Serial.println();
|
||||
Serial.print("RAM: ");
|
||||
Serial.print(RAM_PAGES);
|
||||
Serial.print("kB at 0x0000");
|
||||
Serial.println();
|
||||
#if defined(USE_SPIRAM)
|
||||
Serial.print("SpiRAM: ");
|
||||
Serial.print(SPIRAM_EXTENT * Memory::page_size / 1024);
|
||||
Serial.print("kB at 0x");
|
||||
Serial.print(SPIRAM_BASE, 16);
|
||||
Serial.println();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
hardware_init(cpu);
|
||||
|
||||
DBG(print("RAM: "));
|
||||
DBG(print(RAM_PAGES));
|
||||
DBG(print("kB at 0x0000"));
|
||||
DBG(println());
|
||||
|
||||
for (unsigned i = 0; i < RAM_PAGES; i++)
|
||||
memory.put(pages[i], i * ram<>::page_size);
|
||||
|
||||
#if defined(USE_SPIRAM)
|
||||
DBG(print("SpiRAM: "));
|
||||
DBG(print(SPIRAM_EXTENT * Memory::page_size / 1024));
|
||||
DBG(print("kB at 0x"));
|
||||
DBG(print(SPIRAM_BASE, 16));
|
||||
DBG(println());
|
||||
|
||||
memory.put(sram, SPIRAM_BASE, SPIRAM_EXTENT);
|
||||
#endif
|
||||
|
||||
|
18
Makefile
18
Makefile
@ -1,31 +1,28 @@
|
||||
t ?= esp32
|
||||
|
||||
TERMINAL_SPEED := 115200
|
||||
#CPPFLAGS = -DDEBUGGING -DCPU_DEBUG=false -DTERMINAL_SPEED=$(TERMINAL_SPEED) -DUSE_OWN_KBD -DPS2_SERIAL_KBD=\"UK\"
|
||||
CPPFLAGS = -DDEBUGGING -DCPU_DEBUG=false -DTERMINAL_SPEED=$(TERMINAL_SPEED) -DUSE_OWN_KBD -DUSE_SERIAL
|
||||
CPPFLAGS = -DDEBUGGING -DCPU_DEBUG=false -DTERMINAL_SPEED=$(TERMINAL_SPEED) -DUSE_OWN_KBD
|
||||
LIBRARIES = PS2KeyAdvanced PS2KeyMap
|
||||
|
||||
ifeq ($t, esp8266)
|
||||
BOARD := d1_mini
|
||||
BAUD := 921600
|
||||
FS_DIR := programs
|
||||
EESZ := 4M1M
|
||||
F_CPU := 80
|
||||
CPPFLAGS += -DUSER_SETUP_LOADED -DILI9341_DRIVER -DTFT_CS=PIN_D8 -DTFT_DC=PIN_D1 \
|
||||
-DTFT_RST=-1 -DSPI_FREQUENCY=40000000 -DLOAD_GLCD \
|
||||
-DHARDWARE_H=\"hw/esp8bit.h\"
|
||||
-DHARDWARE_H=\"hw/esp8bit.h\" -DPS2_SERIAL_KBD=\"UK\"
|
||||
LIBRARIES += TFT_eSPI SpiRAM LittleFS
|
||||
endif
|
||||
|
||||
ifeq ($t, tivac)
|
||||
BOARD := EK-LM4F120XL
|
||||
CPPFLAGS += -DHARDWARE_H=\"hw/stellarpad-example.h\"
|
||||
CPPFLAGS += -DHARDWARE_H=\"hw/stellarpad-example.h\" -DPS2_SERIAL_KBD=\"UK\"
|
||||
LIBRARIES += UTFT SD SpiRAM
|
||||
endif
|
||||
|
||||
ifeq ($t, esp32)
|
||||
UPLOADSPEED := 921600
|
||||
FS_DIR := programs
|
||||
LIBRARIES += FS SPIFFS
|
||||
|
||||
ifeq ($b, lilygo)
|
||||
@ -38,9 +35,16 @@ else
|
||||
BOARD := lolin32
|
||||
CPPFLAGS += -DUSER_SETUP_LOADED -DILI9341_DRIVER -DTFT_CS=5 -DTFT_DC=2 \
|
||||
-DTFT_RST=-1 -DSPI_FREQUENCY=40000000 -DLOAD_GLCD \
|
||||
-DHARDWARE_H=\"hw/esp32-example.h\"
|
||||
-DHARDWARE_H=\"hw/esp32-example.h\" -DUSE_SERIAL
|
||||
LIBRARIES += TFT_eSPI
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($t, rp2040)
|
||||
BOARD := adafruit_feather_dvi
|
||||
FLASH := 8388608_2097152
|
||||
CPPFLAGS += -DHARDWARE_H=\"hw/adafruit_feather_dvi.h\" -DPS2_SERIAL_KBD=\"UK\"
|
||||
LIBRARIES += LittleFS PicoDVI Adafruit_GFX Adafruit_BusIO Wire
|
||||
endif
|
||||
|
||||
include $t.mk
|
||||
|
10
README.md
10
README.md
@ -13,10 +13,10 @@ Requirements
|
||||
Keyboard
|
||||
--------
|
||||
- F1 (^N): reset
|
||||
- F2 (^M): advance tape
|
||||
- F3 (^O): rewind tape
|
||||
- F4 (^P): load program from tape (by simulating typing it)
|
||||
- F6 (^R): checkpoint machine
|
||||
- F7 (^S): restore from current checkpoint on tape
|
||||
- F2 (^O): advance tape
|
||||
- F3 (^P): rewind tape
|
||||
- F5 (^R): load program from tape (by simulating typing it)
|
||||
- F7 (^T): checkpoint machine
|
||||
- F8 (^U): restore from current checkpoint on tape
|
||||
- F10(^W): watch CPU execute instructions
|
||||
- Underscore is rubout
|
||||
|
4
config.h
4
config.h
@ -16,9 +16,9 @@
|
||||
|
||||
#endif
|
||||
|
||||
// uncomment to use TFT / VGA display
|
||||
// uncomment to use TFT / VGA / DVI display
|
||||
// otherwise serial terminal is used
|
||||
//#define SCREEN_SERIAL_DSP
|
||||
#define SCREEN_SERIAL_DSP
|
||||
|
||||
#define FG_COLOUR GREEN
|
||||
#define BG_COLOUR BLACK
|
||||
|
Loading…
Reference in New Issue
Block a user