ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
text_hscroll_line.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#include "../../ugbc.h"
36
37/****************************************************************************
38 * CODE SECTION
39 ****************************************************************************/
40
41void text_hscroll_line( Environment * _environment, int _direction, int _overlap ) {
42
43 Variable * y = variable_retrieve( _environment, "YCURSYS" );
44 outline1("LD A, (%s)", y->realName );
45 outline0("LD B, A" );
46 outline1("LD A, $%2.2x", ( _direction & 0xff ) );
47
48 if ( !_environment->deployed.textHScrollLine ) {
49
50 Variable * bitmapAddress = variable_retrieve( _environment, "BITMAPADDRESS" );
51
52 outline0("JMP lib_text_hscroll_line_after");
53
54 outhead0("lib_text_hscroll_line:" );
55 outline1("LD HL, (%s)", bitmapAddress->realName );
56 outline0("LD DE, 32");
57 outhead0("lib_text_hscroll_line_ypos:");
58 outline0("ADD HL, DE");
59 outline0("DEC B");
60 outline0("JP NZ,lib_text_hscroll_line_ypos");
61 outline0("LD DE, HL");
62
63 outline0("CP $80");
64 outline0("JP C, lib_text_hscroll_line_right");
65
66 outhead0("lib_text_hscroll_line_left:");
67 outline0("LD A, 0" );
68 outline0("LD C, A" );
69 outhead0("lib_text_hscroll_line_left3:");
70 outline0("LD A, 0" );
71 outline0("LD B, A" );
72 outline0("LD HL, DE" );
73 outhead0("lib_text_hscroll_line_left2:");
74 outline0("RL (HL)");
75 outline0("INC HL");
76 outline0("INC B");
77 outline0("LD A,B");
78 outline0("CP 32");
79 outline0("JP NZ,lib_text_hscroll_line_right2");
80 outline0("INC C");
81 outline0("LD A,B");
82 outline0("CP 8");
83 outline0("JP NZ,lib_text_hscroll_line_right3");
84 outline0("RET")
85
86 outhead0("lib_text_hscroll_line_right:");
87 outline0("LD A, 8" );
88 outline0("LD C, A" );
89 outhead0("lib_text_hscroll_line_right3:");
90 outline0("LD A, 32" );
91 outline0("LD B, A" );
92 outline0("LD HL, DE" );
93 outhead0("lib_text_hscroll_line_right2:");
94 outline0("RR (HL)");
95 outline0("INC HL");
96 outline0("DEC B");
97 outline0("JP NZ,lib_text_hscroll_line_right2");
98 outline0("DEC C");
99 outline0("JP NZ,lib_text_hscroll_line_right3");
100 outline0("RET")
101
102 outhead0("lib_text_hscroll_line_after:");
103
104 _environment->deployed.textHScrollLine = 1;
105
106 }
107
108 outline0("CALL lib_text_hscroll_line");
109
110}
111
Variable * variable_retrieve(Environment *_environment, char *_name)
void text_hscroll_line(Environment *_environment, int _direction, int _overlap)
int textHScrollLine
Definition ugbc.h:1810
Deployed deployed
Definition ugbc.h:2921
char * realName
Definition ugbc.h:982
struct _Variable Variable
Structure of a single variable.
struct _Environment Environment
Structure of compilation environment.
#define outhead0(s)
Definition ugbc.h:4246
#define outline0(s)
Definition ugbc.h:4252
#define outline1(s, a)
Definition ugbc.h:4253