/* DirtyRectList.h Copyright (C) 2026 Pierre Sarrazin This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef _H_DirtyRectList #define _H_DirtyRectList #include "DirtyRect.h" enum { DirtyRectList_MAX_DIRTY_RECTS = 24, // must be <= 255 }; typedef struct DirtyRectList { byte count; byte peak; DirtyRect rects[DirtyRectList_MAX_DIRTY_RECTS]; } DirtyRectList; void DirtyRectList_init(DirtyRectList *self); // Remembers that the rectangle whose top-left byte is 'addr' // is now "dirty" in the given "dirty list", which is supposed to // correspond with the current screen page. // // Each dirty rectangle is DirtyRect_WIDTH bytes wide. // // numRows: Number of pixel rows of the dirty rectangle (must NOT be zero). // // Returns FALSE if there is no room for the new dirty rectangle // in 'dirtyList' (re: DirtyRectList_MAX_DIRTY_RECTS). // // Increments the count field in the given dirty list. // Updates self->peak if NDEBUG is not defined. // BOOL DirtyRectList_add(DirtyRectList *self, byte *addr, byte numRows); // Calls DirtyRect_clean() for every dirty rectangle in the list, // then clears that list. // void DirtyRectList_clean(DirtyRectList *self); #endif /* _H_DirtyRectList */