Create Xref-Html Frames Remove All Frames
file:/home/jivera/wd/pcsx/PsxHLE.c (Tue Nov 25 22:46:14 2003
)
1: /* Pcsx - Pc Psx Emulator
2: * Copyright (C) 1999-2003 Pcsx Team
3: *
4: * This program is free software; you can redistribute it and/or modify
5: * it under the terms of the GNU General Public License as published by
6: * the Free Software Foundation; either version 2 of the License, or
7: * (at your option) any later version.
8: *
9: * This program is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU General Public License for more details.
13: *
14: * You should have received a copy of the GNU General Public License
15: * along with this program; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18:
19:
20: #include "PsxCommon.h"
21:
22: static void hleDummy() {
23: psxRegs.pc = psxRegs.GPR.n.ra;
24:
25: psxBranchTest();
26: }
27:
28: static void hleA0() {
29: u32 call = psxRegs.GPR.n.t1 & 0xff;
30:
31: if (biosA0[call]) biosA0[call]();
32:
33: psxBranchTest();
34: }
35:
36: static void hleB0() {
37: u32 call = psxRegs.GPR.n.t1 & 0xff;
38:
39: if (biosB0[call]) biosB0[call]();
40:
41: psxBranchTest();
42: }
43:
44: static void hleC0() {
45: u32 call = psxRegs.GPR.n.t1 & 0xff;
46:
47: if (biosC0[call]) biosC0[call]();
48:
49: psxBranchTest();
50: }
51:
52: static void hleBootstrap() { // 0xbfc00000
53: SysPrintf("hleBootstrap\n");
54: CheckCdrom();
55: LoadCdrom();
56: SysPrintf("CdromLabel: \"%s\": PC = %8.8lx (SP = %8.8lx)\n", CdromLabel, psxRegs.pc, psxRegs.GPR.n.sp);
57: }
58:
59: typedef struct {
60: unsigned long _pc0;
61: unsigned long gp0;
62: unsigned long t_addr;
63: unsigned long t_size;
64: unsigned long d_addr;
65: unsigned long d_size;
66: unsigned long b_addr;
67: unsigned long b_size;
68: unsigned long S_addr;
69: unsigned long s_size;
70: unsigned long _sp,_fp,_gp,ret,base;
71: } EXEC;
72:
73: static void hleExecRet() {
74: EXEC *header = (EXEC*)PSXM(psxRegs.GPR.n.s0);
75:
76: SysPrintf("ExecRet %x: %x\n", psxRegs.GPR.n.s0, header->ret);
77:
78: psxRegs.GPR.n.ra = header->ret;
79: psxRegs.GPR.n.sp = header->_sp;
80: psxRegs.GPR.n.s8 = header->_fp;
81: psxRegs.GPR.n.gp = header->_gp;
82: psxRegs.GPR.n.s0 = header->base;
83:
84: psxRegs.GPR.n.v0 = 1;
85: psxRegs.pc = psxRegs.GPR.n.ra;
86: }
87:
88: void (*psxHLEt[256])() = {
89: hleDummy, hleA0, hleB0, hleC0,
90: hleBootstrap, hleExecRet
91: };
92: /* arch-tag: Matthew Dempsky Wed Oct 15 10:34:49 CST 2003 (PsxHLE.c)
93: */
94:
Html form generated by Xrefactory version 1.6.4 on Fri Dec 12 20:52:56 2003
Trial version.