Add loading screen to .tap file

Struggling with Fuse or trying to find an emulator with a specific feature. Ask your questions here.
dwinters18
Drutt
Posts: 20
Joined: Sat Dec 01, 2018 6:45 pm

Re: Add loading screen to .tap file

Post by dwinters18 »

Hi,

Yes that makes sense - I will look at that now. I am getting closer so all help is greatly appreciated!

D
User avatar
textvoyage
Drutt
Posts: 34
Joined: Sun Nov 12, 2017 9:11 pm
Contact:

Re: Add loading screen to .tap file

Post by textvoyage »

A useful thing is that you can use DOS to concatenate multiple .tap files into 1 file, so if you have a loader, a screen & another screen you can type

copy /B loader.tap + screen1.tap + screen2.tap allInOneTap.tap

note the B switch (binary) and the space between screen2.tap and the final, bigger, all-in-one filename at the end
Dr_Dave
Drutt
Posts: 32
Joined: Wed Feb 05, 2020 9:58 am

Re: Add loading screen to .tap file

Post by Dr_Dave »

Thought I'd piggy back a question on this thread, rather than start another...

I'm trying to insert a loading screen in my game's tap file... I've followed the instructions given on page one, and it has mostly worked.

I created a game tap file from sjasmplus (with savetap "filename.tap"), loaded that into ZX-Blockeditor, stripped out all but the basic loader. Loaded the loader into Spin, inserted load "" screen$, saved, loaded back into ZX-Blockeditor then reinserted my game programme data header and data, then my screen header and data between them. The result looks like this:

Image

And it mostly works. The game loads the screen, then the game and the game starts.

However - as soon as it finishes loading in the screen and the game data begins to load, the loading screen gets blanked and I can't figure out why. It just empties out to a mostly white screen with two black character lines at the bottom.

Anyone any idea what I'm missing?

Here's the loader, if it helps:

Image
User avatar
djnzx48
Manic Miner
Posts: 729
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: Add loading screen to .tap file

Post by djnzx48 »

Do you have any peripherals connected such as the Interface 1? Maybe try replacing the POKE with this.

POKE (PEEK 23631+256*PEEK 23632)+5,111
Dr_Dave
Drutt
Posts: 32
Joined: Wed Feb 05, 2020 9:58 am

Re: Add loading screen to .tap file

Post by Dr_Dave »

No peripherals - in fact, I've only tried loading it in an emulator with simulated loading, so I guess it could be an emulator thing, but it doesn't happen with other taps.

Should add that it happens with or without the poke.
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: Add loading screen to .tap file

Post by Ast A. Moore »

Well, the way you make a tape file seems extremely convoluted, but then I’m not here to criticize your development tools. Perhaps, you could share your resulting file with us so we could take a closer look at? Maybe you’ve overlooked something else entirely?

Also, have you considered writing a simple loader in machine code and putting it inside your BASIC bootstrap instead? It’s dead easy and gives you the level of flexibility that cannot be achieved in BASIC (including, but not limited to, loading headerless blocks).
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.
Dr_Dave
Drutt
Posts: 32
Joined: Wed Feb 05, 2020 9:58 am

Re: Add loading screen to .tap file

Post by Dr_Dave »

Ast A. Moore wrote: Mon Mar 02, 2020 10:35 am Well, the way you make a tape file seems extremely convoluted, but then I’m not here to criticize your development tools. Perhaps, you could share your resulting file with us so we could take a closer look at? Maybe you’ve overlooked something else entirely?

Also, have you considered writing a simple loader in machine code and putting it inside your BASIC bootstrap instead? It’s dead easy and gives you the level of flexibility that cannot be achieved in BASIC (including, but not limited to, loading headerless blocks).
Ha! I can't claim credit for the convolutedness... I was just following one of the earlier posts in this thread :)

Haven't considered the machine code loader route. Do you have a link to how to achieve this?

Cheers!
User avatar
Alessandro
Dynamite Dan
Posts: 1908
Joined: Wed Nov 15, 2017 11:10 am
Location: Messina, Italy
Contact:

Re: Add loading screen to .tap file

Post by Alessandro »

Here is an example loader. It assumes that your program must starts at the beginning of its code.

You can turn it into a machine code program loaded as a BASIC one with Pasmo and BIN2DATA:

pasmo --bin loader.asm loader.bin
bin2data -org 24000 -rem loader.bin loader.tap

Remember to remove in ZX-Blockeditor the headers for the screen and main code blocks.

Edit: Use Pasmo v0.5.4 beta 2, 0.6.0 is untested and can cause problems. BIN2DATA can be downloaded from here.

Code: Select all

  ORG 24000

  XOR A
  LD (23693),A     ; PAPER 0, INK 0, BRIGHT 0
  CALL 3503          ; CLS
  LD IX,16384      ; first block address
  LD DE,6912       ; first block length

  CALL LOADER

  LD IX,24064      ; second block address
  LD DE,32766      ; second block length

  CALL LOADER

  JP 24064           ; main program start

LOADER:
  LD   A,255
  SCF
  CALL 1366        ; loads the block
  RET
Last edited by Alessandro on Mon Mar 02, 2020 11:04 am, edited 3 times in total.
Dr_Dave
Drutt
Posts: 32
Joined: Wed Feb 05, 2020 9:58 am

Re: Add loading screen to .tap file

Post by Dr_Dave »

Cool! Thanks :)
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: Add loading screen to .tap file

Post by Ast A. Moore »

The simplest headerless loader will look something like this:

Code: Select all

	xor a		;clear screen (black ink on black paper)
        ld (23693),a
        call $daf

	ld ix,$4000
	ld de,$1b00
	scf
	sbc a,a
	call $556	;load screen$
	
	ld ix,24064
	ld de,32766
	scf
	sbc a,a
	call $556	;load main data
	
	jp 24064	;run game code
34 bytes, if I’m not mistaken
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
bob_fossil
Manic Miner
Posts: 654
Joined: Mon Nov 13, 2017 6:09 pm

Re: Add loading screen to .tap file

Post by bob_fossil »

Dr_Dave wrote: Mon Mar 02, 2020 6:35 am Thought I'd piggy back a question on this thread, rather than start another...

I'm trying to insert a loading screen in my game's tap file... I've followed the instructions given on page one, and it has mostly worked.

I created a game tap file from sjasmplus (with savetap "filename.tap"), loaded that into ZX-Blockeditor, stripped out all but the basic loader. Loaded the loader into Spin, inserted load "" screen$, saved, loaded back into ZX-Blockeditor then reinserted my game programme data header and data, then my screen header and data between them. The result looks like this:

Image

And it mostly works. The game loads the screen, then the game and the game starts.

However - as soon as it finishes loading in the screen and the game data begins to load, the loading screen gets blanked and I can't figure out why. It just empties out to a mostly white screen with two black character lines at the bottom.

Anyone any idea what I'm missing?

Here's the loader, if it helps:

Image
As an aside, I have observed that using POKE 23739, 111 - which stops the tape loader printing 'Bytes: blah' over your screen - does seem to render the 128 Basic editor unusable if your basic loader has an error and needs to return you to the editor. 48 Basic and USR 0 mode seem unaffected. I used to use POKE 23739, CODE "o" to save a couple of bytes.
User avatar
WhatHoSnorkers
Manic Miner
Posts: 252
Joined: Tue Dec 10, 2019 3:22 pm

Re: Add loading screen to .tap file

Post by WhatHoSnorkers »

POKE 23739,244 fixes that I think
I have a little YouTube channel of nonsense
https://www.youtube.com/c/JamesOGradyWhatHoSnorkers
Post Reply