Hi, I'm trying to hook my func() to the NMI interrupt. I know I can detect vertical blanks in other ways, but I'd like to know if I can do it this way.
Does someone know if this is possible in c? Am I doing something wrong?
I wrote this code, but counter doesn't ever get incremented. The commented line was my attempt to do it in pure c but it didn't work either.
(only significant code is pasted here)
Thanks!
Does someone know if this is possible in c? Am I doing something wrong?
I wrote this code, but counter doesn't ever get incremented. The commented line was my attempt to do it in pure c but it didn't work either.
(only significant code is pasted here)
Code:
unsigned char counter;
void func()
{ ++counter; }
void main()
{
counter = 0;
// *( (unsigned char*) 0xFFFA ) = (unsigned char*) func;
asm( "lda %v", func );
asm( "sta $FFFA" );
}
void func()
{ ++counter; }
void main()
{
counter = 0;
// *( (unsigned char*) 0xFFFA ) = (unsigned char*) func;
asm( "lda %v", func );
asm( "sta $FFFA" );
}
Thanks!