fixed SRAM initial state

added vdptiming autodetect
allowed TIME register read
modified HBlank end
This commit is contained in:
ekeeke31 2007-08-12 15:02:32 +00:00
parent ffbb7b6cb1
commit 60d3cac5c8
7 changed files with 21 additions and 37 deletions

View File

@ -11,15 +11,16 @@ used in a few games (now use game database) as backup RAM. This should fix SRAM
. NHLPA Hockey 93, Rings of Power (EA mapper)
. Micromachines games (Codemasters mapper)
- modified WRITE_xxx & READ_xxx macros for multiple endianness support
- rewrote BIG ENDIAN support in render.c and vdp.c: should be a little faster by now (avoid useless swaping)
- SRAM data is now initialized with 0xFF: fix Micromachines 2, Dino Dini Soccer and maybe more
- corrected 16-bits SRAM read/write: fix some Sega Sports and EA Sports games (NFL95, NBA Action 95, NL97, NHL98,...)
- modified WRITE_xxx & READ_xxx macros for better multiple endianness support
- rewrote BIG ENDIAN support in render.c and vdp.c: should be a little faster (no more useless word swapping)
- fixed leftmost Window/PlaneA column render and implemented window bug (see gen-vdp.txt)
- corrected pixel sprite limit emulation
- corrected sprite collision detection
- added 9bits (RGB333) pixelcolor extrapolation to support fullcolor range (0-65535) when using 16bits rendering (RGB 565)
- sprite limit emulation and sprite collision detection should be now a little more accurate
- added 9bits (RGB333) pixel color extrapolation to support fullcolor range (0-65535) when using 16bits rendering (RGB 565)
- completely rewrote interrupt (VINT/HINT) handling: Sesame's Street Counting Cafe now works without any hacks,
no other timing sensitive game seems to be broken
- corrected Hcounter table: Road Rash games (I,II,III) don't need any timing hacks anymore
other timing sensitive games seem to be ok
- modified Hcounter tables: Road Rash games (I,II,III) don't need any timing hacks anymore
- corrected VDP latency so it does not interfere with DMA timings anymore

View File

@ -75,32 +75,6 @@ void EEPROM_Init()
sram.on = 1;
sram.write = 1;
memcpy(&eeprom.type, &database[i].type, sizeof(T_EEPROM_TYPE));
/* Micromachines II need initialized values in RAM */
if (i == 16)
{
int j=0;
while (j<0x400)
{
/* memory array is filled with "PETETEST01234567" */
sram.sram[j++] = 0x50;
sram.sram[j++] = 0x45;
sram.sram[j++] = 0x54;
sram.sram[j++] = 0x45;
sram.sram[j++] = 0x54;
sram.sram[j++] = 0x45;
sram.sram[j++] = 0x53;
sram.sram[j++] = 0x54;
sram.sram[j++] = 0x30;
sram.sram[j++] = 0x31;
sram.sram[j++] = 0x32;
sram.sram[j++] = 0x33;
sram.sram[j++] = 0x34;
sram.sram[j++] = 0x35;
sram.sram[j++] = 0x36;
sram.sram[j++] = 0x37;
}
}
}
}
i++;

View File

@ -147,6 +147,7 @@ unsigned int m68k_read_memory_8 (unsigned int address)
case 0x40: /* TMSS */
case 0x41: /* BOOTROM */
case 0x50: /* SVP REGISTERS */
case 0x30: /* TIME */
return (m68k_read_bus_8 (address));
default: /* Unused */
@ -319,6 +320,7 @@ unsigned int m68k_read_memory_16 (unsigned int address)
case 0x40: /* TMSS */
case 0x41: /* BOOTROM */
case 0x50: /* SVP REGISTERS */
case 0x30: /* TIME */
return (m68k_read_bus_16 (address));
default: /* Unused */

View File

@ -87,9 +87,15 @@ void genesis_set_region ()
void detect_game()
{
/* Lotus 2 RECS */
if (strstr(rominfo.product,"T-50746") != NULL) alttiming = 1;
else alttiming = 0;
/* Chaos Engine / Soldier of Fortune */
if ((strstr(rominfo.product,"T-104066") != NULL) ||
(strstr(rominfo.product,"T-124016") != NULL)) vdptiming = 1;
else vdptiming = 0;
/* Menacer 6-in-1 Pack */
if (strstr(rominfo.product,"MK-1658") != NULL)
{

View File

@ -39,6 +39,7 @@ T_SRAM sram;
void SRAM_Init ()
{
memset (&sram, 0, sizeof (T_SRAM));
memset (&sram.sram[0], 0xFF, 0x10000);
sram.crc = crc32 (0, &sram.sram[0], 0x10000);
if ((cart_rom[0x1b0] == 0x52) && (cart_rom[0x1b1] == 0x41))

View File

@ -262,7 +262,6 @@ int system_frame (int do_skip)
/* H retrace */
status |= 0x0004; // HBlank = 1
m68k_run(aim_m68k - 404);
status &= 0xFFFB; // HBlank = 0
if (!alttiming && !do_skip)
{
@ -290,6 +289,8 @@ int system_frame (int do_skip)
}
}
status &= 0xFFFB; // HBlank = 0
/* Process end of line */
m68k_run(aim_m68k);
if (zreset == 1 && zbusreq == 0) z80_run(aim_z80);

View File

@ -87,7 +87,7 @@ uint8 vdp_rate = 60; /* CPU speed (60Hz by default)*/
void (*color_update) (int index, uint16 data);
uint8 dmatiming = 1;
uint8 vdptiming = 1;
uint8 vdptiming = 0;
/*--------------------------------------------------------------------------*/
/* Init, reset, shutdown functions */
@ -130,7 +130,7 @@ void vdp_reset (void)
frame_end = 0xE0;
dma_endCycles = 0;
status = 0x200; /* fifo empty - all other flags clear */
status = 0x3600; /* fifo empty */
/* Initialize viewport */
bitmap.viewport.x = 0x20;
@ -473,7 +473,6 @@ void vdp_reg_w (uint8 r, uint8 d)
break;
case 0x01: /* CTRL #2 */
/* Change the frame timing */
frame_end = (d & 8) ? 0xF0 : 0xE0;