mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-21 05:29:13 +00:00
Apply a crop, allow time until Z80 slot to be a future-based query.
This commit is contained in:
parent
1ea034310a
commit
f2d7b9f6a9
@ -52,6 +52,9 @@ Nick::Nick(const uint8_t *ram) :
|
||||
|
||||
// Just use RGB for now.
|
||||
crt_.set_display_type(Outputs::Display::DisplayType::RGB);
|
||||
|
||||
// Crop to the centre 90% of the display.
|
||||
crt_.set_visible_area(Outputs::Display::Rect(0.05f, 0.05f, 0.9f, 0.9f));
|
||||
}
|
||||
|
||||
void Nick::write(uint16_t address, uint8_t value) {
|
||||
@ -92,7 +95,7 @@ uint8_t Nick::read([[maybe_unused]] uint16_t address) {
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
Cycles Nick::get_time_until_z80_slot() const {
|
||||
Cycles Nick::get_time_until_z80_slot(Cycles after_period) const {
|
||||
// Place Z80 accesses as the first six cycles in each sixteen-cycle window.
|
||||
// That models video accesses as being the final ten. Which has the net effect
|
||||
// of responding to the line parameter table interrupt flag as soon as it's
|
||||
@ -100,7 +103,7 @@ Cycles Nick::get_time_until_z80_slot() const {
|
||||
|
||||
// i.e. 0 -> 0, 1 -> 15 ... 15 -> 1.
|
||||
return Cycles(
|
||||
15 ^ ((horizontal_counter_ + 15) & 15)
|
||||
15 ^ ((horizontal_counter_ + 15 + after_period.as<int>()) & 15)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ class Nick {
|
||||
uint8_t read(uint16_t address);
|
||||
|
||||
void run_for(Cycles);
|
||||
Cycles get_time_until_z80_slot() const;
|
||||
Cycles get_time_until_z80_slot(Cycles after_period) const;
|
||||
|
||||
void set_scan_target(Outputs::Display::ScanTarget *scan_target);
|
||||
Outputs::Display::ScanStatus get_scaled_scan_status() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user