From 1cf522779d97e15f10ad103e8f0b6d46bb8703dd Mon Sep 17 00:00:00 2001 From: Anthony Pesch Date: Sat, 10 Jun 2017 23:22:05 -0400 Subject: [PATCH] moved non-hw code out of hw dir --- CMakeLists.txt | 11 +++++------ src/{hw => }/debugger.c | 4 ++-- src/{hw => }/debugger.h | 0 src/{hw => }/dreamcast.c | 8 ++++---- src/{hw => }/dreamcast.h | 2 +- src/emulator.c | 6 +++--- src/hw/aica/aica.c | 6 +++--- src/hw/aica/aica.h | 3 +-- src/hw/arm7/arm7.c | 4 ++-- src/hw/arm7/arm7.h | 2 +- src/hw/gdrom/gdrom.c | 2 +- src/hw/gdrom/gdrom.h | 1 - src/hw/holly/holly.c | 4 ++-- src/hw/holly/holly.h | 6 ++---- src/hw/maple/controller.c | 2 +- src/hw/maple/maple.c | 2 +- src/hw/pvr/pvr.c | 4 ++-- src/hw/pvr/pvr.h | 5 ++--- src/hw/pvr/ta.c | 2 +- src/hw/pvr/ta.h | 2 +- src/hw/pvr/ta_types.h | 1 + src/hw/rom/bios.c | 2 +- src/hw/rom/bios.h | 2 +- src/hw/rom/flash.c | 2 +- src/hw/rom/flash.h | 2 +- src/hw/sh4/sh4.c | 6 +++--- src/hw/sh4/sh4.h | 4 ++-- src/hw/sh4/sh4_dbg.c | 2 +- src/hw/sh4/sh4_tmu.c | 2 +- src/{hw => }/memory.c | 4 ++-- src/{hw => }/memory.h | 0 src/{hw => }/scheduler.c | 4 ++-- src/{hw => }/scheduler.h | 0 test/test_sh4.c | 2 +- 34 files changed, 52 insertions(+), 57 deletions(-) rename src/{hw => }/debugger.c (98%) rename src/{hw => }/debugger.h (100%) rename src/{hw => }/dreamcast.c (98%) rename src/{hw => }/dreamcast.h (99%) rename src/{hw => }/memory.c (99%) rename src/{hw => }/memory.h (100%) rename src/{hw => }/scheduler.c (98%) rename src/{hw => }/scheduler.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 84093f6a..18436e94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,10 +192,6 @@ set(REDREAM_SOURCES src/hw/sh4/sh4_dmac.c src/hw/sh4/sh4_intc.c src/hw/sh4/sh4_tmu.c - src/hw/debugger.c - src/hw/dreamcast.c - src/hw/memory.c - src/hw/scheduler.c src/jit/backend/interp/interp_backend.c src/jit/frontend/armv3/armv3_context.c src/jit/frontend/armv3/armv3_disasm.c @@ -223,9 +219,12 @@ set(REDREAM_SOURCES src/sys/exception_handler.c src/sys/filesystem.c src/sys/memory.c + src/debugger.c + src/dreamcast.c src/emulator.c - src/tracer.c -) + src/memory.c + src/scheduler.c + src/tracer.c) if(PLATFORM_WINDOWS) list(APPEND REDREAM_DEFS PLATFORM_WINDOWS=1) diff --git a/src/hw/debugger.c b/src/debugger.c similarity index 98% rename from src/hw/debugger.c rename to src/debugger.c index e4257e3b..8d480838 100644 --- a/src/hw/debugger.c +++ b/src/debugger.c @@ -3,8 +3,8 @@ #include "gdb/gdb_server.h" #include "core/log.h" -#include "hw/debugger.h" -#include "hw/dreamcast.h" +#include "debugger.h" +#include "dreamcast.h" struct debugger { struct dreamcast *dc; diff --git a/src/hw/debugger.h b/src/debugger.h similarity index 100% rename from src/hw/debugger.h rename to src/debugger.h diff --git a/src/hw/dreamcast.c b/src/dreamcast.c similarity index 98% rename from src/hw/dreamcast.c rename to src/dreamcast.c index c12e1e95..8be15585 100644 --- a/src/hw/dreamcast.c +++ b/src/dreamcast.c @@ -1,19 +1,19 @@ -#include "hw/dreamcast.h" +#include "dreamcast.h" #include "core/option.h" #include "core/string.h" +#include "debugger.h" #include "hw/aica/aica.h" #include "hw/arm7/arm7.h" -#include "hw/debugger.h" #include "hw/gdrom/gdrom.h" #include "hw/holly/holly.h" #include "hw/maple/maple.h" -#include "hw/memory.h" #include "hw/pvr/pvr.h" #include "hw/pvr/ta.h" #include "hw/rom/bios.h" #include "hw/rom/flash.h" -#include "hw/scheduler.h" #include "hw/sh4/sh4.h" +#include "memory.h" +#include "scheduler.h" void dc_poll_input(struct dreamcast *dc) { if (!dc->poll_input) { diff --git a/src/hw/dreamcast.h b/src/dreamcast.h similarity index 99% rename from src/hw/dreamcast.h rename to src/dreamcast.h index ba988111..e047341b 100644 --- a/src/hw/dreamcast.h +++ b/src/dreamcast.h @@ -5,7 +5,7 @@ #include #include "core/list.h" #include "host/keycode.h" -#include "hw/memory.h" +#include "memory.h" struct aica; struct arm7; diff --git a/src/emulator.c b/src/emulator.c index cc3eb02a..276d8a31 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -14,23 +14,23 @@ #include "emulator.h" #include "core/option.h" #include "core/profiler.h" +#include "dreamcast.h" #include "host/host.h" #include "hw/aica/aica.h" #include "hw/arm7/arm7.h" -#include "hw/dreamcast.h" #include "hw/gdrom/gdrom.h" #include "hw/holly/holly.h" #include "hw/maple/maple.h" -#include "hw/memory.h" #include "hw/pvr/pvr.h" #include "hw/pvr/ta.h" #include "hw/pvr/tr.h" #include "hw/pvr/trace.h" -#include "hw/scheduler.h" #include "hw/sh4/sh4.h" +#include "memory.h" #include "render/imgui.h" #include "render/microprofile.h" #include "render/render_backend.h" +#include "scheduler.h" #include "sys/thread.h" #include "sys/time.h" diff --git a/src/hw/aica/aica.c b/src/hw/aica/aica.c index d30a2e30..a3dc3a41 100644 --- a/src/hw/aica/aica.c +++ b/src/hw/aica/aica.c @@ -3,14 +3,14 @@ #include "core/log.h" #include "core/option.h" #include "core/profiler.h" +#include "dreamcast.h" #include "hw/aica/aica_types.h" #include "hw/arm7/arm7.h" -#include "hw/dreamcast.h" #include "hw/holly/holly.h" -#include "hw/memory.h" -#include "hw/scheduler.h" #include "hw/sh4/sh4.h" +#include "memory.h" #include "render/imgui.h" +#include "scheduler.h" #include "sys/filesystem.h" DEFINE_OPTION_INT(rtc, 0, OPTION_HIDDEN); diff --git a/src/hw/aica/aica.h b/src/hw/aica/aica.h index 1f051d9c..3fc0e52c 100644 --- a/src/hw/aica/aica.h +++ b/src/hw/aica/aica.h @@ -1,8 +1,7 @@ #ifndef AICA_H #define AICA_H -#include -#include "hw/memory.h" +#include "memory.h" struct aica; struct dreamcast; diff --git a/src/hw/arm7/arm7.c b/src/hw/arm7/arm7.c index 67832085..a78cd14e 100644 --- a/src/hw/arm7/arm7.c +++ b/src/hw/arm7/arm7.c @@ -1,14 +1,14 @@ #include "hw/arm7/arm7.h" #include "core/log.h" +#include "dreamcast.h" #include "hw/aica/aica.h" -#include "hw/dreamcast.h" -#include "hw/scheduler.h" #include "jit/frontend/armv3/armv3_context.h" #include "jit/frontend/armv3/armv3_fallback.h" #include "jit/frontend/armv3/armv3_frontend.h" #include "jit/frontend/armv3/armv3_guest.h" #include "jit/ir/ir.h" #include "jit/jit.h" +#include "scheduler.h" #if ARCH_X64 #include "jit/backend/x64/x64_backend.h" diff --git a/src/hw/arm7/arm7.h b/src/hw/arm7/arm7.h index 7e87dbdf..fb74aae9 100644 --- a/src/hw/arm7/arm7.h +++ b/src/hw/arm7/arm7.h @@ -2,7 +2,7 @@ #define ARM7_H #include "core/profiler.h" -#include "hw/memory.h" +#include "memory.h" struct arm7; struct dreamcast; diff --git a/src/hw/gdrom/gdrom.c b/src/hw/gdrom/gdrom.c index 2e7d2212..68b7e6cc 100644 --- a/src/hw/gdrom/gdrom.c +++ b/src/hw/gdrom/gdrom.c @@ -1,7 +1,7 @@ #include "hw/gdrom/gdrom.h" #include "core/math.h" #include "core/string.h" -#include "hw/dreamcast.h" +#include "dreamcast.h" #include "hw/gdrom/gdrom_replies.inc" #include "hw/gdrom/gdrom_types.h" #include "hw/holly/holly.h" diff --git a/src/hw/gdrom/gdrom.h b/src/hw/gdrom/gdrom.h index 8b248683..21d615e1 100644 --- a/src/hw/gdrom/gdrom.h +++ b/src/hw/gdrom/gdrom.h @@ -1,7 +1,6 @@ #ifndef GDROM_H #define GDROM_H -#include #include "hw/gdrom/disc.h" #include "hw/gdrom/gdrom_types.h" diff --git a/src/hw/holly/holly.c b/src/hw/holly/holly.c index 9b99735d..59372ed1 100644 --- a/src/hw/holly/holly.c +++ b/src/hw/holly/holly.c @@ -1,10 +1,10 @@ #include "hw/holly/holly.h" -#include "hw/dreamcast.h" +#include "dreamcast.h" #include "hw/gdrom/gdrom.h" #include "hw/maple/maple.h" -#include "hw/scheduler.h" #include "hw/sh4/sh4.h" #include "render/imgui.h" +#include "scheduler.h" struct reg_cb holly_cb[NUM_HOLLY_REGS]; diff --git a/src/hw/holly/holly.h b/src/hw/holly/holly.h index f32cf967..e6102c1c 100644 --- a/src/hw/holly/holly.h +++ b/src/hw/holly/holly.h @@ -1,12 +1,10 @@ #ifndef HOLLY_H #define HOLLY_H -#include -#include "hw/dreamcast.h" +#include "dreamcast.h" #include "hw/holly/holly_types.h" -#include "hw/memory.h" +#include "memory.h" -struct dreamcast; struct gdrom; struct maple; struct sh4; diff --git a/src/hw/maple/controller.c b/src/hw/maple/controller.c index 2bd24502..befc098c 100644 --- a/src/hw/maple/controller.c +++ b/src/hw/maple/controller.c @@ -1,6 +1,6 @@ #include "core/option.h" #include "core/string.h" -#include "hw/dreamcast.h" +#include "dreamcast.h" #include "hw/maple/maple.h" enum { diff --git a/src/hw/maple/maple.c b/src/hw/maple/maple.c index d9dd285c..65ab4a00 100644 --- a/src/hw/maple/maple.c +++ b/src/hw/maple/maple.c @@ -1,5 +1,5 @@ #include "hw/maple/maple.h" -#include "hw/dreamcast.h" +#include "dreamcast.h" #include "hw/holly/holly.h" #include "hw/sh4/sh4.h" diff --git a/src/hw/pvr/pvr.c b/src/hw/pvr/pvr.c index ebc4a70d..db473781 100644 --- a/src/hw/pvr/pvr.c +++ b/src/hw/pvr/pvr.c @@ -1,9 +1,9 @@ #include "hw/pvr/pvr.h" -#include "hw/dreamcast.h" +#include "dreamcast.h" #include "hw/holly/holly.h" #include "hw/pvr/ta.h" -#include "hw/scheduler.h" #include "hw/sh4/sh4.h" +#include "scheduler.h" #include "sys/time.h" DEFINE_AGGREGATE_COUNTER(pvr_vblanks); diff --git a/src/hw/pvr/pvr.h b/src/hw/pvr/pvr.h index d6aefc47..7e9da7cc 100644 --- a/src/hw/pvr/pvr.h +++ b/src/hw/pvr/pvr.h @@ -1,11 +1,10 @@ #ifndef PVR_H #define PVR_H -#include #include "core/profiler.h" -#include "hw/dreamcast.h" -#include "hw/memory.h" +#include "dreamcast.h" #include "hw/pvr/pvr_types.h" +#include "memory.h" struct dreamcast; struct holly; diff --git a/src/hw/pvr/ta.c b/src/hw/pvr/ta.c index 51b44ef4..8046903d 100644 --- a/src/hw/pvr/ta.c +++ b/src/hw/pvr/ta.c @@ -5,8 +5,8 @@ #include "hw/pvr/pixel_convert.h" #include "hw/pvr/pvr.h" #include "hw/pvr/tr.h" -#include "hw/scheduler.h" #include "hw/sh4/sh4.h" +#include "scheduler.h" #include "sys/exception_handler.h" #include "sys/filesystem.h" diff --git a/src/hw/pvr/ta.h b/src/hw/pvr/ta.h index c7053e0b..f29efb28 100644 --- a/src/hw/pvr/ta.h +++ b/src/hw/pvr/ta.h @@ -2,8 +2,8 @@ #define TA_H #include "core/profiler.h" -#include "hw/memory.h" #include "hw/pvr/ta_types.h" +#include "memory.h" struct dreamcast; struct ta; diff --git a/src/hw/pvr/ta_types.h b/src/hw/pvr/ta_types.h index 14dab39e..c7dee965 100644 --- a/src/hw/pvr/ta_types.h +++ b/src/hw/pvr/ta_types.h @@ -1,6 +1,7 @@ #ifndef TA_TYPES_H #define TA_TYPES_H +#include #include "core/list.h" #include "core/rb_tree.h" diff --git a/src/hw/rom/bios.c b/src/hw/rom/bios.c index e9c4aa7e..cab7b5d1 100644 --- a/src/hw/rom/bios.c +++ b/src/hw/rom/bios.c @@ -2,7 +2,7 @@ #include "hw/rom/bios.h" #include "core/md5.h" #include "core/option.h" -#include "hw/dreamcast.h" +#include "dreamcast.h" DEFINE_OPTION_STRING(bios, "dc_boot.bin", "Path to boot rom"); diff --git a/src/hw/rom/bios.h b/src/hw/rom/bios.h index dcd245f8..715ca78b 100644 --- a/src/hw/rom/bios.h +++ b/src/hw/rom/bios.h @@ -1,7 +1,7 @@ #ifndef BIOS_H #define BIOS_H -#include "hw/memory.h" +#include "memory.h" struct dreamcast; struct bios; diff --git a/src/hw/rom/flash.c b/src/hw/rom/flash.c index 80453dca..68737187 100644 --- a/src/hw/rom/flash.c +++ b/src/hw/rom/flash.c @@ -4,7 +4,7 @@ #include #include "hw/rom/flash.h" #include "core/option.h" -#include "hw/dreamcast.h" +#include "dreamcast.h" #include "sys/filesystem.h" DEFINE_OPTION_STRING(flash, "dc_flash.bin", "Path to flash rom"); diff --git a/src/hw/rom/flash.h b/src/hw/rom/flash.h index 2d57a4c6..c9598400 100644 --- a/src/hw/rom/flash.h +++ b/src/hw/rom/flash.h @@ -1,7 +1,7 @@ #ifndef FLASH_H #define FLASH_H -#include "hw/memory.h" +#include "memory.h" struct dreamcast; struct flash; diff --git a/src/hw/sh4/sh4.c b/src/hw/sh4/sh4.c index 614d2d3e..ff9b5e52 100644 --- a/src/hw/sh4/sh4.c +++ b/src/hw/sh4/sh4.c @@ -1,21 +1,21 @@ #include "hw/sh4/sh4.h" #include "core/math.h" #include "core/string.h" +#include "dreamcast.h" #include "hw/aica/aica.h" -#include "hw/dreamcast.h" #include "hw/holly/holly.h" -#include "hw/memory.h" #include "hw/pvr/pvr.h" #include "hw/pvr/ta.h" #include "hw/rom/bios.h" #include "hw/rom/flash.h" -#include "hw/scheduler.h" #include "jit/frontend/sh4/sh4_fallback.h" #include "jit/frontend/sh4/sh4_frontend.h" #include "jit/frontend/sh4/sh4_guest.h" #include "jit/ir/ir.h" #include "jit/jit.h" +#include "memory.h" #include "render/imgui.h" +#include "scheduler.h" #include "sys/time.h" #if ARCH_X64 diff --git a/src/hw/sh4/sh4.h b/src/hw/sh4/sh4.h index 90d46ed8..e3345c8b 100644 --- a/src/hw/sh4/sh4.h +++ b/src/hw/sh4/sh4.h @@ -2,11 +2,11 @@ #define SH4_H #include "core/profiler.h" -#include "hw/dreamcast.h" -#include "hw/memory.h" +#include "dreamcast.h" #include "hw/sh4/sh4_types.h" #include "jit/frontend/sh4/sh4_context.h" #include "jit/jit.h" +#include "memory.h" struct dreamcast; struct jit; diff --git a/src/hw/sh4/sh4_dbg.c b/src/hw/sh4/sh4_dbg.c index 2f55ef03..e8115e0e 100644 --- a/src/hw/sh4/sh4_dbg.c +++ b/src/hw/sh4/sh4_dbg.c @@ -1,4 +1,4 @@ -#include "hw/debugger.h" +#include "debugger.h" #include "hw/sh4/sh4.h" #include "jit/frontend/sh4/sh4_disasm.h" #include "jit/frontend/sh4/sh4_fallback.h" diff --git a/src/hw/sh4/sh4_tmu.c b/src/hw/sh4/sh4_tmu.c index e8cdf734..81294eba 100644 --- a/src/hw/sh4/sh4_tmu.c +++ b/src/hw/sh4/sh4_tmu.c @@ -1,5 +1,5 @@ -#include "hw/scheduler.h" #include "hw/sh4/sh4.h" +#include "scheduler.h" static const int64_t PERIPHERAL_CLOCK_FREQ = SH4_CLOCK_FREQ >> 2; static const int PERIPHERAL_SCALE[] = {2, 4, 6, 8, 10, 0, 0, 0}; diff --git a/src/hw/memory.c b/src/memory.c similarity index 99% rename from src/hw/memory.c rename to src/memory.c index 3beed875..3d1b11de 100644 --- a/src/hw/memory.c +++ b/src/memory.c @@ -1,7 +1,7 @@ -#include "hw/memory.h" +#include "memory.h" #include "core/math.h" #include "core/string.h" -#include "hw/dreamcast.h" +#include "dreamcast.h" #include "sys/exception_handler.h" /* diff --git a/src/hw/memory.h b/src/memory.h similarity index 100% rename from src/hw/memory.h rename to src/memory.h diff --git a/src/hw/scheduler.c b/src/scheduler.c similarity index 98% rename from src/hw/scheduler.c rename to src/scheduler.c index 3c77cb82..c163d6d4 100644 --- a/src/hw/scheduler.c +++ b/src/scheduler.c @@ -1,9 +1,9 @@ #include -#include "hw/scheduler.h" +#include "scheduler.h" #include "core/assert.h" #include "core/core.h" #include "core/list.h" -#include "hw/dreamcast.h" +#include "dreamcast.h" #define MAX_TIMERS 128 diff --git a/src/hw/scheduler.h b/src/scheduler.h similarity index 100% rename from src/hw/scheduler.h rename to src/scheduler.h diff --git a/test/test_sh4.c b/test/test_sh4.c index b5dd63af..43e31105 100644 --- a/test/test_sh4.c +++ b/test/test_sh4.c @@ -1,5 +1,5 @@ #include "core/math.h" -#include "hw/dreamcast.h" +#include "dreamcast.h" #include "hw/sh4/sh4.h" #include "retest.h"