Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 03:00 27 Apr 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 : CMM2: V5.07.00b12 - Various fixes

     Page 4 of 9    
Author Message
epsilon

Senior Member

Joined: 30/07/2020
Location: Belgium
Posts: 255
Posted: 12:56pm 01 Apr 2021
Copy link to clipboard 
Print this post

Hi Jiri and Tom,

I was thinking of inserting line splits at fixed intervals to work around the limitation, but that still wouldn't be editor-friendly.
The intent is to create self-extracting archives, most of which wouldn't fit into an editor anyway, but the expectation is that .bas files contain only text and I should respect that
(this in contrast with a .PRG on C64 which typically contains a mix of Basic and binary).

Base64 encoding or something like that would indeed do the trick. It'll be a bit more work than I was hoping for, but still doable. Thanks for the feedback!
Epsilon CMM2 projects
 
RetroJoe

Senior Member

Joined: 06/08/2020
Location: Canada
Posts: 290
Posted: 10:43am 02 Apr 2021
Copy link to clipboard 
Print this post

I appreciate the "container" impulse to get everything into a single portable .BAS file, but you wouldn't attempt that with media assets, each of which has its own dedicated file format.

Most OSes, even vintage 8-bit ones, support some form of raw binary file e.g. the Apple II DOS has BLOAD and BSAVE commands for binary data, and a BRUN command that loads and launches  an executable ML program.

Maybe the facility to save and load a stream of bytes is something Peter can consider as an enhancement request for the "MMOS".
Enjoy Every Sandwich / Joe P.
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 532
Posted: 12:53pm 02 Apr 2021
Copy link to clipboard 
Print this post

  Quote  Maybe the facility to save and load a stream of bytes is something Peter can consider as an enhancement request for the "MMOS".

I think this is you are waiting for.
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
RetroJoe

Senior Member

Joined: 06/08/2020
Location: Canada
Posts: 290
Posted: 07:33am 03 Apr 2021
Copy link to clipboard 
Print this post

@Jiri, well, that was easy    Thanks for pointing that new feature out!

@Epsilon, does that new SAVE DATA / LOAD DATA combination address your use case? Seems a lot more elegant than trying to encode / decode binary data within a BASIC comment block.

This topic reminds me of both Microsoft and Apple trying to convince us for twenty years that we absolutely needed compound office documents, but never actually getting it to work right in all that time. OLE has always been a hot mess.

IMHO, the only legitimate use case for a compound file format is streaming media, wherein the video and multiple audio and subtitle streams must be synchronized and distributed as a single file. And, similarly, we are still fighting the "media container wars", with no clear winner. I am betting on MKV, though - open standards always win over proprietary ones in the end.
Enjoy Every Sandwich / Joe P.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8579
Posted: 09:06am 03 Apr 2021
Copy link to clipboard 
Print this post

V5.07.00b24 now available

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

Fixes a bug where static variables with the same name in different subroutines conflict when used in an interrupt routine. Thanks Geoff
 
epsilon

Senior Member

Joined: 30/07/2020
Location: Belgium
Posts: 255
Posted: 10:14am 03 Apr 2021
Copy link to clipboard 
Print this post

  RetroJoe said  
@Epsilon, does that new SAVE DATA / LOAD DATA combination address your use case? Seems a lot more elegant than trying to encode / decode binary data within a BASIC comment block.


I'm creating a self-extracting version of the .MAR/.MZ1 archive, roughly equivalent to self-extracting zip files, i.e. when you execute them, they unpack themselves. The idea is to make it easy to publish complex CMM2 applications, e.g. games, that consist of multiple files.

SAVE/LOAD DATA doesn't help with that, but the earlier proposal to use base64 encoding solves it nicely. I base64 encode the archive and store it in a COMMENT START/END block. I have verified that this works even with comment blocks larger than CMM2 memory (I used a 6.5MB block to test).
The base64 encoding will increase the file size by 33%, and will increase the unpack-time, but I think that's acceptable.
Epsilon CMM2 projects
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1082
Posted: 02:30am 07 Apr 2021
Copy link to clipboard 
Print this post

What am I doing wrong now?

mode 1,8
cls
pause 1000
? "Test"
do
 DrawHLine 50,750,500
loop

sub DrawHLine x1,x2,y
 do : loop until getscanline > MM.VRES
 line x1,y,x2,y,20,0
 line x1,y,x2,y,20
end sub

On my system (400MHz, MMBasic Version 5.07.00b23), the above hangs on the "do : loop until getscanline > ..."
Comment this line out and it runs - poorly.
Different values of the comparison behave the same.
If I comment out the very first line (mode), the program will run from the editor, but not from the prompt.
The pause in line 3 seems to have no effect.

The purpose of this was to try draw things cleanly without flicker by waiting for the scanline to get 'out of the way'.
Works great when it works. Yes, I know there are other, perhaps better ways to draw cleanly, but ...
Visit Vegipete's *Mite Library for cool programs.
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 532
Posted: 06:25am 07 Apr 2021
Copy link to clipboard 
Print this post

Is it the same with while?
DO WHILE GETSCANLINE<MM.VRES LOOP

Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1082
Posted: 06:50am 07 Apr 2021
Copy link to clipboard 
Print this post

"DO WHILE GETSCANLINE < MM.VRES : LOOP" doesn't work either.

The weird part is that, with MODE 1,8 commented out, the program runs from the editor but not from the prompt. The DO WHILE version behaves the same.

"DO : LOOP UNTIL GETSCANLINE < 1" does work, although there is tearing on the top line. This might serve my purposes.
Visit Vegipete's *Mite Library for cool programs.
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 532
Posted: 06:59am 07 Apr 2021
Copy link to clipboard 
Print this post

And if you try to use interrupt routine from MODE?

DIM INTEGER blank=0
mode 1,8, intr
cls
pause 1000
? "Test"
do
DrawHLine 50,750,500
loop

sub DrawHLine x1,x2,y
do : loop until blank
line x1,y,x2,y,20,0
line x1,y,x2,y,20
blank = 0
end sub

SUB intr
 blank=1
END SUB

Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5903
Posted: 07:00am 07 Apr 2021
Copy link to clipboard 
Print this post

use an interrupt to set a flag
 dim integer doitnow
 mode 1,8,0,doit
 cls
 pause 1000
 ? "Test"
 do
   DrawHLine 50,750,500
 loop
 
sub DrawHLine x1,x2,y
 do : loop until doitnow = 1
 doitnow = 0
 line x1,y,x2,y,20,0
 line x1,y,x2,y,20
end sub
 
sub doit
 doitnow = 1
end sub


Jim

Edit: Jiri beat me to it!
Edited 2021-04-07 17:01 by TassyJim
VK7JH
MMedit   MMBasic Help
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8579
Posted: 07:26am 07 Apr 2021
Copy link to clipboard 
Print this post

  Quote  What am I doing wrong now?


Nothing - it is a bug

Workround is to change mode to something other than 1 and then back to 1

mode 2
mode 1,8
cls
pause 1000
? "Test"
do
DrawHLine 50,750,500
loop

sub DrawHLine x1,x2,y
do : loop until getscanline > MM.VRES
line x1,y,x2,y,20,0
line x1,y,x2,y,20
end sub


Trivial fix in next beta
Edited 2021-04-07 17:27 by matherp
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8579
Posted: 07:40am 07 Apr 2021
Copy link to clipboard 
Print this post

V5.07.00b12 now available

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

Fixes bug in getscanline when mode is set at the beginning of a program and the default mode is the same.

Inconsistency in manual for PAGE COPY. Transparent mode is initiated with T not 1 as specified in the manual. Both available from 5.07.00b25
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 12:07pm 07 Apr 2021
Copy link to clipboard 
Print this post

In chrome, win10, I no longer have the file downloaded when I click on the link above. For some months, I've had to right click on it, "open in new tab", and it downloads and the new tab disappears.

As of a few days ago, that no longer works either, I have to right click, "Copy Link Address", open a new tab, paste address and <Enter>. Then it downloads and I have to close the tab.

Anyone have any idea what is going on and how I fix it back to the way it was when I clicked on the link and it immediately downloaded?
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3840
Posted: 12:09pm 07 Apr 2021
Copy link to clipboard 
Print this post

  lizby said  In chrome, win10, I no longer have the file downloaded when I click on the link above. For some months, I've had to right click on it, "open in new tab", and it downloads and the new tab disappears ...


I have the same issue. It also downloads if you go "Incognito", it's probably a feature for our safety and security.

Best wishes,

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

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 12:33pm 07 Apr 2021
Copy link to clipboard 
Print this post

I have the same issue as well. I think chrome thinks it 'unsafe' for some reason. I right click on the link then click on 'save link as', chrome doesn't want to download it until I click on the '^' down the bottom and then click on 'keep'. Bing seems to be OK.

Bill
Keep safe. Live long and prosper.
 
mclout999
Guru

Joined: 05/07/2020
Location: United States
Posts: 430
Posted: 02:04pm 07 Apr 2021
Copy link to clipboard 
Print this post

The current download is at B25 but I can find no mention of that version. What has changed in B25?
 
mclout999
Guru

Joined: 05/07/2020
Location: United States
Posts: 430
Posted: 02:04pm 07 Apr 2021
Copy link to clipboard 
Print this post

The current download is at B25 but I can find no mention of that version. What has changed in B25?  Sorry Chrome locked up then I got the second post. I wish there was an option for users to delete errant posts like this.
Edited 2021-04-08 00:06 by mclout999
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8579
Posted: 02:22pm 07 Apr 2021
Copy link to clipboard 
Print this post

V5.07.00b25 now available

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

Fixes bug in getscanline when mode is set at the beginning of a program and the default mode is the same.

Inconsistency in manual for PAGE COPY. Transparent mode is initiated with T not 1 as specified in the manual. Both available from 5.07.00b25
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1082
Posted: 05:32pm 07 Apr 2021
Copy link to clipboard 
Print this post

  matherp said  ... it is a bug ... Trivial fix in next beta

Thank you for the fix - it works awesome!

=============================
Could you comment on IMAGE SAVE in conjunction with 8 bit (palette based) mode and modified palettes?

The screensave command I put into "Escape to the Green Hills" and the latest postings on the "MAPSTER tile engine" thread indicate that I and maybe others are struggling with the results we are getting.
Visit Vegipete's *Mite Library for cool programs.
 
     Page 4 of 9    
Print this page
© JAQ Software 2024