Difference between revisions of "Samples"

From MSX Game Library

(V9990)
(Target format)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
Here is a list of sample programs supplied with '''MSXgl''' to demonstrate the use of the library's various functions.
 +
 +
To try out the different samples, simply open a command line in the <tt>MSXgl/projects/samples/</tt> directory and execute:
 +
* <tt>build.bat s_game</tt> (Windows)
 +
* <tt>./build.sh s_game</tt> (Linux & macOS)
 +
 +
Replace "<tt>s_game</tt>" with the name of the sample you want to try out (sample's <tt>.c</tt> file extension is not needed).
 +
 +
<u>Note:</u> Samples use a system to overwrites the project configuration (<tt>project_config.js</tt>) with a sample-specific configuration file (e.g. <tt>s_game.js</tt>). This makes it possible to have several projects in the same directory. This is not necessary for a stand-alone project. See how to [[Create my first program|create your own new program]].
  
 
== Core ==
 
== Core ==
Line 39: Line 48:
 
{{SAMPLE_BOX
 
{{SAMPLE_BOX
 
|name=Clock
 
|name=Clock
|desc=Program showing the use of the MSX 2's Real Time Clock (Ricoh RP-5C01) to get current time and save/load data from CMOS memory.
+
|desc=Program showing the use of the MSX2's Real Time Clock (Ricoh RP-5C01) to get current time and save/load data from CMOS memory.
 
|module1=clock
 
|module1=clock
 
|module2=
 
|module2=
Line 92: Line 101:
 
{{SAMPLE_BOX
 
{{SAMPLE_BOX
 
|name=Draw
 
|name=Draw
|desc=Program showing the use of Draw module with the MSX 2 bitmap screen modes.
+
|desc=Program showing the use of Draw module with the MSX2 bitmap screen modes.
 
|module1=vdp
 
|module1=vdp
 
|module2=draw
 
|module2=draw
Line 120: Line 129:
 
|ext=
 
|ext=
 
|state=Functional
 
|state=Functional
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_gm3.png
+
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_gm3_2.png
 
}}
 
}}
  
Line 172: Line 181:
 
|state=Functional
 
|state=Functional
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_sprite.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_sprite.jpg
 +
}}
 +
 +
=== Sprite FX ===
 +
{{SAMPLE_BOX
 +
|name=Sprite FX
 +
|desc=Program showing the use of Sprite Tool module to modify sprite data (support Cropping, Flipping, Asking and Rotating).
 +
|module1=sprite_fx
 +
|module2=
 +
|module3=
 +
|module4=
 +
|module5=
 +
|file=s_sprtfx.c
 +
|machine=MSX2
 +
|target=ROM_32K
 +
|ext=
 +
|state=Functional
 +
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_sprttool.gif
 
}}
 
}}
  
Line 194: Line 220:
 
{{SAMPLE_BOX
 
{{SAMPLE_BOX
 
|name=Software Tile
 
|name=Software Tile
|desc=Program showing the use of software tile mode for MSX 2 bitmap modes (only Screen 5 & 8 has been tested).
+
|desc=Program showing the use of software tile mode for MSX2 bitmap modes (only Screen 5 & 8 has been tested).
 
|module1=vdp
 
|module1=vdp
 
|module2=
 
|module2=
Line 211: Line 237:
 
{{SAMPLE_BOX
 
{{SAMPLE_BOX
 
|name=Text
 
|name=Text
|desc=Program showing the use of print module with text modes (all MSX 1 and MSX 2 text/tiled mode).
+
|desc=Program showing the use of print module with text modes (all MSX1 and MSX2 text/tiled mode).
 
|module1=print
 
|module1=print
 
|module2=
 
|module2=
Line 309: Line 335:
 
|ext=
 
|ext=
 
|state=Functional
 
|state=Functional
 +
|img=
 +
}}
 +
 +
=== NEO mapper ===
 +
{{SAMPLE_BOX
 +
|name=NEO mapper
 +
|desc=Program showing usage of NEO-8 mapped ROM and segments switching.
 +
|module1=
 +
|module2=
 +
|module3=
 +
|module4=
 +
|module5=
 +
|file=s_neo0.c
 +
|machine=MSX1
 +
|target=ROM_NEO8_8M
 +
|ext=
 +
|state=WIP
 
|img=
 
|img=
 
}}
 
}}
Line 363: Line 406:
 
|state=Functional
 
|state=Functional
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_game.png
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_game.png
 +
}}
 +
 +
=== Localize ===
 +
{{SAMPLE_BOX
 +
|name=Localize
 +
|desc=Show case of the localization handling module.
 +
|module1=localize
 +
|module2=
 +
|module3=
 +
|module4=
 +
|module5=
 +
|file=s_loc.c
 +
|machine=MSX1
 +
|target=ROM_32K
 +
|ext=
 +
|state=Functional
 +
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_loc.png
 
}}
 
}}
  

Latest revision as of 21:20, 13 January 2024

Here is a list of sample programs supplied with MSXgl to demonstrate the use of the library's various functions.

To try out the different samples, simply open a command line in the MSXgl/projects/samples/ directory and execute:

  • build.bat s_game (Windows)
  • ./build.sh s_game (Linux & macOS)

Replace "s_game" with the name of the sample you want to try out (sample's .c file extension is not needed).

Note: Samples use a system to overwrites the project configuration (project_config.js) with a sample-specific configuration file (e.g. s_game.js). This makes it possible to have several projects in the same directory. This is not necessary for a stand-alone project. See how to create your own new program.

Core

Hello World

Program showing the minimal code needed to display a text.
32K

BIOS

Program showing the use of default BIOS functions.
32K

Clock

Program showing the use of the MSX2's Real Time Clock (Ricoh RP-5C01) to get current time and save/load data from CMOS memory.
32K

PSG

Program showing the use of direct control over PSG sound chip.
32K

System

Program showing the retrieval of system information.
  • File: s_sys.c
  • State: ✔️ Functional
32K

Render

Draw

Program showing the use of Draw module with the MSX2 bitmap screen modes.
32K

Graph Mode 3

Program showing the use of Screen 4 (aka Graph mode 3) with various configuration (including unofficial MSX configurations like "Screen 1.5").
32K

Print

Program showing the use of graphical print features (bitmap, sprite, effects, etc.).
32K

Sprite Mode 1

Program showing the use of sprite mode 1 and a Sprite Attribute Table flip method to reduce sprite disappearance.
32K

Sprite Mode 2

Program showing the use of sprite mode 2 and split screen to change VDP setting during screen rendering.
32K

Sprite FX

Program showing the use of Sprite Tool module to modify sprite data (support Cropping, Flipping, Asking and Rotating).
32K

Software Sprite

Program showing the use of software sprite for all bitmap modes using VDP commands.
32K

Software Tile

Program showing the use of software tile mode for MSX2 bitmap modes (only Screen 5 & 8 has been tested).
32K

Text

Program showing the use of print module with text modes (all MSX1 and MSX2 text/tiled mode).
32K

VDP Command

Program showing the use of VDP command to draw several effect in all bitmap modes.
32K

Target format

Boot Disk

Program showing the use boot disk target format. The program will be start from disk without going through MSX-DOS but allow to use BDOS function.
  • Showcased modules:
  • File: s_dos0.c
  • State: ❓ Partially functional
BOOT

MSX-DOS

Program showing the use of MSX-DOS 1 routines to load and display image from file.
MSX-DOS

MSX-DOS 2

Program showing the use of various MSX-DOS 2 routines to load and display image, get disk information or handle mapped memory.
MSX-DOS 2

Mapped ROM

Program showing usage of mapped ROM and segments switching.
ASCII8 128K

NEO mapper

Program showing usage of NEO-8 mapped ROM and segments switching.
NEO8 8M

Utilities

BASIC USR

Program showing the creation of binary to be load and used from BASIC.
BIN (USR)

Compressor

Program showing the use of several compression algorithms (RLEp, Bitbuster 1 & 2, ZX0 and Pletter).
MSX-DOS

Game

Program showing the use of Game and Game pawn modules. The Game module offers state management while Game pawn allows to manage characters (display, animation, movement, collision, etc.)
32K

Localize

Show case of the localization handling module.
32K

Math

Program showing the use of mathematics pre-computed tables, pseudo-random generator and quick-computation functions.
32K

Scrolling

Program showing the use of multi-directionnal tile-based scrolling and screen adjust register for smooth scrolling.
32K

Devices

Joystick

Program showing the use of joystick and input manager.
32K

Keyboard

Program showing the use of keyboard and input manager.
32K

Mouse

Program showing the use of mouse device and universal port (joystick port) device detection.
32K

Ninja Tap

Program showing the use of NinjaTap device to connect up to 8 joysticks on one MSX machine.
32K

ObsoNET

Program showing the use of ObsoNET cartridge using network stack.
16K

PAC

Program showing the use of PAC or FM-PAC to load/save data into SRAM.
32K

V9990

Program showing the use of Yamaha V9990 based video cartridge.
32K

Audio Format

Arkos

Program showing the use of Arkos Tracker II's replayers.
ASCII8 128K

ayFX

Program showing the use of ayFX's replayer.
32K

lVGM

Program showing the use of light-VGM's replayer (PSG).
32K

PCM-Encoder

Program showing the use of the PCM Encoder's replayer (aka. Crystal clean PCM 8bit samples on the poor PSG).
32K

PCM Play

Program showing the use of the PCM Play's replayer.
32K

PT3

Program showing the use of Vortex Tracker II's replayer.
32K

Trilo Tracker SCC

Program showing the use of Trilo Tracker SCC's replayer.
KONAMI 128K

VGM

Program showing the use of VGM's replayer (PSG, SCC, MSX-Music, MSX-Audio).
ASCII16 256K

WYZ

Program showing the use of WYZ Tracker's replayer (version 0.3).
32K

WYZ2

Program showing the use of WYZ Tracker's replayer (version 0.3 47d).
32K