BBC Micro C library
basic.h
Go to the documentation of this file.
1 /*
2 Copyright 2020 Peter Howkins
3 
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the
6 "Software"), to deal in the Software without restriction, including
7 without limitation the rights to use, copy, modify, merge, publish,
8 distribute, sublicense, and/or sell copies of the Software, and to
9 permit persons to whom the Software is furnished to do so, subject to
10 the following conditions:
11 
12 The above copyright notice and this permission notice shall be included
13 in all copies or substantial portions of the Software.
14 
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 */
23 #ifndef BASIC____H
24 #define BASIC____H
25 
33 #include <string.h>
34 #include <stdio.h>
35 #include "stdint.h"
36 #include "os.h"
37 
41 static inline void
42 CLS(void)
43 {
44  oswrch(12);
45 }
46 
52 extern void COLOUR(uint8_t colour);
53 
65 extern void PLOT(uint8_t plotcode, uint16_t x, uint16_t y);
66 
67 
75 static inline void
77 {
78  PLOT(5, x, y);
79 }
80 
87 static inline void
88 ENVELOPE(const void *block)
89 {
90  osword(8, block);
91 }
92 
100 extern void GCOL(uint8_t action, uint8_t colour);
101 
109 extern uint8_t INKEYNEG(int8_t key);
110 
116 extern void MODE(uint8_t mode);
117 
124 static inline void
126 {
127  PLOT(4, x, y);
128 }
129 
138 static inline void
139 PRINT(const char *string)
140 {
141  puts(string);
142 }
143 
154 extern void PRINTTAB(uint8_t x, uint8_t y, const char *string);
155 
164 extern void SOUND(int16_t channel, int16_t amplitude, int16_t pitch, int16_t duration);
165 
166 #endif /* BASIC_____H */
int int16_t
Definition: stdint.h:47
static void oswrch(uint8_t a_char)
Definition: os.h:43
void PRINTTAB(uint8_t x, uint8_t y, const char *string)
void SOUND(int16_t channel, int16_t amplitude, int16_t pitch, int16_t duration)
static void DRAW(uint16_t x, uint16_t y)
Definition: basic.h:76
static void CLS(void)
Definition: basic.h:42
void MODE(uint8_t mode)
unsigned char uint8_t
Definition: stdint.h:34
void COLOUR(uint8_t colour)
BBC MOS API wrappers.
unsigned int uint16_t
Definition: stdint.h:37
signed char int8_t
Definition: stdint.h:43
static void MOVE(uint16_t x, uint16_t y)
Definition: basic.h:125
static void ENVELOPE(const void *block)
Definition: basic.h:88
uint8_t INKEYNEG(int8_t key)
static void PRINT(const char *string)
Definition: basic.h:139
void GCOL(uint8_t action, uint8_t colour)
Named types for various sizes.
void PLOT(uint8_t plotcode, uint16_t x, uint16_t y)
void osword(uint8_t a_func, const void *xy_pointer)