# File test/backup/NADOLDisk.rb, line 66
def find_catalog_slot(filename)
  track=0
  sector=3
  catalog_filename=NADOLFile.catalog_filename(filename.upcase) unless filename.nil?
  while (sector<=9) do
    sector_data=get_sector(track,sector)
    (0..15).each do |slot_no|
      slot_start=slot_no*0x10
      if (filename.nil? && (sector_data[slot_start]==0x00)|| (sector_data[slot_start]==0xFF)) then
        return DSKTrackSector.new(track,sector,slot_start)
      end
      if (!filename.nil?) && (sector_data[slot_start..slot_start+0x0B]==catalog_filename) then
        return DSKTrackSector.new(track,sector,slot_start)
      end
    end
    sector+=1
  end
  nil
end