Port 255 on the ZX Spectrum

Started by Baggey, July 24, 2021, 16:09:21

Previous topic - Next topic

Baggey

Ive tried various researchs on the web and can't seem to find anything on the above PORT 255.

Any Zx Spectrum or Z80 Gurru's out there know what port 255 is or how it effects the machine itself?

Emulating the Game Cobra by imagine their is an in on PORT 255 i can only get it to work by forcing it to recive a 1? or it hangs forever.

Kind Regards Baggey
Running a PC that just Aint fast enough!? i7 Quad core 16GB ram 1TB SSD and NVIDIA Quadro K620 . DID Technology stop! Or have we been assimulated!

ZX Spectrum 48k, C64, ORIC Atmos 48K, Enterprise 128K, The SID chip. Im Misunderstood!

col

#1
This is related to what is called 'the floating bus' on the Spectrum - a timing trick used to know when to start rendering pixels for smooth screen scrolling.
https://sinclair.wiki.zxnet.co.uk/wiki/Floating_bus
https://worldofspectrum.org/faq/reference/48kreference.htm#IOContention

Here's a little explanation of how it worked in the Sidewize game:
https://stevewetherill.com/2015/02/24/the-sidewize-test-zx-spectrum-floating-bus-shenanigans/
http://www.zxdesign.info/sidewizeTest.shtml

After reading that article take a look at a screenie for Cobra and you'll also notice the same 'black bar' between the play area and the stats area that's used for syncing the cpu with the TVs raster beam 8)
https://github.com/davecamp

"When you observe the world through social media, you lose your faith in it."

Baggey

Quote from: col on July 25, 2021, 04:47:35
This is related to what is called 'the floating bus' on the Spectrum - a timing trick used to know when to start rendering pixels for smooth screen scrolling.
https://sinclair.wiki.zxnet.co.uk/wiki/Floating_bus
https://worldofspectrum.org/faq/reference/48kreference.htm#IOContention

Here's a little explanation of how it worked in the Sidewize game:
https://stevewetherill.com/2015/02/24/the-sidewize-test-zx-spectrum-floating-bus-shenanigans/
http://www.zxdesign.info/sidewizeTest.shtml

After reading that article take a look at a screenie for Cobra and you'll also notice the same 'black bar' between the play area and the stats area that's used for syncing the cpu with the TVs raster beam 8)

:o Wow thanks for the Links.

I am in deed getting some flickering on graphics in some games. Cobra, Sidewize, Commando, Arkanoid.

Im also getting some graphic curruption with, Konami's Ping Pong, War, Scuba dive, Sidewize

Incidently I cant get Green Beret to move right passed the middle of the screen for some reason?

Cyclone was hard to get going as it called an Interupt at 65535 ie in the real machine we fetch values from address 0, i was getting random numbers. I needed to to write a check insuring i fed back 243! To get it to run.

Deviating slightly from port 255 i know but Contended memory timing and video/ ULA screen timing and sound Timing seems to be Creeping up on me. Pointing me in the direction now of Keeping track off Time Better.  ::)

So to stop the flickering could be tricky as im printing the whole screen out in one go. It now seems that on the forth Cycle of the ULA or the last Attribute byte needs to be sent to Port 255. Every 32 byte's of the screen updated? It would seem  ???

if i understand it thou, once the ULA has control it write's the whole screen in one go anyway! So how does a reference to IN A,(255) give a value that's say 2/3 rd's down the screen. Because if the Screen is written in one go the Attribute value would hold the bottom right corner of the screen? Hmm

Baggey

Running a PC that just Aint fast enough!? i7 Quad core 16GB ram 1TB SSD and NVIDIA Quadro K620 . DID Technology stop! Or have we been assimulated!

ZX Spectrum 48k, C64, ORIC Atmos 48K, Enterprise 128K, The SID chip. Im Misunderstood!

Baggey

So, Ive ordered this book!

http://www.zxdesign.info/book/theZXSpectrumULA.shtml

Hopeing that I can perfect SpecBlitz Emulator and Understand More of the internal workings of the ULA ::)

Kind Regards Baggey
Running a PC that just Aint fast enough!? i7 Quad core 16GB ram 1TB SSD and NVIDIA Quadro K620 . DID Technology stop! Or have we been assimulated!

ZX Spectrum 48k, C64, ORIC Atmos 48K, Enterprise 128K, The SID chip. Im Misunderstood!

3DzForMe

Good luck with sorting out Port 255, sterling work so far with your ZX emulator!
BLitz3D, IDEal, AGK Studio, BMax, Java Code, Cerberus
Recent Hardware: Dell Laptop
Oldest Hardware: Commodore Amiga 1200 with 1084S Monitor & Blitz Basic 2.1