function int_nmi_func() { ldx #1 stx inVBlank ...Other code }
inline int_waitVbl() { vid_getPPU_CTRL_1() and #CR_NMI if(true) { do { lda inVBlank } while(zero) lda #0 sta inVBlank } else { vblank_wait() //Call our nmi routine because interrupts are not set int_nmi_func() unvblank_wait() } }
inline vblank_wait() { do lda PPU.STATUS while(is plus) }
inline unvblank_wait() { do lda PPU.STATUS while(is minus) }
- Well, the forbidden RAM location bothers me. Actually, I use 4018-403F as free space and put my NSF code there. I use C for the sync code; with NMI, I can take it out and use pure ASM.