home *** CD-ROM | disk | FTP | other *** search
- #type &ffa
- #name StasisRaw
- #base 0
- #include ASMLib:Standard
- #set Service_PsychoStarting=&80300
- #set Service_PsychoDying =&80301
- #set Service_UKStasisFormat=&80310
- #set Service_StasisSave =&80311
- #set Service_StasisIdentify=&80312
- #set stasis_alien =1
- #set raw_filetype =&FFD
-
- .ModuleHeader
- .start
- DCD 0
- DCD init
- DCD final
- DCD service
- DCD title
- DCD help
- DCD helptable
- DCD 0
- DCD 0
- DCD 0
- DCD 0
- .title
- DCB "StasisRaw"
- DCB 0
- ALIGN
- .help
- DCB "Stasis Alien",9,"1.00 (24 Jan 1995) - For raw data samples"
- DCB 0
- ALIGN
- .helptable
- DCB "StasisRaw"
- DCB 0
- ALIGN
- DCD 0
- DCD 0
- DCD 0
- DCD rawhelp
- DCD 0;End Marker
- .rawhelp
- DCB "This module allows Stasis to handle raw data. The samples can be replayed, and saved by the *StasisSave Raw command.",0
- ALIGN
- .service
- ;R12 is the only register we may corrupt in a service call
- SUBS R12,R1,#&80000
- MOVMI PC,R14
- SUB R12,R12,#&300
- TEQ R12,#Service_UKStasisFormat-&80300
- TEQNE R12,#Service_StasisIdentify-&80300
- TEQNE R12,#Service_StasisSave-&80300
- MOVNE PC,R14
- TEQ R12,#Service_StasisIdentify-&80300
- BEQ identify
- TEQ R12,#Service_StasisSave-&80300
- BEQ save
- .ukformat
- STMFD R13!,{R3-R4,R14}
- MOV R3,#&FFD
- CMP R2,R3
- LDMNEFD R13!,{R3-R4,PC}^
- ;identified a raw sample by its filetype.
-
- ADR R0,alienblock
- MOV R1,#0; claim service call
- LDMFD R13!,{R3-R4,PC}
-
- .alienblock
- DCB "StAl"; ID Word - required - used to check if the block is valid.
- DCD getinfo-alienblock;get info routine
- DCD putinfo-alienblock;put info routine
- DCD 0 ;release routine (we don't have one)
- DCD 0 ;must be zero
- DCD 0 ;for future use
- DCD 0 ;for future use
- DCD name1-alienblock
- DCD formatname-alienblock
- DCD raw_filetype
- DCD title-alienblock
- DCD 0
- ALIGN
-
- ;The info routine is entered with
- ;R0 points to the stasis slot decription block
- ;R1 points to your sample
-
- ;The file length as loaded may be accessed by LDR R0,[R10,#4]
-
- ;The info entry should return:
-
- ;R1=name *
- ;R2=length
- ;R3=finetune * &4000=default, &2000=1 octave lower, &8000=1 octave higher etc
- ;R4=repofs *
- ;R5=replen *
- ;R6=datastart
- ;R7=volume *
- ;R8=special (return R8=0)
- ; *= may return zero if not supported
-
- .getinfo
- MOV R11,R1;our sample address
- MOV R1,#0; sample name - not supported by raw samples
- LDR R2,[R10,#4]; file length
- MOV R3,#0
- MOV R4,#0
- MOV R5,#0
- MOV R7,#0
- MOV R6,R11
- MOV R7,#0
- MOV R8,#0
- MOV PC,R14
-
- .putinfo
- AND R0,R8,#%111111111 ;what we don't support ie everything
- MOV PC,R14
-
- .identify
- ADD R0,R0,#1
- CMP R2,#0
- MOVEQ PC,R14
- ADR R12,alienblock
- STR R12,[R2],#4
- MOV PC,R14
-
- ;On entry to a save routine, R0 is the slot number (for us to pass
- ;to Stasis_GetSlotInfo.
- ;R2 points to the filename
- ;R3 points to the namecheck routine in Stasis which compares the name
- ;pointed to by R1 to that entered at the command line
-
- ;We pass on the Service call if we don't recognise the save type
- ;ie return with MOV PC,R14 with registers unchanged.
- ;If we want to save in our format we return with
- ;R0 preserved.
- ;R1=0 to claim the service call
- ;R2 points to a filled-in header block
- ;R3 is the length of the header block
- ;R4 is the filetype
- ;Stasis will add the sample data in logarithmic format after the header
- ;
- ;Otherwise return with R2=0 after carrying out the whole save process
- ;yourself.
- ;To return an error, return with R2=1 and R0 pointing to an error block.
-
- .rawformat
- .save
- STMFD R13!,{R1,R14}
- ADR R1,name1
- MOV R14,PC
- MOV PC,R3 ;BL to R3
- LDMFD R13!,{R1,R14}
- MOVNES PC,R14;return if no match
- STMFD R13!,{R0,R5-R10,R14}
- MOV R1,#0
- ADR R2,rawformat
- MOV R3,#0
- MOV R4,#raw_filetype
- LDMFD R13!,{R0,R5-R10,PC}
- ;return and let Stasis do the rest
-
- .init ;My standard init/final service calls.
- STMFD R13!,{R0-R3,R14}
- ADR R0,start
- MOV R1,#Service_PsychoStarting
- MOV R2,#0; the R12 value
- MOV R3,stasis_alien
- ADR R4,alienblock
- SWI OS_ServiceCall
- CMP R1,#0
- LDMFD R13!,{R0-R3,R14}
- ADREQ R0,initerrtext
- ORRVS R14,R14,#1<<28
- MOVS PC,R14
-
- .final
- STMFD R13!,{R0-R3,R14}
- ADR R0,start
- MOV R1,#Service_PsychoDying
- MOV R2,#0
- MOV R3,stasis_alien
- ADR R4,alienblock
- SWI OS_ServiceCall
- CMP R1,#0
- LDMFD R13!,{R0-R3,R14}
- ADREQ R0,finalerrtext
- ORRVS R14,R14,#1<<28
- MOVS PC,R14
-
- .initerrtext
- DCD &809DFE
- DCB "StasisRaw : Initialisation veto",0
- ALIGN
- .finalerrtext
- DCD &809DFF
- DCB "StasisRaw : RMKill veto",0
-
- .name1
- DCB "Raw",0
- .name2
- DCB "Raw",0
- .formatname
- DCB "Raw Data",0
- ALIGN
-
-
-
-
-
-
-
-