WriteLog("OP: Phrase dump\n ----------\n");
for(uint32 i=0; i<0x100; i+=8)
{
- uint32 hi = jaguar_long_read(olp + i), lo = jaguar_long_read(olp + i + 4);
+ uint32 hi = JaguarReadLong(olp + i, OP), lo = JaguarReadLong(olp + i + 4, OP);
WriteLog("\t%08X: %08X %08X %s", olp + i, hi, lo, opType[lo & 0x07]);
if ((lo & 0x07) == 3)
{
// Object Processor memory access
// Memory range: F00010 - F00027
//
-void op_byte_write(uint32 offset, uint8 data)
+uint8 OPReadByte(uint32 offset, uint32 who/*=UNKNOWN*/)
{
offset &= 0x3F;
- objectp_ram[offset] = data;
+ return objectp_ram[offset];
}
-void op_word_write(uint32 offset, uint16 data)
+uint16 OPReadWord(uint32 offset, uint32 who/*=UNKNOWN*/)
{
offset &= 0x3F;
-// objectp_ram[offset] = (data >> 8) & 0xFF;
-// objectp_ram[offset+1] = data & 0xFF;
- SET16(objectp_ram, offset, data);
-
-/*if (offset == 0x20)
-WriteLog("OP: Setting lo list pointer: %04X\n", data);
-if (offset == 0x22)
-WriteLog("OP: Setting hi list pointer: %04X\n", data);//*/
+ return GET16(objectp_ram, offset);
}
-uint8 op_byte_read(uint32 offset)
+// F00010-F00017 R xxxxxxxx xxxxxxxx OB - current object code from the graphics processor
+// F00020-F00023 W xxxxxxxx xxxxxxxx OLP - start of the object list
+// F00026 W -------- -------x OBF - object processor flag
+
+void OPWriteByte(uint32 offset, uint8 data, uint32 who/*=UNKNOWN*/)
{
offset &= 0x3F;
- return objectp_ram[offset];
+ objectp_ram[offset] = data;
}
-uint16 op_word_read(uint32 offset)
+void OPWriteWord(uint32 offset, uint16 data, uint32 who/*=UNKNOWN*/)
{
-// return (objectp_ram[offset & 0x3F] << 8) | objectp_ram[(offset+1) & 0x3F];
offset &= 0x3F;
- return GET16(objectp_ram, offset);
-}
+ SET16(objectp_ram, offset, data);
-// F00010-F00017 R xxxxxxxx xxxxxxxx OB - current object code from the graphics processor
-// F00020-F00023 W xxxxxxxx xxxxxxxx OLP - start of the object list
-// F00026 W -------- -------x OBF - object processor flag
+/*if (offset == 0x20)
+WriteLog("OP: Setting lo list pointer: %04X\n", data);
+if (offset == 0x22)
+WriteLog("OP: Setting hi list pointer: %04X\n", data);//*/
+}
uint32 op_get_list_pointer(void)
{
uint64 op_load_phrase(uint32 offset)
{
offset &= ~0x07; // 8 byte alignment
- return ((uint64)jaguar_long_read(offset) << 32) | (uint64)jaguar_long_read(offset+4);
+ return ((uint64)JaguarReadLong(offset, OP) << 32) | (uint64)JaguarReadLong(offset+4, OP);
}
void OPStorePhrase(uint32 offset, uint64 p)
{
offset &= ~0x07; // 8 byte alignment
- jaguar_long_write(offset, p >> 32);
- jaguar_long_write(offset + 4, p & 0xFFFFFFFF);
+ JaguarWriteLong(offset, p >> 32, OP);
+ JaguarWriteLong(offset + 4, p & 0xFFFFFFFF, OP);
}
//
//No, the reason this was needed is that the OP code before was wrong. Any value
//less than VDB will get written to the top line of the display!
// if (ypos == 0)
-// ypos = tom_word_read(0xF00046) / 2; // Get the VDB value
+// ypos = TOMReadWord(0xF00046, OP) / 2; // Get the VDB value
uint32 height = (p0 & 0xFFC000) >> 14;
uint32 oldOPP = op_pointer - 8;
// *** BEGIN OP PROCESSOR TESTING ONLY ***
//No, the reason this was needed is that the OP code before was wrong. Any value
//less than VDB will get written to the top line of the display!
// if (ypos == 0)
-// ypos = tom_word_read(0xF00046) / 2; // Get the VDB value
+// ypos = TOMReadWord(0xF00046, OP) / 2; // Get the VDB value
uint32 height = (p0 & 0xFFC000) >> 14;
uint32 oldOPP = op_pointer - 8;
// *** BEGIN OP PROCESSOR TESTING ONLY ***
// ypos ^= 0x01;
// if ((2 * tom_get_scanline()) == ypos || ypos == 0x7FF)
//Here we're using VC instead of the bogus tom_get_scanline() value...
- if (tom_word_read(0xF00006) == ypos || ypos == 0x7FF)
+ if (TOMReadWord(0xF00006, OP) == ypos || ypos == 0x7FF)
op_pointer = link;
break;
case CONDITION_LESS_THAN:
// if ((2 * tom_get_scanline()) < ypos)
- if (tom_word_read(0xF00006) < ypos)
+ if (TOMReadWord(0xF00006, OP) < ypos)
op_pointer = link;
break;
case CONDITION_GREATER_THAN:
// if ((2 * tom_get_scanline()) > ypos)
- if (tom_word_read(0xF00006) > ypos)
+ if (TOMReadWord(0xF00006, OP) > ypos)
op_pointer = link;
break;
case CONDITION_OP_FLAG_SET:
int32 lbufDelta = ((int8)((flags << 7) & 0xFF) >> 5) | 0x02;
// Fetch 1st phrase...
- uint64 pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ uint64 pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
//Note that firstPix should only be honored *if* we start with the 1st phrase of the bitmap
//i.e., we didn't clip on the margin...
pixels <<= firstPix; // Skip first N pixels (N=firstPix)...
i = 0;
// Fetch next phrase...
data += pitch << 3; // Multiply pitch * 8 (optimize: precompute this value)
- pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
}
}
else if (depth == 1) // 2 BPP
while (iwidth--)
{
// Fetch phrase...
- uint64 pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ uint64 pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
data += pitch << 3; // Multiply pitch * 8 (optimize: precompute this value)
for(int i=0; i<32; i++)
while (iwidth--)
{
// Fetch phrase...
- uint64 pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ uint64 pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
data += pitch << 3; // Multiply pitch * 8 (optimize: precompute this value)
for(int i=0; i<16; i++)
while (iwidth--)
{
// Fetch phrase...
- uint64 pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ uint64 pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
data += pitch << 3; // Multiply pitch * 8 (optimize: precompute this value)
for(int i=0; i<8; i++)
while (iwidth--)
{
// Fetch phrase...
- uint64 pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ uint64 pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
data += pitch << 3; // Multiply pitch * 8 (optimize: precompute this value)
for(int i=0; i<4; i++)
while (iwidth--)
{
// Fetch phrase...
- uint64 pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ uint64 pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
data += pitch << 3; // Multiply pitch * 8 (optimize: precompute this value)
for(int i=0; i<2; i++)
int32 lbufDelta = ((int8)((flags << 7) & 0xFF) >> 5) | 0x02;
int pixCount = 0;
- uint64 pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ uint64 pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
while ((int32)iwidth > 0)
{
int phrasesToSkip = pixCount / 64, pixelShift = pixCount % 64;
data += (pitch << 3) * phrasesToSkip;
- pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
pixels <<= 1 * pixelShift;
iwidth -= phrasesToSkip;
pixCount = pixelShift;
int32 lbufDelta = ((int8)((flags << 7) & 0xFF) >> 5) | 0x02;
int pixCount = 0;
- uint64 pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ uint64 pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
while ((int32)iwidth > 0)
{
int phrasesToSkip = pixCount / 32, pixelShift = pixCount % 32;
data += (pitch << 3) * phrasesToSkip;
- pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
pixels <<= 2 * pixelShift;
iwidth -= phrasesToSkip;
pixCount = pixelShift;
int32 lbufDelta = ((int8)((flags << 7) & 0xFF) >> 5) | 0x02;
int pixCount = 0;
- uint64 pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ uint64 pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
while ((int32)iwidth > 0)
{
int phrasesToSkip = pixCount / 16, pixelShift = pixCount % 16;
data += (pitch << 3) * phrasesToSkip;
- pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
pixels <<= 4 * pixelShift;
iwidth -= phrasesToSkip;
pixCount = pixelShift;
int32 lbufDelta = ((int8)((flags << 7) & 0xFF) >> 5) | 0x02;
int pixCount = 0;
- uint64 pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ uint64 pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
while ((int32)iwidth > 0)
{
int phrasesToSkip = pixCount / 8, pixelShift = pixCount % 8;
data += (pitch << 3) * phrasesToSkip;
- pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
pixels <<= 8 * pixelShift;
iwidth -= phrasesToSkip;
pixCount = pixelShift;
int32 lbufDelta = ((int8)((flags << 7) & 0xFF) >> 5) | 0x02;
int pixCount = 0;
- uint64 pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ uint64 pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
while ((int32)iwidth > 0)
{
int phrasesToSkip = pixCount / 4, pixelShift = pixCount % 4;
data += (pitch << 3) * phrasesToSkip;
- pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
pixels <<= 16 * pixelShift;
iwidth -= phrasesToSkip;
while (iwidth--)
{
// Fetch phrase...
- uint64 pixels = ((uint64)jaguar_long_read(data) << 32) | jaguar_long_read(data + 4);
+ uint64 pixels = ((uint64)JaguarReadLong(data, OP) << 32) | JaguarReadLong(data + 4, OP);
data += pitch << 3; // Multiply pitch * 8 (optimize: precompute this value)
for(int i=0; i<2; i++)