mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-11-10 21:05:12 +01:00
[Core/CD] minor optimization
This commit is contained in:
parent
ba2d0dec0e
commit
e347ef2713
@ -243,7 +243,7 @@ void cdc_dma_update(void)
|
||||
}
|
||||
}
|
||||
|
||||
int cdc_decoder_update(uint32 header)
|
||||
void cdc_decoder_update(uint32 header)
|
||||
{
|
||||
/* data decoding enabled ? */
|
||||
if (cdc.ctrl[0] & BIT_DECEN)
|
||||
@ -274,7 +274,7 @@ int cdc_decoder_update(uint32 header)
|
||||
/* buffer RAM write enabled ? */
|
||||
if (cdc.ctrl[0] & BIT_WRRQ)
|
||||
{
|
||||
uint16 offset;
|
||||
int offset;
|
||||
|
||||
/* increment block pointer */
|
||||
cdc.pt.w += 2352;
|
||||
@ -292,19 +292,14 @@ int cdc_decoder_update(uint32 header)
|
||||
cdd_read_data(cdc.ram + 4 + offset);
|
||||
|
||||
/* take care of buffer overrun */
|
||||
if (offset > (0x4000 - 2048 - 4))
|
||||
offset = offset + 2048 + 4 - 0x4000;
|
||||
if (offset > 0)
|
||||
{
|
||||
/* data should be written at the start of buffer */
|
||||
memcpy(cdc.ram, cdc.ram + 0x4000, offset + 2048 + 4 - 0x4000);
|
||||
memcpy(cdc.ram, cdc.ram + 0x4000, offset);
|
||||
}
|
||||
|
||||
/* read next data block */
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* keep decoding same data block if Buffer Write is disabled */
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cdc_reg_w(unsigned char data)
|
||||
|
@ -63,7 +63,7 @@ extern void cdc_reset(void);
|
||||
extern int cdc_context_save(uint8 *state);
|
||||
extern int cdc_context_load(uint8 *state);
|
||||
extern void cdc_dma_update(void);
|
||||
extern int cdc_decoder_update(uint32 header);
|
||||
extern void cdc_decoder_update(uint32 header);
|
||||
extern void cdc_reg_w(unsigned char data);
|
||||
extern unsigned char cdc_reg_r(void);
|
||||
extern unsigned short cdc_host_r(void);
|
||||
|
@ -1480,7 +1480,7 @@ void scd_init(void)
|
||||
|
||||
case 0x0e:
|
||||
{
|
||||
/* $FE0000-$FEFFFF (mirrored every 1MB): 8KB backup RAM (Wonder Mega / X'Eye BIOS access it at $FD0000-$FD1FFF ?) */
|
||||
/* $FE0000-$FEFFFF (mirrored every 1MB): 8KB backup RAM */
|
||||
s68k.memory_map[i].base = NULL;
|
||||
s68k.memory_map[i].read8 = bram_read_byte;
|
||||
s68k.memory_map[i].read16 = bram_read_word;
|
||||
|
Loading…
Reference in New Issue
Block a user