mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-11-13 06:15:07 +01:00
[Core/CD] improved PAL Mega CD timing accuracy
This commit is contained in:
parent
01030f1a76
commit
ece23d007e
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 3.2 MiB After Width: | Height: | Size: 3.2 MiB |
Binary file not shown.
Before Width: | Height: | Size: 3.3 MiB After Width: | Height: | Size: 3.3 MiB |
@ -2,7 +2,7 @@
|
||||
* Genesis Plus
|
||||
* Mega CD / Sega CD hardware
|
||||
*
|
||||
* Copyright (C) 2012-2015 Eke-Eke (Genesis Plus GX)
|
||||
* Copyright (C) 2012-2016 Eke-Eke (Genesis Plus GX)
|
||||
*
|
||||
* Redistribution and use of this code or any derivative works are permitted
|
||||
* provided that the following conditions are met:
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Genesis Plus
|
||||
* Mega CD / Sega CD hardware
|
||||
*
|
||||
* Copyright (C) 2012-2015 Eke-Eke (Genesis Plus GX)
|
||||
* Copyright (C) 2012-2016 Eke-Eke (Genesis Plus GX)
|
||||
*
|
||||
* Redistribution and use of this code or any derivative works are permitted
|
||||
* provided that the following conditions are met:
|
||||
@ -50,12 +50,12 @@
|
||||
#define scd ext.cd_hw
|
||||
#endif
|
||||
|
||||
/* 5000000 SCD clocks/s = ~3184 clocks/line with a Master Clock of 53.693175 MHz */
|
||||
/* This would be slightly (~30 clocks) more on PAL systems because of the slower */
|
||||
/* Master Clock (53.203424 MHz) but not enough to really care about since clocks */
|
||||
/* are not running in sync anyway. */
|
||||
/* CD hardware Master Clock (50 MHz) */
|
||||
#define SCD_CLOCK 50000000
|
||||
#define SCYCLES_PER_LINE 3184
|
||||
|
||||
/* ~3184 SCD clocks/line on NTSC-U system (53.693175 MHz Master Clock) */
|
||||
/* ~3214 SCD clocks/line on PAL system (53.203424 MHz Master Clock) */
|
||||
#define SCYCLES_PER_LINE scd.cycles_per_line
|
||||
|
||||
/* Timer & Stopwatch clocks divider */
|
||||
#define TIMERS_SCYCLES_RATIO (384 * 4)
|
||||
@ -70,7 +70,8 @@ typedef struct
|
||||
uint8 word_ram_2M[0x40000]; /* 256K Word RAM (2M mode) */
|
||||
uint8 bram[0x2000]; /* 8K Backup RAM */
|
||||
reg16_t regs[0x100]; /* 256 x 16-bit ASIC registers */
|
||||
uint32 cycles; /* Master clock counter */
|
||||
uint32 cycles; /* CD Master clock counter */
|
||||
uint32 cycles_per_line; /* CD Master clock count per scanline */
|
||||
int32 stopwatch; /* Stopwatch counter */
|
||||
int32 timer; /* Timer counter */
|
||||
uint8 pending; /* Pending interrupts */
|
||||
|
@ -3,7 +3,7 @@
|
||||
* ROM Loading Support
|
||||
*
|
||||
* Copyright (C) 1998-2003 Charles Mac Donald (original code)
|
||||
* Copyright (C) 2007-2015 Eke-Eke (Genesis Plus GX)
|
||||
* Copyright (C) 2007-2016 Eke-Eke (Genesis Plus GX)
|
||||
*
|
||||
* Redistribution and use of this code or any derivative works are permitted
|
||||
* provided that the following conditions are met:
|
||||
@ -1105,6 +1105,9 @@ void get_region(char *romheader)
|
||||
/* force PAL/NTSC master clock if requested */
|
||||
if (config.master_clock == 1) system_clock = MCLOCK_NTSC;
|
||||
else if (config.master_clock == 2) system_clock = MCLOCK_PAL;
|
||||
|
||||
/* reinitialize CD unit master clock count per scanline */
|
||||
scd.cycles_per_line = (uint32) (MCYCLES_PER_LINE * ((float)SCD_CLOCK / (float)system_clock));
|
||||
}
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* ROM Loading Support
|
||||
*
|
||||
* Copyright (C) 1998-2003 Charles Mac Donald (original code)
|
||||
* Copyright (C) 2007-2015 Eke-Eke (Genesis Plus GX)
|
||||
* Copyright (C) 2007-2016 Eke-Eke (Genesis Plus GX)
|
||||
*
|
||||
* Redistribution and use of this code or any derivative works are permitted
|
||||
* provided that the following conditions are met:
|
||||
|
Loading…
Reference in New Issue
Block a user