Difference between revisions of "GetSetupSetting"

From WikiPrizm
Jump to navigationJump to search
(Created page with "{{syscall | name = GetSetupSetting | header = fxcg/system.h | index = 0x0031 | signature = unsigned char GetSetupSetting(unsigned int SystemParameterNo) | synopsis = Gets a ...")
 
(Added warning about the lack of bounds checking.)
Line 7: Line 7:
 
| parameters = * '''SystemParameterNo''' - index of the setting to retrieve.
 
| parameters = * '''SystemParameterNo''' - index of the setting to retrieve.
 
| returns = The value of the setup setting specified on '''SystemParameterNo'''.
 
| 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.
 +
<nowiki>GetSetupSetting:
 +
mov.l  #SetupSettingsBytes, r2
 +
mov    r4, r0
 +
mov.l  @r2, r6
 +
rts
 +
mov.b  @(r0,r6), r0
 +
! End of function GetSetupSetting
 +
</nowiki>
 
}}
 
}}

Revision as of 16:07, 14 February 2015


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