mirror of
https://github.com/libretro/beetle-pce-fast-libretro.git
synced 2024-11-26 17:40:40 +00:00
Cleanups
This commit is contained in:
parent
7c8001e543
commit
1f8c033d4a
@ -331,12 +331,7 @@ static void DoDMA(vdc_t *vdc)
|
||||
for(i = 0; i < 455; i++)
|
||||
{
|
||||
if(!vdc->DMAReadWrite)
|
||||
{
|
||||
if(vdc->SOUR >= VRAM_Size)
|
||||
VDC_UNDEFINED("Unmapped VRAM DMA read");
|
||||
|
||||
vdc->DMAReadBuffer = vdc->VRAM[vdc->SOUR];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(vdc->DESR < VRAM_Size)
|
||||
@ -356,7 +351,6 @@ static void DoDMA(vdc_t *vdc)
|
||||
{
|
||||
vdc->status |= VDCS_DV;
|
||||
HuC6280_IRQBegin(MDFN_IQIRQ1);
|
||||
VDC_DEBUG("DMA IRQ");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -382,12 +376,7 @@ DECLFW(VDC_Write)
|
||||
case 0x00: REGSETP(vdc->MAWR, V, msb); break;
|
||||
case 0x01: REGSETP(vdc->MARR, V, msb);
|
||||
if(msb)
|
||||
{
|
||||
if(vdc->MARR >= VRAM_Size)
|
||||
VDC_UNDEFINED("Unmapped VRAM VRR(MARR set) read");
|
||||
|
||||
vdc->read_buffer = vdc->VRAM[vdc->MARR];
|
||||
}
|
||||
break;
|
||||
case 0x02: if(!msb) vdc->write_latch = V;
|
||||
else
|
||||
@ -551,9 +540,6 @@ static INLINE void RebuildSATCache(vdc_t *vdc)
|
||||
static INLINE void DoSATDMA(vdc_t *vdc)
|
||||
{
|
||||
unsigned i;
|
||||
if(vdc->SATB > (VRAM_Size - 0x100))
|
||||
VDC_UNDEFINED("Unmapped VRAM SATB DMA read");
|
||||
|
||||
for(i = 0; i < 256; i++)
|
||||
vdc->SAT[i] = vdc->VRAM[(vdc->SATB + i) & 0xFFFF];
|
||||
|
||||
@ -602,7 +588,6 @@ static NO_INLINE void DrawSprites(vdc_t *vdc, const int32 end, uint16 *spr_lineb
|
||||
{
|
||||
vdc->status |= VDCS_OR;
|
||||
HuC6280_IRQBegin(MDFN_IQIRQ1);
|
||||
VDC_DEBUG("Overflow IRQ");
|
||||
}
|
||||
if(!unlimited_sprites)
|
||||
break;
|
||||
@ -676,7 +661,6 @@ static NO_INLINE void DrawSprites(vdc_t *vdc, const int32 end, uint16 *spr_lineb
|
||||
if(dest_pix[x] & 0x100)
|
||||
{
|
||||
vdc->status |= VDCS_CR;
|
||||
VDC_DEBUG("Sprite hit IRQ");
|
||||
HuC6280_IRQBegin(MDFN_IQIRQ1);
|
||||
}
|
||||
dest_pix[x] = raw_pixel | prio_or;
|
||||
@ -866,7 +850,6 @@ void VDC_RunFrame(EmulateSpecStruct *espec, bool IsHES)
|
||||
}
|
||||
if((int)vdc->RCRCount == ((int)vdc->RCR - 0x40) && (vdc->CR & 0x04))
|
||||
{
|
||||
VDC_DEBUG("RCR IRQ");
|
||||
vdc->status |= VDCS_RR;
|
||||
HuC6280_IRQBegin(MDFN_IQIRQ1);
|
||||
}
|
||||
@ -1007,7 +990,6 @@ void VDC_RunFrame(EmulateSpecStruct *espec, bool IsHES)
|
||||
|
||||
if(vdc->status & VDCS_VD)
|
||||
{
|
||||
VDC_DEBUG("VBlank IRQ");
|
||||
HuC6280_IRQBegin(MDFN_IQIRQ1);
|
||||
}
|
||||
|
||||
@ -1031,7 +1013,6 @@ void VDC_RunFrame(EmulateSpecStruct *espec, bool IsHES)
|
||||
{
|
||||
if(vdc->DCR & 0x01)
|
||||
{
|
||||
VDC_DEBUG("Sprite DMA IRQ");
|
||||
vdc->status |= VDCS_DS;
|
||||
HuC6280_IRQBegin(MDFN_IQIRQ1);
|
||||
}
|
||||
|
@ -8,9 +8,6 @@
|
||||
#define REGSETP(_reg, _data, _msb) { _reg &= 0xFF << ((_msb) ? 0 : 8); _reg |= (_data) << ((_msb) ? 8 : 0); }
|
||||
#define REGGETP(_reg, _msb) ((_reg >> ((_msb) ? 8 : 0)) & 0xFF)
|
||||
|
||||
#define VDC_DEBUG(x)
|
||||
#define VDC_UNDEFINED(x) { }
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -146,9 +143,6 @@ static INLINE uint8 VDC_Read(unsigned int A)
|
||||
if(msb)
|
||||
{
|
||||
vdc->MARR += vram_inc_tab[(vdc->CR >> 11) & 0x3];
|
||||
|
||||
if(vdc->MARR >= VRAM_Size)
|
||||
VDC_UNDEFINED("Unmapped VRAM VRR read");
|
||||
vdc->read_buffer = vdc->VRAM[vdc->MARR & VRAM_SizeMask];
|
||||
}
|
||||
}
|
||||
|
@ -53,42 +53,6 @@ static int tagcompare(const char *s1, const char *s2, int n){
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count){
|
||||
long i;
|
||||
int found = 0;
|
||||
int taglen = strlen(tag)+1; /* +1 for the = we append */
|
||||
char *fulltag = (char *)alloca(taglen+ 1);
|
||||
|
||||
strcpy(fulltag, tag);
|
||||
strcat(fulltag, "=");
|
||||
|
||||
for(i=0;i<vc->comments;i++){
|
||||
if(!tagcompare(vc->user_comments[i], fulltag, taglen)){
|
||||
if(count == found)
|
||||
/* We return a pointer to the data, not a copy */
|
||||
return vc->user_comments[i] + taglen;
|
||||
else
|
||||
found++;
|
||||
}
|
||||
}
|
||||
return NULL; /* didn't find anything */
|
||||
}
|
||||
|
||||
int vorbis_comment_query_count(vorbis_comment *vc, char *tag){
|
||||
int i,count=0;
|
||||
int taglen = strlen(tag)+1; /* +1 for the = we append */
|
||||
char *fulltag = (char *)alloca(taglen+1);
|
||||
strcpy(fulltag,tag);
|
||||
strcat(fulltag, "=");
|
||||
|
||||
for(i=0;i<vc->comments;i++){
|
||||
if(!tagcompare(vc->user_comments[i], fulltag, taglen))
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
void vorbis_comment_clear(vorbis_comment *vc){
|
||||
if(vc){
|
||||
long i;
|
||||
|
@ -153,11 +153,6 @@ extern void vorbis_info_init(vorbis_info *vi);
|
||||
extern void vorbis_info_clear(vorbis_info *vi);
|
||||
extern int vorbis_info_blocksize(vorbis_info *vi,int zo);
|
||||
extern void vorbis_comment_init(vorbis_comment *vc);
|
||||
extern void vorbis_comment_add(vorbis_comment *vc, char *comment);
|
||||
extern void vorbis_comment_add_tag(vorbis_comment *vc,
|
||||
char *tag, char *contents);
|
||||
extern char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count);
|
||||
extern int vorbis_comment_query_count(vorbis_comment *vc, char *tag);
|
||||
extern void vorbis_comment_clear(vorbis_comment *vc);
|
||||
|
||||
extern int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb);
|
||||
|
@ -983,9 +983,6 @@ int ov_clear(OggVorbis_File *vf){
|
||||
(vf->callbacks.close_func)(vf->datasource);
|
||||
memset(vf,0,sizeof(*vf));
|
||||
}
|
||||
#ifdef DEBUG_LEAKS
|
||||
_VDBG_dump();
|
||||
#endif
|
||||
return(0);
|
||||
}
|
||||
|
||||
@ -1296,7 +1293,7 @@ int ov_raw_seek(OggVorbis_File *vf,int64_t pos){
|
||||
/* rescales the number x from the range of [0,from] to [0,to]
|
||||
x is in the range [0,from]
|
||||
from, to are in the range [1, 1<<62-1] */
|
||||
int64_t rescale64(int64_t x, int64_t from, int64_t to){
|
||||
static int64_t rescale64(int64_t x, int64_t from, int64_t to){
|
||||
int64_t frac=0;
|
||||
int64_t ret=0;
|
||||
int i;
|
||||
|
Loading…
Reference in New Issue
Block a user