builtin_gpu="peops"
fi
-#if [ "$ARCH" = "x86_64" ]; then
- # currently we are full of 32bit assumptions,
- # at least savestate compatibility will break without these
-# CFLAGS="$CFLAGS -m32"
-# LDFLAGS="$LDFLAGS -m32"
-#fi
-
# supposedly we can avoid -fPIC on armv5 for slightly better performace?
if [ "$ARCH" != "arm" -o "$have_armv6" = "yes" ]; then
PLUGIN_CFLAGS="$PLUGIN_CFLAGS -fPIC"
#include "psxdma.h"
cdrStruct cdr;
+static unsigned char *pTransfer;
/* CD-ROM magic numbers */
#define CdlSync 0
if (cdr.Readed == 0) {
ret = 0;
} else {
- ret = *cdr.pTransfer++;
+ ret = *pTransfer++;
}
#ifdef CDR_LOG
if (rt == 0x80 && !(cdr.Ctrl & 0x3) && cdr.Readed == 0) {
cdr.Readed = 1;
- cdr.pTransfer = cdr.Transfer;
+ pTransfer = cdr.Transfer;
switch (cdr.Mode & 0x30) {
case MODE_SIZE_2328:
case 0x00:
- cdr.pTransfer += 12;
+ pTransfer += 12;
break;
case MODE_SIZE_2340:
- cdr.pTransfer += 0;
+ pTransfer += 0;
break;
default:
- CdlPlay
- Spams DMA3 and gets buffer overrun
*/
- size = CD_FRAMESIZE_RAW - (cdr.pTransfer - cdr.Transfer);
+ size = CD_FRAMESIZE_RAW - (pTransfer - cdr.Transfer);
if (size > cdsize)
size = cdsize;
if (size > 0)
{
- memcpy(ptr, cdr.pTransfer, size);
+ memcpy(ptr, pTransfer, size);
}
psxCpu->Clear(madr, cdsize / 4);
- cdr.pTransfer += cdsize;
+ pTransfer += cdsize;
// burst vs normal
cdr.CurTrack = 1;
cdr.File = 1;
cdr.Channel = 1;
+ pTransfer = cdr.Transfer;
// BIOS player - default values
cdr.AttenuatorLeft[0] = 0x80;
}
int cdrFreeze(gzFile f, int Mode) {
- uintptr_t tmp;
-
+ u32 tmp;
if( Mode == 0 ) {
StopCdda();
gzfreeze(&cdr, sizeof(cdr));
if (Mode == 1)
- tmp = cdr.pTransfer - cdr.Transfer;
+ tmp = pTransfer - cdr.Transfer;
gzfreeze(&tmp, sizeof(tmp));
if (Mode == 0) {
- cdr.pTransfer = cdr.Transfer + tmp;
+ pTransfer = cdr.Transfer + tmp;
if (cdr.Play && !Config.Cdda)
CDR_play(cdr.SetSectorPlay);
unsigned char StatP;
unsigned char Transfer[CD_FRAMESIZE_RAW];
- unsigned char *pTransfer;
+ unsigned int pad1;
unsigned char Prev[4];
unsigned char Param[8];
}
int mdecFreeze(gzFile f, int Mode) {
- gzfreeze(&mdec, sizeof(mdec));
+ u8 *base = (u8 *)&psxM[0x100000];
+ u32 v;
+
+ gzfreeze(&mdec.reg0, sizeof(mdec.reg0));
+ gzfreeze(&mdec.reg1, sizeof(mdec.reg1));
+
+ // old code used to save raw pointers..
+ v = (u8 *)mdec.rl - base;
+ gzfreeze(&v, sizeof(v));
+ mdec.rl = (u16 *)(base + (v & 0xffffe));
+ v = (u8 *)mdec.rl_end - base;
+ gzfreeze(&v, sizeof(v));
+ mdec.rl_end = (u16 *)(base + (v & 0xffffe));
+
+ v = 0;
+ if (mdec.block_buffer_pos)
+ v = mdec.block_buffer_pos - base;
+ gzfreeze(&v, sizeof(v));
+ mdec.block_buffer_pos = 0;
+ if (v)
+ mdec.block_buffer_pos = base + (v & 0xfffff);
+
+ gzfreeze(&mdec.block_buffer, sizeof(mdec.block_buffer));
+ gzfreeze(&mdec.pending_dma1, sizeof(mdec.pending_dma1));
gzfreeze(iq_y, sizeof(iq_y));
gzfreeze(iq_uv, sizeof(iq_uv));
int SB[32+32]; // Pete added another 32 dwords in 1.6 ... prevents overflow issues with gaussian/cubic interpolation (thanx xodnizel!), and can be used for even better interpolations, eh? :)\r
int sval;\r
\r
- unsigned char * pStart; // start ptr into sound mem\r
- unsigned char * pCurr; // current pos in sound mem\r
- unsigned char * pLoop; // loop ptr in sound mem\r
+ int iStart; // start ptr into sound mem\r
+ int iCurr; // current pos in sound mem\r
+ int iLoop; // loop ptr in sound mem\r
\r
int bOn; // is channel active (sample playing?)\r
int bStop; // is channel stopped (sample _can_ still be playing, ADSR Release phase)\r
d->spos = s->spos;\r
d->sinc = s->sinc;\r
memcpy(d->SB, s->SB, sizeof(d->SB));\r
- d->pStart = (unsigned char *)((regAreaGet(ch,6)&~1)<<3);\r
- d->pCurr = s->pCurr;\r
- d->pLoop = s->pLoop;\r
+ d->iStart = (regAreaGet(ch,6)&~1)<<3;\r
+ d->iCurr = 0; // set by the caller\r
+ d->iLoop = 0; // set by the caller\r
d->bOn = !!(dwChannelOn & (1<<ch));\r
d->bStop = s->bStop;\r
d->bReverb = s->bReverb;\r
d->spos = s->spos;\r
d->sinc = s->sinc;\r
memcpy(d->SB, s->SB, sizeof(d->SB));\r
- d->pCurr = (void *)((long)s->pCurr & 0x7fff0);\r
- d->pLoop = (void *)((long)s->pLoop & 0x7fff0);\r
+ d->pCurr = (void *)((long)s->iCurr & 0x7fff0);\r
+ d->pLoop = (void *)((long)s->iLoop & 0x7fff0);\r
if (s->bOn) dwChannelOn |= 1<<ch;\r
d->bStop = s->bStop;\r
d->bReverb = s->bReverb;\r
dwChannelOn&=~(1<<i);\r
\r
save_channel(&pFO->s_chan[i],&s_chan[i],i);\r
- if(pFO->s_chan[i].pCurr)\r
- pFO->s_chan[i].pCurr-=(unsigned long)spuMemC;\r
- if(pFO->s_chan[i].pLoop)\r
- pFO->s_chan[i].pLoop-=(unsigned long)spuMemC;\r
+ if(s_chan[i].pCurr)\r
+ pFO->s_chan[i].iCurr=s_chan[i].pCurr-spuMemC;\r
+ if(s_chan[i].pLoop)\r
+ pFO->s_chan[i].iLoop=s_chan[i].pLoop-spuMemC;\r
}\r
\r
return 1;\r