I know about using RST 10h to print a character, but how do I specify
x/y co-ordinates? I tried the locations that a BASIC PRINT AT sets up
(22528 and 22529, I think they were), even though I read somewhere that
I shouldn't do this...
Or do I need to "roll my own" routine for this functionality?
I'm willing to go RTFM if somebody would be kind enough to tell me
which FM TR :)
--Mark
PS Only found out about Cronosoft last week - "Higgledy Piggledy"
arrived in the post this morning. Fantastic - i.e. the game, as well as
being able to buy it in the first place!
[snip]
> I know about using RST 10h to print a character, but how do I specify x/y
> co-ordinates? I tried the locations that a BASIC PRINT AT sets up (22528
> and 22529, I think they were), even though I read somewhere that I
> shouldn't do this...
PRINT CHR$ 22; CHR$ y; CHR$ x;
[snip]
--
| Darren Salt | d youmustbejoking,demon,co,uk | nr. Ashington,
| RISC OS, | s zap,tartarus,org | Northumberland
| Linux | @ | Toon Army
| We've got Souness, we don't want him
PC card not responding (probably running Windows)
That is, how do I put it in the '...' if I have code like the
following:
LD A,2
CALL 1601 ; select screen
... ; set x and y co-ords
LD A,66 ; character 'B'
RST 16 ; print 'B' to screen
Same as for your character 'B'. See Darren's reply again ;)
Hi Mark,
Your title should refer to the ZX Spectrum as all ROM routines are
different as are the restarts. On the Jupiter Ace, RST 08 prints the
character in the accumulator.
Remember that 1601 is the hexadecimal address of the open channel
routine. Depending on the assembler, you would use a qualifier such as
1601H, $1601 or #1601 having loaded the accumulator with 2 first - then
LD A,22
RST 16 (or RST 10H)
LD A,4
RST 16
LD A,9
RST 16
LD A,66
RST 16
RET
is the equivalent of PRINT AT 4,9,"B"
You can't POKE just the S_POSN system variables as DF_CC must be kept in
line. The former are counters used to decide when newlines and scrolling
are required. The latter is the absolute screen address of the first
byte.
LD BC, #0409
CALL #0DD9
is a way to position the text with six bytes of code.
--
Geoff Wearmouth
GOSH WONDERFUL BASIC ROM: http://www.wearmouth.demon.co.uk/zz/zz.htm
(1) Yes, sorry: I realised as soon as I posted that I'd missed "ZX
Spectrum" out of the title but couldn't see a way of amending it :(
(2) I hadn't made the link that the "22" in Darren's post was a control
code for "AT y,x" - oops.
--Mark
Try using the AT control character followed by the 2 coordinates.
That's how some games managed to print the name without Program: when
loading.
--
______________________________________________________________________________
| spi...@freenet.co.uk | "Are you pondering what I'm pondering Pinky?" |
|Andrew Halliwell BSc(hons)| |
| in | "I think so brain, but this time, you control |
| Computer Science | the Encounter suit, and I'll do the voice..." |
------------------------------------------------------------------------------
That's OK. I didn't read it properly either and spent some time looking
through my ZX80 documentation. :-)
I'm awake now and when calling CLS-SET #0DD9, B should contain 24-y and
C should contain 33-x not the same values that are used in BASIC. Oops.
--
Geoff Wearmouth