TweetFollow Us on Twitter

Summer 91 - Apple II Q& A

Apple II Q& A

Apple II DEVELOPER TECHNICAL SUPPORT

Q Our Apple IIGS® TextEdit field created with NewControl2 appears to be redrawn within the TESetText call, but Apple II GS Toolbox Reference Volume 3 says controls won't be redrawn until the next update event. Is this a mistake in the documentation or in our logic?

A Internally, TextEdit uses control records for all TextEdit records. The main difference between control and noncontrol records is that the control defproc handles many of the standard TextEdit functions without requiring your application to do so. In the case of TESetText, though, TextEdit will always redraw the entire viewRect. This is a mistake in the manual.

Q We want to load $BC files from a folder when our program is launched. How do we ask the Apple II GS System Loader to discard these loaded files at application shutdown time? We tried using the main program's master ID from the Memory Manager, but the files are still not unloaded.

A The Loader is not designed to support more than one program with one user ID. It assumes that InitialLoad or InitialLoad2 will be called with distinct user IDs for each "program" to be controlled individually.

You need to get new user IDs (probably $1000 type) for each module you load, so that you can call UserShutDown on each of them individually when you need to. Don't dispose of the memory at the end; call UserShutDown on each of the IDs and the Loader will take care of the rest. If you're not quitting, you might want to shut them down in zombie state so that they don't have to be reloaded from disk if the memory is available. You can just pass $1000 as the user ID to InitialLoad and it will get a new ID for you and return it on the stack.

Remember that $BC auxiliary types are reserved and must be assigned by Apple Developer Technical Support.

Q How can I turn off the GS/OS file system cache, or keep it from writing to a disk while my file system optimizer is running?

A Altering volumes at the block level will confuse GS/OS ® , because the ProDOS® File System Translator (FST) keeps copies of file system structures that aren't in the cache. You need to use DWrite, although using DWrite instead of WRITE_BLOCK risks destroying the integrity of any open files on disk, such as the system resource file. If you use WRITE_BLOCK, you must close any open files, including the system resource file if you optimize the boot disk.

Once you start optimizing, don't make any calls that could directly or indirectly result in operating system calls--no DA access, no Font Manager calls, no loading tools, nothing. When you're done, GS/OS's internal volume control records (VCRs) will be completely invalid and you'll have to call OSShutDown.

Q When is it OK to make Apple II GS system service calls? I'd like to make calls such as MOVE_INFO from a driver that's executing asynchronously.

A It's OK to make system service calls in response to a GS/OS request, for example. Most of them require the OS environment, such as GS/OS's direct page, but MOVE_INFO, SET_SYS_SPEED, DYN_SLOT_ARBITER, and SIGNAL do not. When you're not in the GS/OS environment, make sure the proper language card bank of bank 1 is swapped in. Just JSLing there will put you into something that's not a system service call. You can either use the bank $E1 equivalents of MOVE_INFO, SET_SYS_SPEED, and DYN_SLOT_ARBITER, or you can make sure that the right $01 language card bank is enabled:

    short
    lda >$E0C068
    pha
    lda >$E0C08B
    lda >$E0C08B
    longmx
; Set up the registers and make your
; JSL  My_Favorite_SysSrv_Call
    short
    lda >$E0C083
    lda >$E0C083
    pla
    sta >$E0C068
    longmx

Q Do I have to write extra program code for my Apple II GS program to grow a resource?

A No, it's pretty straightforward. All you have to do to modify the content of any resource (including growing it) is to load the resource in, make any changes you want to the handle (such as change the data inside or call SetHandleSize to make it bigger), and then call MarkResourceChange. The Resource Manager updates the contents of your file when you call UpdateResourceFile. The Resource Manager recognizes the change in the size of the handle automatically.

Q The Apple IIGS does not seem to sort out equivalent devices on the Apple Desktop Bus TM (ADB) as the Macintosh does and as outlined in the ADB specification. We want multiple keyboard support, but the Apple IIGS ADB micro just begins reading blindly from addresses 2 and 3, assuming one keyboard and one mouse are attached. Is this information correct?

A The Apple IIGS does not do the same kind of dynamic device mapping and remapping that the Macintosh ADB Manager does. The "Apple Desktop Bus Tool Set" chapter of the Apple IIGS Toolbox Reference gives instructions on how to remap devices dynamically yourself. Essentially, you have two options:

  • You can leave the second keyboard address as 2, allowing input from multiple keyboards, but the keyboards' modifier key input will be mixed.
  • You can dynamically remap the keyboards in your program or in an INIT (although some forms of remapping require the user to press a key on the device to be remapped) and then a second keyboard will not appear as the standard keyboard--requiring all who use it to do their own ADB requests to get at the information entered from a second keyboard.

If you don't expect many developers to use a second keyboard, you might just choose to remap it inside any program that uses it. You could write an external library or functions that remap a second keyboard and read from it.

Q Where can I find documentation on how to recognize SCSI partitions, such as MS DOS partitions, from GS/OS?

A The documents you'll need are the GS/OS Reference (Addison-Wesley) and the GS/OS Device Driver Reference (APDA). You can recognize SCSI hard disk partitions programmatically by looking for a SCSI Hard Drive device type ($0005) and a forwardLink or headLink that's nonzero. This will give you all SCSI hard disk partitions, but it won't give you non-SCSI partitions, which have a different device type.

Bit 13 of the Device Characteristics word is for "Linked devices" like partitions, but the GS/OS Device Driver Reference says that bit applies to removable media, so not all third-party GS/OS drivers may set that bit for partitions (even though Apple's SCSI hard disk driver does).

Remember that GS/OS requires each partition to appear as a separate device, so there's no support for multiple partitions on one logical device.


Kudos to our readers who care enough to ask us terrific and well thought-out questions. The answers are supplied by our teams of technical gurus; our thanks to all. Special thanks to Matt Deatherage, C. K. Haun, Jim Luther, and Jim Mensch for the material in this Q & A column. *

Have more questions? Need more answers? Take a look at the Dev Tech Answers library on AppleLink (updated weekly) or at the Q & A stack on the Developer Essentials disc. *

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Whitethorn Games combines two completely...
If you have ever gone fishing then you know that it is a lesson in patience, sitting around waiting for a bite that may never come. Well, that's because you have been doing it wrong, since as Whitehorn Games now demonstrates in new release Skate... | Read more »
Call of Duty Warzone is a Waiting Simula...
It's always fun when a splashy multiplayer game comes to mobile because they are few and far between, so I was excited to see the notification about Call of Duty: Warzone Mobile (finally) launching last week and wanted to try it out. As someone who... | Read more »
Albion Online introduces some massive ne...
Sandbox Interactive has announced an upcoming update to its flagship MMORPG Albion Online, containing massive updates to its existing guild Vs guild systems. Someone clearly rewatched the Helms Deep battle in Lord of the Rings and spent the next... | Read more »
Chucklefish announces launch date of the...
Chucklefish, the indie London-based team we probably all know from developing Terraria or their stint publishing Stardew Valley, has revealed the mobile release date for roguelike deck-builder Wildfrost. Developed by Gaziter and Deadpan Games, the... | Read more »
Netmarble opens pre-registration for act...
It has been close to three years since Netmarble announced they would be adapting the smash series Solo Leveling into a video game, and at last, they have announced the opening of pre-orders for Solo Leveling: Arise. [Read more] | Read more »
PUBG Mobile celebrates sixth anniversary...
For the past six years, PUBG Mobile has been one of the most popular shooters you can play in the palm of your hand, and Krafton is celebrating this milestone and many years of ups by teaming up with hit music man JVKE to create a special song for... | Read more »
ASTRA: Knights of Veda refuse to pump th...
In perhaps the most recent example of being incredibly eager, ASTRA: Knights of Veda has dropped its second collaboration with South Korean boyband Seventeen, named so as it consists of exactly thirteen members and a video collaboration with Lee... | Read more »
Collect all your cats and caterpillars a...
If you are growing tired of trying to build a town with your phone by using it as a tiny, ineffectual shover then fear no longer, as Independent Arts Software has announced the upcoming release of Construction Simulator 4, from the critically... | Read more »
Backbone complete its lineup of 2nd Gene...
With all the ports of big AAA games that have been coming to mobile, it is becoming more convenient than ever to own a good controller, and to help with this Backbone has announced the completion of their 2nd generation product lineup with their... | Read more »
Zenless Zone Zero opens entries for its...
miHoYo, aka HoYoverse, has become such a big name in mobile gaming that it's hard to believe that arguably their flagship title, Genshin Impact, is only three and a half years old. Now, they continue the road to the next title in their world, with... | Read more »

Price Scanner via MacPrices.net

B&H has Apple’s 13-inch M2 MacBook Airs o...
B&H Photo has 13″ MacBook Airs with M2 CPUs and 256GB of storage in stock and on sale for up to $150 off Apple’s new MSRP, starting at only $849. Free 1-2 day delivery is available to most US... Read more
M2 Mac minis on sale for $100-$200 off MSRP,...
B&H Photo has Apple’s M2-powered Mac minis back in stock and on sale today for $100-$200 off MSRP. Free 1-2 day shipping is available for most US addresses: – Mac mini M2/256GB SSD: $499, save $... Read more
Mac Studios with M2 Max and M2 Ultra CPUs on...
B&H Photo has standard-configuration Mac Studios with Apple’s M2 Max & Ultra CPUs in stock today and on Easter sale for $200 off MSRP. Their prices are the lowest available for these models... Read more
Deal Alert! B&H Photo has Apple’s 14-inch...
B&H Photo has new Gray and Black 14″ M3, M3 Pro, and M3 Max MacBook Pros on sale for $200-$300 off MSRP, starting at only $1399. B&H offers free 1-2 day delivery to most US addresses: – 14″ 8... Read more
Department Of Justice Sets Sights On Apple In...
NEWS – The ball has finally dropped on the big Apple. The ball (metaphorically speaking) — an antitrust lawsuit filed in the U.S. on March 21 by the Department of Justice (DOJ) — came down following... Read more
New 13-inch M3 MacBook Air on sale for $999,...
Amazon has Apple’s new 13″ M3 MacBook Air on sale for $100 off MSRP for the first time, now just $999 shipped. Shipping is free: – 13″ MacBook Air (8GB RAM/256GB SSD/Space Gray): $999 $100 off MSRP... Read more
Amazon has Apple’s 9th-generation WiFi iPads...
Amazon has Apple’s 9th generation 10.2″ WiFi iPads on sale for $80-$100 off MSRP, starting only $249. Their prices are the lowest available for new iPads anywhere: – 10″ 64GB WiFi iPad (Space Gray or... Read more
Discounted 14-inch M3 MacBook Pros with 16GB...
Apple retailer Expercom has 14″ MacBook Pros with M3 CPUs and 16GB of standard memory discounted by up to $120 off Apple’s MSRP: – 14″ M3 MacBook Pro (16GB RAM/256GB SSD): $1691.06 $108 off MSRP – 14... Read more
Clearance 15-inch M2 MacBook Airs on sale for...
B&H Photo has Apple’s 15″ MacBook Airs with M2 CPUs (8GB RAM/256GB SSD) in stock today and on clearance sale for $999 in all four colors. Free 1-2 delivery is available to most US addresses.... Read more
Clearance 13-inch M1 MacBook Airs drop to onl...
B&H has Apple’s base 13″ M1 MacBook Air (Space Gray, Silver, & Gold) in stock and on clearance sale today for $300 off MSRP, only $699. Free 1-2 day shipping is available to most addresses in... Read more

Jobs Board

Medical Assistant - Surgical Oncology- *Apple...
Medical Assistant - Surgical Oncology- Apple Hill Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple 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
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Business Analyst | *Apple* Pay - Banco Popu...
Business Analyst | Apple PayApply now " Apply now + Apply Now + Start applying with LinkedIn Start + Please wait Date:Mar 19, 2024 Location: San Juan-Cupey, PR Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.