Difference between revisions of "Samples"
From MSX Game Library
(→Audio Format) |
|||
(68 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | 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) | ||
− | + | 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). | |
− | + | <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. | |
− | ==== Hello World | + | 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 == | ||
+ | |||
+ | === Hello World === | ||
{{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 18: | Line 27: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === BIOS === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=BIOS | |name=BIOS | ||
Line 35: | Line 44: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === Clock === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Clock | |name=Clock | ||
− | |desc=Program showing the use of the Real Time Clock (Ricoh RP-5C01) to get current time and save/load 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 52: | Line 61: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === PSG === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=PSG | |name=PSG | ||
Line 69: | Line 78: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === System === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=System | |name=System | ||
Line 86: | Line 95: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | == Render == | |
− | + | === Draw === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Draw | |name=Draw | ||
Line 105: | Line 114: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === Graph Mode 3 === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Graph Mode 3 | |name=Graph Mode 3 | ||
Line 122: | Line 131: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |state=FUNCTIONAL |
− | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/ | + | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_gm3_2.png |
}} | }} | ||
− | + | === Print === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Print | |name=Print | ||
Line 139: | Line 148: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | ==== Sprite Mode 1 | + | === 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 | ||
+ | }} | ||
+ | |||
+ | === Sprite Mode 1 === | ||
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Sprite | |name=Sprite | ||
Line 156: | Line 182: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === Sprite Mode 2 === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Sprite | |name=Sprite | ||
− | |desc=Program | + | |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 173: | Line 199: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | ==== Software Sprite | + | === 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 | ||
+ | }} | ||
+ | |||
+ | === Software Sprite === | ||
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Software Sprite | |name=Software Sprite | ||
Line 190: | Line 233: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === Software Tile === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Software Tile | |name=Software Tile | ||
Line 207: | Line 250: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === Text === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Text | |name=Text | ||
Line 224: | Line 267: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === VDP Command === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=VDP | |name=VDP | ||
Line 241: | Line 284: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | == Target format == | |
− | + | === Boot Disk === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Boot Disk | |name=Boot Disk | ||
Line 260: | Line 303: | ||
|target=DOS0 | |target=DOS0 | ||
|ext= | |ext= | ||
− | |state= | + | |state=PARTIAL |
|img= | |img= | ||
}} | }} | ||
− | + | === MSX-DOS === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=MSX-DOS | |name=MSX-DOS | ||
Line 277: | Line 320: | ||
|target=DOS1 | |target=DOS1 | ||
|ext= | |ext= | ||
− | |state= | + | |state=FUNCTIONAL |
− | |img= | + | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_dos.png |
}} | }} | ||
− | + | === MSX-DOS 2 === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=MSX-DOS 2 | |name=MSX-DOS 2 | ||
Line 294: | Line 337: | ||
|target=DOS2 | |target=DOS2 | ||
|ext= | |ext= | ||
− | |state= | + | |state=FUNCTIONAL |
− | |img= | + | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_dos2.png |
}} | }} | ||
− | + | === Mapped ROM === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Mapped ROM | |name=Mapped ROM | ||
Line 309: | Line 352: | ||
|file=s_mapper.c | |file=s_mapper.c | ||
|machine=MSX1 | |machine=MSX1 | ||
− | |target= | + | |target=ROM_ASCII8_128K |
|ext= | |ext= | ||
− | |state= | + | |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 | ||
+ | }} | ||
− | ==== BASIC USR | + | == Utilities == |
+ | |||
+ | === BASIC USR === | ||
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=BASIC USR | |name=BASIC USR | ||
Line 330: | Line 390: | ||
|target=BIN_USR | |target=BIN_USR | ||
|ext={{NINJATAP}} | |ext={{NINJATAP}} | ||
− | |state= | + | |state=FUNCTIONAL |
− | |img= | + | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_usr.png |
}} | }} | ||
− | + | === Compressor === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Compressor | |name=Compressor | ||
− | |desc=Program showing the use 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/ | + | |module2=compress/bitbuster2 |
− | |module3=compress/ | + | |module3=compress/lz48 |
− | |module4=compress/ | + | |module4=compress/pletter |
− | |module5=compress/ | + | |module5=compress/zx0 |
|file=s_zip.c | |file=s_zip.c | ||
|machine=MSX2 | |machine=MSX2 | ||
|target=DOS1 | |target=DOS1 | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === Game === | |
{{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= | + | |module2=game/pawn |
|module3= | |module3= | ||
|module4= | |module4= | ||
Line 364: | Line 458: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | ==== Math | + | === 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 | ||
+ | }} | ||
+ | |||
+ | === Math === | ||
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Math | |name=Math | ||
Line 381: | Line 492: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | === | + | === Menu === |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
− | |name= | + | |name=Menu |
− | |desc=Program showing the use of | + | |desc=Program showing the use of Menu module. |
− | |module1= | + | |module1=game/menu |
− | |module2= | + | |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 | ||
+ | |name=QR Code | ||
+ | |desc=Program showing the use of QR Code Tiny module (version optimized for fixed size). | ||
+ | |module1=tool/qrcode_tiny | ||
+ | |module2= | ||
|module3= | |module3= | ||
|module4= | |module4= | ||
|module5= | |module5= | ||
− | |file= | + | |file=s_qrtiny.c |
|machine=MSX2 | |machine=MSX2 | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |state=FUNCTIONAL |
− | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/ | + | |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 | ||
}} | }} | ||
− | + | == Devices == | |
− | + | === Joystick === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Joystick | |name=Joystick | ||
Line 417: | Line 596: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === Keyboard === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Keyboard | |name=Keyboard | ||
Line 434: | Line 613: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === Mouse === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Mouse | |name=Mouse | ||
− | |desc=Program showing the use of mouse device | + | |desc=Program showing the use of mouse device and universal port (joystick port) device detection. |
|module1=input | |module1=input | ||
|module2= | |module2= | ||
Line 451: | Line 630: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |state=FUNCTIONAL |
− | |img= | + | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_mouse.png |
}} | }} | ||
− | + | === Ninja Tap === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Ninja Tap | |name=Ninja Tap | ||
Line 468: | Line 647: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext={{NINJATAP}} | |ext={{NINJATAP}} | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | ==== ObsoNET | + | === 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= | ||
+ | }} | ||
+ | |||
+ | === ObsoNET === | ||
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=ObsoNET | |name=ObsoNET | ||
Line 484: | Line 697: | ||
|machine=MSX1 | |machine=MSX1 | ||
|target=ROM_16K | |target=ROM_16K | ||
− | |ext= | + | |ext=OBSONET |
− | |state= | + | |state=WIP |
|img= | |img= | ||
}} | }} | ||
− | + | === PAC === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=PAC | |name=PAC | ||
Line 502: | Line 715: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext={{PAC}} | |ext={{PAC}} | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | ==== V9990 | + | === 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 | ||
+ | }} | ||
+ | |||
+ | === V9990 === | ||
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=V9990 | |name=V9990 | ||
Line 519: | Line 749: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext={{V9990}} | |ext={{V9990}} | ||
− | |state= | + | |state=FUNCTIONAL |
− | |img= | + | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_v9990.png |
}} | }} | ||
− | + | == Audio Format == | |
− | + | === Arkos === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Arkos | |name=Arkos | ||
− | |desc=Program | + | |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 538: | Line 768: | ||
|target=ROM_ASCII8_128K | |target=ROM_ASCII8_128K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === ayFX === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=ayFX | |name=ayFX | ||
− | |desc=Program showing the use of ayFX | + | |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 555: | Line 785: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === lVGM === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|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= | + | |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= | + | |file=s_ndp.c |
|machine=MSX1 | |machine=MSX1 | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |state=FUNCTIONAL |
− | |img= | + | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_ndp.png |
}} | }} | ||
− | + | === PCM-Encoder === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=PCM Encoder | |name=PCM Encoder | ||
− | |desc=. | + | |desc=Program showing the use of the PCM Encoder's replayer (aka. ''Crystal clean PCM 8bit samples on the poor PSG''). |
− | |module1= | + | |module1=pcm/pcmenc |
|module2= | |module2= | ||
|module3= | |module3= | ||
Line 589: | Line 836: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === PCM Play === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=PCM Play | |name=PCM Play | ||
− | |desc=. | + | |desc=Program showing the use of the PCM Play's replayer. |
− | |module1= | + | |module1=pcm/pcmplay |
|module2= | |module2= | ||
|module3= | |module3= | ||
Line 603: | Line 850: | ||
|module5= | |module5= | ||
|file=s_pcmplay.c | |file=s_pcmplay.c | ||
− | |machine= | + | |machine=MSX1 |
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |state=FUNCTIONAL |
− | |img= | + | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_pcmplay.png |
}} | }} | ||
− | + | === PT3 === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=PT3 | |name=PT3 | ||
Line 623: | Line 870: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === Trilo Tracker SCC === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Trilo Tracker SCC | |name=Trilo Tracker SCC | ||
Line 640: | Line 887: | ||
|target=ROM_KONAMI_SCC_128K | |target=ROM_KONAMI_SCC_128K | ||
|ext= | |ext= | ||
− | |state= | + | |state=FUNCTIONAL |
− | |img= | + | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/refs/heads/main/engine/doc/img/project/s_trilo.png |
}} | }} | ||
− | + | === VGM === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=VGM | |name=VGM | ||
Line 657: | Line 904: | ||
|target=ROM_ASCII16_256K | |target=ROM_ASCII16_256K | ||
|ext={{SCC}} {{MSXMUSIC}} {{MSXAUDIO}} | |ext={{SCC}} {{MSXMUSIC}} {{MSXAUDIO}} | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === WYZ === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=WYZ | |name=WYZ | ||
Line 674: | Line 921: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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 | ||
}} | }} | ||
− | + | === WYZ2 === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=WYZ2 | |name=WYZ2 | ||
Line 691: | Line 938: | ||
|target=ROM_32K | |target=ROM_32K | ||
|ext= | |ext= | ||
− | |state= | + | |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:
- Open a command-line interface in the MSXgl/projects/samples/ directory.
- 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

- File: s_hello.c
- State: ✔️ Functional


BIOS



Clock



PSG



System
Render
Draw



Graph Mode 3






Scrolling



Sprite Mode 1



Sprite Mode 2

- Showcased modules:
- File: s_sprite.c
- State: ✔️ Functional


Sprite FX

- Showcased modules:
- File: s_sprtfx.c
- State: ✔️ Functional


Software Sprite

- Showcased modules:
- File: s_swsprt.c
- State: ✔️ Functional


Software Tile

- Showcased modules:
- File: s_swtile.c
- State: ✔️ Functional


Text




VDP Command

- Showcased modules:
- File: s_vdpcmd.c
- State: ✔️ Functional


Target format
Boot Disk



MSX-DOS




MSX-DOS 2



Mapped ROM

- File: s_mapper.c
- State: ✔️ Functional


NEO mapper

- File: s_neomap.c
- State: ✔️ Functional


Utilities
BASIC USR




Compressor

- Showcased modules:
- compress/bitbuster (doc, code)
- compress/bitbuster2 (doc, code)
- compress/lz48 (doc, code)
- compress/pletter (doc, code)
- compress/zx0 (doc, code)
- File: s_zip.c
- State: ✔️ Functional


Driver

- File: s_drv.c
- State: ✔️ Functional


Encryption



Game



Localize



Math



Menu



QR Code

- Showcased modules:
- tool/qrcode (doc, code)
- File: s_qrcode.c
- State: ✔️ Functional


QR Code Tiny

- Showcased modules:
- File: s_qrtiny.c
- State: ✔️ Functional


Save

- Showcased modules:
- tool/disk_save (doc, code)
- device/pac (doc, code)
- File: s_save.c
- State: ✔️ Functional


WaveGame

- Showcased modules:
- File: s_wavegm.c
- State: ✔️ Functional


Devices
Joystick

- Showcased modules:
- File: s_joystk.c
- State: ✔️ Functional


Keyboard

- Showcased modules:
- File: s_keybrd.c
- State: ✔️ Functional


Mouse



Ninja Tap

- Showcased modules:
- File: s_ntap.c
- State: ✔️ Functional



JoyMega

- Showcased modules:
- device/joymega (doc, code)
- device/msx-hid (doc, code)
- File: s_jmega.c
- State: ✔️ Functional
Lightgun

- Showcased modules:
- File: s_lgun.c
- State: ❓ Partially functional


ObsoNET

- Showcased modules:
- File: s_onet.c
- State: 🚧 Work in progress


PAC

- Showcased modules:
- device/pac (doc, code)
- File: s_pac.c
- State: ✔️ Functional



Paddle

- Showcased modules:
- device/paddle (doc, code)
- File: s_paddle.c
- State: ✔️ Functional


V9990




Audio Format
Arkos

- Showcased modules:
- File: s_arkos.c
- State: ✔️ Functional


ayFX

- Showcased modules:
- File: s_ayfx.c
- State: ✔️ Functional


lVGM

- Showcased modules:
- vgm/lvgm_player (doc, code)
- dos_mapper (doc, code)
- File: s_lvgm.c
- State: ✔️ Functional


NDP

- Showcased modules:
- File: s_ndp.c
- State: ✔️ Functional


PCM-Encoder

- Showcased modules:
- pcm/pcmenc (doc, code)
- File: s_pcmenc.c
- State: ✔️ Functional


PCM Play

- Showcased modules:
- pcm/pcmplay (doc, code)
- File: s_pcmplay.c
- State: ✔️ Functional


PT3

- Showcased modules:
- File: s_pt3.c
- State: ✔️ Functional


Trilo Tracker SCC

- Showcased modules:
- File: s_trilo.c
- State: ✔️ Functional



VGM

- Showcased modules:
- File: s_vgm.c
- State: ✔️ Functional





WYZ

- Showcased modules:
- File: s_wyz.c
- State: ✔️ Functional


WYZ2

- Showcased modules:
- File: s_wyz2.c
- State: ✔️ Functional

