libmsx
C library for MSX
|
Modules | |
Direct access to banked memory by switching page 2. | |
APIs for direct access to 16KiB segments of banked memory. | |
Reading and copying from banked memory. | |
APIs for indirect access to banked memory. | |
Banked Memory as a storage of Named Resources. | |
#include <resources.h> | |
Files | |
file | bmem.h |
Data types and functions for accessing banked memory. | |
Macros | |
#define | BMEM_H_ |
#include <bmem.h>
MegaROM is a ROM consisting of up to 256 8KiB or 16KiB segments.
In libmsx
, MegaROM is treated as banked memory consisting of one large address space (or a series of 16KiB segments).
The first 16KiB segment is used as the CODE
segment.
Subsequent segments are named BANK1
, BANK2
, ..., and BANK63
.
The CODE
segment is always placed on page 1 (0x4000..0x7fff) of its slot's address space.
Page 2 (0x8000..0xbfff) is used as a switchable memory bank, and arbitrary 16KiB segment in banked memory can be placed on page 2.
Functions marked __banked
in banked memory can be called from CODE
segments or other segments, see also SDCC Compiler User Manual "Bank
Switching" and "Z80 banked calls".
bmem.h
provides other functions to use banked memory as data storage.
resources.h
provides functions to use banked memory as data storage of named resources.
CONFIG_ROM_TYPE
is ascii8
or ascii16
.