Window Manager programming in Assembler
-
- Aurora
- Posts: 970
- Joined: Tue Dec 17, 2013 1:17 pm
Window Manager programming in Assembler
I am trying to learn to program in the Pointer Environment in assembler. I don't want to use EasyPointer or EasyPEasy, just plain assembler.
I have a couple of questions (I'm sure there will be more)
1. How do I determine how much memory I need to reserve for the Window Working Definition, and the Window Status Area?
I know the Working Definition is going to be a bit bigger than the Window Definition (word pointers become long pointers etc).
Is there a formula for working it out - Like size of the window definition + x bytes for each loose item + y bytes for each...... etc.
Likewise for the Window Status Area.
2. Just how does the pattern and colours data work in Sprite definitions? I've looked at working examples, but I cannot see the way the data corresponds to the graphic that appears on the screen.
Martin Head
I have a couple of questions (I'm sure there will be more)
1. How do I determine how much memory I need to reserve for the Window Working Definition, and the Window Status Area?
I know the Working Definition is going to be a bit bigger than the Window Definition (word pointers become long pointers etc).
Is there a formula for working it out - Like size of the window definition + x bytes for each loose item + y bytes for each...... etc.
Likewise for the Window Status Area.
2. Just how does the pattern and colours data work in Sprite definitions? I've looked at working examples, but I cannot see the way the data corresponds to the graphic that appears on the screen.
Martin Head
- NormanDunbar
- Forum Moderator
- Posts: 2470
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Buckie, Scotland
- Contact:
Re: Window Manager programming in Assembler
I suspect you need to download Wolfgang's QPTR manual and have a gander at page 185 onwards where it describes the status area (of the working definition?). There's a fixed size of $3F bytes followed by one byte per loose item. Then, elsewhere, there's an area of one byte per application sub window menu item.
I think!
Cheers,
Norm.
I think!
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.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
- NormanDunbar
- Forum Moderator
- Posts: 2470
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Buckie, Scotland
- Contact:
Re: Window Manager programming in Assembler
Many years ago, Geraint Jones did an assembler "course" for the pointer environment in Quanta. I can't remember when, sorry. Is there an index?
Cheers,
Norm.
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.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Re: Window Manager programming in Assembler
Martin,
The manual states
Tobias
Actually, there's no such thing as a documented "formula" for that (rather the opposite). When I have to calculate that size, I normally do it using trial and error (and that is one of the reasons why I tend to use EasyPtr for creating menu definitions for assembler programs, apparently, it "knows" that formula), starting from a rough estimate plus some added elbow room and then checking with the debugger.Martin_Head wrote: 1. How do I determine how much memory I need to reserve for the Window Working Definition, and the Window Status Area?
I know the Working Definition is going to be a bit bigger than the Window Definition (word pointers become long pointers etc).
Is there a formula for working it out - Like size of the window definition + x bytes for each loose item + y bytes for each...... etc.
The manual states
At least some pity for you, but not very helpful otherwiseThis may seem unfair, but only the application will be able to determine the maximum space required in this area.

Tobias
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
- NormanDunbar
- Forum Moderator
- Posts: 2470
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Buckie, Scotland
- Contact:
Re: Window Manager programming in Assembler
Bollox! The fixed size is of course $40 bytes long, not as above. The address offset into the status area is from 0 to $3F. The status byte of the first loose item is at $40 in the status area.NormanDunbar wrote:There's a fixed size of $3F bytes followed by ...
Sorry.
The QPTR manual is at http://www.wlenerz.com/smsqe/add1.html.
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.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
-
- Aurora
- Posts: 970
- Joined: Tue Dec 17, 2013 1:17 pm
Re: Window Manager programming in Assembler
I am currently using the QPTR manual that came with my QPTR package many years ago. I will have a look at Wolfgang's QPTR manual.
At the moment I am using the guesstimate plus a bit of wriggle room approach, just wondered if there was a 'formula'.
No response to question 2. Is it that tricky then? I know there are programs for designing sprites and creating the assembler for them. But I would like to know how it works. That,s why I am trying to avoid things like EasyPointer that do some of the hard work for you.
OK new question, number 3
I want to have a text box on my window that I can type into and edit. Say a filename.
Do I have to open a new (secondary?) window with it's own channel number? How do I get the cursor to appear in it when I click on it? Where is the text stored that I type?
I have disassembled the calculator from QPAC1/2 and that has taught me a lot. But it does not have a text input. I may have to disassemble one of the other QPAC1/2 programs that does have a text input that I want, to see how it works.
Martin Head
At the moment I am using the guesstimate plus a bit of wriggle room approach, just wondered if there was a 'formula'.
No response to question 2. Is it that tricky then? I know there are programs for designing sprites and creating the assembler for them. But I would like to know how it works. That,s why I am trying to avoid things like EasyPointer that do some of the hard work for you.
OK new question, number 3
I want to have a text box on my window that I can type into and edit. Say a filename.
Do I have to open a new (secondary?) window with it's own channel number? How do I get the cursor to appear in it when I click on it? Where is the text stored that I type?
I have disassembled the calculator from QPAC1/2 and that has taught me a lot. But it does not have a text input. I may have to disassemble one of the other QPAC1/2 programs that does have a text input that I want, to see how it works.
Martin Head
- NormanDunbar
- Forum Moderator
- Posts: 2470
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Buckie, Scotland
- Contact:
Re: Window Manager programming in Assembler
Page 104 ...
Wm.swinf, Wm.swlit, Wm.swapp etc set the window to the info window, loose item, application sub window. Then you can use wm.rname or wm.ename from page 124 to edit text in the appropriate area, or us other code to do other stuff with that area.
I've no idea at present, how to set the window back to full size again afterwards! Maybe wm.rptr copes. Never tried it in pure assembly to be honest. As far as I remember ....
Cheers,
Norm.
Wm.swinf, Wm.swlit, Wm.swapp etc set the window to the info window, loose item, application sub window. Then you can use wm.rname or wm.ename from page 124 to edit text in the appropriate area, or us other code to do other stuff with that area.
I've no idea at present, how to set the window back to full size again afterwards! Maybe wm.rptr copes. Never tried it in pure assembly to be honest. As far as I remember ....
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.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Re: Window Manager programming in Assembler
WM.WDRAW (which you would normally do anyways after the input) should restore everything to the previous state.NormanDunbar wrote: I've no idea at present, how to set the window back to full size again afterwards! Maybe wm.rptr copes. Never tried it in pure assembly to be honest. As far as I remember .....
Tobias
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
- NormanDunbar
- Forum Moderator
- Posts: 2470
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Buckie, Scotland
- Contact:
Re: Window Manager programming in Assembler
Thanks Tobias, very useful.
Cheers,
Norm.
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.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
- mk79
- QL Wafer Drive
- Posts: 1349
- Joined: Sun Feb 02, 2014 10:54 am
- Location: Esslingen/Germany
- Contact:
Re: Window Manager programming in Assembler
The sprite format is pretty well documented. QL format in the Qptr manual, extended colour sprites for example here:Martin_Head wrote:No response to question 2. Is it that tricky then? I know there are programs for designing sprites and creating the assembler for them. But I would like to know how it works. That,s why I am trying to avoid things like EasyPointer that do some of the hard work for you.
http://www.kilgus.net/smsqe/display.txt
Not sure if the latter is incorporated into the new Qptr manual. Any specific questions?