src/mame/drivers/megadriv.c
| r9336 | r9337 | |
| 38 | 38 | - this seems to require far greater sync and timing accuracy on rom / ram access than MAME can provide |
| 39 | 39 | - split NTSC / PAL drivers |
| 40 | 40 | - 36greatju: missing backup ram, has issues with golfer select due of that |
| 41 | | - afterbju: black screen, has a bug with Master SH-2 code snippet at 060037f8 (R0 should be 0x3ff but it's instead 0x3fff****) |
| 42 | 41 | - bcracers: write to undefined PWM register? |
| 43 | | - cosmiccp: black screen, Master SH-2 stalls on a RTS? (unchecked) |
| 44 | | - eccodemo: black screen after the Sega logo, faulty comms check |
| 45 | 42 | - fifa96 / nbajamte: dies on the gameplay, waiting for a comm change that never occurs; |
| 46 | 43 | - marsch1: doesn't boot, Master / Slave communicates through SCI |
| 47 | 44 | - nbajamte: missing I2C hookup, startup fails due of that (same I2C type as plain MD version); |
| 48 | 45 | - nflquart: black screen, missing h irq? |
| 49 | 46 | - sangoku4: black screen after the Sega logo |
| 50 | | - sharrierju: black screen; |
| 51 | | - soulstar: hangs almost soon, it just plays the BGM and shows a galaxy background; |
| 47 | - soulstar: OSD and player sprite isn't drawn; |
| 52 | 48 | - tempo: intro is too fast, mostly noticeable with the PWM sound that cuts off too early when it gets to the title screen; |
| 53 | 49 | - tmek: gameplay is clearly too fast |
| 54 | | - vfju: dies when a match starts or when attempts to enter into attract mode, master SH-2 jumps to a misaligned vector; |
| 55 | | - vham: Master SH-2 crashes when entering into gameplay |
| 56 | | - vrdxu: no 3d gfxs |
| 57 | | - wwfraw: writes fb data to the cart area and expects it to be read back, kludging the cart area to be writeable makes the 32x gfxs to appear |
| 50 | - vrdxu: has 3d geometry bugs, caused by a SH-2 DRC bug; |
| 51 | - vrdxu: crashes if you attempt to enter into main menu; |
| 52 | - wwfraw: writes fb data to the cart area and expects it to be read back, kludging the cart area to be writeable makes the 32x gfxs to appear, why? |
| 58 | 53 | - wwfwre: no 32x gfxs |
| 59 | | - xmen: black screen after that you choose the level |
| 54 | - xmen: black screen after that you choose the level, needs bare minimum SH-2 SCI support |
| 60 | 55 | |
| 61 | 56 | Add PicoDrive support (not arcade) |
| 62 | 57 | |
| r9336 | r9337 | |
| 3259 | 3254 | { |
| 3260 | 3255 | |
| 3261 | 3256 | case 0x00: |
| 3262 | | printf("_32x_68k_a15180_w (a15180) %04x %04x source _32x_access_auth %04x\n",data,mem_mask, _32x_access_auth); |
| 3257 | //printf("_32x_68k_a15180_w (a15180) %04x %04x source _32x_access_auth %04x\n",data,mem_mask, _32x_access_auth); |
| 3263 | 3258 | |
| 3264 | 3259 | if (ACCESSING_BITS_0_7) |
| 3265 | 3260 | { |
| r9336 | r9337 | |
| 3332 | 3327 | if (ACCESSING_BITS_0_7) |
| 3333 | 3328 | { |
| 3334 | 3329 | _32x_fb_swap = data & 1; |
| 3335 | | |
| 3330 | |
| 3336 | 3331 | _32x_check_framebuffer_swap(); |
| 3337 | 3332 | } |
| 3338 | | |
| 3333 | |
| 3339 | 3334 | break; |
| 3340 | 3335 | |
| 3341 | 3336 | |
| r9336 | r9337 | |
| 3990 | 3985 | segacd_comms_flags = (segacd_comms_flags & 0xff00) | (data & 0x00ff); |
| 3991 | 3986 | timer_call_after_resynch(space->machine, NULL, 0, NULL); |
| 3992 | 3987 | } |
| 3993 | | |
| 3988 | |
| 3994 | 3989 | if (ACCESSING_BITS_8_15) |
| 3995 | 3990 | { |
| 3996 | 3991 | if (data & 0xff00) |
| r9336 | r9337 | |
| 4010 | 4005 | } |
| 4011 | 4006 | |
| 4012 | 4007 | } |
| 4013 | | |
| 4008 | |
| 4014 | 4009 | if (ACCESSING_BITS_8_15) |
| 4015 | 4010 | { |
| 4016 | 4011 | segacd_comms_flags = (segacd_comms_flags & 0x00ff) | (data & 0xff00); |
| r9336 | r9337 | |
| 4109 | 4104 | { |
| 4110 | 4105 | segacd_cdc_regaddress = data & 0x0f; |
| 4111 | 4106 | if (data & 0xf0) printf("unknown bits set in register address write %04x\n", data); |
| 4112 | | |
| 4107 | |
| 4113 | 4108 | printf("CDC register address set to %02x\n" , segacd_cdc_regaddress); |
| 4114 | 4109 | } |
| 4115 | 4110 | |
| r9336 | r9337 | |
| 4117 | 4112 | { |
| 4118 | 4113 | segacd_cdc_destination_device = (data & 0x0700)>>8; |
| 4119 | 4114 | if (data & 0xf800) printf("unknown bits set in destination address write %04x\n",data); |
| 4120 | | |
| 4115 | |
| 4121 | 4116 | printf("destination set to: "); |
| 4122 | 4117 | switch (segacd_cdc_destination_device&0x7) |
| 4123 | 4118 | { |
| r9336 | r9337 | |
| 4128 | 4123 | case 0x04: printf("RFC5164 PCM\n"); break; |
| 4129 | 4124 | case 0x05: printf("PRG RAM\n"); break; |
| 4130 | 4125 | case 0x06: printf("Illegal\n"); break; |
| 4131 | | case 0x07: printf("2M AM (2M Mode) / SUB CPU 1H RAM\n"); break; |
| 4126 | case 0x07: printf("2M AM (2M Mode) / SUB CPU 1H RAM\n"); break; |
| 4132 | 4127 | } |
| 4133 | 4128 | } |
| 4134 | 4129 | } |
| r9336 | r9337 | |
| 4136 | 4131 | static READ16_HANDLER( segacd_cdc_mode_address_r ) |
| 4137 | 4132 | { |
| 4138 | 4133 | UINT16 retdata = 0x0000; |
| 4139 | | |
| 4134 | |
| 4140 | 4135 | if (ACCESSING_BITS_0_7) |
| 4141 | 4136 | { |
| 4142 | 4137 | retdata |= segacd_cdc_regaddress; |
| 4143 | 4138 | } |
| 4144 | | |
| 4139 | |
| 4145 | 4140 | if (ACCESSING_BITS_8_15) |
| 4146 | 4141 | { |
| 4147 | 4142 | retdata |= segacd_cdc_destination_device << 8; |
| 4148 | | |
| 4143 | |
| 4149 | 4144 | // todo: hook them up |
| 4150 | 4145 | int data_set_ready = 0; |
| 4151 | 4146 | int end_of_data_transfer = 0; |
| 4152 | | |
| 4147 | |
| 4153 | 4148 | if (data_set_ready) retdata |= 0x4000; |
| 4154 | 4149 | if (end_of_data_transfer) retdata |= 0x8000; |
| 4155 | | |
| 4150 | |
| 4156 | 4151 | } |
| 4157 | | |
| 4152 | |
| 4158 | 4153 | return retdata; |
| 4159 | 4154 | } |
| 4160 | 4155 | |
| r9336 | r9337 | |
| 4165 | 4160 | segacd_cdc_registers[segacd_cdc_regaddress] = data; |
| 4166 | 4161 | printf("CDC Register %02x set to %02x\n", segacd_cdc_regaddress, data & 0xff); |
| 4167 | 4162 | } |
| 4168 | | |
| 4163 | |
| 4169 | 4164 | if (ACCESSING_BITS_8_15) |
| 4170 | 4165 | { |
| 4171 | 4166 | // nothing here? |
| r9336 | r9337 | |
| 4181 | 4176 | retdata |= segacd_cdc_registers[segacd_cdc_regaddress]; |
| 4182 | 4177 | printf("CDC Register %02x Read\n", segacd_cdc_regaddress); |
| 4183 | 4178 | } |
| 4184 | | |
| 4179 | |
| 4185 | 4180 | if (ACCESSING_BITS_8_15) |
| 4186 | 4181 | { |
| 4187 | 4182 | // nothing here? |
| 4188 | 4183 | } |
| 4189 | | |
| 4184 | |
| 4190 | 4185 | return retdata; |
| 4191 | 4186 | } |
| 4192 | 4187 | |
| r9336 | r9337 | |
| 4213 | 4208 | printf("Unspported: segacd_main_dataram_part1_r in mode 1\n"); |
| 4214 | 4209 | return 0x0000; |
| 4215 | 4210 | } |
| 4216 | | |
| 4211 | |
| 4217 | 4212 | return 0x0000; |
| 4218 | 4213 | } |
| 4219 | 4214 | |
| 4220 | 4215 | static WRITE16_HANDLER( segacd_main_dataram_part1_w ) |
| 4221 | | { |
| 4216 | { |
| 4222 | 4217 | if (segacd_ram_mode==0) |
| 4223 | 4218 | { |
| 4224 | 4219 | // is this correct? |
| r9336 | r9337 | |
| 4226 | 4221 | COMBINE_DATA(&segacd_dataram[offset]); |
| 4227 | 4222 | else |
| 4228 | 4223 | { |
| 4229 | | printf("Illegal: segacd_main_dataram_part1_w in mode 0 without permission\n"); |
| 4224 | printf("Illegal: segacd_main_dataram_part1_w in mode 0 without permission\n"); |
| 4230 | 4225 | } |
| 4231 | 4226 | } |
| 4232 | 4227 | else if (segacd_ram_mode==1) |
| r9336 | r9337 | |
| 4247 | 4242 | case 0x01: |
| 4248 | 4243 | return segacd_hint_register; |
| 4249 | 4244 | } |
| 4250 | | |
| 4245 | |
| 4251 | 4246 | return 0; |
| 4252 | 4247 | |
| 4253 | 4248 | } |
| r9336 | r9337 | |
| 4302 | 4297 | { |
| 4303 | 4298 | cpu_set_input_line(_segacd_68k_cpu, INPUT_LINE_RESET, ASSERT_LINE); |
| 4304 | 4299 | cpu_set_input_line(_segacd_68k_cpu, INPUT_LINE_HALT, ASSERT_LINE); |
| 4305 | | |
| 4300 | |
| 4306 | 4301 | segacd_hint_register = 0xffff; // -1 |
| 4307 | 4302 | } |
| 4308 | 4303 | |
| r9336 | r9337 | |
| 4359 | 4354 | else |
| 4360 | 4355 | { |
| 4361 | 4356 | printf("Illegal: segacd_sub_dataram_part1_r in mode 0 without permission\n"); |
| 4362 | | return 0x0000; |
| 4357 | return 0x0000; |
| 4363 | 4358 | } |
| 4364 | 4359 | } |
| 4365 | 4360 | else if (segacd_ram_mode==1) |
| r9336 | r9337 | |
| 4367 | 4362 | printf("Unspported: segacd_sub_dataram_part1_r in mode 1\n"); |
| 4368 | 4363 | return 0x0000; |
| 4369 | 4364 | } |
| 4370 | | |
| 4365 | |
| 4371 | 4366 | return 0x0000; |
| 4372 | 4367 | } |
| 4373 | 4368 | |
| 4374 | 4369 | static WRITE16_HANDLER( segacd_sub_dataram_part1_w ) |
| 4375 | | { |
| 4370 | { |
| 4376 | 4371 | if (segacd_ram_mode==0) |
| 4377 | 4372 | { |
| 4378 | 4373 | // is this correct? |
| r9336 | r9337 | |
| 4401 | 4396 | printf("Unspported: segacd_sub_dataram_part2_r in mode 1\n"); |
| 4402 | 4397 | return 0x0000; |
| 4403 | 4398 | } |
| 4404 | | |
| 4399 | |
| 4405 | 4400 | return 0x0000; |
| 4406 | 4401 | } |
| 4407 | 4402 | |
| r9336 | r9337 | |
| 6777 | 6772 | |
| 6778 | 6773 | } |
| 6779 | 6774 | |
| 6780 | | |
| 6781 | 6775 | |
| 6776 | |
| 6782 | 6777 | _32x_check_framebuffer_swap(); |
| 6783 | | |
| 6784 | 6778 | |
| 6779 | |
| 6785 | 6780 | // if (genesis_scanline_counter==0) irq4counter = MEGADRIVE_REG0A_HINT_VALUE; |
| 6786 | 6781 | // irq4counter = MEGADRIVE_REG0A_HINT_VALUE; |
| 6787 | 6782 | |
| r9336 | r9337 | |
| 7672 | 7667 | ROM_COPY( "32x_68k_bios", 0x0, 0x0, 0x100) |
| 7673 | 7668 | |
| 7674 | 7669 | ROM_REGION( 0x400000, "32x_master_sh2", 0 ) /* SH2 Code */ |
| 7675 | | ROM_LOAD( "32x_m_bios.bin", 0x000000, 0x000800, CRC(dd9c46b8) SHA1(1e5b0b2441a4979b6966d942b20cc76c413b8c5e) ) |
| 7670 | ROM_SYSTEM_BIOS( 0, "retail", "Mars Version 1.0 (retail)" ) |
| 7671 | ROMX_LOAD( "32x_m_bios.bin", 0x000000, 0x000800, CRC(dd9c46b8) SHA1(1e5b0b2441a4979b6966d942b20cc76c413b8c5e), ROM_BIOS(1) ) |
| 7672 | ROM_SYSTEM_BIOS( 1, "sdk", "Mars Version 1.0 (early sdk)" ) |
| 7673 | ROMX_LOAD( "32x_m_bios_sdk.bin", 0x000000, 0x000800, BAD_DUMP CRC(c7102c53) SHA1(ed73a47f186b373b8eff765f84ef26c3d9ef6cb0), ROM_BIOS(2) ) |
| 7676 | 7674 | |
| 7675 | |
| 7677 | 7676 | ROM_REGION( 0x400000, "32x_slave_sh2", 0 ) /* SH2 Code */ |
| 7678 | 7677 | ROM_LOAD( "32x_s_bios.bin", 0x000000, 0x000400, CRC(bfda1fe5) SHA1(4103668c1bbd66c5e24558e73d4f3f92061a109a) ) |
| 7679 | 7678 | ROM_END |