QL Tinkering

Helpful tips and guides, also new users can ask for help here.
User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: QL Tinkering

Post by mk79 »

qbits wrote:If you have written anything similar, I would be interested to see them or simply discuss alternatives as part of this topic!
TK2 comes with PRINT_USING

Code: Select all

PRINT_USING "###.###",1.23
Well with Easter almost upon us, I offer this the latest from my QL Tinkering’s… In continuation of my Coffee Cup Challenges, my QBITS Sliding Tiles and write up which includes QBITS Tic Tac Toe and a New Game QBITS Trader to test your resolve and skill as a Stock Market Trader.
Looks cool as always :-)

Cheers, Marcel


User avatar
Cristian
Aurora
Posts: 960
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Re: QL Tinkering

Post by Cristian »

qbits wrote:Well with Easter almost upon us, I offer this the latest from my QL Tinkering’s
Hi,
I've just made some quick tests with real QL and Qemulator. I've sent you some useful information via PM.


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: QL Tinkering

Post by NormanDunbar »

qbits wrote:If you have written anything similar, I would be interested to see them or simply discuss alternatives as part of this topic!
Many years ago, and I do mean many, I wrote a hard disc backup utility called WinBack. I used TK2 but when Dilwyn agreed to publish it, and as TK2 was commercial, I needed to write replacement code for any TK2 stuff I was using.

One of the functions I had to write was to enable me to format numbers into comma delimited, right justified format. I wrote it in assembly. I think I called it comma$, or similar. It was for unsigned values, no decimal points, and up to 13 digits. Leading zeros were suppressed, unless the number was itself zero.

I suspect, given its age, that the code may well be bad! (Winback_asm in this file http://www.dilwyn.me.uk/backup/wbsource.zip)

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
qbits
Trump Card
Posts: 171
Joined: Sun Dec 11, 2016 3:32 pm

Re: QL Tinkering

Post by qbits »

Thanks Marcel – PRINT_USING poses some interesting thoughts. I’ll have to see if I can work it with my specific set up.

Cristan - Thanks for reminding me the QBTTT and QBTile prog will need gx,gy line 1002 set to 0 for BBQL running.

Norman – Yes, back in the day I attempted to write some questionable assembly coded for right justify. Mine is lost in the past and rightly deserves to stay there….


QBITS
Last edited by qbits on Thu Apr 01, 2021 11:19 am, edited 2 times in total.


User avatar
vanpeebles
Commissario Pebbli
Posts: 2815
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: QL Tinkering

Post by vanpeebles »

The trading game looks excellent!


qbits
Trump Card
Posts: 171
Joined: Sun Dec 11, 2016 3:32 pm

Re: QL Tinkering

Post by qbits »

Thanks vanpeebles - the QBTrader_v2 posting is a beta version. I’m still in the process of playing around with variables to make the Market Simulation more diverse.

Cristian – running Q-emulator in limited features mode – I had a problem. The use of CURSOR#ch,x,y,x-offset,y-offset (the Graphics coordinates use of Cursor) doesn’t seem to be supported?

QBITS


User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

Re: QL Tinkering

Post by dilwyn »

qbits wrote:Thanks vanpeebles - the QBTrader_v2 posting is a beta version. I’m still in the process of playing around with variables to make the Market Simulation more diverse.

Cristian – running Q-emulator in limited features mode – I had a problem. The use of CURSOR#ch,x,y,x-offset,y-offset (the Graphics coordinates use of Cursor) doesn’t seem to be supported?

QBITS
QBits - there is an article on the Articles page (where else?) on my site about the problem with a 5 parameter CURSOR command:
some versions of the QL ROM have a nasty bug which prevents the use of the five parameter version of the CURSOR command, but even on version AH and JM ROMs you can still get the command to work with 4 parameters, i.e. miss out the channel number, in which case it defaults to using channel #1. You can get more details of this bug by reading Simon Goodwin and Mark Knight's articles on QL bugs in past issues of QL World and QL Today respectively
To work around this you may be able to fiddle around with channel IDs, there was an article by Simon Goodwin about the equivalent of an USE command, which allowed other channels to be assigned as default channel instead of #1, maybe QL World, maybe DIY Toolkit, I can't find it atm.

EDIT: The article was published in QL World March 1988. The code and text of the article is available in DIY Toolkit Volume C (the USE extension) - http://www.dilwyn.me.uk/tk/diytk2.zip


qbits
Trump Card
Posts: 171
Joined: Sun Dec 11, 2016 3:32 pm

Re: QL Tinkering

Post by qbits »

Dilwyn – I checked out USE and it would be of great use, no pun intended.
It could replace my ch=n S/SuperBASIC Command #ch, that I use for the same reason the Command USE was intended.
I wonder why it wasn’t included in the QPC keywords! Or is there an alternative?

QBITS


qbits
Trump Card
Posts: 171
Joined: Sun Dec 11, 2016 3:32 pm

Re: QL Tinkering

Post by qbits »

You learn something new every day. The CURSOR graphics coordinates for the original SuperBASIC I have learnt, been reminded only applied to the default Window Channel #1 and only accepted 4 parameters x, y Graphics coordinates with x ,y Pixel offsets. The channel option was added I guess with TK2. QBTiles_v2BBQL should now run OK.

QBITS
Attachments
QBTiles_v2BBQL.zip
(3.56 KiB) Downloaded 113 times


User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: QL Tinkering

Post by tofro »

qbits wrote:... The channel option was added I guess with TK2. QBTiles_v2BBQL should now run OK.

QBITS
I don't think so. JS and onwards had the optional channel number in CURSOR.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Post Reply