diff options
author | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2021-07-23 01:11:13 +0100 |
---|---|---|
committer | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2021-07-23 01:11:13 +0100 |
commit | d4dcfd81f2332bcb766d4c7de257bcc848faf494 (patch) | |
tree | f34ca5c6a86995148022d8e54fe92f8a089038b1 | |
parent | Feature: Implemented reload and exit key behaviour (diff) | |
download | CHIP8-Emulator-d4dcfd81f2332bcb766d4c7de257bcc848faf494.tar.gz CHIP8-Emulator-d4dcfd81f2332bcb766d4c7de257bcc848faf494.tar.bz2 CHIP8-Emulator-d4dcfd81f2332bcb766d4c7de257bcc848faf494.zip |
Feature: Implemented background and foreround color customizability
-rw-r--r-- | config.h | 3 | ||||
-rw-r--r-- | main.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/config.h b/config.h index 07f52e8..1656026 100644 --- a/config.h +++ b/config.h @@ -11,6 +11,9 @@ #define GAME_LOAD_LOCATION 0x200 #define FONT_LOAD_LOCATION 0x50 +#define FOREGROUND_COLOR 0x00FFFFFF +#define BLACKGROUND_COLOR 0xFF000000 + #define dbgprintf(fmt, ...) \ do { if(DEBUG) fprintf (stdout, fmt, ##__VA_ARGS__); } while(0) diff --git a/main.c b/main.c index e528a69..449efda 100644 --- a/main.c +++ b/main.c @@ -65,7 +65,7 @@ int main(int argc, char** argv) for(int h = 0; h < 32; ++h) { uint8_t pixel = emulator.display[w][h]; - pixels[64 * h + w] = (0x00FFFFFF * pixel) | 0xFF000000; //TODO: make colors customizable in config.h + pixels[64 * h + w] = (FOREGROUND_COLOR * pixel) | BLACKGROUND_COLOR; } } |