Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:48 28 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : picomite vga  problem

Author Message
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 554
Posted: 08:11pm 21 Aug 2023
Copy link to clipboard 
Print this post

PicoMiteVGA MMBasic Version 5.07.08b10
OPTION KEYBOARD US


using Tera term  for paste the code below  press F1 for save  , F2 for run

mmbasic spits an error

[149] Data "93806","68E09","7280A","B3106"
Error : Expected a number
type edit
the display size is changed

type option list

> option list
PicoMiteVGA MMBasic Version 5.07.08b10
OPTION KEYBOARD US
OPTION DISPLAY 20, 40

hmm no option Display in the code ,looks like a parser bug


MODE 2
'Init all
Dim integer f,n,oc,wx,wy,l,r,obj(10,10) 'moving Object Vars
'1 Bert, 2 RBall, 3 GBall, 4 Coily,
'5 WrongWay,6 Ugg, 7 Slick 8 Sam, 9 Disc
Dim cl%(15):Restore colors:For f=1 To 15:Read cl%(f):Next
Dim sw%(8)=(0,3,5,6,7,5,4,2,0),sp$
FRAMEBUFFER layer
FRAMEBUFFER write l
CLS cl%(5)
FRAMEBUFFER write n
Restore qb1
For n=1 To 26
Read wx,wy
For y=0 To wy-1
Read sp$:sp$=expand$(sp$)
For x=0 To wx-1
Pixel x,y,cl%(Val("&H"+Mid$(sp$,x+1,1)))
Next x
Next y
Sprite read n,0,0,wx,wy:Box 0,0,wx,wy,,0,0
Next n
FRAMEBUFFER write l:CLS
FRAMEBUFFER write n
Dim LC%(8,4,5)
Restore Levels
For l=1 To 8:For r=1 To 4
Read l1$
For n%=1 To 5:LC%(L,R,n%)=Cl%(Val("&H"+Mid$(l1$,n%,1))):Next
Next :Next

'----------------------------------------------
'demo
Do
pyra LC%(1,1,1),LC%(1,1,2),LC%(1,1,3)

FRAMEBUFFER write l:CLS :Text 0,0,"DEMO"
For m=1 To 3
qx%=10:qy%=196
For n=1 To 7
jump 1
Pause 300
Next
Box 120,28,16,16,,0,0
Next
FRAMEBUFFER write n
For l=1 To 8:For r=1 To 4
Text 256,0,"Level="+Str$(l)
Text 256,16,"Round="+Str$(r)
pyra LC%(L,R,1),LC%(L,R,2),LC%(L,R,3)
Pause 500
Next : Next
For l=1 To 15:fields cl%(l):Pause 250:Next

x=0:y=0
FRAMEBUFFER write l
For n=1 To 26
Sprite write n,x,y
Sprite write n,x+160,y,1
Inc x,24:If x>=150 Then x=0:Inc y,32

Next
Pause 20000
FRAMEBUFFER write n
CLS

Loop
'end demo
'------------------------------------------------
'
'Interrupt would be called every 40 ms... main Game loop here  (to come)
Sub Mainloop
Local f
For f=1 To 10
'object in this Level/Round?
If Not obj(f,9) Then move_on
'object active?
If Not obj(f,0) Then move_on


'code etc.
move_on:
Next
End Sub



Function expand$(pxl$)
Local n%,nmb%,tmp$,co$
n%=1: Do
If Asc(Mid$(pxl$,n%,1))< 71 Then
tmp$=tmp$+Mid$(pxl$,n%,1)
Else
co$=Hex$(Asc(Mid$(pxl$,n%,1))-71)
Inc n%:nmb%=Val("&H"+Mid$(pxl$,n%,1))
tmp$=tmp$+String$(nmb%+1,co$)
EndIf
Inc n%:Loop Until n%>Len(pxl$)
expand$=tmp$
End Function


'----------
Sub jump(dir%)  'For Demo .. has to be included in Main
Local x%,ox%,oy%,of%
FRAMEBUFFER write l
ox%=QX%:oy%=QY%
Select Case dir%
Case 1
For x%=qx% To qx%+15 Step 2
'If of%=1 Then Sprite hide 1
Box x%-2,oy%,16,16,,0,0
Inc qy%,-3
Sprite show 2-(of%=7), x%, qy%-sw%(of%), 2,1
oy%=qy%-sw%(of%)
Inc of%

Pause 40
Next
Inc qx%,16
End Select
End Sub


'
'Draws the playground in colors 1 (top) 2 (left) and 3 (right)
Sub pyra C1%,c2%,c3%
tx%=112
For y=0 To 6
For n=0 To y:field tx%+32*n,32+24*y,c1%:block tx%+32*n,40+24*y,c2%,c3%:Next
Inc tx%,-16
Next
End Sub
'------- to recolor just the Top
Sub Fields c1%
tx%=112
For y=0 To 6
For n=0 To y:field tx%+32*n,32+24*y,c1%:Next
Inc tx%,-16
Next
End Sub

'-------------
Sub field x,y,c
Triangle x,y+8,x+16,y,x+16,y+16,c,c
Triangle x+32,y+8,x+16,y,x+16,y+16,c,c
End Sub

Sub Block x,y,c1,c2
'left
Triangle x,y,x+16,y+8,x,y+16,c1,c1
Triangle x,y+16,x+16,y+8,x+16,y+24,c1,c1
'right
Triangle x+17,y+8,x+32,y,x+32,y+16,c2,c2
Triangle x+17,y+8,x+17,y+24,x+32,y+16,c2,c2
End Sub

colors:
Data RGB(BLUE),RGB(GREEN),RGB(CYAN),RGB(RED)
Data RGB(MAGENTA),RGB(YELLOW),RGB(WHITE),RGB(MYRTLE)
Data RGB(COBALT) ,RGB(MIDGREEN),RGB(CERULEAN),RGB(RUST)
Data RGB(FUCHSIA),RGB(BROWN),RGB(LILAC)

'levelcolors
'colors per round:Top, left, right,transition,target
Levels:
Data "93806","68E09","7280A","B3106"
Data "98E62","431B6","E3896","6009E"
Data "36C09","BA807","98E07","6A809"
Data "ACE69","90046","6A84B","531B6"
Data "E3869","28E96","8A8B7","6A1B4"
Data "28E96","B3146","E3869","E0096"
Data "96C35","7A88B","28E96","6389E"
Data "98E62","E0096","6389E","6A1B4"

field:
Data 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0
Data 0,0,0,0,0,0,1,0,1,0,0,0,0,0,0
Data 0,0,0,0,0,1,0,1,0,1,0,0,0,0,0
Data 0,0,0,0,1,0,1,0,1,0,1,0,0,0,0
Data 0,0,0,1,0,1,0,1,0,1,0,1,0,0,0
Data 0,0,1,0,1,0,1,0,1,0,1,0,1,0,0
Data 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0

'Compressed sprite Data
'always facing left, have to be mirrored when looking to the right
'2nd sprite is the Object jumping
'1 Bert (4 Sprites)
qb1:
Data 16,16
Data "GF","GF"
Data "0CCEG3CCEEG3","4CCEE0K2CCEEG2","4S2EE774CCU200","04S3874S2EE00"
Data "004S2874S2U20","G24CC44C4S2EE0","G344C4S4EE0","G3K2S5EE0","G344CC4S400"
Data "G4K2CC4CCG2","G5K2S2G3","G4K204CG4","G2440C4C44CG3","G4K20044CG2"""
Data 16,16
Data "0CCEG3CCEEG3","4CCEE0K2CCEEG2","4S2EE874CCU200","04S3874S2EE00"
Data "004S2774S2U20","G24CC44C4S2EE0","G344C4S4EE0","G3K2S5EE0","G344CC4S400"
Data "G4K2CC4CCG2","G5K2S2G3","G6400CG4","G54400CG4","G24C004S2G4"
Data "G344C4044CG3","G544G24CG2"
Data 16,16
Data "GF","GF","G7S3G3","G5K4S200","G5884884C440","G5874874CC44","G4EK5CK2"
Data "G2EES344S244","00ES9K2","0ECCK2C4C4C4C44","0C8844044CK40","04884G2K500"
Data "0044G3K4G2","G74004G3","G5CC400S200","G3EC400EEC4G2"
Data 16,16
Data "G7S3G3","G5K4S200","G5774774C440","G5884884CC40","G4E884884CK2"
Data "G2EES344S244","00ES9K2","0ECCK2C4C4C4C44","0C8844044CK40","04884G2K500"
Data "0044G3K4G2","G74G24G2","G74G24G2","G74G24G2","G5CC400S200","G3EC400EEC4G2"
'BALL red (2 Sprites)
Data 16,12
Data "GF","GF","GF","GF","G5K4G4","G3K8G2","G2K27K600","00K27K80","00K88K20"
Data "00K78K30","G2KA00","G4K6G3"
'
Data 16,12
Data "GF","GF","G5K4G4","G3K8G2","G2K27K600","00K27K80","00KC0","00K98440"
Data "00K88K20","G2K588K200","G3K8G2","G5K4G4"
'Ball GREEN (2 Sprites)
Data 16,12
Data "GF","GF","GF","GF","GF","GF","G5Q3G5","G3Q7G3","G2Q27Q32AG2"
Data "G2AA7Q42AG2","G2Q62AAG2","G3Q7G3"
'
Data 16,12
Data "GF","GF","GF","GF","G5Q3G5","G3Q7G3","G2Q27Q5G2","G2AA7Q42AG2"
Data "G2Q72AG2","G2Q522AAG2","G3Q222Q2G3","G5Q3G5"
'MBall Coily Drop (2 Sprites)
Data 16,16
Data "GF","GF","GF","G4L5G4","G2L2V3L2G2","0055F7L700","055F77L80","055F77L80"
Data "55FLC","LB8585","LA85885","0L7O400","00L4885O2G2","G3L488G4","GF","GF"
'
Data 16,16
Data "G4L5G4","G2L9G2","00L3V3L300","0L2F7L80","L2F77L9","55FLC","LB8585"
Data "LB8585","LA85885","L8O55","0L5885O350","00L6O3500","G2L2O455G2","G4L5G4"
Data "GF","GF"
'Coily 16x32 up (2 Sprites)
Data 16,32
Data "GF","GF","GF","GF","GF","GF","GF","GF","GF","GF","GF","GF","GF","GF","GF"
Data "GF","00FF0V3G6","0FL7G5","0FL8G4","0FL9G3","FLAG3","FL2G4L2G3"
Data "07005500L3G3","0FL8G4","00FL7G4","00L6G6","00F5G65G3","00F55G355G4"
Data "G2FL605G2","G3FL30055G2","GB5G2","GF"
'
Data 16,32
Data "00FF0FFG8","0FL5G7","0FL5V2G4","0FL8FG3","FLAG3","FL4G3L2G2","055G7L200"
Data "07007G65500","GBF550","G35V2G3F550","00FL5F00F550","0FL200L2005500"
Data "L3FG2L30500","FL2FG3L3G2","0FL2V250L2G2","00FL6055G2","G4L300L200"
Data "GB5500","GBF550","00V6G2F550","0FL700F550","0FL2G2L20L20","0F55G3FL20500"
Data "0FL50L3G2","G45500L3G2","G9L2G2","G9L2G2","G9L2G2","G2FG5L2G2"
Data "G25FG3F55G3","G355V255G4","G555G7"

'Coily 16x32 down (2 Sprites)
Data 16,32
Data "GF","GF","GF","GF","GF","GF","GF","GF","GF","GF","GF","GF","GF","GF","GF"
Data "GF","00FF0FF5FG6","0V555FG5","078787L3FG4","05N2L5FG3","L70L2FG2"
Data "L6G255FG2","0L4G355FG2","07007G2L3G3","G2L70FG2","G3L4005FG2","G8F55FG2"
Data "G25G3FL2G3","G35V3L2FG2","G5L405F00","GB5F00","GB5G2"
'
Data 16,32
Data "00FF0FFG8","0V55G7","07878755V2G4","05N2L5FG3","LBFF00","L5G3L2F00"
Data "0L4G4L2F0","07007G655F0","GC55F","G35V2G455F","00L6FG255F","0L300L2FL2F0"
Data "L3FG4L3F0","0505FG3L3F00","00505V2L4G2","G250L500F00","G4L2G355F0"
Data "GB55F0","GC55F","005V5G355F","0L7FG255F","0L3G35FL3F","0L2G5L3F0"
Data "0LBF00","G4L4G5","GAV200","G9L2F00","G9L2F00","G2FG5L300","G25FG3FL2G2"
Data "G355V255G4","G555G7"
' WrongWay (2 Sprites)
Data 16,16
Data "GF","00L2G45G4","0FFG655G3","F00F005500505G2","F500L600500","0FL805G2"
Data "00F5878755005500","0FF558787L3050","FF57755785005005","0FN3557G6"
Data "FF7788755G6","FFN28755V25500","FF5N288700FG3","0FF55778700FFG2","V477G8"
Data "00V2GA"
'
Data 16,16
Data "00L2G45G4","V25G65G3","FF0FFG4505500","FG455055G250","FF00L5G2500"
Data "0FL6G2L20","00L27L3055055","0FL37L4G25","V2775575FFG4","0FN3557G6"
Data "FFN4L2G5","FF7887755F5G4","FF57O2770FL200","0FF55787G2FG3","V477G4F500"
Data "00V2GA"

'6 Ugg (2 Sprites)
Data 16,16
Data "G57G8","G3705G8","00700F5G8","G250F550FF00550","G250F05FF500550"
Data "00F500F55F550505","00F55FF5F578L3","00F0L2F57885500","G3L378875G2"
Data "00FFL387L300","0L978500","50L6F775G2","500L5F7FF500","0500L4V20L2"
Data "0050050L4G3","GAL200"
'
Data 16,16
Data "G47G9","G2705G9","0700F5G9","0050FL20FF00550","7050F005FF500550"
Data "0F5G2FL40585","0FL2FF55F58L3","0F00L3F58L200","G3L2F58L2G2","00FFL900"
Data "0L977500","50L6F775G2","500L5F8FF500","0500L4V20L2","0050050L4G3","GAL200"

'7 Slick (2 Sprites)
Data 16,16
Data "GF","GF","G9EG4","G6E0E00EG2","G5U30EG3","G4EEAEAEG4","G3EAEEAEAEG3"
Data "G27AA7Q2E2G3","G278787AA2A2G2","00A78787A2A22G2","00AN42A22AG2"
Data "00A72272AI3G2","00I7A2G3","G228822AI2G3","G3I6G4","G2I20I2G5"
'
Data 16,16
Data "G6E0E00EG2","G5U30EG3","G4EEAEAEG4","G3EAEEAEAEG3","G27AA7Q32G3"
Data "G277878AA2A2G2","00A77878A2A2AG2","00AN42AI2G2","00A72272A22A2G2"
Data "002288I5G3","G2288I2A22G3","G3I7G3","G42G222G4","G42G22G5","G42G22G5"
Data "G3I20I2G4"
'8 Sam (2 Sprites)
Data 16,16
Data "GF","GF","G9EG4","G6E0E00EG2","G5U5G3","G4U3AE00E00","G3EAEAAEAEEG2"
Data "G2Q72G3","G287887O4G2","00A87887A2A22G2","002882882AI2G2","00I5AI3G2"
Data "00I9G3","G2288I4G4","G3I6G4","G2I20I2G5"
'
Data 16,16
Data "G6E0E00EG2","G5U30EG3","G5EAEAE00E00","G3EEAEAEAEEG2","G2Q6E2G3","G2O8G3"
Data "00A87887A2A22G2","002872872AI2G2","00I5AI3G2","00I9G3","G2288I5G3"
Data "G2I7G4","G322G222G4","G42G22G5","G42G22G5","G2I20I2G5"
'9 Disc (4 Sprites)
Data 16,12
Data "GF","G54499G5","G2K6P2G2","0K8P40","K2I34P66","4I66P3M2","3I4M88"
Data "J2I2M6O2","0J4226683O20","G2J483838G2","G53383G5","GF"
'
Data 16,12
Data "GF","G52244G5","G2I6K2G2","0I8K40","I2M32K69","2M69K3P2","3M4P88"
Data "J2M2P6O2","0J4669983O20","G2J483838G2","G53383G5","GF"
'
Data 16,12
Data "GF","G56622G5","G2M6I2G2","0M8I40","M2P36I64","6P64I3K2","3P4K88"
Data "J2P2K6O2","0J4994483O20","G2J483838G2","G53383G5","GF"
'
Data 16,12
Data "GF","G59966G5","G2P6M2G2","0P8M40","P2K39M62","9K62M3I2","3K4I88"
Data "J2K2I6O2","0J4442283O20","G2J483838G2","G53383G5","GF"


Plasma
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9128
Posted: 09:39pm 21 Aug 2023
Copy link to clipboard 
Print this post

When you change to mode it changes the display to match. Use EDIT 1 to edit in 640x480 if the current mode is 2
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 06:28am 22 Aug 2023
Copy link to clipboard 
Print this post

[149] Data "93806","68E09","7280A","B3106"
Error : Expected a number...

missing a "," somewere?
Edited 2023-08-22 16:35 by Martin H.
'no comment
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 07:05am 22 Aug 2023
Copy link to clipboard 
Print this post

Your first read is 26 numbers.. but you only have 15.
then they are strings.

If I missed something then I apologise.

Note* I really can't read this basic yet.. The syntax is so complex for a basic.
Edited 2023-08-22 17:08 by IanRogers
I'd give my left arm to be ambidextrous
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 07:17am 22 Aug 2023
Copy link to clipboard 
Print this post

First it defines and reads the Values of the 15 Colors (plus 0) = 15 Numbers
Dim cl%(15):Restore colors:For f=1 To 15:Read cl%(f):Next
so far it is correct.
Later the For n=1 To 26 is reading the Sprites but has also set the Pointer to the right lable Restore qb1
The Sprite data after qb1: is stored in 2 numbers(x and y size) and the Sprite Data in compressed form as strings
'no comment
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 07:34am 22 Aug 2023
Copy link to clipboard 
Print this post

I have been playing with C64 basic as there are many similarities, but this syntax is a mis mash of several basics with C thrown in.

Don't get me wrong. I'll get there.  I'm trying to port Chess over but the learning curve is way harder than it was for C and Pascal.. LOL..

I do like this platform and I may try the Armite, but I need to get the syntax "in me head" first. I am still playing with writing C libraries and using them. But that kinda defeats the purpose. I have Pico's on the Arduino platform and I can do tons, but this is more..... Nostalgic.
I'd give my left arm to be ambidextrous
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 08:44am 22 Aug 2023
Copy link to clipboard 
Print this post

  IanRogers said  I have been playing with C64 basic as there are many similarities, but this syntax is a mis mash of several basics with C thrown in.

Don't get me wrong. I'll get there.  I'm trying to port Chess over but the learning curve is way harder than it was for C and Pascal.. LOL..

I started with Sinclair Basic ZX81->Spectrum->QL. In addition, there was a little MS Basic on the Dragon32 (similar to that of the PET/C64 only more extensive). Then with GFA on the Atari ST I got rid of the line numbers and in VB & VBA under Windows it became event-oriented.

Even if you use the same Basic Dialect, it is partly hart to translate from one System to another. Like transfering Programs vom CMM to Pico.
That's why I understand if it's not easy to read someone else's source code. I sometimes have trouble understanding my own source codes when they are a few months old.
'no comment
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 09:14am 22 Aug 2023
Copy link to clipboard 
Print this post

Commodore BASIC is one on its own, unfortunately. I think if I was to learn BASIC again it's not one I would choose to start with. :) I used to have a C64 and, I'll be honest, it was the only machine I was finally glad to get rid of.

The Atari STFM was a whole new ball game. I loved that machine (lost in a fire, unfortunately). I even considered getting a replacement but even a second hand one was a bit expensive at the time.

For sheer programming fun I still think the old Speccy took some beating. Once you got used to the keyboard system it was surprising how quickly you could churn something out.

I've been converted by MMBasic now though. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 09:30am 22 Aug 2023
Copy link to clipboard 
Print this post

  Quote  The Atari STFM was a whole new ball game. I loved that machine (lost in a fire, unfortunately).

I have one here.. I too loved this. I had a really good MIDI Keyboard, loads of fun.
  Quote  That's why I understand if it's not easy to read someone else's source code. I sometimes have trouble understanding my own source codes when they are a few months old.


Yep! Me too I keep forgetting to comment / remark..

  Quote  For sheer programming fun I still think the old Speccy took some beating. Once you got used to the keyboard system it was surprising how quickly you could churn something out.

I think I have most models.. 16k, 48k, original toastrack, +2, + 3 and a piggin QL.
I have a BBC B+ and a A500 with evertyhing. All upstairs.

Now I have Pi's and Pico's doing all this stuff... Tell you what I don't have.. A life.
I'd give my left arm to be ambidextrous
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 10:08am 22 Aug 2023
Copy link to clipboard 
Print this post

hehe....
I'm very familiar with that situation. :)  I too have a collection of ancient machines, including a couple of 19" racks with Nascom-2 systems in them, a pile of Gemini boards intended to go into a 19" rack or three, a pile of ZX81s and various assorted Speccys, a Camputers Lynx and a Mattel Aquarius. That's without the PCs, a smattering of RPis and a box of breeding RP2040 devices. Oh, and a Goldstar MSX. A lot of this stuff has been donated by various people over the years.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024