From 1018a623e4b59e986b9dd22de44f6b16d9295fb2 Mon Sep 17 00:00:00 2001 From: Enik Land Date: Thu, 25 Jul 2019 23:03:44 -0300 Subject: 315_5124: Adjust horizontal screen positions --- src/devices/bus/sega8/sega8_slot.cpp | 12 ++++++------ src/devices/video/315_5124.cpp | 37 +++++++++++++++++------------------- src/devices/video/315_5124.h | 2 +- src/mame/machine/sms.cpp | 2 +- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/src/devices/bus/sega8/sega8_slot.cpp b/src/devices/bus/sega8/sega8_slot.cpp index e897f6c53e8..4af1059cb74 100644 --- a/src/devices/bus/sega8/sega8_slot.cpp +++ b/src/devices/bus/sega8/sega8_slot.cpp @@ -302,17 +302,17 @@ void sega8_cart_slot_device::set_lphaser_xoffset( uint8_t *rom, int size ) if (size >= 0x8000) { if (!memcmp(&rom[0x7ff0], signatures[0], 16) || !memcmp(&rom[0x7ff0], signatures[1], 16)) - xoff = 26; + xoff = 9; else if (!memcmp(&rom[0x7ff0], signatures[2], 16)) - xoff = 36; + xoff = 19; else if (!memcmp(&rom[0x7ff0], signatures[3], 16)) - xoff = 32; + xoff = 15; else if (!memcmp(&rom[0x7ff0], signatures[4], 16)) - xoff = 30; + xoff = 13; else if (!memcmp(&rom[0x7ff0], signatures[5], 16)) - xoff = 39; + xoff = 22; else if (!memcmp(&rom[0x7ff0], signatures[6], 16)) - xoff = 38; + xoff = 21; } m_cart->set_lphaser_xoffs(xoff); diff --git a/src/devices/video/315_5124.cpp b/src/devices/video/315_5124.cpp index 552df7be283..027663eed4d 100644 --- a/src/devices/video/315_5124.cpp +++ b/src/devices/video/315_5124.cpp @@ -24,23 +24,22 @@ SMS Display Timing ------------------ For more information, please see: - http://cgfm2.emuviews.com/txt/msvdp.txt - - http://www.smspower.org/forums/viewtopic.php?p=44198 + - http://www.smspower.org/forums/viewtopic.php?p=37142 + - http://www.smspower.org/forums/viewtopic.php?p=92925 A scanline contains the following sections: - - horizontal sync 9 E9-ED => HSYNC high - - left blanking 2 ED-EE - - color burst 14 EE-F5 => increment line counter/generate interrupts/etc - - left blanking 8 F5-F9 - - left border 13 F9-FF - - active display 256 00-7F - - right border 15 80-87 - - right blanking 8 87-8B - - horizontal sync 17 8B-93 => HSYNC low - - Although the processing done for a section happens when HCount is in the - specified range (e.g. 00-7F for active display), probably there is a delay - until its signal is shown on screen, as happens on the TMS9918 chip - according to this timing diagram: + - horizontal sync 26 E9-F5 => HSYNC low + - left blanking 2 F6-F6 => HSYNC high + - color burst 14 F7-FD + - left blanking 8 FE-01 + - left border 13 02-08 + - active display 256 08-88 + - right border 15 88-8F + - right blanking 8 90-93 + + Probably the processing done for the active display occurs when HCount + is in the 00-7F range and there is a delay until its signal is shown on + screen, as happens on the TMS9918 chip according to this timing diagram: http://www.smspower.org/Development/TMS9918MasterTimingDiagram @@ -110,8 +109,8 @@ static constexpr u8 line_315_5377[8] = { 26, 26, 27, 28 /* not verified */, 24, #define DISPLAY_DISABLED_HPOS 24 /* not verified, works if above 18 (for 'pstrike2') and below 25 (for 'fantdizzy') */ #define DISPLAY_CB_HPOS 2 /* fixes 'roadrash' (SMS game) title scrolling, due to line counter reload timing */ -#define DRAW_TIME_GG 94 /* 9 + 2 + 14 + 8 + 13 + 96/2 */ -#define DRAW_TIME_SMS 46 /* 9 + 2 + 14 + 8 + 13 */ +#define DRAW_TIME_GG 111 /* 26 + 2 + 14 + 8 + 13 + 96/2 */ +#define DRAW_TIME_SMS 63 /* 26 + 2 + 14 + 8 + 13 */ DEFINE_DEVICE_TYPE(SEGA315_5124, sega315_5124_device, "sega315_5124", "Sega 315-5124 SMS1 VDP") @@ -382,14 +381,12 @@ u8 sega315_5124_device::hcount_read() void sega315_5124_device::hcount_latch() { - const int active_scr_start = 46; /* 9 + 2 + 14 + 8 + 13 */ - /* The hcount value returned by the VDP seems to be based on the previous hpos */ int hclock = screen().hpos() - 1; if (hclock < 0) hclock += WIDTH; - m_hcounter = ((hclock - active_scr_start) >> 1) & 0xff; + m_hcounter = ((hclock - 46) >> 1) & 0xff; m_hcounter_latched = true; } diff --git a/src/devices/video/315_5124.h b/src/devices/video/315_5124.h index 9dab94e40b9..ba58220618d 100644 --- a/src/devices/video/315_5124.h +++ b/src/devices/video/315_5124.h @@ -36,7 +36,7 @@ public: static constexpr unsigned WIDTH = 342; /* 342 pixels */ static constexpr unsigned HEIGHT_NTSC = 262; /* 262 lines */ static constexpr unsigned HEIGHT_PAL = 313; /* 313 lines */ - static constexpr unsigned LBORDER_START = 9 + 2 + 14 + 8; + static constexpr unsigned LBORDER_START = 26 + 2 + 14 + 8; static constexpr unsigned LBORDER_WIDTH = 13; /* 13 pixels */ static constexpr unsigned RBORDER_WIDTH = 15; /* 15 pixels */ static constexpr unsigned TBORDER_START = 3 + 13; diff --git a/src/mame/machine/sms.cpp b/src/mame/machine/sms.cpp index e784353b8c0..fa1b149ee63 100644 --- a/src/mame/machine/sms.cpp +++ b/src/mame/machine/sms.cpp @@ -974,7 +974,7 @@ void sms_state::setup_media_slots() m_lphaser_x_offs = m_smsexpslot->get_lphaser_xoffs(); if (m_lphaser_x_offs == -1) - m_lphaser_x_offs = 36; + m_lphaser_x_offs = 19; } } -- cgit v1.2.3