clang-format in src/win and other misc places
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#ifndef VIDEO_EGA_RENDER_REMAP_H
|
||||
# define VIDEO_EGA_RENDER_REMAP_H
|
||||
#define VIDEO_EGA_RENDER_REMAP_H
|
||||
|
||||
#define VAR_BYTE_MODE (0 << 0)
|
||||
#define VAR_WORD_MODE_MA13 (1 << 0)
|
||||
@@ -9,44 +9,35 @@
|
||||
#define VAR_ROW0_MA13 (1 << 2)
|
||||
#define VAR_ROW1_MA14 (1 << 3)
|
||||
|
||||
#define ADDRESS_REMAP_FUNC(nr) \
|
||||
static uint32_t address_remap_func_ ## nr(ega_t *ega, uint32_t in_addr) \
|
||||
{ \
|
||||
uint32_t out_addr; \
|
||||
\
|
||||
switch (nr & VAR_MODE_MASK) \
|
||||
{ \
|
||||
case VAR_BYTE_MODE: \
|
||||
out_addr = in_addr; \
|
||||
break; \
|
||||
\
|
||||
case VAR_WORD_MODE_MA13: \
|
||||
out_addr = ((in_addr << 1) & 0x1fff8) | \
|
||||
((in_addr >> 13) & 0x4) | \
|
||||
(in_addr & ~0x1ffff); \
|
||||
break; \
|
||||
\
|
||||
case VAR_WORD_MODE_MA15: \
|
||||
out_addr = ((in_addr << 1) & 0x1fff8) | \
|
||||
((in_addr >> 15) & 0x4) | \
|
||||
(in_addr & ~0x1ffff); \
|
||||
break; \
|
||||
\
|
||||
case VAR_DWORD_MODE: \
|
||||
out_addr = ((in_addr << 2) & 0x3fff0) | \
|
||||
((in_addr >> 14) & 0xc) | \
|
||||
(in_addr & ~0x3ffff); \
|
||||
break; \
|
||||
} \
|
||||
\
|
||||
if (nr & VAR_ROW0_MA13) \
|
||||
out_addr = (out_addr & ~0x8000) | \
|
||||
((ega->sc & 1) ? 0x8000 : 0); \
|
||||
if (nr & VAR_ROW1_MA14) \
|
||||
out_addr = (out_addr & ~0x10000) | \
|
||||
((ega->sc & 2) ? 0x10000 : 0); \
|
||||
\
|
||||
return out_addr; \
|
||||
#define ADDRESS_REMAP_FUNC(nr) \
|
||||
static uint32_t address_remap_func_##nr(ega_t *ega, uint32_t in_addr) \
|
||||
{ \
|
||||
uint32_t out_addr; \
|
||||
\
|
||||
switch (nr & VAR_MODE_MASK) { \
|
||||
case VAR_BYTE_MODE: \
|
||||
out_addr = in_addr; \
|
||||
break; \
|
||||
\
|
||||
case VAR_WORD_MODE_MA13: \
|
||||
out_addr = ((in_addr << 1) & 0x1fff8) | ((in_addr >> 13) & 0x4) | (in_addr & ~0x1ffff); \
|
||||
break; \
|
||||
\
|
||||
case VAR_WORD_MODE_MA15: \
|
||||
out_addr = ((in_addr << 1) & 0x1fff8) | ((in_addr >> 15) & 0x4) | (in_addr & ~0x1ffff); \
|
||||
break; \
|
||||
\
|
||||
case VAR_DWORD_MODE: \
|
||||
out_addr = ((in_addr << 2) & 0x3fff0) | ((in_addr >> 14) & 0xc) | (in_addr & ~0x3ffff); \
|
||||
break; \
|
||||
} \
|
||||
\
|
||||
if (nr & VAR_ROW0_MA13) \
|
||||
out_addr = (out_addr & ~0x8000) | ((ega->sc & 1) ? 0x8000 : 0); \
|
||||
if (nr & VAR_ROW1_MA14) \
|
||||
out_addr = (out_addr & ~0x10000) | ((ega->sc & 2) ? 0x10000 : 0); \
|
||||
\
|
||||
return out_addr; \
|
||||
}
|
||||
|
||||
ADDRESS_REMAP_FUNC(0)
|
||||
@@ -66,8 +57,7 @@ ADDRESS_REMAP_FUNC(13)
|
||||
ADDRESS_REMAP_FUNC(14)
|
||||
ADDRESS_REMAP_FUNC(15)
|
||||
|
||||
static uint32_t (*address_remap_funcs[16])(ega_t *ega, uint32_t in_addr) =
|
||||
{
|
||||
static uint32_t (*address_remap_funcs[16])(ega_t *ega, uint32_t in_addr) = {
|
||||
address_remap_func_0,
|
||||
address_remap_func_1,
|
||||
address_remap_func_2,
|
||||
@@ -86,7 +76,8 @@ static uint32_t (*address_remap_funcs[16])(ega_t *ega, uint32_t in_addr) =
|
||||
address_remap_func_15
|
||||
};
|
||||
|
||||
void ega_recalc_remap_func(ega_t *ega)
|
||||
void
|
||||
ega_recalc_remap_func(ega_t *ega)
|
||||
{
|
||||
int func_nr;
|
||||
|
||||
@@ -105,7 +96,7 @@ void ega_recalc_remap_func(ega_t *ega)
|
||||
func_nr |= VAR_ROW1_MA14;
|
||||
|
||||
ega->remap_required = (func_nr != 0);
|
||||
ega->remap_func = address_remap_funcs[func_nr];
|
||||
ega->remap_func = address_remap_funcs[func_nr];
|
||||
}
|
||||
|
||||
#endif /*VIDEO_RENDER_REMAP_H*/
|
||||
|
||||
Reference in New Issue
Block a user