console.bi 1.66 KB
Newer Older
John P. Willis's avatar
John P. Willis committed
1

2

John P. Willis's avatar
John P. Willis committed
3 4 5 6 7 8
'
' I/O PORT USAGE
'
' OUT
'
'   IOBASE   +  0:  1 = Enable Cursor; 0 = Disable Cursor
John P. Willis's avatar
John P. Willis committed
9
'               1:  Set cycle sleep value (ms)
John P. Willis's avatar
John P. Willis committed
10 11
'               2:  Set horizontal offset
'               3:  Set vertical offset
12
'               4:  Fill video buffer
John P. Willis's avatar
John P. Willis committed
13 14 15 16 17 18 19
'
' IN
'
'   IOBASE   +  0:  Read cursor enable value
'               1:  Read refresh sleep value (ms)
'               2:  Read horizontal offset
'               3:  Read vertical offset
John P. Willis's avatar
John P. Willis committed
20
'				4:  Read one character from console
21
'
John P. Willis's avatar
John P. Willis committed
22

23 24 25 26 27 28 29
#define CONSOLE_PAGE &H0001
#define CONSOLE_OFFSET &H0000
#define CONSOLE_LIMIT &H07D0

#define CONSOLE_WIDTH 80
#define CONSOLE_HEIGHT 25

30 31
common shared console_mutex as any ptr

32 33 34 35 36 37
dim shared console_port as string
dim shared console_bps as string
dim shared console_parity as string
dim shared console_data_bits as string
dim shared console_stop_bits as string

John P. Willis's avatar
John P. Willis committed
38 39 40 41 42
dim shared horizontal_offset as ushort = 0
dim shared vertical_offset as ushort = 0
dim shared sleep_duration as ushort = 50
dim shared cursor_enabled as ushort = 1

43 44
dim shared console_file_number as integer

John P. Willis's avatar
John P. Willis committed
45 46
dim shared console_io_base as ushort

John P. Willis's avatar
John P. Willis committed
47 48
dim shared console_refresh as sub()

John P. Willis's avatar
John P. Willis committed
49
declare sub console_attach()
50 51
declare sub console_init_local()
declare sub console_reset_local()
John P. Willis's avatar
John P. Willis committed
52 53
declare function console_input_local(port_number as ushort) as ushort
declare function console_input_serial(port_number as ushort) as ushort
John P. Willis's avatar
John P. Willis committed
54
declare sub console_output(port_number as ushort, value as ushort)
55 56 57 58 59
declare sub console_cycle_local(byval userdata as any ptr)

declare sub console_init_serial()
declare sub console_reset_serial()
declare sub console_cycle_serial(byval userdata as any ptr)
John P. Willis's avatar
John P. Willis committed
60
declare sub console_refresh_local()
John P. Willis's avatar
John P. Willis committed
61
declare sub console_refresh_serial()