10 #define FORCE_ERROR2 0
13 static unsigned buf[128];
17 static void fill (register unsigned* page, register unsigned num)
20 for (i = 0; i < 128; ++i, ++page) {
27 static void cmp (unsigned page, register const unsigned* buf, register unsigned num)
30 for (i = 0; i < 128; ++i, ++buf) {
32 cprintf ("\r\nData mismatch in page $%04X at $%04X\r\n"
33 "Data is $%04X (should be $%04X)\r\n",
34 page, buf, *buf, num);
51 Res = em_load_driver ("c128-reu.emd");
52 if (Res != EM_ERR_OK) {
53 cprintf ("Error in em_load_driver: %u\r\n", Res);
54 cprintf ("os: %u, %s\r\n", _oserror, _stroserror (_oserror));
58 /* Get the number of available pages */
59 PageCount = em_pagecount ();
60 cprintf ("Loaded ok, page count = $%04X\r\n", PageCount);
66 for (I = 0; I < PageCount; ++I) {
74 ((unsigned*) em_map (0x03))[0x73] = 0xFFFF;
79 cputs ("\r\nComparing ");
82 for (I = 0; I < PageCount; ++I) {
83 cmp (I, em_map (I), I);
88 /* Setup the copy structure */
91 c.count = sizeof (buf);
93 /* Fill again all pages */
94 cputs ("\r\nFilling ");
97 for (I = 0; I < PageCount; ++I) {
98 fill (buf, I ^ 0xFFFF);
112 /* Check all pages */
113 cputs ("\r\nComparing ");
116 for (I = 0; I < PageCount; ++I) {
119 cmp (I, buf, I ^ 0xFFFF);
125 cprintf ("Passed!\r\n");