From b6fa12a1bd8b4a69882ec970b50a89cad109a39d Mon Sep 17 00:00:00 2001 From: Lunar Journal Date: Thu, 7 Sep 2023 09:23:43 +0200 Subject: emu8910: readme: update readme Update readme with additional info. --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 9881ce1..ab0cea6 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,34 @@ FIR filter data generated using: Compile with `tsc emu8910.ts`. +To use simply create a PSG49 object as follows: +``` +var emu8910 = new PSG49(YM_CLOCK_ZX, 50); +``` + +Which sets the default clock speed and interrupt frequency. + +To play a FYM module: +``` +song = new FYMReader(); +emu8910.interrupt.routine = +emu8910.clock.frequency = song.getClockRate() +emu8910.interrupt.frequency = song.getFrameRate() +``` + +This sets the ISR function, clock and interrupt frequency for a specific song. + +To stop playback: +``` +emu8910.driver.device.suspend() +emu8910.interrupt.frequency = 0 +``` +To resume: +``` +emu8910.driver.device.resume() +emu8910.interrupt.frequency = song.getFrameRate() +``` + Files: * src/emu8910.ts - Core emulator implementation -- cgit v1.2.3-70-g09d2