Hey All
I attempted nes programming about a year ago with very basic programming skills.
I successfully got my name on the screen and could move it around with the controller.
But it took me days and a bucket of frustration.
Now after a year of learning C# at school, i'm really eager to try it again.
I read you can program nes game using C at the cost of speed. (i'm fine with that. I'm not going to program anything fancy)
What do you guys think of using C?
Is it a good start or should i just go back and use assembly?
so far i used this tutorial to get me started with using c http://www.dreamincode.net/forums/topic/152401-nes-game-programming-part-1/
and this my code:
now for my question: How do i select a background color?
I know i put blue on 3f00 witch means that even if background rendering is switched off it will show blue. Right?
But how do i tell the nes to make it's background red(f302).
Thanks!
I attempted nes programming about a year ago with very basic programming skills.
I successfully got my name on the screen and could move it around with the controller.
But it took me days and a bucket of frustration.
Now after a year of learning C# at school, i'm really eager to try it again.
I read you can program nes game using C at the cost of speed. (i'm fine with that. I'm not going to program anything fancy)
What do you guys think of using C?
Is it a good start or should i just go back and use assembly?
so far i used this tutorial to get me started with using c http://www.dreamincode.net/forums/topic/152401-nes-game-programming-part-1/
and this my code:
Code:
#include <nes.h>
void write_string (char *teken)
{
*((unsigned char*)0x2006) = 0x20;
*((unsigned char*)0x2006) = 0x41; //put the "hallo nes" characters in name table 0
while (*teken)
{
*((unsigned char*)0x2007) = *teken;
teken++;
}
*((unsigned char*)0x2006) = 0x20;
*((unsigned char*)0x2006) = 0x4f; //puts a 2 after "hallo nes", Just expirimenting here.
*((unsigned char*)0x2007) = 0x32;
}
int main()
{
waitvblank();
*((unsigned char*)0x2006) = 0x3F;
*((unsigned char*)0x2006) = 0x03; //white on 3f03
*((unsigned char*)0x2007) = 0x30;
*((unsigned char*)0x2006) = 0x3F;
*((unsigned char*)0x2006) = 0x00; // blue on 3f00
*((unsigned char*)0x2007) = 0x12;
*((unsigned char*)0x2006) = 0x3F;
*((unsigned char*)0x2006) = 0x02; // red on 3f02
*((unsigned char*)0x2007) = 0x16;
write_string("hallo nes!");
*((unsigned char*)0x2005) = 0x00;
*((unsigned char*)0x2005) = 0x00;
*((unsigned char*)0x2001) = 0x08;
while(1);
return 0;
}
void write_string (char *teken)
{
*((unsigned char*)0x2006) = 0x20;
*((unsigned char*)0x2006) = 0x41; //put the "hallo nes" characters in name table 0
while (*teken)
{
*((unsigned char*)0x2007) = *teken;
teken++;
}
*((unsigned char*)0x2006) = 0x20;
*((unsigned char*)0x2006) = 0x4f; //puts a 2 after "hallo nes", Just expirimenting here.
*((unsigned char*)0x2007) = 0x32;
}
int main()
{
waitvblank();
*((unsigned char*)0x2006) = 0x3F;
*((unsigned char*)0x2006) = 0x03; //white on 3f03
*((unsigned char*)0x2007) = 0x30;
*((unsigned char*)0x2006) = 0x3F;
*((unsigned char*)0x2006) = 0x00; // blue on 3f00
*((unsigned char*)0x2007) = 0x12;
*((unsigned char*)0x2006) = 0x3F;
*((unsigned char*)0x2006) = 0x02; // red on 3f02
*((unsigned char*)0x2007) = 0x16;
write_string("hallo nes!");
*((unsigned char*)0x2005) = 0x00;
*((unsigned char*)0x2005) = 0x00;
*((unsigned char*)0x2001) = 0x08;
while(1);
return 0;
}
now for my question: How do i select a background color?
I know i put blue on 3f00 witch means that even if background rendering is switched off it will show blue. Right?
But how do i tell the nes to make it's background red(f302).
Thanks!