trunk/src/mame/drivers/iteagle.cpp
| r253057 | r253058 | |
| 179 | 179 | |
| 180 | 180 | static MACHINE_CONFIG_DERIVED( gtfore01, iteagle ) |
| 181 | 181 | MCFG_DEVICE_MODIFY(PCI_ID_FPGA) |
| 182 | | MCFG_ITEAGLE_FPGA_INIT(0x01000401, 0x0b0b0b) |
| 182 | MCFG_ITEAGLE_FPGA_INIT(0x00000401, 0x0b0b0b) |
| 183 | 183 | MCFG_DEVICE_MODIFY(PCI_ID_EEPROM) |
| 184 | 184 | MCFG_ITEAGLE_EEPROM_INIT(0x0401, 0x7) |
| 185 | 185 | MACHINE_CONFIG_END |
| r253057 | r253058 | |
| 187 | 187 | static MACHINE_CONFIG_DERIVED( gtfore02, iteagle ) |
| 188 | 188 | MCFG_DEVICE_MODIFY(PCI_ID_FPGA) |
| 189 | 189 | MCFG_ITEAGLE_FPGA_INIT(0x01000402, 0x020201) |
| 190 | | MCFG_DEVICE_MODIFY(":pci:0a.0") |
| 190 | MCFG_DEVICE_MODIFY(PCI_ID_EEPROM) |
| 191 | 191 | MCFG_ITEAGLE_EEPROM_INIT(0x0402, 0x7) |
| 192 | 192 | MACHINE_CONFIG_END |
| 193 | 193 | |
| r253057 | r253058 | |
| 215 | 215 | static MACHINE_CONFIG_DERIVED( gtfore06, iteagle ) |
| 216 | 216 | MCFG_DEVICE_MODIFY(PCI_ID_FPGA) |
| 217 | 217 | MCFG_ITEAGLE_FPGA_INIT(0x01000406, 0x0c0b0d) |
| 218 | | MCFG_DEVICE_MODIFY(":pci:0a.0") |
| 218 | MCFG_DEVICE_MODIFY(PCI_ID_EEPROM) |
| 219 | 219 | MCFG_ITEAGLE_EEPROM_INIT(0x0406, 0x9); |
| 220 | 220 | MACHINE_CONFIG_END |
| 221 | 221 | |
| 222 | 222 | static MACHINE_CONFIG_DERIVED( carnking, iteagle ) |
| 223 | 223 | MCFG_DEVICE_MODIFY(PCI_ID_FPGA) |
| 224 | | MCFG_ITEAGLE_FPGA_INIT(0x01000603, 0x0c0b0d) |
| 224 | MCFG_ITEAGLE_FPGA_INIT(0x01000a01, 0x0e0a0a) |
| 225 | 225 | MCFG_DEVICE_MODIFY(PCI_ID_EEPROM) |
| 226 | | MCFG_ITEAGLE_EEPROM_INIT(0x0603, 0x9) |
| 226 | MCFG_ITEAGLE_EEPROM_INIT(0x0a01, 0x9) |
| 227 | 227 | MACHINE_CONFIG_END |
| 228 | 228 | |
| 229 | 229 | static MACHINE_CONFIG_DERIVED( bbhsc, iteagle ) |
| 230 | 230 | MCFG_DEVICE_MODIFY(PCI_ID_FPGA) |
| 231 | | MCFG_ITEAGLE_FPGA_INIT(0x01000600, 0x0c0a0a) |
| 231 | MCFG_ITEAGLE_FPGA_INIT(0x02000600, 0x0c0a0a) |
| 232 | 232 | MCFG_DEVICE_MODIFY(PCI_ID_EEPROM) |
| 233 | | MCFG_ITEAGLE_EEPROM_INIT(0x0600, 0x9) |
| 233 | MCFG_ITEAGLE_EEPROM_INIT(0x0000, 0x7) |
| 234 | 234 | MACHINE_CONFIG_END |
| 235 | 235 | |
| 236 | 236 | static MACHINE_CONFIG_DERIVED( bbhcotw, iteagle ) |
| 237 | 237 | MCFG_DEVICE_MODIFY(PCI_ID_FPGA) |
| 238 | 238 | MCFG_ITEAGLE_FPGA_INIT(0x02000603, 0x080704) |
| 239 | | MCFG_DEVICE_MODIFY(":pci:0a.0") |
| 239 | MCFG_DEVICE_MODIFY(PCI_ID_EEPROM) |
| 240 | 240 | MCFG_ITEAGLE_EEPROM_INIT(0x0603, 0x9) |
| 241 | 241 | MACHINE_CONFIG_END |
| 242 | 242 | |
| r253057 | r253058 | |
| 331 | 331 | |
| 332 | 332 | INPUT_PORTS_END |
| 333 | 333 | |
| 334 | | static INPUT_PORTS_START( bbhcotw ) |
| 334 | static INPUT_PORTS_START( bbh ) |
| 335 | 335 | PORT_INCLUDE( iteagle ) |
| 336 | 336 | |
| 337 | 337 | PORT_MODIFY("IN1") |
| r253057 | r253058 | |
| 557 | 557 | |
| 558 | 558 | GAME( 2000, iteagle, 0, iteagle, iteagle, driver_device, 0, ROT0, "Incredible Technologies", "Eagle BIOS", MACHINE_IS_BIOS_ROOT ) |
| 559 | 559 | GAME( 1998, virtpool, iteagle, virtpool, virtpool, driver_device, 0, ROT0, "Incredible Technologies", "Virtual Pool", MACHINE_NOT_WORKING ) // random lockups on loading screens |
| 560 | | GAME( 2002, carnking, iteagle, carnking, iteagle, driver_device, 0, ROT0, "Incredible Technologies", "Carnival King (v1.00.11)", MACHINE_NOT_WORKING ) |
| 560 | GAME( 2002, carnking, iteagle, carnking, bbh, driver_device, 0, ROT0, "Incredible Technologies", "Carnival King (v1.00.11)", 0 ) |
| 561 | 561 | GAME( 2000, gtfore01, iteagle, gtfore01, iteagle, driver_device, 0, ROT0, "Incredible Technologies", "Golden Tee Fore! (v1.00.25)", 0 ) |
| 562 | 562 | GAME( 2001, gtfore02, iteagle, gtfore02, iteagle, driver_device, 0, ROT0, "Incredible Technologies", "Golden Tee Fore! 2002 (v2.01.06)", 0 ) |
| 563 | 563 | GAME( 2002, gtfore03, iteagle, gtfore03, iteagle, driver_device, 0, ROT0, "Incredible Technologies", "Golden Tee Fore! 2003 (v3.00.10)", 0 ) |
| r253057 | r253058 | |
| 569 | 569 | GAME( 2004, gtfore05b, gtfore05, gtfore05, iteagle, driver_device, 0, ROT0, "Incredible Technologies", "Golden Tee Fore! 2005 Extra (v5.01.00)", 0 ) |
| 570 | 570 | GAME( 2004, gtfore05c, gtfore05, gtfore05, iteagle, driver_device, 0, ROT0, "Incredible Technologies", "Golden Tee Fore! 2005 Extra (v5.00.00)", 0 ) |
| 571 | 571 | GAME( 2005, gtfore06, iteagle, gtfore06, iteagle, driver_device, 0, ROT0, "Incredible Technologies", "Golden Tee Fore! 2006 Complete (v6.00.01)", 0 ) |
| 572 | | GAME( 2002, bbhsc, iteagle, bbhsc, iteagle, driver_device, 0, ROT0, "Incredible Technologies", "Big Buck Hunter - Shooter's Challenge (v1.50.07)", MACHINE_NOT_WORKING ) // doesn't boot |
| 573 | | GAME( 2006, bbhcotw, iteagle, bbhcotw, bbhcotw, driver_device, 0, ROT0, "Incredible Technologies", "Big Buck Hunter Call of the Wild (v3.02.5)", MACHINE_NOT_WORKING ) // random lockups |
| 572 | GAME( 2002, bbhsc, iteagle, bbhsc, bbh, driver_device, 0, ROT0, "Incredible Technologies", "Big Buck Hunter - Shooter's Challenge (v1.50.07)", MACHINE_NOT_WORKING ) // doesn't boot |
| 573 | GAME( 2006, bbhcotw, iteagle, bbhcotw, bbh, driver_device, 0, ROT0, "Incredible Technologies", "Big Buck Hunter Call of the Wild (v3.02.5)", MACHINE_NOT_WORKING ) // random lockups |
trunk/src/mame/machine/iteagle_fpga.cpp
| r253057 | r253058 | |
| 4 | 4 | #include "coreutil.h" |
| 5 | 5 | |
| 6 | 6 | #define LOG_FPGA (0) |
| 7 | #define LOG_SERIAL (0) |
| 7 | 8 | #define LOG_RTC (0) |
| 8 | 9 | #define LOG_RAM (0) |
| 9 | 10 | #define LOG_EEPROM (0) |
| r253057 | r253058 | |
| 80 | 81 | m_serial_str.clear(); |
| 81 | 82 | m_serial_idx = 0; |
| 82 | 83 | m_serial_data = false; |
| 84 | memset(m_serial_com0, 0, sizeof(m_serial_com0)); |
| 83 | 85 | memset(m_serial_com1, 0, sizeof(m_serial_com1)); |
| 84 | 86 | memset(m_serial_com2, 0, sizeof(m_serial_com2)); |
| 85 | 87 | memset(m_serial_com3, 0, sizeof(m_serial_com3)); |
| 86 | | memset(m_serial_com4, 0, sizeof(m_serial_com4)); |
| 88 | m_serial_com0[0] = 0x2c; |
| 87 | 89 | m_serial_com1[0] = 0x2c; |
| 88 | 90 | m_serial_com2[0] = 0x2c; |
| 89 | 91 | m_serial_com3[0] = 0x2c; |
| 90 | | m_serial_com4[0] = 0x2c; |
| 91 | 92 | } |
| 92 | 93 | |
| 93 | 94 | void iteagle_fpga_device::update_sequence(UINT32 data) |
| r253057 | r253058 | |
| 130 | 131 | val1 = ((m_seq & 0x2)<<6) | ((m_seq & 0x4)<<4) | ((m_seq & 0x8)<<2) | ((m_seq & 0x10)<<0) |
| 131 | 132 | | ((m_seq & 0x20)>>2) | ((m_seq & 0x40)>>4) | ((m_seq & 0x80)>>6) | ((m_seq & 0x100)>>8); |
| 132 | 133 | m_seq = (m_seq>>8) | ((feed&0xff)<<16); |
| 133 | | //m_fpga_regs[offset] = (m_fpga_regs[offset]&0xFFFFFF00) | ((val1 + m_seq_rem1)&0xFF); |
| 134 | 134 | m_fpga_regs[offset] = (m_fpga_regs[offset]&0xFFFFFF00) | ((val1 + m_seq_rem1 + m_seq_rem2)&0xFF); |
| 135 | 135 | } else if (data & 0x2) { |
| 136 | 136 | val1 = ((m_seq & 0x2)<<1) | ((m_seq & 0x4)>>1) | ((m_seq & 0x8)>>3); |
| 137 | 137 | m_seq_rem1 = ((m_seq & 0x10)) | ((m_seq & 0x20)>>2) | ((m_seq & 0x40)>>4); |
| 138 | | //m_seq_rem2 = ((m_seq & 0x80)>>1) | ((m_seq & 0x100)>>3) | ((m_seq & 0x200)>>5); |
| 139 | 138 | m_seq = (m_seq>>6) | ((feed&0x3f)<<18); |
| 140 | 139 | m_fpga_regs[offset] = (m_fpga_regs[offset]&0xFFFFFF00) | ((val1 + m_seq_rem1 + m_seq_rem2)&0xFF); |
| 141 | 140 | } else { |
| r253057 | r253058 | |
| 197 | 196 | logerror("%s:fpga_r offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); |
| 198 | 197 | break; |
| 199 | 198 | case 0x0c/4: // 1d = modem byte |
| 200 | | result = (result & 0xFFFF0000) | ((m_serial_com2[m_serial_idx]&0xff)<<8) | (m_serial_com1[m_serial_idx]&0xff); |
| 199 | result = (result & 0xFFFF0000) | ((m_serial_com1[m_serial_idx]&0xff)<<8) | (m_serial_com0[m_serial_idx]&0xff); |
| 201 | 200 | if (ACCESSING_BITS_0_15) { |
| 202 | 201 | m_serial_data = false; |
| 203 | 202 | m_serial_idx = 0; |
| 204 | 203 | } |
| 205 | | if (LOG_FPGA) |
| 204 | if (0 && LOG_FPGA) |
| 206 | 205 | logerror("%s:fpga_r offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); |
| 207 | 206 | break; |
| 208 | 207 | case 0x1c/4: // 1d = modem byte |
| 209 | | result = (result & 0xFFFF0000) | ((m_serial_com4[m_serial_idx]&0xff)<<8) | (m_serial_com3[m_serial_idx]&0xff); |
| 208 | result = (result & 0xFFFF0000) | ((m_serial_com3[m_serial_idx]&0xff)<<8) | (m_serial_com2[m_serial_idx]&0xff); |
| 210 | 209 | if (ACCESSING_BITS_0_15) { |
| 211 | 210 | m_serial_data = false; |
| 212 | 211 | m_serial_idx = 0; |
| r253057 | r253058 | |
| 233 | 232 | if ((m_version & 0xff00) == 0x0200) |
| 234 | 233 | update_sequence_eg1(data & 0xff); |
| 235 | 234 | else |
| 236 | | // ATMEL Chip access. Returns version id's when bit 7 is set. |
| 237 | | update_sequence(data & 0xff); |
| 235 | // ATMEL Chip access. Returns version id's when bit 7 is set. |
| 236 | update_sequence(data & 0xff); |
| 238 | 237 | if (0 && LOG_FPGA) |
| 239 | 238 | logerror("%s:fpga_w offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); |
| 240 | 239 | } |
| r253057 | r253058 | |
| 242 | 241 | if (ACCESSING_BITS_24_31 && (data & 0x01000000)) { |
| 243 | 242 | m_cpu->set_input_line(m_irq_num, CLEAR_LINE); |
| 244 | 243 | // Not sure what value to use here, needed for lightgun |
| 245 | | m_timer->adjust(attotime::from_hz(25)); |
| 244 | m_timer->adjust(attotime::from_hz(59)); |
| 246 | 245 | if (LOG_FPGA) |
| 247 | 246 | logerror("%s:fpga_w offset %04X = %08X & %08X Clearing interrupt(%i)\n", machine().describe_context(), offset*4, data, mem_mask, m_irq_num); |
| 248 | 247 | } else { |
| r253057 | r253058 | |
| 269 | 268 | if (!m_serial_data) { |
| 270 | 269 | m_serial_idx = data&0xf; |
| 271 | 270 | } else { |
| 272 | | m_serial_com1[m_serial_idx] = data&0xff; |
| 271 | m_serial_com0[m_serial_idx] = data&0xff; |
| 273 | 272 | m_serial_idx = 0; |
| 274 | 273 | } |
| 275 | 274 | m_serial_data = !m_serial_data; |
| r253057 | r253058 | |
| 278 | 277 | if (!m_serial_data) { |
| 279 | 278 | m_serial_idx = (data&0x0f00)>>8; |
| 280 | 279 | } else { |
| 281 | | m_serial_com2[m_serial_idx] = (data&0xff00)>>8; |
| 280 | m_serial_com1[m_serial_idx] = (data&0xff00)>>8; |
| 282 | 281 | } |
| 283 | 282 | m_serial_data = !m_serial_data; |
| 284 | 283 | } |
| 285 | 284 | if (ACCESSING_BITS_16_23) { |
| 286 | 285 | if (m_serial_str.size()==0) |
| 287 | | m_serial_str = "com1: "; |
| 286 | m_serial_str = "com0: "; |
| 288 | 287 | m_serial_str += (data>>16)&0xff; |
| 289 | 288 | if (((data>>16)&0xff)==0xd) { |
| 289 | if (LOG_SERIAL) logerror("%s\n", m_serial_str.c_str()); |
| 290 | 290 | osd_printf_debug("%s\n", m_serial_str.c_str()); |
| 291 | 291 | m_serial_str.clear(); |
| 292 | 292 | } |
| 293 | 293 | } |
| 294 | 294 | if (ACCESSING_BITS_24_31) { |
| 295 | 295 | if (m_serial_str.size()==0) |
| 296 | | m_serial_str = "com2: "; |
| 296 | m_serial_str = "com1: "; |
| 297 | 297 | m_serial_str += (data>>24)&0xff; |
| 298 | 298 | if (1 || ((data>>24)&0xff)==0xd) { |
| 299 | if (LOG_SERIAL) logerror("%s\n", m_serial_str.c_str()); |
| 299 | 300 | osd_printf_debug("%s\n", m_serial_str.c_str()); |
| 300 | 301 | m_serial_str.clear(); |
| 301 | 302 | } |
| 302 | 303 | } |
| 303 | | if (LOG_FPGA) |
| 304 | if (0 && LOG_FPGA) |
| 304 | 305 | logerror("%s:fpga_w offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); |
| 305 | 306 | break; |
| 306 | 307 | case 0x1c/4: |
| r253057 | r253058 | |
| 308 | 309 | if (!m_serial_data) { |
| 309 | 310 | m_serial_idx = data&0xf; |
| 310 | 311 | } else { |
| 311 | | m_serial_com3[m_serial_idx] = data&0xff; |
| 312 | m_serial_com2[m_serial_idx] = data&0xff; |
| 312 | 313 | m_serial_idx = 0; |
| 313 | 314 | } |
| 314 | 315 | m_serial_data = !m_serial_data; |
| r253057 | r253058 | |
| 317 | 318 | if (!m_serial_data) { |
| 318 | 319 | m_serial_idx = (data&0x0f00)>>8; |
| 319 | 320 | } else { |
| 320 | | m_serial_com4[m_serial_idx] = (data&0xff00)>>8; |
| 321 | m_serial_com3[m_serial_idx] = (data&0xff00)>>8; |
| 321 | 322 | } |
| 322 | 323 | m_serial_data = !m_serial_data; |
| 323 | 324 | } |
| 324 | 325 | if (ACCESSING_BITS_16_23) { |
| 325 | 326 | if (m_serial_str.size()==0) |
| 326 | | m_serial_str = "com3: "; |
| 327 | m_serial_str = "com2: "; |
| 327 | 328 | m_serial_str += (data>>16)&0xff; |
| 328 | 329 | if (1 || ((data>>16)&0xff)==0xd) { |
| 330 | if (LOG_SERIAL) logerror("%s\n", m_serial_str.c_str()); |
| 329 | 331 | osd_printf_debug("%s\n", m_serial_str.c_str()); |
| 330 | 332 | m_serial_str.clear(); |
| 331 | 333 | } |
| 332 | 334 | } |
| 333 | 335 | if (ACCESSING_BITS_24_31) { |
| 334 | 336 | if (m_serial_str.size()==0) |
| 335 | | m_serial_str = "com4: "; |
| 337 | m_serial_str = "com3: "; |
| 336 | 338 | m_serial_str += (data>>24)&0xff; |
| 337 | 339 | if (((data>>24)&0xff)==0xd) { |
| 340 | if (LOG_SERIAL) logerror("%s\n", m_serial_str.c_str()); |
| 338 | 341 | osd_printf_debug("%s\n", m_serial_str.c_str()); |
| 339 | 342 | m_serial_str.clear(); |
| 340 | 343 | } |
| r253057 | r253058 | |
| 649 | 652 | { |
| 650 | 653 | pci_device::device_reset(); |
| 651 | 654 | memset(m_ctrl_regs, 0, sizeof(m_ctrl_regs)); |
| 652 | | m_ctrl_regs[0x10/4] = 0x00000000; // 0x6=No SIMM, 0x2, 0x1, 0x0 = SIMM . Top 16 bits are compared to 0x3. |
| 655 | m_ctrl_regs[0x10/4] = 0x00070000; // 0x6=No SIMM, 0x2, 0x1, 0x0 = SIMM . Top 16 bits are compared to 0x3. Bit 0 might be lan chip present. |
| 653 | 656 | memset(m_rtc_regs, 0, sizeof(m_rtc_regs)); |
| 654 | 657 | m_rtc_regs[0xa] = 0x20; // 32.768 MHz |
| 655 | 658 | m_rtc_regs[0xb] = 0x02; // 24-hour format |