ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
text_hscroll_screen.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_screen( Environment * _environment, int _direction, int _overlap ) {
42
43 outline1("LD A, $%2.2x", ( _direction & 0xff ) );
44
45 if ( !_environment->deployed.textHScrollScreen ) {
46
47 Variable * bitmapAddress = variable_retrieve( _environment, "BITMAPADDRESS" );
48
49 outline0("JMP lib_text_hscroll_screen_after");
50
51 outhead0("lib_text_hscroll_screen:" );
52 outline0("CP $80");
53 outline0("JP C, lib_text_hscroll_screen_right");
54
55 outhead0("lib_text_hscroll_screen_left:");
56 outline0("LD A, 0" );
57 outline0("LD D, A" );
58 outhead0("lib_text_hscroll_screen_left4:");
59 outline0("LD A, 0" );
60 outline0("LD C, A" );
61 outhead0("lib_text_hscroll_screen_left3:");
62 outline0("LD A, 0" );
63 outline0("LD B, A" );
64 outline1("LD HL, (%s)", bitmapAddress->realName );
65 outhead0("lib_text_hscroll_screen_left2:");
66 outline0("RL (HL)");
67 outline0("INC HL");
68 outline0("INC B");
69 outline0("LD A,B");
70 outline0("CP 32");
71 outline0("JP NZ,lib_text_hscroll_screen_right2");
72 outline0("INC C");
73 outline0("LD A,B");
74 outline0("CP 8");
75 outline0("JP NZ,lib_text_hscroll_screen_right3");
76 outline0("DEC D");
77 outline0("LD A,D");
78 outline0("CP 192");
79 outline0("JP NZ,lib_text_hscroll_screen_right4");
80 outline0("RET")
81
82 outhead0("lib_text_hscroll_screen_right:");
83 outline0("LD A, 192" );
84 outline0("LD D, A" );
85 outhead0("lib_text_hscroll_screen_right4:");
86 outline0("LD A, 8" );
87 outline0("LD C, A" );
88 outhead0("lib_text_hscroll_screen_right3:");
89 outline0("LD A, 32" );
90 outline0("LD B, A" );
91 outline1("LD HL, (%s)", bitmapAddress->realName );
92 outhead0("lib_text_hscroll_screen_right2:");
93 outline0("RR (HL)");
94 outline0("INC HL");
95 outline0("DEC B");
96 outline0("JP NZ,lib_text_hscroll_screen_right2");
97 outline0("DEC C");
98 outline0("JP NZ,lib_text_hscroll_screen_right3");
99 outline0("DEC D");
100 outline0("JP NZ,lib_text_hscroll_screen_right4");
101 outline0("RET")
102
103 outhead0("lib_text_hscroll_screen_after:");
104
105 _environment->deployed.textHScrollScreen = 1;
106
107 }
108
109 outline0("CALL lib_text_hscroll_screen");
110
111}
Variable * variable_retrieve(Environment *_environment, char *_name)
void text_hscroll_screen(Environment *_environment, int _direction, int _overlap)
int textHScrollScreen
Definition ugbc.h:1811
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