Previous 15994 Revisions Next

r1924 Tuesday 11th March, 2008 at 20:50:19 UTC by Wilbert Pol
Removed deprecat.h dependency from video/tms3556.c
[src/mess/drivers]exelv.c
[src/mess/video]tms3556.c tms3556.h

src/mess/video/tms3556.c
r1923r1924
1212*/
1313
1414#include "driver.h"
15#include "deprecat.h"
1615#include "tms3556.h"
1716
1817static struct
r1923r1924
308307   draw a line of text (called by tms3556_draw_line_text and
309308   tms3556_draw_line_mixed)
310309*/
311static void tms3556_draw_line_text_common(UINT16 *ln)
310static void tms3556_draw_line_text_common(running_machine *machine, UINT16 *ln)
312311{
313312   int pattern, x, xx, i, name_offset;
314313   UINT16 fg, bg;
r1923r1924
336335      name_lo = nametbl[name_offset+1];
337336      pattern_ix = ((name_hi >> 2) & 2) | ((name_hi >> 4) & 1);
338337      alphanumeric_mode = (pattern_ix < 2) || ((pattern_ix == 3) && !(vdp.controlRegs[7] & 0x08));
339      fg = Machine->pens[(name_hi >> 5) & 0x7];
338      fg = machine->pens[(name_hi >> 5) & 0x7];
340339      if (alphanumeric_mode)
341340      {
342341         if (name_hi & 4)
r1923r1924
422421   draw a line of bitmap (called by tms3556_draw_line_bitmap and
423422   tms3556_draw_line_mixed)
424423*/
425static void tms3556_draw_line_bitmap_common(UINT16 *ln)
424static void tms3556_draw_line_bitmap_common(running_machine *machine, UINT16 *ln)
426425{
427426   int x, xx;
428427   UINT8 *nametbl;
r1923r1924
444443      name_r = nametbl[vdp.name_offset+2];
445444      for (xx=0;xx<8;xx++)
446445      {
447         UINT16 color = Machine->pens[((name_b >> 5) & 0x4) | ((name_g >> 6) & 0x2) | ((name_r >> 7) & 0x1)];
446         UINT16 color = machine->pens[((name_b >> 5) & 0x4) | ((name_g >> 6) & 0x2) | ((name_r >> 7) & 0x1)];
448447#if DOUBLE_WIDTH
449448         *ln++ = color;
450449#endif
r1923r1924
468467
469468   draw a line in text mode
470469*/
471static void tms3556_draw_line_text(UINT16 *ln)
470static void tms3556_draw_line_text(running_machine *machine, UINT16 *ln)
472471{
473472   if (vdp.char_line_counter == 0)
474473      vdp.char_line_counter = 10;
475474   vdp.char_line_counter--;
476   tms3556_draw_line_text_common(ln);
475   tms3556_draw_line_text_common(machine, ln);
477476}
478477
479478/*
r1923r1924
481480
482481   draw a line in bitmap mode
483482*/
484static void tms3556_draw_line_bitmap(UINT16 *ln)
483static void tms3556_draw_line_bitmap(running_machine *machine, UINT16 *ln)
485484{
486485   UINT8 *nametbl;
487486
488487
489   tms3556_draw_line_bitmap_common(ln);
488   tms3556_draw_line_bitmap_common(machine, ln);
490489   nametbl = vdp.vram + vdp.addressRegs[2];
491   vdp.bg_color = Machine->pens[(nametbl[vdp.name_offset] >> 5) & 0x7];
490   vdp.bg_color = machine->pens[(nametbl[vdp.name_offset] >> 5) & 0x7];
492491   vdp.name_offset += 2;
493492}
494493
r1923r1924
497496
498497   draw a line in mixed mode
499498*/
500static void tms3556_draw_line_mixed(UINT16 *ln)
499static void tms3556_draw_line_mixed(running_machine *machine, UINT16 *ln)
501500{
502501   UINT8 *nametbl;
503502
504503
505504   if (vdp.cg_flag)
506505   {   /* bitmap line */
507      tms3556_draw_line_bitmap_common(ln);
506      tms3556_draw_line_bitmap_common(machine, ln);
508507      nametbl = vdp.vram + vdp.addressRegs[2];
509      vdp.bg_color = Machine->pens[(nametbl[vdp.name_offset] >> 5) & 0x7];
508      vdp.bg_color = machine->pens[(nametbl[vdp.name_offset] >> 5) & 0x7];
510509      vdp.cg_flag = (nametbl[vdp.name_offset] >> 4) & 0x1;
511510      vdp.name_offset += 2;
512511   }
r1923r1924
515514      if (vdp.char_line_counter == 0)
516515         vdp.char_line_counter = 10;
517516      vdp.char_line_counter--;
518      tms3556_draw_line_text_common(ln);
517      tms3556_draw_line_text_common(machine, ln);
519518      if (vdp.char_line_counter == 0)
520519      {
521520         nametbl = vdp.vram + vdp.addressRegs[2];
522         vdp.bg_color = Machine->pens[(nametbl[vdp.name_offset] >> 5) & 0x7];
521         vdp.bg_color = machine->pens[(nametbl[vdp.name_offset] >> 5) & 0x7];
523522         vdp.cg_flag = (nametbl[vdp.name_offset] >> 4) & 0x1;
524523         vdp.name_offset += 2;
525524      }
r1923r1924
531530
532531   draw a line.  If non-interlaced mode, duplicate the line.
533532*/
534static void tms3556_draw_line(bitmap_t *bmp, int line)
533static void tms3556_draw_line(running_machine *machine, bitmap_t *bmp, int line)
535534{
536535   int double_lines;
537536   UINT16 *ln, *ln2 = NULL;
r1923r1924
561560         tms3556_draw_line_empty(ln);
562561         break;
563562      case TMS3556_MODE_TEXT:
564         tms3556_draw_line_text(ln);
563         tms3556_draw_line_text(machine, ln);
565564         break;
566565      case TMS3556_MODE_BITMAP:
567         tms3556_draw_line_bitmap(ln);
566         tms3556_draw_line_bitmap(machine, ln);
568567         break;
569568      case TMS3556_MODE_MIXED:
570         tms3556_draw_line_mixed(ln);
569         tms3556_draw_line_mixed(machine, ln);
571570         break;
572571      }
573572   }
r1923r1924
582581
583582   Do vblank-time tasks
584583*/
585static void tms3556_interrupt_start_vblank(void)
584static void tms3556_interrupt_start_vblank(running_machine *machine)
586585{
587586   int i;
588587
r1923r1924
599598      vdp.blink_count = 60;   /*no idea what the real value is*/
600599   }
601600   /* reset background color */
602   vdp.bg_color = Machine->pens[(vdp.controlRegs[7] >> 5) & 0x7];
601   vdp.bg_color = machine->pens[(vdp.controlRegs[7] >> 5) & 0x7];
603602   /* reset name offset */
604603   vdp.name_offset = 0;
605604   /* reset character line counter */
r1923r1924
616615
617616   scanline handler
618617*/
619void tms3556_interrupt(void)
618void tms3556_interrupt(running_machine *machine)
620619{
621620   /* check for start of vblank */
622621   if (vdp.scanline == 310)   /*no idea what the real value is*/
623      tms3556_interrupt_start_vblank();
622      tms3556_interrupt_start_vblank( machine );
624623
625624   /* render the current line */
626625   if ((vdp.scanline >= 0) && (vdp.scanline < TOTAL_HEIGHT))
627626   {
628627      //if (!video_skip_this_frame())
629         tms3556_draw_line(tmpbitmap, vdp.scanline);
628         tms3556_draw_line(machine, tmpbitmap, vdp.scanline);
630629   }
631630
632631   if (++vdp.scanline == 313)
src/mess/video/tms3556.h
r1923r1924
99
1010extern void tms3556_init(int vram_size);
1111extern void tms3556_reset(void);
12extern void tms3556_interrupt(void);
12extern void tms3556_interrupt(running_machine *machine);
1313
1414MACHINE_DRIVER_EXTERN( tms3556 );
src/mess/drivers/exelv.c
r1923r1924
7474
7575static INTERRUPT_GEN( exelv_hblank_interrupt )
7676{
77   tms3556_interrupt();
77   tms3556_interrupt( machine );
7878}
7979
8080/*static DEVICE_LOAD(exelv_cart)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team