Skip to content

v0.15.4 - Comprehensive Standard Library

Latest

Choose a tag to compare

@oisee oisee released this 21 Dec 22:10
· 3 commits to master since this release

MinZ v0.15.4 - Comprehensive Standard Library

This release adds a complete standard library for MinZ with 10 modules and 2,400+ lines of game-ready code.

New Features

Standard Library Modules

Module Description Key Functions
math/fast Lookup tables fast_sin(), fast_cos(), fast_sqrt()
math/random PRNG & noise rand8(), rand_range(), noise2d()
graphics/screen Pixel graphics set_pixel(), draw_line(), draw_circle()
input/keyboard Input handling is_key_pressed(), get_key_dx()
text/string String ops strlen(), strcmp(), strcpy()
text/format Formatting u8_to_str(), u16_to_hex()
sound/beep Beeper SFX beep(), sfx_jump(), sfx_explosion()
time/delay Timing wait_frame(), delay_ms(), anim_frame()
mem/copy Fast memory memcpy(), memset(), memcmp()
cpm/bdos CP/M calls getchar(), putchar(), file_open()

Example Usage

import stdlib.graphics.screen;
import stdlib.input.keyboard;
import stdlib.time.delay;

fun main() -> void {
    clear_screen();
    set_ink(COLOR_CYAN);
    
    let x: u8 = 128;
    let y: u8 = 96;
    
    loop {
        wait_frame();
        clear_pixel(x, y);
        x = (x + get_key_dx()) as u8;
        y = (y + get_key_dy()) as u8;
        set_pixel(x, y);
    }
}

Improvements

  • All stdlib modules compile successfully with current compiler
  • Pure Z80 assembly for performance-critical functions
  • Game-focused utilities (get_key_dx()/dy(), anim_frame(), sfx_*())
  • Consistent API design across all modules

Statistics

  • 10 stdlib modules
  • 2,400+ lines of code
  • 100% compilation success
  • Zero external dependencies

Installation

git clone https://github.com/oisee/minz.git
cd minz/minzc
go build -o mz cmd/minzc/main.go

MinZ: Modern programming abstractions with zero-cost performance on vintage Z80 hardware.