mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-12-25 11:32:07 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
00e8822ff5
@ -200,6 +200,7 @@ void lnListTransfer() {
|
|||||||
char* ppuAddr = (char*)(uword){ addrHi&0x3f, addrLo };
|
char* ppuAddr = (char*)(uword){ addrHi&0x3f, addrLo };
|
||||||
char size = vram_update_list[idx++];
|
char size = vram_update_list[idx++];
|
||||||
ppuDataTransfer(ppuAddr, vram_update_list+idx, size);
|
ppuDataTransfer(ppuAddr, vram_update_list+idx, size);
|
||||||
|
idx += size;
|
||||||
} else if(addrHi&lfVer) {
|
} else if(addrHi&lfVer) {
|
||||||
// The write is vertical
|
// The write is vertical
|
||||||
char addrLo = vram_update_list[idx++];
|
char addrLo = vram_update_list[idx++];
|
||||||
@ -211,6 +212,7 @@ void lnListTransfer() {
|
|||||||
ppuDataTransfer(ppuAddr, vram_update_list+idx, size);
|
ppuDataTransfer(ppuAddr, vram_update_list+idx, size);
|
||||||
// restore PPUCTRL
|
// restore PPUCTRL
|
||||||
PPU->PPUCTRL = ppuCtrl;
|
PPU->PPUCTRL = ppuCtrl;
|
||||||
|
idx += size;
|
||||||
} else {
|
} else {
|
||||||
// The write is single-byte
|
// The write is single-byte
|
||||||
char addrLo = vram_update_list[idx++];
|
char addrLo = vram_update_list[idx++];
|
||||||
|
@ -9,14 +9,14 @@
|
|||||||
#pragma target(nes)
|
#pragma target(nes)
|
||||||
#include "lazynes.h"
|
#include "lazynes.h"
|
||||||
|
|
||||||
// A string in ROM
|
|
||||||
#pragma data_seg(Data)
|
|
||||||
ubyte b_init[]={0,0,10,'B','U','B','B','L','E','S',':',0,0,lfEnd};
|
|
||||||
|
|
||||||
// A string in RAM
|
// A string in RAM
|
||||||
#pragma data_seg(GameRam)
|
#pragma data_seg(GameRam)
|
||||||
ubyte b[14];
|
ubyte b[14];
|
||||||
|
|
||||||
|
// A string in ROM
|
||||||
|
#pragma data_seg(Data)
|
||||||
|
ubyte b_init[]={0,0,10,'B','U','B','B','L','E','S',':',0,0,lfEnd};
|
||||||
|
|
||||||
// print some text in the static area using lnList
|
// print some text in the static area using lnList
|
||||||
void Print(uword offset, ubyte value) {
|
void Print(uword offset, ubyte value) {
|
||||||
b[0]=(ubyte)(offset>>8)|lfHor; b[1]=(ubyte)offset; b[11]=b[12]='0';
|
b[0]=(ubyte)(offset>>8)|lfHor; b[1]=(ubyte)offset; b[11]=b[12]='0';
|
||||||
@ -26,14 +26,16 @@ void Print(uword offset, ubyte value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int lnMain() {
|
int lnMain() {
|
||||||
// Copy string from ROM to RAM
|
|
||||||
for(char i=0;i<sizeof(b_init);i++)
|
|
||||||
b[i] = b_init[i];
|
|
||||||
static const ubyte bgColors[]={45,33,2};
|
static const ubyte bgColors[]={45,33,2};
|
||||||
ubyte objects=0;
|
ubyte objects=17;
|
||||||
uword tics=0;
|
uword tics=0;
|
||||||
lnSync(lfBlank); // blank screen to enable lnPush() usage
|
lnSync(lfBlank); // blank screen to enable lnPush() usage
|
||||||
lnPush(lnBackCol,3,bgColors); // set background colors
|
lnPush(lnBackCol,3,bgColors); // set background colors
|
||||||
|
|
||||||
|
// Copy string from ROM to RAM
|
||||||
|
for(char i=0;i<sizeof(b_init);i++)
|
||||||
|
b[i] = b_init[i];
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
// update the number to display
|
// update the number to display
|
||||||
tics+=1;
|
tics+=1;
|
||||||
|
Loading…
Reference in New Issue
Block a user