From 46c95320affa1c542f96ae682af3fd707dd324c9 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sat, 24 Oct 2020 14:37:19 -0400 Subject: [PATCH] emul: bring "hw" subfolders one level higher --- emul/README.md | 3 +-- emul/hw/README.md | 10 ---------- emul/{hw => }/rc2014/.gitignore | 0 emul/{hw => }/rc2014/Makefile | 6 +++--- emul/{hw => }/rc2014/README.md | 0 emul/{hw => }/rc2014/acia.c | 0 emul/{hw => }/rc2014/acia.h | 0 emul/{hw => }/rc2014/classic.c | 2 +- emul/{hw => }/rc2014/sdc.c | 0 emul/{hw => }/rc2014/sdc.h | 0 emul/{hw => }/rc2014/sio.c | 0 emul/{hw => }/rc2014/sio.h | 0 emul/{hw => }/sms/.gitignore | 0 emul/{hw => }/sms/Makefile | 6 +++--- emul/{hw => }/sms/README.md | 0 emul/{hw => }/sms/kbd.c | 0 emul/{hw => }/sms/kbd.h | 0 emul/{hw => }/sms/pad.c | 0 emul/{hw => }/sms/pad.h | 0 emul/{hw => }/sms/port.c | 0 emul/{hw => }/sms/port.h | 2 +- emul/{hw => }/sms/sms.c | 2 +- emul/{hw => }/sms/vdp.c | 0 emul/{hw => }/sms/vdp.h | 0 emul/{hw => }/ti/.gitignore | 0 emul/{hw => }/ti/Makefile | 6 +++--- emul/{hw => }/ti/README.md | 0 emul/{hw => }/ti/kbd.c | 0 emul/{hw => }/ti/kbd.h | 0 emul/{hw => }/ti/t6a04.c | 0 emul/{hw => }/ti/t6a04.h | 0 emul/{hw => }/ti/ti84.c | 2 +- recipes/rc2014/Makefile | 2 +- recipes/sms/Makefile | 4 ++-- recipes/ti84/Makefile | 2 +- 35 files changed, 18 insertions(+), 29 deletions(-) delete mode 100644 emul/hw/README.md rename emul/{hw => }/rc2014/.gitignore (100%) rename emul/{hw => }/rc2014/Makefile (72%) rename emul/{hw => }/rc2014/README.md (100%) rename emul/{hw => }/rc2014/acia.c (100%) rename emul/{hw => }/rc2014/acia.h (100%) rename emul/{hw => }/rc2014/classic.c (99%) rename emul/{hw => }/rc2014/sdc.c (100%) rename emul/{hw => }/rc2014/sdc.h (100%) rename emul/{hw => }/rc2014/sio.c (100%) rename emul/{hw => }/rc2014/sio.h (100%) rename emul/{hw => }/sms/.gitignore (100%) rename emul/{hw => }/sms/Makefile (78%) rename emul/{hw => }/sms/README.md (100%) rename emul/{hw => }/sms/kbd.c (100%) rename emul/{hw => }/sms/kbd.h (100%) rename emul/{hw => }/sms/pad.c (100%) rename emul/{hw => }/sms/pad.h (100%) rename emul/{hw => }/sms/port.c (100%) rename emul/{hw => }/sms/port.h (95%) rename emul/{hw => }/sms/sms.c (99%) rename emul/{hw => }/sms/vdp.c (100%) rename emul/{hw => }/sms/vdp.h (100%) rename emul/{hw => }/ti/.gitignore (100%) rename emul/{hw => }/ti/Makefile (78%) rename emul/{hw => }/ti/README.md (100%) rename emul/{hw => }/ti/kbd.c (100%) rename emul/{hw => }/ti/kbd.h (100%) rename emul/{hw => }/ti/t6a04.c (100%) rename emul/{hw => }/ti/t6a04.h (100%) rename emul/{hw => }/ti/ti84.c (99%) diff --git a/emul/README.md b/emul/README.md index 2f23329..7e0d0dc 100644 --- a/emul/README.md +++ b/emul/README.md @@ -28,7 +28,6 @@ because the goal here is to facilitate "high level" development. These apps run on imaginary hardware and use many cheats to simplify I/Os. -For real hardware emulation (which helps developing drivers), see the `hw` -folder. +For real hardware emulation (which helps developing drivers), see subfolders. [libz80]: https://github.com/ggambetta/libz80 diff --git a/emul/hw/README.md b/emul/hw/README.md deleted file mode 100644 index 4900d19..0000000 --- a/emul/hw/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Hardware emulation - -In this folder, we emulate some of the hardware used in recipes. The emulation -is done in a simplistic manner, just enough to verify that the driver code for -it works generally well. No tricky stuff implemented. - -This kind of emulation is useful for detecting obvious regressions without -having to get the code on actual hardware for the upteenth time. - -To use, go to the appropriate subfolder and read README there. diff --git a/emul/hw/rc2014/.gitignore b/emul/rc2014/.gitignore similarity index 100% rename from emul/hw/rc2014/.gitignore rename to emul/rc2014/.gitignore diff --git a/emul/hw/rc2014/Makefile b/emul/rc2014/Makefile similarity index 72% rename from emul/hw/rc2014/Makefile rename to emul/rc2014/Makefile index dc75d2e..6621372 100644 --- a/emul/hw/rc2014/Makefile +++ b/emul/rc2014/Makefile @@ -1,12 +1,12 @@ -EXTOBJS = ../../emul.o ../../libz80/libz80.o +EXTOBJS = ../emul.o ../libz80/libz80.o OBJS = sio.o acia.o sdc.o classic.o TARGET = classic .PHONY: all all: $(TARGET) -../../emul.o: - make -C ../.. +../emul.o: + make -C .. $(TARGET): $(OBJS) $(EXTOBJS) $(CC) $(OBJS) $(EXTOBJS) -o $@ diff --git a/emul/hw/rc2014/README.md b/emul/rc2014/README.md similarity index 100% rename from emul/hw/rc2014/README.md rename to emul/rc2014/README.md diff --git a/emul/hw/rc2014/acia.c b/emul/rc2014/acia.c similarity index 100% rename from emul/hw/rc2014/acia.c rename to emul/rc2014/acia.c diff --git a/emul/hw/rc2014/acia.h b/emul/rc2014/acia.h similarity index 100% rename from emul/hw/rc2014/acia.h rename to emul/rc2014/acia.h diff --git a/emul/hw/rc2014/classic.c b/emul/rc2014/classic.c similarity index 99% rename from emul/hw/rc2014/classic.c rename to emul/rc2014/classic.c index 3f20de2..783fae8 100644 --- a/emul/hw/rc2014/classic.c +++ b/emul/rc2014/classic.c @@ -11,7 +11,7 @@ #include #include #include -#include "../../emul.h" +#include "../emul.h" #include "acia.h" #include "sio.h" #include "sdc.h" diff --git a/emul/hw/rc2014/sdc.c b/emul/rc2014/sdc.c similarity index 100% rename from emul/hw/rc2014/sdc.c rename to emul/rc2014/sdc.c diff --git a/emul/hw/rc2014/sdc.h b/emul/rc2014/sdc.h similarity index 100% rename from emul/hw/rc2014/sdc.h rename to emul/rc2014/sdc.h diff --git a/emul/hw/rc2014/sio.c b/emul/rc2014/sio.c similarity index 100% rename from emul/hw/rc2014/sio.c rename to emul/rc2014/sio.c diff --git a/emul/hw/rc2014/sio.h b/emul/rc2014/sio.h similarity index 100% rename from emul/hw/rc2014/sio.h rename to emul/rc2014/sio.h diff --git a/emul/hw/sms/.gitignore b/emul/sms/.gitignore similarity index 100% rename from emul/hw/sms/.gitignore rename to emul/sms/.gitignore diff --git a/emul/hw/sms/Makefile b/emul/sms/Makefile similarity index 78% rename from emul/hw/sms/Makefile rename to emul/sms/Makefile index b04cc17..d35d462 100644 --- a/emul/hw/sms/Makefile +++ b/emul/sms/Makefile @@ -1,4 +1,4 @@ -EXTOBJS = ../../emul.o ../../libz80/libz80.o +EXTOBJS = ../emul.o ../libz80/libz80.o OBJS = sms.o vdp.o port.o pad.o kbd.o TARGET = sms CFLAGS += `pkg-config --cflags xcb` @@ -7,8 +7,8 @@ LDFLAGS += `pkg-config --libs xcb` .PHONY: all all: $(TARGET) -../../emul.o: - make -C ../.. +../emul.o: + make -C .. $(TARGET): $(OBJS) $(EXTOBJS) $(CC) $(OBJS) $(EXTOBJS) -o $@ $(LDFLAGS) diff --git a/emul/hw/sms/README.md b/emul/sms/README.md similarity index 100% rename from emul/hw/sms/README.md rename to emul/sms/README.md diff --git a/emul/hw/sms/kbd.c b/emul/sms/kbd.c similarity index 100% rename from emul/hw/sms/kbd.c rename to emul/sms/kbd.c diff --git a/emul/hw/sms/kbd.h b/emul/sms/kbd.h similarity index 100% rename from emul/hw/sms/kbd.h rename to emul/sms/kbd.h diff --git a/emul/hw/sms/pad.c b/emul/sms/pad.c similarity index 100% rename from emul/hw/sms/pad.c rename to emul/sms/pad.c diff --git a/emul/hw/sms/pad.h b/emul/sms/pad.h similarity index 100% rename from emul/hw/sms/pad.h rename to emul/sms/pad.h diff --git a/emul/hw/sms/port.c b/emul/sms/port.c similarity index 100% rename from emul/hw/sms/port.c rename to emul/sms/port.c diff --git a/emul/hw/sms/port.h b/emul/sms/port.h similarity index 95% rename from emul/hw/sms/port.h rename to emul/sms/port.h index 5679354..f2111c7 100644 --- a/emul/hw/sms/port.h +++ b/emul/sms/port.h @@ -1,5 +1,5 @@ #pragma once -#include "../../emul.h" +#include "../emul.h" // Each port is a bitmask of each pin's status. 1 means high. // From Bit 0 to 6: up, down, left, right, TL, TR, TH diff --git a/emul/hw/sms/sms.c b/emul/sms/sms.c similarity index 99% rename from emul/hw/sms/sms.c rename to emul/sms/sms.c index dcf3ac7..4025973 100644 --- a/emul/hw/sms/sms.c +++ b/emul/sms/sms.c @@ -7,7 +7,7 @@ #define XK_MISCELLANY #include -#include "../../emul.h" +#include "../emul.h" #include "vdp.h" #include "port.h" #include "pad.h" diff --git a/emul/hw/sms/vdp.c b/emul/sms/vdp.c similarity index 100% rename from emul/hw/sms/vdp.c rename to emul/sms/vdp.c diff --git a/emul/hw/sms/vdp.h b/emul/sms/vdp.h similarity index 100% rename from emul/hw/sms/vdp.h rename to emul/sms/vdp.h diff --git a/emul/hw/ti/.gitignore b/emul/ti/.gitignore similarity index 100% rename from emul/hw/ti/.gitignore rename to emul/ti/.gitignore diff --git a/emul/hw/ti/Makefile b/emul/ti/Makefile similarity index 78% rename from emul/hw/ti/Makefile rename to emul/ti/Makefile index c86008e..a25bd01 100644 --- a/emul/hw/ti/Makefile +++ b/emul/ti/Makefile @@ -1,4 +1,4 @@ -EXTOBJS = ../../emul.o ../../libz80/libz80.o +EXTOBJS = ../emul.o ../libz80/libz80.o OBJS = ti84.o t6a04.o kbd.o TARGET = ti84 CFLAGS += `pkg-config --cflags xcb` @@ -7,8 +7,8 @@ LDFLAGS += `pkg-config --libs xcb` .PHONY: all all: $(TARGET) -../../emul.o: - make -C ../.. +../emul.o: + make -C .. $(TARGET): $(OBJS) $(EXTOBJS) $(CC) $(OBJS) $(EXTOBJS) -o $@ $(LDFLAGS) diff --git a/emul/hw/ti/README.md b/emul/ti/README.md similarity index 100% rename from emul/hw/ti/README.md rename to emul/ti/README.md diff --git a/emul/hw/ti/kbd.c b/emul/ti/kbd.c similarity index 100% rename from emul/hw/ti/kbd.c rename to emul/ti/kbd.c diff --git a/emul/hw/ti/kbd.h b/emul/ti/kbd.h similarity index 100% rename from emul/hw/ti/kbd.h rename to emul/ti/kbd.h diff --git a/emul/hw/ti/t6a04.c b/emul/ti/t6a04.c similarity index 100% rename from emul/hw/ti/t6a04.c rename to emul/ti/t6a04.c diff --git a/emul/hw/ti/t6a04.h b/emul/ti/t6a04.h similarity index 100% rename from emul/hw/ti/t6a04.h rename to emul/ti/t6a04.h diff --git a/emul/hw/ti/ti84.c b/emul/ti/ti84.c similarity index 99% rename from emul/hw/ti/ti84.c rename to emul/ti/ti84.c index cf4e791..8ede3e3 100644 --- a/emul/hw/ti/ti84.c +++ b/emul/ti/ti84.c @@ -14,7 +14,7 @@ #define XK_MISCELLANY #include -#include "../../emul.h" +#include "../emul.h" #include "t6a04.h" #include "kbd.h" diff --git a/recipes/rc2014/Makefile b/recipes/rc2014/Makefile index d4d26ef..b272ee0 100644 --- a/recipes/rc2014/Makefile +++ b/recipes/rc2014/Makefile @@ -4,7 +4,7 @@ CDIR = $(BASE)/cvm EDIR = $(BASE)/emul STAGE = $(CDIR)/stage BLKPACK = $(BASE)/tools/blkpack -EMUL = $(EDIR)/hw/rc2014/classic +EMUL = $(EDIR)/rc2014/classic .PHONY: all all: $(TARGET) diff --git a/recipes/sms/Makefile b/recipes/sms/Makefile index 3910b2d..26b65fe 100644 --- a/recipes/sms/Makefile +++ b/recipes/sms/Makefile @@ -1,9 +1,9 @@ TARGET = os.bin -BASE = ../../ +BASE = ../.. STAGE = $(BASE)/cvm/stage BLKPACK = $(BASE)/tools/blkpack SMSROM = $(BASE)/tools/smsrom -EMUL = $(BASE)/emul/hw/sms/sms +EMUL = $(BASE)/emul/sms/sms .PHONY: all all: $(TARGET) diff --git a/recipes/ti84/Makefile b/recipes/ti84/Makefile index 324c976..be8aa0d 100644 --- a/recipes/ti84/Makefile +++ b/recipes/ti84/Makefile @@ -3,7 +3,7 @@ BASE = ../.. CDIR = $(BASE)/cvm STAGE = $(CDIR)/stage BLKPACK = $(BASE)/tools/blkpack -EMUL = $(BASE)/emul/hw/ti/ti84 +EMUL = $(BASE)/emul/ti/ti84 MKTIUPGRADE = mktiupgrade .PHONY: all