Writing an assembler for the PS1
Writing an assembler for the PS1
I'm writing an assembler and a disassembler for the PS1. I want them to be the end-all, be-all of PS1 (dis)assemblers.
Questions:
1. The specific instruction set used by the PS1 is MIPS r3000, correct?
2. Are there any additional operations that a PS1 assembler should support? Operations such as reading from a disc image, writing to a memory card, communicating with the GPU, or what what have you.
3. If there are, where can I find more info about them?
4. What open source assemblers and disassemblers exist for the PS1?
5. What advice do you have for me?
Questions:
1. The specific instruction set used by the PS1 is MIPS r3000, correct?
2. Are there any additional operations that a PS1 assembler should support? Operations such as reading from a disc image, writing to a memory card, communicating with the GPU, or what what have you.
3. If there are, where can I find more info about them?
4. What open source assemblers and disassemblers exist for the PS1?
5. What advice do you have for me?
-
CodeAsm Verified
- Active PSXDEV User
- Posts: 71
- Joined: Jan 13, 2012
- I am a: Programmer, Student
- Location: The Netherlands
- Contact:
isnt the GNU toolset good enough? (also I think they contain any hits you might need. tho you might want to write macros for like "Operations such as reading from a disc image, writing to a memory card, communicating with the GPU, or what what have you."
further im just a noob, I only know I probably could write in assembler using the GNU tools for MIPS
further im just a noob, I only know I probably could write in assembler using the GNU tools for MIPS
Development Console: SCPH-102, unkown clone Modchip, PAL , FTDI board build into the case (microUSB) for Serial I/O.
Development Computer: GNU/Linux, Arch x86_64 Linux 4.20.3, i7-3632QM [8x3.2GHz], 11,8GiB, 1366x768 GeForce GT 630M (Optimus tech), lots of gig of storage
Development Computer: GNU/Linux, Arch x86_64 Linux 4.20.3, i7-3632QM [8x3.2GHz], 11,8GiB, 1366x768 GeForce GT 630M (Optimus tech), lots of gig of storage
For all needed info check nocash's site, he did comprehensive PS1 research and documented it very well, he also made very advanced PS1 emulator with debugger, though it's not perfect. Also you can use IDApro for disassembling PS1 games if you need reference source for your own work, though I doubt that if you write your disassembler then it will be better than IDA's and yet maybe for someone it still be useful so I won't stop you from doing that . Also on romchaking.net you can find some assembly tools and check them if you want.
http://problemkaputt.de/psx-spx.htm
I want to write a (dis)assembler that supports literally every opcode you would find in a PS1 game. This includes opcodes that deal with cd-rom seeks, reads, and writes, and anything else that you will find.
I want to write a (dis)assembler that supports literally every opcode you would find in a PS1 game. This includes opcodes that deal with cd-rom seeks, reads, and writes, and anything else that you will find.
-
Verified
- Legendary Programmer
- Posts: 256
- Joined: Aug 13, 2012
- I am a: Programmer
- PlayStation Model: Net Yaroze
- Location: France
- Contact:
well, maybe you should learn first what "assembler" is, because such opcodes doesn't exist.
assembler is related to the CPU of the machine, it has nothing to do with CD ROM which is another peripheral to which you talk through specific addresses.
assembler is related to the CPU of the machine, it has nothing to do with CD ROM which is another peripheral to which you talk through specific addresses.
Retro game development on Playstation and other consoles http://orionsoft.free.fr/
So the functions cdrom setloc, read, and write referenced in this post are not actual opcodes but something else entirely?
https://www.romhacking.net/forum/index. ... #msg266131
https://courses.missouristate.edu/KenVo ... lHelp.html
^An example of syscall parameters on the MARS mips emulator.
http://psx.rules.org/system.txt
^Seems to be what I'm looking for, if anyone wants to verify.
https://stackoverflow.com/questions/203 ... nstruction
^A guy verifies that syscall was used to execute math calculations on a vector processing unit.
https://www.romhacking.net/forum/index. ... #msg266131
Are these functions the result of a call to syscall? Where can I find a complete listing of mips opcodes (and their parameters) that the PS1 supports?How do you find these LBA tables? Well you need to run pSX with logging enabled and you need to log all CDROM IO. now just play the game as normal and save the log. Any time you see a line in the log such as
[015b009c] cdrom: setloc 00000000:00000002:00000005
it will be closely followed by lines such as these
[015b00a4] cdrom: read byte 07801800 = 09 (800584dc)
[015b00a4] cdrom: write byte 07801800 = 01 (800584ec)
Those address in the brackets
(800584dc)
(800584ec)
Are a part of the function "setloc". mark the entry point of that function in your disassembly.
https://courses.missouristate.edu/KenVo ... lHelp.html
^An example of syscall parameters on the MARS mips emulator.
http://psx.rules.org/system.txt
^Seems to be what I'm looking for, if anyone wants to verify.
https://stackoverflow.com/questions/203 ... nstruction
^A guy verifies that syscall was used to execute math calculations on a vector processing unit.
-
CodeAsm Verified
- Active PSXDEV User
- Posts: 71
- Joined: Jan 13, 2012
- I am a: Programmer, Student
- Location: The Netherlands
- Contact:
I have no idea if this is any good: http://chortle.ccsu.edu/assemblytutorial/
I dont speak Mips assembly (yet) but @Orion_ seems to be right here, "what is an assembler" what does it do?
What is machine language... what do those bytes mean when you look at a executable? can you write those yourself?
And how do you call a function you created yourself from another part of your code?
can you call a "kernel" function? I think all those questions will be answered if I study assembly and use a assmbler before I would write my own assembler. (I want to, for a Z80, but have to understand the language of the cpu first, its default/common used tools first)
Or, you start with a few simple instructions and write an asembler for those first and hope the PS1 accepts your binairy. https://vhouten.home.xs4all.nl/mipsel/r3000-isa.html my head spins already
I dont speak Mips assembly (yet) but @Orion_ seems to be right here, "what is an assembler" what does it do?
What is machine language... what do those bytes mean when you look at a executable? can you write those yourself?
And how do you call a function you created yourself from another part of your code?
can you call a "kernel" function? I think all those questions will be answered if I study assembly and use a assmbler before I would write my own assembler. (I want to, for a Z80, but have to understand the language of the cpu first, its default/common used tools first)
Or, you start with a few simple instructions and write an asembler for those first and hope the PS1 accepts your binairy. https://vhouten.home.xs4all.nl/mipsel/r3000-isa.html my head spins already
Development Console: SCPH-102, unkown clone Modchip, PAL , FTDI board build into the case (microUSB) for Serial I/O.
Development Computer: GNU/Linux, Arch x86_64 Linux 4.20.3, i7-3632QM [8x3.2GHz], 11,8GiB, 1366x768 GeForce GT 630M (Optimus tech), lots of gig of storage
Development Computer: GNU/Linux, Arch x86_64 Linux 4.20.3, i7-3632QM [8x3.2GHz], 11,8GiB, 1366x768 GeForce GT 630M (Optimus tech), lots of gig of storage
-
Verified
- Legendary Programmer
- Posts: 256
- Joined: Aug 13, 2012
- I am a: Programmer
- PlayStation Model: Net Yaroze
- Location: France
- Contact:
you should try to learn the assembler language and write some assembler code for the PS1 before writing an assembler yourself.
there are some asm source for PS1 on this page in the MISC section: http://hitmen.c02.at/html/psx_sources.html
there are some asm source for PS1 on this page in the MISC section: http://hitmen.c02.at/html/psx_sources.html
Retro game development on Playstation and other consoles http://orionsoft.free.fr/
I'm a programmer, the best way to learn MIPS is to write an assembler. It doesn't seem very hard. I need to know exactly what bits are set with each opcode and all their possible parameters, and what opcodes the PS1 supports.
Labels seem straight-forward.
For a disassembler, I want a way to make it read certain things as something other than assembly - maybe as a table of bytes. How I get it to do that is my problem.
My goal for the disassembler is to have something where once you know everything there is to know about a file, you can feed it everything you know and it will output something that you can assemble and get the exact same file back.
Depending on how I implement the opcode table I can see it being extensible.
Anyways, my questions are:
1. What opcodes doe the PS1 support?
2. What are the parameters for those opcodes not found in general purpose MIPS documents?
Probably the only people who could answer these questions are gemini and nocash.
Labels seem straight-forward.
For a disassembler, I want a way to make it read certain things as something other than assembly - maybe as a table of bytes. How I get it to do that is my problem.
My goal for the disassembler is to have something where once you know everything there is to know about a file, you can feed it everything you know and it will output something that you can assemble and get the exact same file back.
Depending on how I implement the opcode table I can see it being extensible.
Anyways, my questions are:
1. What opcodes doe the PS1 support?
2. What are the parameters for those opcodes not found in general purpose MIPS documents?
Probably the only people who could answer these questions are gemini and nocash.
-
Verified
- Legendary Programmer
- Posts: 256
- Joined: Aug 13, 2012
- I am a: Programmer
- PlayStation Model: Net Yaroze
- Location: France
- Contact:
have fun http://problemkaputt.de/psx-spx.htm#cpuspecifications
and here you have some opcode table: http://drhell.web.fc2.com/ps1/index.html
and here you have some opcode table: http://drhell.web.fc2.com/ps1/index.html
Retro game development on Playstation and other consoles http://orionsoft.free.fr/
Who is online
Users browsing this forum: No registered users and 1 guest