From 5aab219d1964f15bf998e69bae2a228aa073f684 Mon Sep 17 00:00:00 2001 From: Lunar Journal Date: Wed, 6 Sep 2023 17:45:27 +0200 Subject: emu8910: parser: Update parser General parser updates. --- parser.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'parser.js') diff --git a/parser.js b/parser.js index 304cb0f..88efd2d 100644 --- a/parser.js +++ b/parser.js @@ -1,13 +1,14 @@ var song; var emu8910 = new PSG49(YM_CLOCK_ZX, 50); + var currentSong = 0; var songs = [ - "18_soundliner.fym", + "200km_nik-o.fym", "01_scalesmannmisfire.fym" ]; - var currentSong = 0; + loadAndPlay = function() { emu8910.driver.device.resume() @@ -51,6 +52,10 @@ emu8910.interrupt.routine = updateState; emu8910.clock.frequency = song.getClockRate() emu8910.interrupt.frequency = song.getFrameRate() + currentSong++ + if(currentSong >= songs.length){ + currentSong = 0; + } } document.addEventListener('click', loadAndPlay, false); -- cgit v1.2.3-70-g09d2