TweetFollow Us on Twitter

Oct 91 Mousehole
Volume Number:7
Issue Number:10
Column Tag:Mousehole Report

A/UX and Monitors

By Larry Nedry, Mousehole BBS

From: Grinch

Re: Help Manager Resources

Hello, I have a question...

I’ve read IM6’s chapters on using the Help Manager to add Balloon Help to my application icon and menus. It gives examples of the resources to compile but, silly me, I haven’t figured out how to make SARez do this.

SARez retches when I give it these examples. Is there a header of some sort I have to add to define the new resource formats? Is it in IM6? I also note that there doesn’t seem to be any coverage of the correct resource type for movable modal dialogs either.

I’d appreciate a few words of direction on how to get this done.

From: Atom

Re: Help Manager Resources

Yes, there is a header file for balloon resources. In MPW 3.2 it’s called “BalloonTypes.r” (naturally enough!) If you’re using Think C or Pascal as I’m surmising, you might want to ask Symantec tech support about getting the latest headers. There are many new header files for System 7, and (at least in MPW) a few minor changes in some of the old ones. Also, movable modal dialogs don’t have a special resource type; they’re just an ordinary window with a new window definition ID (like plainDBox, documentProc, etc.) I don’t recall the value or exact name of this constant right off, but it’s in IM V6, I think in the Compatibility Guidelines chapter. In any case it’s in the latest headers. Hope this helps.

From: Craigb

Re: Detecting A/UX?

I am writing a program, that when A/UX is present, will (hopefully) communicate will a deamon running in A/UX. So, my two questions are : 1) How do you detect A/UX is running? I know that can be done, but how? 2) How does one communicate to and from A/UX to Mac OS? I am writing my program in Think C.... for what it’s worth...

From: Mrteague

Re: Detecting A/UX?

You can detect that you are running under A/UX by using Gestalt with the selector ‘a/ux’ - if it isn’t running, you will get a gestaltUnknownErr (otherwise you will get the A/UX version # in the lower word of the response parameter). If you really must muck about in low memory globals and don’t have Gestalt, then you need to look at the Hardware Configuration Flags at $0B22 - I don’t know which bit is set offhand, but one of the bits set means A/UX is running. By the way, with MPW 3.2 and later, Gestalt glue is provided that allows you to use Gestalt on any machine with any version of the System (otherwise Gestalt is only available in System 6.0.4 or later, or in ROM on the Mac IIci and later).

Anyway, given that, how do you mean “communicate” with a dameon? If you are running a Macintosh application under A/UX, then you are running in a virtual machine, which is basically MultiFinder (System 6.0.5 for A/UX 2.0, and System 6.0.7 for A/UX 2.01), and it is just another UN*X process, in it’s own protected memory space, so you can’t do any dirty tricks by poking around in memory, because you will get a privilege violation. If you write a standard UN*X program (COFF format), you will be able to use all the standard UN*X libraries etc - but then it won’t be a Mac application. It is possible to sort of “merge” the 2 worlds, but I don’t know enough about that to tell you.

I suggest if you are serious about writing applications for A/UX, that you get all the necessary tools and documentation - you won’t be able to do it without it. I assume if you have A/UX, you have all the documentation that comes with A/UX for programming under A/UX. From the Mac side, you should get Inside Mac Volume VI (the latest for System 7.0), and of course all the earlier ones. Specific to THINK C - you will want to make sure you have the latest version of THINK C (4.05?), as earlier versions are not 32 bit clean (the latest isn’t entirely either, but it will do), and you certainly might have problems creating code that will run under A/UX, and you certainly couldn’t actually run THINK C itself under A/UX, unless you are willing to live with the limitations of the 24-bit memory model under A/UX.

I have written a number of Macintosh applications that run fine under A/UX, and adapt to A/UX specific features (such as filenames use "/" as the delimiter, not ":" as on the Mac OS etc). If you can tell us more about what you are trying to achieve, we may be able to help you further, or tell you that it will be a waste of time.

Hope this helps.

From: Mikel

Re: Detecting A/UX?

Here’s a code snippet from one of Apple’s sample programs:

{1}

  dummy:=SysEnvirons(1,theWorld);
  WNEIsImplemented:=((theWorld.machineType>=0) AND
    (NGetTrapAddress(_WaitNextEvent,ToolTrap)<>
     NGetTrapAddress(_Unimplemented,ToolTrap)));
  flagPtr := PtrToWord(kHWCfgFlags);
  haveAUX := BAnd(flagPtr^,$0200) <> 0;

Hope this helps.

From: Rodman

Re: Blocking switch under MultiFinder

Another way would be to set the high bit in the spareflag of the window record when you wish the window to become modal. You’ll find this a little easier.

From: Salmon

Re: Blocking switch under MultiFinder

You can stop MultiFinder from switching by changing the windowKind field of the window record to 2 before calling WaitNextEvent. This will prevent switching. I have on occasion managed to kill the Finder but I’m still not sure how. (You can’t get it back, but you can keep working).

From: Aikidoka

Re: Blocking switch under MultiFinder

Thanks to everyone for their help on my MultiFinder switch problem. We were working on some interactive multi-media displays using MacroMind’s Director. While running under MultiFinder, a person could click in the upper right corner, and the thing would switch to the Finder, or whatever other program we might have had running in the background. Not what we wanted. Changing the windowKind field caused Director to bomb. What we wound up doing is running Director under System 7.0. It doesn’t switch under System 7.0.

From: Cxer

Re: MaxAppleZoom Patch

The following patches can be made with ResEdit to bypass the time bomb:

For MAZ 1.3:

in INIT 1, change 65AE at offset 578 to 4E71

in INIT 1, change 65AE at offset 5D4 t 4E71

in cdev -4064, change 6AE at offset C4E to 4E71

in cdev -4064, change 65B0at offset CD6 to 4E71

For MAZ 1.31:

in INIT 1, change 65AE at offset 576 to 4E71

in INIT 1, change 6AE at offset 5D2 to 4E71

in cdev -4064, chage 65AE at offset C4C to 4E71

in cdev -4064, change 6B0 at offset CD4 to 4E71

These patches were developed by Bob Boonstra (jrb@mbunix.mitre.org) who comments that he has numerous comments that they work and none to the contrary. Matthew Russotto (russotto@eng.umd.edu) has since discovered why the patch works: the code being bypassed is an obfuscated way of accessing the low-memory global Time ($20C). The code also contains deliberate attempts to prevent use of a debugger during the time bomb check.

From: Walrus

Re: Think Reference 1.0

I just wanted to plug a product I just got today, Symantec’s Think Reference.

Many of you probably got the mailer sent out by Symantec. It is not just an Inside Mac DA, it’s an application (run in 256K) that has a pretty good hypertext Mac Toolbox reference. Obviously, if you are a Mac wizard, you probably don’t need it, for all you others....

From: Walrus

Re: Think Reference 1.0

Think Reference does some explaining about the trap calls, their inputs and outputs as well as providing a ‘Copy Template’ (you can specify a C or Pascal template). Since this is not an Addison-Wesley product, they were not really able to put IM directly into the database, they basically paraphrase it -- which is great, that’s why I bought Macintosh Revealed. And for that reason I haven’t yet gotten rid of IM DA.

If I remember correctly, the Programmer’s Online Companion was basically just the call and did no explanation of what it was for. The Think Reference does that and it has a lot of information about Mac structures and the other details that I always have to dig into Inside Mac for.

One point should be noted. It does not include IM VI (except for Gestalt information). That’s okay, I need to build my biceps.

From: Salmon

Re: Error in Vital Signs MT 7/91

On page 28 of the July issue of MacTutor, the author of the Vital Signs DA states that the definition of StringPtr in the Think C headers is wrong. This is WRONG. The definition of StringPtr in the headers is correct. His definition is most definitly WRONG. He states

   typedef Str255 *StringPtr

However, Str255 in ThinkC is defined as

/* 2 */

  typedef unsigned char Str255[256]

This declares Str255 to be a pointer to an array of char.

Therefore the suggested typedef would declare StringPtr to be a pointer to a pointer to an array of char, which is wrong.

A more serious issue. The code given on p. 36 has a bug. The declaration of diskname as

StringPtr diskname; should be Str255 diskname.

Then when diskname is passed to PBHGVInfo, there will be storage declared. As it is now, an uninitialized pointer is passed to PBHGetVInfo. If the pointer happens to be NULL, nothing happens. If the pointer happens to contain an address where data or code resides...

Boom.

From: Jimm

Re: Multiple monitors/move window

I have a multiple monitor setup with a 2 page monochrome (1 bit) and a 13" 8 bit monitor. When a window is created with GetNewWindow from a resource on the 1 bit monitor and then moved to the 8 bit monitor, CopyBits’ed images (from 8 bit offscreen grafports) are displayed in full color. Direct drawing calls, however, are all in Olive green and white. Examination of the pixmap record of the cGrafPort associated with the window shows the pixelsize to be 1. What’s the deal? If it is a one bit deep map, why do the pixmaps transfer in full color? Do I have to destroy the CGrafPort associated with my window and recreate it when the window changes screens? When the window is created on the 8 bit screen (when I move the menu bar there with the monitors CDEV) everything works flawlessly. Any ideas?

From: Jimm

Re: Multiple monitors/move window

Adding to the previous question, when I create the window on the 8 bit screen using NewCWindow, the pixmap^^pixsize is still 1. It doesn’t matter where I create the screen or where I move it to, the pixmap always claims to be 1 bit deep. When a window is created on an 8 bit screen, why does the window manager create a one bit deep pixmap?

From: Rodman

Re: Multiple monitors/move window

Do you have a window color table associated with the window? If not, I would suggest starting there.

From: Jimm

Re: Multiple monitors/move window

Well it appears that when you open a window, it always sticks you with the pixmap of the main screen. When you draw out of the pixmap, it looks around and says ‘hey maybe there’s another screen out there and I should draw on it instead.’ Consequently, you cannot get the screen depth from the pixmap associated with your CGrafPort. I was banging my head against the wall forever because I was trying to activate the palette of my window while the control panel (used to change screen depth) was still the front window. Once I waited until my window was frontmost, my problems disappeared.

From: Rguerra

Re: Monitor Depths

Thanks for the reply. I’m actually interested in what depth modes a particular monitor is CAPABLE of displaying. This info should be available from the Slot Manager. The CURRENT depth is, as you point out, readily available. Has anyone figured out exactly how to get that info from the Slot manager in order to deal with systems that don’t have HasDepth implemented?

From: Arlen

Re: Monitor Depths

Why is the Slot Manager necessary? I’ve always used the GetGDevice call from Color Quickdraw. This returns a handle to a graphic device (GDHandle). The Graphic Device data structure (IM V-129) contains a PixMapHandle called gdPMap. This handle refers to a pixel map data structure (IM V-52) which contains an integer pixelSize, which holds the current depth of the monitor. Am I missing something?

From: Mikel

Re: MPW C Profilers

Has anyone heard of any profilers for MPW C? I know THINK C has a header, but I am an MPW kind of guy. I thought I read about such a beast once, but I’m blanking now. Something similar to Jon Bentley’s “More Programming Pearls” profiler would be pretty nice.

As an aside, anyone know what Apple’s Advanced Development folks are using the gcc compiler for? Portable operating systems? Hmmm.

From: Mrteague

Re: MPW C Profilers

I guess the closest thing to what you want, is the Performance Tools for MPW - consists of a library, interface files for Pascal and C, sample files, a MPW Tool called PerformReport, and the ROM Map files required for performance reporting. I have used it a little bit with Pascal, but not with C, so I can’t help you there. Basically, you need to add some code to your application to turn on profiling etc - you specify such things as the sampling size etc. Then you build your application with the library linked in, and create a LinkMap. Then run your application and exercise it appropriately, and quit. Then you concatenate the LinkMap and the appropriate ROMMap and run the PerformReport tool. It has been helpful to me in some situations. Hope this helps.

From: Mikel

Re: MPW C Profilers

Thanks for your reply. I did find the PerfTools and built the sample programs that were included. I never did get the PerfDisplay working correctly though, as the main segment procedures were mapped to segment 127, and the linker never generated a segment #127. Anyway, it’s pretty much what I was looking for.

From: Macneil

Re: New User

I too am curious as to the “rules”, usually they are shouted out at one. Here we are left to depend on our own consciences?

From: Sysop

Re: New User

I like to keep it simple. No upload/download ratios. If you have something you want to share please upload it. If you see something you want then download it (except for the MacTutor sources. $5.00 each). This is a BBS where Mac programmers can exchange ideas.

Have fun,

sysop

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Tokkun Studio unveils alpha trailer for...
We are back on the MMORPG news train, and this time it comes from the sort of international developers Tokkun Studio. They are based in France and Japan, so it counts. Anyway, semantics aside, they have released an alpha trailer for the upcoming... | Read more »
Win a host of exclusive in-game Honor of...
To celebrate its latest Jujutsu Kaisen crossover event, Honor of Kings is offering a bounty of login and achievement rewards kicking off the holiday season early. [Read more] | Read more »
Miraibo GO comes out swinging hard as it...
Having just launched what feels like yesterday, Dreamcube Studio is wasting no time adding events to their open-world survival Miraibo GO. Abyssal Souls arrives relatively in time for the spooky season and brings with it horrifying new partners to... | Read more »
Ditch the heavy binders and high price t...
As fun as the real-world equivalent and the very old Game Boy version are, the Pokemon Trading Card games have historically been received poorly on mobile. It is a very strange and confusing trend, but one that The Pokemon Company is determined to... | Read more »
Peace amongst mobile gamers is now shatt...
Some of the crazy folk tales from gaming have undoubtedly come from the EVE universe. Stories of spying, betrayal, and epic battles have entered history, and now the franchise expands as CCP Games launches EVE Galaxy Conquest, a free-to-play 4x... | Read more »
Lord of Nazarick, the turn-based RPG bas...
Crunchyroll and A PLUS JAPAN have just confirmed that Lord of Nazarick, their turn-based RPG based on the popular OVERLORD anime, is now available for iOS and Android. Starting today at 2PM CET, fans can download the game from Google Play and the... | Read more »
Digital Extremes' recent Devstream...
If you are anything like me you are impatiently waiting for Warframe: 1999 whilst simultaneously cursing the fact Excalibur Prime is permanently Vault locked. To keep us fed during our wait, Digital Extremes hosted a Double Devstream to dish out a... | Read more »
The Frozen Canvas adds a splash of colou...
It is time to grab your gloves and layer up, as Torchlight: Infinite is diving into the frozen tundra in its sixth season. The Frozen Canvas is a colourful new update that brings a stylish flair to the Netherrealm and puts creativity in the... | Read more »
Back When AOL WAS the Internet – The Tou...
In Episode 606 of The TouchArcade Show we kick things off talking about my plans for this weekend, which has resulted in this week’s show being a bit shorter than normal. We also go over some more updates on our Patreon situation, which has been... | Read more »
Creative Assembly's latest mobile p...
The Total War series has been slowly trickling onto mobile, which is a fantastic thing because most, if not all, of them are incredibly great fun. Creative Assembly's latest to get the Feral Interactive treatment into portable form is Total War:... | Read more »

Price Scanner via MacPrices.net

Early Black Friday Deal: Apple’s newly upgrad...
Amazon has Apple 13″ MacBook Airs with M2 CPUs and 16GB of RAM on early Black Friday sale for $200 off MSRP, only $799. Their prices are the lowest currently available for these newly upgraded 13″ M2... Read more
13-inch 8GB M2 MacBook Airs for $749, $250 of...
Best Buy has Apple 13″ MacBook Airs with M2 CPUs and 8GB of RAM in stock and on sale on their online store for $250 off MSRP. Prices start at $749. Their prices are the lowest currently available for... Read more
Amazon is offering an early Black Friday $100...
Amazon is offering early Black Friday discounts on Apple’s new 2024 WiFi iPad minis ranging up to $100 off MSRP, each with free shipping. These are the lowest prices available for new minis anywhere... Read more
Price Drop! Clearance 14-inch M3 MacBook Pros...
Best Buy is offering a $500 discount on clearance 14″ M3 MacBook Pros on their online store this week with prices available starting at only $1099. Prices valid for online orders only, in-store... Read more
Apple AirPods Pro with USB-C on early Black F...
A couple of Apple retailers are offering $70 (28%) discounts on Apple’s AirPods Pro with USB-C (and hearing aid capabilities) this weekend. These are early AirPods Black Friday discounts if you’re... Read more
Price drop! 13-inch M3 MacBook Airs now avail...
With yesterday’s across-the-board MacBook Air upgrade to 16GB of RAM standard, Apple has dropped prices on clearance 13″ 8GB M3 MacBook Airs, Certified Refurbished, to a new low starting at only $829... Read more
Price drop! Apple 15-inch M3 MacBook Airs now...
With yesterday’s release of 15-inch M3 MacBook Airs with 16GB of RAM standard, Apple has dropped prices on clearance Certified Refurbished 15″ 8GB M3 MacBook Airs to a new low starting at only $999.... Read more
Apple has clearance 15-inch M2 MacBook Airs a...
Apple has clearance, Certified Refurbished, 15″ M2 MacBook Airs now available starting at $929 and ranging up to $410 off original MSRP. These are the cheapest 15″ MacBook Airs for sale today at... Read more
Apple drops prices on 13-inch M2 MacBook Airs...
Apple has dropped prices on 13″ M2 MacBook Airs to a new low of only $749 in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, now available for $679 for 8-Core CPU/7-Core GPU/256GB models. Apple’s one-year warranty is included, shipping is free, and each... Read more

Jobs Board

Seasonal Cashier - *Apple* Blossom Mall - J...
Seasonal Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Seasonal Fine Jewelry Commission Associate -...
…Fine Jewelry Commission Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) Read more
Seasonal Operations Associate - *Apple* Blo...
Seasonal Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Read more
Hair Stylist - *Apple* Blossom Mall - JCPen...
Hair Stylist - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.