Menu

#52 SBM image format

open
nobody
SMS (1)
5
2023-01-18
2019-10-27
SD Snatcher
No

SBM is a simple format to distribute Sega Master System, GG and TMS9918 (SG-1000, TI-99A, ColecoVision, MSX1) images.

This is its structure:

Header (6 bytes signature):
1.1) Signature
"MSBMP" string for the SMS
"GGBMP" string for the GG
* "TMBMP" string for the TMS9918 (SG-1000, ColecoVision, MSX1, TI-99A, etc)
1.2) Version (1 byte): 0 = v1.0
1.3) File offset to the metatada area (1 byte): 9
1.4) File offset to the data area (16bit, little endian)

Metadata area (if no metadata is present, must contain only the end marker)
2.1) Author name: ASCII text, ends with 0Dh,0Ah
2.2) Title: ASCII text, ends with 0Dh,0Ah
2.3) Notes: ASCII text (might be empty)
2.4) End of the metadata marker: 1Ah (mandatory)

Data area
3.1) VDP registers dump: 16 bytes (SG-1000 uses only the first 7. Fill the unused bytes with zeroes)
3.2) CRAM dump: 64 bytes (SMS uses only the first 32, SG-1000 uses none. Fill the unused bytes with zeroes)
3.3) VRAM dump: 16384 bytes with a raw VRAM dump

I attached some samples in this ticket.

1 Attachments

Discussion

  • Dwayne Robinson

    Dwayne Robinson - 2021-11-03

    @sd-snatcher: Do you have any more info on this ".sbm" format, linking to more documentation or a program name that reads/writes them? I managed to display a few of your sample files with a separate tool I wrote a while back, given your file format description above plus external documents about the SMS/GG VRAM tile format and tilemap elements, but it would be helpful to include what the images are supposed to look like too (e.g. reference .png's). I attached my Golden Axe picture output. TY.

    For the {Golden Axe, Aladdin, Rampage} files, I used:
    1. @0x385A uint16le levelData[32][32];
    2. @0x005A uint8 vram[14336]; // 8x8 tiles, 4bpp, row-interleaved bitplanes
    3. @0x001A r2g2b2x2 palette[64]; // lowest 2 bits = red, then green, then blue, and last the highest 2 bits are unused

    The only reference I could find was this format proposal here, but not utilities that could export them: https://github.com/maxim-zhao/bmp2tile/issues/10

     

    Last edit: Dwayne Robinson 2021-11-04
    • SD Snatcher

      SD Snatcher - 2023-01-15

      Sorry for the awfully late reply. I only noticed your reply now.

      To generate the SBM files, I use a bash script I wrote myself. It extracts a SBM image from a savestate of the Meka emulator. I attached it here, in case you're interested.

      I also attached here:

      1) Fixed versions of some SBM files I noticed that had spurious sprites
      2) Reference renderings of the SBM images as you asked, so you can know how they were supposed to look

       

      Last edit: SD Snatcher 2023-01-18
      • Dwayne Robinson

        Dwayne Robinson - 2023-01-18

        Yo Snatcher, thanks for the data files. A month later, I figured out the format and rendered the scenes for {Aladdin, Fray, Golden Axe, Gulkave, YS1} to add {Sega Master System, Game Gear, TMS9918 SG-1000/MSX1} support for a hobby project to display tilemaps. I just downloaded your additional data and screenshots, and I'll try more of them when I return to that project.

         
        👍
        1

        Last edit: Dwayne Robinson 2023-01-18
        • SD Snatcher

          SD Snatcher - 2023-01-18

          Nice! I also noticed that two other SBM images had some minor issues with the VRAM data. Please redownload the fixed_SBM_files.zip.

          Their reference png renderings in the other zip were correct though.

           
          👍
          1

          Last edit: SD Snatcher 2023-01-18

Log in to post a comment.