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

Utility functions to inspect the slot mechanism of MSX. More...

#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
+ Include dependency graph for slot.h:

Go to the source code of this file.

Macros

#define SLOT_H_
 

Functions

void slot_iterate (void(*callback)(uint8_t slot, void *arg), void *arg)
 MSX For each slot, invoke the given callback with the given arguments.
 
int slot_bcmp (uint8_t slot, const void *addr, const void *s, size_t len)
 MSX Compare the byte sequence to the one present at the given address in the given slot.
 
bool slot_is_read_only (uint8_t slot, void *addr)
 MSX Tests whether a given memory address of the given slot is read-only.
 
bool slot_is_MAIN_ROM (uint8_t slot)
 MSX Inspects if the slot is MAIN ROM.
 
bool slot_is_SUB_ROM (uint8_t slot)
 MSX Inspects if the slot is SUB ROM.
 
bool slot_is_RAM (uint8_t slot)
 MSX Inspects if the slot is RAM.
 
bool slot_is_internal_OPLL (uint8_t slot)
 MSX Inspects if the slot is the internal MSX-MUSIC.
 
bool slot_is_FMPAC (uint8_t slot)
 MSX Inspects if the slot is the FMPAC.
 
bool slot_is_OPLL (uint8_t slot)
 MSX Inspects if the slot is a MSX-MUSIC.
 
bool slot_is_SCC (uint8_t slot)
 MSX Inspects if the slot is a Konami SCC/SCC+.
 
bool slot_is_SCCPlus (uint8_t slot)
 MSX Inspects if the slot is a Konami SCC+.
 
bool slot_is_BDOS (uint8_t slot)
 MSX Inspects if the slot is a BDOS/FDC.
 
bool slot_is_ROM_p1 (uint8_t slot)
 MSX Inspects if the slot is a ROM starting at 0x4000.
 
bool slot_is_ROM_p2 (uint8_t slot)
 MSX Inspects if the slot is a ROM starting at 0x8000.
 
bool slot_is_ROM (uint8_t slot)
 MSX Inspects if the slot is a ROM starting at 0x4000 or 0x8000.
 

Detailed Description

Utility functions to inspect the slot mechanism of MSX.

Example
The following code detects MSX-MUSIC (OPLL) by inspecting each slot.

c
#include <msx.h>
#include <slot.h>
void find_OPLL_callback(uint8_t slot, void * arg) {
uint8_t * p_slot = (uint8_t *)arg;
if (slot_is_internal_OPLL(slot)) {
*p_slot = slot;
}
else if (!*p_slot && slot_is_OPLL(slot)) {
*p_slot = slot;
}
}
void main(void) {
uint8_t slot = 0;
slot_iterate(find_OPLL_callback, &slot);
if (slot) {
// a MSX-MUSIC (OPLL) found on the slot `slot`.
}
for (;;) {
}
}
void await_vsync(void)
MSX Waits for next VSYNC interrupt.
void slot_iterate(void(*callback)(uint8_t slot, void *arg), void *arg)
MSX For each slot, invoke the given callback with the given arguments.
bool slot_is_internal_OPLL(uint8_t slot)
MSX Inspects if the slot is the internal MSX-MUSIC.
bool slot_is_OPLL(uint8_t slot)
MSX Inspects if the slot is a MSX-MUSIC.
Using #include <msx.h> includes almost all C header files in libmsx, for ease to use.
Utility functions to inspect the slot mechanism of MSX.

Definition in file slot.h.

Macro Definition Documentation

◆ SLOT_H_

#define SLOT_H_

Definition at line 52 of file slot.h.