diff --git a/SDL/fb.c b/SDL/fb.c index 2fcee3b..c46436d 100644 --- a/SDL/fb.c +++ b/SDL/fb.c @@ -233,6 +233,11 @@ static void PDD_Name(Host_SetPaletteEntry)(ARMul_State *state,int i,unsigned int SDL_SetColors(sdd_surface, &col, i, 1); } +static void PDD_Name(Host_SetCursorPaletteEntry)(ARMul_State *state,int i,unsigned int phys) +{ + /* TODO */ +} + static void PDD_Name(Host_SetBorderColour)(ARMul_State *state,unsigned int phys) { /* TODO */ diff --git a/amiga/DispKbd.c b/amiga/DispKbd.c index b14b559..5d45c71 100755 --- a/amiga/DispKbd.c +++ b/amiga/DispKbd.c @@ -459,6 +459,11 @@ static void PDD_Name(Host_SetPaletteEntry)(ARMul_State *state,int i,unsigned int SetRGB32(&screen->ViewPort,i,r,g,b); } +static void PDD_Name(Host_SetCursorPaletteEntry)(ARMul_State *state,int i,unsigned int phys) +{ + /* TODO */ +} + static void PDD_Name(Host_SetBorderColour)(ARMul_State *state,unsigned int phys) { /* Set border palette entry */ diff --git a/arch/paldisplaydev.c b/arch/paldisplaydev.c index a3d9676..841201e 100644 --- a/arch/paldisplaydev.c +++ b/arch/paldisplaydev.c @@ -65,6 +65,11 @@ - Function that gets called when a palette entry needs updating - 'phys' is a 13-bit VIDC physical colour + void PDD_Name(Host_SetCursorPaletteEntry)(ARMul_State *state,int i, + uint_fast16_t phys) + - Function that gets called when a cursor palette entry needs updating + - 'phys' is a 13-bit VIDC physical colour + void PDD_Name(Host_SetBorderColour)(ARMul_State *state,uint_fast16_t phys) - Function that gets called when the border colour needs updating - 'phys' is a 13-bit VIDC physical colour @@ -527,7 +532,7 @@ static void PDD_Name(EventFunc)(ARMul_State *state,CycleCount nowtime) /* Ensure full palette rebuild on BPP change */ if((DC.VIDC_CR & 0xc) != (NewCR & 0xc)) { - DC.DirtyPalette = 65535; + DC.DirtyPalette = 0xFFFFF; } DC.VIDC_CR = NewCR; @@ -580,7 +585,7 @@ static void PDD_Name(EventFunc)(ARMul_State *state,CycleCount nowtime) DC.ForceRefresh = true; } DC.ModeChanged = false; - DC.DirtyPalette = -1; + DC.DirtyPalette = 0xFFFFF; } /* Update AutoUpdateFlags */ @@ -636,10 +641,22 @@ static void PDD_Name(EventFunc)(ARMul_State *state,CycleCount nowtime) } /* Update host palette */ - if(DC.DirtyPalette & 0x10000) + if(DC.DirtyPalette & 0x80000) { PDD_Name(Host_SetBorderColour)(state,VIDC.BorderCol); - DC.DirtyPalette -= 0x10000; + DC.DirtyPalette -= 0x80000; + } + if(DC.DirtyPalette & 0x70000) + { + int i; + for(i=0;i<3;i++) + { + if(DC.DirtyPalette & (0x10000<>2; dbug_vidc("VIDC cursor log col %d write val=0x%x\n",addr+1,val); - VIDC.CursorPalette[addr] = val & 0x1fff; + val &= 0x1fff; + if(VIDC.CursorPalette[addr] != val) + { + VIDC.CursorPalette[addr] = val; + DC.DirtyPalette |= 0x10000 << addr; + } break; case 0x60: /* Stereo image reg 7 */ diff --git a/riscos-single/DispKbd.c b/riscos-single/DispKbd.c index 34e212b..99d1d54 100644 --- a/riscos-single/DispKbd.c +++ b/riscos-single/DispKbd.c @@ -392,6 +392,11 @@ static void PDD_Name(Host_SetPaletteEntry)(ARMul_State *state,int i,unsigned int FakeBorderPalEntry = -1; } +static void PDD_Name(Host_SetCursorPaletteEntry)(ARMul_State *state,int i,unsigned int phys) +{ + /* TODO */ +} + static void PDD_Name(Host_SetBorderColour)(ARMul_State *state,unsigned int phys) { char buf[5]; diff --git a/win/DispKbd.c b/win/DispKbd.c index 3627455..3915a45 100644 --- a/win/DispKbd.c +++ b/win/DispKbd.c @@ -267,7 +267,7 @@ static void PDD_Name(Host_SetCursorPaletteEntry)(ARMul_State *state,int i,unsign g |= g>>4; b |= b<<4; - setCursorPaletteColour(i, r, g, b); + setCursorPaletteColour(i + 1, r, g, b); } static void PDD_Name(Host_SetBorderColour)(ARMul_State *state,unsigned int phys) @@ -395,11 +395,6 @@ static void PDD_Name(RefreshMouse)(ARMul_State *state) { rMouseWidth = Width; rMouseHeight = Height; - /* Cursor palette */ - for(x=0; x<3; x++) { - PDD_Name(Host_SetCursorPaletteEntry)(state,x+1,VIDC.CursorPalette[x]); - } - offset=0; memptr=MEMC.Cinit*16; repeat=0;