diff --git a/.gitignore b/.gitignore index b87fe8b..54c7bd7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ *.exe *.obj .vscode/* -bld \ No newline at end of file +bld +*.dsk +*.ROM \ No newline at end of file diff --git a/Makefile b/Makefile index 8cbdd1c..967f4f4 100644 --- a/Makefile +++ b/Makefile @@ -8,14 +8,14 @@ mk_COptions = $(mk_COptionsCommon) -Os TheDefaultOutput : minivmac.exe -bld/OSGLUWIN.o : src/UI/WIN32/OSGLUWIN.c src/LANG/STRCNENG.h cfg/STRCONST.h src/INTLCHAR.h src/COMOSGLU.h src/CONTROLM.h cfg/CNFGGLOB.h +bld/OSGLUWIN.o : src/UI/WIN32/OSGLUWIN.c src/LANG/STRCNENG.h cfg/STRCONST.h src/INTLCHAR.h src/UI/COMOSGLU.h src/CONTROLM.h cfg/CNFGGLOB.h gcc "src/UI/WIN32/OSGLUWIN.c" -o "bld/OSGLUWIN.o" $(mk_COptions) bld/GLOBGLUE.o : src/GLOBGLUE.c gcc "src/GLOBGLUE.c" -o "bld/GLOBGLUE.o" $(mk_COptions) -bld/M68KITAB.o : src/M68K/M68KITAB.c cfg/CNFGGLOB.h - gcc "src/M68K/M68KITAB.c" -o "bld/M68KITAB.o" $(mk_COptions) -bld/MINEM68K.o : src/M68K/MINEM68K.c - gcc "src/M68K/MINEM68K.c" -o "bld/MINEM68K.o" $(mk_COptions) +bld/M68KITAB.o : src/HW/M68K/M68KITAB.c cfg/CNFGGLOB.h + gcc "src/HW/M68K/M68KITAB.c" -o "bld/M68KITAB.o" $(mk_COptions) +bld/MINEM68K.o : src/HW/M68K/MINEM68K.c + gcc "src/HW/M68K/MINEM68K.c" -o "bld/MINEM68K.o" $(mk_COptions) bld/VIAEMDEV.o : src/VIAEMDEV.c gcc "src/VIAEMDEV.c" -o "bld/VIAEMDEV.o" $(mk_COptions) bld/IWMEMDEV.o : src/IWMEMDEV.c @@ -32,18 +32,22 @@ bld/SONYEMDV.o : src/SONYEMDV.c gcc "src/SONYEMDV.c" -o "bld/SONYEMDV.o" $(mk_COptions) bld/SCRNEMDV.o : src/SCRNEMDV.c gcc "src/SCRNEMDV.c" -o "bld/SCRNEMDV.o" $(mk_COptions) -bld/MOUSEMDV.o : src/MOUSEMDV.c - gcc "src/MOUSEMDV.c" -o "bld/MOUSEMDV.o" $(mk_COptions) -bld/KBRDEMDV.o : src/KBRDEMDV.c - gcc "src/KBRDEMDV.c" -o "bld/KBRDEMDV.o" $(mk_COptions) +bld/MOUSEMDV.o : src/HW/MOUSE/MOUSEMDV.c + gcc "src/HW/MOUSE/MOUSEMDV.c" -o "bld/MOUSEMDV.o" $(mk_COptions) +bld/KBRDEMDV.o : src/HW/KBRD/KBRDEMDV.c + gcc "src/HW/KBRD/KBRDEMDV.c" -o "bld/KBRDEMDV.o" $(mk_COptions) bld/SNDEMDEV.o : src/SNDEMDEV.c gcc "src/SNDEMDEV.c" -o "bld/SNDEMDEV.o" $(mk_COptions) bld/PROGMAIN.o : src/PROGMAIN.c gcc "src/PROGMAIN.c" -o "bld/PROGMAIN.o" $(mk_COptions) -bld/ADBEMDEV.o : src/ADB/ADBEMDEV.c - gcc "src/ADB/ADBEMDEV.c" -o "bld/ADBEMDEV.o" $(mk_COptions) -bld/PMUEMDEV.o : src/POWERMAN/PMUEMDEV.c - gcc "src/POWERMAN/PMUEMDEV.c" -o "bld/PMUEMDEV.o" $(mk_COptions) +bld/DATE2SEC.o : src/UTIL/DATE2SEC.c + gcc "src/UTIL/DATE2SEC.c" -o "bld/DATE2SEC.o" $(mk_COptions) + +# todo: add files things that aren't the mac plus +bld/ADBEMDEV.o : src/HW/ADB/ADBEMDEV.c + gcc "src/HW/ADB/ADBEMDEV.c" -o "bld/ADBEMDEV.o" $(mk_COptions) +bld/PMUEMDEV.o : src/HW/POWERMAN/PMUEMDEV.c + gcc "src/HW/POWERMAN/PMUEMDEV.c" -o "bld/PMUEMDEV.o" $(mk_COptions) ObjFiles = \ bld/MINEM68K.o \ @@ -62,6 +66,7 @@ ObjFiles = \ bld/KBRDEMDV.o \ bld/SNDEMDEV.o \ bld/PROGMAIN.o \ + bld/DATE2SEC.o # bld/ADBEMDEV.o \ # bld/PMUEMDEV.o \ diff --git a/cfg/CNFGGLOB.h b/cfg/CNFGGLOB.h index bc925bc..0118791 100644 --- a/cfg/CNFGGLOB.h +++ b/cfg/CNFGGLOB.h @@ -2,17 +2,9 @@ Configuration options used by both platform specific and platform independent code. - This file is automatically generated by the build system, - which tries to know what options are valid in what - combinations. Avoid changing this file manually unless - you know what you're doing. + Hopefully, one day, we can remove this file entirely. */ -/* adapt to current compiler/host processor */ -#ifdef __i386__ -#error "source is configured for 64 bit compiler" -#endif - #include #define MayInline inline __attribute__((always_inline)) diff --git a/cfg/CNFGRAPI.h b/cfg/CNFGRAPI.h index b8be15c..02ea958 100644 --- a/cfg/CNFGRAPI.h +++ b/cfg/CNFGRAPI.h @@ -1,18 +1,9 @@ /* Configuration options used by platform specific code. - This file is automatically generated by the build system, - which tries to know what options are valid in what - combinations. Avoid changing this file manually unless - you know what you're doing. + Hopefully, one day, we can remove this file entirely. */ -#include -#include -#include -#include - - #define RomFileName "vMac.ROM" #define kCheckSumRom_Size 0x00020000 #define kRomCheckSum1 0x4D1EEEE1 @@ -65,17 +56,15 @@ #define NeedDoMoreCommandsMsg 1 #define NeedDoAboutMsg 1 #define UseControlKeys 1 -#define UseActvCode 0 -#define EnableDemoMsg 0 /* version and other info to display to user */ #define NeedIntlChars 0 #define ItnlKyBdFix 1 -#define kStrAppName "Mini vMac" -#define kAppVariationStr "minivmac-36.04-wx64" -#define kStrCopyrightYear "2018" -#define kMaintainerName "unknown" -#define kStrHomePage "(unknown)" +#define kStrAppName "Mini vMac (Viz)" +#define kAppVariationStr "minivmac-viz-36.04-wx64" +#define kStrCopyrightYear "2020" +#define kMaintainerName "InvisibleUp" +#define kStrHomePage "https://github.com/invisibleup/minivmac" #define kBldOpts "-br 36 -t wx64" diff --git a/src/ALTKEYSM.c b/src/ALTKEYSM.c index 25a28a0..30f39be 100644 --- a/src/ALTKEYSM.c +++ b/src/ALTKEYSM.c @@ -1,7 +1,7 @@ #include "ALTKEYSM.h" #include "SYSDEPNS.h" #include "MYOSGLUE.h" -#include "COMOSGLU.h" +#include "UI/COMOSGLU.h" #include "CONTROLM.h" #include "INTLCHAR.h" diff --git a/src/ASCEMDEV.h b/src/ASCEMDEV.h index 342277b..9a7ecd9 100644 --- a/src/ASCEMDEV.h +++ b/src/ASCEMDEV.h @@ -14,11 +14,10 @@ license for more details. */ -#ifdef ASCEMDEV_H -#error "header already included" -#else +#ifndef ASCEMDEV_H #define ASCEMDEV_H -#endif EXPORTFUNC uint32_t ASC_Access(uint32_t Data, bool WriteMem, CPTR addr); EXPORTPROC ASC_SubTick(int SubTick); + +#endif diff --git a/src/GLOBGLUE.h b/src/GLOBGLUE.h index 2b40bfa..7b8d24c 100644 --- a/src/GLOBGLUE.h +++ b/src/GLOBGLUE.h @@ -14,11 +14,8 @@ license for more details. */ -#ifdef GLOBGLUE_H -#error "header already included" -#else +#ifndef GLOBGLUE_H #define GLOBGLUE_H -#endif #define kEmMd_Twig43 0 @@ -274,3 +271,5 @@ typedef ATTer *ATTep; EXPORTFUNC uint32_t MMDV_Access(ATTep p, uint32_t Data, bool WriteMem, bool ByteSize, CPTR addr); EXPORTFUNC bool MemAccessNtfy(ATTep pT); + +#endif diff --git a/src/ADB/ADBEMDEV.c b/src/HW/ADB/ADBEMDEV.c similarity index 98% rename from src/ADB/ADBEMDEV.c rename to src/HW/ADB/ADBEMDEV.c index 102f312..744e6b4 100644 --- a/src/ADB/ADBEMDEV.c +++ b/src/HW/ADB/ADBEMDEV.c @@ -25,7 +25,7 @@ #include "GLOBGLUE.h" #endif -#include "ADB/ADBEMDEV.h" +#include "HW/ADB/ADBEMDEV.h" #ifdef _VIA_Debug #include @@ -38,7 +38,7 @@ IMPORTPROC ADB_ShiftOutData(uint8_t v); IMPORTFUNC uint8_t ADB_ShiftInData(void); -#include "ADB/ADBSHARE.h" +#include "HW/ADB/ADBSHARE.h" LOCALVAR bool ADB_ListenDatBuf; LOCALVAR uint8_t ADB_IndexDatBuf; diff --git a/src/ADB/ADBEMDEV.h b/src/HW/ADB/ADBEMDEV.h similarity index 100% rename from src/ADB/ADBEMDEV.h rename to src/HW/ADB/ADBEMDEV.h diff --git a/src/ADB/ADBSHARE.h b/src/HW/ADB/ADBSHARE.h similarity index 100% rename from src/ADB/ADBSHARE.h rename to src/HW/ADB/ADBSHARE.h diff --git a/src/KBRDEMDV.c b/src/HW/KBRD/KBRDEMDV.c similarity index 99% rename from src/KBRDEMDV.c rename to src/HW/KBRD/KBRDEMDV.c index ecc2c65..a4345b9 100644 --- a/src/KBRDEMDV.c +++ b/src/HW/KBRD/KBRDEMDV.c @@ -29,7 +29,7 @@ #include "GLOBGLUE.h" #endif -#include "KBRDEMDV.h" +#include "HW/KBRD/KBRDEMDV.h" #ifdef _VIA_Debug #include diff --git a/src/KBRDEMDV.h b/src/HW/KBRD/KBRDEMDV.h similarity index 97% rename from src/KBRDEMDV.h rename to src/HW/KBRD/KBRDEMDV.h index c068804..2ca2f13 100644 --- a/src/KBRDEMDV.h +++ b/src/HW/KBRD/KBRDEMDV.h @@ -1,5 +1,5 @@ /* - KBRDEMDV.h + HW/KBRD/KBRDEMDV.h Copyright (C) 2003 Philip Cummins, Paul C. Pratt diff --git a/src/M68K/DISAM68K.c b/src/HW/M68K/DISAM68K.c similarity index 99% rename from src/M68K/DISAM68K.c rename to src/HW/M68K/DISAM68K.c index 798975f..5317c3a 100644 --- a/src/M68K/DISAM68K.c +++ b/src/HW/M68K/DISAM68K.c @@ -26,10 +26,10 @@ #include "EMCONFIG.h" #include "GLOBGLUE.h" -#include "M68K/M68KITAB.h" +#include "HW/M68K/M68KITAB.h" #endif -#include "M68K/DISAM68K.h" +#include "HW/M68K/DISAM68K.h" LOCALVAR uint32_t Disasm_pc; diff --git a/src/M68K/DISAM68K.h b/src/HW/M68K/DISAM68K.h similarity index 92% rename from src/M68K/DISAM68K.h rename to src/HW/M68K/DISAM68K.h index ef9d28c..c0a2e58 100644 --- a/src/M68K/DISAM68K.h +++ b/src/HW/M68K/DISAM68K.h @@ -18,12 +18,10 @@ DISAssemble Motorola 68K instructions. */ -#ifdef DIS1M68K_H -#error "header already included" -#else +#ifndef DIS1M68K_H #define DIS1M68K_H -#endif EXPORTPROC DisasmOneOrSave(uint32_t pc); - EXPORTPROC m68k_WantDisasmContext(void); + +#endif diff --git a/src/M68K/M68KITAB.c b/src/HW/M68K/M68KITAB.c similarity index 99% rename from src/M68K/M68KITAB.c rename to src/HW/M68K/M68KITAB.c index bdaac3a..b866650 100644 --- a/src/M68K/M68KITAB.c +++ b/src/HW/M68K/M68KITAB.c @@ -26,7 +26,7 @@ #include "EMCONFIG.h" #include "GLOBGLUE.h" -#include "M68K/M68KITAB.h" +#include "HW/M68K/M68KITAB.h" struct WorkR { /* expected size : 8 bytes */ diff --git a/src/M68K/M68KITAB.h b/src/HW/M68K/M68KITAB.h similarity index 97% rename from src/M68K/M68KITAB.h rename to src/HW/M68K/M68KITAB.h index 198eb0f..56b2fd5 100644 --- a/src/M68K/M68KITAB.h +++ b/src/HW/M68K/M68KITAB.h @@ -14,13 +14,11 @@ license for more details. */ -#ifdef M68KITAB_H -#error "header already included" -#else +#ifndef M68KITAB_H #define M68KITAB_H -#endif enum { + // 68000 kIKindTst, kIKindCmpB, kIKindCmpW, @@ -160,8 +158,7 @@ enum { kIKindFdflt, kIKindStop, kIKindReset, - -#if Use68020 + // 68020 kIKindCallMorRtm, kIKindBraL, kIKindBccL, @@ -184,11 +181,9 @@ enum { kIKindCAS, kIKindMoveS, kIKindBitField, -#endif -#if EmMMU + // MMU kIKindMMU, -#endif -#if EmFPU + // FPU kIKindFPUmd60, kIKindFPUDBcc, kIKindFPUTrapcc, @@ -198,7 +193,6 @@ enum { kIKindFPUSave, kIKindFPURestore, kIKindFPUdflt, -#endif kNumIKinds }; @@ -277,3 +271,5 @@ typedef struct DecOpR DecOpR; #define SetDcoCycles(p, xx) ((p)->x.Cycles = (xx)) EXPORTPROC M68KITAB_setup(DecOpR *p); + +#endif \ No newline at end of file diff --git a/src/M68K/MINEM68K.c b/src/HW/M68K/MINEM68K.c similarity index 99% rename from src/M68K/MINEM68K.c rename to src/HW/M68K/MINEM68K.c index fd5ef6a..09490ae 100644 --- a/src/M68K/MINEM68K.c +++ b/src/HW/M68K/MINEM68K.c @@ -38,14 +38,14 @@ #include "EMCONFIG.h" #include "GLOBGLUE.h" -#include "M68K/M68KITAB.h" +#include "HW/M68K/M68KITAB.h" #if WantDisasm -#include "M68K/DISAM68K.h" +#include "HW/M68K/DISAM68K.h" #endif #endif -#include "M68K/MINEM68K.h" +#include "HW/M68K/MINEM68K.h" /* ReportAbnormalID unused 0x0123 - 0x01FF diff --git a/src/M68K/MINEM68K.h b/src/HW/M68K/MINEM68K.h similarity index 96% rename from src/M68K/MINEM68K.h rename to src/HW/M68K/MINEM68K.h index f066ec6..8a341b1 100644 --- a/src/M68K/MINEM68K.h +++ b/src/HW/M68K/MINEM68K.h @@ -14,11 +14,8 @@ license for more details. */ -#ifdef MINEM68K_H -#error "header already included" -#else +#ifndef MINEM68K_H #define MINEM68K_H -#endif EXPORTPROC MINEM68K_Init( uint8_t *fIPL); @@ -51,3 +48,5 @@ EXPORTPROC put_vm_long(CPTR addr, uint32_t l); EXPORTPROC SetHeadATTel(ATTep p); EXPORTFUNC ATTep FindATTel(CPTR addr); + +#endif diff --git a/src/MOUSEMDV.c b/src/HW/MOUSE/MOUSEMDV.c similarity index 97% rename from src/MOUSEMDV.c rename to src/HW/MOUSE/MOUSEMDV.c index 1ff0351..21ddf7f 100644 --- a/src/MOUSEMDV.c +++ b/src/HW/MOUSE/MOUSEMDV.c @@ -30,10 +30,10 @@ #include "EMCONFIG.h" #include "GLOBGLUE.h" #include "SCCEMDEV.h" -#include "M68K/MINEM68K.h" +#include "HW/M68K/MINEM68K.h" #endif -#include "MOUSEMDV.h" +#include "HW/MOUSE/MOUSEMDV.h" GLOBALPROC Mouse_Update(void) { diff --git a/src/MOUSEMDV.h b/src/HW/MOUSE/MOUSEMDV.h similarity index 97% rename from src/MOUSEMDV.h rename to src/HW/MOUSE/MOUSEMDV.h index 109065b..a97bc5a 100644 --- a/src/MOUSEMDV.h +++ b/src/HW/MOUSE/MOUSEMDV.h @@ -1,5 +1,5 @@ /* - MOUSEMDV.h + HW/MOUSE/MOUSEMDV.h Copyright (C) 2003 Philip Cummins, Paul C. Pratt diff --git a/src/POWERMAN/PMUEMDEV.c b/src/HW/POWERMAN/PMUEMDEV.c similarity index 99% rename from src/POWERMAN/PMUEMDEV.c rename to src/HW/POWERMAN/PMUEMDEV.c index 0cc1161..11849b8 100644 --- a/src/POWERMAN/PMUEMDEV.c +++ b/src/HW/POWERMAN/PMUEMDEV.c @@ -26,7 +26,7 @@ #include "VIAEMDEV.h" #endif -#include "POWERMAN/PMUEMDEV.h" +#include "HW/POWERMAN/PMUEMDEV.h" /* ReportAbnormalID unused 0x0E0E - 0x0EFF diff --git a/src/POWERMAN/PMUEMDEV.h b/src/HW/POWERMAN/PMUEMDEV.h similarity index 100% rename from src/POWERMAN/PMUEMDEV.h rename to src/HW/POWERMAN/PMUEMDEV.h diff --git a/src/PATCHES/HAPPYMAC/HPMCHACK.h b/src/PATCHES/HAPPYMAC/HPMCHACK.h index ff10025..85006e5 100644 --- a/src/PATCHES/HAPPYMAC/HPMCHACK.h +++ b/src/PATCHES/HAPPYMAC/HPMCHACK.h @@ -26,7 +26,7 @@ #include #include "SYSDEPNS.h" -#include "COMOSGLU.h" +#include "UI/COMOSGLU.h" // Enum of alternate icons typedef enum AHM_types { diff --git a/src/PROGMAIN.c b/src/PROGMAIN.c index dd4d2b6..e80bcfc 100644 --- a/src/PROGMAIN.c +++ b/src/PROGMAIN.c @@ -24,8 +24,8 @@ #include "UI/MYOSGLUE.h" #include "EMCONFIG.h" #include "GLOBGLUE.h" - #include "M68K/M68KITAB.h" - #include "M68K/MINEM68K.h" + #include "HW/M68K/M68KITAB.h" + #include "HW/M68K/MINEM68K.h" #include "VIAEMDEV.h" #if EmVIA2 #include "VIA2EMDV.h" @@ -43,11 +43,11 @@ #include "VIDEMDEV.h" #endif #if EmClassicKbrd - #include "KBRDEMDV.h" + #include "HW/KBRD/KBRDEMDV.h" #elif EmPMU - #include "POWERMAN/PMUEMDEV.h" + #include "HW/POWERMAN/PMUEMDEV.h" #else - #include "ADB/ADBEMDEV.h" + #include "HW/ADB/ADBEMDEV.h" #endif #if EmASC #include "ASCEMDEV.h" @@ -56,7 +56,7 @@ #include "SNDEMDEV.h" #endif #endif - #include "MOUSEMDV.h" + #include "HW/MOUSE/MOUSEMDV.h" #endif diff --git a/src/PROGMAIN.h b/src/PROGMAIN.h index 72c4b1c..fe331f2 100644 --- a/src/PROGMAIN.h +++ b/src/PROGMAIN.h @@ -15,11 +15,10 @@ license for more details. */ -#ifdef PROGMAIN_H -#error "header already included" -#else +#ifndef PROGMAIN_H #define PROGMAIN_H -#endif EXPORTPROC EmulationReserveAlloc(void); EXPORTPROC ProgramMain(void); + +#endif \ No newline at end of file diff --git a/src/ROMEMDEV.h b/src/ROMEMDEV.h index f8e9df8..f33afed 100644 --- a/src/ROMEMDEV.h +++ b/src/ROMEMDEV.h @@ -14,10 +14,9 @@ license for more details. */ -#ifdef ROMEMDEV_H -#error "header already included" -#else +#ifndef ROMEMDEV_H #define ROMEMDEV_H -#endif EXPORTFUNC bool ROM_Init(void); + +#endif \ No newline at end of file diff --git a/src/RTCEMDEV.h b/src/RTCEMDEV.h index 6818c38..8473bea 100644 --- a/src/RTCEMDEV.h +++ b/src/RTCEMDEV.h @@ -14,11 +14,8 @@ license for more details. */ -#ifdef RTCEMDEV_H -#error "header already included" -#else +#ifndef RTCEMDEV_H #define RTCEMDEV_H -#endif EXPORTFUNC bool RTC_Init(void); EXPORTPROC RTC_Interrupt(void); @@ -26,3 +23,5 @@ EXPORTPROC RTC_Interrupt(void); EXPORTPROC RTCunEnabled_ChangeNtfy(void); EXPORTPROC RTCclock_ChangeNtfy(void); EXPORTPROC RTCdataLine_ChangeNtfy(void); + +#endif \ No newline at end of file diff --git a/src/SCCEMDEV.h b/src/SCCEMDEV.h index d5d4099..531f4f8 100644 --- a/src/SCCEMDEV.h +++ b/src/SCCEMDEV.h @@ -14,11 +14,8 @@ license for more details. */ -#ifdef SCCEMDEV_H -#error "header already included" -#else +#ifndef SCCEMDEV_H #define SCCEMDEV_H -#endif EXPORTPROC SCC_Reset(void); @@ -30,3 +27,5 @@ EXPORTFUNC bool SCC_InterruptsEnabled(void); EXPORTPROC LocalTalkTick(void); EXPORTFUNC int InitLocalTalk(void); #endif + +#endif diff --git a/src/SCRNEMDV.h b/src/SCRNEMDV.h index 5d6be2b..7e4795e 100644 --- a/src/SCRNEMDV.h +++ b/src/SCRNEMDV.h @@ -15,10 +15,9 @@ license for more details. */ -#ifdef SCRNEMDV_H -#error "header already included" -#else +#ifndef SCRNEMDV_H #define SCRNEMDV_H -#endif EXPORTPROC Screen_EndTickNotify(void); + +#endif diff --git a/src/SCSIEMDV.c b/src/SCSIEMDV.c index c4ba948..cf5da2f 100644 --- a/src/SCSIEMDV.c +++ b/src/SCSIEMDV.c @@ -31,7 +31,7 @@ #include "UI/MYOSGLUE.h" #include "EMCONFIG.h" #include "GLOBGLUE.h" -#include "M68K/MINEM68K.h" +#include "HW/M68K/MINEM68K.h" #endif #include "SCSIEMDV.h" diff --git a/src/SCSIEMDV.h b/src/SCSIEMDV.h index 298f26b..4541d80 100644 --- a/src/SCSIEMDV.h +++ b/src/SCSIEMDV.h @@ -14,12 +14,11 @@ license for more details. */ -#ifdef SCSIEMDV_H -#error "header already included" -#else +#ifndef SCSIEMDV_H #define SCSIEMDV_H -#endif EXPORTPROC SCSI_Reset(void); EXPORTFUNC uint32_t SCSI_Access(uint32_t Data, bool WriteMem, CPTR addr); + +#endif diff --git a/src/SNDEMDEV.c b/src/SNDEMDEV.c index 8ee92d4..9109491 100644 --- a/src/SNDEMDEV.c +++ b/src/SNDEMDEV.c @@ -28,7 +28,7 @@ #include "UI/MYOSGLUE.h" #include "EMCONFIG.h" #include "GLOBGLUE.h" -#include "M68K/MINEM68K.h" +#include "HW/M68K/MINEM68K.h" #endif #include "SNDEMDEV.h" diff --git a/src/SONYEMDV.c b/src/SONYEMDV.c index 39c98f0..2e564f1 100644 --- a/src/SONYEMDV.c +++ b/src/SONYEMDV.c @@ -34,7 +34,7 @@ #include "ENDIANAC.h" #include "EMCONFIG.h" #include "GLOBGLUE.h" -#include "M68K/MINEM68K.h" +#include "HW/M68K/MINEM68K.h" #endif #include "SONYEMDV.h" diff --git a/src/SYSDEPNS.h b/src/SYSDEPNS.h index 8a9dc55..5a1aed8 100644 --- a/src/SYSDEPNS.h +++ b/src/SYSDEPNS.h @@ -18,11 +18,8 @@ SYStem DEPeNdencies. */ -#ifdef SYSDEPNS_H -#error "header already included" -#else +#ifndef SYSDEPNS_H #define SYSDEPNS_H -#endif #include #include @@ -127,3 +124,5 @@ typedef int32_t simr; #ifndef HaveSwapUi5r #define HaveSwapUi5r 0 #endif + +#endif \ No newline at end of file diff --git a/src/COMOSGLU.h b/src/UI/COMOSGLU.h similarity index 100% rename from src/COMOSGLU.h rename to src/UI/COMOSGLU.h diff --git a/src/UI/OSGLUCCO.m b/src/UI/MACOSX/OSGLUCCO.m similarity index 99% rename from src/UI/OSGLUCCO.m rename to src/UI/MACOSX/OSGLUCCO.m index a0f6116..0c1118d 100644 --- a/src/UI/OSGLUCCO.m +++ b/src/UI/MACOSX/OSGLUCCO.m @@ -344,7 +344,7 @@ LOCALPROC dbglog_close0(void) #define WantColorTransValid 1 -#include "COMOSGLU.h" +#include "UI/COMOSGLU.h" #define WantKeyboard_RemapMac 1 diff --git a/src/UI/MACOSX/OSGLUOSX.c b/src/UI/MACOSX/OSGLUOSX.c index 130c379..67644a3 100644 --- a/src/UI/MACOSX/OSGLUOSX.c +++ b/src/UI/MACOSX/OSGLUOSX.c @@ -895,7 +895,7 @@ LOCALPROC dbglog_close0(void) #define WantColorTransValid 1 #endif -#include "COMOSGLU.h" +#include "UI/COMOSGLU.h" /* --- time, date --- */ @@ -1947,7 +1947,7 @@ LOCALFUNC bool InitMousePosition(void) /* --- time, date, location, part 2 --- */ -#include "DATE2SEC.h" +#include "UTIL/DATE2SEC.h" LOCALFUNC bool InitLocationDat(void) { diff --git a/src/UI/MYOSGLUE.h b/src/UI/MYOSGLUE.h index b0bb645..f60bba1 100644 --- a/src/UI/MYOSGLUE.h +++ b/src/UI/MYOSGLUE.h @@ -25,13 +25,10 @@ port of vMac, by Philip Cummins. */ -#ifdef MYOSGLUE_H -#ifndef AllFiles -#error "header already included" -#endif -#else +#ifndef MYOSGLUE_H #define MYOSGLUE_H -#endif + +#include "UTIL/DATE2SEC.h" #if WantAbnormalReports @@ -439,3 +436,5 @@ EXPORTOSGLUPROC EvtQOutDone(void); #define MKC_CM 0x80 #define MKC_None 0xFF + +#endif diff --git a/src/UI/OSGLUNDS.c b/src/UI/NDS/OSGLUNDS.c similarity index 99% rename from src/UI/OSGLUNDS.c rename to src/UI/NDS/OSGLUNDS.c index 49c1ebd..d33ef3f 100644 --- a/src/UI/OSGLUNDS.c +++ b/src/UI/NDS/OSGLUNDS.c @@ -121,7 +121,7 @@ LOCALPROC WriteExtraErr(char *s) #define WantColorTransValid 0 -#include "COMOSGLU.h" +#include "UI/COMOSGLU.h" #include "CONTROLM.h" LOCALPROC NativeStrFromCStr(char *r, char *s) @@ -730,7 +730,7 @@ LOCALPROC DS_HandleKeyboard(void) LOCALVAR uint32_t TrueEmulatedTime = 0; -#include "DATE2SEC.h" +#include "UTIL/DATE2SEC.h" #define TicksPerSecond 1000000 /* #define TicksPerSecond 1000 */ diff --git a/src/UI/OLDMAC/OSGLUMAC.c b/src/UI/OLDMAC/OSGLUMAC.c index e6877ab..f824da2 100644 --- a/src/UI/OLDMAC/OSGLUMAC.c +++ b/src/UI/OLDMAC/OSGLUMAC.c @@ -742,7 +742,7 @@ LOCALPROC dbglog_close0(void) #include "INTLCHAR.h" -#include "COMOSGLU.h" +#include "UI/COMOSGLU.h" #define WantKeyboard_RemapMac 1 diff --git a/src/UI/UNIX/OSGLUXWN.c b/src/UI/UNIX/OSGLUXWN.c index 95e8d1d..f79fc76 100644 --- a/src/UI/UNIX/OSGLUXWN.c +++ b/src/UI/UNIX/OSGLUXWN.c @@ -308,7 +308,7 @@ LOCALFUNC bool NetSupportedContains(Atom x) #define WantColorTransValid 1 -#include "COMOSGLU.h" +#include "UI/COMOSGLU.h" #include "PBUFSTDC.h" @@ -2288,7 +2288,7 @@ LOCALPROC DisconnectKeyCodes3(void) LOCALVAR uint32_t TrueEmulatedTime = 0; -#include "DATE2SEC.h" +#include "UTIL/DATE2SEC.h" #define TicksPerSecond 1000000 diff --git a/src/UI/WIN32/OSGLUWIN.c b/src/UI/WIN32/OSGLUWIN.c index 6f493fd..75d5e06 100644 --- a/src/UI/WIN32/OSGLUWIN.c +++ b/src/UI/WIN32/OSGLUWIN.c @@ -28,6 +28,11 @@ The main entry point '_tWinMain' is at the end of this file. */ +#include +#include +#include +#include + #include "CNFGRAPI.h" #include "SYSDEPNS.h" #include "ENDIANAC.h" @@ -240,7 +245,7 @@ LOCALPROC dbglog_close0(void) #endif -#include "COMOSGLU.h" +#include "UI/COMOSGLU.h" #ifndef InstallFileIcons #define InstallFileIcons 0 @@ -2253,7 +2258,7 @@ LOCALFUNC bool UpdateTrueEmulatedTime(void) LOCALVAR uint32_t TimeSecBase; LOCALVAR DWORD TimeMilliBase; -#include "DATE2SEC.h" +#include "UTIL/DATE2SEC.h" LOCALFUNC bool CheckDateTime(void) { diff --git a/src/UI/XPLAT/OSGLUGTK.c b/src/UI/XPLAT/OSGLUGTK.c index 515bed5..d442d2d 100644 --- a/src/UI/XPLAT/OSGLUGTK.c +++ b/src/UI/XPLAT/OSGLUGTK.c @@ -29,7 +29,7 @@ #include "STRCONST.h" -#include "COMOSGLU.h" +#include "UI/COMOSGLU.h" /* --- some simple utilities --- */ @@ -778,7 +778,7 @@ LOCALPROC DoKeyCode(guint keycode, bool down) LOCALVAR uint32_t TrueEmulatedTime = 0; -#include "DATE2SEC.h" +#include "UTIL/DATE2SEC.h" #define TicksPerSecond 1000000 diff --git a/src/UI/XPLAT/OSGLUSD2.c b/src/UI/XPLAT/OSGLUSD2.c index c60bf63..f592752 100644 --- a/src/UI/XPLAT/OSGLUSD2.c +++ b/src/UI/XPLAT/OSGLUSD2.c @@ -168,7 +168,7 @@ LOCALPROC dbglog_close0(void) #define WantColorTransValid 0 -#include "COMOSGLU.h" +#include "UI/COMOSGLU.h" #include "PBUFSTDC.h" diff --git a/src/UI/XPLAT/OSGLUSDL.c b/src/UI/XPLAT/OSGLUSDL.c index d8a921b..1a5bf84 100644 --- a/src/UI/XPLAT/OSGLUSDL.c +++ b/src/UI/XPLAT/OSGLUSDL.c @@ -89,7 +89,7 @@ LOCALPROC dbglog_close0(void) #define WantColorTransValid 0 -#include "COMOSGLU.h" +#include "UI/COMOSGLU.h" #include "PBUFSTDC.h" diff --git a/src/DATE2SEC.h b/src/UTIL/DATE2SEC.c similarity index 54% rename from src/DATE2SEC.h rename to src/UTIL/DATE2SEC.c index f5e8c84..c0b03fc 100644 --- a/src/DATE2SEC.h +++ b/src/UTIL/DATE2SEC.c @@ -1,5 +1,5 @@ /* - DATE2SEC.h + UTIL/DATE2SEC.h Copyright (C) 2003 Bradford L. Barrett, Paul C. Pratt You can redistribute this file and/or modify it under the terms @@ -25,11 +25,6 @@ by Bradford L. Barrett. */ -#ifdef DATE2SEC_H -#error "header already included" -#else -#define DATE2SEC_H -#endif /* The function jdate was found at the end of the file @@ -49,32 +44,10 @@ copies of this or derived software. */ -/* ************************************************************* */ -/* */ -/* JDATE - Julian date calculator */ -/* */ -/* Calculates the number of days since Jan 1, 0000. */ -/* */ -/* Originally written by Bradford L. Barrett (03/17/1988) */ -/* Returns an unsigned long value representing the number of */ -/* days since January 1, 0000. */ -/* */ -/* Note: Due to the changes made by Pope Gregory XIII in the */ -/* 16th Centyry (Feb 24, 1582), dates before 1583 will */ -/* not return a truely accurate number (will be at least */ -/* 10 days off). Somehow, I don't think this will */ -/* present much of a problem for most situations :) */ -/* */ -/* Usage: days = jdate(day, month, year) */ -/* */ -/* The number returned is adjusted by 5 to facilitate day of */ -/* week calculations. The mod of the returned value gives the */ -/* day of the week the date is. (ie: dow = days % 7) where */ -/* dow will return 0=Sunday, 1=Monday, 2=Tuesday, etc... */ -/* */ -/* ************************************************************* */ +#include "SYSDEPNS.h" +#include "DATE2SEC.h" -LOCALFUNC uint32_t jdate(int day, int month, int year) +uint32_t jdate(int day, int month, int year) { uint32_t days; /* value returned */ int mtable[] = { @@ -104,7 +77,7 @@ LOCALFUNC uint32_t jdate(int day, int month, int year) return (days + 5); } -LOCALFUNC uint32_t Date2MacSeconds(int second, int minute, int hour, +uint32_t Date2MacSeconds(int second, int minute, int hour, int day, int month, int year) { uint32_t curjdate; diff --git a/src/UTIL/DATE2SEC.h b/src/UTIL/DATE2SEC.h new file mode 100644 index 0000000..b41c9a1 --- /dev/null +++ b/src/UTIL/DATE2SEC.h @@ -0,0 +1,34 @@ +#ifndef DATE2SEC_H +#define DATE2SEC_H +#include "SYSDEPNS.h" + +/* ************************************************************* */ +/* */ +/* JDATE - Julian date calculator */ +/* */ +/* Calculates the number of days since Jan 1, 0000. */ +/* */ +/* Originally written by Bradford L. Barrett (03/17/1988) */ +/* Returns an unsigned long value representing the number of */ +/* days since January 1, 0000. */ +/* */ +/* Note: Due to the changes made by Pope Gregory XIII in the */ +/* 16th Centyry (Feb 24, 1582), dates before 1583 will */ +/* not return a truely accurate number (will be at least */ +/* 10 days off). Somehow, I don't think this will */ +/* present much of a problem for most situations :) */ +/* */ +/* The number returned is adjusted by 5 to facilitate day of */ +/* week calculations. The mod of the returned value gives the */ +/* day of the week the date is. (ie: dow = days % 7) where */ +/* dow will return 0=Sunday, 1=Monday, 2=Tuesday, etc... */ +/* */ +/* ************************************************************* */ +uint32_t jdate(int day, int month, int year); + +uint32_t Date2MacSeconds( + int second, int minute, int hour, int day, int month, int year +); + + +#endif \ No newline at end of file diff --git a/src/VIA2EMDV.h b/src/VIA2EMDV.h index ddd780e..c98a567 100644 --- a/src/VIA2EMDV.h +++ b/src/VIA2EMDV.h @@ -14,11 +14,8 @@ license for more details. */ -#ifdef VIA2EMDV_H -#error "header already included" -#else +#ifndef VIA2EMDV_H #define VIA2EMDV_H -#endif EXPORTPROC VIA2_Zap(void); EXPORTPROC VIA2_Reset(void); @@ -46,3 +43,5 @@ EXPORTFUNC uint16_t VIA2_GetT1InvertTime(void); EXPORTPROC VIA2_ShiftInData(uint8_t v); EXPORTFUNC uint8_t VIA2_ShiftOutData(void); + +#endif diff --git a/src/VIAEMDEV.h b/src/VIAEMDEV.h index 89d322f..0955bd6 100644 --- a/src/VIAEMDEV.h +++ b/src/VIAEMDEV.h @@ -14,11 +14,8 @@ license for more details. */ -#ifdef VIAEMDEV_H -#error "header already included" -#else +#ifndef VIAEMDEV_H #define VIAEMDEV_H -#endif EXPORTPROC VIA1_Zap(void); EXPORTPROC VIA1_Reset(void); @@ -46,3 +43,5 @@ EXPORTFUNC uint16_t VIA1_GetT1InvertTime(void); EXPORTPROC VIA1_ShiftInData(uint8_t v); EXPORTFUNC uint8_t VIA1_ShiftOutData(void); + +#endif diff --git a/src/VIDEMDEV.c b/src/VIDEMDEV.c index 98d7db9..b22938e 100644 --- a/src/VIDEMDEV.c +++ b/src/VIDEMDEV.c @@ -33,7 +33,7 @@ #include "ENDIANAC.h" #include "EMCONFIG.h" #include "GLOBGLUE.h" -#include "M68K/MINEM68K.h" +#include "HW/M68K/MINEM68K.h" #include "SONYEMDV.h" #endif diff --git a/src/VIDEMDEV.h b/src/VIDEMDEV.h index eb935ed..a64bfb5 100644 --- a/src/VIDEMDEV.h +++ b/src/VIDEMDEV.h @@ -14,14 +14,13 @@ license for more details. */ -#ifdef VIDEMDEV_H -#error "header already included" -#else +#ifndef VIDEMDEV_H #define VIDEMDEV_H -#endif EXPORTFUNC bool Vid_Init(void); EXPORTFUNC uint16_t Vid_Reset(void); EXPORTPROC Vid_Update(void); EXPORTPROC ExtnVideo_Access(CPTR p); + +#endif