mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2025-02-18 00:30:43 +00:00
nes: updated presets
This commit is contained in:
parent
788854166a
commit
fb3b996d4a
@ -696,7 +696,7 @@ void init_stars() {
|
|||||||
byte oamid = 0; // 32 slots = 128 bytes
|
byte oamid = 0; // 32 slots = 128 bytes
|
||||||
byte i;
|
byte i;
|
||||||
for (i=0; i<32; 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,17 +5,19 @@
|
|||||||
// index to end of buffer
|
// index to end of buffer
|
||||||
byte updptr = 0;
|
byte updptr = 0;
|
||||||
|
|
||||||
// add EOF marker to buffer
|
// add EOF marker to buffer (but don't increment pointer)
|
||||||
void cendbuf(void) {
|
void cendbuf(void) {
|
||||||
updbuf[updptr] = NT_UPD_EOF;
|
updbuf[updptr] = NT_UPD_EOF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clear vram buffer and place EOF marker
|
||||||
void cclearbuf(void) {
|
void cclearbuf(void) {
|
||||||
updptr = 0;
|
updptr = 0;
|
||||||
cendbuf();
|
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) {
|
void cflushnow(void) {
|
||||||
// make sure buffer has EOF marker
|
// make sure buffer has EOF marker
|
||||||
cendbuf();
|
cendbuf();
|
||||||
@ -29,18 +31,18 @@ void cflushnow(void) {
|
|||||||
// add multiple characters to update buffer
|
// add multiple characters to update buffer
|
||||||
// using horizontal increment
|
// using horizontal increment
|
||||||
void putbytes(word addr, const char* str, byte len) {
|
void putbytes(word addr, const char* str, byte len) {
|
||||||
|
byte i;
|
||||||
// if bytes won't fit, wait for vsync and flush buffer
|
// if bytes won't fit, wait for vsync and flush buffer
|
||||||
if (updptr >= VBUFSIZE-4-len) cflushnow();
|
if (updptr >= VBUFSIZE-4-len) cflushnow();
|
||||||
// add vram address
|
// add vram address
|
||||||
updbuf[updptr] = (addr >> 8) ^ NT_UPD_HORZ;
|
VRAMBUF_ADD((addr >> 8) ^ NT_UPD_HORZ);
|
||||||
updbuf[++updptr] = addr & 0xff;
|
VRAMBUF_ADD(addr); // only lower 8 bits
|
||||||
// add length
|
// add length
|
||||||
updbuf[++updptr] = len;
|
VRAMBUF_ADD(len);
|
||||||
// add bytes
|
// add data
|
||||||
while (len--) {
|
for (i=0; i<len; ++i) {
|
||||||
updbuf[++updptr] = *str++;
|
VRAMBUF_ADD(str[i]);
|
||||||
}
|
}
|
||||||
++updptr;
|
// place EOF mark
|
||||||
// add EOF mark
|
|
||||||
cendbuf();
|
cendbuf();
|
||||||
}
|
}
|
||||||
|
@ -13,22 +13,27 @@
|
|||||||
// index to end of buffer
|
// index to end of buffer
|
||||||
extern byte updptr;
|
extern byte updptr;
|
||||||
|
|
||||||
// macros
|
// macro to add a multibyte header
|
||||||
#define VRAMBUF_PUT(addr,len,flags)\
|
#define VRAMBUF_PUT(addr,len,flags)\
|
||||||
updbuf[updptr++] = ((addr) >> 8) | (flags);\
|
VRAMBUF_ADD(((addr) >> 8) | (flags));\
|
||||||
updbuf[updptr++] = (addr) & 0xff;\
|
VRAMBUF_ADD(addr);\
|
||||||
updbuf[updptr++] = (len);
|
VRAMBUF_ADD(len);
|
||||||
|
|
||||||
|
// macro to add a single byte to buffer
|
||||||
#define VRAMBUF_ADD(b)\
|
#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);
|
void cendbuf(void);
|
||||||
|
|
||||||
// clear update buffer
|
// clear vram buffer and place EOF marker
|
||||||
void cclearbuf(void);
|
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);
|
void cflushnow(void);
|
||||||
|
|
||||||
// add multiple characters to update buffer
|
// add multiple characters to update buffer
|
||||||
|
@ -24,7 +24,7 @@ const JSNES_PRESETS = [
|
|||||||
{id:'metatrigger.c', name:'Trigger Mode + Vbright'},
|
{id:'metatrigger.c', name:'Trigger Mode + Vbright'},
|
||||||
{id:'neslib5.c', name:'RLE Unpack'},
|
{id:'neslib5.c', name:'RLE Unpack'},
|
||||||
{id:'statusbar.c', name:'Split Status Bar'},
|
{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:'music.c', name:'Music Player'},
|
||||||
{id:'siegegame.c', name:'Siege Game'},
|
{id:'siegegame.c', name:'Siege Game'},
|
||||||
{id:'shoot2.c', name:'Solarian Game'},
|
{id:'shoot2.c', name:'Solarian Game'},
|
||||||
|
2
tss
2
tss
@ -1 +1 @@
|
|||||||
Subproject commit 5b5ee67fc06956bc7dce51726e98812d2d897eaa
|
Subproject commit d630ddcb29d74a178cde043d74188fac35d6a21f
|
Loading…
x
Reference in New Issue
Block a user