File tree 2 files changed +18
-26
lines changed
2 files changed +18
-26
lines changed Original file line number Diff line number Diff line change 1
1
t ?= esp32
2
2
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
5
7
TERMINAL_SPEED := 115200
6
8
7
9
ifeq ($t, tivac)
@@ -24,12 +26,13 @@ endif
24
26
25
27
ifeq ($t, esp32)
26
28
UPLOADSPEED := 921600
29
+ LIBRARIES += Network
27
30
28
31
ifeq ($b, lilygo)
29
32
BOARD := ttgo-t7-v14-mini32
30
33
SERIAL_PORT := /dev/ttyACM0
31
34
CPPFLAGS += -DHARDWARE_H=\"hw/ttgo-t7-v14-mini32.h\"
32
- LIBRARIES += FabGL WiFi
35
+ LIBRARIES += ESP32Lib WiFi
33
36
34
37
else
35
38
BOARD := lolin32
Original file line number Diff line number Diff line change 4
4
*/
5
5
#include < stdarg.h>
6
6
#include < r65emu.h>
7
- #include < ports.h>
8
7
#include < z80.h>
9
8
10
9
#include " config.h"
11
10
#include " screen.h"
12
11
#include " io.h"
13
12
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
-
28
13
Memory memory;
29
- z80 cpu (memory, ports );
14
+ z80 cpu (memory);
30
15
ram<> pages[2 ];
31
16
32
17
#include " roms/rom6e.h"
@@ -61,8 +46,18 @@ void function_keys(uint8_t key) {
61
46
}
62
47
63
48
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
+
64
57
hardware_init (cpu);
65
58
59
+ hardware_interval_timer (16 , []() { cpu.irq (vec); });
60
+
66
61
memory.put (e6 , 0x0000 );
67
62
memory.put (f6, 0x1000 );
68
63
memory.put (h6, 0x2000 );
@@ -80,12 +75,6 @@ void loop(void) {
80
75
81
76
kbd.poll ();
82
77
83
- if (!io.paused ()) {
78
+ if (!io.paused ())
84
79
hardware_run ();
85
- if (cpu.ts () > 51200 ) {
86
- cpu.reset_ts ();
87
- if (io.int_enabled ())
88
- cpu.raise (irq);
89
- }
90
- }
91
80
}
You can’t perform that action at this time.
0 commit comments