# File lib/native_file_types/c64/C64GeoPaintPic.rb, line 27
def unpacked_picture_bytes
        bitmap_lines=[]
        colour_map=[]
        (record_nos-[0]).each do |record_no|
#               puts "record #{record_no}"

                record=@contents[record_no]
                line=""
                p=0
                while p<record.length do
                        b=record[p]
#                       puts "byte %02x code %02x" % [p,b]

                        p+=1
                        case b
                        when (0..0x3F) then
#                               puts "copy $#{"%02x" % b} bytes"

                                b.times do 
                                        line<<record[p].chr
                                        p+=1
                                end
                        when (0x40..0x7F) then
                                pattern=record[p,8]
                                rep_count=b % 0x40
#                               puts "pattern rep count $#{"%02x" % rep_count}"

                                p+=8 
                                line<<pattern*rep_count
                        when (0x80..0xff) then
                                rep_count=b - 0x80
#                               puts "copy $#{"%02x" % rep_count} bytes"

                                b=record[p]
                                b = 0 if b.nil?
                                rep_count.times do 
                                        line<<b.chr
                                end
                                p+=1
                        else
                                raise "invalid code byte #{b}"
                        end
                end
                raise "malformed line (length was #{line.length}) at record ##{record_no}" unless line.length>=1448

#               puts "line length was #{line.length}) at record ##{record_no}"


                bitmap_lines[(record_no-1)*2]=line[0,640]
                bitmap_lines[1+(record_no-1)*2]=line[640,640]

                colour_map[(record_no-1)*2]=line[1288,80]
                colour_map[(record_no-1)*2+1]=line[1368,80]

        end
        [bitmap_lines,colour_map]
end