URL
https://opencores.org/ocsvn/tv80/tv80/trunk
[/] [tv80/] [trunk/] [sc_env/] [env_memory.cpp] - Diff between revs 98 and 111
Show entire file |
Details |
Blame |
View Log
Rev 98 |
Rev 111 |
Line 28... |
Line 28... |
|
|
int inline readline(FILE *fh, char *buf)
|
int inline readline(FILE *fh, char *buf)
|
{
|
{
|
int c = 1, cnt = 0;
|
int c = 1, cnt = 0;
|
|
|
|
assert (fh != NULL);
|
|
|
if (feof(fh)) {
|
if (feof(fh)) {
|
*buf = (char) 0;
|
*buf = (char) 0;
|
return 0;
|
return 0;
|
}
|
}
|
while (c) {
|
while (c) {
|
Line 84... |
Line 86... |
lp = line + 9;
|
lp = line + 9;
|
for (int c=0; c<rlen; c++) {
|
for (int c=0; c<rlen; c++) {
|
sscanf (lp, "%02x", &databyte);
|
sscanf (lp, "%02x", &databyte);
|
lp += 2;
|
lp += 2;
|
//printf ("DEBUG: loaded mem[%04x]=%02x\n", addr+c, databyte);
|
//printf ("DEBUG: loaded mem[%04x]=%02x\n", addr+c, databyte);
|
|
assert ( (addr+c) < AM_DEPTH );
|
memory[addr+c] = databyte; dcount++;
|
memory[addr+c] = databyte; dcount++;
|
}
|
}
|
rv = readline (fh, line);
|
rv = readline (fh, line);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.