Previous 15994 Revisions Next

r1263 Monday 12th November, 2007 at 14:43:27 UTC by Curt Coder
[QL] Fixed video a bit.
[src/mess/drivers]ql.c
[src/mess/video]zx8301.c

src/mess/video/zx8301.c
r1262r1263
2121 
2222PALETTE_INIT( zx8301 )
2323{
24   palette_set_color_rgb(machine, 0x00, 0x00, 0x00, 0x00 );
25   palette_set_color_rgb(machine, 0x01, 0x00, 0x00, 0xff );
26   palette_set_color_rgb(machine, 0x02, 0x00, 0xff, 0x00 );
27   palette_set_color_rgb(machine, 0x03, 0x00, 0xff, 0xff );
28   palette_set_color_rgb(machine, 0x04, 0xff, 0x00, 0x00 );
29   palette_set_color_rgb(machine, 0x05, 0xff, 0x00, 0xff );
30   palette_set_color_rgb(machine, 0x06, 0xff, 0xff, 0x00 );
31   palette_set_color_rgb(machine, 0x07, 0xff, 0xff, 0xff );
24   palette_set_color_rgb(machine, 0, 0x00, 0x00, 0x00 );
25   palette_set_color_rgb(machine, 1, 0x00, 0x00, 0xff );
26   palette_set_color_rgb(machine, 2, 0x00, 0xff, 0x00 );
27   palette_set_color_rgb(machine, 3, 0x00, 0xff, 0xff );
28   palette_set_color_rgb(machine, 4, 0xff, 0x00, 0x00 );
29   palette_set_color_rgb(machine, 5, 0xff, 0x00, 0xff );
30   palette_set_color_rgb(machine, 6, 0xff, 0xff, 0x00 );
31   palette_set_color_rgb(machine, 7, 0xff, 0xff, 0xff );
3232}
3333 
3434WRITE8_HANDLER( zx8301_control_w )
r1262r1263
4040 
4141static void zx8301_draw_screen(mame_bitmap *bitmap)
4242{
43   int addr = zx8301.base ? 0x8000 : 0;
43   UINT32 addr = zx8301.base << 15;
4444   int y, word, pixel;
4545 
4646   if (zx8301.mode)
r1262r1263
5151      {
5252         int x = 0;
5353 
54         for (word = 0; word < 32; word++)
54         for (word = 0; word < 64; word++)
5555         {
5656            UINT8 byte_high = videoram[addr++];
5757            UINT8 byte_low = videoram[addr++];
r1262r1263
6262               int green = BIT(byte_high, 7);
6363               int color = (green << 1) | red;
6464 
65               *BITMAP_ADDR16(bitmap, y, x++) = Machine->pens[ZX8301_COLOR_MODE4[color]];
66 
6567               byte_high <<= 1;
6668               byte_low <<= 1;
67 
68               *BITMAP_ADDR16(bitmap, y, x++) = Machine->pens[ZX8301_COLOR_MODE4[color]];
6969            }
7070         }
7171      }
r1262r1263
9797                  color = 0;
9898               }
9999 
100               *BITMAP_ADDR16(bitmap, y, x++) = Machine->pens[color];
101               *BITMAP_ADDR16(bitmap, y, x++) = Machine->pens[color];
102 
100103               byte_high <<= 2;
101104               byte_low <<= 2;
102 
103               *BITMAP_ADDR16(bitmap, y, x++) = Machine->pens[color];
104               *BITMAP_ADDR16(bitmap, y, x++) = Machine->pens[color];
105105            }
106106         }
107107      }
src/mess/drivers/ql.c
r1262r1263
135135{
136136}
137137
138static READ8_HANDLER( mdv_status_r )
138static READ8_HANDLER( zx8302_status_r )
139139{
140140   return 0x0;
141141}
r1262r1263
264264
265265static ADDRESS_MAP_START( ql_map, ADDRESS_SPACE_PROGRAM, 8 )
266266   AM_RANGE(0x000000, 0x00bfff) AM_ROM   // System ROM
267   AM_RANGE(0x00c000, 0x00ffff) AM_ROMBANK(1) // Cartridge ROM
267   AM_RANGE(0x00c000, 0x00ffff) AM_ROM // Cartridge ROM
268268   AM_RANGE(0x018000, 0x018001) AM_WRITE(zx8302_clock_w)
269269   AM_RANGE(0x018002, 0x018002) AM_WRITE(zx8302_control_w)
270270   AM_RANGE(0x018003, 0x018003) AM_WRITE(zx8302_ipc_w)
271   AM_RANGE(0x018020, 0x018020) AM_READWRITE(mdv_status_r, mdv_ctrl_w)
271   AM_RANGE(0x018020, 0x018020) AM_READWRITE(zx8302_status_r, mdv_ctrl_w)
272272   AM_RANGE(0x018022, 0x018022) AM_WRITE(mdv_data_w)
273273   AM_RANGE(0x018063, 0x018063) AM_WRITE(zx8301_control_w)
274274   AM_RANGE(0x020000, 0x02ffff) AM_RAM AM_BASE(&videoram)
r1262r1263
398398static MACHINE_START( ql )
399399{
400400   zx8302_baud_timer = mame_timer_alloc(zx8302_baud_tick);
401
402   memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x00c000, 0x00ffff, 0, 0, MRA8_UNMAP, MWA8_UNMAP);
403
404   memory_configure_bank(1, 0, 1, memory_region(REGION_CPU1) + 0x00c000, 0);
405   memory_set_bank(1, 0);
406401}
407402
408403static MACHINE_DRIVER_START( ql )
r1262r1263
612607
613608static DEVICE_LOAD( ql_cart )
614609{
615   UINT8 *ptr = ((UINT8 *)memory_region(REGION_CPU1)) + 0x00c000;
616610   int   filesize = image_length(image);
617611
618612   if (filesize <= 16 * 1024)
619613   {
620      if (image_fread(image, ptr, filesize) == filesize)
621      {
622         memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x00c000, 0x00ffff, 0, 0, MRA8_BANK1, MWA8_BANK1);
623
624         return INIT_PASS;
625      }
614      return INIT_PASS;
626615   }
627616
628617   return INIT_FAIL;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team