Scratchpad

If you are new to Scratchpad, and want full access as a Scratchpad editor, create an account!
If you already have an account, log in and have fun!!

READ MORE

Scratchpad
(Adjusted timings to be relative to the ULA asserting INTREQ)
(Remove SinclairFAQ template argument)
Tag: sourceedit
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
  +
{{SinclairFAQ|Floating bus}}
  +
 
When the Z80 reads from an unattached port it will read the data present on the ULA bus, which will be a display byte being transferred to the video circuits or 0xFF when idle, such as periods spent building the border.
 
When the Z80 reads from an unattached port it will read the data present on the ULA bus, which will be a display byte being transferred to the video circuits or 0xFF when idle, such as periods spent building the border.
   
 
Each scanline of video memory fetches breaks down into a 16 x 8 cycle sequence with two sets of display and attribute bytes (order: bitmap, attribute, bitmap+1, attribute+1) being fetched during the first 4 cycles followed by 4 idle cycles. The ULA bus remains idle for the remainder of each scanline and returns 0xFF.
 
Each scanline of video memory fetches breaks down into a 16 x 8 cycle sequence with two sets of display and attribute bytes (order: bitmap, attribute, bitmap+1, attribute+1) being fetched during the first 4 cycles followed by 4 idle cycles. The ULA bus remains idle for the remainder of each scanline and returns 0xFF.
   
The following table shows the fetch cycles for the first 8 cycle sequence of the 48K and 128K models:
+
The following table shows the fetch cycles for the first 8 cycle sequence of the 48K and 128K models<ref>This document labels the first tstate which ''begins'' with /INT low as tstate 0; some other resources label this as tstate 1 which will mean all tstate counts are one greater.</ref>:
   
{| border=1
+
{| border="1"
 
|-
 
|-
 
! 48K
 
! 48K
 
! 128K
 
! 128K
 
! ULA bus
 
! ULA bus
 
|-
  +
| 14338
  +
| 14364
  +
| (0x4000)
 
|-
 
|-
 
| 14339
 
| 14339
 
| 14365
 
| 14365
| (0x4000)
+
| (0x5800)
 
|-
 
|-
 
| 14340
 
| 14340
 
| 14366
 
| 14366
| (0x5800)
+
| (0x4001)
 
|-
 
|-
 
| 14341
 
| 14341
 
| 14367
 
| 14367
| (0x4001)
+
| (0x5801)
 
|-
 
|-
 
| 14342
 
| 14342
 
| 14368
 
| 14368
 
| IDLE
| (0x5801)
 
 
|-
 
|-
 
| 14343
 
| 14343
Line 37: Line 43:
 
| 14345
 
| 14345
 
| 14371
 
| 14371
| IDLE
 
|-
 
| 14346
 
| 14372
 
 
| IDLE
 
| IDLE
 
|}
 
|}
   
  +
Note that these timings will all be one tstate later on "[[Contended memory#Timing differences|late timing]]" machines.
   
This [http://homepage.ntlworld.com/mark.woodmass/Float48k.tap 48K test program] can be used for testing an emulator's floating bus implementation. Note that the Z80 samples the data bus during the final T-state of the I/O machine cycle. All timings are relative to the ULA asserting the INTREQ line; as the Z80 samples this line during the final T-state of opcode execution, there is a minimum of a one cycle delay before the Z80 acknowledges the interrupt.
+
These [http://homepage.ntlworld.com/mark.woodmass/Float48k.tap 48K] and [http://homepage.ntlworld.com/mark.woodmass/Float128k.tap 128K] test programs may be used for testing an emulator's floating bus implementation. Note that the Z80 samples the data bus during the final T-state of the I/O machine cycle. All timings are relative to the ULA asserting the INTREQ line; as the Z80 samples this line during the final T-state of opcode execution, there is a minimum of a one cycle delay before the Z80 acknowledges the interrupt.
   
 
The same effect is likely to be seen when reading unattached memory, such as reading the upper 32K on a 16K machine.
 
The same effect is likely to be seen when reading unattached memory, such as reading the upper 32K on a 16K machine.
   
  +
== Commercial games ==
[[Category:ZX Spectrum technical information]]
 
  +
  +
A number of commercial games used the floating bus effect, generally to synchronise with the display and allow for flicker-free drawing. Games known to use the floating bus include:
  +
  +
* ''[[wikipedia:Arkanoid|Arkanoid]]'' (original release only, the Hit Squad rerelease does not use the floating bus)
  +
* ''[[wikipedia:Cobra (film)#Video game|Cobra]]'' (original release only, the Hit Squad rerelease does not use the floating bus)
  +
* ''[[wikipedia:Sidewize|Sidewize]]''
  +
* [[wikipedia:Short_Circuit|Short Circuit]]
  +
  +
  +
== Notes ==
  +
  +
<references />

Latest revision as of 23:45, 22 May 2015

This article has been moved or is in the process of being moved to the Sinclair FAQ Wiki, under the "Floating bus" article. You may find more complete information there.


When the Z80 reads from an unattached port it will read the data present on the ULA bus, which will be a display byte being transferred to the video circuits or 0xFF when idle, such as periods spent building the border.

Each scanline of video memory fetches breaks down into a 16 x 8 cycle sequence with two sets of display and attribute bytes (order: bitmap, attribute, bitmap+1, attribute+1) being fetched during the first 4 cycles followed by 4 idle cycles. The ULA bus remains idle for the remainder of each scanline and returns 0xFF.

The following table shows the fetch cycles for the first 8 cycle sequence of the 48K and 128K models[1]:

48K 128K ULA bus
14338 14364 (0x4000)
14339 14365 (0x5800)
14340 14366 (0x4001)
14341 14367 (0x5801)
14342 14368 IDLE
14343 14369 IDLE
14344 14370 IDLE
14345 14371 IDLE

Note that these timings will all be one tstate later on "late timing" machines.

These 48K and 128K test programs may be used for testing an emulator's floating bus implementation. Note that the Z80 samples the data bus during the final T-state of the I/O machine cycle. All timings are relative to the ULA asserting the INTREQ line; as the Z80 samples this line during the final T-state of opcode execution, there is a minimum of a one cycle delay before the Z80 acknowledges the interrupt.

The same effect is likely to be seen when reading unattached memory, such as reading the upper 32K on a 16K machine.

Commercial games

A number of commercial games used the floating bus effect, generally to synchronise with the display and allow for flicker-free drawing. Games known to use the floating bus include:

  • Arkanoid (original release only, the Hit Squad rerelease does not use the floating bus)
  • Cobra (original release only, the Hit Squad rerelease does not use the floating bus)
  • Sidewize
  • Short Circuit


Notes

  1. This document labels the first tstate which begins with /INT low as tstate 0; some other resources label this as tstate 1 which will mean all tstate counts are one greater.