-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|645|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-




spinal

SmileBASIC Switch - Sale

19th July 2022

hmmm, keyboard input not working, the arduino types fine on the editor screen, but I cant accuratly detect keypresses in the program :-(
The following two idea are very hit+miss, sometimes receives some keypresse, mostly none though.
[code]
DEF READNIBB*snip*


spinal

SmileBASIC Switch - Sale

5th July 2022

Right now I'm suffering ''file not found'' on my only file! :-P
F10 into tile editor, draw some doodles, save as ''sprites''.
go back into main.prg, use
[code]
LOAD''SPRITES'',4
[/code]
get ''file not found'' scree*snip*


spinal

Data -> ADPCM -> Data

27th May 2022

Aha!
(Image.png)
[code]
; Blitz3D
; (Linkage)
;Graphics 320,240,0,2
Dim StepSizeTable(89)
Dim IndexTable(16)
For t = 0 To 15
Read IndexTable(t)
Next
;/* Table of index changes */
Data -1, -1, -1, -1, 2, 4, 6, 8
Data -1, -1, -1, -1, 2, 4, 6,*snip*


spinal

Data -> ADPCM -> Data

27th May 2022

OK, next question...
[code]
Graphics 320,240,0,2
Dim StepSizeTable(89)
Dim IndexTable(16)
For t = 0 To 15
Read IndexTable(t)
Next
;/* Table of index changes */
Data -1, -1, -1, -1, 2, 4, 6, 8
Data -1, -1, -1, -1, 2, 4, 6, 8
For t = 0 To 88
Re*snip*


spinal

Data -> ADPCM -> Data

16th May 2022

Grrrrr, Closer, yet further...
(Image.png)
[code]
; Blitz3D
; (Linkage)
Graphics 1024,900,0,2
Dim StepSizeTable(89)
Dim IndexTable(16)
For t = 0 To 15
Read IndexTable(t)
Next
;/* Table of index changes */
Data 255, 255, 255, 255, 2, 4, 6, 8 *snip*


spinal

Data -> ADPCM -> Data

15th May 2022

hmmm..... Can't tell if better or worse :-P
[code]
; Blitz3D
Graphics 1024,900,0,2
Dim IndexTable(16)
Dim StepSizeTable(89)
For t = 0 To 15
Read IndexTable(t)
Next
;/* Table of index changes */
Data -1, -1, -1, -1, 2, 4, 6, 8
Data -1, -1, -*snip*


spinal

Data -> ADPCM -> Data

15th May 2022

Slightly better...
[code]
; Blitz3D
Graphics 1024,900,0,2
Dim IndexTable(16)
Dim StepSizeTable(89)
For t = 0 To 15
Read IndexTable(t)
Next
;/* Table of index changes */
Data 255, 255, 255, 255, 2, 4, 6, 8
Data 255, 255, 255, 255, 2, 4, 6, 8
Fo*snip*


spinal

Data -> ADPCM -> Data

14th May 2022

OK, I've been trying to decode ADPCM audio using the many identical code examples online, but fail each and every time. So I thought I'd give it a go in blitz, using image data so I could SEE whats going on.
Turns out, it either doesn't work O*snip*


spinal

Building a Touchable Keyboard

1st April 2022

OK, The following code increases the RGB value for every single pixel in a 256x256 grid.
[code]
for(int y=0; y<256; y++){
for(int x=0; x<256; x++){
lineBuffer[x] = colour++;
}
tft.pushImage(0, y, 480, 1, lineBuffer);
}
[*snip*


spinal

Building a Touchable Keyboard

21st March 2022

OK, before going any further, here is the current working code, It has screen, touch and SD card working on the raspberry pi pico through arduino libraries.
The following code first blanks the screen then waits for a serial window to be opened on the comp*snip*


spinal

Abs error?

12th March 2022

[code]
Graphics 800,600,0,2
settingcolour = 0
SetBuffer BackBuffer()
; crop to 336x336
; from 62,10
; 194 images
imageStrip = CreateImage(sWidth, sHeight)
tempImage = CreateImage(336,336)
myAnim = LoadImage(''C:\\Users\\Spinal\\Desktop\\brains\\til*snip*


spinal

Abs error?

12th March 2022

With 3 arrays like following...
[code]
Dim maskR(336,336)
Dim maskG(336,336)
Dim maskB(336,336)
[/code]
The following code gives an ''Operator can not be applied to stings'' error on the [code]If Abs(maskB(x,y)-b) < 100 Then[/code]
line. *snip*


spinal

Mode 7 failure?

3rd December 2021

[code]
Graphics 900,768,0,2
Global texImage = LoadImage(''F:\\Pokitto\\FemtoIDE\\projects\\BoxPusher\\raw\\floor.bmp'') ; 64x64 tile
shiftAmount = 16
Dim myTile(64*64,3)
SetBuffer ImageBuffer(texImage)
; Grab all of the pixels from the tile image f*snip*


spinal

Mode 7 failure?

3rd December 2021

I know this code crashes, but I don't know why...
[code]
Graphics 1250,768,0,2
Global texImage = LoadImage(''F:\\Pokitto\\FemtoIDE\\projects\\BoxPusher\\raw\\floor.bmp'') ; 64x64 tile
SetBuffer FrontBuffer()
x_ = 0.0
y_ = 0.0
scaleX = 32.0
sc*snip*


spinal

gui confusion

8th April 2021

Current conundrum....
Switching from 'add new colours to palette' to 'use a fixed palette'
[code]
Local closestMatch:Int = 0
Local colourDistance:Int = 256+256+256 ' out of range
Local r1:Int = ((rgb565 Shr 11) & 31) '1*snip*


spinal

SpinalWatch

8th March 2021

Introducing...
[code]
_________ __ __ __ __ .__
/ _____/ _____________/ |_/ \\ / \\_/ |_ ____ | |__
\\_____ \\ / \\_ __ \\ __\\ \\/\\/ /\\ __\\/ ___\\| | \\
/ \\ Y Y \\ | \\/| | \\ *snip*


spinal

SpinalWatch

8th March 2021

Python! - Everyone uses python these days, and there are existing examples of transferring data to an arduino...!!!
Nope.
Installed Python, installed pyserial library...
[code]
Traceback (most recent call last):
File ''F:\\arduino-digital-picture*snip*


spinal

SpinalWatch

6th March 2021

This is using the inbuilt serial. So it's not even a Bluetooth problem yet 😞
It's a shame as I managed to save some random junk pixels on the flash chip, which I can load back, but can't grab enough data from the serial port to correct *snip*


spinal

Image rotation?

19th February 2021

I've got most of it figured I think...
Any degree,
[code]
Graphics 640,480,0,2
Graphics 320,240,0,3
SetBuffer BackBuffer()
pic = CreateImage(120,12)
SetBuffer ImageBuffer(pic)
Color 255,0,0
Rect 0,0,120,12,1
Color 0,0,255
Text 0,0,''ABCD*snip*


spinal

gui confusion

5th February 2021

about 5 seconds after I posted I gave that a try, that's the problem with switching languages, you forget things like
[code]
for(int y=0; y<tileSize; y++)
[/code]
is not the same as
[code]
for local y:int=0 to tileSize
[/code]
I've done *snip*


spinal

gui confusion

5th February 2021

Oh, this one is fun!
[code]
Const tileSize:Int = 8
Local tempArray:Int[(tileSize+1)*(tileSize+1)] ' make bigger than i need just in case
Local tempArrayFlip:Int[tempArray.Length][/code]
[code]
For Local y:Int = 0 To tileSize
For Local x:Int =*snip*


spinal

gui confusion

29th January 2021

Getting there!, the code is a mess though.
(Image.png)
[code]
'
' 8888ba.88ba a88888b. dP dP
' 88 `8b `8b *snip*


spinal

gui confusion

28th January 2021

Full code, in case I'm doing something correct somewhere :-P
The idea at this stage, is load a scenery image, then load a background layer, click the transparent colour button, followed by a click on the image somewhere and that colour should become t*snip*


spinal

gui confusion

28th January 2021

I'm attempting to pick a colour from a loaded image.
Surely the following should work? -- nope...
[code]SuperStrict
Graphics 640,480
Local screenpixmap:TPixmap = CreatePixmap(1,1,PF_RGBA8888)
SetColor 255,0,128
DrawRect 0,0,20,20
Flip
While Not*snip*


spinal

gui confusion

28th January 2021

hmmm, this returns -16777216 :-(
[code]
Function GetPixel:Int(pixelX:Int, pixelY:Int)
Local screenpixmap:TPixmap = CreatePixmap(1,1,PF_RGBA8888)
screenpixmap = GrabPixmap(pixelX, pixelY,1,1)
Return ReadPixel(screenpixmap,0,0)
End Function
[/code*snip*

Newer Posts More - Older Posts