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: AustraliaPosts: 3194 |
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. 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: NetherlandsPosts: 4247 |
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: AustraliaPosts: 3194 |
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: 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: NetherlandsPosts: 4247 |
Oeps, my manual was not the latest… Sorry, Volhout PicomiteVGA PETSCII ROBOTS |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4247 |
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: NetherlandsPosts: 4247 |
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 KingdomPosts: 9129 |
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: NetherlandsPosts: 4247 |
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 KingdomPosts: 4043 |
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 KingdomPosts: 9129 |
Your code works perfectly for me on either a: or b: and VGA or normal PicoMite 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 KingdomPosts: 4043 |
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). 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 KingdomPosts: 9129 |
Never use a debugger. In my experience they never work on real time code with interrupts. Trivial to fix |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4043 |
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: NetherlandsPosts: 4247 |
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 KingdomPosts: 9129 |
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: AustraliaPosts: 2137 |
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: NetherlandsPosts: 4247 |
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 KingdomPosts: 4043 |
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: NetherlandsPosts: 4247 |
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: NetherlandsPosts: 4247 |
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 |