summaryrefslogtreecommitdiff
path: root/README
blob: 046f0a1e7e296e880905b505b8d54513afe091c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
libstdgb
========

A C library of useful Game Boy operations.

This library is designed to provide you a simple C interface to the hardware of
the Game Boy hand-held gaming console. It's for the original Game Boy only:
while the code will still run on the Color and Advance models, this library
does not aim to provide interfaces to the features of those devices, such as
color displays.

It also includes complementary post-processing tools designed to make it easy
to organize your Game Boy binary file and formats efficiently on the ROM so you
can spend more time making progress and less time fighting binary formats.

Dependencies
------------

| Program/Library         | Purpose                                         |
|-------------------------|-------------------------------------------------|
| Small Device C Compiler | C compiler used to generate binary instructions |
| CPython 3               | Used for post-processing tools                  |
| Wand for Python 3       | Used for converting images to Game Boy format   |

On Debian-based systems, these can be installed as follows:

    # apt-get install sdcc python3 python3-wand

Notice
------

libstdgb is made using the Small Device C Compiler (SDCC). SDCC has many
versions which output code of varying quality. You should not expect a complete
project to have the same binary size when compiled on different systems.

The version on which this software was tested is not a perfectly optimized
compiler either. For this reason, some of the code will instead be written in
Game Boy assembly language for simple routines that can be easily perfected in
assembly language. This is necessary for a few reasons:

- By writing in assembly language, the output code is predictable (exactly)
- Binary size is a big concern in Game Boy programming; the smaller the better
- For some functions, a program might not be able to tolerate a slow procedure
  - For instance, copying tile maps to VRAM cannot take longer than VBlank

Hacking
-------

libstdgb uses the GNU coding style for C with a strict 79-column limit in the
source code. For "hot" operations, assembly code is permitted, but make sure to
heavily comment its functionality. The goal here is to make this program as
accessible to C programmers as possible while maintaining binary size and
execution time efficiency.

If you would like to contribute, [send your diff to Delwink][1], or use
GitHub's pull request system.

License
-------

libstdgb is libre software: you are free to use, modify, and redistribute it
under the terms of version 3 of the GNU Affero General Public License. See
[COPYING](COPYING) for details.

[1]: mailto:contribute@delwink.com