WILDCARD = $97 ;------------------------------- ; SearchTrack subroutine ; written by qkumba ; search for a string occurring anywhere ; in the data buffer for the current track ; #WILDCARD in search string matches any 1 byte ; (like "." character in regular expressions) ; in: Y = string length ; stack = string to find ; out: C clear if string found ; or set if not found ; If C is clear, then ; A = sector where string was found ; X = starting offset where string was found ; all other registers and flags clobbered ;------------------------------- SearchTrack pla sta match_buffer1+1 sta match_all+1 pla sta match_buffer1+2 sta match_all+2 tax sty match_size1+1 sty match_size2+1 ; fetch last byte to improve search speed match_buffer1 lda $d1d1,y ; modified at runtime sta check_byte1+1 sta check_byte2+1 ; set low part of initial search position tya dey sty cont_search+1 ; set return address clc adc match_buffer1+1 tay bcc plus01 inx plus01 txa pha tya pha ; set match position inc match_all+1 bne plus02 inc match_all+2 plus02 ; set high part of initial search position lda #BASEPAGE sta search+2 lda #