Skip to content

Commit

Permalink
added support for the 'Profi-DOS' cartridge by REX Datentechnik. Than…
Browse files Browse the repository at this point in the history
…ks to SubZero for providing the cartridge over 15 years ago >_<

git-svn-id: https://svn.code.sf.net/p/vice-emu/code/trunk@45471 379a1393-f5fb-40a0-bcee-ef074d9b53f7
  • Loading branch information
mrdudz committed Feb 2, 2025
1 parent 358e9fc commit 1467bc6
Show file tree
Hide file tree
Showing 9 changed files with 552 additions and 1 deletion.
78 changes: 78 additions & 0 deletions vice/doc/vice.texi
Original file line number Diff line number Diff line change
Expand Up @@ -9765,6 +9765,8 @@ Pagefox
@item
Prophet64
@item
Profi-DOS
@item
REX 256KiB EPROM Cart
@item
REX RAM-Floppy
Expand Down Expand Up @@ -10182,6 +10184,10 @@ The following cartridge types are valid:
81: Universal Cartridge 1.5
@item
82: Universal Cartridge 2
@item
83: BMP Data Turbo
@item
84: Profi-DOS
@end itemize

@vindex CartridgeFile
Expand Down Expand Up @@ -23102,6 +23108,8 @@ Prophet64 .crt file
Pagefox .crt file
@item partner64
Partner 64 .crt file
@item pd
Profi-DOS .crt file
@item rep256
REX 256KiB EPROM Cart .crt file, extra files can be inserted (1)(2)(3)
@item rgcd
Expand Down Expand Up @@ -29835,6 +29843,8 @@ $0010- xxxx - ROM data
@tab Universal Cartridge 2
@item 83
@tab BMP Data Turbo 2000
@item 84
@tab Profi-DOS
@end multitable

(*Note: Ocean type 1 includes Navy Seals, Robocop 2 & 3, Shadow of the Beast,
Expand Down Expand Up @@ -34145,6 +34155,74 @@ E0C0: 2C CA 91 AD 0A 03 AE 0B 03 8D B8 02 8E B9 02 A9 ,...............
$8000-$BFFF. ROM at $8000-$BFFF is disabled by writing into the I/O-2
area (typically $DF00) and may be re-enabled by writing into I/O-1 ($DE00).

@c @node FIXME
@subsubsection 84 - Profi-DOS

@multitable @columnfractions .3 .7
@item Size
@tab 16KiB (2 banks of 8KiB)
@item EXROM
@tab inactive (hi) (1)
@item GAME
@tab active (lo) (0)
@item Load address
@tab $E000-$FFFF
@end multitable

@example
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ASCII
----------------------------------------------- ----------------
0000: 43 36 34 20 43 41 52 54 52 49 44 47 45 20 20 20 C64 CARTRIDGE
0010: 00 00 00 40 01 00 00 54 01 00 00 00 00 00 00 00 [email protected]........
0020: 50 72 6f 66 69 2d 44 4f 53 00 00 00 00 00 00 00 Profi-DOS.......
0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0040: 43 48 49 50 00 00 20 10 00 00 00 00 e0 00 20 00 CHIP.. ....... .
0050: 8d 9d 02 a9 eb 48 a9 8e 48 ad 9c 02 48 ad 9d 02 .....H..H...H...
..
2050: 43 48 49 50 00 00 20 10 00 00 00 01 e0 00 20 00 CHIP.. ....... .
2060: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
@end example

The ROM is connected like this:

@example
Port EPROM

D7 => D6
D6 => D4
D5 => D7
D4 => D5
D3 => D0
D2 => D3
D1 => D1
D0 => D2

A0 => A0
A1 => A1
A2 => A2
A3 => A3
A4 => A4
A5 => A5
A6 => A6
A7 => A7
A8 => A12
A9 => A10
A10 => A11
A11 => A9
A12 => A8
A13 => A13
@end example

After reorganizing the ROM data as shown above, the first 8k bank of the ROM
contains the code. The second bank is used as a lookup table, and wired so
that when D0 becomes active (=0), then a counter is started which counts 4
cycles. If during those 4 cycles D1 becomes active (=0), then the EPROM is
enabled and the cartridge enables ultimax mode for ROMH. This way the cart
can patch the kernal, without having an explicit enable mechanism - which
makes it hard to dump (you'll have to know the addresses where this happens)

Any access (read or write) to IO2 ($dfxx) will disable the cartridge again.

@c @node FIXME
@subsection C128 Cartridge Specifics

Expand Down
2 changes: 2 additions & 0 deletions vice/src/c64/cart/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ libc64cart_a_SOURCES = \
pagefox.h \
partner64.c \
partner64.h \
profidos.c \
profidos.h \
prophet64.c \
prophet64.h \
ramcart.c \
Expand Down
6 changes: 6 additions & 0 deletions vice/src/c64/cart/c64cart.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
#include "pagefox.h"
#include "partner64.h"
#include "prophet64.h"
#include "profidos.h"
#include "ramlink.h"
#include "retroreplay.h"
#include "rexep256.h"
Expand Down Expand Up @@ -300,6 +301,7 @@ static cartridge_info_t cartlist[] = {
{ CARTRIDGE_NAME_P64, CARTRIDGE_P64, CARTRIDGE_GROUP_UTIL },
{ CARTRIDGE_NAME_PAGEFOX, CARTRIDGE_PAGEFOX, CARTRIDGE_GROUP_UTIL },
{ CARTRIDGE_NAME_PARTNER64, CARTRIDGE_PARTNER64, CARTRIDGE_GROUP_UTIL },
{ CARTRIDGE_NAME_PROFIDOS, CARTRIDGE_PROFIDOS, CARTRIDGE_GROUP_UTIL },
{ CARTRIDGE_NAME_RAMLINK, CARTRIDGE_RAMLINK, CARTRIDGE_GROUP_UTIL },
{ CARTRIDGE_NAME_RETRO_REPLAY, CARTRIDGE_RETRO_REPLAY, CARTRIDGE_GROUP_FREEZER },
{ CARTRIDGE_NAME_REX, CARTRIDGE_REX, CARTRIDGE_GROUP_UTIL },
Expand Down Expand Up @@ -480,6 +482,7 @@ static int set_cartridge_type(int val, void *param)
case CARTRIDGE_P64:
case CARTRIDGE_PAGEFOX:
case CARTRIDGE_PARTNER64:
case CARTRIDGE_PROFIDOS:
case CARTRIDGE_RAMLINK:
case CARTRIDGE_RETRO_REPLAY:
case CARTRIDGE_REX:
Expand Down Expand Up @@ -937,6 +940,9 @@ static int crt_attach(const char *filename, uint8_t *rawcart)
case CARTRIDGE_PARTNER64:
rc = partner64_crt_attach(fd, rawcart);
break;
case CARTRIDGE_PROFIDOS:
rc = profidos_crt_attach(fd, rawcart);
break;
case CARTRIDGE_UC1:
rc = uc1_crt_attach(fd, rawcart);
break;
Expand Down
28 changes: 28 additions & 0 deletions vice/src/c64/cart/c64carthooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
#include "pagefox.h"
#include "partner64.h"
#include "prophet64.h"
#include "profidos.h"
#include "ramcart.h"
#include "ramlink.h"
#include "retroreplay.h"
Expand Down Expand Up @@ -401,6 +402,9 @@ static const cmdline_option_t cmdline_options[] =
{ "-cartpartner64", CALL_FUNCTION, CMDLINE_ATTRIB_NEED_ARGS,
cart_attach_cmdline, (void *)CARTRIDGE_PARTNER64, NULL, NULL,
"<Name>", "Attach raw 16KiB " CARTRIDGE_NAME_PARTNER64 " cartridge image" },
{ "-cartpd", CALL_FUNCTION, CMDLINE_ATTRIB_NEED_ARGS,
cart_attach_cmdline, (void *)CARTRIDGE_PROFIDOS, NULL, NULL,
"<Name>", "Attach raw 16KiB " CARTRIDGE_NAME_PROFIDOS " cartridge image" },
{ "-cartramcart", CALL_FUNCTION, CMDLINE_ATTRIB_NEED_ARGS,
cart_attach_cmdline, (void *)CARTRIDGE_RAMCART, NULL, NULL,
"<Name>", "Attach raw RamCart cartridge image" },
Expand Down Expand Up @@ -1025,6 +1029,8 @@ int cart_bin_attach(int type, const char *filename, uint8_t *rawcart)
return pagefox_bin_attach(filename, rawcart);
case CARTRIDGE_PARTNER64:
return partner64_bin_attach(filename, rawcart);
case CARTRIDGE_PROFIDOS:
return profidos_bin_attach(filename, rawcart);
case CARTRIDGE_RETRO_REPLAY:
return retroreplay_bin_attach(filename, rawcart);
case CARTRIDGE_REX:
Expand Down Expand Up @@ -1297,6 +1303,9 @@ void cart_attach(int type, uint8_t *rawcart)
case CARTRIDGE_PARTNER64:
partner64_config_setup(rawcart);
break;
case CARTRIDGE_PROFIDOS:
profidos_config_setup(rawcart);
break;
case CARTRIDGE_RETRO_REPLAY:
retroreplay_config_setup(rawcart);
break;
Expand Down Expand Up @@ -1906,6 +1915,9 @@ void cart_detach(int type)
case CARTRIDGE_PARTNER64:
partner64_detach();
break;
case CARTRIDGE_PROFIDOS:
profidos_detach();
break;
case CARTRIDGE_RETRO_REPLAY:
retroreplay_detach();
break;
Expand Down Expand Up @@ -2211,6 +2223,9 @@ void cartridge_init_config(void)
case CARTRIDGE_PARTNER64:
partner64_config_init();
break;
case CARTRIDGE_PROFIDOS:
profidos_config_init();
break;
case CARTRIDGE_RETRO_REPLAY:
retroreplay_config_init();
break;
Expand Down Expand Up @@ -2432,6 +2447,9 @@ void cartridge_reset(void)
case CARTRIDGE_PARTNER64:
partner64_reset();
break;
case CARTRIDGE_PROFIDOS:
profidos_reset();
break;
case CARTRIDGE_REX_RAMFLOPPY:
rexramfloppy_reset();
break;
Expand Down Expand Up @@ -3632,6 +3650,11 @@ int cartridge_snapshot_write_modules(struct snapshot_s *s)
return -1;
}
break;
case CARTRIDGE_PROFIDOS:
if (profidos_snapshot_write_module(s) < 0) {
return -1;
}
break;
case CARTRIDGE_RETRO_REPLAY:
if (retroreplay_snapshot_write_module(s) < 0) {
return -1;
Expand Down Expand Up @@ -4242,6 +4265,11 @@ int cartridge_snapshot_read_modules(struct snapshot_s *s)
goto fail2;
}
break;
case CARTRIDGE_PROFIDOS:
if (profidos_snapshot_read_module(s) < 0) {
goto fail2;
}
break;
case CARTRIDGE_RETRO_REPLAY:
if (retroreplay_snapshot_read_module(s) < 0) {
goto fail2;
Expand Down
24 changes: 24 additions & 0 deletions vice/src/c64/cart/c64cartmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
#include "pagefox.h"
#include "partner64.h"
#include "prophet64.h"
#include "profidos.h"
#include "ramcart.h"
#include "ramlink.h"
#include "retroreplay.h"
Expand Down Expand Up @@ -695,6 +696,7 @@ static uint8_t roml_read_slotmain(uint16_t addr)
case CARTRIDGE_FORMEL64:
case CARTRIDGE_GAME_KILLER:
case CARTRIDGE_MAGIC_FORMEL: /* ? */
case CARTRIDGE_PROFIDOS:
/* fake ultimax hack */
return mem_read_without_ultimax(addr);
case CARTRIDGE_ACTION_REPLAY4:
Expand Down Expand Up @@ -859,6 +861,7 @@ void roml_store(uint16_t addr, uint8_t value)
case CARTRIDGE_GMOD3:
case CARTRIDGE_STARDOS:
case CARTRIDGE_MAGIC_FORMEL: /* ? */
case CARTRIDGE_PROFIDOS:
/* fake ultimax hack */
mem_store_without_ultimax(addr, value);
return;
Expand Down Expand Up @@ -945,6 +948,7 @@ static uint8_t romh_read_slotmain(uint16_t addr)
case CARTRIDGE_EXOS:
case CARTRIDGE_GMOD2:
case CARTRIDGE_STARDOS:
case CARTRIDGE_PROFIDOS:
/* fake ultimax hack, read from ram */
return ram_read(addr);
case CARTRIDGE_GMOD3:
Expand Down Expand Up @@ -1072,6 +1076,8 @@ static uint8_t ultimax_romh_read_hirom_slotmain(uint16_t addr)
return ocean_romh_read(addr);
case CARTRIDGE_PARTNER64:
return partner64_romh_read(addr);
case CARTRIDGE_PROFIDOS:
return profidos_romh_read_hirom(addr);
case CARTRIDGE_RETRO_REPLAY:
return retroreplay_romh_read(addr);
case CARTRIDGE_UC1:
Expand Down Expand Up @@ -1206,6 +1212,7 @@ void romh_store(uint16_t addr, uint8_t value)
case CARTRIDGE_GMOD3:
case CARTRIDGE_IEEEFLASH64:
case CARTRIDGE_MAGIC_FORMEL: /* ? */
case CARTRIDGE_PROFIDOS:
case CARTRIDGE_STARDOS:
case CARTRIDGE_SNAPSHOT64: /* ? */
/* fake ultimax hack, c64 ram */
Expand Down Expand Up @@ -1507,6 +1514,7 @@ static uint8_t ultimax_1000_7fff_read_slot1(uint16_t addr)
case CARTRIDGE_KINGSOFT:
case CARTRIDGE_LT_KERNAL:
case CARTRIDGE_MAGIC_FORMEL:
case CARTRIDGE_PROFIDOS:
case CARTRIDGE_STARDOS:
/* fake ultimax hack, c64 ram */
return mem_read_without_ultimax(addr);
Expand Down Expand Up @@ -1601,6 +1609,7 @@ void ultimax_1000_7fff_store(uint16_t addr, uint8_t value)
case CARTRIDGE_LT_KERNAL:
case CARTRIDGE_MAGIC_FORMEL:
case CARTRIDGE_PARTNER64:
case CARTRIDGE_PROFIDOS:
case CARTRIDGE_STARDOS:
/* fake ultimax hack, c64 ram */
mem_store_without_ultimax(addr, value);
Expand Down Expand Up @@ -1656,6 +1665,7 @@ static uint8_t ultimax_a000_bfff_read_slot1(uint16_t addr)
case CARTRIDGE_GMOD3:
case CARTRIDGE_LT_KERNAL:
case CARTRIDGE_MAGIC_FORMEL:
case CARTRIDGE_PROFIDOS:
case CARTRIDGE_STARDOS:
/* fake ultimax hack, c64 basic, ram */
return mem_read_without_ultimax(addr);
Expand Down Expand Up @@ -1762,6 +1772,7 @@ void ultimax_a000_bfff_store(uint16_t addr, uint8_t value)
case CARTRIDGE_GMOD3:
case CARTRIDGE_LT_KERNAL:
case CARTRIDGE_MAGIC_FORMEL:
case CARTRIDGE_PROFIDOS:
case CARTRIDGE_STARDOS:
/* fake ultimax hack, c64 ram */
mem_store_without_ultimax(addr, value);
Expand Down Expand Up @@ -1808,6 +1819,7 @@ static uint8_t ultimax_c000_cfff_read_slot1(uint16_t addr)
case CARTRIDGE_KINGSOFT:
case CARTRIDGE_LT_KERNAL:
case CARTRIDGE_MAGIC_FORMEL:
case CARTRIDGE_PROFIDOS:
case CARTRIDGE_STARDOS:
/* fake ultimax hack, c64 ram */
return mem_read_without_ultimax(addr);
Expand Down Expand Up @@ -1886,6 +1898,7 @@ void ultimax_c000_cfff_store(uint16_t addr, uint8_t value)
case CARTRIDGE_LT_KERNAL:
case CARTRIDGE_MAGIC_FORMEL:
case CARTRIDGE_PARTNER64:
case CARTRIDGE_PROFIDOS:
case CARTRIDGE_STARDOS:
/* fake ultimax hack, c64 ram */
mem_store_without_ultimax(addr, value);
Expand Down Expand Up @@ -1923,6 +1936,7 @@ static uint8_t ultimax_d000_dfff_read_slot1(uint16_t addr)
case CARTRIDGE_KINGSOFT:
case CARTRIDGE_LT_KERNAL:
case CARTRIDGE_MAGIC_FORMEL:
case CARTRIDGE_PROFIDOS:
case CARTRIDGE_SNAPSHOT64: /* ? */
case CARTRIDGE_STARDOS:
/* fake ultimax hack, c64 io,colram,ram */
Expand Down Expand Up @@ -1997,6 +2011,7 @@ void ultimax_d000_dfff_store(uint16_t addr, uint8_t value)
case CARTRIDGE_KINGSOFT:
case CARTRIDGE_LT_KERNAL:
case CARTRIDGE_MAGIC_FORMEL:
case CARTRIDGE_PROFIDOS:
case CARTRIDGE_SNAPSHOT64: /* ? */
case CARTRIDGE_STARDOS:
/* fake ultimax hack, c64 io,colram,ram */
Expand Down Expand Up @@ -2056,6 +2071,9 @@ static int ultimax_romh_phi1_read_slotmain(uint16_t addr, uint8_t *value)
case CARTRIDGE_MMC_REPLAY:
res = mmcreplay_romh_phi1_read(addr, value);
break;
case CARTRIDGE_PROFIDOS:
res = profidos_romh_phi1_read(addr, value);
break;
case CARTRIDGE_STARDOS:
res = stardos_romh_phi1_read(addr, value);
break;
Expand Down Expand Up @@ -2179,6 +2197,9 @@ static int ultimax_romh_phi2_read_slotmain(uint16_t addr, uint8_t *value)
case CARTRIDGE_MMC_REPLAY:
res = mmcreplay_romh_phi2_read(addr, value);
break;
case CARTRIDGE_PROFIDOS:
res = profidos_romh_phi2_read(addr, value);
break;
case CARTRIDGE_STARDOS:
res = stardos_romh_phi2_read(addr, value);
break;
Expand Down Expand Up @@ -2411,6 +2432,9 @@ static uint8_t cartridge_peek_mem_slotmain(uint16_t addr)
case CARTRIDGE_MAGIC_FORMEL:
res = magicformel_peek_mem(&export_slotmain, addr, &value);
break;
case CARTRIDGE_PROFIDOS:
res = profidos_peek_mem(&export_slotmain, addr, &value);
break;
case CARTRIDGE_RETRO_REPLAY:
res = retroreplay_peek_mem(&export_slotmain, addr, &value);
break;
Expand Down
Loading

0 comments on commit 1467bc6

Please sign in to comment.