Line 61... |
Line 61... |
return *(uint32_t *)(dat + addr);
|
return *(uint32_t *)(dat + addr);
|
}
|
}
|
|
|
uint16_t simmem_read16(oraddr_t addr, void *dat)
|
uint16_t simmem_read16(oraddr_t addr, void *dat)
|
{
|
{
|
|
#ifdef WORDS_BIGENDIAN
|
|
return *(uint16_t *)(dat + addr);
|
|
#else
|
return *(uint16_t *)(dat + (addr ^ 2));
|
return *(uint16_t *)(dat + (addr ^ 2));
|
|
#endif
|
}
|
}
|
|
|
uint8_t simmem_read8(oraddr_t addr, void *dat)
|
uint8_t simmem_read8(oraddr_t addr, void *dat)
|
{
|
{
|
|
#ifdef WORDS_BIGENDIAN
|
|
return *(uint8_t *)(dat + addr);
|
|
#else
|
return *(uint8_t *)(dat + ((addr & ~ADDR_C(3)) | (3 - (addr & 3))));
|
return *(uint8_t *)(dat + ((addr & ~ADDR_C(3)) | (3 - (addr & 3))));
|
|
#endif
|
}
|
}
|
|
|
void simmem_write32(oraddr_t addr, uint32_t value, void *dat)
|
void simmem_write32(oraddr_t addr, uint32_t value, void *dat)
|
{
|
{
|
*(uint32_t *)(dat + addr) = value;
|
*(uint32_t *)(dat + addr) = value;
|
}
|
}
|
|
|
void simmem_write16(oraddr_t addr, uint16_t value, void *dat)
|
void simmem_write16(oraddr_t addr, uint16_t value, void *dat)
|
{
|
{
|
|
#ifdef WORDS_BIGENDIAN
|
|
*(uint16_t *)(dat + addr) = value;
|
|
#else
|
*(uint16_t *)(dat + (addr ^ 2)) = value;
|
*(uint16_t *)(dat + (addr ^ 2)) = value;
|
|
#endif
|
}
|
}
|
|
|
void simmem_write8(oraddr_t addr, uint8_t value, void *dat)
|
void simmem_write8(oraddr_t addr, uint8_t value, void *dat)
|
{
|
{
|
|
#ifdef WORDS_BIGENDIAN
|
|
*(uint8_t *)(dat + addr) = value;
|
|
#else
|
*(uint8_t *)(dat + ((addr & ~ADDR_C(3)) | (3 - (addr & 3)))) = value;
|
*(uint8_t *)(dat + ((addr & ~ADDR_C(3)) | (3 - (addr & 3)))) = value;
|
|
#endif
|
}
|
}
|
|
|
uint32_t simmem_read_zero32(oraddr_t addr, void *dat)
|
uint32_t simmem_read_zero32(oraddr_t addr, void *dat)
|
{
|
{
|
if (config.sim.verbose)
|
if (config.sim.verbose)
|