mirror of
https://github.com/mattrberry/crab.git
synced 2025-02-06 08:45:53 +01:00
fix thumb add not setting value, rename var in thumb multiple load/store
This commit is contained in:
parent
4194dfb6fd
commit
843fb155df
2 changed files with 3 additions and 3 deletions
|
@ -7,7 +7,7 @@ module THUMB
|
||||||
case op
|
case op
|
||||||
when 0b00 then res = @r[rd] = offset
|
when 0b00 then res = @r[rd] = offset
|
||||||
when 0b01 then res = sub(@r[rd], offset, true)
|
when 0b01 then res = sub(@r[rd], offset, true)
|
||||||
when 0b10 then res = add(@r[rd], offset, true)
|
when 0b10 then res = @r[rd] = add(@r[rd], offset, true)
|
||||||
when 0b11 then res = @r[rd] = sub(@r[rd], offset, true)
|
when 0b11 then res = @r[rd] = sub(@r[rd], offset, true)
|
||||||
else raise "Invalid move/compare/add/subtract op: #{op}"
|
else raise "Invalid move/compare/add/subtract op: #{op}"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
module THUMB
|
module THUMB
|
||||||
def thumb_multiple_load_store(instr : Word) : Nil
|
def thumb_multiple_load_store(instr : Word) : Nil
|
||||||
load_from_memory = bit?(instr, 11)
|
load = bit?(instr, 11)
|
||||||
rb = bits(instr, 8..10)
|
rb = bits(instr, 8..10)
|
||||||
list = bits(instr, 0..7)
|
list = bits(instr, 0..7)
|
||||||
address = @r[rb]
|
address = @r[rb]
|
||||||
if load_from_memory # ldmia
|
if load # ldmia
|
||||||
8.times do |idx|
|
8.times do |idx|
|
||||||
if bit?(list, idx)
|
if bit?(list, idx)
|
||||||
@r[idx] = @gba.bus.read_word(address)
|
@r[idx] = @gba.bus.read_word(address)
|
||||||
|
|
Loading…
Add table
Reference in a new issue