Skip to content

Commit

Permalink
Remove kunseg for pgxp rw, since lightrec_rw does that now
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachCook committed Sep 16, 2024
1 parent 59e0e2c commit 1f36680
Showing 1 changed file with 6 additions and 26 deletions.
32 changes: 6 additions & 26 deletions mednafen/psx/cpu_lightrec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,6 @@ pscpu_timestamp_t PS_CPU_LIGHTREC::Run(pscpu_timestamp_t timestamp_in, bool BIOS
# define HTOLE16(x) (x)
#endif

static inline u32 kunseg(u32 addr)
{
if (MDFN_UNLIKELY(addr >= 0xa0000000))
return addr - 0xa0000000;
else
return addr &~ 0x80000000;
}

enum opcodes {
OP_SPECIAL = 0x00,
OP_REGIMM = 0x01,
Expand Down Expand Up @@ -355,9 +347,7 @@ void PS_CPU_LIGHTREC::pgxp_hw_write_byte(struct lightrec_state *state,
{
pscpu_timestamp_t timestamp = lightrec_current_cycle_count(state) - cpu_timestamp;

u32 kmem = kunseg(mem);

PSX_MemWrite8(timestamp, kmem, val);
PSX_MemWrite8(timestamp, mem, val);

PGXP_CPU_SB(opcode, val, mem);

Expand Down Expand Up @@ -389,9 +379,7 @@ void PS_CPU_LIGHTREC::pgxp_hw_write_half(struct lightrec_state *state,
{
pscpu_timestamp_t timestamp = lightrec_current_cycle_count(state) - cpu_timestamp;

u32 kmem = kunseg(mem);

PSX_MemWrite16(timestamp, kmem, val);
PSX_MemWrite16(timestamp, mem, val);

PGXP_CPU_SH(opcode, val, mem);

Expand Down Expand Up @@ -450,9 +438,7 @@ void PS_CPU_LIGHTREC::pgxp_hw_write_word(struct lightrec_state *state,
{
pscpu_timestamp_t timestamp = lightrec_current_cycle_count(state) - cpu_timestamp;

u32 kmem = kunseg(mem);

PSX_MemWrite32(timestamp, kmem, val);
PSX_MemWrite32(timestamp, mem, val);

switch (opcode >> 26){
case OP_SWL:
Expand Down Expand Up @@ -512,9 +498,7 @@ u8 PS_CPU_LIGHTREC::pgxp_hw_read_byte(struct lightrec_state *state,

pscpu_timestamp_t timestamp = lightrec_current_cycle_count(state) - cpu_timestamp;

u32 kmem = kunseg(mem);

val = PSX_MemRead8(timestamp, kmem);
val = PSX_MemRead8(timestamp, mem);

if((opcode >> 26) == OP_LB)
PGXP_CPU_LB(opcode, val, mem);
Expand Down Expand Up @@ -568,9 +552,7 @@ u16 PS_CPU_LIGHTREC::pgxp_hw_read_half(struct lightrec_state *state,

pscpu_timestamp_t timestamp = lightrec_current_cycle_count(state) - cpu_timestamp;

u32 kmem = kunseg(mem);

val = PSX_MemRead16(timestamp, kmem);
val = PSX_MemRead16(timestamp, mem);

if((opcode >> 26) == OP_LH)
PGXP_CPU_LH(opcode, val, mem);
Expand Down Expand Up @@ -648,9 +630,7 @@ u32 PS_CPU_LIGHTREC::pgxp_hw_read_word(struct lightrec_state *state,

pscpu_timestamp_t timestamp = lightrec_current_cycle_count(state) - cpu_timestamp;

u32 kmem = kunseg(mem);

val = PSX_MemRead32(timestamp, kmem);
val = PSX_MemRead32(timestamp, mem);

switch (opcode >> 26){
case OP_LWL:
Expand Down

0 comments on commit 1f36680

Please sign in to comment.