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 17, 2024
1 parent b1e476e commit 2bf0f5e
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 @@ -246,14 +246,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 @@ -352,9 +344,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 @@ -386,9 +376,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 @@ -447,9 +435,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 @@ -509,9 +495,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 @@ -565,9 +549,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 @@ -645,9 +627,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 2bf0f5e

Please sign in to comment.