Create a fullscreen scrolltext

General software. From trouble with the Banyan Tree to OCP Art Studio, post any general software chat here. Could include game challenges...
Post Reply
yogyog
Drutt
Posts: 11
Joined: Thu May 30, 2019 8:07 pm

Create a fullscreen scrolltext

Post 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.
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: Create a fullscreen scrolltext

Post 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?
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: Create a fullscreen scrolltext

Post 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?
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Re: Create a fullscreen scrolltext

Post 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.
User avatar
Alessandro
Dynamite Dan
Posts: 1908
Joined: Wed Nov 15, 2017 11:10 am
Location: Messina, Italy
Contact:

Re: Create a fullscreen scrolltext

Post 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."

User avatar
Joefish
Rick Dangerous
Posts: 2042
Joined: Tue Nov 14, 2017 10:26 am

Re: Create a fullscreen scrolltext

Post 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.
yogyog
Drutt
Posts: 11
Joined: Thu May 30, 2019 8:07 pm

Re: Create a fullscreen scrolltext

Post 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!
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: Create a fullscreen scrolltext

Post 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.
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: Create a fullscreen scrolltext

Post by arkannoyed »

Or if you want an ATTR based scroller that will fill 1/3rd of the screen vertically, then they're fairly plentiful
yogyog
Drutt
Posts: 11
Joined: Thu May 30, 2019 8:07 pm

Re: Create a fullscreen scrolltext

Post by yogyog »

Thank you, arkannoyed - that's exactly what I'm after - In return I could do some graphics/animation work maybe?
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: Create a fullscreen scrolltext

Post 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.
User avatar
Joefish
Rick Dangerous
Posts: 2042
Joined: Tue Nov 14, 2017 10:26 am

Re: Create a fullscreen scrolltext

Post by Joefish »

Can you clarify you want it to run in real-time, not pause frame-by-frame for use in stop-motion animations?
yogyog
Drutt
Posts: 11
Joined: Thu May 30, 2019 8:07 pm

Re: Create a fullscreen scrolltext

Post 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?
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: Create a fullscreen scrolltext

Post by arkannoyed »

Sorry, attributes, so big blocky chunky looking text.
yogyog
Drutt
Posts: 11
Joined: Thu May 30, 2019 8:07 pm

Re: Create a fullscreen scrolltext

Post by yogyog »

Yes - that's exactly what I'm after!

I've not actually written the text yet... give me a week or so.
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: Create a fullscreen scrolltext

Post 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
User avatar
Pegaz
Dynamite Dan
Posts: 1209
Joined: Mon Nov 13, 2017 1:44 pm

Re: Create a fullscreen scrolltext

Post 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...
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: Create a fullscreen scrolltext

Post 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.
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

Re: Create a fullscreen scrolltext

Post 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?
Bizzley
Microbot
Posts: 124
Joined: Thu Nov 16, 2017 10:47 am

Re: Create a fullscreen scrolltext

Post by Bizzley »

Image

Big enough?
"He made eloquent speeches to an audience consisting of a few depressed daffodil roots, and sometimes the cat from next door."
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: Create a fullscreen scrolltext

Post 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!
User avatar
Einar Saukas
Bugaboo
Posts: 3070
Joined: Wed Nov 15, 2017 2:48 pm

Re: Create a fullscreen scrolltext

Post by Einar Saukas »

If you are looking for a generic routine to scroll messages outside screen then there's Rotatrix.
Bizzley
Microbot
Posts: 124
Joined: Thu Nov 16, 2017 10:47 am

Re: Create a fullscreen scrolltext

Post by Bizzley »

Image

Proportional text looks a lot better. (Font is an old 42CPL one since I already had the sizes for the letters)
"He made eloquent speeches to an audience consisting of a few depressed daffodil roots, and sometimes the cat from next door."
User avatar
Pegaz
Dynamite Dan
Posts: 1209
Joined: Mon Nov 13, 2017 1:44 pm

Re: Create a fullscreen scrolltext

Post 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!
Post Reply