Re: [hatari-devel] TT palette bankswitching should be supported |
[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]
Hi Roger, On 02/21/2016 07:26 AM, Roger Burrows wrote:
On 21 Feb 2016 at 1:00, Eero Tamminen wrote:Ah, so this isn't about ST<->TT color palette mapping, but about e.g. 16/4/2 color modes. Both TT and ST modes?It applies when bank-switching is active, so should apply to ST low, ST medium, and TT medium. I originally tested just TT medium, but I've now tested ST medium & ST low and (as per the Atari documents), it applies to all 3. Note that this does not apply to any other TT mode (ST high/duochrome, TT high, TT low).
Thanks for the testing! Could you send the test program you mentioned? Attached patch hopefully fixes that. - Eero
diff -r 6708d52e5e49 src/video.c --- a/src/video.c Sun Feb 21 22:38:10 2016 +0200 +++ b/src/video.c Sun Feb 21 22:53:46 2016 +0200 @@ -3020,6 +3020,13 @@ Uint32 ttpalette = 0xff8400; int i, colors = 1 << bpp; + if (colors <= 16) + { + /* palette bank switching */ + int page = (IoMem_ReadWord(0xff8262) & 0x0f); + ttpalette += page * 16*SIZE_WORD; + } + for (i = 0; i < colors; i++) { Video_SetTTPaletteColor(i, ttpalette);
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |