Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert from QBasic "Binary - Fast load and save" Format?

Tags:

qbasic

I have several hundred games I wrote as a kid some 20 years ago saved in the QBasic 7's .bas "binary" output format (Not to be confused with executable "binaries")

I have been slowly converting these by hand with QBasic in DosBox to ASCII for posterity.

I am curious if anyone know anything about the encoding used by the format such that one could write a script to decode these en masse.

I have been poking at the data a bit, I believe it is beyond me.

For instance the HEX of "ABCD" saved in this format is

fc02 0100 0d00 a801 a801 0700 0102 0304
0605 0810 10ff ff24 00ff ff64 0100 0056
0000 005b 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0061
0052 0000 0000 0161 0000 0002 6162 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
000c 0000 0038 0000 005b 0009 0008 00ff
ffff ffff ffff ff01 0000 0000 0003 01

QBasic Binary Save As Dialog

like image 716
donatJ Avatar asked Jun 28 '26 21:06

donatJ


1 Answers

QB64 Phoenix Edition — a cross-platform, permissively-licensed BASIC compiler — includes a tool for converting QuickBasic 4.5 tokenized source to text. It's mostly used by QB64's IDE for converting legacy files, but can be used from the command line:

QB45BIN «full path to file»

It's supposed to work for most tokenized files, but it wouldn't convert your example. Even when I ran QuickBasic / PDS 7, it wouldn't accept your file either.

like image 199
scruss Avatar answered Jul 02 '26 00:07

scruss