From 4a075815b357b3c85a2c408f55da7163b6edc367 Mon Sep 17 00:00:00 2001 From: InvisibleUp Date: Sat, 1 Apr 2023 14:28:25 -0700 Subject: [PATCH] Fix compilation issues on Windows --- .gitignore | 28 +++-- .gitmodules | 3 - README.md | 11 ++ _work/target_options.h | 226 ----------------------------------------- lib/M68K/m68kgdb.c | 4 + meson.build | 4 +- src/HW/M68K | 1 - src/UI/CONTROLM.c | 2 +- src/UI/SDL2/DRIVES.c | 2 +- src/UI/SDL2/KEYBOARD.c | 2 +- src/UI/SDL2/MOUSE.c | 2 +- src/UI/SDL2/OSGLUSD2.c | 2 +- src/UI/SDL2/OSGLUSD2.h | 2 +- src/UI/SDL2/SOUND.c | 2 +- src/UI/SDL2/TIMEDATE.c | 2 +- src/UI/SDL2/VIDEO.c | 4 +- src/tomlc99 | 2 +- 17 files changed, 50 insertions(+), 249 deletions(-) delete mode 100644 _work/target_options.h delete mode 160000 src/HW/M68K diff --git a/.gitignore b/.gitignore index 35157c8..51bf488 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,27 @@ +# C/C++ *.exe *.obj -.vscode/* -bld +*.pdb + +# Mini vMac *.dsk *.ROM -*.kdev4 -*.pdb -build/ + +# Visual Studio .vs/* -make/ +.vs/ + +# Visual Studio Code +.vscode/ +.vscode/* + +# KDevelop 4 +*.kdev4 + +# Meson +build/ +builddir/ +subprojects/ + +# Working files +_work/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 01c00cb..2a682bd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,3 @@ [submodule "src/tomlc99"] path = src/tomlc99 url = https://github.com/cktan/tomlc99 -[submodule "src/HW/M68K"] - path = src/HW/M68K - url = https://github.com/kstenerud/Musashi.git diff --git a/README.md b/README.md index 7419f76..6f7de5f 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,17 @@ The configuration manager will require resources from a ROM. Here's the screen y ![Flashing ? on a ROM chip, and a message asking you to find a ROM](docs/norom-mockup.gif) +## Compiling +µvMac uses the Meson build system. See https://mesonbuild.com/ for instructions on how to download and use it. + +On Windows systems, you may need to run the following commands for SDL to work: +``` +mkdir subprojects/ +meson wrap install sdl2 +``` + +Also, for now, for the M68K core to work, you need to compile Musashi yourself. Follow the instructions in that project's README for details. + ## Legal info You can redistribute µvMac and/or modify it under the terms diff --git a/_work/target_options.h b/_work/target_options.h deleted file mode 100644 index a0b1364..0000000 --- a/_work/target_options.h +++ /dev/null @@ -1,226 +0,0 @@ -#include - -// General notes: -// Max VRAM on Mac II(x) is 2MiB - -// Supported Macintosh models -typedef enum MacModel { - mdl_Twig43, // Twiggy prototype (ROM 4.3T 07/04/83) - mdl_Twiggy, // Twiggy prototype (later) - mdl_m128K, // 128K - mdl_m512K, // 512K - mdl_m512Ke, // 512K Enhanced - mdl_Plus, // Plus - mdl_SE, // SE - mdl_SEFDHD, // SEFDHD - mdl_Classic, // Classic - mdl_PB100, // PowerBook 100 - mdl_II, // II - mdl_IIx // IIx -} MacModel_t; - -// Supported ROM types -typedef enum MacROM { - rom_Twig43, // ROM 4.3T 07/04/83 - rom_Twiggy, // Twiggy prototype (later) - rom_64K, // 128K/512K - rom_128K, // 512Ke/Plus - rom_SE, // Mac SE w/ 800k drive - rom_II, // Mac II w/ 800k drive - rom_IIx, // Mac II FDHD, IIx, IIcx - rom_PB100, // PowerBook 100 - rom_Classic // Mac Classic -} MacROM_t; - -typedef enum M68KType { - m68000, - m68020, - m68020FPU -} M68KType_t; - -// ROM information. Duplicate MacROMs are alternate ROMS also supported -struct MacROMInfo { - MacROM_t rom; - uint32_t cksum; - uint32_t size; -}; -const struct MacROMInfo MacROMInfoTable[] = { - {rom_Twig43, 0x27F4E04B, 1 << 16}, - {rom_Twiggy, 0x2884371D, 1 << 16}, - {rom_64K, 0x28BA61CE, 1 << 16}, // Mac 128K (?) - {rom_64K, 0x28BA4E50, 1 << 16}, // Mac 512K (?) - {rom_128K, 0x4D1EEEE1, 1 << 17}, // v1, 'Lonely Hearts' - {rom_128K, 0x4D1EEAE1, 1 << 17}, // v2, 'Lonely Heifers' - {rom_128K, 0x4D1F8172, 1 << 17}, // v3, 'Loud Harmonicas' - {rom_SE, 0xB2E362A8, 1 << 18}, - {rom_II, 0x97851DB6, 1 << 18}, // v1 - {rom_II, 0x9779D2C4, 1 << 18}, // v2 - {rom_IIx, 0x97221136, 1 << 18}, - {rom_PB100, 0x96645F9C, 1 << 18} -}; - -// Model information -// We're using base models for RAM and such; no addons -struct MacModelInfo { - MacModel_t MacModel; - MacROM_t MacROM; - M68KType_t M68KType; - uint32_t RAMaSize; // RAM in first address space (?) - uint32_t RAMbSize; - uint32_t RAMvidSize; // External video RAM size - uint32_t ROMBase; - uint16_t hres; - uint16_t vres; - uint8_t bpp; - uint8_t MaxATTListN; // ??? - float ClockSpeed; - bool ADB; // ADB keyboards/mice are used - bool RTC; // Real-time clock - bool PMU; // Power management unit (PB100, Mac Classic?) - bool VIA2; // Versatile Interface Adapter v2 (Mac II series, below uses VIA1) - bool ASC; // Apple Sound Chip (Mac II or PB100) - bool MMU; // True if memory mapper is present (???) - bool VidMem; // Needs external video memory on NuBus port -}; -const struct MacModelInfo MacModelInfoTable[] = { - // Twiggy, ROM 4.3 - { - .MacModel = mdl_Twig43, - .MacROM = rom_Twig43, - .M68KType = m68000, - .RAMaSize = 2 << 16, - .RAMbSize = 0, - .RAMvidSize = 0, - .hres = 512, - .vres = 384, - .bpp = 1, - .MaxATTListN = 16, - .ClockSpeed = 1, - .ADB = false, - .RTC = false, - .PMU = false, - .VIA2 = false, - .ASC = false, - .MMU = false, - }, - // Twiggy - { - .MacModel = mdl_Twiggy, - .MacROM = rom_Twiggy, - .M68KType = m68000, - .RAMaSize = 2 >> 16, - <> 16, - .RAMbSize = 0, - .RAMvidSize = 0, - .hres = 512, - .vres = 384, - .bpp = 1, - .MaxATTListN = 16, - .ClockSpeed = 1, - .ADB = false, - .RTC = false, - .PMU = false, - .VIA2 = false, - .ASC = false, - .MMU = false, - }, - // 512K - { - .MacModel = mdl_m512K, - .MacROM = rom_64K, - .M68KType = m68000, - .RAMaSize = 2 >> 19, - .RAMbSize = 0, - .RAMvidSize = 0, - .hres = 512, - .vres = 384, - .bpp = 1, - .MaxATTListN = 16, - .ClockSpeed = 1, - .ADB = false, - .RTC = false, - .PMU = false, - .VIA2 = false, - .ASC = false, - .MMU = false, - }, - // 512Ke - { - .MacModel = mdl_m512Ke, - .MacROM = rom_128K, - .M68KType = m68000, - .RAMaSize = 2 >> 19, - .RAMbSize = 0, - .RAMvidSize = 0, - .hres = 512, - .vres = 384, - .bpp = 1, - .MaxATTListN = 16, - .ClockSpeed = 1, - .ADB = false, - .RTC = false, - .PMU = false, - .VIA2 = false, - .ASC = false, - .MMU = false, - }, - // Plus - { - .MacModel = mdl_Plus, - .MacROM = rom_128K, - .M68KType = m68000, - .RAMaSize = 2 >> 19, // same RAM for SE, SEFDHD, Classic - .RAMbSize = 2 >> 19, - .RAMvidSize = 0, - .hres = 512, - .vres = 384, - .bpp = 1, - .MaxATTListN = 16, - .ClockSpeed = 1, - .ADB = false, - .RTC = false, - .PMU = false, - .VIA2 = false, - .ASC = false, - .MMU = false, - }, - // II - { - .MacModel = mdl_II, - .MacROM = rom_II, - .M68KType = m68020FPU, - .RAMaSize = 2 >> 20, // same RAM for IIx - .RAMbSize = 0, - .RAMvidSize = 2 >> 20, // 1 MB max for NuBus (256K for PB100) - .hres = 640, - .vres = 480, - .bpp = 8, - .MaxATTListN = 20, - .ClockSpeed = 2, - .ADB = false, - .RTC = false, - .PMU = false, - .VIA2 = false, - .ASC = false, - .MMU = false, - }, -}; diff --git a/lib/M68K/m68kgdb.c b/lib/M68K/m68kgdb.c index 00aae7b..ee0b1ea 100644 --- a/lib/M68K/m68kgdb.c +++ b/lib/M68K/m68kgdb.c @@ -9,7 +9,11 @@ #define GDBSTUB_PORT 4014 #include +#ifdef _WIN32 +#include +#else #include +#endif #include #include #include diff --git a/meson.build b/meson.build index e6ce271..0397f59 100644 --- a/meson.build +++ b/meson.build @@ -77,10 +77,10 @@ HW_SRC = { 'M68K': [ 'lib/M68K/m68kcpu.c', 'lib/M68K/m68kdasm.c', - 'lib/M68K/m68kops.c', 'lib/M68K/softfloat/softfloat.c', 'lib/M68K/m68khooks.c', - 'lib/M68K/m68kgdb.c', + 'lib/M68K/m68kops.c', + #'lib/M68K/m68kgdb.c', ], 'MOUSE': [ 'src/HW/MOUSE/MOUSEMDV.c', diff --git a/src/HW/M68K b/src/HW/M68K deleted file mode 160000 index 67346db..0000000 --- a/src/HW/M68K +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 67346dba6d245d48ab362dfa1d2c18075f9fbcf1 diff --git a/src/UI/CONTROLM.c b/src/UI/CONTROLM.c index 15696d0..58cdaf8 100644 --- a/src/UI/CONTROLM.c +++ b/src/UI/CONTROLM.c @@ -30,7 +30,7 @@ #include "UTIL/ENDIANAC.h" #include "UI/CONTROLM.h" -#include +#include #include "UI/SDL2/OSGLUSD2.h" /* Constants and globals */ diff --git a/src/UI/SDL2/DRIVES.c b/src/UI/SDL2/DRIVES.c index 263b5da..0e50a6d 100644 --- a/src/UI/SDL2/DRIVES.c +++ b/src/UI/SDL2/DRIVES.c @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include "CNFGRAPI.h" #include "EMCONFIG.h" #include "SYSDEPNS.h" diff --git a/src/UI/SDL2/KEYBOARD.c b/src/UI/SDL2/KEYBOARD.c index 4869672..0ae5eb0 100644 --- a/src/UI/SDL2/KEYBOARD.c +++ b/src/UI/SDL2/KEYBOARD.c @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include "CNFGRAPI.h" #include "EMCONFIG.h" #include "SYSDEPNS.h" diff --git a/src/UI/SDL2/MOUSE.c b/src/UI/SDL2/MOUSE.c index c610f3d..dcec4a9 100644 --- a/src/UI/SDL2/MOUSE.c +++ b/src/UI/SDL2/MOUSE.c @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include "CNFGRAPI.h" #include "SYSDEPNS.h" #include "UTIL/ENDIANAC.h" diff --git a/src/UI/SDL2/OSGLUSD2.c b/src/UI/SDL2/OSGLUSD2.c index 56d35b1..9e34e5e 100644 --- a/src/UI/SDL2/OSGLUSD2.c +++ b/src/UI/SDL2/OSGLUSD2.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "CNFGRAPI.h" #include "SYSDEPNS.h" #include "UTIL/ENDIANAC.h" diff --git a/src/UI/SDL2/OSGLUSD2.h b/src/UI/SDL2/OSGLUSD2.h index 8a09cb4..637cbb4 100644 --- a/src/UI/SDL2/OSGLUSD2.h +++ b/src/UI/SDL2/OSGLUSD2.h @@ -2,7 +2,7 @@ #include #include -#include +#include #include "UI/MYOSGLUE.h" /* --- defines and macros and such --- */ diff --git a/src/UI/SDL2/SOUND.c b/src/UI/SDL2/SOUND.c index c0e5fb8..a81128f 100644 --- a/src/UI/SDL2/SOUND.c +++ b/src/UI/SDL2/SOUND.c @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include "CNFGRAPI.h" #include "SYSDEPNS.h" #include "UTIL/ENDIANAC.h" diff --git a/src/UI/SDL2/TIMEDATE.c b/src/UI/SDL2/TIMEDATE.c index 42ec8f9..5664344 100644 --- a/src/UI/SDL2/TIMEDATE.c +++ b/src/UI/SDL2/TIMEDATE.c @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include "CNFGRAPI.h" #include "SYSDEPNS.h" #include "UTIL/ENDIANAC.h" diff --git a/src/UI/SDL2/VIDEO.c b/src/UI/SDL2/VIDEO.c index 7755292..b242080 100644 --- a/src/UI/SDL2/VIDEO.c +++ b/src/UI/SDL2/VIDEO.c @@ -2,8 +2,8 @@ #include #include #include -#include -#include +#include +#include #include "CNFGRAPI.h" #include "SYSDEPNS.h" #include "UTIL/ENDIANAC.h" diff --git a/src/tomlc99 b/src/tomlc99 index b539e3f..8949028 160000 --- a/src/tomlc99 +++ b/src/tomlc99 @@ -1 +1 @@ -Subproject commit b539e3f20ec443d7046153ed4623da277da89170 +Subproject commit 894902820a3ea2f1ec470cd7fe338bde54045cf5