Skip to content

Commit

Permalink
Fix the problem when exporting MML for MSX-DOS where an extra EOF m…
Browse files Browse the repository at this point in the history
…arker is added even if it already exists.

Fix the problem where the name specified by the meta `name` directive is not reflected when exporting MML without pre-compiling.
  • Loading branch information
okaxaki committed Dec 3, 2023
1 parent 8a75f48 commit 05ce9eb
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 23 deletions.
39 changes: 23 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
- Added VGM exporter.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "msxplay-js",
"version": "1.7.3",
"version": "1.7.4",
"description": "",
"type": "module",
"engines": {
Expand Down
16 changes: 11 additions & 5 deletions public/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion src/msxplay-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 05ce9eb

Please sign in to comment.