O2Hawk: fix color output

This commit is contained in:
alyosha-tas 2020-02-16 21:04:28 -05:00
parent aa5cd2165b
commit b3fac6ba12
5 changed files with 19 additions and 7 deletions

View File

@ -10,6 +10,14 @@ SHA1:DE888B7AA2716C3134CFF812A4E07E86B2479537 Shoot the B O2
SHA1:85A44A99B254D92A7433EE46E4CAA91483D7FEA2 Go Sub 2 O2
SHA1:2B34EF0E1A8C0371F00A33D6950E0807F3CB886E Happy Emu O2
SHA1:364504FFCE1108BCF09A5CC784F7EA2CF141F7B8 Football O2
SHA1:14A37A38C582D8822CB78FB0AACE221A2FA9A44C Baseball O2
SHA1:3391E48C0048A2F588D8238BB202E2EC346A6AD4 K.C.'s Crazy Chase O2
SHA1:83D06385FD74E3F7C19309E6908A975FA8856F32 K.C. Munchkin O2
SHA1:0E819A4B0F17520DA24FF79901197F5397CB9A26 UFO! O2

View File

@ -106,7 +106,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
else if (port == 1)
{
// various control pins
return (byte)((lum_en ? 0x80 : 0) |
return (byte)((ppu.lum_en ? 0x80 : 0) |
(copy_en ? 0x40 : 0) |
(0x20) |
(!RAM_en ? 0x10 : 0) |
@ -156,7 +156,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
else if (port == 1)
{
// various control pins
lum_en = value.Bit(7);
ppu.lum_en = value.Bit(7);
copy_en = value.Bit(6);
RAM_en = !value.Bit(4);
ppu_en = !value.Bit(3);
@ -168,7 +168,10 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
rom_bank |= (ushort)(cart_b1 ? 2 : 0);
rom_bank = (ushort)(rom_bank << 11);
//Console.WriteLine("main ctrl: " + value + " " + ppu_en + " " + RAM_en + " " + cpu.TotalExecutedCycles);
ppu.bg_brightness = !ppu.lum_en ? 8 : 0;
ppu.grid_brightness = (!ppu.lum_en | ppu.VDC_color.Bit(6)) ? 8 : 0;
//Console.WriteLine("main ctrl: " + value + " " + ppu.lum_en + " " + ppu_en + " " + RAM_en + " " + cpu.TotalExecutedCycles + " " + ppu.LY);
}
else
{

View File

@ -37,7 +37,6 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
ser.Sync(nameof(ppu_en), ref ppu_en);
ser.Sync(nameof(cart_b0), ref cart_b0);
ser.Sync(nameof(cart_b1), ref cart_b1);
ser.Sync(nameof(lum_en), ref lum_en);
ser.Sync(nameof(copy_en), ref copy_en);
ser.Sync(nameof(kybrd_en), ref kybrd_en);
ser.Sync(nameof(rom_bank), ref rom_bank);

View File

@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
public byte addr_latch;
public byte kb_byte;
public bool ppu_en, RAM_en, kybrd_en, copy_en, lum_en, cart_b0, cart_b1;
public bool ppu_en, RAM_en, kybrd_en, copy_en, cart_b0, cart_b1;
public ushort rom_bank;
public byte[] _bios;

View File

@ -31,6 +31,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
public int cycle;
public bool VBL;
public bool HBL;
public bool lum_en;
// local variables not stated
int current_pixel_offset;
@ -166,8 +167,8 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
{
VDC_color = value;
//Console.WriteLine("VDC_color: " + value + " " + Core.cpu.TotalExecutedCycles);
bg_brightness = VDC_color.Bit(7) ? 8 : 0;
grid_brightness = VDC_color.Bit(6) ? 8 : 0;
grid_brightness = (!lum_en | VDC_color.Bit(6)) ? 8 : 0;
bg_brightness = !lum_en ? 8 : 0;
}
else if (addr == 0xA4)
{
@ -866,6 +867,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
ser.Sync(nameof(Pixel_Stat), ref Pixel_Stat);
ser.Sync(nameof(bg_brightness), ref bg_brightness);
ser.Sync(nameof(grid_brightness), ref grid_brightness);
ser.Sync(nameof(lum_en), ref lum_en);
ser.Sync(nameof(grid_fill), ref grid_fill);
ser.Sync(nameof(grid_fill_col), ref grid_fill_col);