Previous 15994 Revisions Next

r15792 Tuesday 7th August, 2012 at 12:26:22 UTC by Angelo Salese
PC-8801: attempt to fix attribute vram hook-up, it fixes Carrot, Hang-On, N-Basic and Misty Blue gfxs at very least
[src/mess/drivers]pc8801.c

src/mess/drivers/pc8801.c
r15791r15792
528528
529529
530530
531static UINT8 extract_text_attribute(running_machine &machine,UINT32 address,int x)
531static UINT8 extract_text_attribute(running_machine &machine,UINT32 address,int x, UINT8 width)
532532{
533533   pc8801_state *state = machine.driver_data<pc8801_state>();
534534   UINT8 *vram = state->memregion("wram")->base();
535535   int i;
536536   int fifo_size;
537   int offset;
537538
538539   if(state->m_crtc.param[0][4] & 0x80)
539540   {
r15791r15792
542543   }
543544
544545   fifo_size = (state->m_crtc.param[0][4] & 0x20) ? 0 : ((state->m_crtc.param[0][4] & 0x1f) + 1);
546   /* TODO: correct or hack-ish? Certainly having 0 as a attribute X is weird in any case. */
547   offset = (vram[address] == 0) ? 2 : 0;
545548
546549   for(i=0;i<fifo_size;i++)
547550   {
548      /* TODO: DMA timing bug? N-BASIC attributes doesn't work without +2 here ... */
549      if(x < vram[address])
551      if(x < vram[address+offset])
550552      {
551553         return vram[address+1];
552554      }
r15791r15792
554556         address+=2;
555557   }
556558
557   return 0;
559   return vram[address-3+offset];
558560}
559561
560562static void pc8801_draw_char(running_machine &machine,bitmap_ind16 &bitmap,int x,int y,int pal,UINT8 gfx_mode,UINT8 reverse,UINT8 secret,UINT8 blink,UINT8 upper,UINT8 lower,int y_size,int height,int width)
r15791r15792
660662   UINT8 blink;
661663   int pal;
662664
663//   popmessage("%02x",state->m_crtc.param[0][4]);
664
665665   for(y=0;y<y_size;y++)
666666   {
667667      for(x=0;x<80;x++)
r15791r15792
669669         if(x & 1 && !width)
670670            continue;
671671
672         attr = extract_text_attribute(machine,(((y*120)+80+state->m_dma_address[2]) & 0xffff),(x));
672         attr = extract_text_attribute(machine,(((y*120)+80+state->m_dma_address[2]) & 0xffff),(x),width);
673673
674674         if(text_color_flag) // color mode
675675         {
r15791r15792
12641264
12651265READ8_MEMBER(pc8801_state::pc8801_crtc_param_r)
12661266{
1267   printf("CRTC param reading\n");
12671268   return 0xff;
12681269}
12691270
r15791r15792
13361337   }
13371338
13381339   //if((data >> 5) != 4)
1339   //  printf("CRTC cmd %s polled\n",crtc_command[data >> 5]);
1340   //  printf("CRTC cmd %s polled %02x\n",crtc_command[data >> 5],data & 0x1f);
13401341}
13411342
13421343READ8_MEMBER(pc8801_state::pc8801_dmac_r)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team