Skip to content

Commit fef2b38

Browse files
authored
Always use MPC105 for step 1.x and MPC106 for step 2.x (#323)
* Always use MPC105 for step 1.x and MPC106 for step 2.x Some step 1.x games try to detect MPC106 first by accessing it via 0xFEC00CF8 and 0xFEE00CFC but then fail because the device ID is incorrect; we need to make sure MPC105 is only accessible via 0xF0800CF8 and 0xF0C00CFC Remove <pci_bridge> and <real3d_pci_id> tags from Games.xml as they are no longer needed * Fix typo
1 parent 77d28ee commit fef2b38

4 files changed

Lines changed: 40 additions & 60 deletions

File tree

Config/Games.xml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<hardware>
2020
<platform>Sega Model 3</platform>
2121
<stepping>1.0</stepping>
22-
<pci_bridge>MPC106</pci_bridge>
2322
<inputs>
2423
<input type="common" />
2524
<input type="fishing" />
@@ -87,7 +86,6 @@
8786
<hardware>
8887
<platform>Sega Model 3</platform>
8988
<stepping>1.0</stepping>
90-
<pci_bridge>MPC106</pci_bridge>
9189
<inputs>
9290
<input type="common" />
9391
<input type="fishing" />
@@ -113,7 +111,6 @@
113111
<hardware>
114112
<platform>Sega Model 3</platform>
115113
<stepping>1.0</stepping>
116-
<pci_bridge>MPC106</pci_bridge>
117114
<inputs>
118115
<input type="common" />
119116
<input type="fishing" />
@@ -139,7 +136,6 @@
139136
<hardware>
140137
<platform>Sega Model 3</platform>
141138
<stepping>1.0</stepping>
142-
<pci_bridge>MPC106</pci_bridge>
143139
<inputs>
144140
<input type="common" />
145141
<input type="fishing" />
@@ -346,7 +342,6 @@
346342
<stepping>2.1</stepping>
347343
<mpeg_board>DSB2</mpeg_board>
348344
<drive_board>Wheel</drive_board>
349-
<real3d_pci_id>0x16C311DB</real3d_pci_id>
350345
<netboard>true</netboard>
351346
<inputs>
352347
<input type="common" />
@@ -420,7 +415,6 @@
420415
<stepping>2.1</stepping>
421416
<mpeg_board>DSB2</mpeg_board>
422417
<drive_board>Wheel</drive_board>
423-
<real3d_pci_id>0x16C311DB</real3d_pci_id>
424418
<netboard>true</netboard>
425419
<inputs>
426420
<input type="common" />
@@ -452,7 +446,6 @@
452446
<stepping>2.1</stepping>
453447
<mpeg_board>DSB2</mpeg_board>
454448
<drive_board>Wheel</drive_board>
455-
<real3d_pci_id>0x16C311DB</real3d_pci_id>
456449
<netboard>true</netboard>
457450
<inputs>
458451
<input type="common" />
@@ -484,7 +477,6 @@
484477
<stepping>2.1</stepping>
485478
<mpeg_board>DSB2</mpeg_board>
486479
<drive_board>Wheel</drive_board>
487-
<real3d_pci_id>0x16C311DB</real3d_pci_id>
488480
<netboard>true</netboard>
489481
<inputs>
490482
<input type="common" />
@@ -516,7 +508,6 @@
516508
<stepping>2.1</stepping>
517509
<mpeg_board>DSB2</mpeg_board>
518510
<drive_board>Wheel</drive_board>
519-
<real3d_pci_id>0x16C311DB</real3d_pci_id>
520511
<netboard>true</netboard>
521512
<inputs>
522513
<input type="common" />
@@ -954,7 +945,6 @@
954945
<hardware>
955946
<platform>Sega Model 3</platform>
956947
<stepping>2.1</stepping>
957-
<real3d_pci_id>0x16C311DB</real3d_pci_id>
958948
<inputs>
959949
<input type="common" />
960950
<input type="analog_gun1" />
@@ -1221,7 +1211,6 @@
12211211
<hardware>
12221212
<platform>Sega Model 3</platform>
12231213
<stepping>2.1</stepping>
1224-
<real3d_pci_id>0x16C311DB</real3d_pci_id>
12251214
<inputs>
12261215
<input type="common" />
12271216
<input type="magtruck" />
@@ -1292,7 +1281,6 @@
12921281
<hardware>
12931282
<platform>Sega Model 3</platform>
12941283
<stepping>2.1</stepping>
1295-
<real3d_pci_id>0x16C311DB</real3d_pci_id>
12961284
<inputs>
12971285
<input type="common" />
12981286
<input type="magtruck" />
@@ -1738,7 +1726,6 @@
17381726
<stepping>1.5</stepping>
17391727
<mpeg_board>DSB1</mpeg_board>
17401728
<drive_board>Wheel</drive_board>
1741-
<pci_bridge>MPC106</pci_bridge>
17421729
<netboard>true</netboard>
17431730
<audio>QuadFrontRear</audio>
17441731
<inputs>
@@ -2614,7 +2601,6 @@
26142601
<platform>Sega Model 3</platform>
26152602
<stepping>2.0</stepping>
26162603
<drive_board>Billboard</drive_board>
2617-
<real3d_pci_id>0x16C311DB</real3d_pci_id>
26182604
<netboard>true</netboard>
26192605
<inputs>
26202606
<input type="common" />
@@ -2695,7 +2681,6 @@
26952681
<platform>Sega Model 3</platform>
26962682
<stepping>2.0</stepping>
26972683
<drive_board>Billboard</drive_board>
2698-
<real3d_pci_id>0x16C311DB</real3d_pci_id>
26992684
<netboard>true</netboard>
27002685
<inputs>
27012686
<input type="common" />
@@ -2724,7 +2709,6 @@
27242709
<platform>Sega Model 3</platform>
27252710
<stepping>2.0</stepping>
27262711
<drive_board>Billboard</drive_board>
2727-
<real3d_pci_id>0x16C311DB</real3d_pci_id>
27282712
<netboard>true</netboard>
27292713
<inputs>
27302714
<input type="common" />
@@ -2753,7 +2737,6 @@
27532737
<platform>Sega Model 3</platform>
27542738
<stepping>2.0</stepping>
27552739
<drive_board>Billboard</drive_board>
2756-
<real3d_pci_id>0x16C311DB</real3d_pci_id>
27572740
<netboard>true</netboard>
27582741
<inputs>
27592742
<input type="common" />
@@ -2860,7 +2843,6 @@
28602843
<platform>Sega Model 3</platform>
28612844
<stepping>1.5</stepping>
28622845
<drive_board>Billboard</drive_board>
2863-
<pci_bridge>MPC106</pci_bridge>
28642846
<inputs>
28652847
<input type="common" />
28662848
<input type="joystick1" />
@@ -2890,7 +2872,6 @@
28902872
<platform>Sega Model 3</platform>
28912873
<stepping>1.5</stepping>
28922874
<drive_board>Billboard</drive_board>
2893-
<pci_bridge>MPC106</pci_bridge>
28942875
<inputs>
28952876
<input type="common" />
28962877
<input type="joystick1" />
@@ -3010,7 +2991,6 @@
30102991
<platform>Sega Model 3</platform>
30112992
<stepping>1.5</stepping>
30122993
<drive_board>Billboard</drive_board>
3013-
<pci_bridge>MPC106</pci_bridge>
30142994
<inputs>
30152995
<input type="common" />
30162996
<input type="joystick1" />
@@ -3205,7 +3185,6 @@
32053185
<platform>Sega Model 3</platform>
32063186
<stepping>1.5</stepping>
32073187
<drive_board>Billboard</drive_board>
3208-
<pci_bridge>MPC106</pci_bridge>
32093188
<inputs>
32103189
<input type="common" />
32113190
<input type="joystick1" />
@@ -3233,7 +3212,6 @@
32333212
<hardware>
32343213
<platform>Sega Model 3</platform>
32353214
<stepping>1.5</stepping>
3236-
<pci_bridge>MPC106</pci_bridge>
32373215
<drive_board>Billboard</drive_board>
32383216
<inputs>
32393217
<input type="common" />
@@ -3262,7 +3240,6 @@
32623240
<hardware>
32633241
<platform>Sega Model 3</platform>
32643242
<stepping>1.5</stepping>
3265-
<pci_bridge>MPC106</pci_bridge>
32663243
<drive_board>Billboard</drive_board>
32673244
<inputs>
32683245
<input type="common" />

Src/Game.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ struct Game
2727
QUAD_1_LR_2_FR_MIX, // Specific srally2: Split SCSP2 and mix first channel to DSB+SCP11 Front Left/Right and second to Read Left/Right
2828
};
2929
AudioTypes audio = STEREO_LR;
30-
std::string pci_bridge; // overrides default PCI bridge type for stepping (empty string for default)
31-
uint32_t real3d_pci_id = 0; // overrides default Real3D PCI ID for stepping (0 for default)
3230
uint32_t encryption_key = 0;
3331
bool netboard_present = false;
3432

Src/GameLoader.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,6 @@ static void PopulateGameInfo(Game *game, const Util::Config::Node &game_node)
272272
};
273273
std::string audio_type = game_node["hardware/audio"].ValueAsDefault<std::string>("");
274274
game->audio = audio_types[audio_type];
275-
game->pci_bridge = game_node["hardware/pci_bridge"].ValueAsDefault<std::string>("");
276-
game->real3d_pci_id = game_node["hardware/real3d_pci_id"].ValueAsDefault<uint32_t>(0);
277275
game->encryption_key = game_node["hardware/encryption_key"].ValueAsDefault<uint32_t>(0);
278276
game->netboard_present = game_node["hardware/netboard"].ValueAsDefault<bool>(false);
279277

Src/Model3/Model3.cpp

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,9 @@ UINT16 CModel3::Read16(UINT32 addr)
10981098

10991099
// MPC105
11001100
case 0xC0: // F0C00CF8
1101-
return PCIBridge.ReadPCIConfigData(16,addr&3);
1101+
if (PCIBridge.GetModel() == 0x105)
1102+
return PCIBridge.ReadPCIConfigData(16,addr&3);
1103+
break;
11021104

11031105
// MPC106
11041106
case 0xE0:
@@ -1117,7 +1119,9 @@ UINT16 CModel3::Read16(UINT32 addr)
11171119
case 0xED:
11181120
case 0xEE:
11191121
case 0xEF:
1120-
return PCIBridge.ReadPCIConfigData(16,addr&3);
1122+
if (PCIBridge.GetModel() == 0x106)
1123+
return PCIBridge.ReadPCIConfigData(16,addr&3);
1124+
break;
11211125

11221126
// Unknown
11231127
default:
@@ -1233,7 +1237,9 @@ UINT32 CModel3::Read32(UINT32 addr)
12331237

12341238
// MPC105
12351239
case 0xC0: // F0C00CF8
1236-
return PCIBridge.ReadPCIConfigData(32,0);
1240+
if (PCIBridge.GetModel() == 0x105)
1241+
return PCIBridge.ReadPCIConfigData(32,0);
1242+
break;
12371243

12381244
// MPC106
12391245
case 0xE0:
@@ -1252,7 +1258,9 @@ UINT32 CModel3::Read32(UINT32 addr)
12521258
case 0xED:
12531259
case 0xEE:
12541260
case 0xEF:
1255-
return PCIBridge.ReadPCIConfigData(32,0);
1261+
if (PCIBridge.GetModel() == 0x106)
1262+
return PCIBridge.ReadPCIConfigData(32,0);
1263+
break;
12561264

12571265
// RTC
12581266
case 0x14:
@@ -1444,9 +1452,10 @@ void CModel3::Write8(UINT32 addr, UINT8 data)
14441452
}
14451453
goto Unknown8;
14461454

1447-
// MPC105/106
1455+
// MPC105
14481456
case 0xF8:
1449-
PCIBridge.WriteRegister(addr&0xFF,data);
1457+
if (PCIBridge.GetModel() == 0x105)
1458+
PCIBridge.WriteRegister(addr&0xFF,data);
14501459
break;
14511460

14521461
// 53C810 SCSI
@@ -1535,7 +1544,8 @@ void CModel3::Write16(UINT32 addr, UINT16 data)
15351544

15361545
// MPC105
15371546
case 0xC0: // F0C00CF8
1538-
PCIBridge.WritePCIConfigData(16,addr&2,data);
1547+
if (PCIBridge.GetModel() == 0x105)
1548+
PCIBridge.WritePCIConfigData(16,addr&2,data);
15391549
break;
15401550

15411551
// Unknown
@@ -1556,11 +1566,14 @@ void CModel3::Write16(UINT32 addr, UINT16 data)
15561566
}
15571567
goto Unknown16;
15581568

1559-
// MPC105/106
1569+
// MPC105
15601570
case 0xF8:
1561-
// Write in big endian order, like a real PowerPC
1562-
PCIBridge.WriteRegister((addr&0xFF)+0,data>>8);
1563-
PCIBridge.WriteRegister((addr&0xFF)+1,data&0xFF);
1571+
if (PCIBridge.GetModel() == 0x105)
1572+
{
1573+
// Write in big endian order, like a real PowerPC
1574+
PCIBridge.WriteRegister((addr&0xFF)+0,data>>8);
1575+
PCIBridge.WriteRegister((addr&0xFF)+1,data&0xFF);
1576+
}
15641577
break;
15651578

15661579
case 0xC0: // skichamp only
@@ -1672,8 +1685,9 @@ void CModel3::Write32(UINT32 addr, UINT32 data)
16721685
break;
16731686

16741687
// MPC105
1675-
case 0x80: // F0800CF8 (never observed at 0xFExxxxxx)
1676-
PCIBridge.WritePCIConfigAddress(data);
1688+
case 0x80: // F0800CF8
1689+
if (PCIBridge.GetModel() == 0x105)
1690+
PCIBridge.WritePCIConfigAddress(data);
16771691
break;
16781692

16791693
// MPC105/106
@@ -1693,11 +1707,11 @@ void CModel3::Write32(UINT32 addr, UINT32 data)
16931707
case 0xCD: case 0xDD: case 0xED:
16941708
case 0xCE: case 0xDE: case 0xEE:
16951709
case 0xCF: case 0xDF: case 0xEF:
1696-
if ((addr>=0xF0C00CF8) && (addr<0xF0C00D00)) // MPC105
1710+
if ((PCIBridge.GetModel() == 0x105) && (addr>=0xF0C00CF8) && (addr<0xF0C00D00)) // MPC105
16971711
PCIBridge.WritePCIConfigData(32,0,data);
1698-
else if ((addr>=0xFEC00000) && (addr<0xFEE00000)) // MPC106
1712+
else if ((PCIBridge.GetModel() == 0x106) && (addr>=0xFEC00000) && (addr<0xFEE00000)) // MPC106
16991713
PCIBridge.WritePCIConfigAddress(data);
1700-
else if ((addr>=0xFEE00000) && (addr<0xFEF00000)) // MPC106
1714+
else if ((PCIBridge.GetModel() == 0x106) && (addr>=0xFEE00000) && (addr<0xFEF00000)) // MPC106
17011715
PCIBridge.WritePCIConfigData(32,0,data);
17021716
break;
17031717

@@ -1754,13 +1768,16 @@ void CModel3::Write32(UINT32 addr, UINT32 data)
17541768

17551769
goto Unknown32;
17561770

1757-
// MPC105/106
1758-
case 0xF8: // F8FFF000-F8FFF100
1759-
// Write in big endian order, like a real PowerPC
1760-
PCIBridge.WriteRegister((addr&0xFF)+0,(data>>24)&0xFF);
1761-
PCIBridge.WriteRegister((addr&0xFF)+1,(data>>16)&0xFF);
1762-
PCIBridge.WriteRegister((addr&0xFF)+2,(data>>8)&0xFF);
1763-
PCIBridge.WriteRegister((addr&0xFF)+3,data&0xFF);
1771+
// MPC105
1772+
case 0xF8: // F8FFF000-F8FFF0FF
1773+
if (PCIBridge.GetModel() == 0x105)
1774+
{
1775+
// Write in big endian order, like a real PowerPC
1776+
PCIBridge.WriteRegister((addr&0xFF)+0,(data>>24)&0xFF);
1777+
PCIBridge.WriteRegister((addr&0xFF)+1,(data>>16)&0xFF);
1778+
PCIBridge.WriteRegister((addr&0xFF)+2,(data>>8)&0xFF);
1779+
PCIBridge.WriteRegister((addr&0xFF)+3,data&0xFF);
1780+
}
17641781
break;
17651782

17661783
// 53C810 SCSI
@@ -2923,16 +2940,6 @@ Result CModel3::LoadGame(const Game &game, const ROMSet &rom_set)
29232940
return Result::FAIL;
29242941
}
29252942

2926-
if (!game.pci_bridge.empty())
2927-
{
2928-
if (game.pci_bridge == "MPC105")
2929-
PCIBridge.SetModel(0x105);
2930-
else if (game.pci_bridge == "MPC106")
2931-
PCIBridge.SetModel(0x106);
2932-
else
2933-
ErrorLog("Unknown PCI bridge specified in ROM set definition file (%s). Defaulting to MPC%X.", game.pci_bridge.c_str(), PCIBridge.GetModel());
2934-
}
2935-
29362943
// Initialize CPU
29372944
ppc_init(&ppc_config);
29382945
ppc_attach_bus(this);

0 commit comments

Comments
 (0)