Previous 15994 Revisions Next

r5823 Sunday 20th September, 2009 at 22:59:45 UTC by Angelo Salese
[X1TURBO]: Implemented 2bpp colors on tilemap layer
[src/mess/drivers]x1.c

src/mess/drivers/x1.c
r5822r5823
185185{
186186   UINT8 pal;
187187   UINT8 gfx_pal;
188   UINT8 txt_pal;
188   UINT8 txt_pal[8];
189189   UINT8 txt_disp;
190190}turbo_reg;
191191
r5822r5823
11211121}
11221122
11231123static READ8_HANDLER( x1turbo_pal_r )    { return turbo_reg.pal; }
1124static READ8_HANDLER( x1turbo_txpal_r )  { return turbo_reg.txt_pal; }
1124static READ8_HANDLER( x1turbo_txpal_r )  { return turbo_reg.txt_pal[offset]; }
11251125static READ8_HANDLER( x1turbo_txdisp_r ) { return turbo_reg.txt_disp; }
11261126static READ8_HANDLER( x1turbo_gfxpal_r ) { return turbo_reg.gfx_pal; }
11271127
r5822r5823
11331133
11341134static WRITE8_HANDLER( x1turbo_txpal_w )
11351135{
1136   printf("TURBO TEXT PAL %02x\n",data);
1137   turbo_reg.txt_pal = data;
1136   int r,g,b;
1137
1138   printf("TURBO TEXT PAL %02x %02x\n",data,offset);
1139   turbo_reg.txt_pal[offset] = data;
1140
1141   if(turbo_reg.pal & 0x80)
1142   {
1143      r = (data & 0x0c) >> 2;
1144      g = (data & 0x30) >> 4;
1145      b = (data & 0x03) >> 0;
1146
1147      palette_set_color_rgb(space->machine, offset, pal2bit(r), pal2bit(g), pal2bit(b));
1148   }
11381149}
11391150
11401151static WRITE8_HANDLER( x1turbo_txdisp_w )
r5822r5823
12531264   else if(offset >= 0x1f92 && offset <= 0x1f93)   { z80sio_d_w(devtag_get_device(space->machine, "sio"), (offset-0x1f92) & 1,data); }
12541265   else if(offset >= 0x1fa0 && offset <= 0x1fa3)   { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x1fa0,data); }
12551266   else if(offset >= 0x1fa8 && offset <= 0x1fab)   { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x1fa8,data); }
1256   else if(offset == 0x1fb0)                  { x1turbo_pal_w(space,0,data); }
1257   else if(offset >= 0x1fb9 && offset <= 0x1fbf)   { x1turbo_txpal_w(space,offset-0x1fb9,data); }
1258   else if(offset == 0x1fc0)                  { x1turbo_txdisp_w(space,0,data); }
1259   else if(offset == 0x1fc5)                  { x1turbo_gfxpal_w(space,0,data); }
1267//   else if(offset == 0x1fb0)                  { x1turbo_pal_w(space,0,data); }
1268//   else if(offset >= 0x1fb9 && offset <= 0x1fbf)   { x1turbo_txpal_w(space,offset-0x1fb9,data); }
1269//   else if(offset == 0x1fc0)                  { x1turbo_txdisp_w(space,0,data); }
1270//   else if(offset == 0x1fc5)                  { x1turbo_gfxpal_w(space,0,data); }
12601271   else if(offset >= 0x1fd0 && offset <= 0x1fdf)   { x1_scrn_w(space,0,data); }
12611272   else if(offset == 0x1fe0)                  { x1_blackclip_w(space,0,data); }
12621273   else if(offset >= 0x2000 && offset <= 0x2fff)   { colorram[offset-0x2000] = data; }
r5822r5823
12871298   else if(offset >= 0x1fa0 && offset <= 0x1fa3)   { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x1fa0); }
12881299   else if(offset >= 0x1fa8 && offset <= 0x1fab)   { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x1fa8); }
12891300   else if(offset == 0x1fb0)                  { return x1turbo_pal_r(space,0); }
1290   else if(offset >= 0x1fb9 && offset <= 0x1fbf)   { return x1turbo_txpal_r(space,offset-0x1fb9); }
1301   else if(offset >= 0x1fb8 && offset <= 0x1fbf)   { return x1turbo_txpal_r(space,offset-0x1fb8); }
12911302   else if(offset == 0x1fc0)                  { return x1turbo_txdisp_r(space,0); }
12921303   else if(offset == 0x1fc5)                  { return x1turbo_gfxpal_r(space,0); }
12931304//   else if(offset >= 0x1fd0 && offset <= 0x1fdf)   { return x1_scrn_r(space,offset-0x1fd0); }
r5822r5823
13311342   else if(offset >= 0x1fa0 && offset <= 0x1fa3)   { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x1fa0,data); }
13321343   else if(offset >= 0x1fa8 && offset <= 0x1fab)   { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x1fa8,data); }
13331344   else if(offset == 0x1fb0)                  { x1turbo_pal_w(space,0,data); }
1334   else if(offset >= 0x1fb9 && offset <= 0x1fbf)   { x1turbo_txpal_w(space,offset-0x1fb9,data); }
1345   else if(offset >= 0x1fb8 && offset <= 0x1fbf)   { x1turbo_txpal_w(space,offset-0x1fb8,data); }
13351346   else if(offset == 0x1fc0)                  { x1turbo_txdisp_w(space,0,data); }
13361347   else if(offset == 0x1fc5)                  { x1turbo_gfxpal_w(space,0,data); }
13371348   else if(offset >= 0x1fd0 && offset <= 0x1fdf)   { x1_scrn_w(space,0,data); }
r5822r5823
19892000   cassette_change_state(devtag_get_device(machine, "cass" ),CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR);
19902001
19912002   key_irq_flag = ctc_irq_flag = 0;
2003
2004   /* Reinitialize palette here if there's a soft reset for the Turbo PAL stuff*/
2005   for(i=0;i<8;i++)
2006   {
2007      palette_set_color_rgb(machine, i+0x000, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
2008      palette_set_color_rgb(machine, i+0x100, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
2009   }
19922010}
19932011
19942012static PALETTE_INIT(x1)
r5822r5823
20142032
20152033      palette_set_color_rgb(machine, i, r,g,b);
20162034   }
2017
2018   /* TODO: fix this */
2019   for(i=0;i<8;i++)
2020   {
2021      palette_set_color_rgb(machine, i+0x000, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
2022      palette_set_color_rgb(machine, i+0x100, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
2023   }
20242035}
20252036
20262037FLOPPY_OPTIONS_START( x1 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team