-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addet sound and serial ram registers
- Loading branch information
Showing
33 changed files
with
868 additions
and
954 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package serial; | ||
|
||
import ram.RamRegister; | ||
|
||
public class SerialControllRegister extends RamRegister | ||
{ | ||
private static final int SC_ADRESS = 0xFF02; | ||
|
||
private static final int TRANSFER_START_FLAG = 7; | ||
private static final int UNUSED_BIT_6 = 6; | ||
private static final int UNUSED_BIT_5 = 5; | ||
private static final int UNUSED_BIT_4 = 4; | ||
private static final int UNUSED_BIT_3 = 3; | ||
private static final int UNUSED_BIT_2 = 2; | ||
private static final int UNUSED_BIT_1 = 1; | ||
private static final int SHIFT_CLOCK = 0; | ||
|
||
public SerialControllRegister() | ||
{ | ||
super(SC_ADRESS); | ||
setBit(UNUSED_BIT_6, true); | ||
setBit(UNUSED_BIT_5, true); | ||
setBit(UNUSED_BIT_4, true); | ||
setBit(UNUSED_BIT_3, true); | ||
setBit(UNUSED_BIT_2, true); | ||
setBit(UNUSED_BIT_1, true); | ||
} | ||
|
||
@Override | ||
public void put(int adress, byte input) | ||
{ | ||
super.put(adress, input); | ||
setBit(UNUSED_BIT_6, true); | ||
setBit(UNUSED_BIT_5, true); | ||
setBit(UNUSED_BIT_4, true); | ||
setBit(UNUSED_BIT_3, true); | ||
setBit(UNUSED_BIT_2, true); | ||
setBit(UNUSED_BIT_1, true); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package serial; | ||
|
||
import ram.RamRegister; | ||
|
||
public class SerialTransferDataRegister extends RamRegister | ||
{ | ||
private static final int SB_ADRESS = 0xFF01; | ||
|
||
public SerialTransferDataRegister() | ||
{ | ||
super(SB_ADRESS); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package sound; | ||
|
||
import ram.RamRegister; | ||
|
||
public class ChannelControlRegister extends RamRegister | ||
{ | ||
private static final int NR50_ADRESS = 0xFF24; | ||
|
||
private static final int CARDRIDGE_SOUND_SIGNAL_TO_SPEAKER_2 = 7; | ||
private static final int SPEAKER_2_OUTPUT_LEVEL_BIT_2 = 6; | ||
private static final int SPEAKER_2_OUTPUT_LEVEL_BIT_1 = 5; | ||
private static final int SPEAKER_2_OUTPUT_LEVEL_BIT_0 = 4; | ||
private static final int CARDRIDGE_SOUND_SIGNAL_TO_SPEAKER_1 = 3; | ||
private static final int SPEAKER_1_OUTPUT_LEVEL_BIT_2 = 2; | ||
private static final int SPEAKER_1_OUTPUT_LEVEL_BIT_1 = 1; | ||
private static final int SPEAKER_1_OUTPUT_LEVEL_BIT_0 = 0; | ||
|
||
public ChannelControlRegister() | ||
{ | ||
super(NR50_ADRESS); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package sound; | ||
|
||
import ram.RamRegister; | ||
|
||
public class SelectionOfSoundOutputRegister extends RamRegister | ||
{ | ||
private static final int NR51_ADRESS = 0xFF25; | ||
|
||
private static final int OUTPUT_SOUND_4_TO_SPEAKER_2 = 7; | ||
private static final int OUTPUT_SOUND_3_TO_SPEAKER_2 = 6; | ||
private static final int OUTPUT_SOUND_2_TO_SPEAKER_2 = 5; | ||
private static final int OUTPUT_SOUND_1_TO_SPEAKER_2 = 4; | ||
private static final int OUTPUT_SOUND_4_TO_SPEAKER_1 = 3; | ||
private static final int OUTPUT_SOUND_3_TO_SPEAKER_1 = 2; | ||
private static final int OUTPUT_SOUND_2_TO_SPEAKER_1 = 1; | ||
private static final int OUTPUT_SOUND_1_TO_SPEAKER_1 = 0; | ||
|
||
public SelectionOfSoundOutputRegister() | ||
{ | ||
super(NR51_ADRESS); | ||
} | ||
|
||
} |
Oops, something went wrong.