commit 3cd7be7eb52f931ed49bd8d46f01b405214216d5
parent 86a52e10913f7198e115f4384015de249a82d7db
Author: neauoire <aliceffekt@gmail.com>
Date: Sat, 10 Apr 2021 22:00:49 -0700
Removed duplicate function in ppu
Diffstat:
2 files changed, 22 insertions(+), 33 deletions(-)
diff --git a/projects/software/neralie.usm b/projects/software/neralie.usm
@@ -18,10 +18,10 @@
( program )
-|0200 @RESET
+|0200
( theme ) #03fd =System.r #0ef3 =System.g #0bf2 =System.b
- ( vectors ) ,FRAME =Screen.vector
+ ( vectors ) ,on-screen =Screen.vector
#01 =fps.current
#000c
@@ -38,7 +38,7 @@
OVR2 OVR2 ~lines.x1 ,v JSR2
~lines.x2 ,v JSR2
-@FRAME
+@on-screen
,update-fps JSR2
#00 =neralie.color
,neralie-lines JSR2
diff --git a/src/ppu.c b/src/ppu.c
@@ -64,36 +64,6 @@ drawchr(Ppu *p, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 alpha)
}
void
-drawicn(Ppu *p, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 fg, Uint8 bg)
-{
- Uint8 v, h;
- for(v = 0; v < 8; v++)
- for(h = 0; h < 8; h++) {
- Uint8 ch1 = (sprite[v] >> (7 - h)) & 0x1;
- drawpixel(p, x + h, y + v, ch1 ? fg : bg);
- }
-}
-
-void
-drawdebugger(Ppu *p, Uint8 *stack, Uint8 ptr)
-{
- Uint8 i, x, y, b;
- for(i = 0; i < 0x10; ++i) { /* memory */
- x = ((i % 8) * 3 + 3) * 8, y = p->pad + 8 + i / 8 * 8, b = stack[i];
- drawicn(p, x, y, font[(b >> 4) & 0xf], 1 + (ptr == i), 0);
- drawicn(p, x + 8, y, font[b & 0xf], 1 + (ptr == i), 0);
- }
- for(x = 0; x < 32; ++x) {
- drawpixel(p, x, p->height / 2, 2);
- drawpixel(p, p->width - x, p->height / 2, 2);
- drawpixel(p, p->width / 2, p->height - x, 2);
- drawpixel(p, p->width / 2, x, 2);
- drawpixel(p, p->width / 2 - 16 + x, p->height / 2, 2);
- drawpixel(p, p->width / 2, p->height / 2 - 16 + x, 2);
- }
-}
-
-void
putpixel(Ppu *p, Uint8 *layer, Uint16 x, Uint16 y, Uint8 color)
{
Uint16 row = (y % 8) + ((x / 8 + y / 8 * p->hor) * 16), col = 7 - (x % 8);
@@ -135,6 +105,25 @@ putchr(Ppu *p, Uint8 *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color)
}
void
+drawdebugger(Ppu *p, Uint8 *stack, Uint8 ptr)
+{
+ Uint8 i, x, y, b;
+ for(i = 0; i < 0x20; ++i) { /* memory */
+ x = ((i % 8) * 3 + 1) * 8, y = (i / 8 + 1) * 8, b = stack[i];
+ puticn(p, p->bg, x, y, font[(b >> 4) & 0xf], 2);
+ puticn(p, p->bg, x + 8, y, font[b & 0xf], 2);
+ }
+ for(x = 0; x < 0x20; ++x) {
+ drawpixel(p, x, p->height / 2, 2);
+ drawpixel(p, p->width - x, p->height / 2, 2);
+ drawpixel(p, p->width / 2, p->height - x, 2);
+ drawpixel(p, p->width / 2, x, 2);
+ drawpixel(p, p->width / 2 - 16 + x, p->height / 2, 2);
+ drawpixel(p, p->width / 2, p->height / 2 - 16 + x, 2);
+ }
+}
+
+void
getcolors(Ppu *p, Uint8 *addr)
{
int i;