summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/sunplus_gcm394.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/sunplus_gcm394.cpp')
-rw-r--r--src/devices/machine/sunplus_gcm394.cpp48
1 files changed, 44 insertions, 4 deletions
diff --git a/src/devices/machine/sunplus_gcm394.cpp b/src/devices/machine/sunplus_gcm394.cpp
index 01c8104568e..6e1681fa800 100644
--- a/src/devices/machine/sunplus_gcm394.cpp
+++ b/src/devices/machine/sunplus_gcm394.cpp
@@ -258,6 +258,12 @@ WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_7883_w) { LOGMASKED(LOG_GCM39
WRITE16_MEMBER(sunplus_gcm394_base_device::unkarea_78a0_w) { LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_78a0_w %04x\n", machine().describe_context(), data); m_78a0 = data; }
+READ16_MEMBER(sunplus_gcm394_base_device::unkarea_78a0_r)
+{
+ LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_78a0_r\n", machine().describe_context());
+ return machine().rand();
+}
+
READ16_MEMBER(sunplus_gcm394_base_device::unkarea_78a1_r)
{
LOGMASKED(LOG_GCM394, "%s:sunplus_gcm394_base_device::unkarea_78a1_r\n", machine().describe_context());
@@ -367,6 +373,7 @@ void sunplus_gcm394_base_device::gcm394_internal_map(address_map &map)
map(0x00702f, 0x00702f).w(m_spg_video, FUNC(gcm394_base_video_device::unk_vid2_gfxbase_msb_w)); // written with other unknown_video_device2 regs (roz layer or line layer?)
map(0x007030, 0x007030).rw(m_spg_video, FUNC(gcm394_base_video_device::video_7030_brightness_r), FUNC(gcm394_base_video_device::video_7030_brightness_w));
+ map(0x007038, 0x007038).r(m_spg_video, FUNC(gcm394_base_video_device::video_curline_r));
map(0x00703a, 0x00703a).rw(m_spg_video, FUNC(gcm394_base_video_device::video_703a_palettebank_r), FUNC(gcm394_base_video_device::video_703a_palettebank_w));
map(0x00703c, 0x00703c).w(m_spg_video, FUNC(gcm394_base_video_device::video_703c_w)); // TV Control 1
@@ -455,7 +462,7 @@ void sunplus_gcm394_base_device::gcm394_internal_map(address_map &map)
map(0x007882, 0x007882).rw(FUNC(sunplus_gcm394_base_device::unkarea_7882_r), FUNC(sunplus_gcm394_base_device::unkarea_7882_w));
map(0x007883, 0x007883).rw(FUNC(sunplus_gcm394_base_device::unkarea_7883_r), FUNC(sunplus_gcm394_base_device::unkarea_7883_w));
- map(0x0078a0, 0x0078a0).w(FUNC(sunplus_gcm394_base_device::unkarea_78a0_w));
+ map(0x0078a0, 0x0078a0).rw(FUNC(sunplus_gcm394_base_device::unkarea_78a0_r), FUNC(sunplus_gcm394_base_device::unkarea_78a0_w));
map(0x0078a1, 0x0078a1).r(FUNC(sunplus_gcm394_base_device::unkarea_78a1_r));
@@ -518,11 +525,31 @@ READ16_MEMBER(generalplus_gpac800_device::unkarea_7854_r)
// jak_tsm code looks for various 'magic values'
if (m_testval == 1)
- return 0xc2;
+ return 0x98;
else
- return 0x58;
+ return 0x79;
+
+}
+
+// 7998
+
+WRITE16_MEMBER(generalplus_gpac800_device::flash_addr_low_w)
+{
+ //logerror("%s:sunplus_gcm394_base_device::flash_addr_low_w %04x\n", machine().describe_context(), data);
+ m_flash_addr_low = data;
+}
+
+WRITE16_MEMBER(generalplus_gpac800_device::flash_addr_high_w)
+{
+ //logerror("%s:sunplus_gcm394_base_device::flash_addr_high_w %04x\n", machine().describe_context(), data);
+ m_flash_addr_high = data;
+
+ uint32_t address = (m_flash_addr_high << 16) | m_flash_addr_low;
+
+ logerror("%s: flash address is now %08x\n", machine().describe_context(), address);
}
+
// all tilemap registers etc. appear to be in the same place as the above system, including the 'extra' ones not on the earlier models
// so it's likely this is built on top of that just with NAND support
void generalplus_gpac800_device::gpac800_internal_map(address_map& map)
@@ -535,6 +562,11 @@ void generalplus_gpac800_device::gpac800_internal_map(address_map& map)
// this should be the NAND device, as the games attempt to do a DMA operation with '7854' as the source, and the target
// as the RAM location where code needs to end up before jumping to it
map(0x007850, 0x007850).r(FUNC(generalplus_gpac800_device::unkarea_7850_r)); // 'device ready' status flag?
+
+ map(0x007852, 0x007852).w(FUNC(generalplus_gpac800_device::flash_addr_low_w));
+ map(0x007853, 0x007853).w(FUNC(generalplus_gpac800_device::flash_addr_high_w));
+
+
map(0x007854, 0x007854).r(FUNC(generalplus_gpac800_device::unkarea_7854_r)); // data read port (timing appears to be important)
}
@@ -637,9 +669,17 @@ void sunplus_gcm394_base_device::device_reset()
}
+void generalplus_gpac800_device::device_reset()
+{
+ sunplus_gcm394_base_device::device_reset();
+
+ m_flash_addr_low = 0x0000;
+ m_flash_addr_high = 0x0000;
+}
+
IRQ_CALLBACK_MEMBER(sunplus_gcm394_base_device::irq_vector_cb)
{
- //printf("irq_vector_cb %d\n", irqline);
+ //logerror("irq_vector_cb %d\n", irqline);
if (irqline == UNSP_IRQ6_LINE)
set_state_unsynced(UNSP_IRQ6_LINE, CLEAR_LINE);