For the next generation of my home-brew-6502-based-castle-runner computer I decided I need interrupts for screen updates. This came up after upping the frequency of the computer. Running the thing on 8MHz caused the screen updates to go too fast and not very smooth.

So, the next update will be a 10Hz refresh pulse (probably coming from a simple 555 circuit) on the IRQ of the CPU, and then on that IRQ the entire screen will be refreshed from some (to be defined) video RAM page.

For now, the code is in the be able to provide an IRQ routine in the assembly, by simply providing a label as HW_IRW:

LDA #$01
STA $80
LDA #$05
STA $81
JSR :DisplayGotoXY
STA $80
STA $81
JSR :DisplayString

The assembler will then put the address where that label points to as the second vector in the HEX file (after the RESB vector) and the programmer will send it in the header. The hardware programmer will read the vector from the header and write it at address 0x7ffe.

Code can be found here:

Categories: Geekstuff


Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.