Previous 15994 Revisions Next

r9516 Thursday 4th November, 2010 at 15:15:49 UTC by Angelo Salese
[PC-88VA]: Added graphic priority sub-system
[src/mess/drivers]pc88va.c

src/mess/drivers/pc88va.c
r9515r9516
99   TODO:
1010   - Does this system have one or two CPUs? I'm prone to think that the V30 does all the job
1111     and then enters into z80 compatible mode for PC-8801 emulation.
12   - What exact kind of garbage happens if you try to enable both direct and palette color
13     modes to a graphic layer?
14   - What is exactly supposed to be a "bus slot"?
1215
1316********************************************************************************************/
1417
r9515r9516
3841   UINT8 blink;
3942   UINT16 cur_pos_x,cur_pos_y;
4043}tsp;
44static UINT16 video_pri_reg[2];
4145
4246static UINT8 backupram_wp;
4347
r9515r9516
143147/* TODO: this is either a result of an hand-crafted ROM or the JIS stuff is really attribute related ... */
144148static UINT32 calc_kanji_rom_addr(UINT8 jis1,UINT8 jis2,int x,int y)
145149{
146   if(jis1 < 0x28)
150   if(jis1 < 0x30)
147151      return ((jis2 & 0x60) << 8) + ((jis1 & 0x07) << 10) + ((jis2 & 0x1f) << 5);
148   else if(jis1 >= 0x28 && jis1 < 0x30)
149      return ((jis2 & 0x60) << 8) + ((jis1 & 0x07) << 10) + ((jis2 & 0x1f) << 5);
150152   else if(jis1 >= 0x30 && jis1 < 0x3f)
151153      return ((jis2 & 0x60) << 10) + ((jis1 & 0x0f) << 10) + ((jis2 & 0x1f) << 5);
152154   else if(jis1 >= 0x40 && jis1 < 0x50)
r9515r9516
301303                  hline = 1;
302304               break;
303305            default:
304               popmessage("Illegal text tilemap attribute mode %02x",attr_mode);
306               popmessage("Illegal text tilemap attribute mode %02x, contact MESSdev",attr_mode);
305307               return;
306308         }
307309
r9515r9516
339341
340342static VIDEO_UPDATE( pc88va )
341343{
344   UINT8 pri,cur_pri_lv;
345   UINT32 screen_pri;
342346   bitmap_fill(bitmap, cliprect, 0);
343347
348   /*
349   video_pri_reg[0]
350   xxxx ---- ---- ---- priority 3
351   ---- xxxx ---- ---- priority 2
352   ---- ---- xxxx ---- priority 1
353   ---- ---- ---- xxxx priority 0
354   video_pri_reg[1]
355   ---- ---- xxxx ---- priority 5
356   ---- ---- ---- xxxx priority 4
357
358   Note that orthogonality level is actually REVERSED than the level number it indicates, so we have to play a little with the data for an easier usage ...
359   */
360
361   screen_pri = (video_pri_reg[1] & 0x00f0) >> 4; // priority 5
362   screen_pri|= (video_pri_reg[1] & 0x000f) << 4; // priority 4
363   screen_pri|= (video_pri_reg[0] & 0xf000) >> 4; // priority 3
364   screen_pri|= (video_pri_reg[0] & 0x0f00) << 4; // priority 2
365   screen_pri|= (video_pri_reg[0] & 0x00f0) << 12; // priority 1
366   screen_pri|= (video_pri_reg[0] & 0x000f) << 20; // priority 0
367
368   for(pri=0;pri<6;pri++)
344369   {
345      draw_text(screen->machine,bitmap,cliprect);
370      cur_pri_lv = (screen_pri >> (pri*4)) & 0xf;
371
372      if(cur_pri_lv & 8) // enable layer
373      {
374         if(pri <= 1) // (direct color mode, priority 5 and 4)
375         {
376            // 8 = graphic 0
377            // 9 = graphic 1
378         }
379         else
380         {
381            switch(cur_pri_lv & 3) // (palette color mode)
382            {
383               case 0: draw_text(screen->machine,bitmap,cliprect); break;
384               case 1: if(tsp.spr_on) { draw_sprites(screen->machine,bitmap,cliprect); } break;
385               case 2: /* A = graphic 0 */ break;
386               case 3: /* B = graphic 1 */ break;
387            }
388         }
389      }
346390   }
347391
348   if(tsp.spr_on)
349      draw_sprites(screen->machine,bitmap,cliprect);
350
351
352392   return 0;
353393}
354394
r9515r9516
892932   }
893933}
894934
935static WRITE16_HANDLER( video_pri_w )
936{
937   COMBINE_DATA(&video_pri_reg[offset]);
938}
939
895940static ADDRESS_MAP_START( pc88va_io_map, ADDRESS_SPACE_IO, 16 )
896941   AM_RANGE(0x0000, 0x000f) AM_READ8(key_r,0xffff) // Keyboard ROW reading
897942//   AM_RANGE(0x0010, 0x0010) Printer / Calendar Clock Interface
r9515r9516
921966
922967   AM_RANGE(0x0100, 0x0101) AM_READWRITE(screen_ctrl_r,screen_ctrl_w) // Screen Control Register
923968//   AM_RANGE(0x0102, 0x0103) Graphic Screen Control Register
924//   AM_RANGE(0x0106, 0x0107) Palette Control Register
925//   AM_RANGE(0x0108, 0x0109) Direct Color Control Register
969   AM_RANGE(0x0106, 0x0109) AM_WRITE(video_pri_w) // Palette Control Register (priority) / Direct Color Control Register (priority)
926970//   AM_RANGE(0x010a, 0x010b) Picture Mask Mode Register
927971//   AM_RANGE(0x010c, 0x010d) Color Palette Mode Register
928972//   AM_RANGE(0x010e, 0x010f) Backdrop Color Register

Previous 15994 Revisions Next


© 1998-2018 The MESS Team