class GB::Channel1

Defined in:

crab/gb/apu/channel1.cr

Constant Summary

RANGE = 65296..65300
WAVE_DUTY = Slice[[0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 1, 1, 1, 0]]

Instance Method Summary

Instance methods inherited from class GB::VolumeEnvelopeChannel

init_volume_envelope : Nil init_volume_envelope, read_NRx2 : UInt8 read_NRx2, volume_step : Nil volume_step, write_NRx2(value : UInt8) : Nil write_NRx2

Instance methods inherited from class GB::SoundChannel

===(other) ===, [](index : Int) : UInt8 [], []=(index : Int, value : UInt8) : Nil []=, enabled : Bool enabled, enabled=(enabled : Bool) enabled=, frequency_timer : UInt32 frequency_timer, get_amplitude : Float32 get_amplitude, length_counter : Int32 length_counter, length_counter=(length_counter : Int32) length_counter=, length_step : Nil length_step, schedule_reload(frequency_timer : UInt32) : Nil schedule_reload, step : Nil step, step_wave_generation : Nil step_wave_generation

Constructor methods inherited from class GB::SoundChannel

new(gb : GB) new

Instance Method Detail

def ===(other) : Bool #
Description copied from class GB::SoundChannel

Used so that channels can be matched with case..when statements


[View source]
def [](index : Int) : UInt8 #

[View source]
def []=(index : Int, value : UInt8) : Nil #

[View source]
def frequency_calculation : UInt16 #

Calculate the new shadow frequency, disable channel if overflow 11 bits https://gist.github.com/drhelius/3652407#file-game-boy-sound-operation-L243-L250


[View source]
def frequency_timer : UInt32 #
Description copied from class GB::SoundChannel

Calculate the frequency timer


[View source]
def get_amplitude : Float32 #

[View source]
def schedule_reload(frequency_timer : UInt32) : Nil #

[View source]
def step_wave_generation : Nil #
Description copied from class GB::SoundChannel

Called when @period reaches 0


[View source]
def sweep_step : Nil #

[View source]