1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-02 20:30:00 +00:00

Clarify test.

This commit is contained in:
Thomas Harte 2022-08-08 15:57:36 -04:00
parent 4c90a4ec93
commit 892580c183

View File

@ -21,10 +21,12 @@ using namespace Amiga;
namespace {
bool satisfies_raster(uint16_t position, uint16_t blitter_status, uint16_t *instruction) {
// Return immediately if: (i) wait-for-Blitter is not disabled; and (ii) the Blitter is busy.
if(!(instruction[1] & 0x8000) && (blitter_status & 0x4000)) return false;
// Otherwise, test the raster position against the instruction's value and mask.
const uint16_t mask = 0x8000 | (instruction[1] & 0x7ffe);
return
(position & mask) >= (instruction[0] & mask) &&
(!(blitter_status & 0x4000) || (instruction[1] & 0x8000));
return (position & mask) >= (instruction[0] & mask);
}
}