Previous 15994 Revisions Next

r9520 Thursday 4th November, 2010 at 17:06:14 UTC by Angelo Salese
[PC-88VA]: Added command-based sprite/cursor sw
[src/mess/drivers]pc88va.c

src/mess/drivers/pc88va.c
r9519r9520
55   A follow up of the regular PC-8801. It can also run PC-8801 software in compatible mode
66
77   preliminary driver by Angelo Salese
8   Special thanks to Fujix for his documentation translation help
89
910   TODO:
1011   - Does this system have one or two CPUs? I'm prone to think that the V30 does all the job
r9519r9520
4041   UINT8 h_line_pos;
4142   UINT8 blink;
4243   UINT16 cur_pos_x,cur_pos_y;
44   UINT8 curn;
45   UINT8 curn_blink;
4346}tsp;
4447static UINT16 video_pri_reg[2];
4548
r9519r9520
345348   UINT32 screen_pri;
346349   bitmap_fill(bitmap, cliprect, 0);
347350
351   if(tsp.disp_on == 0) // don't bother if we are under DSPOFF command
352      return 0;
353
348354   /*
349355   video_pri_reg[0]
350356   xxxx ---- ---- ---- priority 3
r9519r9520
541547      case DSPON:  cmd = DSPON; buf_size = 3;  buf_index = 0; break;
542548
543549      /* 0x13 - DSPOFF: set DiSPlay OFF */
544      case DSPOFF: tsp.disp_on = 0; break;
550      case DSPOFF: cmd = DSPOFF; tsp.disp_on = 0; break;
545551
546552      /* 0x14 - DSPDEF: set DiSPlay DEFinitions */
547553      case DSPDEF: cmd = DSPDEF; buf_size = 6; buf_index = 0; break;
r9519r9520
559565      case EMUL:   cmd = EMUL;   buf_size = 4; buf_index = 0; break;
560566
561567      /* 0x88 - EXIT: ??? */
562      case EXIT: break;
568      case EXIT:   cmd = EXIT; break;
563569
564570      /* 0x82 - SPRON: set SPRite ON */
565      case SPRON:  cmd = SPRON;  buf_size = 3; buf_index = 0; break;
571      case SPRON:  cmd = SPRON;  buf_size = 3; buf_index = 0; break;
566572
567573      /* 0x83 - SPROFF: set SPRite OFF */
568      case SPROFF: tsp.spr_on = 0; break;
574      case SPROFF: cmd = SPROFF; tsp.spr_on = 0; break;
569575
570576      /* 0x85 - SPRSW: ??? */
571      case SPRSW:  cmd = SPRSW;  buf_size = 1; buf_index = 0; break;
577      case SPRSW:  cmd = SPRSW;  buf_size = 1; buf_index = 0; break;
572578
573579      /* 0x81 - SPROV: set SPRite OVerflow information */
574      case 0x81: /* ... */ break;
580      /*
581      -x-- ---- Sprite Over flag
582      --x- ---- Sprite Collision flag
583      ---x xxxx First sprite that caused Sprite Over event
584      */
585      case SPROV:  cmd = SPROV; /* TODO: where it returns the info? */ break;
575586
576587      /* TODO: 0x89 shouldn't trigger, should be one of the above commands */
577588      default:   cmd = 0x00; printf("PC=%05x: Unknown IDP %02x cmd set\n",cpu_get_pc(space->cpu),data); break;
578589   }
579590}
580591
592static void tsp_sprite_enable(running_machine *machine, UINT32 spr_offset, UINT8 sw_bit)
593{
594   address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
595
596   space->write_word(spr_offset, space->read_word(spr_offset) & ~0x200);
597   space->write_word(spr_offset, space->read_word(spr_offset) | (sw_bit & 0x200));
598}
599
581600/* TODO: very preliminary, needs something showable first */
582601static void execute_sync_cmd(running_machine *machine)
583602{
r9519r9520
642661   /*
643662   [0] attr offset (lo word)
644663   [1] attr offset (hi word)
645   [2] pitch
664   [2] pitch (character code interval x 16, i.e. 0x20 = 2 bytes
646665   [3] line height
647   [4] h line position
666   [4] hline vertical position
648667   [5] blink number
649668   */
650669   tsp.attr_offset = buf_ram[0] | buf_ram[1] << 8;
r9519r9520
658677{
659678   /*
660679   xxxx x--- [0] Sprite Cursor number (sprite RAM entry)
661   ---- --x- [0] (bit in sprite def)
680   ---- --x- [0] show cursor bit (actively modifies the spriteram entry)
662681   ---- ---x [0] Blink Enable
663682   */
664683
665684   /* TODO: needs basic sprite emulation */
685   tsp.curn = (buf_ram[0] & 0xf8);
686   tsp.curn_blink = (buf_ram[0] & 1);
687
688   tsp_sprite_enable(machine, 0xa0000 + tsp.spr_offset + tsp.curn, (buf_ram[0] & 2) << 8);
666689}
667690
668691static void execute_actscr_cmd(running_machine *machine)
669692{
670693   /*
671   xxxx xxxx [0] param * 32 (???)
694   This command assigns a strip where the cursor is located.
695   xxxx xxxx [0] strip ID * 32 (???)
672696   */
673697
674698   /* TODO: no idea about this command */
699   //printf("ACTSCR: %02x\n",buf_ram[0]);
675700}
676701
677702static void execute_curs_cmd(running_machine *machine)
r9519r9520
689714
690715static void execute_emul_cmd(running_machine *machine)
691716{
717   /*
718   [0] Emulate target strip ID x 32
719   [1] The number of chars
720   [2] The number of attributes
721   [3] The number of lines
722   */
723
692724   // TODO: this starts 3301 video emulation
725   //popmessage("Warning: TSP executes EMUL command, contact MESSdev");
693726}
694727
695728static void execute_spron_cmd(running_machine *machine)
r9519r9520
697730   /*
698731   [0] Sprite Table Offset (hi word)
699732   [1] (unknown / reserved)
700   xxxx x--- [2] HSPN: some kind of Sprite Over register
701   ---- --x- [2] MG: ???
702   ---- ---x [2] GR: ???
733   xxxx x--- [2] HSPN: Maximum number of sprites in one raster (num + 1) for Sprite Over
734   ---- --x- [2] MG: all sprites are 2x zoomed vertically when 1
735   ---- ---x [2] GR: 1 to enable the group collision detection
703736   */
704737   tsp.spr_offset = buf_ram[0] << 8;
705738   tsp.spr_on = 1;
r9519r9520
708741
709742static void execute_sprsw_cmd(running_machine *machine)
710743{
711   /* TODO: no idea about this command, some kind of manual sprite switch? */
744   /*
745   Toggle an individual sprite in the sprite ram entry
746   [0] xxxx x--- target sprite number
747   [0] ---- --x- sprite off/on switch
748   */
749
750   tsp_sprite_enable(machine, 0xa0000 + tsp.spr_offset + (buf_ram[0] & 0xf8), (buf_ram[0] & 2) << 8);
712751}
713752
714753static WRITE8_HANDLER( idp_param_w )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team