Custom raster bars

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
User avatar
TMD2003
Rick Dangerous
Posts: 2043
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Custom raster bars

Post by TMD2003 »

Anyone who remembers me asking this on t'other forum back in the days when this forum didn't exist and wouldn't do for over a decade, pretend you forgot, or wipe your memory, and we'll begin...

How hard is it to change the colour of the raster bars on an otherwise-standard ROM loader? I'm thinking something like the Kixx re-release of Gauntlet, where the pilot appears magenta/green, and the data appears black/white. Every other example I can think of, off the top of my head, involves a turbo loader of some description.

The further thought occurs, could this be applied to loading any kind of data, or is it restricted to machine code? It's something I was thinking of doing for Corona Capers, i.e. "wouldn't it be great if I could change the raster bars to red and yellow", and that was loading a mixture of BASIC, bytes (not really machine code, just a couple of character sets) and character arrays.
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
AndyC
Dynamite Dan
Posts: 1406
Joined: Mon Nov 13, 2017 5:12 am

Re: Custom raster bars

Post by AndyC »

No more difficult than writing any sort of custom loader. But writing a custom loader isn't exactly for the feint hearted. And ultimately you're loading data and that data can be whatever you want, but it seems overkill to write a custom machine code loader just to load a BASIC program
User avatar
MonkZy
Manic Miner
Posts: 279
Joined: Thu Feb 08, 2018 1:01 pm

Re: Custom raster bars

Post by MonkZy »

The border values in the ROM loader is XOR'd between changes so there are some very easy pairs of colours.

BLUE(001)/YELLOW(110) and RED(010/CYAN(101) are the two that Sinclair adopted, GREEN(100)/MAGENTA(011) and BLACK(000)/WHITE(111) are very easy to achieve by tweaking the standard ROM routine.
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2641
Joined: Mon Nov 13, 2017 3:16 pm

Re: Custom raster bars

Post by Ast A. Moore »

The easiest way to do it would be to copy the ROM’s loader into RAM and then change a couple of values that affect the border colors. That would make for the smallest loader (your custom loader, that is; the one that would have to do all that).

Writing a custom loader—turbo or not—is a lot of fun, and I’ve certainly dedicated many an hour to that. It’s actually trivial to make a loader that is smaller and more efficient that the one found in the ROM.

If you want to load a BASIC program via a custom loader, keep in mind there might be quite a few maintenance tasks you’ll need to do. I covered a few aspects in my writeup accompanying with the release of the prototype version of Yankee a few years back. (Scroll down to the section entitled “The Inventor of Useless Skills.”)

However, it primarily deals with loading headerless data blocks. If you don’t mind keeping the header, you can just copy the ROM loader as is and modify the relevant parts of the code that change the border colors. (You’ll of course be limited to a specific set of combinations.)
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
Alessandro
Dynamite Dan
Posts: 1910
Joined: Wed Nov 15, 2017 11:10 am
Location: Messina, Italy
Contact:

Re: Custom raster bars

Post by Alessandro »

For a concrete example, you might be interested in taking a look at my SetoLOAD loader. It is a modification of the ROM loader coming into several color schemes - two multicolor and ten with up to four colors each. Sources and examples available.
Post Reply