Jump to content

issues in MOS V2 format description?


K4thos

Recommended Posts

There's got to be an error in MOS V2 format description regarding offsets or length unless I'm missing something. Here is a loop I've coded using values based on IESDP:

COPY_EXISTING ~GMPCARBB.mos~ ~override~
    READ_SHORT 0xc "blocks_cnt" //Number of data blocks
    READ_SHORT 0xe "blocks_off" //Offset to data blocks
    FOR (cnt=0; cnt<"%blocks_cnt%"; cnt=cnt+1) BEGIN
        READ_LONG ("%blocks_off%"+0x1c*cnt) "PVRZ_page"
        PATCH_PRINT ~cnt = %cnt%, PVRZ_page = %PVRZ_page%~
    END
BUT_ONLY

And the result:

cnt = 0, PVRZ_page = 542330701

cnt = 1, PVRZ_page = 0

cnt = 2, PVRZ_page = 0

cnt = 3, PVRZ_page = 1
ERROR: illegal 4-byte read from offset 112 of 108-byte file GMPCARBB.mos
ERROR: [GMPCARBB.mos] -> [test] Patching Failed (COPY) (Failure("GMPCARBB.mos: read out of bounds"))
Link to comment

At the very least, there appear to be some typos on the page regarding offsets, but it looks like you accounted for that.

 

Data Block
Offset Size (data type) Description
0x0000 4 (dword) PVRZ page - Refers to MOSxxxx.PVRZ files, where xxxx is a zero-padded four-digits decimal number.
0x0004 4 (dword) Source x coordinate
0x0008 4 (dword) Source y coordinate
0x000a 4 (dword) Width
0x000c 4 (dword) Height
0x000e 4 (dword) Target x coordinate
0x000e 4 (dword) Target y coordinate

 

Should be:

Data Block

Offset Size (data type) Description
0x0000 4 (dword) PVRZ page - Refers to MOSxxxx.PVRZ files, where xxxx is a zero-padded four-digits decimal number.
0x0004 4 (dword) Source x coordinate
0x0008 4 (dword) Source y coordinate
0x000c 4 (dword) Width
0x0010 4 (dword) Height
0x0014 4 (dword) Target x coordinate
0x0018 4 (dword) Target y coordinate

 

Link to comment
At the very least, there appear to be some typos on the page regarding offsets, but it looks like you accounted for that.

 

Indeed, I've taken it into account with Data Block length. Didn't even notice those unusual offsets since I only need PVRZ page at data block offset 0 and got the 0x1c value by adding up all the dword sizes. Considering the loop doesn't work there have to be more errors in the description.

Link to comment

I did some testing, and it looks like some of the sizes in the header are incorrect.

 

 

MOS V2 Header

 

Offset Size (data type) Description

0x0000 4 (char array) Signature ('MOS ')

0x0004 4 (char array) Version ('V2 ')

0x0008 2 (word) Width (pixels)

0x000a 2 (word) Height (pixels)

0x000c 2 (word) Number of data blocks

0x000e 2 (word) Offset to data blocks

Should be:

 

 

MOS V2 Header

 

Offset Size (data type) Description

0x0000 4 (char array) Signature ('MOS ')

0x0004 4 (char array) Version ('V2 ')

0x0008 4 (dword) Width (pixels)

0x000c 4 (dword) Height (pixels)

0x0010 4 (dword) Number of data blocks

0x0014 4 (dword) Offset to data blocks

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...