BIOS calls: Difference between revisions

From NeoGeo Development Wiki
Jump to navigation Jump to search
m (1 revision)
No edit summary
Line 1: Line 1:
== AES/MVS BIOS calls ==
Please see [[ASM Defines]] or [[C Defines]] for hex addresses.


* [[Joypads]] read
Simplify hierarchy and tell on which system each call works ?
* Clear [[sprites]]
* Clear [[fix layer]]
* [[Memory card]] management


== CD BIOS calls ==
= Universal BIOS calls =


* Same ones as the AES/MVS
BIOS calls common to every system.
* [[Uploading files|Upload]]


== CDZ BIOS calls ==
== BIOSF_CLEARFIX: Clear fix layer ==
 
== BIOSF_CLEARSPR: Clear sprites ==
 
== BIOSF_?: Read player controls ==
 
Sets values in RAM according to buttons states. Often called each frame.
 
Memory locations set:
<pre>
BIOS_P1CURRENT    Joystick 1 state
BIOS_P1PREVIOUS    Previous joystick 1 state
BIOS_P1CHANGE      Joystick 1 state change (edges)
BIOS_P1REPEAT      Joystick 1 repeat (edge, and strobe if held more than ? calls)
Joystick 2...
BIOS_STATCURNT    Joystick 1/2 start/select state
BIOS_STATCHANGE    Previous Joystick 1/2 start/select state
</pre>
 
Bit definitions: see [[Joypads]]
 
= AES/MVS BIOS calls =
 
AES/MVS specific calls.
 
== BIOSF_CRDACCESS: Perform memory card operation ==
(Informations provided by [[User:Smkdan]])
 
Memory locations used (all 8bit):
 
<pre>
BIOS_CRDF      (8bit): function to perform when calling BIOSF_CRDACCESS, see below table
BIOS_CRDRESULT  (8bit): 00 on success, else 80+ and encodes the error, see below table
BIOS_CRDPTR    (32bit): pointer to read from/write to
BIOS_CRDSIZE    (16bit): how much data to read/write from/to card
BIOS_CRDNGH    (16bit): usually game NGH.  Unique identifier for the game that 'owns' the save file
BIOS_CRDFILE    (16bit): each NGH has up to 16 save 'files' associated with
</pre>
 
To access memory card, the RAM addresses above must be set depending on the function being attempted
BIOS_CRDF values:
 
;$00 (Format)
:No extra parameters
 
;$01 (Find)
:'''In''': BIOS_CRDNGH: NGH to find save files for
:'''Out''': BIOS_CRDFILE: 16bit mask containing 1 bits for each one of the 16 save files if present.
:0 bits mean the save file is not present. i.e. FFFF = all 16 saves used, 8000 = only save file 15 is used
 
;$02 (Load)
:'''In''':
:CRDPTR: pointer to store loaded data to
:CRDSIZE: the max size of data to load (automatically stops when entire file is loaded)
:CRDNGH: NGH of file
:CRDFILE: the file # of the given NGH to load from
 
;$03 (Save)
:'''In''':
:CRDPTR: pointer to read data to store to the card
:CRDSIZE: size of data to save
:CRDNGH: NGH of file
:CRDFILE: the file # of the given NGH to save as
 
;$04 (Delete)
:'''In''':
:CRDNGH: NGH of file
:CRDFILE: the file # of the given NGH to delete
 
;$05 (GETNAME)
:Gets name of a save file, forgot how these work...
 
;$06 (SETUSER) (the username of the card)
;$07 (GETUSER)
 
Errors may occur and the BIOS will store a value in BIOS_CRDRESULT depending on what went wrong:
*$00: no errors
*$80: no card inserted
*$81: card inserted, but not formatted
*$82: attempted to load a file that doesn't exist on the card
*$83: checksum error?
*$84: attempted to save to a full card
*$85: card write protect switch is active
 
= CD BIOS calls =
 
* Same ones as the AES/MVS ?
 
== BIOSF_UPLOAD: Upload data to DRAM ==
 
== BIOSF_CDDACMD: Issue CDDA command ==
 
= CDZ BIOS calls =


* Check track 0 ? [[Copy protection]]
* Check track 0 ? [[Copy protection]]


[[Category:Code]]
[[Category:Code]]

Revision as of 13:05, 9 February 2011

Please see ASM Defines or C Defines for hex addresses.

Simplify hierarchy and tell on which system each call works ?

Universal BIOS calls

BIOS calls common to every system.

BIOSF_CLEARFIX: Clear fix layer

BIOSF_CLEARSPR: Clear sprites

BIOSF_?: Read player controls

Sets values in RAM according to buttons states. Often called each frame.

Memory locations set:

BIOS_P1CURRENT     Joystick 1 state
BIOS_P1PREVIOUS    Previous joystick 1 state
BIOS_P1CHANGE      Joystick 1 state change (edges)
BIOS_P1REPEAT      Joystick 1 repeat (edge, and strobe if held more than ? calls)
Joystick 2...
BIOS_STATCURNT     Joystick 1/2 start/select state
BIOS_STATCHANGE    Previous Joystick 1/2 start/select state

Bit definitions: see Joypads

AES/MVS BIOS calls

AES/MVS specific calls.

BIOSF_CRDACCESS: Perform memory card operation

(Informations provided by User:Smkdan)

Memory locations used (all 8bit):

BIOS_CRDF       (8bit): function to perform when calling BIOSF_CRDACCESS, see below table
BIOS_CRDRESULT  (8bit): 00 on success, else 80+ and encodes the error, see below table
BIOS_CRDPTR     (32bit): pointer to read from/write to
BIOS_CRDSIZE    (16bit): how much data to read/write from/to card
BIOS_CRDNGH     (16bit): usually game NGH.  Unique identifier for the game that 'owns' the save file
BIOS_CRDFILE    (16bit): each NGH has up to 16 save 'files' associated with

To access memory card, the RAM addresses above must be set depending on the function being attempted BIOS_CRDF values:

$00 (Format)
No extra parameters
$01 (Find)
In: BIOS_CRDNGH: NGH to find save files for
Out: BIOS_CRDFILE: 16bit mask containing 1 bits for each one of the 16 save files if present.
0 bits mean the save file is not present. i.e. FFFF = all 16 saves used, 8000 = only save file 15 is used
$02 (Load)
In:
CRDPTR: pointer to store loaded data to
CRDSIZE: the max size of data to load (automatically stops when entire file is loaded)
CRDNGH: NGH of file
CRDFILE: the file # of the given NGH to load from
$03 (Save)
In:
CRDPTR: pointer to read data to store to the card
CRDSIZE: size of data to save
CRDNGH: NGH of file
CRDFILE: the file # of the given NGH to save as
$04 (Delete)
In:
CRDNGH: NGH of file
CRDFILE: the file # of the given NGH to delete
$05 (GETNAME)
Gets name of a save file, forgot how these work...
$06 (SETUSER) (the username of the card)
$07 (GETUSER)

Errors may occur and the BIOS will store a value in BIOS_CRDRESULT depending on what went wrong:

  • $00: no errors
  • $80: no card inserted
  • $81: card inserted, but not formatted
  • $82: attempted to load a file that doesn't exist on the card
  • $83: checksum error?
  • $84: attempted to save to a full card
  • $85: card write protect switch is active

CD BIOS calls

  • Same ones as the AES/MVS ?

BIOSF_UPLOAD: Upload data to DRAM

BIOSF_CDDACMD: Issue CDDA command

CDZ BIOS calls