diff --git a/CHANGELOG.md b/CHANGELOG.md index 5aa574e..9cf5c0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,41 +1,48 @@ +# 1.7.4 (2023/12/04) +- Fixed the problem when exporting MML for MSX-DOS where an extra `EOF` marker was added even if it already exists. +- Fixed the problem where the name specified by the meta `name` directive was not reflected when exporting MML without pre-compiling. + +# 1.7.3 (2023/12/03) +- Removed `play after compile` checkbox. + # 1.7.2 (2023/11/27) -- Fix the problem where `l%n` is not highlighted. +- Fixed the problem where `l%n` was not highlighted. # 1.7.1 (2023/11/25) -- Fix the problem where the background theme is not immediately changed on Safari. +- Fixed the problem where the background theme was not immediately changed on Safari. # 1.7.0 (2023/11/24) -- Fix the problem where finite-length music is unexpectedly fading on replay. -- Enhance syntax highlighting. +- Fixed the problem where finite-length music was unexpectedly fading on replay. +- Enhanced MML syntax highlighting. # 1.6.2 (2023/11/07) -- Support MML export in MSX-DOS format. +- Added functionality for exporting MML in MSX-DOS format. # 1.6.0 (2023/08/19) -- Fix the problem where playback rate is ~1.7% higher than real hardware (thanks to @gcielniak). +- Fixed the problem where playback rate was ~1.7% higher than real hardware (thanks to @gcielniak). # 1.5.0 (2023/04/02) -- Use AudioWorklet for playback. +- Replaced the playback engine to use AudioWorklet. # 1.4.1 (2023/04/01) -- Fix the problem where background audio playback is not allowed. +- Fixed the problem where background audio playback was not allowed. - # 1.4.0 (2023/02/06) -- Add loop option as a meta MML property. -- Fix the problem where fade time is always set zero when export. +- Added `loop` property for meta MML params. +- Fixed the problem where fade time was always set zero when export. # 1.3.0 -- Improve PSG emulation quality. +- Improved PSG emulation quality. # 1.2.3 -- Update libkss (again) to fix [emu2413 issue #12](https://github.com/digital-sound-antiques/emu2413/issues/12) +- Updated libkss (again) to fix [emu2413 issue #12](https://github.com/digital-sound-antiques/emu2413/issues/12) # 1.2.2 -- Load lamejs dynaimcally to reduce JS footprint. -- Update libkss to fix [emu2413 issue #12](https://github.com/digital-sound-antiques/emu2413/issues/12) +- Now loading lamejs dynaimcally to reduce JS footprint. +- Updated libkss to fix [emu2413 issue #12](https://github.com/digital-sound-antiques/emu2413/issues/12) # 1.2.1 -- Add a progress indicator and an abort button on the VGM exporter modal. +- Added a progress indicator and an abort button on the VGM exporter modal. # 1.2.0 -- Add VGM exporter. \ No newline at end of file +- Added VGM exporter. \ No newline at end of file diff --git a/package.json b/package.json index fe6a59a..99fb763 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "msxplay-js", - "version": "1.7.3", + "version": "1.7.4", "description": "", "type": "module", "engines": { diff --git a/public/js/editor.js b/public/js/editor.js index 505fe78..9b37c0a 100644 --- a/public/js/editor.js +++ b/public/js/editor.js @@ -557,14 +557,20 @@ function downloadAudio(type, rate, kbps, quality) { } function downloadMML() { - var blob = new Blob([editor.getValue()], { type: "text/plain" }); - saveAs(blob, (lastCompiledName || Date.now()) + ".mml"); + const mml = editor.getValue(); + const info = getMetaMMLInfo(mml); + const name = info.name || "" + Date.now(); + const blob = new Blob([mml], { type: "text/plain" }); + saveAs(blob, name + ".mml"); } function downloadMMLforMSX() { - const mml4msx = MSXPlayUI.convertToMSXDOSText(editor.getValue()); - var blob = new Blob([mml4msx], { type: "text/plain" }); - saveAs(blob, (lastCompiledName || Date.now()) + ".mus"); + const mml = editor.getValue(); + const info = getMetaMMLInfo(mml); + const mml4msx = MSXPlayUI.convertToMSXDOSText(mml); + const name = info.name || "" + Date.now(); + const blob = new Blob([mml4msx], { type: "text/plain" }); + saveAs(blob, name + ".mus"); } function downloadMGS() { diff --git a/src/msxplay-ui.js b/src/msxplay-ui.js index 1b0e99b..fdfbf1e 100644 --- a/src/msxplay-ui.js +++ b/src/msxplay-ui.js @@ -102,7 +102,7 @@ export class MSXPlayUI { convertToMSXDOSText(text) { const data = Utf16toSjis(text.replace(/\r\n/g, "\n").replace(/\n/g, "\r\n")); - if (data[data.length] != 0x1a) { + if (data[data.length - 1] != 0x1a) { const res = new Uint8Array(data.length + 1); res.set(data); res.set([0x1a], data.length); // append EOF