[BS-X] Support for bigger SatData files
This commit is contained in:
parent
54d7fe404d
commit
99e678f049
33
bsx.cpp
33
bsx.cpp
@ -893,7 +893,7 @@ void S9xBSXSetStream1 (uint8 count)
|
||||
long str1size = BSX.sat_stream1.tellg();
|
||||
BSX.sat_stream1.seekg(0, BSX.sat_stream1.beg);
|
||||
float QueueSize = str1size / 22.;
|
||||
BSX.PPU[0x218A - BSXPPUBASE] = (uint8)(ceil(QueueSize));
|
||||
BSX.sat_stream1_queue = (uint16)(ceil(QueueSize));
|
||||
BSX.PPU[0x218D - BSXPPUBASE] = 0;
|
||||
BSX.sat_stream1_first = TRUE;
|
||||
BSX.sat_stream1_loaded = TRUE;
|
||||
@ -925,7 +925,7 @@ void S9xBSXSetStream2 (uint8 count)
|
||||
long str2size = BSX.sat_stream2.tellg();
|
||||
BSX.sat_stream2.seekg(0, BSX.sat_stream2.beg);
|
||||
float QueueSize = str2size / 22.;
|
||||
BSX.PPU[0x2190 - BSXPPUBASE] = (uint8)(ceil(QueueSize));
|
||||
BSX.sat_stream2_queue = (uint16)(ceil(QueueSize));
|
||||
BSX.PPU[0x2193 - BSXPPUBASE] = 0;
|
||||
BSX.sat_stream2_first = TRUE;
|
||||
BSX.sat_stream2_loaded = TRUE;
|
||||
@ -1005,7 +1005,7 @@ uint8 S9xGetBSXPPU (uint16 address)
|
||||
break;
|
||||
}
|
||||
|
||||
if (BSX.PPU[0x218A - BSXPPUBASE] <= 0)
|
||||
if (BSX.sat_stream1_queue <= 0)
|
||||
{
|
||||
BSX.sat_stream1_count++;
|
||||
S9xBSXSetStream1(BSX.sat_stream1_count - 1);
|
||||
@ -1018,7 +1018,14 @@ uint8 S9xGetBSXPPU (uint16 address)
|
||||
}
|
||||
|
||||
if (BSX.sat_stream1_loaded)
|
||||
{
|
||||
//Lock at 0x7F for bigger packets
|
||||
if (BSX.sat_stream1_queue >= 128)
|
||||
BSX.PPU[0x218A - BSXPPUBASE] = 0x7F;
|
||||
else
|
||||
BSX.PPU[0x218A - BSXPPUBASE] = BSX.sat_stream1_queue;
|
||||
t = BSX.PPU[0x218A - BSXPPUBASE];
|
||||
}
|
||||
else
|
||||
t = 0;
|
||||
break;
|
||||
@ -1042,9 +1049,9 @@ uint8 S9xGetBSXPPU (uint16 address)
|
||||
BSX.sat_stream1_first = FALSE;
|
||||
}
|
||||
|
||||
BSX.PPU[0x218A - BSXPPUBASE]--;
|
||||
BSX.sat_stream1_queue--;
|
||||
|
||||
if (BSX.PPU[0x218A - BSXPPUBASE] == 0)
|
||||
if (BSX.sat_stream1_queue == 0)
|
||||
{
|
||||
//Last packet
|
||||
temp |= 0x80;
|
||||
@ -1116,7 +1123,7 @@ uint8 S9xGetBSXPPU (uint16 address)
|
||||
break;
|
||||
}
|
||||
|
||||
if (BSX.PPU[0x2190 - BSXPPUBASE] <= 0)
|
||||
if (BSX.sat_stream2_queue <= 0)
|
||||
{
|
||||
BSX.sat_stream2_count++;
|
||||
S9xBSXSetStream2(BSX.sat_stream2_count - 1);
|
||||
@ -1129,7 +1136,13 @@ uint8 S9xGetBSXPPU (uint16 address)
|
||||
}
|
||||
|
||||
if (BSX.sat_stream2_loaded)
|
||||
{
|
||||
if (BSX.sat_stream2_queue >= 128)
|
||||
BSX.PPU[0x2190 - BSXPPUBASE] = 0x7F;
|
||||
else
|
||||
BSX.PPU[0x2190 - BSXPPUBASE] = BSX.sat_stream2_queue;
|
||||
t = BSX.PPU[0x2190 - BSXPPUBASE];
|
||||
}
|
||||
else
|
||||
t = 0;
|
||||
break;
|
||||
@ -1153,9 +1166,9 @@ uint8 S9xGetBSXPPU (uint16 address)
|
||||
BSX.sat_stream2_first = FALSE;
|
||||
}
|
||||
|
||||
BSX.PPU[0x2190 - BSXPPUBASE]--;
|
||||
BSX.sat_stream2_queue--;
|
||||
|
||||
if (BSX.PPU[0x2190 - BSXPPUBASE] == 0)
|
||||
if (BSX.sat_stream2_queue == 0)
|
||||
{
|
||||
//Last packet
|
||||
temp |= 0x80;
|
||||
@ -1488,6 +1501,10 @@ void S9xResetBSX (void)
|
||||
BSX.MMC[0x07] = BSX.MMC[0x08] = 0x80;
|
||||
BSX.MMC[0x0E] = 0x80;
|
||||
|
||||
// default register values
|
||||
BSX.PPU[0x2196 - BSXPPUBASE] = 0x10;
|
||||
BSX.PPU[0x2197 - BSXPPUBASE] = 0x80;
|
||||
|
||||
// stream reset
|
||||
BSX.sat_pf_latch1_enable = BSX.sat_dt_latch1_enable = FALSE;
|
||||
BSX.sat_pf_latch2_enable = BSX.sat_dt_latch2_enable = FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user