Class TOC

java.lang.Object
  extended byTOC

public class TOC
extends java.lang.Object

This class implements the rombank Table Of Contents, which, according to Allan Blomquist is something like this: "The rombank format is really simple. the first part is a TOC with each game having a 32 byte entry. the first 28 bytes are the title of the game and the last 4 bytes are a 32 bit, little endian word, the lower 20 bits of which are the sector offset that the game starts at and the upper 12 bits are the size of the game in sectors (a sector is 0x800 bytes). terminate the TOC with an extra entry with the first byte of the title set to 255. then starting with the next sector after the TOC, you just put all the games. that's about all there is too it. i'd recommend making a simple rombank.bin with a few games and just looking at it with a hex editor. i think everything i wrote here (off the top of my head) should match up..."


Constructor Summary
TOC(RomsList roms)
          Class constructor.
 
Method Summary
 int getSizePos(int index)
          This method returns the size of the rom in sectors and its offset in the rombank.
 java.lang.String menuName(int index)
          This method returns the Menu Name for every game.
 boolean writeTOC(java.lang.String filename)
          This method write the TOC to the rombank file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TOC

public TOC(RomsList roms)
Class constructor. It requires a RomList object as parameter.

Parameters:
roms - A RomList object which will provide all data for TOC generating.
Method Detail

menuName

public java.lang.String menuName(int index)
This method returns the Menu Name for every game. It currently support the following TAG list:".nes;[*]", just link rombank for Windows. It's not possible for the user modify that TAG removal list without mess around with the source code, yet! ;-)

Parameters:
index - The index of the game to which the Menu Name will be retrieved.
Returns:
The returned value is a string of 28 byte maximum.

getSizePos

public int getSizePos(int index)
This method returns the size of the rom in sectors and its offset in the rombank. Both data are encoded in an Integer value.

Parameters:
index - The index of the ROM.
Returns:
This method returns an Integer which contains both the ROM size (in sectors) and it offset in the rombank.

writeTOC

public boolean writeTOC(java.lang.String filename)
This method write the TOC to the rombank file.

Parameters:
filename - The name of the file on the disk to write down the TOC.
Returns:
This method returns false if something unexpected occur!!