Freeware Loading Screen

From Retrosoftware

(Difference between revisions)
Jump to: navigation, search
(Configuring the screen display)
(Freeware Loading Screen)
Line 1: Line 1:
= Freeware Loading Screen =
= Freeware Loading Screen =
-
In order to establish a consistent branding of our products, all Retro Software freeware releases will feature a Micro Power style cassette inlay and loading screen as shown below:
+
In order to establish a consistent branding of our products, all Retro Software freeware releases will feature a Micro Power style cassette inlay and loading screen as shown below.
-
This document will describe how to configure and use such a loading screen in your own projects.
+
This document describes how to configure and use such a loading screen in your own projects.
[[Image:SparseInvaders-WIPcover.png|260x256px]]
[[Image:SparseInvaders-WIPcover.png|260x256px]]
Line 19: Line 19:
[[Media:FreewareLoader_DFS.zip|FreewareLoader_DFS.zip]]<br>
[[Media:FreewareLoader_DFS.zip|FreewareLoader_DFS.zip]]<br>
[[Media:FreewareLoader_ADFS.zip|FreewareLoader_ADFS.zip]]
[[Media:FreewareLoader_ADFS.zip|FreewareLoader_ADFS.zip]]
 +
== How To Use ==
== How To Use ==

Revision as of 13:39, 13 January 2011

Contents

Freeware Loading Screen

In order to establish a consistent branding of our products, all Retro Software freeware releases will feature a Micro Power style cassette inlay and loading screen as shown below.

This document describes how to configure and use such a loading screen in your own projects.

Image:Sparse_Invaders_load_screen.png


Downloads

These disk images contain a blank template loading screen, a BASIC configuration program and a template BASIC loader program to use as a starting point.

The DFS image is intended for BBC B, B+ and Master users. It is also suitable for Electron users with an appropriate DFS interface such as those from Pegasus or ACP.

The ADFS image is intended for Master Compact users and Electron users with a Plus 3 unit or equivalent. It is also suitable for a BBC B or B+ fitted with ADFS.

FreewareLoader_DFS.zip
FreewareLoader_ADFS.zip


How To Use

This section will describe how to use the provided disk images to create your own RS loader. It is organised as a walkthrough tutorial and should only take around 5-10 minutes to complete.

Getting started

• Load the appropriate disk into your machine or favourite emulator. If using an emulator, be sure to check that disk writes are allowed. The disk won't boot at this point because there's no loader present. We're going to make one!

• If you list the disk catalogue you will see several programs. These will be introduced one at a time.

• The file called SCREEN is an empty template of the loading screen. Running this file shows a Retro Software logo inspired by the familiar Micro Power layout.

>*/SCREEN

Image:RS_Loader_empty.png

The two windows below the logo are currently empty. So let's fill in some game details. Press Break first to clear the screen.

Configuring the screen display

• The program called CONFIG is used to add the game details to the loader screen. Load this in now:

>LOAD "CONFIG"
>_

• List the program to see what it looks like. The section that needs to be modified for your game starts at line 200. The CONFIG program has already been populated with some dummy text:

 200 PROCentry(10+DH, 1, "GAME")
 210 PROCentry(13+DH, 1, "TITLE")
 220 PROCentry(17, 0, "by")
 230 PROCentry(19, 0, "Your Name")

Each entry contains information about one line of the display:

  • the row number (9-20) +DH for double size text
  • the colour of the text (0-3)
  • the text itself (up to 16 characters)

You can create as many entries as you like providing you only use rows between 9 and 20. The default entries show the suggested layout style for most projects.

Leave the defaults as they are for your first time through this tutorial. It will make it easier to follow some of the instructions.

• Run the CONFIG program and it will ask for an output filename. Just press RETURN for now to leave the configured screen in memory without saving it to a file.

The screen can be displayed by entering the command CALL &5000.

>RUN
Output filename: {press RETURN}
>CALL &5000

Image:RS_Loader_default.png

You will notice that a text window has been created in the bottom panel of the screen. This is where the loading messages will appear.

Before we continue, let's get back to mode 7:

>MODE 7

• Now run the CONFIG program again and, this time, enter the name MYSCRN when asked for an output filename:

>RUN
Output filename: MYSCRN
*SAVE MYSCRN FF5000+3D4
>_

The CONFIG program will show the command that it used to save the file. It's worth making a note of the file length (the +3D4 part), we'll need this later.

• There will now be a version of the title screen on the disk called MYSCRN that is populated with the default game details. You can run it to see the screen if you like:

>*/MYSCRN

• We are done with the CONFIG program now, so press Break.

The BASIC loader program

• Next, let's take a look at the BASIC loader program. It's the file called BASLOAD on the disk:

>LOAD "BASLOAD"
>LIST
   10 *EXEC
   20 *FX229,1
   30 HIMEM=&5800
   40 FORI%=0TO&400STEP4:I%!&5000=I%!TOP:NEXT
   50 CALL&5000:IF ?&70>2 I%=INKEY(500):PRINT"Loading";
   60 *RUN GAME
>_

Line 10 closes any open exec channel (the script used to boot the disk).

Line 20 disables the Escape key

Line 30 sets HIMEM to the correct value for a MODE 5 screen.

Line 40 relocates the screen display code to its execute address (&5000). More on this shortly.

Line 50 calls the routine to display the loading screen. The value returned in memory location &70 is the ID of the current filing system. If this number is 2 or less, the program was loaded from tape. If the number is higher than 2 it was loaded from some other filing system. In this case, the loader prints a "Loading" message after a short delay.

Line 60 onwards is the code to run your game. For this tutorial we've (imaginatively) called it GAME!

This program is intended to be the starting point of your own custom loader. Again, for the purposes of the tutorial, just use it as-is for now.

Merging in the load screen

• The next step is to take our loading screen file and bolt it onto the end of this BASIC loader program. The variable TOP can be used to find this address:

>PRINT ~TOP
      197F
>*LOAD MYSCRN 197F
>_

• Now we need to save these combined BASIC and machine code parts as one LOADER file. The variable PAGE tells us the start address for this file. The end address is obtained by adding the screen file length noted earlier to the variable TOP:

>PRINT ~PAGE,~TOP+&3D4
      1900      1D53
>*SAVE LOADER FF1900 FF1D53 FF8023
>_

If you've forgotten the file length of the MYSCRN file, the *INFO command can be used to find it (it's the second number from the right):

>*INFO MYSCRN
$.MYSCRN      FF5000 FF5000 0003D4 010

• That's it, you're done! Press the usual Shift/Break combo to boot the loader and check it out. After a short delay, the program will fail with a "Bad command" error because there isn't actually a GAME file on the disk for it to load. But you get the idea.

Final notes

• Always remember to edit the BASLOAD file and not the LOADER file if you want to change the BASIC part of the loader. Then re-create the LOADER file using the steps above.

• If you're using cross-development tools you can, of course, just append the screen display binary (MYSCRN) to the end of your BASIC loader to create the LOADER program.

• Strictly speaking, the loader screen doesn't need to be attached to the BASIC loader, it could just be run separately. Like this, for example:

  10 *EXEC
  20 *FX229,1
  30 HIMEM=&5800
  40 *RUN MYSCREEN
  50 IF ?&70>2 I%=INKEY(500):PRINT"Loading";
  60 *RUN GAME

However, we would advise against doing this. The recommended method is a little more work but it makes for a more pleasant user experience when loading from tape.