1 2 // automatically generated by m4 from headers in proto subdir 3 4 5 #if __Z80 || __Z80N 6 7 #ifndef __Z80_H__ 8 #define __Z80_H__ 9 10 #include <stdint.h> 11 #include <im2.h> 12 13 extern void __LIB__ z80_delay_ms(uint16_t ms) __smallc __z88dk_fastcall; 14 15 16 extern void __LIB__ z80_delay_tstate(uint16_t tstates) __smallc __z88dk_fastcall; 17 18 19 extern uint8_t __LIB__ z80_get_int_state(void) __smallc; 20 21 22 extern void __LIB__ z80_set_int_state(uint8_t state) __smallc __z88dk_fastcall; 23 24 25 26 extern uint8_t __LIB__ z80_inp(uint16_t port) __smallc __z88dk_fastcall; 27 28 29 extern void __LIB__ *z80_inir(void *dst,uint8_t port,uint8_t num) __smallc; 30 extern void __LIB__ *z80_inir_callee(void *dst,uint8_t port,uint8_t num) __smallc __z88dk_callee; 31 #define z80_inir(a,b,c) z80_inir_callee(a,b,c) 32 33 34 extern void __LIB__ *z80_indr(void *dst,uint8_t port,uint8_t num) __smallc; 35 extern void __LIB__ *z80_indr_callee(void *dst,uint8_t port,uint8_t num) __smallc __z88dk_callee; 36 #define z80_indr(a,b,c) z80_indr_callee(a,b,c) 37 38 39 extern void __LIB__ z80_outp(uint16_t port,uint8_t data) __smallc; 40 extern void __LIB__ z80_outp_callee(uint16_t port,uint8_t data) __smallc __z88dk_callee; 41 #define z80_outp(a,b) z80_outp_callee(a,b) 42 43 44 extern void __LIB__ *z80_otir(void *src,uint8_t port,uint8_t num) __smallc; 45 extern void __LIB__ *z80_otir_callee(void *src,uint8_t port,uint8_t num) __smallc __z88dk_callee; 46 #define z80_otir(a,b,c) z80_otir_callee(a,b,c) 47 48 49 extern void __LIB__ *z80_otdr(void *src,uint8_t port,uint8_t num) __smallc; 50 extern void __LIB__ *z80_otdr_callee(void *src,uint8_t port,uint8_t num) __smallc __z88dk_callee; 51 #define z80_otdr(a,b,c) z80_otdr_callee(a,b,c) 52 53 54 55 #define z80_bpoke(a,b) (*(unsigned char *)(a) = b) 56 #define z80_wpoke(a,b) (*(unsigned int *)(a) = b) 57 #define z80_lpoke(a,b) (*(unsigned long *)(a) = b) 58 59 #define z80_bpeek(a) (*(unsigned char *)(a)) 60 #define z80_wpeek(a) (*(unsigned int *)(a)) 61 #define z80_lpeek(a) (*(unsigned long *)(a)) 62 63 #ifdef __CLANG 64 65 #define z80_llpoke(a,b) (*(unsigned long long *)(a) = b) 66 #define z80_llpeek(a) (*(unsigned long long *)(a)) 67 68 #endif 69 70 #ifdef __SDCC 71 72 #define z80_llpoke(a,b) (*(unsigned long long *)(a) = b) 73 #define z80_llpeek(a) (*(unsigned long long *)(a)) 74 75 #endif 76 77 #endif 78 79 #endif 80