Comments (4)
...and this causes the .h file to be built, in the next make. There doesn't seem to be a date check.
The lc80-roms.h
file will be rebuild when either the lc80-roms.yml
file changes, or the ROM dump file pointed to by that YAML file (https://github.com/floooh/chips-test/blob/master/examples/roms/lc80-roms.yml).
The code-generation runs via this python script: https://github.com/floooh/chips-test/blob/master/fips-files/generators/dump.py, there should be a timestamp check happening there unless it's a bug, but I haven't noticed any strange behaviour (I'm using the same check for all code generation stuff, also in other fips projects).
Regarding behaviour of the RETI instruction: interrupts are disabled "automatically" during the interrupt acknowledge machine cycle in the CPU and before the interrupt service routine is entered. A RETI will not automatically enable interrupts though, that's up to the interrupt service routine. Usually this happens at the start (if the ISR can itself be interrupted), or at latest right before the RETI instruction (through an EI).
Here's a snippet from the RETI description in the Z80 manual:
However, both RETI and RETN will move the status of the IFF2 flag into IFF1 (this is only documented for the RETN instruction, but according to the "Undocumented Z80 Documented" PDF both RETI and RETN behave the same (see page 20 "Things affecting the interrupt flip-flops" here: https://github.com/floooh/emu-info/blob/master/z80/z80-documented.pdf
Cheers :)
from chips.
Hi, there's a short embedding guide in the systems subdirectory: https://github.com/floooh/chips/tree/master/systems#embedding-guide
It's a bit outdated here and there, but all in all it should still be valid.
In general I want to put most of the detailed documentation into the headers themselves, most chip headers have this missing, but the CPU header docs are in pretty good shape, for instance here's how the Z80's interrupt handling works (a bit non-trivial because of the Z80's daisy chain protocol):
https://github.com/floooh/chips/blob/master/chips/z80.h#L228
Usually this protocol is implemented in the Z80 family chips, for the CTC this function is called:
Line 316 in 6cf1ac7
...when the CPU is in an interrupt acknowledge machine cycle (actually this block gets called in each M1 cycle, could be an instruction fetch, or an interrupt acknowledge machine cycle). This is because the interrupt controller must "snoop the bus" for a RETI instruction.
Lines 527 to 534 in 6cf1ac7
The LC80 operating system itself doesn't issue interrupts as far as I saw (only when programmed through user code), but you can step-debug through the Z9001 emulation (which uses CTC interrupts for its system clock), for instance you can set breakpoints in various functions of the CTC's interrupt protocol response routine here:
Line 316 in 6cf1ac7
Hope this helps! If you're stuck somewhere, just add more questions to this thread :)
from chips.
Thanks that is great.
I ended up deleting doing a small mod allowing the ROM size to be smaller than the ROMs, deleting the lc80-roms.h file and replacing the lc80_2k.bin file and this causes the .h file to be built, in the next make. There doesn't seem to be a date check.
One thing I did notice was that if I just put a RETIin the interrupt handler, then the first interrupt would be handled but no others, I assume because they have been disabled. From what I can remember of real Z80s DI to be called to disable them.
from chips.
Faulty memory obviously.
I just checked and under the Visual Studio touch the bin files does not cause the h files to be built. I also did a build on Linux here is the log from the shell.
from chips.
Related Issues (20)
- Reminder: potential bug in m6502 for NMI detection HOT 3
- Known Issues: CPC
- Are you interested in 8086? HOT 2
- Z80 Chip doesn't handle LD A,(IX+n) correctly HOT 4
- Z80 BUSACK/BUSREQ/RESET pins HOT 2
- z80: fetch opcode timing HOT 1
- surprising behaviour of cycle-stepped z80 after PC reset HOT 2
- Z80 wait state handling incorrect? HOT 1
- m6502 doesn't clear D on BRK HOT 1
- Q: page-cross behaviour on 6502 SHY opcode HOT 3
- Unable to use the space bar when there's a CPC_JOYSTICK_DIGITAL attached HOT 2
- Cycle-stepped Motorola 68K HOT 2
- m6569: c accesses half a cycle too late? HOT 2
- Caps Shift doesn't work on ZX Spectrum
- Z80: having _wait() before _mwrite(addr, data) looks incorrect. HOT 3
- Z80 XOR Malfunction HOT 12
- Glitch after snapshot save and load HOT 1
- CPC: Implement Version 3 Snapshots
- [c1541] State of 1541 emulation? HOT 1
- Please consider adding the i8259 interrupt controller HOT 2
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 chips.