diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..503d6fc --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/incbin"] + path = src/incbin + url = https://github.com/graphitemaster/incbin diff --git a/src/HPMCHACK.h b/src/HPMCHACK.h deleted file mode 100644 index bbaaeb1..0000000 --- a/src/HPMCHACK.h +++ /dev/null @@ -1,261 +0,0 @@ -/* - HPMCHACK.c - - Copyright (C) 2016 Steve Chamberlin, Paul C. Pratt - - You can redistribute this file and/or modify it under the terms - of version 2 of the GNU General Public License as published by - the Free Software Foundation. You should have received a copy - of the license along with this file; see the file COPYING. - - This file is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - license for more details. -*/ - -/* - HaPpy MaCintosh Hack - - Patch the ROM for alternatives to the - Happy Macintosh icon displayed on boot - when a disk is inserted. -*/ - -#define kAHM_aside 0 -#define kAHM_cheese 1 -#define kAHM_evil 2 -#define kAHM_horror 3 -#define kAHM_lady_mac 4 -#define kAHM_moustache 5 -#define kAHM_nerdy 6 -#define kAHM_pirate 7 -#define kAHM_sleepy 8 -#define kAHM_sly 9 -#define kAHM_sunglasses 10 -#define kAHM_surprise 11 -#define kAHM_tongue 12 -#define kAHM_yuck 13 -#define kAHM_zombie 14 - -LOCALVAR const uint8_t my_HappyMac_icon[] = { -#if CurAltHappyMac == kAHM_aside - 0x00, 0x00, - 0x39, 0x38, - 0x21, 0x20, - 0x01, 0x00, - 0x01, 0x00, - 0x03, 0x00, - 0x00, 0x00, - 0x00, 0x00, - 0x07, 0x80, - 0x00, 0x00 -#endif -#if CurAltHappyMac == kAHM_cheese - 0x10, 0x10, - 0x28, 0x28, - 0x00, 0x00, - 0x00, 0x00, - 0x3F, 0xF8, - 0x20, 0x08, - 0x20, 0x08, - 0x20, 0x08, - 0x10, 0x10, - 0x0F, 0xE0, -#endif -#if CurAltHappyMac == kAHM_evil - 0x00, 0x00, - 0x10, 0x10, - 0x08, 0x20, - 0x0C, 0x60, - 0x00, 0x00, - 0x20, 0x08, - 0x20, 0x08, - 0x1F, 0xF0, - 0x00, 0x00, - 0x00, 0x00 -#endif -#if CurAltHappyMac == kAHM_horror - 0x38, 0x38, - 0x44, 0x44, - 0x44, 0x44, - 0x44, 0x44, - 0x38, 0x38, - 0x03, 0x80, - 0x03, 0x80, - 0x03, 0x80, - 0x03, 0x80, - 0x03, 0x80 -#endif -#if CurAltHappyMac == kAHM_lady_mac - 0x38, 0x38, - 0x45, 0x44, - 0x55, 0x54, - 0x45, 0x44, - 0x39, 0x38, - 0x03, 0x00, - 0x00, 0x00, - 0x00, 0x00, - 0x07, 0x80, - 0x03, 0x00 -#endif -#if CurAltHappyMac == kAHM_moustache - 0x00, 0x00, - 0x11, 0x10, - 0x11, 0x10, - 0x01, 0x00, - 0x01, 0x00, - 0x03, 0x00, - 0x1F, 0xE0, - 0x00, 0x00, - 0x08, 0x40, - 0x07, 0x80 -#endif -#if CurAltHappyMac == kAHM_nerdy - 0x38, 0x38, - 0x45, 0x45, - 0xD7, 0xD6, - 0x45, 0x44, - 0x39, 0x38, - 0x03, 0x00, - 0x00, 0x00, - 0x00, 0x00, - 0x0F, 0xC0, - 0x00, 0x00 -#endif -#if CurAltHappyMac == kAHM_pirate - 0x00, 0x81, - 0x00, 0x7E, - 0x11, 0x7E, - 0x11, 0x3C, - 0x01, 0x3C, - 0x01, 0x18, - 0x03, 0x00, - 0x00, 0x00, - 0x08, 0x40, - 0x07, 0x80 -#endif -#if CurAltHappyMac == kAHM_sleepy - 0x00, 0x00, - 0x1C, 0x70, - 0x22, 0x88, - 0x00, 0x00, - 0x1C, 0x70, - 0x08, 0x20, - 0x00, 0x00, - 0x00, 0x00, - 0x03, 0x80, - 0x00, 0x00 -#endif -#if CurAltHappyMac == kAHM_sly - 0x00, 0x00, - 0x08, 0x20, - 0x14, 0x50, - 0x00, 0x00, - 0x00, 0x00, - 0x20, 0x08, - 0x3F, 0xF8, - 0x00, 0x00, - 0x00, 0x00, - 0x00, 0x00 -#endif -#if CurAltHappyMac == kAHM_sunglasses - 0x00, 0x00, - 0xFF, 0xFE, - 0x7D, 0x7C, - 0x7D, 0x7C, - 0x39, 0x38, - 0x03, 0x00, - 0x00, 0x00, - 0x1F, 0xF0, - 0x00, 0x00, - 0x00, 0x00 -#endif -#if CurAltHappyMac == kAHM_surprise - 0x1C, 0x70, - 0x22, 0x88, - 0x41, 0x04, - 0x49, 0x24, - 0x41, 0x04, - 0x22, 0x88, - 0x1C, 0x70, - 0x01, 0x00, - 0x03, 0x80, - 0x03, 0x80 -#endif -#if CurAltHappyMac == kAHM_tongue - 0x00, 0x00, - 0x1E, 0x78, - 0x00, 0x00, - 0x00, 0x00, - 0x20, 0x04, - 0x3F, 0xFC, - 0x05, 0x40, - 0x05, 0x40, - 0x04, 0x40, - 0x03, 0x80 -#endif -#if CurAltHappyMac == kAHM_yuck - 0x00, 0x00, - 0x18, 0x30, - 0x04, 0x40, - 0x02, 0x80, - 0x00, 0x00, - 0x00, 0x00, - 0x1F, 0xF0, - 0x15, 0x50, - 0x04, 0x40, - 0x03, 0x80 -#endif -#if CurAltHappyMac == kAHM_zombie - 0x70, 0x7C, - 0x88, 0x82, - 0x88, 0x8A, - 0xA8, 0x8A, - 0x70, 0x82, - 0x00, 0x42, - 0x00, 0x3C, - 0x1E, 0x00, - 0x3F, 0x00, - 0x3F, 0x00 -#endif -}; - -#if CurEmMd <= kEmMd_Twig43 -#define HappyMacBase 0xA34 -#elif CurEmMd <= kEmMd_Twiggy -#define HappyMacBase 0x8F4 -#elif CurEmMd <= kEmMd_128K -#define HappyMacBase 0x8A0 -#elif CurEmMd <= kEmMd_Plus -#define HappyMacBase 0xFD2 -#elif CurEmMd <= kEmMd_Classic -#define HappyMacBase 0x125C -#elif CurEmMd <= kEmMd_PB100 -#define HappyMacBase 0x2BB0 -#elif (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx) -#define HappyMacBase 0x1948 -#endif - -LOCALPROC PatchHappyMac(void) -{ -#if (CurEmMd == kEmMd_PB100) \ - || (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx) - - int i; - uint8_t *dst = HappyMacBase + ROM + 0x18; - uint8_t *src = (uint8_t *)my_HappyMac_icon; - - for (i = 10; --i >= 0; ) { - ++dst; - *dst++ = *src++; - *dst++ = *src++; - ++dst; - } - -#else - MoveBytes((anyp)my_HappyMac_icon, - (anyp)(HappyMacBase + ROM), - sizeof(my_HappyMac_icon)); -#endif -} diff --git a/src/PATCHES/HAPPYMAC/HPMCHACK.h b/src/PATCHES/HAPPYMAC/HPMCHACK.h new file mode 100644 index 0000000..ff10025 --- /dev/null +++ b/src/PATCHES/HAPPYMAC/HPMCHACK.h @@ -0,0 +1,94 @@ +/* + HPMCHACK.c + + Copyright (C) 2016 Steve Chamberlin, Paul C. Pratt + + You can redistribute this file and/or modify it under the terms + of version 2 of the GNU General Public License as published by + the Free Software Foundation. You should have received a copy + of the license along with this file; see the file COPYING. + + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + license for more details. +*/ + +/* + HaPpy MaCintosh Hack + + Patch the ROM for alternatives to the + Happy Macintosh icon displayed on boot + when a disk is inserted. + + Bitmaps from http://www.bigmessowires.com/mac-rom-inator/ +*/ + +#include +#include "SYSDEPNS.h" +#include "COMOSGLU.h" + +// Enum of alternate icons +typedef enum AHM_types { + kAHM_aside, + kAHM_cheese, + kAHM_evil, + kAHM_horror, + kAHM_lady_mac, + kAHM_moustache, + kAHM_nerdy, + kAHM_pirate, + kAHM_sleepy, + kAHM_sly, + kAHM_sunglasses, + kAHM_surprise, + kAHM_tongue, + kAHM_yuck, + kAHM_zombie +} AHM_t; + +// Bitmap includes +#include "aside.xbm" +#include "cheese.xbm" +#include "evil.xbm" +#include "horror.xbm" +#include "lady.xbm" +#include "moustache.xbm" +#include "nerdy.xbm" +#include "pirate.xbm" +#include "sleepy.xbm" +#include "sly.xbm" +#include "sunglasses.xbm" +#include "surprise.xbm" +#include "tongue.xbm" +#include "yuck.xbm" +#include "zombie.xbm" + +// Lookup table +unsigned char * HMAC_BITS[] = { + HMAC_ASIDE_BITS, + HMAC_CHEESE_BITS +}; + +#if CurEmMd <= kEmMd_Twig43 +#define HappyMacBase 0xA34 +#elif CurEmMd <= kEmMd_Twiggy +#define HappyMacBase 0x8F4 +#elif CurEmMd <= kEmMd_128K +#define HappyMacBase 0x8A0 +#elif CurEmMd <= kEmMd_Plus +#define HappyMacBase 0xFD2 +#elif CurEmMd <= kEmMd_Classic +#define HappyMacBase 0x125C +#elif CurEmMd <= kEmMd_PB100 +#define HappyMacBase 0x2BB0 - 0x18 +#elif (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx) +#define HappyMacBase 0x1948 - 0x18 +#endif + +LOCALPROC PatchHappyMac(AHM_t ahm) +{ + uint8_t *dst = ROM + HappyMacBase + 0x18; + uint8_t *src = HMAC_BITS[ahm]; + memcpy(dst, src, 20); +} diff --git a/src/PATCHES/HAPPYMAC/aside.xbm b/src/PATCHES/HAPPYMAC/aside.xbm new file mode 100644 index 0000000..74081ed --- /dev/null +++ b/src/PATCHES/HAPPYMAC/aside.xbm @@ -0,0 +1,14 @@ +#define HMAC_ASIDE_WIDTH 16 +#define HMAC_ASIDE_HEIGHT 10 +static unsigned char HMAC_ASIDE_BITS[] = { + 0x00, 0x00, + 0x39, 0x38, + 0x21, 0x20, + 0x01, 0x00, + 0x01, 0x00, + 0x03, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x07, 0x80, + 0x00, 0x00 +}; \ No newline at end of file diff --git a/src/PATCHES/HAPPYMAC/cheese.xbm b/src/PATCHES/HAPPYMAC/cheese.xbm new file mode 100644 index 0000000..a677c6f --- /dev/null +++ b/src/PATCHES/HAPPYMAC/cheese.xbm @@ -0,0 +1,14 @@ +#define HMAC_CHEESE_WIDTH 16 +#define HMAC_CHEESE_HEIGHT 10 +static unsigned char HMAC_CHEESE_BITS[] = { + 0x10, 0x10, + 0x28, 0x28, + 0x00, 0x00, + 0x00, 0x00, + 0x3F, 0xF8, + 0x20, 0x08, + 0x20, 0x08, + 0x20, 0x08, + 0x10, 0x10, + 0x0F, 0xE0, +}; \ No newline at end of file diff --git a/src/PATCHES/HAPPYMAC/evil.xbm b/src/PATCHES/HAPPYMAC/evil.xbm new file mode 100644 index 0000000..46daeca --- /dev/null +++ b/src/PATCHES/HAPPYMAC/evil.xbm @@ -0,0 +1,14 @@ +#define HMAC_EVIL_WIDTH 16 +#define HMAC_EVIL_HEIGHT 10 +static unsigned char HMAC_EVIL_BITS[] = { + 0x00, 0x00, + 0x10, 0x10, + 0x08, 0x20, + 0x0C, 0x60, + 0x00, 0x00, + 0x20, 0x08, + 0x20, 0x08, + 0x1F, 0xF0, + 0x00, 0x00, + 0x00, 0x00 +}; \ No newline at end of file diff --git a/src/PATCHES/HAPPYMAC/happy-mac-options.png b/src/PATCHES/HAPPYMAC/happy-mac-options.png new file mode 100644 index 0000000..7fcb149 Binary files /dev/null and b/src/PATCHES/HAPPYMAC/happy-mac-options.png differ diff --git a/src/PATCHES/HAPPYMAC/horror.xbm b/src/PATCHES/HAPPYMAC/horror.xbm new file mode 100644 index 0000000..a8b5c40 --- /dev/null +++ b/src/PATCHES/HAPPYMAC/horror.xbm @@ -0,0 +1,14 @@ +#define HMAC_HORROR_WIDTH 16 +#define HMAC_HORROR_HEIGHT 10 +static unsigned char HMAC_HORROR_BITS[] = { + 0x38, 0x38, + 0x44, 0x44, + 0x44, 0x44, + 0x44, 0x44, + 0x38, 0x38, + 0x03, 0x80, + 0x03, 0x80, + 0x03, 0x80, + 0x03, 0x80, + 0x03, 0x80 +}; \ No newline at end of file diff --git a/src/PATCHES/HAPPYMAC/lady.xbm b/src/PATCHES/HAPPYMAC/lady.xbm new file mode 100644 index 0000000..fa4208c --- /dev/null +++ b/src/PATCHES/HAPPYMAC/lady.xbm @@ -0,0 +1,14 @@ +#define HMAC_LADY_WIDTH 16 +#define HMAC_LADY_HEIGHT 10 +static unsigned char HMAC_LADY_BITS[] = { + 0x38, 0x38, + 0x45, 0x44, + 0x55, 0x54, + 0x45, 0x44, + 0x39, 0x38, + 0x03, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x07, 0x80, + 0x03, 0x00 +}; \ No newline at end of file diff --git a/src/PATCHES/HAPPYMAC/moustache.xbm b/src/PATCHES/HAPPYMAC/moustache.xbm new file mode 100644 index 0000000..37c9871 --- /dev/null +++ b/src/PATCHES/HAPPYMAC/moustache.xbm @@ -0,0 +1,14 @@ +#define HMAC_MOUSTACHE_WIDTH 16 +#define HMAC_MOUSTACHE_HEIGHT 10 +static unsigned char HMAC_MOUSTACHE_BITS[] = { + 0x00, 0x00, + 0x11, 0x10, + 0x11, 0x10, + 0x01, 0x00, + 0x01, 0x00, + 0x03, 0x00, + 0x1F, 0xE0, + 0x00, 0x00, + 0x08, 0x40, + 0x07, 0x80 +}; \ No newline at end of file diff --git a/src/PATCHES/HAPPYMAC/nerdy.xbm b/src/PATCHES/HAPPYMAC/nerdy.xbm new file mode 100644 index 0000000..753b52e --- /dev/null +++ b/src/PATCHES/HAPPYMAC/nerdy.xbm @@ -0,0 +1,14 @@ +#define HMAC_NERDY_WIDTH 16 +#define HMAC_NERDY_HEIGHT 10 +static unsigned char HMAC_NERDY_BITS[] = { + 0x38, 0x38, + 0x45, 0x45, + 0xD7, 0xD6, + 0x45, 0x44, + 0x39, 0x38, + 0x03, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x0F, 0xC0, + 0x00, 0x00 +}; \ No newline at end of file diff --git a/src/PATCHES/HAPPYMAC/pirate.xbm b/src/PATCHES/HAPPYMAC/pirate.xbm new file mode 100644 index 0000000..cf70a0f --- /dev/null +++ b/src/PATCHES/HAPPYMAC/pirate.xbm @@ -0,0 +1,14 @@ +#define HMAC_PIRATE_WIDTH 16 +#define HMAC_PIRATE_HEIGHT 10 +static unsigned char HMAC_PIRATE_BITS[] = { + 0x00, 0x81, + 0x00, 0x7E, + 0x11, 0x7E, + 0x11, 0x3C, + 0x01, 0x3C, + 0x01, 0x18, + 0x03, 0x00, + 0x00, 0x00, + 0x08, 0x40, + 0x07, 0x80 +}; \ No newline at end of file diff --git a/src/PATCHES/HAPPYMAC/sleepy.xbm b/src/PATCHES/HAPPYMAC/sleepy.xbm new file mode 100644 index 0000000..8fe85c4 --- /dev/null +++ b/src/PATCHES/HAPPYMAC/sleepy.xbm @@ -0,0 +1,14 @@ +#define HMAC_SLEEPY_WIDTH 16 +#define HMAC_SLEEPY_HEIGHT 10 +static unsigned char HMAC_SLEEPY_BITS[] = { + 0x00, 0x00, + 0x1C, 0x70, + 0x22, 0x88, + 0x00, 0x00, + 0x1C, 0x70, + 0x08, 0x20, + 0x00, 0x00, + 0x00, 0x00, + 0x03, 0x80, + 0x00, 0x00 +}; \ No newline at end of file diff --git a/src/PATCHES/HAPPYMAC/sly.xbm b/src/PATCHES/HAPPYMAC/sly.xbm new file mode 100644 index 0000000..8777190 --- /dev/null +++ b/src/PATCHES/HAPPYMAC/sly.xbm @@ -0,0 +1,14 @@ +#define HMAC_SLY_WIDTH 16 +#define HMAC_SLY_HEIGHT 10 +static unsigned char HMAC_SLY_BITS[] = { + 0x00, 0x00, + 0x08, 0x20, + 0x14, 0x50, + 0x00, 0x00, + 0x00, 0x00, + 0x20, 0x08, + 0x3F, 0xF8, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00 +}; \ No newline at end of file diff --git a/src/PATCHES/HAPPYMAC/sunglasses.xbm b/src/PATCHES/HAPPYMAC/sunglasses.xbm new file mode 100644 index 0000000..b259fe9 --- /dev/null +++ b/src/PATCHES/HAPPYMAC/sunglasses.xbm @@ -0,0 +1,14 @@ +#define HMAC_SUNGLASSES_WIDTH 16 +#define HMAC_SUNGLASSES_HEIGHT 10 +static unsigned char HMAC_SUNGLASSES_BITS[] = { + 0x00, 0x00, + 0xFF, 0xFE, + 0x7D, 0x7C, + 0x7D, 0x7C, + 0x39, 0x38, + 0x03, 0x00, + 0x00, 0x00, + 0x1F, 0xF0, + 0x00, 0x00, + 0x00, 0x00 +}; \ No newline at end of file diff --git a/src/PATCHES/HAPPYMAC/surprise.xbm b/src/PATCHES/HAPPYMAC/surprise.xbm new file mode 100644 index 0000000..3888d45 --- /dev/null +++ b/src/PATCHES/HAPPYMAC/surprise.xbm @@ -0,0 +1,14 @@ +#define HMAC_SURPRISE_WIDTH 16 +#define HMAC_SURPRISE_HEIGHT 10 +static unsigned char HMAC_SURPRISE_BITS[] = { + 0x1C, 0x70, + 0x22, 0x88, + 0x41, 0x04, + 0x49, 0x24, + 0x41, 0x04, + 0x22, 0x88, + 0x1C, 0x70, + 0x01, 0x00, + 0x03, 0x80, + 0x03, 0x80 +}; \ No newline at end of file diff --git a/src/PATCHES/HAPPYMAC/tongue.xbm b/src/PATCHES/HAPPYMAC/tongue.xbm new file mode 100644 index 0000000..8594d3c --- /dev/null +++ b/src/PATCHES/HAPPYMAC/tongue.xbm @@ -0,0 +1,14 @@ +#define HMAC_TONGUE_WIDTH 16 +#define HMAC_TONGUE_HEIGHT 10 +static unsigned char HMAC_TONGUE_BITS[] = { + 0x00, 0x00, + 0x1E, 0x78, + 0x00, 0x00, + 0x00, 0x00, + 0x20, 0x04, + 0x3F, 0xFC, + 0x05, 0x40, + 0x05, 0x40, + 0x04, 0x40, + 0x03, 0x80 +}; \ No newline at end of file diff --git a/src/PATCHES/HAPPYMAC/yuck.xbm b/src/PATCHES/HAPPYMAC/yuck.xbm new file mode 100644 index 0000000..52a0c77 --- /dev/null +++ b/src/PATCHES/HAPPYMAC/yuck.xbm @@ -0,0 +1,14 @@ +#define HMAC_YUCK_WIDTH 16 +#define HMAC_YUCK_HEIGHT 10 +static unsigned char HMAC_YUCK_BITS[] = { + 0x00, 0x00, + 0x18, 0x30, + 0x04, 0x40, + 0x02, 0x80, + 0x00, 0x00, + 0x00, 0x00, + 0x1F, 0xF0, + 0x15, 0x50, + 0x04, 0x40, + 0x03, 0x80 +}; \ No newline at end of file diff --git a/src/PATCHES/HAPPYMAC/zombie.xbm b/src/PATCHES/HAPPYMAC/zombie.xbm new file mode 100644 index 0000000..e62d526 --- /dev/null +++ b/src/PATCHES/HAPPYMAC/zombie.xbm @@ -0,0 +1,14 @@ +#define HMAC_ZOMBIE_WIDTH 16 +#define HMAC_ZOMBIE_HEIGHT 10 +static unsigned char HMAC_ZOMBIE_BITS[] = { + 0x70, 0x7C, + 0x88, 0x82, + 0x88, 0x8A, + 0xA8, 0x8A, + 0x70, 0x82, + 0x00, 0x42, + 0x00, 0x3C, + 0x1E, 0x00, + 0x3F, 0x00, + 0x3F, 0x00 +}; \ No newline at end of file diff --git a/src/incbin b/src/incbin new file mode 160000 index 0000000..c9f3f00 --- /dev/null +++ b/src/incbin @@ -0,0 +1 @@ +Subproject commit c9f3f0091948af39e187559100d0c6c5f2f68ebc