Loading a BBC Micro style bitmap
Whilst BBC Basic for windows can load and display Windows style bitmaps natively,
no capability is provided to load legacy screen data from BBC BASIC on other platforms
unless it is first converted into a intermediate format Windows can understand.
The approaches in this article are an attempt to provide a loading routine for legacy bitmap data.
It is assumed that the reader is familiar with the BBC Micro screen memory
It is assumed that the legacy bitmap data exists as a raw dump in a suitable file that BBC BASIC for
windows has access to.
MODE 8 shares certain characteristics with all the graphics modes present on the original BBC Micro,
so is used as the base mode in which the legacy bitmap data will be reconstructed.
Mode 0 :
In Mode 0 the bitmap data consists of 1bpp bit mapped data arranged in character blocks as opposed to scan lines.
This means that the first 8 bits of the data represent the first line of a character (at the top left of the screen),
the next 8 the second line and so on for the 8 lines of a BBC Micro style character. The next character block is to the
left of the first and so on, line wrapping every 80 characters, for a maximum of 32 lines (UK)
This data organisation means that the user programmable characters can be utilised to render the screen data.
The main program first reads in the bitmap data and then makes a call to the render routine.
MODE 8 DIM beebmem% &8000 F%=OPENIN("ACORNSCREEN.BBC") : FOR memptr%=3000 TO &7FFF : REM for MODE 0,1,2 (UK) beebmem%?memptr%=BGET#F% NEXT PROCbeebmode0 : DEF PROCbeebmode0 *REFRESH OFF CLS VDU 5 VDU 30 memptr%=&3000 A$=A$+CHR$(19)+CHR$(0)+CHR$(0)+CHR$(0)+CHR$(0)+CHR$(0) A$=A$+CHR$(19)+CHR$(&F)+CHR$(&F)+CHR$(0)+CHR$(0)+CHR$(0) A$=A$+CHR$(18)+CHR$(0)+CHR$(&80) A$=A$+CHR$(18)+CHR$(0)+CHR$(&F) PRINT ;A$; :A$="" WHILE memptr%<=&7FFF FOR J%=0 TO 7 A&=beebmem?(memptr%+J%) A$=A$+CHR$(A&) NEXT A$=CHR$(23)+CHR$(255)+A$+CHR$(255) PRINT ;A$; memptr%+=8 A$="" ENDWHILE PRINT CHR$(0); VDU4 *REFRESH *REFRESH ON ENDPROC