forked from trash80/mGB
-
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.
This is a big C reorg to serve two main purposes: - Be more consistent with C and GBDK patterns - Separate modules and logic where possible. It will allow unit testing (next PR) and enable more contained enhancements (e.g. new screens, new synth concepts) and encourage small bug fixes Changes: - Refactors C to use .h patterns - Splits code into modules: io, synth, screen. Consolidates global variables, easier to test and clearer which functionality owns which variables - Converts ASM playNote* and update* for Pu1, Pu2, Wav, Noi into C functions - Most are pretty comparable in speed, so this shouldn't be a big perf regression (stats in comments above methods) - Use structs for a bunch of arrays to improve readability (pointer to struct members is similar to array access (still more room for improvement) - Use GBDK global vars for readability (e.g. rAUD3LOW, _AUDWAVERAM, rAUDENA, etc)
- Loading branch information
Showing
40 changed files
with
2,110 additions
and
2,401 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[Makefile] | ||
indent_style = tab | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = 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
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,24 @@ | ||
#pragma once | ||
|
||
#include <gbdk/platform.h> | ||
|
||
#define MIDI_STATUS_BIT 0x80 | ||
#define MIDI_STATUS_NOTE_ON 0x09 | ||
#define MIDI_STATUS_NOTE_OFF 0x08 | ||
#define MIDI_STATUS_AT 0x0A | ||
#define MIDI_STATUS_CC 0x0B | ||
#define MIDI_STATUS_PC 0x0C | ||
#define MIDI_STATUS_AT_MONO 0x0D | ||
#define MIDI_STATUS_PB 0x0E | ||
|
||
#define MIDI_STATUS_SYSTEM 0xF0 | ||
|
||
// MIDI status | ||
extern uint8_t statusByte; | ||
// MIDI address (e.g. note/CC control) | ||
extern uint8_t addressByte; | ||
// MIDI value (e.g. velocity/value) | ||
extern uint8_t valueByte; | ||
extern uint8_t capturedAddress; | ||
|
||
void updateMidiBuffer(void); |
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,7 @@ | ||
#pragma once | ||
|
||
extern void asmEventMidiPB(void); | ||
extern void asmEventMidiCC(void); | ||
extern void asmEventMidiNote(void); | ||
extern void asmEventMidiNoteOff(void); | ||
extern void asmEventMidiPC(void); |
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,7 @@ | ||
#pragma once | ||
|
||
#include <gbdk/platform.h> | ||
|
||
extern uint8_t serialBuffer[256]; | ||
extern uint8_t serialBufferPosition; | ||
extern uint8_t serialBufferReadPosition; |
Oops, something went wrong.