Add files via upload

This commit is contained in:
Antoine Vignau 2020-06-08 22:53:12 +02:00 committed by GitHub
parent 2816592d97
commit 02608681c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 4497 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 Apple.asm keep=Apple.d
asml Apple.asm keep=Apple.d
echo duplicate -d Apple.d Apple
duplicate -d Apple.d Apple
echo duplicate -r Apple.r Apple
duplicate -r Apple.r Apple
echo filetype Apple $BC
filetype Apple $BC
echo setfile Apple -at $4004
setfile Apple -at $4004
echo copy -c Apple /jim1/system/cdevs/Twilight/Bouncing.Apple
copy -c Apple /jim1/system/cdevs/Twilight/Bouncing.Apple

View File

@ -0,0 +1,344 @@
longa on
longi on
mcopy apple.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
y gequ Depth+2
bordercol gequ y+2
image_index gequ bordercol+1
temp gequ image_index+2
BWidth gequ 20 width in bytes of the shape
BORDER gequ >$E0C034 border color/real time clock register
VERTCNT gequ >$E0C02E
SHR gequ >$E12000
SCBs gequ >$E19D00
PALETTES gequ >$E19E00
VBLWait gequ >$E0C019 bit 7 = 1 if not VBL
*-----------------------------------------------------------------------------*
Main Start
Using MainDATA
phb Store old data bank
phk
plb
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 SHR,x
dex
dex
bpl blank
ldx #32-2
pal lda |Apple_Pal,x
sta PALETTES,x
dex
dex
bpl pal
LongResult
PushWord #1
_GetAddress
PullLong SLookUp
! DefineStack
!oldBank byte
!returnAddress block 3
!MasterID word
!MovePtr long
!TextPtr long
!
! lda MasterID,s
! ora #$0A00
! sta MyID
jsr Animate
! pei MyID
! _DisposeAll
shortm restore users border color
lda BORDER
and #$F0
ora bordercol
sta BORDER
longmx
plb
lda 2,s
sta 12,s
lda 1,s
sta 11,s
tsc Remove input paramaters
clc
adc #10 (MasterID+MovePtr+TextPtr)
tcs
clc
rtl
End
*-----------------------------------------------------------------------------*
Animate Start
Using MainDATA
lda #$E1
sta HiRes+2
lda top_boundary
sta yposition
lda left_boundary
sta xposition
event_loopL8 anop
lda yposition
inc a
inc a
lsr a
clc
adc #$80
sta temp
shortm
wait00 lda VERTCNT
cmp temp
bne wait00
longm
* shortm
*wait2 lda VBLWait
* bmi wait2
*waitVBL lda VBLWait
* bpl waitVBL
* longm
jsr DrawApple
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
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
*-----------------------------------------------------------------------------*
DrawApple Start
Using MainDATA
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 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
lda |Apple,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
* Motion boundaries (in pixels)
left_boundary dc i'0' motion boundaries in pixels
right_boundary dc i'bWidth+160'
top_boundary dc i'02' ;11;15
bottom_boundary dc i'198'
* 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'37'
taboffset ds 2
apple_pal anop
dc h'0000 000a b000 0c00 000d e000'
dc h'0f00 2a05 500d 2c07 700f 0f0b'
dc h'd00d f00f dd0d ff0f'
apple anop ;1111222233334444555566667777888899990000
dc h'0000000000000000000000000000000000000000' 1
dc h'0000000000000000000000022250000000000000' 2
dc h'0000000000000000000002225550000000000000' 3
dc h'0000000000000000000022255550000000000000' 4
dc h'0000000000000000000225555550000000000000' 5
dc h'0000000000000000000225555500000000000000' 6
dc h'0000000000000000002255555000000000000000' 7
dc h'0000000000000000002255500000000000000000' 8
dc h'0000000000000000000255000000000000000000' 9
dc h'0000000002222222000000000055555550000000' 0
dc h'0000000222222222222222255555555555500000' 1
dc h'0000002222222222255555555555555555550000' 2
dc h'0000022222222225555555555555555555555000' 3
dc h'0000222222222255555555555555555555555000' 4
dc h'0000cccccccccdddddddddddddddddddddddd000' 5
dc h'000cccccccccddddddddddddddddddddddddd000' 6
dc h'000cccccccccddddddddddddddddddddddd00000' 7
dc h'000ccccccccdddddddddddddddddddddd0000000' 8
dc h'00cccccccccddddddddddddddddddddd00000000' 9
dc h'0088888888aaaaaaaaaaaaaaaaaaaaa000000000' 0
dc h'0088888888aaaaaaaaaaaaaaaaaaaaa000000000' 1 2
dc h'0088888888aaaaaaaaaaaaaaaaaaaaa000000000' 3
dc h'0088888888aaaaaaaaaaaaaaaaaaaaa000000000' 4
dc h'0001111111444444444444444444444000000000' 5
dc h'0001111111444444444444444444444400000000' 6
dc h'0001111111444444444444444444444440000000' 7
dc h'0000111111144444444444444444444444400000' 8
dc h'0000111111114444444444444444444444444000' 9
dc h'0000077777779999999999999999999999999000' 0
dc h'0000007777777799999999999999999999990000' 1
dc h'0000000777777779999999999999999999900000' 2
dc h'0000000077777777799999999999999999000000' 3
dc h'0000000003333333366666666666666660000000' 4
dc h'0000000000333333333366666666666000000000' 5
dc h'0000000000003333333333336666600000000000' 6
dc h'0000000000000033333333333336000000000000' 7
dc h'0000000000000000000000000000000000000000' 8
MyPortLoc anop
SCB dc i'$0080' portSCB
Pix dc i4'$E12000' ptrToPixImage
dc i'$00A0' width in bytes of each line in image
bounds dc i'0,0' boundary rectangle
mode dc i'200,640' was reverse!
MyPort ds $AA
orgPort ds 4
End
*-----------------------------------------------------------------------------*

View File

@ -0,0 +1,344 @@
longa on
longi on
mcopy apple.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
y gequ Depth+2
bordercol gequ y+2
image_index gequ bordercol+1
temp gequ image_index+2
BWidth gequ 20 width in bytes of the shape
BORDER gequ >$E0C034 border color/real time clock register
VERTCNT gequ >$E0C02E
SHR gequ >$E12000
SCBs gequ >$E19D00
PALETTES gequ >$E19E00
VBLWait gequ >$E0C019 bit 7 = 1 if not VBL
*-----------------------------------------------------------------------------*
Main Start
Using MainDATA
phb Store old data bank
phk
plb
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 SHR,x
dex
dex
bpl blank
ldx #32-2
pal lda |Apple_Pal,x
sta PALETTES,x
dex
dex
bpl pal
LongResult
PushWord #1
_GetAddress
PullLong SLookUp
! DefineStack
!oldBank byte
!returnAddress block 3
!MasterID word
!MovePtr long
!TextPtr long
!
! lda MasterID,s
! ora #$0A00
! sta MyID
jsr Animate
! pei MyID
! _DisposeAll
shortm restore users border color
lda BORDER
and #$F0
ora bordercol
sta BORDER
longmx
plb
lda 2,s
sta 12,s
lda 1,s
sta 11,s
tsc Remove input paramaters
clc
adc #10 (MasterID+MovePtr+TextPtr)
tcs
clc
rtl
End
*-----------------------------------------------------------------------------*
Animate Start
Using MainDATA
lda #$E1
sta HiRes+2
lda top_boundary
sta yposition
lda left_boundary
sta xposition
event_loopL8 anop
lda yposition
inc a
inc a
lsr a
clc
adc #$80
sta temp
shortm
wait00 lda VERTCNT
cmp temp
bne wait00
longm
* shortm
*wait2 lda VBLWait
* bmi wait2
*waitVBL lda VBLWait
* bpl waitVBL
* longm
jsr DrawApple
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
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
*-----------------------------------------------------------------------------*
DrawApple Start
Using MainDATA
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 image_height depth of shape
sta depth
PushWord #0 ; starting Y value
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 fillPtr+1
ldx #0
ply
cLoop lda |Apple,y
fillPtr sta SHR,x
inx
inx
iny
iny
dec WIDTH
bne cLoop
phy
inc y ; go to next line
dec depth ; see if we've done all the lines
bne yLoop
ply
rts
End
*-----------------------------------------------------------------------------*
MainDATA Data
* Motion boundaries (in pixels)
left_boundary dc i'0' motion boundaries in pixels
right_boundary dc i'bWidth+160'
top_boundary dc i'02' ;11;15
bottom_boundary dc i'198'
* 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'37'
taboffset ds 2
apple_pal anop
dc h'0000 000a b000 0c00 000d e000'
dc h'0f00 2a05 500d 2c07 700f 0f0b'
dc h'd00d f00f dd0d ff0f'
apple anop ;1111222233334444555566667777888899990000
dc h'0000000000000000000000000000000000000000' 1
dc h'0000000000000000000000022250000000000000' 2
dc h'0000000000000000000002225550000000000000' 3
dc h'0000000000000000000022255550000000000000' 4
dc h'0000000000000000000225555550000000000000' 5
dc h'0000000000000000000225555500000000000000' 6
dc h'0000000000000000002255555000000000000000' 7
dc h'0000000000000000002255500000000000000000' 8
dc h'0000000000000000000255000000000000000000' 9
dc h'0000000002222222000000000055555550000000' 0
dc h'0000000222222222222222255555555555500000' 1
dc h'0000002222222222255555555555555555550000' 2
dc h'0000022222222225555555555555555555555000' 3
dc h'0000222222222255555555555555555555555000' 4
dc h'0000cccccccccdddddddddddddddddddddddd000' 5
dc h'000cccccccccddddddddddddddddddddddddd000' 6
dc h'000cccccccccddddddddddddddddddddddd00000' 7
dc h'000ccccccccdddddddddddddddddddddd0000000' 8
dc h'00cccccccccddddddddddddddddddddd00000000' 9
dc h'0088888888aaaaaaaaaaaaaaaaaaaaa000000000' 0
dc h'0088888888aaaaaaaaaaaaaaaaaaaaa000000000' 1 2
dc h'0088888888aaaaaaaaaaaaaaaaaaaaa000000000' 3
dc h'0088888888aaaaaaaaaaaaaaaaaaaaa000000000' 4
dc h'0001111111444444444444444444444000000000' 5
dc h'0001111111444444444444444444444400000000' 6
dc h'0001111111444444444444444444444440000000' 7
dc h'0000111111144444444444444444444444400000' 8
dc h'0000111111114444444444444444444444444000' 9
dc h'0000077777779999999999999999999999999000' 0
dc h'0000007777777799999999999999999999990000' 1
dc h'0000000777777779999999999999999999900000' 2
dc h'0000000077777777799999999999999999000000' 3
dc h'0000000003333333366666666666666660000000' 4
dc h'0000000000333333333366666666666000000000' 5
dc h'0000000000003333333333336666600000000000' 6
dc h'0000000000000033333333333336000000000000' 7
dc h'0000000000000000000000000000000000000000' 8
MyPortLoc anop
SCB dc i'$0080' portSCB
Pix dc i4'$E12000' ptrToPixImage
dc i'$00A0' width in bytes of each line in image
bounds dc i'0,0' boundary rectangle
mode dc i'200,640' was reverse!
MyPort ds $AA
orgPort ds 4
End
*-----------------------------------------------------------------------------*

View File

@ -0,0 +1,104 @@
#include "types.rez"
// -- Module name resource
resource rPString (0x1) {
"Bouncing Apple"
};
// --- Version resource
resource rVersion (0x1, $0000) {
{ $1,$1,$0,beta,$4 }, // Version 1.1.0b4
verUS, // US Version
"Twilight II Bouncing Apple Module", // program's name
"By J. Maricondo. Thanks D.Y!\$0D"
"Copyright 1991 Jim Maricondo." // copyright notice
};
// --- About text resource
#define LETXTBOX2 88
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 bounces a colorful Apple"
"\$A8"
" logo around your screen."
};
// --- About icon resource
resource rIcon ($0010DD01) {
$8000, // kind
$0014, // height
$001C, // width
$"FFF0000000000000000000000FFF"
$"FFF0FFFFFFFFFFFFFFFFFFFF0FFF"
$"FFF0F000000000000000000F0FFF"
$"FFF0F000000000000200000F0FFF"
$"FFF0F030000000088088800F0FFF"
$"FFF0F0030000002AAAAA000F0FFF"
$"FFF0F000300000666666600F0FFF"
$"FFF0F0300300F0555555500F0FFF"
$"FFF0F003000F00011011000F0FFF"
$"FFF0F00030F00F000000000F0FFF"
$"FFF0F0300F00F00F0000000F0FFF"
$"FFF0F000000000000000000F0FFF"
$"FFF0FFFFFFFFFFFFFFFFAFFF0FFF"
$"FFF0000000000000000000000FFF"
$"FFFF0FFFFFFFFFFFFFFFFFF0FFFF"
$"FFFF0FFFFFFFFFFFFFFFFFF0FFFF"
$"FFFF0FF4AFFFFFFFFFFFFFF0FFFF"
$"FFFF0CCCCCCCCCCCCCCCCCC0FFFF"
$"FFFF0FFFFFFFFFFFFFFFAFF0FFFF"
$"FFFF00000000000000000000FFFF",
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"000FFFFFFFFFFFFFFFFFFFFFF000"
$"0000FFFFFFFFFFFFFFFFFFFF0000"
$"0000FFFFFFFFFFFFFFFFFFFF0000"
$"0000FFFFFFFFFFFFFFFFFFFF0000"
$"0000FFFFFFFFFFFFFFFFFFFF0000"
$"0000FFFFFFFFFFFFFFFFFFFF0000"
$"0000FFFFFFFFFFFFFFFFFFFF0000";
};

View File

@ -0,0 +1,30 @@
*****************************************************************
* Genesys created ASM65816 resource equates
* Simple Software Systems International, Inc.
* ORCAM.SCG 1.2
*
DelayRez GEQU $1
Control_List GEQU $1003
TextEditCtl GEQU $1
PromptStrCtl GEQU $2
CancelCtl GEQU $3
OKCtl GEQU $4
DelayStrCtl GEQU $5
DelayLECtl GEQU $6
SavedTextC1IStr GEQU $1
ModuleNameStr GEQU $1
CancelStr GEQU $2
OKStr GEQU $3
DefaultLEStr GEQU $4
Prompt_LText GEQU $1
Delay_LText GEQU $2
Configuration_Window GEQU $1
Configuration_Code GEQU $1

View File

@ -0,0 +1,363 @@
#include "types.rez"
#define Prompt_LText_CNT 47
#define Delay_LText_CNT 42
// --- type $0001 defines
#define DelayRez $00000001
// --- type $8003 defines
#define Control_List $00001003
// --- type $8004 defines
#define TextEditCtl $00000001
#define PromptStrCtl $00000002
#define CancelCtl $00000003
#define OKCtl $00000004
#define DelayStrCtl $00000005
#define DelayLECtl $00000006
// --- type $8005 defines
#define SavedTextC1IStr $00000001
// --- type $8006 defines
#define ModuleNameStr $00000001
#define CancelStr $00000002
#define OKStr $00000003
#define DefaultLEStr $00000004
// --- type $800B defines
#define Prompt_LText $00000001
#define Delay_LText $00000002
// --- type $800E defines
#define Configuration_Window $00000001
// --- type $8017 defines
#define Configuration_Code $00000001
// --- type $0001 is undefined and therefore created as hex DATA
data $0001 (DelayRez, $0000) {
$"B400";
};
// --- Version resource
resource rVersion (0x1, $0000) {
{ $1,$0,$0,beta,$2 }, // Version 1.0.0b2
verUS, // US Version
"Twilight II DrawString Module", // program's name
"Copyright 1991 Jim Maricondo." // copyright notice
};
// --- Control List Definitions
resource rControlList (Control_List, $0000) {
{
TextEditCtl, // control 1
PromptStrCtl, // control 2
CancelCtl, // control 3
OKCtl, // control 4
DelayStrCtl, // control 5
DelayLECtl, // control 6
};
};
// --- Control Templates
resource rControlTemplate (TextEditCtl, $0000) {
$00000001, // ID
{ 13, 8, 44,244}, // rect
editTextControl {{
$0000, // flag
$7400, // moreFlags
$00000000, // refCon
$23A80000, // textFlags
{65535,65535,65535,65535}, // indentRect
$00000000, // vertBar
$0000, // vertAmount
$00000000, // horzBar
$0000, // horzAmount
$00000000, // styleRef
$0000, // textDescriptor
0, // textRef
$00000000, // textLength
$00000800, // maxChars
$00000000, // maxLines
$0000, // maxCharsPerLine
$0000, // maxHeight
0, // colorTableRef
$0000, // drawMode
$00000000 // filterProcPtr
}};
};
resource rControlTemplate (PromptStrCtl, $0000) {
$00000002, // ID
{ 3, 10, 12,163}, // rect
statTextControl {{
$0000, // flag
$1002, // moreFlags
$00000000, // refCon
Prompt_LText, // textRef
Prompt_LText_CNT, // textSize
$0000 // just
}};
};
resource rControlTemplate (CancelCtl, $0000) {
$00000003, // ID
{ 66, 26, 79,106}, // rect
simpleButtonControl {{
$0000, // flag
$3002, // moreFlags
$00000000, // refCon
CancelStr, // titleRef
0, // colorTableRef
{"\$1B", "\$1B",$0000,$0000} // key equivalents
}};
};
resource rControlTemplate (OKCtl, $0000) {
$00000004, // ID
{ 66,148, 79,228}, // rect
simpleButtonControl {{
$0001, // flag
$3002, // moreFlags
$00000000, // refCon
OKStr, // titleRef
0, // colorTableRef
{"\$0D", "\$0D",$0000,$0000} // key equivalents
}};
};
resource rControlTemplate (DelayStrCtl, $0000) {
$00000005, // ID
{ 47, 12, 57,131}, // rect
statTextControl {{
$0000, // flag
$1002, // moreFlags
$00000000, // refCon
Delay_LText, // textRef
Delay_LText_CNT, // textSize
$0000 // just
}};
};
resource rControlTemplate (DelayLECtl, $0000) {
$00000006, // ID
{ 45,134, 58,162}, // rect
editLineControl {{
$0000, // flag
$7002, // moreFlags
$00000000, // refCon
$0002, // maxSize
DefaultLEStr // defaultRef
}};
};
// --- rC1InputString Templates
resource rC1InputString (SavedTextC1IStr, $C000) {
"Welcome to Twilight II!"
};
// --- rPString Templates
resource rPString (ModuleNameStr, $0000) {
"Draw String"
};
resource rPString (CancelStr, $0000) {
"Cancel"
};
resource rPString (OKStr, $0000) {
"OK"
};
resource rPString (DefaultLEStr, $0000) {
"2"
};
// --- rTextForLETextBox2 Templates
resource rTextForLETextBox2 (Prompt_LText, $0000) {
"\$01"
"J"
"\$00"
"\$00"
"\$01"
"L"
"\$00"
"\$00"
"\$01"
"R"
"\$04"
"\$00"
"\$01"
"F"
"\$FE"
"\$FF"
"\$00"
"\$08"
"\$01"
"C"
"\$00"
"\$00"
"\$01"
"B"
"\$FF"
"\$FF"
"Enter string to draw:"
};
resource rTextForLETextBox2 (Delay_LText, $0000) {
"\$01"
"J"
"\$00"
"\$00"
"\$01"
"L"
"\$00"
"\$00"
"\$01"
"R"
"\$04"
"\$00"
"\$01"
"F"
"\$FE"
"\$FF"
"\$00"
"\$08"
"\$01"
"C"
"\$00"
"\$00"
"\$01"
"B"
"\$FF"
"\$FF"
"Delay (seconds):"
};
// --- Window Templates
resource rWindParam1 (Configuration_Window, $0000) {
$20A0, // plFrame (frame bits)
NIL, // plTitle (no Title)
$00000000, // plRefCon
{ 0, 0, 0, 0}, // plZoomRect
NIL, // plColorTable (standard colors)
{$0000, $0000}, // plYOrigin, plXOrigin
{$0000, $0000}, // plDataHeight, plDataWidth
{$0000, $0000}, // plMaxHeight, plMaxWidth
{$0000, $0000}, // plVerScroll, plHorScroll
{$0000, $0000}, // plVerPage, plHorPage
$00000000, // plInfoText (info RefCon)
$0000, // plInfoHeight
{ 45,192,132,446}, // plPosition
infront, // plPlane
Control_List, // plControlList
$0009 // plInDesc
};
// --- Code resources
read rCodeResource (0x1,locked,convert) "DS2.config"; /* the config part */
// --- Resource name resources
data 0x8014 (0x10001) {
$"0100 0100 0000 0100 0000 0844 656C 6179" /* ...........Delay */
$"5265 7A" /* Rez */
};
data 0x8014 (0x18003) {
$"0100 0100 0000 0310 0000 0C43 6F6E 7472" /* ...........Contr */
$"6F6C 204C 6973 74" /* ol List */
};
data 0x8014 (0x18004) {
$"0100 0600 0000 0300 0000 0943 616E 6365" /* ...........Cance */
$"6C43 746C 0600 0000 0A44 656C 6179 4C45" /* lCtl.....DelayLE */
$"4374 6C05 0000 000B 4465 6C61 7953 7472" /* Ctl.....DelayStr */
$"4374 6C04 0000 0005 4F4B 4374 6C02 0000" /* Ctl.....OKCtl... */
$"000C 5072 6F6D 7074 5374 7243 746C 0100" /* ..PromptStrCtl.. */
$"0000 0B54 6578 7445 6469 7443 746C" /* ...TextEditCtl */
};
data 0x8014 (0x18005) {
$"0100 0100 0000 0100 0000 0F53 6176 6564" /* ...........Saved */
$"5465 7874 4331 4953 7472" /* TextC1IStr */
};
data 0x8014 (0x18006) {
$"0100 0400 0000 0200 0000 0943 616E 6365" /* ...........Cance */
$"6C53 7472 0100 0000 0D4D 6F64 756C 654E" /* lStr.....ModuleN */
$"616D 6553 7472 0300 0000 054F 4B53 7472" /* ameStr.....OKStr */
$"0400 0000 0C44 6566 6175 6C74 4C45 5374" /* .....DefaultLESt */
$"72" /* r */
};
data 0x8014 (0x1800B) {
$"0100 0200 0000 0200 0000 0B44 656C 6179" /* ...........Delay */
$"204C 5465 7874 0100 0000 0C50 726F 6D70" /* LText.....Promp */
$"7420 4C54 6578 74" /* t LText */
};
data 0x8014 (0x1800E) {
$"0100 0100 0000 0100 0000 1443 6F6E 6669" /* ...........Confi */
$"6775 7261 7469 6F6E 2057 696E 646F 77" /* guration Window */
};
data 0x8014 (0x18017) {
$"0100 0100 0000 0100 0000 1243 6F6E 6669" /* ...........Confi */
$"6775 7261 7469 6F6E 2043 6F64 65" /* guration Code */
};
// --- About icon resource
resource rIcon ($0010DD01) {
$8000, // kind
$0014, // height
$001C, // width
$"FFF0000000000000000000000FFF"
$"FFF0FFFFFFFFFFFFFFFFFFFF0FFF"
$"FFF0F000000000000000000F0FFF"
$"FFF0F03FC00000000000000F0FFF"
$"FFF0F0FFF03FC0000003FC0F0FFF"
$"FFF0F0FFC0FFF003FC0FFF0F0FFF"
$"FFF0F03F00FFC00FFF03FF0F0FFF"
$"FFF0F003F03F0003FF00FC0F0FFF"
$"FFF0F0000003F000FC0F900F0FFF"
$"FFF0F0000000000F9000000F0FFF"
$"FFF0F000000000000000000F0FFF"
$"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,183 @@
mcopy DS.Mac
*-----------------------------------------------------------------------------*
CLOCKCTL gequ $E0C034 clock control register
*-----------------------------------------------------------------------------*
DrawString Start
phb
phk
plb
phd
tsc
tcd
pha ; local space!
pha
DefineStack
TempDP long ; temporary local space
oldDirectPage word
oldBank byte
returnAddress block 3
MasterID word
MovePtr long
TextPtr long
lda >CLOCKCTL
and #$000F
sta OldBorder
lda >CLOCKCTL
and #$FFF0
sta >CLOCKCTL
lda #$0000
ldx #$7D00-2
zero sta >$E12000,x
dex
dex
bpl zero
lda #640
sta Mode
WordResult
_GetMasterSCB
pla
sta MasterSCB
xba
cmp #$8000
bge ModeOK bge
lda #320
sta Mode
ModeOK anop
PushWord #0
PushWord #0
_MoveTo
pei TextPtr+2
pei TextPtr
PushLong #R_top
_StringBounds
LongResult
_GetPort
PushLong #OurPort
_OpenPort
PushLong #OurPort
_SetPort
PushLong #MasterSCB
_SetPortLoc
PushWord #0
_SetBackColor
PushWord #$F
_SetForeColor
PushWord #0
_SetSolidPenPat
loop anop
lda R_top
clc
adc horiz
sta r2_top
lda R_left
clc
adc vert
sta r2_left
lda R_Bottom
clc
adc horiz
sta r2_bottom
lda R_Right
clc
adc vert
sta r2_right
PushLong #r2_top
_PaintRect
WordResult
WordResult
WordResult
_Random
PushWord Mode
_UDivide
pla
pla
sta vert
WordResult
WordResult
WordResult
_Random
PushWord #199
_UDivide
pla
pla
sta horiz
PushWord vert
PushWord horiz
_MoveTo
pei TextPtr+2
pei TextPtr
_DrawString
ldx #$0004
more_delay ldy #$FFFF
delay dey
lda [MovePtr]
bne Exit
cpy #$0000
bne delay
dex
bne more_delay
brl loop
Exit anop
_SetPort
PushLong #OurPort
_ClosePort
lda >CLOCKCTL clock control register
and #$FFF0
ora OldBorder
sta >CLOCKCTL clock control register
pla ; kill locals
pla
pld
plb
lda 2,s
sta 2+10,s
lda 1,s
sta 1+10,s
tsc Remove input paramaters
clc
adc #10 (MasterID+MovePtr+TextPtr)
tcs
clc
rtl
Mode ds 2
r2_top ds 2
r2_left ds 2
r2_bottom ds 2
r2_right ds 2
R_top ds 2
R_left ds 2
R_Bottom ds 2
R_Right ds 2
vert ds 2
horiz ds 2
OldBorder ds 2
OurPort ds $AA
MasterSCB ds 2
dc i4'$00E12000'
dc i2'$00A0'
dc i4'$00000000'
dc i2'$00C8'
End
*-----------------------------------------------------------------------------*

View File

@ -0,0 +1,167 @@
MACRO
&lab _ClosePort
&lab ldx #$1A04
jsl $E10000
MEND
MACRO
&lab _DrawString
&lab ldx #$A504
jsl $E10000
MEND
MACRO
&lab _GetMasterSCB
&lab ldx #$1704
jsl $E10000
MEND
MACRO
&lab _GetPort
&lab ldx #$1C04
jsl $E10000
MEND
MACRO
&lab _MoveTo
&lab ldx #$3A04
jsl $E10000
MEND
MACRO
&lab _OpenPort
&lab ldx #$1804
jsl $E10000
MEND
MACRO
&lab _PaintRect
&lab ldx #$5404
jsl $E10000
MEND
MACRO
&lab _Random
&lab ldx #$8604
jsl $E10000
MEND
MACRO
&lab _SetBackColor
&lab ldx #$A204
jsl $E10000
MEND
MACRO
&lab _SetForeColor
&lab ldx #$A004
jsl $E10000
MEND
MACRO
&lab _SetPort
&lab ldx #$1B04
jsl $E10000
MEND
MACRO
&lab _SetPortLoc
&lab ldx #$1D04
jsl $E10000
MEND
MACRO
&lab _SetSolidPenPat
&lab ldx #$3704
jsl $E10000
MEND
MACRO
&lab _StringBounds
&lab ldx #$AD04
jsl $E10000
MEND
MACRO
&lab WordResult
&lab phd
MEND
MACRO
&lab LongResult
&lab phd
phd
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
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 _UDivide
&lab ldx #$0B0B
jsl $E10000
MEND

View File

@ -0,0 +1,288 @@
mcopy DS2.Mac
copy DS2.Equ
*-----------------------------------------------------------------------------*
CLOCKCTL gequ $E0C034 clock control register
rC1InputString gequ $8005
rConfiguration gequ $0001
*-----------------------------------------------------------------------------*
DrawString Start
phb
phk
plb
phd
pha ; local space!
pha
tsc
tcd
DefineStack
TempDP long ; temporary local space
oldDirectPage word
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
LongResult ; Set random seed
LongResult
_ReadTimeHex
_SetRandSeed
pla
pla
WordResult
_GetCurResourceApp
PullWord OldResourceApp
WordResult
_GetCurResourceFile
PullWord OldResourceFile
PushWord MyID
_ResourceStartUp
* PushWord MyID
* _SetCurResourceApp
WordResult
PushWord #1 request read access
PushLong #0 open a new file
PushLong OurPath
_OpenResourceFile
plx
stx ResFileID
* jcs Error
LongResult
PushWord #rConfiguration
PushLong #DelayRez
_LoadResource
makePdp
lda [3]
sta DelayTime
killLdp
LongResult
PushWord #rC1InputString
PushLong #$00000001
_LoadResource
plx
stx TempDP
plx
stx TempDP+2
* jcs error
ldy #2
lda [TempDP]
tax
lda [TempDP],y
sta TempDP+2
stx TempDP
lda [TempDP] ; make C1 string into a P-String
xba
sta [TempDP]
inc TempDP
lda >CLOCKCTL
and #$000F
sta OldBorder
lda >CLOCKCTL
and #$FFF0
sta >CLOCKCTL
lda #$0000
ldx #$7D00-2
zero sta >$E12000,x
dex
dex
bpl zero
lda #640
sta Mode
WordResult
_GetMasterSCB
pla
sta MasterSCB
xba
cmp #$8000
bge ModeOK bge
lda #320
sta Mode
ModeOK anop
PushWord #0
PushWord #0
_MoveTo
pei TempDP+2
pei TempDP
PushLong #R_top
_StringBounds
LongResult
_GetPort
PullLong OldPort
PushLong #OurPort
_OpenPort
PushLong #OurPort
_SetPort
PushLong #MyPortLoc
_SetPortLoc
PushWord #0
_SetBackColor
PushWord #$F
_SetForeColor
PushWord #0
_SetSolidPenPat
loop anop
lda R_top
clc
adc horiz
sta r2_top
lda R_left
clc
adc vert
sta r2_left
lda R_Bottom
clc
adc horiz
sta r2_bottom
lda R_Right
clc
adc vert
sta r2_right
PushLong #r2_top
_PaintRect
WordResult
WordResult
WordResult
_Random
PushWord Mode
_UDivide
pla
pla
sta vert
WordResult
WordResult
WordResult
_Random
PushWord #199
_UDivide
pla
pla
sta horiz
PushWord vert
PushWord horiz
_MoveTo
pei TempDP+2
pei TempDP
_DrawString
ldy DelayTime
d_loop shortm
v1 lda $E0C019
bmi v1
v2 lda $E0C019
bpl v2
longm
lda [MovePtr]
bne Exit
dey
bne d_loop
brl loop
Exit anop
PushLong OldPort
_SetPort
PushLong #OurPort
_ClosePort
PushWord #3 ; purge level 3
PushWord #rC1InputString
PushLong #$00000001
_ReleaseResource
PushWord ResFileID
_CloseResourceFile
_ResourceShutDown
PushWord OldResourceFile
_SetCurResourceFile
PushWord OldResourceApp
_SetCurResourceApp
PushWord MyID
_DisposeAll
lda >CLOCKCTL clock control register
and #$FFF0
ora OldBorder
sta >CLOCKCTL clock control register
pla ; kill locals
pla
pld
plb
lda 2,s
sta 2+10,s
lda 1,s
sta 1+10,s
tsc Remove input paramaters
clc
adc #10 (MasterID+MovePtr+TextPtr)
tcs
clc
rtl
r2_top ds 2
r2_left ds 2
r2_bottom ds 2
r2_right ds 2
R_top ds 2
R_left ds 2
R_Bottom ds 2
R_Right ds 2
vert ds 2
horiz ds 2
OldBorder ds 2
MyID ds 2
OldPort ds 4
OurPort ds $AA
MyPortLoc anop
MasterSCB ds 2 ; portSCB
dc i4'$E12000' ; ptrToPixImage
dc i'$A0' ; byteWidth of each line in image
bounds dc i'0,0' ; boundary rectangle
dc i'200'
Mode ds 2
OurPath ds 4
ResFileID ds 2
OldResourceApp ds 2
OldResourceFile ds 2
DelayTime ds 2
End
*-----------------------------------------------------------------------------*

Binary file not shown.

View File

@ -0,0 +1,355 @@
MACRO
&lab _GetPort
&lab ldx #$1C04
jsl $E10000
MEND
MACRO
&lab _SetPort
&lab ldx #$1B04
jsl $E10000
MEND
MACRO
&lab WordResult
&lab phd
MEND
MACRO
&lab LongResult
&lab phd
phd
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
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 BLOCK &Value
AIF C:&lab=0,.skiplab
&lab equ &DummyPC
.skiplab
&DummyPC SETA &DummyPC+&Value
MEND
MACRO
&lab GSStr &GSstring
&lab dc i2'L:&GSstring',C'&GSstring'
MEND
MACRO
&lab _CloseResourceFile
&lab ldx #$0B1E
jsl $E10000
MEND
MACRO
&lab _GetCurResourceApp
&lab ldx #$141E
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 _SetCurResourceApp
&lab ldx #$131E
jsl $E10000
MEND
MACRO
&lab _SetCurResourceFile
&lab ldx #$111E
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 _DisposeAll
&lab ldx #$1102
jsl $E10000
MEND
MACRO
&lab _CloseWindow
&lab ldx #$0B0E
jsl $E10000
MEND
MACRO
&lab _NewWindow2
&lab ldx #$610E
jsl $E10000
MEND
MACRO
&lab _TaskMaster
&lab ldx #$1D0E
jsl $E10000
MEND
MACRO
&lab _DrawControls
&lab ldx #$1010
jsl $E10000
MEND
MACRO
&lab _SysBeep
&lab ldx #$2C03
jsl $E10000
MEND
MACRO
&lab _SetFontFlags
&lab ldx #$9804
jsl $E10000
MEND
MACRO
&lab _TEShutDown
&lab ldx #$0322
jsl $E10000
MEND
MACRO
&lab _TEStartUp
&lab ldx #$0222
jsl $E10000
MEND
MACRO
&lab _TEStatus
&lab ldx #$0622
jsl $E10000
MEND
MACRO
&lab _LoadOneTool
&lab ldx #$0F01
jsl $E10000
MEND
MACRO
&lab _DisposeHandle
&lab ldx #$1002
jsl $E10000
MEND
MACRO
&lab _NewHandle
&lab ldx #$0902
jsl $E10000
MEND
MACRO
&LAB JNE &BP
&LAB BEQ *+5
BRL &BP
MEND
MACRO
&lab makeDP
&lab phd
tsc
tcd
MEND
MACRO
&lab _TEGetText
&lab ldx #$0C22
jsl $E10000
MEND
MACRO
&lab _GetCtlHandleFromID
&lab ldx #$3010
jsl $E10000
MEND
MACRO
&lab _LoadResource
&lab ldx #$0E1E
jsl $E10000
MEND
MACRO
&lab _MarkResourceChange
&lab ldx #$101E
jsl $E10000
MEND
MACRO
&LAB JEQ &BP
&LAB BNE *+5
BRL &BP
MEND
MACRO
&lab _Dec2Int
&lab ldx #$280B
jsl $E10000
MEND
MACRO
&lab _Int2Dec
&lab ldx #$260B
jsl $E10000
MEND
MACRO
&lab _TESetText
&lab ldx #$0B22
jsl $E10000
MEND
MACRO
&lab killLdp
&lab pld
pla
pla
MEND
MACRO
&lab makePdp
&lab phd
tsc
tcd
ldy #2
lda [3]
tax
lda [3],y
sta <5
stx <3
MEND
MACRO
&lab _GetCtlTitle
&lab ldx #$0D10
jsl $E10000
MEND
MACRO
&lab _LESetText
&lab ldx #$0B14
jsl $E10000
MEND
MACRO
&lab _LEGetTextHand
&lab ldx #$2214
jsl $E10000
MEND
MACRO
&lab _LEGetTextLen
&lab ldx #$2314
jsl $E10000
MEND
MACRO
&lab _SetOrigin
&lab ldx #$2304
jsl $E10000
MEND
MACRO
&lab _FrontWindow
&lab ldx #$150E
jsl $E10000
MEND
MACRO
&lab _StartDrawing
&lab ldx #$4D0E
jsl $E10000
MEND
MACRO
&lab _FindTargetCtl
&lab ldx #$2610
jsl $E10000
MEND
MACRO
&lab _LESetSelect
&lab ldx #$0E14
jsl $E10000
MEND

View File

@ -0,0 +1,301 @@
MACRO
&lab _ClosePort
&lab ldx #$1A04
jsl $E10000
MEND
MACRO
&lab _DrawString
&lab ldx #$A504
jsl $E10000
MEND
MACRO
&lab _GetMasterSCB
&lab ldx #$1704
jsl $E10000
MEND
MACRO
&lab _GetPort
&lab ldx #$1C04
jsl $E10000
MEND
MACRO
&lab _MoveTo
&lab ldx #$3A04
jsl $E10000
MEND
MACRO
&lab _OpenPort
&lab ldx #$1804
jsl $E10000
MEND
MACRO
&lab _PaintRect
&lab ldx #$5404
jsl $E10000
MEND
MACRO
&lab _Random
&lab ldx #$8604
jsl $E10000
MEND
MACRO
&lab _SetBackColor
&lab ldx #$A204
jsl $E10000
MEND
MACRO
&lab _SetForeColor
&lab ldx #$A004
jsl $E10000
MEND
MACRO
&lab _SetPort
&lab ldx #$1B04
jsl $E10000
MEND
MACRO
&lab _SetPortLoc
&lab ldx #$1D04
jsl $E10000
MEND
MACRO
&lab _SetSolidPenPat
&lab ldx #$3704
jsl $E10000
MEND
MACRO
&lab _StringBounds
&lab ldx #$AD04
jsl $E10000
MEND
MACRO
&lab WordResult
&lab phd
MEND
MACRO
&lab LongResult
&lab phd
phd
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
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 _UDivide
&lab ldx #$0B0B
jsl $E10000
MEND
MACRO
&lab GSStr &GSstring
&lab dc i2'L:&GSstring',C'&GSstring'
MEND
MACRO
&lab _CloseResourceFile
&lab ldx #$0B1E
jsl $E10000
MEND
MACRO
&lab _GetCurResourceApp
&lab ldx #$141E
jsl $E10000
MEND
MACRO
&lab _GetCurResourceFile
&lab ldx #$121E
jsl $E10000
MEND
MACRO
&lab _LoadResource
&lab ldx #$0E1E
jsl $E10000
MEND
MACRO
&lab _OpenResourceFile
&lab ldx #$0A1E
jsl $E10000
MEND
MACRO
&lab _ReleaseResource
&lab ldx #$171E
jsl $E10000
MEND
MACRO
&lab _ResourceShutDown
&lab ldx #$031E
jsl $E10000
MEND
MACRO
&lab _ResourceStartUp
&lab ldx #$021E
jsl $E10000
MEND
MACRO
&lab _SetCurResourceApp
&lab ldx #$131E
jsl $E10000
MEND
MACRO
&lab _SetCurResourceFile
&lab ldx #$111E
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 _DisposeAll
&lab ldx #$1102
jsl $E10000
MEND
MACRO
&lab killLdp
&lab pld
pla
pla
MEND
MACRO
&lab makePdp
&lab phd
tsc
tcd
ldy #2
lda [3]
tax
lda [3],y
sta <5
stx <3
MEND
MACRO
&lab _SetRandSeed
&lab ldx #$8704
jsl $E10000
MEND
MACRO
&lab _ReadTimeHex
&lab ldx #$0D03
jsl $E10000
MEND
MACRO
&lab longm
&lab ANOP
rep #%00100000
longa on
MEND
MACRO
&lab shortm
&lab ANOP
sep #%00100000
longa off
MEND

View File

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

View File

@ -0,0 +1,23 @@
echo unset keeptype
unset keeptype
echo asml DS2.asm keep=DS2.d
asml DS2.asm keep=DS2.d
echo compile DS2.rez keep=DS2.r
compile DS2.rez keep=DS2.r
echo duplicate -d DS2.d DS2
duplicate -d DS2.d DS2
echo duplicate -r DS2.r DS2
duplicate -r DS2.r DS2
echo filetype DS2 $BC
filetype DS2 $BC
echo setfile DS2 -at $4004
setfile DS2 -at $4004
echo copy DS2 /jim1/system/cdevs/Twilight/DrawString1.1
copy -c DS2 /jim1/system/cdevs/Twilight/DrawString1.1

View File

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

View File

@ -0,0 +1,20 @@
echo unset keeptype
unset keeptype
echo compile DS2.rez keep=DS2.r
compile DS2.rez keep=DS2.r
echo duplicate -d DS2.d DS2
duplicate -d DS2.d DS2
echo duplicate -r DS2.r DS2
duplicate -r DS2.r DS2
echo filetype DS2 $BC
filetype DS2 $BC
echo setfile DS2 -at $4004
setfile DS2 -at $4004
echo copy DS2 /jim1/system/cdevs/Twilight/DrawString1.1
copy -c DS2 /jim1/system/cdevs/Twilight/DrawString1.1

View File

@ -0,0 +1,12 @@
#include "types.rez"
#include ":jim4:dya:twilight:common.rez"
resource rPString (0x1) {
"Draw String 1.0"
};
resource rPString (0x2) {
""
};

View File

@ -0,0 +1,422 @@
mcopy DS2.Config.Mac
mcopy 7/m16.util2
copy DS2.equ
copy 7/e16.types
copy 7/e16.window
copy 7/e16.memory
copy 7/e16.control
*-----------------------------------------------------------------------------*
FALSE gequ 0
TRUE gequ 1
rC1InputString gequ $8005
rWindParam1 gequ $800E
rConfiguration gequ $0001
MyID gequ <0
TempDP gequ MyID+2
OldPort gequ TempDP+4
OurWindow gequ OldPort+4
TEFlag gequ OurWindow+4
ToolDP gequ TEFlag+2
OurPath gequ ToolDP+4
*-----------------------------------------------------------------------------*
DSConfig Start
phb
phk
plb
DefineStack
oldBank byte
returnAddress block 3
MasterID word
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 #3 request read/write access
PushLong #0 open a new file
pei OurPath+2
pei OurPath
_OpenResourceFile
plx
stx ResFileID
* jcs Error
LongResult
_GetPort
PullLong OldPort
stz TEFlag
WordResult ;First, check whether we need to load
_TEStatus ;the TE toolset
pla
bcs MustLoad
beq MustLoad
brl skipLoad
MustLoad anop
LongResult ; Okay, now we need some dp space
PushLong #$100 ; we need one page of direct page space
pei MyID
PushWord #attrLocked+attrFixed+attrPage+attrBank
PushLong #0
_NewHandle
bcc dpMemOk ;if we got the mem than everything's
pla ;cool. Otherwise we HAVE to exit.
pla
brk $99
dpMemOk anop
* makeDP ;Get a pointer to the DP mem and store
* lda [3] ;it in TEFlag, for the time being
* sta TEFlag
* pld
PullLong ToolDP ;Don't forget to get the handle, too....
PushWord #$22 ;And finally, load the TE toolset
PushWord #0
_LoadOneTool
bcc TELoaded
brk $88
TELoaded anop
pei MyID ; and start TE up!
lda [ToolDP]
pha
_TEStartUp
bcc TEOk ;TE Started up allright....
brk $77
TEOk lda #-1 ;indicating that we've done so, while
sta TEFlag ;we're at it....
skipLoad anop
LongResult
PushLong #0 ; no replacment title
PushLong #0 ; no replacement refCon
PushLong #DrawContent ; ptr to replacment contentDraw routine
PushLong #0 ; no replacement window definition proc
PushWord #refIsResource
PushLong #Configuration_Window
PushWord #rWindParam1
_NewWindow2
lda 1,s
sta OurWindow
lda 1+2,s
sta OurWindow+2
_SetPort
PushWord #$0004 ; use dithered color text in window...
_SetFontFlags
PushWord #%10010 ; get text from rC1InputString Resource
PushLong #SavedTextC1IStr ; resource ID of C1 input string
PushLong #0 ; length of input text buffer (unused)
PushWord #0 ; type of reference stored in styleRef
PushLong #0 ; styleRef-style structure reference
LongResult ; handle of TERecord in memory
pei OurWindow+2
pei OurWindow
PushLong #TextEditCtl
_GetCtlHandleFromID
_TESetText
LongResult
PushWord #rConfiguration
PushLong #DelayRez
_LoadResource
makePdp
lda [3]
sta DelayTime
killLdp
ldx #0 ; Caluculate the delay
lda DelayTime ; in seconds
sec
nextSub sbc #60
bmi subOk
inx
bra nextSub
subOk stx Seconds
PushWord Seconds ; Convert it to a string
PushLong #TimeTxt
PushWord #2 ; number of characters
PushWord #FALSE ; unsigned
_Int2Dec
PushLong #TimeTxt ;Now, we're going to set the LE control
lda Seconds ;to the number of seconds. To do this
cmp #10 ;we need to figure out how many digits
blt push1 ;there are. Since it can be any number
pea 0002 ;between 1-99, we only have to worry
bra goOn ;about it having 1 or two digits.
push1 pea 0001
lda TimeTxt
xba
sta TimeTxt
goOn LongResult ; for GetCtlTitle
LongResult ; for GetCtlHandleFromID
PushLong OurWindow
PushLong #DelayLECtl
_GetCtlHandleFromID
_GetCtlTitle
_LESetText
LongResult
_FindTargetCtl
pla
plx
bcs out
sta <TempDP
stx <TempDP+2 ; TempDP = target control's handle
lda [TempDP]
tax
ldy #2
lda [TempDP],y
sta <TempDP+2 ; control handle now deref'ed into TempDP
stx <TempDP
ItsLEControl ldy #oCtlData ; offset to LE Record handle
lda [TempDP],y
tax ; low word in X
iny
iny
lda [TempDP],y ; high word in A
pha
phx ; push the LE record handle
LongResult ; save original port
_GetPort
pei OurWindow+2
pei OurWindow
_StartDrawing
PushWord #0 ; start of selection range
PushWord #$FF ; end of selection range
lda 11,s
pha
lda 11,s
pha ; get LE handle at top of stack
_LESetSelect
PushWord #0
PushWord #0
_SetOrigin
_SetPort ; restore original port
pla
pla ;pull the LE record handle off the stack
out anop
wait WordResult ; then wait for the person to hit the
PushWord #$FFFF ; OK button, filtering out all other
PushLong #CfgTaskRec ; events
_TaskMaster
pla
cmp #wInControl ; control selected?
beq ControlHit ; if not, loop
cmp #wInInfo
beq beep
cmp #wInMenuBar
beq beep
cmp #wInDesk
beq beep
cmp #wInContent
beq check
cmp #wInFrame
beq Check
cmp #wInDrag
bne wait
check lda cTData
cmp OurWindow
bne beep
lda cTData+2
cmp OurWindow+2
bne beep
bra wait
beep _SysBeep
bra wait
ControlHit anop
lda cTaskData4 ; ID of pressed control
cmp #CancelCtl ; cancel pressed?
jeq Cancelled
cmp #OKCtl ; OK pressed?
bne wait
Exit anop
WordResult ; for Dec2Int
LongResult ; for LEGetTextHand
LongResult ; for GetCtlTitle
LongResult ; for GetCtlHandleFromID
PushLong OurWindow
PushLong #DelayLECtl
_GetCtlHandleFromID
_GetCtlTitle
lda 1,s
sta TempDP
lda 3,s
sta TempDP+2
_LEGetTextHand
makePdp
pld
WordResult
PushLong TempDP ; handle to edit record
_LEGetTextLen
PushWord #FALSE
_Dec2Int
plx
cpx #1
bge timeOk
ldx #1
timeOk anop
lda #0
dLoop clc
adc #60
dex
bne dLoop
sta DelayTime
LongResult
PushWord #rConfiguration
PushLong #DelayRez
_LoadResource
makePdp
lda DelayTime
sta [3]
killLdp
PushWord #TRUE
PushWord #rConfiguration
PushLong #DelayRez
_MarkResourceChange
LongResult ;Get the text from the TE box
PushWord #%10010 ; rezID for output buffer, C1InputStr
PushLong #SavedTextC1IStr
PushLong #0 ; length of output buffer (ignored)
PushWord #0 ; reference for style data (ignored)
PushLong #0 ; style data (ignored)
LongResult
pei OurWindow+2
pei OurWindow
PushLong #TextEditCtl
_GetCtlHandleFromID
_TEGetText
plx
plx
PushWord #TRUE ; indicate that the resource has changed
PushWord #rC1InputString
PushLong #SavedTextC1IStr
_MarkResourceChange
cancelled anop
pei OurWindow+2
pei OurWindow
_CloseWindow
lda TEFlag
beq skipTE
_TEShutDown
pei ToolDP+2 ; get rid of TE's DP space
pei ToolDP
_DisposeHandle
skipTE anop
pei OldPort+2
pei OldPort
_SetPort
PushWord ResFileID
_CloseResourceFile
_ResourceShutDown
PushWord OldResourceFile
_SetCurResourceFile
PushWord OldResourceApp
_SetCurResourceApp
pei MyID
_DisposeAll
plb
lda 2,s
sta 2+6,s
lda 1,s
sta 1+6,s
tsc Remove input paramaters
clc
adc #6 (MasterID+ourPathname)
tcs
clc
rtl
ResFileID ds 2
OldResourceApp ds 2
OldResourceFile ds 2
DelayTime ds 2
Seconds ds 2
TimeTxt ds 2 ; text string version of seconds
CfgTaskRec anop ; Configuration window's task record
cWhat ds 2
cMessage ds 4
cWhen ds 4
cWhere ds 4
cModifiers ds 2
cTData ds 4
dc i4'$001B2006'
cLastClickTick ds 4
cClickCount ds 2
cTaskData2 ds 4
cTaskData3 ds 4
cTaskData4 ds 4
cLastClickPoint ds 4
End
*-----------------------------------------------------------------------------*
DrawContent Start
phb
phk
plb
LongResult
_GetPort
_DrawControls
plb
rtl
END
*-----------------------------------------------------------------------------*

View File

@ -0,0 +1,72 @@
DefineStack
oldBank byte
returnAddress block 3
MasterID word
MovePtr long
TextPtr long
lda MasterID,s
ora #$0A00
sta MyID
pei MyID
_ResourceStartUp
WordResult
_GetCurResourceApp
PullWord OldResourceApp
WordResult
_GetCurResourceFile
PullWord OldResourceFile
pei MyID
_SetCurResourceApp
WordResult
PushWord #1 request read access
PushLong #0 open a new file
PushLong #OurNameStr
_OpenResourceFile
plx
stx ResFileID
* jcs Error
LongResult
PushWord #rC1InputString
PushLong #$00000001
_LoadResource
plx
stx TempDP
plx
stx TempDP+2
* jcs error
ldy #2
lda [TempDP]
tax
lda [TempDP],y
sta TempDP+2
stx TempDP
PushWord ResFileID
_CloseResourceFile
PushWord OldResourceFile
_SetCurResourceFile
PushWord OldResourceApp
_SetCurResourceApp
_ResourceShutDown
pei <MyID
_DisposeAll
clc
rtl
ResFileID ds 2
OurNameStr GSStr '*:System:CDevs:Twilight:DrawString1.1'
OldResourceApp ds 2
OldResourceFile ds 2

View File

@ -0,0 +1,146 @@
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 Debug &string
aif t:debugSymbols="G",.begin
mexit
.begin
dc i1'$82'
dc i2'(L:&string)+3'
dc i2'$7771'
dc i1'L:&string',C'&string'
MEND
macro
&lab ~MMStartUp
&lab WordResult
Tool $0202
mend
macro
&lab ~MMShutDown &userID
&lab ph2 &userID
Tool $0302
mend
MACRO
&lab name
&lab anop
aif t:DebugSymbols="G",.begin
MEXIT
.begin
brl pastName&SYSCNT
dc i'$7771'
dc i1'L:&lab',c'&lab'
pastName&SYSCNT anop
.pastName
MEND
macro
&lab db &location
&lab anop
aif c:&location<>0,.exists
ds 1
mexit
.exists
dc i1'&location'
mend
macro
&lab dw &location
&lab anop
aif c:&location<>0,.exists
ds 2
mexit
.exists
dc i2'&location'
mend
macro
&lab Tool &number
&lab ldx #&number
jsl $E10000
mend
macro
&lab ph2 &addr,&offset
&lab anop
lclc &char
&char amid "&addr",1,1
aif "&char"="@",.accumulator
aif "&char"="*",.smartmacros
aif "&char"="#",.immediate
aif "&char"="<",.directPage
aif "&char"="[",.zeropage
aif C:&offset=0,.nooffset
aif "&offset"="s",.stack
lda &addr,&offset
pha
mexit
.nooffset
lda &addr
pha
mexit
.stack
lda &addr,s
pha
mexit
.smartmacros
mexit
.accumulator
pha
mexit
.directPage
&addr amid &addr,2,L:&addr-1
pei &addr
mexit
.immediate
&addr amid &addr,2,L:&addr-1
pea &addr
mexit
.zeropage
aif C:&offset<>0,.zeroPageOff
lda &addr
pha
mexit
.zeroPageOff
aif "&offset"="X",.zeroPageReg
aif "&offset"="Y",.zeroPageReg
aif "&offset"="x",.zeroPageReg
aif "&offset"="y",.zeroPageReg
ldy #&offset
lda &addr,y
pha
mexit
.zeroPageReg
lda &addr,&offset
pha
mend
macro
&lab WordResult &zero
&lab anop
aif c:&zeros=1,.zero
phd
mexit
.zero
&lab pea $0000
mend

View File

@ -0,0 +1,171 @@
mcopy fader.mac
keep fader.d
copy 22:t2common.equ
copy 2:ainclude:e16.memory
*-----------------------------------------------------------------------------*
debugSymbols gequ $BAD ; Put in debugging symbols ?
*-----------------------------------------------------------------------------*
* Fader! V1.0b1- Unknown.: Original version - by Jim R Maricondo.
* V1.0b2- 05/10/92: Updated for Generation 2 Module Format. (d31)
* V1.0b3- 05/14/92: Updated to use new T2ModuleFlags bits. (d32)
*
* Fade screen out. Wait until user activity. Fade screen in.
*
* Inputs:
*
* |previous contents|
* |-----------------|
* | T2Result | Long - Result space. (currently reserved)
* |-----------------|
* | T2Message | Word - Action to perform.
* |-----------------|
* | T2data1 | Long - Action specific input.
* |-----------------|
* | T2data2 | Long - Action specific input.
* |-----------------|
* | rtlAddr | 3 bytes - Return address.
* |-----------------|
*
* Outputs:
*
* |previous contents|
* |-----------------|
* | T2Result | Long - Result space. (reserved at this time)
* |-----------------|
* | rtlAddr | 3 bytes - Return address.
* |-----------------|
*
Fader Start
kind $1000 ; no special memory
debug 'Fader'
aif t:debugSymbols="G",.begin
mnote '## Note - Debug Symbols: OFF'
ago .jet
.begin
mnote '## Note - Debug Symbols: ON'
.jet
DefineStack
dpageptr word
dbank byte
rtlAddr block 3
T2data2 long
T2data1 long
T2message word
T2result long
phb
phd
tsc
tcd
lda <T2Message ; Get which setup procedure to call.
cmp #BlankT2
bne n1
brk $00
debug 'blank'
jsr MMStartUp
jsr MMShutDown
brl again
n1 cmp #MakeT2
bne n2
brk $00
debug 'make'
jsr MMStartUp
jsr MMShutDown
brl notSupported
n2 cmp #LoadSetupT2
bne n3
brk $00
debug 'loads'
jsr MMStartUp
jsr MMShutDown
bra notSupported
n3 cmp #UnloadSetupT2
bne n4
brk $00
debug 'unloads'
jsr MMStartUp
jsr MMShutDown
bra notSupported
n4 cmp #KillT2
bne n5
brk $00
debug 'kill'
jsr MMStartUp
jsr MMShutDown
bra notSupported
n5 cmp #HitT2
bne n6
brk $00
debug 'hit'
jsr MMStartUp
jsr MMShutDown
bra notSupported
n6 cmp #SaveT2
bne notSupported
brk $00
debug 'save'
jsr MMStartUp
jsr MMShutDown
bra notSupported
again lda [T2data1] ; movePtr
beq again
; LongResult
; PushLong #ErrLen
; pei <T2Data2+2 ; memory ID
; PushWord #attrLocked+attrNoCross+attrNoSpec
; PushLong #0
; _NewHandle
; PullLong <T2Result
; PushLong #ErrMsg
; pei <T2Result+2
; pei <T2Result
; PushLong #ErrLen
; _PtrToHand
notSupported anop
pld
plb
lda 1,s
sta 1+10,s
lda 2,s
sta 2+10,s
tsc
clc
adc #10
tcs
clc
rtl
;ErrMsg dc c'Attention: Foreground Fader Error!',h'0d'
; dc c'Unable to load ATF file! ($0039)',h'00'
;ErrEnd anop
;ErrLen equ ErrEnd-ErrMsg
MMStartUp name
~MMStartUp
pla
sta ID
rts
MMShutDown name
~MMShutDown ID
rts
ID ds 2
End
*-----------------------------------------------------------------------------*

View File

@ -0,0 +1,295 @@
mcopy fader.mac
mcopy 18:m16.util2
absaddr on
*-----------------------------------------------------------------------------*
Palette0 gequ $E19E00
Border gequ $E0C034 border color / rtc register
NewVideo gequ $E0C029
VBLWait gequ $E0C019 bit 7 = 1 if not VBL
Text gequ $E0C022
bordercol gequ 0 user's original border color
textcol gequ bordercol+2 user's original text/background colors
*-----------------------------------------------------------------------------*
Fader Start
Using MainDATA
phb Store old data bank
phk
plb
brl beginIt
dc c' Twilight Fader Module. '
dc c' January 19, 1991. '
dc c'The executable instructions in this module and '
dc c'all other files distributed with Twilight 2.0 with the '
dc c'exception of ColorStrobe are copyrighted 1991 by Jim '
dc c'Maricondo and Jonah Stich. All rights reserved. '
dc c' Fade routines in this module originally inspired by '
dc c'an article by Kent Dicky, but since then they have been'
dc c' extensively hacked to the point where they bear little'
dc c' resembelance to their original counterparts. '
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
lda >Text
sta <textcol
lda #0
sta >text
longmx
ldx #$200-2 save original screen colors
copy01 lda >Palette0,x
sta |OrgPalette,x
dex
dex
bpl copy01
jsr FadeOut fade out screen
shortm
lda #0
sta >text
longmx
DefineStack
oldDirectPage word
oldBank byte
returnAddress block 3
MasterID word
MovePtr long
TextPtr long
phd wait for user activity
tsc
tcd
getAction lda [MovePtr]
beq getAction
pld
shortm
lda #0
sta >text
longmx
ldx #$200-2 restore original palette
copy02 lda |OrgPalette,x
sta >Palette0,x
dex
dex
bpl copy02
jsr FadeIn fade back in the original picture
plb restore caller's dbr
lda 2,s transfer rtl up stack
sta 12,s
lda 1,s
sta 11,s
tsc Remove input paramaters
clc
adc #10 (MasterID+MovePtr+TextPtr)
tcs
shortm restore user's display colors
lda >Border
and #$F0
ora <bordercol
sta >Border
lda <textcol
sta >Text
longmx
clc
rtl and exit back to twilight
End
*-----------------------------------------------------------------------------*
FadeIn Start
Using MainDATA
php save old processor status register
longi on
shortm
lda #$41 linearize (and turn off) SHR screen
sta >NewVideo
ldx #$01FF
ldy #$03FF
repeat0 lda >Palette0,x copy palettes into buffer
and #$F0
lsr a
lsr a
lsr a
lsr a
sta buffer2,y
dey
lda >Palette0,x
and #$0F
sta buffer2,y
asl a
asl a
asl a
asl a
dey
dex
bpl repeat0
lda #16
sta amount
longm
lda #0 black out all SHR palettes
ldx #$200
zero sta >Palette0-2,x
dex
dex
bne zero
shortm
lda #$C1
sta >NewVideo
fade anop
jsr prepare fade palettes in buffer
jsr fadeIt store buffer data to palettes
dec amount done 16 times yet?
bne fade
quit plp restore old processor status register
rts
prepare ldy #$03FF
repeat lda buffer1,y
clc
adc buffer2,y
sta buffer1,y
dey
bpl repeat
rts
fadeIt anop
waitVBL lda >VBLWait
bpl waitVBL
wait2 lda >VBLWait
bmi wait2
ldx #$01FF
ldy #$03FE
more lda buffer1,y
lsr a
lsr a
lsr a
lsr a
sta temp
lda buffer1+1,y
and #$F0
ora temp
sta >Palette0,x
dey
dey
dex
bpl more
rts
End
*-----------------------------------------------------------------------------*
FadeOut Start
Using MainDATA
longi on
php
shortm
lda #$C1
sta >NewVideo
ldx #$01FF
ldy #$03FF
repeat0 lda >Palette0,x
and #$F0
sta buffer1,y
lsr a
lsr a
lsr a
lsr a
sta buffer2,y
dey
lda >Palette0,x
and #$0F
sta buffer2,y
asl a
asl a
asl a
asl a
sta buffer1,y
dey
dex
bpl repeat0
lda #16
sta amount
fade jsr prepare
jsr fadeIt
dec amount
bne fade
quit lda #$41
sta >NewVideo
plp
rts
prepare ldy #$03FF
repeat lda buffer1,y
sec
sbc buffer2,y
sta buffer1,y
dey
bpl repeat
rts
fadeIt anop
waitVBL lda >VBLWait
bpl waitVBL
wait2 lda >VBLWait
bmi wait2
ldx #$01FF
ldy #$03FE
more lda buffer1,y
lsr a
lsr a
lsr a
lsr a
sta temp
lda buffer1+1,y
and #$F0
ora temp
sta >Palette0,x
dey
dey
dex
bpl more
rts
End
*-----------------------------------------------------------------------------*
MainDATA Data
buffer1 ds $400
buffer2 ds $400
OrgPalette ds $200
temp ds 2
amount ds 2
End
*-----------------------------------------------------------------------------*

View File

@ -0,0 +1,111 @@
mcopy fader.mac
keep fader.d
copy :jim4:dya:twilight:t2common.equ
copy 2:ainclude:e16.memory
*-----------------------------------------------------------------------------*
*debugSymbols gequ $BAD ; Put in debugging symbols ?
*-----------------------------------------------------------------------------*
* Fader! V1.0b1- Unknown.: Original version - by Jim R Maricondo.
* V1.0b2- 05/10/92: Updated for Generation 2 Module Format. (d31)
* V1.0b3- 05/14/92: Updated to use new T2ModuleFlags bits. (d32)
*
* Fade screen out. Wait until user activity. Fade screen in.
*
* Inputs:
*
* |previous contents|
* |-----------------|
* | T2Result | Long - Result space. (currently reserved)
* |-----------------|
* | T2Message | Word - Action to perform.
* |-----------------|
* | T2data1 | Long - Action specific input.
* |-----------------|
* | T2data2 | Long - Action specific input.
* |-----------------|
* | rtlAddr | 3 bytes - Return address.
* |-----------------|
*
* Outputs:
*
* |previous contents|
* |-----------------|
* | T2Result | Long - Result space. (reserved at this time)
* |-----------------|
* | rtlAddr | 3 bytes - Return address.
* |-----------------|
*
Fader Start
kind $1000 ; no special memory
debug 'Fader'
aif t:debugSymbols="G",.begin
mnote '## Note - Debug Symbols: OFF'
ago .jet
.begin
mnote '## Note - Debug Symbols: ON'
.jet
DefineStack
dpageptr word
dbank byte
rtlAddr block 3
T2data2 long
T2data1 long
T2message word
T2result long
phb
phd
tsc
tcd
lda <T2Message ; Get which setup procedure to call.
cmp #BlankT2
bne notSupported
lda CLOCKCTL
and #$FFF0
sta CLOCKCTL
again lda [T2data1] ; movePtr
beq again
; LongResult
; PushLong #ErrLen
; pei <T2Data2+2 ; memory ID
; PushWord #attrLocked+attrNoCross+attrNoSpec
; PushLong #0
; _NewHandle
; PullLong <T2Result
;
; PushLong #ErrMsg
; pei <T2Result+2
; pei <T2Result
; PushLong #ErrLen
; _PtrToHand
notSupported anop
pld
plb
lda 1,s
sta 1+10,s
lda 2,s
sta 2+10,s
tsc
clc
adc #10
tcs
clc
rtl
;ErrMsg dc c'Attention: Foreground Fader Error!',h'0d'
; dc c'Unable to load ATF file! ($0039)',h'00'
;ErrEnd anop
;ErrLen equ ErrEnd-ErrMsg
End
*-----------------------------------------------------------------------------*

View File

@ -0,0 +1,259 @@
*-----------------------------------------------------------------------------*
! Twilight II Fader Module. !
! !
! By Jim Maricondo. !
! !
! Copyright (c) 1991 Jim Maricondo. All rights reserved. !
*-----------------------------------------------------------------------------*
mcopy fader.mac
absaddr on
*-----------------------------------------------------------------------------*
PALETTES gequ >$E19E00
CLOCKCTL gequ >$E0C034 border color / rtc register
NEWVIDEO gequ >$E0C029
RDVBLBAR gequ >$E0C019 bit 7 = 1 if not VBL
TBCOLOR gequ >$E0C022
bordercol gequ <0 user's original border color
textcol gequ bordercol+2 user's original text/background colors
*-----------------------------------------------------------------------------*
Fader 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
lda TBCOLOR
sta textcol
lda NEWVIDEO
ora #$40
sta NEWVIDEO
longmx
ldx #$200-2 save original screen colors
copy01 lda PALETTES,x
sta |OrgPalette,x
dex
dex
bpl copy01
jsr FadeOut fade out screen
DefineStack
oldDirectPage word
oldBank byte
returnAddress block 3
MasterID word
MovePtr long
ourPathname long
phd wait for user activity
tsc
tcd
getAction lda [MovePtr]
beq getAction
pld
jsr FadeIn fade back in the original picture
plb restore caller's dbr
lda 2,s transfer rtl up stack
sta 2+10,s
lda 1,s
sta 1+10,s
tsc Remove input paramaters
clc
adc #10 (MasterID+MovePtr+TextPtr)
tcs
shortm restore user's display colors
lda CLOCKCTL
and #$F0
ora bordercol
sta CLOCKCTL
lda textcol
sta TBCOLOR
longmx
clc
rtl and exit back to twilight
End
*-----------------------------------------------------------------------------*
FadeIn Start
Using MainDATA
php save old processor status register
longi on
shortm
ldx #$01FF
ldy #$03FF
repeat0 lda |OrgPalette,x copy palettes into buffer
and #$F0
lsr a
lsr a
lsr a
lsr a
sta buffer2,y
dey
lda |OrgPalette,x
and #$0F
sta buffer2,y
asl a
asl a
asl a
asl a
dey
dex
bpl repeat0
lda #16
sta amount
longm
lda #0 black out all SHR palettes
ldx #$200
zero sta PALETTES-2,x
dex
dex
bne zero
shortm
fade anop
jsr prepare fade palettes in buffer
jsr fadeIt store buffer data to palettes
dec amount done 16 times yet?
bne fade
quit plp restore old processor status register
rts
prepare ldy #$03FF
repeat lda buffer1,y
clc
adc buffer2,y
sta buffer1,y
dey
bpl repeat
rts
fadeIt anop
w1 lda RDVBLBAR
bmi w1
w2 lda RDVBLBAR
bpl w2
ldx #$01FF
ldy #$03FE
more lda buffer1,y
lsr a
lsr a
lsr a
lsr a
sta temp
lda buffer1+1,y
and #$F0
ora temp
sta PALETTES,x
dey
dey
dex
bpl more
rts
End
*-----------------------------------------------------------------------------*
FadeOut Start
Using MainDATA
longi on
php
shortm
ldx #$01FF
ldy #$03FF
repeat0 lda PALETTES,x
and #$F0
sta buffer1,y
lsr a
lsr a
lsr a
lsr a
sta buffer2,y
dey
lda PALETTES,x
and #$0F
sta buffer2,y
asl a
asl a
asl a
asl a
sta buffer1,y
dey
dex
bpl repeat0
lda #16
sta amount
fade jsr prepare
jsr fadeIt
dec amount
bne fade
quit anop
plp
rts
prepare ldy #$03FF
repeat lda buffer1,y
sec
sbc buffer2,y
sta buffer1,y
dey
bpl repeat
rts
fadeIt anop
w1 lda RDVBLBAR
bmi w1
w2 lda RDVBLBAR
bpl w2
ldx #$01FF
ldy #$03FE
more lda buffer1,y
lsr a
lsr a
lsr a
lsr a
sta temp
lda buffer1+1,y
and #$F0
ora temp
sta PALETTES,x
dey
dey
dex
bpl more
rts
End
*-----------------------------------------------------------------------------*
MainDATA Data
buffer1 ds $400
buffer2 ds $400
OrgPalette ds $200
temp ds 2
amount ds 2
End
*-----------------------------------------------------------------------------*

View File

@ -0,0 +1,92 @@
mcopy fader.mac
keep fader.d
copy ..t2common.equ
*-----------------------------------------------------------------------------*
*debugSymbols gequ $BAD ; Put in debugging symbols ?
*-----------------------------------------------------------------------------*
* Fader! V1.0b1- Unknown.: Original version - by Jim R Maricondo.
* V1.0b2- 05/10/92: Updated for Generation 2 Module Format. (d31)
* V1.0b3- 05/14/92: Updated to use new T2ModuleFlags bits. (d32)
*
* Fade screen out. Wait until user activity. Fade screen in.
*
* Inputs:
*
* |previous contents|
* |-----------------|
* | T2Result | Long - Result space. (currently reserved)
* |-----------------|
* | T2Message | Word - Action to perform.
* |-----------------|
* | T2data1 | Long - Action specific input.
* |-----------------|
* | T2data2 | Long - Action specific input.
* |-----------------|
* | rtlAddr | 3 bytes - Return address.
* |-----------------|
*
* Outputs:
*
* |previous contents|
* |-----------------|
* | T2Result | Long - Result space. (reserved at this time)
* |-----------------|
* | rtlAddr | 3 bytes - Return address.
* |-----------------|
*
Fader Start
kind $1000 ; no special memory
debug 'Fader'
mnote ''
aif t:debugSymbols="G",.begin
mnote '## Note - Debug Symbols: OFF'
ago .jet
.begin
mnote '## Note - Debug Symbols: ON'
.jet
DefineStack
dpageptr word
dbank byte
rtlAddr block 3
T2data2 long
T2data1 long
T2message word
T2result long
phb
phd
tsc
tcd
lda <T2Message ; Get which setup procedure to call.
cmp #BlankT2
bne notSupported
lda CLOCKCTL
and #$FFF0
sta CLOCKCTL
again lda [T2data1] ; movePtr
beq again
notSupported anop
pld
plb
lda 1,s
sta 1+10,s
lda 2,s
sta 2+10,s
tsc
clc
adc #10
tcs
clc
rtl
End
*-----------------------------------------------------------------------------*

View File

@ -0,0 +1,118 @@
mcopy fader.mac
keep fader.d
copy :jim4:dya:twilight:t2common.equ
copy 2:ainclude:e16.memory
*-----------------------------------------------------------------------------*
*debugSymbols gequ $BAD ; Put in debugging symbols ?
*-----------------------------------------------------------------------------*
* Fader! V1.0b1- Unknown.: Original version - by Jim R Maricondo.
* V1.0b2- 05/10/92: Updated for Generation 2 Module Format. (d31)
* V1.0b3- 05/14/92: Updated to use new T2ModuleFlags bits. (d32)
*
* Fade screen out. Wait until user activity. Fade screen in.
*
* Inputs:
*
* |previous contents|
* |-----------------|
* | T2Result | Long - Result space. (currently reserved)
* |-----------------|
* | T2Message | Word - Action to perform.
* |-----------------|
* | T2data1 | Long - Action specific input.
* |-----------------|
* | T2data2 | Long - Action specific input.
* |-----------------|
* | rtlAddr | 3 bytes - Return address.
* |-----------------|
*
* Outputs:
*
* |previous contents|
* |-----------------|
* | T2Result | Long - Result space. (reserved at this time)
* |-----------------|
* | rtlAddr | 3 bytes - Return address.
* |-----------------|
*
Fader Start
kind $1000 ; no special memory
debug 'Fader'
aif t:debugSymbols="G",.begin
mnote '## Note - Debug Symbols: OFF'
ago .jet
.begin
mnote '## Note - Debug Symbols: ON'
.jet
DefineStack
dpageptr word
dbank byte
rtlAddr block 3
T2data2 long
T2data1 long
T2message word
T2result long
phb
phd
tsc
tcd
lda <T2Message ; Get which setup procedure to call.
; cmp #LoadSetupT2
; bne notLS
; brk $cf
; brl notSupported
;
notLS cmp #BlankT2
bne notSupported
; lda CLOCKCTL
; and #$FFF0
; sta CLOCKCTL
~SetCursor #$FE3B5D
again lda [T2data1] ; movePtr
beq again
; LongResult
; PushLong #ErrLen
; pei <T2Data2+2 ; memory ID
; PushWord #attrLocked+attrNoCross+attrNoSpec
; PushLong #0
; _NewHandle
; PullLong <T2Result
; PushLong #ErrMsg
; pei <T2Result+2
; pei <T2Result
; PushLong #ErrLen
; _PtrToHand
notSupported anop
pld
plb
lda 1,s
sta 1+10,s
lda 2,s
sta 2+10,s
tsc
clc
adc #10
tcs
clc
rtl
;ErrMsg dc c'Attention: Foreground Fader Error!',h'0d'
; dc c'Unable to load ATF file! ($0039)',h'00'
;ErrEnd anop
;ErrLen equ ErrEnd-ErrMsg
End
*-----------------------------------------------------------------------------*

View File

@ -0,0 +1,116 @@
mcopy fader.mac
keep fader.d
copy :jim4:dya:twilight:t2common.equ
copy 2:ainclude:e16.memory
*-----------------------------------------------------------------------------*
*debugSymbols gequ $BAD ; Put in debugging symbols ?
*-----------------------------------------------------------------------------*
* Fader! V1.0b1- Unknown.: Original version - by Jim R Maricondo.
* V1.0b2- 05/10/92: Updated for Generation 2 Module Format. (d31)
* V1.0b3- 05/14/92: Updated to use new T2ModuleFlags bits. (d32)
*
* Fade screen out. Wait until user activity. Fade screen in.
*
* Inputs:
*
* |previous contents|
* |-----------------|
* | T2Result | Long - Result space. (currently reserved)
* |-----------------|
* | T2Message | Word - Action to perform.
* |-----------------|
* | T2data1 | Long - Action specific input.
* |-----------------|
* | T2data2 | Long - Action specific input.
* |-----------------|
* | rtlAddr | 3 bytes - Return address.
* |-----------------|
*
* Outputs:
*
* |previous contents|
* |-----------------|
* | T2Result | Long - Result space. (reserved at this time)
* |-----------------|
* | rtlAddr | 3 bytes - Return address.
* |-----------------|
*
Fader Start
kind $1000 ; no special memory
debug 'Fader'
aif t:debugSymbols="G",.begin
mnote '## Note - Debug Symbols: OFF'
ago .jet
.begin
mnote '## Note - Debug Symbols: ON'
.jet
DefineStack
dpageptr word
dbank byte
rtlAddr block 3
T2data2 long
T2data1 long
T2message word
T2result long
phb
phd
tsc
tcd
lda <T2Message ; Get which setup procedure to call.
; cmp #LoadSetupT2
; bne notLS
; brk $cf
; brl notSupported
;
notLS cmp #BlankT2
bne notSupported
lda CLOCKCTL
and #$FFF0
sta CLOCKCTL
;again lda [T2data1] ; movePtr
; beq again
LongResult
PushLong #ErrLen
pei <T2Data2+2 ; memory ID
PushWord #attrLocked+attrNoCross+attrNoSpec
PushLong #0
_NewHandle
PullLong <T2Result
PushLong #ErrMsg
pei <T2Result+2
pei <T2Result
PushLong #ErrLen
_PtrToHand
notSupported anop
pld
plb
lda 1,s
sta 1+10,s
lda 2,s
sta 2+10,s
tsc
clc
adc #10
tcs
clc
rtl
ErrMsg dc c'Attention: Foreground Fader Error!',h'0d'
dc c'Unable to load ATF file! ($0039)',h'00'
ErrEnd anop
ErrLen equ ErrEnd-ErrMsg
End
*-----------------------------------------------------------------------------*