#var __keytest(row,col) D((!!(_rowread_inverted(1<<(row))&(1<<(col)))))

#var __keytest_optimized(row,col) D((!!((__current_row==row?__current_rowread_result:(__current_row=row,__current_rowread_result=_rowread_inverted(1<<(row))))&(1<<(col)))))


#var NULL D(((void*)0))
#var ARROW_UP D(1)
#var ARROW_LEFT D(2)
#var ARROW_DOWN D(3)
#var ARROW_RIGHT D(4)

#var FALSE D(0)
#var TRUE D(1)

#var KEY_F1 D(268)
#var KEY_F2 D(269)
#var KEY_F3 D(270)
#var KEY_F4 D(271)
#var KEY_F5 D(272)
#var KEY_F6 D(273)
#var KEY_F7 D(274)
#var KEY_F8 D(275)
#var KEY_ESC D(264)
#var KEY_QUIT D(4360)
#var KEY_APPS D(265)
#var KEY_SWITCH D(4361)
#var KEY_MODE D(266)
#var KEY_BACKSPACE D(257)
#var KEY_INS D(4353)
#var KEY_CLEAR D(263)
#var KEY_VARLNK D(4141)
#var KEY_CHAR D(4139)
#var KEY_ENTER D(13)
#var KEY_ENTRY D(4109)
#var KEY_STO D(258)
#var KEY_RCL D(4354)
#var KEY_SIGN D(173)
#var KEY_MATH D(4149)
#var KEY_MEM D(4150)
#var KEY_ON D(267)
#var KEY_OFF D(4363)

#var SCR_RECT typedef union{struct{unsigned char x0,y0,x1,y1;}xy;unsigned long l;}SCR_RECT;
#var STAT_2ND D(1)
#var STAT_DIAMOND D(2)
#var STAT_SHIFT D(3)
#var STAT_HAND D(4)

#var OSFastArrows D((*(AMS_1xx?((unsigned char*)(unsigned long)(*((unsigned short*)(_rom_call_addr(51))+0x80))):((unsigned char*)(_rom_call_addr(15C))))))
#var _keytest(rowcol...) D((__keytest(rowcol)))
#var _keytest_optimized(rowcol...) D((__keytest_optimized(rowcol)))
#var _rowread unsigned short _rowread(short)__ATTR_LIB_ASM__;
#var _rowread_internal(row) D((~(_rowread(row))))
#var _rowread_inverted(row) D((_rowread(~((short)(row)))))
#var GKeyDown D(_rom_call(short,(void),17F))
#var GKeyFlush D(_rom_call(void,(void),180))
#var GKeyIn D(_rom_call(short,(SCR_RECT*,short),17E))
#var kbhit D(_rom_call(short,(void),52))
#var ngetchx D(_rom_call(short,(void),51))
#var OSGetStatKeys D(_rom_call(short,(void),299))
#var OSInitBetweenKeyDelay(rate) D(({short __oldRate=_OSInitBetweenKeyDelay(48);(__oldRate*48-1)/_OSInitBetweenKeyDelay((rate))+1;}))
#var _OSInitBetweenKeyDelay D(_rom_call(short,(short),249))
#var OSInitKeyInitDelay D(_rom_call(short,(short),248))
#var pushkey D(_rom_call(void,(short),50))
#var BEGIN_KEYTEST D({register short __current_row=RR_NO_KEY;register unsigned short __current_rowread_result=0;)
#var END_KEYTEST D(})
