Timing for flash attribute
Timing for flash attribute
When flash attribute is set, ink and paper are swapped every 32 frames, but is it possible to find out after which frame it happens? Just curious
-
- Manic Miner
- Posts: 401
- Joined: Fri Jan 03, 2020 10:00 am
Re: Timing for flash attribute
Using a light gun?
Re: Timing for flash attribute
I don't know if it's technically possible to query this from the hardware in any way - someone else might know better. If you really want to know what frame it changes on then I guess you'd need to add a user-calibration step and then keep a count in your interrupt routine
I'm interested to know if you have something in mind or if this is just technical curiosity?
I'm interested to know if you have something in mind or if this is just technical curiosity?
Re: Timing for flash attribute
So far as I know, the frame counter is internal to the ULA and there's no way to read the value of it.
Obviously it can be inferred from the video output, but there's no way for the CPU to read that on an unmodified Spectrum either.
Obviously it can be inferred from the video output, but there's no way for the CPU to read that on an unmodified Spectrum either.
- 1024MAK
- Bugaboo
- Posts: 3123
- Joined: Wed Nov 15, 2017 2:52 pm
- Location: Sunny Somerset in the U.K. in Europe
Re: Timing for flash attribute
Simple answer: no.
There is no provision for the Z80 to access the circuitry that performs this function. The video display system in the ULA is independent from the Z80 and the only readable ULA register is the one that has the keyboard and ear (tape) data bits.
Mark
Standby alert
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
Re: Timing for flash attribute
I seem to recall this question being asked a while back in the WoS forum, and many tantalisingly clever ideas getting comprehensively dismissed.
I agree, the answer is no - unless you get the user to calibrate it by eye/keypress, or more accurately with a lightgun or such, as suggested above.
Re: Timing for flash attribute
Light guns ... They probably don't work well on LCD?
Re: Timing for flash attribute
I quite like the idea of (someone) being able to set up a big chunky shape that flashes Black/Colour (which would feel like on/off if on a black background). Then some detailing round the edge being drawn/erased in sync with the flashes.
Maybe leaving more processing time for doing something else (rather than it all being used on drawing/undrawing a big shape).
(Maybe there's an idea for a game there somewhere)
If it's happening every 32 frames, then maybe it would be possible to hand tweak on which frame it does it.
Flash a block, redraw the block next to it every 32 frames, and move the offset adjustment til its right.
Maybe leaving more processing time for doing something else (rather than it all being used on drawing/undrawing a big shape).
(Maybe there's an idea for a game there somewhere)
If it's happening every 32 frames, then maybe it would be possible to hand tweak on which frame it does it.
Flash a block, redraw the block next to it every 32 frames, and move the offset adjustment til its right.
CLEAR 23855
Re: Timing for flash attribute
That's what's meant by "user calibration"
You could have a screen at the start of the game with something like a whole line of flashing attributes, and below that another line in the same colours which you swap the colours for each cell on each of the 32 frames, and ask the user to select which one is in sync or something like that.
but if you're going to write a bunch of code to swap attributes synced to frames etc you might as well just do that for the sprite in your game and have the flexibility of whatever colours you want instead of the usually hideous ink/paper invert flash
Re: Timing for flash attribute
Should be easy to do calibration in hardware. Have black border and full screen flashing between black and white. Take the Y component of the video out and read it back on some port. Some simple voltage divider may be needed and of course address decoding.
When entire screen is black, you always get 1 (since Y is inverted). When screen changes to white, it will start flashing between 1 and 0, so you know it's the first white frame.
For models with RGB out, just read any one color instead of Y
When entire screen is black, you always get 1 (since Y is inverted). When screen changes to white, it will start flashing between 1 and 0, so you know it's the first white frame.
For models with RGB out, just read any one color instead of Y
- Lethargeek
- Manic Miner
- Posts: 743
- Joined: Wed Dec 11, 2019 6:47 am
Re: Timing for flash attribute
the switch is happening every 16 frames (32 is the full cycle)
no need for that, start/end frame is immediately visible to naked eye
here's a simple visualizer: https://cloud.mail.ru/public/3Vuq/2oKexoL99
(i was too lazy to draw actual numbers, but a grid is sufficient to show it)