File:  [Previous NeXT emulator] / previous / src / cpu / maccess.h
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 19:33:32 2018 UTC (8 years, 3 months ago) by root
Branches: giles, MAIN
CVS tags: branch_softfloat, HEAD
Previous NeXT emulator

 /*
  * UAE - The Un*x Amiga Emulator - CPU core
  *
  * Big endian memory access functions.
  *
  * Copyright 1996 Bernd Schmidt
  *
  * Adaptation to Hatari by Thomas Huth, Eero Tamminen
  *
  * This file is distributed under the GNU Public License, version 2 or at
  * your option any later version. Read the file gpl.txt for details.
  */

#ifndef UAE_MACCESS_H
#define UAE_MACCESS_H

#include <SDL_endian.h>

#if (SDL_BYTE_ORDER == SDL_BIG_ENDIAN)
#define do_get_mem_word(a) (*((uae_u16*)a))
#define do_put_mem_word(a, v) (*((uae_u16*)a)) = v
#define do_get_mem_long(a) (*((uae_u32*)a))
#define do_put_mem_long(a, v) (*((uae_u32*)a)) = v
#else
#define do_get_mem_word(a) __builtin_bswap16(*((uae_u16 *)(a)))
#define do_put_mem_word(a, v) *((uae_u16 *)(a)) = __builtin_bswap16(v) 
#define do_get_mem_long(a) __builtin_bswap32(*((uae_u32 *)(a)))
#define do_put_mem_long(a, v) *((uae_u32 *)(a)) = __builtin_bswap32(v)
#endif

#define do_get_mem_byte(a) (*((uae_u8*)a))
#define do_put_mem_byte(a, v) (*((uae_u8*)a)) = v

#endif /* UAE_MACCESS_H */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.