AminetAminet
Search:
84512 packages online
About
Recent
Browse
Search
Upload
Setup
Services

dev/src/Window.lha

Mirror:Random
Showing:m68k-amigaosppc-amigaosppc-morphosi386-arosi386-amithlonppc-warpupppc-powerupgeneric
No screenshot available
Short:Attach CON: to existing window (Kick 1.x)
Author:Tim King and Andy Finkel of Commodore-Amiga Inc.
Uploader:markk clara co uk
Type:dev/src
Architecture:m68k-amigaos
Source:Fish disk 38 (originally posted to net.micro.amiga)
Date:2012-02-05
Download:http://aminet.net/dev/src/Window.lha - View contents
Readme:http://aminet.net/dev/src/Window.readme
Downloads:1146

C and assembly language source code to "attach" a CON: handler to an existing
window, possibly on a custom screen. This technique only works under Kickstart
1.x. Metacomco's ABasiC, supplied with version 1.0 of the Amiga OS, uses the
same code.

Despite having released this example and ABasiC using it, Commodore removed
support for this technique in Kickstart 2.0 (V36). Under V36 and later there
is a new way to achieve the same result: Open("CON://///WINDOW0xwindaddr")
where windaddr is the address of your Window structure in ASCII hexadecimal.
RAW: can be used instead of CON:.

It is quite simple to conditionally use the old or new method if your program
needs to run on any Kickstart version. My patch to ABasiC allowing it to work
on later Kickstarts does that (see dev/basic/ABasiC_patch.lha on Aminet).
Conditional example code can be found in the second edition of The Amiga Guru
Book by Ralph Babel.


This archive contains a fixed window executable. It seems the original one on
Fish disk 38 was broken, perhaps due to a linker bug? Thanks to Toni Wilen for
pointing that out. For completeness the original broken executable is still
present, named window_orig_broken.

The fixed executable is confirmed to work under Kickstart 1.3. It executes the
Format command to format the disk in DF1:. If you don't have a second floppy
drive you may see the custom screen and window open then immediately close.


-- Mark


Excerpted from the POSTER file in the archive:
---
Article 5072 of net.micro.amiga:
From: andy at cbmvax.cbm.UUCP (Andy Finkel)
Newsgroups: net.micro.amiga
Subject: Creating a DOS Window in a Custom Screen
Message-ID: <901 at cbmvax.cbmvax.cbm.UUCP>
Date: 15 Oct 86 17:04:17 GMT
Organization: Commodore Technology, West Chester, PA

Tricks with AmigaDOS, part II.

As you may recall, part one was all about finding the window pointer and
console.device IO Request Block from a DOS window.  Part II is about how
to go the other way: make an Intuition window into a DOS window.  

Specifically, this is used to get a DOS window to open in a custom
screen. There are reasons why this is something you might want to do...
like, oh, using the Execute command to initialize a new disk in a program
that doesn't use the Workbench screen.

We all knew it was possible...remember the first ABasic ? (by MetaCompCo)


For those of you writing shells...under V1.2 the ability to switch a
window in or out of RAW mode via an AmigaDOS packet can be used to
good advantage when combined with this.


There are 3 files:  window.c which contains most of the program, console.asm
which contains the assembler interface calls to the BCPL routines of 
AmigaDOS, and window.i, the include file I use when I am doing tricks
like this.

Break up the file into its component parts, compile, assemble, and link.

Two warning...under the pressure of 1.2 I've only compiled it under the
Greenhills C cross compiler running on the Sun...so some slight changes
may be needed for other compilers.  I'm only linking with the amiga.lib 
on this one.

The other warning...to finish this quickly (as some people need it now)
I used 3 of the BCPL global routines.  (Sorry).  Actually, I
only had to use 2 (finddevice and loaddevice) but as long as I
was doing it, I went ahead and used the DOS sendpacket).  Assembler versions
of those functions are possible (I think, sigh).

Anyway, another completed chapter in the mysteries of AmigaDos.

				andy finkel
				Commodore-Amiga
---


Contents of dev/src/Window.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[generic]                 1906    3698  51.5% -lh5- de24 Feb  5  1980 Window.readme
[generic]                  728    1557  46.8% -lh5- 71e5 Oct 20  1986 Window/console.asm
[generic]                 1397    2647  52.8% -lh5- 22b8 Oct 20  1986 Window/POSTER
[generic]                 1586    2612  60.7% -lh5- ddb9 Feb  5  1980 Window/window
[generic]                 1411    3383  41.7% -lh5- 5dcd Oct 20  1986 Window/window.c
[generic]                  401    1018  39.4% -lh5- b249 Oct 20  1986 Window/window.i
[generic]                 1588    2612  60.8% -lh5- 7b83 Oct 20  1986 Window/window_orig_broken
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total         7 files    9017   17527  51.4%            Feb  5 20:57

Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>