I am in the middle of looking at generating timing sensitive code (SAM MOD player) and am surprised by the pc:1 x 5 contention on the last 5 t-states.
Based on http://www.z80.info/z80ins.txt
JR e 2 OCF(4) OD(3) IO(5)
So that's
- 4 t-state opcode fetch (memory access -> contended)
- 3 t-state opcode data (memory access -> contended)
- 5 t-state internal operation.
I did not expect an internal operation on the z80 to be contended?
Starting emulator - help with basics of Z80 timing needed
Re: Starting emulator - help with basics of Z80 timing needed
And if I am reading what SimCoupe is doing correctly, https://github.com/simonowen/simcoupe/b ... e/Z80ops.h is simply adding 5 to the CycleCounter.
Re: Starting emulator - help with basics of Z80 timing needed
They're contended because the ULA doesn't look at the control bus for MREQ signals and the like and only respond to what it sees on the address bus which is the last address latched, or the address of the JR offset byte in this case.
The +2a/+3 does acknowledge these signals and those final 5 t-states are not contended.
Re: Starting emulator - help with basics of Z80 timing needed
Aha - it's an (old) Speccy thing, so I am going to assume that the SAM Coupé is also sensible enough to leave them uncontended.Woodster wrote: ↑Sun Aug 18, 2019 9:45 amThey're contended because the ULA doesn't look at the control bus for MREQ signals and the like and only respond to what it sees on the address bus which is the last address latched, or the address of the JR offset byte in this case.
The +2a/+3 does acknowledge these signals and those final 5 t-states are not contended.
Thank you for clearing that up.
- DouglasReynholm
- Manic Miner
- Posts: 349
- Joined: Wed Feb 20, 2019 8:38 pm
- Ast A. Moore
- Rick Dangerous
- Posts: 2641
- Joined: Mon Nov 13, 2017 3:16 pm
Re: Starting emulator - help with basics of Z80 timing needed
“You’ve got spunk and balls, and I like that in a woman.”DouglasReynholm wrote: ↑Sun Aug 18, 2019 10:45 am Best I can do at short notice, take it or leave it.
Every man should plant a tree, build a house, and write a ZX Spectrum game.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Re: Starting emulator - help with basics of Z80 timing needed
Dobro došao Zorane.
Glad to see some ex-yu Spectrum fans here and look forward to your future emulator.
Once again, welcome to this great forum.