# File lib/native_file_types/apple2/PackedHiResPicFormats.rb, line 158 def unpacked_picture_bytes packed_buffer=data_without_header unpacked_buffer="\000"*8192 in_p=0 out_p=0 while out_p<8192 && in_p<packed_buffer.length do colour_byte=packed_buffer[in_p] if (colour_byte==0x80) || (colour_byte==0xFF) then in_p+=1 run_length=packed_buffer[in_p] colour_byte&=0x7F else run_length=1 end in_p+=1 run_length.times do unpacked_buffer[out_p]=colour_byte unless out_p>=8192 out_p+=1 end end unpacked_buffer end