Work on interrupts

This commit is contained in:
Kyle Cardoza 2024-03-30 14:37:25 -04:00
parent 15d9c568dc
commit aa35098cdd
2 changed files with 21 additions and 9 deletions

View File

@ -70,6 +70,12 @@ cop_handler_native:
; right handler for the particular function being called, without
; modifying anything but the X register.
; Note that if a COP function takes a single 8/16-bit argument, it will be
; in A; if it takes two 8/16-bit arguments, they will be in A and Y.
; If the function takes more arguments, then the arguments will be packed
; into a structure, with the bank of the structure in A, and the
; address in that bank of the structure in Y.
; Now, we do an indirect, indexed jump through the jump table.
jmp (.kbank(cop_jump_table),x)
@ -86,14 +92,10 @@ cop_exit:
; -----------------------------------------------------------------------------
.extern version_major, version_minor, version_micro
.extern version_number
cop_get_version:
lda long:version_micro
tay
lda long:version_minor
tax
lda long:version_major
lda long:version_number
cop_rti
; -----------------------------------------------------------------------------

View File

@ -11,9 +11,19 @@
#include "interrupts.h"
#include "drivers/vera.h"
const uint16_t version_major = 0;
const uint16_t version_minor = 1;
const uint16_t version_micro = 1;
// This structure essentially divides a uint16_t into four
// fields, each of which holds a version number.
struct version_number_s {
const uint8_t version_micro: 8;
const uint8_t version_minor: 4;
const uint8_t version_major: 4;
};
struct version_number_s version_number = {
.version_major = 0,
.version_minor = 0,
.version_micro = 1,
};
void
main(void)