Previous 15994 Revisions Next

r6595 Wednesday 9th December, 2009 at 16:14:10 UTC by Tim Schuerewegen
[GP32] Added palette read handler.
[src/mess/drivers]gp32.c

src/mess/drivers/gp32.c
r6594r6595
3333// LCD CONTROLLER
3434
3535static UINT32 s3c240x_vidregs[0x400/4];
36static UINT32 s3c240x_palette[0x400/4];
3637
3738#define BPPMODE_TFT_01   0x08
3839#define BPPMODE_TFT_08   0x0B
r6594r6595
132133   COMBINE_DATA(&s3c240x_vidregs[offset]);
133134}
134135
136static READ32_HANDLER( s3c240x_palette_r )
137{
138   return s3c240x_palette[offset];
139}
140
135141static WRITE32_HANDLER( s3c240x_palette_w )
136142{
137143   UINT8 r, g, b;
144   COMBINE_DATA(&s3c240x_palette[offset]);
138145   if (mem_mask != 0xffffffff)
139146   {
140      logerror("s3c240x_palette_w: unknown mask %08x\n", mem_mask);
147      logerror( "s3c240x_palette_w: unknown mask %08x\n", mem_mask);
141148   }
142149   r = ((data >> 11) & 0x1F) << 3;
143150   g = ((data >>  6) & 0x1F) << 3;
144151   b = ((data >>  1) & 0x1F) << 3;
145   palette_set_color_rgb(space->machine, offset, r, g, b);
152   palette_set_color_rgb( space->machine, offset, r, g, b);
146153}
147154
148155// CLOCK & POWER MANAGEMENT
r6594r6595
13961403   AM_RANGE(0x14600000, 0x1460007b) AM_READWRITE(s3c240x_dma_r, s3c240x_dma_w)
13971404   AM_RANGE(0x14800000, 0x14800017) AM_READWRITE(s3c240x_clkpow_r, s3c240x_clkpow_w)
13981405   AM_RANGE(0x14a00000, 0x14a003ff) AM_READWRITE(s3c240x_vidregs_r, s3c240x_vidregs_w)
1399   AM_RANGE(0x14a00400, 0x14a007ff) AM_RAM AM_BASE_GENERIC(paletteram) AM_WRITE(s3c240x_palette_w)
1406   AM_RANGE(0x14a00400, 0x14a007ff) AM_READWRITE(s3c240x_palette_r, s3c240x_palette_w)
14001407   AM_RANGE(0x15000000, 0x1500002b) AM_READWRITE(s3c240x_uart_0_r, s3c240x_uart_0_w)
14011408   AM_RANGE(0x15004000, 0x1500402b) AM_READWRITE(s3c240x_uart_1_r, s3c240x_uart_1_w)
14021409   AM_RANGE(0x15100000, 0x15100043) AM_READWRITE(s3c240x_pwm_r, s3c240x_pwm_w)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team