Skip to content

Commit 5210565

Browse files
committed
updates
1 parent 172625e commit 5210565

File tree

2 files changed

+18
-26
lines changed

2 files changed

+18
-26
lines changed

Makefile

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
t ?= esp32
22

3-
CPPFLAGS = -DNO_STORAGE -DNO_SPIRAM
4-
LIBRARIES = SPI PS2KeyRaw
3+
#TERMINAL_EXTRA_FLAGS := -C serialout.txt
4+
#CPPFLAGS = -DDEBUGGING=0x01
5+
CPPFLAGS += -DNO_STORAGE -DNO_SPIRAM
6+
LIBRARIES = SPI PS2KeyRaw SimpleTimer
57
TERMINAL_SPEED := 115200
68

79
ifeq ($t, tivac)
@@ -24,12 +26,13 @@ endif
2426

2527
ifeq ($t, esp32)
2628
UPLOADSPEED := 921600
29+
LIBRARIES += Network
2730

2831
ifeq ($b, lilygo)
2932
BOARD := ttgo-t7-v14-mini32
3033
SERIAL_PORT := /dev/ttyACM0
3134
CPPFLAGS += -DHARDWARE_H=\"hw/ttgo-t7-v14-mini32.h\"
32-
LIBRARIES += FabGL WiFi
35+
LIBRARIES += ESP32Lib WiFi
3336

3437
else
3538
BOARD := lolin32

pacman.ino

+12-23
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,14 @@
44
*/
55
#include <stdarg.h>
66
#include <r65emu.h>
7-
#include <ports.h>
87
#include <z80.h>
98

109
#include "config.h"
1110
#include "screen.h"
1211
#include "io.h"
1312

14-
static uint8_t irq;
15-
16-
class IOPorts: public PortDevice {
17-
public:
18-
uint8_t in(uint16_t p) {
19-
return 0;
20-
}
21-
22-
void out(uint16_t p, uint8_t b) {
23-
if ((p & 0xff) == 0x0000)
24-
irq = b;
25-
}
26-
} ports;
27-
2813
Memory memory;
29-
z80 cpu(memory, ports);
14+
z80 cpu(memory);
3015
ram<> pages[2];
3116

3217
#include "roms/rom6e.h"
@@ -61,8 +46,18 @@ void function_keys(uint8_t key) {
6146
}
6247

6348
void setup(void) {
49+
50+
static uint8_t vec;
51+
52+
cpu.set_port_out_handler([](uint16_t p, uint8_t b) {
53+
if ((p & 0xff) == 0x0000)
54+
vec = b;
55+
});
56+
6457
hardware_init(cpu);
6558

59+
hardware_interval_timer(16, []() { cpu.irq(vec); });
60+
6661
memory.put(e6, 0x0000);
6762
memory.put(f6, 0x1000);
6863
memory.put(h6, 0x2000);
@@ -80,12 +75,6 @@ void loop(void) {
8075

8176
kbd.poll();
8277

83-
if (!io.paused()) {
78+
if (!io.paused())
8479
hardware_run();
85-
if (cpu.ts() > 51200) {
86-
cpu.reset_ts();
87-
if (io.int_enabled())
88-
cpu.raise(irq);
89-
}
90-
}
9180
}

0 commit comments

Comments
 (0)