mirror of
https://github.com/JorjBauer/aiie.git
synced 2024-06-12 17:42:07 +00:00
fix S_MIXED drawing to prevent full DMA from flashing
This commit is contained in:
parent
dd76741c23
commit
c906df1093
|
@ -488,7 +488,8 @@ void AppleDisplay::redrawHires()
|
||||||
start = 0x2000;
|
start = 0x2000;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: check MIXED & don't redraw the lower area if it's set
|
// S_MIXED is checked inside Draw14HiresPixelsAt and
|
||||||
|
// Draw14DoubleHiresPixelsAt, so no need to check it here
|
||||||
for (uint16_t addr = start; addr <= start + 0x1FFF; addr+=2) {
|
for (uint16_t addr = start; addr <= start + 0x1FFF; addr+=2) {
|
||||||
if ((*switches) & S_DHIRES) {
|
if ((*switches) & S_DHIRES) {
|
||||||
// FIXME: inline & optimize
|
// FIXME: inline & optimize
|
||||||
|
@ -502,27 +503,33 @@ void AppleDisplay::redrawHires()
|
||||||
|
|
||||||
void AppleDisplay::redrawLores()
|
void AppleDisplay::redrawLores()
|
||||||
{
|
{
|
||||||
// FIXME: can make more efficient by checking S_MIXED for lower bound
|
|
||||||
|
|
||||||
if (((*switches) & S_80COL) && ((*switches) & S_DHIRES)) {
|
if (((*switches) & S_80COL) && ((*switches) & S_DHIRES)) {
|
||||||
for (uint16_t addr = 0x400; addr <= 0x400 + 0x3ff; addr++) {
|
for (uint16_t addr = 0x400; addr <= 0x400 + 0x3ff; addr++) {
|
||||||
uint8_t row, col;
|
uint8_t row, col;
|
||||||
deinterlaceAddress(addr, &row, &col);
|
deinterlaceAddress(addr, &row, &col);
|
||||||
if (col <= 39 && row <= 23) {
|
if (col <= 39 && row <= 23) {
|
||||||
|
if (((*switches) & S_MIXED) && row >= 20) { // ***@@@ is 20 right?
|
||||||
|
// Don't draw this row, we're in MIXED mode
|
||||||
|
} else {
|
||||||
Draw80LoresPixelAt(mmu->readDirect(addr, 0), col, row, 1);
|
Draw80LoresPixelAt(mmu->readDirect(addr, 0), col, row, 1);
|
||||||
Draw80LoresPixelAt(mmu->readDirect(addr, 1), col, row, 0);
|
Draw80LoresPixelAt(mmu->readDirect(addr, 1), col, row, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
uint16_t start = ((*switches) & S_PAGE2) ? 0x800 : 0x400;
|
uint16_t start = ((*switches) & S_PAGE2) ? 0x800 : 0x400;
|
||||||
for (uint16_t addr = start; addr <= start + 0x3FF; addr++) {
|
for (uint16_t addr = start; addr <= start + 0x3FF; addr++) {
|
||||||
uint8_t row, col;
|
uint8_t row, col;
|
||||||
deinterlaceAddress(addr, &row, &col);
|
deinterlaceAddress(addr, &row, &col);
|
||||||
|
if (((*switches) & S_MIXED) && row >= 20) { // ***@@@ is 20 right?
|
||||||
|
// Don't draw this row, we're in MIXED mode
|
||||||
|
} else {
|
||||||
if (col <= 39 && row <= 23) {
|
if (col <= 39 && row <= 23) {
|
||||||
DrawLoresPixelAt(mmu->readDirect(addr, 0), col, row);
|
DrawLoresPixelAt(mmu->readDirect(addr, 0), col, row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppleDisplay::modeChange()
|
void AppleDisplay::modeChange()
|
||||||
|
@ -547,19 +554,27 @@ void AppleDisplay::Draw80LoresPixelAt(uint8_t c, uint8_t x, uint8_t y, uint8_t o
|
||||||
// The colors in every other column are swizzled. Un-swizzle.
|
// The colors in every other column are swizzled. Un-swizzle.
|
||||||
c = ((c & 0x77) << 1) | ((c & 0x88) >> 3);
|
c = ((c & 0x77) << 1) | ((c & 0x88) >> 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t pixel = c & 0x0F;
|
uint8_t pixel = c & 0x0F;
|
||||||
for (uint8_t y2 = 0; y2<4; y2++) {
|
for (uint8_t y2 = 0; y2<4; y2++) {
|
||||||
for (int8_t x2 = 3; x2>=offset; x2--) {
|
for (int8_t x2 = 3; x2>=offset; x2--) {
|
||||||
|
|
||||||
|
if ( !(*switches & S_MIXED) ||
|
||||||
|
y < 20 ) {
|
||||||
drawApplePixel(pixel, x*7+x2+offset*3, y*8+y2);
|
drawApplePixel(pixel, x*7+x2+offset*3, y*8+y2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pixel = (c >> 4);
|
pixel = (c >> 4);
|
||||||
for (uint8_t y2 = 4; y2<8; y2++) {
|
for (uint8_t y2 = 4; y2<8; y2++) {
|
||||||
for (int8_t x2 = 3; x2>=offset; x2--) {
|
for (int8_t x2 = 3; x2>=offset; x2--) {
|
||||||
|
if ( !(*switches & S_MIXED) ||
|
||||||
|
y < 20 ) {
|
||||||
drawApplePixel(pixel, x*7+x2+offset*3, y*8+y2);
|
drawApplePixel(pixel, x*7+x2+offset*3, y*8+y2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppleDisplay::setSwitches(uint16_t *switches)
|
void AppleDisplay::setSwitches(uint16_t *switches)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user