src/mess/machine/sms.c
| r4450 | r4451 | |
| 9 | 9 | #define VERBOSE 0 |
| 10 | 10 | #define LOG(x) do { if (VERBOSE) logerror x; } while (0) |
| 11 | 11 | |
| 12 | #define FLAG_GAMEGEAR 0x00020000 |
| 13 | #define FLAG_BIOS_0400 0x00040000 |
| 14 | #define FLAG_BIOS_2000 0x00080000 |
| 15 | #define FLAG_BIOS_FULL 0x00100000 |
| 16 | #define FLAG_FM 0x00200000 |
| 17 | #define FLAG_REGION_JAPAN 0x00400000 |
| 18 | |
| 19 | |
| 20 | #define IS_GAMEGEAR ( sms_flags & FLAG_GAMEGEAR ) |
| 21 | #define HAS_BIOS_0400 ( sms_flags & FLAG_BIOS_0400 ) |
| 22 | #define HAS_BIOS_2000 ( sms_flags & FLAG_BIOS_2000 ) |
| 23 | #define HAS_BIOS_FULL ( sms_flags & FLAG_BIOS_FULL ) |
| 24 | #define HAS_BIOS ( sms_flags & ( FLAG_BIOS_0400 | FLAG_BIOS_2000 | FLAG_BIOS_FULL ) ) |
| 25 | #define HAS_FM ( sms_flags & FLAG_FM ) |
| 26 | #define IS_REGION_JAPAN ( sms_flags & FLAG_REGION_JAPAN ) |
| 27 | |
| 28 | |
| 12 | 29 | #define CF_CODEMASTERS_MAPPER 0x01 |
| 13 | 30 | #define CF_KOREAN_MAPPER 0x02 |
| 14 | 31 | #define CF_93C46_EEPROM 0x04 |
| r4450 | r4451 | |
| 23 | 40 | static int smsPaused; |
| 24 | 41 | |
| 25 | 42 | static UINT8 biosPort; |
| 26 | | |
| 43 | static UINT32 sms_flags; |
| 27 | 44 | static UINT8 *BIOS; |
| 28 | 45 | |
| 29 | 46 | static UINT8 *sms_mapper_ram; |
| r4450 | r4451 | |
| 927 | 944 | |
| 928 | 945 | DEVICE_START( sms_cart ) |
| 929 | 946 | { |
| 930 | | running_machine *machine = device->machine; |
| 931 | | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 932 | 947 | int i; |
| 933 | 948 | |
| 934 | 949 | for ( i = 0; i < MAX_CARTRIDGES; i++ ) |
| r4450 | r4451 | |
| 955 | 970 | |
| 956 | 971 | DEVICE_IMAGE_LOAD( sms_cart ) |
| 957 | 972 | { |
| 958 | | running_machine *machine = image->machine; |
| 959 | 973 | int size = image_length(image); |
| 960 | 974 | int index = 0; |
| 961 | 975 | const char *fname = image_filename( image ); |
| 962 | 976 | int fname_len = fname ? strlen( fname ) : 0; |
| 963 | 977 | const char *extrainfo = image_extrainfo( image ); |
| 964 | | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 965 | 978 | |
| 966 | 979 | if (strcmp(image->tag,"cart1")==0) |
| 967 | 980 | { |
| r4450 | r4451 | |
| 1166 | 1179 | |
| 1167 | 1180 | sms_mapper_ram = memory_get_write_ptr( space, 0xDFFC ); |
| 1168 | 1181 | |
| 1182 | biosPort = 0; |
| 1183 | |
| 1169 | 1184 | if ( sms_cartridge[sms_current_cartridge].features & CF_CODEMASTERS_MAPPER ) |
| 1170 | 1185 | { |
| 1171 | 1186 | /* Install special memory handlers */ |
| r4450 | r4451 | |
| 1281 | 1296 | cpu_set_input_line(machine->cpu[0], sms_store_control & 0x01 ? 1 : 0, state ); |
| 1282 | 1297 | } |
| 1283 | 1298 | |
| 1299 | |
| 1300 | DRIVER_INIT( sg1000m3 ) |
| 1301 | { |
| 1302 | sms_flags = FLAG_REGION_JAPAN | FLAG_FM; |
| 1303 | } |
| 1304 | |
| 1305 | |
| 1306 | DRIVER_INIT( sms1 ) |
| 1307 | { |
| 1308 | sms_flags = FLAG_BIOS_FULL; |
| 1309 | } |
| 1310 | |
| 1311 | |
| 1312 | DRIVER_INIT( smsj ) |
| 1313 | { |
| 1314 | sms_flags = FLAG_REGION_JAPAN | FLAG_BIOS_2000 | FLAG_FM; |
| 1315 | } |
| 1316 | |
| 1317 | |
| 1318 | DRIVER_INIT( sms2kr ) |
| 1319 | { |
| 1320 | sms_flags = FLAG_REGION_JAPAN | FLAG_BIOS_FULL | FLAG_FM; |
| 1321 | } |
| 1322 | |
| 1323 | |
| 1324 | DRIVER_INIT( smssdisp ) |
| 1325 | { |
| 1326 | sms_flags = 0; |
| 1327 | } |
| 1328 | |
| 1329 | |
| 1330 | DRIVER_INIT( gamegear ) |
| 1331 | { |
| 1332 | sms_flags = FLAG_GAMEGEAR; |
| 1333 | } |
| 1334 | |
| 1335 | |
| 1336 | DRIVER_INIT( gamegeaj ) |
| 1337 | { |
| 1338 | sms_flags = FLAG_REGION_JAPAN | FLAG_GAMEGEAR | FLAG_BIOS_0400; |
| 1339 | } |
| 1340 | |
src/mess/drivers/sms.c
| r4450 | r4451 | |
| 619 | 619 | ***************************************************************************/ |
| 620 | 620 | |
| 621 | 621 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 622 | | CONS( 1984, sg1000m3, sms, 0, sg1000m3, sms, 0, 0, "Sega", "SG-1000 Mark III", FLAG_REGION_JAPAN | FLAG_FM ) |
| 623 | | CONS( 1986, sms1, sms, 0, sms1ntsc, sms, 0, 0, "Sega", "Master System I", FLAG_BIOS_FULL ) |
| 624 | | CONS( 1986, sms1pal, sms, 0, sms1pal, sms, 0, 0, "Sega", "Master System I (PAL)" , FLAG_BIOS_FULL ) |
| 625 | | CONS( 1986, smssdisp, sms, 0, smssdisp, sms, 0, 0, "Sega", "Master System Store Display Unit", GAME_NOT_WORKING ) |
| 626 | | CONS( 1987, smsj, sms, 0, smsfm, sms, 0, 0, "Sega", "Master System (Japan)", FLAG_REGION_JAPAN | FLAG_BIOS_2000 | FLAG_FM ) |
| 627 | | CONS( 1990, sms, 0, 0, sms2ntsc, sms, 0, 0, "Sega", "Master System II", FLAG_BIOS_FULL ) |
| 628 | | CONS( 1990, smspal, sms, 0, sms2pal, sms, 0, 0, "Sega", "Master System II (PAL)", FLAG_BIOS_FULL ) |
| 629 | | CONS( 1990, sms2kr, sms, 0, sms2fm, sms, 0, 0, "Samsung", "Gam*Boy II (Korea)", FLAG_REGION_JAPAN | FLAG_BIOS_FULL | FLAG_FM ) |
| 622 | CONS( 1984, sg1000m3, sms, 0, sg1000m3, sms, sg1000m3, 0, "Sega", "SG-1000 Mark III", 0 ) |
| 623 | CONS( 1986, sms1, sms, 0, sms1ntsc, sms, sms1, 0, "Sega", "Master System I", 0 ) |
| 624 | CONS( 1986, sms1pal, sms, 0, sms1pal, sms, sms1, 0, "Sega", "Master System I (PAL)" , 0 ) |
| 625 | CONS( 1986, smssdisp, sms, 0, smssdisp, sms, smssdisp, 0, "Sega", "Master System Store Display Unit", GAME_NOT_WORKING ) |
| 626 | CONS( 1987, smsj, sms, 0, smsfm, sms, smsj, 0, "Sega", "Master System (Japan)", 0 ) |
| 627 | CONS( 1990, sms, 0, 0, sms2ntsc, sms, sms1, 0, "Sega", "Master System II", 0 ) |
| 628 | CONS( 1990, smspal, sms, 0, sms2pal, sms, sms1, 0, "Sega", "Master System II (PAL)", 0 ) |
| 629 | CONS( 1990, sms2kr, sms, 0, sms2fm, sms, sms2kr, 0, "Samsung", "Gam*Boy II (Korea)", 0 ) |
| 630 | 630 | |
| 631 | | CONS( 1990, gamegear, 0, sms, gamegear, gg, 0, 0, "Sega", "Game Gear (Europe/America)", FLAG_GAMEGEAR ) |
| 632 | | CONS( 1990, gamegeaj, gamegear, 0, gamegear, gg, 0, 0, "Sega", "Game Gear (Japan)", FLAG_REGION_JAPAN | FLAG_GAMEGEAR | FLAG_BIOS_0400 ) |
| 631 | CONS( 1990, gamegear, 0, sms, gamegear, gg, gamegear, 0, "Sega", "Game Gear (Europe/America)", 0 ) |
| 632 | CONS( 1990, gamegeaj, gamegear, 0, gamegear, gg, gamegeaj, 0, "Sega", "Game Gear (Japan)", 0 ) |