Hello All,
This is my first post @ nesdev. I'm building my first emulator,and have finished the 6502 CPU core & a very basic sprite renderer. Below is the flow I'm taking:
1. Start:
2. Run the CPU
3. Check if total no. of cycles exceed 341 if yes goto 4, else back to 2
4. Render one scanline by the ppu
5. Adjust any excess cycles the cpu has rendered by adding excess cycles to step 3.
6. Go back to 2 if 262 scanlines haven't been rendered
6. Once all 262 scanlines have been rendered complete the frame.
7. render the frame
8. Stop
Loop the above 60 times a second
But I see the sprite animations that are happening are roughly at half the actual rate.
I counted the no. of avg CPU cycles I'm doing per frame and its coming as 29870 which I think is close to the actual NES.
Can anyone suggest what wrong I could be doing?
Thanks,
Babai
This is my first post @ nesdev. I'm building my first emulator,and have finished the 6502 CPU core & a very basic sprite renderer. Below is the flow I'm taking:
1. Start:
2. Run the CPU
3. Check if total no. of cycles exceed 341 if yes goto 4, else back to 2
4. Render one scanline by the ppu
5. Adjust any excess cycles the cpu has rendered by adding excess cycles to step 3.
6. Go back to 2 if 262 scanlines haven't been rendered
6. Once all 262 scanlines have been rendered complete the frame.
7. render the frame
8. Stop
Loop the above 60 times a second
But I see the sprite animations that are happening are roughly at half the actual rate.
I counted the no. of avg CPU cycles I'm doing per frame and its coming as 29870 which I think is close to the actual NES.
Can anyone suggest what wrong I could be doing?
Thanks,
Babai