Difference between revisions of "Samples"

From MSX Game Library

 
(57 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.
+
Here is a list of sample programs included with '''MSXgl''' to illustrate how to use the library’s various features and functions.
 +
To test a sample program, follow these steps:
 +
# Open a command-line interface in the <tt>MSXgl/projects/samples/</tt> directory.
 +
# Run one of the following commands, depending on your operating system:
 +
#* <tt>build.bat s_game</tt> (Windows)
 +
#* <tt>./build.sh s_game</tt> (Linux & macOS)
  
To try out the different samples, simply open a command line in the <tt>MSXgl/projects/samples/</tt> directory and run:
+
Replace <tt>s_game</tt> with the name of the sample you wish to test (there’s no need to include the <tt>.c</tt> file extension).
* <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.
+
<u>Note:</u> Sample programs use a configuration system that overwrites the default project settings (<tt>project_config.js</tt>) with a sample-specific configuration file (e.g., <tt>s_game.js</tt>). This approach allows multiple projects to coexist in the same directory without conflicts.
  
 +
For standalone projects, this step is unnecessary. To learn how to set up your own project from scratch, see [[Create my first program|this guide]].
  
 
== Core ==
 
== Core ==
Line 13: Line 17:
 
{{SAMPLE_BOX
 
{{SAMPLE_BOX
 
|name=Hello
 
|name=Hello
|desc=Program showing the minimal code needed to display a text.
+
|desc=Program showing the minimal code needed to display a "Hello World!" text.
 
|module1=
 
|module1=
 
|module2=
 
|module2=
Line 23: Line 27:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_hello.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_hello.jpg
 
}}
 
}}
Line 40: Line 44:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_bios.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_bios.jpg
 
}}
 
}}
Line 47: Line 51:
 
{{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 57: Line 61:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_clock.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_clock.jpg
 
}}
 
}}
Line 74: Line 78:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_psg.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_psg.jpg
 
}}
 
}}
Line 91: Line 95:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_sys.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_sys.jpg
 
}}
 
}}
Line 100: Line 104:
 
{{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 110: Line 114:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_draw.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_draw.jpg
 
}}
 
}}
Line 127: Line 131:
 
|target=ROM_32K
 
|target=ROM_32K
 
|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 144: Line 148:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_print.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_print.jpg
 +
}}
 +
 +
=== Scrolling ===
 +
{{SAMPLE_BOX
 +
|name=Scrolling
 +
|desc=Program showing the use of multi-directionnal tile-based scrolling and screen adjust register for smooth scrolling.
 +
|module1=vdp
 +
|module2=scroll
 +
|module3=
 +
|module4=
 +
|module5=
 +
|file=s_scroll.c
 +
|machine=MSX2
 +
|target=ROM_32K
 +
|ext=
 +
|state=FUNCTIONAL
 +
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_scroll.png
 
}}
 
}}
  
Line 161: Line 182:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_sm1.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_sm1.jpg
 
}}
 
}}
Line 168: Line 189:
 
{{SAMPLE_BOX
 
{{SAMPLE_BOX
 
|name=Sprite
 
|name=Sprite
|desc=Program showing the use of sprite mode 2 and split screen to change VDP setting during screen rendering.
+
|desc=Program demonstrating the use of sprite mode 2 (including multi-colors) and split screen using the horizontal interrupt to modify VDP parameters during screen rendering.
 
|module1=vdp
 
|module1=vdp
 
|module2=
 
|module2=
Line 178: Line 199:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|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 195: Line 233:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_swsprt.png
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_swsprt.png
 
}}
 
}}
Line 202: Line 240:
 
{{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 212: Line 250:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_swtile.png
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_swtile.png
 
}}
 
}}
Line 219: Line 257:
 
{{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 229: Line 267:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_text.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_text.jpg
 
}}
 
}}
Line 246: Line 284:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_vdpcmd.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_vdpcmd.jpg
 
}}
 
}}
Line 265: Line 303:
 
|target=DOS0
 
|target=DOS0
 
|ext=
 
|ext=
|state=Partial
+
|state=PARTIAL
 
|img=
 
|img=
 
}}
 
}}
Line 282: Line 320:
 
|target=DOS1
 
|target=DOS1
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
|img=
+
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_dos.png
 
}}
 
}}
  
Line 299: Line 337:
 
|target=DOS2
 
|target=DOS2
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
|img=
+
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_dos2.png
 
}}
 
}}
  
Line 316: Line 354:
 
|target=ROM_ASCII8_128K
 
|target=ROM_ASCII8_128K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=
 
|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_neomap.c
 +
|machine=MSX1
 +
|target=ROM_NEO8_8M
 +
|ext=
 +
|state=FUNCTIONAL
 +
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_neomap.png
 
}}
 
}}
  
Line 335: Line 390:
 
|target=BIN_USR
 
|target=BIN_USR
 
|ext={{NINJATAP}}
 
|ext={{NINJATAP}}
|state=Functional
+
|state=FUNCTIONAL
|img=
+
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_usr.png
 
}}
 
}}
  
Line 343: Line 398:
 
|name=Compressor
 
|name=Compressor
 
|desc=Program showing the use of several compression algorithms (RLEp, Bitbuster 1 & 2, ZX0 and Pletter).
 
|desc=Program showing the use of several compression algorithms (RLEp, Bitbuster 1 & 2, ZX0 and Pletter).
|module1=compress
+
|module1=compress/bitbuster
|module2=compress/bitbuster
+
|module2=compress/bitbuster2
|module3=compress/bitbuster2
+
|module3=compress/lz48
|module4=compress/zx0
+
|module4=compress/pletter
|module5=compress/pletter
+
|module5=compress/zx0
 
|file=s_zip.c
 
|file=s_zip.c
 
|machine=MSX2
 
|machine=MSX2
 
|target=DOS1
 
|target=DOS1
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
|img=
+
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_zip.png
 +
}}
 +
 
 +
=== Driver ===
 +
{{SAMPLE_BOX
 +
|name=Driver
 +
|desc=Program showing the creation of the driver, a code designed to be placed in memory and executed from a main program. Used in [[#MSX-DOS 2]] sample.
 +
|module1=
 +
|module2=
 +
|module3=
 +
|module4=
 +
|module5=
 +
|file=s_drv.c
 +
|machine=MSX1
 +
|target=RAW
 +
|ext=
 +
|state=FUNCTIONAL
 +
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_drv.png
 +
}}
 +
 
 +
=== Encryption ===
 +
{{SAMPLE_BOX
 +
|name=Encryption
 +
|desc=Program showing the use of an encoding system to encrypt data. Useful for creating backup codes, for example.
 +
|module1=crypt
 +
|module2=
 +
|module3=
 +
|module4=
 +
|module5=
 +
|file=s_crypt.c
 +
|machine=MSX1
 +
|target=ROM_32K
 +
|ext=
 +
|state=FUNCTIONAL
 +
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_crypt.png
 
}}
 
}}
  
Line 359: Line 448:
 
{{SAMPLE_BOX
 
{{SAMPLE_BOX
 
|name=Game
 
|name=Game
|desc=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.)  
+
|desc=Program showing the use of Game state and Game pawn modules. The Game state module offers state management while Game pawn allows to manage characters (display, animation, movement, collision, etc.)  
|module1=game
+
|module1=game/state
|module2=game_pawn
+
|module2=game/pawn
 
|module3=
 
|module3=
 
|module4=
 
|module4=
Line 369: Line 458:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|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=Demonstration of the localization management module with support for multiple languages and management of different character sets.
 +
|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
 
}}
 
}}
  
Line 386: Line 492:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_math.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_math.jpg
 
}}
 
}}
  
=== Scrolling ===
+
=== Menu ===
 +
{{SAMPLE_BOX
 +
|name=Menu
 +
|desc=Program showing the use of Menu module.
 +
|module1=game/menu
 +
|module2=
 +
|module3=
 +
|module4=
 +
|module5=
 +
|file=s_menu.c
 +
|machine=MSX1
 +
|target=ROM_32K
 +
|ext=
 +
|state=PARTIAL
 +
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_menu.png
 +
}}
 +
 
 +
=== QR Code ===
 +
{{SAMPLE_BOX
 +
|name=QR Code
 +
|desc=Program showing the use of QR Code module.
 +
|module1=tool/qrcode
 +
|module2=
 +
|module3=
 +
|module4=
 +
|module5=
 +
|file=s_qrcode.c
 +
|machine=MSX2
 +
|target=ROM_32K
 +
|ext=
 +
|state=FUNCTIONAL
 +
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_qrcode.png
 +
}}
 +
 
 +
=== QR Code Tiny ===
 
{{SAMPLE_BOX
 
{{SAMPLE_BOX
|name=Scrolling
+
|name=QR Code
|desc=Program showing the use of multi-directionnal tile-based scrolling and screen adjust register for smooth scrolling.
+
|desc=Program showing the use of QR Code Tiny module (version optimized for fixed size).
|module1=vdp
+
|module1=tool/qrcode_tiny
|module2=scroll
+
|module2=
 
|module3=
 
|module3=
 
|module4=
 
|module4=
 
|module5=
 
|module5=
|file=s_scroll.c
+
|file=s_qrtiny.c
 
|machine=MSX2
 
|machine=MSX2
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_scroll.png
+
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_qrtiny.png
 +
}}
 +
 
 +
=== Save ===
 +
{{SAMPLE_BOX
 +
|name=Save
 +
|desc=Program showing the use of data save from cartridge (supporting floppy disk and PAC cartridge).
 +
|module1=tool/disk_save
 +
|module2=device/pac
 +
|module3=
 +
|module4=
 +
|module5=
 +
|file=s_save.c
 +
|machine=MSX1
 +
|target=ROM_32K
 +
|ext=
 +
|state=FUNCTIONAL
 +
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_save.png
 +
}}
 +
 
 +
=== WaveGame ===
 +
{{SAMPLE_BOX
 +
|name=WaveGame
 +
|desc=Program demonstrate the use WaveGame feature for the Pico+ cartridge.
 +
|module1=device/wavegame
 +
|module2=
 +
|module3=
 +
|module4=
 +
|module5=
 +
|file=s_wavegm.c
 +
|machine=MSX1
 +
|target=ROM_32K
 +
|ext=
 +
|state=FUNCTIONAL
 +
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_wavegm.png
 
}}
 
}}
  
Line 422: Line 596:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_joystick.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_joystick.jpg
 
}}
 
}}
Line 439: Line 613:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_keyboard.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_keyboard.jpg
 
}}
 
}}
Line 456: Line 630:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
|img=
+
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_mouse.png
 
}}
 
}}
  
Line 473: Line 647:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext={{NINJATAP}}
 
|ext={{NINJATAP}}
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_ntap.png
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_ntap.png
 +
}}
 +
 +
=== JoyMega ===
 +
{{SAMPLE_BOX
 +
|name=JoyMega
 +
|desc=Program showing the use of JoyMega adapter to use 8 buttons Megadrive joystick on MSX.
 +
|module1=device/joymega
 +
|module2=device/msx-hid
 +
|module3=
 +
|module4=
 +
|module5=
 +
|file=s_jmega.c
 +
|machine=MSX1
 +
|target=ROM_32K
 +
|ext={{JOYMEGA}}
 +
|state=FUNCTIONAL
 +
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_jmega.png
 +
}}
 +
 +
=== Lightgun ===
 +
{{SAMPLE_BOX
 +
|name=Lightgun
 +
|desc=Program showing the use of 'ASCII Plus-X Terminator' and 'MHT Gun-Stick' lightguns on MSX.
 +
|module1=device/lightgun
 +
|module2=
 +
|module3=
 +
|module4=
 +
|module5=
 +
|file=s_lgun.c
 +
|machine=MSX1
 +
|target=ROM_32K
 +
|ext=
 +
|state=PARTIAL
 +
|img=
 
}}
 
}}
  
Line 489: Line 697:
 
|machine=MSX1
 
|machine=MSX1
 
|target=ROM_16K
 
|target=ROM_16K
|ext=
+
|ext=OBSONET
|state=Partial
+
|state=WIP
 
|img=
 
|img=
 
}}
 
}}
Line 507: Line 715:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext={{PAC}}
 
|ext={{PAC}}
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_pac.png
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_pac.png
 +
}}
 +
 +
=== Paddle ===
 +
{{SAMPLE_BOX
 +
|name=Paddle
 +
|desc=Program showing the use of Arkanoid Vaus Paddle module.
 +
|module1=device/paddle
 +
|module2=
 +
|module3=
 +
|module4=
 +
|module5=
 +
|file=s_paddle.c
 +
|machine=MSX1
 +
|target=ROM_48K_ISR
 +
|ext=PADDLE
 +
|state=FUNCTIONAL
 +
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_paddle.png
 
}}
 
}}
  
Line 524: Line 749:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext={{V9990}}
 
|ext={{V9990}}
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_v9990.png
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_v9990.png
 
}}
 
}}
Line 533: Line 758:
 
{{SAMPLE_BOX
 
{{SAMPLE_BOX
 
|name=Arkos
 
|name=Arkos
|desc=Program showing the use of Arkos Tracker II's replayers.
+
|desc=Program to demonstrate the use of the different Arkos Tracker (AT2 and AT3) music replayers.
 
|module1=arkos/akg_player
 
|module1=arkos/akg_player
 
|module2=arkos/akm_player
 
|module2=arkos/akm_player
Line 543: Line 768:
 
|target=ROM_ASCII8_128K
 
|target=ROM_ASCII8_128K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_arkos.png
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_arkos.png
 
}}
 
}}
Line 550: Line 775:
 
{{SAMPLE_BOX
 
{{SAMPLE_BOX
 
|name=ayFX
 
|name=ayFX
|desc=Program showing the use of ayFX's replayer.
+
|desc=Program showing the use of ayFX sound effect replayer (both using a bank or a single sound file).
 
|module1=ayfx/ayfx_player
 
|module1=ayfx/ayfx_player
 
|module2=
 
|module2=
Line 560: Line 785:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_ayfx.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_ayfx.jpg
 
}}
 
}}
Line 568: Line 793:
 
|name=Light VGM
 
|name=Light VGM
 
|desc=Program showing the use of light-VGM's replayer (PSG).
 
|desc=Program showing the use of light-VGM's replayer (PSG).
|module1=lvgm/lvgm_player
+
|module1=vgm/lvgm_player
 +
|module2=dos_mapper
 +
|module3=
 +
|module4=
 +
|module5=
 +
|file=s_lvgm.c
 +
|machine=MSX1
 +
|target=DOS2
 +
|ext=
 +
|state=FUNCTIONAL
 +
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_lvgm.png
 +
}}
 +
 
 +
=== NDP ===
 +
{{SAMPLE_BOX
 +
|name=NDP
 +
|desc=Program showing the use of NDP replayer (PSG).
 +
|module1=ndp/ndp_player
 
|module2=
 
|module2=
 
|module3=
 
|module3=
 
|module4=
 
|module4=
 
|module5=
 
|module5=
|file=s_lvgm.c
+
|file=s_ndp.c
 
|machine=MSX1
 
|machine=MSX1
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
|img=
+
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_ndp.png
 
}}
 
}}
  
Line 594: Line 836:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_pcm.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_pcm.jpg
 
}}
 
}}
Line 611: Line 853:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
|img=
+
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_pcmplay.png
 
}}
 
}}
  
Line 628: Line 870:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_pt3.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_pt3.jpg
 
}}
 
}}
Line 645: Line 887:
 
|target=ROM_KONAMI_SCC_128K
 
|target=ROM_KONAMI_SCC_128K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
|img=
+
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_trilo.png
 
}}
 
}}
  
Line 662: Line 904:
 
|target=ROM_ASCII16_256K
 
|target=ROM_ASCII16_256K
 
|ext={{SCC}} {{MSXMUSIC}} {{MSXAUDIO}}
 
|ext={{SCC}} {{MSXMUSIC}} {{MSXAUDIO}}
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_vgm.jpg
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_vgm.jpg
 
}}
 
}}
Line 679: Line 921:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_wyz.png
 
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_wyz.png
 
}}
 
}}
Line 696: Line 938:
 
|target=ROM_32K
 
|target=ROM_32K
 
|ext=
 
|ext=
|state=Functional
+
|state=FUNCTIONAL
|img=
+
|img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_wyz2.png
 
}}
 
}}

Latest revision as of 20:38, 19 October 2025

Here is a list of sample programs included with MSXgl to illustrate how to use the library’s various features and functions. To test a sample program, follow these steps:

  1. Open a command-line interface in the MSXgl/projects/samples/ directory.
  2. Run one of the following commands, depending on your operating system:
    • build.bat s_game (Windows)
    • ./build.sh s_game (Linux & macOS)

Replace s_game with the name of the sample you wish to test (there’s no need to include the .c file extension).

Note: Sample programs use a configuration system that overwrites the default project settings (project_config.js) with a sample-specific configuration file (e.g., s_game.js). This approach allows multiple projects to coexist in the same directory without conflicts.

For standalone projects, this step is unnecessary. To learn how to set up your own project from scratch, see this guide.

Core

Hello World

Program showing the minimal code needed to display a "Hello World!" 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

Scrolling

Program showing the use of multi-directionnal tile-based scrolling and screen adjust register for smooth scrolling.
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 demonstrating the use of sprite mode 2 (including multi-colors) and split screen using the horizontal interrupt to modify VDP parameters 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.
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

Driver

Program showing the creation of the driver, a code designed to be placed in memory and executed from a main program. Used in #MSX-DOS 2 sample.
  • File: s_drv.c
  • State: ✔️ Functional

Encryption

Program showing the use of an encoding system to encrypt data. Useful for creating backup codes, for example.
32K

Game

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

Localize

Demonstration of the localization management module with support for multiple languages and management of different character sets.
32K

Math

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

Menu

Program showing the use of Menu module.
32K

QR Code

Program showing the use of QR Code module.
32K

QR Code Tiny

Program showing the use of QR Code Tiny module (version optimized for fixed size).
32K

Save

Program showing the use of data save from cartridge (supporting floppy disk and PAC cartridge).
32K

WaveGame

Program demonstrate the use WaveGame feature for the Pico+ cartridge.
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

JoyMega

Program showing the use of JoyMega adapter to use 8 buttons Megadrive joystick on MSX.

Lightgun

Program showing the use of 'ASCII Plus-X Terminator' and 'MHT Gun-Stick' lightguns on MSX.
32K

ObsoNET

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

PAC

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

Paddle

Program showing the use of Arkanoid Vaus Paddle module.
48K (ISR) PADDLE

V9990

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

Audio Format

Arkos

Program to demonstrate the use of the different Arkos Tracker (AT2 and AT3) music replayers.
ASCII8 128K

ayFX

Program showing the use of ayFX sound effect replayer (both using a bank or a single sound file).
32K

lVGM

Program showing the use of light-VGM's replayer (PSG).
MSX-DOS 2

NDP

Program showing the use of NDP 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