Previous 15994 Revisions Next

r10098 Wednesday 19th January, 2011 at 03:09:01 UTC by Angelo Salese
[PC-8801]: Fixed text tilemap colors in width 40
[src/mess/drivers]pc8801.c

src/mess/drivers/pc8801.c
r10097r10098
2626   - Acro Jet: hangs waiting for an irq;
2727   - Aggress: crashes after that it shows the title screen;
2828   - American Success: reads the light pen?
29   - Alphos: test case for text VRAM attributes;
29   - Alpha (demo): crashes with "illegal function" msg;
3030   - Alphos: text VRAM garbage during gameplay;
3131   - Balance of Power: attempt to use the SIO port for mouse polling, worked around for now;
3232   - Battle Entry: moans with a kanji msg then dies if you try to press either numpad 1 or 2 (what it basically asks by looking at the DASM)
3333   - Bersekers Front Gaiden 3: checks CPU speed port and polls the PCG stuff too;
3434   - Bishoujo Baseball Gakuen: checks ym2608 after intro screen;
35   - Blue Moon Story: moans with a kanji msg;.
3536   - Bokosuka Wars: doesn't boot, floppy issue;
37   - Bouken Roman: doesn't boot, floppy issue;
38   - Bruce Lee: doesn't boot, floppy issue;
39   - Bu U Ma: sets gfx compatibility mode (attr bit 4,N-BASIC), dunno how to draw with it ...;
3640   - Grobda: palette is ugly;
3741   - Wanderers from Ys: floppy / irq issues?
3842   - Xevious: game is too fast
r10097r10098
314318
315319
316320
317static UINT8 extract_text_attribute(running_machine *machine,UINT32 address,int x,int swap)
321static UINT8 extract_text_attribute(running_machine *machine,UINT32 address,int x)
318322{
319323   UINT8 *vram = machine->region("maincpu")->base() + WRAM_BASE;
320324   int i;
r10097r10098
330334
331335   for(i=0;i<fifo_size;i++)
332336   {
333      /* TODO: do we have a bug lying to somewhere else? N-BASIC attributes doesn't work without this +2 ... */
334      if(x < vram[address+swap])
337      /* TODO: DMA timing bug? N-BASIC attributes doesn't work here without +2 here ... */
338      if(x < vram[address])
335339      {
336340         return vram[address+1];
337341      }
r10097r10098
352356   UINT8 attr;
353357   UINT8 reverse;
354358   UINT8 pal;
359   UINT8 gfx_mode;
355360
356361   y_height = y_size == 20 ? 10 : 8;
357362
r10097r10098
359364   {
360365      for(x=0;x<80;x++)
361366      {
362         attr = extract_text_attribute(machine,(((y*120)+80+dma_address[2]) & 0xffff),(x),0);
367         attr = extract_text_attribute(machine,(((y*120)+80+dma_address[2]) & 0xffff),(x));
363368
364369         if(text_color_flag)
370         {
365371            pal = (attr & 0xe0) >> 5;
372            gfx_mode = (attr & 0x10) >> 4;
373         }
366374         else
375         {
367376            pal = 7;
377            reverse = attr & 4;
378         }
368379
369         reverse = attr & 4;
380         pal|=8; //text pal bank
370381
371382         for(yi=0;yi<8;yi++)
372383         {
r10097r10098
377388               int res_x,res_y;
378389               int tile;
379390               int color;
380               UINT8 *gfx_data = machine->region("gfx1")->base();
381391
382               tile = vram[x+(y*120)+dma_address[2]];
392               {
393                  UINT8 *gfx_data = machine->region("gfx1")->base();
383394
384               res_x = x*8+xi;
385               res_y = y*y_height+yi;
395                  tile = vram[x+(y*120)+dma_address[2]];
386396
387               if(is_cursor || reverse)
388                  color = ((gfx_data[tile*8+yi] >> (7-xi)) & 1) ? -1 : pal;
389               else
390                  color = ((gfx_data[tile*8+yi] >> (7-xi)) & 1) ? pal : -1;
397                  res_x = x*8+xi;
398                  res_y = y*y_height+yi;
391399
392               if((res_x)<=machine->primary_screen->visible_area().max_x && (res_y)<=machine->primary_screen->visible_area().max_y)
393                  if(color != -1)
394                     *BITMAP_ADDR16(bitmap, res_y, res_x) = machine->pens[color];
400                  if(is_cursor || reverse)
401                     color = ((gfx_data[tile*8+yi] >> (7-xi)) & 1) ? -1 : pal;
402                  else
403                     color = ((gfx_data[tile*8+yi] >> (7-xi)) & 1) ? pal : -1;
404
405                  if((res_x)<=machine->primary_screen->visible_area().max_x && (res_y)<=machine->primary_screen->visible_area().max_y)
406                     if(color != -1)
407                        *BITMAP_ADDR16(bitmap, res_y, res_x) = machine->pens[color];
408               }
395409            }
396410         }
397411      }
r10097r10098
407421   UINT8 y_height;
408422   UINT8 attr;
409423   UINT8 reverse;
424   UINT8 pal;
410425
411426   y_height = y_size == 20 ? 10 : 8;
412427
r10097r10098
417432         if(x & 1)
418433            continue;
419434
420         attr = extract_text_attribute(machine,(((y*120)+80+dma_address[2]) & 0xffff),(x),2);
435         attr = extract_text_attribute(machine,(((y*120)+80+dma_address[2]) & 0xffff),(x));
421436
437         if(text_color_flag)
438            pal = (attr & 0xe0) >> 5;
439         else
440            pal = 7;
441
442         pal|=8; //text pal bank
443
422444         reverse = attr & 4;
423445
424446         for(yi=0;yi<8;yi++)
r10097r10098
438460               res_y = (y*y_height)+yi;
439461
440462               if(is_cursor || reverse)
441                  color = ((gfx_data[tile*8+yi] >> (7-xi)) & 1) ? -1 : 7;
463                  color = ((gfx_data[tile*8+yi] >> (7-xi)) & 1) ? -1 : pal;
442464               else
443                  color = ((gfx_data[tile*8+yi] >> (7-xi)) & 1) ? 7 : -1;
465                  color = ((gfx_data[tile*8+yi] >> (7-xi)) & 1) ? pal : -1;
444466
445467               if((res_x)<=machine->primary_screen->visible_area().max_x && (res_y)<=machine->primary_screen->visible_area().max_y)
446468                  if(color != -1)
r10097r10098
11311153
11321154static WRITE8_HANDLER( pc8801_pcg8100_w )
11331155{
1156   if(data)
11341157   printf("Write to PCG-8100 %02x %02x\n",offset,data);
11351158}
11361159
r10097r10098
17391762      extram_bank = 0;
17401763      extram_mode = 0;
17411764   }
1765
1766   {
1767      int i;
1768
1769      for(i=0;i<0x10;i++) //text + bitmap
1770         palette_set_color_rgb(machine, i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
1771   }
17421772}
17431773
17441774static PALETTE_INIT( pc8801 )
17451775{
17461776   int i;
17471777
1748   for(i=0;i<8;i++)
1778   for(i=0;i<0x10;i++) //text + bitmap
17491779      palette_set_color_rgb(machine, i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
17501780}
17511781
r10097r10098
18671897   ROM_LOAD( "kanji2.rom", 0x20000, 0x20000, CRC(154803cc) SHA1(7e6591cd465cbb35d6d3446c5a83b46d30fafe95) )   // it should not be here
18681898
18691899   ROM_REGION( 0x40000, "gfx1", 0)
1870   ROM_COPY( "kanji", 0x1000, 0x0000, 0x800 )
1900   ROM_COPY( "kanji", 0x1000, 0x0000, 0x1000 )
18711901ROM_END
18721902
18731903ROM_START( pc8801mk2fr )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team