Microscopic optimizations

This commit is contained in:
neauoire 2021-04-10 09:32:14 -07:00
parent f14f8a64f4
commit 05d9405e7a
2 changed files with 3 additions and 2 deletions

View File

@ -214,8 +214,8 @@ screen_poke(Uxn *u, Uint16 ptr, Uint8 b0, Uint8 b1)
Uint16 x = mempeek16(u, ptr + 8);
Uint16 y = mempeek16(u, ptr + 10);
Uint8 *addr = &u->ram.dat[mempeek16(u, ptr + 12)];
Uint8 *layer = (b1 >> 4 & 0xf) % 2 ? ppu.fg : ppu.bg;
switch((b1 >> 4) / 2) {
Uint8 *layer = b1 >> 4 & 0x1 ? ppu.fg : ppu.bg;
switch(b1 >> 5) {
case 0: putpixel(&ppu, layer, x, y, b1 & 0x3); break;
case 1: puticn(&ppu, layer, x, y, addr, b1 & 0xf); break;
case 2: putchr(&ppu, layer, x, y, addr, b1 & 0xf); break;

View File

@ -3,6 +3,7 @@
/*
Copyright (c) 2021 Devine Lu Linvega
Copyright (c) 2021 Andrew Alderwick
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above