Replace disam.h with opcodes{h,c}
[emu8051.git] / src / common / hexfile.c
index 8967cf8..c9c7de3 100644 (file)
@@ -11,7 +11,6 @@
 #  include "config.h"
 #endif
 
-#include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdbool.h>
@@ -35,11 +34,11 @@ void
 int2asciihex(int val, char *str, int width)
 {
        if (width == 1)
-               sprintf(str , "%.1X", (u_int8_t) val);
+               sprintf(str , "%.1X", (uint8_t) val);
        else if (width == 2)
-               sprintf(str , "%.2X", (u_int8_t) val);
+               sprintf(str , "%.2X", (uint8_t) val);
        else if (width == 4)
-               sprintf(str , "%.4X", (u_int16_t) val);
+               sprintf(str , "%.4X", (uint16_t) val);
        else
                sprintf(str , "Err");
 }
@@ -149,9 +148,9 @@ hexfile_load(const char *filename)
                if (rec_type == 0) {
                        for (j = 0; j < rec_len; j++) {
                                data = asciihex2int_len(&line[i], 2);
-                               memory_write8(PGM_MEM_ID,
-                                             (unsigned int) (load_offset + j),
-                                             (unsigned char) data);
+                               mem_write8(PGM_MEM_ID,
+                                          (unsigned int) (load_offset + j),
+                                          (unsigned char) data);
                                i += 2;
                                checksum += data;
                        }