after implementing the 3DCube Demo from https://retro64.altervista.org/blog/an- ... d-objects/ i think about a frames per second counter to know how many frames the routine is working.
My routine look like this:
Code: Select all
SEI ; new Interrupt-Service-Routine @ IRQ
LDA #<IRQ
STA $0314
LDA #>IRQ
STA $0315
LDA #$3C ; store 60 to cycle counter to CC
STA CC
LDA #$00 ; set FPS to zero for initial
STA FPS
CLI
;RTS
MainLoop:
INC FPS
3D-Cube calculation
Drawing
...
JMP MainLoop
IRQ:
DEC CC ; decrement cycle counter
BNE Back ; no, then back to program
LDA #$3C ; reset cycle counter to 60
STA CC ;
LDA FPS ; load FPS value
STA $1280 ; show FPS to screen/bitmap
LDA #$00 ; reset FPS value to zero
sta FPS
lda #%10101010 ; just to show and count the bit pattern
sta $1281
lda #%01010101
sta $1282
Back:
JMP $EABF
The bit-pattern in the first line shows 00010001. That is decimal 17.
The second and third bit-pattern is only for counting the bits in the first line.
My question is, is this interrupt routine correct?
Can the jump to the $EABF routine be implemented differently?
Where is the return of routine $EABF stored?
Thanks a lot for your help.
Best regards,
Sven