Ooops
November 27, 2021, 22:43:18

Author Topic: Port 255 on the ZX Spectrum  (Read 522 times)

Offline Baggey

  • Sr. Member
  • ****
  • Posts: 293
Port 255 on the ZX Spectrum
« on: July 24, 2021, 16:09:21 »
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. DID Technology stop or have we been assimulated!

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

Jesus was only famous because of his DAD.    Resistance Is Futile! Your code will be assimulated!

Offline col

  • Hero Member
  • *****
  • Posts: 608
Re: Port 255 on the ZX Spectrum
« Reply #1 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)
« Last Edit: July 25, 2021, 05:17:32 by col »

Offline Baggey

  • Sr. Member
  • ****
  • Posts: 293
Re: Port 255 on the ZX Spectrum
« Reply #2 on: July 30, 2021, 17:50:50 »
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. DID Technology stop or have we been assimulated!

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

Jesus was only famous because of his DAD.    Resistance Is Futile! Your code will be assimulated!

Offline Baggey

  • Sr. Member
  • ****
  • Posts: 293
Re: Port 255 on the ZX Spectrum
« Reply #3 on: July 30, 2021, 19:23:10 »
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. DID Technology stop or have we been assimulated!

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

Jesus was only famous because of his DAD.    Resistance Is Futile! Your code will be assimulated!

Offline 3DzForMe

  • Hero Member
  • *****
  • Posts: 1286
Re: Port 255 on the ZX Spectrum
« Reply #4 on: July 31, 2021, 08:57:52 »
Good luck with sorting out Port 255, sterling work so far with your ZX emulator!

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal