What's new

Problems with Storing Loading memory.

Frederic

MisterCarrot : O64 Coder
I know I don't have to post it here but I don't know where else.
(Please to be indulgent)

* Value = *(BYTE *)(RSPInfo.DMEM + ((Addr ^ 3) & 0xFFF)) ;

I'm asking my self for the ^ 3 operation.

What is the aim of this operation ?
Where are TLB routines ?
 

zilmar

Emulator Developer
Moderator
a couple of points.
0. This operation is to move one byte from dmem at the value in addr to store in the variable value.
1. This is rsp code, the rsp has no tlb, it can only access DMEM which is 1k. eg from 0 to 0xFFF, this is where the "& 0xFFF " comes from.

2. This is from an emulator run on a PC, the PC has a different memory layout, so to make it faster each DWORD on a 32 byte boundry is swaped

1 2 3 4 becomes 4 3 2 1

so if I want to get one byte I actually want another one

byte - Real byte
0 xor 3 = 3
1 xor 3 = 2
2 xor 3 = 1
3 xor 3 = 0

so the "^3" just translates to the byte location

Does this answer what you want to know?
 
OP
Frederic

Frederic

MisterCarrot : O64 Coder
Yes, thank you.
I known about memory layout but I didn't understand what the ^3 mean.
 
OP
Frederic

Frederic

MisterCarrot : O64 Coder
Oh no !
I understand now the problem. I believed that RSP and R4300i were the same ! It's the reason why I didn't understand some part of code.
So i have to create 2 interpretors, One for the R4300 and another for rsp with is nearly the same of R4300i.
 

zilmar

Emulator Developer
Moderator
Frederic said:
Oh no !
I understand now the problem. I believed that RSP and R4300i were the same ! It's the reason why I didn't understand some part of code.
So i have to create 2 interpretors, One for the R4300 and another for rsp with is nearly the same of R4300i.

well pj64 really is the only one with an RSP cpu, most just do high level to do what the rsp does
 

Top