Add files via upload

This commit is contained in:
Antoine Vignau 2020-06-08 22:55:42 +02:00 committed by GitHub
parent 170429cd2c
commit 937479d95d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
49 changed files with 20797 additions and 0 deletions

View File

@ -0,0 +1,115 @@
MACRO
&lab LongResult
&lab phd
phd
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,12 @@
echo asml Earth1.asm keep=Earth1.d
asml Earth1.asm keep=Earth1.d
echo duplicate -d Earth1.d Earth1
duplicate -d Earth1.d Earth1
echo duplicate -r Earth1.r Earth1
duplicate -r Earth1.r Earth1
echo filetype Earth1 $BC
filetype Earth1 $BC
echo setfile Earth1 -at $4004
setfile Earth1 -at $4004
echo copy -c Earth1 /jim1/system/cdevs/Twilight/Little.Earth
copy -c Earth1 /jim1/system/cdevs/Twilight/Little.Earth

View File

@ -0,0 +1,291 @@
*-----------------------------------------------------------------------------*
! Twilight II Little Bouncing Earth Module. !
! !
! By Jim Maricondo. !
! !
! Copyright (c) 1991 Jim Maricondo. All rights reserved. !
*-----------------------------------------------------------------------------*
longa on
longi on
mcopy Earth1.MAC
*-----------------------------------------------------------------------------*
deref_ptr gequ <0
screen_ptr gequ deref_ptr+4
SLookUp gequ screen_ptr+4
image_ptr gequ SLookUp+4
MyID gequ image_ptr+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
NumEarths gequ 46
CLOCKCTL gequ >$E0C034 border color / rtc register
RDVBLBAR gequ >$E0C019 bit 7 = 1 if not VBL
MAXIMAGES gequ 1 # of images that can be handled
*-----------------------------------------------------------------------------*
Little_Earth Start
Using MainDATA
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 Earth_Pal,x
sta $E19E00,x
dex
dex
bpl pal
LongResult
PushWord #1
_GetAddress
PullLong SLookUp
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
clc
rtl
End
*-----------------------------------------------------------------------------*
Animate Start
Using MainDATA
stz left_boundary init boundaries
stz top_boundary
lda #170
sta right_boundary
lda #200
sta bottom_boundary
stz ShapeNum
lda #$E1
sta HiRes+2
event_loopL8 shortm
w1 lda RDVBLBAR
bmi w1
w2 lda RDVBLBAR
bpl w2
longm
jsr DrawEarth
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
ourPathname 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
*-----------------------------------------------------------------------------*
MainDATA Data
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'20'
image_bytewidth dc i'10'
image_wordwidth dc i'5'
image_height dc i'17'
Earth_Pal anop
dc h'0000 0B00 0F00 000F F00F F000 700F 6000 0000 1101 5505' dc h'77079909DD0DFF'
dc h'6606 7707 9909 DD0D FF0F'
End
*-----------------------------------------------------------------------------*
copy earthdata2.asm

View File

@ -0,0 +1,101 @@
#include "types.rez"
// Module name resource
resource rPString (0x1) {
"Bouncing Earth 1"
};
// --- 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 far away in the depths "
"of outer space."
};
// --- Version resource
resource rVersion (0x1) {
{ $1,$0,$1,final,$1 }, // Version 1.0.1f1
verUS, // US Version
"Twilight II Bouncing Earth 1 Module", // program's name
"By J. Maricondo. Art by M. Keller.\$0D"
"Copyright 1991 Jim Maricondo." // copyright notice
};
// --- About icon resource
resource rIcon ($0010DD01) {
$8000, // kind
$0014, // height
$001C, // width
$"FFF0000000000000000000000FFF"
$"FFF0FFFFFFFFFFFFFFFFFFFF0FFF"
$"FFF0F000000000000000000F0FFF"
$"FFF0F030000000000111000F0FFF"
$"FFF0F003000000008811800F0FFF"
$"FFF0F000300000008111100F0FFF"
$"FFF0F030030000F00111000F0FFF"
$"FFF0F00300300F000000000F0FFF"
$"FFF0F0003000F00F0000000F0FFF"
$"FFF0F000030F00F00000000F0FFF"
$"FFF0F00000F00F000000000F0FFF"
$"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,889 @@
*-----------------------------------------------------------------------------*
EarthDATA Data
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,Earth43'
dc i'Earth44,Earth45,Earth46'
Earth1 anop ;;;;aaaabbbbcccc
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000111777111100000'
dc h'00005771175711110000'
dc h'00055557177111111000'
dc h'00055771111111111000'
dc h'00557111111111111100'
dc h'00771111111111111100'
dc h'00117111111111111100'
dc h'00711111111111111100'
dc h'00571111111111111100'
dc h'00071111111111111000'
dc h'00011111111111111000'
dc h'00001111111111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth2 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000711177711100000'
dc h'00005577117571110000'
dc h'00055555717711111000'
dc h'00055577111111111000'
dc h'00555711111111111100'
dc h'00577111111111111100'
dc h'00711711111111111100'
dc h'00771111111111111100'
dc h'00557111111111111100'
dc h'00057111111111111000'
dc h'00071111111111111000'
dc h'00001111111111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth3 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000771117771100000'
dc h'00005557711757110000'
dc h'00055555571771111000'
dc h'00055557711111111000'
dc h'00555571111111111100'
dc h'00557711111111111100'
dc h'00571171111111111100'
dc h'00577111111111111100'
dc h'00555711111111111100'
dc h'00055711111111111000'
dc h'00057111111111111000'
dc h'00007111111111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth4 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000777111777100000'
dc h'00005555771175710000'
dc h'00055555557177111000'
dc h'00055555771111111000'
dc h'00555557111111111100'
dc h'00555771111111111100'
dc h'00557117111111111100'
dc h'00757711111111111100'
dc h'00755571111111111100'
dc h'00075571111111111000'
dc h'00075711111111111000'
dc h'00007711111111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth5 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000777711177700000'
dc h'00005555577117570000'
dc h'00055555555717711000'
dc h'00055555577111111000'
dc h'00555555711111111100'
dc h'00555577111111111100'
dc h'00555711711111111100'
dc h'00775771111111111100'
dc h'00175557111111111100'
dc h'00017557111111111000'
dc h'00017571111111111000'
dc h'00001771111111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth6 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000777771117700000'
dc h'00005555557711750000'
dc h'00055555555571771000'
dc h'00055555557711111000'
dc h'00555555571111111100'
dc h'00755557711111111100'
dc h'00755571171111111100'
dc h'00177577111111111100'
dc h'00117555711111111100'
dc h'00011755711111111000'
dc h'00011757111111111000'
dc h'00001177111111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth7 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000777777111700000'
dc h'00005555555771170000'
dc h'00055555555557177000'
dc h'00055555555771111000'
dc h'00755555557111111100'
dc h'00175555771111111100'
dc h'00175557117111111100'
dc h'00117757711111111100'
dc h'00111755571111111100'
dc h'00011175571111111000'
dc h'00011175711111111000'
dc h'00001117711111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth8 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000777777711100000'
dc h'00007555555577110000'
dc h'00055555555555717000'
dc h'00075555555577111000'
dc h'00175555555711111100'
dc h'00117555577111111100'
dc h'00117555711711111100'
dc h'00111775771111111100'
dc h'00111175557111111100'
dc h'00011117557111111000'
dc h'00011117571111111000'
dc h'00001111771111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth9 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000177777771100000'
dc h'00007755555557710000'
dc h'00075555555555571000'
dc h'00017555555557711000'
dc h'00117555555571111100'
dc h'00111755557711111100'
dc h'00111755571171111100'
dc h'00111177577111111100'
dc h'00111117555711111100'
dc h'00011111755711111000'
dc h'00011111757111111000'
dc h'00001111177111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth10 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000117777777100000'
dc h'00007775555555770000'
dc h'00057555555555557000'
dc h'00071755555555771000'
dc h'00111755555557111100'
dc h'00111175555771111100'
dc h'00711175557117111100'
dc h'00111117757711111100'
dc h'00111111755571111100'
dc h'00011111175571111000'
dc h'00011111175711111000'
dc h'00001111117711110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth11 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000111777777700000'
dc h'00007777555555570000'
dc h'00075755555555555000'
dc h'00017175555555577000'
dc h'00111175555555711100'
dc h'00111117555577111100'
dc h'00171117555711711100'
dc h'00111111775771111100'
dc h'00111111175557111100'
dc h'00011111117557111000'
dc h'00011111117571111000'
dc h'00001111111771110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth12 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000111177777700000'
dc h'00001777755555550000'
dc h'00017575555555555000'
dc h'00011717555555557000'
dc h'00111117555555571100'
dc h'00111111755557711100'
dc h'00117111755571171100'
dc h'00111111177577111100'
dc h'00111111117555711100'
dc h'00011111111755711000'
dc h'00011111111757111000'
dc h'00001111111177110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth13 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000111117777700000'
dc h'00007177775555550000'
dc h'00071757555555555000'
dc h'00071171755555555000'
dc h'00111111755555557100'
dc h'00111111175555771100'
dc h'00111711175557117100'
dc h'00111111117757711100'
dc h'00111111111755571100'
dc h'00011111111175571000'
dc h'00011111111175711000'
dc h'00001111111117710000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth14 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000111117777700000'
dc h'00007177775555550000'
dc h'00071757555555555000'
dc h'00071171755555555000'
dc h'00111111755555557100'
dc h'00111111175555771100'
dc h'00111711175557117100'
dc h'00111111117757711100'
dc h'00111111111755571100'
dc h'00011111111175571000'
dc h'00011111111175711000'
dc h'00001111111117710000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth15 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000111111777700000'
dc h'00007717777555550000'
dc h'00057175755555555000'
dc h'00077117175555555000'
dc h'00111111175555555700'
dc h'00111111117555577100'
dc h'00111171117555711700'
dc h'00111111111775771100'
dc h'00111111111175557100'
dc h'00011111111117557000'
dc h'00011111111117571000'
dc h'00001111111111770000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth16 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000111111177700000'
dc h'00007771777755550000'
dc h'00075717575555555000'
dc h'00017711717555555000'
dc h'00711111117555555500'
dc h'00111111111755557700'
dc h'00111117111755571100'
dc h'00111111111177577100'
dc h'00111111111117555700'
dc h'00011111111111755000'
dc h'00011111111111757000'
dc h'00001111111111170000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth17 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000111111117700000'
dc h'00005777177775550000'
dc h'00017571757555555000'
dc h'00011771171755555000'
dc h'00171111111755555500'
dc h'00711111111175555700'
dc h'00111111711175557100'
dc h'00111111111117757700'
dc h'00711111111111755500'
dc h'00011111111111175000'
dc h'00011111111111175000'
dc h'00001111111111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth18 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000711111111700000'
dc h'00007577717777550000'
dc h'00071757175755555000'
dc h'00011177117175555000'
dc h'00717111111175555500'
dc h'00171111111117555500'
dc h'00111111171117555700'
dc h'00111111111111775700'
dc h'00171111111111175500'
dc h'00071111111111117000'
dc h'00071111111111117000'
dc h'00001111111111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth19 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000171111111100000'
dc h'00007757771777750000'
dc h'00057175717575555000'
dc h'00071117711717555000'
dc h'00571711111117555500'
dc h'00717111111111755500'
dc h'00111111117111755500'
dc h'00711111111111177500'
dc h'00117111111111117500'
dc h'00077111111111111000'
dc h'00057111111111111000'
dc h'00001111111111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth20 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000117111111100000'
dc h'00007775777177770000'
dc h'00055717571757555000'
dc h'00057111771171755000'
dc h'00557171111111755500'
dc h'00771711111111175500'
dc h'00111111111711175500'
dc h'00771111111111117700'
dc h'00111711111111111700'
dc h'00077711111111111000'
dc h'00075711111111111000'
dc h'00007111111111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth21 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000111711111100000'
dc h'00005777577717770000'
dc h'00055571757175755000'
dc h'00055711177117175000'
dc h'00555717111111175500'
dc h'00577171111111117500'
dc h'00711111111171117500'
dc h'00177111111111111700'
dc h'00111171111111111100'
dc h'00077771111111111000'
dc h'00057571111111111000'
dc h'00001711111111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth22 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000711171111100000'
dc h'00007577757771770000'
dc h'00055557175717575000'
dc h'00055571117711717000'
dc h'00555571711111117500'
dc h'00557717111111111700'
dc h'00571111111117111700'
dc h'00717711111111111100'
dc h'00111117111111111100'
dc h'00017777111111111000'
dc h'00075757111111111000'
dc h'00007171111111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth23 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000171117111100000'
dc h'00005757775777170000'
dc h'00055555717571757000'
dc h'00055557111771171000'
dc h'00555557171111111700'
dc h'00755771711111111100'
dc h'00757111111111711100'
dc h'00171771111111111100'
dc h'00111111711111111100'
dc h'00011777711111111000'
dc h'00017575711111111000'
dc h'00001717111111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth24 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000717111711100000'
dc h'00005575777577710000'
dc h'00055555571757175000'
dc h'00055555711177117000'
dc h'00755555717111111100'
dc h'00175577171111111100'
dc h'00175711111111171100'
dc h'00117177111111111100'
dc h'00111111171111111100'
dc h'00011177771111111000'
dc h'00071757571111111000'
dc h'00001171711111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth25 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000771711171100000'
dc h'00005557577757770000'
dc h'00055555557175717000'
dc h'00055555571117711000'
dc h'00575555571711111100'
dc h'00717557717111111100'
dc h'00117571111111117100'
dc h'00711717711111111100'
dc h'00711111117111111100'
dc h'00011117777111111000'
dc h'00077175757111111000'
dc h'00001117171111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth26 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000577171117100000'
dc h'00005555757775770000'
dc h'00055555555717571000'
dc h'00055555557111771000'
dc h'00757555557171111100'
dc h'00171755771711111100'
dc h'00711757111111111700'
dc h'00571171771111111100'
dc h'00571111111711111100'
dc h'00071111777711111000'
dc h'00017717575711111000'
dc h'00007111717111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth27 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000557717111700000'
dc h'00005555575777570000'
dc h'00055555555571757000'
dc h'00055555555711177000'
dc h'00575755555717111100'
dc h'00717175577171111100'
dc h'00771175711111111100'
dc h'00557117177111111100'
dc h'00557111111171111100'
dc h'00057111177771111000'
dc h'00071771757571111000'
dc h'00007711171711110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth28 anop
dc h'00000000000000000000'
dc h'00000007111110000000'
dc h'00000555771711100000'
dc h'00005555557577750000'
dc h'00055555555557175000'
dc h'00055555555571117000'
dc h'00757575555571711100'
dc h'00171717557717111100'
dc h'00777117571111111100'
dc h'00555711717711111100'
dc h'00555711111117111100'
dc h'00055711117777111000'
dc h'00057177175757111000'
dc h'00001771117171110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth29 anop
dc h'00000000000000000000'
dc h'00000007711110000000'
dc h'00000555577171100000'
dc h'00005555555757770000'
dc h'00055555555555717000'
dc h'00055555555557111000'
dc h'00775757555557171100'
dc h'00117171755771711100'
dc h'00777711757111111100'
dc h'00555571171771111100'
dc h'00555571111111711100'
dc h'00055571111777711000'
dc h'00055717717575711000'
dc h'00007177111717110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth30 anop
dc h'00000000000000000000'
dc h'00000007771110000000'
dc h'00000555557717100000'
dc h'00005555555575770000'
dc h'00055555555555571000'
dc h'00055555555555711000'
dc h'00577575755555717100'
dc h'00711717175577171100'
dc h'00177771175711111100'
dc h'00755557117177111100'
dc h'00755557111111171100'
dc h'00075557111177771000'
dc h'00075571771757571000'
dc h'00005717711171710000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth31 anop
dc h'00000000000000000000'
dc h'00000007777110000000'
dc h'00000555555771700000'
dc h'00005555555557570000'
dc h'00055555555555557000'
dc h'00055555555555571000'
dc h'00757757575555571700'
dc h'00171171717557717100'
dc h'00117777117571111100'
dc h'00175555711717711100'
dc h'00175555711111117100'
dc h'00017555711117777000'
dc h'00017557177175757000'
dc h'00007571771117170000'
dc h'00000711111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth32 anop
dc h'00000000000000000000'
dc h'00000007777710000000'
dc h'00000755555577100000'
dc h'00005555555555750000'
dc h'00055555555555555000'
dc h'00075555555555557000'
dc h'00175775757555557100'
dc h'00117117171755771700'
dc h'00111777711757111100'
dc h'00117555571171771100'
dc h'00117555571111111700'
dc h'00011755571111777000'
dc h'00011755717717575000'
dc h'00001757177111710000'
dc h'00000171111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth33 anop
dc h'00000000000000000000'
dc h'00000007777770000000'
dc h'00000775555557700000'
dc h'00005555555555570000'
dc h'00075555555555555000'
dc h'00017555555555555000'
dc h'00117577575755555700'
dc h'00111711717175577100'
dc h'00111177771175711100'
dc h'00111755557117177100'
dc h'00111755557111111100'
dc h'00011175557111177000'
dc h'00011175571771757000'
dc h'00001175717711170000'
dc h'00000117111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth34 anop
dc h'00000000000000000000'
dc h'00000001777770000000'
dc h'00000777555555700000'
dc h'00005555555555550000'
dc h'00017555555555555000'
dc h'00011755555555555000'
dc h'00111757757575555500'
dc h'00111171171717557700'
dc h'00111117777117571100'
dc h'00111175555711717700'
dc h'00111175555711111100'
dc h'00011117555711117000'
dc h'00011117557177175000'
dc h'00001117571771110000'
dc h'00001117111111000000'
dc h'00000011111100000000'
dc h'00000000000000000000'
Earth35 anop
dc h'00000000000000000000'
dc h'00000001177770000000'
dc h'00000777755555500000'
dc h'00007555555555550000'
dc h'00011755555555555000'
dc h'00011175555555555000'
dc h'00111175775757555500'
dc h'00111117117171755700'
dc h'00111111777711757100'
dc h'00111117555571171700'
dc h'00111117555571111100'
dc h'00011111755571111000'
dc h'00011111755717717000'
dc h'00001111757177110000'
dc h'00000111171111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth36 anop
dc h'00000000000000000000'
dc h'00000001117770000000'
dc h'00000177775555500000'
dc h'00001755555555550000'
dc h'00011175555555555000'
dc h'00011117555555555000'
dc h'00111117577575755500'
dc h'00111111711717175500'
dc h'00111111177771175700'
dc h'00111111755557117100'
dc h'00111111755557111100'
dc h'00011111175557111000'
dc h'00011111175571771000'
dc h'00001111175717710000'
dc h'00000111117111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth37 anop
dc h'00000000000000000000'
dc h'00000001111770000000'
dc h'00000117777555500000'
dc h'00001175555555550000'
dc h'00011117555555555000'
dc h'00011111755555555000'
dc h'00111111757757575500'
dc h'00111111171171717500'
dc h'00111111117777117500'
dc h'00111111175555711700'
dc h'00111111175555711100'
dc h'00011111117555711000'
dc h'00011111117557177000'
dc h'00001111117571770000'
dc h'00000111111711100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth38 anop
dc h'00000000000000000000'
dc h'00000001111170000000'
dc h'00000111777755500000'
dc h'00001117555555550000'
dc h'00011111755555555000'
dc h'00011111175555555000'
dc h'00111111175775757500'
dc h'00111111117117171700'
dc h'00111111111777711700'
dc h'00111111117555571100'
dc h'00111111117555571100'
dc h'00011111111755571000'
dc h'00011111111755717000'
dc h'00001111111757170000'
dc h'00000111111171100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth39 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000111177775500000'
dc h'00001111755555550000'
dc h'00011111175555555000'
dc h'00011111117555555000'
dc h'00111111117577575700'
dc h'00111111111711717100'
dc h'00111111111177771100'
dc h'00111111111755557100'
dc h'00111111111755557100'
dc h'00011111111175557000'
dc h'00011111111175571000'
dc h'00001111111175710000'
dc h'00000111111117100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth40 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000111117777500000'
dc h'00007111175555550000'
dc h'00071111117555555000'
dc h'00011111111755555000'
dc h'00111111111757757500'
dc h'00111111111171171700'
dc h'00111111111117777100'
dc h'00111111111175555700'
dc h'00111111111175555700'
dc h'00011111111117555000'
dc h'00011111111117557000'
dc h'00001111111117570000'
dc h'00000111111111700000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth41 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000111111777700000'
dc h'00005711117555550000'
dc h'00077111111755555000'
dc h'00011111111175555000'
dc h'00111111111175775700'
dc h'00111111111117117100'
dc h'00111111111111777700'
dc h'00111111111117555500'
dc h'00111111111117555500'
dc h'00011111111111755000'
dc h'00011111111111755000'
dc h'00001111111111750000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth42 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000711111177700000'
dc h'00007571111755550000'
dc h'00017711111175555000'
dc h'00011111111117555000'
dc h'00111111111117577500'
dc h'00111111111111711700'
dc h'00111111111111177700'
dc h'00111111111111755500'
dc h'00111111111111755500'
dc h'00011111111111175000'
dc h'00011111111111175000'
dc h'00001111111111170000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth43 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000771111117700000'
dc h'00001757111175550000'
dc h'00071771111117555000'
dc h'00011111111111755000'
dc h'00111111111111757700'
dc h'00111111111111171100'
dc h'00111111111111117700'
dc h'00111111111111175500'
dc h'00111111111111175500'
dc h'00011111111111117000'
dc h'00011111111111117000'
dc h'00001111111111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth44 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000777111111700000'
dc h'00001175711117550000'
dc h'00057177111111755000'
dc h'00071111111111175000'
dc h'00111111111111175700'
dc h'00111111111111117100'
dc h'00111111111111111700'
dc h'00111111111111117500'
dc h'00111111111111117500'
dc h'00011111111111111000'
dc h'00011111111111111000'
dc h'00001111111111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth45 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000177711111100000'
dc h'00007117571111750000'
dc h'00055717711111175000'
dc h'00077111111111117000'
dc h'00711111111111117500'
dc h'00111111111111111700'
dc h'00711111111111111100'
dc h'00111111111111111700'
dc h'00111111111111111700'
dc h'00011111111111111000'
dc h'00011111111111111000'
dc h'00001111111111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
Earth46 anop
dc h'00000000000000000000'
dc h'00000001111110000000'
dc h'00000117771111100000'
dc h'00007711757111170000'
dc h'00055571771111117000'
dc h'00057711111111111000'
dc h'00571111111111111700'
dc h'00711111111111111100'
dc h'00171111111111111100'
dc h'00111111111111111100'
dc h'00711111111111111100'
dc h'00011111111111111000'
dc h'00011111111111111000'
dc h'00001111111111110000'
dc h'00000111111111100000'
dc h'00000001111110000000'
dc h'00000000000000000000'
End
*-----------------------------------------------------------------------------*

View File

@ -0,0 +1,303 @@
longa on
longi on
mcopy anim1.mac
mcopy 7:m16.util2
*-----------------------------------------------------------------------------*
! Illusions of Motion
! by Stephen P. Lepisto
! date: 1/22/90
! Assembler: Merlin-16+ v4.08+
*-----------------------------------------------------------------------------*
deref_ptr gequ 0
screen_ptr gequ deref_ptr+4
SLookUp gequ screen_ptr+4
image_ptr gequ SLookUp+4
MyID gequ image_ptr+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
NumEarths gequ 46
Strobe gequ $E0C000
ClearStrobe gequ $E0C010
VBLWait gequ $E0C019 bit 7 = 1 if not VBL
MAXIMAGES gequ 1 # of images that can be handled
*-----------------------------------------------------------------------------*
Main Start
Using MainDATA
phk
plb
jsr dostartup
bcs shutdown error in startup
jsr Animate
shutdown jsr doshutdown
_Quit quitparms
End
*-----------------------------------------------------------------------------*
Animate Start
Using MainDATA
stz left_boundary init boundaries
stz top_boundary
lda #170
sta right_boundary
lda #200
sta bottom_boundary
stz ShapeNum
lda #$E1
sta HiRes+2
event_loopL8 shortm
wait2 lda >VBLWait
bmi wait2
waitVBL lda >VBLWait !
bpl waitVBL !
longm
jsr DrawEarth
jsr move_images move all images
lda ShapeNum
inc a
cmp #NumEarths
bne keepIt
lda #0
keepIt sta ShapeNum
shortm
lda >Strobe if keypress, then quit
bpl event_loopL8
lda >ClearStrobe
longm
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
*-----------------------------------------------------------------------------*
DoStartUp Start
Using MainDATA
_TLStartUp
WordResult
_MMStartUp
pla
sta MasterID
ora #$100
sta MyID
_MTStartUp
LongResult get direct page space for QuickDraw
PushLong #$300
pei MyID
PushWord #$C015
PushLong #0
_NewHandle
PullLong deref_ptr
bcs xL25
lda [deref_ptr]
pha
PushWord #0 320 mode
PushWord #0 screen width
pei MyID
_QDStartUp
bcs xL25
ldx #32-2
pal lda Earth_Pal,x
sta $E19E00,x
dex
dex
bpl pal
LongResult
PushWord #1
_GetAddress
PullLong SLookUp
clc
xL25 rts
End
*-----------------------------------------------------------------------------*
doShutDown Start
Using MainDATA
_QDShutDown
pei MyID
_DisposeAll
pei MasterID
_MMShutDown
_MTShutDown
_TLShutDown
rts
End
*-----------------------------------------------------------------------------*
MainDATA Data
quitparms dc i4'0'
dc i'$0000' not restartable
MasterID ds 2
MyID ds 2
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'20'
image_bytewidth dc i'10'
image_wordwidth dc i'5'
image_height dc i'17'
Earth_Pal anop
dc h'0000 0B00 0F00 000F F00F F000 700F 6000 0000 1101 5505' dc h'77079909DD0DFF'
dc h'6606 7707 9909 DD0D FF0F'
End
*-----------------------------------------------------------------------------*
copy earthdata2.asm

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,277 @@
MACRO
&LAB JCS &BP
&LAB BCC *+5
BRL &BP
MEND
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
MACRO
&lab _GetMasterSCB
&lab ldx #$1704
jsl $E10000
MEND
MACRO
&lab pushlong &addr,&offset
&lab ANOP
LCLC &C
LCLC &REST
&C AMID &addr,1,1
AIF "&C"="#",.immediate
AIF "&C"="[",.zeropage
AIF C:&offset=0,.nooffset
AIF "&offset"="s",.stack
pushword &addr+2,&offset
pushword &addr,&offset
MEXIT
.nooffset
pushword &addr+2
pushword &addr
MEXIT
.immediate
&REST AMID &addr,2,L:&addr-1
dc I1'$F4',I2'(&REST)|-16'
dc I1'$F4',I2'&REST'
MEXIT
.stack
pushword &addr+2,s
pushword &addr+2,s
MEXIT
.zeropage
ldy #&offset+2
pushword &addr,y
ldy #&offset
pushword &addr,y
MEND
MACRO
&lab _GetHandleSize
&lab ldx #$1802
jsl $E10000
MEND
MACRO
&lab _NewHandle
&lab ldx #$0902
jsl $E10000
MEND
MACRO
&lab _SoundStartUp
&lab ldx #$0208
jsl $E10000
MEND
MACRO
&lab _SoundShutDown
&lab ldx #$0308
jsl $E10000
MEND
MACRO
&lab _FFStartSound
&lab ldx #$0E08
jsl $E10000
MEND
MACRO
&lab _FFStopSound
&lab ldx #$0F08
jsl $E10000
MEND
MACRO
&lab _LoadResource
&lab ldx #$0E1E
jsl $E10000
MEND
MACRO
&lab _SoundToolStatus
&lab ldx #$0608
jsl $E10000
MEND
MACRO
&lab _GetCurResourceApp
&lab ldx #$141E
jsl $E10000
MEND
MACRO
&lab _SetCurResourceApp
&lab ldx #$131E
jsl $E10000
MEND
MACRO
&lab GSStr &GSstring
&lab dc i2'L:&GSstring',C'&GSstring'
MEND
MACRO
&lab WordResult
&lab phd
MEND
MACRO
&lab _CloseResourceFile
&lab ldx #$0B1E
jsl $E10000
MEND
MACRO
&lab _DetachResource
&lab ldx #$181E
jsl $E10000
MEND
MACRO
&lab _GetCurResourceFile
&lab ldx #$121E
jsl $E10000
MEND
MACRO
&lab _OpenResourceFile
&lab ldx #$0A1E
jsl $E10000
MEND
MACRO
&lab _ResourceShutDown
&lab ldx #$031E
jsl $E10000
MEND
MACRO
&lab _ResourceStartUp
&lab ldx #$021E
jsl $E10000
MEND
MACRO
&lab _SetCurResourceFile
&lab ldx #$111E
jsl $E10000
MEND
MACRO
&lab _FFSoundStatus
&lab ldx #$1008
jsl $E10000
MEND
macro
&lab deref &locations,&handle
&lab lda [&handle]
lcla &count
&count seta 1
.loop
sta &locations(&count)
&count seta &count+1
aif &count<=C:&locations,^loop
ldy #2
lda [&handle],y
&count seta 1
.loop
sta &locations(&count)+2
&count seta &count+1
aif &count<=C:&locations,^loop
mend

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,38 @@
BulletDATA Data
bullet4 anop ;11112222333344445555 * 15 lines
dc h'00000000000000E00000'
dc h'000000E000000E0E0000'
dc h'000000E0E000E4EE0000'
dc h'00000EEE4EEE4EE00000'
dc h'0000E4E4444444E0E500'
dc h'04E44334411144E54000'
dc h'0004444110002440E000'
dc h'00000444100013E00000'
dc h'000000EE210014EE0000'
dc h'000004EE431133EE0000'
dc h'000000E44434EEEEE000'
dc h'0000000EE44EEEE0E000'
dc h'000000E0EE044E00E000'
dc h'00000000000400000000'
dc h'000000E0000000000000'
bulmsk4 anop
dc h'FFFFFFFFFFFFFF0FFFFF'
dc h'FFFFFF0FFFFFF0F0FFFF'
dc h'FFFFFF0F0FFF0000FFFF'
dc h'FFFFF0000000000FFFFF'
dc h'FFFF00000000000F00FF'
dc h'F0000000000000000FFF'
dc h'FFF000000000000F0FFF'
dc h'FFFFF0000000000FFFFF'
dc h'FFFFFF0000000000FFFF'
dc h'FFFFF00000000000FFFF'
dc h'FFFFFF00000000000FFF'
dc h'FFFFFFF00000000F0FFF'
dc h'FFFFFF0F00F000FF0FFF'
dc h'FFFFFFFFFFF0FFFFFFFF'
dc h'FFFFFF0FFFFFFFFFFFFF'
End

View File

@ -0,0 +1,12 @@
echo asml SKULLey.asm keep=SKULLey.d
asml SKULLey.asm keep=SKULLey.d
echo duplicate -d SKULLey.d SKULLey
duplicate -d SKULLey.d SKULLey
echo duplicate -r SKULLey.r SKULLey
duplicate -r SKULLey.r SKULLey
echo filetype SKULLey $BC
filetype SKULLey $BC
echo setfile SKULLey -at $4004
setfile SKULLey -at $4004
echo copy -c SKULLey /jim1/system/cdevs/Twilight/SKULLey
copy -c SKULLey /jim1/system/cdevs/Twilight/SKULLey

View File

@ -0,0 +1,744 @@
*-----------------------------------------------------------------------------*
! Twilight II SKULLey Module. !
! !
! By Jim Maricondo. !
! !
! Copyright (c) 1991 Jim Maricondo. All rights reserved. !
*-----------------------------------------------------------------------------*
mcopy skulley.mac
absaddr on
case off
*-----------------------------------------------------------------------------*
! TO TOGGLE:
!
! * SOUND
! * ACCELERATOR PRESENT
sculley gequ <0
SLookUp gequ sculley+4
MyID gequ SLookUp+4
HiRes gequ MyID+2
Width gequ HiRes+4
Depth gequ Width+2
y gequ Depth+2
bordercol gequ y+2
image_index gequ bordercol+1
inactive gequ image_index+2
stage gequ inactive+2
byte_offset gequ stage+2
bullet_offset gequ byte_offset+2
bul_off_temp gequ bullet_offset+2
shots gequ bul_off_temp+2
HandleLoc gequ shots+2
ztemp1 gequ shots+2
ToolsDP gequ HandleLoc+4
ShutItDown gequ ToolsDP+2
NoSound gequ shutItDown+2
TempHandle gequ NOSound+2
tempPtr gequ TempHandle+4
bas1 gequ tempPtr+4
bas2 gequ bas1+4
bas22 gequ bas2+4
ourPath gequ bas22+4
BWidth gequ 30
Height gequ 75
NumBullets gequ 4
CLOCKCTL gequ >$E0C034 border color / rtc register
RDVBLBAR gequ >$E0C019
MAXIMAGES gequ 1 # of images that can be handled
rSculley gequ $32F1
rPalette gequ $32F2
rSound gequ $32F3
*-----------------------------------------------------------------------------*
SKULLey Start
Using MainDATA
phb Store old data bank
phk
plb
bra beginIt
dc c' ][ Infinitum. '
beginIt anop
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
stz ShutItDown
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
lda ourPathname,s
sta ourPath
lda ourPathname+2,s
sta ourPath+2
WordResult
_GetCurResourceApp
PullWord OldResourceApp
WordResult
_GetCurResourceFile
PullWord OldResourceFile
pei MyID
_ResourceStartUp
* pei MyID
* _SetCurResourceApp
WordResult
PushWord #1 request read access
PushLong #0 open a new file
pei ourPath+2
pei ourPath
_OpenResourceFile
plx
stx ResFileID
jcs Error
LongResult
PushWord #rPalette
PushLong #$00000001
_LoadResource
plx
stx TempHandle
plx
stx TempHandle+2
jcs error
deref TempPtr,TempHandle
ldx #32-2 set skulley palette
pal txy
lda [TempPtr],y
sta $E19E00,x
dex
dex
bpl pal
LongResult
PushWord #rSound
PushLong #$00000001
_LoadResource
plx
stx TempHandle
plx
stx TempHandle+2
jcs error
deref SoundPtr,TempHandle
LongResult
pei TempHandle+2
pei TempHandle
_GetHandleSize
PullLong SoundSize
LongResult
PushWord #rSculley
PushLong #$00000001
_LoadResource
plx
stx TempHandle
plx
stx TempHandle+2
jcs error
deref Bas1,TempHandle
PushWord #rSculley
PushLong #$00000001
_DetachResource
LongResult
PushWord #rSculley
PushLong #$00000001
_LoadResource
plx
stx TempHandle
plx
stx TempHandle+2
jcs error
deref (Bas2,Sculley,Bas22),TempHandle
lda Bas22 ; Bas22 = Bas2+2220
clc
adc #2220
bcc noInc
inc Bas22+2
noInc sta Bas22
PushWord #rSculley
PushLong #$00000001
_DetachResource
WordResult
_SoundToolStatus
pla
bne Active if nonzero, tool is active
LongResult
PushLong #$100 1 page of direct page space
pei MyID
PushWord #$C005 locked/fixed/page aligned/specific bank
PushLong #0 specify bank 0
_NewHandle
plx
stx HandleLoc
plx
stx HandleLoc+2
bcs Error if error, exit module
lda [HandleLoc] dereference handle to get & and save
sta ToolsDP location of direct page
pei ToolsDP bnk $0 start addr of 1 page direct page
_SoundStartUp
lda #1
sta ShutItDown
Active anop
lda SoundSize+1
sta Pages
stz NoSound
WordResult
_FFSoundStatus
pla
and #%10000000
beq good gen 7 is inactive, so sound is enabled
lda #1
sta NoSound else sound is disabled
good anop
jsr Animate
bra noErr
Error anop
sta $E12000
noErr 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
PushWord #%10000000
_FFStopSound Make sure Generator 7 is off
lda ShutItDown if it was started in the first place,
beq nope leave it started up
_SoundShutDown
nope anop
PushWord ResFileID
_CloseResourceFile
_ResourceShutDown
PushWord OldResourceFile
_SetCurResourceFile
PushWord OldResourceApp
_SetCurResourceApp
pei MyID
_DisposeAll
clc
rtl
End
*-----------------------------------------------------------------------------*
Animate Start
Using MainDATA
WordResult
_GetMasterSCB
pla
bmi Shadowing_On
lda #$E1
sta HiRes+2
bra cont
Shadowing_On anop
lda #$01
sta HiRes+2
cont anop
stz shots
jsr Randomize ; set a new random seed
event_loopL8 anop
* shortm ; for ACCELERATOR ONLY !
*v1 lda RDVBLBAR
* bmi v1
*v2 lda RDVBLBAR
* bpl v2
* longm
jsr DrawSculley
lda shots
cmp #20
blt no_reset
stz shots
ldy #75*30
recopy lda [bas1],y
sta [bas2],y
dey
dey
bpl recopy
lda #0
ldy #BWidth
zero00 sta [Bas2],y
dey
dey
bpl zero00
no_reset anop
jsr move_images move all images
DefineStack
oldDirectPage word
rtsAddress word
oldBank byte
returnAddress block 3
MasterID word
MovePtr long
ourPathname 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
inc shots
jsr DrawBullet
rts
! Invert Y velocity to give the illusion of a bounce.
invert_yvel lda yvelocity
eor #$ffff
inc a
sta yvelocity
inc shots
jsr DrawBullet
rts
End
*-----------------------------------------------------------------------------*
PlaySound Start
using MainDATA
lda NoSound if nosound is true, then don't do any
beq good sound effects
rts
good anop
PushWord #%10000000
_FFStopSound Make sure Generator 7 is off
jsr Random
bmi right_speaker
PushWord #$1701 1=left spkr; 7=gen 7; 0=reserved; 1=FF
PushLong #PlayParms Pointer to the SoundParms
_FFStartSound Start playing sound (continuously)
rts
right_speaker anop
PushWord #$0701 0=right spkr; 7=gen7; 0=reserved; 1=FF
PushLong #PlayParms Pointer to the SoundParms
_FFStartSound Start playing sound (continuously)
rts
End
*-----------------------------------------------------------------------------*
* This should draw Sculley a lot faster.
* Just set "Sculley" to the address of the shape (32 bits) and this routine
* should draw it. ("Sculley" should be in the Direct Page.)
* Also: It should not cross banks! I don't think it did originally so it
* shouldn't be a problem.
* -- Derek Young
DrawSculley Start
Using MainDATA
longa on
longi on
lda yposition
asl a
tay
lda [SLookUp],y
clc
adc xposition
sta HiRes ; set up the index onto the screen now
lda image_height ; depth of shape
sta depth
lda Bas2
sta Sculley
clc ; Carry will stay clear
; ; throughout the loop.
yloop ldx image_wordwidth ; width (in words) of shape
ldy #0
xloop lda [Sculley],y
sta [HiRes],y
iny ; only one register to increment!
iny
dex
bne xloop
lda Sculley
adc image_bytewidth ; next line of Mr. Sculley
sta Sculley
lda HiRes ; next line on the screen
adc #160
sta HiRes
dec depth
bne yloop
rts
End
*-----------------------------------------------------------------------------*
DrawBullet Start
Using MainDATA
Using BulletDATA
longa on
longi on
jsr PlaySound
GetRandom anop
jsr Random
and #$0FFF <- to optimize!! think about it... :)
cmp #2100
bge GetRandom
sta bullet_offset
stz image_index init an index into the shape data
lda #15 depth of bullet
sta depth
lda bullet_offset
sta bul_off_temp
yloop anop
lda #5 width (in words) of shape
sta width
ldy bul_off_temp use Y as a horizontal offset
ldx image_index
xloop anop
lda [bas2],y
and |bulmsk4,x get byte of shape
ora |bullet4,x
sta [bas2],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
lda bul_off_temp move ptr one line down
clc
adc #30 30 bytes wide (skulley shape)
sta bul_off_temp NEU
dec depth see if done all lines
bne yloop
lda #0
tay
tax
zero0 txa
sta [Bas2],y
tya
clc
adc #bWidth
tay
cpy #bWidth*75 75 lines
bne zero0
lda #0
ldy #28
tax
zero1 txa
sta [Bas2],y
tya
clc
adc #bWidth
tay
cpy #(bWidth*75)+28 75 lines
bne zero1
lda #0
tay
zero2 sta [Bas2],y
sta [Bas22],y ; sta bastard4+2220,y
iny ; (zero bottom lines of Sculley's pic)
iny
cpy #bWidth
bne zero2
rts
End
*-----------------------------------------------------------------------------*
MainDATA Data
! We don't use the first 256 bytes of DOC RAM because they might already be in
! use by the Note Synthesizer. Also, we use the full 32768 bytes offered by
! the DOC RAM, since there are two generators and each requires a buffer, so we
! split it in half for an effective $7E00 bytes per generator. Also, by
! Setting the pointer to the next wave to the beginning of this wave, the wave
! repeats.
PlayParms anop
SoundPtr dc i4'SoundPtr'
Pages ds 2
dc i'200' Sound speed
dc i'$0100' Page 1 of doc ram
dc i'$7E00' Reserve 32k in doc ram
dc i4'0' Pointer to next wave; 0 for no repeat
dc i'$00FF' Volume: 255 (maximum)
SoundSize ds 4
ResFileID ds 2
OurNameStr GSStr '*:system:cdevs:twilight:SKULLey1.1'
OldResourceApp ds 2
OldResourceFile ds 2
! Motion boundaries (in pixels)
left_boundary dc i'0' motion boundaries in pixels
right_boundary dc i'bWidth+160'
top_boundary dc i'0'
bottom_boundary dc i'200'
! 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'height'
End
*-----------------------------------------------------------------------------*
* I thought you might want to have the random
* number generator I use. I haven't tested it
* against QuickDraw but there was a demo with Merlin
* that showed it and it was VERY fast and random
* looking. (I could send it if you want.)
* Use this for whatever you want.
*-------------------------------------------------
* RANDOM returns a random number in A
* RANDOMIZE seeds the generator from the clock
* SEED seeds the generator from AXY.
*
* Adapted by Derek Young from RANDOM, from the
* Merlin 16+ package.
*
* X and Y registers preserved, number returned in A
Random Start
phx
phy
clc
ldx INDEXI
ldy INDEXJ
lda ARRAY-2,X
adc ARRAY-2,Y
sta ARRAY-2,X
dex
dex
bne DYL7
ldx #17*2 ; Cycle index if at end of
DYL7 dey ; the array
dey
bne SETIXL7
ldy #17*2
SETIXL7 stx INDEXI
sty INDEXJ
ply
plx
rts
INDEXI dc a'17*2' ; The relative positions of
INDEXJ dc a'5*2' ; these indexes is crucial
ARRAY dc a'1,1,2,3,5,8,13,21,54,75,129,204'
dc a'323,527,850,1377,2227'
*=================================================
* Randomize sets the random number seed from the
* clock.
Randomize Entry
pha
pha
pha
pha
ldx #$D03 ; ReadTimeHex
jsl $E10000 ; (like this so we don't need macros)
pla
plx
ply
sta 1,S
ora #1 ; At least one must be odd
sta ARRAY
stx ARRAY+2
phx ; Push index regs on stack
phy
ldx #30
LUPV1 sta ARRAY+2,X
dex
dex
lda 1,S ; Was Y
sta ARRAY+2,X
dex
dex
lda 3,S ; Was X
sta ARRAY+2,X
lda 5,S ; Original A
dex
dex
bne LUPV1
lda #17*2
sta INDEXI ; Init proper indexes
lda #5*2 ; into array
sta INDEXJ
jsr Random ; Warm the generator up.
jsr Random
ply
plx
pla
rts
end
*-----------------------------------------------------------------------------*
copy bullets3.src

View File

@ -0,0 +1,667 @@
mcopy skulley.mac
mcopy 7/m16.smartmisc
absaddr on
case off
*-----------------------------------------------------------------------------*
sculley gequ <0
SLookUp gequ sculley+4
MyID gequ SLookUp+4
HiRes gequ MyID+2
Width gequ HiRes+4
Depth gequ Width+2
y gequ Depth+2
bordercol gequ y+2
image_index gequ bordercol+1
inactive gequ image_index+2
stage gequ inactive+2
byte_offset gequ stage+2
bullet_offset gequ byte_offset+2
bul_off_temp gequ bullet_offset+2
shots gequ bul_off_temp+2
HandleLoc gequ shots+2
ztemp1 gequ shots+2
ToolsDP gequ HandleLoc+4
ShutItDown gequ ToolsDP+2
NoSound gequ shutItDown+2
TempHandle gequ NOSound+2
tempPtr gequ TempHandle+4
bas1 gequ tempPtr+4
bas2 gequ bas1+4
bas22 gequ bas2+4
ourPath gequ bas22+4
BWidth gequ 30
Height gequ 75
NumBullets gequ 4
Border gequ $E0C034 border color / rtc register
Strobe gequ $E0C000
ClearStrobe gequ $E0C010
VBLWait gequ $E0C019 bit 7 = 1 if not VBL
MAXIMAGES gequ 1 # of images that can be handled
rSculley gequ $32F1
rPalette gequ $32F2
rSound gequ $32F3
*-----------------------------------------------------------------------------*
Main Start
Using MainDATA
phb Store old data bank
phk
plb
bra beginIt
dc c' ][ Infinitum. '
beginIt anop
shortm
lda >Border save old border color and make border
pha color now black
and #$0F
sta bordercol
pla
and #$F0
sta >Border
longm
lda #0
ldx #$8000-2
blank sta $E12000,x
dex
dex
bpl blank
stz ShutItDown
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
lda ourPathname,s
sta ourPath
lda ourPathname+2,s
sta ourPath+2
WordResult
_GetCurResourceApp
PullWord OldResourceApp
WordResult
_GetCurResourceFile
PullWord OldResourceFile
pei MyID
_ResourceStartUp
* pei MyID
* _SetCurResourceApp
WordResult
PushWord #1 request read access
PushLong #0 open a new file
pei ourPath+2
pei ourPath
_OpenResourceFile
plx
stx ResFileID
jcs Error
LongResult
PushWord #rPalette
PushLong #$00000001
_LoadResource
plx
stx TempHandle
plx
stx TempHandle+2
jcs error
deref TempPtr,TempHandle
ldx #32-2 set skulley palette
pal txy
lda [TempPtr],y
sta $E19E00,x
dex
dex
bpl pal
LongResult
PushWord #rSound
PushLong #$00000001
_LoadResource
plx
stx TempHandle
plx
stx TempHandle+2
jcs error
deref SoundPtr,TempHandle
LongResult
pei TempHandle+2
pei TempHandle
_GetHandleSize
PullLong SoundSize
LongResult
PushWord #rSculley
PushLong #$00000001
_LoadResource
plx
stx TempHandle
plx
stx TempHandle+2
jcs error
deref Bas1,TempHandle
PushWord #rSculley
PushLong #$00000001
_DetachResource
LongResult
PushWord #rSculley
PushLong #$00000001
_LoadResource
plx
stx TempHandle
plx
stx TempHandle+2
jcs error
deref (Bas2,Sculley,Bas22),TempHandle
lda Bas22 ; Bas22 = Bas2+2220
clc
adc #2220
bcc noInc
inc Bas22+2
noInc sta Bas22
PushWord #rSculley
PushLong #$00000001
_DetachResource
WordResult
_SoundToolStatus
pla
bne Active if nonzero, tool is active
LongResult
PushLong #$100 1 page of direct page space
pei MyID
PushWord #$C005 locked/fixed/page aligned/specific bank
PushLong #0 specify bank 0
_NewHandle
plx
stx HandleLoc
plx
stx HandleLoc+2
bcs Error if error, exit module
lda [HandleLoc] dereference handle to get & and save
sta ToolsDP location of direct page
pei ToolsDP bnk $0 start addr of 1 page direct page
_SoundStartUp
lda #1
sta ShutItDown
Active anop
lda SoundSize+1
sta Pages
stz NoSound
WordResult
_FFSoundStatus
pla
and #%10000000
beq good gen 7 is inactive, so sound is enabled
lda #1
sta NoSound else sound is disabled
good anop
jsr Animate
bra noErr
Error anop
sta $E12000
noErr plb
lda 2,s
sta 12,s
lda 1,s
sta 11,s
tsc Remove input paramaters
clc
adc #10 (MasterID+MovePtr+TextPtr)
tcs
shortm restore users border color
lda >Border
and #$F0
ora bordercol
sta >Border
longmx
PushWord #%10000000
_FFStopSound Make sure Generator 7 is off
lda ShutItDown if it was started in the first place,
beq nope leave it started up
_SoundShutDown
nope anop
PushWord ResFileID
_CloseResourceFile
_ResourceShutDown
PushWord OldResourceFile
_SetCurResourceFile
PushWord OldResourceApp
_SetCurResourceApp
pei MyID
_DisposeAll
clc
rtl
End
*-----------------------------------------------------------------------------*
Animate Start
Using MainDATA
WordResult
_GetMasterSCB
pla
bmi Shadowing_On
lda #$E1
sta HiRes+2
bra cont
Shadowing_On anop
lda #$01
sta HiRes+2
cont anop
stz shots
LongResult
LongResult
_ReadTimeHex
_SetRandSeed
pla neu
pla neu
! lda top_boundary
! sta yposition
! lda left_boundary
! sta xposition
event_loopL8 anop
* lda yposition
* clc
* adc #73
* lsr a
* clc
* adc #$80
* sta Bottom
* shortm
*wait2 lda >$E0C02E
* cmp Bottom
* bne wait2
* longm
jsr DrawSculley
lda shots
cmp #20
blt no_reset
stz shots
ldy #75*30
recopy lda [bas1],y
sta [bas2],y
dey
dey
bpl recopy
lda #0
ldy #BWidth
zero00 sta [Bas2],y
dey
dey
bpl zero00
no_reset anop
jsr move_images move all images
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
bottom ds 2
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
inc shots
jsr DrawBullet
rts
! Invert Y velocity to give the illusion of a bounce.
invert_yvel lda yvelocity
eor #$ffff
inc a
sta yvelocity
inc shots
jsr DrawBullet
rts
End
*-----------------------------------------------------------------------------*
PlaySound Start
using MainDATA
lda NoSound if nosound is true, then don't do any
beq good sound effects
rts
good anop
PushWord #%10000000
_FFStopSound Make sure Generator 7 is off
WordResult
_Random
pla
bmi right_speaker
PushWord #$1701 1=left spkr; 7=gen 7; 0=reserved; 1=FF
PushLong #PlayParms Pointer to the SoundParms
_FFStartSound Start playing sound (continuously)
rts
right_speaker anop
PushWord #$0701 0=right spkr; 7=gen7; 0=reserved; 1=FF
PushLong #PlayParms Pointer to the SoundParms
_FFStartSound Start playing sound (continuously)
rts
End
*-----------------------------------------------------------------------------*
* This should draw Sculley a lot faster.
* Just set "Sculley" to the address of the shape (32 bits) and this routine
* should draw it. ("Sculley" should be in the Direct Page.)
* Also: It should not cross banks! I don't think it did originally so it
* shouldn't be a problem.
* -- Derek Young
DrawSculley Start
Using MainDATA
longa on
longi on
lda yposition
asl a
tay
lda [SLookUp],y
clc
adc xposition
sta HiRes ; set up the index onto the screen now
lda image_height ; depth of shape
sta depth
lda Bas2
sta Sculley
clc ; Carry will stay clear
; ; throughout the loop.
yloop ldx image_wordwidth ; width (in words) of shape
ldy #0
xloop lda [Sculley],y
sta [HiRes],y
iny ; only one register to increment!
iny
dex
bne xloop
lda Sculley
adc image_bytewidth ; next line of Mr. Sculley
sta Sculley
lda HiRes ; next line on the screen
adc #160
sta HiRes
dec depth
bne yloop
rts
End
*-----------------------------------------------------------------------------*
DrawBullet Start
Using MainDATA
Using BulletDATA
longa on
longi on
jsr PlaySound
randomize anop
WordResult
_Random
pla
and #$0FFF <- to optimize!! think about it... :)
cmp #2100
bge randomize
sta bullet_offset
stz image_index init an index into the shape data
lda #15 depth of bullet
sta depth
lda bullet_offset
sta bul_off_temp
yloop anop
lda #5 width (in words) of shape
sta width
ldy bul_off_temp use Y as a horizontal offset
ldx image_index
xloop anop
lda [bas2],y
and |bulmsk4,x get byte of shape
ora |bullet4,x
sta [bas2],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
lda bul_off_temp move ptr one line down
clc
adc #30 30 bytes wide (skulley shape)
sta bul_off_temp NEU
dec depth see if done all lines
bne yloop
lda #0
tay
tax
zero0 txa
sta [Bas2],y
tya
clc
adc #bWidth
tay
cpy #bWidth*75 75 lines
bne zero0
lda #0
ldy #28
tax
zero1 txa
sta [Bas2],y
tya
clc
adc #bWidth
tay
cpy #(bWidth*75)+28 75 lines
bne zero1
lda #0
tay
zero2 sta [Bas2],y
sta [Bas22],y ; sta bastard4+2220,y
iny ; (zero bottom lines of Sculley's pic)
iny
cpy #bWidth
bne zero2
rts
End
*-----------------------------------------------------------------------------*
MainDATA Data
! We don't use the first 256 bytes of DOC RAM because they might already be in
! use by the Note Synthesizer. Also, we use the full 32768 bytes offered by
! the DOC RAM, since there are two generators and each requires a buffer, so we
! split it in half for an effective $7E00 bytes per generator. Also, by
! Setting the pointer to the next wave to the beginning of this wave, the wave
! repeats.
PlayParms anop
SoundPtr dc i4'SoundPtr'
Pages ds 2
dc i'200' Sound speed
dc i'$0100' Page 1 of doc ram
dc i'$7E00' Reserve 32k in doc ram
dc i4'0' Pointer to next wave; 0 for no repeat
dc i'$00FF' Volume: 255 (maximum)
SoundSize ds 4
ResFileID ds 2
OurNameStr GSStr '*:system:cdevs:twilight:SKULLey1.1'
OldResourceApp ds 2
OldResourceFile ds 2
! Motion boundaries (in pixels)
left_boundary dc i'0' motion boundaries in pixels
right_boundary dc i'bWidth+160'
top_boundary dc i'0'
bottom_boundary dc i'200'
! 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'height'
End
*-----------------------------------------------------------------------------*
copy bullets3.src

View File

@ -0,0 +1,329 @@
#include "types.rez"
#define rSculley $32F1
#define rPalette $32F2
#define rSound $32F3
resource rResName ($000132F1) {
1, /* Resource Template Version */
{
0x1, "Mr. Sculley (75*30)"
}
};
resource rResName ($000132F2) {
1, /* Resource Template Version */
{
0x1, "Sculley Palette"
}
};
resource rResName ($000132F3) {
1, /* Resource Template Version */
{
0x1, "Sculley Sound"
}
};
resource rResName ($00018006) {
1, /* Resource Template Version */
{
0x1, "Module Name"
}
};
read rSound (0x1, nocrossbank, nospecialmemory, protected, locked, fixed)
":Jim4:dya:twilight:skulley:bang.ouch";
resource rPString (0x1) {
"SKULLey"
};
data rPalette (0x1, nocrossbank, nospecialmemory) {
$"0000 1101 2202 3303 4404 5505 6609 760A 870A 880B 990B"
$"AA0C CC0C DD0D 6606 AA0C"
};
data rSculley (0x1, nocrossbank, nospecialmemory) {
$"000000000000000000000000"
$"000000000000000000000000"
$"000000000000000000000000"
$"000111233333333333321111"
$"000000000000000000000000"
$"000000000000011234444444"
$"344444333332111000000000"
$"000000000000000000000000"
$"123344444443334444343443"
$"332110000000000000000000"
$"000000000001234444444344"
$"444444333444444320100000"
$"000000000000000000000013"
$"444444444334434443433444"
$"444444321000000000000000"
$"000000000124444444344434"
$"343343333334334444433000"
$"000000000000000000001344"
$"444444443333434333334443"
$"333344444410000000000000"
$"000000014444444444433333"
$"344333445444443344444421"
$"000000000000000000134344"
$"444444434333333444555655"
$"544444444433100000000000"
$"000000234444354444444334"
$"444455565655555444444443"
$"100000000000000001344443"
$"344433334555565555666665"
$"555544444443310000000000"
$"000012344343454444455667"
$"566666666666554544444443"
$"331000000000000023443434"
$"454455657676677766766666"
$"555554444443432000000000"
$"000134444334444557677777"
$"777766776666665554444444"
$"442000000000000234444444"
$"455687888877877776776666"
$"666554444444443100000000"
$"000234444444567788888888"
$"877777766666666555444444"
$"443100000000000234344455"
$"678888888888877777766666"
$"665555444444433100000000"
$"000244456666788888888888"
$"877777766766665555444444"
$"433200000000001344467777"
$"888889888888887877776666"
$"665555444444433200000000"
$"002345667788888888888888"
$"877777776666665555444444"
$"443210000000002344567888"
$"888888888888887777766666"
$"666555444444433210000000"
$"002345567888888888888888"
$"888777776666665555444433"
$"343210000000002344567888"
$"888888888889878777766766"
$"665555444444444210000000"
$"001245667888888888988888"
$"888887766666665555444444"
$"344310000000000234567888"
$"888888988888888877776666"
$"665555443443444310000000"
$"000124567888898898888888"
$"888877766666655555544443"
$"444310000000000013457788"
$"888898888888878877666666"
$"655655444444444310000000"
$"000001347888888888888888"
$"887767766666665544444433"
$"344310000000000000138878"
$"888889889888888767767766"
$"665444544444333310000000"
$"000000026778888889889888"
$"888866776666665454454443"
$"433310000000000000025788"
$"888888888888887866566565"
$"545444554444444310000000"
$"000000014788888988877787"
$"887665455554454444454444"
$"444310000000000000014687"
$"786887676777776554455455"
$"555445444444434210000000"
$"000000014776556565445678"
$"776544444344565555444434"
$"444210000000000000014855"
$"567644445678775444584645"
$"565665544444444200000000"
$"000000014757786484457778"
$"8754445a7445666665544444"
$"444200000000000000014787"
$"757744567888876446576676"
$"666665544444443200000000"
$"000000014688677876677887"
$"776555567787766655544444"
$"443200000000000000014688"
$"8889a8777887876555567766"
$"777655544444433100000000"
$"000000013787988998777777"
$"876555566777777655554444"
$"432100000000000000013677"
$"988887777777876555666677"
$"776655554444431000000000"
$"000000003567788887778887"
$"786555566667766665554444"
$"421000000000000000002467"
$"788887788778787655555666"
$"666665554444421000000000"
$"000000002467888888777778"
$"777655555566666665544444"
$"421000000000000000001367"
$"888877666777876765554466"
$"666665444444421000000000"
$"000000000247788876657777"
$"987665544466666655454444"
$"420000000000000000000235"
$"777776677777976654444556"
$"666655554444420000000000"
$"000000000125677766687777"
$"666544445555666655544444"
$"420000000000000000000024"
$"677666677777666544555555"
$"566655544444420000000000"
$"000000000023566765877777"
$"776556656545667655554444"
$"430000000000000000000012"
$"466777777777877766645455"
$"677655554444432100000000"
$"000000000002456778656565"
$"656565654566676555544444"
$"543211000000000000000001"
$"256777666658b87979665666"
$"676556544444555432100000"
$"000000000000245677777665"
$"656565656666666556544345"
$"555544210000000000000000"
$"124567777666655555666566"
$"665555544444555554310000"
$"000000000000013457777776"
$"676666665566665555444445"
$"455554310000000000000000"
$"001356778877777666666556"
$"655554444444545444210000"
$"000000000000000245678877"
$"777666666655654554444444"
$"444443200000000000000000"
$"000134567787777666666665"
$"544544444444444442100000"
$"000000000000000013456787"
$"777766666665444544444444"
$"444421000000000000000000"
$"000001346777777776666655"
$"444444444444444310000000"
$"000000000000000000124677"
$"777777666655545444444444"
$"443100000000000000000000"
$"000000013467676777666655"
$"544444444444431000000000"
$"000000000000000000001345"
$"666666665555444444444444"
$"310000000000000000000000"
$"000000000134565666565544"
$"444444444442100000000000"
$"000000000000000000000123"
$"555555555555554444444421"
$"000000000000000000000000"
$"000000000123566656655655"
$"655555444210000000000000"
$"000000000000000000000023"
$"676666666666565655432100"
$"000000000000000000000000"
$"000000000023677676666666"
$"666654310000000000000000"
$"000000000000000000000013"
$"567766666666666542100000"
$"000000000000000000000000"
$"000000000002357766666666"
$"554421000000000000000000"
$"000000000000000000000000"
$"245555444444432200000000"
$"000000000000000000000000"
$"000000000000123333333332"
$"210000000000000000000000"
$"000000000000000000000000"
$"000000000000000000000000"
$"000000000000"
};
// --- Version resource
resource rVersion (0x1, $0000) {
{ $1,$1,$0,beta,$4 }, // Version 1.1.0b4
verUS, // US Version
"Twilight II SKULLey Module", // program's name
"By J. Maricondo. Thanks DY&MK!\$0D"
"Copyright 1991 Jim Maricondo." // copyright notice
};
// --- 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 allows some users to vent their frustrations at Apple's "
"support (or lack of) for the Apple II line by John Sculley, CEO."
};
// --- About icon resource
resource rIcon ($0010DD01) {
$8000, // kind
$0014, // height
$001C, // width
$"FFF0000000000000000000000FFF"
$"FFF0FFFFFFFFFFFFFFFFFFFF0FFF"
$"FFF0F000000000000000000F0FFF"
$"FFF0F000040AA44AA000040F0FFF"
$"FFF0F04000A020080A04000F0FFF"
$"FFF0F0040AA024A80AA0000F0FFF"
$"FFF0F0000AAAA44AAAA0400F0FFF"
$"FFF0F0040A02AA4A80A0000F0FFF"
$"FFF0F0440AA02AA80AA0000F0FFF"
$"FFF0F04000AA0000AA00400F0FFF"
$"FFF0F000000AAAAAA000000F0FFF"
$"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";
};
// End of resource //

View File

@ -0,0 +1,113 @@
#pragma keep "fr"
#pragma optimize 0
#pragma rtl
#pragma debug 0 /* was -1 */
#include <types.h>
#include <quickdraw.h>
#include <orca.h>
#include <misctool.h>
#define MAX_X 640
#define MAX_Y 200
#pragma lint -1
/* Prototypes */
int GetKey(int *, int);
void main(void);
/* Global Variables */
int modifier;
/* Routines */
void main(void)
{
unsigned int color;
unsigned int dh,dv,sh,sv,len,dir,k,old_dir,j;
unsigned int screenwidth = 642; /* 2, -1 */
unsigned int screenheight = 202;
Rect newr;
Long TargetTick; /* end of wait tick number */
startgraph(MAX_X);
SetPenMode(modeCopy);
SetSolidPenPat(-1);
SetRandSeed (GetTick());
ClearScreen(0xffff);
sh = 6;
sv = 3;
newr.h1 = (+Random()) % (screenwidth-2);
newr.v1 = (+Random()) % (screenheight-0); /* -2 */
newr.h2 = newr.h1 + sh;
newr.v2 = newr.v1 + sv;
old_dir = 0;
while (!GetKey(&modifier, FALSE)) {
Set640Color(Random() & 0xF);
for (j = 1; j <= 20; ++j) {
dir = Random() % 2;
switch (old_dir)
{
case 0:
if (dir == 0)
dir = 3;
else dir = 1;
break;
case 1:
if (dir == 1)
dir = 2;
break;
case 2:
if (dir == 0)
dir = 1;
else dir = 3;
break;
case 3:
if (dir == 1)
dir = 2;
break;
}
old_dir = dir;
switch (dir)
{
case 0:
len = (Random() % newr.v1) / sv;
dh = 0;
dv = -sv;
break;
case 1:
len = (Random() % (screenwidth - newr.h2)) / sh;
dh = sh;
dv = 0;
break;
case 2:
len = (Random() % (screenheight - newr.v2)) / sv;
dh = 0;
dv = sv;
break;
case 3:
len = (Random() % newr.h1) / sh;
dh = -sh;
dv = 0;
break;
}
for (k = 1; k <= len; ++k) {
OffsetRect(&newr,dh,dv);
/* newr.v1 -= 2;
newr.h1 -= 2;*/
PaintRect(&newr);
/* newr.v1 += 2;
newr.h1 += 2;*/
}
}
}
endgraph();
}

View File

@ -0,0 +1,145 @@
#pragma keep "frantic"
#pragma cdev frantic
#pragma optimize -1
/*#include "frantic.H"*/
#include <t2.h>
#include <quickdraw.h>
pascal longword GetTick(void) inline(0x2503,dispatcher);
#pragma lint -1
#pragma debug 0 /* was -1 */
/* Prototypes */
LongWord BlankT2Moire(void);
/* Global Variables */
Word *movePtr;
/*****************************************************************************\
|* *|
|* BlankT2Message- *|
|* This function performs the screen blanking activities. *|
|* *|
\*****************************************************************************/
LongWord BlankT2Message (void)
{
unsigned int color;
unsigned int dh,dv,sh,sv,len,dir,k,old_dir,j;
unsigned int screenwidth = 640;
unsigned int screenheight = 200;
Rect newr;
Long TargetTick; /* end of wait tick number */
SetRandSeed (GetTick ());
/*****************************************************/
/* Animate the screen until the movePtr becomes true */
/*****************************************************/
sh = 6;
sv = 3;
newr.h1 = (+Random()) % (screenwidth + 1);
newr.v1 = (+Random()) % (screenheight + 1);
newr.h2 = newr.h1 + sh;
newr.v2 = newr.v1 + sv;
old_dir = 0;
while (!(*movePtr)) {
Set640Color(Random() & 0xF);
for (j = 1; j <= 20; ++j) {
dir = Random() % 2;
switch (old_dir)
{
case 0:
if (dir == 0)
dir = 3;
else dir = 1;
break;
case 1:
if (dir == 1)
dir = 2;
break;
case 2:
if (dir == 0)
dir = 1;
else dir = 3;
break;
case 3:
if (dir == 1)
dir = 2;
break;
}
old_dir = dir;
switch (dir)
{
case 0:
len = (Random() % newr.v1) / sv;
dh = 0;
dv = -sv;
break;
case 1:
len = (Random() % (screenwidth - newr.h2)) / sh;
dh = sh;
dv = 0;
break;
case 2:
len = (Random() % (screenheight - newr.v2)) / sv;
dh = 0;
dv = sv;
break;
case 3:
len = (Random() % newr.h1) / sh;
dh = -sh;
dv = 0;
break;
}
for (k = 1; k <= len; ++k) {
OffsetRect(&newr,dh,dv);
PaintRect(&newr);
}
}
}
/**********************************************/
/* No error occurred, so return a NULL handle */
/**********************************************/
return (LongWord) NULL;
}
/*****************************************************************************\
|* *|
|* Messages- *|
|* This function checks the Twilight II message parameter and *|
|* dispatches control to the appropriate message handler. *|
|* *|
\*****************************************************************************/
LongWord frantic (LongWord data2, LongWord data1, Word message)
{
LongWord Result = 1L;
switch (message)
{
case BlankT2:
movePtr=(Word *) data1;
Result=BlankT2Message();
case MakeT2:
case SaveT2:
case LoadSetupT2:
case UnloadSetupT2:
case KillT2:
case HitT2:
break;
}
return Result;
}

View File

@ -0,0 +1,177 @@
/*****************************************************************************\
|* *|
|* Messages *|
|* *|
|* by: Josef W. Wankerl *|
|* *|
|* Version: 1.0 *|
|* 06/15/92 *|
|* *|
\*****************************************************************************/
#pragma keep "frantic"
#pragma cdev frantic
/*#pragma optimize -1*/
/*#include "frantic.H"*/
#include <t2.h>
#include <quickdraw.h>
pascal longword GetTick(void) inline(0x2503,dispatcher);
/*#pragma lint -1*/
#pragma debug 0 /* was -1 */
#define SCREENWIDTH 640
#define SCREENHEIGHT 200
/*****************************************************************************\
|* *|
|* BlankT2Message- *|
|* This function performs the screen blanking activities. *|
|* *|
\*****************************************************************************/
LongWord BlankT2Message (Word *movePtr)
{
unsigned int color;
unsigned int dh,dv,sh,sv,len,dir,k,old_dir,j;
Rect newr;
Long TargetTick; /* end of wait tick number */
/******************************************************************/
/* Set the correct pen size so vertical lines do not appear wimpy */
/******************************************************************/
/* SetPenSize (2, 1);*/
/************************************/
/* Seed the random number generator */
/************************************/
SetRandSeed (GetTick ());
/*****************************************************/
/* Animate the screen until the movePtr becomes true */
/*****************************************************/
sh = 6;
sv = 3;
newr.left = Randomize(SCREENWIDTH + 1);
newr.top = Randomize(SCREENHEIGHT + 1);
newr.right = (newr.left + sh);
newr.bottom = (newr.top + sv);
old_dir = 0;
while (!(*movePtr)) {
SetDithColor(Randomize(16));
for (j = 1; j <= 20; ++j) {
dir = Randomize(2);
switch (old_dir)
{
case 0:
if (dir == 0)
dir = 3;
else dir = 1;
break;
case 1:
if (dir == 1)
dir = 2;
break;
case 2:
if (dir == 0)
dir = 1;
else dir = 3;
break;
case 3:
if (dir == 1)
dir = 2;
break;
}
old_dir = dir;
switch (dir)
{
case 0:
len = (Randomize(newr.top) / sv);
dh = 0;
dv = -sv;
break;
case 1:
len = (Randomize(SCREENWIDTH-newr.right) / sh);
dh = sh;
dv = 0;
break;
case 2:
len = (Randomize(SCREENHEIGHT-newr.bottom) / sv);
dh = 0;
dv = sv;
break;
case 3:
len = (Randomize(newr.left) / sh);
dh = -sh;
dv = 0;
break;
}
for (k = 1; k <= len; ++k) {
OffsetRect(&newr,dh,dv);
PaintRect(&newr);
}
}
}
/**********************************************/
/* No error occurred, so return a NULL handle */
/**********************************************/
return (LongWord) NULL;
}
/*****************************************************************************\
|* *|
|* Messages- *|
|* This function checks the Twilight II message parameter and *|
|* dispatches control to the appropriate message handler. *|
|* *|
\*****************************************************************************/
LongWord frantic (LongWord data2, LongWord data1, Word message)
{
LongWord Result = 1L;
switch (message)
{
case MakeT2:
break;
case SaveT2:
break;
case BlankT2:
Result = BlankT2Message ((Word *) data1);
break;
case LoadSetupT2:
break;
case UnloadSetupT2:
break;
case KillT2:
break;
case HitT2:
break;
}
return Result;
}
Randomize (int range)
{
long rawResult;
/* Generate a random number using QuickDraw's Random() function. */
rawResult = Random ();
rawResult &= 0x7FFFL;
return ((rawResult * range) / 32768);
}

View File

@ -0,0 +1,22 @@
/*****************************************************************************\
|* *|
|* Messages *|
|* *|
|* by: Josef W. Wankerl *|
|* *|
|* Version: 1.0 *|
|* 06/10/92 *|
|* *|
\*****************************************************************************/
#include <control.h>
#include <intmath.h>
#include <locator.h>
#include <memory.h>
#include <misctool.h>
#include <orca.h>
#include <quickdraw.h>
#include <resources.h>
#include <window.h>
#include <t2.h>

View File

@ -0,0 +1,140 @@
{$DeskAcc -1 -1 'Frantic'}
{$LongGlobals+}
{ August 6, 1987 }
{ Frantic NDA written by: }
{ Floyd Zink, Jr. }
{ CIS 73147,2717 }
{ Genie F.ZINK }
{ This is public domain. You can do what ever you want with this. }
program FranticNDA;
uses QDIntf, GSIntf, MiscTools, ConsoleIO;
var
Open : boolean;
myWindPtr : WindowPtr;
procedure dofrantic; forward;
function DAOpen: WindowPtr;
var myWind: NewWindowParamBlk;
begin
if open then exit;
fillchar(myWind,sizeof(NewWindowParamBlk),0);
with myWind do
begin
param_length := sizeof(NewWindowParamBlk);
wFrame := $0020;
wPosition.top := 5; { Copied window idea from }
wPosition.left := 5; { Jason Harper's MeltDown NDA }
wPosition.bottom:= 6;
wPosition.right := 6;
wPlane := -1;
wStorage := nil;
end;
myWindPtr := NewWindow(myWind);
SetSysWindow(myWindPtr);
Open := true;
DAOpen := myWindPtr;
dofrantic;
end;
procedure DAClose;
begin
if Open then CloseWindow(myWindPtr);
Open := false;
end;
procedure DAAction(Code:Integer; Param:Longint);
begin
CloseNDAByWinPtr(myWindPtr);
end;
procedure DAInit(Code:Integer);
begin
if (Code = 0) and Open then DAClose;
Open := false;
end;
procedure dofrantic;
var
currPort : GrafPtr;
screenwidth,screenheight,color,dh,dv,
sh,sv,len,dir,k,old_dir,j : integer;
newr: Rect;
eventrec: EventRecord;
done:boolean;
begin
HideCursor;
if GetMasterSCB >= 128
then screenwidth := 640
else screenwidth := 320;
screenheight:=200;
currPort := GetPort;
SetPort(GetMenuMgrPort);
sh:=6; sv:=3;
done:=false;
newr.left:= Random mod (screenwidth+1);
newr.top := Random mod (screenheight+1);
newr.right:=newr.left+sh;
newr.bottom:=newr.top+sv;
old_dir:=0;
repeat
color:= random mod 16;
setdithcolor(color);
for j:=1 to 20 do
begin
dir:=random mod 2;
case old_dir of
0: if dir=0 then dir:=3 else dir:=1;
1: if dir=1 then dir:=2;
2: if dir=0 then dir:=1 else dir:=3;
3: if dir=1 then dir:=2;
end;
old_dir:=dir;
case dir of
0: begin
len:=(random mod newr.top) div sv;
dh:=0; dv:=-sv;
end;
1: begin
len:=(random mod (screenwidth-newr.right)) div sh;
dh:=sh; dv:=0;
end;
2: begin
len:=(random mod (screenheight-newr.bottom)) div sv;
dh:=0; dv:=sv;
end;
3: begin
len:=(random mod newr.left) div sh;
dh:=-sh; dv:=0;
end;
end;
for k:=1 to len do begin
offsetrect(newr,dh,dv);
paintrect(newr);
end;
if GetOSEvent(MDownMask+KeyDownMask,eventrec) then
begin
done:=true;
leave;
end;
end;
until Done;
SetPort(currPort);
DrawMenuBar;
Refresh(nil);
ShowCursor;
end;
begin
end.

View File

@ -0,0 +1,87 @@
#include "types.rez"
#include "T2Common.Rez"
// --- custom resource type defines
resource rT2ModuleFlags (moduleFlags) {
/* fWantFadeOut +
fWantFadeIn +
fWantForceGrafPortMode640 */
NIL
};
// --- Icon Definitions
resource rIcon (moduleIcon) {
$8000, // kind
$0014, // height
$001C, // width
$"FFF0000000000000000000000FFF"
$"FFF0FFFFFFFFFFFFFFFFFFFF0FFF"
$"FFF0F000000000000000000F0FFF"
$"FFF0F0FFFFFFFFFFFFFFFF0F0FFF"
$"FFF0F0FF0000000000FFFF0F0FFF"
$"FFF0F0F0FFFFFFFFFF0FFF0F0FFF"
$"FFF0F0F0F000F0F00F0FFF0F0FFF"
$"FFF0F0F0FFFFFFFFFF0FFF0F0FFF"
$"FFF0F0FF0000000000FFFF0F0FFF"
$"FFF0F0FFFFFFFFFFFFFFFF0F0FFF"
$"FFF0F0FFFFFFFFFFFFFFFF0F0FFF"
$"FFF0F000000000000000000F0FFF"
$"FFF0FFFFFFFFFFFFFFFFAFFF0FFF"
$"FFF0000000000000000000000FFF"
$"FFFF0FFFFFFFFFFFFFFFFFF0FFFF"
$"FFFF0FFFFFFFFFFFFFFFFFF0FFFF"
$"FFFF0FF4AFFFFFFFFFFFFFF0FFFF"
$"FFFF0CCCCCCCCCCCCCCCCCC0FFFF"
$"FFFF0FFFFFFFFFFFFFFFAFF0FFFF"
$"FFFF00000000000000000000FFFF",
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"0000FFFFFFFFFFFFFFFFFFFF0000"
$"0000FFFFFFFFFFFFFFFFFFFF0000"
$"0000FFFFFFFFFFFFFFFFFFFF0000"
$"0000FFFFFFFFFFFFFFFFFFFF0000"
$"0000FFFFFFFFFFFFFFFFFFFF0000"
$"0000FFFFFFFFFFFFFFFFFFFF0000";
};
// --- rPString Templates
resource rPString (moduleName) {
"Frantic"
};
// --- rTextForLETextBox2 Templates
resource rTextForLETextBox2 (moduleMessage) {
TBCenterJust
TBForeColor TBColor4
"\n"
"This module goes frantic."
};
// --- rVersion Templates
resource rVersion (moduleVersion) {
{1, 0, 0, beta, 1},
verUS,
"Twilight II Frantic Module",
"Copyright 1992 by Jim Maricondo"
};

Binary file not shown.

View File

@ -0,0 +1,75 @@
procedure dofrantic; forward;
procedure dofrantic;
var
currPort : GrafPtr;
screenwidth,screenheight,color,dh,dv,
sh,sv,len,dir,k,old_dir,j : integer;
newr: Rect;
eventrec: EventRecord;
done:boolean;
begin
HideCursor;
if GetMasterSCB >= 128
then screenwidth := 640
else screenwidth := 320;
screenheight:=200;
currPort := GetPort;
SetPort(GetMenuMgrPort);
sh:=6; sv:=3;
done:=false;
newr.left:= Random mod (screenwidth+1);
newr.top := Random mod (screenheight+1);
newr.right:=newr.left+sh;
newr.bottom:=newr.top+sv;
old_dir:=0;
repeat
color:= random mod 16;
setdithcolor(color);
for j:=1 to 20 do
begin
dir:=random mod 2;
case old_dir of
0: if dir=0 then dir:=3 else dir:=1;
1: if dir=1 then dir:=2;
2: if dir=0 then dir:=1 else dir:=3;
3: if dir=1 then dir:=2;
end;
old_dir:=dir;
case dir of
0: begin
len:=(random mod newr.top) div sv;
dh:=0; dv:=-sv;
end;
1: begin
len:=(random mod (screenwidth-newr.right)) div sh;
dh:=sh; dv:=0;
end;
2: begin
len:=(random mod (screenheight-newr.bottom)) div sv;
dh:=0; dv:=sv;
end;
3: begin
len:=(random mod newr.left) div sh;
dh:=-sh; dv:=0;
end;
end;
for k:=1 to len do begin
offsetrect(newr,dh,dv);
paintrect(newr);
end;
if GetOSEvent(MDownMask+KeyDownMask,eventrec) then
begin
done:=true;
leave;
end;
end;
until Done;
SetPort(currPort);
DrawMenuBar;
Refresh(nil);
ShowCursor;
end;

View File

@ -0,0 +1,4 @@
compile fr.cc
link fr psea keep=fr
fr

View File

@ -0,0 +1,101 @@
/*****************************************************************************\
|* *|
|* Messages *|
|* *|
|* by: Josef W. Wankerl *|
|* *|
|* Version: 1.0 *|
|* 06/15/92 *|
|* *|
\*****************************************************************************/
#pragma keep "frantic"
#pragma cdev frantic
/*#pragma optimize -1*/
#include "frantic.H"
#pragma lint -1
#pragma debug 0 /* was -1 */
/*****************************************************************************\
|* *|
|* BlankT2Message- *|
|* This function performs the screen blanking activities. *|
|* *|
\*****************************************************************************/
LongWord BlankT2Message (Word *movePtr)
{
int i; /* number of messages displayed on the screen */
Long TargetTick; /* end of wait tick number */
/******************************************************************/
/* Set the correct pen size so vertical lines do not appear wimpy */
/******************************************************************/
/* SetPenSize (2, 1);*/
/************************************/
/* Seed the random number generator */
/************************************/
SetRandSeed (GetTick ());
/*****************************************************/
/* Animate the screen until the movePtr becomes true */
/*****************************************************/
while (!(*movePtr))
{
/************************************************************/
/* Wait for five seconds, or until the movePtr becomes true */
/************************************************************/
TargetTick = GetTick () + (5 * 60);
while ((!(*movePtr)) && (GetTick () < TargetTick));
}
/**********************************************/
/* No error occurred, so return a NULL handle */
/**********************************************/
return (LongWord) NULL;
}
/*****************************************************************************\
|* *|
|* Messages- *|
|* This function checks the Twilight II message parameter and *|
|* dispatches control to the appropriate message handler. *|
|* *|
\*****************************************************************************/
LongWord frantic (LongWord data2, LongWord data1, Word message)
{
LongWord Result = 1L;
switch (message)
{
case MakeT2:
break;
case SaveT2:
break;
case BlankT2:
Result = BlankT2Message ((Word *) data1);
break;
case LoadSetupT2:
break;
case UnloadSetupT2:
break;
case KillT2:
break;
case HitT2:
break;
}
return Result;
}

View File

@ -0,0 +1,28 @@
/********************************************
; File: T2.h
;
; By: Josef W. Wankerl
;
; Copyright EGO Systems 1992
; All Rights Reserved
;
********************************************/
#ifndef __T2__
#define __T2__
/* Action message codes sent to modules. */
#define MakeT2 0
#define SaveT2 1
#define BlankT2 2
#define LoadSetupT2 3
#define UnloadSetupT2 4
#define KillT2 5
#define HitT2 6
/* Resources types. */
#define rT2ModuleFlags 0x1000
#define rT2ExtSetup1 0x1001
#define rT2ModuleWord 0x1002
#endif

View File

@ -0,0 +1,4 @@
compile Lines.cc keep=Lines
link Lines random keep=Lines
Lines

View File

@ -0,0 +1,166 @@
#pragma keep "Lines"
#include <Orca.h>
void Line(int,int,int,int,int);
void SmoothLine(int,int,int,int,int,int);
void Plot(int,int,int);
int GetKey(void);
extern int random(void);
extern void set_random_seed(void);
int main(void)
{
int x1,y1,x2,y2,i;
startgraph(320);
set_random_seed();
do {
x1=random() % 160;
x2=random() % 160;
y1=random() % 100;
y2=random() % 100;
Line(x1,y1,x2,y2,15);
SmoothLine(x1+160,y1,x2+160,y2,15,1);
SmoothLine(x1+160,y1+100,x2+160,y2+100,3,10);
} while(0x1B != GetKey());
endgraph();
}
void SmoothLine(x1,y1,x2,y2,Color, OtherColor)
{
int xDelta, yDelta, xStep=1, yStep=1, Cycle;
xDelta=x2-x1;
yDelta=y2-y1;
if(xDelta<0)
{
xDelta=-xDelta;
xStep=-1;
}
if(yDelta<0)
{
yDelta=-yDelta;
yStep=-1;
}
if(yDelta<xDelta)
{
Cycle=xDelta >>1;
while(x1 != x2)
{
Plot(x1, y1, Color);
Cycle+=yDelta;
if(Cycle>xDelta)
{
Plot(x1+xStep, y1, OtherColor);
Cycle-=xDelta;
y1+=yStep;
Plot(x1, y1, OtherColor);
}
x1+=xStep;
}
Plot(x1,y1,Color);
}
else
{
Cycle=yDelta >>1;
while(y1 != y2)
{
Plot(x1, y1, Color);
Cycle+=xDelta;
if(Cycle>yDelta)
{
Plot(x1, y1+yStep, OtherColor);
Cycle-=yDelta;
x1+=xStep;
Plot(x1, y1, OtherColor);
}
y1+=yStep;
}
Plot(x1,y1,Color);
}
}
void Line(x1,y1,x2,y2,Color)
{
int xDelta, yDelta, xStep=1, yStep=1, Cycle;
xDelta=x2-x1;
yDelta=y2-y1;
if(xDelta<0)
{
xDelta=-xDelta;
xStep=-1;
}
if(yDelta<0)
{
yDelta=-yDelta;
yStep=-1;
}
if(yDelta<xDelta)
{
Cycle=xDelta >>1;
while(x1 != x2)
{
Plot(x1, y1, Color);
Cycle+=yDelta;
if(Cycle>xDelta)
{
Cycle-=xDelta;
y1+=yStep;
}
x1+=xStep;
}
Plot(x1,y1,Color);
}
else
{
Cycle=yDelta >>1;
while(y1 != y2)
{
Plot(x1, y1, Color);
Cycle+=xDelta;
if(Cycle>yDelta)
{
Cycle-=yDelta;
x1+=xStep;
}
y1+=yStep;
}
Plot(x1,y1,Color);
}
}
void Plot(int x, int y, int color)
{
char *PP;
if(x<0 || y<0 || x>319 || y>199)
return;
PP=(char *) (0xE12000 + 160 * y + (x>>1));
if(x & 0x01)
*PP=(*PP & 0xF0) | color;
else
*PP=(*PP & 0x0F) | (color<<4);
}
int GetKey()
{
char ch, *cp;
cp = (char *) 0x00C000; /* wait for keypress */
while ((*cp & 0x80) == 0) ;
ch = (*cp) & 0x7F; /* save the key */
cp = (char *) 0x00C010; /* clear the strobe */
*cp = 0;
return ch;
}

View File

@ -0,0 +1,101 @@
#include "types.rez"
// --- Module name resouce
resource rPString (0x1) {
"Power Scroll"
};
// --- 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 scrolls text you create in the sleek looking DYA PowerFont "
"at speeds you choose."
};
// --- Version resource
resource rVersion (0x1) {
{ $1,$0,$1,beta,$1 }, // Version 1.0.1b1
verUS, // US Version
"Twilight II Meltdown Module", // program's name
"By J. Maricondo. Art by M. Keller.\$0D"
"Copyright 1991 Jim Maricondo." // copyright notice
};
// --- About icon resource
resource rIcon ($0010DD01) {
$8000, // kind
$0014, // height
$001C, // width
$"FFF0000000000000000000000FFF"
$"FFF0FFFFFFFFFFFFFFFFFFFF0FFF"
$"FFF0F000000000000000000F0FFF"
$"FFF0F00DDDDD00100100100F0FFF"
$"FFF0F0D0000010010010010F0FFF"
$"FFF0F0D0DDD010010010010F0FFF"
$"FFF0F0D0000010010010010F0FFF"
$"FFF0F0D0111010010010010F0FFF"
$"FFF0F0D010D010010010010F0FFF"
$"FFF0F0D010D010010010010F0FFF"
$"FFF0F0D110D110010010010F0FFF"
$"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,127 @@
MACRO
&lab str &string
&lab dc i1'L:&string',C'&string'
MEND
MACRO
&lab _MMStartUp
&lab ldx #$0202
jsl $E10000
MEND
MACRO
&lab _MMShutDown
&lab ldx #$0302
jsl $E10000
MEND
MACRO
&lab _DisposeAll
&lab ldx #$1102
jsl $E10000
MEND
MACRO
&lab _NewHandle
&lab ldx #$0902
jsl $E10000
MEND
MACRO
&lab _TLStartUp
&lab ldx #$0201
jsl $E10000
MEND
MACRO
&lab _TLShutDown
&lab ldx #$0301
jsl $E10000
MEND
MACRO
&lab pushlong &addr,&offset
&lab ANOP
LCLC &C
LCLC &REST
&C AMID &addr,1,1
AIF "&C"="#",.immediate
AIF "&C"="[",.zeropage
AIF C:&offset=0,.nooffset
AIF "&offset"="s",.stack
pushword &addr+2,&offset
pushword &addr,&offset
MEXIT
.nooffset
pushword &addr+2
pushword &addr
MEXIT
.immediate
&REST AMID &addr,2,L:&addr-1
dc I1'$F4',I2'(&REST)|-16'
dc I1'$F4',I2'&REST'
MEXIT
.stack
pushword &addr+2,s
pushword &addr+2,s
MEXIT
.zeropage
ldy #&offset+2
pushword &addr,y
ldy #&offset
pushword &addr,y
MEND
MACRO
&lab pushword &SYSOPR
&lab ANOP
AIF C:&SYSOPR=0,.b
LCLC &C
&C AMID "&SYSOPR",1,1
AIF ("&C"="#").AND.(S:LONGA),.immediate
lda &SYSOPR
pha
MEXIT
.b
pha
MEXIT
.immediate
LCLC &REST
LCLA &BL
&BL ASEARCH "&SYSOPR"," ",1
AIF &BL>0,.a
&BL SETA L:&SYSOPR+1
.a
&REST AMID "&SYSOPR",2,&BL-2
dc I1'$F4',I2'&REST'
MEND
MACRO
&lab longm
&lab ANOP
rep #%00100000
longa on
MEND
MACRO
&lab shortm
&lab ANOP
sep #%00100000
longa off
MEND
MACRO
&lab _Quit &params
&lab jsl $E100A8
dc i2"$29"
dc i4"&params"
MEND
MACRO
&lab WordResult
&lab phd
MEND
MACRO
&lab LongResult
&lab phd
phd
MEND
MACRO
&lab _SysFailMgr
&lab ldx #$1503
jsl $E10000
MEND
MACRO
&LAB JCS &BP
&LAB BCC *+5
BRL &BP
MEND

View File

@ -0,0 +1,14 @@
echo unset keeptype
unset keeptype
echo asml PMod2.asm keep=PMod2.d
asml PMod2.asm keep=PMod2.d
echo duplicate -d PMod2.d PMod2
duplicate -d PMod2.d PMod2
echo duplicate -r PMod2.r PMod2
duplicate -r PMod2.r PMod2
echo filetype PMod2 $BC
filetype PMod2 $BC
echo setfile PMod2 -at $4004
setfile PMod2 -at $4004
echo copy PMod2 /jim1/system/cdevs/Twilight/PowerScroll1.0
copy -c PMod2 /jim1/system/cdevs/Twilight/PowerScroll1.0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
#include "types.rez"
resource rPString (0x1) {
"PowerScroll 1.0"
};
resource rPString (0x2) {
"Text to scroll:"
};

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,192 @@
MACRO
&lab pushlong &addr,&offset
&lab ANOP
LCLC &C
LCLC &REST
&C AMID &addr,1,1
AIF "&C"="#",.immediate
AIF "&C"="[",.zeropage
AIF C:&offset=0,.nooffset
AIF "&offset"="s",.stack
pushword &addr+2,&offset
pushword &addr,&offset
MEXIT
.nooffset
pushword &addr+2
pushword &addr
MEXIT
.immediate
&REST AMID &addr,2,L:&addr-1
dc I1'$F4',I2'(&REST)|-16'
dc I1'$F4',I2'&REST'
MEXIT
.stack
pushword &addr+2,s
pushword &addr+2,s
MEXIT
.zeropage
ldy #&offset+2
pushword &addr,y
ldy #&offset
pushword &addr,y
MEND
MACRO
&lab pushword &SYSOPR
&lab ANOP
AIF C:&SYSOPR=0,.b
LCLC &C
&C AMID "&SYSOPR",1,1
AIF ("&C"="#").AND.(S:LONGA),.immediate
lda &SYSOPR
pha
MEXIT
.b
pha
MEXIT
.immediate
LCLC &REST
LCLA &BL
&BL ASEARCH "&SYSOPR"," ",1
AIF &BL>0,.a
&BL SETA L:&SYSOPR+1
.a
&REST AMID "&SYSOPR",2,&BL-2
dc I1'$F4',I2'&REST'
MEND
MACRO
&lab longmx
&lab ANOP
rep #%00110000
longa on
longi on
MEND
MACRO
&lab longm
&lab ANOP
rep #%00100000
longa on
MEND
MACRO
&lab shortmx
&lab ANOP
sep #%00110000
longa off
longi off
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
MACRO
&LAB JCS &BP
&LAB BCC *+5
BRL &BP
MEND
MACRO
&lab wordresult
&lab phd
MEND
MACRO
&lab longresult
&lab phd
phd
MEND
MACRO
&lab _NewHandle
&lab ldx #$0902
jsl $E10000
MEND
MACRO
&lab _DisposeAll
&lab ldx #$1102
jsl $E10000
MEND
MACRO
&lab _UnPackBytes
&lab ldx #$2703
jsl $E10000
MEND
MACRO
&lab _CloseGS &params
&lab jsl $E100A8
dc i2"$2014"
dc i4"&params"
MEND
MACRO
&lab _OpenGS &params
&lab jsl $E100A8
dc i2"$2010"
dc i4"&params"
MEND
MACRO
&lab _ReadGS &params
&lab jsl $E100A8
dc i2"$2012"
dc i4"&params"
MEND
MACRO
&lab _Int2Hex
&lab ldx #$220B
jsl $E10000
MEND
MACRO
&lab _WriteCString
&lab ldx #$200C
jsl $E10000
MEND
MACRO
&lab _DisposeHandle
&lab ldx #$1002
jsl $E10000
MEND
MACRO
&lab _GetDirEntryGS &params
&lab jsl $E100A8
dc i2"$201C"
dc i4"&params"
MEND
MACRO
&LAB JCC &BP
&LAB BCS *+5
BRL &BP
MEND
MACRO
&LAB JNE &BP
&LAB BEQ *+5
BRL &BP
MEND
MACRO
&lab _Multiply
&lab ldx #$090B
jsl $E10000
MEND

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,193 @@
MACRO
&LAB _OPEN &DCB
&LAB JSL $E100A8
DC I2'$10'
DC I4'&DCB'
MEND
MACRO
&lab _HideCursor
&lab ldx #$9004
jsl $E10000
MEND
MACRO
&LAB JCS &BP
&LAB BCC *+5
BRL &BP
MEND
MACRO
&lab pushlong &addr,&offset
&lab ANOP
LCLC &C
LCLC &REST
&C AMID &addr,1,1
AIF "&C"="#",.immediate
AIF "&C"="[",.zeropage
AIF C:&offset=0,.nooffset
AIF "&offset"="s",.stack
pushword &addr+2,&offset
pushword &addr,&offset
MEXIT
.nooffset
pushword &addr+2
pushword &addr
MEXIT
.immediate
&REST AMID &addr,2,L:&addr-1
dc I1'$F4',I2'(&REST)|-16'
dc I1'$F4',I2'&REST'
MEXIT
.stack
pushword &addr+2,s
pushword &addr+2,s
MEXIT
.zeropage
ldy #&offset+2
pushword &addr,y
ldy #&offset
pushword &addr,y
MEND
MACRO
&lab pushword &SYSOPR
&lab ANOP
AIF C:&SYSOPR=0,.b
LCLC &C
&C AMID "&SYSOPR",1,1
AIF ("&C"="#").AND.(S:LONGA),.immediate
lda &SYSOPR
pha
MEXIT
.b
pha
MEXIT
.immediate
LCLC &REST
LCLA &BL
&BL ASEARCH "&SYSOPR"," ",1
AIF &BL>0,.a
&BL SETA L:&SYSOPR+1
.a
&REST AMID "&SYSOPR",2,&BL-2
dc I1'$F4',I2'&REST'
MEND
MACRO
&lab longm
&lab ANOP
rep #%00100000
longa on
MEND
MACRO
&lab shortm
&lab ANOP
sep #%00100000
longa off
MEND
MACRO
&lab wordresult
&lab phd
MEND
MACRO
&lab longresult
&lab phd
phd
MEND
MACRO
&lab _NewHandle
&lab ldx #$0902
jsl $E10000
MEND
MACRO
&lab _DisposeAll
&lab ldx #$1102
jsl $E10000
MEND
MACRO
&lab _UnPackBytes
&lab ldx #$2703
jsl $E10000
MEND
MACRO
&lab _CloseGS &params
&lab jsl $E100A8
dc i2"$2014"
dc i4"&params"
MEND
MACRO
&lab _OpenGS &params
&lab jsl $E100A8
dc i2"$2010"
dc i4"&params"
MEND
MACRO
&lab _ReadGS &params
&lab jsl $E100A8
dc i2"$2012"
dc i4"&params"
MEND
MACRO
&lab GSStr &GSstring
&lab dc i2'L:&GSstring',C'&GSstring'
MEND
MACRO
&lab _Int2Hex
&lab ldx #$220B
jsl $E10000
MEND
MACRO
&lab _WriteCString
&lab ldx #$200C
jsl $E10000
MEND
MACRO
&lab _DisposeHandle
&lab ldx #$1002
jsl $E10000
MEND
MACRO
&lab _GetDirEntryGS &params
&lab jsl $E100A8
dc i2"$201C"
dc i4"&params"
MEND
MACRO
&LAB JCC &BP
&LAB BCS *+5
BRL &BP
MEND
MACRO
&LAB JNE &BP
&LAB BEQ *+5
BRL &BP
MEND
MACRO
&lab _Multiply
&lab ldx #$090B
jsl $E10000
MEND
MACRO
DefineStack
GBLA &DummyPC
&DummyPC SETA 1
MEND
MACRO
&lab BYTE
&lab equ &DummyPC
&DummyPC SETA &DummyPC+1
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
MACRO
&lab _InitCursor
&lab ldx #$CA04
jsl $E10000
MEND

View File

@ -0,0 +1,186 @@
MACRO
&lab _HideCursor
&lab ldx #$9004
jsl $E10000
MEND
MACRO
&LAB JCS &BP
&LAB BCC *+5
BRL &BP
MEND
MACRO
&lab pushlong &addr,&offset
&lab ANOP
LCLC &C
LCLC &REST
&C AMID &addr,1,1
AIF "&C"="#",.immediate
AIF "&C"="[",.zeropage
AIF C:&offset=0,.nooffset
AIF "&offset"="s",.stack
pushword &addr+2,&offset
pushword &addr,&offset
MEXIT
.nooffset
pushword &addr+2
pushword &addr
MEXIT
.immediate
&REST AMID &addr,2,L:&addr-1
dc I1'$F4',I2'(&REST)|-16'
dc I1'$F4',I2'&REST'
MEXIT
.stack
pushword &addr+2,s
pushword &addr+2,s
MEXIT
.zeropage
ldy #&offset+2
pushword &addr,y
ldy #&offset
pushword &addr,y
MEND
MACRO
&lab pushword &SYSOPR
&lab ANOP
AIF C:&SYSOPR=0,.b
LCLC &C
&C AMID "&SYSOPR",1,1
AIF ("&C"="#").AND.(S:LONGA),.immediate
lda &SYSOPR
pha
MEXIT
.b
pha
MEXIT
.immediate
LCLC &REST
LCLA &BL
&BL ASEARCH "&SYSOPR"," ",1
AIF &BL>0,.a
&BL SETA L:&SYSOPR+1
.a
&REST AMID "&SYSOPR",2,&BL-2
dc I1'$F4',I2'&REST'
MEND
MACRO
&lab longm
&lab ANOP
rep #%00100000
longa on
MEND
MACRO
&lab shortm
&lab ANOP
sep #%00100000
longa off
MEND
MACRO
&lab wordresult
&lab phd
MEND
MACRO
&lab longresult
&lab phd
phd
MEND
MACRO
&lab _NewHandle
&lab ldx #$0902
jsl $E10000
MEND
MACRO
&lab _DisposeAll
&lab ldx #$1102
jsl $E10000
MEND
MACRO
&lab _UnPackBytes
&lab ldx #$2703
jsl $E10000
MEND
MACRO
&lab _CloseGS &params
&lab jsl $E100A8
dc i2"$2014"
dc i4"&params"
MEND
MACRO
&lab _OpenGS &params
&lab jsl $E100A8
dc i2"$2010"
dc i4"&params"
MEND
MACRO
&lab _ReadGS &params
&lab jsl $E100A8
dc i2"$2012"
dc i4"&params"
MEND
MACRO
&lab GSStr &GSstring
&lab dc i2'L:&GSstring',C'&GSstring'
MEND
MACRO
&lab _Int2Hex
&lab ldx #$220B
jsl $E10000
MEND
MACRO
&lab _WriteCString
&lab ldx #$200C
jsl $E10000
MEND
MACRO
&lab _DisposeHandle
&lab ldx #$1002
jsl $E10000
MEND
MACRO
&lab _GetDirEntryGS &params
&lab jsl $E100A8
dc i2"$201C"
dc i4"&params"
MEND
MACRO
&LAB JCC &BP
&LAB BCS *+5
BRL &BP
MEND
MACRO
&LAB JNE &BP
&LAB BEQ *+5
BRL &BP
MEND
MACRO
&lab _Multiply
&lab ldx #$090B
jsl $E10000
MEND
MACRO
DefineStack
GBLA &DummyPC
&DummyPC SETA 1
MEND
MACRO
&lab BYTE
&lab equ &DummyPC
&DummyPC SETA &DummyPC+1
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
MACRO
&lab _InitCursor
&lab ldx #$CA04
jsl $E10000
MEND

View File

@ -0,0 +1,12 @@
#include "types.rez"
resource rPString (0x1) {
$"A5"
"Slide Show"
$"A5"
};
resource rPString (0x2) {
"Directory:"
};

View File

@ -0,0 +1,11 @@
#include "types.rez"
resource rPString (0x1) {
"Slide Show"
};
resource rPString (0x2) {
"Directory:"
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff