mirror of
https://github.com/LIV2/WinUAE.git
synced 2025-12-06 00:12:52 +00:00
addrdiff
This commit is contained in:
parent
9857f8c1f2
commit
87afbcdbc1
@ -10318,7 +10318,7 @@ static uae_u16 sprite_fetch(struct sprite *s, uaecptr pt, int hpos, int slot, in
|
||||
}
|
||||
#endif
|
||||
#ifdef DEBUGGER
|
||||
int num = (int)(s - &spr[0]);
|
||||
int num = addrdiff(s, &spr[0]);
|
||||
if (debug_dma) {
|
||||
record_dma_read(num * 8 + 0x140 + mode * 4 + slot * 2, pt, hpos, vpos, DMARECORD_SPRITE, num);
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ static int getunitnum (struct dev_info_spti *di)
|
||||
{
|
||||
if (!di)
|
||||
return -1;
|
||||
int idx = (int)(di - &dev_info[0]);
|
||||
int idx = addrdiff(di, &dev_info[0]);
|
||||
for (int i = 0; i < MAX_TOTAL_SCSI_DEVICES; i++) {
|
||||
if (unittable[i] - 1 == idx)
|
||||
return i;
|
||||
|
||||
@ -415,7 +415,7 @@ static void to_iff_ilbm(TrapContext *ctx, HBITMAP hbmp)
|
||||
}
|
||||
}
|
||||
|
||||
tsize = (int)(p - iff - 8);
|
||||
tsize = addrdiff(p, iff) - 8;
|
||||
p = iff + 4;
|
||||
p[0] = tsize >> 24;
|
||||
p[1] = tsize >> 16;
|
||||
|
||||
@ -1949,7 +1949,7 @@ static int createmasktexture (struct d3dstruct *d3d, const TCHAR *filename, stru
|
||||
D3DXIMAGE_INFO dinfo;
|
||||
TCHAR tmp[MAX_DPATH];
|
||||
int maskwidth, maskheight;
|
||||
int idx = (int)(sd - &d3d->shaders[0]);
|
||||
int idx = addrdiff(sd, &d3d->shaders[0]);
|
||||
|
||||
if (filename[0] == 0)
|
||||
return 0;
|
||||
|
||||
@ -2134,7 +2134,7 @@ static bool allocshadertex(struct d3d11struct *d3d, struct shadertex *t, int w,
|
||||
|
||||
static bool allocextratextures(struct d3d11struct *d3d, struct shaderdata11 *s, int w, int h)
|
||||
{
|
||||
int scnt = (int)(s - &d3d->shaders[0]);
|
||||
int scnt = addrdiff(s, &d3d->shaders[0]);
|
||||
if (!allocshadertex(d3d, &s->lpWorkTexture1, w, h, scnt))
|
||||
return false;
|
||||
if (!allocshadertex(d3d, &s->lpWorkTexture2, w, h, scnt))
|
||||
|
||||
@ -983,7 +983,7 @@ static int saveiff(FILE *fp, bool alpha)
|
||||
}
|
||||
}
|
||||
|
||||
int tsize = (int)(p - iff - 8);
|
||||
int tsize = addrdiff(p, iff) - 8;
|
||||
p = iff + 4;
|
||||
p[0] = tsize >> 24;
|
||||
p[1] = tsize >> 16;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user