In message <
[email protected]>
on 13 Jan 2017 CP/M User wrote:
On Wednesday, 11 January 2017 19:01:13 UTC+11, Matthew Phillips wrote:
In message on 11 Jan 2017 CP/M User wrote:
On Saturday, 2 July 2016 04:09:47 UTC+10, Matthew Phillips wrote:
In message on 1 Jul 2016 B. P. TBC wrote:
Has the Amstrad CPC 464 a real text mode, like the C64? Or the CPC has only graphics mode?
The CPC 464 only has three graphics modes. All modes are 200 pixels high (25 text lines of 8 pixels). MODE 0 is 160 pixels wide, MODE 1
is 320 pixels wide and MODE 2 is 640 pixels, with 4, 2 and 1 bits per pixel respectively, so all 16K.
The Amstrad has an 4 Graphics Mode if you include the more obscure 4 coloured Mode 0, it works differently from MODE 0 in that a hidden
screen can be drawn and displayed based on the INKs. From what I can
tell it has't been widely used and as MODE 0 offers up to 16 colours, it's more effective to use that MODE when writing games.
It's not known to the MODE command, is it? Nor is it mentioned in the documentation of SCR SET MODE.
It is a mode in its own right, though I'm unsure if the firmware recognises it, There was an article about it along with a BASIC RSX driver program. I posted some examples on the CPC-Wiki a while ago:
http://www.cpcwiki.eu/forum/programming/double-buffering-and-frame-flyback/msg91485/#msg91485
using that program along with an example of my own, but found it wasn't really viable for using in games and for any games programmers who made any wire-framed graphical games (e.g. Tank busters), it would of been easier to just use MODE 0 and Flip to the visible INKs for drawing the graphics once they have been drawn.
Thanks for the reference. I fished the magazine off my shelf and had a go at hand-disassembly of the RSX commands.
The |MODE command that puts the computer into the "MODE 3" of the article
does this:
XOR A
CALL &BC0E
DI
EXX
LD A,C
OR 3
LD C,A
EXX
EI
LD A,99
LD (&A9),A
RET
I suspect the final two commands before the RET are not crucial and are being used to keep a record of which "screen" is in use.
So the 4-colour 20 x 25 mode is not known to the firmware. The EXX command, which has to be done while interrupts are disabled, accesses the Z80
alternate register set. Most of my books have no information about what the alternate registers are used for, but the full Amsoft firmware guide covers this in Appendix XI. The register C' holds the current mode in bits 0 and 1, and the lower and upper ROM states in bits 2 and 3.
So it is "MODE 3" after a fashion. The firmware is unaware of this mode,
whose existence is probably just a side-effect of the silicon implementation
of the gate array.
In this mode, only half of the bits of each byte of screen memory are used by the video chip, but the firmware still thinks you are in mode 0 and,
depending on pen colour, will manipulate all the bits in each byte. Thus setting up fresh content in the hidden half of each byte is not exactly trivial. The RSX provided in the article to switch between the visible and
the hidden content disassembles as follows:
LD A,(&A9)
CP 100
RET Z
INC A
LD (&A9),A
LD BC,&4000
LD HL,&C000
.loop
LD A,(HL)
RLCA
RLCA
LD (HL),A
INC HL
DEC BC
LD A,B
OR C
JR NZ,loop
RET
So it's not surprising you found it slow. The article claims that "games like Design Design's Tankbusters use this mode" but I doubt anyone would have bothered to go to this effort for so little gain.
There is also a mistake in line 120 of the listing, which should read GOTO
100 at the end instead of GOTO 110. The listing works as written, but the mistake means that some typing errors in the hexadecimal would not have been picked up.
--
Matthew Phillips
Durham
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)