Added a crude IRQ and NMI override vector.

This commit is contained in:
Peter Weingartner 2024-08-28 19:39:21 -04:00
parent 6e76c28d41
commit 8a3d413af8
23 changed files with 916 additions and 869 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View file

@ -259,6 +259,14 @@ const char * boot_source_name(enum boot_src_e device) {
}
static void boot_reset_screen() {
// Reset the region
t_rect boot_text_window;
boot_text_window.origin.x = 0;
boot_text_window.origin.y = 0;
boot_text_window.size.width = 0;
boot_text_window.size.height = 0;
txt_set_region(0, &boot_text_window);
// txt_set_mode(0, TXT_MODE_TEXT | TXT_MODE_SPRITE);
*tvky_mstr_ctrl = (uint16_t)(VKY_MCR_TEXT);
@ -278,6 +286,7 @@ static void boot_reset_screen() {
// Clear the text screen
txt_clear(0, 2);
txt_set_xy(0, 0, 0);
}
void boot_from(enum boot_src_e device, boot_record_p boot_record) {

View file

@ -93,6 +93,9 @@ p_int_handler int_handle_25;
p_int_handler int_handle_26;
p_int_handler int_handle_27;
uint32_t * irq_ram_vector = (uint32_t *)0x00fdec;
uint32_t * nmi_ram_vector = (uint32_t *)0x00fdf4;
/**
* @brief Mapping of FoenixMCP interrupt numbers to F256 GABE group numbers (0xff indicates an unassigned interrupt number)
*
@ -134,6 +137,10 @@ void int_init() {
int i;
p_int_handler * int_handlers = &int_handle_00;
// Zero out the interrupt ram vectors
*irq_ram_vector = 0;
*nmi_ram_vector = 0;
// Clear all the interrupt handlers
for (i = 0; i < 4 * 8; i++) {
int_handlers[i] = 0;
@ -475,6 +482,12 @@ SYSTEMCALL void int_clear(unsigned short n) {
void int_handle_irq() {
uint8_t mask_bits = 0;
if (*irq_ram_vector != 0) {
p_int_handler handler = (p_int_handler)(*irq_ram_vector);
handler();
return;
}
// Process any pending interrupts in group 0
mask_bits = *PENDING_GRP0;
if (mask_bits) {
@ -531,4 +544,9 @@ void int_handle_irq() {
* __attribute__((interrupt(0xffea)))
*/
void int_handle_nmi() {
if (*nmi_ram_vector != 0) {
p_int_handler handler = (p_int_handler)(*nmi_ram_vector);
handler();
return;
}
}

View file

@ -66,7 +66,7 @@ void tile_init() {
void tile_map_assign(uint8_t map, uint16_t * address, uint8_t width, uint8_t height, uint8_t size) {
if (map <= VKY_TILEMAP_MAX) {
uint16_t * tile_map_ram = (uint8_t *)tile_map_memory_base;
uint16_t * tile_map_ram = (uint16_t *)tile_map_memory_base;
for (int i = 0; i < width*height; i++) {
tile_map_ram[i] = address[i];
}

View file

@ -7,6 +7,6 @@
#define VER_MAJOR 1
#define VER_MINOR 0
#define VER_BUILD 4
#define VER_BUILD 9
#endif