Scaling an entire screen

Anything QL Software or Programming Related.
User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: Scaling an entire screen

Post by bwinkel67 »

My destination platform would be a BBQL (with JSU ROM since the scaling functions are for that). I also need the program to run a little quicker since the music replay is a bit slow (playing Mary Had A Little Lamb was painful). The program allows you to set tempo but I can't believe that it actually is doing it accurately given how bad it sounds. I think I've used Turbo before to compile Baton Twirler (I think Peter Hale created it and I like to use it when demoing multi-tasking).

If Q-liberator is easy to compile BASIC code to a stand-alone executable then I'll give that a try. Initially, to get a compiled version, I'd be doing it on QLAY with 8MB of memory and tons of speed.

I'd love to be able to also compile it on a BBQL with only microdrives (vDrive w/out vMap, so mdv3 through mdv8). Which one of these would work well on a slow 128K QL?


User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: Scaling an entire screen

Post by bwinkel67 »

EmmBee wrote:You can't go wrong with QLiberator, that's the compiler I would recommend.
I am using QPC2, and found that "del" is a keyword, so I changed that variable to "delay".
Also, to get it to work, I found that CURSOR #ch, x, y had to be changed to AT #ch, y DIV 10, x DIV 6.
The version I'm using is QPC2 v4.5. It could be that the latest v5.0 perhaps cures that problem.
Using QLiberator, this compiled straight off, with no problems, and it works well.
The cursor can be moved around the screen, and the sounds experienced.
Seems like a nice program.
I tried Supercharge and after a little bit of editing I got it to compile but it won't run. It gave a few dozen warning and had 5 erros that I was able to fix. One was that it didn't like DLINE (seems to be part of its list of commands).

I will try QLiberator next. Could you PM me a zip'ed file of the compiled program (or just attach it to this thread as a zip since it would allow others to use it as well), just in case I struggle to get it to compile. I will give it a try (and also try Turbo) just to see which one works for me.


EmmBee
Trump Card
Posts: 240
Joined: Fri Jan 13, 2012 5:29 pm
Location: Kent

Re: Scaling an entire screen

Post by EmmBee »

bwinkel67 wrote:
EmmBee wrote:You can't go wrong with QLiberator, that's the compiler I would recommend.
I am using QPC2, and found that "del" is a keyword, so I changed that variable to "delay".
Also, to get it to work, I found that CURSOR #ch, x, y had to be changed to AT #ch, y DIV 10, x DIV 6.
The version I'm using is QPC2 v4.5. It could be that the latest v5.0 perhaps cures that problem.
Using QLiberator, this compiled straight off, with no problems, and it works well.
The cursor can be moved around the screen, and the sounds experienced.
Seems like a nice program.
I tried Supercharge and after a little bit of editing I got it to compile but it won't run. It gave a few dozen warning and had 5 erros that I was able to fix. One was that it didn't like DLINE (seems to be part of its list of commands).

I will try QLiberator next. Could you PM me a zip'ed file of the compiled program (or just attach it to this thread as a zip since it would allow others to use it as well), just in case I struggle to get it to compile. I will give it a try (and also try Turbo) just to see which one works for me.
Hi,

I changed DLINE to ELINE (on 22 lines) and del to delay (5 lines) - all easy enough to do using Search and Replace.
Turbo limits channels to a maximum of 32 - the highest is #31, so I changed #99 to #9 (on 15 lines),
and also changed CURSOR #ch, x, y to AT #ch, y DIV 10, x DIV 6 ( on 1 line).
I did the compiles on QPC2 - so, beware - they may not work on QDOS. I don't know - let me know.

Here is the zip ...
QBSoundsv5.zip
(42.65 KiB) Downloaded 70 times
EmmBee


User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: Scaling an entire screen

Post by bwinkel67 »

I got it to compile with SUPERCHARGE with minimal changes (i.e. CUROSOR works and didn't need to be modified). I made the following changes:
  • All scaling functions I added (lines 1100 to 1720) were renamed from D????? to A_????? (A for adjust)
  • Added a check so it works for any ROM: IF ver$="JSU":hs=.84:else hs=1: REMark Adjust scale for US NTSC
  • The only mods, besides my scaling functions were
    • had to open up scr_ for channel 1 and 2 and con_ for channel 0 since SUPERCHARGE doesn't open by default
    • changed channel #99 to #9 since SUPERCHARGE only has 0 to 15
Note this is not my program, I only modified it. It was created by S. M. Bourne and can be found on Dilwyn's site under Sounds. The manual is pretty extensive:

http://www.dilwyn.me.uk/sound/QBITS%20E ... Sounds.pdf

My aim was to compile it so that it would run at a decent speed on a BBQL. It now can play Mary Had A Little Lamb at normal speed. My other modifications (sans the compile part to speed it up) was to make it run on NTSC QL's since the screen gets cut off, losing 25% of it at the bottom (that scaling may have slowed down the original program though I still think it would have been to slow originally). I used a scale factor of 84% because the program doesn't use the full screen even when you see all of it.

Here is the Supercharged program (I included the BASIC one as well). You need to invoke it with EXEC_W since otherwise you can't CTRL-C your cursor to it if run with EXEC. After compiling it with SUPERCHARGE, I had to change dataspace to 16000 to make it work (it defaults to only 2000). It should run on most machines (note that EmmBee's didn't work for me as it replaced a bunch of characters with junk and the screen formatting was all off -- likely due to QBC2 compilation).
QBQLSoundsv5.zip
(22.59 KiB) Downloaded 71 times
My plan, for fun, is to try and compile it with SUPERCHARGE on my BBQL. I like SUPERCHARGE because it reminds me of Digital 'C" SE. I know Turbo is the newer version but I don't like its interface and haven't been able to get it to work.


User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: Scaling an entire screen

Post by bwinkel67 »

Dilwyn, perhaps we can add this next to the original as a compiled version (with added NTSC support). Note that I am not the author so maybe he should be contacted to see if he's fine with that since I did make changes other than just to get it to compile. It's such a cool program and the compiled version makes it run nicely on a BBQL.

Bedsides the few changes to get it to compile with SUPERCHARGE and the screen formatting changes run on multiple ROM's, I also changed the list of devices so now it works with flp1, flp2, or mdv1 through mdv8 (the original had no mdv, it did have win, but also had nfa and dos which I didn't find all that useful). I did add a REMark that I modified it for NTSC. It has 10 devices now (originally 8) but I could up it to 12 and add win1 and win2, though I figure with flp1 and flp2 you can always remap that to win1 and win2.


User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: Scaling an entire screen

Post by bwinkel67 »

The zip file I uploaded with QBQLSoundsv5_exe in it had a bug. :o :( I spent a few hours debugging it only in the end to realize the report_txt file screamed at me with a warning:


**** Warning at line 157: END SELECT assumed.

**** Warning at line 157: END SELECT assumed.


There were 2 inline SELECT statements that weren't terminated and so all the code afterwards (that dealt with printing the marker on the keyboard) was skipped. SuperBASIC doen't seem to care all that much about ending them but SUPERCHAGE did. Fixed now and seems to work.
QBQLSoundsv5.zip
(22.62 KiB) Downloaded 76 times
I'm pretty impressed with SUPERCHARGE. It compiled, what I would say is, a very complex BASIC program pretty easily. When I started this I was worried I'd have to spend a ton of time changing stuff. It gave good syntax errors and warning (I should have read the warnings more carefully). The program runs as expected. I don't do much BASIC programming on the QL but (a) am impressed with the SuperBASIC language and (b) with also with Digital Precision's SUPERCHARGE (and I feel like I can safely say this again on the forum without getting flamed).

I will eventually try Turbo and QLiberator to see how they compare. I first want to see how SUPERCHARGE works on an unexpanded BBQL since that's always sort of the fun of it when it comes to this hobby for me. Now, do I use faster emulator when I want to get something to run as quickly as possible? Oh yes :)


User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: Scaling an entire screen

Post by bwinkel67 »

Casio vs Sinclair QL. I actually learned to play the tune while entering the sheet music on the QL :D

https://vimeo.com/614109979


Silvester
Gold Card
Posts: 436
Joined: Thu Dec 12, 2013 10:14 am
Location: UK

Re: Scaling an entire screen

Post by Silvester »

bwinkel67 wrote:Casio vs Sinclair QL. I actually learned to play the tune while entering the sheet music on the QL :D

https://vimeo.com/614109979
Nice, pitch sounded correct (to my ear at least).

There is a simple MIDI device over NET in post here (https://www.qlforum.co.uk/viewtopic.php ... =10#p14069), you could also play the MT205 from Basic quite easily (no record though).

Edit: Ah, a link on google misled me, MT205 has no MIDI !


David
User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: Scaling an entire screen

Post by bwinkel67 »

Wow, MIDI out over the network port (with even a diagram provided on how to wire the connector). That port can also produce audio (i.e. for tape saving). I want to eventually see if any audio (speech) synthesis can be done like the ZX81. Pretty handy port. I realize it's only going out and I bet the "going in" is the more important piece for MIDI.


User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: Scaling an entire screen

Post by bwinkel67 »

So I ran into a bit of a problem that I didn't realize existed. I thought that monitor mode for both NTSC and PAL was identical and only TV mode differed since in NTSC you lose some screen real estate. I discovered in my compiled QBQLSoundsv5 program that it worked differently with JS vs JSU ROM. I had scaled it horizontally (hs = . 84 since the QBQLSoundsv5 program didn't use the full screen in PAL mode...otherwise the scaling, for full screen, should be .75) but also needed to use that variable for veritical scaling, which was surprising. With JSU (NTSC) I get the full 512x256 screen in Monitor mode and only 512x192 in TV mode, so why in the world is vertical behaving differently between NTSC and PAL?

Here is an example. No scaling used (i.e. SCALE was not applied), so this is what you get when you boot up. Note that BLOCK works the same on both (left is JSU/NTSC and right is JS/PAL) but LINE works differently:
QL-graphics.png
Why was the coordinate system changed for NTSC?


Post Reply