Added option to swap bytes in charge of duty cycles, a bug present on some Dendy models.
This commit is contained in:
parent
36e1b07c19
commit
21d94f7f27
|
@ -226,6 +226,7 @@ static CFGSTRUCT fceuconfig[] =
|
|||
AC(soundNoisevol),
|
||||
AC(soundPCMvol),
|
||||
AC(muteTurbo),
|
||||
AC(swapDuty),
|
||||
|
||||
AC(goptions),
|
||||
NAC("eoptions",eoptions),
|
||||
|
|
|
@ -147,6 +147,7 @@ int genie = 0;
|
|||
int pal_emulation = 0;
|
||||
int pal_setting_specified = 0;
|
||||
int dendy = 0;
|
||||
bool swapDuty = 0; // some dendy models had duty cycle bits swapped
|
||||
int ntsccol = 0, ntsctint, ntschue;
|
||||
std::string BaseDirectory;
|
||||
int PauseAfterLoad;
|
||||
|
|
|
@ -104,6 +104,7 @@ extern int soundPCMvol; //Sound channel PCM - volume control
|
|||
|
||||
extern int soundquality;
|
||||
extern bool muteTurbo;
|
||||
extern bool swapDuty;
|
||||
|
||||
extern uint8 cpalette[192];
|
||||
extern int srendlinen;
|
||||
|
|
|
@ -422,8 +422,8 @@ BEGIN
|
|||
COMBOBOX COMBO_SOUND_RATE,50,78,53,46,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX COMBO_SOUND_QUALITY,50,54,67,46,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Quality:",65455,17,54,27,10
|
||||
CONTROL "Mute frame advance.",CHECK_SOUND_MUTEFA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,110,87,11
|
||||
CONTROL "Mute Turbo.",CHECK_SOUND_MUTETURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,150,111,55,10
|
||||
CONTROL "Mute frame advance",CHECK_SOUND_MUTEFA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,110,87,11
|
||||
CONTROL "Mute Turbo",CHECK_SOUND_MUTETURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,138,111,53,10
|
||||
GROUPBOX "Triangle",131,70,142,44,93,WS_GROUP
|
||||
CONTROL "",CTL_VOLUME_TRACKBAR_TRIANGLE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_VERT | TBS_BOTH | WS_TABSTOP,78,150,28,83
|
||||
GROUPBOX "Square1",132,121,142,44,93,WS_GROUP
|
||||
|
@ -438,6 +438,7 @@ BEGIN
|
|||
PUSHBUTTON "Restore defaults",IDC_SOUND_RESTOREDEFAULTVOL,19,238,56,11
|
||||
LTEXT "",ID_SOUND_TRITOP,76,135,38,8
|
||||
LTEXT "",ID_SOUND_QUALITYNOTIFY,170,133,144,8
|
||||
CONTROL "Swap Duty Cycles",CHECK_SOUND_SWAPDUTY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,239,110,74,10
|
||||
END
|
||||
|
||||
SUBORKBDIALOG DIALOGEX 13, 72, 478, 171
|
||||
|
|
|
@ -634,6 +634,7 @@
|
|||
#define IDC_COPY_INPUT 1203
|
||||
#define IDC_AUTORESUMECDLOGGING 1203
|
||||
#define IDC_MASK_UNUSED_GRAPHICS 1203
|
||||
#define CHECK_SOUND_SWAPDUTY 1203
|
||||
#define IDC_VOLUMEGROUP 1204
|
||||
#define IDC_OMITBLANK 1204
|
||||
#define IDC_CHECK3 1204
|
||||
|
|
|
@ -400,6 +400,7 @@ static void UpdateSD(HWND hwndDlg)
|
|||
CheckDlgButton(hwndDlg,CHECK_SOUND_GLOBAL_FOCUS,(soundoptions&SO_GFOCUS)?BST_CHECKED:BST_UNCHECKED);
|
||||
CheckDlgButton(hwndDlg,CHECK_SOUND_MUTEFA,(soundoptions&SO_MUTEFA)?BST_CHECKED:BST_UNCHECKED);
|
||||
CheckDlgButton(hwndDlg,CHECK_SOUND_MUTETURBO,(muteTurbo)?BST_CHECKED:BST_UNCHECKED);
|
||||
CheckDlgButton(hwndDlg,CHECK_SOUND_SWAPDUTY,(swapDuty)?BST_CHECKED:BST_UNCHECKED);
|
||||
// The option formerly flagged by SO_OLDUP can no longer be enabled.
|
||||
// CheckDlgButton(hwndDlg,131,(soundoptions&SO_OLDUP)?BST_CHECKED:BST_UNCHECKED);
|
||||
SendDlgItemMessage(hwndDlg,COMBO_SOUND_QUALITY,CB_SETCURSEL,soundquality,(LPARAM)(LPSTR)0);
|
||||
|
@ -412,6 +413,7 @@ static void UpdateSD(HWND hwndDlg)
|
|||
|
||||
if (!soundo)
|
||||
{
|
||||
EnableWindow(GetDlgItem(hwndDlg,CHECK_SOUND_SWAPDUTY),FALSE);
|
||||
EnableWindow(GetDlgItem(hwndDlg,CHECK_SOUND_MUTETURBO),FALSE);
|
||||
EnableWindow(GetDlgItem(hwndDlg,CHECK_SOUND_MUTEFA),FALSE);
|
||||
EnableWindow(GetDlgItem(hwndDlg,CHECK_SOUND_8BIT),FALSE);
|
||||
|
@ -693,6 +695,9 @@ case WM_COMMAND:
|
|||
case CHECK_SOUND_MUTETURBO:
|
||||
muteTurbo ^= 1;
|
||||
break;
|
||||
case CHECK_SOUND_SWAPDUTY:
|
||||
swapDuty ^=1;
|
||||
break;
|
||||
case CHECK_SOUND_ENABLED:soundo=!soundo;
|
||||
if(!soundo) TrashSound();
|
||||
else soundo=InitSound();
|
||||
|
|
|
@ -229,9 +229,12 @@ static DECLFW(Write_PSG)
|
|||
A&=0x1F;
|
||||
switch(A)
|
||||
{
|
||||
case 0x0:DoSQ1();
|
||||
case 0x0:
|
||||
DoSQ1();
|
||||
EnvUnits[0].Mode=(V&0x30)>>4;
|
||||
EnvUnits[0].Speed=(V&0xF);
|
||||
if (swapDuty)
|
||||
V = (V&0x3F)|((V&0x80)>>1)|((V&0x40)<<1);
|
||||
break;
|
||||
case 0x1:
|
||||
sweepon[0]=V&0x80;
|
||||
|
@ -248,18 +251,22 @@ static DECLFW(Write_PSG)
|
|||
DoSQ2();
|
||||
EnvUnits[1].Mode=(V&0x30)>>4;
|
||||
EnvUnits[1].Speed=(V&0xF);
|
||||
if (swapDuty)
|
||||
V = (V&0x3F)|((V&0x80)>>1)|((V&0x40)<<1);
|
||||
break;
|
||||
case 0x5:
|
||||
sweepon[1]=V&0x80;
|
||||
break;
|
||||
case 0x6:DoSQ2();
|
||||
case 0x6:
|
||||
DoSQ2();
|
||||
curfreq[1]&=0xFF00;
|
||||
curfreq[1]|=V;
|
||||
break;
|
||||
case 0x7:
|
||||
SQReload(1,V);
|
||||
break;
|
||||
case 0xa:DoTriangle();
|
||||
case 0xa:
|
||||
DoTriangle();
|
||||
break;
|
||||
case 0xb:
|
||||
DoTriangle();
|
||||
|
@ -267,11 +274,13 @@ static DECLFW(Write_PSG)
|
|||
lengthcount[2]=lengthtable[(V>>3)&0x1f];
|
||||
TriMode=1; // Load mode
|
||||
break;
|
||||
case 0xC:DoNoise();
|
||||
case 0xC:
|
||||
DoNoise();
|
||||
EnvUnits[2].Mode=(V&0x30)>>4;
|
||||
EnvUnits[2].Speed=(V&0xF);
|
||||
break;
|
||||
case 0xE:DoNoise();
|
||||
case 0xE:
|
||||
DoNoise();
|
||||
break;
|
||||
case 0xF:
|
||||
DoNoise();
|
||||
|
@ -279,9 +288,9 @@ static DECLFW(Write_PSG)
|
|||
lengthcount[3]=lengthtable[(V>>3)&0x1f];
|
||||
EnvUnits[2].reloaddec=1;
|
||||
break;
|
||||
case 0x10:DoPCM();
|
||||
case 0x10:
|
||||
DoPCM();
|
||||
LoadDMCPeriod(V&0xF);
|
||||
|
||||
if(SIRQStat&0x80)
|
||||
{
|
||||
if(!(V&0x80))
|
||||
|
|
|
@ -58,6 +58,7 @@ extern unsigned char *cdloggerdata;
|
|||
#endif
|
||||
|
||||
extern uint32 soundtsoffs;
|
||||
extern bool swapDuty;
|
||||
#define SOUNDTS (timestamp + soundtsoffs)
|
||||
|
||||
void SetNESSoundMap(void);
|
||||
|
|
Loading…
Reference in New Issue