diff options
author | David Haywood <28625134+DavidHaywood@users.noreply.github.com> | 2020-03-09 17:37:58 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-09 18:37:58 +0100 |
commit | 848cc70191b6dd4804dd7f6967a46383baca1ed9 (patch) | |
tree | 740047b39dcb8b418642d6f4390c80c8da0fef77 /src/devices | |
parent | 0f5d9704430be08691749593b25edc8f783810e2 (diff) |
Plug and Play work (#6411)
New machines marked as NOT_WORKING
----------------------------------
Power Rangers Force In Time (JAKKS Pacific TV Motion Game) [Sean Riddle, Kev (FBN)]
Domyos Step Concept (Domyos Interactive System) [Sean Riddle, 404_11]
Tinker Bell and the Lost Treasure (JAKKS Pacific TV Motion Game) [Sean Riddle, David Haywood]
Phineas and Ferb: Best Game Ever! (JAKKS Pacific TV Motion Game) [Sean Riddle, David Haywood]
* some paccon visual improvements (nw)
* some bits for gormiti (nw)
* this seems to be # of sprites to draw, paccon uses it extensively (nw)
* realistic address mode select (nw)
* notes on flipping (nw)
Diffstat (limited to 'src/devices')
-rw-r--r-- | src/devices/machine/sunplus_gcm394.cpp | 2 | ||||
-rw-r--r-- | src/devices/machine/sunplus_gcm394_video.cpp | 95 | ||||
-rw-r--r-- | src/devices/machine/sunplus_gcm394_video.h | 1 |
3 files changed, 76 insertions, 22 deletions
diff --git a/src/devices/machine/sunplus_gcm394.cpp b/src/devices/machine/sunplus_gcm394.cpp index d48e110787c..ceef80a6776 100644 --- a/src/devices/machine/sunplus_gcm394.cpp +++ b/src/devices/machine/sunplus_gcm394.cpp @@ -701,6 +701,8 @@ void sunplus_gcm394_base_device::base_internal_map(address_map &map) map(0x007087, 0x007087).w(m_spg_video, FUNC(gcm394_base_video_device::video_7087_w)); map(0x007088, 0x007088).w(m_spg_video, FUNC(gcm394_base_video_device::video_7088_w)); + map(0x0070e0, 0x0070e0).r(m_spg_video, FUNC(gcm394_base_video_device::video_70e0_r)); // gormiti checks this + // ###################################################################################################################################################################################### // 73xx-77xx = video ram // ###################################################################################################################################################################################### diff --git a/src/devices/machine/sunplus_gcm394_video.cpp b/src/devices/machine/sunplus_gcm394_video.cpp index e91061dc94b..34eb17c3d32 100644 --- a/src/devices/machine/sunplus_gcm394_video.cpp +++ b/src/devices/machine/sunplus_gcm394_video.cpp @@ -365,6 +365,17 @@ void gcm394_base_video_device::draw(const rectangle &cliprect, uint32_t line, ui { words_per_tile = 8; // seems to be correct for sprites regardless of size / bpp on smartfp } + + int x_max; + if (m_707f & 0x0010) + { + x_max = 0x400; + } + else + { + x_max = 0x200; + } + uint32_t m = (bitmap_addr) + (words_per_tile * tile + bits_per_row * (line ^ yflipmask)); @@ -428,9 +439,9 @@ void gcm394_base_video_device::draw(const rectangle &cliprect, uint32_t line, ui if (RowScroll) xx -= 0;// (int16_t)m_scrollram[yy & 0x1ff]; - //xx &= 0x01ff; - //if (xx >= 0x01c0) - // xx -= 0x0200; + xx &= (x_max-1); + if (xx >= (x_max-0x40)) + xx -= x_max; if (xx >= 0 && xx <= cliprect.max_x) { @@ -686,7 +697,7 @@ void gcm394_base_video_device::draw_page(const rectangle &cliprect, uint32_t sca } -void gcm394_base_video_device::draw_sprite(const rectangle &cliprect, uint32_t scanline, int priority, uint32_t base_addr) +void gcm394_base_video_device::draw_sprite(const rectangle& cliprect, uint32_t scanline, int priority, uint32_t base_addr) { uint32_t bitmap_addr = (m_sprite_702d_gfxbase_msb << 16) | m_sprite_7022_gfxbase_lsb; uint32_t tile = m_spriteram[base_addr + 0]; @@ -702,14 +713,29 @@ void gcm394_base_video_device::draw_sprite(const rectangle &cliprect, uint32_t s int addressing_mode = 0; - // m_7042_sprite is f7 on smartfp - // 01 on wrlshunt - // this is not enough to conclude anything + int screenwidth, screenheight, x_max; + if (m_707f & 0x0010) + { + screenwidth = 640; + screenheight = 480; + x_max = 0x400; + } + else + { + screenwidth = 320; + screenheight = 240; + x_max = 0x200; + } - if (m_7042_sprite == 0x01) + + // good for gormiti, smartfp, wrlshunt, paccon, jak_totm, jak_s500, jak_gtg + if ((m_7042_sprite & 0x0010) == 0x10) + addressing_mode = 0; // smartfp, paccon + else addressing_mode = 1; - tile |= m_spriteextra[base_addr / 4] << 16; + if (addressing_mode == 0) // smartfp, paccon + tile |= m_spriteextra[base_addr / 4] << 16; if (((attr & PAGE_PRIORITY_FLAG_MASK) >> PAGE_PRIORITY_FLAG_SHIFT) != priority) { @@ -719,15 +745,16 @@ void gcm394_base_video_device::draw_sprite(const rectangle &cliprect, uint32_t s const uint32_t h = 8 << ((attr & PAGE_TILE_HEIGHT_MASK) >> PAGE_TILE_HEIGHT_SHIFT); const uint32_t w = 8 << ((attr & PAGE_TILE_WIDTH_MASK) >> PAGE_TILE_WIDTH_SHIFT); - /* - if (!(m_video_regs[0x42] & SPRITE_COORD_TL_MASK)) + + + if (!(m_7042_sprite & SPRITE_COORD_TL_MASK)) { - x = (160 + x) - w / 2; - y = (120 - y) - (h / 2) + 8; + x = ((screenwidth / 2) + x) - w / 2; + y = ((screenheight / 2) - y) - (h / 2) + 8; } - */ - x &= 0x01ff; + + x &= (x_max - 1); y &= 0x01ff; uint32_t tile_line = ((scanline - y) + 0x200) % h; @@ -742,17 +769,26 @@ void gcm394_base_video_device::draw_sprite(const rectangle &cliprect, uint32_t s bool blend = (attr & 0x4000); - bool flip_x = false; + bool flip_x; + uint8_t bpp; + uint32_t yflipmask; + uint32_t palette_offset; // different attribute use? - if (addressing_mode == 0) + if (addressing_mode == 0) // smartfp, paccon { flip_x = (attr & TILE_X_FLIP); + bpp = attr & 0x0003; + yflipmask = attr & TILE_Y_FLIP ? h - 1 : 0; + palette_offset = (attr & 0x0f00) >> 4; + } + else + { + flip_x = 0;// (attr & TILE_X_FLIP); // wrlshunt, jak_totm, jak_s550 do not want this to be flip bit, gormiti does. also configurable, or error in spriteram content? + bpp = attr & 0x0003; + yflipmask = 0;// attr& TILE_Y_FLIP ? h - 1 : 0; // see flipx comment + palette_offset = (attr & 0x0f00) >> 4; } - - const uint8_t bpp = attr & 0x0003; - const uint32_t yflipmask = attr & TILE_Y_FLIP ? h - 1 : 0; - uint32_t palette_offset = (attr & 0x0f00) >> 4; //palette_offset |= 0x0d00; palette_offset |= 0x0500; @@ -775,7 +811,12 @@ void gcm394_base_video_device::draw_sprite(const rectangle &cliprect, uint32_t s void gcm394_base_video_device::draw_sprites(const rectangle &cliprect, uint32_t scanline, int priority) { - for (uint32_t n = 0; n < 0x100; n++) + // paccon suggests this, does older hardware have similar? + int numsprites = (m_7042_sprite & 0xff00) >> 8; + if (numsprites == 0) + numsprites = 0x100; + + for (uint32_t n = 0; n < numsprites; n++) { draw_sprite(cliprect, scanline, priority, 4 * n); } @@ -1282,6 +1323,8 @@ WRITE16_MEMBER(gcm394_base_video_device::video_707f_w) } m_707f = data; + + //popmessage("707f is %04x\n", data); } READ16_MEMBER(gcm394_base_video_device::video_703a_palettebank_r) @@ -1408,6 +1451,14 @@ READ16_MEMBER(gcm394_base_video_device::video_7051_r) return retdat; } +READ16_MEMBER(gcm394_base_video_device::video_70e0_r) +{ + uint16_t retdat = machine().rand(); + LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::video_70e0_r (returning %04x)\n", machine().describe_context(), retdat); + return retdat; +} + + // this block get set once, in a single function, could be important WRITE16_MEMBER(gcm394_base_video_device::video_7080_w) { LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::video_7080_w %04x\n", machine().describe_context(), data); m_7080 = data; } WRITE16_MEMBER(gcm394_base_video_device::video_7081_w) { LOGMASKED(LOG_GCM394_VIDEO, "%s:gcm394_base_video_device::video_7081_w %04x\n", machine().describe_context(), data); m_7081 = data; } diff --git a/src/devices/machine/sunplus_gcm394_video.h b/src/devices/machine/sunplus_gcm394_video.h index e9349700e3b..e88cf402c82 100644 --- a/src/devices/machine/sunplus_gcm394_video.h +++ b/src/devices/machine/sunplus_gcm394_video.h @@ -124,6 +124,7 @@ public: DECLARE_READ16_MEMBER(spriteram_r); DECLARE_READ16_MEMBER(video_7051_r); + DECLARE_READ16_MEMBER(video_70e0_r); auto write_video_irq_callback() { return m_video_irq_cb.bind(); }; |