QL Tinkering

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

Re: QL Tinkering

Postby mk79 » Wed Mar 31, 2021 9:23 pm

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: 850
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Re: QL Tinkering

Postby Cristian » Wed Mar 31, 2021 9:25 pm

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: 1502
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: QL Tinkering

Postby NormanDunbar » Wed Mar 31, 2021 10:22 pm

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 - https://www.amazon.co.uk/Arduino-Softwa ... 1484257898, https://www.apress.com/gb/book/9781484257890
qbits
Bent Pin Expansion Port
Posts: 80
Joined: Sun Dec 11, 2016 3:32 pm

Re: QL Tinkering

Postby qbits » Thu Apr 01, 2021 9:40 am

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: 2575
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: QL Tinkering

Postby vanpeebles » Thu Apr 01, 2021 9:51 am

The trading game looks excellent!


qbits
Bent Pin Expansion Port
Posts: 80
Joined: Sun Dec 11, 2016 3:32 pm

Re: QL Tinkering

Postby qbits » Thu Apr 01, 2021 11:17 am

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: 1960
Joined: Wed Dec 01, 2010 10:39 pm

Re: QL Tinkering

Postby dilwyn » Thu Apr 01, 2021 11:57 am

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


--
All things QL - http://www.dilwyn.me.uk
qbits
Bent Pin Expansion Port
Posts: 80
Joined: Sun Dec 11, 2016 3:32 pm

Re: QL Tinkering

Postby qbits » Thu Apr 01, 2021 7:34 pm

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
Bent Pin Expansion Port
Posts: 80
Joined: Sun Dec 11, 2016 3:32 pm

Re: QL Tinkering

Postby qbits » Fri Apr 02, 2021 8:41 am

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 9 times


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

Re: QL Tinkering

Postby tofro » Fri Apr 02, 2021 1:03 pm

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

Who is online

Users browsing this forum: No registered users and 5 guests