mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
Having decided to look at the MAME source again, I have a fairly minor patch:
* Fix build of ldplayer on OS X. Since the CUSTOM sound module no longer exists, I arbitrarily changed it to WAVE, as ar gets upset if it has no input files. I also removed the -all_load flag for ldplayer from the main makefile as it upsets the linker on OS X. * Fix build for PPC64 Linux. (This slightly messes up static branch prediction hints on OS X and AIX, but OS X for PPC64 is dead, and no- one builds MAME for AIX, and it will still build, anyway.) * Paramaterise the arguments to check for NULL in the ATTR_NONNULL macro rather than just checking the first argument. This requires compiler support for C99 variadic macros (MSVC2005 and GCC4 have this AFAIK). Vas
This commit is contained in:
parent
5caef9210c
commit
58d832602b
5
makefile
5
makefile
@ -402,11 +402,6 @@ ifdef MAP
|
||||
LDFLAGSEMULATOR += -Wl,-Map,$(FULLNAME).map
|
||||
endif
|
||||
|
||||
# any reason why this doesn't work for all cases?
|
||||
ifeq ($(TARGETOS),macosx)
|
||||
LDFLAGSEMULATOR += -Xlinker -all_load
|
||||
endif
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------
|
||||
|
@ -299,7 +299,7 @@ _count_leading_ones(UINT32 value)
|
||||
-------------------------------------------------*/
|
||||
|
||||
#define compare_exchange32 _compare_exchange32
|
||||
INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
|
||||
INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
|
||||
_compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange)
|
||||
{
|
||||
register INT32 result;
|
||||
@ -333,7 +333,7 @@ _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange)
|
||||
|
||||
#if defined(__ppc64__) || defined(__PPC64__)
|
||||
#define compare_exchange64 _compare_exchange64
|
||||
INLINE INT64 ATTR_NONNULL ATTR_FORCE_INLINE
|
||||
INLINE INT64 ATTR_NONNULL(1) ATTR_FORCE_INLINE
|
||||
_compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange)
|
||||
{
|
||||
register INT64 result;
|
||||
@ -343,7 +343,7 @@ _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange)
|
||||
" cmpd %[compare], %[result] \n"
|
||||
" bne 2f \n"
|
||||
" stdcx. %[exchange], 0, %[ptr] \n"
|
||||
" bne-- 1b \n"
|
||||
" bne- 1b \n"
|
||||
"2: "
|
||||
: [dummy] "+m" (*ptr) /* Lets GCC know that *ptr will be read/written in case it's not marked volatile */
|
||||
, [result] "=&r" (result)
|
||||
@ -365,7 +365,7 @@ _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange)
|
||||
-------------------------------------------------*/
|
||||
|
||||
#define atomic_exchange32 _atomic_exchange32
|
||||
INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
|
||||
INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
|
||||
_atomic_exchange32(INT32 volatile *ptr, INT32 exchange)
|
||||
{
|
||||
register INT32 result;
|
||||
@ -393,7 +393,7 @@ _atomic_exchange32(INT32 volatile *ptr, INT32 exchange)
|
||||
-------------------------------------------------*/
|
||||
|
||||
#define atomic_add32 _atomic_add32
|
||||
INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
|
||||
INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
|
||||
_atomic_add32(INT32 volatile *ptr, INT32 delta)
|
||||
{
|
||||
register INT32 result;
|
||||
@ -422,7 +422,7 @@ _atomic_add32(INT32 volatile *ptr, INT32 delta)
|
||||
-------------------------------------------------*/
|
||||
|
||||
#define atomic_increment32 _atomic_increment32
|
||||
INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
|
||||
INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
|
||||
_atomic_increment32(INT32 volatile *ptr)
|
||||
{
|
||||
register INT32 result;
|
||||
@ -450,7 +450,7 @@ _atomic_increment32(INT32 volatile *ptr)
|
||||
-------------------------------------------------*/
|
||||
|
||||
#define atomic_decrement32 _atomic_decrement32
|
||||
INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
|
||||
INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
|
||||
_atomic_decrement32(INT32 volatile *ptr)
|
||||
{
|
||||
register INT32 result;
|
||||
|
@ -504,7 +504,7 @@ _count_leading_ones(UINT32 value)
|
||||
-------------------------------------------------*/
|
||||
|
||||
#define compare_exchange32 _compare_exchange32
|
||||
INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
|
||||
INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
|
||||
_compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange)
|
||||
{
|
||||
register INT32 result;
|
||||
@ -531,7 +531,7 @@ _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange)
|
||||
|
||||
#ifdef __x86_64__
|
||||
#define compare_exchange64 _compare_exchange64
|
||||
INLINE INT64 ATTR_NONNULL ATTR_FORCE_INLINE
|
||||
INLINE INT64 ATTR_NONNULL(1) ATTR_FORCE_INLINE
|
||||
_compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange)
|
||||
{
|
||||
register INT64 result;
|
||||
@ -557,7 +557,7 @@ _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange)
|
||||
-------------------------------------------------*/
|
||||
|
||||
#define atomic_exchange32 _atomic_exchange32
|
||||
INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
|
||||
INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
|
||||
_atomic_exchange32(INT32 volatile *ptr, INT32 exchange)
|
||||
{
|
||||
register INT32 result;
|
||||
@ -580,7 +580,7 @@ _atomic_exchange32(INT32 volatile *ptr, INT32 exchange)
|
||||
-------------------------------------------------*/
|
||||
|
||||
#define atomic_add32 _atomic_add32
|
||||
INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
|
||||
INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
|
||||
_atomic_add32(INT32 volatile *ptr, INT32 delta)
|
||||
{
|
||||
register INT32 result = delta;
|
||||
@ -604,7 +604,7 @@ _atomic_add32(INT32 volatile *ptr, INT32 delta)
|
||||
-------------------------------------------------*/
|
||||
|
||||
#define atomic_increment32 _atomic_increment32
|
||||
INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
|
||||
INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
|
||||
_atomic_increment32(INT32 volatile *ptr)
|
||||
{
|
||||
register INT32 result = 1;
|
||||
@ -628,7 +628,7 @@ _atomic_increment32(INT32 volatile *ptr)
|
||||
-------------------------------------------------*/
|
||||
|
||||
#define atomic_decrement32 _atomic_decrement32
|
||||
INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
|
||||
INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
|
||||
_atomic_decrement32(INT32 volatile *ptr)
|
||||
{
|
||||
register INT32 result = -1;
|
||||
|
@ -63,11 +63,11 @@ struct _acia6850_interface
|
||||
|
||||
DEVICE_GET_INFO( acia6850 );
|
||||
|
||||
void acia6850_tx_clock_in(const device_config *device) ATTR_NONNULL;
|
||||
void acia6850_rx_clock_in(const device_config *device) ATTR_NONNULL;
|
||||
void acia6850_tx_clock_in(const device_config *device) ATTR_NONNULL(1);
|
||||
void acia6850_rx_clock_in(const device_config *device) ATTR_NONNULL(1);
|
||||
|
||||
void acia6850_set_rx_clock(const device_config *device, int clock) ATTR_NONNULL;
|
||||
void acia6850_set_tx_clock(const device_config *device, int clock) ATTR_NONNULL;
|
||||
void acia6850_set_rx_clock(const device_config *device, int clock) ATTR_NONNULL(1);
|
||||
void acia6850_set_tx_clock(const device_config *device, int clock) ATTR_NONNULL(1);
|
||||
|
||||
WRITE8_DEVICE_HANDLER( acia6850_ctrl_w );
|
||||
READ8_DEVICE_HANDLER( acia6850_stat_r );
|
||||
|
@ -853,75 +853,75 @@ void address_map_free(address_map *map);
|
||||
/* ----- direct access control ----- */
|
||||
|
||||
/* registers an address range as having a decrypted data pointer */
|
||||
void memory_set_decrypted_region(const address_space *space, offs_t addrstart, offs_t addrend, void *base) ATTR_NONNULL;
|
||||
void memory_set_decrypted_region(const address_space *space, offs_t addrstart, offs_t addrend, void *base) ATTR_NONNULL(1, 4);
|
||||
|
||||
/* register a handler for opcode base changes on a given CPU */
|
||||
direct_update_func memory_set_direct_update_handler(const address_space *space, direct_update_func function) ATTR_NONNULL;
|
||||
direct_update_func memory_set_direct_update_handler(const address_space *space, direct_update_func function) ATTR_NONNULL(1);
|
||||
|
||||
/* called by CPU cores to update the opcode base for the given address */
|
||||
int memory_set_direct_region(const address_space *space, offs_t *byteaddress) ATTR_NONNULL;
|
||||
int memory_set_direct_region(const address_space *space, offs_t *byteaddress) ATTR_NONNULL(1, 2);
|
||||
|
||||
/* return a pointer the memory byte provided in the given address space, or NULL if it is not mapped to a bank */
|
||||
void *memory_get_read_ptr(const address_space *space, offs_t byteaddress) ATTR_NONNULL;
|
||||
void *memory_get_read_ptr(const address_space *space, offs_t byteaddress) ATTR_NONNULL(1);
|
||||
|
||||
/* return a pointer the memory byte provided in the given address space, or NULL if it is not mapped to a writeable bank */
|
||||
void *memory_get_write_ptr(const address_space *space, offs_t byteaddress) ATTR_NONNULL;
|
||||
void *memory_get_write_ptr(const address_space *space, offs_t byteaddress) ATTR_NONNULL(1);
|
||||
|
||||
|
||||
|
||||
/* ----- memory banking ----- */
|
||||
|
||||
/* configure the addresses for a bank */
|
||||
void memory_configure_bank(running_machine *machine, int banknum, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL;
|
||||
void memory_configure_bank(running_machine *machine, int banknum, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(1, 5);
|
||||
|
||||
/* configure the decrypted addresses for a bank */
|
||||
void memory_configure_bank_decrypted(running_machine *machine, int banknum, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL;
|
||||
void memory_configure_bank_decrypted(running_machine *machine, int banknum, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(1, 5);
|
||||
|
||||
/* select one pre-configured entry to be the new bank base */
|
||||
void memory_set_bank(running_machine *machine, int banknum, int entrynum) ATTR_NONNULL;
|
||||
void memory_set_bank(running_machine *machine, int banknum, int entrynum) ATTR_NONNULL(1);
|
||||
|
||||
/* return the currently selected bank */
|
||||
int memory_get_bank(running_machine *machine, int banknum) ATTR_NONNULL;
|
||||
int memory_get_bank(running_machine *machine, int banknum) ATTR_NONNULL(1);
|
||||
|
||||
/* set the absolute address of a bank base */
|
||||
void memory_set_bankptr(running_machine *machine, int banknum, void *base) ATTR_NONNULL;
|
||||
void memory_set_bankptr(running_machine *machine, int banknum, void *base) ATTR_NONNULL(1, 3);
|
||||
|
||||
|
||||
|
||||
/* ----- dynamic address space mapping ----- */
|
||||
|
||||
/* install a new memory handler into the given address space, returning a pointer to the memory backing it, if present */
|
||||
void *_memory_install_handler(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
|
||||
void *_memory_install_handler(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1);
|
||||
|
||||
/* same as above but explicitly for 8-bit handlers */
|
||||
UINT8 *_memory_install_handler8(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_space_func rhandler, write8_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
|
||||
UINT8 *_memory_install_handler8(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_space_func rhandler, write8_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1);
|
||||
|
||||
/* same as above but explicitly for 16-bit handlers */
|
||||
UINT16 *_memory_install_handler16(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_space_func rhandler, write16_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
|
||||
UINT16 *_memory_install_handler16(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_space_func rhandler, write16_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1);
|
||||
|
||||
/* same as above but explicitly for 32-bit handlers */
|
||||
UINT32 *_memory_install_handler32(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_space_func rhandler, write32_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
|
||||
UINT32 *_memory_install_handler32(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_space_func rhandler, write32_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1);
|
||||
|
||||
/* same as above but explicitly for 64-bit handlers */
|
||||
UINT64 *_memory_install_handler64(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_space_func rhandler, write64_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
|
||||
UINT64 *_memory_install_handler64(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_space_func rhandler, write64_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1);
|
||||
|
||||
/* install a new device memory handler into the given address space, returning a pointer to the memory backing it, if present */
|
||||
void *_memory_install_device_handler(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
|
||||
void *_memory_install_device_handler(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1, 2);
|
||||
|
||||
/* same as above but explicitly for 8-bit handlers */
|
||||
UINT8 *_memory_install_device_handler8(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, write8_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
|
||||
UINT8 *_memory_install_device_handler8(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, write8_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1, 2);
|
||||
|
||||
/* same as above but explicitly for 16-bit handlers */
|
||||
UINT16 *_memory_install_device_handler16(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, write16_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
|
||||
UINT16 *_memory_install_device_handler16(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, write16_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1, 2);
|
||||
|
||||
/* same as above but explicitly for 32-bit handlers */
|
||||
UINT32 *_memory_install_device_handler32(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, write32_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
|
||||
UINT32 *_memory_install_device_handler32(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, write32_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1, 2);
|
||||
|
||||
/* same as above but explicitly for 64-bit handlers */
|
||||
UINT64 *_memory_install_device_handler64(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, write64_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
|
||||
UINT64 *_memory_install_device_handler64(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, write64_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1, 2);
|
||||
|
||||
/* install a new input port handler into the given address space */
|
||||
void memory_install_read_port_handler(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, const char *tag) ATTR_NONNULL;
|
||||
void memory_install_read_port_handler(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, const char *tag) ATTR_NONNULL(1, 6);
|
||||
|
||||
|
||||
|
||||
|
@ -3,10 +3,10 @@
|
||||
#ifndef __DAC_H__
|
||||
#define __DAC_H__
|
||||
|
||||
void dac_data_w(const device_config *device, UINT8 data) ATTR_NONNULL;
|
||||
void dac_signed_data_w(const device_config *device, UINT8 data) ATTR_NONNULL;
|
||||
void dac_data_16_w(const device_config *device, UINT16 data) ATTR_NONNULL;
|
||||
void dac_signed_data_16_w(const device_config *device, UINT16 data) ATTR_NONNULL;
|
||||
void dac_data_w(const device_config *device, UINT8 data) ATTR_NONNULL(1);
|
||||
void dac_signed_data_w(const device_config *device, UINT8 data) ATTR_NONNULL(1);
|
||||
void dac_data_16_w(const device_config *device, UINT16 data) ATTR_NONNULL(1);
|
||||
void dac_signed_data_16_w(const device_config *device, UINT16 data) ATTR_NONNULL(1);
|
||||
|
||||
WRITE8_DEVICE_HANDLER( dac_w );
|
||||
WRITE8_DEVICE_HANDLER( dac_signed_w );
|
||||
|
@ -34,7 +34,7 @@ CPUS += Z80
|
||||
# specify required sound cores
|
||||
#-------------------------------------------------
|
||||
|
||||
SOUNDS += CUSTOM
|
||||
SOUNDS += WAVE
|
||||
|
||||
|
||||
#-------------------------------------------------
|
||||
|
@ -49,7 +49,7 @@
|
||||
#define ATTR_PURE __attribute__((pure))
|
||||
#define ATTR_CONST __attribute__((const))
|
||||
#define ATTR_FORCE_INLINE __attribute__((always_inline))
|
||||
#define ATTR_NONNULL __attribute__((nonnull(1)))
|
||||
#define ATTR_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
|
||||
#define UNEXPECTED(exp) __builtin_expect((exp), 0)
|
||||
#define RESTRICT __restrict__
|
||||
#define SETJMP_GNUC_PROTECT() (void)__builtin_return_address(1)
|
||||
@ -64,7 +64,7 @@
|
||||
#define ATTR_PURE
|
||||
#define ATTR_CONST
|
||||
#define ATTR_FORCE_INLINE
|
||||
#define ATTR_NONNULL
|
||||
#define ATTR_NONNULL(...)
|
||||
#define UNEXPECTED(exp) (exp)
|
||||
#define RESTRICT
|
||||
#define SETJMP_GNUC_PROTECT() do {} while (0)
|
||||
|
Loading…
Reference in New Issue
Block a user