/* Copyright (c) Michael Hamel, 1991 */
/* NetHack may be freely redistributed. See license for details. */
-#ifdef applec /* This needs to be resident always */
+#if defined(macintosh) && defined(__SC__) && !defined(__FAR_CODE__)
+/* this needs to be resident always */
#pragma segment Main
#endif
#include <TextUtils.h>
#include <Resources.h>
+
+void error(const char *format,...)
+{
+ Str255 buf;
+ va_list ap;
+
+ va_start(ap, format);
+ vsprintf((char *)buf, format, ap);
+ va_end(ap);
+
+ C2P((char *)buf, buf);
+ ParamText(buf, (StringPtr)"", (StringPtr)"", (StringPtr)"");
+ Alert(128, (ModalFilterUPP) NULL);
+ ExitToShell();
+}
+
+
+#if 0 /* Remainder of file is obsolete and will be removed */
+
#define stackDepth 1
#define errAlertID 129
#define stdIOErrID 1999
itemHit = Alert(errAlertID, (ModalFilterUPP)nil);
}
-
Boolean itworked(short errcode)
/* Return TRUE if it worked, do an error message and return false if it didn't. Error
strings for native C errors are in STR#1999, Mac errs in STR 2000-errcode, e.g
showerror("of an internal error",line);
}
+
void attemptingto(char * activity)
/* Say what we are trying to do for subsequent error-handling: will appear as x in an
alert in the form "Could not x because y" */
{ C2P(activity,gActivities[gTopactivity]);
}
-#if 0 /* Apparently unused */
void comment(char *s, long n)
{
Str255 paserr;
if (gTopactivity > 1) --gTopactivity;
else error("activity stack underflow");
}
-#endif /* Apparently unused */
+
+#endif /* Obsolete */
OpenHandleFile (const unsigned char *name, long fileType)
{
int i;
- OSErr err;
Handle h;
Str255 s;
if (theHandleFiles[i].data == 0L) break;
}
- if (i >= MAX_HF) {
- error("Ran out of HandleFiles");
+ if (i >= MAX_HF)
return -1;
- }
h = GetNamedResource (fileType, name);
- err = ResError();
- if (err == resNotFound) return -1; /* Don't complain, this might be normal */
- if (!itworked(err)) return -1;
+ if (!h) return (-1);
theHandleFiles[i].data = h;
theHandleFiles[i].size = GetHandleSize (h);
CloseHandleFile (int fd)
{
if (!IsHandleFile (fd)) {
- error("CloseHandleFile: isn't a handle");
return -1;
}
fd -= FIRST_HF;
long amt = len;
if (IsHandleFile (fd)) {
-
return ReadHandleFile (fd, ptr, amt);
} else {
-
short err = FSRead (fd, &amt, ptr);
- if (err == eofErr && len) {
-
- return amt;
- }
- if (itworked (err)) {
-
- return (amt);
- } else {
-
- return -1;
- }
+ return ((err == noErr) || (err == eofErr && len)) ? amt : -1;
}
}
+
#if 0 /* this function isn't used, if you use it, uncomment prototype in macwin.h */
char *
macgets (int fd, char *ptr, unsigned len)
long amt = len;
if (IsHandleFile (fd)) return -1;
-
- if (itworked(FSWrite (fd, &amt, ptr))) return(amt);
- else return(-1);
+ if (FSWrite(fd, &amt, ptr) == noErr)
+ return (amt);
+ else
+ return (-1);
}
break;
}
- if (itworked(SetFPos (fd, posMode, where)) && itworked(GetFPos (fd, &curPos)))
- return(curPos);
-
- return(-1);
+ if (SetFPos(fd, posMode, where) == noErr && GetFPos(fd, &curPos) == noErr)
+ return (curPos);
+ else
+ return(-1);
}
+
/* ---------------------------------------------------------------------- */
boolean rsrc_dlb_init(void) {
#include <OSUtils.h>
#include <files.h>
#include <Types.h>
-#ifdef MAC_MPW32
-#include <String.h>
-#include <Strings.h>
-#endif
#include <Dialogs.h>
#include <Packages.h>
#include <ToolUtils.h>
#include <Resources.h>
-#ifdef applec
-#include <SysEqu.h>
-#endif
#include <Errors.h>
#ifndef O_RDONLY
#include <fcntl.h>
#endif
-static void
-finder_file_request(void);
+static void finder_file_request(void);
+int main(void);
+
+#if __SC__ || __MRC__
+QDGlobals qd;
+#endif
-int NDECL(main);
int
main (void)
/* Enable or disable the appropriate item */
- GetDItem(wind, item, &type, &handle, &rect);
+ GetDialogItem(wind, item, &type, &handle, &rect);
if (enable) type &= ~itemDisable;
else type |= itemDisable;
HiliteControl((ControlHandle)handle, enable ? 0 : 255);
- SetDItem(wind, item, type, handle, &rect);
+ SetDialogItem(wind, item, type, handle, &rect);
return;
}
/* Which item shall we redraw? */
- GetDItem(wind, item, &type, &handle, &rect);
+ GetDialogItem(wind, item, &type, &handle, &rect);
switch (item) {
case RSRC_ASK_DEFAULT:
PenSize(3, 3);
/* Initialize the name text item */
ask_restring(plname, str);
if (plname[0]) {
- GetDItem(askdialog, RSRC_ASK_NAME, &type, &handle, &rect);
- SetIText(handle, str);
+ GetDialogItem(askdialog, RSRC_ASK_NAME, &type, &handle, &rect);
+ SetDialogItemText(handle, str);
}
#if 0
{
}
}
if (pName [0]) {
- GetDItem(askdialog, RSRC_ASK_NAME, &type, &handle, &rect);
- SetIText(handle, pName);
+ GetDialogItem(askdialog, RSRC_ASK_NAME, &type, &handle, &rect);
+ SetDialogItemText(handle, pName);
if (pName [0] > 2 && pName [pName [0] - 1] == '-') {
short role = (*pANR).anMenu[anRole];
char suffix = (char) pName[pName[0]],
}
}
#endif
- SelIText(askdialog, RSRC_ASK_NAME, 0, 32767);
+ SelectDialogItemText(askdialog, RSRC_ASK_NAME, 0, 32767);
/* Initialize the role popup menu */
if (!(askmenu[RSRC_ASK_ROLE] = NewMenu(RSRC_ASK_ROLE, "\p")))
/* Set the redraw procedures */
for (item = RSRC_ASK_DEFAULT; item <= RSRC_ASK_MODE; item++) {
- GetDItem(askdialog, item, &type, &handle, &rect);
- SetDItem(askdialog, item, type, (Handle)redraw, &rect);
+ GetDialogItem(askdialog, item, &type, &handle, &rect);
+ SetDialogItem(askdialog, item, type, (Handle)redraw, &rect);
}
/* Handle dialog events */
if (!races[++j].noun) j = 0;
} while (i != j);
if (currrace != i) {
- GetDItem(askdialog, RSRC_ASK_RACE, &type, &handle, &rect);
+ GetDialogItem(askdialog, RSRC_ASK_RACE, &type, &handle, &rect);
InvalRect(&rect);
}
if (++j >= ROLE_GENDERS) j = 0;
} while (i != j);
if (currgend != i) {
- GetDItem(askdialog, RSRC_ASK_GEND, &type, &handle, &rect);
+ GetDialogItem(askdialog, RSRC_ASK_GEND, &type, &handle, &rect);
InvalRect(&rect);
}
if (++j >= ROLE_ALIGNS) j = 0;
} while (i != j);
if (curralign != i) {
- GetDItem(askdialog, RSRC_ASK_ALIGN, &type, &handle, &rect);
+ GetDialogItem(askdialog, RSRC_ASK_ALIGN, &type, &handle, &rect);
InvalRect(&rect);
}
for (i = 0; roles[i].name.m; i++) {
ask_restring((currgend && roles[i].name.f) ?
roles[i].name.f : roles[i].name.m, str);
- SetItem(askmenu[RSRC_ASK_ROLE], i+1, str);
+ SetMenuItemText(askmenu[RSRC_ASK_ROLE], i+1, str);
CheckItem(askmenu[RSRC_ASK_ROLE], i+1, currrole == i);
}
case RSRC_ASK_ALIGN:
case RSRC_ASK_GEND:
case RSRC_ASK_MODE:
- GetDItem(askdialog, item, &type, &handle, &rect);
+ GetDialogItem(askdialog, item, &type, &handle, &rect);
pt = *(Point *)▭
LocalToGlobal(&pt);
if (!!(i = PopUpMenuSelect(askmenu[item], pt.v, pt.h,
} while ((item != RSRC_ASK_PLAY) && (item != RSRC_ASK_QUIT));
/* Process the name */
- GetDItem(askdialog, RSRC_ASK_NAME, &type, &handle, &rect);
- GetIText(handle, str);
+ GetDialogItem(askdialog, RSRC_ASK_NAME, &type, &handle, &rect);
+ GetDialogItemText(handle, str);
if (str[0] > PL_NSIZ-1) str[0] = PL_NSIZ-1;
BlockMove(&str[1], plname, str[0]);
plname[str[0]] = '\0';
ParamText("\pReally Quit?", "\p", "\p", "\p");
itemHit = Alert(alrtMenu_NY, (ModalFilterUPP) 0L);
- ResetAlrtStage();
+ ResetAlertStage();
if (itemHit != bttnMenuAlertYes) {
doQuit = 0;
/*
* Set up the synth
*/
- if (itworked (SndNewChannel (&theChannel, sampledSynth, initMono +
- initNoInterp, (void *) 0))) {
-
+ if (SndNewChannel(&theChannel, sampledSynth, initMono +
+ initNoInterp, (void *) 0) == noErr) {
char midi_note [] = {57, 59, 60, 62, 64, 65, 67};
short err;
}
SndDisposeChannel (theChannel, false); /* Sync wait for completion */
ReleaseResource (theSound);
-
- mustwork (err);
}
}
-/* SCCS Id: @(#)mactopl.c 3.1 91/07/23
+/* SCCS Id: @(#)mactopl.c 3.1 91/07/23 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
#include "hack.h"
-#ifndef __MWERKS__
-#include <fcntl.h>
-#endif
-
#if 0
int
#include "mactty.h"
#include "wintty.h"
-#if defined(applec)
-#include <sysequ.h>
-#else
#include <LowMem.h>
-#endif
#include <AppleEvents.h>
#include <Gestalt.h>
#include <TextUtils.h>
#include <DiskInit.h>
+#include <ControlDefinitions.h>
NhWindow *theWindows = (NhWindow *) 0;
-#ifndef USESROUTINEDESCRIPTORS /* not using universal headers */
- /* Cast everything in terms of the new Low Memory function calls. */
-# if defined(applec)
-# define LMGetCurStackBase() (*(long *) CurStackBase)
-# define LMGetDefltStack() (*(long *) DefltStack)
-# elif defined(THINK_C)
-# define LMGetCurStackBase() CurStackBase
-# define LMGetDefltStack() (*(long *) DefltStack)
-# elif defined(__MWERKS__)
-# else
-# error /* need to define LM functions for this compiler */
-# endif
-#endif /* !USEROUTINEDESCRIPTORS (universal headers) */
-
/* Borrowed from the Mac tty port */
extern WindowPtr _mt_window;
/* set up base fonts for all window types */
GetFNum ("\pHackFont", &i);
if (i == 0)
- i = monaco;
+ i = kFontIDMonaco;
win_fonts [NHW_BASE] = win_fonts [NHW_MAP] = win_fonts [NHW_STATUS] = i;
GetFNum ("\pPSHackFont", &i);
if (i == 0)
- i = geneva;
+ i = kFontIDGeneva;
win_fonts [NHW_MESSAGE] = i;
- win_fonts [NHW_TEXT] = geneva;
+ win_fonts [NHW_TEXT] = kFontIDGeneva;
macFlags.hasAE = 0;
if(!Gestalt(gestaltAppleEventsAttr, &l) && (l & (1L << gestaltAppleEventsPresent))){
InitMenuRes ();
theWindows = (NhWindow *) NewPtrClear (NUM_MACWINDOWS * sizeof (NhWindow));
- mustwork(MemError());
+ if (MemError())
+ error("mac_init_nhwindows: Couldn't allocate memory for windows.");
DimMenuBar ();
void
enter_topl_mode(char *query) {
if (in_topl_mode())
- Debugger();
+ return;
putstr(WIN_MESSAGE, ATR_BOLD, query);
NhWindow *aWin = theWindows + WIN_MESSAGE;
if (!in_topl_mode())
- Debugger();
+ return;
/* remove unprintables from the answer */
for (ap = *(*top_line)->hText + topl_query_len, bp = answer; ans_len > 0; ans_len--, ap++) {
if (iflags.window_inited) {
if (flags.tombstone && killer) {
/* Prepare for the coming of the tombstone window. */
- win_fonts [NHW_TEXT] = monaco;
+ win_fonts [NHW_TEXT] = kFontIDMonaco;
}
return;
}
if ((!((WindowPeek) theWindow)->visible || (kind != NHW_MENU && kind != NHW_TEXT))) {
DisposeWindow (theWindow);
if (aWin->windowText) {
- DisposHandle (aWin->windowText);
+ DisposeHandle (aWin->windowText);
}
aWin->its_window = (WindowPtr) 0;
aWin->windowText = (Handle) 0;
where.v = where.v / nhw->row_height;
clicked_mod = (theEvent->modifiers & shiftKey) ? CLICK_2 : CLICK_1;
- if (strchr(topl_resp, click_to_cmd(where.h, where.v, clicked_mod)))
+ if (strchr(topl_resp, *click_to_cmd(where.h, where.v, clicked_mod)))
nhbell();
else {
if (cursor_locked)
static short
macDoNull (EventRecord *theEvent, WindowPtr theWindow) {
- if (!theEvent || !theWindow)
- Debugger ();
return 0;
}
NhWindow *aWin = GetNhWin (theWindow);
int l;
- if (!theEvent) {
- Debugger ();
- }
+ if (!theEvent)
+ return 0;
GetClip(org_clip);
name = tmp;
break;
}
- TextFont(geneva);
+ TextFont(kFontIDGeneva);
TextSize(9);
GetFontInfo(&font);
MoveTo ((frame.left + frame.right - StringWidth(name)) / 2,
RgnHandle h;
Boolean vis;
- if (!theEvent) {
- Debugger ();
- }
+ if (!theEvent)
+ return 0;
r2.left = r2.right - SBARWIDTH;
r2.right += 1;
GlobalToLocal (&where);
dir_bas = iflags.num_pad ? (char *) ndir : (char *) sdir;
- dir = strchr (dir_bas, click_to_cmd (where.h / nhw->char_width + 1 ,
+ dir = strchr (dir_bas, *click_to_cmd (where.h / nhw->char_width + 1 ,
where.v / nhw->row_height, CLICK_1));
}
ch = GetCursor (dir ? dir - dir_bas + 513 : 512);
-/* SCCS Id: @(#)getline.c 3.1 90/22/02
+/* SCCS Id: @(#)getline.c 3.1 90/22/02 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
#include "mactty.h"
#endif
#include "macpopup.h"
+#include <ControlDefinitions.h>
/* Flash a dialog button when its accelerator key is pressed */
void
unsigned long ticks;
/* Apple recommends 8 ticks */
- GetDItem(wind, item, &type, &handle, &rect);
+ GetDialogItem(wind, item, &type, &handle, &rect);
HiliteControl((ControlHandle)handle, kControlButtonPart);
Delay(8, &ticks);
HiliteControl((ControlHandle)handle, 0);
Handle h;
Rect r;
- GetDItem (dlog, item, &k, &h, &r);
+ GetDialogItem (dlog, item, &k, &h, &r);
PenSize (3, 3);
FrameRoundRect (&r, frame_corner, frame_corner);
PenNormal ();
if (!FrameItemUPP) /* initialize handler routine */
FrameItemUPP = NewUserItemProc(FrameItem);
- GetDItem (dlog, item, &kind, &h, &r);
+ GetDialogItem (dlog, item, &kind, &h, &r);
InsetRect (&r, -4, -4);
r2 = r;
- GetDItem (dlog, frame, &kind, &h, &r);
- SetDItem (dlog, frame, kind, (Handle) FrameItemUPP, &r2);
+ GetDialogItem (dlog, frame, &kind, &h, &r);
+ SetDialogItem (dlog, frame, kind, (Handle) FrameItemUPP, &r2);
frame_corner = 16;
}
Rect r, r2;
if (gEnterItem != newEnterItem) {
- GetDItem (dp, gEnterItem, &kind, &item, &r2);
+ GetDialogItem (dp, gEnterItem, &kind, &item, &r2);
InsetRect (&r2, - 4, - 4);
EraseRect (&r2);
InvalRect (&r2);
gEnterItem = newEnterItem;
- GetDItem (dp, newEnterItem, &kind, &item, &r2);
+ GetDialogItem (dp, newEnterItem, &kind, &item, &r2);
frame_corner = kind == ctrlItem + btnCtrl ? 16 : 0;
InsetRect (&r2, - 4, - 4);
InvalRect (&r2);
r = r2;
- GetDItem (dp, yn_user_item [dlogID - YN_DLOG], &kind, &item, &r2);
- SetDItem (dp, yn_user_item [dlogID - YN_DLOG], kind, item, &r);
+ GetDialogItem (dp, yn_user_item [dlogID - YN_DLOG], &kind, &item, &r2);
+ SetDialogItem (dp, yn_user_item [dlogID - YN_DLOG], kind, item, &r);
}
}
Handle h;
Rect r;
Str255 s;
- GetDItem(dp, gEnterItem, &k, &h, &r);
- GetIText(h, s);
+ GetDialogItem(dp, gEnterItem, &k, &h, &r);
+ GetDialogItemText(h, s);
if (s[0])
StringToNum(s, &yn_number);
}
com [1] = ch;
if (ch == 27) {
- GetDItem (dp, 4, &k, &h, &r);
- SetIText (h, com);
+ GetDialogItem (dp, 4, &k, &h, &r);
+ SetDialogItemText (h, com);
*item = 2;
FlashButton (dp, 2);
return 1;
}
if (! gRespStr || strchr (gRespStr, ch)) {
- GetDItem (dp, 4, &k, &h, &r);
- SetIText (h, com);
+ GetDialogItem (dp, 4, &k, &h, &r);
+ SetDialogItemText (h, com);
*item = 1;
FlashButton (dp, 1);
return 1;
}
if (ch == 10 || ch == 13 || ch == 3 || ch == 32) {
com [1] = gDef;
- GetDItem (dp, 4, &k, &h, &r);
- SetIText (h, com);
+ GetDialogItem (dp, 4, &k, &h, &r);
+ SetDialogItemText (h, com);
*item = 1;
FlashButton (dp, 1);
return 1;
}
if (ch > 32 && ch < 127) {
- GetDItem (dp, 4, &k, &h, &r);
- SetIText (h, com);
+ GetDialogItem (dp, 4, &k, &h, &r);
+ SetDialogItemText (h, com);
*item = 1;
FlashButton (dp, 1);
return 1;
short k, item;
Handle h;
Rect r;
- unsigned char com [32] = {1, 27}; // margin for getitext
+ unsigned char com [32] = {1, 27}; // margin for GetDialogItemText
Str255 pQuery;
char c = queued_resp ((char *) resp);
}
pQuery[0] = strlen (&pQuery[1]);
ParamText ((char *) pQuery, (uchar *) 0, (uchar *) 0, (uchar *) 0);
- GetDItem (dp, 4, &k, &h, &r);
- SetIText (h, com);
- SelIText (dp, 4, 0, 0x7fff);
+ GetDialogItem (dp, 4, &k, &h, &r);
+ SetDialogItemText (h, com);
+ SelectDialogItemText (dp, 4, 0, 0x7fff);
InitCursor ();
SetFrameItem (dp, 6, 1);
gRespStr = resp;
mv_modal_dialog (OneCharDLOGFilter, &item);
} while (item != 1 && item != 2);
- GetIText (h, com);
+ GetDialogItemText (h, com);
mv_close_dialog (dp);
if (item == 2 || ! com [0]) {
for (ix = 3; ix; ix ++) {
h = (Handle) 0;
k = 0;
- GetDItem (dp, ix, &k, &h, &r);
+ GetDialogItem (dp, ix, &k, &h, &r);
if (! k || ! h) {
return 0;
}
** Get the text from the text edit item.
*/
- GetDItem(promptDialog, 4, &type, (Handle *) &ctrl, &box);
- GetIText((Handle) ctrl, pasStr);
+ GetDialogItem(promptDialog, 4, &type, (Handle *) &ctrl, &box);
+ GetDialogItemText((Handle) ctrl, pasStr);
/*
** Convert it to a 'C' string and copy it into the return value.
}
}
- mustwork (create_tty (&_mt_window, WIN_BASE_KIND + NHW_MAP, _mt_in_color));
+ if (create_tty (&_mt_window, WIN_BASE_KIND + NHW_MAP, _mt_in_color) != noErr)
+ error("_mt_init_stuff: Couldn't create tty.");
((WindowPeek) _mt_window)->windowKind = (WIN_BASE_KIND + NHW_MAP);
SelectWindow (_mt_window);
SetPort (_mt_window);
SetOrigin (-1, -1);
font_size = (iflags.large_font && !small_screen) ? 12 : 9;
- mustwork (init_tty_number (_mt_window, win_fonts [NHW_MAP], font_size, CO, LI));
+ if (init_tty_number (_mt_window, win_fonts [NHW_MAP], font_size, CO, LI) != noErr)
+ error("_mt_init_stuff: Couldn't init tty.");
- mustwork (get_tty_metrics (_mt_window, &num_cols, &num_rows, &win_width ,
- &win_height, &font_num, &font_size, &char_width, &row_height));
+ if (get_tty_metrics (_mt_window, &num_cols, &num_rows, &win_width ,
+ &win_height, &font_num, &font_size, &char_width, &row_height))
+ error("_mt_init_stuff: Couldn't get tty metrics.");
SizeWindow (_mt_window, win_width + 2, win_height + 2, 1);
if (RetrievePosition (kMapWindow, &vert, &hor)) {
ShowWindow (_mt_window);
/* Start in raw, always flushing mode */
- mustwork (get_tty_attrib (_mt_window, TTY_ATTRIB_FLAGS, &flag));
+ get_tty_attrib(_mt_window, TTY_ATTRIB_FLAGS, &flag);
flag |= TA_ALWAYS_REFRESH | TA_WRAP_AROUND;
- mustwork (set_tty_attrib (_mt_window, TTY_ATTRIB_FLAGS, flag));
+ set_tty_attrib(_mt_window, TTY_ATTRIB_FLAGS, flag);
- mustwork (get_tty_attrib (_mt_window, TTY_ATTRIB_CURSOR, &flag));
+ get_tty_attrib(_mt_window, TTY_ATTRIB_CURSOR, &flag);
flag |= (TA_BLINKING_CURSOR | TA_NL_ADD_CR);
- mustwork (set_tty_attrib (_mt_window, TTY_ATTRIB_CURSOR, flag));
+ set_tty_attrib(_mt_window, TTY_ATTRIB_CURSOR, flag);
- mustwork (set_tty_attrib (_mt_window, TTY_ATTRIB_FOREGROUND, _mt_colors [NO_COLOR] [0]));
- mustwork (set_tty_attrib (_mt_window, TTY_ATTRIB_BACKGROUND, _mt_colors [NO_COLOR] [1]));
- clear_tty (_mt_window);//
+ set_tty_attrib(_mt_window, TTY_ATTRIB_FOREGROUND, _mt_colors[NO_COLOR][0]);
+ set_tty_attrib(_mt_window, TTY_ATTRIB_BACKGROUND, _mt_colors[NO_COLOR][1]);
+ clear_tty (_mt_window);
InitMenuRes ();
}
void
-setftty (void) {
-long flag;
+setftty (void)
+{
+ long flag;
- mustwork (get_tty_attrib (_mt_window, TTY_ATTRIB_FLAGS, &flag));
-/* Buffered output in the game */
+ /* Buffered output for the game */
+ get_tty_attrib (_mt_window, TTY_ATTRIB_FLAGS, &flag);
flag &= ~ TA_ALWAYS_REFRESH;
flag |= TA_INHIBIT_VERT_SCROLL; /* don't scroll */
- mustwork (set_tty_attrib (_mt_window, TTY_ATTRIB_FLAGS, flag));
-
+ set_tty_attrib (_mt_window, TTY_ATTRIB_FLAGS, flag);
iflags.cbreak = 1;
}
void
-settty (const char *str) {
-long flag;
+settty (const char *str)
+{
+ long flag;
update_tty (_mt_window);
- mustwork (get_tty_attrib (_mt_window, TTY_ATTRIB_FLAGS, &flag));
-/* Buffered output in the game, raw in "raw" mode */
+ /* Buffered output for the game, raw in "raw" mode */
+ get_tty_attrib(_mt_window, TTY_ATTRIB_FLAGS, &flag);
flag &= ~ TA_INHIBIT_VERT_SCROLL; /* scroll */
flag |= TA_ALWAYS_REFRESH;
- mustwork (set_tty_attrib (_mt_window, TTY_ATTRIB_FLAGS, flag));
+ set_tty_attrib(_mt_window, TTY_ATTRIB_FLAGS, flag);
tty_raw_print ("\n");
if (str) {