summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-01-16 04:12:04 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-01-16 04:12:04 +0000
commitaebc07a8971238b115210e89eca8e7824eca8dbc (patch)
treea7157331b3813365da7703902380ac6309f5e934 /src
parentf6c832ea90a9c69c95b4006ff328867bb41ebe5c (diff)
Cleanups and version bump.
Diffstat (limited to 'src')
-rw-r--r--src/emu/clifront.c2
-rw-r--r--src/emu/cpu/m6502/ops02.h2
-rw-r--r--src/emu/cpu/rsp/rspdrc.c2
-rw-r--r--src/emu/cpu/unsp/unsp.c14
-rw-r--r--src/emu/debug/express.c4
-rw-r--r--src/emu/devintrf.c2
-rw-r--r--src/emu/devintrf.h6
-rw-r--r--src/emu/emu.h6
-rw-r--r--src/emu/emualloc.c48
-rw-r--r--src/emu/emualloc.h28
-rw-r--r--src/emu/emucore.h6
-rw-r--r--src/emu/machine/ldcore.c6
-rw-r--r--src/emu/machine/pit8253.c2
-rw-r--r--src/emu/mame.c2
-rw-r--r--src/emu/mame.h14
-rw-r--r--src/emu/memory.c6
-rw-r--r--src/emu/rendfont.c4
-rw-r--r--src/emu/sound/k053260.c4
-rw-r--r--src/emu/state.c2
-rw-r--r--src/emu/validity.c2
-rw-r--r--src/lib/util/astring.h6
-rw-r--r--src/lib/util/bitmap.c6
-rw-r--r--src/lib/util/tagmap.h8
-rw-r--r--src/mame/drivers/aliens.c2
-rw-r--r--src/mame/drivers/asterix.c2
-rw-r--r--src/mame/drivers/blockhl.c2
-rw-r--r--src/mame/drivers/cave.c18
-rw-r--r--src/mame/drivers/cb2001.c6
-rw-r--r--src/mame/drivers/chqflag.c2
-rw-r--r--src/mame/drivers/cybertnk.c2
-rw-r--r--src/mame/drivers/deco_ld.c2
-rw-r--r--src/mame/drivers/dwarfd.c46
-rw-r--r--src/mame/drivers/gbusters.c2
-rw-r--r--src/mame/drivers/gunpey.c6
-rw-r--r--src/mame/drivers/hng64.c2
-rw-r--r--src/mame/drivers/metalmx.c2
-rw-r--r--src/mame/drivers/monzagp.c40
-rw-r--r--src/mame/drivers/moo.c4
-rw-r--r--src/mame/drivers/multigam.c2
-rw-r--r--src/mame/drivers/ninjaw.c2
-rw-r--r--src/mame/drivers/othunder.c2
-rw-r--r--src/mame/drivers/parodius.c6
-rw-r--r--src/mame/drivers/psikyosh.c22
-rw-r--r--src/mame/drivers/rungun.c2
-rw-r--r--src/mame/drivers/seta.c6
-rw-r--r--src/mame/drivers/slapshot.c2
-rw-r--r--src/mame/drivers/sms.c68
-rw-r--r--src/mame/drivers/spy.c6
-rw-r--r--src/mame/drivers/ssingles.c42
-rw-r--r--src/mame/drivers/surpratk.c2
-rw-r--r--src/mame/drivers/taito_f2.c6
-rw-r--r--src/mame/drivers/taito_l.c2
-rw-r--r--src/mame/drivers/taito_z.c6
-rw-r--r--src/mame/drivers/tmnt.c28
-rw-r--r--src/mame/drivers/vega.c6
-rw-r--r--src/mame/drivers/warriorb.c2
-rw-r--r--src/mame/drivers/wgp.c2
-rw-r--r--src/mame/drivers/xexex.c2
-rw-r--r--src/mame/drivers/xmen.c4
-rw-r--r--src/mame/includes/asuka.h2
-rw-r--r--src/mame/includes/cave.h2
-rw-r--r--src/mame/includes/gijoe.h4
-rw-r--r--src/mame/includes/rastan.h2
-rw-r--r--src/mame/includes/spy.h2
-rw-r--r--src/mame/includes/taito_b.h2
-rw-r--r--src/mame/includes/taito_f2.h2
-rw-r--r--src/mame/includes/tmnt.h4
-rw-r--r--src/mame/includes/volfied.h2
-rw-r--r--src/mame/machine/ajax.c2
-rw-r--r--src/mame/machine/n64.c2
-rw-r--r--src/mame/video/cave.c172
-rw-r--r--src/mame/video/darius.c2
-rw-r--r--src/mame/video/dbz.c4
-rw-r--r--src/mame/video/gijoe.c34
-rw-r--r--src/mame/video/gradius3.c4
-rw-r--r--src/mame/video/hng64.c6
-rw-r--r--src/mame/video/lethal.c14
-rw-r--r--src/mame/video/mainevt.c2
-rw-r--r--src/mame/video/moo.c2
-rw-r--r--src/mame/video/ninjaw.c4
-rw-r--r--src/mame/video/othunder.c2
-rw-r--r--src/mame/video/overdriv.c2
-rw-r--r--src/mame/video/parodius.c4
-rw-r--r--src/mame/video/psikyosh.c6
-rw-r--r--src/mame/video/rastan.c2
-rw-r--r--src/mame/video/simpsons.c6
-rw-r--r--src/mame/video/slapshot.c12
-rw-r--r--src/mame/video/surpratk.c4
-rw-r--r--src/mame/video/tail2nos.c14
-rw-r--r--src/mame/video/taito_f2.c16
-rw-r--r--src/mame/video/taito_l.c2
-rw-r--r--src/mame/video/taito_z.c16
-rw-r--r--src/mame/video/taitoair.c24
-rw-r--r--src/mame/video/tmnt.c36
-rw-r--r--src/mame/video/topspeed.c2
-rw-r--r--src/mame/video/vendetta.c4
-rw-r--r--src/mame/video/wgp.c16
-rw-r--r--src/mame/video/xexex.c12
-rw-r--r--src/mame/video/xmen.c4
-rw-r--r--src/osd/sdl/SDL1211_opengl.h10
-rw-r--r--src/osd/sdl/blit13.h8
-rw-r--r--src/osd/sdl/debugwin.c26
-rw-r--r--src/osd/sdl/draw13.c272
-rw-r--r--src/osd/sdl/drawogl.c350
-rw-r--r--src/osd/sdl/drawsdl.c134
-rw-r--r--src/osd/sdl/dview.c22
-rw-r--r--src/osd/sdl/gl_shader_mgr.c46
-rw-r--r--src/osd/sdl/gl_shader_tool.c46
-rw-r--r--src/osd/sdl/gl_shader_tool.h24
-rw-r--r--src/osd/sdl/input.c432
-rw-r--r--src/osd/sdl/main.c2
-rw-r--r--src/osd/sdl/osd_opengl.h72
-rw-r--r--src/osd/sdl/osdsdl.h406
-rw-r--r--src/osd/sdl/osinline.h4
-rw-r--r--src/osd/sdl/output.c10
-rw-r--r--src/osd/sdl/sdl.mak38
-rw-r--r--src/osd/sdl/sdldir.c4
-rw-r--r--src/osd/sdl/sdlfile.c32
-rw-r--r--src/osd/sdl/sdlmain.c98
-rw-r--r--src/osd/sdl/sdlos_macosx.c6
-rw-r--r--src/osd/sdl/sdlos_os2.c2
-rw-r--r--src/osd/sdl/sdlos_unix.c6
-rw-r--r--src/osd/sdl/sdlsync.h18
-rw-r--r--src/osd/sdl/sdlsync_ntc.c34
-rw-r--r--src/osd/sdl/sdlsync_os2.c18
-rw-r--r--src/osd/sdl/sdlsync_sdl.c16
-rw-r--r--src/osd/sdl/sdlsync_tc.c26
-rw-r--r--src/osd/sdl/sdlsync_win32.c10
-rw-r--r--src/osd/sdl/sdlwork.c14
-rw-r--r--src/osd/sdl/sound.c54
-rw-r--r--src/osd/sdl/testkeys.c22
-rw-r--r--src/osd/sdl/texcopy.c28
-rw-r--r--src/osd/sdl/video.c78
-rw-r--r--src/osd/sdl/video.h8
-rw-r--r--src/osd/sdl/window.c104
-rw-r--r--src/osd/sdl/window.h12
-rw-r--r--src/osd/windows/winmisc.c10
-rw-r--r--src/tools/unidasm.c6
-rw-r--r--src/version.c2
139 files changed, 1752 insertions, 1752 deletions
diff --git a/src/emu/clifront.c b/src/emu/clifront.c
index 6701e4f2234..a5cb042197a 100644
--- a/src/emu/clifront.c
+++ b/src/emu/clifront.c
@@ -195,7 +195,7 @@ error:
/* free our options and exit */
if (options != NULL)
options_free(options);
-
+
/* report any unfreed memory */
dump_unfreed_mem();
return result;
diff --git a/src/emu/cpu/m6502/ops02.h b/src/emu/cpu/m6502/ops02.h
index f97f8f2c02a..a44e35b8ed9 100644
--- a/src/emu/cpu/m6502/ops02.h
+++ b/src/emu/cpu/m6502/ops02.h
@@ -665,7 +665,7 @@
P |= F_T | F_B; \
if( (cpustate->irq_state != CLEAR_LINE) && !(P & F_I) ) \
{ \
- LOG(("M6502 '%s' RTI sets after_cli\n",cpustate->device->tag.cstr())); \
+ LOG(("M6502 '%s' RTI sets after_cli\n",cpustate->device->tag.cstr())); \
cpustate->after_cli = 1; \
}
diff --git a/src/emu/cpu/rsp/rspdrc.c b/src/emu/cpu/rsp/rspdrc.c
index adea780e042..b4da27c751e 100644
--- a/src/emu/cpu/rsp/rspdrc.c
+++ b/src/emu/cpu/rsp/rspdrc.c
@@ -1977,7 +1977,7 @@ static void cfunc_rsp_stv(void *param)
static int generate_swc2(rsp_state *rsp, drcuml_block *block, compiler_state *compiler, const opcode_desc *desc)
{
-// int loopdest;
+// int loopdest;
UINT32 op = desc->opptr.l[0];
int dest = (op >> 16) & 0x1f;
//int base = (op >> 21) & 0x1f;
diff --git a/src/emu/cpu/unsp/unsp.c b/src/emu/cpu/unsp/unsp.c
index 7fc8f4bc540..f0dababc283 100644
--- a/src/emu/cpu/unsp/unsp.c
+++ b/src/emu/cpu/unsp/unsp.c
@@ -827,11 +827,11 @@ static CPU_SET_INFO( unsp )
unsp_set_irq_line(unsp, state - CPUINFO_INT_INPUT_STATE, (int)info->i);
break;
- case CPUINFO_INT_REGISTER + UNSP_SP: UNSP_REG(SP) = info->i; break;
+ case CPUINFO_INT_REGISTER + UNSP_SP: UNSP_REG(SP) = info->i; break;
case CPUINFO_INT_REGISTER + UNSP_R1: UNSP_REG(R1) = info->i; break;
case CPUINFO_INT_REGISTER + UNSP_R2: UNSP_REG(R2) = info->i; break;
case CPUINFO_INT_REGISTER + UNSP_R3: UNSP_REG(R3) = info->i; break;
- case CPUINFO_INT_REGISTER + UNSP_R4: UNSP_REG(R4) = info->i; break;
+ case CPUINFO_INT_REGISTER + UNSP_R4: UNSP_REG(R4) = info->i; break;
case CPUINFO_INT_REGISTER + UNSP_BP: UNSP_REG(BP) = info->i; break;
case CPUINFO_INT_REGISTER + UNSP_SR: UNSP_REG(SR) = info->i; break;
case CPUINFO_INT_PC: /* Intentional fallthrough */
@@ -841,7 +841,7 @@ static CPU_SET_INFO( unsp )
break;
case CPUINFO_INT_REGISTER + UNSP_IRQ: unsp->irq = info->i; break;
case CPUINFO_INT_REGISTER + UNSP_FIQ: unsp->fiq = info->i; break;
- case CPUINFO_INT_REGISTER + UNSP_SB: unsp->sb = info->i; break;
+ case CPUINFO_INT_REGISTER + UNSP_SB: unsp->sb = info->i; break;
}
}
@@ -854,7 +854,7 @@ CPU_GET_INFO( unsp )
case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(unsp_state); break;
case CPUINFO_INT_INPUT_LINES: info->i = 0; break;
case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break;
- case DEVINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break;
+ case DEVINFO_INT_ENDIANNESS: info->i = ENDIANNESS_BIG; break;
case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break;
case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break;
case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 2; break;
@@ -895,11 +895,11 @@ CPU_GET_INFO( unsp )
case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &unsp->icount; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
- case DEVINFO_STR_NAME: strcpy(info->s, "u'nSP"); break;
- case DEVINFO_STR_FAMILY: strcpy(info->s, "u'nSP"); break;
+ case DEVINFO_STR_NAME: strcpy(info->s, "u'nSP"); break;
+ case DEVINFO_STR_FAMILY: strcpy(info->s, "u'nSP"); break;
case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break;
case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break;
- case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break;
+ case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break;
case CPUINFO_STR_FLAGS: strcpy(info->s, " "); break;
diff --git a/src/emu/debug/express.c b/src/emu/debug/express.c
index 434e2c83090..0bce34ffeca 100644
--- a/src/emu/debug/express.c
+++ b/src/emu/debug/express.c
@@ -1978,7 +1978,7 @@ int symtable_add(symbol_table *table, const char *name, const symbol_entry *entr
int strindex;
int all_digits, i;
-// assert_always(entry->table == table, "Mismatched symbol tables");
+// assert_always(entry->table == table, "Mismatched symbol tables");
/* we cannot add numeric symbols */
all_digits = TRUE;
@@ -1990,7 +1990,7 @@ int symtable_add(symbol_table *table, const char *name, const symbol_entry *entr
break;
}
}
-// assert_always(!all_digits, "All-digit symbols are not allowed");
+// assert_always(!all_digits, "All-digit symbols are not allowed");
/* see if we already have an entry and just overwrite it if we do */
oldentry = (symbol_entry *)symtable_find(table, name);
diff --git a/src/emu/devintrf.c b/src/emu/devintrf.c
index 9454db8c703..1855795f5ea 100644
--- a/src/emu/devintrf.c
+++ b/src/emu/devintrf.c
@@ -99,7 +99,7 @@ const region_info *device_config::subregion(const char *_tag) const
/*-------------------------------------------------
- subdevice - return a pointer to the given
+ subdevice - return a pointer to the given
device that is owned by us
-------------------------------------------------*/
diff --git a/src/emu/devintrf.h b/src/emu/devintrf.h
index 2560542cb42..72412a30d8f 100644
--- a/src/emu/devintrf.h
+++ b/src/emu/devintrf.h
@@ -311,7 +311,7 @@ class device_config
{
DISABLE_COPYING(device_config);
-public: // private eventually
+public: // private eventually
const address_space * addrspace[ADDRESS_SPACES]; /* auto-discovered address spaces */
public:
@@ -320,7 +320,7 @@ public:
inline const address_space *space(int index = 0) const;
inline const address_space *space(device_space index) const;
-
+
const region_info *subregion(const char *tag) const;
const device_config *subdevice(const char *tag) const;
@@ -357,7 +357,7 @@ public:
struct device_list
{
device_config * head; /* head of the list */
- tagmap_t<device_config *> map; /* map for fast lookups */
+ tagmap_t<device_config *> map; /* map for fast lookups */
};
diff --git a/src/emu/emu.h b/src/emu/emu.h
index 222693d07fd..4f31420a6ee 100644
--- a/src/emu/emu.h
+++ b/src/emu/emu.h
@@ -3,11 +3,11 @@
emu.h
Core header file to be included by most files.
-
- NOTE: The contents of this file are designed to meet the needs of
+
+ NOTE: The contents of this file are designed to meet the needs of
drivers and devices. In addition to this file, you will also need
to include the headers of any CPUs or other devices that are required.
-
+
If you find yourself needing something outside of this file in a
driver or device, think carefully about what you are doing.
diff --git a/src/emu/emualloc.c b/src/emu/emualloc.c
index 206a8c3fd38..1d1d9caafac 100644
--- a/src/emu/emualloc.c
+++ b/src/emu/emualloc.c
@@ -86,7 +86,7 @@ public:
static bool lock_alloc; // set to true temporarily during lock allocation
static memory_entry *hash[hash_prime];// hash table based on pointer
static memory_entry *freehead; // pointer to the head of the free list
-
+
static memory_entry *allocate(size_t size, void *base, const char *file, int line);
static memory_entry *find(void *ptr);
static void release(memory_entry *entry);
@@ -133,7 +133,7 @@ void *malloc_file_line(size_t size, const char *file, int line)
void *result = osd_malloc(size);
if (result == NULL)
return NULL;
-
+
#ifdef MAME_DEBUG
// add a new entry
memory_entry::allocate(size, result, file, line);
@@ -156,7 +156,7 @@ void free_file_line(void *memory, const char *file, int line)
#ifdef MAME_DEBUG
// find the memory entry
memory_entry *entry = memory_entry::find(memory);
-
+
// warn about untracked frees
if (entry == NULL)
{
@@ -164,7 +164,7 @@ void free_file_line(void *memory, const char *file, int line)
osd_break_into_debugger("Error: attempt to free untracked memory");
return;
}
-
+
// free the entry and the memory
if (entry != NULL)
memory_entry::release(entry);
@@ -175,8 +175,8 @@ void free_file_line(void *memory, const char *file, int line)
/*-------------------------------------------------
- dump_unfreed_mem - called from the exit path
- of any code that wants to check for unfreed
+ dump_unfreed_mem - called from the exit path
+ of any code that wants to check for unfreed
memory
-------------------------------------------------*/
@@ -227,7 +227,7 @@ resource_pool::~resource_pool()
void resource_pool::add(resource_pool_item &item)
{
osd_lock_acquire(listlock);
-
+
// insert into hash table
int hashval = reinterpret_cast<FPTR>(item.ptr) % hash_prime;
item.next = hash[hashval];
@@ -244,7 +244,7 @@ void resource_pool::add(resource_pool_item &item)
/*-------------------------------------------------
- remove - remove a specific item from the
+ remove - remove a specific item from the
resource pool
-------------------------------------------------*/
@@ -253,7 +253,7 @@ void resource_pool::remove(void *ptr)
// ignore NULLs
if (ptr == NULL)
return;
-
+
// search for the item
osd_lock_acquire(listlock);
@@ -266,7 +266,7 @@ void resource_pool::remove(void *ptr)
// remove from hash table
resource_pool_item *deleteme = *scanptr;
*scanptr = deleteme->next;
-
+
// remove from ordered list
if (deleteme->ordered_prev != NULL)
deleteme->ordered_prev->ordered_next = deleteme->ordered_next;
@@ -274,7 +274,7 @@ void resource_pool::remove(void *ptr)
ordered_head = deleteme->ordered_next;
if (deleteme->ordered_next != NULL)
deleteme->ordered_next->ordered_prev = deleteme->ordered_prev;
-
+
// delete the object and break
delete deleteme;
break;
@@ -282,10 +282,10 @@ void resource_pool::remove(void *ptr)
osd_lock_release(listlock);
}
-
-
+
+
/*-------------------------------------------------
- find - find a specific item in the resource
+ find - find a specific item in the resource
pool
-------------------------------------------------*/
@@ -293,7 +293,7 @@ resource_pool_item *resource_pool::find(void *ptr)
{
// search for the item
osd_lock_acquire(listlock);
-
+
int hashval = reinterpret_cast<FPTR>(ptr) % hash_prime;
resource_pool_item *item;
for (item = hash[hashval]; item != NULL; item = item->next)
@@ -310,7 +310,7 @@ resource_pool_item *resource_pool::find(void *ptr)
contains - return true if given ptr is
contained by one of the objects in the pool
-------------------------------------------------*/
-
+
bool resource_pool::contains(void *_ptrstart, void *_ptrend)
{
UINT8 *ptrstart = reinterpret_cast<UINT8 *>(_ptrstart);
@@ -342,7 +342,7 @@ found:
void resource_pool::clear()
{
osd_lock_acquire(listlock);
-
+
// important: delete in reverse order of adding
while (ordered_head != NULL)
remove(ordered_head->ptr);
@@ -395,7 +395,7 @@ memory_entry *memory_entry::allocate(size_t size, void *base, const char *file,
{
acquire_lock();
- // if we're out of free entries, allocate a new chunk
+ // if we're out of free entries, allocate a new chunk
if (freehead == NULL)
{
// create a new chunk, and fail if we can't
@@ -413,18 +413,18 @@ memory_entry *memory_entry::allocate(size_t size, void *base, const char *file,
freehead = entry++;
}
}
-
+
// grab a free entry
memory_entry *entry = freehead;
freehead = entry->next;
- // populate it
+ // populate it
entry->size = size;
entry->base = base;
entry->file = file;
entry->line = line;
entry->id = curid++;
-
+
// add it to the alloc list
int hashval = reinterpret_cast<FPTR>(base) % hash_prime;
entry->next = hash[hashval];
@@ -432,7 +432,7 @@ memory_entry *memory_entry::allocate(size_t size, void *base, const char *file,
entry->next->prev = entry;
entry->prev = NULL;
hash[hashval] = entry;
-
+
release_lock();
return entry;
}
@@ -447,10 +447,10 @@ memory_entry *memory_entry::find(void *ptr)
// NULL maps to nothing
if (ptr == NULL)
return NULL;
-
+
// scan the list under the lock
acquire_lock();
-
+
int hashval = reinterpret_cast<FPTR>(ptr) % hash_prime;
memory_entry *entry;
for (entry = hash[hashval]; entry != NULL; entry = entry->next)
diff --git a/src/emu/emualloc.h b/src/emu/emualloc.h
index ebf6d44c190..4bb6ceadbae 100644
--- a/src/emu/emualloc.h
+++ b/src/emu/emualloc.h
@@ -60,7 +60,7 @@ class resource_pool_item
private:
resource_pool_item(const resource_pool_item &);
resource_pool_item &operator=(const resource_pool_item &);
-
+
public:
resource_pool_item(void *_ptr, size_t _size)
: next(NULL),
@@ -69,14 +69,14 @@ public:
ptr(_ptr),
size(_size) { }
virtual ~resource_pool_item() { }
-
+
resource_pool_item * next;
resource_pool_item * ordered_next;
resource_pool_item * ordered_prev;
void * ptr;
size_t size;
};
-
+
// a resource_pool_object is a simple object wrapper for the templatized type
template<class T> class resource_pool_object : public resource_pool_item
@@ -84,28 +84,28 @@ template<class T> class resource_pool_object : public resource_pool_item
private:
resource_pool_object<T>(const resource_pool_object<T> &);
resource_pool_object<T> &operator=(const resource_pool_object<T> &);
-
+
public:
- resource_pool_object(T *_object)
+ resource_pool_object(T *_object)
: resource_pool_item(reinterpret_cast<void *>(_object), sizeof(T)),
object(_object) { }
virtual ~resource_pool_object() { delete object; }
-
+
private:
T *object;
};
-// a resource_pool_array is a simple object wrapper for an allocated array of
+// a resource_pool_array is a simple object wrapper for an allocated array of
// the templatized type
template<class T> class resource_pool_array : public resource_pool_item
{
private:
resource_pool_array<T>(const resource_pool_array<T> &);
resource_pool_array<T> &operator=(const resource_pool_array<T> &);
-
+
public:
- resource_pool_array(T *_array, int _count)
+ resource_pool_array(T *_array, int _count)
: resource_pool_item(reinterpret_cast<void *>(_array), sizeof(T) * _count),
array(_array),
count(_count) { }
@@ -123,11 +123,11 @@ class resource_pool
private:
resource_pool(const resource_pool &);
resource_pool &operator=(const resource_pool &);
-
+
public:
resource_pool();
~resource_pool();
-
+
void add(resource_pool_item &item);
void remove(resource_pool_item &item) { remove(item.ptr); }
void remove(void *ptr);
@@ -135,13 +135,13 @@ public:
resource_pool_item *find(void *ptr);
bool contains(void *ptrstart, void *ptrend);
void clear();
-
+
template<class T> T *add_object(T* object) { add(*new(__FILE__, __LINE__) resource_pool_object<T>(object)); return object; }
template<class T> T *add_array(T* array, int count) { add(*new(__FILE__, __LINE__) resource_pool_array<T>(array, count)); return array; }
private:
static const int hash_prime = 193;
-
+
osd_lock * listlock;
resource_pool_item * hash[hash_prime];
resource_pool_item * ordered_head;
@@ -168,7 +168,7 @@ private:
#define pool_alloc(_pool, _type) (_pool).add_object(new(__FILE__, __LINE__) _type)
#define pool_alloc_clear(_pool, _type) (_pool).add_object(new(__FILE__, __LINE__, zeromem) _type)
#define pool_alloc_array(_pool, _type, _num) (_pool).add_array(new(__FILE__, __LINE__) _type[_num], (_num))
-#define pool_alloc_array_clear(_pool, _type, _num) (_pool).add_array(new(__FILE__, __LINE__, zeromem) _type[_num], (_num))
+#define pool_alloc_array_clear(_pool, _type, _num) (_pool).add_array(new(__FILE__, __LINE__, zeromem) _type[_num], (_num))
#define pool_free(_pool, v) (_pool).remove(v)
// global allocation helpers
diff --git a/src/emu/emucore.h b/src/emu/emucore.h
index 3de03bda6d6..8021be92498 100644
--- a/src/emu/emucore.h
+++ b/src/emu/emucore.h
@@ -280,21 +280,21 @@ public:
va_end(ap);
osd_break_into_debugger(text);
}
-
+
emu_fatalerror(const char *format, va_list ap)
: code(0)
{
vsprintf(text, format, ap);
osd_break_into_debugger(text);
}
-
+
emu_fatalerror(int _exitcode, const char *format, va_list ap)
: code(_exitcode)
{
vsprintf(text, format, ap);
osd_break_into_debugger(text);
}
-
+
const char *string() const { return text; }
int exitcode() const { return code; }
diff --git a/src/emu/machine/ldcore.c b/src/emu/machine/ldcore.c
index 34f29ef577b..cbd2c090210 100644
--- a/src/emu/machine/ldcore.c
+++ b/src/emu/machine/ldcore.c
@@ -1407,9 +1407,9 @@ static void init_video(const device_config *device)
fillbitmap_yuy16(frame->bitmap, 40, 109, 240);
/* make a copy of the bitmap that clips out the VBI and horizontal blanking areas */
- frame->visbitmap = auto_alloc(device->machine, bitmap_t(BITMAP_ADDR16(frame->bitmap, 44, frame->bitmap->width * 8 / 720),
- frame->bitmap->width - 2 * frame->bitmap->width * 8 / 720,
- frame->bitmap->height - 44,
+ frame->visbitmap = auto_alloc(device->machine, bitmap_t(BITMAP_ADDR16(frame->bitmap, 44, frame->bitmap->width * 8 / 720),
+ frame->bitmap->width - 2 * frame->bitmap->width * 8 / 720,
+ frame->bitmap->height - 44,
frame->bitmap->rowpixels, frame->bitmap->format));
}
diff --git a/src/emu/machine/pit8253.c b/src/emu/machine/pit8253.c
index 8214146986e..e06c72d3b3f 100644
--- a/src/emu/machine/pit8253.c
+++ b/src/emu/machine/pit8253.c
@@ -551,7 +551,7 @@ static void simulate2(const device_config *device, struct pit8253_timer *timer,
if (timer->gate == 0 && mode == 4)
{
- cycles_to_output = CYCLES_NEVER;
+ cycles_to_output = CYCLES_NEVER;
}
else
{
diff --git a/src/emu/mame.c b/src/emu/mame.c
index e4260cb05e7..f812d21cf62 100644
--- a/src/emu/mame.c
+++ b/src/emu/mame.c
@@ -825,7 +825,7 @@ void memory_region_free(running_machine *machine, const char *name)
/*-------------------------------------------------
- memory_region_info - return a pointer to the
+ memory_region_info - return a pointer to the
information struct for a given memory region
-------------------------------------------------*/
diff --git a/src/emu/mame.h b/src/emu/mame.h
index 238879e44cb..2d984d0e68d 100644
--- a/src/emu/mame.h
+++ b/src/emu/mame.h
@@ -159,13 +159,13 @@ typedef void (*output_callback_func)(void *param, const char *format, va_list ar
class region_info
{
DISABLE_COPYING(region_info);
-
+
running_machine * machine;
-
+
public:
region_info(running_machine *machine, const char *_name, UINT32 _length, UINT32 _flags);
~region_info();
-
+
operator void *() const { return (this != NULL) ? base.v : NULL; }
operator INT8 *() const { return (this != NULL) ? base.i8 : NULL; }
operator UINT8 *() const { return (this != NULL) ? base.u8 : NULL; }
@@ -175,9 +175,9 @@ public:
operator UINT32 *() const { return (this != NULL) ? base.u32 : NULL; }
operator INT64 *() const { return (this != NULL) ? base.i64 : NULL; }
operator UINT64 *() const { return (this != NULL) ? base.u64 : NULL; }
-
+
UINT32 bytes() const { return (this != NULL) ? length : 0; }
-
+
region_info * next;
astring name;
generic_ptr base;
@@ -214,7 +214,7 @@ class running_machine
public:
running_machine(const game_driver *driver);
~running_machine();
-
+
inline const device_config *device(const char *tag);
inline const input_port_config *port(const char *tag);
inline const region_info *region(const char *tag);
@@ -474,7 +474,7 @@ void mame_get_current_datetime(running_machine *machine, mame_system_time *systi
inline const device_config *running_machine::device(const char *tag)
{
- return device_list_find_by_tag(&config->devicelist, tag);
+ return device_list_find_by_tag(&config->devicelist, tag);
}
inline const input_port_config *running_machine::port(const char *tag)
diff --git a/src/emu/memory.c b/src/emu/memory.c
index feea469ef03..34a7a6b92f2 100644
--- a/src/emu/memory.c
+++ b/src/emu/memory.c
@@ -339,7 +339,7 @@ struct _memory_private
memory_block * memory_block_list; /* head of the list of memory blocks */
- tagmap_t<bank_info *> bankmap; /* map for fast bank lookups */
+ tagmap_t<bank_info *> bankmap; /* map for fast bank lookups */
bank_info * banklist; /* data gathered for each bank */
UINT8 banknext; /* next bank to allocate */
@@ -1204,8 +1204,8 @@ void memory_set_bankptr(running_machine *machine, const char *tag, void *base)
fatalerror("memory_set_bankptr called for unknown bank '%s'", tag);
if (base == NULL)
fatalerror("memory_set_bankptr called NULL base");
-// if (ALLOW_ONLY_AUTO_MALLOC_BANKS)
-// validate_auto_malloc_memory(base, bank->byteend - bank->bytestart + 1);
+// if (ALLOW_ONLY_AUTO_MALLOC_BANKS)
+// validate_auto_malloc_memory(base, bank->byteend - bank->bytestart + 1);
/* set the base */
memdata->bank_ptr[bank->index] = (UINT8 *)base;
diff --git a/src/emu/rendfont.c b/src/emu/rendfont.c
index c4b6719fa09..8affd635856 100644
--- a/src/emu/rendfont.c
+++ b/src/emu/rendfont.c
@@ -600,7 +600,7 @@ static int render_font_load_bdf(render_font *font)
mame_printf_warning("Loading BDF font... (%d characters loaded)\n", charcount);
}
}
-
+
/* make sure all the numbers are the same width */
if (font->chars[0] != NULL)
{
@@ -611,7 +611,7 @@ static int render_font_load_bdf(render_font *font)
for (int ch = '0'; ch <= '9'; ch++)
font->chars[0][ch].width = maxwidth;
}
-
+
return 0;
}
diff --git a/src/emu/sound/k053260.c b/src/emu/sound/k053260.c
index 5dc70ec7a39..0aab4de76f9 100644
--- a/src/emu/sound/k053260.c
+++ b/src/emu/sound/k053260.c
@@ -218,9 +218,9 @@ static DEVICE_START( k053260 )
ic->intf = (device->static_config != NULL) ? (const k053260_interface *)device->static_config : &defintrf;
ic->mode = 0;
-
+
const region_info *region = (ic->intf->rgnoverride != NULL) ? device->machine->region(ic->intf->rgnoverride) : device->region;
-
+
ic->rom = *region;
ic->rom_size = region->bytes();
diff --git a/src/emu/state.c b/src/emu/state.c
index cdcdd23add9..0be032b26c6 100644
--- a/src/emu/state.c
+++ b/src/emu/state.c
@@ -182,7 +182,7 @@ void state_init(running_machine *machine)
double test_double;
test_enum_type test_enum;
test_class_type test_class;
-
+
assert_always(IS_VALID_SAVE_TYPE(test_bool), "bool is not a valid type for save");
assert_always(IS_VALID_SAVE_TYPE(test_INT8), "INT8 is not a valid type for save");
assert_always(IS_VALID_SAVE_TYPE(test_UINT8), "UINT8 is not a valid type for save");
diff --git a/src/emu/validity.c b/src/emu/validity.c
index dfda9176cab..867f8b43a73 100644
--- a/src/emu/validity.c
+++ b/src/emu/validity.c
@@ -51,7 +51,7 @@ class region_entry
public:
region_entry()
: length(0) { }
-
+
astring tag;
UINT32 length;
};
diff --git a/src/lib/util/astring.h b/src/lib/util/astring.h
index 889360cae9f..68a7881edb4 100644
--- a/src/lib/util/astring.h
+++ b/src/lib/util/astring.h
@@ -299,7 +299,7 @@ class astring : public astring_base
{
private:
astring &init();
-
+
public:
astring() { init(); }
~astring();
@@ -315,11 +315,11 @@ public:
astring &operator=(const astring &string) { return cpy(string); }
astring &reset() { return cpy(""); }
-
+
operator const char *() const { return astring_c(this); }
const char *cstr() const { return astring_c(this); }
int len() const { return astring_len(this); }
-
+
astring &cpy(const astring &src) { return *astring_cpy(this, &src); }
astring &cpy(const char *src) { return *astring_cpyc(this, src); }
astring &cpy(const char *src, int count) { return *astring_cpych(this, src, count); }
diff --git a/src/lib/util/bitmap.c b/src/lib/util/bitmap.c
index 3f40e9f3a20..0f9eac3769e 100644
--- a/src/lib/util/bitmap.c
+++ b/src/lib/util/bitmap.c
@@ -308,8 +308,8 @@ void bitmap_free(bitmap_t *bitmap)
/*-------------------------------------------------
- bitmap_clone_existing -- clone an existing
- bitmap by copying its fields; the target
+ bitmap_clone_existing -- clone an existing
+ bitmap by copying its fields; the target
bitmap does not own the memory
-------------------------------------------------*/
@@ -318,7 +318,7 @@ void bitmap_clone_existing(bitmap_t *bitmap, const bitmap_t *srcbitmap)
if (bitmap->alloc != NULL)
free(bitmap->alloc);
bitmap->alloc = NULL;
-
+
bitmap->base = srcbitmap->base;
bitmap->rowpixels = srcbitmap->rowpixels;
bitmap->width = srcbitmap->width;
diff --git a/src/lib/util/tagmap.h b/src/lib/util/tagmap.h
index a841562caa7..b6e771f815c 100644
--- a/src/lib/util/tagmap.h
+++ b/src/lib/util/tagmap.h
@@ -130,17 +130,17 @@ template<class T> class tagmap_t : public tagmap
private:
tagmap_t(const tagmap &);
tagmap_t &operator=(const tagmap &);
-
+
public:
tagmap_t() { memset(table, 0, sizeof(table)); }
~tagmap_t() { reset(); }
-
+
void reset() { tagmap_reset(this); }
-
+
tagmap_error add(const char *tag, T object, bool replace_if_duplicate = false) { return tagmap_add(this, tag, (void *)object, replace_if_duplicate); }
tagmap_error add_unique_hash(const char *tag, T object, bool replace_if_duplicate = false) { return tagmap_add_unique_hash(this, tag, (void *)object, replace_if_duplicate); }
void remove(const char *tag) { tagmap_remove(this, tag); }
-
+
T find(const char *tag) const { return reinterpret_cast<T>(tagmap_find(this, tag)); }
T find(const char *tag, UINT32 hash) const { return reinterpret_cast<T>(tagmap_find_prehashed(this, tag, hash)); }
T find_hash_only(const char *tag) const { return reinterpret_cast<T>(tagmap_find_hash_only(this, tag)); }
diff --git a/src/mame/drivers/aliens.c b/src/mame/drivers/aliens.c
index 5d11170282d..6d112b27a8f 100644
--- a/src/mame/drivers/aliens.c
+++ b/src/mame/drivers/aliens.c
@@ -553,7 +553,7 @@ static KONAMI_SETLINES_CALLBACK( aliens_banking )
{
int bank = 4;
- if (lines & 0x10)
+ if (lines & 0x10)
bank -= 4;
bank += (lines & 0x0f);
diff --git a/src/mame/drivers/asterix.c b/src/mame/drivers/asterix.c
index 872f73ba82a..67f412f214d 100644
--- a/src/mame/drivers/asterix.c
+++ b/src/mame/drivers/asterix.c
@@ -60,7 +60,7 @@ static INTERRUPT_GEN( asterix_interrupt )
asterix_state *state = (asterix_state *)device->machine->driver_data;
// global interrupt masking
- if (!k056832_is_irq_enabled(state->k056832, 0))
+ if (!k056832_is_irq_enabled(state->k056832, 0))
return;
cpu_set_input_line(device, 5, HOLD_LINE); /* ??? All irqs have the same vector, and the mask used is 0 or 7 */
diff --git a/src/mame/drivers/blockhl.c b/src/mame/drivers/blockhl.c
index 253c9855661..b030ce74b4b 100644
--- a/src/mame/drivers/blockhl.c
+++ b/src/mame/drivers/blockhl.c
@@ -343,7 +343,7 @@ static KONAMI_SETLINES_CALLBACK( blockhl_banking )
/* other bits unknown */
- if ((lines & 0x84) != 0x80)
+ if ((lines & 0x84) != 0x80)
logerror("%04x: setlines %02x\n", cpu_get_pc(device), lines);
}
diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c
index 963e94106c2..32807e8f2d0 100644
--- a/src/mame/drivers/cave.c
+++ b/src/mame/drivers/cave.c
@@ -156,14 +156,14 @@ static READ16_HANDLER( cave_irq_cause_r )
cave_state *state = (cave_state *)space->machine->driver_data;
int result = 0x0003;
- if (state->vblank_irq)
+ if (state->vblank_irq)
result ^= 0x01;
- if (state->unknown_irq)
+ if (state->unknown_irq)
result ^= 0x02;
- if (offset == 4/2)
+ if (offset == 4/2)
state->vblank_irq = 0;
- if (offset == 6/2)
+ if (offset == 6/2)
state->unknown_irq = 0;
update_irq_state(space->machine);
@@ -917,7 +917,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( hotdogst_rombank_w )
{
- if (data & ~0x0f)
+ if (data & ~0x0f)
logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(space->cpu), data);
memory_set_bank(space->machine, "bank2", data & 0x0f);
@@ -955,7 +955,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( mazinger_rombank_w )
{
- if (data & ~0x07)
+ if (data & ~0x07)
logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(space->cpu), data);
memory_set_bank(space->machine, "bank2", data & 0x07);
@@ -986,7 +986,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( metmqstr_rombank_w )
{
- if (data & ~0x0f)
+ if (data & ~0x0f)
logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(space->cpu), data);
memory_set_bank(space->machine, "bank1", data & 0x0f);
@@ -1036,7 +1036,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( pwrinst2_rombank_w )
{
- if (data & ~0x07)
+ if (data & ~0x07)
logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(space->cpu), data);
memory_set_bank(space->machine, "bank1", data & 0x07);
@@ -1080,7 +1080,7 @@ static WRITE8_HANDLER( mirror_ram_w )
static WRITE8_HANDLER( sailormn_rombank_w )
{
- if (data & ~0x1f)
+ if (data & ~0x1f)
logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(space->cpu), data);
memory_set_bank(space->machine, "bank1", data & 0x1f);
diff --git a/src/mame/drivers/cb2001.c b/src/mame/drivers/cb2001.c
index 3bc27629705..9373e736c5f 100644
--- a/src/mame/drivers/cb2001.c
+++ b/src/mame/drivers/cb2001.c
@@ -126,7 +126,7 @@ e0033 45 01 mov al,1
e0035 49 d3 06 mov [6d3],al
0089 call 2a9d e0038 call e30a2
- 2a9d ld hl,d0b3 e30a2 premov bw,[04a6] (1e -> bb)
+ 2a9d ld hl,d0b3 e30a2 premov bw,[04a6] (1e -> bb)
2aa0 inc (hl) e30a5 inc b ptr[bw]
2aa1 inc hl e30a8 inc bw
2aa2 inc (hl) e30a9 inc b ptr[bw]
@@ -138,14 +138,14 @@ e0035 49 d3 06 mov [6d3],al
0c52 or a,a e003e and al,al
0c53 ret nz e0040 be e0083
0c54 ld hl,d461 .
-0c57 ld a,(d476) e0042 mov aw,[4b9] (68 -> a1)
+0c57 ld a,(d476) e0042 mov aw,[4b9] (68 -> a1)
0c5a or a e0045 and aw,aw
0c5b jr nz,0c6d e0047 be e0083
0c5d ld a,(hl) .
0c5e or a e0049 and al,al
0c5f jr nz,0c71 e004b be e0054
0c61 inc hl e004d dec al
-0c62 inc (hl) e004f mov [4b9],aw (4c -> a3)
+0c62 inc (hl) e004f mov [4b9],aw (4c -> a3)
0c63 ld a,(hl) .
. e0052 br e0083
. e0054 and ah,ah
diff --git a/src/mame/drivers/chqflag.c b/src/mame/drivers/chqflag.c
index d13bbfe8f2c..9ab366c06d2 100644
--- a/src/mame/drivers/chqflag.c
+++ b/src/mame/drivers/chqflag.c
@@ -3,7 +3,7 @@
Chequered Flag / Checkered Flag (GX717) (c) Konami 1988
Notes:
- - Position counter doesn't behave correctly because of the K051733
+ - Position counter doesn't behave correctly because of the K051733
protection.
- 007232 volume & panning control is almost certainly wrong.
diff --git a/src/mame/drivers/cybertnk.c b/src/mame/drivers/cybertnk.c
index 5234ee4ffed..6640738dd99 100644
--- a/src/mame/drivers/cybertnk.c
+++ b/src/mame/drivers/cybertnk.c
@@ -535,7 +535,7 @@ static WRITE16_HANDLER( io_w )
// This seems to only be written after each irq1 and irq2, irq ack?
//logerror("irq wrote %04x\n", data);
//else
- // LOG_UNKNOWN_WRITE
+ // LOG_UNKNOWN_WRITE
break;
case 0xd4/2:
diff --git a/src/mame/drivers/deco_ld.c b/src/mame/drivers/deco_ld.c
index 5472bff29f7..917af01d617 100644
--- a/src/mame/drivers/deco_ld.c
+++ b/src/mame/drivers/deco_ld.c
@@ -171,7 +171,7 @@ static ADDRESS_MAP_START( begas_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x1002, 0x1002) AM_READ(test_r)
AM_RANGE(0x1003, 0x1003) AM_READ(test_r)
AM_RANGE(0x1001, 0x1001) AM_WRITENOP //???
-// AM_RANGE(0x1003, 0x1003) AM_READ_PORT("IN0")
+// AM_RANGE(0x1003, 0x1003) AM_READ_PORT("IN0")
AM_RANGE(0x1003, 0x1003) AM_WRITE(rblaster_vram_bank_w) //might be 1001
AM_RANGE(0x1006, 0x1006) AM_NOP //ld status / command
AM_RANGE(0x1007, 0x1007) AM_READWRITE(laserdisc_r,laserdisc_w) // ld data
diff --git a/src/mame/drivers/dwarfd.c b/src/mame/drivers/dwarfd.c
index c9a055682c2..ce34206e6e8 100644
--- a/src/mame/drivers/dwarfd.c
+++ b/src/mame/drivers/dwarfd.c
@@ -154,16 +154,16 @@ Dumped by Grull Osgo
Location Device File ID Checksum
----------------------------------------
-CPU 10A 27C128 a1.bin 9f26 [ CPU ROM ]
+CPU 10A 27C128 a1.bin 9f26 [ CPU ROM ]
-CPU 6H 27C128 a2.bin 7ccc [ Character ]
-CPU 6K 27C128 a3.bin ba34 [ Character ]
+CPU 6H 27C128 a2.bin 7ccc [ Character ]
+CPU 6K 27C128 a3.bin ba34 [ Character ]
LDP O7 27c128 a4.bin 2120 [ LDP Ctrl ] (Add-On Board "7-50A" on O7-O9-010 IC Sockets)
-Notes: CPU - Main Board includes NTSC decoder, video Switch & Audio control.
- No Model or Serial number on PCB.
+Notes: CPU - Main Board includes NTSC decoder, video Switch & Audio control.
+ No Model or Serial number on PCB.
Uses a Pioneer LD-V2000 Laserdisc player.
The laserdisc player is modified - has a custom communication & audio cable (10 Wires Flat Cable).
@@ -191,18 +191,18 @@ Disk 1
------
Sticker:
- 09-251 A
+ 09-251 A
- HORSE RACE I
+ HORSE RACE I
- QUARTER HORSE
+ QUARTER HORSE
- (C) 1981 DALE FRANK RODESCH
- SAN DIEGO, CA USA
+ (C) 1981 DALE FRANK RODESCH
+ SAN DIEGO, CA USA
Stamp on disk:
- 09-251A1-15
+ 09-251A1-15
@@ -211,37 +211,37 @@ Disk 2
Sticker:
- 09251 1
+ 09251 1
- QUARTER HORSE
+ QUARTER HORSE
- VIDEO DISK
+ VIDEO DISK
- (C) 1981 DALE FRANK RODESCH
+ (C) 1981 DALE FRANK RODESCH
Stamp on disk:
- 09-251A1-01
+ 09-251A1-01
- 09-251 A
+ 09-251 A
Disk 1
------
Sticker:
- 09-251 A
+ 09-251 A
- HORSE RACE I
+ HORSE RACE I
- QUARTER HORSE
+ QUARTER HORSE
- (C) 1981 DALE FRANK RODESCH
+ (C) 1981 DALE FRANK RODESCH
Stamp on disk:
- 09-251A1-06
+ 09-251A1-06
@@ -1061,7 +1061,7 @@ ROM_START( quarterhb )
/* ??? colors */
ROM_LOAD( "3a_50-1381_63s080n.bin",0x00, 0x20, CRC(451d0a72) SHA1(9ff6e2c5bd2b57bd607cb33e60e7ed25bea164b3) )
/* memory map */
-// ROM_LOAD( "7h_7602.bin",0x20, 0x20, BAD_DUMP CRC(451d0a72) SHA1(9ff6e2c5bd2b57bd607cb33e60e7ed25bea164b3) )
+// ROM_LOAD( "7h_7602.bin",0x20, 0x20, BAD_DUMP CRC(451d0a72) SHA1(9ff6e2c5bd2b57bd607cb33e60e7ed25bea164b3) )
ROM_LOAD( "7h_bprom.bin",0x20, 0x20, BAD_DUMP CRC(c9618de2) SHA1(d5636546dbc57e6aab01dab79b2ead1dfef8fa5c) ) //taken from the other set, might be bad
DISK_REGION( "laserdisc" )
diff --git a/src/mame/drivers/gbusters.c b/src/mame/drivers/gbusters.c
index 1989018eba0..e8206833657 100644
--- a/src/mame/drivers/gbusters.c
+++ b/src/mame/drivers/gbusters.c
@@ -301,7 +301,7 @@ static MACHINE_RESET( gbusters )
konami_configure_set_lines(devtag_get_device(machine, "maincpu"), gbusters_banking);
/* mirror address for banked ROM */
- memcpy(&RAM[0x18000], &RAM[0x10000], 0x08000);
+ memcpy(&RAM[0x18000], &RAM[0x10000], 0x08000);
state->palette_selected = 0;
state->priority = 0;
diff --git a/src/mame/drivers/gunpey.c b/src/mame/drivers/gunpey.c
index c3c08641918..5fca3b1c447 100644
--- a/src/mame/drivers/gunpey.c
+++ b/src/mame/drivers/gunpey.c
@@ -168,15 +168,15 @@ static WRITE8_HANDLER( gunpey_blitter_w )
static ADDRESS_MAP_START( mem_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x00000, 0x0ffff) AM_RAM
-// AM_RANGE(0x50000, 0x500ff) AM_RAM
-// AM_RANGE(0x50100, 0x502ff) AM_NOP
+// AM_RANGE(0x50000, 0x500ff) AM_RAM
+// AM_RANGE(0x50100, 0x502ff) AM_NOP
AM_RANGE(0x80000, 0xfffff) AM_ROM
ADDRESS_MAP_END
static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 16 )
AM_RANGE(0x7f40, 0x7f45) AM_READ8(gunpey_inputs_r,0xffff)
-// AM_RANGE(0x7f48, 0x7f48) AM_WRITE(output_w)
+// AM_RANGE(0x7f48, 0x7f48) AM_WRITE(output_w)
AM_RANGE(0x7f80, 0x7f81) AM_DEVREADWRITE8("ymz", ymz280b_r, ymz280b_w, 0xffff)
AM_RANGE(0x7f88, 0x7f89) AM_DEVREADWRITE8("oki", okim6295_r, okim6295_w, 0xff00)
diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c
index c5ad68ee02d..b8f8d0c0cc9 100644
--- a/src/mame/drivers/hng64.c
+++ b/src/mame/drivers/hng64.c
@@ -2361,5 +2361,5 @@ GAME( 1998, xrally, hng64, hng64, hng64, hng64_race, ROT0, "SNK", "Xtreme R
GAME( 1998, bbust2, hng64, hng64, bbust2, hng64_shoot, ROT0, "SNK", "Beast Busters 2nd Nightmare", GAME_NOT_WORKING|GAME_NO_SOUND ) /* 004 */
GAME( 1998, sams64_2, hng64, hng64, hng64, ss64, ROT0, "SNK", "Samurai Shodown: Warrior's Rage / Samurai Spirits 2: Asura Zanmaden", GAME_NOT_WORKING|GAME_NO_SOUND ) /* 005 */
GAME( 1998, fatfurwa, hng64, hng64, hng64, fatfurwa, ROT0, "SNK", "Fatal Fury: Wild Ambition (rev.A)", GAME_NOT_WORKING|GAME_NO_SOUND ) /* 006 */
-GAME( 1999, buriki, hng64, hng64, hng64, fatfurwa, ROT0, "SNK", "Buriki One (rev.B)", GAME_NOT_WORKING|GAME_NO_SOUND ) /* 007 */
+GAME( 1999, buriki, hng64, hng64, hng64, fatfurwa, ROT0, "SNK", "Buriki One (rev.B)", GAME_NOT_WORKING|GAME_NO_SOUND ) /* 007 */
diff --git a/src/mame/drivers/metalmx.c b/src/mame/drivers/metalmx.c
index 3e336123263..2cb652339e7 100644
--- a/src/mame/drivers/metalmx.c
+++ b/src/mame/drivers/metalmx.c
@@ -287,7 +287,7 @@ static VIDEO_UPDATE( metalmx )
/* TODO: TMS34020 should take care of this */
metalmx_state *state = (metalmx_state *)screen->machine->driver_data;
-// UINT32 *src_base = &gsp_vram[(vreg_base[0x40/4] & 0x40) ? 0x20000 : 0];
+// UINT32 *src_base = &gsp_vram[(vreg_base[0x40/4] & 0x40) ? 0x20000 : 0];
UINT16 *src_base = state->gsp_vram;
int y;
diff --git a/src/mame/drivers/monzagp.c b/src/mame/drivers/monzagp.c
index afa6a6e9b47..60be4261cc6 100644
--- a/src/mame/drivers/monzagp.c
+++ b/src/mame/drivers/monzagp.c
@@ -86,9 +86,9 @@ static VIDEO_UPDATE(monzagp)
for(y=0;y<256;y++)
{
for(x=0;x<256;x++)
- {
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[bank&1],
- vram[y*screenw+x],
+ {
+ drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[bank&1],
+ vram[y*screenw+x],
//(vram[y*screenw+x]&0x3f)+(bank>>1)*64,
0,
0, 0,
@@ -116,8 +116,8 @@ static WRITE8_HANDLER(port_w)
//vram[coordy*screenw+coordx]=data;
//if(output==0xfe)
{
- // if(data>='A' && data <='Z')
- // printf("%.2x %.2x %c %c\n",coordy, offset,data, znaki[data-'A']);
+ // if(data>='A' && data <='Z')
+ // printf("%.2x %.2x %c %c\n",coordy, offset,data, znaki[data-'A']);
//vram[coordy*screenw+coordx]=data;
vram[(coordx*256+coordy)&0x7ff]=data;
}
@@ -187,16 +187,16 @@ static WRITE8_HANDLER(port3_w)
/*
-#define I8039_p0 0x100
-#define I8039_p1 0x101
-#define I8039_p2 0x102
-#define I8039_p4 0x104
-#define I8039_p5 0x105
-#define I8039_p6 0x106
-#define I8039_p7 0x107
-#define I8039_t0 0x110
-#define I8039_t1 0x111
-#define I8039_bus 0x120
+#define I8039_p0 0x100
+#define I8039_p1 0x101
+#define I8039_p2 0x102
+#define I8039_p4 0x104
+#define I8039_p5 0x105
+#define I8039_p6 0x106
+#define I8039_p7 0x107
+#define I8039_t0 0x110
+#define I8039_t1 0x111
+#define I8039_bus 0x120
*/
static ADDRESS_MAP_START( monzagp_io, ADDRESS_SPACE_IO, 8 )
@@ -276,11 +276,11 @@ ROM_START( monzagp )
ROM_LOAD( "8.1f", 0x1400, 0x0400, CRC(99ce2753) SHA1(f4540700ea909ba1be34ac2c33dafd8ec67a2bb7) )
ROM_REGION( 0x10000, "unk1", 0 )
- ROM_LOAD( "1.9c", 0x0000, 0x0400, CRC(005d5fed) SHA1(145a860751ef7d99129b7242aacac7a4e1e14a51) )
- ROM_LOAD( "2", 0x0400, 0x0400, NO_DUMP )
- ROM_LOAD( "3.12f", 0x0800, 0x0400, CRC(e5591074) SHA1(ac756ee605d932d7c1c3eddbe2b9c6f78dad6ce8) )
- ROM_LOAD( "4.10f", 0x0c00, 0x0400, CRC(a426a371) SHA1(d6023bebf6924d1820e631ee53896100e5b256a5) )
- ROM_LOAD( "5.9f", 0x1000, 0x0400, CRC(5abd1ef6) SHA1(1bc79225c1be2821930fdb8e821a70c7ac8683ab) )
+ ROM_LOAD( "1.9c", 0x0000, 0x0400, CRC(005d5fed) SHA1(145a860751ef7d99129b7242aacac7a4e1e14a51) )
+ ROM_LOAD( "2", 0x0400, 0x0400, NO_DUMP )
+ ROM_LOAD( "3.12f", 0x0800, 0x0400, CRC(e5591074) SHA1(ac756ee605d932d7c1c3eddbe2b9c6f78dad6ce8) )
+ ROM_LOAD( "4.10f", 0x0c00, 0x0400, CRC(a426a371) SHA1(d6023bebf6924d1820e631ee53896100e5b256a5) )
+ ROM_LOAD( "5.9f", 0x1000, 0x0400, CRC(5abd1ef6) SHA1(1bc79225c1be2821930fdb8e821a70c7ac8683ab) )
ROM_REGION( 0x0700, "proms", 0 )
ROM_LOAD( "63s140.1", 0x0000, 0x0100, CRC(5123c83e) SHA1(d8ff06af421d3dae65bc9b0a081ed56249ef61ab) )
diff --git a/src/mame/drivers/moo.c b/src/mame/drivers/moo.c
index a0e38054870..9368ccdb338 100644
--- a/src/mame/drivers/moo.c
+++ b/src/mame/drivers/moo.c
@@ -156,7 +156,7 @@ static INTERRUPT_GEN( moobl_interrupt )
static WRITE16_HANDLER( sound_cmd1_w )
{
- if ((data & 0x00ff0000) == 0)
+ if ((data & 0x00ff0000) == 0)
{
data &= 0xff;
soundlatch_w(space, 0, data);
@@ -165,7 +165,7 @@ static WRITE16_HANDLER( sound_cmd1_w )
static WRITE16_HANDLER( sound_cmd2_w )
{
- if ((data & 0x00ff0000) == 0)
+ if ((data & 0x00ff0000) == 0)
soundlatch2_w(space, 0, data & 0xff);
}
diff --git a/src/mame/drivers/multigam.c b/src/mame/drivers/multigam.c
index abf2acd8708..bd46404d0c4 100644
--- a/src/mame/drivers/multigam.c
+++ b/src/mame/drivers/multigam.c
@@ -38,7 +38,7 @@
Multi Game 2 & III: 21 games included, hardware features MMC3 NES mapper and additional
RAM used by Super Mario Bros 3.
- Multi Game (Tung Sheng Electronics): 10 games included, selectable by dip switches.
+ Multi Game (Tung Sheng Electronics): 10 games included, selectable by dip switches.
*/
#include "emu.h"
diff --git a/src/mame/drivers/ninjaw.c b/src/mame/drivers/ninjaw.c
index 988db810e56..a7910d59d22 100644
--- a/src/mame/drivers/ninjaw.c
+++ b/src/mame/drivers/ninjaw.c
@@ -386,7 +386,7 @@ static READ16_HANDLER( ninjaw_sound_r )
if (offset == 1)
return ((tc0140syt_comm_r(state->tc0140syt, 0) & 0xff));
- else
+ else
return 0;
}
diff --git a/src/mame/drivers/othunder.c b/src/mame/drivers/othunder.c
index c9073e513ef..a6efe65a295 100644
--- a/src/mame/drivers/othunder.c
+++ b/src/mame/drivers/othunder.c
@@ -418,7 +418,7 @@ static READ16_HANDLER( othunder_sound_r )
othunder_state *state = (othunder_state *)space->machine->driver_data;
if (offset == 1)
return ((tc0140syt_comm_r(state->tc0140syt, 0) & 0xff));
- else
+ else
return 0;
}
diff --git a/src/mame/drivers/parodius.c b/src/mame/drivers/parodius.c
index 90e79124dc2..7917afb23be 100644
--- a/src/mame/drivers/parodius.c
+++ b/src/mame/drivers/parodius.c
@@ -80,7 +80,7 @@ static WRITE8_HANDLER( parodius_videobank_w )
{
parodius_state *state = (parodius_state *)space->machine->driver_data;
- if (state->videobank & 0xf8)
+ if (state->videobank & 0xf8)
logerror("%04x: videobank = %02x\n",cpu_get_pc(space->cpu),data);
/* bit 0 = select palette or work RAM at 0000-07ff */
@@ -93,7 +93,7 @@ static WRITE8_HANDLER( parodius_3fc0_w )
{
parodius_state *state = (parodius_state *)space->machine->driver_data;
- if ((data & 0xf4) != 0x10)
+ if ((data & 0xf4) != 0x10)
logerror("%04x: 3fc0 = %02x\n",cpu_get_pc(space->cpu),data);
/* bit 0/1 = coin counters */
@@ -399,7 +399,7 @@ ROM_END
static KONAMI_SETLINES_CALLBACK( parodius_banking )
{
- if (lines & 0xf0)
+ if (lines & 0xf0)
logerror("%04x: setlines %02x\n", cpu_get_pc(device), lines);
memory_set_bank(device->machine, "bank1", (lines & 0x0f) ^ 0x0f);
diff --git a/src/mame/drivers/psikyosh.c b/src/mame/drivers/psikyosh.c
index bb2a74dc315..43e98e57c8a 100644
--- a/src/mame/drivers/psikyosh.c
+++ b/src/mame/drivers/psikyosh.c
@@ -454,16 +454,16 @@ P1KEY11 29|30 P2KEY11
GND 53|54 GND
GND 55|56 GND
*/
-
+
UINT32 controls = input_port_read(space->machine, "CONTROLLER");
UINT32 value = input_port_read(space->machine, "INPUTS");
-
+
if(controls) {
// Clearly has ghosting, game will only recognise one key depressed at once, and keyboard can only represent keys with distinct rows and columns
- // Since the game can't accept conflicting inputs e.g. PL1 Up and 'A' or 'B' we have to
+ // Since the game can't accept conflicting inputs e.g. PL1 Up and 'A' or 'B' we have to
// make the user choose the input method. Especially since in test mode both sets are usable.
// Switch top word to either Mahjong inputs or joystick depending
-
+
enum {
KEY1 = 0x0400, // JAMMA P2 Button 1
KEY2 = 0x0040, // JAMMA P2 Down
@@ -471,13 +471,13 @@ P1KEY11 29|30 P2KEY11
KEY4 = 0x8000, // JAMMA P1 Up
KEY5 = 0x4000, // JAMMA P1 Down
KEY6 = 0x0010, // JAMMA P2 Left
-// KEY7
+// KEY7
KEY8 = 0x1000, // JAMMA P1 Left
KEY9 = 0x2000, // JAMMA P1 Right
KEY10 = 0x0020, // JAMMA P2 Right
KEY11 = 0x0800, // JAMMA P1 Button 1
}; // Mahjong->JAMMA mapping specific to this game pcb
-
+
UINT16 key_codes[] = { // treated as IP_ACTIVE_LOW, game inverts them upon reading
// ROW (distinct pins for P1 or P2) | COLUMN (shared for P1+P2)
KEY4 | KEY3, // A
@@ -506,9 +506,9 @@ P1KEY11 29|30 P2KEY11
int count = 0;
// HACK: read IPT_START1 from "INPUTS" to avoid listing it twice or having two independent STARTs listed
- int start_depressed = ~value & 0x01000000;
+ int start_depressed = ~value & 0x01000000;
keys |= start_depressed ? 1 << (sizeof(key_codes)/sizeof(key_codes[0]) - 1) : 0; // and bung it in at the end
-
+
value |= 0xFFFF0000; // set top word
do {
// since we can't handle multiple keys, just return the first one depressed
@@ -753,7 +753,7 @@ static INPUT_PORTS_START( mjgtaste )
PORT_CONFNAME( 0x00000001, 0x00000001, DEF_STR ( Controller ) )
PORT_CONFSETTING( 0x00000000, DEF_STR( Joystick ) )
PORT_CONFSETTING( 0x00000001, "Mahjong Panel" )
-
+
PORT_START("MAHJONG") /* articifial enumeration for mahjong encoder */
PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_MAHJONG_A ) PORT_PLAYER(1)
PORT_BIT( 0x00000002, IP_ACTIVE_HIGH, IPT_MAHJONG_B ) PORT_PLAYER(1)
@@ -774,8 +774,8 @@ static INPUT_PORTS_START( mjgtaste )
PORT_BIT( 0x00010000, IP_ACTIVE_HIGH, IPT_MAHJONG_CHI ) PORT_PLAYER(1)
PORT_BIT( 0x00020000, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH ) PORT_PLAYER(1)
PORT_BIT( 0x00040000, IP_ACTIVE_HIGH, IPT_MAHJONG_RON ) PORT_PLAYER(1)
-// PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_START1 ) /* start on panel, hacked in from the regular one to avoid duplicates in the UI */
-
+// PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_START1 ) /* start on panel, hacked in from the regular one to avoid duplicates in the UI */
+
PORT_START("JP4") /* jumper pads on the PCB */
// PORT_DIPNAME( 0x03000000, 0x01000000, DEF_STR( Region ) )
// PORT_DIPSETTING( 0x00000000, DEF_STR( Japan ) )
diff --git a/src/mame/drivers/rungun.c b/src/mame/drivers/rungun.c
index 1edd46a5453..a7b6bc5c89f 100644
--- a/src/mame/drivers/rungun.c
+++ b/src/mame/drivers/rungun.c
@@ -230,7 +230,7 @@ static INTERRUPT_GEN(audio_interrupt)
{
rungun_state *state = (rungun_state *)device->machine->driver_data;
- if (state->z80_control & 0x80)
+ if (state->z80_control & 0x80)
return;
cpu_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c
index 51accb77565..a630c294a9a 100644
--- a/src/mame/drivers/seta.c
+++ b/src/mame/drivers/seta.c
@@ -6702,9 +6702,9 @@ static const gfx_layout superbar_layout =
{ 0,1,2,3,4,5,6,7,
64,65,66,67,68,69,70,71 },
{ 0*8, 2*8, 16*8, 18*8,
- 1*8, 3*8, 17*8, 19*8,
- 4*8, 6*8, 20*8, 22*8,
- 5*8, 7*8, 21*8, 23*8 },
+ 1*8, 3*8, 17*8, 19*8,
+ 4*8, 6*8, 20*8, 22*8,
+ 5*8, 7*8, 21*8, 23*8 },
16*16
};
diff --git a/src/mame/drivers/slapshot.c b/src/mame/drivers/slapshot.c
index 4a6faef3ba4..d08f625e90d 100644
--- a/src/mame/drivers/slapshot.c
+++ b/src/mame/drivers/slapshot.c
@@ -256,7 +256,7 @@ static READ16_HANDLER( slapshot_msb_sound_r )
slapshot_state *state = (slapshot_state *)space->machine->driver_data;
if (offset == 1)
return ((tc0140syt_comm_r(state->tc0140syt, 0) & 0xff) << 8);
- else
+ else
return 0;
}
diff --git a/src/mame/drivers/sms.c b/src/mame/drivers/sms.c
index 01b03437f94..f545ef1c813 100644
--- a/src/mame/drivers/sms.c
+++ b/src/mame/drivers/sms.c
@@ -859,40 +859,40 @@ ROM_START( sureshot )
ROM_END
/*
-Etched in copper on back COPYRIGHT SMS 1983
- mfg corp
- S/N A-872 A-872 was etched
- MADE IN USA
-
-Etched in copper on front REV 03
-
-Silkscreened on top P/N 1001
-
-
-.16 2764 handwritten sticker U16
-.17 2764 handwritten sticker U17
-.18 2764 handwritten sticker U18
-.19 2764 handwritten sticker U19
-.26 2732 handwritten sticker #26
-.32 pal10l8 green dot sticker with 32 written on it
-.52 pal10l8 blue dot sticker with 52 written on it
-.58 pal10l8 3 blue dot stickers with 58 written on one
-.40 pal10l8 red dot sticker with 40 written on it
-.39 pal10l8 3 green dot stickers with 39 written on one
-.38 pal10l8 3 blue dot stickers with 38 written on one
-.80 pal10l8 2 blue dot stickers with 80 written on one
-.94 pal14h4 2 green dot stickers with 94 written on one - was getting different values for each read
-.109 pal14h4 2 brown dot stickers with 109 written on one
-.110 pal10l8 2 red dot stickers with 110 written on one
-.128 pal10h8 1 blue, 1 brown, and another blue dot sticker with 128 written on the first blue one
-.129 pal10h8 1 green and 1 red dot sticker
-.130 pal10h8 3 red dot stickers with 130 written on one
-.140 pal14h4 1 brown sticker with 140 written on it
-.141 pal14h4 1 brown sticker with 141 written on it
-.142 pal14h4 1 brown sticker with 142 written on it
-.143 pal14h4 1 brown sticker with 143 written on it
-.144 pal14h4 1 brown sticker with 144 written on it
-.145 pal14h4 1 brown sticker with 145 written on it
+Etched in copper on back COPYRIGHT SMS 1983
+ mfg corp
+ S/N A-872 A-872 was etched
+ MADE IN USA
+
+Etched in copper on front REV 03
+
+Silkscreened on top P/N 1001
+
+
+.16 2764 handwritten sticker U16
+.17 2764 handwritten sticker U17
+.18 2764 handwritten sticker U18
+.19 2764 handwritten sticker U19
+.26 2732 handwritten sticker #26
+.32 pal10l8 green dot sticker with 32 written on it
+.52 pal10l8 blue dot sticker with 52 written on it
+.58 pal10l8 3 blue dot stickers with 58 written on one
+.40 pal10l8 red dot sticker with 40 written on it
+.39 pal10l8 3 green dot stickers with 39 written on one
+.38 pal10l8 3 blue dot stickers with 38 written on one
+.80 pal10l8 2 blue dot stickers with 80 written on one
+.94 pal14h4 2 green dot stickers with 94 written on one - was getting different values for each read
+.109 pal14h4 2 brown dot stickers with 109 written on one
+.110 pal10l8 2 red dot stickers with 110 written on one
+.128 pal10h8 1 blue, 1 brown, and another blue dot sticker with 128 written on the first blue one
+.129 pal10h8 1 green and 1 red dot sticker
+.130 pal10h8 3 red dot stickers with 130 written on one
+.140 pal14h4 1 brown sticker with 140 written on it
+.141 pal14h4 1 brown sticker with 141 written on it
+.142 pal14h4 1 brown sticker with 142 written on it
+.143 pal14h4 1 brown sticker with 143 written on it
+.144 pal14h4 1 brown sticker with 144 written on it
+.145 pal14h4 1 brown sticker with 145 written on it
*/
ROM_START( secondch )
diff --git a/src/mame/drivers/spy.c b/src/mame/drivers/spy.c
index d2f84000fb0..8680f858c2b 100644
--- a/src/mame/drivers/spy.c
+++ b/src/mame/drivers/spy.c
@@ -204,7 +204,7 @@ static void spy_collision( running_machine *machine )
The mad scientist's laser truck has both a high sprite center and a small height value.
It has to be measured from the ground to detect correctly.
*/
- if (w2 == 0x58 && d2 == 0x04 && h2 == 0x10 && y2 == 0x30)
+ if (w2 == 0x58 && d2 == 0x04 && h2 == 0x10 && y2 == 0x30)
h2 = y2;
// what other sprites fall into:
@@ -229,9 +229,9 @@ static void spy_collision( running_machine *machine )
nearplane = (state->pmcram[2] << 8) + state->pmcram[3];
// fail safe
- if (loopend > MAX_SPRITES)
+ if (loopend > MAX_SPRITES)
loopend = MAX_SPRITES;
- if (!nearplane)
+ if (!nearplane)
nearplane = DEF_NEAR_PLANE;
loopend = (loopend << 1) + 4;
diff --git a/src/mame/drivers/ssingles.c b/src/mame/drivers/ssingles.c
index 555319a363f..5f530ef164b 100644
--- a/src/mame/drivers/ssingles.c
+++ b/src/mame/drivers/ssingles.c
@@ -299,7 +299,7 @@ static ADDRESS_MAP_START( atamanot_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0800, 0x08ff) AM_WRITE(ssingles_colorram_w)
AM_RANGE(0x0000, 0x1fff) AM_ROM
AM_RANGE(0x4000, 0x47ff) AM_RAM
-// AM_RANGE(0x6000, 0x60ff) AM_RAM //kanji tilemap?
+// AM_RANGE(0x6000, 0x60ff) AM_RAM //kanji tilemap?
AM_RANGE(0x6000, 0x7fff) AM_ROM AM_REGION("question",0)
AM_RANGE(0x8000, 0x9fff) AM_ROM
AM_RANGE(0xc000, 0xc000) AM_READ( c000_r )
@@ -451,33 +451,33 @@ atamanot kanji gfx decoding:
static const gfx_layout layout_16x16 =
{
- 16,16,
- RGN_FRAC(1,4),
- 1,
- { 0 },
- { 0, 1, 2, 3, 4, 5, 6, 7,
- RGN_FRAC(1,4)+0, RGN_FRAC(1,4)+1, RGN_FRAC(1,4)+2, RGN_FRAC(1,4)+3, RGN_FRAC(1,4)+4, RGN_FRAC(1,4)+5, RGN_FRAC(1,4)+6, RGN_FRAC(1,4)+7 },
- { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
- RGN_FRAC(2,4)+0*8, RGN_FRAC(2,4)+1*8, RGN_FRAC(2,4)+2*8, RGN_FRAC(2,4)+3*8, RGN_FRAC(2,4)+4*8, RGN_FRAC(2,4)+5*8, RGN_FRAC(2,4)+6*8, RGN_FRAC(2,4)+7*8 },
- 8*8
+ 16,16,
+ RGN_FRAC(1,4),
+ 1,
+ { 0 },
+ { 0, 1, 2, 3, 4, 5, 6, 7,
+ RGN_FRAC(1,4)+0, RGN_FRAC(1,4)+1, RGN_FRAC(1,4)+2, RGN_FRAC(1,4)+3, RGN_FRAC(1,4)+4, RGN_FRAC(1,4)+5, RGN_FRAC(1,4)+6, RGN_FRAC(1,4)+7 },
+ { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
+ RGN_FRAC(2,4)+0*8, RGN_FRAC(2,4)+1*8, RGN_FRAC(2,4)+2*8, RGN_FRAC(2,4)+3*8, RGN_FRAC(2,4)+4*8, RGN_FRAC(2,4)+5*8, RGN_FRAC(2,4)+6*8, RGN_FRAC(2,4)+7*8 },
+ 8*8
};
static const gfx_layout layout_8x16 =
{
- 8,16,
- RGN_FRAC(1,2),
- 1,
- { 0 },
- { 0, 1, 2, 3, 4, 5, 6, 7 },
- { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
- RGN_FRAC(2,4)+0*8, RGN_FRAC(2,4)+1*8, RGN_FRAC(2,4)+2*8, RGN_FRAC(2,4)+3*8, RGN_FRAC(2,4)+4*8, RGN_FRAC(2,4)+5*8, RGN_FRAC(2,4)+6*8, RGN_FRAC(2,4)+7*8 },
- 8*8
+ 8,16,
+ RGN_FRAC(1,2),
+ 1,
+ { 0 },
+ { 0, 1, 2, 3, 4, 5, 6, 7 },
+ { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
+ RGN_FRAC(2,4)+0*8, RGN_FRAC(2,4)+1*8, RGN_FRAC(2,4)+2*8, RGN_FRAC(2,4)+3*8, RGN_FRAC(2,4)+4*8, RGN_FRAC(2,4)+5*8, RGN_FRAC(2,4)+6*8, RGN_FRAC(2,4)+7*8 },
+ 8*8
};
- GFXDECODE_ENTRY( "kanji", 0, layout_16x16, 0, 8 )
- GFXDECODE_ENTRY( "kanji_uc", 0, layout_8x16, 0, 8 )
- GFXDECODE_ENTRY( "kanji_lc", 0, layout_8x16, 0, 8 )
+ GFXDECODE_ENTRY( "kanji", 0, layout_16x16, 0, 8 )
+ GFXDECODE_ENTRY( "kanji_uc", 0, layout_8x16, 0, 8 )
+ GFXDECODE_ENTRY( "kanji_lc", 0, layout_8x16, 0, 8 )
It looks "stolen" from an unknown Japanese computer?
*/
diff --git a/src/mame/drivers/surpratk.c b/src/mame/drivers/surpratk.c
index 8377ddc2020..ed0ba833344 100644
--- a/src/mame/drivers/surpratk.c
+++ b/src/mame/drivers/surpratk.c
@@ -74,7 +74,7 @@ static WRITE8_HANDLER( surpratk_5fc0_w )
{
surpratk_state *state = (surpratk_state *)space->machine->driver_data;
- if ((data & 0xf4) != 0x10)
+ if ((data & 0xf4) != 0x10)
logerror("%04x: 3fc0 = %02x\n",cpu_get_pc(space->cpu),data);
/* bit 0/1 = coin counters */
diff --git a/src/mame/drivers/taito_f2.c b/src/mame/drivers/taito_f2.c
index cdd66125382..198229dbcc0 100644
--- a/src/mame/drivers/taito_f2.c
+++ b/src/mame/drivers/taito_f2.c
@@ -628,7 +628,7 @@ static WRITE8_HANDLER( sound_bankswitch_w )
memory_set_bank(space->machine, "bank2", (data - 1) & 7);
#ifdef MAME_DEBUG
- if (((data - 1) & 7) > 2)
+ if (((data - 1) & 7) > 2)
logerror("CPU #1 switch to ROM bank %06x: should only happen if Z80 prg rom is 128K!\n",(data - 1) & 7);
#endif
}
@@ -699,7 +699,7 @@ static WRITE16_HANDLER( driveout_sound_command_w )
static WRITE16_HANDLER( cchip2_word_w )
{
- taitof2_state *state = (taitof2_state *)space->machine->driver_data;
+ taitof2_state *state = (taitof2_state *)space->machine->driver_data;
logerror("cchip2_w pc: %06x offset %04x: %02x\n", cpu_get_pc(space->cpu), offset, data);
@@ -708,7 +708,7 @@ static WRITE16_HANDLER( cchip2_word_w )
static READ16_HANDLER( cchip2_word_r )
{
- taitof2_state *state = (taitof2_state *)space->machine->driver_data;
+ taitof2_state *state = (taitof2_state *)space->machine->driver_data;
/* C-Chip ID */
if (offset == 0x401)
diff --git a/src/mame/drivers/taito_l.c b/src/mame/drivers/taito_l.c
index c96d91d31b9..05fc2b969b5 100644
--- a/src/mame/drivers/taito_l.c
+++ b/src/mame/drivers/taito_l.c
@@ -317,7 +317,7 @@ static INTERRUPT_GEN( vbl_interrupt )
cpu_set_irq_callback(device, irq_callback);
/* kludge to make plgirls boot */
- if (cpu_get_reg(device, Z80_IM) != 2)
+ if (cpu_get_reg(device, Z80_IM) != 2)
return;
// What is really generating interrupts 0 and 1 is still to be found
diff --git a/src/mame/drivers/taito_z.c b/src/mame/drivers/taito_z.c
index 8a2decac923..4eaaf22418f 100644
--- a/src/mame/drivers/taito_z.c
+++ b/src/mame/drivers/taito_z.c
@@ -1407,7 +1407,7 @@ static READ16_HANDLER( taitoz_sound_r )
if (offset == 1)
return (tc0140syt_comm_r(state->tc0140syt, 0) & 0xff);
- else
+ else
return 0;
}
@@ -1438,7 +1438,7 @@ static READ16_HANDLER( taitoz_msb_sound_r )
if (offset == 1)
return ((tc0140syt_comm_r(state->tc0140syt, 0) & 0xff) << 8);
- else
+ else
return 0;
}
#endif
@@ -1447,7 +1447,7 @@ static READ16_HANDLER( taitoz_msb_sound_r )
/**** sound pan control ****/
static WRITE8_HANDLER( taitoz_pancontrol )
{
-// taitoz_state *state = (taitoz_state *)space->machine->driver_data;
+// taitoz_state *state = (taitoz_state *)space->machine->driver_data;
static const char *const fltname[] = { "2610.1.r", "2610.1.l", "2610.2.r", "2610.2.l" };
offset = offset & 3;
diff --git a/src/mame/drivers/tmnt.c b/src/mame/drivers/tmnt.c
index 23a7f8848b6..3bb7ad30b01 100644
--- a/src/mame/drivers/tmnt.c
+++ b/src/mame/drivers/tmnt.c
@@ -241,9 +241,9 @@ static WRITE16_HANDLER( prmrsocr_sound_cmd_w )
if (ACCESSING_BITS_0_7)
{
data &= 0xff;
- if (offset == 0)
+ if (offset == 0)
soundlatch_w(space, 0, data);
- else
+ else
soundlatch2_w(space, 0, data);
}
}
@@ -276,10 +276,10 @@ static WRITE8_HANDLER( tmnt_sres_w )
/* bit 2 plays the title music */
if (data & 0x04)
{
- if (!sample_playing(state->samples, 0))
+ if (!sample_playing(state->samples, 0))
sample_start_raw(state->samples, 0, state->sampledata, 0x40000, 20000, 0);
}
- else
+ else
sample_stop(state->samples, 0);
state->tmnt_soundlatch = data;
}
@@ -797,11 +797,11 @@ INLINE UINT32 tmnt2_get_word( running_machine *machine, UINT32 addr )
{
tmnt_state *state = (tmnt_state *)machine->driver_data;
- if (addr <= 0x07ffff / 2)
- return(state->tmnt2_rom[addr]);
- else if (addr >= 0x104000 / 2 && addr <= 0x107fff / 2)
- return(state->sunset_104000[addr - 0x104000 / 2]);
- else if (addr >= 0x180000 / 2 && addr <= 0x183fff / 2)
+ if (addr <= 0x07ffff / 2)
+ return(state->tmnt2_rom[addr]);
+ else if (addr >= 0x104000 / 2 && addr <= 0x107fff / 2)
+ return(state->sunset_104000[addr - 0x104000 / 2]);
+ else if (addr >= 0x180000 / 2 && addr <= 0x183fff / 2)
return(machine->generic.spriteram.u16[addr - 0x180000 / 2]);
return 0;
}
@@ -821,7 +821,7 @@ static void tmnt2_put_word( const address_space *space, UINT32 addr, UINT16 data
k053245_word_w(state->k053245, offs, data, 0xffff);
}
}
- else if (addr >= 0x104000 / 2 && addr <= 0x107fff / 2)
+ else if (addr >= 0x104000 / 2 && addr <= 0x107fff / 2)
state->sunset_104000[addr - 0x104000 / 2] = data;
}
@@ -836,11 +836,11 @@ static WRITE16_HANDLER( tmnt2_1c0800_w )
COMBINE_DATA(state->tmnt2_1c0800 + offset);
- if (offset != 0x18/2 || !ACCESSING_BITS_8_15)
+ if (offset != 0x18/2 || !ACCESSING_BITS_8_15)
return;
mcu = state->tmnt2_1c0800;
- if ((mcu[8] & 0xff00) != 0x8200)
+ if ((mcu[8] & 0xff00) != 0x8200)
return;
src_addr = (mcu[0] | (mcu[1] & 0xff) << 16) >> 1;
@@ -848,9 +848,9 @@ static WRITE16_HANDLER( tmnt2_1c0800_w )
mod_addr = (mcu[4] | (mcu[5] & 0xff) << 16) >> 1;
zlock = (mcu[8] & 0xff) == 0x0001;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < 4; i++)
src[i] = tmnt2_get_word(space->machine, src_addr + i);
- for (i = 0; i < 24; i++) mod[i] =
+ for (i = 0; i < 24; i++) mod[i] =
tmnt2_get_word(space->machine, mod_addr + i);
code = src[0]; // code
diff --git a/src/mame/drivers/vega.c b/src/mame/drivers/vega.c
index 6fc9386d640..1d9b22233d9 100644
--- a/src/mame/drivers/vega.c
+++ b/src/mame/drivers/vega.c
@@ -64,7 +64,7 @@ ROM_START( vega )
ROM_LOAD( "rom7.bin", 0x0000, 0x0800, CRC(1de564cd) SHA1(7408cd29f1afc111aa695ecb00160d8f7fba7532) )
ROM_LOAD( "rom8.bin", 0x0000, 0x0800, CRC(ccb8598c) SHA1(8c4a702f0653bb189db7d8ac4c2a06aacecc0de0) )
ROM_LOAD( "rom9.bin", 0x0000, 0x0800, CRC(191c73cd) SHA1(17b1c3790f82b276e55d25ea8a38a3c9cf20bf12) )
- //ROM_LOAD( "rom10.bin", 0x0000, 0x1000, CRC(c7659222) SHA1(86df4f4afe5bfd0b67239353a344724405c32fed) ) // 1ST AND 2ND HALF IDENTICAL
+ //ROM_LOAD( "rom10.bin", 0x0000, 0x1000, CRC(c7659222) SHA1(86df4f4afe5bfd0b67239353a344724405c32fed) ) // 1ST AND 2ND HALF IDENTICAL
ROM_LOAD( "rom10a.bin", 0x0000, 0x1000, CRC(fca9a570) SHA1(598772db11b32518ed6bf5155a19f4f1761a4831) ) // if you convert the ascii dump there is different data in the 2nd half unlike the above dump (it also appears in the ascii dumps of 11/12 too tho)
ROM_LOAD( "rom11.bin", 0x0000, 0x0800, CRC(d1896f77) SHA1(5b80bf7aa81508edfae4fa583b4b0077575a300c) )
ROM_LOAD( "rom12.bin", 0x0000, 0x0800, CRC(f5f1df2f) SHA1(5851b468702e5e4f085b64afbe7d8b797bb109b5) )
@@ -114,9 +114,9 @@ DRIVER_INIT(vegaa)
l = ascii_to_bin(l);
r = ascii_to_bin(r);
-
+
num = l << 4 | r;
-
+
buf[count] = num;
count++;
}
diff --git a/src/mame/drivers/warriorb.c b/src/mame/drivers/warriorb.c
index 663b932758f..91b8cc6a3a5 100644
--- a/src/mame/drivers/warriorb.c
+++ b/src/mame/drivers/warriorb.c
@@ -194,7 +194,7 @@ static READ16_HANDLER( warriorb_sound_r )
if (offset == 1)
return ((tc0140syt_comm_r(state->tc0140syt, 0) & 0xff));
- else
+ else
return 0;
}
diff --git a/src/mame/drivers/wgp.c b/src/mame/drivers/wgp.c
index 9d50d0f004d..f8b8a1672a8 100644
--- a/src/mame/drivers/wgp.c
+++ b/src/mame/drivers/wgp.c
@@ -638,7 +638,7 @@ static READ16_HANDLER( wgp_sound_r )
if (offset == 1)
return ((tc0140syt_comm_r(state->tc0140syt, 0) & 0xff));
- else
+ else
return 0;
}
diff --git a/src/mame/drivers/xexex.c b/src/mame/drivers/xexex.c
index edd2e8012f5..2e2752495d4 100644
--- a/src/mame/drivers/xexex.c
+++ b/src/mame/drivers/xexex.c
@@ -219,7 +219,7 @@ static WRITE16_HANDLER( sound_cmd1_w )
{
// anyone knows why 0x1a keeps lurking the sound queue in the world version???
if (state->strip_0x1a)
- if (soundlatch2_r(space, 0) == 1 && data == 0x1a)
+ if (soundlatch2_r(space, 0) == 1 && data == 0x1a)
return;
soundlatch_w(space, 0, data & 0xff);
diff --git a/src/mame/drivers/xmen.c b/src/mame/drivers/xmen.c
index 31842d5c85d..adc875034c9 100644
--- a/src/mame/drivers/xmen.c
+++ b/src/mame/drivers/xmen.c
@@ -298,9 +298,9 @@ INPUT_PORTS_END
static INTERRUPT_GEN( xmen_interrupt )
{
- if (cpu_getiloops(device) == 0)
+ if (cpu_getiloops(device) == 0)
irq5_line_hold(device);
- else
+ else
irq3_line_hold(device);
}
diff --git a/src/mame/includes/asuka.h b/src/mame/includes/asuka.h
index df5173e76bd..141570d5109 100644
--- a/src/mame/includes/asuka.h
+++ b/src/mame/includes/asuka.h
@@ -8,7 +8,7 @@ typedef struct _asuka_state asuka_state;
struct _asuka_state
{
/* memory pointers */
-// UINT16 * paletteram; // this currently uses generic palette handlers
+// UINT16 * paletteram; // this currently uses generic palette handlers
/* video-related */
UINT16 video_ctrl;
diff --git a/src/mame/includes/cave.h b/src/mame/includes/cave.h
index 1ece14d3497..979e0bf510a 100644
--- a/src/mame/includes/cave.h
+++ b/src/mame/includes/cave.h
@@ -4,7 +4,7 @@
***************************************************************************/
-struct sprite_cave
+struct sprite_cave
{
int priority, flags;
diff --git a/src/mame/includes/gijoe.h b/src/mame/includes/gijoe.h
index ecd21a45779..5350689e9cc 100644
--- a/src/mame/includes/gijoe.h
+++ b/src/mame/includes/gijoe.h
@@ -18,8 +18,8 @@ struct _gijoe_state
int avac_vrc, sprite_colorbase;
/* misc */
- UINT16 cur_control2;
- emu_timer *dmadelay_timer;
+ UINT16 cur_control2;
+ emu_timer *dmadelay_timer;
/* devices */
const device_config *maincpu;
diff --git a/src/mame/includes/rastan.h b/src/mame/includes/rastan.h
index 2f413df31f8..92908b0d4bf 100644
--- a/src/mame/includes/rastan.h
+++ b/src/mame/includes/rastan.h
@@ -8,7 +8,7 @@ typedef struct _rastan_state rastan_state;
struct _rastan_state
{
/* memory pointers */
-// UINT16 * paletteram; // this currently uses generic palette handlers
+// UINT16 * paletteram; // this currently uses generic palette handlers
/* video-related */
UINT16 sprite_ctrl;
diff --git a/src/mame/includes/spy.h b/src/mame/includes/spy.h
index 4ca590c61d4..622ac43f5b3 100644
--- a/src/mame/includes/spy.h
+++ b/src/mame/includes/spy.h
@@ -19,7 +19,7 @@ struct _spy_state
int rambank, pmcbank;
int video_enable;
int old_3f90;
-
+
/* devices */
const device_config *maincpu;
const device_config *audiocpu;
diff --git a/src/mame/includes/taito_b.h b/src/mame/includes/taito_b.h
index 29107d849ba..333c5e42c61 100644
--- a/src/mame/includes/taito_b.h
+++ b/src/mame/includes/taito_b.h
@@ -5,7 +5,7 @@ struct _taitob_state
/* memory pointers */
UINT16 * spriteram;
UINT16 * pixelram;
-// UINT16 * paletteram; // this currently uses generic palette handlers
+// UINT16 * paletteram; // this currently uses generic palette handlers
/* video-related */
/* framebuffer is a raw bitmap, remapped as a last step */
diff --git a/src/mame/includes/taito_f2.h b/src/mame/includes/taito_f2.h
index 2979e5b1a9b..73f0de9ee2c 100644
--- a/src/mame/includes/taito_f2.h
+++ b/src/mame/includes/taito_f2.h
@@ -27,7 +27,7 @@ struct _taitof2_state
int sprite_type;
UINT16 spritebank[8];
-// UINT16 spritebank_eof[8];
+// UINT16 spritebank_eof[8];
UINT16 spritebank_buffered[8];
INT32 sprites_disabled, sprites_active_area, sprites_master_scrollx, sprites_master_scrolly;
diff --git a/src/mame/includes/tmnt.h b/src/mame/includes/tmnt.h
index f8b24915b5d..0518a8ce624 100644
--- a/src/mame/includes/tmnt.h
+++ b/src/mame/includes/tmnt.h
@@ -4,7 +4,7 @@ struct _tmnt_state
{
/* memory pointers */
INT16 * sampledata;
- UINT16 * tmnt2_1c0800;
+ UINT16 * tmnt2_1c0800;
UINT16 * sunset_104000;
UINT16 * tmnt2_rom;
// UINT16 * paletteram; // currently this uses generic palette handling
@@ -14,7 +14,7 @@ struct _tmnt_state
/* video-related */
int layer_colorbase[3], sprite_colorbase;
int layerpri[3];
- int sorted_layer[3]; // this might not be necessary, but tmnt2 uses it in a strange way...
+ int sorted_layer[3]; // this might not be necessary, but tmnt2 uses it in a strange way...
tilemap_t *roz_tilemap;
int glfgreat_roz_rom_bank, glfgreat_roz_char_bank, glfgreat_roz_rom_mode;
diff --git a/src/mame/includes/volfied.h b/src/mame/includes/volfied.h
index 2bdb1f55875..bc7bd9b839f 100644
--- a/src/mame/includes/volfied.h
+++ b/src/mame/includes/volfied.h
@@ -10,7 +10,7 @@ struct _volfied_state
/* memory pointers */
UINT16 * video_ram;
UINT8 * cchip_ram;
-// UINT16 * paletteram; // this currently uses generic palette handlers
+// UINT16 * paletteram; // this currently uses generic palette handlers
/* video-related */
UINT16 video_ctrl;
diff --git a/src/mame/machine/ajax.c b/src/mame/machine/ajax.c
index b1f3d2e4b73..437543e3259 100644
--- a/src/mame/machine/ajax.c
+++ b/src/mame/machine/ajax.c
@@ -37,7 +37,7 @@ static WRITE8_HANDLER( ajax_bankswitch_w )
int bank = 0;
/* rom select */
- if (!(data & 0x80))
+ if (!(data & 0x80))
bank += 4;
/* coin counters */
diff --git a/src/mame/machine/n64.c b/src/mame/machine/n64.c
index 1db986d0409..52335bb7930 100644
--- a/src/mame/machine/n64.c
+++ b/src/mame/machine/n64.c
@@ -533,7 +533,7 @@ WRITE32_DEVICE_HANDLER( n64_sp_reg_w )
{
UINT32 oldstatus = cpu_get_reg(device, RSP_SR);
UINT32 newstatus = oldstatus;
-
+
// printf( "RSP_STATUS_REG Write; %08x\n", data );
if (data & 0x00000001) // clear halt
{
diff --git a/src/mame/video/cave.c b/src/mame/video/cave.c
index ebc0859b689..95e7c1d77e1 100644
--- a/src/mame/video/cave.c
+++ b/src/mame/video/cave.c
@@ -303,7 +303,7 @@ static TILE_GET_INFO( sailormn_get_tile_info_2 )
INLINE void vram_w( UINT16 *VRAM, tilemap_t *TILEMAP, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask )
{
- if ((VRAM[offset] & mem_mask) == (data & mem_mask))
+ if ((VRAM[offset] & mem_mask) == (data & mem_mask))
return;
COMBINE_DATA(&VRAM[offset]);
@@ -328,7 +328,7 @@ INLINE void vram_w( UINT16 *VRAM, tilemap_t *TILEMAP, ATTR_UNUSED offs_t offset,
INLINE void vram_8x8_w( UINT16 *VRAM, tilemap_t *TILEMAP, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask )
{
offset %= 0x4000 / 2;
- if ((VRAM[offset] & mem_mask) == (data & mem_mask))
+ if ((VRAM[offset] & mem_mask) == (data & mem_mask))
return;
COMBINE_DATA(&VRAM[offset + 0x0000 / 2]);
@@ -343,51 +343,51 @@ static TILE_GET_INFO( get_tile_info_2 ) { cave_state *state = (cave_state *)mach
static TILE_GET_INFO( get_tile_info_3 ) { cave_state *state = (cave_state *)machine->driver_data; get_tile_info(machine, tileinfo, tile_index, 3, state->vram_3, state->tiledim_3); }
WRITE16_HANDLER( cave_vram_0_w )
-{
- cave_state *state = (cave_state *)space->machine->driver_data;
- vram_w(state->vram_0, state->tilemap_0, offset, data, mem_mask);
+{
+ cave_state *state = (cave_state *)space->machine->driver_data;
+ vram_w(state->vram_0, state->tilemap_0, offset, data, mem_mask);
}
WRITE16_HANDLER( cave_vram_0_8x8_w )
-{
- cave_state *state = (cave_state *)space->machine->driver_data;
- vram_8x8_w(state->vram_0, state->tilemap_0, offset, data, mem_mask);
+{
+ cave_state *state = (cave_state *)space->machine->driver_data;
+ vram_8x8_w(state->vram_0, state->tilemap_0, offset, data, mem_mask);
}
WRITE16_HANDLER( cave_vram_1_w )
-{
- cave_state *state = (cave_state *)space->machine->driver_data;
- vram_w(state->vram_1, state->tilemap_1, offset, data, mem_mask);
+{
+ cave_state *state = (cave_state *)space->machine->driver_data;
+ vram_w(state->vram_1, state->tilemap_1, offset, data, mem_mask);
}
WRITE16_HANDLER( cave_vram_1_8x8_w )
-{
- cave_state *state = (cave_state *)space->machine->driver_data;
- vram_8x8_w(state->vram_1, state->tilemap_1, offset, data, mem_mask);
+{
+ cave_state *state = (cave_state *)space->machine->driver_data;
+ vram_8x8_w(state->vram_1, state->tilemap_1, offset, data, mem_mask);
}
WRITE16_HANDLER( cave_vram_2_w )
-{
- cave_state *state = (cave_state *)space->machine->driver_data;
- vram_w(state->vram_2, state->tilemap_2, offset, data, mem_mask);
+{
+ cave_state *state = (cave_state *)space->machine->driver_data;
+ vram_w(state->vram_2, state->tilemap_2, offset, data, mem_mask);
}
WRITE16_HANDLER( cave_vram_2_8x8_w )
-{
- cave_state *state = (cave_state *)space->machine->driver_data;
- vram_8x8_w(state->vram_2, state->tilemap_2, offset, data, mem_mask);
+{
+ cave_state *state = (cave_state *)space->machine->driver_data;
+ vram_8x8_w(state->vram_2, state->tilemap_2, offset, data, mem_mask);
}
WRITE16_HANDLER( cave_vram_3_w )
-{
- cave_state *state = (cave_state *)space->machine->driver_data;
- vram_w(state->vram_3, state->tilemap_3, offset, data, mem_mask);
+{
+ cave_state *state = (cave_state *)space->machine->driver_data;
+ vram_w(state->vram_3, state->tilemap_3, offset, data, mem_mask);
}
WRITE16_HANDLER( cave_vram_3_8x8_w )
-{
- cave_state *state = (cave_state *)space->machine->driver_data;
- vram_8x8_w(state->vram_3, state->tilemap_3, offset, data, mem_mask);
+{
+ cave_state *state = (cave_state *)space->machine->driver_data;
+ vram_8x8_w(state->vram_3, state->tilemap_3, offset, data, mem_mask);
}
@@ -559,7 +559,7 @@ static void get_sprite_info_cave( running_machine *machine )
source = state->spriteram + ((state->spriteram_size / 2) / 2) * state->spriteram_bank;
if (state->videoregs[4] & 0x02)
- if (state->spriteram_2)
+ if (state->spriteram_2)
source = state->spriteram_2 + ((state->spriteram_size / 2) / 2) * state->spriteram_bank;
finish = source + ((state->spriteram_size / 2) / 2);
@@ -689,7 +689,7 @@ static void get_sprite_info_donpachi( running_machine *machine )
source = state->spriteram + ((state->spriteram_size / 2) / 2) * state->spriteram_bank;
if (state->videoregs[4] & 0x02)
- if (state->spriteram_2)
+ if (state->spriteram_2)
source = state->spriteram_2 + ((state->spriteram_size / 2) / 2) * state->spriteram_bank;
finish = source + ((state->spriteram_size / 2) / 2);
@@ -887,7 +887,7 @@ static void do_blit_zoom16_cave( running_machine *machine, const struct sprite_c
x2 = sprite->x;
x1 = x2 + sprite->total_width;
dx = -1;
- if (x2 < state->blit.clip_left)
+ if (x2 < state->blit.clip_left)
x2 = state->blit.clip_left;
if (x1 > state->blit.clip_right)
@@ -896,16 +896,16 @@ static void do_blit_zoom16_cave( running_machine *machine, const struct sprite_c
x1 = state->blit.clip_right;
while ((xcount0 & 0xffff) >= sprite->zoomx_re)
{
- xcount0 += sprite->zoomx_re;
+ xcount0 += sprite->zoomx_re;
x1--;
}
}
- if (x2 >= x1)
+ if (x2 >= x1)
return;
x1--; x2--;
}
- else
+ else
{
x1 = sprite->x;
x2 = x1 + sprite->total_width;
@@ -916,13 +916,13 @@ static void do_blit_zoom16_cave( running_machine *machine, const struct sprite_c
x1 = state->blit.clip_left;
while ((xcount0 & 0xffff) >= sprite->zoomx_re)
{
- xcount0 += sprite->zoomx_re;
+ xcount0 += sprite->zoomx_re;
x1++;
}
}
- if (x2 > state->blit.clip_right)
+ if (x2 > state->blit.clip_right)
x2 = state->blit.clip_right;
- if (x1 >= x2)
+ if (x1 >= x2)
return;
}
@@ -931,7 +931,7 @@ static void do_blit_zoom16_cave( running_machine *machine, const struct sprite_c
y2 = sprite->y;
y1 = y2 + sprite->total_height;
dy = -1;
- if (y2 < state->blit.clip_top)
+ if (y2 < state->blit.clip_top)
y2 = state->blit.clip_top;
if (y1 > state->blit.clip_bottom)
{
@@ -939,15 +939,15 @@ static void do_blit_zoom16_cave( running_machine *machine, const struct sprite_c
y1 = state->blit.clip_bottom;
while ((ycount0 & 0xffff) >= sprite->zoomy_re)
{
- ycount0 += sprite->zoomy_re;
+ ycount0 += sprite->zoomy_re;
y1--;
}
}
- if (y2 >= y1)
+ if (y2 >= y1)
return;
y1--; y2--;
}
- else
+ else
{
y1 = sprite->y;
y2 = y1 + sprite->total_height;
@@ -958,13 +958,13 @@ static void do_blit_zoom16_cave( running_machine *machine, const struct sprite_c
y1 = state->blit.clip_top;
while ((ycount0 & 0xffff) >= sprite->zoomy_re)
{
- ycount0 += sprite->zoomy_re;
+ ycount0 += sprite->zoomy_re;
y1++;
}
}
- if (y2 > state->blit.clip_bottom )
+ if (y2 > state->blit.clip_bottom )
y2 = state->blit.clip_bottom;
- if (y1 >= y2)
+ if (y1 >= y2)
return;
}
@@ -995,7 +995,7 @@ static void do_blit_zoom16_cave( running_machine *machine, const struct sprite_c
source += xcount >> 16;
xcount &= 0xffff;
pen = *source;
- if (pen)
+ if (pen)
dest[x] = base_pen + pen;
}
xcount += sprite->zoomx_re;
@@ -1028,15 +1028,15 @@ static void do_blit_zoom16_cave_zb( running_machine *machine, const struct sprit
x1 = state->blit.clip_right;
while ((xcount0 & 0xffff) >= sprite->zoomx_re)
{
- xcount0 += sprite->zoomx_re;
+ xcount0 += sprite->zoomx_re;
x1--;
}
}
- if (x2 >= x1)
+ if (x2 >= x1)
return;
x1--; x2--;
}
- else
+ else
{
x1 = sprite->x;
x2 = x1 + sprite->total_width;
@@ -1045,15 +1045,15 @@ static void do_blit_zoom16_cave_zb( running_machine *machine, const struct sprit
{
xcount0 += (state->blit.clip_left - x1) * sprite->zoomx_re;
x1 = state->blit.clip_left;
- while ((xcount0 & 0xffff) >= sprite->zoomx_re)
+ while ((xcount0 & 0xffff) >= sprite->zoomx_re)
{
- xcount0 += sprite->zoomx_re;
+ xcount0 += sprite->zoomx_re;
x1++;
}
}
- if (x2 > state->blit.clip_right)
+ if (x2 > state->blit.clip_right)
x2 = state->blit.clip_right;
- if (x1 >= x2)
+ if (x1 >= x2)
return;
}
if (sprite->flags & SPRITE_FLIPY_CAVE)
@@ -1061,7 +1061,7 @@ static void do_blit_zoom16_cave_zb( running_machine *machine, const struct sprit
y2 = sprite->y;
y1 = y2 + sprite->total_height;
dy = -1;
- if (y2 < state->blit.clip_top)
+ if (y2 < state->blit.clip_top)
y2 = state->blit.clip_top;
if (y1 > state->blit.clip_bottom)
{
@@ -1069,15 +1069,15 @@ static void do_blit_zoom16_cave_zb( running_machine *machine, const struct sprit
y1 = state->blit.clip_bottom;
while ((ycount0 & 0xffff) >= sprite->zoomy_re)
{
- ycount0 += sprite->zoomy_re;
+ ycount0 += sprite->zoomy_re;
y1--;
}
}
- if (y2 >= y1)
+ if (y2 >= y1)
return;
y1--; y2--;
}
- else
+ else
{
y1 = sprite->y;
y2 = y1 + sprite->total_height;
@@ -1088,13 +1088,13 @@ static void do_blit_zoom16_cave_zb( running_machine *machine, const struct sprit
y1 = state->blit.clip_top;
while ((ycount0 & 0xffff) >= sprite->zoomy_re)
{
- ycount0 += sprite->zoomy_re;
+ ycount0 += sprite->zoomy_re;
y1++;
}
}
- if (y2 > state->blit.clip_bottom)
+ if (y2 > state->blit.clip_bottom)
y2 = state->blit.clip_bottom;
- if (y1 >= y2)
+ if (y1 >= y2)
return;
}
@@ -1156,18 +1156,18 @@ static void do_blit_16_cave( running_machine *machine, const struct sprite_cave
x2 = sprite->x;
x1 = x2 + sprite->total_width;
dx = -1;
- if (x2 < state->blit.clip_left)
+ if (x2 < state->blit.clip_left)
x2 = state->blit.clip_left;
if (x1 > state->blit.clip_right)
{
xcount0 = x1 - state->blit.clip_right;
x1 = state->blit.clip_right;
}
- if (x2 >= x1)
+ if (x2 >= x1)
return;
x1--; x2--;
}
- else
+ else
{
x1 = sprite->x;
x2 = x1 + sprite->total_width;
@@ -1177,9 +1177,9 @@ static void do_blit_16_cave( running_machine *machine, const struct sprite_cave
xcount0 = state->blit.clip_left - x1;
x1 = state->blit.clip_left;
}
- if (x2 > state->blit.clip_right)
+ if (x2 > state->blit.clip_right)
x2 = state->blit.clip_right;
- if (x1 >= x2)
+ if (x1 >= x2)
return;
}
if (sprite->flags & SPRITE_FLIPY_CAVE)
@@ -1187,14 +1187,14 @@ static void do_blit_16_cave( running_machine *machine, const struct sprite_cave
y2 = sprite->y;
y1 = y2 + sprite->total_height;
dy = -1;
- if (y2 < state->blit.clip_top)
+ if (y2 < state->blit.clip_top)
y2 = state->blit.clip_top;
if (y1 > state->blit.clip_bottom)
{
ycount0 = y1 - state->blit.clip_bottom;
y1 = state->blit.clip_bottom;
}
- if (y2 >= y1)
+ if (y2 >= y1)
return;
y1--; y2--;
}
@@ -1207,9 +1207,9 @@ static void do_blit_16_cave( running_machine *machine, const struct sprite_cave
ycount0 = state->blit.clip_top - y1;
y1 = state->blit.clip_top;
}
- if (y2 > state->blit.clip_bottom)
+ if (y2 > state->blit.clip_bottom)
y2 = state->blit.clip_bottom;
- if (y1 >= y2)
+ if (y1 >= y2)
return;
}
@@ -1229,7 +1229,7 @@ static void do_blit_16_cave( running_machine *machine, const struct sprite_cave
for (x = x1; x != x2; x += dx)
{
pen = *source;
- if (pen)
+ if (pen)
dest[x] = base_pen + pen;
source++;
}
@@ -1252,18 +1252,18 @@ static void do_blit_16_cave_zb( running_machine *machine, const struct sprite_c
x2 = sprite->x;
x1 = x2 + sprite->total_width;
dx = -1;
- if (x2 < state->blit.clip_left)
+ if (x2 < state->blit.clip_left)
x2 = state->blit.clip_left;
if (x1 > state->blit.clip_right)
{
xcount0 = x1 - state->blit.clip_right;
x1 = state->blit.clip_right;
}
- if (x2 >= x1)
+ if (x2 >= x1)
return;
x1--; x2--;
}
- else
+ else
{
x1 = sprite->x;
x2 = x1 + sprite->total_width;
@@ -1273,9 +1273,9 @@ static void do_blit_16_cave_zb( running_machine *machine, const struct sprite_c
xcount0 = state->blit.clip_left - x1;
x1 = state->blit.clip_left;
}
- if (x2 > state->blit.clip_right)
+ if (x2 > state->blit.clip_right)
x2 = state->blit.clip_right;
- if (x1 >= x2)
+ if (x1 >= x2)
return;
}
if (sprite->flags & SPRITE_FLIPY_CAVE)
@@ -1283,18 +1283,18 @@ static void do_blit_16_cave_zb( running_machine *machine, const struct sprite_c
y2 = sprite->y;
y1 = y2 + sprite->total_height;
dy = -1;
- if (y2 < state->blit.clip_top)
+ if (y2 < state->blit.clip_top)
y2 = state->blit.clip_top;
if (y1 > state->blit.clip_bottom)
{
ycount0 = y1 - state->blit.clip_bottom;
y1 = state->blit.clip_bottom;
}
- if (y2 >= y1)
+ if (y2 >= y1)
return;
y1--; y2--;
}
- else
+ else
{
y1 = sprite->y;
y2 = y1 + sprite->total_height;
@@ -1304,7 +1304,7 @@ static void do_blit_16_cave_zb( running_machine *machine, const struct sprite_c
ycount0 = state->blit.clip_top - y1;
y1 = state->blit.clip_top;
}
- if (y2 > state->blit.clip_bottom)
+ if (y2 > state->blit.clip_bottom)
y2 = state->blit.clip_bottom;
if (y1 >= y2)
return;
@@ -1568,25 +1568,25 @@ INLINE void cave_tilemap_draw(
static void cave_tilemap_0_draw( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 flags, UINT32 priority, UINT32 priority2 )
{
cave_state *state = (cave_state *)machine->driver_data;
- cave_tilemap_draw(machine, bitmap, cliprect, state->tilemap_0, state->vram_0, state->vctrl_0, flags, priority, priority2);
+ cave_tilemap_draw(machine, bitmap, cliprect, state->tilemap_0, state->vram_0, state->vctrl_0, flags, priority, priority2);
}
static void cave_tilemap_1_draw( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 flags, UINT32 priority, UINT32 priority2 )
{
cave_state *state = (cave_state *)machine->driver_data;
- cave_tilemap_draw(machine, bitmap, cliprect, state->tilemap_1, state->vram_1, state->vctrl_1, flags, priority, priority2);
+ cave_tilemap_draw(machine, bitmap, cliprect, state->tilemap_1, state->vram_1, state->vctrl_1, flags, priority, priority2);
}
static void cave_tilemap_2_draw( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 flags, UINT32 priority, UINT32 priority2 )
{
cave_state *state = (cave_state *)machine->driver_data;
- cave_tilemap_draw(machine, bitmap, cliprect, state->tilemap_2, state->vram_2, state->vctrl_2, flags, priority, priority2);
+ cave_tilemap_draw(machine, bitmap, cliprect, state->tilemap_2, state->vram_2, state->vctrl_2, flags, priority, priority2);
}
static void cave_tilemap_3_draw( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 flags, UINT32 priority, UINT32 priority2 )
{
cave_state *state = (cave_state *)machine->driver_data;
- cave_tilemap_draw(machine, bitmap, cliprect, state->tilemap_3, state->vram_3, state->vctrl_3, flags, priority, priority2);
+ cave_tilemap_draw(machine, bitmap, cliprect, state->tilemap_3, state->vram_3, state->vctrl_3, flags, priority, priority2);
}
@@ -1605,7 +1605,7 @@ VIDEO_UPDATE( cave )
if (state->tilemap_0)
{
state->tiledim_0 = state->vctrl_0[1] & 0x2000;
- if (state->tiledim_0 != state->old_tiledim_0)
+ if (state->tiledim_0 != state->old_tiledim_0)
tilemap_mark_all_tiles_dirty(state->tilemap_0);
state->old_tiledim_0 = state->tiledim_0;
}
@@ -1613,7 +1613,7 @@ VIDEO_UPDATE( cave )
if (state->tilemap_1)
{
state->tiledim_1 = state->vctrl_1[1] & 0x2000;
- if (state->tiledim_1 != state->old_tiledim_1)
+ if (state->tiledim_1 != state->old_tiledim_1)
tilemap_mark_all_tiles_dirty(state->tilemap_1);
state->old_tiledim_1 = state->tiledim_1;
}
@@ -1621,7 +1621,7 @@ VIDEO_UPDATE( cave )
if (state->tilemap_2)
{
state->tiledim_2 = state->vctrl_2[1] & 0x2000;
- if (state->tiledim_2 != state->old_tiledim_2)
+ if (state->tiledim_2 != state->old_tiledim_2)
tilemap_mark_all_tiles_dirty(state->tilemap_2);
state->old_tiledim_2 = state->tiledim_2;
}
@@ -1629,7 +1629,7 @@ VIDEO_UPDATE( cave )
if (state->tilemap_3)
{
state->tiledim_3 = state->vctrl_3[1] & 0x2000;
- if (state->tiledim_3 != state->old_tiledim_3)
+ if (state->tiledim_3 != state->old_tiledim_3)
tilemap_mark_all_tiles_dirty(state->tilemap_3);
state->old_tiledim_3 = state->tiledim_3;
}
@@ -1762,7 +1762,7 @@ void cave_get_sprite_info( running_machine *machine )
static STATE_POSTLOAD( cave_sprite_postload )
{
- /* FIXME: this is probably not enough to restore sprites, but anyway saves do not
- currently work due to pending timers hence it is hard to test what is missing */
+ /* FIXME: this is probably not enough to restore sprites, but anyway saves do not
+ currently work due to pending timers hence it is hard to test what is missing */
cave_get_sprite_info(machine);
}
diff --git a/src/mame/video/darius.c b/src/mame/video/darius.c
index 3f50c02159c..efa270f2da0 100644
--- a/src/mame/video/darius.c
+++ b/src/mame/video/darius.c
@@ -72,7 +72,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
data = spriteram[offs + 3];
priority = (data & 0x80) >> 7; // 0 = low
- if (priority != primask)
+ if (priority != primask)
continue;
color = (data & 0x7f);
diff --git a/src/mame/video/dbz.c b/src/mame/video/dbz.c
index 845566a8054..1efc0e06550 100644
--- a/src/mame/video/dbz.c
+++ b/src/mame/video/dbz.c
@@ -24,13 +24,13 @@ void dbz_sprite_callback( running_machine *machine, int *code, int *color, int *
dbz_state *state = (dbz_state *)machine->driver_data;
int pri = (*color & 0x3c0) >> 5;
- if (pri <= state->layerpri[3])
+ if (pri <= state->layerpri[3])
*priority_mask = 0xff00;
else if (pri > state->layerpri[3] && pri <= state->layerpri[2])
*priority_mask = 0xfff0;
else if (pri > state->layerpri[2] && pri <= state->layerpri[1])
*priority_mask = 0xfffc;
- else
+ else
*priority_mask = 0xfffe;
*color = (state->sprite_colorbase << 1) + (*color & 0x1f);
diff --git a/src/mame/video/gijoe.c b/src/mame/video/gijoe.c
index aa8060b4eb2..477a5f4075e 100644
--- a/src/mame/video/gijoe.c
+++ b/src/mame/video/gijoe.c
@@ -7,14 +7,14 @@ void gijoe_sprite_callback( running_machine *machine, int *code, int *color, int
gijoe_state *state = (gijoe_state *)machine->driver_data;
int pri = (*color & 0x03e0) >> 4;
- if (pri <= state->layer_pri[3])
+ if (pri <= state->layer_pri[3])
*priority_mask = 0;
- else if (pri > state->layer_pri[3] && pri <= state->layer_pri[2])
+ else if (pri > state->layer_pri[3] && pri <= state->layer_pri[2])
*priority_mask = 0xff00;
- else if (pri > state->layer_pri[2] && pri <= state->layer_pri[1])
+ else if (pri > state->layer_pri[2] && pri <= state->layer_pri[1])
*priority_mask = 0xff00 | 0xf0f0;
- else if (pri > state->layer_pri[1] && pri <= state->layer_pri[0])
- *priority_mask = 0xff00 | 0xf0f0 | 0xcccc;
+ else if (pri > state->layer_pri[1] && pri <= state->layer_pri[0])
+ *priority_mask = 0xff00 | 0xf0f0 | 0xcccc;
else
*priority_mask = 0xff00 | 0xf0f0 | 0xcccc | 0xaaaa;
@@ -29,20 +29,20 @@ void gijoe_tile_callback( running_machine *machine, int layer, int *code, int *c
if (tile >= 0xf000 && tile <= 0xf4ff)
{
tile &= 0x0fff;
- if (tile < 0x0310)
- {
- state->avac_occupancy[layer] |= 0x0f00;
- tile |= state->avac_bits[0];
+ if (tile < 0x0310)
+ {
+ state->avac_occupancy[layer] |= 0x0f00;
+ tile |= state->avac_bits[0];
+ }
+ else if (tile < 0x0470)
+ {
+ state->avac_occupancy[layer] |= 0xf000;
+ tile |= state->avac_bits[1];
}
- else if (tile < 0x0470)
- {
- state->avac_occupancy[layer] |= 0xf000;
- tile |= state->avac_bits[1];
- }
else
- {
- state->avac_occupancy[layer] |= 0x00f0;
- tile |= state->avac_bits[2];
+ {
+ state->avac_occupancy[layer] |= 0x00f0;
+ tile |= state->avac_bits[2];
}
*code = tile;
}
diff --git a/src/mame/video/gradius3.c b/src/mame/video/gradius3.c
index 0208b3bf6d4..30f127ee572 100644
--- a/src/mame/video/gradius3.c
+++ b/src/mame/video/gradius3.c
@@ -41,9 +41,9 @@ void gradius3_sprite_callback( running_machine *machine, int *code, int *color,
gradius3_state *state = (gradius3_state *)machine->driver_data;
int pri = ((*color & 0x60) >> 5);
- if (state->priority == 0)
+ if (state->priority == 0)
*priority_mask = primask[0][pri];
- else
+ else
*priority_mask = primask[1][pri];
*code |= (*color & 0x01) << 13;
diff --git a/src/mame/video/hng64.c b/src/mame/video/hng64.c
index 34298145287..d64524ea0e5 100644
--- a/src/mame/video/hng64.c
+++ b/src/mame/video/hng64.c
@@ -1921,7 +1921,7 @@ void recoverPolygonBlock(running_machine* machine, const UINT16* packet, struct
threeDRoms = (UINT16*)(memory_region(machine, "verts"));
threeDPointer = &threeDRoms[threeDOffset * 3];
- if (threeDOffset >= 0x0c00000 && hng64_mcu_type == SHOOT_MCU)
+ if (threeDOffset >= 0x0c00000 && hng64_mcu_type == SHOOT_MCU)
{
printf("Strange geometry packet: (ignoring)\n");
printPacket(packet, 1);
@@ -2050,7 +2050,7 @@ void recoverPolygonBlock(running_machine* machine, const UINT16* packet, struct
// Debug - Colors polygons with certain flags bright blue! ajg
//if (chunkOffset[2] & 0x00f0)
- // polys[*numPolys].debugColor = 0xff0000ff;
+ // polys[*numPolys].debugColor = 0xff0000ff;
// Debug - ajg
//printf("%d (%08x) : %04x %04x %04x ", k, address[k]*3*2, chunkOffset[0], chunkOffset[1], chunkOffset[2]);
@@ -2094,7 +2094,7 @@ void recoverPolygonBlock(running_machine* machine, const UINT16* packet, struct
/* TODO: Does the explicit palette bit do anything when the dynamic palette flag is on? */
}
else
- {
+ {
UINT8 explicitPaletteValue = (chunkOffset[1] & 0x0f00) >> 8;
polys[*numPolys].palOffset += explicitPaletteValue * 0x80;
}
diff --git a/src/mame/video/lethal.c b/src/mame/video/lethal.c
index 9a52c2efaaa..92c2c1e030c 100644
--- a/src/mame/video/lethal.c
+++ b/src/mame/video/lethal.c
@@ -18,19 +18,19 @@ void lethalen_sprite_callback( running_machine *machine, int *code, int *color,
*color += 0x400 / 64; // colourbase?
/* this isn't ideal.. shouldn't need to hardcode it? not 100% sure about it anyway*/
- if (pri == 0x10)
+ if (pri == 0x10)
*priority_mask = 0xf0; // guys on first level
- else if (pri == 0x90)
+ else if (pri == 0x90)
*priority_mask = 0xf0; // car doors
- else if (pri == 0x20)
+ else if (pri == 0x20)
*priority_mask = 0xf0 | 0xcc; // people behind glass on 1st level
- else if (pri == 0xa0)
+ else if (pri == 0xa0)
*priority_mask = 0xf0 | 0xcc; // glass on 1st/2nd level
- else if (pri == 0x40)
+ else if (pri == 0x40)
*priority_mask = 0; // blood splats?
- else if (pri == 0x00)
+ else if (pri == 0x00)
*priority_mask = 0; // gunshots etc
- else if (pri == 0x30)
+ else if (pri == 0x30)
*priority_mask = 0xf0 | 0xcc | 0xaa; // mask sprites (always in a bad colour, used to do special effects i think
else
{
diff --git a/src/mame/video/mainevt.c b/src/mame/video/mainevt.c
index 30d24239dab..ab66cf285e4 100644
--- a/src/mame/video/mainevt.c
+++ b/src/mame/video/mainevt.c
@@ -55,7 +55,7 @@ void mainevt_sprite_callback(running_machine *machine, int *code,int *color,int
*priority_mask = 0xff00;
else if (*color & 0x40)
*priority_mask = 0xff00 | 0xf0f0;
- else
+ else
*priority_mask = 0xff00 | 0xf0f0 | 0xcccc;
/* bit 7 is shadow, not used */
diff --git a/src/mame/video/moo.c b/src/mame/video/moo.c
index 65bd92ffce9..0ccb848f8b5 100644
--- a/src/mame/video/moo.c
+++ b/src/mame/video/moo.c
@@ -23,7 +23,7 @@ void moo_sprite_callback( running_machine *machine, int *code, int *color, int *
*priority_mask = 0xf0;
else if (pri <= state->layerpri[0])
*priority_mask = 0xf0|0xcc;
- else
+ else
*priority_mask = 0xf0|0xcc|0xaa;
*color = state->sprite_colorbase | (*color & 0x001f);
diff --git a/src/mame/video/ninjaw.c b/src/mame/video/ninjaw.c
index 9870156ba0e..ccfb33c87b1 100644
--- a/src/mame/video/ninjaw.c
+++ b/src/mame/video/ninjaw.c
@@ -33,7 +33,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
data = spriteram[offs + 2];
tilenum = data & 0x7fff;
- if (!tilenum)
+ if (!tilenum)
continue;
data = spriteram[offs + 0];
@@ -60,7 +60,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = (data & 0x2) >> 1;
priority = (data & 0x4) >> 2; // 1 = low
/* data&0x8 - unknown */
- if (priority != primask)
+ if (priority != primask)
continue;
color = (data & 0x7f00) >> 8;
/* data&0x8000 - unknown */
diff --git a/src/mame/video/othunder.c b/src/mame/video/othunder.c
index c9624502556..4e77f40681b 100644
--- a/src/mame/video/othunder.c
+++ b/src/mame/video/othunder.c
@@ -99,7 +99,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
tilenum = data & 0x1fff; // $80000 spritemap rom maps up to $2000 64x64 sprites
flipy = (data & 0x8000) >> 15;
- if (!tilenum)
+ if (!tilenum)
continue;
map_offset = tilenum << 5;
diff --git a/src/mame/video/overdriv.c b/src/mame/video/overdriv.c
index 95c3325f4aa..aa4e208b63c 100644
--- a/src/mame/video/overdriv.c
+++ b/src/mame/video/overdriv.c
@@ -14,7 +14,7 @@ void overdriv_sprite_callback( running_machine *machine, int *code, int *color,
int pri = (*color & 0xffe0) >> 5; /* ??????? */
if (pri)
*priority_mask = 0x02;
- else
+ else
*priority_mask = 0x00;
*color = state->sprite_colorbase + (*color & 0x001f);
diff --git a/src/mame/video/parodius.c b/src/mame/video/parodius.c
index 0eff7e6e7c6..26f8bc2cd4a 100644
--- a/src/mame/video/parodius.c
+++ b/src/mame/video/parodius.c
@@ -26,13 +26,13 @@ void parodius_sprite_callback( running_machine *machine, int *code, int *color,
{
parodius_state *state = (parodius_state *)machine->driver_data;
int pri = 0x20 | ((*color & 0x60) >> 2);
- if (pri <= state->layerpri[2])
+ if (pri <= state->layerpri[2])
*priority_mask = 0;
else if (pri > state->layerpri[2] && pri <= state->layerpri[1])
*priority_mask = 0xf0;
else if (pri > state->layerpri[1] && pri <= state->layerpri[0])
*priority_mask = 0xf0 | 0xcc;
- else
+ else
*priority_mask = 0xf0 | 0xcc | 0xaa;
*color = state->sprite_colorbase + (*color & 0x1f);
diff --git a/src/mame/video/psikyosh.c b/src/mame/video/psikyosh.c
index af2be7944d8..91da7bc6671 100644
--- a/src/mame/video/psikyosh.c
+++ b/src/mame/video/psikyosh.c
@@ -998,7 +998,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
**- End Sprite Format -*/
-
+
psikyosh_state *state = (psikyosh_state *)machine->driver_data;
const gfx_element *gfx;
UINT32 *src = machine->generic.buffered_spriteram.u32; /* Use buffered spriteram */
@@ -1133,7 +1133,7 @@ static void psikyosh_postlineblend( running_machine *machine, bitmap_t *bitmap,
if ((state->vidregs[2] & 0xf) != req_pri) {
return;
}
-
+
profiler_mark_start(PROFILER_USER2);
for (y = cliprect->min_y; y <= cliprect->max_y; y += 1) {
@@ -1185,7 +1185,7 @@ popmessage ("Regs %08x %08x %08x %08x\n %08x %08x %08x %08x",
state->vidregs[4], state->vidregs[5],
state->vidregs[6], state->vidregs[7]);
#endif
-
+
bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
bitmap_fill(state->z_bitmap, cliprect, 0); /* z-buffer */
diff --git a/src/mame/video/rastan.c b/src/mame/video/rastan.c
index 3da86161860..01448dbffd1 100644
--- a/src/mame/video/rastan.c
+++ b/src/mame/video/rastan.c
@@ -175,7 +175,7 @@ VIDEO_UPDATE( jumping )
{
rainbow_state *state = (rainbow_state *)screen->machine->driver_data;
UINT16 *spriteram = state->spriteram;
- int offs, layer[2];
+ int offs, layer[2];
int sprite_colbank = (state->sprite_ctrl & 0xe0) >> 1;
pc080sn_tilemap_update(state->pc080sn);
diff --git a/src/mame/video/simpsons.c b/src/mame/video/simpsons.c
index 21dca4818c2..c4a47960c8f 100644
--- a/src/mame/video/simpsons.c
+++ b/src/mame/video/simpsons.c
@@ -27,13 +27,13 @@ void simpsons_sprite_callback( running_machine *machine, int *code, int *color,
simpsons_state *state = (simpsons_state *)machine->driver_data;
int pri = (*color & 0x0f80) >> 6; /* ??????? */
- if (pri <= state->layerpri[2])
+ if (pri <= state->layerpri[2])
*priority_mask = 0;
else if (pri > state->layerpri[2] && pri <= state->layerpri[1])
*priority_mask = 0xf0;
else if (pri > state->layerpri[1] && pri <= state->layerpri[0])
*priority_mask = 0xf0 | 0xcc;
- else
+ else
*priority_mask = 0xf0 | 0xcc | 0xaa;
*color = state->sprite_colorbase + (*color & 0x001f);
@@ -72,7 +72,7 @@ static READ8_HANDLER( simpsons_k053247_r )
else
return(state->spriteram[offs] >> 8);
}
- else
+ else
return state->xtraram[offset - 0x1000];
}
diff --git a/src/mame/video/slapshot.c b/src/mame/video/slapshot.c
index 8687a565a3d..0ff78e36a84 100644
--- a/src/mame/video/slapshot.c
+++ b/src/mame/video/slapshot.c
@@ -153,22 +153,22 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if ((state->spriteram_buffered[(offs + 4) / 2] & 0xf000) == 0xa000)
{
master_scrollx = state->spriteram_buffered[(offs + 4) / 2] & 0xfff;
- if (master_scrollx >= 0x800)
+ if (master_scrollx >= 0x800)
master_scrollx -= 0x1000; /* signed value */
master_scrolly = state->spriteram_buffered[(offs + 6) / 2] & 0xfff;
- if (master_scrolly >= 0x800)
+ if (master_scrolly >= 0x800)
master_scrolly -= 0x1000; /* signed value */
}
if ((state->spriteram_buffered[(offs + 4) / 2] & 0xf000) == 0x5000)
{
scroll1x = state->spriteram_buffered[(offs + 4) / 2] & 0xfff;
- if (scroll1x >= 0x800)
+ if (scroll1x >= 0x800)
scroll1x -= 0x1000; /* signed value */
scroll1y = state->spriteram_buffered[(offs + 6) / 2] & 0xfff;
- if (scroll1y >= 0x800)
+ if (scroll1y >= 0x800)
scroll1y -= 0x1000; /* signed value */
}
@@ -418,11 +418,11 @@ static void taito_update_sprites_active_area( running_machine *machine )
if ((state->spriteram_buffered[(offs+4)/2] & 0xf000) == 0xa000)
{
state->sprites_master_scrollx = state->spriteram_buffered[(offs + 4) / 2] & 0xfff;
- if (state->sprites_master_scrollx >= 0x800)
+ if (state->sprites_master_scrollx >= 0x800)
state->sprites_master_scrollx -= 0x1000; /* signed value */
state->sprites_master_scrolly = state->spriteram_buffered[(offs + 6) / 2] & 0xfff;
- if (state->sprites_master_scrolly >= 0x800)
+ if (state->sprites_master_scrolly >= 0x800)
state->sprites_master_scrolly -= 0x1000; /* signed value */
}
}
diff --git a/src/mame/video/surpratk.c b/src/mame/video/surpratk.c
index 10929c87499..d73e781458c 100644
--- a/src/mame/video/surpratk.c
+++ b/src/mame/video/surpratk.c
@@ -27,13 +27,13 @@ void surpratk_sprite_callback( running_machine *machine, int *code, int *color,
{
surpratk_state *state = (surpratk_state *)machine->driver_data;
int pri = 0x20 | ((*color & 0x60) >> 2);
- if (pri <= state->layerpri[2])
+ if (pri <= state->layerpri[2])
*priority_mask = 0;
else if (pri > state->layerpri[2] && pri <= state->layerpri[1])
*priority_mask = 0xf0;
else if (pri > state->layerpri[1] && pri <= state->layerpri[0])
*priority_mask = 0xf0 | 0xcc;
- else
+ else
*priority_mask = 0xf0 | 0xcc | 0xaa;
*color = state->sprite_colorbase + (*color & 0x1f);
diff --git a/src/mame/video/tail2nos.c b/src/mame/video/tail2nos.c
index 8c60bb0c11d..75dfe982f85 100644
--- a/src/mame/video/tail2nos.c
+++ b/src/mame/video/tail2nos.c
@@ -109,11 +109,11 @@ WRITE16_HANDLER( tail2nos_gfxbank_w )
int bank;
/* bits 0 and 2 select char bank */
- if (data & 0x04)
+ if (data & 0x04)
bank = 2;
- else if (data & 0x01)
+ else if (data & 0x01)
bank = 1;
- else
+ else
bank = 0;
if (state->charbank != bank)
@@ -123,9 +123,9 @@ WRITE16_HANDLER( tail2nos_gfxbank_w )
}
/* bit 5 seems to select palette bank (used on startup) */
- if (data & 0x20)
+ if (data & 0x20)
bank = 7;
- else
+ else
bank = 3;
if (state->charpalette != bank)
@@ -158,10 +158,10 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
int sx, sy, flipx, flipy, code, color;
sx = spriteram[offs + 1];
- if (sx >= 0x8000)
+ if (sx >= 0x8000)
sx -= 0x10000;
sy = 0x10000 - spriteram[offs + 0];
- if (sy >= 0x8000)
+ if (sy >= 0x8000)
sy -= 0x10000;
code = spriteram[offs + 2] & 0x07ff;
color = (spriteram[offs + 2] & 0xe000) >> 13;
diff --git a/src/mame/video/taito_f2.c b/src/mame/video/taito_f2.c
index c2a1496015d..cd222f8098e 100644
--- a/src/mame/video/taito_f2.c
+++ b/src/mame/video/taito_f2.c
@@ -248,7 +248,7 @@ WRITE16_HANDLER( taitof2_spritebank_w )
int i = 0;
int j = 0;
- if (offset < 2)
+ if (offset < 2)
return; /* irrelevant zero writes */
if (offset < 4) /* special bank pairs */
@@ -296,7 +296,7 @@ static void taito_f2_tc360_spritemixdraw( running_machine *machine, bitmap_t *de
int sprite_screen_height = (scaley * gfx->height + 0x8000) >> 16;
int sprite_screen_width = (scalex * gfx->width + 0x8000) >> 16;
- if (!scalex || !scaley)
+ if (!scalex || !scaley)
return;
if (sprite_screen_width && sprite_screen_height)
@@ -528,7 +528,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
color = 0;
f2_x_offset = state->hide_pixels; /* Get rid of 0-3 unwanted pixels on edge of screen. */
- if (state->sprites_flipscreen)
+ if (state->sprites_flipscreen)
f2_x_offset = -state->flip_hide_pixels; // was -f2_x_offset
/* safety check to avoid getting stuck in bank 2 for games using only one bank */
@@ -547,7 +547,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
/* Get rid of 0-3 unwanted pixels on edge of screen. */
f2_x_offset = state->hide_pixels;
- if (state->sprites_flipscreen)
+ if (state->sprites_flipscreen)
f2_x_offset = -state->flip_hide_pixels; // was -f2_x_offset
if (state->game == FOOTCHMP)
@@ -563,22 +563,22 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if ((state->spriteram_buffered[(offs + 4) / 2] & 0xf000) == 0xa000)
{
master_scrollx = state->spriteram_buffered[(offs + 4) / 2] & 0xfff;
- if (master_scrollx >= 0x800)
+ if (master_scrollx >= 0x800)
master_scrollx -= 0x1000; /* signed value */
master_scrolly = state->spriteram_buffered[(offs + 6) / 2] & 0xfff;
- if (master_scrolly >= 0x800)
+ if (master_scrolly >= 0x800)
master_scrolly -= 0x1000; /* signed value */
}
if ((state->spriteram_buffered[(offs + 4) / 2] & 0xf000) == 0x5000)
{
scroll1x = state->spriteram_buffered[(offs + 4) / 2] & 0xfff;
- if (scroll1x >= 0x800)
+ if (scroll1x >= 0x800)
scroll1x -= 0x1000; /* signed value */
scroll1y = state->spriteram_buffered[(offs + 6) / 2] & 0xfff;
- if (scroll1y >= 0x800)
+ if (scroll1y >= 0x800)
scroll1y -= 0x1000; /* signed value */
}
diff --git a/src/mame/video/taito_l.c b/src/mame/video/taito_l.c
index b5ec8de94d2..bb7de98513a 100644
--- a/src/mame/video/taito_l.c
+++ b/src/mame/video/taito_l.c
@@ -260,7 +260,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
sx = state->buff_spriteram[offs + 4] | ((state->buff_spriteram[offs + 5] & 1) << 8);
sy = state->buff_spriteram[offs + 6];
- if (sx >= 320)
+ if (sx >= 320)
sx -= 512;
flipx = state->buff_spriteram[offs + 3] & 0x01;
flipy = state->buff_spriteram[offs + 3] & 0x02;
diff --git a/src/mame/video/taito_z.c b/src/mame/video/taito_z.c
index 2965db169ae..b5186ee2c56 100644
--- a/src/mame/video/taito_z.c
+++ b/src/mame/video/taito_z.c
@@ -178,7 +178,7 @@ static void contcirc_draw_sprites_16x8( running_machine *machine, bitmap_t *bitm
color = (data & 0xff00) >> 8;
zoomx = (data & 0x7f);
- if (!tilenum)
+ if (!tilenum)
continue;
map_offset = tilenum << 7;
@@ -205,7 +205,7 @@ static void contcirc_draw_sprites_16x8( running_machine *machine, bitmap_t *bitm
code = spritemap[map_offset + px + (py << 3)];
- if (code == 0xffff)
+ if (code == 0xffff)
bad_chunks++;
curx = x + ((k * zoomx) / 8);
@@ -274,7 +274,7 @@ static void chasehq_draw_sprites_16x16( running_machine *machine, bitmap_t *bitm
/* higher bits are sometimes used... e.g. sign over flashing enemy car...! */
tilenum = data & 0x7ff;
- if (!tilenum)
+ if (!tilenum)
continue;
zoomx += 1;
@@ -303,7 +303,7 @@ static void chasehq_draw_sprites_16x16( running_machine *machine, bitmap_t *bitm
code = spritemap[map_offset + px + (py << 3)];
- if (code == 0xffff)
+ if (code == 0xffff)
bad_chunks++;
curx = x + ((k * zoomx) / 8);
@@ -459,7 +459,7 @@ static void bshark_draw_sprites_16x8( running_machine *machine, bitmap_t *bitmap
data = spriteram[offs + 3];
tilenum = data & 0x1fff; /* $80000 spritemap rom maps up to $2000 64x64 sprites */
- if (!tilenum)
+ if (!tilenum)
continue;
map_offset = tilenum << 5;
@@ -564,7 +564,7 @@ static void sci_draw_sprites_16x8( running_machine *machine, bitmap_t *bitmap, c
data = spriteram[offs + 3];
tilenum = data & 0x1fff; /* $80000 spritemap rom maps up to $2000 64x64 sprites */
- if (!tilenum)
+ if (!tilenum)
continue;
map_offset = tilenum << 5;
@@ -660,7 +660,7 @@ static void aquajack_draw_sprites_16x8(running_machine *machine, bitmap_t *bitma
flipy = (data & 0x8000) >> 15; // ???
tilenum = data & 0x1fff; /* $80000 spritemap rom maps up to $2000 64x64 sprites */
- if (!tilenum)
+ if (!tilenum)
continue;
map_offset = tilenum << 5;
@@ -755,7 +755,7 @@ static void spacegun_draw_sprites_16x8(running_machine *machine, bitmap_t *bitma
flipy = (data & 0x8000) >> 15; // ???
tilenum = data & 0x1fff; /* $80000 spritemap rom maps up to $2000 64x64 sprites */
- if (!tilenum)
+ if (!tilenum)
continue;
map_offset = tilenum << 5;
diff --git a/src/mame/video/taitoair.c b/src/mame/video/taitoair.c
index 2c791174dbb..2ee7236c110 100644
--- a/src/mame/video/taitoair.c
+++ b/src/mame/video/taitoair.c
@@ -208,7 +208,7 @@ static void fill_slope( bitmap_t *bitmap, const rectangle *cliprect, int color,
y1 = cliprect->min_y;
}
- if (x1 > x2 || (x1==x2 && sl1 > sl2))
+ if (x1 > x2 || (x1==x2 && sl1 > sl2))
{
INT32 t, *tp;
t = x1;
@@ -222,7 +222,7 @@ static void fill_slope( bitmap_t *bitmap, const rectangle *cliprect, int color,
nx2 = tp;
}
- while (y1 < y2)
+ while (y1 < y2)
{
if (y1 >= cliprect->min_y)
{
@@ -235,7 +235,7 @@ static void fill_slope( bitmap_t *bitmap, const rectangle *cliprect, int color,
if (xx2 > cliprect->max_x)
xx2 = cliprect->max_x;
- while (xx1 <= xx2)
+ while (xx1 <= xx2)
{
*BITMAP_ADDR16(bitmap, y1, xx1) = color;
xx1++;
@@ -259,14 +259,14 @@ static void fill_poly( bitmap_t *bitmap, const rectangle *cliprect, const struct
int color = q->col;
int pcount = q->pcount;
- for (i = 0; i < pcount; i++)
+ for (i = 0; i < pcount; i++)
{
p[i].x = p[i + pcount].x = q->p[i].x << TAITOAIR_FRAC_SHIFT;
p[i].y = p[i + pcount].y = q->p[i].y;
}
pmin = pmax = 0;
- for (i = 1; i < pcount; i++)
+ for (i = 1; i < pcount; i++)
{
if (p[i].y < p[pmin].y)
pmin = i;
@@ -293,9 +293,9 @@ static void fill_poly( bitmap_t *bitmap, const rectangle *cliprect, const struct
goto startup;
- for (;;)
+ for (;;)
{
- if (p[ps1 - 1].y == p[ps2 + 1].y)
+ if (p[ps1 - 1].y == p[ps2 + 1].y)
{
fill_slope(bitmap, cliprect, color, x1, x2, sl1, sl2, cury, p[ps1 - 1].y, &x1, &x2);
cury = p[ps1 - 1].y;
@@ -313,8 +313,8 @@ static void fill_poly( bitmap_t *bitmap, const rectangle *cliprect, const struct
x2 = p[ps2].x;
sl1 = (x1 - p[ps1 - 1].x) / (cury - p[ps1 - 1].y);
sl2 = (x2 - p[ps2 + 1].x) / (cury - p[ps2 + 1].y);
- }
- else if (p[ps1 - 1].y < p[ps2 + 1].y)
+ }
+ else if (p[ps1 - 1].y < p[ps2 + 1].y)
{
fill_slope(bitmap, cliprect, color, x1, x2, sl1, sl2, cury, p[ps1 - 1].y, &x1, &x2);
cury = p[ps1 - 1].y;
@@ -325,8 +325,8 @@ static void fill_poly( bitmap_t *bitmap, const rectangle *cliprect, const struct
ps1--;
x1 = p[ps1].x;
sl1 = (x1 - p[ps1 - 1].x) / (cury - p[ps1 - 1].y);
- }
- else
+ }
+ else
{
fill_slope(bitmap, cliprect, color, x1, x2, sl1, sl2, cury, p[ps2 + 1].y, &x1, &x2);
cury = p[ps2 + 1].y;
@@ -370,7 +370,7 @@ VIDEO_UPDATE( taitoair )
if (state->line_ram[0x3fff])
{
int adr = 0x3fff;
-// struct taitoair_poly q;
+// struct taitoair_poly q;
while (adr >= 0 && state->line_ram[adr] && state->line_ram[adr] != 0x4000)
{
diff --git a/src/mame/video/tmnt.c b/src/mame/video/tmnt.c
index d5bf22f640b..dccd9199a9c 100644
--- a/src/mame/video/tmnt.c
+++ b/src/mame/video/tmnt.c
@@ -122,13 +122,13 @@ void punkshot_sprite_callback( running_machine *machine, int *code, int *color,
{
tmnt_state *state = (tmnt_state *)machine->driver_data;
int pri = 0x20 | ((*color & 0x60) >> 2);
- if (pri <= state->layerpri[2])
+ if (pri <= state->layerpri[2])
*priority_mask = 0;
else if (pri > state->layerpri[2] && pri <= state->layerpri[1])
*priority_mask = 0xf0;
else if (pri > state->layerpri[1] && pri <= state->layerpri[0])
*priority_mask = 0xf0 | 0xcc;
- else
+ else
*priority_mask = 0xf0 | 0xcc | 0xaa;
*code |= (*color & 0x10) << 9;
@@ -139,13 +139,13 @@ void thndrx2_sprite_callback( running_machine *machine, int *code, int *color, i
{
tmnt_state *state = (tmnt_state *)machine->driver_data;
int pri = 0x20 | ((*color & 0x60) >> 2);
- if (pri <= state->layerpri[2])
+ if (pri <= state->layerpri[2])
*priority_mask = 0;
else if (pri > state->layerpri[2] && pri <= state->layerpri[1])
*priority_mask = 0xf0;
else if (pri > state->layerpri[1] && pri <= state->layerpri[0])
*priority_mask = 0xf0 | 0xcc;
- else
+ else
*priority_mask = 0xf0 | 0xcc | 0xaa;
*color = state->sprite_colorbase + (*color & 0x0f);
@@ -162,13 +162,13 @@ void lgtnfght_sprite_callback( running_machine *machine, int *code, int *color,
{
tmnt_state *state = (tmnt_state *)machine->driver_data;
int pri = 0x20 | ((*color & 0x60) >> 2);
- if (pri <= state->layerpri[2])
+ if (pri <= state->layerpri[2])
*priority_mask = 0;
else if (pri > state->layerpri[2] && pri <= state->layerpri[1])
*priority_mask = 0xf0;
else if (pri > state->layerpri[1] && pri <= state->layerpri[0])
*priority_mask = 0xf0 | 0xcc;
- else
+ else
*priority_mask = 0xf0 | 0xcc | 0xaa;
*color = state->sprite_colorbase + (*color & 0x1f);
@@ -183,13 +183,13 @@ if (input_code_pressed(machine, KEYCODE_W) && (*color & 0x40)) *color = rand();
if (input_code_pressed(machine, KEYCODE_E) && (*color & 0x80)) *color = rand();
#endif
int pri = 0x20 | ((*color & 0x60) >> 2);
- if (pri <= state->layerpri[2])
+ if (pri <= state->layerpri[2])
*priority_mask = 0;
else if (pri > state->layerpri[2] && pri <= state->layerpri[1])
*priority_mask = 0xf0;
else if (pri > state->layerpri[1] && pri <= state->layerpri[0])
*priority_mask = 0xf0 | 0xcc;
- else
+ else
*priority_mask = 0xf0 | 0xcc | 0xaa;
*color = state->sprite_colorbase + (*color & 0x1f);
@@ -199,13 +199,13 @@ void prmrsocr_sprite_callback( running_machine *machine, int *code, int *color,
{
tmnt_state *state = (tmnt_state *)machine->driver_data;
int pri = 0x20 | ((*color & 0x60) >> 2);
- if (pri <= state->layerpri[2])
+ if (pri <= state->layerpri[2])
*priority_mask = 0;
else if (pri > state->layerpri[2] && pri <= state->layerpri[1])
*priority_mask = 0xf0;
else if (pri > state->layerpri[1] && pri <= state->layerpri[0])
*priority_mask = 0xf0 | 0xcc;
- else
+ else
*priority_mask = 0xf0 | 0xcc | 0xaa;
*code |= state->prmrsocr_sprite_bank << 14;
@@ -275,8 +275,8 @@ VIDEO_START( glfgreat )
state->roz_tilemap = tilemap_create(machine, glfgreat_get_roz_tile_info, tilemap_scan_rows, 16, 16, 512, 512);
tilemap_set_transparent_pen(state->roz_tilemap,0);
- state->glfgreat_roz_rom_bank = 0;
- state->glfgreat_roz_char_bank = 0;
+ state->glfgreat_roz_rom_bank = 0;
+ state->glfgreat_roz_char_bank = 0;
state->glfgreat_roz_rom_mode = 0;
state_save_register_global(machine, state->glfgreat_roz_rom_bank);
state_save_register_global(machine, state->glfgreat_roz_char_bank);
@@ -290,8 +290,8 @@ VIDEO_START( prmrsocr )
state->roz_tilemap = tilemap_create(machine, prmrsocr_get_roz_tile_info, tilemap_scan_rows, 16, 16, 512, 256);
tilemap_set_transparent_pen(state->roz_tilemap,0);
- state->prmrsocr_sprite_bank = 0;
- state->glfgreat_roz_char_bank = 0;
+ state->prmrsocr_sprite_bank = 0;
+ state->glfgreat_roz_char_bank = 0;
state_save_register_global(machine, state->prmrsocr_sprite_bank);
state_save_register_global(machine, state->glfgreat_roz_char_bank);
}
@@ -300,7 +300,7 @@ VIDEO_START( blswhstl )
{
tmnt_state *state = (tmnt_state *)machine->driver_data;
- state->blswhstl_rombank = -1;
+ state->blswhstl_rombank = -1;
state_save_register_global(machine, state->blswhstl_rombank);
}
@@ -678,9 +678,9 @@ READ16_HANDLER( glfgreat_ball_r )
popmessage("%04x", state->glfgreat_pixel);
#endif
/* if out of the ROZ layer palette range, it's in the water - return 0 */
- if (state->glfgreat_pixel < 0x400 || state->glfgreat_pixel >= 0x500)
+ if (state->glfgreat_pixel < 0x400 || state->glfgreat_pixel >= 0x500)
return 0;
- else
+ else
return state->glfgreat_pixel & 0xff;
}
@@ -750,7 +750,7 @@ VIDEO_UPDATE( tmnt2 )
if (newdim != state->lastdim || newen != state->lasten)
{
brt = 1.0;
- if (newen)
+ if (newen)
brt -= (1.0 - PALETTE_DEFAULT_SHADOW_FACTOR) * newdim / 8;
state->lastdim = newdim;
state->lasten = newen;
diff --git a/src/mame/video/topspeed.c b/src/mame/video/topspeed.c
index 1b5f373a124..4b7ed998d61 100644
--- a/src/mame/video/topspeed.c
+++ b/src/mame/video/topspeed.c
@@ -53,7 +53,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
priority = (data & 0x8000) >> 15;
// unknown = (data & 0x2000) >> 13;
- if (y == 0x180)
+ if (y == 0x180)
continue; /* dead sprite */
map_offset = tilenum << 7;
diff --git a/src/mame/video/vendetta.c b/src/mame/video/vendetta.c
index afdbececff1..c034a4fa712 100644
--- a/src/mame/video/vendetta.c
+++ b/src/mame/video/vendetta.c
@@ -33,13 +33,13 @@ void vendetta_sprite_callback( running_machine *machine, int *code, int *color,
{
vendetta_state *state = (vendetta_state *)machine->driver_data;
int pri = (*color & 0x03e0) >> 4; /* ??????? */
- if (pri <= state->layerpri[2])
+ if (pri <= state->layerpri[2])
*priority_mask = 0;
else if (pri > state->layerpri[2] && pri <= state->layerpri[1])
*priority_mask = 0xf0;
else if (pri > state->layerpri[1] && pri <= state->layerpri[0])
*priority_mask = 0xf0 | 0xcc;
- else
+ else
*priority_mask = 0xf0 | 0xcc | 0xaa;
*color = state->sprite_colorbase + (*color & 0x001f);
diff --git a/src/mame/video/wgp.c b/src/mame/video/wgp.c
index f911b8f26ac..16cad00302b 100644
--- a/src/mame/video/wgp.c
+++ b/src/mame/video/wgp.c
@@ -492,12 +492,12 @@ INLINE void bryan2_drawscanline( bitmap_t *bitmap, int x, int y, int length,
UINT16 *dsti = BITMAP_ADDR16(bitmap, y, x);
UINT8 *dstp = BITMAP_ADDR8(priority, y, x);
- if (transparent)
+ if (transparent)
{
- while (length--)
+ while (length--)
{
UINT32 spixel = *src++;
- if (spixel < 0x7fff)
+ if (spixel < 0x7fff)
{
*dsti = spixel;
*dstp = pri;
@@ -505,10 +505,10 @@ INLINE void bryan2_drawscanline( bitmap_t *bitmap, int x, int y, int length,
dsti++;
dstp++;
}
- }
+ }
else /* Not transparent case */
{
- while (length--)
+ while (length--)
{
*dsti++ = *src++;
*dstp++ = pri;
@@ -570,9 +570,9 @@ static void wgp_piv_layer_draw( running_machine *machine, bitmap_t *bitmap, cons
y_index = 0;
}
- if (!machine_flip)
- y = min_y;
- else
+ if (!machine_flip)
+ y = min_y;
+ else
y = max_y;
do
diff --git a/src/mame/video/xexex.c b/src/mame/video/xexex.c
index 8bfb2189c35..fc0d737fcf5 100644
--- a/src/mame/video/xexex.c
+++ b/src/mame/video/xexex.c
@@ -12,13 +12,13 @@ void xexex_sprite_callback( running_machine *machine, int *code, int *color, int
pri = (*color & 0x3e0) >> 4;
if (pri <= state->layerpri[3])
- *priority_mask = 0;
+ *priority_mask = 0;
else if (pri > state->layerpri[3] && pri <= state->layerpri[2])
- *priority_mask = 0xff00;
- else if (pri > state->layerpri[2] && pri <= state->layerpri[1])
- *priority_mask = 0xff00 | 0xf0f0;
- else if (pri > state->layerpri[1] && pri <= state->layerpri[0])
- *priority_mask = 0xff00 | 0xf0f0 | 0xcccc;
+ *priority_mask = 0xff00;
+ else if (pri > state->layerpri[2] && pri <= state->layerpri[1])
+ *priority_mask = 0xff00 | 0xf0f0;
+ else if (pri > state->layerpri[1] && pri <= state->layerpri[0])
+ *priority_mask = 0xff00 | 0xf0f0 | 0xcccc;
else
*priority_mask = 0xff00 | 0xf0f0 | 0xcccc | 0xaaaa;
diff --git a/src/mame/video/xmen.c b/src/mame/video/xmen.c
index 3515c8df8c7..b0ffad29e8b 100644
--- a/src/mame/video/xmen.c
+++ b/src/mame/video/xmen.c
@@ -31,13 +31,13 @@ void xmen_sprite_callback( running_machine *machine, int *code, int *color, int
xmen_state *state = (xmen_state *)machine->driver_data;
int pri = (*color & 0x00e0) >> 4; /* ??????? */
- if (pri <= state->layerpri[2])
+ if (pri <= state->layerpri[2])
*priority_mask = 0;
else if (pri > state->layerpri[2] && pri <= state->layerpri[1])
*priority_mask = 0xf0;
else if (pri > state->layerpri[1] && pri <= state->layerpri[0])
*priority_mask = 0xf0 | 0xcc;
- else
+ else
*priority_mask = 0xf0 | 0xcc | 0xaa;
*color = state->sprite_colorbase + (*color & 0x001f);
diff --git a/src/osd/sdl/SDL1211_opengl.h b/src/osd/sdl/SDL1211_opengl.h
index aba8e602890..5e163d8027d 100644
--- a/src/osd/sdl/SDL1211_opengl.h
+++ b/src/osd/sdl/SDL1211_opengl.h
@@ -21,7 +21,7 @@
*/
/* This is a simple file to encapsulate the OpenGL API headers */
-
+
#include <SDL/SDL_config.h>
#ifdef __WIN32__
@@ -68,21 +68,21 @@ extern "C" {
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
+**
** http://oss.sgi.com/projects/FreeB
-**
+**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
+**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
-**
+**
** Additional Notice Provisions: This software was created using the
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
** not been independently verified as being compliant with the OpenGL(R)
diff --git a/src/osd/sdl/blit13.h b/src/osd/sdl/blit13.h
index c40aa319b04..12b45d2269d 100644
--- a/src/osd/sdl/blit13.h
+++ b/src/osd/sdl/blit13.h
@@ -11,10 +11,10 @@ INLINE UINT32 premult32(UINT32 pixel)
UINT8 r = (pixel >> 16) & 0xff;
UINT8 g = (pixel >> 8) & 0xff;
UINT8 b = (pixel >> 0) & 0xff;
-
+
return 0xFF000000 |
(((UINT16)r * (UINT16)a) / 255) << 16 |
- (((UINT16)g * (UINT16)a) / 255) << 8 |
+ (((UINT16)g * (UINT16)a) / 255) << 8 |
(((UINT16)b * (UINT16)a) / 255);
}
@@ -85,9 +85,9 @@ INLINE UINT32 pixel_ycc_to_rgb_pal(UINT16 *pixel, const rgb_t *palette)
#define OP_YUV16PAL_UYVY(_src) ((texsource->palette[((_src) >> 8) & 0xff] << 8) | ((_src) & 0x00ff))
-#define OP_YUV16PAL_YVYU(_src) ((texsource->palette[((_src) >> 8) & 0xff] & 0xff) | ((_src & 0xff) << 8))
+#define OP_YUV16PAL_YVYU(_src) ((texsource->palette[((_src) >> 8) & 0xff] & 0xff) | ((_src & 0xff) << 8))
-#define OP_YUV16_YVYU(_src) ((((_src) >> 8) & 0xff) | ((_src & 0xff) << 8))
+#define OP_YUV16_YVYU(_src) ((((_src) >> 8) & 0xff) | ((_src & 0xff) << 8))
#define OP_YUV16_YUY2(_src) ( ((_src) & 0xff00ff00) | \
(((_src)>>16)&0xff) | (((_src)<<16)&0xff0000) )
diff --git a/src/osd/sdl/debugwin.c b/src/osd/sdl/debugwin.c
index c4fade92030..f44fb75926a 100644
--- a/src/osd/sdl/debugwin.c
+++ b/src/osd/sdl/debugwin.c
@@ -80,7 +80,7 @@ typedef struct memorycombo_item
char name[256];
UINT8 prefsize;
running_machine *machine; // machine
- const memory_subview_item *subview; // subview
+ const memory_subview_item *subview; // subview
const device_config *device; // CPU device
} memorycombo_item;
@@ -102,7 +102,7 @@ static void debugwin_show(int show)
void (*f)(GtkWidget *widget) = show ? gtk_widget_show : gtk_widget_hide;
if(dmain) {
f(dmain->win);
- // dview_set_updatable(dmain->console_w, show);
+ // dview_set_updatable(dmain->console_w, show);
}
for(p1 = memorywin_list; p1; p1 = p1->next)
f(p1->win);
@@ -146,7 +146,7 @@ static void edit_activate(GtkEntry *item, gpointer user_data)
edit_add_hist(e, text);
e->cb(e->machine, text, e->cbp);
edit_set_field(e);
-
+
}
static void edit_hist_back(edit *e)
@@ -283,14 +283,14 @@ void debugmain_comments_activate(GtkMenuItem *item, gpointer user_data)
static void debugmain_set_cpu(const device_config *cpu)
{
- if (cpu != dmain->cpu)
+ if (cpu != dmain->cpu)
{
char title[256];
const registers_subview_item *regsubitem;
const disasm_subview_item *dasmsubitem;
dmain->cpu = cpu;
-
+
// first set all the views to the new cpu
for (dasmsubitem = disasm_view_get_subview_list(dmain->disasm); dasmsubitem != NULL; dasmsubitem = dasmsubitem->next)
if (dasmsubitem->space->cpu == cpu)
@@ -318,7 +318,7 @@ static void debugmain_set_cpu(const device_config *cpu)
void osd_wait_for_debugger(const device_config *device, int firststop)
{
// create a console window
- if(!dmain)
+ if(!dmain)
{
// GTK init should probably be done earlier
gtk_init(0, 0);
@@ -375,7 +375,7 @@ static void debugmain_init(running_machine *machine)
debug_view_begin_update(dmain->disasm);
disasm_view_set_expression(dmain->disasm, "curpc");
-// debug_view_set_property_UINT32(dmain->disasm, DVP_DASM_TRACK_LIVE, 1);
+// debug_view_set_property_UINT32(dmain->disasm, DVP_DASM_TRACK_LIVE, 1);
debug_view_end_update(dmain->disasm);
g_signal_connect(dmain->win, "destroy", G_CALLBACK(debugmain_destroy), dmain);
@@ -409,7 +409,7 @@ static void memorywin_zone_changed(GtkComboBox *zone_w, memorywin_i *mem)
memorywin_update_checks(mem);
// update the window title
- subview = memory_view_get_current_subview(mem->memory);
+ subview = memory_view_get_current_subview(mem->memory);
sprintf(title, "Memory: %s", subview->name);
gtk_window_set_title(GTK_WINDOW(mem->win), title);
@@ -507,7 +507,7 @@ static void disasmwin_cpu_changed(GtkComboBox *cpu_w, disasmwin_i *dis)
disasmwin_update_checks(dis);
- subview = disasm_view_get_current_subview(dis->disasm);
+ subview = disasm_view_get_current_subview(dis->disasm);
sprintf(title, "Disassembly: %s", subview->name);
gtk_window_set_title(GTK_WINDOW(dis->win), title);
}
@@ -587,7 +587,7 @@ static void disasmwin_new(running_machine *machine)
debug_view_begin_update(dis->disasm);
disasm_view_set_expression(dis->disasm, "curpc");
-// debug_view_set_property_UINT32(dis->disasm, DVP_DASM_TRACK_LIVE, 1);
+// debug_view_set_property_UINT32(dis->disasm, DVP_DASM_TRACK_LIVE, 1);
debug_view_end_update(dis->disasm);
// populate the combobox
@@ -604,7 +604,7 @@ static void disasmwin_new(running_machine *machine)
gtk_combo_box_set_active(dis->cpu_w, cursel);
disasm_view_set_subview(dis->disasm, cursel);
- subview = disasm_view_get_current_subview(dis->disasm);
+ subview = disasm_view_get_current_subview(dis->disasm);
sprintf(title, "Disassembly: %s", subview->name);
gtk_window_set_title(GTK_WINDOW(dis->win), title);
@@ -613,7 +613,7 @@ static void disasmwin_new(running_machine *machine)
g_signal_connect(lookup_widget(dis->win, "enc_opcodes"), "activate", G_CALLBACK(disasmwin_enc_opcodes_activate), dis);
g_signal_connect(lookup_widget(dis->win, "comments"), "activate", G_CALLBACK(disasmwin_comments_activate), dis);
- // g_signal_connect(dis->edit_w, "activate", G_CALLBACK(disasmwin_process_string), dis);
+ // g_signal_connect(dis->edit_w, "activate", G_CALLBACK(disasmwin_process_string), dis);
g_signal_connect(dis->win, "destroy", G_CALLBACK(disasmwin_destroy), dis);
gtk_widget_show_all(dis->win);
}
@@ -757,7 +757,7 @@ void on_reverse_activate(GtkMenuItem *item, gpointer user_data)
memorywin_i *info = (memorywin_i *) user_data;
debug_view_begin_update(info->memory);
memory_view_set_reverse(info->memory, gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(lookup_widget(info->win, "reverse"))));
-
+
debug_view_end_update(info->memory);
}
diff --git a/src/osd/sdl/draw13.c b/src/osd/sdl/draw13.c
index fc49eed1693..ebfed185525 100644
--- a/src/osd/sdl/draw13.c
+++ b/src/osd/sdl/draw13.c
@@ -1,5 +1,5 @@
//============================================================
-//
+//
// draw13.c - SDL 1.3 drawing implementation
//
// Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team.
@@ -97,11 +97,11 @@ struct _copy_info {
struct _texture_info
{
texture_info * next; // next texture in the list
-
+
HashT hash; // hash value for the texture (must be >= pointer size)
UINT32 flags; // rendering flags
render_texinfo texinfo; // copy of the texture info
-
+
int rawwidth, rawheight;// raw width/height of the texture
int format; // texture format
@@ -110,13 +110,13 @@ struct _texture_info
int pixels_own; // do we own / allocated it ?
SDL_TextureID texture_id;
-
+
copy_info *copyinfo;
Uint32 sdl_access;
Uint32 sdl_blendmode;
quad_setup_data setup;
int is_rotated;
-
+
osd_ticks_t last_access;
};
@@ -124,16 +124,16 @@ struct _texture_info
typedef struct _sdl_info sdl_info;
struct _sdl_info
{
- INT32 blittimer;
+ INT32 blittimer;
UINT32 extra_flags;
texture_info * texlist; // list of active textures
- INT32 texture_max_width; // texture maximum width
- INT32 texture_max_height; // texture maximum height
+ INT32 texture_max_width; // texture maximum width
+ INT32 texture_max_height; // texture maximum height
float last_hofs;
float last_vofs;
-
+
// Stats
INT64 last_blit_time;
INT64 last_blit_pixels;
@@ -178,7 +178,7 @@ static texture_info * texture_update(sdl_window_info *window, const render_primi
//============================================================
#define SDL_TEXFORMAT_LAST SDL_TEXFORMAT_PALETTE16A
-#define BM_ALL (-1)
+#define BM_ALL (-1)
//( SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD)
#define texcopy_NULL NULL
@@ -186,107 +186,107 @@ static texture_info * texture_update(sdl_window_info *window, const render_primi
#define ENTRY_BM(a,b,c,d,f,bm) { SDL_TEXFORMAT_ ## a, SDL_PIXELFORMAT_ ## b, c, d, texcopy_ ## f, bm, #a, #b, 0, 0, 0, 0}
#define ENTRY_LR(a,b,c,d,f) { SDL_TEXFORMAT_ ## a, SDL_PIXELFORMAT_ ## b, c, d, texcopy_ ## f, BM_ALL, #a, #b, 0, 0, 0, -1}
-static copy_info blit_info_default[] =
+static copy_info blit_info_default[] =
{
/* no rotation */
- ENTRY(ARGB32, ARGB8888, 4, 0, NULL),
- ENTRY_LR(ARGB32, RGB888, 4, 0, argb32_rgb32),
+ ENTRY(ARGB32, ARGB8888, 4, 0, NULL),
+ ENTRY_LR(ARGB32, RGB888, 4, 0, argb32_rgb32),
/* Entry for primarily for directfb */
- ENTRY_BM(ARGB32, RGB888, 4, 0, argb32_rgb32, SDL_BLENDMODE_ADD),
- ENTRY_BM(ARGB32, RGB888, 4, 0, argb32_rgb32, SDL_BLENDMODE_MOD),
- ENTRY_BM(ARGB32, RGB888, 4, 0, argb32_rgb32, SDL_BLENDMODE_NONE),
+ ENTRY_BM(ARGB32, RGB888, 4, 0, argb32_rgb32, SDL_BLENDMODE_ADD),
+ ENTRY_BM(ARGB32, RGB888, 4, 0, argb32_rgb32, SDL_BLENDMODE_MOD),
+ ENTRY_BM(ARGB32, RGB888, 4, 0, argb32_rgb32, SDL_BLENDMODE_NONE),
- ENTRY(RGB32, ARGB8888, 4, 0, rgb32_argb32),
- ENTRY(RGB32, RGB888, 4, 0, NULL),
+ ENTRY(RGB32, ARGB8888, 4, 0, rgb32_argb32),
+ ENTRY(RGB32, RGB888, 4, 0, NULL),
- ENTRY(RGB32_PALETTED, ARGB8888, 4, 0, rgb32pal_argb32),
+ ENTRY(RGB32_PALETTED, ARGB8888, 4, 0, rgb32pal_argb32),
ENTRY(RGB32_PALETTED, RGB888, 4, 0, rgb32pal_argb32),
- ENTRY(YUY16, UYVY, 2, 0, NULL /* yuv16_uyvy*/),
- ENTRY(YUY16, YUY2, 2, 0, yuv16_yuy2),
- ENTRY(YUY16, YVYU, 2, 0, yuv16_yvyu),
- ENTRY(YUY16, ARGB8888, 4, 0, yuv16_argb32),
- ENTRY(YUY16, RGB888, 4, 0, yuv16pal_argb32),
-
- ENTRY(YUY16_PALETTED, UYVY, 2, 0, yuv16pal_uyvy),
- ENTRY(YUY16_PALETTED, YUY2, 2, 0, yuv16pal_yuy2),
- ENTRY(YUY16_PALETTED, YVYU, 2, 0, yuv16pal_yvyu),
- ENTRY(YUY16_PALETTED, ARGB8888, 4, 0, yuv16pal_argb32),
- ENTRY(YUY16_PALETTED, RGB888, 4, 0, yuv16pal_argb32),
+ ENTRY(YUY16, UYVY, 2, 0, NULL /* yuv16_uyvy*/),
+ ENTRY(YUY16, YUY2, 2, 0, yuv16_yuy2),
+ ENTRY(YUY16, YVYU, 2, 0, yuv16_yvyu),
+ ENTRY(YUY16, ARGB8888, 4, 0, yuv16_argb32),
+ ENTRY(YUY16, RGB888, 4, 0, yuv16pal_argb32),
- ENTRY(PALETTE16, ARGB8888, 4, 0, pal16_argb32),
- ENTRY(PALETTE16, RGB888, 4, 0, pal16_argb32),
+ ENTRY(YUY16_PALETTED, UYVY, 2, 0, yuv16pal_uyvy),
+ ENTRY(YUY16_PALETTED, YUY2, 2, 0, yuv16pal_yuy2),
+ ENTRY(YUY16_PALETTED, YVYU, 2, 0, yuv16pal_yvyu),
+ ENTRY(YUY16_PALETTED, ARGB8888, 4, 0, yuv16pal_argb32),
+ ENTRY(YUY16_PALETTED, RGB888, 4, 0, yuv16pal_argb32),
- ENTRY(RGB15, RGB555, 2, 0, NULL /* rgb15_argb1555 */),
- ENTRY(RGB15, ARGB1555, 2, 0, rgb15_argb1555),
- ENTRY(RGB15, ARGB8888, 4, 0, rgb15_argb32),
- ENTRY(RGB15, RGB888, 4, 0, rgb15_argb32),
+ ENTRY(PALETTE16, ARGB8888, 4, 0, pal16_argb32),
+ ENTRY(PALETTE16, RGB888, 4, 0, pal16_argb32),
- ENTRY(RGB15_PALETTED, ARGB8888, 4, 0, rgb15pal_argb32),
- ENTRY(RGB15_PALETTED, RGB888, 4, 0, rgb15pal_argb32),
+ ENTRY(RGB15, RGB555, 2, 0, NULL /* rgb15_argb1555 */),
+ ENTRY(RGB15, ARGB1555, 2, 0, rgb15_argb1555),
+ ENTRY(RGB15, ARGB8888, 4, 0, rgb15_argb32),
+ ENTRY(RGB15, RGB888, 4, 0, rgb15_argb32),
- ENTRY(PALETTE16A, ARGB8888, 4, 0, pal16a_argb32),
- ENTRY(PALETTE16A, RGB888, 4, 0, pal16a_rgb32),
+ ENTRY(RGB15_PALETTED, ARGB8888, 4, 0, rgb15pal_argb32),
+ ENTRY(RGB15_PALETTED, RGB888, 4, 0, rgb15pal_argb32),
+
+ ENTRY(PALETTE16A, ARGB8888, 4, 0, pal16a_argb32),
+ ENTRY(PALETTE16A, RGB888, 4, 0, pal16a_rgb32),
/* rotation */
- ENTRY(ARGB32, ARGB8888, 4, 1, rot_argb32_argb32),
- ENTRY_LR(ARGB32, RGB888, 4, 1, rot_argb32_rgb32),
+ ENTRY(ARGB32, ARGB8888, 4, 1, rot_argb32_argb32),
+ ENTRY_LR(ARGB32, RGB888, 4, 1, rot_argb32_rgb32),
/* Entry for primarily for directfb */
- ENTRY_BM(ARGB32, RGB888, 4, 1, rot_argb32_rgb32, SDL_BLENDMODE_ADD),
- ENTRY_BM(ARGB32, RGB888, 4, 1, rot_argb32_rgb32, SDL_BLENDMODE_MOD),
- ENTRY_BM(ARGB32, RGB888, 4, 1, rot_argb32_rgb32, SDL_BLENDMODE_NONE),
+ ENTRY_BM(ARGB32, RGB888, 4, 1, rot_argb32_rgb32, SDL_BLENDMODE_ADD),
+ ENTRY_BM(ARGB32, RGB888, 4, 1, rot_argb32_rgb32, SDL_BLENDMODE_MOD),
+ ENTRY_BM(ARGB32, RGB888, 4, 1, rot_argb32_rgb32, SDL_BLENDMODE_NONE),
- ENTRY(RGB32, ARGB8888, 4, 1, rot_rgb32_argb32),
- ENTRY(RGB32, RGB888, 4, 1, rot_argb32_argb32),
+ ENTRY(RGB32, ARGB8888, 4, 1, rot_rgb32_argb32),
+ ENTRY(RGB32, RGB888, 4, 1, rot_argb32_argb32),
- ENTRY(RGB32_PALETTED, ARGB8888, 4, 1, rot_rgb32pal_argb32),
+ ENTRY(RGB32_PALETTED, ARGB8888, 4, 1, rot_rgb32pal_argb32),
ENTRY(RGB32_PALETTED, RGB888, 4, 1, rot_rgb32pal_argb32),
- ENTRY(YUY16, ARGB8888, 4, 1, rot_yuv16_argb32),
- ENTRY(YUY16, RGB888, 4, 1, rot_yuv16_argb32),
-
- ENTRY(YUY16_PALETTED, ARGB8888, 4, 1, rot_yuv16pal_argb32),
- ENTRY(YUY16_PALETTED, RGB888, 4, 1, rot_yuv16pal_argb32),
+ ENTRY(YUY16, ARGB8888, 4, 1, rot_yuv16_argb32),
+ ENTRY(YUY16, RGB888, 4, 1, rot_yuv16_argb32),
+
+ ENTRY(YUY16_PALETTED, ARGB8888, 4, 1, rot_yuv16pal_argb32),
+ ENTRY(YUY16_PALETTED, RGB888, 4, 1, rot_yuv16pal_argb32),
- ENTRY(PALETTE16, ARGB8888, 4, 1, rot_pal16_argb32),
- ENTRY(PALETTE16, RGB888, 4, 1, rot_pal16_argb32),
+ ENTRY(PALETTE16, ARGB8888, 4, 1, rot_pal16_argb32),
+ ENTRY(PALETTE16, RGB888, 4, 1, rot_pal16_argb32),
- ENTRY(RGB15, RGB555, 2, 1, rot_rgb15_argb1555),
- ENTRY(RGB15, ARGB1555, 2, 1, rot_rgb15_argb1555),
- ENTRY(RGB15, ARGB8888, 4, 1, rot_rgb15_argb32),
- ENTRY(RGB15, RGB888, 4, 1, rot_rgb15_argb32),
+ ENTRY(RGB15, RGB555, 2, 1, rot_rgb15_argb1555),
+ ENTRY(RGB15, ARGB1555, 2, 1, rot_rgb15_argb1555),
+ ENTRY(RGB15, ARGB8888, 4, 1, rot_rgb15_argb32),
+ ENTRY(RGB15, RGB888, 4, 1, rot_rgb15_argb32),
- ENTRY(RGB15_PALETTED, ARGB8888, 4, 1, rot_rgb15pal_argb32),
- ENTRY(RGB15_PALETTED, RGB888, 4, 1, rot_rgb15pal_argb32),
+ ENTRY(RGB15_PALETTED, ARGB8888, 4, 1, rot_rgb15pal_argb32),
+ ENTRY(RGB15_PALETTED, RGB888, 4, 1, rot_rgb15pal_argb32),
- ENTRY(PALETTE16A, ARGB8888, 4, 1, rot_pal16a_argb32),
- ENTRY(PALETTE16A, RGB888, 4, 1, rot_pal16a_rgb32),
+ ENTRY(PALETTE16A, ARGB8888, 4, 1, rot_pal16a_argb32),
+ ENTRY(PALETTE16A, RGB888, 4, 1, rot_pal16a_rgb32),
{ -1 },
};
-static copy_info blit_info_16bpp[] =
+static copy_info blit_info_16bpp[] =
{
/* no rotation */
- ENTRY(PALETTE16, RGB555, 2, 0, pal16_argb1555),
- ENTRY(PALETTE16, ARGB1555, 2, 0, pal16_argb1555),
+ ENTRY(PALETTE16, RGB555, 2, 0, pal16_argb1555),
+ ENTRY(PALETTE16, ARGB1555, 2, 0, pal16_argb1555),
- ENTRY(RGB15_PALETTED, RGB555, 2, 0, rgb15pal_argb1555),
- ENTRY(RGB15_PALETTED, ARGB1555, 2, 0, rgb15pal_argb1555),
+ ENTRY(RGB15_PALETTED, RGB555, 2, 0, rgb15pal_argb1555),
+ ENTRY(RGB15_PALETTED, ARGB1555, 2, 0, rgb15pal_argb1555),
/* rotation */
- ENTRY(PALETTE16, RGB555, 2, 1, rot_pal16_argb1555),
- ENTRY(PALETTE16, ARGB1555, 2, 1, rot_pal16_argb1555),
+ ENTRY(PALETTE16, RGB555, 2, 1, rot_pal16_argb1555),
+ ENTRY(PALETTE16, ARGB1555, 2, 1, rot_pal16_argb1555),
- ENTRY(RGB15_PALETTED, RGB555, 2, 1, rot_rgb15pal_argb1555),
- ENTRY(RGB15_PALETTED, ARGB1555, 2, 1, rot_rgb15pal_argb1555),
+ ENTRY(RGB15_PALETTED, RGB555, 2, 1, rot_rgb15pal_argb1555),
+ ENTRY(RGB15_PALETTED, ARGB1555, 2, 1, rot_rgb15pal_argb1555),
{ -1 },
};
static copy_info *blit_info[SDL_TEXFORMAT_LAST+1];
-static struct
+static struct
{
Uint32 format;
int status;
@@ -314,15 +314,15 @@ INLINE Uint32 map_blendmode(int blendmode)
{
case BLENDMODE_NONE:
return SDL_BLENDMODE_NONE;
- case BLENDMODE_ALPHA:
+ case BLENDMODE_ALPHA:
return SDL_BLENDMODE_BLEND;
- case BLENDMODE_RGB_MULTIPLY:
+ case BLENDMODE_RGB_MULTIPLY:
return SDL_BLENDMODE_MOD;
- case BLENDMODE_ADD:
+ case BLENDMODE_ADD:
return SDL_BLENDMODE_ADD;
default:
mame_printf_warning("Unknown Blendmode %d", blendmode);
- }
+ }
return SDL_BLENDMODE_NONE;
}
@@ -332,29 +332,29 @@ INLINE void set_coloralphamode(SDL_TextureID texture_id, const render_color *col
UINT32 sg = (UINT32)(255.0f * color->g);
UINT32 sb = (UINT32)(255.0f * color->b);
UINT32 sa = (UINT32)(255.0f * color->a);
-
-
+
+
if (color->r >= 1.0f && color->g >= 1.0f && color->b >= 1.0f && IS_OPAQUE(color->a))
{
SDL_SetTextureColorMod(texture_id, 0xFF, 0xFF, 0xFF);
- SDL_SetTextureAlphaMod(texture_id, 0xFF);
+ SDL_SetTextureAlphaMod(texture_id, 0xFF);
}
/* coloring-only case */
else if (IS_OPAQUE(color->a))
{
SDL_SetTextureColorMod(texture_id, sr, sg, sb);
- SDL_SetTextureAlphaMod(texture_id, 0xFF);
+ SDL_SetTextureAlphaMod(texture_id, 0xFF);
}
/* alpha and/or coloring case */
else if (!IS_TRANSPARENT(color->a))
{
SDL_SetTextureColorMod(texture_id, sr, sg, sb);
- SDL_SetTextureAlphaMod(texture_id, sa);
+ SDL_SetTextureAlphaMod(texture_id, sa);
}
- else
+ else
{
SDL_SetTextureColorMod(texture_id, 0xFF, 0xFF, 0xFF);
- SDL_SetTextureAlphaMod(texture_id, 0xFF);
+ SDL_SetTextureAlphaMod(texture_id, 0xFF);
}
}
@@ -362,12 +362,12 @@ INLINE void render_quad(sdl_info *sdl, texture_info *texture, render_primitive *
{
SDL_TextureID texture_id;
SDL_Rect target_rect;
-
+
target_rect.x = x;
target_rect.y = y;
target_rect.w = round_nearest(prim->bounds.x1 - prim->bounds.x0);
target_rect.h = round_nearest(prim->bounds.y1 - prim->bounds.y0);
-
+
if (texture)
{
texture_id = texture->texture_id;
@@ -383,7 +383,7 @@ INLINE void render_quad(sdl_info *sdl, texture_info *texture, render_primitive *
}
SDL_SetTextureBlendMode(texture_id, texture->sdl_blendmode);
set_coloralphamode(texture_id, &prim->color);
- SDL_RenderCopy(texture_id, NULL, &target_rect);
+ SDL_RenderCopy(texture_id, NULL, &target_rect);
texture->copyinfo->time += osd_ticks();
texture->copyinfo->pixel_count += MAX(STAT_PIXEL_THRESHOLD , (texture->rawwidth * texture->rawheight));
@@ -412,9 +412,9 @@ static int RendererSupportsFormat(Uint32 format, Uint32 access, const char *sfor
{
struct SDL_RendererInfo render_info;
int i;
-
+
SDL_GetRendererInfo(&render_info);
-
+
for (i=0; i < render_info.num_texture_formats; i++)
{
if (format == render_info.texture_formats[i])
@@ -445,11 +445,11 @@ static int RendererSupportsFormat(Uint32 format, Uint32 access, const char *sfor
SDL_DestroyTexture(texid);
return 1;
}
- mame_printf_verbose("Pixelformat <%s> error %s \n", sformat, SDL_GetError());
+ mame_printf_verbose("Pixelformat <%s> error %s \n", sformat, SDL_GetError());
mame_printf_verbose("Pixelformat <%s> not supported\n", sformat);
fmt_support[i].status = 0;
return 0;
-}
+}
#endif
//============================================================
@@ -469,7 +469,7 @@ static void add_list(copy_info **head, copy_info *element, Uint32 bm)
static void expand_copy_info(copy_info *list)
{
copy_info *bi;
-
+
for (bi = list; bi->src_fmt != -1; bi++)
{
if (bi->bm_mask == BM_ALL)
@@ -487,13 +487,13 @@ static void expand_copy_info(copy_info *list)
int draw13_init(sdl_draw_info *callbacks)
{
const char *stemp;
-
+
// fill in the callbacks
callbacks->exit = draw13_exit;
callbacks->attach = draw13_attach;
mame_printf_verbose("Using SDL native texturing driver (SDL 1.3+)\n");
-
+
expand_copy_info(blit_info_default);
//FIXME: -opengl16 should be -opengl -prefer16bpp
//if (video_config.prefer16bpp_tex)
@@ -510,7 +510,7 @@ int draw13_init(sdl_draw_info *callbacks)
mame_printf_verbose("Warning: Unable to load opengl library: %s\n", stemp ? stemp : "<default>");
else
mame_printf_verbose("Loaded opengl shared library: %s\n", stemp ? stemp : "<default>");
-
+
return 0;
}
@@ -527,7 +527,7 @@ static void draw13_exit(void)
for (bi = blit_info[i]; bi != NULL; )
{
if (bi->pixel_count)
- mame_printf_verbose("%s -> %s %s blendmode 0x%02x, %d samples: %d KPixel/sec\n", bi->srcname, bi->dstname,
+ mame_printf_verbose("%s -> %s %s blendmode 0x%02x, %d samples: %d KPixel/sec\n", bi->srcname, bi->dstname,
bi->rotate ? "rot" : "norot", bi->bm_mask, bi->samples,
(int) bi->perf);
freeme = bi;
@@ -569,13 +569,13 @@ static int draw13_window_create(sdl_window_info *window, int width, int height)
window->dxdata = sdl;
- sdl->extra_flags = (window->fullscreen ?
+ sdl->extra_flags = (window->fullscreen ?
SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_FOCUS | SDL_WINDOW_FULLSCREEN: SDL_WINDOW_RESIZABLE);
// create the SDL window
SDL_SelectVideoDisplay(window->monitor->handle);
- if (window->fullscreen && video_config.switchres)
+ if (window->fullscreen && video_config.switchres)
{
SDL_DisplayMode mode;
SDL_GetCurrentDisplayMode(&mode);
@@ -607,7 +607,7 @@ static int draw13_window_create(sdl_window_info *window, int width, int height)
}
else
SDL_SetWindowDisplayMode(window->window_id, NULL); // Use desktop
-
+
window->window_id = SDL_CreateWindow(window->title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
width, height, sdl->extra_flags);
@@ -615,21 +615,21 @@ static int draw13_window_create(sdl_window_info *window, int width, int height)
//SDL_SetWindowFullscreen(window->window_id, window->fullscreen);
SDL_RaiseWindow(window->window_id);
SDL_GetWindowSize(window->window_id, &window->width, &window->height);
-
+
// create renderer
-
- if (video_config.waitvsync)
+
+ if (video_config.waitvsync)
result = SDL_CreateRenderer(window->window_id, -1, SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC);
else
result = SDL_CreateRenderer(window->window_id, -1, SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTDISCARD);
-
+
if (result)
{
fatalerror("Error on creating renderer: %s \n", SDL_GetError());
}
-
+
SDL_SelectRenderer(window->window_id);
-
+
sdl->blittimer = 3;
// in case any textures try to come up before these are validated,
@@ -652,7 +652,7 @@ static void draw13_window_resize(sdl_window_info *window, int width, int height)
SDL_SetWindowSize(window->window_id, width, height);
SDL_GetWindowSize(window->window_id, &window->width, &window->height);
sdl->blittimer = 3;
-
+
}
//============================================================
@@ -748,7 +748,7 @@ static int draw13_window_draw(sdl_window_info *window, UINT32 dc, int update)
sdl->last_hofs = hofs;
sdl->last_vofs = vofs;
-
+
osd_lock_acquire(window->primlist->lock);
// now draw
@@ -773,7 +773,7 @@ static int draw13_window_draw(sdl_window_info *window, UINT32 dc, int update)
texture = texture_update(window, prim);
if (texture)
blit_pixels += (texture->rawheight * texture->rawwidth);
- render_quad(sdl, texture, prim,
+ render_quad(sdl, texture, prim,
round_nearest(hofs + prim->bounds.x0),
round_nearest(vofs + prim->bounds.y0));
break;
@@ -839,13 +839,13 @@ static copy_info *texture_compute_size_type(const render_texinfo *texsource, tex
copy_info *result = NULL;
int maxperf = 0;
//int bm = PRIMFLAG_GET_BLENDMODE(flags);
-
+
for (bi = blit_info[texture->format]; bi != NULL; bi = bi->next)
{
- if ((texture->is_rotated == bi->rotate)
+ if ((texture->is_rotated == bi->rotate)
&& (texture->sdl_blendmode == bi->bm_mask))
{
- if (RendererSupportsFormat(bi->dst_fmt, texture->sdl_access, bi->dstname))
+ if (RendererSupportsFormat(bi->dst_fmt, texture->sdl_access, bi->dstname))
{
if (bi->perf == 0)
return bi;
@@ -862,9 +862,9 @@ static copy_info *texture_compute_size_type(const render_texinfo *texsource, tex
/* try last resort handlers */
for (bi = blit_info[texture->format]; bi != NULL; bi = bi->next)
{
- if ((texture->is_rotated == bi->rotate)
+ if ((texture->is_rotated == bi->rotate)
&& (texture->sdl_blendmode == bi->bm_mask))
- if (RendererSupportsFormat(bi->dst_fmt, texture->sdl_access, bi->dstname))
+ if (RendererSupportsFormat(bi->dst_fmt, texture->sdl_access, bi->dstname))
return bi;
}
//FIXME: crash implement a -do nothing handler */
@@ -879,7 +879,7 @@ static texture_info *texture_create(sdl_window_info *window, const render_texinf
{
sdl_info *sdl = (sdl_info *) window->dxdata;
texture_info *texture;
-
+
// allocate a new texture
texture = (texture_info *) osd_malloc(sizeof(*texture));
memset(texture, 0, sizeof(*texture));
@@ -892,7 +892,7 @@ static texture_info *texture_create(sdl_window_info *window, const render_texinf
texture->is_rotated = FALSE;
texture->setup = *setup;
texture->sdl_blendmode = map_blendmode(PRIMFLAG_GET_BLENDMODE(flags));
-
+
switch (PRIMFLAG_GET_TEXFORMAT(flags))
{
case TEXFORMAT_ARGB32:
@@ -925,24 +925,24 @@ static texture_info *texture_create(sdl_window_info *window, const render_texinf
texture->is_rotated = TRUE;
else
texture->is_rotated = FALSE;
-
+
//texture->sdl_access = SDL_TEXTUREACCESS_STATIC;
texture->sdl_access = SDL_TEXTUREACCESS_STREAMING;
// Watch out for 0x0 textures ...
if (!texture->setup.rotwidth || !texture->setup.rotheight)
mame_printf_warning("Trying to create texture with zero dim\n");
-
+
// compute the size
texture->copyinfo = texture_compute_size_type(texsource, texture, flags);
- texture->texture_id = SDL_CreateTexture(texture->copyinfo->dst_fmt, texture->sdl_access,
+ texture->texture_id = SDL_CreateTexture(texture->copyinfo->dst_fmt, texture->sdl_access,
texture->setup.rotwidth, texture->setup.rotheight);
-
+
if (!texture->texture_id)
mame_printf_error("Error creating texture: %d x %d, pixelformat %s error: %s\n", texture->setup.rotwidth, texture->setup.rotheight,
texture->copyinfo->dstname, SDL_GetError());
-
+
if ( (texture->copyinfo->func != NULL) && (texture->sdl_access == SDL_TEXTUREACCESS_STATIC))
{
texture->pixels = osd_malloc(texture->setup.rotwidth * texture->setup.rotheight * texture->copyinfo->dst_bpp);
@@ -970,8 +970,8 @@ static void texture_set_data(sdl_info *sdl, texture_info *texture, const render_
{
texture->pitch = texture->setup.rotwidth * texture->copyinfo->dst_bpp;
texture->copyinfo->func(texture, texsource);
- }
- else
+ }
+ else
{
texture->pixels = texsource->base;
texture->pitch = texture->texinfo.rowpixels * texture->copyinfo->dst_bpp;
@@ -983,7 +983,7 @@ static void texture_set_data(sdl_info *sdl, texture_info *texture, const render_
SDL_LockTexture(texture->texture_id, NULL, 1, (void **) &texture->pixels, &texture->pitch);
if ( texture->copyinfo->func )
texture->copyinfo->func(texture, texsource);
- else
+ else
{
UINT8 *src = (UINT8 *) texsource->base;
UINT8 *dst = (UINT8 *) texture->pixels;
@@ -1009,7 +1009,7 @@ static void compute_setup(sdl_info *sdl, const render_primitive *prim, quad_setu
{
const render_quad_texuv *texcoords = &prim->texcoords;
int texwidth = prim->texture.width;
- int texheight = prim->texture.height;
+ int texheight = prim->texture.height;
float fdudx, fdvdx, fdudy, fdvdy;
float width, height;
float fscale;
@@ -1023,9 +1023,9 @@ static void compute_setup(sdl_info *sdl, const render_primitive *prim, quad_setu
fdvdx = (texcoords->tr.v - texcoords->tl.v) / fscale; // c a21
fdudy = (texcoords->bl.u - texcoords->tl.u) / fscale; // b a12
fdvdy = (texcoords->bl.v - texcoords->tl.v) / fscale; // d a22
-
+
/* compute start and delta U,V coordinates now */
-
+
setup->dudx = round_nearest(65536.0f * fdudx);
setup->dvdx = round_nearest(65536.0f * fdvdx);
setup->dudy = round_nearest(65536.0f * fdudy);
@@ -1043,7 +1043,7 @@ static void compute_setup(sdl_info *sdl, const render_primitive *prim, quad_setu
setup->startu += (setup->dudx + setup->dudy) / 2;
setup->startv += (setup->dvdx + setup->dvdy) / 2;
-
+
}
//============================================================
@@ -1109,7 +1109,7 @@ static texture_info * texture_update(sdl_window_info *window, const render_primi
sdl_info *sdl = (sdl_info *) window->dxdata;
quad_setup_data setup;
texture_info *texture;
-
+
compute_setup(sdl, prim, &setup, prim->flags);
texture = texture_find(sdl, prim, &setup);
@@ -1117,8 +1117,8 @@ static texture_info * texture_update(sdl_window_info *window, const render_primi
// if we didn't find one, create a new texture
if (texture == NULL && prim->texture.base != NULL)
{
- texture = texture_create(window, &prim->texture, &setup, prim->flags);
- }
+ texture = texture_create(window, &prim->texture, &setup, prim->flags);
+ }
if (texture != NULL)
{
@@ -1129,14 +1129,14 @@ static texture_info * texture_update(sdl_window_info *window, const render_primi
texture_set_data(sdl, texture, &prim->texture, prim->flags);
}
- }
+ }
return texture;
}
static void draw13_destroy_texture(sdl_info *sdl, texture_info *texture)
{
texture_info *p;
-
+
SDL_DestroyTexture(texture->texture_id);
if ( texture->pixels_own )
{
@@ -1144,7 +1144,7 @@ static void draw13_destroy_texture(sdl_info *sdl, texture_info *texture)
texture->pixels=NULL;
texture->pixels_own=FALSE;
}
-
+
for (p=sdl->texlist; p != NULL; p = p->next)
if (p->next == texture)
break;
@@ -1165,9 +1165,9 @@ static void draw13_destroy_all_textures(sdl_window_info *window)
return;
if(window->primlist && window->primlist->lock)
- {
- lock=TRUE;
- osd_lock_acquire(window->primlist->lock);
+ {
+ lock=TRUE;
+ osd_lock_acquire(window->primlist->lock);
}
texture = sdl->texlist;
diff --git a/src/osd/sdl/drawogl.c b/src/osd/sdl/drawogl.c
index 9969db22e22..cd8c9ce0501 100644
--- a/src/osd/sdl/drawogl.c
+++ b/src/osd/sdl/drawogl.c
@@ -1,5 +1,5 @@
//============================================================
-//
+//
// drawogl.c - SDL software and OpenGL implementation
//
// Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team.
@@ -156,7 +156,7 @@ typedef struct _texture_info texture_info;
#if USE_OPENGL
typedef void (*texture_copy_func)(texture_info *texture, const render_texinfo *texsource);
#endif
-
+
/* texture_info holds information about a texture */
struct _texture_info
{
@@ -173,26 +173,26 @@ struct _texture_info
int xprescale; // what is our X prescale factor?
int yprescale; // what is our Y prescale factor?
int nocopy; // must the texture date be copied?
-
+
UINT32 texture; // OpenGL texture "name"/ID
const GLint * texProperties; // texture properties
texture_copy_func texCopyFn; // texture copy function, !=NULL if !nocopy
GLenum texTarget; // OpenGL texture target
int texpow2; // Is this texture pow2
-
+
UINT32 mpass_dest_idx; // Multipass dest idx [0..1]
UINT32 mpass_textureunit[2]; // texture unit names for GLSL
-
+
UINT32 mpass_texture_mamebm[2];// Multipass OpenGL texture "name"/ID for the shader
UINT32 mpass_fbo_mamebm[2]; // framebuffer object for this texture, multipass
UINT32 mpass_texture_scrn[2]; // Multipass OpenGL texture "name"/ID for the shader
UINT32 mpass_fbo_scrn[2]; // framebuffer object for this texture, multipass
-
+
UINT32 lut_texture; // LUT OpenGL texture "name"/ID for the shader
- int lut_table_width; // LUT table width
+ int lut_table_width; // LUT table width
int lut_table_height; // LUT table height
-
+
UINT32 pbo; // pixel buffer object for this texture (DYNAMIC only!)
UINT32 *data; // pixels for the texture
int data_own; // do we own / allocated it ?
@@ -205,7 +205,7 @@ struct _texture_info
typedef struct _sdl_info sdl_info;
struct _sdl_info
{
- INT32 blittimer;
+ INT32 blittimer;
UINT32 extra_flags;
#if (SDL_VERSION_ATLEAST(1,3,0))
@@ -219,19 +219,19 @@ struct _sdl_info
// 3D info (GL mode only)
texture_info * texlist; // list of active textures
int last_blendmode; // previous blendmode
- INT32 texture_max_width; // texture maximum width
- INT32 texture_max_height; // texture maximum height
+ INT32 texture_max_width; // texture maximum width
+ INT32 texture_max_height; // texture maximum height
int texpoweroftwo; // must textures be power-of-2 sized?
int usevbo; // runtime check if VBO is available
int usepbo; // runtime check if PBO is available
int usefbo; // runtime check if FBO is available
int useglsl; // runtime check if GLSL is available
-
+
glsl_shader_info *glsl; // glsl_shader_info
-
+
GLhandleARB glsl_program[2*GLSL_SHADER_MAX]; // GLSL programs, or 0
int glsl_program_num; // number of GLSL programs
- int glsl_program_mb2sc; // GLSL program idx, which transforms
+ int glsl_program_mb2sc; // GLSL program idx, which transforms
// the mame-bitmap -> screen-bitmap (size/rotation/..)
// All progs <= glsl_program_mb2sc using the mame bitmap
// as input, otherwise the screen bitmap.
@@ -246,10 +246,10 @@ struct _sdl_info
float last_hofs;
float last_vofs;
-
+
// Static vars from draogl_window_dra
- INT32 surf_w;
- INT32 surf_h;
+ INT32 surf_w;
+ INT32 surf_h;
GLfloat texVerticex[8];
};
@@ -295,19 +295,19 @@ INLINE void set_blendmode(sdl_info *sdl, int blendmode)
case BLENDMODE_NONE:
glDisable(GL_BLEND);
break;
- case BLENDMODE_ALPHA:
+ case BLENDMODE_ALPHA:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
break;
- case BLENDMODE_RGB_MULTIPLY:
+ case BLENDMODE_RGB_MULTIPLY:
glEnable(GL_BLEND);
glBlendFunc(GL_DST_COLOR, GL_ZERO);
break;
- case BLENDMODE_ADD:
+ case BLENDMODE_ADD:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
break;
- }
+ }
sdl->last_blendmode = blendmode;
}
@@ -335,7 +335,7 @@ static void load_gl_lib(void);
// OGL 1.3
#ifdef GL_ARB_multitexture
-static PFNGLACTIVETEXTUREARBPROC pfn_glActiveTexture = NULL;
+static PFNGLACTIVETEXTUREARBPROC pfn_glActiveTexture = NULL;
#else
static PFNGLACTIVETEXTUREPROC pfn_glActiveTexture = NULL;
#endif
@@ -455,8 +455,8 @@ static void loadgl_functions(void)
int err_count = 0;
/* the following is tricky ... #func will be expanded to glBegin
- * while func will be expanded to disp_p->glBegin
- */
+ * while func will be expanded to disp_p->glBegin
+ */
#define OSD_GL(ret,func,params) \
if (!( func = (ret (APIENTRY *)params) SDL_GL_GetProcAddress( #func ) )) \
@@ -467,11 +467,11 @@ static void loadgl_functions(void)
#define GET_GLFUNC 1
#include "osd_opengl.h"
#undef GET_GLFUNC
-
+
if (err_count)
fatalerror("Error loading GL library functions, giving up\n");
-#endif
+#endif
}
//============================================================
@@ -484,9 +484,9 @@ static void load_gl_lib(void)
if (!dll_loaded)
{
/*
- * directfb and and x11 use this env var
- * SDL_VIDEO_GL_DRIVER
- */
+ * directfb and and x11 use this env var
+ * SDL_VIDEO_GL_DRIVER
+ */
const char *stemp;
stemp = options_get_string(mame_options(), SDLOPTION_GL_LIB);
@@ -497,8 +497,8 @@ static void load_gl_lib(void)
{
fatalerror("Unable to load opengl library: %s\n", stemp ? stemp : "<default>");
}
- mame_printf_verbose("Loaded opengl shared library: %s\n", stemp ? stemp : "<default>");
- /* FIXME: must be freed as well */
+ mame_printf_verbose("Loaded opengl shared library: %s\n", stemp ? stemp : "<default>");
+ /* FIXME: must be freed as well */
gl_dispatch = (osd_gl_dispatch *) osd_malloc(sizeof(osd_gl_dispatch));
dll_loaded=1;
}
@@ -523,7 +523,7 @@ static int drawogl_window_create(sdl_window_info *window, int width, int height)
window->dxdata = sdl;
#if (SDL_VERSION_ATLEAST(1,3,0))
- sdl->extra_flags = (window->fullscreen ?
+ sdl->extra_flags = (window->fullscreen ?
SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_FOCUS | SDL_WINDOW_FULLSCREEN : SDL_WINDOW_RESIZABLE);
sdl->extra_flags |= SDL_WINDOW_OPENGL;
@@ -534,7 +534,7 @@ static int drawogl_window_create(sdl_window_info *window, int width, int height)
// create the SDL window
SDL_SelectVideoDisplay(window->monitor->handle);
- if (window->fullscreen && video_config.switchres)
+ if (window->fullscreen && video_config.switchres)
{
SDL_DisplayMode mode;
SDL_GetCurrentDisplayMode(&mode);
@@ -546,7 +546,7 @@ static int drawogl_window_create(sdl_window_info *window, int width, int height)
}
else
SDL_SetWindowDisplayMode(window->window_id, NULL); // Use desktop
-
+
window->window_id = SDL_CreateWindow(window->title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
width, height, sdl->extra_flags);
@@ -560,7 +560,7 @@ static int drawogl_window_create(sdl_window_info *window, int width, int height)
//SDL_SetWindowFullscreen(window->window_id, window->fullscreen);
SDL_RaiseWindow(window->window_id);
SDL_GetWindowSize(window->window_id, &window->width, &window->height);
-
+
sdl->gl_context_id = SDL_GL_CreateContext(window->window_id);
if (!sdl->gl_context_id)
{
@@ -569,7 +569,7 @@ static int drawogl_window_create(sdl_window_info *window, int width, int height)
}
SDL_GL_SetSwapInterval(video_config.waitvsync ? 2 : 0);
-
+
#else
sdl->extra_flags = (window->fullscreen ? SDL_FULLSCREEN : SDL_RESIZABLE);
sdl->extra_flags |= SDL_OPENGL | SDL_DOUBLEBUF;
@@ -578,11 +578,11 @@ static int drawogl_window_create(sdl_window_info *window, int width, int height)
#if (SDL_VERSION_ATLEAST(1,2,10))
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, video_config.waitvsync ? 1 : 0);
#endif
-
+
load_gl_lib();
// create the SDL surface (which creates the window in windowed mode)
- sdl->sdlsurf = SDL_SetVideoMode(width, height,
+ sdl->sdlsurf = SDL_SetVideoMode(width, height,
0, SDL_SWSURFACE | SDL_ANYFORMAT | sdl->extra_flags);
if (!sdl->sdlsurf)
@@ -590,7 +590,7 @@ static int drawogl_window_create(sdl_window_info *window, int width, int height)
window->width = sdl->sdlsurf->w;
window->height = sdl->sdlsurf->h;
-
+
if ( (video_config.mode == VIDEO_MODE_OPENGL) && !(sdl->sdlsurf->flags & SDL_OPENGL) )
{
mame_printf_error("OpenGL not supported on this driver!\n");
@@ -600,7 +600,7 @@ static int drawogl_window_create(sdl_window_info *window, int width, int height)
// set the window title
SDL_WM_SetCaption(window->title, "SDLMAME");
-#endif
+#endif
sdl->totalColors = window->totalColors;
sdl->blittimer = 0;
sdl->surf_w = 0;
@@ -614,8 +614,8 @@ static int drawogl_window_create(sdl_window_info *window, int width, int height)
sdl->texture_max_height = 64;
/* load any GL function addresses
- * this must be done here because we need a context
- */
+ * this must be done here because we need a context
+ */
loadgl_functions();
extstr = (char *)glGetString(GL_EXTENSIONS);
@@ -712,7 +712,7 @@ static int drawogl_window_create(sdl_window_info *window, int width, int height)
mame_printf_verbose("OpenGL: pixel buffers not supported\n");
}
}
-
+
if (strstr(extstr, "GL_EXT_framebuffer_object"))
{
sdl->usefbo = 1;
@@ -728,7 +728,7 @@ static int drawogl_window_create(sdl_window_info *window, int width, int height)
if (strstr(extstr, "GL_ARB_shader_objects") &&
strstr(extstr, "GL_ARB_shading_language_100") &&
strstr(extstr, "GL_ARB_vertex_shader") &&
- strstr(extstr, "GL_ARB_fragment_shader")
+ strstr(extstr, "GL_ARB_fragment_shader")
)
{
sdl->useglsl = video_config.glsl;
@@ -763,7 +763,7 @@ static int drawogl_window_create(sdl_window_info *window, int width, int height)
shown_video_info = 1;
sdl->init_context = 0;
-
+
return 0;
}
@@ -783,13 +783,13 @@ static void drawogl_window_resize(sdl_window_info *window, int width, int height
#else
SDL_FreeSurface(sdl->sdlsurf);
- sdl->sdlsurf = SDL_SetVideoMode(width, height, 0,
+ sdl->sdlsurf = SDL_SetVideoMode(width, height, 0,
SDL_SWSURFACE | SDL_ANYFORMAT | sdl->extra_flags);
window->width = sdl->sdlsurf->w;
window->height = sdl->sdlsurf->h;
#endif
sdl->init_context = 1;
-
+
}
//============================================================
@@ -946,7 +946,7 @@ static void loadGLExtensions(sdl_window_info *window)
}
}
- if ( sdl->usefbo &&
+ if ( sdl->usefbo &&
( !pfn_glIsFramebuffer || !pfn_glBindFramebuffer || !pfn_glDeleteFramebuffers ||
!pfn_glGenFramebuffers || !pfn_glCheckFramebufferStatus || !pfn_glFramebufferTexture2D
))
@@ -1012,10 +1012,10 @@ static void loadGLExtensions(sdl_window_info *window)
mame_printf_warning("OpenGL: FBO not supported\n");
}
}
-
+
if ( sdl->useglsl )
{
- #ifdef GL_ARB_multitexture
+ #ifdef GL_ARB_multitexture
pfn_glActiveTexture = (PFNGLACTIVETEXTUREARBPROC) SDL_GL_GetProcAddress("glActiveTextureARB");
#else
pfn_glActiveTexture = (PFNGLACTIVETEXTUREPROC) SDL_GL_GetProcAddress("glActiveTexture");
@@ -1041,8 +1041,8 @@ static void loadGLExtensions(sdl_window_info *window)
{
mame_printf_warning("OpenGL: GLSL supported, but shader instantiation failed - disabled\n");
}
- }
- }
+ }
+ }
if ( sdl->useglsl )
{
@@ -1083,13 +1083,13 @@ static void loadGLExtensions(sdl_window_info *window)
glsl_shader_feature = GLSL_SHADER_FEAT_CUSTOM;
if (_once)
{
- mame_printf_verbose("OpenGL: GLSL using mame bitmap shader filter %d: '%s'\n",
+ mame_printf_verbose("OpenGL: GLSL using mame bitmap shader filter %d: '%s'\n",
sdl->glsl_program_num, video_config.glsl_shader_mamebm[i]);
}
sdl->glsl_program_mb2sc = sdl->glsl_program_num; // the last mame_bitmap (mb) shader does it.
sdl->glsl_program_num++;
}
- }
+ }
if ( video_config.glsl_shader_scrn_num > 0 && sdl->glsl_program_num==0 )
{
@@ -1106,12 +1106,12 @@ static void loadGLExtensions(sdl_window_info *window)
} else {
if (_once)
{
- mame_printf_verbose("OpenGL: GLSL using screen bitmap shader filter %d: '%s'\n",
+ mame_printf_verbose("OpenGL: GLSL using screen bitmap shader filter %d: '%s'\n",
sdl->glsl_program_num, video_config.glsl_shader_scrn[i]);
}
sdl->glsl_program_num++;
}
- }
+ }
if ( 0==sdl->glsl_program_num &&
0 <= video_config.glsl_filter && video_config.glsl_filter < GLSL_SHADER_FEAT_INT_NUMBER )
@@ -1122,7 +1122,7 @@ static void loadGLExtensions(sdl_window_info *window)
if (_once)
{
- mame_printf_verbose("OpenGL: GLSL using shader filter '%s', idx: %d, num %d (vid filter: %d)\n",
+ mame_printf_verbose("OpenGL: GLSL using shader filter '%s', idx: %d, num %d (vid filter: %d)\n",
glsl_shader_get_filter_name_mamebm(glsl_shader_feature),
glsl_shader_feature, sdl->glsl_program_num, video_config.filter);
}
@@ -1212,7 +1212,7 @@ static int drawogl_window_draw(sdl_window_info *window, UINT32 dc, int update)
{
loadGLExtensions(window);
}
-
+
sdl->surf_w=window->width;
sdl->surf_h=window->height;
@@ -1235,38 +1235,38 @@ static int drawogl_window_draw(sdl_window_info *window, UINT32 dc, int update)
glDisable(GL_LINE_SMOOTH);
glDisable(GL_POINT_SMOOTH);
}
-
+
// enable blending
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
sdl->last_blendmode = BLENDMODE_ALPHA;
-
+
// set lines and points just barely above normal size to get proper results
glLineWidth(video_config.beamwidth);
glPointSize(video_config.beamwidth);
-
+
// set up a nice simple 2D coordinate system, so GL behaves exactly how we'd like.
//
// (0,0) (w,0)
// |~~~~~~~~~|
- // | |
- // | |
- // | |
+ // | |
+ // | |
+ // | |
// |_________|
// (0,h) (w,h)
-
+
glViewport(0.0, 0.0, (GLsizei)window->width, (GLsizei)window->height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, (GLdouble)window->width, (GLdouble)window->height, 0.0, 0.0, -1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
-
+
if ( ! sdl->initialized )
{
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(2, GL_FLOAT, 0, sdl->texVerticex); // no VBO, since it's too volatile
-
+
sdl->initialized = 1;
}
}
@@ -1301,7 +1301,7 @@ static int drawogl_window_draw(sdl_window_info *window, UINT32 dc, int update)
sdl->last_hofs = hofs;
sdl->last_vofs = vofs;
-
+
osd_lock_acquire(window->primlist->lock);
// now draw
@@ -1312,9 +1312,9 @@ static int drawogl_window_draw(sdl_window_info *window, UINT32 dc, int update)
switch (prim->type)
{
/**
- * Try to stay in one Begin/End block as long as possible,
- * since entering and leaving one is most expensive..
- */
+ * Try to stay in one Begin/End block as long as possible,
+ * since entering and leaving one is most expensive..
+ */
case RENDER_PRIMITIVE_LINE:
#if !USE_WIN32_STYLE_LINES
// check if it's really a point
@@ -1416,8 +1416,8 @@ static int drawogl_window_draw(sdl_window_info *window, UINT32 dc, int update)
if (a > 1.0) a = 1.0;
glColor4f(r, g, b, a);
-// texture = texture_update(window, prim, 0);
-// if (texture) printf("line has texture!\n");
+// texture = texture_update(window, prim, 0);
+// if (texture) printf("line has texture!\n");
// if we have a texture to use for the vectors, use it here
#if 0
@@ -1716,7 +1716,7 @@ static void drawogl_window_destroy(sdl_window_info *window)
//============================================================
//
-// glBufferData to push a nocopy texture to the GPU is slower than TexSubImage2D,
+// glBufferData to push a nocopy texture to the GPU is slower than TexSubImage2D,
// so don't use PBO here
//
// we also don't want to use PBO's in the case of nocopy==TRUE,
@@ -1733,14 +1733,14 @@ static void texture_compute_type_subroutine(sdl_info *sdl, const render_texinfo
texture->type = TEXTURE_TYPE_PLAIN;
texture->texTarget = (sdl->usetexturerect)?GL_TEXTURE_RECTANGLE_ARB:GL_TEXTURE_2D;
texture->texpow2 = (sdl->usetexturerect)?0:sdl->texpoweroftwo;
- }
+ }
// currently glsl supports idx and rgb palette lookups,
// no special quality scaling, so we could drop the prescale criteria below ..
if ( texture->type == TEXTURE_TYPE_NONE &&
- sdl->useglsl &&
+ sdl->useglsl &&
(
- texture->format==SDL_TEXFORMAT_PALETTE16 || // glsl idx16 lut
+ texture->format==SDL_TEXFORMAT_PALETTE16 || // glsl idx16 lut
texture->format==SDL_TEXFORMAT_RGB32_PALETTED || // glsl rgb32 lut/direct
texture->format==SDL_TEXFORMAT_RGB15_PALETTED // glsl rgb15 lut/direct
) &&
@@ -1750,13 +1750,13 @@ static void texture_compute_type_subroutine(sdl_info *sdl, const render_texinfo
{
texture->type = TEXTURE_TYPE_SHADER;
texture->nocopy = TRUE;
- texture->texTarget = GL_TEXTURE_2D;
+ texture->texTarget = GL_TEXTURE_2D;
texture->texpow2 = sdl->texpoweroftwo;
}
// determine if we can skip the copy step
// if this was not already decided by the shader condition above
- if ( !texture->nocopy &&
+ if ( !texture->nocopy &&
texture_copy_properties[texture->format][SDL_TEXFORMAT_SRC_EQUALS_DEST] &&
!texture_copy_properties[texture->format][SDL_TEXFORMAT_SRC_HAS_PALETTE] &&
texture->xprescale == 1 && texture->yprescale == 1 &&
@@ -1764,7 +1764,7 @@ static void texture_compute_type_subroutine(sdl_info *sdl, const render_texinfo
texsource->rowpixels <= sdl->texture_max_width )
{
texture->nocopy = TRUE;
- }
+ }
if( texture->type == TEXTURE_TYPE_NONE &&
sdl->usepbo && !texture->nocopy )
@@ -1773,7 +1773,7 @@ static void texture_compute_type_subroutine(sdl_info *sdl, const render_texinfo
texture->type = TEXTURE_TYPE_DYNAMIC;
texture->texTarget = (sdl->usetexturerect)?GL_TEXTURE_RECTANGLE_ARB:GL_TEXTURE_2D;
texture->texpow2 = (sdl->usetexturerect)?0:sdl->texpoweroftwo;
- }
+ }
if( texture->type == TEXTURE_TYPE_NONE )
{
@@ -1803,17 +1803,17 @@ INLINE int get_valid_pow2_value(int v, int needPow2)
static void texture_compute_size_subroutine(sdl_window_info *window, texture_info *texture, UINT32 flags,
UINT32 width, UINT32 height,
- int* p_width, int* p_height, int* p_width_create, int* p_height_create)
+ int* p_width, int* p_height, int* p_width_create, int* p_height_create)
{
sdl_info *sdl = (sdl_info *) window->dxdata;
int width_create;
int height_create;
- if ( texture->texpow2 )
+ if ( texture->texpow2 )
{
width_create = gl_round_to_pow2 (width);
height_create = gl_round_to_pow2 (height);
- } else if ( texture->type==TEXTURE_TYPE_SHADER )
+ } else if ( texture->type==TEXTURE_TYPE_SHADER )
{
/**
* at least use a multiple of 8 for shader .. just in case
@@ -1867,8 +1867,8 @@ static void texture_compute_size_type(sdl_window_info *window, const render_texi
}
texture_compute_type_subroutine(sdl, texsource, texture, flags);
-
- texture_compute_size_subroutine(window, texture, flags, texsource->width, texsource->height,
+
+ texture_compute_size_subroutine(window, texture, flags, texsource->width, texsource->height,
&finalwidth, &finalheight, &finalwidth_create, &finalheight_create);
// if we added pixels for the border, and that just barely pushed us over, take it back
@@ -1879,8 +1879,8 @@ static void texture_compute_size_type(sdl_window_info *window, const render_texi
texture->borderpix = FALSE;
texture_compute_type_subroutine(sdl, texsource, texture, flags);
-
- texture_compute_size_subroutine(window, texture, flags, texsource->width, texsource->height,
+
+ texture_compute_size_subroutine(window, texture, flags, texsource->width, texsource->height,
&finalwidth, &finalheight, &finalwidth_create, &finalheight_create);
}
@@ -1888,7 +1888,7 @@ static void texture_compute_size_type(sdl_window_info *window, const render_texi
if (finalwidth_create > sdl->texture_max_width || finalheight_create > sdl->texture_max_height)
{
static int printed = FALSE;
- if (!printed)
+ if (!printed)
mame_printf_warning("Texture too big! (wanted: %dx%d, max is %dx%d)\n", finalwidth_create, finalheight_create, sdl->texture_max_width, sdl->texture_max_height);
printed = TRUE;
}
@@ -1906,8 +1906,8 @@ static void texture_compute_size_type(sdl_window_info *window, const render_texi
mame_printf_verbose("GL texture: copy %d, shader %d, dynamic %d, %dx%d %dx%d [%s, Equal: %d, Palette: %d,\n"
" scale %dx%d, border %d, pitch %d,%d/%d], colors: %d, bytes/pix %d\n",
!texture->nocopy, texture->type==TEXTURE_TYPE_SHADER, texture->type==TEXTURE_TYPE_DYNAMIC,
- finalwidth, finalheight, finalwidth_create, finalheight_create,
- texfmt_to_string[texture->format],
+ finalwidth, finalheight, finalwidth_create, finalheight_create,
+ texfmt_to_string[texture->format],
(int)texture_copy_properties[texture->format][SDL_TEXFORMAT_SRC_EQUALS_DEST],
(int)texture_copy_properties[texture->format][SDL_TEXFORMAT_SRC_HAS_PALETTE],
texture->xprescale, texture->yprescale,
@@ -1927,7 +1927,7 @@ static void texture_compute_size_type(sdl_window_info *window, const render_texi
// texture_create
//============================================================
-static int gl_checkFramebufferStatus(void)
+static int gl_checkFramebufferStatus(void)
{
GLenum status;
status=(GLenum)pfn_glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT);
@@ -1955,7 +1955,7 @@ static int gl_checkFramebufferStatus(void)
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
mame_printf_error("GL FBO: incomplete,missing read buffer\n");
return -1;
-#ifdef GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT
+#ifdef GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT
case GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT:
mame_printf_error("GL FBO: incomplete, duplicate attachment\n");
return -1;
@@ -1977,7 +1977,7 @@ static int texture_fbo_create(UINT32 text_unit, UINT32 text_name, UINT32 fbo_nam
glBindTexture(GL_TEXTURE_2D, text_name);
{
GLint _width, _height;
- if ( gl_texture_check_size(GL_TEXTURE_2D, 0, GL_RGBA8, width, height,
+ if ( gl_texture_check_size(GL_TEXTURE_2D, 0, GL_RGBA8, width, height,
0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, &_width, &_height, 1) )
{
mame_printf_error("cannot create fbo texture, req: %dx%d, avail: %dx%d - bail out\n",
@@ -1985,7 +1985,7 @@ static int texture_fbo_create(UINT32 text_unit, UINT32 text_name, UINT32 fbo_nam
return -1;
}
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height,
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height,
0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL );
}
// non-screen textures will never be filtered
@@ -1995,7 +1995,7 @@ static int texture_fbo_create(UINT32 text_unit, UINT32 text_name, UINT32 fbo_nam
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
- pfn_glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
+ pfn_glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, text_name, 0);
if ( gl_checkFramebufferStatus() )
@@ -2007,7 +2007,7 @@ static int texture_fbo_create(UINT32 text_unit, UINT32 text_name, UINT32 fbo_nam
return 0;
}
-static int texture_shader_create(sdl_window_info *window,
+static int texture_shader_create(sdl_window_info *window,
const render_texinfo *texsource, texture_info *texture, UINT32 flags)
{
sdl_info *sdl = (sdl_info *) window->dxdata;
@@ -2050,18 +2050,18 @@ static int texture_shader_create(sdl_window_info *window,
}
/**
- * We experience some GLSL LUT calculation inaccuracy on some GL drivers.
- * while using the correct lut calculations.
- * This error is due to the color index value to GLSL/texture passing process:
- * mame:uint16_t -> OpenGL: GLfloat(alpha texture) -> GLSL:uint16_t (value regeneration)
- * The latter inaccurate uint16_t value regeneration is buggy on some drivers/cards,
- * therefor we always widen the lut size to pow2,
- * and shape it equaly into 2D space (max texture size restriction).
- * This is a practical GL driver workaround to minimize the chance for
- * floating point arithmetic errors in the GLSL engine.
- *
- * Shape the lut texture to achieve texture max size compliance and equal 2D partitioning
- */
+ * We experience some GLSL LUT calculation inaccuracy on some GL drivers.
+ * while using the correct lut calculations.
+ * This error is due to the color index value to GLSL/texture passing process:
+ * mame:uint16_t -> OpenGL: GLfloat(alpha texture) -> GLSL:uint16_t (value regeneration)
+ * The latter inaccurate uint16_t value regeneration is buggy on some drivers/cards,
+ * therefor we always widen the lut size to pow2,
+ * and shape it equaly into 2D space (max texture size restriction).
+ * This is a practical GL driver workaround to minimize the chance for
+ * floating point arithmetic errors in the GLSL engine.
+ *
+ * Shape the lut texture to achieve texture max size compliance and equal 2D partitioning
+ */
lut_texture_width = sqrt((double)(texture->lut_table_width));
lut_texture_width = get_valid_pow2_value (lut_texture_width, 1);
@@ -2075,9 +2075,9 @@ static int texture_shader_create(sdl_window_info *window,
texture->lut_table_width = lut_texture_width;
/**
- * always use pow2 for LUT, to minimize the chance for floating point arithmetic errors
- * (->buggy GLSL engine)
- */
+ * always use pow2 for LUT, to minimize the chance for floating point arithmetic errors
+ * (->buggy GLSL engine)
+ */
lut_table_height_pow2 = get_valid_pow2_value (texture->lut_table_height, 1 /* texture->texpow2 */);
lut_table_width_pow2 = get_valid_pow2_value (texture->lut_table_width, 1 /* texture->texpow2 */);
@@ -2104,7 +2104,7 @@ static int texture_shader_create(sdl_window_info *window,
// multipass mode
assert(sdl->usefbo);
- // GL_TEXTURE3 GLSL Uniforms
+ // GL_TEXTURE3 GLSL Uniforms
texture->mpass_dest_idx = 0;
texture->mpass_textureunit[0] = GL_TEXTURE3;
texture->mpass_textureunit[1] = GL_TEXTURE2;
@@ -2192,7 +2192,7 @@ static int texture_shader_create(sdl_window_info *window,
for (i=0; i<2; i++)
{
- if ( texture_fbo_create(texture->mpass_textureunit[i],
+ if ( texture_fbo_create(texture->mpass_textureunit[i],
texture->mpass_texture_mamebm[i],
texture->mpass_fbo_mamebm[i],
texture->rawwidth_create, texture->rawheight_create) )
@@ -2216,7 +2216,7 @@ static int texture_shader_create(sdl_window_info *window,
for (i=0; i<2; i++)
{
- if ( texture_fbo_create(texture->mpass_textureunit[i],
+ if ( texture_fbo_create(texture->mpass_textureunit[i],
texture->mpass_texture_scrn[i],
texture->mpass_fbo_scrn[i],
surf_w_pow2, surf_h_pow2) )
@@ -2231,7 +2231,7 @@ static int texture_shader_create(sdl_window_info *window,
if ( !(sdl->glsl_vid_attributes && texture->format!=SDL_TEXFORMAT_PALETTE16) )
{
- // GL_TEXTURE1
+ // GL_TEXTURE1
glGenTextures(1, (GLuint *)&texture->lut_texture);
pfn_glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, texture->lut_texture);
@@ -2273,7 +2273,7 @@ static int texture_shader_create(sdl_window_info *window,
assert ( texture->lut_texture );
}
- // GL_TEXTURE0
+ // GL_TEXTURE0
// get a name for this texture
glGenTextures(1, (GLuint *)&texture->texture);
pfn_glActiveTexture(GL_TEXTURE0);
@@ -2286,10 +2286,10 @@ static int texture_shader_create(sdl_window_info *window,
UINT32 * dummy = NULL;
GLint _width, _height;
if ( gl_texture_check_size(GL_TEXTURE_2D, 0, texture->texProperties[SDL_TEXFORMAT_INTERNAL],
- texture->rawwidth_create, texture->rawheight_create,
+ texture->rawwidth_create, texture->rawheight_create,
0,
- texture->texProperties[SDL_TEXFORMAT_FORMAT],
- texture->texProperties[SDL_TEXFORMAT_TYPE],
+ texture->texProperties[SDL_TEXFORMAT_FORMAT],
+ texture->texProperties[SDL_TEXFORMAT_TYPE],
&_width, &_height, 1) )
{
mame_printf_error("cannot create bitmap texture, req: %dx%d, avail: %dx%d - bail out\n",
@@ -2301,10 +2301,10 @@ static int texture_shader_create(sdl_window_info *window,
texture->texProperties[SDL_TEXFORMAT_PIXEL_SIZE]);
memset(dummy, 0, texture->rawwidth_create * texture->rawheight_create *
texture->texProperties[SDL_TEXFORMAT_PIXEL_SIZE]);
- glTexImage2D(GL_TEXTURE_2D, 0, texture->texProperties[SDL_TEXFORMAT_INTERNAL],
- texture->rawwidth_create, texture->rawheight_create,
+ glTexImage2D(GL_TEXTURE_2D, 0, texture->texProperties[SDL_TEXFORMAT_INTERNAL],
+ texture->rawwidth_create, texture->rawheight_create,
0,
- texture->texProperties[SDL_TEXFORMAT_FORMAT],
+ texture->texProperties[SDL_TEXFORMAT_FORMAT],
texture->texProperties[SDL_TEXFORMAT_TYPE], dummy);
glFinish(); // should not be necessary, .. but make sure we won't access the memory after free
free(dummy);
@@ -2349,7 +2349,7 @@ static int texture_shader_create(sdl_window_info *window,
dummy = (UINT32 *) malloc(texture->rawwidth_create * texture->rawheight_create * sizeof(UINT16));
memset(dummy, 0, texture->rawwidth_create * texture->rawheight_create * sizeof(UINT16));
glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA16,
- texture->rawwidth_create, texture->rawheight_create,
+ texture->rawwidth_create, texture->rawheight_create,
0,
GL_ALPHA, GL_UNSIGNED_SHORT, dummy);
glFinish(); // should not be necessary, .. but make sure we won't access the memory after free
@@ -2377,7 +2377,7 @@ static texture_info *texture_create(sdl_window_info *window, const render_texinf
{
sdl_info *sdl = (sdl_info *) window->dxdata;
texture_info *texture;
-
+
// allocate a new texture
texture = (texture_info *) malloc(sizeof(*texture));
memset(texture, 0, sizeof(*texture));
@@ -2399,15 +2399,15 @@ static texture_info *texture_create(sdl_window_info *window, const render_texinf
}
// set the texture_format
- //
- // src/emu/validity.c:validate_display() states,
+ //
+ // src/emu/validity.c:validate_display() states,
// an emulated driver can only produce
// BITMAP_FORMAT_INDEXED16, BITMAP_FORMAT_RGB15 and BITMAP_FORMAT_RGB32
// where only the first original paletted.
//
// other paletted formats, i.e.:
// SDL_TEXFORMAT_RGB32_PALETTED, SDL_TEXFORMAT_RGB15_PALETTED and SDL_TEXFORMAT_YUY16_PALETTED
- // add features like brightness etc by the mame core
+ // add features like brightness etc by the mame core
//
// all palette lookup may be implemented using shaders later on ..
// that's why we keep the EQUAL flag TRUE, for all original true color bitmaps.
@@ -2463,8 +2463,8 @@ static texture_info *texture_create(sdl_window_info *window, const render_texinf
free(texture);
return NULL;
}
- }
- else
+ }
+ else
{
// get a name for this texture
glGenTextures(1, (GLuint *)&texture->texture);
@@ -2473,12 +2473,12 @@ static texture_info *texture_create(sdl_window_info *window, const render_texinf
// make sure we're operating on *this* texture
glBindTexture(texture->texTarget, texture->texture);
-
+
// this doesn't actually upload, it just sets up the PBO's parameters
- glTexImage2D(texture->texTarget, 0, texture->texProperties[SDL_TEXFORMAT_INTERNAL],
- texture->rawwidth_create, texture->rawheight_create,
- texture->borderpix ? 1 : 0,
- texture->texProperties[SDL_TEXFORMAT_FORMAT],
+ glTexImage2D(texture->texTarget, 0, texture->texProperties[SDL_TEXFORMAT_INTERNAL],
+ texture->rawwidth_create, texture->rawheight_create,
+ texture->borderpix ? 1 : 0,
+ texture->texProperties[SDL_TEXFORMAT_FORMAT],
texture->texProperties[SDL_TEXFORMAT_TYPE], NULL);
if ((PRIMFLAG_GET_SCREENTEX(flags)) && video_config.filter)
@@ -2524,10 +2524,10 @@ static texture_info *texture_create(sdl_window_info *window, const render_texinf
pfn_glBindBuffer( GL_PIXEL_UNPACK_BUFFER_ARB, texture->pbo);
// set up the PBO dimension, ..
- pfn_glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB,
+ pfn_glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB,
texture->rawwidth * texture->rawheight * texture->texProperties[SDL_TEXFORMAT_PIXEL_SIZE],
NULL, GL_STREAM_DRAW);
- }
+ }
if ( !texture->nocopy && texture->type!=TEXTURE_TYPE_DYNAMIC )
{
@@ -2579,9 +2579,9 @@ static void texture_set_data(texture_info *texture, const render_texinfo *texsou
// always fill non-wrapping textures with an extra pixel on the top
if (texture->borderpix)
{
- memset(texture->data, 0,
+ memset(texture->data, 0,
(texsource->width * texture->xprescale + 2) * texture->texProperties[SDL_TEXFORMAT_PIXEL_SIZE]);
- }
+ }
// when nescesarry copy (and convert) the data
if (!texture->nocopy)
@@ -2593,8 +2593,8 @@ static void texture_set_data(texture_info *texture, const render_texinfo *texsou
// always fill non-wrapping textures with an extra pixel on the bottom
if (texture->borderpix)
{
- memset((UINT8 *)texture->data +
- (texsource->height + 1) * texture->rawwidth * texture->texProperties[SDL_TEXFORMAT_PIXEL_SIZE],
+ memset((UINT8 *)texture->data +
+ (texsource->height + 1) * texture->rawwidth * texture->texProperties[SDL_TEXFORMAT_PIXEL_SIZE],
0,
(texsource->width * texture->xprescale + 2) * texture->texProperties[SDL_TEXFORMAT_PIXEL_SIZE]);
}
@@ -2617,19 +2617,19 @@ static void texture_set_data(texture_info *texture, const render_texinfo *texsou
glPixelStorei(GL_UNPACK_ROW_LENGTH, texture->texinfo.rowpixels);
- // and upload the image
+ // and upload the image
if(texture->format!=SDL_TEXFORMAT_PALETTE16)
{
- glTexSubImage2D(texture->texTarget, 0, 0, 0, texture->rawwidth, texture->rawheight,
- texture->texProperties[SDL_TEXFORMAT_FORMAT],
+ glTexSubImage2D(texture->texTarget, 0, 0, 0, texture->rawwidth, texture->rawheight,
+ texture->texProperties[SDL_TEXFORMAT_FORMAT],
texture->texProperties[SDL_TEXFORMAT_TYPE], texture->data);
}
else
{
- glTexSubImage2D(texture->texTarget, 0, 0, 0, texture->rawwidth, texture->rawheight,
+ glTexSubImage2D(texture->texTarget, 0, 0, 0, texture->rawwidth, texture->rawheight,
GL_ALPHA, GL_UNSIGNED_SHORT, texture->data);
}
- }
+ }
else if ( texture->type == TEXTURE_TYPE_DYNAMIC )
{
glBindTexture(texture->texTarget, texture->texture);
@@ -2640,10 +2640,10 @@ static void texture_set_data(texture_info *texture, const render_texinfo *texsou
pfn_glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER_ARB);
// kick off the DMA
- glTexSubImage2D(texture->texTarget, 0, 0, 0, texture->rawwidth, texture->rawheight,
- texture->texProperties[SDL_TEXFORMAT_FORMAT],
+ glTexSubImage2D(texture->texTarget, 0, 0, 0, texture->rawwidth, texture->rawheight,
+ texture->texProperties[SDL_TEXFORMAT_FORMAT],
texture->texProperties[SDL_TEXFORMAT_TYPE], NULL);
- }
+ }
else
{
glBindTexture(texture->texTarget, texture->texture);
@@ -2654,9 +2654,9 @@ static void texture_set_data(texture_info *texture, const render_texinfo *texsou
else
glPixelStorei(GL_UNPACK_ROW_LENGTH, texture->rawwidth);
- // and upload the image
- glTexSubImage2D(texture->texTarget, 0, 0, 0, texture->rawwidth, texture->rawheight,
- texture->texProperties[SDL_TEXFORMAT_FORMAT],
+ // and upload the image
+ glTexSubImage2D(texture->texTarget, 0, 0, 0, texture->rawwidth, texture->rawheight,
+ texture->texProperties[SDL_TEXFORMAT_FORMAT],
texture->texProperties[SDL_TEXFORMAT_TYPE], texture->data);
}
}
@@ -2688,7 +2688,7 @@ static texture_info *texture_find(sdl_info *sdl, const render_primitive *prim)
// texture_update
//============================================================
-static void texture_coord_update(sdl_window_info *window,
+static void texture_coord_update(sdl_window_info *window,
texture_info *texture, const render_primitive *prim, int shaderIdx)
{
sdl_info *sdl = (sdl_info *) window->dxdata;
@@ -2813,7 +2813,7 @@ static void texture_mpass_flip(sdl_info *sdl, texture_info *texture, int shaderI
if ( shaderIdx==0 )
{
- glPushAttrib(GL_VIEWPORT_BIT);
+ glPushAttrib(GL_VIEWPORT_BIT);
GL_CHECK_ERROR_NORMAL();
glViewport(0.0, 0.0, (GLsizei)texture->rawwidth, (GLsizei)texture->rawheight);
}
@@ -2825,7 +2825,7 @@ static void texture_mpass_flip(sdl_info *sdl, texture_info *texture, int shaderI
}
glClear(GL_COLOR_BUFFER_BIT); // make sure the whole texture is redrawn ..
}
- else
+ else
{
glBindTexture(texture->texTarget, 0);
pfn_glBindFramebuffer(GL_FRAMEBUFFER_EXT, 0);
@@ -2859,7 +2859,7 @@ static void texture_shader_update(sdl_window_info *window, texture_info *texture
{
if (scrnum == window->start_viewscreen)
{
- container = render_container_get_screen(screen);
+ container = render_container_get_screen(screen);
}
scrnum++;
@@ -2902,9 +2902,9 @@ static texture_info * texture_update(sdl_window_info *window, const render_primi
// if we didn't find one, create a new texture
if (texture == NULL && prim->texture.base != NULL)
{
- texture = texture_create(window, &prim->texture, prim->flags);
+ texture = texture_create(window, &prim->texture, prim->flags);
- }
+ }
else if (texture != NULL)
{
if ( texture->type == TEXTURE_TYPE_SHADER )
@@ -2914,11 +2914,11 @@ static texture_info * texture_update(sdl_window_info *window, const render_primi
else if ( texture->type == TEXTURE_TYPE_DYNAMIC )
{
assert ( sdl->usepbo ) ;
- pfn_glBindBuffer( GL_PIXEL_UNPACK_BUFFER_ARB, texture->pbo);
+ pfn_glBindBuffer( GL_PIXEL_UNPACK_BUFFER_ARB, texture->pbo);
glEnable(texture->texTarget);
- }
- else
- {
+ }
+ else
+ {
glEnable(texture->texTarget);
}
}
@@ -2944,7 +2944,7 @@ static texture_info * texture_update(sdl_window_info *window, const render_primi
texture_set_data(texture, &prim->texture);
texBound=1;
}
- }
+ }
if (!texBound) {
glBindTexture(texture->texTarget, texture->texture);
@@ -2957,13 +2957,13 @@ static texture_info * texture_update(sdl_window_info *window, const render_primi
pfn_glBindBuffer( GL_ARRAY_BUFFER_ARB, texture->texCoordBufferName );
// Load The Data
pfn_glBufferSubData( GL_ARRAY_BUFFER_ARB, 0, 4*2*sizeof(GLfloat), texture->texCoord );
- glTexCoordPointer( 2, GL_FLOAT, 0, (char *) NULL ); // we are using ARB VBO buffers
+ glTexCoordPointer( 2, GL_FLOAT, 0, (char *) NULL ); // we are using ARB VBO buffers
}
else
{
glTexCoordPointer(2, GL_FLOAT, 0, texture->texCoord);
}
- }
+ }
return texture;
}
@@ -2974,7 +2974,7 @@ static void texture_disable(sdl_info *sdl, texture_info * texture)
{
assert ( sdl->useglsl );
pfn_glUseProgramObjectARB(0); // back to fixed function pipeline
- } else if ( texture->type == TEXTURE_TYPE_DYNAMIC )
+ } else if ( texture->type == TEXTURE_TYPE_DYNAMIC )
{
pfn_glBindBuffer( GL_PIXEL_UNPACK_BUFFER_ARB, 0);
glDisable(texture->texTarget);
@@ -3036,11 +3036,11 @@ static void drawogl_destroy_all_textures(sdl_window_info *window)
#if (SDL_VERSION_ATLEAST(1,3,0))
SDL_GL_MakeCurrent(window->window_id, sdl->gl_context_id);
#endif
-
+
if(window->primlist && window->primlist->lock)
- {
- lock=TRUE;
- osd_lock_acquire(window->primlist->lock);
+ {
+ lock=TRUE;
+ osd_lock_acquire(window->primlist->lock);
}
texture = sdl->texlist;
@@ -3059,20 +3059,20 @@ static void drawogl_destroy_all_textures(sdl_window_info *window)
pfn_glDeleteBuffers( 1, &(texture->texCoordBufferName) );
texture->texCoordBufferName=0;
}
-
+
if(sdl->usepbo && texture->pbo)
{
pfn_glDeleteBuffers( 1, (GLuint *)&(texture->pbo) );
texture->pbo=0;
}
-
+
if( sdl->glsl_program_num > 1 )
{
assert(sdl->usefbo);
pfn_glDeleteFramebuffers(2, (GLuint *)&texture->mpass_fbo_mamebm[0]);
glDeleteTextures(2, (GLuint *)&texture->mpass_texture_mamebm[0]);
}
-
+
if ( sdl->glsl_program_mb2sc < sdl->glsl_program_num - 1 )
{
assert(sdl->usefbo);
@@ -3097,10 +3097,10 @@ static void drawogl_destroy_all_textures(sdl_window_info *window)
if ( sdl->useglsl )
{
- glsl_shader_free(sdl->glsl);
+ glsl_shader_free(sdl->glsl);
sdl->glsl = NULL;
}
-
+
sdl->initialized = 0;
if (lock)
diff --git a/src/osd/sdl/drawsdl.c b/src/osd/sdl/drawsdl.c
index 230715f40de..ff22e49c1d1 100644
--- a/src/osd/sdl/drawsdl.c
+++ b/src/osd/sdl/drawsdl.c
@@ -1,5 +1,5 @@
//============================================================
-//
+//
// drawsdl.c - SDL software and OpenGL implementation
//
// Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team.
@@ -42,7 +42,7 @@ typedef struct _sdl_scale_mode sdl_scale_mode;
typedef struct _sdl_info sdl_info;
struct _sdl_info
{
- INT32 blittimer;
+ INT32 blittimer;
UINT32 extra_flags;
#if (SDL_VERSION_ATLEAST(1,3,0))
@@ -54,12 +54,12 @@ struct _sdl_info
#endif
// YUV overlay
- UINT32 *yuv_lookup;
+ UINT32 *yuv_lookup;
UINT16 *yuv_bitmap;
-
- // if we leave scaling to SDL and the underlying driver, this
+
+ // if we leave scaling to SDL and the underlying driver, this
// is the render_target_width/height to use
-
+
int hw_scale_width;
int hw_scale_height;
int last_hofs;
@@ -68,7 +68,7 @@ struct _sdl_info
int old_blitheight;
// shortcut to scale mode info
-
+
const sdl_scale_mode *scale_mode;
};
@@ -163,7 +163,7 @@ static const sdl_scale_mode scale_modes[] =
const char *drawsdl_scale_mode_str(int index)
{
const sdl_scale_mode *sm = scale_modes;
-
+
while (index>0)
{
if (sm->name == NULL)
@@ -178,7 +178,7 @@ int drawsdl_scale_mode(const char *s)
{
const sdl_scale_mode *sm = scale_modes;
int index;
-
+
index = 0;
while (sm->name != NULL)
{
@@ -253,17 +253,17 @@ static void setup_texture(sdl_window_info *window, int tempwidth, int tempheight
const sdl_scale_mode *sdl_sm = sdl->scale_mode;
SDL_DisplayMode mode;
UINT32 fmt;
-
+
// Determine preferred pixelformat and set up yuv if necessary
SDL_GetCurrentDisplayMode(&mode);
-
+
if (sdl->yuv_bitmap)
{
global_free(sdl->yuv_bitmap);
- sdl->yuv_bitmap = NULL;
+ sdl->yuv_bitmap = NULL;
}
- if (sdl_sm->is_scale)
+ if (sdl_sm->is_scale)
{
render_target_get_minimum_size(window->target, &sdl->hw_scale_width, &sdl->hw_scale_height);
if (video_config.prescale)
@@ -282,13 +282,13 @@ static void setup_texture(sdl_window_info *window, int tempwidth, int tempheight
{
int w = sdl->hw_scale_width * sdl_sm->mult_w;
int h = sdl->hw_scale_height * sdl_sm->mult_h;
-
+
sdl->texture_id = SDL_CreateTexture(fmt, SDL_TEXTUREACCESS_STREAMING, w, h);
-
+
}
else
{
- sdl->texture_id = SDL_CreateTexture(fmt, SDL_TEXTUREACCESS_STREAMING,
+ sdl->texture_id = SDL_CreateTexture(fmt, SDL_TEXTUREACCESS_STREAMING,
tempwidth, tempheight);
}
@@ -315,18 +315,18 @@ static void yuv_overlay_init(sdl_window_info *window)
minimum_width *= video_config.prescale;
minimum_height *= video_config.prescale;
}
-
+
if (sdl->yuvsurf != NULL)
{
SDL_FreeYUVOverlay(sdl->yuvsurf);
sdl->yuvsurf = NULL;
}
-
+
if (sdl->yuv_bitmap != NULL)
{
global_free(sdl->yuv_bitmap);
}
-
+
mame_printf_verbose("SDL: Creating %d x %d YUV-Overlay ...\n", minimum_width, minimum_height);
sdl->yuv_bitmap = global_alloc_array(UINT16, minimum_width*minimum_height);
@@ -338,7 +338,7 @@ static void yuv_overlay_init(sdl_window_info *window)
mame_printf_error("SDL: Couldn't create SDL_yuv_overlay: %s\n", SDL_GetError());
//return 1;
}
-
+
sdl->hw_scale_width = minimum_width;
sdl->hw_scale_height = minimum_height;
@@ -363,7 +363,7 @@ static void drawsdl_show_info(sdl_window_info *window, struct SDL_RendererInfo *
static struct {
int flag;
const char *name;
- } rflist[] =
+ } rflist[] =
{
RF_ENTRY(SDL_RENDERER_SINGLEBUFFER),
RF_ENTRY(SDL_RENDERER_PRESENTCOPY),
@@ -375,7 +375,7 @@ static void drawsdl_show_info(sdl_window_info *window, struct SDL_RendererInfo *
{-1, NULL}
};
int i;
-
+
mame_printf_verbose("window: using renderer %s\n", render_info->name ? render_info->name : "<unknown>");
for (i = 0; rflist[i].name != NULL; i++)
if (render_info->flags & rflist[i].flag)
@@ -396,17 +396,17 @@ static int drawsdl_window_create(sdl_window_info *window, int width, int height)
memset(sdl, 0, sizeof(sdl_info));
window->dxdata = sdl;
-
+
sdl->scale_mode = &scale_modes[window->scale_mode];
-
+
#if (SDL_VERSION_ATLEAST(1,3,0))
- sdl->extra_flags = (window->fullscreen ?
+ sdl->extra_flags = (window->fullscreen ?
SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_FOCUS | SDL_WINDOW_MOUSE_FOCUS
| SDL_WINDOW_INPUT_GRABBED : SDL_WINDOW_RESIZABLE);
SDL_SelectVideoDisplay(window->monitor->handle);
- if (window->fullscreen && video_config.switchres)
+ if (window->fullscreen && video_config.switchres)
{
SDL_DisplayMode mode;
SDL_GetCurrentDisplayMode(&mode);
@@ -418,45 +418,45 @@ static int drawsdl_window_create(sdl_window_info *window, int width, int height)
}
else
SDL_SetWindowDisplayMode(window->window_id, NULL); // Use desktop
-
+
window->window_id = SDL_CreateWindow(window->title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
width, height, sdl->extra_flags);
SDL_ShowWindow(window->window_id);
-
+
SDL_SetWindowFullscreen(window->window_id, window->fullscreen);
- SDL_GetWindowSize(window->window_id, &window->width, &window->height);
+ SDL_GetWindowSize(window->window_id, &window->width, &window->height);
SDL_RaiseWindow(window->window_id);
-
+
/* FIXME: Bug in SDL 1.3 */
if (window->fullscreen)
SDL_SetWindowGrab(window->window_id, 1);
// create a texture
-
- if (video_config.waitvsync)
+
+ if (video_config.waitvsync)
SDL_CreateRenderer(window->window_id, -1, SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC);
else
SDL_CreateRenderer(window->window_id, -1, SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTDISCARD);
-
+
SDL_SelectRenderer(window->window_id);
-
+
{
struct SDL_RendererInfo render_info;
SDL_GetRendererInfo(&render_info);
-
+
drawsdl_show_info(window, &render_info);
// Check scale mode
-
+
if (sdl->scale_mode->pixel_format)
{
int i;
int found = 0;
-
+
for (i=0; i < render_info.num_texture_formats; i++)
if (sdl->scale_mode->pixel_format == render_info.texture_formats[i])
found = 1;
-
+
if (!found)
{
mame_printf_verbose("window: Scale mode %s not supported! Using default.\n", sdl->scale_mode->name);
@@ -465,14 +465,14 @@ static int drawsdl_window_create(sdl_window_info *window, int width, int height)
}
}
}
-
+
setup_texture(window, width, height);
#else
sdl->extra_flags = (window->fullscreen ? SDL_FULLSCREEN : SDL_RESIZABLE);
sdl->extra_flags |= sdl->scale_mode->extra_flags;
- sdl->sdlsurf = SDL_SetVideoMode(width, height,
+ sdl->sdlsurf = SDL_SetVideoMode(width, height,
0, SDL_SWSURFACE | SDL_ANYFORMAT | sdl->extra_flags);
if (!sdl->sdlsurf)
@@ -480,7 +480,7 @@ static int drawsdl_window_create(sdl_window_info *window, int width, int height)
window->width = sdl->sdlsurf->w;
window->height = sdl->sdlsurf->h;
-
+
if (sdl->scale_mode->is_yuv)
yuv_overlay_init(window);
@@ -489,7 +489,7 @@ static int drawsdl_window_create(sdl_window_info *window, int width, int height)
#endif
sdl->yuv_lookup = NULL;
sdl->blittimer = 0;
-
+
drawsdl_yuv_init(sdl);
return 0;
}
@@ -516,7 +516,7 @@ static void drawsdl_window_resize(sdl_window_info *window, int width, int height
SDL_FreeSurface(sdl->sdlsurf);
//printf("SetVideoMode %d %d\n", wp->resize_new_width, wp->resize_new_height);
- sdl->sdlsurf = SDL_SetVideoMode(width, height, 0,
+ sdl->sdlsurf = SDL_SetVideoMode(width, height, 0,
SDL_SWSURFACE | SDL_ANYFORMAT | sdl->extra_flags);
window->width = sdl->sdlsurf->w;
window->height = sdl->sdlsurf->h;
@@ -525,7 +525,7 @@ static void drawsdl_window_resize(sdl_window_info *window, int width, int height
{
yuv_overlay_init(window);
}
-
+
#endif
}
@@ -583,7 +583,7 @@ static void drawsdl_window_destroy(sdl_window_info *window)
static void drawsdl_window_clear(sdl_window_info *window)
{
sdl_info *sdl = (sdl_info *) window->dxdata;
-
+
sdl->blittimer = 3;
}
@@ -618,7 +618,7 @@ static int drawsdl_xy_to_render_target(sdl_window_info *window, int x, int y, in
static const render_primitive_list *drawsdl_window_get_primitives(sdl_window_info *window)
{
sdl_info *sdl = (sdl_info *) window->dxdata;
-
+
if ((!window->fullscreen) || (video_config.switchres))
{
sdlwindow_blit_surface_size(window, window->width, window->height);
@@ -665,7 +665,7 @@ static int drawsdl_window_draw(sdl_window_info *window, UINT32 dc, int update)
gmask = sdl->sdlsurf->format->Gmask;
bmask = sdl->sdlsurf->format->Bmask;
amask = sdl->sdlsurf->format->Amask;
-
+
if (window->blitwidth != sdl->old_blitwidth || window->blitheight != sdl->old_blitheight)
{
if (sdl->scale_mode->is_yuv)
@@ -684,7 +684,7 @@ static int drawsdl_window_draw(sdl_window_info *window, UINT32 dc, int update)
sdl->blittimer--;
}
-
+
if (sdl->scale_mode->is_yuv)
{
SDL_LockYUVOverlay(sdl->yuvsurf);
@@ -704,11 +704,11 @@ static int drawsdl_window_draw(sdl_window_info *window, UINT32 dc, int update)
sdl->old_blitheight = window->blitheight;
sdl->blittimer = 3;
}
-
+
{
Uint32 format;
int access, w, h;
-
+
SDL_QueryTexture(sdl->texture_id, &format, &access, &w, &h);
SDL_PixelFormatEnumToMasks(format, &bpp, &rmask, &gmask, &bmask, &amask);
bpp = bpp / 8; /* convert to bytes per pixels */
@@ -723,7 +723,7 @@ static int drawsdl_window_draw(sdl_window_info *window, UINT32 dc, int update)
//SDL_RenderFill(0,0,0,0 /*255*/,NULL);
sdl->blittimer--;
}
-
+
SDL_LockTexture(sdl->texture_id, NULL, 1, (void **) &surfptr, &pitch);
#endif
@@ -749,7 +749,7 @@ static int drawsdl_window_draw(sdl_window_info *window, UINT32 dc, int update)
// do not crash if the window's smaller than the blit area
if (blitheight > ch)
{
- blitheight = ch;
+ blitheight = ch;
}
else if (video_config.centerv)
{
@@ -758,7 +758,7 @@ static int drawsdl_window_draw(sdl_window_info *window, UINT32 dc, int update)
if (blitwidth > cw)
{
- blitwidth = cw;
+ blitwidth = cw;
}
else if (video_config.centerh)
{
@@ -767,14 +767,14 @@ static int drawsdl_window_draw(sdl_window_info *window, UINT32 dc, int update)
sdl->last_hofs = hofs;
sdl->last_vofs = vofs;
-
+
osd_lock_acquire(window->primlist->lock);
// render to it
if (!sdl->scale_mode->is_yuv)
{
int mamewidth, mameheight;
-
+
if (!sdl->scale_mode->is_scale)
{
mamewidth = blitwidth;
@@ -814,7 +814,7 @@ static int drawsdl_window_draw(sdl_window_info *window, UINT32 dc, int update)
mame_printf_error("SDL: ERROR! Unknown video mode: R=%08X G=%08X B=%08X\n", rmask, gmask, bmask);
break;
}
- }
+ }
else
{
assert (sdl->yuv_bitmap != NULL);
@@ -938,7 +938,7 @@ static int drawsdl_window_draw(sdl_window_info *window, UINT32 dc, int update)
(u) = (( -4878*(r) - 9578*(g) + 14456*(b) + 4210688) >> 15); \
(v) = (( 14456*(r) - 12105*(g) - 2351*(b) + 4210688) >> 15)
-#ifdef LSB_FIRST
+#ifdef LSB_FIRST
#define Y1MASK 0x000000FF
#define UMASK 0x0000FF00
#define Y2MASK 0x00FF0000
@@ -961,7 +961,7 @@ static int drawsdl_window_draw(sdl_window_info *window, UINT32 dc, int update)
#define YMASK (Y1MASK|Y2MASK)
#define UVMASK (UMASK|VMASK)
-static void yuv_lookup_set(sdl_info *sdl, unsigned int pen, unsigned char red,
+static void yuv_lookup_set(sdl_info *sdl, unsigned int pen, unsigned char red,
unsigned char green, unsigned char blue)
{
UINT32 y,u,v;
@@ -969,7 +969,7 @@ static void yuv_lookup_set(sdl_info *sdl, unsigned int pen, unsigned char red,
RGB2YUV(red,green,blue,y,u,v);
/* Storing this data in YUYV order simplifies using the data for
- YUY2, both with and without smoothing... */
+ YUY2, both with and without smoothing... */
sdl->yuv_lookup[pen]=(y<<Y1SHIFT)|(u<<USHIFT)|(y<<Y2SHIFT)|(v<<VSHIFT);
}
@@ -983,7 +983,7 @@ static void drawsdl_yuv_init(sdl_info *sdl)
for (b = 0; b < 32; b++)
{
int idx = (r << 10) | (g << 5) | b;
- yuv_lookup_set(sdl, idx,
+ yuv_lookup_set(sdl, idx,
(r << 3) | (r >> 2),
(g << 3) | (g >> 2),
(b << 3) | (b >> 2));
@@ -996,16 +996,16 @@ static void yuv_RGB_to_YV12(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch
UINT8 *dest_y;
UINT8 *dest_u;
UINT8 *dest_v;
- UINT16 *src;
+ UINT16 *src;
UINT16 *src2;
UINT32 *lookup = sdl->yuv_lookup;
UINT8 *pixels[3];
int u1,v1,y1,u2,v2,y2,u3,v3,y3,u4,v4,y4; /* 12 */
-
+
pixels[0] = ptr;
pixels[1] = ptr + pitch * sdl->hw_scale_height;
pixels[2] = pixels[1] + pitch * sdl->hw_scale_height / 4;
-
+
for(y=0;y<sdl->hw_scale_height;y+=2)
{
src=bitmap + (y * sdl->hw_scale_width) ;
@@ -1044,13 +1044,13 @@ static void yuv_RGB_to_YV12(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch
dest_u[x>>1] = (u1+u2+u3+u4)/4;
dest_v[x>>1] = (v1+v2+v3+v4)/4;
-
+
}
}
}
static void yuv_RGB_to_YV12X2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch)
-{
+{
/* this one is used when scale==2 */
unsigned int x,y;
UINT16 *dest_y;
@@ -1087,7 +1087,7 @@ static void yuv_RGB_to_YV12X2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pit
}
static void yuv_RGB_to_YUY2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch)
-{
+{
/* this one is used when scale==2 */
unsigned int y;
UINT32 *dest;
@@ -1116,7 +1116,7 @@ static void yuv_RGB_to_YUY2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch
}
static void yuv_RGB_to_YUY2X2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch)
-{
+{
/* this one is used when scale==2 */
unsigned int y;
UINT32 *dest;
diff --git a/src/osd/sdl/dview.c b/src/osd/sdl/dview.c
index 43991824706..37b917150ff 100644
--- a/src/osd/sdl/dview.c
+++ b/src/osd/sdl/dview.c
@@ -104,9 +104,9 @@ static void dview_hadj_changed(GtkAdjustment *adj, DView *dv)
debug_view_xy pos;
UINT32 v = (UINT32)(adj->value);
- pos = debug_view_get_visible_position(dv->dw);
+ pos = debug_view_get_visible_position(dv->dw);
- if (v != pos.x)
+ if (v != pos.x)
{
pos.x = v;
debug_view_set_visible_position(dv->dw, pos);
@@ -119,9 +119,9 @@ static void dview_vadj_changed(GtkAdjustment *adj, DView *dv)
debug_view_xy pos;
UINT32 v = (UINT32)(adj->value);
- pos = debug_view_get_visible_position(dv->dw);
+ pos = debug_view_get_visible_position(dv->dw);
- if (v != pos.y)
+ if (v != pos.y)
{
pos.y = v;
debug_view_set_visible_position(dv->dw, pos);
@@ -147,7 +147,7 @@ static void dview_realize(GtkWidget *wdv)
attributes.visual = gtk_widget_get_visual(wdv);
attributes.colormap = gtk_widget_get_colormap(wdv);
attributes.event_mask = gtk_widget_get_events(wdv) | GDK_EXPOSURE_MASK;
-
+
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
wdv->window = gdk_window_new(gtk_widget_get_parent_window(wdv), &attributes, attributes_mask);
@@ -166,7 +166,7 @@ static void dview_size_allocate(GtkWidget *wdv, GtkAllocation *allocation)
int ovs = dv->vs;
debug_view_xy size, pos, col, vsize;
- pos = debug_view_get_visible_position(dv->dw);
+ pos = debug_view_get_visible_position(dv->dw);
size = debug_view_get_total_size(dv->dw);
dv->tr = size.y;
@@ -210,7 +210,7 @@ static void dview_size_allocate(GtkWidget *wdv, GtkAllocation *allocation)
vsize.x = size.x-pos.x;
}
- debug_view_set_visible_position(dv->dw, pos);
+ debug_view_set_visible_position(dv->dw, pos);
debug_view_set_visible_size(dv->dw, vsize);
if(GTK_WIDGET_REALIZED(wdv))
@@ -240,7 +240,7 @@ static void dview_size_allocate(GtkWidget *wdv, GtkAllocation *allocation)
dv->hadj->page_increment = span;
dv->hadj->page_size = span;
gtk_adjustment_changed(dv->hadj);
- debug_view_set_visible_position(dv->dw, pos);
+ debug_view_set_visible_position(dv->dw, pos);
} else {
if(ohs)
gtk_widget_hide(dv->hscrollbar);
@@ -268,7 +268,7 @@ static void dview_size_allocate(GtkWidget *wdv, GtkAllocation *allocation)
dv->vadj->page_increment = span;
dv->vadj->page_size = span;
gtk_adjustment_changed(dv->vadj);
- debug_view_set_visible_position(dv->dw, pos);
+ debug_view_set_visible_position(dv->dw, pos);
} else {
if(ovs)
gtk_widget_hide(dv->vscrollbar);
@@ -334,7 +334,7 @@ static void dview_class_init(DViewClass *dvc)
if(!dvc->fixedfont)
dvc->fixedfont = pango_font_description_from_string("Monospace 10");
-
+
if(!dvc->fixedfont) {
mame_printf_error("Couldn't find a monospace font, aborting\n");
abort();
@@ -357,7 +357,7 @@ static void dview_init(DView *dv)
if(!dvc->fixedfont_width) {
PangoFontMetrics *metrics;
metrics = pango_context_get_metrics(gtk_widget_get_pango_context(GTK_WIDGET(dv)), dvc->fixedfont, 0);
-
+
dvc->fixedfont_width = PANGO_PIXELS(pango_font_metrics_get_approximate_char_width(metrics));
dvc->fixedfont_height = PANGO_PIXELS(pango_font_metrics_get_ascent(metrics) +
pango_font_metrics_get_descent(metrics));
diff --git a/src/osd/sdl/gl_shader_mgr.c b/src/osd/sdl/gl_shader_mgr.c
index 0707ed47656..fa0915c3ab1 100644
--- a/src/osd/sdl/gl_shader_mgr.c
+++ b/src/osd/sdl/gl_shader_mgr.c
@@ -75,9 +75,9 @@ static const char * glsl_mamebm_filter_names [GLSL_SHADER_FEAT_MAX_NUMBER] =
static GLhandleARB glsl_mamebm_programs [GLSL_SHADER_TYPE_NUMBER][GLSL_SHADER_FEAT_MAX_NUMBER+9] =
{
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* idx16 lut: plain, bilinear, custom0-9, .. */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* rgb32 lut: plain, bilinear, custom0-9, .. */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* rgb32 dir: plain, bilinear, custom0-9, .. */
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* idx16 lut: plain, bilinear, custom0-9, .. */
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* rgb32 lut: plain, bilinear, custom0-9, .. */
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* rgb32 dir: plain, bilinear, custom0-9, .. */
};
/**
@@ -85,31 +85,31 @@ static GLhandleARB glsl_mamebm_programs [GLSL_SHADER_TYPE_NUMBER][GLSL_SHADER_FE
*/
static int glsl_mamebm_fsh2vsh[GLSL_SHADER_FEAT_MAX_NUMBER] =
{
- 0, // plain -> general
- 0, // bilinear -> general
+ 0, // plain -> general
+ 0, // bilinear -> general
1, // custom -> custom
};
-static GLhandleARB glsl_mamebm_vsh_shader[GLSL_VERTEX_SHADER_MAX_NUMBER+9] =
+static GLhandleARB glsl_mamebm_vsh_shader[GLSL_VERTEX_SHADER_MAX_NUMBER+9] =
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* general, custom0-9 */
static GLhandleARB glsl_mamebm_fsh_shader [GLSL_SHADER_TYPE_NUMBER][GLSL_SHADER_FEAT_MAX_NUMBER+9] =
{
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* idx16 lut: plain, bilinear, custom0-9 */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* rgb32 lut: plain, bilinear, custom0-9 */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* rgb32 dir: plain, bilinear, custom0-9 */
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* idx16 lut: plain, bilinear, custom0-9 */
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* rgb32 lut: plain, bilinear, custom0-9 */
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* rgb32 dir: plain, bilinear, custom0-9 */
};
static GLhandleARB glsl_scrn_programs [10] =
{
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* rgb32: custom0-9, .. */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* rgb32: custom0-9, .. */
};
-static GLhandleARB glsl_scrn_vsh_shader[10] =
+static GLhandleARB glsl_scrn_vsh_shader[10] =
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* custom0-9 */
static GLhandleARB glsl_scrn_fsh_shader [10] =
-{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* rgb32: custom0-9 */
+{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* rgb32: custom0-9 */
const char * glsl_shader_get_filter_name_mamebm(int glslShaderFeature)
{
@@ -144,16 +144,16 @@ glsl_shader_info *glsl_shader_init(void)
err = gl_shader_loadExtention((PFNGLGETPROCADDRESSOS)SDL_GL_GetProcAddress);
if(err) return NULL;
-
+
for (i=0; !err && i<GLSL_VERTEX_SHADER_INT_NUMBER; i++)
{
#ifdef GLSL_SOURCE_ON_DISK
if(glsl_mamebm_vsh_files[i])
- err = gl_compile_shader_file ( &glsl_mamebm_vsh_shader[i], GL_VERTEX_SHADER_ARB,
+ err = gl_compile_shader_file ( &glsl_mamebm_vsh_shader[i], GL_VERTEX_SHADER_ARB,
glsl_mamebm_vsh_files[i], 0);
#else
if(glsl_mamebm_vsh_sources[i])
- err = gl_compile_shader_source( &glsl_mamebm_vsh_shader[i], GL_VERTEX_SHADER_ARB,
+ err = gl_compile_shader_source( &glsl_mamebm_vsh_shader[i], GL_VERTEX_SHADER_ARB,
glsl_mamebm_vsh_sources[i], 0);
#endif
}
@@ -166,14 +166,14 @@ glsl_shader_info *glsl_shader_init(void)
{
#ifdef GLSL_SOURCE_ON_DISK
if(glsl_mamebm_fsh_files[i][j])
- err = gl_compile_shader_files (&glsl_mamebm_programs[i][j],
- &glsl_mamebm_vsh_shader[glsl_mamebm_fsh2vsh[j]],
+ err = gl_compile_shader_files (&glsl_mamebm_programs[i][j],
+ &glsl_mamebm_vsh_shader[glsl_mamebm_fsh2vsh[j]],
&glsl_mamebmfsh_shader[i][j],
NULL /*precompiled*/, glsl_mamebm_fsh_files[i][j], 0);
#else
if(glsl_mamebm_fsh_sources[i][j])
- err = gl_compile_shader_sources(&glsl_mamebm_programs[i][j],
- &glsl_mamebm_vsh_shader[glsl_mamebm_fsh2vsh[j]],
+ err = gl_compile_shader_sources(&glsl_mamebm_programs[i][j],
+ &glsl_mamebm_vsh_shader[glsl_mamebm_fsh2vsh[j]],
&glsl_mamebm_fsh_shader[i][j],
NULL /*precompiled*/, glsl_mamebm_fsh_sources[i][j]);
#endif
@@ -193,7 +193,7 @@ int glsl_shader_free(glsl_shader_info *shinfo)
for (i=0; i<GLSL_VERTEX_SHADER_MAX_NUMBER+9; i++)
{
if ( glsl_mamebm_vsh_shader[i] )
- (void) gl_delete_shader( NULL, &glsl_mamebm_vsh_shader[i], NULL);
+ (void) gl_delete_shader( NULL, &glsl_mamebm_vsh_shader[i], NULL);
}
for (i=0; i<GLSL_SHADER_TYPE_NUMBER; i++)
@@ -217,7 +217,7 @@ int glsl_shader_free(glsl_shader_info *shinfo)
for (i=0; i<10; i++)
{
if ( glsl_scrn_vsh_shader[i] )
- (void) gl_delete_shader( NULL, &glsl_scrn_vsh_shader[i], NULL);
+ (void) gl_delete_shader( NULL, &glsl_scrn_vsh_shader[i], NULL);
if ( glsl_scrn_fsh_shader[i] )
(void) gl_delete_shader( NULL, NULL, &glsl_scrn_fsh_shader[i]);
if ( glsl_scrn_programs[i] )
@@ -253,7 +253,7 @@ int glsl_shader_add_mamebm(glsl_shader_info *shinfo, const char * custShaderPref
break;
}
- err = gl_compile_shader_files (&glsl_mamebm_programs[i][GLSL_SHADER_FEAT_CUSTOM+idx],
+ err = gl_compile_shader_files (&glsl_mamebm_programs[i][GLSL_SHADER_FEAT_CUSTOM+idx],
&glsl_mamebm_vsh_shader[GLSL_VERTEX_SHADER_CUSTOM+idx],
&glsl_mamebm_fsh_shader[i][GLSL_SHADER_FEAT_CUSTOM+idx],
NULL /*precompiled*/, fname, 0);
@@ -273,7 +273,7 @@ int glsl_shader_add_scrn(glsl_shader_info *shinfo, const char * custShaderPrefix
snprintf(fname, 8192, "%s.fsh", custShaderPrefix); fname[8191]=0;
- err = gl_compile_shader_files (&glsl_scrn_programs[idx],
+ err = gl_compile_shader_files (&glsl_scrn_programs[idx],
&glsl_scrn_vsh_shader[idx],
&glsl_scrn_fsh_shader[idx],
NULL /*precompiled*/, fname, 0);
diff --git a/src/osd/sdl/gl_shader_tool.c b/src/osd/sdl/gl_shader_tool.c
index e3e8e1fb8e9..6c501a456bd 100644
--- a/src/osd/sdl/gl_shader_tool.c
+++ b/src/osd/sdl/gl_shader_tool.c
@@ -8,22 +8,22 @@
* Dual license: MAME and GPL version 2
*
* This module has a dual license, i.e. it is compatible to MAME,
- * but I like to reserve my rights to use this module under
+ * but I like to reserve my rights to use this module under
* the GPL as well.
*
* GPL license:
* Visit http://www.gnu.org/copyleft/gpl.html
*
* MAME license:
- * Visit http://mamedev.org for licensing and usage restrictions.
+ * Visit http://mamedev.org for licensing and usage restrictions.
*
*
* OpenGL GLSL ARB extentions:
*
- * GL_ARB_shader_objects
- * GL_ARB_shading_language_100
- * GL_ARB_vertex_shader
- * GL_ARB_fragment_shader
+ * GL_ARB_shader_objects
+ * GL_ARB_shading_language_100
+ * GL_ARB_vertex_shader
+ * GL_ARB_fragment_shader
*
*/
@@ -86,9 +86,9 @@ int gl_shader_loadExtention(PFNGLGETPROCADDRESSOS GetProcAddress)
if ( pfn_glGetObjectParameterivARB && pfn_glGetInfoLogARB && pfn_glDeleteObjectARB && pfn_glCreateShaderObjectARB &&
pfn_glShaderSourceARB && pfn_glCompileShaderARB && pfn_glCreateProgramObjectARB && pfn_glAttachObjectARB &&
pfn_glLinkProgramARB && pfn_glValidateProgramARB && pfn_glUseProgramObjectARB && pfn_glGetUniformLocationARB &&
- pfn_glGetUniformLocationARB && pfn_glUniform1fARB && pfn_glUniform1iARB &&
- pfn_glUniform1fvARB && pfn_glUniform2fvARB && pfn_glUniform3fvARB && pfn_glUniform4fvARB &&
- pfn_glUniform1ivARB && pfn_glUniform2ivARB && pfn_glUniform3ivARB && pfn_glUniform4ivARB
+ pfn_glGetUniformLocationARB && pfn_glUniform1fARB && pfn_glUniform1iARB &&
+ pfn_glUniform1fvARB && pfn_glUniform2fvARB && pfn_glUniform3fvARB && pfn_glUniform4fvARB &&
+ pfn_glUniform1ivARB && pfn_glUniform2ivARB && pfn_glUniform3ivARB && pfn_glUniform4ivARB
)
{
return 0;
@@ -170,7 +170,7 @@ int gl_shader_check_error(GLhandleARB obj, GLenum obj_query, GLSLCheckMode m, co
if ( CHECK_VERBOSE <= m )
mame_printf_warning("%s:%d: GL Error: object type 0x%X generation failed\n", file, line, (unsigned int)obj);
res=-1;
- } else if ( CHECK_ALWAYS_VERBOSE <= m )
+ } else if ( CHECK_ALWAYS_VERBOSE <= m )
{
if(param==GL_PROGRAM_OBJECT_ARB)
mame_printf_warning("%s:%d: GL Error: object type 0x%X is PROGRAM, successful\n", file, line, (unsigned int)obj);
@@ -183,7 +183,7 @@ int gl_shader_check_error(GLhandleARB obj, GLenum obj_query, GLSLCheckMode m, co
{
if ( CHECK_ALWAYS_VERBOSE <= m )
mame_printf_warning("%s:%d: GL Info: object 0x%X not yet marked for deletion\n", file, line, (unsigned int)obj);
- } else if ( CHECK_ALWAYS_VERBOSE <= m )
+ } else if ( CHECK_ALWAYS_VERBOSE <= m )
{
mame_printf_warning("%s:%d: GL Info: object 0x%X deletion successful\n", file, line, (unsigned int)obj);
}
@@ -194,7 +194,7 @@ int gl_shader_check_error(GLhandleARB obj, GLenum obj_query, GLSLCheckMode m, co
if ( CHECK_VERBOSE <= m )
mame_printf_warning("%s:%d: GL Error: object 0x%X compilation failed\n", file, line, (unsigned int)obj);
res=-1;
- } else if ( CHECK_ALWAYS_VERBOSE <= m )
+ } else if ( CHECK_ALWAYS_VERBOSE <= m )
{
mame_printf_warning("%s:%d: GL Info: object 0x%X compiled successful\n", file, line, (unsigned int)obj);
}
@@ -205,7 +205,7 @@ int gl_shader_check_error(GLhandleARB obj, GLenum obj_query, GLSLCheckMode m, co
if ( CHECK_VERBOSE <= m )
mame_printf_warning("%s:%d: GL Error: object 0x%X linking failed\n", file, line, (unsigned int)obj);
res=-1;
- } else if ( CHECK_ALWAYS_VERBOSE <= m )
+ } else if ( CHECK_ALWAYS_VERBOSE <= m )
{
mame_printf_warning("%s:%d: GL Info: object 0x%X linked successful\n", file, line, (unsigned int)obj);
}
@@ -216,7 +216,7 @@ int gl_shader_check_error(GLhandleARB obj, GLenum obj_query, GLSLCheckMode m, co
if ( CHECK_VERBOSE <= m )
mame_printf_warning("%s:%d: GL Error: object 0x%X validation failed\n", file, line, (unsigned int)obj);
res=-1;
- } else if ( CHECK_ALWAYS_VERBOSE <= m )
+ } else if ( CHECK_ALWAYS_VERBOSE <= m )
{
mame_printf_warning("%s:%d: GL Info: object 0x%X validation successful\n", file, line, (unsigned int)obj);
}
@@ -250,8 +250,8 @@ int gl_round_to_pow2(int v)
return v;
}
-int gl_texture_check_size(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height,
- GLint border, GLenum format, GLenum type,
+int gl_texture_check_size(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height,
+ GLint border, GLenum format, GLenum type,
GLint *avail_width, GLint *avail_height,
int verbose)
{
@@ -265,7 +265,7 @@ int gl_texture_check_size(GLenum target, GLint level, GLint internalFormat, GLsi
*avail_height = 0;
GL_CHECK_ERROR_QUIET();
-
+
/* Test the max texture size */
while(err && width>=1 && height>=1 /* && width>=64 && height>=64 */)
{
@@ -275,8 +275,8 @@ int gl_texture_check_size(GLenum target, GLint level, GLint internalFormat, GLsi
border, format, type, NULL);
if ( 0!=(err=GL_CHECK_ERROR_NORMAL() )) return err;
- glGetTexLevelParameteriv( texTargetProxy, level, GL_TEXTURE_WIDTH, avail_width);
- glGetTexLevelParameteriv( texTargetProxy, level, GL_TEXTURE_HEIGHT, avail_height);
+ glGetTexLevelParameteriv( texTargetProxy, level, GL_TEXTURE_WIDTH, avail_width);
+ glGetTexLevelParameteriv( texTargetProxy, level, GL_TEXTURE_HEIGHT, avail_height);
if ( 0!=(err=GL_CHECK_ERROR_NORMAL() )) return err;
if ( (*avail_width) != width || (*avail_height) != height )
@@ -286,9 +286,9 @@ int gl_texture_check_size(GLenum target, GLint level, GLint internalFormat, GLsi
if(verbose)
{
mame_printf_warning("gl_texture_size_check: "
- "TexImage2D(0x%X, %d, 0x%X, %d, %d, %d, 0x%X, 0x%X): returned size does not match: %dx%d\n",
- (unsigned int)target, (int)level, (int)internalFormat,
- (int)width, (int)height, (int)border, (unsigned int)format, (unsigned int)type,
+ "TexImage2D(0x%X, %d, 0x%X, %d, %d, %d, 0x%X, 0x%X): returned size does not match: %dx%d\n",
+ (unsigned int)target, (int)level, (int)internalFormat,
+ (int)width, (int)height, (int)border, (unsigned int)format, (unsigned int)type,
(int)*avail_width, (int)*avail_height);
}
@@ -351,7 +351,7 @@ static int delete_shader_tool( GLhandleARB *program, GLhandleARB *vertex_shader,
return 0;
}
-
+
int gl_compile_shader_source( GLhandleARB *shader, GLenum type, const char * shader_source, int verbose )
{
int err = 0;
diff --git a/src/osd/sdl/gl_shader_tool.h b/src/osd/sdl/gl_shader_tool.h
index 50700457abb..dd59906ae1e 100644
--- a/src/osd/sdl/gl_shader_tool.h
+++ b/src/osd/sdl/gl_shader_tool.h
@@ -8,22 +8,22 @@
* Dual license: MAME and GPL version 2
*
* This module has a dual license, i.e. it is compatible to MAME,
- * but I like to reserve my rights to use this module under
+ * but I like to reserve my rights to use this module under
* the GPL as well.
*
* GPL license:
* Visit http://www.gnu.org/copyleft/gpl.html
*
* MAME license:
- * Visit http://mamedev.org for licensing and usage restrictions.
+ * Visit http://mamedev.org for licensing and usage restrictions.
*
*
* OpenGL GLSL ARB extentions:
*
- * GL_ARB_shader_objects
- * GL_ARB_shading_language_100
- * GL_ARB_vertex_shader
- * GL_ARB_fragment_shader
+ * GL_ARB_shader_objects
+ * GL_ARB_shading_language_100
+ * GL_ARB_vertex_shader
+ * GL_ARB_fragment_shader
*
*/
@@ -99,18 +99,18 @@ typedef enum {
int gl_check_error(GLSLCheckMode m, const char *file, const int line);
-int gl_texture_check_size(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height,
- GLint border, GLenum format, GLenum type,
+int gl_texture_check_size(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height,
+ GLint border, GLenum format, GLenum type,
GLsizei *avail_width, GLsizei *avail_height,
int verbose);
int gl_round_to_pow2(int v);
/**
- * @param obj_query Can be either GL_OBJECT_TYPE_ARB, GL_OBJECT_DELETE_STATUS_ARB, GL_OBJECT_COMPILE_STATUS_ARB,
+ * @param obj_query Can be either GL_OBJECT_TYPE_ARB, GL_OBJECT_DELETE_STATUS_ARB, GL_OBJECT_COMPILE_STATUS_ARB,
* GL_OBJECT_LINK_STATUS_ARB, GL_OBJECT_VALIDATE_STATUS_ARB
- * Should be used after the refering action, i.e. GL_OBJECT_DELETE_STATUS_ARB after a
- * glDeleteObjectARB call, etc.
+ * Should be used after the refering action, i.e. GL_OBJECT_DELETE_STATUS_ARB after a
+ * glDeleteObjectARB call, etc.
*/
int gl_shader_check_error(GLhandleARB obj, GLenum obj_query, GLSLCheckMode m, const char *file, const int line);
@@ -138,7 +138,7 @@ int gl_compile_shader_sources( GLhandleARB *program, GLhandleARB *vertex_shader,
int gl_delete_shader( GLhandleARB *program, GLhandleARB *vertex_shader, GLhandleARB *fragment_shader );
-#if defined(SDLMAME_MACOSX)
+#if defined(SDLMAME_MACOSX)
#ifndef GL_ARB_shader_objects
typedef char GLcharARB;
typedef unsigned int GLhandleARB;
diff --git a/src/osd/sdl/input.c b/src/osd/sdl/input.c
index 4442993bee5..d196f44415b 100644
--- a/src/osd/sdl/input.c
+++ b/src/osd/sdl/input.c
@@ -7,7 +7,7 @@
//
// SDLMAME by Olivier Galibert and R. Belmont
//
-// SixAxis info: left analog is axes 0 & 1, right analog is axes 2 & 3,
+// SixAxis info: left analog is axes 0 & 1, right analog is axes 2 & 3,
// analog L2 is axis 12 and analog L3 is axis 13
//
//============================================================
@@ -74,7 +74,7 @@ enum
typedef struct _keyboard_state keyboard_state;
struct _keyboard_state
{
- INT32 state[0x3ff]; // must be INT32!
+ INT32 state[0x3ff]; // must be INT32!
INT8 oldkey[MAX_KEYS];
INT8 currkey[MAX_KEYS];
};
@@ -106,8 +106,8 @@ struct _device_info
// device information
device_info ** head;
device_info * next;
- char * name;
-
+ char * name;
+
// MAME information
input_device * device;
@@ -132,7 +132,7 @@ static UINT8 input_paused;
static sdl_window_info * focus_window = NULL;
// input buffer - only for SDLMAME_EVENTS_IN_WORKER_THREAD
-#define MAX_BUF_EVENTS (500) /* 100 not enough for SDL 1.3 */
+#define MAX_BUF_EVENTS (500) /* 100 not enough for SDL 1.3 */
static SDL_Event event_buf[MAX_BUF_EVENTS];
static int event_buf_count;
@@ -154,7 +154,7 @@ static device_info * joystick_list;
// joystick mapper
typedef struct _device_map_t device_map_t;
-struct _device_map_t
+struct _device_map_t
{
struct {
char *name;
@@ -201,10 +201,10 @@ typedef struct _kt_table kt_table;
struct _kt_table {
INT32 mame_key;
INT32 sdl_key;
- //const char * vkey;
- //const char * ascii;
- const char * mame_key_name;
- char * ui_name;
+ //const char * vkey;
+ //const char * ascii;
+ const char * mame_key_name;
+ char * ui_name;
};
#if (SDL_VERSION_ATLEAST(1,3,0))
@@ -226,18 +226,18 @@ struct _kt_table {
static kt_table sdl_key_trans_table[] =
{
- // MAME key SDL key vkey ascii
+ // MAME key SDL key vkey ascii
KTT_ENTRY0( ESC, ESCAPE, 0x1b, 0x1b, "ESC" ),
- KTT_ENTRY1( 1, 1 ),
- KTT_ENTRY1( 2, 2 ),
- KTT_ENTRY1( 3, 3 ),
- KTT_ENTRY1( 4, 4 ),
- KTT_ENTRY1( 5, 5 ),
- KTT_ENTRY1( 6, 6 ),
- KTT_ENTRY1( 7, 7 ),
- KTT_ENTRY1( 8, 8 ),
- KTT_ENTRY1( 9, 9 ),
- KTT_ENTRY1( 0, 0 ),
+ KTT_ENTRY1( 1, 1 ),
+ KTT_ENTRY1( 2, 2 ),
+ KTT_ENTRY1( 3, 3 ),
+ KTT_ENTRY1( 4, 4 ),
+ KTT_ENTRY1( 5, 5 ),
+ KTT_ENTRY1( 6, 6 ),
+ KTT_ENTRY1( 7, 7 ),
+ KTT_ENTRY1( 8, 8 ),
+ KTT_ENTRY1( 9, 9 ),
+ KTT_ENTRY1( 0, 0 ),
KTT_ENTRY0( MINUS, MINUS, 0xbd, '-', "MINUS" ),
KTT_ENTRY0( EQUALS, EQUALS, 0xbb, '=', "EQUALS" ),
KTT_ENTRY0( BACKSPACE, BACKSPACE, 0x08, 0x08, "BACKSPACE" ),
@@ -252,9 +252,9 @@ static kt_table sdl_key_trans_table[] =
KTT_ENTRY1( I, I ),
KTT_ENTRY1( O, O ),
KTT_ENTRY1( P, P ),
- KTT_ENTRY0( OPENBRACE, LEFTBRACKET, 0xdb, '[', "OPENBRACE" ),
- KTT_ENTRY0( CLOSEBRACE,RIGHTBRACKET, 0xdd, ']', "CLOSEBRACE" ),
- KTT_ENTRY0( ENTER, RETURN, 0x0d, 0x0d, "RETURN" ),
+ KTT_ENTRY0( OPENBRACE, LEFTBRACKET, 0xdb, '[', "OPENBRACE" ),
+ KTT_ENTRY0( CLOSEBRACE,RIGHTBRACKET, 0xdd, ']', "CLOSEBRACE" ),
+ KTT_ENTRY0( ENTER, RETURN, 0x0d, 0x0d, "RETURN" ),
KTT_ENTRY2( LCONTROL, LCTRL ),
KTT_ENTRY1( A, A ),
KTT_ENTRY1( S, S ),
@@ -267,8 +267,8 @@ static kt_table sdl_key_trans_table[] =
KTT_ENTRY1( L, L ),
KTT_ENTRY0( COLON, SEMICOLON, 0xba, ';', "COLON" ),
KTT_ENTRY0( QUOTE, APOSTROPHE, 0xde, '\'', "QUOTE" ),
- KTT_ENTRY2( LSHIFT, LSHIFT ),
- KTT_ENTRY0( BACKSLASH, BACKSLASH, 0xdc, '\\', "BACKSLASH" ),
+ KTT_ENTRY2( LSHIFT, LSHIFT ),
+ KTT_ENTRY0( BACKSLASH, BACKSLASH, 0xdc, '\\', "BACKSLASH" ),
KTT_ENTRY1( Z, Z ),
KTT_ENTRY1( X, X ),
KTT_ENTRY1( C, C ),
@@ -276,26 +276,26 @@ static kt_table sdl_key_trans_table[] =
KTT_ENTRY1( B, B ),
KTT_ENTRY1( N, N ),
KTT_ENTRY1( M, M ),
- KTT_ENTRY0( COMMA, COMMA, 0xbc, ',', "COMMA" ),
- KTT_ENTRY0( STOP, PERIOD, 0xbe, '.', "STOP" ),
- KTT_ENTRY0( SLASH, SLASH, 0xbf, '/', "SLASH" ),
- KTT_ENTRY2( RSHIFT, RSHIFT ),
- KTT_ENTRY0( ASTERISK, KP_MULTIPLY, '*', '*', "ASTERIX" ),
- KTT_ENTRY2( LALT, LALT ),
- KTT_ENTRY0( SPACE, SPACE, ' ', ' ', "SPACE" ),
- KTT_ENTRY2( CAPSLOCK, CAPSLOCK ),
- KTT_ENTRY2( F1, F1 ),
- KTT_ENTRY2( F2, F2 ),
- KTT_ENTRY2( F3, F3 ),
- KTT_ENTRY2( F4, F4 ),
- KTT_ENTRY2( F5, F5 ),
- KTT_ENTRY2( F6, F6 ),
- KTT_ENTRY2( F7, F7 ),
- KTT_ENTRY2( F8, F8 ),
- KTT_ENTRY2( F9, F9 ),
- KTT_ENTRY2( F10, F10 ),
- KTT_ENTRY2( NUMLOCK, NUMLOCKCLEAR ),
- KTT_ENTRY2( SCRLOCK, SCROLLLOCK ),
+ KTT_ENTRY0( COMMA, COMMA, 0xbc, ',', "COMMA" ),
+ KTT_ENTRY0( STOP, PERIOD, 0xbe, '.', "STOP" ),
+ KTT_ENTRY0( SLASH, SLASH, 0xbf, '/', "SLASH" ),
+ KTT_ENTRY2( RSHIFT, RSHIFT ),
+ KTT_ENTRY0( ASTERISK, KP_MULTIPLY, '*', '*', "ASTERIX" ),
+ KTT_ENTRY2( LALT, LALT ),
+ KTT_ENTRY0( SPACE, SPACE, ' ', ' ', "SPACE" ),
+ KTT_ENTRY2( CAPSLOCK, CAPSLOCK ),
+ KTT_ENTRY2( F1, F1 ),
+ KTT_ENTRY2( F2, F2 ),
+ KTT_ENTRY2( F3, F3 ),
+ KTT_ENTRY2( F4, F4 ),
+ KTT_ENTRY2( F5, F5 ),
+ KTT_ENTRY2( F6, F6 ),
+ KTT_ENTRY2( F7, F7 ),
+ KTT_ENTRY2( F8, F8 ),
+ KTT_ENTRY2( F9, F9 ),
+ KTT_ENTRY2( F10, F10 ),
+ KTT_ENTRY2( NUMLOCK, NUMLOCKCLEAR ),
+ KTT_ENTRY2( SCRLOCK, SCROLLLOCK ),
KTT_ENTRY2( 7_PAD, KP_7 ),
KTT_ENTRY2( 8_PAD, KP_8 ),
KTT_ENTRY2( 9_PAD, KP_9 ),
@@ -303,35 +303,35 @@ static kt_table sdl_key_trans_table[] =
KTT_ENTRY2( 4_PAD, KP_4 ),
KTT_ENTRY2( 5_PAD, KP_5 ),
KTT_ENTRY2( 6_PAD, KP_6 ),
- KTT_ENTRY2( PLUS_PAD, KP_PLUS ),
+ KTT_ENTRY2( PLUS_PAD, KP_PLUS ),
KTT_ENTRY2( 1_PAD, KP_1 ),
KTT_ENTRY2( 2_PAD, KP_2 ),
KTT_ENTRY2( 3_PAD, KP_3 ),
KTT_ENTRY2( 0_PAD, KP_0 ),
- KTT_ENTRY2( DEL_PAD, KP_PERIOD ),
- KTT_ENTRY2( F11, F11 ),
- KTT_ENTRY2( F12, F12 ),
- KTT_ENTRY2( F13, F13 ),
- KTT_ENTRY2( F14, F14 ),
- KTT_ENTRY2( F15, F15 ),
+ KTT_ENTRY2( DEL_PAD, KP_PERIOD ),
+ KTT_ENTRY2( F11, F11 ),
+ KTT_ENTRY2( F12, F12 ),
+ KTT_ENTRY2( F13, F13 ),
+ KTT_ENTRY2( F14, F14 ),
+ KTT_ENTRY2( F15, F15 ),
KTT_ENTRY2( ENTER_PAD, KP_ENTER ),
- KTT_ENTRY2( RCONTROL, RCTRL ),
+ KTT_ENTRY2( RCONTROL, RCTRL ),
KTT_ENTRY2( SLASH_PAD, KP_DIVIDE ),
- KTT_ENTRY2( PRTSCR, PRINTSCREEN ),
- KTT_ENTRY2( RALT, RALT ),
- KTT_ENTRY2( HOME, HOME ),
- KTT_ENTRY2( UP, UP ),
- KTT_ENTRY2( PGUP, PAGEUP ),
- KTT_ENTRY2( LEFT, LEFT ),
+ KTT_ENTRY2( PRTSCR, PRINTSCREEN ),
+ KTT_ENTRY2( RALT, RALT ),
+ KTT_ENTRY2( HOME, HOME ),
+ KTT_ENTRY2( UP, UP ),
+ KTT_ENTRY2( PGUP, PAGEUP ),
+ KTT_ENTRY2( LEFT, LEFT ),
KTT_ENTRY2( RIGHT, RIGHT ),
- KTT_ENTRY2( END, END ),
- KTT_ENTRY2( DOWN, DOWN ),
- KTT_ENTRY2( PGDN, PAGEDOWN ),
- KTT_ENTRY2( INSERT, INSERT ),
+ KTT_ENTRY2( END, END ),
+ KTT_ENTRY2( DOWN, DOWN ),
+ KTT_ENTRY2( PGDN, PAGEDOWN ),
+ KTT_ENTRY2( INSERT, INSERT ),
{ ITEM_ID_DEL, SDL_SCANCODE_DELETE, "ITEM_ID_DEL", (char *)"DELETE" },
- KTT_ENTRY2( LWIN, LGUI ),
- KTT_ENTRY2( RWIN, RGUI ),
- KTT_ENTRY2( MENU, MENU ),
+ KTT_ENTRY2( LWIN, LGUI ),
+ KTT_ENTRY2( RWIN, RGUI ),
+ KTT_ENTRY2( MENU, MENU ),
KTT_ENTRY0( TILDE, GRAVE, 0xc0, '`', "TILDE" ),
KTT_ENTRY0( BACKSLASH2, NONUSBACKSLASH, 0xdc, '\\', "BACKSLASH2" ),
{ -1 }
@@ -351,18 +351,18 @@ static kt_table sdl_key_trans_table[] =
static kt_table sdl_key_trans_table[] =
{
- // MAME key SDL key vkey ascii
+ // MAME key SDL key vkey ascii
KTT_ENTRY0( ESC, ESCAPE, 0x1b, 0x1b, "ESC" ),
- KTT_ENTRY1( 1, 1 ),
- KTT_ENTRY1( 2, 2 ),
- KTT_ENTRY1( 3, 3 ),
- KTT_ENTRY1( 4, 4 ),
- KTT_ENTRY1( 5, 5 ),
- KTT_ENTRY1( 6, 6 ),
- KTT_ENTRY1( 7, 7 ),
- KTT_ENTRY1( 8, 8 ),
- KTT_ENTRY1( 9, 9 ),
- KTT_ENTRY1( 0, 0 ),
+ KTT_ENTRY1( 1, 1 ),
+ KTT_ENTRY1( 2, 2 ),
+ KTT_ENTRY1( 3, 3 ),
+ KTT_ENTRY1( 4, 4 ),
+ KTT_ENTRY1( 5, 5 ),
+ KTT_ENTRY1( 6, 6 ),
+ KTT_ENTRY1( 7, 7 ),
+ KTT_ENTRY1( 8, 8 ),
+ KTT_ENTRY1( 9, 9 ),
+ KTT_ENTRY1( 0, 0 ),
KTT_ENTRY0( MINUS, MINUS, 0xbd, '-', "MINUS" ),
KTT_ENTRY0( EQUALS, EQUALS, 0xbb, '=', "EQUALS" ),
KTT_ENTRY0( BACKSPACE, BACKSPACE, 0x08, 0x08, "BACKSPACE" ),
@@ -377,9 +377,9 @@ static kt_table sdl_key_trans_table[] =
KTT_ENTRY1( I, i ),
KTT_ENTRY1( O, o ),
KTT_ENTRY1( P, p ),
- KTT_ENTRY0( OPENBRACE, LEFTBRACKET, 0xdb, '[', "OPENBRACE" ),
- KTT_ENTRY0( CLOSEBRACE,RIGHTBRACKET, 0xdd, ']', "CLOSEBRACE" ),
- KTT_ENTRY0( ENTER, RETURN, 0x0d, 0x0d, "RETURN" ),
+ KTT_ENTRY0( OPENBRACE, LEFTBRACKET, 0xdb, '[', "OPENBRACE" ),
+ KTT_ENTRY0( CLOSEBRACE,RIGHTBRACKET, 0xdd, ']', "CLOSEBRACE" ),
+ KTT_ENTRY0( ENTER, RETURN, 0x0d, 0x0d, "RETURN" ),
KTT_ENTRY2( LCONTROL, LCTRL ),
KTT_ENTRY1( A, a ),
KTT_ENTRY1( S, s ),
@@ -392,8 +392,8 @@ static kt_table sdl_key_trans_table[] =
KTT_ENTRY1( L, l ),
KTT_ENTRY0( COLON, SEMICOLON, 0xba, ';', "COLON" ),
KTT_ENTRY0( QUOTE, QUOTE, 0xde, '\'', "QUOTE" ),
- KTT_ENTRY2( LSHIFT, LSHIFT ),
- KTT_ENTRY0( BACKSLASH, BACKSLASH, 0xdc, '\\', "BACKSLASH" ),
+ KTT_ENTRY2( LSHIFT, LSHIFT ),
+ KTT_ENTRY0( BACKSLASH, BACKSLASH, 0xdc, '\\', "BACKSLASH" ),
KTT_ENTRY1( Z, z ),
KTT_ENTRY1( X, x ),
KTT_ENTRY1( C, c ),
@@ -401,26 +401,26 @@ static kt_table sdl_key_trans_table[] =
KTT_ENTRY1( B, b ),
KTT_ENTRY1( N, n ),
KTT_ENTRY1( M, m ),
- KTT_ENTRY0( COMMA, COMMA, 0xbc, ',', "COMMA" ),
- KTT_ENTRY0( STOP, PERIOD, 0xbe, '.', "STOP" ),
- KTT_ENTRY0( SLASH, SLASH, 0xbf, '/', "SLASH" ),
- KTT_ENTRY2( RSHIFT, RSHIFT ),
- KTT_ENTRY0( ASTERISK, KP_MULTIPLY, '*', '*', "ASTERIX" ),
- KTT_ENTRY2( LALT, LALT ),
- KTT_ENTRY0( SPACE, SPACE, ' ', ' ', "SPACE" ),
- KTT_ENTRY2( CAPSLOCK, CAPSLOCK ),
- KTT_ENTRY2( F1, F1 ),
- KTT_ENTRY2( F2, F2 ),
- KTT_ENTRY2( F3, F3 ),
- KTT_ENTRY2( F4, F4 ),
- KTT_ENTRY2( F5, F5 ),
- KTT_ENTRY2( F6, F6 ),
- KTT_ENTRY2( F7, F7 ),
- KTT_ENTRY2( F8, F8 ),
- KTT_ENTRY2( F9, F9 ),
- KTT_ENTRY2( F10, F10 ),
- KTT_ENTRY2( NUMLOCK, NUMLOCK ),
- KTT_ENTRY2( SCRLOCK, SCROLLOCK ),
+ KTT_ENTRY0( COMMA, COMMA, 0xbc, ',', "COMMA" ),
+ KTT_ENTRY0( STOP, PERIOD, 0xbe, '.', "STOP" ),
+ KTT_ENTRY0( SLASH, SLASH, 0xbf, '/', "SLASH" ),
+ KTT_ENTRY2( RSHIFT, RSHIFT ),
+ KTT_ENTRY0( ASTERISK, KP_MULTIPLY, '*', '*', "ASTERIX" ),
+ KTT_ENTRY2( LALT, LALT ),
+ KTT_ENTRY0( SPACE, SPACE, ' ', ' ', "SPACE" ),
+ KTT_ENTRY2( CAPSLOCK, CAPSLOCK ),
+ KTT_ENTRY2( F1, F1 ),
+ KTT_ENTRY2( F2, F2 ),
+ KTT_ENTRY2( F3, F3 ),
+ KTT_ENTRY2( F4, F4 ),
+ KTT_ENTRY2( F5, F5 ),
+ KTT_ENTRY2( F6, F6 ),
+ KTT_ENTRY2( F7, F7 ),
+ KTT_ENTRY2( F8, F8 ),
+ KTT_ENTRY2( F9, F9 ),
+ KTT_ENTRY2( F10, F10 ),
+ KTT_ENTRY2( NUMLOCK, NUMLOCK ),
+ KTT_ENTRY2( SCRLOCK, SCROLLOCK ),
KTT_ENTRY2( 7_PAD, KP7 ),
KTT_ENTRY2( 8_PAD, KP8 ),
KTT_ENTRY2( 9_PAD, KP9 ),
@@ -428,35 +428,35 @@ static kt_table sdl_key_trans_table[] =
KTT_ENTRY2( 4_PAD, KP4 ),
KTT_ENTRY2( 5_PAD, KP5 ),
KTT_ENTRY2( 6_PAD, KP6 ),
- KTT_ENTRY2( PLUS_PAD, KP_PLUS ),
+ KTT_ENTRY2( PLUS_PAD, KP_PLUS ),
KTT_ENTRY2( 1_PAD, KP1 ),
KTT_ENTRY2( 2_PAD, KP2 ),
KTT_ENTRY2( 3_PAD, KP3 ),
KTT_ENTRY2( 0_PAD, KP0 ),
- KTT_ENTRY2( DEL_PAD, KP_PERIOD ),
- KTT_ENTRY2( F11, F11 ),
- KTT_ENTRY2( F12, F12 ),
- KTT_ENTRY2( F13, F13 ),
- KTT_ENTRY2( F14, F14 ),
- KTT_ENTRY2( F15, F15 ),
+ KTT_ENTRY2( DEL_PAD, KP_PERIOD ),
+ KTT_ENTRY2( F11, F11 ),
+ KTT_ENTRY2( F12, F12 ),
+ KTT_ENTRY2( F13, F13 ),
+ KTT_ENTRY2( F14, F14 ),
+ KTT_ENTRY2( F15, F15 ),
KTT_ENTRY2( ENTER_PAD, KP_ENTER ),
- KTT_ENTRY2( RCONTROL, RCTRL ),
+ KTT_ENTRY2( RCONTROL, RCTRL ),
KTT_ENTRY2( SLASH_PAD, KP_DIVIDE ),
- KTT_ENTRY2( PRTSCR, PRINT ),
- KTT_ENTRY2( RALT, RALT ),
- KTT_ENTRY2( HOME, HOME ),
- KTT_ENTRY2( UP, UP ),
- KTT_ENTRY2( PGUP, PAGEUP ),
- KTT_ENTRY2( LEFT, LEFT ),
+ KTT_ENTRY2( PRTSCR, PRINT ),
+ KTT_ENTRY2( RALT, RALT ),
+ KTT_ENTRY2( HOME, HOME ),
+ KTT_ENTRY2( UP, UP ),
+ KTT_ENTRY2( PGUP, PAGEUP ),
+ KTT_ENTRY2( LEFT, LEFT ),
KTT_ENTRY2( RIGHT, RIGHT ),
- KTT_ENTRY2( END, END ),
- KTT_ENTRY2( DOWN, DOWN ),
- KTT_ENTRY2( PGDN, PAGEDOWN ),
- KTT_ENTRY2( INSERT, INSERT ),
+ KTT_ENTRY2( END, END ),
+ KTT_ENTRY2( DOWN, DOWN ),
+ KTT_ENTRY2( PGDN, PAGEDOWN ),
+ KTT_ENTRY2( INSERT, INSERT ),
{ ITEM_ID_DEL, SDLK_DELETE, "ITEM_ID_DEL", (char *)"DELETE" },
- KTT_ENTRY2( LWIN, LSUPER ),
- KTT_ENTRY2( RWIN, RSUPER ),
- KTT_ENTRY2( MENU, MENU ),
+ KTT_ENTRY2( LWIN, LSUPER ),
+ KTT_ENTRY2( RWIN, RSUPER ),
+ KTT_ENTRY2( MENU, MENU ),
KTT_ENTRY0( TILDE, BACKQUOTE, 0xc0, '`', "TILDE" ),
KTT_ENTRY0( BACKSLASH2, HASH, 0xdc, '\\', "BACKSLASH2" ),
{ -1 }
@@ -464,7 +464,7 @@ static kt_table sdl_key_trans_table[] =
#endif
typedef struct _key_lookup_table key_lookup_table;
-struct _key_lookup_table
+struct _key_lookup_table
{
int code;
const char *name;
@@ -472,10 +472,10 @@ struct _key_lookup_table
#if (SDL_VERSION_ATLEAST(1,3,0))
#define KE(x) { SDL_SCANCODE_ ## x, "SDL_SCANCODE_" #x },
-#define KE8(A, B, C, D, E, F, G, H) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G) KE(H)
+#define KE8(A, B, C, D, E, F, G, H) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G) KE(H)
#define KE7(A, B, C, D, E, F, G) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G)
#define KE5(A, B, C, D, E) KE(A) KE(B) KE(C) KE(D) KE(E)
-#define KE3(A, B, C) KE(A) KE(B) KE(C)
+#define KE3(A, B, C) KE(A) KE(B) KE(C)
static key_lookup_table sdl_lookup_table[] =
{
@@ -502,7 +502,7 @@ static key_lookup_table sdl_lookup_table[] =
};
#else
#define KE(x) { SDLK_ ## x, "SDLK_" #x },
-#define KE8(A, B, C, D, E, F, G, H) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G) KE(H)
+#define KE8(A, B, C, D, E, F, G, H) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G) KE(H)
static key_lookup_table sdl_lookup_table[] =
{
@@ -536,7 +536,7 @@ static key_lookup_table sdl_lookup_table[] =
KE8(LCTRL, RALT, LALT, RMETA, LMETA, LSUPER, RSUPER, MODE )
KE8(COMPOSE, HELP, PRINT, SYSREQ, BREAK, MENU, POWER, EURO )
KE(UNDO)
- KE(LAST)
+ KE(LAST)
{-1, ""}
};
#endif
@@ -611,7 +611,7 @@ static void devmap_register(device_map_t *devmap, int physical_idx, char *name)
devmap->map[stick].name = name;
devmap->logical[physical_idx] = stick;
}
-
+
}
//============================================================
@@ -622,9 +622,9 @@ static void devmap_init(running_machine *machine, device_map_t *devmap, const ch
{
int dev;
char defname[20];
-
- assert(max_devices <= MAX_DEVMAP_ENTRIES);
-
+
+ assert(max_devices <= MAX_DEVMAP_ENTRIES);
+
for (dev = 0; dev < MAX_DEVMAP_ENTRIES; dev++)
{
devmap->map[dev].name = (char *)"";
@@ -632,7 +632,7 @@ static void devmap_init(running_machine *machine, device_map_t *devmap, const ch
devmap->logical[dev] = -1;
}
devmap->initialized = 0;
-
+
for (dev = 0; dev < max_devices; dev++)
{
const char *dev_name;
@@ -648,7 +648,7 @@ static void devmap_init(running_machine *machine, device_map_t *devmap, const ch
}
}
-static device_info *devmap_class_register(running_machine *machine, device_map_t *devmap,
+static device_info *devmap_class_register(running_machine *machine, device_map_t *devmap,
int index, device_info **devlist, input_device_class devclass)
{
device_info *devinfo = NULL;
@@ -691,7 +691,7 @@ static void sdlinput_register_joysticks(running_machine *machine)
for (physical_stick = 0; physical_stick < SDL_NumJoysticks(); physical_stick++)
{
char *joy_name = remove_spaces(machine, SDL_JoystickName(physical_stick));
-
+
devmap_register(&joy_map, physical_stick, joy_name);
}
@@ -701,9 +701,9 @@ static void sdlinput_register_joysticks(running_machine *machine)
if (devinfo == NULL)
continue;
-
+
physical_stick = joy_map.map[stick].physical;
-
+
joy = SDL_JoystickOpen(physical_stick);
devinfo->joystick.device = joy;
@@ -716,7 +716,7 @@ static void sdlinput_register_joysticks(running_machine *machine)
for (axis = 0; axis < SDL_JoystickNumAxes(joy); axis++)
{
input_item_id itemid;
-
+
if (axis < INPUT_MAX_AXIS)
itemid = (input_item_id) (ITEM_ID_XAXIS + axis);
else if (axis < INPUT_MAX_AXIS + INPUT_MAX_ADD_ABSOLUTE)
@@ -727,12 +727,12 @@ static void sdlinput_register_joysticks(running_machine *machine)
sprintf(tempname, "A%d %s", axis, devinfo->name);
input_device_item_add(devinfo->device, tempname, &devinfo->joystick.axes[axis], itemid, generic_axis_get_state);
}
-
+
// loop over all buttons
for (button = 0; button < SDL_JoystickNumButtons(joy); button++)
{
input_item_id itemid;
-
+
devinfo->joystick.buttons[button] = 0;
if (button < INPUT_MAX_BUTTONS)
@@ -750,7 +750,7 @@ static void sdlinput_register_joysticks(running_machine *machine)
for (hat = 0; hat < SDL_JoystickNumHats(joy); hat++)
{
input_item_id itemid;
-
+
sprintf(tempname, "hat %d Up", hat);
itemid = (input_item_id) ((hat < INPUT_MAX_HATS) ? ITEM_ID_HAT1UP + 4 * hat : ITEM_ID_OTHER_SWITCH);
input_device_item_add(devinfo->device, tempname, &devinfo->joystick.hatsU[hat], itemid, generic_button_get_state);
@@ -794,7 +794,7 @@ static void sdlinput_deregister_joysticks(running_machine *machine)
static void sdlinput_register_mice(running_machine *machine)
{
int index, physical_mouse;
-
+
mouse_enabled = options_get_bool(mame_options(), OPTION_MOUSE);
devmap_init(machine, &mouse_map, SDLOPTION_MOUSEINDEX, 8, "Mouse mapping");
@@ -802,7 +802,7 @@ static void sdlinput_register_mice(running_machine *machine)
for (physical_mouse = 0; physical_mouse < SDL_GetNumMice(); physical_mouse++)
{
char *mouse_name = remove_spaces(machine, SDL_GetMouseName(physical_mouse));
-
+
devmap_register(&mouse_map, physical_mouse, mouse_name);
}
@@ -817,23 +817,23 @@ static void sdlinput_register_mice(running_machine *machine)
if (devinfo == NULL)
continue;
-
+
// add the axes
sprintf(defname, "X %s", devinfo->name);
input_device_item_add(devinfo->device, defname, &devinfo->mouse.lX, ITEM_ID_XAXIS, generic_axis_get_state);
sprintf(defname, "Y %s", devinfo->name);
input_device_item_add(devinfo->device, defname, &devinfo->mouse.lY, ITEM_ID_YAXIS, generic_axis_get_state);
-
+
for (button = 0; button < 4; button++)
{
input_item_id itemid;
-
+
sprintf(defname, "B%d", button + 1);
itemid = (input_item_id) (ITEM_ID_BUTTON1+button);
-
+
input_device_item_add(devinfo->device, defname, &devinfo->mouse.buttons[button], itemid, generic_button_get_state);
}
-
+
if (0 && mouse_enabled)
SDL_SetRelativeMouseMode(index, SDL_TRUE);
mame_printf_verbose("Mouse: Registered %s\n", devinfo->name);
@@ -846,7 +846,7 @@ static void sdlinput_register_mice(running_machine *machine)
device_info *devinfo;
char defname[20];
int button;
-
+
mame_printf_verbose("Mouse: Start initialization\n");
mouse_map.logical[0] = 0;
@@ -856,7 +856,7 @@ static void sdlinput_register_mice(running_machine *machine)
devinfo->device = input_device_add(machine, DEVICE_CLASS_MOUSE, devinfo->name, devinfo);
mouse_enabled = options_get_bool(mame_options(), OPTION_MOUSE);
-
+
// add the axes
input_device_item_add(devinfo->device, "X", &devinfo->mouse.lX, ITEM_ID_XAXIS, generic_axis_get_state);
input_device_item_add(devinfo->device, "Y", &devinfo->mouse.lY, ITEM_ID_YAXIS, generic_axis_get_state);
@@ -900,7 +900,7 @@ static int lookup_sdl_code(const char *scode)
static int lookup_mame_index(const char *scode)
{
int index, i;
-
+
index=-1;
i=0;
while (sdl_key_trans_table[i].mame_key >= 0)
@@ -910,7 +910,7 @@ static int lookup_mame_index(const char *scode)
index=i;
break;
}
- i++;
+ i++;
}
return index;
}
@@ -921,7 +921,7 @@ static int lookup_mame_code(const char *scode)
int index;
index = lookup_mame_index(scode);
if (index >= 0)
- return sdl_key_trans_table[index].mame_key;
+ return sdl_key_trans_table[index].mame_key;
else
return -1;
}
@@ -959,7 +959,7 @@ static kt_table * sdlinput_read_keymap(running_machine *machine)
key_trans_table = auto_alloc_array(machine, kt_table, ARRAY_LENGTH(sdl_key_trans_table));
memcpy((void *) key_trans_table, sdl_key_trans_table, sizeof(sdl_key_trans_table));
-
+
while (!feof(keymap_file))
{
fgets(buf, 255, keymap_file);
@@ -974,11 +974,11 @@ static kt_table * sdlinput_read_keymap(running_machine *machine)
memset(kns, 0, 21);
sscanf(buf, "%20s %20s %x %x %20c\n",
mks, sks, &vk, &ak, kns);
-
+
index=lookup_mame_index(mks);
sk = lookup_sdl_code(sks);
- if ( sk >= 0 && index >=0)
+ if ( sk >= 0 && index >=0)
{
key_trans_table[index].sdl_key = sk;
// vk and ak are not really needed
@@ -995,7 +995,7 @@ static kt_table * sdlinput_read_keymap(running_machine *machine)
}
fclose(keymap_file);
mame_printf_verbose("Keymap: Processed %d lines\n", line);
-
+
return key_trans_table;
}
@@ -1019,7 +1019,7 @@ static void sdlinput_register_keyboards(running_machine *machine)
{
char defname[90];
snprintf(defname, sizeof(defname)-1, "Keyboard #%d", physical_keyboard + 1);
-
+
devmap_register(&keyboard_map, physical_keyboard, defname);
}
@@ -1034,17 +1034,17 @@ static void sdlinput_register_keyboards(running_machine *machine)
if (devinfo == NULL)
continue;
-
+
// populate it
for (keynum = 0; sdl_key_trans_table[keynum].mame_key >= 0; keynum++)
{
input_item_id itemid;
-
+
itemid = (input_item_id) key_trans_table[keynum].mame_key;
// generate the default / modified name
snprintf(defname, sizeof(defname)-1, "%s", key_trans_table[keynum].ui_name);
-
+
// add the item to the device
input_device_item_add(devinfo->device, defname, &devinfo->keyboard.state[OSD_SDL_INDEX(key_trans_table[keynum].sdl_key)], itemid, generic_button_get_state);
}
@@ -1064,7 +1064,7 @@ static void sdlinput_register_keyboards(running_machine *machine)
key_trans_table = sdlinput_read_keymap(machine);
keyboard_map.logical[0] = 0;
-
+
mame_printf_verbose("Keyboard: Start initialization\n");
// SDL 1.2 only has 1 keyboard (1.3+ will have multiple, this must be revisited then)
@@ -1076,12 +1076,12 @@ static void sdlinput_register_keyboards(running_machine *machine)
for (keynum = 0; sdl_key_trans_table[keynum].mame_key >= 0; keynum++)
{
input_item_id itemid;
-
+
itemid = (input_item_id) key_trans_table[keynum].mame_key;
// generate the default / modified name
snprintf(defname, sizeof(defname)-1, "%s", key_trans_table[keynum].ui_name);
-
+
// add the item to the device
//printf("Test %d\n", OSD_SDL_INDEX(key_trans_table[keynum].sdl_key) );
input_device_item_add(devinfo->device, defname, &devinfo->keyboard.state[OSD_SDL_INDEX(key_trans_table[keynum].sdl_key)], itemid, generic_button_get_state);
@@ -1102,7 +1102,7 @@ void sdlinput_init(running_machine *machine)
joystick_list = NULL;
mouse_list = NULL;
lightgun_list = NULL;
-
+
app_has_mouse_focus = 1;
// we need pause and exit callbacks
@@ -1135,7 +1135,7 @@ void sdlinput_init(running_machine *machine)
device_list_reset_devices(keyboard_list);
device_list_reset_devices(mouse_list);
device_list_reset_devices(joystick_list);
-
+
}
@@ -1191,7 +1191,7 @@ sdl_window_info *sdlinput_get_focus_window(running_machine *machine)
INLINE sdl_window_info * window_from_id(SDL_WindowID windowID)
{
sdl_window_info *w;
-
+
for (w = sdl_window_list; w != NULL; w = w->next)
{
//printf("w->window_id: %d\n", w->window_id);
@@ -1207,7 +1207,7 @@ INLINE void resize_all_windows(void)
{
sdl_window_info *w;
osd_ticks_t now = osd_ticks();
-
+
if (SDL13_COMBINE_RESIZE)
{
for (w = sdl_window_list; w != NULL; w = w->next)
@@ -1235,12 +1235,12 @@ void sdlinput_process_events_buf(running_machine *machine)
/* Make sure we get all pending events */
SDL_PumpEvents();
#endif
- while(SDL_PollEvent(&event))
+ while(SDL_PollEvent(&event))
{
if (event_buf_count < MAX_BUF_EVENTS)
event_buf[event_buf_count++] = event;
else
- mame_printf_warning("Event Buffer Overflow!\n");
+ mame_printf_warning("Event Buffer Overflow!\n");
}
osd_lock_release(input_lock);
}
@@ -1276,8 +1276,8 @@ void sdlinput_poll(running_machine *machine)
osd_lock_release(input_lock);
bufp = 0;
}
-
- while (TRUE)
+
+ while (TRUE)
{
if (SDLMAME_EVENTS_IN_WORKER_THREAD)
{
@@ -1291,7 +1291,7 @@ void sdlinput_poll(running_machine *machine)
break;
}
- if (event.type == SDL_KEYUP &&
+ if (event.type == SDL_KEYUP &&
event.key.keysym.sym == SDLK_CAPSLOCK)
{
/* more caps-lock hack */
@@ -1320,7 +1320,7 @@ void sdlinput_poll(running_machine *machine)
if (axis <= 3)
{
- devinfo->joystick.axes[event.jaxis.axis] = (event.jaxis.value * 2);
+ devinfo->joystick.axes[event.jaxis.axis] = (event.jaxis.value * 2);
}
else
{
@@ -1331,7 +1331,7 @@ void sdlinput_poll(running_machine *machine)
}
else
{
- devinfo->joystick.axes[event.jaxis.axis] = (event.jaxis.value * 2);
+ devinfo->joystick.axes[event.jaxis.axis] = (event.jaxis.value * 2);
}
}
break;
@@ -1378,12 +1378,12 @@ void sdlinput_poll(running_machine *machine)
devinfo = generic_device_find_index(joystick_list, joy_map.logical[event.jbutton.which]);
if (devinfo)
{
- devinfo->joystick.buttons[event.jbutton.button] = (event.jbutton.state == SDL_PRESSED) ? 0x80 : 0;
+ devinfo->joystick.buttons[event.jbutton.button] = (event.jbutton.state == SDL_PRESSED) ? 0x80 : 0;
}
break;
case SDL_MOUSEBUTTONDOWN:
devinfo = generic_device_find_index(mouse_list, mouse_map.logical[event.button.which]);
- devinfo->mouse.buttons[event.button.button-1] = 0x80;
+ devinfo->mouse.buttons[event.button.button-1] = 0x80;
//printf("But down %d %d %d %d %s\n", event.button.which, event.button.button, event.button.x, event.button.y, devinfo->name);
if (event.button.button == 1)
{
@@ -1396,9 +1396,9 @@ void sdlinput_poll(running_machine *machine)
sdl_window_info *window = GET_FOCUS_WINDOW(&event.button);
if (window != NULL && window->xy_to_render_target(window, event.button.x,event.button.y, &cx, &cy) )
{
- ui_input_push_mouse_down_event(machine, window->target, cx, cy);
+ ui_input_push_mouse_down_event(machine, window->target, cx, cy);
// FIXME Parameter ?
- if ((click-last_click < 250)
+ if ((click-last_click < 250)
&& (cx >= last_x - 4 && cx <= last_x + 4)
&& (cy >= last_y - 4 && cy <= last_y + 4) )
{
@@ -1416,17 +1416,17 @@ void sdlinput_poll(running_machine *machine)
break;
case SDL_MOUSEBUTTONUP:
devinfo = generic_device_find_index(mouse_list, mouse_map.logical[event.button.which]);
- devinfo->mouse.buttons[event.button.button-1] = 0;
+ devinfo->mouse.buttons[event.button.button-1] = 0;
//printf("But up %d %d %d %d\n", event.button.which, event.button.button, event.button.x, event.button.y);
if (event.button.button == 1)
{
int cx, cy;
sdl_window_info *window = GET_FOCUS_WINDOW(&event.button);
-
+
if (window != NULL && window->xy_to_render_target(window, event.button.x,event.button.y, &cx, &cy) )
{
- ui_input_push_mouse_up_event(machine, window->target, cx, cy);
+ ui_input_push_mouse_up_event(machine, window->target, cx, cy);
}
}
break;
@@ -1435,10 +1435,10 @@ void sdlinput_poll(running_machine *machine)
#if (SDL_VERSION_ATLEAST(1,3,0))
// FIXME: may apply to 1.2 as well ...
//printf("Motion %d %d %d %s\n", event.motion.which, event.motion.x, event.motion.y, devinfo->name);
- devinfo->mouse.lX += event.motion.xrel * INPUT_RELATIVE_PER_PIXEL;
+ devinfo->mouse.lX += event.motion.xrel * INPUT_RELATIVE_PER_PIXEL;
devinfo->mouse.lY += event.motion.yrel * INPUT_RELATIVE_PER_PIXEL;
#else
- devinfo->mouse.lX = event.motion.xrel * INPUT_RELATIVE_PER_PIXEL;
+ devinfo->mouse.lX = event.motion.xrel * INPUT_RELATIVE_PER_PIXEL;
devinfo->mouse.lY = event.motion.yrel * INPUT_RELATIVE_PER_PIXEL;
#endif
{
@@ -1446,7 +1446,7 @@ void sdlinput_poll(running_machine *machine)
sdl_window_info *window = GET_FOCUS_WINDOW(&event.motion);
if (window != NULL && window->xy_to_render_target(window, event.motion.x, event.motion.y, &cx, &cy) )
- ui_input_push_mouse_move_event(machine, window->target, cx, cy);
+ ui_input_push_mouse_move_event(machine, window->target, cx, cy);
}
break;
#if (!SDL_VERSION_ATLEAST(1,3,0))
@@ -1480,10 +1480,10 @@ void sdlinput_poll(running_machine *machine)
case SDL_WINDOWEVENT:
{
sdl_window_info *window = GET_WINDOW(&event.window);
-
+
if (window == NULL)
break;
-
+
switch (event.window.event)
{
case SDL_WINDOWEVENT_CLOSE:
@@ -1498,7 +1498,7 @@ void sdlinput_poll(running_machine *machine)
focus_window = window;
break;
case SDL_WINDOWEVENT_RESIZED:
- if (SDL13_COMBINE_RESIZE)
+ if (SDL13_COMBINE_RESIZE)
{
window->resize_width = event.window.data1;
window->resize_height = event.window.data2;
@@ -1516,7 +1516,7 @@ void sdlinput_poll(running_machine *machine)
/* fall through */
case SDL_WINDOWEVENT_FOCUS_GAINED:
case SDL_WINDOWEVENT_EXPOSED:
- case SDL_WINDOWEVENT_MAXIMIZED:
+ case SDL_WINDOWEVENT_MAXIMIZED:
case SDL_WINDOWEVENT_RESTORED:
focus_window = window;
break;
@@ -1531,7 +1531,7 @@ void sdlinput_poll(running_machine *machine)
#endif
}
-
+
//============================================================
// sdlinput_release_keys
//============================================================
@@ -1553,7 +1553,7 @@ void sdlinput_release_keys(running_machine *machine)
break;
memset(&devinfo->keyboard.state, 0, sizeof(devinfo->keyboard.state));
}
-#endif
+#endif
}
@@ -1566,14 +1566,14 @@ int sdlinput_should_hide_mouse(running_machine *machine)
// if we are paused, no
if (input_paused)
return FALSE;
-
+
// if neither mice nor lightguns enabled in the core, then no
if (!mouse_enabled && !lightgun_enabled)
return FALSE;
-
+
if (!app_has_mouse_focus)
return FALSE;
-
+
// otherwise, yes
return TRUE;
}
@@ -1589,7 +1589,7 @@ void osd_customize_input_type_list(input_type_desc *typelist)
int mameid_code ,ui_code;
#endif
input_type_desc *typedesc;
-
+
// loop over the defaults
for (typedesc = typelist; typedesc != NULL; typedesc = typedesc->next)
{
@@ -1612,9 +1612,9 @@ void osd_customize_input_type_list(input_type_desc *typelist)
// disable UI_SELECT when LALT is down, this stops selecting
// things in the menu when toggling fullscreen with LALT+ENTER
-/* case IPT_UI_SELECT:
- input_seq_set_3(&typedesc->seq[SEQ_TYPE_STANDARD], KEYCODE_ENTER, SEQCODE_NOT, KEYCODE_LALT);
- break;*/
+/* case IPT_UI_SELECT:
+ input_seq_set_3(&typedesc->seq[SEQ_TYPE_STANDARD], KEYCODE_ENTER, SEQCODE_NOT, KEYCODE_LALT);
+ break;*/
// page down for fastforward (must be OSD_3 as per src/emu/ui.c)
case IPT_UI_FAST_FORWARD:
@@ -1622,7 +1622,7 @@ void osd_customize_input_type_list(input_type_desc *typelist)
typedesc->name = "Fast Forward";
input_seq_set_1(&typedesc->seq[SEQ_TYPE_STANDARD], KEYCODE_PGDN);
break;
-
+
// OSD hotkeys use LCTRL and start at F3, they start at
// F3 because F1-F2 are hardcoded into many drivers to
// various dipswitches, and pressing them together with
@@ -1638,7 +1638,7 @@ void osd_customize_input_type_list(input_type_desc *typelist)
case IPT_UI_SOFT_RESET:
input_seq_set_5(&typedesc->seq[SEQ_TYPE_STANDARD], KEYCODE_F3, SEQCODE_NOT, KEYCODE_LCONTROL, SEQCODE_NOT, KEYCODE_LSHIFT);
break;
-
+
// LCTRL-F4 to toggle keep aspect
case IPT_OSD_4:
typedesc->token = "TOGGLE_KEEP_ASPECT";
@@ -1649,7 +1649,7 @@ void osd_customize_input_type_list(input_type_desc *typelist)
case IPT_UI_SHOW_GFX:
input_seq_set_3(&typedesc->seq[SEQ_TYPE_STANDARD], KEYCODE_F4, SEQCODE_NOT, KEYCODE_LCONTROL);
break;
-
+
// LCTRL-F5 to toggle OpenGL filtering
case IPT_OSD_5:
typedesc->token = "TOGGLE_FILTER";
@@ -1660,7 +1660,7 @@ void osd_customize_input_type_list(input_type_desc *typelist)
case IPT_UI_TOGGLE_DEBUG:
input_seq_set_3(&typedesc->seq[SEQ_TYPE_STANDARD], KEYCODE_F5, SEQCODE_NOT, KEYCODE_LCONTROL);
break;
-
+
// LCTRL-F6 to decrease OpenGL prescaling
case IPT_OSD_6:
typedesc->token = "DECREASE_PRESCALE";
@@ -1671,7 +1671,7 @@ void osd_customize_input_type_list(input_type_desc *typelist)
case IPT_UI_TOGGLE_CHEAT:
input_seq_set_3(&typedesc->seq[SEQ_TYPE_STANDARD], KEYCODE_F6, SEQCODE_NOT, KEYCODE_LCONTROL);
break;
-
+
// LCTRL-F7 to increase OpenGL prescaling
case IPT_OSD_7:
typedesc->token = "INCREASE_PRESCALE";
@@ -1682,7 +1682,7 @@ void osd_customize_input_type_list(input_type_desc *typelist)
case IPT_UI_LOAD_STATE:
input_seq_set_5(&typedesc->seq[SEQ_TYPE_STANDARD], KEYCODE_F7, SEQCODE_NOT, KEYCODE_LCONTROL, SEQCODE_NOT, KEYCODE_LSHIFT);
break;
-
+
// LCTRL-F10 to toggle the renderer (software vs opengl)
case IPT_OSD_10:
typedesc->token = "TOGGLE_RENDERER";
@@ -1693,7 +1693,7 @@ void osd_customize_input_type_list(input_type_desc *typelist)
case IPT_UI_THROTTLE:
input_seq_set_3(&typedesc->seq[SEQ_TYPE_STANDARD], KEYCODE_F10, SEQCODE_NOT, KEYCODE_LCONTROL);
break;
-
+
// disable the config menu if the ALT key is down
// (allows ALT-TAB to switch between apps)
case IPT_UI_CONFIGURE:
@@ -1711,7 +1711,7 @@ void osd_customize_input_type_list(input_type_desc *typelist)
static void device_list_reset_devices(device_info *devlist_head)
{
device_info *curdev;
-
+
for (curdev = devlist_head; curdev != NULL; curdev = curdev->next)
generic_device_reset(curdev);
}
@@ -1724,7 +1724,7 @@ static void device_list_reset_devices(device_info *devlist_head)
static void device_list_free_devices(device_info **devlist_head)
{
device_info *curdev, *next;
-
+
for (curdev = *devlist_head; curdev != NULL; )
{
next = curdev->next;
@@ -1747,17 +1747,17 @@ static device_info *generic_device_alloc(device_info **devlist_head_ptr, const c
// allocate memory for the device object
devinfo = global_alloc_clear(device_info);
devinfo->head = devlist_head_ptr;
-
+
// allocate a UTF8 copy of the name
devinfo->name = (char *) global_alloc_array(char, strlen(name)+1);
if (devinfo->name == NULL)
goto error;
strcpy(devinfo->name, (char *)name);
-
+
// append us to the list
for (curdev_ptr = devinfo->head; *curdev_ptr != NULL; curdev_ptr = &(*curdev_ptr)->next) ;
*curdev_ptr = devinfo;
-
+
return devinfo;
error:
@@ -1778,7 +1778,7 @@ static void generic_device_free(device_info *devinfo)
for (curdev_ptr = devinfo->head; *curdev_ptr != devinfo && *curdev_ptr != NULL; curdev_ptr = &(*curdev_ptr)->next) ;
if (*curdev_ptr == devinfo)
*curdev_ptr = devinfo->next;
-
+
// free the copy of the name if present
if (devinfo->name != NULL)
{
@@ -1835,11 +1835,11 @@ static void generic_device_reset(device_info *devinfo)
// keyboard case
if (devinfo->head == &keyboard_list)
memset(&devinfo->keyboard, 0, sizeof(devinfo->keyboard));
-
+
// mouse/lightgun case
else if (devinfo->head == &mouse_list || devinfo->head == &lightgun_list)
memset(&devinfo->mouse, 0, sizeof(devinfo->mouse));
-
+
// joystick case
else if (devinfo->head == &joystick_list)
{
@@ -1855,7 +1855,7 @@ static void generic_device_reset(device_info *devinfo)
static INT32 generic_button_get_state(void *device_internal, void *item_internal)
{
INT32 *itemdata = (INT32 *) item_internal;
-
+
// return the current state
return *itemdata >> 7;
}
@@ -1868,7 +1868,7 @@ static INT32 generic_button_get_state(void *device_internal, void *item_internal
static INT32 generic_axis_get_state(void *device_internal, void *item_internal)
{
INT32 *axisdata = (INT32 *) item_internal;
-
+
// return the current state
return *axisdata;
}
diff --git a/src/osd/sdl/main.c b/src/osd/sdl/main.c
index ca1a305dd4d..1e047108306 100644
--- a/src/osd/sdl/main.c
+++ b/src/osd/sdl/main.c
@@ -5,7 +5,7 @@
// Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
// Visit http://mamedev.org for licensing and usage restrictions.
//
-// SDLMAME by Olivier Galibert and R. Belmont
+// SDLMAME by Olivier Galibert and R. Belmont
//
//============================================================
diff --git a/src/osd/sdl/osd_opengl.h b/src/osd/sdl/osd_opengl.h
index c835fdbca11..655ac01f0ad 100644
--- a/src/osd/sdl/osd_opengl.h
+++ b/src/osd/sdl/osd_opengl.h
@@ -2,21 +2,21 @@
#ifndef MANGLE
/***************************************************************
- *
+ *
* Standard Header
- *
+ *
***************************************************************/
#ifndef _OSD_OPENGL_H
#define _OSD_OPENGL_H
-
+
#if USE_OPENGL
-
+
/* equivalent to #include <GL/gl.h>
- * #include <GL/glext.h>
- */
+ * #include <GL/glext.h>
+ */
#include <SDL/SDL_version.h>
-
+
#if (SDL_VERSION_ATLEAST(1,2,10))
#if defined(SDLMAME_WIN32)
// Avoid that winnt.h (included via sdl_opengl.h, windows.h, windef.h includes intrin.h
@@ -25,51 +25,51 @@
#include <SDL/SDL_opengl.h>
#else
/*
- * SDL 1.2.9 does not provide everything we need
- * We therefore distribute it ourselves
- */
+ * SDL 1.2.9 does not provide everything we need
+ * We therefore distribute it ourselves
+ */
#include "SDL1211_opengl.h"
-#endif
+#endif
#ifdef USE_DISPATCH_GL
#define OSD_GL(ret,func,params) ret (APIENTRY *func) params;
#define OSD_GL_UNUSED(ret,func,params)
-
+
typedef struct _osd_gl_dispatch osd_gl_dispatch;
-
- struct _osd_gl_dispatch
+
+ struct _osd_gl_dispatch
{
#define GET_GLFUNC 1
#include "osd_opengl.h"
#undef GET_GLFUNC
};
-
+
#undef OSD_GL
#undef OSD_GL_UNUSED
-
+
extern osd_gl_dispatch *gl_dispatch;
-
+
/*
- * Use gl_mangle to map function names
- */
-
+ * Use gl_mangle to map function names
+ */
+
#define MANGLE(x) gl_dispatch->gl ## x
#include "osd_opengl.h"
-
+
#endif /* USE_DISPATCH_GL */
-
+
#endif /* USE_OPENGL */
-
+
#endif /* _OSD_OPENGL_H */
#else /* MANGLE */
/***************************************************************
- *
- * Used to redefine opengl functions
- *
- * Credits: taken from gl_mangle.h
- *
- ***************************************************************/
+ *
+ * Used to redefine opengl functions
+ *
+ * Credits: taken from gl_mangle.h
+ *
+ ***************************************************************/
#define glAccum MANGLE(Accum)
#define glActiveStencilFaceEXT MANGLE(ActiveStencilFaceEXT)
@@ -1517,13 +1517,13 @@
#endif /* MANGLE */
#else /* GET_GLFUNC */
/***************************************************************
- *
- * Used recursively for prototyping and function assignment
- *
- * Credits: taken from sdl_glfuncs.h
- *
- ***************************************************************/
-
+ *
+ * Used recursively for prototyping and function assignment
+ *
+ * Credits: taken from sdl_glfuncs.h
+ *
+ ***************************************************************/
+
OSD_GL_UNUSED(void,glAccum,(GLenum,GLfloat))
OSD_GL_UNUSED(void,glAlphaFunc,(GLenum,GLclampf))
OSD_GL_UNUSED(GLboolean,glAreTexturesResident,(GLsizei,const GLuint*,GLboolean*))
diff --git a/src/osd/sdl/osdsdl.h b/src/osd/sdl/osdsdl.h
index 4aae58b7644..d8508934871 100644
--- a/src/osd/sdl/osdsdl.h
+++ b/src/osd/sdl/osdsdl.h
@@ -3,204 +3,204 @@
/* Notes
- - Known bugs:
-
- * SDL1.3/X11: Some compound keys, e.g. "'" are not supported by SDL driver
- * SDL1.3: sdlvideofps does not take -numscreens>1 into account.
- * SDL1.3/WIN32: crashes with -rd d3d
- * SDL1.3/WIN32: resizing does not work
-
- - fixed returning (w,h) = (0,0) in get_max_bounds
- - new video driver "sdl13" utilitizing SDL texture and line
- drawing support. Accelerated drivers like directfb now
- may attain opengl speed. DirectFB does with a radeon card.
- The driver determines which pixel formats perform best and
- converts textures to these pixel formats.
- Supported options:
- -waitvsync
- -filter
- -prescale
- Supported renderdrivers:
- X11: opengl, software, x11 (no artwork!)
- DirectFB: directfb, software, opengl (special setup, slow)
- Windows: software, gdi (no artwork)
- - SDL1.3: Clear bck when moving
- - SDL1.3: now compiles on win32
- - SDL1.3: Support screen refresh rates, provided the sdl video
- layer supports them (e.g. X11).
- - Use video_config.waitvsync (previously option was queried)
- - -video soft / -sm now supports -prescale
- - removed reqwidth, reqheight from sdl_monitor_info; not used anywhere
- - removed layerconfig from sdl_video_config; not used anywhere
-
- - fixed yuv issues (firefox) / this was a bug I introduced
- - removed deprecat.h from output.c
- - Separated keyboard and mouse initialization into separate functions
- - added _FORTIFY_SOURCE to verbose compiler define output.
- - remove MAX_CPU from debugwin.c
- - fixed vsync handling in SDL1.3 in soft/opengl drivers
- - "waitvsync" also supported by "soft" driver in SDL1.3
- - multiple mice and keyboards supported in SDL1.3
- - support for DISTRO= make option
- - got rid of "-joymap" and "-joymap_file"
- - add -joy_idx[0-7] -keyb_idx[0-7] -mouse_idx[0-7] which
- specify, which device is allocated to to e.g. Mouse 1, Mouse 2, ...
- - moved define of THREAD_COOPERATIVE into sdl.mak and renamed to
- NO_THREAD_COOPERATIVE. Changed references to #ifndef
- - define NO_DEBUGGER in sdl.mak
- - Solaris now uses -DNO_AFFINITY_NP
- - added machine to window_info, removed deprecat.h from drawogl.c
-
- - For DEBUG=1 builds, disable input grapping while windowed
- - Fixed WIN32 compile
- Wrote setenv function since mingw does not provide one.
- Implemented osd_event_* as inline functions for win32 build.
- We should at some point merge sdlwork.c and winwork.c and push it
- to the core, letting sdlsync.c provide the necessary details.
- - Removed keybled.c and references
- - Added output.c and output.h. These will look for a fifo or file
- /tmp/sdlmame_out and write output notifiers to it.
- Added a sample client ledutil.sh to src/osd/sdl which turns
- leds on and off and provides a debug (log) facility.
- - removed os2work.c
-
- - replaced window->render_lock with event window->rendered_event
- For multiple windows and "-mt", the old code would allow filling up
- the workqueue with 1000s of entries, since the lock would not block while
- another window is rendered. The osd_event establishes a barrier which
- is only freed if the last window blit operation has finished.
- - Set SDL_VIDEO_GL_DRIVER if -gl_lib is given. The SDL directfb driver is picky about
- this. Added reminder: FIXME: move lib loading code from drawogl.c here. This may be
- used to disable opengl if no library was loaded.
- - SDL1.3/video=opengl: Fixed windows not being updated after another window was resized
- - for -verbose, output some information about renderer (-video soft)
- - initialize mouse_enabled with option "-mouse". Affects both SDL1.2 and SDL1.3
- This will hide the mouse if you specify "-mouse".
- - SDL1.2: added blitmode "async" which sets SDL_ASYNCBLIT
- - SDL1.2: removed blitmodes "hwbest" and "hwblit"
- - added blitmode "hwbest" for antialiased and smoothed scaling now that the
- directfb driver supports it. This is also supported by the 1.3 opengl
- render backend
- - added sdlinput_release_keys to cope with lost keyboard events in SDL1.3
- - some identing in drawogl.c
- - rename SDL_* macros to SDLMAME_* (avoid name clashes)
- - got rid of VIDEO_SCALE_MODE constants. Scale modes are now handled in drawsdl.c.
- Starting mame with eg. -video soft -sm yuy2 on X11 no longer crashes.
- - some more changes to input.c to avoid resize loops (issue for directfb)
-
- - working ui mouse inputs for SDL1.2 and SDL1.3 incl. yuv modes
- - added blitmode "hwblit" (SDL1.3) for rgb hardware scaling
- - rename "-yuvmode" option to "-scalemode"
- - rename yuv_mode and derivatives to scale_mode
- - moved extra_flags into sdl_info
- - moved callbacks indow sdl_window_info
- - made a number of flags (e.g. yuvmode) window relative
+ - Known bugs:
+
+ * SDL1.3/X11: Some compound keys, e.g. "'" are not supported by SDL driver
+ * SDL1.3: sdlvideofps does not take -numscreens>1 into account.
+ * SDL1.3/WIN32: crashes with -rd d3d
+ * SDL1.3/WIN32: resizing does not work
+
+ - fixed returning (w,h) = (0,0) in get_max_bounds
+ - new video driver "sdl13" utilitizing SDL texture and line
+ drawing support. Accelerated drivers like directfb now
+ may attain opengl speed. DirectFB does with a radeon card.
+ The driver determines which pixel formats perform best and
+ converts textures to these pixel formats.
+ Supported options:
+ -waitvsync
+ -filter
+ -prescale
+ Supported renderdrivers:
+ X11: opengl, software, x11 (no artwork!)
+ DirectFB: directfb, software, opengl (special setup, slow)
+ Windows: software, gdi (no artwork)
+ - SDL1.3: Clear bck when moving
+ - SDL1.3: now compiles on win32
+ - SDL1.3: Support screen refresh rates, provided the sdl video
+ layer supports them (e.g. X11).
+ - Use video_config.waitvsync (previously option was queried)
+ - -video soft / -sm now supports -prescale
+ - removed reqwidth, reqheight from sdl_monitor_info; not used anywhere
+ - removed layerconfig from sdl_video_config; not used anywhere
+
+ - fixed yuv issues (firefox) / this was a bug I introduced
+ - removed deprecat.h from output.c
+ - Separated keyboard and mouse initialization into separate functions
+ - added _FORTIFY_SOURCE to verbose compiler define output.
+ - remove MAX_CPU from debugwin.c
+ - fixed vsync handling in SDL1.3 in soft/opengl drivers
+ - "waitvsync" also supported by "soft" driver in SDL1.3
+ - multiple mice and keyboards supported in SDL1.3
+ - support for DISTRO= make option
+ - got rid of "-joymap" and "-joymap_file"
+ - add -joy_idx[0-7] -keyb_idx[0-7] -mouse_idx[0-7] which
+ specify, which device is allocated to to e.g. Mouse 1, Mouse 2, ...
+ - moved define of THREAD_COOPERATIVE into sdl.mak and renamed to
+ NO_THREAD_COOPERATIVE. Changed references to #ifndef
+ - define NO_DEBUGGER in sdl.mak
+ - Solaris now uses -DNO_AFFINITY_NP
+ - added machine to window_info, removed deprecat.h from drawogl.c
+
+ - For DEBUG=1 builds, disable input grapping while windowed
+ - Fixed WIN32 compile
+ Wrote setenv function since mingw does not provide one.
+ Implemented osd_event_* as inline functions for win32 build.
+ We should at some point merge sdlwork.c and winwork.c and push it
+ to the core, letting sdlsync.c provide the necessary details.
+ - Removed keybled.c and references
+ - Added output.c and output.h. These will look for a fifo or file
+ /tmp/sdlmame_out and write output notifiers to it.
+ Added a sample client ledutil.sh to src/osd/sdl which turns
+ leds on and off and provides a debug (log) facility.
+ - removed os2work.c
+
+ - replaced window->render_lock with event window->rendered_event
+ For multiple windows and "-mt", the old code would allow filling up
+ the workqueue with 1000s of entries, since the lock would not block while
+ another window is rendered. The osd_event establishes a barrier which
+ is only freed if the last window blit operation has finished.
+ - Set SDL_VIDEO_GL_DRIVER if -gl_lib is given. The SDL directfb driver is picky about
+ this. Added reminder: FIXME: move lib loading code from drawogl.c here. This may be
+ used to disable opengl if no library was loaded.
+ - SDL1.3/video=opengl: Fixed windows not being updated after another window was resized
+ - for -verbose, output some information about renderer (-video soft)
+ - initialize mouse_enabled with option "-mouse". Affects both SDL1.2 and SDL1.3
+ This will hide the mouse if you specify "-mouse".
+ - SDL1.2: added blitmode "async" which sets SDL_ASYNCBLIT
+ - SDL1.2: removed blitmodes "hwbest" and "hwblit"
+ - added blitmode "hwbest" for antialiased and smoothed scaling now that the
+ directfb driver supports it. This is also supported by the 1.3 opengl
+ render backend
+ - added sdlinput_release_keys to cope with lost keyboard events in SDL1.3
+ - some identing in drawogl.c
+ - rename SDL_* macros to SDLMAME_* (avoid name clashes)
+ - got rid of VIDEO_SCALE_MODE constants. Scale modes are now handled in drawsdl.c.
+ Starting mame with eg. -video soft -sm yuy2 on X11 no longer crashes.
+ - some more changes to input.c to avoid resize loops (issue for directfb)
+
+ - working ui mouse inputs for SDL1.2 and SDL1.3 incl. yuv modes
+ - added blitmode "hwblit" (SDL1.3) for rgb hardware scaling
+ - rename "-yuvmode" option to "-scalemode"
+ - rename yuv_mode and derivatives to scale_mode
+ - moved extra_flags into sdl_info
+ - moved callbacks indow sdl_window_info
+ - made a number of flags (e.g. yuvmode) window relative
- changing of yuvmodes and opengl scale effects is working with SDL 1.3
- - improved fullscreen handling
- - removed HAS_WINDOW_MENU - this has no effect nowhere
- - removed underscores in header defines, e.g. __SDL_SYNC__ ==> __SDLSYNC__
- - added SDLMAME_HAS_DEBUGGER define
- - removed #if 0 inw window.c
- - added option "-audiodriver" to specify the SDL audio driver
- - added option "-videodriver" to specify the SDL video driver
- - added option "-renderdriver" to specify the SDL renderer driver
- - changed environment SDLMAME_GL_LIB into option -gl_lib
- - added some more SDL_ENV defines
- - move keymap reading into separate function
- - SDL_EnableUNICODE for all builds (not only MESS)
- - SDL1.3 : Mouse & text input for ui
-
- - removed osd_event_wait_multiple from sdlsync.h
- - removed some includes not needed
- - reorganized texcopy/scale2x
- - removed effect.h
- - removed effect_func.h
- - indenting
- - put osd_copyfile, osd_stat into #ifdef MESS
- - added code which implements events without the need
- for pthreads. This is commented out, since
- owever, it horribly fails, if
- threads > num processors as is the case if you
- enable "-mt"
- - rename mame_bitmap to bitmap_t
- - introduced define OSDWORK_CALLBACK to prototype and
- define functions to be passed to sdlwork.c
-
- - fixes from judge for warnings / may reappear (glade)
- - more warnings fixed / may reappear (glade)
- - moved osdefs.h into sdlprefix.h
- - removed osdefs.h
- - finally removed sdlmisc.h
-
- - create drawogl.c and moved ogl relevant stuff there
- - draw.window_init() now called after window creation
- - removed window.opengl flag
- - added sdl_window_info as parameter to all functions in window.h
- - rename SDL_VERSIONNUM to SDL_VERSION_ATLEAST
- - removed all uclock stuff in sdlmisc.[ch]
- - minor cleanups
-
- - fixed compile issues against SDL13
- - fixed input issues with SDL13
- - stricter checks for USE_OPENGL, e.g. for options
- - move sdlvideo_loadgl to window.c, rename it to sdlwindow_loadgl and make it static
- - moved yuv_blit.c into drawsdl.c
- - renamed compute_blit_surface_size to sdlwindow_blit_surface_size
- - renamed drawsdl_destroy_all_textures to drawogl_destroy_all_textures and
- moved it to _sdl_draw_callbacks
- - removed print_colums
- - rename misc.h to sdlmisc.h
- - moved some includes from .h to .c
- - rename led_init to sdlled_init for consistency
- - rename sdl_init_audio to sdlaudio_init for consistency
- - fixed some indentation issues
- - removed ticker.h & dirty.h
-
- - changed all [f]printf to mame_printf_verbose|error|warning
- - removed obsolete frameskipping code
- - removed obsolete throttle code
- - removed fastforward
- - removed framestorun
- - introduced SDLOPTION constants for a number of options
- - add more verbose info for YUV
-
- - removed dirty.h
- - removed ticker.h
-
- - remove win_trying_to_quit
- - changed win_use_mouse to static use_mouse
- - removed win_key_trans_table
- - removed keyboard typematic definitions from input.h
- - made sdl_monitor_list static
- - removed hwstretch (sdl_video_config)
- - removed syncrefresh (sdl_video_config)
- - removed triplebuf (sdl_video_config)
- - removed sdl_has_menu
- - fixed memory_leak (window.c)
-
- - moved prototypes from drawsdl.c to window.h
- - removed joystick calibration code
- - "#if 0" code which is unreachable
- - "#if 0" code which is never used
- - moved pick_best_mode to window.c
- - removed pause_brightness option
- - added more SDLOPTION_ defines
-
- - renamed void yuv_lookup_init to drawsdl_yuv_init (global namespace)
- - rmoved some obsolete code
- - add SDL1.3 compatibility
-
- - fixed some compile issues
- - moved clear_surface into window thread
- - got SDL1.3 -mt working - still crashing on exit
-
- - removed "digital" option
- - removed device selection options
- - added more SDLOPTION defines
+ - improved fullscreen handling
+ - removed HAS_WINDOW_MENU - this has no effect nowhere
+ - removed underscores in header defines, e.g. __SDL_SYNC__ ==> __SDLSYNC__
+ - added SDLMAME_HAS_DEBUGGER define
+ - removed #if 0 inw window.c
+ - added option "-audiodriver" to specify the SDL audio driver
+ - added option "-videodriver" to specify the SDL video driver
+ - added option "-renderdriver" to specify the SDL renderer driver
+ - changed environment SDLMAME_GL_LIB into option -gl_lib
+ - added some more SDL_ENV defines
+ - move keymap reading into separate function
+ - SDL_EnableUNICODE for all builds (not only MESS)
+ - SDL1.3 : Mouse & text input for ui
+
+ - removed osd_event_wait_multiple from sdlsync.h
+ - removed some includes not needed
+ - reorganized texcopy/scale2x
+ - removed effect.h
+ - removed effect_func.h
+ - indenting
+ - put osd_copyfile, osd_stat into #ifdef MESS
+ - added code which implements events without the need
+ for pthreads. This is commented out, since
+ owever, it horribly fails, if
+ threads > num processors as is the case if you
+ enable "-mt"
+ - rename mame_bitmap to bitmap_t
+ - introduced define OSDWORK_CALLBACK to prototype and
+ define functions to be passed to sdlwork.c
+
+ - fixes from judge for warnings / may reappear (glade)
+ - more warnings fixed / may reappear (glade)
+ - moved osdefs.h into sdlprefix.h
+ - removed osdefs.h
+ - finally removed sdlmisc.h
+
+ - create drawogl.c and moved ogl relevant stuff there
+ - draw.window_init() now called after window creation
+ - removed window.opengl flag
+ - added sdl_window_info as parameter to all functions in window.h
+ - rename SDL_VERSIONNUM to SDL_VERSION_ATLEAST
+ - removed all uclock stuff in sdlmisc.[ch]
+ - minor cleanups
+
+ - fixed compile issues against SDL13
+ - fixed input issues with SDL13
+ - stricter checks for USE_OPENGL, e.g. for options
+ - move sdlvideo_loadgl to window.c, rename it to sdlwindow_loadgl and make it static
+ - moved yuv_blit.c into drawsdl.c
+ - renamed compute_blit_surface_size to sdlwindow_blit_surface_size
+ - renamed drawsdl_destroy_all_textures to drawogl_destroy_all_textures and
+ moved it to _sdl_draw_callbacks
+ - removed print_colums
+ - rename misc.h to sdlmisc.h
+ - moved some includes from .h to .c
+ - rename led_init to sdlled_init for consistency
+ - rename sdl_init_audio to sdlaudio_init for consistency
+ - fixed some indentation issues
+ - removed ticker.h & dirty.h
+
+ - changed all [f]printf to mame_printf_verbose|error|warning
+ - removed obsolete frameskipping code
+ - removed obsolete throttle code
+ - removed fastforward
+ - removed framestorun
+ - introduced SDLOPTION constants for a number of options
+ - add more verbose info for YUV
+
+ - removed dirty.h
+ - removed ticker.h
+
+ - remove win_trying_to_quit
+ - changed win_use_mouse to static use_mouse
+ - removed win_key_trans_table
+ - removed keyboard typematic definitions from input.h
+ - made sdl_monitor_list static
+ - removed hwstretch (sdl_video_config)
+ - removed syncrefresh (sdl_video_config)
+ - removed triplebuf (sdl_video_config)
+ - removed sdl_has_menu
+ - fixed memory_leak (window.c)
+
+ - moved prototypes from drawsdl.c to window.h
+ - removed joystick calibration code
+ - "#if 0" code which is unreachable
+ - "#if 0" code which is never used
+ - moved pick_best_mode to window.c
+ - removed pause_brightness option
+ - added more SDLOPTION_ defines
+
+ - renamed void yuv_lookup_init to drawsdl_yuv_init (global namespace)
+ - rmoved some obsolete code
+ - add SDL1.3 compatibility
+
+ - fixed some compile issues
+ - moved clear_surface into window thread
+ - got SDL1.3 -mt working - still crashing on exit
+
+ - removed "digital" option
+ - removed device selection options
+ - added more SDLOPTION defines
*/
//============================================================
-// System dependent defines
+// System dependent defines
//============================================================
// Process events in worker thread
@@ -224,13 +224,13 @@
#endif
#if defined(NO_DEBUGGER)
-#define SDLMAME_HAS_DEBUGGER (0)
+#define SDLMAME_HAS_DEBUGGER (0)
#else
-#define SDLMAME_HAS_DEBUGGER (1)
+#define SDLMAME_HAS_DEBUGGER (1)
#endif
//============================================================
-// Defines
+// Defines
//============================================================
#define SDLOPTION_INIPATH "inipath"
@@ -238,7 +238,7 @@
#define SDLOPTION_SCREEN(x) "screen" x
#define SDLOPTION_ASPECT(x) "aspect" x
#define SDLOPTION_RESOLUTION(x) "resolution" x
-#define SDLOPTION_VIEW(x) "view" x
+#define SDLOPTION_VIEW(x) "view" x
#define SDLOPTION_SDLVIDEOFPS "sdlvideofps"
#define SDLOPTION_KEEPASPECT "keepaspect"
#define SDLOPTION_WINDOW "window"
@@ -264,9 +264,9 @@
#define SDLOPTION_OSLOG "oslog"
#define SDLOPTION_SIXAXIS "sixaxis"
-#define SDLOPTION_JOYINDEX "joy_idx"
-#define SDLOPTION_KEYBINDEX "keyb_idx"
-#define SDLOPTION_MOUSEINDEX "mouse_index"
+#define SDLOPTION_JOYINDEX "joy_idx"
+#define SDLOPTION_KEYBINDEX "keyb_idx"
+#define SDLOPTION_MOUSEINDEX "mouse_index"
#define SDLOPTION_SHADER_MAME(x) "glsl_shader_mame" x
#define SDLOPTION_SHADER_SCREEN(x) "glsl_shader_screen" x
@@ -316,13 +316,13 @@
//============================================================
-// sound.c
+// sound.c
//============================================================
void sdlaudio_init(running_machine *machine);
//============================================================
-// sdlwork.c
+// sdlwork.c
//============================================================
extern int sdl_num_processors;
diff --git a/src/osd/sdl/osinline.h b/src/osd/sdl/osinline.h
index d020e89a912..0a9c6f428a8 100644
--- a/src/osd/sdl/osinline.h
+++ b/src/osd/sdl/osinline.h
@@ -1,6 +1,6 @@
//============================================================
//
-// osinline.h - GNU C inline functions
+// osinline.h - GNU C inline functions
//
//============================================================
@@ -11,7 +11,7 @@
//============================================================
-// INLINE FUNCTIONS
+// INLINE FUNCTIONS
//============================================================
#if defined(__i386__) || defined(__x86_64__)
diff --git a/src/osd/sdl/output.c b/src/osd/sdl/output.c
index c33b88cb1a7..3fe9efab05f 100644
--- a/src/osd/sdl/output.c
+++ b/src/osd/sdl/output.c
@@ -29,7 +29,7 @@
/*
* Using long/int should be sufficient on all
- * architectures.
+ * architectures.
*/
@@ -74,11 +74,11 @@ PID_CAST osd_getpid(void)
void sdloutput_init(running_machine *machine)
{
int fildes;
-
+
add_exit_callback(machine, sdloutput_exit);
fildes = open(SDLMAME_OUTPUT, O_RDWR | O_NONBLOCK);
-
+
if (fildes < 0)
{
output = NULL;
@@ -87,12 +87,12 @@ void sdloutput_init(running_machine *machine)
else
{
output = fdopen(fildes, "w");
-
+
mame_printf_verbose("ouput: opened output notifier file %s\n", SDLMAME_OUTPUT);
fprintf(output, "MAME " PID_FMT " START %s\n", osd_getpid(), machine->gamedrv->name);
fflush(output);
}
-
+
output_set_notifier(NULL, notifier_callback, NULL);
}
diff --git a/src/osd/sdl/sdl.mak b/src/osd/sdl/sdl.mak
index 027b36aed61..ccec6f91edb 100644
--- a/src/osd/sdl/sdl.mak
+++ b/src/osd/sdl/sdl.mak
@@ -7,7 +7,7 @@
# Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team.
# Visit http://mamedev.org for licensing and usage restrictions.
#
-# SDLMAME by Olivier Galibert and R. Belmont
+# SDLMAME by Olivier Galibert and R. Belmont
#
###########################################################################
@@ -41,8 +41,8 @@
# this will also add a rpath to the executable
# MESA_INSTALL_ROOT = /usr/local/dfb_GL
-# uncomment the next line to build a binary using
-# GL-dispatching.
+# uncomment the next line to build a binary using
+# GL-dispatching.
# This option takes precedence over MESA_INSTALL_ROOT
USE_DISPATCH_GL = 1
@@ -73,19 +73,19 @@ CCOMFLAGS += $(OPT_FLAGS)
#-------------------------------------------------
# distribution may change things
#-------------------------------------------------
-
+
ifeq ($(DISTRO),)
DISTRO = generic
-else
+else
ifeq ($(DISTRO),debian-stable)
DEFS += -DNO_AFFINITY_NP
-else
+else
ifeq ($(DISTRO),ubuntu-intrepid)
# Force gcc-4.2 on ubuntu-intrepid
CC = @gcc -V 4.2
LD = g++-4.2
#LDFLAGS += -lsupc++ -static-libgcc
-else
+else
ifeq ($(DISTRO),gcc44-generic)
CC = @gcc -V 4.4
LD = @g++ -V 4.4
@@ -151,7 +151,7 @@ SYNC_IMPLEMENTATION = tc
endif
ifeq ($(TARGETOS),unix)
-DEFS += -DSDLMAME_UNIX
+DEFS += -DSDLMAME_UNIX
ifndef NO_X11
DEFS += -DSDLMAME_X11
else
@@ -160,7 +160,7 @@ endif
endif
ifeq ($(TARGETOS),macosx)
-DEFS += -DSDLMAME_UNIX -DSDLMAME_MACOSX
+DEFS += -DSDLMAME_UNIX -DSDLMAME_MACOSX
SYNC_IMPLEMENTATION = ntc
MAINLDFLAGS = -Xlinker -all_load
ifdef BIGENDIAN
@@ -215,10 +215,10 @@ SDLMAIN =
OSDCOREOBJS = \
$(SDLOBJ)/strconv.o \
$(SDLOBJ)/sdldir.o \
- $(SDLOBJ)/sdlfile.o \
+ $(SDLOBJ)/sdlfile.o \
$(SDLOBJ)/sdlos_$(TARGETOS).o \
$(SDLOBJ)/sdlsync_$(SYNC_IMPLEMENTATION).o \
- $(SDLOBJ)/sdlwork.o
+ $(SDLOBJ)/sdlwork.o
# any "main" must be in LIBOSD or else the build will fail!
# for the windows build, we just add it to libocore as well.
@@ -296,7 +296,7 @@ endif
# Non-X11 builds can not use the debugger
ifndef NO_X11
OSDCOREOBJS += $(SDLOBJ)/debugwin.o $(SDLOBJ)/dview.o $(SDLOBJ)/debug-sup.o $(SDLOBJ)/debug-intf.o
-CCOMFLAGS += `pkg-config --cflags gtk+-2.0` `pkg-config --cflags gconf-2.0`
+CCOMFLAGS += `pkg-config --cflags gtk+-2.0` `pkg-config --cflags gconf-2.0`
LIBS += `pkg-config --libs gtk+-2.0` `pkg-config --libs gconf-2.0`
CCOMFLAGS += -DGTK_DISABLE_DEPRECATED
else
@@ -324,7 +324,7 @@ ifeq ($(TARGETOS),win32)
ifdef SDL_INSTALL_ROOT
CCOMFLAGS += -I$(SDL_INSTALL_ROOT)/include
-LIBS += -L$(SDL_INSTALL_ROOT)/lib
+LIBS += -L$(SDL_INSTALL_ROOT)/lib
# -Wl,-rpath,$(SDL_INSTALL_ROOT)/lib -lSDL $(LIBGL)
endif
@@ -342,7 +342,7 @@ OSDCOREOBJS += $(SDLOBJ)/debugwin.o
LDFLAGS += -static-libgcc
# Static linking of SDL
-LIBS += -Wl,-Bstatic -lSDL -Wl,-Bdynamic
+LIBS += -Wl,-Bstatic -lSDL -Wl,-Bdynamic
LIBS += -lopengl32 -luser32 -lgdi32 -lddraw -ldsound -ldxguid -lwinmm -ladvapi32 -lcomctl32 -lshlwapi
endif # Win32
@@ -354,7 +354,7 @@ OSDOBJS += $(SDLOBJ)/SDLMain_tmpl.o
ifndef MACOSX_USE_LIBSDL
# Compile using framework (compile using libSDL is the exception)
-LIBS += -framework SDL -framework Cocoa -framework OpenGL -lpthread
+LIBS += -framework SDL -framework Cocoa -framework OpenGL -lpthread
else
# Compile using installed libSDL (Fink or MacPorts):
#
@@ -407,10 +407,10 @@ $(LIBOSD): $(OSDOBJS)
# testkeys
#-------------------------------------------------
-$(SDLOBJ)/testkeys.o: $(SDLSRC)/testkeys.c
+$(SDLOBJ)/testkeys.o: $(SDLSRC)/testkeys.c
@echo Compiling $<...
$(CC) $(CFLAGS) $(DEFS) -c $< -o $@
-
+
TESTKEYSOBJS = \
$(SDLOBJ)/testkeys.o \
@@ -420,12 +420,12 @@ testkeys$(EXE): $(TESTKEYSOBJS) $(LIBUTIL) $(LIBOCORE)
sdlclean:
rm -f .depend
-
+
testlib:
-echo LIBS: $(LIBS)
-echo DEFS: $(DEFS)
-echo CORE: $(OSDCOREOBJS)
-
+
ifneq ($(TARGETOS),win32)
depend:
rm -f .depend
diff --git a/src/osd/sdl/sdldir.c b/src/osd/sdl/sdldir.c
index d0edea43ba7..0236f769036 100644
--- a/src/osd/sdl/sdldir.c
+++ b/src/osd/sdl/sdldir.c
@@ -120,7 +120,7 @@ osd_directory *osd_opendir(const char *dirname)
if (tmpstr[0] == '$')
{
char *envval;
- envstr = (char *) malloc(strlen(tmpstr)+1);
+ envstr = (char *) malloc(strlen(tmpstr)+1);
strcpy(envstr, tmpstr);
@@ -138,7 +138,7 @@ osd_directory *osd_opendir(const char *dirname)
j = strlen(envval) + strlen(tmpstr) + 1;
free(tmpstr);
tmpstr = (char *) malloc(j);
-
+
// start with the value of $HOME
strcpy(tmpstr, envval);
// replace the null with a path separator again
diff --git a/src/osd/sdl/sdlfile.c b/src/osd/sdl/sdlfile.c
index acc52d6d8f9..40dab6a040c 100644
--- a/src/osd/sdl/sdlfile.c
+++ b/src/osd/sdl/sdlfile.c
@@ -49,7 +49,7 @@ static UINT32 create_path_recursive(char *path);
struct _osd_file
{
int handle;
- char filename[1];
+ char filename[1];
};
@@ -136,7 +136,7 @@ file_error osd_open(const char *path, UINT32 openflags, osd_file **file, UINT64
filerr = FILERR_INVALID_ACCESS;
goto error;
}
-
+
tmpstr = (char *) malloc(strlen((*file)->filename)+1);
strcpy(tmpstr, (*file)->filename);
@@ -144,7 +144,7 @@ file_error osd_open(const char *path, UINT32 openflags, osd_file **file, UINT64
if (tmpstr[0] == '$')
{
char *envval;
- envstr = (char *) malloc(strlen(tmpstr)+1);
+ envstr = (char *) malloc(strlen(tmpstr)+1);
strcpy(envstr, tmpstr);
@@ -162,7 +162,7 @@ file_error osd_open(const char *path, UINT32 openflags, osd_file **file, UINT64
j = strlen(envval) + strlen(tmpstr) + 1;
free(tmpstr);
tmpstr = (char *) malloc(j);
-
+
// start with the value of $HOME
strcpy(tmpstr, envval);
// replace the null with a path separator again
@@ -258,7 +258,7 @@ file_error osd_read(osd_file *file, void *buffer, UINT64 offset, UINT32 count, U
if (result < 0)
#elif defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_OS2)
lseek(file->handle, (UINT32)offset&0xffffffff, SEEK_SET);
- result = read(file->handle, buffer, count);
+ result = read(file->handle, buffer, count);
if (result < 0)
#elif defined(SDLMAME_UNIX)
result = pread64(file->handle, buffer, count, offset);
@@ -286,7 +286,7 @@ file_error osd_write(osd_file *file, const void *buffer, UINT64 offset, UINT32 c
if (!result)
#elif defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_OS2)
lseek(file->handle, (UINT32)offset&0xffffffff, SEEK_SET);
- result = write(file->handle, buffer, count);
+ result = write(file->handle, buffer, count);
if (!result)
#elif defined(SDLMAME_UNIX)
result = pwrite64(file->handle, buffer, count, offset);
@@ -322,7 +322,7 @@ file_error osd_rmfile(const char *filename)
{
if (unlink(filename) == -1)
{
- return error_to_file_error(errno);
+ return error_to_file_error(errno);
}
return FILERR_NONE;
@@ -374,7 +374,7 @@ int osd_get_physical_drive_geometry(const char *filename, UINT32 *cylinders, UIN
/*============================================================ */
/* osd_is_path_separator */
/*============================================================ */
-
+
static int osd_is_path_separator(char c)
{
return (c == '/') || (c == '\\');
@@ -386,7 +386,7 @@ static int osd_is_path_separator(char c)
int osd_is_absolute_path(const char *path)
{
int result;
-
+
if (osd_is_path_separator(path[0]))
result = TRUE;
#if !defined(SDLMAME_WIN32) && !defined(SDLMAME_OS2)
@@ -401,12 +401,12 @@ int osd_is_absolute_path(const char *path)
else
result = FALSE;
return result;
-}
+}
/* not used anywhere */
-#if 0
+#if 0
//============================================================
-// osd_mkdir
+// osd_mkdir
//============================================================
file_error osd_mkdir(const char *dir)
@@ -424,7 +424,7 @@ file_error osd_mkdir(const char *dir)
}
//============================================================
-// osd_rmdir
+// osd_rmdir
//============================================================
static file_error osd_rmdir(const char *dir)
@@ -442,7 +442,7 @@ static file_error osd_rmdir(const char *dir)
#ifdef MESS
//============================================================
-// osd_copyfile
+// osd_copyfile
// FIXME: this will not work with blanks in filename ...
//============================================================
@@ -470,7 +470,7 @@ osd_directory_entry *osd_stat(const char *path)
#else
struct stat64 st;
#endif
-
+
#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
err = stat(path, &st);
#else
@@ -486,7 +486,7 @@ osd_directory_entry *osd_stat(const char *path)
result->name = ((char *) result) + sizeof(*result);
result->type = S_ISDIR(st.st_mode) ? ENTTYPE_DIR : ENTTYPE_FILE;
result->size = (UINT64)st.st_size;
-
+
return result;
}
#endif
diff --git a/src/osd/sdl/sdlmain.c b/src/osd/sdl/sdlmain.c
index b08b73969ed..a3e9077fcaa 100644
--- a/src/osd/sdl/sdlmain.c
+++ b/src/osd/sdl/sdlmain.c
@@ -60,7 +60,7 @@ void MorphToPM()
#endif
//============================================================
-// LOCAL VARIABLES
+// LOCAL VARIABLES
//============================================================
#ifdef MESS
@@ -85,7 +85,7 @@ static char cwd[512];
static const options_entry mame_sdl_options[] =
{
- { SDLOPTION_INIPATH, INI_PATH, 0, "path to ini files" },
+ { SDLOPTION_INIPATH, INI_PATH, 0, "path to ini files" },
// debugging options
{ NULL, NULL, OPTION_HEADER, "DEBUGGING OPTIONS" },
@@ -126,30 +126,30 @@ static const options_entry mame_sdl_options[] =
{ SDLOPTION_GL_VBO, "1", OPTION_BOOLEAN, "enable OpenGL VBO, if available (default on)" },
{ SDLOPTION_GL_PBO, "1", OPTION_BOOLEAN, "enable OpenGL PBO, if available (default on)" },
{ SDLOPTION_GL_GLSL, "0", OPTION_BOOLEAN, "enable OpenGL GLSL, if available (default off)" },
- { SDLOPTION_GLSL_FILTER, "1", 0, "enable OpenGL GLSL filtering instead of FF filtering 0-plain, 1-bilinear (default)" },
- { SDLOPTION_SHADER_MAME("0"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 0" },
- { SDLOPTION_SHADER_MAME("1"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 1" },
- { SDLOPTION_SHADER_MAME("2"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 2" },
- { SDLOPTION_SHADER_MAME("3"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 3" },
- { SDLOPTION_SHADER_MAME("4"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 4" },
- { SDLOPTION_SHADER_MAME("5"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 5" },
- { SDLOPTION_SHADER_MAME("6"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 6" },
- { SDLOPTION_SHADER_MAME("7"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 7" },
- { SDLOPTION_SHADER_MAME("8"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 8" },
- { SDLOPTION_SHADER_MAME("9"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 9" },
- { SDLOPTION_SHADER_SCREEN("0"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 0" },
- { SDLOPTION_SHADER_SCREEN("1"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 1" },
- { SDLOPTION_SHADER_SCREEN("2"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 2" },
- { SDLOPTION_SHADER_SCREEN("3"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 3" },
- { SDLOPTION_SHADER_SCREEN("4"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 4" },
- { SDLOPTION_SHADER_SCREEN("5"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 5" },
- { SDLOPTION_SHADER_SCREEN("6"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 6" },
- { SDLOPTION_SHADER_SCREEN("7"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 7" },
- { SDLOPTION_SHADER_SCREEN("8"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 8" },
- { SDLOPTION_SHADER_SCREEN("9"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 9" },
- { SDLOPTION_GL_GLSL_VID_ATTR, "1", OPTION_BOOLEAN, "enable OpenGL GLSL handling of brightness and contrast. Better RGB game performance for free. (default)" },
+ { SDLOPTION_GLSL_FILTER, "1", 0, "enable OpenGL GLSL filtering instead of FF filtering 0-plain, 1-bilinear (default)" },
+ { SDLOPTION_SHADER_MAME("0"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 0" },
+ { SDLOPTION_SHADER_MAME("1"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 1" },
+ { SDLOPTION_SHADER_MAME("2"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 2" },
+ { SDLOPTION_SHADER_MAME("3"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 3" },
+ { SDLOPTION_SHADER_MAME("4"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 4" },
+ { SDLOPTION_SHADER_MAME("5"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 5" },
+ { SDLOPTION_SHADER_MAME("6"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 6" },
+ { SDLOPTION_SHADER_MAME("7"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 7" },
+ { SDLOPTION_SHADER_MAME("8"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 8" },
+ { SDLOPTION_SHADER_MAME("9"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader set mame bitmap 9" },
+ { SDLOPTION_SHADER_SCREEN("0"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 0" },
+ { SDLOPTION_SHADER_SCREEN("1"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 1" },
+ { SDLOPTION_SHADER_SCREEN("2"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 2" },
+ { SDLOPTION_SHADER_SCREEN("3"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 3" },
+ { SDLOPTION_SHADER_SCREEN("4"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 4" },
+ { SDLOPTION_SHADER_SCREEN("5"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 5" },
+ { SDLOPTION_SHADER_SCREEN("6"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 6" },
+ { SDLOPTION_SHADER_SCREEN("7"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 7" },
+ { SDLOPTION_SHADER_SCREEN("8"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 8" },
+ { SDLOPTION_SHADER_SCREEN("9"), SDLOPTVAL_NONE, 0, "custom OpenGL GLSL shader screen bitmap 9" },
+ { SDLOPTION_GL_GLSL_VID_ATTR, "1", OPTION_BOOLEAN, "enable OpenGL GLSL handling of brightness and contrast. Better RGB game performance for free. (default)" },
#endif
-
+
// per-window options
{ NULL, NULL, OPTION_HEADER, "PER-WINDOW VIDEO OPTIONS" },
{ SDLOPTION_SCREEN(""), SDLOPTVAL_AUTO, 0, "explicit name of the first screen; 'auto' here will try to make a best guess" },
@@ -241,7 +241,7 @@ static const options_entry mame_sdl_options[] =
#endif
{ SDLOPTION_AUDIODRIVER ";ad", SDLOPTVAL_AUTO, 0, "sdl audio driver to use ('alsa', 'arts', ... or 'auto' for SDL default" },
#if USE_OPENGL
- { SDLOPTION_GL_LIB, SDLOPTVAL_GLLIB, 0, "alternative libGL.so to use; 'auto' for system default" },
+ { SDLOPTION_GL_LIB, SDLOPTVAL_GLLIB, 0, "alternative libGL.so to use; 'auto' for system default" },
#endif
// End of list
@@ -256,7 +256,7 @@ static int setenv(const char *name, const char *value, int overwrite)
{
char *buf;
int result;
-
+
if (!overwrite)
{
if (getenv(name) != NULL)
@@ -265,18 +265,18 @@ static int setenv(const char *name, const char *value, int overwrite)
buf = (char *) malloc(strlen(name)+strlen(value)+2);
sprintf(buf, "%s=%s", name, value);
result = putenv(buf);
-
- /* will be referenced by environment
- * Therefore it is not freed here
- */
-
+
+ /* will be referenced by environment
+ * Therefore it is not freed here
+ */
+
return result;
}
#endif
//============================================================
-// main
+// main
//============================================================
// we do some special sauce on Win32...
@@ -287,7 +287,7 @@ int main(int argc, char **argv)
int res = 0;
#else
-
+
/* gee */
extern "C" DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
@@ -334,7 +334,7 @@ int main(int argc, char *argv[])
if (display)
XCloseDisplay(display);
}
-#endif
+#endif
res = cli_execute(argc, argv, mame_sdl_options);
@@ -347,7 +347,7 @@ int main(int argc, char *argv[])
// already called...
//SDL_Quit();
-
+
exit(res);
return res;
@@ -367,7 +367,7 @@ static void output_oslog(running_machine *machine, const char *buffer)
//============================================================
-// osd_exit
+// osd_exit
//============================================================
static void osd_exit(running_machine *machine)
@@ -378,10 +378,10 @@ static void osd_exit(running_machine *machine)
}
//============================================================
-// defines_verbose
+// defines_verbose
//============================================================
-#define MAC_EXPAND_STR(_m) #_m
+#define MAC_EXPAND_STR(_m) #_m
#define MACRO_VERBOSE(_mac) \
do { \
if (strcmp(MAC_EXPAND_STR(_mac), #_mac) != 0) \
@@ -445,14 +445,14 @@ static void defines_verbose(void)
}
//============================================================
-// osd_sdl_info
+// osd_sdl_info
//============================================================
static void osd_sdl_info(void)
{
#if SDL_VERSION_ATLEAST(1,3,0)
int i, cur, num = SDL_GetNumVideoDrivers();
-
+
mame_printf_verbose("Available videodrivers: ");
for (i=0;i<num;i++)
{
@@ -467,7 +467,7 @@ static void osd_sdl_info(void)
{
SDL_DisplayMode mode;
int j;
-
+
SDL_SelectVideoDisplay(i);
mame_printf_verbose("\tDisplay #%d\n", i);
if (SDL_GetDesktopDisplayMode(&mode));
@@ -495,7 +495,7 @@ static void osd_sdl_info(void)
//============================================================
-// osd_init
+// osd_init
//============================================================
void osd_init(running_machine *machine)
@@ -528,8 +528,8 @@ void osd_init(running_machine *machine)
}
/* Set the SDL environment variable for drivers wanting to load the
- * lib at startup.
- */
+ * lib at startup.
+ */
/* FIXME: move lib loading code from drawogl.c here */
stemp = options_get_string(mame_options(), SDLOPTION_GL_LIB);
@@ -578,9 +578,9 @@ void osd_init(running_machine *machine)
{
mame_printf_error("sdlmame: -debug not supported on X11-less builds\n\n");
osd_exit(machine);
- exit(-1);
+ exit(-1);
}
-
+
if (sdlvideo_init(machine))
{
osd_exit(machine);
@@ -591,11 +591,11 @@ void osd_init(running_machine *machine)
}
sdlinput_init(machine);
-
+
sdlaudio_init(machine);
sdloutput_init(machine);
-
+
if (options_get_bool(mame_options(), SDLOPTION_OSLOG))
add_logerror_callback(machine, output_oslog);
diff --git a/src/osd/sdl/sdlos_macosx.c b/src/osd/sdl/sdlos_macosx.c
index 5ce21f87573..eb6bf195fdc 100644
--- a/src/osd/sdl/sdlos_macosx.c
+++ b/src/osd/sdl/sdlos_macosx.c
@@ -156,7 +156,7 @@ int osd_num_processors(void)
unsigned int count;
kern_return_t r;
mach_port_t my_mach_host_self;
-
+
count = HOST_BASIC_INFO_COUNT;
my_mach_host_self = mach_host_self();
if ( ( r = host_info(my_mach_host_self, HOST_BASIC_INFO, (host_info_t)(&host_basic_info), &count)) == KERN_SUCCESS )
@@ -164,7 +164,7 @@ int osd_num_processors(void)
processors = host_basic_info.avail_cpus;
}
mach_port_deallocate(mach_task_self(), my_mach_host_self);
-
+
return processors;
}
@@ -200,7 +200,7 @@ void osd_break_into_debugger(const char *message)
#ifdef MAME_DEBUG
printf("MAME exception: %s\n", message);
printf("Attempting to fall into debugger\n");
- kill(getpid(), SIGTRAP);
+ kill(getpid(), SIGTRAP);
#else
printf("Ignoring MAME exception: %s\n", message);
#endif
diff --git a/src/osd/sdl/sdlos_os2.c b/src/osd/sdl/sdlos_os2.c
index 113f74de82d..4c20ae815d0 100644
--- a/src/osd/sdl/sdlos_os2.c
+++ b/src/osd/sdl/sdlos_os2.c
@@ -196,7 +196,7 @@ int osd_num_processors(void)
void *osd_alloc_executable(size_t size)
{
void *p;
-
+
DosAllocMem( &p, size, fALLOC );
return p;
}
diff --git a/src/osd/sdl/sdlos_unix.c b/src/osd/sdl/sdlos_unix.c
index 610d63b3237..e38111bc28c 100644
--- a/src/osd/sdl/sdlos_unix.c
+++ b/src/osd/sdl/sdlos_unix.c
@@ -30,7 +30,7 @@ osd_ticks_t osd_ticks(void)
{
struct timeval tp;
static osd_ticks_t start_sec = 0;
-
+
gettimeofday(&tp, NULL);
if (start_sec==0)
start_sec = tp.tv_sec;
@@ -49,7 +49,7 @@ osd_ticks_t osd_ticks_per_second(void)
void osd_sleep(osd_ticks_t duration)
{
UINT32 msec;
-
+
// convert to milliseconds, rounding down
msec = (UINT32)(duration * 1000 / osd_ticks_per_second());
@@ -139,7 +139,7 @@ void osd_break_into_debugger(const char *message)
#ifdef MAME_DEBUG
printf("MAME exception: %s\n", message);
printf("Attempting to fall into debugger\n");
- kill(getpid(), SIGTRAP);
+ kill(getpid(), SIGTRAP);
#else
printf("Ignoring MAME exception: %s\n", message);
#endif
diff --git a/src/osd/sdl/sdlsync.h b/src/osd/sdl/sdlsync.h
index 82fec017d72..691497456a5 100644
--- a/src/osd/sdl/sdlsync.h
+++ b/src/osd/sdl/sdlsync.h
@@ -51,7 +51,7 @@ osd_event *osd_event_alloc(int manualreset, int initialstate);
Return value:
TRUE: The event was signalled
- FALSE: A timeout occurred
+ FALSE: A timeout occurred
-----------------------------------------------------------------------------*/
int osd_event_wait(osd_event *event, osd_ticks_t timeout);
@@ -65,7 +65,7 @@ int osd_event_wait(osd_event *event, osd_ticks_t timeout);
Return value:
- None
+ None
-----------------------------------------------------------------------------*/
void osd_event_reset(osd_event *event);
@@ -79,11 +79,11 @@ void osd_event_reset(osd_event *event);
Return value:
- None
-
- Notes:
-
- All threads waiting for the event will be signalled.
+ None
+
+ Notes:
+
+ All threads waiting for the event will be signalled.
-----------------------------------------------------------------------------*/
void osd_event_set(osd_event *event);
@@ -149,10 +149,10 @@ int osd_thread_adjust_priority(osd_thread *thread, int adjust);
Parameters:
- thread - A pointer to a previously created thread
+ thread - A pointer to a previously created thread
or NULL for main thread
mask - bitmask to which cpus to bind
- i.e. 0x01 1st cpu, 0x02, 2nd cpu, 0x04 3rd cpu
+ i.e. 0x01 1st cpu, 0x02, 2nd cpu, 0x04 3rd cpu
Return value:
diff --git a/src/osd/sdl/sdlsync_ntc.c b/src/osd/sdl/sdlsync_ntc.c
index a99f50fdd20..95297340a44 100644
--- a/src/osd/sdl/sdlsync_ntc.c
+++ b/src/osd/sdl/sdlsync_ntc.c
@@ -35,7 +35,7 @@
#include <sys/time.h>
struct _osd_lock {
- volatile pthread_t holder;
+ volatile pthread_t holder;
INT32 count;
#ifdef PTR64
INT8 padding[52]; // Fill a 64-byte cache line
@@ -43,10 +43,10 @@ struct _osd_lock {
INT8 padding[56]; // A bit more padding
#endif
};
-
+
struct _osd_event {
pthread_mutex_t mutex;
- pthread_cond_t cond;
+ pthread_cond_t cond;
volatile INT32 autoreset;
volatile INT32 signalled;
#ifdef PTR64
@@ -69,10 +69,10 @@ struct _osd_scalable_lock
{
struct
{
- volatile INT32 haslock; // do we have the lock?
- INT32 filler[64/4-1]; // assumes a 64-byte cache line
+ volatile INT32 haslock; // do we have the lock?
+ INT32 filler[64/4-1]; // assumes a 64-byte cache line
} slot[WORK_MAX_THREADS]; // one slot per thread
- volatile INT32 nextindex; // index of next slot to use
+ volatile INT32 nextindex; // index of next slot to use
};
@@ -83,7 +83,7 @@ struct _osd_scalable_lock
osd_scalable_lock *osd_scalable_lock_alloc(void)
{
osd_scalable_lock *lock;
-
+
lock = (osd_scalable_lock *)calloc(1, sizeof(*lock));
memset(lock, 0, sizeof(*lock));
@@ -171,7 +171,7 @@ void osd_scalable_lock_free(osd_scalable_lock *lock)
{
free(lock);
}
-
+
INLINE pthread_t osd_compare_exchange_pthread_t(pthread_t volatile *ptr, pthread_t compare, pthread_t exchange)
{
#ifdef PTR64
@@ -265,9 +265,9 @@ void osd_lock_acquire(osd_lock *lock)
#endif
#if 0
/* If you mean to use locks as a blocking mechanism for extended
- * periods of time, you should do something like this. However,
- * it kills the performance of gaelco3d.
- */
+ * periods of time, you should do something like this. However,
+ * it kills the performance of gaelco3d.
+ */
if (spin == 0)
{
struct timespec sleep = { 0, 100000 }, remaining;
@@ -319,7 +319,7 @@ void osd_lock_release(osd_lock *lock)
}
// trying to release a lock you don't hold is bad!
-// assert(lock->holder == pthread_self());
+// assert(lock->holder == pthread_self());
}
//============================================================
@@ -347,7 +347,7 @@ osd_event *osd_event_alloc(int manualreset, int initialstate)
pthread_cond_init(&ev->cond, NULL);
ev->signalled = initialstate;
ev->autoreset = !manualreset;
-
+
return ev;
}
@@ -414,9 +414,9 @@ int osd_event_wait(osd_event *event, osd_ticks_t timeout)
struct timeval tp;
UINT64 msec = timeout * 1000 / osd_ticks_per_second();
UINT64 nsec;
-
+
gettimeofday(&tp, NULL);
-
+
ts.tv_sec = tp.tv_sec;
nsec = (UINT64) tp.tv_usec * (UINT64) 1000 + (msec * (UINT64) 1000000);
ts.tv_nsec = nsec % (UINT64) 1000000000;
@@ -440,7 +440,7 @@ int osd_event_wait(osd_event *event, osd_ticks_t timeout)
{
printf("Error %d while waiting for pthread_cond_timedwait: %s\n", ret, strerror(ret));
}
-
+
} while (TRUE);
}
}
@@ -481,7 +481,7 @@ int osd_thread_adjust_priority(osd_thread *thread, int adjust)
{
struct sched_param sched;
int policy;
-
+
if ( pthread_getschedparam( thread->thread, &policy, &sched ) == 0 )
{
sched.sched_priority += adjust;
diff --git a/src/osd/sdl/sdlsync_os2.c b/src/osd/sdl/sdlsync_os2.c
index cbc1fe878af..f3271e154e0 100644
--- a/src/osd/sdl/sdlsync_os2.c
+++ b/src/osd/sdl/sdlsync_os2.c
@@ -34,7 +34,7 @@
#define pthread_self _gettid
struct _osd_lock {
- volatile pthread_t holder;
+ volatile pthread_t holder;
INT32 count;
#ifdef PTR64
INT8 padding[52]; // Fill a 64-byte cache line
@@ -62,10 +62,10 @@ struct _osd_scalable_lock
{
struct
{
- volatile INT32 haslock; // do we have the lock?
- INT32 filler[64/4-1]; // assumes a 64-byte cache line
+ volatile INT32 haslock; // do we have the lock?
+ INT32 filler[64/4-1]; // assumes a 64-byte cache line
} slot[WORK_MAX_THREADS]; // one slot per thread
- volatile INT32 nextindex; // index of next slot to use
+ volatile INT32 nextindex; // index of next slot to use
};
@@ -76,7 +76,7 @@ struct _osd_scalable_lock
osd_scalable_lock *osd_scalable_lock_alloc(void)
{
osd_scalable_lock *lock;
-
+
lock = (osd_scalable_lock *)calloc(1, sizeof(*lock));
memset(lock, 0, sizeof(*lock));
@@ -258,9 +258,9 @@ void osd_lock_acquire(osd_lock *lock)
#endif
#if 0
/* If you mean to use locks as a blocking mechanism for extended
- * periods of time, you should do something like this. However,
- * it kills the performance of gaelco3d.
- */
+ * periods of time, you should do something like this. However,
+ * it kills the performance of gaelco3d.
+ */
if (spin == 0)
{
struct timespec sleep = { 0, 100000 }, remaining;
@@ -312,7 +312,7 @@ void osd_lock_release(osd_lock *lock)
}
// trying to release a lock you don't hold is bad!
-// assert(lock->holder == pthread_self());
+// assert(lock->holder == pthread_self());
}
//============================================================
diff --git a/src/osd/sdl/sdlsync_sdl.c b/src/osd/sdl/sdlsync_sdl.c
index d728aea9392..382e2c8139d 100644
--- a/src/osd/sdl/sdlsync_sdl.c
+++ b/src/osd/sdl/sdlsync_sdl.c
@@ -26,7 +26,7 @@
#if VERBOSE
#define LOG( x ) do { printf x; printf("\n"); } while (0)
#else
-#define LOG( x )
+#define LOG( x )
#endif
typedef struct _hidden_mutex_t hidden_mutex_t;
struct _hidden_mutex_t {
@@ -34,10 +34,10 @@ struct _hidden_mutex_t {
volatile INT32 locked;
volatile INT32 threadid;
};
-
+
struct _osd_event {
- SDL_mutex * mutex;
- SDL_cond * cond;
+ SDL_mutex * mutex;
+ SDL_cond * cond;
volatile INT32 autoreset;
volatile INT32 signalled;
};
@@ -54,7 +54,7 @@ struct _osd_thread {
struct _osd_scalable_lock
{
- SDL_mutex * mutex;
+ SDL_mutex * mutex;
};
//============================================================
@@ -64,7 +64,7 @@ struct _osd_scalable_lock
osd_scalable_lock *osd_scalable_lock_alloc(void)
{
osd_scalable_lock *lock;
-
+
lock = (osd_scalable_lock *)calloc(1, sizeof(*lock));
lock->mutex = SDL_CreateMutex();
@@ -195,7 +195,7 @@ osd_event *osd_event_alloc(int manualreset, int initialstate)
ev->cond = SDL_CreateCond();
ev->signalled = initialstate;
ev->autoreset = !manualreset;
-
+
return ev;
}
@@ -262,7 +262,7 @@ int osd_event_wait(osd_event *event, osd_ticks_t timeout)
if (!event->signalled)
{
UINT64 msec = (timeout * 1000) / osd_ticks_per_second();
-
+
do {
int ret = SDL_CondWaitTimeout(event->cond, event->mutex, msec);
if ( ret == SDL_MUTEX_TIMEDOUT )
diff --git a/src/osd/sdl/sdlsync_tc.c b/src/osd/sdl/sdlsync_tc.c
index 34100c09135..eeddfef0bcb 100644
--- a/src/osd/sdl/sdlsync_tc.c
+++ b/src/osd/sdl/sdlsync_tc.c
@@ -36,10 +36,10 @@ typedef struct _hidden_mutex_t hidden_mutex_t;
struct _hidden_mutex_t {
pthread_mutex_t id;
};
-
+
struct _osd_event {
pthread_mutex_t mutex;
- pthread_cond_t cond;
+ pthread_cond_t cond;
volatile INT32 autoreset;
volatile INT32 signalled;
#ifdef PTR64
@@ -69,7 +69,7 @@ struct _osd_scalable_lock
osd_scalable_lock *osd_scalable_lock_alloc(void)
{
osd_scalable_lock *lock;
-
+
lock = (osd_scalable_lock *)calloc(1, sizeof(*lock));
lock->lock = osd_lock_alloc();
@@ -122,7 +122,7 @@ void osd_lock_acquire(osd_lock *lock)
{
hidden_mutex_t *mutex = (hidden_mutex_t *) lock;
int r;
-
+
r = pthread_mutex_lock(&mutex->id);
if (r==0)
return;
@@ -137,12 +137,12 @@ int osd_lock_try(osd_lock *lock)
{
hidden_mutex_t *mutex = (hidden_mutex_t *) lock;
int r;
-
+
r = pthread_mutex_trylock(&mutex->id);
if (r==0)
return 1;
//if (r!=EBUSY)
- // mame_printf_error("Error on trylock: %d: %s\n", r, strerror(r));
+ // mame_printf_error("Error on trylock: %d: %s\n", r, strerror(r));
return 0;
}
@@ -186,7 +186,7 @@ osd_event *osd_event_alloc(int manualreset, int initialstate)
pthread_cond_init(&ev->cond, NULL);
ev->signalled = initialstate;
ev->autoreset = !manualreset;
-
+
return ev;
}
@@ -253,9 +253,9 @@ int osd_event_wait(osd_event *event, osd_ticks_t timeout)
struct timeval tp;
UINT64 msec = timeout * 1000 / osd_ticks_per_second();
UINT64 nsec;
-
+
gettimeofday(&tp, NULL);
-
+
ts.tv_sec = tp.tv_sec;
nsec = (UINT64) tp.tv_usec * (UINT64) 1000 + (msec * (UINT64) 1000000);
ts.tv_nsec = nsec % (UINT64) 1000000000;
@@ -279,7 +279,7 @@ int osd_event_wait(osd_event *event, osd_ticks_t timeout)
{
printf("Error %d while waiting for pthread_cond_timedwait: %s\n", ret, strerror(ret));
}
-
+
} while (TRUE);
}
}
@@ -320,7 +320,7 @@ int osd_thread_adjust_priority(osd_thread *thread, int adjust)
{
struct sched_param sched;
int policy;
-
+
if ( pthread_getschedparam( thread->thread, &policy, &sched ) == 0 )
{
sched.sched_priority += adjust;
@@ -348,12 +348,12 @@ int osd_thread_cpu_affinity(osd_thread *thread, UINT32 mask)
for (bitnum=0; bitnum<32; bitnum++)
if (mask & (1<<bitnum))
CPU_SET(bitnum, &cmask);
-
+
if (thread == NULL)
lthread = pthread_self();
else
lthread = thread->thread;
-
+
if (pthread_setaffinity_np(lthread, sizeof(cmask), &cmask) <0)
{
/* Not available during link in all targets */
diff --git a/src/osd/sdl/sdlsync_win32.c b/src/osd/sdl/sdlsync_win32.c
index 051921ae282..cc89609b529 100644
--- a/src/osd/sdl/sdlsync_win32.c
+++ b/src/osd/sdl/sdlsync_win32.c
@@ -98,10 +98,10 @@ struct _osd_scalable_lock
#if USE_SCALABLE_LOCKS
struct
{
- volatile INT32 haslock; // do we have the lock?
+ volatile INT32 haslock; // do we have the lock?
INT32 filler[64/4-1]; // assumes a 64-byte cache line
} slot[WORK_MAX_THREADS]; // one slot per thread
- volatile INT32 nextindex; // index of next slot to use
+ volatile INT32 nextindex; // index of next slot to use
#else
CRITICAL_SECTION section;
#endif
@@ -110,9 +110,9 @@ struct _osd_scalable_lock
osd_scalable_lock *osd_scalable_lock_alloc(void)
{
osd_scalable_lock *lock;
-
+
lock = (osd_scalable_lock *)calloc(1, sizeof(*lock));
-
+
memset(lock, 0, sizeof(*lock));
#if USE_SCALABLE_LOCKS
lock->slot[0].haslock = TRUE;
@@ -179,7 +179,7 @@ osd_thread *osd_thread_create(osd_thread_callback callback, void *cbparam)
{
osd_thread *thread;
uintptr_t handle;
-
+
thread = (osd_thread *)calloc(1, sizeof(osd_thread));
thread->callback = callback;
thread->param = cbparam;
diff --git a/src/osd/sdl/sdlwork.c b/src/osd/sdl/sdlwork.c
index 7d71141bc48..ce0920cab55 100644
--- a/src/osd/sdl/sdlwork.c
+++ b/src/osd/sdl/sdlwork.c
@@ -114,7 +114,7 @@ struct _osd_work_item
{
osd_work_item * next; // pointer to next item
osd_work_queue * queue; // pointer back to the owning queue
- osd_work_callback callback; // callback function
+ osd_work_callback callback; // callback function
void * param; // callback parameter
void * result; // callback result
osd_event * event; // event signalled when complete
@@ -209,13 +209,13 @@ osd_work_queue *osd_work_queue_alloc(int flags)
// set its priority: I/O threads get high priority because they are assumed to be
// blocked most of the time; other threads just match the creator's priority
if (flags & WORK_QUEUE_FLAG_IO)
- osd_thread_adjust_priority(thread->handle, 1);
+ osd_thread_adjust_priority(thread->handle, 1);
else
- osd_thread_adjust_priority(thread->handle, 0);
+ osd_thread_adjust_priority(thread->handle, 0);
// Bind main thread to cpu 0
osd_thread_cpu_affinity(NULL, effective_cpu_mask(0));
-
+
if (flags & WORK_QUEUE_FLAG_IO)
osd_thread_cpu_affinity(thread->handle, effective_cpu_mask(1));
else
@@ -274,7 +274,7 @@ int osd_work_queue_wait(osd_work_queue *queue, osd_ticks_t timeout)
// spin until we're done
begin_timing(thread->spintime);
-
+
do {
int spin = 10000;
while (--spin && queue->items != 0)
@@ -586,7 +586,7 @@ static int effective_num_processors(void)
static UINT32 effective_cpu_mask(int index)
{
- char *s;
+ char *s;
char buf[5];
UINT32 mask = 0xFFFF;
@@ -659,7 +659,7 @@ static void *worker_thread_entry(void *param)
// spin for a while looking for more work
begin_timing(thread->spintime);
stopspin = osd_ticks() + SPIN_LOOP_TIME;
-
+
do {
int spin = 10000;
while (--spin && queue->list == NULL)
diff --git a/src/osd/sdl/sound.c b/src/osd/sdl/sound.c
index 5296cb18f37..99395100bb2 100644
--- a/src/osd/sdl/sound.c
+++ b/src/osd/sdl/sound.c
@@ -23,13 +23,13 @@
#include "osdsdl.h"
//============================================================
-// DEBUGGING
+// DEBUGGING
//============================================================
#define LOG_SOUND 0
//============================================================
-// PARAMETERS
+// PARAMETERS
//============================================================
// number of samples per SDL callback
@@ -43,10 +43,10 @@ static int stream_loop = 0;
#define MAX_AUDIO_LATENCY 10
//============================================================
-// LOCAL VARIABLES
+// LOCAL VARIABLES
//============================================================
-static int attenuation = 0;
+static int attenuation = 0;
static int initialized_audio = 0;
static int buf_locked;
@@ -69,7 +69,7 @@ static FILE *sound_log;
static int snd_enabled;
//============================================================
-// PROTOTYPES
+// PROTOTYPES
//============================================================
static int sdl_init(running_machine *machine);
@@ -82,7 +82,7 @@ static void sdl_callback(void *userdata, Uint8 *stream, int len);
//============================================================
-// osd_start_audio_stream
+// osd_start_audio_stream
//============================================================
void sdlaudio_init(running_machine *machine)
{
@@ -106,7 +106,7 @@ void sdlaudio_init(running_machine *machine)
//============================================================
-// osd_stop_audio_stream
+// osd_stop_audio_stream
//============================================================
static void sdl_cleanup_audio(running_machine *machine)
@@ -114,11 +114,11 @@ static void sdl_cleanup_audio(running_machine *machine)
// if nothing to do, don't do it
if (machine->sample_rate == 0)
return;
-
+
// kill the buffers and dsound
sdl_kill(machine);
sdl_destroy_buffers();
-
+
// print out over/underflow stats
if (buffer_overflows || buffer_underflows)
mame_printf_verbose("Sound buffer: overflows=%d underflows=%d\n", buffer_overflows, buffer_underflows);
@@ -131,7 +131,7 @@ static void sdl_cleanup_audio(running_machine *machine)
}
//============================================================
-// lock_buffer
+// lock_buffer
//============================================================
static int lock_buffer(long offset, long size, void **buffer1, long *length1, void **buffer2, long *length2)
{
@@ -183,7 +183,7 @@ static int lock_buffer(long offset, long size, void **buffer1, long *length1, vo
}
//============================================================
-// unlock_buffer
+// unlock_buffer
//============================================================
static void unlock_buffer(void)
{
@@ -197,23 +197,23 @@ static void unlock_buffer(void)
}
//============================================================
-// Apply attenuation
+// Apply attenuation
//============================================================
static void att_memcpy(void *dest, INT16 *data, int bytes_to_copy)
-{
+{
int level= (int) (pow(10.0, (float) attenuation / 20.0) * 128.0);
INT16 *d = (INT16 *) dest;
int count = bytes_to_copy/2;
while (count>0)
- {
+ {
*d++ = (*data++ * level) >> 7; /* / 128 */
count--;
}
}
//============================================================
-// copy_sample_data
+// copy_sample_data
//============================================================
static void copy_sample_data(INT16 *data, int bytes_to_copy)
@@ -261,7 +261,7 @@ static void copy_sample_data(INT16 *data, int bytes_to_copy)
//============================================================
-// osd_update_audio_stream
+// osd_update_audio_stream
//============================================================
void osd_update_audio_stream(running_machine *machine, INT16 *buffer, int samples_this_frame)
@@ -272,7 +272,7 @@ void osd_update_audio_stream(running_machine *machine, INT16 *buffer, int sample
int bytes_this_frame = samples_this_frame * sizeof(INT16) * 2;
int play_position, write_position, stream_in;
int orig_write; // used in LOG
-
+
play_position = stream_playpos;
write_position = stream_playpos + ((machine->sample_rate / 50) * sizeof(INT16) * 2);
@@ -328,7 +328,7 @@ void osd_update_audio_stream(running_machine *machine, INT16 *buffer, int sample
{
stream_in -= stream_buffer_size;
stream_loop = 1;
-
+
if (LOG_SOUND)
fprintf(sound_log, "stream_loop set to 1 (stream_in looped)\n");
@@ -343,7 +343,7 @@ void osd_update_audio_stream(running_machine *machine, INT16 *buffer, int sample
//============================================================
-// osd_set_mastervolume
+// osd_set_mastervolume
//============================================================
void osd_set_mastervolume(int _attenuation)
@@ -358,7 +358,7 @@ void osd_set_mastervolume(int _attenuation)
}
//============================================================
-// sdl_callback
+// sdl_callback
//============================================================
static void sdl_callback(void *userdata, Uint8 *stream, int len)
{
@@ -408,7 +408,7 @@ static void sdl_callback(void *userdata, Uint8 *stream, int len)
{
stream_playpos -= stream_buffer_size;
stream_loop = 0;
-
+
if (LOG_SOUND)
fprintf(sound_log, "stream_loop set to 0 (stream_playpos looped)\n");
}
@@ -420,13 +420,13 @@ static void sdl_callback(void *userdata, Uint8 *stream, int len)
//============================================================
-// sdl_init
+// sdl_init
//============================================================
static int sdl_init(running_machine *machine)
{
int n_channels = 2;
int audio_latency;
- SDL_AudioSpec aspec, obtained;
+ SDL_AudioSpec aspec, obtained;
char audio_driver[16] = "";
if (initialized_audio)
@@ -450,7 +450,7 @@ static int sdl_init(running_machine *machine)
// set up the audio specs
aspec.freq = machine->sample_rate;
- aspec.format = AUDIO_S16SYS; // keep endian independant
+ aspec.format = AUDIO_S16SYS; // keep endian independant
aspec.channels = n_channels;
aspec.samples = sdl_xfer_samples;
aspec.callback = sdl_callback;
@@ -503,7 +503,7 @@ cant_start_audio:
//============================================================
-// sdl_kill
+// sdl_kill
//============================================================
static void sdl_kill(running_machine *machine)
@@ -519,7 +519,7 @@ static void sdl_kill(running_machine *machine)
//============================================================
-// dsound_create_buffers
+// dsound_create_buffers
//============================================================
static int sdl_create_buffers(void)
@@ -535,7 +535,7 @@ static int sdl_create_buffers(void)
//============================================================
-// sdl_destroy_buffers
+// sdl_destroy_buffers
//============================================================
static void sdl_destroy_buffers(void)
diff --git a/src/osd/sdl/testkeys.c b/src/osd/sdl/testkeys.c
index 7b75fbd82c4..f757ebb9dbb 100644
--- a/src/osd/sdl/testkeys.c
+++ b/src/osd/sdl/testkeys.c
@@ -22,14 +22,14 @@
// Check whether SDL has compat interface
#if defined(SDL_AllocSurface) || (!SDL_VERSION_ATLEAST(1,3,0))
-#define SDL_HAS_COMPAT 1
+#define SDL_HAS_COMPAT 1
#else
-#define SDL_HAS_COMPAT 0
+#define SDL_HAS_COMPAT 0
#endif
typedef struct _key_lookup_table key_lookup_table;
-struct _key_lookup_table
+struct _key_lookup_table
{
int code;
const char *name;
@@ -38,10 +38,10 @@ struct _key_lookup_table
#if SDL_HAS_COMPAT
#if (SDL_VERSION_ATLEAST(1,3,0))
#define KE(x) { SDL_SCANCODE_ ## x, "SDL_SCANCODE_" #x },
-#define KE8(A, B, C, D, E, F, G, H) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G) KE(H)
+#define KE8(A, B, C, D, E, F, G, H) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G) KE(H)
#define KE7(A, B, C, D, E, F, G) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G)
#define KE5(A, B, C, D, E) KE(A) KE(B) KE(C) KE(D) KE(E)
-#define KE3(A, B, C) KE(A) KE(B) KE(C)
+#define KE3(A, B, C) KE(A) KE(B) KE(C)
static key_lookup_table sdl_lookup[] =
@@ -67,7 +67,7 @@ static key_lookup_table sdl_lookup[] =
};
#else
#define KE(x) { SDLK_ ## x, "SDLK_" #x },
-#define KE8(A, B, C, D, E, F, G, H) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G) KE(H)
+#define KE8(A, B, C, D, E, F, G, H) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G) KE(H)
static key_lookup_table sdl_lookup[] =
{
@@ -101,7 +101,7 @@ static key_lookup_table sdl_lookup[] =
KE8(LCTRL, RALT, LALT, RMETA, LMETA, LSUPER, RSUPER, MODE )
KE8(COMPOSE, HELP, PRINT, SYSREQ, BREAK, MENU, POWER, EURO )
KE(UNDO)
- KE(LAST)
+ KE(LAST)
{-1, ""}
};
#endif
@@ -155,8 +155,8 @@ int main(int argc, char *argv[])
#else
lookup_key_name(sdl_lookup, event.key.keysym.sym),
#endif
- (int) event.key.keysym.scancode,
- (int) event.key.keysym.unicode,
+ (int) event.key.keysym.scancode,
+ (int) event.key.keysym.unicode,
buf);
}
break;
@@ -169,8 +169,8 @@ int main(int argc, char *argv[])
#else
lookup_key_name(sdl_lookup, event.key.keysym.sym),
#endif
- (int) event.key.keysym.scancode,
- (int) event.key.keysym.unicode,
+ (int) event.key.keysym.scancode,
+ (int) event.key.keysym.unicode,
buf);
break;
}
diff --git a/src/osd/sdl/texcopy.c b/src/osd/sdl/texcopy.c
index 16e32687a1d..bcaf0b21dfb 100644
--- a/src/osd/sdl/texcopy.c
+++ b/src/osd/sdl/texcopy.c
@@ -60,7 +60,7 @@ static void init_clamp(void)
for (i=0;i<256;i++)
{
clamp[i + 128] = i;
-
+
coff_cr[i][0] = + 409 * i - 56992;
coff_cr[i][1] = - 208 * i;
coff_cb[i][0] = - 100 * i /* - 208 * cr */ + 34784;
@@ -124,7 +124,7 @@ INLINE UINT32 ycc_to_rgb(unsigned y, unsigned cb, unsigned cr)
#endif
//============================================================
-// MANUAL TEXCOPY FUNCS
+// MANUAL TEXCOPY FUNCS
// (YUY format is weird and doesn't fit the assumptions of the
// standard macros so we handle it here
//============================================================
@@ -155,13 +155,13 @@ static void texcopy_yuv16(texture_info *texture, const render_texinfo *texsource
UINT16 srcpix1 = *src++;
UINT8 cb = srcpix0 & 0xff;
UINT8 cr = srcpix1 & 0xff;
-
+
*dst++ = ycc_to_rgb(srcpix0 >> 8, cb, cr);
*dst++ = ycc_to_rgb(srcpix1 >> 8, cb, cr);
}
-
+
// always fill non-wrapping textures with an extra pixel on the right
- #if 0
+ #if 0
if (texture->borderpix)
*dst++ = 0;
#endif
@@ -175,14 +175,14 @@ static void texcopy_yuv16_paletted(texture_info *texture, const render_texinfo *
UINT32 *dst;
UINT16 *src;
int lookup[256];
-
+
if (clamp[0]>0)
init_clamp();
/* preprocess lookup */
for (x=0; x<256; x++)
lookup[x] = texsource->palette[x] * 298;
-
+
// loop over Y
for (y = 0; y < texsource->height; y++)
{
@@ -200,23 +200,23 @@ static void texcopy_yuv16_paletted(texture_info *texture, const render_texinfo *
UINT16 srcpix1 = *src++;
UINT8 cb = srcpix0 & 0xff;
UINT8 cr = srcpix1 & 0xff;
-
+
#if 0
*dst++ = ycc_to_rgb(texsource->palette[0x000 + (srcpix0 >> 8)], cb, cr);
*dst++ = ycc_to_rgb(texsource->palette[0x000 + (srcpix1 >> 8)], cb, cr);
#else
- int r = (const int) coff_cr[cr][0];
- int g = (const int) coff_cb[cb][0] + (const int) coff_cr[cr][1];
+ int r = (const int) coff_cr[cr][0];
+ int g = (const int) coff_cb[cb][0] + (const int) coff_cr[cr][1];
int b = (const int) coff_cb[cb][1];
int y1 = (const int) lookup[(srcpix0 >> 8)];
int y2 = (const int) lookup[(srcpix1 >> 8)];
-
+
*dst++ = 0xff000000 | (CLSH(r + y1)<<16) | (CLSH(g + y1)<<8) | (CLSH(b + y1));
*dst++ = 0xff000000 | (CLSH(r + y2)<<16) | (CLSH(g + y2)<<8) | (CLSH(b + y2));
#endif
}
-
+
// always fill non-wrapping textures with an extra pixel on the right
#if 0
if (texture->borderpix)
@@ -277,11 +277,11 @@ static void FUNC_NAME(texcopy)(texture_info *texture, const render_texinfo *texs
}
break;
}
-
+
// always fill non-wrapping textures with an extra pixel on the right
if (texture->borderpix)
*dst++ = 0;
-
+
/* abuse x var to act as line counter while copying */
for (x = 1; x < texture->yprescale; x++)
{
diff --git a/src/osd/sdl/video.c b/src/osd/sdl/video.c
index cd89fe955ef..97d360dbb64 100644
--- a/src/osd/sdl/video.c
+++ b/src/osd/sdl/video.c
@@ -179,7 +179,7 @@ void sdlvideo_monitor_refresh(sdl_monitor_info *monitor)
{
#if (SDL_VERSION_ATLEAST(1,3,0))
SDL_DisplayMode dmode;
-
+
SDL_SelectVideoDisplay(monitor->handle);
SDL_GetDesktopDisplayMode(&dmode);
monitor->monitor_width = dmode.w;
@@ -189,7 +189,7 @@ void sdlvideo_monitor_refresh(sdl_monitor_info *monitor)
#else
#if defined(SDLMAME_WIN32) // Win32 version
MONITORINFOEX info;
- info.cbSize = sizeof(info);
+ info.cbSize = sizeof(info);
GetMonitorInfo((HMONITOR)monitor->handle, (LPMONITORINFO)&info);
monitor->center_width = monitor->monitor_width = info.rcMonitor.right - info.rcMonitor.left;
monitor->center_height = monitor->monitor_height = info.rcMonitor.bottom - info.rcMonitor.top;
@@ -212,7 +212,7 @@ void sdlvideo_monitor_refresh(sdl_monitor_info *monitor)
int screen;
SDL_SysWMinfo info;
SDL_VERSION(&info.version);
-
+
if ( SDL_GetWMInfo(&info) && (info.subsystem == SDL_SYSWM_X11) )
{
screen = DefaultScreen(info.info.x11.display);
@@ -225,8 +225,8 @@ void sdlvideo_monitor_refresh(sdl_monitor_info *monitor)
XineramaScreenInfo *xineinfo;
int numscreens;
- xineinfo = XineramaQueryScreens(info.info.x11.display, &numscreens);
-
+ xineinfo = XineramaQueryScreens(info.info.x11.display, &numscreens);
+
monitor->center_width = xineinfo[0].width;
monitor->center_height = xineinfo[0].height;
@@ -238,18 +238,18 @@ void sdlvideo_monitor_refresh(sdl_monitor_info *monitor)
monitor->center_height = monitor->monitor_height;
}
}
- else
+ else
#endif // defined(SDLMAME_X11)
{
static int first_call=0;
static int cw, ch;
-
+
SDL_VideoDriverName(monitor->monitor_device, sizeof(monitor->monitor_device)-1);
- if (first_call==0)
+ if (first_call==0)
{
char *dimstr = getenv(SDLENV_DESKTOPDIM);
const SDL_VideoInfo *sdl_vi;
-
+
sdl_vi = SDL_GetVideoInfo();
#if (SDL_VERSION_ATLEAST(1,2,10))
cw = sdl_vi->current_w;
@@ -277,9 +277,9 @@ void sdlvideo_monitor_refresh(sdl_monitor_info *monitor)
monitor->monitor_height = ch;
monitor->center_width = cw;
monitor->center_height = ch;
- }
+ }
}
- #elif defined(SDLMAME_OS2) // OS2 version
+ #elif defined(SDLMAME_OS2) // OS2 version
monitor->center_width = monitor->monitor_width = WinQuerySysValue( HWND_DESKTOP, SV_CXSCREEN );
monitor->center_height = monitor->monitor_height = WinQuerySysValue( HWND_DESKTOP, SV_CYSCREEN );
strcpy(monitor->monitor_device, "OS/2 display");
@@ -289,7 +289,7 @@ void sdlvideo_monitor_refresh(sdl_monitor_info *monitor)
{
static int info_shown=0;
- if (!info_shown)
+ if (!info_shown)
{
mame_printf_verbose("SDL Device Driver : %s\n", monitor->monitor_device);
mame_printf_verbose("SDL Monitor Dimensions: %d x %d\n", monitor->monitor_width, monitor->monitor_height);
@@ -345,10 +345,10 @@ void osd_update(running_machine *machine, int skip_redraw)
// if we're not skipping this redraw, update all windows
if (!skip_redraw)
{
-// profiler_mark(PROFILER_BLIT);
+// profiler_mark(PROFILER_BLIT);
for (window = sdl_window_list; window != NULL; window = window->next)
sdlwindow_video_window_update(machine, window);
-// profiler_mark(PROFILER_END);
+// profiler_mark(PROFILER_END);
}
// poll the joystick values here
@@ -387,7 +387,7 @@ static void add_primary_monitor(void *data)
// hook us into the list
**tailptr = monitor;
*tailptr = &monitor->next;
-}
+}
#endif
@@ -424,12 +424,12 @@ static BOOL CALLBACK monitor_enum_callback(HMONITOR handle, HDC dc, LPRECT rect,
// guess the aspect ratio assuming square pixels
monitor->aspect = (float)(info.rcMonitor.right - info.rcMonitor.left) / (float)(info.rcMonitor.bottom - info.rcMonitor.top);
-
+
// SDL will crash if monitors are queried here
// This will be done in window.c (Ughh, ugly)
-
+
monitor->modes = NULL;
-
+
// save the primary monitor handle
if (info.dwFlags & MONITORINFOF_PRIMARY)
primary_monitor = monitor;
@@ -466,13 +466,13 @@ static void init_monitors(void)
for (i = 0; i < SDL_GetNumVideoDisplays(); i++)
{
sdl_monitor_info *monitor;
- SDL_DisplayMode dmode;
+ SDL_DisplayMode dmode;
// allocate a new monitor info
monitor = global_alloc_clear(sdl_monitor_info);
snprintf(monitor->monitor_device, sizeof(monitor->monitor_device)-1, "%s%d", SDLOPTION_SCREEN(""),i);
-
+
SDL_SelectVideoDisplay(i);
SDL_GetDesktopDisplayMode(&dmode);
monitor->monitor_width = dmode.w;
@@ -528,7 +528,7 @@ static sdl_monitor_info *pick_monitor(int index)
// look for a match in the name first
if (scrname != NULL)
for (monitor = sdl_monitor_list; monitor != NULL; monitor = monitor->next)
- {
+ {
moncount++;
if (strcmp(scrname, monitor->monitor_device) == 0)
goto finishit;
@@ -584,21 +584,21 @@ static void check_osd_inputs(running_machine *machine)
// check for toggling fullscreen mode
if (ui_input_pressed(machine, IPT_OSD_1))
sdlwindow_toggle_full_screen(machine, window);
-
+
if (ui_input_pressed(machine, IPT_OSD_2))
{
//FIXME: on a per window basis
video_config.fullstretch = !video_config.fullstretch;
ui_popup_time(1, "Uneven stretch %s", video_config.fullstretch? "enabled":"disabled");
}
-
+
if (ui_input_pressed(machine, IPT_OSD_4))
{
//FIXME: on a per window basis
video_config.keepaspect = !video_config.keepaspect;
ui_popup_time(1, "Keepaspect %s", video_config.keepaspect? "enabled":"disabled");
}
-
+
if (USE_OPENGL || SDL_VERSION_ATLEAST(1,3,0))
{
//FIXME: on a per window basis
@@ -672,20 +672,20 @@ static void extract_video_config(running_machine *machine)
video_config.mode = VIDEO_MODE_OPENGL;
else if (USE_OPENGL && (strcmp(stemp, SDLOPTVAL_OPENGL16) == 0))
{
- video_config.mode = VIDEO_MODE_OPENGL;
- video_config.prefer16bpp_tex = 1;
+ video_config.mode = VIDEO_MODE_OPENGL;
+ video_config.prefer16bpp_tex = 1;
}
else if (SDL_VERSION_ATLEAST(1,3,0) && (strcmp(stemp, SDLOPTVAL_SDL13) == 0))
{
- video_config.mode = VIDEO_MODE_SDL13;
- video_config.prefer16bpp_tex = 1;
+ video_config.mode = VIDEO_MODE_SDL13;
+ video_config.prefer16bpp_tex = 1;
}
else
{
mame_printf_warning("Invalid video value %s; reverting to software\n", stemp);
video_config.mode = VIDEO_MODE_SOFT;
}
-
+
video_config.switchres = options_get_bool(mame_options(), SDLOPTION_SWITCHRES);
video_config.centerh = options_get_bool(mame_options(), SDLOPTION_CENTERH);
video_config.centerv = options_get_bool(mame_options(), SDLOPTION_CENTERV);
@@ -715,15 +715,15 @@ static void extract_video_config(running_machine *machine)
{
int i;
static char buffer[20]; // gl_glsl_filter[0..9]?
-
+
video_config.glsl_filter = options_get_int (mame_options(), SDLOPTION_GLSL_FILTER);
-
+
video_config.glsl_shader_mamebm_num=0;
-
+
for(i=0; i<GLSL_SHADER_MAX; i++)
{
snprintf(buffer, 18, SDLOPTION_SHADER_MAME("%d"), i); buffer[17]=0;
-
+
stemp = options_get_string(mame_options(), buffer);
if (stemp && strcmp(stemp, SDLOPTVAL_NONE) != 0 && strlen(stemp)>0)
{
@@ -734,13 +734,13 @@ static void extract_video_config(running_machine *machine)
video_config.glsl_shader_mamebm[i] = NULL;
}
}
-
+
video_config.glsl_shader_scrn_num=0;
-
+
for(i=0; i<GLSL_SHADER_MAX; i++)
{
snprintf(buffer, 20, SDLOPTION_SHADER_SCREEN("%d"), i); buffer[19]=0;
-
+
stemp = options_get_string(mame_options(), buffer);
if (stemp && strcmp(stemp, SDLOPTVAL_NONE) != 0 && strlen(stemp)>0)
{
@@ -751,7 +751,7 @@ static void extract_video_config(running_machine *machine)
video_config.glsl_shader_scrn[i] = NULL;
}
}
-
+
video_config.glsl_vid_attributes = options_get_int (mame_options(), SDLOPTION_GL_GLSL_VID_ATTR);
{
// Disable feature: glsl_vid_attributes, as long we have the gamma calculation
@@ -780,7 +780,7 @@ static void extract_video_config(running_machine *machine)
}
video_config.glsl_vid_attributes = 0;
}
-
+
}
// misc options: sanity check values
@@ -889,7 +889,7 @@ static void get_resolution(const char *name, sdl_window_config *config, int repo
data = defdata;
}
-
+
if (sscanf(data, "%dx%dx%d@%d", &config->width, &config->height, &config->depth, &config->refresh) < 2 && report_error)
mame_printf_error("Illegal resolution value for %s = %s\n", name, data);
}
diff --git a/src/osd/sdl/video.h b/src/osd/sdl/video.h
index b6350c65a34..1e3b7492d42 100644
--- a/src/osd/sdl/video.h
+++ b/src/osd/sdl/video.h
@@ -94,10 +94,10 @@ struct _sdl_video_config
int novideo; // don't draw, for pure CPU benchmarking
// global configuration
- int windowed; // start windowed?
+ int windowed; // start windowed?
int prescale; // prescale factor (not currently supported)
- int keepaspect; // keep aspect ratio?
- int numscreens; // number of screens
+ int keepaspect; // keep aspect ratio?
+ int numscreens; // number of screens
int centerh;
int centerv;
@@ -136,7 +136,7 @@ struct _sdl_video_config
// X11 options
int restrictonemonitor; // in fullscreen, confine to Xinerama monitor 0
- // YUV options
+ // YUV options
int scale_mode;
};
diff --git a/src/osd/sdl/window.c b/src/osd/sdl/window.c
index 8b209f3d7c6..f3da823cb2d 100644
--- a/src/osd/sdl/window.c
+++ b/src/osd/sdl/window.c
@@ -44,16 +44,16 @@
#define WINDOW_DECORATION_HEIGHT (48) // title bar + bottom drag region
#ifdef MAME_DEBUG
-//#define ASSERT_USE(x) do { printf("%x %x\n", (int) SDL_ThreadID(), x); assert_always(SDL_ThreadID() == x, "Wrong Thread"); } while (0)
+//#define ASSERT_USE(x) do { printf("%x %x\n", (int) SDL_ThreadID(), x); assert_always(SDL_ThreadID() == x, "Wrong Thread"); } while (0)
#define ASSERT_USE(x) do { SDL_threadID _thid = SDL_ThreadID(); assert_always( _thid == x, "Wrong Thread"); } while (0)
#else
#define ASSERT_USE(x) do {} while (0)
-//#define ASSERT_USE(x) assert(SDL_ThreadID() == x)
+//#define ASSERT_USE(x) assert(SDL_ThreadID() == x)
#endif
-#define ASSERT_REDRAW_THREAD() ASSERT_USE(window_threadid)
-#define ASSERT_WINDOW_THREAD() ASSERT_USE(window_threadid)
-#define ASSERT_MAIN_THREAD() ASSERT_USE(main_threadid)
+#define ASSERT_REDRAW_THREAD() ASSERT_USE(window_threadid)
+#define ASSERT_WINDOW_THREAD() ASSERT_USE(window_threadid)
+#define ASSERT_MAIN_THREAD() ASSERT_USE(main_threadid)
#define OSDWORK_CALLBACK(name) void *name(void *param, ATTR_UNUSED int threadid)
@@ -151,7 +151,7 @@ INLINE void clear_worker_param(worker_param *wp)
INLINE void execute_async(osd_work_callback callback, worker_param *wp)
{
worker_param *wp_temp = NULL;
-
+
if (wp)
{
wp_temp = (worker_param *) osd_malloc(sizeof(worker_param));
@@ -293,7 +293,7 @@ static OSDWORK_CALLBACK( sdlwindow_exit_wt )
{
if (SDLMAME_INIT_IN_WORKER_THREAD)
SDL_Quit();
-
+
if (param)
osd_free(param);
return NULL;
@@ -313,7 +313,7 @@ static void sdlwindow_exit(running_machine *machine)
sdl_window_list = temp->next;
sdlwindow_video_window_destroy(machine, temp);
}
-
+
// if we're multithreaded, clean up the window thread
if (multithreading_enabled)
{
@@ -366,7 +366,7 @@ void sdlwindow_blit_surface_size(sdl_window_info *window, int window_width, int
desired_aspect = (float)target_width / (float)target_height;
}
- // non-integer scaling - often gives more pleasing results in full screen
+ // non-integer scaling - often gives more pleasing results in full screen
if (!video_config.fullstretch)
{
// compute maximum integral scaling to fit the window
@@ -420,7 +420,7 @@ void sdlwindow_blit_surface_size(sdl_window_info *window, int window_width, int
if ((window->blitwidth != newwidth) || (window->blitheight != newheight))
sdlwindow_clear(window);
-
+
window->blitwidth = newwidth;
window->blitheight = newheight;
}
@@ -437,12 +437,12 @@ static OSDWORK_CALLBACK( sdlwindow_resize_wt )
sdl_window_info * window = wp->window;
ASSERT_WINDOW_THREAD();
-
+
window->destroy_all_textures(window);
window->resize(window, wp->resize_new_width, wp->resize_new_height);
sdlwindow_blit_surface_size(window, wp->resize_new_width, wp->resize_new_height);
-
+
sdlwindow_clear(window);
osd_free(wp);
@@ -457,12 +457,12 @@ void sdlwindow_resize(sdl_window_info *window, INT32 width, INT32 height)
if (width == window->width && height == window->height)
return;
-
+
clear_worker_param(&wp);
wp.resize_new_width = width;
wp.resize_new_height = height;
wp.window = window;
-
+
execute_async_wait(&sdlwindow_resize_wt, &wp);
}
@@ -490,13 +490,13 @@ void sdlwindow_clear(sdl_window_info *window)
clear_worker_param(wp);
wp->window = window;
-
+
if (SDL_ThreadID() == main_threadid)
{
execute_async_wait(&sdlwindow_clear_surface_wt, wp);
osd_free(wp);
}
- else
+ else
sdlwindow_clear_surface_wt( (void *) wp, 0);
}
@@ -528,7 +528,7 @@ static OSDWORK_CALLBACK( sdlwindow_toggle_full_screen_wt )
sdlinput_release_keys(wp->machine);
// toggle the window mode
- window->fullscreen = !window->fullscreen;
+ window->fullscreen = !window->fullscreen;
complete_create_wt(param, 0);
@@ -544,7 +544,7 @@ void sdlwindow_toggle_full_screen(running_machine *machine, sdl_window_info *win
clear_worker_param(&wp);
wp.window = window;
wp.machine = machine;
-
+
execute_async_wait(&sdlwindow_toggle_full_screen_wt, &wp);
}
@@ -574,13 +574,13 @@ void sdlwindow_modify_prescale(running_machine *machine, sdl_window_info *window
new_prescale = window->prescale + 1;
if (dir < 0 && window->prescale > 1)
new_prescale = window->prescale - 1;
-
+
if (new_prescale != window->prescale)
{
if (window->fullscreen && video_config.switchres)
{
execute_async_wait(&sdlwindow_video_window_destroy_wt, &wp);
-
+
window->prescale = new_prescale;
execute_async_wait(&complete_create_wt, &wp);
@@ -717,7 +717,7 @@ int sdlwindow_video_window_create(running_machine *machine, int index, sdl_monit
window->monitor = monitor;
window->machine = machine;
window->index = index;
-
+
//FIXME: these should be per_window in config-> or even better a bit set
window->fullscreen = !video_config.windowed;
window->prescale = video_config.prescale;
@@ -732,14 +732,14 @@ int sdlwindow_video_window_create(running_machine *machine, int index, sdl_monit
window->windowed_width = config->width;
window->windowed_height = config->height;
}
- window->totalColors = config->totalColors;
+ window->totalColors = config->totalColors;
// add us to the list
*last_window_ptr = window;
last_window_ptr = &window->next;
draw.attach(&draw, window);
-
+
// create an event that we can use to skip blitting
window->rendered_event = osd_event_alloc(FALSE, TRUE);
@@ -748,7 +748,7 @@ int sdlwindow_video_window_create(running_machine *machine, int index, sdl_monit
if (window->target == NULL)
goto error;
- // set the specific view
+ // set the specific view
sprintf(option, SDLOPTION_VIEW("%d"), index);
set_starting_view(machine, index, window, options_get_string(mame_options(), option));
@@ -762,13 +762,13 @@ int sdlwindow_video_window_create(running_machine *machine, int index, sdl_monit
if (multithreading_enabled)
{
- osd_work_item *wi;
-
+ osd_work_item *wi;
+
wi = osd_work_item_queue(work_queue, &complete_create_wt, (void *) wp, 0);
sdlwindow_sync();
result = *((int *) (osd_work_item_result)(wi));
osd_work_item_release(wi);
- }
+ }
else
result = *((int *) complete_create_wt((void *) wp, 0));
@@ -801,7 +801,7 @@ static OSDWORK_CALLBACK( sdlwindow_video_window_destroy_wt )
// release all keys ...
sdlinput_release_keys(wp->machine);
-
+
osd_free(wp);
return NULL;
@@ -872,7 +872,7 @@ static void pick_best_mode(sdl_window_info *window, int *fswidth, int *fsheight)
}
num = SDL_GetNumDisplayModes();
-
+
if (num == 0)
{
mame_printf_error("SDL: No modes available?!\n");
@@ -940,15 +940,15 @@ static void pick_best_mode(sdl_window_info *window, int *fswidth, int *fsheight)
#if defined(SDLMAME_WIN32)
/*
- * We need to do this here. If SDL_ListModes is
- * called in init_monitors, the call will crash
- * on win32
- */
+ * We need to do this here. If SDL_ListModes is
+ * called in init_monitors, the call will crash
+ * on win32
+ */
modes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_DOUBLEBUF);
#else
modes = window->monitor->modes;
#endif
-
+
if (modes == (SDL_Rect **)0)
{
mame_printf_error("SDL: No modes available?!\n");
@@ -1002,7 +1002,7 @@ void sdlwindow_video_window_update(running_machine *machine, sdl_window_info *wi
{
ASSERT_MAIN_THREAD();
-
+
// adjust the cursor state
sdlwindow_update_cursor_state(machine, window);
@@ -1010,7 +1010,7 @@ void sdlwindow_video_window_update(running_machine *machine, sdl_window_info *wi
if (window->target != NULL)
{
int tempwidth, tempheight;
-
+
// see if the games video mode has changed
render_target_get_minimum_size(window->target, &tempwidth, &tempheight);
if (tempwidth != window->minwidth || tempheight != window->minheight)
@@ -1029,7 +1029,7 @@ void sdlwindow_video_window_update(running_machine *machine, sdl_window_info *wi
}
}
- // only render if we have been signalled
+ // only render if we have been signalled
if (osd_event_wait(window->rendered_event, 0))
{
worker_param wp;
@@ -1086,7 +1086,7 @@ static OSDWORK_CALLBACK( complete_create_wt )
{
worker_param * wp = (worker_param *) param;
sdl_window_info * window = wp->window;
-
+
int tempwidth, tempheight;
static int result[2] = {0,1};
@@ -1119,9 +1119,9 @@ static OSDWORK_CALLBACK( complete_create_wt )
else
{
/* Create the window directly with the correct aspect
- instead of letting sdlwindow_blit_surface_size() resize it
- this stops the window from "flashing" from the wrong aspect
- size to the right one at startup. */
+ instead of letting sdlwindow_blit_surface_size() resize it
+ this stops the window from "flashing" from the wrong aspect
+ size to the right one at startup. */
tempwidth = (window->maxwidth != 0) ? window->maxwidth : 640;
tempheight = (window->maxheight != 0) ? window->maxheight : 480;
@@ -1155,10 +1155,10 @@ static void measure_fps(sdl_window_info *window, UINT32 dc, int update)
double dt;
double tps;
osd_ticks_t tps_t;
-
+
tps_t = osd_ticks_per_second();
tps = (double) tps_t;
-
+
t0 = osd_ticks();
window->draw(window, dc, update);
@@ -1175,8 +1175,8 @@ static void measure_fps(sdl_window_info *window, UINT32 dc, int update)
mame_printf_info("%6.2lfs, %4lu F, "
"avrg game: %5.2lf FPS %.2lf ms/f, "
"avrg video: %5.2lf FPS %.2lf ms/f, "
- "last video: %5.2lf FPS %.2lf ms/f\n",
- dt, frames-frames_skip4fps,
+ "last video: %5.2lf FPS %.2lf ms/f\n",
+ dt, frames-frames_skip4fps,
(double)(frames-frames_skip4fps)/dt, // avrg game fps
( (currentTime-startTime) / ((frames-frames_skip4fps)) ) * 1000.0 / osd_ticks_per_second(),
(double)(frames-frames_skip4fps)/((double)(sumdt) / tps), // avrg vid fps
@@ -1190,13 +1190,13 @@ static void measure_fps(sdl_window_info *window, UINT32 dc, int update)
static OSDWORK_CALLBACK( draw_video_contents_wt )
{
- UINT32 dc = 0;
- int update = 1;
+ UINT32 dc = 0;
+ int update = 1;
worker_param *wp = (worker_param *) param;
sdl_window_info *window = wp->window;
-
+
ASSERT_REDRAW_THREAD();
-
+
// Some configurations require events to be polled in the worker thread
sdlinput_process_events_buf(wp->machine);
@@ -1211,14 +1211,14 @@ static OSDWORK_CALLBACK( draw_video_contents_wt )
{
if( video_config.perftest )
measure_fps(window, dc, update);
- else
+ else
window->draw(window, dc, update);
}
/* all done, ready for next */
osd_event_set(window->rendered_event);
osd_free(wp);
-
+
return NULL;
}
@@ -1393,7 +1393,7 @@ static void get_max_bounds(sdl_window_info *window, int *window_width, int *wind
maxwidth -= WINDOW_DECORATION_WIDTH;
maxheight -= WINDOW_DECORATION_HEIGHT;
*window_width = maxwidth;
- *window_height = maxheight;
+ *window_height = maxheight;
}
}
diff --git a/src/osd/sdl/window.h b/src/osd/sdl/window.h
index eea5ba4bf4a..96ebc92bc7c 100644
--- a/src/osd/sdl/window.h
+++ b/src/osd/sdl/window.h
@@ -37,10 +37,10 @@ struct _sdl_window_info
{
// Pointer to next window
sdl_window_info * next;
-
+
// Pointer to machine
running_machine * machine;
-
+
// Draw Callbacks
int (*create)(sdl_window_info *window, int width, int height);
void (*resize)(sdl_window_info *window, int width, int height);
@@ -58,7 +58,7 @@ struct _sdl_window_info
sdl_monitor_info * monitor;
int fullscreen;
int index;
-
+
// diverse flags
int minwidth, minheight;
int maxwidth, maxheight;
@@ -86,13 +86,13 @@ struct _sdl_window_info
int totalColors; // total colors from machine/sdl_window_config
int start_viewscreen;
-
+
// per window modes ...
int scale_mode;
-
+
// GL specific
int prescale;
-
+
#if (SDL_VERSION_ATLEAST(1,3,0))
// Needs to be here as well so we can identify window
SDL_WindowID window_id;
diff --git a/src/osd/windows/winmisc.c b/src/osd/windows/winmisc.c
index 90c8dad9e9e..0130b2bf2b3 100644
--- a/src/osd/windows/winmisc.c
+++ b/src/osd/windows/winmisc.c
@@ -78,12 +78,12 @@ void *osd_malloc(size_t size)
#else
// add in space for the base pointer
size += sizeof(size_t);
-
+
// small items just come from the heap
void *result;
if (size < GUARD_PAGE_THRESH)
result = HeapAlloc(GetProcessHeap(), 0, size);
-
+
// large items get guard pages
else
{
@@ -103,7 +103,7 @@ void *osd_malloc(size_t size)
// work backwards from the page base to get to the block base
result = GUARD_ALIGN_START ? page_base : (reinterpret_cast<UINT8 *>(page_base) + rounded_size - size);
}
-
+
// store the page_base at the start
*reinterpret_cast<size_t *>(result) = size;
return reinterpret_cast<UINT8 *>(result) + sizeof(size_t);
@@ -121,11 +121,11 @@ void osd_free(void *ptr)
HeapFree(GetProcessHeap(), 0, ptr);
#else
size_t size = reinterpret_cast<size_t *>(ptr)[-1];
-
+
// small items just get freed
if (size < GUARD_PAGE_THRESH)
HeapFree(GetProcessHeap(), 0, ptr);
-
+
// large items need more care
else
{
diff --git a/src/tools/unidasm.c b/src/tools/unidasm.c
index 77c9fa1f572..93431ada607 100644
--- a/src/tools/unidasm.c
+++ b/src/tools/unidasm.c
@@ -503,7 +503,7 @@ int main(int argc, char *argv[])
}
// run it
- try
+ try
{
curpc = opts.basepc;
for (curbyte = 0; curbyte < length; curbyte += numbytes)
@@ -515,7 +515,7 @@ int main(int argc, char *argv[])
// disassemble
pcdelta = (*opts.dasm->func)(NULL, buffer, curpc, oprom, oprom, opts.mode) & DASMFLAG_LENGTHMASK;
-
+
if (opts.dasm->pcshift < 0)
numbytes = pcdelta << -opts.dasm->pcshift;
else
@@ -629,6 +629,6 @@ int main(int argc, char *argv[])
{
fprintf(stderr, "Caught unhandled exception\n");
}
-
+
return result;
}
diff --git a/src/version.c b/src/version.c
index af1c135da00..0994d17c11d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -10,4 +10,4 @@
***************************************************************************/
extern const char build_version[];
-const char build_version[] = "0.136 ("__DATE__")";
+const char build_version[] = "0.136u1 ("__DATE__")";