eris2010

Documentation: http://frombelow.net/projects/eris2010/
Clone: git clone https://git.frombelow.net/eris2010.git
Log | Files | Refs | README | LICENSE

os.h (1310B)


      1 #ifndef OS_H
      2 #define OS_H
      3 
      4 /* For detecting memory leaks. */
      5 void __fastcall__ get_stack_pointers(unsigned char *hw_sp, unsigned *eris_sp,
      6 				     unsigned *cc65_sp);
      7 
      8 /* Access to resources */
      9 
     10 #define IRQ_ISR = 0x7ffe
     11 
     12 #ifdef SYMON
     13   #define ACIA_BASE = 0x8800
     14 #else
     15   #define ACIA_BASE = 0xc000
     16 #endif
     17 #define ACIA_DATA_REG ACIA_BASE
     18 #define ACIA_STATUS_REG (ACIA_BASE+0x1)
     19 #define ACIA_CMD_REG (ACIA_BASE+0x2)
     20 #define ACIA_CTRL_REG (ACIA_BASE+0x3)
     21 
     22 #ifdef SYMON
     23   #define VIA_BASE 0x8000
     24 #else
     25   #define VIA_BASE 0xc800
     26 #endif
     27 #define VIA_RB VIA_BASE
     28 #define VIA_RA (VIA_BASE+0x1)
     29 #define VIA_DDRB (VIA_BASE+0x2)
     30 #define VIA_DDRA (VIA_BASE+0x3)
     31 #define VIA_T1CL (VIA_BASE+0x4)
     32 #define VIA_T1CH (VIA_BASE+0x5)
     33 #define VIA_T1LL (VIA_BASE+0x6)
     34 #define VIA_T1LH (VIA_BASE+0x7)
     35 #define VIA_T2CL (VIA_BASE+0x8)
     36 #define VIA_T2CH (VIA_BASE+0x9)
     37 #define VIA_SR (VIA_BASE+0xA)
     38 #define VIA_ACR (VIA_BASE+0xB)
     39 #define VIA_PCR (VIA_BASE+0xC)
     40 #define VIA_IFR (VIA_BASE+0xD)
     41 #define VIA_IER (VIA_BASE+0xE)
     42 #define VIA_RA2 (VIA_BASE+0xF)
     43 
     44 // https://github.com/cc65/wiki/wiki/PEEK-and-POKE
     45 #define POKE(addr,val)     (*(unsigned char*) (addr) = (val))
     46 #define POKEW(addr,val)    (*(unsigned*) (addr) = (val))
     47 #define PEEK(addr)         (*(unsigned char*) (addr))
     48 #define PEEKW(addr)        (*(unsigned*) (addr))
     49 
     50 #endif
     51