2 * (C) GraÅžvydas "notaz" Ignotas, 2011
4 * This work is licensed under the terms of GNU GPL version 2 or later.
5 * See the COPYING file in the top-level directory.
10 static int pcsx_direct_read(int type, u_int addr, int cc_adj, int cc, int rs, int rt)
12 if ((addr & 0xfffff000) == 0x1f801000) {
14 switch (addr & 0xffff) {
15 case 0x1120: // rcnt2 count
16 if (rt < 0) goto dont_care;
18 emit_readword((int)&rcnts[2].mode, HOST_TEMPREG);
19 emit_readword((int)&rcnts[2].cycleStart, rt);
20 emit_testimm(HOST_TEMPREG, 0x200);
21 emit_readword((int)&last_count, HOST_TEMPREG);
22 emit_sub(HOST_TEMPREG, rt, HOST_TEMPREG);
23 emit_add(HOST_TEMPREG, cc, HOST_TEMPREG);
25 emit_addimm(HOST_TEMPREG, cc_adj, rt);
26 emit_shrne_imm(rt, 3, rt);
27 mov_loadtype_adj(type!=LOADW_STUB?type:LOADH_STUB, rt, rt);
31 case 0x1124: // rcnt mode
34 emit_readword((int)&rcnts[t].mode, rt);
35 emit_andimm(rt, ~0x1800, HOST_TEMPREG);
36 emit_writeword(HOST_TEMPREG, (int)&rcnts[t].mode);
37 mov_loadtype_adj(type, rt, rt);
49 assem_debug("pcsx_direct_read %08x end\n", addr);
53 assem_debug("pcsx_direct_read %08x dummy\n", addr);
59 static int pcsx_direct_read(int type, u_int addr, int cc_adj, int cc, int rs, int rt)
66 // vim:shiftwidth=2:expandtab