Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 15:45 10 May 2025 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 V6.00.02 betas

     Page 20 of 23    
Author Message
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3998
Posted: 09:42am 03 Mar 2025
Copy link to clipboard 
Print this post

  bfwolf said  From the latest manual:


Can TIMER be used as a COMMAND?

It can be used as a variable (timer = 0 etc) but I tried

timer 0


and got Error: Syntax
(using mmb4l)

John
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4854
Posted: 10:15am 03 Mar 2025
Copy link to clipboard 
Print this post

  matherp said  What a convoluted way of doing something that is fully supported

TEXT 10,200,str$(timer,3,0,"0")


ACKn,

There is a better way. I will use it.
But why does the convoluted way not work ? Is there a hidden snag, I was not aware of, or is there a flaw in the implementation ?

Volhout
PicomiteVGA PETSCII ROBOTS
 
dddns
Senior Member

Joined: 20/09/2024
Location: Germany
Posts: 259
Posted: 10:34am 03 Mar 2025
Copy link to clipboard 
Print this post

  Volhout said  
But why does the convoluted way not work ?
Volhout

It does!Try
Str$(timer,0,0)

Edited 2025-03-03 20:42 by dddns
 
ville56
Senior Member

Joined: 08/06/2022
Location: Austria
Posts: 217
Posted: 11:03am 03 Mar 2025
Copy link to clipboard 
Print this post

in V6.00.02b15 I encoutered the following symptom:

if the following line is entered


 f_speed = (f_len_mm/time_diff)*(1e6/3600000)*f_scale


the firmware changes i immediately to

f_speed = (f_len_mm/time_diff)&(1e6/3600000)*f_scale


no matter if entered dirctly or via MMedit upload. BUT if the * is followed by a trailing blank, the * persists.


Regards, Gerald
                                                                 
73 de OE1HGA, Gerald
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 11:12am 03 Mar 2025
Copy link to clipboard 
Print this post

  Quote  in V6.00.02b15 I encoutered the following symptom:


Sorry - playing with an idea - will back it out in the next beta. In the meantime use the space before the (
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4854
Posted: 12:37pm 03 Mar 2025
Copy link to clipboard 
Print this post

  dddns said  
  Volhout said  
But why does the convoluted way not work ?
Volhout

It does!Try
Str$(timer,0,0)


Oh.... I feel so stupid...
Thanks.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4854
Posted: 09:04am 05 Mar 2025
Copy link to clipboard 
Print this post

Peter,

v6.00.02b15 has a nasty bug (found on 2040 VGA version). This is probably the same as ville56 found.

It converts a "*" into an "&" symbol.

See below error message
> RUN
[620] sy=180+8&(part>5):pt=Part-6&(part>5)
Error : Expression syntax

'line 620 contains this code:
sy=180+8*(part>5):pt=Part-6*(part>5)


I have loaded the program from SD card, tried uploading it again through USB (Xmodem). Result is the same. This is a program that ran fine on b14.

Options did not change (VGA design 2). Keyboard = US.

Volhout
Edited 2025-03-05 19:07 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 09:31am 05 Mar 2025
Copy link to clipboard 
Print this post

I know. The workround is to put a space before the bracket - will be fixed in next beta
 
ville56
Senior Member

Joined: 08/06/2022
Location: Austria
Posts: 217
Posted: 11:46pm 05 Mar 2025
Copy link to clipboard 
Print this post

@Peter,

SEEK seems to work not properly on drive A:

Symptopm:
On drive A: opening a file for RANDOM, SEEK to a position and PRINT a char does not extend the file to the expected size. The char is written at some (for me) arbitrary position. Could be just appended at EOF position. Can evaluate this further if you want me to.

On drive B: with the same procedure, the file has the proper size and the char ist stored at the expected position.

Environment: RP2350A, V6.00.02b15

Regards, Gerald
                                                                 
73 de OE1HGA, Gerald
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 07:54am 06 Mar 2025
Copy link to clipboard 
Print this post

  Quote  On drive A: opening a file for RANDOM, SEEK to a position and PRINT a char does not extend the file to the expected size.


That's not functionality I would expect to work on the B: drive so I'm surprised it does. The fact that is doesn't on the A: drive is a function of LittleFS internals so can't be changed.
 
ville56
Senior Member

Joined: 08/06/2022
Location: Austria
Posts: 217
Posted: 10:20am 06 Mar 2025
Copy link to clipboard 
Print this post

Sorry Peter, but I don't understand why it should not work at all.

IMHO the SEEK is necessary to position the read- or writepointer within a RANDOM file. Otherwise random files would be useless as one cannot freely position the pointer. So the sequence open for random, seek, read or write should work even with LittleFS. Or asked the other way round ... what sequence should work for random file access?

Where is my misunderstanding, please? Maybe I don't see the wood for the trees ...
                                                                 
73 de OE1HGA, Gerald
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7503
Posted: 10:35am 06 Mar 2025
Copy link to clipboard 
Print this post

SEEK is for positioning the pointer at a position in an existing file. The file should be there otherwise there is no entry in it to SEEK. The idea is to open the file in RANDOM, write your records in any order you like then use SEEK to position the pointer to records within the file.

It may be that the problem is with the implementation for drive B:.

SEEK returns the number for the next record. It wouldn't make sense to use it to extend the file past the last record. OPEN RANDOM is for that.
Mick

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

Joined: 08/06/2022
Location: Austria
Posts: 217
Posted: 10:42am 06 Mar 2025
Copy link to clipboard 
Print this post

  Mixtel90 said  ... write your records in any order you like ...


That is exactly what I wanted to do, but I'm stumbling over the problem of writing records "in any order". So my idea was to use seek to position to where I want to write, even if it is past EOF.

But how do I write other than sequentially without specifying a position within the file ? ... I'm stuck here ....



Gerald
                                                                 
73 de OE1HGA, Gerald
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4251
Posted: 10:53am 06 Mar 2025
Copy link to clipboard 
Print this post

Gerald,

I wouldn't like to comment on whether the existing behaviour is "correct" (perhaps it should ERROR if you SEEK beyond the end of a file), but given it "is what it is" you could check the current file size before writing and if you want to SEEK beyond that point then first pad it with zeroes (or whatever your empty record is).

EDIT: Not that it helps you, but it looks like MMB4L works as you originally expected and fills in with NULLs until reaching the SEEK point.

Tom
Edited 2025-03-06 20:59 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 10:55am 06 Mar 2025
Copy link to clipboard 
Print this post

I'll look at it
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 12:04pm 06 Mar 2025
Copy link to clipboard 
Print this post

V6.00.02b16 posted

https://geoffg.net/Downloads/picomite/PicoMite_Beta.zip

Fixes silly bug in parser when ( follows directly after *
Allows seek to increase file size on the A: drive
Workaround for bug in RP2350 ROM that changes the QSPI-PAD configuration when writing to flash - in English    fixes a bug that made overclocking a RP2350 with PSRAM more difficult
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 295
Posted: 12:18pm 06 Mar 2025
Copy link to clipboard 
Print this post

USB/HDMI/2350 beta11 (I know there is newer betas but I do not think it would change somehow problem I`ve got)

I need advice. And do not think it deserves separate thread.

I wrote some library sub, which name i call from command prompt (as so named users, or custom or new command) and all works good according to manual.  

SUB declares some global variables, and other (helper) subs (sits in library too) reads/modifies declared few global vars if needed.

So sub does it`s job and exits. Under exit I could erase vars, but there is also posibility - user just ctrl+C  before sub would finish, and then vars vill not be erased.

If I would run sub first time - all good.

If I would ctrl+C and exit sub and would call it again (without any prior RUN or EDIT command) it throws error "variable already declared"

It seems to me I understand how things work, but if sub could be run from library multiple times withour RUN/EDIT in between (commands which would reset and clear vars) should`n entering multiple times SUB reset vars too ?

I see some ways how to work around this, but still need advice how I could solve this problem, before making something unnecesarry complicated.
My MMBasic 'sand box'
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4251
Posted: 12:21pm 06 Mar 2025
Copy link to clipboard 
Print this post

  matherp said  V6.00.02b16 posted


Peter, could you confirm (or otherwise) that this includes support for the PiHut and Buffalo gamepads I sent you the configuration for ? If not, then no hurry, I just won't be installing this firmware yet.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 12:22pm 06 Mar 2025
Copy link to clipboard 
Print this post

Yes
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4251
Posted: 12:30pm 06 Mar 2025
Copy link to clipboard 
Print this post

  matherp said  Yes


Lovely, I'll try to find 10 minutes to test.

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
     Page 20 of 23    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025