Previous 15994 Revisions Next

r8736 Saturday 7th August, 2010 at 18:46:30 UTC by Angelo Salese
[PC6001Mk2]: Fixed extended gfx mode priority, 3bpp mode has higher priority than 2bpp, fixes American Truck gameplay graphics
[src/mess/drivers]pc6001.c

src/mess/drivers/pc6001.c
r8735r8736
1818        B) It's easier to me to see what the attribute vram does since I don't
1919           have any docs atm.
2020
21    TODO (pc6001mk2 specific)
22    - vram banking model isn't yet 100% understood;
23   - page mode 4 doesn't seem to work properly;
24   - some games needs particular parameters (with the MON command), they all won't boot;
25
2621   TODO (game specific):
2722   - The Outlaw (AX-10): is now broken due of the joycode stuff
2823   - Portpia: hangs after a bunch of text screens
r8735r8736
3227   - Yakyukyo (MK2): waits for an irq, check which one;
3328   - Forts 2 (MK2): ASCII gfxs are missing;
3429   - Hydlide (MK2): crashes due of a load error;
30   - American Truck (MK2): It has various gfx bugs
3531
3632==================================================================================
3733
r8735r8736
346342{
347343   int x,y,tile,attr;
348344
349   if(exgfx_2bpp_mode)
345   /* note: bitmap mode have priority over everything else, check American Truck */
346   if(exgfx_bitmap_mode)
350347   {
351348      int count,color,i;
352349
r8735r8736
354351
355352      for(y=0;y<200;y++)
356353      {
357         for(x=0;x<320;x+=8)
354         for(x=0;x<160;x+=4)
358355         {
359            for(i=0;i<8;i++)
356            for(i=0;i<4;i++)
360357            {
361358               int pen[2];
362359
363360               /*
364361               palette reference:
365               UINT8 pal_num[] = { 0x00, 0x04, 0x01, 0x05 };
362               UINT8 pal_num[] = { 0x00, 0x04, 0x01, 0x05,
363                                   0x02, 0x06, 0x03, 0x07,
364                                   0x08, 0x0c, 0x09, 0x0d,
365                                   0x0a, 0x0e, 0x0b, 0x0f };
366366
367               color |= pal_num[(pen[0] & 1) | ((pen[1] & 1) << 1)];
367               color |= pal_num[(pen[0] & 3) | ((pen[1] & 3) << 2)];
368368               */
369369
370               pen[0] = pc6001_video_ram[count+0x0000] >> (7-i) & 1;
371               pen[1] = pc6001_video_ram[count+0x2000] >> (7-i) & 1;
370               pen[0] = pc6001_video_ram[count+0x0000] >> (6-i*2) & 3;
371               pen[1] = pc6001_video_ram[count+0x2000] >> (6-i*2) & 3;
372372
373               if(bgcol_bank & 4) //PC-6001 emulation mode
374               {
375                  color = 0x08;
376                  color |= (pen[0]) | (pen[1]<<1);
377                  color |= (bgcol_bank & 1) << 2;
378               }
379               else //Mk-2 mode
380               {
381                  color = 0x10;
382                  color |= ((pen[0] & 1) << 2);
383                  color |= ((pen[1] & 1) >> 0);
384                  color |= ((bgcol_bank & 1) << 1);
385                  color |= ((bgcol_bank & 2) << 2);
386               }
373               color = 0x10;
374               color |= ((pen[0] & 1) << 2);
375               color |= ((pen[0] & 2) >> 1);
376               color |= ((pen[1] & 1) << 1);
377               color |= ((pen[1] & 2) << 2);
387378
388               if ((x+i) <= screen->visible_area().max_x && (y) <= screen->visible_area().max_y)
389                  *BITMAP_ADDR16(bitmap, y, (x+i)) = screen->machine->pens[color];
379               if (((x+i)*2+0) <= screen->visible_area().max_x && (y) <= screen->visible_area().max_y)
380                  *BITMAP_ADDR16(bitmap, y, (x+i)*2+0) = screen->machine->pens[color];
381               if (((x+i)*2+1) <= screen->visible_area().max_x && (y) <= screen->visible_area().max_y)
382                  *BITMAP_ADDR16(bitmap, y, (x+i)*2+1) = screen->machine->pens[color];
390383            }
391384
392385            count++;
393386         }
394387      }
395
396388   }
397   else if(exgfx_bitmap_mode)
389   else if(exgfx_2bpp_mode)
398390   {
399391      int count,color,i;
400392
r8735r8736
402394
403395      for(y=0;y<200;y++)
404396      {
405         for(x=0;x<160;x+=4)
397         for(x=0;x<320;x+=8)
406398         {
407            for(i=0;i<4;i++)
399            for(i=0;i<8;i++)
408400            {
409401               int pen[2];
410402
411403               /*
412404               palette reference:
413               UINT8 pal_num[] = { 0x00, 0x04, 0x01, 0x05,
414                                   0x02, 0x06, 0x03, 0x07,
415                                   0x08, 0x0c, 0x09, 0x0d,
416                                   0x0a, 0x0e, 0x0b, 0x0f };
405               UINT8 pal_num[] = { 0x00, 0x04, 0x01, 0x05 };
417406
418               color |= pal_num[(pen[0] & 3) | ((pen[1] & 3) << 2)];
407               color |= pal_num[(pen[0] & 1) | ((pen[1] & 1) << 1)];
419408               */
420409
421               pen[0] = pc6001_video_ram[count+0x0000] >> (6-i*2) & 3;
422               pen[1] = pc6001_video_ram[count+0x2000] >> (6-i*2) & 3;
410               pen[0] = pc6001_video_ram[count+0x0000] >> (7-i) & 1;
411               pen[1] = pc6001_video_ram[count+0x2000] >> (7-i) & 1;
423412
424               color = 0x10;
425               color |= ((pen[0] & 1) << 2);
426               color |= ((pen[0] & 2) >> 1);
427               color |= ((pen[1] & 1) << 1);
428               color |= ((pen[1] & 2) << 2);
413               if(bgcol_bank & 4) //PC-6001 emulation mode
414               {
415                  color = 0x08;
416                  color |= (pen[0]) | (pen[1]<<1);
417                  color |= (bgcol_bank & 1) << 2;
418               }
419               else //Mk-2 mode
420               {
421                  color = 0x10;
422                  color |= ((pen[0] & 1) << 2);
423                  color |= ((pen[1] & 1) >> 0);
424                  color |= ((bgcol_bank & 1) << 1);
425                  color |= ((bgcol_bank & 2) << 2);
426               }
429427
430               if (((x+i)*2+0) <= screen->visible_area().max_x && (y) <= screen->visible_area().max_y)
431                  *BITMAP_ADDR16(bitmap, y, (x+i)*2+0) = screen->machine->pens[color];
432               if (((x+i)*2+1) <= screen->visible_area().max_x && (y) <= screen->visible_area().max_y)
433                  *BITMAP_ADDR16(bitmap, y, (x+i)*2+1) = screen->machine->pens[color];
428               if ((x+i) <= screen->visible_area().max_x && (y) <= screen->visible_area().max_y)
429                  *BITMAP_ADDR16(bitmap, y, (x+i)) = screen->machine->pens[color];
434430            }
435431
436432            count++;
r8735r8736
743739         if((data & 0x0f) == 0x05)
744740            memory_set_bankptr(device->machine, "bank4", &ROM[banksw_table_r0[(bank_r0 & 0xf0)>>4][3]]);
745741         if((data & 0x0f) == 0x04)
746            memory_set_bankptr(device->machine, "bank4", &gfx_data[0]); //FIXME: check this (CGROM 2)
742            memory_set_bankptr(device->machine, "bank4", &gfx_data[0x2000]); //FIXME: check this (CGROM 2)
747743      }
748744   }
749745   i8255a_w(device,offset,data);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team