Returning values from a basic extension function

Anything QL Software or Programming Related.
User avatar
pjw
Super Gold Card
Posts: 710
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Returning values from a basic extension function

Postby pjw » Thu Oct 15, 2020 11:12 am

mk79 wrote:<>

Code: Select all

        move.w  bv..chrix,a1

Haha, thats pretty definitive, yes!


Per
Be wary of large West-Coast corporations bearing gifts!
- Ancient Trojan proverb
daniel_baum
Bent Pin Expansion Port
Posts: 81
Joined: Sat Aug 26, 2017 11:58 am

Re: Returning values from a basic extension function

Postby daniel_baum » Sun Oct 18, 2020 6:34 pm

Hi all,

I finally have a working sbasic extension function :) :) It takes an sbasic name as a parameter, and returns the value of the last four bytes of the name table entry for that name, which, in the case of an sbasic extension, is the address of the function itself. It returns them as a hex string. I also wrote the same thing in sbasic, so I could find my own function to debug it (using jmon), and, later on, to confirm the results of the assembly language code.

This is the first time I have ever attempted an sbasic extension, so I am rather chuffed that it works. There's still a bit of debugging to do before I am sure that it won't brick the system :(

I do have a couple of questions: the function does not work fully until I have done a NEW, or loaded a new basic program. Before this, it only works partially, not finding names toward the end of the name list. Any ideas why this might be?

Also, is it possible to change the cursor colour in QD? On my system (QPC2 in high colour mode) it's light blue, and doesn't stand out very well against the grey background.

Thanks to all for your help in getting me started :)

D.


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

Re: Returning values from a basic extension function

Postby NormanDunbar » Sun Oct 18, 2020 7:05 pm

daniel_baum wrote:This is the first time I have ever attempted an sbasic extension, so I am rather chuffed that it works. There's still a bit of debugging to do before I am sure that it won't brick the system :(


It's a good feeling isn't it? Well done.

If you are on pre-JS, I think, extensions don't work after loading the code until NEW is called. From JS one, this is not necessary.


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
daniel_baum
Bent Pin Expansion Port
Posts: 81
Joined: Sat Aug 26, 2017 11:58 am

Re: Returning values from a basic extension function

Postby daniel_baum » Sun Oct 18, 2020 7:34 pm

NormanDunbar wrote:
daniel_baum wrote:This is the first time I have ever attempted an sbasic extension, so I am rather chuffed that it works. There's still a bit of debugging to do before I am sure that it won't brick the system :(


It's a good feeling isn't it? Well done.

If you are on pre-JS, I think, extensions don't work after loading the code until NEW is called. From JS one, this is not necessary.


Cheers,
Norm.


Hi Norm,

It's SMSQ/E 3.36. The extension works. It just fails to find some names which it finds successfully after the NEW.

D.


User avatar
mk79
Super Gold Card
Posts: 679
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: Returning values from a basic extension function

Postby mk79 » Sun Oct 18, 2020 8:49 pm

daniel_baum wrote:Also, is it possible to change the cursor colour in QD? On my system (QPC2 in high colour mode) it's light blue, and doesn't stand out very well against the grey background.
Cursors are sprites on SMSQ/E, they can have any colour, alpha transparency and even animation. Check out marcel-theme and fading-cursor here https://www.kilgus.net/smsqe/gd2-high-colour/. Should also be part of the QPCDemo.win file supplied with QPC I think.

Marcel


User avatar
mk79
Super Gold Card
Posts: 679
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: Returning values from a basic extension function

Postby mk79 » Sun Oct 18, 2020 8:50 pm

daniel_baum wrote:It's SMSQ/E 3.36. The extension works. It just fails to find some names which it finds successfully after the NEW.
You test in the main SBasic or some daughter SBasic?

Marcel


daniel_baum
Bent Pin Expansion Port
Posts: 81
Joined: Sat Aug 26, 2017 11:58 am

Re: Returning values from a basic extension function

Postby daniel_baum » Sun Oct 18, 2020 9:02 pm

Hi Marcel,

In the main Sbasic.

D.

Edit: I think I've found the problem. We'll find out tomorrow...



Who is online

Users browsing this forum: No registered users and 2 guests