diff --git a/src/crab/gb/audio/abstract_channels.cr b/src/crab/gb/audio/abstract_channels.cr index 1cd8a96..8b622b0 100644 --- a/src/crab/gb/audio/abstract_channels.cr +++ b/src/crab/gb/audio/abstract_channels.cr @@ -30,7 +30,7 @@ module GB end # Used so that channels can be matched with case..when statements - abstract def ===(value) + abstract def ===(other) # Calculate the frequency timer abstract def frequency_timer : UInt32 diff --git a/src/crab/gb/audio/channel1.cr b/src/crab/gb/audio/channel1.cr index e603771..1794abc 100644 --- a/src/crab/gb/audio/channel1.cr +++ b/src/crab/gb/audio/channel1.cr @@ -9,8 +9,8 @@ module GB RANGE = 0xFF10..0xFF14 - def ===(value) : Bool - value.is_a?(Int) && RANGE.includes?(value) + def ===(other) : Bool + other.is_a?(Int) && RANGE.includes?(other) end @wave_duty_position = 0 diff --git a/src/crab/gb/audio/channel2.cr b/src/crab/gb/audio/channel2.cr index 5dde400..286863a 100644 --- a/src/crab/gb/audio/channel2.cr +++ b/src/crab/gb/audio/channel2.cr @@ -9,8 +9,8 @@ module GB RANGE = 0xFF16..0xFF19 - def ===(value) : Bool - value.is_a?(Int) && RANGE.includes?(value) + def ===(other) : Bool + other.is_a?(Int) && RANGE.includes?(other) end @wave_duty_position = 0 diff --git a/src/crab/gb/audio/channel3.cr b/src/crab/gb/audio/channel3.cr index 33ecd76..5d32a69 100644 --- a/src/crab/gb/audio/channel3.cr +++ b/src/crab/gb/audio/channel3.cr @@ -3,8 +3,8 @@ module GB RANGE = 0xFF1A..0xFF1E WAVE_RAM_RANGE = 0xFF30..0xFF3F - def ===(value) : Bool - value.is_a?(Int) && RANGE.includes?(value) || WAVE_RAM_RANGE.includes?(value) + def ===(other) : Bool + other.is_a?(Int) && RANGE.includes?(other) || WAVE_RAM_RANGE.includes?(other) end @wave_ram = Bytes.new(WAVE_RAM_RANGE.size) { |idx| idx & 1 == 0 ? 0x00_u8 : 0xFF_u8 } diff --git a/src/crab/gb/audio/channel4.cr b/src/crab/gb/audio/channel4.cr index a052646..2a3059b 100644 --- a/src/crab/gb/audio/channel4.cr +++ b/src/crab/gb/audio/channel4.cr @@ -2,8 +2,8 @@ module GB class Channel4 < VolumeEnvelopeChannel RANGE = 0xFF20..0xFF23 - def ===(value) : Bool - value.is_a?(Int) && RANGE.includes?(value) + def ===(other) : Bool + other.is_a?(Int) && RANGE.includes?(other) end @lfsr : UInt16 = 0x0000 diff --git a/src/crab/gba/apu/abstract_channels.cr b/src/crab/gba/apu/abstract_channels.cr index c91b1a3..491fd02 100644 --- a/src/crab/gba/apu/abstract_channels.cr +++ b/src/crab/gba/apu/abstract_channels.cr @@ -30,7 +30,7 @@ module GBA end # Used so that channels can be matched with case..when statements - abstract def ===(value) + abstract def ===(other) # Calculate the frequency timer abstract def frequency_timer : UInt32 diff --git a/src/crab/gba/apu/channel1.cr b/src/crab/gba/apu/channel1.cr index 139aff6..3ead9b7 100644 --- a/src/crab/gba/apu/channel1.cr +++ b/src/crab/gba/apu/channel1.cr @@ -9,8 +9,8 @@ module GBA RANGE = 0x60..0x67 - def ===(value) : Bool - value.is_a?(Int) && RANGE.includes?(value) + def ===(other) : Bool + other.is_a?(Int) && RANGE.includes?(other) end @wave_duty_position = 0 diff --git a/src/crab/gba/apu/channel2.cr b/src/crab/gba/apu/channel2.cr index 280c059..d467931 100644 --- a/src/crab/gba/apu/channel2.cr +++ b/src/crab/gba/apu/channel2.cr @@ -9,8 +9,8 @@ module GBA RANGE = 0x68..0x6F - def ===(value) : Bool - value.is_a?(Int) && RANGE.includes?(value) + def ===(other) : Bool + other.is_a?(Int) && RANGE.includes?(other) end @wave_duty_position = 0 diff --git a/src/crab/gba/apu/channel3.cr b/src/crab/gba/apu/channel3.cr index 7c59841..d0f353c 100644 --- a/src/crab/gba/apu/channel3.cr +++ b/src/crab/gba/apu/channel3.cr @@ -3,8 +3,8 @@ module GBA RANGE = 0x70..0x77 WAVE_RAM_RANGE = 0x90..0x9F - def ===(value) : Bool - value.is_a?(Int) && RANGE.includes?(value) || WAVE_RAM_RANGE.includes?(value) + def ===(other) : Bool + other.is_a?(Int) && RANGE.includes?(other) || WAVE_RAM_RANGE.includes?(other) end @wave_ram = Array(Bytes).new 2, Bytes.new(WAVE_RAM_RANGE.size) { |idx| idx & 1 == 0 ? 0x00_u8 : 0xFF_u8 } diff --git a/src/crab/gba/apu/channel4.cr b/src/crab/gba/apu/channel4.cr index f6aabc5..c6b6681 100644 --- a/src/crab/gba/apu/channel4.cr +++ b/src/crab/gba/apu/channel4.cr @@ -2,8 +2,8 @@ module GBA class Channel4 < VolumeEnvelopeChannel RANGE = 0x78..0x7F - def ===(value) : Bool - value.is_a?(Int) && RANGE.includes?(value) + def ===(other) : Bool + other.is_a?(Int) && RANGE.includes?(other) end @lfsr : UInt16 = 0x0000 diff --git a/src/crab/gba/apu/dma_channels.cr b/src/crab/gba/apu/dma_channels.cr index f8021c0..156769d 100644 --- a/src/crab/gba/apu/dma_channels.cr +++ b/src/crab/gba/apu/dma_channels.cr @@ -8,8 +8,8 @@ module GBA @timers : Array(Proc(UInt16)) @latches = Array(Int16).new 2, 0 - def ===(value) : Bool - value.is_a?(Int) && RANGE.includes?(value) + def ===(other) : Bool + other.is_a?(Int) && RANGE.includes?(other) end def initialize(@gba : GBA, @control : Reg::SOUNDCNT_H)