ULA+ palette question

Y'know, other stuff, Sinclair related.
Post Reply
User avatar
XTM
Manic Miner
Posts: 794
Joined: Mon Jun 22, 2020 12:09 am
Location: Cologne, Germany
Contact:

ULA+ palette question

Post by XTM »

I wasn't really sure what section to post this in, so it goes in here.

Disclaimer: I don't use ULA+ myself. Let me explain the "issue".

There's a German guy on YouTube who occasionally uploads videos of himself playing Speccy games, which already is remarkable in itself because this an incredibly rare find here in Commodoreland ;)

As far as I know, he's using a Harlequin 128 with the ZX-HD from Bytedelight. I'm not overly familiar with it but I know it supports ULA+. I think he also uses a DivMMC with that file browser (I forgot what it is called).
The issue is that after his switch to the ZX-HD a few months ago, whenever he uploads a new Speccy game video, even when it is a non-AGD game, it always shows the same (fairly garish) palette every. single. time. Here, this one:
Image

I believed the nice thing about ULA+ was that you can make your own custom palettes and I've learned from some other forum topics (like this one) that such palettes are initialised by defining them in a short Basic program prior to loading the actual game.

My assumption is that most AGD-created games simply do not have a custom palette defined, as their author either didn't know about this ULA+ feature or didn't care - or the guy whose videos I'm watching is loading his games in a way that forego/ignore the Basic bit that defines the palette.

He also did a livestream a while ago where he tried out tons of Speccy games, but the moment he went back to the file browser after playing a game created with AGD, the "wrong" palette was activated. You can see the behaviour in this video of a 4 hour+ long live stream. At 2:50:15 he loads "Jetpack Jock" which according to the SC entry was made in AGD. Running the game does however not yet trigger a switch to the ULA+ palette, as the original Speccy palette is still in place. Instead, the instant he goes back to the file browser at 2:53:16, the ULA+ palette gets activated and stays resident so to speak, though a few games/demos in-between actually seem to show a few colours closer to the original ZX palette. Hmm, not sure what's going on there ...

For all of the above, I'm wondering - where is this specific palette that I see in this guys' videos coming from? Is it a standard alternative palette that ULA+ defaults to when it isn't "fed" new values from a Basic program or elsewhere?

I'm aware of the colour fixer by XoRRoX btw., but I fear that is beyond the scope of our German YouTube guy as he probably isn't aware of which of the games he shows are made with AGD. Is there really no way to re-initialize the regular Speccy palette after the ULA+ one has "taken over"? Surely there's something I'm missing here?
User avatar
TMD2003
Rick Dangerous
Posts: 2043
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Re: ULA+ palette question

Post by TMD2003 »

XTM wrote: Thu Sep 21, 2023 10:28 pm I believed the nice thing about ULA+ was that you can make your own custom palettes and I've learned from some other forum topics (like this one) that such palettes are initialised by defining them in a short Basic program prior to loading the actual game.[/url]
OUT 48955,64: OUT 65339,1 turns ULAplus on...
OUT 48955,(0-63): OUT 65339,x turns palette entry (0-63) to value x...
XTM wrote: Thu Sep 21, 2023 10:28 pmIs there really no way to re-initialize the regular Speccy palette after the ULA+ one has "taken over"? Surely there's something I'm missing here?
...OUT 48955,64: OUT 65339,0 turns ULAplus off again.

It doesn't even have to be BASIC; it can all be translated to LD BC,xxxxx : LD A,y : OUT (C),A - and if all the y-values (for BC=65539) are held in a data table, point HL (or IX) to it, read and OUT each one, and the palette will change in an instant. I wouldn't have thought AGD would have any ULAplus code in it from scratch. And I know next to nothing about the Harlequin - but might it have a switchable facility where it stores the ULAplus data in its own memory and can activate palettes independently of the game?

If I've remembered correctly, the Super Game Boy could do that (i.e. the peripheral that allowed Game Boy games to be played on a TV via a SNES) - it allowed easy customisation of the Game Boy's four "colours" - the original LCD greens, black/white/two greys, or even some combination of other colours like an Amstrad CPC in non-Lego mode. Whether or not it could do that in the middle of a game I have no idea, but with the game on an unmodifiable ROM cartridge it would make sense if it was the Super Game Boy working independently of the cartridge plugged into it.
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: 1408
Joined: Mon Nov 13, 2017 5:12 am

Re: ULA+ palette question

Post by AndyC »

Iirc there was a mistake in AGD where it always enabled ULA+ mode, even if the developer didn't intend it. And as a result a whole bunch of AGD games ship with a broken palette if you play them on a machine that has ULA+ hardware. I think it's been changed in more recent versions, but that involves rebuilding the game with the latest engine.
User avatar
1024MAK
Bugaboo
Posts: 3123
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: ULA+ palette question

Post by 1024MAK »

As far as I am aware, the Harlequin 128 does not support ULA+ features. The Harlequin boards use normal logic chips rather than any ULA, gate array, CPLD or FPGA.

The ZX-HD does however support ULA+ features.

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
User avatar
flatduckrecords
Manic Miner
Posts: 787
Joined: Thu May 07, 2020 11:47 am
Location: Oban, Scotland
Contact:

Re: ULA+ palette question

Post by flatduckrecords »

Newer versions of the browser (including Bob Fossil’s one) now reset the palette correctly when launching/browsing, but the old NMI browser that originally came with my DivMMC didn’t—so you could end up with the wrong palette if you play a ULA+ game followed by an original game (without resetting in between). I’m not aware of it persisting across power cycles though, is that what seems to be happening? My Harlequin and ZX-HD don’t do that.
User avatar
XTM
Manic Miner
Posts: 794
Joined: Mon Jun 22, 2020 12:09 am
Location: Cologne, Germany
Contact:

Re: ULA+ palette question

Post by XTM »

Thanks for all the responses.

So what I gather from this is, these old games where the authors didn't intend any ULA+ palette so didn't define one, the AGD game just initializes one. I'm still wondering where these specific colours are coming from, like if they are the default ULA+ palette values for AGD games, somewhere present in their data ...

@TMD2003
I have a Super Game Boy though I haven't used it in decades, but iirc you could indeed change the colours anytime you wanted, and define a few custom ones.

@flatduckrecords
Well, I'm trying to figure out what happened in the videos by the German guy, his name is Thomas btw so I'll refer to that name from now on.
As far as I've seen the latest three videos on Thomas' ZX Spectrum playlist all show this palette. But one of the games, Hyperkill, does not mention AGD on its SC database entry or it's homepage. However, judging by the very typical beeper sound effects, I assume it actually is an AGD game. Therefore, if my assumption is correct, nothing out of the ordinary so to speak for these 3 games, just the "bug" occuring.
On the other hand, during Thomas' live stream when the colour persisted after one AGD game was run, he probably never carried out a power cycle (you mean properly turning off the machine and all attached hardware, right).
Is there an easy way for Thomas to update Bob Fossil's browser? I don't think he is too deep/knowledgeable into/about Speccy stuff as it is only one of many machines he shows in his videos. I'd like to point him to somewhere he can get such an update. Well, I think it's the one found here -> http://www.thefossilrecord.co.uk/author/bob_fossil_esq/
(Hmm, is he even using Bob Fossil's browser? Here is a screenshot from the video of what he is using. I'm not familiar with any of these as I don't use any real hardware with modern stuff attached to it):
Image
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: ULA+ palette question

Post by Jbizzel »

AndyC wrote: Fri Sep 22, 2023 5:15 pm Iirc there was a mistake in AGD where it always enabled ULA+ mode, even if the developer didn't intend it. And as a result a whole bunch of AGD games ship with a broken palette if you play them on a machine that has ULA+ hardware. I think it's been changed in more recent versions, but that involves rebuilding the game with the latest engine.
This.

Cocaine bear had this issue when i played the first version. So did Yoyos revenge. Took me ages to realise it was an adg bug and not something I was doing
User avatar
flatduckrecords
Manic Miner
Posts: 787
Joined: Thu May 07, 2020 11:47 am
Location: Oban, Scotland
Contact:

Re: ULA+ palette question

Post by flatduckrecords »

XTM wrote: Fri Sep 22, 2023 9:19 pm Is there an easy way for Thomas to update Bob Fossil's browser?
Yes it looks like Thomas is using the standard browser (and esxDOS v086, I think, which is quite old). See the first post in Bob’s thread for the alternative browser. I think Thomas would need to update esxDOS to v089 though. It’s not difficult but he’d need to run the tap file to re-flashes the device so it’s not trivial.

I think it’s a worthwhile upgrade just for the long filename support, but might be a challenge for someone not so familiar. In any case it seems the main problem is an AGD bug anyway so on balance it might be better not to update after all!

Power cycle - yes I meant powering the system down. (That shouldn’t be necessary, a normal reset should clear the palette back to default).



And just to demonstrate a non-AGD game, I took this pic a while ago - I used the old NMI browser to load up one of the ULA+ demos, then (without resetting) loaded up Dizzy while the custom palette was still active. So that’s what I thought was going on, but I see from Thomas’ playlist they are all (?) modern/AGD games.
User avatar
XTM
Manic Miner
Posts: 794
Joined: Mon Jun 22, 2020 12:09 am
Location: Cologne, Germany
Contact:

Re: ULA+ palette question

Post by XTM »

Ewww, your Dizzy screenshot looks like a shoddy Speccy port on the CPC :lol:

Yes, it appears the games he showed after he got his ZX-HD are all AGD games. But he got it only a few months ago, the vast majority in his playlist was made using an original 48k Speccy that broke eventually, triggering his upgrade to the Harlequin.

You only really saw the behaviour you showed with that Dizzy pic on the 4 hours+ long livestream Thomas did a few months ago. Probably too much of a faff for him to update the browser. I'll live with it, Speccy colour misrepresentation for a very limited German audience (his Commodore/Atari etc. streams usually fetch a larger audience, most people here have no Speccy nostalgia so they just don't seem to be interested, sad truth).
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: ULA+ palette question

Post by Jbizzel »

This is way off topic, but does bobs browser work on a standard divide like the 57c I have?

I've got it in my head that it doesn't.
User avatar
XTM
Manic Miner
Posts: 794
Joined: Mon Jun 22, 2020 12:09 am
Location: Cologne, Germany
Contact:

Re: ULA+ palette question

Post by XTM »

So in closing, am I correct in assuming ULA+ palettes are only turned on by software? Or is there a function where you can define your own custom palette (similar to the palette editors available in some Speccy emulators like Spin) and have it always active, so that for example you turn on your system, activate this palette in some kind of menu and then play all old "classic" software with it?
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: ULA+ palette question

Post by Jbizzel »

You can program the pallette in basic etc, or load it in before you load a different program.

So yes, activated by software

See:


https://sinclair.wiki.zxnet.co.uk/wiki/ULAplus
AndyC
Dynamite Dan
Posts: 1408
Joined: Mon Nov 13, 2017 5:12 am

Re: ULA+ palette question

Post by AndyC »

If you enable ULA+ and define your own palette, classic games will use it. ULA+ games will, obviously, override it with their own palette selections, of course.
User avatar
XTM
Manic Miner
Posts: 794
Joined: Mon Jun 22, 2020 12:09 am
Location: Cologne, Germany
Contact:

Re: ULA+ palette question

Post by XTM »

AndyC wrote: Sat Sep 23, 2023 3:01 pm If you enable ULA+ and define your own palette, classic games will use it. ULA+ games will, obviously, override it with their own palette selections, of course.
But what is the behaviour when you have just turned on your machine and enable ULA+? Am I correct in assuming by that point in time, you have not yet defined a palette and it still shows the standard colours? And defining it is only possible in software (like loading or typing in the Basic/Code that carries out all the OUTs necessary), right?

Edit:
I've found the info on https://zxdesign.itch.io/ulaplus and am reading it right now after having written the above paragraph. As until now I wasn't sure if you just "page in" the ULA+ functionality so to speak by simply setting a value or even a bit somewhere (similar to how you page in something on the 128K Speccy) and that "turns it on", or if changing palette values effectively is what it is all about.
AndyC
Dynamite Dan
Posts: 1408
Joined: Mon Nov 13, 2017 5:12 am

Re: ULA+ palette question

Post by AndyC »

Interestingly, it doesn't actually seem to specify the "default" colours when it is enabled. Although I'd assume most implementations default to the equivalent Speccy colours and presumably the FLASH colours default to match the default colours but without the FLASHing effect.
User avatar
1024MAK
Bugaboo
Posts: 3123
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: ULA+ palette question

Post by 1024MAK »

There’s three possible default actions available with hardware registers:
  1. Do nothing specific, hence each register bit will randomly be zero or one at power up.
  2. Either use the system reset signal or use an independent power on reset signal to reset all the register bits or to set all the register bits.
  3. Same as above, but use more complex circuitry to set specific data - such as the Speccy normal colours and attributes.
If it’s not mentioned, then it’s very likely the first point above. However, some registers may have a tendency to consistently be zero or one at power up, due to slight differences in the actual design and manufacturing of the chip.

The additional point, is that something like ULA+ is expected to always have software to program the registers to specific values for a game (or other software). Hence in the true Sinclair tradition, why would anyone include the extra complexity to implement points 2 or 3 above?

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: ULA+ palette question

Post by Seven.FFF »

1024MAK wrote: Sat Sep 23, 2023 8:27 pm There’s three possible default actions available with hardware registers
ZX-HD is not really hardware in that sense, though. It’s just a program running on a raspberry Pi. It would be perverse to go out of their way to leave what are implemented as software variables uninitialised.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
1024MAK
Bugaboo
Posts: 3123
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: ULA+ palette question

Post by 1024MAK »

@Seven.FFF Fair enough, if it’s software, then point 3 of my post above is easy and does not involve any significant extra cost.

I don’t have a ZX-HD and have not looked at it in detail.

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
AndyC
Dynamite Dan
Posts: 1408
Joined: Mon Nov 13, 2017 5:12 am

Re: ULA+ palette question

Post by AndyC »

1024MAK wrote: Sat Sep 23, 2023 8:27 pm The additional point, is that something like ULA+ is expected to always have software to program the registers to specific values for a game (or other software). Hence in the true Sinclair tradition, why would anyone include the extra complexity to implement points 2 or 3 above?
The main reason I can think of is because the default behaviour when it is off is to use the Speccy colours and that's probably simplest to achieve by just setting the ULA+ registers to known values.
animaal
Microbot
Posts: 101
Joined: Sat Mar 09, 2019 5:14 pm

Re: ULA+ palette question

Post by animaal »

I've read the specification page linked above, but still feel I don't know a lot about ULA+

Is the timing specified? I.e. how long it takes for a palette colour value to be updated when the instruction is issued? I'm wondering if runtime animations could be achieved with just palette changes. For example, a stream showing flowing water simply by updating the palette colour values - not requiring redrawing the steam each frame.
AndyC
Dynamite Dan
Posts: 1408
Joined: Mon Nov 13, 2017 5:12 am

Re: ULA+ palette question

Post by AndyC »

I believe that, like most 8-bit machines with a palette based display, it's effectively instant. You can certainly achieve "waterfall" like effects, since that only really requires rotating palette entries once per frame. I'd assume you could also create "raster bar" type effects too (by changing a single colour entry multiple times per frame), although getting the timing to position it right on the Speccy might be the more difficult part.
User avatar
Lee Bee
Dynamite Dan
Posts: 1297
Joined: Sat Nov 16, 2019 11:01 pm
Location: Devon, England
Contact:

Re: ULA+ palette question

Post by Lee Bee »

I love the idea of being able to play around with your Speccy's colour palette and change a game's colour. Also love the Speccy being able to have an orange.

On the other hand, I'm a fan of standardisation, and really don't like the inconsistency of all these different ZX models with their different hardware abilities. One of the reasons I like retro machines is that they never change. Their limitations present a challenge which is satisfying to work against. But if these hardware limitations are forever being "improved" then this sense of achievement is nullified because the goalposts are being shifted arbitrarily, and no one truly knows what a Spectrum "is". Where do you draw the limit for upgrades before you have to stop calling it a Speccy? (The Next crossed that line IMHO.)

Personally, I'd be happy if someday the Speccy community would agree on a permanent, standardised set of hardware limitations to be used by all developers. Something not too different from the original, just with a few helpful tweaks, maybe a touch more memory. (A touch more speed would also be nice.) This could still come in a variety of form factors, but everyone would have the same, standard hardware.
User avatar
bob_fossil
Manic Miner
Posts: 661
Joined: Mon Nov 13, 2017 6:09 pm

Re: ULA+ palette question

Post by bob_fossil »

Jbizzel wrote: Sat Sep 23, 2023 8:40 am This is way off topic, but does bobs browser work on a standard divide like the 57c I have?

I've got it in my head that it doesn't.
I don't own a divIDE but I have had reports and seen YouTube videos of people using my browser with it. After copying over the modified BIN and SYS files from the browser .zip file, you need to then go into the 'No_MMC_Memory' folder and copy the BIN and SYS folders in there over the original folders on the root of the disk.
Post Reply