Is it possible to Decipher file structure from mips?
#31
Well i dont mind snoopy around on that as well cos I am quickly getting kengo fatigue
Reply

Sponsored links

#32
mini mips class for a function call:
* Put argument in a0/a1/a2/a3 regsiter
* Jump to the function with jalr (not function after the jump will be executed)

* Inside the function save some places on the stack: sp = sp - 100. The stack is the location of temporary variable.
* To access global data (or register) you need to load the address in 2 times (16 bits immediate value). It is often
lui reg, upperbit (load upper immediate)
addiu reg, lowerbit (add immediate unsigned).

* At the end of the function, set the returns value in v0/v1 registers.
* discard the stack: sp = sp + 100
* jr $ra (return address)

Note: often various register must be saved to handle nested function calls.
Note: register 0 (or r0) is hardwired to 0



A typical open on the PS2.
EE: create a RPC packet with the server ID, and the call ID. A return address is send too.
EE: Send the packet to IOP with SIF dma
EE: do others things and ultimately check the RPC/DMA status.
IOP: Receive a RPC packet, process it.
IOP: Oh my gosh the open function! Open file and copy data (SIF dma) to the return address (sent in the request packet).
IOP: Send another RPC packet to say jobs done.
Reply
#33
(06-07-2014, 03:44 PM)gregory Wrote: A typical open on the PS2.
EE: create a RPC packet with the server ID, and the call ID. A return address is send too.
EE: Send the packet to IOP with SIF dma
EE: do others things and ultimately check the RPC/DMA status.
IOP: Receive a RPC packet, process it.
IOP: Oh my gosh the open function! Open file and copy data (SIF dma) to the return address (sent in the request packet).
IOP: Send another RPC packet to say jobs done.

My only question is do we get to see this part in the debugger
Reply
#34
Code:
SIF1 DMA start...
Sif1: ProcessEETag
REFE 00000003
Sif 1: Write EE to Fifo
  SIF + 12 = 12 (pos=12)
  SIF - 4 = 8 (pos=4)
SIF 1 IOP: dest chain tag madr:00019500 wc:0008 id:4 irq:1
Sif 1: End EE
Sif1: Write Fifo to IOP
Sif 1 IOP doing transfer 0008 to 00019500
  SIF - 8 = 0 (pos=12)
Sif 1: End IOP
Reply
#35
The debugger is only on the ee side. You won't see anything on the iop side.

For sif, there is a special git branch. Current "sif log" is really low level. The branch will show you the high level rpc packet.
Reply
#36
Maybe i should take an holiday and come back to it. Thank you all who participated in this learning experience.
Reply
#37
There is wiki on the github project https://github.com/PCSX2/pcsx2
It would be interesting to create a summary and explanation of all your discovery. For example the header of the first bin file.
Reply
#38
Hi guys,
So I took a very long break and literally woke up with the answer to my question (sort of). I managed to see the patterns in just regular hex and I was able to decipher the structure of the data.

I just have to ask do people need to write data structures in special ways for faster DVD reads? What would be the purpose of a [short data, short padding] when you could just use an Int?

I am going to release everything once I figure out if I am 100% right.
Reply
#39
To expand on my earlier comment I have figured out the sequence of floats and ints in most file but not their uses
Reply
#40
I regret leaving this as I did cos I've had to learn it all over again.


I figured it out.
Kinda ashamed I let myself get confused easily
Reply




Users browsing this thread: 1 Guest(s)