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

Read from status registers. More...

+ Collaboration diagram for Status registers:

Functions

uint8_t vdp_get_status (uint8_t reg)
 MSX Read from a VDP status register.
 

Detailed Description

Read from status registers.

Function Documentation

◆ vdp_get_status()

uint8_t vdp_get_status ( uint8_t  reg)

MSX Read from a VDP status register.

Parameters
regVDP status register number.
  • MSX : 0
  • MSX2: 0..9
  • If any other value was specified, behaviour is undefined.
Returns
Value of the VDP status register.
  • If reg != 0, returns the value of the status register #reg
  • If reg == 0, returns the value of STATFL instead of reading the status register #0 (S#0).
Note
The MSX SYSTEM interrupt routine reads S#0 to see if an interrupt due to VSYNC has occurred. Also, reading S#0 resets bit #7 (VSYNC interrupt flag) of S#0, so the latest value read from S#0 is stored in STATFL for other uses. Therefore, this function reads STATFL instead of S#0 if reg == 0.
See also
STATFL