nr_cop_records[curr_cop_set] = 0;
}
-STATIC_INLINE uae_u32 ledcolor (uae_u32 c, uae_u32 *rc, uae_u32 *gc, uae_u32 *bc, uae_u32 *a)
+static uae_u32 ledcolor (uae_u32 c, uae_u32 *rc, uae_u32 *gc, uae_u32 *bc, uae_u32 *a)
{
uae_u32 v = rc[(c >> 16) & 0xff] | gc[(c >> 8) & 0xff] | bc[(c >> 0) & 0xff];
if (a)
return v;
}
-STATIC_INLINE void putpixel (uae_u8 *buf, int bpp, int x, xcolnr c8)
+static void putpixel (uae_u8 *buf, int x, xcolnr c8)
{
- if (x <= 0)
+ if (x <= 0) {
return;
-
- switch (bpp) {
- case 1:
- buf[x] = (uae_u8)c8;
- break;
- case 2:
- {
- uae_u16 *p = (uae_u16*)buf + x;
- *p = (uae_u16)c8;
- break;
- }
- case 3:
- /* no 24 bit yet */
- break;
- case 4:
- {
- uae_u32 *p = (uae_u32*)buf + x;
- *p = c8;
- break;
- }
}
+
+ uae_u32 *p = (uae_u32*)buf + x;
+ *p = c8;
}
#define lc(x) ledcolor (x, xredcolors, xgreencolors, xbluecolors, NULL)
static int cycles_toggle;
-static void debug_draw_cycles(uae_u8 *buf, int bpp, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors)
+static void debug_draw_cycles(uae_u8 *buf, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors)
{
int y, x, xx, dx, xplus, yplus;
struct dma_rec *dr;
}
if (dr->intlev > intlev)
intlev = dr->intlev;
- putpixel(buf, bpp, xx + 4, c);
+ putpixel(buf, xx + 4, c);
if (xplus > 1)
- putpixel(buf, bpp, xx + 4 + 1, c);
+ putpixel(buf, xx + 4 + 1, c);
if (xplus > 2)
- putpixel(buf, bpp, xx + 4 + 2, c);
+ putpixel(buf, xx + 4 + 2, c);
dr++;
if (dr->hpos == 0) {
break;
}
}
- putpixel (buf, bpp, dx + 0, 0);
- putpixel (buf, bpp, dx + 1, lc(intlevc[intlev]));
- putpixel (buf, bpp, dx + 2, lc(intlevc[intlev]));
- putpixel (buf, bpp, dx + 3, 0);
+ putpixel (buf, dx + 0, 0);
+ putpixel (buf, dx + 1, lc(intlevc[intlev]));
+ putpixel (buf, dx + 2, lc(intlevc[intlev]));
+ putpixel (buf, dx + 3, 0);
}
#define HEATMAP_WIDTH 256
uae_u16 type, extra;
};
-static void debug_draw_heatmap(uae_u8 *buf, int bpp, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors)
+static void debug_draw_heatmap(uae_u8 *buf, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors)
{
struct memory_heatmap *mht = heatmap;
int dx = 16;
uae_u32 c = heatmap_debug_colors[mht->cnt * DMARECORD_MAX + mht->type];
//c = heatmap_debug_colors[(HEATMAP_COUNT - 1) * DMARECORD_MAX + DMARECORD_CPU_I];
int xx = x + dx;
- putpixel(buf, bpp, xx, c);
+ putpixel(buf, xx, c);
if (mht->cnt > 0)
mht->cnt--;
mht++;
}
}
-void debug_draw(uae_u8 *buf, int bpp, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors)
+void debug_draw(uae_u8 *buf, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors)
{
if (!heatmap_debug_colors) {
heatmap_debug_colors = xcalloc(uae_u32, DMARECORD_MAX * HEATMAP_COUNT);
}
if (heatmap) {
- debug_draw_heatmap(buf, bpp, line, width, height, xredcolors, xgreencolors, xbluecolors);
+ debug_draw_heatmap(buf, line, width, height, xredcolors, xgreencolors, xbluecolors);
} else if (dma_record_data) {
- debug_draw_cycles(buf, bpp, line, width, height, xredcolors, xgreencolors, xbluecolors);
+ debug_draw_cycles(buf, line, width, height, xredcolors, xgreencolors, xbluecolors);
}
}
static int lightpen_y1[2], lightpen_y2[2];
-void putpixel(uae_u8 *buf, uae_u16 *genlockbuf, int bpp, int x, xcolnr c8)
+void putpixel(uae_u8 *buf, uae_u16 *genlockbuf, int x, xcolnr c8)
{
if (x <= 0)
return;
- if (genlockbuf)
+ if (genlockbuf) {
genlockbuf[x] = 1;
-
- switch (bpp) {
- case 1:
- buf[x] = (uae_u8)c8;
- break;
- case 2:
- {
- uae_u16 *p = (uae_u16*)buf + x;
- *p = (uae_u16)c8;
- break;
- }
- case 3:
- /* no 24 bit yet */
- break;
- case 4:
- {
- uae_u32 *p = (uae_u32*)buf + x;
- *p = c8;
- break;
- }
}
+
+ uae_u32 *p = (uae_u32*)buf + x;
+ *p = c8;
}
static uae_u8 *status_line_ptr(int monid, int line)
int y;
y = line - (vidinfo->inbuffer->outheight - TD_TOTAL_HEIGHT);
- xlinebuffer = vidinfo->inbuffer->linemem;
- if (xlinebuffer == 0)
- xlinebuffer = row_map[line];
+ xlinebuffer = row_map[line];
xlinebuffer_genlock = row_map_genlock[line];
return xlinebuffer;
}
if (!buf)
return;
if (statusy < 0)
- statusline_render(monid, buf, vidinfo->inbuffer->pixbytes, vidinfo->inbuffer->rowbytes, vidinfo->inbuffer->outwidth, TD_TOTAL_HEIGHT, xredcolors, xgreencolors, xbluecolors, NULL);
+ statusline_render(monid, buf, vidinfo->inbuffer->rowbytes, vidinfo->inbuffer->outwidth, TD_TOTAL_HEIGHT, xredcolors, xgreencolors, xbluecolors, NULL);
else
- draw_status_line_single(monid, buf, vidinfo->inbuffer->pixbytes, statusy, vidinfo->inbuffer->outwidth, xredcolors, xgreencolors, xbluecolors, NULL);
+ draw_status_line_single(monid, buf, statusy, vidinfo->inbuffer->outwidth, xredcolors, xgreencolors, xbluecolors, NULL);
}
static void draw_debug_status_line(int monid, int line)
{
struct vidbuf_description *vidinfo = &adisplays[monid].gfxvidinfo;
- xlinebuffer = vidinfo->inbuffer->linemem;
- if (xlinebuffer == 0)
- xlinebuffer = row_map[line];
+ xlinebuffer = row_map[line];
xlinebuffer_genlock = row_map_genlock[line];
- debug_draw(xlinebuffer, vidinfo->inbuffer->pixbytes, line, vidinfo->inbuffer->outwidth, vidinfo->inbuffer->outheight, xredcolors, xgreencolors, xbluecolors);
+ debug_draw(xlinebuffer, line, vidinfo->inbuffer->outwidth, vidinfo->inbuffer->outheight, xredcolors, xgreencolors, xbluecolors);
}
#define LIGHTPEN_HEIGHT 12
int color1 = onscreen ? (lpnum ? 0x0ff : 0xff0) : (lpnum ? 0x0f0 : 0xf00);
int color2 = (color1 & 0xeee) >> 1;
- xlinebuffer = vidinfo->inbuffer->linemem;
- if (xlinebuffer == 0)
- xlinebuffer = row_map[line];
+ xlinebuffer = row_map[line];
xlinebuffer_genlock = row_map_genlock[line];
p = lightpen_cursor + y * LIGHTPEN_WIDTH;
for (int i = 0; i < LIGHTPEN_WIDTH; i++) {
int xx = x + i - LIGHTPEN_WIDTH / 2;
if (*p != '-' && xx >= 0 && xx < vidinfo->inbuffer->outwidth) {
- putpixel(xlinebuffer, xlinebuffer_genlock, vidinfo->inbuffer->pixbytes, xx, *p == 'x' ? xcolors[color1] : xcolors[color2]);
+ putpixel(xlinebuffer, xlinebuffer_genlock, xx, *p == 'x' ? xcolors[color1] : xcolors[color2]);
}
p++;
}
color2 = refresh_indicator_colors[pixel - 5];
}
for (int x = 0; x < 8; x++) {
- putpixel(xlinebuffer, NULL, vidinfo->inbuffer->pixbytes, x, xcolors[color1]);
+ putpixel(xlinebuffer, NULL, x, xcolors[color1]);
}
for (int x = 8; x < 16; x++) {
- putpixel(xlinebuffer, NULL, vidinfo->inbuffer->pixbytes, x, xcolors[color2]);
+ putpixel(xlinebuffer, NULL, x, xcolors[color2]);
}
}
}
extern void record_dma_ipl(void);
extern void record_dma_ipl_sample(void);
extern void debug_mark_refreshed(uaecptr);
-extern void debug_draw(uae_u8 *buf, int bpp, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors);
+extern void debug_draw(uae_u8 *buf, int line, int width, int height, uae_u32 *xredcolors, uae_u32 *xgreencolors, uae_u32 *xbluescolors);
extern struct dma_rec *record_dma_next_cycle(int hpos, int vpos, int vvpos);
#define TRACE_SKIP_INS 1
extern void get_custom_topedge (int *x, int *y, bool max);
extern void get_custom_raw_limits (int *pw, int *ph, int *pdx, int *pdy);
void get_custom_mouse_limits (int *pw, int *ph, int *pdx, int *pdy, int dbl);
-extern void putpixel (uae_u8 *buf, uae_u16 *genlockbuf, int bpp, int x, xcolnr c8);
+extern void putpixel (uae_u8 *buf, uae_u16 *genlockbuf, int x, xcolnr c8);
extern void allocvidbuffer(int monid, struct vidbuffer *buf, int width, int height, int depth);
extern void freevidbuffer(int monid, struct vidbuffer *buf);
extern void check_prefs_picasso(void);
#define STATUSLINE_RTG 2
#define STATUSLINE_TARGET 0x80
-void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwidth, uae_u32 *rc, uae_u32 *gc, uae_u32 *bc, uae_u32 *alpha);
-void statusline_single_erase(int monid, uae_u8 *buf, int bpp, int y, int totalwidth);
+void draw_status_line_single(int monid, uae_u8 *buf, int y, int totalwidth, uae_u32 *rc, uae_u32 *gc, uae_u32 *bc, uae_u32 *alpha);
+void statusline_single_erase(int monid, uae_u8 *buf, int y, int totalwidth);
void statusline_getpos(int monid, int *x, int *y, int width, int height);
#define STATUSTYPE_FLOPPY 1
bool createstatusline(HWND, int);
void deletestatusline(int);
-void statusline_render(int, uae_u8 *buf, int bpp, int pitch, int width, int height, uae_u32 *rc, uae_u32 *gc, uae_u32 *bc, uae_u32 *alpha);
+void statusline_render(int, uae_u8 *buf, int pitch, int width, int height, uae_u32 *rc, uae_u32 *gc, uae_u32 *bc, uae_u32 *alpha);
void statusline_add_message(int statustype, const TCHAR *format, ...);
void statusline_clear(void);
void statusline_vsync(void);
extern float getvsyncrate(int monid, float hz, int *mult);
- /* The graphics code has a choice whether it wants to use a large buffer
- * for the whole display, or only a small buffer for a single line.
- * If you use a large buffer:
- * - set bufmem to point at it
- * - set linemem to 0
- * - if memcpy within bufmem would be very slow, i.e. because bufmem is
- * in graphics card memory, also set emergmem to point to a buffer
- * that is large enough to hold a single line.
- * - implement flush_line to be a no-op.
- * If you use a single line buffer:
- * - set bufmem and emergmem to 0
- * - set linemem to point at your buffer
- * - implement flush_line to copy a single line to the screen
- */
struct vidbuffer
{
/* Function implemented by graphics driver */
int (*lockscr) (struct vidbuf_description *gfxinfo, struct vidbuffer *vb);
void (*unlockscr) (struct vidbuf_description *gfxinfo, struct vidbuffer *vb);
- uae_u8 *linemem;
- uae_u8 *emergmem;
uae_u8 *bufmem, *bufmemend;
uae_u8 *realbufmem;
if (avioutput_width == 0 || avioutput_height == 0 || avioutput_bits == 0) {
avioutput_width = WIN32GFX_GetWidth(mon);
avioutput_height = WIN32GFX_GetHeight(mon);
- avioutput_bits = WIN32GFX_GetDepth(mon, 0);
+ avioutput_bits = 32;
if (WIN32GFX_IsPicassoScreen(mon) && avioutput_originalsize) {
struct picasso96_state_struct *state = &picasso96_state[aviout_monid];
avioutput_width = state->Width;
if (avioutput_width == 0 || avioutput_height == 0) {
avioutput_width = workprefs.gfx_monitor[0].gfx_size.width;
avioutput_height = workprefs.gfx_monitor[0].gfx_size.height;
- avioutput_bits = WIN32GFX_GetDepth(mon, 0);
+ avioutput_bits = 32;
}
if (!aviout_height_out)
aviout_height_out = avioutput_height;
int max_texture_w, max_texture_h;
int tin_w, tin_h, tout_w, tout_h, window_h, window_w;
int tino_w, tino_h;
- int t_depth, dmult, dmultxh, dmultxv, dmode;
+ int dmult, dmultxh, dmultxv, dmode;
int required_sl_texture_w, required_sl_texture_h;
int vsync2, guimode, maxscanline, variablerefresh;
int resetcount;
if (!d3d->texture1 || !d3d->texture2)
return 0;
d3d->usetexture = d3d->texture1;
- write_log (_T("%s: %d*%d main texture, depth %d\n"), D3DHEAD, w, h, d3d->t_depth);
+ write_log (_T("%s: %d*%d main texture\n"), D3DHEAD, w, h);
if (d3d->psActive) {
for (int i = 0; i < MAX_SHADERS; i++) {
int w2, h2;
for (int y = 0; y < d3d->ledheight; y++) {
uae_u8 *buf = (uae_u8*)locked.pBits + y * locked.Pitch;
- statusline_single_erase(d3d->num, buf, 32 / 8, y, d3d->ledwidth);
+ statusline_single_erase(d3d->num, buf, y, d3d->ledwidth);
}
- statusline_render(d3d->num, (uae_u8*)locked.pBits, 32 / 8, locked.Pitch, d3d->ledwidth, d3d->ledheight, rc, gc, bc, a);
+ statusline_render(d3d->num, (uae_u8*)locked.pBits, locked.Pitch, d3d->ledwidth, d3d->ledheight, rc, gc, bc, a);
for (int y = 0; y < d3d->ledheight; y++) {
uae_u8 *buf = (uae_u8*)locked.pBits + y * locked.Pitch;
- draw_status_line_single(d3d->num, buf, 32 / 8, y, d3d->ledwidth, rc, gc, bc, a);
+ draw_status_line_single(d3d->num, buf, y, d3d->ledwidth, rc, gc, bc, a);
}
d3d->ledtexture->UnlockRect (0);
static int createsltexture (struct d3dstruct *d3d)
{
- d3d->sltexture = createtext (d3d, d3d->required_sl_texture_w, d3d->required_sl_texture_h, d3d->t_depth < 32 ? D3DFMT_A4R4G4B4 : D3DFMT_A8R8G8B8);
+ d3d->sltexture = createtext (d3d, d3d->required_sl_texture_w, d3d->required_sl_texture_h, D3DFMT_A8R8G8B8);
if (!d3d->sltexture)
return 0;
write_log (_T("%s: SL %d*%d texture allocated\n"), D3DHEAD, d3d->required_sl_texture_w, d3d->required_sl_texture_h);
int l1, l2;
int x, y, yy;
uae_u8 *sld, *p;
- int bpp;
if (d3d->scanline_osl1 == d3d->filterd3d->gfx_filter_scanlines &&
d3d->scanline_osl3 == d3d->filterd3d->gfx_filter_scanlinelevel &&
d3d->scanline_osl4 == d3d->filterd3d->gfx_filter_scanlineoffset &&
!force)
return;
- bpp = d3d->t_depth < 32 ? 2 : 4;
d3d->scanline_osl1 = d3d->filterd3d->gfx_filter_scanlines;
d3d->scanline_osl3 = d3d->filterd3d->gfx_filter_scanlinelevel;
d3d->scanline_osl2 = d3d->filterd3d->gfx_filter_scanlineratio;
}
sld = (uae_u8*)locked.pBits;
for (y = 0; y < d3d->required_sl_texture_h; y++) {
- memset(sld + y * locked.Pitch, 0, d3d->required_sl_texture_w * bpp);
+ memset(sld + y * locked.Pitch, 0, d3d->required_sl_texture_w * 4);
}
for (y = 0; y < d3d->required_sl_texture_h; y += l1 + l2) {
int y2 = y + (d3d->filterd3d->gfx_filter_scanlineoffset % (l1 + 1));
for (yy = 0; yy < l2 && y2 + yy < d3d->required_sl_texture_h; yy++) {
for (x = 0; x < d3d->required_sl_texture_w; x++) {
uae_u8 sll = sl42;
- p = &sld[(y2 + yy) * locked.Pitch + (x * bpp)];
- if (bpp < 4) {
- /* 16-bit, A4R4G4B4 */
- p[1] = (sl4 << 4) | (sll << 0);
- p[0] = (sll << 4) | (sll << 0);
- } else {
- /* 32-bit, A8R8G8B8 */
- uae_u8 sll4 = sl4 | (sl4 << 4);
- uae_u8 sll2 = sll | (sll << 4);
- p[0] = sll2;
- p[1] = sll2;
- p[2] = sll2;
- p[3] = sll4;
- }
+ p = &sld[(y2 + yy) * locked.Pitch + (x * 4)];
+ /* 32-bit, A8R8G8B8 */
+ uae_u8 sll4 = sl4 | (sl4 << 4);
+ uae_u8 sll2 = sll | (sll << 4);
+ p[0] = sll2;
+ p[1] = sll2;
+ p[2] = sll2;
+ p[3] = sll4;
}
}
}
return D3DADAPTER_DEFAULT;
}
-static const TCHAR *D3D_init2 (struct d3dstruct *d3d, HWND ahwnd, int w_w, int w_h, int depth, int *freq, int mmulth, int mmultv)
+static const TCHAR *D3D_init2 (struct d3dstruct *d3d, HWND ahwnd, int w_w, int w_h, int *freq, int mmulth, int mmultv)
{
int monid = d3d->num;
struct amigadisplay *ad = &adisplays[monid];
}
xfree (d3d->fakebitmap);
- d3d->fakebitmap = xmalloc (uae_u8, w_w * depth);
+ d3d->fakebitmap = xmalloc (uae_u8, w_w * 4);
d3dx = LoadLibrary (D3DX9DLL);
if (d3dx == NULL) {
}
d3d->d3dhwnd = ahwnd;
- d3d->t_depth = depth;
flags = D3DCREATE_FPU_PRESERVE | D3DCREATE_MULTITHREADED;
// Check if hardware vertex processing is available
if (d3d->d3d_ex && D3DEX) {
write_log (_T("%s\n"), errmsg);
D3DEX = 0;
- return D3D_init2(d3d, ahwnd, w_w, w_h, depth, freq, mmulth, mmultv);
+ return D3D_init2(d3d, ahwnd, w_w, w_h, freq, mmulth, mmultv);
}
D3D_free(monid, true);
return errmsg;
write_log (_T("\n"));
- write_log (_T("%s: PS=%d.%d VS=%d.%d %d*%d*%d%s%s VS=%d B=%d%s %d-bit %d (%dx%d)\n"),
+ write_log (_T("%s: PS=%d.%d VS=%d.%d %d*%d*%d%s%s VS=%d B=%d%s %d (%dx%d)\n"),
D3DHEAD,
(d3dCaps.PixelShaderVersion >> 8) & 0xff, d3dCaps.PixelShaderVersion & 0xff,
(d3dCaps.VertexShaderVersion >> 8) & 0xff, d3dCaps.VertexShaderVersion & 0xff,
d3d->dpp.Windowed ? _T("") : _T(" FS"),
vsync, ap.gfx_backbuffers,
ap.gfx_vflip < 0 ? _T("WE") : (ap.gfx_vflip > 0 ? _T("WS") : _T("I")),
- d3d->t_depth, adapter,
+ adapter,
d3d->max_texture_w, d3d->max_texture_h
);
changed_prefs.gf[d3d->filterd3didx].gfx_filter_scanlines = d3d->filterd3d->gfx_filter_scanlines = 0;
}
- switch (depth)
- {
- case 32:
- default:
- d3d->tformat = D3DFMT_X8R8G8B8;
- break;
- case 15:
- d3d->tformat = D3DFMT_X1R5G5B5;
- break;
- case 16:
- d3d->tformat = D3DFMT_R5G6B5;
- break;
- }
+ d3d->tformat = D3DFMT_X8R8G8B8;
changed_prefs.leds_on_screen |= STATUSLINE_TARGET;
currprefs.leds_on_screen |= STATUSLINE_TARGET;
D3D_free2 (d3d);
sleep_millis (1000);
write_log (_T("Threaded D3D_init() start (init)\n"));
- const TCHAR *t = D3D_init2 (d3d, d3dargs.hwnd, d3dargs.w, d3dargs.h,d3dargs.depth, d3dargs.freq, d3dargs.mmulth, d3dargs.mmultv);
+ const TCHAR *t = D3D_init2 (d3d, d3dargs.hwnd, d3dargs.w, d3dargs.h, d3dargs.freq, d3dargs.mmulth, d3dargs.mmultv);
if (t) {
gui_message (_T("Threaded D3D_init() returned error '%s'\n"), t);
}
d3d->fakemode = false;
}
-static const TCHAR *xD3D_init (HWND ahwnd, int monid, int w_w, int w_h, int depth, int *freq, int mmulth, int mmultv, int *errp)
+static const TCHAR *xD3D_init (HWND ahwnd, int monid, int w_w, int w_h, int *freq, int mmulth, int mmultv, int *errp)
{
struct d3dstruct *d3d = &d3ddata[monid];
if (!fakemodewaitms) {
- const TCHAR *v = D3D_init2(d3d, ahwnd, w_w, w_h, depth, freq, mmulth, mmultv);
+ const TCHAR *v = D3D_init2(d3d, ahwnd, w_w, w_h, freq, mmulth, mmultv);
if (v != NULL) {
*errp = 1;
}
d3dargs.hwnd = ahwnd;
d3dargs.w = w_w;
d3dargs.h = w_h;
- d3dargs.depth = depth;
d3dargs.mmulth = mmulth;
d3dargs.mmultv = mmultv;
d3dargs.freq = freq;
}
}
-void D3D_getpixelformat (int depth, int *rb, int *gb, int *bb, int *rs, int *gs, int *bs, int *ab, int *as, int *a)
+void D3D_getpixelformat (int *rb, int *gb, int *bb, int *rs, int *gs, int *bs, int *ab, int *as, int *a)
{
- switch (depth)
- {
- case 32:
- *rb = 8;
- *gb = 8;
- *bb = 8;
- *ab = 8;
- *rs = 16;
- *gs = 8;
- *bs = 0;
- *as = 24;
- *a = 0;
- break;
- case 15:
- *rb = 5;
- *gb = 5;
- *bb = 5;
- *ab = 1;
- *rs = 10;
- *gs = 5;
- *bs = 0;
- *as = 15;
- *a = 0;
- break;
- case 16:
- *rb = 5;
- *gb = 6;
- *bb = 5;
- *ab = 0;
- *rs = 11;
- *gs = 5;
- *bs = 0;
- *as = 0;
- *a = 0;
- break;
- }
+ *rb = 8;
+ *gb = 8;
+ *bb = 8;
+ *ab = 8;
+ *rs = 16;
+ *gs = 8;
+ *bs = 0;
+ *as = 24;
+ *a = 0;
}
static float xD3D_getrefreshrate(int monid)
}
*w = d3d->window_w;
*h = d3d->window_h;
- *bits = d3d->t_depth;
+ *bits = 32;
return ret;
}
};
extern void(*D3D_free)(int, bool immediate);
-extern const TCHAR* (*D3D_init)(HWND ahwnd, int, int w_w, int h_h, int depth, int *freq, int mmulth, int mmultv, int *errp);
+extern const TCHAR* (*D3D_init)(HWND ahwnd, int, int w_w, int h_h, int *freq, int mmulth, int mmultv, int *errp);
extern bool(*D3D_alloctexture)(int, int, int);
extern void(*D3D_refresh)(int);
extern bool(*D3D_renderframe)(int, int,bool);
extern bool(*D3D_extoverlay)(struct extoverlay*, int);
extern void(*D3D_paint)(void);
-extern LPDIRECT3DSURFACE9 D3D_capture(int, int*,int*,int*,bool);
-extern bool D3D11_capture(int, void**,int*, int*, int*,int*,bool);
+extern LPDIRECT3DSURFACE9 D3D_capture(int, int*,int*, int*, bool);
+extern bool D3D11_capture(int, void**,int*, int*, int*, int*, bool);
-void D3D_getpixelformat(int depth, int *rb, int *gb, int *bb, int *rs, int *gs, int *bs, int *ab, int *as, int *a);
+void D3D_getpixelformat(int *rb, int *gb, int *bb, int *rs, int *gs, int *bs, int *ab, int *as, int *a);
void d3d9_select(void);
void d3d11_select(void);
#include <Dwmapi.h>
void (*D3D_free)(int, bool immediate);
-const TCHAR *(*D3D_init)(HWND ahwnd, int, int w_w, int h_h, int depth, int *freq, int mmulth, int mmultv, int *err);
+const TCHAR *(*D3D_init)(HWND ahwnd, int monid, int w_w, int h_h, int *freq, int mmulth, int mmultv, int *err);
bool (*D3D_alloctexture)(int, int, int);
void(*D3D_refresh)(int);
bool(*D3D_renderframe)(int, int,bool);
}
for (int y = 0; y < d3d->osd.height; y++) {
uae_u8 *buf = (uae_u8*)map.pData + y * map.RowPitch;
- statusline_single_erase(d3d->num, buf, 32 / 8, y, d3d->ledwidth);
+ statusline_single_erase(d3d->num, buf, y, d3d->ledwidth);
}
- statusline_render(d3d->num, (uae_u8*)map.pData, 32 / 8, map.RowPitch, d3d->ledwidth, d3d->ledheight, rc, gc, bc, a);
+ statusline_render(d3d->num, (uae_u8*)map.pData, map.RowPitch, d3d->ledwidth, d3d->ledheight, rc, gc, bc, a);
for (int y = 0; y < d3d->osd.height; y++) {
uae_u8 *buf = (uae_u8*)map.pData + y * map.RowPitch;
- draw_status_line_single(d3d->num, buf, 32 / 8, y, d3d->ledwidth, rc, gc, bc, a);
+ draw_status_line_single(d3d->num, buf, y, d3d->ledwidth, rc, gc, bc, a);
}
d3d->m_deviceContext->Unmap(d3d->osd.texture, 0);
return d3d->vblank;
}
-static bool xD3D11_initvals(HWND ahwnd, int monid, int w_w, int w_h, int t_w, int t_h, int depth, int *freq, int mmulth, int mmultv, bool doalloc)
+static bool xD3D11_initvals(HWND ahwnd, int monid, int w_w, int w_h, int t_w, int t_h, int *freq, int mmulth, int mmultv, bool doalloc)
{
struct d3d11struct *d3d = &d3d11data[monid];
bool changed = false;
return changed;
}
-static int xxD3D11_init2(HWND ahwnd, int monid, int w_w, int w_h, int t_w, int t_h, int depth, int *freq, int mmulth, int mmultv)
+static int xxD3D11_init2(HWND ahwnd, int monid, int w_w, int w_h, int t_w, int t_h, int *freq, int mmulth, int mmultv)
{
struct d3d11struct *d3d = &d3d11data[monid];
struct amigadisplay *ad = &adisplays[monid];
DXGI_MODE_DESC1 *displayModeList;
DXGI_ADAPTER_DESC adapterDesc;
- write_log(_T("D3D11 init start. (%d*%d) (%d*%d) RTG=%d Depth=%d.\n"), w_w, w_h, t_w, t_h, ad->picasso_on, depth);
+ write_log(_T("D3D11 init start. (%d*%d) (%d*%d) RTG=%d\n"), w_w, w_h, t_w, t_h, ad->picasso_on);
d3d->filterd3didx = ad->gf_index;
d3d->filterd3d = &currprefs.gf[d3d->filterd3didx];
d3d->delayedfs = 0;
d3d->device_errors = 0;
- if (depth != 32) {
- return 0;
- }
-
if (!can_D3D11(false)) {
return 0;
}
- xD3D11_initvals(ahwnd, monid, w_w, w_h, t_w, t_h, depth, freq, mmulth, mmultv, false);
+ xD3D11_initvals(ahwnd, monid, w_w, w_h, t_w, t_h, freq, mmulth, mmultv, false);
d3d->ahwnd = ahwnd;
UINT flags = 0;
result = d3d->m_device->CheckFormatSupport(d3d->texformat, &flags);
if (FAILED(result) || !(flags & D3D11_FORMAT_SUPPORT_TEXTURE2D)) {
- if (depth != 32)
- write_log(_T("Direct3D11: 16-bit texture format is not supported %08x\n"), result);
- else
- write_log(_T("Direct3D11: 32-bit texture format is not supported!? %08x\n"), result);
- if (depth == 32)
- return 0;
- write_log(_T("Direct3D11: Retrying in 32-bit mode\n"), result);
- return -1;
+ write_log(_T("Direct3D11: 32-bit texture format is not supported!? %08x\n"), result);
+ return 0;
}
// Initialize the swap chain description.
write_log(_T("D3D11 free end\n"));
}
-static int xxD3D11_init(HWND ahwnd, int monid, int w_w, int w_h, int depth, int *freq, int mmulth, int mmultv)
+static int xxD3D11_init(HWND ahwnd, int monid, int w_w, int w_h, int *freq, int mmulth, int mmultv)
{
- return xxD3D11_init2(ahwnd, monid, w_w, w_h, w_w, w_h, depth, freq, mmulth, mmultv);
+ return xxD3D11_init2(ahwnd, monid, w_w, w_h, w_w, w_h, freq, mmulth, mmultv);
}
-static const TCHAR *xD3D11_init(HWND ahwnd, int monid, int w_w, int w_h, int depth, int *freq, int mmulth, int mmultv, int *errp)
+static const TCHAR *xD3D11_init(HWND ahwnd, int monid, int w_w, int w_h, int *freq, int mmulth, int mmultv, int *errp)
{
bool reset = false;
if (!can_D3D11(false)) {
}
if (reset) {
xD3D11_free(monid, true);
- int v = xxD3D11_init(ahwnd, monid, w_w, w_h, depth, freq, mmulth, mmultv);
+ int v = xxD3D11_init(ahwnd, monid, w_w, w_h, freq, mmulth, mmultv);
if (v > 0) {
return NULL;
}
return _T("D3D11 INITIALIZATION ERROR");
} else {
struct d3d11struct *d3d = &d3d11data[monid];
- if (xD3D11_initvals(ahwnd, monid, w_w, w_h, w_w, w_h, depth, freq, mmulth, mmultv, true)) {
+ if (xD3D11_initvals(ahwnd, monid, w_w, w_h, w_w, w_h, freq, mmulth, mmultv, true)) {
d3d->fsresizedo = true;
} else {
*errp = -1;
d3d->delayedfs = 0;
ShowWindow(d3d->ahwnd, SW_SHOWNORMAL);
int freq = 0;
- if (!xxD3D11_init2(d3d->ahwnd, d3d->num, d3d->m_screenWidth, d3d->m_screenHeight, d3d->m_bitmapWidth2, d3d->m_bitmapHeight2, 32, &freq, d3d->dmultxh, d3d->dmultxv))
+ if (!xxD3D11_init2(d3d->ahwnd, d3d->num, d3d->m_screenWidth, d3d->m_screenHeight, d3d->m_bitmapWidth2, d3d->m_bitmapHeight2, &freq, d3d->dmultxh, d3d->dmultxv))
d3d->invalidmode = true;
return false;
}
int enabled;
int num;
int wwidth, wheight;
- int depth;
HWND hwnd;
HDC hdc;
HGDIOBJ oldbm;
bmi.bV4Height = -h;
bmi.bV4Planes = 1;
bmi.bV4V4Compression = BI_RGB;
- bmi.bV4BitCount = gdi->depth;
+ bmi.bV4BitCount = 32;
bm->width = w;
bm->height = h;
- bm->depth = gdi->depth;
bm->pitch = ((w * bmi.bV4BitCount + 31) / 32) * 4;
bmi.bV4SizeImage = bm->pitch * h;
bm->hbm = CreateDIBSection(gdi->hdc, (const BITMAPINFO*)&bmi, DIB_RGB_COLORS, &bm->bits, NULL, 0);
for (int y = 0; y < gdi->osd.height; y++) {
uae_u8 *buf = (uae_u8*)gdi->osd.bits + y * gdi->osd.pitch;
- statusline_single_erase(gdi->num, buf, gdi->osd.depth / 8, y, gdi->ledwidth);
+ statusline_single_erase(gdi->num, buf, y, gdi->ledwidth);
}
- statusline_render(gdi->num, (uae_u8*)gdi->osd.bits, gdi->osd.depth / 8, gdi->osd.pitch, gdi->ledwidth, gdi->ledheight, rc, gc, bc, a);
+ statusline_render(gdi->num, (uae_u8*)gdi->osd.bits, gdi->osd.pitch, gdi->ledwidth, gdi->ledheight, rc, gc, bc, a);
for (int y = 0; y < gdi->osd.height; y++) {
uae_u8 *buf = (uae_u8*)gdi->osd.bits + y * gdi->osd.pitch;
- draw_status_line_single(gdi->num, buf, gdi->osd.depth / 8, y, gdi->ledwidth, rc, gc, bc, a);
+ draw_status_line_single(gdi->num, buf, y, gdi->ledwidth, rc, gc, bc, a);
}
}
gdi->extoverlays = NULL;
}
-static const TCHAR *gdi_init(HWND ahwnd, int monid, int w_w, int w_h, int depth, int *freq, int mmulth, int mmultv, int *errp)
+static const TCHAR *gdi_init(HWND ahwnd, int monid, int w_w, int w_h, int *freq, int mmulth, int mmultv, int *errp)
{
struct gdistruct *gdi = &gdidata[monid];
}
gdi_free(monid, true);
gdi->hwnd = ahwnd;
- gdi->depth = depth;
gdi->wwidth = w_w;
gdi->wheight = w_h;
if (allocsprite(gdi, &gdi->buf, gdi->wwidth, gdi->wheight)) {
allocsprite(gdi, &gdi->osd, gdi->ledwidth, gdi->ledheight);
allocsprite(gdi, &gdi->cursor, CURSORMAXWIDTH, CURSORMAXHEIGHT);
gdi->enabled = 1;
- write_log(_T("GDI mode initialized %d*%d*%d\n"), w_w, w_h, depth);
+ write_log(_T("GDI mode initialized %d*%d\n"), w_w, w_h);
return NULL;
}
struct gdistruct *gdi = &gdidata[monid];
int cx, cy;
- if (gdi->depth < 32) {
- return false;
- }
-
if (width < 0 || height < 0) {
return true;
}
return (uae_u8 *)gdi->cursor.bits;
}
- if (gdi->depth < 32) {
- return NULL;
- }
-
if (pitch) {
*pitch = gdi->cursor.pitch;
return (uae_u8*)gdi->cursor.bits;
struct gdioverlay *ov, *ovprev, *ov2;
struct gdibm *s = NULL;
- if (gdi->depth < 32) {
- return false;
- }
-
gdi->eraseneeded = true;
ov = gdi->extoverlays;
dst_width = vidinfo->width;
pitch = vidinfo->rowbytes;
statusline_getpos(monid, &slx, &sly, state->Width, dst_height);
- statusline_render(monid, dst + sly * pitch, vidinfo->pixbytes, pitch, dst_width, dst_height, p96rc, p96gc, p96bc, NULL);
+ statusline_render(monid, dst + sly * pitch, pitch, dst_width, dst_height, p96rc, p96gc, p96bc, NULL);
int m = statusline_get_multiplier(monid) / 100;
for (y = 0; y < TD_TOTAL_HEIGHT * m; y++) {
uae_u8 *buf = dst + (y + sly) * pitch;
- draw_status_line_single(monid, buf, vidinfo->pixbytes, y, dst_width, p96rc, p96gc, p96bc, NULL);
+ draw_status_line_single(monid, buf, y, dst_width, p96rc, p96gc, p96bc, NULL);
}
}
struct winuae_currentmode {
unsigned int flags;
- int native_width, native_height, native_depth, pitch;
- int current_width, current_height, current_depth;
+ int native_width, native_height;
+ int current_width, current_height;
int amiga_width, amiga_height;
int initdone;
int fullfill;
height = state->Height;
}
if (D3D_isenabled(0) == 2) {
- int w, h, pitch, bits = 32, d;
+ int w, h, bits, pitch;
void *data;
- bool got = D3D11_capture(monid, &data, &w, &h, &d, &pitch, renderTarget);
+ bool got = D3D11_capture(monid, &data, &w, &h, &bits, &pitch, renderTarget);
int dpitch = (((width * depth + 31) & ~31) / 8);
lpvBits = xmalloc(uae_u8, dpitch * height);
bi->bmiHeader.biClrUsed = 0;
bi->bmiHeader.biClrImportant = 0;
- if (got && lpvBits && d <= 32) {
+ if (got && lpvBits && bits <= 32) {
for (int y = 0; y < h && y < height; y++) {
uae_u8 *d = (uae_u8*)lpvBits + (height - y - 1) * dpitch;
uae_u32 *s = (uae_u32*)((uae_u8*)data + y * pitch);
bi->bmiHeader.biClrImportant = 0;
if (lpvBits) {
- if (bits == 32) {
- for (int y = 0; y < h && y < height; y++) {
- uae_u8 *d = (uae_u8*)lpvBits + (height - y - 1) * dpitch;
- uae_u32 *s = (uae_u32*)((uae_u8*)l.pBits + y * l.Pitch);
- for (int x = 0; x < w && x < width; x++) {
- uae_u32 v = *s++;
- d[0] = v >> 0;
- d[1] = v >> 8;
- d[2] = v >> 16;
- if (depth == 32) {
- d[3] = v >> 24;
- d += 4;
- } else {
- d += 3;
- }
- }
- }
- } else if (bits == 16 || bits == 15) {
- for (int y = 0; y < h && y < height; y++) {
- uae_u8 *d = (uae_u8*)lpvBits + (height - y - 1) * dpitch;
- uae_u16 *s = (uae_u16*)((uae_u8*)l.pBits + y * l.Pitch);
- for (int x = 0; x < w && x < width; x++) {
- uae_u16 v = s[x];
- uae_u16 v2 = v;
- if (bits == 16) {
- v2 = v & 31;
- v2 |= ((v & (31 << 5)) << 1) | (((v >> 5) & 1) << 5);
- v2 |= (v & (31 << 10)) << 1;
- } else {
- v2 = v & 31;
- v2 |= (v >> 1) & (31 << 5);
- v2 |= (v >> 1) & (31 << 10);
- }
- ((uae_u16*)d)[0] = v2;
- d += 2;
+ for (int y = 0; y < h && y < height; y++) {
+ uae_u8 *d = (uae_u8*)lpvBits + (height - y - 1) * dpitch;
+ uae_u32 *s = (uae_u32*)((uae_u8*)l.pBits + y * l.Pitch);
+ for (int x = 0; x < w && x < width; x++) {
+ uae_u32 v = *s++;
+ d[0] = v >> 0;
+ d[1] = v >> 8;
+ d[2] = v >> 16;
+ if (depth == 32) {
+ d[3] = v >> 24;
+ d += 4;
+ } else {
+ d += 3;
}
}
}
PostMessage(mon->hStatusWnd, SB_SETTEXT, (WPARAM)((window_led_msg_start) | SBT_OWNERDRAW), (LPARAM)_T(""));
}
-void statusline_render(int monid, uae_u8 *buf, int bpp, int pitch, int maxwidth, int maxheight, uae_u32 *rc, uae_u32 *gc, uae_u32 *bc, uae_u32 *alpha)
+void statusline_render(int monid, uae_u8 *buf, int pitch, int maxwidth, int maxheight, uae_u32 *rc, uae_u32 *gc, uae_u32 *bc, uae_u32 *alpha)
{
struct AmigaMonitor *mon = &AMonitors[monid];
uae_u32 white = rc[0xff] | gc[0xff] | bc[0xff] | (alpha ? alpha[0xff] : 0);
* Copyright 1997-2000 Brian King
*/
-#define FORCE16BIT 0
-
#include "sysconfig.h"
#include <stdlib.h>
return isfullscreen_2(&currprefs);
}
-int WIN32GFX_GetDepth(struct AmigaMonitor *mon, int real)
-{
- if (!mon->currentmode.native_depth)
- return mon->currentmode.current_depth;
- return real ? mon->currentmode.native_depth : mon->currentmode.current_depth;
-}
-
int WIN32GFX_GetWidth(struct AmigaMonitor *mon)
{
return mon->currentmode.current_width;
int default_freq = 60;
-static uae_u8 *scrlinebuf;
-
-
static struct MultiDisplay *getdisplay2(struct uae_prefs *p, int index)
{
struct AmigaMonitor *mon = &AMonitors[0];
#ifdef PICASSO96
}
#endif
-#if FORCE16BIT
- mon->currentmode.current_depth = 16;
-#else
- mon->currentmode.current_depth = 32;
-#endif
+
mon->currentmode.amiga_width = mon->currentmode.current_width;
mon->currentmode.amiga_height = mon->currentmode.current_height;
{
struct AmigaMonitor *mon = &AMonitors[monid];
/* init colors */
- D3D_getpixelformat (mon->currentmode.current_depth,
- &red_bits, &green_bits, &blue_bits, &red_shift, &green_shift, &blue_shift, &alpha_bits, &alpha_shift, &alpha);
-
- if (!(mon->currentmode.flags & (DM_D3D))) {
- if (mon->currentmode.current_depth != mon->currentmode.native_depth) {
- if (mon->currentmode.current_depth == 16) {
- red_bits = 5; green_bits = 6; blue_bits = 5;
- red_shift = 11; green_shift = 5; blue_shift = 0;
- } else {
- red_bits = green_bits = blue_bits = 8;
- red_shift = 16; green_shift = 8; blue_shift = 0;
- }
- }
- }
+ D3D_getpixelformat(&red_bits, &green_bits, &blue_bits, &red_shift, &green_shift, &blue_shift, &alpha_bits, &alpha_shift, &alpha);
+
+ red_bits = green_bits = blue_bits = 8;
+ red_shift = 16; green_shift = 8; blue_shift = 0;
+
alloc_colors64k(monid, red_bits, green_bits, blue_bits, red_shift,green_shift, blue_shift, alpha_bits, alpha_shift, alpha, 0);
notice_new_xcolors ();
#ifdef AVIOUTPUT
static int oldhz;
int w = mon->currentmode.native_width;
int h = mon->currentmode.native_height;
- int d = mon->currentmode.native_depth / 8;
struct MultiDisplay *md = getdisplay(&currprefs, monid);
struct PicassoResolution *found;
int newh, i, cnt;
return 1;
if (state->Width == wc->current_width &&
state->Height == wc->current_height) {
- if (state->BytesPerPixel * 8 == wc->current_depth || state->BytesPerPixel == 1)
- return 0;
- return 0;
+ return 0;
}
return 1;
} else {
if (mon->currentmode.current_width != wc->current_width ||
- mon->currentmode.current_height != wc->current_height ||
- mon->currentmode.current_depth != wc->current_depth)
+ mon->currentmode.current_height != wc->current_height)
return -1;
}
} else if (isfullscreen () == 0) {
#ifdef PICASSO96
struct picasso_vidbuf_description *vidinfo = &picasso_vidinfo[mon->monitor_id];
vidinfo->rowbytes = 0;
- vidinfo->pixbytes = mon->currentmode.current_depth / 8;
+ vidinfo->pixbytes = 32 / 8;
vidinfo->rgbformat = 0;
vidinfo->extra_mem = 1;
vidinfo->height = mon->currentmode.current_height;
vidinfo->width = mon->currentmode.current_width;
- vidinfo->depth = mon->currentmode.current_depth;
vidinfo->offset = 0;
vidinfo->splitypos = -1;
#endif
return 1;
}
-static void allocsoftbuffer(int monid, const TCHAR *name, struct vidbuffer *buf, int flags, int width, int height, int depth)
+static void allocsoftbuffer(int monid, const TCHAR *name, struct vidbuffer *buf, int flags, int width, int height)
{
struct vidbuf_description *vidinfo = &adisplays[monid].gfxvidinfo;
+ int depth = 32;
if (buf->initialized && buf->vram_buffer) {
return;
buf->bufmem_allocated = NULL;
buf->vram_buffer = true;
- write_log(_T("Mon %d reserved %s draw buffer (%d*%d*%d)\n"), monid, name, width, height, depth);
-
} else {
xfree(buf->realbufmem);
buf->bufmem_allocated = buf->bufmem = buf->realbufmem + (h / 2) * buf->rowbytes + (w / 2) * buf->pixbytes;
buf->bufmemend = buf->realbufmem + size - buf->rowbytes;
- write_log(_T("Mon %d allocated %s temp buffer (%d*%d*%d) = %p\n"), monid, name, width, height, depth, buf->realbufmem);
-
}
}
static BOOL doInit(struct AmigaMonitor *mon)
{
- int tmp_depth;
int ret = 0;
bool modechanged;
for (;;) {
updatemodes(mon);
- mon->currentmode.native_depth = 0;
- tmp_depth = mon->currentmode.current_depth;
if (mon->currentmode.flags & DM_W_FULLSCREEN) {
RECT rc = getdisplay(&currprefs, mon->monitor_id)->rect;
break;
} else {
#endif
- mon->currentmode.native_depth = mon->currentmode.current_depth;
-
if (currprefs.gfx_resolution > avidinfo->gfx_resolution_reserved)
avidinfo->gfx_resolution_reserved = currprefs.gfx_resolution;
if (currprefs.gfx_vresolution > avidinfo->gfx_vresolution_reserved)
avidinfo->gfx_vresolution_reserved = currprefs.gfx_vresolution;
- //gfxvidinfo.drawbuffer.gfx_resolution_reserved = RES_SUPERHIRES;
#if defined (GFXFILTER)
if (mon->currentmode.flags & DM_D3D) {
}
int errv = 0;
const TCHAR *err = D3D_init(mon->hAmigaWnd, mon->monitor_id, mon->currentmode.native_width, mon->currentmode.native_height,
- mon->currentmode.current_depth, &mon->currentmode.freq, fmh, fmv, &errv);
+ &mon->currentmode.freq, fmh, fmv, &errv);
if (errv > 0) {
if (errv == 2 && currprefs.gfx_api == 0) {
write_log("Retrying D3D %s\n", err);
error_log(_T("Direct3D11 failed to initialize ('%s'), falling back to Direct3D9."), err);
errv = 0;
err = D3D_init(mon->hAmigaWnd, mon->monitor_id, mon->currentmode.native_width, mon->currentmode.native_height,
- mon->currentmode.current_depth, &mon->currentmode.freq, fmh, fmv, &errv);
+ &mon->currentmode.freq, fmh, fmv, &errv);
}
if (errv > 0) {
D3D_free(0, true);
error_log(_T("Direct3D9/11 failed to initialize ('%s'), falling back to GDI."), err);
errv = 0;
err = D3D_init(mon->hAmigaWnd, mon->monitor_id, mon->currentmode.native_width, mon->currentmode.native_height,
- mon->currentmode.current_depth, &mon->currentmode.freq, fmh, fmv, &errv);
+ &mon->currentmode.freq, fmh, fmv, &errv);
if (errv) {
error_log(_T("Failed to initialize any rendering modes."));
}
}
- mon->currentmode.current_depth = mon->currentmode.native_depth;
gfxmode_reset(mon->monitor_id);
ret = -1;
goto oops;
int WIN32GFX_IsPicassoScreen(struct AmigaMonitor*);
int WIN32GFX_GetWidth(struct AmigaMonitor*);
int WIN32GFX_GetHeight(struct AmigaMonitor*);
-int WIN32GFX_GetDepth(struct AmigaMonitor*, int real);
void WIN32GFX_DisplayChangeRequested(int);
void DX_Invalidate(struct AmigaMonitor*, int x, int y, int width, int height);
-int WIN32GFX_AdjustScreenmode(struct MultiDisplay *md, int *pwidth, int *pheight, int *ppixbits);
+int WIN32GFX_AdjustScreenmode(struct MultiDisplay *md, int *pwidth, int *pheight);
extern HCURSOR normalcursor;
extern int default_freq;
static const char *numbers = numbers_default;
-STATIC_INLINE uae_u32 ledcolor(uae_u32 c, uae_u32 *rc, uae_u32 *gc, uae_u32 *bc, uae_u32 *a)
+static uae_u32 ledcolor(uae_u32 c, uae_u32 *rc, uae_u32 *gc, uae_u32 *bc, uae_u32 *a)
{
uae_u32 v = rc[(c >> 16) & 0xff] | gc[(c >> 8) & 0xff] | bc[(c >> 0) & 0xff];
if (a)
return v;
}
-static void write_tdnumber(uae_u8 *buf, int bpp, int x, int y, int num, uae_u32 c1, uae_u32 c2, int mult)
+static void write_tdnumber(uae_u8 *buf, int x, int y, int num, uae_u32 c1, uae_u32 c2, int mult)
{
int j;
const char *numptr;
for (j = 0; j < td_numbers_width; j++) {
for (int k = 0; k < mult; k++) {
if (*numptr == 'x')
- putpixel(buf, NULL, bpp, x + j * mult + k, c1);
+ putpixel(buf, NULL, x + j * mult + k, c1);
else if (*numptr == '+')
- putpixel(buf, NULL, bpp, x + j * mult + k, c2);
+ putpixel(buf, NULL, x + j * mult + k, c2);
}
numptr++;
}
return statusline_mult[idx];
}
-void draw_status_line_single(int monid, uae_u8 *buf, int bpp, int y, int totalwidth, uae_u32 *rc, uae_u32 *gc, uae_u32 *bc, uae_u32 *alpha)
+void draw_status_line_single(int monid, uae_u8 *buf, int y, int totalwidth, uae_u32 *rc, uae_u32 *gc, uae_u32 *bc, uae_u32 *alpha)
{
struct amigadisplay *ad = &adisplays[monid];
int x_start, j, led, border;
x = x_start + pos * td_width * mult;
for (int xx = 0; xx < mult; xx++) {
if (!border) {
- putpixel(buf, NULL, bpp, x - mult + xx, cb);
+ putpixel(buf, NULL, x - mult + xx, cb);
}
for (j = 0; j < td_led_width * mult; j += mult) {
- putpixel(buf, NULL, bpp, x + j + xx, c);
+ putpixel(buf, NULL, x + j + xx, c);
}
if (!border) {
- putpixel(buf, NULL, bpp, x + j + xx, cb);
+ putpixel(buf, NULL, x + j + xx, cb);
}
}
if (num3 >= 0) {
x += (td_led_width - am * td_numbers_width) * mult / 2;
if (num1 > 0) {
- write_tdnumber(buf, bpp, x, y - td_numbers_pady, num1, pen_rgb, c2, mult);
+ write_tdnumber(buf, x, y - td_numbers_pady, num1, pen_rgb, c2, mult);
x += td_numbers_width * mult;
}
if (num2 >= 0) {
- write_tdnumber(buf, bpp, x, y - td_numbers_pady, num2, pen_rgb, c2, mult);
+ write_tdnumber(buf, x, y - td_numbers_pady, num2, pen_rgb, c2, mult);
x += td_numbers_width * mult;
} else if (num2 < -1) {
x += td_numbers_width * mult;
}
- write_tdnumber(buf, bpp, x, y - td_numbers_pady, num3, pen_rgb, c2, mult);
+ write_tdnumber(buf, x, y - td_numbers_pady, num3, pen_rgb, c2, mult);
x += td_numbers_width * mult;
if (num4 > 0)
- write_tdnumber(buf, bpp, x, y - td_numbers_pady, num4, pen_rgb, c2, mult);
+ write_tdnumber(buf, x, y - td_numbers_pady, num4, pen_rgb, c2, mult);
}
}
}
statusline_update_notification();
}
-void statusline_single_erase(int monid, uae_u8 *buf, int bpp, int y, int totalwidth)
+void statusline_single_erase(int monid, uae_u8 *buf, int y, int totalwidth)
{
- memset(buf, 0, bpp * totalwidth);
+ memset(buf, 0, 4 * totalwidth);
}