Amiga: drop #if 0 dead-code blocks

Includes a dead amii_player_selection / RandomWindow pair (~280 lines),
eraseall / CopyFile in amidos.c, and smaller fragments.
This commit is contained in:
Ingo Paschke
2026-05-11 20:30:45 +02:00
parent 00433c7998
commit e90a297021
6 changed files with 0 additions and 456 deletions
-301
View File
@@ -408,290 +408,6 @@ amii_askname(void)
/* Get the player selection character */
#if 0 /* New function at the bottom */
void
amii_player_selection(void)
{
struct Window *cwin;
struct IntuiMessage *imsg;
int aredone = 0;
struct Gadget *gd;
static int once = 0;
long class, code;
amii_clear_nhwindow( WIN_BASE );
if (validrole(flags.initrole))
return;
else {
flags.initrole = randrole(FALSE);
return;
}
#if 0 /* Don't query the user ... instead give random character -jhsa */
#if 0 /* OBSOLETE */
if( *svp.pl_character ){
svp.pl_character[ 0 ] = toupper( svp.pl_character[ 0 ] );
if( strchr( pl_classes, svp.pl_character[ 0 ] ) )
return;
}
#endif
if( !once ){
if( bigscreen ){
Type_NewWindowStructure1.TopEdge =
(HackScreen->Height/2) - (Type_NewWindowStructure1.Height/2);
}
for( gd = Type_NewWindowStructure1.FirstGadget; gd;
gd = gd->NextGadget )
{
if( gd->GadgetID != 0 )
SetBorder( gd );
}
once = 1;
}
if( WINVERS_AMIV )
{
Type_NewWindowStructure1.Extension = wintags;
Type_NewWindowStructure1.Flags |= WFLG_NW_EXTENDED;
fillhook.h_Entry = (void *) &LayerFillHook;
fillhook.h_Data = (void *)-2;
fillhook.h_SubEntry = 0;
}
Type_NewWindowStructure1.Screen = HackScreen;
if( ( cwin = OpenShWindow( (void *)&Type_NewWindowStructure1 ) ) == NULL )
{
return;
}
#if 0
WindowToFront( cwin );
#endif
while( !aredone )
{
WaitPort( cwin->UserPort );
while( ( imsg = (void *) GetMsg( cwin->UserPort ) ) != NULL )
{
class = imsg->Class;
code = imsg->Code;
gd = (struct Gadget *)imsg->IAddress;
ReplyMsg( (struct Message *)imsg );
switch( class )
{
case VANILLAKEY:
if( strchr( pl_classes, toupper( code ) ) )
{
svp.pl_character[0] = toupper( code );
aredone = 1;
}
else if( code == ' ' || code == '\n' || code == '\r' )
{
flags.initrole = randrole(FALSE);
#if 0 /* OBSOLETE */
strcpy( svp.pl_character, roles[ rnd( 11 ) ] );
#endif
aredone = 1;
amii_clear_nhwindow( WIN_BASE );
CloseShWindow( cwin );
RandomWindow( svp.pl_character );
return;
}
else if( code == 'q' || code == 'Q' )
{
CloseShWindow( cwin );
clearlocks();
exit_nhwindows(NULL);
nh_terminate(0);
}
else
DisplayBeep( NULL );
break;
case GADGETUP:
switch( gd->GadgetID )
{
case 1: /* Random Character */
flags.initrole = randrole(FALSE);
#if 0 /* OBSOLETE */
strcpy( svp.pl_character, roles[ rnd( 11 ) ] );
#endif
amii_clear_nhwindow( WIN_BASE );
CloseShWindow( cwin );
RandomWindow( svp.pl_character );
return;
default:
svp.pl_character[0] = gd->GadgetID;
break;
}
aredone = 1;
break;
case CLOSEWINDOW:
CloseShWindow( cwin );
clearlocks();
exit_nhwindows(NULL);
nh_terminate(0);
break;
}
}
}
amii_clear_nhwindow( WIN_BASE );
CloseShWindow( cwin );
#endif /* Do not query user ... -jhsa */
}
#endif /* Function elsewhere */
#if 0 /* Unused ... -jhsa */
#include "NH:sys/amiga/randwin.c"
void
RandomWindow(char *name)
{
struct MsgPort *tport;
struct timerequest *trq;
static int once = 0;
struct Gadget *gd;
struct Window *w;
struct IntuiMessage *imsg;
int ticks = 0, aredone = 0, timerdone = 0;
long mask, got;
tport = CreateMsgPort();
trq = (struct timerequest *)CreateIORequest( tport, sizeof( *trq ) );
if( tport == NULL || trq == NULL )
{
allocerr:
if( tport ) DeleteMsgPort( tport );
if( trq ) DeleteIORequest( (struct IORequest *)trq );
Delay( 8 * 50 );
return;
}
if( OpenDevice( TIMERNAME, UNIT_VBLANK, (struct IORequest *)trq, 0L ) != 0 )
goto allocerr;
trq->tr_node.io_Command = TR_ADDREQUEST;
trq->tr_time.tv_secs = 8;
trq->tr_time.tv_micro = 0;
SendIO( (struct IORequest *)trq );
/* Place the name in the center of the screen */
Rnd_IText5.IText = name;
Rnd_IText6.LeftEdge = Rnd_IText4.LeftEdge +
(strlen(Rnd_IText4.IText)+1)*8;
Rnd_NewWindowStructure1.Width = (
(strlen( Rnd_IText2.IText )+1) * 8 ) +
HackScreen->WBorLeft + HackScreen->WBorRight;
Rnd_IText5.LeftEdge = (Rnd_NewWindowStructure1.Width -
(strlen(name)*8))/2;
gd = Rnd_NewWindowStructure1.FirstGadget;
gd->LeftEdge = (Rnd_NewWindowStructure1.Width - gd->Width)/2;
/* Chose correct modifier */
Rnd_IText6.IText = "a";
switch( *name )
{
case 'a': case 'e': case 'i': case 'o':
case 'u': case 'A': case 'E': case 'I':
case 'O': case 'U':
Rnd_IText6.IText = "an";
break;
}
if( !once )
{
if( bigscreen )
{
Rnd_NewWindowStructure1.TopEdge =
(HackScreen->Height/2) - (Rnd_NewWindowStructure1.Height/2);
}
for( gd = Rnd_NewWindowStructure1.FirstGadget; gd; gd = gd->NextGadget )
{
if( gd->GadgetID != 0 )
SetBorder( gd );
}
Rnd_NewWindowStructure1.IDCMPFlags |= VANILLAKEY;
once = 1;
}
if( WINVERS_AMIV )
{
Rnd_NewWindowStructure1.Extension = wintags;
Rnd_NewWindowStructure1.Flags |= WFLG_NW_EXTENDED;
fillhook.h_Entry = (void *) &LayerFillHook;
fillhook.h_Data = (void *)-2;
fillhook.h_SubEntry = 0;
}
Rnd_NewWindowStructure1.Screen = HackScreen;
if( ( w = OpenShWindow( (void *)&Rnd_NewWindowStructure1 ) ) == NULL )
{
AbortIO( (struct IORequest *)trq );
WaitIO( (struct IORequest *)trq );
CloseDevice( (struct IORequest *)trq );
DeleteIORequest( (struct IORequest *) trq );
DeleteMsgPort( tport );
Delay( 50 * 8 );
return;
}
PrintIText( w->RPort, &Rnd_IntuiTextList1, 0, 0 );
mask = (1L << tport->mp_SigBit)|(1L << w->UserPort->mp_SigBit);
while( !aredone )
{
got = Wait( mask );
if( got & (1L << tport->mp_SigBit ) )
{
aredone = 1;
timerdone = 1;
GetMsg( tport );
}
while( w && ( imsg = (struct IntuiMessage *) GetMsg( w->UserPort ) ) )
{
switch( (long)imsg->Class )
{
/* Must be up for a little while... */
case INACTIVEWINDOW:
if( ticks >= 40 )
aredone = 1;
break;
case INTUITICKS:
++ticks;
break;
case GADGETUP:
aredone = 1;
break;
case VANILLAKEY:
if(imsg->Code=='\n' || imsg->Code==' ' || imsg->Code=='\r')
aredone = 1;
break;
}
ReplyMsg( (struct Message *)imsg );
}
}
if( !timerdone )
{
AbortIO( (struct IORequest *)trq );
WaitIO( (struct IORequest *)trq );
}
CloseDevice( (struct IORequest *)trq );
DeleteIORequest( (struct IORequest *) trq );
DeleteMsgPort( tport );
if(w) CloseShWindow( w );
}
#endif /* Discarded randwin ... -jhsa */
/* this should probably not be needed (or be renamed)
void
@@ -992,23 +708,6 @@ amii_yn_function(const char *query, const char *resp, char def)
cursor_on(WIN_MESSAGE);
q = lowc(WindowGetchar());
cursor_off(WIN_MESSAGE);
#if 0
/* fix for PL2 */
if (q == '\020') { /* ctrl-P */
if(!doprev)
(void) tty_doprev_message(); /* need two initially */
(void) tty_doprev_message();
q = (char)0;
doprev = 1;
continue;
} else if (doprev) {
tty_clear_nhwindow(WIN_MESSAGE);
cw->maxcol = cw->maxrow;
doprev = 0;
amii_addtopl(prompt);
continue;
}
#endif /*0*/
digit_ok = allow_num && isdigit(q);
if (q == '\033') {
if (strchr(resp, 'q'))