1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-26 19:17:52 +00:00

Attempt to copy and paste my way to working type-1 sprites.

This commit is contained in:
Thomas Harte
2023-02-16 22:46:19 -05:00
parent 023da1970a
commit c140f370fe
3 changed files with 93 additions and 32 deletions
+17 -13
View File
@@ -212,19 +212,23 @@ void TMS9918<personality>::run_for(const HalfCycles cycles) {
// ------------------------
// Perform memory accesses.
// ------------------------
#define fetch(function, clock, offset) { \
const int first_window = from_internal<personality, clock>(this->fetch_pointer_.column); \
const int final_window = from_internal<personality, clock>(end_column); \
if(first_window == final_window) break; \
if(final_window != clock_rate<personality, clock>()) { \
function<true>( \
this->line_buffers_[this->fetch_pointer_.row], this->fetch_pointer_.row + offset, \
first_window, final_window); \
} else { \
function<false>( \
this->line_buffers_[this->fetch_pointer_.row], this->fetch_pointer_.row + offset, \
first_window, final_window); \
} \
#define fetch(function, clock, offset) { \
const int first_window = from_internal<personality, clock>(this->fetch_pointer_.column); \
const int final_window = from_internal<personality, clock>(end_column); \
if(first_window == final_window) break; \
if(final_window != clock_rate<personality, clock>()) { \
function<true>( \
this->line_buffers_[this->fetch_pointer_.row], \
this->line_buffers_[(this->fetch_pointer_.row + 1) % this->mode_timing_.total_lines], \
this->fetch_pointer_.row + offset, \
first_window, final_window); \
} else { \
function<false>( \
this->line_buffers_[this->fetch_pointer_.row], \
this->line_buffers_[(this->fetch_pointer_.row + 1) % this->mode_timing_.total_lines], \
this->fetch_pointer_.row + offset, \
first_window, final_window); \
} \
}
switch(line_buffer.fetch_mode) {