1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-06-10 14:29:30 +00:00

Test for !OK with system data addresses

This commit is contained in:
Peter Evans 2018-03-07 20:42:27 -06:00
parent 4d4fbdf79a
commit f555196080
2 changed files with 8 additions and 2 deletions

View File

@ -320,7 +320,13 @@ apple2_text_area(vm_area *area, vm_bitfont *font, size_t addr)
// (0x0800-0x0BFF) respectively. If the given address is not in
// those (contiguous) ranges, then let's bail.
if (addr < 0x0400 || addr > 0x0BFF) {
return 0;
return ERR_INVALID;
}
// Certain addresses are not meant to be displayable, and are
// actually used for system data
if (buffer_rows[addr] == -1 || buffer_cols[addr] == -1) {
return ERR_INVALID;
}
// In a given page for 40-column mode, you get 960 grid parts that

View File

@ -39,7 +39,7 @@ Test(apple2_text, area)
vm_area area;
cr_assert_neq(apple2_text_area(&area, font, 0x0301), OK);
cr_assert_neq(apple2_text_area(&area, font, 0x0461), OK);
cr_assert_neq(apple2_text_area(&area, font, 0x04FB), OK);
cr_assert_eq(apple2_text_area(&area, font, 0x0537), OK);
// FIXME: need a proper test for area; we're missing one because the