mirror of
https://github.com/LIV2/WinUAE.git
synced 2025-12-06 00:12:52 +00:00
Fix order of operations.
This commit is contained in:
parent
0256436e0a
commit
9f169b3c4b
@ -1886,7 +1886,7 @@ int scsi_cd_emulate (int unitnum, uae_u8 *cmdbuf, int scsi_cmd_len,
|
||||
strack++;
|
||||
}
|
||||
addtocentry (&p2, &maxlen, 0xa2, 0xaa, msf, p, toc);
|
||||
int tlen = addrdiff(p2, p + 2);
|
||||
int tlen = addrdiff(p2, p) + 2;
|
||||
p[0] = tlen >> 8;
|
||||
p[1] = tlen >> 0;
|
||||
scsi_len = tlen + 2;
|
||||
|
||||
@ -338,11 +338,11 @@ static int getsub_deinterleaved (uae_u8 *dst, struct cdunit *cdu, struct cdtoc *
|
||||
// regenerate Q-subchannel
|
||||
uae_u8 *s = dst + SUB_ENTRY_SIZE;
|
||||
s[0] = (t->ctrl << 4) | (t->adr << 0);
|
||||
s[1] = tobcd(addrdiff(t, &cdu->toc[0] + 1));
|
||||
s[1] = tobcd(addrdiff(t, &cdu->toc[0]) + 1);
|
||||
s[2] = tobcd(1);
|
||||
int msf = lsn2msf(sector);
|
||||
tolongbcd(s + 7, msf);
|
||||
msf = lsn2msf(addrdiff(sector, t->address - 150));
|
||||
msf = lsn2msf(addrdiff(sector, t->address) - 150);
|
||||
tolongbcd(s + 3, msf);
|
||||
ret = 2;
|
||||
}
|
||||
|
||||
@ -1278,7 +1278,7 @@ static void initscideattr (int readonly)
|
||||
strcpy ((char*)p, "Generic Emulated PCMCIA IDE");
|
||||
p += strlen ((char*)p) + 1;
|
||||
*p++= 0xff;
|
||||
*rp = addrdiff(p, rp - 1);
|
||||
*rp = addrdiff(p, rp) - 1;
|
||||
|
||||
/* CISTPL_FUNCID */
|
||||
*p++ = 0x21;
|
||||
@ -1380,7 +1380,7 @@ static void initsramattr (int size, int readonly)
|
||||
sprintf ((char*)p, "Generic Emulated %dKB PCMCIA SRAM Card", size >> 10);
|
||||
p += strlen ((char*)p) + 1;
|
||||
*p++= 0xff;
|
||||
*rp = addrdiff(p, rp - 1);
|
||||
*rp = addrdiff(p, rp) - 1;
|
||||
|
||||
/* CISTPL_FUNCID */
|
||||
*p++ = 0x21;
|
||||
|
||||
@ -241,7 +241,7 @@ void WriteOutput(const TCHAR *out, int len)
|
||||
for(;;) {
|
||||
p = _tcschr(tmp, '\n');
|
||||
if (p) {
|
||||
pos = addrdiff(p, tmp + 1);
|
||||
pos = addrdiff(p, tmp) + 1;
|
||||
if (pos > (MAX_LINEWIDTH + 1))
|
||||
pos = MAX_LINEWIDTH + 1;
|
||||
buf = xcalloc(TCHAR, pos + 2);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user