mirror of
https://github.com/ksherlock/iigs.git
synced 2025-01-03 15:30:07 +00:00
fix some bugs
This commit is contained in:
parent
cb87444860
commit
830963c0a0
11
aaae.rb
11
aaae.rb
@ -37,15 +37,16 @@ def output_bytes(name, data)
|
|||||||
tmp.each_byte {|b|
|
tmp.each_byte {|b|
|
||||||
print " " if index == 0
|
print " " if index == 0
|
||||||
|
|
||||||
printf("%02x, ", b)
|
printf("0x%02x, ", b)
|
||||||
|
|
||||||
index = index + 1
|
index = index + 1
|
||||||
if index == 16
|
if index == 8
|
||||||
print "\n"
|
print "\n"
|
||||||
index = 0
|
index = 0
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
print "\n" if index > 0
|
puts "0x00\n"
|
||||||
|
#print "\n" if index > 0
|
||||||
puts "};"
|
puts "};"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -66,10 +67,10 @@ def output_strings(name, data)
|
|||||||
data.each {|x|
|
data.each {|x|
|
||||||
|
|
||||||
# escape \
|
# escape \
|
||||||
x = x.gsub(/\\/, '\\')
|
x = x.gsub(/([\\"])/) {|m| '\\' + m }
|
||||||
|
|
||||||
# escape "
|
# escape "
|
||||||
x = x.gsub(/"/, '\"')
|
#x = x.gsub(/"/, '\"')
|
||||||
|
|
||||||
# escape chars...
|
# escape chars...
|
||||||
# unfortunately, \x doesn't have a length limit so
|
# unfortunately, \x doesn't have a length limit so
|
||||||
|
Loading…
Reference in New Issue
Block a user