mmontag / chip-player-js

Web-based music player for a variety of video game and chiptune music formats.
https://chiptune.app
GNU General Public License v3.0
345 stars 19 forks source link

Fix corrupted texts in the tag of GME #29

Closed soltune closed 4 years ago

soltune commented 5 years ago

Overview

GME based files sometimes may show corrupt texts in their tag. This is because of the mismatch between internal text encoding in the tags and js. This fix brings the text encoding convertor to solve this.

How to represent the bug

Load the files which include Japanese texts in the tag.

Screen shots

before

before

after

after
mmontag commented 4 years ago

Very nice... thanks for making this series of PRs!

mmontag commented 4 years ago

Unfortunately, this has increased main JS bundle size by 25% (1 MB ➔ 1.27 MB, 290 KB ➔ 365 KB gzipped). As a primary design goal is a fast initial load, I need to revert and come up with another solution that loads JIS support on demand, or at least asynchronously. Good time to add a webpack loader.

soltune commented 4 years ago

@mmontag Thanks for the info! I understand that Chip player JS will be needed to change its architecture to make it.

# in addition, if the .wasm file could be split into each players(as you've mentioned on #3) someday it would improve its response...

mmontag commented 3 years ago

Good news... I think this is possible to do with the Text Encoding Web API, without any external library. I've got Shift-JIS decoding working for the Sharp 68000 MDX titles (7710d9a21dd31564ca9fc53a70351ad9b0c86c5c). Will take a look later.