Thread View: comp.sys.amiga.tech
2 messages
2 total messages
Started by Ron Tarrant
Tue, 25 Dec 1990 22:05
Re: Pointer Initialization
Author: Ron Tarrant
Date: Tue, 25 Dec 1990 22:05
Date: Tue, 25 Dec 1990 22:05
33 lines
1418 bytes
1418 bytes
> kzyx@vax5.cit.cornell.edu writes:
>
> Msg-ID: <1990Dec24.152533.1770@vax5.cit.cornell.edu>
> Posted: 24 Dec 90 19:25:33 GMT
>
>
> Hello there,
>
> What is the correct way to initialize a structure pointer to access
> the hardware under ANSI (Aztec C 5.0d)
>
> Edval
It's not a good idea to access the hardware directly. It means you have to
update your code every time there is system software and makes it harder (if
I'm not mistaken) to go from one Amiga model to another.
> kzyx@vax5.cit.cornell.edu writes:
>
> struct myblitterstruct *myblitterpointer;
>
This initializes your structure pointer. If you already have a structure of
this type defined, that is. If you also have an actual
structure of this type declared, then make your pointer point to it like this:
myblitterstruct = &OriginalBlitterStruct
But when you point your pointer at something in the hardware you're asking for
trouble. In fact, I'm not sure it can even be done.
-Ron
Re: Pointer Initialization
Author: Dave Love
Date: Thu, 27 Dec 1990 17:14
Date: Thu, 27 Dec 1990 17:14
48 lines
2197 bytes
2197 bytes
In article <4241@mindlink.UUCP> a976@mindlink.UUCP (Ron Tarrant) writes: >> kzyx@vax5.cit.cornell.edu writes: >> What is the correct way to initialize a structure pointer to access >> the hardware under ANSI (Aztec C 5.0d) >> > >It's not a good idea to access the hardware directly. It means you have to >update your code every time there is system software and makes it harder (if >I'm not mistaken) to go from one Amiga model to another. > Agreed. >> struct myblitterstruct *myblitterpointer; >> > >This initializes your structure pointer. If you already have a structure of >this type defined, that is. If you also have an actual >structure of this type declared, then make your pointer point to it like this: > > myblitterstruct = &OriginalBlitterStruct > >But when you point your pointer at something in the hardware you're asking for >trouble. In fact, I'm not sure it can even be done. >-Ron To get to the hardware you need something like the following line (assuming you want myblitterpointer to point to the actual blitter registers): struct myblitterstruct *myblitterpointer = (struct myblitterstruct *)(0x00000000L); where 0x00000000 is replaced by the appropriate hardware address (Sorry, I don't have my RKM's handy so I can't give the correct address). DISCLAIMER: Using techniques similar to this in production code will probably result in the end of the world as we know it. :) However, going straight to the hardware was, for me, the best way to learn about the blitter. Once I was comfortable with what the blitter did (and why), it was fairly simple to find "approved" ways to use it. -- Dave Love UUCP: dcl@ncsc1.att.com CI$: 75126,2223 bix: dlove -- "MS-DOS... The ultimate PC virus." --
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads