Page 1 of 2
Title Screen Data Load
Posted: Thu Jan 09, 2025 1:33 pm
by rinwaldmolly
Hi,
I've created a title page using a combination of plot, draw and some custom UDGs using read DATA statements and the standard POKE USR "a" command - so far so good.
In a separate listing I also make use of custom UDGs for the main program - I've been attempting to type this into the listing for the title page but the second new DATA routine is not overwriting the UDG set and displays instead the UDGs from the first data load - is it not possible to overwrite a USR space in the same listing? (Admittedly I've not seen this done in any of the listings I've been learning from but it seemed logical to me!).
Cheers,
Jason
Re: Title Screen Data Load
Posted: Thu Jan 09, 2025 2:52 pm
by 1024MAK
You can overwrite / redefine a UDG at any time.
If the UDG has been printed to the screen, these will not change if you redefine the UDG.
But when you print the relevant UDG again, the new "shape" will be used.
A program reads DATA statements and data item in sequence. Once read, the pointer used by BASIC moves on to the next data item.
However, you can move the pointer by using the RESTORE statement. This has RESTORE, followed by a line number.
I'm not sure if any of the above answers your question.
Mark
Re: Title Screen Data Load
Posted: Thu Jan 09, 2025 3:23 pm
by XavSnap
Hi Jason,
Just save your screen as a SCREEN$ file and reload it on the screen without UDGs.
The UDG on Specrum 16k and 48k are located at the top of memory, and can't be retrieve or change with POKEs...
But POKE USR "a" point to the right memory segment for both Spectrum.
Try
10 PRINT"Hello"
20 SAVE"myscreen" SCREEN$
(Where SCREEN$= CTRL+SHIFT & CTRL+K)
NEW
Just save a BASIC loader to set colors, music and UDG.
10 LOAD"myscreen" SCREEN$
20 PAUSE 500
30 LOAD "MyProgram"
Re: Title Screen Data Load
Posted: Fri Jan 10, 2025 8:22 pm
by rinwaldmolly
Hmm - ok i thought it might have something to do with screen$ but where am i loading from?
By which I mean I’m working in ZX basic on a Next so I can either load the screen listing or the main listing - i have not really advanced to compiling in sequence like a tape load (i am only guessing this is how this would work based on your suggestion xavsnap - this is my first attempt at an original programme)
Can I share the two listings with you?
Re: Title Screen Data Load
Posted: Fri Jan 10, 2025 9:40 pm
by 1024MAK
Although I have a Next, I've not tried saving or loading multiple files.
With a real ZX Spectrum with a real tape deck, or most emulators that run on a PC, then the sequence is something like this:
Save the "loader" program ( SAVE "name" LINE 10)
Save the screen data ( SAVE "screen" SCREEN$)
Save the main program ( SAVE "name" LINE 10)
With an emulator, the "tape" file can Then be saved as either a TZX type or a TAP type.
Then when loading:
Type LOAD ""
The ZX Spectrum loads the "loader" program.
This autostarts and runs, as it runs, it loads the screen data, then it loads the main program. Once the main program has loaded it will also autostart.
The "loader" is generally fairly simple:
Code: Select all
10 PAPER 1 : INK 5 : BORDER 1 : CLS
20 LOAD "screen" SCREEN$
30 LOAD "main"
Note that this assumes the main program is a BASIC program. Machine code main programs require a slightly different arrangement.
My poor quality video of an example is here:
https://www.youtube.com/watch?v=iGsoo-n56ik
Mark
Re: Title Screen Data Load
Posted: Fri Jan 10, 2025 10:00 pm
by XavSnap
This video ?
https://www.youtube.com/watch?v=9mV7Vvqkdo4
Just save both files on the same tape file.
Re: Title Screen Data Load
Posted: Sat Jan 11, 2025 3:08 am
by XavSnap
1024MAK wrote: ↑Thu Jan 09, 2025 2:52 pm
You can overwrite / redefine a UDG at any time.
Just use a single UDG character...
Code: Select all
10 LET A$="\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a"
20 RESTORE 110
30 FOR c=0 TO 7:FOR I = USR "A" TO USR "A"+7:READ A:POKE I, A:NEXT I:PRINT AT 0,0;A$;AT 21,0;A$
50 PRINT AT (RND*20)+1,(RND*31);"\a"
60 NEXT c
80 GO TO 20
100 REM ==== DATAS UDG ====
120 DATA 0,60,126,54,30,126,60,0,0,120,252,108,60,252,120,0,0,240,249,216,120,249,240,0,0,225,243,177,240,243,225,0
130 DATA 0,195,231,99,225,231,195,0,0,135,207,198,195,207,135,0,0,15,159,141,135,159,15,0,0,30,63,27,15,63,30,0
Note : "\a" = CHR$ 144
Re: Title Screen Data Load
Posted: Sat Jan 11, 2025 12:00 pm
by 1024MAK
XavSnap wrote: ↑Sat Jan 11, 2025 3:08 am
Just use a single UDG character...
Arrrrggg - I’ll have nightmares about Pac-Man taking over my Sinclair....!!!
Mark
Re: Title Screen Data Load
Posted: Tue Mar 04, 2025 7:06 pm
by rinwaldmolly
Me again!
Have watched the suggested youtube videos and think I get the theory of saving separate programs to a virtual tape then loading them in sequence but I think I've been staring at too much code today to put this in practice!
I've attached the .z80 code and loading screen as a .scr in the hope that someone can turn them into a shiny .TAP file!
This is the first listing I have ever written in basic (+3 in FUSE) so please be gentle!
Best,
Jason
Re: Title Screen Data Load
Posted: Wed Mar 05, 2025 1:01 am
by 1024MAK
Give this a go...
Mark