trunk/src/emu/video/upd7220.c
r241444 | r241445 | |
965 | 965 | int isize,psize; |
966 | 966 | UINT16 tile_data = 0; |
967 | 967 | |
968 | | LOG(("uPD7220 char check: %d %d %02x %08x %d %d\n",x,y,m_figs.m_dir,m_ead,m_figs.m_d,m_figs.m_dc)); |
| 968 | LOG(("uPD7220 char check: %d %d %02x %08x %d %d %02x\n",x,y,m_figs.m_dir,m_ead,m_figs.m_d,m_figs.m_dc,m_figs.m_figure_type)); |
969 | 969 | |
970 | 970 | isize = m_figs.m_d & 0x3ff; |
971 | 971 | /* Guess: D has presumably upper bits for ysize, QX-10 relies on this (TODO: check this on any real HW) */ |
r241444 | r241445 | |
985 | 985 | curpixel++; |
986 | 986 | } |
987 | 987 | } |
988 | | x += x_dir[(m_figs.m_dir + 2) & 7]; |
989 | | y += y_dir[(m_figs.m_dir + 2) & 7]; |
| 988 | if(m_figs.m_figure_type == 2) |
| 989 | { |
| 990 | x += x_dir[(m_figs.m_dir + 2) & 7]; |
| 991 | y += y_dir[(m_figs.m_dir + 2) & 7]; |
| 992 | } |
| 993 | else |
| 994 | { |
| 995 | x += x_dir[(m_figs.m_dir + 1) & 7]; |
| 996 | y += y_dir[(m_figs.m_dir + 1) & 7]; |
| 997 | } |
990 | 998 | } |
991 | 999 | } |
992 | 1000 | |
r241444 | r241445 | |
1332 | 1340 | break; |
1333 | 1341 | |
1334 | 1342 | case COMMAND_GCHRD: /* graphics character draw and area filling start */ |
1335 | | if(m_figs.m_figure_type == 2) |
| 1343 | if((m_figs.m_figure_type & 0xf) == 2) |
1336 | 1344 | draw_char(((m_ead % eff_pitch) << 4) | (m_dad & 0xf),(m_ead / eff_pitch)); |
1337 | 1345 | else |
1338 | 1346 | logerror("uPD7220 '%s' Unimplemented command GCHRD %02x\n", tag(),m_figs.m_figure_type); |
r241444 | r241445 | |
1350 | 1358 | break; |
1351 | 1359 | |
1352 | 1360 | case COMMAND_CURD: /* cursor address read */ |
| 1361 | { |
| 1362 | UINT16 dad = 1 << m_dad; |
1353 | 1363 | fifo_set_direction(FIFO_READ); |
1354 | 1364 | |
1355 | 1365 | queue(m_ead & 0xff, 0); |
1356 | 1366 | queue((m_ead >> 8) & 0xff, 0); |
1357 | 1367 | queue(m_ead >> 16, 0); |
1358 | | queue(m_dad & 0xff, 0); |
1359 | | queue(m_dad >> 8, 0); |
| 1368 | queue(dad & 0xff, 0); |
| 1369 | queue(dad >> 8, 0); |
1360 | 1370 | |
1361 | 1371 | m_sr |= UPD7220_SR_DATA_READY; |
1362 | 1372 | break; |
| 1373 | } |
1363 | 1374 | |
1364 | 1375 | case COMMAND_LPRD: /* light pen address read */ |
1365 | 1376 | fifo_set_direction(FIFO_READ); |
r241444 | r241445 | |
1530 | 1541 | addr = sad + (y * m_pitch); |
1531 | 1542 | |
1532 | 1543 | if (!m_draw_text_cb.isnull()) |
1533 | | m_draw_text_cb(bitmap, addr, y, wd, m_pitch, m_lr, m_dc, m_ead); |
| 1544 | m_draw_text_cb(bitmap, addr, (y * m_lr), wd, m_pitch, m_lr, m_dc, m_ead); |
1534 | 1545 | } |
1535 | 1546 | |
1536 | 1547 | sy = y + 1; |
r241444 | r241445 | |
1601 | 1612 | addr = (sad & 0x3ffff) + ((y / m_lr) * m_pitch); |
1602 | 1613 | |
1603 | 1614 | if (!m_draw_text_cb.isnull()) |
1604 | | m_draw_text_cb(bitmap, addr, (y + tsy) / m_lr, wd, m_pitch, m_lr, m_dc, m_ead); |
| 1615 | m_draw_text_cb(bitmap, addr, y + tsy, wd, m_pitch, m_lr, m_dc, m_ead); |
1605 | 1616 | } |
1606 | 1617 | } |
1607 | 1618 | } |