2009-07-28 21:32:10 +00:00
|
|
|
// Copyright (C) 2003 Dolphin Project.
|
2008-12-08 05:25:12 +00:00
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official SVN repository and contact information can be found at
|
|
|
|
// http://code.google.com/p/dolphin-emu/
|
|
|
|
|
|
|
|
#include "../Globals.h"
|
|
|
|
|
|
|
|
#include "UCodes.h"
|
|
|
|
|
|
|
|
#include "UCode_AX.h"
|
|
|
|
#include "UCode_AXWii.h"
|
|
|
|
#include "UCode_Zelda.h"
|
|
|
|
#include "UCode_ROM.h"
|
|
|
|
#include "UCode_CARD.h"
|
|
|
|
#include "UCode_InitAudioSystem.h"
|
|
|
|
|
|
|
|
IUCode* UCodeFactory(u32 _CRC, CMailHandler& _rMailHandler)
|
|
|
|
{
|
|
|
|
switch (_CRC)
|
|
|
|
{
|
2009-02-02 20:05:24 +00:00
|
|
|
case UCODE_ROM:
|
2009-07-01 20:55:43 +00:00
|
|
|
INFO_LOG(DSPHLE, "Switching to ROM ucode");
|
2009-02-02 20:05:24 +00:00
|
|
|
return new CUCode_Rom(_rMailHandler);
|
|
|
|
|
|
|
|
case UCODE_INIT_AUDIO_SYSTEM:
|
2009-07-01 20:55:43 +00:00
|
|
|
INFO_LOG(DSPHLE, "Switching to INIT ucode");
|
2009-02-02 20:05:24 +00:00
|
|
|
return new CUCode_InitAudioSystem(_rMailHandler);
|
|
|
|
|
|
|
|
case 0x65d6cc6f: // CARD
|
2009-07-01 20:55:43 +00:00
|
|
|
INFO_LOG(DSPHLE, "Switching to CARD ucode");
|
2009-02-02 20:05:24 +00:00
|
|
|
return new CUCode_CARD(_rMailHandler);
|
|
|
|
|
2009-06-28 11:47:39 +00:00
|
|
|
case 0x3ad3b7ac: // Naruto3, Paper Mario - The Thousand Year Door
|
2009-02-02 20:05:24 +00:00
|
|
|
case 0x3daf59b9: // Alien Hominid
|
2009-06-28 11:47:39 +00:00
|
|
|
case 0x4e8a8b21: // spdemo, ctaxi, 18 wheeler, disney, monkeyball 1/2,cubivore,puzzlecollection,wario,
|
2009-02-02 20:05:24 +00:00
|
|
|
// capcom vs snk, naruto2, lost kingdoms, star fox, mario party 4, mortal kombat,
|
|
|
|
// smugglers run warzone, smash brothers, sonic mega collection, ZooCube
|
|
|
|
// nddemo, starfox
|
|
|
|
case 0x07f88145: // bustamove, ikaruga, fzero, robotech battle cry, star soldier, soul calibur2,
|
|
|
|
// Zelda:OOT, Tony hawk, viewtiful joe
|
|
|
|
case 0xe2136399: // billy hatcher, dragonballz, mario party 5, TMNT, ava1080
|
2009-07-01 20:55:43 +00:00
|
|
|
INFO_LOG(DSPHLE, "CRC %08x: AX ucode chosen", _CRC);
|
2009-02-02 20:05:24 +00:00
|
|
|
return new CUCode_AX(_rMailHandler);
|
|
|
|
|
2009-05-02 16:15:52 +00:00
|
|
|
case 0x088e38a5: // IPL - JAP
|
|
|
|
case 0xd73338cf: // IPL
|
2009-06-28 10:00:25 +00:00
|
|
|
case 0x42f64ac4: // Luigi
|
|
|
|
case 0x4be6a5cb: // AC, Pikmin
|
2009-07-01 20:55:43 +00:00
|
|
|
INFO_LOG(DSPHLE, "CRC %08x: JAC (early Zelda) ucode chosen", _CRC);
|
2009-07-11 13:57:21 +00:00
|
|
|
return new CUCode_Zelda(_rMailHandler, _CRC);
|
2009-05-02 16:15:52 +00:00
|
|
|
|
2009-02-02 20:05:24 +00:00
|
|
|
case 0x6CA33A6D: // DK Jungle Beat
|
2009-06-21 08:39:21 +00:00
|
|
|
case 0x86840740: // Zelda WW - US
|
2009-06-20 10:39:45 +00:00
|
|
|
case 0x56d36052: // Mario Sunshine
|
|
|
|
case 0x2fcdf1ec: // Mario Kart, zelda 4 swords
|
2009-08-24 04:04:10 +00:00
|
|
|
case 0x267fd05a: // Pikmin PAL
|
2009-07-01 20:55:43 +00:00
|
|
|
INFO_LOG(DSPHLE, "CRC %08x: Zelda ucode chosen", _CRC);
|
2009-06-28 14:22:51 +00:00
|
|
|
return new CUCode_Zelda(_rMailHandler, _CRC);
|
2009-02-02 20:05:24 +00:00
|
|
|
|
|
|
|
// WII CRCs
|
2009-08-12 01:15:57 +00:00
|
|
|
case 0xb7eb9a9c: // Wii Pikmin - PAL
|
|
|
|
case 0xeaeb38cc: // Wii Pikmin 2 - PAL
|
2009-02-02 20:05:24 +00:00
|
|
|
case 0x6c3f6f94: // zelda - PAL
|
2009-03-08 21:12:02 +00:00
|
|
|
case 0xd643001f: // mario galaxy - PAL
|
2009-07-01 20:55:43 +00:00
|
|
|
INFO_LOG(DSPHLE, "CRC %08x: Zelda Wii ucode chosen\n", _CRC);
|
2009-06-28 14:22:51 +00:00
|
|
|
return new CUCode_Zelda(_rMailHandler, _CRC);
|
2009-02-02 20:05:24 +00:00
|
|
|
|
2009-08-30 19:51:16 +00:00
|
|
|
case 0x2ea36ce6: // Some Wii demos
|
2009-02-04 07:40:37 +00:00
|
|
|
case 0x5ef56da3: // AX demo
|
|
|
|
case 0x347112ba: // raving rabbits
|
|
|
|
case 0xfa450138: // wii sports - PAL
|
|
|
|
case 0xadbc06bd: // Elebits
|
2009-02-27 23:44:15 +00:00
|
|
|
case 0x4cc52064: // Bleach: Versus Crusade
|
2009-08-24 04:04:10 +00:00
|
|
|
case 0xd9c4bf34: // WiiMenu
|
2009-07-01 20:55:43 +00:00
|
|
|
INFO_LOG(DSPHLE, "CRC %08x: Wii - AXWii chosen", _CRC);
|
2009-02-04 07:40:37 +00:00
|
|
|
return new CUCode_AXWii(_rMailHandler, _CRC);
|
|
|
|
|
2009-02-02 20:05:24 +00:00
|
|
|
default:
|
2009-05-02 16:15:52 +00:00
|
|
|
PanicAlert("DSPHLE: Unknown ucode (CRC = %08x) - forcing AX/AXWii.\n\nTry LLE plugin if this is homebrew.", _CRC);
|
|
|
|
if (g_dspInitialize.bWii)
|
2009-02-02 20:05:24 +00:00
|
|
|
return new CUCode_AXWii(_rMailHandler, _CRC);
|
|
|
|
return new CUCode_AX(_rMailHandler);
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|