PSYQ object VS ELF object

vbt

Staff member
i'm trying to rebuild some psyq code without using psymake, asmsh & ccsh. the issue is it uses libraries with psyq's object format and they can't be used by a modern compiler/assembler. for some libraries there are no sources, i can just extract object from lib. would there be a way to convert a .obj (psyq) to .o (cof or elf) ? psygnosis provided a converter from coff to psyq.

image.png


psyq asm (close.s) :
Code:
    opt    c+

    section    .text

; int close(int fd)
;               r4

    xdef    PCclose

PCclose:
    mov.l    #3,r0    ; fsCLOSE
    trapa    #$23

    rts
    nop

    end

gnu as (close.s)

Code:
 .text

.global _PCclose
_PCclose:
    mov    #3,r0
    trapa    #0x23

    rts
    nop
 
The object format is probably going to be very similar across all Psy-Q targets, so you could try looking into if eg. the N64 or PSX scene has documented it. IDA claims to understand Playstation Psy-Q objects and executables.
 
  • Like
Reactions: vbt
Back
Top