ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
msx1.h
Go to the documentation of this file.
1#ifndef __UGBC_MSX1__
2#define __UGBC_MSX1__
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_CAPABILITIES ( ( 1<<TILEMAP_NATIVE ) | ( 1<<BITMAP_NATIVE ) )
171
172#define DEFAULT_PAINT_BUCKET_SIZE 512
173
174#define BANK_COUNT 0
175#define BANK_SIZE 8192
176#define BANK_BASE_ADDRESS 0xa000
177
178#define JOY_COUNT 2
179
180#define JOY_UP 0
181#define JOY_DOWN 1
182#define JOY_LEFT 2
183#define JOY_RIGHT 3
184#define JOY_FIRE 4
185
186#define JOYSTICK_CONFIG_DEFAULT_SYNC 1
187
188#define MAX_AUDIO_CHANNELS 3
189
190#define DSTRING_DEFAULT_COUNT 255
191#define DSTRING_DEFAULT_SPACE 1024
192
193void msx1_wait_key( Environment * _environment, int _release );
194void msx1_wait_fire( Environment * _environment, int _port, int _release );
195void msx1_wait_fire_semivar( Environment * _environment, char * _port, int _release );
196void msx1_wait_key_or_fire( Environment * _environment, int _port, int _release );
197void msx1_wait_key_or_fire_semivar( Environment * _environment, char * _port, int _release );
198void msx1_key_state( Environment * _environment, char *_scancode, char * _result );
199void msx1_scancode( Environment * _environment, char * _scacode );
200void msx1_asciicode( Environment * _environment, char * _asciicode );
201void msx1_inkey( Environment * _environment, char * _key );
202void msx1_key_pressed( Environment * _environment, char *_scancode, char * _result );
203void msx1_put_key( Environment * _environment, char *_string, char * _size );
204
205void msx1_scanshift( Environment * _environment, char * _shifts );
206void msx1_keyshift( Environment * _environment, char * _shifts );
207void msx1_clear_key( Environment * _environment );
208void msx1_joy( Environment * _environment, int _port, char * _result );
209void msx1_joy_vars( Environment * _environment, char * _port, char * _result );
210
211void msx1_sys_call( Environment * _environment, int _destination );
212
213void msx1_timer_set_status_on( Environment * _environment, char * _timer );
214void msx1_timer_set_status_off( Environment * _environment, char * _timer );
215void msx1_timer_set_counter( Environment * _environment, char * _timer, char * _counter );
216void msx1_timer_set_init( Environment * _environment, char * _timer, char * _init );
217void msx1_timer_set_address( Environment * _environment, char * _timer, char * _address );
218void msx1_dload( Environment * _environment, char * _filename, char * _offset, char * _address, char * _size );
219void msx1_dsave( Environment * _environment, char * _filename, char * _offset, char * _address, char * _size );
220
221#endif
void msx1_timer_set_address(Environment *_environment, char *_timer, char *_address)
Definition msx1.c:373
void msx1_scancode(Environment *_environment, char *_scacode)
Definition msx1.c:226
void msx1_put_key(Environment *_environment, char *_string, char *_size)
Definition msx1.c:501
void msx1_key_pressed(Environment *_environment, char *_scancode, char *_result)
Definition msx1.c:246
void msx1_timer_set_status_off(Environment *_environment, char *_timer)
Definition msx1.c:312
void msx1_wait_key(Environment *_environment, int _release)
Definition msx1.c:131
void msx1_keyshift(Environment *_environment, char *_shifts)
Definition msx1.c:269
void msx1_dsave(Environment *_environment, char *_filename, char *_offset, char *_address, char *_size)
Definition msx1.c:445
void msx1_joy(Environment *_environment, int _port, char *_result)
Definition msx1.c:55
void msx1_key_state(Environment *_environment, char *_scancode, char *_result)
Definition msx1.c:211
void msx1_timer_set_counter(Environment *_environment, char *_timer, char *_counter)
Definition msx1.c:329
void msx1_joy_vars(Environment *_environment, char *_port, char *_result)
Definition msx1.c:86
void msx1_wait_key_or_fire_semivar(Environment *_environment, char *_port, int _release)
Definition msx1.c:162
void msx1_scanshift(Environment *_environment, char *_shifts)
Definition msx1.c:262
void msx1_inkey(Environment *_environment, char *_key)
Definition msx1.c:120
void msx1_wait_key_or_fire(Environment *_environment, int _port, int _release)
Definition msx1.c:145
void msx1_timer_set_status_on(Environment *_environment, char *_timer)
Definition msx1.c:296
void msx1_asciicode(Environment *_environment, char *_asciicode)
Definition msx1.c:237
void msx1_dload(Environment *_environment, char *_filename, char *_offset, char *_address, char *_size)
Definition msx1.c:396
void msx1_wait_fire(Environment *_environment, int _port, int _release)
Definition msx1.c:179
void msx1_timer_set_init(Environment *_environment, char *_timer, char *_init)
Definition msx1.c:351
void msx1_clear_key(Environment *_environment)
Definition msx1.c:280
void msx1_sys_call(Environment *_environment, int _destination)
Definition msx1.c:290
void msx1_wait_fire_semivar(Environment *_environment, char *_port, int _release)
Definition msx1.c:195
struct _Environment Environment
Structure of compilation environment.