Modules/system/Usage

From MSX Game Library

Revision as of 21:09, 7 January 2024 by Aoineko (talk | contribs) (Created page with "Some examples: <syntaxhighlight lang="c"> Sys_StopClickSound(); // Stop keyboard "click" sound DisableInterrupt(); // Code you don't want to be interrupted EnableInterrupt();...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

< Modules‎ | system

Some examples:

Sys_StopClickSound(); // Stop keyboard "click" sound

DisableInterrupt();
// Code you don't want to be interrupted
EnableInterrupt();

while(1)
{
	Halt(); // Wait for signal (should be screen synchronization)
	// Code to be synchronized at 50/60 Hz
}

Example for mapped ROM (for a 8K mapper):

u8 prevSeg = GET_BANK_SEGMENT(3); // Backup previous segment number in bank #3 (for mapper ROM)
SET_BANK_SEGMENT(3, 10); // Set segment #10 in bank #3
// Here you can access to segment #10 data at addresses A000~BFFFh
SET_BANK_SEGMENT(3, prevSeg); // Restore the previous segment number in bank #3