libmsx
C library for MSX
Loading...
Searching...
No Matches

Change / Get CPU mode. More...

+ Collaboration diagram for Z80 / R800 CPU mode:

Functions

void msx_CHGCPU (const uint8_t mode)
 MSXturboR BIOS : CHGCPU (0180H/MAIN)
 
void msx_set_cpu_mode (const uint8_t mode)
 MSX Change the CPU mode.
 
uint8_t msx_GETCPU (void)
 MSXturboR BIOS : GETCPU (0183H/MAIN)
 
uint8_t msx_get_cpu_mode (void)
 MSX Get the CPU mode.
 

Detailed Description

Change / Get CPU mode.

Function Documentation

◆ msx_CHGCPU()

void msx_CHGCPU ( const uint8_t  mode)

MSXturboR BIOS : CHGCPU (0180H/MAIN)

Change the CPU mode.

Parameters
modecpu 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)
Note
This is a C language wrapper for the BIOS function CHGCPU (0180H/MAIN) for MSXturboR.
Attention
For MSX, MSX2, and MSX2+, the behavior is undefined.
Therefore, msx_set_cpu_mode() is recommended instead.
See also
msx_set_cpu_mode()

◆ msx_set_cpu_mode()

void msx_set_cpu_mode ( const uint8_t  mode)

MSX Change the CPU mode.

Parameters
modecpu 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)
Note
This function is the C interface for the BIOS functionCHGCPU (0180H/MAIN) for MSXturboR.
For MSX, MSX2, and MSX2+, this function does nothing.
Therefore, unlike msx_CHGCPU(), this function can be used on any MSX platform.
See also
msx_CHGCPU()

◆ msx_GETCPU()

uint8_t msx_GETCPU ( void  )

MSXturboR BIOS : GETCPU (0183H/MAIN)

Get the CPU mode.

Returns
cpu mode:
  • 0 : Z80 mode
  • 1 : R800 ROM mode
  • 2 : R800 DRAM mode
Note
This is a C language wrapper for the BIOS function GETCPU (0183H/MAIN) for MSXturboR.
Attention
For MSX, MSX2, and MSX2+, the behavior is undefined.
Therefore, msx_get_cpu_mode() is recommended instead.
See also
msx_get_cpu_mode()

◆ msx_get_cpu_mode()

uint8_t msx_get_cpu_mode ( void  )

MSX Get the CPU mode.

Returns
cpu mode:
  • 0 : Z80 mode
  • 1 : R800 ROM mode
  • 2 : R800 DRAM mode
Note
This function is the C interface for the BIOS functionGETCPU (0183H/MAIN) for MSXturboR.
For MSX, MSX2, and MSX2+, this function always returns 0 (Z80 mode).
Therefore, unlike msx_GETCPU(), this function can be used on any MSX platform.
See also
msx_GETCPU()