Previous 15994 Revisions Next

r5511 Thursday 27th August, 2009 at 20:14:53 UTC by Angelo Salese
[X1]: Fixed PCG height/width, fixed an upload issue and fixed a bankswitch quirk, now even more games boots up
[src/mess/drivers]x1.c

src/mess/drivers/x1.c
r5510r5511
1212   - Fix the interrupts (uses IM 2)
1313
1414   per-game specific TODO:
15   - 177 / Dragon Buster: fix the keyboard flags otherwise these doesn't boot
16   - Dragon Buster: uses PCG + sets bitmap in a weird way;
15   - 177 / Dragon Buster: fix the keyboard flags otherwise these doesn't boot;
16   - Dragon Buster: Maybe the pcg tilemap uses scrolling and priorities are wrong;
1717   - Shanghai: tests the ay8910 read regs, mouse/joystick perhaps?
18   - Gaia: Hits a FDC drive assert;
18   - Gaia/Space Harrier: Hits the FDC drive assert, the latter boots but has heavy emulation
19     video/logic problems;
1920
2021=================================================================================================
2122
r5510r5511
198199         int pcg_bank = (colorram[x+(y*40*w)] & 0x20)>>4;
199200         int region = (width+(height<<1)) & 3;
200201
201         if(pcg_bank)
202         {
203            region = 4;
204            width = 0;
205            height = 0;
206         }
202         if(pcg_bank) { region+= 4; }
207203         else if(tile == 0) continue; //<- correct?
208204
209205         if(color & 0x38)
r5510r5511
316312{
317313   UINT8 *ROM = memory_region(space->machine, "maincpu");
318314
319   memory_set_bankptr(space->machine, 1, &ROM[0x00000]);
315   if(data)
316      memory_set_bankptr(space->machine, 1, &ROM[0x00000]);
320317}
321318
322319static WRITE8_HANDLER( rom_data_w )
r5510r5511
402399         break;
403400      case 0x0ffc:
404401         /* data & 3 = disk drive, TODO */
405         if(data & 3)
406            fatalerror("FDC: Using more than 1 floppy disk drive!");
402         //if(data & 3)
403         //   fatalerror("FDC: Using more than 1 floppy disk drive!");
407404         wd17xx_set_drive(dev,0);
408405         floppy_drive_set_motor_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 0), data & 0x80);
409406         floppy_drive_set_ready_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 0), data & 0x80,0);
r5510r5511
461458   if(addr == 0)
462459   {
463460      /* maybe data actually? */
464      pcg_index[0] = 0;
465      pcg_index[1] = 0;
466      pcg_index[2] = 0;
461      pcg_index[0] = data*8;
462      pcg_index[1] = data*8;
463      pcg_index[2] = data*8;
467464   }
468465   else
469466   {
470      pcg_offset = ((pcg_index[addr-1]*8)+(offset & 7)) & 0x7ff;
467      pcg_offset = (pcg_index[addr-1]) & 0x7ff;
471468      pcg_offset+=((addr-1)*0x800);
472469      PCG_RAM[pcg_offset] = data;
473470
474471      pcg_offset &= 0x7ff;
475472
476      gfx_element_mark_dirty(space->machine->gfx[2], pcg_offset >> 3);
473       gfx_element_mark_dirty(space->machine->gfx[4], pcg_offset >> 3);
474       gfx_element_mark_dirty(space->machine->gfx[5], pcg_offset >> 3);
475       gfx_element_mark_dirty(space->machine->gfx[6], pcg_offset >> 3);
476       gfx_element_mark_dirty(space->machine->gfx[7], pcg_offset >> 3);
477477
478        if((offset & 7) == 7)
479           pcg_index[addr-1]++;
478        pcg_index[addr-1]++;
480479   }
481480}
482481
r5510r5511
506505   AM_RANGE(0x1900, 0x19ff) AM_READWRITE(sub_io_r,sub_io_w) //sub port comms, mirrored
507506   AM_RANGE(0x1a00, 0x1a03) AM_MIRROR(0xfc) AM_DEVREADWRITE("ppi8255_0", ppi8255_r, ppi8255_w) //8255, mirrored
508507   AM_RANGE(0x1b00, 0x1bff) AM_DEVREADWRITE("ay", ay8910_r, ay8910_data_w) //PSG / ay-3-8910 data port
509//   AM_RANGE(0x1b00, 0x1bff) AM_DEVWRITE("ay", ay8910_data_w) //PSG / ay-3-8910 data port
510508   AM_RANGE(0x1c00, 0x1cff) AM_DEVWRITE("ay", ay8910_address_w) //PSG / ay-3-8910 reg port
511509   AM_RANGE(0x1d00, 0x1dff) AM_READNOP AM_WRITE(rom_bank_1_w) //ROM/RAM bankswitch = ROM
512510   AM_RANGE(0x1e00, 0x1eff) AM_WRITE(rom_bank_0_w) //ROM/RAM bankswitch = RAM
r5510r5511
564562   8*8
565563};
566564
565static const gfx_layout x1_pcg_8x8 =
566{
567   8,8,
568   RGN_FRAC(1,3),
569   3,
570   { RGN_FRAC(1,3),RGN_FRAC(2,3),RGN_FRAC(0,3) },
571   { 0, 1, 2, 3, 4, 5, 6, 7 },
572   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
573   8*8
574};
575
576static const gfx_layout x1_pcg_8wx8 =
577{
578   16,8,
579   RGN_FRAC(1,3),
580   3,
581   { RGN_FRAC(1,3),RGN_FRAC(2,3),RGN_FRAC(0,3) },
582   { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7 },
583   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
584   8*8
585};
586
587static const gfx_layout x1_pcg_8x8w =
588{
589   8,16,
590   RGN_FRAC(1,3),
591   3,
592   { RGN_FRAC(1,3),RGN_FRAC(2,3),RGN_FRAC(0,3) },
593   { 0, 1, 2, 3, 4, 5, 6, 7 },
594   { 0*8, 0*8, 1*8, 1*8, 2*8, 2*8, 3*8, 3*8, 4*8, 4*8, 5*8, 5*8, 6*8, 6*8, 7*8, 7*8 },
595   8*8
596};
597
598static const gfx_layout x1_pcg_8wx8w =
599{
600   16,16,
601   RGN_FRAC(1,3),
602   3,
603   { RGN_FRAC(1,3),RGN_FRAC(2,3),RGN_FRAC(0,3) },
604   { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7 },
605   { 0*8, 0*8, 1*8, 1*8, 2*8, 2*8, 3*8, 3*8, 4*8, 4*8, 5*8, 5*8, 6*8, 6*8, 7*8, 7*8 },
606   8*8
607};
608
567609static const gfx_layout x1_chars_16x16 =
568610{
569611   16,16,
r5510r5511
575617   16*16
576618};
577619
578static const gfx_layout x1_pcg_8x8 =
579{
580   8,8,
581   RGN_FRAC(1,3),
582   3,
583   { RGN_FRAC(2,3),RGN_FRAC(1,3),RGN_FRAC(0,3) },
584   { 0, 1, 2, 3, 4, 5, 6, 7 },
585   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
586   8*8
587};
588
589620/* TODO: separe the different x1 decodings accordingly */
590621static GFXDECODE_START( x1 )
591622   GFXDECODE_ENTRY( "cgrom", 0x00000, x1_chars_8x8,    0, 0x40 )
r5510r5511
593624   GFXDECODE_ENTRY( "cgrom", 0x00000, x1_chars_8x8w,   0, 0x40 )
594625   GFXDECODE_ENTRY( "cgrom", 0x00000, x1_chars_8wx8w,  0, 0x40 )
595626   GFXDECODE_ENTRY( "pcg",   0x00000, x1_pcg_8x8,      0x80, 1 )
627   GFXDECODE_ENTRY( "pcg",   0x00000, x1_pcg_8wx8,     0x80, 1 )
628   GFXDECODE_ENTRY( "pcg",   0x00000, x1_pcg_8x8w,     0x80, 1 )
629   GFXDECODE_ENTRY( "pcg",   0x00000, x1_pcg_8wx8w,    0x80, 1 )
596630   GFXDECODE_ENTRY( "cgrom", 0x01800, x1_chars_16x16,  0, 0x40 ) //only x1turboz uses this so far
597631   GFXDECODE_ENTRY( "kanji", 0x27000, x1_chars_16x16,  0, 0x40 ) //needs to be checked when the ROM will be redumped
598632GFXDECODE_END
r5510r5511
939973   memset(gfx_bitmap_ram,0x00,0xc000);
940974
941975   for(i=0;i<0x1800;i++)
976   {
942977      PCG_RAM[i] = 0;
978   }
979
980   for(i=0;i<0x0400;i++)
981   {
982      gfx_element_mark_dirty(machine->gfx[4], i);
983         gfx_element_mark_dirty(machine->gfx[5], i);
984         gfx_element_mark_dirty(machine->gfx[6], i);
985      gfx_element_mark_dirty(machine->gfx[7], i);
986   }
943987}
944988
945989static void ctc0_interrupt(const device_config *device, int state)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team