Jump to content
RealModScene
Sign in to follow this  
MaesterRowen

Aurora Tips & Tricks from Phoenix #4 - Enhancing the Rom Browser

Recommended Posts

ROM Launch Data

Aurora will set LaunchData when a ROM is executed from the GameContent menu of an Emulator.  The launch data is in the following format:

#define AURORA_LAUNCHDATA_APPID         'AUOA'
#define AURORA_LAUNCHDATA_ROM_FUNCID    'ROMS'
#define AURORA_LAUNCHDATA_ROM_VERSION   1

typedef struct _AURORA_LAUNCHDATA_ROM {
  DWORD ApplicationId;       // AURORA_LAUNCHDATA_APPID
  DWORD FunctionId;          // AURORA_LAUNCHDATA_ROM_FUNCID
  DWORD FunctionVersion;     // AURORA_LAUNCHDATA_ROM_VERSION
  CHAR SystemPath[0x40];     // /System/Harddisk0/Parition0
  CHAR RelativePath[0x104];  // /Emulators/Snes9x/Roms/ 
  CHAR Exectutable[0x28];    // ChronoTrigger.zip
  CHAR Reserved[0x100];      // Reserved for future use
} AURORA_LAUNCHDATA_ROM, *PAURORA_LAUNCH_DATA_ROM;

It will be the responsibility of the Emulator application to detect whether or not the launch data exists; and if so check to see if the ApplicationID is 'AUOA' and that the FunctionId is 'ROMS'. The function version is the current version of the structure. If it does not match those conditions then the rest of the launch data structure may not contain the correctly formatted data.  The launch data above provides enough information to mount the path and access the ROM file. The emulator can then extract/load and execute the rom as neccesary.

 
ROM LUA Script
When the GameContent menu is opened for an emulator, instead of scanning for DLC like retail games, it will scan a local directory for ROM files. The local directory that the scanner uses is /Roms. By default, every individual file that is located in this folder will show up in the list of roms after the scan has completed. Note: The scanning function is recursive so it will scan into folders and find the files within; however, it does not include the folder in the list of discovered ROMs.

 
Customizing the Rom List:
For each file that is found within the /Roms directory a LUA script is run that will output formatting information. This LUA script is located in the base folder for the emulator (next to default.xex) and should have a file name of emulator.lua. If emulator.lua is not found, an internal LUA script is run that echoes the filename passed to the script as a parameter.

The internal LUA script is as follows:

function prepareRomMetadata( MetaData )
  return MetaData.FileName, "", ""
end

 
A custom external LUA script will be required to contain the exact same function prepareRomMetadata and should include three (3) return values. The first return value represents the display name or friendly name of the ROM. The second return value represents the system name (ie, SNES, Genesis ) and the third return value represents a path to an icon.

Display Name:
If the display name is blank, the ROM will not show up on the list at all. This is allows the script to ignore files in the event that certain file types are used as metadata and not for ROM executable files.

System Name:
If the system name is blank, or no 2nd return value is provided, then the system name will display as blank in the ROM list.

Image Path:
If the image path is blank or the path points to an image that is missing, then the missing icon image will be used in its place.
In addition to the return values, there is also a parameter. The parameter for this function is MetaDataMetaData is a LUA table that contains information about the file that was scanned when the list was loaded. TheMetaData table is as follows:

struct MetaData {
  string Root;      // The root that the ROM was found (ie, Hdd1:, Usb0: )
  string Directory; // The directory the ROM was found
  string FileName;  // The file name of the ROM (minus the extension)
  string Extension; // The file extension for the ROM
  DWORD FileSize;   // The file size for the ROM
};

The idea behind the custom external LUA script is that emulator creators can provide these with their emulator to force the list to display in a way that best works for them.

Share this post


Link to post
Share on other sites

Will this work for PCSXR 360? (Or just PCSX 360)

It will work with any emulator that implements support for our launchdata...

Sent from my SM-G903F

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...