projects
/
emu8051.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace disam.h with opcodes{h,c}
[emu8051.git]
/
src
/
common
/
hexfile.c
diff --git
a/src/common/hexfile.c
b/src/common/hexfile.c
index
8967cf8
..
c9c7de3
100644
(file)
--- a/
src/common/hexfile.c
+++ b/
src/common/hexfile.c
@@
-11,7
+11,6
@@
# include "config.h"
#endif
# include "config.h"
#endif
-#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.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)
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)
else if (width == 2)
- sprintf(str , "%.2X", (u
_
int8_t) val);
+ sprintf(str , "%.2X", (uint8_t) val);
else if (width == 4)
else if (width == 4)
- sprintf(str , "%.4X", (u
_
int16_t) val);
+ sprintf(str , "%.4X", (uint16_t) val);
else
sprintf(str , "Err");
}
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);
if (rec_type == 0) {
for (j = 0; j < rec_len; j++) {
data = asciihex2int_len(&line[i], 2);
- mem
ory
_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;
}
i += 2;
checksum += data;
}