News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Split raster handling

Started by martin464, 03:01, 05 November 22

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

martin464

like everyone does, just messing around with split rasters

is there any way to get it to change the colour more often?
this a full screen width with no delays using OUTI and INC B but each bar is quite a few characters wide

the funny thing is the wiki said this technique is used for scrolling messages to build up characters, with the results i'm getting one letter would take up the whole screen!



CPC 464 - 212387 K31-4Z

"One essential object is to choose that arrangement which shall tend to reduce to a minimum the time necessary for completing the calculation." Ada Lovelace

martin464

CPC 464 - 212387 K31-4Z

"One essential object is to choose that arrangement which shall tend to reduce to a minimum the time necessary for completing the calculation." Ada Lovelace

Axelay

I don't know if it's the fastest/best way, but in the past I've used a string of instructions like this:

out (c),c
out (c),c
out (c),a
out (c),c
out (c),a


with c & a preloaded with the colours before each line.  That gives a colour change 4 characters apart.  To scroll, you change the start point of the split raster, which shifts by 1 character the position.  Then every 4 frames you reset the start point and use self modifying code to change the instructions, so the above might become

out (c),c
out (c),a
out (c),c
out (c),a
out (c),a


so the colour changes have moved along by 4 characters.

martin464

ah that's a good trick i like that, :thumbs up:
CPC 464 - 212387 K31-4Z

"One essential object is to choose that arrangement which shall tend to reduce to a minimum the time necessary for completing the calculation." Ada Lovelace

Longshot

You can also use out(#ff),a to have a size of 3 characters (3x2 bytes)
https://shaker.logonsystem.fr/tests?cpc=1&crtc=0&test=A9

Depending on the value of A (between #40 and #7F), this can however send I/O to other circuits, which must be done knowingly. ;D
Rhaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!!

martin464

Yes I found that out trying OTIR, B went on a dive through the ports but this could replicate the Spectrum colour clash quite nicely (!)
CPC 464 - 212387 K31-4Z

"One essential object is to choose that arrangement which shall tend to reduce to a minimum the time necessary for completing the calculation." Ada Lovelace

Longshot

OTIR and OTDR are not really usable on Cpc since B decrements to 0 and this value serves as the i/o port.
However, you can see an example of OTIR use in Shaker
https://shaker.logonsystem.fr/tests?cpc=1&amspirit=1&crtc=0&test=BR see SubTest F

The method used for this test is to run this instruction and abort it with an interrupt before B reaches a critical value.
Also, this instruction takes 6 µseconds between each color update.
Rhaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!!

Prodatron

You can use repeating

INC B:OUTI
INC B:OUTI
...

instead of OTIR on the CPC, which will have the same speed (I think so?), but takes some code memory.
Btw, yes, you have to INC B first, as OUTI is first decreasing it before outing (hl) to the port at BC.
With INI you have to INC B in the second step (I wonder what they did so that the Z80 behaves in this different way).

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Mage

Quote from: Longshot on 12:26, 05 November 22You can also use out(#ff),a to have a size of 3 characters (3x2 bytes)
https://shaker.logonsystem.fr/tests?cpc=1&crtc=0&test=A9

Depending on the value of A (between #40 and #7F), this can however send I/O to other circuits, which must be done knowingly. ;D

Do you know is there any "out(number),a" equivalent to enable/disable split-border within 3 characters ?

Longshot

QuoteDo you know is there any "out(number),a" equivalent to enable/disable split-border within 3 characters ?
On CRTC 0, a splitborder uses R8 (#3x/#0x)
On CRTC 1, a splitborder uses R6 (#00/<>C4) (on lines where C4<>0)

The OUT(#ff),A instruction can write to the selected CRTC register with
A=1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61 (and same values +128)

On CRTC 0, values <49 disable border and >49 enable border
(but however, the interlace is activated (bit 0=1), and you need to disable it before the end of the line (e.g. R8=0))

On CRTC 1, the border can only be cancelled (border to non border) with this instruction.
Rhaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!!

martin464

that otir technique.. that's another level.... amazing someone pulled it off! wow
not sure if it's actually usable for real...
with out (b), r - it's good enough i found it the same as INC/OUTI same size split. 

i did have a weird problem of the first split not being visible. ok, just put some more nop's in and couldn't find the magic number to make it start where it should. 

the example said
;; delay so that the first colour change is invisible (it occurs
;; during the horizontal flyback)
defs 28


wonder why first colour change needs to be invisible, i really want it to start on the first one
i tried adding more than 28 going 1 at a time, expecting it to work eventually.... 

y'know, this crtc/gate array stuff is beginning to sink in. it looks worse than it is. i think i might be close to getting it, not guru level just "enough to scrape by" level that will do me!
CPC 464 - 212387 K31-4Z

"One essential object is to choose that arrangement which shall tend to reduce to a minimum the time necessary for completing the calculation." Ada Lovelace

Mage

Thank you very much @Longshot 

Longshot

Quote from: martin464i did have a weird problem of the first split not being visible. ok, just put some more nop's in and couldn't find the magic number to make it start where it should.
For your subject, I advise you to look at the diagrams on page 47.

This should bring you some answers. ;)

http://logonsystem.fr/down/ACCC1.3-EN.pdf
Rhaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!!

Powered by SMFPacks Menu Editor Mod