mirror of
https://github.com/libretro/beetle-psx-libretro.git
synced 2024-11-23 08:49:47 +00:00
Simplify SimpleFIFO some more
This commit is contained in:
parent
921dbed515
commit
4137fb2987
@ -30,22 +30,12 @@ class SimpleFIFO
|
||||
return(size - in_count);
|
||||
}
|
||||
|
||||
INLINE uint8 ReadUnit(bool peek)
|
||||
INLINE uint8 ReadByte(void)
|
||||
{
|
||||
uint8 ret = data[read_pos];
|
||||
|
||||
if(!peek)
|
||||
{
|
||||
read_pos = (read_pos + 1) & (size - 1);
|
||||
in_count--;
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
INLINE uint8 ReadByte(bool peek)
|
||||
{
|
||||
return(ReadUnit(peek));
|
||||
uint8 ret = data[read_pos];
|
||||
read_pos = (read_pos + 1) & (size - 1);
|
||||
in_count--;
|
||||
return(ret);
|
||||
}
|
||||
|
||||
INLINE void Write(const uint8 *happy_data, uint32 happy_count)
|
||||
@ -61,14 +51,11 @@ class SimpleFIFO
|
||||
}
|
||||
}
|
||||
|
||||
INLINE void WriteUnit(const uint8& wr_data)
|
||||
INLINE void WriteByte(const uint8 wr_data)
|
||||
{
|
||||
Write(&wr_data, 1);
|
||||
}
|
||||
|
||||
INLINE void WriteByte(const uint8& wr_data)
|
||||
{
|
||||
Write(&wr_data, 1);
|
||||
data[write_pos] = wr_data;
|
||||
write_pos = (write_pos + 1) & (size - 1);
|
||||
in_count++;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1450,7 +1450,7 @@ void PS_CDC::Write(const int32_t timestamp, uint32 A, uint8 V)
|
||||
else if(V & 0x40) // Something CD-DA related(along with & 0x20 ???)?
|
||||
{
|
||||
for(unsigned i = 0; i < 4 && DMABuffer.in_count; i++)
|
||||
DMABuffer.ReadByte(false);
|
||||
DMABuffer.ReadByte();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1552,7 +1552,7 @@ uint8 PS_CDC::Read(const int32_t timestamp, uint32 A)
|
||||
case 0x02:
|
||||
//PSX_WARNING("[CDC] DMA Buffer manual read");
|
||||
if(DMABuffer.in_count)
|
||||
return DMABuffer.ReadByte(false);
|
||||
return DMABuffer.ReadByte();
|
||||
PSX_WARNING("[CDC] CD data transfer port read, but no data present!");
|
||||
break;
|
||||
case 0x03:
|
||||
@ -1578,7 +1578,7 @@ uint32 PS_CDC::DMARead(void)
|
||||
for(i = 0; i < 4; i++)
|
||||
{
|
||||
if(DMABuffer.in_count)
|
||||
data |= DMABuffer.ReadByte(false) << (i * 8);
|
||||
data |= DMABuffer.ReadByte() << (i * 8);
|
||||
else
|
||||
{
|
||||
PSX_WARNING("[CDC] DMA read buffer underflow!");
|
||||
|
Loading…
Reference in New Issue
Block a user