diff --git a/tar.tal b/tar.tal index cf127f9..89eb7b6 100644 --- a/tar.tal +++ b/tar.tal @@ -97,8 +97,6 @@ @read-error "error 20 "reading 20 "data 0a 00 -( LIKELY BUG: skipping large distances may not work ) - ( skips carry*2^32 + hi*2^16 + lo bytes ) @skip ( carry^ hi* lo* -> ) skip-lo ( carry^ hi* ) diff --git a/type-abc.tal b/type-abc.tal index b6549d0..aaf13ce 100644 --- a/type-abc.tal +++ b/type-abc.tal @@ -456,3 +456,5 @@ [ 2a 00 00 00 ] [ 00 00 00 00 ] [ 00 00 00 00 ] &silence $1000 + +( zzzqqqqqq ) diff --git a/wave.tal b/wave.tal index ac8dfd5..c6ff80f 100644 --- a/wave.tal +++ b/wave.tal @@ -69,16 +69,14 @@ ;filename .File/name DEO2 parse .is-stereo LDZ ?&stereo - .is-8bit LDZ ?&mono-8bit - ;mono-s16-to-u8 ;reload/resample STA2 #01 ;reload/sft STA !&done - &mono-8bit - ;mono-u8-to-u8 ;reload/resample STA2 #00 ;reload/sft STA !&done + .is-8bit LDZ ?&mono-8bit LITr 01 ;mono-s16-to-u8 !&done + &mono-8bit LITr 00 ;mono-u8-to-u8 !&done &stereo - .is-8bit LDZ ?&stereo-8bit - ;stereo-s16-to-u8 ;reload/resample STA2 #02 ;reload/sft STA !&done - &stereo-8bit - ;stereo-u8-to-u8 ;reload/resample STA2 #01 ;reload/sft STA !&done + .is-8bit LDZ ?&stereo-8bit LITr 02 ;stereo-s16-to-u8 !&done + &stereo-8bit LITr 01 ;stereo-u8-to-u8 !&done &done + LIT2 =reload/resample STA2 ( ; save resample function ) + LIT2r =reload/sft STAr ( ; save shift size ) #2000 .File/len DEO2 #2000 ;len0 STA2 #2000 ;buf0 zero-buf-u8 #2000 ;len1 STA2 #2000 ;buf1 zero-buf-u8 @@ -100,11 +98,13 @@ .File/ok DEI2 #002c EQU2k ?&ok #0000 DIV &ok POP2 POP2 - ;header ( hdr* ) - #0016 ADD2 LDA2k #0200 EQU2 .is-stereo STZ ( hdr+22* ) - #000c ADD2 LDA2k #0800 EQU2 .is-8bit STZ ( hdr+34* ) + #0016 #0200 hdr-eq2 .is-stereo STZ ( ; hdr+22 ) + #0022 #0800 hdr-eq2 .is-8bit STZ ( ; hdr+34 ) JMP2r + @hdr-eq2 ( offset* v* -> eq^ ) + STH2 ;header ADD2 LDA2 STH2r EQU2 JMP2r + @reload ( l-addr* b-addr* -> ) .done LDZ ?&skip ( l-addr* b-addr* ) SWP2 ( b-addr* l-addr* )