mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-24 18:21:50 +01:00
adjuster HCOUNT/HINT timings, improved fast menu scrolling, removed unused SRC algorithms
This commit is contained in:
parent
4c374d034a
commit
deec7ecd2f
@ -8,6 +8,7 @@ CURRENT:
|
||||
- YM2612(MAME): fixed a bug in SSG-EG emulation code, fix Level 1 music in Alisia Dragoon
|
||||
- YM2612(MAME): improved Detune overflow accuracy, fix high-frequency sound effects & musics in many games
|
||||
- YM2612(MAME): fixed registers 0x20-0x26 Reset state, fix intro music in B.O.B
|
||||
- adjusted HCounter values, fix Sonic 3D bonus stage
|
||||
|
||||
[NGC/Wii]
|
||||
- improved menu scrolling using Wiimote D-PAD
|
||||
|
16
source/hvc.h
16
source/hvc.h
@ -337,9 +337,9 @@ uint8 vc_pal_240[313] = {
|
||||
*/
|
||||
|
||||
uint8 cycle2hc32[488] = {
|
||||
0x85, 0x85, 0x85, 0x86, 0x86, 0x87, 0x87, 0x87, 0x88, 0x88, 0x88, 0x89, 0x89, 0x89, 0x8A, 0x8A,
|
||||
0x8A, 0x8B, 0x8B, 0x8B, 0x8C, 0x8C, 0x8D, 0x8D, 0x8D, 0x8E, 0x8E, 0x8E, 0x8F, 0x8F, 0x8F, 0x90,
|
||||
0x90, 0x90, 0x91, 0x91, 0x91, 0x92, 0x92, 0x92, 0x93, 0x93,
|
||||
0x85, 0x85, 0x86, 0x86, 0x87, 0x87, 0x87, 0x88, 0x88, 0x88, 0x89, 0x89, 0x89, 0x8A, 0x8A, 0x8A,
|
||||
0x8B, 0x8B, 0x8B, 0x8C, 0x8C, 0x8D, 0x8D, 0x8D, 0x8E, 0x8E, 0x8E, 0x8F, 0x8F, 0x8F, 0x90, 0x90,
|
||||
0x90, 0x91, 0x91, 0x91, 0x92, 0x92, 0x92, 0x93, 0x93,
|
||||
0xE9, 0xE9, 0xE9, 0xEA, 0xEA, 0xEA,
|
||||
0xEB, 0xEB, 0xEB, 0xEC, 0xEC, 0xEC, 0xED, 0xED, 0xED, 0xEE, 0xEE, 0xEE, 0xEF, 0xEF, 0xF0, 0xF0,
|
||||
0xF0, 0xF1, 0xF1, 0xF1, 0xF2, 0xF2, 0xF2, 0xF3, 0xF3, 0xF3, 0xF4, 0xF4, 0xF4, 0xF5, 0xF5, 0xF6,
|
||||
@ -368,13 +368,13 @@ uint8 cycle2hc32[488] = {
|
||||
0x71, 0x72, 0x72, 0x72, 0x73, 0x73, 0x73, 0x74, 0x74, 0x74, 0x75, 0x75, 0x75, 0x76, 0x76, 0x76,
|
||||
0x77, 0x77, 0x77, 0x78, 0x78, 0x79, 0x79, 0x79, 0x7A, 0x7A, 0x7A, 0x7B, 0x7B, 0x7B, 0x7C, 0x7C,
|
||||
0x7C, 0x7D, 0x7D, 0x7D, 0x7E, 0x7E, 0x7E, 0x7F, 0x7F, 0x80, 0x80, 0x80, 0x81, 0x81, 0x81, 0x82,
|
||||
0x82, 0x82, 0x83, 0x83, 0x83, 0x84, 0x84, 0x84
|
||||
0x82, 0x82, 0x83, 0x83, 0x83, 0x84, 0x84, 0x84, 0x85,
|
||||
};
|
||||
|
||||
uint8 cycle2hc40[488] = {
|
||||
0xA5, 0xA5, 0xA6, 0xA6, 0xA7, 0xA7, 0xA7, 0xA8, 0xA8, 0xA9, 0xA9, 0xAA, 0xAA, 0xAA, 0xAB, 0xAB,
|
||||
0xAC, 0xAC, 0xAD, 0xAD, 0xAD, 0xAE, 0xAE, 0xAF, 0xAF, 0xB0, 0xB0, 0xB1, 0xB1, 0xB1, 0xB2, 0xB2,
|
||||
0xB3, 0xB3, 0xB4, 0xB4, 0xB4, 0xB5, 0xB5, 0xB6, 0xB6,
|
||||
0xA4, 0xA5, 0xA5, 0xA6, 0xA6, 0xA7, 0xA7, 0xA7, 0xA8, 0xA8, 0xA9, 0xA9, 0xAA, 0xAA,
|
||||
0xAA, 0xAB, 0xAB, 0xAC, 0xAC, 0xAD, 0xAD, 0xAD, 0xAE, 0xAE, 0xAF, 0xAF, 0xB0, 0xB0, 0xB1, 0xB1,
|
||||
0xB1, 0xB2, 0xB2, 0xB3, 0xB3, 0xB4, 0xB4, 0xB4, 0xB5, 0xB5, 0xB6, 0xB6,
|
||||
0xE4, 0xE4, 0xE4, 0xE5, 0xE5, 0xE6, 0xE6,
|
||||
0xE7, 0xE7, 0xE7, 0xE8, 0xE8, 0xE9, 0xE9, 0xEA, 0xEA, 0xEB, 0xEB, 0xEB, 0xEC, 0xEC, 0xED, 0xED,
|
||||
0xEE, 0xEE, 0xEE, 0xEF, 0xEF, 0xF0, 0xF0, 0xF1, 0xF1, 0xF1, 0xF2, 0xF2, 0xF3, 0xF3, 0xF4, 0xF4,
|
||||
@ -403,7 +403,7 @@ uint8 cycle2hc40[488] = {
|
||||
0x8D, 0x8D, 0x8D, 0x8E, 0x8E, 0x8F, 0x8F, 0x90, 0x90, 0x90, 0x91, 0x91, 0x92, 0x92, 0x93, 0x93,
|
||||
0x94, 0x94, 0x94, 0x95, 0x95, 0x96, 0x96, 0x97, 0x97, 0x97, 0x98, 0x98, 0x99, 0x99, 0x9A, 0x9A,
|
||||
0x9A, 0x9B, 0x9B, 0x9C, 0x9C, 0x9D, 0x9D, 0x9D, 0x9E, 0x9E, 0x9F, 0x9F, 0xA0, 0xA0, 0xA1, 0xA1,
|
||||
0xA1, 0xA2, 0xA2, 0xA3, 0xA3, 0xA4, 0xA4, 0xA4,
|
||||
0xA1, 0xA2, 0xA2, 0xA3, 0xA3, 0xA4, 0xA4,
|
||||
};
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <fat.h>
|
||||
#include <sys/dir.h>
|
||||
|
||||
#define CONFIG_VERSION "GENPLUS 1.2.2 "
|
||||
#define CONFIG_VERSION "GENPLUS 1.2.3 "
|
||||
|
||||
t_config config;
|
||||
|
||||
|
@ -146,23 +146,7 @@ void soundmenu ()
|
||||
sprintf (items[1], "FM Volume: %1.2f", config.fm_preamp);
|
||||
sprintf (items[2], "Volume Boost: %dX", config.boost);
|
||||
sprintf (items[3], "LowPass Filter: %s", config.filter ? " ON":"OFF");
|
||||
if (config.hq_fm == 0) sprintf (items[4], "HQ YM2612: OFF");
|
||||
else if (config.fm_core)
|
||||
{
|
||||
/* GENS core only got linear resampling */
|
||||
sprintf (items[4], "HQ YM2612: LINEAR");
|
||||
}
|
||||
else
|
||||
{
|
||||
/* MAME core uses libsamplerate */
|
||||
if (config.hq_fm == 1) sprintf (items[4], "HQ YM2612: LINEAR");
|
||||
else if (config.hq_fm == 2) sprintf (items[4], "HQ YM2612: LOW");
|
||||
else if (config.hq_fm == 3) sprintf (items[4], "HQ YM2612: FAST");
|
||||
else if (config.hq_fm == 4) sprintf (items[4], "HQ YM2612: MEDIUM");
|
||||
#ifdef USE_SINC_BEST
|
||||
else if (config.hq_fm == 5) sprintf (items[4], "HQ YM2612: BEST");
|
||||
#endif
|
||||
}
|
||||
sprintf (items[4], "HQ YM2612: %s", config.hq_fm ? " ON":"OFF");
|
||||
sprintf (items[5], "FM core: %s", config.fm_core ? "GENS" : "MAME");
|
||||
|
||||
ret = domenu (&items[0], count, 1);
|
||||
@ -194,11 +178,7 @@ void soundmenu ()
|
||||
break;
|
||||
|
||||
case 4:
|
||||
#ifdef USE_SINC_BEST
|
||||
config.hq_fm = (config.hq_fm + 1) % (config.fm_core ? 2 : 6);
|
||||
#else
|
||||
config.hq_fm = (config.hq_fm + 1) % (config.fm_core ? 2 : 5);
|
||||
#endif
|
||||
config.hq_fm ^= 1;
|
||||
if (genromsize)
|
||||
{
|
||||
audio_init(48000);
|
||||
|
@ -71,7 +71,7 @@ static const u16 pad_keys[8] =
|
||||
#define PAD_LEFT 2
|
||||
#define PAD_RIGHT 3
|
||||
|
||||
#define MAX_HELD_CNT 10
|
||||
#define MAX_HELD_CNT 8
|
||||
static u32 held_cnt = 0;
|
||||
|
||||
static u32 wpad_dirmap[3][4] =
|
||||
@ -537,8 +537,8 @@ static void wpad_update(s8 num, u8 i, u32 exp)
|
||||
}
|
||||
else
|
||||
{
|
||||
old_x -= input.analog[2][0];
|
||||
old_y -= input.analog[2][1];
|
||||
old_x += input.analog[2][0];
|
||||
old_y += input.analog[2][1];
|
||||
}
|
||||
}
|
||||
|
||||
@ -750,27 +750,12 @@ u16 ogc_input__getMenuButtons(void)
|
||||
WPAD_IR(0, &ir);
|
||||
|
||||
/* wiimote directions */
|
||||
if (q & WPAD_BUTTON_UP)
|
||||
{
|
||||
held_cnt = 0;
|
||||
p |= ir.valid ? PAD_BUTTON_UP : PAD_BUTTON_LEFT;
|
||||
}
|
||||
else if (q & WPAD_BUTTON_DOWN)
|
||||
{
|
||||
held_cnt = 0;
|
||||
p |= ir.valid ? PAD_BUTTON_DOWN : PAD_BUTTON_RIGHT;
|
||||
}
|
||||
else if (q & WPAD_BUTTON_LEFT)
|
||||
{
|
||||
held_cnt = 0;
|
||||
p |= ir.valid ? PAD_BUTTON_LEFT : PAD_BUTTON_DOWN;
|
||||
}
|
||||
else if (q & WPAD_BUTTON_RIGHT)
|
||||
{
|
||||
held_cnt = 0;
|
||||
p |= ir.valid ? PAD_BUTTON_RIGHT : PAD_BUTTON_UP;
|
||||
}
|
||||
else if (h & WPAD_BUTTON_UP)
|
||||
if (q & WPAD_BUTTON_UP) p |= ir.valid ? PAD_BUTTON_UP : PAD_BUTTON_LEFT;
|
||||
else if (q & WPAD_BUTTON_DOWN) p |= ir.valid ? PAD_BUTTON_DOWN : PAD_BUTTON_RIGHT;
|
||||
else if (q & WPAD_BUTTON_LEFT) p |= ir.valid ? PAD_BUTTON_LEFT : PAD_BUTTON_DOWN;
|
||||
else if (q & WPAD_BUTTON_RIGHT) p |= ir.valid ? PAD_BUTTON_RIGHT : PAD_BUTTON_UP;
|
||||
|
||||
if (h & WPAD_BUTTON_UP)
|
||||
{
|
||||
held_cnt ++;
|
||||
if (held_cnt == MAX_HELD_CNT)
|
||||
|
@ -399,7 +399,7 @@ static void gxScale(void)
|
||||
}
|
||||
|
||||
xshift = (config.aspect || !gc_pal) ? 8 : 4;
|
||||
yshift = vdp_pal ? 1 : -1;
|
||||
yshift = vdp_pal ? 1 : 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -30,8 +30,7 @@
|
||||
** half length : 340238
|
||||
** increment : 2381
|
||||
*/
|
||||
#ifdef USE_SINC_BEST
|
||||
|
||||
#ifndef NGC
|
||||
static const struct slow_high_qual_coeffs_s
|
||||
{ int increment ;
|
||||
coeff_t coeffs [340239] ;
|
||||
|
@ -30,7 +30,7 @@
|
||||
** half length : 22437
|
||||
** increment : 491
|
||||
*/
|
||||
|
||||
#ifndef NGC
|
||||
static const struct slow_mid_qual_coeffs_s
|
||||
{ int increment ;
|
||||
coeff_t coeffs [22438] ;
|
||||
@ -22478,3 +22478,4 @@ static const struct slow_mid_qual_coeffs_s
|
||||
}
|
||||
} ; /* mid_qual_coeffs */
|
||||
|
||||
#endif
|
||||
|
@ -186,13 +186,13 @@ sinc_set_converter (SRC_PRIVATE *psrc, int src_enum)
|
||||
temp_filter.index_inc = fastest_coeffs.increment ;
|
||||
break ;
|
||||
|
||||
#ifndef NGC
|
||||
case SRC_SINC_MEDIUM_QUALITY :
|
||||
temp_filter.coeffs = slow_mid_qual_coeffs.coeffs ;
|
||||
temp_filter.coeff_half_len = ARRAY_LEN (slow_mid_qual_coeffs.coeffs) - 1 ;
|
||||
temp_filter.index_inc = slow_mid_qual_coeffs.increment ;
|
||||
break ;
|
||||
|
||||
#ifdef USE_SINC_BEST
|
||||
case SRC_SINC_BEST_QUALITY :
|
||||
temp_filter.coeffs = slow_high_qual_coeffs.coeffs ;
|
||||
temp_filter.coeff_half_len = ARRAY_LEN (slow_high_qual_coeffs.coeffs) - 1 ;
|
||||
|
@ -868,11 +868,11 @@ INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm)
|
||||
INLINE void advance_lfo()
|
||||
{
|
||||
UINT8 pos;
|
||||
UINT8 prev_pos;
|
||||
/*UINT8 prev_pos;*/
|
||||
|
||||
if (ym2612.OPN.lfo_inc) /* LFO enabled ? */
|
||||
{
|
||||
prev_pos = ym2612.OPN.lfo_cnt>>LFO_SH & 127;
|
||||
/*prev_pos = ym2612.OPN.lfo_cnt>>LFO_SH & 127;*/
|
||||
|
||||
ym2612.OPN.lfo_cnt += ym2612.OPN.lfo_inc;
|
||||
|
||||
@ -895,7 +895,7 @@ INLINE void advance_lfo()
|
||||
}
|
||||
|
||||
/* PM works with 4 times slower clock */
|
||||
prev_pos >>= 2;
|
||||
/*prev_pos >>= 2;*/
|
||||
pos >>= 2;
|
||||
/* update PM when LFO output changes */
|
||||
/*if (prev_pos != pos)*/ /* can't use global lfo_pm for this optimization, must be chip->lfo_pm instead*/
|
||||
|
@ -164,7 +164,7 @@ void sound_update(void)
|
||||
}
|
||||
|
||||
/* samplerate conversion */
|
||||
src_simple (&src_data, SRC_LINEAR + 1 - config.hq_fm, 2);
|
||||
src_simple (&src_data, SRC_SINC_FASTEST, 2);
|
||||
|
||||
/* this is basically libsamplerate "src_float_to_int_array" function, adapted to interlace samples */
|
||||
len = snd.buffer_size;
|
||||
@ -220,8 +220,8 @@ void fm_write(unsigned int cpu, unsigned int address, unsigned int data)
|
||||
{
|
||||
if (address & 1)
|
||||
{
|
||||
snd.fm.curStage = fm_sample_cnt(cpu);
|
||||
fm_update();
|
||||
snd.fm.curStage = fm_sample_cnt(cpu);
|
||||
fm_update();
|
||||
}
|
||||
_YM2612_Write(address & 3, data);
|
||||
}
|
||||
|
@ -231,9 +231,8 @@ int system_frame (int do_skip)
|
||||
hint_pending = 1;
|
||||
hvint_updated = 0;
|
||||
|
||||
/* previous scanline was shortened (see below), we execute extra cycles on this line */
|
||||
if (line != 0) aim_m68k += 36;
|
||||
}
|
||||
/* adjust timings to take decrement in account */
|
||||
if ((line != 0) || (h_counter == 0)) aim_m68k += 36;
|
||||
|
||||
/* HINT will be triggered on next line, approx. 36 cycles before VDP starts line rendering */
|
||||
/* during this period, any VRAM/CRAM/VSRAM writes should NOT be taken in account before next line */
|
||||
|
Loading…
Reference in New Issue
Block a user