mirror of
https://github.com/robmcmullen/apple2.git
synced 2024-06-26 04:29:34 +00:00
Fixed double hires to have correct colors; fixed LC alt bank access.
This commit is contained in:
parent
ebcadf2555
commit
3107275cfe
|
@ -750,8 +750,8 @@ if (showpath)
|
||||||
#ifdef LC_DEBUGGING
|
#ifdef LC_DEBUGGING
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
b = ram[addr - 0x1000];
|
// b = ram[addr - 0x1000];
|
||||||
// b = (ramrd ? ram2[addr - 0x1000] : ram[addr - 0x1000]);
|
b = (altzp ? ram2[addr - 0x1000] : ram[addr - 0x1000]);
|
||||||
#ifdef LC_DEBUGGING
|
#ifdef LC_DEBUGGING
|
||||||
if (showpath)
|
if (showpath)
|
||||||
WriteLog("b is from LC bank #1 (ram[addr - 0x1000])...\n");
|
WriteLog("b is from LC bank #1 (ram[addr - 0x1000])...\n");
|
||||||
|
@ -761,8 +761,8 @@ if (showpath)
|
||||||
#ifdef LC_DEBUGGING
|
#ifdef LC_DEBUGGING
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
b = ram[addr];
|
// b = ram[addr];
|
||||||
// b = (ramrd ? ram2[addr] : ram[addr]);
|
b = (altzp ? ram2[addr] : ram[addr]);
|
||||||
#ifdef LC_DEBUGGING
|
#ifdef LC_DEBUGGING
|
||||||
if (showpath)
|
if (showpath)
|
||||||
WriteLog("b is from LC bank #2 (ram[addr])...\n");
|
WriteLog("b is from LC bank #2 (ram[addr])...\n");
|
||||||
|
@ -782,7 +782,6 @@ if (showpath)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if 1
|
|
||||||
// Check for 80STORE mode (STORE80 takes precedence over RAMRD/WRT)...
|
// Check for 80STORE mode (STORE80 takes precedence over RAMRD/WRT)...
|
||||||
if ((((addr >= 0x0400) && (addr <= 0x07FF)) || ((addr >= 0x2000) && (addr <= 0x3FFF))) && store80Mode)
|
if ((((addr >= 0x0400) && (addr <= 0x07FF)) || ((addr >= 0x2000) && (addr <= 0x3FFF))) && store80Mode)
|
||||||
{
|
{
|
||||||
|
@ -795,20 +794,10 @@ if (showpath)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finally, check for auxillary/altzp write switches
|
// Finally, check for auxillary/altzp write switches
|
||||||
#endif
|
|
||||||
if (addr < 0x0200)
|
if (addr < 0x0200)
|
||||||
b = (altzp ? ram2[addr] : ram[addr]);
|
b = (altzp ? ram2[addr] : ram[addr]);
|
||||||
else
|
else
|
||||||
b = (ramrd ? ram2[addr] : ram[addr]);
|
b = (ramrd ? ram2[addr] : ram[addr]);
|
||||||
// if (ramrd)
|
|
||||||
// b = ram2[addr];
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// if (altzp)
|
|
||||||
// b = ram2[addr];
|
|
||||||
// else
|
|
||||||
// b = ram[addr];
|
|
||||||
// }
|
|
||||||
#ifdef LC_DEBUGGING
|
#ifdef LC_DEBUGGING
|
||||||
if (showpath)
|
if (showpath)
|
||||||
WriteLog("b is from ram[addr]...\n");
|
WriteLog("b is from ram[addr]...\n");
|
||||||
|
@ -1263,7 +1252,7 @@ if (addr >= 0xD000 && addr <= 0xD00F)
|
||||||
{
|
{
|
||||||
if (writeRAM)
|
if (writeRAM)
|
||||||
{
|
{
|
||||||
#if 1
|
#if 0
|
||||||
if (addr <= 0xDFFF && visibleBank == LC_BANK_1)
|
if (addr <= 0xDFFF && visibleBank == LC_BANK_1)
|
||||||
ram[addr - 0x1000] = b;
|
ram[addr - 0x1000] = b;
|
||||||
else
|
else
|
||||||
|
@ -1271,14 +1260,14 @@ if (addr >= 0xD000 && addr <= 0xD00F)
|
||||||
#else
|
#else
|
||||||
if (addr <= 0xDFFF && visibleBank == LC_BANK_1)
|
if (addr <= 0xDFFF && visibleBank == LC_BANK_1)
|
||||||
{
|
{
|
||||||
if (ramwrt)
|
if (altzp)
|
||||||
ram2[addr - 0x1000] = b;
|
ram2[addr - 0x1000] = b;
|
||||||
else
|
else
|
||||||
ram[addr - 0x1000] = b;
|
ram[addr - 0x1000] = b;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ramwrt)
|
if (altzp)
|
||||||
ram2[addr] = b;
|
ram2[addr] = b;
|
||||||
else
|
else
|
||||||
ram[addr] = b;
|
ram[addr] = b;
|
||||||
|
@ -1313,6 +1302,7 @@ if (addr >= 0xD000 && addr <= 0xD00F)
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (addr < 0x0200)
|
if (addr < 0x0200)
|
||||||
|
// if (addr < 0x0200 || addr >= 0xD000)
|
||||||
{
|
{
|
||||||
if (altzp)
|
if (altzp)
|
||||||
ram2[addr] = b;
|
ram2[addr] = b;
|
||||||
|
|
|
@ -797,21 +797,15 @@ static void RenderHiRes(uint16_t toLine/*= 192*/)
|
||||||
|
|
||||||
static void RenderDHiRes(uint16_t toLine/*= 192*/)
|
static void RenderDHiRes(uint16_t toLine/*= 192*/)
|
||||||
{
|
{
|
||||||
// NOTE: Not endian safe. !!! FIX !!! [DONE]
|
|
||||||
#if 0
|
|
||||||
uint32_t pixelOn = (screenType == ST_WHITE_MONO ? 0xFFFFFFFF : 0xFF61FF61);
|
|
||||||
#else
|
|
||||||
// Now it is. Now roll this fix into all the other places... !!! FIX !!!
|
// Now it is. Now roll this fix into all the other places... !!! FIX !!!
|
||||||
// The colors are set in the 8-bit array as R G B A
|
// The colors are set in the 8-bit array as R G B A
|
||||||
uint8_t monoColors[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0x61, 0xFF, 0x61, 0xFF };
|
uint8_t monoColors[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0x61, 0xFF, 0x61, 0xFF };
|
||||||
uint32_t * colorPtr = (uint32_t *)monoColors;
|
uint32_t * colorPtr = (uint32_t *)monoColors;
|
||||||
uint32_t pixelOn = (screenType == ST_WHITE_MONO ? colorPtr[0] : colorPtr[1]);
|
uint32_t pixelOn = (screenType == ST_WHITE_MONO ? colorPtr[0] : colorPtr[1]);
|
||||||
#endif
|
|
||||||
|
|
||||||
for(uint16_t y=0; y<toLine; y++)
|
for(uint16_t y=0; y<toLine; y++)
|
||||||
{
|
{
|
||||||
uint16_t previousLoPixel = 0;
|
uint32_t previous4bits = 0;
|
||||||
uint32_t previous3bits = 0;
|
|
||||||
|
|
||||||
for(uint16_t x=0; x<40; x+=2)
|
for(uint16_t x=0; x<40; x+=2)
|
||||||
{
|
{
|
||||||
|
@ -823,7 +817,7 @@ static void RenderDHiRes(uint16_t toLine/*= 192*/)
|
||||||
pixels = pixels | ((mirrorTable[screenByte & 0x7F]) << 21);
|
pixels = pixels | ((mirrorTable[screenByte & 0x7F]) << 21);
|
||||||
screenByte = ram2[lineAddrHiRes[y] + (displayPage2 ? 0x2000 : 0x0000) + x + 1];
|
screenByte = ram2[lineAddrHiRes[y] + (displayPage2 ? 0x2000 : 0x0000) + x + 1];
|
||||||
pixels = pixels | ((mirrorTable[screenByte & 0x7F]) << 7);
|
pixels = pixels | ((mirrorTable[screenByte & 0x7F]) << 7);
|
||||||
pixels = previous3bits | (pixels >> 1);
|
pixels = previous4bits | (pixels >> 1);
|
||||||
|
|
||||||
// We now have 28 pixels (expanded from 14) in word: mask is $0F FF FF FF
|
// We now have 28 pixels (expanded from 14) in word: mask is $0F FF FF FF
|
||||||
// 0ppp 1111 1111 1111 1111 1111 1111 1111
|
// 0ppp 1111 1111 1111 1111 1111 1111 1111
|
||||||
|
@ -833,18 +827,18 @@ static void RenderDHiRes(uint16_t toLine/*= 192*/)
|
||||||
{
|
{
|
||||||
for(uint8_t i=0; i<7; i++)
|
for(uint8_t i=0; i<7; i++)
|
||||||
{
|
{
|
||||||
uint8_t bitPat = (pixels & 0x7F000000) >> 24;
|
uint8_t bitPat = (pixels & 0xFE000000) >> 25;
|
||||||
pixels <<= 4;
|
pixels <<= 4;
|
||||||
|
|
||||||
for(uint8_t j=0; j<4; j++)
|
for(uint8_t j=0; j<4; j++)
|
||||||
{
|
{
|
||||||
uint8_t color = blurTable[bitPat][j];
|
uint32_t color = palette[blurTable[bitPat][j]];
|
||||||
scrBuffer[(x * 14) + (i * 4) + j + (((y * 2) + 0) * VIRTUAL_SCREEN_WIDTH)] = palette[color];
|
scrBuffer[(x * 14) + (i * 4) + j + (((y * 2) + 0) * VIRTUAL_SCREEN_WIDTH)] = color;
|
||||||
scrBuffer[(x * 14) + (i * 4) + j + (((y * 2) + 1) * VIRTUAL_SCREEN_WIDTH)] = palette[color];
|
scrBuffer[(x * 14) + (i * 4) + j + (((y * 2) + 1) * VIRTUAL_SCREEN_WIDTH)] = color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
previous3bits = pixels & 0x70000000;
|
previous4bits = pixels & 0xF0000000;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -2946,6 +2946,21 @@ if (regs.pc == 0xD269)
|
||||||
dumpDis = true;
|
dumpDis = true;
|
||||||
}//*/
|
}//*/
|
||||||
#endif
|
#endif
|
||||||
|
//if (regs.pc == 0xE08E)
|
||||||
|
/*if (regs.pc == 0xAD33)
|
||||||
|
{
|
||||||
|
WriteLog("\n*** After loader ***\n\n");
|
||||||
|
dumpDis = true;
|
||||||
|
}//*/
|
||||||
|
/*if (regs.pc == 0x0418)
|
||||||
|
{
|
||||||
|
WriteLog("\n*** CUSTOM DISK READ subroutine...\n\n");
|
||||||
|
dumpDis = false;
|
||||||
|
}
|
||||||
|
if (regs.pc == 0x0)
|
||||||
|
{
|
||||||
|
dumpDis = true;
|
||||||
|
}//*/
|
||||||
#ifdef __DEBUGMON__
|
#ifdef __DEBUGMON__
|
||||||
//WAIT is commented out here because it's called by BELL1...
|
//WAIT is commented out here because it's called by BELL1...
|
||||||
if (regs.pc == 0xFCA8)
|
if (regs.pc == 0xFCA8)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user