mirror of
https://github.com/mattrberry/crab.git
synced 2024-11-16 19:49:30 +01:00
various minor changes suggested by ameba
This commit is contained in:
parent
eafe5455f6
commit
afcd4b667e
4 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue