Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 21:15 08 May 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 : Updated PicoMite, PicoMite and WebMite Firmware

     Page 2 of 4    
Author Message
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 10:10am 26 May 2023
Copy link to clipboard 
Print this post

  Volhout said  It is however annoying that the html files have long lines, and the webmite build in editor does not allow editing these long lines.

I created a batch file on my PC which copied all the files in the project one by one to the WebMite using TFTP.  This worked great, I could use Notepad++ on the PC to edit the .bas and .html files, hit save all, then double click in the batch file.  Within a second or two the WebMite was fully updated.

A great workflow.

  Volhout said  I would like to report an anomaly.
This happened to me because I created a webpage that auto refreshes itself every 10 seconds. So opening the build in editor, and few seconds later all is locked up.

Yes, it happened to me also.  Peter will best answer this but the web server runs in the background and my guess is that it is not terminated when MMBasic returns to the command prompt.  Many features of MMBasic act like this because keeping the context of the program open helps with debugging (for example, being able to print variables).

When your browser requests a page the server tries to respond but gets itself in a twist because the main program that started it is no longer running.  This is only a problem when debugging and I'm not sure of the solution except to close your browser.

Geoff
Geoff Graham - http://geoffg.net
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3562
Posted: 09:04pm 07 Jun 2023
Copy link to clipboard 
Print this post

Geoff,

Could I be mistaken, but is there in the picomite VGA manual no mention of SPRITES in the chapter about graphics ? There is a chapter on BLIT, but I must have missed SPRITES.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 05:49am 08 Jun 2023
Copy link to clipboard 
Print this post

There is a section on page 27 which covers SPRITE which replaces BLIT.  It is not very detailed, just a pointer to the functionality.

Page 61 says:
  Quote  The BLIT command is converted to SPRITE by the MMBasic pre-processor.  See the SPRITE command for the available functions.

Have I misunderstood your question?
The latest manual is here: https://geoffg.net/Downloads/picomite/PicoMiteVGA_User_Manual.pdf

Geoff
Geoff Graham - http://geoffg.net
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3562
Posted: 06:04am 08 Jun 2023
Copy link to clipboard 
Print this post

Oeps, my manual was not the latest…

Sorry,

Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3562
Posted: 06:04am 08 Jun 2023
Copy link to clipboard 
Print this post

Oeps, my manual was not the latest…

Sorry,

Volhout

P.S. you didn't change the font in appendix-E for the code snippets.
Edited 2023-06-08 18:31 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3562
Posted: 09:49am 09 Jun 2023
Copy link to clipboard 
Print this post

Geoff, Peter,

I would like to report a bug for the release 5.07.07 for VGA picomite.


play volume 50,50
do
 play tone 500,10
 pause 1000
 play tone 10,500
 pause 1000
loop


This piece of code plays 500Hz left, then right alternating. The other channel is 10Hz (best would be 0Hz, but for me 10Hz is inaudible on my headset).

So I try to achieve the same using the volume command

play tone 500,500
do
 play volume 0,50
 pause 1000
 play volume 50,0
 pause 1000
loop


However, I hear only 1 channel ON/OFF, as if it is mono. But I did program both channels with 500Hz.

What is wrong. Did I misinterpret how these commands work ?

Volhout

P.S. This is PCM audio from OPTION AUDIO GP6,GP7
Edited 2023-06-09 20:21 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8600
Posted: 01:20pm 09 Jun 2023
Copy link to clipboard 
Print this post

This is a feature which I introduced in the last release - perhaps wrongly?

When you execute PLAY TONE 500,500 the firmware optimises this as a mono output which significantly reduces the overhead in the audio interrupt. Therefore it only responds to the left volume setting.

If you go PLAY TONE n,m where n and m are different then the volume controls will work as expected
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3562
Posted: 02:15pm 09 Jun 2023
Copy link to clipboard 
Print this post

Aha....

Okay, this means that in practise I will not have a problem. I am studying for a picomite implementation of my old ORIC ATMOS snake game. And wanted to implement a somewhat more advanced soundtrack.


Volhout
Edited 2023-06-10 04:46 by Volhout
PicomiteVGA PETSCII ROBOTS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3852
Posted: 06:11pm 11 Jun 2023
Copy link to clipboard 
Print this post

Good evening Peter,

I've been chasing ghosts (memory corruption I think) with PLAY WAV, and whilst I'm not sure I've identified the smoking gun I've got the following issues to report:

1. I don't think NEW clears the PLAY WAV interrupt (Audio.c#WAVInterrupt)

2. The firing of the PLAY WAV interrupt occurs prematurely (?), certainly before PLAY WAV can be called again, e.g.

> list
Option Base 0
Option Default None
Option Explicit On

Dim wav_done%

Do
 wav_done% = 0
 Play Wav "CantinaBand3.wav", wav_interrupt
 Do While Not wav_done% : Loop
Loop

Sub wav_interrupt()
 Print "wav_interrupt"
 wav_done% = 1
End Sub
> run
wav_interrupt
[8] Play Wav "CantinaBand3.wav", wav_interrupt
Error : Sound output in use


3. The interrupt gets fired twice if you try and workaround this by using PLAY STOP, e.g.
> list
Option Base 0
Option Default None
Option Explicit On

Dim wav_done%

Do
 wav_done% = 0
 Play Wav "CantinaBand3.wav", wav_interrupt
 Do While Not wav_done% : Loop
 Play Stop
 Print "----"
Loop

Sub wav_interrupt()
 Print "wav_interrupt"
 wav_done% = 1
End Sub
> run
wav_interrupt
wav_interrupt
----
wav_interrupt
wav_interrupt
----
wav_interrupt
wav_interrupt
----
wav_interrupt
wav_interrupt
----
...


WAV file from here: https://www2.cs.uic.edu/~i101/SoundFiles/CantinaBand3.wav

Best wishes,

Tom

P.S. Did you get my email describing bugfixes for CALL and MM.CMDLINE$ ?
Edited 2023-06-12 04:12 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8600
Posted: 07:40am 12 Jun 2023
Copy link to clipboard 
Print this post

  Quote  The firing of the PLAY WAV interrupt occurs prematurely (?), certainly before PLAY WAV can be called again, e.g.


Your code works perfectly for me on either a: or b: and VGA or normal PicoMite

  Quote  P.S. Did you get my email describing bugfixes for CALL and MM.CMDLINE$ ?


Updated the code on github but no release in the near future
Edited 2023-06-12 18:34 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3852
Posted: 08:50am 12 Jun 2023
Copy link to clipboard 
Print this post

  matherp said  
  thwill said  The firing of the PLAY WAV interrupt occurs prematurely (?), certainly before PLAY WAV can be called again, e.g.


Your code works perfectly for me on either a: or b: and VGA or normal PicoMite


Thanks Peter, I think I know what I messed up with (2).

What about (3) that still seems to happen ?

And also (1), but I found that from code inspection rather than actually confirming it was the real source of my problems (which I'm still trying to reproduce in just a few lines of code).

  matherp said  
  thwill said  P.S. Did you get my email describing bugfixes for CALL and MM.CMDLINE$ ?


Updated the code on github but no release in the near future


Nps. Thank you.

Peter, do you have any experience debugging the firmware using a 2nd Pico as a Picoprobe with OpenOCD ? I just need to know whether it is possible before I spend time on it, or whether there is some fundamental brick-wall such as the MMBasic firmware being too big/complex.

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 8600
Posted: 09:22am 12 Jun 2023
Copy link to clipboard 
Print this post

  Quote  Peter, do you have any experience debugging the firmware using a 2nd Pico as a Picoprobe with OpenOCD ? I just need to know whether it is possible before I spend time on it, or whether there is some fundamental brick-wall such as the MMBasic firmware being too big/complex.


Never use a debugger. In my experience they never work on real time code with interrupts.

  Quote  What about (3) that still seems to happen ?

Trivial to fix
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3852
Posted: 09:26am 12 Jun 2023
Copy link to clipboard 
Print this post

  matherp said  Never use a debugger. In my experience they never work on real time code with interrupts.


Ah, a printf man, I mostly am myself but sometimes I feel the need for something more when hunting memory corruption issues.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3562
Posted: 05:22am 13 Jun 2023
Copy link to clipboard 
Print this post

Geoff, Peter,

Maybe this is already known, but I was fighting MMBasic for a few hours before I realized that you cannot edit a text file with the build in editor.

The text file was a sprite file consisting of a header and data fields.

The original file was created in the PC and send to the SD card.

During development I wanted to correct some flaws using the inbuild editor, and after that only the first sprite in the file would load, not the successive 7 (there are 8 sprites in the file). For the eye, the file looks good, but only 1 sprite will read.

This is picomite VGA 5.07.07

Attached is the (PC) sprite file that will load correct 8 sprites.
After opening in the editor, and save, it will only load the first sprite.

1_8.zip

I hope we can fix this, so people can also develop on the pico itself, and don't need a PC to work with sprites.

Volhout

Edit: the sprite file starts with a header (3 numbers), maybe the first number is converted into a line number in the editor.
Edited 2023-06-13 16:13 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8600
Posted: 07:56am 13 Jun 2023
Copy link to clipboard 
Print this post

  Quote  Edit: the sprite file starts with a header (3 numbers), maybe the first number is converted into a line number in the editor.


No, but the editor changes the spacing which bu..ers the C function "sscanf" reading the numbers. I can fix this in a new release but this is not imminent.
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 1805
Posted: 08:13am 13 Jun 2023
Copy link to clipboard 
Print this post

Might be of no use in this case but if every line in a data file starts with a single quote and the extension is .bas it should be possible.
Your program just needs to discard the first character of each line.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3562
Posted: 08:14pm 25 Jun 2023
Copy link to clipboard 
Print this post

Not sure if this is MMBasic design, but I noticed that the SETTICK stops when your MMBasic program is waiting for user response from an INPUT statement.

Is there an alternate compact way to mimick an INPUT statement that allows SETTICK to continue ? I use the tick for music, and the music stops during human interaction.
I want to avoid writing a complete input parser in MMBasic around an INKEY statement.

Any idea's ?
Edited 2023-06-26 06:15 by Volhout
PicomiteVGA PETSCII ROBOTS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3852
Posted: 09:11pm 25 Jun 2023
Copy link to clipboard 
Print this post

  Volhout said  Any idea's ?


I'm aware of no magic, but if you can cope with my over-engineering you are welcome to use con.readln() from here:

   https://github.com/thwill1000/mmbasic-sptools/blob/master/src/gonzo/console.inc

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3562
Posted: 07:20am 26 Jun 2023
Copy link to clipboard 
Print this post

Hi Tom,

Thank you for the con.readln() example. It will be a guide for me.
Although I may simplify it to the max to stay withing the 5000 bytes size for the program. The first game release will have the music stop during text entry.

Volhout
Edited 2023-06-26 17:20 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3562
Posted: 01:16pm 26 Jun 2023
Copy link to clipboard 
Print this post

Dear Peter,

I have a question about VAR SAVE/RESTORE in picomite VGA 5.07.07

When I have a program that saves a variable, and restore it in a second run, that works fine. But when I remove the program from program memory, and reload the same program, it does not restore anymore.

Example program:
Dim a
VAR restore

Print a
Input a
Print a

VAR save a


You can change the value of "a" and see that it is stored. But not after a NEW and re-loading of the same program.

>var clear
> new
> run "test
0
? 234
234
> RUN
234
? 456
456
> RUN
456
?
> new
> run "test
0
?


I checked, but after the "NEW" the memory for VAR was still reserved. Only the new version of the same program connot read the stored value anymore. What is happening ?

Volhout
Edited 2023-06-26 23:19 by Volhout
PicomiteVGA PETSCII ROBOTS
 
     Page 2 of 4    
Print this page
© JAQ Software 2024