From 6cd6b3a2c11c6d910ae2a4eb98670fdaf2f04894 Mon Sep 17 00:00:00 2001 From: tim lindner Date: Wed, 3 Oct 2018 09:34:04 -0700 Subject: [PATCH] General CoCo Cartridge Fixes (#4050) * Fixed 16k cartridge banking for all CoCos. Fixed 32k external ROM mode for CoCo 3 * Turned off some logging --- src/devices/bus/coco/coco_pak.cpp | 2 +- src/mame/machine/6883sam.cpp | 3 +++ src/mame/machine/coco_vhd.cpp | 2 +- src/mame/video/gime.cpp | 15 ++++++++++++--- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/devices/bus/coco/coco_pak.cpp b/src/devices/bus/coco/coco_pak.cpp index 6605a992f14..7c184dc67ad 100644 --- a/src/devices/bus/coco/coco_pak.cpp +++ b/src/devices/bus/coco/coco_pak.cpp @@ -199,7 +199,7 @@ uint8_t *coco_pak_banked_device::get_cart_base() uint32_t coco_pak_banked_device::get_cart_size() { - return 0x4000; + return 0x20000; } //------------------------------------------------- diff --git a/src/mame/machine/6883sam.cpp b/src/mame/machine/6883sam.cpp index 03d86b20a1f..3f455fc3954 100644 --- a/src/mame/machine/6883sam.cpp +++ b/src/mame/machine/6883sam.cpp @@ -156,6 +156,9 @@ void sam6883_device::configure_bank(int bank, uint8_t *memory, uint32_t memory_s /* 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; diff --git a/src/mame/machine/coco_vhd.cpp b/src/mame/machine/coco_vhd.cpp index 2384127346e..c75e278caee 100644 --- a/src/mame/machine/coco_vhd.cpp +++ b/src/mame/machine/coco_vhd.cpp @@ -48,7 +48,7 @@ CONSTANTS ***************************************************************************/ -#define VERBOSE 1 +#define VERBOSE 0 #define VHDSTATUS_OK 0x00 #define VHDSTATUS_NO_VHD_ATTACHED 0x02 diff --git a/src/mame/video/gime.cpp b/src/mame/video/gime.cpp index 71086db95c7..db8265c0b89 100644 --- a/src/mame/video/gime.cpp +++ b/src/mame/video/gime.cpp @@ -86,6 +86,7 @@ + //************************************************************************** // CONSTANTS //************************************************************************** @@ -97,6 +98,7 @@ #define LOG_INT_MASKING 0 #define LOG_GIME 0 #define LOG_TIMER 0 +#define LOG_PALETTE 0 @@ -552,12 +554,15 @@ void gime_device::update_memory(int bank) // 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]; @@ -1005,6 +1010,10 @@ inline void gime_device::write_palette_register(offs_t offset, uint8_t data) { 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) {