BSAVE Header

From OHRRPGCE-Wiki
Jump to: navigation, search

The BSAVE header is a "stamp" that QBasic puts on an array that it saves to disk. It tells QBasic how to load it again, and where to stick it.

However, the modern OHRRPGCE engine ignores all the data except the size and magic number, which is what you should do too. In addition, many lumps still have a 7 byte header which used to be a BSAVE header, but now contains only garbage, and should be completely ignored.

Only GEN, FNT, PAL, MAS continue to use BSAVE headers, meaning the length and magic number need to be correct. When writing a BSAVE lump, you can set the segment and offset to anything.

Formal Specs[edit]

About Formal Specs

Data Meaning
BYTE Magic number (always 0xFD, 253)
INT Segment. Set to 0x9999 by modern versions.
INT Offset is always 0
INT Length, the number of bytes