Add files via upload

This commit is contained in:
Antoine Vignau 2020-06-08 22:49:33 +02:00 committed by GitHub
parent 12bfecb575
commit 78a69f1812
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
86 changed files with 17453 additions and 0 deletions

View File

@ -0,0 +1,120 @@
MACRO
&lab LongResult
&lab phd
phd
MEND
MACRO
&lab _DisposeAll
&lab ldx #$1102
jsl $E10000
MEND
MACRO
&lab _GetAddress
&lab ldx #$0904
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 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 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,18 @@
echo asml Earth2.asm keep=Earth2.d
asml Earth2.asm keep=Earth2.d
echo duplicate -d Earth2.d Earth2
duplicate -d Earth2.d Earth2
echo duplicate -r Earth2.r Earth2
duplicate -r Earth2.r Earth2
echo filetype Earth2 $BC
filetype Earth2 $BC
echo setfile Earth2 -at $4004
setfile Earth2 -at $4004
echo copy -c Earth2 /jim1/system/cdevs/Twilight/Large.Earth
copy -c Earth2 /jim1/system/cdevs/Twilight/Large.Earth

767
source/twilight/Earth/e1.15 Normal file
View File

@ -0,0 +1,767 @@
*-----------------------------------------------------------------------------*
earthDATA Data
earth1 ANOP
dc h'000000000000023332222300'
dc h'000000000000000000000033'
dc h'322332223332200000000000'
dc h'00000000333333f3fff33444'
dc h'222000000000000000233233'
dc h'44f35ddee555423220000000'
dc h'0000023332344534edddde44'
dc h'444433000000000022234435'
dc h'5542eedeeee4e44334500000'
dc h'000222244555553344e4eddd'
dc h'deeee4560000000332334555'
dc h'43434e44eedddddde4460000'
dc h'003323344455445534445ede'
dc h'eeddde555000002223444555'
dc h'4345454ee5dd5edddee55000'
dc h'0f223344444432344555e5ed'
dc h'ddddde5456000f2234543444'
dc h'42334555555edddd55544600'
dc h'0f243455334443334555544d'
dc h'dddde5544500ff2455543344'
dc h'44445555554eddddde544cc0'
dc h'f3345554334444555555544e'
dc h'dddde5eddcc0234455544344'
dc h'55555555433eddddd5edd6c0'
dc h'22354454334555555554333e'
dc h'ddeddddcd6c0223444554344'
dc h'55555554434ee55eeded6660'
dc h'222445543344555543444433'
dc h'ee55e3356660033455554345'
dc h'544443444533ee5544366600'
dc h'034545543445554433444544'
dc h'4e5544566600033544454445'
dc h'55543444454eedee55466600'
dc h'00344355554455434444444e'
dc h'dddded566000003453445444'
dc h'444444344444edddcd666000'
dc h'00034244444444444333444e'
dc h'dddccc660000000343344445'
dc h'445433344445eddd66660000'
dc h'0000e334444545553334444e'
dc h'd5666560000000000dd44455'
dc h'555544455554d66646000000'
dc h'000000ccd555544555466645'
dc h'c6664000000000000000ccc6'
dc h'd55666666665666000000000'
dc h'0000000000ccccc666666655'
dc h'600000000000000000000000'
dc h'0cccc6666600000000000000'
earth2 ANOP
dc h'0000000000000f2323222200'
dc h'0000000000000000000000ff'
dc h'222333222233200000000000'
dc h'000000003333332344323444'
dc h'222000000000000000233333'
dc h'444f4eee4455532220000000'
dc h'000002223334455e45ddee55'
dc h'543433000000000022234434'
dc h'55534edddde4444444500000'
dc h'00022223455455542eedeeee'
dc h'4e4433560000000322335555'
dc h'5553344e4eddddeeee460000'
dc h'003334344455543434e44eed'
dc h'ddddde456000002333444445'
dc h'5445534445edeeeddde66000'
dc h'0ff23344445554345454ee5d'
dc h'd5edddee65000ff224444444'
dc h'432344555e5edddddde55500'
dc h'0ff234454344442334555555'
dc h'edddd5555500fff354455334'
dc h'443334555544ddddde555550'
dc h'fff355554334444445555554'
dc h'eddddde555c0ff4455554334'
dc h'444555555544edddde5eccc0'
dc h'f24555554434455555555433'
dc h'eddddd5dcc60223454454334'
dc h'555555554333eddedddccc60'
dc h'223444455434455555554434'
dc h'ee55eeddc660023344554334'
dc h'4555543444433ee55e446600'
dc h'034445555434554444344453'
dc h'3ee554546600033554554344'
dc h'55544334445444e555566600'
dc h'003454445444555543444454'
dc h'eedee6656000003454355554'
dc h'455434444444edddcdc56000'
dc h'000355344544444444434444'
dc h'4edcccc60000000344244444'
dc h'444444333444edccccc60000'
dc h'000045334444544543334444'
dc h'6dccc660000000000d434444'
dc h'545553334455dc6666000000'
dc h'000000cc5545555554456666'
dc h'5c666000000000000000cc66'
dc h'6655666566655c6000000000'
dc h'0000000000cc6c6666666666'
dc h'500000000000000000000000'
dc h'0ccc66666600000000000000'
earth3 ANOP
dc h'0000000000000f2223232200'
dc h'0000000000000000000000ff'
dc h'f2ff23232222300000000000'
dc h'00000000322fff2334442233'
dc h'332000000000000000333333'
dc h'444444554345543220000000'
dc h'00000f23234445555e4eee44'
dc h'5554230000000000f2222345'
dc h'45555e45ddee555434500000'
dc h'0002222235554455534edddd'
dc h'e44444560000000322324455'
dc h'5455542eedeeee4e44350000'
dc h'002334344455555553344e4e'
dc h'ddddeeed6000002334554444'
dc h'55543434e44eeddddddd6000'
dc h'0ff234544444455445534445'
dc h'edeeedddc6000ffff4444444'
dc h'5554345454ee5dd5eddddc00'
dc h'0ffef334444444432344555e'
dc h'5eddddddd600fffed3444543'
dc h'44442334555555edddd56660'
dc h'fffee4544553344433345555'
dc h'44ddddde6660ffeee4555543'
dc h'34444445555554edddddd660'
dc h'ffee55555543344445555555'
dc h'44eddddd6cc03ff455555544'
dc h'34455555555433eddddc6cc0'
dc h'323444544543345555555543'
dc h'33eddedcccc0033444444554'
dc h'34455555554434ee55ddcc00'
dc h'024443445543344555543444'
dc h'433ee56c5500023554455554'
dc h'345544443444533ee6666400'
dc h'003455545543445554433444'
dc h'5444e6666000003455544454'
dc h'44555543444454eecdc66000'
dc h'000255543555544554344444'
dc h'44eccccc0000000245553445'
dc h'444444444344445dcccc0000'
dc h'000035542444444444443334'
dc h'55dcccc0000000000d653344'
dc h'445445433355566ccc000000'
dc h'000000cc4444445455544456'
dc h'66cc6000000000000000cc65'
dc h'566666656666665000000000'
dc h'0000000000cc666666666666'
dc h'600000000000000000000000'
dc h'0c6c66666600000000000000'
earth4 ANOP
dc h'0000000000000f2233223300'
dc h'0000000000000000000000ff'
dc h'ffff22232322200000000000'
dc h'00000000ff3ffff3ff343432'
dc h'22300000000000000023ff32'
dc h'3fff44455533434320000000'
dc h'000002223344455555445543'
dc h'4555330000000000222f3435'
dc h'5555555e4eee445554400000'
dc h'00022ff323245545555e45dd'
dc h'ee5554460000000222333345'
dc h'554455534edddde444460000'
dc h'002224344344555455542eed'
dc h'eeee4e455000002224554444'
dc h'55555553344e4eddddedc000'
dc h'02f2345555444455543434e4'
dc h'4eedddddcc000ffff4455444'
dc h'44455445534445edeeedcc00'
dc h'0ffefee44444445554345454'
dc h'ee5dd5edcc00fffedde33444'
dc h'4444432344555e5eddddccc0'
dc h'fffeddd34445434444233455'
dc h'5555edddc6603feedde45445'
dc h'5334443334555544ddddcc60'
dc h'22eddde45555433444444555'
dc h'5554eddcccc022fede555555'
dc h'4334444555555544eddccc60'
dc h'224ee4555555443445555555'
dc h'5433eddccc60034444445445'
dc h'4334555555554333edcdcc00'
dc h'034544444445543445555555'
dc h'4434ee66cc00032454434455'
dc h'43344555543444433dd66c00'
dc h'002355544555543455444434'
dc h'44533dc66000003455555455'
dc h'434455544334445455c66000'
dc h'000355555444544455554344'
dc h'4455dccc0000000344555435'
dc h'5554455434444455cccc0000'
dc h'000034555534454444444443'
dc h'55566cc0000000000d555424'
dc h'4444444444444666cc000000'
dc h'000000cc6633444454465445'
dc h'66666000000000000000cc54'
dc h'555565666555666000000000'
dc h'0000000000cc666666666666'
dc h'600000000000000000000000'
dc h'0c6666666600000000000000'
earth5 ANOP
dc h'000000000000022333333300'
dc h'0000000000000000000000ff'
dc h'ffff22332233200000000000'
dc h'00000000fffffffeff333434'
dc h'222000000000000000222fff'
dc h'4fffe4ee4545422230000000'
dc h'00000f2223ff444eee444555'
dc h'33444400000000002f223345'
dc h'555555554455434555500000'
dc h'000222233e45455555555e4e'
dc h'ee44556600000002223fe433'
dc h'245545555e45ddee55560000'
dc h'00222234443345554455534e'
dc h'dddde4456000002223454443'
dc h'44555455542eedeeee4d6000'
dc h'023233455544445555555334'
dc h'4e4eddddcc0002f2f4455555'
dc h'444455543434e44eedddcc00'
dc h'0fffeee44554444445544553'
dc h'4445edeedc00fffeddeee444'
dc h'44445554345454ee5dd5dcc0'
dc h'fffedddde334444444432344'
dc h'555e5eddccc0fffeddddd344'
dc h'454344442334555555edccc0'
dc h'234edddde454455334443334'
dc h'555544dcccc03334dddde455'
dc h'554334444445555554ecccc0'
dc h'3234eede5555554334444555'
dc h'555544ecccc002345ee45555'
dc h'554434455555555433dccc00'
dc h'033554444454454334555555'
dc h'554333dccc00033555444444'
dc h'455434455555554435dc6600'
dc h'003444544344554334455554'
dc h'3444445cc000003444555445'
dc h'5554345544443444645cc000'
dc h'000255555554554344555443'
dc h'344566660000000245555554'
dc h'445444555543445566cc0000'
dc h'000045545554355554455434'
dc h'555666c0000000000d545555'
dc h'344544444455556666000000'
dc h'000000cc5654244444455556'
dc h'55566000000000000000cc66'
dc h'445555656665556000000000'
dc h'0000000000cc556666666665'
dc h'500000000000000000000000'
dc h'0c6666666600000000000000'
earth6 ANOP
dc h'000000000000022233323300'
dc h'0000000000000000000000ff'
dc h'ff2223333333300000000000'
dc h'00000000fffffffeff334433'
dc h'332000000000000000ff2fff'
dc h'eeefddee4445443220000000'
dc h'00000f2f223fee5eeee4ee45'
dc h'4543230000000000f3ff3335'
dc h'ee544eee4445553344500000'
dc h'0002f32f3444555555555544'
dc h'55434566000000022222444e'
dc h'45455555555e4eee44560000'
dc h'003223234ee433245545555e'
dc h'45ddee566000003323334444'
dc h'3345554455534edddde56000'
dc h'0ff333444544434455545554'
dc h'2eedeeee6c000f2244444555'
dc h'444455555553344e4eddcc00'
dc h'0223f4e44555554444555434'
dc h'34e44eedcc002ffededee445'
dc h'544444455445534445eddcc0'
dc h'3ffeddddeee4444444555434'
dc h'5454ee5dc6c03feedddddde3'
dc h'34444444432344555e5eccc0'
dc h'33feedddddd3444543444423'
dc h'34555556dcc032355edddde4'
dc h'54455334443334555545ccc0'
dc h'234544dddde4555543344444'
dc h'45555555ccc0034444eede55'
dc h'55554334444555555555cc00'
dc h'0344445ee455555544344555'
dc h'55555445cc00033545544444'
dc h'54454334555555554445cc00'
dc h'003455554444444554344555'
dc h'55554556c000003455445443'
dc h'445543344555543455655000'
dc h'000355445554455554345544'
dc h'443556650000000f44555555'
dc h'545543445554434566660000'
dc h'0000e4555555544454445555'
dc h'54566660000000000d655455'
dc h'543555544565466666000000'
dc h'000000cc5555553445455556'
dc h'66656000000000000000cc66'
dc h'653555556666665000000000'
dc h'0000000000cc665566666666'
dc h'600000000000000000000000'
dc h'0c5566666600000000000000'
earth7 ANOP
dc h'000000000000032f33322200'
dc h'0000000000000000000000ff'
dc h'ff2222333233300000000000'
dc h'00000000ffffffff33344444'
dc h'333000000000000000ffffff'
dc h'efeeedee4455434320000000'
dc h'00000ff3ff3ffedddeddee44'
dc h'4545320000000000ffff3f33'
dc h'4ede5eeee4ee454543400000'
dc h'000f2ff4fe4445ee544eee44'
dc h'455533560000000222f44e44'
dc h'445555555555445543460000'
dc h'0022233433444e4545555555'
dc h'5e4eee45600000223344334e'
dc h'e433245545555e45dded6000'
dc h'02ff44443344443345554455'
dc h'534eddddc60003fff5444445'
dc h'444344555455542eedeedc00'
dc h'032f34544445554444555555'
dc h'53344e4ecc00222344e4e445'
dc h'5555444455543434e44edcc0'
dc h'232feddedee4455444444554'
dc h'45534445dcc0234fddddddee'
dc h'e44444445554345454ee6cc0'
dc h'224edddddddde33444444443'
dc h'2344555d6cc02245eeeddddd'
dc h'd344454344442334555666c0'
dc h'2244455edddde45445533444'
dc h'3334555666c002355544dddd'
dc h'e45555433444444555666600'
dc h'02355444eede555555433444'
dc h'455555666600022554445ee4'
dc h'555555443445555556665500'
dc h'002455455444445445433455'
dc h'555556655000002355555544'
dc h'444445543445555566665000'
dc h'000f55554454434455433445'
dc h'555546660000000f45554455'
dc h'544555543455445556660000'
dc h'0000ee545555555455434455'
dc h'65555660000000000cd45555'
dc h'555444544466666566000000'
dc h'000000cc6654555435566556'
dc h'66566000000000000000cc65'
dc h'666645566666666000000000'
dc h'0000000000cc666646666666'
dc h'600000000000000000000000'
dc h'0c6655666600000000000000'
earth8 ANOP
dc h'0000000000000f322f322200'
dc h'0000000000000000000000ff'
dc h'ff332f333222200000000000'
dc h'00000000ffffffff33334443'
dc h'333000000000000000ffffff'
dc h'eeeeee444555544330000000'
dc h'00000ffffffeeddeddedee44'
dc h'5544440000000000ffffe4fe'
dc h'4eeedddeddee444545500000'
dc h'000ffffefe4e434ede5eeee4'
dc h'ee4545550000000fff3fe5ee'
dc h'4445ee544eee444555350000'
dc h'00fff234e54e444455555555'
dc h'55445544600000ff22444433'
dc h'444e45455555555e4eed6000'
dc h'0222335444334ee433245545'
dc h'555e45ddcc000222fe554433'
dc h'44443345554455534eddcc00'
dc h'0f24fee54444454443445554'
dc h'55542eeddc0022244e445444'
dc h'4555444455555553344e5cc0'
dc h'32234444e4e4455555444455'
dc h'543434e45cc022344eeddede'
dc h'e445544444455445534456c0'
dc h'22355eddddddeee444444455'
dc h'54345455dc6022345edddddd'
dc h'dde334444444432344566c60'
dc h'223455eeedddddd344454344'
dc h'442334566660022454455edd'
dc h'dde454455334443334666600'
dc h'0223455544dddde455554334'
dc h'4444456666000224455444ee'
dc h'de5555554334444556666600'
dc h'00333554445ee45555554434'
dc h'455556666000002335554554'
dc h'444454454334555566666000'
dc h'000f34555555444444455434'
dc h'455666660000000ffe555544'
dc h'544344554334456666560000'
dc h'0000ed555544555445555434'
dc h'66566650000000000cde5455'
dc h'555554554355666665000000'
dc h'000000ccd555555554456556'
dc h'66666000000000000000cc66'
dc h'656665466666666000000000'
dc h'0000000000cc666666566666'
dc h'600000000000000000000000'
dc h'0c6666466600000000000000'
earth9 ANOP
dc h'0000000000000f2322233200'
dc h'0000000000000000000000ff'
dc h'ffff322f3222200000000000'
dc h'00000000fffffffe443f4443'
dc h'222000000000000000ffffff'
dc h'eeeeee444455534330000000'
dc h'00000fffffeeedddddee4445'
dc h'5555440000000000ffffeefe'
dc h'eddddeddedee445544500000'
dc h'000ffffeedd5ee4eeedddedd'
dc h'ee44455600000002ffefedee'
dc h'4e434ede5eeee4ee45460000'
dc h'00fffeee4ee5ee4445ee544e'
dc h'ee444556500000ffffe344e5'
dc h'4e4444555555555544566000'
dc h'0fffff33444433444e454555'
dc h'55555e4ecc0003f234445444'
dc h'334ee433245545555e45cc00'
dc h'02f334ee5544334444334555'
dc h'4455534ecc0033ff45eee544'
dc h'4445444344555455542edcc0'
dc h'3323454e4454444555444455'
dc h'555553345c603343444444e4'
dc h'e4455555444455543434d660'
dc h'2233454eeddedee445544444'
dc h'4554455456602224455edddd'
dc h'ddeee44444445554345566c0'
dc h'2234445edddddddde3344444'
dc h'44432345666002334455eeed'
dc h'ddddd3444543444423456600'
dc h'02342454455edddde4544553'
dc h'344433466600023333455544'
dc h'dddde4555543344445566600'
dc h'003344455444eede55555543'
dc h'344446666000003454355444'
dc h'5ee455555544344566666000'
dc h'000f44355545544444544543'
dc h'345666660000000ffe345555'
dc h'554444444554345666660000'
dc h'0000edee5555445443445543'
dc h'45566660000000000dcd5555'
dc h'445554455565466666000000'
dc h'000000ccdd54555555556655'
dc h'66666000000000000000ccc5'
dc h'666666656666666000000000'
dc h'0000000000cc666666665666'
dc h'600000000000000000000000'
dc h'0c6666665600000000000000'
earth10 ANOP
dc h'0000000000000ff233322300'
dc h'0000000000000000000000ff'
dc h'ffff23222332200000000000'
dc h'00000000fffffffeff433f43'
dc h'222000000000000000ffffff'
dc h'eeeedd554e55533220000000'
dc h'00000fffffeeedddddee4444'
dc h'5554440000000000ffffeeed'
dc h'ddddddddee44455555500000'
dc h'000ffffeedddeeeddddedded'
dc h'ee44555600000002ffeedddd'
dc h'd5ee4eeedddeddee44460000'
dc h'0022f3eddeedee4e434ede5e'
dc h'eee4ee4660000022ffddde4e'
dc h'e5ee4445ee544eee44466000'
dc h'0332ffdee344e54e44445555'
dc h'555555446600033ffeee3344'
dc h'4433444e45455555555e5c00'
dc h'0334f444445444334ee43324'
dc h'5545555e56003233e444ee55'
dc h'443344443345554455535cc0'
dc h'2334ee45eee5444445444344'
dc h'555455543cc0324444454e44'
dc h'544445554444555555534660'
dc h'234554444444e4e445555544'
dc h'4455543546c0223443454eed'
dc h'dedee4455444444554466560'
dc h'223434455eddddddeee44444'
dc h'445554356660023444445edd'
dc h'dddddde33444444443346600'
dc h'0234434455eeedddddd34445'
dc h'434444355600022444245445'
dc h'5edddde45445533445455600'
dc h'00235333455544dddde45555'
dc h'433445666000002354444554'
dc h'44eede555555433455666000'
dc h'000f55543554445ee4555555'
dc h'443556660000000ffe443555'
dc h'455444445445434566660000'
dc h'0000edee3455555544444445'
dc h'65466660000000000dcdee55'
dc h'554454434466555666000000'
dc h'000000cccc55554455555666'
dc h'66566000000000000000cccd'
dc h'656666666666656000000000'
dc h'0000000000ccc66666666666'
dc h'600000000000000000000000'
dc h'0c6666666600000000000000'
earth11 ANOP
dc h'0000000000000fff22233200'
dc h'0000000000000000000000ff'
dc h'fffff2333223200000000000'
dc h'00000000fffffffeef343334'
dc h'322000000000000000ffffff'
dc h'eeeeddee544e533220000000'
dc h'00000fffffeeeddddddd554e'
dc h'5554330000000000ffffeeed'
dc h'ddddddddee44445554500000'
dc h'000ffffeedddddddddddddee'
dc h'444555660000000fffeedddd'
dc h'ddeeeddddeddedee44560000'
dc h'00f2f3eeddddddd5ee4eeedd'
dc h'deddee456000002223e4ddde'
dc h'edee4e434ede5eeee4ed6000'
dc h'022232eeddde4ee5ee4445ee'
dc h'544eee446600033344eedee3'
dc h'44e54e444455555555555600'
dc h'03344eeeee33444433444e45'
dc h'455555556c00333455e44444'
dc h'5444334ee433245545556c60'
dc h'333354e444ee554433444433'
dc h'455544556560223455ee45ee'
dc h'e54444454443445554556640'
dc h'23445544454e445444455544'
dc h'445555566550233555544444'
dc h'44e4e4455555444455555650'
dc h'23244443454eeddedee44554'
dc h'44444555666002344434455e'
dc h'ddddddeee444444455655600'
dc h'02344444445edddddddde334'
dc h'444444554500033444434455'
dc h'eeedddddd344454345564500'
dc h'002344442454455edddde454'
dc h'455335665000002344533345'
dc h'5544dddde455554345666000'
dc h'0003445444455444eede5555'
dc h'554446660000000ffe555435'
dc h'54445ee45555555556660000'
dc h'0000edee4435554554444454'
dc h'56555660000000000dcdee34'
dc h'555555444455566656000000'
dc h'000000ccccee555544555456'
dc h'66655000000000000000cccc'
dc h'666655666666666000000000'
dc h'0000000000cccc6666666666'
dc h'600000000000000000000000'
dc h'0cc666666600000000000000'
earth12 ANOP
dc h'0000000000000ffff2223200'
dc h'0000000000000000000000ff'
dc h'ffffff222332300000000000'
dc h'00000000fffffffeeef34443'
dc h'232000000000000000ffffff'
dc h'eeeeddde4544444220000000'
dc h'00000fffffeeedddddddee54'
dc h'4e54330000000000ffffeeed'
dc h'dddddddddd554e5554500000'
dc h'000ffffeedddddddddddddee'
dc h'444455660000000fffeedddd'
dc h'ddddddddddddee4445560000'
dc h'00ffffeeddddddddeeedddde'
dc h'ddedee45600000fff3e4dedd'
dc h'ddddd5ee4eeedddedded6000'
dc h'0f223344e4dddeedee4e434e'
dc h'de5eeee4cc0003323443eedd'
dc h'de4ee5ee4445ee544eee5600'
dc h'03344554eedee344e54e4444'
dc h'5555555566003334555eeeee'
dc h'33444433444e454555556660'
dc h'33345555e444445444334ee4'
dc h'33245545666033445454e444'
dc h'ee5544334444334555446660'
dc h'33344555ee45eee544444544'
dc h'434455556660333554554445'
dc h'4e4454444555444455566660'
dc h'2235455554444444e4e44555'
dc h'554444566650023534444345'
dc h'4eeddedee445544444566600'
dc h'0223444434455eddddddeee4'
dc h'444444666600022444444444'
dc h'5edddddddde3344445566500'
dc h'00245444434455eeedddddd3'
dc h'444544666000003444444424'
dc h'54455edddde4544564566000'
dc h'000244445333455544dddde4'
dc h'555655560000000f45445444'
dc h'455444eede55556665560000'
dc h'0000feee55543554445ee455'
dc h'66666650000000000dcdee44'
dc h'355545544455666665000000'
dc h'000000ccccee345555565556'
dc h'66666000000000000000cccc'
dc h'dd6666556665666000000000'
dc h'0000000000cccc6666666666'
dc h'600000000000000000000000'
dc h'0ccc66666600000000000000'
earth13 ANOP
dc h'0000000000000ffffff22300'
dc h'0000000000000000000000ff'
dc h'fffffff22232200000000000'
dc h'00000000fffffffeeeef2334'
dc h'323000000000000000ffffff'
dc h'eeeedddde455533320000000'
dc h'00000fffffeeedddddddde45'
dc h'4445430000000000ffffeeed'
dc h'ddddddddddee544e54500000'
dc h'000ffffeeddddddddddddddd'
dc h'554e556600000002ffeedddd'
dc h'ddddddddddddee4444560000'
dc h'0022feeddddddddddddddddd'
dc h'ddee444660000022fedededd'
dc h'ddddddeeeddddeddeded6000'
dc h'023ffee4e4deddddddd5ee4e'
dc h'eedddeddcc00033f344444e4'
dc h'dddeedee4e434ede5eeed600'
dc h'0234444443eeddde4ee5ee44'
dc h'45ee544edc003334555554ee'
dc h'dee344e54e44445555556660'
dc h'323455555eeeee3344443344'
dc h'4e45455566603344555555e4'
dc h'44445444334ee43324555660'
dc h'2345555454e444ee55443344'
dc h'4433455656602345444555ee'
dc h'45eee5444445444344566660'
dc h'224545545544454e44544445'
dc h'554444566660023445455554'
dc h'444444e4e445555544556600'
dc h'023445344443454eeddedee4'
dc h'455444566600022223444434'
dc h'455eddddddeee44445566600'
dc h'002244444444445edddddddd'
dc h'e33445666000002245544443'
dc h'4455eeedddddd34456656000'
dc h'0002554444442454455edddd'
dc h'e45556650000000f44444453'
dc h'33455544dddde46666650000'
dc h'0000fe55445444455444eede'
dc h'66666660000000000ddeee55'
dc h'543554445ed5666666000000'
dc h'000000ccccee443555466556'
dc h'66666000000000000000cccc'
dc h'dd4566666666666000000000'
dc h'0000000000cccccc66666666'
dc h'600000000000000000000000'
dc h'0ccc66666600000000000000'
earth14 ANOP
dc h'0000000000000ffffff32200'
dc h'0000000000000000000000ff'
dc h'fffffffff223200000000000'
dc h'00000000fffffffeeeeef223'
dc h'322000000000000000ffffff'
dc h'eeeeddddde34444230000000'
dc h'00000fffffeeeddddddddde4'
dc h'5554340000000000ffffeeed'
dc h'ddddddddddde454445500000'
dc h'000ffffeeddddddddddddddd'
dc h'ee544e6600000002ffeedddd'
dc h'dddddddddddddd554e560000'
dc h'002223eddddddddddddddddd'
dc h'ddee44456000002223dddddd'
dc h'ddddddddddddddddee456000'
dc h'022233eddededdddddddeeed'
dc h'dddeddedcc0002224eede4e4'
dc h'deddddddd5ee4eeedddecc00'
dc h'02244e444444e4dddeedee4e'
dc h'434ede5edc00223355544443'
dc h'eeddde4ee5ee4445ee545cc0'
dc h'223455555554eedee344e54e'
dc h'44445555666022435555555e'
dc h'eeee33444433444e45456660'
dc h'224555555555e44444544433'
dc h'4ee433256660223555555454'
dc h'e444ee554433444433466660'
dc h'223555444555ee45eee54444'
dc h'454443456660022455455455'
dc h'44454e445444455544556600'
dc h'02244445455554444444e4e4'
dc h'455555566600022444453444'
dc h'43454eeddedee44555566600'
dc h'00232223444434455edddddd'
dc h'eee445666000002233444444'
dc h'44445edddddddde345666000'
dc h'000233455444434455eeeddd'
dc h'ddd456660000000f24554444'
dc h'442454455eddddd566660000'
dc h'0000fe5444445333455544dd'
dc h'ccd66660000000000dde5544'
dc h'5444455444ddcc6666000000'
dc h'000000ccddee55543555556c'
dc h'c6666000000000000000cccc'
dc h'dd5546666666666000000000'
dc h'0000000000cccccc56666666'
dc h'600000000000000000000000'
dc h'0ccccc666600000000000000'
earth15 ANOP
dc h'0000000000000ffff2f33200'
dc h'0000000000000000000000ff'
dc h'fffffffff322200000000000'
dc h'00000000fffffffeeeeefff3'
dc h'232000000000000000ffffff'
dc h'eeeedddddde3334220000000'
dc h'00000fffffeeedddddddddde'
dc h'3445430000000000ffffeeed'
dc h'dddddddddddde45554500000'
dc h'0003fffeeddddddddddddddd'
dc h'de45445600000002ffeedddd'
dc h'ddddddddddddddee544c0000'
dc h'00ff23fedddddddddddddddd'
dc h'dddd554d6000002f2344dddd'
dc h'ddddddddddddddddee456000'
dc h'02223344dddddddddddddddd'
dc h'ddddddee660002223344edde'
dc h'deddddddddeeeddddedddc00'
dc h'0222345eede4e4deddddddd5'
dc h'ee4eeeddcc002322355e4444'
dc h'44e4dddeedee4e434ede6cc0'
dc h'32235455544443eeddde4ee5'
dc h'ee4445ee6660223355555555'
dc h'54eedee344e54e4444556660'
dc h'2234545555555eeeee334444'
dc h'33444e465660223455555555'
dc h'55e444445444334ee4344660'
dc h'22234555555454e444ee5544'
dc h'334444346660022345554445'
dc h'55ee45eee544444544546600'
dc h'0223345545545544454e4454'
dc h'444555566600022334444545'
dc h'5554444444e4e44556666600'
dc h'0023444445344443454eedde'
dc h'dee446666000002344222344'
dc h'4434455eddddddeed5666000'
dc h'0002433344444444445edddd'
dc h'dddcd5560000000f34334554'
dc h'44434455eeedddccc5660000'
dc h'0000fe34554444442454455e'
dc h'ccccc660000000000dde5444'
dc h'445333455555ccccc6000000'
dc h'000000ccdd55445444466556'
dc h'cccc6000000000000000cccd'
dc h'dd66654666666cc000000000'
dc h'0000000000cccccc66566666'
dc h'600000000000000000000000'
dc h'0ccccc566600000000000000'
copy e16.30
copy e31.42
EarthTable anop
dc i'Earth1,Earth2,Earth3,Earth4,Earth5,Earth6,Earth7,Earth8'
dc i'Earth9,Earth10,Earth11,Earth12,Earth13,Earth14,Earth15'
dc i'Earth16,Earth17,Earth18,Earth19,Earth20,Earth21,Earth22'
dc i'Earth23,Earth24,Earth25,Earth26,Earth27,Earth28,Earth29'
dc i'Earth30,Earth31,Earth32,Earth33,Earth34,Earth35,Earth36'
dc i'Earth37,Earth38,Earth39,Earth40,Earth41,Earth42'
End
*-----------------------------------------------------------------------------*

View File

@ -0,0 +1,750 @@
earth16 ANOP
dc h'0000000000000f2ff3333300'
dc h'0000000000000000000000ff'
dc h'fffffff2f332300000000000'
dc h'00000000fffffffeeefefff4'
dc h'222000000000000000ffffff'
dc h'eeeeddddddeee33320000000'
dc h'00000f2fffeeeddddddddddd'
dc h'e334430000000000ff2feeed'
dc h'ddddddddddddde3445500000'
dc h'000ffffeeddddddddddddddd'
dc h'dde455660000000ff3fedddd'
dc h'ddddddddddddddde45460000'
dc h'00fff3fedddddddddddddddd'
dc h'ddddee55600000ffff44eedd'
dc h'dddddddddddddddddd566000'
dc h'0f2f3f4444dddddddddddddd'
dc h'ddddddee66000332344444dd'
dc h'dddddddddddddddddddddc00'
dc h'0333244344eddededddddddd'
dc h'eeeddddecc00ff3343445eed'
dc h'e4e4deddddddd5ee4eeeccc0'
dc h'f22443355e444444e4dddeed'
dc h'ee4e434ecc60224344545554'
dc h'4443eeddde4ee5ee4445dc60'
dc h'3234445555555554eedee344'
dc h'e54e44456660223444545555'
dc h'555eeeee33444433444d6660'
dc h'2223445555555555e4444454'
dc h'44334ee55540022333455555'
dc h'5454e444ee55443344555500'
dc h'0233334555444555ee45eee5'
dc h'444445566500022333345545'
dc h'545544454e44544446666600'
dc h'002233344445455554444444'
dc h'e4e446666000002244444445'
dc h'344443454eeddeded5666000'
dc h'000244442223444434455edd'
dc h'dddcdcc60000000f34433344'
dc h'444444445eddddccccc50000'
dc h'0000fe4433455444434455ee'
dc h'dcccccc0000000000dde3455'
dc h'4444442454566ccccc000000'
dc h'000000ccdd54444453345666'
dc h'66ccc000000000000000cccd'
dc h'66556555666666c000000000'
dc h'0000000000cccccc66665666'
dc h'600000000000000000000000'
dc h'0ccccc665600000000000000'
earth17 ANOP
dc h'0000000000000f2223333300'
dc h'0000000000000000000000ff'
dc h'ffff2ff33333300000000000'
dc h'00000000fffffffeeefff3f4'
dc h'323000000000000000ffffff'
dc h'eeeeddddedeee43220000000'
dc h'00000fffffeeeddddddddddd'
dc h'eee4340000000000ffff3eed'
dc h'dddddddddddddde334500000'
dc h'000ffffe3ddddddddddddddd'
dc h'ddde34560000000fffefdddd'
dc h'dddddddddddddddde4560000'
dc h'003ffef5eddddddddddddddd'
dc h'ddddde46600000fffee4eedd'
dc h'dddddddddddddddddded6000'
dc h'0ff3fede44eedddddddddddd'
dc h'dddddddd66000fff3e4e4444'
dc h'dddddddddddddddddddddc00'
dc h'0f3444444444dddddddddddd'
dc h'ddddddddcc00f23454344344'
dc h'eddededdddddddeeedddccc0'
dc h'2fff5443445eede4e4dedddd'
dc h'ddd5ee4edcc02ff34543355e'
dc h'444444e4dddeedee4e435cc0'
dc h'333454445455544443eeddde'
dc h'4ee5ee4556c0334444445555'
dc h'555554eedee344e54e456660'
dc h'33344444545555555eeeee33'
dc h'444433456c60023433445555'
dc h'555555e444445444335dc600'
dc h'022333334555555454e444ee'
dc h'554433566600022343334555'
dc h'444555ee45eee54445566600'
dc h'00224333345545545544454e'
dc h'445445666000002343333444'
dc h'45455554444444e4d5666000'
dc h'00034344444445344443454e'
dc h'edddccc60000000f34444422'
dc h'23444434455eddcccccc0000'
dc h'0000fe44433344444444445e'
dc h'ccccccc0000000000dde4433'
dc h'455444434466dccccc000000'
dc h'000000ccdd34554444453566'
dc h'666cc000000000000000cccd'
dc h'655555645566666000000000'
dc h'0000000000cccc6666666666'
dc h'600000000000000000000000'
dc h'0ccccc666600000000000000'
earth18 ANOP
dc h'000000000000022222222300'
dc h'0000000000000000000000ff'
dc h'ff2f22233333300000000000'
dc h'00000000fffffffeff3ff444'
dc h'333000000000000000ffffff'
dc h'eeeeddddeee4e44230000000'
dc h'00000fffffeeeddddddddded'
dc h'eee53300000000002fffeeed'
dc h'ddddddddddddddeee4500000'
dc h'000322feed4ddddddddddddd'
dc h'dddde3460000000fffeedd4d'
dc h'ddddddddddddddddde360000'
dc h'00ff3feddedddddddddddddd'
dc h'dddddde5600000ff3fdde5ed'
dc h'dddddddddddddddddddd6000'
dc h'0fffffede4eedddddddddddd'
dc h'ddddddddcc000fffe5edde44'
dc h'eeddddddddddddddddddcc00'
dc h'0ffefe4e4e4444dddddddddd'
dc h'ddddddddcc00ffff55544444'
dc h'44ddddddddddddddddddccc0'
dc h'fff35554344344eddededddd'
dc h'ddddeeedccc0f33fee544344'
dc h'5eede4e4deddddddd5ee5cc0'
dc h'233ee44543355e444444e4dd'
dc h'deedee4d5560224544544454'
dc h'55544443eeddde4ee5ed6660'
dc h'22455444445555555554eede'
dc h'e344e54d6660034544444454'
dc h'5555555eeeee334444446600'
dc h'02344433445555555555e444'
dc h'445444456c00022433333345'
dc h'55555454e444ee5545456600'
dc h'00223343334555444555ee45'
dc h'eee545666000002333433334'
dc h'5545545544454e4465666000'
dc h'000f34433334444545555444'
dc h'4445d6c60000000f35434444'
dc h'4445344443454edccccc0000'
dc h'0000fe444444222344443445'
dc h'6dccccc0000000000dde4443'
dc h'3344444444556ccccc000000'
dc h'000000ccdd44334554455456'
dc h'66ccc000000000000000cccd'
dc h'456655556646666000000000'
dc h'0000000000cccc6666666555'
dc h'600000000000000000000000'
dc h'0ccc66666600000000000000'
earth19 ANOP
dc h'0000000000000fffff322200'
dc h'0000000000000000000000f2'
dc h'fff322222222300000000000'
dc h'00000000fffffffff3f33344'
dc h'333000000000000000ffffff'
dc h'eeeedddee4ee544330000000'
dc h'00000fffffeeedddddddddde'
dc h'ee4e44000000000033f2eeed'
dc h'dddddddddddddedeee500000'
dc h'000ff333fddddddddddddddd'
dc h'dddddedc0000000fff423ddd'
dc h'd4dddddddddddddddddc0000'
dc h'00fffefeddddd4dddddddddd'
dc h'dddddddcc00000fffee5eddd'
dc h'eddddddddddddddddddcc000'
dc h'03ffeee5edde5edddddddddd'
dc h'ddddddddcc000fffeddeeede'
dc h'4eedddddddddddddddddcc00'
dc h'0ffeeddd5edde44eeddddddd'
dc h'ddddddddcc002ffedddee4e4'
dc h'e4444dddddddddddddddccc0'
dc h'3ffedde5554444444ddddddd'
dc h'ddddddddccc03ffede455543'
dc h'44344eddededdddddddedcc0'
dc h'322e54eee5443445eede4e4d'
dc h'eddddddc6cc0324454ee4454'
dc h'3355e444444e4dddeeddc6c0'
dc h'22444554454445455544443e'
dc h'eddde4ed6cc0023445554444'
dc h'45555555554eedee345d6600'
dc h'0234555444444545555555ee'
dc h'eee334566500022444444334'
dc h'45555555555e444446566500'
dc h'00344443333334555555454e'
dc h'444ee666600000f444333433'
dc h'34555444555ee45edd666000'
dc h'000fe4433433334554554554'
dc h'4455d6660000000feee34433'
dc h'3344445455554455666c0000'
dc h'0000edd45434444444534444'
dc h'4566ccc0000000000dcee444'
dc h'4442223444545666cc000000'
dc h'000000cccde4443334455556'
dc h'6666c000000000000000cccd'
dc h'd55445666666566000000000'
dc h'0000000000ccccc566666666'
dc h'600000000000000000000000'
dc h'0cccc6666600000000000000'
earth20 ANOP
dc h'0000000000000fffff223200'
dc h'000000000000000000000032'
dc h'3f2fffff3222200000000000'
dc h'000000002f2ff2fee4333333'
dc h'22300000000000000022ffff'
dc h'feeedee4e444544330000000'
dc h'00000fffffeeeddddddddee4'
dc h'ee554400000000003ffffeed'
dc h'dddddddddddddeee4e500000'
dc h'000fff34f4dddddddddddddd'
dc h'dddededc0000000fffe454ed'
dc h'dddddddddddddddddddc0000'
dc h'00fffeee533dddd4dddddddd'
dc h'dddddddcc00000fffeddeedd'
dc h'ddd4dddddddddddddddcc000'
dc h'0fffeedde5edddeddddddddd'
dc h'ddddddddcc0003ffeddde5ed'
dc h'de5eddddddddddddddddcc00'
dc h'0334fddddeeede4eeddddddd'
dc h'ddddddddcc00332fdddddd5e'
dc h'dde44eedddddddddddddccc0'
dc h'332fdddddee4e4e4444ddddd'
dc h'ddddddddccc0334fdddde555'
dc h'4444444dddddddddddddccc0'
dc h'434eedde45554344344edded'
dc h'eddddddcccc033443e54eee5'
dc h'443445eede4e4deddddccc60'
dc h'32435454ee44543355e44444'
dc h'4e4dddedccc0023454455445'
dc h'4445455544443eedddd5cc00'
dc h'023344455544444555555555'
dc h'4eedee466c00022344555444'
dc h'444545555555eeeee4466600'
dc h'002234444443344555555555'
dc h'5e444566600000f255444333'
dc h'3334555555454e445dc66000'
dc h'000fe5443334333455544455'
dc h'5ee56ccc0000000feee44334'
dc h'333345545545545566c60000'
dc h'0000eddee344333344445455'
dc h'66566660000000000dcdd454'
dc h'344444445355565666000000'
dc h'000000cccde4444442234556'
dc h'65666000000000000000cccd'
dc h'd55544456666666000000000'
dc h'0000000000ccccc665566666'
dc h'600000000000000000000000'
dc h'0cccc5666600000000000000'
earth21 ANOP
dc h'00000000000002f2ff222200'
dc h'0000000000000000000000ff'
dc h'3f2fffff2232200000000000'
dc h'0000000022ff323f3effff43'
dc h'22200000000000000032222f'
dc h'3ff2edd54444433230000000'
dc h'0000032f22fefdeddddee4e4'
dc h'4455440000000000233ffeed'
dc h'dddddddddddee4ee55500000'
dc h'0004333eeeeddddddddddddd'
dc h'dddeee5c0000000fffff55e4'
dc h'dddddddddddddddddedc0000'
dc h'003ffeedd554eddddddddddd'
dc h'dddddddcc00000fffeddde53'
dc h'3dddd4dddddddddddddcc000'
dc h'033feeddddeeddddd4dddddd'
dc h'ddddddddcc000333fedddde5'
dc h'edddedddddddddddddddcc00'
dc h'033445eddde5edde5edddddd'
dc h'ddddddddcc0033345eddddde'
dc h'eede4eedddddddddddddccc0'
dc h'33344edddddd5edde44eeddd'
dc h'ddddddddccc043444eddddde'
dc h'e4e4e4444dddddddddddccc0'
dc h'44455edddde5554444444ddd'
dc h'dddddddcccc033555eedde45'
dc h'554344344eddededdddcccc0'
dc h'3345543e54eee5443445eede'
dc h'4e4deddcccc00344535454ee'
dc h'44543355e444444e4dcccc00'
dc h'034444544554454445455544'
dc h'443eedccc600043443444555'
dc h'444445555555554eecdc5600'
dc h'003333445554444445455555'
dc h'55eeedc5500000f242344444'
dc h'433445555555555e55666000'
dc h'000fe3554443333334555555'
dc h'454d566c0000000feee54433'
dc h'343334555444556dc66c0000'
dc h'0000eddee443343333455455'
dc h'56666660000000000dcddee3'
dc h'443333444465666666000000'
dc h'000000ccccd4543444455565'
dc h'66665000000000000000cccd'
dc h'd55555534456666000000000'
dc h'0000000000ccccc666555666'
dc h'600000000000000000000000'
dc h'0cccc6655600000000000000'
earth22 ANOP
dc h'000000000000022222223200'
dc h'00000000000000000000002f'
dc h'ff32f2ff2222200000000000'
dc h'00000000222fff3f3fefff33'
dc h'322000000000000000332222'
dc h'ff435e4deeee533220000000'
dc h'0000022332223e4ee3edd544'
dc h'444433000000000032233f23'
dc h'edededdddee4e44455500000'
dc h'000333244eeddddddddddddd'
dc h'dee4ee660000000334445dde'
dc h'eddddddddddddddddeec0000'
dc h'00334ffeee55e4dddddddddd'
dc h'ddddddddc00000333fddddd5'
dc h'54eddddddddddddddddcc000'
dc h'0333feddddde533dddd4dddd'
dc h'ddddddddcc0003334edddddd'
dc h'eeddddd4ddddddddddddcc00'
dc h'033445eedddde5edddeddddd'
dc h'ddddddddcc0033345555eddd'
dc h'e5edde5eddddddddddddccc0'
dc h'2334555edddddeeede4eeddd'
dc h'ddddddddccc02244554edddd'
dc h'dd5edde44eedddddddddccc0'
dc h'2355554edddddee4e4e4444d'
dc h'dddddddcccc02356555edddd'
dc h'e5554444444ddddddddcccc0'
dc h'2345655eedde45554344344e'
dc h'ddededdcccc0044555543e54'
dc h'eee5443445eede4e4ddccc00'
dc h'045554535454ee44543355e4'
dc h'44444e5ccc00044554445445'
dc h'54454445455544443ddccc00'
dc h'004554434445554444455555'
dc h'55554dccc00000f454334455'
dc h'5444444545555555ddccc000'
dc h'000fe3423444444334455555'
dc h'55566c660000000feee35544'
dc h'43333334555555566c660000'
dc h'0000eddee544333433345554'
dc h'55666cc0000000000dcddee4'
dc h'433433334565666666000000'
dc h'000000ccccdee34433345556'
dc h'66666000000000000000cccc'
dc h'c56545556666656000000000'
dc h'0000000000ccccc666666444'
dc h'500000000000000000000000'
dc h'0cccc6665500000000000000'
earth23 ANOP
dc h'000000000000022222222200'
dc h'000000000000000000000022'
dc h'2ff222222232200000000000'
dc h'00000000f2222fff43f2ff33'
dc h'222000000000000000223322'
dc h'3fff5e4edeee434220000000'
dc h'00000322333324ee545e4dee'
dc h'ee5433000000000033323444'
dc h'334e4ee3edd5444444500000'
dc h'00032333354e33edededddde'
dc h'e4e44466000000022344455e'
dc h'eddddddddddddddee4ec0000'
dc h'00233446555ddeeddddddddd'
dc h'ddddddddc0000023346eeeee'
dc h'55e4dddddddddddddddcc000'
dc h'0223445eddddd554eddddddd'
dc h'ddddddddcc00023345eddddd'
dc h'de533dddd4ddddddddddcc00'
dc h'0334455eddddddeeddddd4dd'
dc h'ddddddddcc0023345555eedd'
dc h'dde5edddedddddddddddccc0'
dc h'2334555555eddde5edde5edd'
dc h'ddddddddccc0223455555edd'
dc h'dddeeede4eedddddddddccc0'
dc h'223455554edddddd5edde44e'
dc h'eddddddcccc0323565554edd'
dc h'dddee4e4e4444ddddddcccc0'
dc h'432566555edddde555444444'
dc h'4ddddddcccc0023555655eed'
dc h'de45554344344eddeddccc00'
dc h'02265555543e54eee5443445'
dc h'eede4e5ccc00023665545354'
dc h'54ee44543355e444455c6c00'
dc h'003565544454455445444545'
dc h'5544455cc00000f466544344'
dc h'4555444445555555666cc000'
dc h'000fe5543344555444444545'
dc h'555666cc0000000feee34234'
dc h'4444433445555566666c0000'
dc h'0000eddee355444333333455'
dc h'66666660000000000dcddee5'
dc h'443334333466666666000000'
dc h'000000ccccdee44334344456'
dc h'66666000000000000000cccc'
dc h'cdd455445566666000000000'
dc h'0000000000ccccc666566666'
dc h'600000000000000000000000'
dc h'0cccc6666600000000000000'
earth24 ANOP
dc h'000000000000022222222200'
dc h'000000000000000000000032'
dc h'222222222222300000000000'
dc h'00000000ff32222ff3333223'
dc h'32200000000000000033f2f2'
dc h'333ede54e3ee433220000000'
dc h'000003332244344eee5e4ede'
dc h'ee4443000000000023333345'
dc h'4434ee545e4deeee54500000'
dc h'00022334444554334e4ee3ed'
dc h'd54444560000000233345445'
dc h'4e33edededdddee4e4460000'
dc h'0022233555455eeddddddddd'
dc h'dddddee5c000002224555655'
dc h'5ddeeddddddddddddddcc000'
dc h'022234556eeeee55e4dddddd'
dc h'ddddddddcc00022235555edd'
dc h'ddd554edddddddddddddcc00'
dc h'02234555edddddde533dddd4'
dc h'ddddddddcc00222455555edd'
dc h'ddddeeddddd4ddddddddccc0'
dc h'4224555555eedddde5eddded'
dc h'ddddddddccc0322455555555'
dc h'eddde5edde5eddddddddccc0'
dc h'43244555555edddddeeede4e'
dc h'eddddddcccc033234455554e'
dc h'dddddd5edde44eeddddcccc0'
dc h'33444565554edddddee4e4e4'
dc h'444ddddcccc003553566555e'
dc h'dddde5554444444dddcccc00'
dc h'03444555655eedde45554344'
dc h'344edddccc00033436555554'
dc h'3e54eee5443445eedd5c6c00'
dc h'0023566554535454ee445433'
dc h'55e445666000003356655444'
dc h'544554454445455555665000'
dc h'000fe5665443444555444445'
dc h'555666660000000feee55433'
dc h'445554444445456666660000'
dc h'0000eddee342344444433445'
dc h'66666660000000000dcddee3'
dc h'554443333345666666000000'
dc h'000000ccccdee54433354446'
dc h'66666000000000000000cccc'
dc h'cdd554455555666000000000'
dc h'0000000000ccccccc5665555'
dc h'600000000000000000000000'
dc h'0cccc6665600000000000000'
earth25 ANOP
dc h'000000000000023222222200'
dc h'0000000000000000000000f3'
dc h'322222222222200000000000'
dc h'000000003322322333322222'
dc h'2230000000000000004443ff'
dc h'43334ee44443334220000000'
dc h'0000033433f3f4444dde54e3'
dc h'ee4433000000000022334434'
dc h'55444eee5e4edeee44500000'
dc h'000222244544554434ee545e'
dc h'4deeee660000000222345554'
dc h'4554334e4ee3edd544460000'
dc h'002223454554454e33ededed'
dc h'dddee4e56000002223444555'
dc h'455eedddddddddddddddd000'
dc h'022232455556555ddeeddddd'
dc h'ddddddddcc0002222345556e'
dc h'eeee55e4ddddddddddddcc00'
dc h'02222445555eddddd554eddd'
dc h'ddddddddcc003223445555ed'
dc h'ddddde533dddd4ddddddccc0'
dc h'33234555555eddddddeedddd'
dc h'd4ddddddccc0345335555555'
dc h'eedddde5edddedddddddccc0'
dc h'34443555555555eddde5edde'
dc h'5edddddcccc0445534455555'
dc h'5edddddeeede4eeddddcccc0'
dc h'3445334455554edddddd5edd'
dc h'e44eeddcccc0034554456555'
dc h'4edddddee4e4e4444dcccc00'
dc h'0345653566555edddde55544'
dc h'44444dcccc00022554455565'
dc h'5eedde45554344344dcccc00'
dc h'002454365555543e54eee544'
dc h'3445edcc6000002444566554'
dc h'535454ee44543355d5666000'
dc h'000354566554445445544544'
dc h'454666660000000feee56654'
dc h'434445554444456666660000'
dc h'0000eddee554334455544444'
dc h'56566660000000000dcddee3'
dc h'423444444345566666000000'
dc h'000000dcccdee35544444445'
dc h'56666000000000000000cccc'
dc h'cdd655445655566000000000'
dc h'0000000000ccccccc6655655'
dc h'500000000000000000000000'
dc h'0cccccc56600000000000000'
earth26 ANOP
dc h'0000000000000ff332222200'
dc h'0000000000000000000000ff'
dc h'ff3232222222200000000000'
dc h'00000000fff2f33333322222'
dc h'222000000000000000fff333'
dc h'334344444333322230000000'
dc h'000003434454fe54444ee444'
dc h'433443000000000022334545'
dc h'e4e4444dde54e3ee44500000'
dc h'0002222345554455444eee5e'
dc h'4edeee560000000222234555'
dc h'44554434ee545e4deeed0000'
dc h'002323244555544554334e4e'
dc h'e3edd5456000002323445545'
dc h'54454e33edededdddee5d000'
dc h'02222244444555455eeddddd'
dc h'ddddddddcc00022223434555'
dc h'56555ddeedddddddddddcc00'
dc h'0223233345556eeeee55e4dd'
dc h'ddddddddcc00322343344555'
dc h'5eddddd554edddddddddccc0'
dc h'223344445555edddddde533d'
dc h'ddd4ddddccc0224444455555'
dc h'5eddddddeeddddd4ddddccc0'
dc h'22466435555555eedddde5ed'
dc h'ddeddddcccc0224654355555'
dc h'5555eddde5edde5edddcccc0'
dc h'225665344555555edddddeee'
dc h'de4eeddcccc0024655334455'
dc h'554edddddd5edde44edccc00'
dc h'023555544565554edddddee4'
dc h'e4e4445ccc00022555653566'
dc h'555edddde5554444455ccc00'
dc h'003345544555655eedde4555'
dc h'4344356cc000002345543655'
dc h'55543e54eee5443456dcc000'
dc h'00024544566554535454ee44'
dc h'543466c60000000ff5545665'
dc h'544454455445445666660000'
dc h'0000eedee566544344455544'
dc h'55566660000000000dcddee5'
dc h'543344555455566666000000'
dc h'000000dcccdee34234455555'
dc h'56666000000000000000cccc'
dc h'cdd466556555555000000000'
dc h'0000000000ccccccc6665556'
dc h'500000000000000000000000'
dc h'0cccccc66500000000000000'
earth27 ANOP
dc h'0000000000000fff32333300'
dc h'0000000000000000000000ff'
dc h'fffff3322222200000000000'
dc h'00000000ffffffff43433222'
dc h'22200000000000000033ffff'
dc h'f3f454444333322220000000'
dc h'00000233fff4454454444443'
dc h'333323000000000022235456'
dc h'65ee54444ee4444334500000'
dc h'00022223455655e4e4444dde'
dc h'54e3ee560000000222223455'
dc h'554455444eee5e4edeed0000'
dc h'0032232334455544554434ee'
dc h'545e4dedd000002224443445'
dc h'55544554334e4ee3edd66000'
dc h'0222344444554554454e33ed'
dc h'ededddded600022234334444'
dc h'4555455eedddddddddddcc00'
dc h'0222343343455556555ddeed'
dc h'ddddddddcc00222344333345'
dc h'556eeeee55e4ddddddddccc0'
dc h'333344433445555eddddd554'
dc h'edddddddccc0333354444455'
dc h'55edddddde533dddd4ddccc0'
dc h'333455444555555eddddddee'
dc h'ddddd4dcccc0323456643555'
dc h'5555eedddde5edddeddcccc0'
dc h'332356543555555555eddde5'
dc h'edde5edcccc0022466653445'
dc h'55555edddddeeede4edccc00'
dc h'02345655334455554edddddd'
dc h'5edde45dcc00022445555445'
dc h'65554edddddee4e4e5566c00'
dc h'00334555653566555edddde5'
dc h'554445666000004454455445'
dc h'55655eedde45554355566000'
dc h'0003444554365555543e54ee'
dc h'e54546660000000ff4454456'
dc h'6554535454ee446555660000'
dc h'0000eee55456655444544554'
dc h'56566660000000000dcedee5'
dc h'665443444566566666000000'
dc h'000000dcccdee55433456666'
dc h'66666000000000000000cccc'
dc h'cdd453456666655000000000'
dc h'0000000000ccccccc5666665'
dc h'500000000000000000000000'
dc h'0cccccc66600000000000000'
earth28 ANOP
dc h'0000000000000ffff4323300'
dc h'0000000000000000000000ff'
dc h'ffffff323333200000000000'
dc h'0000000022fffffeeef44333'
dc h'222000000000000000332fff'
dc h'eeefee545443323220000000'
dc h'0000022333eeeee4e5544443'
dc h'3333220000000000422244fe'
dc h'e55544544444433333400000'
dc h'0003322335656665ee54444e'
dc h'e44443460000000332223455'
dc h'5655e4e4444dde54e3ed0000'
dc h'00333323333455554455444e'
dc h'ee5e4eddd000003232443334'
dc h'455544554434ee545e4cd000'
dc h'033332454434455554455433'
dc h'4e4ee3edc600033224454444'
dc h'554554454e33edededddcd00'
dc h'033323443344444555455eed'
dc h'ddddddddcc00332333443343'
dc h'455556555ddeedddddddccc0'
dc h'33234444333345556eeeee55'
dc h'e4ddddddccc0334454444334'
dc h'45555eddddd554edddddccc0'
dc h'3445445444445555edddddde'
dc h'533dddd5ccc0344544554445'
dc h'55555eddddddeeddddd5ccc0'
dc h'334444566435555555eedddd'
dc h'e5edddecccc0024533565435'
dc h'55555555eddde5edde6dcc00'
dc h'0244346665344555555edddd'
dc h'deeede5dcc00022444565533'
dc h'4455554edddddd5edcd66c00'
dc h'0023444555544565554edddd'
dc h'dee4e5d66000002354455565'
dc h'3566555edddde55555666000'
dc h'0003655445544555655eedde'
dc h'455655660000000ff5444554'
dc h'365555543e54eed666560000'
dc h'0000eee44544566554535454'
dc h'dd566650000000000dcee554'
dc h'566554445456666666000000'
dc h'000000dccddee56654445556'
dc h'66666000000000000000cccc'
dc h'cdd665446666666000000000'
dc h'0000000000ccccccc5645666'
dc h'600000000000000000000000'
dc h'0cccccc56600000000000000'
earth29 ANOP
dc h'0000000000000ffffff22200'
dc h'0000000000000000000000ff'
dc h'fffffff43233300000000000'
dc h'0000000033fffffeeeef4344'
dc h'33200000000000000033f322'
dc h'eeeedddde554433220000000'
dc h'00000323333ffddddeee5454'
dc h'433333000000000033323445'
dc h'dddee4e55444433333400000'
dc h'000233433455eee555445444'
dc h'444333450000000233434445'
dc h'656665ee54444ee444450000'
dc h'002234443334555655e4e444'
dc h'4dde54e4d000003334543333'
dc h'3455554455444eee5e4dc000'
dc h'0f3343534433344555445544'
dc h'34ee545e6c00023345434544'
dc h'344555544554334e4ee3dc00'
dc h'02244434454444554554454e'
dc h'33edededcc00223454334433'
dc h'44444555455eedddddddccc0'
dc h'22344433443343455556555d'
dc h'deedddddccc0234444444433'
dc h'3345556eeeee55e4ddddccc0'
dc h'2245555444433445555edddd'
dc h'd554eddcccc0224655445444'
dc h'445555edddddde533ddcc6c0'
dc h'2246554455444555555edddd'
dc h'ddeedddcc6c0024554445664'
dc h'35555555eedddde5edccdc00'
dc h'0234553356543555555555ed'
dc h'dde5edcd6c00022454346665'
dc h'344555555edddddeedcd6c00'
dc h'002344445655334455554edd'
dc h'dddd5dccc000003344444555'
dc h'544565554eddddded5d6c000'
dc h'000244544555653566555edd'
dc h'dde666660000000345655445'
dc h'544555655eedde5666650000'
dc h'0000fee5444554365555543e'
dc h'65ddc660000000000dcee445'
dc h'44566554536566cc66000000'
dc h'000000dccde5545665555566'
dc h'66666000000000000000cccc'
dc h'cdd666656566666000000000'
dc h'0000000000ccccccc6665566'
dc h'600000000000000000000000'
dc h'0cccccc56400000000000000'
earth30 ANOP
dc h'0000000000000ffffff33300'
dc h'000000000000000000000022'
dc h'fffffffff222300000000000'
dc h'00000000ff22fffeeeeee543'
dc h'333000000000000000f3ff33'
dc h'ffeeddddde54544320000000'
dc h'00000f3333f434dddddddde5'
dc h'544433000000000022333445'
dc h'4eeddddeee54544333500000'
dc h'00022334444555dddee4e554'
dc h'444333450000000222446444'
dc h'55eee5554454444443350000'
dc h'00322345544445656665ee54'
dc h'444ee445600000ff23555433'
dc h'34555655e4e4444dde55d000'
dc h'0fff44555433333455554455'
dc h'444eee5e6c000fff45545344'
dc h'3334455544554434ee546d00'
dc h'0f2345554345443445555445'
dc h'54334e4ed500332245543445'
dc h'4444554554454e33ededdcc0'
dc h'322355543344334444455545'
dc h'5eedddddccc0322355443344'
dc h'3343455556555ddeedddccc0'
dc h'222555444444333345556eee'
dc h'ee55e4dcccc0322455555444'
dc h'433445555eddddd554ecccc0'
dc h'22235655445444445555eddd'
dc h'ddde533cccc0022356554455'
dc h'444555555eddddddeecccc00'
dc h'0223555444566435555555ee'
dc h'dddde5dccc00022444553356'
dc h'543555555555eddde6dccc00'
dc h'00334454346665344555555e'
dc h'dddddddcc000003344444456'
dc h'55334455554eddddcc6cc000'
dc h'00025444444555544565554e'
dc h'dddccdc60000000344445445'
dc h'55653566555eddccd6660000'
dc h'0000f555655445544555655e'
dc h'dccd6660000000000ecee544'
dc h'4554365555654d66cc000000'
dc h'000000dccde4454456666565'
dc h'6666c000000000000000cccc'
dc h'd66566666666666000000000'
dc h'0000000000ccccccc6666665'
dc h'600000000000000000000000'
dc h'0cccccc66600000000000000'

View File

@ -0,0 +1,600 @@
earth31 ANOP
dc h'0000000000000ffffff32200'
dc h'0000000000000000000000f3'
dc h'2ffffffff333200000000000'
dc h'00000000ffff22feeeeeeff3'
dc h'223000000000000000fff3ff'
dc h'33feddddddd6534330000000'
dc h'00000ffff3ff45eeddddddde'
dc h'5455440000000000ffff4445'
dc h'e544dddddddde55444500000'
dc h'0003f2234545554eeddddeee'
dc h'545443450000000322245554'
dc h'4555dddee4e5544443350000'
dc h'0033233455644455eee55544'
dc h'54444444500000ff33345554'
dc h'4445656665ee54444ee56000'
dc h'0fffff3455543334555655e4'
dc h'e4444dde66000fffee555554'
dc h'33333455554455444eee6d00'
dc h'0ffeee555453443334455544'
dc h'554434ee6600ffff44555543'
dc h'4544344555544554334e5dc0'
dc h'f23443455434454444554554'
dc h'454e33eddcc0f24324555433'
dc h'443344444555455eedddccc0'
dc h'f34424554433443343455556'
dc h'555ddeecccc0233335554444'
dc h'44333345556eeeee55e5ccc0'
dc h'22443455555444433445555e'
dc h'ddddd555dcc0033333565544'
dc h'5444445555edddddde645c00'
dc h'03442356554455444555555e'
dc h'ddddddddcc00032433555444'
dc h'566435555555eedddcd6cc00'
dc h'003344445533565435555555'
dc h'55eddcd6c000003454445434'
dc h'6665344555555eddccccc000'
dc h'000354444444565533445555'
dc h'4edccccc0000000344544444'
dc h'4555544565554ecccccc0000'
dc h'0000f5544454455565356655'
dc h'6dccccc0000000000ec55565'
dc h'5445544555666dcccc000000'
dc h'000000dccde5444554366666'
dc h'665c6000000000000000cccc'
dc h'd55655666666656000000000'
dc h'0000000000ccccc666666666'
dc h'600000000000000000000000'
dc h'0cccccc66600000000000000'
earth32 ANOP
dc h'00000000000003f2f3322300'
dc h'000000000000000000000022'
dc h'f32ffffff322200000000000'
dc h'00000000322ff32ffeeeeff4'
dc h'332000000000000000f3ffff'
dc h'ef32eddddddee33230000000'
dc h'00000ff3fff4ee44eddddddd'
dc h'd654440000000000ffffeef5'
dc h'ee55eeddddddde5455500000'
dc h'00033ffefe5555e544dddddd'
dc h'dde554560000000f33f23455'
dc h'45554eeddddeee5454450000'
dc h'00ff34342555544555dddee4'
dc h'e55444445000002f34444455'
dc h'644455eee555445444456000'
dc h'0fffff543455544445656665'
dc h'ee54444ed6000fffedee3455'
dc h'543334555655e4e4444dcd00'
dc h'02feedde5555543333345555'
dc h'4455444edd002ffeddde5554'
dc h'53443334455544554434dd60'
dc h'23feee445555434544344555'
dc h'544554335d602ff355434554'
dc h'34454444554554454e33dcc0'
dc h'22f454245554334433444445'
dc h'55455eecccc022f554245544'
dc h'33443343455556555ddddcc0'
dc h'223543355544444433334555'
dc h'6eeeee56d6c0023454345555'
dc h'5444433445555eddddc66600'
dc h'023543335655445444445555'
dc h'edddddcd6500022554235655'
dc h'4455444555555edddccccc00'
dc h'003444335554445664355555'
dc h'55eedcccc000003454444455'
dc h'3356543555555555dcccc000'
dc h'000355544454346665344555'
dc h'555dcccc0000000345544444'
dc h'445655334455555dcccc0000'
dc h'0000f5545444444555544565'
dc h'665dccc0000000000ec55444'
dc h'544555653566666ccc000000'
dc h'000000dcc655655445555666'
dc h'666cc000000000000000cccc'
dc h'd65556655666666000000000'
dc h'0000000000ccccc666666666'
dc h'600000000000000000000000'
dc h'0cccc6666600000000000000'
earth33 ANOP
dc h'000000000000022322233200'
dc h'000000000000000000000032'
dc h'2223f2f33223200000000000'
dc h'00000000f33222f43fefeff4'
dc h'222000000000000000ffff32'
dc h'2ff44eeddddee44320000000'
dc h'00000ffff3fefdde43eddddd'
dc h'dee4330000000000ffffe4fd'
dc h'e5de44edddddddd654500000'
dc h'000ffffeeddde5ee55eedddd'
dc h'ddde54660000000ff34fedee'
dc h'5555e544dddddddde5560000'
dc h'0022ff45e3345545554eeddd'
dc h'deee545560000022ff554425'
dc h'55544555dddee4e554456000'
dc h'03223f55444455644455eee5'
dc h'554454446600032ffdee5434'
dc h'55544445656665ee54445c00'
dc h'022fedddee34555433345556'
dc h'55e4e4445c002223edddde55'
dc h'555433333455554455445cc0'
dc h'222fddddde55545344333445'
dc h'5544554446c02234edee4455'
dc h'554345443445555445544560'
dc h'223ee4554345543445444455'
dc h'4554454d45c03333e4542455'
dc h'5433443344444555455ddcc0'
dc h'3323e5542455443344334345'
dc h'5556555cccc0033345433555'
dc h'444444333345556eeedd6600'
dc h'032344543455555444433445'
dc h'555eddccc600032345433356'
dc h'55445444445555eddccccc00'
dc h'002345542356554455444555'
dc h'555edcccc000002355443355'
dc h'5444566435555555ddccc000'
dc h'000255544444553356543555'
dc h'555666cc0000000345555444'
dc h'54346665344555666ccc0000'
dc h'0000f5555444444456553344'
dc h'66666cc0000000000ed55454'
dc h'44444555545666666c000000'
dc h'000000ddd654445445566646'
dc h'66666000000000000000ddd6'
dc h'666665566666666000000000'
dc h'0000000000cdddd666666656'
dc h'600000000000000000000000'
dc h'0cccc6666600000000000000'
earth34 ANOP
dc h'00000000000002223f222300'
dc h'0000000000000000000000ff'
dc h'322223222332200000000000'
dc h'00000000ff33322334f2f443'
dc h'232000000000000000fffff3'
dc h'4322e54ededee43220000000'
dc h'00000fffffef443ee54eeddd'
dc h'dee54400000000002fffeef5'
dc h'ededde43eddddddee4500000'
dc h'00022ffeedd5ede5de44eddd'
dc h'ddddd666000000022feeeddd'
dc h'dde5ee55eeddddddde560000'
dc h'00222ff55eedee5555e544dd'
dc h'dddddde66000002222ee55e3'
dc h'345545554eeddddeee556000'
dc h'022322ee55442555544555dd'
dc h'dee4e55466000223344e5544'
dc h'4455644455eee55544545600'
dc h'02243eedee54345554444565'
dc h'6665ee54560022234eddddee'
dc h'3455543334555655e4e45660'
dc h'222344edddde555554333334'
dc h'55554455566022334eddddde'
dc h'555453443334455544555650'
dc h'223445edee44555543454434'
dc h'45555446665022344ee45543'
dc h'455434454444554554466c50'
dc h'234543e45424555433443344'
dc h'444555466cc0034533e55424'
dc h'554433443343455556666c00'
dc h'034543454335554444443333'
dc h'45556eddcc00033533445434'
dc h'55555444433445555dcccc00'
dc h'003443454333565544544444'
dc h'5555ecccc00000f344455423'
dc h'56554455444555556dccc000'
dc h'000244554433555444566435'
dc h'555666cc0000000234555444'
dc h'445533565435556666660000'
dc h'0000f5555554445434666534'
dc h'56666660000000000ed55554'
dc h'444444565544566666000000'
dc h'000000ddd654544444466666'
dc h'66666000000000000000ddd6'
dc h'655565566666566000000000'
dc h'0000000000cdd66666666666'
dc h'600000000000000000000000'
dc h'0cccc6666600000000000000'
earth35 ANOP
dc h'0000000000000f3222223200'
dc h'0000000000000000000000ff'
dc h'fff2223f2223300000000000'
dc h'00000000ffffff3323343224'
dc h'3220000000000000003fffff'
dc h'44433445e3e5533320000000'
dc h'0000022fffeef55433e54ede'
dc h'dee5330000000000332feeed'
dc h'de543ee54eeddddee5500000'
dc h'0003322feddde5ededde43ed'
dc h'dddddec600000003222fdddd'
dc h'd5ede5de44edddddddd60000'
dc h'0032222eddeddddde5ee55ee'
dc h'dddddddc60000032224ee55e'
dc h'edee5555e544dddddddcc000'
dc h'02223333ee55e3345545554e'
dc h'eddddeee660002223533ee55'
dc h'442555544555dddee4e56600'
dc h'022335444e55444455644455'
dc h'eee5554466002223454eedee'
dc h'543455544445656665ee6660'
dc h'2223444eddddee3455543334'
dc h'555655e4d66022234444eddd'
dc h'de5555543333345555446660'
dc h'2223444eddddde5554534433'
dc h'34455545666022244445edee'
dc h'445555434544344555556660'
dc h'2224444ee455434554344544'
dc h'44554555666002355543e454'
dc h'245554334433444445666600'
dc h'03355533e554245544334433'
dc h'434555666600033555434543'
dc h'3555444444333345566ccc00'
dc h'003455334454345555544443'
dc h'3445566cc000004455434543'
dc h'335655445444445566ccc000'
dc h'000fe4444554235655445544'
dc h'4556666c0000000f44445544'
dc h'335554445664356666660000'
dc h'0000e4445554444455335654'
dc h'46666660000000000ed55555'
dc h'544454346666466666000000'
dc h'000000ddd655544444456666'
dc h'55666000000000000000ddd6'
dc h'656555556666666000000000'
dc h'0000000000cdd66666666666'
dc h'600000000000000000000000'
dc h'0cc666666600000000000000'
earth36 ANOP
dc h'0000000000000ff222223200'
dc h'0000000000000000000000ff'
dc h'ffff32222232200000000000'
dc h'00000000ff3ffffff3224f32'
dc h'233000000000000000f3ffff'
dc h'eeef54344542344220000000'
dc h'000003333feeed55543445e3'
dc h'e55434000000000033323eed'
dc h'dde55433e54ededee5500000'
dc h'000333343eddddde543ee54e'
dc h'eddddec60000000333434edd'
dc h'dde5ededde43eddddddc0000'
dc h'003334333eddddd5ede5de44'
dc h'eddddddcc000003333333edd'
dc h'eddddde5ee55eedddddcc000'
dc h'033343434ee55eedee5555e5'
dc h'44ddddddcc000322344433ee'
dc h'55e3345545554eeddddecc00'
dc h'0222344533ee554425555445'
dc h'55dddee4d60022224445444e'
dc h'55444455644455eee5555660'
dc h'322344454eedee5434555444'
dc h'45656665dc60223344444edd'
dc h'ddee3455543334555655d6c0'
dc h'2234344444edddde55555433'
dc h'333455565660223333444edd'
dc h'ddde55545344333445566660'
dc h'3223344445edee4455554345'
dc h'443445566660032334444ee4'
dc h'554345543445444455566600'
dc h'0334455543e4542455543344'
dc h'3344445666000335455533e5'
dc h'542455443344334346666600'
dc h'003455554345433555444444'
dc h'333346666000004455553344'
dc h'543455555444433456666000'
dc h'000365554345433356554454'
dc h'444566660000000ffee44445'
dc h'542356554455445666660000'
dc h'0000ee544455443355544456'
dc h'65466660000000000dc44455'
dc h'544444553366665666000000'
dc h'000000ddd655555444554566'
dc h'66566000000000000000ddd6'
dc h'666555556666665000000000'
dc h'0000000000cdd66666666666'
dc h'600000000000000000000000'
dc h'0cc666666600000000000000'
earth37 ANOP
dc h'0000000000000ffff2223300'
dc h'0000000000000000000000ff'
dc h'fffff2222232300000000000'
dc h'000000003ffffffeef432333'
dc h'3220000000000000002ff3ff'
dc h'4feedee4335e423330000000'
dc h'00000333f3feedddde543445'
dc h'42354300000000002333444e'
dc h'dddd55543445e3e554500000'
dc h'00022334444ddddde55433e5'
dc h'4ededec6000000023344554e'
dc h'ddddde543ee54eeddddc0000'
dc h'00333445544edddde5ededde'
dc h'43eddddcc00000333455433e'
dc h'ddddd5ede5de44eddddcc000'
dc h'03334454333eddeddddde5ee'
dc h'55eeddddcc0003334554434e'
dc h'e55eedee5555e544ddddcc00'
dc h'033433444433ee55e3345545'
dc h'554eedddcc00322343444533'
dc h'ee55442555544555ddded6c0'
dc h'3323334445444e5544445564'
dc h'4455eee5666033433444454e'
dc h'edee543455544445656666c0'
dc h'33334444444eddddee345554'
dc h'3334555666c0223444344444'
dc h'edddde555554333334566660'
dc h'22344333444eddddde555453'
dc h'443334466660024433344445'
dc h'edee44555543454434566600'
dc h'03453334444ee45543455434'
dc h'454444666600033544455543'
dc h'e45424555433443345566600'
dc h'002455455533e55424554433'
dc h'443344666000002455555543'
dc h'454335554444443344666000'
dc h'000365555533445434555554'
dc h'444446660000000ff5655543'
dc h'454333565544545566660000'
dc h'0000eeeee444455423565544'
dc h'66566660000000000dce5444'
dc h'554433555455666656000000'
dc h'000000dcc544555444456645'
dc h'66665000000000000000ddd6'
dc h'666665556656666000000000'
dc h'0000000000cdd66666666666'
dc h'600000000000000000000000'
dc h'0cc666666600000000000000'
earth38 ANOP
dc h'00000000000002f222222200'
dc h'0000000000000000000000ff'
dc h'fffffff22233300000000000'
dc h'0000000022fffffeeef33333'
dc h'32300000000000000022223f'
dc h'efffddde5434434220000000'
dc h'000003232ff4ed5edddee433'
dc h'5e42340000000000222344f5'
dc h'edddddde5434454235500000'
dc h'0002222445555edddd555434'
dc h'45e3e5660000000222345554'
dc h'4ddddde55433e54ededc0000'
dc h'0022234555554eddddde543e'
dc h'e54eeddcc000002234555554'
dc h'4edddde5ededde43eddcc000'
dc h'0233445555433eddddd5ede5'
dc h'de44edddcc00033345555433'
dc h'3eddeddddde5ee55eeddcc00'
dc h'0234455554434ee55eedee55'
dc h'55e544ddcc00223455434444'
dc h'33ee55e3345545554eedccc0'
dc h'23334443444533ee55442555'
dc h'544555ddccc0234444334445'
dc h'444e55444455644455eed660'
dc h'2345543444454eedee543455'
dc h'544445666660224543444444'
dc h'4eddddee3455543334566660'
dc h'22344444344444edddde5555'
dc h'543333356660023444433344'
dc h'4eddddde5554534433456600'
dc h'03345433344445edee445555'
dc h'434544466600032555333444'
dc h'4ee455434554344545566600'
dc h'00345544455543e454245554'
dc h'334434666000003345554555'
dc h'33e554245544334444656000'
dc h'000245555555434543355544'
dc h'444545550000000ff5655555'
dc h'334454345555545565560000'
dc h'0000eee56555434543335655'
dc h'55666660000000000dceeee4'
dc h'444554235666566666000000'
dc h'000000dccd54445544346666'
dc h'66666000000000000000dcc5'
dc h'556665556666556000000000'
dc h'0000000000cdd66666666666'
dc h'500000000000000000000000'
dc h'0cc666666600000000000000'
earth39 ANOP
dc h'0000000000000f2222222200'
dc h'0000000000000000000000ff'
dc h'fff2f2222222200000000000'
dc h'0000000022f2fffeeffff333'
dc h'333000000000000000222f22'
dc h'ffeedddde444434230000000'
dc h'0000023322334edeeeddde54'
dc h'34444300000000002223343e'
dc h'e5dd5edddee4335e42500000'
dc h'000222233555e5edddddde54'
dc h'344542460000000222224555'
dc h'555edddd55543445e3e60000'
dc h'002222234555544ddddde554'
dc h'33e54edcc000002223445555'
dc h'554eddddde543ee54eecc000'
dc h'022233555555544edddde5ed'
dc h'edde43edcc00022245555555'
dc h'433eddddd5ede5de44edcc00'
dc h'022445555554333eddeddddd'
dc h'e5ee55eecc00222355555554'
dc h'434ee55eedee5555e544ccc0'
dc h'2223555543444433ee55e334'
dc h'5545554edcc0223454444344'
dc h'4533ee55442555544555ccc0'
dc h'22355544334445444e554444'
dc h'55644456dcc0223555543444'
dc h'454eedee5434555444466660'
dc h'333455434444444eddddee34'
dc h'555433356660023444444434'
dc h'4444edddde55555433445600'
dc h'023444444333444eddddde55'
dc h'545344455600022544543334'
dc h'4445edee4455554346565600'
dc h'002445553334444ee4554345'
dc h'543446666000003455554445'
dc h'5543e4542455543355556000'
dc h'0003544555455533e5542455'
dc h'4434565500000003f4455555'
dc h'554345433555445566550000'
dc h'0000eee56555553344543455'
dc h'66666660000000000dcee565'
dc h'554345433366666666000000'
dc h'000000dccdeee44445553466'
dc h'66666000000000000000dccd'
dc h'655566555566666000000000'
dc h'0000000000ccc66666666666'
dc h'600000000000000000000000'
dc h'0cc666666600000000000000'
earth40 ANOP
dc h'0000000000000ff333222200'
dc h'0000000000000000000000ff'
dc h'ffff22222222200000000000'
dc h'0000000022fffffff3f33223'
dc h'222000000000000000332222'
dc h'f3fedddeeee4434330000000'
dc h'00000322223f34eedddddde4'
dc h'444443000000000033224424'
dc h'445edeeeddde543444500000'
dc h'0003332235454ee5dd5eddde'
dc h'e4335e540000000222223445'
dc h'55e5edddddde543445440000'
dc h'00222332334555555edddd55'
dc h'543445e4c000002223433345'
dc h'55544ddddde55433e54dc000'
dc h'02223344445555554eddddde'
dc h'543ee54ecc00022234445555'
dc h'55544edddde5ededde43cc00'
dc h'02223455555555433eddddd5'
dc h'ede5de44dc00322245555555'
dc h'54333eddeddddde5ee55dcc0'
dc h'33224455555554434ee55eed'
dc h'ee5555e556c0322244555543'
dc h'444433ee55e3345545555cc0'
dc h'333345544443444533ee5544'
dc h'2555544666c0322445554433'
dc h'4445444e55444455644566c0'
dc h'23344555543444454eedee54'
dc h'345554456660034544554344'
dc h'44444eddddee345554445600'
dc h'024444444444344444edddde'
dc h'555554455500022444444443'
dc h'33444eddddde555454565500'
dc h'002345445433344445edee44'
dc h'555544666000002345455533'
dc h'34444ee45543455445666000'
dc h'000255555544455543e45424'
dc h'555545660000000245544555'
dc h'455533e55424555555660000'
dc h'0000f5e44555555543454335'
dc h'66566660000000000dcee565'
dc h'555533445445666666000000'
dc h'000000dccde5655543465445'
dc h'66666000000000000000dccd'
dc h'ddd555566645666000000000'
dc h'0000000000cccd6666666655'
dc h'600000000000000000000000'
dc h'0cc666666600000000000000'
earth41 ANOP
dc h'000000000000033222333200'
dc h'000000000000000000000033'
dc h'f2fff2233322200000000000'
dc h'000000003333f23eeff44432'
dc h'222000000000000000322333'
dc h'23feddde4444433220000000'
dc h'00000333234432eedeeee4e4'
dc h'433433000000000023334445'
dc h'3344e4eddddeeee444500000'
dc h'000222244543434e44eedddd'
dc h'dde444560000000222335544'
dc h'5534445edeeeddde54360000'
dc h'00222335554345454ee5dd5e'
dc h'dddee4346000002223444432'
dc h'344555e5edddddde54356000'
dc h'022243344442334555555edd'
dc h'dd5554346600032245334443'
dc h'334555544ddddde55433d600'
dc h'033444334444445555554edd'
dc h'ddde543ed600333454334444'
dc h'555555544edddde5ededcc60'
dc h'333454434455555555433edd'
dc h'ddd5ede5cc60233354334555'
dc h'555554333eddeddddde5dc60'
dc h'223455434455555554434ee5'
dc h'5eedee5666c0223554334455'
dc h'5543444433ee55e334566660'
dc h'2245554345544443444533ee'
dc h'554425566660033554344555'
dc h'44334445444e554444666600'
dc h'033445444555543444454eed'
dc h'ee5434666600032355554455'
dc h'434444444eddddee35666600'
dc h'0032445444444444344444ed'
dc h'ddde56666000002244444444'
dc h'444333444eddddde66666000'
dc h'0002344445445433344445ed'
dc h'ee4566660000000224444545'
dc h'553334444ee4555466660000'
dc h'0000f44455555544455543e4'
dc h'65366660000000000dd45554'
dc h'4555455533d6664666000000'
dc h'000000ccd6e4455555565456'
dc h'65566000000000000000cccd'
dc h'd66666665566665000000000'
dc h'0000000000ccccc666666566'
dc h'600000000000000000000000'
dc h'0cccccc66600000000000000'
earth42 ANOP
dc h'000000000000033322223300'
dc h'000000000000000000000033'
dc h'223322233322200000000000'
dc h'0000000033333f2fff334443'
dc h'222000000000000000332333'
dc h'4f34ddee5554333220000000'
dc h'000003332244434edddde444'
dc h'444433000000000022334345'
dc h'542eedeeee4e443344500000'
dc h'00022234455553344e4edddd'
dc h'eeee44560000000322335554'
dc h'3434e44eedddddde44460000'
dc h'00322334455445534445edee'
dc h'eddde5446000002223445554'
dc h'345454ee5dd5edddee445000'
dc h'0222334444432344555e5edd'
dc h'dddde5436600022235434444'
dc h'2334555555edddd555435600'
dc h'0233355334443334555544dd'
dc h'ddde55434c00f23455433444'
dc h'4445555554eddddde543dc60'
dc h'3334554334444555555544ed'
dc h'ddde5edeccc0334455443445'
dc h'5555555433eddddd5ede6cc0'
dc h'2244454334555555554333ed'
dc h'dedddddd6cc0223445543445'
dc h'5555554434ee55eedee66660'
dc h'22345543344555543444433e'
dc h'e55e33466660023555543455'
dc h'44443444533ee55442666600'
dc h'034455434455544334445444'
dc h'e55444566600033444544455'
dc h'5543444454eedee544566600'
dc h'0033355554455434444444ed'
dc h'dddee4666000003434454444'
dc h'44444344444eddddd6666000'
dc h'0002244444444444333444ed'
dc h'dddcd6660000000323444454'
dc h'45433344445eded566660000'
dc h'0000234444545553334444ee'
dc h'56665660000000000d544555'
dc h'55544455544d566466000000'
dc h'000000cc565544555456644c'
dc h'66646000000000000000cc6d'
dc h'556666666656665000000000'
dc h'0000000000cccc6666666556'
dc h'600000000000000000000000'
dc h'0ccc66666600000000000000'

View File

@ -0,0 +1,398 @@
*-----------------------------------------------------------------------------*
! Twilight II Large Bouncing Earth Module. !
! !
! By Jim Maricondo. !
! !
! v1.0 for Twilight II - 10/24/92 !
! v1.0.1 - 1/3/93 JRM
! !
! Copyright (c) 1991 Jim Maricondo. All rights reserved. !
*-----------------------------------------------------------------------------*
*****************************************************************
* Jim:
* This works fine on my system now. Try it on yours. I made a lot of little
* changes. First: You were getting 'trash' instead of a globe sometimes
* because you never initialized the variable ShapeNum, meaning that it
* sometimes started at about $Cxxx (the times I ran it trhough the debugger)
* which is a bit high when you only have 42 shapes. :) I added a stz ShapeNum
* right before the jsr Animate to fix that. Then, the bigger problem--you
* had the loop timed so that it would *-wait-draw-calculate-erase-goto*. For
* all but the top few lines, this meant that it would erase the shape, then
* wait, with it erased, then quickly draw and erase it again, then wait
* with it erased, etc. That is waht was giving you the banding. So, I moved
* the erase to right before the draw, like this: *-wait-erase-draw-calculate-
* goto*. This had the problem that there wasn't enough time in the VBL
* period to completely erase and redraw the thing--the band showed up on
* about the top 20 lines. So, to fix this, I changed the wait loop to loop
* on the VertCnt register ($E0C02E). I calculate where the bottom of the
* shape is, and wait until the gun has passed that line. Then I start drawing.
* As pointed out in TN IIGS #70, this gives you almost 1/30th of a second
* to draw the shape, which is plenty of time. Also, one personal observation:
* I think there's a little jerk in the ball. After it does a loop, it seems
* to skip a frame or some such.... Oh ya, one more thing: what was the point
* of grabbing a $7D00 hunk of memory, filling it wih zeros, then using dp
* long indexed to get a 0, when you could have just done one lda #0 and
* save yourself MANY cycles? It's not like you have a background to restore.
* :) I changed this, but left the old stuff there, just commented out.
* Enjoy!
* --Jonah
*
* ps. I'm adding this about 3 hours later: Don't ORA the master MemID
* with $0100. I load the file in with a MemID of x1xx or x2xx, so the
* ORA will do nothing, but the DisposeAll will be VERY uncool. Try $0A00
* instead.... :)
*****************************************************************
longa on
longi on
mcopy Earth.MAC
copy 22:t2common.equ
copy 22:dsdb.equ
keep earth.d
*-----------------------------------------------------------------------------*
MovePtr gequ <0
SLookUp gequ MovePtr+4
HiRes gequ SLookUp+4
Width gequ HiRes+4
Depth gequ Width+2
ShapeNum gequ Depth+2
y gequ ShapeNum+2
ztemp2 gequ y+2
BackPtr gequ ztemp2+4
lasty gequ BackPtr+4
lastx gequ lasty+2
YCoord gequ lastx+2
back_Width gequ YCoord+2
back_depth gequ back_width+2
SHRPtr gequ back_depth+2
shape_bottom gequ SHRPtr+4
bWidth gequ 18
NumEarths gequ 42
MAXIMAGES gequ 1 ; # of images that can be handled
;debugSymbols gequ $BAD ; Put in debugging symbols ?
;debugBreaks gequ $BAD ; Put in debugging breaks ?
*-----------------------------------------------------------------------------*
Large_Earth Start
kind $1000 ; no special memory
debug 'Large_Earth'
Using MainDATA
Using EarthDATA
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
bne notSupported
lda T2data1,s ; movePtr
sta MovePtr
lda T2data1+2,s
sta MovePtr+2
ldx #32-2
pal lda Earth2_Pal,x
sta $E19E00,x
dex
dex
bpl pal
~GetAddress #1
PullLong SLookUp
stz ShapeNum
jsr Animate
notSupported 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
*-----------------------------------------------------------------------------*
Animate Start
debug 'Animate'
Using MainDATA
lda #1
sta left_boundary init boundaries
sta xposition
lda #1
sta top_boundary
sta yposition
lda #160+bWidth-1
sta right_boundary
lda #200-1
sta bottom_boundary
lda #$2000
sta SHRPtr
sta HiRes ; new!
shortm
lda SHADOW
longm
bit #$08 ; bit 3 = 1 = inhibit SHR shadowing
bne bankE1
lda #$01
sta SHRPtr+2
sta HiRes+2
bra bankSet
bankE1 lda #$E1
sta SHRPtr+2
sta HiRes+2
bankSet anop
event_loopL8 anop
lda yposition
clc
adc image_height
lsr a
clc
adc #$80
sec ;it was getting stuck at shape_bottom
sbc #4 ; = $E1, so I subtract a few to move
sta shape_bottom ; it up. Why was it getting stuck?!
shortm
wait2 lda >VERTCNT
cmp shape_bottom
bne wait2
longm
jsr fixback
jsr DrawEarth
lda yposition
sta lasty
lda xposition
sta lastx
jsr move_images move all images
lda ShapeNum
inc a
cmp #(NumEarths*2)
blt keepIt
lda #0
keepIt sta ShapeNum
lda [MovePtr]
beq event_loopL8
rts
End
*-----------------------------------------------------------------------------*
! Apply velocities to all images to cause them to move.
! Bounce them off the motion boundaries as needed.
move_images Start
debug 'move_images'
Using MainDATA
lda xposition
clc
adc xvelocity
bmi Z1L9 way past left
cmp left_boundary
bge Z2L9 not on left edge
Z1L9 jsr invert_xvel else bounce it
lda left_boundary
bra Z2L9
Z2L9 pha
clc
adc image_width
cmp right_boundary
pla
blt Z3L9 not on right edge
jsr invert_xvel else bounce it
lda right_boundary
sec
sbc image_width
Z3L9 sta xposition
lda yposition
clc
adc yvelocity
bmi Z4L9 ;way above top
cmp top_boundary
bge Z5L9 ;below top edge
Z4L9 jsr invert_yvel ;else bounce it
lda top_boundary
bra Z6L9
Z5L9 pha
clc
adc image_height
cmp bottom_boundary
pla
blt Z6L9 ;above bottom edge
jsr invert_yvel ;else bounce it
lda bottom_boundary
sec
sbc image_height
Z6L9 sta yposition
rts
! Invert X velocity to give the illusion of a bounce.
invert_xvel lda xvelocity
eor #$ffff
inc a
sta xvelocity
rts
! Invert Y velocity to give the illusion of a bounce.
invert_yvel lda yvelocity
eor #$ffff
inc a
sta yvelocity
rts
End
*-----------------------------------------------------------------------------*
DrawEarth Start
debug 'drawEarth'
Using MainDATA
Using EarthDATA
longa on
longi on
stz image_index init an index into the shape data
lda yposition Y coord.. down!
sta y X coord.. across!
lda shapeNum
and #$FFFE
; asl a x 2 to get shape number
tax
lda EarthTable,x shape data
sta fill2+1
lda image_height depth of shape
sta depth
yloop anop
lda image_wordwidth width (in words) of shape
sta width
lda y y = y coordinate
asl a multipy by 2 to get index into table
tay
lda [SLookUp],y get address from table
clc add x to base address
adc xposition x = horizontal position (in bytes)
sta HiRes
ldy #0 use Y as a horizontal offset
ldx image_index
xloop anop
fill2 lda |$0000,x get byte of shape
sta [HiRes],y
iny move over a word to the right
iny
inx increment index into shape's data
inx
dec width see if done with this line
bne xloop
stx image_index
inc y go to next line
dec depth see if done all lines
bne yloop
rts
End
*-----------------------------------------------------------------------------*
FixBack Start
debug 'fixBack'
Using MainDATA
longa on
longi on
lda lasty Y coord.. down!
sta YCoord X coord.. across!
lda image_height depth of shape
sta back_depth
yloop anop
lda #bWidth/2 width (in words) of shape
sta back_Width
lda YCoord y = y coordinate
asl a multipy by 2 to get index into table
tay
lda [SLookUp],y get address from table
clc add x to base address
adc lastx x = horizontal position (in bytes)
sec convert it into offset into SHR instead
sbc #$2000 of offset into bank E1
tay
lda #0
xloop anop
; lda [BackPtr],y get byte of shape
sta [SHRPtr],y
iny move over a word to the right
iny
dec back_width see if done with this line
bne xloop
inc YCoord go to next line
dec back_depth see if done all lines
bne yloop
rts
End
*-----------------------------------------------------------------------------*
MainDATA Data
earth2_pal ANOP
dc h'0000 000f 2300 3400 4500 5600'
dc h'6700 9a08 bb09 cd0a ee0c ff0f'
dc h'a000 8000 6000 4000'
number_of_images dc i'MAXIMAGES' # of images handled
image_index ds 2 loop index
! Motion boundaries (in pixels)
left_boundary ds 2
right_boundary ds 2
top_boundary ds 2
bottom_boundary ds 2
! Image arrays
xvelocity dc i'1'
yvelocity dc i'1'
xposition dc i'0'
yposition dc i'0'
image_width dc i'bWidth*2'
image_bytewidth dc i'bWidth'
image_wordwidth dc i'bWidth/2'
image_height dc i'32'
End
*-----------------------------------------------------------------------------*
copy e1.15

View File

@ -0,0 +1,393 @@
*-----------------------------------------------------------------------------*
! Twilight II Large Bouncing Earth Module. !
! !
! By Jim Maricondo. !
! !
! v1.0 for Twilight II - 10/24/92 !
! !
! Copyright (c) 1991 Jim Maricondo. All rights reserved. !
*-----------------------------------------------------------------------------*
*****************************************************************
* Jim:
* This works fine on my system now. Try it on yours. I made a lot of little
* changes. First: You were getting 'trash' instead of a globe sometimes
* because you never initialized the variable ShapeNum, meaning that it
* sometimes started at about $Cxxx (the times I ran it trhough the debugger)
* which is a bit high when you only have 42 shapes. :) I added a stz ShapeNum
* right before the jsr Animate to fix that. Then, the bigger problem--you
* had the loop timed so that it would *-wait-draw-calculate-erase-goto*. For
* all but the top few lines, this meant that it would erase the shape, then
* wait, with it erased, then quickly draw and erase it again, then wait
* with it erased, etc. That is waht was giving you the banding. So, I moved
* the erase to right before the draw, like this: *-wait-erase-draw-calculate-
* goto*. This had the problem that there wasn't enough time in the VBL
* period to completely erase and redraw the thing--the band showed up on
* about the top 20 lines. So, to fix this, I changed the wait loop to loop
* on the VertCnt register ($E0C02E). I calculate where the bottom of the
* shape is, and wait until the gun has passed that line. Then I start drawing.
* As pointed out in TN IIGS #70, this gives you almost 1/30th of a second
* to draw the shape, which is plenty of time. Also, one personal observation:
* I think there's a little jerk in the ball. After it does a loop, it seems
* to skip a frame or some such.... Oh ya, one more thing: what was the point
* of grabbing a $7D00 hunk of memory, filling it wih zeros, then using dp
* long indexed to get a 0, when you could have just done one lda #0 and
* save yourself MANY cycles? It's not like you have a background to restore.
* :) I changed this, but left the old stuff there, just commented out.
* Enjoy!
* --Jonah
*
* ps. I'm adding this about 3 hours later: Don't ORA the master MemID
* with $0100. I load the file in with a MemID of x1xx or x2xx, so the
* ORA will do nothing, but the DisposeAll will be VERY uncool. Try $0A00
* instead.... :)
*****************************************************************
longa on
longi on
mcopy Earth.MAC
copy :jim4:dya:twilight:t2common.equ
keep 'earth.d'
*-----------------------------------------------------------------------------*
MovePtr gequ <0
SLookUp gequ MovePtr+4
HiRes gequ SLookUp+4
Width gequ HiRes+4
Depth gequ Width+2
ShapeNum gequ Depth+2
y gequ ShapeNum+2
bordercol gequ y+2
ztemp2 gequ bordercol+1
BackPtr gequ ztemp2+4
lasty gequ BackPtr+4
lastx gequ lasty+2
YCoord gequ lastx+2
back_Width gequ YCoord+2
back_depth gequ back_width+2
SHRPtr gequ back_depth+2
shape_bottom gequ SHRPtr+4
bWidth gequ 18
NumEarths gequ 42
MAXIMAGES gequ 1 ; # of images that can be handled
debugSymbols gequ $BAD ; Put in debugging symbols ?
debugBreaks gequ $BAD ; Put in debugging breaks ?
*-----------------------------------------------------------------------------*
Large_Earth Start
kind $1000 ; no special memory
debug 'Large_Earth'
Using MainDATA
Using EarthDATA
copy :jim4:dya:twilight: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
bne notSupported
lda T2data1,s ; movePtr
sta MovePtr
lda T2data1+2,s
sta MovePtr+2
ldx #32-2
pal lda Earth2_Pal,x
sta $E19E00,x
dex
dex
bpl pal
~GetAddress #1
PullLong SLookUp
stz ShapeNum
jsr Animate
notSupported 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
*-----------------------------------------------------------------------------*
Animate Start
debug 'Animate'
Using MainDATA
lda #1
sta left_boundary init boundaries
sta xposition
lda #1
sta top_boundary
sta yposition
lda #160+bWidth-1
sta right_boundary
lda #200-1
sta bottom_boundary
lda #$2000
sta SHRPtr
lda SHADOW
bit #$08 ; bit 3 = 1 = inhibit SHR shadowing
bne bankE1
lda #$01
sta SHRPtr+2
sta HiRes+2
bra bankSet
bankE1 lda #$E1
sta SHRPtr+2
sta HiRes+2
bankSet anop
event_loopL8 anop
lda yposition
clc
adc image_height
lsr a
clc
adc #$80
sec ;it was getting stuck at shape_bottom
sbc #4 ; = $E1, so I subtract a few to move
sta shape_bottom ; it up. Why was it getting stuck?!
shortm
wait2 lda >VERTCNT
cmp shape_bottom
bne wait2
longm
jsr fixback
jsr DrawEarth
lda yposition
sta lasty
lda xposition
sta lastx
jsr move_images move all images
lda ShapeNum
inc a
cmp #NumEarths
bne keepIt
lda #0
keepIt sta ShapeNum
lda [MovePtr]
beq event_loopL8
rts
End
*-----------------------------------------------------------------------------*
! Apply velocities to all images to cause them to move.
! Bounce them off the motion boundaries as needed.
move_images Start
debug 'move_images'
Using MainDATA
lda xposition
clc
adc xvelocity
bmi Z1L9 way past left
cmp left_boundary
bge Z2L9 not on left edge
Z1L9 jsr invert_xvel else bounce it
lda left_boundary
bra Z2L9
Z2L9 pha
clc
adc image_width
cmp right_boundary
pla
blt Z3L9 not on right edge
jsr invert_xvel else bounce it
lda right_boundary
sec
sbc image_width
Z3L9 sta xposition
lda yposition
clc
adc yvelocity
bmi Z4L9 ;way above top
cmp top_boundary
bge Z5L9 ;below top edge
Z4L9 jsr invert_yvel ;else bounce it
lda top_boundary
bra Z6L9
Z5L9 pha
clc
adc image_height
cmp bottom_boundary
pla
blt Z6L9 ;above bottom edge
jsr invert_yvel ;else bounce it
lda bottom_boundary
sec
sbc image_height
Z6L9 sta yposition
rts
! Invert X velocity to give the illusion of a bounce.
invert_xvel lda xvelocity
eor #$ffff
inc a
sta xvelocity
rts
! Invert Y velocity to give the illusion of a bounce.
invert_yvel lda yvelocity
eor #$ffff
inc a
sta yvelocity
rts
End
*-----------------------------------------------------------------------------*
DrawEarth Start
debug 'drawEarth'
Using MainDATA
Using EarthDATA
longa on
longi on
stz image_index init an index into the shape data
lda yposition Y coord.. down!
sta y X coord.. across!
lda shapeNum
asl a x 2 to get shape number
tax
lda EarthTable,x shape data
sta fill2+1
lda image_height depth of shape
sta depth
yloop anop
lda image_wordwidth width (in words) of shape
sta width
lda y y = y coordinate
asl a multipy by 2 to get index into table
tay
lda [SLookUp],y get address from table
clc add x to base address
adc xposition x = horizontal position (in bytes)
sta HiRes
ldy #0 use Y as a horizontal offset
ldx image_index
xloop anop
fill2 lda |$0000,x get byte of shape
sta [HiRes],y
iny move over a word to the right
iny
inx increment index into shape's data
inx
dec width see if done with this line
bne xloop
stx image_index
inc y go to next line
dec depth see if done all lines
bne yloop
rts
End
*-----------------------------------------------------------------------------*
FixBack Start
debug 'fixBack'
Using MainDATA
longa on
longi on
lda lasty Y coord.. down!
sta YCoord X coord.. across!
lda image_height depth of shape
sta back_depth
yloop anop
lda #bWidth/2 width (in words) of shape
sta back_Width
lda YCoord y = y coordinate
asl a multipy by 2 to get index into table
tay
lda [SLookUp],y get address from table
clc add x to base address
adc lastx x = horizontal position (in bytes)
sec convert it into offset into SHR instead
sbc #$2000 of offset into bank E1
tay
lda #0
xloop anop
; lda [BackPtr],y get byte of shape
sta [SHRPtr],y
iny move over a word to the right
iny
dec back_width see if done with this line
bne xloop
inc YCoord go to next line
dec back_depth see if done all lines
bne yloop
rts
End
*-----------------------------------------------------------------------------*
MainDATA Data
earth2_pal ANOP
dc h'0000 000f 2300 3400 4500 5600'
dc h'6700 9a08 bb09 cd0a ee0c ff0f'
dc h'a000 8000 6000 4000'
number_of_images dc i'MAXIMAGES' # of images handled
image_index ds 2 loop index
! Motion boundaries (in pixels)
left_boundary ds 2
right_boundary ds 2
top_boundary ds 2
bottom_boundary ds 2
! Image arrays
xvelocity dc i'1'
yvelocity dc i'1'
xposition dc i'0'
yposition dc i'0'
image_width dc i'bWidth*2'
image_bytewidth dc i'bWidth'
image_wordwidth dc i'bWidth/2'
image_height dc i'32'
End
*-----------------------------------------------------------------------------*
copy e1.15

View File

@ -0,0 +1 @@
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 longm &lab ANOP rep #%00100000 longa on MEND MACRO &lab shortm &lab ANOP sep #%00100000 longa off 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 dbrk &num aif t:debugBreaks="G",.begin mexit .begin brk &num MEND macro &lab ~GetAddress &tableID &lab LongResult ph2 &tableID Tool $0904 mend macro &lab Tool &number &lab ldx #&number jsl $E10000 mend macro &lab LongResult &zeros &lab anop aif c:&zeros=1,.zeros phd phd mexit .zeros pea $0000 pea $0000 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",.ze oPageReg aif "&offset"="x",.zeroPageReg aif "&offset"="y",.zeroPageReg ldy #&offset lda &addr,y pha mexit .zeroPageReg lda &addr,&offset pha mend

View File

@ -0,0 +1,83 @@
#include "types.rez"
#include "22:t2common.rez"
resource rT2ModuleFlags (moduleFlags) {
fFadeOut+fFadeIn, // module flags word
$01, // enabled flag (unimplemented)
$0101, // minimum T2 version required
NIL, // reserved
"Earth" // module name
};
// --- About text resource
resource rTextForLETextBox2 (moduleMessage) {
TBLeftJust
TBBackColor TBColorF
TBForeColor TBColor4
"Earth"
TBForeColor TBColor1
" gives you a dazzling full-color view of the rotating earth, as it would"
" appear from outer space."
};
// --- Version resource
resource rVersion (moduleVersion) {
{ 1,0,1,alpha,1 }, // Version 1.0.1a1
verUS, // US Version
"T2 Earth Module", // program's name
"By J.Maricondo. Art by R&D Bagdadi.\n"
"Copyright 1991-4, Jim Maricondo." // copyright notice
};
// --- icon resource
resource rIcon (moduleIcon) {
$8000, // kind
$0014, // height
$001C, // width
$"FFF0000000000000000000000FFF"
$"FFF0FFFFFFFFFFFFFFFFFFFF0FFF"
$"FFF0F000000000000000000F0FFF"
$"FFF0F000000000001111100F0FFF"
$"FFF0F030000000081811880F0FFF"
$"FFF0F003000000088111180F0FFF"
$"FFF0F000300000081111110F0FFF"
$"FFF0F0300300F0018111110F0FFF"
$"FFF0F003000F00001111100F0FFF"
$"FFF0F00030F00F000000000F0FFF"
$"FFF0F0300F00F00F0000000F0FFF"
$"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,407 @@
*-----------------------------------------------------------------------------*
! Twilight II Large Bouncing Earth Module. !
! !
! By Jim Maricondo. !
! !
! v1.0 for Twilight II - 10/24/92 !
! v1.0.1 - 1/3/93 JRM
! !
! Copyright (c) 1991 Jim Maricondo. All rights reserved. !
*-----------------------------------------------------------------------------*
*****************************************************************
* Jim:
* This works fine on my system now. Try it on yours. I made a lot of little
* changes. First: You were getting 'trash' instead of a globe sometimes
* because you never initialized the variable ShapeNum, meaning that it
* sometimes started at about $Cxxx (the times I ran it trhough the debugger)
* which is a bit high when you only have 42 shapes. :) I added a stz ShapeNum
* right before the jsr Animate to fix that. Then, the bigger problem--you
* had the loop timed so that it would *-wait-draw-calculate-erase-goto*. For
* all but the top few lines, this meant that it would erase the shape, then
* wait, with it erased, then quickly draw and erase it again, then wait
* with it erased, etc. That is waht was giving you the banding. So, I moved
* the erase to right before the draw, like this: *-wait-erase-draw-calculate-
* goto*. This had the problem that there wasn't enough time in the VBL
* period to completely erase and redraw the thing--the band showed up on
* about the top 20 lines. So, to fix this, I changed the wait loop to loop
* on the VertCnt register ($E0C02E). I calculate where the bottom of the
* shape is, and wait until the gun has passed that line. Then I start drawing.
* As pointed out in TN IIGS #70, this gives you almost 1/30th of a second
* to draw the shape, which is plenty of time. Also, one personal observation:
* I think there's a little jerk in the ball. After it does a loop, it seems
* to skip a frame or some such.... Oh ya, one more thing: what was the point
* of grabbing a $7D00 hunk of memory, filling it wih zeros, then using dp
* long indexed to get a 0, when you could have just done one lda #0 and
* save yourself MANY cycles? It's not like you have a background to restore.
* :) I changed this, but left the old stuff there, just commented out.
* Enjoy!
* --Jonah
*
* ps. I'm adding this about 3 hours later: Don't ORA the master MemID
* with $0100. I load the file in with a MemID of x1xx or x2xx, so the
* ORA will do nothing, but the DisposeAll will be VERY uncool. Try $0A00
* instead.... :)
*****************************************************************
longa on
longi on
mcopy Earth.MAC
copy 22:t2common.equ
copy 22:dsdb.equ
keep earth.d
*-----------------------------------------------------------------------------*
MovePtr gequ <0
SLookUp gequ MovePtr+4
HiRes gequ SLookUp+4
Width gequ HiRes+4
Depth gequ Width+2
ShapeNum gequ Depth+2
y gequ ShapeNum+2
ztemp2 gequ y+2
BackPtr gequ ztemp2+4
lasty gequ BackPtr+4
lastx gequ lasty+2
YCoord gequ lastx+2
back_Width gequ YCoord+2
back_depth gequ back_width+2
SHRPtr gequ back_depth+2
shape_bottom gequ SHRPtr+4
bWidth gequ 18
NumEarths gequ 42
MAXIMAGES gequ 1 ; # of images that can be handled
debugSymbols gequ $BAD ; Put in debugging symbols ?
debugBreaks gequ $BAD ; Put in debugging breaks ?
*-----------------------------------------------------------------------------*
Large_Earth Start
kind $1000 ; no special memory
debug 'Large_Earth'
Using MainDATA
Using EarthDATA
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
bne notSupported
lda T2data1,s ; movePtr
sta MovePtr
lda T2data1+2,s
sta MovePtr+2
ldx #32-2
pal lda Earth2_Pal,x
sta $E19E00,x
dex
dex
bpl pal
~GetAddress #1
PullLong SLookUp
stz ShapeNum
jsr Animate
notSupported 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
*-----------------------------------------------------------------------------*
Animate Start
debug 'Animate'
Using MainDATA
lda #1
sta left_boundary init boundaries
sta xposition
lda #1
sta top_boundary
sta yposition
lda #160+bWidth-1
sta right_boundary
lda #200-1
sta bottom_boundary
lda #$2000
sta SHRPtr
shortm
lda SHADOW
longm
bit #$08 ; bit 3 = 1 = inhibit SHR shadowing
bne bankE1
lda #$01
sta SHRPtr+2
sta HiRes+2
bra bankSet
bankE1 lda #$E1
sta SHRPtr+2
sta HiRes+2
bankSet anop
event_loopL8 anop
lda yposition
clc
adc image_height
lsr a
clc
adc #$80
sec ;it was getting stuck at shape_bottom
sbc #4 ; = $E1, so I subtract a few to move
sta shape_bottom ; it up. Why was it getting stuck?!
shortm
wait2 lda >VERTCNT
cmp shape_bottom
bne wait2
longm
jsr fixback
jsr DrawEarth
lda yposition
sta lasty
lda xposition
sta lastx
jsr move_images move all images
lda ShapeNum
inc a
cmp #(NumEarths*2)
blt keepIt
lda #0
keepIt sta ShapeNum
lda [MovePtr]
beq event_loopL8
rts
End
*-----------------------------------------------------------------------------*
! Apply velocities to all images to cause them to move.
! Bounce them off the motion boundaries as needed.
move_images Start
debug 'move_images'
Using MainDATA
lda xposition
clc
adc xvelocity
bmi Z1L9 way past left
cmp left_boundary
bge Z2L9 not on left edge
Z1L9 jsr invert_xvel else bounce it
lda left_boundary
bra Z2L9
Z2L9 pha
clc
adc image_width
cmp right_boundary
pla
blt Z3L9 not on right edge
jsr invert_xvel else bounce it
lda right_boundary
sec
sbc image_width
Z3L9 sta xposition
lda yposition
clc
adc yvelocity
bmi Z4L9 ;way above top
cmp top_boundary
bge Z5L9 ;below top edge
Z4L9 jsr invert_yvel ;else bounce it
lda top_boundary
bra Z6L9
Z5L9 pha
clc
adc image_height
cmp bottom_boundary
pla
blt Z6L9 ;above bottom edge
jsr invert_yvel ;else bounce it
lda bottom_boundary
sec
sbc image_height
Z6L9 sta yposition
rts
! Invert X velocity to give the illusion of a bounce.
invert_xvel lda xvelocity
eor #$ffff
inc a
sta xvelocity
rts
! Invert Y velocity to give the illusion of a bounce.
invert_yvel lda yvelocity
eor #$ffff
inc a
sta yvelocity
rts
End
*-----------------------------------------------------------------------------*
DrawEarth Start
debug 'drawEarth'
Using MainDATA
Using EarthDATA
longa on
longi on
stz image_index init an index into the shape data
lda yposition Y coord.. down!
sta y X coord.. across!
lda shapeNum
and #$FFFE
; asl a x 2 to get shape number
tax
lda EarthTable,x shape data
sta fill2+1
lda image_height depth of shape
sta depth
yloop anop
lda image_wordwidth width (in words) of shape
sta width
lda y y = y coordinate
asl a multipy by 2 to get index into table
tay
lda [SLookUp],y get address from table
clc add x to base address
adc xposition x = horizontal position (in bytes)
sta HiRes
ldy #0 use Y as a horizontal offset
ldx image_index
xloop anop
fill2 lda |$0000,x get byte of shape
sta [HiRes],y
iny move over a word to the right
iny
inx increment index into shape's data
inx
dec width see if done with this line
bne xloop
stx image_index
inc y go to next line
dec depth see if done all lines
bne yloop
rts
End
*-----------------------------------------------------------------------------*
FixBack Start
debug 'fixBack'
Using MainDATA
longa on
longi on
lda lasty Y coord.. down!
sta YCoord X coord.. across!
lda image_height depth of shape
sta back_depth
yloop anop
lda #bWidth/2 width (in words) of shape
sta back_Width
lda YCoord y = y coordinate
asl a multiply by 2 to get index into table
tay
lda [SLookUp],y get address from table
clc add x to base address
adc lastx x = horizontal position (in bytes)
sec convert it into offset into SHR instead
sbc #$2000 of offset into bank E1
; tay
sta adr+1
brk
phb
lda SHRPtr
xba
pha
plb
plb
lda #0
xloop anop
; lda [BackPtr],y get byte of shape
adr sta |$0000,y
; sta [SHRPtr],y
iny move over a word to the right
iny
dec back_width see if done with this line
bne xloop
plb
inc YCoord go to next line
dec back_depth see if done all lines
bne yloop
rts
End
*-----------------------------------------------------------------------------*
MainDATA Data
earth2_pal ANOP
dc h'0000 000f 2300 3400 4500 5600'
dc h'6700 9a08 bb09 cd0a ee0c ff0f'
dc h'a000 8000 6000 4000'
number_of_images dc i'MAXIMAGES' # of images handled
image_index ds 2 loop index
! Motion boundaries (in pixels)
left_boundary ds 2
right_boundary ds 2
top_boundary ds 2
bottom_boundary ds 2
! Image arrays
xvelocity dc i'1'
yvelocity dc i'1'
xposition dc i'0'
yposition dc i'0'
image_width dc i'bWidth*2'
image_bytewidth dc i'bWidth'
image_wordwidth dc i'bWidth/2'
image_height dc i'32'
End
*-----------------------------------------------------------------------------*
copy e1.15

View File

@ -0,0 +1,440 @@
*-----------------------------------------------------------------------------*
! Twilight II Large Bouncing Earth Module. !
! !
! By Jim Maricondo. !
! !
! Copyright (c) 1991 Jim Maricondo. All rights reserved. !
*-----------------------------------------------------------------------------*
*****************************************************************
* Jim:
* This works fine on my system now. Try it on yours. I made a lot of little
* changes. First: You were getting 'trash' instead of a globe sometimes
* because you never initialized the variable ShapeNum, meaning that it
* sometimes started at about $Cxxx (the times I ran it trhough the debugger)
* which is a bit high when you only have 42 shapes. :) I added a stz ShapeNum
* right before the jsr Animate to fix that. Then, the bigger problem--you
* had the loop timed so that it would *-wait-draw-calculate-erase-goto*. For
* all but the top few lines, this meant that it would erase the shape, then
* wait, with it erased, then quickly draw and erase it again, then wait
* with it erased, etc. That is waht was giving you the banding. So, I moved
* the erase to right before the draw, like this: *-wait-erase-draw-calculate-
* goto*. This had the problem that there wasn't enough time in the VBL
* period to completely erase and redraw the thing--the band showed up on
* about the top 20 lines. So, to fix this, I changed the wait loop to loop
* on the VertCnt register ($E0C02E). I calculate where the bottom of the
* shape is, and wait until the gun has passed that line. Then I start drawing.
* As pointed out in TN IIGS #70, this gives you almost 1/30th of a second
* to draw the shape, which is plenty of time. Also, one personal observation:
* I think there's a little jerk in the ball. After it does a loop, it seems
* to skip a frame or some such.... Oh ya, one more thing: what was the point
* of grabbing a $7D00 hunk of memory, filling it wih zeros, then using dp
* long indexed to get a 0, when you could have just done one lda #0 and
* save yourself MANY cycles? It's not like you have a background to restore.
* :) I changed this, but left the old stuff there, just commented out.
* Enjoy!
* --Jonah
*
* ps. I'm adding this about 3 hours later: Don't ORA the master MemID
* with $0100. I load the file in with a MemID of x1xx or x2xx, so the
* ORA will do nothing, but the DisposeAll will be VERY uncool. Try $0A00
* instead.... :)
*****************************************************************
longa on
longi on
mcopy Earth2.MAC
*-----------------------------------------------------------------------------*
SLookUp gequ <0
MyID gequ SLookUp+4
MasterID gequ MyID+2
HiRes gequ MasterID+2
Width gequ HiRes+4
Depth gequ Width+2
ShapeNum gequ Depth+2
y gequ ShapeNum+2
bordercol gequ y+2
ztemp2 gequ bordercol+1
BackPtr gequ ztemp2+4
lasty gequ BackPtr+4
lastx gequ lasty+2
YCoord gequ lastx+2
back_Width gequ YCoord+2
back_depth gequ back_width+2
SHR gequ back_depth+2
shape_bottom gequ SHR+4
bWidth gequ 18
NumEarths gequ 42
CLOCKCTL gequ >$E0C034 border color / rtc register
VERTCNT gequ >$E0C02E
MAXIMAGES gequ 1 # of images that can be handled
*-----------------------------------------------------------------------------*
Large_Earth Start
Using MainDATA
Using EarthDATA
phb Store old data bank
phk
plb
shortm
lda CLOCKCTL save old border color and make border
pha color now black
and #$0F
sta bordercol
pla
and #$F0
sta CLOCKCTL
longm
lda #0
ldx #$8000-2
blank sta $E12000,x
dex
dex
bpl blank
ldx #32-2
pal lda Earth2_Pal,x
sta $E19E00,x
dex
dex
bpl pal
LongResult
PushWord #1
_GetAddress
PullLong SLookUp
DefineStack
oldBank byte
returnAddress block 3
MasterID word
MovePtr long
ourPathname long
lda MasterID,s
ora #$0A00
sta MyID
; LongResult allocate background memory
; PushLong #$7D00
; pei MyID
; PushWord #attrLocked+attrFixed+attrNoSpec+attrNoCross
; PushLong #0
; _NewHandle
; plx
; stx ztemp2
; plx
; stx ztemp2+2
;
; lda [ztemp2]
; sta BackPtr
; ldy #2
; lda [ztemp2],y
; sta BackPtr+2
;
; lda #0
; ldy #$7D00-2
;ero sta [BackPtr],y
; dey
; dey
; bpl zero
;
stz ShapeNum
jsr Animate
plb
lda 2,s
sta 2+10,s
lda 1,s
sta 1+10,s
tsc Remove input paramaters
clc
adc #10 (MasterID+MovePtr+OurPathname)
tcs
shortm restore users border color
lda CLOCKCTL
and #$F0
ora bordercol
sta CLOCKCTL
longmx
pei MyID
_DisposeAll
clc
rtl
End
*-----------------------------------------------------------------------------*
Animate Start
Using MainDATA
lda #1
sta left_boundary init boundaries
sta xposition
lda #1
sta top_boundary
sta yposition
lda #160+bWidth-1
sta right_boundary
lda #200-1
sta bottom_boundary
lda #$E1
sta HiRes+2
lda #$2000
sta SHR
lda #$E1
sta SHR+2
event_loopL8 anop
lda yposition
clc
adc image_height
lsr a
clc
adc #$80
sec ;it was getting stuck at shape_bottom
sbc #4 ; = $E1, so I subtract a few to move
sta shape_bottom ; it up. Why was it getting stuck?!
shortm
wait2 lda >VERTCNT
cmp shape_bottom
bne wait2
longm
jsr fixback
jsr DrawEarth
lda yposition
sta lasty
lda xposition
sta lastx
jsr move_images move all images
lda ShapeNum
inc a
cmp #NumEarths
bne keepIt
lda #0
keepIt sta ShapeNum
DefineStack
oldDirectPage word
rtsAddress word
oldBank byte
returnAddress block 3
MasterID word
MovePtr long
TextPtr long
phd
tsc
tcd
lda [MovePtr]
bne done
pld
bra event_loopL8
done anop
pld
rts
End
*-----------------------------------------------------------------------------*
! Apply velocities to all images to cause them to move.
! Bounce them off the motion boundaries as needed.
move_images Start
Using MainDATA
lda xposition
clc
adc xvelocity
bmi Z1L9 way past left
cmp left_boundary
bge Z2L9 not on left edge
Z1L9 jsr invert_xvel else bounce it
lda left_boundary
bra Z2L9
Z2L9 pha
clc
adc image_width
cmp right_boundary
pla
blt Z3L9 not on right edge
jsr invert_xvel else bounce it
lda right_boundary
sec
sbc image_width
Z3L9 sta xposition
lda yposition
clc
adc yvelocity
bmi Z4L9 ;way above top
cmp top_boundary
bge Z5L9 ;below top edge
Z4L9 jsr invert_yvel ;else bounce it
lda top_boundary
bra Z6L9
Z5L9 pha
clc
adc image_height
cmp bottom_boundary
pla
blt Z6L9 ;above bottom edge
jsr invert_yvel ;else bounce it
lda bottom_boundary
sec
sbc image_height
Z6L9 sta yposition
rts
! Invert X velocity to give the illusion of a bounce.
invert_xvel lda xvelocity
eor #$ffff
inc a
sta xvelocity
rts
! Invert Y velocity to give the illusion of a bounce.
invert_yvel lda yvelocity
eor #$ffff
inc a
sta yvelocity
rts
End
*-----------------------------------------------------------------------------*
DrawEarth Start
Using MainDATA
Using EarthDATA
longa on
longi on
stz image_index init an index into the shape data
lda yposition Y coord.. down!
sta y X coord.. across!
lda shapeNum
asl a x 2 to get shape number
tax
lda EarthTable,x shape data
sta fill2+1
lda image_height depth of shape
sta depth
yloop anop
lda image_wordwidth width (in words) of shape
sta width
lda y y = y coordinate
asl a multipy by 2 to get index into table
tay
lda [SLookUp],y get address from table
clc add x to base address
adc xposition x = horizontal position (in bytes)
sta HiRes
ldy #0 use Y as a horizontal offset
ldx image_index
xloop anop
fill2 lda |$0000,x get byte of shape
sta [HiRes],y
iny move over a word to the right
iny
inx increment index into shape's data
inx
dec width see if done with this line
bne xloop
stx image_index
inc y go to next line
dec depth see if done all lines
bne yloop
rts
End
*-----------------------------------------------------------------------------*
FixBack Start
Using MainDATA
longa on
longi on
lda lasty Y coord.. down!
sta YCoord X coord.. across!
lda image_height depth of shape
sta back_depth
yloop anop
lda #bWidth/2 width (in words) of shape
sta back_Width
lda YCoord y = y coordinate
asl a multipy by 2 to get index into table
tay
lda [SLookUp],y get address from table
clc add x to base address
adc lastx x = horizontal position (in bytes)
sec convert it into offset into SHR instead
sbc #$2000 of offset into bank E1
tay
lda #0
xloop anop
; lda [BackPtr],y get byte of shape
sta [SHR],y
iny move over a word to the right
iny
dec back_width see if done with this line
bne xloop
inc YCoord go to next line
dec back_depth see if done all lines
bne yloop
rts
End
*-----------------------------------------------------------------------------*
MainDATA Data
earth2_pal ANOP
dc h'0000 000f 2300 3400 4500 5600'
dc h'6700 9a08 bb09 cd0a ee0c ff0f'
dc h'a000 8000 6000 4000'
number_of_images dc i'MAXIMAGES' # of images handled
image_index ds 2 loop index
! Motion boundaries (in pixels)
left_boundary ds 2
right_boundary ds 2
top_boundary ds 2
bottom_boundary ds 2
! Image arrays
xvelocity dc i'1'
yvelocity dc i'1'
xposition dc i'0'
yposition dc i'0'
image_width dc i'bWidth*2'
image_bytewidth dc i'bWidth'
image_wordwidth dc i'bWidth/2'
image_height dc i'32'
End
*-----------------------------------------------------------------------------*
copy e1.15

View File

@ -0,0 +1,101 @@
#include "types.rez"
// --- Module name resource
resource rPString (0x1) {
"Bouncing Earth 2"
};
// --- About text resource
resource rTextForLETextBox2 ($0010DD01) {
"\$01"
"J"
"\$00"
"\$00"
"\$01"
"L"
"\$00"
"\$00"
"\$01"
"R"
"\$04"
"\$00"
"\$01"
"F"
"\$FE"
"\$FF"
"\$00"
"\$08"
"\$01"
"C"
"\$11"
"\$11"
"\$01"
"B"
"\$FF"
"\$FF"
"This module simulates a view of the earth from close distances in "
"outer space such as the moon."
};
// --- Version resource
resource rVersion (0x1) {
{ $1,$0,$1,final,$1 }, // Version 1.0.1f1
verUS, // US Version
"Twilight II Bouncing Earth 2 Module", // program's name
"By J. Maricondo. Art by R&D Bagdadi.\$0D"
"Copyright 1991 Jim Maricondo." // copyright notice
};
// --- About icon resource
resource rIcon ($0010DD01) {
$8000, // kind
$0014, // height
$001C, // width
$"FFF0000000000000000000000FFF"
$"FFF0FFFFFFFFFFFFFFFFFFFF0FFF"
$"FFF0F000000000000000000F0FFF"
$"FFF0F000000000001111100F0FFF"
$"FFF0F030000000081811880F0FFF"
$"FFF0F003000000088111180F0FFF"
$"FFF0F000300000081111110F0FFF"
$"FFF0F0300300F0018111110F0FFF"
$"FFF0F003000F00001111100F0FFF"
$"FFF0F00030F00F000000000F0FFF"
$"FFF0F0300F00F00F0000000F0FFF"
$"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,28 @@
# Twilight II Earth UNIX MakeFile
# by Jim Maricondo
# v1.0 - 10/24/92 2:14pm
# v1.1 - 1/3/92 3:15pm
# v1.1.1 - 1/9/93 1:17am
# First deal with all the dfork...
earth.d.root: earth.asm earth.mac e1.15 e16.30 e31.42 22/t2common.equ 22/dsdb.equ
compile +w earth.asm keep=earth.d
earth.d: earth.d.root
link +w earth.d keep=earth.d
# Now work with the rfork...
earth.r: earth.rez
compile earth.rez keep=earth.r
# Now put it together.
earth: earth.r earth.d
duplicate -d earth.d earth
duplicate -r earth.r earth
setfile -at $4004 -t $bc earth -m .
cp earth :jim1:system:cdevs:twilight:earth
22:beep

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,59 @@
!!!!! Quick note for people that never read the whole documentation file. Please feel free to edit the AmrHldHstg.Data file. I put that data in a separate text file so it would be easy for you to edit it. Have fun!!!!!
What is this business about America being help hostage?
As most of you probably already know, Rush Limbaugh is a very popular radio talk show host, best selling author (The Way Things Ought To be) and late night TV talk show host. You don't have to agree with his conservative views to enjoy the show. He does a great job of entertaining his audience by poking fun of the news events of the day.
Ever since the inauguration of Bill (and Hillary) Clinton, Rush has been providing special programming to cover this "crisis" situation. He starts every show (radio and TV) by announcing that "This is a special edition of the Rush Limbaugh Show. America Held Hostage". Rush then says that for the middle class this is day x of the crises. Thanks to retroactive taxes on the rich and the dead, this is day x+19 for the rich and the dead. And there are 1460-x days left in the crises for all of us. All of this is done in a fashion to more or less make fun of how the "dominate media culture" handles so called "crises" situations.
The America Held Hostage screen saver module for Twilight II displays the vital statistics about the America Held Hostage crises. Namely, the number of days we have endured the crises (for both the middle class and the rich & dead) and the number of days left.
Installation
To use the America Held Hostage screen saver, you need Twilight II. (WARNING! Here comes a blatant plug) If you don't have Twilight II you REALLY should get it. The retail price is only $39.95. That includes over 40 spectacular modules. It is available from Big Red Computer Club and Resource Central for as little as $29 + s/h. Contact Digisoft Innovation (the publisher) for more information.
Digisoft Innovations
PO Box 380
Trumbull, CT 06611
203/375-0837
(No, I wasn't paid to put that in there but I am paid every time some one buy Twilight II :) )
Once you have Twilight II installed in your system all you need to do to use America Held Hostage is copy the files AmrHldHstg and AmrHldHstg.Data into your Twilight folder.
This folder should be located at *:System:CDevs:Twilight. In other words, the Twilight Folder is in your CDevs folder which is in your System folder which is on your boot drive.
Once those two files are installed in your Twilight folder you can use AmericaHeldHostage just like any other Twilight II modules. Open Twilight II by select Twilight II from the Apple menu. Now select America Held Hstg from the list of modules and press the "Blank Now" button. That's all there is to it.
Customizing America Held Hostage
If you highlight America Held Hstg in the Twilight II window and click on setup will get a setup window for America Held Hostage. Here you can set what font is used to draw the America held Hostage title and the day counters. You can select any font you like in any size you like. Just don't pick something too big or it won't fit on the screen.
If you are a bit more ambitious you can customize America Held Hostage even further. The AmrHldHstg.Data file contains all the text that is used to label the day counters for the different categories. For example, rather than always saying "Day x for the middle class", you will sometimes see "Day x for Joe 6 pack" or "Day x for member of bowling leagues". These labels are pulled out of the AmrHldHstg.Data text file. You can add your own labels or edit the existing ones if you like. All you need is any application that can edit a text file. Teach is probably the easiest application to use but if you have EgoEd, ShadowWrite, BigEditThing, AppleWorks GS, AppleWorks Classic, or just about any other word processor you can use them as well.
Just double click on the AmrHldHstg.Data file and system 6 should launch teach and open the file. The file contains several lines of text in groups of 3. The first line in the group is the label for the middle class. The second line is the label for the rich and the dead. The third line is the label for everyone. Always add or remove lines in groups of three. When it is time to blank the screen, the module will pick at random one of the groups of lines and use it to label the day counters.
Depending on your system setup, Twilight II may load the AmrHldHstg.Data file at startup and keep it in memory all the time. This means that if you edit the file your changes will not take effect until the next time you reboot. Another way to get Twilight II to reload the file is simply open the Twilight II window and close it again.
About the Author (James C. Smith)
I have been writing Twilight II screen saver modules for almost a year and a half now. I wrote several of the modules included with Twilight II. I am most proud of Fireworks, Cyclone, Plasma, Headlines, Snow, Mountains, String Art, Life, and Fading Clock. I also did several simpler modules including Inverter, Scroll, Scanner, Twilight, TunnelVision II, Drip Drop, Color By Color, and Short Out.
ShareWare?
Well, let's put it this way, if you want to send me a defecate awareness ribbon (made of any denomination) it would be GREATLY appreciated. I made one for my self but I neaded the buck and spend it. :( If you can't afford to send one you could at least drop me a line to let me know you like and use America Held Hostage. If I get a good response from this modules I may release some other Rush related modules. Suggestions are welcome. You can reach me at
James C. Smith
4117 North 84th st.
Milwaukee, WI 53222
414/466-2506
E-Mail address
JamesSWI on America Online or if you have access to the internet you can reach that mail box as
JamesSWI@aol.com

View File

@ -0,0 +1,123 @@
/*
** ColorByColor for T2 by James C. Smith
*/
#pragma keep "ClrByClr"
#pragma cdev ColorByColor
#pragma optimize 0
#pragma debug 0
#include "T2f.H"
#include "Random3.h"
#include <string.h>
#include <memory.h>
#include <locator.h>
#pragma lint 0
pascal LongWord TickCount() inline(0x1006,dispatcher);
pascal void SysBeep() inline(0x2C03,dispatcher);
int i,i2;
Long OldTick=0, TmpTick;
Word *movePtr;
char ColorOrder[16], TempC;
int DemoMode;
void Wait(int);
void Wait(int WaitLength)
{
TmpTick=OldTick;
while((OldTick=TickCount())<=TmpTick+WaitLength);
}
struct getInfoOut T2Info={0,0,0xE};
int temp;
int NumColors, MinPal, NumMinPal;
LongWord BlankT2ColorByColor(void)
{
int TableNumber, Brightness;
word *Colors;
Colors=(void *) 0xE19E00ul;
if( (*((char *) 0xE19D00ul)) & 0x80)
{
NumColors=4;
NumMinPal=4;
} else {
NumColors=16;
NumMinPal=1;
}
init_random(toT2Str);
set_random_seed();
SendRequest(t2GetInfo, stopAfterOne+sendToName, (longword) toT2Str, 0, (void *) &T2Info);
/*Built a table of color table numbers */
for(i=0; i<16; i++)
ColorOrder[i]=i;
/* randomize the table */
for(i=0; i<NumColors; i++)
{
i2=random() % NumColors;
TempC=ColorOrder[i];
ColorOrder[i]=ColorOrder[i2];
ColorOrder[i2]=TempC;
}
/* Set fade all colors to black in ColorOrder[] order */
for(i=0; (i<NumColors) && (!(*movePtr)); i++)
{
for(Brightness=15; Brightness >=0; Brightness--)
{
for(MinPal=0; MinPal< NumMinPal; MinPal++)
{
for(TableNumber=0; TableNumber<16; TableNumber++)
{
temp=ColorOrder[i]+(MinPal<<2)+(TableNumber<<4);
Colors[temp]=(((Colors[temp] & 0x0F) * Brightness)>>4) |
((((Colors[temp] & 0xF0) * Brightness)>>4) & 0xF0) |
((((Colors[temp] & 0xF00) * Brightness)>>4) & 0xF00);
}
} /* end NinPall */
Wait(1);
}
}
if((T2Info.count_selected_modules < 2) || DemoMode)
{
while (!(*movePtr)); /* wait until the movePtr becomes true */
}
if(*movePtr)
return (LongWord) bmrFadeIn;
else
return (LongWord) bmrNextModule;
}
LongWord ColorByColor(LongWord data2, LongWord data1, Word message)
{
LongWord Result = 0L;
switch (message)
{
case BlankT2:
DemoMode=data2 & bmiBlankNow;
movePtr=(Word *) data1;
Result = BlankT2ColorByColor ();
break;
case MakeT2:
case SaveT2:
case LoadSetupT2:
case UnloadSetupT2:
case KillT2:
case HitT2:
break;
}
return Result;
}

View File

@ -0,0 +1,164 @@
#pragma keep "Compile.HLs"
#include <stdio.h>
#include <string.h>
#define MaxSubsPerKeyWord 256
#define MaxKeyWordLength 32
#define MaxNumKeyWords 256
#define MaxLineLength 256
/* first pass
** build table of all key words that are DEFINED and count the number substitutions for each key word
**
**
** second pass
** skip space for header on output file
** skip space for poniters to substitutions
** write first substitution replacing key word references with key word opcode numbers
** fill in poniter to first word
** do next text substitution
** do next key word
** write header pointers
*/
typedef unsigned int FileAddress;
FILE *SourceFile, *CompiledFile;
struct {
char KeyWord[MaxKeyWordLength];
int NumberOfSubstitutions;
FileAddress Location; /* of list of substitutions in output file */
} SymboleTable[MaxNumKeyWords];
int NumKeyWords;
FileAddress SubstitutionList[MaxSubsPerKeyWord];
int NumSubstitutions;
char work[MaxLineLength];
void Pass1(void);
void Pass2(void);
void MyRead(void);
int Find(char *, int);
void main(void)
{
printf("Opening files...\n");
SourceFile=fopen("Headlines.Src", "r");
CompiledFile=fopen("Headlines.DATA", "wb");
fputs("Headlines data file version 1.00\n", CompiledFile);
printf("Pass 1...\n");
Pass1();
printf("Pass 2...\n");
Pass2();
printf("Closing files...\n");
fclose(SourceFile);
fclose(CompiledFile);
printf("Done\n");
}
void Pass1(void)
{
NumKeyWords=0;
do{
do{
MyRead();
if(feof(SourceFile))
break;
} while (work[0] != '#'); /* read lines untill you find one starting with a key word marker */
if(feof(SourceFile))
break;
NumKeyWords++;
strcpy(SymboleTable[NumKeyWords-1].KeyWord, work+1);
printf("%d Key Word:%s...", NumKeyWords-1, work+1);
do{
MyRead();
if(work[0])
SymboleTable[NumKeyWords-1].NumberOfSubstitutions++;
} while (work[0]); /* read lines untill you find a blank one */
printf("has %d substitutions.\n", SymboleTable[NumKeyWords-1].NumberOfSubstitutions);
} while (!feof(SourceFile));
}
void Pass2(void)
{
FileAddress LocKeyWord, LocSubText;
int SubNumber, KeyWordNumber=-1;
int KeyWordPos, KeyWordEndPos, KeyWordLength, SearchStart, tmp;
fseek(SourceFile, 0, SEEK_SET);
LocKeyWord=50 + NumKeyWords*(2+ (sizeof (FileAddress)));
do{
do{
MyRead();
if(feof(SourceFile))
break;
} while (work[0] != '#'); /* read lines untill you find one starting with a key word marker */
if(feof(SourceFile))
break;
KeyWordNumber++;
SymboleTable[KeyWordNumber].Location=LocKeyWord;
LocSubText=LocKeyWord+(SymboleTable[KeyWordNumber].NumberOfSubstitutions*(sizeof (FileAddress)));
SubNumber=-1;
fseek(CompiledFile, LocSubText, SEEK_SET);
printf("Key Word:%s\n", work+1);
do{
MyRead();
if(work[0]) {
SubNumber++;
/* replace any key words with key word opcodes */
SearchStart=0;
while(-1 != (tmp=(strpos(work+SearchStart, '<'))))
{
KeyWordPos=tmp+SearchStart;
SearchStart=KeyWordPos+2;
work[KeyWordPos]=0xFF; /* replace the < with a key word flag */
work[KeyWordPos+1]=
(char) Find(work+KeyWordPos+1, KeyWordLength=strpos(work+KeyWordPos+1, '>'));
(work[KeyWordPos+1])+=32;
KeyWordEndPos=KeyWordPos+1+KeyWordLength;
if(strlen(work)>KeyWordEndPos)
memmove(work+KeyWordPos+2, work+KeyWordEndPos+1, strlen(work)-KeyWordEndPos);
}
fputs(work, CompiledFile);
fputc('\n', CompiledFile);
SubstitutionList[SubNumber]=LocSubText;
LocSubText+=strlen(work)+1;
}
} while (work[0]); /* read lines untill you find a blank one */
fseek(CompiledFile, LocKeyWord, SEEK_SET); /* get into position to write aray of pointers to substitution text */
fwrite(SubstitutionList, sizeof (FileAddress), SubNumber+1, CompiledFile);
LocKeyWord=LocSubText;
} while (!feof(SourceFile));
fseek(CompiledFile, 50, SEEK_SET); /* get into position to write master header */
for(KeyWordNumber=0; KeyWordNumber<NumKeyWords; KeyWordNumber++)
{
fwrite(&SymboleTable[KeyWordNumber].NumberOfSubstitutions, 2+(sizeof (FileAddress)), 1, CompiledFile);
}
}
void MyRead(void)
{
fgets(work, sizeof work, SourceFile);
work[strlen(work)-1]=0;
}
char FindWork[MaxKeyWordLength];
int Find(char *Text, int Length)
{
int i;
memcpy(FindWork, Text, Length);
FindWork[Length]=0;
for(i=0; i<NumKeyWords; i++)
if(strcmp(FindWork, SymboleTable[i].KeyWord)==0)
return i;
printf("Key word \x22%s\x22 not found!\n\x07", FindWork);
return 0;
}

View File

@ -0,0 +1,594 @@
/*
** Cyclone for T2 by James C. Smith
*/
/*
** speed (pixels moved/frame)
*/
#pragma keep "Cyclone"
#pragma cdev Cyclone
#pragma optimize -1
#pragma debug 0
#include "T2.H"
#include "Random3.H"
#include <stdlib.h>
#include <quickdraw.h>
#include <control.h>
#include <resources.h>
#include <string.h>
#include <memory.h>
#pragma lint 0
#define MaxNumLines 90
#define NumX 320
#define NumY 200
#define ControlList 0x00001003l
#define ShapePopup 0x00000001l
#define LengthPopup 0x00000002l
#define ColorPopup 0x00000003l
#define IconControl 0x00000004l
#define WidthPopup 0x00000005l
#define PresetShapes 0x00000006l
#define HorizontalPopup 0x00000007l
#define VerticalPopup 0x00000008l
#define ShapeMenu 0x00000001l
#define LengthMenu 0x00000002l
#define ColorMenu 0x00000003l
#define RandomShape 0x00000001l
#define LineShape 0x00000002l
#define VShape 0x00000003l
#define XShape 0x00000004l
#define OvalShape 0x00000005l
#define FilledOvalShape 0x00000006l
#define RectShape 0x00000007l
#define FilledRectShape 0x00000008l
#define RRectShape 0x00000009l
#define FilledRRectShape 0x0000000Al
#define Sliding 0x00000000l
#define Reds 0x00000001l
#define Blues 0x00000002l
#define Greens 0x00000003l
#define DefaultColor 0x00000004l
#define Earthtone 0x00000005l
#define Rainbow 0x00000006l
#define Pastels 0x00000007l
#define ZShape 0x0000000Bl
#define Diamond 0x0000000Cl
pascal LongWord TickCount() inline(0x1006,dispatcher);
pascal void SysBeep() inline(0x2C03,dispatcher);
LongWord MakeT2Cyclone(void);
void LoadSetupT2Cyclone(void);
void SaveConfigResource(char *, word);
word LoadConfigResource(char *, word);
LongWord HitT2Cyclone(LongWord);
void SaveT2Cyclone(void);
void DrawShape(int,int,int,int);
word OptionWord;
int i, DrawNumber, EraseNumber, X1Hist[MaxNumLines], X2Hist[MaxNumLines], Color;
int Y1Hist[MaxNumLines], Y2Hist[MaxNumLines], X1V, X2V, Y1V, Y2V, X1, X2, Y1, Y2;
int Colors[16], Colors2[16], ColorCount, FirstTime;
int SlideColor, SlideDirection, SlideCounter, SlideMask;
int RectAry[4];
Word *movePtr;
unsigned int ConfigShape, ConfigLength, ConfigColor, ConfigWidth, ActLength, HM, VM, ConfigPreset, IsPreset, LastPreset;
char *ConfigNameString="\pCyclone Config";
Long OldTick=0, TmpTick, CheckIn;
word DefColors[]=
{0x0000,0x0535,0x0A62,0x0831,0x0611,0x0742,0x0762,0x0783,0x0694,0x0395,0x0168,0x0108,0x0617,0x0624,0x0CA2,0x0CA2,\
0x0000,0x0B22,0x0F00,0x0F70,0x0FF0,0x07F0,0x00C3,0x00A6,0x00FF,0x007F,0x000F,0x070F,0x0F0F,0x0F07,0x0A1E,0x0A1E,\
0x0000,0x004A,0x018E,0x06C9,0x00DF,0x0FE6,0x0FC9,0x0F9D,0x0D9F,0x0BFC,0x0FF9,0x0FCD,0x0DCF,0x06C9,0x0FE6,0x0FE6};
Word SetupFileNumber;
GrafPortPtr SetupWindow;
int min(int a, int b)
{
if (a<b) return (a);
else return(b);
}
int max(int a, int b)
{
if (a>b) return (a);
else return(b);
}
void DrawShape(int LX1, int LY1, int LX2, int LY2)
{
RectAry[0]=min(LY1,LY2)-5;
RectAry[1]=min(LX1,LX2)-5;
RectAry[2]=max(LY2,LY1)+5;
RectAry[3]=max(LX2,LX1)+5;
switch (ConfigShape)
{
case LineShape:
MoveTo(LX1,LY1);
LineTo(LX2,LY2);
break;
case VShape:
MoveTo(LX1,LY1);
LineTo((LX1+LX2)>>1, LY2);
LineTo(LX2,LY1);
break;
case XShape:
MoveTo(LX1,LY1);
LineTo(LX2,LY2);
MoveTo(LX2,LY1);
LineTo(LX1,LY2);
break;
case OvalShape:
FrameOval((Rect *) &RectAry);
break;
case FilledOvalShape:
PaintOval((Rect *) &RectAry);
break;
case RectShape:
FrameRect((Rect *)&RectAry);
break;
case FilledRectShape:
PaintRect((Rect *) &RectAry);
break;
case RRectShape:
FrameRRect((Rect *) &RectAry,25,25);
break;
case FilledRRectShape:
PaintRRect((Rect *) &RectAry,15,15);
break;
case ZShape:
MoveTo(LX1,LY1);
LineTo(LX2,(LY1+LY2)>>1);
LineTo(LX1,(LY1+LY2)>>1);
LineTo(LX2,LY2);
break;
case Diamond:
MoveTo((LX1+LX2)>>1,LY1);
LineTo(LX2,(LY1+LY2)>>1);
LineTo((LX1+LX2)>>1,LY2);
LineTo(LX1,(LY1+LY2)>>1);
LineTo((LX1+LX2)>>1,LY1);
break;
} /* end switch shape */
} /* end draw shape function */
LongWord BlankT2Cyclone(void)
{
CheckIn=0;
FirstTime=1;
ColorCount=0;
Color=15;
SlideCounter=1;
init_random(toT2Str);
set_random_seed();
if(ConfigLength==1)
ActLength=0;
else
ActLength=(ConfigLength-1)*15;
SetPenMode(modeCopy);
SetPenSize(ConfigWidth+1, ConfigWidth+1);
switch(ConfigColor) {
case Sliding:
case Blues:
for(i=0; i<16; i++) Colors2[i]=i;
break;
case Greens:
for(i=0; i<16; i++) Colors2[i]=i<<4;
break;
case Reds:
for(i=0; i<16; i++) Colors2[i]=i<<8;
break;
case DefaultColor:
InitColorTable(Colors2);
break;
case Earthtone:
memcpy(Colors2, DefColors, 32);
break;
case Rainbow:
memcpy(Colors2, &DefColors[16], 32);
break;
case Pastels:
memcpy(Colors2, &DefColors[32], 32);
break;
} /* end switch ConfigColor */
SetColorTable(0, Colors2);
X1V=(random() % 3)+3;
Y1V=(random() % 3)+3;
do X2V=(random() % 3)+3; while (X2V == X1V);
do Y2V=(random() % 3)+3; while (Y2V == Y1V);
DrawNumber=max(0,ActLength-1);
EraseNumber=0;
X1=X1Hist[DrawNumber]=(random() % (NumX-30))+15;
Y1=Y1Hist[DrawNumber]=(random() % (NumY-30))+15;
X2=X2Hist[DrawNumber]=(random() % (NumX-30))+15;
Y2=Y2Hist[DrawNumber]=(random() % (NumY-30))+15;
if(ConfigShape==RandomShape)
ConfigShape=(random() % 11) +2;
while (!(*movePtr)) /* Animate the screen until the movePtr becomes true */
{
if(ColorCount > 0) {
ColorCount=0;
Color++;
if(Color > 15)
Color=1;
if(ConfigColor==Sliding){
if(SlideCounter==1){ /* pick new color to slide and */
do {
SlideColor=(random()% 3) <<2; /* determin the direction to slide in */
SlideMask= 0x0F << SlideColor;
if(Colors2[15] & SlideMask) SlideDirection=0;
else SlideDirection=1;
} while((Colors2[15] ^ SlideMask)==0);
}
for(i=SlideCounter; i < 16; i++) /* slide the color */
if (SlideDirection) Colors2[i]+= 1<<SlideColor;
else Colors2[i]-= 1<<SlideColor;
SlideCounter++;
if(SlideCounter>15)
SlideCounter=1;
} /* end if slifing colors */
memcpy(&Colors[1], &Colors2[16-Color], (long) Color<<1); /* cycle colors */
if (Color<15) memcpy(&Colors[Color+1], &Colors2[1], (long) (15-Color)<<1);
if(CheckIn) {
TmpTick=OldTick;
while((OldTick=TickCount())==TmpTick);
CheckIn=0;
} else
CheckIn++;
SetColorTable(0, Colors);
}
ColorCount++;
SetSolidPenPat(Color);
/*X1=X1Hist[DrawNumber];
Y1=Y1Hist[DrawNumber];
X2=X2Hist[DrawNumber];
Y2=Y2Hist[DrawNumber]; */
DrawShape(X1,Y1,X2,Y2);
if(HM) DrawShape(NumX-X1,Y1,NumX-X2,Y2);
if (VM) DrawShape(X1,NumY-Y1,X2,NumY-Y2);
if (VM && HM) DrawShape(NumX-X1,NumY-Y1,NumX-X2,NumY-Y2);
if(ActLength) {
SetSolidPenPat(0);
if(EraseNumber+1>=ActLength)
FirstTime=0;
if(!FirstTime){
DrawShape(X1Hist[EraseNumber],Y1Hist[EraseNumber],X2Hist[EraseNumber],Y2Hist[EraseNumber]);
if(HM)DrawShape(NumX-X1Hist[EraseNumber],Y1Hist[EraseNumber],NumX-X2Hist[EraseNumber],Y2Hist[EraseNumber]);
if(VM)DrawShape(X1Hist[EraseNumber],NumY-Y1Hist[EraseNumber],X2Hist[EraseNumber],NumY-Y2Hist[EraseNumber]);
if(VM && HM)DrawShape(NumX-X1Hist[EraseNumber],NumY-Y1Hist[EraseNumber],NumX-X2Hist[EraseNumber],NumY-Y2Hist[EraseNumber]);
}
DrawNumber++;
if(DrawNumber >= ActLength)
DrawNumber=0;
EraseNumber++;
if(EraseNumber >= ActLength)
EraseNumber=0;
}
X1+=X1V;
Y1+=Y1V;
X2+=X2V;
Y2+=Y2V;
if(X1 < 5 || X1 > NumX-1)
X1V=-X1V;
if(Y1 < 5 || Y1 > NumY-1)
Y1V=-Y1V;
if(X2 < 5 || X2 > NumX-1)
X2V=-X2V;
if(Y2 < 5 || Y2 > NumY-1)
Y2V=-Y2V;
if(ActLength) {
X1Hist[DrawNumber]=X1;
Y1Hist[DrawNumber]=Y1;
X2Hist[DrawNumber]=X2;
Y2Hist[DrawNumber]=Y2;
}
}
ClearScreen (0);
return (LongWord) NULL;
}
void SaveT2Cyclone(void)
{
Word FileNumber;
/* Save current resource file and switch in Twilight.Setup */
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
/* Save control values */
ConfigShape = GetCtlValue (GetCtlHandleFromID (SetupWindow, ShapePopup));
ConfigLength = GetCtlValue (GetCtlHandleFromID (SetupWindow, LengthPopup));
ConfigColor = GetCtlValue (GetCtlHandleFromID (SetupWindow, ColorPopup))-1;
ConfigWidth = GetCtlValue (GetCtlHandleFromID (SetupWindow, WidthPopup))-1;
HM = GetCtlValue (GetCtlHandleFromID (SetupWindow, HorizontalPopup));
VM = GetCtlValue (GetCtlHandleFromID (SetupWindow, VerticalPopup));
OptionWord=(IsPreset<<15) | (ConfigWidth<<12) | (ConfigShape << 8) | (VM<<7) | (ConfigLength << 4) | (HM<<3) | ConfigColor;
SaveConfigResource(ConfigNameString, OptionWord);
/*****************************/
/* Restore old resource file */
/*****************************/
SetCurResourceFile (FileNumber);
}
LongWord HitT2Cyclone(LongWord ControlHit)
{
LongWord EnableFlag = 0L;
if (ControlHit == ShapePopup) {
ConfigShape = GetCtlValue (GetCtlHandleFromID (SetupWindow, ShapePopup));
EnableFlag = 1L; }
if (ControlHit == LengthPopup) {
ConfigLength = GetCtlValue (GetCtlHandleFromID (SetupWindow, LengthPopup));
EnableFlag = 1L; }
if (ControlHit == ColorPopup) {
ConfigColor = GetCtlValue (GetCtlHandleFromID (SetupWindow, ColorPopup))-1;
EnableFlag = 1L; }
if (ControlHit == WidthPopup) {
ConfigWidth = GetCtlValue (GetCtlHandleFromID (SetupWindow, WidthPopup))-1;
EnableFlag = 1L; }
if (ControlHit == HorizontalPopup) {
HM = GetCtlValue (GetCtlHandleFromID (SetupWindow, HorizontalPopup));
EnableFlag = 1L; }
if (ControlHit == VerticalPopup) {
VM = GetCtlValue (GetCtlHandleFromID (SetupWindow, VerticalPopup));
EnableFlag = 1L; }
if(EnableFlag && ConfigPreset!=1) {
SetCtlValue (1, GetCtlHandleFromID (SetupWindow, PresetShapes));
IsPreset=0;
ConfigPreset=1;
}
OptionWord= (ConfigWidth<<12) | (ConfigShape << 8) | (VM<<7) | (ConfigLength << 4) | (HM<<3) | ConfigColor;
if (ControlHit == PresetShapes) {
EnableFlag = 1L;
ConfigPreset=OptionWord = GetCtlValue (GetCtlHandleFromID (SetupWindow, PresetShapes));
LastPreset=OptionWord;
IsPreset=1;
if(OptionWord != 1){
ConfigWidth = (OptionWord & 0xF000) >> 12;
ConfigShape = (OptionWord & 0x0F00) >> 8;
ConfigLength = (OptionWord & 0x0070) >> 4;
ConfigColor = OptionWord & 0x0007;
VM = (OptionWord & 0x0080) >> 7;
HM = (OptionWord & 0x0008) >> 3;
SetCtlValue (ConfigShape, GetCtlHandleFromID (SetupWindow, ShapePopup));
SetCtlValue (ConfigLength, GetCtlHandleFromID (SetupWindow, LengthPopup));
SetCtlValue (ConfigColor+1, GetCtlHandleFromID (SetupWindow, ColorPopup));
SetCtlValue (ConfigWidth+1, GetCtlHandleFromID (SetupWindow, WidthPopup));
SetCtlValue (HM, GetCtlHandleFromID (SetupWindow, HorizontalPopup));
SetCtlValue (VM, GetCtlHandleFromID (SetupWindow, VerticalPopup));
}
}
if(LastPreset==OptionWord && ConfigPreset==1){
IsPreset=1;
ConfigPreset=LastPreset;
SetCtlValue (LastPreset, GetCtlHandleFromID (SetupWindow, PresetShapes));
}
return EnableFlag;
}
/*****************************************************************************\
|* *|
|* LoadConfigResource- (updated) *|
|* 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;
struct {
word Type;
Long ID;
} HandleInfo;
/**************************************/
/* 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;
}
/*****************************************************************************\
|* *|
|* 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, NULL);
**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);
/*DisposeHandle (ConfigData); */
}
}
LongWord MakeT2Cyclone (void)
{
CtlRecHndl junk;
Word FileNumber;
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
LoadSetupT2Cyclone();
SetCurResourceFile (FileNumber);
junk=NewControl2(SetupWindow, resourceToResource, (long) ControlList);
SetCtlValue (ConfigShape, GetCtlHandleFromID (SetupWindow, ShapePopup));
SetCtlValue (ConfigLength, GetCtlHandleFromID (SetupWindow, LengthPopup));
SetCtlValue (ConfigColor+1, GetCtlHandleFromID (SetupWindow, ColorPopup));
SetCtlValue (ConfigWidth+1, GetCtlHandleFromID (SetupWindow, WidthPopup));
SetCtlValue (HM, GetCtlHandleFromID (SetupWindow, HorizontalPopup));
SetCtlValue (VM, GetCtlHandleFromID (SetupWindow, VerticalPopup));
if(IsPreset) {
SetCtlValue (OptionWord & 0x7FFF, GetCtlHandleFromID (SetupWindow, PresetShapes));
LastPreset=ConfigPreset=OptionWord & 0x7FFF;;
}else {
SetCtlValue (1, GetCtlHandleFromID (SetupWindow, PresetShapes));
ConfigPreset=1;
LastPreset=0;
}
return 0x0Al;
}
void LoadSetupT2Cyclone(void)
{
/* Option word format
** 0x8000 = IsPreset
** 0x7000 = Width
** 0x0F00 = Shape
** 0X0080 = VerticalMirror
** 0x0070 = Length
** 0X0008 = HorizontalMirror
** 0x0007 = Color
*/
OptionWord = LoadConfigResource (ConfigNameString, 0x9610);
IsPreset = (OptionWord & 0x8000) >> 15;
ConfigWidth = (OptionWord & 0x7000) >> 12;
ConfigShape = (OptionWord & 0x0F00) >> 8;
ConfigLength = (OptionWord & 0x0070) >> 4;
ConfigColor = OptionWord & 0x0007;
VM = (OptionWord & 0x0080) >> 7;
HM = (OptionWord & 0x0008) >> 3;
}
LongWord Cyclone(LongWord data2, LongWord data1, Word message)
{
LongWord Result = 0L;
switch (message)
{
case MakeT2:
SetupWindow = (GrafPortPtr) data1;
SetupFileNumber = (Word) data2;
Result = MakeT2Cyclone ();
break;
case BlankT2:
movePtr=(Word *) data1;
Result = BlankT2Cyclone ();
break;
case SaveT2:
SaveT2Cyclone();
break;
case LoadSetupT2:
LoadSetupT2Cyclone();
break;
case UnloadSetupT2:
break;
case KillT2:
break;
case HitT2:
Result = HitT2Cyclone(data2);
break;
}
return Result;
}

View File

@ -0,0 +1,96 @@
#pragma keep "Dither"
#pragma optimize -2
#pragma debug 0
#include <Types.h>
#define NumColors 7 /* number of colors we can access from our custom color palette */
#define NumShades 11 /* number of shades we can derive from each color */
typedef longword Pattern2 [8]; /* this is another, more convenient way of representing QuickDraw's Pattern data structure */
Pattern2 ditherColor [NumColors][NumShades]; /* the array of dithered colors with shades per color */
/* SetPenPat (&ditherColor [color][shade]); */ /* here we set the dithered color indexed by the shade and color */
/* Sets my patterns. Note array format: ditherColor [color, shade, pattern]. */
void SetCustomDitherColorPatterns (void)
{
integer i, c, s, p;
ditherColor[0][0][0] = 0x00000000; /* 0% mixture */
ditherColor[0][0][1] = 0x00000000;
ditherColor[0][0][2] = 0x00000000;
ditherColor[0][0][3] = 0x00000000;
ditherColor[0][0][4] = 0x00000000;
ditherColor[0][0][5] = 0x00000000;
ditherColor[0][0][6] = 0x00000000;
ditherColor[0][0][7] = 0x00000000;
ditherColor[0][1][0] = 0x00100000; /* 6.25% mixture */
ditherColor[0][1][1] = 0x00000000;
ditherColor[0][1][2] = 0x00000010;
ditherColor[0][1][3] = 0x00000000;
ditherColor[0][1][4] = 0x10000000;
ditherColor[0][1][5] = 0x00000000;
ditherColor[0][1][6] = 0x00001000;
ditherColor[0][1][7] = 0x00000000;
ditherColor[0][2][0] = 0x10000000; /* 12.5% mixture */
ditherColor[0][2][1] = 0x00001000;
ditherColor[0][2][2] = 0x00100000;
ditherColor[0][2][3] = 0x00000010;
ditherColor[0][2][4] = 0x10000000;
ditherColor[0][2][5] = 0x00001000;
ditherColor[0][2][6] = 0x00100000;
ditherColor[0][2][7] = 0x00000010;
ditherColor[0][3][0] = 0x10001000; /* 25% mixture */
ditherColor[0][3][1] = 0x00100010;
ditherColor[0][3][2] = 0x01000100;
ditherColor[0][3][3] = 0x00010001;
ditherColor[0][3][4] = 0x10001000;
ditherColor[0][3][5] = 0x00100010;
ditherColor[0][3][6] = 0x01000100;
ditherColor[0][3][7] = 0x00010001;
ditherColor[0][4][0] = 0x10001000; /* 37.5% mixture */
ditherColor[0][4][1] = 0x01010101;
ditherColor[0][4][2] = 0x00100010;
ditherColor[0][4][3] = 0x01010101;
ditherColor[0][4][4] = 0x10001000;
ditherColor[0][4][5] = 0x01010101;
ditherColor[0][4][6] = 0x00100010;
ditherColor[0][4][7] = 0x01010101;
ditherColor[0][5][0] = 0x10101010; /* 50% mixture */
ditherColor[0][5][1] = 0x01010101;
ditherColor[0][5][2] = 0x10101010;
ditherColor[0][5][3] = 0x01010101;
ditherColor[0][5][4] = 0x10101010;
ditherColor[0][5][5] = 0x01010101;
ditherColor[0][5][6] = 0x10101010;
ditherColor[0][5][7] = 0x01010101;
/* Create 62.5%, 75%, 87.5%, 93.75%, and 100% mixtures by inverting
the first 5 mixtures: */
for (s = 6, i = 4; s < NumShades; s++, i--)
for (p = 0; p < 8; p++)
ditherColor[0][s][p] = 0x11111111 - ditherColor[0][i][p];
/* Now with the first dithered color semi-complete, use it as a template
to generate the rest of the dithered colors' shades: */
for (c = 1; c < NumColors; c++)
for (s = 0; s < NumShades; s++)
for (p = 0; p < 8; p++)
ditherColor[c][s][p] = (0x11111111 - ditherColor[0][s][p]) * ( ((c+1) * 2)-1 ) +
( ditherColor[0][s][p] * ((c+1) * 2) );
/* With all of the dithered colors created, complete the first color's
shades by using itself as a template: */
c = 0;
for (s = 0; s < NumShades; s++)
for (p = 0; p < 8; p++)
ditherColor[c][s][p] = (0x11111111 - ditherColor[0][s][p]) * ( ((c+1) * 2)-1 ) +
( ditherColor[0][s][p] * ((c+1) * 2) );
}

View File

@ -0,0 +1,6 @@
compile Plasma.cc keep=Plasma
link Plasma random3.c plot2.c keep=Plasma
copy -f Plasma *:system:cdevs:twilight:Plasma
filetype *:system:cdevs:twilight:Plasma $bc $4004
nda

View File

@ -0,0 +1,18 @@
===================== Quick and dirty information ==========================
Put Headlines and Headlines.Data in your Twilight folder.
If you want to edit the headlines data you need to edit the Headlines.Src file with any text editor and then run the Compile.HLs program to generate a new Headlines.Data file.
===================== Beta Headlines Documentation =========================
Headline is my latest (and last for this release) module for Twilight II. It reads data out of the Headlines.Data file and uses it to make up phrases that could be the headline on a tabloid. Make sure you put the Headlines.Date file in the same folder as the Headline module. In 99.9% of the cases this would be your *:System:CDev:Twilight folder. The other two files that are included (Compile.HLs and Headlines.Src) are only needed if you want to edit the Headlines.Data file. They are not used by the Headlines module and to not need to be in your Twilight folder.
If you would like to experiment with making up headlines of your own you can load the Headlines.Src file into your favorite text editor. There are some notes at the beginning of the file that explain the general format of the file. When you are done editing the Headlines.Src file you need to run the Compile.HLs program. It will generate a new Headlines.Data file that you can stick in your Twilight folder. Headlines always loads the file called Headlines.Data and always looks for it in the same folder that the module is in. The Compile.HLs program is currently a VERY "Quick and Dirty" type EXE program. It is NOT intended for distribution. Just a tool for me (and beta testers) to use to create the data file that will be distributed. It does not do much error trapping and has no nice prompts. It just automatically opens a file called Headlines.Src and outputs a file called Headlines.Data. Since it is an EXE program it needs to be run from a command line shell like ORCA. If you don't have a shell you could try changing the file type to S16 and using it that way but it may have trouble locating the source file because it will try to load it out of prefix 0 which is not nesicarely the directory the program is in.
Please play around with Headlines and let me know what you think. If you are adventures enough to play around with editing the headlines file please let me know what you think of the data in there. I am very open to suggestions for new data in the headlines.data file. Play around with editing the file and then e-mail me any suggestions you have for CHANGES. E-Mailing your edited Headlines.Src file will not help me much because I have no way of combining 15 versions of one file.
Thanks for actually reading this.
_____
James C. Smith

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,420 @@
/*
** Plasma for T2 by James C. Smith
*/
#pragma keep "Plasma"
#pragma cdev Plasma
#pragma optimize -1
#pragma debug 0
#include "T2f.H"
#include "Random3.H"
#include "Plot2.h"
#define ControlList 0x00001003
#define ColorsPopup 0x00000001l
#define SmoothnesPopup 0x00000002l
#define DelayPopup 0x00000003l
#define CycleCheckBox 0x00000004l
#define QuitAfterOneCB 0x00000006l
#define ColorsMenu 0x00000001
#define SmoothnesMenu 0x00000002
#define DelayMenu 0x00000003
/*#include <time.h> */
#include <string.h>
#include <stdlib.h>
#include <quickdraw.h>
#include <control.h>
#include <resources.h>
#include <memory.h>
#include <orca.h>
#include <locator.h>
pascal void SysBeep() inline(0x2C03,dispatcher);
pascal LongWord TickCount() inline(0x1006,dispatcher);
#pragma lint -1
#define CycleSpeed 5
void CycleColors(void);
void subdivide(int x1, int y1, int x2, int y2);
void set_color(int xa, int ya, int x, int y, int xb, int yb);
void MySetColorTable(void);
LongWord MakeT2Plasma(void);
void LoadSetupT2Plasma(void);
void SaveConfigResource(char *, word);
word LoadConfigResource(char *, word);
LongWord HitT2Plasma(LongWord);
void SaveT2Plasma(void);
char *ConfigNameString="\pPlasma Configuration";
int Xres=319, Yres=199;
unsigned int ConfigSmoothnes, ConfigColors, ConfigDelay, ConfigDelay2, ConfigCycle, ConfigQuitAfterOne;
int ActSmoothnes;
Word *movePtr;
long NewTick, OldTick;
LongWord LastCycle;
Word SetupFileNumber;
GrafPortPtr SetupWindow;
long VRam;
void CycleColors(void)
{
word tmp;
tmp=*((word *) (VRam+0x009E02l));
memmove((void *) (VRam+0x009E02l), (void *) (VRam+0x009E04l), 28);
*((word *) (VRam+0x009E1El))=tmp;
}
struct getInfoOut T2Info={0,0,0xE};
LongWord BlankT2Plasma(void)
{
init_random(toT2Str);
set_random_seed();
ActSmoothnes=ConfigSmoothnes-2;
if((*((char *)0x00C035))& 0x08)
VRam=0xE10000l;
else
VRam=0x010000l;
init_plot((char *) VRam,(char *)GetAddress(1), toT2Str);
SendRequest(t2GetInfo, stopAfterOne+sendToName, (longword) toT2Str, 0, (void *) &T2Info);
while (!(*movePtr))
{
ClearScreen (0);
MySetColorTable();
set_pixel(0, 0, random() %16);
set_pixel(Xres, 0, random() %16);
set_pixel(Xres, Yres, random() %16);
set_pixel(0, Yres, random() %16);
subdivide(0,0,Xres,Yres);
NewTick=OldTick=TickCount();
while( (!(*movePtr)) && (NewTick<OldTick+(long)ConfigDelay2) ) {
if(ConfigCycle && (TickCount() >= LastCycle+CycleSpeed))
{
CycleColors();
LastCycle=TickCount();
}
NewTick=TickCount();
}
if(ConfigQuitAfterOne && (T2Info.count_selected_modules > 1))
break;
}
if(*movePtr)
{
return (LongWord) 0;
} else
return (LongWord) bmrNextModule;
}
int ColorTables[]=
{0x0007,0x0118,0x0229,0x033A,0x044B,0x055C,0x066D,0x077E,0x088F,0x099F,0x0AAF,0x0BBF,0x0CCF,0x0DDF,0x0EEF,0x0FFF,\
0x0666,0x0DDD,0x0DDD,0x0CCC,0x0BBB,0x0AAA,0x0999,0x0888,0x0777,0x0666,0x0555,0x0444,0x0333,0x0222,0x0111,0x0000,\
0x0118,0x0118,0x0118,0x0229,0x0589,0x08E8,0x07D7,0x06C6,0x05B5,0x04A4,0x0393,0x0282,0x0171,0x0260,0x0350,0x0240,\
0x0000,0x0C30,0x0960,0x0690,0x03C0,0x00F0,0x00C3,0x0096,0x0069,0x003C,0x000F,0x030C,0x0609,0x0906,0x0C03,0x0F00,\
0x0000,0x0FF0,0x0FD0,0x0FB0,0x0F90,0x0F70,0x0F50,0x0F30,0x0F10,0x0F30,0x0F50,0x0F70,0x0F90,0x0FB0,0x0FD0,0X0FE0};
/*{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}*/
void MySetColorTable(void)
{
int tmp;
tmp=ConfigColors;
if(!tmp)
tmp=random() % 5;
else
tmp--;
memcpy((void *)(VRam+0x009E00l), &ColorTables[tmp<<4], 32);
}
void subdivide(int x1, int y1, int x2, int y2)
{
int x,y,color;
if (*movePtr)
return;
if(ConfigCycle && (TickCount() >= LastCycle+CycleSpeed))
{
CycleColors();
LastCycle=TickCount();
}
if((x2-x1<2) && (y2-y1<2))
return;
x=(x1+x2)>>1;
y=(y1+y2)>>1;
set_color(x1,y1,x,y1,x2,y1);
set_color(x2,y1,x2,y,x2,y2);
set_color(x1,y2,x,y2,x2,y2);
set_color(x1,y1,x1,y,x1,y2);
color=(get_pixel(x1,y1)+get_pixel(x2,y1)+get_pixel(x2,y2)+get_pixel(x1,y2))>>2;
if(!get_pixel(x,y))
set_pixel(x,y,color);
subdivide(x1,y1,x,y);
subdivide(x,y1,x2,y);
subdivide(x,y,x2,y2);
subdivide(x1,y,x,y2);
}
void set_color(int xa, int ya, int x, int y, int xb, int yb)
{
long color;
if(get_pixel(x,y))
return;
color=abs(xa-xb) + abs(ya-yb);
if(ActSmoothnes>0)
color>>=ActSmoothnes;
if(ActSmoothnes<0)
color<<=abs(ActSmoothnes);
if(!color)
color=1;
color=(random() % (color<<1)+1 )-color;
color+=(get_pixel(xa,ya)+get_pixel(xb,yb))>>1;
if(color<1)
color=1;
if(color>15)
color=15;
set_pixel(x,y,(int) color);
}
void SaveT2Plasma(void)
{
word OptionWord;
Word FileNumber;
/* Save current resource file and switch in Twilight.Setup */
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
/* Save control values */
ConfigSmoothnes = GetCtlValue (GetCtlHandleFromID (SetupWindow, SmoothnesPopup));
ConfigColors = GetCtlValue (GetCtlHandleFromID (SetupWindow, ColorsPopup))-1;
ConfigDelay = GetCtlValue (GetCtlHandleFromID (SetupWindow, DelayPopup));
ConfigCycle = GetCtlValue (GetCtlHandleFromID (SetupWindow, CycleCheckBox));
ConfigQuitAfterOne = GetCtlValue (GetCtlHandleFromID (SetupWindow, QuitAfterOneCB));
OptionWord=(ConfigSmoothnes<< 12) | (ConfigColors << 8) | (ConfigDelay << 4) | (ConfigQuitAfterOne << 1) | ConfigCycle;
SaveConfigResource(ConfigNameString, OptionWord);
/*****************************/
/* Restore old resource file */
/*****************************/
SetCurResourceFile (FileNumber);
}
LongWord HitT2Plasma(LongWord ControlHit)
{
LongWord EnableFlag = 0L;
if (ControlHit == ColorsPopup)
EnableFlag = 1L;
if (ControlHit == SmoothnesPopup)
EnableFlag = 1L;
if (ControlHit == DelayPopup)
EnableFlag = 1L;
if (ControlHit == CycleCheckBox)
EnableFlag = 1L;
if (ControlHit ==QuitAfterOneCB)
EnableFlag = 1L;
return EnableFlag;
}
/*****************************************************************************\
|* *|
|* LoadConfigResource- (updated) *|
|* 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;
struct {
word Type;
Long ID;
} HandleInfo;
/**************************************/
/* 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;
}
/*****************************************************************************\
|* *|
|* 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);
/*DisposeHandle (ConfigData); */
}
}
LongWord MakeT2Plasma (void)
{
CtlRecHndl junk;
Word FileNumber;
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
LoadSetupT2Plasma();
SetCurResourceFile (FileNumber);
junk=NewControl2(SetupWindow, resourceToResource, (long) ControlList);
SetCtlValue (ConfigSmoothnes, GetCtlHandleFromID (SetupWindow, SmoothnesPopup));
SetCtlValue (ConfigColors+1, GetCtlHandleFromID (SetupWindow, ColorsPopup));
SetCtlValue (ConfigDelay, GetCtlHandleFromID (SetupWindow, DelayPopup));
SetCtlValue (ConfigCycle, GetCtlHandleFromID (SetupWindow, CycleCheckBox));
SetCtlValue (ConfigQuitAfterOne, GetCtlHandleFromID (SetupWindow, QuitAfterOneCB));
return 6;
}
unsigned int DelayLookup[]={0,5*60, 10*60, 15*60, 30*80, 1*60*80, 2*60*60, 3*60*60, 5*60*60};
void LoadSetupT2Plasma(void)
{
word OptionWord;
/* Option word format
** 0xF000 = Smoothnes
** 0x0F00 = Colors
** 0x00F0 = Delay (pos in list)
** 0x0002 = Quit After One
** 0x0001 = Cycle flag
*/
OptionWord = LoadConfigResource (ConfigNameString, 0x5040);
ConfigSmoothnes = OptionWord >> 12;
ConfigColors = (OptionWord & 0x0F00) >> 8;
ConfigDelay = (OptionWord & 0x00F0) >> 4;
ConfigDelay2 = DelayLookup[ConfigDelay-1];
ConfigQuitAfterOne = (OptionWord & 0x0002) >> 1;
ConfigCycle = OptionWord & 0x0001;
}
LongWord Plasma(LongWord data2, LongWord data1, Word message)
{
LongWord Result = 0L;
switch (message)
{
case MakeT2:
SetupWindow = (GrafPortPtr) data1;
SetupFileNumber = (Word) data2;
Result = MakeT2Plasma ();
break;
case BlankT2:
if(data2 & bmiBlankNow)
ConfigQuitAfterOne=0;
movePtr=(Word *) data1;
Result = BlankT2Plasma ();
break;
case SaveT2:
SaveT2Plasma();
break;
case LoadSetupT2:
LoadSetupT2Plasma();
break;
case UnloadSetupT2:
break;
case KillT2:
break;
case HitT2:
Result = HitT2Plasma(data2);
break;
}
return Result;
}

View File

@ -0,0 +1,94 @@
SLED Commands
All commands must be preseaded by the command character. By default this is
the "|" character. See the ????? command below to see how to change the
command character. Fallowing the command character should be one of the single
letter commands below. Most of the commands must be fallowed by one or more
arguments. For example the wait command takes one integer argument to tell
it how many 60ths of a second to wait. An example of a wait command would be:
|W30
That would make the display pause for 30 60ths of a second or one half second.
Next next command should imeadiatlu fallow the last character of the last
command. Characters with an ASCII value lass than 32 are ignored. This means
all returns and line feeds are ignored as well as tabs. You can place those
characters any where you want in the text to help space it out to make it
easier for you to read. Spaces or NOT ignored. You can not put spaces in
places they don't belong. Using spaces in thext that is to be displayed is not
a problem but putting them between commands or between command arguments will
screw things up.
Commands with an "*" after then can be nested inside of other
commands. (The "*" is NOT part of the command. Do not put it in your text.)
This nesting means that you can put them insie the text argument of another
command. For example, you can put the (T)ime command inside a scroll (L)eft
command to make the time scroll across the scree.
L scroll Left
All the text fallowing the L and before the next command character will
be scrolled left. The scrolling will stop as soon as the last character
in the text is fully on screen. If you want the text centered or of you
want to to scroll all the way off the screen you will have to pad the text
with spaces at the end. There is no limit to the number of characters you
can scroll using the L command. They will just keep scrolling and
scrolling and scrolling forever.
P Print
Clears the display and then displays the specified text using the
specified justification. The first argument is a single
character that specifies a justification for the text. Valid options are
L, C, or R for Left, Center or Right. Imeadiatly fallowing the
justification argument is the text argument. This is the text you want
to be displayed. It will be justified horizontaly according to the
justification argument. You can only display one display full of
characters at a time using this command. With the present display size and
font that means 8 characters. If you try to display more than 8 characters
using this command you will get an error message.
U scroll Up
This command takes the exact same arguments as the Print command.
The text specified in the text argument will be scrool up onto the display
all at once. The text will be justified horizontaly according to the
justification argument. The text will stop scrolling up as soon as it is
totaly on screen. You can only scroll one display one full of characters
at a time using this command. With the present display size and font that
means 8 characters. If you try to display more than 8 characters using
this command you will get an error message.
W Wait
There are two forms of the Wait command. The first is used to wait for
a specified amount of time. This simply makes the display pause for
x/60ths of a second. Nothing at all will happen during this time. You
must specify one numeric argument that is the number of 60ths of a second
to wait. 30 would mean half a seconds, 60 would mean 1 second and 180
would mean 3 seconds. The second form of the command tells the system to
wait for the sonds on the clock to change. It will wait unlill the number
of seconds on the clock changes to a value different than the value it had
last time the wait for time change command was called. To specify a wait
for time change simply fallow the W command with a T for Time.
; Comment
All characters after the ; character and up to the next command character
are ignored. You can put anything you want in here.
C Clear
Clears the current display.
T* Time
This command will place the current time in your text. It takes one
argument that is padding to make room to insert the correct time at run
time. You can specify as meny or as few padding characters as you wish.
They will all be replaced with the current time or nulls. The padding
characters must be fallowed by a command character to specify the end of
the padding. This command character is NOT the start of the next command.
Is simply terminats the time command. Remeber, the time command is nested
in side of another command. If you want a command to imeadialy fallow
the time command you need to include a second command character. For example:
|D|Txxxxxxxx||W60
would display the first 8 characters of the current time and then wait one
second. Normaly, you would nest the time command inside some text like
this:
|LThe time is |Txxxxxxxxxxx| acording to this stupid computer.
D* Date
Works exactly like the (T)ime command but replaces the padding characters
with the date rather than the time.
If no command is specified at the begining of the text than the L command is
assumed. This menas that is all you want to do is scroll some text across
the display you don't need to put the text in the file. You don't need any
special commands at all. Just make sure the text don't contain the command
character in it any where.

View File

@ -0,0 +1,120 @@
/*
** ShortOut for T2 by James C. Smith
*/
#pragma keep "ShortOut"
#pragma cdev ShortOut
#pragma optimize 0
#pragma debug 0
#include "T2f.H"
#include "Random3.h"
#include <string.h>
#include <memory.h>
#include <locator.h>
#pragma lint 0
pascal LongWord TickCount() inline(0x1006,dispatcher);
pascal void SysBeep() inline(0x2C03,dispatcher);
int i,i2;
Long OldTick=0, TmpTick;
Word *movePtr;
long VRam;
char ScanLine[200], TempC;
char OrigSCB, OrigColorTable14[32];
int DemoMode;
void Wait(int);
void Wait(int WaitLength)
{
TmpTick=OldTick;
while((OldTick=TickCount())<=TmpTick+WaitLength);
}
struct getInfoOut T2Info={0,0,0xE};
LongWord BlankT2ShortOut(void)
{
VRam=0xE12000l;
init_random(toT2Str);
set_random_seed();
SendRequest(t2GetInfo, stopAfterOne+sendToName, (longword) toT2Str, 0, (void *) &T2Info);
/* Make backup of color table 14 */
memcpy(OrigColorTable14, (void *) (VRam+0x007E00 + 14 * 32), (size_t) 32);
/* Set color table 14 to all blank */
memset( (void *) (VRam+0x007E00 + 14 * 32), 0,(size_t) 32);
/*Built a table of scan line numbers */
for(i=0; i<200; i++)
ScanLine[i]=i;
/* randomize the table */
for(i=0; i<200; i++)
{
i2=random() % 200;
TempC=ScanLine[i];
ScanLine[i]=ScanLine[i2];
ScanLine[i2]=TempC;
}
/* Set all the scan lines to black in ScanLine[] order */
OrigSCB=*((char *) (VRam+0x007D00));
for(i=0; i<200 && (!(*movePtr)); i++)
{
if(i % 13==0)
Wait(0);
*((char *) (VRam+0x007D00+ScanLine[i]))=(*((char *) (VRam+0x007D00+ScanLine[i])) & 0xF0) | 0x0E;
}
if((T2Info.count_selected_modules < 2) || DemoMode)
{
while (!(*movePtr)); /* wait until the movePtr becomes true */
/* reset all SCBs back to origonal in the same oreder they were blacked out */
for(i=0; i<200; i++)
{
if(i % 40==0)
Wait(0);
*((char *) (VRam+0x007D00+ScanLine[i]))=OrigSCB;
}
} else {
memset( (void *) 0xE19D00ul, 0, 200);
memset( (void *) 0xE19E00ul, 0, 512);
}
/* reset color table 15 */
memcpy((void *) (VRam+0x007E00 + 14 * 32), OrigColorTable14, (size_t) 32);
if(*movePtr)
return (LongWord) NULL;
else
return (LongWord) bmrNextModule;
}
LongWord ShortOut(LongWord data2, LongWord data1, Word message)
{
LongWord Result = 0L;
switch (message)
{
case BlankT2:
DemoMode=data2 & bmiBlankNow;
movePtr=(Word *) data1;
Result = BlankT2ShortOut ();
break;
case MakeT2:
case SaveT2:
case LoadSetupT2:
case UnloadSetupT2:
case KillT2:
case HitT2:
break;
}
return Result;
}

View File

@ -0,0 +1,350 @@
/*
** Clock for T2 by James C. Smith
*/
#pragma keep "Clock"
#pragma cdev Clock
#pragma optimize -1
#pragma debug 0
#include "T2.H"
#include "Random3.h"
#pragma lint 0
#include <misctool.h>
#include <quickdraw.h>
#include <font.h>
#include <string.h>
#include <stdlib.h>
#include <control.h>
#include <resources.h>
#include <memory.h>
pascal LongWord TickCount() inline(0x1006,dispatcher);
pascal void SysBeep() inline(0x2C03,dispatcher);
LongWord MakeT2Clock(void);
void LoadSetupT2Clock(void);
void SaveConfigResource(char *, word);
word LoadConfigResource(char *, word);
LongWord HitT2Clock(LongWord);
void SaveT2Clock(void);
#define ClockIcon 0x0010DD01l
#define ControlList 0x00001003l
#define IconControl 0x00000001l
#define SetFont 0x00000002l
#define CurrentText 0x00000003l
char *ConfigNameStringNumber="\pClock Config Font";
char *ConfigNameStringSize="\pClock Config Size";
LongWord ConfigFontID;
Word SetupFileNumber;
GrafPortPtr SetupWindow;
ColorTable DefColorTable={0,0x0FFF,0,0x0FFF,0,0x0FFF,0,0x0FFF,0,0x0FFF,0,0x0FFF,0,0x0FFF,0,0x0FFF};
ColorTable MyColorTable;
int CurColor=1, FirstTime,x,y, oldx, oldy,xv,yv,MoveDelay=8;
char OldTime[21]={' ',0}, NewTime[21]={' ',0}, TmpTime[21];
Long OldTick=0, TmpTick;
int work;
Word *movePtr;
LongWord BlankT2Clock(void)
{
int TextSize[4];
init_random(toT2Str);
set_random_seed();
FirstTime=2;
memcpy(MyColorTable, DefColorTable, 32);
SetColorTable (0, MyColorTable);
InstallFont(ConfigFontID, 0x0000); /* select configed font */
ClearScreen (0);
ReadAsciiTime(TmpTime);
TmpTime[20]=0;
for(work=0; TmpTime[work]; work++) TmpTime[work]&=0x7F;
MoveTo(0,0);
CStringBounds(TmpTime+9,(Rect *) TextSize);
xv=(random() % 2) ? 1:-1;
yv=(random() % 2) ? 1:-1;
x=(random() % abs((640+TextSize[1])-TextSize[3]))-TextSize[1];
y=(random() % abs((200+TextSize[0])-TextSize[2]))-TextSize[0];
SetBackColor(0);
ClearScreen (0);
while (!(*movePtr)) /* Animate the screen until the movePtr becomes true */
{
ReadAsciiTime(TmpTime);
TmpTime[20]=0;
for(work=0; TmpTime[work]; work++) TmpTime[work]&=0x7F;
if(strcmp(NewTime, TmpTime)!=0){
SetForeColor(CurColor);
if(FirstTime==0){
SetTextMode(modeXOR);
MoveTo(oldx,oldy);
DrawCString(OldTime+9);
} else FirstTime--;
oldx=x;
oldy=y;
if(!MoveDelay){
x+=xv;
y+=yv;
MoveDelay=8;
}
MoveDelay--;
if(x+TextSize[1]<0) {xv=abs(xv), x+=xv;}
if(y+TextSize[0]<0) {yv=abs(yv), y+=yv;}
if(x+TextSize[3]>640) {xv=-abs(xv), x+=xv;}
if(y+TextSize[2]>200) {yv=-abs(yv), y+=yv;}
SetTextMode(modeOR);
MoveTo(x,y);
DrawCString(TmpTime+9);
strcpy(OldTime, NewTime);
strcpy(NewTime, TmpTime);
CurColor=3-CurColor;
}
if(CurColor==2){
if(MyColorTable[2]){
MyColorTable[1]+=273;
MyColorTable[2]-=273;
}
} else {
if(MyColorTable[1]){
MyColorTable[1]-=273;
MyColorTable[2]+=273;
}
}
memcpy(&MyColorTable[4], MyColorTable, 8);
memcpy(&MyColorTable[8], MyColorTable, 16);
TmpTick=OldTick;
while((OldTick=TickCount())<=(TmpTick+1));
SetColorTable (0, MyColorTable);
}
/* ClearScreen (0); */
SetPurgeStat(ConfigFontID, (word) purgeBit);
return (LongWord) NULL;
}
#pragma debug 0
void SaveT2Clock(void)
{
Word FileNumber;
/* Save current resource file and switch in Twilight.Setup */
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
/* Save control values */
SaveConfigResource(ConfigNameStringNumber, ConfigFontID & 0x0000FFFF);
SaveConfigResource(ConfigNameStringSize, ConfigFontID >> 16);
/*****************************/
/* Restore old resource file */
/*****************************/
SetCurResourceFile (FileNumber);
}
LongWord HitT2Clock(LongWord ControlHit)
{
LongWord OldConfigFontID;
LongWord EnableFlag = 0L;
GrafPort MyPort,*OldPort;
if (ControlHit == SetFont){
OldConfigFontID=ConfigFontID;
OldPort = GetPort (); /* Save grafport for future restore */
OpenPort (&MyPort); /* Create a new port */
ConfigFontID=ChooseFont((longword) ConfigFontID, (word) 0);
SetPort (OldPort);
ClosePort (&MyPort); /* Restore grafport and kill ours */
if(ConfigFontID==0)
ConfigFontID=OldConfigFontID;
else
if(OldConfigFontID != ConfigFontID) EnableFlag = 1L;
}
return EnableFlag;
}
/*****************************************************************************\
|* *|
|* LoadConfigResource- (updated) *|
|* 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;
struct {
word Type;
Long ID;
} HandleInfo;
/**************************************/
/* 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;
}
/*****************************************************************************\
|* *|
|* 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 ((longword) (sizeof (Word)), GetCurResourceApp(), attrLocked, NULL);
**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);
/*DisposeHandle (ConfigData); */
}
}
LongWord MakeT2Clock (void)
{
CtlRecHndl junk;
Word FileNumber;
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
LoadSetupT2Clock();
SetCurResourceFile (FileNumber);
junk=NewControl2(SetupWindow, resourceToResource, (long) ControlList);
return 2l;
}
void LoadSetupT2Clock(void)
{
/* Option word format
** 0x0010 = Big
** 0x000F = NumSparks
*/
ConfigFontID = (((LongWord) LoadConfigResource (ConfigNameStringSize, 0x3000)) <<16 ) | ((LongWord) LoadConfigResource (ConfigNameStringNumber, 0x8235));
}
LongWord Clock(LongWord data2, LongWord data1, Word message)
{
LongWord Result = 0L;
switch (message)
{
case MakeT2:
SetupWindow = (GrafPortPtr) data1;
SetupFileNumber = (Word) data2;
Result = MakeT2Clock ();
break;
case BlankT2:
movePtr=(Word *) data1;
Result = BlankT2Clock ();
break;
case SaveT2:
SaveT2Clock();
break;
case LoadSetupT2:
LoadSetupT2Clock();
break;
case UnloadSetupT2:
break;
case KillT2:
break;
case HitT2:
Result = HitT2Clock(data2);
break;
}
return Result;
}

View File

@ -0,0 +1,479 @@
/*
** DripDrop for T2 by James C. Smith
*/
#pragma keep "DripDrop"
#pragma cdev DripDrop
#pragma optimize -1
#pragma debug 0
#include "T23.H"
#include "Random3.H"
#include <orca.h>
#include <string.h>
#include <types.h>
#include <memory.h>
#include <locator.h>
#include <loader.h>
#include <control.h>
#include <resources.h>
#include <sound.h>
#include <quickdraw.h>
#pragma lint 0
pascal LongWord TickCount() inline(0x1006,dispatcher);
pascal void SysBeep() inline(0x2C03,dispatcher);
#define ControlList 0x00001003l
#define IconControl 0x00000001l
#define NumDropsPopUp 0x00000002l
#define DropLifePopUp 0x00000003l
#define SoundCB 0x00000004l
#define rSoundID 0x00000001l
LongWord MakeT2DripDrop(void);
void LoadSetupT2DripDrop(void);
void SaveConfigResource(char *, word);
word LoadConfigResource(char *, word);
LongWord HitT2DripDrop(LongWord);
void SaveT2DripDrop(void);
void LoadSound();
handle LoadASound(unsigned long, word *);
void PlayASound(handle, int, word);
Word SetupFileNumber;
GrafPortPtr SetupWindow;
word OptionWord;
Handle SoundHandle;
int i, i2, OldX,OldY, OldAge, SoundsAreLoaded=0, DisableSounds;
int RectAry[4];
word ConfigNumDrops, ConfigDropLife, ConfigSound;
Word *movePtr;
char *ConfigNameString="\pDripDrop Config";
word DropFreq;
typedef struct rSoundSampleType {
int SoundFormat;
int WaveSize;
int RealPitch;
int StereoChannel;
unsigned int SampleRate;
char StartOfWaveData;
};
typedef struct Drop {
int x;
int y;
int Age;
};
struct startupToolsOut DripDropToolsOut;
word MyID;
word Colors[16];
int BrightColor;
struct Drop Drops[20];
struct SoundParamBlock SoundPB;
struct rSoundSampleType *SoundPtr;
word LastGen, GenNum=0;
void PlayASound(handle SoundHandle, int Channel, word Frequency)
{
struct rSoundSampleType *SoundPtr;
if(ConfigSound==0 || SoundsAreLoaded==0)
return;
Channel>>=1;
HLock(SoundHandle);
SoundPtr=(void *) *SoundHandle;
SoundPB.waveStart=&SoundPtr->StartOfWaveData;
SoundPB.waveSize=SoundPtr->WaveSize;
SoundPB.freqOffset=Frequency;
SoundPB.docBuffer=GenNum<<15;
SoundPB.bufferSize=0x6;
SoundPB.nextWavePtr=NULL;
SoundPB.volSetting=159-Channel+96;
FFStopSound((word) (1<<GenNum));
FFSetUpSound((word) (0<<12 | GenNum<<8 | ffSynthMode), (Pointer) &SoundPB);
LastGen=GenNum;
GenNum++;
if(GenNum>3)
GenNum=0;
SoundPB.docBuffer=GenNum<<15;
SoundPB.volSetting=Channel+96;
FFStopSound((word) (1<<GenNum));
FFSetUpSound((word) (1<<12 | GenNum<<8 | ffSynthMode), (Pointer) &SoundPB);
FFStartPlaying(1<<GenNum | 1<< LastGen);
GenNum++;
if(GenNum>3)
GenNum=0;
HUnlock(SoundHandle);
}
void CycleColors(void)
{
word tmp;
tmp=Colors[15];
memmove(&Colors[2], &Colors[1], 28);
Colors[1]=tmp;
SetColorTable(0, Colors);
BrightColor++;
if(BrightColor>15)
BrightColor=1;
}
LongWord BlankT2DripDrop(void)
{
int StartSoundTool;
init_random(toT2Str);
set_random_seed();
if(ConfigSound)
{
StartSoundTool = SoundToolStatus();
if (!StartSoundTool) {
SendRequest(t2StartupTools, stopAfterOne+sendToName, (longword) toT2Str, (((long)MyID)<<16)+startshut_sound,(void *) &DripDropToolsOut);
if (DripDropToolsOut.errors)
{
ConfigSound=0;
return (LongWord) NULL;
}
} else
ConfigSound=0;
}
SetPenMode(modeCopy);
SetPenSize(2, 1);
for(i=0; i<16; i++) Colors[i]=(i<<1)%16;
SetColorTable(0, Colors);
BrightColor=15;
for(i=0; i<ConfigNumDrops; i++)
{
Drops[i].x=random() % 320;
Drops[i].y=random() % 200;
Drops[i].Age=(random()^0x5555) % (ConfigDropLife+8);
}
while (!(*movePtr)) /* Animate the screen until the movePtr becomes true */
{
CycleColors();
for(i=0; i<ConfigNumDrops; i++)
{
OldX=Drops[i].x;
OldY=Drops[i].y;
OldAge=Drops[i].Age-6;
Drops[i].Age++;
if(Drops[i].Age>=ConfigDropLife+6)
{
Drops[i].x=random() % 320;
Drops[i].y=random() % 200;
Drops[i].Age=((random()^0x5555) % 3)+1;
PlayASound(SoundHandle, Drops[i].x, DropFreq);
}
i2=Drops[i].Age;
if(i2<ConfigDropLife)
{
RectAry[0]=Drops[i].y-(i2<<1);
RectAry[1]=Drops[i].x-(i2<<3);
RectAry[2]=Drops[i].y+(i2<<1);
RectAry[3]=Drops[i].x+(i2<<3);
SetSolidPenPat(BrightColor);
FrameOval((Rect *) RectAry);
}
if(OldAge>0)
{
RectAry[0]=OldY-(OldAge<<1);
RectAry[1]=OldX-(OldAge<<3);
RectAry[2]=OldY+(OldAge<<1);
RectAry[3]=OldX+(OldAge<<3);
SetSolidPenPat(0);
FrameOval((Rect *) RectAry);
}
} /* end loop for numprops */
} /* end while no movement */
if (ConfigSound)
{
FFStopSound((word) 0x7FFF);
SendRequest(t2ShutdownTools, stopAfterOne+sendToName, (long) toT2Str,startshut_sound,(long) NULL);
}
return (LongWord) NULL;
}
void SaveT2DripDrop(void)
{
Word FileNumber;
/* Save current resource file and switch in Twilight.Setup */
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
/* Save control values */
ConfigSound = GetCtlValue (GetCtlHandleFromID (SetupWindow, SoundCB));
ConfigNumDrops = GetCtlValue (GetCtlHandleFromID (SetupWindow, NumDropsPopUp));
ConfigDropLife = GetCtlValue (GetCtlHandleFromID (SetupWindow, DropLifePopUp));
OptionWord=(ConfigSound<<15) | (ConfigNumDrops<<8) | ConfigDropLife;
SaveConfigResource(ConfigNameString, OptionWord);
/*****************************/
/* Restore old resource file */
/*****************************/
SetCurResourceFile (FileNumber);
}
LongWord HitT2DripDrop(LongWord ControlHit)
{
LongWord EnableFlag = 0L;
if (ControlHit == NumDropsPopUp)
EnableFlag = 1L;
if (ControlHit == DropLifePopUp)
EnableFlag = 1L;
if (ControlHit == SoundCB)
EnableFlag = 1L;
return EnableFlag;
}
/*****************************************************************************\
|* *|
|* LoadConfigResource- (updated) *|
|* 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;
struct {
word Type;
Long ID;
} HandleInfo;
/**************************************/
/* 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;
}
/*****************************************************************************\
|* *|
|* 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, NULL);
**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);
/*DisposeHandle (ConfigData); */
}
}
LongWord MakeT2DripDrop (void)
{
CtlRecHndl junk;
Word FileNumber;
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
LoadSetupT2DripDrop();
SetCurResourceFile (FileNumber);
junk=NewControl2(SetupWindow, resourceToResource, (long) ControlList);
SetCtlValue (ConfigNumDrops, GetCtlHandleFromID (SetupWindow, NumDropsPopUp));
SetCtlValue (ConfigDropLife, GetCtlHandleFromID (SetupWindow, DropLifePopUp));
SetCtlValue (ConfigSound, GetCtlHandleFromID (SetupWindow, SoundCB));
return 4l;
}
void LoadSetupT2DripDrop(void)
{
/* Option word format
** 0x8000 = Sound
** 0x7F00 = NumDrops
** 0X00FF = DropLength
*/
OptionWord = LoadConfigResource (ConfigNameString, 0x8309);
ConfigSound=OptionWord >> 15;
ConfigNumDrops = (OptionWord & 0x7F00) >> 8;
ConfigDropLife = OptionWord & 0x00FF;
}
handle LoadASound(unsigned long ResID, word *freqOffset)
{
handle WorkHandle;
WorkHandle=LoadResource(rSoundSample, ResID);
if(toolerror())
return 0;
DetachResource(rSoundSample, ResID);
SetHandleID(MyID, WorkHandle);
HLock(WorkHandle);
SoundPtr=(void *) *WorkHandle;
SendRequest(t2CalcFreqOffset, stopAfterOne+sendToName, (longword) toT2Str, (long) (SoundPtr->RealPitch),(void *) &DripDropToolsOut);
*freqOffset=DripDropToolsOut.errors;
HUnlock(WorkHandle);
return WorkHandle;
}
void LoadSound()
{
word MyResFile, OldResFile;
if(DisableSounds)
ConfigSound=0;
OldResFile=GetCurResourceFile();
MyResFile=OpenResourceFile(1 /* read only */, NULL, LGetPathname2(MyID, 0x0001));
if(toolerror())
{
ConfigSound=0;
return;
}
SoundHandle=LoadASound(rSoundID, &DropFreq);
if(!SoundHandle)
{
ConfigSound=0;
} else
SoundsAreLoaded=1;
CloseResourceFile(MyResFile);
SetCurResourceFile(OldResFile);
}
void UnLoadSound(void)
{
DisposeHandle(SoundHandle);
SoundsAreLoaded=0;
}
LongWord DripDrop(LongWord data2, LongWord data1, Word message)
{
LongWord Result = 0L;
MyID=MMStartUp();
switch (message)
{
case MakeT2:
SetupWindow = (GrafPortPtr) data1;
SetupFileNumber = (Word) data2;
Result = MakeT2DripDrop ();
break;
case BlankT2:
movePtr=(Word *) data1;
Result = BlankT2DripDrop ();
break;
case SaveT2:
SaveT2DripDrop();
break;
case LoadSetupT2:
DisableSounds=data2 & 1;
LoadSetupT2DripDrop();
if(DisableSounds)
ConfigSound=0;
if(ConfigSound)
LoadSound();
break;
case UnloadSetupT2:
if(SoundsAreLoaded)
UnLoadSound();
break;
case KillT2:
break;
case HitT2:
Result = HitT2DripDrop(data2);
break;
}
return Result;
}

View File

@ -0,0 +1,885 @@
/*#define DONT_USE_SOUNDS 1*/ /* define DONT_USE_SOUNDS to disable all the sound
** related code
*/
/* to do
**
** kill every other
** check for error loading sounds (missing resource OR our of memory)
*/
/*
** Fireworks for T2 by James C. Smith
*/
#pragma keep "Fireworks"
#pragma cdev Fireworks
#pragma optimize -1
#pragma debug 0
#include "T23.H"
#include "Random3.H"
#include "Plot2.h"
#include <memory.h>
#include <string.h>
#include <locator.h>
#include <loader.h>
#include <quickdraw.h>
#include <stdlib.h>
#include <control.h>
#include <resources.h>
#include <sound.h>
#pragma lint 0
pascal LongWord TickCount() inline(0x1006,dispatcher);
pascal void SysBeep() inline(0x2C03,dispatcher);
/* constants */
#define MaxNumSparks 170
#define ControlList 0x00001003l
#define IconControl 0x00000001l
#define NumSparks 0x00000002l
#define BigCB 0x00000003l
#define ReflectCB 0x00000004l
#define SoundCB 0x00000005l
#ifndef DONT_USE_SOUNDS
#define rSoundExplode 0x00000001l
#define rSoundLaunch 0x00000002l
#define rSoundWhirl 0x00000003l
#define rSoundBoom 0x00000004l
typedef struct rSoundSampleType {
int SoundFormat;
int WaveSize;
int RealPitch;
int StereoChannel;
unsigned int SampleRate;
char StartOfWaveData;
};
#endif
LongWord MakeT2Fireworks(void);
void LoadSetupT2Fireworks(void);
void SaveConfigResource(char *, word);
word LoadConfigResource(char *, word);
LongWord HitT2Fireworks(LongWord);
void SaveT2Fireworks(void);
void (*PlotPointer)(int, int, int);
void Plot(int, int, int);
void Plot2(int, int, int);
void set_pixel2(int, int, int);
void Wait(int);
void Wait2(int);
void New(void);
void Flasher(int,int,int);
void Slow(int, int, int);
void Cycle(void);
#ifndef DONT_USE_SOUNDS
handle LoadASound(unsigned long ResID, word *);
void LoadSounds(void);
void UnLoadSounds(void);
void PlayASound(handle, int, word);
#endif
typedef struct SparkStruct {
int HistX[14];
int HistY[14];
int X;
int Y;
int XV;
int YV;
};
struct startupToolsOut FWToolsOut;
struct SparkStruct Sparks[MaxNumSparks], *SparkPtr;
word MyID;
long x,y,xv,yv;
int IntX=999, IntY, XHist[14], YHist[14], CyclePointer=15, Erase, HistPointer, tmp;
int LaunchColorTable[]={0x000,0x0111,0x0200,0x0300,0x0400,0x0500,0x0600,0x0700,0x0800,0x0900,0x0A00,0x0B00,0x0C00,0x0D00,0x0E00,0x0F00};
/*int LaunchColorTable[]={0x000,0x0111,0x0222,0x0333,0x0444,0x0555,0x0666,0x0777,0x0888,0x0999,0x0AAA,0x0BBB,0x0CCC,0x0DDD,0x0EEE,0x0FFF};*/
int MyColorTable[16], CurNumSparks;
int i, StopIt, EveryOther=0, SoundsAreLoaded=0, DisableSounds;
Long OldTick=0, TmpTick;
Word *movePtr;
char *VRam;
unsigned int *ScreenTablePtr;
char *ConfigNameString="\pFireworks Config";
word ConfigNumSparks, ConfigBig, ConfigSound, ConfigReflect;
#ifndef DONT_USE_SOUNDS
Handle SoundHandleExplode, SoundHandleLaunch, SoundHandleBoom, SoundHandleWhirl;
word ExplodeFreq, LaunchFreq, BoomFreq, WhirlFreq;
struct rSoundSampleType *SoundPtr;
#endif
Word SetupFileNumber;
GrafPortPtr SetupWindow;
signed int SinTable[]={
0, 2, 4, 6, 8,11,13,15,17,19,21,23,26,28,30,31,33,35,37,
39,41,42,44,46,47,49,50,51,53,54,55,56,57,58,59,60,60,61,
62,62,63,63,63,63,63,63,63,63,63,63,63,62,62,61,60,60,59,
58,57,56,55,54,53,51,50,49,47,46,44,42,41,39,37,35,33,32,
30,28,26,23,21,19,17,15,13,11, 8, 6, 4, 2, 0,-2,-4,-6,-8,
-11,-13,-15,-17,-19,-21,-23,-26,-28,-30,-31,-33,-35,-37,-39,-41,-42,-44,-46,
-47,-49,-50,-51,-53,-54,-55,-56,-57,-58,-59,-60,-60,-61,-62,-62,-63,-63,-63,
-63,-63,-63,-63,-63,-63,-63,-63,-62,-62,-61,-60,-60,-59,-58,-57,-56,-55,-54,
-53,-51,-50,-49,-47,-46,-44,-42,-41,-39,-37,-35,-33,-32,-30,-28,-26,-23,-21,
-19,-17,-15,-13,-11,-8,-6,-4,-2};
#ifndef DONT_USE_SOUNDS
word LastGen, GenNum=0;
struct SoundParamBlock SoundPB;
void PlayASound(handle SoundHandle, int Channel, word Frequency)
{
if(ConfigSound==0 || SoundsAreLoaded==0)
return;
HLock(SoundHandle);
SoundPtr=(void *) *SoundHandle;
Channel=Channel > 160 ? 1 : 0;
SoundPB.waveStart=&SoundPtr->StartOfWaveData;
SoundPB.waveSize=SoundPtr->WaveSize;
SoundPB.freqOffset=Frequency;
SoundPB.docBuffer=GenNum<<15;
SoundPB.bufferSize=0x6;
SoundPB.nextWavePtr=NULL;
SoundPB.volSetting=255;
FFStopSound((word) (1<<GenNum));
FFStartSound((word) (Channel<<12 | GenNum<<8 | ffSynthMode), (Pointer) &SoundPB);
GenNum++;
if(GenNum>3)
GenNum=0;
HUnlock(SoundHandle);
}
/*
void PlayASound(handle SoundHandle, int Channel, word Frequency)
{
if(ConfigSound==0 || SoundsAreLoaded==0)
return;
Channel>>=1;
HLock(SoundHandle);
SoundPtr=(void *) *SoundHandle;
SoundPB.waveStart=&SoundPtr->StartOfWaveData;
SoundPB.waveSize=SoundPtr->WaveSize;
SoundPB.freqOffset=Frequency;
SoundPB.docBuffer=GenNum<<15;
SoundPB.bufferSize=0x6;
SoundPB.nextWavePtr=NULL;
SoundPB.volSetting=159-Channel+96;
FFStopSound((word) (1<<GenNum));
FFSetUpSound((word) (0<<12 | GenNum<<8 | ffSynthMode), &SoundPB);
LastGen=GenNum;
GenNum++;
if(GenNum>3)
GenNum=0;
SoundPB.docBuffer=GenNum<<15;
SoundPB.volSetting=Channel+96;
FFStopSound((word) (1<<GenNum));
FFSetUpSound((word) (1<<12 | GenNum<<8 | ffSynthMode), &SoundPB);
FFStartPlaying(1<<GenNum | 1<< LastGen);
GenNum++;
if(GenNum>3)
GenNum=0;
HUnlock(SoundHandle);
} */
handle LoadASound(unsigned long ResID, word *freqOffset)
{
handle WorkHandle;
WorkHandle=LoadResource(rSoundSample, ResID);
if(toolerror())
return 0;
DetachResource(rSoundSample, ResID);
SetHandleID(MyID, WorkHandle);
HLock(WorkHandle);
SoundPtr=(void *) *WorkHandle;
SendRequest(t2CalcFreqOffset, stopAfterOne+sendToName, (longword) toT2Str, (long) (SoundPtr->RealPitch),(void *) &FWToolsOut);
*freqOffset=FWToolsOut.errors;
HUnlock(WorkHandle);
return WorkHandle;
}
void LoadSounds(void)
{
word MyResFile, OldResFile;
int NumSoundsLoaded;
OldResFile=GetCurResourceFile();
MyResFile=OpenResourceFile(1 /* read only */, NULL, LGetPathname2(MyID, 0x0001));
SoundsAreLoaded=1;
SoundHandleExplode=LoadASound(rSoundExplode, &ExplodeFreq);
if(SoundHandleExplode)
{
SoundHandleWhirl= LoadASound(rSoundWhirl, &WhirlFreq);
if(SoundHandleWhirl)
{
SoundHandleBoom= LoadASound(rSoundBoom, &BoomFreq);
if(SoundHandleBoom)
{
SoundHandleLaunch= LoadASound(rSoundLaunch, &LaunchFreq);
if(SoundHandleLaunch);
else {
DisposeHandle(SoundHandleExplode);
DisposeHandle(SoundHandleWhirl);
DisposeHandle(SoundHandleBoom);
SoundsAreLoaded=0;
}
} else {
DisposeHandle(SoundHandleExplode);
DisposeHandle(SoundHandleWhirl);
SoundsAreLoaded=0;
}
} else {
DisposeHandle(SoundHandleExplode);
SoundsAreLoaded=0;
}
} else {
SoundsAreLoaded=0;
}
if(!SoundsAreLoaded)
ConfigSound=0;
CloseResourceFile(MyResFile);
SetCurResourceFile(OldResFile);
}
void UnLoadSounds(void)
{
if(SoundsAreLoaded)
{
DisposeHandle(SoundHandleExplode);
DisposeHandle(SoundHandleLaunch);
DisposeHandle(SoundHandleBoom);
DisposeHandle(SoundHandleWhirl);
SoundsAreLoaded=0;
}
}
#endif
void Wait2(int WaitLength)
{
TmpTick=OldTick;
while(((OldTick=TickCount())<=TmpTick+WaitLength) && (!(*movePtr)));
}
void Wait(int WaitLength)
{
TmpTick=OldTick;
while((OldTick=TickCount())<=TmpTick+WaitLength);
}
void Plot2(int x, int y, int color)
{
Plot(x, y, color);
Plot(320-x, 200-y, color);
}
void set_pixel2(int x, int y, int color)
{
set_pixel(x, y, color);
set_pixel(320-x, 200-y, color);
}
void Plot(int x, int y, int color)
{
char *PP;
if(x<0 || y<0 || x>318 || y>198)
return;
PP=VRam + *(ScreenTablePtr+y) + (x>>1);
if(x & 0x01) {
*PP=(*PP & 0xF0) | color;
*(PP+1)=(*(PP+1) & 0x0F) | (color<<4);
*(PP+160)=(*(PP+160) & 0xF0) | color;
*(PP+161)=(*(PP+161) & 0x0F) | (color<<4);
}else {
*PP=(color<<4)|color;
*(PP+160)=(color<<4)|color;
}
}
/*void Plot(int x, int y, int color)
{
char *PP;
if(x<0 || y<0 || x>318 || y>198)
return;
PP=VRam + *(ScreenTablePtr+y) + (x>>1);
if(ConfigBig) {
if(x & 0x01) {
*PP=(*PP & 0xF0) | color;
*(PP+1)=(*(PP+1) & 0x0F) | (color<<4);
*(PP+160)=(*(PP+160) & 0xF0) | color;
*(PP+161)=(*(PP+161) & 0x0F) | (color<<4);
}else {
*PP=(color<<4)|color;
*(PP+160)=(color<<4)|color;
}
} else {
if(x & 0x01)
*PP=(*PP & 0xF0) | color;
else
*PP=(*PP & 0x0F) | (color<<4);
}
} */
int Spark;
int Angle;
signed int Z;
void Slow(int Wiggle, int Glitter, int BallSize)
{
int C1, C2, C3, FadingI, SmallBallSize;
SmallBallSize=BallSize-14;
do{
C1=random() % 15;
C2=random() % 15;
C3=random() % 15;
} while (C1+C2+C3 < 20);
MyColorTable[1]=(C1*20)/100<<8 | (C2*20)/100<<4 | (C3*20)/100;
for(i=15; i>1; i--) {
MyColorTable[i]=C1<<8 | C2<<4 | C3;
if(C1) C1--;
if(C2) C2--;
if(C3) C3--;
}
SetColorTable(0, MyColorTable);
CyclePointer=15;
HistPointer=0;
#ifndef DONT_USE_SOUNDS
if(Wiggle)
PlayASound(SoundHandleWhirl, IntX, WhirlFreq);
else
PlayASound(SoundHandleExplode, IntX, ExplodeFreq);
#endif
/* Initialize the table of sparks with randm directions */
for(Spark=0; Spark<CurNumSparks; Spark++){
SparkPtr=&Sparks[Spark];
Angle=random()%180;
Z=SinTable[random()%180];
if(Z<0)
Z=(-Z);
SparkPtr->YV=(SinTable[Angle]*Z)/64;
Angle-=45;
if(Angle<0)
Angle+=180;
SparkPtr->XV=(SinTable[Angle]*Z)/64;
SparkPtr->X=IntX<<6;
SparkPtr->Y=IntY<<6;
SparkPtr->HistX[HistPointer]=IntX;
SparkPtr->HistY[HistPointer]=IntY;
}
for(i=0; i<BallSize; i++){
if(*movePtr)
return;
HistPointer++;
if(HistPointer>13)
HistPointer=0;
/* erase old sparks is this is the 14th cycle through */
if(i>13) for(Spark=0; Spark<CurNumSparks; Spark++){
SparkPtr=&Sparks[Spark];
if((!Glitter) || (random()%40))
(*PlotPointer)(SparkPtr->HistX[HistPointer], SparkPtr->HistY[HistPointer], 1);
} /* end for spark erase*/
Cycle();
if (i<SmallBallSize) for(Spark=0; Spark<CurNumSparks; Spark++){
SparkPtr=&Sparks[Spark];
if(SparkPtr->YV< 64 /*(1<<6)*/ )
SparkPtr->YV++; /* spark gravity */
SparkPtr->X+=SparkPtr->XV;
SparkPtr->Y+=SparkPtr->YV;
if(Wiggle && i>15) {
tmp=((i+(Spark<<3))<<3)%180; /* \/ wiggle \/ */
SparkPtr->Y+=Spark % 2?(SinTable[tmp]/2):(-(SinTable[tmp]/2));
tmp-=45;
if(tmp<0)
tmp+=180;
SparkPtr->X+=SinTable[tmp]; /* /\ wiggle /\ */
}
(*PlotPointer)(SparkPtr->HistX[HistPointer]=SparkPtr->X>>6, SparkPtr->HistY[HistPointer]=SparkPtr->Y>>6, CyclePointer);
} /* end for spark draw new*/
} /* end for 130 frames in explosion */
if(Glitter) {
MyColorTable[1]=0x0111;
SetColorTable(0, MyColorTable);
for(i=20; i && (!(*movePtr)); i--){
Cycle();
Wait2(2);
}
} /* end if glitter */
if((!Glitter) && (!Wiggle) && ((random() & 42)==42)) {
for(Spark=0; Spark<CurNumSparks; Spark+=4){
IntX=Sparks[Spark].X>>6;
IntY=Sparks[Spark].Y>>6;
Flasher(3,3,1);
} /* end for spark flash */
} /* end if flash all sparks */
} /* end Slow explosion type */
void Cycle(void)
{
tmp=MyColorTable[15];
memmove(&MyColorTable[3], &MyColorTable[2], 26);
MyColorTable[2]=tmp;
SetColorTable(0, MyColorTable);
CyclePointer++;
if(CyclePointer>15)
CyclePointer=2;
}
int RectAry[4];
int RectAry2[4];
void Flasher(int XSize, int YSize, int LesDelay)
{
#ifndef DONT_USE_SOUNDS
PlayASound(SoundHandleBoom, IntX, BoomFreq);
#endif
RectAry[0]=IntY-YSize;
RectAry[2]=IntY+YSize;
RectAry[1]=IntX-XSize;
RectAry[3]=IntX+XSize;
RectAry2[0]=(200-IntY)-YSize;
RectAry2[2]=(200-IntY)+YSize;
RectAry2[1]=(320-IntX)-XSize;
RectAry2[3]=(320-IntX)+XSize;
tmp=MyColorTable[15];
MyColorTable[15]=0x0FFF;
SetColorTable(0, MyColorTable);
SetSolidPenPat(15);
Wait(LesDelay?1:2);
PaintOval((Rect *) RectAry);
if(ConfigReflect)
PaintOval((Rect *) RectAry2);
MyColorTable[0]=0x0DDD;
MyColorTable[1]=0x0FFF;
Wait(LesDelay?0:1);
/* *((char *)0x00C034)&=0xF0; */ /* make sure boarder is blank */
/* *((char *)0x00C034)|=0x0A; */ /* set boarder color to light grey */
SetColorTable(0, MyColorTable);
SetSolidPenPat(1);
PaintOval((Rect *)RectAry);
if(ConfigReflect)
PaintOval((Rect *) RectAry2);
MyColorTable[0]=0x0000;
MyColorTable[1]=0x0111;
MyColorTable[15]=tmp;
Wait(LesDelay?1:2);
SetColorTable(0, MyColorTable);
/* *((char *)0x00C034)&=0xF0;*/ /* set boarder color to blank */
}
void New(void)
{
CyclePointer=15;
memcpy(MyColorTable, LaunchColorTable, 32);
SetColorTable(0, MyColorTable);
x=((long) (random() % 160))<<16;
y=199<<16;
xv=(random() % 128)<<8;
if(x>(80<<16)){
x+=160<<16;
xv=(-xv);
}
IntX=x>>16;
IntY=y>>16;
yv=-281<<8;
yv+=(random()%819)<<4;
HistPointer=0;
Erase=0;
StopIt=0;
RectAry[0]=IntY-5;
RectAry[2]=IntY+5;
RectAry[1]=IntX-6;
RectAry[3]=IntX+6;
SetSolidPenPat(CyclePointer);
PaintOval((Rect *)RectAry);
if(ConfigReflect)
{
RectAry2[0]=(200-IntY)-5;
RectAry2[2]=(200-IntY)+5;
RectAry2[1]=(320-IntX)-6;
RectAry2[3]=(320-IntX)+6;
PaintOval((Rect *)RectAry2);
}
#ifndef DONT_USE_SOUNDS
PlayASound(SoundHandleLaunch, IntX, LaunchFreq);
#endif
}
LongWord BlankT2Fireworks(void)
{
int StartSoundTool;
#ifndef DONT_USE_SOUNDS
if(ConfigSound)
{
StartSoundTool = SoundToolStatus();
if (!StartSoundTool) {
SendRequest(t2StartupTools, stopAfterOne+sendToName, (longword) toT2Str, (((long)MyID)<<16)+startshut_sound,(void *) &FWToolsOut);
if (FWToolsOut.errors)
{
ConfigSound=0;
return (LongWord) NULL;
}
} else
ConfigSound=0;
}
#endif
ClearScreen (0);
if((*((char *)0x00C035))& 0x08)
VRam=(char *) 0xE10000l;
else
VRam=(char *) 0x010000l;
ScreenTablePtr=(void *) GetAddress(0x0001);
init_plot((char *) VRam,(char *) ScreenTablePtr, toT2Str);
if(ConfigReflect)
{
if(ConfigBig)
PlotPointer=Plot2;
else
PlotPointer=set_pixel2;
} else {
if(ConfigBig)
PlotPointer=Plot;
else
PlotPointer=set_pixel;
}
SetColorTable (0, MyColorTable);
init_random(toT2Str);
set_random_seed();
New();
while (!(*movePtr)) /* Animate the screen until the movePtr becomes true */
{
if(Erase)
(*PlotPointer)(XHist[HistPointer], YHist[HistPointer], 1);
Cycle();
if(StopIt){
StopIt++;
if(StopIt>15){
switch((random()^0x5555)%4){
case 0: Flasher(8,7,0); /* flasher */
break;
case 1: CurNumSparks=(ConfigNumSparks+1)*10; /* normal */
Slow(0,0,85);
break;
case 2: CurNumSparks=((ConfigNumSparks+1)*10)/3; /* wiggle */
Slow(1,0,115);
break;
case 3: CurNumSparks=(ConfigNumSparks+1)*10; /* glitter */
Slow(0,1,85);
break;
} /* end switch effect type */
memset(&MyColorTable[1], 0x0111, 30);
SetColorTable(0, MyColorTable);
Wait2(20 + (random() % 30));
ClearScreen (0);
New();
}
}
else
(*PlotPointer)(IntX, IntY, CyclePointer);
XHist[HistPointer]=IntX;
YHist[HistPointer]=IntY;
HistPointer++;
if(HistPointer>13){
HistPointer=0;
if(!Erase){
SetSolidPenPat(0);
PaintOval((Rect *)RectAry);
if(ConfigReflect)
PaintOval((Rect *)RectAry2);
Erase=1;
}
}
if(!EveryOther){
TmpTick=OldTick;
while((OldTick=TickCount())==TmpTick);
EveryOther=4;
} else
EveryOther--;
x+=xv;
y+=yv;
IntX=x>>16;
IntY=y>>16;
yv+=203; /* "gravity" */
if(yv>(51<<8) && (!StopIt))
StopIt=1;
}
ClearScreen (0);
#ifndef DONT_USE_SOUNDS
if (ConfigSound)
{
FFStopSound((word) 0x7FFF);
SendRequest(t2ShutdownTools, stopAfterOne+sendToName, (long) toT2Str,startshut_sound,(long) NULL);
}
#endif
return (LongWord) NULL;
}
void SaveT2Fireworks(void)
{
word OptionWord;
Word FileNumber;
/* Save current resource file and switch in Twilight.Setup */
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
/* Save control values */
ConfigReflect = GetCtlValue (GetCtlHandleFromID (SetupWindow, ReflectCB));
ConfigNumSparks = GetCtlValue (GetCtlHandleFromID (SetupWindow, NumSparks))-1;
ConfigBig = GetCtlValue (GetCtlHandleFromID (SetupWindow, BigCB));
#ifndef DONT_USE_SOUNDS
ConfigSound = GetCtlValue (GetCtlHandleFromID (SetupWindow, SoundCB));
#endif
OptionWord=(ConfigReflect << 6) | (ConfigSound << 5) | (ConfigBig << 4) | ConfigNumSparks;
SaveConfigResource(ConfigNameString, OptionWord);
/*****************************/
/* Restore old resource file */
/*****************************/
SetCurResourceFile (FileNumber);
}
LongWord HitT2Fireworks(LongWord ControlHit)
{
LongWord EnableFlag = 0L;
if (ControlHit == ReflectCB)
EnableFlag = 1L;
if (ControlHit == NumSparks)
EnableFlag = 1L;
if (ControlHit == BigCB)
EnableFlag = 1L;
#ifndef DONT_USE_SOUNDS
if (ControlHit == SoundCB)
EnableFlag = 1L;
#endif
return EnableFlag;
}
/*****************************************************************************\
|* *|
|* LoadConfigResource- (updated) *|
|* 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;
struct {
word Type;
Long ID;
} HandleInfo;
/**************************************/
/* 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;
}
/*****************************************************************************\
|* *|
|* 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);
/*DisposeHandle (ConfigData); */
}
}
LongWord MakeT2Fireworks (void)
{
CtlRecHndl junk;
Word FileNumber;
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
LoadSetupT2Fireworks();
SetCurResourceFile (FileNumber);
junk=NewControl2(SetupWindow, resourceToResource, (long) ControlList);
#ifndef DONT_USE_SOUNDS
SetCtlValue (ConfigSound, GetCtlHandleFromID (SetupWindow, SoundCB));
#endif
SetCtlValue (ConfigReflect, GetCtlHandleFromID (SetupWindow, ReflectCB));
SetCtlValue (ConfigNumSparks+1, GetCtlHandleFromID (SetupWindow, NumSparks));
SetCtlValue (ConfigBig, GetCtlHandleFromID (SetupWindow, BigCB));
#ifndef DONT_USE_SOUNDS
return 5l;
#else
return 4l;
#endif
}
void LoadSetupT2Fireworks(void)
{
word OptionWord;
/* Option word format
** 0x0040 = Reflect
** 0x0020 = Sound
** 0x0010 = Big
** 0x000F = NumSparks
*/
OptionWord = LoadConfigResource (ConfigNameString, 0x00026);
ConfigReflect = (OptionWord & 0x0040) >> 6;
ConfigSound = (OptionWord & 0x0020) >> 5;
ConfigBig = (OptionWord & 0x0010) >> 4;
ConfigNumSparks = OptionWord & 0x000F;
}
LongWord Fireworks(LongWord data2, LongWord data1, Word message)
{
LongWord Result = 0L;
MyID=MMStartUp();
switch (message)
{
case MakeT2:
SetupWindow = (GrafPortPtr) data1;
SetupFileNumber = (Word) data2;
Result = MakeT2Fireworks ();
break;
case BlankT2:
movePtr=(Word *) data1;
Result = BlankT2Fireworks ();
break;
case SaveT2:
SaveT2Fireworks();
break;
case LoadSetupT2:
DisableSounds=data2 & 1;
LoadSetupT2Fireworks();
#ifndef DONT_USE_SOUNDS
if(DisableSounds)
ConfigSound=0;
if(ConfigSound)
LoadSounds();
#endif
break;
case UnloadSetupT2:
#ifndef DONT_USE_SOUNDS
UnLoadSounds();
#endif
break;
case KillT2:
break;
case HitT2:
Result = HitT2Fireworks(data2);
break;
}
return Result;
}

View File

@ -0,0 +1,6 @@
compile Clock.cc keep=Clock
link Clock random3.c keep=Clock
copy -f Clock *:system:cdevs:twilight:Clock
filetype *:system:cdevs:twilight:Clock $bc $4004
nda

View File

@ -0,0 +1,6 @@
compile Cyclone.cc keep=Cyclone
link Cyclone random3.c keep=Cyclone
copy -f Cyclone *:system:cdevs:twilight:Cyclone
filetype *:system:cdevs:twilight:Cyclone $bc $4004
nda

View File

@ -0,0 +1,6 @@
compile Fireworks.cc keep=Fireworks
link Fireworks random3.c plot2.c keep=Fireworks
copy -f fireworks *:system:cdevs:twilight:fireworks
filetype *:system:cdevs:twilight:fireworks $bc $4004
nda

View File

@ -0,0 +1,6 @@
compile Headlines.cc keep=Headlines
link Headlines random3.c keep=Headlines
copy -f Headlines *:system:cdevs:twilight:Headlines
filetype *:system:cdevs:twilight:Headlines $bc $4004
nda

View File

@ -0,0 +1,6 @@
compile Life.cc keep=Life
link Life random3.c keep=Life
copy -f Life *:system:cdevs:twilight:Life
filetype *:system:cdevs:twilight:Life $bc $4004
n

View File

@ -0,0 +1,7 @@
compile Scanner.cc keep=Scanner
link Scanner keep=Scanner
copy -f Scanner *:system:cdevs:twilight:Scanner
filetype *:system:cdevs:twilight:Scanner $bc $4004
nda
grafoff

View File

@ -0,0 +1,6 @@
compile StringArt.cc keep=StringArt
link StringArt random3.c keep=StringArt
copy -f StringArt *:system:cdevs:twilight:StringArt
filetype *:system:cdevs:twilight:StringArt $bc $4004
n

View File

@ -0,0 +1,6 @@
compile TV.cc keep=TV
link TV keep=TV
copy -f TV *:system:cdevs:twilight:TunnelVision.II
filetype *:system:cdevs:twilight:TunnelVision.II $bc $4004
nda

View File

@ -0,0 +1,7 @@
compile ColorByColor.cc keep=ClrByClr
link ClrByClr random3.c keep=ColorByColor
copy -f ColorByColor *:system:cdevs:twilight:ColorByColor
filetype *:system:cdevs:twilight:ColorByColor $bc $4004
nda
grafoff

View File

@ -0,0 +1,6 @@
compile DripDrop.cc keep=DripDrop
link DripDrop random3.c keep=DripDrop
copy -f DripDrop *:system:cdevs:twilight:DripDrop
filetype *:system:cdevs:twilight:DripDrop $bc $4004
nda

View File

@ -0,0 +1,6 @@
compile Fireworks.cc keep=Fireworks
link Fireworks random3.c plot2.c keep=Fireworks
copy -f fireworks *:system:cdevs:twilight:fireworks.slnt
filetype *:system:cdevs:twilight:fireworks.slnt $bc $4004
nda

View File

@ -0,0 +1,6 @@
compile Inverter.cc keep=Inverter
link Inverter keep=Inverter
copy -f Inverter *:system:cdevs:twilight:Inverter
filetype *:system:cdevs:twilight:Inverter $bc $4004
nda

View File

@ -0,0 +1,7 @@
compile Mountains.cc keep=Mountains
link Mountains random3.c dither keep=Mountains
copy -f Mountains *:system:cdevs:twilight:Mountains
filetype *:system:cdevs:twilight:Mountains $bc $4004
nda
grafoff

View File

@ -0,0 +1,3 @@
copy -f StringArt *:system:cdevs:twilight:StringArt
filetype *:system:cdevs:twilight:StringArt $bc $4004
n

View File

@ -0,0 +1,6 @@
compile Scroll.cc keep=Scroll
link Scroll keep=Scroll
copy -f Scroll *:system:cdevs:twilight:Scroll
filetype *:system:cdevs:twilight:Scroll $bc $4004
n

View File

@ -0,0 +1,6 @@
compile Snow.cc keep=Snow
link Snow random3.c plot2.c keep=Snow
copy -f Snow *:system:cdevs:twilight:Snow
filetype *:system:cdevs:twilight:Snow $bc $4004
n

View File

@ -0,0 +1,6 @@
compile ShortOut.cc keep=ShortOut
link ShortOut Random3.c keep=ShortOut
copy -f ShortOut *:system:cdevs:twilight:ShortOut
filetype *:system:cdevs:twilight:ShortOut $bc $4004
nda

View File

@ -0,0 +1,6 @@
compile Twilight.cc keep=Twilight
link Twilight random3.c plot2.c keep=Twilight
copy -f Twilight *:system:cdevs:twilight:Twilight
filetype *:system:cdevs:twilight:Twilight $bc $4004
n

View File

@ -0,0 +1,434 @@
/*
** Headlines for T2 by James C. Smith
*/
/* File Format
**
** First 50 bytes = File ID and file format version
** array of key word records
** key word record = 2 byte count of number of substitution strings
** there are for this key word.
** 2 byte pointer to text substitution array for this
** key word
** text substitution array = an array of 2 byte pointer to substitution
** strings.
** substitution strin = a \n terminated string. An 0xFF character in
** the string flags a key word in the string
** and is fallowed by a one byte key word number.
** This number is offset by 32 so that key word
** number 10 is not taken for a \n teminating
** the string. The key word number - 32 = the
** position of the key word in the key word
** record array.
**
**
*/
#pragma keep "Headlines"
#pragma cdev Headlines
#pragma optimize -1
#pragma debug 0
#include "T2f.H"
#include "Random3.h"
#include <stdio.h>
#include <string.h>
#include <memory.h>
#include <lineedit.h>
#include <loader.h>
#include <misctool.h>
#include <quickdraw.h>
#include <font.h>
#include <string.h>
#include <stdlib.h>
#include <control.h>
#include <resources.h>
#include <locator.h>
pascal LongWord TickCount() inline(0x1006,dispatcher);
extern int random(void);
extern void set_random_seed(void);
LongWord MakeT2Headlines(void);
void LoadSetupT2Headlines(void);
void SaveConfigResource(char *, word);
word LoadConfigResource(char *, word);
LongWord HitT2Headlines(LongWord);
void SaveT2Headlines(void);
#define HeadlinesIcon 0x0010DD01l
#define ControlList 0x00001003l
#define IconControl 0x00000001l
#define SetFont 0x00000002l
#define DelayPU 0x00000003l
#define QuitAfterOneCB 0x00000004l
#define MyStackSize 512
typedef unsigned int FileAddress;
void DeRef(int);
void Wait(int);
char OutString[256];
int OutStringLen=0, TempInt;
FileAddress TempFileAddress;
int x,y;
word MyID;
FILE *HeadlinesFile;
char FileName[128], *FileNamePtr;
char MyStack[MyStackSize];
int MyStackPointer;
char *ConfigNameStringNumber="\pHeadlines Config Font";
char *ConfigNameStringSize="\pHeadlines Config Size";
char *ConfigNameString="\pHeadlines Configuration";
LongWord ConfigFontID;
int ConfigDelay, ConfigQuitAfterOne;
int RealDelay;
Word SetupFileNumber;
GrafPortPtr SetupWindow;
ColorTable DefColorTable={0,0x0FFF,0,0x0FFF,0,0x0FFF,0,0x0FFF,0,0x0FFF,0,0x0FFF,0,0x0FFF,0,0x0FFF};
ColorTable BlackColorTable={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
Long OldTick=0, TmpTick;
Word *movePtr;
int MyRect[]={5,5,195,635};
struct getInfoOut T2Info={0,0,0xE};
LongWord BlankT2Headlines(void)
{
init_random(toT2Str);
set_random_seed();
SetRandSeed(random());
FileNamePtr=LGetPathname(MyID, 0x0001);
memcpy(FileName, FileNamePtr+1, FileNamePtr[0]);
strcpy(&FileName[FileNamePtr[0]], ".Data");
HeadlinesFile=fopen(FileName, "rb");
if(HeadlinesFile==0)
return (longword) "Error opening the Headlines.Data file!\x0DMake sure it is in the same folder as Headlins.";
fgets(FileName, sizeof FileName, HeadlinesFile);
if(strcmp("Headlines data file version 1.00\n", FileName))
{
fclose(HeadlinesFile);
return (longword) "The Headlines.Data file does not contain valid Headlines\rdata or is made for a different version of Headlines.";
}
SendRequest(t2GetInfo, stopAfterOne+sendToName, (longword) toT2Str, 0, (void *) &T2Info);
Wait(0);
InstallFont(ConfigFontID, 0x0000); /* select configed font */
SetBackColor(0);
SetForeColor(1);
SetSolidBackPat(0);
RealDelay=ConfigDelay * 60;
while (!(*movePtr)) /* Animate the screen until the movePtr becomes true */
{
MyStackPointer=0;
OutStringLen=0;
DeRef(0);
OutString[OutStringLen]=0;
ClearScreen (0);
SetColorTable (0, BlackColorTable);
LETextBox2(OutString, OutStringLen, (Rect *)MyRect, 1);
SetColorTable (0, DefColorTable);
Wait(RealDelay);
if(ConfigQuitAfterOne && (T2Info.count_selected_modules > 1))
break;
}
fclose(HeadlinesFile);
SetPurgeStat(ConfigFontID, (word) purgeBit);
if(*movePtr)
{
return (LongWord) 0;
} else
return (LongWord) bmrNextModule;
}
void Wait(int WaitLength)
{
TmpTick=OldTick;
while(((OldTick=TickCount())<=TmpTick+WaitLength) && (!(*movePtr)));
}
void SaveT2Headlines(void)
{
Word OptionWord;
Word FileNumber;
/* Save current resource file and switch in Twilight.Setup */
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
/* Save control values */
ConfigDelay = GetCtlValue (GetCtlHandleFromID (SetupWindow, DelayPU));
ConfigQuitAfterOne = GetCtlValue (GetCtlHandleFromID (SetupWindow, QuitAfterOneCB));
OptionWord=(ConfigQuitAfterOne<<15)|ConfigDelay;
SaveConfigResource(ConfigNameString, OptionWord);
SaveConfigResource(ConfigNameStringNumber, ConfigFontID & 0x0000FFFF);
SaveConfigResource(ConfigNameStringSize, ConfigFontID >> 16);
/*****************************/
/* Restore old resource file */
/*****************************/
SetCurResourceFile (FileNumber);
}
LongWord HitT2Headlines(LongWord ControlHit)
{
LongWord OldConfigFontID;
LongWord EnableFlag = 0L;
GrafPort MyPort,*OldPort;
if (ControlHit == DelayPU)
EnableFlag = 1L;
if (ControlHit == QuitAfterOneCB)
EnableFlag = 1L;
if (ControlHit == SetFont){
OldConfigFontID=ConfigFontID;
OldPort = GetPort (); /* Save grafport for future restore */
OpenPort (&MyPort); /* Create a new port */
ConfigFontID=ChooseFont((long) ConfigFontID, (word) 0);
SetPort (OldPort);
ClosePort (&MyPort); /* Restore grafport and kill ours */
if(ConfigFontID==0)
ConfigFontID=OldConfigFontID;
else
if(OldConfigFontID != ConfigFontID) EnableFlag = 1L;
}
return EnableFlag;
}
/*****************************************************************************\
|* *|
|* LoadConfigResource- (updated) *|
|* 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;
struct {
word Type;
Long ID;
} HandleInfo;
/**************************************/
/* 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;
}
/*****************************************************************************\
|* *|
|* 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, NULL);
**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);
/*DisposeHandle (ConfigData); */
}
}
LongWord MakeT2Headlines (void)
{
CtlRecHndl junk;
Word FileNumber;
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
LoadSetupT2Headlines();
SetCurResourceFile (FileNumber);
junk=NewControl2(SetupWindow, resourceToResource, (long) ControlList);
SetCtlValue (ConfigDelay, GetCtlHandleFromID (SetupWindow, DelayPU));
SetCtlValue (ConfigQuitAfterOne, GetCtlHandleFromID (SetupWindow, QuitAfterOneCB));
return 4l;
}
void LoadSetupT2Headlines(void)
{
word OptionWord;
/* Option word format
** 0x8000 = Quit After One
** 0x00FF = Delay between Headlines
*/
ConfigFontID = (((LongWord) LoadConfigResource (ConfigNameStringSize, 0x1801)) <<16 ) | ((LongWord) LoadConfigResource (ConfigNameStringNumber, times));
OptionWord = LoadConfigResource (ConfigNameString, 15);
ConfigQuitAfterOne=(OptionWord & 0x8000)>>15;
ConfigDelay=OptionWord & 0x00FF;
}
LongWord Headlines(LongWord data2, LongWord data1, Word message)
{
Handle TempHandle;
LongWord Result = 0L;
MyID=MMStartUp();
switch (message)
{
case MakeT2:
SetupWindow = (GrafPortPtr) data1;
SetupFileNumber = (Word) data2;
Result = MakeT2Headlines ();
break;
case BlankT2:
if(data2 & bmiBlankNow)
ConfigQuitAfterOne=0;
movePtr=(Word *) data1;
Result = BlankT2Headlines ();
if(Result & 0x00FFFFFFul)
{
TempHandle=NewHandle( (long) (strlen((char *) Result)+1), MyID, attrLocked | attrFixed | attrNoCross | attrNoSpec, NULL);
strcpy(*TempHandle, (char *) Result);
Result=(long) TempHandle;
}
break;
case SaveT2:
SaveT2Headlines();
break;
case LoadSetupT2:
LoadSetupT2Headlines();
break;
case UnloadSetupT2:
break;
case KillT2:
break;
case HitT2:
Result = HitT2Headlines(data2);
break;
}
return Result;
}
void DeRef(int KeyWordNumber)
{
int SubNumber/*, LocationInWork*/;
int OrigonalStackPointer;
char *LocalStackPointer;
OrigonalStackPointer=MyStackPointer;
fseek(HeadlinesFile, 50 + KeyWordNumber *(2 + (sizeof (FileAddress))), SEEK_SET);
fread(&TempInt, sizeof (int), 1, HeadlinesFile); /* read number of substitutions for this key word */
fread(&TempFileAddress, sizeof (FileAddress), 1, HeadlinesFile); /* read starting location of list of substitutions */
SubNumber=(random()+Random()) % TempInt;
fseek(HeadlinesFile, TempFileAddress+(SubNumber * (sizeof (FileAddress))), SEEK_SET);
fread(&TempFileAddress, sizeof (FileAddress), 1, HeadlinesFile); /* read starting location of substitution text */
fseek(HeadlinesFile, TempFileAddress, SEEK_SET);
LocalStackPointer=fgets(&MyStack[MyStackPointer], MyStackSize-MyStackPointer, HeadlinesFile);
MyStackPointer+=1+strlen(LocalStackPointer);
for(; *LocalStackPointer; LocalStackPointer++)
{
switch (*LocalStackPointer)
{
case 0xFF:
DeRef(*(++LocalStackPointer)-32);
break;
case '\n':
break;
case 0x5C:
OutString[OutStringLen++]=0x0D;
break;
case '|':
OutString[OutStringLen++]=0x27;
break;
default:
OutString[OutStringLen++]=*LocalStackPointer;
break;
}
}
MyStackPointer=OrigonalStackPointer;
}

View File

@ -0,0 +1,306 @@
/*
** Inverter for T2 by James C. Smith
*/
#pragma keep "Inverter"
#pragma cdev Inverter
#pragma optimize -1
#pragma debug 0
#include "T23.H"
#include <string.h>
#include <types.h>
#include <control.h>
#include <resources.h>
#include <memory.h>
#pragma lint 0
pascal LongWord TickCount() inline(0x1006,dispatcher);
pascal void SysBeep() inline(0x2C03,dispatcher);
#define InverterIcon 0x0010DD01l
#define ControlList 0x00001003l
#define IconControl 0x00000001l
#define DelayPopup 0x00000002l
#define ShapePopup 0x00000003l
#define DelayMenu 0x00000001l
#define ShapeMenu 0x00000002l
LongWord MakeT2Inverter(void);
void LoadSetupT2Inverter(void);
void SaveConfigResource(char *, word);
word LoadConfigResource(char *, word);
LongWord HitT2Inverter(LongWord);
void SaveT2Inverter(void);
Word SetupFileNumber;
GrafPortPtr SetupWindow;
word OptionWord;
int i;
word ConfigDelay, ConfigShape;
Long OldTick=0, TmpTick;
Word *movePtr;
word Colors[16];
char *ConfigNameString="\pInverter Config";
void Wait2(int WaitLength)
{
TmpTick=OldTick;
while(((OldTick=TickCount())<=TmpTick+WaitLength) && (!(*movePtr)));
}
void SetUp(void)
{
char tmp2;
memcpy( Colors, (void *)0xE19E00, 32); /* Colors = color pallet 1 */
/* make sure all SCBs are set to palet 0 */
tmp2=((*((char *) 0xE19DC7))) & ((char)0xF0);
memset( (void *)0xE19D00, tmp2, (size_t) 200);
/* invert colors in work */
for(i=0; i<16; i++)
Colors[i]=
(0x000F - (Colors[i] & 0x000F)) |
(0x00F0 - (Colors[i] & 0x00F0)) |
(0x0F00 - (Colors[i] & 0x0F00));
memcpy( (void *) (0xE19E00 +32 ), Colors, 32); /* store colors in pallete 1 */
/* set SCBs according to ConfigShape */
tmp2=((*((char *) 0xE19DC7))) & ((char)0xF0);
for(i=0; i<200; i++) {
if(!(i % ConfigShape)) tmp2 ^= 0x01;
*((char *) (0xE19D00+i))= tmp2;
}
} /* end setup */
LongWord BlankT2Inverter(void)
{
SetUp();
while (!(*movePtr)) /* Animate the screen until the movePtr becomes true */
{
Wait2(15*ConfigDelay);
memcpy(Colors, (void *)0xE19E00, 32); /* Colors = pallet 0 */
memcpy( (void *) 0xE19E00, (void *) (0xE19E00+32), 32); /* copy pallet1 to pallet0 */
memcpy( (void *) (0xE19E00 + 32), Colors, 32); /* pallet1 = Colors */
}
return (LongWord) NULL;
}
void SaveT2Inverter(void)
{
Word FileNumber;
/* Save current resource file and switch in Twilight.Setup */
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
/* Save control values */
ConfigShape = GetCtlValue (GetCtlHandleFromID (SetupWindow, ShapePopup));
ConfigDelay = GetCtlValue (GetCtlHandleFromID (SetupWindow, DelayPopup))-1;
OptionWord=(ConfigShape<<8) | ConfigDelay;
SaveConfigResource(ConfigNameString, OptionWord);
/*****************************/
/* Restore old resource file */
/*****************************/
SetCurResourceFile (FileNumber);
}
LongWord HitT2Inverter(LongWord ControlHit)
{
LongWord EnableFlag = 0L;
if (ControlHit == ShapePopup)
EnableFlag = 1L;
if (ControlHit == DelayPopup)
EnableFlag = 1L;
return EnableFlag;
}
/*****************************************************************************\
|* *|
|* LoadConfigResource- (updated) *|
|* 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;
struct {
word Type;
Long ID;
} HandleInfo;
/**************************************/
/* 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;
}
/*****************************************************************************\
|* *|
|* 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, NULL);
**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);
/*DisposeHandle (ConfigData); */
}
}
LongWord MakeT2Inverter (void)
{
CtlRecHndl junk;
Word FileNumber;
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
LoadSetupT2Inverter();
SetCurResourceFile (FileNumber);
junk=NewControl2(SetupWindow, resourceToResource, (long) ControlList);
SetCtlValue (ConfigShape, GetCtlHandleFromID (SetupWindow, ShapePopup));
SetCtlValue (ConfigDelay+1, GetCtlHandleFromID (SetupWindow, DelayPopup));
return 0x03l;
}
void LoadSetupT2Inverter(void)
{
/* Option word format
** 0xFF00 = Shape
** 0X00FF = Delay
*/
OptionWord = LoadConfigResource (ConfigNameString, 0x640C);
ConfigShape = (OptionWord & 0xFF00) >> 8;
ConfigDelay = OptionWord & 0x00FF;
}
LongWord Inverter(LongWord data2, LongWord data1, Word message)
{
LongWord Result = 1L;
switch (message)
{
case MakeT2:
SetupWindow = (GrafPortPtr) data1;
SetupFileNumber = (Word) data2;
Result = MakeT2Inverter ();
break;
case BlankT2:
movePtr=(Word *) data1;
Result = BlankT2Inverter ();
break;
case SaveT2:
SaveT2Inverter();
break;
case LoadSetupT2:
LoadSetupT2Inverter();
break;
case UnloadSetupT2:
break;
case KillT2:
break;
case HitT2:
Result = HitT2Inverter(data2);
break;
}
return Result;
}

View File

@ -0,0 +1,253 @@
/*
** Life for T2 by James C. Smith
*/
#pragma keep "Life"
#pragma cdev Life
#include "T23.H"
#include "Random3.H"
#include <quickdraw.h>
#include <string.h>
#pragma optimize -1
#pragma debug 0
#pragma lint 0
#define MaxX 39
#define MaxY 27
#define NumX 40
#define NumY 28
#define StableTimeLimit 15
void Plot(void);
void UnPlot(void);
void PlotII(int, int);
void Upset(void);
pascal LongWord TickCount() inline(0x1006,dispatcher);
pascal void SysBeep() inline(0x2C03,dispatcher);
unsigned int *ScreenTablePtr;
int MyColorTable[16]={ 0x000, /* 0 */
0x500, 0x550, 0x050, 0x505, 0x005, /* 1 2 3 4 5 */
0xA00, 0xAA0, 0x0A0, 0xA0A, 0x00A, /* 6 7 8 9 A */
0xF00, 0xFF0, 0x0F0, 0xF0F, 0x00F}; /* B C D E F */
/*char C=0xFF; */
char Map[NumX][NumY], ChangeX[NumX*NumY], ChangeY[NumX*NumY];
int i,x,y, TheColor, Total, Population=0, OldPopulation, StableTime=0, NumChanges;
unsigned long *LongPointer;
Word *movePtr;
void Upset(void)
{
int x2,y2;
StableTime=0;
x2=random() % (MaxX-4);
y2=random() % (MaxY-4);
switch (random() & 0x03)
{
case 0:
PlotII(x2,y2);
PlotII(x2,y2+1);
PlotII(x2,y2+2);
PlotII(x2+1,y2+2);
PlotII(x2+2,y2+1);
break;
case 1:
PlotII(x2,y2);
PlotII(x2+2,y2);
PlotII(x2+1,y2+1);
PlotII(x2+2,y2+1);
PlotII(x2+1,y2+2);
break;
case 2:
PlotII(x2,y2);
PlotII(x2+1,y2);
PlotII(x2+2,y2);
PlotII(x2+2,y2+1);
PlotII(x2+2,y2+2);
PlotII(x2+1,y2+2);
PlotII(x2,y2+2);
PlotII(x2,y2+1);
break;
case 3:
PlotII(x2,y2);
PlotII(x2,y2+1);
PlotII(x2+1,y2+1);
PlotII(x2+1,y2+2);
PlotII(x2+2,y2);
PlotII(x2+2,y2+1);
PlotII(x2+3,y2+1);
PlotII(x2+3,y2+2);
break;
}
}
void PlotII(int X, int Y)
{
x=X;
y=Y;
Plot();
Map[x][y]=1;
}
void Plot(void)
{
LongPointer=(void *) (0xE10000+(x<<2)+*(ScreenTablePtr+y*7));
switch(TheColor)
{
case 1:
*LongPointer= 0xFAFFFFFF;
*(LongPointer+40)= 0xA5AAAAFA;
*(LongPointer+80)= 0xA5AAAAFA;
*(LongPointer+120)= 0xA5AAAAFA;
*(LongPointer+160)= 0xA5AAAAFA;
*(LongPointer+200)= 0xA5AAAAFA;
*(LongPointer+240)= 0x555555A5;
break;
case 2:
*LongPointer= 0xE9EEEEEE;
*(LongPointer+40)= 0x949999E9;
*(LongPointer+80)= 0x949999E9;
*(LongPointer+120)= 0x949999E9;
*(LongPointer+160)= 0x949999E9;
*(LongPointer+200)= 0x949999E9;
*(LongPointer+240)= 0x44444494;
break;
case 3:
*LongPointer= 0xD8DDDDDD;
*(LongPointer+40)= 0x838888D8;
*(LongPointer+80)= 0x838888D8;
*(LongPointer+120)= 0x838888D8;
*(LongPointer+160)= 0x838888D8;
*(LongPointer+200)= 0x838888D8;
*(LongPointer+240)= 0x33333383;
break;
case 4:
*LongPointer= 0xC7CCCCCC;
*(LongPointer+40)= 0x727777C7;
*(LongPointer+80)= 0x727777C7;
*(LongPointer+120)= 0x727777C7;
*(LongPointer+160)= 0x727777C7;
*(LongPointer+200)= 0x727777C7;
*(LongPointer+240)= 0x22222272;
break;
case 5:
*LongPointer= 0xB6BBBBBB;
*(LongPointer+40)= 0x616666B6;
*(LongPointer+80)= 0x616666B6;
*(LongPointer+120)= 0x616666B6;
*(LongPointer+160)= 0x616666B6;
*(LongPointer+200)= 0x616666B6;
*(LongPointer+240)= 0x11111161;
break;
}
}
void UnPlot(void)
{
LongPointer=(void *) (0xE10000+(x<<2)+*(ScreenTablePtr+y*7));
*(unsigned long*)LongPointer=0;
*(unsigned long*)(LongPointer+40)=0;
*(unsigned long*)(LongPointer+80)=0;
*(unsigned long*)(LongPointer+120)=0;
*(unsigned long*)(LongPointer+160)=0;
*(unsigned long*)(LongPointer+200)=0;
*(unsigned long*)(LongPointer+240)=0;
}
LongWord BlankT2Life(void)
{
init_random(toT2Str);
set_random_seed();
TheColor=1;
ScreenTablePtr=(void *) GetAddress(0x0001);
SetColorTable (0, MyColorTable);
memset(Map, 0, sizeof Map);
for (i=0; i< 250; i++){
x=random()%NumX;
y=random()%NumY;
if(!Map[x][y])
Population++;
Map[x][y]=1;
Plot();
}
while (!(*movePtr)) /* Animate the screen until the movePtr becomes true */
{
TheColor++;
if(TheColor==6)
TheColor=1;
OldPopulation=Population;
NumChanges=0;
/* C-=0x11;
if(C==0x11)
C=0xFF; */
for(y=0; y<NumY && (!(*movePtr)); y++){
for(x=0; x<NumX; x++){
switch (Total=Map[x==0 ? MaxX:x-1][y==0 ? MaxY:y-1]+Map[x==0 ? MaxX:x-1][y]+Map[x==0 ? MaxX:x-1][y==MaxY ? 0:y+1]+Map[x][y==0 ? MaxY:y-1] \
+Map[x][y==MaxY ? 0:y+1]+Map[x==MaxX ? 0:x+1][y==0 ? MaxY:y-1]+Map[x==MaxX ? 0:x+1][y]+Map[x==MaxX ? 0:x+1][y==MaxY ? 0:y+1]){
case 2: break;
case 3: if(Map[x][y])
break;
Population++;
ChangeX[NumChanges]=x;
ChangeY[NumChanges++]=y;
break;
default: if(!Map[x][y])
break;
Population--;
ChangeX[NumChanges]=x;
ChangeY[NumChanges++]=y;
break;
} /* end switch total */
} /* end x loop */
} /* end y loop */
if (NumChanges) for(i=0; i<NumChanges; i++)
{
x=ChangeX[i];
y=ChangeY[i];
if(Map[x][y]=1-Map[x][y])
Plot();
else
UnPlot();
}
if(Population==OldPopulation)
{
StableTime++;
if(StableTime>StableTimeLimit)
Upset();
}
else
StableTime=0;
}
ClearScreen(0);
return (LongWord) NULL;
}
LongWord Life(LongWord data2, LongWord data1, Word message)
{
LongWord Result = 0L;
switch (message)
{
case BlankT2:
movePtr=(Word *) data1;
Result = BlankT2Life ();
break;
case MakeT2:
case SaveT2:
case LoadSetupT2:
case UnloadSetupT2:
case KillT2:
case HitT2:
break;
}
return Result;
}

View File

@ -0,0 +1,496 @@
/*
** Mountain for T2 by James C. Smith
*/
#pragma keep "Mountain"
#pragma cdev Mountain
#pragma optimize -1
#pragma debug 0
#include "T2f.H"
#include "Random3.H"
#define NumColors 7 /* number of colors we can access from our custom color palette */
#define NumShades 11 /* number of shades we can derive from each color */
#define MountainIcon 0x0010DD01l
#define ControlList 0x00001003l
#define DetailPopUp 0x00000001l
#define SmoothnesPopUp 0x00000002l
#define DelayPopUp 0x00000003l
#define IconControl 0x00000004l
#define QuitAfterOneCB 0x00000005l
#define MaxXRes 129
#define MaxYRes 129
#include <string.h>
#include <stdlib.h>
#include <quickdraw.h>
#include <control.h>
#include <resources.h>
#include <orca.h>
#include <locator.h>
#include <memory.h>
pascal void SysBeep() inline(0x2C03,dispatcher);
pascal LongWord TickCount() inline(0x1006,dispatcher);
typedef longword Pattern2[8]; /* this is another, more convenient way of representing QuickDraw's Pattern data structure */
extern Pattern2 ditherColor[NumColors][NumShades]; /* the array of dithered colors with shades per color */
extern void SetCustomDitherColorPatterns(void);
#pragma lint -1
void Plot(int x, int y, int color);
void Subdivite(int x1, int y1, int x2, int y2);
void SetColor(int xa, int ya, int x, int y, int xb, int yb);
void MySetColorTable(void);
void DrawTriangle(int, int, int, int, int, int);
int PickColor(int/*, int*/);
LongWord MakeT2Mountain(void);
void LoadSetupT2Mountain(void);
void SaveConfigResource(char *, word);
word LoadConfigResource(char *, word);
LongWord HitT2Mountain(LongWord);
void SaveT2Mountain(void);
LongWord BlankT2Mountain(void);
void D3(int X,int Y, int *X2, int *Y2);
char *ConfigNameString="\pMountain Config";
unsigned int ConfigSmoothnes, ConfigDetail, ConfigDelay2, ConfigDelay, ConfigQuitAfterOne;
int ActSmoothnes;
Word *movePtr;
long NewTick, OldTick;
char Grid[MaxXRes][MaxYRes];
int XRes, YRes, i;
Word SetupFileNumber;
GrafPortPtr SetupWindow;
RegionHndl Triangle;
long VRam;
void D3(int X,int Y, int *X2, int *Y2)
{
int Z;
/* int OpY;
OpY=YRes-Y; */
Z=Grid[X][Y];
/* *X2=(X*10)-X+(OpY<<1)+((X>>1) ? -(OpY) : (OpY))-(YRes>>2);
*Y2=70+(Y<<2)-(((Z>60?Z:60)*Y)>>7); */ /* this method does a funky type of perspective */
/* *X2=(X*6)-(X)+((YRes-Y)<<1)-YRes;
*Y2=70+(Y<<1)-((Z>60?Z:60)/10); */ /* Let's reduce size for 65*65 rather than 33*33 */
#define Angle 45
#define Width ((long) (320+Angle+20))
#define Height 180
*X2=(X*Width/XRes)-(Y*Angle/YRes);
*Y2=50+(Y*Height/YRes)-((Z>60?Z:60)*3/XRes); /*Let's attempt scaling!!!!! for variable detail */
/* *X2=(X*12)-(X<<1)+((YRes-Y)<<1)-YRes;
*Y2=70+(Y<<2)-((Z>60?Z:60)/6); */ /* Old Faithfull */
/* *X2=(X*10)-X+((YRes-Y)<<1)-YRes;
*Y2=70+(Y<<2)-((Z>60?Z:60)/6); */ /* this is what was used in the origonal beta release of mountains */
}
struct getInfoOut T2Info={0,0,0xE};
LongWord BlankT2Mountain(void)
{
SendRequest(t2GetInfo, stopAfterOne+sendToName, (longword) toT2Str, 0, (void *) &T2Info);
init_random(toT2Str);
set_random_seed();
SetCustomDitherColorPatterns();
ActSmoothnes=ConfigSmoothnes-2;
ConfigDelay2=ConfigDelay*120;
Triangle=NewRgn();
SetPenMode(modeCopy);
SetPenSize(1, 1);
/* *((char *) 0x00C034)|=0x01; */ /* change the border color */
if((*((char *)0x00C035))& 0x08)
VRam=0xE12000l;
else
VRam=0x012000l;
XRes=3;
for(i=0; i<ConfigDetail; i++)
XRes=XRes*2-1;
YRes=XRes;
while (!(*movePtr))
{
ClearScreen (0);
memset(Grid, 0, sizeof (Grid));
MySetColorTable();
Plot(0, 0, (random() % 255)+1);
Plot(XRes-1, 0, (random() % 255)+1);
Plot(XRes-1, YRes-1, (random() % 255)+1);
Plot(0, YRes-1, (random() % 255)+1);
Subdivite(0,0,XRes-1,YRes-1);
NewTick=OldTick=TickCount();
if(ConfigDelay>1)
while( (!(*movePtr)) && (NewTick<OldTick+(long)ConfigDelay2) )
NewTick=TickCount();
if(ConfigQuitAfterOne && (T2Info.count_selected_modules > 1))
break;
}
if(*movePtr)
{
return (LongWord) 0;
} else
return (LongWord) bmrNextModule;
}
/*int MyColorTable[]={0x0000,0x0118,0x0AFA,0x09F9,0x08E8,0x07D7,0x06C6,0x05B5,0x04A4,0x0393,0x0282,0x0171,0x0260,0x0350,0x0240, 0x0FFF};*/
/*int MyColorTable[]={0x0000,0x0004,0x0118,0x0474,0x08E8,0x0363,0x06C6,0x0252,0x04A4,0x0141,0x0282,0x0131,0x0260,0x0120,0x0240, 0x0FFF};*/
int MyColorTable[]={0x0000,0x0006,0x0118,0x0AFA,0x09F9,0x08E8,0x07D7,0x06C6,0x05B5,0x04A4,0x0393,0x0282,0x0171,0x0260,0x0350, 0x0FFF};
void MySetColorTable(void)
{
memcpy((void *)(VRam+0x007E00l), MyColorTable, 32);
}
void Plot(int x3, int y3, int color)
{
Grid[x3][y3]=(char)color;
}
void DrawTriangle(int x1, int y1, int x2, int y2, int x3, int y3)
{
OpenRgn();
MoveTo(x1, y1);
LineTo(x2, y2);
LineTo(x3, y3);
LineTo(x1, y1);
CloseRgn(Triangle);
PaintRgn(Triangle);
/* SetSolidPenPat(0);
MoveTo(x1, y1);
LineTo(x2, y2);
LineTo(x3, y3);
LineTo(x1, y1); */
SetEmptyRgn(Triangle);
}
int PickColor(int Color/*, int MyShade*/)
{
int n;
n=Color < 64 ? 0: (Color-64)*77/(256-64);
/* n=Color < 64 ? 0: (Color-64)/32+1; */
/* n=Color < 64 ? 1: (Color-64)/14+2; */
SetPenPat(&ditherColor[0][n]);
/* SetPenPat(&ditherColor[n][MyShade]);*/ /* here we set the dithered color indexed by the shade and color */
/* SetSolidPenPat(n); */
}
void Subdivite(int x1, int y1, int x2, int y2)
{
int x,y,color;
int X3D1, Y3D1;
int X3D2, Y3D2;
int X3D3, Y3D3;
int X3D4, Y3D4;
int X3D5, Y3D5;
if (*movePtr)
return;
x=(x1+x2)>>1;
y=(y1+y2)>>1;
color=(Grid[x1][y1]+Grid[x2][y1]+Grid[x2][y2]+Grid[x1][y2])>>2;
if(!Grid[x][y])
Plot(x,y,color);
if((x2-x1<2) && (y2-y1<2)) /* ibit was not or equil */
{
D3(x1, y1, &X3D1, &Y3D1);
D3(x2, y1, &X3D2, &Y3D2);
D3(x, y, &X3D3, &Y3D3);
D3(x1, y2, &X3D4, &Y3D4);
D3(x2, y2, &X3D5, &Y3D5);
PickColor((Grid[x1][y1]+Grid[x2][y1]+Grid[x][y])/3/*,3*/);
DrawTriangle(X3D1,Y3D1,X3D2,Y3D2,X3D3,Y3D3);
PickColor((Grid[x1][y1]+Grid[x1][y2]+Grid[x][y])/3/*,5*/);
DrawTriangle(X3D1,Y3D1,X3D4,Y3D4,X3D3,Y3D3);
PickColor((Grid[x2][y1]+Grid[x2][y2]+Grid[x][y])/3/*,7*/);
DrawTriangle(X3D2,Y3D2,X3D5,Y3D5,X3D3,Y3D3);
PickColor((Grid[x1][y2]+Grid[x2][y2]+Grid[x][y])/3/*,9*/);
DrawTriangle(X3D4,Y3D4,X3D5,Y3D5,X3D3,Y3D3);
return;
}
SetColor(x1,y1,x,y1,x2,y1);
SetColor(x2,y1,x2,y,x2,y2);
SetColor(x1,y2,x,y2,x2,y2);
SetColor(x1,y1,x1,y,x1,y2);
Subdivite(x1,y1,x,y);
Subdivite(x,y1,x2,y);
Subdivite(x1,y,x,y2);
Subdivite(x,y,x2,y2);
}
void SetColor(int xa, int ya, int x, int y, int xb, int yb)
{
long color;
if(Grid[x][y])
return;
color=abs(xa-xb) + abs(ya-yb);
if(ActSmoothnes>0)
color>>=ActSmoothnes;
if(ActSmoothnes<0)
color<<=abs(ActSmoothnes);
if(!color)
color=1;
color<<=4; /* ibit changed for 256 mode */
color=(random() % (color<<1)+1 )-color;
color+=(Grid[xa][ya]+Grid[xb][yb])>>1;
if(color<1)
color=1;
if(color>255)
color=255;
Plot(x,y,(int) color);
}
void SaveT2Mountain(void)
{
Word FileNumber, OptionWord;
/* Save current resource file and switch in Twilight.Setup */
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
/* Save control values */
ConfigSmoothnes = GetCtlValue (GetCtlHandleFromID (SetupWindow, SmoothnesPopUp));
ConfigDetail = GetCtlValue (GetCtlHandleFromID (SetupWindow, DetailPopUp));
ConfigDelay = GetCtlValue (GetCtlHandleFromID (SetupWindow, DelayPopUp));
ConfigQuitAfterOne = GetCtlValue (GetCtlHandleFromID (SetupWindow, QuitAfterOneCB));
OptionWord=(ConfigQuitAfterOne << 15) | (ConfigDelay << 8) | ((ConfigSmoothnes-1) << 4) | ((ConfigDetail-1));
SaveConfigResource(ConfigNameString, OptionWord);
/*****************************/
/* Restore old resource file */
/*****************************/
SetCurResourceFile (FileNumber);
}
LongWord HitT2Mountain(LongWord ControlHit)
{
LongWord EnableFlag = 0L;
if (ControlHit == DelayPopUp)
EnableFlag = 1L;
if (ControlHit == SmoothnesPopUp)
EnableFlag = 1L;
if (ControlHit == DetailPopUp)
EnableFlag = 1L;
if (ControlHit == QuitAfterOneCB)
EnableFlag = 1L;
return EnableFlag;
}
/*****************************************************************************\
|* *|
|* LoadConfigResource- (updated) *|
|* 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;
struct {
word Type;
Long ID;
} HandleInfo;
/**************************************/
/* 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;
}
/*****************************************************************************\
|* *|
|* 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, NULL);
**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);
/*DisposeHandle (ConfigData); */
}
}
LongWord MakeT2Mountain (void)
{
CtlRecHndl junk;
Word FileNumber;
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
LoadSetupT2Mountain();
SetCurResourceFile (FileNumber);
junk=NewControl2(SetupWindow, resourceToResource, (long) ControlList);
SetCtlValue (ConfigSmoothnes, GetCtlHandleFromID (SetupWindow, SmoothnesPopUp));
SetCtlValue (ConfigDetail, GetCtlHandleFromID (SetupWindow, DetailPopUp));
SetCtlValue (ConfigDelay, GetCtlHandleFromID (SetupWindow, DelayPopUp));
SetCtlValue (ConfigQuitAfterOne, GetCtlHandleFromID (SetupWindow, QuitAfterOneCB));
return 0x05l;
}
void LoadSetupT2Mountain(void)
{
word OptionWord;
/* Option word format
** 0x8000 = Quit After One
** 0x7F00 = Delay
** 0X00F0 = Smoothnes
** 0X000F = Detail
*/
OptionWord = LoadConfigResource (ConfigNameString, 0x0F13);
ConfigQuitAfterOne = (OptionWord & 0x8000) >> 15;
ConfigDelay = (OptionWord & 0x7F00) >> 8;
ConfigSmoothnes = ((OptionWord & 0x00F0)>>4)+1;
ConfigDetail = (OptionWord & 0x000F)+1;
}
LongWord Mountain(LongWord data2, LongWord data1, Word message)
{
LongWord Result = 0L;
switch (message)
{
case MakeT2:
SetupWindow = (GrafPortPtr) data1;
SetupFileNumber = (Word) data2;
Result = MakeT2Mountain ();
break;
case BlankT2:
if(data2 & bmiBlankNow)
ConfigQuitAfterOne=0;
movePtr=(Word *) data1;
Result = BlankT2Mountain ();
break;
case SaveT2:
SaveT2Mountain();
break;
case LoadSetupT2:
LoadSetupT2Mountain();
break;
case UnloadSetupT2:
break;
case KillT2:
break;
case HitT2:
Result = HitT2Mountain(data2);
break;
}
return Result;
}

View File

@ -0,0 +1,132 @@
/*
** Scanner for T2 by James C. Smith
*/
#pragma keep "Scanner"
#pragma cdev Scanner
#pragma optimize 0
#pragma debug 0
#include "T23.H"
#include "Random3.h"
#include <string.h>
#include <memory.h>
#include <types.h>
/*#include <quickdraw.h> */
#pragma lint 0
pascal LongWord TickCount() inline(0x1006,dispatcher);
pascal void SysBeep() inline(0x2C03,dispatcher);
int i,i2, Direction=1;
Long OldTick=0, TmpTick;
Word *movePtr;
char OldSCB;
int ColorTableCount[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
unsigned SL, CT;
long VRam;
void SetUp(void)
{
unsigned char *tmp, tmp2;
unsigned int FTmp;
VRam=0xE12000l;
for(SL=0; SL<200; SL++) /* Count the ocurences of references to each color table in the SCBs */
ColorTableCount[*((char *) (0xE19D00+SL)) & 0x0F]++;
SL=0;
for(CT=1; CT<16; CT++) /* find the color table that has the most ocurences */
if(ColorTableCount[CT] > ColorTableCount[SL])
SL=CT;
/* Copy the LS color table to all other color tables */
for(i=0; i<16; i++){
if(i != SL)
memcpy( (void *) (VRam+0x007E00 + i * 32), (void *) (VRam+0x007E00 + SL * 32), 32);
}
/* Get a current SCB */
OldSCB=*((char *) VRam+0x007D50);
/* make sure all SCBs are set to color table 0 */
tmp2=*((char *) (VRam+0x007DC7)) & ((char)0xF0);
memset((void *) (VRam+0x007D00), tmp2, (size_t) 200);
/* Dim each pallete */
for(i=1; i<(16); i++){ /* loop each pallet */
FTmp=16*(16-i);
for(i2=0; i2<32; i2++){ /* loop each byte in palete */
tmp=(unsigned char *) (VRam+0x007E00+i*32+i2);
*tmp=(*tmp & 0xF0) | ( ((unsigned char) (((*tmp & 0x0F) * FTmp)>>8)));
*tmp=(*tmp & 0x0F) | (( ((unsigned char) ((((*tmp & 0xF0)>>4) * FTmp)>>8)))<<4);
} /* end loop each byte */
} /* end loop each pallete */
i=0;
} /* end setup */
LongWord BlankT2Scanner(void)
{
char *SCBPointer;
char Range, tmp;
SetUp();
while (!(*movePtr)) /* Animate the screen until the movePtr becomes true */
{
TmpTick=OldTick;
while((OldTick=TickCount())<=(TmpTick+1));
if(i>99) {
if(Direction==1) {
BlockMove((void *) (VRam+0x007D01l), (void *) (VRam+0x007D00l), 199l);
} else {
BlockMove((void *) (VRam+0x007D00l), (void *) (VRam+0x007D01l), 199l);
}
i2+=Direction;
if(i2==16 || i2==185) Direction=(-Direction);
} else {
for(Range=0; Range<15 && Range<=i; Range++){
SCBPointer=(char *) (VRam+0x007D00l+i-Range);
*SCBPointer=((*SCBPointer) & 0xF0) | Range;
SCBPointer=(char *) (VRam+0x007DC7-i+Range);
*SCBPointer=((*SCBPointer) & 0xF0) | Range;
}
i++;
i2=100;
}
}
memset((void *) (VRam+0x007D00), OldSCB, (size_t) 200);
return (LongWord) NULL;
}
LongWord Scanner(LongWord data2, LongWord data1, Word message)
{
LongWord Result = 0L;
switch (message)
{
case BlankT2:
movePtr=(Word *) data1;
Result = BlankT2Scanner ();
break;
case MakeT2:
case SaveT2:
case LoadSetupT2:
case UnloadSetupT2:
case KillT2:
case HitT2:
break;
}
return Result;
}

View File

@ -0,0 +1,333 @@
/*
** Scroll for T2 by James C. Smith
*/
#pragma keep "Scroll"
#pragma cdev Scroll
#pragma optimize -1
#pragma debug 0
#include "T23.H"
#include <string.h>
#include <memory.h>
#include <types.h>
#include <control.h>
#include <resources.h>
#define ScrollIcon 0x0010DD01l
#define ControlList 0x00001003l
#define IconSontrol 0x00000001l
#define SizePopUp 0x00000002l
#define LinesPerFramePopUp 0x00000003l
#define MaxLinesPerFrame 8
#pragma lint 0
pascal LongWord TickCount() inline(0x1006,dispatcher);
pascal void SysBeep() inline(0x2C03,dispatcher);
LongWord MakeT2Scroll(void);
void LoadSetupT2Scroll(void);
void SaveConfigResource(char *, word);
word LoadConfigResource(char *, word);
LongWord HitT2Scroll(LongWord);
void SaveT2Scroll(void);
Word SetupFileNumber;
GrafPortPtr SetupWindow;
word OptionWord;
char *ConfigNameString="\pScroll Config";
word ConfigSize,ConfigLinesPerFrame;
long LinesPerFrame;
long NumLinesToScroll;
long FirstLine;
long YV;
long TimeTillMove;
Long OldTick=0, TmpTick;
Word *movePtr;
char Buffer[160*MaxLinesPerFrame];
long VRam;
int ColorTableCount[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
LongWord BlankT2Scroll(void)
{
unsigned tmp2, SL, CT;
/* long NumLinesToScroll2, LinesPerFrame2, YV2;
char *FirstLine2, Buffer2[MaxLinesPerFrame]; */
if((*((char *)0x00C035))& 0x08)
VRam=0xE12000l;
else
VRam=0x012000l;
for(SL=0; SL<200; SL++) /* Count the ocurences of references to each color table in the SCBs */
ColorTableCount[*((char *) (0xE19D00+SL)) & 0x0F]++;
SL=0;
for(CT=1; CT<16; CT++) /* find the color table that has the most ocurences */
if(ColorTableCount[CT] > ColorTableCount[SL])
SL=CT;
/* make sure all SCBs are set to color table SL (the ones used the most)*/
tmp2=*((char *) (0xE12000+0x007DC7)) & ((char)0xF0);
tmp2|=SL;
memset((void *) (0xE12000+0x007D00), tmp2, (size_t) 200);
if(ConfigSize != 200)
{
if((ConfigLinesPerFrame<<1) > ConfigSize) ConfigLinesPerFrame=ConfigSize>>1;
ConfigSize=(ConfigSize/ConfigLinesPerFrame)*ConfigLinesPerFrame;
}
LinesPerFrame=ConfigLinesPerFrame*160l;
/* LinesPerFrame2=ConfigLinesPerFrame; */
NumLinesToScroll=ConfigSize*160l;
/* NumLinesToScroll2=ConfigSize; */
FirstLine=0l*160l;
/* FirstLine2=(void *) (0xE12000l+0x7D00l); */
YV=160l;
/* YV2=1; */
TimeTillMove=0;
while (!(*movePtr)) /* Animate the screen until the movePtr becomes true */
{
/* TmpTick=OldTick;
while((OldTick=TickCount())==(TmpTick)); */
if(ConfigSize != 200) {
if(!TimeTillMove) {
TimeTillMove=NumLinesToScroll;
FirstLine+=YV;
/* FirstLine2+=YV2; */
if(FirstLine==0 | (FirstLine+NumLinesToScroll==200l*160l))
{
YV=(-YV);
/* YV2=(-YV2); */
}
}
TimeTillMove-=LinesPerFrame;
}
BlockMove((void *)(VRam+FirstLine), Buffer, (long) (LinesPerFrame));
BlockMove((void *)(VRam+LinesPerFrame+FirstLine), (void *)(VRam+FirstLine), (long) NumLinesToScroll-LinesPerFrame);
BlockMove(Buffer, (void *)(VRam+ FirstLine+ (NumLinesToScroll-LinesPerFrame)), (long) LinesPerFrame);
/* BlockMove((void *)(FirstLine2), Buffer2, (long) (LinesPerFrame2));
BlockMove((void *)(LinesPerFrame2+FirstLine2), (void *)(FirstLine2), (long) NumLinesToScroll2-LinesPerFrame2);
BlockMove(Buffer2, (void *)(FirstLine2+ (NumLinesToScroll2-LinesPerFrame2)), (long) LinesPerFrame2);*/
}
return (LongWord) NULL;
}
void SaveT2Scroll(void)
{
Word FileNumber;
/* Save current resource file and switch in Twilight.Setup */
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
/* Save control values */
ConfigSize = GetCtlValue (GetCtlHandleFromID (SetupWindow, SizePopUp));
ConfigLinesPerFrame = GetCtlValue (GetCtlHandleFromID (SetupWindow, LinesPerFramePopUp));
OptionWord=((ConfigLinesPerFrame-1)<<8) | ConfigSize;
SaveConfigResource(ConfigNameString, OptionWord);
/*****************************/
/* Restore old resource file */
/*****************************/
SetCurResourceFile (FileNumber);
}
LongWord HitT2Scroll(LongWord ControlHit)
{
LongWord EnableFlag = 0L;
if (ControlHit == LinesPerFramePopUp)
EnableFlag = 1L;
if (ControlHit == SizePopUp)
EnableFlag = 1L;
return EnableFlag;
}
/*****************************************************************************\
|* *|
|* LoadConfigResource- (updated) *|
|* 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;
struct {
word Type;
Long ID;
} HandleInfo;
/**************************************/
/* 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;
}
/*****************************************************************************\
|* *|
|* 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, NULL);
**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);
/*DisposeHandle (ConfigData); */
}
}
LongWord MakeT2Scroll (void)
{
CtlRecHndl junk;
Word FileNumber;
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
LoadSetupT2Scroll();
SetCurResourceFile (FileNumber);
junk=NewControl2(SetupWindow, resourceToResource, (long) ControlList);
SetCtlValue (ConfigSize, GetCtlHandleFromID (SetupWindow, SizePopUp));
SetCtlValue (ConfigLinesPerFrame, GetCtlHandleFromID (SetupWindow, LinesPerFramePopUp));
return 0x03l;
}
void LoadSetupT2Scroll(void)
{
/* Option word format
** 0x0F00 = LinesPerFrame
** 0X00FF = Size
*/
OptionWord = LoadConfigResource (ConfigNameString, 0x07C8);
ConfigLinesPerFrame = ((OptionWord & 0x0F00)>>8)+1;
ConfigSize = OptionWord & 0x00FF;
}
LongWord Scroll(LongWord data2, LongWord data1, Word message)
{
LongWord Result = 0L;
switch (message)
{
case MakeT2:
SetupWindow = (GrafPortPtr) data1;
SetupFileNumber = (Word) data2;
Result = MakeT2Scroll ();
break;
case BlankT2:
movePtr=(Word *) data1;
Result = BlankT2Scroll ();
break;
case SaveT2:
SaveT2Scroll();
break;
case LoadSetupT2:
LoadSetupT2Scroll();
break;
case UnloadSetupT2:
break;
case KillT2:
break;
case HitT2:
Result = HitT2Scroll(data2);
break;
}
return Result;
}

View File

@ -0,0 +1,19 @@
First of all, one reminder. SLED and my other recent Twilight II modules are NOT property of Digisoft Innovations. In the future an agreement will probably be maid with DSI to distribute my new modules with an update to Twilight II. However, for now I retain the rights. If Soft Disk, GS+, or some one else expresses interest in them I may go that route.
Now that that's over with, here is what's new in SLED.
First I rewrote all the screen update code in assembly. When it was all finished it ended up being faster than the C version but not dramatically. After some help from Jim over the phone I managed to optimize the ams code a LOT. It is now MUCH faster. You can actually scroll text at full speed on an un-accelerated GS without skipping any frames.
Next I added some new commands. You can now change colors, do wipes and fades, use inverse and more.
With all the new commands my "scripts" got VERY cryptic. I broke down a wrote a read script interpreter. One that uses real words like <PRINT> and <SCROLL>. Some of the command even have arguments. Even optional and multiple arguments. And LOOP!
Unfortunately with the improved interpreter came a small loss of speed. SLED skips a frame here and there when scrolling text on stock GS.
Almost everyone said SLED scrolls text too fast. To show you why I use the speed I do I have added a way to slow it down. Normally SLED updates the screen once of 1/60th of a second. If you hold down the command key it will slow down to one frame every 2/60th of a second. You will see it looks very choppy. BTW, you can hold option to see SLED go all out full speed.
At the request of Greg I changed the way the LEDs are drawn to make them use two colors to make them look rounder and more 3D. They don't look much better but now they do look more like LEDs than tinny red stop signs. If you think you could draw a better one then feel free to play with the SHR screen I included in the archive. If you come up with a better pallet and or LED shape let me know!
Finally, I touched up the font a bit and made it proportional! Now Ms, Ws, and Ts look better and there isn't all kinds of extra space after Is, 1s, and punctuation marks. In the process of making the font proportional the justifications also became much improved. There is now a command to make all numbers a fixed size to make clocks looks better.
I have planes for a few more wipes and other transitions. I also plan to speed things up a little more to keep up with a stock GS. I also still want to make the LEDs and bit smaller so we can get more of them. Lastly, I need to work on the options. I especially need a way to set the number of bad LEDs. The only thing is I have already spent way too much time on such a silly program. Unless people express a lot of interest in SLED, I think I am going to have to start working on something a bit more productive.

View File

@ -0,0 +1,19 @@
First of all, one reminder. SLED and my other recent Twilight II modules are NOT property of Digisoft Innovations. In the future an agreement will probably be maid with DSI to distribute my new modules with an update to Twilight II. However, for now I retain the rights. If Soft Disk, GS+, or some one else expresses interest in them I may go that route.
Now that that's over with, here is what's new in SLED.
First I rewrote all the screen update code in assembly. When it was all finished it ended up being faster than the C version but not dramatically. After some help from Jim over the phone I managed to optimize the ams code a LOT. It is now MUCH faster. You can actually scroll text at full speed on an un-accelerated GS without skipping any frames.
Next I added some new commands. You can now change colors, do wipes and fades, use inverse and more.
With all the new commands my "scripts" got VERY cryptic. I broke down a wrote a read script interpreter. One that uses real words like <PRINT> and <SCROLL>. Some of the command even have arguments. Even optional and multiple arguments. And LOOP!
Unfortunately with the improved interpreter came a small loss of speed. SLED skips a frame here and there when scrolling text on stock GS.
Almost everyone said SLED scrolls text too fast. To show you why I use the speed I do I have added a way to slow it down. Normally SLED updates the screen once of 1/60th of a second. If you hold down the command key it will slow down to one frame every 2/60th of a second. You will see it looks very choppy. BTW, you can hold option to see SLED go all out full speed.
At the request of Greg I changed the way the LEDs are drawn to make them use two colors to make them look rounder and more 3D. They don't look much better but now they do look more like LEDs than tinny red stop signs. If you think you could draw a better one then feel free to play with the SHR screen I included in the archive. If you come up with a better pallet and or LED shape let me know!
Finally, I touched up the font a bit and made it proportional! Now Ms, Ws, and Ts look better and there isn't all kinds of extra space after Is, 1s, and punctuation marks. In the process of making the font proportional the justifications also became much improved. There is now a command to make all numbers a fixed size to make clocks looks better.
I have planes for a few more wipes and other transitions. I also plan to speed things up a little more to keep up with a stock GS. I also still want to make the LEDs and bit smaller so we can get more of them. Lastly, I need to work on the options. I especially need a way to set the number of bad LEDs. The only thing is I have already spent way too much time on such a silly program. Unless people express a lot of interest in SLED, I think I am going to have to start working on something a bit more productive.

View File

@ -0,0 +1,131 @@
SLED uses a very simple scripting language to allow you to control exactly what is displayed. The scripts are stored in ordinary Text of Teach files that can be edited with any text editor or word processor. The simplest script you can write is simply a file full of what ever text you want displayed on the LED display. Any text you put int he script will be scrolled across the display from right to left with the default red color. If you want to get fancy and add wipes, fades, colors, or other special effects you need to learn a few very simple commands and some basic rules about how commands are used.
Any text that is not between open and close command characters is printed to the display using the current printing method. Return characters (as well as any other control characters) are ignored by SLED. This means you can use then to format your script to make it easier for you to read. Just do not place any returns (or other control characters) in the middle of command. That would confuse the SLED script interpreter. Any character that is not in the SLED font is also ignored. Currently the SLED font only contains the standard ACSII characters. That is any letter or punctuation you have on your keyboard. Extended characters that you type with the option key are not in the SLED font and will not be displayed.
All commands must be between a begin command and end command character to let SLED know to interpret the command rather than display the word on the screen. The default begin command character is the less than "<" characters and the default end command character is the greater than ">" character. So, to place a pause command in your script you would simply type <PAUSE>. To try to make it as easy as possible to write scripts, SLED has been designed to allow you to use several different words to get the same results. For example, the commands WAIT, PAUSE, and DELAY all cause the same action. You can also abbreviate any command. Simply typing <P> will have the same result as typing <PAUSE>. In cases where the command you type could be short for more than one command, SLED actual uses the command that comes first alphabetically. For example, <P> could mean <PAUSE> or <PRINT>. Since PAUSE comes before PRINT alphabetically, SLED would execute the PAUSE command. To abbreviate PRINT you would have to type <PR> so that SLED wouldn't PAUSE when you wanted to PRINT.
SLED doesn't care what case you use when you type commands. <print>, <Print>, <PRINT>, and <PrInT> all work equally well.
You can never type a space in the middle of a command. Command such as BACKGROUNDCOLOR will NOT be recognized if you enter then as two word. SLED would interpret the text
<BACKGROUND COLOR> as the command BACKGROUND with an argument of COLOR. This would cause an error.
Several command have arguments. These are options you specify when you enter the command. For example, if you type <COLOR BLUE>, BLUE is an argument used with the command COLOR. Arguments are always between the begin and command characters along with a command but separated from the command with a space. Some command have an optional argument. For example, when you use the PAUSE command you can specify a number of milliseconds to pause or if you don't specify a duration PAUSE will use the default duration of 1 seconds. Some commands may take more than one argument. For example, with the color command you can specify a foreground and a background color. Multiple arguments are separated by spaces or comas. For example, <COLOR RED,GREEN> or <COLOR RED GREEN> or <COLOR RED, GREEN> would specify red text on a green background. Some commands take numeric arguments. For example PAUSE takes one argument to specify the number of milliseconds to pause. Most command take words as arguments. For example, COLOR requires a word such as RED, GREEN, or BLUE to specify a new color. When you enter words as arguments to commands they can be abbreviated just like commands can be. For example, <COLOR RED, GREEN> could be abbreviated to <C R, G>.
The begin and end command characters do not have to be "<" and ">". If the first character in the file is a "{", "[" or "(" the begin and end command characters will be set to "{" and "}", "[" and "]", or "(" and ")" respectively. If you often need to print a "<" on the screen but never use parentheses you could use parentheses to mark the beginning and ending of commands. If you need to display the begin command character you can place it between a begin and end command character and one begin command character will be printed to the screen. For example, "<<>" would print the "<" character on the screen. The end command character can be printed by simply typing it. As long as it is not preceeded by a begin command character, the end command character can be used just like any other character. For example, "5 > 4" would print "5 > 4" and "5 <<> 6 would print "5 < 6". Simply typing "5 < 6" would not work because SLED would be expecting a command after the "<".
When SLED reaches the end of the script it automatically loops back to the beginning of the script. All global setting, such as colors, justification, and printing mode, are reset to their default values before the script is executed again.
The following is the list of command that SLED supports. The first line shows the word used to invoke the command and the names of any arguments the command has. Arguments that appear inside of brackets ("[" and "]") are optional
arguments. The following describe what the command does and what valid values for the arguments are.
BACKGROUNDCOLOR [OFF_COLOR]
Changes what color is used to draw LEDs that are turned off. If no OFF_COLOR is specified, OFF_COLOR is set to OFF by default. The COLOR command can also be used to change the background color. Valid colors are:
BLACK
BLUE
DARKRED (same as OFF)
DARKGREEN
GREEN
ON (same as RED)
OFF (same of DARKRED)
RED (same as ON)
WHITE
YELLOW
CLEAR
Turns off all LEDs. (Clears the display)
ERASE can be used in place of CLEAR.
COLOR [ON_COLOR] [OFF_COLOR]
Changes what color is used to draw LEDs. ON_COLOR is the color used to draw text and OFF_COLOR is the color used to draw the text background. If no ON_COLOR is specified, ON_COLOR is set to ON by default. If no OFF_COLOR is specified, the OFF_COLOR is not changed. The OFF_COLOR can also be changed with the BACKGROUNDCOLOR command. See the BACKGROUNDCOLOR command for a list of valid colors.
COLORBACKGROUND [OFF_COLOR]
See BACKGROUNDCOLOR
DATE
Displays the current date with the correct printing method. The date is displayed in the format specified by the control panel.
DELAY [DELAY_TIME]
Pauses for DELAY_TIME milliseconds. During this time nothing at all happens. This gives the user time to read the display. If no DELAY_TIME is specified a default delay of 60 milliseconds (1 second) is used. PAUSE or WAIT can be used in place of DELAY. A default 1 second delay
DOWN
Changes the printing method to SCROLLDOWN. This means that any text that fallows will be displays by scrolling it onto the screen from top to bottom. SCROLLDOWN can be used in place of DOWN.
ENDLOOP
See NEXT.
ERASE
See CLEAR
FADE
Changes the printing method to FADE. This means that any text that fallows will be displayed by slowly transitioning from the previous display to the new text. This slow transition is done by slowly turning LEDs on or off one at a time in a random order.
FONT [FONT_NAME]
Changes the font that all text is drawn with. Valid FONT_NAMEs and NORMAL and FIXEDNUMBERS. If no FONT_NAME is specified, NORMAL is used. FIXEDNUMBERS is especially useful when displaying a clock because all the numbers are a fixed size rather than the usual proportionally spaced numbers. SETFONT can be used in place of FONT.
FOR COUNT
Marks the beginning of a loop that will be repeated COUNT times. The end of the loop must be marked with a NEXT command. This is much like a FOR, NEXT loop in BASIC. You can nest FOR, NEXT loops up to 5 levels deep. In other words, you can have one FOR, NEXT loop inside of another FOR, NEXT loop. Just don't start more than 5 FOR loops inside of each other. LOOP can be used in place of FOR.
INVERSE
Changes the color of every LED on the screen so that all ON LEDs turn OFF and all OFF LEDs turn ON. The current ON_COLOR and OFF_COLOR will also be swapped so that all text that is printed in the future will also be inversed. Using the INVERSE command a second time will put everything back to normal. INVERT can be used in place of INVERSE.
INVERT
See INVERSE.
JUSTIFICATION JUSTIFICATION_MODE
Changes the JUSTIFICATION_MODE. The justification mode is used to determine how all text is printed. The only exception is SCROLLLEFT text witch is not justified at all because it is always moving. Valid values for JUSTIFICATION_MODE are CENTER, LEFT, or RIGHT. SETJUSTIFICATION can be used in place of JUSTIFICATION.
LEFT
Changes the printing method to SCROLLLEFT. This means that any text that fallows will be displayed by scrolling it across the screen from right to left. SCROLLLEFT can be used in place of LEFT.
LOOP COUNT
See FOR.
NEXT
Marks the end of a FOR, NEXT loop. See FOR. ENDLOOP can be used in place of NEXT.
PAUSE [DELAY_TIME]
See DELAY.
PRINT
Changes the printing method to PRINT. This means that any text that fallows will be displayed by simply printing the letters on the display without any scrolling or other effects.
SCROLLDOWN
See DOWN.
SCROLLLEFT
See LEFT.
SCROLLOFF
Clears the display by scrolling the contents to the left one LED at a time. This is usually used at the end of some text that is being displayed with the <SCROLLLEFT> or <LEFT> command. If your script contained "<LEFT>Hello World!" the words "Hello World!" would scroll onto the screen from the left but stop scrolling as soon as the last character was fully visible on the screen. Ff you added SCROLLOFF after the text like this "<LEFT>Hello World!<SCROLLOFF>" then the word would continue to scroll left until they are completely off the screen. Adding extra spaces to the end of your text has a similar effect but is not very accurate because SLED uses a proportional font and it is hard to know exactly how many spaces are needed.
SETFONT
See FONT.
SET JUSTIFICATION
See JUSTIFICATION.
SO
See SCROLLOFF.
SCROLLUP
See UP.
TIME [WIDTH]
Displays the current time with the correct printing method. By default only the first 8 characters of the current time are printed. If a WIDTH is specified then WIDTH characters of the time as displayed. WIDTH can be a value between 1
and 11. The time is displayed in the format specified by the control panel.
TIMECHANGEWAIT
Waits for the seconds on the clock to change to a time greater that the time that was on the clock last time the TIMECHANGEWAIT command was used. This is especially useful when creating clock displays. The script "<UP><TIME><TIMECHANGEWAIT>" would make the current time scroll up onto the display, wait for the time to change, and then loop back to the beginning and scroll up the new time. WAITFORTIMECHANGE can be substituted for TIMECHANGE.
UP
Changes the printing method to SCROLLUP. This means that any text that fallows will be displays by scrolling it onto the screen from bottom to top. SCROLLUP can be used in place of UP.
WAIT [DELAY_TIME]
See DELAY
WAITFORTIMECHANGE
See TIMECHANGE.
WIPE [DIRECTION] [SHOW_LINE]
Changes the printing method to WIPE. This means that any text that fallows will be displays using a wipe effect that slowly changes on line of the display at a time. The transition can be made from top to bottom, bottom to top, left to right, or right to left by specifying a DIRECTION of DOWN, UP, RIGHT, or LEFT respectively. If no direction is specified then a direction of DOWN is assumed. SHOW_LINE is a logical value that specifies weather of not the transition line should be visible. Just try it to see what I mean. :)

View File

@ -0,0 +1,131 @@
SLED uses a very simple scripting language to allow you to control exactly what is displayed. The scripts are stored in ordinary Text of Teach files that can be edited with any text editor or word processor. The simplest script you can write is simply a file full of what ever text you want displayed on the LED display. Any text you put int he script will be scrolled across the display from right to left with the default red color. If you want to get fancy and add wipes, fades, colors, or other special effects you need to learn a few very simple commands and some basic rules about how commands are used.
Any text that is not between open and close command characters is printed to the display using the current printing method. Return characters (as well as any other control characters) are ignored by SLED. This means you can use then to format your script to make it easier for you to read. Just do not place any returns (or other control characters) in the middle of command. That would confuse the SLED script interpreter. Any character that is not in the SLED font is also ignored. Currently the SLED font only contains the standard ACSII characters. That is any letter or punctuation you have on your keyboard. Extended characters that you type with the option key are not in the SLED font and will not be displayed.
All commands must be between a begin command and end command character to let SLED know to interpret the command rather than display the word on the screen. The default begin command character is the less than "<" characters and the default end command character is the greater than ">" character. So, to place a pause command in your script you would simply type <PAUSE>. To try to make it as easy as possible to write scripts, SLED has been designed to allow you to use several different words to get the same results. For example, the commands WAIT, PAUSE, and DELAY all cause the same action. You can also abbreviate any command. Simply typing <P> will have the same result as typing <PAUSE>. In cases where the command you type could be short for more than one command, SLED actual uses the command that comes first alphabetically. For example, <P> could mean <PAUSE> or <PRINT>. Since PAUSE comes before PRINT alphabetically, SLED would execute the PAUSE command. To abbreviate PRINT you would have to type <PR> so that SLED wouldn't PAUSE when you wanted to PRINT.
SLED doesn't care what case you use when you type commands. <print>, <Print>, <PRINT>, and <PrInT> all work equally well.
You can never type a space in the middle of a command. Command such as BACKGROUNDCOLOR will NOT be recognized if you enter then as two word. SLED would interpret the text
<BACKGROUND COLOR> as the command BACKGROUND with an argument of COLOR. This would cause an error.
Several command have arguments. These are options you specify when you enter the command. For example, if you type <COLOR BLUE>, BLUE is an argument used with the command COLOR. Arguments are always between the begin and command characters along with a command but separated from the command with a space. Some command have an optional argument. For example, when you use the PAUSE command you can specify a number of milliseconds to pause or if you don't specify a duration PAUSE will use the default duration of 1 seconds. Some commands may take more than one argument. For example, with the color command you can specify a foreground and a background color. Multiple arguments are separated by spaces or comas. For example, <COLOR RED,GREEN> or <COLOR RED GREEN> or <COLOR RED, GREEN> would specify red text on a green background. Some commands take numeric arguments. For example PAUSE takes one argument to specify the number of milliseconds to pause. Most command take words as arguments. For example, COLOR requires a word such as RED, GREEN, or BLUE to specify a new color. When you enter words as arguments to commands they can be abbreviated just like commands can be. For example, <COLOR RED, GREEN> could be abbreviated to <C R, G>.
The begin and end command characters do not have to be "<" and ">". If the first character in the file is a "{", "[" or "(" the begin and end command characters will be set to "{" and "}", "[" and "]", or "(" and ")" respectively. If you often need to print a "<" on the screen but never use parentheses you could use parentheses to mark the beginning and ending of commands. If you need to display the begin command character you can place it between a begin and end command character and one begin command character will be printed to the screen. For example, "<<>" would print the "<" character on the screen. The end command character can be printed by simply typing it. As long as it is not preceeded by a begin command character, the end command character can be used just like any other character. For example, "5 > 4" would print "5 > 4" and "5 <<> 6 would print "5 < 6". Simply typing "5 < 6" would not work because SLED would be expecting a command after the "<".
When SLED reaches the end of the script it automatically loops back to the beginning of the script. All global setting, such as colors, justification, and printing mode, are reset to their default values before the script is executed again.
The following is the list of command that SLED supports. The first line shows the word used to invoke the command and the names of any arguments the command has. Arguments that appear inside of brackets ("[" and "]") are optional
arguments. The following describe what the command does and what valid values for the arguments are.
BACKGROUNDCOLOR [OFF_COLOR]
Changes what color is used to draw LEDs that are turned off. If no OFF_COLOR is specified, OFF_COLOR is set to OFF by default. The COLOR command can also be used to change the background color. Valid colors are:
BLACK
BLUE
DARKRED (same as OFF)
DARKGREEN
GREEN
ON (same as RED)
OFF (same of DARKRED)
RED (same as ON)
WHITE
YELLOW
CLEAR
Turns off all LEDs. (Clears the display)
ERASE can be used in place of CLEAR.
COLOR [ON_COLOR] [OFF_COLOR]
Changes what color is used to draw LEDs. ON_COLOR is the color used to draw text and OFF_COLOR is the color used to draw the text background. If no ON_COLOR is specified, ON_COLOR is set to ON by default. If no OFF_COLOR is specified, the OFF_COLOR is not changed. The OFF_COLOR can also be changed with the BACKGROUNDCOLOR command. See the BACKGROUNDCOLOR command for a list of valid colors.
COLORBACKGROUND [OFF_COLOR]
See BACKGROUNDCOLOR
DATE
Displays the current date with the correct printing method. The date is displayed in the format specified by the control panel.
DELAY [DELAY_TIME]
Pauses for DELAY_TIME milliseconds. During this time nothing at all happens. This gives the user time to read the display. If no DELAY_TIME is specified a default delay of 60 milliseconds (1 second) is used. PAUSE or WAIT can be used in place of DELAY. A default 1 second delay
DOWN
Changes the printing method to SCROLLDOWN. This means that any text that fallows will be displays by scrolling it onto the screen from top to bottom. SCROLLDOWN can be used in place of DOWN.
ENDLOOP
See NEXT.
ERASE
See CLEAR
FADE
Changes the printing method to FADE. This means that any text that fallows will be displayed by slowly transitioning from the previous display to the new text. This slow transition is done by slowly turning LEDs on or off one at a time in a random order.
FONT [FONT_NAME]
Changes the font that all text is drawn with. Valid FONT_NAMEs and NORMAL and FIXEDNUMBERS. If no FONT_NAME is specified, NORMAL is used. FIXEDNUMBERS is especially useful when displaying a clock because all the numbers are a fixed size rather than the usual proportionally spaced numbers. SETFONT can be used in place of FONT.
FOR COUNT
Marks the beginning of a loop that will be repeated COUNT times. The end of the loop must be marked with a NEXT command. This is much like a FOR, NEXT loop in BASIC. You can nest FOR, NEXT loops up to 5 levels deep. In other words, you can have one FOR, NEXT loop inside of another FOR, NEXT loop. Just don't start more than 5 FOR loops inside of each other. LOOP can be used in place of FOR.
INVERSE
Changes the color of every LED on the screen so that all ON LEDs turn OFF and all OFF LEDs turn ON. The current ON_COLOR and OFF_COLOR will also be swapped so that all text that is printed in the future will also be inversed. Using the INVERSE command a second time will put everything back to normal. INVERT can be used in place of INVERSE.
INVERT
See INVERSE.
JUSTIFICATION JUSTIFICATION_MODE
Changes the JUSTIFICATION_MODE. The justification mode is used to determine how all text is printed. The only exception is SCROLLLEFT text witch is not justified at all because it is always moving. Valid values for JUSTIFICATION_MODE are CENTER, LEFT, or RIGHT. SETJUSTIFICATION can be used in place of JUSTIFICATION.
LEFT
Changes the printing method to SCROLLLEFT. This means that any text that fallows will be displayed by scrolling it across the screen from right to left. SCROLLLEFT can be used in place of LEFT.
LOOP COUNT
See FOR.
NEXT
Marks the end of a FOR, NEXT loop. See FOR. ENDLOOP can be used in place of NEXT.
PAUSE [DELAY_TIME]
See DELAY.
PRINT
Changes the printing method to PRINT. This means that any text that fallows will be displayed by simply printing the letters on the display without any scrolling or other effects.
SCROLLDOWN
See DOWN.
SCROLLLEFT
See LEFT.
SCROLLOFF
Clears the display by scrolling the contents to the left one LED at a time. This is usually used at the end of some text that is being displayed with the <SCROLLLEFT> or <LEFT> command. If your script contained "<LEFT>Hello World!" the words "Hello World!" would scroll onto the screen from the left but stop scrolling as soon as the last character was fully visible on the screen. Ff you added SCROLLOFF after the text like this "<LEFT>Hello World!<SCROLLOFF>" then the word would continue to scroll left until they are completely off the screen. Adding extra spaces to the end of your text has a similar effect but is not very accurate because SLED uses a proportional font and it is hard to know exactly how many spaces are needed.
SETFONT
See FONT.
SET JUSTIFICATION
See JUSTIFICATION.
SO
See SCROLLOFF.
SCROLLUP
See UP.
TIME [WIDTH]
Displays the current time with the correct printing method. By default only the first 8 characters of the current time are printed. If a WIDTH is specified then WIDTH characters of the time as displayed. WIDTH can be a value between 1
and 11. The time is displayed in the format specified by the control panel.
TIMECHANGEWAIT
Waits for the seconds on the clock to change to a time greater that the time that was on the clock last time the TIMECHANGEWAIT command was used. This is especially useful when creating clock displays. The script "<UP><TIME><TIMECHANGEWAIT>" would make the current time scroll up onto the display, wait for the time to change, and then loop back to the beginning and scroll up the new time. WAITFORTIMECHANGE can be substituted for TIMECHANGE.
UP
Changes the printing method to SCROLLUP. This means that any text that fallows will be displays by scrolling it onto the screen from bottom to top. SCROLLUP can be used in place of UP.
WAIT [DELAY_TIME]
See DELAY
WAITFORTIMECHANGE
See TIMECHANGE.
WIPE [DIRECTION] [SHOW_LINE]
Changes the printing method to WIPE. This means that any text that fallows will be displays using a wipe effect that slowly changes on line of the display at a time. The transition can be made from top to bottom, bottom to top, left to right, or right to left by specifying a DIRECTION of DOWN, UP, RIGHT, or LEFT respectively. If no direction is specified then a direction of DOWN is assumed. SHOW_LINE is a logical value that specifies weather of not the transition line should be visible. Just try it to see what I mean. :)

View File

@ -0,0 +1,376 @@
/*
** Snow for T2 by James C. Smith
*/
#pragma keep "Snow"
#pragma cdev Snow
#pragma optimize -1
#pragma debug 0
#include "T2.H"
#include "Random3.h"
#include "Plot2.h"
#include <string.h>
#include <quickdraw.h>
#include <control.h>
#include <resources.h>
#include <memory.h>
#include <locator.h>
pascal LongWord TickCount() inline(0x1006,dispatcher);
pascal void SysBeep() inline(0x2C03,dispatcher);
#pragma lint 0
#define ControlList 0x00001003l
#define IconControl 0x00000001l
#define TimeBeforeClearPopUp 0x00000002l
#define NumFlakesPopUp 0x00000003l
#define ClearFirstCB 0x00000004l
LongWord MakeT2Snow(void);
void LoadSetupT2Snow(void);
void SaveConfigResource(char *, word);
word LoadConfigResource(char *, word);
LongWord HitT2Snow(LongWord);
void SaveT2Snow(void);
LongWord BlankT2Snow(void);
Word SetupFileNumber;
GrafPortPtr SetupWindow;
word OptionWord;
char *VRam;
int MaxYV;
int i, OldX,OldY;
word ConfigNumFlakes, ConfigTimeBeforeClear, ConfigClearFirst;
Word *movePtr;
char *ConfigNameString="\pSnow Config";
typedef struct Flake {
unsigned int x;
unsigned int y;
unsigned int xv;
unsigned int yv;
char Under;
};
LongWord StartTime;
word Colors[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x0FFF,0x0FFF};
struct Flake Flakes[130], *AFlake;
LongWord BlankT2Snow(void)
{
int ScreenWasCleared=0;
if(ConfigNumFlakes>130 || ConfigNumFlakes < 10)
{
SysBeep();
SysBeep();
ConfigNumFlakes=60;
}
MaxYV=ConfigNumFlakes>>1;
if((*((char *)0x00C035))& 0x08)
VRam=(void *) 0xE10000l;
else
VRam=(void *) 0x010000l;
init_plot((char *) VRam,(char *)GetAddress(1), toT2Str);
init_random(toT2Str);
set_random_seed();
if(ConfigClearFirst)
{
ScreenWasCleared=1;
ClearScreen(0);
SetAllSCBs(GetStandardSCB() & 0x7F);
SetColorTable(0, (void *) Colors);
}
StartTime=TickCount();
for(i=0; i<ConfigNumFlakes; i++)
{
Flakes[i].y=((random() % 185)+15)<<4;
do {
Flakes[i].x=((random() % 380)-60)<<4;
} while(get_pixel(Flakes[i].x>>4,Flakes[i].y>>4)==15);
Flakes[i].xv=random() % 10;
Flakes[i].yv=(random() % MaxYV)+10;
Flakes[i].Under=getset_pixel(Flakes[i].x>>4, Flakes[i].y>>4, 15);
}
while(!(*movePtr)) /* Animate the screen until the movePtr becomes true */
{
if((TickCount()-StartTime)/3600 >= ConfigTimeBeforeClear)
{
ScreenWasCleared=1;
ClearScreen(0);
StartTime=TickCount();
for(i=0; i<ConfigNumFlakes; i++)
OldX=Flakes[i].Under=0;
}
for(i=0; i<ConfigNumFlakes; i++)
{
AFlake=&Flakes[i];
OldX=AFlake->x;
OldY=AFlake->y;
set_pixel(OldX>>4,OldY>>4,AFlake->Under);
AFlake->x+=AFlake->xv;
AFlake->y+=AFlake->yv;
/* try to slide left or right or stop if you have to if.... */
if(get_pixel(AFlake->x>>4,AFlake->y>>4)==15)
{
AFlake->xv=0;
AFlake->yv=16; /*AFlake->yv > 16 ? 16:5; */
AFlake->x=OldX;
AFlake->y=OldY+AFlake->yv;
if(get_pixel(AFlake->x>>4,AFlake->y>>4)==15 && OldX<(319<<4))
AFlake->x=OldX+16;
if(get_pixel(AFlake->x>>4,AFlake->y>>4)==15 && OldX>((0)+15))
AFlake->x=OldX-16;
if(random() & 0x07)
{
if(get_pixel(AFlake->x>>4,AFlake->y>>4)==15 && OldX>((1<<4)+15))
AFlake->x=OldX-32;
if(get_pixel(AFlake->x>>4,AFlake->y>>4)==15 && OldX<(318<<4))
AFlake->x=OldX+32;
}
if(get_pixel(AFlake->x>>4,AFlake->y>>4)==15)
{
AFlake->y=ConfigClearFirst ? 0:(13<<4);
do {
AFlake->x=((random() % 380)-60)<<4;
} while(get_pixel(AFlake->x>>4,AFlake->y>>4)==15);
AFlake->xv=random() % 10;
AFlake->yv=(random() % MaxYV)+10;
set_pixel(OldX>>4,OldY>>4,15);
AFlake->Under=getset_pixel(AFlake->x>>4, AFlake->y>>4, 15);
} else {
AFlake->Under=getset_pixel(AFlake->x>>4, AFlake->y>>4, 15);
}
} else {
AFlake->Under=getset_pixel(AFlake->x>>4, AFlake->y>>4, 15);
}
} /* end loop for num flakes */
} /* end while no movement */
if(ScreenWasCleared)
return(LongWord) bmrFadeIn;
else
return(LongWord) NULL;
}
void SaveT2Snow(void)
{
Word FileNumber;
/* Save current resource file and switch in Twilight.Setup */
FileNumber=GetCurResourceFile();
SetCurResourceFile(SetupFileNumber);
/* Save control values */
ConfigNumFlakes=GetCtlValue(GetCtlHandleFromID(SetupWindow, NumFlakesPopUp));
ConfigTimeBeforeClear=GetCtlValue(GetCtlHandleFromID(SetupWindow, TimeBeforeClearPopUp));
ConfigClearFirst=GetCtlValue(GetCtlHandleFromID(SetupWindow, ClearFirstCB));
OptionWord=(ConfigClearFirst<<15) | (ConfigNumFlakes<<8) | ConfigTimeBeforeClear;
SaveConfigResource(ConfigNameString, OptionWord);
/*****************************/
/* Restore old resource file */
/*****************************/
SetCurResourceFile(FileNumber);
}
LongWord HitT2Snow(LongWord ControlHit)
{
LongWord EnableFlag=0L;
if(ControlHit == NumFlakesPopUp)
EnableFlag=1L;
if(ControlHit == TimeBeforeClearPopUp)
EnableFlag=1L;
if(ControlHit == ClearFirstCB)
EnableFlag=1L;
return EnableFlag;
}
/*****************************************************************************\
|* *|
|* LoadConfigResource- (updated) *|
|* 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;
struct {
word Type;
Long ID;
} HandleInfo;
/**************************************/
/* 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;
}
/*****************************************************************************\
|* *|
|* 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, NULL);
**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);
/*DisposeHandle (ConfigData); */
}
}
LongWord MakeT2Snow(void)
{
Word FileNumber;
FileNumber=GetCurResourceFile();
SetCurResourceFile(SetupFileNumber);
LoadSetupT2Snow();
SetCurResourceFile(FileNumber);
NewControl2(SetupWindow, resourceToResource,(long) ControlList);
SetCtlValue(ConfigNumFlakes, GetCtlHandleFromID(SetupWindow, NumFlakesPopUp));
SetCtlValue(ConfigTimeBeforeClear, GetCtlHandleFromID(SetupWindow, TimeBeforeClearPopUp));
SetCtlValue(ConfigClearFirst, GetCtlHandleFromID(SetupWindow, ClearFirstCB));
return 0x04l;
}
void LoadSetupT2Snow(void)
{
/* Option word format
** 0x8000=ClearFirst
** 0x7F00=NumFlakes
** 0x00FF=TimeBeforeClear
*/
OptionWord=LoadConfigResource(ConfigNameString, 0x3C3C);
ConfigClearFirst =(OptionWord & 0x8000) >> 15;
ConfigNumFlakes =(OptionWord & 0x7F00) >> 8;
ConfigTimeBeforeClear= OptionWord & 0x00FF;
}
LongWord Snow(LongWord data2, LongWord data1, Word message)
{
LongWord Result=0L;
switch(message)
{
case MakeT2:
SetupWindow=(GrafPortPtr) data1;
SetupFileNumber=(Word) data2;
Result=MakeT2Snow();
break;
case BlankT2:
movePtr=(Word *) data1;
Result=BlankT2Snow();
break;
case SaveT2:
SaveT2Snow();
break;
case LoadSetupT2:
LoadSetupT2Snow();
if(ConfigClearFirst)
Result=lmrFadeOut;
else
Result=lmrReqUsableScreen;
break;
case UnloadSetupT2:
break;
case KillT2:
break;
case HitT2:
Result=HitT2Snow(data2);
break;
}
return Result;
}

View File

@ -0,0 +1,378 @@
/*
** StringArt for T2 by James C. Smith
*/
#pragma keep "StringArt"
#pragma cdev StringArt
#pragma optimize -1
#pragma debug 0
#include "T2f.H"
#include "Random3.h"
#pragma lint 0
#include <stdlib.h>
#include <quickdraw.h>
#include <control.h>
#include <resources.h>
#include <memory.h>
#include <locator.h>
#include <string.h>
pascal LongWord TickCount() inline(0x1006,dispatcher);
pascal void SysBeep() inline(0x2C03,dispatcher);
LongWord MakeT2StringArt(void);
void LoadSetupT2StringArt(void);
void SaveConfigResource(char *, word);
word LoadConfigResource(char *, word);
LongWord HitT2StringArt(LongWord);
void SaveT2StringArt(void);
void Wait(int);
int SinInt(int);
int CosInt(int);
#define StringArtIcon 0x0010DD01l
#define ControlList 0x00001003l
#define IconControl 0x00000001l
#define DelayPU 0x00000002l
#define NumLinesPU 0x00000003l
#define QuitAfterOneCB 0x00000004l
char *ConfigNameString="\pString Art Config";
Word SetupFileNumber;
GrafPortPtr SetupWindow;
Long OldTick=0, TmpTick;
Word *movePtr;
word ConfigDelay, ConfigNumLines=100, ConfigQuitAfterOne;
extended ActualSpeed;
word OptionWord;
ColorTable MyColorTable;
void Wait(int WaitLength)
{
TmpTick=OldTick;
while(((OldTick=TickCount())<=TmpTick+WaitLength) && (!(*movePtr)));
}
int SinTable[]={
320,325,331,336,342,347,353,358,364,370,375,381,386,391,397,402,408,413,418,
424,429,434,439,445,450,455,460,465,470,475,479,484,489,494,498,503,508,512,
517,521,525,529,534,538,542,546,550,554,557,561,565,568,572,575,578,582,585,
588,591,594,597,599,602,605,607,610,612,614,616,618,620,622,624,626,627,629,
630,631,633,634,635,636,636,637,638,638,639,639,639,639,639,639,639,639,639,
638,638,637,636,636,635,634,633,631,630,629,627,626,624,622,620,618,616,614,
612,610,607,605,602,599,597,594,591,588,585,582,578,575,572,568,565,561,557,
554,550,546,542,538,534,529,525,521,517,512,508,503,498,494,489,484,480,475,
470,465,460,455,450,445,439,434,429,424,418,413,408,402,397,391,386,381,375,
370,364,358,353,347,342,336,331,325,320,315,309,304,298,293,287,282,276,270,
265,259,254,249,243,238,232,227,222,216,211,206,201,195,190,185,180,175,170,
165,161,156,151,146,142,137,132,128,123,119,115,111,106,102,98,94,90,86,
83,79,75,72,68,65,62,58,55,52,49,46,43,41,38,35,33,30,28,
26,24,22,20,18,16,14,13,11,10, 9, 7, 6, 5, 4, 4, 3, 2, 2,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 4, 4, 5, 6, 7, 9,10,
11,13,14,16,18,20,22,24,26,28,30,33,35,38,41,43,46,49,52,
55,58,62,65,68,72,75,79,83,86,90,94,98,102,106,111,115,119,123,
128,132,137,142,146,151,156,160,165,170,175,180,185,190,195,201,206,211,216,
222,227,232,238,243,249,254,259,265,270,276,282,287,293,298,304,309,315};
int SinInt(int Degre)
{
Degre%=360;
return SinTable[Degre];
}
int CosInt(int Degre)
{
Degre+=90;
Degre%=360;
return SinTable[Degre];
}
int XMultiplyer1, YMultiplyer1, XAdder1, YAdder1;
int XMultiplyer2, YMultiplyer2, XAdder2, YAdder2;
int Angle;
struct getInfoOut T2Info={0,0,0xE};
LongWord BlankT2StringArt(void)
{
word RandomColor, R, G, B;
init_random(toT2Str);
set_random_seed();
SendRequest(t2GetInfo, stopAfterOne+sendToName, (longword) toT2Str, 0, (void *) &T2Info);
ActualSpeed=360 / (ConfigNumLines*20);
SetSolidPenPat(15);
SetPenMode(modeCopy);
SetPenSize(1, 1);
memset(MyColorTable, 0, sizeof MyColorTable);
while (!(*movePtr)) /* Animate the screen until the movePtr becomes true */
{
ClearScreen(0);
do {
R=random() % 16;
G=random() % 16;
B=random() % 16;
} while ((R<9) && (G<9) && (B<9));
RandomColor=(R<<8) | (G<<4) | B;
MyColorTable[3]=RandomColor;
MyColorTable[7]=RandomColor;
MyColorTable[11]=RandomColor;
MyColorTable[15]=RandomColor;
SetColorTable(0, MyColorTable);
do {
XMultiplyer1=random() % 4;
YMultiplyer1=random() % 4;
XMultiplyer2=random() % 4;
YMultiplyer2=random() % 4;
} while((XMultiplyer1==0) + (YMultiplyer1==0) + (XMultiplyer2==0) + (YMultiplyer2==0)>2);
XAdder1=random() % 360;
YAdder1=random() % 360;
XAdder2=random() % 360;
YAdder2=random() % 360;
for(Angle=0; (Angle <360) && (*movePtr==0); Angle+=ActualSpeed)
{
MoveTo(CosInt(Angle * XMultiplyer1 + XAdder1) ,SinInt(Angle * YMultiplyer1 + YAdder1) * 50 / 160);
LineTo(CosInt(Angle * XMultiplyer2 + XAdder2) ,SinInt(Angle * YMultiplyer2 + YAdder2) * 50 / 160);
}
if(ConfigDelay)
{
Wait(0);
Wait(ConfigDelay*60);
}
if(ConfigQuitAfterOne && (T2Info.count_selected_modules > 1))
break;
}
if(*movePtr)
return (LongWord) 0;
else
return (LongWord) bmrNextModule;
}
void SaveT2StringArt(void)
{
Word FileNumber;
/* Save current resource file and switch in Twilight.Setup */
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
/* Save control values */
ConfigDelay = GetCtlValue (GetCtlHandleFromID (SetupWindow, DelayPU))-1;
ConfigNumLines = GetCtlValue (GetCtlHandleFromID (SetupWindow, NumLinesPU));
ConfigQuitAfterOne = GetCtlValue (GetCtlHandleFromID (SetupWindow, QuitAfterOneCB));
OptionWord=(ConfigQuitAfterOne<<15)|(ConfigDelay << 4) | ConfigNumLines;
SaveConfigResource(ConfigNameString, OptionWord);
/*****************************/
/* Restore old resource file */
/*****************************/
SetCurResourceFile (FileNumber);
}
LongWord HitT2StringArt(LongWord ControlHit)
{
LongWord EnableFlag = 0L;
if (ControlHit == DelayPU)
EnableFlag = 1L;
if (ControlHit == NumLinesPU)
EnableFlag = 1L;
if (ControlHit == QuitAfterOneCB)
EnableFlag = 1L;
return EnableFlag;
}
/*****************************************************************************\
|* *|
|* LoadConfigResource- (updated) *|
|* 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;
struct {
word Type;
Long ID;
} HandleInfo;
/**************************************/
/* 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;
}
/*****************************************************************************\
|* *|
|* 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 ((longword) (sizeof (Word)), GetCurResourceApp(), attrLocked, NULL);
**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);
/*DisposeHandle (ConfigData); */
}
}
LongWord MakeT2StringArt (void)
{
Word FileNumber;
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
LoadSetupT2StringArt();
SetCurResourceFile (FileNumber);
NewControl2(SetupWindow, resourceToResource, (long) ControlList);
SetCtlValue (ConfigDelay+1, GetCtlHandleFromID (SetupWindow, DelayPU));
SetCtlValue (ConfigNumLines, GetCtlHandleFromID (SetupWindow, NumLinesPU));
SetCtlValue (ConfigQuitAfterOne, GetCtlHandleFromID (SetupWindow, QuitAfterOneCB));
return 0x04l;
}
void LoadSetupT2StringArt(void)
{
/* Option word format
** 0x8000 = QuitAfterOne
** 0x00F0 = Daley
** 0x000F = NumLines
*/
OptionWord = LoadConfigResource (ConfigNameString, 0x0029);
ConfigQuitAfterOne = (OptionWord & 0xF000) >> 15;
ConfigDelay = (OptionWord & 0x00F0) >> 4;
ConfigNumLines = OptionWord & 0x000F;
}
LongWord StringArt(LongWord data2, LongWord data1, Word message)
{
LongWord Result = 0L;
switch (message)
{
case MakeT2:
SetupWindow = (GrafPortPtr) data1;
SetupFileNumber = (Word) data2;
Result = MakeT2StringArt ();
break;
case BlankT2:
if(data2 & bmiBlankNow)
ConfigQuitAfterOne=0;
movePtr=(Word *) data1;
Result = BlankT2StringArt ();
break;
case SaveT2:
SaveT2StringArt();
break;
case LoadSetupT2:
LoadSetupT2StringArt();
break;
case UnloadSetupT2:
break;
case KillT2:
break;
case HitT2:
Result = HitT2StringArt(data2);
break;
}
return Result;
}

147
source/twilight/James/tv.cc Normal file
View File

@ -0,0 +1,147 @@
/*
** T2 for T2 by James C. Smith
*/
#pragma keep "T2"
#pragma cdev T2
#pragma optimize -1
#pragma debug 0
#include "T23.H"
#include <memory.h>
#include <time.h>
#include <quickdraw.h>
#include <string.h>
#include <sane.h>
#include <locator.h>
#pragma lint 0
pascal LongWord TickCount() inline(0x1006,dispatcher);
pascal void SysBeep() inline(0x2C03,dispatcher);
int i, Color;
word MyID;
int Colors[16], Colors2[16], ColorCount=0;
int SlideColor, SlideDirection, SlideCounter, SlideMask;
int RectAry[4];
float Depth, Accel;
Long OldTick, TmpTick;
Word *movePtr;
LongWord BlankT2T2(void)
{
time_t t;
struct tm trec;
struct startupToolsOut TVToolsOut;
int startSane;
startSane = SANEStatus();
if (!startSane) {
SendRequest((word) t2StartupTools, (word) stopAfterOne+sendToName, (long) toT2Str,
(((long)MyID)<<16) | startshut_sane,
(Ptr) &TVToolsOut);
if (TVToolsOut.errors)
return (LongWord) NULL;
}
Color=15;
OldTick=0;
SlideCounter=1;
Depth=-45;
Accel=3;
OldTick=0;
SetPenMode(modeCopy);
for(i=0; i<16; i++) Colors2[i]=i;
SetColorTable(0, Colors2);
t=time(NULL); /* Get a seed for the random number */
trec=*localtime(&t); /* genorator from the clock */
srand(trec.tm_sec);
while (!(*movePtr)) /* Animate the screen until the movePtr becomes true */
{
if(ColorCount > 0) {
ColorCount=0;
Color++;
if(Color > 15)
Color=1;
if(Color==1 && Depth > 99) {
if(SlideCounter==1){ /* pick new color to slide and */
do {
SlideColor=(rand()% 3) *4; /* determin the direction to slide in */
SlideMask= 0x0F << SlideColor;
if(Colors2[15] & SlideMask) SlideDirection=0;
else SlideDirection=1;
} while((Colors2[15] ^ SlideMask)==0);
}
for(i=SlideCounter; i < 16; i++) /* slide the color */
if (SlideDirection) Colors2[i]+= 1<<SlideColor;
else Colors2[i]-= 1<<SlideColor;
SlideCounter++;
if(SlideCounter>15)
SlideCounter=1;
}
memcpy(&Colors[1], &Colors2[16-Color], (long) Color<<1); /* cycle colors */
if (Color<15) memcpy(&Colors[Color+1], &Colors2[1], (long) (15-Color)<<1);
TmpTick=OldTick;
while((OldTick=TickCount())==TmpTick);
SetColorTable(0, Colors);
}
ColorCount++;
SetSolidPenPat(16-Color);
if(Depth<100){
RectAry[0]=Depth;
RectAry[2]=199-Depth;
RectAry[1]=Depth*1.6;
RectAry[3]=319-RectAry[1];
PaintOval((Rect *) RectAry);
Depth+=Accel;
Accel=Accel/1.02;
}
}
ClearScreen (0);
if (!startSane)
SendRequest(t2ShutdownTools, stopAfterOne+sendToName, (long) toT2Str,
(long) startshut_sane,
(long) NULL);
return (LongWord) NULL;
}
LongWord T2(LongWord data2, LongWord data1, Word message)
{
LongWord Result = 0L;
MyID=MMStartUp();
switch (message)
{
case BlankT2:
movePtr=(Word *) data1;
Result = BlankT2T2 ();
break;
case MakeT2:
case SaveT2:
case LoadSetupT2:
case UnloadSetupT2:
case KillT2:
case HitT2:
break;
}
return Result;
}

View File

@ -0,0 +1,419 @@
/*
** Twilight for T2 by James C. Smith
*/
#pragma keep "Twilight"
#pragma cdev Twilight
#pragma optimize -1
#pragma debug 0
#include "T2.H"
#include "random3.h"
#include <quickdraw.h>
#include <string.h>
#include <memory.h>
#include <types.h>
#include <control.h>
#include <resources.h>
#define ClockIcon 0x0010DD01
#define ControlList 0x00001003
#define IconControl 0x00000001
#define FastCB 0x00000002
#define NumBuildingsPU 0x00000003
#define NumStarsPU 0x00000004
#define BuildingHeightPU 0x00000005
#define BuildingWidthPU 0x00000006
#define LimitCB 0x00000007
#define MaxLinesPerFrame 8
#pragma lint 0
pascal LongWord TickCount() inline(0x1006,dispatcher);
pascal void SysBeep() inline(0x2C03,dispatcher);
LongWord MakeT2Twilight(void);
void LoadSetupT2Twilight(void);
void SaveConfigResource(char *, word);
word LoadConfigResource(char *, word);
LongWord HitT2Twilight(LongWord);
void SaveT2Twilight(void);
void Wait(int);
int HitBuilding(int,int,int);
void Erase(int);
Word SetupFileNumber;
GrafPortPtr SetupWindow;
word OptionWord;
char *ConfigNameString="\pTwilightModule Config";
word ConfigNumBuildings, ConfigBuildingHeight, ConfigBuildingWidth, ConfigNumStars, ConfigFast, ConfigLimit;
word NumBuildings, BuildingHeight, BuildingWidth, NumStars;
Long OldTick=0, TmpTick;
Word *movePtr;
long VRam;
#define MaxNumStars 900
#define MaxNumBuildings 16
unsigned int X[MaxNumStars], Y[MaxNumStars];
int BX[MaxNumBuildings], BHeight[MaxNumBuildings], BWidth[MaxNumBuildings];
int XO[MaxNumBuildings], YO[MaxNumBuildings], XI[MaxNumBuildings], YI[MaxNumBuildings];
int Building, Star;
int MyColorTable[]={0x000,0xFF7,0xFFF,0xEEE,0xDDD,0xCCC,0xBBB,0xAAA,0x999,0x888,0x777,0x666,0x555,0x444,0x333,0x222};
void Wait(int WaitLength)
{
TmpTick=OldTick;
while(((OldTick=TickCount())<=TmpTick+WaitLength) && (!(*movePtr)));
}
int HitBuilding(int X,int Y, int B) /* b=building to start the search with */
{
if(NumBuildings)
for(; B<NumBuildings; B++)
if(Y>=(200-BHeight[B])+YO[B] && X>=BX[B]+XO[B] && X<=BX[B]+BWidth[B]+XO[B])
return 1;
return 0;
}
void Erase(int StarNumber)
{
unsigned int XD, YD;
XD=X[StarNumber] & 0x800;
YD=Y[StarNumber] & 0x800;
X[StarNumber] &= 0x7FF;
Y[StarNumber] &= 0x7FF;
set_pixel(X[StarNumber], Y[StarNumber], 0);
if(XD)
set_pixel(X[StarNumber]+1, Y[StarNumber], 0);
if(YD)
{
set_pixel(X[StarNumber], Y[StarNumber]+1, 0);
if(XD)
set_pixel(X[StarNumber]+1, Y[StarNumber]+1, 0);
}
}
LongWord BlankT2Twilight(void)
{
if((*((char *)0x00C035))& 0x08)
VRam=0xE10000l;
else
VRam=0x010000l;
init_plot((char *) VRam,(char *)GetAddress(1), toT2Str);
init_random(toT2Str);
set_random_seed();
SetColorTable(0, (void *) MyColorTable);
for(Star=0; Star<NumStars; Star++)
{
X[Star]=-1;
Y[Star]=-1;
}
if(NumBuildings)
for(Building=0; Building <NumBuildings; Building++)
{
do {
XI[Building]=(random() % 4)+2;
YI[Building]=((random()>>2) % 4)+2;
} while (XI[Building]+YI[Building] < 7);
XO[Building]=(random()>>1) % 8;
YO[Building]=(random()>>2) % 8;
BWidth[Building]=((random() % (BuildingWidth>>1)) + (BuildingWidth>>1))/XI[Building]*XI[Building]-1;
BX[Building]=(random() % (320-BWidth[Building]))/XI[Building]*YI[Building];
BHeight[Building]=(random() % (BuildingHeight>>1))+(BuildingHeight>>1);
}
while (!(*movePtr)) /* Animate the screen until the movePtr becomes true */
{
Star=random() % NumStars;
if(X[Star]!=-1)
Erase(Star);
if(!ConfigFast)
Wait((random() % 20)+5);
if(NumBuildings && (random() & 0x13))
{
do{
Building=random() % NumBuildings;
X[Star]=((random() % BWidth[Building]) + BX[Building])/XI[Building]*XI[Building]+XO[Building];
Y[Star]=(200-(random() % BHeight[Building]))/YI[Building]*YI[Building]+YO[Building];
} while(HitBuilding(X[Star],Y[Star],Building+1));
set_pixel(X[Star], Y[Star], 1);
if(!ConfigLimit)
{
if(XI[Building] > 4)
{
set_pixel(X[Star]+1, Y[Star], 1);
if(YI[Building] > 4)
set_pixel(X[Star]+1, Y[Star]+1, 1);
X[Star] |=0x800;
}
if(YI[Building] > 4)
{
set_pixel(X[Star] & 0x7FF, Y[Star]+1, 1);
Y[Star] |=0x800;
}
}
} else {
int tmp;
do{
X[Star]=random() % 320;
tmp=(random() % 170)+10;
Y[Star]=tmp*tmp/190;
} while(HitBuilding(X[Star],Y[Star],0));
set_pixel(X[Star], Y[Star], (random() % 14) + 2);
}
if(!ConfigFast)
Wait((random() % 20)+5);
}
return (LongWord) NULL;
}
void SaveT2Twilight(void)
{
Word FileNumber;
/* Save current resource file and switch in Twilight.Setup */
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
/* Save control values */
ConfigNumBuildings =GetCtlValue (GetCtlHandleFromID (SetupWindow, NumBuildingsPU))-1;
ConfigBuildingHeight =GetCtlValue (GetCtlHandleFromID (SetupWindow, BuildingHeightPU))-1;
ConfigBuildingWidth =GetCtlValue (GetCtlHandleFromID (SetupWindow, BuildingWidthPU))-1;
ConfigNumStars = GetCtlValue (GetCtlHandleFromID (SetupWindow, NumStarsPU))-1;
ConfigFast = GetCtlValue (GetCtlHandleFromID (SetupWindow, FastCB));
ConfigLimit = GetCtlValue (GetCtlHandleFromID (SetupWindow, LimitCB));
OptionWord=(ConfigLimit << 14) | (ConfigFast<<13)|(ConfigNumStars<<10)|(ConfigBuildingWidth<<7)|(ConfigBuildingHeight<<4)|ConfigNumBuildings;
SaveConfigResource(ConfigNameString, OptionWord);
/*****************************/
/* Restore old resource file */
/*****************************/
SetCurResourceFile (FileNumber);
}
LongWord HitT2Twilight(LongWord ControlHit)
{
LongWord EnableFlag = 0L;
if (ControlHit == NumBuildingsPU)
EnableFlag = 1L;
if (ControlHit == BuildingHeightPU)
EnableFlag = 1L;
if (ControlHit == BuildingWidthPU)
EnableFlag = 1L;
if (ControlHit == NumStarsPU)
EnableFlag = 1L;
if (ControlHit == FastCB)
EnableFlag = 1L;
if (ControlHit == LimitCB)
EnableFlag = 1L;
return EnableFlag;
}
/*****************************************************************************\
|* *|
|* LoadConfigResource- (updated) *|
|* 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;
struct {
word Type;
Long ID;
} HandleInfo;
/**************************************/
/* 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;
}
/*****************************************************************************\
|* *|
|* 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, NULL);
**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);
/*DisposeHandle (ConfigData); */
}
}
LongWord MakeT2Twilight (void)
{
CtlRecHndl junk;
Word FileNumber;
FileNumber = GetCurResourceFile ();
SetCurResourceFile (SetupFileNumber);
LoadSetupT2Twilight();
SetCurResourceFile (FileNumber);
junk=NewControl2(SetupWindow, resourceToResource, (long) ControlList);
SetCtlValue (ConfigNumBuildings+1, GetCtlHandleFromID (SetupWindow, NumBuildingsPU));
SetCtlValue (ConfigBuildingHeight+1, GetCtlHandleFromID (SetupWindow, BuildingHeightPU));
SetCtlValue (ConfigBuildingWidth+1, GetCtlHandleFromID (SetupWindow, BuildingWidthPU));
SetCtlValue (ConfigNumStars+1, GetCtlHandleFromID (SetupWindow, NumStarsPU));
SetCtlValue (ConfigFast, GetCtlHandleFromID (SetupWindow, FastCB));
SetCtlValue (ConfigLimit, GetCtlHandleFromID (SetupWindow, LimitCB));
return 0x07l;
}
void LoadSetupT2Twilight(void)
{
/* Option word format
** 0X4000 = Limit
** 0X2000 = Fast
** 0X1C00 = NumStars
** 0X0380 = BuildingWidth
** 0X0070 = BuildingHeight
** 0X000F = NumBuildings
*/
OptionWord = LoadConfigResource (ConfigNameString, 0x1C37);
ConfigNumBuildings = OptionWord & 0x000F;
NumBuildings=ConfigNumBuildings;
ConfigBuildingHeight = (OptionWord & 0x0070) >> 4;
BuildingHeight=(ConfigBuildingHeight+1)*25;
ConfigBuildingWidth = (OptionWord & 0x0380) >> 7;
BuildingWidth=(ConfigBuildingWidth+1)*20;
ConfigNumStars = (OptionWord & 0x1C00) >>10;
NumStars=(ConfigNumStars+1)*100;
ConfigFast = (OptionWord & 0x2000) >> 13;
ConfigLimit = (OptionWord & 0x4000) >> 14;
}
LongWord Twilight(LongWord data2, LongWord data1, Word message)
{
LongWord Result = 0L;
switch (message)
{
case MakeT2:
SetupWindow = (GrafPortPtr) data1;
SetupFileNumber = (Word) data2;
Result = MakeT2Twilight ();
break;
case BlankT2:
movePtr=(Word *) data1;
Result = BlankT2Twilight ();
break;
case SaveT2:
SaveT2Twilight();
break;
case LoadSetupT2:
LoadSetupT2Twilight();
break;
case UnloadSetupT2:
break;
case KillT2:
break;
case HitT2:
Result = HitT2Twilight(data2);
break;
}
return Result;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
nol ;turn listing off (NO List)
ovr ;always assemble
asm impulse ;assemble the file
lnk impulse.l
typ EXE
sav impulse.d ;useful for testing!
* typ $BC
* cmd auxtype impulse,$4004

View File

@ -0,0 +1,241 @@
*=================================================
* Macros
add MAC
LDA ]1
CLC
ADC ]2
BPL Positive
CLC
ADC #512
BRA Cont_Add
Positive CMP #512
BCC Cont_Add
SEC
SBC #512
Cont_Add STA ]1
EOM
TABLE_SPECIAL MAC
MX %00
LDA ]1 ; Pas Elementaire
LSR
LDX Perspective
BNE Div2_Only
* LSR
LSR ; Divise par 2
; pour recuperer un bit de precision
Div2_Only LDX ]2 ; Signe Pas elementaire
BEQ No_Inversaga
EOR #$FFFF
INC
No_Inversaga = *
STA Buf_VAL ; Valeur
LDA ]4
ASL
CLC
ADC #]3
STA Patch0
LDA ]4
ASL
STA Patch2
LDX #0
LDA #0
]lp STA !$0000,X
Patch0 = *-2
CLC
ADC Buf_VAL
CPX #0
Patch2 = *-2
BEQ Patch1
INX
INX
BRA ]lp
Patch1 DEX
DEX
BMI Here ; Cas ou la dim = 0
LDA #0
]lp SEC
SBC Buf_VAL
STA ]3,X
DEX
DEX
BPL ]lp
Here EOM
TABLE MAC
MX %00
LDA ]1 ; Pas Elementaire
LSR ; Divise par 2
; pour recuperer un bit de precision
LDX ]2 ; Signe Pas elementaire
BEQ No_Inversaga
EOR #$FFFF
INC
No_Inversaga = *
STA Buf_VAL ; Valeur
LDA ]4
ASL
CLC
ADC #]3
STA Patch0
LDA ]4
ASL
STA Patch2
LDX #0
LDA #0
]lp STA !$0000,X
Patch0 = *-2
CLC
ADC Buf_VAL
CPX #0
Patch2 = *-2
BEQ Patch1
INX
INX
BRA ]lp
Patch1 DEX
DEX
BMI Here ; Cas ou la dim = 0
LDA #0
]lp SEC
SBC Buf_VAL
STA ]3,X
DEX
DEX
BPL ]lp
Here EOM
Add MAC
CPY ]1
BEQ Same_Signe0
SEC
SBC ]2
DEY
BEQ First_Negatif0
BCC Inverse_Value0
BRA Cont_Calc0
Inverse_Value0 EOR #$FFFF
INC
INC ]3
BRA Cont_Calc0
First_Negatif0 BCS Cont_Calc0
EOR #$FFFF
INC ; Change le signe
STZ ]3
BRA Cont_Calc0
Same_Signe0 CLC
ADC ]2
Cont_Calc0 STA ]4 ; *
EOM
Plot1 MAC
txa
bmi ]aa
cmp #$7d01
bcs ]aa
LDAL $012000-1,X
HEX 0901F1
STAL $012000-1,X
]aa TXA
ADC #$2000-1
CMP Old
BEQ No_Store
STA Old
cmp #$9d00+1
bcs No_Store
STA [Ptr_Clear]
STA [Ptr_Tsb]
STA [Ptr_Tsb2]
INC Ptr_Clear
INC Ptr_Clear
INC Ptr_Clear
INC Ptr_Tsb
INC Ptr_Tsb
INC Ptr_Tsb
INC Ptr_Tsb2
INC Ptr_Tsb2
INC Ptr_Tsb2
No_Store CLC
EOM
EOM
Plot0 MAC
txa
bmi ]bb
cmp #$7d00
bcs ]bb
LDAL $012000,X
HEX 091F10
STAL $012000,X
]bb TXA
ADC #$2000
CMP Old
BEQ No_Store
STA Old
cmp #$9d00
bcs No_Store
STA [Ptr_Clear]
STA [Ptr_Tsb]
STA [Ptr_Tsb2]
INC Ptr_Clear
INC Ptr_Clear
INC Ptr_Clear
INC Ptr_Tsb
INC Ptr_Tsb
INC Ptr_Tsb
INC Ptr_Tsb2
INC Ptr_Tsb2
INC Ptr_Tsb2
No_Store CLC
EOM
BCSL MAC
BCC Here
BRL ]1
Here EOM
BCCL MAC
BCS Here
BRL ]1
Here EOM
BNEL MAC
BEQ Here
BRL ]1
Here EOM
BMIL MAC
BPL Here
BRL ]1
Here EOM
bcsl MAC
BCC Here
BRL ]1
Here EOM
bccl MAC
BCS Here
BRL ]1
Here EOM
bnel MAC
BEQ Here
BRL ]1
Here EOM
beql MAC
BNE Here
BRL ]1
Here EOM
bmil MAC
BPL Here
BRL ]1
Here EOM
*=================================================

View File

@ -0,0 +1,289 @@
~IntSource MAC
PHW ]1
Tool $2303
<<<
~MMStartUp MAC
PHA
Tool $202
<<<
~MMShutDown MAC
PHW ]1
Tool $302
<<<
_MMShutDown MAC
Tool $302
<<<
_WriteResource MAC
Tool $161E
<<<
~NewHandle MAC
P2SL ]1
PxW ]2;]3
PHL ]4
Tool $902
<<<
~DisposeAll MAC
PHW ]1
Tool $1102
<<<
PHW MAC
IF #=]1
PEA ]1
ELSE
IF MX/2
LDA ]1+1
PHA
FIN
LDA ]1
PHA
FIN
<<<
PHL MAC
IF #=]1
PEA ^]1
ELSE
PHW ]1+2
FIN
PHW ]1
<<<
P2SL MAC
PHA
PHA
IF #=]1
PEA ^]1
ELSE
PHW ]1+2
FIN
PHW ]1
<<<
Tool MAC
LDX #]1 ; load tool call #
JSL $E10000 ; go to dispatcher
<<<
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
<<<
PushLong MAC
IF #=]1
PushWord #^]1
ELSE
PushWord ]1+2
FIN
PushWord ]1
<<<
PushWord MAC
IF #=]1
PEA ]1
ELSE
IF MX/2
LDA ]1+1
PHA
FIN
LDA ]1
PHA
FIN
<<<
_NewControl2 MAC
Tool $3110
<<<
BEQL MAC
BNE OV
BRL ]1
OV <<<
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
<<<
~GetTick MAC
PHS 2
Tool $2503
<<<
PHS MAC
DO ]0
LUP ]1
PHA
--^
ELSE
PHA
FIN
<<<
~NewControl2 MAC
P2SL ]1
PHWL ]2;]3
Tool $3110
<<<
PHWL MAC
PHW ]1
PHL ]2
<<<
_SetCtlValue MAC
Tool $1910
<<<
_GetCtlValue MAC
Tool $1A10
<<<
~GetCtlHandleFromID MAC
PHS 2
PxL ]1;]2
Tool $3010
<<<
_GetCtlHandleFromID MAC
Tool $3010
<<<
_NewHandle MAC
Tool $902
<<<
_AddResource MAC
Tool $C1E
<<<
~UpdateResourceFile MAC
PHW ]1
Tool $D1E
<<<
_UpdateResourceFile MAC
Tool $D1E
<<<
_RemoveResource MAC
Tool $F1E
<<<
_MarkResourceChange MAC
Tool $101E
<<<
~SetCurResourceFile MAC
PHW ]1
Tool $111E
<<<
_SetCurResourceFile MAC
Tool $111E
<<<
~GetCurResourceFile MAC
PHA
Tool $121E
<<<
~UniqueResourceID MAC
P2SW ]1
PHW ]2
Tool $191E
<<<
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
<<<
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
<<<
P2SW MAC
PHA
PHA
IF #=]1
PEA ]1
ELSE
IF MX/2
LDA ]1+1
PHA
FIN
LDA ]1
PHA
FIN
<<<
_ReleaseResource MAC
Tool $171E
<<<
_RMSetResourceName mac
Tool $2D1E
<<<
~RMLoadNamedResource mac
PHS 2
PHWL ]1;]2
Tool $2C1E
<<<
~RMFindNamedResource mac
PHS 2
PHW ]1
PxL ]2;]3
Tool $2A1E
<<<
killLdp MAC
pld
ply
ply
<<<
~GetIRQEnable MAC
PHA
Tool $2903
<<<
wr MAC
phd
<<<
lr MAC
phd
phd
<<<
_GetTick MAC
Tool $2503
<<<
_UDivide MAC
Tool $B0B
<<<
_SendRequest MAC
Tool $1c01
<<<
_PtrToHand MAC
Tool $2802
<<<
~GetCurResourceApp MAC
PHA
Tool $141E
<<<
_HexIt MAC
Tool $2A0B
<<<

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,39 @@
rel
dsk random3.c
use random2.mac
put 22:t2common.equ
put 2:ainclude:e16.locator
init_random = *
rtlAddr equ 1
targetStr equ rtlAddr+3
lda targetStr+2,s
tax
lda targetStr,s
PushWord #t2PrivGetProcs
PushWord #stopAfterOne+sendToName
phx
pha
PushLong #8
PushLong #dataOut
_SendRequest
jsl set_random_seed
lda 1,s
sta 1+4,s
lda 2,s
sta 2+4,s
plx
plx
rtl
dataOut
ds 2
set_random_seed = *
ds 4
random = *
ds 4

View File

@ -0,0 +1,257 @@
HEX FFFFFBFFECFFD3FFB1FF84FF4EFF0EFF
HEX C4FE71FE13FEACFD3BFDC0FC3CFCADFB
HEX 16FB74FAC9F914F955F88DF7BCF6E1F5
HEX FCF40EF417F316F20CF1F9EFDDEEB7ED
HEX 88EC50EB0FEAC5E872E716E6B1E443E3
HEX CDE14EE0C6DE36DD9DDBFCD952D8A0D6
HEX E6D423D358D186CFABCDC9CBDEC9ECC7
HEX F2C5F0C3E7C1D7BFBFBDA0BB79B94CB7
HEX 17B5DBB299B04FAEFFABA9A94BA7E8A4
HEX 7EA20EA0979D1B9B989810968293EE90
HEX 548EB68B11896886B98305814D7E8F7B
HEX CD7806763A736A70966DBD6AE0670065
HEX 1B62335F475C575964566E537450784D
HEX 784A7647704469415E3E513B42383135
HEX 1E32082FF12BD928BE25A322861F671C
HEX 481927160613E40FC20C9F097B065803
HEX 3400EF0213063609590C7C0F9E12BF15
HEX E018001C1E1F3B22572572288B2BA22E
HEX B731CB34DC37EC3AF93D04410C441147
HEX 144A144D11500B530256F558E55BD25E
HEX BB61A06481675E6A376D0C70DD72A975
HEX 7178347BF27DAB8060830F86B9885E8B
HEX FE8D98902C93BB954498C89A459DBC9F
HEX 2DA298A4FCA65AA9B2AB03AE4DB091B2
HEX CDB403B731B959BB79BD92BFA3C1ADC3
HEX B0C5ABC79EC989CB6DCD49CF1CD1E8D2
HEX ACD467D61AD8C5D967DB01DD92DE1BE0
HEX 9CE113E382E4E8E545E799E8E4E927EB
HEX 60EC90EDB7EED5EFE9F0F4F1F6F2EFF3
HEX DEF4C4F5A0F673F73CF8FCF8B2F95EFA
HEX 01FB9AFB2AFCAFFC2CFD9EFD06FE65FE
HEX BAFE05FF46FF7EFFABFFCFFFE9FFF9FF
HEX FFFFFCFFEEFFD7FFB6FF8BFF56FF17FF
HEX CEFE7CFE20FEBAFD4AFDD1FC4DFCC0FB
HEX 2AFB89FADFF92CF96FF8A8F7D8F6FEF5
HEX 1BF52EF438F338F22FF11DF002EFDDED
HEX B0EC79EB39EAF0E89EE743E6E0E473E3
HEX FEE180E0F9DE6ADDD2DB32DA8AD8D9D6
HEX 1FD55ED394D1C3CFE9CD08CC1ECA2DC8
HEX 34C634C42BC21CC005BEE7BBC1B994B7
HEX 61B526B3E4B09CAE4DACF7A99AA738A5
HEX CEA25FA0E99D6E9BEC986496D7934491
HEX AB8E0D8C6989C18613845F81A77EEA7B
HEX 297962769773C870F46D1C6B40686065
HEX 7C62945FA85CB959C756D153D750DB4D
HEX DC4ADA47D544CD41C33EB73BA8389735
HEX 84326F2F582C402926260A23ED1FCF1C
HEX B0198F166E134C102A0D070AE406C003
HEX 9C008702AA05CE08F10B140F36125715
HEX 7818981BB61ED421F0240B28242B3B2E
HEX 513165347737863A943D9F40A743AD46
HEX B049B14CAE4FA952A0559458845B715E
HEX 5A6140642267FF69D96CAE6F7F724C75
HEX 1478D87A977D51800683B6856188068B
HEX A78D4290D7926695F097749AF29C6A9F
HEX DCA148A4ADA60CA964ABB6AD01B046B2
HEX 83B4BAB6E9B811BB33BD4CBF5FC16AC3
HEX 6DC569C75DC94ACB2FCD0BCFE0D0ADD2
HEX 71D42ED6E2D78ED931DBCCDC5FDEE9DF
HEX 6AE1E3E253E4BAE518E76DE8BAE9FDEA
HEX 38EC69ED91EEB0EFC6F0D2F1D5F2CFF3
HEX BFF4A6F584F658F722F8E3F89BF948FA
HEX ECFA87FB18FC9FFC1CFD8FFDF9FD59FE
HEX AFFEFCFE3EFF77FFA6FFCBFFE6FFF8FF
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 0000230347066A098E0CB00FD212F315
HEX 1419331C521F6F228B25A528BE2BD52E
HEX EB31FE340F381F3B2C3E36413E444447
HEX 464A464D43503D5333562659165C025F
HEX EB61D064B1678E6A666D3B700B73D775
HEX 9F78617B1F7ED8808C833B86E5888A8B
HEX 298EC3905793E5956E98F19A6E9DE59F
HEX 55A2C0A424A782A9D9AB29AE73B0B6B2
HEX F2B427B755B97CBB9CBDB4BFC5C1CFC3
HEX D1C5CBC7BEC9A9CB8CCD67CF3AD106D3
HEX C9D483D636D8E0D982DB1BDDACDE35E0
HEX B4E12BE399E4FFE55BE7AFE8FAE93BEB
HEX 74ECA3EDCAEEE7EFFBF005F207F3FFF3
HEX EDF4D2F5AEF680F749F808F9BDF969FA
HEX 0BFBA4FB33FCB8FC33FDA5FD0DFE6BFE
HEX BFFE0AFF4AFF81FFAEFFD1FFEAFFFAFF
HEX FFFFFBFFEDFFD5FFB3FF87FF52FF13FF
HEX C9FE76FE1AFEB3FD43FDC8FC45FCB7FB
HEX 20FB7FFAD4F920F962F89BF7CAF6EFF5
HEX 0CF51EF427F327F21EF10BF0EFEECAED
HEX 9CEC64EB24EADAE888E72DE6C8E45BE3
HEX E5E167E0E0DE50DDB8DB17DA6ED8BCD6
HEX 03D541D376D1A4CFCACDE8CBFEC90CC8
HEX 13C612C409C2F9BFE2BDC3BB9DB970B7
HEX 3CB501B3BEB076AE26ACD0A973A710A5
HEX A6A236A0C09D449BC2983A96AC931991
HEX 808EE18B3D899486E68332817A7EBD7B
HEX FB78347669739970C56DED6A10683065
HEX 4B62635F785C885995569F53A650AA4D
HEX AA4AA847A3449B41913E843B75386435
HEX 51323C2F252C0C29F225D622B91F9B1C
HEX 7C195B163A131810F60CD309AF068C03
HEX 6800BB02DF050209250C480F6A128B15
HEX AC18CC1BEA1E082224253E28572B6F2E
HEX 84319834A937B93AC63DD140DA43DF46
HEX E249E34CE04FDA52D155C558B55BA15E
HEX 8B61706451672F6A086DDD6FAE727B75
HEX 4278067BC47D7E803383E2858D88328B
HEX D28D6D90029391951A989E9A1C9D939F
HEX 05A270A4D5A633A98BABDDAD27B06BB2
HEX A8B4DEB60DB935BB56BD6FBF81C18CC3
HEX 8FC58AC77EC96ACB4ECD2ACFFED0CAD2
HEX 8ED44AD6FED7A9D94CDBE7DC79DE02E0
HEX 83E1FBE26AE4D1E52FE783E8CFE912EB
HEX 4CEC7CEDA4EEC2EFD7F0E3F1E6F2DFF3
HEX CFF4B5F592F665F72FF8F0F8A6F953FA
HEX F7FA91FB21FCA7FC24FD97FD00FE5FFE
HEX B5FE00FF42FF7BFFA9FFCDFFE8FFF8FF
HEX FFFFFCFFEFFFD9FFB8FF8EFF59FF1BFF
HEX D3FE82FE26FEC1FD52FDD9FC56FCCAFB
HEX 34FB94FAEBF938F97BF8B5F7E5F60CF6
HEX 2AF53EF448F349F241F12FF015EFF1ED
HEX C4EC8DEB4EEA06E9B4E75AE6F7E48BE3
HEX 16E299E013DF84DDEDDB4DDAA5D8F5D6
HEX 3CD57BD3B2D1E1CF08CE27CC3ECA4EC8
HEX 55C655C44DC23EC028BE0ABCE5B9B9B7
HEX 85B54BB30AB1C2AE73AC1EAAC2A75FA5
HEX F7A288A0129E979B16998F9602946F91
HEX D68E398C9589ED863F848C81D57E187C
HEX 57799076C673F770236E4B6B6F689065
HEX AC62C45FD95CEA59F856025409510D4E
HEX 0E4B0C4807450042F63EEA3BDB38CA35
HEX B732A22F8C2C732959263E232120031D
HEX E419C316A21381105E0D3B0A1807F403
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000000000000000000000000000000
HEX 00000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100
HEX 01000100010001000100010001000100

View File

@ -0,0 +1,673 @@
#include "types.rez"
#include "22:t2common.rez"
// --- Flags resource
resource rT2ModuleFlags (moduleFlags) {
fSetup+fFadeOut+fFadeIn+fGrafPort320, // module flags word
$01, // enabled flag (unimplemented)
$0110, // minimum T2 version required
NIL, // reserved
"Impulse 3D" // module name
};
// --- About text resource
resource rTextForLETextBox2 (moduleMessage) {
TBLeftJust
TBBackColor TBColorE
TBForeColor TBColor4
"Impulse 3D"
TBForeColor TBColor0
" zooms, scales and rotates dazzling wireframe 3D objects in real time.\n"
TBBackColor TBColorF
TBForeColor TBColor1
"Impulse works best with low memory mode turned off."
};
// --- Version resource
resource rVersion (moduleVersion) {
{1,0,0,release,0}, // Version
verUS, // US Version
"T2 Impulse 3D Module", // program's name
"By FTA & Jim Maricondo.\n"
"Copyright 1992-93 Jim Maricondo." // copyright notice
};
// --- About icon resource
resource rIcon (moduleIcon) {
$8000, // kind
$0014, // height
$0016, // width
$"F00000000000000000000F"
$"0FFFFFFFFFFFFFFFFFFFF0"
$"0F000000000000000000F0"
$"0F000B3000000E300000F0"
$"0F0000B300000EE30000F0"
$"0F00000B30000E3E3000F0"
$"0F000BBBB3000E30E300F0"
$"0F000000B3000E30E300F0"
$"0F00000B30000E3E3000F0"
$"0F0000B300000EE30000F0"
$"0F000B3000000E300000F0"
$"0F000000000000000000F0"
$"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";
};
// --- type $8004 defines
#define CTLTMP_00006FFD $00006FFD
#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_0000000D $0000000D
#define PSTR_0000000E $0000000E
#define PSTR_0000000F $0000000F
#define PSTR_00000010 $00000010
#define PSTR_00000011 $00000011
#define PSTR_00000012 $00000012
#define PSTR_000000FC $000000FC
#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
// --- type $8009 defines
#define MENU_00000001 $00000001
#define MENU_00000002 $00000002
// --- 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
// --- type $800B defines
#define LETXTBOX_00000001 $00000001
#define LETXTBOX_00000002 $00000002
// --- type $800E defines
#define WPARAM1_00000FFF $00000FFF
// --- type $8010 defines
#define WCOLOR_00000001 $00000001
// --- Control List Definitions
resource rControlList (1) {
{
CTLTMP_00007002, // control 1
CTLTMP_00007001, // control 2
CTLTMP_00007000, // control 3
CTLTMP_00006FFF, // control 4
CTLTMP_00006FFE, // control 5
CTLTMP_00006FFD, // control 6
1, // control 7
2, // control 8
};
};
// --- Control Templates
resource rControlTemplate (CTLTMP_00006FFE) {
1, // ID
{ 82, 14, 91,338}, // rect
checkControl {{
$0000, // flag
$3002, // moreFlags
$00000000, // refCon
PSTR_0000000D, // titleRef
$0001, // initialValue
0, // colorTableRef
{"D","d",$0100,$0100} // key equivalents
}};
};
resource rControlTemplate (CTLTMP_00006FFF) {
2, // ID
{ 66, 12, 0, 0}, // rect
popUpControl {{
$0040, // flag
$1002+fDrawPopDownIcon, // moreFlags
$00000000, // refCon
$0000, // titleWidth
MENU_00000002, // menuRef -- SHOW DELAY popup
2, // initialValue
0 // colorTableRef
}};
};
resource rControlTemplate (CTLTMP_00007000) {
3, // ID
{ 51, 12, 0, 0}, // rect
popUpControl {{
$0040, // flag
$1002+fDrawPopDownIcon, // moreFlags
$00000000, // refCon
$0000, // titleWidth
MENU_00000001, // menuRef -- WHICH SHAPE popup
16, // initialValue
0 // colorTableRef
}};
};
resource rControlTemplate (CTLTMP_00006FFD) {
4, // ID
{108, 72,127,271}, // rect
statTextControl {{
$0000, // flag
$1002, // moreFlags
$00000000, // refCon
LETXTBOX_00000002 // textRef
}};
};
resource rControlTemplate (CTLTMP_00007001) {
5, // ID
{ 32,136, 42,255}, // rect
statTextControl {{
$0000, // flag
$1002, // moreFlags
$00000000, // refCon
LETXTBOX_00000001 // textRef
}};
};
resource rControlTemplate (CTLTMP_00007002) {
6, // ID
{ 25, 84, 48,130}, // rect
iconButtonControl {{
$000C, // flag
$1020, // moreFlags
$00000000, // refCon
moduleIcon, // iconRef
0, // titleRef
0, // colorTableRef
$0000 // displayMode
}};
};
resource rControlTemplate (1) {
7, // ID
{105,42,106,296}, // rect
rectangleControl {{
$0002, // flag (%10 = black pattern)
fCtlProcNotPtr, // moreFlags (required values)
NIL // refCon
}};
};
resource rControlTemplate (2) {
8, // ID
// { 93, 14,102,296}, // rect
{ 93, 14,102,338}, // rect
checkControl {{
$0000, // flag
$3002, // moreFlags
$00000000, // refCon
10, // titleRef
$0000, // initialValue
0, // colorTableRef
{"M","m",$0100,$0100} // key equivalents
}};
};
// --- rPString Templates
resource rPString (PSTR_0000000D) {
"Display Frames Per Second (fps) Counter"
};
resource rPString (10) {
"Maximum Zoom (Accelerator Recommended)"
};
// --- SHOW DELAY popup
resource rPString (PSTR_0000000F) {
" Show Each Shape For: "
};
resource rPString (PSTR_0000000E) { //1
"10 Seconds"
};
resource rPString (PSTR_00000115, $C018) { //2 - DEFAULT
"20 Seconds"
};
resource rPString (PSTR_00000116, $C018) { //3
"30 Seconds"
};
resource rPString (PSTR_00000117, $C018) { //4
"1 Minute"
};
resource rPString (PSTR_00000118, $C018) { //5
"2 Minutes"
};
resource rPString (PSTR_00000119, $C018) { //6
"5 Minutes"
};
resource rPString (PSTR_0000011A, $C018) { //7
"10 Minutes"
};
// --- WHICH SHAPE popup
resource rPString (PSTR_00000011) {
" Shape: "
};
resource rPString (PSTR_00000010) { //1 - default
"All"
};
resource rPString (PSTR_00000107, $C018) { //2
"Random"
};
resource rPString (PSTR_0000010D, $C018) { //3
"DYA 3D Logo"
};
resource rPString (3) { //4
"Diamond"
};
resource rPString (4) { //5
"Pyramid"
};
resource rPString (PSTR_0000010C, $C018) { //6
"FTA Logo"
};
resource rPString (PSTR_0000010B, $C018) { //7
"Cube I"
};
resource rPString (2) { //8
"Car"
};
resource rPString (PSTR_0000010A, $C018) { //9
"DYA 2D Logo"
};
resource rPString (PSTR_00000109, $C018) { //10
"Cube II"
};
resource rPString (PSTR_00000108, $C018) { //11
"ACS Logo 1"
};
resource rPString (PSTR_00000110, $C018) { //12
"Apple Logo 1"
};
resource rPString (PSTR_0000010F, $C018) { //13
"Apple Logo 2"
};
resource rPString (PSTR_0000010E, $C018) { //14
"ACS Logo 2"
};
resource rPString (PSTR_00000111, $C018) { //15
"Rebound"
};
resource rPString (PSTR_00000113, $C018) { //16
"Dijon, France"
};
resource rPString (PSTR_00000112, $C018) { //17
"World"
};
resource rPString (PSTR_00000114, $C018) { //18
"Ship"
};
resource rPString (5) {
"GS"
};
// --- Menu Definitions
resource rMenu (MENU_00000001) {
$0001, // menuID
$A000, // menuFlag
PSTR_00000011, { // menuTitleRef -- WHICH SHAPE popup
MENUITEM_0000010D, // dya
3, // diamond
4, // pyramid
MENUITEM_0000010C, // fta
MENUITEM_0000010B, // cube
2, // car
MENUITEM_0000010A, // dya2d
MENUITEM_00000109, // cuberev
MENUITEM_00000108, // acs
MENUITEM_00000110, // applealone
MENUITEM_0000010F, // apple
MENUITEM_0000010E, // acs2
MENUITEM_00000111, // rebound
MENUITEM_00000113, // fracne
MENUITEM_00000112, // world
MENUITEM_00000114, // ship
5, // iigs
MENUITEM_00000107, // random
MENUITEM_00000001 // all -- DEFAULT
};
};
resource rMenu (MENU_00000002) {
$0002, // menuID
$A000, // menuFlag
PSTR_0000000F, { // menuTitleRef -- SHOW DELAY popup
MENUITEM_00000115, // 10s
MENUITEM_00000116, // 20s
MENUITEM_00000117, // 30s
MENUITEM_00000118, // 1m
MENUITEM_00000119, // 2m
MENUITEM_0000011A, // 5m
MENUITEM_0000011B // 10m
};
};
// --- Menu Item Definitions
// --- WHICH SHAPE popup defs
resource rMenuItem (MENUITEM_00000001) {
1, // itemID - ALL
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8002, // itemFlag - DEFAULT ("All")
PSTR_00000010 // itemTitleRef
};
resource rMenuItem (MENUITEM_00000107, $C018) {
2, // itemID - RANDOM
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8040, // itemFlag
PSTR_00000107 // itemTitleRef
};
resource rMenuItem (MENUITEM_0000010D, $C018) {
3, // itemID -- DYA
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_0000010D // itemTitleRef
};
resource rMenuItem (3, $C018) {
4, // itemID -- DIAMOND
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
3 // itemTitleRef
};
resource rMenuItem (4, $C018) {
5, // itemID -- PYRAMID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
4 // itemTitleRef
};
resource rMenuItem (MENUITEM_0000010C, $C018) {
6, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_0000010C // itemTitleRef
};
resource rMenuItem (MENUITEM_0000010B, $C018) {
7, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_0000010B // itemTitleRef
};
resource rMenuItem (2, $C018) {
8, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
2 // itemTitleRef
};
resource rMenuItem (MENUITEM_0000010A, $C018) {
9, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_0000010A // itemTitleRef
};
resource rMenuItem (MENUITEM_00000109, $C018) {
10, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000109 // itemTitleRef
};
resource rMenuItem (MENUITEM_00000108, $C018) {
11, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000108 // itemTitleRef
};
resource rMenuItem (MENUITEM_00000110, $C018) {
12, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000110 // itemTitleRef
};
resource rMenuItem (MENUITEM_0000010F, $C018) {
13, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_0000010F // itemTitleRef
};
resource rMenuItem (MENUITEM_0000010E, $C018) {
14, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_0000010E // itemTitleRef
};
resource rMenuItem (MENUITEM_00000111, $C018) {
15, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000111 // itemTitleRef
};
resource rMenuItem (MENUITEM_00000113, $C018) {
16, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000113 // itemTitleRef
};
resource rMenuItem (MENUITEM_00000112, $C018) {
17, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000112 // itemTitleRef
};
resource rMenuItem (MENUITEM_00000114, $C018) {
18, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000114 // itemTitleRef
};
resource rMenuItem (5, $C018) {
19, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8040, // itemFlag - underlined
5 // itemTitleRef
};
// --- SHOW DELAY popup defs
resource rMenuItem (MENUITEM_00000115, $C018) {
1, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_0000000E // itemTitleRef
};
resource rMenuItem (MENUITEM_00000116, $C018) {
2, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8002, // itemFlag - DEFAULT
PSTR_00000115 // itemTitleRef
};
resource rMenuItem (MENUITEM_00000117, $C018) {
3, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000116 // itemTitleRef
};
resource rMenuItem (MENUITEM_00000118, $C018) {
1*6, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000117 // itemTitleRef
};
resource rMenuItem (MENUITEM_00000119, $C018) {
2*6, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000118 // itemTitleRef
};
resource rMenuItem (MENUITEM_0000011A, $C018) {
5*6, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_00000119 // itemTitleRef
};
resource rMenuItem (MENUITEM_0000011B, $C018) {
10*6, // itemID
"","", // itemChar, itemAltChar
NIL, // itemCheck
$8000, // itemFlag
PSTR_0000011A // itemTitleRef
};
// --- rTextForLETextBox2 Templates
resource rTextForLETextBox2 (LETXTBOX_00000001) {
"Impulse Options"
};
resource rTextForLETextBox2 (LETXTBOX_00000002) {
TBLeftJust
TBForeColor TBColor1
TBBackColor TBColorF
"Special thanks to Joe Kohn, Matt Keller, and the FTA. (rip)"
};

View File

@ -0,0 +1,17 @@
# impulse makefile
# by Jim Maricondo
# v1.0 - 1/1/93 - coded (tC)
# v1.0.1 - 1/9/93 1:17am 1:56am - enhanced greatly (jG!?)
# v1.0.2 - 2/16/93 8:55pm - t2common.rez. (HB!??!)
impulse.r: impulse.rez 22/t2common.rez
compile impulse.rez keep=impulse.r
impulse: impulse.d impulse.r
duplicate -d impulse.d impulse
duplicate -r impulse.r impulse
setfile -at $4004 -t $bc impulse -m .
setfile 22/impulse -m .
cp impulse *:system:cdevs:twilight:impulse
22:beep

View File

@ -0,0 +1,88 @@
* T2 Common Module Equates. By Jim Maricondo.
* v1.0 - 05/24/92 - Initial Version.
* v1.1 - 05/29/92 - Revised 'cuz of new t2common.rez. - v1.0d33
* v1.2 - 10/24/92 - IPC equates added - v1.0.1b1. - datafield added
* v1.3 - 12/13/92 - mfOverrideSound added - v1.0.1b2
* Resources types.
rT2ModuleFlags equ $1000
rT2ExtSetup1 equ $1001
rT2ModuleWord equ $1002 ; reztype for module words in T2 setup
* Action message codes sent to modules.
MakeT2 equ 0 ; Make module-specific ctls.
SaveT2 equ 1 ; Save new preferences
BlankT2 equ 2 ; Blank the screen.
LoadSetupT2 equ 3 ; Load any resources from yo' fork
UnloadSetupT2 equ 4 ; Dispose of any resources from yo' fk.
KillT2 equ 5 ; Module setup being closed.
HitT2 equ 6 ; Setup window control hit.
do 0
* How the stack is setup when a module gets called.
dp equ 1 ; This is how the stack is set up
Bank equ dp+2 ; with DP at the top and Result
rtlAddr equ Bank+1 ; occuping the top 4 bytes
T2data2 equ rtlAddr+3
T2data1 equ T2data2+4
T2Message equ T2data1+4
T2Result equ T2Message+2
T2StackSize equ T2Result+4
* Softswitches
KBD equ >$E0C000
KBDSTRB equ >$E0C010
RDVBLBAR equ >$E0C019 ; bit 7 = 1 if not VBL
TBCOLOR equ >$E0C022
NEWVIDEO equ >$E0C029
VERTCNT equ >$E0C02E
SPKR equ >$E0C030
CLOCKCTL equ >$E0C034 ; border color / rtc register
SHADOW equ >$E0C035
INCBUSYFLG equ >$E10064 ; increment busy flag
DECBUSYFLG equ >$E10068 ; decrement busy flag
SHR equ >$E12000
SCBS equ >$E19D00
PALETTES equ >$E19E00
fin
* Boolean logic
FALSE equ 0
TRUE equ 1
* T2 External IPC
t2TurnOn equ $9000
t2TurnOff equ $9001
t2BoxOverrideOff equ $9002
t2BoxOverrideOn equ $9003
t2GetCurState equ $9004
t2StartupTools equ $9005
t2ShutdownTools equ $9006
t2ShareWord equ $9007
t2SetBlinkProc equ $9008
t2GetNoBlankCursors equ $9009
t2BkgBlankNow equ $900A
t2GetBuffers equ $900B
t2GetVersion equ $900C
* T2 Private IPC
reqDLZSS equ $8007
t2PrivGetProcs equ $9020
* DataField equates.
SetFieldValue equ $8000 ;custom control messages that are
GetFieldValue equ $8001 ; accepted by DataField
* Flag word passed to modules at loadsetupT2 time...
mfOverrideSound equ $0001 ; bit 0. 1=override sound, 0=sound ok