Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
36
Task/Image-noise/BBC-BASIC/image-noise.basic
Normal file
36
Task/Image-noise/BBC-BASIC/image-noise.basic
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
dx% = 320
|
||||
dy% = 240
|
||||
images% = 100000
|
||||
VDU 23,22,dx%;dy%;8,8,16,0
|
||||
|
||||
REM Create a block of random data in memory:
|
||||
DIM random% dx%*dy%+images%
|
||||
FOR R% = random% TO random%+dx%*dy%+images%
|
||||
?R% = RND(256)-1
|
||||
NEXT
|
||||
|
||||
REM Create a BMP file structure:
|
||||
DIM bmpfile{bfType{l&,h&}, bfSize%, bfReserved%, bfOffBits%, \
|
||||
\ biSize%, biWidth%, biHeight%, biPlanes{l&,h&}, biBitCount{l&,h&}, \
|
||||
\ biCompression%, biSizeImage%, biXPelsPerMeter%, biYPelsPerMeter%, \
|
||||
\ biClrUsed%, biClrImportant%, biPalette%(255)}
|
||||
bmpfile.biSize% = 40
|
||||
bmpfile.biWidth% = dx%
|
||||
bmpfile.biHeight% = dy%
|
||||
bmpfile.biPlanes.l& = 1
|
||||
bmpfile.biBitCount.l& = 8
|
||||
FOR C% = 0 TO 255
|
||||
bmpfile.biPalette%(C%) = C% OR C%<<8 OR C%<<16
|
||||
NEXT
|
||||
|
||||
REM Display image at a random offset into the data:
|
||||
frame% = 0
|
||||
TIME = 0
|
||||
REPEAT
|
||||
bmpfile.bfOffBits% = random% - bmpfile{} + RND(images%)
|
||||
OSCLI "MDISPLAY " + STR$~bmpfile{}
|
||||
frame% += 1
|
||||
IF TIME>10 THEN
|
||||
SYS "SetWindowText", @hwnd%, "BBC BASIC: " + STR$(frame%*100 DIV TIME) + " fps"
|
||||
ENDIF
|
||||
UNTIL FALSE
|
||||
Loading…
Add table
Add a link
Reference in a new issue