Fix sign extensions from vipRead() and busReadMisc()
This commit is contained in:
parent
57dcd8370a
commit
04e79c9151
|
@ -153,12 +153,18 @@ static void busRead(VB *sim, uint32_t address, int type, int32_t *value) {
|
|||
|
||||
case 0: /* VIP */
|
||||
vipRead(sim, address, type, value);
|
||||
switch (type) {
|
||||
case VB_S8 : *value = (int8_t ) *value; break;
|
||||
case VB_S16: *value = (int16_t) *value; break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1: break; /* VSU */
|
||||
|
||||
case 2: /* Misc. I/O */
|
||||
*value = busReadMisc(sim, address, type);
|
||||
if (type == VB_S8)
|
||||
*value = (int8_t) *value;
|
||||
break;
|
||||
|
||||
case 3: break; /* Unmapped */
|
||||
|
|
Loading…
Reference in New Issue