various minor changes suggested by ameba

This commit is contained in:
Matthew Berry 2022-10-28 16:59:46 -07:00
parent eafe5455f6
commit afcd4b667e
4 changed files with 4 additions and 4 deletions

View file

@ -36,7 +36,7 @@ class BiosSelection < Resolvable
ImGui.same_line
gba_bios_text_buffer_valid = @gba_bios_text_buffer_valid
ImGui.push_style_color(ImGui::ImGuiCol::Text, RED_TEXT_COL) unless gba_bios_text_buffer_valid
ImGui.input_text_with_hint("##gba_bios", "optional", @gba_bios_text_buffer, ImGui::ImGuiInputTextFlags::CallbackAlways) do |data|
ImGui.input_text_with_hint("##gba_bios", "optional", @gba_bios_text_buffer, ImGui::ImGuiInputTextFlags::CallbackAlways) do
@gba_bios_text_buffer_valid = @gba_bios_text_buffer.bytesize == 0 || File.file?(@gba_bios_text_buffer.to_s)
0 # allow input to proceed
end

View file

@ -16,7 +16,7 @@ module GBA
@gpio : GPIO
def initialize(@gba : GBA, bios_path : String)
File.open(bios_path) { |file| file.read @bios }
File.open(bios_path, &.read(@bios))
@gpio = GPIO.new(@gba)
end

View file

@ -14,7 +14,7 @@ module GBA
end
def initialize(rom_path : String)
File.open(rom_path) { |file| file.read @rom }
File.open(rom_path, &.read(@rom))
# The following logic accounts for improperly dumped ROMs or bad homebrews.
# All proper ROMs should have a power-of-two size. The handling here is
# really pretty arbitrary. mGBA chooses to fill the entire ROM address

View file

@ -134,7 +134,7 @@ module GBA
delta_source = word_size * source_control.delta
delta_dest = word_size * dest_control.delta
len.times do |idx|
len.times do
@gba.bus[@dst[channel]] = word_size == 4 ? @gba.bus.read_word(@src[channel]) : @gba.bus.read_half(@src[channel])
@src[channel] &+= delta_source
@dst[channel] &+= delta_dest