Sprinter: configuration identification
ZXNet echo conference «code.zx»
From 812/08.16 → To Yuri Burawtsow 16 September 1997
The other day, September 15, 97, at 00:14, Yuri Burawtsow wrote to Denis Parinov:
Glad to welcome you, Yuri!!!!!!
YB> I had these questions:
YB> 1. How to determine that a program is running
YB> on Sprinter, even if
YB> is another machine being emulated?
It looks like if another machine is emulated, then
Sprinter will not be detected programmatically (to avoid glitches).
Well, in normal mode there will be a function that will say,
"I'm Sprinter" while she's gone.
YB> 2. How to programmatically determine availability
YB> full RAM?
In Sprinter, apparently there will be no concept of incomplete RAM. How
reserve memory, see below _HO_ this is a current project and apparently
something will change.
YB> 3. How to programmatically influence the Turbo mode?
YB> 4. How to enable/disable emulation
YB> any other machine?
this will apparently be handled by the OS!
YB> Answering questions, please provide, pls, under-
YB> detailed description of all ports and entry points
YB> used in these operations.
By the way, why did you need this? If you're going to do something
Be sure to write in agreement with F. Peters!!! YB> Sincerely, Yuri.
Everything below can be used for informational purposes only.
because something may change and lead to inoperability
programs, for all questions regarding hardware, please contact f. Peters
tel. (812) 132-05-86.
Sprinter-97. Screen.
The generation of video images in a computer is carried out using a special
way. The entire image field, including off-screen areas
synchronization pulses, divided into squares (familiar places),
equal in size to a standard computer familiarity
ZX-Spectrum. In each such familiarity, the output mode is set
images. This can be an image of a regular symbol
ZX-Spectrum or two ZX-Spectrum symbols compressed horizontally into
twice. These can be graphic images in various
resolution modes. In familiarity mode it may be indicated that
a border, extinguishing signal or
synchronization Thus, all clock signals
turn out to be programmable. Information about familiarity mode
is written to a special RAM,
which is filled with the necessary data immediately after
turning on the computer. In further work to change the mode
image output, just change the mode values in the desired
acquaintances. Signs responsible for synchronization and impulses
It is not recommended to touch the suppression, as this will lead to
changing the TV synchronization mode and distortingimages when changing mode. (Similar distortion
observed in IBM when mode switching is performed
screen. ) In familiarity mode, it is also indicated from which area
Video RAM takes the data displayed on the screen. This allows
Easily move images around familiar locations by changing
information in acquaintance modes. This saves programs
working with windows from tracking the position of data in
video memory when moving windows. To move them it is enough
overwrite data about familiarity mode. The very image in
video memory remains in the same place. If you have
information of different windows in different places of video RAM, then
switching windows will be done without loss of information in
these windows, which leads to a significant acceleration of such
operations. In the existing version of Sprinter-97, familiarity mode
specified by two bytes. The first byte contains information about the mode
familiarity and the senior part of the address of the familiarity. Second
represents the low-order part of the familiarity address. Address
familiarity has a one and a half byte value and specifies 64
byte block of video RAM from which the image of the given image is taken
acquaintances. The image in the familiar place may have different
resolution and mode. In modes G-256-8 and G-16-16 in familiarity
All 64 bytes are used. In G-16-8 mode, 32 bytes are enough,
In ZX-40 mode - 9 bytes, ZX-80 - 18 bytes. Mode G-16-8uses all 64 bytes, which uses only 4 bits of
8. Which bits are used for output is determined by the palette.
The circuit design of this mode is no different from the G-256-8 mode. What to ask
this mode, it is enough to write colors in the palette that do not depend on
unnecessary bits. This eliminates the need to mask out unnecessary bits when
image output. Enabling ZX-40 mode results in
formal connection of six characters of the ZX-Spectrum format in
this familiar place. Half of them correspond to the alternative
screen connected via bit3 port 7FFD. 'Alternative'
characters appear on the screen next to the 'normal' ones in
ZX-80, when there are two symbols in one familiar place.
It remains to determine which of the three pairs of characters should be output
to the screen. This is determined by additional bits in the mode byte
screen. In graphics modes, these bits determine the number
the palette used in a given familiarity. Let's describe what bits
mode bytes are responsible for what.
Best regards, Denis.
-+- ZX WORD 2.5+
From 812/08.16 → To Yuri Burawtsow 16 September 1997
The other day, September 15, 97, at 00:14, Yuri Burawtsow wrote to Denis Parinov:
Glad to welcome you, Yuri!!!!!!
Bit3..Bit0 is the high part of the Video RAM address.
Bit5..Bit4 - output mode:
00 - (G-256-16 planned),G-16-16;
01 - ZX-80;
10 - G-256-8,G-16-8;
11 - ZX-40.
Bit7..Bit6 - palette number in graphic mode or number
character in ZX-Spectrum mode. Palette number in graphic mode
also defines additional submodes. Palettes with numbers
2 and 3 in G-256-8 mode correspond to a special BOND submode, in
in which color number FFh is redefined as non-existent. If
pixel information has this number, then its color is taken from
previous point. This gives the effect of hardware fill
horizontal lines, which can significantly increase speed
displaying images built on single-color planes. This one
the same number determines the symbol in ZX-Spectrum mode. There are
only symbols with numbers 0,1,2. The symbol with number 3 is
a sign that the output is installed in a given signal location
synchronization, blanking and border. What exactly is the signal?
determined by bits 3..0 of the same mode byte, since in
When these signals are output, the video RAM address is not required.
Video RAM addressing. The video RAM address is formed from the number
page and direct address on that page. Number
video pages are recorded in a special port (rgadr).Addressing has two modes - ZX... and GR... In ZX-40 and
ZX-80 addressing information in familiar places is done in the same way as
in standard ZX-Spectrum. Addressing the acquaintances themselves
is completely determined by what is written in the mode bytes. B
in graphic modes, the addressing is changed so that the bytes
located on the same horizontal line were located
directly after each other.
Correspondence between address bits and mode byte bits:
1. ZX modes... Address - PGS4..0,A12..0,A13=0, A14..A15 - window.
Main RAM windows open for display - xxx0x101b
Byte0
Bit7..6 - A12..A11 ( For attributes - A9..A8 )
Bit5..4 - sets the ZX-40/ZX-80 mode
Bit3..0 - video RAM page, set to OUT (pgadr),A
Byte1
Bit7..0 - A7..0
Familiarity addressing - A10..A8 (For attributes A12..10 = 110b)
2. GR modes... Address - PGS4..1,A13..0, PGS0=0, A14..A15 - window.
Main RAM windows open for display - 0101xxxxb
Byte0
Bit7..6 - sets the palette and BOND mode
Bit5..4 - sets the GR-... mode
Bit3..0 - A9..6
Byte1
Bit7..4 - A13..10
Bit3..3 - PGS4
Bit2..0 - A5..3
Addressing the familiarity - A2..0 - horizontal, PGS3..1 - vertical.
How to address video RAM in different modes?
Video RAM addresses are multiplexed depending on the
what mode should the output be made in? For this portvideo RAM pages contain a special bit that determines
video RAM addressing mode. This is Bit5 Output to the video page port
values 40h..7Fh causes the video RAM addressing to switch to
graphic mode. This switching has been introduced to simplify
working with a graphic screen. Currently as
pages of video RAM in graphic mode, part of it is used
page addresses of the main RAM, which leads to the establishment
formal correspondence of specific video-RAM pages to specific
main pages. These pages are the pages
50h..5Fh.For their use as video RAM pages
You need to switch the video RAM addressing to graphics mode.
Screen mode RAM is located in video RAM and is addressed precisely
same way. To gain access to it, you need to write to the port
video page value 16h or 17h. On page 17h
bytes 0 are located, and on page 16h bytes 1 mode are located.
The mode information consists of 40 lines having a length of 64 bytes and
following each other on page 17h. each line contains
string synchronization information. It is located in bytes from
40th to 55th. Lines from 32 to 39 are responsible for personnel
synchronization. Bytes 0..39 in lines 0..31 contain information about
visible screen mode. Bytes with the same addresses in
page 16h corresponds to mode 1 bytes. Change informationin the 32nd to 39th lines, also in bytes 40..63 in lines from 0th
before the 31st it is not recommended. The mode lines are located one after the other
each other and consist of two 2.5k blocks located on
two pages. These pages have enough memory for
arrangement of several such blocks to specify several
mode pages. The existing version of Sprinter-97 uses
only two such pages, located at addresses 0000h and
1000h per page. It is necessary to remember that the mode is set when
values 16h and 17h sent to the video RAM page port. B
In this case, the video RAM page has a size of 8K and addresses in
pages are within 0..1FFFh.) Switching pages
mode is carried out by writing to the port (rgmod) values 0 or
1. These video RAM pages contain one more additional
the page that contains the palette data. This page
becomes available after writing the value to the video page port
80h.
Best regards, Denis.
-+- ZX WORD 2.5+
From 812/08.16 → To Yuri Burawtsow 16 September 1997
The other day, September 15, 97, at 00:14, Yuri Burawtsow wrote to Denis Parinov:
Glad to welcome you, Yuri!!!!!!
Sprinter-97. BIOS functions.
;=============================================================================
; Bios Sprinter-97 functions.
; Working version 07/16/97
;=============================================================================
; !!! The functions are supplemented and may be partially changed. !!!
;=============================================================================
; LP_OPEN_WIN Open a window
; point 3D13h C=80h Input: B - window code.
; B=0 - Spectrum 32x24 B=1 - Spectrum 64x24
; B=2 - Spectrum 40x24 B=3 - Spectrum 80x24
; Output: DE - window size
CMD_OPEN_WIN EQU 80H
;=============================================================================
; LP_PRINT_ALL Outputting characters to the screen from the current familiarity
; point 3D13h C=81h Input: A - symbol,
; B - number of characters displayed,
; E - symbol attribute
CMD_PRINT_ALL EQU 81H
;=============================================================================
; LP_PRINT_SYM Displays characters on the screen from the current familiarity
; without attribute
; point 3D13h C=82h Input: A - symbol,
; B - number of characters displayed,
CMD_PRINT_SYM EQU 82H
;=============================================================================
; LP_PRINT_ATR Display attributes on the screen from the current location
; point 3D13h C=83h Input: B - number of characters displayed,; E - symbol attribute
CMD_PRINT_ATR EQU 83H
;=============================================================================
; LP_SET_PLACE Setting the current familiarity
; point 3D13h C=84h Input: E - horizontal familiarity
; D - vertical familiarity
CMD_SET_PLACE EQU 84H
;=============================================================================
; LP_PRINT_LN Print a string of characters to the screen from the current
; dating places
; point 3D13h C=85h Input: HL - line address
; B - number of characters displayed,
; E - character attribute
CMD_PRINT_LINE EQU 85H
;=============================================================================
; LP_PRINT_LN2 Outputs a string of characters to the screen from the current
; familiar places without attributes
; point 3D13h C=86h Input: HL - line address
; B - number of characters displayed,
CMD_PRINT_LINE2 EQU 86H
;=============================================================================
; LP_PRINT_LN3 Outputs a string of characters to the screen from the current
; spaces are displayed after D
; point 3D13h C=87h Input: HL - line address
; B - number of characters displayed,
; D - separator
; E - character attribute
CMD_PRINT_LINE3 EQU 87H
;=============================================================================
; LP_PRINT_LN4 Output a string of characters to the screen from the current
; familiar places without attributes after D are displayed
; spaces; point 3D13h C=88h Input: HL - line address
; B - number of characters displayed,
; D - separator
CMD_PRINT_LINE4 EQU 88H
;=============================================================================
; LP_CLS_WIN Clear screen window
; point 3D13h C=89h Input: DE - window position
; B - cleanup attribute
; H - height, L - width
CMD_CLS_WIN EQU 89H
;=============================================================================
; LP_SCROLL_UD ; Input: D - top line (from 0)
; B = 1 - UP/ B=2 - DOWN
; E - number of scrolled lines
CMD_SCROLL EQU 8AH
;=============================================================================
; LP_PRINT_LN5 Output a string of characters to the screen from the current
; familiarity after D nothing is displayed
; point 3D13h C=8Bh Input: HL - line address
; B - number of characters displayed,
; D - separator
; E - character attribute
; Output: HL - last character + 1
CMD_PRINT_LINE5 EQU 8BH
;=============================================================================
; LP_PRINT_LN6 Outputs a string of characters to the screen from the current
; familiar places without attributes after D nothing
; is displayed
; point 3D13h C=8Ch Input: HL - line address
; B - number of characters displayed,
; D - separator
; Output: HL - last character + 1
CMD_PRINT_LINE6 EQU 8CH;=============================================================================
Best regards, Denis.
-+- ZX WORD 2.5+
From 812/08.16 → To Yuri Burawtsow 16 September 1997
The other day, September 15, 97, at 00:14, Yuri Burawtsow wrote to Denis Parinov:
Glad to welcome you, Yuri!!!!!!
;=============================================================================
; KBD_IN Enter scancode from the keyboard without waiting,
; point 3D13h C=8Fh Keyboard and TURBO mode control
; Input: A = 0 - scancode input
; A = 1 - disable ZX-Spectrum KBD emulation
; A = 2 - enable ZX-Spectrum KBD emulation
; A = 3 - disable TURBO; A = 4 - enable TURBO
; Output: Z - no code
; NZ - there is a code - in A
CMD_KBD_IN EQU 8FH
;=============================================================================
; point 3D13h C=90h
; Determining the amount of memory.
; Output: BC - total amount of RAM in blocks of 16k
EMM_FN0 EQU 90H
;=============================================================================
; point 3D13h C=91h
; Initializing memory allocation. Erasing
; all RAM disks
EMM_FN1 EQU 91H
;=============================================================================
; point 3D13h C=92h
; Get memory block N bytes
; Input: A - RAM-Disk number
; B - number of required blocks
; Output: A - RAM-Disk/error code
; CF - error sign
; (no memory/RAM-Disk exists)
EMM_FN2 EQU 92H
;=============================================================================
; point 3D13h C=93h
; Free up memory block RAM-Disk A; Input: A - RAM-Disk KEY ( Clear RAM-Disk A )
EMM_FN3 EQU 93H
;=============================================================================
; point 3D13h C=94h
; Get page N RAM-Disk A
; Input: A - RAM-Disk KEY, B - page number
; Output: A - page
EMM_FN4 EQU 94H
;=============================================================================
; point 3D13h C=95h
; Get next RAM-Disk page
; Input: A - RAM page
; Output: A - next RAM page / L=0FFh - end
EMM_FN5 EQU 95H
;=============================================================================
; point 3D13h C=96h
; Obtaining port addresses and data for recovery
; Input: A - projection window number
; Output: B - data, C - window port address
; Upon completion of work with extended RAM, the program
; must execute OUT (C),B for all used
; windows to return the pages connected
; earlier
EMM_FN6 EQU 96H
;=============================================================================
; point 3D13h C=98h
; Calculation of page and address in RAM-Disk by
; absolute sector number
; Input: A - RAM-Disk, DE - absolute sector number
; Output: A - page, HL - address in page
RAMD_CALC_PAGE EQU 98H
;=============================================================================
; ..Internal function..
; open a graphics window, with a handle in IX; in place HL, E - mode page, seventh bit E - BOND mode
PIC_FN0 EQU 0A0H
;=============================================================================
; point 3D13h C=0A1h
; OUTPUT POINT input: dE - vertical, HL - horizontal,
; A - dot color, B - graph number. windows
PIC_FN1 EQU 0A1H
;=============================================================================
; point 3D13h C=0A2h
; OUTPUT LINE 'FILL' input: dE - vertical, HL - horizontal.
; IX - line length in points, A - color
PIC_FN2 EQU 0A2H
;=============================================================================
; point 3D13h C=0A3h
; OUTPUT LINE 'COPY' input: dE - vertical, IX - horizontal.
; A