Skip to content

Miscellaneous discoveries and corrections #4

@CyberYoshi64

Description

@CyberYoshi64

DAT content types

SmileBASIC DAT files are not just comprised of content types 3 to 5. Types 0, 1 and 2 are also valid, but left unused, as they were deemed unnecessary with the vanilla file types.
These are Int8, Uint8 and Int16, respectively. They would come in handy for PCM streams or custom waveforms for MML, as you won't have to convert them yourself then.
SmileBoom might have planned to add content type 0x06 in SB4, but it seems like the idea didn't get ground., as importing an SB3 DAT file with this content type will crash SB4 upon trying to load it.
Otherwise, any other invalid type simply cause the parser to stop reading after the dimension length values and just fill the array with zeroes.

SB3's creator name encoding

SmileBASIC 3's creator/uploader name fields do not use UTF-8 encoding.
Crafting a name with non-ASCII characters (in my case: H\x80\xFF\xCC\xF0\xA2䀵 lmao! XD) will return like so:

2022-01-29_14-55-00
In-file encoding: UTF-8

2022-01-29_15-34-37 532
In-file encoding: ANSI (raw)

The lines, I'm talking about.

The actual encoding that SmileBASIC 3 reads it, is ASCII. Should a byte not be decodable it throws it's usual method out of the window and read past the header and potentially also loop around to find valid characters. (Rough investigation, but far enough)

Nontheless, you should probably sanity-check the name and replace invalid characters with '?' before passing it off, when it's a SB3 file.

EDIT: Loving how I said the same thing twice but with different phrasing...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions