IRQ work in BIOS

This commit is contained in:
Kyle J Cardoza 2024-07-07 20:50:53 -04:00
parent e562ef8dab
commit 3e888ffa65
9 changed files with 357 additions and 39 deletions

View File

@ -23,9 +23,7 @@
long_i \
pha \
phx \
phy \
short_a \
long_i
phy
#define restore_registers \
long_a \
@ -33,6 +31,4 @@
ply \
plx \
pla \
plp \
short_a \
long_i
plp

View File

@ -16,7 +16,7 @@
.extern _NearBaseAddress
#endif
#include "bios/macros.h"
#include "macros.h"
;;; ***************************************************************************
;;;

View File

@ -5,3 +5,129 @@
//
// Copyright © 2024 Kyle J Cardoza <Kyle.Cardoza@icloud.com>
#include <stdint.h>
// Return values from handlers, if any, should be stored in
// DP[0] for the C register, DP[4] for the X register, and
// DP[6] for the Y register.
extern uint16_t Dp[4];
void irq_handler(void) {
return;
}
void brk_irq_handler(void) {
return;
}
void abort_irq_handler(void) {
return;
}
void nmi_handler(void) {
return;
}
void timer0_irq_handler(void) {
return;
}
void timer1_irq_handler(void) {
return;
}
void timer2_irq_handler(void) {
return;
}
void timer3_irq_handler(void) {
return;
}
void timer4_irq_handler(void) {
return;
}
void timer5_irq_handler(void) {
return;
}
void timer6_irq_handler(void) {
return;
}
void timer7_irq_handler(void) {
return;
}
void pe56_irq_handler(void) {
return;
}
void ne57_irq_handler(void) {
return;
}
void pe60_irq_handler(void) {
return;
}
void pe62_irq_handler(void) {
return;
}
void ne64_irq_handler(void) {
return;
}
void ne66_irq_handler(void) {
return;
}
void pib_irq_handler(void) {
return;
}
void level_irq_handler(void) {
return;
}
void uart_0_rx_irq_handler(void) {
return;
}
void uart_0_tx_irq_handler(void) {
return;
}
void uart_1_rx_irq_handler(void) {
return;
}
void uart_1_tx_irq_handler(void) {
return;
}
void uart_2_rx_irq_handler(void) {
return;
}
void uart_2_tx_irq_handler(void) {
return;
}
void uart_3_rx_irq_handler(void) {
return;
}
void uart_3_tx_irq_handler(void) {
return;
}
void cop_handler(uint16_t arg_c, uint16_t arg_x, uint16_t arg_y) {
(void) arg_c;
(void) arg_x;
(void) arg_y;
return;
}

View File

@ -10,95 +10,291 @@
//;
//; Copyright © 2024 Kyle J Cardoza <Kyle.Cardoza@icloud.com>
#include "macros.h"
#include "sentinel65x.h"
.extern _Dp
.extern irq_handler
; This section gets copied to 0x00F000
.section irq_trampolines
reserved_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
timer0_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
timer1_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
timer2_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
timer3_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
timer4_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
timer5_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
timer6_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
timer7_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
pe56_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
ne57_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
pe60_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
pe62_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
ne64_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
ne66_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
pib_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
level_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
call long:irq_handler
jump interrupt_return
uart_0_rx_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
uart_0_tx_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
uart_1_rx_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
uart_1_tx_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
uart_2_rx_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
uart_2_tx_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
uart_3_rx_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
uart_3_tx_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
cop_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
brk_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
abort_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
jump interrupt_return
nmi_irq:
rti
phb
phd
rep #0b00110000
pha
phx
phy
.extern nmi_handler
long_a
call long:nmi_handler
jump interrupt_return
interrupt_return:
rep #0b00110000
ply
plx
pla
pld
plb
jump interrupt_return
; This section gets copied to 0x00FF80
.section irq_vectors

View File

@ -5,7 +5,7 @@
//;
//; Copyright © 2024 Kyle J Cardoza <Kyle.Cardoza@icloud.com>
#include "boot/sentinel65x.h"
#include "sentinel65x.h"
.section code, noreorder
.pubweak __program_root_section