Comments (1)
WAIT is not explicity set by using any function. Instead, you should directly add to Z80::cycles
the desired wait T-states. Do it within the callback corresponding to the M-cycle in which the WAIT signal is generated.
As for BUSREQ, there is a limitation, although I have not yet explained it adequately in the documentation: A real Z80 CPU responds to the BUSREQ signal at the end of each M-cycle. That means that as long as the signal lasts, the M-cycle is frozen and the CPU does not go to the next one until the signal ends. If the signal is short, this can be emulated in the same way as WAIT, that is, by adding to Z80::cycles
the duration of the signal. However, if the signal is very long, for example in the case of a DMA operation that moves a large amount of memory or similar, then we have the problem that, even if we add the T-states:
- if that amount makes the global T-state counter of your machine object exceed the total T-states of 1 emulated machine frame,
- and the signal does not occur in the last M-cycle of the instruction,
- and there are still others in which memory will be accessed,
problems may arise (depending on what is being emulated and whether a precise control of the T-state within the frame in which a memory access is performed is required, of course).
I think the best solution is to handle BUSREQ in your side between your calls to z80_run
or z80_execute
, and assume that the signal always starts during the last M-cycle of an instruction.
The alternative would be to save the state of the Z80
object and use setjmp()
or similar in the callback where the signal occurs to avoid finishing executing the instruction. But I don't think it would be worth it, it would be quite complex to do.
from z80.
Related Issues (3)
- zexall test suite failing HOT 13
- Question HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from z80.