exxos blog - random goings on

Blogs & guides and tales of woo by forum members.
User avatar
exxos
Site Admin
Site Admin
Posts: 24083
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: exxos blog - random goings on

Post by exxos »

This is quickly turning into a small nightmare again :roll:

Even if I close the main GB7 window and only trigger events on the new window, which is a different ID and handle, the previous window routines are still somehow triggering which does not make sense.So I think trying to open two windows even if there is only one open at a time it is going to involve another total rewrite of the GB7 core. But as I don't know what is wrong in the first place...

Really I should reuse the main GB7 window. But the problem is there is that the redraw routines are geared up to draw the results etc. so displaying another bunch of information would then put even more clauses into what to do and what not to draw in the window :roll:

EDIT:

So the AES window handle goes wonky in all this which is why is running the previous drawing routines. The main window handle is normally "3" an additional window is normally "4". however when you close the main window "3". The handle for the now window open also becomes "3". The only way to stop the handles some changing is to keep the window open.. Which then screws up the AES three drawing routines.. So damned if do and damned if don't all the time :roll:
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
exxos
Site Admin
Site Admin
Posts: 24083
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: exxos blog - random goings on

Post by exxos »

So what I can gather currently is the main GB7 window content is not updating correctly and the actual content is ending up on the second window :shrug:

I don't really see how that can happen because I have separate AES handles for both Windows.I even recheck the handles and the new one is opened in case they have changed. I don't get it.





I suppose the cheating way is to just redraw the whole window and force it to be on top when the redraw happens.

Obviously I cannot redraw the whole window when it is a background window otherwise it will overwrite the window contents which is on top.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
stephen_usher
Posts: 5875
Joined: Mon Nov 13, 2017 7:19 pm
Location: Oxford, UK.
Contact:

Re: exxos blog - random goings on

Post by stephen_usher »

Surely you need to detach the drawing routines from the window handle before closing the window?

Remember that GEM is a first generation (and very rudimentary) WIMP system and it doesn't do a lot for you underneath. You have to manually clean up before closing windows. This also explains why if you close a window with a low handle number and then open a new window it will reuse that low numbered handle as it will just do a simple search for the first free handle in the list.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
User avatar
exxos
Site Admin
Site Admin
Posts: 24083
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: exxos blog - random goings on

Post by exxos »

It seems the AES simply didn't process the event at all. So no redraw messages *** . In which case making the window on top and full redraw might be the only way.

*** I output a dump of events to a file. It does actually trigger MOVE event, that works, and 1 REDRAW event, but not sure what its actually redrawing.

Capture.PNG
Capture.PNG (161.41 KiB) Viewed 2258 times
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
exxos
Site Admin
Site Admin
Posts: 24083
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: exxos blog - random goings on

Post by exxos »

OH it does send a redraw event, but only the overlapping section :WTF:

1.PNG
1.PNG (69.2 KiB) Viewed 2254 times
2.PNG
2.PNG (71.14 KiB) Viewed 2254 times
3.PNG
3.PNG (70.54 KiB) Viewed 2254 times
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
exxos
Site Admin
Site Admin
Posts: 24083
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: exxos blog - random goings on

Post by exxos »

I did a event dump of the window move below.

Capture.PNG
Capture.PNG (87.74 KiB) Viewed 2248 times

Code: Select all

 
 EVENT		AES	     X	           Y	 	 W             H
 30            3             0             0             0             0 
 28            3             376           142           628           332 
 20            3             219           141           281           305 
 20            4             216           123           160           327 
 20            4             376           123           120           19 
 30            4             0             0             0             0 
30 = WM_UNTOPPED
28 = WM_MOVED
20 = WM_REDRAW

3 = main window
4 = new window

Will draw a black square on every event next to see what its actually doing...
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
exxos
Site Admin
Site Admin
Posts: 24083
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: exxos blog - random goings on

Post by exxos »

Code: Select all

 28            3             375           132           628           332 
 20            3             219           141           281           305 
 20            4             216           123           159           327 
 20            4             375           123           121           9 
So it draws a black square on the new window.. makes no sense as the GB6 window is BEHIND the new window anyway. But that could be just the order things are happening in my debug code..

1.PNG
1.PNG (65.45 KiB) Viewed 2243 times

Next same black square over the GB7 main window...okay I guess..

2.PNG
2.PNG (96.52 KiB) Viewed 2243 times

Then a redraw which is almost right, but still nothing in the big gap on the GB7 main window.

3.PNG
3.PNG (82.69 KiB) Viewed 2243 times

So it seems impossible to redraw a background window... but it does work when only the main GB7 window is open, in respect to desktop windows that is. :crazy:
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
HigashiJun
Posts: 1286
Joined: Fri Jun 19, 2020 7:21 am
Location: Tokyo

Re: exxos blog - random goings on

Post by HigashiJun »

It reminds me of a movie called "The NeverEnding story"...

:lol:

The film score was nice, though.

https://www.youtube.com/watch?v=2WN0T-Ee3q4

Cheers.
User avatar
exxos
Site Admin
Site Admin
Posts: 24083
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: exxos blog - random goings on

Post by exxos »

HigashiJun wrote: Wed Jan 04, 2023 9:11 am It reminds me of a movie called "The NeverEnding story"...
Was on of my favorite films when I was a kid :)
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
Badwolf
Posts: 2290
Joined: Tue Nov 19, 2019 12:09 pm

Re: exxos blog - random goings on

Post by Badwolf »

I don't know if this will help at all, @exxos?

This was a little test window program I wrote a while back. Should be compilable with Pure C (there's a PRJ file in there).

All it does it display a single window, so you need desk accessories or a multitasking environment to get the best out of it, but it draws some text and some background fill and everytime it draws a new background rectangle it changes the colour index so you can see what it's done. It doesn't do anythign clever, IIRC. I think it just redraws the whole window with clipping enabled.

In effect, it's explaining the dirty rectangle list visually.

Perhaps disable the text rendering would help further?

Anyway, YMMV, but here you go.

Screenshot_2023-01-04_10-49-09.png
Screenshot_2023-01-04_10-49-09.png (33.17 KiB) Viewed 2252 times

BW

PS: this is probably the most pertinent function

Code: Select all

void redraw_window( int handle, GRECT *dirty ) {
        int wx, wy, ww, wh;
        int pxy[4];
        int clip[4];
        int i;
        GRECT r;        
        
        graf_mouse( M_OFF, 0L );
        

        wind_update( BEG_UPDATE );
        
        wind_set( handle, WF_VSLSIZE, vslidersz, 0,0,0 );
        
        i = 0;
        wind_get( handle, WF_FIRSTXYWH, &r.g_x, &r.g_y, &r.g_w, &r.g_h );
        while( r.g_w > 0 && r.g_h > 0 ) {
                if( rc_intersect( dirty, &r ) ) {
                        set_clip( TRUE, r );
                        draw_window_content( handle );                  
                        set_clip( FALSE, r );
                }
                wind_get( handle, WF_NEXTXYWH, &r.g_x, &r.g_y, &r.g_w, &r.g_h );
        }
        
        wind_update( END_UPDATE );
        graf_mouse( M_ON, 0L );
        
}
Attachments
window.zip
(9.03 KiB) Downloaded 21 times
DFB1 Open source 50MHz 030 and TT-RAM accelerator for the Falcon
DSTB1 Open source 16Mhz 68k and AltRAM accelerator for the ST
Smalliermouse ST-optimised USB mouse adapter based on SmallyMouse2
FrontBench The Frontier: Elite 2 intro as a benchmark
Post Reply

Return to “MEMBER BLOGS”