aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-05-19 12:22:42 +0200
committerBad Diode <bd@badd10de.dev>2021-05-19 12:22:42 +0200
commitfd5dede600bcaf8d5c16963544512b2e0ba68586 (patch)
treedfcf87c67ec114e34a92e07b7545afcf75ee4d2d
parent9873680f9d24e30afc1962987fac2c3ad1612f7b (diff)
downloaduxngba-fd5dede600bcaf8d5c16963544512b2e0ba68586.tar.gz
uxngba-fd5dede600bcaf8d5c16963544512b2e0ba68586.zip
Test automata drawing
-rw-r--r--src/bd-font.c11
-rw-r--r--src/common.h11
-rw-r--r--src/main.c5
-rw-r--r--src/small-font.c11
-rw-r--r--src/sprites.h11
5 files changed, 47 insertions, 2 deletions
diff --git a/src/bd-font.c b/src/bd-font.c
index e3fb6cc..6913f78 100644
--- a/src/bd-font.c
+++ b/src/bd-font.c
@@ -1,3 +1,14 @@
1/*
2Copyright (c) 2021 Bad Diode
3
4Permission to use, copy, modify, and distribute this software for any
5purpose with or without fee is hereby granted, provided that the above
6copyright notice and this permission notice appear in all copies.
7
8THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9WITH REGARD TO THIS SOFTWARE.
10*/
11
1u32 bd_font[] = { 12u32 bd_font[] = {
2 0x00000000, 0x00000000, 0x00002400, 0x423c0000, 13 0x00000000, 0x00000000, 0x00002400, 0x423c0000,
3 0x00002400, 0x3c420000, 0x0000363e, 0x3e1c0800, 14 0x00002400, 0x3c420000, 0x0000363e, 0x3e1c0800,
diff --git a/src/common.h b/src/common.h
index aeea1a6..2859b11 100644
--- a/src/common.h
+++ b/src/common.h
@@ -3,6 +3,17 @@
3 3
4#include "shorthand.h" 4#include "shorthand.h"
5 5
6/*
7Copyright (c) 2021 Bad Diode
8
9Permission to use, copy, modify, and distribute this software for any
10purpose with or without fee is hereby granted, provided that the above
11copyright notice and this permission notice appear in all copies.
12
13THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14WITH REGARD TO THIS SOFTWARE.
15*/
16
6// 17//
7// Memory sections. 18// Memory sections.
8// 19//
diff --git a/src/main.c b/src/main.c
index df6e225..cd991e1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -10,7 +10,8 @@
10#include "uxn/uxn.c" 10#include "uxn/uxn.c"
11#include "uxn/devices/ppu.h" 11#include "uxn/devices/ppu.h"
12#include "uxn/devices/ppu.c" 12#include "uxn/devices/ppu.c"
13#include "uxn/roms/dvd.c" 13// #include "uxn/roms/dvd.c"
14#include "uxn/roms/automata.c"
14 15
15/* 16/*
16Copyright (c) 2021 Bad Diode 17Copyright (c) 2021 Bad Diode
@@ -69,7 +70,7 @@ screen_talk(Device *d, Uint8 b0, Uint8 w) {
69 Uint8 *layer = d->dat[0xe] >> 4 & 0x1 ? ppu.fg : ppu.bg; 70 Uint8 *layer = d->dat[0xe] >> 4 & 0x1 ? ppu.fg : ppu.bg;
70 Uint8 mode = d->dat[0xe] >> 5; 71 Uint8 mode = d->dat[0xe] >> 5;
71 if(!mode) { 72 if(!mode) {
72 // putpixel(&ppu, layer, x, y, d->dat[0xe] & 0x3); 73 putpixel(&ppu, layer, x, y, d->dat[0xe] & 0x3);
73 } else if(mode-- & 0x1) { 74 } else if(mode-- & 0x1) {
74 puticn(&ppu, layer, x, y, addr, d->dat[0xe] & 0xf, mode & 0x2, mode & 0x4); 75 puticn(&ppu, layer, x, y, addr, d->dat[0xe] & 0xf, mode & 0x2, mode & 0x4);
75 } else { 76 } else {
diff --git a/src/small-font.c b/src/small-font.c
index 2f232dd..e5adb35 100644
--- a/src/small-font.c
+++ b/src/small-font.c
@@ -1,3 +1,14 @@
1/*
2Copyright (c) 2021 Bad Diode
3
4Permission to use, copy, modify, and distribute this software for any
5purpose with or without fee is hereby granted, provided that the above
6copyright notice and this permission notice appear in all copies.
7
8THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9WITH REGARD TO THIS SOFTWARE.
10*/
11
1u32 small_font[] = { 12u32 small_font[] = {
2 0x00000000, 0x00000000, 0x00020202, 0x00020000, 13 0x00000000, 0x00000000, 0x00020202, 0x00020000,
3 0x000a0a00, 0x00000000, 0x000a1f0a, 0x1f0a0000, 14 0x000a0a00, 0x00000000, 0x000a1f0a, 0x1f0a0000,
diff --git a/src/sprites.h b/src/sprites.h
index a64b784..c5eb57c 100644
--- a/src/sprites.h
+++ b/src/sprites.h
@@ -3,6 +3,17 @@
3 3
4#include "common.h" 4#include "common.h"
5 5
6/*
7Copyright (c) 2021 Bad Diode
8
9Permission to use, copy, modify, and distribute this software for any
10purpose with or without fee is hereby granted, provided that the above
11copyright notice and this permission notice appear in all copies.
12
13THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14WITH REGARD TO THIS SOFTWARE.
15*/
16
6typedef struct Sprite { 17typedef struct Sprite {
7 // A unique sprite identifier. 18 // A unique sprite identifier.
8 size_t id; 19 size_t id;