mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-25 18:51:49 +01:00
various modifications
This commit is contained in:
parent
7a28802085
commit
41ffdefb1d
14
history.txt
14
history.txt
@ -10,18 +10,24 @@ CURRENT:
|
|||||||
- YM2612(MAME): improved Detune overflow accuracy, fix very high frequency sounds in many games
|
- YM2612(MAME): improved Detune overflow accuracy, fix very high frequency sounds in many games
|
||||||
- YM2612(MAME): fixed registers 0x20-0x26 Reset state, fix intro music in "B.O.B"
|
- YM2612(MAME): fixed registers 0x20-0x26 Reset state, fix intro music in "B.O.B"
|
||||||
- YM2612(MAME): removed previous fix with KEY ON, fix "Flamethrower" sound effect in "Alien 3"
|
- YM2612(MAME): removed previous fix with KEY ON, fix "Flamethrower" sound effect in "Alien 3"
|
||||||
- adjusted HCounter values, fix line flickering in "Sonic 3D" bonus stage
|
- adjusted HCounter values, fixes line flickering in "Sonic 3D" bonus stage
|
||||||
- re-enabled Z80 banked access to WRAM, fix hang-up in "Mamono Hunter Youko"
|
- adjusted VINT timing, fixes hang-up in "V.R Troopers"
|
||||||
- modified JCART emulation, fix corrupted tracks logo in "Micro Machines 2"
|
- improved HBLANK flag accuracy, fixes line flickering in "Gouketsuji Ichizoku"
|
||||||
|
- re-enabled Z80 banked access to WRAM, fixes hang-up in "Mamono Hunter Youko"
|
||||||
|
- modified JCART emulation, fixes corrupted tracks logo in "Micro Machines 2"
|
||||||
|
|
||||||
|
|
||||||
[NGC/Wii]
|
[NGC/Wii]
|
||||||
- now use fixed libsamplerate setting in "HQ YM2612" mode
|
- remove unused libsamplerate settings in "HQ YM2612" mode
|
||||||
- implemented menu fast scrolling with the Wiimote D-PAD
|
- implemented menu fast scrolling with the Wiimote D-PAD
|
||||||
- fixed config file incompatibilities between Gamecube and Wii versions
|
- fixed config file incompatibilities between Gamecube and Wii versions
|
||||||
- re-enabled texture filtering in H40 original mode when overscan is emulated: fix screen scroll tearing
|
- re-enabled texture filtering in H40 original mode when overscan is emulated: fix screen scroll tearing
|
||||||
- added Shay Green's NTSC Filters support
|
- added Shay Green's NTSC Filters support
|
||||||
|
|
||||||
|
[NGC]
|
||||||
- added proper 480p menu detection for NTSC Gamecube users
|
- added proper 480p menu detection for NTSC Gamecube users
|
||||||
|
- now prevents FAT automatic operations if no SDCARD is inserted
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
26/08/2008:
|
26/08/2008:
|
||||||
|
@ -7,9 +7,12 @@
|
|||||||
#define CONFIG_VERSION "GENPLUS 1.2.6 "
|
#define CONFIG_VERSION "GENPLUS 1.2.6 "
|
||||||
|
|
||||||
t_config config;
|
t_config config;
|
||||||
|
bool use_FAT;
|
||||||
|
|
||||||
void config_save()
|
void config_save()
|
||||||
{
|
{
|
||||||
|
if (!use_FAT) return;
|
||||||
|
|
||||||
/* first check if directory exist */
|
/* first check if directory exist */
|
||||||
DIR_ITER *dir = diropen("/genplus");
|
DIR_ITER *dir = diropen("/genplus");
|
||||||
if (dir == NULL) mkdir("/genplus",S_IRWXU);
|
if (dir == NULL) mkdir("/genplus",S_IRWXU);
|
||||||
@ -27,13 +30,12 @@ void config_save()
|
|||||||
|
|
||||||
void config_load()
|
void config_load()
|
||||||
{
|
{
|
||||||
char version[15];
|
|
||||||
|
|
||||||
/* open file for writing */
|
/* open file for writing */
|
||||||
FILE *fp = fopen("/genplus/genplus.ini", "rb");
|
FILE *fp = fopen("/genplus/genplus.ini", "rb");
|
||||||
if (fp == NULL) return;
|
if (fp == NULL) return;
|
||||||
|
|
||||||
/* read version */
|
/* read version */
|
||||||
|
char version[15];
|
||||||
fread(version, 15, 1, fp);
|
fread(version, 15, 1, fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
if (strcmp(version,CONFIG_VERSION)) return;
|
if (strcmp(version,CONFIG_VERSION)) return;
|
||||||
|
@ -41,6 +41,7 @@ extern t_config config;
|
|||||||
extern void config_save();
|
extern void config_save();
|
||||||
extern void config_load();
|
extern void config_load();
|
||||||
extern void set_config_defaults(void);
|
extern void set_config_defaults(void);
|
||||||
|
extern bool use_FAT;
|
||||||
|
|
||||||
#endif /* _CONFIG_H_ */
|
#endif /* _CONFIG_H_ */
|
||||||
|
|
||||||
|
@ -146,7 +146,9 @@ void soundmenu ()
|
|||||||
sprintf (items[1], "FM Volume: %1.2f", config.fm_preamp);
|
sprintf (items[1], "FM Volume: %1.2f", config.fm_preamp);
|
||||||
sprintf (items[2], "Volume Boost: %dX", config.boost);
|
sprintf (items[2], "Volume Boost: %dX", config.boost);
|
||||||
sprintf (items[3], "LowPass Filter: %s", config.filter ? " ON":"OFF");
|
sprintf (items[3], "LowPass Filter: %s", config.filter ? " ON":"OFF");
|
||||||
sprintf (items[4], "HQ YM2612: %s", config.hq_fm ? " ON":"OFF");
|
if (config.hq_fm == 0) sprintf (items[4], "HQ YM2612: OFF");
|
||||||
|
else if ((config.hq_fm == 1) || config.fm_core) sprintf (items[4], "HQ YM2612: LINEAR");
|
||||||
|
else sprintf (items[4], "HQ YM2612: SINC");
|
||||||
sprintf (items[5], "FM core: %s", config.fm_core ? "GENS" : "MAME");
|
sprintf (items[5], "FM core: %s", config.fm_core ? "GENS" : "MAME");
|
||||||
|
|
||||||
ret = domenu (&items[0], count, 1);
|
ret = domenu (&items[0], count, 1);
|
||||||
@ -178,7 +180,8 @@ void soundmenu ()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
config.hq_fm ^= 1;
|
config.hq_fm ++;
|
||||||
|
if ((config.hq_fm>2)||(config.fm_core && (config.hq_fm>1))) config.hq_fm = 0;
|
||||||
if (genromsize)
|
if (genromsize)
|
||||||
{
|
{
|
||||||
audio_init(48000);
|
audio_init(48000);
|
||||||
@ -328,7 +331,7 @@ void dispmenu ()
|
|||||||
if (config.tv_mode == 0) sprintf (items[2], "TV Mode: 60HZ");
|
if (config.tv_mode == 0) sprintf (items[2], "TV Mode: 60HZ");
|
||||||
else if (config.tv_mode == 1) sprintf (items[2], "TV Mode: 50HZ");
|
else if (config.tv_mode == 1) sprintf (items[2], "TV Mode: 50HZ");
|
||||||
else sprintf (items[2], "TV Mode: 50/60HZ");
|
else sprintf (items[2], "TV Mode: 50/60HZ");
|
||||||
sprintf (items[3], "Texture Filter: %s", config.filtering ? " ON" : "OFF");
|
sprintf (items[3], "GX Filter: %s", config.filtering ? " ON" : "OFF");
|
||||||
if (config.ntsc == 1) sprintf (items[4], "NTSC Filter: COMPOSITE");
|
if (config.ntsc == 1) sprintf (items[4], "NTSC Filter: COMPOSITE");
|
||||||
else if (config.ntsc == 2) sprintf (items[4], "NTSC Filter: S-VIDEO");
|
else if (config.ntsc == 2) sprintf (items[4], "NTSC Filter: S-VIDEO");
|
||||||
else if (config.ntsc == 3) sprintf (items[4], "NTSC Filter: RGB");
|
else if (config.ntsc == 3) sprintf (items[4], "NTSC Filter: RGB");
|
||||||
|
@ -15,6 +15,8 @@ t_history history;
|
|||||||
|
|
||||||
void history_save()
|
void history_save()
|
||||||
{
|
{
|
||||||
|
if (!use_FAT) return;
|
||||||
|
|
||||||
/* first check if directory exist */
|
/* first check if directory exist */
|
||||||
DIR_ITER *dir = diropen("/genplus");
|
DIR_ITER *dir = diropen("/genplus");
|
||||||
if (dir == NULL) mkdir("/genplus",S_IRWXU);
|
if (dir == NULL) mkdir("/genplus",S_IRWXU);
|
||||||
|
@ -85,6 +85,8 @@ static int SD_ManageFile(char *filename, int direction, int filetype)
|
|||||||
int done = 0;
|
int done = 0;
|
||||||
int filesize;
|
int filesize;
|
||||||
|
|
||||||
|
if (!use_FAT) return 0;
|
||||||
|
|
||||||
/* first check if directory exist */
|
/* first check if directory exist */
|
||||||
DIR_ITER *dir = diropen("/genplus/saves");
|
DIR_ITER *dir = diropen("/genplus/saves");
|
||||||
if (dir == NULL) mkdir("/genplus/saves",S_IRWXU);
|
if (dir == NULL) mkdir("/genplus/saves",S_IRWXU);
|
||||||
|
@ -125,7 +125,8 @@ int main (int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Initialize SDCARD Interface (LibFAT) */
|
/* Initialize SDCARD Interface (LibFAT) */
|
||||||
fatInitDefault();
|
use_FAT = 0;
|
||||||
|
if (fatInitDefault() == true) use_FAT = 1;
|
||||||
|
|
||||||
/* Restore User Configuration */
|
/* Restore User Configuration */
|
||||||
set_config_defaults();
|
set_config_defaults();
|
||||||
|
@ -647,7 +647,7 @@ void render_line(int line, uint8 odd_frame)
|
|||||||
/* vertical borders or display OFF */
|
/* vertical borders or display OFF */
|
||||||
if ((line >= bitmap.viewport.h) || (!(reg[1] & 0x40)))
|
if ((line >= bitmap.viewport.h) || (!(reg[1] & 0x40)))
|
||||||
{
|
{
|
||||||
memset(&lb[0x20], 0x40 | border, width);
|
memset(&lb[0x20], 0x40, width);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -693,14 +693,14 @@ void render_line(int line, uint8 odd_frame)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Mode 4 feature only (unemulated, no games rely on this) */
|
/* Mode 4 feature only (unemulated, no games rely on this) */
|
||||||
/*if(!(reg[1] & 0x04) && (reg[0] & 0x20)) memset(&lb[0x20], 0x40 | border, 0x08);*/
|
/*if(!(reg[1] & 0x04) && (reg[0] & 0x20)) memset(&lb[0x20], 0x40, 0x08);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/* horizontal borders */
|
/* horizontal borders */
|
||||||
if (config.overscan)
|
if (config.overscan)
|
||||||
{
|
{
|
||||||
memset(&lb[0x20 - bitmap.viewport.x], 0x40 | border, bitmap.viewport.x);
|
memset(&lb[0x20 - bitmap.viewport.x], 0x40, bitmap.viewport.x);
|
||||||
memset(&lb[0x20 + bitmap.viewport.w], 0x40 | border, bitmap.viewport.x);
|
memset(&lb[0x20 + bitmap.viewport.w], 0x40, bitmap.viewport.x);
|
||||||
width += 2 * bitmap.viewport.x;
|
width += 2 * bitmap.viewport.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,9 @@
|
|||||||
#include "shared.h"
|
#include "shared.h"
|
||||||
#include "samplerate.h"
|
#include "samplerate.h"
|
||||||
|
|
||||||
|
#define CLOCK_NTSC 53693175
|
||||||
|
#define CLOCK_PAL 53203424
|
||||||
|
|
||||||
/* generic functions */
|
/* generic functions */
|
||||||
int (*_YM2612_Write)(unsigned char adr, unsigned char data);
|
int (*_YM2612_Write)(unsigned char adr, unsigned char data);
|
||||||
int (*_YM2612_Read)(void);
|
int (*_YM2612_Read)(void);
|
||||||
@ -91,8 +94,8 @@ static inline void psg_update()
|
|||||||
|
|
||||||
void sound_init(int rate)
|
void sound_init(int rate)
|
||||||
{
|
{
|
||||||
double vclk = Master_Clock / 7.0; /* 68000 and YM2612 clock */
|
double vclk = (vdp_pal ? (double)CLOCK_PAL : (double)CLOCK_NTSC) / 7.0; /* 68000 and YM2612 clock */
|
||||||
double zclk = Master_Clock / 15.0; /* Z80 and SN76489 clock */
|
double zclk = (vdp_pal ? (double)CLOCK_PAL : (double)CLOCK_NTSC) / 15.0; /* Z80 and SN76489 clock */
|
||||||
|
|
||||||
/* cycle-accurate FM samples */
|
/* cycle-accurate FM samples */
|
||||||
if (config.hq_fm && !config.fm_core)
|
if (config.hq_fm && !config.fm_core)
|
||||||
@ -164,7 +167,7 @@ void sound_update(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* samplerate conversion */
|
/* samplerate conversion */
|
||||||
src_simple (&src_data, svp ? SRC_LINEAR : SRC_SINC_FASTEST, 2);
|
src_simple (&src_data, (config.hq_fm&1) ? SRC_LINEAR : SRC_SINC_FASTEST, 2);
|
||||||
|
|
||||||
/* this is basically libsamplerate "src_float_to_int_array" function, adapted to interlace samples */
|
/* this is basically libsamplerate "src_float_to_int_array" function, adapted to interlace samples */
|
||||||
len = snd.buffer_size;
|
len = snd.buffer_size;
|
||||||
|
@ -33,8 +33,6 @@ t_snd snd;
|
|||||||
uint8 vdp_rate;
|
uint8 vdp_rate;
|
||||||
uint16 lines_per_frame;
|
uint16 lines_per_frame;
|
||||||
double Master_Clock;
|
double Master_Clock;
|
||||||
uint32 m68cycles_per_line;
|
|
||||||
uint32 z80cycles_per_line;
|
|
||||||
uint32 aim_m68k;
|
uint32 aim_m68k;
|
||||||
uint32 count_m68k;
|
uint32 count_m68k;
|
||||||
uint32 line_m68k;
|
uint32 line_m68k;
|
||||||
@ -61,16 +59,21 @@ static inline void update_interrupts(void)
|
|||||||
uint8 latency = hvint_updated;
|
uint8 latency = hvint_updated;
|
||||||
hvint_updated = -1;
|
hvint_updated = -1;
|
||||||
|
|
||||||
|
/* VDP hardware latency */
|
||||||
|
if (latency) count_m68k += m68k_execute(latency);
|
||||||
|
|
||||||
|
/* Level 6 interrupt */
|
||||||
if (vint_pending && (reg[1] & 0x20))
|
if (vint_pending && (reg[1] & 0x20))
|
||||||
{
|
{
|
||||||
vint_triggered = 1;
|
vint_triggered = 1;
|
||||||
if (latency) count_m68k += m68k_execute(latency);
|
|
||||||
m68k_set_irq(6);
|
m68k_set_irq(6);
|
||||||
}
|
}
|
||||||
|
/* Level 4 interrupt */
|
||||||
else if (hint_pending && (reg[0] & 0x10))
|
else if (hint_pending && (reg[0] & 0x10))
|
||||||
{
|
{
|
||||||
m68k_set_irq(4);
|
m68k_set_irq(4);
|
||||||
}
|
}
|
||||||
|
/* Clear all interrupts */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m68k_set_irq(0);
|
m68k_set_irq(0);
|
||||||
@ -105,10 +108,6 @@ void system_init (void)
|
|||||||
lines_per_frame = vdp_pal ? 313 : 262;
|
lines_per_frame = vdp_pal ? 313 : 262;
|
||||||
Master_Clock = vdp_pal ? (double)CLOCK_PAL : (double)CLOCK_NTSC;
|
Master_Clock = vdp_pal ? (double)CLOCK_PAL : (double)CLOCK_NTSC;
|
||||||
|
|
||||||
/* CPU cycles increments */
|
|
||||||
z80cycles_per_line = 228;
|
|
||||||
m68cycles_per_line = 488;
|
|
||||||
|
|
||||||
gen_init ();
|
gen_init ();
|
||||||
vdp_init ();
|
vdp_init ();
|
||||||
render_init ();
|
render_init ();
|
||||||
@ -260,22 +259,22 @@ int system_frame (int do_skip)
|
|||||||
/* update inputs */
|
/* update inputs */
|
||||||
update_input();
|
update_input();
|
||||||
|
|
||||||
/* set VBLANK flag */
|
/* set VBLANK flag (Dracula) */
|
||||||
status |= 0x08;
|
status |= 0x08;
|
||||||
|
|
||||||
/* Z80 interrupt is 16ms period (one frame) and 64us length (one scanline) */
|
/* Z80 interrupt is 16ms period (one frame) and 64us length (one scanline) */
|
||||||
zirq = 1;
|
zirq = 1;
|
||||||
z80_set_irq_line(0, ASSERT_LINE);
|
z80_set_irq_line(0, ASSERT_LINE);
|
||||||
|
|
||||||
/* delay between HINT, VBLANK and VINT (approx. 14.7 us) */
|
/* delay between HINT, VBLANK and VINT (OutRunners, VR Troopers) */
|
||||||
m68k_run(line_m68k + 84); /* need to take upcoming latency in account (Hurricanes, Outrunners) */
|
m68k_run(line_m68k + 84);
|
||||||
if (zreset && !zbusreq) z80_run(line_z80 + 40);
|
if (zreset && !zbusreq) z80_run(line_z80 + 39);
|
||||||
else count_z80 = line_z80 + 40;
|
else count_z80 = line_z80 + 39;
|
||||||
|
|
||||||
/* Vertical Interrupt */
|
/* Vertical Interrupt */
|
||||||
status |= 0x80;
|
status |= 0x80;
|
||||||
vint_pending = 1;
|
vint_pending = 1;
|
||||||
hvint_updated = 30; /* Tyrants, Mega-Lo-Mania & Ex Mutant need some cycles to read VINT flag */
|
hvint_updated = 36; /* Tyrants, Mega-Lo-Mania & Ex Mutant need some cycles to read VINT flag */
|
||||||
}
|
}
|
||||||
else if (zirq)
|
else if (zirq)
|
||||||
{
|
{
|
||||||
|
@ -28,6 +28,10 @@
|
|||||||
#define SYSTEM_MEGADRIVE 1
|
#define SYSTEM_MEGADRIVE 1
|
||||||
#define SYSTEM_PICO 2
|
#define SYSTEM_PICO 2
|
||||||
|
|
||||||
|
/* CPU cycles increments */
|
||||||
|
#define z80cycles_per_line 228
|
||||||
|
#define m68cycles_per_line 488
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint8 *data; /* Bitmap data */
|
uint8 *data; /* Bitmap data */
|
||||||
@ -75,10 +79,7 @@ typedef struct
|
|||||||
extern t_bitmap bitmap;
|
extern t_bitmap bitmap;
|
||||||
extern t_snd snd;
|
extern t_snd snd;
|
||||||
extern uint16 lines_per_frame;
|
extern uint16 lines_per_frame;
|
||||||
extern double Master_Clock;
|
|
||||||
extern uint8 vdp_rate;
|
extern uint8 vdp_rate;
|
||||||
extern uint32 m68cycles_per_line;
|
|
||||||
extern uint32 z80cycles_per_line;
|
|
||||||
extern uint32 aim_m68k;
|
extern uint32 aim_m68k;
|
||||||
extern uint32 count_m68k;
|
extern uint32 count_m68k;
|
||||||
extern uint32 line_m68k;
|
extern uint32 line_m68k;
|
||||||
|
@ -604,7 +604,7 @@ unsigned int vdp_ctrl_r(void)
|
|||||||
if (!(reg[1] & 0x40)) temp |= 0x8;
|
if (!(reg[1] & 0x40)) temp |= 0x8;
|
||||||
|
|
||||||
/* HBLANK flag (Sonic 3 and Sonic 2 "VS Modes", Lemmings 2) */
|
/* HBLANK flag (Sonic 3 and Sonic 2 "VS Modes", Lemmings 2) */
|
||||||
if (count_m68k <= line_m68k + 84) temp |= 0x4;
|
if ((count_m68k <= (line_m68k + 84)) || (count_m68k > (line_m68k + 488))) temp |= 0x4;
|
||||||
|
|
||||||
/* clear pending flag */
|
/* clear pending flag */
|
||||||
pending = 0;
|
pending = 0;
|
||||||
@ -766,7 +766,7 @@ void vdp_reg_w(unsigned int r, unsigned int d)
|
|||||||
color_update(0x00, *(uint16 *)&cram[(border << 1)]);
|
color_update(0x00, *(uint16 *)&cram[(border << 1)]);
|
||||||
|
|
||||||
/* background color modified during HBLANK */
|
/* background color modified during HBLANK */
|
||||||
if ((v_counter < bitmap.viewport.h) && (count_m68k <= (line_m68k + 84)))
|
if (count_m68k <= (line_m68k + 84))
|
||||||
{
|
{
|
||||||
/* remap current line (see Road Rash I,II,III) */
|
/* remap current line (see Road Rash I,II,III) */
|
||||||
reg[7] = d;
|
reg[7] = d;
|
||||||
|
Loading…
Reference in New Issue
Block a user