Commit Graph

39 Commits

Author SHA1 Message Date
ebc65ac4a5 build: make the build emit relative paths 2017-11-19 18:26:39 -08:00
3976d8635e gbdb: add support for multiple commands on single line 2017-11-19 18:25:50 -08:00
23898c72b6 WIP 2017-09-17 19:02:46 -04:00
8e3a8056fa WIP: idk 2017-09-17 10:35:55 -04:00
2532bc077f WIP: makefile: fixx relative paths 2017-08-05 11:12:45 -07:00
be4b876955 buildbot: fix coverage reports
A recent commit which added out-of-tree builds broke buildbot coverage
reports. This fixes them.
2017-05-31 22:23:02 -07:00
df22d782f5 Makefile: fix stopping on failed tests
A previous patch changed the way tests are run by piping the output
into sed to indent the output. This broke checking the return code of
the test because the return code is really that of sed.

Fix this by taking a dependecy on bash and using PIPESTATUS to get
the return code fo the test.
2017-05-31 22:03:30 -07:00
8dbcf353ab gbemu: refactor testing infrastructure
Similar to gbasm, break the testing into different files for sanity's
sake. This patch also adds a "test" register state which is compared
to the state of the actual CPU registers at the end of the test.

Finally, break the inc and dec tests, but add "ld r8, r8" and "ld dr,
d8" tests.
2017-05-31 22:03:29 -07:00
30df5164d6 cpu: add missing header guards 2017-05-31 22:03:27 -07:00
f76d384e6d cpu: define get_reg functions as const
This will be useful in the future when we want to reference the CPU
state in a const-way.
2017-05-31 22:03:26 -07:00
e062a40571 gbasm: return the position of the first differing byte
This aids debugging failing tests by showing exactly where things
failed in assertions that follow failed comparisons.
2017-05-31 22:03:25 -07:00
7900ac28ff ld: add support for loading 8-bit immediates 2017-05-31 22:03:23 -07:00
6a9e8b06a7 configure: add a proper configure script
It's not very good, but it supports all of the options by the
previous far-worse Makefile configure targets, and also now supports
out-of-tree builds.

Also include the relevent updates to the .buildbot script and
.gitignore.
2017-05-31 22:03:21 -07:00
ba534f81e4 gbasm: do not differentiate immediate bit lengths
Instead, treat them simply as values. Specific instructions can
determine if their values are valid or representable.
2017-05-31 22:03:05 -07:00
05bff5cefb gbasm: truncate file at end of output
When overwriting an old output file, this will delete the extra data
if the new output is shorter than the old output.
2017-05-23 22:12:22 -07:00
4cad9a3ec3 gbasm: make some internal functions static 2017-05-20 18:59:40 -07:00
e64d59c793 parser: treat comma as a delimiter 2017-05-20 18:58:59 -07:00
bc3d54edbc gbasm: add test for "ld r8, r8" 2017-05-20 16:55:58 -07:00
b0577cebc6 gbasm: add support for generating source input
By adding an "init" function per test, it is easier to
generate code that would be laborious to write by hand.
2017-05-20 16:50:49 -07:00
70a7e80d3e gbasm: add support for "ld, r8, r8" 2017-05-20 16:47:57 -07:00
a5f3ae7ad6 gbasm: correct the "(hl)" operand
Though not a real register, the operand "(hl)" fits in
better with the 8-bit registers than it does with the
sixteen bit ones. As such, move its definition.

Also, define useful values for the 8-bit operands rather
than arbitrary ones.
2017-05-20 16:43:29 -07:00
e1d8eb0257 buildbot: remove extra directories from uploads 2017-05-13 11:19:27 -07:00
2a6178da6f gitignore: remove buildbot and doxygen artifacts 2017-05-10 22:40:12 -07:00
e506e74ca4 buildbot: update buildbot output directory 2017-05-10 22:40:12 -07:00
cdeae65824 buildbot: vacuously succeed on unknown commands 2017-05-10 22:40:12 -07:00
a6786ae01e README: update compilation documentation
Signed-off-by: Max Regan <mgregan2@gmail.com>
2017-05-10 22:40:12 -07:00
23fa8db134 test: add buildbot configuration
Signed-off-by: Max Regan <mgregan2@gmail.com>
2017-05-10 22:40:12 -07:00
5cdda55874 doxygen: add simple config
Signed-off-by: Max Regan <mgregan2@gmail.com>
2017-05-10 22:40:12 -07:00
e5acc3088c treewide: restucture source tree per project
Signed-off-by: Max Regan <mgregan2@gmail.com>
2017-05-10 22:40:12 -07:00
6ba525b64b .gitignore: add a gitignore for build artifacts
Signed-off-by: Max Regan <mgregan2@gmail.com>
2017-05-10 22:40:12 -07:00
f8f17f91d0 cpu: fix dec_16
When getting the register index, an incorrect shift was being
used. Fix the test case by correcting this.

Signed-off-by: Max Regan <mgregan2@gmail.com>
2017-05-10 22:40:12 -07:00
b6f9557d11 cpu: cleanup to use named registers
Since we have direct access to registers via name by "cpu->a" and the
like. Use that notation in a few more places since it is far more concise.

Signed-off-by: Max Regan <mgregan2@gmail.com>
2017-05-10 22:40:12 -07:00
5bbc6097b5 cpu: fix up register accesses
The HL dereference operations cause problems indexing into the
registers array, because it causes a hole in the array that only
exists in the 8-bit register space.

Instead of accessing the registers directly by the same indices used
in in the assembly instructions, create a lookup table to map between
them.

Signed-off-by: Max Regan <mgregan2@gmail.com>
2017-05-10 22:40:12 -07:00
0268f13080 common: include newline in debug logger
So it isn't necessary to add it each time.

Signed-off-by: Max Regan <mgregan2@gmail.com>
2017-05-10 22:40:12 -07:00
544e4afee8 tests: rename to remove underscores
It makes them more amenable to using their names as the
names of the lcov output reports, which complains about
the dashes.

Signed-Off-By: Max Regan <mgregan2@gmail.com>
2017-05-10 22:40:12 -07:00
681b8e3233 make: clean up coverage builds
Clean up the coverage build output, and add a "config" target for
doing a coverage build.

Signed-off-by: Max Regan <mgregan2@gmail.com>
2017-05-10 22:40:12 -07:00
d25d2d8549 test: add automatic unit test coverage generation
Using lcov, generate an HTML report via "make coverage-report"
describing the coverage of each file. Ideally, this will get added to
an automated testing pipeline.

Signed-off-by: Max Regan <mgregan2@gmail.com>
2017-05-10 22:40:12 -07:00
d9bf91fc5a tri: fix autocomplete when one string is a prefix of another
Also add a bunch of unit tests for all of the various tri functions.

Signed-off-by: Max Regan <mgregan2@gmail.com>
2017-05-10 22:40:12 -07:00
6e2f4096a2 gb-emu: initial commit
Add a mostly non-functional Gameboy CPU and the skeleton
of a Gameboy assembler intended for unit tests.
2017-05-10 22:40:12 -07:00