Previous 15994 Revisions Next

r4451 Wednesday 1st April, 2009 at 15:50:00 UTC by Wilbert Pol
[SMS] Cleaned up driver flag abuse.
[src/mess/drivers]sms.c
[src/mess/includes]sms.h
[src/mess/machine]sms.c

src/mess/includes/sms.h
r4450r4451
1515#define NVRAM_SIZE                        (0x8000)
1616#define CPU_ADDRESSABLE_SIZE         (0x10000)
1717
18
19#define FLAG_GAMEGEAR         0x00020000
20#define FLAG_BIOS_0400         0x00040000
21#define FLAG_BIOS_2000         0x00080000
22#define FLAG_BIOS_FULL         0x00100000
23#define FLAG_FM            0x00200000
24#define FLAG_REGION_JAPAN      0x00400000
25
26#define IS_GAMEGEAR         ( space->machine->gamedrv->flags & FLAG_GAMEGEAR )
27#define HAS_BIOS_0400         ( space->machine->gamedrv->flags & FLAG_BIOS_0400 )
28#define HAS_BIOS_2000         ( space->machine->gamedrv->flags & FLAG_BIOS_2000 )
29#define HAS_BIOS_FULL         ( space->machine->gamedrv->flags & FLAG_BIOS_FULL )
30#define HAS_BIOS         ( space->machine->gamedrv->flags & ( FLAG_BIOS_0400 | FLAG_BIOS_2000 | FLAG_BIOS_FULL ) )
31#define HAS_FM            ( space->machine->gamedrv->flags & FLAG_FM )
32#define IS_REGION_JAPAN         ( space->machine->gamedrv->flags & FLAG_REGION_JAPAN )
33
34
3518/*----------- defined in machine/sms.c -----------*/
3619
3720/* Function prototypes */
r4450r4451
7962#define IO_CHIP                     (0x04)   /* I/O chip disabled (1= disabled, 0= enabled) */
8063
8164
65DRIVER_INIT( sg1000m3 );
66DRIVER_INIT( sms1 );
67DRIVER_INIT( smsj );
68DRIVER_INIT( sms2kr );
69DRIVER_INIT( smssdisp );
70DRIVER_INIT( gamegear );
71DRIVER_INIT( gamegeaj );
72
73
8274#endif /* SMS_H_ */
src/mess/machine/sms.c
r4450r4451
99#define VERBOSE 0
1010#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
1111
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
1229#define CF_CODEMASTERS_MAPPER   0x01
1330#define CF_KOREAN_MAPPER   0x02
1431#define CF_93C46_EEPROM      0x04
r4450r4451
2340static int smsPaused;
2441
2542static UINT8 biosPort;
26
43static UINT32 sms_flags;
2744static UINT8 *BIOS;
2845
2946static UINT8 *sms_mapper_ram;
r4450r4451
927944
928945DEVICE_START( sms_cart )
929946{
930   running_machine *machine = device->machine;
931   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
932947   int i;
933948
934949   for ( i = 0; i < MAX_CARTRIDGES; i++ )
r4450r4451
955970
956971DEVICE_IMAGE_LOAD( sms_cart )
957972{
958   running_machine *machine = image->machine;
959973   int size = image_length(image);
960974   int index = 0;
961975   const char *fname = image_filename( image );
962976   int fname_len = fname ? strlen( fname ) : 0;
963977   const char *extrainfo = image_extrainfo( image );
964   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
965978
966979   if (strcmp(image->tag,"cart1")==0)
967980   {
r4450r4451
11661179
11671180   sms_mapper_ram = memory_get_write_ptr( space, 0xDFFC );
11681181
1182   biosPort = 0;
1183
11691184   if ( sms_cartridge[sms_current_cartridge].features & CF_CODEMASTERS_MAPPER )
11701185   {
11711186      /* Install special memory handlers */
r4450r4451
12811296   cpu_set_input_line(machine->cpu[0], sms_store_control & 0x01 ? 1 : 0, state );
12821297}
12831298
1299
1300DRIVER_INIT( sg1000m3 )
1301{
1302   sms_flags = FLAG_REGION_JAPAN | FLAG_FM;
1303}
1304
1305
1306DRIVER_INIT( sms1 )
1307{
1308   sms_flags = FLAG_BIOS_FULL;
1309}
1310
1311
1312DRIVER_INIT( smsj )
1313{
1314   sms_flags = FLAG_REGION_JAPAN | FLAG_BIOS_2000 | FLAG_FM;
1315}
1316
1317
1318DRIVER_INIT( sms2kr )
1319{
1320   sms_flags = FLAG_REGION_JAPAN | FLAG_BIOS_FULL | FLAG_FM;
1321}
1322
1323
1324DRIVER_INIT( smssdisp )
1325{
1326   sms_flags = 0;
1327}
1328
1329
1330DRIVER_INIT( gamegear )
1331{
1332   sms_flags = FLAG_GAMEGEAR;
1333}
1334
1335
1336DRIVER_INIT( gamegeaj )
1337{
1338   sms_flags = FLAG_REGION_JAPAN | FLAG_GAMEGEAR | FLAG_BIOS_0400;
1339}
1340
src/mess/drivers/sms.c
r4450r4451
619619***************************************************************************/
620620
621621/*    YEAR  NAME        PARENT      COMPAT  MACHINE     INPUT   INIT    CONFIG      COMPANY     FULLNAME                            FLAGS */
622CONS( 1984, sg1000m3,   sms,        0,      sg1000m3,   sms,    0,      0,        "Sega",     "SG-1000 Mark III",                 FLAG_REGION_JAPAN | FLAG_FM )
623CONS( 1986, sms1,       sms,        0,      sms1ntsc,   sms,    0,      0,        "Sega",     "Master System I",                  FLAG_BIOS_FULL )
624CONS( 1986, sms1pal,    sms,        0,      sms1pal,    sms,    0,      0,        "Sega",     "Master System I (PAL)" ,           FLAG_BIOS_FULL )
625CONS( 1986, smssdisp,   sms,        0,      smssdisp,   sms,    0,      0,        "Sega",     "Master System Store Display Unit", GAME_NOT_WORKING )
626CONS( 1987, smsj,       sms,        0,      smsfm,      sms,    0,      0,        "Sega",     "Master System (Japan)",            FLAG_REGION_JAPAN | FLAG_BIOS_2000 | FLAG_FM )
627CONS( 1990, sms,        0,          0,      sms2ntsc,   sms,    0,      0,        "Sega",     "Master System II",                 FLAG_BIOS_FULL )
628CONS( 1990, smspal,     sms,        0,      sms2pal,    sms,    0,      0,        "Sega",     "Master System II (PAL)",           FLAG_BIOS_FULL )
629CONS( 1990, sms2kr,     sms,        0,      sms2fm,     sms,    0,      0,        "Samsung",  "Gam*Boy II (Korea)",               FLAG_REGION_JAPAN | FLAG_BIOS_FULL | FLAG_FM )
622CONS( 1984, sg1000m3,   sms,        0,      sg1000m3,   sms,    sg1000m3, 0,        "Sega",     "SG-1000 Mark III",                 0 )
623CONS( 1986, sms1,       sms,        0,      sms1ntsc,   sms,    sms1,     0,        "Sega",     "Master System I",                  0 )
624CONS( 1986, sms1pal,    sms,        0,      sms1pal,    sms,    sms1,     0,        "Sega",     "Master System I (PAL)" ,           0 )
625CONS( 1986, smssdisp,   sms,        0,      smssdisp,   sms,    smssdisp, 0,     "Sega",     "Master System Store Display Unit", GAME_NOT_WORKING )
626CONS( 1987, smsj,       sms,        0,      smsfm,      sms,    smsj,     0,        "Sega",     "Master System (Japan)",            0 )
627CONS( 1990, sms,        0,          0,      sms2ntsc,   sms,    sms1,     0,        "Sega",     "Master System II",                 0 )
628CONS( 1990, smspal,     sms,        0,      sms2pal,    sms,    sms1,     0,        "Sega",     "Master System II (PAL)",           0 )
629CONS( 1990, sms2kr,     sms,        0,      sms2fm,     sms,    sms2kr,   0,        "Samsung",  "Gam*Boy II (Korea)",               0 )
630630
631CONS( 1990, gamegear,   0,          sms,    gamegear,   gg,     0,      0,       "Sega",     "Game Gear (Europe/America)",       FLAG_GAMEGEAR )
632CONS( 1990, gamegeaj,   gamegear,   0,      gamegear,   gg,     0,      0,        "Sega",     "Game Gear (Japan)",                FLAG_REGION_JAPAN | FLAG_GAMEGEAR | FLAG_BIOS_0400 )
631CONS( 1990, gamegear,   0,          sms,    gamegear,   gg,     gamegear, 0,       "Sega",     "Game Gear (Europe/America)",       0 )
632CONS( 1990, gamegeaj,   gamegear,   0,      gamegear,   gg,     gamegeaj, 0,        "Sega",     "Game Gear (Japan)",                0 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team