The ZX Ecosystem v5.1.0;_GUI_v3.1.0
Loading...
Searching...
No Matches
Namespaces | Classes
The ZX Screen

Description

This module provides the ZX screen behavior.

NOTE:

-These classes are not thread-safe.

http://jafma.net

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Collaboration diagram for The ZX Screen:

Namespaces

namespace  zxeco
 The main namespace of the library, that spans across all the zx modules.
 

Classes

class  zxeco::At
 Just a shorter renaming of CharCursor. More...
 
class  zxeco::Screen
 The class that provides the main support for managing the ZX screen. More...
 
struct  zxeco::Screen::InputCallbacks
 Callbacks used in input. More...
 
class  zxeco::Screen::ScaledTextPrinter< SW, SH >
 A class for printing with scaled characters. More...
 
class  zxeco::BASICScreen
 This class decorates Screen to get the original BASIC screen model of the ZX. More...
 
struct  zxeco::BASICScreen::ScrollInfo
 Info produced after a scroll or some movements of the text cursor. More...
 

Class Documentation

◆ zxeco::At

class zxeco::At

Just a shorter renaming of CharCursor.

< Notice that at construction, it comes first the x (horizontal) coordinate, then y (vertical).

Definition at line 50 of file ZXScreen.h.

Inheritance diagram for zxeco::At:
Collaboration diagram for zxeco::At:

Public Member Functions

 At (const CharCursor &cc)
 
 At (CharCursor &&cc)
 
Atoperator= (const CharCursor &cc)
 
Atoperator= (CharCursor &&cc)
 
- Public Member Functions inherited from zxeco::Cursor< CharCoordT, CharCoordT >
 Cursor (typename WidthType::type xc, typename HeightType::type yc)
 Constructor, from the numerical coord types. More...
 
 Cursor (WidthType xc, HeightType yc)
 Constructor from the trait coord types. More...
 
void newRow (void) noexcept
 Go down one row resetting x (y <- y + 1 & x <- 0). More...
 
void newCol (void) noexcept
 Go right one column (x <- x + 1). More...
 
void incRow (void) noexcept
 Go down one row without resetting x. More...
 
bool zero (void) const noexcept
 Return TRUE if the cursor is placed at (0,0). *‍/. More...
 
bool before (const Cursor &oth) const noexcept
 < Return TRUE if THIS is placed before OTH in the plane (linearly). More...
 
bool rightBelow (const Cursor &oth) const noexcept
 < Return TRUE if THIS is placed to the right and below of OTH. More...
 
IntDist xDiff (const Cursor &oth) const noexcept
 < Return the signed distance in X from OTH to THIS. More...
 
IntDist yDiff (const Cursor &oth) const noexcept
 < Return the signed distance in Y from OTH to THIS. More...
 
void addDiff (IntDist xdiff, IntDist ydiff) noexcept
 < Add the given signed distances to both coordinates. More...
 
bool operator== (const Cursor &oth) const noexcept
 < Return TRUE if both cursors are placed at the same place. More...
 
bool operator!= (const Cursor &oth) const noexcept
 < Unequality. More...
 
Cursor operator+ (const Cursor &oth) const
 < Return the sum of both cursors. More...
 
Cursoroperator+= (const Cursor &oth)
 Make the sum and return the result. More...
 
Cursor operator- (const Cursor &oth) const
 < Return the cursor THIS relative to OTH, or throw if result is negative. More...
 
Cursoroperator-= (const Cursor &oth)
 Make the substraction and return the result. More...
 
std::string to_string (bool withtype=true) const
 < Return a string with the textual information of the area. More...
 

Additional Inherited Members

- Public Types inherited from zxeco::Cursor< CharCoordT, CharCoordT >
using WidthType = CharCoordT
 Type used for the width dimension. More...
 
using HeightType = CharCoordT
 Type used for the height dimension. More...
 
- Static Public Member Functions inherited from zxeco::Cursor< CharCoordT, CharCoordT >
static const CursortheZero (void) noexcept
 < Return a reference to an inmutable zero cursorof this type. More...
 
static Cursor max (const Cursor &c0, const Cursor &c1) noexcept
 < Return a copy of the one of C0, C1 that is more to the right and below. More...
 
- Public Attributes inherited from zxeco::Cursor< CharCoordT, CharCoordT >
WidthType::type x
 Coordinate in width (horizontally). More...
 
HeightType::type y
 Coordinates in height (vertically). More...
 

Constructor & Destructor Documentation

◆ At() [1/2]

zxeco::At::At ( const CharCursor cc)
inline

Definition at line 56 of file ZXScreen.h.

◆ At() [2/2]

zxeco::At::At ( CharCursor &&  cc)
inline

Definition at line 57 of file ZXScreen.h.

Member Function Documentation

◆ operator=() [1/2]

At & zxeco::At::operator= ( const CharCursor cc)
inline

Definition at line 58 of file ZXScreen.h.

◆ operator=() [2/2]

At & zxeco::At::operator= ( CharCursor &&  cc)
inline

Definition at line 59 of file ZXScreen.h.

◆ zxeco::Screen

class zxeco::Screen

The class that provides the main support for managing the ZX screen.

Notice that an object of this class does not open any window; it just holds all the information in memory, without visualization. For displaying, see the ZXEco class.

This class manages the screen in a flat model, i.e., no bottom/top areas, text and plot coordinates have their (0,0) at the top-left corner, growing downwards and linear layout in the bitmap (not as in the original ZX). If you want the original ZX model, where the (0,0) pixel was at the bottom-left, which did not count the input area (this class does not distinguish an input area), and also worked with a non-linear layout in the bitmap, use the BASICScreen decorator class.

In this class, the text cursor may be placed at any location without causing errors, even outside the visible screen. The next printed character will cause scrolls if the current row is outside the screen and/or begin at the next line if the current column is outside the screen.

This class is not thread-safe.

Definition at line 88 of file ZXScreen.h.

Static Public Member Functions

-----------— Static methods -----------—
static void fillInitialFontBitmaps (uint8_t *p)
 Fill from the given address the ZX original 32-127 character bitmaps.
 
static void fillInitialUDGBitmaps (uint8_t *p)
 Fill from the given address the original ZX UDG bitmaps.
 
static std::pair< CharArea, size_t > printArea (const CharArea &area, const std::string &txt, const ExpandToken &expandtoken=kNudeExpandToken)
 Return the space occupied by TXT if printed at (0,0) within AREA. More...
 
static CharArea areaForPrint (const std::string &txt, const ExpandToken &expandtoken=kNudeExpandToken)
 Fill from the given address the ZX original 32-127 character bitmaps. More...
 

Public Member Functions

-----------— Constructors -----------—
 Screen (const CharArea &dimensions={SCREENCOLS, SCREENROWS}, const ExpandToken expandtoken=kInvExpandToken)
 Default constructor with given dimensions (cannot be empty area). More...
 
 Screen (uint8_t *bitmap, uint8_t *attrmap, const CharArea &dimensions={SCREENCOLS, SCREENROWS}, const ExpandToken expandtoken=kInvExpandToken)
 Constructor that does not create the bitmap/attrmap, but uses external.
 
 Screen (Screen &oth, const CharRect &region, const ExpandToken expandtoken=kInvExpandToken)
 Constructor of a subscreen covering a (non-empty area) region of anothr. More...
 
 Screen (const Screen &)=delete
 Default constructor with given dimensions (cannot be empty area). More...
 
Screenoperator= (const Screen &)=delete
 Default constructor with given dimensions (cannot be empty area). More...
 
 Screen (Screen &&)=delete
 Default constructor with given dimensions (cannot be empty area). More...
 
Screenoperator= (Screen &&)=delete
 Default constructor with given dimensions (cannot be empty area). More...
 
virtual ~Screen (void)
 Destroy the Screen.
 
-----------— General methods -----------—
const DoubleAreainfo (void) const noexcept
 Return a read-only reference to the info of this Screen. More...
 
const ExpandTokenexpandToken (void) const noexcept
 Return a read-only reference to the expand token routine. More...
 
CharArea entireCharArea (void) const
 Return a CharArea covering the whole screen. More...
 
CharRect entireCharRect (void) const
 Return a CharRect covering the whole screen. More...
 
const CharRectsubRegion (void) const noexcept
 Return the region within a containing Screen, or empty if not contained. More...
 
bool inside (const CharRect &r) const noexcept
 < Return TRUE if the given rectangle is inside the screen entirely. More...
 
void cls (void)
 Clear the Screen by putting all bitmap to 0 and attrs as current color. More...
 
void scrollUp (PixelDist howmany=8, PixelCoord upperrow=0)
 Scroll the bitmap HOWMANY pixels up from UPPERROW, & maybe the attrmap. More...
 
void scrollUpAttrs (CharDist howmany=1, CharCoord upperrow=0)
 Scroll HOWMANY rows of chars in the attrmap starting at UPPERROW. More...
 
-----------------— Colors methods ----------------—
void setBorder (BasicColor c) noexcept
 Change the border color. More...
 
BasicColor border (void) const noexcept
 Get the current border color. More...
 
Colorscolors (void) noexcept
 Get reference to the current colors that can be used to write and read. More...
 
---------— Bitmap & attrmap access methods --------------—
Recall that this class is not thread-safe, thus other threads may be 
accessing the same data concurrently.

Also, recall that the bitmap is internally stored linearly (flat
model), not following the ZX original bitmap layout.
DoubleGraphicgraphic (void) noexcept
 Return a reference to the bitmap + attrmap of this Screen. More...
 
const DoubleGraphicgraphic (void) const noexcept
 Return a const reference to the bitmap + attrmap of this Screen. More...
 
--------— Font and UDGs bitmap methods ----------------—
const uint8_t * currentFontBitmap (void) const noexcept
 Return the current font bitmap, or nullptr if it is the ZX original one. More...
 
void changeFontBitmap (const uint8_t *pfont) noexcept
 Change the bitmap for the font used to print characters 32-127. More...
 
void copyFontBitmap (uint8_t *dest) const
 Copy all the characters from the current font bitmap into DEST. More...
 
const uint8_t * currentUDGsBitmap (void) const noexcept
 Return the current UDGs bitmap, or nullptr if it is the ZX original one. More...
 
void changeUDGsBitmap (const uint8_t *pudgs) noexcept
 Set to PUDGS the memory address where UDGs are defined. More...
 
uint8_t recognizeCharInFont (const Bitmap &charbitmap, uint8_t howmany=CHRFIRSTGB - CHRSPC, bool evenwithinv=true) const
 Return the ASCII code of a char in the current font that has that bitmp. More...
 
uint8_t recognizeCharInGrBlocks (const Bitmap &charbitmap) const
 The same as recognizeCharInFont() but for a ZX graphic block. More...
 
-— Text printing methods (using flat model coordinates) -—
uint8_t attrForPrints (const CharCursor &pos, const Colors &desired) const
 Calculate the attr to put at POS for getting DESIRED colors there. More...
 
uint8_t attrForPrints (size_t offset, const Colors &desired) const
 Calculate the attr to put at (offset) for getting DESIRED colors there. More...
 
void setTextCursor (const CharCursor &pos)
 Set the cursor for printing at the given flat model coordinates. More...
 
const CharCursorgetTextCursor (void) const noexcept
 Get the current cursor position for printing in flat model coordinates. More...
 
void put (uint8_t c)
 Calculate the attr to put at POS for getting DESIRED colors there. More...
 
void putChar (const uint8_t *d)
 Put the 1-char bitmap D (8 bytes) exactly as in put(). More...
 
size_t print (const std::string &txt, size_t printmax=0)
 Calculate the attr to put at POS for getting DESIRED colors there. More...
 
size_t printSize (const std::string &txt, CharCursor &cur, CharArea &area, size_t &nscrlls) const
 Do a fake printing of TXT at position CUR to calculate printing size. More...
 
Screenoperator<< (const std::string &txt)
 Calculate the attr to put at POS for getting DESIRED colors there. More...
 
Screenoperator<< (uint8_t c)
 Calculate the attr to put at POS for getting DESIRED colors there. More...
 
Screenoperator<< (const CharCursor &at)
 Calculate the attr to put at POS for getting DESIRED colors there. More...
 
Screenoperator<< (Paper p)
 Calculate the attr to put at POS for getting DESIRED colors there. More...
 
Screenoperator<< (Ink i)
 Calculate the attr to put at POS for getting DESIRED colors there. More...
 
Screenoperator<< (Bright b)
 Calculate the attr to put at POS for getting DESIRED colors there. More...
 
Screenoperator<< (Flash f)
 Calculate the attr to put at POS for getting DESIRED colors there. More...
 
Screenoperator<< (Inverse i)
 Calculate the attr to put at POS for getting DESIRED colors there. More...
 
Screenoperator<< (Over o)
 Calculate the attr to put at POS for getting DESIRED colors there. More...
 
void printRectangle (const CharRect &rect, char c, const Colors *cmc=nullptr)
 Fill the given rectangle with the given char with given colors. More...
 
-----------------— Text input ---------------------------—
bool flatInput_printItem (const std::string &item)
 Callback needed for doing input in the flat model version. More...
 
void input (std::string &res, const InputCallbacks &callbacks, const CharCursor &pos, const Colors &c0, const Keyboard &k0, bool withquotes, CharDist maxscrolls, size_t maxlen=0, const Beep &b=Beep{})
 Do input like the ZX, storing the resulting string into RES. More...
 
-----------------— Drawing methods -----------------------—
bool validPixel (const PixCursor &pos) const noexcept
 < Return TRUE if the given coordinates are inside the bitmap. More...
 
bool point (const PixCursor &pos) const
 Return TRUE if the given pixel has ink color; otherwise return FALSE. More...
 
void plot (const PixCursor &pos, const Colors *cmc=nullptr)
 Equivalent to the original Spectrum BASIC plot command. More...
 
const PixCursorlastPlot (void) const noexcept
 Return the coordinates of the last plot. More...
 
void draw (IntDist incx, IntDist incy, const Colors *cmc=nullptr)
 Draw a straight line. More...
 
void draw (IntDist incx, IntDist incy, double arc, const Colors *cmc=nullptr)
 Draw an arc with current colors and modes. More...
 
void circle (const PixCursor &center, PixelDist r, const Colors *cmc=nullptr)
 Draw a circle. More...
 
void rectangle (const PixRect &rect, const Colors *cmc=nullptr)
 Draw a 1-pixel thick rectangular contour. More...
 
using ExpandToken = std::function< std::string(uint8_t c)>
 User's routine that must expand a given token code into the token text. More...
 
static const ExpandToken kInvExpandToken
 Expand token routine that always generates CHRINVALID as expansion. More...
 
static const ExpandToken kNudeExpandToken
 Expand token that return token text without trailing/leading spaces. More...
 
static constexpr size_t kFontSize
 Size in bytes of all bitmaps of a font. More...
 

Member Typedef Documentation

◆ ExpandToken

using zxeco::Screen::ExpandToken = std::function< std::string(uint8_t c)>

User's routine that must expand a given token code into the token text.

Definition at line 95 of file ZXScreen.h.

Constructor & Destructor Documentation

◆ Screen() [1/4]

zxeco::Screen::Screen ( const CharArea dimensions = {SCREENCOLSSCREENROWS},
const ExpandToken  expandtoken = kInvExpandToken 
)

Default constructor with given dimensions (cannot be empty area).

Construct a Screen with the given dimensions and do CLS(). The border is initially WHITE and the content is filled with the color definition given by AttrColors{} dflt constructor. The printing cursor is at (0,0) in flat model coordinates (i.e., top-left & towards bottom and right when increasing), and so the last plot coordinates. EXPANDTOKEN will be called in print and input whenever a token code must be transformed into text.

◆ Screen() [2/4]

zxeco::Screen::Screen ( Screen oth,
const CharRect region,
const ExpandToken  expandtoken = kInvExpandToken 
)

Constructor of a subscreen covering a (non-empty area) region of anothr.

DO NOT DO CLS() or any modification of BITMAP/ATTRMAP in this ctor. In this case, the destructor of Screen will not delete the external bitmap/attrmap. The rest of parameters are like in the default constructor. BITMAP and ATTRMAP must have enough room for the bitmap/attrmap; this constructor and the rest of the class does not check that. Also, both memory areas can be modified when the Screen is. DO NOT DO CLS() or any modification of OTH bitmap/attrmap in this ctor. A subscreen refers to a region of another screen (OTH, that must outlive this one) and redirects all its operation to that region. If the region is empty, a region covering the entire OTH is used. If the region does not lies within OTH, throws.

◆ Screen() [3/4]

zxeco::Screen::Screen ( const Screen )
delete

Default constructor with given dimensions (cannot be empty area).

Construct a Screen with the given dimensions and do CLS(). The border is initially WHITE and the content is filled with the color definition given by AttrColors{} dflt constructor. The printing cursor is at (0,0) in flat model coordinates (i.e., top-left & towards bottom and right when increasing), and so the last plot coordinates. EXPANDTOKEN will be called in print and input whenever a token code must be transformed into text.

◆ Screen() [4/4]

zxeco::Screen::Screen ( Screen &&  )
delete

Default constructor with given dimensions (cannot be empty area).

Construct a Screen with the given dimensions and do CLS(). The border is initially WHITE and the content is filled with the color definition given by AttrColors{} dflt constructor. The printing cursor is at (0,0) in flat model coordinates (i.e., top-left & towards bottom and right when increasing), and so the last plot coordinates. EXPANDTOKEN will be called in print and input whenever a token code must be transformed into text.

Member Function Documentation

◆ printArea()

static std::pair< CharArea, size_t > zxeco::Screen::printArea ( const CharArea area,
const std::string &  txt,
const ExpandToken expandtoken = kNudeExpandToken 
)
static

Return the space occupied by TXT if printed at (0,0) within AREA.

Create a dummy Screen of the same size as AREA and do the printing (the dummy screen does not occupy room in memory). Return an empty area in the first element if TXT is empty, or an area that covers in height the entire used height of the printing and in width the width of AREA. The second element in the pair is the length in printed chars of TXT. TXT may contain any control chars.

◆ areaForPrint()

static CharArea zxeco::Screen::areaForPrint ( const std::string &  txt,
const ExpandToken expandtoken = kNudeExpandToken 
)
inlinestatic

Fill from the given address the ZX original 32-127 character bitmaps.

Parameters
expandtokenCalculate the bounding area needed to print TXT. It does a dummy print on a screen of maximum size (considering the types of the char coordinates), through printArea(), which does not consume any memory for that screen.

Definition at line 259 of file ZXScreen.h.

◆ operator=() [1/2]

Screen & zxeco::Screen::operator= ( const Screen )
delete

Default constructor with given dimensions (cannot be empty area).

Construct a Screen with the given dimensions and do CLS(). The border is initially WHITE and the content is filled with the color definition given by AttrColors{} dflt constructor. The printing cursor is at (0,0) in flat model coordinates (i.e., top-left & towards bottom and right when increasing), and so the last plot coordinates. EXPANDTOKEN will be called in print and input whenever a token code must be transformed into text.

◆ operator=() [2/2]

Screen & zxeco::Screen::operator= ( Screen &&  )
delete

Default constructor with given dimensions (cannot be empty area).

Construct a Screen with the given dimensions and do CLS(). The border is initially WHITE and the content is filled with the color definition given by AttrColors{} dflt constructor. The printing cursor is at (0,0) in flat model coordinates (i.e., top-left & towards bottom and right when increasing), and so the last plot coordinates. EXPANDTOKEN will be called in print and input whenever a token code must be transformed into text.

◆ info()

const DoubleArea & zxeco::Screen::info ( void  ) const
inlinenoexcept

Return a read-only reference to the info of this Screen.

Definition at line 322 of file ZXScreen.h.

◆ expandToken()

const ExpandToken & zxeco::Screen::expandToken ( void  ) const
inlinenoexcept

Return a read-only reference to the expand token routine.

Definition at line 325 of file ZXScreen.h.

◆ entireCharArea()

CharArea zxeco::Screen::entireCharArea ( void  ) const
inline

Return a CharArea covering the whole screen.

Definition at line 328 of file ZXScreen.h.

◆ entireCharRect()

CharRect zxeco::Screen::entireCharRect ( void  ) const
inline

Return a CharRect covering the whole screen.

You can get a PixRect or a CharPixRect from the CharRect using the getPixRect() or getCharPixRect() functions, respectively.

Definition at line 331 of file ZXScreen.h.

◆ subRegion()

const CharRect & zxeco::Screen::subRegion ( void  ) const
inlinenoexcept

Return the region within a containing Screen, or empty if not contained.

Definition at line 336 of file ZXScreen.h.

◆ inside()

bool zxeco::Screen::inside ( const CharRect r) const
inlinenoexcept

< Return TRUE if the given rectangle is inside the screen entirely.

Definition at line 339 of file ZXScreen.h.

◆ cls()

void zxeco::Screen::cls ( void  )

Clear the Screen by putting all bitmap to 0 and attrs as current color.

Use current colors and modes, and set the printing cursor to 0,0 and the last plot to 0,0, both in flat model coordinates.

Note
-Like in the original ZX, inverse and over are not taken into account for cls(), but only paper, ink, bright and flash. Paper or ink can use special color CONTRAST, but, unlike the original ZX, TRANSPARENT will leave the previous attribute values (the bitmap content is cleared anyway).
-Like in the original ZX, CLS is not done by printing spaces (whose bitmaps could be changed by the user by setting a different charset), but with a faster filling of zero bytes in the screen.

◆ scrollUp()

void zxeco::Screen::scrollUp ( PixelDist  howmany = 8,
PixelCoord  upperrow = 0 
)

Scroll the bitmap HOWMANY pixels up from UPPERROW, & maybe the attrmap.

If HOWMANY is 0 or >= the height of the bitmap, do nothing. UPPERROW indicates the highest row (i.e., the one with smallest y-coord) that is scrolled up; rows higher than that will not be scrolled, but can be overwritten by lower rows that are scrolled (depending on HOWMANY). If UPPERROW >= the height of the bitmap, no scroll is done.

The new pixel rows appearing below the scroll are filled with 0.

If HOWMANY and UPPERROW are multiple of 8, also scroll up the attrmap accordingly, by calling scrollUpAttrmap() at the end; otherwise, no effect occurs on the attrmap.

No effect will be produced on the current text printing cursor.

◆ scrollUpAttrs()

void zxeco::Screen::scrollUpAttrs ( CharDist  howmany = 1,
CharCoord  upperrow = 0 
)

Scroll HOWMANY rows of chars in the attrmap starting at UPPERROW.

If HOWMANY is 0 or >= the height of the attrmap, do nothing. UPPERROW indicates the highest row (i.e., the one with smallest y-coord) that is scrolled up; rows higher than that will not be scrolled, but can be overwritten by lower rows that are scrolled (depending on HOWMANY). If UPPERROW >= height of the attrmap, no scroll is done.

The attributes for the cleared rows in the bottom are taken from the current colors and modes applied on the first column of the last row of the screen, i.e., if those colors and modes have no contrast or transparent, they are used directly, but if they have contrast or transparent, the contrast or transparent is turned into a basic color by using it at the last row.

There will be no effect in the bitmap.

◆ setBorder()

void zxeco::Screen::setBorder ( BasicColor  c)
inlinenoexcept

Change the border color.

Definition at line 399 of file ZXScreen.h.

◆ border()

BasicColor zxeco::Screen::border ( void  ) const
inlinenoexcept

Get the current border color.

Definition at line 402 of file ZXScreen.h.

◆ colors()

Colors & zxeco::Screen::colors ( void  )
inlinenoexcept

Get reference to the current colors that can be used to write and read.

Definition at line 405 of file ZXScreen.h.

◆ graphic() [1/2]

DoubleGraphic & zxeco::Screen::graphic ( void  )
inlinenoexcept

Return a reference to the bitmap + attrmap of this Screen.

Definition at line 421 of file ZXScreen.h.

◆ graphic() [2/2]

const DoubleGraphic & zxeco::Screen::graphic ( void  ) const
inlinenoexcept

Return a const reference to the bitmap + attrmap of this Screen.

Definition at line 424 of file ZXScreen.h.

◆ currentFontBitmap()

const uint8_t * zxeco::Screen::currentFontBitmap ( void  ) const
inlinenoexcept

Return the current font bitmap, or nullptr if it is the ZX original one.

Definition at line 433 of file ZXScreen.h.

◆ changeFontBitmap()

void zxeco::Screen::changeFontBitmap ( const uint8_t *  pfont)
inlinenoexcept

Change the bitmap for the font used to print characters 32-127.

No copy of the content of PFONT is done inside the screen. PFONT will be used as the bitmap for characters (see the Bitmap constructor). Unlike the CHARS sysvar in ZX BASIC, the PFONT address is not substracted 256; it must point to the bitmap of the space character. If PFONT is nullptr, a default font is used. Otherwise, *PFONT must outlive this object, since no copy of the font is done.

Note
-The charset must exist in memory contiguously, i.e., no wrap around is performed to emulate the 64K wrap around of the original ZX when the charset goes beyond 64K.

Definition at line 436 of file ZXScreen.h.

◆ copyFontBitmap()

void zxeco::Screen::copyFontBitmap ( uint8_t *  dest) const

Copy all the characters from the current font bitmap into DEST.

If the current font is nullptr, the original ZX charset is copied. DEST must have space for kFontSize bytes.

◆ currentUDGsBitmap()

const uint8_t * zxeco::Screen::currentUDGsBitmap ( void  ) const
inlinenoexcept

Return the current UDGs bitmap, or nullptr if it is the ZX original one.

Definition at line 454 of file ZXScreen.h.

◆ changeUDGsBitmap()

void zxeco::Screen::changeUDGsBitmap ( const uint8_t *  pudgs)
inlinenoexcept

Set to PUDGS the memory address where UDGs are defined.

A nullptr will produce default UDGs when printing. *PUDGS must outlive this object otherwise, since no copy of the UDGs is done. Notice that this class does not deal with 64KB wrapping in the set of UDG bitmaps.

Definition at line 457 of file ZXScreen.h.

◆ recognizeCharInFont()

uint8_t zxeco::Screen::recognizeCharInFont ( const Bitmap charbitmap,
uint8_t  howmany = CHRFIRSTGB - CHRSPC,
bool  evenwithinv = true 
) const

Return the ASCII code of a char in the current font that has that bitmp.

Return the ASCII code in the font (from 32 for space to 127 to copyright) of the character with coinciding bitmap, or return 0 value if none is recognized. If EVENWITHINV and the recognized char is in inverse form, set the most significant bit of the result to 1.

Parameters
charbitmapmust be a 1x8 graphic with the bitmap of the char.
howmanyindicates how many chars to consider in the font. It must be <= CHRFIRSTGB - CHRSPC (96).
evenwithinvrecognizes the given char in its inverse form if it is true; otherwise it does only recognizes it in its normal form.
Note
-No wrap around in 64KB of RAM is done by this method on the font set; HOWMANY chars in the font are considered to be contiguously stored.

◆ recognizeCharInGrBlocks()

uint8_t zxeco::Screen::recognizeCharInGrBlocks ( const Bitmap charbitmap) const

The same as recognizeCharInFont() but for a ZX graphic block.

Graphic blocks are the ones in the numbered keys of the ZX keyboard. This method returns the ASCII code of the graphic block recognized, or 0 if not recognized.

◆ attrForPrints() [1/2]

uint8_t zxeco::Screen::attrForPrints ( const CharCursor pos,
const Colors desired 
) const

Calculate the attr to put at POS for getting DESIRED colors there.

Return the attr that must be put at the character corresponding to the cell POS if the desired colors and modes are DESIRED, i.e., taking into account transparencies and contrasts. POS must be within screen; otherwise, an exception is raised. Use the flat model coordinates. The procedure to calculate the attribute is explained in the adjustByExisting() method of the AttrColors class.

◆ attrForPrints() [2/2]

uint8_t zxeco::Screen::attrForPrints ( size_t  offset,
const Colors desired 
) const

Calculate the attr to put at (offset) for getting DESIRED colors there.

The procedure to calculate the attribute is explained in the adjustByExisting() method of the AttrColors class.

◆ setTextCursor()

void zxeco::Screen::setTextCursor ( const CharCursor pos)
inline

Set the cursor for printing at the given flat model coordinates.

Do not raise an exception if outside the screen; if the y coordinate is outside the screen, the next print will produce as many scrolls as needed to disclose the affected area, and if the x coordinate is outside the screen the next printed char will be at the next line to the left.

Note
-This behaviour is mostly the same as in the original ZX, except for the coordinate system (flat model).

Definition at line 507 of file ZXScreen.h.

◆ getTextCursor()

const CharCursor & zxeco::Screen::getTextCursor ( void  ) const
inlinenoexcept

Get the current cursor position for printing in flat model coordinates.

Definition at line 516 of file ZXScreen.h.

◆ put()

void zxeco::Screen::put ( uint8_t  c)
inline

Calculate the attr to put at POS for getting DESIRED colors there.

Return the attr that must be put at the character corresponding to the cell POS if the desired colors and modes are DESIRED, i.e., taking into account transparencies and contrasts. POS must be within screen; otherwise, an exception is raised. Use the flat model coordinates. The procedure to calculate the attribute is explained in the adjustByExisting() method of the AttrColors class.

Parameters
cPut C at current position with current attrs without updating cursor. The current cursor MUST be within screen; otherwise, an exception is raised. Characters before space or tokens are printed as '?'. The rest are correctly printed.

Definition at line 519 of file ZXScreen.h.

◆ putChar()

void zxeco::Screen::putChar ( const uint8_t *  d)
inline

Put the 1-char bitmap D (8 bytes) exactly as in put().

Definition at line 528 of file ZXScreen.h.

◆ print()

size_t zxeco::Screen::print ( const std::string &  txt,
size_t  printmax = 0 
)
inline

Calculate the attr to put at POS for getting DESIRED colors there.

Return the attr that must be put at the character corresponding to the cell POS if the desired colors and modes are DESIRED, i.e., taking into account transparencies and contrasts. POS must be within screen; otherwise, an exception is raised. Use the flat model coordinates. The procedure to calculate the attribute is explained in the adjustByExisting() method of the AttrColors class.

Parameters
printmaxPrint TXT using the flat model coordinates, doing scrolls if needed. Print the given text in the current cursor position with the current colors, and move the cursor appropriately. Do scroll if necessary. TXT can contain control ascii codes (see zxString() function). Return the number of one-row scrolls done during printing. If PRINTMAX > 0, only print up to PRINTMAX characters (not counting any control code, but counting all characters or tokens when deployed).
Note
-Printing a char when the current x coordinate is out of screen will print at the left of the next line (doing scroll if needed). This happens even when the char is a newline control char (i.e., the current row will only advance 1).
-Scroll is done right before printing a character at a position that is out-of-screen in the y-coordinate, scrolling up as many rows as needed to set the cursor position at the last within-screen y coordinate.
-This method does not end by doing a newline (CHRENTER within TXT will insert a newline, though).
-Printing a comma control code will print spaces until the half of the width of the Screen, whatever that width is.
-Color and printing mode control character codes embedded into TXT will affect all further printings, not only this one (unlike in the ZX). For imitating the original ZX behaviour, store and retrieve the current colors and modes with the colors() method.

Definition at line 531 of file ZXScreen.h.

◆ printSize()

size_t zxeco::Screen::printSize ( const std::string &  txt,
CharCursor cur,
CharArea area,
size_t &  nscrlls 
) const

Do a fake printing of TXT at position CUR to calculate printing size.

CUR will be modified as in an actual printing, ending with its position after printing TXT. The number of scrolls (not actually done) will be in NSCRLLS. AREA will be filled with the bounding box of the printing, after doing the scrolls (not counted in the area or in the cursor) and the linear length in chars of the printing will be returned (not counting scrolls).

◆ operator<<() [1/9]

Screen & zxeco::Screen::operator<< ( const std::string &  txt)
inline

Calculate the attr to put at POS for getting DESIRED colors there.

Return the attr that must be put at the character corresponding to the cell POS if the desired colors and modes are DESIRED, i.e., taking into account transparencies and contrasts. POS must be within screen; otherwise, an exception is raised. Use the flat model coordinates. The procedure to calculate the attribute is explained in the adjustByExisting() method of the AttrColors class.

Definition at line 572 of file ZXScreen.h.

◆ operator<<() [2/9]

Screen & zxeco::Screen::operator<< ( uint8_t  c)
inline

Calculate the attr to put at POS for getting DESIRED colors there.

Return the attr that must be put at the character corresponding to the cell POS if the desired colors and modes are DESIRED, i.e., taking into account transparencies and contrasts. POS must be within screen; otherwise, an exception is raised. Use the flat model coordinates. The procedure to calculate the attribute is explained in the adjustByExisting() method of the AttrColors class.

Definition at line 574 of file ZXScreen.h.

◆ operator<<() [3/9]

Screen & zxeco::Screen::operator<< ( const CharCursor at)
inline

Calculate the attr to put at POS for getting DESIRED colors there.

Return the attr that must be put at the character corresponding to the cell POS if the desired colors and modes are DESIRED, i.e., taking into account transparencies and contrasts. POS must be within screen; otherwise, an exception is raised. Use the flat model coordinates. The procedure to calculate the attribute is explained in the adjustByExisting() method of the AttrColors class.

Definition at line 576 of file ZXScreen.h.

◆ operator<<() [4/9]

Screen & zxeco::Screen::operator<< ( Paper  p)
inline

Calculate the attr to put at POS for getting DESIRED colors there.

Return the attr that must be put at the character corresponding to the cell POS if the desired colors and modes are DESIRED, i.e., taking into account transparencies and contrasts. POS must be within screen; otherwise, an exception is raised. Use the flat model coordinates. The procedure to calculate the attribute is explained in the adjustByExisting() method of the AttrColors class.

Definition at line 578 of file ZXScreen.h.

◆ operator<<() [5/9]

Screen & zxeco::Screen::operator<< ( Ink  i)
inline

Calculate the attr to put at POS for getting DESIRED colors there.

Return the attr that must be put at the character corresponding to the cell POS if the desired colors and modes are DESIRED, i.e., taking into account transparencies and contrasts. POS must be within screen; otherwise, an exception is raised. Use the flat model coordinates. The procedure to calculate the attribute is explained in the adjustByExisting() method of the AttrColors class.

Definition at line 580 of file ZXScreen.h.

◆ operator<<() [6/9]

Screen & zxeco::Screen::operator<< ( Bright  b)
inline

Calculate the attr to put at POS for getting DESIRED colors there.

Return the attr that must be put at the character corresponding to the cell POS if the desired colors and modes are DESIRED, i.e., taking into account transparencies and contrasts. POS must be within screen; otherwise, an exception is raised. Use the flat model coordinates. The procedure to calculate the attribute is explained in the adjustByExisting() method of the AttrColors class.

Definition at line 582 of file ZXScreen.h.

◆ operator<<() [7/9]

Screen & zxeco::Screen::operator<< ( Flash  f)
inline

Calculate the attr to put at POS for getting DESIRED colors there.

Return the attr that must be put at the character corresponding to the cell POS if the desired colors and modes are DESIRED, i.e., taking into account transparencies and contrasts. POS must be within screen; otherwise, an exception is raised. Use the flat model coordinates. The procedure to calculate the attribute is explained in the adjustByExisting() method of the AttrColors class.

Definition at line 584 of file ZXScreen.h.

◆ operator<<() [8/9]

Screen & zxeco::Screen::operator<< ( Inverse  i)
inline

Calculate the attr to put at POS for getting DESIRED colors there.

Return the attr that must be put at the character corresponding to the cell POS if the desired colors and modes are DESIRED, i.e., taking into account transparencies and contrasts. POS must be within screen; otherwise, an exception is raised. Use the flat model coordinates. The procedure to calculate the attribute is explained in the adjustByExisting() method of the AttrColors class.

Definition at line 586 of file ZXScreen.h.

◆ operator<<() [9/9]

Screen & zxeco::Screen::operator<< ( Over  o)
inline

Calculate the attr to put at POS for getting DESIRED colors there.

Return the attr that must be put at the character corresponding to the cell POS if the desired colors and modes are DESIRED, i.e., taking into account transparencies and contrasts. POS must be within screen; otherwise, an exception is raised. Use the flat model coordinates. The procedure to calculate the attribute is explained in the adjustByExisting() method of the AttrColors class.

Definition at line 588 of file ZXScreen.h.

◆ printRectangle()

void zxeco::Screen::printRectangle ( const CharRect rect,
char  c,
const Colors cmc = nullptr 
)

Fill the given rectangle with the given char with given colors.

If CMC == nullptr, uses current colors. If the rectangle goes out of the screen, prints what it can. The current text cursor is not modified.

◆ flatInput_printItem()

bool zxeco::Screen::flatInput_printItem ( const std::string &  item)

Callback needed for doing input in the flat model version.

For using it in the input() method, wrap it with your Screen obj:

[& your_screen_obj](const std::string & item) -> bool
{ return(your_screen_obj.flatInput_printItem(item)); }
See also
InputCallbacks, input.

◆ input()

void zxeco::Screen::input ( std::string &  res,
const InputCallbacks callbacks,
const CharCursor pos,
const Colors c0,
const Keyboard k0,
bool  withquotes,
CharDist  maxscrolls,
size_t  maxlen = 0,
const Beep b = Beep{} 
)

Do input like the ZX, storing the resulting string into RES.

This method performs the main loop for doing an input, but it needs a number of helper routines to manage sound, keyboard, etc. See ZXEco::flatInputCallbacks() method to an example of how to define those callbacks.

Parameters
reswill be filled with the input string.
callbacksmust contain all the callback routines needed for the input.
posis the initial cursor position for the input.
c0are the initial colors to use for the input.
k0is the initial state of the keyboard.
withquotesmakes the input to be surrounded by quotes or not.
maxscrollsis the maximum number of scrolls to do during input.
maxlensets a maximum length for the input, or none if it is 0.
bis the sound to do after each key pressing.
See also
InputPutCursorAttrs, InputPrintItem.

◆ validPixel()

bool zxeco::Screen::validPixel ( const PixCursor pos) const
inlinenoexcept

< Return TRUE if the given coordinates are inside the bitmap.

Definition at line 643 of file ZXScreen.h.

◆ point()

bool zxeco::Screen::point ( const PixCursor pos) const

Return TRUE if the given pixel has ink color; otherwise return FALSE.

Raise an exception if POS is outside the screen.

◆ plot()

void zxeco::Screen::plot ( const PixCursor pos,
const Colors cmc = nullptr 
)

Equivalent to the original Spectrum BASIC plot command.

Plot a single point at POS coordinates according to the CMC colors and modes (inverse, over), that are not set as the current colors and modes (i.e., they are temporary). These colors will affect the entire character cell. All of them will be used (paper, ink, etc.) for the plot. If CMC == nullptr, uses the ink, inverse and over from the current colors, and paper, bright and flash from the plotted cell. Also set the last plotted point to the POS coordinates. Raise an exception if POS are outside the screen.

Note
-The original ZX had two ways of doing a plot (or draw or circle), implemented in the ROM routine CLASS-09 (1CBE) that was called just before the plot, draw or circle were executed. This method correspond to the first of them, while the next method is the second:

1) If the command contains embedded color commands, it will use them in all their components (like this method). 2) If it does not, only uses the ink from the global current colors, like the next method (bright, flash and paper will be kept as in the existing attr).

In both cases, inverse and over are taken correctly into accout, either from globals or embedded. The behavior of over and inverse is exactly as in the original ZX:

no over & no inverse    ->  set the pixel to ink (1)
no over & inverse       ->  set the pixel to paper (0)
over & no inverse       ->  complement the pixel
over & inverse          ->  do not modify the pixel (but colors
                            will have an effect)

◆ lastPlot()

const PixCursor & zxeco::Screen::lastPlot ( void  ) const
inlinenoexcept

Return the coordinates of the last plot.

Definition at line 686 of file ZXScreen.h.

◆ draw() [1/2]

void zxeco::Screen::draw ( IntDist  incx,
IntDist  incy,
const Colors cmc = nullptr 
)

Draw a straight line.

Draw a straight line from the last plot coordinates (not included) up to INCX and INCY increments in pixels (inclusive). Ignore any pixel that goes out of screen, instead of producing an error like the original ZX did. Do clipping like the ZX did. The last pixel drawn becomes the last pìxel coordinates for further draws. The management of colors and modes is like in plot().

Note
-The algorithm used is exactly the one of the ZX ROM.
-Since the Y coordinate in the flat model goes in opposite direction to the Y coordinate in the original ZX, INCY will also work in an opposite manner.

◆ draw() [2/2]

void zxeco::Screen::draw ( IntDist  incx,
IntDist  incy,
double  arc,
const Colors cmc = nullptr 
)

Draw an arc with current colors and modes.

As in the ZX, draws an arc for INCX, INCY units, in particular the one corresponding to the circle sector that sustains ARC radians and whose circumference passes through both ending points. ARC can be any number.

Note
-If the radius of the circle is greater than or equal to the largest dimension of the display, a straight line is drawn.
-If ARC is 0 or >= 2*pi or <= -2*pi, a straight line is drawn.
-If ARC is positive, the arc is drawn counterclockwise.
-If ARC is negative the arc is drawn clockwise.
-If INCX == INCY == 0, nothing is drawn.
-If any point to draw lies outside the screen, the drawing is stopped there without producing any error.
-Like the straight line draw, this method plots the last point of the arc but not the first point.
-Since the Y coordinate in the flat model is in opposite direction to the Y coordinate in the original ZX, INCY will work also in an opposite manner.
-The previous notes reflect quite exactly the original ZX behavior of the draw command, but the algorithm used here is not the same (in the ZX ROM the algorithm is based on floating point calculations anyway, thus no special improvement in efficiency was expected of making an exact replica).

◆ circle()

void zxeco::Screen::circle ( const PixCursor center,
PixelDist  r,
const Colors cmc = nullptr 
)

Draw a circle.

Draw a circle with the given data, using the colors like in plot().

Note
-Like the ZX, the circle is started at angle = 0 and drawn counterclockwise.
-The last point plotted becomes the last plot coordinates.
-The first point that lies outside the screen stops the drawing without producing any error.
-The radius must be an absolute (positive) number. If it is 0, a single plot in the center of the circle is performed.
-The algorithm used here is not the same as the one of the original ZX, for the same reasons explained in the draw-arc method.

◆ rectangle()

void zxeco::Screen::rectangle ( const PixRect rect,
const Colors cmc = nullptr 
)

Draw a 1-pixel thick rectangular contour.

If part of the rectangle falls outside the screen, stops at that point. The plotting cursor is changed while drawing, ending at RECT.CORNER if everything is right.

Member Data Documentation

◆ kInvExpandToken

const ExpandToken zxeco::Screen::kInvExpandToken
static

Expand token routine that always generates CHRINVALID as expansion.

Definition at line 98 of file ZXScreen.h.

◆ kNudeExpandToken

const ExpandToken zxeco::Screen::kNudeExpandToken
static

Expand token that return token text without trailing/leading spaces.

Definition at line 101 of file ZXScreen.h.

◆ kFontSize

constexpr size_t zxeco::Screen::kFontSize
staticconstexpr
Initial value:
=
static_cast<size_t>(CHRFIRSTGB - CHRSPC) * 8
constexpr uint8_t CHRFIRSTGB
first graphic-block char
Definition: ZXChars.h:72
constexpr uint8_t CHRSPC
space
Definition: ZXChars.h:43

Size in bytes of all bitmaps of a font.

Definition at line 104 of file ZXScreen.h.

◆ zxeco::Screen::InputCallbacks

struct zxeco::Screen::InputCallbacks

Callbacks used in input.

See also
input.

Definition at line 110 of file ZXScreen.h.

Public Types

using PrintItem = std::function< bool(const std::string &) >
 
using GetNewKeyboard = std::function< void(const Keyboard &, Keyboard &, Membrane &, std::string &) >
 
using Play = std::function< void(const Beep &) >
 
using CheckInput = std::function< bool(const std::string &) >
 

Public Attributes

PrintItem printItem
 Callback to print items in the screen. More...
 
GetNewKeyboard getNewKeyboard
 Callback to get changes in keyboard. More...
 
Play play
 Callback to play keyboard clics. More...
 
CheckInput checkInput
 Callback to check input validity. More...
 

Member Typedef Documentation

◆ PrintItem

using zxeco::Screen::InputCallbacks::PrintItem = std::function< bool(const std::string &) >

Must print an element of the input string at the current cursor. The element will be either an ascii character or a control command, never a token code. Must return TRUE if there is one scroll done.

Definition at line 112 of file ZXScreen.h.

◆ GetNewKeyboard

using zxeco::Screen::InputCallbacks::GetNewKeyboard = std::function< void(const Keyboard &, Keyboard &, Membrane &, std::string &) >

Must wait for a key change in the Keyboard, and then return the new keyboard, the last membrane, and the pressed keys as a string.

See also
Keyboard.

Definition at line 118 of file ZXScreen.h.

◆ Play

using zxeco::Screen::InputCallbacks::Play = std::function< void(const Beep &) >

Must play the given beep.

See also
Beep.

Definition at line 126 of file ZXScreen.h.

◆ CheckInput

using zxeco::Screen::InputCallbacks::CheckInput = std::function< bool(const std::string &) >

Must return TRUE if the given string is a valid input.

Definition at line 131 of file ZXScreen.h.

Member Data Documentation

◆ printItem

PrintItem zxeco::Screen::InputCallbacks::printItem

Callback to print items in the screen.

Definition at line 135 of file ZXScreen.h.

◆ getNewKeyboard

GetNewKeyboard zxeco::Screen::InputCallbacks::getNewKeyboard

Callback to get changes in keyboard.

Definition at line 136 of file ZXScreen.h.

◆ play

Play zxeco::Screen::InputCallbacks::play

Callback to play keyboard clics.

Definition at line 137 of file ZXScreen.h.

◆ checkInput

CheckInput zxeco::Screen::InputCallbacks::checkInput

Callback to check input validity.

Definition at line 138 of file ZXScreen.h.

◆ zxeco::Screen::ScaledTextPrinter

class zxeco::Screen::ScaledTextPrinter
template<unsigned SW, unsigned SH>
class zxeco::Screen::ScaledTextPrinter< SW, SH >

A class for printing with scaled characters.

This prints bitmap chars of an underlying Screen with scaled width and/or height. Attributes and other features of the underlying Screen -including its current text cursor- are unaffected. The printing done by this class is slower and functionally limited w.r.t. the normal print of Screen.

Template Parameters
SWis the scale in width, measured in normal ZX chars width. If it is 0, indicates to scale down to half-width (4 pixels width), and in that case SH must be 1.
SHis the scale in height, measured in normal ZX chars height, i.e., 1 means normal height chars, 2 means twice the height, and so on. It must be > 0.

Definition at line 157 of file ZXScreen.h.

Public Member Functions

 ScaledTextPrinter (Screen &scr, bool perfectchars=true)
 Create a scaled text printer for the given screen; cursor at 0,0. More...
 
 ScaledTextPrinter (const ScaledTextPrinter &)=delete
 
 ScaledTextPrinter (ScaledTextPrinter &&)=delete
 
ScaledTextPrinteroperator= (const ScaledTextPrinter &)=delete
 
ScaledTextPrinteroperator= (ScaledTextPrinter &&)=delete
 Return a reference to the underlying Screen.
 
ScreenunderlyingScreen (void) noexcept
 
const CharAreascaledDimensions (void) const noexcept
 < Return the scaled dimensions of the screen with this printer. More...
 
Colorscolors (void) noexcept
 Return a reference to the current colors to read and write them. More...
 
void setCursor (const CharCursor &stc)
 Put the current scaled cursor at STC or throw if out of screen. More...
 
const CharCursorgetCursor (void) const noexcept
 Return the current scaled cursor. More...
 
PixRect getCursorRect (void) const noexcept
 Return the pixel rectangle of the cursor. More...
 
void print (const std::string &txt)
 Print the given text at the current scaled position. More...
 
void print (const uint8_t *bitmap)
 Print a scaled char with the given bitmap. More...
 

Constructor & Destructor Documentation

◆ ScaledTextPrinter()

template<unsigned SW, unsigned SH>
zxeco::Screen::ScaledTextPrinter< SCW, SCH >::ScaledTextPrinter ( Screen scr,
bool  perfectchars = true 
)

Create a scaled text printer for the given screen; cursor at 0,0.

SCR must outlive this object. PERFECTCHARS indicate whether to use pre-defined scaled chars that look better than the default automatic scaling in the case of scaling down characters to 4-pixel width. Initially, the colours of this printer are taken from the screen, but they can be modified -only for this printer- aftwerwards. The font for characters is taken from the current one in the screen when each character is about to be printed.

Definition at line 1413 of file ZXScreen.h.

Member Function Documentation

◆ underlyingScreen()

template<unsigned SW, unsigned SH>
Screen & zxeco::Screen::ScaledTextPrinter< SW, SH >::underlyingScreen ( void  )
inlinenoexcept

Definition at line 179 of file ZXScreen.h.

◆ scaledDimensions()

template<unsigned SW, unsigned SH>
const CharArea & zxeco::Screen::ScaledTextPrinter< SW, SH >::scaledDimensions ( void  ) const
inlinenoexcept

< Return the scaled dimensions of the screen with this printer.

Definition at line 181 of file ZXScreen.h.

◆ colors()

template<unsigned SW, unsigned SH>
Colors & zxeco::Screen::ScaledTextPrinter< SW, SH >::colors ( void  )
inlinenoexcept

Return a reference to the current colors to read and write them.

Definition at line 185 of file ZXScreen.h.

◆ setCursor()

template<unsigned SW, unsigned SH>
void zxeco::Screen::ScaledTextPrinter< SCW, SCH >::setCursor ( const CharCursor stc)

Put the current scaled cursor at STC or throw if out of screen.

Definition at line 1434 of file ZXScreen.h.

◆ getCursor()

template<unsigned SW, unsigned SH>
const CharCursor & zxeco::Screen::ScaledTextPrinter< SW, SH >::getCursor ( void  ) const
inlinenoexcept

Return the current scaled cursor.

Definition at line 191 of file ZXScreen.h.

◆ getCursorRect()

template<unsigned SW, unsigned SH>
PixRect zxeco::Screen::ScaledTextPrinter< SCW, SCH >::getCursorRect ( void  ) const
noexcept

Return the pixel rectangle of the cursor.

Definition at line 1442 of file ZXScreen.h.

◆ print() [1/2]

template<unsigned SW, unsigned SH>
void zxeco::Screen::ScaledTextPrinter< SCW, SCH >::print ( const std::string &  txt)

Print the given text at the current scaled position.

Current colours of this printer object are used for the printing without changing the ones in the Screen (the Screen cursor is not changed either). Control chars, tokens, and UDGs are printed as CHRINVALID. Graphic blocks are allowed. Scrolls are not performed (when the end of the screen is reached, the rest of the text is ignored). The scaled cursor is updated after printing.

Definition at line 1462 of file ZXScreen.h.

◆ print() [2/2]

template<unsigned SW, unsigned SH>
void zxeco::Screen::ScaledTextPrinter< SCW, SCH >::print ( const uint8_t *  bitmap)

Print a scaled char with the given bitmap.

Definition at line 1553 of file ZXScreen.h.

◆ zxeco::BASICScreen

class zxeco::BASICScreen

This class decorates Screen to get the original BASIC screen model of the ZX.

Internally, the screen data is stored as in the Screen class, i.e., in a flat, linear layout in memory, though the data can be transferred to/from other non-flat layouts using the flat*() and nonFlat*() methods. Those methods, however, will consider a flat layout in both sides -not doing any transformation- if the BASICScreen display has dimensions different from the ones in the original ZX.

On a higher abstraction level, instead of the flat coordinate model, this class provides channels 'K' and 'S', specialized inputs in 'K', and the same coordinate axes as in the original ZX.

The text cursor coordinates can be outside the corresponding channel area. Only when an attempt of printing a char at those places occurs is when this class adjusts the cursor by moving to the next line and/or doing necessary scrolls.

The underlying Screen can be manipulated outside this class, but the flat state in that Screen is not guaranteed to be synchronized with the state here at any moment (i.e., cursor positions, current colors, etc.)

Behaviour of channels S and K in the original ZX:

(https://faqwiki.zxnet.co.uk/wiki/Channels_and_streams)

Valid streams are from 0 to 15.

#0 is the input/output stream, associated to channel "K", in the lower 
    screen, rows 22-23 inclusive at the start.
#1 is also associated to "K".
#2 is output-only stream, associated to channel "S", in the upper screen, 
    rows 0-21 inclusive at the start.
#3 is output-only printing stream, associated to channel "P", i.e., it is 
    the one used implicitly by LPRINT, etc.

CLS is the command that clears "K" and "S", filling the former with the border color as paper and contrast color as ink and the latter as the user has established in the global colors.

System messages are always printed at the bottom line of the screen, within the "K" channel, at column 0.

Printing/inputting at channel "K" starts at line 23 (not 22) and may scroll upwards consuming space from channel "S" (scrolling up the content of channel "S" ONLY IF THE GROWING OF "K" reaches the current row to print in "S"; otherwise "K" overwrites the bottom part of "S" without scrolling it). Scroll of the "K" channel cannot go beyond the size of the screen (it produces out of screen error).

The original 2-rows size of "K" is restored by CLS, by starting the execution of INPUT and also by the system printing any message.

Printing at channel "S" at a row that is currently occupied by channel "K", with AT, produces an out of screen error. If the printing is not explicit, but reaches that limit by accumulating other printings, a scroll message is shown (as always, in line 23, where all messages are shown) and, when the user press to scroll (any key but space), the clearing of the message produces a reset of the "K" space to its original 2-rows size before doing the scroll, and then, the pending printing at "S" is done at line 21, the last one of the restored "S" space (having cleared a number of lines in "S" previously occupied by "K").

Note
-This is a decorator pattern and not an adaptor, facade or proxy because it adds functionality: https://javarevisited.blogspot.com/2015/01/adapter-vs-decorator-vs-facade-vs-proxy-pattern-java.html
See also
Screen

Definition at line 911 of file ZXScreen.h.

Static Public Member Functions

static void checkChannel (char c, const std::string &place="")
 

Public Member Functions

 BASICScreen (Screen &scr, const KeyWait &keywait=[](void) -> Keyboard { return(Keyboard{});})
 Constructor: decorates an existing Screen object. More...
 
 BASICScreen (const BASICScreen &)=delete
 Constructor: decorates an existing Screen object. More...
 
 BASICScreen (BASICScreen &&)=delete
 Constructor: decorates an existing Screen object. More...
 
BASICScreenoperator= (const BASICScreen &)=delete
 Constructor: decorates an existing Screen object. More...
 
BASICScreenoperator= (BASICScreen &&)=delete
 Constructor: decorates an existing Screen object. More...
 
virtual ~BASICScreen (void)=default
 Constructor: decorates an existing Screen object. More...
 
size_t flatBitmap (size_t offset) const
 Return a bitmap offset in the flat model given the non-flat one. More...
 
size_t flatAttrmap (size_t offset) const
 Return an attrmap offset in the flat model given the non-flat one. More...
 
CharCursor flatTextCoords (char channel, const CharCursor &pos) const
 Return a version of POS (that corresponds to CHANNEL) in the flat model. More...
 
PixCursor flatPixelCoords (const PixCursor &pos) const
 Return a version of POS in the flat model. More...
 
size_t nonflatBitmap (size_t offset) const
 Return a bitmap offset in the non-flat model given the flat one. More...
 
size_t nonflatAttrmap (size_t offset) const
 Return an attrmap offset in the non-flat model given the flat one. More...
 
CharCursor nonflatTextCoords (char channel, const CharCursor &pos) const
 Return POS transformed from flat model to the given channel. More...
 
PixCursor nonflatPixelCoords (const PixCursor &pos) const
 Return POS transformed from flat into non-flat coords. More...
 
Screenflat (void) const
 Return a reference to the underlying flat screen. *‍/. More...
 
void reset (void)
 Set the K and S channels to their initial cursors and sizes, as in CLS. More...
 
void resetChannelK (void)
 Reset cursors, size and contents of channel K to its initial values. More...
 
CharDist scrollCnt (void) const noexcept
 Return how many scrolls will be done (+1) before asking. More...
 
void setScrollCnt (CharDist newcnt)
 Change to NEWCNT the current count of scrolls to do wihout asking. More...
 
void fillKColors (BasicColor b, Colors &colors) const
 Fill COLORS with colors for K channel calculated from border color B. More...
 
void changeGlobalColors (char channel, const Colors &newcols)
 Change the global colors in the given channel to NEWCOLS.
 
void getGlobalColors (char channel, Colors &colors) const
 Fill COLS with a copy of the global colors in the given channel. More...
 
void restoreGlobalColors (char channel)
 Set the current, local colors in the channel to the global ones.
 
void changeChannel (char c)
 Set current channel to C (either 'K' or 'S') without changing cursor. More...
 
char getChannel (void) const
 Return the current channel. More...
 
void setTextCursor (char channel, const CharCursor &pos)
 Set the channel to CHANNEL and put the cursor where requested. More...
 
CharCursor getTextCursor (char ch=0x00) const
 Return the non-flat text cursor of the given channel ('S' or 'K'). More...
 
bool columnAtLeft (void) const
 TRUE if the current non-flat column at the current channel is at left. More...
 
ScrollInfo print (const std::string &txt)
 Print a string, possibly containing ctrl chars, in the current channel. More...
 
void moveNewLine (void)
 Move text cursor to a new line without printing CHRENTER. More...
 
void plot (const PixCursor &pos, const Colors *cmc=nullptr)
 Plot the given point using original, non-flat ZX plot coordinates. More...
 
void draw (IntDist incx, IntDist incy, const Colors *cmc=nullptr)
 Draw the given line using original, non-flat ZX plot increments. More...
 
void draw (IntDist incx, IntDist incy, double arc, const Colors *cmc=nullptr)
 Draw the given arc using original, non-flat ZX plot increments. More...
 
void circle (const PixCursor &center, PixelDist r, const Colors *cmc=nullptr)
 Draw the given circle using original, non-flat ZX plot coordinates. More...
 
bool point (const PixCursor &pos) const
 < Return TRUE if the given point is on or FALSE if it is off. More...
 
bool originalInput_printItem (const std::string &txt)
 Callback routine for using in Screen::input() that respects this model. More...
 
std::string input (bool withquotes, const Keyboard &k0, const Screen::InputCallbacks::GetNewKeyboard &cbk, const Screen::InputCallbacks::Play &cbp, const Screen::InputCallbacks::CheckInput &cnci)
 Do input in the original mode. More...
 
std::string to_string (void) const
 Return a text with info about the current state of the decorator. More...
 
using KeyWait = std::function< Keyboard(void) >
 Routine that waits for a key press and return the resulting keyboard. More...
 
static const CharDist kInitialRowsK = 2
 Number of character rows initially in the K channel. More...
 
static const PixelDist kInitialHeightK = charDistToPixelDist(kInitialRowsK)
 Number of pixel rows initially in the K channel. More...
 

Member Typedef Documentation

◆ KeyWait

using zxeco::BASICScreen::KeyWait = std::function < Keyboard (void) >

Routine that waits for a key press and return the resulting keyboard.

Definition at line 918 of file ZXScreen.h.

Constructor & Destructor Documentation

◆ BASICScreen() [1/3]

zxeco::BASICScreen::BASICScreen ( Screen scr,
const KeyWait keywait = [](void) -> Keyboard { return(Keyboard{});} 
)

Constructor: decorates an existing Screen object.

This method also initiates the channels.

Parameters
scris the underlying Screen that is decorated. It must outlive this object.
keywaitis a routine that must wait for no-key, then must wait for key, then must wait for no-key, and finally return the last keyboard state in order to read the last key pressed. See for instance the method ZXEco::waitOneKey(). The default one does no waitings; just returns a new keyboard. This routine is used for waiting for a key when a scroll message is printed; if the routine return no-pressing, as in the default one, there will be an exception at calling it.

◆ BASICScreen() [2/3]

zxeco::BASICScreen::BASICScreen ( const BASICScreen )
delete

Constructor: decorates an existing Screen object.

This method also initiates the channels.

Parameters
scris the underlying Screen that is decorated. It must outlive this object.
keywaitis a routine that must wait for no-key, then must wait for key, then must wait for no-key, and finally return the last keyboard state in order to read the last key pressed. See for instance the method ZXEco::waitOneKey(). The default one does no waitings; just returns a new keyboard. This routine is used for waiting for a key when a scroll message is printed; if the routine return no-pressing, as in the default one, there will be an exception at calling it.

◆ BASICScreen() [3/3]

zxeco::BASICScreen::BASICScreen ( BASICScreen &&  )
delete

Constructor: decorates an existing Screen object.

This method also initiates the channels.

Parameters
scris the underlying Screen that is decorated. It must outlive this object.
keywaitis a routine that must wait for no-key, then must wait for key, then must wait for no-key, and finally return the last keyboard state in order to read the last key pressed. See for instance the method ZXEco::waitOneKey(). The default one does no waitings; just returns a new keyboard. This routine is used for waiting for a key when a scroll message is printed; if the routine return no-pressing, as in the default one, there will be an exception at calling it.

◆ ~BASICScreen()

virtual zxeco::BASICScreen::~BASICScreen ( void  )
virtualdefault

Constructor: decorates an existing Screen object.

This method also initiates the channels.

Parameters
scris the underlying Screen that is decorated. It must outlive this object.
keywaitis a routine that must wait for no-key, then must wait for key, then must wait for no-key, and finally return the last keyboard state in order to read the last key pressed. See for instance the method ZXEco::waitOneKey(). The default one does no waitings; just returns a new keyboard. This routine is used for waiting for a key when a scroll message is printed; if the routine return no-pressing, as in the default one, there will be an exception at calling it.

Member Function Documentation

◆ checkChannel()

static void zxeco::BASICScreen::checkChannel ( char  c,
const std::string &  place = "" 
)
inlinestatic
Parameters
placeCheck validity of the channel and throws if invalid. Include PLACE as a text in the error.

Definition at line 960 of file ZXScreen.h.

◆ operator=() [1/2]

BASICScreen & zxeco::BASICScreen::operator= ( const BASICScreen )
delete

Constructor: decorates an existing Screen object.

This method also initiates the channels.

Parameters
scris the underlying Screen that is decorated. It must outlive this object.
keywaitis a routine that must wait for no-key, then must wait for key, then must wait for no-key, and finally return the last keyboard state in order to read the last key pressed. See for instance the method ZXEco::waitOneKey(). The default one does no waitings; just returns a new keyboard. This routine is used for waiting for a key when a scroll message is printed; if the routine return no-pressing, as in the default one, there will be an exception at calling it.

◆ operator=() [2/2]

BASICScreen & zxeco::BASICScreen::operator= ( BASICScreen &&  )
delete

Constructor: decorates an existing Screen object.

This method also initiates the channels.

Parameters
scris the underlying Screen that is decorated. It must outlive this object.
keywaitis a routine that must wait for no-key, then must wait for key, then must wait for no-key, and finally return the last keyboard state in order to read the last key pressed. See for instance the method ZXEco::waitOneKey(). The default one does no waitings; just returns a new keyboard. This routine is used for waiting for a key when a scroll message is printed; if the routine return no-pressing, as in the default one, there will be an exception at calling it.

◆ flatBitmap()

size_t zxeco::BASICScreen::flatBitmap ( size_t  offset) const

Return a bitmap offset in the flat model given the non-flat one.

The returned offset is in [0,bitmap.size-1]. This method does not affect the content of the screen in any way; it only reads its dimensions. Throw if the offset is out of range.

Parameters
offsetmust be in [0,bitmap.size-1].

◆ flatAttrmap()

size_t zxeco::BASICScreen::flatAttrmap ( size_t  offset) const
inline

Return an attrmap offset in the flat model given the non-flat one.

The returned offset is in [0,attrmap.size-1]. This method does not affect the content of the screen in any way; it only reads its dimensions. Throw if the offset is out of range.

Parameters
offsetmust be in [0,attrmap.size-1].

Definition at line 1010 of file ZXScreen.h.

◆ flatTextCoords()

CharCursor zxeco::BASICScreen::flatTextCoords ( char  channel,
const CharCursor pos 
) const

Return a version of POS (that corresponds to CHANNEL) in the flat model.

In the 'K' channel, Y == 0 indicates the current top line of that bottom area. Throw if the channel is invalid. This method does not throws any error if coords are out of the channel area.

◆ flatPixelCoords()

PixCursor zxeco::BASICScreen::flatPixelCoords ( const PixCursor pos) const

Return a version of POS in the flat model.

Throw if the coords are out of the screen.

◆ nonflatBitmap()

size_t zxeco::BASICScreen::nonflatBitmap ( size_t  offset) const

Return a bitmap offset in the non-flat model given the flat one.

The returned offset is in [0,bitmap.size-1]. This method does not affect the content of the screen in any way; it only reads its dimensions. Throw if the offset is out of range.

Parameters
offsetmust be in [0,bitmap.size-1].

◆ nonflatAttrmap()

size_t zxeco::BASICScreen::nonflatAttrmap ( size_t  offset) const
inline

Return an attrmap offset in the non-flat model given the flat one.

The returned offset is in [0,attrmap.size-1]. This method does not affect the content of the screen in any way; it only reads its dimensions. Throw if the offset is out of range.

Parameters
offsetmust be in [0,attrmap.size-1].

Definition at line 1039 of file ZXScreen.h.

◆ nonflatTextCoords()

CharCursor zxeco::BASICScreen::nonflatTextCoords ( char  channel,
const CharCursor pos 
) const

Return POS transformed from flat model to the given channel.

In the 'K' channel, Y == 0 indicates the current top line of that bottom area. Throw if the channel is invalid.

◆ nonflatPixelCoords()

PixCursor zxeco::BASICScreen::nonflatPixelCoords ( const PixCursor pos) const

Return POS transformed from flat into non-flat coords.

Throw if the coords are out of screen.

◆ flat()

Screen & zxeco::BASICScreen::flat ( void  ) const
inline

Return a reference to the underlying flat screen. *‍/.

Definition at line 1060 of file ZXScreen.h.

◆ reset()

void zxeco::BASICScreen::reset ( void  )

Set the K and S channels to their initial cursors and sizes, as in CLS.

The colors used are the global ones, thus you must change them before. This method clears the screen as in CLS; actually, it should be called anytime you want a CLS, CLEAR or RUN. This method does not change the current channel.

◆ resetChannelK()

void zxeco::BASICScreen::resetChannelK ( void  )
inline

Reset cursors, size and contents of channel K to its initial values.

Use the global colors for K, that are not reset. This method does not change the current channel.

Definition at line 1070 of file ZXScreen.h.

◆ scrollCnt()

CharDist zxeco::BASICScreen::scrollCnt ( void  ) const
inlinenoexcept

Return how many scrolls will be done (+1) before asking.

This is the analogous to the SCRCNT system variable in the original ZX.

Definition at line 1074 of file ZXScreen.h.

◆ setScrollCnt()

void zxeco::BASICScreen::setScrollCnt ( CharDist  newcnt)
inline

Change to NEWCNT the current count of scrolls to do wihout asking.

Definition at line 1078 of file ZXScreen.h.

◆ fillKColors()

void zxeco::BASICScreen::fillKColors ( BasicColor  b,
Colors colors 
) const

Fill COLORS with colors for K channel calculated from border color B.

See also
scrollCnt().

◆ getGlobalColors()

void zxeco::BASICScreen::getGlobalColors ( char  channel,
Colors colors 
) const

Fill COLS with a copy of the global colors in the given channel.

This must be called anytime a BORDER, INK, PAPER, etc. statement is to be mimicked (not a substatement within a PRINT or INPUT, but a standalone statement).

◆ changeChannel()

void zxeco::BASICScreen::changeChannel ( char  c)

Set current channel to C (either 'K' or 'S') without changing cursor.

It also sets the current colors for the channel to the global ones. Therefore, this method MUST BE CALLED at the beginning of any PRINT or INPUT being mimicked even when that statement does not sets the channel (implicitly, it does set the channel), and also every time a channel substatement ("#...") is to be mimicked, since that substatement restores the global colors in the original ZX. This method does not clear or change channel cursors or sizes.

◆ getChannel()

char zxeco::BASICScreen::getChannel ( void  ) const
inline

Return the current channel.

Definition at line 1119 of file ZXScreen.h.

◆ setTextCursor()

void zxeco::BASICScreen::setTextCursor ( char  channel,
const CharCursor pos 
)

Set the channel to CHANNEL and put the cursor where requested.

POS contains non-flat coordinates. Putting the cursor outside the screen is dealt with as in the flat Screen class: the next print will adjust it to the next line.

◆ getTextCursor()

CharCursor zxeco::BASICScreen::getTextCursor ( char  ch = 0x00) const

Return the non-flat text cursor of the given channel ('S' or 'K').

If CH is 0x00, return the cursor of the current channel.

◆ columnAtLeft()

bool zxeco::BASICScreen::columnAtLeft ( void  ) const
inline

TRUE if the current non-flat column at the current channel is at left.

Definition at line 1132 of file ZXScreen.h.

◆ print()

ScrollInfo zxeco::BASICScreen::print ( const std::string &  txt)

Print a string, possibly containing ctrl chars, in the current channel.

Do the necessary scrolls, asking the user for continuing scrolling if it is the case (using the key waiting routine passed in the constructor). It also updates non-flat cursor.

Note
-Ctrl chars in TXT can modify the current colors used for printing in the current channel. If you need to restore the global ones, you have to call changeChannel(); to change the global colors, use changeGlobalColors().
-If you need to do a ctrl operation separately, not as a part of a string to print (i.e., an INK, PAPER, etc.), form a string with that control using the zxString() function, and then call this.

◆ moveNewLine()

void zxeco::BASICScreen::moveNewLine ( void  )
inline

Move text cursor to a new line without printing CHRENTER.

The difference with printing CHRENTER is that the latter will do scroll if necessary before doing the newline cursor updating. This method does not any scroll, just update the cursor.

Definition at line 1155 of file ZXScreen.h.

◆ plot()

void zxeco::BASICScreen::plot ( const PixCursor pos,
const Colors cmc = nullptr 
)

Plot the given point using original, non-flat ZX plot coordinates.

Uses global S colors if CMC == nullptr.

◆ draw() [1/2]

void zxeco::BASICScreen::draw ( IntDist  incx,
IntDist  incy,
const Colors cmc = nullptr 
)

Draw the given line using original, non-flat ZX plot increments.

Uses global S colors if CMC == nullptr.

◆ draw() [2/2]

void zxeco::BASICScreen::draw ( IntDist  incx,
IntDist  incy,
double  arc,
const Colors cmc = nullptr 
)

Draw the given arc using original, non-flat ZX plot increments.

Uses global S colors if CMC == nullptr.

◆ circle()

void zxeco::BASICScreen::circle ( const PixCursor center,
PixelDist  r,
const Colors cmc = nullptr 
)

Draw the given circle using original, non-flat ZX plot coordinates.

Uses global S colors if CMC == nullptr.

◆ point()

bool zxeco::BASICScreen::point ( const PixCursor pos) const
inline

< Return TRUE if the given point is on or FALSE if it is off.

< Uses original, non-flat ZX plot coordinates.

Definition at line 1184 of file ZXScreen.h.

◆ originalInput_printItem()

bool zxeco::BASICScreen::originalInput_printItem ( const std::string &  txt)

Callback routine for using in Screen::input() that respects this model.

For using it in the Screen::input() method, wrap it with the BASICScreen object:

\code
  [& your_BASICscreen_obj](const std::string & item) -> bool
        { return(your_BASICscreen_obj.originalInput_printItem(item)); }
\endcode
Note
-The rest of callback routines needed by Screen::input() are either defined in Screen (since they are also valid for the flat model) or in ZXEco (since they deal with other components such as the keyboard or the sound).
See also
ZXEco::originalInputCallbacks()

◆ input()

std::string zxeco::BASICScreen::input ( bool  withquotes,
const Keyboard k0,
const Screen::InputCallbacks::GetNewKeyboard cbk,
const Screen::InputCallbacks::Play cbp,
const Screen::InputCallbacks::CheckInput cnci 
)

Do input in the original mode.

Current channel must be 'K'. This method calls the input() method of the underlying flat screen.

Parameters
withquotesis true for printing surrounding quotes in the input.
k0is the initial state of the keyboard.
cbk,cbp,cnciare the callback routines needed for the input.

◆ to_string()

std::string zxeco::BASICScreen::to_string ( void  ) const

Return a text with info about the current state of the decorator.

The text is multiline.

Member Data Documentation

◆ kInitialRowsK

const CharDist zxeco::BASICScreen::kInitialRowsK = 2
static

Number of character rows initially in the K channel.

Definition at line 948 of file ZXScreen.h.

◆ kInitialHeightK

const PixelDist zxeco::BASICScreen::kInitialHeightK = charDistToPixelDist(kInitialRowsK)
static

Number of pixel rows initially in the K channel.

Definition at line 951 of file ZXScreen.h.

◆ zxeco::BASICScreen::ScrollInfo

struct zxeco::BASICScreen::ScrollInfo

Info produced after a scroll or some movements of the text cursor.

Definition at line 922 of file ZXScreen.h.

Public Attributes

bool acceptedScroll
 
size_t howmanyScrolls
 How many one-text-line scrolls were done. More...
 
bool newlineDone
 TRUE if there has been any newline movement. More...
 

Public Member Functions

bool add (const ScrollInfo &si1) noexcept
 < Add the info of SI1 to this, returning the breaking of scrolls. More...
 
std::string to_string (void) const
 < Return a string with the info about this object. More...
 

Constructor & Destructor Documentation

◆ ScrollInfo()

zxeco::BASICScreen::ScrollInfo::ScrollInfo ( void  )
inline

Definition at line 929 of file ZXScreen.h.

Member Function Documentation

◆ add()

bool zxeco::BASICScreen::ScrollInfo::add ( const ScrollInfo si1)
inlinenoexcept

< Add the info of SI1 to this, returning the breaking of scrolls.

Definition at line 933 of file ZXScreen.h.

◆ to_string()

std::string zxeco::BASICScreen::ScrollInfo::to_string ( void  ) const
inline

< Return a string with the info about this object.

Definition at line 940 of file ZXScreen.h.

Member Data Documentation

◆ acceptedScroll

bool zxeco::BASICScreen::ScrollInfo::acceptedScroll

FALSE if there has been an scroll and the user rejected.

Definition at line 924 of file ZXScreen.h.

◆ howmanyScrolls

size_t zxeco::BASICScreen::ScrollInfo::howmanyScrolls

How many one-text-line scrolls were done.

Definition at line 926 of file ZXScreen.h.

◆ newlineDone

bool zxeco::BASICScreen::ScrollInfo::newlineDone

TRUE if there has been any newline movement.

Definition at line 927 of file ZXScreen.h.