Difference between revisions of "Modules/system"

From MSX Game Library

< Modules

 
Line 2: Line 2:
 
|name=system
 
|name=system
 
|category=Core
 
|category=Core
 +
|image=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_sys.jpg
 
|dependency1=
 
|dependency1=
 
|dependency2=
 
|dependency2=

Latest revision as of 00:00, 13 January 2024

system

Code: system.h

Category: Core

Dependencies: None

Samples:

The system module give access to low level features like interruption activation or slot management.

Usage

To use this module, include "system.h" in your source code, and add "system" to the modules list (LibModules) in your project's configuration file (project_config.js).

Some examples:

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

DisableInterrupt();   // Disable interruption. ISR will not been called event is interruption signal is set
// Code you don't want to be interrupted
EnableInterrupt();    // Restore interruption

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

Samples

See module use cases in the sample programs:

Settings


Dependencies

Dependency on other modules: None

Documentation