trunk/src/emu/bus/sms_ctrl/multitap.c
| r242572 | r242573 | |
| 29 | 29 | //------------------------------------------------- |
| 30 | 30 | |
| 31 | 31 | sms_multitap_device::sms_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 32 | | device_t(mconfig, SMS_MULTITAP, "Furrtek's Multitap", tag, owner, clock, "sms_multitap", __FILE__), |
| 32 | device_t(mconfig, SMS_MULTITAP, "Multitap", tag, owner, clock, "sms_multitap", __FILE__), |
| 33 | 33 | device_sms_control_port_interface(mconfig, *this), |
| 34 | 34 | m_subctrl1_port(*this, "ctrl1"), |
| 35 | 35 | m_subctrl2_port(*this, "ctrl2"), |
trunk/src/mess/drivers/sms.c
| r242572 | r242573 | |
| 13 | 13 | To do: |
| 14 | 14 | |
| 15 | 15 | - SIO interface for Game Gear (needs netplay, I guess) |
| 16 | | - Gear to Gear Port SMS Controller Adaptor |
| 17 | 16 | - Sega Demo Unit II (kiosk expansion device) |
| 18 | 17 | - SMS Disk System (floppy disk drive expansion device) - unreleased |
| 19 | 18 | - Rapid button of Japanese Master System |
| r242572 | r242573 | |
| 24 | 23 | - Software compatibility flags, by region and/or BIOS |
| 25 | 24 | - Emulate SRAM cartridges? (for use with Bock's dump tool) |
| 26 | 25 | - Support for other DE-9 compatible controllers, like the Mega Drive 6-Button |
| 27 | | that has software support (at least a test tool made by Charles MacDonald) |
| 26 | that has homebrew software support |
| 28 | 27 | |
| 29 | 28 | The Game Gear SIO hardware is not emulated but has some |
| 30 | 29 | placeholders in 'machine/sms.c' |
| r242572 | r242573 | |
| 47 | 46 | |
| 48 | 47 | -------------------------------------------------------------------------------- |
| 49 | 48 | |
| 49 | General compatibility issues on real hardware (not emulation bugs): |
| 50 | |
| 51 | - Some ROMs have issues or don't work when running on a console of different |
| 52 | region; |
| 53 | - Many Japanese/Korean or homebrew ROMs don't have the signature required by |
| 54 | BIOSes of consoles sold overseas; |
| 55 | - Paddle games need to detect the system region as Japanese to work with the |
| 56 | Paddle controller; |
| 57 | - Few games of the ones with FM support need to detect the system region as |
| 58 | Japanese to play FM sound; |
| 59 | - The Light Phaser gun doesn't work with the Japanese SMS; |
| 60 | - There are reports about Light Phaser working on the second Korean console |
| 61 | version, and a Korean advert shows support on the first version (Gam*Boy I, |
| 62 | although based on Japanese SMS); |
| 63 | - The Korean SMS versions have Japanese-format cartridge slot, but only on the |
| 64 | first (Gam*Boy I) the region is detected as Japanese; |
| 65 | - Some SMS ROMs don't run when are plugged-in to SMS expansion slot, through |
| 66 | the gender adapter; |
| 67 | - Some SMS ROMs don't run when are plugged-in to a Game Gear, through the |
| 68 | Master Gear adapter; |
| 69 | |
| 70 | -------------------------------------------------------------------------------- |
| 71 | |
| 50 | 72 | Sega Master System II |
| 51 | 73 | Sega 1990 |
| 52 | 74 | |
| r242572 | r242573 | |
| 338 | 360 | AM_RANGE(0x40, 0x7f) AM_DEVWRITE("gamegear", gamegear_device, write) |
| 339 | 361 | AM_RANGE(0x80, 0x80) AM_MIRROR(0x3e) AM_DEVREADWRITE("sms_vdp", sega315_5124_device, vram_read, vram_write) |
| 340 | 362 | AM_RANGE(0x81, 0x81) AM_MIRROR(0x3e) AM_DEVREADWRITE("sms_vdp", sega315_5124_device, register_read, register_write) |
| 341 | | AM_RANGE(0xc0, 0xc0) AM_READ_PORT("GG_PORT_DC") |
| 342 | | AM_RANGE(0xc1, 0xc1) AM_READ_PORT("GG_PORT_DD") |
| 343 | | AM_RANGE(0xdc, 0xdc) AM_READ_PORT("GG_PORT_DC") |
| 344 | | AM_RANGE(0xdd, 0xdd) AM_READ_PORT("GG_PORT_DD") |
| 363 | AM_RANGE(0xc0, 0xc0) AM_READ(sms_input_port_dc_r) |
| 364 | AM_RANGE(0xc1, 0xc1) AM_READ(sms_input_port_dd_r) |
| 365 | AM_RANGE(0xdc, 0xdc) AM_READ(sms_input_port_dc_r) |
| 366 | AM_RANGE(0xdd, 0xdd) AM_READ(sms_input_port_dd_r) |
| 345 | 367 | ADDRESS_MAP_END |
| 346 | 368 | |
| 347 | 369 | |
| r242572 | r242573 | |
| 439 | 461 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 440 | 462 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 441 | 463 | |
| 442 | | PORT_START("GG_PORT_DD") |
| 443 | | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 444 | | |
| 445 | 464 | PORT_START("START") |
| 446 | 465 | PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 447 | 466 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START ) PORT_NAME("Start") /* Game Gear START */ |
| r242572 | r242573 | |
| 785 | 804 | MCFG_GG_CARTRIDGE_ADD("slot", gg_cart, NULL) |
| 786 | 805 | |
| 787 | 806 | MCFG_SOFTWARE_LIST_ADD("cart_list", "gamegear") |
| 807 | |
| 808 | MCFG_GG_GEAR2GEAR_PORT_ADD("gear2gear", gg_gear2gear_port_devices, NULL) |
| 809 | MCFG_GG_GEAR2GEAR_PORT_TH_INPUT_HANDLER(WRITELINE(sms_state, sms_ctrl2_th_input)) // not verified |
| 810 | //MCFG_GG_GEAR2GEAR_PORT_PIXEL_HANDLER(READ32(sms_state, sms_pixel_color)) // only for GG-TV mod |
| 788 | 811 | MACHINE_CONFIG_END |
| 789 | 812 | |
| 790 | 813 | |
| r242572 | r242573 | |
| 963 | 986 | - Sega Mark III Soft Desk 10 |
| 964 | 987 | - Sega Shooting Zone |
| 965 | 988 | |
| 989 | The SMS Store Display Unit is labeled PD-W UNIT. Pictures found on Internet |
| 990 | show cartridges with a label where a not-for-sale message is written along |
| 991 | the information that it is for use on the Product Display-Working Unit. |
| 992 | |
| 966 | 993 | ***************************************************************************/ |
| 967 | 994 | |
| 968 | 995 | /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ |
trunk/src/mess/includes/sms.h
| r242572 | r242573 | |
| 19 | 19 | #define CONTROL1_TAG "ctrl1" |
| 20 | 20 | #define CONTROL2_TAG "ctrl2" |
| 21 | 21 | |
| 22 | #include "bus/gamegear/gear2gear.h" |
| 22 | 23 | #include "bus/sms_ctrl/smsctrl.h" |
| 23 | 24 | #include "bus/sms_exp/smsexp.h" |
| 24 | 25 | #include "bus/sega8/sega8_slot.h" |
| r242572 | r242573 | |
| 36 | 37 | m_region_maincpu(*this, "maincpu"), |
| 37 | 38 | m_port_ctrl1(*this, CONTROL1_TAG), |
| 38 | 39 | m_port_ctrl2(*this, CONTROL2_TAG), |
| 40 | m_port_gear2gear(*this, "gear2gear"), |
| 41 | m_port_gg_dc(*this, "GG_PORT_DC"), |
| 39 | 42 | m_port_pause(*this, "PAUSE"), |
| 40 | 43 | m_port_reset(*this, "RESET"), |
| 41 | 44 | m_port_start(*this, "START"), |
| r242572 | r242573 | |
| 63 | 66 | required_memory_region m_region_maincpu; |
| 64 | 67 | optional_device<sms_control_port_device> m_port_ctrl1; |
| 65 | 68 | optional_device<sms_control_port_device> m_port_ctrl2; |
| 69 | optional_device<gg_gear2gear_port_device> m_port_gear2gear; |
| 70 | optional_ioport m_port_gg_dc; |
| 66 | 71 | optional_ioport m_port_pause; |
| 67 | 72 | optional_ioport m_port_reset; |
| 68 | 73 | optional_ioport m_port_start; |
| r242572 | r242573 | |
| 195 | 200 | void setup_media_slots(); |
| 196 | 201 | void setup_enabled_slots(); |
| 197 | 202 | void lphaser_hcount_latch(); |
| 198 | | void sms_get_inputs(address_space &space); |
| 203 | void sms_get_inputs(); |
| 199 | 204 | }; |
| 200 | 205 | |
| 201 | 206 | class smssdisp_state : public sms_state |
trunk/src/mess/machine/sms.c
| r242572 | r242573 | |
| 45 | 45 | |
| 46 | 46 | WRITE_LINE_MEMBER(sms_state::sms_ctrl2_th_input) |
| 47 | 47 | { |
| 48 | if (m_is_gamegear && (!m_cartslot->exists() || !m_cartslot->m_cart->get_sms_mode())) |
| 49 | return; |
| 50 | |
| 48 | 51 | // Check if TH of controller port 2 is set to input (1) |
| 49 | 52 | if (m_io_ctrl_reg & 0x08) |
| 50 | 53 | { |
| r242572 | r242573 | |
| 63 | 66 | } |
| 64 | 67 | |
| 65 | 68 | |
| 66 | | void sms_state::sms_get_inputs( address_space &space ) |
| 69 | void sms_state::sms_get_inputs() |
| 67 | 70 | { |
| 68 | | UINT8 data1, data2; |
| 71 | UINT8 data1 = 0xff; |
| 72 | UINT8 data2 = 0xff; |
| 69 | 73 | |
| 70 | 74 | m_port_dc_reg = 0xff; |
| 71 | 75 | m_port_dd_reg = 0xff; |
| r242572 | r242573 | |
| 74 | 78 | // physical pins numbering. For register bits whose order differs, |
| 75 | 79 | // it's necessary move the equivalent controller bits to match. |
| 76 | 80 | |
| 77 | | data1 = m_port_ctrl1->port_r(); |
| 78 | | m_port_dc_reg &= ~0x0f | data1; // Up, Down, Left, Right |
| 79 | | m_port_dc_reg &= ~0x10 | (data1 >> 1); // TL (Button 1) |
| 80 | | m_port_dc_reg &= ~0x20 | (data1 >> 2); // TR (Button 2) |
| 81 | if (m_is_gamegear) |
| 82 | { |
| 83 | data1 = m_port_gg_dc->read(); |
| 84 | m_port_dc_reg &= ~0x03f | data1; |
| 85 | } |
| 86 | else |
| 87 | { |
| 88 | data1 = m_port_ctrl1->port_r(); |
| 89 | m_port_dc_reg &= ~0x0f | data1; // Up, Down, Left, Right |
| 90 | m_port_dc_reg &= ~0x10 | (data1 >> 1); // TL (Button 1) |
| 91 | m_port_dc_reg &= ~0x20 | (data1 >> 2); // TR (Button 2) |
| 92 | } |
| 81 | 93 | |
| 82 | | data2 = m_port_ctrl2->port_r(); |
| 94 | if (m_is_gamegear) |
| 95 | { |
| 96 | if (m_cartslot->exists() && m_cartslot->m_cart->get_sms_mode()) |
| 97 | data2 = m_port_gear2gear->port_r(); |
| 98 | } |
| 99 | else |
| 100 | { |
| 101 | data2 = m_port_ctrl2->port_r(); |
| 102 | } |
| 83 | 103 | m_port_dc_reg &= ~0xc0 | (data2 << 6); // Up, Down |
| 84 | 104 | m_port_dd_reg &= ~0x03 | (data2 >> 2); // Left, Right |
| 85 | 105 | m_port_dd_reg &= ~0x04 | (data2 >> 3); // TL (Button 1) |
| r242572 | r242573 | |
| 116 | 136 | } |
| 117 | 137 | else |
| 118 | 138 | { |
| 119 | | sms_get_inputs(space); |
| 139 | sms_get_inputs(); |
| 120 | 140 | return m_port_dc_reg; |
| 121 | 141 | } |
| 122 | 142 | } |
| r242572 | r242573 | |
| 129 | 149 | UINT8 ctrl1_port_data = 0xff; |
| 130 | 150 | UINT8 ctrl2_port_data = 0xff; |
| 131 | 151 | |
| 152 | if (m_is_gamegear && (!m_cartslot->exists() || !m_cartslot->m_cart->get_sms_mode())) |
| 153 | { |
| 154 | m_io_ctrl_reg = data; |
| 155 | return; |
| 156 | } |
| 157 | |
| 132 | 158 | // Controller Port 1: |
| 133 | 159 | |
| 134 | 160 | // check if TR or TH are set to output (0). |
| r242572 | r242573 | |
| 171 | 197 | } |
| 172 | 198 | if (!m_is_gamegear) |
| 173 | 199 | m_port_ctrl2->port_w(ctrl2_port_data); |
| 200 | else |
| 201 | m_port_gear2gear->port_w(ctrl2_port_data); // not verified |
| 174 | 202 | } |
| 175 | 203 | // check if TH is set to input (1). |
| 176 | 204 | if (data & 0x08) |
| 177 | 205 | { |
| 178 | 206 | if (!m_is_gamegear) |
| 179 | 207 | ctrl2_port_data &= ~0x40 | m_port_ctrl2->port_r(); |
| 208 | else |
| 209 | ctrl2_port_data &= ~0x40 | m_port_gear2gear->port_r(); // not verified |
| 180 | 210 | |
| 181 | 211 | // check if TH input level is high (1) and was output/low (0) |
| 182 | 212 | if ((ctrl2_port_data & 0x40) && !(m_io_ctrl_reg & 0x88)) |
| r242572 | r242573 | |
| 232 | 262 | { |
| 233 | 263 | if (m_is_mark_iii) |
| 234 | 264 | { |
| 235 | | sms_get_inputs(space); |
| 265 | sms_get_inputs(); |
| 236 | 266 | return m_port_dc_reg; |
| 237 | 267 | } |
| 238 | 268 | |
| 239 | | if (m_mem_ctrl_reg & IO_CHIP) |
| 269 | if (!m_is_gamegear && (m_mem_ctrl_reg & IO_CHIP)) |
| 240 | 270 | { |
| 241 | 271 | return 0xff; |
| 242 | 272 | } |
| 243 | 273 | else |
| 244 | 274 | { |
| 245 | | sms_get_inputs(space); |
| 275 | sms_get_inputs(); |
| 246 | 276 | |
| 247 | 277 | // Check if TR of controller port 1 is set to output (0) |
| 248 | 278 | if (!(m_io_ctrl_reg & 0x01)) |
| r242572 | r242573 | |
| 260 | 290 | { |
| 261 | 291 | if (m_is_mark_iii) |
| 262 | 292 | { |
| 263 | | sms_get_inputs(space); |
| 293 | sms_get_inputs(); |
| 264 | 294 | return m_port_dd_reg; |
| 265 | 295 | } |
| 266 | 296 | |
| 267 | | if (m_mem_ctrl_reg & IO_CHIP) |
| 297 | if (!m_is_gamegear && (m_mem_ctrl_reg & IO_CHIP)) |
| 268 | 298 | return 0xff; |
| 269 | 299 | |
| 270 | | sms_get_inputs(space); |
| 300 | sms_get_inputs(); |
| 271 | 301 | |
| 272 | 302 | // Check if TR of controller port 2 is set to output (0) |
| 273 | 303 | if (!(m_io_ctrl_reg & 0x04)) |
| r242572 | r242573 | |
| 276 | 306 | m_port_dd_reg &= ~0x08 | ((m_io_ctrl_reg & 0x40) >> 3); |
| 277 | 307 | } |
| 278 | 308 | |
| 279 | | if (m_is_smsj) |
| 309 | if (m_is_smsj || (m_is_gamegear && m_is_gg_region_japan)) |
| 280 | 310 | { |
| 281 | 311 | // For Japanese Master System, set upper 4 bits with TH/TR |
| 282 | 312 | // direction bits of IO control register, according to Enri's |
| 283 | 313 | // docs (http://www43.tok2.com/home/cmpslv/Sms/EnrSms.htm). |
| 284 | 314 | // This makes the console incapable of using the Light Phaser. |
| 315 | // Assume the same for a Japanese Game Gear. |
| 285 | 316 | m_port_dd_reg &= ~0x10 | ((m_io_ctrl_reg & 0x01) << 4); |
| 286 | 317 | m_port_dd_reg &= ~0x20 | ((m_io_ctrl_reg & 0x04) << 3); |
| 287 | 318 | m_port_dd_reg &= ~0x40 | ((m_io_ctrl_reg & 0x02) << 5); |