src/mess/video/upd7220.c
| r10624 | r10625 | |
| 19 | 19 | - FIGS |
| 20 | 20 | - FIGD |
| 21 | 21 | - 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) |
| 23 | 23 | - DMAR |
| 24 | 24 | - DMAW |
| 25 | 25 | - read-modify-write cycle |
| 26 | 26 | - read data |
| 27 | 27 | - modify data |
| 28 | 28 | - write data |
| 29 | - QX-10 diagnostic test crashes when it attempts to draw lines; |
| 29 | 30 | |
| 30 | 31 | - honor visible area |
| 31 | 32 | - wide mode (32-bit access) |
| r10624 | r10625 | |
| 664 | 665 | static void draw_line(upd7220_t *upd7220,int x,int y) |
| 665 | 666 | { |
| 666 | 667 | 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}; |
| 669 | 670 | const int line_x_step[8] = { 1, 0, 0, 1,-1, 0, 0,-1 }; |
| 670 | 671 | const int line_y_step[8] = { 0, 1,-1, 0, 0,-1, 1, 0 }; |
| 671 | 672 | UINT16 line_pattern; |
| 672 | 673 | int line_step = 0; |
| 674 | UINT8 dot; |
| 673 | 675 | |
| 674 | 676 | line_size = upd7220->figs.dc + 1; |
| 677 | /* TODO: line pattern is unchecked */ |
| 675 | 678 | line_pattern = (upd7220->ra[8]) | (upd7220->ra[9]<<8); |
| 676 | 679 | |
| 677 | 680 | //printf("%d %d %08x %04x %d %04x\n",x,y,line_size,line_pattern,upd7220->figs.dir,upd7220->pitch); |
| r10624 | r10625 | |
| 682 | 685 | line_step/= upd7220->figs.dc; |
| 683 | 686 | line_step++; |
| 684 | 687 | 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)); |
| 686 | 690 | x += line_x_dir[upd7220->figs.dir]; |
| 687 | 691 | y += line_y_dir[upd7220->figs.dir]; |
| 688 | 692 | } |