Skip to content

Commit

Permalink
macfb: allow larger write accesses to the DAFB_LUT register
Browse files Browse the repository at this point in the history
The original tests with MacOS showed that only the bottom 8 bits of the DAFB_LUT
register were used when writing to the LUT, however A/UX performs some of its
writes using 4 byte accesses. Expand the address range for the DAFB_LUT register
so that different size accesses write the correct value to the color_palette
array.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-ID: <20231026085650.917663-4-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
  • Loading branch information
mcayland authored and vivier committed Nov 5, 2023
1 parent 2fca4e7 commit ced6425
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hw/display/macfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#define DAFB_INTR_STAT 0x108
#define DAFB_INTR_CLEAR 0x10c
#define DAFB_LUT_INDEX 0x200
#define DAFB_LUT 0x213
#define DAFB_LUT 0x210

#define DAFB_INTR_VBL 0x4

Expand Down Expand Up @@ -586,8 +586,8 @@ static void macfb_ctrl_write(void *opaque,
case DAFB_LUT_INDEX:
s->palette_current = (val & 0xff) * 3;
break;
case DAFB_LUT:
s->color_palette[s->palette_current] = val;
case DAFB_LUT ... DAFB_LUT + 3:
s->color_palette[s->palette_current] = val & 0xff;
s->palette_current = (s->palette_current + 1) %
ARRAY_SIZE(s->color_palette);
if (s->palette_current % 3) {
Expand Down

0 comments on commit ced6425

Please sign in to comment.