mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-04 14:30:19 +00:00
Display properly from greater RAM sizes.
This commit is contained in:
parent
b6f45d9a90
commit
e2a8b26b57
@ -130,8 +130,9 @@ Video::Video() :
|
|||||||
crt_.set_visible_area(crt_.get_rect_for_area(33, 260, 440, 1700, 4.0f / 3.0f));
|
crt_.set_visible_area(crt_.get_rect_for_area(33, 260, 440, 1700, 4.0f / 3.0f));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Video::set_ram(uint16_t *ram, size_t) {
|
void Video::set_ram(uint16_t *ram, size_t size) {
|
||||||
ram_ = ram;
|
ram_ = ram;
|
||||||
|
ram_mask_ = int((size >> 1) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Video::set_scan_target(Outputs::Display::ScanTarget *scan_target) {
|
void Video::set_scan_target(Outputs::Display::ScanTarget *scan_target) {
|
||||||
@ -202,7 +203,7 @@ void Video::run_for(HalfCycles duration) {
|
|||||||
const int end_column = (since_load + run_length - 1) >> 3;
|
const int end_column = (since_load + run_length - 1) >> 3;
|
||||||
|
|
||||||
while(start_column != end_column) {
|
while(start_column != end_column) {
|
||||||
data_latch_[data_latch_position_] = ram_[current_address_ & 262143];
|
data_latch_[data_latch_position_] = ram_[current_address_ & ram_mask_];
|
||||||
data_latch_position_ = (data_latch_position_ + 1) & 127;
|
data_latch_position_ = (data_latch_position_ + 1) & 127;
|
||||||
++current_address_;
|
++current_address_;
|
||||||
++start_column;
|
++start_column;
|
||||||
|
@ -138,6 +138,7 @@ class Video {
|
|||||||
int current_address_ = 0;
|
int current_address_ = 0;
|
||||||
|
|
||||||
uint16_t *ram_ = nullptr;
|
uint16_t *ram_ = nullptr;
|
||||||
|
int ram_mask_ = 0;
|
||||||
|
|
||||||
int x_ = 0, y_ = 0, next_y_ = 0;
|
int x_ = 0, y_ = 0, next_y_ = 0;
|
||||||
bool load_ = false;
|
bool load_ = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user