aboutsummaryrefslogtreecommitdiff
path: root/hw/sm501.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2012-01-22 16:38:21 +0000
committerBlue Swirl <blauwirbel@gmail.com>2012-02-04 12:45:10 +0000
commitcd7a45c95ecf2404810f3c6becb7cb83c5010ad8 (patch)
tree49d6bedd8bf8267333293bfc5217687d3175b82c /hw/sm501.c
parentcb437e48ab7ddd9b85843beb524904ee4b565721 (diff)
memory: change dirty getting API to take a size
Instead of each device knowing or guessing the guest page size, just pass the desired size of dirtied memory area. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/sm501.c')
-rw-r--r--hw/sm501.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/hw/sm501.c b/hw/sm501.c
index 09c5894cf9..94c0abf4cb 100644
--- a/hw/sm501.c
+++ b/hw/sm501.c
@@ -1323,15 +1323,12 @@ static void sm501_draw_crt(SM501State * s)
for (y = 0; y < height; y++) {
int update_hwc = draw_hwc_line ? within_hwc_y_range(s, y, 1) : 0;
int update = full_update || update_hwc;
- ram_addr_t page0 = offset & TARGET_PAGE_MASK;
- ram_addr_t page1 = (offset + width * src_bpp - 1) & TARGET_PAGE_MASK;
- ram_addr_t page;
+ ram_addr_t page0 = offset;
+ ram_addr_t page1 = offset + width * src_bpp - 1;
/* check dirty flags for each line */
- for (page = page0; page <= page1; page += TARGET_PAGE_SIZE)
- if (memory_region_get_dirty(&s->local_mem_region, page,
- DIRTY_MEMORY_VGA))
- update = 1;
+ update = memory_region_get_dirty(&s->local_mem_region, page0, page1,
+ DIRTY_MEMORY_VGA);
/* draw line and change status */
if (update) {