Skip to content

Conversation

EkkehardDomning
Copy link
Contributor

I updated the MOS6520.pas according to the *.c source. In my oppinion the cycles fields are missing in the IRQ/NMI/Push/Pop and MemRead and Write functions. This is not added now.
I implemented a much better timing behaviour in the thread, running with both PAL and NTSC firmware.
I implemented also an internal method to execute the IRQ by using the cycles counter and the value from the VIA timer register. This is more precise than using an external timer and allows the VIA register change by the user program.
Take a look if the might fit into the project.

To validate the timing you may use the following basic line. In command mode enter
?TI$
than hit enter and start a stop watch. The VIC-20 will print something like "000022" which says that the system is up and running for 00h, 00m and 22s
Enter the command again and wait until you stopwatch shows that one minute is gone.
The display should show "000122", telling that one minute is gone.

EkkehardDomning and others added 2 commits May 5, 2025 21:20
The thread will now sleep frequently if the 6502 emulation is faster than the original system. Two fields could be used to observe this. One is an average time between two interrupts (16.6ms = 1/60s) the other is the ratio between 6502 Emulation and PC time.
The timing of the via is read from the firmware, but the actual frequency (NTSC or PAL) has to be set manually.
Optional IRQ execution within the thread, by observing the VIA Timer register.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant