Skip to content

Commit

Permalink
Support MACH 5
Browse files Browse the repository at this point in the history
  • Loading branch information
KimJorgensen committed Jun 30, 2024
1 parent 069a650 commit 00e19c1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ The following cartridge types are currently supported:
* Prophet64
* Freeze Frame
* Freeze Machine
* MACH 5
* Pagefox
* RGCD, Hucky
* Drean
Expand Down
2 changes: 2 additions & 0 deletions firmware/cartridges/cartridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ static void (*crt_get_handler(u32 cartridge_type, bool vic_support)) (void)
return c64gs_handler;

case CRT_WARP_SPEED:
case CRT_MACH_5:
case CRT_C128_WARP_SPEED:
return NTSC_OR_PAL_HANDLER(warpspeed);

Expand Down Expand Up @@ -158,6 +159,7 @@ static void crt_init(DAT_CRT_HEADER *crt_header)
break;

case CRT_WARP_SPEED:
case CRT_MACH_5:
case CRT_C128_WARP_SPEED:
warpspeed_init(crt_header);
break;
Expand Down
13 changes: 11 additions & 2 deletions firmware/cartridges/warpspeed.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2019-2022 Kim Jørgensen and Sven Oliver (SvOlli) Moll
* Copyright (c) 2019-2024 Kim Jørgensen and Sven Oliver (SvOlli) Moll
* Copyright (c) 2024 Lord Kopromaster
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand All @@ -26,6 +27,8 @@
* - write $DF00-$DFFF turns ROM off
* still it's twice as fast as JiffyDOS and can load to RAM at $D000-$DFFF,
* and also packs a lot of features.
*
* MACH 5 has a similar hardware setup to Warp Speed but only has an 8k bank
*/

static u32 warpspeed_on;
Expand Down Expand Up @@ -53,17 +56,23 @@ FORCE_INLINE void warpspeed_write_handler(u32 control, u32 addr, u32 data)
{
if (!(control & C64_IO1))
{
// Any write to IO1: Enable ROM
C64_CRT_CONTROL(warpspeed_on);
}
else if (!(control & C64_IO2))
{
// Any write to IO2: Disable ROM
C64_CRT_CONTROL(STATUS_LED_OFF|CRT_PORT_NONE);
}
}

static void warpspeed_init(DAT_CRT_HEADER *crt_header)
{
if (crt_header->type == CRT_WARP_SPEED)
if (crt_header->type == CRT_MACH_5)
{
warpspeed_on = STATUS_LED_ON|CRT_PORT_8K;
}
else if (crt_header->type == CRT_WARP_SPEED)
{
warpspeed_on = STATUS_LED_ON|CRT_PORT_16K;
}
Expand Down

0 comments on commit 00e19c1

Please sign in to comment.