libmsx
C library for MSX
Loading...
Searching...
No Matches
bios_entry.h File Reference

Assembler entry points for MSX BIOS functions. More...

#include <stdint.h>
#include "config.h"
+ Include dependency graph for bios_entry.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BIOS_ENTRY_H
 

Variables

static const uint8_t RDSLT
 MSX BIOS : RDSLT (000CH / MAIN).
 
static const uint8_t WRSLT
 MSX BIOS : WRSLT (0014H / MAIN).
 
static const uint8_t CALSLT
 MSX BIOS : CALSLT (001CH / MAIN).
 
static const uint8_t ENASLT
 MSX BIOS : ENASLT (0024H / MAIN).
 
static const uint8_t CALLF
 MSX BIOS : CALLF (0030H / MAIN).
 
static const uint8_t RSLREG
 MSX BIOS : RSLREG (0138H / MAIN).
 
static const uint8_t WSLREG
 MSX BIOS : WSLREG (013BH / MAIN).
 
static const uint8_t GTSTCK
 MSX BIOS : GTSTCK (00D5H / MAIN).
 
static const uint8_t GTTRIG
 MSX BIOS : GTTRIG (00D8H / MAIN).
 
static const uint8_t CHGCPU
 MSXturboR BIOS : CHGCPU (0180H/MAIN).
 
static const uint8_t GETCPU
 MSXturboR BIOS : GETCPU (0183H/MAIN).
 

Detailed Description

Assembler entry points for MSX BIOS functions.

Note
This defines address and name of entry points.

Definition in file bios_entry.h.

Macro Definition Documentation

◆ BIOS_ENTRY_H

#define BIOS_ENTRY_H

Definition at line 21 of file bios_entry.h.

Variable Documentation

◆ RDSLT

const uint8_t RDSLT
static

MSX BIOS : RDSLT (000CH / MAIN).

Read value from the given address of the given slot.

Parameters
Aslot
HLaddress to read
Return values
Avalue of the address of the slot.
Postcondition
AF, BC, DE registers are changed.
Interrupt is disabled.
See also
msx_RDSLT()

Definition at line 42 of file bios_entry.h.

◆ WRSLT

const uint8_t WRSLT
static

MSX BIOS : WRSLT (0014H / MAIN).

Write a value to the given address of the given slot.

Parameters
Aslot
HLaddress to write
Ea value to be written
Postcondition
AF, BC, D registers are changed.
Interrupt is disabled.
See also
msx_WRSLT()

Definition at line 58 of file bios_entry.h.

◆ CALSLT

const uint8_t CALSLT
static

MSX BIOS : CALSLT (001CH / MAIN).

Inter slot call to the given address of the given slot.

Parameters
IYslot (higher byte of IY register)
IXaddress to be called
Postcondition
CPU registers are changed according to the results of the routines called.

Definition at line 70 of file bios_entry.h.

◆ ENASLT

const uint8_t ENASLT
static

MSX BIOS : ENASLT (0024H / MAIN).

Switch the page including the given address to the given slot's corresponding page.

Parameters
Aslot
HLaddress
Postcondition
All registers are changed.
Interrupt is disabled.

Definition at line 83 of file bios_entry.h.

◆ CALLF

const uint8_t CALLF
static

MSX BIOS : CALLF (0030H / MAIN).

Inter slot call to the given address of the given slot.

Parameters shall be passed as inline parameter forms as follows:

asm
rst 30h ; same as "call _CALLF"
db 00h ; slot #0
dw 006ch ; address 006ch
Postcondition
CPU registers are changed according to the results of the routines called.

Definition at line 99 of file bios_entry.h.

◆ RSLREG

const uint8_t RSLREG
static

MSX BIOS : RSLREG (0138H / MAIN).

Read value from the primary slot select register.

Return values
Avalue

Definition at line 108 of file bios_entry.h.

◆ WSLREG

const uint8_t WSLREG
static

MSX BIOS : WSLREG (013BH / MAIN).

Write a value to the primary slot select register.

Parameters
Avalue

Definition at line 117 of file bios_entry.h.

◆ GTSTCK

const uint8_t GTSTCK
static

MSX BIOS : GTSTCK (00D5H / MAIN).

Get the status of the eight-way lever on the joystick or the arrow keys on the keyboard.

Parameters
Ajoystick number
  • 0 : keyboard (the arrow keys)
  • 1 : joystick #1
  • 2 : joystick #2
Return values
Astatus of the eight-way lever or the arrow keys.
  • 0 : center
  • 1 : north
  • 2 : north east
  • 3 : east
  • 4 : south east
  • 5 : south
  • 6 : south west
  • 7 : west
  • 8 : north west
Postcondition
ALL CPU registers will be changed.
See also
msx_GTSTCK()
joypad_get_state()
MSX Datapack Volume 2, pp.70 (w/ error)
MSX Datapack Volume 2, pp.612

Definition at line 148 of file bios_entry.h.

◆ GTTRIG

const uint8_t GTTRIG
static

MSX BIOS : GTTRIG (00D8H / MAIN).

Get the status of the trigger button on the joystick or the SPACE key on the keyboard.

Parameters
Atrigger button number
  • 0 : keyboard (the SPACE key)
  • 1 : trigger button #1 of the joystick #1
  • 2 : trigger button #1 of the joystick #2
  • 3 : trigger button #2 of the joystick #1
  • 4 : trigger button #2 of the joystick #2
Return values
Astatus of the trigger button or the SPACE key.
  • 0x00 : released
  • 0xFF : pressed
See also
msx_GTTRIG()
joypad_get_state()
MSX Datapack Volume 2, pp.71
MSX Datapack Volume 2, pp.613 (w/ error)

Definition at line 172 of file bios_entry.h.

◆ CHGCPU

const uint8_t CHGCPU
static

MSXturboR BIOS : CHGCPU (0180H/MAIN).

Change the CPU mode.

Parameters
Acpu mode, that shall be the following bit pattern:
  • bit #7 : LED
    • 0 : Do not change the LED status
    • 1 : Turn the LED on and off according to the CPU
  • bit #6..#2 : (unused, shall be all 0)
  • bit #1..#0 : CPU
    • 00 : Z80 mode
    • 01 : R800 ROM mode
    • 10 : R800 DRAM mode
    • 11 : (reserved)
Postcondition
Interrupts will be enabled.
Note
The values of all registers except the R register will be inherited by the changed CPU.
R800 DRAM mode is the default and fastest CPU mode for MSXturboR. DRAM access is faster than ROM access on R800 CPUs. Therefore, the MSXturboR boot code copies the system software (i.e. BIOS ROM code) to DRAM during the boot sequence, and maps that DRAM area to the address space instead of BIOS ROM.
Attention
Changing the CPU mode is done by simply changing the settings of the system control LSI (S1990). Therefore, if you change the CPU mode to Z80 mode or R800 ROM mode, then change the contents of the DRAM area where was used for system software, and then change the CPU mode to R800 DRAM mode, the system will crash. System software is transferred to the DRAM only at system startup.
See also
msx_CHGCPU()
msx_set_cpu_mode()
MSX Datapack Volume 3, pp.13
MSX Datapack Volume 3, pp.25

Definition at line 215 of file bios_entry.h.

◆ GETCPU

const uint8_t GETCPU
static

MSXturboR BIOS : GETCPU (0183H/MAIN).

Get the CPU mode.

Return values
Acpu mode:
  • 0 : Z80 mode
  • 1 : R800 ROM mode
  • 2 : R800 DRAM mode
Postcondition
F register will be changed.
See also
msx_GETCPU()
msx_get_cpu_mode()
MSX Datapack Volume 3, pp.13
MSX Datapack Volume 3, pp.27

Definition at line 234 of file bios_entry.h.