ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
pc1403.h
Go to the documentation of this file.
1#ifndef __UGBC_PC1403__
2#define __UGBC_PC1403__
3
4/*****************************************************************************
5 * ugBASIC - an isomorphic BASIC language compiler for retrocomputers *
6 *****************************************************************************
7 * Copyright 2021-2026 Marco Spedaletti (asimov@mclink.it)
8 *
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 *----------------------------------------------------------------------------
21 * Concesso in licenza secondo i termini della Licenza Apache, versione 2.0
22 * (la "Licenza"); è proibito usare questo file se non in conformità alla
23 * Licenza. Una copia della Licenza è disponibile all'indirizzo:
24 *
25 * http://www.apache.org/licenses/LICENSE-2.0
26 *
27 * Se non richiesto dalla legislazione vigente o concordato per iscritto,
28 * il software distribuito nei termini della Licenza è distribuito
29 * "COSì COM'è", SENZA GARANZIE O CONDIZIONI DI ALCUN TIPO, esplicite o
30 * implicite. Consultare la Licenza per il testo specifico che regola le
31 * autorizzazioni e le limitazioni previste dalla medesima.
32 ****************************************************************************/
33
34#include "../ugbc.h"
35
36#define KEY_NONE 255
37
38#define KEY_0 0
39#define KEY_1 1
40#define KEY_2 2
41#define KEY_3 3
42#define KEY_4 4
43#define KEY_5 5
44#define KEY_6 6
45#define KEY_7 7
46#define KEY_8 8
47#define KEY_9 9
48#define KEY_MINUS 10
49#define KEY_EQUAL 11
50#define KEY_BACKSLASH 12
51#define KEY_SQUARE_OPEN 13
52#define KEY_SQUARE_CLOSE 14
53#define KEY_SEMICOLON 15
54#define KEY_QUOTE 16
55// ~
56// <
57// >
58// ?
59// $00
60#define KEY_A 22
61#define KEY_B 23
62#define KEY_C 24
63#define KEY_D 25
64#define KEY_E 26
65#define KEY_F 27
66#define KEY_G 28
67#define KEY_H 29
68#define KEY_I 30
69#define KEY_J 31
70#define KEY_K 32
71#define KEY_L 33
72#define KEY_M 34
73#define KEY_N 35
74#define KEY_O 36
75#define KEY_P 37
76#define KEY_Q 38
77#define KEY_R 39
78#define KEY_S 40
79#define KEY_T 41
80#define KEY_U 42
81#define KEY_V 43
82#define KEY_W 44
83#define KEY_X 45
84#define KEY_Y 46
85#define KEY_Z 47
86// 48: 81
87// 49: 82
88// 50: 83
89// 51: 84
90// 52: 85
91// 53: f1
92// 54: f2
93// 55: f3
94// 56: f4
95// 57: f5
96#define KEY_ESC 58
97#define KEY_TAB 59
98// 60: 86
99#define KEY_BS 61
100// 62: 87
101#define KEY_RETURN 63
102#define KEY_SPACE 64
103// 65: 88
104// 66: 89
105// 67: 90
106// 68: 91
107// 69: 92
108// 70: 93
109// 71: 94
110#define KEY_ASTERISK 72
111#define KEY_PLUS 73
112 // DB "/", "0", "1", "2", "3", "4"
113 // DB "5", "6", ",", "8", "9", "-", "7", "."
114#define KEY_PERIOD 87
115 // DB $ff
116
117
118#define KEY_AT 0
119#define KEY_COMMODORE 0
120#define KEY_CONTROL 0
121#define KEY_CRSR_LEFT_RIGHT 0
122#define KEY_CRSR_UP_DOWN 0
123#define KEY_DELETE 0
124#define KEY_F1 0
125#define KEY_F2 0
126#define KEY_F3 0
127#define KEY_F4 0
128#define KEY_F5 0
129#define KEY_F6 0
130#define KEY_F7 0
131#define KEY_F8 0
132#define KEY_HOME 0
133#define KEY_INSERT 0
134#define KEY_LEFT_ARROW 0
135#define KEY_LEFT_SHIFT 0
136#define KEY_POUND 0
137#define KEY_RIGHT_SHIFT 0
138#define KEY_RUNSTOP 0
139#define KEY_UP_ARROW 0
140#define KEY_SEMICOMMA 0
141#define KEY_APIX 0
142#define KEY_DEAD 0
143#define KEY_SHIFT 0
144#define KEY_CTRL 0
145#define KEY_GRAPH 0
146#define KEY_CAPS 0
147#define KEY_CODE 0
148#define KEY_STOP 0
149#define KEY_SELECT 0
150#define KEY_INS 0
151#define KEY_DEL 0
152#define KEY_LEFT 0
153#define KEY_UP 0
154#define KEY_DOWN 0
155#define KEY_RIGHT 0
156#define KEY_DIVISION 0
157#define KEY_CLEAR 0
158#define KEY_COLON 0
159#define KEY_COMMA 0
160#define KEY_SLASH 0
161
162#define KEYBOARD_CONFIG_DEFAULT_SYNC 0
163
164#define INPUT_DEFAULT_SEPARATOR ','
165#define INPUT_DEFAULT_SIZE 32
166#define INPUT_DEFAULT_CURSOR 95
167#define INPUT_DEFAULT_RATE 16
168#define INPUT_DEFAULT_DELAY 64
169
170#define SCREEN_WIDTH 120
171#define SCREEN_HEIGHT 8
172
173#define SCREEN_CAPABILITIES ( ( 1<<TILEMAP_NATIVE ) | ( 1<<BITMAP_NATIVE ) )
174
175#define DEFAULT_PAINT_BUCKET_SIZE 512
176
177#define BANK_COUNT 1
178#define BANK_SIZE 4096
179#define BANK_BASE_ADDRESS 0
180
181#define JOY_COUNT 2
182
183#define JOY_UP 0
184#define JOY_DOWN 1
185#define JOY_LEFT 2
186#define JOY_RIGHT 3
187#define JOY_FIRE 4
188
189#define JOYSTICK_CONFIG_DEFAULT_SYNC 1
190
191#define MAX_AUDIO_CHANNELS 3
192
193#define BITMAP_MODE_STANDARD 1 // Standard Bitmap Mode
194#define TILEMAP_MODE_STANDARD 0 // (emulated) Standard Character Mode
195#define BITMAP_MODE_DEFAULT BITMAP_MODE_STANDARD
196
197#define DOUBLE_BUFFER_PAGE_0 0
198#define DOUBLE_BUFFER_PAGE_1 0
199#define SPRITE_COUNT 0
200#define SCREEN_SPRITE_RATIO_X 0
201#define SCREEN_SPRITE_RATIO_Y 0
202#define SPRITE_HEIGHT 0
203#define SCREEN_BORDER_X 0
204#define SCREEN_BORDER_Y 0
205#define SPRITE_WIDTH 0
206#define SPRITE_X_MIN 0
207#define SPRITE_Y_MIN 0
208#define SPRITE_X_MAX 0
209#define SPRITE_Y_MAX 0
210
211#define COLOR_TRANSPARENT 0x00
212#define COLOR_BLACK 0x01
213#define COLOR_DARK_WHITE 0x0e // GREY
214#define COLOR_WHITE 0x0f
215#define COLOR_LIGHT_WHITE COLOR_WHITE
216#define COLOR_DARK_RED 0x06 // BROWN
217#define COLOR_RED 0x08
218#define COLOR_LIGHT_RED 0x09
219#define COLOR_CYAN 0x07
220#define COLOR_VIOLET 0x0d
221#define COLOR_DARK_GREEN 0x02 // GREEN
222#define COLOR_GREEN 0x02
223#define COLOR_LIGHT_GREEN 0x03
224#define COLOR_DARK_BLUE 0x04
225#define COLOR_BLUE 0x07
226#define COLOR_LIGHT_BLUE 0x05
227#define COLOR_YELLOW 0x0b
228#define COLOR_ORANGE 0x09
229#define COLOR_BROWN 0x06
230#define COLOR_DARK_GREY 0x0e
231#define COLOR_GREY 0x0e
232#define COLOR_LIGHT_GREY 0x0e
233#define COLOR_MAGENTA 0x0d
234#define COLOR_PURPLE COLOR_VIOLET
235#define COLOR_LAVENDER COLOR_VIOLET
236#define COLOR_GOLD 0x0a
237#define COLOR_TURQUOISE COLOR_LIGHT_BLUE
238#define COLOR_TAN COLOR_BROWN
239#define COLOR_YELLOW_GREEN 0x03
240#define COLOR_OLIVE_GREEN 0x0c
241#define COLOR_PINK COLOR_LIGHT_RED
242#define COLOR_PEACH COLOR_PINK
243#define COLOR_COUNT 16
244
245#define DEFAULT_PEN_COLOR COLOR_BLACK
246#define DEFAULT_PAPER_COLOR COLOR_WHITE
247
248#define IMAGE_WIDTH_SIZE 1
249#define IMAGE_WIDTH_OFFSET 0
250#define IMAGE_HEIGHT_SIZE 1
251#define IMAGE_HEIGHT_OFFSET 0
252
253#define TEXT_COLUMNS_COUNT 24
254#define TEXT_ROWS_COUNT 1
255
256void pc1403_initialization( Environment * _environment );
257
258void pc1403_wait_key( Environment * _environment, int _release );
259void pc1403_wait_fire( Environment * _environment, int _port, int _release );
260void pc1403_wait_fire_semivar( Environment * _environment, char * _port, int _release );
261void pc1403_wait_key_or_fire( Environment * _environment, int _port, int _release );
262void pc1403_wait_key_or_fire_semivar( Environment * _environment, char * _port, int _release );
263void pc1403_key_state( Environment * _environment, char *_scancode, char * _result );
264void pc1403_scancode( Environment * _environment, char * _scacode );
265void pc1403_asciicode( Environment * _environment, char * _asciicode );
266void pc1403_inkey( Environment * _environment, char * _key );
267void pc1403_key_pressed( Environment * _environment, char *_scancode, char * _result );
268void pc1403_put_key( Environment * _environment, char *_string, char * _size );
269
270void pc1403_scanshift( Environment * _environment, char * _shifts );
271void pc1403_keyshift( Environment * _environment, char * _shifts );
272void pc1403_clear_key( Environment * _environment );
273void pc1403_joy( Environment * _environment, int _port, char * _result );
274void pc1403_joy_vars( Environment * _environment, char * _port, char * _result );
275
276void pc1403_sys_call( Environment * _environment, int _destination );
277
278void pc1403_timer_set_status_on( Environment * _environment, char * _timer );
279void pc1403_timer_set_status_off( Environment * _environment, char * _timer );
280void pc1403_timer_set_counter( Environment * _environment, char * _timer, char * _counter );
281void pc1403_timer_set_init( Environment * _environment, char * _timer, char * _init );
282void pc1403_timer_set_address( Environment * _environment, char * _timer, char * _address );
283void pc1403_dload( Environment * _environment, char * _filename, char * _offset, char * _address, char * _size );
284void pc1403_dsave( Environment * _environment, char * _filename, char * _offset, char * _address, char * _size );
285
286void pc1403_cls( Environment * _environment );
287void pc1403_cls_box( Environment * _environment, char * _x1, char * _y1, char * _x2, char * _y2 );
288void pc1403_pset_int( Environment * _environment, int _x, int _y, int *_c );
289void pc1403_pset_vars( Environment * _environment, char *_x, char *_y, char *_c );
290void pc1403_pget_color_vars( Environment * _environment, char *_x, char *_y, char * _result );
291
292void pc1403_text( Environment * _environment, char * _text, char * _text_size, int _raw );
293
294#endif
void pc1403_clear_key(Environment *_environment)
Definition pc1403.c:262
void pc1403_dload(Environment *_environment, char *_filename, char *_offset, char *_address, char *_size)
Definition pc1403.c:1468
void pc1403_inkey(Environment *_environment, char *_key)
Definition pc1403.c:189
void pc1403_text(Environment *_environment, char *_text, char *_text_size, int _raw)
Definition pc1403.c:154
void pc1403_pset_int(Environment *_environment, int _x, int _y, int *_c)
Definition pc1403.c:79
void pc1403_asciicode(Environment *_environment, char *_asciicode)
Definition pc1403.c:237
void pc1403_dsave(Environment *_environment, char *_filename, char *_offset, char *_address, char *_size)
Definition pc1403.c:1472
void pc1403_wait_key_or_fire(Environment *_environment, int _port, int _release)
Definition pc1403.c:201
void pc1403_scanshift(Environment *_environment, char *_shifts)
Definition pc1403.c:250
void pc1403_key_pressed(Environment *_environment, char *_scancode, char *_result)
Definition pc1403.c:244
void pc1403_sys_call(Environment *_environment, int _destination)
Definition pc1403.c:1325
void pc1403_cls_box(Environment *_environment, char *_x1, char *_y1, char *_x2, char *_y2)
Definition pc1403.c:185
void pc1403_timer_set_address(Environment *_environment, char *_timer, char *_address)
Definition pc1403.c:1433
void pc1403_pset_vars(Environment *_environment, char *_x, char *_y, char *_c)
Definition pc1403.c:96
void pc1403_put_key(Environment *_environment, char *_string, char *_size)
Definition pc1403.c:1456
void pc1403_timer_set_status_on(Environment *_environment, char *_timer)
Definition pc1403.c:1357
void pc1403_wait_key_or_fire_semivar(Environment *_environment, char *_port, int _release)
Definition pc1403.c:207
void pc1403_keyshift(Environment *_environment, char *_shifts)
Definition pc1403.c:256
void pc1403_wait_key(Environment *_environment, int _release)
Definition pc1403.c:195
void pc1403_key_state(Environment *_environment, char *_scancode, char *_result)
Definition pc1403.c:225
void pc1403_pget_color_vars(Environment *_environment, char *_x, char *_y, char *_result)
Definition pc1403.c:124
void pc1403_timer_set_init(Environment *_environment, char *_timer, char *_init)
Definition pc1403.c:1411
void pc1403_cls(Environment *_environment)
Definition pc1403.c:177
void pc1403_wait_fire_semivar(Environment *_environment, char *_port, int _release)
Definition pc1403.c:219
void pc1403_timer_set_counter(Environment *_environment, char *_timer, char *_counter)
Definition pc1403.c:1389
void pc1403_wait_fire(Environment *_environment, int _port, int _release)
Definition pc1403.c:213
void pc1403_scancode(Environment *_environment, char *_scacode)
Definition pc1403.c:231
void pc1403_timer_set_status_off(Environment *_environment, char *_timer)
Definition pc1403.c:1373
void pc1403_joy_vars(Environment *_environment, char *_port, char *_result)
Definition pc1403.c:1480
void pc1403_joy(Environment *_environment, int _port, char *_result)
Definition pc1403.c:1476
void pc1403_initialization(Environment *_environment)
Definition pc1403.c:274
struct _Environment Environment
Structure of compilation environment.