mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-25 18:51:49 +01:00
fixed SRAM initial state
added vdptiming autodetect allowed TIME register read modified HBlank end
This commit is contained in:
parent
ffbb7b6cb1
commit
60d3cac5c8
@ -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)
|
. NHLPA Hockey 93, Rings of Power (EA mapper)
|
||||||
. Micromachines games (Codemasters mapper)
|
. Micromachines games (Codemasters mapper)
|
||||||
|
|
||||||
- modified WRITE_xxx & READ_xxx macros for multiple endianness support
|
- SRAM data is now initialized with 0xFF: fix Micromachines 2, Dino Dini Soccer and maybe more
|
||||||
- rewrote BIG ENDIAN support in render.c and vdp.c: should be a little faster by now (avoid useless swaping)
|
- 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)
|
- fixed leftmost Window/PlaneA column render and implemented window bug (see gen-vdp.txt)
|
||||||
- corrected pixel sprite limit emulation
|
- sprite limit emulation and sprite collision detection should be now a little more accurate
|
||||||
- corrected sprite collision detection
|
- added 9bits (RGB333) pixel color extrapolation to support fullcolor range (0-65535) when using 16bits rendering (RGB 565)
|
||||||
- added 9bits (RGB333) pixelcolor 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,
|
- 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
|
other timing sensitive games seem to be ok
|
||||||
- corrected Hcounter table: Road Rash games (I,II,III) don't need any timing hacks anymore
|
- 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
|
- corrected VDP latency so it does not interfere with DMA timings anymore
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,32 +75,6 @@ void EEPROM_Init()
|
|||||||
sram.on = 1;
|
sram.on = 1;
|
||||||
sram.write = 1;
|
sram.write = 1;
|
||||||
memcpy(&eeprom.type, &database[i].type, sizeof(T_EEPROM_TYPE));
|
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++;
|
i++;
|
||||||
|
@ -147,6 +147,7 @@ unsigned int m68k_read_memory_8 (unsigned int address)
|
|||||||
case 0x40: /* TMSS */
|
case 0x40: /* TMSS */
|
||||||
case 0x41: /* BOOTROM */
|
case 0x41: /* BOOTROM */
|
||||||
case 0x50: /* SVP REGISTERS */
|
case 0x50: /* SVP REGISTERS */
|
||||||
|
case 0x30: /* TIME */
|
||||||
return (m68k_read_bus_8 (address));
|
return (m68k_read_bus_8 (address));
|
||||||
|
|
||||||
default: /* Unused */
|
default: /* Unused */
|
||||||
@ -319,6 +320,7 @@ unsigned int m68k_read_memory_16 (unsigned int address)
|
|||||||
case 0x40: /* TMSS */
|
case 0x40: /* TMSS */
|
||||||
case 0x41: /* BOOTROM */
|
case 0x41: /* BOOTROM */
|
||||||
case 0x50: /* SVP REGISTERS */
|
case 0x50: /* SVP REGISTERS */
|
||||||
|
case 0x30: /* TIME */
|
||||||
return (m68k_read_bus_16 (address));
|
return (m68k_read_bus_16 (address));
|
||||||
|
|
||||||
default: /* Unused */
|
default: /* Unused */
|
||||||
|
@ -87,9 +87,15 @@ void genesis_set_region ()
|
|||||||
|
|
||||||
void detect_game()
|
void detect_game()
|
||||||
{
|
{
|
||||||
|
/* Lotus 2 RECS */
|
||||||
if (strstr(rominfo.product,"T-50746") != NULL) alttiming = 1;
|
if (strstr(rominfo.product,"T-50746") != NULL) alttiming = 1;
|
||||||
else alttiming = 0;
|
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 */
|
/* Menacer 6-in-1 Pack */
|
||||||
if (strstr(rominfo.product,"MK-1658") != NULL)
|
if (strstr(rominfo.product,"MK-1658") != NULL)
|
||||||
{
|
{
|
||||||
|
@ -39,6 +39,7 @@ T_SRAM sram;
|
|||||||
void SRAM_Init ()
|
void SRAM_Init ()
|
||||||
{
|
{
|
||||||
memset (&sram, 0, sizeof (T_SRAM));
|
memset (&sram, 0, sizeof (T_SRAM));
|
||||||
|
memset (&sram.sram[0], 0xFF, 0x10000);
|
||||||
sram.crc = crc32 (0, &sram.sram[0], 0x10000);
|
sram.crc = crc32 (0, &sram.sram[0], 0x10000);
|
||||||
|
|
||||||
if ((cart_rom[0x1b0] == 0x52) && (cart_rom[0x1b1] == 0x41))
|
if ((cart_rom[0x1b0] == 0x52) && (cart_rom[0x1b1] == 0x41))
|
||||||
|
@ -262,7 +262,6 @@ int system_frame (int do_skip)
|
|||||||
/* H retrace */
|
/* H retrace */
|
||||||
status |= 0x0004; // HBlank = 1
|
status |= 0x0004; // HBlank = 1
|
||||||
m68k_run(aim_m68k - 404);
|
m68k_run(aim_m68k - 404);
|
||||||
status &= 0xFFFB; // HBlank = 0
|
|
||||||
|
|
||||||
if (!alttiming && !do_skip)
|
if (!alttiming && !do_skip)
|
||||||
{
|
{
|
||||||
@ -290,6 +289,8 @@ int system_frame (int do_skip)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
status &= 0xFFFB; // HBlank = 0
|
||||||
|
|
||||||
/* Process end of line */
|
/* Process end of line */
|
||||||
m68k_run(aim_m68k);
|
m68k_run(aim_m68k);
|
||||||
if (zreset == 1 && zbusreq == 0) z80_run(aim_z80);
|
if (zreset == 1 && zbusreq == 0) z80_run(aim_z80);
|
||||||
|
@ -87,7 +87,7 @@ uint8 vdp_rate = 60; /* CPU speed (60Hz by default)*/
|
|||||||
void (*color_update) (int index, uint16 data);
|
void (*color_update) (int index, uint16 data);
|
||||||
|
|
||||||
uint8 dmatiming = 1;
|
uint8 dmatiming = 1;
|
||||||
uint8 vdptiming = 1;
|
uint8 vdptiming = 0;
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
/* Init, reset, shutdown functions */
|
/* Init, reset, shutdown functions */
|
||||||
@ -130,7 +130,7 @@ void vdp_reset (void)
|
|||||||
frame_end = 0xE0;
|
frame_end = 0xE0;
|
||||||
dma_endCycles = 0;
|
dma_endCycles = 0;
|
||||||
|
|
||||||
status = 0x200; /* fifo empty - all other flags clear */
|
status = 0x3600; /* fifo empty */
|
||||||
|
|
||||||
/* Initialize viewport */
|
/* Initialize viewport */
|
||||||
bitmap.viewport.x = 0x20;
|
bitmap.viewport.x = 0x20;
|
||||||
@ -473,7 +473,6 @@ void vdp_reg_w (uint8 r, uint8 d)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x01: /* CTRL #2 */
|
case 0x01: /* CTRL #2 */
|
||||||
|
|
||||||
/* Change the frame timing */
|
/* Change the frame timing */
|
||||||
frame_end = (d & 8) ? 0xF0 : 0xE0;
|
frame_end = (d & 8) ? 0xF0 : 0xE0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user