Starting emulator - help with basics of Z80 timing needed

Struggling with Fuse or trying to find an emulator with a specific feature. Ask your questions here.
User avatar
Stefan
Dizzy
Posts: 90
Joined: Mon Nov 13, 2017 9:51 pm
Location: Belgium
Contact:

Re: Starting emulator - help with basics of Z80 timing needed

Post by Stefan » Sun Aug 18, 2019 7:55 am

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?
0 x

User avatar
Stefan
Dizzy
Posts: 90
Joined: Mon Nov 13, 2017 9:51 pm
Location: Belgium
Contact:

Re: Starting emulator - help with basics of Z80 timing needed

Post by Stefan » Sun Aug 18, 2019 8:01 am

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.
0 x

User avatar
Woodster
Berk
Posts: 26
Joined: Mon Nov 13, 2017 12:17 pm

Re: Starting emulator - help with basics of Z80 timing needed

Post by Woodster » Sun Aug 18, 2019 8:45 am

Stefan wrote:
Sun Aug 18, 2019 7:55 am
I did not expect an internal operation on the z80 to be contended?
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.
2 x

User avatar
Stefan
Dizzy
Posts: 90
Joined: Mon Nov 13, 2017 9:51 pm
Location: Belgium
Contact:

Re: Starting emulator - help with basics of Z80 timing needed

Post by Stefan » Sun Aug 18, 2019 8:59 am

Woodster wrote:
Sun Aug 18, 2019 8:45 am
Stefan wrote:
Sun Aug 18, 2019 7:55 am
I did not expect an internal operation on the z80 to be contended?
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.
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.

Thank you for clearing that up.
1 x

User avatar
DouglasReynholm
Microbot
Posts: 138
Joined: Wed Feb 20, 2019 8:38 pm
Location: Norf Lahndan Innit

Re: Starting emulator - help with basics of Z80 timing needed

Post by DouglasReynholm » Sun Aug 18, 2019 9:45 am

R-Tape wrote:
Fri Aug 16, 2019 1:37 pm
The first step should be thinking of a cool name
Mustering my best Douglas Reynholm/Matt Berry voice:

Spectrum
Emulator
'X'
You
Think
I
Might
Enjoy

Best I can do at short notice, take it or leave it.
1 x

User avatar
Ast A. Moore
Dynamite Dan
Posts: 1189
Joined: Mon Nov 13, 2017 3:16 pm

Re: Starting emulator - help with basics of Z80 timing needed

Post by Ast A. Moore » Sun Aug 18, 2019 10:11 am

DouglasReynholm wrote:
Sun Aug 18, 2019 9:45 am
Best I can do at short notice, take it or leave it.
“You’ve got spunk and balls, and I like that in a woman.”
0 x
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.

User avatar
Pegaz
Manic Miner
Posts: 242
Joined: Mon Nov 13, 2017 1:44 pm

Re: Starting emulator - help with basics of Z80 timing needed

Post by Pegaz » Sun Aug 25, 2019 4:53 pm

Zoran wrote:
Fri Aug 16, 2019 12:50 pm
Hello,

I am planning to start my own Spectrum emulator (yes, another one is just what is 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. :)
1 x

User avatar
Zoran
Berk
Posts: 6
Joined: Fri Aug 16, 2019 11:56 am

Re: Starting emulator - help with basics of Z80 timing needed

Post by Zoran » Tue Aug 27, 2019 6:39 am

Pegaz wrote:
Sun Aug 25, 2019 4:53 pm
Zoran wrote:
Fri Aug 16, 2019 12:50 pm
Hello,

I am planning to start my own Spectrum emulator (yes, another one is just what is 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. :)
Thank you!
0 x

Post Reply