Author Topic: Reading to and writing from disc images for the PS1  (Read 2069 times)

MysticLord

  • *
  • Posts: 79
    • View Profile
I recently wrote code that handles I/O for PS1 disc images.  You can find it here: https://bitbucket.org/MysticLord/snakeoil/src

I'm posting here so that other people can use my code to make editors for PS1 games and improve the existing ones.  You can use any of my code posted here with any license you want, though as a Linux user I prefer you use an open source license like the BSD or MIT licenses.  I am happy to answer questions about the code, Java, or anything you don't understand.

The classes and files which are relevant to implementing disc image I/O are covered below.



DataHandler.java: methods readFromDiscImage(...) and writeToDiscImage(...).  This is almost all the logic for handling data and file I/O.  It's a little involved, so if you have questions please ask them so I can add better comments.  I also want to write a series of blog posts about disc image I/O; questions will help me determine what is easiest to understand and what isn't.  Also I'm aware that this isn't "proper" java and honestly I don't care.  Object-Orientation is a meme to me.

EDC_ECC_Generator.java: everything in this file is a translation of a python program by abyssonym (which itself is a translation of a C program), which is here: https://github.com/abyssonym/randomtools/blob/master/cdrom_ecc.py

AbstractDataTable: this class and its subclasses are used to store information about data tables.  I needed separate logic to handle data tables that are found at specific addresses in a file, those that are pointer-addressed from elsewhere in a file, those that are always the same length, and those that are variable length.  The actual logic is in DataHandler, but these classes all need to store different information depending on their type.

data.csv: This is where information on data tables is stored, and later read into DataHandler.

L2sq.txt and EDC_crctable.txt: these files are needed to generate EDC and ECC.  Straight copies from abyssonym: https://github.com/abyssonym/randomtools
« Last Edit: 2019-06-11 01:14:29 by MysticLord »