mirror of
https://github.com/callapple/Twilight_II.git
synced 2024-06-02 20:41:35 +00:00
AV 202005 - First upload of v2
This is the first upload of Jim Maricondo's Twilight II v2.0 source code files
This commit is contained in:
parent
1d9a32c1bd
commit
3b2cd5f92c
102
source/orca/Libraries/AInclude/E16.CCCP
Normal file
102
source/orca/Libraries/AInclude/E16.CCCP
Normal file
|
@ -0,0 +1,102 @@
|
|||
; File: E16.CCCP
|
||||
;
|
||||
; By: Josef W. Wankerl
|
||||
;
|
||||
; Copyright EGO Systems 1993
|
||||
; All Rights Reserved
|
||||
;
|
||||
|
||||
; SendRequest codes sent to Cool Cursor (target = "EGO Systems~Cool Cursor~")
|
||||
cccpAreYouThere gequ $8000
|
||||
cccpGetActive gequ $8001
|
||||
cccpSetActive gequ $8002
|
||||
cccpGetSpeed gequ $8003
|
||||
cccpSetSpeed gequ $8004
|
||||
cccpGetAppPriority gequ $8005
|
||||
cccpSetAppPriority gequ $8006
|
||||
cccpGetSafe gequ $8007
|
||||
cccpSetSafe gequ $8008
|
||||
cccpGetCursorList gequ $8009
|
||||
cccpSetCursorList gequ $800A
|
||||
cccpGetCursor gequ $800B
|
||||
cccpSetCursor gequ $800C
|
||||
cccpLoadCursor gequ $800D
|
||||
cccpDisposeCursor gequ $800E
|
||||
cccpAnimateCursor gequ $800F
|
||||
cccpGetCursorType gequ $8010
|
||||
|
||||
; *****************************************************************************
|
||||
|
||||
; Cool Cursor constants
|
||||
|
||||
cccpMode320 gequ $0000
|
||||
cccpMode640 gequ $0001
|
||||
|
||||
cccpPointer gequ $0000
|
||||
cccpWait gequ $0001
|
||||
cccpIBeam gequ $0002
|
||||
cccpCustom gequ $0003
|
||||
cccpOther gequ $0004
|
||||
|
||||
rSmooth gequ $0001
|
||||
|
||||
cccpVersionError gequ $CCC9
|
||||
|
||||
; *****************************************************************************
|
||||
|
||||
; Cool Cursor dataIn structure offsets
|
||||
|
||||
occcpActiveFlagSetActiveIn gequ $0000
|
||||
|
||||
occcpSpeedSetSpeedIn gequ $0000
|
||||
|
||||
occcpPrioritySetAppPriorityIn gequ $0000
|
||||
|
||||
occcpSpeedSetSafeIn gequ $0000
|
||||
|
||||
occcpCursorListHandleSetCursorListIn gequ $0000
|
||||
|
||||
occcpCursorModeGetCursorIn gequ $0000
|
||||
|
||||
occcpCursorModeSetCursorIn gequ $0000
|
||||
occcpMasterHandleSetCursorIn gequ occcpCursorModeSetCursorIn+2
|
||||
|
||||
occcpPathnamePtrLoadCursorIn gequ $0000
|
||||
occcpCursorStartIDLoadCursorIn gequ occcpPathnamePtrLoadCursorIn+4
|
||||
|
||||
occcpMasterHandleDisposeCursorIn gequ $0000
|
||||
|
||||
occcpMasterHandleAnimateCursorIn gequ $0000
|
||||
|
||||
; *****************************************************************************
|
||||
|
||||
; Cool Cursor dataOut structure offsets
|
||||
|
||||
orecvCountAreYouThereOut gequ $0000
|
||||
occcpIDAreYouThereOut gequ orecvCountAreYouThereOut+2
|
||||
occcpVersionAreYouThereOut gequ occcpIDAreYouThereOut+2
|
||||
|
||||
orecvCountGetActiveOut gequ $0000
|
||||
occcpActiveFlagGetActiveOut gequ orecvCountGetActiveOut+2
|
||||
|
||||
orecvCountGetSpeedOut gequ $0000
|
||||
occcpSpeedGetSpeedOut gequ orecvCountGetSpeedOut+2
|
||||
|
||||
orecvCountGetAppPriorityOut gequ $0000
|
||||
occcpPriorityGetAppPriorityOut gequ orecvCountGetAppPriorityOut+2
|
||||
|
||||
orecvCountGetSafeOut gequ $0000
|
||||
occcpSafeFlagGetSafeOut gequ orecvCountGetSafeOut+2
|
||||
|
||||
orecvCountGetCursorListOut gequ $0000
|
||||
occcpCursorListHandleGetCursorListOut gequ orecvCountGetCursorListOut+2
|
||||
|
||||
orecvCountGetCursorOut gequ $0000
|
||||
occcpMasterHandleGetCursorOut gequ orecvCountGetCursorOut+2
|
||||
|
||||
orecvCountLoadCursorOut gequ $0000
|
||||
occcpErrorLoadCursorOut gequ orecvCountLoadCursorOut+2
|
||||
occcpMasterHandleLoadCursorOut gequ occcpErrorLoadCursorOut+2
|
||||
|
||||
orecvCountGetCursorStateOut gequ $0000
|
||||
occcpCursorTypeGetCursorStateOut gequ orecvCountGetCursorStateOut+2
|
81
source/orca/Libraries/AInclude/E16.Locator
Normal file
81
source/orca/Libraries/AInclude/E16.Locator
Normal file
|
@ -0,0 +1,81 @@
|
|||
; File: E16.Locator
|
||||
;
|
||||
;
|
||||
; Copyright Apple Computer, Inc. 1986-92
|
||||
; All Rights Reserved
|
||||
;
|
||||
;
|
||||
toolNotFoundErr GEQU $0001
|
||||
funcNotFoundErr GEQU $0002
|
||||
sysStrtMtErr GEQU $0100 ; can't mount system startup volume
|
||||
tlBadRecFlag GEQU $0103 ; StartStop record invalid
|
||||
tlCantLoad GEQU $0104 ; A tool cannot be loaded
|
||||
toolVersionErr GEQU $0110
|
||||
messNotFoundErr GEQU $0111
|
||||
messageOvfl GEQU $0112 ; No message numbers available
|
||||
nameTooLong GEQU $0113 ; Message name too long
|
||||
reqNotAccepted GEQU $0120 ;SendRequest request not accepted
|
||||
duplicateName GEQU $0121 ;duplicate name for AcceptRequests
|
||||
invalidSendRequest GEQU $0122 ;bad combo of target and sendHow
|
||||
|
||||
fileInfoType GEQU $0001 ; Message type parameter
|
||||
addMessage GEQU $0001 ; action parameter
|
||||
getMessage GEQU $0002 ; action parameter
|
||||
deleteMessage GEQU $0003 ; action parameter
|
||||
fileInfoTypeGS GEQU $0011 ; Message Type parameter
|
||||
|
||||
; GetMsgHandle flags values
|
||||
gmhByIndex GEQU 0
|
||||
gmhByType GEQU 1
|
||||
gmhByName GEQU 2
|
||||
|
||||
; SendRequest/AcceptRequests codes
|
||||
systemSaysBeep GEQU $0001 ;used by SysBeep2
|
||||
systemSaysUnknownDisk GEQU $0002 ;used by HandleDiskInsert
|
||||
srqGoAway GEQU $0003
|
||||
srqGetrSoundSample GEQU $0004
|
||||
srqSynchronize GEQU $0005
|
||||
srqPlayrSoundSample GEQU $0006
|
||||
systemSaysNewDeskMsg GEQU $0008
|
||||
systemSaysEjectingDev GEQU $000E
|
||||
systemSaysDeskStartUp GEQU $0502
|
||||
systemSaysDeskShutDown GEQU $0503
|
||||
systemSaysFixedAppleMenu GEQU $051E
|
||||
systemSaysMenuKey GEQU $0F01
|
||||
; AV 202005
|
||||
systemSaysForceUndim GEQU $000D
|
||||
|
||||
; SendRequest sendHow values
|
||||
stopAfterOne GEQU $8000
|
||||
sendToAll GEQU 0
|
||||
sendToName GEQU 1
|
||||
sendToUserID GEQU 2
|
||||
|
||||
; StartUpTools flag bits
|
||||
leaveScreenClean GEQU $0004
|
||||
openResAsAllowed GEQU $0008
|
||||
noResourceMgr GEQU $0010 ;for ShutDownTools, too
|
||||
|
||||
mvReturn GEQU $0001 ; like ok for dialogs
|
||||
mvEscape GEQU $0002 ; like cancel for dialogs
|
||||
sysTool GEQU $0000
|
||||
userTool GEQU $8000
|
||||
|
||||
; offset constants for MessageRec and MessageRecGS
|
||||
omessageNext GEQU 0
|
||||
omessageType GEQU 4
|
||||
omessageData GEQU 6
|
||||
omessagePrintFlag GEQU 6
|
||||
ofileNames GEQU 8
|
||||
|
||||
; offset constants for ToolSpec
|
||||
otoolNumber GEQU 0
|
||||
ominVersion GEQU 2
|
||||
|
||||
; offset constants for StartStopRecord
|
||||
oflags GEQU 0
|
||||
ovideoMode GEQU 2
|
||||
oresFileID GEQU 4
|
||||
odPageHandle GEQU 6
|
||||
onumTools GEQU 10
|
||||
otheTools GEQU 12
|
1381
source/orca/Libraries/RInclude/Types.rez
Normal file
1381
source/orca/Libraries/RInclude/Types.rez
Normal file
File diff suppressed because it is too large
Load Diff
19
source/twilight/debug.asm
Normal file
19
source/twilight/debug.asm
Normal file
|
@ -0,0 +1,19 @@
|
|||
|
||||
aif t:debugSymbols="G",.begin
|
||||
mnote '## Note - Debug Symbols: OFF'
|
||||
ago .jet
|
||||
.begin
|
||||
mnote '## Note - Debug Symbols: ON'
|
||||
.jet
|
||||
aif t:debugBreaks="G",.begin2
|
||||
mnote '## Note - Debugging Breaks: OFF'
|
||||
ago .jet2
|
||||
.begin2
|
||||
mnote '## Note - Debugging Breaks: ON'
|
||||
.jet2
|
||||
aif t:debugCode="G",.begin3
|
||||
mnote '## Note - Other Debug Code: OFF'
|
||||
ago .jet3
|
||||
.begin3
|
||||
mnote '## Note - Other Debug Code: ON'
|
||||
.jet3
|
1580
source/twilight/twilight/beat.asm
Normal file
1580
source/twilight/twilight/beat.asm
Normal file
File diff suppressed because it is too large
Load Diff
450
source/twilight/twilight/beat.mac
Normal file
450
source/twilight/twilight/beat.mac
Normal file
|
@ -0,0 +1,450 @@
|
|||
MACRO
|
||||
&lab jnel &BP
|
||||
&lab beq *+5
|
||||
&lab._brl brl &BP
|
||||
MEND
|
||||
MACRO
|
||||
&lab pulllong &addr1,&addr2
|
||||
&lab ANOP
|
||||
AIF C:&addr1=0,.a
|
||||
AIF C:&addr2=0,.b
|
||||
LCLC &C
|
||||
&C AMID &addr1,1,1
|
||||
AIF "&C"="[",.zeropage
|
||||
pullword &addr1
|
||||
sta &addr2
|
||||
pullword &addr1+2
|
||||
sta &addr2+2
|
||||
MEXIT
|
||||
.a
|
||||
pullword
|
||||
pullword
|
||||
MEXIT
|
||||
.b
|
||||
pullword &addr1
|
||||
pullword &addr1+2
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&addr2
|
||||
pullword &addr1,y
|
||||
ldy #&addr2+2
|
||||
pullword &addr1,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pullword &SYSOPR
|
||||
&lab ANOP
|
||||
pla
|
||||
AIF C:&SYSOPR=0,.end
|
||||
sta &SYSOPR
|
||||
.end
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushlong &addr,&offset
|
||||
&lab ANOP
|
||||
LCLC &C
|
||||
LCLC &REST
|
||||
&C AMID &addr,1,1
|
||||
AIF "&C"="#",.immediate
|
||||
AIF "&C"="[",.zeropage
|
||||
AIF C:&offset=0,.nooffset
|
||||
AIF "&offset"="s",.stack
|
||||
pushword &addr+2,&offset
|
||||
pushword &addr,&offset
|
||||
MEXIT
|
||||
.nooffset
|
||||
pushword &addr+2
|
||||
pushword &addr
|
||||
MEXIT
|
||||
.immediate
|
||||
&REST AMID &addr,2,L:&addr-1
|
||||
dc I1'$F4',I2'(&REST)|-16'
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEXIT
|
||||
.stack
|
||||
pushword &addr+2,s
|
||||
pushword &addr+2,s
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&offset+2
|
||||
pushword &addr,y
|
||||
ldy #&offset
|
||||
pushword &addr,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushword &SYSOPR
|
||||
&lab ANOP
|
||||
AIF C:&SYSOPR=0,.b
|
||||
LCLC &C
|
||||
&C AMID "&SYSOPR",1,1
|
||||
AIF ("&C"="#").AND.(S:LONGA),.immediate
|
||||
lda &SYSOPR
|
||||
pha
|
||||
MEXIT
|
||||
.b
|
||||
pha
|
||||
MEXIT
|
||||
.immediate
|
||||
LCLC &REST
|
||||
LCLA &BL
|
||||
&BL ASEARCH "&SYSOPR"," ",1
|
||||
AIF &BL>0,.a
|
||||
&BL SETA L:&SYSOPR+1
|
||||
.a
|
||||
&REST AMID "&SYSOPR",2,&BL-2
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEND
|
||||
MACRO
|
||||
&lab 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
|
||||
&lab killLdp
|
||||
&lab pld
|
||||
ply
|
||||
ply
|
||||
MEND
|
||||
MACRO
|
||||
&lab makeDP
|
||||
&lab phd
|
||||
tsc
|
||||
tcd
|
||||
MEND
|
||||
MACRO
|
||||
&LAB JEQ &BP
|
||||
&LAB BNE *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
MACRO
|
||||
&LAB JLT &BP
|
||||
&LAB BGE *+5
|
||||
BRL &BP
|
||||
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 _SendRequest
|
||||
&lab ldx #$1c01
|
||||
jsl $E10000
|
||||
mend
|
||||
MACRO
|
||||
&LAB JNE &BP
|
||||
&LAB BEQ *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
MACRO
|
||||
&LAB JCS &BP
|
||||
&LAB BCC *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
macro
|
||||
&lab ~SysBeep2 &beepkind
|
||||
&lab ph2 &beepkind
|
||||
Tool $3803
|
||||
mend
|
||||
macro
|
||||
&lab ~Button &buttonNum
|
||||
&lab WordResult
|
||||
ph2 &buttonNum
|
||||
Tool $0D06
|
||||
mend
|
||||
macro
|
||||
&lab ~GetMouse &mouseLocPtr
|
||||
&lab ph4 &mouseLocPtr
|
||||
Tool $0C06
|
||||
mend
|
||||
macro
|
||||
&lab ~ReadMouse
|
||||
&lab WordResult
|
||||
WordResult
|
||||
WordResult
|
||||
Tool $1703
|
||||
mend
|
||||
macro
|
||||
&lab ~LocalToGlobal &resultPointPtr
|
||||
&lab ph4 &resultPointPtr
|
||||
Tool $8404
|
||||
mend
|
||||
macro
|
||||
&lab ~GetSysBar
|
||||
&lab LongResult
|
||||
Tool $110F
|
||||
mend
|
||||
MACRO
|
||||
&lab _SetCursor
|
||||
&lab ldx #$8E04
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetCursorAdr
|
||||
&lab LongResult
|
||||
Tool $8F04
|
||||
mend
|
||||
macro
|
||||
&lab ~SetCursor &cursorPtr
|
||||
&lab ph4 &cursorPtr
|
||||
Tool $8E04
|
||||
mend
|
||||
macro
|
||||
&lab WordResult &zero
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zero
|
||||
phd
|
||||
mexit
|
||||
.zero
|
||||
&lab pea $0000
|
||||
mend
|
||||
macro
|
||||
&lab LongResult &zeros
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zeros
|
||||
phd
|
||||
phd
|
||||
mexit
|
||||
.zeros
|
||||
pea $0000
|
||||
pea $0000
|
||||
mend
|
||||
macro
|
||||
&lab ph2 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid "&addr",1,1
|
||||
aif "&char"="@",.accumulator
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif C:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.accumulator
|
||||
pha
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea &addr
|
||||
mexit
|
||||
.zeropage
|
||||
aif C:&offset<>0,.zeroPageOff
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOff
|
||||
aif "&offset"="X",.zeroPageReg
|
||||
aif "&offset"="Y",.ze
|
||||
oPageReg
|
||||
aif "&offset"="x",.zeroPageReg
|
||||
aif "&offset"="y",.zeroPageReg
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageReg
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mend
|
||||
macro
|
||||
&lab ph4 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &addr,1,1
|
||||
aif "&char"="@",.registers
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif c:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
.yesoffset
|
||||
lda &addr+2,&offset
|
||||
pha
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr+2
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr+2,s
|
||||
pha
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.registers
|
||||
phy
|
||||
phx
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea +(&addr)|-16
|
||||
pea &addr
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr+2
|
||||
pei &addr
|
||||
mexit
|
||||
.zeroPage
|
||||
aif C:&offset<>0,.zeroPageOffset
|
||||
ldy #2
|
||||
lda &addr,y
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOffset
|
||||
aif "&offset"="X",.zeroPageRegX
|
||||
aif "&offset"="Y",.zeroPageRegY
|
||||
aif "&offset"="x",.zeroPageRegX
|
||||
aif "&offset"="y",.zeroPageRegY
|
||||
ldy #&offset+2
|
||||
lda &addr,y
|
||||
pha
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageRegX
|
||||
lda &addr,&offset
|
||||
tay
|
||||
inx
|
||||
inx
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phy
|
||||
mexit
|
||||
.zeroPageRegY
|
||||
lda &addr,&offset
|
||||
tax
|
||||
iny
|
||||
iny
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phx
|
||||
mend
|
||||
macro
|
||||
&lab ~SchAddTask &taskPtr
|
||||
&lab WordResult
|
||||
ph4 &taskPtr
|
||||
Tool $0907
|
||||
mend
|
||||
macro
|
||||
&lab ~ReadKeyMicroMemory &dataOutPtr,&DataInPtr,&adbCommand
|
||||
&lab ph4 &dataOutPtr
|
||||
ph4 &dataInPtr
|
||||
ph2 &adbCommand
|
||||
Tool $0B09
|
||||
mend
|
||||
macro
|
||||
&lab ~ReadBParam ¶mRefNum
|
||||
&lab WordResult
|
||||
ph2 ¶mRefNum
|
||||
Tool $0C03
|
||||
mend
|
||||
MACRO
|
||||
&lab mvw &num1,&num2
|
||||
&lab lda &num1
|
||||
sta &num2
|
||||
MEND
|
||||
macro
|
||||
&lab Tool &number
|
||||
&lab ldx #&number
|
||||
jsl $E10000
|
||||
mend
|
||||
MACRO
|
||||
&lab ename
|
||||
&lab entry
|
||||
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 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 mvl &srcLong,&dstLong
|
||||
&lab ANOP
|
||||
LCLC &C
|
||||
&C AMID &srcLong,1,1
|
||||
AIF "&C"="#",.direct
|
||||
lda &srcLong
|
||||
sta &dstLong
|
||||
lda &srcLong+2
|
||||
sta &dstLong+2
|
||||
MEXIT
|
||||
.direct
|
||||
lda &srcLong
|
||||
sta &dstLong
|
||||
lda &srcLong|-16
|
||||
sta &dstLong+2
|
||||
MEND
|
||||
MACRO
|
||||
&lab debugBorder
|
||||
&lab anop
|
||||
aif t:debugSymbols="G",.begin
|
||||
MEXIT
|
||||
.begin
|
||||
shortm
|
||||
lda $e1c034
|
||||
inc a
|
||||
sta $e1c034
|
||||
longm
|
||||
MEND
|
1873
source/twilight/twilight/blank.asm
Normal file
1873
source/twilight/twilight/blank.asm
Normal file
File diff suppressed because it is too large
Load Diff
733
source/twilight/twilight/blank.mac
Normal file
733
source/twilight/twilight/blank.mac
Normal file
|
@ -0,0 +1,733 @@
|
|||
MACRO
|
||||
&lab pulllong &addr1,&addr2
|
||||
&lab ANOP
|
||||
AIF C:&addr1=0,.a
|
||||
AIF C:&addr2=0,.b
|
||||
LCLC &C
|
||||
&C AMID &addr1,1,1
|
||||
AIF "&C"="[",.zeropage
|
||||
pullword &addr1
|
||||
sta &addr2
|
||||
pullword &addr1+2
|
||||
sta &addr2+2
|
||||
MEXIT
|
||||
.a
|
||||
pullword
|
||||
pullword
|
||||
MEXIT
|
||||
.b
|
||||
pullword &addr1
|
||||
pullword &addr1+2
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&addr2
|
||||
pullword &addr1,y
|
||||
ldy #&addr2+2
|
||||
pullword &addr1,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pullword &SYSOPR
|
||||
&lab ANOP
|
||||
pla
|
||||
AIF C:&SYSOPR=0,.end
|
||||
sta &SYSOPR
|
||||
.end
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushlong &addr,&offset
|
||||
&lab ANOP
|
||||
LCLC &C
|
||||
LCLC &REST
|
||||
&C AMID &addr,1,1
|
||||
AIF "&C"="#",.immediate
|
||||
AIF "&C"="[",.zeropage
|
||||
AIF C:&offset=0,.nooffset
|
||||
AIF "&offset"="s",.stack
|
||||
pushword &addr+2,&offset
|
||||
pushword &addr,&offset
|
||||
MEXIT
|
||||
.nooffset
|
||||
pushword &addr+2
|
||||
pushword &addr
|
||||
MEXIT
|
||||
.immediate
|
||||
&REST AMID &addr,2,L:&addr-1
|
||||
dc I1'$F4',I2'(&REST)|-16'
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEXIT
|
||||
.stack
|
||||
pushword &addr+2,s
|
||||
pushword &addr+2,s
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&offset+2
|
||||
pushword &addr,y
|
||||
ldy #&offset
|
||||
pushword &addr,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushword &SYSOPR
|
||||
&lab ANOP
|
||||
AIF C:&SYSOPR=0,.b
|
||||
LCLC &C
|
||||
&C AMID "&SYSOPR",1,1
|
||||
AIF ("&C"="#").AND.(S:LONGA),.immediate
|
||||
lda &SYSOPR
|
||||
pha
|
||||
MEXIT
|
||||
.b
|
||||
pha
|
||||
MEXIT
|
||||
.immediate
|
||||
LCLC &REST
|
||||
LCLA &BL
|
||||
&BL ASEARCH "&SYSOPR"," ",1
|
||||
AIF &BL>0,.a
|
||||
&BL SETA L:&SYSOPR+1
|
||||
.a
|
||||
&REST AMID "&SYSOPR",2,&BL-2
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEND
|
||||
MACRO
|
||||
&lab 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
|
||||
&lab killLdp
|
||||
&lab pld
|
||||
ply
|
||||
ply
|
||||
MEND
|
||||
MACRO
|
||||
&lab makeDP
|
||||
&lab phd
|
||||
tsc
|
||||
tcd
|
||||
MEND
|
||||
MACRO
|
||||
&LAB JEQ &BP
|
||||
&LAB BNE *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetPort
|
||||
&lab LongResult
|
||||
Tool $1C04
|
||||
mend
|
||||
macro
|
||||
&lab Tool &number
|
||||
&lab ldx #&number
|
||||
jsl $E10000
|
||||
mend
|
||||
MACRO
|
||||
&lab 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 _SendRequest
|
||||
&lab ldx #$1c01
|
||||
jsl $E10000
|
||||
mend
|
||||
MACRO
|
||||
&LAB JNE &BP
|
||||
&LAB BEQ *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
MACRO
|
||||
&LAB JCS &BP
|
||||
&LAB BCC *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
macro
|
||||
&lab ~SysBeep2 &beepkind
|
||||
&lab ph2 &beepkind
|
||||
Tool $3803
|
||||
mend
|
||||
macro
|
||||
&lab WordResult &zero
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zero
|
||||
phd
|
||||
mexit
|
||||
.zero
|
||||
&lab pea $0000
|
||||
mend
|
||||
macro
|
||||
&lab LongResult &zeros
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zeros
|
||||
phd
|
||||
phd
|
||||
mexit
|
||||
.zeros
|
||||
pea $0000
|
||||
pea $0000
|
||||
mend
|
||||
macro
|
||||
&lab ph2 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid "&addr",1,1
|
||||
aif "&char"="@",.accumulator
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif C:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.accumulator
|
||||
pha
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea &addr
|
||||
mexit
|
||||
.zeropage
|
||||
aif C:&offset<>0,.zeroPageOff
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOff
|
||||
aif "&offset"="X",.zeroPageReg
|
||||
aif "&offset"="Y",.ze
|
||||
oPageReg
|
||||
aif "&offset"="x",.zeroPageReg
|
||||
aif "&offset"="y",.zeroPageReg
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageReg
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mend
|
||||
MACRO
|
||||
&lab mvw &num1,&num2
|
||||
&lab lda &num1
|
||||
sta &num2
|
||||
MEND
|
||||
MACRO
|
||||
&lab mvl &srcLong,&dstLong
|
||||
&lab ANOP
|
||||
LCLC &C
|
||||
&C AMID &srcLong,1,1
|
||||
AIF "&C"="#",.direct
|
||||
lda &srcLong
|
||||
sta &dstLong
|
||||
lda &srcLong+2
|
||||
sta &dstLong+2
|
||||
MEXIT
|
||||
.direct
|
||||
lda &srcLong
|
||||
sta &dstLong
|
||||
lda &srcLong|-16
|
||||
sta &dstLong+2
|
||||
MEND
|
||||
MACRO
|
||||
&lab _NewHandle
|
||||
&lab ldx #$0902
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetPort
|
||||
&lab ldx #$1B04
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~FMShutDown
|
||||
&lab Tool $031B
|
||||
mend
|
||||
macro
|
||||
&lab ~FMStatus
|
||||
&lab WordResult 0
|
||||
Tool $061B
|
||||
mend
|
||||
macro
|
||||
&lab ~DisposeHandle &theHandle
|
||||
&lab ph4 &theHandle
|
||||
Tool $1002
|
||||
mend
|
||||
macro
|
||||
&lab ~DrawCString &cString
|
||||
&lab ph4 &cString
|
||||
Tool $A604
|
||||
mend
|
||||
macro
|
||||
&lab ~GetMasterSCB
|
||||
&lab WordResult
|
||||
Tool $1704
|
||||
mend
|
||||
macro
|
||||
&lab ~MoveTo &h,&v
|
||||
&lab ph2 &h
|
||||
ph2 &v
|
||||
Tool $3A04
|
||||
mend
|
||||
macro
|
||||
&lab ~CloseResourceFile &fileID
|
||||
&lab ph2 &fileID
|
||||
Tool $0B1E
|
||||
mend
|
||||
macro
|
||||
&lab ~GetCurResourceFile
|
||||
&lab WordResult
|
||||
Tool $121E
|
||||
mend
|
||||
macro
|
||||
&lab ph4 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &addr,1,1
|
||||
aif "&char"="@",.registers
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif c:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
.yesoffset
|
||||
lda &addr+2,&offset
|
||||
pha
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr+2
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr+2,s
|
||||
pha
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.registers
|
||||
phy
|
||||
phx
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea +(&addr)|-16
|
||||
pea &addr
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr+2
|
||||
pei &addr
|
||||
mexit
|
||||
.zeroPage
|
||||
aif C:&offset<>0,.zeroPageOffset
|
||||
ldy #2
|
||||
lda &addr,y
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOffset
|
||||
aif "&offset"="X",.zeroPageRegX
|
||||
aif "&offset"="Y",.zeroPageRegY
|
||||
aif "&offset"="x",.zeroPageRegX
|
||||
aif "&offset"="y",.zeroPageRegY
|
||||
ldy #&offset+2
|
||||
lda &addr,y
|
||||
pha
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageRegX
|
||||
lda &addr,&offset
|
||||
tay
|
||||
inx
|
||||
inx
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phy
|
||||
mexit
|
||||
.zeroPageRegY
|
||||
lda &addr,&offset
|
||||
tax
|
||||
iny
|
||||
iny
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phx
|
||||
mend
|
||||
MACRO
|
||||
&lab dbrk &num
|
||||
aif t:debugBreaks="G",.begin
|
||||
mexit
|
||||
.begin
|
||||
brk &num
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetCurResourceApp
|
||||
&lab wordresult
|
||||
Tool $141E
|
||||
mend
|
||||
MACRO
|
||||
&lab _SetCurResourceFile
|
||||
&lab ldx #$111E
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~SetCurResourceFile &fileID
|
||||
&lab ph2 &fileID
|
||||
Tool $111E
|
||||
mend
|
||||
MACRO
|
||||
&lab _MoveTo
|
||||
&lab ldx #$3A04
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab QDRect
|
||||
&lab anop
|
||||
&lab._top ds 2
|
||||
&lab._left ds 2
|
||||
&lab._bottom ds 2
|
||||
&lab._right ds 2
|
||||
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 _GetHandleSize
|
||||
&lab ldx #$1802
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _FMStartUp
|
||||
&lab ldx #$021B
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab errorbrk &op
|
||||
&lab anop
|
||||
aif t:debugCode="G",.doit
|
||||
mexit
|
||||
.doit
|
||||
bcc *+4
|
||||
aif c:&op=1,.value
|
||||
brk $BB
|
||||
mexit
|
||||
.value
|
||||
brk &op
|
||||
mend
|
||||
MACRO
|
||||
&lab ename
|
||||
&lab entry
|
||||
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
|
||||
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 LONG
|
||||
&lab equ &DummyPC
|
||||
&DummyPC SETA &DummyPC+4
|
||||
MEND
|
||||
macro
|
||||
&lab ~FindHandle &locationPtr
|
||||
&lab LongResult
|
||||
ph4 &locationPtr
|
||||
Tool $1A02
|
||||
mend
|
||||
MACRO
|
||||
&lab EndLocals
|
||||
&lab equ &DummyPC-1
|
||||
MEND
|
||||
macro
|
||||
&lab ~WaitUntil &delayfrom,&delayamount
|
||||
&lab WordResult
|
||||
PushWord &delayfrom
|
||||
PushWord &delayamount
|
||||
Tool $3A03
|
||||
mend
|
||||
macro
|
||||
&lab ~SetBackColor &backColor
|
||||
&lab ph2 &backColor
|
||||
Tool $A204
|
||||
mend
|
||||
macro
|
||||
&lab ~SetForeColor &foreColor
|
||||
&lab ph2 &foreColor
|
||||
Tool $A004
|
||||
mend
|
||||
macro
|
||||
&lab ~SetSolidPenPat &colorNum
|
||||
&lab ph2 &colorNum
|
||||
Tool $3704
|
||||
mend
|
||||
MACRO
|
||||
&lab _PaintRect
|
||||
&lab ldx #$5404
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _UDivide
|
||||
&lab ldx #$0B0B
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _DrawCString
|
||||
&lab ldx #$A604
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~CStringBounds &cString,&rectPtr
|
||||
&lab ph4 &cString
|
||||
ph4 &rectPtr
|
||||
Tool $AE04
|
||||
mend
|
||||
MACRO
|
||||
&lab _CStringBounds
|
||||
&lab ldx #$AE04
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~InitColorTable &tablePtr
|
||||
&lab ph4 &tablePtr
|
||||
Tool $0D04
|
||||
mend
|
||||
macro
|
||||
&lab ~SetColorTable &tableNumber,&srcTablePtr
|
||||
&lab ph2 &tableNumber
|
||||
ph4 &srcTablePtr
|
||||
Tool $0E04
|
||||
mend
|
||||
macro
|
||||
&lab ~ClearScreen &colorWord
|
||||
&lab ph2 &colorWord
|
||||
Tool $1504
|
||||
mend
|
||||
macro
|
||||
&lab ~SetCurResourceApp &userID
|
||||
&lab ph2 &userID
|
||||
Tool $131E
|
||||
mend
|
||||
MACRO
|
||||
&lab _SetCurResourceApp
|
||||
&lab ldx #$131E
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~LoadSysFont
|
||||
&lab Tool $131B
|
||||
mend
|
||||
MACRO
|
||||
&lab shortmx
|
||||
&lab ANOP
|
||||
sep #%00110000
|
||||
longa off
|
||||
longi off
|
||||
MEND
|
||||
macro
|
||||
&lab ~HideCursor
|
||||
&lab Tool $9004
|
||||
mend
|
||||
macro
|
||||
&lab ~ShowCursor
|
||||
&lab Tool $9104
|
||||
mend
|
||||
macro
|
||||
&lab ~ClosePort &grafPort
|
||||
&lab ph4 &grafPort
|
||||
Tool $1A04
|
||||
mend
|
||||
macro
|
||||
&lab ~OpenPort &resultPortPtr
|
||||
&lab ph4 &resultPortPtr
|
||||
Tool $1804
|
||||
mend
|
||||
macro
|
||||
&lab ~SetPort &portPtr
|
||||
&lab ph4 &portPtr
|
||||
Tool $1B04
|
||||
mend
|
||||
MACRO
|
||||
&lab _CheckHandle
|
||||
&lab ldx #$1E02
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~SetPortLoc &locInfoPtr
|
||||
&lab ph4 &locInfoPtr
|
||||
Tool $1D04
|
||||
mend
|
||||
macro
|
||||
&lab ~GetPortLoc &locInfoPtr
|
||||
&lab ph4 &locInfoPtr
|
||||
Tool $1E04
|
||||
mend
|
||||
macro
|
||||
&lab ~CloseRgn &rgnHandle
|
||||
&lab ph4 &rgnHandle
|
||||
Tool $6E04
|
||||
mend
|
||||
macro
|
||||
&lab ~FrameRect &rectPtr
|
||||
&lab ph4 &rectPtr
|
||||
Tool $5304
|
||||
mend
|
||||
macro
|
||||
&lab ~NewRgn
|
||||
&lab LongResult
|
||||
Tool $6704
|
||||
mend
|
||||
macro
|
||||
&lab ~SetPortRect &rectPtr
|
||||
&lab ph4 &rectPtr
|
||||
Tool $1F04
|
||||
mend
|
||||
macro
|
||||
&lab ~SetVisHandle &rgnHandle
|
||||
&lab ph4 &rgnHandle
|
||||
Tool $C804
|
||||
mend
|
||||
MACRO
|
||||
&lab _OpenRgn
|
||||
&lab ldx #$6D04
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~SetAllSCBs &newSCB
|
||||
&lab ph2 &newSCB
|
||||
Tool $1404
|
||||
mend
|
||||
MACRO
|
||||
&lab _SetMasterSCB
|
||||
&lab ldx #$1604
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _GetColorTable
|
||||
&lab ldx #$0F04
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _GetSCB
|
||||
&lab ldx #$1304
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetColorTable
|
||||
&lab ldx #$0E04
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetSCB
|
||||
&lab ldx #$1204
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~HidePen
|
||||
&lab Tool $2704
|
||||
mend
|
||||
macro
|
||||
&lab ~ShowPen
|
||||
&lab Tool $2804
|
||||
mend
|
||||
macro
|
||||
&lab ~HUnlock &theHandle
|
||||
&lab ph4 &theHandle
|
||||
Tool $2202
|
||||
mend
|
||||
MACRO
|
||||
&lab _HLock
|
||||
&lab ldx #$2002
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetHandleId
|
||||
&lab ldx #$3002
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab peil &arg
|
||||
&lab pei &arg+2
|
||||
pei &arg
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SysBeep
|
||||
&lab ldx #$2C03
|
||||
jsl $E10000
|
||||
MEND
|
2025
source/twilight/twilight/cdev.asm
Normal file
2025
source/twilight/twilight/cdev.asm
Normal file
File diff suppressed because it is too large
Load Diff
37
source/twilight/twilight/cdev.equ
Normal file
37
source/twilight/twilight/cdev.equ
Normal file
|
@ -0,0 +1,37 @@
|
|||
|
||||
* Constants for controls in the main window
|
||||
|
||||
BlankBtn gequ 1 ; The Blank Now button's ID
|
||||
T2Ctl gequ 2 ; "Twilight.. The Ultimate ..."
|
||||
SetupCtl gequ 3 ; The Option button's ID
|
||||
ModuleListCtl gequ 4 ; The list of modules available
|
||||
AboutCtl gequ 5 ; The "About Module" control
|
||||
ActiveCtl gequ 6 ; T2 Active checkbox
|
||||
RandomizeCtl gequ 7 ; Randomize checkbox
|
||||
PurgeCtl gequ 8
|
||||
ToggleCtl gequ 9
|
||||
|
||||
* More IDs.
|
||||
T2SetupTestCtlID gequ $07FEFFFC ; test control in setup window
|
||||
T2SetupPopupCtlID gequ $07FEFFFD ; popup control in setup window
|
||||
T2SetupUpdateCtlID gequ $07FEFFFE ; save control in setup window
|
||||
|
||||
* Constants for controls in the Options window
|
||||
OKButton gequ 2 ; OK button
|
||||
CancelBtn gequ 3 ; CANCEL button
|
||||
InstalledBtn gequ 4 ; Installed check box
|
||||
BoxBtn gequ 5 ; Box in menu bar check box
|
||||
CapsBtn gequ 6 ; Caps Lock 'lock' check box
|
||||
BlankLE gequ 8 ; LE with time info
|
||||
ULNowBtn gequ 10 ; upperL corner radio buttons
|
||||
ULDontBtn gequ 11 ; (Blank Now, Don't Blank, and Off).
|
||||
ULOffBtn gequ 12
|
||||
LLNowBtn gequ 14 ; lowerL corner radio buttons
|
||||
LLDontBtn gequ 15 ; (Blank Now, Don't Blank, and Off).
|
||||
LLOffBtn gequ 16
|
||||
URNowBtn gequ $15 ; upperR corner radio buttons
|
||||
URDontBtn gequ $16 ; (Blank Now, Don't Blank, and Off).
|
||||
UROffBtn gequ $17
|
||||
LRNowBtn gequ $1A ; lowerR corner radio buttons
|
||||
LRDontBtn gequ $1B ; (Blank Now, Don't Blank, and Off).
|
||||
LROffBtn gequ $1C
|
837
source/twilight/twilight/cdev.mac
Normal file
837
source/twilight/twilight/cdev.mac
Normal file
|
@ -0,0 +1,837 @@
|
|||
MACRO
|
||||
&lab pulllong &addr1,&addr2
|
||||
&lab ANOP
|
||||
AIF C:&addr1=0,.a
|
||||
AIF C:&addr2=0,.b
|
||||
LCLC &C
|
||||
&C AMID &addr1,1,1
|
||||
AIF "&C"="[",.zeropage
|
||||
pullword &addr1
|
||||
sta &addr2
|
||||
pullword &addr1+2
|
||||
sta &addr2+2
|
||||
MEXIT
|
||||
.a
|
||||
pullword
|
||||
pullword
|
||||
MEXIT
|
||||
.b
|
||||
pullword &addr1
|
||||
pullword &addr1+2
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&addr2
|
||||
pullword &addr1,y
|
||||
ldy #&addr2+2
|
||||
pullword &addr1,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pullword &SYSOPR
|
||||
&lab ANOP
|
||||
pla
|
||||
AIF C:&SYSOPR=0,.end
|
||||
sta &SYSOPR
|
||||
.end
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushlong &addr,&offset
|
||||
&lab ANOP
|
||||
LCLC &C
|
||||
LCLC &REST
|
||||
&C AMID &addr,1,1
|
||||
AIF "&C"="#",.immediate
|
||||
AIF "&C"="[",.zeropage
|
||||
AIF C:&offset=0,.nooffset
|
||||
AIF "&offset"="s",.stack
|
||||
pushword &addr+2,&offset
|
||||
pushword &addr,&offset
|
||||
MEXIT
|
||||
.nooffset
|
||||
pushword &addr+2
|
||||
pushword &addr
|
||||
MEXIT
|
||||
.immediate
|
||||
&REST AMID &addr,2,L:&addr-1
|
||||
dc I1'$F4',I2'(&REST)|-16'
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEXIT
|
||||
.stack
|
||||
pushword &addr+2,s
|
||||
pushword &addr+2,s
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&offset+2
|
||||
pushword &addr,y
|
||||
ldy #&offset
|
||||
pushword &addr,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushword &SYSOPR
|
||||
&lab ANOP
|
||||
AIF C:&SYSOPR=0,.b
|
||||
LCLC &C
|
||||
&C AMID "&SYSOPR",1,1
|
||||
AIF ("&C"="#").AND.(S:LONGA),.immediate
|
||||
lda &SYSOPR
|
||||
pha
|
||||
MEXIT
|
||||
.b
|
||||
pha
|
||||
MEXIT
|
||||
.immediate
|
||||
LCLC &REST
|
||||
LCLA &BL
|
||||
&BL ASEARCH "&SYSOPR"," ",1
|
||||
AIF &BL>0,.a
|
||||
&BL SETA L:&SYSOPR+1
|
||||
.a
|
||||
&REST AMID "&SYSOPR",2,&BL-2
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEND
|
||||
MACRO
|
||||
&lab longm
|
||||
&lab ANOP
|
||||
rep #%00100000
|
||||
longa on
|
||||
MEND
|
||||
MACRO
|
||||
&lab shortm
|
||||
&lab ANOP
|
||||
sep #%00100000
|
||||
longa off
|
||||
MEND
|
||||
MACRO
|
||||
&lab killLdp
|
||||
&lab pld
|
||||
ply
|
||||
ply
|
||||
MEND
|
||||
MACRO
|
||||
&lab makeDP
|
||||
&lab phd
|
||||
tsc
|
||||
tcd
|
||||
MEND
|
||||
MACRO
|
||||
&LAB JEQ &BP
|
||||
&LAB BNE *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
macro
|
||||
&lab ptr &location
|
||||
&lab anop
|
||||
aif c:&location=1,.value
|
||||
ds 4
|
||||
mexit
|
||||
.value
|
||||
dc i4'&location'
|
||||
mend
|
||||
macro
|
||||
&lab ~GetPort
|
||||
&lab LongResult
|
||||
Tool $1C04
|
||||
mend
|
||||
macro
|
||||
&lab Tool &number
|
||||
&lab ldx #&number
|
||||
jsl $E10000
|
||||
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 _SendRequest
|
||||
&lab ldx #$1c01
|
||||
jsl $E10000
|
||||
mend
|
||||
MACRO
|
||||
&LAB JNE &BP
|
||||
&LAB BEQ *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
macro
|
||||
&lab WordResult &zero
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zero
|
||||
phd
|
||||
mexit
|
||||
.zero
|
||||
&lab pea $0000
|
||||
mend
|
||||
macro
|
||||
&lab LongResult &zeros
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zeros
|
||||
phd
|
||||
phd
|
||||
mexit
|
||||
.zeros
|
||||
pea $0000
|
||||
pea $0000
|
||||
mend
|
||||
MACRO
|
||||
&lab mvw &num1,&num2
|
||||
&lab lda &num1
|
||||
sta &num2
|
||||
MEND
|
||||
MACRO
|
||||
&lab mvl &srcLong,&dstLong
|
||||
&lab ANOP
|
||||
LCLC &C
|
||||
&C AMID &srcLong,1,1
|
||||
AIF "&C"="#",.direct
|
||||
lda &srcLong
|
||||
sta &dstLong
|
||||
lda &srcLong+2
|
||||
sta &dstLong+2
|
||||
MEXIT
|
||||
.direct
|
||||
lda &srcLong
|
||||
sta &dstLong
|
||||
lda &srcLong|-16
|
||||
sta &dstLong+2
|
||||
MEND
|
||||
MACRO
|
||||
&lab _NewHandle
|
||||
&lab ldx #$0902
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetPort
|
||||
&lab ldx #$1B04
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~FMShutDown
|
||||
&lab Tool $031B
|
||||
mend
|
||||
macro
|
||||
&lab ~FMStatus
|
||||
&lab WordResult 0
|
||||
Tool $061B
|
||||
mend
|
||||
macro
|
||||
&lab ~DisposeHandle &theHandle
|
||||
&lab ph4 &theHandle
|
||||
Tool $1002
|
||||
mend
|
||||
macro
|
||||
&lab ~DrawCString &cString
|
||||
&lab ph4 &cString
|
||||
Tool $A604
|
||||
mend
|
||||
macro
|
||||
&lab ~GetMasterSCB
|
||||
&lab WordResult
|
||||
Tool $1704
|
||||
mend
|
||||
macro
|
||||
&lab ~MoveTo &h,&v
|
||||
&lab ph2 &h
|
||||
ph2 &v
|
||||
Tool $3A04
|
||||
mend
|
||||
macro
|
||||
&lab ~CloseResourceFile &fileID
|
||||
&lab ph2 &fileID
|
||||
Tool $0B1E
|
||||
mend
|
||||
macro
|
||||
&lab ~GetCurResourceFile
|
||||
&lab WordResult
|
||||
Tool $121E
|
||||
mend
|
||||
macro
|
||||
&lab ph4 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &addr,1,1
|
||||
aif "&char"="@",.registers
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif c:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
.yesoffset
|
||||
lda &addr+2,&offset
|
||||
pha
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr+2
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr+2,s
|
||||
pha
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.registers
|
||||
phy
|
||||
phx
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea +(&addr)|-16
|
||||
pea &addr
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr+2
|
||||
pei &addr
|
||||
mexit
|
||||
.zeroPage
|
||||
aif C:&offset<>0,.zeroPageOffset
|
||||
ldy #2
|
||||
lda &addr,y
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOffset
|
||||
aif "&offset"="X",.zeroPageRegX
|
||||
aif "&offset"="Y",.zeroPageRegY
|
||||
aif "&offset"="x",.zeroPageRegX
|
||||
aif "&offset"="y",.zeroPageRegY
|
||||
ldy #&offset+2
|
||||
lda &addr,y
|
||||
pha
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageRegX
|
||||
lda &addr,&offset
|
||||
tay
|
||||
inx
|
||||
inx
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phy
|
||||
mexit
|
||||
.zeroPageRegY
|
||||
lda &addr,&offset
|
||||
tax
|
||||
iny
|
||||
iny
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phx
|
||||
mend
|
||||
MACRO
|
||||
&lab dbrk &num
|
||||
aif t:debugBreaks="G",.begin
|
||||
mexit
|
||||
.begin
|
||||
brk &num
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetCurResourceApp
|
||||
&lab wordresult
|
||||
Tool $141E
|
||||
mend
|
||||
MACRO
|
||||
&lab _SetCurResourceFile
|
||||
&lab ldx #$111E
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~SetCurResourceFile &fileID
|
||||
&lab ph2 &fileID
|
||||
Tool $111E
|
||||
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 _FMStartUp
|
||||
&lab ldx #$021B
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab errorbrk &op
|
||||
&lab anop
|
||||
aif t:debugCode="G",.doit
|
||||
mexit
|
||||
.doit
|
||||
bcc *+4
|
||||
aif c:&op=1,.value
|
||||
brk $BB
|
||||
mexit
|
||||
.value
|
||||
brk &op
|
||||
mend
|
||||
MACRO
|
||||
&lab ename
|
||||
&lab entry
|
||||
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 _SetHandleId
|
||||
&lab ldx #$3002
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab peil &arg
|
||||
&lab pei &arg+2
|
||||
pei &arg
|
||||
MEND
|
||||
MACRO
|
||||
&lab _OpenResourceFile
|
||||
&lab ldx #$0A1E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _NewControl2
|
||||
&lab ldx #$3110
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _MessageCenter
|
||||
&lab ldx #$1501
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _FindHandle
|
||||
&lab ldx #$1A02
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _NewWindow2
|
||||
&lab ldx #$610E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _DrawControls
|
||||
&lab ldx #$1010
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _HiliteControl
|
||||
&lab ldx #$1110
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _NewList2
|
||||
&lab ldx #$161C
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _DrawString
|
||||
&lab ldx #$A504
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _LETextBox
|
||||
&lab ldx #$1814
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _LETextBox2
|
||||
&lab ldx #$2014
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _DrawIcon
|
||||
&lab ldx #$0B12
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _GetOpenFileRefNum
|
||||
&lab ldx #$1F1E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _GetRefInfoGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2039"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
macro
|
||||
&lab ~NewControl2 &ownerPtr,&inputDesc,&inputRef
|
||||
&lab LongResult
|
||||
ph4 &ownerPtr
|
||||
ph2 &inputDesc
|
||||
ph4 &inputRef
|
||||
Tool $3110
|
||||
mend
|
||||
macro
|
||||
&lab ~SortList2 &comparePtr,&ctlHandle
|
||||
&lab ph4 &comparePtr
|
||||
ph4 &ctlHandle
|
||||
Tool $151C
|
||||
mend
|
||||
macro
|
||||
&lab ~GetHandleSize &theHandle
|
||||
&lab LongResult
|
||||
ph4 &theHandle
|
||||
Tool $1802
|
||||
mend
|
||||
macro
|
||||
&lab ~DeleteID &userID
|
||||
&lab ph2 &userID
|
||||
Tool $2103
|
||||
mend
|
||||
macro
|
||||
&lab ~GetNewID &idTag
|
||||
&lab WordResult
|
||||
ph2 &idTag
|
||||
Tool $2003
|
||||
mend
|
||||
macro
|
||||
&lab ~SetFontFlags &fontFlags
|
||||
&lab ph2 &fontFlags
|
||||
Tool $9804
|
||||
mend
|
||||
macro
|
||||
&lab ~QDAuxStartUp
|
||||
&lab Tool $0212
|
||||
mend
|
||||
macro
|
||||
&lab ~QDAuxShutDown
|
||||
&lab Tool $0312
|
||||
mend
|
||||
macro
|
||||
&lab ~QDAuxStatus
|
||||
&lab WordResult 0
|
||||
Tool $0612
|
||||
mend
|
||||
macro
|
||||
&lab ~LoadResource &resourceType,&resourceID
|
||||
&lab LongResult
|
||||
ph2 &resourceType
|
||||
ph4 &resourceID
|
||||
Tool $0E1E
|
||||
mend
|
||||
macro
|
||||
&lab ~ReleaseResource &purgeLevel,&resourceType,&resourceID
|
||||
&lab ph2 &purgeLevel
|
||||
ph2 &resourceType
|
||||
ph4 &resourceID
|
||||
Tool $171E
|
||||
mend
|
||||
macro
|
||||
&lab ~LoadOneTool &toolNumber,&minVersion
|
||||
&lab ph2 &toolNumber
|
||||
ph2 &minVersion
|
||||
Tool $0F01
|
||||
mend
|
||||
macro
|
||||
&lab ~MessageByName &createItFlag,&recordPtr
|
||||
&lab LongResult
|
||||
ph2 &createItFlag
|
||||
ph4 &recordPtr
|
||||
Tool $1701
|
||||
mend
|
||||
macro
|
||||
&lab ~CloseWindow &windowPtr
|
||||
&lab ph4 &windowPtr
|
||||
Tool $0B0E
|
||||
mend
|
||||
macro
|
||||
&lab ~UserShutdown &userID,&quitFlag
|
||||
&lab WordResult
|
||||
ph2 &userID
|
||||
ph2 &quitFlag
|
||||
Tool $1211
|
||||
mend
|
||||
macro
|
||||
&lab ph2 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid "&addr",1,1
|
||||
aif "&char"="@",.accumulator
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif C:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.accumulator
|
||||
pha
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea &addr
|
||||
mexit
|
||||
.zeropage
|
||||
aif C:&offset<>0,.zeroPageOff
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOff
|
||||
aif "&offset"="X",.zeroPageReg
|
||||
aif "&offset"="Y",.ze
|
||||
oPageReg
|
||||
aif "&offset"="x",.zeroPageReg
|
||||
aif "&offset"="y",.zeroPageReg
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageReg
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mend
|
||||
macro
|
||||
&lab ~GetCtlHandleFromID &ctlWindowPtr,&ctlID
|
||||
&lab LongResult
|
||||
ph4 &ctlWindowPtr
|
||||
ph4 &ctlID
|
||||
Tool $3010
|
||||
mend
|
||||
macro
|
||||
&lab ~HandToPtr &sourceHandle,&destPtr,&count
|
||||
&lab ph4 &sourceHandle
|
||||
ph4 &destPtr
|
||||
ph4 &count
|
||||
Tool $2902
|
||||
mend
|
||||
macro
|
||||
&lab ~VersionString &flags,&theVersion,&stringPtr
|
||||
&lab PushWord &flags
|
||||
PushLong &theVersion
|
||||
PushLong &stringPtr
|
||||
Tool $3903
|
||||
mend
|
||||
macro
|
||||
&lab ~DetachResource &resourceType,&resourceID
|
||||
&lab ph2 &resourceType
|
||||
ph4 &resourceID
|
||||
Tool $181E
|
||||
mend
|
||||
macro
|
||||
&lab ~AlertWindow &alertFlags,&subStrPtr,&alertStrRef
|
||||
&lab WordResult
|
||||
ph2 &alertFlags
|
||||
ph4 &subStrPtr
|
||||
ph4 &alertStrRef
|
||||
Tool $590E
|
||||
mend
|
||||
macro
|
||||
&lab ~NewHandle &blockSize,&userID,&attributes,&locationPtr
|
||||
&lab LongResult
|
||||
ph4 &blockSize
|
||||
ph2 &userID
|
||||
ph2 &attributes
|
||||
ph4 &locationPtr
|
||||
Tool $0902
|
||||
mend
|
||||
macro
|
||||
&lab ~TaskMasterDA &eventMask,&taskRecPtr
|
||||
&lab WordResult
|
||||
ph2 &eventMask
|
||||
ph4 &taskRecPtr
|
||||
Tool $5F0E
|
||||
mend
|
||||
MACRO
|
||||
&lab _Multiply
|
||||
&lab ldx #$090B
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _InitialLoad2
|
||||
&lab ldx #$2011
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _DisposeAll
|
||||
&lab ldx #$1102
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~FlushEvents &eventMask,&stopMask
|
||||
&lab WordResult
|
||||
ph2 &eventMask
|
||||
ph2 &stopMask
|
||||
Tool $1506
|
||||
mend
|
||||
macro
|
||||
&lab ~InitCursor
|
||||
&lab Tool $CA04
|
||||
mend
|
||||
macro
|
||||
&lab ~TaskMaster &eventMask,&taskRecPtr
|
||||
&lab WordResult
|
||||
ph2 &eventMask
|
||||
ph4 &taskRecPtr
|
||||
Tool $1D0E
|
||||
mend
|
||||
macro
|
||||
&lab ~HLock &theHandle
|
||||
&lab ph4 &theHandle
|
||||
Tool $2002
|
||||
mend
|
||||
MACRO
|
||||
&lab _HexIt
|
||||
&lab ldx #$2A0B
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab str &string
|
||||
&lab dc i1'L:&string',C'&string'
|
||||
MEND
|
||||
macro
|
||||
&lab ~HexIt &intValue
|
||||
&lab LongResult
|
||||
ph2 &intValue
|
||||
Tool $2A0B
|
||||
mend
|
||||
macro
|
||||
&lab ~GetResourceSize &resourceType,&resourceID
|
||||
&lab LongResult
|
||||
ph2 &resourceType
|
||||
ph4 &resourceID
|
||||
Tool $1D1E
|
||||
mend
|
||||
MACRO
|
||||
&lab _SetCtlValue
|
||||
&lab ldx #$1910
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~ListStartUp
|
||||
&lab Tool $021C
|
||||
mend
|
||||
macro
|
||||
&lab ~ListShutDown
|
||||
&lab Tool $031C
|
||||
mend
|
||||
macro
|
||||
&lab ~ListStatus
|
||||
&lab WordResult 0
|
||||
Tool $061C
|
||||
mend
|
||||
macro
|
||||
&lab ~PostEvent &eventCode,&eventMsg
|
||||
&lab WordResult
|
||||
ph2 &eventCode
|
||||
ph4 &eventMsg
|
||||
Tool $1406
|
||||
mend
|
||||
macro
|
||||
&lab ~TEStatus
|
||||
&lab WordResult 0
|
||||
Tool $0622
|
||||
mend
|
||||
MACRO
|
||||
&lab _GetCtlValue
|
||||
&lab ldx #$1A10
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~MarkResourceChange &changeFlag,&resourceType,&resourceID
|
||||
&lab ph2 &changeFlag
|
||||
ph2 &resourceType
|
||||
ph4 &resourceID
|
||||
Tool $101E
|
||||
mend
|
||||
macro
|
||||
&lab ~UpdateResourceFile &fileID
|
||||
&lab ph2 &fileID
|
||||
Tool $0D1E
|
||||
mend
|
||||
MACRO
|
||||
&lab _DeleteID
|
||||
&lab ldx #$2103
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab jcsl &BP
|
||||
&lab bcc *+5
|
||||
&lab._brl brl &BP
|
||||
MEND
|
||||
macro
|
||||
&lab handle
|
||||
&lab ds 4
|
||||
mend
|
||||
macro
|
||||
&lab boolean &onoff
|
||||
&lab anop
|
||||
aif c:&onoff=1,.value
|
||||
dc i'0'
|
||||
mexit
|
||||
.value
|
||||
dc i'&onoff'
|
||||
mend
|
||||
MACRO
|
||||
&lab _TEStartUp
|
||||
&lab ldx #$0222
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _CloseResourceFile
|
||||
&lab ldx #$0B1E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab debugBorder
|
||||
&lab anop
|
||||
aif t:debugSymbols="G",.begin
|
||||
MEXIT
|
||||
.begin
|
||||
shortm
|
||||
lda $e1c034
|
||||
inc a
|
||||
sta $e1c034
|
||||
longm
|
||||
MEND
|
||||
MACRO
|
||||
&lab stzl &adr
|
||||
&lab stz &adr
|
||||
stz &adr+2
|
||||
MEND
|
||||
macro
|
||||
&lab ~NextMember2 &itemNumber,&ctlHandle
|
||||
&lab WordResult
|
||||
ph2 &itemNumber
|
||||
ph4 &ctlHandle
|
||||
Tool $121C
|
||||
mend
|
4
source/twilight/twilight/debug.equ
Normal file
4
source/twilight/twilight/debug.equ
Normal file
|
@ -0,0 +1,4 @@
|
|||
|
||||
debugCode gequ $BAD ; Put in other debugging code ?
|
||||
debugBreaks gequ $BAD ; Put in debugging breaks ?
|
||||
debugSymbols gequ $BAD ; Put in debugging symbols ?
|
921
source/twilight/twilight/dispatch.asm
Normal file
921
source/twilight/twilight/dispatch.asm
Normal file
|
@ -0,0 +1,921 @@
|
|||
setcom 80
|
||||
*-----------------------------------------------------------------------------*
|
||||
DisPatch start
|
||||
kind $1000 ; no special memory
|
||||
debug 'DisPatch'
|
||||
Using InitDATA
|
||||
Using DispatchDATA
|
||||
|
||||
*************************************
|
||||
* Misc. equates
|
||||
|
||||
disptch1 equ $E10000
|
||||
disptch2 equ $E10004
|
||||
|
||||
longa on
|
||||
longi on
|
||||
|
||||
*************************************
|
||||
* patch the tool dispatch vector
|
||||
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
|
||||
ldx #^MyPatch
|
||||
ldy #MyPatch
|
||||
jsr Install
|
||||
|
||||
~GetVector #bellVector
|
||||
pla
|
||||
sta oldBellVect+1
|
||||
pla
|
||||
shortm
|
||||
sta oldBellVect+3
|
||||
longm
|
||||
|
||||
PushLong #BellVectPatch ; source pointer
|
||||
LongResult ; destionation handle space
|
||||
PushLong #bPatchEnd-bPatchStart
|
||||
~GetNewID #$2000 ; get new control program ID
|
||||
PushWord #attrLocked+attrFixed+attrNoSpec+attrNoCross
|
||||
phd
|
||||
phd
|
||||
_NewHandle
|
||||
lda 1,s
|
||||
sta patchH
|
||||
lda 1+2,s
|
||||
sta patchH+2 ; destination handle
|
||||
PushLong #bPatchEnd-bPatchStart ; count
|
||||
_PtrToHand
|
||||
|
||||
PushWord #bellVector
|
||||
PushLong patchH
|
||||
jsr makePdp
|
||||
pld
|
||||
_SetVector
|
||||
|
||||
plb
|
||||
rtl
|
||||
|
||||
|
||||
*************************************
|
||||
patchH ds 4
|
||||
BellRecursion entry
|
||||
ds 2
|
||||
|
||||
debug 'BellVectPatch'
|
||||
bPatchStart anop
|
||||
BellVectPatch anop
|
||||
php ; +0-
|
||||
longmx ; +1-
|
||||
pha ; +3-
|
||||
disablePatch lda #0 ; +4- t2 still installed?
|
||||
bne skipPatch ; nope.
|
||||
|
||||
jsl realPatch
|
||||
|
||||
skipPatch anop
|
||||
pla
|
||||
plp
|
||||
oldBellVect jmp >0
|
||||
bPatchEnd anop
|
||||
|
||||
|
||||
|
||||
realPatch name
|
||||
lda >NowFlag
|
||||
bne returnY
|
||||
|
||||
lda >OptionsFlag
|
||||
bit #fSysBeepsUnblank
|
||||
beq returnY ; sysbeeps don't unblank
|
||||
|
||||
lda >KbdChangedFlg
|
||||
inc a
|
||||
sta >KbdChangedFlg
|
||||
|
||||
returnY rtl
|
||||
|
||||
|
||||
|
||||
*************************************
|
||||
RemoveIt ename
|
||||
|
||||
longa on
|
||||
longi on
|
||||
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
|
||||
ldx #^MyPatch
|
||||
ldy #MyPatch
|
||||
jsr Remove
|
||||
php ; save carry flag
|
||||
|
||||
PushLong patchH ; invalidate bell patch
|
||||
jsr makePdp
|
||||
ldy #5
|
||||
lda #-1
|
||||
sta [3],y
|
||||
killLdp
|
||||
|
||||
plp
|
||||
plb
|
||||
rtl
|
||||
|
||||
*************************************
|
||||
*************************************
|
||||
|
||||
**************************************************
|
||||
* Name: Install by Greg Templeman
|
||||
* Installs the specified tool patch.
|
||||
* Note: Install doesn't verify you have passed a
|
||||
* valid header, so just MAKE SURE YOU DO!
|
||||
* Note: The patch header must not cross bank
|
||||
* boundaries. While code segments virtually
|
||||
* never cross bank boundaries, it is possible to
|
||||
* deliberately make one do so (and work), but it
|
||||
* won't work here!
|
||||
* Note: Install assumes that disptch1/disptch
|
||||
* already contain JML's. Pretty safe bet.
|
||||
**************************************************
|
||||
* Inputs:
|
||||
* A = Unused
|
||||
* X = Pointer to patch header, high
|
||||
* Y = Pointer to patch header, low
|
||||
**************************************************
|
||||
* Outputs:
|
||||
* A = scrambled
|
||||
* X = scrambled
|
||||
* Y = scrambled
|
||||
* patchptr: Pointer to patch header
|
||||
**************************************************
|
||||
* Volatile:
|
||||
* tmptr
|
||||
*
|
||||
|
||||
Install name
|
||||
|
||||
DefineStack
|
||||
tmptr long
|
||||
patchptr long
|
||||
stkFrameSize EndLocals
|
||||
|
||||
phd
|
||||
tsc
|
||||
sec
|
||||
sbc #stkFrameSize
|
||||
tcs
|
||||
tcd
|
||||
|
||||
jsr TPsetup ;Set things up, disable IRQ
|
||||
* bcs :xt ;->Invalid patch header
|
||||
|
||||
ldx |disptch1+3 ;Get address of first patch (or the actual
|
||||
lda |disptch1+1 ; dispatcher if no other patches are installed)
|
||||
sec
|
||||
sbc #$0011
|
||||
tay
|
||||
jsr ChkPatch ;Anyone else patching the Dispatcher? (sets up tmptr)
|
||||
bcc not1st ;->Yes, we're not the first
|
||||
|
||||
yes1st ldx #^disptch1-8 ;Copy original dispatcher
|
||||
ldy #disptch1-8 ; stuff into linked-list
|
||||
stx tmptr+2
|
||||
sty tmptr
|
||||
|
||||
not1st ldy #$10-2
|
||||
_loop1 lda [tmptr],y ;Set up the linked-list
|
||||
sta [patchptr],y
|
||||
dey
|
||||
dey
|
||||
cpy #8
|
||||
bge _loop1
|
||||
_loop2 lda |disptch1,y ;Copy the current patch vectors
|
||||
sta [patchptr],y ; into our patch's header section
|
||||
dey
|
||||
dey
|
||||
bpl _loop2
|
||||
|
||||
lda patchptr+1 ;Now patch us into the Dispatch vectors
|
||||
sta |disptch1+2
|
||||
sta |disptch2+2 ;Set up Dispatch bank bytes
|
||||
lda patchptr
|
||||
adc #$0011 ;(c=0 after BGE=BCS fails)
|
||||
sta |disptch1+1 ;Set up disptch1
|
||||
adc #$0004 ;(c=0 after ADC)
|
||||
sta |disptch2+1 ; and finish disptch2
|
||||
|
||||
* asl ;Save carry status
|
||||
xt plp ;Re-enable interrupts
|
||||
* lsr ;Restore carry status
|
||||
plb ;Back to previous bank
|
||||
|
||||
tsc
|
||||
clc
|
||||
adc #stkFrameSize
|
||||
tcs
|
||||
pld
|
||||
rts
|
||||
|
||||
|
||||
**************************************************
|
||||
* Name: Remove by Greg Templeman
|
||||
* Removes the specified (installed) tool patch.
|
||||
* Note: If an error occurs, your patch has _NOT_
|
||||
* been removed. Under these circumstances, IT
|
||||
* IS NOT SAFE TO SHUT DOWN YOUR APPLICATION OR
|
||||
* DISPOSE OF ITS MEMORY! Doing so will leave
|
||||
* your tool patch dangling and crash the system.
|
||||
**************************************************
|
||||
* Inputs:
|
||||
* A = Unused
|
||||
* X = Pointer to patch header, high
|
||||
* Y = Pointer to patch header, low
|
||||
**************************************************
|
||||
* Outputs:
|
||||
* A = scrambled
|
||||
* X = scrambled
|
||||
* Y = scrambled
|
||||
* c = SET if error, CLEAR if successful
|
||||
* patchptr: Pointer to patch header
|
||||
**************************************************
|
||||
* Volatile:
|
||||
* tmptr
|
||||
*
|
||||
|
||||
Remove name
|
||||
phd
|
||||
tsc
|
||||
sec
|
||||
sbc #stkFrameSize
|
||||
tcs
|
||||
tcd
|
||||
|
||||
jsr TPsetup ;Set things up, disable IRQ
|
||||
bcs _out ;->Uh-oh, something bad's going on...
|
||||
|
||||
lda patchptr
|
||||
adc #$0011 ;(carry is clear after BCS fails)
|
||||
sta patchptr
|
||||
cmp |disptch1+1
|
||||
bne _not1st ;->Not 1st item in list
|
||||
lda patchptr+1
|
||||
cmp |disptch1+2
|
||||
bne _not1st
|
||||
|
||||
_1st ldx #^disptch1 ;There is no previous item in this linked list--
|
||||
ldy #disptch1 ; copy our "next items" into the Dispatch vectors
|
||||
stx tmptr+2
|
||||
sty tmptr
|
||||
lda patchptr ;Set up for later
|
||||
bra _remove ;->Remove us from list (c=1 after CMP, BNE fails!)
|
||||
|
||||
_not1st ldx |disptch1+3 ;Get address of first patch (or the actual
|
||||
lda |disptch1+1 ; dispatcher if no other patches are installed)
|
||||
_loop sec
|
||||
sbc #$0011
|
||||
tay
|
||||
jsr ChkPatch ;Check for valid patch (also sets up tmptr)
|
||||
bcs _out
|
||||
sep #$70 ;Short mode + set V
|
||||
ldy #3
|
||||
lda [tmptr],y
|
||||
tax ;Save bank address
|
||||
ldy #1
|
||||
cpx patchptr+2 ;(doesn't change V flag)
|
||||
longmx
|
||||
bne _skip ;->Patch not yet found
|
||||
clv ;This might be it...
|
||||
_skip lda [tmptr],y
|
||||
bvs _loop ;->Not our patch yet
|
||||
cmp patchptr
|
||||
bne _loop ;->Not our patch yet
|
||||
|
||||
_remove sbc #$0011 ;(c=1 after CMP, BNE fails)
|
||||
sta patchptr ;We've located our patch in
|
||||
ldy #8-2 ; the linked list.
|
||||
_unlink lda [patchptr],y ;Now remove it.
|
||||
sta [tmptr],y
|
||||
dey
|
||||
dey
|
||||
bpl _unlink
|
||||
|
||||
clc ;=No errors
|
||||
_out asl a ;Save carry bit
|
||||
plp ;Restore IRQ state
|
||||
lsr a ;Restore carry bit
|
||||
plb
|
||||
|
||||
tsc
|
||||
clc
|
||||
adc #stkFrameSize
|
||||
tcs
|
||||
pld
|
||||
rts
|
||||
|
||||
|
||||
**************************************************
|
||||
* Name: TPsetup by Greg Templeman
|
||||
* Stores the patch header pointer in patchptr,
|
||||
* saves the DBR and P-register on the stack (under
|
||||
* the RTS), then sets the bank to $E1 (the
|
||||
* dispatcher bank) and disables interrupts.
|
||||
**************************************************
|
||||
* Inputs:
|
||||
* A = Unused
|
||||
* X = Pointer to patch header, high
|
||||
* Y = Pointer to patch header, low
|
||||
**************************************************
|
||||
* Outputs:
|
||||
* A = scrambled
|
||||
* X = scrambled
|
||||
* Y = scrambled
|
||||
* i = Set (interrupts disabled)
|
||||
* c = CLEAR if valid patch, SET if invalid patch
|
||||
* patchptr: Pointer to patch header
|
||||
* tmptr: Pointer to patch header
|
||||
* Stack:
|
||||
* byte: Old data-bank register (DBR)
|
||||
* byte: Old processor status register (P)
|
||||
**************************************************
|
||||
* Volatile:
|
||||
* tmptr
|
||||
*
|
||||
|
||||
TPsetup pla ;Pull RTS
|
||||
stx patchptr+2
|
||||
sty patchptr
|
||||
phb
|
||||
; pea disptch1|-12
|
||||
pea $e1e1
|
||||
plb
|
||||
plb
|
||||
php
|
||||
sei ;Important: don't leave interrupts on!
|
||||
pha ;Restore RTS
|
||||
|
||||
**************************************************
|
||||
* Name: ChkPatch by Greg Templeman
|
||||
* Checks an apparent patch to see if it has the
|
||||
* correct header format to be a real patch.
|
||||
**************************************************
|
||||
* Inputs:
|
||||
* A = Unused
|
||||
* X = Pointer to patch header, high
|
||||
* Y = Pointer to patch header, low
|
||||
**************************************************
|
||||
* Outputs:
|
||||
* A = scrambled
|
||||
* X = scrambled
|
||||
* Y = scrambled
|
||||
* c = CLEAR if valid patch, SET if invalid patch
|
||||
* tmptr: Pointer to patch header
|
||||
**************************************************
|
||||
* Volatile:
|
||||
*
|
||||
|
||||
ChkPatch stx tmptr+2
|
||||
sty tmptr ;New patch address
|
||||
|
||||
shortmx ;Short mode briefly
|
||||
ldy #16-4 ;Check 4 JML's
|
||||
_check lda [tmptr],y
|
||||
cmp #$5C
|
||||
bne _bad2 ;->Not a JML, bad header
|
||||
tya ;(c=1 after CMP, BNE fails)
|
||||
sbc #4
|
||||
tay
|
||||
bpl _check
|
||||
|
||||
ldy #16
|
||||
lda [tmptr],y ;Get rtl opcode
|
||||
cmp #$6B
|
||||
bne _bad2 ;->Not an RTL, bad header
|
||||
iny
|
||||
longmx ;Back to long mode
|
||||
lda [tmptr],y ;Get phk/pea opcodes
|
||||
cmp #$F44B
|
||||
bne _bad ;->Wrong form, bad header
|
||||
lda tmptr ;(c=1 after CMP, BNE fails)
|
||||
adc #$000F-1 ;(c=1, so effectively + $F)
|
||||
ldy #$13
|
||||
cmp [tmptr],y
|
||||
clc ;We're done if this compares
|
||||
beq _xt ;->Yes, we're outta here
|
||||
|
||||
_bad2 longmx ;(for people entering here)
|
||||
_bad sec
|
||||
_xt rts
|
||||
|
||||
|
||||
*************************************
|
||||
|
||||
MyPatch anop ;Header for a Dispatcher patch
|
||||
next1vct jml next1vct
|
||||
next2vct jml next2vct
|
||||
disp1vct jml disp1vct
|
||||
disp2vct jml disp2vct
|
||||
anRTL rtl
|
||||
|
||||
NewDsp1 phk ;Don't change these two lines; they
|
||||
pea anRTL-1 ; are required by the patch protocol
|
||||
|
||||
NewDsp2 anop
|
||||
cpx #$1406 ; postEvent
|
||||
beq T2PostEvent
|
||||
cpx #$0a06
|
||||
beq Go_GNE
|
||||
; blt next2vct
|
||||
cpx #$ca04
|
||||
beq Go_InitC
|
||||
; bge next2vct
|
||||
cpx #$0a12
|
||||
beq Go_WaitC
|
||||
cpx #$8e04
|
||||
beq Go_SetC
|
||||
|
||||
lda >NowFlag ; if we haven't bkg blank now'd
|
||||
bne next2vct ; then don't patch out these calls!
|
||||
|
||||
*0E04 (FE15B9) SetColorTable(Tab#,@SrcTab)
|
||||
*1004 (FE1617) SetColorEntry(Tab#,Ent#,NewCol)
|
||||
*0F04 (FE15E8) GetColorTable(Tab#,@DestTbl)
|
||||
*1104 (FE164E) GetColorEntry(Tab#,Ent#):Color
|
||||
|
||||
cpx #$0E04 ; SetColorTable
|
||||
beq Go_SetColTbl
|
||||
cpx #$1004 ; SetColorEntry
|
||||
beq Go_SetColEnt
|
||||
cpx #$0F04 ; GetColorTable
|
||||
beq Go_GetColTbl
|
||||
cpx #$1104 ; GetColorEntry
|
||||
beq Go_GetColEnt
|
||||
|
||||
*2C03 (FEBF01) SysBeep()
|
||||
*3803 (03BF2F) *%SysBeep2(beepKind)
|
||||
|
||||
cpx #$2C03 ; SysBeep
|
||||
beq Go_SysBeep
|
||||
cpx #$3803 ; Sysbeep2
|
||||
beq Go_SysBeep2
|
||||
|
||||
bra next2vct
|
||||
|
||||
*************************************
|
||||
|
||||
Go_GNE bra T2GetNextEvent
|
||||
Go_WaitC brl T2WaitCursor
|
||||
Go_InitC brl T2InitCursor
|
||||
Go_SetC brl T2SetCursor
|
||||
Go_SetColTbl brl T2SetColorTable
|
||||
Go_SetColEnt brl T2SetColorEntry
|
||||
Go_GetColTbl brl T2GetColorTable
|
||||
Go_GetColEnt brl T2GetColorEntry
|
||||
Go_SysBeep brl T2SysBeep
|
||||
Go_SysBeep2 brl T2SysBeep2
|
||||
|
||||
|
||||
*************************************
|
||||
T2PostEvent name
|
||||
|
||||
rtl1_pe equ 1
|
||||
rtl2_pe equ rtl1_pe+3
|
||||
eventMsg_pe equ rtl2_pe+3
|
||||
eventCode_pe equ eventMsg_pe+4
|
||||
result_pe equ eventCode_pe+2
|
||||
|
||||
* if intellikey is on, skip the postevent patch..
|
||||
|
||||
lda >OptionsFlag
|
||||
bit #fUseIntelliKey
|
||||
bne next2vct2
|
||||
|
||||
lda eventCode_pe,s
|
||||
cmp #mouseDownEvt ; 1
|
||||
blt next2vct2
|
||||
cmp #autoKeyEvt+1 ; = updateEvt (6)
|
||||
bge next2vct2
|
||||
cmp #4
|
||||
bne pastl
|
||||
next2vct2 brl next2vct
|
||||
pastl anop
|
||||
|
||||
* event codes : will be acted upon
|
||||
* mouseDownEvt - 1
|
||||
* mouseUpEvt - 2
|
||||
* keyDownEvt - 3 (what the fuck happened to 4? :)
|
||||
* autoKeyEvt - 5
|
||||
|
||||
lda #TRUE
|
||||
sta >KbdChangedFlg
|
||||
|
||||
* If we just detected a keypress that will end up restoring the text screen,
|
||||
* restore the text screen NOW so that if the keypress we just hit causes
|
||||
* the program to change the border color, we won't delay so much that the
|
||||
* prog changes the border color and then we go and restore the old, now
|
||||
* incorrect color over the new one! (Don't ask - Greg Templeman convinced
|
||||
* me to implement this! - d37 Sun 6 Sept 92 10pm)
|
||||
|
||||
lda NEWVIDEO
|
||||
bit #$80
|
||||
bne shr_on ; shr is on
|
||||
lda NowFlag ; already blanked?
|
||||
bne shr_on ; if no, skip trying to restore
|
||||
phx
|
||||
jsl later_entry ; call text hndlr so it can restore now
|
||||
plx
|
||||
|
||||
shr_on brl next2vct
|
||||
|
||||
|
||||
*************************************
|
||||
T2GetNextEvent name
|
||||
|
||||
phx
|
||||
shortm
|
||||
lda NEWVIDEO
|
||||
longm
|
||||
and #$FF
|
||||
bit #$80
|
||||
beq exit_gne ; SHR off!!
|
||||
|
||||
lda >NowBlankRunQPeriod
|
||||
beq callST
|
||||
lda >NowUnBlankRunQPeriod
|
||||
beq callST
|
||||
lda >BlankRunQPeriod
|
||||
bne exit_gne
|
||||
|
||||
callST _SystemTask
|
||||
|
||||
exit_gne anop
|
||||
plx
|
||||
brl next2vct
|
||||
|
||||
|
||||
*************************************
|
||||
T2WaitCursor name
|
||||
|
||||
lda >cccpActive ; if cool cursor is active
|
||||
bne skip_find_adr ; then skip any cursor stuff
|
||||
|
||||
lda #TRUE
|
||||
sta >nabIt+1
|
||||
|
||||
mvw #TRUE,>WaitCursorNow
|
||||
|
||||
skip_find_adr brl next2vct
|
||||
|
||||
|
||||
*************************************
|
||||
T2SetCursor name
|
||||
; dbrk 02
|
||||
; debug 'setC'
|
||||
|
||||
rtl1_sc equ 1
|
||||
rtl2_sc equ rtl1_sc+3
|
||||
cursorAdr_sc equ rtl2_sc+3
|
||||
|
||||
lda >cccpActive ; if cool cursor is active
|
||||
bne leave ; then skip any cursor stuff
|
||||
|
||||
nabIt lda #0
|
||||
beq dontNabIt
|
||||
mvw #0,>nabIt+1 ; stop nabbing it
|
||||
lda cursorAdr_sc,s
|
||||
sta >WaitCursorAdr
|
||||
lda cursorAdr_sc+2,s
|
||||
sta >WaitCursorAdr+2
|
||||
bra yes_leave
|
||||
|
||||
dontNabIt anop
|
||||
lda cursorAdr_sc,s
|
||||
cmp >WaitCursorAdr
|
||||
bne no_set_waitcursor
|
||||
lda cursorAdr_sc+2,s
|
||||
cmp >WaitCursorAdr+2
|
||||
bne no_set_waitcursor
|
||||
|
||||
yes_leave anop
|
||||
mvw #TRUE,>WaitCursorNow
|
||||
bra leave
|
||||
|
||||
no_set_waitcursor anop
|
||||
mvw #FALSE,>WaitCursorNow
|
||||
leave brl next2vct
|
||||
|
||||
|
||||
*************************************
|
||||
T2InitCursor name
|
||||
; dbrk 03
|
||||
; debug 'initC'
|
||||
|
||||
lda >cccpActive ; if cool cursor is active
|
||||
bne leave ; then skip any cursor stuff
|
||||
|
||||
mvw #FALSE,>WaitCursorNow
|
||||
brl next2vct
|
||||
|
||||
|
||||
*************************************
|
||||
* SetColorTable Patch:
|
||||
* Coded - October '92 (1.0.1b1)
|
||||
* Debugged - Dec 4 '92. JRM (1.0.1b2)
|
||||
|
||||
T2SetColorTable name
|
||||
|
||||
; lda >NowFlag ; if we haven't blank now'd
|
||||
; jne next2vct ; then don't patch out the call!
|
||||
|
||||
rtl1_sct0 equ 1
|
||||
rtl2_sct0 equ rtl1_sct0+3
|
||||
srctblptr_sct0 equ rtl2_sct0+3
|
||||
tblnum_sct0 equ srctblptr_sct0+4
|
||||
|
||||
lda tblnum_sct0,s
|
||||
cmp #16
|
||||
blt valid_ok_sct
|
||||
ldx #badTableNum
|
||||
bra strip6_return
|
||||
|
||||
valid_ok_sct anop
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
|
||||
dbr_sct equ 1
|
||||
rtl1_sct equ dbr_sct+1
|
||||
rtl2_sct equ rtl1_sct+3
|
||||
srctblptr_sct equ rtl2_sct+3
|
||||
tblnum_sct equ srctblptr_sct+4
|
||||
|
||||
lda srctblptr_sct+2,s
|
||||
pha
|
||||
lda srctblptr_sct+2,s
|
||||
pha
|
||||
PushLong NowHndl
|
||||
jsr makePdp
|
||||
pld
|
||||
lda tblnum_sct+$08,s
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
asl a ; x32 bytes per color table
|
||||
clc
|
||||
adc 1,s
|
||||
sta 1,s
|
||||
PushLong #32 ; count
|
||||
_BlockMove
|
||||
|
||||
ldx #0 ; ignore the call! :-) - no errors
|
||||
plb
|
||||
|
||||
strip6_return lda 5,s
|
||||
sta 5+6,s
|
||||
lda 3,s
|
||||
sta 3+6,s
|
||||
lda 1,s
|
||||
sta 1+6,s
|
||||
pla
|
||||
pla
|
||||
pla
|
||||
txa
|
||||
cmp #1
|
||||
rtl
|
||||
|
||||
|
||||
*************************************
|
||||
* SetColorEntry Patch:
|
||||
* V1.0 - Coded - Dec 4 '92. JRM (1.0.1b2)
|
||||
|
||||
T2SetColorEntry name
|
||||
|
||||
rtl1_sce0 equ 1
|
||||
rtl2_sce0 equ rtl1_sce0+3
|
||||
newColor_sce0 equ rtl2_sce0+3
|
||||
entrynum_sce0 equ newColor_sce0+2
|
||||
tblnum_sce0 equ entrynum_sce0+2
|
||||
|
||||
lda tblnum_sce0,s
|
||||
cmp #16
|
||||
blt valid_ok1
|
||||
ldx #badTableNum
|
||||
bra strip6_return
|
||||
|
||||
valid_ok1 anop
|
||||
lda entrynum_sce0,s
|
||||
cmp #16
|
||||
blt valid_ok2
|
||||
ldx #badColorNum
|
||||
bra strip6_return
|
||||
|
||||
valid_ok2 anop
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
|
||||
dbr_sce equ 1
|
||||
rtl1_sce equ dbr_sce+1
|
||||
rtl2_sce equ rtl1_sce+3
|
||||
newColor_sce equ rtl2_sce+3
|
||||
entrynum_sce equ newColor_sce+2
|
||||
tblnum_sce equ entrynum_sce+2
|
||||
|
||||
lda tblnum_sce,s
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
asl a ; x32 bytes per color table
|
||||
clc
|
||||
adc entrynum_sce,s
|
||||
pha
|
||||
|
||||
PushLong NowHndl
|
||||
jsr makePdp
|
||||
|
||||
lda 7,s ; get at phx above
|
||||
tay
|
||||
lda newColor_sce+8,s
|
||||
sta [3],y
|
||||
|
||||
killLdp
|
||||
ply
|
||||
|
||||
ldx #0 ; ignore the call! :-) - no errors
|
||||
plb
|
||||
brl strip6_return
|
||||
|
||||
|
||||
*************************************
|
||||
* GetColorEntry Patch:
|
||||
* V1.0 - Coded - Dec 4 '92. JRM (1.0.1b2)
|
||||
|
||||
T2GetColorEntry name
|
||||
|
||||
rtl1_gce0 equ 1
|
||||
rtl2_gce0 equ rtl1_gce0+3
|
||||
entrynum_gce0 equ rtl2_gce0+3
|
||||
tblnum_gce0 equ entrynum_gce0+2
|
||||
result_gce0 equ tblnum_gce0+2
|
||||
|
||||
lda tblnum_gce0,s
|
||||
cmp #16
|
||||
blt valid_ok3
|
||||
ldx #badTableNum
|
||||
bra strip4_return
|
||||
|
||||
valid_ok3 anop
|
||||
lda entrynum_gce0,s
|
||||
cmp #16
|
||||
blt valid_ok4
|
||||
ldx #badColorNum
|
||||
bra strip4_return
|
||||
|
||||
valid_ok4 anop
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
|
||||
dbr_gce equ 1
|
||||
rtl1_gce equ dbr_gce+1
|
||||
rtl2_gce equ rtl1_gce+3
|
||||
entrynum_gce equ rtl2_gce+3
|
||||
tblnum_gce equ entrynum_gce+2
|
||||
result_gce equ tblnum_gce+2
|
||||
|
||||
lda tblnum_gce,s
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
asl a ; x32 bytes per color table
|
||||
clc
|
||||
adc entrynum_gce,s
|
||||
adc entrynum_gce,s
|
||||
pha
|
||||
|
||||
PushLong NowHndl
|
||||
jsr makePdp
|
||||
|
||||
lda 7,s ; get at phx above
|
||||
tay
|
||||
lda [3],y
|
||||
sta result_gce+8,s
|
||||
|
||||
killLdp
|
||||
ply
|
||||
|
||||
ldx #0 ; ignore the call! :-) - no errors
|
||||
plb
|
||||
|
||||
strip4_return lda 5,s
|
||||
sta 5+4,s
|
||||
lda 3,s
|
||||
sta 3+4,s
|
||||
lda 1,s
|
||||
sta 1+4,s
|
||||
pla
|
||||
pla
|
||||
txa
|
||||
cmp #1
|
||||
rtl
|
||||
|
||||
|
||||
*************************************
|
||||
* GetColorTable Patch:
|
||||
* V1.0 - Coded - Dec 4 '92. JRM (1.0.1b2)
|
||||
|
||||
T2GetColorTable name
|
||||
|
||||
rtl1_gct0 equ 1
|
||||
rtl2_gct0 equ rtl1_gct0+3
|
||||
desttblptr_gct0 equ rtl2_gct0+3
|
||||
tblnum_gct0 equ desttblptr_gct0+4
|
||||
|
||||
lda tblnum_gct0,s
|
||||
cmp #16
|
||||
blt valid_ok_gct
|
||||
ldx #badTableNum
|
||||
brl strip6_return
|
||||
|
||||
valid_ok_gct anop
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
|
||||
dbr_gct equ 1
|
||||
rtl1_gct equ dbr_gct+1
|
||||
rtl2_gct equ rtl1_gct+3
|
||||
desttblptr_gct equ rtl2_gct+3
|
||||
tblnum_gct equ desttblptr_gct+4
|
||||
|
||||
PushLong NowHndl
|
||||
jsr makePdp
|
||||
pld
|
||||
lda desttblptr_gct+2+4,s
|
||||
pha
|
||||
lda desttblptr_gct+2+4,s
|
||||
pha
|
||||
lda tblnum_gct+8,s
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
asl a ; x32 bytes per color table
|
||||
clc
|
||||
adc 5,s
|
||||
sta 5,s
|
||||
PushLong #32 ; count
|
||||
_BlockMove
|
||||
|
||||
ldx #0 ; ignore the call! :-) - no errors
|
||||
plb
|
||||
|
||||
brl strip6_return
|
||||
|
||||
*************************************
|
||||
T2SysBeep2 name
|
||||
|
||||
rtl1_sb2 equ 1
|
||||
rtl2_sb2 equ rtl1_sb2+3
|
||||
beepKind_sb2 equ rtl2_sb2+3
|
||||
|
||||
lda beepKind_sb2,s
|
||||
and #$3FFF
|
||||
cmp #sbScreenUnblanking
|
||||
beq ignore
|
||||
cmp #sbScreenBlanking
|
||||
beq ignore
|
||||
bra fakeKey
|
||||
|
||||
*************************************
|
||||
T2SysBeep name
|
||||
|
||||
fakeKey lda >OptionsFlag
|
||||
bit #fSysBeepsUnblank
|
||||
beq ignore ; sysbeeps don't unblank
|
||||
|
||||
lda >KbdChangedFlg
|
||||
inc a
|
||||
sta >KbdChangedFlg
|
||||
|
||||
mvw #TRUE,>BeepOverride
|
||||
|
||||
ignore anop
|
||||
brl next2vct
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
DispatchDATA Data
|
||||
debug 'DispatchDATA'
|
||||
|
||||
WaitCursorNow dc i'FALSE'
|
||||
WaitCursorAdr ds 4
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
264
source/twilight/twilight/equates
Normal file
264
source/twilight/twilight/equates
Normal file
|
@ -0,0 +1,264 @@
|
|||
|
||||
FALSE gequ 0
|
||||
TRUE gequ 1
|
||||
|
||||
* Action message codes sent to modules.
|
||||
MakeT2 gequ 0 ; Make module-specific ctls.
|
||||
SaveT2 gequ 1 ; Save new preferences
|
||||
BlankT2 gequ 2 ; Blank the screen.
|
||||
LoadSetupT2 gequ 3 ; Load any resources from yo' fork
|
||||
UnloadSetupT2 gequ 4 ; Dispose of any resources from yo' fk.
|
||||
KillT2 gequ 5 ; Module setup being closed.
|
||||
HitT2 gequ 6 ; Setup window control hit.
|
||||
|
||||
* Softswitch, etc, equates.
|
||||
SHADOWSHR gequ >$012000 ; SHR display buffer addr (shadowed)
|
||||
KBD gequ >$E0C000 ; keyboard strobe register
|
||||
KBDSTRB gequ >$E0C010
|
||||
RDVBLBAR gequ >$E0C019 ; bit 7 = 1 if not VBL
|
||||
RDTEXT gequ >$E0C01A
|
||||
TBCOLOR gequ >$E0C022 ; text and background color register
|
||||
KEYMODREG gequ >$E0C025 ; keyboard modifier register
|
||||
NEWVIDEO gequ >$E0C029 ; NewVideo SHR enable/disable register
|
||||
VERTCNT gequ >$E0C02E ; Vertical scanline counter
|
||||
HORIZCNT gequ >$E0C02F ; Horizontal scanline counter
|
||||
CLOCKCTL gequ >$E0C034 ; border color/real time clock register
|
||||
SHADOW gequ >$E0C035 ; shadowing enable/disable register
|
||||
TXTCLR gequ >$E0C050
|
||||
TXTSET gequ >$E0C051
|
||||
BUTN0 gequ >$E0C061 ; read joystick button 0
|
||||
BUTN1 gequ >$E0C062 ; read joystick button 1
|
||||
INCBUSY gequ >$E10064
|
||||
DECBUSY gequ >$E10068
|
||||
OS_KIND gequ >$E100BC ; $00 = ProDOS 8, $01 = GS/OS
|
||||
BUSYFLG gequ >$E100FF ; system busy flag
|
||||
SHR gequ >$E12000 ; address of SHR display buffer
|
||||
SCBS gequ >$E19D00 ; address of start of SCBs for SHR
|
||||
PALETTES gequ >$E19E00 ; address of start of SHR palettes
|
||||
|
||||
MaxFSTLen gequ 32 ; Maximum filename length supported
|
||||
|
||||
* Constants for resource types used by CDev.
|
||||
rT2Setup1 gequ $0001 ; T2 config reztype 1 (integer)
|
||||
rTwilightData gequ $1000 ; for twilight.data cache info
|
||||
rT2ExtSetup1 gequ $1001 ; T2 config reztype 1 (integer)
|
||||
rT2String gequ $1010
|
||||
|
||||
* Constants for custom resource types used by modules.
|
||||
rT2ModuleFlags gequ $D001 ; T2 module flags word reztype
|
||||
|
||||
* "Twilight.Setup" file information:
|
||||
setup_filetype gequ $005A ; configuration file
|
||||
setup_auxtype gequ $805B ; "Twilight II preferences"
|
||||
setup_access gequ $E3 ; normal access
|
||||
|
||||
* Defined bits of T2ModuleFlags module flag word.
|
||||
fSetup gequ $0001
|
||||
fFadeOut gequ $0002
|
||||
fFadeIn gequ $0004
|
||||
fGrafPort320 gequ $0008
|
||||
fGrafPort640 gequ $0010
|
||||
fLoadSetupBoot gequ $0020
|
||||
fLoadSetupBlank gequ $0040
|
||||
fOpenRForkWriteEnabled gequ $0080
|
||||
fMostCommonPalette gequ $0100
|
||||
fReqUsableScreen gequ $0200
|
||||
fLeavesUsableScreen gequ $0400
|
||||
;fPrematureExit gequ $1000
|
||||
fChecked gequ $2000
|
||||
fForeground gequ $0000 ; bit 14 = 0
|
||||
fBackground gequ $4000 ; bit 14 = 1
|
||||
fInternal gequ $8000
|
||||
|
||||
* Integers in corner preference resources.
|
||||
off gequ %000 ; ignore corner
|
||||
dontBlank gequ %001 ; don't blank
|
||||
bkgblanknow gequ %010 ; instant background blank now
|
||||
blanknow gequ %011 ; normal foreground blank now
|
||||
|
||||
* AuxIDs to use for allocating memory.
|
||||
bufferMemAuxID gequ $0100 ; auxID to allocate buffer memory with
|
||||
moduleDPAuxID gequ $0200 ; auxID to allocate module DP space w/
|
||||
pathBuffAuxID gequ $0300 ; auxID to allocate saved pathname buff
|
||||
listMemAuxID gequ $0400 ; auxID to allocate list memory with
|
||||
pathMemAuxID gequ $0500 ; auxID to allocate module pathnames
|
||||
NDAStructAuxID gequ $0600 ; auxID to allocate NDA structure with
|
||||
modNameAuxID gequ $0700 ; auxID to allocate module names with
|
||||
requestAuxID gequ $0800 ; auxID passed to AcceptRequests
|
||||
setupAuxID gequ $0900 ; auxID for allocating setup memory
|
||||
ndaAuxID gequ $0A00 ; auxID given to T2 NDA
|
||||
toolAuxID gequ $0B00 ; auxID for tool memory (dp, etc)
|
||||
; purgeSHRAuxID gequ $0C00 ; auxID for allocating 01 shr as purgable
|
||||
miscAuxID gequ $0E00 ; auxID for miscellaneous allocations
|
||||
codeRezAuxID gequ $0F00 ; auxID to allocate codeResource with (Must be F!)
|
||||
|
||||
* Request codes supported by the INIT.
|
||||
reqOpenT2PrefFile gequ $8000
|
||||
reqFadeOut gequ $8001
|
||||
reqFadeIn gequ $8002
|
||||
reqBlankScreen gequ $8003
|
||||
reqLoadModule gequ $8004
|
||||
reqInstallNDA gequ $8005
|
||||
reqRemoveNDA gequ $8006
|
||||
reqDLZSS gequ $8007
|
||||
reqConcatenate gequ $8008
|
||||
reqRandomize gequ $8009
|
||||
reqRemoveT2 gequ $800A
|
||||
reqSetBuffers gequ $800B
|
||||
lastRequestNum gequ $800B+1
|
||||
|
||||
* T2 External IPC
|
||||
firstT2IPC gequ $9000
|
||||
t2TurnOn gequ $9000
|
||||
t2TurnOff gequ $9001
|
||||
t2BoxOverrideOff gequ $9002
|
||||
t2BoxOverrideOn gequ $9003
|
||||
t2GetInfo gequ $9004
|
||||
t2StartupTools gequ $9005
|
||||
t2ShutdownTools gequ $9006
|
||||
t2ShareMemory gequ $9007
|
||||
t2SetBlinkProc gequ $9008
|
||||
t2ForceBkgBlank gequ $9009
|
||||
t2BkgBlankNow gequ $900A
|
||||
t2GetBuffers gequ $900B
|
||||
t2Reserved1 gequ $900C ; was t2GetVersion
|
||||
t2CalcFreqOffset gequ $900D
|
||||
lastT2IPC gequ $900D+1
|
||||
|
||||
* T2 Private IPC
|
||||
firstT2PrivIPC gequ $9020
|
||||
t2PrivGetProcs gequ $9020
|
||||
lastT2PrivIPC gequ $9020+1
|
||||
|
||||
* order of rects in rRectList resource
|
||||
oBlinkBoxRect640 gequ 0
|
||||
oBlinkBoxRect320 gequ 1
|
||||
oULRect gequ 2
|
||||
oURRect320 gequ 3
|
||||
oURRect640 gequ 4
|
||||
oLLRect gequ 5
|
||||
oLRRect320 gequ 6
|
||||
oLRRect640 gequ 7
|
||||
|
||||
* misc..
|
||||
ListMemberSize gequ 15 ; Size of each list member (bytes)
|
||||
T2_module_path gequ $07FEFFFF ; ID of changed module path wString
|
||||
|
||||
* Popup control template equates.
|
||||
oMenuRef gequ $1C
|
||||
oInitialValue gequ $20
|
||||
|
||||
* Menu template equates.
|
||||
oItemRefArray gequ $0A
|
||||
|
||||
* Menu item template equates.
|
||||
oItemTitleRef gequ $0A
|
||||
|
||||
* List control record equates.
|
||||
oCtlMemDraw gequ $28
|
||||
|
||||
* StatText control template equates..
|
||||
oStatText_textRef gequ $1A
|
||||
|
||||
* Defined bits of OptionsRez
|
||||
fT2Active gequ $0001 ; bit 0
|
||||
fBlinkingBox gequ $0002 ; bit 1
|
||||
fCapsLockLock gequ $0004 ; bit 2
|
||||
fWarningAlerts gequ $0008 ; bit 3
|
||||
fInstallNDA gequ $0010 ; bit 4
|
||||
fRandomize gequ $0020 ; bit 5
|
||||
fLetMouseRestore gequ $0040 ; bit 6
|
||||
fNoSound gequ $0080 ; bit 7 (v1.0.1b2 - 12/13/92)
|
||||
fWatchBkgBlank gequ $0000 ; bits 8-9: 00 = watchbkgblank
|
||||
fWatchDontBlank gequ $0100 ; 01 = watchdontblank
|
||||
fWatchNormBlank gequ $0200 ; 10 = watchnormblank
|
||||
fDClickPreview gequ $0000 ; bits 10-11: 00 = dclickpreviewmodule
|
||||
fDClickClose gequ $0400 ; 01 = dclickcloset2
|
||||
fDClickSetup gequ $0800 ; 10 = dclicksetupmodule
|
||||
fDClickToggle gequ $0C00 ; 11 = dclickToggle
|
||||
fTextBkgBlank gequ $0000 ; bits 12-13: 00 = textbkgblank
|
||||
fTextGSOSBlank gequ $1000 ; 01 = textgsosblank
|
||||
fTextDontBlank gequ $2000 ; 10 = textdontblank
|
||||
fSysBeepsUnblank gequ $4000 ; bit 14 (v1.0.1b2 - 12/13/92)
|
||||
fUseIntelliKey gequ $8000 ; bit 15 (v1.0.1b2 - 12/13/92) - end!
|
||||
* And Options2Rez
|
||||
fLowMemoryMode gequ $0001 ; bit 0
|
||||
fSHRCorners gequ $0002 ; bit 1
|
||||
fSwapModules gequ $0004 ; bit 2
|
||||
fPassword gequ $0008 ; bit 3
|
||||
fNewModulePath gequ $0010 ; bit 4
|
||||
|
||||
* how many modules will fit in the list memory buffer we initially allocate
|
||||
startListMem gequ 10
|
||||
|
||||
* DataField equates.
|
||||
SetFieldValue gequ $8000 ;custom control messages that are
|
||||
GetFieldValue gequ $8001 ; accepted by DataField
|
||||
|
||||
* ipc for "ScreenSaverAware~"
|
||||
ssaSHRBlanking gequ $8000
|
||||
ssaSHRUnblanking gequ $8001
|
||||
ssaTextBlanking gequ $8002
|
||||
ssaTextUnblanking gequ $8003
|
||||
|
||||
ssaForegroundBlank gequ 0
|
||||
ssaBackgroundBlank gequ 1
|
||||
|
||||
T2 gequ $5432 ; "T2" in ascii...
|
||||
|
||||
T2Version gequ $8200 ; v2.0b1
|
||||
|
||||
* T2 module flags resource offsets...
|
||||
oMF_version gequ 0 ; byte - mf version (should be 1)
|
||||
oMF_flags gequ oMF_version+1 ; word - module flags
|
||||
oMF_enabled gequ oMF_flags+2 ; byte - enabled flag (unimplemented)
|
||||
oMF_min_ver gequ oMF_enabled+1 ; word - minimum T2 version required
|
||||
oMF_reserved gequ oMF_min_ver+2 ; word - reserved for future expansion
|
||||
oMF_module_name gequ oMF_reserved+2 ; 25 char pstring (25 + 1 length byte)
|
||||
oMF_eos gequ oMF_module_name+26 ; end of structure
|
||||
|
||||
|
||||
* Flag word passed to modules at loadsetupT2 time in T2Data2 (lo)
|
||||
* (lmi = loadMessageInput)
|
||||
lmiOverrideSound gequ $0001 ; bit 0. 1=override sound, 0=sound ok
|
||||
|
||||
* Flag word passed to mdoules at blankT2 time in T2Data2 (lo)
|
||||
* (bmi = blankMessageInput)
|
||||
bmiBlankNow gequ $0001
|
||||
|
||||
|
||||
* bits of BlankT2's T2Result - hi word (blankmessageresult)
|
||||
bmrNextModule gequ $0100
|
||||
bmrFadeIn gequ $0200
|
||||
bmrLeavesUsableScreen gequ $0400
|
||||
|
||||
* bits of LoadSetupT2's T2Result - lo word (loadmessageresult)
|
||||
lmrReqUsableScreen gequ $0001 ; requires usable screen
|
||||
lmrFadeOut gequ $0002 ; fade out after all
|
||||
lmrMostCommonPalette gequ $0004 ; mcp after all
|
||||
|
||||
* 'Twilight.Data' offsets......
|
||||
|
||||
odata_Signature gequ 0
|
||||
odata_Version gequ odata_Signature+2 ; 2
|
||||
odata_num_modules gequ odata_Version+2 ; 4
|
||||
odata_num_support_setup gequ odata_num_modules+2 ; 6
|
||||
odata_t2dir_mod_TD gequ odata_num_support_setup+2 ; 8
|
||||
odata_dirInfo gequ odata_t2dir_mod_TD+8 ; 16
|
||||
odata_moduleFlags gequ odata_dirInfo+32 ; 48
|
||||
odata_moduleFName gequ odata_moduleFlags+34 ; 82
|
||||
odata_end gequ odata_moduleFName+34 ; +maxFSTLen+2 = 116
|
||||
|
||||
header_size gequ odata_dirInfo
|
||||
|
||||
* file format:
|
||||
* 00-01: signature - "T2" ascii
|
||||
* 02-03: version - 0002 - v2 (version number)
|
||||
* 04-05: num_modules - to follow
|
||||
* 06-07: num_support_setup - (cannot exceed num_modules)
|
||||
* 08-15: t2dir_mod_TD - modification time/date of t2 directory (8 bytes)
|
||||
* start of module_data
|
||||
* 16-47: dirInfo - (32 bytes) directory entry info, module 1
|
||||
* 48-81: moduleFlags - (34 bytes) rT2moduleFlags, module 1
|
||||
* 82-115: moduleFName (34 bytes, MaxFSTLen+2) - filename of module
|
||||
* etc.
|
1541
source/twilight/twilight/init.asm
Normal file
1541
source/twilight/twilight/init.asm
Normal file
File diff suppressed because it is too large
Load Diff
804
source/twilight/twilight/init.mac
Normal file
804
source/twilight/twilight/init.mac
Normal file
|
@ -0,0 +1,804 @@
|
|||
MACRO
|
||||
&lab pulllong &addr1,&addr2
|
||||
&lab ANOP
|
||||
AIF C:&addr1=0,.a
|
||||
AIF C:&addr2=0,.b
|
||||
LCLC &C
|
||||
&C AMID &addr1,1,1
|
||||
AIF "&C"="[",.zeropage
|
||||
pullword &addr1
|
||||
sta &addr2
|
||||
pullword &addr1+2
|
||||
sta &addr2+2
|
||||
MEXIT
|
||||
.a
|
||||
pullword
|
||||
pullword
|
||||
MEXIT
|
||||
.b
|
||||
pullword &addr1
|
||||
pullword &addr1+2
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&addr2
|
||||
pullword &addr1,y
|
||||
ldy #&addr2+2
|
||||
pullword &addr1,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pullword &SYSOPR
|
||||
&lab ANOP
|
||||
pla
|
||||
AIF C:&SYSOPR=0,.end
|
||||
sta &SYSOPR
|
||||
.end
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushlong &addr,&offset
|
||||
&lab ANOP
|
||||
LCLC &C
|
||||
LCLC &REST
|
||||
&C AMID &addr,1,1
|
||||
AIF "&C"="#",.immediate
|
||||
AIF "&C"="[",.zeropage
|
||||
AIF C:&offset=0,.nooffset
|
||||
AIF "&offset"="s",.stack
|
||||
pushword &addr+2,&offset
|
||||
pushword &addr,&offset
|
||||
MEXIT
|
||||
.nooffset
|
||||
pushword &addr+2
|
||||
pushword &addr
|
||||
MEXIT
|
||||
.immediate
|
||||
&REST AMID &addr,2,L:&addr-1
|
||||
dc I1'$F4',I2'(&REST)|-16'
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEXIT
|
||||
.stack
|
||||
pushword &addr+2,s
|
||||
pushword &addr+2,s
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&offset+2
|
||||
pushword &addr,y
|
||||
ldy #&offset
|
||||
pushword &addr,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushword &SYSOPR
|
||||
&lab ANOP
|
||||
AIF C:&SYSOPR=0,.b
|
||||
LCLC &C
|
||||
&C AMID "&SYSOPR",1,1
|
||||
AIF ("&C"="#").AND.(S:LONGA),.immediate
|
||||
lda &SYSOPR
|
||||
pha
|
||||
MEXIT
|
||||
.b
|
||||
pha
|
||||
MEXIT
|
||||
.immediate
|
||||
LCLC &REST
|
||||
LCLA &BL
|
||||
&BL ASEARCH "&SYSOPR"," ",1
|
||||
AIF &BL>0,.a
|
||||
&BL SETA L:&SYSOPR+1
|
||||
.a
|
||||
&REST AMID "&SYSOPR",2,&BL-2
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEND
|
||||
MACRO
|
||||
&lab 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
|
||||
&lab killLdp
|
||||
&lab pld
|
||||
ply
|
||||
ply
|
||||
MEND
|
||||
MACRO
|
||||
&lab makeDP
|
||||
&lab phd
|
||||
tsc
|
||||
tcd
|
||||
MEND
|
||||
macro
|
||||
&lab ptr &location
|
||||
&lab anop
|
||||
aif c:&location=1,.value
|
||||
ds 4
|
||||
mexit
|
||||
.value
|
||||
dc i4'&location'
|
||||
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 _SendRequest
|
||||
&lab ldx #$1c01
|
||||
jsl $E10000
|
||||
mend
|
||||
macro
|
||||
&lab ~SysBeep2 &beepkind
|
||||
&lab ph2 &beepkind
|
||||
Tool $3803
|
||||
mend
|
||||
macro
|
||||
&lab WordResult &zero
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zero
|
||||
phd
|
||||
mexit
|
||||
.zero
|
||||
&lab pea $0000
|
||||
mend
|
||||
macro
|
||||
&lab LongResult &zeros
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zeros
|
||||
phd
|
||||
phd
|
||||
mexit
|
||||
.zeros
|
||||
pea $0000
|
||||
pea $0000
|
||||
mend
|
||||
macro
|
||||
&lab ph2 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid "&addr",1,1
|
||||
aif "&char"="@",.accumulator
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif C:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.accumulator
|
||||
pha
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea &addr
|
||||
mexit
|
||||
.zeropage
|
||||
aif C:&offset<>0,.zeroPageOff
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOff
|
||||
aif "&offset"="X",.zeroPageReg
|
||||
aif "&offset"="Y",.ze
|
||||
oPageReg
|
||||
aif "&offset"="x",.zeroPageReg
|
||||
aif "&offset"="y",.zeroPageReg
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageReg
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mend
|
||||
macro
|
||||
&lab ~SchAddTask &taskPtr
|
||||
&lab WordResult
|
||||
ph4 &taskPtr
|
||||
Tool $0907
|
||||
mend
|
||||
MACRO
|
||||
&lab mvw &num1,&num2
|
||||
&lab lda &num1
|
||||
sta &num2
|
||||
MEND
|
||||
MACRO
|
||||
&lab mvl &srcLong,&dstLong
|
||||
&lab ANOP
|
||||
LCLC &C
|
||||
&C AMID &srcLong,1,1
|
||||
AIF "&C"="#",.direct
|
||||
lda &srcLong
|
||||
sta &dstLong
|
||||
lda &srcLong+2
|
||||
sta &dstLong+2
|
||||
MEXIT
|
||||
.direct
|
||||
lda &srcLong
|
||||
sta &dstLong
|
||||
lda &srcLong|-16
|
||||
sta &dstLong+2
|
||||
MEND
|
||||
macro
|
||||
&lab Tool &number
|
||||
&lab ldx #&number
|
||||
jsl $E10000
|
||||
mend
|
||||
MACRO
|
||||
&lab _NewHandle
|
||||
&lab ldx #$0902
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~DisposeHandle &theHandle
|
||||
&lab ph4 &theHandle
|
||||
Tool $1002
|
||||
mend
|
||||
macro
|
||||
&lab ~CloseResourceFile &fileID
|
||||
&lab ph2 &fileID
|
||||
Tool $0B1E
|
||||
mend
|
||||
macro
|
||||
&lab ~GetCurResourceFile
|
||||
&lab WordResult
|
||||
Tool $121E
|
||||
mend
|
||||
macro
|
||||
&lab ph4 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &addr,1,1
|
||||
aif "&char"="@",.registers
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif c:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
.yesoffset
|
||||
lda &addr+2,&offset
|
||||
pha
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr+2
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr+2,s
|
||||
pha
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.registers
|
||||
phy
|
||||
phx
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea +(&addr)|-16
|
||||
pea &addr
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr+2
|
||||
pei &addr
|
||||
mexit
|
||||
.zeroPage
|
||||
aif C:&offset<>0,.zeroPageOffset
|
||||
ldy #2
|
||||
lda &addr,y
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOffset
|
||||
aif "&offset"="X",.zeroPageRegX
|
||||
aif "&offset"="Y",.zeroPageRegY
|
||||
aif "&offset"="x",.zeroPageRegX
|
||||
aif "&offset"="y",.zeroPageRegY
|
||||
ldy #&offset+2
|
||||
lda &addr,y
|
||||
pha
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageRegX
|
||||
lda &addr,&offset
|
||||
tay
|
||||
inx
|
||||
inx
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phy
|
||||
mexit
|
||||
.zeroPageRegY
|
||||
lda &addr,&offset
|
||||
tax
|
||||
iny
|
||||
iny
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phx
|
||||
mend
|
||||
MACRO
|
||||
&lab dbrk &num
|
||||
aif t:debugBreaks="G",.begin
|
||||
mexit
|
||||
.begin
|
||||
brk &num
|
||||
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 errorbrk &op
|
||||
&lab anop
|
||||
aif t:debugCode="G",.doit
|
||||
mexit
|
||||
.doit
|
||||
bcc *+4
|
||||
aif c:&op=1,.value
|
||||
brk $BB
|
||||
mexit
|
||||
.value
|
||||
brk &op
|
||||
mend
|
||||
MACRO
|
||||
&lab ename
|
||||
&lab entry
|
||||
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
|
||||
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 LONG
|
||||
&lab equ &DummyPC
|
||||
&DummyPC SETA &DummyPC+4
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetHandleId
|
||||
&lab ldx #$3002
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab C1Result &size,&text
|
||||
&lab anop
|
||||
&lab._bufsize dw &size
|
||||
aif c:&text=0,.nodefault
|
||||
&lab._textlen dw l:&text
|
||||
&lab._text dc c"&text"
|
||||
ds &size-4-(l:&text)
|
||||
mexit
|
||||
.nodefault
|
||||
&lab._textlen dw
|
||||
&lab._text ds &size-$04
|
||||
mend
|
||||
macro
|
||||
&lab dw &location
|
||||
&lab anop
|
||||
aif c:&location<>0,.exists
|
||||
ds 2
|
||||
mexit
|
||||
.exists
|
||||
dc i2'&location'
|
||||
mend
|
||||
macro
|
||||
&lab RefInfoRecGS ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._refNum dc i2'¶meters(1)'
|
||||
&lab._access dc i2'¶meters(2)'
|
||||
aif c:¶meters=2,.exit
|
||||
&lab._pathName dc i4'¶meters(3)'
|
||||
.exit
|
||||
mend
|
||||
MACRO
|
||||
&lab _GetOpenFileRefNum
|
||||
&lab ldx #$1F1E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _GetRefInfoGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2039"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetNewID &idTag
|
||||
&lab WordResult
|
||||
ph2 &idTag
|
||||
Tool $2003
|
||||
mend
|
||||
macro
|
||||
&lab ~LoadResource &resourceType,&resourceID
|
||||
&lab LongResult
|
||||
ph2 &resourceType
|
||||
ph4 &resourceID
|
||||
Tool $0E1E
|
||||
mend
|
||||
macro
|
||||
&lab ~ReleaseResource &purgeLevel,&resourceType,&resourceID
|
||||
&lab ph2 &purgeLevel
|
||||
ph2 &resourceType
|
||||
ph4 &resourceID
|
||||
Tool $171E
|
||||
mend
|
||||
macro
|
||||
&lab ~MessageByName &createItFlag,&recordPtr
|
||||
&lab LongResult
|
||||
ph2 &createItFlag
|
||||
ph4 &recordPtr
|
||||
Tool $1701
|
||||
mend
|
||||
macro
|
||||
&lab ~DetachResource &resourceType,&resourceID
|
||||
&lab ph2 &resourceType
|
||||
ph4 &resourceID
|
||||
Tool $181E
|
||||
mend
|
||||
MACRO
|
||||
&lab _Multiply
|
||||
&lab ldx #$090B
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _PtrToHand
|
||||
&lab ldx #$2802
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _DisposeAll
|
||||
&lab ldx #$1102
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~HLock &theHandle
|
||||
&lab ph4 &theHandle
|
||||
Tool $2002
|
||||
mend
|
||||
MACRO
|
||||
&lab str &string
|
||||
&lab dc i1'L:&string',C'&string'
|
||||
MEND
|
||||
MACRO
|
||||
&lab _ReleaseResource
|
||||
&lab ldx #$171E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _LoadResource
|
||||
&lab ldx #$0E1E
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab handle
|
||||
&lab ds 4
|
||||
mend
|
||||
macro
|
||||
&lab boolean &onoff
|
||||
&lab anop
|
||||
aif c:&onoff=1,.value
|
||||
dc i'0'
|
||||
mexit
|
||||
.value
|
||||
dc i'&onoff'
|
||||
mend
|
||||
macro
|
||||
&lab ~ReadKeyMicroData &dataLength,&dataPtr,&adbCommand
|
||||
&lab ph2 &dataLength
|
||||
ph4 &dataPtr
|
||||
ph2 &adbCommand
|
||||
Tool $0A09
|
||||
mend
|
||||
macro
|
||||
&lab ~DelHeartBeat &taskPtr
|
||||
&lab ph4 &taskPtr
|
||||
Tool $1303
|
||||
mend
|
||||
macro
|
||||
&lab _AcceptRequests
|
||||
&lab ldx #$1b01
|
||||
jsl $E10000
|
||||
mend
|
||||
MACRO
|
||||
&lab _AddNotifyProcGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2034"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
MACRO
|
||||
&lab _FSTSpecific ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2033"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
MACRO
|
||||
&lab _VolumeGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2008"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
MACRO
|
||||
&lab _WaitCursor
|
||||
&lab ldx #$0A12
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _InitCursor
|
||||
&lab ldx #$CA04
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~AddToRunQ &runItemPtr
|
||||
&lab ph4 &runItemPtr
|
||||
Tool $1F05
|
||||
mend
|
||||
macro
|
||||
&lab ~EMStatus
|
||||
&lab WordResult 0
|
||||
Tool $0606
|
||||
mend
|
||||
macro
|
||||
&lab ~Int2Hex &intValue,&strPtr,&strLength
|
||||
&lab ph2 &intValue
|
||||
ph4 &strPtr
|
||||
ph2 &strLength
|
||||
Tool $220B
|
||||
mend
|
||||
macro
|
||||
&lab ~MenuStatus
|
||||
&lab WordResult
|
||||
Tool $060F
|
||||
mend
|
||||
macro
|
||||
&lab ~SetHeartBeat &taskPtr
|
||||
&lab ph4 &taskPtr
|
||||
Tool $1203
|
||||
mend
|
||||
macro
|
||||
&lab ~QDStatus
|
||||
&lab WordResult 0
|
||||
Tool $0604
|
||||
mend
|
||||
macro
|
||||
&lab ~GetNameGS ¶ms
|
||||
&lab ~~GSOS $2027,¶ms
|
||||
mend
|
||||
macro
|
||||
&lab GetNameRecGS ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._dataBuffer dc i4'¶meters(1)'
|
||||
mend
|
||||
macro
|
||||
&lab NotifyRecGS ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._procPtr dc i4'¶meters(1)'
|
||||
mend
|
||||
macro
|
||||
&lab VolumeRecGS ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._devName dc i4'¶meters(1)'
|
||||
&lab._volName dc i4'¶meters(2)'
|
||||
aif c:¶meters=2,.exit
|
||||
&lab._totalBlocks dc i4'¶meters(3)'
|
||||
aif c:¶meters=3,.exit
|
||||
&lab._freeBlocks dc i4'¶meters(4)'
|
||||
aif c:¶meters=4,.exit
|
||||
&lab._fileSysID dc i2'¶meters(5)'
|
||||
aif c:¶meters=5,.exit
|
||||
&lab._blockSize dc i2'¶meters(6)'
|
||||
aif c:¶meters=6,.exit
|
||||
&lab._characteristics dc i2'¶meters(7)'
|
||||
aif c:¶meters=7,.exit
|
||||
&lab._deviceID dc i2'¶meters(8)'
|
||||
.exit
|
||||
mend
|
||||
macro
|
||||
&lab GetUserPathRec ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._fileSysID dc i2'¶meters(1)'
|
||||
&lab._commandNum dc i2'¶meters(2)'
|
||||
&lab._prefixPtr dc i4'¶meters(3)'
|
||||
mend
|
||||
macro
|
||||
&lab ~~GSOS &number,¶ms
|
||||
&lab jsl $E100A8
|
||||
dw &number
|
||||
dl ¶ms
|
||||
mend
|
||||
macro
|
||||
&lab dl &location
|
||||
&lab anop
|
||||
aif c:&location<>0,.exists
|
||||
ds 4
|
||||
mexit
|
||||
.exists
|
||||
dc i4'&location'
|
||||
mend
|
||||
MACRO
|
||||
&lab _SystemTask
|
||||
&lab ldx #$1905
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab DevNumRecGS ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._devName dc i4'¶meters(1)'
|
||||
&lab._devNum dc i2'¶meters(2)'
|
||||
mend
|
||||
macro
|
||||
&lab DInfoRecGS ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._devNum dc i2'¶meters(1)'
|
||||
&lab._devName dc i4'¶meters(2)'
|
||||
aif c:¶meters=2,.exit
|
||||
&lab._characteristics dc i2'¶meters(3)'
|
||||
aif c:¶meters=3,.exit
|
||||
&lab._totalBlocks dc i4'¶meters(4)'
|
||||
aif c:¶meters=4,.exit
|
||||
&lab._slotNum dc i2'¶meters(5)'
|
||||
aif c:¶meters=5,.exit
|
||||
&lab._unitNum dc i2'¶meters(6)'
|
||||
aif c:¶meters=6,.exit
|
||||
&lab._version dc i2'¶meters(7)'
|
||||
aif c:¶meters=7,.exit
|
||||
&lab._deviceID dc i2'¶meters(8)'
|
||||
aif c:¶meters=8,.exit
|
||||
&lab._headLink dc i2'¶meters(9)'
|
||||
aif c:¶meters=9,.exit
|
||||
&lab._forwardLink dc i2'¶meters(10)'
|
||||
aif c:¶meters=10,.exit
|
||||
&lab._extendedDIBPtr dc i4'¶meters(11)'
|
||||
.exit
|
||||
mend
|
||||
MACRO
|
||||
&lab _DInfoGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$202C"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
MACRO
|
||||
&lab _GetDevNumberGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2020"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
MACRO
|
||||
&lab _BlockMove
|
||||
&lab ldx #$2B02
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetVector
|
||||
&lab ldx #$1003
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetVector &VRN
|
||||
&lab LongResult
|
||||
ph2 &VRN
|
||||
Tool $1103
|
||||
mend
|
||||
MACRO
|
||||
&lab shortmx
|
||||
&lab ANOP
|
||||
sep #%00110000
|
||||
longa off
|
||||
longi off
|
||||
MEND
|
||||
MACRO
|
||||
&lab EndLocals
|
||||
&lab equ &DummyPC-1
|
||||
MEND
|
||||
MACRO
|
||||
&lab _GetHandleSize
|
||||
&lab ldx #$1802
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _HandToPtr
|
||||
&lab ldx #$2902
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _DisposeHandle
|
||||
&lab ldx #$1002
|
||||
jsl $E10000
|
||||
MEND
|
1141
source/twilight/twilight/ipc.asm
Normal file
1141
source/twilight/twilight/ipc.asm
Normal file
File diff suppressed because it is too large
Load Diff
220
source/twilight/twilight/ipc.mac
Normal file
220
source/twilight/twilight/ipc.mac
Normal file
|
@ -0,0 +1,220 @@
|
|||
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 killLdp
|
||||
&lab pld
|
||||
ply
|
||||
ply
|
||||
MEND
|
||||
MACRO
|
||||
&lab makeDP
|
||||
&lab phd
|
||||
tsc
|
||||
tcd
|
||||
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 LongResult &zeros
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zeros
|
||||
phd
|
||||
phd
|
||||
mexit
|
||||
.zeros
|
||||
pea $0000
|
||||
pea $0000
|
||||
mend
|
||||
MACRO
|
||||
&lab mvw &num1,&num2
|
||||
&lab lda &num1
|
||||
sta &num2
|
||||
MEND
|
||||
MACRO
|
||||
&lab _NewHandle
|
||||
&lab ldx #$0902
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~DisposeHandle &theHandle
|
||||
&lab ph4 &theHandle
|
||||
Tool $1002
|
||||
mend
|
||||
macro
|
||||
&lab ph4 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &addr,1,1
|
||||
aif "&char"="@",.registers
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif c:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
.yesoffset
|
||||
lda &addr+2,&offset
|
||||
pha
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr+2
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr+2,s
|
||||
pha
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.registers
|
||||
phy
|
||||
phx
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea +(&addr)|-16
|
||||
pea &addr
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr+2
|
||||
pei &addr
|
||||
mexit
|
||||
.zeroPage
|
||||
aif C:&offset<>0,.zeroPageOffset
|
||||
ldy #2
|
||||
lda &addr,y
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOffset
|
||||
aif "&offset"="X",.zeroPageRegX
|
||||
aif "&offset"="Y",.zeroPageRegY
|
||||
aif "&offset"="x",.zeroPageRegX
|
||||
aif "&offset"="y",.zeroPageRegY
|
||||
ldy #&offset+2
|
||||
lda &addr,y
|
||||
pha
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageRegX
|
||||
lda &addr,&offset
|
||||
tay
|
||||
inx
|
||||
inx
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phy
|
||||
mexit
|
||||
.zeroPageRegY
|
||||
lda &addr,&offset
|
||||
tax
|
||||
iny
|
||||
iny
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phx
|
||||
mend
|
||||
MACRO
|
||||
&lab 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
|
||||
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 LONG
|
||||
&lab equ &DummyPC
|
||||
&DummyPC SETA &DummyPC+4
|
||||
MEND
|
||||
macro
|
||||
&lab Tool &number
|
||||
&lab ldx #&number
|
||||
jsl $E10000
|
||||
mend
|
||||
MACRO
|
||||
&lab _SANEStartUp
|
||||
&lab ldx #$020A
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SANEShutDown
|
||||
&lab ldx #$030A
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SoundShutDown
|
||||
&lab ldx #$0308
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SoundStartUp
|
||||
&lab ldx #$0208
|
||||
jsl $E10000
|
||||
MEND
|
465
source/twilight/twilight/library.asm
Normal file
465
source/twilight/twilight/library.asm
Normal file
|
@ -0,0 +1,465 @@
|
|||
setcom 80
|
||||
mcopy library.mac
|
||||
keep library
|
||||
copy equates
|
||||
copy debug.equ
|
||||
*-----------------------------------------------------------------------------*
|
||||
* Twilight II's LIBRARY.ASM Source Code Segment (Part of the INIT.)
|
||||
* Segmented: 18 January 1993 - JRM.
|
||||
*-----------------------------------------------------------------------------*
|
||||
* Random routines... v1.0
|
||||
*-----------------------------------------------------------------------------*
|
||||
random Start
|
||||
debug 'random'
|
||||
|
||||
copy 22:debug.asm
|
||||
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
clc
|
||||
phx
|
||||
phy
|
||||
ldx INDEXI
|
||||
ldy INDEXJ
|
||||
lda ARRAY-2,X
|
||||
adc ARRAY-2,Y
|
||||
sta ARRAY-2,X
|
||||
dex
|
||||
dex
|
||||
bne JM_DY
|
||||
ldx #17*2 ;Cycle index if at end of
|
||||
JM_DY dey ; the array
|
||||
dey
|
||||
bne SETIX
|
||||
ldy #17*2
|
||||
SETIX stx INDEXI
|
||||
sty INDEXJ
|
||||
ply
|
||||
plx
|
||||
plb
|
||||
rtl
|
||||
|
||||
INDEXI dc i'17*2' ;The relative positions of
|
||||
INDEXJ dc i'5*2' ; these indexes is crucial
|
||||
|
||||
ARRAY dc i'1,1,2,3,5,8,13,21,54,75,129,204'
|
||||
dc i'323,527,850,1377,2227'
|
||||
|
||||
seed anop
|
||||
pha
|
||||
ora #1 ;At least one must be odd
|
||||
sta ARRAY
|
||||
stx ARRAY+2
|
||||
phx ;Push index regs on stack
|
||||
phy
|
||||
ldx #30
|
||||
loop 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 loop
|
||||
lda #17*2
|
||||
sta INDEXI ;Init proper indexes
|
||||
lda #5*2 ; into array
|
||||
sta INDEXJ
|
||||
jsl random ;Warm the generator up.
|
||||
jsl random
|
||||
jsl random
|
||||
jsl random
|
||||
ply
|
||||
plx
|
||||
pla
|
||||
plb
|
||||
rtl
|
||||
|
||||
* Set random number seed
|
||||
* v1.0.1 JRM 29 Nov 1992 - more random :-) (readtimehex) (v1.0.1b1)
|
||||
* v1.0.2 JRM 19 Dec 1992 - yet more random. much better. (v1.0.1b3)
|
||||
* v1.0.3 JRM 30 Dec 1992 - hopefully fixed fINALLY (v1.0.1b3)
|
||||
|
||||
set_random_seed entry
|
||||
debug 'set_random_seed'
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
|
||||
~GetTick
|
||||
pla
|
||||
sta fill1+1
|
||||
pla
|
||||
sta fill2+1
|
||||
|
||||
~ReadTimeHex
|
||||
lda 7,s ; day of week | filler
|
||||
; and #$FFF0 ; isolate day of week + hi nib fill
|
||||
ror a
|
||||
ror a
|
||||
ror a
|
||||
ror a
|
||||
sta 7,s
|
||||
|
||||
lda 1,s ; minute | second
|
||||
and #$F0FF ; isolate hi nib min + second
|
||||
rol a
|
||||
rol a
|
||||
rol a
|
||||
rol a
|
||||
tax
|
||||
lda $FF0000,x
|
||||
xba
|
||||
eor 1,s
|
||||
eor 5,s ; month | date
|
||||
eor 7,s
|
||||
fill1 eor #0
|
||||
eor VERTCNT
|
||||
tay
|
||||
|
||||
lda 7,s
|
||||
xba
|
||||
sta 7,s
|
||||
|
||||
lda 1,s ; minute | second
|
||||
and #$0FFF ; isolate lo nib min + second
|
||||
xba
|
||||
tax
|
||||
lda $FE0000,x
|
||||
xba
|
||||
; ora 5,s
|
||||
; and 3,s ; current year | hour
|
||||
eor 7,s
|
||||
eor 1,s
|
||||
fill2 eor #0
|
||||
eor VERTCNT
|
||||
|
||||
tyx
|
||||
ply
|
||||
ply
|
||||
ply
|
||||
ply
|
||||
brl seed
|
||||
|
||||
lda 1,s ; minute | second
|
||||
xba
|
||||
eor 1,s
|
||||
eor 5,s ; month | date
|
||||
eor 7,s
|
||||
tax
|
||||
|
||||
lda 7,s
|
||||
xba
|
||||
sta 7,s
|
||||
|
||||
lda 1,s ; minute | second
|
||||
; and #$00FF ; isolate second
|
||||
ora 5,s
|
||||
;; eor 3,s ; current year | hour
|
||||
and 3,s ; current year | hour
|
||||
eor 7,s
|
||||
eor 1,s
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
* Plot Routines:
|
||||
* v1.0 - 17-8 Jan 1993 - JRM - coded
|
||||
*-----------------------------------------------------------------------------*
|
||||
setup_plot Start
|
||||
|
||||
dbr equ 1
|
||||
rtlAddr equ dbr+1
|
||||
screenPtr equ rtlAddr+3
|
||||
lookupPtr equ screenPtr+4
|
||||
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
|
||||
lda lookupPtr,s
|
||||
sta patchLook+1
|
||||
lda lookupPtr+2,s
|
||||
shortm
|
||||
sta patchLook+3
|
||||
longm
|
||||
|
||||
lda screenPtr,s
|
||||
sta screen1+1
|
||||
sta screen2+1
|
||||
lda screenPtr+2,s
|
||||
shortm
|
||||
sta screen1+3
|
||||
sta screen2+3
|
||||
; lda #$C1
|
||||
; sta $e1c029
|
||||
longm
|
||||
|
||||
plb
|
||||
lda 1,s
|
||||
sta 1+8,s
|
||||
lda 2,s
|
||||
sta 2+8,s
|
||||
plx
|
||||
plx
|
||||
plx
|
||||
plx
|
||||
rtl
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
set_pixel Start
|
||||
|
||||
dbr equ 1
|
||||
rtlAddr equ dbr+1
|
||||
x_coord equ rtlAddr+3
|
||||
y_coord equ x_coord+2
|
||||
color equ y_coord+2
|
||||
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
|
||||
lda y_coord,s
|
||||
cmp #200
|
||||
bge return
|
||||
lda x_coord,s
|
||||
cmp #320
|
||||
bge return
|
||||
|
||||
lda x_coord,s
|
||||
lsr a
|
||||
sta x_div2+1
|
||||
|
||||
lda y_coord,s
|
||||
jsr getLookup
|
||||
clc
|
||||
x_div2 adc #0 ;x_div2
|
||||
tax
|
||||
|
||||
lda x_coord,s
|
||||
bit #1
|
||||
bne loNibble
|
||||
|
||||
hiNibble anop
|
||||
lda color,s
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
shortm
|
||||
sta color_ls4+1
|
||||
|
||||
jsr readPixel
|
||||
and #$0F
|
||||
color_ls4 ora #0 ;color_ls4
|
||||
jsr writePixel
|
||||
bra all_set
|
||||
|
||||
loNibble anop
|
||||
shortm
|
||||
jsr readPixel
|
||||
and #$F0
|
||||
ora color,s
|
||||
jsr writePixel
|
||||
|
||||
all_set longm
|
||||
|
||||
return plb
|
||||
lda 1,s
|
||||
sta 1+6,s
|
||||
lda 2,s
|
||||
sta 2+6,s
|
||||
plx
|
||||
plx
|
||||
plx
|
||||
rtl
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
get_pixel Start
|
||||
|
||||
dbr equ 1
|
||||
rtlAddr equ dbr+1
|
||||
x_coord equ rtlAddr+3
|
||||
y_coord equ x_coord+2
|
||||
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
|
||||
lda y_coord,s
|
||||
cmp #200
|
||||
blt y_good
|
||||
ldy #$F
|
||||
bra return
|
||||
x_bad anop
|
||||
ldy #0
|
||||
bra return
|
||||
y_good lda x_coord,s
|
||||
cmp #320
|
||||
bge x_bad
|
||||
|
||||
lda x_coord,s
|
||||
lsr a
|
||||
sta x_div2+1
|
||||
|
||||
lda y_coord,s
|
||||
jsr getLookup
|
||||
clc
|
||||
x_div2 adc #0 ;x_div2
|
||||
tax
|
||||
|
||||
lda x_coord,s
|
||||
bit #1
|
||||
bne loNibble
|
||||
|
||||
hiNibble anop
|
||||
shortm
|
||||
jsr readPixel
|
||||
and #$F0
|
||||
lsr a
|
||||
lsr a
|
||||
lsr a
|
||||
lsr a
|
||||
bra all_set
|
||||
|
||||
loNibble anop
|
||||
shortm
|
||||
jsr readPixel
|
||||
; and #$0F
|
||||
|
||||
all_set longm
|
||||
and #$000F
|
||||
tay
|
||||
return plb
|
||||
lda 1,s
|
||||
sta 1+4,s
|
||||
lda 2,s
|
||||
sta 2+4,s
|
||||
plx
|
||||
plx
|
||||
tya
|
||||
rtl
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
readPixel Start
|
||||
|
||||
screen1 entry
|
||||
lda >0,x
|
||||
rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
writePixel Start
|
||||
|
||||
screen2 entry
|
||||
sta >0,x
|
||||
rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
getset_pixel Start
|
||||
|
||||
dbr equ 1
|
||||
rtlAddr equ dbr+1
|
||||
x_coord equ rtlAddr+3
|
||||
y_coord equ x_coord+2
|
||||
color equ y_coord+2
|
||||
|
||||
phb
|
||||
phk
|
||||
plb
|
||||
|
||||
lda #0
|
||||
sta returnPixel+1
|
||||
|
||||
lda y_coord,s
|
||||
cmp #200
|
||||
blt y_good
|
||||
lda #$F
|
||||
sta returnPixel+1
|
||||
bra return
|
||||
y_good lda x_coord,s
|
||||
cmp #320
|
||||
bge return ; x is bad
|
||||
|
||||
lda x_coord,s
|
||||
lsr a
|
||||
sta x_div2+1
|
||||
|
||||
lda y_coord,s
|
||||
jsr getLookup
|
||||
clc
|
||||
x_div2 adc #0 ;x_div2
|
||||
tax
|
||||
|
||||
lda x_coord,s
|
||||
bit #1
|
||||
bne loNibble
|
||||
|
||||
hiNibble anop
|
||||
lda color,s
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
shortm
|
||||
sta color_ls4+1
|
||||
|
||||
jsr readPixel
|
||||
pha
|
||||
and #$F0
|
||||
lsr a
|
||||
lsr a
|
||||
lsr a
|
||||
lsr a
|
||||
sta returnPixel+1
|
||||
pla
|
||||
and #$0F
|
||||
color_ls4 ora #0 ;color_ls4
|
||||
jsr writePixel
|
||||
bra all_set
|
||||
|
||||
loNibble anop
|
||||
shortm
|
||||
jsr readPixel
|
||||
pha
|
||||
and #$0F
|
||||
sta returnPixel+1
|
||||
pla
|
||||
and #$F0
|
||||
ora color,s
|
||||
jsr writePixel
|
||||
|
||||
all_set longm
|
||||
|
||||
return plb
|
||||
lda 1,s
|
||||
sta 1+6,s
|
||||
lda 2,s
|
||||
sta 2+6,s
|
||||
plx
|
||||
plx
|
||||
plx
|
||||
returnPixel lda #0
|
||||
rtl
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
getLookup Start
|
||||
|
||||
asl a
|
||||
tax
|
||||
patchLook entry
|
||||
lda >0,x
|
||||
rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
60
source/twilight/twilight/library.mac
Normal file
60
source/twilight/twilight/library.mac
Normal file
|
@ -0,0 +1,60 @@
|
|||
MACRO
|
||||
&lab longm
|
||||
&lab ANOP
|
||||
rep #%00100000
|
||||
longa on
|
||||
MEND
|
||||
MACRO
|
||||
&lab shortm
|
||||
&lab ANOP
|
||||
sep #%00100000
|
||||
longa off
|
||||
MEND
|
||||
MACRO
|
||||
&lab Debug &string
|
||||
aif t:debugSymbols="G",.begin
|
||||
mexit
|
||||
.begin
|
||||
dc i1'$82'
|
||||
dc i2'(L:&string)+3'
|
||||
dc i2'$7771'
|
||||
dc i1'L:&string',C'&string'
|
||||
MEND
|
||||
macro
|
||||
&lab ~ReadTimeHex
|
||||
&lab WordResult
|
||||
WordResult
|
||||
WordResult
|
||||
WordResult
|
||||
Tool $0D03
|
||||
mend
|
||||
macro
|
||||
&lab ~GetTick
|
||||
&lab LongResult
|
||||
Tool $2503
|
||||
mend
|
||||
macro
|
||||
&lab LongResult &zeros
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zeros
|
||||
phd
|
||||
phd
|
||||
mexit
|
||||
.zeros
|
||||
pea $0000
|
||||
pea $0000
|
||||
mend
|
||||
macro
|
||||
&lab Tool &number
|
||||
&lab ldx #&number
|
||||
jsl $E10000
|
||||
mend
|
||||
macro
|
||||
&lab WordResult &zero
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zero
|
||||
phd
|
||||
mexit
|
||||
.zero
|
||||
&lab pea $0000
|
||||
mend
|
2643
source/twilight/twilight/list.asm
Normal file
2643
source/twilight/twilight/list.asm
Normal file
File diff suppressed because it is too large
Load Diff
986
source/twilight/twilight/list.mac
Normal file
986
source/twilight/twilight/list.mac
Normal file
|
@ -0,0 +1,986 @@
|
|||
MACRO
|
||||
&lab pulllong &addr1,&addr2
|
||||
&lab ANOP
|
||||
AIF C:&addr1=0,.a
|
||||
AIF C:&addr2=0,.b
|
||||
LCLC &C
|
||||
&C AMID &addr1,1,1
|
||||
AIF "&C"="[",.zeropage
|
||||
pullword &addr1
|
||||
sta &addr2
|
||||
pullword &addr1+2
|
||||
sta &addr2+2
|
||||
MEXIT
|
||||
.a
|
||||
pullword
|
||||
pullword
|
||||
MEXIT
|
||||
.b
|
||||
pullword &addr1
|
||||
pullword &addr1+2
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&addr2
|
||||
pullword &addr1,y
|
||||
ldy #&addr2+2
|
||||
pullword &addr1,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pullword &SYSOPR
|
||||
&lab ANOP
|
||||
pla
|
||||
AIF C:&SYSOPR=0,.end
|
||||
sta &SYSOPR
|
||||
.end
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushlong &addr,&offset
|
||||
&lab ANOP
|
||||
LCLC &C
|
||||
LCLC &REST
|
||||
&C AMID &addr,1,1
|
||||
AIF "&C"="#",.immediate
|
||||
AIF "&C"="[",.zeropage
|
||||
AIF C:&offset=0,.nooffset
|
||||
AIF "&offset"="s",.stack
|
||||
pushword &addr+2,&offset
|
||||
pushword &addr,&offset
|
||||
MEXIT
|
||||
.nooffset
|
||||
pushword &addr+2
|
||||
pushword &addr
|
||||
MEXIT
|
||||
.immediate
|
||||
&REST AMID &addr,2,L:&addr-1
|
||||
dc I1'$F4',I2'(&REST)|-16'
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEXIT
|
||||
.stack
|
||||
pushword &addr+2,s
|
||||
pushword &addr+2,s
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&offset+2
|
||||
pushword &addr,y
|
||||
ldy #&offset
|
||||
pushword &addr,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushword &SYSOPR
|
||||
&lab ANOP
|
||||
AIF C:&SYSOPR=0,.b
|
||||
LCLC &C
|
||||
&C AMID "&SYSOPR",1,1
|
||||
AIF ("&C"="#").AND.(S:LONGA),.immediate
|
||||
lda &SYSOPR
|
||||
pha
|
||||
MEXIT
|
||||
.b
|
||||
pha
|
||||
MEXIT
|
||||
.immediate
|
||||
LCLC &REST
|
||||
LCLA &BL
|
||||
&BL ASEARCH "&SYSOPR"," ",1
|
||||
AIF &BL>0,.a
|
||||
&BL SETA L:&SYSOPR+1
|
||||
.a
|
||||
&REST AMID "&SYSOPR",2,&BL-2
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEND
|
||||
MACRO
|
||||
&lab longm
|
||||
&lab ANOP
|
||||
rep #%00100000
|
||||
longa on
|
||||
MEND
|
||||
MACRO
|
||||
&lab shortm
|
||||
&lab ANOP
|
||||
sep #%00100000
|
||||
longa off
|
||||
MEND
|
||||
MACRO
|
||||
&lab killLdp
|
||||
&lab pld
|
||||
ply
|
||||
ply
|
||||
MEND
|
||||
MACRO
|
||||
&lab makeDP
|
||||
&lab phd
|
||||
tsc
|
||||
tcd
|
||||
MEND
|
||||
MACRO
|
||||
&LAB JEQ &BP
|
||||
&LAB BNE *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
MACRO
|
||||
&LAB JLT &BP
|
||||
&LAB BGE *+5
|
||||
BRL &BP
|
||||
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 _SendRequest
|
||||
&lab ldx #$1c01
|
||||
jsl $E10000
|
||||
mend
|
||||
MACRO
|
||||
&LAB JNE &BP
|
||||
&LAB BEQ *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
macro
|
||||
&lab WordResult &zero
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zero
|
||||
phd
|
||||
mexit
|
||||
.zero
|
||||
&lab pea $0000
|
||||
mend
|
||||
macro
|
||||
&lab LongResult &zeros
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zeros
|
||||
phd
|
||||
phd
|
||||
mexit
|
||||
.zeros
|
||||
pea $0000
|
||||
pea $0000
|
||||
mend
|
||||
MACRO
|
||||
&lab mvw &num1,&num2
|
||||
&lab lda &num1
|
||||
sta &num2
|
||||
MEND
|
||||
MACRO
|
||||
&lab ename
|
||||
&lab entry
|
||||
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 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 mvl &srcLong,&dstLong
|
||||
&lab ANOP
|
||||
LCLC &C
|
||||
&C AMID &srcLong,1,1
|
||||
AIF "&C"="#",.direct
|
||||
lda &srcLong
|
||||
sta &dstLong
|
||||
lda &srcLong+2
|
||||
sta &dstLong+2
|
||||
MEXIT
|
||||
.direct
|
||||
lda &srcLong
|
||||
sta &dstLong
|
||||
lda &srcLong|-16
|
||||
sta &dstLong+2
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetPort
|
||||
&lab LongResult
|
||||
Tool $1C04
|
||||
mend
|
||||
macro
|
||||
&lab Tool &number
|
||||
&lab ldx #&number
|
||||
jsl $E10000
|
||||
mend
|
||||
MACRO
|
||||
&lab _NewHandle
|
||||
&lab ldx #$0902
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetPort
|
||||
&lab ldx #$1B04
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~DisposeHandle &theHandle
|
||||
&lab ph4 &theHandle
|
||||
Tool $1002
|
||||
mend
|
||||
macro
|
||||
&lab ~CloseResourceFile &fileID
|
||||
&lab ph2 &fileID
|
||||
Tool $0B1E
|
||||
mend
|
||||
macro
|
||||
&lab ph4 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &addr,1,1
|
||||
aif "&char"="@",.registers
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif c:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
.yesoffset
|
||||
lda &addr+2,&offset
|
||||
pha
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr+2
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr+2,s
|
||||
pha
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.registers
|
||||
phy
|
||||
phx
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea +(&addr)|-16
|
||||
pea &addr
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr+2
|
||||
pei &addr
|
||||
mexit
|
||||
.zeroPage
|
||||
aif C:&offset<>0,.zeroPageOffset
|
||||
ldy #2
|
||||
lda &addr,y
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOffset
|
||||
aif "&offset"="X",.zeroPageRegX
|
||||
aif "&offset"="Y",.zeroPageRegY
|
||||
aif "&offset"="x",.zeroPageRegX
|
||||
aif "&offset"="y",.zeroPageRegY
|
||||
ldy #&offset+2
|
||||
lda &addr,y
|
||||
pha
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageRegX
|
||||
lda &addr,&offset
|
||||
tay
|
||||
inx
|
||||
inx
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phy
|
||||
mexit
|
||||
.zeroPageRegY
|
||||
lda &addr,&offset
|
||||
tax
|
||||
iny
|
||||
iny
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phx
|
||||
mend
|
||||
MACRO
|
||||
&lab dbrk &num
|
||||
aif t:debugBreaks="G",.begin
|
||||
mexit
|
||||
.begin
|
||||
brk &num
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetCurResourceApp
|
||||
&lab wordresult
|
||||
Tool $141E
|
||||
mend
|
||||
MACRO
|
||||
&lab _MoveTo
|
||||
&lab ldx #$3A04
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab QDRect
|
||||
&lab anop
|
||||
&lab._top ds 2
|
||||
&lab._left ds 2
|
||||
&lab._bottom ds 2
|
||||
&lab._right ds 2
|
||||
mend
|
||||
MACRO
|
||||
&lab _GetHandleSize
|
||||
&lab ldx #$1802
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab errorbrk &op
|
||||
&lab anop
|
||||
aif t:debugCode="G",.doit
|
||||
mexit
|
||||
.doit
|
||||
bcc *+4
|
||||
aif c:&op=1,.value
|
||||
brk $BB
|
||||
mexit
|
||||
.value
|
||||
brk &op
|
||||
mend
|
||||
macro
|
||||
&lab ~HUnlock &theHandle
|
||||
&lab ph4 &theHandle
|
||||
Tool $2202
|
||||
mend
|
||||
MACRO
|
||||
&lab _HLock
|
||||
&lab ldx #$2002
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetHandleId
|
||||
&lab ldx #$3002
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ptr &location
|
||||
&lab anop
|
||||
aif c:&location=1,.value
|
||||
ds 4
|
||||
mexit
|
||||
.value
|
||||
dc i4'&location'
|
||||
mend
|
||||
MACRO
|
||||
&lab _OpenResourceFile
|
||||
&lab ldx #$0A1E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _NewWindow2
|
||||
&lab ldx #$610E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _DrawControls
|
||||
&lab ldx #$1010
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _DrawString
|
||||
&lab ldx #$A504
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~SetFontFlags &fontFlags
|
||||
&lab ph2 &fontFlags
|
||||
Tool $9804
|
||||
mend
|
||||
macro
|
||||
&lab ~LoadResource &resourceType,&resourceID
|
||||
&lab LongResult
|
||||
ph2 &resourceType
|
||||
ph4 &resourceID
|
||||
Tool $0E1E
|
||||
mend
|
||||
macro
|
||||
&lab ~ReleaseResource &purgeLevel,&resourceType,&resourceID
|
||||
&lab ph2 &purgeLevel
|
||||
ph2 &resourceType
|
||||
ph4 &resourceID
|
||||
Tool $171E
|
||||
mend
|
||||
macro
|
||||
&lab ~CloseWindow &windowPtr
|
||||
&lab ph4 &windowPtr
|
||||
Tool $0B0E
|
||||
mend
|
||||
macro
|
||||
&lab ph2 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid "&addr",1,1
|
||||
aif "&char"="@",.accumulator
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif C:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.accumulator
|
||||
pha
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea &addr
|
||||
mexit
|
||||
.zeropage
|
||||
aif C:&offset<>0,.zeroPageOff
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOff
|
||||
aif "&offset"="X",.zeroPageReg
|
||||
aif "&offset"="Y",.ze
|
||||
oPageReg
|
||||
aif "&offset"="x",.zeroPageReg
|
||||
aif "&offset"="y",.zeroPageReg
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageReg
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mend
|
||||
macro
|
||||
&lab ~GetCtlHandleFromID &ctlWindowPtr,&ctlID
|
||||
&lab LongResult
|
||||
ph4 &ctlWindowPtr
|
||||
ph4 &ctlID
|
||||
Tool $3010
|
||||
mend
|
||||
MACRO
|
||||
&lab _Multiply
|
||||
&lab ldx #$090B
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~HLock &theHandle
|
||||
&lab ph4 &theHandle
|
||||
Tool $2002
|
||||
mend
|
||||
MACRO
|
||||
&lab str &string
|
||||
&lab dc i1'L:&string',C'&string'
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetCtlValue
|
||||
&lab ldx #$1910
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab handle
|
||||
&lab ds 4
|
||||
mend
|
||||
MACRO
|
||||
&lab stzl &adr
|
||||
&lab stz &adr
|
||||
stz &adr+2
|
||||
MEND
|
||||
macro
|
||||
&lab ~NextMember2 &itemNumber,&ctlHandle
|
||||
&lab WordResult
|
||||
ph2 &itemNumber
|
||||
ph4 &ctlHandle
|
||||
Tool $121C
|
||||
mend
|
||||
macro
|
||||
&lab C1Result &size,&text
|
||||
&lab anop
|
||||
&lab._bufsize dw &size
|
||||
aif c:&text=0,.nodefault
|
||||
&lab._textlen dw l:&text
|
||||
&lab._text dc c"&text"
|
||||
ds &size-4-(l:&text)
|
||||
mexit
|
||||
.nodefault
|
||||
&lab._textlen dw
|
||||
&lab._text ds &size-$04
|
||||
mend
|
||||
macro
|
||||
&lab dw &location
|
||||
&lab anop
|
||||
aif c:&location<>0,.exists
|
||||
ds 2
|
||||
mexit
|
||||
.exists
|
||||
dc i2'&location'
|
||||
mend
|
||||
macro
|
||||
&lab RefInfoRecGS ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._refNum dc i2'¶meters(1)'
|
||||
&lab._access dc i2'¶meters(2)'
|
||||
aif c:¶meters=2,.exit
|
||||
&lab._pathName dc i4'¶meters(3)'
|
||||
.exit
|
||||
mend
|
||||
MACRO
|
||||
&lab _PtrToHand
|
||||
&lab ldx #$2802
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _ReleaseResource
|
||||
&lab ldx #$171E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _LoadResource
|
||||
&lab ldx #$0E1E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _CloseGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2014"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
MACRO
|
||||
&lab _OpenGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2010"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
MACRO
|
||||
&lab _GetDirEntryGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$201C"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SelectMember2
|
||||
&lab ldx #$141C
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab DirEntryRecGS ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._refnum dc i2'¶meters(1)'
|
||||
&lab._flags dc i2'¶meters(2)'
|
||||
&lab._base dc i2'¶meters(3)'
|
||||
&lab._displacement dc i2'¶meters(4)'
|
||||
&lab._nameBuffer dc i4'¶meters(5)'
|
||||
aif c:¶meters=5,.exit
|
||||
&lab._entryNum dc i2'¶meters(6)'
|
||||
aif c:¶meters=6,.exit
|
||||
&lab._fileType dc i2'¶meters(7)'
|
||||
aif c:¶meters=7,.exit
|
||||
&lab._eof dc i4'¶meters(8)'
|
||||
aif c:¶meters=8,.exit
|
||||
&lab._blockCount dc i4'¶meters(9)'
|
||||
aif c:¶meters=9,.exit
|
||||
&lab._createTD dc i8'¶meters(10)'
|
||||
aif c:¶meters=10,.exit
|
||||
&lab._modifyTD dc i8'¶meters(11)'
|
||||
aif c:¶meters=11,.exit
|
||||
&lab._access dc i2'¶meters(12)'
|
||||
aif c:¶meters=12,.exit
|
||||
&lab._auxType dc i4'¶meters(13)'
|
||||
aif c:¶meters=13,.exit
|
||||
&lab._fileSysID dc i2'¶meters(14)'
|
||||
aif c:¶meters=14,.exit
|
||||
&lab._optionList dc i4'¶meters(15)'
|
||||
aif c:¶meters=15,.exit
|
||||
&lab._resourceEOF dc i4'¶meters(16)'
|
||||
aif c:¶meters=16,.exit
|
||||
&lab._resourceBlocks dc i4'¶meters(17)'
|
||||
.exit
|
||||
mend
|
||||
macro
|
||||
&lab OpenRecGS ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._refNum dc i2'¶meters(1)'
|
||||
&lab._pathName dc i4'¶meters(2)'
|
||||
aif c:¶meters=2,.exit
|
||||
&lab._requestAccess dc i2'¶meters(3)'
|
||||
aif c:¶meters=3,.exit
|
||||
&lab._resourceNum dc i2'¶meters(4)'
|
||||
aif c:¶meters=4,.exit
|
||||
&lab._access dc i2'¶meters(5)'
|
||||
aif c:¶meters=5,.exit
|
||||
&lab._fileType dc i2'¶meters(6)'
|
||||
aif c:¶meters=6,.exit
|
||||
&lab._auxType dc i4'¶meters(7)'
|
||||
aif c:¶meters=7,.exit
|
||||
&lab._storageType dc i2'¶meters(8)'
|
||||
aif c:¶meters=8,.exit
|
||||
&lab._createTD dc i8'¶meters(9)'
|
||||
aif c:¶meters=9,.exit
|
||||
&lab._modifyTD dc i8'¶meters(10)'
|
||||
aif c:¶meters=10,.exit
|
||||
&lab._optionList dc i4'¶meters(11)'
|
||||
aif c:¶meters=11,.exit
|
||||
&lab._eof dc i4'¶meters(12)'
|
||||
aif c:¶meters=12,.exit
|
||||
&lab._eofBlocks dc i4'¶meters(13)'
|
||||
aif c:¶meters=13,.exit
|
||||
&lab._resourceEOF dc i4'¶meters(14)'
|
||||
aif c:¶meters=14,.exit
|
||||
&lab._resourceBlocks dc i4'¶meters(15)'
|
||||
.exit
|
||||
mend
|
||||
macro
|
||||
&lab RefNumRecGS ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._refNum dc i2'¶meters(1)'
|
||||
mend
|
||||
MACRO
|
||||
&lab _CompareStrings
|
||||
&lab ldx #$181C
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&LAB JGE &BP
|
||||
&LAB BLT *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
MACRO
|
||||
&lab _AddResource
|
||||
&lab ldx #$0C1E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _RemoveResource
|
||||
&lab ldx #$0F1E
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~EraseRect &rectPtr
|
||||
&lab ph4 &rectPtr
|
||||
Tool $5504
|
||||
mend
|
||||
macro
|
||||
&lab ~GetClipHandle
|
||||
&lab LongResult
|
||||
Tool $C704
|
||||
mend
|
||||
macro
|
||||
&lab ~InvertRect &rectPtr
|
||||
&lab ph4 &rectPtr
|
||||
Tool $5604
|
||||
mend
|
||||
macro
|
||||
&lab ~SetPenMask &maskPtr
|
||||
&lab ph4 &maskPtr
|
||||
Tool $3204
|
||||
mend
|
||||
macro
|
||||
&lab ~GetTextFace
|
||||
&lab WordResult
|
||||
Tool $9B04
|
||||
mend
|
||||
macro
|
||||
&lab ~SetTextFace &textFace
|
||||
&lab ph2 &textFace
|
||||
Tool $9A04
|
||||
mend
|
||||
MACRO
|
||||
&lab _SetTextFace
|
||||
&lab ldx #$9A04
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab GSStr &GSstring
|
||||
&lab dc i2'L:&GSstring',C'&GSstring'
|
||||
MEND
|
||||
macro
|
||||
&lab QDPoint
|
||||
&lab anop
|
||||
&lab._y ds 2
|
||||
&lab._x ds 2
|
||||
mend
|
||||
MACRO
|
||||
&lab _LineTo
|
||||
&lab ldx #$3C04
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _StringBounds
|
||||
&lab ldx #$AD04
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetPenSize &resultPointPtr
|
||||
&lab ph4 &resultPointPtr
|
||||
Tool $2D04
|
||||
mend
|
||||
macro
|
||||
&lab ~SetPenSize &penWidth,&penHeight
|
||||
&lab ph2 &penWidth
|
||||
ph2 &penHeight
|
||||
Tool $2C04
|
||||
mend
|
||||
macro
|
||||
&lab ~DrawMember2 &itemNumber,&ctlHandle
|
||||
&lab ph2 &itemNumber
|
||||
ph4 &ctlHandle
|
||||
Tool $111C
|
||||
mend
|
||||
MACRO
|
||||
&lab _DrawMember2
|
||||
&lab ldx #$111C
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~Multiply &multiplicand,&multiplier
|
||||
&lab LongResult
|
||||
ph2 &multiplicand
|
||||
ph2 &multiplier
|
||||
Tool $090B
|
||||
mend
|
||||
MACRO
|
||||
&lab _SetHandleSize
|
||||
&lab ldx #$1902
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetCharExtra
|
||||
&lab LongResult
|
||||
Tool $D504
|
||||
mend
|
||||
MACRO
|
||||
&lab _SetCharExtra
|
||||
&lab ldx #$D404
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~Long2Fix &longValue
|
||||
&lab LongResult
|
||||
ph4 &longValue
|
||||
Tool $1A0B
|
||||
mend
|
||||
macro
|
||||
&lab ~FillRect &rectPtr,&patternPtr
|
||||
&lab ph4 &rectPtr
|
||||
ph4 &patternPtr
|
||||
Tool $5704
|
||||
mend
|
||||
MACRO
|
||||
&lab _CreateGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2001"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
MACRO
|
||||
&lab _DestroyGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2002"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
MACRO
|
||||
&lab _GetEOFGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2019"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
MACRO
|
||||
&lab _GetPrefixGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$200A"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
MACRO
|
||||
&lab _ReadGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2012"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetMarkGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2016"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetPrefixGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2009"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
MACRO
|
||||
&lab _WriteGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2013"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
MACRO
|
||||
&lab _HandToPtr
|
||||
&lab ldx #$2902
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~SetHandleSize &newSize,&theHandle
|
||||
&lab ph4 &newSize
|
||||
ph4 &theHandle
|
||||
Tool $1902
|
||||
mend
|
||||
macro
|
||||
&lab CreateRecGS ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._pathName dc i4'¶meters(1)'
|
||||
aif c:¶meters=1,.exit
|
||||
&lab._access dc i2'¶meters(2)'
|
||||
aif c:¶meters=2,.exit
|
||||
&lab._fileType dc i2'¶meters(3)'
|
||||
aif c:¶meters=3,.exit
|
||||
&lab._auxType dc i4'¶meters(4)'
|
||||
aif c:¶meters=4,.exit
|
||||
&lab._storageType dc i2'¶meters(5)'
|
||||
aif c:¶meters=5,.exit
|
||||
&lab._eof dc i4'¶meters(6)'
|
||||
aif c:¶meters=6,.exit
|
||||
&lab._resourceEOF dc i4'¶meters(7)'
|
||||
.exit
|
||||
mend
|
||||
macro
|
||||
&lab EOFRecGS ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._refNum dc i2'¶meters(1)'
|
||||
&lab._eof dc i4'¶meters(2)'
|
||||
mend
|
||||
macro
|
||||
&lab IORecGS ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._refNum dc i2'¶meters(1)'
|
||||
&lab._dataBuffer dc i4'¶meters(2)'
|
||||
&lab._requestCount dc i4'¶meters(3)'
|
||||
&lab._transferCount dc i4'¶meters(4)'
|
||||
aif c:¶meters=4,.exit
|
||||
&lab._cachePriority dc i2'¶meters(5)'
|
||||
.exit
|
||||
mend
|
||||
macro
|
||||
&lab NameRecGS ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._pathName dc i4'¶meters(1)'
|
||||
mend
|
||||
macro
|
||||
&lab PrefixRecGS ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._prefixNum dc i2'¶meters(1)'
|
||||
&lab._prefix dc i4'¶meters(2)'
|
||||
mend
|
||||
macro
|
||||
&lab SetPositionRecGS ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._refNum dc i2'¶meters(1)'
|
||||
&lab._base dc i2'¶meters(2)'
|
||||
&lab._displacement dc i4'¶meters(3)'
|
||||
mend
|
||||
MACRO
|
||||
&lab _SetEOFGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2018"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
macro
|
||||
&lab ~SelectMember2 &itemNumber,&ctlHandle
|
||||
&lab ph2 &itemNumber
|
||||
ph4 &ctlHandle
|
||||
Tool $141C
|
||||
mend
|
||||
MACRO
|
||||
&lab _SetCtlTitle
|
||||
&lab ldx #$0C10
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetCtlValue &ctlHandle
|
||||
&lab WordResult
|
||||
ph4 &ctlHandle
|
||||
Tool $1A10
|
||||
mend
|
||||
macro
|
||||
&lab ~GetMasterSCB
|
||||
&lab WordResult
|
||||
Tool $1704
|
||||
mend
|
||||
macro
|
||||
&lab ~MoveWindow &newX,&newY,&windowPtr
|
||||
&lab ph2 &newX
|
||||
ph2 &newY
|
||||
ph4 &windowPtr
|
||||
Tool $190E
|
||||
mend
|
||||
macro
|
||||
&lab ~ShowWindow &windowPtr
|
||||
&lab ph4 &windowPtr
|
||||
Tool $130E
|
||||
mend
|
36
source/twilight/twilight/makefile
Normal file
36
source/twilight/twilight/makefile
Normal file
|
@ -0,0 +1,36 @@
|
|||
*
|
||||
* AV 202005 - An Orca/m makefile
|
||||
*
|
||||
*
|
||||
* init things
|
||||
*
|
||||
prefix 22 /t2/export/twilight
|
||||
*
|
||||
* make Twilight II
|
||||
*
|
||||
compile +w blank.asm keep=o/blank
|
||||
compile +w init.asm keep=o/init
|
||||
compile +w beat.asm keep=o/beat
|
||||
compile +w request.asm keep=o/request
|
||||
compile +w ipc.asm keep=o/ipc
|
||||
compile +w library.asm keep=o/library
|
||||
link +w -x o/init o/beat o/request o/blank o/ipc o/library keep=o/init
|
||||
*
|
||||
* make the CDEV
|
||||
*
|
||||
compile +w cdev.asm keep=o/cdev
|
||||
compile +w setup.asm keep=o/setup
|
||||
compile +w misc.asm keep=o/misc
|
||||
compile +w list.asm keep=o/list
|
||||
link +w -x o/cdev o/setup o/misc o/list keep=o/cdev
|
||||
*
|
||||
* make the resources
|
||||
*
|
||||
compile tii.rez keep=Twilight.II rez=(-t $C7)
|
||||
copy -C Twilight.II cdevs:Twilight.II
|
||||
compile newboth.rez keep=Twilight.II rez=(-a -t $C7)
|
||||
copy -C Twilight.II cdevs:Twilight.II
|
||||
*
|
||||
* Copy the version on my startup disk
|
||||
*
|
||||
copy -C cdevs:Twilight.II /systeme/system/cdevs/Twilight.II
|
625
source/twilight/twilight/misc.asm
Normal file
625
source/twilight/twilight/misc.asm
Normal file
|
@ -0,0 +1,625 @@
|
|||
setcom 80
|
||||
keep misc
|
||||
mcopy misc.mac
|
||||
copy 13:ainclude:e16.window
|
||||
copy 13:ainclude:e16.resources
|
||||
copy 13:ainclude:e16.control
|
||||
copy 13:ainclude:e16.adb
|
||||
copy 13:ainclude:e16.locator
|
||||
copy 13:ainclude:e16.quickdraw
|
||||
copy v1.2.equ
|
||||
copy equates
|
||||
copy tii.equ
|
||||
copy cdev.equ
|
||||
copy debug.equ
|
||||
*-----------------------------------------------------------------------------*
|
||||
* LoadModuleErr - v1.0 - 1 Jan 93 - Jim R Maricondo (tc) - T2 v1.0.1b3
|
||||
* If an error occurs trying to load the module, display an error
|
||||
* alert listing the error code and module pathname. This will be a stop
|
||||
* alert and will have one button - cancel.
|
||||
* Call:
|
||||
* PushWord Error (error number)
|
||||
* PushLong PathPtr (pointer to module w-string pathname)
|
||||
* jsr LoadModuleErr
|
||||
|
||||
LoadModuleErr Start
|
||||
debug 'LoadModuleErr'
|
||||
|
||||
copy 22:debug.asm
|
||||
|
||||
rtsAdr equ 1
|
||||
pathPtr equ rtsAdr+2
|
||||
error equ pathPtr+4
|
||||
|
||||
lda error,s
|
||||
LongResult
|
||||
pha
|
||||
_HexIt ; convert error to ascii
|
||||
PullLong convErr
|
||||
|
||||
lda pathPtr+2,s
|
||||
tax
|
||||
lda pathPtr,s
|
||||
phx
|
||||
pha
|
||||
makeDP
|
||||
|
||||
; temporarily convert the pathname w-str into a p-str to pass to alertwindow
|
||||
|
||||
lda 3,s
|
||||
inc a
|
||||
sta pathnamePStr
|
||||
lda 3+2,s
|
||||
sta pathnamePStr+2
|
||||
lda [3]
|
||||
xba
|
||||
sta [3]
|
||||
|
||||
~InitCursor
|
||||
~AlertWindow #awPString+awResource+awButtonLayout,#lmeErrSub,#awErrLoadModuleCancel
|
||||
plx ; get button hit
|
||||
lda [3] ; change the pathname back into a
|
||||
xba ; w-string
|
||||
sta [3]
|
||||
killLdp
|
||||
ply
|
||||
plx
|
||||
plx
|
||||
plx
|
||||
phy
|
||||
rts
|
||||
|
||||
* loadmoduleerror subsitution error alert string array
|
||||
|
||||
lmeErrSub dc i4'errorPStr'
|
||||
pathnamePStr ds 4
|
||||
errorPStr anop
|
||||
dc h'04' ; length byte (pstring)
|
||||
convErr ds 4
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
EnsureT2Active Start
|
||||
debug 'EnsureT2Active'
|
||||
kind $1000
|
||||
Using BlankNowDATA
|
||||
Using GlobalDATA
|
||||
|
||||
; PushWord #t2GetInfo
|
||||
; PushWord #stopAfterOne+sendToUserID
|
||||
; ldy #$0000
|
||||
; phy ; target (hi)
|
||||
; lda MyID
|
||||
; ora #requestAuxID
|
||||
; pha ; target (lo)
|
||||
; phy
|
||||
; phy ; dataIn (none)
|
||||
; PushLong #stateWordDataOut ; dataOut
|
||||
; _SendRequest
|
||||
;
|
||||
; lda stateWord
|
||||
; bit #%10000 ; is T2 currently on?
|
||||
; beq T2On
|
||||
;
|
||||
; PushWord #t2TurnOn
|
||||
; PushWord #stopAfterOne+sendToUserID
|
||||
; ldy #$0000
|
||||
; phy ; target (hi)
|
||||
; lda MyID
|
||||
; ora #requestAuxID
|
||||
; pha ; target (lo)
|
||||
; phy
|
||||
; phy ; dataIn (none)
|
||||
; phy
|
||||
; phy ; dataOut (none)
|
||||
; _SendRequest
|
||||
|
||||
PushLong OnFlagPtr
|
||||
makeDP
|
||||
lda [3]
|
||||
sta oldOnFlagFill+1
|
||||
lda #$FF
|
||||
sta [3]
|
||||
ldy #2
|
||||
lda [3],y
|
||||
sta oldIPCT2OffFill+1
|
||||
lda #0
|
||||
sta [3],y
|
||||
killLdp
|
||||
|
||||
T2On anop
|
||||
rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
DesureT2Active Start
|
||||
debug 'DesureT2Active'
|
||||
kind $1000
|
||||
Using GlobalDATA
|
||||
Using BlankNowDATA
|
||||
|
||||
; lda stateWord
|
||||
; bit #%10000 ; was T2 on at first?
|
||||
; beq T2WasOn
|
||||
|
||||
PushLong OnFlagPtr
|
||||
makeDP
|
||||
oldOnFlagFill entry
|
||||
lda #0
|
||||
sta [3]
|
||||
ldy #2
|
||||
oldIPCT2OffFill entry
|
||||
lda #0
|
||||
sta [3],y
|
||||
killLdp
|
||||
|
||||
; PushWord #t2TurnOff
|
||||
; PushWord #stopAfterOne+sendToUserID
|
||||
; ldy #$0000
|
||||
; phy ; target (hi)
|
||||
; lda MyID
|
||||
; ora #requestAuxID
|
||||
; pha ; target (lo)
|
||||
; phy
|
||||
; phy ; dataIn (none)
|
||||
; phy
|
||||
; phy ; dataOut (none)
|
||||
; _SendRequest
|
||||
T2WasOn anop
|
||||
rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
SendBlankNow Start
|
||||
kind $1000
|
||||
Using GlobalDATA
|
||||
Using BlankNowDATA
|
||||
debug 'SendBlankNow'
|
||||
|
||||
* Make sure T2 is active. (i.e. shift clear stuff)
|
||||
|
||||
jsr EnsureT2Active
|
||||
|
||||
* tell the SHR heartbeat to ignore the mouse for the first 1 second
|
||||
|
||||
PushLong IgnMouseTimePtr
|
||||
makeDP
|
||||
lda #2 ; 1 second
|
||||
sta [3]
|
||||
killLdp
|
||||
|
||||
PushWord #reqBlankScreen
|
||||
PushWord #stopAfterOne+sendToUserID
|
||||
ldy #$0000
|
||||
phy ; target (hi)
|
||||
lda MyID
|
||||
ora #requestAuxID
|
||||
pha ; target (lo)
|
||||
PushLong #BlankScreenDataIn ; dataIn
|
||||
phy
|
||||
phy ; dataOut (none)
|
||||
_SendRequest
|
||||
|
||||
~FlushEvents #keyDownMask+mUpMask+mDownMask+autoKeyMask,#0
|
||||
pla
|
||||
|
||||
* if we had to enable T2, then disable it again to make it like before
|
||||
|
||||
jsr DesureT2Active
|
||||
rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
* Check for our nifty Easter Egg Type #2 (If the last 3 keys pressed were DYA)
|
||||
* Requires rom01 or rom03 with ADB keyboard.
|
||||
* by Jim Maricondo, December 24, 1992.. v1.0
|
||||
* Enter with adb version in A..
|
||||
* Exit with carry flag set = egg good. clear = egg bad.
|
||||
|
||||
CheckDYA Start
|
||||
debug 'CheckDYA'
|
||||
|
||||
; lda adbVersion
|
||||
cmp #4
|
||||
beq rom01
|
||||
cmp #5
|
||||
bne noRom01
|
||||
rom01 mvw #33,ramOffToBuffer+1 ; rom01
|
||||
lda #15 ; keybuffoffset for rom01
|
||||
bra readBuffOff
|
||||
|
||||
noRom01 cmp #6
|
||||
bne unsupported
|
||||
lda #22 ; keybuffoffset for rom03
|
||||
readBuffOff jsr readADB
|
||||
inc a ; transform it - make it last key buffer offset
|
||||
and #$0f
|
||||
sta temp2
|
||||
|
||||
jsr GetKeyFromBuffer
|
||||
cmp #"A"
|
||||
beq ok0
|
||||
cmp #"a"
|
||||
bne noEgg2
|
||||
ok0 lda temp2
|
||||
inc a
|
||||
and #$0F
|
||||
sta temp2
|
||||
jsr GetKeyFromBuffer
|
||||
cmp #"Y"
|
||||
beq ok1
|
||||
cmp #"y"
|
||||
bne noEgg2
|
||||
ok1 lda temp2
|
||||
inc a
|
||||
and #$0F
|
||||
sta temp2
|
||||
jsr GetKeyFromBuffer
|
||||
cmp #"D"
|
||||
beq ok2
|
||||
cmp #"d"
|
||||
bne noEgg2
|
||||
ok2 sec ; yes!
|
||||
rts
|
||||
|
||||
noEgg2 anop
|
||||
unsupported anop
|
||||
clc ; no!
|
||||
rts
|
||||
|
||||
temp2 ds 2
|
||||
|
||||
GetKeyFromBuffer anop
|
||||
clc
|
||||
ramOffToBuffer adc #40 ; rom03
|
||||
jsr readADB
|
||||
and #$FF
|
||||
rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
AppleII Start
|
||||
debug 'AppleII'
|
||||
Using GlobalDATA
|
||||
|
||||
LongResult
|
||||
LongResult
|
||||
lda #0
|
||||
pha
|
||||
pha
|
||||
pha
|
||||
PushWord #$fe1f ; IDROUTINE
|
||||
_FWEntry
|
||||
pla ; y register
|
||||
ply
|
||||
ply
|
||||
ply
|
||||
and #$FF
|
||||
cmp #3 ; rom03 only!
|
||||
bne skipSound2
|
||||
|
||||
~SoundToolStatus
|
||||
pla
|
||||
bne skipSound2
|
||||
|
||||
PushWord #t2StartupTools
|
||||
PushWord #stopAfterOne+sendToUserID
|
||||
ldy #$0000
|
||||
phy ; target (hi)
|
||||
lda MyID
|
||||
tax
|
||||
ora #requestAuxID
|
||||
pha ; target (lo)
|
||||
txa
|
||||
ora #miscAuxID
|
||||
pha ; dataIn (hi)
|
||||
PushWord #%10 ; startup snd mgr (datain - lo)
|
||||
PushLong #startupDataOut ; dataOut
|
||||
_SendRequest
|
||||
bcs skipSound
|
||||
lda errors
|
||||
skipSound2 bne skipSound
|
||||
|
||||
~FFStopSound #$7FFF
|
||||
|
||||
shortm
|
||||
lda >$E100CA
|
||||
pha
|
||||
ora #$08
|
||||
sta >$E100CA
|
||||
longm
|
||||
|
||||
~FFStartSound #1,#$FE080C
|
||||
|
||||
loop ~FFSoundDoneStatus #0
|
||||
pla
|
||||
beq loop
|
||||
|
||||
shortm
|
||||
pla
|
||||
sta >$E100CA
|
||||
longm
|
||||
|
||||
PushWord #t2ShutdownTools
|
||||
PushWord #stopAfterOne+sendToUserID
|
||||
ldy #$0000
|
||||
phy ; target (hi)
|
||||
lda MyID
|
||||
ora #requestAuxID
|
||||
pha ; target (lo)
|
||||
phy ; dataIn (hi)
|
||||
PushWord #%10 ; shutdown snd mgr (datain - lo)
|
||||
phy
|
||||
phy ; dataOut (none)
|
||||
_SendRequest
|
||||
|
||||
skipSound rts
|
||||
|
||||
;a2sndprmblk dc i4'$00FF1000' ;addr
|
||||
; dc i2'$000C' ;pages
|
||||
; dc i2'$00F6' ;sample rate
|
||||
; dc i2'$0000' ;buffer start addr
|
||||
; dc i2'$000F' ;buffer size
|
||||
; dc i4'$00FE081E' ;next wave's parm block
|
||||
; dc i2'$00FF' ;volume
|
||||
;a2sndprmblk2 dc i4'$00FF1D00' ;addr
|
||||
; dc i2'$001F' ;pages
|
||||
; dc i2'$00F6' ;sample rate
|
||||
; dc i2'$0000' ;buffer start addr
|
||||
; dc i2'$000F' ;buffer size
|
||||
; dc i4'$00000000' ;next wave's parm block
|
||||
; dc i2'$00FF' ;volume
|
||||
|
||||
startupDataOut anop
|
||||
recvCount ds 2 ; count
|
||||
errors ds 2
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
* makePdp. V1.00 - 12/08/91 by JRM.
|
||||
*
|
||||
* Dereference handle (make a pointer) on the stack.
|
||||
*
|
||||
* Inputs:
|
||||
*
|
||||
* |previous contents|
|
||||
* |-----------------|
|
||||
* | handle | Long - Handle to dereference.
|
||||
* |-----------------|
|
||||
* | rtsAddr | Word - Return address.
|
||||
* |-----------------|
|
||||
*
|
||||
* Outputs:
|
||||
*
|
||||
* | |
|
||||
* |previous contents|
|
||||
* |-----------------|
|
||||
* | pointer | Long - Dereferenced handle.
|
||||
* |-----------------|
|
||||
* | rtsAddr | Word - Return address.
|
||||
* |-----------------|
|
||||
*
|
||||
|
||||
makePdp Start
|
||||
debug 'makePdp'
|
||||
|
||||
TheHandle equ DP+2
|
||||
DP equ 1
|
||||
|
||||
plx ; yank return address
|
||||
phd
|
||||
tsc
|
||||
tcd
|
||||
ldy #2
|
||||
lda [TheHandle],y
|
||||
tay
|
||||
lda [TheHandle]
|
||||
sta <TheHandle
|
||||
sty <TheHandle+2
|
||||
phx ; push back return address
|
||||
rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
LogInCodeResConv Start
|
||||
debug 'LogInCodeResourceConv'
|
||||
|
||||
~GetCodeResConverter
|
||||
PushWord #rCodeResource
|
||||
PushWord #resLogIn+resLogApp ; install in app converter list
|
||||
_ResourceConverter
|
||||
rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
LogOutCodeResConv Start
|
||||
debug 'LogOutCodeResConv'
|
||||
|
||||
~GetCodeResConverter
|
||||
PushWord #rCodeResource
|
||||
PushWord #resLogOut+resLogApp ; remove from app converter list
|
||||
_ResourceConverter
|
||||
rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
DimAbout Start
|
||||
Using GlobalDATA
|
||||
debug 'DimAbout'
|
||||
|
||||
lda AboutDisabled+1
|
||||
bne AlreadyDisabled
|
||||
|
||||
PushWord #inactiveHilite ; for HilightControl
|
||||
~GetCtlHandleFromID T2WindP,#AboutCtl
|
||||
_HiliteControl ; Dim the about ctl
|
||||
mvw #TRUE,AboutDisabled+1
|
||||
AlreadyDisabled rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
EnableAbout Start
|
||||
Using GlobalDATA
|
||||
Using SetupDATA ; for setupWindOpen
|
||||
debug 'EnableAbout'
|
||||
|
||||
; ~GetMasterSCB
|
||||
; pla
|
||||
; bit #mode640
|
||||
; beq DimAbout ; 320 mode, can't have it enabled!
|
||||
|
||||
ldx setupWindOpen
|
||||
bne DimAbout ; setup open! can't have about enabled.
|
||||
|
||||
* If warning alerts are ON and we're in 320 mode, than allow about module
|
||||
* to be enabled...
|
||||
|
||||
~GetMasterSCB
|
||||
pla
|
||||
bit #mode640
|
||||
bne enableIt
|
||||
lda OptionsFlag
|
||||
bit #fWarningAlerts
|
||||
beq DimAbout
|
||||
; bra enableIt
|
||||
|
||||
enableIt anop
|
||||
AboutDisabled entry
|
||||
lda #0
|
||||
beq alreadyEnabled
|
||||
PushWord #noHilite
|
||||
~GetCtlHandleFromID T2WindP,#AboutCtl
|
||||
_HiliteControl ; enable the about ctl
|
||||
; lda #FALSE
|
||||
stz AboutDisabled+1
|
||||
alreadyEnabled rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
DimBlankNow Start
|
||||
Using GlobalDATA
|
||||
debug 'DimBlankNow'
|
||||
|
||||
lda BlankNowDisabled+1
|
||||
bne AlreadyDisabled
|
||||
|
||||
PushWord #inactiveHilite
|
||||
~GetCtlHandleFromID T2WindP,#BlankBtn
|
||||
_HiliteControl
|
||||
mvw #TRUE,BlankNowDisabled+1
|
||||
AlreadyDisabled rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
EnableBlankNow Start
|
||||
Using GlobalDATA
|
||||
debug 'EnableBlankNow'
|
||||
|
||||
lda OptionsFlag ; neu!
|
||||
bit #fRandomize
|
||||
bne DimBlankNow
|
||||
|
||||
BlankNowDisabled entry
|
||||
lda #0
|
||||
beq AlreadyEnabled
|
||||
|
||||
PushWord #noHilite
|
||||
~GetCtlHandleFromID T2WindP,#BlankBtn
|
||||
_HiliteControl
|
||||
; lda #FALSE
|
||||
stz BlankNowDisabled+1
|
||||
AlreadyEnabled rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
EnableTest Start
|
||||
Using SetupDATA
|
||||
debug 'EnableTest'
|
||||
|
||||
* enable the test control
|
||||
|
||||
PushWord #noHilite
|
||||
~GetCtlHandleFromID setupWindPtr,#T2SetupTestCtlID
|
||||
_HiliteControl
|
||||
rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
DimTest Start
|
||||
Using SetupDATA
|
||||
debug 'DimTest'
|
||||
|
||||
* dim the test control
|
||||
|
||||
PushWord #inactiveHilite
|
||||
~GetCtlHandleFromID setupWindPtr,#T2SetupTestCtlID
|
||||
_HiliteControl
|
||||
rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
DimToggle Start
|
||||
Using GlobalDATA
|
||||
debug 'DimToggle'
|
||||
|
||||
lda ToggleDisabled+1
|
||||
bne AlreadyDisabled
|
||||
|
||||
PushWord #inactiveHilite ; for HilightControl
|
||||
~GetCtlHandleFromID T2WindP,#ToggleCtl
|
||||
_HiliteControl ; Dim the about ctl
|
||||
mvw #TRUE,ToggleDisabled+1
|
||||
AlreadyDisabled rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
EnableToggle Start
|
||||
Using GlobalDATA
|
||||
debug 'EnableToggle'
|
||||
|
||||
ToggleDisabled entry
|
||||
lda #0
|
||||
beq alreadyEnabled
|
||||
PushWord #noHilite
|
||||
~GetCtlHandleFromID T2WindP,#ToggleCtl
|
||||
_HiliteControl ; enable the about ctl
|
||||
; lda #FALSE
|
||||
stz ToggleDisabled+1
|
||||
alreadyEnabled rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
readADB Start
|
||||
kind $1000
|
||||
debug 'readADB'
|
||||
Using ADBDATA
|
||||
|
||||
sta dataIn ; register
|
||||
PushLong #dataOut
|
||||
PushLong #dataIn
|
||||
PushWord #readMicroMem
|
||||
_ReadKeyMicroMemory
|
||||
lda dataOut ; memory value
|
||||
rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
ADBDATA Data
|
||||
|
||||
adbVersion ds 2
|
||||
dataIn ds 2
|
||||
dataOut ds 2
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
||||
initAdbVersion Start
|
||||
kind $1000
|
||||
debug 'initAdbVers'
|
||||
Using ADBDATA
|
||||
|
||||
~ReadKeyMicroData #1,#adbVersion,#readVersionNum
|
||||
lda adbVersion
|
||||
rts
|
||||
|
||||
End
|
||||
*-----------------------------------------------------------------------------*
|
388
source/twilight/twilight/misc.mac
Normal file
388
source/twilight/twilight/misc.mac
Normal file
|
@ -0,0 +1,388 @@
|
|||
MACRO
|
||||
&lab pulllong &addr1,&addr2
|
||||
&lab ANOP
|
||||
AIF C:&addr1=0,.a
|
||||
AIF C:&addr2=0,.b
|
||||
LCLC &C
|
||||
&C AMID &addr1,1,1
|
||||
AIF "&C"="[",.zeropage
|
||||
pullword &addr1
|
||||
sta &addr2
|
||||
pullword &addr1+2
|
||||
sta &addr2+2
|
||||
MEXIT
|
||||
.a
|
||||
pullword
|
||||
pullword
|
||||
MEXIT
|
||||
.b
|
||||
pullword &addr1
|
||||
pullword &addr1+2
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&addr2
|
||||
pullword &addr1,y
|
||||
ldy #&addr2+2
|
||||
pullword &addr1,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pullword &SYSOPR
|
||||
&lab ANOP
|
||||
pla
|
||||
AIF C:&SYSOPR=0,.end
|
||||
sta &SYSOPR
|
||||
.end
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushlong &addr,&offset
|
||||
&lab ANOP
|
||||
LCLC &C
|
||||
LCLC &REST
|
||||
&C AMID &addr,1,1
|
||||
AIF "&C"="#",.immediate
|
||||
AIF "&C"="[",.zeropage
|
||||
AIF C:&offset=0,.nooffset
|
||||
AIF "&offset"="s",.stack
|
||||
pushword &addr+2,&offset
|
||||
pushword &addr,&offset
|
||||
MEXIT
|
||||
.nooffset
|
||||
pushword &addr+2
|
||||
pushword &addr
|
||||
MEXIT
|
||||
.immediate
|
||||
&REST AMID &addr,2,L:&addr-1
|
||||
dc I1'$F4',I2'(&REST)|-16'
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEXIT
|
||||
.stack
|
||||
pushword &addr+2,s
|
||||
pushword &addr+2,s
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&offset+2
|
||||
pushword &addr,y
|
||||
ldy #&offset
|
||||
pushword &addr,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushword &SYSOPR
|
||||
&lab ANOP
|
||||
AIF C:&SYSOPR=0,.b
|
||||
LCLC &C
|
||||
&C AMID "&SYSOPR",1,1
|
||||
AIF ("&C"="#").AND.(S:LONGA),.immediate
|
||||
lda &SYSOPR
|
||||
pha
|
||||
MEXIT
|
||||
.b
|
||||
pha
|
||||
MEXIT
|
||||
.immediate
|
||||
LCLC &REST
|
||||
LCLA &BL
|
||||
&BL ASEARCH "&SYSOPR"," ",1
|
||||
AIF &BL>0,.a
|
||||
&BL SETA L:&SYSOPR+1
|
||||
.a
|
||||
&REST AMID "&SYSOPR",2,&BL-2
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEND
|
||||
MACRO
|
||||
&lab longm
|
||||
&lab ANOP
|
||||
rep #%00100000
|
||||
longa on
|
||||
MEND
|
||||
MACRO
|
||||
&lab shortm
|
||||
&lab ANOP
|
||||
sep #%00100000
|
||||
longa off
|
||||
MEND
|
||||
MACRO
|
||||
&lab killLdp
|
||||
&lab pld
|
||||
ply
|
||||
ply
|
||||
MEND
|
||||
MACRO
|
||||
&lab makeDP
|
||||
&lab phd
|
||||
tsc
|
||||
tcd
|
||||
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 _SendRequest
|
||||
&lab ldx #$1c01
|
||||
jsl $E10000
|
||||
mend
|
||||
macro
|
||||
&lab LongResult &zeros
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zeros
|
||||
phd
|
||||
phd
|
||||
mexit
|
||||
.zeros
|
||||
pea $0000
|
||||
pea $0000
|
||||
mend
|
||||
MACRO
|
||||
&lab mvw &num1,&num2
|
||||
&lab lda &num1
|
||||
sta &num2
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetMasterSCB
|
||||
&lab WordResult
|
||||
Tool $1704
|
||||
mend
|
||||
macro
|
||||
&lab Tool &number
|
||||
&lab ldx #&number
|
||||
jsl $E10000
|
||||
mend
|
||||
macro
|
||||
&lab WordResult &zero
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zero
|
||||
phd
|
||||
mexit
|
||||
.zero
|
||||
&lab pea $0000
|
||||
mend
|
||||
MACRO
|
||||
&lab _HiliteControl
|
||||
&lab ldx #$1110
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetCtlHandleFromID &ctlWindowPtr,&ctlID
|
||||
&lab LongResult
|
||||
ph4 &ctlWindowPtr
|
||||
ph4 &ctlID
|
||||
Tool $3010
|
||||
mend
|
||||
macro
|
||||
&lab ~AlertWindow &alertFlags,&subStrPtr,&alertStrRef
|
||||
&lab WordResult
|
||||
ph2 &alertFlags
|
||||
ph4 &subStrPtr
|
||||
ph4 &alertStrRef
|
||||
Tool $590E
|
||||
mend
|
||||
macro
|
||||
&lab ~FlushEvents &eventMask,&stopMask
|
||||
&lab WordResult
|
||||
ph2 &eventMask
|
||||
ph2 &stopMask
|
||||
Tool $1506
|
||||
mend
|
||||
macro
|
||||
&lab ~InitCursor
|
||||
&lab Tool $CA04
|
||||
mend
|
||||
MACRO
|
||||
&lab _HexIt
|
||||
&lab ldx #$2A0B
|
||||
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",.ze
|
||||
oPageReg
|
||||
aif "&offset"="x",.zeroPageReg
|
||||
aif "&offset"="y",.zeroPageReg
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageReg
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mend
|
||||
macro
|
||||
&lab ph4 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &addr,1,1
|
||||
aif "&char"="@",.registers
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif c:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
.yesoffset
|
||||
lda &addr+2,&offset
|
||||
pha
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr+2
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr+2,s
|
||||
pha
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.registers
|
||||
phy
|
||||
phx
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea +(&addr)|-16
|
||||
pea &addr
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr+2
|
||||
pei &addr
|
||||
mexit
|
||||
.zeroPage
|
||||
aif C:&offset<>0,.zeroPageOffset
|
||||
ldy #2
|
||||
lda &addr,y
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOffset
|
||||
aif "&offset"="X",.zeroPageRegX
|
||||
aif "&offset"="Y",.zeroPageRegY
|
||||
aif "&offset"="x",.zeroPageRegX
|
||||
aif "&offset"="y",.zeroPageRegY
|
||||
ldy #&offset+2
|
||||
lda &addr,y
|
||||
pha
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageRegX
|
||||
lda &addr,&offset
|
||||
tay
|
||||
inx
|
||||
inx
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phy
|
||||
mexit
|
||||
.zeroPageRegY
|
||||
lda &addr,&offset
|
||||
tax
|
||||
iny
|
||||
iny
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phx
|
||||
mend
|
||||
macro
|
||||
&lab ~ReadKeyMicroData &dataLength,&dataPtr,&adbCommand
|
||||
&lab ph2 &dataLength
|
||||
ph4 &dataPtr
|
||||
ph2 &adbCommand
|
||||
Tool $0A09
|
||||
mend
|
||||
MACRO
|
||||
&lab _ResourceConverter
|
||||
&lab ldx #$281E
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetCodeResConverter
|
||||
&lab LongResult
|
||||
Tool $3403
|
||||
mend
|
||||
MACRO
|
||||
&lab _ReadKeyMicroMemory
|
||||
&lab ldx #$0B09
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~FFSoundDoneStatus &genNumber
|
||||
&lab WordResult
|
||||
ph2 &genNumber
|
||||
Tool $1408
|
||||
mend
|
||||
macro
|
||||
&lab ~FFStartSound &genNumFFSynth,&pBlockPtr
|
||||
&lab ph2 &genNumFFSynth
|
||||
ph4 &pBlockPtr
|
||||
Tool $0E08
|
||||
mend
|
||||
macro
|
||||
&lab ~FFStopSound &genMask
|
||||
&lab ph2 &genMask
|
||||
Tool $0F08
|
||||
mend
|
||||
macro
|
||||
&lab ~SoundToolStatus
|
||||
&lab WordResult ;
|
||||
Tool $0608
|
||||
mend
|
||||
MACRO
|
||||
&lab _FWEntry
|
||||
&lab ldx #$2403
|
||||
jsl $E10000
|
||||
MEND
|
11
source/twilight/twilight/newboth.rez
Normal file
11
source/twilight/twilight/newboth.rez
Normal file
|
@ -0,0 +1,11 @@
|
|||
|
||||
// #include "Types.Rez"
|
||||
#define T2_Init $07FEFFFF
|
||||
#define rCodeResource $8017
|
||||
#define rCDEVCode $8018
|
||||
|
||||
// include "Twilight.II";
|
||||
// delete rCodeResource;
|
||||
// delete rCDevCode;
|
||||
read rCodeResource (T2_Init,locked,convert,nospecialmemory) "o:init"; /* init part */
|
||||
read rCDEVCode (0x1,locked,convert,nospecialmemory) "o:cdev"; /* cdev program */
|
2568
source/twilight/twilight/request.asm
Normal file
2568
source/twilight/twilight/request.asm
Normal file
File diff suppressed because it is too large
Load Diff
696
source/twilight/twilight/request.mac
Normal file
696
source/twilight/twilight/request.mac
Normal file
|
@ -0,0 +1,696 @@
|
|||
MACRO
|
||||
&lab pulllong &addr1,&addr2
|
||||
&lab ANOP
|
||||
AIF C:&addr1=0,.a
|
||||
AIF C:&addr2=0,.b
|
||||
LCLC &C
|
||||
&C AMID &addr1,1,1
|
||||
AIF "&C"="[",.zeropage
|
||||
pullword &addr1
|
||||
sta &addr2
|
||||
pullword &addr1+2
|
||||
sta &addr2+2
|
||||
MEXIT
|
||||
.a
|
||||
pullword
|
||||
pullword
|
||||
MEXIT
|
||||
.b
|
||||
pullword &addr1
|
||||
pullword &addr1+2
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&addr2
|
||||
pullword &addr1,y
|
||||
ldy #&addr2+2
|
||||
pullword &addr1,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pullword &SYSOPR
|
||||
&lab ANOP
|
||||
pla
|
||||
AIF C:&SYSOPR=0,.end
|
||||
sta &SYSOPR
|
||||
.end
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushlong &addr,&offset
|
||||
&lab ANOP
|
||||
LCLC &C
|
||||
LCLC &REST
|
||||
&C AMID &addr,1,1
|
||||
AIF "&C"="#",.immediate
|
||||
AIF "&C"="[",.zeropage
|
||||
AIF C:&offset=0,.nooffset
|
||||
AIF "&offset"="s",.stack
|
||||
pushword &addr+2,&offset
|
||||
pushword &addr,&offset
|
||||
MEXIT
|
||||
.nooffset
|
||||
pushword &addr+2
|
||||
pushword &addr
|
||||
MEXIT
|
||||
.immediate
|
||||
&REST AMID &addr,2,L:&addr-1
|
||||
dc I1'$F4',I2'(&REST)|-16'
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEXIT
|
||||
.stack
|
||||
pushword &addr+2,s
|
||||
pushword &addr+2,s
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&offset+2
|
||||
pushword &addr,y
|
||||
ldy #&offset
|
||||
pushword &addr,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushword &SYSOPR
|
||||
&lab ANOP
|
||||
AIF C:&SYSOPR=0,.b
|
||||
LCLC &C
|
||||
&C AMID "&SYSOPR",1,1
|
||||
AIF ("&C"="#").AND.(S:LONGA),.immediate
|
||||
lda &SYSOPR
|
||||
pha
|
||||
MEXIT
|
||||
.b
|
||||
pha
|
||||
MEXIT
|
||||
.immediate
|
||||
LCLC &REST
|
||||
LCLA &BL
|
||||
&BL ASEARCH "&SYSOPR"," ",1
|
||||
AIF &BL>0,.a
|
||||
&BL SETA L:&SYSOPR+1
|
||||
.a
|
||||
&REST AMID "&SYSOPR",2,&BL-2
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEND
|
||||
MACRO
|
||||
&lab longm
|
||||
&lab ANOP
|
||||
rep #%00100000
|
||||
longa on
|
||||
MEND
|
||||
MACRO
|
||||
&lab shortm
|
||||
&lab ANOP
|
||||
sep #%00100000
|
||||
longa off
|
||||
MEND
|
||||
MACRO
|
||||
&lab killLdp
|
||||
&lab pld
|
||||
ply
|
||||
ply
|
||||
MEND
|
||||
MACRO
|
||||
&lab makeDP
|
||||
&lab phd
|
||||
tsc
|
||||
tcd
|
||||
MEND
|
||||
MACRO
|
||||
&LAB JEQ &BP
|
||||
&LAB BNE *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
MACRO
|
||||
&LAB JLT &BP
|
||||
&LAB BGE *+5
|
||||
BRL &BP
|
||||
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 _SendRequest
|
||||
&lab ldx #$1c01
|
||||
jsl $E10000
|
||||
mend
|
||||
MACRO
|
||||
&LAB JNE &BP
|
||||
&LAB BEQ *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetSysBar
|
||||
&lab LongResult
|
||||
Tool $110F
|
||||
mend
|
||||
macro
|
||||
&lab WordResult &zero
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zero
|
||||
phd
|
||||
mexit
|
||||
.zero
|
||||
&lab pea $0000
|
||||
mend
|
||||
macro
|
||||
&lab LongResult &zeros
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zeros
|
||||
phd
|
||||
phd
|
||||
mexit
|
||||
.zeros
|
||||
pea $0000
|
||||
pea $0000
|
||||
mend
|
||||
macro
|
||||
&lab ~SchAddTask &taskPtr
|
||||
&lab WordResult
|
||||
ph4 &taskPtr
|
||||
Tool $0907
|
||||
mend
|
||||
MACRO
|
||||
&lab mvw &num1,&num2
|
||||
&lab lda &num1
|
||||
sta &num2
|
||||
MEND
|
||||
MACRO
|
||||
&lab mvl &srcLong,&dstLong
|
||||
&lab ANOP
|
||||
LCLC &C
|
||||
&C AMID &srcLong,1,1
|
||||
AIF "&C"="#",.direct
|
||||
lda &srcLong
|
||||
sta &dstLong
|
||||
lda &srcLong+2
|
||||
sta &dstLong+2
|
||||
MEXIT
|
||||
.direct
|
||||
lda &srcLong
|
||||
sta &dstLong
|
||||
lda &srcLong|-16
|
||||
sta &dstLong+2
|
||||
MEND
|
||||
macro
|
||||
&lab Tool &number
|
||||
&lab ldx #&number
|
||||
jsl $E10000
|
||||
mend
|
||||
MACRO
|
||||
&lab _NewHandle
|
||||
&lab ldx #$0902
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~DisposeHandle &theHandle
|
||||
&lab ph4 &theHandle
|
||||
Tool $1002
|
||||
mend
|
||||
macro
|
||||
&lab ~CloseResourceFile &fileID
|
||||
&lab ph2 &fileID
|
||||
Tool $0B1E
|
||||
mend
|
||||
macro
|
||||
&lab ~GetCurResourceFile
|
||||
&lab WordResult
|
||||
Tool $121E
|
||||
mend
|
||||
macro
|
||||
&lab ph4 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &addr,1,1
|
||||
aif "&char"="@",.registers
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif c:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
.yesoffset
|
||||
lda &addr+2,&offset
|
||||
pha
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr+2
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr+2,s
|
||||
pha
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.registers
|
||||
phy
|
||||
phx
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea +(&addr)|-16
|
||||
pea &addr
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr+2
|
||||
pei &addr
|
||||
mexit
|
||||
.zeroPage
|
||||
aif C:&offset<>0,.zeroPageOffset
|
||||
ldy #2
|
||||
lda &addr,y
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOffset
|
||||
aif "&offset"="X",.zeroPageRegX
|
||||
aif "&offset"="Y",.zeroPageRegY
|
||||
aif "&offset"="x",.zeroPageRegX
|
||||
aif "&offset"="y",.zeroPageRegY
|
||||
ldy #&offset+2
|
||||
lda &addr,y
|
||||
pha
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageRegX
|
||||
lda &addr,&offset
|
||||
tay
|
||||
inx
|
||||
inx
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phy
|
||||
mexit
|
||||
.zeroPageRegY
|
||||
lda &addr,&offset
|
||||
tax
|
||||
iny
|
||||
iny
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phx
|
||||
mend
|
||||
MACRO
|
||||
&lab dbrk &num
|
||||
aif t:debugBreaks="G",.begin
|
||||
mexit
|
||||
.begin
|
||||
brk &num
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetCurResourceApp
|
||||
&lab wordresult
|
||||
Tool $141E
|
||||
mend
|
||||
MACRO
|
||||
&lab _SetCurResourceFile
|
||||
&lab ldx #$111E
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~SetCurResourceFile &fileID
|
||||
&lab ph2 &fileID
|
||||
Tool $111E
|
||||
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 errorbrk &op
|
||||
&lab anop
|
||||
aif t:debugCode="G",.doit
|
||||
mexit
|
||||
.doit
|
||||
bcc *+4
|
||||
aif c:&op=1,.value
|
||||
brk $BB
|
||||
mexit
|
||||
.value
|
||||
brk &op
|
||||
mend
|
||||
MACRO
|
||||
&lab ename
|
||||
&lab entry
|
||||
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
|
||||
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 LONG
|
||||
&lab equ &DummyPC
|
||||
&DummyPC SETA &DummyPC+4
|
||||
MEND
|
||||
macro
|
||||
&lab ~FindHandle &locationPtr
|
||||
&lab LongResult
|
||||
ph4 &locationPtr
|
||||
Tool $1A02
|
||||
mend
|
||||
MACRO
|
||||
&lab EndLocals
|
||||
&lab equ &DummyPC-1
|
||||
MEND
|
||||
MACRO
|
||||
&lab _UDivide
|
||||
&lab ldx #$0B0B
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~SetCurResourceApp &userID
|
||||
&lab ph2 &userID
|
||||
Tool $131E
|
||||
mend
|
||||
MACRO
|
||||
&lab _SetCurResourceApp
|
||||
&lab ldx #$131E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetHandleId
|
||||
&lab ldx #$3002
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab peil &arg
|
||||
&lab pei &arg+2
|
||||
pei &arg
|
||||
MEND
|
||||
MACRO
|
||||
&lab _OpenResourceFile
|
||||
&lab ldx #$0A1E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _MessageCenter
|
||||
&lab ldx #$1501
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~DeleteID &userID
|
||||
&lab ph2 &userID
|
||||
Tool $2103
|
||||
mend
|
||||
macro
|
||||
&lab ~GetNewID &idTag
|
||||
&lab WordResult
|
||||
ph2 &idTag
|
||||
Tool $2003
|
||||
mend
|
||||
macro
|
||||
&lab ~LoadResource &resourceType,&resourceID
|
||||
&lab LongResult
|
||||
ph2 &resourceType
|
||||
ph4 &resourceID
|
||||
Tool $0E1E
|
||||
mend
|
||||
macro
|
||||
&lab ~ReleaseResource &purgeLevel,&resourceType,&resourceID
|
||||
&lab ph2 &purgeLevel
|
||||
ph2 &resourceType
|
||||
ph4 &resourceID
|
||||
Tool $171E
|
||||
mend
|
||||
macro
|
||||
&lab ~MessageByName &createItFlag,&recordPtr
|
||||
&lab LongResult
|
||||
ph2 &createItFlag
|
||||
ph4 &recordPtr
|
||||
Tool $1701
|
||||
mend
|
||||
macro
|
||||
&lab ph2 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid "&addr",1,1
|
||||
aif "&char"="@",.accumulator
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif C:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.accumulator
|
||||
pha
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea &addr
|
||||
mexit
|
||||
.zeropage
|
||||
aif C:&offset<>0,.zeroPageOff
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOff
|
||||
aif "&offset"="X",.zeroPageReg
|
||||
aif "&offset"="Y",.ze
|
||||
oPageReg
|
||||
aif "&offset"="x",.zeroPageReg
|
||||
aif "&offset"="y",.zeroPageReg
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageReg
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mend
|
||||
macro
|
||||
&lab ~AlertWindow &alertFlags,&subStrPtr,&alertStrRef
|
||||
&lab WordResult
|
||||
ph2 &alertFlags
|
||||
ph4 &subStrPtr
|
||||
ph4 &alertStrRef
|
||||
Tool $590E
|
||||
mend
|
||||
MACRO
|
||||
&lab _InitialLoad2
|
||||
&lab ldx #$2011
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _DisposeAll
|
||||
&lab ldx #$1102
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~InitCursor
|
||||
&lab Tool $CA04
|
||||
mend
|
||||
MACRO
|
||||
&lab _HexIt
|
||||
&lab ldx #$2A0B
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab str &string
|
||||
&lab dc i1'L:&string',C'&string'
|
||||
MEND
|
||||
macro
|
||||
&lab ~UpdateResourceFile &fileID
|
||||
&lab ph2 &fileID
|
||||
Tool $0D1E
|
||||
mend
|
||||
MACRO
|
||||
&lab _CloseResourceFile
|
||||
&lab ldx #$0B1E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _ReleaseResource
|
||||
&lab ldx #$171E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _LoadResource
|
||||
&lab ldx #$0E1E
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~DelHeartBeat &taskPtr
|
||||
&lab ph4 &taskPtr
|
||||
Tool $1303
|
||||
mend
|
||||
macro
|
||||
&lab _AcceptRequests
|
||||
&lab ldx #$1b01
|
||||
jsl $E10000
|
||||
mend
|
||||
macro
|
||||
&lab ~EMStatus
|
||||
&lab WordResult 0
|
||||
Tool $0606
|
||||
mend
|
||||
macro
|
||||
&lab ~MenuStatus
|
||||
&lab WordResult
|
||||
Tool $060F
|
||||
mend
|
||||
macro
|
||||
&lab ~QDStatus
|
||||
&lab WordResult 0
|
||||
Tool $0604
|
||||
mend
|
||||
MACRO
|
||||
&LAB JGE &BP
|
||||
&LAB BLT *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
MACRO
|
||||
&lab _AddResource
|
||||
&lab ldx #$0C1E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _UserShutDown
|
||||
&lab ldx #$1211
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _DetachResource
|
||||
&lab ldx #$181E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _CreateResourceFile
|
||||
&lab ldx #$091E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetMItemStruct
|
||||
&lab ldx #$490F
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~DeskStatus
|
||||
&lab WordResult 0
|
||||
Tool $0605
|
||||
mend
|
||||
macro
|
||||
&lab ~InstallNDA &theHandle
|
||||
&lab ph4 &theHandle
|
||||
Tool $0E05
|
||||
mend
|
||||
macro
|
||||
&lab ~GetNumNDAs
|
||||
&lab WordResult
|
||||
Tool $1B05
|
||||
mend
|
||||
macro
|
||||
&lab ~DeleteMItem &itemNum
|
||||
&lab ph2 &itemNum
|
||||
Tool $100F
|
||||
mend
|
||||
MACRO
|
||||
&lab _CalcMenuSize
|
||||
&lab ldx #$1C0F
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _FixAppleMenu
|
||||
&lab ldx #$1E05
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~RemoveNDA &idHandle
|
||||
&lab ph4 &idHandle
|
||||
Tool $2205
|
||||
mend
|
||||
macro
|
||||
&lab ~TEShutDown
|
||||
&lab Tool $0322
|
||||
mend
|
||||
MACRO
|
||||
&lab _DelNotifyProcGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2035"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
macro
|
||||
&lab ~RemoveFromRunQ &runItemPtr
|
||||
&lab ph4 &runItemPtr
|
||||
Tool $2005
|
||||
mend
|
||||
macro
|
||||
&lab ~WindStatus
|
||||
&lab WordResult 0
|
||||
Tool $060E
|
||||
mend
|
||||
MACRO
|
||||
&lab _PurgeHandle
|
||||
&lab ldx #$1202
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&LAB JCC &BP
|
||||
&LAB BCS *+5
|
||||
BRL &BP
|
||||
MEND
|
3711
source/twilight/twilight/setup.asm
Normal file
3711
source/twilight/twilight/setup.asm
Normal file
File diff suppressed because it is too large
Load Diff
860
source/twilight/twilight/setup.mac
Normal file
860
source/twilight/twilight/setup.mac
Normal file
|
@ -0,0 +1,860 @@
|
|||
MACRO
|
||||
&lab pulllong &addr1,&addr2
|
||||
&lab ANOP
|
||||
AIF C:&addr1=0,.a
|
||||
AIF C:&addr2=0,.b
|
||||
LCLC &C
|
||||
&C AMID &addr1,1,1
|
||||
AIF "&C"="[",.zeropage
|
||||
pullword &addr1
|
||||
sta &addr2
|
||||
pullword &addr1+2
|
||||
sta &addr2+2
|
||||
MEXIT
|
||||
.a
|
||||
pullword
|
||||
pullword
|
||||
MEXIT
|
||||
.b
|
||||
pullword &addr1
|
||||
pullword &addr1+2
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&addr2
|
||||
pullword &addr1,y
|
||||
ldy #&addr2+2
|
||||
pullword &addr1,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pullword &SYSOPR
|
||||
&lab ANOP
|
||||
pla
|
||||
AIF C:&SYSOPR=0,.end
|
||||
sta &SYSOPR
|
||||
.end
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushlong &addr,&offset
|
||||
&lab ANOP
|
||||
LCLC &C
|
||||
LCLC &REST
|
||||
&C AMID &addr,1,1
|
||||
AIF "&C"="#",.immediate
|
||||
AIF "&C"="[",.zeropage
|
||||
AIF C:&offset=0,.nooffset
|
||||
AIF "&offset"="s",.stack
|
||||
pushword &addr+2,&offset
|
||||
pushword &addr,&offset
|
||||
MEXIT
|
||||
.nooffset
|
||||
pushword &addr+2
|
||||
pushword &addr
|
||||
MEXIT
|
||||
.immediate
|
||||
&REST AMID &addr,2,L:&addr-1
|
||||
dc I1'$F4',I2'(&REST)|-16'
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEXIT
|
||||
.stack
|
||||
pushword &addr+2,s
|
||||
pushword &addr+2,s
|
||||
MEXIT
|
||||
.zeropage
|
||||
ldy #&offset+2
|
||||
pushword &addr,y
|
||||
ldy #&offset
|
||||
pushword &addr,y
|
||||
MEND
|
||||
MACRO
|
||||
&lab pushword &SYSOPR
|
||||
&lab ANOP
|
||||
AIF C:&SYSOPR=0,.b
|
||||
LCLC &C
|
||||
&C AMID "&SYSOPR",1,1
|
||||
AIF ("&C"="#").AND.(S:LONGA),.immediate
|
||||
lda &SYSOPR
|
||||
pha
|
||||
MEXIT
|
||||
.b
|
||||
pha
|
||||
MEXIT
|
||||
.immediate
|
||||
LCLC &REST
|
||||
LCLA &BL
|
||||
&BL ASEARCH "&SYSOPR"," ",1
|
||||
AIF &BL>0,.a
|
||||
&BL SETA L:&SYSOPR+1
|
||||
.a
|
||||
&REST AMID "&SYSOPR",2,&BL-2
|
||||
dc I1'$F4',I2'&REST'
|
||||
MEND
|
||||
MACRO
|
||||
&lab 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
|
||||
&lab killLdp
|
||||
&lab pld
|
||||
ply
|
||||
ply
|
||||
MEND
|
||||
MACRO
|
||||
&lab makeDP
|
||||
&lab phd
|
||||
tsc
|
||||
tcd
|
||||
MEND
|
||||
MACRO
|
||||
&LAB JEQ &BP
|
||||
&LAB BNE *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
MACRO
|
||||
&LAB JLT &BP
|
||||
&LAB BGE *+5
|
||||
BRL &BP
|
||||
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 _SendRequest
|
||||
&lab ldx #$1c01
|
||||
jsl $E10000
|
||||
mend
|
||||
MACRO
|
||||
&LAB JNE &BP
|
||||
&LAB BEQ *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
macro
|
||||
&lab WordResult &zero
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zero
|
||||
phd
|
||||
mexit
|
||||
.zero
|
||||
&lab pea $0000
|
||||
mend
|
||||
macro
|
||||
&lab LongResult &zeros
|
||||
&lab anop
|
||||
aif c:&zeros=1,.zeros
|
||||
phd
|
||||
phd
|
||||
mexit
|
||||
.zeros
|
||||
pea $0000
|
||||
pea $0000
|
||||
mend
|
||||
MACRO
|
||||
&lab mvw &num1,&num2
|
||||
&lab lda &num1
|
||||
sta &num2
|
||||
MEND
|
||||
MACRO
|
||||
&lab ename
|
||||
&lab entry
|
||||
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 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 mvl &srcLong,&dstLong
|
||||
&lab ANOP
|
||||
LCLC &C
|
||||
&C AMID &srcLong,1,1
|
||||
AIF "&C"="#",.direct
|
||||
lda &srcLong
|
||||
sta &dstLong
|
||||
lda &srcLong+2
|
||||
sta &dstLong+2
|
||||
MEXIT
|
||||
.direct
|
||||
lda &srcLong
|
||||
sta &dstLong
|
||||
lda &srcLong|-16
|
||||
sta &dstLong+2
|
||||
MEND
|
||||
macro
|
||||
&lab ~GetPort
|
||||
&lab LongResult
|
||||
Tool $1C04
|
||||
mend
|
||||
macro
|
||||
&lab Tool &number
|
||||
&lab ldx #&number
|
||||
jsl $E10000
|
||||
mend
|
||||
MACRO
|
||||
&lab _NewHandle
|
||||
&lab ldx #$0902
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetPort
|
||||
&lab ldx #$1B04
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~DisposeHandle &theHandle
|
||||
&lab ph4 &theHandle
|
||||
Tool $1002
|
||||
mend
|
||||
macro
|
||||
&lab ~GetMasterSCB
|
||||
&lab WordResult
|
||||
Tool $1704
|
||||
mend
|
||||
macro
|
||||
&lab ~CloseResourceFile &fileID
|
||||
&lab ph2 &fileID
|
||||
Tool $0B1E
|
||||
mend
|
||||
macro
|
||||
&lab ~GetCurResourceFile
|
||||
&lab WordResult
|
||||
Tool $121E
|
||||
mend
|
||||
macro
|
||||
&lab ph4 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid &addr,1,1
|
||||
aif "&char"="@",.registers
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif c:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
.yesoffset
|
||||
lda &addr+2,&offset
|
||||
pha
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr+2
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr+2,s
|
||||
pha
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.registers
|
||||
phy
|
||||
phx
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea +(&addr)|-16
|
||||
pea &addr
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr+2
|
||||
pei &addr
|
||||
mexit
|
||||
.zeroPage
|
||||
aif C:&offset<>0,.zeroPageOffset
|
||||
ldy #2
|
||||
lda &addr,y
|
||||
pha
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOffset
|
||||
aif "&offset"="X",.zeroPageRegX
|
||||
aif "&offset"="Y",.zeroPageRegY
|
||||
aif "&offset"="x",.zeroPageRegX
|
||||
aif "&offset"="y",.zeroPageRegY
|
||||
ldy #&offset+2
|
||||
lda &addr,y
|
||||
pha
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageRegX
|
||||
lda &addr,&offset
|
||||
tay
|
||||
inx
|
||||
inx
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phy
|
||||
mexit
|
||||
.zeroPageRegY
|
||||
lda &addr,&offset
|
||||
tax
|
||||
iny
|
||||
iny
|
||||
lda &addr,&offset
|
||||
pha
|
||||
phx
|
||||
mend
|
||||
macro
|
||||
&lab ~GetCurResourceApp
|
||||
&lab wordresult
|
||||
Tool $141E
|
||||
mend
|
||||
MACRO
|
||||
&lab _SetCurResourceFile
|
||||
&lab ldx #$111E
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~SetCurResourceFile &fileID
|
||||
&lab ph2 &fileID
|
||||
Tool $111E
|
||||
mend
|
||||
MACRO
|
||||
&lab _GetHandleSize
|
||||
&lab ldx #$1802
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab errorbrk &op
|
||||
&lab anop
|
||||
aif t:debugCode="G",.doit
|
||||
mexit
|
||||
.doit
|
||||
bcc *+4
|
||||
aif c:&op=1,.value
|
||||
brk $BB
|
||||
mexit
|
||||
.value
|
||||
brk &op
|
||||
mend
|
||||
MACRO
|
||||
&lab _UDivide
|
||||
&lab ldx #$0B0B
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab shortmx
|
||||
&lab ANOP
|
||||
sep #%00110000
|
||||
longa off
|
||||
longi off
|
||||
MEND
|
||||
macro
|
||||
&lab ~HUnlock &theHandle
|
||||
&lab ph4 &theHandle
|
||||
Tool $2202
|
||||
mend
|
||||
MACRO
|
||||
&lab _HLock
|
||||
&lab ldx #$2002
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetHandleId
|
||||
&lab ldx #$3002
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab peil &arg
|
||||
&lab pei &arg+2
|
||||
pei &arg
|
||||
MEND
|
||||
MACRO
|
||||
&lab _OpenResourceFile
|
||||
&lab ldx #$0A1E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _NewControl2
|
||||
&lab ldx #$3110
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _FindHandle
|
||||
&lab ldx #$1A02
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _NewWindow2
|
||||
&lab ldx #$610E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _DrawControls
|
||||
&lab ldx #$1010
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _HiliteControl
|
||||
&lab ldx #$1110
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~NewControl2 &ownerPtr,&inputDesc,&inputRef
|
||||
&lab LongResult
|
||||
ph4 &ownerPtr
|
||||
ph2 &inputDesc
|
||||
ph4 &inputRef
|
||||
Tool $3110
|
||||
mend
|
||||
macro
|
||||
&lab ~GetHandleSize &theHandle
|
||||
&lab LongResult
|
||||
ph4 &theHandle
|
||||
Tool $1802
|
||||
mend
|
||||
macro
|
||||
&lab ~GetNewID &idTag
|
||||
&lab WordResult
|
||||
ph2 &idTag
|
||||
Tool $2003
|
||||
mend
|
||||
macro
|
||||
&lab ~SetFontFlags &fontFlags
|
||||
&lab ph2 &fontFlags
|
||||
Tool $9804
|
||||
mend
|
||||
macro
|
||||
&lab ~LoadResource &resourceType,&resourceID
|
||||
&lab LongResult
|
||||
ph2 &resourceType
|
||||
ph4 &resourceID
|
||||
Tool $0E1E
|
||||
mend
|
||||
macro
|
||||
&lab ~ReleaseResource &purgeLevel,&resourceType,&resourceID
|
||||
&lab ph2 &purgeLevel
|
||||
ph2 &resourceType
|
||||
ph4 &resourceID
|
||||
Tool $171E
|
||||
mend
|
||||
macro
|
||||
&lab ~LoadOneTool &toolNumber,&minVersion
|
||||
&lab ph2 &toolNumber
|
||||
ph2 &minVersion
|
||||
Tool $0F01
|
||||
mend
|
||||
macro
|
||||
&lab ~CloseWindow &windowPtr
|
||||
&lab ph4 &windowPtr
|
||||
Tool $0B0E
|
||||
mend
|
||||
macro
|
||||
&lab ~UserShutdown &userID,&quitFlag
|
||||
&lab WordResult
|
||||
ph2 &userID
|
||||
ph2 &quitFlag
|
||||
Tool $1211
|
||||
mend
|
||||
macro
|
||||
&lab ph2 &addr,&offset
|
||||
&lab anop
|
||||
lclc &char
|
||||
&char amid "&addr",1,1
|
||||
aif "&char"="@",.accumulator
|
||||
aif "&char"="*",.smartmacros
|
||||
aif "&char"="#",.immediate
|
||||
aif "&char"="<",.directPage
|
||||
aif "&char"="[",.zeropage
|
||||
aif C:&offset=0,.nooffset
|
||||
aif "&offset"="s",.stack
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mexit
|
||||
.nooffset
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.stack
|
||||
lda &addr,s
|
||||
pha
|
||||
mexit
|
||||
.smartmacros
|
||||
mexit
|
||||
.accumulator
|
||||
pha
|
||||
mexit
|
||||
.directPage
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pei &addr
|
||||
mexit
|
||||
.immediate
|
||||
&addr amid &addr,2,L:&addr-1
|
||||
pea &addr
|
||||
mexit
|
||||
.zeropage
|
||||
aif C:&offset<>0,.zeroPageOff
|
||||
lda &addr
|
||||
pha
|
||||
mexit
|
||||
.zeroPageOff
|
||||
aif "&offset"="X",.zeroPageReg
|
||||
aif "&offset"="Y",.ze
|
||||
oPageReg
|
||||
aif "&offset"="x",.zeroPageReg
|
||||
aif "&offset"="y",.zeroPageReg
|
||||
ldy #&offset
|
||||
lda &addr,y
|
||||
pha
|
||||
mexit
|
||||
.zeroPageReg
|
||||
lda &addr,&offset
|
||||
pha
|
||||
mend
|
||||
macro
|
||||
&lab ~GetCtlHandleFromID &ctlWindowPtr,&ctlID
|
||||
&lab LongResult
|
||||
ph4 &ctlWindowPtr
|
||||
ph4 &ctlID
|
||||
Tool $3010
|
||||
mend
|
||||
macro
|
||||
&lab ~HandToPtr &sourceHandle,&destPtr,&count
|
||||
&lab ph4 &sourceHandle
|
||||
ph4 &destPtr
|
||||
ph4 &count
|
||||
Tool $2902
|
||||
mend
|
||||
macro
|
||||
&lab ~DetachResource &resourceType,&resourceID
|
||||
&lab ph2 &resourceType
|
||||
ph4 &resourceID
|
||||
Tool $181E
|
||||
mend
|
||||
macro
|
||||
&lab ~AlertWindow &alertFlags,&subStrPtr,&alertStrRef
|
||||
&lab WordResult
|
||||
ph2 &alertFlags
|
||||
ph4 &subStrPtr
|
||||
ph4 &alertStrRef
|
||||
Tool $590E
|
||||
mend
|
||||
macro
|
||||
&lab ~TaskMasterDA &eventMask,&taskRecPtr
|
||||
&lab WordResult
|
||||
ph2 &eventMask
|
||||
ph4 &taskRecPtr
|
||||
Tool $5F0E
|
||||
mend
|
||||
MACRO
|
||||
&lab _Multiply
|
||||
&lab ldx #$090B
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _InitialLoad2
|
||||
&lab ldx #$2011
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _DisposeAll
|
||||
&lab ldx #$1102
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~InitCursor
|
||||
&lab Tool $CA04
|
||||
mend
|
||||
macro
|
||||
&lab ~TaskMaster &eventMask,&taskRecPtr
|
||||
&lab WordResult
|
||||
ph2 &eventMask
|
||||
ph4 &taskRecPtr
|
||||
Tool $1D0E
|
||||
mend
|
||||
macro
|
||||
&lab ~HLock &theHandle
|
||||
&lab ph4 &theHandle
|
||||
Tool $2002
|
||||
mend
|
||||
MACRO
|
||||
&lab _HexIt
|
||||
&lab ldx #$2A0B
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab str &string
|
||||
&lab dc i1'L:&string',C'&string'
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetCtlValue
|
||||
&lab ldx #$1910
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _GetCtlValue
|
||||
&lab ldx #$1A10
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~MarkResourceChange &changeFlag,&resourceType,&resourceID
|
||||
&lab ph2 &changeFlag
|
||||
ph2 &resourceType
|
||||
ph4 &resourceID
|
||||
Tool $101E
|
||||
mend
|
||||
macro
|
||||
&lab ~UpdateResourceFile &fileID
|
||||
&lab ph2 &fileID
|
||||
Tool $0D1E
|
||||
mend
|
||||
macro
|
||||
&lab handle
|
||||
&lab ds 4
|
||||
mend
|
||||
macro
|
||||
&lab boolean &onoff
|
||||
&lab anop
|
||||
aif c:&onoff=1,.value
|
||||
dc i'0'
|
||||
mexit
|
||||
.value
|
||||
dc i'&onoff'
|
||||
mend
|
||||
MACRO
|
||||
&lab stzl &adr
|
||||
&lab stz &adr
|
||||
stz &adr+2
|
||||
MEND
|
||||
macro
|
||||
&lab ~NextMember2 &itemNumber,&ctlHandle
|
||||
&lab WordResult
|
||||
ph2 &itemNumber
|
||||
ph4 &ctlHandle
|
||||
Tool $121C
|
||||
mend
|
||||
MACRO
|
||||
&lab _PtrToHand
|
||||
&lab ldx #$2802
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _LoadResource
|
||||
&lab ldx #$0E1E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _BlockMove
|
||||
&lab ldx #$2B02
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _DisposeHandle
|
||||
&lab ldx #$1002
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&LAB JGE &BP
|
||||
&LAB BLT *+5
|
||||
BRL &BP
|
||||
MEND
|
||||
MACRO
|
||||
&lab _AddResource
|
||||
&lab ldx #$0C1E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab GSStr &GSstring
|
||||
&lab dc i2'L:&GSstring',C'&GSstring'
|
||||
MEND
|
||||
macro
|
||||
&lab ~Multiply &multiplicand,&multiplier
|
||||
&lab LongResult
|
||||
ph2 &multiplicand
|
||||
ph2 &multiplier
|
||||
Tool $090B
|
||||
mend
|
||||
MACRO
|
||||
&lab _SetHandleSize
|
||||
&lab ldx #$1902
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _GetPrefixGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$200A"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SetPrefixGS ¶ms
|
||||
&lab jsl $E100A8
|
||||
dc i2"$2009"
|
||||
dc i4"¶ms"
|
||||
MEND
|
||||
macro
|
||||
&lab ~SetHandleSize &newSize,&theHandle
|
||||
&lab ph4 &newSize
|
||||
ph4 &theHandle
|
||||
Tool $1902
|
||||
mend
|
||||
macro
|
||||
&lab PrefixRecGS ¶meters
|
||||
lcla &pCount
|
||||
&pCount seta c:¶meters
|
||||
&lab anop
|
||||
&lab._pCount dc i2'&pCount'
|
||||
&lab._prefixNum dc i2'¶meters(1)'
|
||||
&lab._prefix dc i4'¶meters(2)'
|
||||
mend
|
||||
MACRO
|
||||
&lab _DetachResource
|
||||
&lab ldx #$181E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SFShutDown
|
||||
&lab ldx #$0317
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _DisposeControl
|
||||
&lab ldx #$0A10
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _HideControl
|
||||
&lab ldx #$0E10
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SFGetFile2
|
||||
&lab ldx #$0E17
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _SFStartUp
|
||||
&lab ldx #$0217
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _CompileText
|
||||
&lab ldx #$600E
|
||||
jsl $E10000
|
||||
MEND
|
||||
macro
|
||||
&lab ~SFStatus
|
||||
&lab WordResult 0
|
||||
Tool $0617
|
||||
mend
|
||||
macro
|
||||
&lab ~UnloadOneTool &toolNumber
|
||||
&lab ph2 &toolNumber
|
||||
Tool $1001
|
||||
mend
|
||||
macro
|
||||
&lab ~InvalCtls &ctlWindowPtr
|
||||
&lab ph4 &ctlWindowPtr
|
||||
Tool $3710
|
||||
mend
|
||||
macro
|
||||
&lab ~WaitCursor
|
||||
&lab Tool $0A12
|
||||
mend
|
||||
macro
|
||||
&lab ~RemoveResource &resourceType,&resourceID
|
||||
&lab ph2 &resourceType
|
||||
ph4 &resourceID
|
||||
Tool $0F1E
|
||||
mend
|
||||
macro
|
||||
&lab ~GetAuxWindInfo &windowPtr
|
||||
&lab LongResult
|
||||
PushLong &windowPtr
|
||||
Tool $630E
|
||||
mend
|
||||
macro
|
||||
&lab ~SelectWindow &windowPtr
|
||||
&lab ph4 &windowPtr
|
||||
Tool $110E
|
||||
mend
|
||||
macro
|
||||
&lab ~SetSysWindow &windowPtr
|
||||
&lab ph4 &windowPtr
|
||||
Tool $4B0E
|
||||
mend
|
||||
macro
|
||||
&lab ~SetWRefCon &wRefCon,&windowPtr
|
||||
&lab ph4 &wRefCon
|
||||
ph4 &windowPtr
|
||||
Tool $280E
|
||||
mend
|
||||
MACRO
|
||||
&lab _CallCtlDefProc
|
||||
&lab ldx #$2C10
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _GetCtlHandleFromID
|
||||
&lab ldx #$3010
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _MakeThisCtlTarget
|
||||
&lab ldx #$2810
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _UpdateResourceFile
|
||||
&lab ldx #$0D1E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _CloseWindow
|
||||
&lab ldx #$0B0E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _GetAuxWindInfo
|
||||
&lab ldx #$630E
|
||||
jsl $E10000
|
||||
MEND
|
||||
MACRO
|
||||
&lab _GetLETextByID
|
||||
&lab ldx #$3B10
|
||||
jsl $E10000
|
||||
MEND
|
22
source/twilight/twilight/tii.equ
Normal file
22
source/twilight/twilight/tii.equ
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
* parts of e16.event...
|
||||
nullEvt GEQU $0000
|
||||
mouseDownEvt GEQU $0001
|
||||
mouseUpEvt GEQU $0002
|
||||
keyDownEvt GEQU $0003
|
||||
autoKeyEvt GEQU $0005
|
||||
updateEvt GEQU $0006
|
||||
activateEvt GEQU $0008
|
||||
switchEvt GEQU $0009
|
||||
deskAccEvt GEQU $000A
|
||||
mDownMask GEQU $0002
|
||||
mUpMask GEQU $0004
|
||||
keyDownMask GEQU $0008
|
||||
autoKeyMask GEQU $0020
|
||||
updateMask GEQU $0040
|
||||
activeMask GEQU $0100
|
||||
switchMask GEQU $0200
|
||||
everyEvent GEQU $FFFF
|
||||
owhat GEQU 0
|
||||
omessage GEQU 2
|
||||
appleKey GEQU $0100 ; set if Apple key down
|
3327
source/twilight/twilight/tii.rez
Normal file
3327
source/twilight/twilight/tii.rez
Normal file
File diff suppressed because it is too large
Load Diff
244
source/twilight/twilight/v1.2.equ
Normal file
244
source/twilight/twilight/v1.2.equ
Normal file
|
@ -0,0 +1,244 @@
|
|||
*** Foundation Resource Name Reference Table ***
|
||||
|
||||
Opt2ChangePathAlert GEQU $07FEFFEC
|
||||
|
||||
SwapTimeRez gequ 1
|
||||
TimeRez GEQU $00000002
|
||||
OptionsRez GEQU $00000003
|
||||
CornersRez GEQU $00000004
|
||||
Options2Rez GEQU $00000005
|
||||
|
||||
T2_Icon GEQU $00000001
|
||||
|
||||
T2_CDev_CtlLst GEQU $00000001
|
||||
PassCtlLst GEQU $07FEFFF8
|
||||
Opt2EnterPassCtlLst GEQU $07FEFFF9
|
||||
T2Setup_Options2_CtlLst GEQU $07FEFFFA
|
||||
T2_Wait_CtlLst GEQU $07FEFFFB
|
||||
T2Setup_Options_CtlLst GEQU $07FEFFFC
|
||||
T2Setup_Corner_CtlLst GEQU $07FEFFFD
|
||||
T2_Setup_CtlLst GEQU $07FEFFFE
|
||||
T2_About_CtlLst GEQU $07FEFFFF
|
||||
|
||||
Opt2SetPassLineCtl GEQU $07FEFFC1
|
||||
Opt2OKCtl GEQU $07FEFFC2
|
||||
Opt2CancelCtl GEQU $07FEFFC3
|
||||
Opt2SetPassChangeStrCtl GEQU $07FEFFC4
|
||||
Opt2SetPassOldPassStrCtl GEQU $07FEFFC5
|
||||
Opt2SetPassNewPassStrCtl GEQU $07FEFFC6
|
||||
Opt2SetPassOldCtl GEQU $07FEFFC7
|
||||
Opt2SetPassNew1Ctl GEQU $07FEFFC8
|
||||
Opt2SetPassNew2Ctl GEQU $07FEFFC9
|
||||
PassEnterPassCtl GEQU $07FEFFCA
|
||||
PassEnterPassStrCtl GEQU $07FEFFCB
|
||||
Opt2SetPathCtl GEQU $07FEFFCC
|
||||
Opt2UseDiffPathCtl GEQU $07FEFFCD
|
||||
Opt2AdvOptionsStrCtl GEQU $07FEFFCE
|
||||
Opt2SHRCornersActiveCtl GEQU $07FEFFCF
|
||||
Opt2MinutesStrCtl GEQU $07FEFFD0
|
||||
Opt2SwapCtl GEQU $07FEFFD1
|
||||
Opt2DataFieldTimeCtl GEQU $07FEFFD2
|
||||
Opt2PassProtCtl GEQU $07FEFFD3
|
||||
Opt2SetPassCtl GEQU $07FEFFD4
|
||||
Opt2CurPathStrCtl GEQU $07FEFFD5
|
||||
WaitThermoCtl GEQU $07FEFFD6
|
||||
OptLowMemoryCtl GEQU $07FEFFD7
|
||||
OptUseIntelliKeyCtl GEQU $07FEFFD8
|
||||
OptSysBeepsUnblankCtl GEQU $07FEFFD9
|
||||
OptProhibitSndCtl GEQU $07FEFFDA
|
||||
OptWatchPopupCtl GEQU $07FEFFDB
|
||||
OptTextBlankPopupCtl GEQU $07FEFFDC
|
||||
WaitWaitStrCtl GEQU $07FEFFDD
|
||||
T2SetupPopupCtl GEQU $07FEFFDE
|
||||
T2SetupLineCtl GEQU $07FEFFDF
|
||||
T2StopIcon320Ctl GEQU $07FEFFE0
|
||||
T2StopIcon640Ctl GEQU $07FEFFE1
|
||||
T2AbtModLineCtl GEQU $07FEFFE2
|
||||
T2AbtModInfoCtl GEQU $07FEFFE3
|
||||
T2AboutModuleCtl GEQU $07FEFFE4
|
||||
T2ModuleListCtl GEQU $07FEFFE5
|
||||
T2PurgeCtl GEQU $07FEFFE6
|
||||
T2SetupTestCtl GEQU $07FEFFE7
|
||||
T2IconCtl GEQU $07FEFFE8
|
||||
T2ToggleCtl GEQU $07FEFFE9
|
||||
T2GenericCantOpenMsgCtl GEQU $07FEFFEA
|
||||
T2SetupUpdateCtl GEQU $07FEFFEB
|
||||
OptBlankDelayDFCtl GEQU $07FEFFEC
|
||||
OptMinToBlankStrCtl GEQU $07FEFFED
|
||||
OptCapsLockCtl GEQU $07FEFFEE
|
||||
OptMenuBoxCtl GEQU $07FEFFEF
|
||||
T2ActiveCtl GEQU $07FEFFF0
|
||||
OptNDACtl GEQU $07FEFFF1
|
||||
T2HelpTECtl GEQU $07FEFFF2
|
||||
OptMouseRestoreDeskCtl GEQU $07FEFFF3
|
||||
OptDClickFctnCtl GEQU $07FEFFF4
|
||||
T2VerCtl GEQU $07FEFFF5
|
||||
OptWarningAlertsCtl GEQU $07FEFFF6
|
||||
CornersStrCtl GEQU $07FEFFF7
|
||||
Corners_Rect GEQU $07FEFFF8
|
||||
UL_Popup GEQU $07FEFFF9
|
||||
LL_Popup GEQU $07FEFFFA
|
||||
UR_Popup GEQU $07FEFFFB
|
||||
LR_Popup GEQU $07FEFFFC
|
||||
T2StrCtl GEQU $07FEFFFD
|
||||
T2SetupCtl GEQU $07FEFFFE
|
||||
T2BlankNowCtl GEQU $07FEFFFF
|
||||
|
||||
CancelStr GEQU $07FEFFCA
|
||||
OKStr GEQU $07FEFFCB
|
||||
EnterPassStr GEQU $07FEFFCC
|
||||
NewPass2Str GEQU $07FEFFCD
|
||||
NewPass1Str GEQU $07FEFFCE
|
||||
OldPassStr GEQU $07FEFFCF
|
||||
Opt2PassProtStr GEQU $07FEFFD0
|
||||
Opt2SwapStr GEQU $07FEFFD1
|
||||
Opt2SHRCornActiveStr GEQU $07FEFFD2
|
||||
Opt2UseDiffPathStr GEQU $07FEFFD3
|
||||
Opt2SetItStr GEQU $07FEFFD4
|
||||
T2Options2MItemStr GEQU $07FEFFD5
|
||||
T2ToggleCtlStr GEQU $07FEFFD6
|
||||
OptLowMemoryStr GEQU $07FEFFD7
|
||||
OptUseIntelliKeyStr GEQU $07FEFFD8
|
||||
OptSysBeepsUnblankStr GEQU $07FEFFD9
|
||||
OptProhibitSndStr GEQU $07FEFFDA
|
||||
T2PurgeCtlStr GEQU $07FEFFDB
|
||||
T2SetupPopupStr GEQU $07FEFFDC
|
||||
T2SetupTestStr GEQU $07FEFFDD
|
||||
OptToggleStr GEQU $07FEFFDE
|
||||
OptMouseRestoreStr GEQU $07FEFFDF
|
||||
OptWarningAlertsStr GEQU $07FEFFE0
|
||||
OptWatchNormalBlankStr GEQU $07FEFFE1
|
||||
OptTextBkgroundBlankStr GEQU $07FEFFE2
|
||||
OptSetupModuleStr GEQU $07FEFFE3
|
||||
OptTextOnlyGSOSStr GEQU $07FEFFE4
|
||||
OptTxtScrnBlankStr GEQU $07FEFFE5
|
||||
OptWatchCursorStr GEQU $07FEFFE6
|
||||
OptWatchBkgroundBlankStr GEQU $07FEFFE7
|
||||
OptCloseT2MItemStr GEQU $07FEFFE8
|
||||
OptPreviewMItemStr GEQU $07FEFFE9
|
||||
OptDClickFctnStr GEQU $07FEFFEA
|
||||
OptCapsLockStr GEQU $07FEFFEC
|
||||
OptMenuBoxStr GEQU $07FEFFED
|
||||
T2ActiveCtlStr GEQU $07FEFFEE
|
||||
OptNDAStr GEQU $07FEFFEF
|
||||
DisabledStr GEQU $07FEFFF1
|
||||
BlankNowStr GEQU $07FEFFF2
|
||||
DontBlankStr GEQU $07FEFFF3
|
||||
ULStr GEQU $07FEFFF4
|
||||
BkgBlankNowStr GEQU $07FEFFF5
|
||||
LLStr GEQU $07FEFFF6
|
||||
URStr GEQU $07FEFFF7
|
||||
LRStr GEQU $07FEFFF8
|
||||
T2SetupStr GEQU $07FEFFF9
|
||||
T2AboutModuleStr GEQU $07FEFFFA
|
||||
T2SetupCtlStr GEQU $07FEFFFB
|
||||
T2BlankNowStr GEQU $07FEFFFC
|
||||
T2SetupUpdateStr GEQU $07FEFFFD
|
||||
T2OptionsMItemStr GEQU $07FEFFFE
|
||||
T2CornerMItemStr GEQU $07FEFFFF
|
||||
|
||||
T2SetupWatchMenu GEQU $07FEFFF8
|
||||
T2SetupTextBlankMenu GEQU $07FEFFF9
|
||||
OptDClickFctnMenu GEQU $07FEFFFA
|
||||
LR_Menu GEQU $07FEFFFB
|
||||
UR_Menu GEQU $07FEFFFC
|
||||
LL_Menu GEQU $07FEFFFD
|
||||
UL_Menu GEQU $07FEFFFE
|
||||
T2SetupModuleMenu GEQU $07FEFFFF
|
||||
|
||||
T2Options2MItem GEQU $07FEFFE2
|
||||
OptToggleMItem GEQU $07FEFFE3
|
||||
WatchDontBlank_MItem GEQU $07FEFFE4
|
||||
WatchNormalBlank_MItem GEQU $07FEFFE5
|
||||
WatchBkgroundBlank_MItem GEQU $07FEFFE6
|
||||
OptSetupModuleMItem GEQU $07FEFFE7
|
||||
TextOnlyGSOS_MItem GEQU $07FEFFE8
|
||||
TextBkgroundBlank_MItem GEQU $07FEFFE9
|
||||
TextBlankDisabled_MItem GEQU $07FEFFEA
|
||||
LL_Disabled_MItem GEQU $07FEFFEB
|
||||
LL_Never_MItem GEQU $07FEFFEC
|
||||
LL_Now_MItem GEQU $07FEFFED
|
||||
LL_BkgNow_MItem GEQU $07FEFFEE
|
||||
UR_Disabled_MItem GEQU $07FEFFEF
|
||||
UR_Never_MItem GEQU $07FEFFF0
|
||||
UR_Now_MItem GEQU $07FEFFF1
|
||||
UR_BkgNow_MItem GEQU $07FEFFF2
|
||||
LR_Disabled_MItem GEQU $07FEFFF3
|
||||
LR_Never_MItem GEQU $07FEFFF4
|
||||
LR_Now_MItem GEQU $07FEFFF5
|
||||
LR_BkgNow_MItem GEQU $07FEFFF6
|
||||
UL_Disabled_MItem GEQU $07FEFFF7
|
||||
UL_Never_MItem GEQU $07FEFFF8
|
||||
UL_Now_MItem GEQU $07FEFFF9
|
||||
UL_BkgNow_MItem GEQU $07FEFFFA
|
||||
T2OptionsMItem GEQU $07FEFFFB
|
||||
T2CornerMItem GEQU $07FEFFFC
|
||||
OptCloseMItem GEQU $07FEFFFD
|
||||
OptPreviewMItem GEQU $07FEFFFE
|
||||
T2MenuItem GEQU $07FEFFFF
|
||||
|
||||
PassEnterPass_LText GEQU $07FEFFEC
|
||||
Opt2NewPass_LText GEQU $07FEFFED
|
||||
Opt2OldPass_LText GEQU $07FEFFEE
|
||||
Opt2ChangePass_LText GEQU $07FEFFEF
|
||||
Opt2CurPath_LText GEQU $07FEFFF0
|
||||
Opt2Minutes_LText GEQU $07FEFFF1
|
||||
Opt2AdvOptions_LText GEQU $07FEFFF2
|
||||
WaitWait_LText GEQU $07FEFFF3
|
||||
T2Ver_LText GEQU $07FEFFF4
|
||||
T2CantFindSetup_LText GEQU $07FEFFF5
|
||||
OptMinToBlank_LText GEQU $07FEFFF6
|
||||
T2WriteProtect_LText GEQU $07FEFFF7
|
||||
Corners_LText GEQU $07FEFFF8
|
||||
T2CantDoFileStuff_LText GEQU $07FEFFF9
|
||||
T2CantStartTools_LText GEQU $07FEFFFA
|
||||
T2CantGetMemory_LText GEQU $07FEFFFB
|
||||
T2AbtModInfo_LText GEQU $07FEFFFC
|
||||
T2Help_EE1_LText GEQU $07FEFFFD
|
||||
T2Help_LText GEQU $07FEFFFE
|
||||
T2T2_LText GEQU $07FEFFFF
|
||||
|
||||
Opt2EnterPassWind GEQU $07FEFFFA
|
||||
PassWind GEQU $07FEFFFB
|
||||
T2_Wait_Window GEQU $07FEFFFC
|
||||
Temporary_T2_CDev_Window GEQU $07FEFFFD
|
||||
T2_Setup_Window GEQU $07FEFFFE
|
||||
T2_About_Module_Window GEQU $07FEFFFF
|
||||
|
||||
T2_Setup_WColor GEQU $07FEFFFF
|
||||
|
||||
BadPassAlert GEQU $07FEFFED
|
||||
Opt2Pass4LengthAlert GEQU $07FEFFEE
|
||||
Opt2BadNewPassAlert GEQU $07FEFFEF
|
||||
Opt2BadOldPassAlert GEQU $07FEFFF0
|
||||
awErrMemoryLMM GEQU $07FEFFF1
|
||||
awErrLoadModuleCancel GEQU $07FEFFF2
|
||||
awErrLoadModuleCont GEQU $07FEFFF3
|
||||
AlertInsertT2Disk GEQU $07FEFFF4
|
||||
AlertAbout320Error GEQU $07FEFFF5
|
||||
AlertSetup320Error GEQU $07FEFFF6
|
||||
AlertModuleNoSupportSetup GEQU $07FEFFF7
|
||||
AlertPurgeT2Warning GEQU $07FEFFF8
|
||||
AlertWarnPrefsNoSave2 GEQU $07FEFFF9
|
||||
AlertCapsLockError GEQU $07FEFFFA
|
||||
AlertCloseError GEQU $07FEFFFB
|
||||
AlertOpenError GEQU $07FEFFFC
|
||||
AlertUnknownError GEQU $07FEFFFD
|
||||
awCantPurge GEQU $07FEFFFE
|
||||
AlertWarnPrefsNoSave GEQU $07FEFFFF
|
||||
|
||||
T2_Init GEQU $07FEFFFF
|
||||
|
||||
Twilight_II_CDev GEQU $00000001
|
||||
|
||||
T2_CDev_Flags GEQU $00000001
|
||||
|
||||
Module_Folder GEQU $00000001
|
||||
Setup_Path GEQU $00000002
|
||||
|
||||
NoBlank640Cursor GEQU $07FEFFFE
|
||||
NoBlank320Cursor GEQU $07FEFFFF
|
||||
|
||||
T2_Version GEQU $00000001
|
||||
|
||||
T2_Init_RectList GEQU $07FEFFFF
|
Loading…
Reference in New Issue
Block a user