Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export to a binary file #10

Open
sdsnatcher opened this issue Jul 28, 2018 · 2 comments
Open

Export to a binary file #10

sdsnatcher opened this issue Jul 28, 2018 · 2 comments

Comments

@sdsnatcher
Copy link

sdsnatcher commented Jul 28, 2018

To make it easier to implement support in PC viewers like the RECOIL library, it would be ideal to have a standardised binary format for the SMS images and export images on this format.

It can be very a simple VRAM dump, so support can be easily implemented on emulators too. And the format allows easy binary inclusion for game development. The INCBIN would only have to skip the header and the VDP registers tail.

Here goes a humble proposal:

  1. 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)
  1. 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)
  2. Data area
    3.1) VDP registers dump: 10h 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

The file extension could be .SBM, meaning "Sega Bitmap".

@maxim-zhao
Copy link
Owner

Interesting, a long time ago I wrote a program to support Windows thumbnails (in Windows XP, the interface has since changed) from Meka savestates using the same principle (render from VRAM contents) but it fell down because it could not restore any raster effects.

@sdsnatcher
Copy link
Author

Indeed, raster effects won't be supported. But at least title screens and other static bitmaps could be easily dumped this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants