mirror of
https://github.com/callapple/Twilight_II.git
synced 2025-01-16 07:31:00 +00:00
Add files via upload
This commit is contained in:
parent
78a69f1812
commit
256399c2d2
BIN
source/twilight/jw/Libraries/T2.INT
Normal file
BIN
source/twilight/jw/Libraries/T2.INT
Normal file
Binary file not shown.
42
source/twilight/jw/Libraries/T2.PAS
Normal file
42
source/twilight/jw/Libraries/T2.PAS
Normal file
@ -0,0 +1,42 @@
|
||||
{$keep 'T2PAS'}
|
||||
|
||||
Unit T2;
|
||||
|
||||
Interface
|
||||
|
||||
{********************************************************
|
||||
*
|
||||
* Twilight II Interface File
|
||||
*
|
||||
* By: Josef W. Wankerl
|
||||
*
|
||||
* Other USES Files Needed: - None -
|
||||
*
|
||||
* Other Tool Sets Needed: - None -
|
||||
*
|
||||
* Copyright 1992
|
||||
* By EGO Systems
|
||||
* All Rights Reserved
|
||||
*
|
||||
*********************************************************}
|
||||
|
||||
Const
|
||||
{ Action message codes sent to modules. }
|
||||
MakeT2 = 0;
|
||||
SaveT2 = 1;
|
||||
BlankT2 = 2;
|
||||
LoadSetupT2 = 3;
|
||||
UnloadSetupT2 = 4;
|
||||
KillT2 = 5;
|
||||
HitT2 = 6;
|
||||
|
||||
{ Resources types. }
|
||||
rT2ModuleFlags = $1000;
|
||||
rT2ExtSetup1 = $1001;
|
||||
rT2ModuleWord = $1002;
|
||||
|
||||
Type
|
||||
movePtrType = ^Boolean;
|
||||
|
||||
Implementation
|
||||
End.
|
28
source/twilight/jw/Libraries/T2.h
Normal file
28
source/twilight/jw/Libraries/T2.h
Normal file
@ -0,0 +1,28 @@
|
||||
/********************************************
|
||||
; File: T2.h
|
||||
;
|
||||
; By: Josef W. Wankerl
|
||||
;
|
||||
; Copyright EGO Systems 1992
|
||||
; All Rights Reserved
|
||||
;
|
||||
********************************************/
|
||||
|
||||
#ifndef __T2__
|
||||
#define __T2__
|
||||
|
||||
/* Action message codes sent to modules. */
|
||||
#define MakeT2 0
|
||||
#define SaveT2 1
|
||||
#define BlankT2 2
|
||||
#define LoadSetupT2 3
|
||||
#define UnloadSetupT2 4
|
||||
#define KillT2 5
|
||||
#define HitT2 6
|
||||
|
||||
/* Resources types. */
|
||||
#define rT2ModuleFlags 0x1000
|
||||
#define rT2ExtSetup1 0x1001
|
||||
#define rT2ModuleWord 0x1002
|
||||
|
||||
#endif
|
550
source/twilight/jw/Messages/Messages.CC
Normal file
550
source/twilight/jw/Messages/Messages.CC
Normal file
@ -0,0 +1,550 @@
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* Messages *|
|
||||
|* *|
|
||||
|* by: Josef W. Wankerl *|
|
||||
|* *|
|
||||
|* Version: 1.0 *|
|
||||
|* 06/15/92 *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
#pragma keep "Messages"
|
||||
#pragma cdev Messages
|
||||
#pragma optimize -1
|
||||
|
||||
#include "Messages.H"
|
||||
|
||||
#pragma lint -1
|
||||
|
||||
#pragma debug 0 /* was -1 */
|
||||
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* SaveConfigResource- *|
|
||||
|* This function takes a word value and saves it as a rT2ModuleWord *|
|
||||
|* resource in the Twilight.Setup file. The value is saved and a *|
|
||||
|* name is added. Any previous rT2ModuleWord with the same name is *|
|
||||
|* first removed before the new value is added. *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
void SaveConfigResource (char *Name, Word SaveValue)
|
||||
{
|
||||
Word FileID;
|
||||
Long ResourceID;
|
||||
Word **ConfigData;
|
||||
|
||||
/******************************************************/
|
||||
/* Check to see if the named resource already exists */
|
||||
/******************************************************/
|
||||
|
||||
ResourceID = RMFindNamedResource (rT2ModuleWord, Name, &FileID);
|
||||
if (!toolerror ())
|
||||
{
|
||||
char NullString = '\x000';
|
||||
|
||||
/**************************************************************/
|
||||
/* The resource already exists, so first remove the name from */
|
||||
/* the resource, then remove the resource itself */
|
||||
/**************************************************************/
|
||||
|
||||
RMSetResourceName (rT2ModuleWord, ResourceID, &NullString);
|
||||
RemoveResource (rT2ModuleWord, ResourceID);
|
||||
}
|
||||
|
||||
/*********************************************/
|
||||
/* Create new handle for the future resource */
|
||||
/*********************************************/
|
||||
|
||||
ConfigData =
|
||||
(Word **) NewHandle (sizeof (Word), MMStartUp (), attrLocked, 0L);
|
||||
**ConfigData = SaveValue;
|
||||
|
||||
/*********************************************/
|
||||
/* Find a new ID for the resource and add it */
|
||||
/*********************************************/
|
||||
|
||||
ResourceID = UniqueResourceID (0, rT2ModuleWord);
|
||||
AddResource (ConfigData, 0, rT2ModuleWord, ResourceID);
|
||||
if (toolerror ())
|
||||
DisposeHandle (ConfigData);
|
||||
else
|
||||
{
|
||||
|
||||
/**********************************************************/
|
||||
/* Set the name of the resource if it was added correctly */
|
||||
/**********************************************************/
|
||||
|
||||
RMSetResourceName (rT2ModuleWord, ResourceID, Name);
|
||||
UpdateResourceFile (SetupFileNumber);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* SaveT2Message- *|
|
||||
|* This function saves the values of all setup controls. *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
void SaveT2Message (void)
|
||||
{
|
||||
Word FileNumber;
|
||||
char MultipleWorkString[7];
|
||||
|
||||
/***********************************************************/
|
||||
/* Save current resource file and switch in Twilight.Setup */
|
||||
/***********************************************************/
|
||||
|
||||
FileNumber = GetCurResourceFile ();
|
||||
SetCurResourceFile (SetupFileNumber);
|
||||
|
||||
/***********************/
|
||||
/* Save control values */
|
||||
/***********************/
|
||||
|
||||
Message = GetCtlValue (GetCtlHandleFromID (SetupWindow, MessageCtl));
|
||||
SaveConfigResource (MessageString, Message);
|
||||
Request = GetCtlValue (GetCtlHandleFromID (SetupWindow, RequestCtl));
|
||||
SaveConfigResource (RequestString, Request);
|
||||
|
||||
GetLETextByID (SetupWindow, MultipleCtl, &MultipleWorkString);
|
||||
Multiple = Dec2Int (&(MultipleWorkString[1]),
|
||||
((Word) MultipleWorkString[0]) & 0x00FF, 0);
|
||||
SaveConfigResource (MultipleString, Multiple);
|
||||
|
||||
/*****************************/
|
||||
/* Restore old resource file */
|
||||
/*****************************/
|
||||
|
||||
SetCurResourceFile (FileNumber);
|
||||
}
|
||||
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* LoadConfigResource- *|
|
||||
|* This function attempts to load a named rT2ModuleWord resource. If *|
|
||||
|* the resource exists, the value of the rT2ModuleWord resource is *|
|
||||
|* returned, otherwise a default value is returned. *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
Word LoadConfigResource (char *Name, Word DefaultValue)
|
||||
{
|
||||
Word Result;
|
||||
Word **ConfigData;
|
||||
|
||||
/**************************************/
|
||||
/* Attempt to load the named resource */
|
||||
/**************************************/
|
||||
|
||||
ConfigData = (Word **) RMLoadNamedResource (rT2ModuleWord, Name);
|
||||
if (toolerror ())
|
||||
|
||||
/********************************************************/
|
||||
/* Resource does not exist, so return the default value */
|
||||
/********************************************************/
|
||||
|
||||
Result = DefaultValue;
|
||||
else
|
||||
|
||||
/****************************************************/
|
||||
/* Resource exists, return the rT2Module word value */
|
||||
/****************************************************/
|
||||
|
||||
Result = **ConfigData;
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* LoadSetupT2Message- *|
|
||||
|* This function loads in the messages configuration data. *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
void LoadSetupT2Message (void)
|
||||
{
|
||||
Message = LoadConfigResource (MessageString, 1);
|
||||
Request = LoadConfigResource (RequestString, 1);
|
||||
Multiple = LoadConfigResource (MultipleString, 5);
|
||||
}
|
||||
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* MakeT2Message- *|
|
||||
|* This function creates the controls for the messages setup window *|
|
||||
|* and sets the value of the controls the the current setup. *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
LongWord MakeT2Message (void)
|
||||
{
|
||||
int i;
|
||||
Word FileNumber;
|
||||
char MultipleWorkString[7];
|
||||
|
||||
/***********************************************************/
|
||||
/* Save current resource file and switch in Twilight.Setup */
|
||||
/***********************************************************/
|
||||
|
||||
FileNumber = GetCurResourceFile ();
|
||||
SetCurResourceFile (SetupFileNumber);
|
||||
|
||||
/***********************************************************************/
|
||||
/* Make absolutely sure that the messages configuration data is loaded */
|
||||
/***********************************************************************/
|
||||
|
||||
LoadSetupT2Message ();
|
||||
|
||||
/*****************************/
|
||||
/* Restore old resource file */
|
||||
/*****************************/
|
||||
|
||||
SetCurResourceFile (FileNumber);
|
||||
|
||||
/*********************************************************************/
|
||||
/* Create setup controls and set their states to match current setup */
|
||||
/*********************************************************************/
|
||||
|
||||
NewControl2 (SetupWindow, resourceToResource, MainControlList);
|
||||
|
||||
SetCtlValue (Message, GetCtlHandleFromID (SetupWindow, MessageCtl));
|
||||
SetCtlValue (Request, GetCtlHandleFromID (SetupWindow, RequestCtl));
|
||||
|
||||
Int2Dec (Multiple, &(MultipleWorkString[1]), 5, 0);
|
||||
for (i = 1; (i < 7) && (MultipleWorkString[i] == ' '); i++);
|
||||
MultipleWorkString[i - 1] = 6 - i;
|
||||
SetLETextByID (SetupWindow, MultipleCtl, &(MultipleWorkString[i - 1]));
|
||||
|
||||
/*****************************************/
|
||||
/* Return the number of the last control */
|
||||
/*****************************************/
|
||||
|
||||
return ZeroTxtCtl;
|
||||
}
|
||||
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* HitT2Message- *|
|
||||
|* This function checks to see which control has been hit, and if a *|
|
||||
|* control that requires the "Update" button has been hit, the *|
|
||||
|* EnableFlag is set to true. *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
LongWord HitT2Message (LongWord ControlHit)
|
||||
{
|
||||
LongWord EnableFlag = 0L;
|
||||
|
||||
if (ControlHit == MessageCtl)
|
||||
EnableFlag = 1L;
|
||||
if (ControlHit == RequestCtl)
|
||||
EnableFlag = 1L;
|
||||
if (ControlHit == MultipleCtl)
|
||||
EnableFlag = 1L;
|
||||
|
||||
/****************************************/
|
||||
/* Return the update button enable flag */
|
||||
/****************************************/
|
||||
|
||||
return EnableFlag;
|
||||
}
|
||||
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* BlankT2Message- *|
|
||||
|* This function performs the screen blanking activities. *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
LongWord BlankT2Message (Word *movePtr)
|
||||
{
|
||||
int i; /* number of messages displayed on the screen */
|
||||
int Count; /* number of messages to display */
|
||||
int Offset; /* offset in message handle to start of string */
|
||||
int Override; /* not showing messages or requests flag */
|
||||
int wrap; /* message index wraped flag */
|
||||
Word Fore; /* foreground color for text */
|
||||
Word Back; /* background color for text */
|
||||
Long StartIndex; /* anchor point for message index */
|
||||
Long MessageIndex = 1L; /* current index into the messages */
|
||||
Long TargetTick; /* end of wait tick number */
|
||||
Handle MessageHandle; /* handle to the current message */
|
||||
|
||||
/******************************************************************/
|
||||
/* Set the correct pen size so vertical lines do not appear wimpy */
|
||||
/******************************************************************/
|
||||
|
||||
SetPenSize (2, 1);
|
||||
|
||||
/************************************/
|
||||
/* Seed the random number generator */
|
||||
/************************************/
|
||||
|
||||
SetRandSeed (GetTick ());
|
||||
|
||||
/***********************************************************************/
|
||||
/* If the number of messages to draw is zero, change the count so that */
|
||||
/* it draws all the messages. Otherwise, set the count to the number */
|
||||
/* of messages to draw */
|
||||
/***********************************************************************/
|
||||
|
||||
if (Multiple == 0)
|
||||
Count = 32767;
|
||||
else
|
||||
Count = Multiple;
|
||||
|
||||
/****************************************************************************/
|
||||
/* If both messages and requests are not being shown, set the override flag */
|
||||
/****************************************************************************/
|
||||
|
||||
if ((!Message) && (!Request))
|
||||
Override = 1;
|
||||
else
|
||||
Override = 0;
|
||||
|
||||
/*****************************************************/
|
||||
/* Animate the screen until the movePtr becomes true */
|
||||
/*****************************************************/
|
||||
|
||||
while (!(*movePtr))
|
||||
{
|
||||
|
||||
/*** ==== CUT HERE FOR AN ORCA/C TWILIGHT II BLANKER SHELL ==== ***/
|
||||
|
||||
ClearScreen (0);
|
||||
|
||||
wrap = 0;
|
||||
StartIndex = MessageIndex;
|
||||
for (i = 0; (i < Count) && (!wrap); )
|
||||
{
|
||||
|
||||
/************************/
|
||||
/* Get the next message */
|
||||
/************************/
|
||||
|
||||
MessageHandle = GetMsgHandle (0, MessageIndex++);
|
||||
if ((!toolerror ()) && (MessageHandle != NULL))
|
||||
{
|
||||
|
||||
/*****************************/
|
||||
/* Check for a named message */
|
||||
/*****************************/
|
||||
|
||||
if ((*((Word *) ((*MessageHandle) + 4))) & 0x8000)
|
||||
{
|
||||
int Width;
|
||||
Rect BoundingBox;
|
||||
|
||||
HLock (MessageHandle);
|
||||
|
||||
if (*((*MessageHandle) + 8) > 2)
|
||||
{
|
||||
|
||||
/*******************************/
|
||||
/* Check for a request message */
|
||||
/*******************************/
|
||||
|
||||
if ((*((*MessageHandle) + 9) == '\x0FF') &&
|
||||
(*((*MessageHandle) + 10) == '>'))
|
||||
{
|
||||
|
||||
/******************************************************************/
|
||||
/* If request message, change the message so the $FF> isn't shown */
|
||||
/******************************************************************/
|
||||
|
||||
*((*MessageHandle) + 10) = (*((*MessageHandle) + 8)) - 2;
|
||||
Offset = 10;
|
||||
|
||||
/******************************/
|
||||
/* Set up for inverted colors */
|
||||
/******************************/
|
||||
|
||||
Fore = 0x0000;
|
||||
Back = 0x000F;
|
||||
}
|
||||
else
|
||||
{
|
||||
Offset = 8;
|
||||
|
||||
/****************************/
|
||||
/* Set up for normal colors */
|
||||
/****************************/
|
||||
|
||||
Fore = 0x000F;
|
||||
Back = 0x0000;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Offset = 8;
|
||||
|
||||
/****************************/
|
||||
/* Set up for normal colors */
|
||||
/****************************/
|
||||
|
||||
Fore = 0x000F;
|
||||
Back = 0x0000;
|
||||
}
|
||||
|
||||
if (((Offset == 8) && Message) ||
|
||||
((Offset == 10) && Request) ||
|
||||
Override)
|
||||
{
|
||||
|
||||
/*******************************************/
|
||||
/* Find the width of the string to display */
|
||||
/*******************************************/
|
||||
|
||||
if (!Override)
|
||||
Width = StringWidth ((*MessageHandle) + Offset);
|
||||
else
|
||||
Width = StringWidth (&BlankerName);
|
||||
|
||||
/**********************************************************************/
|
||||
/* Generate a randomly placed rectangle big enough to hold the string */
|
||||
/**********************************************************************/
|
||||
|
||||
BoundingBox.h1 = (+Random ()) % (620 - (Width + 40));
|
||||
BoundingBox.v1 = (+Random ()) % (200 - 15);
|
||||
BoundingBox.h2 = BoundingBox.h1 + Width + 40;
|
||||
BoundingBox.v2 = BoundingBox.v1 + 15;
|
||||
|
||||
/***************************************/
|
||||
/* Paint the interior of the rectangle */
|
||||
/***************************************/
|
||||
|
||||
SetSolidPenPat (Back);
|
||||
PaintRRect (&BoundingBox, 25, 25);
|
||||
|
||||
/*************************************/
|
||||
/* Draw a frame around the rectangle */
|
||||
/*************************************/
|
||||
|
||||
SetSolidPenPat (Fore);
|
||||
FrameRRect (&BoundingBox, 25, 25);
|
||||
|
||||
/****************************************/
|
||||
/* Draw the string inside the rectangle */
|
||||
/****************************************/
|
||||
|
||||
SetForeColor (Fore);
|
||||
SetBackColor (Back);
|
||||
MoveTo (BoundingBox.h1 + 20, BoundingBox.v1 + 11);
|
||||
|
||||
if (!Override)
|
||||
DrawString ((*MessageHandle) + Offset);
|
||||
else
|
||||
{
|
||||
DrawString (&BlankerName);
|
||||
|
||||
/*******************************************************************/
|
||||
/* Set the wrap flag so the blanker name string is only drawn once */
|
||||
/*******************************************************************/
|
||||
|
||||
wrap = 1;
|
||||
}
|
||||
|
||||
/**************************************************/
|
||||
/* Increment the number of messages on the screen */
|
||||
/**************************************************/
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
/*********************************************************/
|
||||
/* Restore message to its proper state if it was changed */
|
||||
/*********************************************************/
|
||||
|
||||
if (Offset == 10) *((*MessageHandle) + 10) = '>';
|
||||
|
||||
HUnlock (MessageHandle);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
/*************************************************************************/
|
||||
/* If an error occurred while getting the next message it means that the */
|
||||
/* end of the messages has been reached, so start over at message one. */
|
||||
/*************************************************************************/
|
||||
|
||||
MessageIndex = 1L;
|
||||
|
||||
/********************************************************************/
|
||||
/* If the starting index is the same as the current index, then the */
|
||||
/* message index has wrapped completely. The wrap flag is then set */
|
||||
/* so duplicate messages are not displayed on the screen. */
|
||||
/********************************************************************/
|
||||
|
||||
if (StartIndex == MessageIndex) wrap = 1;
|
||||
}
|
||||
|
||||
/*** ==== CUT HERE FOR AN ORCA/C TWILIGHT II BLANKER SHELL ==== ***/
|
||||
|
||||
/************************************************************/
|
||||
/* Wait for five seconds, or until the movePtr becomes true */
|
||||
/************************************************************/
|
||||
|
||||
TargetTick = GetTick () + (5 * 60);
|
||||
while ((!(*movePtr)) && (GetTick () < TargetTick));
|
||||
}
|
||||
|
||||
/**********************************************/
|
||||
/* No error occurred, so return a NULL handle */
|
||||
/**********************************************/
|
||||
|
||||
return (LongWord) NULL;
|
||||
}
|
||||
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* Messages- *|
|
||||
|* This function checks the Twilight II message parameter and *|
|
||||
|* dispatches control to the appropriate message handler. *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
LongWord Messages (LongWord data2, LongWord data1, Word message)
|
||||
{
|
||||
LongWord Result = 1L;
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case MakeT2:
|
||||
|
||||
/***************************************************************************/
|
||||
/* Save pointer to setup window and resource file number of Twilight.Setup */
|
||||
/***************************************************************************/
|
||||
|
||||
SetupWindow = (GrafPortPtr) data1;
|
||||
SetupFileNumber = (Word) data2;
|
||||
|
||||
/*****************************/
|
||||
/* Create the setup controls */
|
||||
/*****************************/
|
||||
|
||||
Result = MakeT2Message ();
|
||||
break;
|
||||
case SaveT2:
|
||||
SaveT2Message ();
|
||||
break;
|
||||
case BlankT2:
|
||||
Result = BlankT2Message ((Word *) data1);
|
||||
break;
|
||||
case LoadSetupT2:
|
||||
LoadSetupT2Message ();
|
||||
break;
|
||||
case UnloadSetupT2:
|
||||
break;
|
||||
case KillT2:
|
||||
break;
|
||||
case HitT2:
|
||||
Result = HitT2Message (data2);
|
||||
break;
|
||||
}
|
||||
|
||||
return Result;
|
||||
}
|
47
source/twilight/jw/Messages/Messages.H
Normal file
47
source/twilight/jw/Messages/Messages.H
Normal file
@ -0,0 +1,47 @@
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* Messages *|
|
||||
|* *|
|
||||
|* by: Josef W. Wankerl *|
|
||||
|* *|
|
||||
|* Version: 1.0 *|
|
||||
|* 06/10/92 *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
#include <control.h>
|
||||
#include <intmath.h>
|
||||
#include <locator.h>
|
||||
#include <memory.h>
|
||||
#include <misctool.h>
|
||||
#include <orca.h>
|
||||
#include <quickdraw.h>
|
||||
#include <resources.h>
|
||||
#include <window.h>
|
||||
|
||||
#include <t2.h>
|
||||
|
||||
#define MainControlList 0x00000001L
|
||||
|
||||
#define IconCtl 0x00000001L
|
||||
#define MessageTxtCtl 0x00000002L
|
||||
#define MessageCtl 0x00000003L
|
||||
#define RequestCtl 0x00000004L
|
||||
#define MultipleTxtCtl 0x00000006L
|
||||
#define MultipleCtl 0x00000006L
|
||||
#define ZeroTxtCtl 0x00000007L
|
||||
|
||||
Word Message; /* Display messages flag */
|
||||
Word Request; /* Display requests flag */
|
||||
Word Multiple; /* Number of messages to display */
|
||||
|
||||
Word SetupFileNumber;
|
||||
GrafPortPtr SetupWindow;
|
||||
|
||||
#define MessageString "\pMessages: Message"
|
||||
#define RequestString "\pMessages: Request"
|
||||
#define MultipleString "\pMessages: Multiple"
|
||||
|
||||
#define BlankerName "\pTwilight II \
|
||||
\x0D2Messages\x0D3 \
|
||||
Blanker by Josef W. Wankerl"
|
28
source/twilight/jw/Messages/T2.h
Normal file
28
source/twilight/jw/Messages/T2.h
Normal file
@ -0,0 +1,28 @@
|
||||
/********************************************
|
||||
; File: T2.h
|
||||
;
|
||||
; By: Josef W. Wankerl
|
||||
;
|
||||
; Copyright EGO Systems 1992
|
||||
; All Rights Reserved
|
||||
;
|
||||
********************************************/
|
||||
|
||||
#ifndef __T2__
|
||||
#define __T2__
|
||||
|
||||
/* Action message codes sent to modules. */
|
||||
#define MakeT2 0
|
||||
#define SaveT2 1
|
||||
#define BlankT2 2
|
||||
#define LoadSetupT2 3
|
||||
#define UnloadSetupT2 4
|
||||
#define KillT2 5
|
||||
#define HitT2 6
|
||||
|
||||
/* Resources types. */
|
||||
#define rT2ModuleFlags 0x1000
|
||||
#define rT2ExtSetup1 0x1001
|
||||
#define rT2ModuleWord 0x1002
|
||||
|
||||
#endif
|
380
source/twilight/jw/Messages/t2.c.shell.cc
Normal file
380
source/twilight/jw/Messages/t2.c.shell.cc
Normal file
@ -0,0 +1,380 @@
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* Messages *|
|
||||
|* *|
|
||||
|* by: Josef W. Wankerl *|
|
||||
|* *|
|
||||
|* Version: 1.0 *|
|
||||
|* 06/15/92 *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
#pragma keep "Messages"
|
||||
#pragma cdev Messages
|
||||
#pragma optimize -1
|
||||
|
||||
#include "Messages.H"
|
||||
|
||||
#pragma lint -1
|
||||
|
||||
#pragma debug 0 /* was -1 */
|
||||
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* SaveConfigResource- *|
|
||||
|* This function takes a word value and saves it as a rT2ModuleWord *|
|
||||
|* resource in the Twilight.Setup file. The value is saved and a *|
|
||||
|* name is added. Any previous rT2ModuleWord with the same name is *|
|
||||
|* first removed before the new value is added. *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
void SaveConfigResource (char *Name, Word SaveValue)
|
||||
{
|
||||
Word FileID;
|
||||
Long ResourceID;
|
||||
Word **ConfigData;
|
||||
|
||||
/******************************************************/
|
||||
/* Check to see if the named resource already exists */
|
||||
/******************************************************/
|
||||
|
||||
ResourceID = RMFindNamedResource (rT2ModuleWord, Name, &FileID);
|
||||
if (!toolerror ())
|
||||
{
|
||||
char NullString = '\x000';
|
||||
|
||||
/**************************************************************/
|
||||
/* The resource already exists, so first remove the name from */
|
||||
/* the resource, then remove the resource itself */
|
||||
/**************************************************************/
|
||||
|
||||
RMSetResourceName (rT2ModuleWord, ResourceID, &NullString);
|
||||
RemoveResource (rT2ModuleWord, ResourceID);
|
||||
}
|
||||
|
||||
/*********************************************/
|
||||
/* Create new handle for the future resource */
|
||||
/*********************************************/
|
||||
|
||||
ConfigData =
|
||||
(Word **) NewHandle (sizeof (Word), MMStartUp (), attrLocked, 0L);
|
||||
**ConfigData = SaveValue;
|
||||
|
||||
/*********************************************/
|
||||
/* Find a new ID for the resource and add it */
|
||||
/*********************************************/
|
||||
|
||||
ResourceID = UniqueResourceID (0, rT2ModuleWord);
|
||||
AddResource (ConfigData, 0, rT2ModuleWord, ResourceID);
|
||||
if (toolerror ())
|
||||
DisposeHandle (ConfigData);
|
||||
else
|
||||
{
|
||||
|
||||
/**********************************************************/
|
||||
/* Set the name of the resource if it was added correctly */
|
||||
/**********************************************************/
|
||||
|
||||
RMSetResourceName (rT2ModuleWord, ResourceID, Name);
|
||||
UpdateResourceFile (SetupFileNumber);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* SaveT2Message- *|
|
||||
|* This function saves the values of all setup controls. *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
void SaveT2Message (void)
|
||||
{
|
||||
Word FileNumber;
|
||||
char MultipleWorkString[7];
|
||||
|
||||
/***********************************************************/
|
||||
/* Save current resource file and switch in Twilight.Setup */
|
||||
/***********************************************************/
|
||||
|
||||
FileNumber = GetCurResourceFile ();
|
||||
SetCurResourceFile (SetupFileNumber);
|
||||
|
||||
/***********************/
|
||||
/* Save control values */
|
||||
/***********************/
|
||||
|
||||
Message = GetCtlValue (GetCtlHandleFromID (SetupWindow, MessageCtl));
|
||||
SaveConfigResource (MessageString, Message);
|
||||
Request = GetCtlValue (GetCtlHandleFromID (SetupWindow, RequestCtl));
|
||||
SaveConfigResource (RequestString, Request);
|
||||
|
||||
GetLETextByID (SetupWindow, MultipleCtl, &MultipleWorkString);
|
||||
Multiple = Dec2Int (&(MultipleWorkString[1]),
|
||||
((Word) MultipleWorkString[0]) & 0x00FF, 0);
|
||||
SaveConfigResource (MultipleString, Multiple);
|
||||
|
||||
/*****************************/
|
||||
/* Restore old resource file */
|
||||
/*****************************/
|
||||
|
||||
SetCurResourceFile (FileNumber);
|
||||
}
|
||||
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* LoadConfigResource- *|
|
||||
|* This function attempts to load a named rT2ModuleWord resource. If *|
|
||||
|* the resource exists, the value of the rT2ModuleWord resource is *|
|
||||
|* returned, otherwise a default value is returned. *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
Word LoadConfigResource (char *Name, Word DefaultValue)
|
||||
{
|
||||
Word Result;
|
||||
Word **ConfigData;
|
||||
|
||||
/**************************************/
|
||||
/* Attempt to load the named resource */
|
||||
/**************************************/
|
||||
|
||||
ConfigData = (Word **) RMLoadNamedResource (rT2ModuleWord, Name);
|
||||
if (toolerror ())
|
||||
|
||||
/********************************************************/
|
||||
/* Resource does not exist, so return the default value */
|
||||
/********************************************************/
|
||||
|
||||
Result = DefaultValue;
|
||||
else
|
||||
|
||||
/****************************************************/
|
||||
/* Resource exists, return the rT2Module word value */
|
||||
/****************************************************/
|
||||
|
||||
Result = **ConfigData;
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* LoadSetupT2Message- *|
|
||||
|* This function loads in the messages configuration data. *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
void LoadSetupT2Message (void)
|
||||
{
|
||||
Message = LoadConfigResource (MessageString, 1);
|
||||
Request = LoadConfigResource (RequestString, 1);
|
||||
Multiple = LoadConfigResource (MultipleString, 5);
|
||||
}
|
||||
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* MakeT2Message- *|
|
||||
|* This function creates the controls for the messages setup window *|
|
||||
|* and sets the value of the controls the the current setup. *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
LongWord MakeT2Message (void)
|
||||
{
|
||||
int i;
|
||||
Word FileNumber;
|
||||
char MultipleWorkString[7];
|
||||
|
||||
/***********************************************************/
|
||||
/* Save current resource file and switch in Twilight.Setup */
|
||||
/***********************************************************/
|
||||
|
||||
FileNumber = GetCurResourceFile ();
|
||||
SetCurResourceFile (SetupFileNumber);
|
||||
|
||||
/***********************************************************************/
|
||||
/* Make absolutely sure that the messages configuration data is loaded */
|
||||
/***********************************************************************/
|
||||
|
||||
LoadSetupT2Message ();
|
||||
|
||||
/*****************************/
|
||||
/* Restore old resource file */
|
||||
/*****************************/
|
||||
|
||||
SetCurResourceFile (FileNumber);
|
||||
|
||||
/*********************************************************************/
|
||||
/* Create setup controls and set their states to match current setup */
|
||||
/*********************************************************************/
|
||||
|
||||
NewControl2 (SetupWindow, resourceToResource, MainControlList);
|
||||
|
||||
SetCtlValue (Message, GetCtlHandleFromID (SetupWindow, MessageCtl));
|
||||
SetCtlValue (Request, GetCtlHandleFromID (SetupWindow, RequestCtl));
|
||||
|
||||
Int2Dec (Multiple, &(MultipleWorkString[1]), 5, 0);
|
||||
for (i = 1; (i < 7) && (MultipleWorkString[i] == ' '); i++);
|
||||
MultipleWorkString[i - 1] = 6 - i;
|
||||
SetLETextByID (SetupWindow, MultipleCtl, &(MultipleWorkString[i - 1]));
|
||||
|
||||
/*****************************************/
|
||||
/* Return the number of the last control */
|
||||
/*****************************************/
|
||||
|
||||
return ZeroTxtCtl;
|
||||
}
|
||||
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* HitT2Message- *|
|
||||
|* This function checks to see which control has been hit, and if a *|
|
||||
|* control that requires the "Update" button has been hit, the *|
|
||||
|* EnableFlag is set to true. *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
LongWord HitT2Message (LongWord ControlHit)
|
||||
{
|
||||
LongWord EnableFlag = 0L;
|
||||
|
||||
if (ControlHit == MessageCtl)
|
||||
EnableFlag = 1L;
|
||||
if (ControlHit == RequestCtl)
|
||||
EnableFlag = 1L;
|
||||
if (ControlHit == MultipleCtl)
|
||||
EnableFlag = 1L;
|
||||
|
||||
/****************************************/
|
||||
/* Return the update button enable flag */
|
||||
/****************************************/
|
||||
|
||||
return EnableFlag;
|
||||
}
|
||||
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* BlankT2Message- *|
|
||||
|* This function performs the screen blanking activities. *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
LongWord BlankT2Message (Word *movePtr)
|
||||
{
|
||||
int i; /* number of messages displayed on the screen */
|
||||
int Count; /* number of messages to display */
|
||||
int Offset; /* offset in message handle to start of string */
|
||||
int Override; /* not showing messages or requests flag */
|
||||
int wrap; /* message index wraped flag */
|
||||
Word Fore; /* foreground color for text */
|
||||
Word Back; /* background color for text */
|
||||
Long StartIndex; /* anchor point for message index */
|
||||
Long MessageIndex = 1L; /* current index into the messages */
|
||||
Long TargetTick; /* end of wait tick number */
|
||||
Handle MessageHandle; /* handle to the current message */
|
||||
|
||||
/******************************************************************/
|
||||
/* Set the correct pen size so vertical lines do not appear wimpy */
|
||||
/******************************************************************/
|
||||
|
||||
SetPenSize (2, 1);
|
||||
|
||||
/************************************/
|
||||
/* Seed the random number generator */
|
||||
/************************************/
|
||||
|
||||
SetRandSeed (GetTick ());
|
||||
|
||||
/***********************************************************************/
|
||||
/* If the number of messages to draw is zero, change the count so that */
|
||||
/* it draws all the messages. Otherwise, set the count to the number */
|
||||
/* of messages to draw */
|
||||
/***********************************************************************/
|
||||
|
||||
if (Multiple == 0)
|
||||
Count = 32767;
|
||||
else
|
||||
Count = Multiple;
|
||||
|
||||
/****************************************************************************/
|
||||
/* If both messages and requests are not being shown, set the override flag */
|
||||
/****************************************************************************/
|
||||
|
||||
if ((!Message) && (!Request))
|
||||
Override = 1;
|
||||
else
|
||||
Override = 0;
|
||||
|
||||
/*****************************************************/
|
||||
/* Animate the screen until the movePtr becomes true */
|
||||
/*****************************************************/
|
||||
|
||||
while (!(*movePtr))
|
||||
|
||||
{
|
||||
|
||||
/************************************************************/
|
||||
/* Wait for five seconds, or until the movePtr becomes true */
|
||||
/************************************************************/
|
||||
|
||||
TargetTick = GetTick () + (5 * 60);
|
||||
while ((!(*movePtr)) && (GetTick () < TargetTick));
|
||||
}
|
||||
|
||||
/**********************************************/
|
||||
/* No error occurred, so return a NULL handle */
|
||||
/**********************************************/
|
||||
|
||||
return (LongWord) NULL;
|
||||
}
|
||||
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* Messages- *|
|
||||
|* This function checks the Twilight II message parameter and *|
|
||||
|* dispatches control to the appropriate message handler. *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
LongWord Messages (LongWord data2, LongWord data1, Word message)
|
||||
{
|
||||
LongWord Result = 1L;
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case MakeT2:
|
||||
|
||||
/***************************************************************************/
|
||||
/* Save pointer to setup window and resource file number of Twilight.Setup */
|
||||
/***************************************************************************/
|
||||
|
||||
SetupWindow = (GrafPortPtr) data1;
|
||||
SetupFileNumber = (Word) data2;
|
||||
|
||||
/*****************************/
|
||||
/* Create the setup controls */
|
||||
/*****************************/
|
||||
|
||||
Result = MakeT2Message ();
|
||||
break;
|
||||
case SaveT2:
|
||||
SaveT2Message ();
|
||||
break;
|
||||
case BlankT2:
|
||||
Result = BlankT2Message ((Word *) data1);
|
||||
break;
|
||||
case LoadSetupT2:
|
||||
LoadSetupT2Message ();
|
||||
break;
|
||||
case UnloadSetupT2:
|
||||
break;
|
||||
case KillT2:
|
||||
break;
|
||||
case HitT2:
|
||||
Result = HitT2Message (data2);
|
||||
break;
|
||||
}
|
||||
|
||||
return Result;
|
||||
}
|
71
source/twilight/jw/Shapes/Shapes.PAS
Normal file
71
source/twilight/jw/Shapes/Shapes.PAS
Normal file
@ -0,0 +1,71 @@
|
||||
{*****************************************************************************}
|
||||
{* *}
|
||||
{* Shapes *}
|
||||
{* *}
|
||||
{* by: Josef W. Wankerl *}
|
||||
{* *}
|
||||
{* Version: 1.0 *}
|
||||
{* 06/08/92 *}
|
||||
{* *}
|
||||
{*****************************************************************************}
|
||||
|
||||
{$CDev Shapes}
|
||||
{$Keep 'Shapes'}
|
||||
{$Optimize -1}
|
||||
|
||||
Program PascalShapes;
|
||||
|
||||
Uses Common, QuickDrawII, T2;
|
||||
|
||||
Procedure DrawAShape;
|
||||
Const
|
||||
Shapes = 4;
|
||||
|
||||
Var
|
||||
RandomRect : rect;
|
||||
RandomPattern : pattern;
|
||||
PatternElement : Byte;
|
||||
I : Integer;
|
||||
|
||||
Begin
|
||||
PatternElement := ((+QDRandom) Mod 16);
|
||||
PatternElement := PatternElement + (PatternElement << 4);
|
||||
|
||||
For I := 0 to 31 Do
|
||||
RandomPattern[I] := PatternElement;
|
||||
|
||||
SetPenPat (RandomPattern);
|
||||
|
||||
With RandomRect Do
|
||||
Begin
|
||||
v1 := (+QDRandom) Mod 200;
|
||||
h1 := (+QDRandom) Mod 320;
|
||||
v2 := (+QDRandom) Mod 200;
|
||||
h2 := (+QDRandom) Mod 320;
|
||||
End;
|
||||
|
||||
Case (+QDRandom) Mod Shapes Of
|
||||
0 : PaintOval (RandomRect);
|
||||
1 : PaintRect (RandomRect);
|
||||
2 : PaintRRect (RandomRect, (+QDRandom) Mod 150, (+QDRandom) Mod 150);
|
||||
3 : PaintArc (RandomRect, (+QDRandom) Mod 360, (+QDRandom) Mod 360)
|
||||
End
|
||||
End;
|
||||
|
||||
Function BlankT2Message (movePtr : movePtrType) : LongInt;
|
||||
Begin
|
||||
While Not movePtr^ Do
|
||||
DrawAShape;
|
||||
|
||||
BlankT2Message := LongInt (NIL)
|
||||
End;
|
||||
|
||||
Function Shapes (message : Integer; data1 : LongInt; data2 : LongInt): LongInt;
|
||||
Begin
|
||||
If message = BlankT2
|
||||
Then Shapes := BlankT2Message (movePtrType (data1))
|
||||
Else Shapes := 1
|
||||
End;
|
||||
|
||||
Begin {Main}
|
||||
End. {Main}
|
78
source/twilight/jw/Shapes/Shapes.Rez
Normal file
78
source/twilight/jw/Shapes/Shapes.Rez
Normal file
@ -0,0 +1,78 @@
|
||||
#include "types.rez"
|
||||
#include "T2Common.Rez"
|
||||
|
||||
// --- custom resource type defines
|
||||
|
||||
resource rT2ModuleFlags (moduleFlags) {
|
||||
fWantFadeOut +
|
||||
fWantFadeIn +
|
||||
fWantForceGrafPortMode320
|
||||
};
|
||||
|
||||
resource rIcon (moduleIcon, $0000) {
|
||||
$8000, // kind
|
||||
$0014, // height
|
||||
$001C, // width
|
||||
|
||||
$"FFF0000000000000000000000FFF"
|
||||
$"FFF0FFFFFFFFFFFFFFFFFFFF0FFF"
|
||||
$"FFF0F000000000000000000F0FFF"
|
||||
$"FFF0F0FFFFFFFFFFFFFFFF0F0FFF"
|
||||
$"FFF0F0FF3333333333FFFF0F0FFF"
|
||||
$"FFF0F0F333333333333FFF0F0FFF"
|
||||
$"FFF0F0F333333333333FFF0F0FFF"
|
||||
$"FFF0F0F333333333333FFF0F0FFF"
|
||||
$"FFF0F0FF3333333333FFFF0F0FFF"
|
||||
$"FFF0F0FFFFFFFFFFFFFFFF0F0FFF"
|
||||
$"FFF0F0FFFFFFFFFFFFFFFF0F0FFF"
|
||||
$"FFF0F000000000000000000F0FFF"
|
||||
$"FFF0FFFFFFFFFFFFFFFFAFFF0FFF"
|
||||
$"FFF0000000000000000000000FFF"
|
||||
$"FFFF0FFFFFFFFFFFFFFFFFF0FFFF"
|
||||
$"FFFF0FFFFFFFFFFFFFFFFFF0FFFF"
|
||||
$"FFFF0FF4AFFFFFFFFFFFFFF0FFFF"
|
||||
$"FFFF0CCCCCCCCCCCCCCCCCC0FFFF"
|
||||
$"FFFF0FFFFFFFFFFFFFFFAFF0FFFF"
|
||||
$"FFFF00000000000000000000FFFF",
|
||||
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000";
|
||||
};
|
||||
|
||||
resource rPString (moduleName, $0000) {
|
||||
"Shapes"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2 (moduleMessage, $0000) {
|
||||
TBCenterJust
|
||||
TBForeColor TBColor4
|
||||
"\n"
|
||||
"This module generates random QuickDraw II shapes and draws "
|
||||
"them on the screen."
|
||||
};
|
||||
|
||||
|
||||
resource rVersion (moduleVersion, $0000) {
|
||||
{1, 0, 0, beta, 1},
|
||||
verUS,
|
||||
"Twilight II Shapes Module",
|
||||
"Copyright 1992 by Josef W. Wankerl"
|
||||
};
|
5
source/twilight/jw/T2.35
Normal file
5
source/twilight/jw/T2.35
Normal file
@ -0,0 +1,5 @@
|
||||
The About Module button really freaks out with the two italic items.
|
||||
|
||||
Putting the cursor in the "don't blank" corner causes file transfers (using AWGS & Transfusion) to go haywire.
|
||||
|
||||
O}her than that, everything seems to be OK. ~-) Sure is nice to get short lists of things, eh? There are still a couple of things I'd like to see, like being able to turn T2 off automatically when I go to P8.
|
7
source/twilight/jw/T2.New
Normal file
7
source/twilight/jw/T2.New
Normal file
@ -0,0 +1,7 @@
|
||||
I'm Running Out Of T2 Titles To Put On These Things: :-)
|
||||
|
||||
When the front window changes during a screen blank (normal OR background) un-blank the screen. Whenever a server shuts down, I never know what's going on. :-) This is mostly a cosmetic fix.
|
||||
|
||||
Enclosed in this archive is the latest-gratest Messages blanker. The blanker module *should* work with the changed d34 HitT2 message, but since I don't have it, I can't test it. :-) The Messages blanker is pretty much in its final form, complete with lots of silly comments. Go ahead and distribute this guy with d34 if you want. You can either distribute it in its entirety, or you can cut between the two "cut here" comments to distribute just an ORCA/C blanker shell. I purposefully put the second "cut here" above the statements that perform a five second wait so other people can see the "correct" way to do it. :-) Oh yeah, make sure that the T2.h file is in the 13:ORCACDefs: folder before you recompile.
|
||||
|
||||
I would have also sent you a new Shapes module, but I don't have the new 6.0 interfaces for ORCA/Pascal, so my RMLoadNamedResource calls don't compile and I haven't had the heart to go in and change the interfaces manually yet. The Shapes module should work under d34 since it doesn't need the HitT2 message.
|
187
source/twilight/jw/cccp/CCCP.H
Normal file
187
source/twilight/jw/cccp/CCCP.H
Normal file
@ -0,0 +1,187 @@
|
||||
/********************************************
|
||||
; File: CCCP.h
|
||||
;
|
||||
; By: Josef W. Wankerl
|
||||
;
|
||||
; Copyright EGO Systems 1993
|
||||
; All Rights Reserved
|
||||
;
|
||||
********************************************/
|
||||
|
||||
#ifndef __TYPES__
|
||||
#include <TYPES.h>
|
||||
#endif
|
||||
|
||||
#ifndef __LIST__
|
||||
#include <LIST.h>
|
||||
#endif
|
||||
|
||||
#ifndef __GSOS__
|
||||
#include <GSOS.h>
|
||||
#endif
|
||||
|
||||
#ifndef __STDFILE__
|
||||
#include <STDFILE.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CCCP__
|
||||
#define __CCCP__
|
||||
|
||||
/* target name for SendRequest to Cool Cursor */
|
||||
#define NAME_OF_CCCP "\pEGO Systems~Cool Cursor~"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* SendRequest codes sent to Cool Cursor (target = "EGO Systems~Cool Cursor~") */
|
||||
#define cccpAreYouThere 0x8000
|
||||
#define cccpGetActive 0x8001
|
||||
#define cccpSetActive 0x8002
|
||||
#define cccpGetSpeed 0x8003
|
||||
#define cccpSetSpeed 0x8004
|
||||
#define cccpGetAppPriority 0x8005
|
||||
#define cccpSetAppPriority 0x8006
|
||||
#define cccpGetSafe 0x8007
|
||||
#define cccpSetSafe 0x8008
|
||||
#define cccpGetCursorList 0x8009
|
||||
#define cccpSetCursorList 0x800A
|
||||
#define cccpGetCursor 0x800B
|
||||
#define cccpSetCursor 0x800C
|
||||
#define cccpLoadCursor 0x800D
|
||||
#define cccpDisposeCursor 0x800E
|
||||
#define cccpAnimateCursor 0x800F
|
||||
#define cccpGetCursorType 0x8010
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* Cool Cursor constants */
|
||||
|
||||
#define cccpMode320 0x0000
|
||||
#define cccpMode640 0x0001
|
||||
|
||||
#define cccpPointer 0x0000
|
||||
#define cccpWait 0x0001
|
||||
#define cccpIBeam 0x0002
|
||||
#define cccpCustom 0x0003
|
||||
#define cccpOther 0x0004
|
||||
|
||||
#define rSmooth 0x0001
|
||||
|
||||
#define cccpVersionError 0xCCC9
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* Cool Cursor DataIn Structures */
|
||||
|
||||
typedef struct cccpSetActiveIn
|
||||
{
|
||||
Word cccpActiveFlag;
|
||||
} cccpSetActiveIn, *cccpSetActiveInPtr;
|
||||
|
||||
typedef struct cccpSetSpeedIn
|
||||
{
|
||||
Word cccpSpeed;
|
||||
} cccpSetSpeedIn, *cccpSetSpeedInPtr;
|
||||
|
||||
typedef struct cccpSetAppPriorityIn
|
||||
{
|
||||
Word cccpPriority;
|
||||
} cccpSetAppPriorityIn, *cccpSetAppPriorityInPtr;
|
||||
|
||||
typedef struct cccpSetSafeIn
|
||||
{
|
||||
Word cccpSafeFlag;
|
||||
} cccpSetSafeIn, *cccpSetSafeInPtr;
|
||||
|
||||
typedef struct cccpSetCursorListIn
|
||||
{
|
||||
Handle cccpCursorListHandle;
|
||||
} cccpSetCursorListIn, *cccpSetCursorListInPtr;
|
||||
|
||||
typedef struct cccpGetCursorIn
|
||||
{
|
||||
Word cccpCursorMode;
|
||||
} cccpGetCursorIn, *cccpGetCursorInPtr;
|
||||
|
||||
typedef struct cccpSetCursorIn
|
||||
{
|
||||
Word cccpCursorMode;
|
||||
Handle cccpMasterHandle;
|
||||
} cccpSetCursorIn, *cccpSetCursorInPtr;
|
||||
|
||||
typedef struct cccpLoadCursorIn
|
||||
{
|
||||
GSString255Ptr cccpPathnamePtr;
|
||||
LongWord cccpCursorStartID;
|
||||
} cccpLoadCursorIn, *cccpLoadCursorInPtr;
|
||||
|
||||
typedef struct cccpDisposeCursorIn
|
||||
{
|
||||
Handle cccpMasterHandle;
|
||||
} cccpDisposeCursorIn, *cccpDisposeCursorInPtr;
|
||||
|
||||
typedef struct cccpAnimateCursorIn
|
||||
{
|
||||
Handle cccpMasterHandle;
|
||||
} cccpAnimateCursorIn, *cccpAnimateCursorInPtr;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* Cool Cursor DataOut Structures */
|
||||
|
||||
typedef struct cccpAreYouThereOut
|
||||
{
|
||||
Word recvCount;
|
||||
Word cccpID;
|
||||
LongWord cccpVersion;
|
||||
} cccpAreYouThereOut, *cccpAreYouThereOutPtr;
|
||||
|
||||
typedef struct cccpGetActiveOut
|
||||
{
|
||||
Word recvCount;
|
||||
Word cccpActiveFlag;
|
||||
} cccpGetActiveOut, *cccpGetActiveOutPtr;
|
||||
|
||||
typedef struct cccpGetSpeedOut
|
||||
{
|
||||
Word recvCount;
|
||||
Word cccpSpeed;
|
||||
} cccpGetSpeedOut, *cccpGetSpeedOutPtr;
|
||||
|
||||
typedef struct cccpGetAppPriorityOut
|
||||
{
|
||||
Word recvCount;
|
||||
Word cccpPriority;
|
||||
} cccpGetAppPriorityOut, *cccpGetAppPriorityOutPtr;
|
||||
|
||||
typedef struct cccpGetSafeOut
|
||||
{
|
||||
Word recvCount;
|
||||
Word cccpSafeFlag;
|
||||
} cccpGetSafeOut, *cccpGetSafeOutPtr;
|
||||
|
||||
typedef struct cccpGetCursorListOut
|
||||
{
|
||||
Word recvCount;
|
||||
Handle cccpCursorListHandle;
|
||||
} cccpGetCursorListOut, *cccpGetCursorListOutPtr;
|
||||
|
||||
typedef struct cccpGetCursorOut
|
||||
{
|
||||
Word recvCount;
|
||||
Handle cccpMasterHandle;
|
||||
} cccpGetCursorOut, *cccpGetCursorOutPtr;
|
||||
|
||||
typedef struct cccpLoadCursorOut
|
||||
{
|
||||
Word recvCount;
|
||||
Word cccpError;
|
||||
Handle cccpMasterHandle;
|
||||
} cccpLoadCursorOut, *cccpLoadCursorOutPtr;
|
||||
|
||||
typedef struct cccpGetCursorTypeOut
|
||||
{
|
||||
Word recvCount;
|
||||
Word cccpCursorType;
|
||||
} cccpGetCursorTypeOut, *cccpGetCursorTypeOutPtr;
|
||||
|
||||
#endif
|
180
source/twilight/jw/cccp/CCCP.PAS
Normal file
180
source/twilight/jw/cccp/CCCP.PAS
Normal file
@ -0,0 +1,180 @@
|
||||
{$keep 'CCCPPAS'}
|
||||
|
||||
Unit CCCP;
|
||||
|
||||
Interface
|
||||
|
||||
{********************************************************
|
||||
*
|
||||
* Cool Cursor Interface File
|
||||
*
|
||||
* By: Josef W. Wankerl
|
||||
*
|
||||
* Other USES Files Needed: Common
|
||||
*
|
||||
* Other Tool Sets Needed: - None -
|
||||
*
|
||||
* Copyright 1993
|
||||
* By EGO Systems
|
||||
* All Rights Reserved
|
||||
*
|
||||
*********************************************************}
|
||||
|
||||
Uses
|
||||
Common;
|
||||
|
||||
Const
|
||||
{ target name for SendRequest to Cool Cursor }
|
||||
name_of_cccp = 'EGO Systems~Cool Cursor~';
|
||||
|
||||
{ SendRequest codes sent to Cool Cursor (target = "EGO Systems~Cool Cursor~") }
|
||||
cccpAreYouThere = $8000;
|
||||
cccpGetActive = $8001;
|
||||
cccpSetActive = $8002;
|
||||
cccpGetSpeed = $8003;
|
||||
cccpSetSpeed = $8004;
|
||||
cccpGetAppPriority = $8005;
|
||||
cccpSetAppPriority = $8006;
|
||||
cccpGetSafe = $8007;
|
||||
cccpSetSafe = $8008;
|
||||
cccpGetCursorList = $8009;
|
||||
cccpSetCursorList = $800A;
|
||||
cccpGetCursor = $800B;
|
||||
cccpSetCursor = $800C;
|
||||
cccpLoadCursor = $800D;
|
||||
cccpDisposeCursor = $800E;
|
||||
cccpAnimateCursor = $800F;
|
||||
cccpGetCursortype = $8010;
|
||||
|
||||
{ Cool Cursor constants }
|
||||
|
||||
cccpMode320 = $0000;
|
||||
cccpMode640 = $0001;
|
||||
|
||||
cccpPointer = $0000;
|
||||
cccpWait = $0001;
|
||||
cccpIBeam = $0002;
|
||||
cccpCustom = $0003;
|
||||
cccpOther = $0004;
|
||||
|
||||
rSmooth = $0001;
|
||||
|
||||
cccpVersionError = $CCC9;
|
||||
|
||||
Type
|
||||
{ Cool Cursor DataIn Structures }
|
||||
|
||||
cccpSetActiveIn = Record
|
||||
cccpActiveFlag : Integer
|
||||
End;
|
||||
cccpSetActiveInPtr = ^cccpSetActiveIn;
|
||||
|
||||
cccpSetSpeedIn = Record
|
||||
cccpSpeed : Integer
|
||||
End;
|
||||
cccpSetSpeedInPtr = ^cccpSetSpeedIn;
|
||||
|
||||
cccpSetAppPriorityIn = Record
|
||||
cccpPriority : Integer
|
||||
End;
|
||||
cccpSetAppPriorityInPtr = ^cccpSetAppPriorityIn;
|
||||
|
||||
cccpSetSafeIn = Record
|
||||
cccpSafeFlag : Integer
|
||||
End;
|
||||
cccpSetSafeInPtr = ^cccpSetSafeIn;
|
||||
|
||||
cccpSetCursorListIn = Record
|
||||
cccpCursorListHandle : Handle
|
||||
End;
|
||||
cccpSetCursorListInPtr = ^cccpSetCursorListIn;
|
||||
|
||||
cccpGetCursorIn = Record
|
||||
cccpCursorMode : Integer
|
||||
End;
|
||||
cccpGetCursorInPtr = ^cccpGetCursorIn;
|
||||
|
||||
cccpSetCursorIn = Record
|
||||
cccpCursorMode : Integer;
|
||||
cccpMasterHandle : Handle
|
||||
End;
|
||||
cccpSetCursorInPtr = ^cccpSetCursorIn;
|
||||
|
||||
cccpLoadCursorIn = Record
|
||||
cccpPathnamePtr : gsosInStringPtr;
|
||||
cccpCursorStartID : LongInt
|
||||
End;
|
||||
cccpLoadCursorInPtr = ^cccpLoadCursorIn;
|
||||
|
||||
cccpDisposeCursorIn = Record
|
||||
cccpMasterHandle : Handle
|
||||
End;
|
||||
cccpDisposeCursorInPtr = ^cccpDisposeCursorIn;
|
||||
|
||||
cccpAnimateCursorIn = Record
|
||||
cccpMasterHandle : Handle
|
||||
End;
|
||||
cccpAnimateCursorInPtr = ^cccpAnimateCursorIn;
|
||||
|
||||
{*****************************************************************************}
|
||||
|
||||
{ Cool Cursor DataOut Structures }
|
||||
|
||||
cccpAreYouThereOut = Record
|
||||
recvCount : Integer;
|
||||
cccpID : Integer;
|
||||
cccpVersion : LongInt
|
||||
End;
|
||||
cccpAreYouThereOutPtr = ^cccpAreYouThereOut;
|
||||
|
||||
cccpGetActiveOut = Record
|
||||
recvCount : Integer;
|
||||
cccpActiveFlag : Integer
|
||||
End;
|
||||
cccpGetActiveOutPtr = ^cccpGetActiveOut;
|
||||
|
||||
cccpGetSpeedOut = Record
|
||||
recvCount : Integer;
|
||||
cccpSpeed : Integer
|
||||
End;
|
||||
cccpGetSpeedOutPtr = ^cccpGetSpeedOut;
|
||||
|
||||
cccpGetAppPriorityOut = Record
|
||||
recvCount : Integer;
|
||||
cccpPriority : Integer
|
||||
End;
|
||||
cccpGetAppPriorityOutPtr = ^cccpGetAppPriorityOut;
|
||||
|
||||
cccpGetSafeOut = Record
|
||||
recvCount : Integer;
|
||||
cccpSafeFlag : Integer
|
||||
End;
|
||||
cccpGetSafeOutPtr = ^cccpGetSafeOut;
|
||||
|
||||
cccpGetCursorListOut = Record
|
||||
recvCount : Integer;
|
||||
cccpCursorListHandle : Handle
|
||||
End;
|
||||
cccpGetCursorListOutPtr = ^cccpGetCursorListOut;
|
||||
|
||||
cccpGetCursorOut = Record
|
||||
recvCount : Integer;
|
||||
cccpMasterHandle : Handle
|
||||
End;
|
||||
cccpGetCursorOutPtr = ^cccpGetCursorOut;
|
||||
|
||||
cccpLoadCursorOut = Record
|
||||
recvCount : Integer;
|
||||
cccpError : Integer;
|
||||
cccpMasterHandle : Handle
|
||||
End;
|
||||
cccpLoadCursorOutPtr = ^cccpLoadCursorOut;
|
||||
|
||||
cccpGetCursorTypeOut = Record
|
||||
recvCount : Integer;
|
||||
cccpCursorType : Integer
|
||||
End;
|
||||
cccpGetCursorTypeOutPtr = ^cccpGetCursorTypeOut;
|
||||
|
||||
Implementation
|
||||
End.
|
209
source/twilight/jw/cccp/CCCP.Requests
Normal file
209
source/twilight/jw/cccp/CCCP.Requests
Normal file
@ -0,0 +1,209 @@
|
||||
Cool Cursor v2.0 Request Information
|
||||
By Josef W. Wankerl
|
||||
Copyright © 1993 by EGO Systems
|
||||
|
||||
Please remember, Cool Cursor is NOT public domain or shareware. If you give copies of Cool Cursor (or this documentation) away, we will not be able to stay in business! It really is that simple!
|
||||
|
||||
A lot of the hard work that Cool Cursor does is now handled by a request procedure. The Cool Cursor control panel makes extensive use of the request handler code to configure Cool Cursor.
|
||||
|
||||
For convenience, I have created several interface files for Cool Cursor which define constants and structures for various languages. Using the interface files should simplify calling the Cool Cursor request handler. For ORCA/M, you'll need to copy the E16.CCCP file to your 13:AInclude directory. Simply put a Copy 13:AInclude:E16.CCCP line at the start of your program that will be making calls to the Cool Cursor request handler. For ORCA/C, youÕll need to copy the CCCP.H file to your 13:ORCACDefs directory. Simply put a #include <CCCP.h> line at the start of your program that will be making calls to the Cool Cursor request handler. For ORCA/Pascal, youÕll need to copy the CCCP.INT file to your 13:ORCAPascalDefs directory. Simply put a Uses CCCP line with the rest of your uses for your program which will be making calls to the Cool Cursor request handler. The interface files for ORCA/C and ORCA/Pascal (CCCP.H and CCCP.PAS) contain the information on the constants and structures that you will need to know in order to send requests to the Cool Cursor request handler.
|
||||
|
||||
The requests that Cool Cursor accepts are:
|
||||
|
||||
reqCode Name
|
||||
$8000 cccpAreYouThere
|
||||
$8001 cccpGetActive
|
||||
$8002 cccpSetActive
|
||||
$8003 cccpGetSpeed
|
||||
$8004 cccpSetSpeed
|
||||
$8005 cccpGetAppPriority
|
||||
$8006 cccpSetAppPriority
|
||||
$8007 cccpGetSafe
|
||||
$8008 cccpSetSafe
|
||||
$8009 cccpGetCursorList
|
||||
$800A cccpSetCursorList
|
||||
$800B cccpGetCursor
|
||||
$800C cccpSetCursor
|
||||
$800D cccpLoadCursor
|
||||
$800E cccpDisposeCursor
|
||||
$800F cccpAnimateCursor
|
||||
$8010 cccpGetCursorState
|
||||
|
||||
Master Handle
|
||||
A lot of the requests that Cool Cursor handles require, or return, a master handle. A master handle is a handle that contains all the information necessary for a cursor animation. The first word in the handle is a count of the number of cursor frames in the animation. After the count word, there are entries for each cursor frame. A cursor frame entry consists of two elements: a handle to the actual cursor data, and a smooth animation flag word. Each cursor entry is six bytes long (four bytes for the cursor data handle and two bytes for the smooth flag word). The smooth flag word determines whether the cursorÕs mask, hot spot, and size are the same as the previous cursor frame.
|
||||
|
||||
cccpAreYouThere $8000
|
||||
If Cool Cursor is present, it always accepts this request and returns no error.
|
||||
|
||||
dataIn:
|
||||
Reserved.
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpID WordÑPermanent memory ID for Cool Cursor
|
||||
$04 cccpVersion LongÑCool CursorÕs version number (from its rVersion resource)
|
||||
|
||||
cccpGetActive $8001
|
||||
This tells Cool Cursor to return its active setting. When the active flag is true, whenever a program issues the WaitCursor call, Cool Cursor will present an animated cursor instead of the static watch cursor. When the active flag is not true, Cool Cursor will not automatically animate the cursor, however, requests will still be accepted and acted on by the Cool Cursor request handler (except for requests to animate the cursor).
|
||||
|
||||
dataIn:
|
||||
Reserved.
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpActiveFlag WordÑCool Cursor active flag
|
||||
|
||||
cccpSetActive $8002
|
||||
This tells Cool Cursor to change its active setting. When the active flag is true, whenever a program issues the WaitCursor call, Cool Cursor will present an animated cursor instead of the static watch cursor. When the active flag is not true, Cool Cursor will not automatically animate the cursor, however, requests will still be accepted and acted on by the Cool Cursor request handler (except for requests to animate the cursor).
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpActiveFlag WordÑNew Cool Cursor active flag
|
||||
|
||||
dataOut:
|
||||
Reserved.
|
||||
|
||||
cccpGetSpeed $8003
|
||||
This tells Cool Cursor to return the minimum time (in 1/60 second increments) between cursor animation frames.
|
||||
|
||||
dataIn:
|
||||
Reserved.
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpSpeed WordÑAnimation speed
|
||||
|
||||
cccpSetSpeed $8004
|
||||
This tells Cool Cursor to change the minimum time (in 1/60 second increments) between cursor animation frames.
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpSpeed WordÑNew animation speed
|
||||
|
||||
dataOut:
|
||||
Reserved.
|
||||
|
||||
cccpGetAppPriority $8005
|
||||
This returns how the Cool Cursor request procedure handles a finderSaysBeforeOpen request. If cccpPriority is non-zero, then all finderSaysBeforeOpen requests are being ignored.
|
||||
|
||||
dataIn:
|
||||
Reserved.
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpPriority WordÑApplication gets files first flag
|
||||
|
||||
cccpSetAppPriority $8006
|
||||
This tells the Cool Cursor request procedure how to handle a finderSaysBeforeOpen request. If cccpPriority is non-zero, then all finderSaysBeforeOpen requests are ignored.
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpPriority WordÑNew applications get files first flag
|
||||
|
||||
dataOut buffer:
|
||||
Reserved.
|
||||
|
||||
cccpGetSafe $8007
|
||||
This tells Cool Cursor to return the animate only when safe flag. If cccpSafeFlag is non-zero, then Cool Cursor will attempt to animate the cursor even if the system busy flag is set, but only when the busy level is the same as when the animation started.
|
||||
|
||||
dataIn:
|
||||
Reserved.
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpSafe WordÑAnimate only when safe flag
|
||||
|
||||
cccpSetSafe $8008
|
||||
This tells Cool Cursor to change the animate only when safe flag. If cccpSafeFlag is non-zero, then Cool Cursor will attempt to animate the cursor even if the system busy flag is set, but only when the busy level is the same as when the animation started.
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpSafe WordÑNew animate only when safe flag
|
||||
|
||||
dataOut:
|
||||
Reserved.
|
||||
|
||||
cccpGetCursorList $8009
|
||||
This tells Cool Cursor to return the handle to its list of random cursor filenames. The handle to this list must not be disposed of. The list of random cursor filenames is in the rWStringList format. To get the pathname for a Cool Cursor document file, prepend *:System:CDevs:Cursors: to the filename.
|
||||
|
||||
dataIn:
|
||||
Reserved.
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpCursorListHandle LongÑRandom cursor filename list handle
|
||||
|
||||
cccpSetCursorList $800A
|
||||
This is used to tell Cool Cursor about a new list of random cursor filenames. The old list of random cursor filenames handle is disposed of by the cccpSetCursorList call. The memory ID of the handle passed to cccpCursorListHandle will be changed to Cool CursorÕs permanent ID. The list of random cursor filenames should be in the rWStringList format. To get the pathname for a Cool Cursor document file, prepend *:System:CDevs:Cursors: to the filename.
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpCursorListHandle LongÑNew random cursor filename list handle
|
||||
|
||||
dataOut:
|
||||
Reserved.
|
||||
|
||||
cccpGetCursor $800B
|
||||
This tells Cool Cursor to return the master handle for a WaitCursor animation. The handle to this list must not be disposed of. The cccpCursorMode parameter determines which master cursor to return. When cccpCursorMode is zero, the 320 mode master cursor handle is returned. When cccpCursorMode is non-zero, the 640 mode master cursor handle is returned.
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpCursorMode WordÑQuickDraw II mode for the cursor
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpMasterHandle LongÑAnimation master handle
|
||||
|
||||
cccpSetCursor $800C
|
||||
This tells Cool Cursor to set the master handle for a WaitCursor animation. The old master handle (and all the information relating to the master handle) is disposed of by the cccpSetCursor call. The memory ID of the handle passed to cccpMasterHandle will be changed to Cool CursorÕs permanent ID, as well as all the handles relating to the master handle. The cccpCursorMode parameter determines which master cursor to set. When cccpCursorMode is zero, the 320 mode master cursor handle is set. When cccpCursorMode is non-zero, the 640 mode master cursor handle is set.
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpCursorMode WordÑQuickDraw II mode for the cursor
|
||||
$02 cccpMasterHandle LongÑNew animation master handle
|
||||
|
||||
dataOut:
|
||||
Reserved.
|
||||
|
||||
cccpLoadCursor $800D
|
||||
This tells Cool Cursor to load a cursor animation. The entire animation will be in all unlocked handles and the animation will be returned in an unlocked master handle. The memory ID for all the handles will be Cool CursorÕs permanent memory ID. If the cccpPathnamePtr is NIL, the animation is assumed to be in the current resource chain and no version resource validation is performed. If the cccpPathnamePtr is not NIL, the animation is assumed to be in a Cool Cursor document file and version resource validation is performed. If you donÕt want version validation to be performed, set bit 31 of the cccpPathnamePtr parameter. If a version error is encountered (the rVersion resource contains a version that Cool Cursor doesnÕt know aboutÑan absent rVersion resource indicates a version 1.0 Cool Cursor document file), the cccpError field will contain the cccpVersionError code ($CCC9 Ñ looks ominously like CCCP, doesnÕt it?).
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpPathnamePtr LongÑPointer to the pathname to load the animation from
|
||||
$04 cccpCursorStartID LongÑResource ID for first cursor in the animaton
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpError WordÑError code for any error that occurred while loading
|
||||
$04 cccpMasterHandle LongÑAnimation master handle
|
||||
|
||||
cccpDisposeCursor $800E
|
||||
This tells Cool Cursor to dispose of all the information related to a master handle and then the master handle itself. This is useful for when a program calls cccpLoadCursor to load a custom animation. This request should not be used to dispose of a master handle returned from cccpGetCursor. Since animations loaded with cccpLoadCursor have Cool CursorÕs permanent memory ID attached to them, you should make certain that you are disposing of the master handle when you are through with it.
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpMasterHandle LongÑAnimation master handle
|
||||
|
||||
dataOut:
|
||||
Reserved.
|
||||
|
||||
cccpAnimateCursor $800F
|
||||
This tells Cool Cursor to begin a custom cursor animation. This is useful for when a program wants to animate a custom cursor. The cursor should first be loaded with the cccpLoadCursor request. After the cccpAnimateCursor request is made, all the handles relating to the master handle will be locked (except for the master handle, which should remain unlocked). The handles will remain locked until the animation is finished, at which point, they will all be unlocked.
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpMasterHandle LongÑAnimation master handle
|
||||
|
||||
dataOut:
|
||||
Reserved.
|
||||
|
||||
cccpGetCursorState $8010
|
||||
This tells Cool Cursor to return the type of the current cursor. The values for cccpCursorType are:
|
||||
|
||||
cccpCursorType Name Meaning
|
||||
$0000 cccpPointer Cursor is the pointer (arrow) cursor
|
||||
$0001 cccpWait Cursor is the watch cursor or currently animating
|
||||
$0002 cccpIBeam Cursor is the I-Beam cursor
|
||||
$0003 cccpCustom Cursor is animating because of the cccpAnimateCursor request
|
||||
$0004 cccpOther Cursor is an unknown application-specific cursor
|
||||
|
||||
dataIn:
|
||||
Reserved.
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpCursorType WordÑCurrent cursor type
|
||||
|
||||
osef W. Wankerl
|
||||
Technical Editor of GS+ Magazine
|
102
source/twilight/jw/cccp/E16.CCCP
Normal file
102
source/twilight/jw/cccp/E16.CCCP
Normal file
@ -0,0 +1,102 @@
|
||||
; File: E16.CCCP
|
||||
;
|
||||
; By: Josef W. Wankerl
|
||||
;
|
||||
; Copyright EGO Systems 1993
|
||||
; All Rights Reserved
|
||||
;
|
||||
|
||||
; SendRequest codes sent to Cool Cursor (target = "EGO Systems~Cool Cursor~")
|
||||
cccpAreYouThere gequ $8000
|
||||
cccpGetActive gequ $8001
|
||||
cccpSetActive gequ $8002
|
||||
cccpGetSpeed gequ $8003
|
||||
cccpSetSpeed gequ $8004
|
||||
cccpGetAppPriority gequ $8005
|
||||
cccpSetAppPriority gequ $8006
|
||||
cccpGetSafe gequ $8007
|
||||
cccpSetSafe gequ $8008
|
||||
cccpGetCursorList gequ $8009
|
||||
cccpSetCursorList gequ $800A
|
||||
cccpGetCursor gequ $800B
|
||||
cccpSetCursor gequ $800C
|
||||
cccpLoadCursor gequ $800D
|
||||
cccpDisposeCursor gequ $800E
|
||||
cccpAnimateCursor gequ $800F
|
||||
cccpGetCursorType gequ $8010
|
||||
|
||||
; *****************************************************************************
|
||||
|
||||
; Cool Cursor constants
|
||||
|
||||
cccpMode320 gequ $0000
|
||||
cccpMode640 gequ $0001
|
||||
|
||||
cccpPointer gequ $0000
|
||||
cccpWait gequ $0001
|
||||
cccpIBeam gequ $0002
|
||||
cccpCustom gequ $0003
|
||||
cccpOther gequ $0004
|
||||
|
||||
rSmooth gequ $0001
|
||||
|
||||
cccpVersionError gequ $CCC9
|
||||
|
||||
; *****************************************************************************
|
||||
|
||||
; Cool Cursor dataIn structure offsets
|
||||
|
||||
occcpActiveFlagSetActiveIn gequ $0000
|
||||
|
||||
occcpSpeedSetSpeedIn gequ $0000
|
||||
|
||||
occcpPrioritySetAppPriorityIn gequ $0000
|
||||
|
||||
occcpSpeedSetSafeIn gequ $0000
|
||||
|
||||
occcpCursorListHandleSetCursorListIn gequ $0000
|
||||
|
||||
occcpCursorModeGetCursorIn gequ $0000
|
||||
|
||||
occcpCursorModeSetCursorIn gequ $0000
|
||||
occcpMasterHandleSetCursorIn gequ occcpCursorModeSetCursorIn+2
|
||||
|
||||
occcpPathnamePtrLoadCursorIn gequ $0000
|
||||
occcpCursorStartIDLoadCursorIn gequ occcpPathnamePtrLoadCursorIn+4
|
||||
|
||||
occcpMasterHandleDisposeCursorIn gequ $0000
|
||||
|
||||
occcpMasterHandleAnimateCursorIn gequ $0000
|
||||
|
||||
; *****************************************************************************
|
||||
|
||||
; Cool Cursor dataOut structure offsets
|
||||
|
||||
orecvCountAreYouThereOut gequ $0000
|
||||
occcpIDAreYouThereOut gequ orecvCountAreYouThereOut+2
|
||||
occcpVersionAreYouThereOut gequ occcpIDAreYouThereOut+2
|
||||
|
||||
orecvCountGetActiveOut gequ $0000
|
||||
occcpActiveFlagGetActiveOut gequ orecvCountGetActiveOut+2
|
||||
|
||||
orecvCountGetSpeedOut gequ $0000
|
||||
occcpSpeedGetSpeedOut gequ orecvCountGetSpeedOut+2
|
||||
|
||||
orecvCountGetAppPriorityOut gequ $0000
|
||||
occcpPriorityGetAppPriorityOut gequ orecvCountGetAppPriorityOut+2
|
||||
|
||||
orecvCountGetSafeOut gequ $0000
|
||||
occcpSafeFlagGetSafeOut gequ orecvCountGetSafeOut+2
|
||||
|
||||
orecvCountGetCursorListOut gequ $0000
|
||||
occcpCursorListHandleGetCursorListOut gequ orecvCountGetCursorListOut+2
|
||||
|
||||
orecvCountGetCursorOut gequ $0000
|
||||
occcpMasterHandleGetCursorOut gequ orecvCountGetCursorOut+2
|
||||
|
||||
orecvCountLoadCursorOut gequ $0000
|
||||
occcpErrorLoadCursorOut gequ orecvCountLoadCursorOut+2
|
||||
occcpMasterHandleLoadCursorOut gequ occcpErrorLoadCursorOut+2
|
||||
|
||||
orecvCountGetCursorStateOut gequ $0000
|
||||
occcpCursorTypeGetCursorStateOut gequ orecvCountGetCursorStateOut+2
|
209
source/twilight/jw/cccp/c
Normal file
209
source/twilight/jw/cccp/c
Normal file
@ -0,0 +1,209 @@
|
||||
Cool Cursor v2.0 Request Information
|
||||
By Josef W. Wankerl
|
||||
Copyright © 1993 by EGO Systems
|
||||
|
||||
Please remember, Cool Cursor is NOT public domain or shareware. If you give copies of Cool Cursor (or this documentation) away, we will not be able to stay in business! It really is that simple!
|
||||
|
||||
A lot of the hard work that Cool Cursor does is now handled by a request procedure. The Cool Cursor control panel makes extensive use of the request handler code to configure Cool Cursor.
|
||||
|
||||
For convenience, I have created several interface files for Cool Cursor which define constants and structures for various languages. Using the interface files should simplify calling the Cool Cursor request handler. For ORCA/M, you'll need to copy the E16.CCCP file to your 13:AInclude directory. Simply put a Copy 13:AInclude:E16.CCCP line at the start of your program that will be making calls to the Cool Cursor request handler. For ORCA/C, youÕll need to copy the CCCP.H file to your 13:ORCACDefs directory. Simply put a #include <CCCP.h> line at the start of your program that will be making calls to the Cool Cursor request handler. For ORCA/Pascal, youÕll need to copy the CCCP.INT file to your 13:ORCAPascalDefs directory. Simply put a Uses CCCP line with the rest of your uses for your program which will be making calls to the Cool Cursor request handler. The interface files for ORCA/C and ORCA/Pascal (CCCP.H and CCCP.PAS) contain the information on the constants and structures that you will need to know in order to send requests to the Cool Cursor request handler.
|
||||
|
||||
The requests that Cool Cursor accepts are:
|
||||
|
||||
reqCode Name
|
||||
$8000 cccpAreYouThere
|
||||
$8001 cccpGetActive
|
||||
$8002 cccpSetActive
|
||||
$8003 cccpGetSpeed
|
||||
$8004 cccpSetSpeed
|
||||
$8005 cccpGetAppPriority
|
||||
$8006 cccpSetAppPriority
|
||||
$8007 cccpGetSafe
|
||||
$8008 cccpSetSafe
|
||||
$8009 cccpGetCursorList
|
||||
$800A cccpSetCursorList
|
||||
$800B cccpGetCursor
|
||||
$800C cccpSetCursor
|
||||
$800D cccpLoadCursor
|
||||
$800E cccpDisposeCursor
|
||||
$800F cccpAnimateCursor
|
||||
$8010 cccpGetCursorState
|
||||
|
||||
Master Handle
|
||||
A lot of the requests that Cool Cursor handles require, or return, a master handle. A master handle is a handle that contains all the information necessary for a cursor animation. The first word in the handle is a count of the number of cursor frames in the animation. After the count word, there are entries for each cursor frame. A cursor frame entry consists of two elements: a handle to the actual cursor data, and a smooth animation flag word. Each cursor entry is six bytes long (four bytes for the cursor data handle and two bytes for the smooth flag word). The smooth flag word determines whether the cursorÕs mask, hot spot, and size are the same as the previous cursor frame.
|
||||
|
||||
cccpAreYouThere $8000
|
||||
If Cool Cursor is present, it always accepts this request and returns no error.
|
||||
|
||||
dataIn:
|
||||
Reserved.
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpID WordÑPermanent memory ID for Cool Cursor
|
||||
$04 cccpVersion LongÑCool CursorÕs version number (from its rVersion resource)
|
||||
|
||||
cccpGetActive $8001
|
||||
This tells Cool Cursor to return its active setting. When the active flag is true, whenever a program issues the WaitCursor call, Cool Cursor will present an animated cursor instead of the static watch cursor. When the active flag is not true, Cool Cursor will not automatically animate the cursor, however, requests will still be accepted and acted on by the Cool Cursor request handler (except for requests to animate the cursor).
|
||||
|
||||
dataIn:
|
||||
Reserved.
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpActiveFlag WordÑCool Cursor active flag
|
||||
|
||||
cccpSetActive $8002
|
||||
This tells Cool Cursor to change its active setting. When the active flag is true, whenever a program issues the WaitCursor call, Cool Cursor will present an animated cursor instead of the static watch cursor. When the active flag is not true, Cool Cursor will not automatically animate the cursor, however, requests will still be accepted and acted on by the Cool Cursor request handler (except for requests to animate the cursor).
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpActiveFlag WordÑNew Cool Cursor active flag
|
||||
|
||||
dataOut:
|
||||
Reserved.
|
||||
|
||||
cccpGetSpeed $8003
|
||||
This tells Cool Cursor to return the minimum time (in 1/60 second increments) between cursor animation frames.
|
||||
|
||||
dataIn:
|
||||
Reserved.
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpSpeed WordÑAnimation speed
|
||||
|
||||
cccpSetSpeed $8004
|
||||
This tells Cool Cursor to change the minimum time (in 1/60 second increments) between cursor animation frames.
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpSpeed WordÑNew animation speed
|
||||
|
||||
dataOut:
|
||||
Reserved.
|
||||
|
||||
cccpGetAppPriority $8005
|
||||
This returns how the Cool Cursor request procedure handles a finderSaysBeforeOpen request. If cccpPriority is non-zero, then all finderSaysBeforeOpen requests are being ignored.
|
||||
|
||||
dataIn:
|
||||
Reserved.
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpPriority WordÑApplication gets files first flag
|
||||
|
||||
cccpSetAppPriority $8006
|
||||
This tells the Cool Cursor request procedure how to handle a finderSaysBeforeOpen request. If cccpPriority is non-zero, then all finderSaysBeforeOpen requests are ignored.
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpPriority WordÑNew applications get files first flag
|
||||
|
||||
dataOut buffer:
|
||||
Reserved.
|
||||
|
||||
cccpGetSafe $8007
|
||||
This tells Cool Cursor to return the animate only when safe flag. If cccpSafeFlag is non-zero, then Cool Cursor will attempt to animate the cursor even if the system busy flag is set, but only when the busy level is the same as when the animation started.
|
||||
|
||||
dataIn:
|
||||
Reserved.
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpSafe WordÑAnimate only when safe flag
|
||||
|
||||
cccpSetSafe $8008
|
||||
This tells Cool Cursor to change the animate only when safe flag. If cccpSafeFlag is non-zero, then Cool Cursor will attempt to animate the cursor even if the system busy flag is set, but only when the busy level is the same as when the animation started.
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpSafe WordÑNew animate only when safe flag
|
||||
|
||||
dataOut:
|
||||
Reserved.
|
||||
|
||||
cccpGetCursorList $8009
|
||||
This tells Cool Cursor to return the handle to its list of random cursor filenames. The handle to this list must not be disposed of. The list of random cursor filenames is in the rWStringList format. To get the pathname for a Cool Cursor document file, prepend *:System:CDevs:Cursors: to the filename.
|
||||
|
||||
dataIn:
|
||||
Reserved.
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpCursorListHandle LongÑRandom cursor filename list handle
|
||||
|
||||
cccpSetCursorList $800A
|
||||
This is used to tell Cool Cursor about a new list of random cursor filenames. The old list of random cursor filenames handle is disposed of by the cccpSetCursorList call. The memory ID of the handle passed to cccpCursorListHandle will be changed to Cool CursorÕs permanent ID. The list of random cursor filenames should be in the rWStringList format. To get the pathname for a Cool Cursor document file, prepend *:System:CDevs:Cursors: to the filename.
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpCursorListHandle LongÑNew random cursor filename list handle
|
||||
|
||||
dataOut:
|
||||
Reserved.
|
||||
|
||||
cccpGetCursor $800B
|
||||
This tells Cool Cursor to return the master handle for a WaitCursor animation. The handle to this list must not be disposed of. The cccpCursorMode parameter determines which master cursor to return. When cccpCursorMode is zero, the 320 mode master cursor handle is returned. When cccpCursorMode is non-zero, the 640 mode master cursor handle is returned.
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpCursorMode WordÑQuickDraw II mode for the cursor
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpMasterHandle LongÑAnimation master handle
|
||||
|
||||
cccpSetCursor $800C
|
||||
This tells Cool Cursor to set the master handle for a WaitCursor animation. The old master handle (and all the information relating to the master handle) is disposed of by the cccpSetCursor call. The memory ID of the handle passed to cccpMasterHandle will be changed to Cool CursorÕs permanent ID, as well as all the handles relating to the master handle. The cccpCursorMode parameter determines which master cursor to set. When cccpCursorMode is zero, the 320 mode master cursor handle is set. When cccpCursorMode is non-zero, the 640 mode master cursor handle is set.
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpCursorMode WordÑQuickDraw II mode for the cursor
|
||||
$02 cccpMasterHandle LongÑNew animation master handle
|
||||
|
||||
dataOut:
|
||||
Reserved.
|
||||
|
||||
cccpLoadCursor $800D
|
||||
This tells Cool Cursor to load a cursor animation. The entire animation will be in all unlocked handles and the animation will be returned in an unlocked master handle. The memory ID for all the handles will be Cool CursorÕs permanent memory ID. If the cccpPathnamePtr is NIL, the animation is assumed to be in the current resource chain and no version resource validation is performed. If the cccpPathnamePtr is not NIL, the animation is assumed to be in a Cool Cursor document file and version resource validation is performed. If you donÕt want version validation to be performed, set bit 31 of the cccpPathnamePtr parameter. If a version error is encountered (the rVersion resource contains a version that Cool Cursor doesnÕt know aboutÑan absent rVersion resource indicates a version 1.0 Cool Cursor document file), the cccpError field will contain the cccpVersionError code ($CCC9 Ñ looks ominously like CCCP, doesnÕt it?).
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpPathnamePtr LongÑPointer to the pathname to load the animation from
|
||||
$04 cccpCursorStartID LongÑResource ID for first cursor in the animaton
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpError WordÑError code for any error that occurred while loading
|
||||
$04 cccpMasterHandle LongÑAnimation master handle
|
||||
|
||||
cccpDisposeCursor $800E
|
||||
This tells Cool Cursor to dispose of all the information related to a master handle and then the master handle itself. This is useful for when a program calls cccpLoadCursor to load a custom animation. This request should not be used to dispose of a master handle returned from cccpGetCursor. Since animations loaded with cccpLoadCursor have Cool CursorÕs permanent memory ID attached to them, you should make certain that you are disposing of the master handle when you are through with it.
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpMasterHandle LongÑAnimation master handle
|
||||
|
||||
dataOut:
|
||||
Reserved.
|
||||
|
||||
cccpAnimateCursor $800F
|
||||
This tells Cool Cursor to begin a custom cursor animation. This is useful for when a program wants to animate a custom cursor. The cursor should first be loaded with the cccpLoadCursor request. After the cccpAnimateCursor request is made, all the handles relating to the master handle will be locked (except for the master handle, which should remain unlocked). The handles will remain locked until the animation is finished, at which point, they will all be unlocked.
|
||||
|
||||
dataIn is a pointer to a buffer which contains:
|
||||
$00 cccpMasterHandle LongÑAnimation master handle
|
||||
|
||||
dataOut:
|
||||
Reserved.
|
||||
|
||||
cccpGetCursorState $8010
|
||||
This tells Cool Cursor to return the type of the current cursor. The values for cccpCursorType are:
|
||||
|
||||
cccpCursorType Name Meaning
|
||||
$0000 cccpPointer Cursor is the pointer (arrow) cursor
|
||||
$0001 cccpWait Cursor is the watch cursor or currently animating
|
||||
$0002 cccpIBeam Cursor is the I-Beam cursor
|
||||
$0003 cccpCustom Cursor is animating because of the cccpAnimateCursor request
|
||||
$0004 cccpOther Cursor is an unknown application-specific cursor
|
||||
|
||||
dataIn:
|
||||
Reserved.
|
||||
|
||||
dataOut buffer:
|
||||
$00 recvCount WordÑNumber of times the request was received
|
||||
$02 cccpCursorType WordÑCurrent cursor type
|
||||
|
||||
osef W. Wankerl
|
||||
Technical Editor of GS+ Magazine
|
449
source/twilight/jw/latest/Shapes.PAS
Normal file
449
source/twilight/jw/latest/Shapes.PAS
Normal file
@ -0,0 +1,449 @@
|
||||
{*****************************************************************************}
|
||||
{* *}
|
||||
{* Shapes *}
|
||||
{* *}
|
||||
{* by: Josef W. Wankerl *}
|
||||
{* *}
|
||||
{* Version: 1.0 *}
|
||||
{* 06/23/92 *}
|
||||
{* *}
|
||||
{*****************************************************************************}
|
||||
|
||||
{$CDev Shapes}
|
||||
{$Keep 'Shapes'}
|
||||
{$Optimize -1}
|
||||
|
||||
Program PascalShapes;
|
||||
|
||||
{$List+}
|
||||
Uses
|
||||
Common,
|
||||
ControlMgr,
|
||||
EventMgr,
|
||||
MemoryMgr,
|
||||
MscToolSet,
|
||||
QuickDrawII,
|
||||
ResourceMgr,
|
||||
WindowMgr,
|
||||
T2;
|
||||
{$List-}
|
||||
|
||||
Const
|
||||
MainControlList = 1;
|
||||
|
||||
IconCtl = 1;
|
||||
ShapesTxtCtl = 2;
|
||||
|
||||
OvalCtl = 3;
|
||||
RectangleCtl = 4;
|
||||
RoundRectangleCtl = 5;
|
||||
ArcCtl = 6;
|
||||
|
||||
OvalString = 'Shapes: Oval';
|
||||
RectangleString = 'Shapes: Rectangle';
|
||||
RoundRectangleString = 'Shapes: Round Rectange';
|
||||
ArcString = 'Shapes: Arc';
|
||||
|
||||
Type
|
||||
rT2Word = Integer;
|
||||
rT2WordPtr = ^rT2Word;
|
||||
rT2WordHndl = ^rT2WordPtr;
|
||||
|
||||
Var
|
||||
Oval : Boolean; {* Draw an oval flag *}
|
||||
Rectangle : Boolean; {* Draw a rectangle flag *}
|
||||
RoundRectangle : Boolean; {* Draw a round rectangle flag *}
|
||||
Arc : Boolean; {* Draw an arc flag *}
|
||||
|
||||
SetupFileNumber : Integer;
|
||||
SetupWindow : GrafPortPtr;
|
||||
|
||||
{*****************************************************************************}
|
||||
{* *}
|
||||
{* SaveConfigResource- *}
|
||||
{* This procedure takes a word value and saves it as a rT2ModuleWord *}
|
||||
{* resource in the Twilight.Setup file. The value is saved and a *}
|
||||
{* name is added. Any previous rT2ModuleWord with the same name is *}
|
||||
{* first removed before the new value is added. *}
|
||||
{* *}
|
||||
{*****************************************************************************}
|
||||
|
||||
Procedure SaveConfigResource (Name : pString; SaveValue : Integer);
|
||||
Var
|
||||
NullString : pString;
|
||||
FileID : Integer;
|
||||
ResourceID : LongInt;
|
||||
ConfigData : rT2WordHndl;
|
||||
|
||||
Begin
|
||||
{*****************************************************}
|
||||
{* Check to see if the named resource already exists *}
|
||||
{*****************************************************}
|
||||
|
||||
ResourceID := RMFindNamedResource (rT2ModuleWord, Name, FileID);
|
||||
If ToolError <> 0
|
||||
Then Begin
|
||||
NullString[0] := Char(0);
|
||||
|
||||
{**************************************************************}
|
||||
{* The resource already exists, so first remove the name from *}
|
||||
{* the resource, then remove the resource itself *}
|
||||
{**************************************************************}
|
||||
|
||||
RMSetResourceName (rT2ModuleWord, ResourceID, NullString);
|
||||
RemoveResource (rT2ModuleWord, ResourceID)
|
||||
End;
|
||||
|
||||
{*********************************************}
|
||||
{* Create new handle for the future resource *}
|
||||
{*********************************************}
|
||||
|
||||
ConfigData := rT2WordHndl (NewHandle (sizeof (Integer), MMStartUp,
|
||||
attrLocked, 0));
|
||||
ConfigData^^ := SaveValue;
|
||||
|
||||
{*********************************************}
|
||||
{* Find a new ID for the resource and add it *}
|
||||
{*********************************************}
|
||||
|
||||
ResourceID := UniqueResourceID (0, rT2ModuleWord);
|
||||
AddResource (ConfigData, 0, rT2ModuleWord, ResourceID);
|
||||
If ToolError <> 0
|
||||
Then
|
||||
DisposeHandle (ConfigData)
|
||||
Else Begin
|
||||
|
||||
{**********************************************************}
|
||||
{* Set the name of the resource if it was added correctly *}
|
||||
{**********************************************************}
|
||||
|
||||
RMSetResourceName (rT2ModuleWord, ResourceID, Name);
|
||||
UpdateResourceFile (SetupFileNumber)
|
||||
End
|
||||
End;
|
||||
|
||||
{*****************************************************************************}
|
||||
{* *}
|
||||
{* SaveT2Message- *}
|
||||
{* This procedure saves the values of all setup controls. *}
|
||||
{* *}
|
||||
{*****************************************************************************}
|
||||
|
||||
Procedure SaveT2Message;
|
||||
Var
|
||||
FileNumber : Integer;
|
||||
|
||||
Begin
|
||||
|
||||
{***********************************************************}
|
||||
{* Save current resource file and switch in Twilight.Setup *}
|
||||
{***********************************************************}
|
||||
|
||||
FileNumber := GetCurResourceFile;
|
||||
SetCurResourceFile (SetupFileNumber);
|
||||
|
||||
{***********************}
|
||||
{* Save control values *}
|
||||
{***********************}
|
||||
|
||||
Oval := Boolean (GetCtlValue (GetCtlHandleFromID (SetupWindow, OvalCtl)));
|
||||
SaveConfigResource (OvalString, Oval);
|
||||
|
||||
Rectangle := Boolean (
|
||||
GetCtlValue (GetCtlHandleFromID (SetupWindow, RectangleCtl)));
|
||||
SaveConfigResource (RectangleString, Rectangle);
|
||||
|
||||
RoundRectangle := Boolean (
|
||||
GetCtlValue (GetCtlHandleFromID (SetupWindow, RoundRectangleCtl)));
|
||||
SaveConfigResource (RoundRectangleString, RoundRectangle);
|
||||
|
||||
Arc := Boolean (GetCtlValue (GetCtlHandleFromID (SetupWindow, ArcCtl)));
|
||||
SaveConfigResource (ArcString, Arc);
|
||||
|
||||
{*****************************}
|
||||
{* Restore old resource file *}
|
||||
{*****************************}
|
||||
|
||||
SetCurResourceFile (FileNumber)
|
||||
End;
|
||||
|
||||
{*****************************************************************************}
|
||||
{* *}
|
||||
{* LoadConfigResource- *}
|
||||
{* This function attempts to load a named rT2ModuleWord resource. If *}
|
||||
{* the resource exists, the value of the rT2ModuleWord resource is *}
|
||||
{* returned, otherwise a default value is returned. *}
|
||||
{* *}
|
||||
{*****************************************************************************}
|
||||
|
||||
Function LoadConfigResource (Name : pString; DefaultValue : Integer) : Integer;
|
||||
Var
|
||||
Result : Integer;
|
||||
ConfigData : rT2WordHndl;
|
||||
|
||||
Begin
|
||||
|
||||
{**************************************}
|
||||
{* Attempt to load the named resource *}
|
||||
{**************************************}
|
||||
|
||||
ConfigData := rT2WordHndl (RMLoadNamedResource (rT2ModuleWord, Name));
|
||||
If ToolError <> 0
|
||||
Then
|
||||
|
||||
{********************************************************}
|
||||
{* Resource does not exist, so return the default value *}
|
||||
{********************************************************}
|
||||
|
||||
Result := DefaultValue
|
||||
Else
|
||||
|
||||
{****************************************************}
|
||||
{* Resource exists, return the rT2Module word value *}
|
||||
{****************************************************}
|
||||
|
||||
Result := ConfigData^^;
|
||||
|
||||
LoadConfigResource := Result
|
||||
End;
|
||||
|
||||
{*****************************************************************************}
|
||||
{* *}
|
||||
{* LoadSetupT2Message- *}
|
||||
{* This procedure loads in the messages configuration data. *}
|
||||
{* *}
|
||||
{*****************************************************************************}
|
||||
|
||||
Procedure LoadSetupT2Message;
|
||||
Begin
|
||||
Oval := Boolean (LoadConfigResource (OvalString, 1));
|
||||
Rectangle := Boolean (LoadConfigResource (RectangleString, 1));
|
||||
RoundRectangle := Boolean (LoadConfigResource (RoundRectangleString, 1));
|
||||
Arc := Boolean (LoadConfigResource (ArcString, 1))
|
||||
End;
|
||||
|
||||
{*****************************************************************************}
|
||||
{* *}
|
||||
{* MakeT2Message- *}
|
||||
{* This function creates the controls for the messages setup window *}
|
||||
{* and sets the value of the controls the the current setup. *}
|
||||
{* *}
|
||||
{*****************************************************************************}
|
||||
|
||||
Function MakeT2Message : LongInt;
|
||||
Const
|
||||
resourceToResource = $0009;
|
||||
|
||||
Var
|
||||
FileNumber : Integer;
|
||||
NC2Result : ctlRecHndl;
|
||||
|
||||
Begin
|
||||
|
||||
{***********************************************************}
|
||||
{* Save current resource file and switch in Twilight.Setup *}
|
||||
{***********************************************************}
|
||||
|
||||
FileNumber := GetCurResourceFile;
|
||||
SetCurResourceFile (SetupFileNumber);
|
||||
|
||||
{***********************************************************************}
|
||||
{* Make absolutely sure that the messages configuration data is loaded *}
|
||||
{***********************************************************************}
|
||||
|
||||
LoadSetupT2Message;
|
||||
|
||||
{*****************************}
|
||||
{* Restore old resource file *}
|
||||
{*****************************}
|
||||
|
||||
SetCurResourceFile (FileNumber);
|
||||
|
||||
{*********************************************************************}
|
||||
{* Create setup controls and set their states to match current setup *}
|
||||
{*********************************************************************}
|
||||
|
||||
NC2Result := NewControl2 (SetupWindow, resourceToResource, MainControlList);
|
||||
|
||||
SetCtlValue (Oval, GetCtlHandleFromID (SetupWindow, OvalCtl));
|
||||
SetCtlValue (Rectangle, GetCtlHandleFromID (SetupWindow, RectangleCtl));
|
||||
SetCtlValue (RoundRectangle,
|
||||
GetCtlHandleFromID (SetupWindow, RoundRectangleCtl));
|
||||
SetCtlValue (Arc, GetCtlHandleFromID (SetupWindow, ArcCtl));
|
||||
|
||||
{*****************************************}
|
||||
{* Return the number of the last control *}
|
||||
{*****************************************}
|
||||
|
||||
MakeT2Message := ArcCtl
|
||||
End;
|
||||
|
||||
{*****************************************************************************}
|
||||
{* *}
|
||||
{* HitT2Message- *}
|
||||
{* This function checks to see which control has been hit, and if a *}
|
||||
{* control that requires the "Update" button has been hit, the *}
|
||||
{* EnableFlag is set to true. *}
|
||||
{* *}
|
||||
{*****************************************************************************}
|
||||
|
||||
Function HitT2Message (ControlID : LongInt) : LongInt;
|
||||
Var
|
||||
EnableFlag : LongInt;
|
||||
|
||||
Begin
|
||||
EnableFlag := 0;
|
||||
|
||||
If ControlID = OvalCtl Then EnableFlag := 1;
|
||||
If ControlID = RectangleCtl Then EnableFlag := 1;
|
||||
If ControlID = RoundRectangleCtl Then EnableFlag := 1;
|
||||
If ControlID = ArcCtl Then EnableFlag := 1;
|
||||
|
||||
{****************************************}
|
||||
{* Return the update button enable flag *}
|
||||
{****************************************}
|
||||
|
||||
HitT2Message := EnableFlag
|
||||
End;
|
||||
|
||||
{*** ==== CUT HERE FOR AN ORCA/Pascal TWILIGHT II BLANKER SHELL ==== ***}
|
||||
|
||||
{*****************************************************************************}
|
||||
{* *}
|
||||
{* DrawAShape- *}
|
||||
{* This procedure draws a random QuickDraw II shape on the screen. *}
|
||||
{* *}
|
||||
{*****************************************************************************}
|
||||
|
||||
Procedure DrawAShape;
|
||||
Const
|
||||
Shapes = 5;
|
||||
|
||||
Var
|
||||
ValidShape : Integer;
|
||||
RandomRect : rect;
|
||||
|
||||
Begin
|
||||
|
||||
{*********************************}
|
||||
{* Set a random color to draw in *}
|
||||
{*********************************}
|
||||
|
||||
SetSolidPenPat ((+QDRandom) Mod 16);
|
||||
|
||||
{******************************************}
|
||||
{* Generate a random rectangle to draw in *}
|
||||
{******************************************}
|
||||
|
||||
With RandomRect Do
|
||||
Begin
|
||||
v1 := (+QDRandom) Mod 200;
|
||||
h1 := (+QDRandom) Mod 320;
|
||||
v2 := (+QDRandom) Mod 200;
|
||||
h2 := (+QDRandom) Mod 320;
|
||||
End;
|
||||
|
||||
{*******************************}
|
||||
{* Find a random shape to draw *}
|
||||
{*******************************}
|
||||
|
||||
ValidShape := (+QDRandom) Mod Shapes;
|
||||
|
||||
{*************************************************}
|
||||
{* Make sure the shape is configured to be drawn *}
|
||||
{*************************************************}
|
||||
|
||||
If (ValidShape = 0) And (Not Oval) Then ValidShape := 1;
|
||||
If (ValidShape = 1) And (Not Rectangle) Then ValidShape := 2;
|
||||
If (ValidShape = 2) And (Not RoundRectangle) Then ValidShape := 3;
|
||||
If (ValidShape = 3) And (Not Arc) Then ValidShape := 4;
|
||||
|
||||
{*************************}
|
||||
{* Draw the random shape *}
|
||||
{*************************}
|
||||
|
||||
Case ValidShape Of
|
||||
0 : PaintOval (RandomRect);
|
||||
1 : PaintRect (RandomRect);
|
||||
2 : PaintRRect (RandomRect, (+QDRandom) Mod 150, (+QDRandom) Mod 150);
|
||||
3 : PaintArc (RandomRect, (+QDRandom) Mod 360, (+QDRandom) Mod 360)
|
||||
End
|
||||
End;
|
||||
|
||||
{*** ==== CUT HERE FOR AN ORCA/Pascal TWILIGHT II BLANKER SHELL ==== ***}
|
||||
|
||||
{*****************************************************************************}
|
||||
{* *}
|
||||
{* BlankT2Message- *}
|
||||
{* This function performs the screen blanking activities. *}
|
||||
{* *}
|
||||
{*****************************************************************************}
|
||||
|
||||
Function BlankT2Message (movePtr : movePtrType) : LongInt;
|
||||
Begin
|
||||
|
||||
{************************************}
|
||||
{* Seed the random number generator *}
|
||||
{************************************}
|
||||
|
||||
SetRandSeed (GetTick);
|
||||
|
||||
{*****************************************************}
|
||||
{* Animate the screen until the movePtr becomes true *}
|
||||
{*****************************************************}
|
||||
|
||||
While Not movePtr^ Do
|
||||
DrawAShape;
|
||||
|
||||
{**********************************************}
|
||||
{* No error occurred, so return a NULL handle *}
|
||||
{**********************************************}
|
||||
|
||||
BlankT2Message := LongInt (NIL)
|
||||
End;
|
||||
|
||||
{*****************************************************************************}
|
||||
{* *}
|
||||
{* Shapes- *}
|
||||
{* This function checks the Twilight II message parameter and *}
|
||||
{* dispatches control to the appropriate message handler. *}
|
||||
{* *}
|
||||
{*****************************************************************************}
|
||||
|
||||
Function Shapes (message : Integer; data1 : LongInt; data2 : LongInt): LongInt;
|
||||
Var
|
||||
Result : LongInt;
|
||||
|
||||
Begin
|
||||
Result := 1;
|
||||
|
||||
Case message Of
|
||||
MakeT2 :
|
||||
Begin
|
||||
|
||||
{***************************************************************************}
|
||||
{* Save pointer to setup window and resource file number of Twilight.Setup *}
|
||||
{***************************************************************************}
|
||||
|
||||
SetupWindow := GrafPortPtr (data1);
|
||||
SetupFileNumber := Integer (data2);
|
||||
|
||||
{*****************************}
|
||||
{* Create the setup controls *}
|
||||
{*****************************}
|
||||
|
||||
Result := MakeT2Message
|
||||
End;
|
||||
SaveT2 : SaveT2Message;
|
||||
BlankT2 : Result := BlankT2Message (movePtrType (data1));
|
||||
LoadSetupT2 : LoadSetupT2Message;
|
||||
UnloadSetupT2 : ;
|
||||
KillT2 : ;
|
||||
HitT2 : Result := HitT2Message (data1)
|
||||
End;
|
||||
|
||||
Shapes := Result
|
||||
End;
|
||||
|
||||
Begin {Main}
|
||||
End. {Main}
|
251
source/twilight/jw/latest/Shapes.Rez
Normal file
251
source/twilight/jw/latest/Shapes.Rez
Normal file
@ -0,0 +1,251 @@
|
||||
/*****************************************************************************\
|
||||
|* *|
|
||||
|* Shapes *|
|
||||
|* *|
|
||||
|* by: Josef W. Wankerl *|
|
||||
|* *|
|
||||
|* Version: 1.0 *|
|
||||
|* 06/23/92 *|
|
||||
|* *|
|
||||
\*****************************************************************************/
|
||||
|
||||
#include "types.rez"
|
||||
#include "T2Common.Rez"
|
||||
|
||||
// --- type $8003 defines
|
||||
|
||||
#define CTLLST_00000001 $00000001
|
||||
|
||||
// --- type $8004 defines
|
||||
|
||||
#define CTLTMP_00000001 $00000001
|
||||
#define CTLTMP_00000002 $00000002
|
||||
#define CTLTMP_00000003 $00000003
|
||||
#define CTLTMP_00000004 $00000004
|
||||
#define CTLTMP_00000005 $00000005
|
||||
#define CTLTMP_00000006 $00000006
|
||||
|
||||
// --- type $8006 defines
|
||||
|
||||
#define PSTR_00000100 $00000100
|
||||
#define PSTR_00000101 $00000101
|
||||
#define PSTR_00000102 $00000102
|
||||
#define PSTR_00000103 $00000103
|
||||
|
||||
// --- type $800B defines
|
||||
|
||||
#define LETXTBOX_00000001 $00000001
|
||||
|
||||
// --- type $800E defines
|
||||
|
||||
#define WPARAM1_00000001 $00000001
|
||||
|
||||
resource rT2ModuleFlags (moduleFlags, $0000) {
|
||||
fSetupSupported +
|
||||
fWantFadeOut +
|
||||
fWantWipeIn +
|
||||
fWantForceGrafPortMode320
|
||||
};
|
||||
|
||||
// --- Icon Definitions
|
||||
|
||||
resource rIcon (moduleIcon, $0000) {
|
||||
$8000, // kind
|
||||
$0014, // height
|
||||
$001C, // width
|
||||
|
||||
$"FFF0000000000000000000000FFF"
|
||||
$"FFF0FFFFFFFFFFFFFFFFFFFF0FFF"
|
||||
$"FFF0F000000000000000000F0FFF"
|
||||
$"FFF0F0FFFFFFFFFFAAAA550F0FFF"
|
||||
$"FFF0F0FF4444444444AA550F0FFF"
|
||||
$"FFF0F0F444444444444AAA0F0FFF"
|
||||
$"FFF0F0F444444444444AAA0F0FFF"
|
||||
$"FFF0F0F444444444444AAA0F0FFF"
|
||||
$"FFF0F0F24444444444FFFF0F0FFF"
|
||||
$"FFF0F0F22222FFFFFFFFFF0F0FFF"
|
||||
$"FFF0F0FF222FFFFFFFFFFF0F0FFF"
|
||||
$"FFF0F000000000000000000F0FFF"
|
||||
$"FFF0FFFFFFFFFFFFFFFFAFFF0FFF"
|
||||
$"FFF0000000000000000000000FFF"
|
||||
$"FFFF0FFFFFFFFFFFFFFFFFF0FFFF"
|
||||
$"FFFF0FFFFFFFFFFFFFFFFFF0FFFF"
|
||||
$"FFFF0FF4AFFFFFFFFFFFFFF0FFFF"
|
||||
$"FFFF0CCCCCCCCCCCCCCCCCC0FFFF"
|
||||
$"FFFF0FFFFFFFFFFFFFFFAFF0FFFF"
|
||||
$"FFFF00000000000000000000FFFF",
|
||||
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000";
|
||||
};
|
||||
|
||||
// --- Control List Definitions
|
||||
|
||||
resource rControlList (CTLLST_00000001, $0000) {
|
||||
{
|
||||
CTLTMP_00000006, // control 1
|
||||
CTLTMP_00000005, // control 2
|
||||
CTLTMP_00000004, // control 3
|
||||
CTLTMP_00000003, // control 4
|
||||
CTLTMP_00000002, // control 5
|
||||
CTLTMP_00000001, // control 6
|
||||
};
|
||||
};
|
||||
|
||||
// --- Control Templates
|
||||
|
||||
resource rControlTemplate (CTLTMP_00000001, $0000) {
|
||||
$00000001, // ID
|
||||
{ 31, 94, 52,138}, // rect
|
||||
iconButtonControl {{
|
||||
$000C, // flag
|
||||
$1020, // moreFlags
|
||||
$00000000, // refCon
|
||||
moduleIcon, // iconRef
|
||||
0, // titleRef
|
||||
0, // colorTableRef
|
||||
$0000 // displayMode
|
||||
}};
|
||||
};
|
||||
|
||||
resource rControlTemplate (CTLTMP_00000002, $0000) {
|
||||
$00000002, // ID
|
||||
{ 43,152, 52,257}, // rect
|
||||
statTextControl {{
|
||||
$0000, // flag
|
||||
$1002, // moreFlags
|
||||
$00000000, // refCon
|
||||
LETXTBOX_00000001 // textRef
|
||||
}};
|
||||
};
|
||||
|
||||
resource rControlTemplate (CTLTMP_00000003, $0000) {
|
||||
$00000003, // ID
|
||||
{ 68, 4, 77,158}, // rect
|
||||
checkControl {{
|
||||
$0000, // flag
|
||||
$1002, // moreFlags
|
||||
$00000000, // refCon
|
||||
PSTR_00000100, // titleRef
|
||||
$0001 // initialValue
|
||||
}};
|
||||
};
|
||||
|
||||
resource rControlTemplate (CTLTMP_00000004, $0000) {
|
||||
$00000004, // ID
|
||||
{ 79, 4, 88,158}, // rect
|
||||
checkControl {{
|
||||
$0000, // flag
|
||||
$1002, // moreFlags
|
||||
$00000000, // refCon
|
||||
PSTR_00000101, // titleRef
|
||||
$0001 // initialValue
|
||||
}};
|
||||
};
|
||||
|
||||
resource rControlTemplate (CTLTMP_00000005, $0000) {
|
||||
$00000005, // ID
|
||||
{ 90, 4, 99,158}, // rect
|
||||
checkControl {{
|
||||
$0000, // flag
|
||||
$1002, // moreFlags
|
||||
$00000000, // refCon
|
||||
PSTR_00000102, // titleRef
|
||||
$0001 // initialValue
|
||||
}};
|
||||
};
|
||||
|
||||
resource rControlTemplate (CTLTMP_00000006, $0000) {
|
||||
$00000006, // ID
|
||||
{101, 4,110,158}, // rect
|
||||
checkControl {{
|
||||
$0000, // flag
|
||||
$1002, // moreFlags
|
||||
$00000000, // refCon
|
||||
PSTR_00000103, // titleRef
|
||||
$0001 // initialValue
|
||||
}};
|
||||
};
|
||||
|
||||
// --- rPString Templates
|
||||
|
||||
resource rPString (moduleName, $0000) {
|
||||
"Shapes"
|
||||
};
|
||||
|
||||
resource rPString (PSTR_00000100, $0000) {
|
||||
"Ovals"
|
||||
};
|
||||
|
||||
resource rPString (PSTR_00000101, $0000) {
|
||||
"Rectangles"
|
||||
};
|
||||
|
||||
resource rPString (PSTR_00000102, $0000) {
|
||||
"Round Rectangles"
|
||||
};
|
||||
|
||||
resource rPString (PSTR_00000103, $0000) {
|
||||
"Arcs"
|
||||
};
|
||||
|
||||
// --- rTextForLETextBox2 Templates
|
||||
|
||||
resource rTextForLETextBox2 (LETXTBOX_00000001, $0000) {
|
||||
TBStyleBold
|
||||
"Shapes Setup"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2 (moduleMessage, $0000) {
|
||||
TBCenterJust
|
||||
TBForeColor TBColor4
|
||||
"\n"
|
||||
"This module generates random QuickDraw II shapes and draws "
|
||||
"them on the screen."
|
||||
};
|
||||
|
||||
// --- Window Templates
|
||||
|
||||
resource rWindParam1 (WPARAM1_00000001, $0000) {
|
||||
$80A0, // plFrame (frame bits)
|
||||
NIL, // plTitle (no Title)
|
||||
$00000000, // plRefCon
|
||||
{ 0, 0, 0, 0}, // plZoomRect
|
||||
NIL, // plColorTable (standard colors)
|
||||
{$0000, $0000}, // plYOrigin, plXOrigin
|
||||
{$0000, $0000}, // plDataHeight, plDataWidth
|
||||
{$0000, $0000}, // plMaxHeight, plMaxWidth
|
||||
{$0000, $0000}, // plVerScroll, plHorScroll
|
||||
{$0000, $0000}, // plVerPage, plHorPage
|
||||
$00000000, // plInfoText (info RefCon)
|
||||
$0000, // plInfoHeight
|
||||
{ 51,246,179,590}, // plPosition
|
||||
infront, // plPlane
|
||||
CTLLST_00000001, // plControlList
|
||||
$0209 // plInDesc
|
||||
};
|
||||
|
||||
resource rVersion (moduleVersion, $0000) {
|
||||
{1, 0, 0, beta, 2},
|
||||
verUS,
|
||||
"Twilight II Shapes Module",
|
||||
"Copyright 1992 by Josef W. Wankerl"
|
||||
};
|
26
source/twilight/jw/latest/T2.Complaints
Normal file
26
source/twilight/jw/latest/T2.Complaints
Normal file
@ -0,0 +1,26 @@
|
||||
***EEEK!
|
||||
I just lost part of my Messages source code. I had a hard drive crash a while ago, and I recovered most of the stuff that was important. Including the Messages source. So I backed the stuff up. But, the messages.cc file didn't get recovered correctly. So now I have a backup of a corrupted file. Not very nice. Overwrote the old backup with the uncorrupted source. So... wouldja mind sending me back a copy of the messages.cc file? I hope I sent you an uncorrupted copy. Doesn't matter how far back it goes, I don't think, as long as the BlankT2 function is intact. I have everything else but that. Thanx.
|
||||
|
||||
Now onto business... ;-)
|
||||
|
||||
Why doesn't Setup work in 320 mode? Is it because the window won't fit? You know, if you make it a bit skinnier, and a bit taller, it'll fit just fine. It's really annoying not to have setup in 320 mode programs. The same for the module about dialog. It shouldn't be all that difficult to have two separate windows, one for 640 and one for 320, for the about text to fit in, should it?
|
||||
|
||||
w/d33:
|
||||
I put my ORCA.Sys16 icon out on the Finder's desktop in the lower lefthand corner of the screen. That's the background blank now corner. So, I slap my mouse pointer in the lower lefthand corner, double click, and launch ORCA. So I get there. I change my prefix. The screen blanks. I press shift to bring it back. It comes back. It blanks again. I press shift to bring it back. It comes back. It blanks again. I move the mouse... everything's dandy. Ya might wanna check into that - no mouse corners when text is up and no mouse is there or something. Beats me how you'd do it, though. :-)
|
||||
|
||||
I've had some weird occurances of the screen blanking, then the application quits. Most notibly in the Finder. One minute the screen is blanked (animated) and then the Finder quits to the System 6 launcher. I can't reproduce this one reliably at all. (Only happened three or so times randomly.)
|
||||
|
||||
w/d34:
|
||||
I dynamically installed d34 and it corrupted my setup file, so when I rebooted my system got hosed. Just thought you'd want to know. :-) Probably never happen again.
|
||||
|
||||
Diz suggested that T2 also do some kind of password protection before the screen unblanks. He says a lot of the MacBlankers do that. And, of course, he'd want it to work in both text and graphical environments. Probably not when you do a forced background blank in a screen corner, though, but any other time the screen blanks. It'll be an option, of course. I dunno how viable this is, but hey, might as well suggest it, eh?
|
||||
|
||||
I *LOVE* that new wipe in. It doesn't correctly restore the screen, though, some bits are blocky and missing - most notibly along the left edge of the screen. Adding a RefreshDesktop(0) will clear that up, but just fixing the wipe to restore the screen all the way will probably work better. Have you given any thought to adding "wiper" modules to T2? The fWantFadeIn and fWantFadeOut bits could change to fWantWipeIn and fWantWipeOut (heh!) and you (not the blanker) could select the types of wipes you want. Fades, the circular thing, and any other that may come along. Just a thought...
|
||||
|
||||
Oh yeah... ya didn't credit me with the T2Hit is now like control panels thing in d34. :-)
|
||||
|
||||
Instead of having us delete our Twilight.Setup file every time, why not just put a rVersion resource in there? Check it against Twilight's rVersion number, and if they're incompatible, notify the user that the file will be deleted, then delete the file. This will also help if you make Twilight.III and its data file changes. :-)
|
||||
|
||||
I'm haveing some really fucked up stuff happen with the Shapes blanker now. I'm sending you the source code so maybe you can figure out what's going on. Basically, when anything to do with the blanker has to hapen, the system will crash. Bad bad bad. I have no idea what's going on. Do you?
|
||||
|
||||
Say, how are you gunna be distributing Twilight II? ShareWare? You know, we'd love to publish it for you. :-) Maybe not in GS+, but as a stand alone product. We could pay you royalties or something. But, if you decide to go ShareWare... I'll letcha in on a little secret. We here at GS+ are thinking about starting a mail order business. One of the things that we would do is sell ShareWare. We'd work out a deal with the ShareWare author so they'd give us a discount on the price. In exchange, we'd sell their ShareWare. So what would happen is ther user would pay us $10 for the ShareWare fee, plus any shipping and disk costs, and we'd then pay the author the discounted price so we would make a buck. Why is this better than getting people to pay you the full price directly? Well, we would take credit cards. Just call us up and place your order. No check writing or mailing things in. BIG plus there. What do you think about this idea? Still in the planning stages here. Also, in the last GS+, we ran an article on how to write Phantasm screen blankers. We'd like to do the same for T2 blankers. Would you like to write the article? If not, I'll probably end up doing it. It'd carry more weight if you did it, though. :-) Of course we'd pay you for it.
|
12
source/twilight/jw/old/EvenMoreT2
Normal file
12
source/twilight/jw/old/EvenMoreT2
Normal file
@ -0,0 +1,12 @@
|
||||
EVEN MORE T2 junk...
|
||||
|
||||
¥ The key equivalent for "About Module..." should be Command-?, not Command-A.
|
||||
¥ The key equivalent for "Twilight II Active" should be Command-A.
|
||||
¥ The key equivalent for "Randomize" should be Command-R.
|
||||
¥ The focus frame is still on the list control... :-)
|
||||
|
||||
For the next version, could you at least get the caps lock lock working, as well as being able to turn off that damned blinking menu bar box? :-)
|
||||
|
||||
I've tried writing a blanker for T2... and included is the source code, plus the module. Check it out, eh? The blanker portion works fine, but the setup is really screwy. Can you figure out why? There are some comments for you to look at in the Messages.CC file. And, in thinking about them, if the wantFadeOut bit is set then most likely the stuff I've commented about the wantInitPort (is that what I called it?) should probably be done - so the wantFadeOut bit is the wantInitPort bit if wantGrafPort is set. Does that make any sense???
|
||||
|
||||
Okay, funky, just saw something weird. When I choose Messages from the setup pop-up menu, the controls are drawn really screwy. When I cover the window with EGOed and then look again, the update routine is called, and the controls all look dandy. Any ideas on this one?
|
5
source/twilight/jw/old/T2.Bug
Normal file
5
source/twilight/jw/old/T2.Bug
Normal file
@ -0,0 +1,5 @@
|
||||
Twilight Bug Found! :-)
|
||||
|
||||
Here's how to reproduce it. Open Twilight II. Click on "Setup...". Select the Tiler setup from the pop-up menu. Click on the Twilight II window to make it active. Click on "About Module..." to get information on Tiler. Click to dismiss the dialog. Watch your system die a horrible death. (HINT: What resource is in common with both the About Module dialog AND the Tiler setup window, eh? Hmmmm... could it be... some kind of pictorial representation of the blanker? ;-)
|
||||
|
||||
Included with this is also the latest-gratest version of the Messages module which actually supports setup - the only problem is that the setup controls are still drawn screwy. No comments for you in this version - you should read them from the last one (that bit of code hasn't changed).
|
16
source/twilight/jw/old/T2.Comments
Normal file
16
source/twilight/jw/old/T2.Comments
Normal file
@ -0,0 +1,16 @@
|
||||
Nice job! I really liked what I saw... sure would like to have a few more blankers, though (specifically universe and power scroll ;-). Say, how difficult would it be to support the old blanker style as well as the new??? Well it don't matter all that much since you're probably gunna get all the old blankers revised anyhow, eh? :-)
|
||||
|
||||
T2 Comments:
|
||||
|
||||
¥ The command-help dialog doesn't have your AOL address as AFC DYA Jim... :-)
|
||||
¥ The control panel's list control has a focus frame on it when it's the only targetable control
|
||||
¥ How are you implementing the non-watch cursor blanking??? I'm gunna start work on Cool Cursor 1.1 soon and it'll be able to tell you (SendRequest to EGO Systems~Cool Cursor~ and ask for the WaitStatus, I believe it'll be... plus you can request to load and animate a special Twilight cursor if ya want... :-)
|
||||
¥ New Module Idea: Man, it'd be way cool if the Fill Maze (in demo mode where the computer finds its way out) could be converted into a blanker...
|
||||
¥ I like the seconds before blank now idea... but more appropriate would probably be some way for the screen to blank until a key is pressed or the mouse button is clicked (i.e. ignore mouse movements)
|
||||
¥ I think that Phantasm has some kind of way to "slideshow" all its available blankers - ya might want to think about something like that - I dunno how useful it'd be, though
|
||||
¥ Speaking of Phantasm... sure would be way cool if T2 could use Phantasm blanker modules... but that would be one of the last things I would work on
|
||||
¥ re: KillT2 message - wouldn't it just be easier for T2 to call KillControls to kill the controls? It'd have to re-make the pop-up, update button, and divider controls... but that'd be a heckuva lot easier than a loop to kill setup controls - especially if they're created with a single NewControl2 call which refers to a control list, eh? I don't remember if KillControls actually hides 'em first, so you'd probably have to call invalRect or something on the setup control area.
|
||||
¥ re: BlankT2 message - instead of a pointer to the movement flag (which tells the module to return to T2) I think the T2Data1 parameter should be a pointer to a structure - first the movement flag, then a grafPortPtr. This would work in conjunction with a new flag bit (0=setup,1=fade in,2=fade out,3=grafPort) which would let T2 automatically call GetPort/OpenPort/SetPort before dispatching to the module (since I would hope that grafPorts would be used a lot and having each module do this is a waste of code, eh?) and then the ClosePort/SetPort calls would be made by T2 when the blanker module returns. Also, a way of specifying whether the mode should be either 320 or 640 mode would be appropriate, too, but I haven't thought about this too much...
|
||||
¥ re: Twilight.Setup - Yeek! I dunno if I like that file format. The "rT2ExtSetup2 ($1002) Reserved for internal CDev use. (Module name of selected module.)" should actually be a rPString resource, most likely with ID of 1. The "rT2ExtSetup1 ($1001) Reserved for internal CDev use. (Internal integer flags.)" is probably okay. However, the "rTilerSetup ($0100) User adjustable configuration resources for Tiler module." is what gets me. I believe that some standard types should be declared like rCheckBox ($0001?), rRadio ($0002?), (rPString and rText have already been defined) and that the preferences be saved and loaded by name, rather than by number. So, for example, if a module is named "Tiler" and it wants to load a pString, it would load the pString named "Tiler" from the Twilight.Setup file. Also, if there are more than one pStrings, it should load "Tiler - 1" and then "Tiler - 2" or something like that. What do you think about this, eh? I think it'd be much more flexible than assigning a type for each blanker.
|
||||
¥ I'd be nice if the Twilight II Active checkbox was on the main control panel window
|
||||
¥ I did a new T2 icon for the Twilight.Preferences file... probably not too good, buy hey, what do I know? :-)
|
31
source/twilight/jw/old/T2.Comments2
Normal file
31
source/twilight/jw/old/T2.Comments2
Normal file
@ -0,0 +1,31 @@
|
||||
>> Supporting old style modules is out of the question, for two reasons: 1-It is impossible to detect which version from a software point of view <<
|
||||
Well, not if you move the T2 blanker main code to the resource fork - if a blanker has a data fork length > 0 then it's an old style one. :-)
|
||||
>> 2-WHY would I want to? I changed the module format for good reason; I do not want to regress into the limits imposed by the old format which I escaped with G2MF! :-) <<
|
||||
True, true... but it'd keep other people from having to re-write their modules. But I also see your point entirely. I think I agree that old style blankers should be left alone and T2 should only support the new.
|
||||
|
||||
>> Thanks a lot for your comments. I wish everyone was as verbal as the few people like yourself. <<
|
||||
I just hope you don't take my comments too personally. :-)
|
||||
|
||||
>>>> The control panel's list control has a focus frame on it when it's the only targetable control <<<<
|
||||
>> That is exactly how it's supposed to be! If it didn't have the automatic focus frame then you couldn't navigate the list via the keyboard until you clicked in the listCtl's boundsRect with the mouse first! (yuck, icky; I hate programs that make you do that [i.e. DTUtils v3.3]) <<
|
||||
...then how does SFGetFile do it? All you have to do is set the fCtlWantsEvents bit in the moreflags? word and it'll do the ListKey for you, right? Or, you could call ListKey yourself... the point is that there shouldn't be a focus frame if there's only one targetable control.
|
||||
|
||||
re: Cool Cursor - yup, I understand that you don't want to require ppl to have CCCP. That's cool. Lemmie know if you need any help with the code there... hey, but you're a subscriber - you have the source code anyhow, eh? :-)
|
||||
|
||||
>> re: KillT2 message:
|
||||
But the current setup isn't as difficult or tedious as you seem to imply. Sure, it might not be as good as what you're suggesting to replace it (if it is feasible that is), but it still isn't difficult - just do a loop killing off ctls with IDs 1 thru whatever the highest Id you have. I call my killCtl routine recursively (inside my modules) so killing all the ctls from a control list is easy. <<
|
||||
You might want to do this yourself, then. When The KillT2 message is sent, the blanker sends back it's highest blanker ID and then T2 goes though and does the recursive erase/kill calls for the blanker. I'm just trying to weed out as much unnecessary module code as necessary. :-)
|
||||
|
||||
>> Excellent idea!!! I will try to implement it soon! Perhaps I will define 2 new bits of T2ModuleFlags: 3=grafport640, 4=grafport320. But, I'm really not too too familiar with QuickDraw II - I thought you just open up a grafport and it automatically has to use the mode QDII was started up with. So I'm kinda confused now :-) <<
|
||||
Actually, I think 3=grafPort, and if 3 is set then 4 determines the mode (320/640) - that way if 4 is set and 3 isn't then things don't go crazy. Eh? What I mean by mode is that T2 would go thru and update all the SCBs to be 640 or 320 mode. I know that when blankers start up they switch in the mode their animation will take place in, right? Or am I totally off base here?
|
||||
|
||||
>> re: named setup resources <<
|
||||
I like your ideas here as well! How come I couldn't think of that? :-) I'll try to get this done for d32 as to do it before many other people write modules. <<
|
||||
Cool! Glad you liked the idea. :-)
|
||||
|
||||
>>>> I did a new T2 icon for the Twilight.Preferences file... probably not too good, buy hey, what do I know? :-) <<<<
|
||||
>> I like it! I'm adding it to the T2.Icons file! :-) Thanks a lot! <<
|
||||
Well, it's kinda a ripoff of my Replicator preferences file icon... :-) Yah, those icons are pretty nifty. I remember you saying that the icon file is better than the rBundle shit... is it really? I would think that if each blanker module carried around its own icon for the finder to display that it'd eliminate a lot of icon stuff - but I really haven't looked at the finder docs too closely to figure out exactly how all that stuff works. But yah, I like the icons file. :-)
|
||||
|
||||
>> Thanks again for all the comments.. I appreciate it! <<
|
||||
Hey, glad to help out! Eagerly waiting for d32 or whatever it'll be... :-)
|
22
source/twilight/jw/old/T2.Junk
Normal file
22
source/twilight/jw/old/T2.Junk
Normal file
@ -0,0 +1,22 @@
|
||||
The "Setup..." button should not be inactive whenever the setup window is open. Instead, its function should be to bring the setup window to the front.
|
||||
|
||||
And, just to remind you, it'd be nice if there was a built-in blanker called "Background Blank" that would perform a background blank instead of an animated one.
|
||||
|
||||
You most likely want to change the help dialog to be a TextEdit control and describe the various functions of all those setup controls. :-)
|
||||
|
||||
The DoubleClick function pop-up menu should most likely have an "Ignore" setting so that double-clicking doesn't do anything.
|
||||
|
||||
The T2Hit message should be exactly like the hit message for control panels in that data1 and data2 contain the handle of the control hit and the id of the control hit. (maybe it's the other way around... check FTN.C7.XXXX for the specifics :-)
|
||||
|
||||
Speaking of control panels... looks like that's what you're doing with T2. Why not give each setup a different window? :-) Just a thought... it'd be just fine if there was only one setup window.
|
||||
|
||||
The fWantForceGrafPortMode640 and fWantForceGrafPortMode320 bits don't seem to work very well... I was in platypus paint and the thing freaked out when Messages b2 ran. Also, I was in the Finder and Shapes b1 ran and things freaked out... maybe you need to call SetMasterSCB???
|
||||
|
||||
The pathname area for the YDI blanker is a bit small... you might want to enlarge it some. :-)
|
||||
|
||||
Feel free to distribute the blankers and source code for Messages and Shapes in the next beta of T2, provided they will still work with the g2mf. If you change the module format so drastically (like change the hit message) so that the blankers won't work, let me know and I'll re-compile a version that will and send it off to you so you can include it. I've made some header files for both Pascal and C, as well, that you can distribute, even after beta stage. I really dunno what I'm gunna do with the Messages and Shapes modules yet... I think Diz wants to make an entire package of blankers and sell them or something. But, since I wrote them, I'm gunna make them available to the beta developers on good faith. When T2 reaches a final stage, if you like, I can rip the guts out (like you did for Tiler) and just let you distribute the shell parts in a module developer package. These guys are still developmental, and there aren't any comments that I know of... but they're cool enough to get a feel for what to do. I think I'll eventually put some kind of configuration on Shapes.
|
||||
|
||||
And, just to give you a hard time 'cause my name wasn't on them, didn't I ask for these? ;-)
|
||||
|
||||
¥ T2 now sets all the SCBs to use palette 0 (AND #$8080) before calling modules. There are several other GrafPort and mode changes too Ð see G2MF ERS v1.2.1.
|
||||
¥ About Module control is dimmed when the setup window is opened so there are no control (specifically, Icon) conflicts.
|
27
source/twilight/jw/old/T2.replies2
Normal file
27
source/twilight/jw/old/T2.replies2
Normal file
@ -0,0 +1,27 @@
|
||||
>> I just hope you don't take my comments too personally. :-) <<
|
||||
Don't worry about it at all! Same goes here. :-)
|
||||
|
||||
>>>> The control panel's list control has a focus frame on it when it's the only targetable control <<<<
|
||||
>> ...then how does SFGetFile do it? All you have to do is set the fCtlWantsEvents bit in the moreflags? word and it'll do the ListKey for you, right? Or, you could call ListKey yourself... the point is that there shouldn't be a focus frame if there's only one targetable control. <<
|
||||
I think you have a point now! I'll look into it further!
|
||||
|
||||
>> re: Cool Cursor - yup, I understand that you don't want to require ppl to have CCCP. That's cool. Lemmie know if you need any help with the code there... hey, but you're a subscriber - you have the source code anyhow, eh? :-) <<
|
||||
Thanks, I won't hesitate to take advantage of your offer :-) Yes, I have the source thru my subscription, but my comprehension of C code is another matter entirely :-)
|
||||
|
||||
>> re: KillT2 message:
|
||||
You might want to do this yourself, then. When The KillT2 message is sent, the blanker sends back it's highest blanker ID and then T2 goes though and does the recursive erase/kill calls for the blanker. I'm just trying to weed out as much unnecessary module code as necessary. :-) <<
|
||||
Ahh. I like it that way, good point! :-)
|
||||
|
||||
>> Actually, I think 3=grafPort, and if 3 is set then 4 determines the mode (320/640) - that way if 4 is set and 3 isn't then things don't go crazy. Eh? What I mean by mode is that T2 would go thru and update all the SCBs to be 640 or 320 mode. I know that when blankers start up they switch in the mode their animation will take place in, right? Or am I totally off base here? <<
|
||||
You are correct. I will try to implement this as soon as possible. Another good idea!
|
||||
|
||||
>> re: named setup resources
|
||||
Cool! Glad you liked the idea. :-) <<
|
||||
It's already implemented - I just have to update the G2MF ERS.
|
||||
|
||||
>>>>>> I did a new T2 icon for the Twilight.Preferences file... probably not too good, buy hey, what do I know? :-) <<<<<<
|
||||
>> Well, it's kinda a ripoff of my Replicator preferences file icon... :-) Yah, those icons are pretty nifty. I remember you saying that the icon file is better than the rBundle shit... is it really? I would think that if each blanker module carried around its own icon for the finder to display that it'd eliminate a lot of icon stuff - but I really haven't looked at the finder docs too closely to figure out exactly how all that stuff works. But yah, I like the icons file. :-) <<
|
||||
This is a good rule of thumb I've discovered: rBundles are shit except for if you're an application. I would also have thought that it would be easier for each module to have its own rBundle - and it could reference the same copy of the module icon that appears in the module about box, but it's a bitch and a half! (understatement) First off, in order for the finder to even LOOK at each rBundle, you must get info on each individual module or file with one! Second, the icons take effect the next time you QUIT back to the finder. Third, if you get info multiple times on the same file with an rBundle, it places copies of its rbundle in your desktop file! In my experiments, I wound up with 4 copies of one SAME RBUNDLE in my Desktop file, just testing the concept!!!
|
||||
|
||||
>> Hey, glad to help out! Eagerly waiting for d32 or whatever it'll be... :-) <<
|
||||
d32 should hopefully be out this weekend! :-) Thanks again.
|
3
source/twilight/jw/old/YetMoreT2Ideas
Normal file
3
source/twilight/jw/old/YetMoreT2Ideas
Normal file
@ -0,0 +1,3 @@
|
||||
When I'm in a 320 mode program and the screen blanks with the Messages module, the screen is left in 320 mode... T2 should set the MasterSCB and SCBs of all the scan lines to either 640 or 320 mode based on the wantGrafPort320 bit. In addition, it'd be nice if the palette was set to zero for each scan line when the wantGrafPort bit is set. I think I've mentioned this before (in the source code comments?), but it can't hurt to remind you, eh? :-)
|
||||
|
||||
When I change a value in the setup dialog and then either close the window or choose another setup item from the pop-up menu, I almost invariably forget to hit the update button. A nifty preference for T2 to have would be "Prompt for updating" when something like that happens - I could turn it on and a dialog would say "You forgot to update the setup. What do you want to do with the changes you made? (Ignore) or (Update)." That can be turned off for people who don't forget so easily. :-) This, of course, assumes that you put in that Hit message allowing the Update button to be enabled when a hit on a control that requires setup information to be updated. :-)
|
11
source/twilight/jw/old/moret2
Normal file
11
source/twilight/jw/old/moret2
Normal file
@ -0,0 +1,11 @@
|
||||
More Twilight Suggestions:
|
||||
|
||||
Provide a blanker which is not a module, but actually built into Twilight II, called "Background Blank" which performs a background blank when the specified blank time has elapsed.
|
||||
|
||||
When the setup window is displayed, have the "Update" button inactive unless a change has been made. When the "Update" button is selected, call the T2Save routine in the blanker, then disable the "Update" button. You'll probably have to have a T2Hit message which would allow the blanker module to discover which control was hit (just like the control panel does) and return a flag which will let T2 know if it should enable the "Update" button or not. (Some hits might not necessarily enable the "Update" button.)
|
||||
|
||||
You might want to change the "Help" information for T2 to be a TextEdit control instead of the two static text controls toggled by the option key. As you may know, Control Panels NDA 2.0 starts up and shuts down TextEdit for you when the help button is hit, so all you need to do is create the control and shove in the text. It'd be really neato if the text was styled and colored and stuff, but I haven't yet been able to figure out exactly how to create a rStyleBlock and incorporate it into a help TextEdit control... but I haven't played with it all that much, either.
|
||||
|
||||
re: Tiler b7 & AppleWorks GS - I was on GEnie with AWGS and Tiler kicked in. So I moved the mouse to restore the screen. Things were really screwy after that. The text scrolled up and was replaced by black instead of white. I dunno what happened. Unless you have an idea, I'd just chalk it up to an AWGS peculiarality (everyone else special cases AWGS... sheesh! what a piece of trash!) and ignore it. :-)
|
||||
|
||||
I've noticed that when I'm in ORCA, and I compile something that takes a while (long enough for the text screen to background blank) and then the compile finished and control transfers to a desktop program (my make script for Replicator automatically launches it when the compile is done) and then I quit my desktop application to return to ORCA that the screen is really fucked. Ya might wanna look for the deskShutDown and/or deskStartUp requests (there is a startup request, is there not? I don't remember...) and unblank any blanked screen.
|
18
source/twilight/jw/old/t2.junk.p.s
Normal file
18
source/twilight/jw/old/t2.junk.p.s
Normal file
@ -0,0 +1,18 @@
|
||||
Subj: d33 mods
|
||||
Date: 92-06-08 18:02:38 EDT
|
||||
From: JWankerl
|
||||
To: AFC DYAJim
|
||||
|
||||
File: d33.mods.shk (25472 bytes)
|
||||
DL time (2400 baud): < 3 minutes
|
||||
Posted on: America Online
|
||||
|
||||
Jim,
|
||||
|
||||
Here's some stuff on d33... hope you haven't outdated it already. ;-) Some last minute thoughts I had and didn't put into the ShrinkIt archive...
|
||||
|
||||
A preference for P8 blanking would be nice. When I'm in P8, sometimes, I don't want T2 to do screen blanking for me. It'd be nice to turn it off just for P8.
|
||||
|
||||
Also, don't forget to request a real file type from DTS for the Twilight.Setup file. :-)
|
||||
|
||||
Hope you enjoy the stuff I'm sending now...
|
46
source/twilight/jw/old/t2.replies
Normal file
46
source/twilight/jw/old/t2.replies
Normal file
@ -0,0 +1,46 @@
|
||||
I'm glad you like how it's progressing. I will try to get a few more modules converted soon. Once I get most of the CDev done, however, I will spend much more time on modules. Supporting old style modules is out of the question, for two reasons: 1-It is impossible to detect which version from a software point of view, and 2-WHY would I want to? I changed the module format for good reason; I do not want to regress into the limits imposed by the old format which I escaped with G2MF! :-)
|
||||
|
||||
Thanks a lot for your comments. I wish everyone was as verbal as the few people like yourself. The people who contribute the least will be the first to go when I reach my maximum tester limit.
|
||||
|
||||
Let me address your comments now..
|
||||
|
||||
>> The command-help dialog doesn't have your AOL address as AFC DYA Jim... :-) <<
|
||||
The reason why I originally decided to leave it that way was you never know how long I'll be AFC, while I'll always have my DYA Jim account. However, I figure now what the hell - I'll change it.
|
||||
|
||||
>> The control panel's list control has a focus frame on it when it's the only targetable control <<
|
||||
That is exactly how it's supposed to be! If it didn't have the automatic focus frame then you couldn't navigate the list via the keyboard until you clicked in the listCtl's boundsRect with the mouse first! (yuck, icky; I hate programs that make you do that [i.e. DTUtils v3.3])
|
||||
|
||||
>> How are you implementing the non-watch cursor blanking??? I'm gunna start work on Cool Cursor 1.1 soon and it'll be able to tell you (SendRequest to EGO Systems~Cool Cursor~ and ask for the WaitStatus, I believe it'll be... plus you can request to load and animate a special Twilight cursor if ya want... :-) <<
|
||||
I haven't really decided yet, altho I've been bouncing around in my head using the same method CC does to patch out the appropriate addresses. I'd like to use CC calls, but chances are 90% of the users won't have CC, and I'm not sure I want to make having CoolCursor a requirement to use all features of T2.. :-(
|
||||
|
||||
>> New Module Idea: Man, it'd be way cool if the Fill Maze (in demo mode where the computer finds its way out) could be converted into a blanker... <<
|
||||
Hmm, I wonder if I could get Jason to do it..
|
||||
|
||||
>> I like the seconds before blank now idea... but more appropriate would probably be some way for the screen to blank until a key is pressed or the mouse button is clicked (i.e. ignore mouse movements) <<
|
||||
Oh well, it's gone now! I removed it to make room for features I consider to be more important. However I just added a check box for not allowing mouse movement to restore a blanked screen when in a desktop program. :-)
|
||||
|
||||
>> I think that Phantasm has some kind of way to "slideshow" all its available blankers - ya might want to think about something like that - I dunno how useful it'd be, though <<
|
||||
Yeah, why really bother? Just navigate the list and click blank now for each one.. :)
|
||||
|
||||
>> Speaking of Phantasm... sure would be way cool if T2 could use Phantasm blanker modules... but that would be one of the last things I would work on <<
|
||||
Sure, it would be cool. But I doubt if it would be practical. First off, Phantasm puts its blankers into its resource fork (EEW!!!). Second of all I don't feel like spending the time to disassemble the appropriate portions of Phantasm to decode the format (I feel my time would be better spent implementing other aspects of T2).
|
||||
|
||||
>> re: KillT2 message - wouldn't it just be easier for T2 to call KillControls to kill the controls? It'd have to re-make the pop-up, update button, and divider controls... but that'd be a heckuva lot easier than a loop to kill setup controls - especially if they're created with a single NewControl2 call which refers to a control list, eh? I don't remember if KillControls actually hides 'em first, so you'd probably have to call invalRect or something on the setup control area. <<
|
||||
When you call KillControls, I suppose it also disposes of all the memory used by the controls. Then it would dispose of the entire structure belonging to the Setup popup. Rebuilding this structure each time would be tedious and time consuming :-( However É I might be making all the references in the Setup popup as refIsPointer - if this is so then they can't be disposed of when the control is killed by killCtls. I will have to look - it's been awhile since I wrote that code. Then there is the problem of erasing the controls, as you said. I believe I tried InvalRect before using EraseControl and it did not work. What I ended up settling on was the EraseControl DisposeControl loop, and then calling InvalCtls after making the new controls.
|
||||
But the current setup isn't as difficult or tedious as you seem to imply. Sure, it might not be as good as what you're suggesting to replace it (if it is feasible that is), but it still isn't difficult - just do a loop killing off ctls with IDs 1 thru whatever the highest Id you have. I call my killCtl routine recursively (inside my modules) so killing all the ctls from a control list is easy.
|
||||
|
||||
>> re: BlankT2 message - instead of a pointer to the movement flag (which tells the module to return to T2) I think the T2Data1 parameter should be a pointer to a structure - first the movement flag, then a grafPortPtr. This would work in conjunction with a new flag bit (0=setup,1=fade in,2=fade out,3=grafPort) which would let T2 automatically call GetPort/OpenPort/SetPort before dispatching to the module (since I would hope that grafPorts would be used a lot and having each module do this is a waste of code, eh?) and then the ClosePort/SetPort calls would be made by T2 when the blanker module returns. Also, a way of specifying whether the mode should be either 320 or 640 mode would be appropriate, too, but I haven't thought about this too much... <<
|
||||
Excellent idea!!! I will try to implement it soon! Perhaps I will define 2 new bits of T2ModuleFlags: 3=grafport640, 4=grafport320. But, I'm really not too too familiar with QuickDraw II - I thought you just open up a grafport and it automatically has to use the mode QDII was started up with. So I'm kinda confused now :-)
|
||||
|
||||
>> re: Twilight.Setup - Yeek! I dunno if I like that file format. The "rT2ExtSetup2 ($1002) Reserved for internal CDev use. (Module name of selected module.)" should actually be a rPString resource, most likely with ID of 1. The "rT2ExtSetup1 ($1001) Reserved for internal CDev use. (Internal integer flags.)" is probably okay. However, the "rTilerSetup ($0100) User adjustable configuration resources for Tiler module." is what gets me. I believe that some standard types should be declared like rCheckBox ($0001?), rRadio ($0002?), (rPString and rText have already been defined) and that the preferences be saved and loaded by name, rather than by number. So, for example, if a module is named "Tiler" and it wants to load a pString, it would load the pString named "Tiler" from the Twilight.Setup file. Also, if there are more than one pStrings, it should load "Tiler - 1" and then "Tiler - 2" or something like that. What do you think about this, eh? I think it'd be much more flexible than assigning a type for each blanker. <<
|
||||
I like your ideas here as well! How come I couldn't think of that? :-) I'll try to get this done for d32 as to do it before many other people write modules.
|
||||
|
||||
>> I'd be nice if the Twilight II Active checkbox was on the main control panel window <<
|
||||
Done in d32. (Still not implemented, but it's moved :-)
|
||||
|
||||
>> I did a new T2 icon for the Twilight.Preferences file... probably not too good, buy hey, what do I know? :-) <<
|
||||
I like it! I'm adding it to the T2.Icons file! :-) Thanks a lot!
|
||||
|
||||
Thanks again for all the comments.. I appreciate it!
|
||||
|
||||
Ç Jim
|
21
source/twilight/jw/t2.junk.reply
Normal file
21
source/twilight/jw/t2.junk.reply
Normal file
@ -0,0 +1,21 @@
|
||||
Help is turning into a TextEdit control in d34. Discovered a bug in TextEdit and LETextBox2 resources in the process.
|
||||
|
||||
A background blank module will be coming in the not too distant future.
|
||||
|
||||
I now give you credit for those two suggestions of yours that I forgot to tie your name to. (oops)
|
||||
|
||||
I'll stop disabling the setup ctl for d34, and I'll add a DoubleClick: ignore function too- thanks. Look for HitT2 to change too.
|
||||
|
||||
I really don't care for the idea of giving each module its own setup - but thanks for bringing it up so I could think about it.
|
||||
|
||||
the fForce bits were slightly buggy in d33 - a combination of palette and masterSCB problems. These are fixed for d34.
|
||||
|
||||
I'll try making the YDI pathname control larger for you. Stashing your ATF's away on some huge server folder? ;-)
|
||||
|
||||
As for modules now - Messages is REAL COOL, Shapes is nifty too. You forgot to get rid of the palette buffer you previously used in the old messages but no longer is nececessary because T2 does it for you. So kill the line defining this palette. As for distribution, very soon the module format should settle down pretty much. At that time I'll rip out the guts (like I did for the tiler and shell.asm) and distribute stripped C and Pascal module shells pending your final approval.
|
||||
|
||||
Selling a whole package of modules (or including some now and then with GS+) sounds ok to me.
|
||||
|
||||
as always, many thanks for everything!!!
|
||||
|
||||
<<Jim
|
10
source/twilight/kalei/K.S
Normal file
10
source/twilight/kalei/K.S
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
nol ;turn listing off (NO List)
|
||||
ovr ;always assemble
|
||||
|
||||
asm Kalid2
|
||||
lnk Kaleidoscope.l
|
||||
|
||||
typ EXE
|
||||
sav Kalei.d
|
662
source/twilight/kalei/KALID2.S
Normal file
662
source/twilight/kalei/KALID2.S
Normal file
@ -0,0 +1,662 @@
|
||||
*------------------------------------------------*
|
||||
* *
|
||||
* Kaleidoscope *
|
||||
* A Twilight II module *
|
||||
* Derek Young, May 1992 *
|
||||
* Originally SHKalid *
|
||||
* by John Stephen III *
|
||||
* *
|
||||
* version 1.0d *
|
||||
*------------------------------------------------*
|
||||
lst off
|
||||
rel
|
||||
xc
|
||||
xc
|
||||
mx %00
|
||||
|
||||
dum 1
|
||||
dp da 0
|
||||
Bank db 0 ;This is how the stack is set up
|
||||
rtlAddr adr 0 ;with DP at the top and Result
|
||||
T2data2 adrl 0 ;occupying the top four bytes
|
||||
T2data1 adrl 0
|
||||
T2Message da 0
|
||||
T2Result adrl 0
|
||||
T2StackSize adrl 0
|
||||
dend
|
||||
|
||||
dum $F0
|
||||
MovePtr adrl 0 ;keep this out of the way
|
||||
dend
|
||||
|
||||
*-------------------------------------------------
|
||||
* start of the blanker...
|
||||
* this is a really simple blanker - no setup or
|
||||
* anything else besides "T2Blank".
|
||||
|
||||
Start
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
phd
|
||||
tdc
|
||||
sta OurDP
|
||||
tsc
|
||||
tcd
|
||||
|
||||
ldx T2Data1
|
||||
ldy T2Data1+2
|
||||
lda T2Message
|
||||
sta Mess
|
||||
|
||||
lda Mess ;Get which setup procedure to call.
|
||||
cmp #2
|
||||
beq :1
|
||||
jmp Bye ;not a message we can handle
|
||||
|
||||
:1 lda OurDP
|
||||
tcd
|
||||
|
||||
stx MovePtr ;save this in our own DP
|
||||
sty MovePtr+2
|
||||
|
||||
*-------------------------------------------------
|
||||
* The start of the program...
|
||||
|
||||
Blank sep $30
|
||||
lda #0 ;black border - don't need to save it
|
||||
stal $C034
|
||||
|
||||
;for some reason this program
|
||||
;is completely in 8-bit...
|
||||
|
||||
jsr ClrTable
|
||||
jsr MakeLookup
|
||||
lda #$01
|
||||
sta $10
|
||||
sta $11
|
||||
sta $13
|
||||
sta $15
|
||||
sta $17
|
||||
lda #$11
|
||||
sta $14
|
||||
lda #$03
|
||||
sta $16
|
||||
sta $19
|
||||
lda #$0A
|
||||
sta $18
|
||||
lda #$02
|
||||
sta $1A
|
||||
lda #$00
|
||||
sta $1B
|
||||
sta $12
|
||||
tax
|
||||
tay
|
||||
|
||||
jsr Reset
|
||||
* jsr SetPalette ;temporary!
|
||||
|
||||
Loop
|
||||
rep $20
|
||||
lda [MovePtr] ;check for any movement
|
||||
sep $20
|
||||
beq :1
|
||||
jmp Bye
|
||||
|
||||
:1 jsr H3453
|
||||
]loop tya
|
||||
clc
|
||||
adc $11
|
||||
cmp #160
|
||||
bcc H3400
|
||||
lda #0
|
||||
sec
|
||||
sbc $11
|
||||
sta $11
|
||||
bra ]loop
|
||||
|
||||
H3400 tay
|
||||
H3401 txa
|
||||
clc
|
||||
adc $10
|
||||
cmp #160
|
||||
bcc H3412
|
||||
lda #$00
|
||||
sec
|
||||
sbc $10
|
||||
sta $10
|
||||
bra H3401
|
||||
|
||||
H3412 tax
|
||||
jsr H343F
|
||||
tya
|
||||
bne Loop
|
||||
txa
|
||||
cmp $12
|
||||
bne Loop
|
||||
inx
|
||||
txa
|
||||
cmp #$A0
|
||||
bcc H3426
|
||||
lda #$00
|
||||
H3426 sta $12
|
||||
tax
|
||||
phx
|
||||
ldx $15
|
||||
H342C jsr H343F
|
||||
dex
|
||||
bne H342C
|
||||
plx
|
||||
jsr H2349
|
||||
jsr Cycle
|
||||
jsr H3485
|
||||
jmp Loop
|
||||
|
||||
*-------------------------------------------------
|
||||
* Time to quit
|
||||
|
||||
Bye rep $30 ;reg size is undefined coming in
|
||||
pld
|
||||
plb
|
||||
lda 1,s ; move up RTL address
|
||||
sta 1+10,s
|
||||
lda 2,s
|
||||
sta 2+10,s
|
||||
tsc ; Remove input parameters.
|
||||
clc
|
||||
adc #10
|
||||
tcs
|
||||
lda #0
|
||||
sta 4,s
|
||||
sta 6,s ;the result (nil for no error)
|
||||
clc
|
||||
rtl
|
||||
|
||||
Mess da 0
|
||||
OurDP da 0
|
||||
|
||||
*-------------------------------------------------
|
||||
|
||||
mx %11
|
||||
|
||||
H2003 lda #$E1
|
||||
sta $02
|
||||
rep %00100000
|
||||
txa
|
||||
xba
|
||||
lsr
|
||||
sta $00
|
||||
lsr
|
||||
lsr
|
||||
clc
|
||||
adc $00
|
||||
adc #$2000
|
||||
sta $00
|
||||
sep %00100000
|
||||
rts
|
||||
|
||||
MakeLookup ldx #$00
|
||||
]loop jsr H2003
|
||||
lda $00
|
||||
sta H21A5,X
|
||||
lda $01
|
||||
sta H20DD,X
|
||||
inx
|
||||
cpx #$C8
|
||||
bne ]loop
|
||||
|
||||
jsr ClearScreen
|
||||
|
||||
* jsr Reset ;this eliminates the blank screen beginning.
|
||||
|
||||
lda #0
|
||||
sta $03
|
||||
sta $04
|
||||
sta H23DB+0
|
||||
sta H23DB+1
|
||||
sta H23DB+2
|
||||
sta H23DB+3
|
||||
sta H23DB+4
|
||||
sta H23DB+5
|
||||
sta H23DB+6
|
||||
sta H23DB+7
|
||||
sta H23DB+8
|
||||
sta $0A
|
||||
lda #$0F
|
||||
sta H23E4
|
||||
sta H23E4+1
|
||||
sta H23E4+2
|
||||
lda #$50
|
||||
sta $08
|
||||
lda #$05
|
||||
sta $07
|
||||
lda #$FF
|
||||
sta $09
|
||||
rts
|
||||
|
||||
* Plot a point symetrically
|
||||
* This is what gives it the kaleidoscope look
|
||||
* The line number is given in X and the
|
||||
* horizontal offset in Y.
|
||||
|
||||
PlotKalid lda H20DD,X
|
||||
sta $01
|
||||
lda H21A5,X
|
||||
sta $00
|
||||
|
||||
lda $03
|
||||
sta [$00],Y
|
||||
phy
|
||||
tya
|
||||
eor #$FF
|
||||
clc
|
||||
adc #$A0
|
||||
tay
|
||||
lda $03
|
||||
sta [$00],Y
|
||||
ply
|
||||
rts
|
||||
|
||||
* Simply plot a point
|
||||
* Also to be rewritten
|
||||
|
||||
Plot lda H20DD,X
|
||||
sta $01
|
||||
lda H21A5,X
|
||||
sta $00
|
||||
lda $03
|
||||
sta [$00],Y
|
||||
rts
|
||||
|
||||
* Plot a row of pixels
|
||||
|
||||
Row sta $0B
|
||||
]loop jsr Plot
|
||||
iny
|
||||
dec $0B
|
||||
bne ]loop
|
||||
rts
|
||||
|
||||
* Plot a column of pixels
|
||||
|
||||
Column sta $0B
|
||||
]loop jsr Plot
|
||||
inx
|
||||
dec $0B
|
||||
bne ]loop
|
||||
rts
|
||||
|
||||
* scanline lookup tables
|
||||
|
||||
H20DD ds 200 ;hi byte
|
||||
H21A5 ds 200 ;middle byte
|
||||
|
||||
* Cycle the colors in the palette
|
||||
|
||||
Cycle inc $04
|
||||
lda $04
|
||||
and #%1111 ;keep it modula 16
|
||||
sta $04
|
||||
jsr SetPalette
|
||||
rts
|
||||
|
||||
* Set the palette
|
||||
|
||||
SetPalette phx
|
||||
phy
|
||||
ldx #0
|
||||
lda $04
|
||||
asl
|
||||
tay
|
||||
]loop tya
|
||||
and #%11111
|
||||
tay
|
||||
lda InitialPal,Y
|
||||
stal $E19E00,X
|
||||
iny
|
||||
inx
|
||||
cpx #32
|
||||
bne ]loop
|
||||
ply
|
||||
plx
|
||||
rts
|
||||
|
||||
* This is the starting color table
|
||||
|
||||
InitialPal da $000,$111,$222,$333,$444,$555,$666,$777
|
||||
da $888,$999,$AAA,$BBB,$CCC,$DDD,$EEE,$FFF
|
||||
|
||||
ds 8 ;a little buffer - I think this gets overwritten!
|
||||
*InitialPal ds 32
|
||||
|
||||
ClearScreen rep $30
|
||||
ldx #$8000-2
|
||||
lda #0
|
||||
]loop stal $E12000,x
|
||||
dex
|
||||
dex
|
||||
bpl ]loop
|
||||
sep $30
|
||||
rts
|
||||
|
||||
NewPalette
|
||||
H22DB phx
|
||||
phy
|
||||
ldx #$00
|
||||
:loop1 lda H23DE,X
|
||||
tay
|
||||
lda H23DB,X
|
||||
tax
|
||||
lda #16
|
||||
jsr H2447
|
||||
inx
|
||||
cpx #$03
|
||||
bne :loop1
|
||||
ldy #$00
|
||||
:loop2 ldx #$00
|
||||
jsr H24A4
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
sta InitialPal,Y
|
||||
inx
|
||||
jsr H24A4
|
||||
ora InitialPal,Y
|
||||
sta InitialPal,Y
|
||||
inx
|
||||
jsr H24A4
|
||||
sta InitialPal+1,Y
|
||||
iny
|
||||
iny
|
||||
bcc :loop2
|
||||
ply
|
||||
plx
|
||||
rts
|
||||
|
||||
* Fade from one palette to another
|
||||
|
||||
H2317 phx
|
||||
phy
|
||||
ldx #$00
|
||||
H231B lda H23E4,X
|
||||
cmp H23DE,X
|
||||
beq H232E
|
||||
bcs H232B
|
||||
dec H23DE,X
|
||||
jmp H232E
|
||||
|
||||
H232B inc H23DE,X
|
||||
H232E lda H23E1,X
|
||||
cmp H23DB,X
|
||||
beq H2341
|
||||
bcs H233E
|
||||
dec H23DB,X
|
||||
jmp H2341
|
||||
|
||||
H233E inc H23DB,X
|
||||
H2341 inx
|
||||
cpx #$03
|
||||
bne H231B
|
||||
ply
|
||||
plx
|
||||
rts
|
||||
|
||||
H2349 dec $08
|
||||
bne H2386
|
||||
Reset lda #$03
|
||||
sta $08
|
||||
phx
|
||||
phy
|
||||
jsr H2317
|
||||
jsr H22DB
|
||||
jsr SetPalette
|
||||
dec $07
|
||||
bne H2384
|
||||
lda #$28 ;Reset
|
||||
sta $07
|
||||
H2364 jsr Random
|
||||
and #$0F
|
||||
beq H2364
|
||||
cmp $09
|
||||
beq H2364
|
||||
sta $09
|
||||
tax
|
||||
lda H23AB,X
|
||||
sta H23E4
|
||||
lda H23CB,X
|
||||
sta H23E4+1
|
||||
lda H23BB,X
|
||||
sta H23E4+2
|
||||
H2384 ply
|
||||
plx
|
||||
H2386 rts
|
||||
|
||||
* I think this is a random number generator
|
||||
|
||||
Random phx
|
||||
ldx #$08
|
||||
H238A lda $05
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
eor $05
|
||||
asl
|
||||
lda $06
|
||||
rol
|
||||
sta $06
|
||||
lda $05
|
||||
rol
|
||||
sta $05
|
||||
ora $06
|
||||
bne H23A4
|
||||
lda #$01
|
||||
sta $05
|
||||
H23A4 dex
|
||||
bne H238A
|
||||
plx
|
||||
lda $06
|
||||
rts
|
||||
|
||||
* Are these for the random number generator?
|
||||
|
||||
H23AB hex 00000000
|
||||
hex 0F0F0F0F
|
||||
hex 0F0F0F0F
|
||||
hex 08080808
|
||||
|
||||
H23BB hex 00000F0F
|
||||
hex 00000F0F
|
||||
hex 0F0F0808
|
||||
hex 0F0F0808
|
||||
|
||||
H23CB hex 000F000F
|
||||
hex 000F000F
|
||||
hex 0F080F08
|
||||
hex 0F080F08
|
||||
|
||||
H23DB ds 1
|
||||
H23DC ds 1
|
||||
H23DD ds 1
|
||||
H23DE ds 1
|
||||
H23DF ds 1
|
||||
H23E0 ds 1
|
||||
H23E1 ds 1
|
||||
H23E2 ds 1
|
||||
H23E3 ds 1
|
||||
|
||||
H23E4 ds 3
|
||||
|
||||
ClrTable ldx #$00
|
||||
txa
|
||||
]loop sta H2557,X
|
||||
inx
|
||||
cpx #32
|
||||
bne ]loop
|
||||
rts
|
||||
|
||||
H2447 pha
|
||||
txa
|
||||
pha
|
||||
ldx #$00
|
||||
H244C lda H2557,X
|
||||
beq H2458 ;find the first zero
|
||||
inx
|
||||
cpx #32
|
||||
bne H244C
|
||||
brk $00 ;should never happen
|
||||
H2458 pla
|
||||
sta H24F7,X
|
||||
sta H24D7,X
|
||||
pla
|
||||
sta H25B7,X
|
||||
inc
|
||||
sta H2537,X
|
||||
tya
|
||||
sta H2517,X
|
||||
sec
|
||||
sbc H24F7,X
|
||||
beq H2484
|
||||
bcs H2490
|
||||
eor #$FF
|
||||
clc
|
||||
adc #$02
|
||||
sta H2557,X
|
||||
lda #$FF
|
||||
sta H2597,X
|
||||
bmi H249B
|
||||
H2484 lda #$01
|
||||
sta H2557,X
|
||||
stz H2597,X
|
||||
bra H249B
|
||||
H2490 inc
|
||||
sta H2557,X
|
||||
lda #$01
|
||||
sta H2597,X
|
||||
H249B STz H2577,X
|
||||
lda H24D7,X
|
||||
rts
|
||||
|
||||
H24A4 lda H25B7,X
|
||||
beq H24D0
|
||||
lda H2577,X
|
||||
clc
|
||||
adc H2557,X
|
||||
H24B0 sta H2577,X
|
||||
sec
|
||||
sbc H2537,X
|
||||
bcc H24C8
|
||||
pha
|
||||
lda H2597,X
|
||||
clc
|
||||
adc H24D7,X
|
||||
sta H24D7,X
|
||||
pla
|
||||
jmp H24B0
|
||||
|
||||
H24C8 dec H25B7,X
|
||||
lda H24D7,X
|
||||
clc
|
||||
rts
|
||||
|
||||
H24D0 stz H2557,X
|
||||
sec
|
||||
rts
|
||||
|
||||
H24D7 ds 32
|
||||
H24F7 ds 32 ;some color tables
|
||||
H2517 ds 32
|
||||
H2537 ds 32
|
||||
H2557 ds 32
|
||||
H2577 ds 32
|
||||
H2597 ds 32
|
||||
H25B7 ds 32
|
||||
|
||||
H343F dec $13
|
||||
bne H3452
|
||||
lda #$01
|
||||
sta $13
|
||||
lda $03
|
||||
clc
|
||||
adc $14
|
||||
bcc H3450
|
||||
lda #$00
|
||||
H3450 sta $03
|
||||
H3452 rts
|
||||
|
||||
H3453 phx
|
||||
phy
|
||||
tya
|
||||
txy
|
||||
tax
|
||||
jsr H3461
|
||||
ply
|
||||
plx
|
||||
jsr H3461
|
||||
rts
|
||||
|
||||
H3461 phx
|
||||
txa
|
||||
eor #$FF
|
||||
clc
|
||||
adc #200
|
||||
tax
|
||||
jsr PlotKalid
|
||||
plx
|
||||
jsr PlotKalid
|
||||
rts
|
||||
|
||||
H3485 inc $1B
|
||||
lda $1B
|
||||
cmp $18
|
||||
bcc H3498
|
||||
dec $1A
|
||||
bne H3494
|
||||
jsr H34A3
|
||||
H3494 lda #$00
|
||||
sta $1B
|
||||
H3498 cmp $19
|
||||
lda $16
|
||||
bcc H34A0
|
||||
lda $17
|
||||
H34A0 sta $15
|
||||
rts
|
||||
|
||||
H34A3 jsr Random
|
||||
and #$03
|
||||
cmp #$04
|
||||
bcs H34A3
|
||||
cmp #$00
|
||||
beq H34A3
|
||||
sta $16
|
||||
H34B2 jsr Random
|
||||
and #$03
|
||||
cmp #$04
|
||||
bcs H34B2
|
||||
cmp #$00
|
||||
beq H34B2
|
||||
sta $17
|
||||
H34C1 jsr Random
|
||||
and #$1F
|
||||
cmp #$19
|
||||
bcs H34C1
|
||||
cmp #$02
|
||||
bcc H34C1
|
||||
sta $18
|
||||
H34D0 jsr Random
|
||||
and #$1F
|
||||
cmp $18
|
||||
bcs H34D0
|
||||
cmp #$01
|
||||
bcc H34D0
|
||||
sta $19
|
||||
H34DF jsr Random
|
||||
and #$0F
|
||||
beq H34DF
|
||||
cmp #$0A
|
||||
bcs H34DF
|
||||
sta $1A
|
||||
rts
|
||||
|
||||
typ $BC
|
||||
sav Kaleidoscope.l
|
96
source/twilight/kalei/Kalei.REZ
Normal file
96
source/twilight/kalei/Kalei.REZ
Normal file
@ -0,0 +1,96 @@
|
||||
|
||||
#include "types.rez"
|
||||
#include "22:t2common.rez"
|
||||
|
||||
resource rT2ModuleFlags (moduleFlags) {
|
||||
fFadeIn +
|
||||
fFadeOut +
|
||||
fLeavesUsableScreen +
|
||||
fGrafPort320, // module flags word
|
||||
$01, // enabled flag (unimplemented)
|
||||
$0110, // minimum T2 version required
|
||||
NIL, // reserved
|
||||
"Kaleidoscope" // module name
|
||||
};
|
||||
|
||||
// --- Version resource
|
||||
|
||||
resource rVersion (moduleVersion) {
|
||||
{1,0,1,release,0}, // Version
|
||||
verUS, // US Version
|
||||
"T2 Kaleidoscope Module", // program's name
|
||||
"By Derek Young & J. Stephen 3.\n" // copyright notice
|
||||
"Copyr. 1991-93 DigiSoft Innovations."
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2 (moduleMessage) {
|
||||
TBFont TBShaston "\$00\$08"
|
||||
TBLeftJust
|
||||
TBBackColor TBColorF
|
||||
TBForeColor TBColor4 "K"
|
||||
TBForeColor TBColor1 "a"
|
||||
TBForeColor TBColor0 "l"
|
||||
TBForeColor TBColor5 "e"
|
||||
TBForeColor TBColor2 "i"
|
||||
TBForeColor TBColor7 "d"
|
||||
TBForeColor TBColor9 "o"
|
||||
TBForeColor TBColor4 "s"
|
||||
TBForeColor TBColor2 "c"
|
||||
TBForeColor TBColor1 "o"
|
||||
TBForeColor TBColor5 "p"
|
||||
TBForeColor TBColor3 "e"
|
||||
TBForeColor TBColor0
|
||||
" creates a colorful mirrored kaleidoscope effect on your computer"
|
||||
" screen.\n"
|
||||
"Based on a program by John Stephen III."
|
||||
};
|
||||
|
||||
// --- About icon resource
|
||||
|
||||
resource rIcon (moduleIcon) {
|
||||
$8000, // kind
|
||||
$0014, // height
|
||||
$001C, // width
|
||||
|
||||
$"FFF0000000000000000000000FFF"
|
||||
$"FFF0FFFFFFFFFFFFFFFFFFFF0FFF"
|
||||
$"FFF0F000000000000000000F0FFF"
|
||||
$"FFF0F00770660550BB0DD00F0FFF"
|
||||
$"FFF0F0100700700700D00A0F0FFF"
|
||||
$"FFF0F00107070EE070D0A00F0FFF"
|
||||
$"FFF0F0401050E00E050A040F0FFF"
|
||||
$"FFF0F040A050E00E0501040F0FFF"
|
||||
$"FFF0F00A0D070EE07070100F0FFF"
|
||||
$"FFF0F0A00D0070070070010F0FFF"
|
||||
$"FFF0F00DD0BB05506607700F0FFF"
|
||||
$"FFF0F000000000000000000F0FFF"
|
||||
$"FFF0FFFFFFFFFFFFFFFFAFFF0FFF"
|
||||
$"FFF0000000000000000000000FFF"
|
||||
$"FFFF0FFFFFFFFFFFFFFFFFF0FFFF"
|
||||
$"FFFF0FFFFFFFFFFFFFFFFFF0FFFF"
|
||||
$"FFFF0FF4AFFFFFFFFFFFFFF0FFFF"
|
||||
$"FFFF0CCCCCCCCCCCCCCCCCC0FFFF"
|
||||
$"FFFF0FFFFFFFFFFFFFFFAFF0FFFF"
|
||||
$"FFFF00000000000000000000FFFF",
|
||||
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"000FFFFFFFFFFFFFFFFFFFFFF000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000"
|
||||
$"0000FFFFFFFFFFFFFFFFFFFF0000";
|
||||
};
|
14
source/twilight/kalei/makefile
Normal file
14
source/twilight/kalei/makefile
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
# Kalei makefile
|
||||
# by Jim Maricondo
|
||||
# v1.0 - 1/9/93 2:15pm - coded. (Jg?!)
|
||||
|
||||
kalei.r: kalei.rez 22/t2common.rez
|
||||
compile kalei.rez keep=kalei.r
|
||||
|
||||
kaleidoscope: kalei.r kalei.d
|
||||
duplicate -d kalei.d kaleidoscope
|
||||
duplicate -r kalei.r kaleidoscope
|
||||
setfile -at $4004 -t $bc kaleidoscope -m .
|
||||
cp kaleidoscope *:system:cdevs:twilight:kaleidoscope
|
||||
22:beep
|
299
source/twilight/link/plot.asm
Normal file
299
source/twilight/link/plot.asm
Normal file
@ -0,0 +1,299 @@
|
||||
|
||||
mcopy plot.mac
|
||||
keep plot.c
|
||||
case on
|
||||
objcase on
|
||||
|
||||
init_plot Start
|
||||
|
||||
dbr equ 1
|
||||
rtlAddr equ dbr+1
|
||||
screenPtr equ rtlAddr+3
|
||||
lookupPtr equ screenPtr+4
|
||||
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
|
||||
lda lookupPtr,s
|
||||
sta patchLook+1
|
||||
lda lookupPtr+2,s
|
||||
shortm
|
||||
sta patchLook+3
|
||||
longm
|
||||
|
||||
lda screenPtr,s
|
||||
sta screen1+1
|
||||
sta screen2+1
|
||||
lda screenPtr+2,s
|
||||
shortm
|
||||
sta screen1+3
|
||||
sta screen2+3
|
||||
; lda #$C1
|
||||
; sta $e1c029
|
||||
longm
|
||||
|
||||
plb
|
||||
lda 1,s
|
||||
sta 1+8,s
|
||||
lda 2,s
|
||||
sta 2+8,s
|
||||
plx
|
||||
plx
|
||||
plx
|
||||
plx
|
||||
rtl
|
||||
|
||||
End
|
||||
|
||||
set_pixel Start
|
||||
|
||||
dbr equ 1
|
||||
rtlAddr equ dbr+1
|
||||
x_coord equ rtlAddr+3
|
||||
y_coord equ x_coord+2
|
||||
color equ y_coord+2
|
||||
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
|
||||
; brk
|
||||
|
||||
lda y_coord,s
|
||||
cmp #200
|
||||
bge return
|
||||
lda x_coord,s
|
||||
cmp #320
|
||||
bge return
|
||||
|
||||
lda x_coord,s
|
||||
lsr a
|
||||
sta x_div2+1
|
||||
|
||||
lda y_coord,s
|
||||
jsr getLookup
|
||||
clc
|
||||
x_div2 adc #0 ;x_div2
|
||||
tax
|
||||
|
||||
lda x_coord,s
|
||||
bit #1
|
||||
bne loNibble
|
||||
|
||||
hiNibble anop
|
||||
lda color,s
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
shortm
|
||||
sta color_ls4+1
|
||||
|
||||
jsr readPixel
|
||||
and #$0F
|
||||
color_ls4 ora #0 ;color_ls4
|
||||
jsr writePixel
|
||||
bra all_set
|
||||
|
||||
loNibble anop
|
||||
shortm
|
||||
jsr readPixel
|
||||
and #$F0
|
||||
ora color,s
|
||||
jsr writePixel
|
||||
|
||||
all_set longm
|
||||
|
||||
return plb
|
||||
lda 1,s
|
||||
sta 1+6,s
|
||||
lda 2,s
|
||||
sta 2+6,s
|
||||
plx
|
||||
plx
|
||||
plx
|
||||
rtl
|
||||
|
||||
End
|
||||
|
||||
get_pixel Start
|
||||
|
||||
dbr equ 1
|
||||
rtlAddr equ dbr+1
|
||||
x_coord equ rtlAddr+3
|
||||
y_coord equ x_coord+2
|
||||
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
|
||||
lda y_coord,s
|
||||
cmp #200
|
||||
blt y_good
|
||||
ldy #$F
|
||||
bra return
|
||||
x_bad anop
|
||||
ldy #0
|
||||
bra return
|
||||
y_good lda x_coord,s
|
||||
cmp #320
|
||||
bge x_bad
|
||||
|
||||
lda x_coord,s
|
||||
lsr a
|
||||
sta x_div2+1
|
||||
|
||||
lda y_coord,s
|
||||
jsr getLookup
|
||||
clc
|
||||
x_div2 adc #0 ;x_div2
|
||||
tax
|
||||
|
||||
lda x_coord,s
|
||||
bit #1
|
||||
bne loNibble
|
||||
|
||||
hiNibble anop
|
||||
shortm
|
||||
jsr readPixel
|
||||
and #$F0
|
||||
lsr a
|
||||
lsr a
|
||||
lsr a
|
||||
lsr a
|
||||
bra all_set
|
||||
|
||||
loNibble anop
|
||||
shortm
|
||||
jsr readPixel
|
||||
; and #$0F
|
||||
|
||||
all_set longm
|
||||
and #$000F
|
||||
tay
|
||||
return plb
|
||||
lda 1,s
|
||||
sta 1+4,s
|
||||
lda 2,s
|
||||
sta 2+4,s
|
||||
plx
|
||||
plx
|
||||
tya
|
||||
rtl
|
||||
|
||||
End
|
||||
|
||||
readPixel Start
|
||||
|
||||
screen1 entry
|
||||
lda >0,x
|
||||
rts
|
||||
|
||||
End
|
||||
|
||||
writePixel Start
|
||||
|
||||
screen2 entry
|
||||
sta >0,x
|
||||
rts
|
||||
|
||||
End
|
||||
|
||||
getset_pixel Start
|
||||
|
||||
dbr equ 1
|
||||
rtlAddr equ dbr+1
|
||||
x_coord equ rtlAddr+3
|
||||
y_coord equ x_coord+2
|
||||
color equ y_coord+2
|
||||
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
|
||||
lda #0
|
||||
sta returnPixel+1
|
||||
|
||||
lda y_coord,s
|
||||
cmp #200
|
||||
blt y_good
|
||||
lda #$F
|
||||
sta returnPixel+1
|
||||
bra return
|
||||
y_good lda x_coord,s
|
||||
cmp #320
|
||||
bge return ; x is bad
|
||||
|
||||
lda x_coord,s
|
||||
lsr a
|
||||
sta x_div2+1
|
||||
|
||||
lda y_coord,s
|
||||
jsr getLookup
|
||||
clc
|
||||
x_div2 adc #0 ;x_div2
|
||||
tax
|
||||
|
||||
lda x_coord,s
|
||||
bit #1
|
||||
bne loNibble
|
||||
|
||||
hiNibble anop
|
||||
lda color,s
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
shortm
|
||||
sta color_ls4+1
|
||||
|
||||
jsr readPixel
|
||||
pha
|
||||
and #$F0
|
||||
lsr a
|
||||
lsr a
|
||||
lsr a
|
||||
lsr a
|
||||
sta returnPixel+1
|
||||
pla
|
||||
and #$0F
|
||||
color_ls4 ora #0 ;color_ls4
|
||||
jsr writePixel
|
||||
bra all_set
|
||||
|
||||
loNibble anop
|
||||
shortm
|
||||
jsr readPixel
|
||||
pha
|
||||
and #$0F
|
||||
sta returnPixel+1
|
||||
pla
|
||||
and #$F0
|
||||
ora color,s
|
||||
jsr writePixel
|
||||
|
||||
all_set longm
|
||||
|
||||
return plb
|
||||
lda 1,s
|
||||
sta 1+6,s
|
||||
lda 2,s
|
||||
sta 2+6,s
|
||||
plx
|
||||
plx
|
||||
plx
|
||||
returnPixel lda #0
|
||||
rtl
|
||||
|
||||
End
|
||||
|
||||
getLookup Start
|
||||
|
||||
asl a
|
||||
tax
|
||||
patchLook entry
|
||||
lda >0,x
|
||||
rts
|
||||
|
||||
End
|
BIN
source/twilight/link/plot.c
Normal file
BIN
source/twilight/link/plot.c
Normal file
Binary file not shown.
7
source/twilight/link/plot.h
Normal file
7
source/twilight/link/plot.h
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
/* Plot v1.2 */
|
||||
extern void init_plot(char * screenPtr, char * lookupPtr);
|
||||
extern int get_pixel(int x, int y);
|
||||
/* set_pixel and getset_pixel return F if y>199, or 0 if x>319 */
|
||||
extern void set_pixel(int x, int y, int color);
|
||||
extern int getset_pixel(int x, int y, int color);
|
12
source/twilight/link/plot.mac
Normal file
12
source/twilight/link/plot.mac
Normal file
@ -0,0 +1,12 @@
|
||||
MACRO
|
||||
&lab longm
|
||||
&lab ANOP
|
||||
rep #%00100000
|
||||
longa on
|
||||
MEND
|
||||
MACRO
|
||||
&lab shortm
|
||||
&lab ANOP
|
||||
sep #%00100000
|
||||
longa off
|
||||
MEND
|
69
source/twilight/link/plot2.asm
Normal file
69
source/twilight/link/plot2.asm
Normal file
@ -0,0 +1,69 @@
|
||||
|
||||
mcopy plot2.mac
|
||||
keep plot2.c
|
||||
case on
|
||||
objcase on
|
||||
copy 13/ainclude/e16.locator
|
||||
copy 22:t2common.equ
|
||||
|
||||
* void init_plot(char * screenPtr, char * lookupPtr, char * targetStr)
|
||||
|
||||
init_plot Start
|
||||
|
||||
dpr equ 1
|
||||
dbr equ dpr+2
|
||||
rtlAddr equ dbr+1
|
||||
screenPtr equ rtlAddr+3
|
||||
lookupPtr equ screenPtr+4
|
||||
targetStr equ lookupPtr+4
|
||||
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
phd
|
||||
tsc
|
||||
tcd
|
||||
|
||||
PushWord #t2PrivGetProcs
|
||||
PushWord #stopAfterOne+sendToName
|
||||
pei <targetStr+2
|
||||
pei <targetStr
|
||||
PushWord #8 ; start (3rd proc)
|
||||
PushWord #24 ; end (thru 6th proc)
|
||||
PushLong #plotDataOut
|
||||
_SendRequest
|
||||
|
||||
pei <lookupPtr+2
|
||||
pei <lookupPtr
|
||||
pei <screenPtr+2
|
||||
pei <screenPtr
|
||||
jsl setup_plot
|
||||
|
||||
pld
|
||||
plb
|
||||
lda 1,s
|
||||
sta 1+12,s
|
||||
lda 2,s
|
||||
sta 2+12,s
|
||||
tsc
|
||||
clc
|
||||
adc #12
|
||||
tcs
|
||||
rtl
|
||||
|
||||
plotDataOut anop
|
||||
ds 2
|
||||
setup_plot entry
|
||||
rtl
|
||||
ds 3
|
||||
get_pixel entry
|
||||
rtl
|
||||
ds 3
|
||||
set_pixel entry
|
||||
rtl
|
||||
ds 3
|
||||
getset_pixel entry
|
||||
rtl
|
||||
ds 3
|
||||
|
||||
End
|
BIN
source/twilight/link/plot2.c
Normal file
BIN
source/twilight/link/plot2.c
Normal file
Binary file not shown.
9
source/twilight/link/plot2.h
Normal file
9
source/twilight/link/plot2.h
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
/* Plot v2 - 18 Jan 93 JRM */
|
||||
extern void init_plot(char * screenPtr, char * lookupPtr, char * targetStr);
|
||||
/* You should not have to call setup_plot - init_plot does it for you */
|
||||
extern void setup_plot(char * screenPtr, char * lookupPtr);
|
||||
extern int get_pixel(int x, int y);
|
||||
/* set_pixel and getset_pixel return F if y>199, or 0 if x>319 */
|
||||
extern void set_pixel(int x, int y, int color);
|
||||
extern int getset_pixel(int x, int y, int color);
|
60
source/twilight/link/plot2.mac
Normal file
60
source/twilight/link/plot2.mac
Normal file
@ -0,0 +1,60 @@
|
||||
MACRO
|
||||
&lab pushlong &addr,&offset
|
||||
&lab ANOP
|
||||
LCLC &C
|
||||
LCLC &REST
|
||||
&C AMID &addr,1,1
|
||||
AIF "&C"="#",.immediate
|
||||
AIF "&C"="[",.zeropage
|
||||
AIF C:&offset=0,.nooffset
|
||||
AIF "&offset"="s",.stack
|
||||
pushword &addr+2,&offset
|
||||
pushword &addr,&offset
|
||||
MEXIT
|
||||
.nooffset
|
||||
pushword &addr+2
|
||||
pushword &addr
|
||||
MEXIT
|
||||
.immediate
|
||||
&REST AMID &addr,2,L:&addr-1
|
||||
dc I1'$F4',I2'(&REST)|-16'
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEXIT
|
||||
.stack
|
||||
pushword &addr+2,s
|
||||
pushword &addr+2,s
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&offset+2
|
||||
pushword &addr,y
|
||||
ldy #&offset
|
||||
pushword &addr,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushword &SYSOPR
|
||||
&lab ANOP
|
||||
AIF C:&SYSOPR=0,.b
|
||||
LCLC &C
|
||||
&C AMID "&SYSOPR",1,1
|
||||
AIF ("&C"="#").AND.(S:LONGA),.immediate
|
||||
lda &SYSOPR
|
||||
pha
|
||||
MEXIT
|
||||
.b
|
||||
pha
|
||||
MEXIT
|
||||
.immediate
|
||||
LCLC &REST
|
||||
LCLA &BL
|
||||
&BL ASEARCH "&SYSOPR"," ",1
|
||||
AIF &BL>0,.a
|
||||
&BL SETA L:&SYSOPR+1
|
||||
.a
|
||||
&REST AMID "&SYSOPR",2,&BL-2
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEND
|
||||
macro
|
||||
&lab _SendRequest
|
||||
&lab ldx #$1c01
|
||||
jsl $E10000
|
||||
mend
|
8
source/twilight/link/random.about
Normal file
8
source/twilight/link/random.about
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
Prototypes for random:
|
||||
|
||||
extern int random(void);
|
||||
extern void set_random_seed(void);
|
||||
|
||||
random returns an integer between 0 and 0xFFFF.
|
||||
set_random_seed sets the random seed for you, based on GetTick and VERTCNT.
|
91
source/twilight/link/random.asm
Normal file
91
source/twilight/link/random.asm
Normal file
@ -0,0 +1,91 @@
|
||||
|
||||
*------------------------------------------------*
|
||||
* "random" returns a random number in A *
|
||||
* "set_seed" seeds the generator from the clock *
|
||||
* *
|
||||
* Adapted from the Merlin 16+ package by Derek *
|
||||
* Young. *
|
||||
*------------------------------------------------*
|
||||
|
||||
case on
|
||||
|
||||
random Start
|
||||
clc
|
||||
phx
|
||||
phy
|
||||
ldx INDEXI
|
||||
ldy INDEXJ
|
||||
lda ARRAY-2,X
|
||||
adc ARRAY-2,Y
|
||||
sta ARRAY-2,X
|
||||
dex
|
||||
dex
|
||||
bne DY
|
||||
ldx #17*2 ;Cycle index if at end of
|
||||
DY dey ; the array
|
||||
dey
|
||||
bne SETIX
|
||||
ldy #17*2
|
||||
SETIX stx INDEXI
|
||||
sty INDEXJ
|
||||
ply
|
||||
plx
|
||||
rtl
|
||||
|
||||
INDEXI dc i'17*2' ;The relative positions of
|
||||
INDEXJ dc i'5*2' ; these indexes is crucial
|
||||
|
||||
ARRAY dc i'1,1,2,3,5,8,13,21,54,75,129,204'
|
||||
dc i'323,527,850,1377,2227'
|
||||
|
||||
seed anop
|
||||
pha
|
||||
ora #1 ;At least one must be odd
|
||||
sta ARRAY
|
||||
stx ARRAY+2
|
||||
phx ;Push index regs on stack
|
||||
phy
|
||||
ldx #30
|
||||
loop sta ARRAY+2,X
|
||||
dex
|
||||
dex
|
||||
lda 1,S ;Was Y
|
||||
sta ARRAY+2,X
|
||||
dex
|
||||
dex
|
||||
lda 3,S ;Was X
|
||||
sta ARRAY+2,X
|
||||
lda 5,S ;Original A
|
||||
dex
|
||||
dex
|
||||
bne loop
|
||||
lda #17*2
|
||||
sta INDEXI ;Init proper indexes
|
||||
lda #5*2 ; into array
|
||||
sta INDEXJ
|
||||
jsl random ;Warm the generator up.
|
||||
jsl random
|
||||
jsl random
|
||||
jsl random
|
||||
ply
|
||||
plx
|
||||
pla
|
||||
rtl
|
||||
|
||||
VERTCNT equ >$E0C02E ;Vertical scanline counter
|
||||
|
||||
* Set random number seed
|
||||
|
||||
set_random_seed entry
|
||||
pha
|
||||
pha
|
||||
ldx #$2503 ;_GetTick
|
||||
jsl $E10000
|
||||
ply
|
||||
pla
|
||||
eor #'DY' ;mix X up a bit (it's not as random)
|
||||
tax
|
||||
lda VERTCNT
|
||||
bra seed
|
||||
|
||||
End
|
28
source/twilight/link/random2.asm
Normal file
28
source/twilight/link/random2.asm
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
case on
|
||||
keep random2.c
|
||||
mcopy random2.mac
|
||||
copy 22:t2common.equ
|
||||
copy 2:ainclude:e16.locator
|
||||
|
||||
init_random Start
|
||||
PushWord #t2PrivGetProcs
|
||||
PushWord #stopAfterOne+sendToName
|
||||
PushLong #toT2String
|
||||
PushLong #8
|
||||
PushLong #dataOut
|
||||
_SendRequest
|
||||
jsl set_random_seed
|
||||
rtl
|
||||
|
||||
toT2String entry
|
||||
str 'DYA~Twilight II~'
|
||||
|
||||
dataOut anop
|
||||
ds 2
|
||||
set_random_seed entry
|
||||
ds 4
|
||||
random entry
|
||||
ds 4
|
||||
|
||||
End
|
BIN
source/twilight/link/random2.c
Normal file
BIN
source/twilight/link/random2.c
Normal file
Binary file not shown.
64
source/twilight/link/random2.mac
Normal file
64
source/twilight/link/random2.mac
Normal file
@ -0,0 +1,64 @@
|
||||
MACRO
|
||||
&lab pushlong &addr,&offset
|
||||
&lab ANOP
|
||||
LCLC &C
|
||||
LCLC &REST
|
||||
&C AMID &addr,1,1
|
||||
AIF "&C"="#",.immediate
|
||||
AIF "&C"="[",.zeropage
|
||||
AIF C:&offset=0,.nooffset
|
||||
AIF "&offset"="s",.stack
|
||||
pushword &addr+2,&offset
|
||||
pushword &addr,&offset
|
||||
MEXIT
|
||||
.nooffset
|
||||
pushword &addr+2
|
||||
pushword &addr
|
||||
MEXIT
|
||||
.immediate
|
||||
&REST AMID &addr,2,L:&addr-1
|
||||
dc I1'$F4',I2'(&REST)|-16'
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEXIT
|
||||
.stack
|
||||
pushword &addr+2,s
|
||||
pushword &addr+2,s
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&offset+2
|
||||
pushword &addr,y
|
||||
ldy #&offset
|
||||
pushword &addr,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushword &SYSOPR
|
||||
&lab ANOP
|
||||
AIF C:&SYSOPR=0,.b
|
||||
LCLC &C
|
||||
&C AMID "&SYSOPR",1,1
|
||||
AIF ("&C"="#").AND.(S:LONGA),.immediate
|
||||
lda &SYSOPR
|
||||
pha
|
||||
MEXIT
|
||||
.b
|
||||
pha
|
||||
MEXIT
|
||||
.immediate
|
||||
LCLC &REST
|
||||
LCLA &BL
|
||||
&BL ASEARCH "&SYSOPR"," ",1
|
||||
AIF &BL>0,.a
|
||||
&BL SETA L:&SYSOPR+1
|
||||
.a
|
||||
&REST AMID "&SYSOPR",2,&BL-2
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEND
|
||||
macro
|
||||
&lab _SendRequest
|
||||
&lab ldx #$1c01
|
||||
jsl $E10000
|
||||
mend
|
||||
MACRO
|
||||
&lab str &string
|
||||
&lab dc i1'L:&string',C'&string'
|
||||
MEND
|
6
source/twilight/link/random3.H
Normal file
6
source/twilight/link/random3.H
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
/* Random v3 - JRM */
|
||||
extern int random(void);
|
||||
/* init_random will call set_random_seed for you! */
|
||||
extern void init_random(char *);
|
||||
extern void set_random_seed(void);
|
43
source/twilight/link/random3.asm
Normal file
43
source/twilight/link/random3.asm
Normal file
@ -0,0 +1,43 @@
|
||||
|
||||
case on
|
||||
keep random3.c
|
||||
mcopy random2.mac
|
||||
copy 22:t2common.equ
|
||||
copy 2:ainclude:e16.locator
|
||||
|
||||
init_random Start
|
||||
|
||||
rtlAddr equ 1
|
||||
targetStr equ rtlAddr+3
|
||||
|
||||
lda targetStr+2,s
|
||||
tax
|
||||
lda targetStr,s
|
||||
|
||||
PushWord #t2PrivGetProcs
|
||||
PushWord #stopAfterOne+sendToName
|
||||
phx
|
||||
pha
|
||||
PushLong #8
|
||||
PushLong #dataOut
|
||||
_SendRequest
|
||||
jsl set_random_seed
|
||||
|
||||
lda 1,s
|
||||
sta 1+4,s
|
||||
lda 2,s
|
||||
sta 2+4,s
|
||||
plx
|
||||
plx
|
||||
rtl
|
||||
|
||||
dataOut anop
|
||||
ds 2
|
||||
set_random_seed entry
|
||||
rtl
|
||||
ds 3
|
||||
random entry
|
||||
rtl
|
||||
ds 3
|
||||
|
||||
End
|
43
source/twilight/link/rnd.asm
Normal file
43
source/twilight/link/rnd.asm
Normal file
@ -0,0 +1,43 @@
|
||||
|
||||
case off
|
||||
keep random3.a
|
||||
mcopy random2.mac
|
||||
copy 22:t2common.equ
|
||||
copy 2:ainclude:e16.locator
|
||||
|
||||
init_random Start
|
||||
|
||||
rtlAddr equ 1
|
||||
targetStr equ rtlAddr+3
|
||||
|
||||
lda targetStr+2,s
|
||||
tax
|
||||
lda targetStr,s
|
||||
|
||||
PushWord #t2PrivGetProcs
|
||||
PushWord #stopAfterOne+sendToName
|
||||
phx
|
||||
pha
|
||||
PushLong #8
|
||||
PushLong #dataOut
|
||||
_SendRequest
|
||||
jsl set_random_seed
|
||||
|
||||
lda 1,s
|
||||
sta 1+4,s
|
||||
lda 2,s
|
||||
sta 2+4,s
|
||||
plx
|
||||
plx
|
||||
rtl
|
||||
|
||||
dataOut anop
|
||||
ds 2
|
||||
set_random_seed entry
|
||||
rtl
|
||||
ds 3
|
||||
random entry
|
||||
rtl
|
||||
ds 3
|
||||
|
||||
End
|
48
source/twilight/link/testplot.cc
Normal file
48
source/twilight/link/testplot.cc
Normal file
@ -0,0 +1,48 @@
|
||||
|
||||
#include "plot.h"
|
||||
#include <quickdraw.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/*#pragma rtl*/
|
||||
#pragma debug 0
|
||||
#pragma optimize -1
|
||||
#pragma lint -1
|
||||
#pragma keep "testplot"
|
||||
|
||||
void main(void);
|
||||
|
||||
void main(void) {
|
||||
|
||||
int line,p;
|
||||
|
||||
init_plot((char *)0xE10000l,(char *)GetAddress(1));
|
||||
/* InitColorTable(0xE19E00l);
|
||||
SetAllSCBs(00);
|
||||
ClearScreen(NIL);*/
|
||||
|
||||
asm {
|
||||
brk 0xff;
|
||||
}
|
||||
p = get_pixel(7,201);
|
||||
|
||||
for (line = 0; line < 200; line++) {
|
||||
set_pixel(0,line,0xFu);
|
||||
set_pixel(7,line,0x3u);
|
||||
set_pixel(4,line,0x7u);
|
||||
}
|
||||
|
||||
/* p = get_pixel(0,132);
|
||||
asm {
|
||||
brk 0xff;
|
||||
}
|
||||
p = get_pixel(7,0);
|
||||
asm {
|
||||
brk 0xff;
|
||||
}
|
||||
p = get_pixel(4,89);
|
||||
asm {
|
||||
brk 0xff;
|
||||
} */
|
||||
|
||||
exit(0);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user