Skip to content

Commit

Permalink
Trying to implement "forbiden" video mode VM1 vd208
Browse files Browse the repository at this point in the history
  • Loading branch information
nzeemin committed Nov 7, 2023
1 parent f349a1f commit b32104d
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions emulator/Emulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -918,10 +918,29 @@ void Emulator_PrepareScreenLines(void* pImageBits, SCREEN_LINE_CALLBACK lineCall
}
else //if (vmode == 12) // VM1, плотность видео-строки 208 байт - запрещенный режим
{
//NOTE: Как выяснилось, берутся только чётные биты из строки в 208 байт
uint16_t pal14hi = pBoard->GetRAMWordView(paladdr + 14);
uint16_t pal14lo = pBoard->GetRAMWordView(paladdr + 14 + 256);
uint32_t color0 = Color16Convert((uint16_t)((pal14hi & 0xff) << 8 | (pal14lo & 0xff)));
uint32_t color1 = Color16Convert((uint16_t)((pal14hi & 0xff00) | (pal14lo & 0xff00) >> 8));
while (barcount > 0)
{
FILL8PIXELS(colorBorder)
FILL8PIXELS(colorBorder)
uint16_t bits = pBoard->GetRAMWordView(otraddr);
otraddr += 2;
for (uint16_t k = 0; k < 8; k++)
{
uint32_t color = (bits & 2) ? color1 : color0;
FILL1PIXEL(color)
bits = bits >> 2;
}
bits = pBoard->GetRAMWordView(otraddr);
otraddr += 2;
for (uint16_t k = 0; k < 8; k++)
{
uint32_t color = (bits & 2) ? color1 : color0;
FILL1PIXEL(color)
bits = bits >> 2;
}
barcount--;
}
}
Expand Down

0 comments on commit b32104d

Please # to comment.