1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-12-28 05:29:33 +00:00

nes: updated presets

This commit is contained in:
Steven Hugg 2019-03-06 15:54:37 -05:00
parent 788854166a
commit fb3b996d4a
5 changed files with 28 additions and 21 deletions

View File

@ -696,7 +696,7 @@ void init_stars() {
byte oamid = 0; // 32 slots = 128 bytes
byte i;
for (i=0; i<32; i++) {
oamid = oam_spr(rand(), i*8, 103+(i&3), 0, oamid);
oamid = oam_spr(rand(), i*8, 103+(i&3), 0|OAM_BEHIND, oamid);
}
}

View File

@ -5,17 +5,19 @@
// index to end of buffer
byte updptr = 0;
// add EOF marker to buffer
// add EOF marker to buffer (but don't increment pointer)
void cendbuf(void) {
updbuf[updptr] = NT_UPD_EOF;
}
// clear vram buffer and place EOF marker
void cclearbuf(void) {
updptr = 0;
cendbuf();
}
// flush buffer now, waiting for next frame
// wait for next frame, then clear buffer
// this assumes the NMI will call flush_vram_update()
void cflushnow(void) {
// make sure buffer has EOF marker
cendbuf();
@ -29,18 +31,18 @@ void cflushnow(void) {
// add multiple characters to update buffer
// using horizontal increment
void putbytes(word addr, const char* str, byte len) {
byte i;
// if bytes won't fit, wait for vsync and flush buffer
if (updptr >= VBUFSIZE-4-len) cflushnow();
// add vram address
updbuf[updptr] = (addr >> 8) ^ NT_UPD_HORZ;
updbuf[++updptr] = addr & 0xff;
VRAMBUF_ADD((addr >> 8) ^ NT_UPD_HORZ);
VRAMBUF_ADD(addr); // only lower 8 bits
// add length
updbuf[++updptr] = len;
// add bytes
while (len--) {
updbuf[++updptr] = *str++;
VRAMBUF_ADD(len);
// add data
for (i=0; i<len; ++i) {
VRAMBUF_ADD(str[i]);
}
++updptr;
// add EOF mark
// place EOF mark
cendbuf();
}

View File

@ -13,22 +13,27 @@
// index to end of buffer
extern byte updptr;
// macros
// macro to add a multibyte header
#define VRAMBUF_PUT(addr,len,flags)\
updbuf[updptr++] = ((addr) >> 8) | (flags);\
updbuf[updptr++] = (addr) & 0xff;\
updbuf[updptr++] = (len);
VRAMBUF_ADD(((addr) >> 8) | (flags));\
VRAMBUF_ADD(addr);\
VRAMBUF_ADD(len);
// macro to add a single byte to buffer
#define VRAMBUF_ADD(b)\
updbuf[updptr++] = (b);
__A__ = (b);\
asm("ldy %v", updptr);\
asm("sta $100,y");\
asm("inc %v", updptr);
// add EOF marker to buffer
// add EOF marker to buffer (but don't increment pointer)
void cendbuf(void);
// clear update buffer
// clear vram buffer and place EOF marker
void cclearbuf(void);
// flush buffer now, waiting for next frame
// wait for next frame, then clear buffer
// this assumes the NMI will call flush_vram_update()
void cflushnow(void);
// add multiple characters to update buffer

View File

@ -24,7 +24,7 @@ const JSNES_PRESETS = [
{id:'metatrigger.c', name:'Trigger Mode + Vbright'},
{id:'neslib5.c', name:'RLE Unpack'},
{id:'statusbar.c', name:'Split Status Bar'},
{id:'horizmask.c', name:'Horizontal Scrolling'},
{id:'horizmask.c', name:'Offscreen Scrolling'},
{id:'music.c', name:'Music Player'},
{id:'siegegame.c', name:'Siege Game'},
{id:'shoot2.c', name:'Solarian Game'},

2
tss

@ -1 +1 @@
Subproject commit 5b5ee67fc06956bc7dce51726e98812d2d897eaa
Subproject commit d630ddcb29d74a178cde043d74188fac35d6a21f