GBHawk: Add ROM domain, add Green palette option
This commit is contained in:
parent
afe5a7cd11
commit
b2bc602398
|
@ -20,6 +20,23 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
|||
{
|
||||
//Console.WriteLine("-----------------------FRAME-----------------------");
|
||||
|
||||
//Update the color palette if a setting changed
|
||||
if(_settings.Palette == GBSettings.PaletteType.BW)
|
||||
{
|
||||
color_palette[0] = color_palette_BW[0];
|
||||
color_palette[1] = color_palette_BW[1];
|
||||
color_palette[2] = color_palette_BW[2];
|
||||
color_palette[3] = color_palette_BW[3];
|
||||
}
|
||||
else
|
||||
{
|
||||
color_palette[0] = color_palette_Gr[0];
|
||||
color_palette[1] = color_palette_Gr[1];
|
||||
color_palette[2] = color_palette_Gr[2];
|
||||
color_palette[3] = color_palette_Gr[3];
|
||||
}
|
||||
|
||||
|
||||
if (_tracer.Enabled)
|
||||
{
|
||||
cpu.TraceCallback = s => _tracer.Put(s);
|
||||
|
@ -165,7 +182,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
|||
public int VsyncNumerator => _frameHz;
|
||||
public int VsyncDenominator => 1;
|
||||
|
||||
public static readonly uint[] color_palette = { 0xFFFFFFFF , 0xFFAAAAAA, 0xFF555555, 0xFF000000 };
|
||||
public static readonly uint[] color_palette_BW = { 0xFFFFFFFF , 0xFFAAAAAA, 0xFF555555, 0xFF000000 };
|
||||
public static readonly uint[] color_palette_Gr = { 0xFFA4C505, 0xFF88A905, 0xFF1D551D, 0xFF052505 };
|
||||
|
||||
public uint[] color_palette = new uint[4];
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -34,6 +34,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
|||
MemoryDomain.Endian.Little,
|
||||
addr => PeekSystemBus(addr),
|
||||
(addr, value) => PokeSystemBus(addr, value),
|
||||
1),
|
||||
new MemoryDomainDelegate(
|
||||
"ROM",
|
||||
_rom.Length,
|
||||
MemoryDomain.Endian.Little,
|
||||
addr => _rom[addr],
|
||||
(addr, value) => ZP_RAM[addr] = value,
|
||||
1)
|
||||
};
|
||||
|
||||
|
|
|
@ -38,6 +38,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
|||
|
||||
public class GBSettings
|
||||
{
|
||||
public enum PaletteType
|
||||
{
|
||||
BW,
|
||||
Gr
|
||||
}
|
||||
|
||||
[DisplayName("Console Mode")]
|
||||
[Description("Pick which console to run, 'Auto' chooses from ROM header, 'GB' and 'GBC' chooses the respective system")]
|
||||
[DefaultValue(PaletteType.BW)]
|
||||
public PaletteType Palette { get; set; }
|
||||
|
||||
|
||||
public GBSettings Clone()
|
||||
{
|
||||
return (GBSettings)MemberwiseClone();
|
||||
|
|
|
@ -720,7 +720,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
|||
}
|
||||
|
||||
// based on sprite priority and pixel values, pick a final pixel color
|
||||
Core._vidbuffer[LY * 160 + pixel_counter] = (int)GBHawk.color_palette[pixel];
|
||||
Core._vidbuffer[LY * 160 + pixel_counter] = (int)Core.color_palette[pixel];
|
||||
pixel_counter++;
|
||||
|
||||
if (pixel_counter == 160)
|
||||
|
|
Loading…
Reference in New Issue