mos_hardware/mega65/libc/
bindings.rs

1/* automatically generated by rust-bindgen 0.63.0 */
2
3pub const ATTRIB_BLINK: u32 = 16;
4pub const ATTRIB_REVERSE: u32 = 32;
5pub const ATTRIB_UNDERLINE: u32 = 128;
6pub const ATTRIB_HIGHLIGHT: u32 = 64;
7pub const COLOUR_BLACK: u32 = 0;
8pub const COLOUR_WHITE: u32 = 1;
9pub const COLOUR_RED: u32 = 2;
10pub const COLOUR_CYAN: u32 = 3;
11pub const COLOUR_PURPLE: u32 = 4;
12pub const COLOUR_GREEN: u32 = 5;
13pub const COLOUR_BLUE: u32 = 6;
14pub const COLOUR_YELLOW: u32 = 7;
15pub const COLOUR_ORANGE: u32 = 8;
16pub const COLOUR_BROWN: u32 = 9;
17pub const COLOUR_PINK: u32 = 10;
18pub const COLOUR_GREY1: u32 = 11;
19pub const COLOUR_DARKGREY: u32 = 11;
20pub const COLOUR_GREY2: u32 = 12;
21pub const COLOUR_GREY: u32 = 12;
22pub const COLOUR_MEDIUMGREY: u32 = 12;
23pub const COLOUR_LIGHTGREEN: u32 = 13;
24pub const COLOUR_LIGHTBLUE: u32 = 14;
25pub const COLOUR_GREY3: u32 = 15;
26pub const COLOUR_LIGHTGREY: u32 = 15;
27pub const KEYMOD_RSHIFT: u32 = 1;
28pub const KEYMOD_LSHIFT: u32 = 2;
29pub const KEYMOD_CTRL: u32 = 4;
30pub const KEYMOD_MEGA: u32 = 8;
31pub const KEYMOD_ALT: u32 = 16;
32pub const KEYMOD_NOSCRL: u32 = 32;
33pub const KEYMOD_CAPSLOCK: u32 = 64;
34pub const BOX_STYLE_NONE: u32 = 0;
35pub const BOX_STYLE_INNER: u32 = 1;
36pub const BOX_STYLE_MID: u32 = 2;
37pub const BOX_STYLE_OUTER: u32 = 3;
38pub const BOX_STYLE_ROUND: u32 = 4;
39pub const HLINE_STYLE_TOP_THIN: u32 = 99;
40pub const HLINE_STYLE_BTM_THIN: u32 = 100;
41pub const HLINE_STYLE_TOP_NORMAL: u32 = 119;
42pub const HLINE_STYLE_BTM_NORMAL: u32 = 111;
43pub const HLINE_STYLE_TOP1_8: u32 = 69;
44pub const HLINE_STYLE_TOP3_8: u32 = 68;
45pub const HLINE_STYLE_BTM1_8: u32 = 82;
46pub const HLINE_STYLE_BTM3_8: u32 = 70;
47pub const HLINE_STYLE_MID: u32 = 64;
48pub const HLINE_STYLE_CHECKER: u32 = 104;
49pub const VLINE_STYLE_LEFT_NORMAL: u32 = 116;
50pub const VLINE_STYLE_RIGHT_NORMAL: u32 = 106;
51pub const VLINE_STYLE_MID: u32 = 66;
52pub const VLINE_STYLE_CHECKER: u32 = 92;
53pub const CINPUT_ACCEPT_NUMERIC: u32 = 1;
54pub const CINPUT_ACCEPT_LETTER: u32 = 2;
55pub const CINPUT_ACCEPT_ALL: u32 = 4;
56pub const CINPUT_NO_AUTOTRANSLATE: u32 = 8;
57pub const CINPUT_ACCEPT_ALPHA: u32 = 3;
58pub const TARGET_UNKNOWN: u32 = 0;
59pub const TARGET_MEGA65R1: u32 = 1;
60pub const TARGET_MEGA65R2: u32 = 2;
61pub const TARGET_MEGA65R3: u32 = 3;
62pub const TARGET_MEGAPHONER1: u32 = 33;
63pub const TARGET_MEGAPHONER4: u32 = 34;
64pub const TARGET_NEXYS4: u32 = 64;
65pub const TARGET_NEXYS4DDR: u32 = 65;
66pub const TARGET_NEXYS4DDRWIDGET: u32 = 66;
67pub const TARGET_WUKONG: u32 = 253;
68pub const TARGET_SIMULATION: u32 = 254;
69pub const TEST_START: u32 = 240;
70pub const TEST_SKIP: u32 = 241;
71pub const TEST_PASS: u32 = 242;
72pub const TEST_FAIL: u32 = 243;
73pub const TEST_ERROR: u32 = 244;
74pub const TEST_LOG: u32 = 253;
75pub const TEST_SETNAME: u32 = 254;
76pub const TEST_DONEALL: u32 = 255;
77#[repr(C)]
78#[derive(Debug, Default, Copy, Clone)]
79pub struct tagRECT {
80    pub left: ::core::ffi::c_uchar,
81    pub top: ::core::ffi::c_uchar,
82    pub right: ::core::ffi::c_uchar,
83    pub bottom: ::core::ffi::c_uchar,
84}
85
86pub type RECT = tagRECT;
87extern "C" {
88    #[doc = " \\m65libsummary{conionit}{Initialises the library internal state}\n\\m65libsyntax    {void conioinit(void)}\n\\m65libremarks{This must be called before using any conio library function.}"]
89    pub fn conioinit();
90}
91extern "C" {
92    #[doc = " \\m65libsummary{togglecase}{Set lower case character set}\n\\m65libsyntax    {void setlowercase(void)}"]
93    pub fn setlowercase();
94}
95extern "C" {
96    #[doc = " \\m65libsummary{togglecase}{Set upper case character set}\n\\m65libsyntax    {void setuppercase(void)}"]
97    pub fn setuppercase();
98}
99extern "C" {
100    #[doc = " \\m65libsummary{setscreenaddr}{Sets the screen RAM start address}\n\\m65libsyntax    {void setscreenaddr(long addr);}\n\\m65libparam     {addr}{The address to set as start of screen RAM}\n\\m65example   {\n// Set beginning of screen RAM at $48000\nsetscreenaddr(0x48000UL);\n}\n\\m65libremarks{No bounds check is performed on the selected address}"]
101    pub fn setscreenaddr(addr: ::core::ffi::c_long);
102}
103extern "C" {
104    #[doc = " \\m65libsummary{getscreenaddr}{Returns the screen RAM start address}\n\\m65libsyntax    {long getscreenaddr(void);}\n\\m65libretval    {The current screen RAM address start address.}"]
105    pub fn getscreenaddr() -> ::core::ffi::c_long;
106}
107extern "C" {
108    #[doc = " \\m65libsummary{setcolramoffset}{Sets the color RAM start offset value}\n\\m65libsyntax    {void setcolramoffset(long offset);}\n\\m65libparam     {addr}{The offset from the beginning of the color RAM address ($FF80000)}\n\\m65libremarks{No bounds check is performed on the resulting address. Do not exceed the available Color RAM size}"]
109    pub fn setcolramoffset(addr: ::core::ffi::c_uint);
110}
111extern "C" {
112    #[doc = " \\m65libsummary{getcolramoffset}{Returns the color RAM start offset value}\n\\m65libsyntax    {long getscreenaddr(void);}\n\\m65libretval    {The current color RAM start offset value.}"]
113    pub fn getcolramoffset() -> ::core::ffi::c_uint;
114}
115extern "C" {
116    #[doc = " \\m65libsummary{setcharsetaddr}{Sets the character set start address}\n\\m65libsyntax    {void setcharsetaddr(long addr);}\n\\m65libparam     {addr}{The address to set as start of character set}\n\\m65libremarks   {No bounds check is performed on the selected address}"]
117    pub fn setcharsetaddr(addr: ::core::ffi::c_long);
118}
119extern "C" {
120    #[doc = " \\m65libsummary{getcharsetaddr}{Returns the current character set start address}\n\\m65libsyntax    {long getscreenaddr(void);}\n\\m65libretval    {The current character set start address.}"]
121    pub fn getcharsetaddr() -> ::core::ffi::c_long;
122}
123extern "C" {
124    #[doc = "\\m65libsummary{clrscr}{Clear the text screen. }\n\\m65libsyntax    {void clrscr(void)}\n\\m65example   {\n// Clear screen to white\ntextcolor(COLOUR_WHITE);\nclrscr();\n}\n\\m65libremarks{Color RAM will be cleared with current text color}"]
125    pub fn clrscr();
126}
127extern "C" {
128    #[doc = " \\m65libsummary{getscreensize}{Returns the dimensions of the text screen}\n\\m65libsyntax    {void getscreensize(unsigned char* width, unsigned char* height)}\n\\m65libparam     {width}{Pointer to location where width will be returned}\n\\m65libparam     {height}{Pointer to location where height will be returned}"]
129    pub fn getscreensize(width: *mut ::core::ffi::c_uchar, height: *mut ::core::ffi::c_uchar);
130}
131extern "C" {
132    #[doc = " \\m65libsummary{setscreensize}{Sets the dimensions of the text screen}\n\\m65libsyntax    {void setscreensize(unsigned char width, unsigned char height)}\n\\m65libparam     {width}{The width in columns (40 or 80)}\n\\m65libparam     {height}{The height in rows (25 or 50)}\n\\m65libremarks   {Currently only 40/80 and 25/50 are accepted. Other values are ignored.}"]
133    pub fn setscreensize(width: ::core::ffi::c_uchar, height: ::core::ffi::c_uchar);
134}
135extern "C" {
136    #[doc = " \\m65libsummary{set16bitcharmode}{Sets or clear the 16-bit character mode}\n\\m65libsyntax    {void set16bitcharmode(unsigned char f)}\n\\m65libparam     {f}{Set true to set the 16-bit character mode}\n\\m65libremarks   {This will trigger a video parameter reset if HOTREG is ENABLED. See sethotregs function.}"]
137    pub fn set16bitcharmode(f: ::core::ffi::c_uchar);
138}
139extern "C" {
140    #[doc = " \\m65libsummary{sethotregs}{Sets or clear the hot-register behavior of the VIC-IV chip.}\n\\m65libsyntax    {void set16bitcharmode(unsigned char f)}\n\\m65libparam     {f}{Set true to enable the hotreg behavior}\n\\m65libremarks   {When this mode is ENABLED a video mode reset will be triggered when touching $D011, $D016, $D018, $D031\nor the VIC-II bank bits of $DD00. }"]
141    pub fn sethotregs(f: ::core::ffi::c_uchar);
142}
143extern "C" {
144    #[doc = " \\m65libsummary{setextendedattrib}{Sets or clear the VIC-III extended attributes mode to support blink, underline, bold\nand highlight.} \\m65libsyntax    {void setextendedattrib(unsigned char f)} \\m65libparam     {f}{Set true to set the\nextended attributes mode}"]
145    pub fn setextendedattrib(f: ::core::ffi::c_uchar);
146}
147extern "C" {
148    #[doc = " \\m65libsummary{togglecase}{Toggle the current character set case}\n\\m65libsyntax    {void togglecase(void)}"]
149    pub fn togglecase();
150}
151extern "C" {
152    #[doc = " \\m65libsummary{bordercolor}{Sets the current border color}\n\\m65libsyntax    {void bordercolor(unsigned char c)}\n\\m65libparam     {c}{The color to set}"]
153    pub fn bordercolor(c: ::core::ffi::c_uchar);
154}
155extern "C" {
156    #[doc = " \\m65libsummary{bgcolor}{Sets the current screen (background) color}\n\\m65libsyntax    {void bgcolor(unsigned char c)}\n\\m65libparam     {c}{The color to set}"]
157    pub fn bgcolor(c: ::core::ffi::c_uchar);
158}
159extern "C" {
160    #[doc = " \\m65libsummary{textcolor}{Sets the current text color}\n\\m65libsyntax    {void textcolor(unsigned char c)}\n\\m65libparam     {c}{The color to set}\n\\m65libremarks   {This function preserves attributes in the upper 4-bits if extended attributes are enabled. See\nsetextendedattrib. }"]
161    pub fn textcolor(c: ::core::ffi::c_uchar);
162}
163extern "C" {
164    #[doc = " \\m65libsummary{revers}{Enable the reverse attribute}\n\\m65libsyntax    {void revers(unsigned char c)}\n\\m65libparam     {enable}{0 to disable, 1 to enable}\n\\m65libremarks   {Extended attributes mode must be active. See setextendedattrib.}"]
165    pub fn revers(enable: ::core::ffi::c_uchar);
166}
167extern "C" {
168    #[doc = " \\m65libsummary{highlight}{Enable the highlight attribute}\n\\m65libsyntax    {void highlight(unsigned char c)}\n\\m65libparam     {enable}{0 to disable, 1 to enable}\n\\m65libremarks   {Extended attributes mode must be active. See setextendedattrib.}"]
169    pub fn highlight(enable: ::core::ffi::c_uchar);
170}
171extern "C" {
172    #[doc = " \\m65libsummary{blink}{Enable the blink attribute}\n\\m65libsyntax    {void blink(unsigned char c)}\n\\m65libparam     {enable}{0 to disable, 1 to enable}\n\\m65libremarks   {Extended attributes mode must be active. See setextendedattrib.}"]
173    pub fn blink(enable: ::core::ffi::c_uchar);
174}
175extern "C" {
176    #[doc = " \\m65libsummary{underline}{Enable the underline attribute}\n\\m65libsyntax    {void underline(unsigned char c)}\n\\m65libparam     {enable}{0 to disable, 1 to enable}\n\\m65libremarks   {Extended attributes mode must be active. See setextendedattrib.}"]
177    pub fn underline(enable: ::core::ffi::c_uchar);
178}
179extern "C" {
180    #[doc = " \\m65libsummary{altpal}{Enable the alternate-palette attribute}\n\\m65libsyntax    {void altpal(unsigned char c)}\n\\m65libparam     {enable}{0 to disable, 1 to enable}\n\\m65libremarks   {Extended attributes mode must be active. See setextendedattrib.}"]
181    pub fn altpal(enable: ::core::ffi::c_uchar);
182}
183extern "C" {
184    #[doc = " \\m65libsummary{clearattr}{Clear all text attributes}\n\\m65libsyntax    {void clearattr())}\n\\m65libremarks   {Extended attributes mode must be active. See setextendedattrib.}"]
185    pub fn clearattr();
186}
187extern "C" {
188    #[doc = " \\m65libsummary{cellcolor}{Sets the color of a character cell}\n\\m65libsyntax    {void cellcolor(unsigned char x, unsigned char y, unsigned char c)}\n\\m65libparam     {x}{The cell X-coordinate}\n\\m65libparam     {y}{The cell Y-coordinate}\n\\m65libparam     {c}{The color to set}\n\\m65libremarks   {No screen bounds checks are performed; out of screen behavior is undefined }"]
189    pub fn cellcolor(x: ::core::ffi::c_uchar, y: ::core::ffi::c_uchar, c: ::core::ffi::c_uchar);
190}
191extern "C" {
192    #[doc = " \\m65libsummary{setpalbank}{Set current text/bitmap palette bank (BTPALSEL).}\n\\m65libsyntax    {void setpalbank(unsigned char bank)}\n\\m65libparam     {bank}{The palette bank to set. Valid values are 0, 1, 2 or 3.}\n\\m65libremarks   {Use setpalbanka to set alternate text/bitmap palette}"]
193    pub fn setpalbank(bank: ::core::ffi::c_uchar);
194}
195extern "C" {
196    #[doc = " \\m65libsummary{setpalbanka}{Set alternate text/bitmap palette bank.}\n\\m65libsyntax    {void setpalbanka(unsigned char bank)}\n\\m65libparam     {bank}{The palette bank to set. Valid values are 0, 1, 2 or 3.}\n\\m65libremarks   {Use setpalbank to set main text/bitmap palette}"]
197    pub fn setpalbanka(bank: ::core::ffi::c_uchar);
198}
199extern "C" {
200    #[doc = " \\m65libsummary{getpalbank}{Get selected text/bitmap palette bank.}\n\\m65libsyntax    {unsigned char getpalbank(void)}\n\\m65libremarks   {Use getpalbanka to get alternate text/bitmap selected palette}\n\\m65libretval    {The current selected main text/bitmap palette bank.}"]
201    pub fn getpalbank() -> ::core::ffi::c_uchar;
202}
203extern "C" {
204    #[doc = " \\m65libsummary{getpalbanka}{Get selected alternate text/bitmap palette bank.}\n\\m65libsyntax    {unsigned char getpalbanka(void)}\n\\m65libremarks   {Use getpalbank to get main text/bitmap selected palette}\n\\m65libretval    {The current selected alternate text/bitmap palette bank.}"]
205    pub fn getpalbanka() -> ::core::ffi::c_uchar;
206}
207extern "C" {
208    #[doc = " \\m65libsummary{setmapedpal}{Set maped-in palette bank at $D100-$D3FF.}\n\\m65libsyntax    {void setmapedpal(unsigned char bank)}\n\\m65libparam     {bank}{The palette bank to map-in. Valid values are 0, 1, 2 or 3.}"]
209    pub fn setmapedpal(bank: ::core::ffi::c_uchar);
210}
211extern "C" {
212    #[doc = " \\m65libsummary{getmapedpal}{Get maped-in  palette bank at $D100-$D3FF.}\n\\m65libsyntax    {unsigned char getmapedpal(void)}"]
213    pub fn getmapedpal() -> ::core::ffi::c_uchar;
214}
215extern "C" {
216    #[doc = " \\m65libsummary{setpalentry}{Set color entry for the maped-in palette}\n\\m65libsyntax    {void setpalentry(unsigned char c, unsigned char r, unsigned char g, unsigned char b)}\n\\m65libparam     {c}{The palette entry index (0-255)}\n\\m65libparam     {r}{The red component value}\n\\m65libparam     {g}{The green component value}\n\\m65libparam     {b}{The blue component value}\n\\m65libremarks   {Use setmapedmal to bank-in the palette to modify}"]
217    pub fn setpalentry(
218        c: ::core::ffi::c_uchar,
219        r: ::core::ffi::c_uchar,
220        g: ::core::ffi::c_uchar,
221        b: ::core::ffi::c_uchar,
222    );
223}
224extern "C" {
225    #[doc = " \\m65libsummary{fillrect}{Fill a rectangular area with character and color value}\n\\m65libsyntax    {void fillrect(const RECT *rc, unsigned char ch, unsigned char col)}\n\\m65libparam     {rc}{A RECT structure specifying the box coordinates}\n\\m65libparam     {ch}{A char code to fill the rectangle}\n\\m65libparam     {col}{The color to fill}\n\\m65libremarks   {No screen bounds checks are performed; out of screen behavior is undefined }"]
226    pub fn fillrect(rc: *const RECT, ch: ::core::ffi::c_uchar, col: ::core::ffi::c_uchar);
227}
228extern "C" {
229    #[doc = " \\m65libsummary{box}{Draws a box with graphic characters}\n\\m65libsyntax    {void box(const RECT *rc, unsigned char color, unsigned char style, unsigned char clear, unsigned char\nshadow)} \\m65libparam     {rc}{A RECT structure specifying the box coordinates} \\m65libparam     {color}{The color to use\nfor the graphic characters} \\m65libparam     {style}{The style for the box borders. Can be set to BOX_STYLE_NONE,\nBOX_STYLE_ROUNDED, BOX_STYLE_INNER, BOX_STYLE_OUTER, BOX_STYLE_MID } \\m65libparam     {clear}{Set to 1 to clear the box\ninterior with the selected color} \\m65libparam     {shadow}{Set to 1 to draw a drop shadow} \\m65libremarks   {No screen\nbounds checks are performed; out of screen behavior is undefined }"]
230    #[link_name = "\u{1}box"]
231    pub fn box_(
232        rc: *const RECT,
233        color: ::core::ffi::c_uchar,
234        style: ::core::ffi::c_uchar,
235        clear: ::core::ffi::c_uchar,
236        shadow: ::core::ffi::c_uchar,
237    );
238}
239extern "C" {
240    #[doc = " \\m65libsummary{hline}{Draws an horizontal line.}\n\\m65libsyntax    {void hline(unsigned char x, unsigned char y, unsigned char len, unsigned char style)}\n\\m65libparam     {x}{The line start X-coordinate}\n\\m65libparam     {y}{The line start Y-coordinate}\n\\m65libparam     {len}{The line length}\n\\m65libparam     {style}{The style for the line. See HLINE_ constants for available styles. }\n\\m65libremarks   {No screen bounds checks are performed; out of screen behavior is undefined }"]
241    pub fn hline(
242        x: ::core::ffi::c_uchar,
243        y: ::core::ffi::c_uchar,
244        len: ::core::ffi::c_uchar,
245        style: ::core::ffi::c_uchar,
246    );
247}
248extern "C" {
249    #[doc = " \\m65libsummary{vline}{Draws a vertical line.}\n\\m65libsyntax    {void vline(unsigned char x, unsigned char y, unsigned char len, unsigned char style)}\n\\m65libparam     {x}{The line start X-coordinate}\n\\m65libparam     {y}{The line start Y-coordinate}\n\\m65libparam     {len}{The line length}\n\\m65libparam     {style}{The style for the line. See VLINE_ constants for available styles. }\n\\m65libremarks   {No screen bounds checks are performed; out of screen behavior is undefined }"]
250    pub fn vline(
251        x: ::core::ffi::c_uchar,
252        y: ::core::ffi::c_uchar,
253        len: ::core::ffi::c_uchar,
254        style: ::core::ffi::c_uchar,
255    );
256}
257extern "C" {
258    #[doc = " \\m65libsummary{gohome}{Set the current position at home (0,0 coordinate)}\n\\m65libsyntax    {void gohome(void)}"]
259    pub fn gohome();
260}
261extern "C" {
262    #[doc = " \\m65libsummary{gotoxy}{Set the current position at X,Y coordinates}\n\\m65libsyntax    {void gotoxy(unsigned char x, unsigned char y)}\n\\m65libparam     {x}{The new X-coordinate}\n\\m65libparam     {y}{The new Y-coordinate}\n\\m65libremarks   {No screen bounds checks are performed; out of screen behavior is undefined }"]
263    pub fn gotoxy(x: ::core::ffi::c_uchar, y: ::core::ffi::c_uchar);
264}
265extern "C" {
266    #[doc = " \\m65libsummary{gotox}{Set the current position X-coordinate}\n\\m65libsyntax    {void gotox(unsigned char x)}\n\\m65libparam     {x}{The new X-coordinate}\n\\m65libremarks   {No screen bounds checks are performed; out of screen behavior is undefined }"]
267    pub fn gotox(x: ::core::ffi::c_uchar);
268}
269extern "C" {
270    #[doc = " \\m65libsummary{gotoy}{Set the current position Y-coordinate}\n\\m65libsyntax    {void gotoy(unsigned char y)}\n\\m65libparam     {y}{The new Y-coordinate}\n\\m65libremarks   {No screen bounds checks are performed; out of screen behavior is undefined }"]
271    pub fn gotoy(y: ::core::ffi::c_uchar);
272}
273extern "C" {
274    #[doc = " \\m65libsummary{moveup}{Move current position up}\n\\m65libsyntax    {void moveup(unsigned char count)}\n\\m65libparam     {count}{The number of positions to move}\n\\m65libremarks   {No screen bounds checks are performed; out of screen behavior is undefined }"]
275    pub fn moveup(count: ::core::ffi::c_uchar);
276}
277extern "C" {
278    #[doc = " \\m65libsummary{movedown}{Move current position down}\n\\m65libsyntax    {void movedown(unsigned char count)}\n\\m65libparam     {count}{The number of positions to move}\n\\m65libremarks   {No screen bounds checks are performed; out of screen behavior is undefined }"]
279    pub fn movedown(count: ::core::ffi::c_uchar);
280}
281extern "C" {
282    #[doc = " \\m65libsummary{moveleft}{Move current position left}\n\\m65libsyntax    {void moveleft(unsigned char count)}\n\\m65libparam     {count}{The number of positions to move}\n\\m65libremarks   {No screen bounds checks are performed; out of screen behavior is undefined }"]
283    pub fn moveleft(count: ::core::ffi::c_uchar);
284}
285extern "C" {
286    #[doc = " \\m65libsummary{moveright}{Move current position right}\n\\m65libsyntax    {void moveright(unsigned char count)}\n\\m65libparam     {count}{The number of positions to move}\n\\m65libremarks   {No screen bounds checks are performed; out of screen behavior is undefined }"]
287    pub fn moveright(count: ::core::ffi::c_uchar);
288}
289extern "C" {
290    #[doc = " \\m65libsummary{wherex}{Return the current position X coordinate}\n\\m65libsyntax    {unsigned char wherex(void)}\n\\m65libretval    {The current position X coordinate}"]
291    pub fn wherex() -> ::core::ffi::c_uchar;
292}
293extern "C" {
294    #[doc = " \\m65libsummary{wherey}{Return the current position Y coordinate}\n\\m65libsyntax    {unsigned char wherey(void)}\n\\m65libretval    {The current position Y coordinate}"]
295    pub fn wherey() -> ::core::ffi::c_uchar;
296}
297extern "C" {
298    pub fn petsciitoscreencode(c: ::core::ffi::c_char) -> ::core::ffi::c_char;
299}
300extern "C" {
301    pub fn petsciitoscreencode_s(s: *mut ::core::ffi::c_char) -> *mut ::core::ffi::c_char;
302}
303extern "C" {
304    #[doc = " \\m65libsummary{cputc}{Output a single screen code character to screen at current position}\n\\m65libsyntax    {void cputc(unsigned char c)}\n\\m65libparam     {c}{The screen code of the character to output}"]
305    pub fn cputc(c: ::core::ffi::c_uchar);
306}
307extern "C" {
308    #[doc = " \\m65libsummary{cputnc}{Output N copies of a character at current position}\n\\m65libsyntax    {void cputnc(unsigned char count, unsigned char c)}\n\\m65libparam     {c}{The screen code of the characters to output}\n\\m65libparam     {count}{The count of characters to print}"]
309    pub fn cputnc(count: ::core::ffi::c_uchar, c: ::core::ffi::c_uchar);
310}
311extern "C" {
312    #[doc = " \\m65libsummary{cputhex}{Output an hex-formatted number at current position}\n\\m65libsyntax    {void cputhex(long n, unsigned char prec)}\n\\m65libparam     {n}{The number to write}\n\\m65libparam     {prec}{The precision of the hex number, in digits. Leading zeros will be printed accordingly}\n\\m65libremarks   {The $ symbol will be automatically added at beginning of string}"]
313    pub fn cputhex(n: ::core::ffi::c_long, prec: ::core::ffi::c_uchar);
314}
315extern "C" {
316    #[doc = " \\m65libsummary{cputdec}{Output a decimal number at current position}\n\\m65libsyntax    {void cputdec(long n, unsigned char padding, unsigned char leadingZ)}\n\\m65libparam     {n}{The number to write}\n\\m65libparam     {padding}{The padding space to add before number}\n\\m65libparam     {leadingZ}{The leading zeros to print}"]
317    pub fn cputdec(
318        n: ::core::ffi::c_long,
319        padding: ::core::ffi::c_uchar,
320        leadingZ: ::core::ffi::c_uchar,
321    );
322}
323extern "C" {
324    #[doc = " \\m65libsummary{cputs}{Output screen codes at current position}\n\\m65libsyntax    {void cputs(const unsigned char* s)}\n\\m65libparam     {s}{Am array of screen codes to print}\n\\m65libremarks   {This function works with screen codes only. To output ordinary ASCII/PETSCII strings,\nuse the \"pcputs\" macro. No pointer check is performed.  If s is null or invalid, behavior is undefined. }"]
325    pub fn cputs(s: *const ::core::ffi::c_uchar);
326}
327extern "C" {
328    #[doc = " \\m65libsummary{cputsxy}{Output multiple screen codes at X,Y coordinates}\n\\m65libsyntax    {void cputsxy (unsigned char x, unsigned char y, const unsigned char* s)}\n\\m65libparam     {x}{The X coordinate where string will be printed}\n\\m65libparam     {y}{The Y coordinate where string will be printed}\n\\m65libparam     {s}{An array of screen codes to print}\n\\m65libremarks   {This function works with screen codes only. To output ordinary ASCII/PETSCII strings,\nuse the \"pcputsxy\" macro. No pointer check is performed.  If s is null or invalid, behavior is undefined. }"]
329    pub fn cputsxy(
330        x: ::core::ffi::c_uchar,
331        y: ::core::ffi::c_uchar,
332        s: *const ::core::ffi::c_uchar,
333    );
334}
335extern "C" {
336    #[doc = " \\m65libsummary{cputcxy}{Output a single character at X,Y coordinates}\n\\m65libsyntax    {void cputcxy (unsigned char x, unsigned char y, unsigned char c)}\n\\m65libparam     {x}{The X coordinate where character will be printed}\n\\m65libparam     {y}{The Y coordinate where character will be printed}\n\\m65libparam     {c}{The screen code of the character to print}"]
337    pub fn cputcxy(x: ::core::ffi::c_uchar, y: ::core::ffi::c_uchar, c: ::core::ffi::c_uchar);
338}
339extern "C" {
340    #[doc = " \\m65libsummary{cputncxy}{Output N copies of a single character at X,Y coordinates}\n\\m65libsyntax    {void cputncxy (unsigned char x, unsigned char y, unsigned char count, unsigned char c)}\n\\m65libparam     {x}{The X coordinate where character will be printed}\n\\m65libparam     {y}{The Y coordinate where character will be printed}\n\\m65libparam     {count}{The number of characters to output}\n\\m65libparam     {c}{The screen code of the characters to print}"]
341    pub fn cputncxy(
342        x: ::core::ffi::c_uchar,
343        y: ::core::ffi::c_uchar,
344        count: ::core::ffi::c_uchar,
345        c: ::core::ffi::c_uchar,
346    );
347}
348extern "C" {
349    pub fn _cprintf(
350        translateCodes: ::core::ffi::c_uchar,
351        fmt: *const ::core::ffi::c_uchar,
352        ...
353    ) -> ::core::ffi::c_uchar;
354}
355extern "C" {
356    #[doc = " \\m65libsummary{cgetc}{ Waits until a character is in the keyboard buffer and returns it }\n\\m65libsyntax    {unsigned char cgetc (void);}\n\\m65libretval    {The last character in the keyboard buffer }\n\\m65libremarks   {Returned values are ASCII character codes}"]
357    pub fn cgetc() -> ::core::ffi::c_uchar;
358}
359extern "C" {
360    #[doc = " \\m65libsummary{kbhit}{ Returns the character in the keyboard buffer }\n\\m65libsyntax    {unsigned char kbhit (void);}\n\\m65libretval    {The character code in the keyboard buffer,  0 otherwise. }\n\\m65libremarks   {Returned values are ASCII character codes}"]
361    pub fn kbhit() -> ::core::ffi::c_uchar;
362}
363extern "C" {
364    #[doc = " \\m65libsummary{getkeymodstate}{\nReturn the key modifiers state.}\n\\m65libsyntax    {unsigned char getkeymodstate(void)}\n\\m65libretval    {A byte with the key modifier state bits,\nwhere bits:\n%<\n\\begin{tabular}{lll}\n\\textbf{Bit} & \\textbf{Meaning} & \\textbf{Constant}        \\\\\n0   & Right SHIFT State & \\texttt{KEYMOD\\_RSHIFT} \\\\\n1   & Left  SHIFT state & \\texttt{KEYMOD\\_LSHIFT} \\\\\n2   & CTRL state        & \\texttt{KEYMOD\\_CTRL}  \\\\\n3   & MEGA state        & \\texttt{KEYMOD\\_MEGA} \\\\\n4   & ALT state         & \\texttt{KEYMOD\\_ALT} \\\\\n5   & NOSCRL state      & \\texttt{KEYMOD\\_NOSCRL} \\\\\n6   & CAPSLOCK state    & \\texttt{KEYMOD\\_CAPSLOCK} \\\\\n7   & Reserved          & - \\\\\n\\end{tabular}\n%>}"]
365    pub fn getkeymodstate() -> ::core::ffi::c_uchar;
366}
367extern "C" {
368    #[doc = " \\m65libsummary{flushkeybuf}{Flush the keyboard buffer}\n\\m65libsyntax    {void flushkeybuf(void)}"]
369    pub fn flushkeybuf();
370}
371extern "C" {
372    #[doc = " \\m65libsummary{cinput}{Get input from keyboard, printing incoming characters at current position.}\n\\m65libsyntax    {unsigned char cinput(char* buffer, unsigned char buflen, unsigned char flags)}\n\\m65libparam     {buffer}{Target character buffer preallocated by caller}\n\\m65libparam     {buflen}{Target buffer length in characters, including the null character terminator}\n\\m65libparam     {flags}{Flags for input:  (default is accept all printable characters)\n%<\n\\texttt{CINPUT\\_ACCEPT\\_NUMERIC} \\\\\nAccepts numeric characters. \\\\ \\\\\n\\texttt{CINPUT\\_ACCEPT\\_LETTER}  \\\\\nAccepts letters.  \\\\ \\\\\n\\texttt{CINPUT\\_ACCEPT\\_SYM}  \\\\\nAccepts symbols.  \\\\ \\\\\n\\texttt{CINPUT\\_ACCEPT\\_ALL}\\\\\nAccepts all. Equals to \\texttt{CINPUT\\_ACCEPT\\_NUMERIC \\textbar CINPUT\\_ACCEPT\\_LETTER \\textbar\nCINPUT\\_ACCEPT\\_SYM} \\\\ \\\\\n\\texttt{CINPUT\\_ACCEPT\\_ALPHA} \\\\\nAccepts alphanumeric characters. Equals to \\texttt{CINPUT\\_ACCEPT\\_NUMERIC \\textbar CINPUT\\_ACCEPT\\_LETTER} \\\\ \\\\\n\\texttt{CINPUT\\_NO\\_AUTOTRANSLATE}\\\\\nDisables the feature that makes cinput to autodisplay uppercase characters when standard lowercase character set\nis selected  and the user enters letters without the SHIFT key, that would display graphic characters instead of\nalphabetic ones. \\\\\n%>}\n\n\\m65libretval    {Count of successfully read characters in buffer}"]
373    pub fn cinput(
374        buffer: *mut ::core::ffi::c_uchar,
375        buflen: ::core::ffi::c_uchar,
376        flags: ::core::ffi::c_uchar,
377    ) -> ::core::ffi::c_uchar;
378}
379extern "C" {
380    pub fn debug_msg(m: *mut ::core::ffi::c_char);
381}
382pub type int_least64_t = i64;
383pub type uint_least64_t = u64;
384pub type int_fast64_t = i64;
385pub type uint_fast64_t = u64;
386pub type int_least32_t = i32;
387pub type uint_least32_t = u32;
388pub type int_fast32_t = i32;
389pub type uint_fast32_t = u32;
390pub type int_least16_t = i16;
391pub type uint_least16_t = u16;
392pub type int_fast16_t = i16;
393pub type uint_fast16_t = u16;
394pub type int_least8_t = i8;
395pub type uint_least8_t = u8;
396pub type int_fast8_t = i8;
397pub type uint_fast8_t = u8;
398pub type intmax_t = ::core::ffi::c_longlong;
399pub type uintmax_t = ::core::ffi::c_ulonglong;
400extern "C" {
401    pub fn opendir() -> ::core::ffi::c_uchar;
402}
403extern "C" {
404    pub fn readdir(arg1: ::core::ffi::c_uchar) -> *mut m65_dirent;
405}
406extern "C" {
407    pub fn closedir(arg1: ::core::ffi::c_uchar);
408}
409#[repr(C)]
410#[derive(Debug, Copy, Clone)]
411pub struct m65_dirent {
412    pub d_ino: u32,
413    pub d_off: u16,
414    pub d_reclen: u32,
415    pub d_type: u16,
416    pub d_name: [::core::ffi::c_char; 256usize],
417}
418impl Default for m65_dirent {
419    fn default() -> Self {
420        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
421        unsafe {
422            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
423            s.assume_init()
424        }
425    }
426}
427extern "C" {
428    pub fn toggle_rom_write_protect();
429}
430extern "C" {
431    pub fn closeall();
432}
433extern "C" {
434    pub fn close(fd: ::core::ffi::c_uchar);
435}
436extern "C" {
437    pub fn open(filename: *const ::core::ffi::c_char) -> ::core::ffi::c_uchar;
438}
439extern "C" {
440    pub fn read512(buffer: *mut ::core::ffi::c_uchar) -> ::core::ffi::c_ushort;
441}
442extern "C" {
443    pub fn chdir(filename: *const ::core::ffi::c_char) -> ::core::ffi::c_uchar;
444}
445extern "C" {
446    pub fn chdirroot() -> ::core::ffi::c_uchar;
447}
448extern "C" {
449    pub fn usleep(micros: u32);
450}
451#[repr(C)]
452#[derive(Debug, Copy, Clone)]
453pub struct dmagic_dmalist {
454    pub option_0b: ::core::ffi::c_uchar,
455    pub option_80: ::core::ffi::c_uchar,
456    pub source_mb: ::core::ffi::c_uchar,
457    pub option_81: ::core::ffi::c_uchar,
458    pub dest_mb: ::core::ffi::c_uchar,
459    pub option_85: ::core::ffi::c_uchar,
460    pub dest_skip: ::core::ffi::c_uchar,
461    pub end_of_options: ::core::ffi::c_uchar,
462    pub command: ::core::ffi::c_uchar,
463    pub count: ::core::ffi::c_uint,
464    pub source_addr: ::core::ffi::c_uint,
465    pub source_bank: ::core::ffi::c_uchar,
466    pub dest_addr: ::core::ffi::c_uint,
467    pub dest_bank: ::core::ffi::c_uchar,
468    pub sub_cmd: ::core::ffi::c_uchar,
469    pub modulo: ::core::ffi::c_uint,
470}
471extern "C" {
472    pub static mut dmalist: dmagic_dmalist;
473}
474extern "C" {
475    pub static mut dma_byte: ::core::ffi::c_uchar;
476}
477extern "C" {
478    pub fn mega65_io_enable();
479}
480extern "C" {
481    pub fn lpeek(address: ::core::ffi::c_long) -> ::core::ffi::c_uchar;
482}
483extern "C" {
484    pub fn lpeek_debounced(address: ::core::ffi::c_long) -> ::core::ffi::c_uchar;
485}
486extern "C" {
487    pub fn lpoke(address: ::core::ffi::c_long, value: ::core::ffi::c_uchar);
488}
489extern "C" {
490    pub fn lcopy(
491        source_address: ::core::ffi::c_long,
492        destination_address: ::core::ffi::c_long,
493        count: ::core::ffi::c_uint,
494    );
495}
496extern "C" {
497    pub fn lfill(
498        destination_address: ::core::ffi::c_long,
499        value: ::core::ffi::c_uchar,
500        count: ::core::ffi::c_uint,
501    );
502}
503extern "C" {
504    pub fn lfill_skip(
505        destination_address: ::core::ffi::c_long,
506        value: ::core::ffi::c_uchar,
507        count: ::core::ffi::c_uint,
508        skip: ::core::ffi::c_uchar,
509    );
510}
511extern "C" {
512    pub fn random32(range: u32) -> u32;
513}
514extern "C" {
515    pub fn random16(range: u16) -> u16;
516}
517extern "C" {
518    pub fn random8(range: u8) -> u8;
519}
520extern "C" {
521    pub fn srand(seed: u32);
522}
523extern "C" {
524    pub fn rand8(range: u8) -> u8;
525}
526extern "C" {
527    pub fn rand16(range: u16) -> u16;
528}
529extern "C" {
530    pub fn rand32(range: u32) -> u32;
531}
532extern "C" {
533    pub static mut sector_buffer: [u8; 512usize];
534}
535extern "C" {
536    pub fn mega65_clear_sector_buffer();
537}
538extern "C" {
539    pub fn mega65_sdcard_reset();
540}
541extern "C" {
542    pub fn mega65_fast();
543}
544extern "C" {
545    pub fn mega65_sdcard_open();
546}
547extern "C" {
548    pub fn mega65_sdcard_map_sector_buffer();
549}
550extern "C" {
551    pub fn mega65_sdcard_unmap_sector_buffer();
552}
553extern "C" {
554    pub fn mega65_sdcard_readsector(sector_number: u32) -> u8;
555}
556extern "C" {
557    pub fn mega65_sdcard_writesector(sector_number: u32) -> u8;
558}
559extern "C" {
560    pub fn mega65_sdcard_erase(first_sector: u32, last_sector: u32);
561}
562extern "C" {
563    pub fn detect_target() -> ::core::ffi::c_uchar;
564}
565extern "C" {
566    #[doc = " \\brief Setup of the unit test reporting to the host machine\n \\param param testName Human readable name of the test\n \\param issueNum The mega65-core issue number that identifies the test issue"]
567    pub fn unit_test_setup(testName: *mut ::core::ffi::c_char, issueNum: ::core::ffi::c_ushort);
568}
569extern "C" {
570    #[doc = " \\brief Report a successful test with a optional message\n \\param msg Description of the successful test (NULL uses global testName)"]
571    pub fn unit_test_ok(msg: *mut ::core::ffi::c_char);
572}
573extern "C" {
574    #[doc = " \\brief Report a failed test with a optional message\n \\param msg Description of the failed test (NULL uses global testName)"]
575    pub fn unit_test_fail(msg: *mut ::core::ffi::c_char);
576}
577extern "C" {
578    #[doc = " \\brief Finish test procedure and tell m65 to exit"]
579    pub fn unit_test_done();
580}
581extern "C" {
582    #[doc = " \\brief Reports unit test result to the host machine\n \\param issue The issue number that identifies the test issue\n \\param sub The sub issue number (for multiple tests per issue)\n \\param status The test status to be sent"]
583    pub fn unit_test_report(
584        issue: ::core::ffi::c_ushort,
585        sub: ::core::ffi::c_uchar,
586        status: ::core::ffi::c_uchar,
587    );
588}
589extern "C" {
590    #[doc = " \\brief Reports current test name to the host machine\n \\param name The human-readable name of the current test"]
591    pub fn unit_test_set_current_name(name: *mut ::core::ffi::c_char);
592}
593extern "C" {
594    #[doc = " \\brief Logs a message on the host machine\n \\param msg The message to be logged"]
595    pub fn unit_test_log(msg: *mut ::core::ffi::c_char);
596}
597#[repr(C)]
598#[derive(Debug, Default, Copy, Clone)]
599pub struct m65_tm {
600    pub tm_sec: ::core::ffi::c_uchar,
601    pub tm_min: ::core::ffi::c_uchar,
602    pub tm_hour: ::core::ffi::c_uchar,
603    pub tm_mday: ::core::ffi::c_uchar,
604    pub tm_mon: ::core::ffi::c_uchar,
605    pub tm_year: ::core::ffi::c_ushort,
606    pub tm_wday: ::core::ffi::c_uchar,
607    pub tm_yday: ::core::ffi::c_int,
608    pub tm_isdst: ::core::ffi::c_uchar,
609}
610extern "C" {
611    pub fn getrtc(tm: *mut m65_tm);
612}
613extern "C" {
614    pub fn setrtc(tm: *mut m65_tm);
615}