Difference between revisions of "Modules/system/Usage"

From MSX Game Library

< Modules‎ | system

(Created page with "Some examples: <syntaxhighlight lang="c"> Sys_StopClickSound(); // Stop keyboard "click" sound DisableInterrupt(); // Code you don't want to be interrupted EnableInterrupt();...")
(No difference)

Revision as of 22:09, 7 January 2024

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