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
41/* <usermanual>
42@keyword HSCROLL
43@target msx1
44</usermanual> */
45void text_hscroll_line( Environment * _environment, int _direction, int _overlap ) {
46
47 Variable * y = variable_retrieve( _environment, "YCURSYS" );
48 outline1("LD A, (%s)", y->realName );
49 outline0("LD B, A" );
50 outline1("LD A, $%2.2x", ( _direction & 0xff ) );
51
52 if ( !_environment->deployed.textHScrollLine ) {
53
54 Variable * bitmapAddress = variable_retrieve( _environment, "BITMAPADDRESS" );
55
56 outline0("JMP lib_text_hscroll_line_after");
57
58 outhead0("lib_text_hscroll_line:" );
59 outline1("LD HL, (%s)", bitmapAddress->realName );
60 outline0("LD DE, 32");
61 outhead0("lib_text_hscroll_line_ypos:");
62 outline0("ADD HL, DE");
63 outline0("DEC B");
64 outline0("JP NZ,lib_text_hscroll_line_ypos");
65 outline0("LD DE, HL");
66
67 outline0("CP $80");
68 outline0("JP C, lib_text_hscroll_line_right");
69
70 outhead0("lib_text_hscroll_line_left:");
71 outline0("LD A, 0" );
72 outline0("LD C, A" );
73 outhead0("lib_text_hscroll_line_left3:");
74 outline0("LD A, 0" );
75 outline0("LD B, A" );
76 outline0("LD HL, DE" );
77 outhead0("lib_text_hscroll_line_left2:");
78 outline0("RL (HL)");
79 outline0("INC HL");
80 outline0("INC B");
81 outline0("LD A,B");
82 outline0("CP 32");
83 outline0("JP NZ,lib_text_hscroll_line_right2");
84 outline0("INC C");
85 outline0("LD A,B");
86 outline0("CP 8");
87 outline0("JP NZ,lib_text_hscroll_line_right3");
88 outline0("RET")
89
90 outhead0("lib_text_hscroll_line_right:");
91 outline0("LD A, 8" );
92 outline0("LD C, A" );
93 outhead0("lib_text_hscroll_line_right3:");
94 outline0("LD A, 32" );
95 outline0("LD B, A" );
96 outline0("LD HL, DE" );
97 outhead0("lib_text_hscroll_line_right2:");
98 outline0("RR (HL)");
99 outline0("INC HL");
100 outline0("DEC B");
101 outline0("JP NZ,lib_text_hscroll_line_right2");
102 outline0("DEC C");
103 outline0("JP NZ,lib_text_hscroll_line_right3");
104 outline0("RET")
105
106 outhead0("lib_text_hscroll_line_after:");
107
108 _environment->deployed.textHScrollLine = 1;
109
110 }
111
112 outline0("CALL lib_text_hscroll_line");
113
114}
115
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