You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function used (tcc_udiv) does not like having the direct page register being not zero, as one of its instructions uses absolute addressing and not the direct page addressing that the other instructions use.
The following is a small example based on the hello world example showing this. The value displayed should always be 0, 10 or 20 (remember, %x displays a number in hexadecimal), but it displays 70 instead.
There's a small hack with swapping out NMI routines since I don't know how to make new text display when using a custom NMI routine, if you can tell me how to do it I would appreciate it.
/*--------------------------------------------------------------------------------- Simple console 'hello world' demo -- alekmaul---------------------------------------------------------------------------------*/#include<snes.h>externchartilfont, palfont;
void (*oldnmi)(void);
u16tileid;
//---------------------------------------------------------------------------------voidupdateRowBuffer(void) {
u16temp=4;
/*This should never be greater than 0x20*/u16tile= ( temp % 3 ) *16;
tileid=tile;
}
intmain(void)
{
// Initialize text console with our fontconsoleSetTextVramBGAdr(0x6800);
consoleSetTextVramAdr(0x3000);
consoleSetTextOffset(0x0100);
consoleInitText(0, 16*2, &tilfont, &palfont);
// Init backgroundbgSetGfxPtr(0, 0x2000);
bgSetMapPtr(0, 0x6800, SC_32x32);
// Now Put in 16 color mode and disable Bgs except currentsetMode(BG_MODE1, 0);
bgSetDisable(1);
bgSetDisable(2);
// Draw a wonderful text :PconsoleDrawText(10, 10, "Hello World !");
consoleDrawText(6, 14, "WELCOME TO PVSNESLIB");
consoleDrawText(3, 18, "HTTPS://WWW.PORTABLEDEV.COM");
oldnmi=nmi_handler;
nmiSet(updateRowBuffer);
WaitForVBlank();
WaitForVBlank();
consoleDrawText(5, 6, "%x", tileid);
nmiSet(oldnmi);
// Wait for nothing :PsetScreenOn();
while (1)
{
WaitForVBlank();
}
return0;
}
The text was updated successfully, but these errors were encountered:
The function used (tcc_udiv) does not like having the direct page register being not zero, as one of its instructions uses absolute addressing and not the direct page addressing that the other instructions use.
The following is a small example based on the hello world example showing this. The value displayed should always be 0, 10 or 20 (remember,
%x
displays a number in hexadecimal), but it displays 70 instead.There's a small hack with swapping out NMI routines since I don't know how to make new text display when using a custom NMI routine, if you can tell me how to do it I would appreciate it.
The text was updated successfully, but these errors were encountered: