• MacTech Network:
  • Tech Support
  • |
  • MacForge.net
  • |
  • Apple News
  • |
  • Register Domains
  • |
  • SSL Certificates
  • |
  • iPod Deals
  • |
  • Mac Deals
  • |
  • Mac Book Shelf

MAC TECH

  • Home
  • Magazine
    • About MacTech in Print
    • Issue Table of Contents
    • Subscribe
    • Risk Free Sample
    • Back Issues
    • MacTech DVD
  • Archives
    • MacTech Print Archives
    • MacMod
    • MacTutor
    • FrameWorks
    • develop
  • Forums
  • News
    • MacTech News
    • MacTech Blog
    • MacTech Reviews and KoolTools
    • Whitepapers, Screencasts, Videos and Books
    • News Scanner
    • Rumors Scanner
    • Documentation Scanner
    • Submit News or PR
    • MacTech News List
  • Store
  • Apple Expo
    • by Category
    • by Company
    • by Product
  • Job Board
  • Editorial
    • Submit News or PR
    • Writer's Kit
    • Editorial Staff
    • Editorial Calendar
  • Advertising
    • Benefits of MacTech
    • Mechanicals and Submission
    • Dates and Deadlines
    • Submit Apple Expo Entry
  • User
    • Register for Ongoing Raffles
    • Register new user
    • Edit User Settings
    • Logout
  • Contact
    • Customer Service
    • Webmaster Feedback
    • Submit News or PR
    • Suggest an article
  • Connect Tools
    • MacTech Live Podcast
    • RSS Feeds
    • Twitter

ADVERTISEMENT
Volume Number:12
Issue Number:8
Column Tag:Tips & Tidbits

Tips & Tidbits

By Steve Sisak

CodeWarrior Target Switch

Here’s an easy way (in CodeWarrior) to build a project file for another target if you have been working on one target already (i.e., working on a 68K project, and now it’s time to make a PPC project).

Even though I create apps for both 68K and PPC, I always just work in a 68K project file, since I have a 68K Mac at home to work on.

When it comes time to make a PPC binary for testing, or just to see if the thing will compile with a PPC compiler, I’ll go to the Finder and duplicate (Command-D) my 68K project file, and then rename the copy to something like “MyProject (PPC)”.

Open the new project up, reset all the project prefs to a PPC target, set other prefs as needed, remove the 68K libraries, and add in the PPC libraries (and you might need to update the precompiled header files, unless you use something like a Prefix.h file that conditionally adds in the right precompiled header based upon the target).

Voilà! It’s a pretty simple thing that saves you lots of time in recreating project files for multiple targets.

John Daub

The Origin of the GWorld

Sometimes, images drawn into offscreen GWorlds for a translucent drag don’t draw properly if the GWorld’s portRect starts at any location other than (0,0). This can result in items being clipped improperly, or not being drawn at all.

This problem only occurs when the user has multiple monitors hooked up.

Translucent drags will work fine if you create the GWorld for the drag image at location (0, 0).

Jeremy Vineyard

But How About Free Overnight Shipping?

If you’d like to learn more tricks on optimizing PowerPC assembly language code, call IBM and order the 240-page PowerPC Compiler Writer’s Guide. They’ll charge you $1 (yes, one dollar) and you have to pay with a credit card (at this price you should order four or five for friends and family). The phone number is (800) 879-2755 (IBM’s Manuals & Publications). The book is ISBN 0-9649654-0-2 and IBM part number MPRPPCOMP-01.

Here’s an example from their Optimal Code Sequences chapter. The C code is calculating the absolute value of v0:

absoluteValue = (signed_word) v0 < 0 ? -v0 : v0;

The optimal instructions (which are nice to the pipeline, no branches) are:

srawi     R4, R3, 31  // v0 is in R3 on entry
add       R5, R4, R3
xor       R6, R5, R4

There are about 40 other short sequences like this one given in the book, as well as discussions on instruction scheduling, alignment, etc. Well worth the price!

Mike Scanlin

 
MacTech Only Search:
Community Search:

 
 
 

 
 
 
 
 
  • SPREAD THE WORD:
  • Slashdot
  • Digg
  • Del.icio.us
  • Reddit
  • Newsvine
  • Generate a short URL for this page:



MacTech Magazine. www.mactech.com
Toll Free 877-MACTECH, Outside US/Canada: 805-494-9797
MacTech is a registered trademark of Xplain Corporation. Xplain, "The journal of Apple technology", Apple Expo, Explain It, MacDev, MacDev-1, THINK Reference, NetProfessional, Apple Expo, MacTech Central, MacTech Domains, MacNews, MacForge, and the MacTutorMan are trademarks or service marks of Xplain Corporation. Sprocket is a registered trademark of eSprocket Corporation. Other trademarks and copyrights appearing in this printing or software remain the property of their respective holders.
All contents are Copyright 1984-2010 by Xplain Corporation. All rights reserved. Theme designed by Icreon.
 
Nov. 20: Take Control of Syncing Data in Sow Leopard' released
Nov. 19: Cocktail 4.5 (Leopard Edition) released
Nov. 19: macProVideo offers new Cubase tutorials
Nov. 18: S Stardom anounces Safe Capsule, a companion piece for Apple's
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live