mirror of
https://github.com/callapple/Twilight_II.git
synced 2025-04-12 03:37:14 +00:00
Add files via upload
This commit is contained in:
parent
54c01d1ce8
commit
6a1c673f1d
339
source/twilight/puzzling/Puzzling.Mac
Normal file
339
source/twilight/puzzling/Puzzling.Mac
Normal file
@ -0,0 +1,339 @@
|
||||
MACRO
|
||||
&lab _UDivide
|
||||
&lab ldx #$0B0B
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _NewHandle
|
||||
&lab ldx #$0902
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetPort
|
||||
&lab ldx #$1B04
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab pulllong &addr1,&addr2
|
||||
&lab ANOP
|
||||
AIF C:&addr1=0,.a
|
||||
AIF C:&addr2=0,.b
|
||||
LCLC &C
|
||||
&C AMID &addr1,1,1
|
||||
AIF "&C"="[",.zeropage
|
||||
pullword &addr1
|
||||
sta &addr2
|
||||
pullword &addr1+2
|
||||
sta &addr2+2
|
||||
MEXIT
|
||||
.a
|
||||
pullword
|
||||
pullword
|
||||
MEXIT
|
||||
.b
|
||||
pullword &addr1
|
||||
pullword &addr1+2
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&addr2
|
||||
pullword &addr1,y
|
||||
ldy #&addr2+2
|
||||
pullword &addr1,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pullword &SYSOPR
|
||||
&lab ANOP
|
||||
pla
|
||||
AIF C:&SYSOPR=0,.end
|
||||
sta &SYSOPR
|
||||
.end
|
||||
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 Debug &string
|
||||
aif t:debugSymbols="G",.begin
|
||||
mexit
|
||||
.begin
|
||||
dc i1'$82'
|
||||
dc i2'(L:&string)+3'
|
||||
dc i2'$7771'
|
||||
dc i1'L:&string',C'&string'
|
||||
MEND
|
||||
MACRO
|
||||
&LAB JEQ &BP
|
||||
&LAB BNE *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetPort
|
||||
&lab LongResult
|
||||
Tool $1C04
|
||||
mend
|
||||
macro
|
||||
&lab Tool &number
|
||||
&lab ldx #&number
|
||||
jsl $E10000
|
||||
mend
|
||||
MACRO
|
||||
&LAB JNE &BP
|
||||
&LAB BEQ *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetMasterSCB
|
||||
&lab WordResult
|
||||
Tool $1704
|
||||
mend
|
||||
macro
|
||||
&lab ~GetPortLoc &locInfoPtr
|
||||
&lab ph4 &locInfoPtr
|
||||
Tool $1E04
|
||||
mend
|
||||
macro
|
||||
&lab ph4 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &addr,1,1
|
||||
aif "&char"="@",.registers
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif c:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
.yesoffset
|
||||
lda &addr+2,&offset
|
||||
pha
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr+2
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr+2,s
|
||||
pha
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.registers
|
||||
phy
|
||||
phx
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea +(&addr)|-16
|
||||
pea &addr
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr+2
|
||||
pei &addr
|
||||
mexit
|
||||
.zeroPage
|
||||
aif C:&offset<>0,.zeroPageOffset
|
||||
ldy #2
|
||||
lda &addr,y
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOffset
|
||||
aif "&offset"="X",.zeroPageRegX
|
||||
aif "&offset"="Y",.zeroPageRegY
|
||||
aif "&offset"="x",.zeroPageRegX
|
||||
aif "&offset"="y",.zeroPageRegY
|
||||
ldy #&offset+2
|
||||
lda &addr,y
|
||||
pha
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageRegX
|
||||
lda &addr,&offset
|
||||
tay
|
||||
inx
|
||||
inx
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phy
|
||||
mexit
|
||||
.zeroPageRegY
|
||||
lda &addr,&offset
|
||||
tax
|
||||
iny
|
||||
iny
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phx
|
||||
mend
|
||||
macro
|
||||
&lab ~DisposeAll &userID
|
||||
&lab ph2 &userID
|
||||
Tool $1102
|
||||
mend
|
||||
macro
|
||||
&lab ~PaintPixels &paintParamPtr
|
||||
&lab ph4 &paintParamPtr
|
||||
Tool $7F04
|
||||
mend
|
||||
macro
|
||||
&lab ~GetWMgrPort
|
||||
&lab LongResult
|
||||
Tool $200E
|
||||
mend
|
||||
macro
|
||||
&lab ph2 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid "&addr",1,1
|
||||
aif "&char"="@",.accumulator
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif C:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.accumulator
|
||||
pha
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea &addr
|
||||
mexit
|
||||
.zeropage
|
||||
aif C:&offset<>0,.zeroPageOff
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOff
|
||||
aif "&offset"="X",.zeroPageReg
|
||||
aif "&offset"="Y",.zeroPageReg
|
||||
aif "&offset"="x",.zeroPageReg
|
||||
aif "&offset"="y",.zeroPageReg
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageReg
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mend
|
||||
macro
|
||||
&lab ~UDivide ÷nd,&divisor
|
||||
&lab WordResult
|
||||
WordResult
|
||||
ph2 ÷nd
|
||||
ph2 &divisor
|
||||
Tool $0B0B
|
||||
mend
|
||||
MACRO
|
||||
&lab str &string
|
||||
&lab dc i1'L:&string',C'&string'
|
||||
MEND
|
||||
MACRO
|
||||
&lab _GetSCB
|
||||
&lab ldx #$1304
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetSCB
|
||||
&lab ldx #$1204
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~MMStartUp
|
||||
&lab WordResult
|
||||
Tool $0202
|
||||
mend
|
||||
MACRO
|
||||
&lab _MMShutDown
|
||||
&lab ldx #$0302
|
||||
jsl $E10000
|
||||
MEND
|
85
source/twilight/puzzling/Puzzling.REZ
Normal file
85
source/twilight/puzzling/Puzzling.REZ
Normal file
@ -0,0 +1,85 @@
|
||||
|
||||
#include "types.rez"
|
||||
#include "22:t2common.rez"
|
||||
|
||||
resource rT2ModuleFlags (moduleFlags) {
|
||||
fMostCommonPalette+
|
||||
fLeavesUsableScreen+
|
||||
fReqUsableScreen, // module flags word
|
||||
$01, // enabled flag (unimplemented)
|
||||
$0110, // minimum T2 version required
|
||||
NIL, // reserved
|
||||
"Puzzling" // module name
|
||||
};
|
||||
|
||||
// --- About text resource
|
||||
|
||||
resource rTextForLETextBox2 (moduleMessage) {
|
||||
TBLeftJust
|
||||
TBBackColor TBColorF
|
||||
TBForeColor TBColor5
|
||||
"Puzzling"
|
||||
TBForeColor TBColor1
|
||||
" turns your screen into a mosaic of constantly swapping rectangular "
|
||||
"puzzle pieces."
|
||||
};
|
||||
|
||||
// --- Version resource
|
||||
|
||||
resource rVersion (moduleVersion) {
|
||||
{1,0,0,release,0}, // Version
|
||||
verUS, // US Version
|
||||
"T2 Puzzling Module", // program's name
|
||||
"By J. Maricondo and Stich.\n"
|
||||
"Copyright 1991-93, Jim Maricondo." // copyright notice
|
||||
};
|
||||
|
||||
// --- About icon resource
|
||||
|
||||
resource rIcon (moduleIcon) {
|
||||
$8000, // kind
|
||||
$0014, // height
|
||||
$001C, // width
|
||||
|
||||
$"FFF0000000000000000000000FFF"
|
||||
$"FFF0FFFFFFFFFFFFFFFFFFFF0FFF"
|
||||
$"FFF0F000000000000000000F0FFF"
|
||||
$"FFF0F0FFFFFF00000FFFFF0F0FFF"
|
||||
$"FFF0F0F8888A00000F888A0F0FFF"
|
||||
$"FFF0F0F88AA0000FF8888A0F0FFF"
|
||||
$"FFF0F0F8A00000F888888A0F0FFF"
|
||||
$"FFF0F0F8A00000F888888A0F0FFF"
|
||||
$"FFF0F0F88BB0000AA8888A0F0FFF"
|
||||
$"FFF0F0F8888A00000F888A0F0FFF"
|
||||
$"FFF0F0FAAAAA00000FAAAA0F0FFF"
|
||||
$"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";
|
||||
};
|
28
source/twilight/puzzling/makefile
Normal file
28
source/twilight/puzzling/makefile
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
# Twilight II Puzzling UNIX MakeFile
|
||||
# by Jim Maricondo
|
||||
# v1.0 - 10/24/92 2:52pm
|
||||
# v1.1 - 1/2/93 6:08pm
|
||||
# v1.1.1 - 1/9/93 1:19am
|
||||
|
||||
# First deal with all the dfork...
|
||||
|
||||
puzzling.d.root: puzzling.asm puzzling.mac 22/t2common.equ 22/dsdb.equ 22/makepdp.asm
|
||||
compile +w puzzling.asm keep=puzzling.d
|
||||
|
||||
puzzling.d: puzzling.d.root 22/random3.a.root
|
||||
link +w puzzling.d 22:random3.a keep=puzzling.d
|
||||
|
||||
# Now work with the rfork...
|
||||
|
||||
puzzling.r: puzzling.rez 22/t2common.rez
|
||||
compile puzzling.rez keep=puzzling.r
|
||||
|
||||
# Now put it together.
|
||||
|
||||
puzzling: puzzling.r puzzling.d
|
||||
duplicate -d puzzling.d puzzling
|
||||
duplicate -r puzzling.r puzzling
|
||||
setfile -at $4004 -t $bc puzzling -m .
|
||||
cp puzzling :Jim1:system:cdevs:twilight:puzzling
|
||||
22:beep
|
289
source/twilight/puzzling/puzzling.asm
Normal file
289
source/twilight/puzzling/puzzling.asm
Normal file
@ -0,0 +1,289 @@
|
||||
|
||||
*-----------------------------------------------------------------------------*
|
||||
! Twilight II Little Puzzling Module. !
|
||||
! !
|
||||
! By Jim Maricondo and Jonah Stich. !
|
||||
! !
|
||||
! v1.0 for Twilight II - 10/24/92 JRM !
|
||||
! v1.0f1 - 1/2/93 JRM !
|
||||
! !
|
||||
! Copyright (c) 1991-1993 Jim Maricondo. All rights reserved. !
|
||||
*-----------------------------------------------------------------------------*
|
||||
mcopy Puzzling.MAC
|
||||
copy 22:t2common.equ
|
||||
copy 22:dsdb.equ
|
||||
copy 13:ainclude:e16.memory
|
||||
copy 13:ainclude:e16.quickdraw
|
||||
keep puzzling.d
|
||||
*-----------------------------------------------------------------------------*
|
||||
MyID gequ <0
|
||||
ScreenW gequ MyID+2
|
||||
MovePtr gequ ScreenW+2
|
||||
*-----------------------------------------------------------------------------*
|
||||
Puzzling Start
|
||||
kind $1000 ; no special memory
|
||||
debug 'Puzzling'
|
||||
using PuzzDATA
|
||||
|
||||
copy 22:dsdb.asm
|
||||
|
||||
phb Store old data bank
|
||||
phk
|
||||
plb
|
||||
phd
|
||||
; tdc
|
||||
; sta OurDP
|
||||
; tsc
|
||||
; tcd
|
||||
|
||||
; dbrk $0f
|
||||
|
||||
lda T2Message,s ; Get which setup procedure to call.
|
||||
cmp #BlankT2
|
||||
jne notSupported
|
||||
|
||||
lda T2data1,s ; movePtr
|
||||
sta MovePtr
|
||||
lda T2data1+2,s
|
||||
sta MovePtr+2
|
||||
|
||||
; lda T2data2+2,s
|
||||
; ora #$0100
|
||||
; sta MyID
|
||||
|
||||
~MMStartUp
|
||||
pla
|
||||
ora #$0100
|
||||
sta MyID
|
||||
|
||||
|
||||
; dbrk $55
|
||||
|
||||
; PushWord #t2PrivGetProcs
|
||||
; PushWord #stopAfterOne+sendToName
|
||||
; PushLong #toString
|
||||
; PushLong #8
|
||||
; PushLong #dataOut
|
||||
; _SendRequest
|
||||
;
|
||||
; jsl set_random_seed
|
||||
|
||||
PushLong #toT2String
|
||||
jsl init_random
|
||||
|
||||
ldx #200-1
|
||||
forcePal0 phx
|
||||
phx
|
||||
phd
|
||||
phx
|
||||
_GetSCB
|
||||
pla
|
||||
and #$F0
|
||||
pha
|
||||
_SetSCB
|
||||
plx
|
||||
dex
|
||||
bpl forcePal0
|
||||
|
||||
lda #640
|
||||
sta ScreenW
|
||||
|
||||
~GetMasterSCB
|
||||
PullWord StoreLoc
|
||||
bit #mode640
|
||||
bne screenOk
|
||||
|
||||
lda #320
|
||||
sta ScreenW
|
||||
|
||||
screenOk anop
|
||||
~GetPort
|
||||
|
||||
~GetWMgrPort
|
||||
_SetPort
|
||||
|
||||
~GetPortLoc #SourceLoc
|
||||
|
||||
~UDivide ScreenW,#5
|
||||
pullword Inc
|
||||
pla
|
||||
|
||||
ldx #0
|
||||
lda #0
|
||||
nextX sta RectTable+2,x
|
||||
sta RectTable+42,x
|
||||
sta RectTable+82,x
|
||||
sta RectTable+122,x
|
||||
clc
|
||||
adc Inc
|
||||
sta RectTable+6,x
|
||||
sta RectTable+46,x
|
||||
sta RectTable+86,x
|
||||
sta RectTable+126,x
|
||||
tay
|
||||
txa
|
||||
clc
|
||||
adc #8
|
||||
tax
|
||||
tya
|
||||
cpx #40
|
||||
bne nextX
|
||||
|
||||
longresult
|
||||
pushlong #32*51
|
||||
pei MyID
|
||||
pushword #attrLocked+attrFixed
|
||||
pushlong #0
|
||||
_NewHandle
|
||||
jsr makePdp
|
||||
pld
|
||||
PullLong MemPtr
|
||||
|
||||
event_loop anop
|
||||
wordresult
|
||||
wordresult
|
||||
jsl random
|
||||
; wordresult
|
||||
; _Random
|
||||
pha
|
||||
pushword #20
|
||||
_UDivide
|
||||
pla
|
||||
pla
|
||||
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
tax
|
||||
ldy #0
|
||||
nextRect1 lda RectTable,x
|
||||
sta SourceRect,y
|
||||
inx
|
||||
inx
|
||||
iny
|
||||
iny
|
||||
cpy #8
|
||||
bne nextRect1
|
||||
|
||||
wordresult
|
||||
wordresult
|
||||
; wordresult
|
||||
; _Random
|
||||
jsl random
|
||||
pha
|
||||
pushword #20
|
||||
_UDivide
|
||||
pla
|
||||
pla
|
||||
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
tax
|
||||
ldy #0
|
||||
nextRect2 lda RectTable,x
|
||||
sta DestRect,y
|
||||
inx
|
||||
inx
|
||||
iny
|
||||
iny
|
||||
cpy #8
|
||||
bne nextRect2
|
||||
|
||||
~PaintPixels #StoreParams
|
||||
~PaintPixels #MoveParams
|
||||
~PaintPixels #RestoreParams
|
||||
|
||||
lda [MovePtr]
|
||||
jeq event_loop
|
||||
|
||||
_SetPort
|
||||
|
||||
~DisposeAll MyID
|
||||
|
||||
lda MyID
|
||||
and #$F0FF
|
||||
pha
|
||||
_MMShutDown
|
||||
|
||||
notSupported anop
|
||||
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
|
||||
clc
|
||||
rtl
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
PuzzDATA Data
|
||||
debug 'PuzzDATA'
|
||||
|
||||
toT2String str 'DYA~Twilight II~'
|
||||
|
||||
SourceRect ds 8
|
||||
DestRect ds 8
|
||||
|
||||
SourceLoc ds 16
|
||||
|
||||
StoreLoc ds 2
|
||||
MemPtr ds 4
|
||||
dc i'32'
|
||||
StoreRect dc i'0,0,50'
|
||||
Inc ds 2
|
||||
|
||||
StoreParams anop
|
||||
dc i4'SourceLoc'
|
||||
dc i4'StoreLoc'
|
||||
dc i4'DestRect'
|
||||
dc i4'StoreRect'
|
||||
dc i'0'
|
||||
dc i4'0'
|
||||
|
||||
MoveParams anop
|
||||
dc i4'SourceLoc'
|
||||
dc i4'SourceLoc'
|
||||
dc i4'SourceRect'
|
||||
dc i4'DestRect'
|
||||
dc i'0'
|
||||
dc i4'0'
|
||||
|
||||
RestoreParams anop
|
||||
dc i4'StoreLoc'
|
||||
dc i4'SourceLoc'
|
||||
dc i4'StoreRect'
|
||||
dc i4'SourceRect'
|
||||
dc i'0'
|
||||
dc i4'0'
|
||||
|
||||
RectTable anop
|
||||
Rect1 dc i'0,0,50,0'
|
||||
Rect2 dc i'0,0,50,0'
|
||||
Rect3 dc i'0,0,50,0'
|
||||
Rect4 dc i'0,0,50,0'
|
||||
Rect5 dc i'0,0,50,0'
|
||||
Rect6 dc i'50,0,100,0'
|
||||
Rect7 dc i'50,0,100,0'
|
||||
Rect8 dc i'50,0,100,0'
|
||||
Rect9 dc i'50,0,100,0'
|
||||
Rect10 dc i'50,0,100,0'
|
||||
Rect11 dc i'100,0,150,0'
|
||||
Rect12 dc i'100,0,150,0'
|
||||
Rect13 dc i'100,0,150,0'
|
||||
Rect14 dc i'100,0,150,0'
|
||||
Rect15 dc i'100,0,150,0'
|
||||
Rect16 dc i'150,0,200,0'
|
||||
Rect17 dc i'150,0,200,0'
|
||||
Rect18 dc i'150,0,200,0'
|
||||
Rect19 dc i'150,0,200,0'
|
||||
Rect20 dc i'150,0,200,0'
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
copy 22:makePdp.ASM
|
391
source/twilight/quotes/QUOTES.REZ
Normal file
391
source/twilight/quotes/QUOTES.REZ
Normal file
@ -0,0 +1,391 @@
|
||||
/***************************************************
|
||||
* Resources for T2 Quotes module
|
||||
****************************************************/
|
||||
|
||||
#include "types.rez"
|
||||
#include "t2common.rez"
|
||||
|
||||
/***** Required resources *****/
|
||||
|
||||
resource rPString(moduleName) {
|
||||
"Quotes"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2(moduleMessage) {
|
||||
TBForeColor
|
||||
TBColor1
|
||||
"While your IIGS is idle, let it entertain you "
|
||||
"with a collection of zany and thought- provoking "
|
||||
"quotes!"
|
||||
};
|
||||
|
||||
resource rIcon(moduleIcon) {
|
||||
$8000, /* color */
|
||||
$0014,
|
||||
$001C,
|
||||
$"0000000000000000000000000000"
|
||||
$"0000000000000000000000000000"
|
||||
$"0000000000000000000000000000"
|
||||
$"0000000000000000000000000000"
|
||||
$"00000FFFF0000000FFFF00000000"
|
||||
$"0000FFFFFF00000FFFFFF0000000"
|
||||
$"0000FFFFFF00000FFFFFF0000000"
|
||||
$"0000FFFFF000000FFFFF00000000"
|
||||
$"00000FFFF0000000FFFF00000000"
|
||||
$"00000FFFFF000000FFFFF0000000"
|
||||
$"0000000FFFFF000000FFFFF00000"
|
||||
$"0000000000FFF00000000FFF0000"
|
||||
$"0000000000000000000000000000"
|
||||
$"0000000000000000000000000000"
|
||||
$"0000000000000000000000000000"
|
||||
$"0000000000000000000000000000"
|
||||
$"0000000000000000000000000000"
|
||||
$"0000000000000000000000000000"
|
||||
$"0000000000000000000000000000"
|
||||
$"0000000000000000000000000000",
|
||||
|
||||
$"0000000000000000000000000000"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"0000000000000000000000000000"
|
||||
$"0000000000000000000000000000"
|
||||
$"0000000000000000000000000000"
|
||||
$"0000000000000000000000000000"
|
||||
$"0000000000000000000000000000",
|
||||
};
|
||||
|
||||
resource rT2ModuleFlags(moduleFlags) {
|
||||
fSetupSupported+fWantFadeOut+fWantFadeIn+fWantForceGrafPortMode640+fForceLoadSetupAtBoot
|
||||
};
|
||||
|
||||
resource rVersion(moduleVersion) {
|
||||
{1,0,0,development,7},
|
||||
verUS,
|
||||
"Twilight II Quotes Module v1.0",
|
||||
"By Eric D. Shepherd (June 2, 1992)"
|
||||
};
|
||||
|
||||
/***************************************************
|
||||
*********** NOTE: LETextBox2 resources *************
|
||||
*********** from $0001-$FFFF are *************
|
||||
*********** RESERVED for quotes. *************
|
||||
****************************************************/
|
||||
|
||||
/***************************************************
|
||||
* Setup controls
|
||||
*
|
||||
***/
|
||||
|
||||
resource rControlTemplate(1) {
|
||||
1, /* ID */
|
||||
{26,5,36,52}, /* Rect */
|
||||
statTextControl {{
|
||||
0,
|
||||
$1002,
|
||||
0,
|
||||
$10000
|
||||
}};
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2($10000) {
|
||||
"Delay:"
|
||||
};
|
||||
|
||||
resource rControlTemplate(2) {
|
||||
2, /* ID */
|
||||
{25,53,37,100}, /* Rect */
|
||||
editLineControl {{
|
||||
0, /* Visible */
|
||||
$7002, /* moreFlags */
|
||||
0,
|
||||
4, /* Size in characters */
|
||||
0
|
||||
}};
|
||||
};
|
||||
|
||||
resource rControlTemplate(3) {
|
||||
3, /* ID */
|
||||
{40,5,110,343}, /* Rect */
|
||||
editTextControl {{
|
||||
0, /* visible */
|
||||
$7402, /* moreflags */
|
||||
0,
|
||||
fSingleFormat+fSmartCutPaste+fTabSwitch+fDrawBounds,
|
||||
{$FFFF,$FFFF,$FFFF,$FFFF},
|
||||
$FFFFFFFF
|
||||
}};
|
||||
};
|
||||
|
||||
resource rControlTemplate(4) {
|
||||
4, /* ID */
|
||||
{24,110,0,0}, /* Rect */
|
||||
simpleButtonControl {{
|
||||
0, /* visible, round, single-outline */
|
||||
$1002,
|
||||
0,
|
||||
$1000
|
||||
}};
|
||||
};
|
||||
|
||||
resource rPString($1000) {
|
||||
"Add"
|
||||
};
|
||||
|
||||
resource rControlTemplate(5) {
|
||||
5, /* ID */
|
||||
{24,172,0,0}, /* Rect */
|
||||
simpleButtonControl {{
|
||||
0,
|
||||
$1002,
|
||||
0,
|
||||
$1001
|
||||
}};
|
||||
};
|
||||
|
||||
resource rPString($1001) {
|
||||
"Replace"
|
||||
};
|
||||
|
||||
resource rControlTemplate(6) {
|
||||
6, /* ID */
|
||||
{24,265,0,0}, /* Rect */
|
||||
simpleButtonControl {{
|
||||
0,
|
||||
$1002,
|
||||
0,
|
||||
$1002
|
||||
}};
|
||||
};
|
||||
|
||||
resource rPString($1002) {
|
||||
"Delete"
|
||||
};
|
||||
|
||||
resource rControlTemplate(7) {
|
||||
7, /* ID */
|
||||
{114,5,127,290},
|
||||
scrollControl {{
|
||||
$001C, /* has left & right arrows */
|
||||
$1000,
|
||||
0, /* Refcon */
|
||||
100, /* maxSize -- to be set in Quotes */
|
||||
1, /* see one at a time */
|
||||
1 /* initial setting */
|
||||
}};
|
||||
};
|
||||
|
||||
resource rControlTemplate(8) {
|
||||
8, /* ID */
|
||||
{115,294,126,343}, /* Rect */
|
||||
statTextControl {{
|
||||
$80, /* invisible */
|
||||
$1000,
|
||||
0,
|
||||
0
|
||||
}};
|
||||
};
|
||||
|
||||
|
||||
resource rControlList(1) {
|
||||
{
|
||||
3, /* TextEdit */
|
||||
1, /* Static text */
|
||||
2, /* edit line */
|
||||
4, /* Add button */
|
||||
5, /* Replace button */
|
||||
6, /* Delete button */
|
||||
7, /* scroll bar */
|
||||
8, /* current selection statText */
|
||||
0
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/***************************************************
|
||||
* Quote strings & stuff
|
||||
*
|
||||
***/
|
||||
|
||||
resource rT2ModuleWord(1) {
|
||||
$0016 /* The number of string resources 0-65535 */
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2(1) {
|
||||
"For every man there one day will come an answer, "
|
||||
"custom-tailored to suit his soul."
|
||||
TBEndOfLine
|
||||
" -- Anonymous"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2(2) {
|
||||
"Quoth the raven: 'Eat my shorts!'"
|
||||
TBEndOfLine
|
||||
" -- Bart Simpson"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2(3) {
|
||||
"Apple II Forever "
|
||||
TBEndOfLine
|
||||
" -- Apple Computer, Inc."
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2(4) {
|
||||
"I'll hack anything, anytime, as long as it's fun!"
|
||||
TBEndOfLine
|
||||
" -- Anonymous"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2(5) {
|
||||
"'Tis better to have loved and lost... yadda yadda yadda."
|
||||
TBEndOfLine
|
||||
" -- Bart Simpson"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2(6) {
|
||||
"Yield to temptation; it may not pass your way again."
|
||||
TBEndOfLine
|
||||
" -- Lazarus Long"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2(7) {
|
||||
TBStyleBold
|
||||
"Quotes Module"
|
||||
TBStylePlain
|
||||
" v1.0d7"
|
||||
TBStyleBold
|
||||
TBEndOfLine
|
||||
"for Twilight II"
|
||||
TBStylePlain
|
||||
TBEndOfLine
|
||||
TBEndOfLine
|
||||
"Module by Eric Shepherd"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2(8) {
|
||||
"Always listen to experts. They'll tell you what can't be done, "
|
||||
"and why. Then do it."
|
||||
TBEndOfLine
|
||||
" -- Lazarus Long"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2(9) {
|
||||
TBStyleItalic
|
||||
TBStyleBold
|
||||
"Twilight II"
|
||||
TBEndOfLine
|
||||
TBStylePlain
|
||||
" by Jim Maricondo"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2($000A) {
|
||||
TBStyleBold
|
||||
"You can add quotes to this module!"
|
||||
TBStylePlain
|
||||
TBEndOfLine
|
||||
"At this time, you have to manually modify the Quotes module's "
|
||||
"resources, since setup isn't implemented in this version."
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2($000B) {
|
||||
"In the beginning the Universe was created. This has made "
|
||||
"a lot of people very angry and been widely regarded as a bad "
|
||||
"move."
|
||||
TBEndOfLine
|
||||
" -- Douglas Adams"
|
||||
TBEndOfLine
|
||||
TBStyleItalic
|
||||
" The Restaurant at the End of the Universe"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2($000C) {
|
||||
"There is a theory which states that if ever anyone discovers "
|
||||
"exactly what the Universe is for and why it is here, it will "
|
||||
"instantly disappear and be replaced by something even more "
|
||||
"bizarre and inexplicable."
|
||||
TBEndOfLine
|
||||
TBEndOfLine
|
||||
"There is another which states that this has already happened."
|
||||
TBEndOfLine
|
||||
" -- Douglas Adams"
|
||||
TBEndOfLine
|
||||
TBStyleItalic
|
||||
" The Restaurant at the End of the Universe"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2($000D) {
|
||||
"Mr. President, we must not allow a mine shaft gap!"
|
||||
TBEndOfLine
|
||||
" -- George C. Scott"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2($000E) {
|
||||
"Mr. Tangent for President in 1992!"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2($000F) {
|
||||
"Life is made up of sobs, sniffles, and smiles, "
|
||||
"with sniffles predominating."
|
||||
TBEndOfLine
|
||||
" -- O. Henry"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2($0010) {
|
||||
"Once there were two brothers. One ran away to sea, the other "
|
||||
"was elected Vice-President, and nothing was ever heard of "
|
||||
"either of them again."
|
||||
TBEndOfLine
|
||||
" -- Thomas R. Marshall"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2($0011) {
|
||||
"He travels the fastest who travels alone."
|
||||
TBEndOfLine
|
||||
" -- Rudyard Kipling"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2($0012) {
|
||||
"What is history but a fable agreed upon?"
|
||||
TBEndOfLine
|
||||
" -- Napoleon Bonaparte"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2($0013) {
|
||||
"Familiarity breeds contempt-- and children."
|
||||
TBEndOfLine
|
||||
" -- Mark Twain"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2($0014) {
|
||||
"You can fool some of the people all of the time, and all "
|
||||
"of the people some of the time, but you cannot fool all "
|
||||
"of the people all the time."
|
||||
TBEndOfLine
|
||||
" -- Abraham Lincoln"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2($0015) {
|
||||
"O, what a tangled web we weave,"
|
||||
TBEndOfLine
|
||||
" When first we practice to deceive!"
|
||||
TBEndOfLine
|
||||
" -- Walter Scott"
|
||||
};
|
||||
|
||||
resource rTextForLETextBox2($0016) {
|
||||
"Grow up as soon as you can. It pays. The only time "
|
||||
"you really live fully is from thirty to sixty."
|
||||
TBEndOfLine
|
||||
" -- Hervey Allen"
|
||||
};
|
92
source/twilight/quotes/QuotesNotes
Normal file
92
source/twilight/quotes/QuotesNotes
Normal file
@ -0,0 +1,92 @@
|
||||
Twilight II Quotes Module v1.0 Notes
|
||||
by Eric D. Shepherd
|
||||
|
||||
Quotes randomly selects a text message and displays it in a colored frame on the 640-mode super-hires screen. You can easily add, replace, and delete quotes using Setup in Twilight II.
|
||||
|
||||
The default display time is 15 seconds; you can change this by simply entering the number of seconds you would like the delay to last in the Delay edit line. Negative numbers are pinned to zero. The maximum allowed delay is 1092 seconds (amazingly, this happens to be the maximum number of seconds which can be represented in 60ths of a second in a word :); any higher value will be pinned to this. If the value is zero, Quotes reacts predictablyÑit simply flashes the quotes on the screen as quickly as it can, with no delay between themÑ and although this isn't necessarily lightning-fast, it is fast enough to make reading the quotes impossible (unless you're a really, really fast reader).
|
||||
|
||||
The quotes are kept in the resource fork of the module itself, as is the resource which tracks how many quotes are available. The delay setting is kept in Twilight.Setup.
|
||||
|
||||
The horizontal scroll bar at the bottom of the window is used to select which quote you wish to view and/or modify. The number to the right of that is the quote number you are viewing. The most visible control is the large, black, TextEdit box. This is where the quote text is displayed. This scroll bar will be changed into a series of easy-to-use icons in the next version of Quotes; I've begun the coding, but ran out of time to complete the implementation before the Twilight II v1.0 release date.
|
||||
|
||||
Above this are three buttons: Add, Replace, and Delete. Clicking the Delete button will delete the currently displayed quote. Clicking the Replace button will save the current contents of the TextEdit box into the quote number displayed in the lower-right corner of the Setup window. Clicking the Add button will add a new quote, placing the contents of the TextEdit box into it. Note that clicking these buttons causes their respective actions to occur immediately, and that the Update button is only used for the Delay edit line and Disk events unblank checkbox.
|
||||
|
||||
All the standard TextEdit keys function normally; the most useful are:
|
||||
|
||||
Control-C Copy
|
||||
Control-V Paste
|
||||
Control-X Cut
|
||||
|
||||
There is a limit of 500 characters in the TextEdit box. This is done to avoid excessively large quotes which might be too long to read in the period of time they are displayed onscreen. However, for extremely long quotes, Quotes automatically adds three seconds to the time the text is displayed onscreen.
|
||||
|
||||
There are also a number of keyboard equivalents:
|
||||
|
||||
Apple-? Help (lists these keys)
|
||||
Apple-A Select all
|
||||
Apple-B Bold
|
||||
Apple-F Fix colors (sets current selection to white on black)
|
||||
Apple-I Italic
|
||||
Apple-L Underline (this works if you have ShastonUL.8 installed in your
|
||||
*:System:Fonts folder)
|
||||
Apple-O Outline
|
||||
Apple-S Shadow
|
||||
Apple-T Plain text
|
||||
|
||||
Fix Colors is provided so that if you paste text into the Quotes text box, you can correct the colors, which will usually be black on white instead of white on black.
|
||||
|
||||
Changes New to d11
|
||||
The Select all key, Apple-A, has been added. Also, Quotes now validates that you don't add more than 65,535 quotes by dimming the Add button if there are that many quotes (this has not been tested). Finally, the scroll bar is much less sensitive. The WaitUntil call was sort of screwed up: I was passing 4 as the delay time; the problem, of course, is that I meant 4 ticks, not 1/4 tick. Oops. Anyway, it's definitely much better now. :)
|
||||
|
||||
Also, thanks to Marc Wolfgram for supplying hundreds of new quotes. I haven't finished shuffling through them all yet (some of them don't work in the Quotes context, and some are just too darned long; and they all need some reworking to look right onscreen), but I have added a number of them. There are now about 160 quotes in the default module. If you have any you'd like to suggest, email me and I'll be happy to toss 'em in. :) Also, if there are any that you think are particularly stupid and should be removed, let me know!
|
||||
|
||||
Changes New to d12
|
||||
I have added about 200 more quotes for this version. Also, if TextEdit is not started, the Quotes setup box fills with a nice text message telling you to try again from another application. Formerly, Quotes would crash in this situation. For d13 I plan to add a color fix key equivalent to adjust the colors of the selected text; this will be provided because pasting text into the Quotes text box comes out with the colors inverted (and although you might want it that way, then again, you might not).
|
||||
|
||||
Changes New to d13
|
||||
The Fix Colors key has been implemented. Some spelling and formatting errors in quotes have been corrected, and more quotes have been added.
|
||||
|
||||
Changes New to d14
|
||||
Due to a combination of bugs in d13 and in T2 d34, version 1.0d13 of Quotes was extremely unstable and should not be used. The bug would cause Quotes to load and save the QuotesDelay resource from the wrong resource fork, and would confuse it until it crashed. This has been fixed; however, the delay time is still not loaded and saved correctly.
|
||||
|
||||
Changes New to d15
|
||||
Apparently, while I was editing the Rez source for Quotes, I accidentally deleted a random character, which just happened to be part of the control ID for one of the buttons. This made that button have the same ID as the Delay edit line, and using _SetLETextByID and _GetLETextByID on this was bad. This has been fixed.
|
||||
|
||||
Smoothed the icon by putting appropriate grays in the corners, making it look much better. I still have lots more quotes to add yet! :)
|
||||
|
||||
When the TextEdit box was getting updated, I was making an unneeded _DrawOneCtl call, wasting both memory and time. Removed.
|
||||
|
||||
Changes New to d16
|
||||
Added more quotes, bringing the current total to 439. Eventually, I'm going to go through and change quotes and apostrophes to use the curly quotes available on the super-hires screen.
|
||||
|
||||
Made some changes so that the Add button wouldn't flicker strangely. I think I've finally corrected all problems with controls that flicker and flash when they're updated due to multiple redraws.
|
||||
|
||||
Changes New to d17
|
||||
Adjusted the size of the TextEdit control so that no partial lines of text will ever appear. Also slightly moved most of the controls to make room for a line of text at the bottom of the Setup window. This text advises the user to press Apple-? for help.
|
||||
|
||||
Pressing Apple-? brings up a dialog (an alert window) with information on the keys available in Quotes setup.
|
||||
|
||||
A cool new addition: while the Quotes module is running, inserting and ejecting disks will unblank the screen just like mouse movements and keypresses do. This is done by calling ScanDevices during the loop that looks for the Movement flag. If ScanDevices returns a non-zero value, indicating an insertion or ejection, the screen is unblanked.
|
||||
|
||||
Changes New to b1
|
||||
Reworked the code which deals with the parameters passed to the module. The code is smaller and faster now. Removed redundant error checking on one tool call in the blank routine and improved error handling elsewhere. Removed quite a bit of unneeded codeÑcode that was saving and restoring port information unnecessarily. Tuned up the code responsible for the delay between quotes so that it would be a few bytes shorter.
|
||||
|
||||
The random number generator is now seeded differently. Previously, it was being seeded with the current value of the tick counter. Since this number rarely got unusually large, the possibilities for the seeding were limited. It is now seeded with an arrangement of the date and time returned by the ReadHexTime call.
|
||||
|
||||
Also cleaned up the appearance of the quotes, and removed several boring and stupid ones.
|
||||
|
||||
Finally fixed the problem that caused the screen not to blank during setup. Using the new t2ShareWord request procedure, I pass Quotes' resource app between the setup copy of Quotes and the blanking copy. Once I've done this, I can manipulate the resource path to get access the the files I need to blank.
|
||||
|
||||
Moved the scroll bar up one more line to make room for a checkbox at the bottom of the window. The "Disk events unblank" checkbox turns on and off the ScanDevices call Quotes makes in its delay loop. When this box is checked, disk insertions and ejections will unblank. When it is not checked, disk events will be ignored. This box is provided because certain devices are physically activated each time they are polled, and this can be really annoying (an example of this is the UniDisk 3.5). Users of the UniDisk 3.5 can now turn off this option to eliminate the constant polling of their drives at blank time.
|
||||
|
||||
Changes New to v1.0 (release version)
|
||||
I had begun replacing the scroll bar with icons to allow better control over the selection of the quote to be edited. Since I ran out of time, I've put the scroll bar back in, and will have the icons back in there for v1.0.1 or v1.1 (whichever).
|
||||
|
||||
Also cleaned up and added more quotes, and touched up the Help alert. I still don't like the help alert, and will probably redo it from scratch for the next version.
|
||||
|
||||
|
||||
Problems, Glitches, and Known Bugs
|
||||
No known bugs at this time.
|
||||
|
||||
If you find any bugs, or if you have questions or comments about Quotes, drop me email at uerics@mcl.mcl.ucsb.edu (or, if you must, AOL: Sheppy :).
|
||||
|
||||
- Eric S.
|
127
source/twilight/quotes/QuotesNotes1.1
Normal file
127
source/twilight/quotes/QuotesNotes1.1
Normal file
@ -0,0 +1,127 @@
|
||||
Twilight II Quotes Module v1.1 Notes
|
||||
by Eric D. Shepherd
|
||||
|
||||
Quotes randomly selects a text message and displays it in a colored frame on the 640-mode super-hires screen. You can easily add, replace, and delete quotes using Setup in Twilight II.
|
||||
|
||||
The default display time is 15 seconds; you can change this by using the data field control labelled ÒTimeÓ. You can select from among the following options: 5 seconds, 10 seconds, 15 seconds, 20 seconds, 30 seconds, 1 minute, 2 minutes, 5 minutes, 10 minutes, and 15 minutes.
|
||||
|
||||
The quotes are kept in are kept in a file in the Twilight directory called "QuotesFile", as is the resource which tracks how many quotes are available. The delay setting is kept in Twilight.Setup. This has changed since Quotes v1.0, which kept all these resources in Quotes' own resource fork. Actually, the file must have the same pathname as Quotes, but with ÒFileÓ appended to the end of it. So if Quotes is located at Ò:Googolplex:Zippy:Dee:Doo:DahÓ, then QuotesFile must be named Ò:Googolplex:Zippy:Dee:Doo:DahFileÓ.
|
||||
|
||||
By the way, if you made lots of changes to the quotes back before QuotesFile, you can just rename your old copy of Quotes as QuotesFile, although youÕll be missing out on lots of new stuff. That should work with no problems. If you want, you can remove the data fork and the non-LETextBox2 resources (although you need to leave the quotecount resource).
|
||||
|
||||
The horizontal scroll bar at the bottom of the window is used to select which quote you wish to view and/or modify. The number to the right of that is the quote number you are viewing. The most visible control is the large, black, TextEdit box. This is where the quote text is displayed. This scroll bar will be changed into a series of easy-to-use icons in the next version of Quotes; I've begun the coding, but have had no end of trouble actually getting it to work, so IÕll deal with it for another version. If youÕve set your WaitUntil delay to be smaller than normal, youÕll find that the scroll bar is terribly difficult to maneuver (part of the reason I want to replace it). Also, if you try to scroll without saving a changed quote, an alert will ask if youÕd like to save it first.
|
||||
|
||||
Above this are three buttons: Add, Replace, and Delete. Clicking the Delete button will delete the currently displayed quote. Clicking the Replace button will save the current contents of the TextEdit box into the quote number displayed in the lower-right corner of the Setup window. Clicking the Add button will add a new quote, placing the contents of the TextEdit box into it. Note that clicking these buttons causes their respective actions to occur immediately, and that the Update button is only used for the Delay data field control and Disk events unblank checkbox.
|
||||
|
||||
All the standard TextEdit keys function normally; the most useful are:
|
||||
|
||||
Control-C Copy
|
||||
Control-V Paste
|
||||
Control-X Cut
|
||||
|
||||
There is a limit of 768 characters in the TextEdit box. This is done to avoid excessively large quotes which might be too long to read in the period of time they are displayed onscreen. However, for extremely long quotes, Quotes automatically adds three seconds to the time the text is displayed onscreen. If you really want to get around the 768 character limit, edit QuotesFile using Foundation. :) This value has been changed from 500 to 768 because some very cool quotes really need more space to be included (ignoring entirely the fact that very few people read fast enough to catch the entire message before a new one appearsÑ but thatÕs why the speed is configurable).
|
||||
|
||||
There are also a number of keyboard equivalents:
|
||||
|
||||
Apple-? Help (lists these keys)
|
||||
Apple-A Select all
|
||||
Apple-B Bold
|
||||
Apple-F Fix colors (sets current selection to white on black)
|
||||
Apple-I Italic
|
||||
Apple-L Underline (this works if you have ShastonUL.8 installed in your
|
||||
*:System:Fonts folder)
|
||||
Apple-O Outline
|
||||
Apple-S Shadow
|
||||
Apple-T Plain text
|
||||
|
||||
Fix Colors is provided so that if you paste text into the Quotes text box, you can correct the colors, which will usually be black on white instead of white on black.
|
||||
|
||||
Changes Intended to Go In Eventually
|
||||
1. I intend to remove that annoying scroll bar and replace it with a set of icons for moving through the quotes. By the way, if you've set your WaitUntil scaling fast, you'll have a tough time handling this scroll bar.
|
||||
2. I want to make the cursor change into an I-beam when it is over the TextEdit control, but IÕm generally too lazy to do it. This feature will be added if/when Jim adds a T2Idle message.
|
||||
3. IÕd like to add a ÒsearchÓ feature, where the user could enter text and scan all the quotes for any occurrances of that text.
|
||||
4. I plan to eventually add code so that if the first line of the quote begins with a certain character combination or string, the remainder of that line is interpreted as commands to Quotes, including a ÒwidthÓ parameter, which would allow odd-sized quotes to specify special widths so that they look better onscreen.
|
||||
|
||||
|
||||
Eventually IÕm going to write an application for merging quotes files together. IÕve decided Òto hell with my plan to add it right into the moduleÓ. What a pain in the neck thatÕd be. :)
|
||||
|
||||
|
||||
Version 1.1f6 a.k.a version 1.1
|
||||
I had a thought (donÕt be too surprised): some of the quotes contained in this default QuotesFile might not be appropriate for certain users (or perhaps might be offensive). Some kind of warning may be warranted. Opinions?
|
||||
|
||||
1. Corrected some glitches in the moduleFlags; I was using a number of archaic definitions left over from T2 v1.0 and 1.0.1.
|
||||
2. Fixed the Twilight II required version number from 1.0.1 to 1.1.
|
||||
3. Changed the maximum size of the text in the TextEdit control from 500 to 768 characters.
|
||||
4. Scanned all the quotes and did the best I could to make them look decent onscreen. Also added and removed a few more quotes.
|
||||
|
||||
|
||||
Version 1.1f5
|
||||
I donÕt know what came of this version. I sent out an f4 version, and the next time I remember examining the resource fork, it was set to f6, so I assume that I accidentally incremented the version twice. No big deal.
|
||||
|
||||
|
||||
Version 1.1f4
|
||||
My TransWarp GS completely died yesterday, leaving me running at 2.6 MHz. It would have to wait until my life savings/college education fund was down to $650. Damn!
|
||||
|
||||
0. This version of Quotes requires T2 version, er... 1.1f4? Is that the one? At any rate, it requires the version with T2ShareMemory implemented. :)
|
||||
1. When setup is open, any form of blanking will always display the quote that Setup is displaying first. This allows the user to look at each quote to verify that it looks acceptable at blank time. At the moment, this is being done by storing ÒTQÓ and the quote number at $00/0350, which isnÕt really proper behavior. If I donÕt find a more appropriate way to do this before release time, I may remove this feature.
|
||||
2. Corrected several system-killer bugs in the help feature. I had intentionally been allowing the user to manipulate desk accessories while help was open, but this did not work well since closing Quotes with the help window open would orphan the help window. I fixed this so that closing Quotes would also close the help window, but that left the DoModalWindow loop for the help feature orphaned and still running with no windows onscreen after closing Quotes with Help open! So now I just donÕt allow DA actions while viewing Help, which is a damned shame. However, there is still code in place to close the Help window when Quote setup closes, just in case. Eventually, when I lose my current touch of laziness, IÕll rig this up to work.
|
||||
5. Now uses T2ShareMemory to save the quote number to display [see (1)], so Quotes no longer does anything illegal.
|
||||
6. Cleaned up more quotes. By the time Twilight II 1.1 is finished, I intend to have gone through every quote one by one, doing the best I can to make them look acceptable at blank time.
|
||||
|
||||
Version 1.1f3
|
||||
1. Added the best of the remaining quotes sent to me by Marc Wolfgram and Jim. If you have any youÕd like to see added, send Ôem!
|
||||
2. The ÒFix ColorsÓ option (Apple-F) now also sets the font to Shaston and the size to 8. This makes it even easier to cut-and-paste text from other files.
|
||||
3. Adjusted the help text somewhat.
|
||||
4. Now uses the new $D001 resource type for the rT2ModuleFlags resource, which makes this version compatible with/require version 1.0.1f2 of Twilight II.
|
||||
5. Added more quotes out of a book of mine, as well as some others. There are now over 630 quotes. If you see typos, quotes that look funny onscreen, or any quotes that you think should be removed, let me know!
|
||||
6. Clicking the message that says ÒPress Apple-? for helpÓ will pop up the help window.
|
||||
7. Error messages are now accompanied by the error code which generated the error (in all cases where possible).
|
||||
|
||||
|
||||
Version 1.1f2
|
||||
1. Replaced the old help alert with a modal window containing two controls: a scrollable TextEdit box and the OK button.
|
||||
2. Removed some dead code and resources.
|
||||
3. Eventually IÕll stick in some code so that the error messages are accompanied by the error codes. Probably in f3, since IÕm too busy to do it at the moment. :)
|
||||
4. Hmmm... I donÕt know why it didnÕt work last time I did it, but the Apple-? and Apple-/ keys are now both accepted for the Help function. I know I had that coded just like this when Jim first told me it wasnÕt working. Sigh. Cosmic rays. :)
|
||||
5. Revised a number of the quotes to look better, and corrected some grammar. Added and removed a few quotes, as well.
|
||||
6. The Delete button no longer asks you if you want to save the current quote if youÕve changed it. This was extra-bad because it asked you after it had already deleted the quote!
|
||||
|
||||
Version 1.1f1
|
||||
1. Okay, so it wasnÕt fixed in d3. But it wasnÕt entirely my fault. T2 wasnÕt always setting the resource app correctly before calling the modules, which is fixed in T2 v1.0.1f1.
|
||||
2. There were still some bugs in my code, though. I no longer preserve the resource app, since T2 does it. Also, the routine that closes the resource fork was being called twice each time unblanking occurred. The first time it would close QuotesFile. The second time, it would close the current applicationÕs resource file! Ouch! Fixed.
|
||||
3. Added code to handle more errors. The only major error that I know IÕm not checking yet (no flames, ItÕll be done before I send this version off) is the case when the QuotesFile canÕt be opened.
|
||||
4. The pathname for QuotesFile is now built on the fly. I obtain QuotesÕ pathname, copy it into a new buffer, and append ÒFileÓ to the end of it. So if QuotesÕ path is Ò:Hard.Disk:SlickWillie:AlBore:CoolModuleÓ, QuotesFile would be read from Ò:Hard.Disk:SlickWillie:AlBore:CoolModuleFileÓ. If the pathname comes out too long, then the user canÕt possibly have placed the file in the right place anyway, so it gets handled like a ÒQuotesFile not foundÓ error (which isnÕt handled yet). It will be handled at blanktime as if the QuotesFile were empty. At setup time, it will be handled by placing a static text control in the Setup window which reads something like ÒThe Quotes Module requires that a Quotes data file called ÒxxxÓ be located in the same directory as QuotesÓ.
|
||||
5. The error managing routine has been fixed to work correctly.
|
||||
6. If the QuotesFile isnÕt found at Setup time, the Setup window contains a large text box explaining the problem.
|
||||
7. Fixed a number of bugs involving userIDs and closing the wrong resource file.
|
||||
8. Now uses the way-cool data field control to select the delay for quotes! Very nice, although it was a bear to implement...
|
||||
9. To do (8), I had to slightly move a few of the controls.
|
||||
10. I hopefully will remember to slip in the new icon before sending it off. Whoever created it: do you have a way to convert it to Rez source?
|
||||
|
||||
Version 1.1d3
|
||||
1. Hallelujah! The old "blanking-at-setup" bug has, as far as my testing shows, been crushed at last! And there was much rejoicing!
|
||||
|
||||
Version 1.1d2
|
||||
1. Changed the way updating of the contents of the TextEdit control is handled. It used to be handled at HitT2 time; it is now done during the scroll bar's control handling code, which saves code elsewhere.
|
||||
2. If you've edited the contents of the TextEdit control and try to manipulate the scroll bar without using Replace or Add first, you are told that you haven't saved the current record and are asked if you'd like to do so. Note that this does just Replace right now. If you think it's necessary, I'll make it so you can choose between "Add", "Replace", and "Don't Save".
|
||||
3. Removed badly written (and, to top it off, dead) code from the HitT2 code. This code used to recognize that the scroll bar was hit, update the current quote number indicator, load the text, and update the TE record. However, after adding the verification in (2), I found that I was being asked for permission to save twice, once by the scroll routine, and once by HitT2. So I was able to pull dead code. Coolness. :)
|
||||
4. Added a new rAlertString(2) to the resource fork. It contains the "permission to save" alert.
|
||||
|
||||
|
||||
Version 1.1d1
|
||||
1. Quotes are now stored in a file called QuotesFile in the Twilight folder on the boot volume. The next version of Quotes will be intelligent enough to build the pathname based on the path in which Quotes itself is loaded (in other words, Quotes' pathname minus the last part, which is the name of Quotes itself, plus "QuotesFile").
|
||||
2. Quotes finally correctly manipulates resource file switching. I don't know why I had so much trouble getting it to work, but I sat down with it today and it worked the first time! Sigh. :)
|
||||
3. Fixed a bug which caused QuotesFile to be closed after the Setup window was brought up. This meant that you couldn't actually edit any quotes! Ack! Now the resource file isn't closed until KillT2 time.
|
||||
4. Again began scanning quotes for errors. Thanks to JP1 for sending me a list of errors.
|
||||
5. Oh, yes! Of course, I changed the version number to 1.1. :)
|
||||
6. Found a nasty bug which has always been in there but just happened to work because the quotes were being stored in the same resource file as Quotes itself. What was happening was this: I was switching in the resource file for the quotes, copying the text from the TextEdit control into its resource, switching out the resource file for the quotes, and then marking the resource as changed. Of course, now that the resource file actually changes in this case, this no longer works, since the wrong file's resources get changed! Oops! Now the MarkResourceChange call is done before switching out QuotesFile.
|
||||
7. The Update button is no longer enabled by using the TextEdit control since that control doesn't do anything with the TextEdit control.
|
||||
8. Fixed more bugs in the code for updating controls. Man, was that dealt with poorly! I'm amazed it ever worked! Whew; it seems okay now.
|
||||
9. Revised code so that it would actually know when to write to Twilight.Setup and when to write to QuotesFile.
|
||||
|
||||
Problems, Glitches, and Known Bugs
|
||||
None at this time.
|
||||
|
||||
If you find any bugs, or if you have questions or comments about Quotes, drop me email at uerics@mcl.mcl.ucsb.edu (or, if you must, AOL: Sheppy :).
|
||||
|
||||
- Eric S.
|
Loading…
x
Reference in New Issue
Block a user