Mercurial > repos > simple16
diff src/cpu.h @ 25:fb14515266f4
Implemented timer and timer interrupts. Added get/setvbr instructions. Fixed assembler bug. Moved mnemonics into a separate source file
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 31 Mar 2016 23:25:52 -0700 |
parents | 5176efdda5ae |
children | 6e7bfe83d2b0 |
line wrap: on
line diff
--- a/src/cpu.h Thu Mar 31 00:07:37 2016 -0700 +++ b/src/cpu.h Thu Mar 31 23:25:52 2016 -0700 @@ -28,6 +28,7 @@ void *system; uint32_t cycles; uint32_t clock_inc; + uint32_t current_target; uint32_t num_mem_regions; uint16_t regs[16]; uint16_t exception; @@ -39,6 +40,7 @@ uint16_t prefetch; uint8_t state; + uint8_t pending_interrupts; port_handler port_handlers[16]; memory_region mem_regions[]; @@ -46,6 +48,11 @@ cpu* alloc_cpu(uint32_t clock_divider, uint32_t num_regions, memory_region *regions); void run_cpu(cpu *context, uint32_t target_cycle); +//To be implemented by system +uint32_t next_interrupt_cycle(cpu *context, uint8_t mask); +uint8_t get_current_interrupts(cpu *context); +void ack_interrupt(cpu *context, int which); + extern char * mnemonics[]; extern char * mnemonics_single_src[]; extern char * mnemonics_single_reg[]; @@ -99,7 +106,9 @@ GETEUR, SETEUR, GETENUM, - SETENUM + SETENUM, + GETVBR, + SETVBR }; enum {