User Tools

Site Tools


loading_20a_20bbc_20micro_20style_20bitmap

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

loading_20a_20bbc_20micro_20style_20bitmap [2018/03/31 13:19]
127.0.0.1 external edit
loading_20a_20bbc_20micro_20style_20bitmap [2018/04/17 16:59] (current)
tbest3112 Added syntax highlighting
Line 2: Line 2:
  
  ​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.\\ \\   ​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 +<code bb4w> 
-  DIM beebmem% &8000 +      ​MODE 8 
-  F%=OPENIN("​ACORNSCREEN.BBC"​) : +      DIM beebmem% &8000 
-  FOR memptr%=3000 TO &7FFF : REM for MODE 0,1,2 (UK) +      F%=OPENIN("​ACORNSCREEN.BBC"​) : 
-  beebmem%?​memptr%=BGET#​F% +      FOR memptr%=3000 TO &7FFF : REM for MODE 0,1,2 (UK) 
-  NEXT+        beebmem%?​memptr%=BGET#​F% 
 +      NEXT
  
-  ​PROCbeebmode0 +      ​PROCbeebmode0 
-  +      
-   ​DEF PROCbeebmode0 +      DEF PROCbeebmode0 
-   ​*REFRESH OFF +      *REFRESH OFF 
-   ​CLS +      CLS 
-   ​VDU 5 +      VDU 5 
-   ​VDU 30 +      VDU 30 
-   ​memptr%=&​3000 +      memptr%=&​3000 
-   ​A$=A$+CHR$(19)+CHR$(0)+CHR$(0)+CHR$(0)+CHR$(0)+CHR$(0) +      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$(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$(&​80) 
-   ​A$=A$+CHR$(18)+CHR$(0)+CHR$(&​F) +      A$=A$+CHR$(18)+CHR$(0)+CHR$(&​F) 
-   ​PRINT ;A$; :​A$=""​ +      PRINT ;A$; :​A$=""​ 
-   ​WHILE memptr%<​=&​7FFF +      WHILE memptr%<​=&​7FFF 
-   ​FOR J%=0 TO 7 +        FOR J%=0 TO 7 
-   ​A&​=beebmem?​(memptr%+J%) +          A&​=beebmem?​(memptr%+J%) 
-   ​A$=A$+CHR$(A&​) +          A$=A$+CHR$(A&​) 
-   ​NEXT +        NEXT 
-   ​A$=CHR$(23)+CHR$(255)+A$+CHR$(255) +        A$=CHR$(23)+CHR$(255)+A$+CHR$(255) 
-   ​PRINT ;A$; +        PRINT ;A$; 
-   ​memptr%+=8 +        memptr%+=8 
-   ​A$=""​ +        A$=""​ 
-   ​ENDWHILE +      ENDWHILE 
-   ​PRINT CHR$(0); +      PRINT CHR$(0); 
-   ​VDU4 +      VDU4 
-   ​*REFRESH +      *REFRESH 
-   ​*REFRESH ON +      *REFRESH ON 
-   ​ENDPROC+      ENDPROC 
 +</​code>​
loading_20a_20bbc_20micro_20style_20bitmap.txt · Last modified: 2018/04/17 16:59 by tbest3112