Page 3 of 4

Re: Window Manager programming in Assembler

Posted: Tue Oct 25, 2016 4:49 pm
by tofro
Silvester wrote:
Martin_Head wrote:

But of course, to use the macros you first need a good understanding of QPtr and its data arrays :geek:
To use the macros, you first need to have a QPTR license. I don't think it's still on sale, and I don't think it's available for download anywhere.

Tobias

Re: Window Manager programming in Assembler

Posted: Thu Oct 27, 2016 10:25 am
by Martin_Head
mk & tofro

I did wonder if it was to do with the bit patterns in the screen memory. Then I thought, No, That's so hardware dependant. Tony Tebby made QDOS so hardware independant. I thought, Surely the Window Manager would use some standard bit pattern, and then convert it to the correct form for the hardware it's running on.

Wrong....

On another topic.. This may be an 'obvious' question..

If I am writing a PE/Window manager program that I want to run in mode 4, and mode 8, and maybe GD2 modes. Do I need to write 2, or 3 different Window Definitions, one for each screen mode. Then when the program starts, look at the screen mode/window manager version to decide which Window definition to use.


As far as working out how much memory to reserve for the Window Working Definition, and Status areas. I was thinking about writing a routine that would allocate an area of memory, fill it with something like $55. Then use the Window manger routines to read your Window Definition and build the Working Definition in this area. Then scan the area backwards looking for the $55 to stop. This would be the end of the Working Definition. Subtract the start of the area from it, and add bit working room to get the required size for the Working Definition

Martin Head

Window Manager programming in Assembler

Posted: Thu Oct 27, 2016 10:40 am
by mk79
Martin_Head wrote:I thought, Surely the Window Manager would use some standard bit pattern, and then convert it to the correct form for the hardware it's running on.
With the limits imposed by the QL hardware you have to make shortcuts. SMSQ/E on the other hand can convert sprites between the different colour modes. The converted sprite is cached because the systems were/are still too slow to make the conversion live.
If I am writing a PE/Window manager program that I want to run in mode 4, and mode 8, and maybe GD2 modes. Do I need to write 2, or 3 different Window Definitions, one for each screen mode.
If you use the system palette then no, you only need to do one definition. Except for mode 8 maybe, but that's because of the different pixel size, not the colours.
As far as working out how much memory to reserve for the Window Working Definition, and Status areas. I was thinking about writing a routine that would allocate an area of memory, fill it with something like $55.
I'm at a conference and don't have access to my files. But that sounds awfully complicated. EasySource I think outputs the needed value, so I'd really advice for designing the menu in EasyMenu and convert that to assembler using EasySource.

Re: Window Manager programming in Assembler

Posted: Thu Oct 27, 2016 1:10 pm
by BSJR
mk79 wrote:The sprite format is pretty well documented. QL format in the Qptr manual, extended colour sprites for example here:
http://www.kilgus.net/smsqe/display.txt

Not sure if the latter is incorporated into the new Qptr manual. Any specific questions?
This may be a bit off a side step but looking at the display.txt, I cannot find how the various GD2 palette modes (3,7,15,31) should work. Where is this palette located inside the sprite, how many bytes are used for each colour sample?
Or is this one of the "Options" that was never worked out?

BSJR

Re: Window Manager programming in Assembler

Posted: Thu Oct 27, 2016 3:01 pm
by tofro
mk79 wrote:EasySource I think outputs the needed value, so I'd really advice for designing the menu in EasyMenu and convert that to assembler using EasySource.
It indeed does. It emits symbols for both the working definition and the status area length.

Code: Select all

worklen	equ	$00000210
statlen	equ	$00000060
Tobias

Re: Window Manager programming in Assembler

Posted: Thu Oct 27, 2016 3:05 pm
by Silvester
tofro wrote: To use the macros, you first need to have a QPTR license. I don't think it's still on sale, and I don't think it's available for download anywhere.
Tobias
The macros included with QPtr are exactly the same as included with the current SMSQ/E sources. They are WMAN macros. QPtr is the Basic toolkit (bin file).

Like most people at the time, I bought the QPtr package just for the official documentation on the Pointer interface/Window manager.

Although I had a tinker with QPtr BASIC keywords I've never used them. Though I have used EasyPtr 3 extensively.

Even though I already had TT original QPtr I stumped up again and bought new update from Jochen Merz (along with many other QL things).

I don't know if you know but you don't 'include' macros in your finished code - they are like a catalyst - only used to create machine code, and otherwise don't get 'used'.

I have never read anything about 'license' required to use them in your own code.

Re: Window Manager programming in Assembler

Posted: Fri Oct 28, 2016 7:28 pm
by mk79
BSJR wrote: This may be a bit off a side step but looking at the display.txt, I cannot find how the various GD2 palette modes (3,7,15,31) should work. Where is this palette located inside the sprite, how many bytes are used for each colour sample?
Or is this one of the "Options" that was never worked out?
The palette is not per sprite, but global for the whole OS. It's the same you get when using COLOUR_PAL in basic. You can redefine it using the PALETTE_8 command http://superbasic-manual.readthedocs.io ... #palette-8. Of course this makes it pretty much impossible to known what colour you actually end with as a developer, so I think nobody has ever used it in practice.

Re: Window Manager programming in Assembler

Posted: Fri Oct 28, 2016 7:52 pm
by mk79
tofro wrote:
mk79 wrote:EasySource I think outputs the needed value, so I'd really advice for designing the menu in EasyMenu and convert that to assembler using EasySource.
It indeed does. It emits symbols for both the working definition and the status area length.

Code: Select all

worklen	equ	$00000210
statlen	equ	$00000060
Thanks for checking. I'm now united again with my laptop and just checked QPtr, there the size of the area is determined automatically using the SETWRK macro.

And by the way
Location: SW Germany
Um, may I ask where in SW Germany?

Re: Window Manager programming in Assembler

Posted: Fri Oct 28, 2016 11:47 pm
by tofro
mk79 wrote:
tofro wrote:
Location: SW Germany
Um, may I ask where in SW Germany?

Stuttgart

Grüßle,
Tobias

Re: Window Manager programming in Assembler

Posted: Sat Oct 29, 2016 10:40 am
by mk79
tofro wrote:
mk79 wrote:Um, may I ask where in SW Germany?
Stuttgart

Grüßle,
Tobias
And I thought I was the last active QL user in the region :o

Cheers from Esslingen, Marcel :-)