Add files via upload

This commit is contained in:
Antoine Vignau 2020-06-08 23:01:22 +02:00 committed by GitHub
parent 58c81c2673
commit fc2b1041d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 3873 additions and 0 deletions

View File

@ -0,0 +1,28 @@
# Twilight II Moire UNIX MakeFile
# by Jim Maricondo
# v1.0 - 10/24/92 8:06pm
# v1.1 - 12/23/92 4:52pm
# v1.1.1 - 1/9/93 1:17am
# First deal with all the dfork...
moire.d.root: moire.cc moire.h 22/t2.h
compile +w moire.cc keep=moire.d
moire.d: moire.d.root 22/random3.c.root
link +w moire.d 22:random3.c keep=moire.d
# Now work with the rfork...
moire.r: moire.rez 22/t2common.rez
compile moire.rez keep=moire.r
# Now put it together.
moire: moire.r moire.d
duplicate -d moire.d moire
duplicate -r moire.r moire
setfile -at $4004 -t $bc moire -m .
cp moire :jim1:system:cdevs:twilight:moire
22:beep

View File

@ -0,0 +1,478 @@
/*
* MOIRE!
*
* An all new Twilight II module! (EXE version.)
* By Jim Maricondo, August 10-13, 1992. Copyright 1992, All rights reserved.
*
* This is an improved C version of two different moire programs, one
* (following) in BASIC, and one in TML Pascal.
*
10 HGR2 :A = 5
20 X1 = RND (1) * 279:Y1 = RND (1) * 191
30 C = C + 1: IF C = 8 THEN C = 0
40 HCOLOR= C:Y = 191
50 FOR X = 0 TO 279 STEP A
60 HPLOT X,191 TO X1,Y1 TO 279 - X,0
70 NEXT X
80 FOR Y = 0 TO 191 STEP A
90 HPLOT 279,191 - Y TO X1,Y1 TO 0,Y
100 NEXT Y
110 FOR I = 1 TO 500: NEXT I
120 IF PEEK ( - 16384) = 155 THEN POKE - 16368,0: TEXT : END
130 GOTO 20
*
* v1.0 - 10-13 August 1992 - JRM:
* = initial version
* v1.0.1b1 - date unknown - JRM:
* = updated for new random stuff
* v1.0.1b2 - 23 December 92 - JRM:
* = updated for new LoadConfigResource proc
* = cleaned up code a LOT
*
*/
#pragma keep "moire.d"
#pragma optimize -1
#pragma cdev Moire
#include "moire.h"
#pragma lint -1
/* Strings */
char toT2String[]=toT2Str;
/* Resource name strings */
char DrawDelayStr[]="\pMoire: DrawDelay";
char ColorsStr[]="\pMoire: Colors";
char ClearScreenStr[]="\pMoire: ClearScrn";
/* Global Variables */
Word DrawDelay; /* Drawing delay */
Word Colors; /* Colors to use */
Word ClearScrn; /* How often to clear the screen */
Word *movePtr;
Word SetupFileNumber;
GrafPortPtr SetupWindow;
/* Prototypes */
int moire_effect_a(void);
int moire_effect_b(void);
void SaveConfigResource(char *, word);
word LoadConfigResource(char *, word);
LongWord MakeT2Moire(void);
void LoadSetupT2Moire(void);
LongWord HitT2Moire(LongWord);
void SaveT2Moire(void);
LongWord BlankT2Moire(void);
/* Random v3 */
extern int random(void);
extern void set_random_seed(void);
extern void init_random(char *);
/* Routines */
/*------ MOIRE main event loop ------*/
/*****************************************************************************\
|* BlankT2Moire
|* This function performs the screen blanking activities.
\*****************************************************************************/
LongWord BlankT2Moire(void) {
unsigned int r, i, c;
long TargetTick;
unsigned char *SrcTbl;
int CSOverride;
SetPenMode(modeCopy);
init_random(toT2String);
if (Colors == cRandomMItemID)
Colors = (random() & 7) + 1; /* get a number from 1 thru 8 */
if (Colors == cPastelsMItemID)
SrcTbl = &Pastels_Palette[0];
else if (Colors == cLandscapeMItemID)
SrcTbl = &Landscape_Palette[0];
else if (Colors == cBrightSunMItemID)
SrcTbl = &Bright_Sun_Palette[0];
else if (Colors == cDarkSunMItemID)
SrcTbl = &Dark_Sun_Palette[0];
else if (Colors == cBluescaleMItemID)
SrcTbl = &Bluescale_Palette[0];
else if (Colors == cGrayscaleMItemID)
SrcTbl = &Grayscale_Palette[0];
else if (Colors == cBlueDefaultMItemID)
SrcTbl = &Blue_Default_Palette[0];
if (Colors != cDefaultMItemID)
SetColorTable(0u, SrcTbl);
if (ClearScrn == csNeverMItemID) {
CSOverride = TRUE;
ClearScrn = cs1MoireMItemID;
}
else
CSOverride = FALSE;
if (DrawDelay == ddNoneMItemID)
DrawDelay = 0;
while (!(*movePtr)) {
if (!(r = (random() & 3))) { /* r = 0 thru 3 (%00 thru %11) */
if (!CSOverride)
ClearScreen(0);
for (i = 0; i < ClearScrn; i++) {
if (moire_effect_a())
goto done;
TargetTick = GetTick () + (DrawDelay * 60);
while ((!(*movePtr)) && (GetTick () < TargetTick))
GetNextEvent(deskAccEvt+keyDownEvt+autoKeyEvt, &evtRec);
if (*movePtr)
goto done;
}
}
else if (r == 1) {
if (!CSOverride)
ClearScreen(0);
for (i = 0; i < ClearScrn; i++) {
if (moire_effect_b())
goto done;
TargetTick = GetTick () + (DrawDelay * 60);
while ((!(*movePtr)) && (GetTick () < TargetTick))
GetNextEvent(deskAccEvt+keyDownEvt+autoKeyEvt, &evtRec);
if (*movePtr)
goto done;
}
}
else { /* r = 2 or r = 3 */
if (!CSOverride) {
ClearScreen(0);
for (i = 0; i < (ClearScrn>>1); i++) {
if (ClearScrn == cs1MoireMItemID)
ClearScreen(0);
if (moire_effect_a())
goto done;
TargetTick = GetTick () + (DrawDelay * 60);
while ((!(*movePtr)) && (GetTick () < TargetTick))
GetNextEvent(deskAccEvt+keyDownEvt+autoKeyEvt, &evtRec);
if (*movePtr)
goto done;
if (ClearScrn == cs1MoireMItemID)
ClearScreen(0);
if (moire_effect_b())
goto done;
TargetTick = GetTick () + (DrawDelay * 60);
while ((!(*movePtr)) && (GetTick () < TargetTick))
GetNextEvent(deskAccEvt+keyDownEvt+autoKeyEvt, &evtRec);
if (*movePtr)
goto done;
}
}
}
}
done:
/* No error occurred, so return a NULL handle */
return (LongWord) NULL;
}
/*------ MOIRE type A moire routine (from BASIC) ------*/
int moire_effect_a(void) {
unsigned int step;
unsigned int moire_center_x, moire_center_y;
unsigned int x, y;
step = (random() % 19) + 6; /* 6 to 25 */
moire_center_x = (unsigned int) random() % (MAX_X-1);
moire_center_y = (unsigned int) random() % (MAX_Y-1);
Set640Color(random() & 0xF);
y = MAX_Y-1;
for (x = 0; x < MAX_X; x += step) {
MoveTo(x, MAX_Y-1);
LineTo(moire_center_x, moire_center_y);
LineTo((MAX_X - 1 - x), 0);
GetNextEvent(deskAccEvt+keyDownEvt+autoKeyEvt, &evtRec);
if (*movePtr)
return(TRUE);
}
for (y = 0; y < MAX_Y; y += step) {
MoveTo(MAX_X, (MAX_Y - 1 - y));
LineTo(moire_center_x, moire_center_y);
LineTo(0, y);
GetNextEvent(deskAccEvt+keyDownEvt+autoKeyEvt, &evtRec);
if (*movePtr)
return(TRUE);
}
return(FALSE);
}
/*------ MOIRE type B moire routine (from pascal) ------*/
int moire_effect_b(void) {
int moire_center_x, moire_center_y;
int x, y, i, i2;
moire_center_x = (unsigned int) random() % (MAX_X-1);
moire_center_y = (unsigned int) random() % (MAX_Y-1);
Set640Color(random() & 0xF);
for (i = 0; i < 180; i++) {
MoveTo(moire_center_x, moire_center_y);
x = SinTable[i]; /* sine i */
i2 = i - 45;
if (i2 < 0)
i2 += 180;
y = SinTable[i2]; /* cosine i */
LineTo((x + moire_center_x), (y + moire_center_y));
GetNextEvent(deskAccEvt+keyDownEvt+autoKeyEvt, &evtRec);
if (*movePtr)
return(TRUE);
}
return(FALSE);
}
/*****************************************************************************\
|* 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), GetCurResourceApp(), attrLocked, 0L);
**ConfigData = SaveValue;
/* Find a new ID for the resource and add it */
ResourceID = UniqueResourceID (0, rT2ModuleWord);
AddResource ((Handle) ConfigData, 0, rT2ModuleWord, ResourceID);
if (toolerror ())
DisposeHandle ((Handle) ConfigData);
else
{
/* Set the name of the resource if it was added correctly */
RMSetResourceName (rT2ModuleWord, ResourceID, Name);
UpdateResourceFile (SetupFileNumber);
}
}
/*****************************************************************************\
|* 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, fileID;
Long rID;
Handle ConfigData;
/**************************************/
/* Attempt to load the named resource */
/**************************************/
rID = RMFindNamedResource((Word) rT2ModuleWord, (Ptr) Name, &fileID);
ConfigData = LoadResource((Word) rT2ModuleWord, rID);
if (toolerror ())
Result = DefaultValue; /* Resource does not exist, so return the default value */
else {
HLock(ConfigData); /* Resource exists, return the rT2Module word value */
Result = **(word **)ConfigData;
HUnlock(ConfigData);
ReleaseResource(3, (Word) rT2ModuleWord, rID);
}
return Result;
}
/*****************************************************************************\
|* LoadSetupT2Moire-
|* This function loads in the messages configuration data.
\*****************************************************************************/
void LoadSetupT2Moire(void) {
DrawDelay = LoadConfigResource (DrawDelayStr, ddNoneMItemID);
Colors = LoadConfigResource (ColorsStr, cRandomMItemID);
ClearScrn = LoadConfigResource (ClearScreenStr, cs6MoireMItemID);
}
/*****************************************************************************\
|* MakeT2Moire-
|* This function creates the controls for the messages setup window
|* and sets the value of the controls the the current setup.
\*****************************************************************************/
LongWord MakeT2Moire(void) {
int i;
Word FileNumber;
/* Save current resource file and switch in Twilight.Setup */
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
/* Make absolutely sure that the messages configuration data is loaded */
LoadSetupT2Moire();
/* Restore old resource file */
SetCurResourceFile (FileNumber);
/* Create setup controls and set their states to match current setup */
NewControl2 (SetupWindow, resourceToResource, MainControlList);
SetCtlValue (DrawDelay, GetCtlHandleFromID (SetupWindow, DrawDelayPopCtl));
SetCtlValue (Colors, GetCtlHandleFromID (SetupWindow, ColorsPopCtl));
SetCtlValue (ClearScrn, GetCtlHandleFromID (SetupWindow, ClearScreenPopCtl));
/* Return the number of the last control */
return IconCtl;
}
/*****************************************************************************\
|* HitT2Moire- *|
|* 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 HitT2Moire(LongWord ControlHit) {
LongWord EnableFlag = 0L;
if (ControlHit == ClearScreenPopCtl)
EnableFlag = 1L;
if (ControlHit == ColorsPopCtl)
EnableFlag = 1L;
if (ControlHit == DrawDelayPopCtl)
EnableFlag = 1L;
/* Return the update button enable flag */
return EnableFlag;
}
/*****************************************************************************\
|* SaveT2Moire- *|
|* This function saves the values of all setup controls. *|
\*****************************************************************************/
void SaveT2Moire(void) {
Word FileNumber;
/* Save current resource file and switch in Twilight.Setup */
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
/* Save control values */
DrawDelay = GetCtlValue (GetCtlHandleFromID (SetupWindow, DrawDelayPopCtl));
SaveConfigResource (DrawDelayStr, DrawDelay);
Colors = GetCtlValue (GetCtlHandleFromID (SetupWindow, ColorsPopCtl));
SaveConfigResource (ColorsStr, Colors);
ClearScrn = GetCtlValue (GetCtlHandleFromID (SetupWindow, ClearScreenPopCtl));
SaveConfigResource (ClearScreenStr, ClearScrn);
/* Restore old resource file */
SetCurResourceFile (FileNumber);
}
/*****************************************************************************\
|* Moire-
|* This function checks the Twilight II message parameter and *|
|* dispatches control to the appropriate message handler. *|
\*****************************************************************************/
LongWord Moire (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 = MakeT2Moire();
break;
case SaveT2:
SaveT2Moire();
break;
case BlankT2:
movePtr=(Word *) data1;
Result = BlankT2Moire();
break;
case LoadSetupT2:
LoadSetupT2Moire();
case UnloadSetupT2:
case KillT2:
break;
case HitT2:
Result = HitT2Moire(data2);
break;
}
return Result;
}

View File

@ -0,0 +1,139 @@
#include <control.h>
#include <event.h>
#include <memory.h>
#include <orca.h>
#include <quickdraw.h>
#include <resources.h>
#include <window.h>
#include <misctool.h>
#include "22:t2.h"
/*#define deskAccEvt 0x000A
#define nullEvt 0x0000 */
#define MAX_X 640
#define MAX_Y 200
#define PI 3.141592653589793
#define DEGTORAD 2.0*PI/360.0
#define MainControlList 0x00000001L
#define DrawDelayPopCtl 1L
#define ColorsPopCtl 2L
#define ClearScreenPopCtl 3L
#define MoireTextCtl 4L
#define IconCtl 5L
/* Palettes */
unsigned char Blue_Default_Palette[] = {
0x00, 0x00, 0x02, 0x0F, 0xBF, 0x00, 0xFF, 0x0F, 0x00, 0x00, 0x0F, 0x09,
0xF0, 0x0F, 0xFF, 0x0F, 0x00, 0x00, 0x02, 0x0F, 0xBF, 0x00, 0xFF, 0x0F,
0x00, 0x00, 0x0F, 0x09, 0xF0, 0x0F, 0xFF, 0x0F
}; /* end Blue_Default_Palette */
unsigned char Bluescale_Palette[] = {
0x02, 0x00, 0x7F, 0x03, 0xEE, 0x08, 0xEF, 0x0F, 0x02, 0x00, 0x7F, 0x03,
0xEE, 0x08, 0xEF, 0x0F, 0x02, 0x00, 0x7F, 0x03, 0xEE, 0x08, 0xEF, 0x0F,
0x02, 0x00, 0x7F, 0x03, 0xEE, 0x08, 0xEF, 0x0F
}; /* end Bluescale_Palette */
unsigned char Bright_Sun_Palette[] = {
0x00, 0x04, 0x73, 0x0F, 0xE8, 0x0E, 0xFD, 0x0F, 0x00, 0x04, 0x73, 0x0F,
0xE8, 0x0E, 0xFD, 0x0F, 0x00, 0x04, 0x73, 0x0F, 0xE8, 0x0E, 0xFD, 0x0F,
0x00, 0x04, 0x73, 0x0F, 0xE8, 0x0E, 0xFD, 0x0F
}; /* end Bright_Sun_Palette */
unsigned char Dark_Sun_Palette[] = {
0x02, 0x00, 0xA0, 0x0C, 0x61, 0x0F, 0x44, 0x0C, 0x02, 0x00, 0xA0, 0x0C,
0x61, 0x0F, 0x44, 0x0C, 0x02, 0x00, 0xA0, 0x0C, 0x61, 0x0F, 0x44, 0x0C,
0x02, 0x00, 0xA0, 0x0C, 0x61, 0x0F, 0x44, 0x0C
}; /* end Dark_Sun_Palette */
unsigned char Grayscale_Palette[] = {
0x00, 0x00, 0x55, 0x05, 0xAA, 0x0A, 0xFF, 0x0F, 0x00, 0x00, 0x55, 0x05,
0xAA, 0x0A, 0xFF, 0x0F, 0x00, 0x00, 0x55, 0x05, 0xAA, 0x0A, 0xFF, 0x0F,
0x00, 0x00, 0x55, 0x05, 0xAA, 0x0A, 0xFF, 0x0F
}; /* end Grayscale_Palette */
unsigned char Landscape_Palette[] = {
0x02, 0x00, 0x7F, 0x03, 0xA2, 0x06, 0xFE, 0x0E, 0x02, 0x00, 0x7F, 0x03,
0xA2, 0x06, 0xFE, 0x0E, 0x02, 0x00, 0x7F, 0x03, 0xA2, 0x06, 0xFE, 0x0E,
0x02, 0x00, 0x7F, 0x03, 0xA2, 0x06, 0xFE, 0x0E
}; /* end Landscape_Palette */
unsigned char Pastels_Palette[] = {
0x00, 0x00, 0xB8, 0x0F, 0xFC, 0x0B, 0xFF, 0x0F, 0x00, 0x00, 0x9F, 0x0A,
0xF9, 0x0F, 0xFF, 0x0F, 0x00, 0x00, 0xB8, 0x0F, 0xFC, 0x0B, 0xFF, 0x0F,
0x00, 0x00, 0x9F, 0x0A, 0xF9, 0x0F, 0xFF, 0x0F
}; /* end Pastels_Palette */
#define cPastelsMItemID 1u
#define cLandscapeMItemID 2u
#define cBrightSunMItemID 3u
#define cDarkSunMItemID 4u
#define cBluescaleMItemID 5u
#define cGrayscaleMItemID 6u
#define cBlueDefaultMItemID 7u
#define cDefaultMItemID 8u
#define cRandomMItemID 9u
#define dd1SecMItemID 1u
#define dd2SecMItemID 2u
#define dd5SecMItemID 5u
#define dd10SecMItemID 10u
#define dd20SecMItemID 20u
#define dd30SecMItemID 30u
#define ddNoneMItemID 100u
#define cs1MoireMItemID 1u
#define cs2MoireMItemID 2u
#define cs6MoireMItemID 6u
#define cs10MoireMItemID 10u
#define cs20MoireMItemID 20u
#define csNeverMItemID 100u
/*
This program used to make this table: (Thanks James Smith)
void main(void) {
float angle;
int result;
for(angle=0; angle<360; angle+=2) {
if(!((int) angle%18))
printf("\n");
result=(int) (sin(angle/57.29578)*1000);
printf("%2d,", result);
}
printf("\n");
}
*/
signed int SinTable[] = {
0,34,69,104,139,173,207,241,275,
309,342,374,406,438,469,499,529,559,
587,615,642,669,694,719,743,766,788,
809,829,848,866,882,898,913,927,939,
951,961,970,978,984,990,994,997,999,
999,999,997,994,990,984,978,970,961,
951,939,927,913,898,882,866,848,829,
809,788,766,743,719,694,669,642,615,
587,559,529,500,469,438,406,374,342,
309,275,241,207,173,139,104,69,34,
0,-34,-69,-104,-139,-173,-207,-241,-275,
-309,-342,-374,-406,-438,-469,-499,-529,-559,
-587,-615,-642,-669,-694,-719,-743,-766,-788,
-809,-829,-848,-866,-882,-898,-913,-927,-939,
-951,-961,-970,-978,-984,-990,-994,-997,-999,
-999,-999,-997,-994,-990,-984,-978,-970,-961,
-951,-939,-927,-913,-898,-882,-866,-848,-829,
-809,-788,-766,-743,-719,-694,-669,-642,-615,
-587,-559,-529,-500,-469,-438,-406,-374,-342,
-309,-275,-241,-207,-173,-139,-104,-69,-34
};
EventRecord evtRec;

View File

@ -0,0 +1,570 @@
#include "types.rez"
#include "22:T2Common.Rez"
// --- type $8004 defines
#define CTLTMP_00006FFE $00006FFE
#define CTLTMP_00006FFF $00006FFF
#define CTLTMP_00007000 $00007000
#define CTLTMP_00007001 $00007001
#define CTLTMP_00007002 $00007002
#define CTLTMP_00007003 $00007003
#define CTLTMP_00010012 $00010012
// --- type $8006 defines
#define PSTR_00000001 $00000001
#define PSTR_00000012 $00000012
#define PSTR_000000FC $000000FC
#define PSTR_000000FD $000000FD
#define PSTR_000000FE $000000FE
#define PSTR_00000107 $00000107
#define PSTR_00000108 $00000108
#define PSTR_00000109 $00000109
#define PSTR_0000010A $0000010A
#define PSTR_0000010B $0000010B
#define PSTR_0000010C $0000010C
#define PSTR_0000010D $0000010D
#define PSTR_0000010E $0000010E
#define PSTR_0000010F $0000010F
#define PSTR_00000110 $00000110
#define PSTR_00000111 $00000111
#define PSTR_00000112 $00000112
#define PSTR_00000113 $00000113
#define PSTR_00000114 $00000114
#define PSTR_00000115 $00000115
#define PSTR_00000116 $00000116
#define PSTR_00000117 $00000117
#define PSTR_00000118 $00000118
#define PSTR_00000119 $00000119
#define PSTR_0000011A $0000011A
#define PSTR_0000011B $0000011B
#define PSTR_0000011C $0000011C
#define PSTR_0000011D $0000011D
// --- type $800A defines
#define MENUITEM_00000001 $00000001
#define MENUITEM_00000107 $00000107
#define MENUITEM_00000108 $00000108
#define MENUITEM_00000109 $00000109
#define MENUITEM_0000010A $0000010A
#define MENUITEM_0000010B $0000010B
#define MENUITEM_0000010C $0000010C
#define MENUITEM_0000010D $0000010D
#define MENUITEM_0000010E $0000010E
#define MENUITEM_0000010F $0000010F
#define MENUITEM_00000110 $00000110
#define MENUITEM_00000111 $00000111
#define MENUITEM_00000112 $00000112
#define MENUITEM_00000113 $00000113
#define MENUITEM_00000114 $00000114
#define MENUITEM_00000115 $00000115
#define MENUITEM_00000116 $00000116
#define MENUITEM_00000117 $00000117
#define MENUITEM_00000118 $00000118
#define MENUITEM_00000119 $00000119
#define MENUITEM_0000011A $0000011A
#define MENUITEM_0000011B $0000011B
// --- custom resource type defines
resource rT2ModuleFlags (moduleFlags) {
fMostCommonPalette +
fSetup +
fFadeOut +
fFadeIn +
fLeavesUsableScreen +
fGrafPort640, // module flags
$01, // enabled flag (unimplemented)
$0110, // minimum T2 version required
NIL, // reserved
"Moir\$8E" // module name
};
// --- Icon Definitions
resource rIcon (moduleIcon) {
$8000, // kind
$0014, // height
$0016, // width
$"F00000000000000000000F"
$"0FFFFFFFFFFFFFFFFFFFF0"
$"0F0000E0D00E000B000BF0"
$"0FE000E00DE00000B0B0F0"
$"0F0E00E00ED000000B00F0"
$"0F00E0E0E00D0000B0B0F0"
$"0F000EEE0000D00B000BF0"
$"0FEEEEEEEEEEEDBEEEDEF0"
$"0F000EEE00000BD00D00F0"
$"0F00E0E0E000B00DD000F0"
$"0F0E00E00E0B000DD000F0"
$"0FE000E000B000D00D00F0"
$"0FFFFFFFFFFFFFFFFAFFF0"
$"0000000000000000000000"
$"F0FFFFFFFFFFFFFFFFFF0F"
$"F0FFFFFFFFFFFFFFFFFF0F"
$"F0FF4AFFFFFFFFFFFFFF0F"
$"F0CCCCCCCCCCCCCCCCCC0F"
$"F0FFFFFFFFFFFFFFFAFF0F"
$"F00000000000000000000F",
$"0FFFFFFFFFFFFFFFFFFFF0"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"0FFFFFFFFFFFFFFFFFFFF0"
$"0FFFFFFFFFFFFFFFFFFFF0"
$"0FFFFFFFFFFFFFFFFFFFF0"
$"0FFFFFFFFFFFFFFFFFFFF0"
$"0FFFFFFFFFFFFFFFFFFFF0"
$"0FFFFFFFFFFFFFFFFFFFF0";
};
// --- Control List Definitions
resource rControlList (1) {
{
1, // control 1
2, // control 3
3, // control 4
4, // control 5
5, // control 6
};
};
// --- Control Templates
resource rControlTemplate (1) {
1, // ID
{107, 18, 0, 0}, // rect
popUpControl {{
$0040, // flag
$1002+fDrawPopDownIcon, // moreFlags
$00000000, // refCon
$0000, // titleWidth
1, // menuRef -- DRAW DELAY
100, // initialValue -- None
0 // colorTableRef
}};
};
resource rControlTemplate (2) {
2, // ID
{ 88, 18, 0, 0}, // rect
popUpControl {{
$0040, // flag
$1002+fDrawPopDownIcon, // moreFlags
$00000000, // refCon
$0000, // titleWidth
2, // menuRef -- COLORS
9, // initialValue -- random palette
0 // colorTableRef
}};
};
resource rControlTemplate (3) {
3, // ID
{ 69, 18, 0, 0}, // rect
popUpControl {{
$0040, // flag
$1002+fDrawPopDownIcon, // moreFlags
$00000000, // refCon
$0000, // titleWidth
3, // menuRef -- CLEAR SCREEN
6, // initialValue -- After 6 Moires
0 // colorTableRef
}};
};
resource rControlTemplate (4) {
4, // ID
{ 53,128, 62,233}, // rect
statTextControl {{
$0000, // flag
$1002, // moreFlags
$00000000, // refCon
1 // textRef
}};
};
resource rControlTemplate (5) {
5, // ID
{ 25,148, 52,200}, // rect
iconButtonControl {{
$000C, // flag
$1020, // moreFlags
$00000000, // refCon
moduleIcon, // iconRef
0, // titleRef
0, // colorTableRef
$0000 // displayMode
}};
};
// -- CLEAR SCREEN menu item strings
resource rPString (PSTR_000000FD) {
" Clear Screen: "
};
resource rPString (PSTR_00000108, $C018) { //1
"After 1 Moir\$8E"
};
resource rPString (PSTR_00000107, $C018) { //2
"After 2 Moir\$8Es"
};
resource rPString (PSTR_00000109, $C018) { //6- default
"After 6 Moir\$8Es"
};
resource rPString (PSTR_0000010B, $C018) { //10
"After 10 Moir\$8Es"
};
resource rPString (PSTR_0000010A, $C018) { //20
"After 20 Moir\$8Es"
};
resource rPString (PSTR_000000FE, $c018) { //100
"Never"
};
// -- DRAW DELAY menu item strings
resource rPString (PSTR_0000010F) {
" Draw Delay: "
};
resource rPString (PSTR_00000114, $C018) { //1
"1 Second"
};
resource rPString (PSTR_00000111, $C018) { //2
"2 Seconds"
};
resource rPString (PSTR_00000112, $C018) { //5
"5 Seconds"
};
resource rPString (PSTR_00000110, $c018) { //10
"10 Seconds"
};
resource rPString (PSTR_00000115, $C018) { //20
"20 Seconds"
};
resource rPString (PSTR_00000113, $C018) { //30
"30 Seconds"
};
resource rPString (PSTR_00000116, $C018) { //100- default
"None"
};
// -- COLORS menu item strings
resource rPString (PSTR_0000010C) {
" Colors: "
};
resource rPString (PSTR_00000117, $C018) { //1
"Pastels"
};
resource rPString (PSTR_00000118, $C018) { //2
"Landscape"
};
resource rPString (PSTR_0000011A, $C018) { //3
"Bright Sun"
};
resource rPString (PSTR_0000011B, $C018) { //4
"Dark Sun"
};
resource rPString (PSTR_0000010E, $C018) { //5
"Bluescale"
};
resource rPString (PSTR_00000119, $C018) { //6
"Grayscale"
};
resource rPString (PSTR_0000011D, $C018) { //7
"Blue Default"
};
resource rPString (PSTR_0000010D, $c018) { //8
"Default Palette"
};
resource rPString (PSTR_0000011C, $C018) { //9- default
"Random"
};
// --- Menu Definitions
resource rMenu (1) {
$0003, // menuID
$A000, // menuFlag
PSTR_0000010F, { // menuTitleRef -- DRAW DELAY
MENUITEM_00000112,
MENUITEM_0000010F,
MENUITEM_00000110,
MENUITEM_0000010E,
MENUITEM_00000113,
MENUITEM_00000111,
MENUITEM_00000114
};
};
resource rMenu (2) {
$0002, // menuID
$A000, // menuFlag
PSTR_0000010C, { // menuTitleRef -- COLORS
MENUITEM_00000115,
MENUITEM_00000116,
MENUITEM_00000118,
MENUITEM_00000119,
MENUITEM_0000010D,
MENUITEM_00000117,
MENUITEM_0000011B,
MENUITEM_0000010C,
MENUITEM_0000011A
};
};
resource rMenu (3) {
$0001, // menuID
$A000, // menuFlag
PSTR_000000FD, { // menuTitleRef -- CLEAR SCREEN
MENUITEM_00000108,
MENUITEM_00000107,
MENUITEM_00000109,
MENUITEM_0000010B,
MENUITEM_0000010A,
MENUITEM_00000001
};
};
// --- Menu Item Definitions
// -- CLEAR SCREEN popup menu items
resource rMenuItem (MENUITEM_00000108, $c018) {
$0001, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000108 // itemTitleRef
};
resource rMenuItem (MENUITEM_00000107, $C018) {
$0002, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000107 // itemTitleRef
};
resource rMenuItem (MENUITEM_00000109, $C018) {
$0006, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8002, // itemFlag
PSTR_00000109 // itemTitleRef
};
resource rMenuItem (MENUITEM_0000010B, $C018) {
10, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_0000010B // itemTitleRef
};
resource rMenuItem (MENUITEM_0000010A, $C018) {
20, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8040, // itemFlag
PSTR_0000010A // itemTitleRef
};
resource rMenuItem (MENUITEM_00000001, $c018) {
100, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_000000FE // itemTitleRef
};
// -- DRAW DELAY popup menu items
resource rMenuItem (MENUITEM_00000112, $C018) {
$0001, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000114 // itemTitleRef
};
resource rMenuItem (MENUITEM_0000010F, $C018) {
$0002, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000111 // itemTitleRef
};
resource rMenuItem (MENUITEM_00000110, $C018) {
5, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000112 // itemTitleRef
};
resource rMenuItem (MENUITEM_0000010E, $c018) {
10, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000110 // itemTitleRef
};
resource rMenuItem (MENUITEM_00000113, $C018) {
20, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000115 // itemTitleRef
};
resource rMenuItem (MENUITEM_00000111, $C018) {
30, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8040, // itemFlag
PSTR_00000113 // itemTitleRef
};
resource rMenuItem (MENUITEM_00000114, $C018) {
100, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8002, // itemFlag
PSTR_00000116 // itemTitleRef
};
// -- COLORS popup menu items
resource rMenuItem (MENUITEM_00000115, $C018) {
$0001, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000117 // itemTitleRef
};
resource rMenuItem (MENUITEM_00000116, $C018) {
$0002, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000118 // itemTitleRef
};
resource rMenuItem (MENUITEM_00000118, $C018) {
$0003, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_0000011A // itemTitleRef
};
resource rMenuItem (MENUITEM_00000119, $C018) {
$0004, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_0000011B // itemTitleRef
};
resource rMenuItem (MENUITEM_0000010D, $C018) {
$0005, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_0000010E // itemTitleRef
};
resource rMenuItem (MENUITEM_00000117, $C018) {
$0006, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000119 // itemTitleRef
};
resource rMenuItem (MENUITEM_0000011B, $C018) {
$0007, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_0000011D // itemTitleRef
};
resource rMenuItem (MENUITEM_0000010C, $c018) {
$0008, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8040, // itemFlag
PSTR_0000010D // itemTitleRef
};
resource rMenuItem (MENUITEM_0000011A, $C018) {
$0009, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8002, // itemFlag
PSTR_0000011C // itemTitleRef
};
// --- rTextForLETextBox2 Templates
resource rTextForLETextBox2 (1) {
"Moir\$8E Options"
};
// --- rTextForLETextBox2 Templates
resource rTextForLETextBox2 (moduleMessage) {
TBLeftJust
TBForeColor TBColor1
"Moir\$8E fills the screen with infinitely varying, colorful moir\$8E patterns "
"whose frequency and color you can choose."
};
// --- rVersion Templates
resource rVersion (moduleVersion) {
{1,0,2,beta,2}, // Version
verUS, // US Version
"T2 Moir\$8E Module", // program's name
"By Jim Maricondo\n"
"Copyr 1992-94. All rights reserved." // copyright notice
};

View File

@ -0,0 +1,169 @@
MACRO
&lab _GetBackPat
&lab ldx #$3504
jsl $E10000
MEND
MACRO
&lab _GetMasterSCB
&lab ldx #$1704
jsl $E10000
MEND
MACRO
&lab _GetPort
&lab ldx #$1C04
jsl $E10000
MEND
MACRO
&lab _Random
&lab ldx #$8604
jsl $E10000
MEND
MACRO
&lab _ScrollRect
&lab ldx #$7E04
jsl $E10000
MEND
MACRO
&lab _SetBackPat
&lab ldx #$3404
jsl $E10000
MEND
MACRO
&lab _SetPort
&lab ldx #$1B04
jsl $E10000
MEND
MACRO
&lab _ShowPen
&lab ldx #$2804
jsl $E10000
MEND
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 WordResult
&lab phd
MEND
MACRO
&lab LongResult
&lab phd
phd
MEND
MACRO
&lab _UDivide
&lab ldx #$0B0B
jsl $E10000
MEND
MACRO
&lab _GetMenuMgrPort
&lab ldx #$1B0F
jsl $E10000
MEND
MACRO
&lab pullword &SYSOPR
&lab ANOP
pla
AIF C:&SYSOPR=0,.end
sta &SYSOPR
.end
MEND
MACRO
&lab longmx
&lab ANOP
rep #%00110000
longa on
longi on
MEND
MACRO
&lab longm
&lab ANOP
rep #%00100000
longa on
MEND
MACRO
&lab shortm
&lab ANOP
sep #%00100000
longa off
MEND
MACRO
DefineStack
GBLA &DummyPC
&DummyPC SETA 1
MEND
MACRO
&lab BYTE
&lab equ &DummyPC
&DummyPC SETA &DummyPC+1
MEND
MACRO
&lab WORD
&lab equ &DummyPC
&DummyPC SETA &DummyPC+2
MEXIT
MEND
MACRO
&lab LONG
&lab equ &DummyPC
&DummyPC SETA &DummyPC+4
MEND
MACRO
&lab BLOCK &Value
AIF C:&lab=0,.skiplab
&lab equ &DummyPC
.skiplab
&DummyPC SETA &DummyPC+&Value
MEND

View File

@ -0,0 +1,86 @@
#include "types.rez"
#include "22:t2common.rez"
// --- Module name resource
resource rT2ModuleFlags (moduleFlags) {
fLeavesUsableScreen+fReqUsableScreen, // module flags word
$01, // enabled flag (unimplemented)
$0110, // minimum T2 version required
NIL, // reserved
"Meltdown" // module name
};
// --- About text resource
resource rTextForLETextBox2 (moduleMessage) {
TBLeftJust
"\n"
TBBackColor TBColorA
TBForeColor TBColor1
"Meltdown"
TBForeColor TBColor0
" makes your screen melt, drip, and contort! Be careful; some radiation "
"might leak!"
};
// --- Version resource
resource rVersion (moduleVersion) {
{1,0,0,release,0}, // Version
verUS, // US Version
"T2 Meltdown Module", // program's name
"By Jim Maricondo.\n"
"Copyright 1993, Jim Maricondo." // copyright notice
};
// --- About icon resource
resource rIcon (moduleIcon) {
$8000, // kind
$0014, // height
$001C, // width
$"FFF0000000000000000000000FFF"
$"FFF0FFFFFFFFFFFFFFFFFFFF0FFF"
$"FFF0F000000000000000000F0FFF"
$"FFF0F0000000AAAA0000000F0FFF"
$"FFF0F0000000AAAA0000000F0FFF"
$"FFF0F00000002AA80000000F0FFF"
$"FFF0F00000000AA00000000F0FFF"
$"FFF0F000000AA00AA000000F0FFF"
$"FFF0F0000AAAA82AAAA0000F0FFF"
$"FFF0F00002AA8002AA80000F0FFF"
$"FFF0F000002A0000A800000F0FFF"
$"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";
};

View File

@ -0,0 +1,31 @@
# Twilight II Meltdown UNIX MakeFile
# by Jim Maricondo
# v1.0 - 1/3/93 2:13pm
# v1.0.1 - 1/9/93 1:17am
# v1.0.2 - 1/20/93 9:58pm
# First deal with all the dfork...
Meltdown.d.root: Meltdown.cc 22/t2.h
compile +w Meltdown.cc keep=Meltdown.d
meltplot.c.root: meltplot.asm meltplot.mac
compile +w meltplot.asm keep=meltplot.c
Meltdown.d: Meltdown.d.root 22/random3.c.root meltplot.c.root
link +w Meltdown.d 22:random3.c meltplot.c keep=Meltdown.d
# Now work with the rfork...
Meltdown.r: Meltdown.rez 22/t2common.rez
compile Meltdown.rez keep=Meltdown.r
# Now put it together.
Meltdown: Meltdown.r Meltdown.d
duplicate -d Meltdown.d Meltdown
duplicate -r Meltdown.r Meltdown
setfile -at $4004 -t $bc Meltdown -m .
cp Meltdown :jim1:system:cdevs:twilight:Meltdown
22:beep

View File

@ -0,0 +1,162 @@
#pragma keep "meltdown.d"
#pragma cdev meltdown
#pragma optimize -1
#include <quickdraw.h>
#include "22:t2.h"
#include "22:link:random3.h"
#include <locator.h>
extern pascal LongWord GetTick(void) inline(0x2503,dispatcher);
#pragma lint -1
#pragma debug 0
#define SHR_BYTE_WIDTH 160
#define SHR_HEIGHT 199
#define TICKS_PER_SECOND 60
#define TICKS_PER_MINUTE TICKS_PER_SECOND*60
#define CLEAR_DELAY TICKS_PER_SECOND*3*50
/* Strings */
char toT2String[]=toT2Str;
/* Prototypes */
LongWord BlankT2Message(Word);
/* externals */
extern void init_save_restore(char * screenPtr, char * lookupPtr);
extern void save_pixels(char *, int, int, int);
extern void restore_pixels(char *, int, int, int);
extern void scroll_rect(Rect * rect, char * buffer);
extern void restore_screen(void *);
/* Global Variables */
Word *movePtr;
/* unsigned int *ScreenTablePtr; */
char *VRam;
char pixels[160];
/*****************************************************************************\
|* BlankT2Message- *|
|* This function performs the screen blanking activities. *|
\*****************************************************************************/
LongWord BlankT2Message (Word blank_flags) {
word temp,i;
int start_byte_offset, byte_width, top;
Rect newr;
word start_left, end_right, width;
long TargetTick;
struct getBuffersOut meltBuffersOut;
Ptr meltBuffersOutP = (Ptr) &meltBuffersOut;
struct getInfoOut myGetInfoOut = {NULL,0,0xE,NULL,NULL,NULL,NULL,NULL};
Ptr myGetInfoOutP = (Ptr) &myGetInfoOut;
init_random(toT2String);
if((*((char *)0xE0C035))& 0x08)
VRam=(void *) 0xE10000l;
else
VRam=(void *) 0x010000l;
init_save_restore((char *) VRam, (char *) GetAddress(1));
SendRequest(t2GetBuffers, stopAfterOne+sendToName, (long) toT2String,
(long) NIL, (Ptr) meltBuffersOutP);
SendRequest(t2GetInfo, stopAfterOne+sendToName, (long) toT2String,
(long) NIL, (Ptr) myGetInfoOutP);
TargetTick = GetTick() + CLEAR_DELAY;
while (!(*movePtr)) {
do {
while ((start_left = (random() & 0xFF)) >= 160)
;
while ((width = (random() & 0xFF)) > 160)
;
start_left &= 0xFFFE;
width &= 0xFFFE;
end_right = width+start_left;
/* while (end_right > 160)
end_right -= 4; */
if (width < 0)
width = 10;
} while (((end_right-start_left) > 30) || (end_right > 160));
newr.h1 = start_left;
newr.h2 = end_right;
newr.v1 = random() % (SHR_HEIGHT/*+1*/);
newr.v2 = SHR_HEIGHT;
/* byte_width = newr.h2 - newr.h1;
start_byte_offset = newr.h1;
top = newr.v1;*/
scroll_rect((Rect *)&newr, (char *)&pixels);
if (GetTick() > TargetTick) {
if ( ((blank_flags&bmiBlankNow) == bmiBlankNow) ||
(myGetInfoOut.count_selected_modules == 1) ) {
TargetTick = GetTick() + CLEAR_DELAY;
restore_screen(*meltBuffersOut.shr_main_bufferH);
}
else
return (LongWord) bmrNextModule;
}
}
/* 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 meltdown (LongWord data2, LongWord data1, Word message)
{
LongWord Result = 1L;
switch (message)
{
case BlankT2:
movePtr=(Word *) data1;
Result=BlankT2Message((Word) data2);
break;
case LoadSetupT2:
case MakeT2:
case SaveT2:
case UnloadSetupT2:
case KillT2:
case HitT2:
Result=NULL;
break;
}
return Result;
}

View File

@ -0,0 +1,582 @@
mcopy meltplot.mac
keep meltplot.c
case on
objcase on
*-----------------------------------------------------------------------------*
SHADOW gequ >$E0C035
*-----------------------------------------------------------------------------*
* extern void init_save_restore(char * screenPtr, char * lookupPtr);
init_save_restore 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
longm
plb
lda 1,s
sta 1+8,s
lda 2,s
sta 2+8,s
plx
plx
plx
plx
rtl
End
*-----------------------------------------------------------------------------*
* extern void save_pixels(char * buffer, int line, int byte_offset, int byte_width);
save_pixels Start
dbr equ 1
rtlAddr equ dbr+1
buffer equ rtlAddr+3
line equ buffer+4
byte_offset equ line+2
byte_width equ byte_offset+2
phb
phk
plb
lda line,s
cmp #200
bge return
lda byte_offset,s
cmp #160
bge return
lda byte_width,s
cmp #160+1
bge return
; lda x_coord,s
; lsr a
; sta x_div2+1
lda buffer,s
sta bufferFill+1
lda buffer+2,s
xba
sta bankFill+1
lda byte_width,s
sta widthFill+1
lda line,s
jsr getLookup
clc
adc byte_offset,s
tax
bankFill pea 0
plb
plb
ldy #0
copyBuffer jsr readPixel
bufferFill sta |$0000,y
iny
iny
inx
inx
cpx #$9D00
bge return
widthFill cpy #0
blt copyBuffer
return plb
lda 1,s
sta 1+10,s
lda 2,s
sta 2+10,s
plx
plx
plx
plx
plx
rtl
End
*-----------------------------------------------------------------------------*
* extern void restore_pixels(char * buffer, int line, int byte_offset, int byte_width);
restore_pixels Start
dbr equ 1
rtlAddr equ dbr+1
buffer equ rtlAddr+3
line equ buffer+4
byte_offset equ line+2
byte_width equ byte_offset+2
phb
phk
plb
lda line,s
cmp #200
bge return
lda byte_offset,s
cmp #160
bge return
lda byte_width,s
cmp #160+1
bge return
lda buffer,s
sta bufferFill+1
lda buffer+2,s
xba
sta bankFill+1
lda line,s
jsr getLookup
clc
adc byte_offset,s
tax
lda byte_width,s
sta widthFill+1
bankFill pea 0
plb
plb
ldy #0
copyBuffer anop
bufferFill lda |$0000,y
jsr writePixel
iny
iny
inx
inx
cpx #$9D00
bge return
widthFill cpy #0
blt copyBuffer
return plb
lda 1,s
sta 1+10,s
lda 2,s
sta 2+10,s
plx
plx
plx
plx
plx
rtl
End
*-----------------------------------------------------------------------------*
readPixel Start
screen1 entry
lda >0,x
rts
End
*-----------------------------------------------------------------------------*
writePixel Start
screen2 entry
sta >0,x
rts
End
*-----------------------------------------------------------------------------*
getLookup Start
asl a
tax
patchLook entry
lda >0,x
rts
End
*-----------------------------------------------------------------------------*
* extern void scroll_rect(rect * rect, char * buffer);
* Limits:
* - will only scroll one line down..
* - will only work with word aligned rects..
* - rect "bottom" will be assumed TO BE 199
scroll_rect Start
dpr equ 1
dbr equ dpr+2
rtlAddr equ dbr+1
rect equ rtlAddr+3
buffer equ rect+4
oTop equ 0
oLeft equ oTop+2
oBottom equ oLeft+2
oRight equ oBottom+2
phb
phk
plb
phd
tsc
tcd
; ldy #oTop
lda [rect] ; top
cmp #199
bge return
ldy #oRight
lda [rect],y
cmp #160
bge return
ldy #oRight
lda [rect],y
ldy #oLeft
sec
sbc [rect],y
sta byte_width
; ldy #oLeft
lda [rect],y
sta start_byte_offset
lda [rect] ; top
sta top
; ldy #oBottom
; lda [rect],y ; will be 199
; dec a ; down to 198
lda #198
sta bottom
scroll_loop PushWord byte_width
PushWord start_byte_offset
PushWord bottom
pei buffer+2
pei buffer
jsl save_pixels
PushWord byte_width
PushWord start_byte_offset
lda bottom
inc a
pha
pei buffer+2
pei buffer
jsl restore_pixels
dec bottom
lda bottom
bmi return
cmp top
; beq return ; neu
bge scroll_loop
return pld
plb
lda 1,s
sta 1+8,s
lda 2,s
sta 2+8,s
plx
plx
plx
plx
rtl
byte_width ds 2
start_byte_offset ds 2
top ds 2
bottom ds 2
End
*-----------------------------------------------------------------------------*
restore_screen Start
dpr equ 1
dbr equ dpr+2
rtlAddr equ dbr+1
savedScreenP equ rtlAddr+3
phb
phk
plb
phd
tsc
tcd
; brk
lda flitter+1
eor #1
sta flitter+1
flitter lda #0
bne backwards
shortm
lda SHADOW
longm
bit #$08
bne restoreE1
restore01 anop
ldy #$7D00-2+200
rest01_loop anop
tyx
lda [savedScreenP],y
sta >$012000,x
dey
dey
bpl rest01_loop
bra done
restoreE1 anop
ldy #$7D00-2+200
restE1_loop anop
tyx
lda [savedScreenP],y
sta >$E12000,x
dey
dey
bpl restE1_loop
bra done
backwards anop
lda #$E120
sta shrAddr+2
shortm
lda #$E1
sta zayro+3
longm
ldx #200-2
fixSCB lda >$E19D00,x
and #$F0F0
sta >$E19D00,x
dex
dex
bpl fixSCB
shortm
lda SHADOW
longm
bit #$08
bne restoreE1_back
restore01_back anop
lda #$0120
sta shrAddr+2
shortm
lda #$01
sta zayro+3
longm
restoreE1_back anop
ldx #0
ldy #198 ;199
copyEm phx
phy
jsr copyLine
ply
plx
inx
dey
bpl copyEm
; brk
; ldy #$7D00 ;-2+200
; ldx #200-2
;revSCB_loop anop
; lda [savedScreenP],y
; xba
; sta >$E19D00,x
; iny
; iny
; dex
; dex
; bpl revSCB_loop
done anop
ldx #160-2
lda #0
zayro sta >$E12000,x
dex
dex
bpl zayro
pld
plb
lda 1,s
sta 1+4,s
lda 2,s
sta 2+4,s
plx
plx
rtl
x160 anop
asl a ;x2
asl a ;x4
asl a ;x8
asl a ;x16
asl a ;x32
sta fillAdd+1
asl a ;x64
asl a ;x128
clc
fillAdd adc #0 ;+x32 = x160
rts
copyLine anop
txa
inc a
jsr x160
tax
dex
dex
tya
jsr x160
tay
lda #80
sta counter
copyIt lda [savedScreenP],y
jsr swap
shrAddr sta $012000,x
iny
iny
dex
dex
dec counter
bne copyIt
rts
counter ds 2
swap anop
; brk
pha
lda $E19D00
bit #$80
bne use640
pla
shortm
jsr swapNibbles
sta endResult+2
longm
xba
shortm
jsr swapNibbles
sta endResult+1
longm
endResult lda #0
rts
use640 anop
pla
shortm
jsr mode640
sta endResult+2
longm
xba
shortm
jsr mode640
sta endResult+1
longm
bra endResult
swapNibbles anop
longa off
pha
and #$0F
asl a
asl a
asl a
asl a
sta f1+1
pla
and #$F0
lsr a
lsr a
lsr a
lsr a
f1 ora #00
rts
longa on
mode640 anop
longa off
sta temp
and #%11
clc
ror a
ror a
ror a
sta ora1+1
lda temp
and #%1100
asl a
asl a
; and #%00110000
sta ora2+1
lda temp
and #%110000
lsr a
lsr a
sta ora3+1
lda temp
and #%11000000
clc
rol a
rol a
rol a
ora1 ora #0
ora2 ora #0
ora3 ora #0
longa on
rts
temp ds 1
End
*-----------------------------------------------------------------------------*

Binary file not shown.

View File

@ -0,0 +1,35 @@
MACRO
&lab longm
&lab ANOP
rep #%00100000
longa on
MEND
MACRO
&lab shortm
&lab ANOP
sep #%00100000
longa off
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

View File

@ -0,0 +1,9 @@
asm Moviet
lnk Moviet.l
typ EXE
sav Movie.d
* typ $BC
* cmd auxtype MovieTheater,$4004

View File

@ -0,0 +1,43 @@
*-----------------------------------------------------------------------------*
* makePdp. V1.00 - 12/08/91 by JRM.
*
* Dereference handle (make a pointer) on the stack.
*
* Inputs:
*
* |previous contents|
* |-----------------|
* | handle | Long - Handle to dereference.
* |-----------------|
* | rtsAddr | Word - Return address.
* |-----------------|
*
* Outputs:
*
* | |
* |previous contents|
* |-----------------|
* | pointer | Long - Dereferenced handle.
* |-----------------|
* | rtsAddr | Word - Return address.
* |-----------------|
*
makePdp = *
DP = 1
TheHandle = DP+2
plx ; yank return address
phd
tsc
tcd
ldy #2
lda [TheHandle],y
tay
lda [TheHandle]
sta <TheHandle
sty <TheHandle+2
phx ; push back return address
rts

View File

@ -0,0 +1,292 @@
_DISPOSECONTROL MAC
Tool $A10
<<<
_HIDECONTROL MAC
Tool $E10
<<<
^GETCTLHANDLEFROMID MAC
PHS 2
PxL ]1;]2
Tool $3010
<<<
^NEWCONTROL2 MAC
P2SL ]1
PHWL ]2;]3
Tool $3110
<<<
_NEWCONTROL2 MAC
Tool $3110
<<<
^LOADONETOOL MAC
PxW ]1;]2
Tool $F01
<<<
^UNLOADONETOOL MAC
PHW ]1
Tool $1001
<<<
^NEWHANDLE MAC
P2SL ]1
PxW ]2;]3
PHL ]4
Tool $902
<<<
^DISPOSEHANDLE MAC
PHL ]1
Tool $1002
<<<
^GETHANDLESIZE MAC
P2SL ]1
Tool $1802
<<<
_SETHANDLESIZE MAC
Tool $1902
<<<
^HLOCK MAC
PHL ]1
Tool $2002
<<<
_PTRTOHAND MAC
Tool $2802
<<<
^BLOCKMOVE MAC
PxL ]1;]2;]3
Tool $2B02
<<<
_ADDRESOURCE MAC
Tool $C1E
<<<
^UPDATERESOURCEFILE MAC
PHW ]1
Tool $D1E
<<<
^LOADRESOURCE MAC
P2SW ]1
PHL ]2
Tool $E1E
<<<
_REMOVERESOURCE MAC
Tool $F1E
<<<
^SETCURRESOURCEFILE MAC
PHW ]1
Tool $111E
<<<
_SETCURRESOURCEFILE MAC
Tool $111E
<<<
^GETCURRESOURCEFILE MAC
PHA
Tool $121E
<<<
^RELEASERESOURCE MAC
PxW ]1;]2
PHL ]3
Tool $171E
<<<
_DETACHRESOURCE MAC
Tool $181E
<<<
^UNIQUERESOURCEID MAC
P2SW ]1
PHW ]2
Tool $191E
<<<
_SFSTARTUP MAC
Tool $217
<<<
_SFSHUTDOWN MAC
Tool $317
<<<
^SFSTATUS MAC
PHA
Tool $617
<<<
_SFGETFILE2 MAC
Tool $E17
<<<
_COMPILETEXT MAC
Tool $600E
<<<
BEQL MAC
BNE OV
BRL ]1
OV <<<
PHWL MAC
PHW ]1
PHL ]2
<<<
PXW MAC
DO ]0/1
PHW ]1
DO ]0/2
PHW ]2
DO ]0/3
PHW ]3
DO ]0/4
PHW ]4
FIN
FIN
FIN
FIN
<<<
PXL MAC
DO ]0/1
PHL ]1
DO ]0/2
PHL ]2
DO ]0/3
PHL ]3
DO ]0/4
PHL ]4
FIN
FIN
FIN
FIN
<<<
P2SL MAC
PHA
PHA
IF #=]1
PEA ^]1
ELSE
PHW ]1+2
FIN
PHW ]1
<<<
PHL MAC
IF #=]1
PEA ^]1
ELSE
PHW ]1+2
FIN
PHW ]1
<<<
PHS MAC
DO ]0
LUP ]1
PHA
--^
ELSE
PHA
FIN
<<<
P2SW MAC
PHA
PHA
do ]0=0
pha
else
phw ]1
fin
eom
PUSHWORD mac
do ]0=0
pha
else
phw ]1
fin
eom
PHW mac
if #=]1
pea ]1
else
]D = *
lda ]1
do *-]d/3
if MX/2
ds -3
lda ]1+1
pha
lda ]1
fin
pha
else
ds -2
pei ]1
fin
fin
eom
PUSHLONG MAC
IF #=]1
PushWord #^]1
ELSE
PushWord ]1+2
FIN
PushWord ]1
<<<
PULLLONG MAC
DO ]0
PullWord ]1
PullWord ]1+2
ELSE
PullWord
PullWord
FIN
<<<
PULLWORD MAC
PLA
DO ]0
STA ]1
FIN
IF MX/2
PLA
DO ]0
STA ]1+1
FIN
FIN
<<<
TOOL MAC
LDX #]1
JSL $E10000
<<<
CLOSE_GS mac
GSOS $2014;]1
eom
OPEN_GS mac
GSOS $2010;]1
eom
READ_GS mac
GSOS $2012;]1
eom
GSOS mac
jsl $E100A8
da ]1
adrl ]2
eom
_RMSETRESOURCENAME mac
Tool $2D1E
<<<
^RMLOADNAMEDRESOURCE mac
PHS 2
PHWL ]1;]2
Tool $2C1E
<<<
~RMFindNamedResource mac ;sys6.0
PHS 2
PHW ]1
PxL ]2;]3
Tool $2A1E
<<<
_RMFindNamedResource mac
Tool $2A1E
<<<
_NEWHANDLE MAC
Tool $902
<<<
^HEXIT MAC
P2SW ]1
Tool $2A0B
<<<
_SetHandleID MAC
Tool $3002
<<<
^GETCURRESOURCEAPP MAC
PHA
Tool $141E
<<<
^MMSTARTUP MAC
PHA
Tool $202
<<<

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,16 @@
# movieTheatre makefile
# by Jim Maricondo
# v1.0 - 1/4/93 - coded (tC?)
# v1.0.1 - 1/9/93 1:19am - "-m .", ":", etc. (Jg?!)
# v1.0.2 - 2/16/93 8:54pm - t2common.rez. (HB!??!)
movie.r: movie.rez 22/t2common.rez
compile movie.rez keep=movie.r
movietheater: movie.d movie.r
duplicate -d movie.d movietheater
duplicate -r movie.r movietheater
setfile -at $4004 -t $bc movietheater -m .
cp movieTheater *:system:cdevs:twilight:MovieTheater
22:beep

View File

@ -0,0 +1,193 @@
#include "types.rez"
#include "22:t2common.rez"
// --- type $8001 defines
#define YDI_Icon $10dd01
// --- type $8003 defines
#define YDI_CtlLst $00000005
// --- type $8004 defines
#define YDISetAnimPathCtl $00006FFF
#define YDIAnimPathStrCtl $00007000
#define YDIStrCtl $00007001
#define YDIIconCtl $00007002
// --- type $8006 defines
#define YDISetAnimPathStr $00000011
// --- type $800B defines
#define YDI_LText $00000001
#define AnimPath_LText $00000002
resource rT2ModuleFlags (moduleFlags) {
fSetup+
fFadeOut+
fFadeIn+
fLoadSetupBlank+
fLeavesUsableScreen, // module flags word
$01, // enabled flag (unimplemented)
$0110, // minimum T2 version required
NIL, // reserved
"Movie Theater" // module name
};
// --- About text resource
resource rTextForLETextBox2 (moduleMessage) {
TBLeftJust
TBBackColor TBColorF
TBForeColor TBColor0
"Movie Theater"
TBForeColor TBColor1
" will display any PaintWorks-type ($C2) animation files.\n"
"Be careful to choose animation files that won\$D5t burn in!"
};
// --- Version resource
resource rVersion (moduleVersion) {
{1,0,0,release,0}, // Version
verUS, // US Version
"T2 Movie Theater Module", // program's name
"By Derek Young and J.Maricondo.\n"
"Copyright 1992-93 Jim Maricondo." // copyright notice
};
// --- Icon Definitions
resource rIcon (moduleIcon) {
$8000, // kind
$0015, // height
$0016, // width
$"F00000000000000000000F"
$"0FFFFFFFFFFFFFFFFFFFF0"
$"0F000000000000000000F0"
$"0F0FF000111111000FF0F0"
$"0F0FF0F01111110F0FF0F0"
$"0F0FF000000000000FF0F0"
$"0F0FF0F04444440F0FF0F0"
$"0F0FF000444444000FF0F0"
$"0F0FF0F04444440F0FF0F0"
$"0F0FF000444444000FF0F0"
$"0F0FF0F00000000F0FF0F0"
$"0F0FF000EEEEEE000FF0F0"
$"0F000000000000000000F0"
$"0FFFFFFFFFFFFFFFFAFFF0"
$"0000000000000000000000"
$"F0FFFFFFFFFFFFFFFFFF0F"
$"F0FFFFFFFFFFFFFFFFFF0F"
$"F0FF4AFFFFFFFFFFFFFF0F"
$"F0CCCCCCCCCCCCCCCCCC0F"
$"F0FFFFFFFFFFFFFFFAFF0F"
$"F00000000000000000000F",
$"0FFFFFFFFFFFFFFFFFFFF0"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFF"
$"0FFFFFFFFFFFFFFFFFFFF0"
$"0FFFFFFFFFFFFFFFFFFFF0"
$"0FFFFFFFFFFFFFFFFFFFF0"
$"0FFFFFFFFFFFFFFFFFFFF0"
$"0FFFFFFFFFFFFFFFFFFFF0"
$"0FFFFFFFFFFFFFFFFFFFF0";
};
// --- Control List Definitions
resource rControlList (YDI_CtlLst) {
{
YDIIconCtl, // control 3
YDIStrCtl, // control 4
// YDIAnimPathStrCtl, // control 5
YDISetAnimPathCtl, // control 6
};
};
// --- Control Templates
resource rControlTemplate (YDISetAnimPathCtl) {
$00000001, // ID
{ 72, 92-2, 85,250+2}, // rect
simpleButtonControl {{
$0000, // flag
$3002, // moreFlags
$00000000, // refCon
YDISetAnimPathStr, // titleRef
0, // colorTableRef
{"A","a",$0100,$0100} // key equivalents
}};
};
resource rControlTemplate (YDIAnimPathStrCtl) {
$00000002, // ID
{ 93, 12,125,331}, // rect
statTextControl {{
$0000, // flag
$1002, // moreFlags
$00000000, // refCon
AnimPath_LText, // textRef
NIL, // textSize
$0000 // just
}};
};
resource rControlTemplate (YDIStrCtl) {
$00000003, // ID
{ 56,128, 64,247}, // rect
statTextControl {{
$0000, // flag
$1002, // moreFlags
$00000000, // refCon
YDI_LText, // textRef
NIL, // textSize
$0000 // just
}};
};
resource rControlTemplate (YDIIconCtl) {
$00000004, // ID
{ 33-1,146, 53+1,194}, // rect
iconButtonControl {{
$000C, // flag
$1020, // moreFlags
$00000000, // refCon
YDI_Icon, // iconRef
0, // titleRef
0, // colorTableRef
$0000 // displayMode
}};
};
// --- rPString Templates
resource rPString (YDISetAnimPathStr) {
"Set Animation Path..."
};
// --- rTextForLETextBox2 Templates
resource rTextForLETextBox2 (YDI_LText) {
"Movie Theater"
};
resource rTextForLETextBox2 (AnimPath_LText) {
TBLeftJust
TBLeftMargin "\$00\$00"
"Animation\$CAPath:\$CA"
"\$D2*0\$D3"
};