Properly protect the HLE instructions against corrupted memory.
Config.RCntFix = 1;
}
- var.value = NULL;
- var.key = "pcsx_rearmed_idiablofix";
-
- if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
- {
- if (strcmp(var.value, "disabled") == 0)
- spu_config.idiablofix = 0;
- else if (strcmp(var.value, "enabled") == 0)
- spu_config.idiablofix = 1;
- }
-
var.value = NULL;
var.key = "pcsx_rearmed_inuyasha_fix";
},
"simple",
},
- {
- "pcsx_rearmed_idiablofix",
- "Diablo Music Fix",
- NULL,
- {
- { "disabled", NULL },
- { "enabled", NULL },
- { NULL, NULL },
- },
- "disabled",
- },
{
"pcsx_rearmed_pe2_fix",
"Parasite Eve 2/Vandal Hearts 1/2 Fix",
},
NULL
},
- {
- "pcsx_rearmed_idiablofix",
- "Diablo Müzik Düzeltmesi",
- NULL,
- {
- { NULL, NULL },
- },
- NULL
- },
{
"pcsx_rearmed_pe2_fix",
"Parasite Eve 2/Vandal Hearts 1/2 Düzeltmleri",
pl_rearmed_cbs.gpu_peopsgl.iTexGarbageCollection = 1;
spu_config.iUseReverb = 1;
- spu_config.idiablofix = 0;
spu_config.iUseInterpolation = 1;
spu_config.iXAPitch = 0;
spu_config.iVolume = 768;
CE_INTVAL_P(gpu_peopsgl.iTexGarbageCollection),
CE_INTVAL_P(gpu_peopsgl.dwActFixes),
CE_INTVAL(spu_config.iUseReverb),
- CE_INTVAL(spu_config.idiablofix),
CE_INTVAL(spu_config.iXAPitch),
CE_INTVAL(spu_config.iUseInterpolation),
CE_INTVAL(spu_config.iTempo),
mee_range_h ("Volume boost", 0, volume_boost, -5, 30, h_spu_volboost),
mee_onoff ("Reverb", 0, spu_config.iUseReverb, 1),
mee_enum ("Interpolation", 0, spu_config.iUseInterpolation, men_spu_interp),
- mee_onoff ("Diablo Music fix", 0, spu_config.idiablofix, 1),
mee_onoff ("Adjust XA pitch", 0, spu_config.iXAPitch, 1),
mee_onoff_h ("Adjust tempo", 0, spu_config.iTempo, 1, h_spu_tempo),
mee_end,
cdr.Channel = cdr.Transfer[4 + 1];
}
+ /* Gameblabla
+ * Skips playing on channel 255.
+ * Fixes missing audio in Blue's Clues : Blue's Big Musical. (Should also fix Taxi 2)
+ * TODO : Check if this is the proper behaviour.
+ * */
if((cdr.Transfer[4 + 2] & 0x4) &&
(cdr.Transfer[4 + 1] == cdr.Channel) &&
- (cdr.Transfer[4 + 0] == cdr.File)) {
+ (cdr.Transfer[4 + 0] == cdr.File) && cdr.Channel != 255) {
int ret = xa_decode_sector(&cdr.Xa, cdr.Transfer+4, cdr.FirstSector);
if (!ret) {
cdrAttenuate(cdr.Xa.pcm, cdr.Xa.nsamples, cdr.Xa.stereo);
* 320x240x16@60Hz => 9.216 MB/s
* so 2.0 to 4.0 should be fine.
*/
-#define MDEC_BIAS 2
+
+/* Was set to 2 before but it would cause issues in R-types and Vandal Hearts videos.
+ * Setting it to 6 as dmitrysmagin did fix those... except for Galerians.
+ * Galerians needs this to be set to 10 (!!) before it looks properly.
+ * I've tried this with a few other games (including R-Types) and so far, this
+ * has not backfired.
+ * */
+#define MDEC_BIAS 10
#define DSIZE 8
#define DSIZE2 (DSIZE * DSIZE)
void psxBios_GPU_dw() { // 0x46
int size;
- s32 *ptr;
+ u32 *ptr;
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s\n", biosA0n[0x46]);
#endif
GPU_writeData(0xa0000000);
- GPU_writeData((a1<<16)|(a0&0xffff));
- GPU_writeData((a3<<16)|(a2&0xffff));
- size = (a2*a3+1)/2;
- ptr = (s32*)PSXM(Rsp[4]); //that is correct?
- do {
- GPU_writeData(SWAP32(*ptr));
- ptr++;
- } while(--size);
+ GPU_writeData((a1<<0x10)|(a0&0xffff));
+ GPU_writeData((a3<<0x10)|(a2&0xffff));
+ size = (a2*a3)/2;
+ ptr = (u32*)PSXM(Rsp[4]); //that is correct?
+ while(size--)
+ {
+ GPU_writeData(SWAPu32(*ptr++));
+ }
pc0 = ra;
}
void psxBios_mem2vram() { // 0x47
int size;
-
+ gpuSyncPluginSR();
GPU_writeData(0xa0000000);
- GPU_writeData((a1<<16)|(a0&0xffff));
- GPU_writeData((a3<<16)|(a2&0xffff));
- size = (a2*a3+1)/2;
+ GPU_writeData((a1<<0x10)|(a0&0xffff));
+ GPU_writeData((a3<<0x10)|(a2&0xffff));
+ size = ((((a2 * a3) / 2) >> 4) << 16);
GPU_writeStatus(0x04000002);
psxHwWrite32(0x1f8010f4,0);
psxHwWrite32(0x1f8010f0,psxHwRead32(0x1f8010f0)|0x800);
psxHwWrite32(0x1f8010a0,Rsp[4]);//might have a buggy...
- psxHwWrite32(0x1f8010a4,((size/16)<<16)|16);
+ psxHwWrite32(0x1f8010a4, size | 0x10);
psxHwWrite32(0x1f8010a8,0x01000201);
pc0 = ra;
}
void psxBios_GPU_cw() { // 0x49
+ gpuSyncPluginSR();
GPU_writeData(a0);
+ v0 = HW_GPU_STATUS;
pc0 = ra;
}
void psxBios_GPU_cwb() { // 0x4a
- s32 *ptr = (s32*)Ra0;
+ u32 *ptr = (u32*)Ra0;
int size = a1;
- while(size--) {
- GPU_writeData(SWAP32(*ptr));
- ptr++;
+ gpuSyncPluginSR();
+ while(size--)
+ {
+ GPU_writeData(SWAPu32(*ptr++));
}
pc0 = ra;
}
-
-void psxBios_GPU_SendPackets() { //4b:
+
+void psxBios_GPU_SendPackets() { //4b:
+ gpuSyncPluginSR();
GPU_writeStatus(0x04000002);
psxHwWrite32(0x1f8010f4,0);
psxHwWrite32(0x1f8010f0,psxHwRead32(0x1f8010f0)|0x800);
unsigned int bNoise:1; // noise active flag\r
unsigned int bFMod:2; // freq mod (0=off, 1=sound channel, 2=freq channel)\r
unsigned int prevflags:3; // flags from previous block\r
-\r
+ unsigned int bIgnoreLoop:1; // Ignore loop\r
int iLeftVolume; // left volume\r
int iRightVolume; // right volume\r
ADSRInfoEx ADSRX;\r
unsigned short regArea[0x400];\r
} SPUInfo;\r
\r
+#define regAreaGet(ch,offset) \\r
+ spu.regArea[((ch<<4)|(offset))>>1]\r
+\r
///////////////////////////////////////////////////////////\r
// SPU.C globals\r
///////////////////////////////////////////////////////////\r
void do_samples(unsigned int cycles_to, int do_sync);\r
void schedule_next_irq(void);\r
\r
-#define regAreaGet(ch,offset) \\r
- spu.regArea[((ch<<4)|(offset))>>1]\r
-\r
#define do_samples_if_needed(c, sync) \\r
do { \\r
if (sync || (int)((c) - spu.cycles_played) >= 16 * 768) \\r
//------------------------------------------------//\r
case 14: // loop?\r
spu.s_chan[ch].pLoop=spu.spuMemC+((val&~1)<<3);\r
+ spu.s_chan[ch].bIgnoreLoop = 1;\r
goto upd_irq;\r
//------------------------------------------------//\r
}\r
{\r
if((val&1) && regAreaGet(ch,6)) // mmm... start has to be set before key on !?!\r
{\r
- spu.s_chan[ch].pCurr=spu.spuMemC+((regAreaGet(ch,6)&~1)<<3); // must be block aligned\r
- if (spu_config.idiablofix == 0) spu.s_chan[ch].pLoop=spu.spuMemC+((regAreaGet(ch,14)&~1)<<3);\r
+ spu.s_chan[ch].bIgnoreLoop = 0;\r
spu.dwNewChannel|=(1<<ch);\r
}\r
}\r
s_chan->iSBPos=27;
s_chan->spos=0;
+ s_chan->pCurr = spu.spuMemC+((regAreaGet(ch,6)&~1)<<3);
+
spu.dwNewChannel&=~(1<<ch); // clear new channel bit
spu.dwChannelOn|=1<<ch;
spu.dwChannelDead&=~(1<<ch);
decode_block_data(SB, start + 2, predict_nr, shift_factor);
flags = start[1];
- if (flags & 4)
+ if (flags & 4 && (!s_chan->bIgnoreLoop))
s_chan->pLoop = start; // loop adress
start += 16;
spu.s_chan[i].ADSRX.SustainIncrease = 1;
spu.s_chan[i].pLoop = spu.spuMemC;
spu.s_chan[i].pCurr = spu.spuMemC;
+ spu.s_chan[i].bIgnoreLoop = 0;
}
spu.bSpuInit=1; // flag: we are inited
int iUseReverb;
int iUseInterpolation;
int iTempo;
- int idiablofix;
int iUseThread;
int iUseFixedUpdates; // output fixed number of samples/frame