diff --git a/lib/furnace-avm2/abc/opcodes/push_literal/as3_pushbyte.rb b/lib/furnace-avm2/abc/opcodes/push_literal/as3_pushbyte.rb index 3de9047..fc10a8b 100644 --- a/lib/furnace-avm2/abc/opcodes/push_literal/as3_pushbyte.rb +++ b/lib/furnace-avm2/abc/opcodes/push_literal/as3_pushbyte.rb @@ -3,7 +3,7 @@ class AS3PushByte < PushLiteralOpcode instruction 0x24 body do - uint8 :value + int8 :value end type :integer diff --git a/lib/furnace-avm2/abc/opcodes/push_literal/as3_pushshort.rb b/lib/furnace-avm2/abc/opcodes/push_literal/as3_pushshort.rb index c47b29e..b6b2503 100644 --- a/lib/furnace-avm2/abc/opcodes/push_literal/as3_pushshort.rb +++ b/lib/furnace-avm2/abc/opcodes/push_literal/as3_pushshort.rb @@ -3,7 +3,7 @@ class AS3PushShort < PushLiteralOpcode instruction 0x25 body do - vuint30 :value + vint32 :value end type :integer diff --git a/lib/furnace-avm2/binary/record.rb b/lib/furnace-avm2/binary/record.rb index ca0f634..9f96b2c 100644 --- a/lib/furnace-avm2/binary/record.rb +++ b/lib/furnace-avm2/binary/record.rb @@ -186,6 +186,20 @@ def length_uint8(value, options) 1 end + # int8 + + def read_int8(io, options) + io.read(1).unpack("c").at(0) + end + + def write_int8(io, value, options) + io.write([value].pack("c")) + end + + def length_int8(value, options) + 1 + end + # uint16 def read_uint16(io, options) diff --git a/test/basic.as b/test/basic.as index 74c06be..aab23a4 100644 --- a/test/basic.as +++ b/test/basic.as @@ -1,7 +1,7 @@ package test { class Literal { function test() { - call(1, 1, 200, 200); + call(1, 1, 200, 200, -1, -50, 32767, 32768, -32760, -500000); } }