Previous 15994 Revisions Next

r10625 Tuesday 1st March, 2011 at 02:22:27 UTC by Angelo Salese
[uPD7220]: Preliminary draw lines support
[src/mess/video]upd7220.c

src/mess/video/upd7220.c
r10624r10625
1919        - FIGS
2020        - FIGD
2121        - GCHRD
22        - RDAT, needs a delayed FIFO (seen in A5105 when it scrolls up)
22        - RDAT, needs a larger FIFO (seen in A5105 when it scrolls up)
2323        - DMAR
2424        - DMAW
2525    - read-modify-write cycle
2626        - read data
2727        - modify data
2828        - write data
29   - QX-10 diagnostic test crashes when it attempts to draw lines;
2930
3031    - honor visible area
3132    - wide mode (32-bit access)
r10624r10625
664665static void draw_line(upd7220_t *upd7220,int x,int y)
665666{
666667   int line_size,i;
667   const int line_x_dir[8] = { 0, 1, 1, 1, 0,-1,-1,-1};
668   const int line_y_dir[8] = { 1, 1, 0,-1,-1,-1, 0, 1};
668   const int line_x_dir[8] = { 0, 1, 1, 0, 0,-1,-1, 0};
669   const int line_y_dir[8] = { 1, 0, 0,-1,-1, 0, 0, 1};
669670   const int line_x_step[8] = { 1, 0, 0, 1,-1, 0, 0,-1 };
670671   const int line_y_step[8] = { 0, 1,-1, 0, 0,-1, 1, 0 };
671672   UINT16 line_pattern;
672673   int line_step = 0;
674   UINT8 dot;
673675
674676   line_size = upd7220->figs.dc + 1;
677   /* TODO: line pattern is unchecked */
675678   line_pattern = (upd7220->ra[8]) | (upd7220->ra[9]<<8);
676679
677680   //printf("%d %d %08x %04x %d %04x\n",x,y,line_size,line_pattern,upd7220->figs.dir,upd7220->pitch);
r10624r10625
682685      line_step/= upd7220->figs.dc;
683686      line_step++;
684687      line_step >>= 1;
685      draw_pixel(upd7220,x + line_step*line_x_step[upd7220->figs.dir],y + line_step*line_y_step[upd7220->figs.dir],1 << ((x + line_step*line_x_step[upd7220->figs.dir]) & 0xf));
688      dot = (line_pattern >> ((15-i+upd7220->dad) & 0xf)) & 1;
689      draw_pixel(upd7220,x + (line_step*line_x_step[upd7220->figs.dir]),y + (line_step*line_y_step[upd7220->figs.dir]),dot << ((x + line_step*line_x_step[upd7220->figs.dir]) & 0xf));
686690      x += line_x_dir[upd7220->figs.dir];
687691      y += line_y_dir[upd7220->figs.dir];
688692   }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team