Comments (1)
The real chip draws TWO pixels per clock cycle, effectively it is like drawing ONE pixel at twice the clock speed; so I think the MC6847_TICK_HZ constant should be doubled.
I think this part is correct, the data sheet explicitely says that "incoming" frequency at the CLK pin must be 3.57... MHz, the clock frequency often just says how many bytes can fetched at most, not how many pixels are drawn. Looking at the scanline decoding functions it looks like the chips either fetches 16 or 32 bytes per scanline, and (depending on graphics mode) renders between 64 to 256 visible pixels per scanline from those 16 or 32 bytes (with different deocding rules of how those bytes map to pixels).
However, the pixel decoding isn't cycle-correct anyway, since it decodes an entire scanline at once, and the timing when that happens is defined h_count and h_period values (whenether the horizontal counter "hits" h_period, one complete scanline will be decoded in a single cycle, which of course isn't correct at all, but as long as h_count counts up at the right frequency, and h_period has the right value, the timing will be correct per scanline.
The horizontal video frame is 227.5 clock cycles, resulting in 227.5 x 2 = 455 pixels, so the constant MC6847_DISPLAY_WIDTH should be raised from 320 to 455
The DISPLAY_WIDTH constant isn't really relevant for the timing, this only describes how big the frame buffer must be. Instead the h_period value is relevant, and the 227.5 clock cycles value can be found here (rounded to 228 though):
Line 284 in fdef73e
In the software emulation the border pixels are equally divided:
Yes, this might be an actual error. I simply adjusted the BORDER_PIXELS constant so that the video image appears centered.
Cheers :)
from chips.
Related Issues (20)
- 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
- Reminder: Check and fix 6502 decimal mode. HOT 1
- Unable to load uncompressed Z80 snapshot taken on ZX Spectrum Next
- Emulation of Fairlight 2 (128k) fails on 128K Spectrum HOT 1
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.