Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 14:44 27 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/WEB V5.07.08 release candidates

     Page 5 of 18    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4042
Posted: 09:28am 01 Oct 2023
Copy link to clipboard 
Print this post

Hi Peter,

The latest push to github has a typo in the README:

... all warnings in PicoMire code fixed ...
                          ^


I can understand how you might feel that about the code at the moment .

Best wishes,

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 9122
Posted: 09:43am 01 Oct 2023
Copy link to clipboard 
Print this post

The mode file codec provides no information as to what is the end. It just plays in a loop (CMM2 is the same and I think the Maximite did the same with a different codec). If anyone can tell me how to detect the end I'll implement it. (github hxcmod)

The hxcmod_fillbuffer function can return a tracker_buffer_state but I  don't know enough about the mod file format to interpret it
Edited 2023-10-01 19:54 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4042
Posted: 10:09am 01 Oct 2023
Copy link to clipboard 
Print this post

  matherp said  The mode file codec provides no information as to what is the end. It just plays in a loop (CMM2 is the same and I think the Maximite did the same with a different codec). If anyone can tell me how to detect the end I'll implement it. (github hxcmod)

The hxcmod_fillbuffer function can return a tracker_buffer_state but I  don't know enough about the mod file format to interpret it


Ack. @Martin H seems to know something about the format, so maybe he will be able to help.

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 04:21pm 01 Oct 2023
Copy link to clipboard 
Print this post

Information about the File Format can be found here :
https://www.ocf.berkeley.edu/~eek/index.html/tiny_examples/ptmod/ap12.html here :
https://www.exotica.org.uk/wiki/ProPacker_2.1#File_format
or here :
https://www.eblong.com/zarf/blorb/mod-spec.txt

If I remember correctly (it's been about 30 years) the trackers play the MODules until a user or the MOD to stop.
Maybe hxcmod has a Flag, which tells what to do at the End of the Playlist.
In a MOD, there may be jumps to other positions in the playlist, so some MODs play endlessly anyway.
The end can just be detected by looking at the position in the "playlist" if the end of the last pattern is reached, and there is nou "jump to another playlist position"-command in the last pattern, this should be the end of the song.
(The songlenth in Pattern should be found after the last Sampleinfo-block, at Offset 950, 1 Byte (Range is 1-128)).

@Tom, you might look at the lose.mod or the win.mod from the PETSCIIROBOT InGame Music, I posted last Friday. This should not be repeated automatically, because the module jumps into an empty pattern at the end and stays there.
I hope this helps..
Edited 2023-10-02 03:02 by Martin H.
'no comment
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9122
Posted: 05:57pm 01 Oct 2023
Copy link to clipboard 
Print this post

I've hacked hxcmod and put a parameterised return if the table position loops back to 0. Attached is VGA test firmware

USE:
PLAY MODFILE fname$
to play on a loop as normal

USE:
PLAY MODFILE fname$, interrupt
to trigger an interrupt and stop playback when the table address loops. Obviously only available in a program

tested and seems to work although the last bars may not be quite correct - let me know

PicoMiteVGA.zip
Edited 2023-10-02 04:20 by matherp
 
crez

Senior Member

Joined: 24/10/2012
Location: Australia
Posts: 152
Posted: 12:29am 02 Oct 2023
Copy link to clipboard 
Print this post

I have just tried 'play flac' on picomite 5.07.07 and it works fine for stereo, but a mono flac file is playing at what sounds like double speed. Using Audacity to generate the file. I have looked at the file header and it looks correct for a mono file. The mono file, as you would expect, is about half the size of the stereo one.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9122
Posted: 08:04am 02 Oct 2023
Copy link to clipboard 
Print this post

  Quote   but a mono flac file is playing at what sounds like double speed.


Thanks - will fix
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 12:32pm 02 Oct 2023
Copy link to clipboard 
Print this post

something has changed with the PIXEL(x,y) Function.

@5.07.07 it returns the color of the Dot on the active Layer (Framebuffer write N/F/L), even if the Range was on an Invisible layer. (F or N even if something overlaps on L).

@5.07.08RC4
PIXEL(x,y) returns the Color of the Visible dot, even if a other layer is switched to aktive (Framebuffer write N/F/L)
'no comment
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9122
Posted: 12:40pm 02 Oct 2023
Copy link to clipboard 
Print this post

VGA, PicoMite, What did you do first etc.?
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 12:52pm 02 Oct 2023
Copy link to clipboard 
Print this post

PicoMiteVGA MMBasic Version 5.07.08RC4


'test
MODE 2:Font 1
FRAMEBUFFER layer
FRAMEBUFFER write n
CLS
Text 0,0,"A"
FRAMEBUFFER write l
Box 0,0,16,16,,RGB(green),RGB(Green)
FRAMEBUFFER write n
Font 7
Text 0,32,""
For y=0 To 11
For x=0 To 7
If Pixel(x,y) Then :Print "1";:Else : Print "0";:EndIf
Next x
Print
Next y
Option list
'Save image "5.07.08RC4.bmp"


if you REM out the BOX on Framebuffer L, it works as it should.




On PicoMiteVGA MMBasic Version 5.07.07 it was correct
Except that the green square on the LAYER isnt saved by "save image"


Edited 2023-10-02 23:22 by Martin H.
'no comment
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9122
Posted: 01:20pm 02 Oct 2023
Copy link to clipboard 
Print this post

Wasn't this a change I made for you? It now reports the OR of N and L when the layer is active to allow SAVE IMAGE to capture the actual display
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 01:25pm 02 Oct 2023
Copy link to clipboard 
Print this post

  matherp said  Wasn't this a change I made for you? It now reports the OR of N and L when the layer is active to allow SAVE IMAGE to capture the actual display

No Volhout asked for a posibility, saving everything from the Screen..
But that's not the point

The green Square was also @5.0707 on the Screen (Layer) and the PIXEL Function still returns the correct values from the aktiv Layer (N).
What it does not on 5.07.08RC4

So now we can save everything from the screen, but the pixel function only works to a limited extent.
Edited 2023-10-02 23:36 by Martin H.
'no comment
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9122
Posted: 03:15pm 02 Oct 2023
Copy link to clipboard 
Print this post

OK understand - will fix
 
TheMonkeys

Regular Member

Joined: 15/12/2022
Location: Australia
Posts: 59
Posted: 05:18am 03 Oct 2023
Copy link to clipboard 
Print this post

Hi All, a little thought for the day.

How (not) to use BitBang:

My Library code (excerpt)
Option explicit
Option default integer
Dim dog=10 ' in case unattended freezboot
Const con=1 ' CONsole
Const lgf=2 ' logFiles
Const trc=4 ' TRaCe/TRaCk
Const lds=8 ' LEDs
Dim debug=lgf+con
'~~~ledstrip' setup
Const cort=0 '~~~ cortex, r=Hrs, g=Mins, b=Secs
Const serv=1 '~~~ servient, r=404, g=connection#, b=ftype
Const parse=2 '~~ parseReq, r=POST. g=parseing, b=paramcount
Const logshed=3 '~~~ logfiles, 15 min update, r=state, g=day, b=week + schedule reminder: gn to rd as reminder reached, bl on completion
Const therm=4 '~~ thermostat, r=on,g=off,b(off=thermo,on=forced)
Const ledpin=21
SetPin ledpin, DOut
Const striplen=5 ' led strip length - 5 LED bar
Dim ledbar(striplen)

Sub RGBled(ledind, rv, gv, bv) ' Solid - no LeDS means dimmed display
ledbar(ledind)=Choice(debug And lds,RGB(rv, gv, bv),RGB(rv/60,gv/60,bv/60))
Bitbang ws2812 O, ledpin, striplen, ledbar(0)
End Sub

My main loop
WEB tcp interrupt servient
main:
ch=Val(Field$(Time$,1,":")): cm=Val(Field$(Time$,2,":")): cs=Val(Field$(Time$,3,":")) ' pre-calculate
rd=ch*5: gn=cm*2: bl=cs*2 ' Time of Day
If (Timer Mod 1000)<200 Then ' Cortex Stable
RGBled(cort,rd,gn,bl) ' H,M,S
If cs=8 Then done=0 ' once
If cs=10 Then shedAct() ' a minute
Else
RGBled(cort,rd/8,gn/8,bl/8), ' h,m,s
EndIf
If remend > 0 Then ' do we have a...
ct=ch*60+cm ' mins since midnight
If remend>ct Then ' reminder. Only handles oaat(One At A Time)
gn=(remend-ct)/(remdur+1)*120
rd=120-gn
bl=0
RGBled(logshed,rd,gn,bl) ' reminder state
Else
remend=0
remdur=0
logIt("reminder complete",con,3)
RGBled(logshed,0,0,16) ' reminder complete
EndIf
EndIf
usage=round((1-(MM.Info(free space)/MM.Info(disk size)))*100,1)
Pause 6
updateheater
RGBled(cort,0,0,0) ' Cortex twitch enhance
maxmin
Pause 6
If cm Mod 15=14 And  cs > 50 Then ' *:14:5*,*:29:5*,*:44:5*,*:59:5*
busy=1 ' seems to help
If cs=51 Then fact$=getShed()
If cs=52 Then logFiles(0,maxtemp,mintemp)
If Time$="23:59:54" Then
maxmin(1)
logFiles((Day$(Now)="Sunday")+1,currenttemp,currenttemp)
logIt(Date$+" Day roll-over",con+lgf,3)
EndIf
busy=0 ' /seems to help
EndIf
If dog Then WatchDog (dog*1000) Else WatchDog off
GoTo main

35 minutes and 43 seconds of bit banging later, is it any wonder that it freezes?

I commented out the bitbang line in the subroutine and all is good.
50708b11 was the last time that I was getting away with this.

Cheers,

Chris.
Edited 2023-10-03 15:19 by TheMonkeys
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9122
Posted: 06:16pm 05 Oct 2023
Copy link to clipboard 
Print this post

V5.07.08RC5

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

Fixes bug introduced in reading the VGA screen when the framebuffer L is enabled
Fixes bug in the editor when a file is edited without an extension being specified (defaults to .bas)
Fixes bug in playing mono FLAC files (untested)

Changes LIBRARY DISK SAVE so only used memory is written to disk
Changes LIBRARY DISK LOAD so files smaller than the full library can be loaded
Together these changes allow libraries to be stored on, for example, a PicoMite, to be used on a PicoMiteVGA

PLAY MODFILE fname$ [, intsub]
If the optional interrupt parameter is set it will be called when the modfile has played through a single loop and playback will be terminated.
If not set the modfile will play on a loop as before. Because of the way mod files work the end of playback may not be perfect with a few additional notes from the next loop played.

OPTION PICO OFF/ON (default ON, permanent option, N/A WebMite)
If set to OFF GP23, GP24, and GP29 are not initialised allowing them to be used freely on non-Pico boards. GP25 remains under the control of OPTION HEARTBEAT ON/OFF

BLIT MEMORY address%, x, y[,col]
If the word at address% has the top bit set the sprite will be treated as compressed as though BLIT COMPRESSED was used

WebMite
WEB TLS functionality is removed. The maximum program size is increased to 96Kb (from 80Kb) WARNING: installing this version on the WebMite will delete the A: drive and all options
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4042
Posted: 12:02pm 06 Oct 2023
Copy link to clipboard 
Print this post

Thank you Peter, it looks like it also includes the fix to deal with the SD card access display artifacts during a background framebuffer copy .

  matherp said  WARNING: installing this version on the WebMite will delete the A: drive and all options


Could I trouble you for a pointer to what it is (in the source) that triggers this behaviour (not specific to this case but in the general PicoMite firmware update procedure) ?

Best wishes,

Tom
Edited 2023-10-06 22:03 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 12:43pm 06 Oct 2023
Copy link to clipboard 
Print this post

  thwill said  
  matherp said  WARNING: installing this version on the WebMite will delete the A: drive and all options


Could I trouble you for a pointer to what it is (in the source) that triggers this behaviour (not specific to this case but in the general PicoMite firmware update procedure) ?

Best wishes,

Tom

@Tom, Peter
I just updated the VGA Version, no option was deleted,
Pixel Function is working correct again, thank you
'no comment
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4042
Posted: 12:47pm 06 Oct 2023
Copy link to clipboard 
Print this post

  Martin H. said  @Tom, Peter
I just updated the VGA Version, no option was deleted,
Pixel Function is working correct again, thank you


Yes, Peter was clear it was only the WebMite which would experience this. I'm just hoping for a hint as to what governs when this does and does not happen so I don't have to unpick this piece of the source-code without direction.

Best wishes,

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 9122
Posted: 04:01pm 06 Oct 2023
Copy link to clipboard 
Print this post

  Quote  Could I trouble you for a pointer to what it is (in the source) that triggers this behaviour (not specific to this case but in the general PicoMite firmware update procedure) ?


1. I want it to - change of magic number in Configuration.h
2. Change of the heap/program/variable table size in Configuration.h
3. Change to the option structure - shouldn't be an issue going forward

NB: also, if new commands are added then programs stored in the library or flash slots may become corrupted - incorrect tokens. In this case I try and remember to do 1

In addition the A: drive will be automatically re-formatted if corrupt (e.g. after OPTION MODBUFF is set to a different size) and the options will be reset if corrupt
Edited 2023-10-07 02:02 by matherp
 
carlschneider
Senior Member

Joined: 04/08/2023
Location: South Africa
Posts: 158
Posted: 06:26pm 06 Oct 2023
Copy link to clipboard 
Print this post

Hi Peter

Thanks for releasing RC5.

Is it just me or have you restricted the OPTION DISPLAY column width to 100? I have some longish lines of code and have been using 157 up to RC4.
Cheers Carl                                                        
Retirement is tough on Hobbies without a day job
 
     Page 5 of 18    
Print this page
© JAQ Software 2024