Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
07303 Media Support Major Always Apr 26, 2019, 02:37 Sep 2, 2021, 01:51
Tester star2root View Status Public Platform MAME (Self-compiled)
Assigned To AJR Resolution Fixed OS MacOS X
Status [?] Resolved Driver
Version 0.209 Fixed in Version 0.230 Build 64-bit
Fixed in Git Commit 91fc427 Github Pull Request #
Summary MESS-specific 07303: coco3 [tharogad]: The Castle of Tharogad game cartridge does not run
Description The rom pak for Castle of Tharogad drop you into Extended Color BASIC instead of launching the game. This pak worked in release 0.192 and is currently broken. I am pretty sure it stopped working when the support for 32k CoCo 3 game paks was added. Other 16k rom like Thexder still work, and all the 32k roms I have tried work, so this may be the only one not working. The disk/hacked version of Tharogad still runs fine.
Steps To Reproduce Run:
mame64 coco3 tharogad
Additional Information The reason it's not work is probably related to this code update:

--- src/mame/video/gime.cpp 2019-04-25 08:57:14.000000000 -0400
+++ src/mame/video/gime.cpp 2019-04-25 09:03:33.000000000 -0400
@@ -97,6 +97,7 @@
 #define LOG_INT_MASKING 0
 #define LOG_GIME 0
 #define LOG_TIMER 0
+#define LOG_PALETTE 0
 
 
 
@@ -558,12 +559,15 @@
  // we're in ROM
  static const uint8_t rom_map[4][4] =
  {
- { 0, 1, 6, 7 },
- { 0, 1, 6, 7 },
+ { 0, 1, 4, 5 },
+ { 0, 1, 4, 5 },
  { 0, 1, 2, 3 },
- { 4, 5, 6, 7 }
+ { 6, 7, 4, 5 }
  };
 
+ // Pin ROM page to MMU slot
+ block = (block & 0xfc) | (bank & 0x03);
+
  // look up the block in the ROM map
  block = rom_map[m_gime_registers[0] & 3][(block & 0x3F) - 0x3C];
 
@@ -1011,6 +1015,10 @@
 {
  offset &= 0x0F;
 
+ // perform logging
+ if (LOG_PALETTE)
+ logerror("%s: CoCo3 Palette: $%04x <== $%02x\n", describe_context(), offset + 0xffB0, data);
+
  /* has this entry changed? */
  if (m_palette_rotated[m_palette_rotated_position][offset] != data)
  {
--- src/mame/machine/coco_vhd.cpp 2019-04-25 08:56:28.000000000 -0400
+++ src/mame/machine/coco_vhd.cpp 2019-04-25 08:56:43.000000000 -0400
@@ -48,7 +48,7 @@
     CONSTANTS
 ***************************************************************************/
 
-#define VERBOSE 1
+#define VERBOSE 0
 
 #define VHDSTATUS_OK 0x00
 #define VHDSTATUS_NO_VHD_ATTACHED 0x02
--- src/mame/machine/6883sam.cpp 2019-04-25 08:52:28.000000000 -0400
+++ src/mame/machine/6883sam.cpp 2019-04-25 08:54:20.000000000 -0400
@@ -151,6 +151,9 @@
  /* if we're configuring a bank that never changes, update it now */
  switch(bank)
  {
+ case 3:
+ m_space_C000.point(m_banks[3], m_banks[3].m_memory_offset);
+ break;
  case 4:
  m_space_FF00.point(m_banks[4], 0x0000);
  break;
--- src/devices/bus/coco/coco_pak.cpp 2019-04-25 08:51:06.000000000 -0400
+++ src/devices/bus/coco/coco_pak.cpp 2019-04-25 08:51:45.000000000 -0400
@@ -199,7 +199,7 @@
 
 uint32_t coco_pak_banked_device::get_cart_size()
 {
- return 0x4000;
+ return 0x20000;
 }
 
 //-------------------------------------------------
Github Commit
Flags
Regression Version 0.203
Affected Sets / Systems coco3 [tharogad]
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
9
User avatar
No.16389
star2root
Viewer
Apr 28, 2019, 01:57
Removing these lines from src/mame/video/gime.cpp fixes this issue and as far as I can tell does not break any other cartridges that currently work.

- // Pin ROM page to MMU slot
- block = (block & 0xfc) | (bank & 0x03);

The rampage cartridge doesn't seem to work, but as far as I can tell, it never has worked and doesn't work with or without this change. All the other cartridges that I have tested seem to work as well as they did before, and this change allows tharogad to work.
User avatar
No.16390
star2root
Viewer
Apr 28, 2019, 02:12
Looks like Super Pitfall is also broken, but also seems to be a different problem, and I see it has been reported. So removing the two lines above still doesn't appear to break anything that is currently working, and seems to fix the Castle of Tharogad issue.
User avatar
No.16418
star2root
Viewer
May 4, 2019, 09:08
So, any comments on removing those two lines of code? I think that is the correct fix but I could be wrong.
User avatar
No.16419
Tafoid
Administrator
May 4, 2019, 11:12
Best thing to do it push the code via a PR to the MAME repository for examination and comment.
https://github.com/mamedev/mame
User avatar
No.16424
star2root
Viewer
May 4, 2019, 21:02
Is there a way to create a pull request without creating and publicly posting a fork of the entire code base? Because I don't want to do that, but I will happily share patches.
User avatar
No.18545
star2root
Viewer
Mar 14, 2021, 20:03
https://github.com/mamedev/mame/pull/7862/commits/66769187b1b6cadd77e825aae1253c007191ca55
User avatar
No.18553
AJR
Developer
Mar 15, 2021, 14:45
The cause of this bug is the initialization routine executed when the program first enters the cartridge ROM:

C000: ORCC #$50
C002: CLR $FFD9
C005: LDD #$3E3F
C008: STD $FFA4
C00B: JMP $800E

Execution then needs to continue with code from the same cartridge area having been banked where it jumps to.
User avatar
No.19201
star2root
Viewer
Sep 2, 2021, 00:10
Have any fixes for this issue been applied or is this still broken in the current version in the main branch?
User avatar
No.19204
Tafoid
Administrator
Sep 2, 2021, 01:51
Works fine here in 0.235 and current GIT.
It was resolved back in 0.230, as the bug report states and links to the fixing commit.