diff --git a/source/twilight/nm/asm.getset2 b/source/twilight/nm/asm.getset2 new file mode 100644 index 0000000..64a45f8 --- /dev/null +++ b/source/twilight/nm/asm.getset2 @@ -0,0 +1,28 @@ +* This sample code shows how to manipulate a DataField control using two custom +* control messages. DataField supports all other normal control activity. For +* example, you can set the ctlInvis bit in the control flags field, and the +* control will not draw. + +* To find out what tag value the first field is set to, use this code: + + LongResult + PushLong DataCtlHand + PushWord #GetFieldValue + PushWord #0 ;not used for GetFieldValue + PushWord #34 ;field number - they start at 34 + _CallCtlDefProc + pla ;this is the current tag + plx ;always zero + +* To change the value of a field, use this code: + + LongResult + PushLong DataCtlHand + PushWord #SetFieldValue + PushWord #4 ;new tag value for this field + PushWord #34 ;field number - they start at 34 + _CallCtlDefProc + plx ;always zero + plx ;same + + diff --git a/source/twilight/nm/bsq/FISH b/source/twilight/nm/bsq/FISH new file mode 100644 index 0000000..0e99fa2 Binary files /dev/null and b/source/twilight/nm/bsq/FISH differ diff --git a/source/twilight/nm/bsq/FishPix b/source/twilight/nm/bsq/FishPix new file mode 100644 index 0000000..0ea3ef8 Binary files /dev/null and b/source/twilight/nm/bsq/FishPix differ diff --git a/source/twilight/nm/bsq/ToastPix b/source/twilight/nm/bsq/ToastPix new file mode 100644 index 0000000..c3d7993 Binary files /dev/null and b/source/twilight/nm/bsq/ToastPix differ diff --git a/source/twilight/nm/bsq/t2.common.stuff/README b/source/twilight/nm/bsq/t2.common.stuff/README new file mode 100644 index 0000000..d1ba906 --- /dev/null +++ b/source/twilight/nm/bsq/t2.common.stuff/README @@ -0,0 +1,39 @@ +Nathan Mates's Twlight II common asm routine documentation + + These are very sketchy docs, as I simply wrote the things for myself, +and was asked today to upload them. I hope to be getting the sample "Ball" +T2 module source in C or Pascal soon so that I can distribute a sample module's +source that isn's copyrighted. :) + + Anyways, this set of files should include the file e16.t2, which is a +modified version of what Jim sent me earlier. I commented out some stack +offsets that aren't useful anymore, as my code takes care of the stack and +all on entry. + +[ Jim- Modify the e16.t2 file to your linking; you wrote 90% of it :) ] + + Also included are a set of files, asm, macros, and exec files designed +to let you build the set of common routines. + +[ Jim- If you don't want the datactl stuff to get out (I don't have the +datactl dox in this archive anyways), just delete the references to the +datactl file in "go" and "makemacs" as well as the datactl file. ] + + To save the time used in recompiling these common routines every time, I +have come up with a slightly new system, which I call objLibraries. That is, +the compiled form resides in your Libraries folder (13: under orca), and +they are linked in at link time. To do this, you simply need to tell the +computer to do so. Assuming that you have a blanker assembled to the name +objfile (with orca making the extensions .root, .a, .b and so forth), simply +use the command + +link 13:t2.comm objfile + + Of course, you can add the KEEP= directive, the -x flag (T2 blankers are so +small that expressing is a waste) as you like. + + The 'build libraries' exec "go" is included so that you can run it and +copies of the objLibraries are in the right place. + +[Jim- Just send me the Ball sample source and I'll make up a full demo. It's +a little hard to explain everything without referring to some source ] diff --git a/source/twilight/nm/bsq/t2.common.stuff/go b/source/twilight/nm/bsq/t2.common.stuff/go new file mode 100644 index 0000000..0f257fa --- /dev/null +++ b/source/twilight/nm/bsq/t2.common.stuff/go @@ -0,0 +1,2 @@ +compile t2.common.asm Keep=13:t2.comm +compile t2.datactl.asm Keep=13:t2.data diff --git a/source/twilight/nm/bsq/t2.common.stuff/makemacs b/source/twilight/nm/bsq/t2.common.stuff/makemacs new file mode 100644 index 0000000..3e67b33 --- /dev/null +++ b/source/twilight/nm/bsq/t2.common.stuff/makemacs @@ -0,0 +1,2 @@ +macgen t2.common.asm t2.common.macs 18/m16= +macgen t2.datactl.asm t2.datactl.macs 18/m16= diff --git a/source/twilight/nm/bsq/t2.common.stuff/t2.common.asm b/source/twilight/nm/bsq/t2.common.stuff/t2.common.asm new file mode 100644 index 0000000..aa17bac --- /dev/null +++ b/source/twilight/nm/bsq/t2.common.stuff/t2.common.asm @@ -0,0 +1,542 @@ + mcopy t2.common.macs + copy 18/e16.t2 + copy 18/e16.memory + +* +* +* General T2 module code (at least for my modules) by Nathan Mates +* Based heavily on source sent to me by Jim Maricondo; I made functions +* out of a lot of things that got used a lot. +* +* Entry points in your code that need to be supported: +* DoMakeT2,DoSaveT2,DoBlankT2,DoLoadSetupT2,DoUnloadT2,DoKillT2,DoHitT2 +* +* A number of callbacks for common operations are given, with a _2 name. +* See the included code for their code and use. +* +* Code assumptions: +* 1. You have at most 65535 item IDs in a setup window. Thus, the high word is +* zero. If you want more, you know enough to make the necessary changes. +* 2. There is only 1 code segment for the blanker. +* Thus, if you use object-named segments (such as "Label start NukeIraq"), +* you'll have to delete the names or make all the functions here with your +* name. +* This allows: +* -jsr/rts around in the code +* -words to be passed around for pointers to things. This is for things +* like passing pointers to resName strings; the upper word is the +* current bank. +* 3. You have Orca, and have some understanding of my macros. +* +* You may use this code freely in your modules as long as this source file +* retains my name in it. This is in the CommonData data segment; please don't +* touch it. + +Entry start + using CommonData + +T2Message equ 13 + + phb ;Store old data bank + phk + plb + + phd + tsc + sta EntryStack + inc a + inc a ;account for phd on stack... + tcd + + lda EndDItems are unhitable + +* If there are special conditions, or whatever, make your own + +T2Data2 equ 5 +T2Result equ 15 + + ldx #True ;assume hit something worthwile. + lda T2data2+2 ;ctlID hi word must be zero + bne nothingHit + lda T2data2 ;get ctlID + cmp MaxDHitable + beq HitIt + blt HitIt + ldx #0 ;didn't hit anything worthwile; no need to save +HitIt stx T2Result +nothingHit rts + end + +* +* +DoMakeT2_2 start +* +* Entry code for make, which sets up variables that are used in a lot of +* other setup places. If you use any other functions in here related to +* setup and preferences, USE THIS FUNCTION BEFORE OTHERS!!! +* + using CommonData +T2Data1 equ 9 ;on stacked dp +T2Data2 equ 5 ; " +T2Result equ 15 ; " + + lda T2data1+2 + sta WindPtr+2 + lda T2data1 + sta WindPtr + lda T2data2 + sta RezFileID + lda MaxDItemNum ;defined in your source + sta T2Result + phb + phb ;get the current program bank + pla + and #$FF ;make it 8-bits only + sta ThisProgBnk + + PushWord + _MMStartUp + PullWord MyID + + LongResult + pei + +* Also: Registers to pass in: +* AAAA: Resource Type to load +* XXXX: Pointer to rName pascal string +* YYYY: Flag whether this is a 1-word resource +* + +* YYYY=1 = Not Word Resource +* In1: Pointer to Function handling resource loaded from disk +* When called, a pointer to the loaded resource is at +* DP 3, so lda [3] is the first word of that resource. +* Take nothing from the stack, put nothing on it, and +* end with an rts. Also, don't mess with the DP. +* In2: Pointer to Function handling first time (resource not yet created) +* Called when the resource told to load is not around. +* No defined DP, or whatever. End with an rts +* +* YYYY=0 = Word Resource +* In1: Default value (for when resource is not on disk) +* In2: Pointer to word variable to store the parameter in (output) +* +* See the included code for details. +* +* On exit, parameters are cleaned up from the stack, and the carry flag is +* set according to whether the resource existed on disk (cc=yes, cs=no) + + using CommonData + sta ResIOType + stx StringPtr + sty DataType + + phb ;have to define on entry! + phb ;get the current program bank + pla + and #$FF ;make it 8-bits only + sta ThisProgBnk + + LongResult + PushWord ResIOType ;resource type + PushWord ThisProgBnk ;upper word of long pointer + phx ;lower word of long pointer to rName string. + _RMLoadNamedResource + bcc IsOnDisk ;cc=was on disk... + + plx ;not on disk here + plx ;remove result from stack... + ldy DataType + bne NotDiskFcn + lda 5,s ;default value + sta (3,s),y ;Y guaranteed to be 0 coming in here + bra DoneNotDisk + +NotDiskFcn per DoneNotDisk-1 ;"rts" address + lda 5,s ;"not loaded" function handler + dec a ;-1 to make an rts pointer from it + pha + rts +DoneNotDisk sec ;flag not on disk... +DoneLoad pla ;return address + plx + plx ;remove + pha + rts + +IsOnDisk jsr MakePDp ;make pointer to loaded resource on stack... + ldy DataType + bne OnDiskFcn ;passed in function ptr to handle loading + lda [3] ;get what the pointer is pointing at + sta (9,s),y ;y=0 + bra DoneDisk ;and handle the rest of the disk access... + +OnDiskFcn per DoneDisk-1 ;"rts" address + lda 13,s + dec a ;-1 to make a rts pointer from it + pha + rts ;rts to the callback +DoneDisk KillLDp ;pld/pla/pla or similar + + PushWord #3 ;purge level + PushWord ResIOType ;rtype for release + + LongResult + PushWord ResIOType + PushWord ThisProgBnk ;upper word of long pointer + PushWord StringPtr + PushLong #Temp ;don't care about filenum, but toolbox does + _RMFindNamedResource ;get it + _ReleaseResource ;and throw it out. We have a copy now :) + clc + bra DoneLoad ;get out of here... + +DataType ds 2 + end + +* +* +SaveAPref start +* +* Saves a preference to disk, handles its not being there... + +* Stack Just before Calling +* Word : Length of resource +* Word : In2 +* + +* Also: Registers to pass in: +* AAAA: Resource Type to load +* XXXX: Pointer to rName pascal string +* + +* Based on the Length of the resource, In2 should be: +* Length=2 (1 word) +* In2 should be the actual value to store. +* Length not 2 +* In2 should be a pointer to a function +* When called, a pointer to where to store the resource is at DP 3. +* It is your responsibility not to touch the stack, and not write +* beyond the size you specified for the resource. End your routine +* with an rts. +* +* See the included code for details. +* +* On exit, parameters are cleaned up from the stack, and the carry flag is +* set according to whether the resource existed on disk (cc=yes, cs=no) + + using CommonData + sta ResIOType + stx StringPtr + + phb ;have to define on entry! + phb ;get the current program bank + pla + and #$FF ;make it 8-bits only + sta ThisProgBnk + + LongResult + PushWord ResIOType ;resource type + PushWord ThisProgBnk ;upper word of long pointer + phx ;StringPtr + _RMLoadNamedResource + jcc HavePrefs1 + +* ;use trashed result from _RMLoadNamedResource +* ;as space for output from _NewHandle + PushWord #0 ;high word of + PushWord 11,s ;length of block in bytes + WordResult + _GetCurResourceApp + PushWord #attrNoCross+attrNoSpec + phd + phd + _NewHandle + lda 1,s + sta temp + lda 1+2,s + sta temp+2 + jsr MakePdp + + lda 11,s ;length on stack... + cmp #2 ;word resource? + bne FcnPtr1 + lda 9,s ;value to save to disk + sta [3] + bra FirstTime ;and go about getting out of here + +FcnPtr1 per FirstTime-1 + lda 11,s + dec a + pha + rts +FirstTime KillLdp ;pld pla pla. Same # bytes as a jsr... + + PushLong temp ;handle + PushWord #attrNoSpec+attrNoCross ;attr + PushWord ResIOType ;rtype + LongResult + PushWord #$FFFF + PushWord ResIOType + _UniqueResourceID + lda 1,s + sta temp + lda 1+2,s + sta temp+2 + _AddResource + + PushWord ResIOType ;rType + PushLong temp ;rID + PushWord ThisProgBnk ;upper word of long pointer + PushWord StringPtr + _RMSetResourceName + plx ;return address + pla + pla ;get stacked stuff off + phx + sec ;flag resource wasn't on disk + rts ;out of here... + +HavePrefs1 anop + jsr MakePdp + lda 11,s ;length byte on stack + cmp #2 + bne FcnPtr2 + lda 09,s ;value to save to disk + sta [3] + bra AlreadyThere ;and go about getting out of here + +FcnPtr2 per AlreadyThere-1 + lda 11,s + dec a + pha + rts +AlreadyThere KillLdp ;pld pla pla. Same # bytes as a jsr... + + PushWord #TRUE ;changeflag: true + PushWord ResIOType ;rtype + + LongResult + pha ;ResIOType from 2 lines up + PushWord ThisProgBnk ;upper word of long pointer + PushWord StringPtr + PushLong #Temp ;don't care about filenum, but toolbox does + _RMFindNamedResource ;get it + _MarkResourceChange + plx ;return address + pla + pla ;get stacked stuff off + phx + rts + end \ No newline at end of file diff --git a/source/twilight/nm/bsq/t2.common.stuff/t2.common.macs b/source/twilight/nm/bsq/t2.common.stuff/t2.common.macs new file mode 100644 index 0000000..9a0dc51 --- /dev/null +++ b/source/twilight/nm/bsq/t2.common.stuff/t2.common.macs @@ -0,0 +1,190 @@ + MACRO +&lab _GetCtlHandleFromID +&lab ldx #$3010 + jsl $E10000 + MEND + MACRO +&lab _GetCtlValue +&lab ldx #$1A10 + jsl $E10000 + MEND + MACRO +&lab _NewControl2 +&lab ldx #$3110 + jsl $E10000 + MEND + MACRO +&lab _SetCtlValue +&lab ldx #$1910 + jsl $E10000 + MEND + MACRO +&lab _MMStartUp +&lab ldx #$0202 + jsl $E10000 + MEND + MACRO +&lab _NewHandle +&lab ldx #$0902 + jsl $E10000 + MEND + MACRO +&lab _SysFailMgr +&lab ldx #$1503 + jsl $E10000 + MEND + MACRO +&LAB JCC &BP +&LAB BCS *+5 + BRL &BP + MEND + MACRO +&lab WordResult +&lab pha + MEND + MACRO +&lab LongResult +&lab pha + pha + MEND + MACRO +&lab killLdp +&lab pld + pla + pla + 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 _GetWRefCon +&lab ldx #$290E + jsl $E10000 + MEND + MACRO +&lab _AddResource +&lab ldx #$0C1E + jsl $E10000 + MEND + MACRO +&lab _GetCurResourceApp +&lab ldx #$141E + jsl $E10000 + MEND + MACRO +&lab _MarkResourceChange +&lab ldx #$101E + jsl $E10000 + MEND + MACRO +&lab _ReleaseResource +&lab ldx #$171E + jsl $E10000 + MEND + MACRO +&lab _UniqueResourceID +&lab ldx #$191E + jsl $E10000 + MEND + MACRO +&lab _RMFindNamedResource +&lab ldx #$2A1E + jsl $E10000 + MEND + MACRO +&lab _RMLoadNamedResource +&lab ldx #$2C1E + jsl $E10000 + MEND + MACRO +&lab _RMSetResourceName +&lab ldx #$2D1E + jsl $E10000 + MEND diff --git a/source/twilight/nm/bsq/t2.common.stuff/t2.datactl.asm b/source/twilight/nm/bsq/t2.common.stuff/t2.datactl.asm new file mode 100644 index 0000000..80fe42b --- /dev/null +++ b/source/twilight/nm/bsq/t2.common.stuff/t2.datactl.asm @@ -0,0 +1,141 @@ + mcopy t2.datactl.macs + copy 18/e16.t2 + copy 18/e16.memory + +* +* +Mk1stDatactl start +* +* Makes the first (or only) Datactl; once it's made, subsequent calls can be +* made to LoadDataCtl for the others. +* +* Pass In: +* XXXX: Lower word of resource ID for control template of DataCrl to load +* Upper word must be 0 +* YYYY: Value to set this control to after it's made. +* + using Globals + using CommonData +T2Data1 equ 9 + + stx ResToLoadId + sty ResValue + + LongResult ; for CallCtlDefProc + LongResult ; for NewControl2 + pei 0,.a +&BL SETA L:&SYSOPR+1 +.a +&REST AMID "&SYSOPR",2,&BL-2 + dc I1'$F4',I2'&REST' + MEND + MACRO +&lab _LoadResource +&lab ldx #$0E1E + jsl $E10000 + MEND diff --git a/source/twilight/nm/bug b/source/twilight/nm/bug new file mode 100644 index 0000000..7ddf36e --- /dev/null +++ b/source/twilight/nm/bug @@ -0,0 +1,13 @@ +Path: DYA/Digisoft Innovations/Twilight II v1.0/v1.1 (Part 2) + +Subj: Love it. :) 93-05-20 00:02:09 EDT +From: AFC Tosh +Posted on: America Online + + I got my upgrade in the mail.....Having had many problems with earlier versions, its great to have a nice stable version now....works like a charm. + + Found one minor bug....When in the Clock Module, "Digital", the hour character is trashed when the hour changes.....i.e: when it changes from 4:59 to 5:00, the 5 character will not be drawn correctly. No crashes, and it keeps telling time OK. Just not redrawing the Hour correctly. :) + +Love Scanner Mode. :) + +Tosh