resonance 1.0.1
Loading...
Searching...
No Matches
iop.h File Reference

Go to the source code of this file.

Classes

struct  IopModule
 One IOP module the game loads during start-up. More...

Enumerations

enum  IopModuleSource { kIopModuleSourceDisc = 1 , kIopModuleSourceHost = 2 }
 Which media LoadIopModule() may take a module from. More...
enum  HardEffectTemplate {
  kTemplateUseHardEffect = 10000 , kTemplateHardEffectId = 10001 , kTemplateHardEffectVolumes = 10002 , kTemplateHardDelayTime = 10003 ,
  kTemplateHardFeedback = 10004 , kTemplateHardEffectStt = 10005 , kTemplateNoPauseChannels = 10006 , kTemplateChorusRate = 10007 ,
  kTemplateChorusDepth = 10008 , kTemplateChorusShape = 10009 , kTemplateLevelExists = 10010 , kTemplateHardSynthErrorFile = 10011
}
 The script templates RegisterHardEffectCommands() registers for ConfigureSpu2Effects(). More...

Functions

void InitIop ()
 Bring the IOP up with the game's IOP image and restart the services that depend on it.
void LoadIopModule (const IopModule *pModule, unsigned nSources)
 Load one IOP module from the disc or over the host link.
void LoadIopModules ()
 Load every IOP module the game needs and start the services that depend on them.
void ConfigureRetailBoot ()
 Write the retail boot options over the boot-option block.
void InitDebugPrinting ()
 Bring up the graphics path and the on-screen debug console.
void InitBootConfig ()
 Apply the boot configuration and build the zone list.
void RegisterHardEffectCommands ()
 Register the hard-effect script commands.

Enumeration Type Documentation

◆ IopModuleSource

Which media LoadIopModule() may take a module from.

Enumerator
kIopModuleSourceDisc 

cdrom0:\IOP\<NAME>.IRX;1.

kIopModuleSourceHost 

host0:iop/<name>.irx.

◆ HardEffectTemplate

The script templates RegisterHardEffectCommands() registers for ConfigureSpu2Effects().

Enumerator
kTemplateUseHardEffect 

current_level.ps2_use_hard_effect(d).

kTemplateHardEffectId 

current_level.ps2_hard_effect_id(d).

kTemplateHardEffectVolumes 

current_level.ps2_hard_effect_volumes(d)[d].

kTemplateHardDelayTime 

current_level.ps2_hard_delay_time(d).

kTemplateHardFeedback 

current_level.ps2_hard_feedback(d).

kTemplateHardEffectStt 

current_level.ps2_heff_stt()[d].

kTemplateNoPauseChannels 

current_level.ps2_heff_nopause_channels().

kTemplateChorusRate 

current_level.ps2_heff_chorus_rate()[d].

kTemplateChorusDepth 

current_level.ps2_heff_chorus_depth()[d].

kTemplateChorusShape 

current_level.ps2_heff_chorus_shape()[d].

kTemplateLevelExists 

current_level_exists().

kTemplateHardSynthErrorFile 

current_level.ps2_hsyn_error_file().

Function Documentation

◆ InitIop()

void InitIop ( )

Bring the IOP up with the game's IOP image and restart the services that depend on it.

The retail boot configuration is written first. The IOP is then rebooted and resynchronised, and the debug console and the boot configuration are initialised last. The image is cdrom0:\IOP\IOPRP23.IMG;1 in kHostModeCdOnly and host0:iop/ioprp23.img otherwise.

Ghidra address:
NTSC-U/C: 0x004dfe28
Ghidra address:
PAL: 0x0051e5c0

◆ LoadIopModule()

void LoadIopModule ( const IopModule * pModule,
unsigned nSources )

Load one IOP module from the disc or over the host link.

The disc arm upper-cases the module name and composes cdrom0:\IOP\NAME.IRX;1. The host arm composes host0:iop/name.irx from the name as the table records it, with no case conversion.

The two arms are exclusive rather than a fallback chain. kIopModuleSourceDisc wins wherever it is set, so a mask with both bits never arrives at the host arm. A failed load reports through Error() and calls exit(1) rather than trying the other medium.

An empty mask reports LoadModuleFromAnywhere failed and calls exit(1). That message is the only place the image attests a name for this routine, and the existing spelling is retained in preference to it.

Parameters
pModuleThe module to load.
nSourcesA mask of IopModuleSource values.
Ghidra address:
NTSC-U/C: 0x004de170
Ghidra address:
PAL: 0x0051c728

◆ LoadIopModules()

void LoadIopModules ( )

Load every IOP module the game needs and start the services that depend on them.

The selected host mode is reported to cout, the SIF RPC layer and the IOP heap are initialised, the ten modules of the shipped table are loaded, and the multitap and memory card libraries are started. The host mode also selects the media mask. kHostModeCdHost permits both media, kHostModeCdOnly permits the disc, and kHostModeHostOnly permits the host link.

Ghidra address:
NTSC-U/C: 0x004de600
Ghidra address:
PAL: 0x0051ccd0

◆ ConfigureRetailBoot()

void ConfigureRetailBoot ( )

Write the retail boot options over the boot-option block.

The routine belongs to the same translation unit as GetHostMode() and is declared here so that iop.cpp can call it. It writes eight of the nine words of the block at 0x0070bf10 in one pass, setting the host mode to kHostModeCdOnly and UsingArkFiles() to 1. ScreenMessagesEnabled() is the word it omits.

Ghidra address:
NTSC-U/C: 0x0050f030
Ghidra address:
PAL: 0x0054e5c8

◆ InitDebugPrinting()

void InitDebugPrinting ( )

Bring up the graphics path and the on-screen debug console.

The routine belongs to another translation unit and is declared here so that iop.cpp can call it. The unit is devconsole.cpp. It initialises the GS through Gs_Initialize() and then creates a console of 75 columns by 30 rows of 16-bit character cells, clearing every cell to 0x0720, a space with attribute 7. InitIop() is the only caller.

Ghidra address:
NTSC-U/C: 0x005e5f18
Ghidra address:
PAL: 0x006280d8

◆ InitBootConfig()

void InitBootConfig ( )

Apply the boot configuration and build the zone list.

The routine belongs to the same translation unit as GetHostMode() and is declared here so that iop.cpp can call it. It reports Running from CD only, since we couldn't find the config file and Running from CD ONLY, forcing arkfiles ON and async ON, writes the host mode, the ark flag, and the disc flag again, opens the memory report, and then calls InitializeZoneList(). The shipped build reports both messages unconditionally. No build variant that shipped reads the configuration file.

The name is inferred. Nothing in the image attests it, and InitIop() is the only caller.

In the PAL build the routine then records the console's language setting through SetLanguage(), as the European release does.

Ghidra address:
NTSC-U/C: 0x0050f080
Ghidra address:
PAL: 0x0054e618

◆ RegisterHardEffectCommands()

void RegisterHardEffectCommands ( )

Register the hard-effect script commands.

The image emits the routine far from the rest of this module, after tanf(). It registers script templates 10000 through 10011 against the current_level expressions for the hard effect, its chorus, and the hard synth error file, with current_level_exists() taking 10010 out of sequence between the fifth and the sixth.

The name is inferred from those expressions. Nothing in the image attests it, and LoadIopModules() is the only caller.

Ghidra address:
NTSC-U/C: 0x005e1210
Ghidra address:
PAL: 0x00623150