Difference between revisions of "Samples"
From MSX Game Library
(→Render) |
(→Driver) |
||
(90 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 | + | |desc=Program showing the minimal code needed to display a "Hello World!" text. |
+ | |module1= | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_hello.c | |file=s_hello.c | ||
|machine=MSX1 | |machine=MSX1 | ||
− | |state= | + | |target=ROM_32K |
+ | |ext= | ||
+ | |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 | ||
− | |desc=Program showing the use of | + | |desc=Program showing the use of default BIOS functions. |
+ | |module1=bios | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_bios.c | |file=s_bios.c | ||
|machine=MSX1 | |machine=MSX1 | ||
− | |state= | + | |target=ROM_32K |
+ | |ext= | ||
+ | |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 | ||
}} | }} | ||
− | ==== System | + | === Clock === |
+ | {{SAMPLE_BOX | ||
+ | |name=Clock | ||
+ | |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 | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_clock.c | ||
+ | |machine=MSX2 | ||
+ | |target=ROM_32K | ||
+ | |ext= | ||
+ | |state=Functional | ||
+ | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_clock.jpg | ||
+ | }} | ||
+ | |||
+ | === PSG === | ||
+ | {{SAMPLE_BOX | ||
+ | |name=PSG | ||
+ | |desc=Program showing the use of direct control over PSG sound chip. | ||
+ | |module1=psg | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_psg.c | ||
+ | |machine=MSX1 | ||
+ | |target=ROM_32K | ||
+ | |ext= | ||
+ | |state=Functional | ||
+ | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_psg.jpg | ||
+ | }} | ||
+ | |||
+ | === System === | ||
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=System | |name=System | ||
− | |desc= | + | |desc=Program showing the retrieval of system information. |
+ | |module1= | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_sys.c | |file=s_sys.c | ||
|machine=MSX1 | |machine=MSX1 | ||
− | |state= | + | |target=ROM_32K |
+ | |ext= | ||
+ | |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 | ||
− | |desc=Program showing the use of Draw module | + | |desc=Program showing the use of Draw module with the MSX2 bitmap screen modes. |
+ | |module1=vdp | ||
+ | |module2=draw | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_draw.c | |file=s_draw.c | ||
|machine=MSX2 | |machine=MSX2 | ||
− | |state= | + | |target=ROM_32K |
+ | |ext= | ||
+ | |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 | ||
− | |desc=. | + | |desc=Program showing the use of Screen 4 (aka Graph mode 3) with various configuration (including unofficial MSX configurations like "Screen 1.5"). |
+ | |module1=vdp | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_gm3.c | |file=s_gm3.c | ||
|machine=MSX2 | |machine=MSX2 | ||
− | |state= | + | |target=ROM_32K |
− | |img= | + | |ext= |
+ | |state=Functional | ||
+ | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_gm3_2.png | ||
+ | }} | ||
+ | |||
+ | === Print === | ||
+ | {{SAMPLE_BOX | ||
+ | |name=Print | ||
+ | |desc=Program showing the use of graphical print features (bitmap, sprite, effects, etc.). | ||
+ | |module1=print | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_print.c | ||
+ | |machine=MSX2 | ||
+ | |target=ROM_32K | ||
+ | |ext= | ||
+ | |state=Functional | ||
+ | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_print.jpg | ||
}} | }} | ||
− | + | === Sprite Mode 1 === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Sprite | |name=Sprite | ||
− | |desc=Program showing the use of sprite mode 1 and | + | |desc=Program showing the use of sprite mode 1 and a Sprite Attribute Table flip method to reduce sprite disappearance. |
+ | |module1=vdp | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_sm1.c | |file=s_sm1.c | ||
|machine=MSX1 | |machine=MSX1 | ||
− | |state= | + | |target=ROM_32K |
+ | |ext= | ||
+ | |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 | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_sprite.c | |file=s_sprite.c | ||
|machine=MSX2 | |machine=MSX2 | ||
− | |state= | + | |target=ROM_32K |
+ | |ext= | ||
+ | |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 | + | |name=Software Sprite |
− | |desc=Program showing the use of software sprite using VDP commands. | + | |desc=Program showing the use of software sprite for all bitmap modes using VDP commands. |
+ | |module1=vdp | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_swsprt.c | |file=s_swsprt.c | ||
|machine=MSX2 | |machine=MSX2 | ||
− | |state= | + | |target=ROM_32K |
+ | |ext= | ||
+ | |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 | ||
}} | }} | ||
− | ==== Text | + | === Software Tile === |
+ | {{SAMPLE_BOX | ||
+ | |name=Software Tile | ||
+ | |desc=Program showing the use of software tile mode for MSX2 bitmap modes (only Screen 5 & 8 has been tested). | ||
+ | |module1=vdp | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_swtile.c | ||
+ | |machine=MSX2 | ||
+ | |target=ROM_32K | ||
+ | |ext= | ||
+ | |state=Functional | ||
+ | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_swtile.png | ||
+ | }} | ||
+ | |||
+ | === Text === | ||
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Text | |name=Text | ||
− | |desc= | + | |desc=Program showing the use of print module with text modes (all MSX1 and MSX2 text/tiled mode). |
+ | |module1=print | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_text.c | |file=s_text.c | ||
− | |machine= | + | |machine=MSX12 |
− | |state= | + | |target=ROM_32K |
+ | |ext= | ||
+ | |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 | ||
− | |desc= | + | |desc=Program showing the use of VDP command to draw several effect in all bitmap modes. |
+ | |module1=vdp | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_vdpcmd.c | |file=s_vdpcmd.c | ||
|machine=MSX2 | |machine=MSX2 | ||
− | |state= | + | |target=ROM_32K |
+ | |ext= | ||
+ | |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 === | + | === 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 | ||
+ | }} | ||
+ | |||
+ | == Target format == | ||
+ | |||
+ | === Boot Disk === | ||
+ | {{SAMPLE_BOX | ||
+ | |name=Boot Disk | ||
+ | |desc=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. | ||
+ | |module1=dos | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_dos0.c | ||
+ | |machine=MSX2 | ||
+ | |target=DOS0 | ||
+ | |ext= | ||
+ | |state=Partial | ||
+ | |img= | ||
+ | }} | ||
− | + | === MSX-DOS === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=MSX-DOS | |name=MSX-DOS | ||
− | |desc=. | + | |desc=Program showing the use of MSX-DOS 1 routines to load and display image from file. |
+ | |module1=dos | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_dos.c | |file=s_dos.c | ||
− | |machine= | + | |machine=MSX22+ |
− | |state= | + | |target=DOS1 |
+ | |ext= | ||
+ | |state=Functional | ||
|img= | |img= | ||
}} | }} | ||
− | + | === MSX-DOS 2 === | |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=MSX-DOS 2 | |name=MSX-DOS 2 | ||
− | |desc=. | + | |desc=Program showing the use of various MSX-DOS 2 routines to load and display image, get disk information or handle mapped memory. |
+ | |module1=dos | ||
+ | |module2=dos_mapper | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_dos2.c | |file=s_dos2.c | ||
− | |machine= | + | |machine=MSX2 |
− | |state= | + | |target=DOS2 |
+ | |ext= | ||
+ | |state=Functional | ||
|img= | |img= | ||
}} | }} | ||
− | === | + | === Mapped ROM === |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
− | |name= | + | |name=Mapped ROM |
− | |desc=. | + | |desc=Program showing usage of mapped ROM and segments switching. |
− | |file= | + | |module1= |
− | |machine= | + | |module2= |
− | |state= | + | |module3= |
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_mapper.c | ||
+ | |machine=MSX1 | ||
+ | |target=ROM_ASCII8_128K | ||
+ | |ext= | ||
+ | |state=Functional | ||
|img= | |img= | ||
}} | }} | ||
− | === | + | === NEO mapper === |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
− | |name= | + | |name=NEO mapper |
− | |desc=Program showing usage of ROM | + | |desc=Program showing usage of NEO-8 mapped ROM and segments switching. |
− | |file= | + | |module1= |
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_neo0.c | ||
|machine=MSX1 | |machine=MSX1 | ||
− | |state= | + | |target=ROM_NEO8_8M |
+ | |ext= | ||
+ | |state=Functional | ||
|img= | |img= | ||
}} | }} | ||
− | + | == Utilities == | |
− | === | + | === Driver === |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
− | |name= | + | |name=Driver |
− | |desc=Program showing the | + | |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. |
− | |file= | + | |module1= |
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_drv.c | ||
+ | |machine=MSX1 | ||
+ | |target=RAW | ||
+ | |ext= | ||
+ | |state=Functional | ||
+ | |img= | ||
+ | }} | ||
+ | |||
+ | === BASIC USR === | ||
+ | {{SAMPLE_BOX | ||
+ | |name=BASIC USR | ||
+ | |desc=Program showing the creation of binary to be load and used from BASIC. | ||
+ | |module1=basic_usr | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_usr.c | ||
|machine=MSX1 | |machine=MSX1 | ||
− | |state= | + | |target=BIN_USR |
− | |img= | + | |ext={{NINJATAP}} |
+ | |state=Functional | ||
+ | |img= | ||
}} | }} | ||
− | === | + | === Compressor === |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
− | |name= | + | |name=Compressor |
− | |desc=Program showing the use of | + | |desc=Program showing the use of several compression algorithms (RLEp, Bitbuster 1 & 2, ZX0 and Pletter). |
− | |file= | + | |module1=compress/bitbuster |
+ | |module2=compress/bitbuster2 | ||
+ | |module3=compress/lz48 | ||
+ | |module4=compress/pletter | ||
+ | |module5=compress/zx0 | ||
+ | |file=s_zip.c | ||
|machine=MSX2 | |machine=MSX2 | ||
− | |state= | + | |target=DOS1 |
− | |img= | + | |ext= |
+ | |state=Functional | ||
+ | |img= | ||
}} | }} | ||
− | === | + | === Game === |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
− | |name= | + | |name=Game |
− | |desc=Program showing the use of | + | |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.) |
− | |file= | + | |module1=game/state |
− | |machine= | + | |module2=game/pawn |
− | |state= | + | |module3= |
− | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/ | + | |module4= |
+ | |module5= | ||
+ | |file=s_game.c | ||
+ | |machine=MSX1 | ||
+ | |target=ROM_32K | ||
+ | |ext= | ||
+ | |state=Functional | ||
+ | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_game.png | ||
}} | }} | ||
− | === | + | === Localize === |
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
− | |name= | + | |name=Localize |
− | |desc= | + | |desc=Demonstration of the localization management module with support for multiple languages and management of different character sets. |
− | |file= | + | |module1=localize |
− | |machine= | + | |module2= |
− | |state= | + | |module3= |
− | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/ | + | |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= | + | |name=Math |
− | |desc= | + | |desc=Program showing the use of mathematics pre-computed tables, pseudo-random generator and quick-computation functions. |
− | |file= | + | |module1=math |
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_math.c | ||
|machine=MSX2 | |machine=MSX2 | ||
− | |state= | + | |target=ROM_32K |
− | |img= | + | |ext= |
+ | |state=Functional | ||
+ | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_math.jpg | ||
}} | }} | ||
− | === | + | === Encryption === |
− | |||
− | |||
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
− | |name= | + | |name=Encryption |
− | |desc=Program showing the use of | + | |desc=Program showing the use of an encoding system to encrypt data. Useful for creating backup codes, for example. |
− | |file= | + | |module1=crypt |
− | |machine= | + | |module2= |
− | |state= | + | |module3= |
− | |img= | + | |module4= |
+ | |module5= | ||
+ | |file=s_crypt.c | ||
+ | |machine=MSX1 | ||
+ | |target=ROM_32K | ||
+ | |ext= | ||
+ | |state=Functional | ||
+ | |img= | ||
}} | }} | ||
− | ==== Joystick | + | == Devices == |
+ | |||
+ | === Joystick === | ||
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=Joystick | |name=Joystick | ||
|desc=Program showing the use of joystick and input manager. | |desc=Program showing the use of joystick and input manager. | ||
+ | |module1=input | ||
+ | |module2=input_manager | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_joystk.c | |file=s_joystk.c | ||
|machine=MSX1 | |machine=MSX1 | ||
− | |state= | + | |target=ROM_32K |
+ | |ext= | ||
+ | |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 | ||
|desc=Program showing the use of keyboard and input manager. | |desc=Program showing the use of keyboard and input manager. | ||
+ | |module1=input | ||
+ | |module2=input_manager | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_keybrd.c | |file=s_keybrd.c | ||
|machine=MSX1 | |machine=MSX1 | ||
− | |state= | + | |target=ROM_32K |
+ | |ext= | ||
+ | |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 | ||
+ | |name=Mouse | ||
+ | |desc=Program showing the use of mouse device and universal port (joystick port) device detection. | ||
+ | |module1=input | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_mouse.c | ||
+ | |machine=MSX1 | ||
+ | |target=ROM_32K | ||
+ | |ext= | ||
+ | |state=Functional | ||
+ | |img= | ||
+ | }} | ||
+ | |||
+ | === Ninja Tap === | ||
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
− | |name= | + | |name=Ninja Tap |
− | |desc=Program showing the use of | + | |desc=Program showing the use of NinjaTap device to connect up to 8 joysticks on one MSX machine. |
− | |file= | + | |module1=device/ninjatap |
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_ntap.c | ||
+ | |machine=MSX1 | ||
+ | |target=ROM_32K | ||
+ | |ext={{NINJATAP}} | ||
+ | |state=Functional | ||
+ | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_ntap.png | ||
+ | }} | ||
+ | |||
+ | === ObsoNET === | ||
+ | {{SAMPLE_BOX | ||
+ | |name=ObsoNET | ||
+ | |desc=Program showing the use of ObsoNET cartridge using network stack. | ||
+ | |module1=network/obsonet | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_onet.c | ||
+ | |machine=MSX1 | ||
+ | |target=ROM_16K | ||
+ | |ext= | ||
+ | |state=Partial | ||
+ | |img= | ||
+ | }} | ||
+ | |||
+ | === PAC === | ||
+ | {{SAMPLE_BOX | ||
+ | |name=PAC | ||
+ | |desc=Program showing the use of PAC or FM-PAC to load/save data into SRAM. | ||
+ | |module1=device/pac | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_pac.c | ||
+ | |machine=MSX1 | ||
+ | |target=ROM_32K | ||
+ | |ext={{PAC}} | ||
+ | |state=Functional | ||
+ | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_pac.png | ||
+ | }} | ||
+ | |||
+ | === V9990 === | ||
+ | {{SAMPLE_BOX | ||
+ | |name=V9990 | ||
+ | |desc=Program showing the use of Yamaha V9990 based video cartridge. | ||
+ | |module1=v9990 | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_v9990.c | ||
|machine=MSX1 | |machine=MSX1 | ||
− | |state= | + | |target=ROM_32K |
− | |img=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/ | + | |ext={{V9990}} |
+ | |state=Functional | ||
+ | |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= | + | |desc=Program to demonstrate the use of the different Arkos Tracker (AT2 and AT3) music replayers. |
+ | |module1=arkos/akg_player | ||
+ | |module2=arkos/akm_player | ||
+ | |module3=arkos/aky_player | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_arkos.c | |file=s_arkos.c | ||
|machine=MSX1 | |machine=MSX1 | ||
− | |state= | + | |target=ROM_ASCII8_128K |
+ | |ext= | ||
+ | |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= | + | |desc=Program showing the use of ayFX sound effect replayer (both using a bank or a single sound file). |
+ | |module1=ayfx/ayfx_player | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_ayfx.c | |file=s_ayfx.c | ||
|machine=MSX2 | |machine=MSX2 | ||
− | |state= | + | |target=ROM_32K |
+ | |ext= | ||
+ | |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=PCM | + | |name=Light VGM |
− | |desc= | + | |desc=Program showing the use of light-VGM's replayer (PSG). |
+ | |module1=lvgm/lvgm_player | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_lvgm.c | ||
+ | |machine=MSX1 | ||
+ | |target=ROM_32K | ||
+ | |ext= | ||
+ | |state=Functional | ||
+ | |img= | ||
+ | }} | ||
+ | |||
+ | === PCM-Encoder === | ||
+ | {{SAMPLE_BOX | ||
+ | |name=PCM Encoder | ||
+ | |desc=Program showing the use of the PCM Encoder's replayer (aka. ''Crystal clean PCM 8bit samples on the poor PSG''). | ||
+ | |module1=pcm/pcmenc | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_pcmenc.c | |file=s_pcmenc.c | ||
|machine=MSX1 | |machine=MSX1 | ||
− | |state= | + | |target=ROM_32K |
+ | |ext= | ||
+ | |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 | ||
}} | }} | ||
− | ==== PT3 | + | === PCM Play === |
+ | {{SAMPLE_BOX | ||
+ | |name=PCM Play | ||
+ | |desc=Program showing the use of the PCM Play's replayer. | ||
+ | |module1=pcm/pcmplay | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_pcmplay.c | ||
+ | |machine=MSX1 | ||
+ | |target=ROM_32K | ||
+ | |ext= | ||
+ | |state=Functional | ||
+ | |img= | ||
+ | }} | ||
+ | |||
+ | === PT3 === | ||
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=PT3 | |name=PT3 | ||
− | |desc= | + | |desc=Program showing the use of Vortex Tracker II's replayer. |
+ | |module1=pt3/pt3_player | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_pt3.c | |file=s_pt3.c | ||
|machine=MSX2 | |machine=MSX2 | ||
− | |state= | + | |target=ROM_32K |
+ | |ext= | ||
+ | |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 | ||
}} | }} | ||
− | ==== VGM | + | === Trilo Tracker SCC === |
+ | {{SAMPLE_BOX | ||
+ | |name=Trilo Tracker SCC | ||
+ | |desc=Program showing the use of Trilo Tracker SCC's replayer. | ||
+ | |module1=trilo/trilo_scc_player | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_trilo.c | ||
+ | |machine=MSX1 | ||
+ | |target=ROM_KONAMI_SCC_128K | ||
+ | |ext= | ||
+ | |state=Functional | ||
+ | |img= | ||
+ | }} | ||
+ | |||
+ | === VGM === | ||
{{SAMPLE_BOX | {{SAMPLE_BOX | ||
|name=VGM | |name=VGM | ||
− | |desc= | + | |desc=Program showing the use of VGM's replayer (PSG, SCC, MSX-Music, MSX-Audio). |
+ | |module1=vgm/vgm_player | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_vgm.c | |file=s_vgm.c | ||
|machine=MSX1 | |machine=MSX1 | ||
− | |state= | + | |target=ROM_ASCII16_256K |
+ | |ext={{SCC}} {{MSXMUSIC}} {{MSXAUDIO}} | ||
+ | |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 | ||
− | |desc= | + | |desc=Program showing the use of WYZ Tracker's replayer (version 0.3). |
+ | |module1=wyz/wyz_player | ||
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
|file=s_wyz.c | |file=s_wyz.c | ||
|machine=MSX1 | |machine=MSX1 | ||
− | |state= | + | |target=ROM_32K |
+ | |ext= | ||
+ | |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= | + | |name=WYZ2 |
− | |desc= | + | |desc=Program showing the use of WYZ Tracker's replayer (version 0.3 47d). |
− | |file= | + | |module1=wyz/wyz_player2 |
+ | |module2= | ||
+ | |module3= | ||
+ | |module4= | ||
+ | |module5= | ||
+ | |file=s_wyz2.c | ||
|machine=MSX1 | |machine=MSX1 | ||
− | | | + | |target=ROM_32K |
− | + | |ext= | |
− | + | |state=Functional | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | |state= | ||
|img= | |img= | ||
}} | }} |
Latest revision as of 17:47, 18 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






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


Scrolling



Target format
Boot Disk



MSX-DOS




MSX-DOS 2



Mapped ROM

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


NEO mapper

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


Utilities
Driver

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


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


Game



Localize



Math



Encryption



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



ObsoNET

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


PAC

- Showcased modules:
- device/pac (doc, code)
- File: s_pac.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:
- File: s_lvgm.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

