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

Fallout Shelter pulls in ten times its u...
When the Fallout TV series was announced I, like I assume many others, assumed it was going to be an utter pile of garbage. Well, as we now know that couldn't be further from the truth. It was a smash hit, and this success has of course given the... | Read more »
Recruit two powerful-sounding students t...
I am a fan of anime, and I hear about a lot that comes through, but one that escaped my attention until now is A Certain Scientific Railgun T, and that name is very enticing. If it's new to you too, then players of Blue Archive can get a hands-on... | Read more »
Top Hat Studios unveils a new gameplay t...
There are a lot of big games coming that you might be excited about, but one of those I am most interested in is Athenian Rhapsody because it looks delightfully silly. The developers behind this project, the rather fancy-sounding Top Hat Studios,... | Read more »
Bound through time on the hunt for sneak...
Have you ever sat down and wondered what would happen if Dr Who and Sherlock Holmes went on an adventure? Well, besides probably being the best mash-up of English fiction, you'd get the Hidden Through Time series, and now Rogueside has announced... | Read more »
The secrets of Penacony might soon come...
Version 2.2 of Honkai: Star Rail is on the horizon and brings the culmination of the Penacony adventure after quite the escalation in the latest story quests. To help you through this new expansion is the introduction of two powerful new... | Read more »
The Legend of Heroes: Trails of Cold Ste...
I adore game series that have connecting lore and stories, which of course means the Legend of Heroes is very dear to me, Trails lore has been building for two decades. Excitedly, the next stage is upon us as Userjoy has announced the upcoming... | Read more »
Go from lowly lizard to wicked Wyvern in...
Do you like questing, and do you like dragons? If not then boy is this not the announcement for you, as Loongcheer Game has unveiled Quest Dragon: Idle Mobile Game. Yes, it is amazing Square Enix hasn’t sued them for copyright infringement, but... | Read more »
Aether Gazer unveils Chapter 16 of its m...
After a bit of maintenance, Aether Gazer has released Chapter 16 of its main storyline, titled Night Parade of the Beasts. This big update brings a new character, a special outfit, some special limited-time events, and, of course, an engaging... | Read more »
Challenge those pesky wyverns to a dance...
After recently having you do battle against your foes by wildly flailing Hello Kitty and friends at them, GungHo Online has whipped out another surprising collaboration for Puzzle & Dragons. It is now time to beat your opponents by cha-cha... | Read more »
Pack a magnifying glass and practice you...
Somehow it has already been a year since Torchlight: Infinite launched, and XD Games is celebrating by blending in what sounds like a truly fantastic new update. Fans of Cthulhu rejoice, as Whispering Mist brings some horror elements, and tests... | Read more »

Price Scanner via MacPrices.net

Sunday Sale: Take $150 off every 15-inch M3 M...
Amazon is now offering a $150 discount on every configuration and color of Apple’s M3-powered 15″ MacBook Airs. Prices start at $1149 for models with 8GB of RAM and 256GB of storage: – 15″ M3 MacBook... Read more
Apple’s 24-inch M3 iMacs are on sale for $150...
Amazon is offering a $150 discount on Apple’s new M3-powered 24″ iMacs. Prices start at $1149 for models with 8GB of RAM and 256GB of storage: – 24″ M3 iMac/8-core GPU/8GB/256GB: $1149.99, $150 off... Read more
Verizon has Apple AirPods on sale this weeken...
Verizon has Apple AirPods on sale for up to 31% off MSRP on their online store this weekend. Their prices are the lowest price available for AirPods from any Apple retailer. Verizon service is not... Read more
Apple has 15-inch M2 MacBook Airs available s...
Apple has clearance, Certified Refurbished, 15″ M2 MacBook Airs available starting at $1019 and ranging up to $300 off original MSRP. These are the cheapest 15″ MacBook Airs for sale today at Apple.... Read more
May 2024 Apple Education discounts on MacBook...
If you’re a student, teacher, or staff member at any educational institution, you can use your .edu email address when ordering at Apple Education to take up to $300 off the purchase of a new MacBook... Read more
Clearance 16-inch M2 Pro MacBook Pros in stoc...
Apple has clearance 16″ M2 Pro MacBook Pros available in their Certified Refurbished store starting at $2049 and ranging up to $450 off original MSRP. Each model features a new outer case, shipping... Read more
Save $300 at Apple on 14-inch M3 MacBook Pros...
Apple has 14″ M3 MacBook Pros with 16GB of RAM, Certified Refurbished, available for $270-$300 off MSRP. Each model features a new outer case, shipping is free, and an Apple 1-year warranty is... Read more
Apple continues to offer 14-inch M3 MacBook P...
Apple has 14″ M3 MacBook Pros, Certified Refurbished, available starting at only $1359 and ranging up to $270 off MSRP. Each model features a new outer case, shipping is free, and an Apple 1-year... Read more
Apple AirPods Pro with USB-C return to all-ti...
Amazon has Apple’s AirPods Pro with USB-C in stock and on sale for $179.99 including free shipping. Their price is $70 (28%) off MSRP, and it’s currently the lowest price available for new AirPods... Read more
Apple Magic Keyboards for iPads are on sale f...
Amazon has Apple Magic Keyboards for iPads on sale today for up to $70 off MSRP, shipping included: – Magic Keyboard for 10th-generation Apple iPad: $199, save $50 – Magic Keyboard for 11″ iPad Pro/... Read more

Jobs Board

Liquor Stock Clerk - S. *Apple* St. - Idaho...
Liquor Stock Clerk - S. Apple St. Boise Posting Begin Date: 2023/10/10 Posting End Date: 2024/10/14 Category: Retail Sub Category: Customer Service Work Type: Part Read more
*Apple* App Developer - Datrose (United Stat...
…year experiencein programming and have computer knowledge with SWIFT. Job Responsibilites: Apple App Developer is expected to support essential tasks for the RxASL 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
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
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.