4th update to my Carbon support file. (to be renamed and replace main-crb.c in angband/Macintosh) --- Changes from the 3rd revision * Eliminated the "quit without saving" menu and CodeWarrior-dependent code hooked into that. * Fixed keypad encoding bug -- Gileba pointed out its presence in his(her?) port of 2.9.2 Mac PPC/68K in the upload notice, but it remained. * Fixed cannot-type-backslash/vertical-bar-in-the-Japanese-keyboard bug. It has keycode of 93 there, which is unused in US/European key layouts. --- Based on V2.9.2/2.9.3 main-mac.c Original authors: Ben Harrison, Keith Randall, Maarten Hazewinkel, Steve Linberg and Peter Ammon. Modified by pelpel (kazuo@sta.att.ne.jp) Motivation ---------- A couple of existing Carbon support files fail to update display in some cases (most notably spell effects) on OS X, since the system buffers all drawings and flushes them when WaitNextEvent() is called. The other non-trivial problem was busy no-wait loop within Term_inkey, regardless of the wait parameter. This can also be said of existing main-mac.c, by the way. I noticed this when my machine became unusually hot while I played Angband. Other changes ------------- There was a big GWorld buffer allocated, unused, and freed upon exit This applies to main-mac.c as well. SetupAppDir now uses Process Manager, which I believe is more reliable and efficient. Since launching takes some time on OS X, window animation is introduced to make that a bit more bearable. Some API calls are updated to modern ones, but I can't remember which. Still wondering whether never_bored should be set to TRUE or not -- It isn't set now. How to use ---------- Unfortunately, this file only works with CodeWarrior and possibly with MPW. Port to OS X's free development environment certainly needs more work, because *so* many things have been changed there. You can use the resource file that comes with the ext-mac archive on the Angband FTP server, with these two additions: - plst 0 : can be empty, although Apple recommends us to fill it in. - STR# 128 : something like "Please select your lib folder" Build instruction is nearly identical to the Mac + CodeWarrior one found at Thangorodrim (http://thangorodrim.angband.org), with these modifications applied to your project file: - replace main-mac.c in the project with this file (in the link order tab) - remove InterfaceLib and MathLib - add CarbonLib (found in Carbon SDK or CW's UniversalInterfaces) -- if you choose to use the USE_CF_PREFERENCES code, you'll need Carbon SDK 1.1 or greater - replace MSL C.PPC.Lib with MSL C.Carbon.Lib (both found in MSL:MSL_C:MSL_MacOS:Lib:PPC) - leave MSL RuntimePPC.Lib as it is - don't forget to update resource file, as described above - as in Classic targets, you may have to include and . The most convinient place for them is the first #ifdef MACINTOSH in h-system.h - if you are compiling a variant, check variant dependent ifdef's explained in the source code, and add appropriate ones in your A-mac-h.pch. // pelpel