Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 5552

programming • Re: spr2bbc problem

$
0
0
I like your reply, thanks for describing the error. Though the error may not be prudent for inexperienced programmers, it's a good utility.

I extended the area of my 1bpp sprite (to a multiple of 8x8) 64x64 and the program spat out a mono BBC/Electron sprite file of 512 bytes.

Interesting geraldholdsworth, that you wrote a lot of utilities based on this subject. I wonder if you could please check this code for errors if you don't mind, it's a plot routine for BBC/Electron basic that doesn't seem to work properly, I just get a strange 16x8 blob.

Code:

MODE 4REM 64x64 mono spriteDIM S% 511REM Load sprite from filefilename$ = "SPRITE64"F% = OPENIN(filename$)IF F% = 0 THEN PRINT "ERROR Cannot open file": ENDFOR I% = 0 TO 511S%?I% = BGET#F%NEXTCLOSE#F%X% = 100Y% = 80PROCsprite(X%, Y%)ENDDEF PROCsprite(X%, Y%)LOCAL row%, col%, byte%, mask%, sy%FOR row% = 0 TO 63sy% = Y% + row%FOR col% = 0 TO 63byte% = S%?(row% * 8 + col% DIV 8)mask% = &80 >> (col% AND 7)IF byte% AND mask% THENPLOT 69, X% + col%, sy%ENDIFNEXTNEXTENDPROC

Statistics: Posted by Square Mezzmer — Wed Feb 04, 2026 7:20 am



Viewing all articles
Browse latest Browse all 5552

Trending Articles