diff options
author | Alexis PUSKARCZYK | 2016-12-19 10:18:15 +0100 |
---|---|---|
committer | Alexis PUSKARCZYK | 2016-12-19 10:18:15 +0100 |
commit | ea4db4b5e14d27f9820cc72ecc7b244c1c2b9cb9 (patch) | |
tree | 1c711b85837e96914b692778376f7cf2dc51927f /libpcsxcore/new_dynarec/backends/psx/pcsxmem_inline.c | |
parent | 127622a0091a7a54c8c32069bdd262ad6d402b16 (diff) | |
parent | 30373a821c80e223d5c592ccce95377ff57b4998 (diff) | |
download | pcsx_rearmed-ea4db4b5e14d27f9820cc72ecc7b244c1c2b9cb9.tar.gz pcsx_rearmed-ea4db4b5e14d27f9820cc72ecc7b244c1c2b9cb9.tar.bz2 pcsx_rearmed-ea4db4b5e14d27f9820cc72ecc7b244c1c2b9cb9.zip |
Merge branch 'master' of https://github.com/libretro/pcsx_rearmed into master_merged
Diffstat (limited to 'libpcsxcore/new_dynarec/backends/psx/pcsxmem_inline.c')
-rw-r--r-- | libpcsxcore/new_dynarec/backends/psx/pcsxmem_inline.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/libpcsxcore/new_dynarec/backends/psx/pcsxmem_inline.c b/libpcsxcore/new_dynarec/backends/psx/pcsxmem_inline.c new file mode 100644 index 0000000..305931a --- /dev/null +++ b/libpcsxcore/new_dynarec/backends/psx/pcsxmem_inline.c @@ -0,0 +1,66 @@ +/* + * (C) GraÅžvydas "notaz" Ignotas, 2011 + * + * This work is licensed under the terms of GNU GPL version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef DRC_DBG + +static int pcsx_direct_read(int type, u_int addr, int cc_adj, int cc, int rs, int rt) +{ + if ((addr & 0xfffff000) == 0x1f801000) { + u_int t; + switch (addr & 0xffff) { + case 0x1120: // rcnt2 count + if (rt < 0) goto dont_care; + if (cc < 0) return 0; + emit_readword((int)&rcnts[2].mode, HOST_TEMPREG); + emit_readword((int)&rcnts[2].cycleStart, rt); + emit_testimm(HOST_TEMPREG, 0x200); + emit_readword((int)&last_count, HOST_TEMPREG); + emit_sub(HOST_TEMPREG, rt, HOST_TEMPREG); + emit_add(HOST_TEMPREG, cc, HOST_TEMPREG); + if (cc_adj) + emit_addimm(HOST_TEMPREG, cc_adj, rt); + emit_shrne_imm(rt, 3, rt); + mov_loadtype_adj(type!=LOADW_STUB?type:LOADH_STUB, rt, rt); + goto hit; + case 0x1104: + case 0x1114: + case 0x1124: // rcnt mode + if (rt < 0) return 0; + t = (addr >> 4) & 3; + emit_readword((int)&rcnts[t].mode, rt); + emit_andimm(rt, ~0x1800, HOST_TEMPREG); + emit_writeword(HOST_TEMPREG, (int)&rcnts[t].mode); + mov_loadtype_adj(type, rt, rt); + goto hit; + } + } + else { + if (rt < 0) + goto dont_care; + } + + return 0; + +hit: + assem_debug("pcsx_direct_read %08x end\n", addr); + return 1; + +dont_care: + assem_debug("pcsx_direct_read %08x dummy\n", addr); + return 1; +} + +#else + +static int pcsx_direct_read(int type, u_int addr, int cc_adj, int cc, int rs, int rt) +{ + return 0; +} + +#endif + +// vim:shiftwidth=2:expandtab |