diff --git a/.gitignore b/.gitignore index 1c6eb68..fe7f0cf 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,7 @@ a.out roms/ third_party/fmt bios.bin -*.sav \ No newline at end of file +*.sav +*.swp +./.tags + diff --git a/Makefile b/Makefile index 9c14c29..af61464 100644 --- a/Makefile +++ b/Makefile @@ -6,10 +6,10 @@ SOURCE = src INCLUDE = include BACKUPDIR = $(INCLUDE)/backup OBJ = \ + config.o \ APU.o \ Arm7.o \ arm_isa.o \ - config.o \ Discovery.o \ Flash.o \ Gamepad.o \ @@ -33,6 +33,12 @@ ifdef opt CXXFLAGS += -Ofast endif +# Use verbose output +# run `make verbose=1` +ifdef verbose +CXXFLAGS += -Wall -pedantic +endif + all: discovery discovery: $(LIST) main.cpp $(CXX) $(CXXFLAGS) -o discovery $(SOURCE)/main.cpp $(LIST) $(LIBS) diff --git a/README.md b/README.md index bba56dd..111ba06 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,65 @@ Discovery will attempt to load a BIOS in the same directory as the executable ca `./discovery path/to/rom -b path/to/bios` +### Flags + +| Flag | | Type | Description| +|----|----|----|----| +`-i` | `--input` | `string` | Specify the input ROM +`-b` | `--bios` | `string` | Specify the BIOS Discovery will use +`-c` | `--config` | `string` | Specify the config file Discovery will use +`-h` | `--help` | `boolean` | Print Discovery help + +## Configuration + +By default Discovery will load and read settings from a file named `discovery.config`. Alternatively, you can load from a different config file +using: + +`./discovery -c my_alt_config.file` + +The syntax for a config file is very simple. Key-value pairs are set like so: + +``` +# this is a comment +set_key = values_like_this +``` + +Below is a table describing the keys Discovery will recognize. + +### Configuration options + +|Key | Description| +|----|----| +`gba_a ` | Map the A button to the specified key +`gba_b ` | Map the B button to the specified key +`gba_sel ` | Map the Select button to the specified key +`gba_start ` | Map the Start button to the specified key +`gba_dpad_right` | Map right on the dpad to the specified key +`gba_dpad_left ` | Map left on the dpad to the specified key +`gba_dpad_up ` | Map up on the dpad to the specified key +`gba_dpad_down ` | Map down on the dpad the specified key +`gba_r ` | Map the R button to the specified key +`gba_l ` | Map the L button to the specified key + +#### Example + +This example config file will map controls to WASD keys, using the k, l, o, and p +keys for the A, B, L and R buttons, respectively: + +``` +# map buttons to WASD controls +gba_dpad_up = w +gba_dpad_down = s +gba_dpad_left = a +gba_dpad_right = d +gba_a = k +gba_b = l +gba_r = o +gba_l = p +gba_start = cr +gba_sel = bs +``` + ## Building on Linux based systems Discovery has the following dependencies: - make diff --git a/discovery.config b/discovery.config new file mode 100644 index 0000000..753ecc0 --- /dev/null +++ b/discovery.config @@ -0,0 +1,12 @@ +# map keys +gba_dpad_up = up +gba_dpad_down = down +gba_dpad_left = left +gba_dpad_right = right +gba_a = x +gba_b = z +gba_r = s +gba_l = a +gba_start = cr +gba_sel = bs + diff --git a/docs/assets/9600204_orig.gif b/docs/assets/9600204_orig.gif new file mode 100644 index 0000000..45b792c Binary files /dev/null and b/docs/assets/9600204_orig.gif differ diff --git a/docs/assets/Minimoog_1979_left_2017_right.jpg b/docs/assets/Minimoog_1979_left_2017_right.jpg new file mode 100644 index 0000000..014cdcc Binary files /dev/null and b/docs/assets/Minimoog_1979_left_2017_right.jpg differ diff --git a/docs/css/styles.css b/docs/css/styles.css index 1a73eac..0714666 100644 --- a/docs/css/styles.css +++ b/docs/css/styles.css @@ -81,3 +81,24 @@ hr { .bl { margin-bottom: 16px; } + +.figure { + display: flex; + flex-direction: column; + margin-top: 2rem; + margin-bottom: 2rem; +} + +.figure-text { + margin-left: auto; + margin-right: auto; + max-width: 66.66666%; + margin-top: .5rem; +} + +.figure-image { + margin-left: auto; + margin-right: auto; + max-width: 81.33333%; + max-height: 81.33333%; +} diff --git a/docs/docs.html b/docs/docs.html index b02d837..762e34b 100644 --- a/docs/docs.html +++ b/docs/docs.html @@ -74,34 +74,49 @@
Table of contents
  • Sound resources
  • @@ -111,13 +126,27 @@
    Table of contents
  • Fourier transform
  • -
    Just trying out in HTML