trunk/src/emu/cpu/v810/v810.c
r17431 | r17432 | |
3 | 3 | Tomasz Slanina - analog[at]op.pl |
4 | 4 | |
5 | 5 | Change Log |
| 6 | - 23/08/2012 - Implemented remaining BSU opcodes (Angelo Salese) |
6 | 7 | - 21/08/2012 - Fixed SET.F behaviour (Angelo Salese) |
7 | 8 | - 20/08/2012 - Fixed a sign bug with CVT.WS opcode (Angelo Salese) |
8 | 9 | - 16/08/2012 - Added XB, XH, MPYHW, MOVBSU, ORBSU and ANDNBSU opcodes |
r17431 | r17432 | |
17 | 18 | - CY flag in few floating point opcodes |
18 | 19 | (all floating point opcodes are NOT tested!) |
19 | 20 | - traps/interrupts/exceptions |
20 | | - bitstring opcodes |
| 21 | - bitstring opcodes currently makes the emulation to drop to 0% |
21 | 22 | - timing |
22 | 23 | - missing opcodes : trap, caxi |
23 | 24 | |
r17431 | r17432 | |
1091 | 1092 | |
1092 | 1093 | W_W(cpustate,dst,tmp); |
1093 | 1094 | break; |
| 1095 | case 0x9: // ANDBSU |
| 1096 | srctmp = ((R_W(cpustate,src) >> srcbit) & 1) ^ 1; |
| 1097 | dsttmp = R_W(cpustate,dst); |
| 1098 | |
| 1099 | tmp = dsttmp & (~(srctmp << dstbit)); |
| 1100 | |
| 1101 | W_W(cpustate,dst,tmp); |
| 1102 | break; |
| 1103 | case 0xa: // XORBSU |
| 1104 | srctmp = (R_W(cpustate,src) >> srcbit) & 1; |
| 1105 | dsttmp = R_W(cpustate,dst); |
| 1106 | |
| 1107 | tmp = dsttmp ^ (srctmp << dstbit); |
| 1108 | |
| 1109 | W_W(cpustate,dst,tmp); |
| 1110 | break; |
1094 | 1111 | case 0xb: // MOVBSU |
1095 | 1112 | srctmp = (R_W(cpustate,src) >> srcbit) & 1; |
1096 | 1113 | dsttmp = (R_W(cpustate,dst) & ~(1 << dstbit)); |
r17431 | r17432 | |
1099 | 1116 | |
1100 | 1117 | W_W(cpustate,dst,tmp); |
1101 | 1118 | break; |
| 1119 | case 0xc: // ORNBSU |
| 1120 | srctmp = ((R_W(cpustate,src) >> srcbit) & 1) ^ 1; |
| 1121 | dsttmp = R_W(cpustate,dst); |
| 1122 | |
| 1123 | tmp = dsttmp | (srctmp << dstbit); |
| 1124 | |
| 1125 | W_W(cpustate,dst,tmp); |
| 1126 | break; |
1102 | 1127 | case 0xd: // ANDNBSU |
1103 | 1128 | srctmp = (R_W(cpustate,src) >> srcbit) & 1; |
1104 | 1129 | dsttmp = R_W(cpustate,dst); |
r17431 | r17432 | |
1107 | 1132 | |
1108 | 1133 | W_W(cpustate,dst,tmp); |
1109 | 1134 | break; |
| 1135 | case 0xe: // XORNBSU |
| 1136 | srctmp = ((R_W(cpustate,src) >> srcbit) & 1) ^ 1; |
| 1137 | dsttmp = R_W(cpustate,dst); |
| 1138 | |
| 1139 | tmp = dsttmp ^ (srctmp << dstbit); |
| 1140 | |
| 1141 | W_W(cpustate,dst,tmp); |
| 1142 | break; |
| 1143 | case 0xf: // NOTBSU |
| 1144 | srctmp = ((R_W(cpustate,src) >> srcbit) & 1) ^ 1; |
| 1145 | dsttmp = (R_W(cpustate,dst) & ~(1 << dstbit)); |
| 1146 | |
| 1147 | tmp = (srctmp << dstbit) | dsttmp; |
| 1148 | |
| 1149 | W_W(cpustate,dst,tmp); |
| 1150 | break; |
1110 | 1151 | default: fatalerror("V810: unemulated BSU opcode %04x\n",op); |
1111 | 1152 | } |
1112 | 1153 | |
r17431 | r17432 | |
1261 | 1302 | |
1262 | 1303 | if (cpustate->irq_state != CLEAR_LINE) { |
1263 | 1304 | if (!(GET_NP | GET_EP | GET_ID)) { |
1264 | | if (cpustate->irq_line >=((cpustate->PSW & 0xF0000) >> 16)) { |
| 1305 | if (cpustate->irq_line >((cpustate->PSW & 0xF0000) >> 16)) { |
1265 | 1306 | take_interrupt(cpustate); |
1266 | 1307 | } |
1267 | 1308 | } |
trunk/src/mess/drivers/vboy.c
r17431 | r17432 | |
11 | 11 | - 100us / 20us timers |
12 | 12 | - sound |
13 | 13 | - per-game NVRAM hook-up (wariolnd, vleague, golf, others?) |
14 | | - 3dtetris: missing gameplay (writes to framebuffer?) |
| 14 | - 3dtetris: missing gfxs on gameplay (writes to framebuffer) |
15 | 15 | - boundh: game is way too fast |
16 | 16 | - galactic: ball goes out of bounds sometimes? |
17 | | - golf: black screen on attract mode/gameplay |
| 17 | - golf: missing gfxs on gameplay (writes to framebuffer) |
18 | 18 | - marioten: title screen logo is misplaced if Mario completes his animation |
19 | | - nesterfb: ball stops when thrown |
| 19 | - nesterfb: once that you hit the pins, animation phase takes a while to start |
20 | 20 | - redalarm: gameplay doesn't work |
21 | 21 | - spaceinv: Taito logo only if you press the button, framebuffer? |
22 | 22 | - spaceinv: missing shots |
23 | | - vlab: doesn't boot (irq issue?) |
24 | | - wariolnd: brightness gets suddently darker during intro, CPU bug? |
25 | | - waterwld: doesn't accept start input at title screen; |
| 23 | - telerobo: crashes if you die |
| 24 | - telerobo: hangs after winning first match; |
| 25 | - telerobo: when you beat your opponent, the winning animation has a gfx bug |
| 26 | (HBias negative numbers?) |
| 27 | - vlab: doesn't boot (irq issue?) |
| 28 | - wariolnd: brightness gets suddently darker during intro. |
| 29 | - waterwld: doesn't accept start input at title screen (regression, it used to work); |
26 | 30 | |
27 | 31 | ****************************************************************************/ |
28 | 32 | |
r17431 | r17432 | |
118 | 122 | int *m_ovr_map; |
119 | 123 | UINT16 m_frame_count; |
120 | 124 | UINT8 m_displayfb; |
121 | | UINT8 m_display_count; |
| 125 | UINT8 m_drawfb; |
122 | 126 | UINT8 m_row_num; |
123 | 127 | attotime m_input_latch_time; |
124 | 128 | |
r17431 | r17432 | |
474 | 478 | bitmap.fill(state->m_vip_regs.BKCOL, cliprect); |
475 | 479 | int cur_spt; |
476 | 480 | |
| 481 | if(!(state->m_vip_regs.DPCTRL & 2)) /* Don't bother if screen is off */ |
| 482 | return 0; |
| 483 | |
477 | 484 | cur_spt = 3; |
478 | 485 | for(int i=31; i>=0; i--) |
479 | 486 | if (state->display_world(i, bitmap, false, cur_spt)) break; |
r17431 | r17432 | |
487 | 494 | bitmap.fill(state->m_vip_regs.BKCOL, cliprect); |
488 | 495 | int cur_spt; |
489 | 496 | |
| 497 | if(!(state->m_vip_regs.DPCTRL & 2)) /* Don't bother if screen is off */ |
| 498 | return 0; |
| 499 | |
490 | 500 | cur_spt = 3; |
491 | 501 | for(int i=31; i>=0; i--) |
492 | 502 | if (state->display_world(i, bitmap, true, cur_spt)) break; |
r17431 | r17432 | |
660 | 670 | ---- ---- x--- ---- FCLK |
661 | 671 | ---- ---- -x-- ---- SCANRDY (active low) |
662 | 672 | ---- ---- --xx xx-- DPBSY (current framebuffer displayed) |
| 673 | ---- ---- --10 00-- RFB1 |
| 674 | ---- ---- --01 00-- LFB1 |
| 675 | ---- ---- --00 10-- RFB0 |
| 676 | ---- ---- --00 01-- LFB0 |
663 | 677 | ---- ---- ---- --x- DISP |
664 | 678 | */ |
665 | 679 | case 0x20: //DPSTTS |
r17431 | r17432 | |
670 | 684 | |
671 | 685 | if(m_vip_regs.DPCTRL & 2) |
672 | 686 | { |
673 | | UINT8 DPBSY = machine().rand() & 3; |
674 | | |
675 | | if(DPBSY & 2) |
676 | | res |= 0x20; |
677 | | else if(DPBSY & 1) |
678 | | res |= 0x08; |
| 687 | if(m_row_num < 224/8) |
| 688 | { |
| 689 | if(m_displayfb == 0) |
| 690 | res |= 0x0c; |
| 691 | else |
| 692 | res |= 0x30; |
| 693 | } |
679 | 694 | } |
680 | 695 | |
681 | 696 | res |= 0x40; |
r17431 | r17432 | |
708 | 723 | ---- ---- ---- --x- XPEN (starts drawing at beginning of game frame) |
709 | 724 | ---- ---- ---- ---x XPRST (force drawing process to idle) |
710 | 725 | */ |
711 | | UINT8 drawfb = ((m_displayfb ^ 1) + 1) << 2; |
712 | 726 | UINT16 res; |
713 | 727 | |
714 | 728 | //printf("%d\n",row_num); |
715 | 729 | |
716 | 730 | res = m_vip_regs.XPSTTS & 0x00f3; // empty ^^' |
717 | | if(m_vip_regs.XPCTRL & 2 && m_row_num < 224/8) // screen active |
718 | | res |= drawfb; |
| 731 | if(m_vip_regs.XPCTRL & 2 && m_row_num > 224/8) // screen active |
| 732 | res |= m_drawfb << 2; |
719 | 733 | |
720 | 734 | if(m_row_num < 224/8) |
721 | 735 | { |
r17431 | r17432 | |
1086 | 1100 | state->m_vboy_regs.wcr = 0xfc; |
1087 | 1101 | state->m_vboy_regs.kcr = 0x4c; |
1088 | 1102 | state->m_vip_regs.DPCTRL = 2; // ssquash relies on this at boot otherwise no frame_start irq is fired |
| 1103 | state->m_displayfb = 0; |
| 1104 | state->m_drawfb = 0; |
1089 | 1105 | } |
1090 | 1106 | |
1091 | 1107 | |
r17431 | r17432 | |
1158 | 1174 | |
1159 | 1175 | m_frame_count++; |
1160 | 1176 | |
1161 | | m_display_count ++; |
1162 | | m_display_count &= 3; |
1163 | | |
1164 | 1177 | if(m_frame_count > m_vip_regs.FRMCYC) |
1165 | 1178 | { |
1166 | 1179 | m_set_irq(0x0008); // GAME_START |
1167 | 1180 | m_frame_count = 0; |
1168 | 1181 | } |
1169 | 1182 | |
1170 | | if(m_vip_regs.XPCTRL & 2) |
| 1183 | if(m_vip_regs.DPCTRL & 2) |
1171 | 1184 | m_displayfb ^= 1; |
1172 | 1185 | } |
1173 | 1186 | |
1174 | 1187 | if(scanline == 224) |
| 1188 | { |
| 1189 | m_drawfb = 3; |
1175 | 1190 | m_set_irq(0x4000); // XPEND |
| 1191 | } |
1176 | 1192 | |
1177 | 1193 | if(scanline == 232) |
| 1194 | { |
| 1195 | m_drawfb &= ~1; |
1178 | 1196 | m_set_irq(0x0002); // LFBEND |
| 1197 | } |
1179 | 1198 | |
1180 | 1199 | if(scanline == 240) |
| 1200 | { |
| 1201 | m_drawfb &= ~2; |
1181 | 1202 | m_set_irq(0x0004); // RFBEND |
| 1203 | } |
1182 | 1204 | |
1183 | 1205 | if(scanline == 248) |
1184 | 1206 | { |