2021-03-16 07:17:43 +00:00
|
|
|
// Project64 - A Nintendo 64 emulator
|
|
|
|
// http://www.pj64-emu.com/
|
|
|
|
// Copyright(C) 2001-2021 Project64
|
|
|
|
// Copyright(C) 2012 Bobby Smiles
|
|
|
|
// Copyright(C) 2009 Richard Goedeken
|
|
|
|
// Copyright(C) 2002 Hacktarux
|
|
|
|
// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
2016-04-28 07:09:44 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
#include <string.h>
|
|
|
|
|
2021-03-16 05:50:30 +00:00
|
|
|
/*
|
|
|
|
During IPL3 stage of CIC x105 games, the RSP performs some checks and transactions
|
|
|
|
necessary for booting the game.
|
|
|
|
|
|
|
|
We only implement the needed DMA transactions for booting.
|
|
|
|
|
|
|
|
Found in Banjo-Tooie, Zelda, Perfect Dark, ...)
|
|
|
|
*/
|
|
|
|
|
2016-04-28 07:09:44 +00:00
|
|
|
void cicx105_ucode(CHle * hle)
|
|
|
|
{
|
2021-03-16 05:50:30 +00:00
|
|
|
// memcpy is okay to use because access constraints are met (alignment, size)
|
2016-04-28 07:09:44 +00:00
|
|
|
unsigned int i;
|
|
|
|
unsigned char *dst = hle->dram() + 0x2fb1f0;
|
|
|
|
unsigned char *src = hle->imem() + 0x120;
|
|
|
|
|
2021-03-16 05:50:30 +00:00
|
|
|
// dma_read(0x1120, 0x1e8, 0x1e8)
|
2016-04-28 07:09:44 +00:00
|
|
|
memcpy(hle->imem() + 0x120, hle->dram() + 0x1e8, 0x1f0);
|
|
|
|
|
2021-03-16 05:50:30 +00:00
|
|
|
// dma_write(0x1120, 0x2fb1f0, 0xfe817000)
|
2016-04-28 07:09:44 +00:00
|
|
|
for (i = 0; i < 24; ++i)
|
|
|
|
{
|
|
|
|
memcpy(dst, src, 8);
|
|
|
|
dst += 0xff0;
|
|
|
|
src += 0x8;
|
|
|
|
}
|
2021-03-16 05:50:30 +00:00
|
|
|
}
|