Standardize formatting again

This commit is contained in:
Matthew Berry 2022-01-08 10:02:33 -08:00
parent 1e0dc878dd
commit 0c7e952b8f
7 changed files with 2 additions and 12 deletions

View file

@ -158,8 +158,6 @@ module GBA
when 0x88 then @soundbias.value.to_u8!
when 0x89 then (@soundbias.value >> 8).to_u8!
else puts "Unmapped APU read ~ addr:#{hex_str io_addr.to_u8}".colorize.fore(:red); 0_u8 # todo: open bus
end
end

View file

@ -85,8 +85,6 @@ module GBA
when 0x64 then 0xFF_u8 # write-only
when 0x65 then 0xBF_u8 | (@length_enable ? 0x40 : 0)
else puts "Reading from invalid Channel1 register: #{hex_str index.to_u16}".colorize.fore(:red); 0_u8 # todo: open bus
end
end

View file

@ -50,8 +50,6 @@ module GBA
when 0x6C then 0xFF_u8 # write-only
when 0x6D then 0xBF_u8 | (@length_enable ? 0x40 : 0)
else puts "Reading from invalid Channel2 register: #{hex_str index.to_u16}".colorize.fore(:red); 0_u8 # todo: open bus
end
end

View file

@ -63,8 +63,6 @@ module GBA
@wave_ram[@wave_ram_bank][index - WAVE_RAM_RANGE.begin]
end
else puts "Reading from invalid Channel3 register: #{hex_str index.to_u16}".colorize.fore(:red); 0_u8 # todo: open bus
end.to_u8
end

View file

@ -50,8 +50,6 @@ module GBA
when 0x7C then @clock_shift << 4 | @width_mode << 3 | @divisor_code
when 0x7D then 0xBF | (@length_enable ? 0x40 : 0)
else puts "Reading from invalid Channel4 register: #{hex_str index.to_u16}".colorize.fore(:red); 0_u8 # todo: open bus
end.to_u8
end

View file

@ -7,7 +7,7 @@ module GBA
address = @r[rb]
unless list == 0
final_addr = 4_u32 * list.popcount + address
if load # ldmia
if load # ldmia
@r[rb] = final_addr # thumb ldmia writes back immediately
8.times do |idx|
if bit?(list, idx)

View file

@ -4,7 +4,7 @@ module GBA
alias Word = UInt32
alias Words = Slice(UInt32)
record BGR16, value : UInt16 do # xBBBBBGGGGGRRRRR
# Create a new BGR16 struct with the given values. Trucates at 5 bits.
# Create a new BGR16 struct with the given values. Trucates at 5 bits.
def initialize(blue : Number, green : Number, red : Number)
@value = (blue <= 0x1F ? blue.to_u16 : 0x1F_u16) << 10 |
(green <= 0x1F ? green.to_u16 : 0x1F_u16) << 5 |