[Ql-Users] WMAN queries

2011-01-21 Thread Norman Dunbar
Morning all,

I've written a small demo program to show the things that happen when an
application sub-window is hit in a PE program. The program has a window
containing a single application sub-window.

The hit routine does nothing more than this:

ahit0   movem.l d1/d3/d5-d7/a0/a4,-(a7) ; Save the workers
moveq #0,d1   ; D1.W = Application sub window number
moveq #0,d2   ; D2.W = Ink colour
;   A4 already set to Working definition
jsr wm_swapp(a2)  ; Set channel id (A0) to the subwindow

movem.l a1-a2,-(a7)   ; A1 gets corrupted
lea hit,a1; Text string to print
move.w ut_mtext,a2; Print string vector
jsr (a2)  ; Print the message

lea hitter,a1 ; Hit counter location
move.w (a1),d1; Hit counter value
addq.w #1,d1  ; Increment counter
move.w d1,(a1); Save counter
move.w ut_mint,a2 ; Print integer vector
jsr (a2)  ; Print it

movem.l (a7)+,a1-a2   ; Restore

movem.l (a7)+,d1/d3/d5-d7/a0/a4 ; Restore the workers
moveq #0,d0   ; No errors
rts

; Strings and things go here

hitter  dc.w 0; How many times have I been hit?

hit dc.w hit_e-hit-2  ; Hit message
dc.b 'HIT: '
hit_e   equ *

Now, when run I notice the following foibles:

1. The hit code is called when the pointer enters the sub-window, and
each time it moves within the sub-window.

2. Pressing the TAB key, which activates the sub-window, the counter
increases by TWO and not one.

3. Pressing the F1 key also increases the count by two.

4. Other keys, I have not tested everything, increment the counter by one.

There are no menus or anything in the sub-window, it is used simply as a
display area by the program, aub-window menus come in a later article!

Another question, I only have a single sub-window. If I comment out the
call to WM_SWAPP in the hit routine, I still see my output in the
sub-window, but it is not cleared before hand. (I can live with this)
but when I was writing PE stuff using SuperBasic and EasyPTR 3, I always
had to set the channel to the sub-window (or info window or whatever)
before I could write to it.

So, My further queries are:

1. Do I need to call WM_SWAPP if I only have one sub-window or can I
assume that the channel id always refers to the sub-window regardless
unless I explicitly set it to a loose item or whatever?

2. If I have two or more sub-windows, does the channel id, by default,
point at the first - I haven't tested this yet - If I don't call WM_SWAPP?

Thanks.

PS. The above has been noticed running on QPC under Wine on Linux. I'm
attempting to run it under Windows (in an emulator) to see what happens
there!

-- 
Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
Thorpe House
61 Richardshaw Lane
Pudsey
West Yorkshire
United Kingdom
LS28 7EL

Company Number: 05132767
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] WMAN queries

2011-01-21 Thread gdgqler

On 21 Jan 2011, at 10:14, Norman Dunbar wrote:

 
 I've written a small demo program to show the things that happen when an
 application sub-window is hit in a PE program. The program has a window
 containing a single application sub-window.
 
 The hit routine does nothing more than this:
 
 ahit0   movem.l d1/d3/d5-d7/a0/a4,-(a7) ; Save the workers
moveq #0,d1   ; D1.W = Application sub window number
moveq #0,d2   ; D2.W = Ink colour
 ;   A4 already set to Working definition
jsr wm_swapp(a2)  ; Set channel id (A0) to the subwindow
 
movem.l a1-a2,-(a7)   ; A1 gets corrupted
lea hit,a1; Text string to print
move.w ut_mtext,a2; Print string vector
jsr (a2)  ; Print the message
 
lea hitter,a1 ; Hit counter location
move.w (a1),d1; Hit counter value
addq.w #1,d1  ; Increment counter
move.w d1,(a1); Save counter
move.w ut_mint,a2 ; Print integer vector
jsr (a2)  ; Print it
 
movem.l (a7)+,a1-a2   ; Restore
 
movem.l (a7)+,d1/d3/d5-d7/a0/a4 ; Restore the workers
moveq #0,d0   ; No errors
rts
 
 ; Strings and things go here
 
 hitter  dc.w 0; How many times have I been hit?
 
 hit dc.w hit_e-hit-2  ; Hit message
dc.b 'HIT: '
 hit_e   equ *
 
 Now, when run I notice the following foibles:
 
 1. The hit code is called when the pointer enters the sub-window, and
 each time it moves within the sub-window.
 
 2. Pressing the TAB key, which activates the sub-window, the counter
 increases by TWO and not one.
 
 3. Pressing the F1 key also increases the count by two.
 
 4. Other keys, I have not tested everything, increment the counter by one.
 
 There are no menus or anything in the sub-window, it is used simply as a
 display area by the program, aub-window menus come in a later article!
 

The hit routine is called by PE in many cases. For example the manual says If 
there is no keystroke, or the keystroke is not the selection keystroke for a 
loose menu item or an application sub-window, then, if the pointer is within a 
sub-window, the hit routine is called, or else the loose menu item list is 
searched to find a new current item. F1 causes an event and so will cause the 
hit routine to be called.

 Another question, I only have a single sub-window. If I comment out the
 call to WM_SWAPP in the hit routine, I still see my output in the
 sub-window, but it is not cleared before hand. (I can live with this)
 but when I was writing PE stuff using SuperBasic and EasyPTR 3, I always
 had to set the channel to the sub-window (or info window or whatever)
 before I could write to it.
 

Commenting out WM_SWAPP is not a good idea. When I tried this program, or 
something very like it, HIT appeared in the main window. However, accessing the 
application window by a selection key caused HIT to appear in the application 
window. Obviously, the PE redefines the window area depending on where it finds 
the pointer.

 So, My further queries are:
 
 1. Do I need to call WM_SWAPP if I only have one sub-window or can I
 assume that the channel id always refers to the sub-window regardless
 unless I explicitly set it to a loose item or whatever?
 

You have to use WM_SWAPP

 2. If I have two or more sub-windows, does the channel id, by default,
 point at the first - I haven't tested this yet - If I don't call WM_SWAPP?
 

No


George
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] WMAN queries

2011-01-21 Thread gdgqler

On 21 Jan 2011, at 12:58, Norman Dunbar wrote:

 
 Commenting out WM_SWAPP is not a good idea. When I tried this program, or 
 something very like it, HIT appeared in the main window. However, accessing 
 the application window by a selection key caused HIT to appear in the 
 application window. Obviously, the PE redefines the window area depending on 
 where it finds the pointer.
 Well, in my example, if the pointer is outside of the sub-window,
 nothing happens to call the HIT code regardless. It's only a HIT when
 the pointer is within the sub-window area, or I press TAB to activate
 the sub-window.

In my window definition I set A to select the application window. So, 
pressing A when the pointer is outside the application window first sets the 
focus to the application window and then the hit routine is called.

George
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


[Ql-Users] OT - Proposed cut to BT broadband charges in rural areas

2011-01-21 Thread Malcolm Cadman

Hi,

This will be of interest to some of you in the UK, in rural areas ... 
including the most rural Wales.


From ZN News:

Ofcom proposes BT wholesale rural price cuts
  BT should cut its wholesale costs by between 10 and 14 percent in 
rural areas, where there is no wholesale broadband competition, 
according to the regulator

  http://nl.zdnet.co.uk/matBcBDaic/ihBhH

--
Malcolm Cadman
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


[Ql-Users] Programming project request...

2011-01-21 Thread Plastic
Hi all.

So, I recently had a head injury that gave me some concentration and short
term memory problems. From my past experience with this type of injury in
1994, I know the best therapy is to work my brain, stretch it, make demands.

I have use of a QL software emulator. It can emulate the basic QL with many
memory configurations, QDOS, Minerva, etc, and save/load to disk.

So.

The exercise I have given myself is to write some SuperBASIC software that
benefits the community. On completion, the code would be released free for
all.

I was only an average programmer in my heyday and have an idea what my
limitations where then, and am sure they're less now. For this reason, I am
putting some artificial limits on what I do.

It could be anything - a game, utility, whatever. However, it can't rely on
special hardware. It should be able to run on a 640K QL. It would be in
SuperBASIC, not assembly, but as an option (if I can find the Lightning I
have in a box SOMEWHERE) it could be compiled. So TCP/IP based apps are
out... for now. No pointers (I don't have one.)

I'm open to games or simulations that don't require advanced math...

So far I have considered:

An Air Traffic Control game/simulator (depending on realism achieved.)
A graphical tower defense game - but not really a desire to develop some
game toolkit or learn a complicated one - something meeting 80s standards,
not today's!
Blocks games. Many ideas to choose from. Not so convinced on this.
Board games? Meh?
Trading game/stocks/... simulation?
An election/govt game? (Like the BBC GB Ltd. game, but more playabe?)
A fantasy sport league game?
A catalog/library app? (for books, dvds, etc?)

I'm quite taken by doing a QL version of Plants vs Zombies.

I also have a to do list. I am rereading my original QL manual - don't have
the Care TK2 manual any more so need to go find a copy of that. Also, need
to check out this Minerva thing. I've always stuck to JS roms and tk2. I'm
not a big POKE/PEEKer so OS differences don't affect me so much.

What I'd like from the list is ideas within or outside this list to give me
something to work on. The brain took a good thump and it truly isn't working
so well - it feels like I have a permanent stinking head cold.

*So, ideas/suggestions/discussion would help me, and may act as a bunch of
ideas for others interested in doing something similar in the future...
*
Ok. I went and took a look, and my Lightning is on microdrive. Is there a pd
or shareware compiler anyone would recommend, depending on how the
conversation develops, that can work on an emulator?

Dave
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] Programming project request...

2011-01-21 Thread Rich Mellor

On 22/01/2011 06:03, Plastic wrote:

Hi all.

So, I recently had a head injury that gave me some concentration and short
term memory problems. From my past experience with this type of injury in
1994, I know the best therapy is to work my brain, stretch it, make demands.

I have use of a QL software emulator. It can emulate the basic QL with many
memory configurations, QDOS, Minerva, etc, and save/load to disk.

So.

The exercise I have given myself is to write some SuperBASIC software that
benefits the community. On completion, the code would be released free for
all.

I was only an average programmer in my heyday and have an idea what my
limitations where then, and am sure they're less now. For this reason, I am
putting some artificial limits on what I do.

It could be anything - a game, utility, whatever. However, it can't rely on
special hardware. It should be able to run on a 640K QL. It would be in
SuperBASIC, not assembly, but as an option (if I can find the Lightning I
have in a box SOMEWHERE) it could be compiled. So TCP/IP based apps are
out... for now. No pointers (I don't have one.)

I'm open to games or simulations that don't require advanced math...

So far I have considered:

An Air Traffic Control game/simulator (depending on realism achieved.)
A graphical tower defense game - but not really a desire to develop some
game toolkit or learn a complicated one - something meeting 80s standards,
not today's!
Blocks games. Many ideas to choose from. Not so convinced on this.
Board games? Meh?
Trading game/stocks/... simulation?
An election/govt game? (Like the BBC GB Ltd. game, but more playabe?)
A fantasy sport league game?
A catalog/library app? (for books, dvds, etc?)

I'm quite taken by doing a QL version of Plants vs Zombies.

I also have a to do list. I am rereading my original QL manual - don't have
the Care TK2 manual any more so need to go find a copy of that. Also, need
to check out this Minerva thing. I've always stuck to JS roms and tk2. I'm
not a big POKE/PEEKer so OS differences don't affect me so much.

What I'd like from the list is ideas within or outside this list to give me
something to work on. The brain took a good thump and it truly isn't working
so well - it feels like I have a permanent stinking head cold.

*So, ideas/suggestions/discussion would help me, and may act as a bunch of
ideas for others interested in doing something similar in the future...
*
Ok. I went and took a look, and my Lightning is on microdrive. Is there a pd
or shareware compiler anyone would recommend, depending on how the
conversation develops, that can work on an emulator?

Dave
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm



Good morning Dave,

It would also be a good idea for you to post this on the QL Forum (where 
there are more new users than on this list) - see

www.qlforum.co.uk

Manuals - see the QL homepage for replacement manuals which can be 
downloaded - http://www.dilwyn.me.uk/docs/manuals/index.html


As for a SuperBASIC compiler...
Lightning is a utility which increase the speed of graphics and text 
routines in any program which uses the standard QDOS routines, it is not 
a SuperBASIC compiler.


You can purchase Q-Liberator which is a good all round compiler, but not 
highly optimised for speed.


Otherwise there is the public domain Turbo compiler which includes a 
massive toolkit and can produce much faster code than Q-Liberator, so it 
is better for games.  The downside with Turbo is that it does not cope 
well with sloppy programming, so you need to concentrate on structured 
programming (procedures, functions, FOR... END FOR (not simply FOR.. 
NEXT) etc.


Turbo can be obtained from http://www.dilwyn.me.uk/turbo/index.html

--
Rich Mellor
RWAP Services

http://www.rwapsoftware.co.uk
http://www.rwapservices.co.uk

-- Try out our new site: http://sellmyretro.com


___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] Programming project request...

2011-01-21 Thread Timothy Swenson

Dave,

The Turbo compiler (and Turbo Toolkit) are now freeware and available, 
and can be found on this page:


http://www.dilwyn.me.uk/turbo/index.html

You'll also find a large number of programming tools at the main index 
for Dilywn's side:


http://www.dilwyn.me.uk/downloads.html

You can find TK2 and the Pointer Environment there too.

Tim Swenson
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] Programming project request...

2011-01-21 Thread Plastic
On Sat, Jan 22, 2011 at 12:23 AM, Rich Mellor r...@rwapservices.co.ukwrote:

 On 22/01/2011 06:03, Plastic wrote:

 As for a SuperBASIC compiler...

 Lightning is a utility which increase the speed of graphics and text
 routines in any program which uses the standard QDOS routines, it is not a
 SuperBASIC compiler.


See, that's what I have to deal with. As soon as I'm told that I remember it
very clearly. Lightning was this really need tool that transformed my QL by
replacing the commonly used display routines (which were as general purpose
as possible and slow) with custom, up to 30x faster specific routines.  I
know that! But I didn't until you said it.

This kind of thing happens to me a few times every day right now.

I have the Turbo Toolkit - but that is also on microdrive. Timothy Swenson's
email addresses that.

Good links all... Following, reading and printing. Can't scribble pencil
notes in the margin of a PDF.

Dave
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm