Page 1 of 1

Create a fullscreen scrolltext

Posted: Tue Jun 04, 2019 9:15 am
by yogyog
I'm looking for something where I can type in some text and have the ZX Spectrum turn it into a showy fullscreen scrolltext. Like you find on a ZX Spectrum demo.

I'm also hoping that

I want to have it on a screen in the background of the follow-up video to this: https://www.youtube.com/watch?v=lrqIhcGNZQo - the last one has credits on a ZX spectrum (which I faked) - for the next one I want to have a flashy scrolltext behind the puppet. I like the idea of these being made by a stopmotion animator in the 80's probably in Czechaslovacia, who uses a ZX Spectrum clone for credits, and I would rather have the added authenticity of using an actual ZX Spectrum program rather than something I put together in Blender taking the ZX Spectrum's colour limitations.

Re: Create a fullscreen scrolltext

Posted: Tue Jun 04, 2019 9:33 am
by arkannoyed
Probably the easiest way would be to try and 'Hack' a Demo if you can find one with a scroller that you like. Just change the scroller text if thats possible?

Re: Create a fullscreen scrolltext

Posted: Tue Jun 04, 2019 10:10 am
by Ast A. Moore
Oh, you mean a horizontal one-line scroller? That “full screen” kind of threw me for a loop. I thought you meant a vertical, multi-line scroller; that would be quite difficult to pull off without major slowdowns.

A horizontal scroller is pretty trivial, although the actual implementation will vary depending on how quickly you want the text to scroll (i.e. 1 pixel, 4 pixels, or 8 pixels).

Are you looking for a ready-made solution or just coding ideas? I mean, how well versed are you in Z80 assembly?

Re: Create a fullscreen scrolltext

Posted: Tue Jun 04, 2019 10:51 am
by R-Tape
Nice animation!

One easy way is to use a utility like this one: https://spectrumcomputing.co.uk/index.p ... 6&id=24203

Press space to stop and go to BASIC, and you can edit line 30 with any text you want.

If that's too fancy, or not fancy enough, just try searching SC for "scroller" and there are a few choices.

Re: Create a fullscreen scrolltext

Posted: Tue Jun 04, 2019 10:58 am
by Alessandro
This is the scrolling text routine I have been using for years. I reworked it from a source I cannot remember now. It can display custom fonts and be relocated.

Code: Select all


  FONT EQU [your custom font address]

SCROLL:

  LD HL, TEXT

  LD (MESSAGE),HL    ; loads the text address in MESSAGE
  LD (L_35489),HL    ; points to the first character of the text
  
L_35387:  HALT
  CALL 00654                ; calls the control key routine
  INC E                     ; increases E by 1, if it's 255 (no key pressed) turns to 0
  RET NZ                     ; JP NZ, [address] to exit to a different memory location
  CALL L_35414
  JP L_35387
L_35413: DEC C
L_35414:  LD HL,20735       ; 20735 (default)
  PUSH HL
  LD B,008
L_35420:  PUSH BC
  PUSH HL
  LD B,032
  AND A
L_35425:  RL (HL)
  DEC L
  DJNZ L_35425
  POP HL
  INC H
  POP BC
  DJNZ L_35420
  LD HL,(L_35489)           ; get current place in the text
  LD L,(HL)                 ; get the letter 
  LD H,0  
  ADD HL,HL
  ADD HL,HL
  ADD HL,HL                 ; letter times 8
  LD DE,FONT-256            ; get font address ( don't forget its minus 256 -> 32*8 )
  ADD HL,DE                 ; HL now holds the address of the character in the font
  EX DE,HL                  ; exchange so DE is letter in memory we wish to use
  POP HL                    ; retrieve where on screen we are going to put this vertical line of pixels
  LD A,(PUNTO_A)
  LD C,A
  LD B,008
L_35459:  LD A,(DE)
  AND C
  JR Z,L_35464
  INC (HL)
L_35464:  INC H
  INC DE
  DJNZ L_35459
  LD HL,PUNTO_A
  RRC (HL)
  RET NC
  LD HL,(L_35489)
  INC HL
  LD A,(HL)
  AND A
  JR NZ,L_35485
  LD HL,(MESSAGE)
L_35485:  LD (L_35489),HL

   RET

L_35489: DEFS 2  
  
MESSAGE: DEFS 2

PUNTO_A:  ADD A,B 

TEXT:
  DEFM " Here goes your text."
  DEFM " Remember to put a space"
  DEFM " before every sentence, for better readability."


Re: Create a fullscreen scrolltext

Posted: Tue Jun 04, 2019 1:05 pm
by Joefish
Does this mean you need to make it move in steps to go with the stop-motion?
In which case speed isn't really an issue - if it's in BASIC and takes even a few seconds to render each step, then that's not a problem for stop-motion..?

The simplest method would be to take a text message and enlarge it by setting a whole character-square's attribute based on each pixel of the text, making it 8x larger. Or setting two characters so it's 16x taller and 8x wider.

You could go much fancier and design a large detailed sprite for each text character and render them with pixel-scrolling, but it's (a) a lot of effort and (b) you still need to decide how to synchronise it with your stop-motion animation.

Re: Create a fullscreen scrolltext

Posted: Tue Jun 04, 2019 1:13 pm
by yogyog
I know NO ZX Spectrum Assembly. Or any assembly at all.

I was after a horisontal scroller with HUGE TEXT.

The idea of hacking a demo sounds interesting... as does the program R-Tape suggested.

Thanks, guys!

Re: Create a fullscreen scrolltext

Posted: Tue Jun 04, 2019 1:46 pm
by arkannoyed
If you look on something like ZX AAA Demo site and find something you like the look of, then I'm sure one of us on here would be able to extract/ modify it so you can utilise the scroller somehow.

Re: Create a fullscreen scrolltext

Posted: Tue Jun 04, 2019 1:56 pm
by arkannoyed
Or if you want an ATTR based scroller that will fill 1/3rd of the screen vertically, then they're fairly plentiful

Re: Create a fullscreen scrolltext

Posted: Tue Jun 04, 2019 2:03 pm
by yogyog
Thank you, arkannoyed - that's exactly what I'm after - In return I could do some graphics/animation work maybe?

Re: Create a fullscreen scrolltext

Posted: Tue Jun 04, 2019 2:09 pm
by arkannoyed
No need. We do stuff just for the sheer hell of it on here! :D

do you want a routine that you just initialise and it can scroll some text that you've entered somewhere?

If you want White ATTRs text on a Black background then I do have a routine already for that.

Re: Create a fullscreen scrolltext

Posted: Tue Jun 04, 2019 2:51 pm
by Joefish
Can you clarify you want it to run in real-time, not pause frame-by-frame for use in stop-motion animations?

Re: Create a fullscreen scrolltext

Posted: Tue Jun 04, 2019 3:23 pm
by yogyog
Joefish - erm - all the stop-motion is actually 3D animation done in Blender - so I'll be running it on an emulator and screen - recording. Sorry - this is all lies.

arkannoyed - that's exactly what I want - yes... What does ATTR mean?

Re: Create a fullscreen scrolltext

Posted: Tue Jun 04, 2019 3:31 pm
by arkannoyed
Sorry, attributes, so big blocky chunky looking text.

Re: Create a fullscreen scrolltext

Posted: Tue Jun 04, 2019 5:01 pm
by yogyog
Yes - that's exactly what I'm after!

I've not actually written the text yet... give me a week or so.

Re: Create a fullscreen scrolltext

Posted: Wed Jun 05, 2019 3:07 pm
by arkannoyed
So Yogyog, is this what you need?

Image

Perhaps appears a little jerky on here, but I think thats mostly because its an animated GIF

Re: Create a fullscreen scrolltext

Posted: Wed Jun 05, 2019 6:37 pm
by Pegaz
How hard is it to make such a big, pixel smooth scroll across the whole screen including border?
I think I saw such a scroll in some demo, but I cant remember it now.
It looks really impressive when text appears on one side of the screen and disappears into the other...

Re: Create a fullscreen scrolltext

Posted: Wed Jun 05, 2019 7:08 pm
by Ast A. Moore
Pegaz wrote: Wed Jun 05, 2019 6:37 pm How hard is it to make such a big, pixel smooth scroll across the whole screen including border?
You can’t do pixel-smooth scrolling in the border area. The ULA is incapable of changing the color of individual pixels of the border; only 8–pixel-wide lines.

Re: Create a fullscreen scrolltext

Posted: Wed Jun 05, 2019 7:25 pm
by R-Tape
Ast A. Moore wrote: Wed Jun 05, 2019 7:08 pm You can’t do pixel-smooth scrolling in the border area. The ULA is incapable of changing the color of individual pixels of the border; only 8–pixel-wide lines.
Does anyone know of examples of scrollers that make the best of this by using it as a 'stretch' scroll? Fat on entry including border, thins on screen, then fattens on exit left including border?

Re: Create a fullscreen scrolltext

Posted: Wed Jun 05, 2019 7:26 pm
by Bizzley
Image

Big enough?

Re: Create a fullscreen scrolltext

Posted: Wed Jun 05, 2019 7:35 pm
by arkannoyed
Pegaz wrote: Wed Jun 05, 2019 6:37 pm How hard is it to make such a big, pixel smooth scroll across the whole screen including border?
I think I saw such a scroll in some demo, but I cant remember it now.
It looks really impressive when text appears on one side of the screen and disappears into the other...
That is a whole different kettle of ULAs! It’s all to do with timing tricks, and will differ between all the machine variants, therefore also needs a model check routine too to adjust timings correctly. It does look nice though!

Re: Create a fullscreen scrolltext

Posted: Wed Jun 05, 2019 7:52 pm
by Einar Saukas
If you are looking for a generic routine to scroll messages outside screen then there's Rotatrix.

Re: Create a fullscreen scrolltext

Posted: Wed Jun 05, 2019 8:26 pm
by Bizzley
Image

Proportional text looks a lot better. (Font is an old 42CPL one since I already had the sizes for the letters)

Re: Create a fullscreen scrolltext

Posted: Wed Jun 05, 2019 8:53 pm
by Pegaz
Einar Saukas wrote: Wed Jun 05, 2019 7:52 pm If you are looking for a generic routine to scroll messages outside screen then there's Rotatrix.
Yes, that's what I meant, it looks really great!