ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
antic.c
Go to the documentation of this file.
1/*****************************************************************************
2 * ugBASIC - an isomorphic BASIC language compiler for retrocomputers *
3 *****************************************************************************
4 * Copyright 2021-2026 Marco Spedaletti (asimov@mclink.it)
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *----------------------------------------------------------------------------
18 * Concesso in licenza secondo i termini della Licenza Apache, versione 2.0
19 * (la "Licenza"); è proibito usare questo file se non in conformità alla
20 * Licenza. Una copia della Licenza è disponibile all'indirizzo:
21 *
22 * http://www.apache.org/licenses/LICENSE-2.0
23 *
24 * Se non richiesto dalla legislazione vigente o concordato per iscritto,
25 * il software distribuito nei termini della Licenza è distribuito
26 * "COSì COM'è", SENZA GARANZIE O CONDIZIONI DI ALCUN TIPO, esplicite o
27 * implicite. Consultare la Licenza per il testo specifico che regola le
28 * autorizzazioni e le limitazioni previste dalla medesima.
29 ****************************************************************************/
30
31/****************************************************************************
32 * INCLUDE SECTION
33 ****************************************************************************/
34
35#if defined(__atari__) || defined(__atarixl__)
36
37#include "../ugbc.h"
38
39/****************************************************************************
40 * CODE SECTION
41 ****************************************************************************/
42
58void antic_raster_at( Environment * _environment, char * _label, char * _positionlo, char * _positionhi ) {
59
60 deploy( raster, src_hw_antic_raster_asm );
61
62 outline1("LDA %s", _positionlo);
63 outline0("STA RASTERLO");
64 outline1("LDA %s", _positionhi);
65 outline0("STA RASTERHI");
66 outline1("LDA #<%s", _label);
67 outline0("STA TMPPTR");
68 outline1("LDA #>%s", _label);
69 outline0("STA TMPPTR+1");
70 outline0("JSR RASTERAT");
71
72}
73
84void antic_next_raster( Environment * _environment ) {
85
86 outline0("RTI");
87
88}
89
103void antic_next_raster_at( Environment * _environment, char * _label, char * _positionlo, char * _positionhi ) {
104
105 deploy( raster, src_hw_antic_raster_asm );
106
107 outline1("LDA %s", _positionlo);
108 outline0("STA RASTERLO");
109 outline1("LDA %s", _positionhi);
110 outline0("STA RASTERHI");
111 outline1("LDA #<%s", _label);
112 outline0("STA TMPPTR");
113 outline1("LDA #>%s", _label);
114 outline0("STA TMPPTR+1");
115 outline0("JSR RASTERAT");
116 outline0("RTI");
117
118}
119
120void antic_initialization( Environment * _environment ) {
121
122 deploy_deferred( anticvars, src_hw_antic_vars_asm );
123 deploy_deferred( anticstartup, src_hw_antic_startup_asm );
124
125 // variable_import( _environment, "DLI", VT_BUFFER, 256 );
126 // variable_global( _environment, "DLI" );
127
128 outline0("JSR ANTICSTARTUP");
129
130}
131
132void antic_finalization( Environment * _environment ) {
133
134}
135
136#endif
void antic_initialization(Environment *_environment)
Definition antic.c:120
void antic_raster_at(Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
ANTIC: emit code to set raster irq
Definition antic.c:58
void antic_next_raster(Environment *_environment)
ANTIC: emit code to wait for next raster irq
Definition antic.c:84
void antic_finalization(Environment *_environment)
Definition antic.c:132
void antic_next_raster_at(Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
ANTIC: emit code to wait for next raster irq at different position
Definition antic.c:103
#define deploy_deferred(s, e)
Definition ugbc.h:4302
struct _Environment Environment
Structure of compilation environment.
#define outline0(s)
Definition ugbc.h:4252
#define outline1(s, a)
Definition ugbc.h:4253
#define deploy(s, e)
Definition ugbc.h:4288