Rewritten the irq handler

This commit is contained in:
hkz 2025-10-14 08:39:41 +02:00
commit 46f3662322
7 changed files with 87 additions and 37 deletions

View file

@ -39,8 +39,6 @@ static state_page_data* state_page = (state_page_data*)STATE_PAGE;
static shared_page_data *shared_page = (shared_page_data*)SHARED_PAGE;
static uint8_t text_buf[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
__attribute__((interrupt)) void irq_handler(void);
void main(void) {
uint16_t moves_count = 0;
uint16_t score = 0;
@ -61,7 +59,7 @@ void main(void) {
vdp_switch_nt(0); // Make sure VDP shows the gamegrid
// Setup the IRQ handler
POKEW(IRQ_HANDLER_ADDRESS, (uint16_t)irq_handler);
POKEW(IRQ_HANDLER_ADDRESS, (uint16_t)vdp_irq_handler);
// Reset the game, calculate the initial score depending on which tiles we randomly get
score = reset_game();
@ -193,8 +191,3 @@ void main(void) {
return;
}
__attribute__((interrupt)) void irq_handler(void) {
vdp_write_interleaved_sat();
}