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.
8 static int pcsx_direct_read(int type, u_int addr, int cc_adj, int cc, int rs, int rt)
10 if ((addr & 0xfffff000) == 0x1f801000) {
12 switch (addr & 0xffff) {
13 case 0x1120: // rcnt2 count
14 if (rt < 0) goto dont_care;
16 emit_readword((int)&rcnts[2].mode, HOST_TEMPREG);
17 emit_readword((int)&rcnts[2].cycleStart, rt);
18 emit_testimm(HOST_TEMPREG, 0x200);
19 emit_readword((int)&last_count, HOST_TEMPREG);
20 emit_sub(HOST_TEMPREG, rt, HOST_TEMPREG);
21 emit_add(HOST_TEMPREG, cc, HOST_TEMPREG);
23 emit_addimm(HOST_TEMPREG, cc_adj, rt);
24 emit_shrne_imm(rt, 3, rt);
25 mov_loadtype_adj(type!=LOADW_STUB?type:LOADH_STUB, rt, rt);
29 case 0x1124: // rcnt mode
32 emit_readword((int)&rcnts[t].mode, rt);
33 emit_andimm(rt, ~0x1800, HOST_TEMPREG);
34 emit_writeword(HOST_TEMPREG, (int)&rcnts[t].mode);
35 mov_loadtype_adj(type, rt, rt);
47 assem_debug("pcsx_direct_read %08x end\n", addr);
51 assem_debug("pcsx_direct_read %08x dummy\n", addr);
55 // vim:shiftwidth=2:expandtab