GetSetupSetting

From WikiPrizm
Revision as of 16:07, 14 February 2015 by ProgrammerNerd (talk | contribs) (Added warning about the lack of bounds checking.)
Jump to navigationJump to search


Synopsis

Header: fxcg/system.h
Syscall index: 0x0031
Function signature: unsigned char GetSetupSetting(unsigned int SystemParameterNo)

Gets a Setup setting.

Parameters

  • SystemParameterNo - index of the setting to retrieve.

Returns

The value of the setup setting specified on SystemParameterNo.

Comments

This function does no bounds checking meaning that with an incorrect value of SystemParameterNo you may accidently overwrite a byte that does not pertain to setup settings. Here is a disassembly of it for your reference.

GetSetupSetting:
	mov.l   #SetupSettingsBytes, r2
	mov     r4, r0
	mov.l   @r2, r6
	rts
	mov.b   @(r0,r6), r0
! End of function GetSetupSetting