Path: blob/master/libmupen64plus/mupen64plus-rsp-hle/src/cicx105.c
2 views
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *1* Mupen64plus-rsp-hle - cicx105.c *2* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *3* Copyright (C) 2012 Bobby Smiles *4* Copyright (C) 2009 Richard Goedeken *5* Copyright (C) 2002 Hacktarux *6* *7* This program is free software; you can redistribute it and/or modify *8* it under the terms of the GNU General Public License as published by *9* the Free Software Foundation; either version 2 of the License, or *10* (at your option) any later version. *11* *12* This program is distributed in the hope that it will be useful, *13* but WITHOUT ANY WARRANTY; without even the implied warranty of *14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *15* GNU General Public License for more details. *16* *17* You should have received a copy of the GNU General Public License *18* along with this program; if not, write to the *19* Free Software Foundation, Inc., *20* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *21* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */2223#include <string.h>2425#include "hle.h"2627/**28* During IPL3 stage of CIC x105 games, the RSP performs some checks and transactions29* necessary for booting the game.30*31* We only implement the needed DMA transactions for booting.32*33* Found in Banjo-Tooie, Zelda, Perfect Dark, ...)34**/35void cicx105_ucode()36{37// memcpy is okay to use because access constrains are met (alignment, size)38unsigned int i;39unsigned char * dst = rsp.RDRAM + 0x2fb1f0;40unsigned char * src = rsp.IMEM + 0x120;4142/* dma_read(0x1120, 0x1e8, 0x1e8) */43memcpy(rsp.IMEM + 0x120, rsp.RDRAM + 0x1e8, 0x1f0);4445/* dma_write(0x1120, 0x2fb1f0, 0xfe817000) */46for (i = 0; i < 24; ++i)47{48memcpy(dst, src, 8);49dst += 0xff0;50src += 0x8;5152}53}54555657