From: Frode Solheim Date: Fri, 4 Sep 2015 16:59:30 +0000 (-0700) Subject: header guards, include uae/types.h, a few related changes X-Git-Tag: 3200~91^2 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=8c712322cdb22f0c14eef0ffd81ec83f473430b9;p=francis%2Fwinuae.git header guards, include uae/types.h, a few related changes --- diff --git a/bsdsocket.cpp b/bsdsocket.cpp index a86c3e49..0f3282bc 100644 --- a/bsdsocket.cpp +++ b/bsdsocket.cpp @@ -158,7 +158,7 @@ uae_u32 callfdcallback (TrapContext *context, SB, uae_u32 fd, uae_u32 action) return v; } -BOOL checksd(TrapContext *context, SB, int sd) +bool checksd(TrapContext *context, SB, int sd) { int iCounter; SOCKET s; diff --git a/include/a2065.h b/include/a2065.h index a61c0c96..bced619a 100644 --- a/include/a2065.h +++ b/include/a2065.h @@ -1,3 +1,5 @@ +#ifndef UAE_A2065_H +#define UAE_A2065_H #ifdef A2065 @@ -10,3 +12,4 @@ extern void rethink_a2065 (void); #endif +#endif /* UAE_A2065_H */ diff --git a/include/a2091.h b/include/a2091.h index 08401974..f59b488a 100644 --- a/include/a2091.h +++ b/include/a2091.h @@ -1,6 +1,5 @@ - -#ifndef A2091_H -#define A2091_H +#ifndef UAE_A2091_H +#define UAE_A2091_H #ifdef A2091 @@ -147,6 +146,6 @@ extern int add_wd_scsi_hd (struct wd_state *wd, int ch, struct hd_hardfiledata * extern int add_wd_scsi_cd (struct wd_state *wd, int ch, int unitnum); extern int add_wd_scsi_tape (struct wd_state *wd, int ch, const TCHAR *tape_directory, bool readonly); -#endif +#endif /* A2091 */ -#endif /* A2091H */ +#endif /* UAE_A2091_H */ diff --git a/include/akiko.h b/include/akiko.h index a8229245..07c5c9e9 100644 --- a/include/akiko.h +++ b/include/akiko.h @@ -1,4 +1,5 @@ - +#ifndef UAE_AKIKO_H +#define UAE_AKIKO_H #define AKIKO_BASE 0xb80000 #define AKIKO_BASE_END 0xb80100 /* ?? */ @@ -11,3 +12,5 @@ extern void AKIKO_hsync_handler (void); extern void akiko_mute (int); extern void rethink_akiko (void); + +#endif /* UAE_AKIKO_H */ diff --git a/include/amax.h b/include/amax.h index eec6ea8c..0334941c 100644 --- a/include/amax.h +++ b/include/amax.h @@ -1,3 +1,7 @@ +#ifndef UAE_AMAX_H +#define UAE_AMAX_H + +#include "uae/types.h" void amax_diskwrite (uae_u16 w); void amax_bfe001_write (uae_u8 pra, uae_u8 dra); @@ -6,3 +10,5 @@ void amax_disk_select (uae_u8 v, uae_u8 ov, int); void amax_reset (void); void amax_init (void); bool amax_active(void); + +#endif /* UAE_AMAX_H */ diff --git a/include/ar.h b/include/ar.h index b1cb263a..eab7d56c 100644 --- a/include/ar.h +++ b/include/ar.h @@ -1,3 +1,7 @@ +#ifndef UAE_AR_H +#define UAE_AR_H + +#include "uae/types.h" /* disable HRTMon support by commenting this out */ #define ACTION_REPLAY_HRTMON @@ -67,3 +71,5 @@ extern uae_u32 hrtmem_start, hrtmem_size; extern uae_u8 ar_custom[2*256], ar_ciaa[16], ar_ciab[16]; extern int hrtmon_lang; + +#endif /* UAE_AR_H */ diff --git a/include/arcadia.h b/include/arcadia.h index 9225d230..d82a3b20 100644 --- a/include/arcadia.h +++ b/include/arcadia.h @@ -28,6 +28,6 @@ extern int arcadia_flag, arcadia_coin[2]; #define ARCADIA_BIOS 1 #define ARCADIA_GAME 2 -#endif +#endif /* ARCADIA */ -#endif // UAE_ARCADIA_H +#endif /* UAE_ARCADIA_H */ diff --git a/include/audio.h b/include/audio.h index b3c9c50c..dd9ea983 100644 --- a/include/audio.h +++ b/include/audio.h @@ -1,49 +1,53 @@ - /* - * UAE - The Un*x Amiga Emulator - * - * Sound emulation stuff - * - * Copyright 1995, 1996, 1997 Bernd Schmidt - */ +/* + * UAE - The Un*x Amiga Emulator + * + * Sound emulation stuff + * + * Copyright 1995, 1996, 1997 Bernd Schmidt + */ + +#ifndef UAE_AUDIO_H +#define UAE_AUDIO_H + +#include "uae/types.h" #define PERIOD_MAX ULONG_MAX #define MAX_EV ~0u -extern void aud0_handler (void); -extern void aud1_handler (void); -extern void aud2_handler (void); -extern void aud3_handler (void); - -extern void AUDxDAT (int nr, uae_u16 value); -extern void AUDxDAT (int nr, uae_u16 value, uaecptr addr); -extern void AUDxVOL (int nr, uae_u16 value); -extern void AUDxPER (int nr, uae_u16 value); -extern void AUDxLCH (int nr, uae_u16 value); -extern void AUDxLCL (int nr, uae_u16 value); -extern void AUDxLEN (int nr, uae_u16 value); - -extern uae_u16 audio_dmal (void); -extern void audio_state_machine (void); -extern uaecptr audio_getpt (int nr, bool reset); - -extern int init_audio (void); -extern void ahi_install (void); -extern void audio_reset (void); -extern void update_audio (void); -extern void audio_evhandler (void); -extern void audio_hsync (void); -extern void audio_update_adkmasks (void); -extern void update_sound (double clk); -extern void update_cda_sound (double clk); -extern void led_filter_audio (void); -extern void set_audio (void); -extern int audio_activate (void); -extern void audio_deactivate (void); -extern void audio_vsync (void); - -extern void audio_sampleripper(int); +void aud0_handler (void); +void aud1_handler (void); +void aud2_handler (void); +void aud3_handler (void); + +void AUDxDAT (int nr, uae_u16 value); +void AUDxDAT (int nr, uae_u16 value, uaecptr addr); +void AUDxVOL (int nr, uae_u16 value); +void AUDxPER (int nr, uae_u16 value); +void AUDxLCH (int nr, uae_u16 value); +void AUDxLCL (int nr, uae_u16 value); +void AUDxLEN (int nr, uae_u16 value); + +uae_u16 audio_dmal (void); +void audio_state_machine (void); +uaecptr audio_getpt (int nr, bool reset); +int init_audio (void); +void ahi_install (void); +void audio_reset (void); +void update_audio (void); +void audio_evhandler (void); +void audio_hsync (void); +void audio_update_adkmasks (void); +void update_sound (double clk); +void update_cda_sound (double clk); +void led_filter_audio (void); +void set_audio (void); +int audio_activate (void); +void audio_deactivate (void); +void audio_vsync (void); +void audio_sampleripper(int); +void write_wavheader (struct zfile *wavfile, uae_u32 size, uae_u32 freq); + extern int sampleripper_enabled; -extern void write_wavheader (struct zfile *wavfile, uae_u32 size, uae_u32 freq); extern void audio_update_sndboard(unsigned int); extern void audio_enable_sndboard(bool); @@ -65,40 +69,51 @@ extern int sound_paula_volume[2]; #define AUDIO_CHANNEL_CDA_RIGHT 7 enum { - SND_MONO, SND_STEREO, SND_4CH_CLONEDSTEREO, SND_4CH, SND_6CH_CLONEDSTEREO, SND_6CH, SND_NONE }; -STATIC_INLINE int get_audio_stereomode (int channels) + SND_MONO, + SND_STEREO, + SND_4CH_CLONEDSTEREO, + SND_4CH, + SND_6CH_CLONEDSTEREO, + SND_6CH, + SND_NONE +}; + +static inline int get_audio_stereomode (int channels) { - switch (channels) - { + switch (channels) + { case 1: - return SND_MONO; + return SND_MONO; case 2: - return SND_STEREO; + return SND_STEREO; case 4: - return SND_4CH; + return SND_4CH; case 6: - return SND_6CH; - } - return SND_STEREO; + return SND_6CH; + } + return SND_STEREO; } + STATIC_INLINE int get_audio_nativechannels (int stereomode) { - int ch[] = { 1, 2, 4, 4, 6, 6, 0 }; - return ch[stereomode]; + int ch[] = { 1, 2, 4, 4, 6, 6, 0 }; + return ch[stereomode]; } + STATIC_INLINE int get_audio_amigachannels (int stereomode) { - int ch[] = { 1, 2, 2, 4, 2, 4, 0 }; - return ch[stereomode]; + int ch[] = { 1, 2, 2, 4, 2, 4, 0 }; + return ch[stereomode]; } + STATIC_INLINE int get_audio_ismono (int stereomode) { - if (stereomode == 0) - return 1; - return 0; + return stereomode == 0; } - #define SOUND_MAX_DELAY_BUFFER 1024 - #define SOUND_MAX_LOG_DELAY 10 - #define MIXED_STEREO_MAX 16 - #define MIXED_STEREO_SCALE 32 +#define SOUND_MAX_DELAY_BUFFER 1024 +#define SOUND_MAX_LOG_DELAY 10 +#define MIXED_STEREO_MAX 16 +#define MIXED_STEREO_SCALE 32 + +#endif /* UAE_AUDIO_H */ diff --git a/include/autoconf.h b/include/autoconf.h index feae86c8..27e91753 100644 --- a/include/autoconf.h +++ b/include/autoconf.h @@ -6,6 +6,11 @@ * (c) 1996 Ed Hanway */ +#ifndef UAE_AUTOCONF_H +#define UAE_AUTOCONF_H + +#include "uae/types.h" + #define RTAREA_DEFAULT 0xf00000 #define RTAREA_BACKUP 0xef0000 #define RTAREA_BACKUP_2 0xdb0000 @@ -31,6 +36,7 @@ extern uaecptr makedatatable (uaecptr resid, uaecptr resname, uae_u8 type, uae_s extern void align (int); extern volatile int uae_int_requested, uaenet_int_requested; +extern volatile int uaenet_vsync_requested; extern void set_uae_int_flag (void); #define RTS 0x4e75 @@ -102,7 +108,6 @@ extern void uaegfx_install_code (uaecptr); extern uae_u32 emulib_target_getcpurate (uae_u32, uae_u32*); - typedef addrbank*(*DEVICE_INIT)(struct romconfig*); typedef void(*DEVICE_ADD)(int, struct uaedev_config_info*, struct romconfig*); typedef bool(*E8ACCESS)(int, uae_u32*, int, bool); @@ -190,3 +195,5 @@ struct cpuboardtype int defaultsubtype; }; extern const struct cpuboardtype cpuboards[]; + +#endif /* UAE_AUTOCONF_H */ diff --git a/include/blitter.h b/include/blitter.h index c9c80b47..7bb74927 100644 --- a/include/blitter.h +++ b/include/blitter.h @@ -6,6 +6,11 @@ * (c) 1995 Bernd Schmidt */ +#ifndef UAE_BLITTER_H +#define UAE_BLITTER_H + +#include "uae/types.h" + struct bltinfo { int blitzero; int blitashift, blitbshift, blitdownashift, blitdownbshift; @@ -60,3 +65,5 @@ extern uae_u32 blit_masktable[BLITTER_MAX_WORDS]; #define BLIT_MODE_APPROXIMATE 0 #define BLIT_MODE_COMPATIBLE 1 #define BLIT_MODE_EXACT 2 + +#endif /* UAE_BLITTER_H */ diff --git a/include/blkdev.h b/include/blkdev.h index fb1df03a..7a96a005 100644 --- a/include/blkdev.h +++ b/include/blkdev.h @@ -1,6 +1,8 @@ #ifndef UAE_BLKDEV_H #define UAE_BLKDEV_H +#include "uae/types.h" + #define DEVICE_SCSI_BUFSIZE (65536 - 1024) #define SCSI_UNIT_DISABLED -1 diff --git a/include/bsdsocket.h b/include/bsdsocket.h index 27d4c21c..a250fabf 100644 --- a/include/bsdsocket.h +++ b/include/bsdsocket.h @@ -7,6 +7,11 @@ * */ +#ifndef UAE_BSDSOCKET_H +#define UAE_BSDSOCKET_H + +#include "uae/types.h" + #define BSD_TRACING_ENABLED 0 extern int log_bsd; @@ -138,7 +143,6 @@ uae_u32 addmem (uae_u32 * dst, const uae_char *src, int len); extern void bsdsocklib_seterrno (SB, int); extern void bsdsocklib_setherrno (SB, int); -extern void sockmsg (unsigned int, WPARAM, LPARAM); extern void sockabort (SB); extern void addtosigqueue (SB, int); @@ -147,7 +151,7 @@ extern void sigsockettasks (void); extern void locksigqueue (void); extern void unlocksigqueue (void); -extern BOOL checksd(TrapContext*, SB, int sd); +extern bool checksd(TrapContext*, SB, int sd); extern void setsd(TrapContext*, SB, int , SOCKET_TYPE); extern int getsd (TrapContext*, SB, SOCKET_TYPE); extern SOCKET_TYPE getsock (SB, int); @@ -203,3 +207,9 @@ extern uae_u32 callfdcallback (TrapContext *context, SB, uae_u32 fd, uae_u32 act extern uaecptr bsdlib_startup (uaecptr); extern void bsdlib_install (void); extern void bsdlib_reset (void); + +void bsdsock_fake_int_handler(void); + +extern int volatile bsd_int_requested; + +#endif /* UAE_BSDSOCKET_H */ diff --git a/include/calc.h b/include/calc.h index be732348..33ae11a2 100644 --- a/include/calc.h +++ b/include/calc.h @@ -1,3 +1,9 @@ +#ifndef UAE_CALC_H +#define UAE_CALC_H + +#include "uae/types.h" extern bool calc(const TCHAR *input, double *outval); extern bool iscalcformula (const TCHAR *formula); + +#endif /* UAE_CALC_H */ diff --git a/include/catweasel.h b/include/catweasel.h index acee5bd8..62ec613e 100644 --- a/include/catweasel.h +++ b/include/catweasel.h @@ -1,3 +1,5 @@ +#ifndef UAE_CATWEASEL_H +#define UAE_CATWEASEL_H #ifdef CATWEASEL @@ -92,4 +94,6 @@ int catweasel_diskready(catweasel_drive *d); int catweasel_track0(catweasel_drive *d); -#endif +#endif /* CATWEASEL */ + +#endif /* UAE_CATWEASEL_H */ diff --git a/include/cd32_fmv.h b/include/cd32_fmv.h index c54d9a6d..96adc99e 100644 --- a/include/cd32_fmv.h +++ b/include/cd32_fmv.h @@ -1,3 +1,7 @@ +#ifndef UAE_CD32_FMV_H +#define UAE_CD32_FMV_H + +#include "uae/types.h" extern addrbank *cd32_fmv_init (uaecptr); extern void cd32_fmv_reset(void); @@ -13,3 +17,5 @@ extern void cd32_fmv_new_border_color(uae_u32); extern void cd32_fmv_set_sync(double svpos, double adjust); extern int cd32_fmv_active; + +#endif /* UAE_CD32_FMV_H */ diff --git a/include/cdtv.h b/include/cdtv.h index 181d3796..9b90d6f9 100644 --- a/include/cdtv.h +++ b/include/cdtv.h @@ -1,3 +1,7 @@ +#ifndef UAE_CDTV_H +#define UAE_CDTV_H + +#include "uae/types.h" #ifdef CDTV @@ -25,5 +29,6 @@ extern void cdtv_scsi_clear_int (void); extern bool cdtv_front_panel (int); -#endif +#endif /* CDTV */ +#endif /* UAE_CDTV_H */ diff --git a/include/cdtvcr.h b/include/cdtvcr.h index 99f19d84..473ae98f 100644 --- a/include/cdtvcr.h +++ b/include/cdtvcr.h @@ -1,3 +1,5 @@ +#ifndef UAE_CDTVCR_H +#define UAE_CDTVCR_H void cdtvcr_reset(void); void cdtvcr_free(void); @@ -5,3 +7,4 @@ void rethink_cdtvcr(void); extern void CDTVCR_hsync_handler(void); +#endif /* UAE_CDTVCR_H */ diff --git a/include/cia.h b/include/cia.h index 3dae1157..1b4ee43a 100644 --- a/include/cia.h +++ b/include/cia.h @@ -6,6 +6,11 @@ * (c) 1995 Bernd Schmidt */ +#ifndef UAE_CIA_H +#define UAE_CIA_H + +#include "uae/types.h" + extern void CIA_reset (void); extern void CIA_vsync_prehandler (void); extern void CIA_hsync_prehandler (void); @@ -22,6 +27,7 @@ extern void dumpcia (void); extern void rethink_cias (void); extern int resetwarning_do (int); extern void cia_set_overlay (bool); +void cia_heartbeat (void); extern int parallel_direct_write_data (uae_u8, uae_u8); extern int parallel_direct_read_data (uae_u8*); @@ -29,3 +35,5 @@ extern int parallel_direct_write_status (uae_u8, uae_u8); extern int parallel_direct_read_status (uae_u8*); extern void rtc_hardreset (void); + +#endif /* UAE_CIA_H */ diff --git a/include/clipboard.h b/include/clipboard.h index 148bcfe8..00c46d75 100644 --- a/include/clipboard.h +++ b/include/clipboard.h @@ -1,3 +1,7 @@ +#ifndef UAE_CLIPBOARD_H +#define UAE_CLIPBOARD_H + +#include "uae/types.h" extern int amiga_clipboard_want_data (void); extern void amiga_clipboard_got_data (uaecptr data, uae_u32 size, uae_u32 actual); @@ -6,4 +10,6 @@ extern void amiga_clipboard_init (void); extern uaecptr amiga_clipboard_proc_start (void); extern void amiga_clipboard_task_start (uaecptr); extern void clipboard_disable (bool); -extern void clipboard_vsync (void); \ No newline at end of file +extern void clipboard_vsync (void); + +#endif /* UAE_CLIPBOARD_H */ diff --git a/include/commpipe.h b/include/commpipe.h index 9c44f41e..f8bd100f 100644 --- a/include/commpipe.h +++ b/include/commpipe.h @@ -6,6 +6,11 @@ * Copyright 1997, 2001 Bernd Schmidt */ +#ifndef UAE_COMMPIPE_H +#define UAE_COMMPIPE_H + +#include "uae/types.h" + typedef union { int i; uae_u32 u32; @@ -154,3 +159,5 @@ STATIC_INLINE void write_comm_pipe_pvoid (smp_comm_pipe *p, void *data, int no_b foo.pv = data; write_comm_pipe_pt (p, foo, no_buffer); } + +#endif /* UAE_COMMPIPE_H */ diff --git a/include/consolehook.h b/include/consolehook.h index 4a5b2137..05110a8f 100644 --- a/include/consolehook.h +++ b/include/consolehook.h @@ -1,5 +1,11 @@ +#ifndef UAE_CONSOLEHOOK_H +#define UAE_CONSOLEHOOK_H + +#include "uae/types.h" int consolehook_activate (void); void consolehook_ret (uaecptr condev, uaecptr oldbeginio); uaecptr consolehook_beginio (uaecptr request); void consolehook_config (struct uae_prefs *p); + +#endif /* UAE_CONSOLEHOOK_H */ diff --git a/include/cpu_prefetch.h b/include/cpu_prefetch.h index c479346d..acf9e5b1 100644 --- a/include/cpu_prefetch.h +++ b/include/cpu_prefetch.h @@ -1,3 +1,7 @@ +#ifndef UAE_CPU_PREFETCH_H +#define UAE_CPU_PREFETCH_H + +#include "uae/types.h" #ifdef CPUEMU_20 @@ -502,3 +506,5 @@ STATIC_INLINE uae_u32 get_disp_ea_000 (uae_u32 base, uae_u32 dp) regd = (uae_s32)(uae_s16)regd; return base + (uae_s8)dp + regd; } + +#endif /* UAE_CPU_PREFETCH_H */ diff --git a/include/cpuboard.h b/include/cpuboard.h index 5aa0f315..e788612e 100644 --- a/include/cpuboard.h +++ b/include/cpuboard.h @@ -1,3 +1,7 @@ +#ifndef UAE_CPUBOARD_H +#define UAE_CPUBOARD_H + +#include "uae/types.h" extern addrbank *cpuboard_autoconfig_init(struct romconfig*); extern bool cpuboard_maprom(void); @@ -27,6 +31,10 @@ extern uae_u32 cyberstorm_scsi_ram_get(uaecptr addr); extern int REGPARAM3 cyberstorm_scsi_ram_check(uaecptr addr, uae_u32 size) REGPARAM; extern uae_u8 *REGPARAM3 cyberstorm_scsi_ram_xlate(uaecptr addr) REGPARAM; +void cyberstorm_irq(int level); +void cyberstorm_mk3_ppc_irq(int level); +void blizzardppc_irq(int level); + #define BOARD_MEMORY_Z2 1 #define BOARD_MEMORY_Z3 2 #define BOARD_MEMORY_HIGHMEM 3 @@ -80,3 +88,4 @@ extern uae_u8 *REGPARAM3 cyberstorm_scsi_ram_xlate(uaecptr addr) REGPARAM; #define BOARD_IC 11 #define BOARD_IC_ACA500 0 +#endif /* UAE_CPUBOARD_H */ diff --git a/include/cpummu.h b/include/cpummu.h index f5b2274f..79372c50 100644 --- a/include/cpummu.h +++ b/include/cpummu.h @@ -24,8 +24,10 @@ */ -#ifndef CPUMMU_H -#define CPUMMU_H +#ifndef UAE_CPUMMU_H +#define UAE_CPUMMU_H + +#include "uae/types.h" #include "mmu_common.h" @@ -921,4 +923,4 @@ extern void m68k_do_rts_mmu060 (void); extern void m68k_do_rte_mmu060 (uaecptr a7); extern void m68k_do_bsr_mmu060 (uaecptr oldpc, uae_s32 offset); -#endif /* CPUMMU_H */ +#endif /* UAE_CPUMMU_H */ diff --git a/include/cpummu030.h b/include/cpummu030.h index 9eaebd82..63b4927c 100644 --- a/include/cpummu030.h +++ b/include/cpummu030.h @@ -1,5 +1,7 @@ -#ifndef CPUMMU030_H -#define CPUMMU030_H +#ifndef UAE_CPUMMU030_H +#define UAE_CPUMMU030_H + +#include "uae/types.h" #include "mmu_common.h" @@ -470,4 +472,4 @@ extern void m68k_do_rte_mmu030 (uaecptr a7); extern void flush_mmu030 (uaecptr, int); extern void m68k_do_bsr_mmu030 (uaecptr oldpc, uae_s32 offset); -#endif +#endif /* UAE_CPUMMU030_H */ diff --git a/include/crc32.h b/include/crc32.h index 0c8fbf7e..7972fb5f 100644 --- a/include/crc32.h +++ b/include/crc32.h @@ -1,6 +1,13 @@ +#ifndef UAE_CRC32_H +#define UAE_CRC32_H + +#include "uae/types.h" + extern uae_u32 get_crc32 (void *p, int size); extern uae_u16 get_crc16 (void *p, int size); extern uae_u32 get_crc32_val (uae_u8 v, uae_u32 crc); extern void get_sha1 (void *p, int size, void *out); extern const TCHAR *get_sha1_txt (void *p, int size); #define SHA1_SIZE 20 + +#endif /* UAE_CRC32_H */ diff --git a/include/custom.h b/include/custom.h index 960d1636..e876bd47 100644 --- a/include/custom.h +++ b/include/custom.h @@ -6,9 +6,10 @@ * (c) 1995 Bernd Schmidt */ -#ifndef CUSTOM_H -#define CUSTOM_H +#ifndef UAE_CUSTOM_H +#define UAE_CUSTOM_H +#include "uae/types.h" #include "machdep/rpt.h" /* These are the masks that are ORed together in the chipset_mask option. @@ -238,5 +239,6 @@ extern int current_maxvpos (void); extern struct chipset_refresh *get_chipset_refresh (void); extern void compute_framesync (void); extern void getsyncregisters(uae_u16 *phsstrt, uae_u16 *phsstop, uae_u16 *pvsstrt, uae_u16 *pvsstop); +int is_bitplane_dma (int hpos); -#endif /* CUSTOM_H */ +#endif /* UAE_CUSTOM_H */ diff --git a/include/debug.h b/include/debug.h index 6c00de7d..6fdb02f7 100644 --- a/include/debug.h +++ b/include/debug.h @@ -7,6 +7,11 @@ * */ +#ifndef UAE_DEBUG_H +#define UAE_DEBUG_H + +#include "uae/types.h" + #ifdef DEBUGGER #define MAX_HIST 500 @@ -166,4 +171,6 @@ extern void debug_draw_cycles (uae_u8 *buf, int bpp, int line, int width, int he STATIC_INLINE void activate_debugger (void) { }; -#endif +#endif /* DEBUGGER */ + +#endif /* UAE_DEBUG_H */ diff --git a/include/devices.h b/include/devices.h index f9df2154..da849973 100644 --- a/include/devices.h +++ b/include/devices.h @@ -1,3 +1,5 @@ +#ifndef UAE_DEVICES_H +#define UAE_DEVICES_H void devices_reset(int hardreset); void devices_vsync_pre(void); @@ -10,4 +12,6 @@ void devices_update_sync(double svpos, double syncadjust); void reset_all_systems(void); void do_leave_program(void); void virtualdevice_init(void); -void devices_restore_start(void); \ No newline at end of file +void devices_restore_start(void); + +#endif /* UAE_DEVICES_H */ diff --git a/include/disk.h b/include/disk.h index b4c724a2..25227b6e 100644 --- a/include/disk.h +++ b/include/disk.h @@ -6,6 +6,11 @@ * (c) 1995 Bernd Schmidt */ +#ifndef UAE_DISK_H +#define UAE_DISK_H + +#include "uae/types.h" + typedef enum { DRV_NONE = -1, DRV_35_DD = 0, DRV_35_HD, DRV_525_SD, DRV_35_DD_ESCOM, DRV_PC_ONLY_40, DRV_PC_ONLY_80 } drive_type; #define HISTORY_FLOPPY 0 @@ -99,3 +104,4 @@ extern int disk_debug_track; #define MAX_PREVIOUS_IMAGES 50 +#endif /* UAE_DISK_H */ diff --git a/include/diskutil.h b/include/diskutil.h index b390818a..e3b848d0 100644 --- a/include/diskutil.h +++ b/include/diskutil.h @@ -1,3 +1,9 @@ +#ifndef UAE_DISKUTIL_H +#define UAE_DISKUTIL_H + +#include "uae/types.h" int isamigatrack (uae_u16 *amigamfmbuffer, uae_u8 *mfmdata, int len, uae_u8 *writebuffer, uae_u8 *writebuffer_ok, int track, int *outsize); int ispctrack (uae_u16 *amigamfmbuffer, uae_u8 *mfmdata, int len, uae_u8 *writebuffer, uae_u8 *writebuffer_ok, int track, int *outsize); + +#endif /* UAE_DISKUTIL_H */ diff --git a/include/dongle.h b/include/dongle.h index d2f8e4f0..22d425e1 100644 --- a/include/dongle.h +++ b/include/dongle.h @@ -1,3 +1,8 @@ +#ifndef UAE_DONGLE_H +#define UAE_DONGLE_H + +#include "uae/types.h" + extern void dongle_reset (void); extern uae_u8 dongle_cia_read (int, int, uae_u8); extern void dongle_cia_write (int, int, uae_u8); @@ -5,4 +10,6 @@ extern void dongle_joytest (uae_u16); extern uae_u16 dongle_joydat (int, uae_u16); extern void dongle_potgo (uae_u16); extern uae_u16 dongle_potgor (uae_u16); -extern int dongle_analogjoy (int, int); \ No newline at end of file +extern int dongle_analogjoy (int, int); + +#endif /* UAE_DONGLE_H */ diff --git a/include/drawing.h b/include/drawing.h index 3b85af12..cd0a4eca 100644 --- a/include/drawing.h +++ b/include/drawing.h @@ -4,6 +4,11 @@ * Copyright 1996-1998 Bernd Schmidt */ +#ifndef UAE_DRAWING_H +#define UAE_DRAWING_H + +#include "uae/types.h" + #define SMART_UPDATE 1 #ifdef SUPPORT_PENGUINS @@ -289,6 +294,7 @@ extern void set_custom_limits (int w, int h, int dx, int dy); extern void check_custom_limits (void); extern void get_custom_topedge (int *x, int *y, bool max); extern void get_custom_raw_limits (int *pw, int *ph, int *pdx, int *pdy); +void get_custom_mouse_limits (int *pw, int *ph, int *pdx, int *pdy, int dbl); extern void putpixel (uae_u8 *buf, int bpp, int x, xcolnr c8, int opaq); extern void allocvidbuffer (struct vidbuffer *buf, int width, int height, int depth); extern void freevidbuffer (struct vidbuffer *buf); @@ -315,3 +321,5 @@ STATIC_INLINE void toggle_inhibit_frame (int bit) { inhibit_frame ^= 1 << bit; } + +#endif /* UAE_DRAWING_H */ diff --git a/include/driveclick.h b/include/driveclick.h index 9267ea60..33a8171b 100644 --- a/include/driveclick.h +++ b/include/driveclick.h @@ -6,6 +6,10 @@ * Copyright 2004 James Bagg, Toni Wilen */ +#ifndef UAE_DRIVECLICK_H +#define UAE_DRIVECLICK_H + +#include "uae/types.h" #define CLICK_TRACKS 84 @@ -48,4 +52,6 @@ extern void driveclick_fdrawcmd_detect (void); extern void driveclick_fdrawcmd_seek (int, int); extern void driveclick_fdrawcmd_motor (int, int); extern void driveclick_fdrawcmd_vsync (void); -extern int driveclick_pcdrivemask, driveclick_pcdrivenum; \ No newline at end of file +extern int driveclick_pcdrivemask, driveclick_pcdrivenum; + +#endif /* UAE_DRIVECLICK_H */ diff --git a/include/enforcer.h b/include/enforcer.h index 04723a7c..32c50ddb 100644 --- a/include/enforcer.h +++ b/include/enforcer.h @@ -1,9 +1,9 @@ -#ifndef UAE__ENFORCER_H -#define UAE__ENFORCER_H +#ifndef UAE_ENFORCER_H +#define UAE_ENFORCER_H int enforcer_enable(int); int enforcer_disable(void); extern int enforcermode; -#endif \ No newline at end of file +#endif /* UAE_ENFORCER_H */ diff --git a/include/epsonprinter.h b/include/epsonprinter.h index 4a70f61a..a70b6c4d 100644 --- a/include/epsonprinter.h +++ b/include/epsonprinter.h @@ -16,6 +16,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef UAE_EPSONPRINTER_H +#define UAE_EPSONPRINTER_H + #define Bit16u uae_u16 #define Bit16s uae_s16 #define Bit8u uae_u8 @@ -24,11 +27,8 @@ #define Bits uae_s32 #define Bit32u uae_u32 -#if !defined __PRINTER_H -#define __PRINTER_H - #ifndef WINFONT -s#include "ft2build.h" +#include "ft2build.h" #include FT_FREETYPE_H #endif @@ -83,6 +83,4 @@ enum Typeface svjittra = 31 }; - - -#endif +#endif /* UAE_EPSONPRINTER_H */ diff --git a/include/ersatz.h b/include/ersatz.h index 2833e4ba..1569bf60 100644 --- a/include/ersatz.h +++ b/include/ersatz.h @@ -6,7 +6,14 @@ * (c) 1995 Bernd Schmidt */ +#ifndef UAE_ERSATZ_H +#define UAE_ERSATZ_H + +#include "uae/types.h" + extern void init_ersatz_rom (uae_u8 *data); extern void ersatz_chipcopy (void); extern void ersatz_perform (uae_u16); extern void DISK_ersatz_read (int,int, uaecptr); + +#endif /* UAE_ERSATZ_H */ diff --git a/include/events.h b/include/events.h index f63d5450..7257ea5a 100644 --- a/include/events.h +++ b/include/events.h @@ -1,6 +1,3 @@ -#ifndef EVENTS_H -#define EVENTS_H - /* * UAE - The Un*x Amiga Emulator * @@ -12,6 +9,11 @@ * Copyright 1995-1998 Bernd Schmidt */ +#ifndef UAE_EVENTS_H +#define UAE_EVENTS_H + +#include "uae/types.h" + #undef EVENT_DEBUG #include "machdep/rpt.h" @@ -153,5 +155,4 @@ STATIC_INLINE void event2_remevent (int no) eventtab2[no].active = 0; } - -#endif +#endif /* UAE_EVENTS_H */ diff --git a/include/execio.h b/include/execio.h index 6a0465a8..17887041 100644 --- a/include/execio.h +++ b/include/execio.h @@ -1,3 +1,5 @@ +#ifndef UAE_EXECIO_H +#define UAE_EXECIO_H #define IOERR_OPENFAIL -1 #define IOERR_ABORTED -2 @@ -115,3 +117,5 @@ #define NSCMD_TD_WRITE64 0xc001 #define NSCMD_TD_SEEK64 0xc002 #define NSCMD_TD_FORMAT64 0xc003 + +#endif /* UAE_EXECIO_H */ diff --git a/include/execlib.h b/include/execlib.h index c1fe0513..70906626 100644 --- a/include/execlib.h +++ b/include/execlib.h @@ -6,6 +6,9 @@ * Copyright 1996 Bernd Schmidt */ +#ifndef UAE_EXECLIB_H +#define UAE_EXECLIB_H + #define CMD_INVALID 0 #define CMD_RESET 1 #define CMD_READ 2 @@ -45,3 +48,5 @@ #define MEMF_REVERSE (1<<18) #define MEMF_TOTAL (1<<19) #endif + +#endif /* UAE_EXECLIB_H */ diff --git a/include/fdi2raw.h b/include/fdi2raw.h index ad99d84d..0878870d 100644 --- a/include/fdi2raw.h +++ b/include/fdi2raw.h @@ -1,8 +1,8 @@ -#ifndef __FDI2RAW_H -#define __FDI2RAW_H +#ifndef UAE_FDI2RAW_H +#define UAE_FDI2RAW_H + +#include "uae/types.h" -//#include "types.h" -#include typedef struct fdi FDI; #ifdef __cplusplus @@ -25,4 +25,4 @@ extern int fdi2raw_get_write_protect (FDI *); } #endif -#endif +#endif /* UAE_FDI2RAW_H */ diff --git a/include/filesys.h b/include/filesys.h index 31700a6a..1d8e79d6 100644 --- a/include/filesys.h +++ b/include/filesys.h @@ -6,8 +6,10 @@ * Copyright 1997 Bernd Schmidt */ -#ifndef FILESYS_H -#define FILESYS_H +#ifndef UAE_FILESYS_H +#define UAE_FILESYS_H + +#include "uae/types.h" struct hardfilehandle; @@ -156,4 +158,4 @@ extern void getchsgeometry (uae_u64 size, int *pcyl, int *phead, int *psectorspe extern void getchsgeometry_hdf (struct hardfiledata *hfd, uae_u64 size, int *pcyl, int *phead, int *psectorspertrack); extern void getchspgeometry (uae_u64 total, int *pcyl, int *phead, int *psectorspertrack, bool idegeometry); -#endif /* MEMORY_H */ +#endif /* UAE_FILESYS_H */ diff --git a/include/flags_x86.h b/include/flags_x86.h index f3129ea5..3192fbcc 100644 --- a/include/flags_x86.h +++ b/include/flags_x86.h @@ -23,8 +23,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef NATIVE_FLAGS_X86_H -#define NATIVE_FLAGS_X86_H +#ifndef UAE_FLAGS_X86_H +#define UAE_FLAGS_X86_H /* Native integer code conditions */ enum { @@ -44,4 +44,4 @@ enum { NATIVE_CC_LE = 14 }; -#endif /* NATIVE_FLAGS_X86_H */ +#endif /* UAE_FLAGS_X86_H */ diff --git a/include/flashrom.h b/include/flashrom.h index 1b2cb06f..15859538 100644 --- a/include/flashrom.h +++ b/include/flashrom.h @@ -1,3 +1,7 @@ +#ifndef UAE_FLASHROM_H +#define UAE_FLASHROM_H + +#include "uae/types.h" /* FLASH */ @@ -23,4 +27,4 @@ int eeprom_i2c_set(void *i2c, int line, int level); #define FLASHROM_EVERY_OTHER_BYTE_ODD 2 #define FLASHROM_PARALLEL_EEPROM 4 - +#endif /* UAE_FLASHROM_H */ diff --git a/include/fpp-ieee-be.h b/include/fpp-ieee-be.h index 061c7ab2..29f52808 100644 --- a/include/fpp-ieee-be.h +++ b/include/fpp-ieee-be.h @@ -9,6 +9,12 @@ * Copyright 1999 Sam Jordan */ +#ifndef UAE_FPP_IEEE_BE_H +#define UAE_FPP_IEEE_BE_H + +#include "uae/types.h" + + STATIC_INLINE double to_single (uae_u32 value) { union { @@ -62,3 +68,5 @@ STATIC_INLINE void from_double(double src, uae_u32 * wrd1, uae_u32 * wrd2) /* Get the rest of the conversion functions defined. */ #include "fpp-unknown.h" + +#endif /* UAE_FPP_IEEE_BE_H */ diff --git a/include/fpp-unknown.h b/include/fpp-unknown.h index aa991640..05707a99 100644 --- a/include/fpp-unknown.h +++ b/include/fpp-unknown.h @@ -8,6 +8,11 @@ * Copyright 1996 Herman ten Brugge */ +#ifndef UAE_FPP_UNKNOWN_H +#define UAE_FPP_UNKNOWN_H + +#include "uae/types.h" + #ifndef HAVE_to_single STATIC_INLINE double to_single (uae_u32 value) { @@ -137,3 +142,5 @@ STATIC_INLINE void from_double(double src, uae_u32 * wrd1, uae_u32 * wrd2) *wrd2 = (uae_u32) (frac * 9007199254740992.0 - tmp * 4294967296.0); } #endif + +#endif /* UAE_FPP_UNKNOWN_H */ diff --git a/include/fsdb.h b/include/fsdb.h index 55db4e56..7fa086bb 100644 --- a/include/fsdb.h +++ b/include/fsdb.h @@ -7,6 +7,11 @@ * Copyright 1999 Bernd Schmidt */ +#ifndef UAE_FSDB_H +#define UAE_FSDB_H + +#include "uae/types.h" + #ifndef FSDB_FILE #define FSDB_FILE _T("_UAEFSDB.___") #endif @@ -85,9 +90,9 @@ typedef struct a_inode_struct { uae_u32 uniq; /* For a directory that is being ExNext()ed, the number of child ainos which must be kept locked in core. */ - unsigned long locked_children; + unsigned int locked_children; /* How many ExNext()s are going on in this directory? */ - unsigned long exnext_count; + unsigned int exnext_count; /* AmigaOS locking bits. */ int shlock; long db_offset; @@ -192,3 +197,5 @@ extern int custom_fsdb_used_as_nname (a_inode *base, const TCHAR *nname); #define MYVOLUMEINFO_CDFS 16 extern int my_getvolumeinfo (const TCHAR *root); + +#endif /* UAE_FSDB_H */ diff --git a/include/fsusage.h b/include/fsusage.h index 01783bf2..0a11dd04 100644 --- a/include/fsusage.h +++ b/include/fsusage.h @@ -1,19 +1,24 @@ /* fsusage.h -- declarations for filesystem space usage info - Copyright (C) 1991, 1992 Free Software Foundation, Inc. + * Copyright (C) 1991, 1992 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. +#ifndef UAE_FSUSAGE_H +#define UAE_FSUSAGE_H - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "uae/types.h" /* Space usage statistics for a filesystem. Blocks are 512-byte. */ struct fs_usage @@ -26,3 +31,5 @@ struct fs_usage }; int get_fs_usage (const TCHAR *path, const TCHAR *disk, struct fs_usage *fsp); + +#endif /* UAE_FSUSAGE_H */ diff --git a/include/gayle.h b/include/gayle.h index 3cb18f9a..671aed37 100644 --- a/include/gayle.h +++ b/include/gayle.h @@ -1,3 +1,7 @@ +#ifndef UAE_GAYLE_H +#define UAE_GAYLE_H + +#include "uae/types.h" extern void gayle_reset (int); extern void gayle_hsync (void); @@ -17,4 +21,6 @@ extern int gary_timeout; // non-existing memory access = delay #define PCMCIA_COMMON_START 0x600000 #define PCMCIA_COMMON_SIZE 0x400000 -extern void gayle_dataflyer_enable(bool); \ No newline at end of file +extern void gayle_dataflyer_enable(bool); + +#endif /* UAE_GAYLE_H */ diff --git a/include/genblitter.h b/include/genblitter.h index 3b333feb..cb8116da 100644 --- a/include/genblitter.h +++ b/include/genblitter.h @@ -7,9 +7,14 @@ * Copyright 1996 Alessandro Bissacco */ +#ifndef UAE_GENBLITTER_H +#define UAE_GENBLITTER_H + struct blitop { const char *s; int used; }; extern struct blitop blitops[256]; + +#endif /* UAE_GENBLITTER_H */ diff --git a/include/gensound.h b/include/gensound.h index 4be557e2..24c589ae 100644 --- a/include/gensound.h +++ b/include/gensound.h @@ -7,13 +7,15 @@ * Copyright 1997 Bernd Schmidt */ +#ifndef UAE_GENSOUND_H +#define UAE_GENSOUND_H + extern int sound_available; extern void (*sample_handler) (void); /* sample_evtime is in normal Amiga cycles; scaled_sample_evtime is in our event cycles. */ extern float scaled_sample_evtime; -extern float scaled_sample_evtime_orig; /* Determine if we can produce any sound at all. This can be only a guess; * if unsure, say yes. Any call to init_sound may change the value. */ @@ -28,3 +30,4 @@ extern void sample16s_handler (void); extern void sample16ss_handler (void); extern void sample8s_handler (void); +#endif /* UAE_GENSOUND_H */ diff --git a/include/gfxfilter.h b/include/gfxfilter.h index 74d1eebf..914b5178 100644 --- a/include/gfxfilter.h +++ b/include/gfxfilter.h @@ -1,3 +1,7 @@ +#ifndef UAE_GFXFILTER_H +#define UAE_GFXFILTER_H + +#include "uae/types.h" #ifdef GFXFILTER @@ -88,4 +92,7 @@ uae_u8 *getrtgbuffer (int *widthp, int *heightp, int *pitch, int *depth, uae_u8 void freertgbuffer (uae_u8 *dst); extern void getrtgfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height); -#endif + +#endif /* GFXFILTER */ + +#endif /* UAE_GFXFILTER_H */ diff --git a/include/gui.h b/include/gui.h index 890e1584..55aa30a1 100644 --- a/include/gui.h +++ b/include/gui.h @@ -6,6 +6,11 @@ * Copyright 1996 Bernd Schmidt */ +#ifndef UAE_GUI_H +#define UAE_GUI_H + +#include "uae/types.h" + extern int gui_init (void); extern int gui_update (void); extern void gui_exit (void); @@ -73,13 +78,32 @@ extern void gui_update_gfx (void); void notify_user (int msg); void notify_user_parms (int msg, const TCHAR *parms, ...); int translate_message (int msg, TCHAR *out); + typedef enum { - NUMSG_NEEDEXT2, NUMSG_NOROM, NUMSG_NOROMKEY, - NUMSG_KSROMCRCERROR, NUMSG_KSROMREADERROR, NUMSG_NOEXTROM, - NUMSG_MODRIP_NOTFOUND, NUMSG_MODRIP_FINISHED, NUMSG_MODRIP_SAVE, - NUMSG_KS68EC020, NUMSG_KS68020, NUMSG_KS68030, - NUMSG_ROMNEED, NUMSG_EXPROMNEED, NUMSG_NOZLIB, NUMSG_STATEHD, - NUMSG_NOCAPS, NUMSG_OLDCAPS, NUMSG_KICKREP, NUMSG_KICKREPNO, - NUMSG_KS68030PLUS, NUMSG_NO_PPC, NUMSG_UAEBOOTROM_PPC + NUMSG_NEEDEXT2, // 0 + NUMSG_NOROM, + NUMSG_NOROMKEY, + NUMSG_KSROMCRCERROR, + NUMSG_KSROMREADERROR, + NUMSG_NOEXTROM, // 5 + NUMSG_MODRIP_NOTFOUND, + NUMSG_MODRIP_FINISHED, + NUMSG_MODRIP_SAVE, + NUMSG_KS68EC020, + NUMSG_KS68020, // 10 + NUMSG_KS68030, + NUMSG_ROMNEED, + NUMSG_EXPROMNEED, + NUMSG_NOZLIB, + NUMSG_STATEHD, // 15 + NUMSG_NOCAPS, + NUMSG_OLDCAPS, + NUMSG_KICKREP, + NUMSG_KICKREPNO, + NUMSG_KS68030PLUS, // 20 + NUMSG_NO_PPC, + NUMSG_UAEBOOTROM_PPC, + NUMSG_LAST } notify_user_msg; +#endif /* UAE_GUI_H */ diff --git a/include/ide.h b/include/ide.h index a0f2855d..4807b648 100644 --- a/include/ide.h +++ b/include/ide.h @@ -1,3 +1,7 @@ +#ifndef UAE_IDE_H +#define UAE_IDE_H + +#include "uae/types.h" /* IDE drive registers */ #define IDE_DATA 0x00 @@ -130,30 +134,32 @@ uae_u8 *ide_save_state(uae_u8 *dst, struct ide_hdf *ide); uae_u8 *ide_restore_state(uae_u8 *src, struct ide_hdf *ide); #define IDE_MEMORY_FUNCTIONS(x, y, z) \ -static void REGPARAM2 x ## _bput(uaecptr addr, uae_u32 b) \ +void REGPARAM2 x ## _bput(uaecptr addr, uae_u32 b) \ { \ - y ## _write_byte(## z, addr, b); \ + y ## _write_byte(z, addr, b); \ } \ -static void REGPARAM2 x ## _wput(uaecptr addr, uae_u32 b) \ +void REGPARAM2 x ## _wput(uaecptr addr, uae_u32 b) \ { \ - y ## _write_word(## z, addr, b); \ + y ## _write_word(z, addr, b); \ } \ -static void REGPARAM2 x ## _lput(uaecptr addr, uae_u32 b) \ +void REGPARAM2 x ## _lput(uaecptr addr, uae_u32 b) \ { \ - y ## _write_word(## z, addr, b >> 16); \ - y ## _write_word(## z, addr + 2, b); \ + y ## _write_word(z, addr, b >> 16); \ + y ## _write_word(z, addr + 2, b); \ } \ -static uae_u32 REGPARAM2 x ## _bget(uaecptr addr) \ +uae_u32 REGPARAM2 x ## _bget(uaecptr addr) \ { \ -return y ## _read_byte(## z, addr); \ +return y ## _read_byte(z, addr); \ } \ -static uae_u32 REGPARAM2 x ## _wget(uaecptr addr) \ +uae_u32 REGPARAM2 x ## _wget(uaecptr addr) \ { \ -return y ## _read_word(## z, addr); \ +return y ## _read_word(z, addr); \ } \ -static uae_u32 REGPARAM2 x ## _lget(uaecptr addr) \ +uae_u32 REGPARAM2 x ## _lget(uaecptr addr) \ { \ - uae_u32 v = y ## _read_word(## z, addr) << 16; \ - v |= y ## _read_word(## z, addr + 2); \ + uae_u32 v = y ## _read_word(z, addr) << 16; \ + v |= y ## _read_word(z, addr + 2); \ return v; \ } + +#endif /* UAE_IDE_H */ diff --git a/include/idecontrollers.h b/include/idecontrollers.h index 3fe355f4..482577d2 100644 --- a/include/idecontrollers.h +++ b/include/idecontrollers.h @@ -1,3 +1,8 @@ +#ifndef UAE_IDECONTROLLERS_H +#define UAE_IDECONTROLLERS_H + +#include "uae/types.h" + // Other IDE controllers void idecontroller_free(void); @@ -45,3 +50,5 @@ addrbank *x86_at_hd_init_2(struct romconfig *rc); void x86_add_at_hd_unit_2(int ch, struct uaedev_config_info *ci, struct romconfig *rc); addrbank *x86_at_hd_init_xt(struct romconfig *rc); void x86_add_at_hd_unit_xt(int ch, struct uaedev_config_info *ci, struct romconfig *rc); + +#endif /* UAE_IDECONTROLLERS_H */ diff --git a/include/identify.h b/include/identify.h index 27103a5e..ff027706 100644 --- a/include/identify.h +++ b/include/identify.h @@ -5,6 +5,11 @@ * */ +#ifndef UAE_IDENTIFY_H +#define UAE_IDENTIFY_H + +#include "uae/types.h" + struct mem_labels { const TCHAR *name; @@ -32,3 +37,4 @@ extern const struct mem_labels int_labels[]; extern const struct mem_labels trap_labels[]; extern const struct customData custd[]; +#endif /* UAE_IDENTIFY_H */ diff --git a/include/inputdevice.h b/include/inputdevice.h index c88c2de7..071b8d6b 100644 --- a/include/inputdevice.h +++ b/include/inputdevice.h @@ -7,6 +7,11 @@ * Copyright 2001-2002 Toni Wilen */ +#ifndef UAE_INPUTDEVICE_H +#define UAE_INPUTDEVICE_H + +#include "uae/types.h" + #define DIR_LEFT_BIT 0 #define DIR_RIGHT_BIT 1 #define DIR_UP_BIT 2 @@ -88,23 +93,23 @@ struct inputevent { #define ID_FLAG_GAMEPORTSCUSTOM_MASK (ID_FLAG_GAMEPORTSCUSTOM1 | ID_FLAG_GAMEPORTSCUSTOM2) #define ID_FLAG_AUTOFIRE_MASK (ID_FLAG_TOGGLE | ID_FLAG_INVERTTOGGLE | ID_FLAG_AUTOFIRE) -#define ID_FLAG_QUALIFIER1 0x000000100000000 -#define ID_FLAG_QUALIFIER1_R 0x000000200000000 -#define ID_FLAG_QUALIFIER2 0x000000400000000 -#define ID_FLAG_QUALIFIER3 0x000001000000000 -#define ID_FLAG_QUALIFIER4 0x000004000000000 -#define ID_FLAG_QUALIFIER5 0x000010000000000 -#define ID_FLAG_QUALIFIER6 0x000040000000000 -#define ID_FLAG_QUALIFIER7 0x000100000000000 -#define ID_FLAG_QUALIFIER8 0x000400000000000 -#define ID_FLAG_QUALIFIER_SPECIAL 0x001000000000000 -#define ID_FLAG_QUALIFIER_SPECIAL_R 0x002000000000000 -#define ID_FLAG_QUALIFIER_SHIFT 0x004000000000000 -#define ID_FLAG_QUALIFIER_CONTROL 0x010000000000000 -#define ID_FLAG_QUALIFIER_ALT 0x040000000000000 -#define ID_FLAG_QUALIFIER_WIN 0x100000000000000 -#define ID_FLAG_QUALIFIER_MASK 0xfffffff00000000 -#define ID_FLAG_QUALIFIER_MASK_R 0xaaaaaaa00000000 +#define ID_FLAG_QUALIFIER1 0x000000100000000ULL +#define ID_FLAG_QUALIFIER1_R 0x000000200000000ULL +#define ID_FLAG_QUALIFIER2 0x000000400000000ULL +#define ID_FLAG_QUALIFIER3 0x000001000000000ULL +#define ID_FLAG_QUALIFIER4 0x000004000000000ULL +#define ID_FLAG_QUALIFIER5 0x000010000000000ULL +#define ID_FLAG_QUALIFIER6 0x000040000000000ULL +#define ID_FLAG_QUALIFIER7 0x000100000000000ULL +#define ID_FLAG_QUALIFIER8 0x000400000000000ULL +#define ID_FLAG_QUALIFIER_SPECIAL 0x001000000000000ULL +#define ID_FLAG_QUALIFIER_SPECIAL_R 0x002000000000000ULL +#define ID_FLAG_QUALIFIER_SHIFT 0x004000000000000ULL +#define ID_FLAG_QUALIFIER_CONTROL 0x010000000000000ULL +#define ID_FLAG_QUALIFIER_ALT 0x040000000000000ULL +#define ID_FLAG_QUALIFIER_WIN 0x100000000000000ULL +#define ID_FLAG_QUALIFIER_MASK 0xfffffff00000000ULL +#define ID_FLAG_QUALIFIER_MASK_R 0xaaaaaaa00000000ULL #define ID_FLAG_SAVE_MASK_CONFIG 0x000001ff #define ID_FLAG_SAVE_MASK_QUALIFIERS ID_FLAG_QUALIFIER_MASK @@ -126,20 +131,20 @@ struct inputevent { #define IDEV_MAPPED_SET_ONOFF 128 #define IDEV_MAPPED_SET_ONOFF_VAL 256 -#define IDEV_MAPPED_QUALIFIER1 0x000000100000000 -#define IDEV_MAPPED_QUALIFIER2 0x000000400000000 -#define IDEV_MAPPED_QUALIFIER3 0x000001000000000 -#define IDEV_MAPPED_QUALIFIER4 0x000004000000000 -#define IDEV_MAPPED_QUALIFIER5 0x000010000000000 -#define IDEV_MAPPED_QUALIFIER6 0x000040000000000 -#define IDEV_MAPPED_QUALIFIER7 0x000100000000000 -#define IDEV_MAPPED_QUALIFIER8 0x000400000000000 -#define IDEV_MAPPED_QUALIFIER_SPECIAL 0x001000000000000 -#define IDEV_MAPPED_QUALIFIER_SHIFT 0x004000000000000 -#define IDEV_MAPPED_QUALIFIER_CONTROL 0x010000000000000 -#define IDEV_MAPPED_QUALIFIER_ALT 0x040000000000000 -#define IDEV_MAPPED_QUALIFIER_WIN 0x100000000000000 -#define IDEV_MAPPED_QUALIFIER_MASK 0xfffffff00000000 +#define IDEV_MAPPED_QUALIFIER1 0x000000100000000ULL +#define IDEV_MAPPED_QUALIFIER2 0x000000400000000ULL +#define IDEV_MAPPED_QUALIFIER3 0x000001000000000ULL +#define IDEV_MAPPED_QUALIFIER4 0x000004000000000ULL +#define IDEV_MAPPED_QUALIFIER5 0x000010000000000ULL +#define IDEV_MAPPED_QUALIFIER6 0x000040000000000ULL +#define IDEV_MAPPED_QUALIFIER7 0x000100000000000ULL +#define IDEV_MAPPED_QUALIFIER8 0x000400000000000ULL +#define IDEV_MAPPED_QUALIFIER_SPECIAL 0x001000000000000ULL +#define IDEV_MAPPED_QUALIFIER_SHIFT 0x004000000000000ULL +#define IDEV_MAPPED_QUALIFIER_CONTROL 0x010000000000000ULL +#define IDEV_MAPPED_QUALIFIER_ALT 0x040000000000000ULL +#define IDEV_MAPPED_QUALIFIER_WIN 0x100000000000000ULL +#define IDEV_MAPPED_QUALIFIER_MASK 0xfffffff00000000ULL #define SET_ONOFF_ON_VALUE 0x7fffff01 #define SET_ONOFF_OFF_VALUE 0x7fffff00 @@ -195,7 +200,7 @@ extern int input_get_default_keyboard (int num); #define DEFEVENT(A, B, C, D, E, F) INPUTEVENT_ ## A, enum inputevents { INPUTEVENT_ZERO, -#include "inputevents.def" +#include "../inputevents.def" INPUTEVENT_END }; #undef DEFEVENT @@ -337,3 +342,5 @@ extern void inputdevice_settest (int); extern int inputdevice_testread_count (void); extern bool target_can_autoswitchdevice(void); + +#endif /* UAE_INPUTDEVICE_H */ diff --git a/include/inputrecord.h b/include/inputrecord.h index 0a307616..7adf4ec9 100644 --- a/include/inputrecord.h +++ b/include/inputrecord.h @@ -6,6 +6,11 @@ * Copyright 2010 Toni Wilen */ +#ifndef UAE_INPUTRECORD_H +#define UAE_INPUTRECORD_H + +#include "uae/types.h" + extern int inputrecord_debug; //#define INPREC_JOYPORT 1 @@ -53,4 +58,6 @@ extern void inprec_playdebug_cia (uae_u32, uae_u32, uae_u32); extern int inprec_getposition (void); extern void inprec_setposition (int offset, int replaycounter); extern bool inprec_realtime (void); -extern void inprec_getstatus (TCHAR*); \ No newline at end of file +extern void inprec_getstatus (TCHAR*); + +#endif /* UAE_INPUTRECORD_H */ diff --git a/include/isofs_api.h b/include/isofs_api.h index dac30837..843afcdf 100644 --- a/include/isofs_api.h +++ b/include/isofs_api.h @@ -1,3 +1,7 @@ +#ifndef UAE_ISOFS_API_H +#define UAE_ISOFS_API_H + +#include "uae/types.h" struct cd_opendir_s; struct cd_openfile_s; @@ -30,3 +34,5 @@ void isofs_closefile(struct cd_openfile_s*); uae_s64 isofs_lseek(struct cd_openfile_s*, uae_s64, int); uae_s64 isofs_fsize(struct cd_openfile_s*); uae_s64 isofs_read(struct cd_openfile_s*, void*, unsigned int); + +#endif /* UAE_ISOFS_API_H */ diff --git a/include/keyboard.h b/include/keyboard.h index ed8a275c..91b4b67e 100644 --- a/include/keyboard.h +++ b/include/keyboard.h @@ -6,6 +6,9 @@ * (c) 1995 Bernd Schmidt */ +#ifndef UAE_KEYBOARD_H +#define UAE_KEYBOARD_H + /* First, two dummies */ #define AK_mousestuff 0x100 #define AK_inhibit 0x101 @@ -174,4 +177,6 @@ enum aks { AKS_ENTERGUI = 0x200, AKS_SCREENSHOT_FILE, AKS_SCREENSHOT_CLIPBOARD, #define AKS_FIRST AKS_ENTERGUI -extern int target_checkcapslock (int, int *); \ No newline at end of file +extern int target_checkcapslock (int, int *); + +#endif /* UAE_KEYBOARD_H */ diff --git a/include/keybuf.h b/include/keybuf.h index 7f5390f5..436e36ed 100644 --- a/include/keybuf.h +++ b/include/keybuf.h @@ -7,6 +7,9 @@ * (c) 1996 Bernd Schmidt */ +#ifndef UAE_KEYBUF_H +#define UAE_KEYBUF_H + extern int get_next_key (void); extern int keys_available (void); extern int record_key (int); @@ -14,3 +17,5 @@ extern int record_key_direct (int); extern void keybuf_init (void); extern int getcapslockstate (void); extern void setcapslockstate (int); + +#endif /* UAE_KEYBUF_H */ diff --git a/include/luascript.h b/include/luascript.h index 5f0eb13f..ce1572f8 100644 --- a/include/luascript.h +++ b/include/luascript.h @@ -6,8 +6,8 @@ * Copyright 2013 Frode SOlheim */ -#ifndef LUASCRIPT_H_ -#define LUASCRIPT_H_ +#ifndef UAE_LUASCRIPT_H +#define UAE_LUASCRIPT_H #ifdef WITH_LUA #include @@ -21,6 +21,6 @@ void uae_lua_run_handler(const char *name); void uae_lua_aquire_lock(); void uae_lua_release_lock(); -#endif // WITH_LUA +#endif /* WITH_LUA */ -#endif // LUASCRIPT_H_ +#endif /* UAE_LUASCRIPT_H */ diff --git a/include/mackbd.h b/include/mackbd.h index bbd5764c..ce37e6bb 100644 --- a/include/mackbd.h +++ b/include/mackbd.h @@ -6,6 +6,9 @@ * (c) 1996 Ernesto Corvi */ +#ifndef UAE_MACKBD_H +#define UAE_MACKBD_H + #define kUpArrowKeyMap 0x7E /* key map offset for up arrow */ #define kDownArrowKeyMap 0x7D /* key map offset for down arrow */ #define kRightArrowKeyMap 0x7C /* key map offset for right arrow */ @@ -107,3 +110,5 @@ #define kKP7KeyMap 0x59 #define kKP8KeyMap 0x5B #define kKP9KeyMap 0x5C + +#endif /* UAE_MACKBD_H */ diff --git a/include/memory.h b/include/memory.h index 84279b34..713f6680 100644 --- a/include/memory.h +++ b/include/memory.h @@ -6,8 +6,8 @@ * Copyright 1995 Bernd Schmidt */ -#ifndef MEMORY_H -#define MEMORY_H +#ifndef UAE_MEMORY_H +#define UAE_MEMORY_H extern void memory_reset (void); extern void a1000_reset (void); @@ -281,16 +281,28 @@ static uae_u8 *REGPARAM2 name ## _xlate (uaecptr addr) \ #endif #define DECLARE_MEMORY_FUNCTIONS(name) \ - static uae_u32 REGPARAM3 name ## _lget (uaecptr) REGPARAM; \ - static uae_u32 REGPARAM3 name ## _lgeti (uaecptr) REGPARAM; \ - static uae_u32 REGPARAM3 name ## _wget (uaecptr) REGPARAM; \ - static uae_u32 REGPARAM3 name ## _wgeti (uaecptr) REGPARAM; \ - static uae_u32 REGPARAM3 name ## _bget (uaecptr) REGPARAM; \ - static void REGPARAM3 name ## _lput (uaecptr, uae_u32) REGPARAM; \ - static void REGPARAM3 name ## _wput (uaecptr, uae_u32) REGPARAM; \ - static void REGPARAM3 name ## _bput (uaecptr, uae_u32) REGPARAM; \ - static int REGPARAM3 name ## _check (uaecptr addr, uae_u32 size) REGPARAM; \ - static uae_u8 *REGPARAM3 name ## _xlate (uaecptr addr) REGPARAM; +static uae_u32 REGPARAM3 NOWARN_UNUSED(name ## _lget) (uaecptr) REGPARAM; \ +static uae_u32 REGPARAM3 NOWARN_UNUSED(name ## _lgeti) (uaecptr) REGPARAM; \ +static uae_u32 REGPARAM3 NOWARN_UNUSED(name ## _wget) (uaecptr) REGPARAM; \ +static uae_u32 REGPARAM3 NOWARN_UNUSED(name ## _wgeti) (uaecptr) REGPARAM; \ +static uae_u32 REGPARAM3 NOWARN_UNUSED(name ## _bget) (uaecptr) REGPARAM; \ +static void REGPARAM3 NOWARN_UNUSED(name ## _lput) (uaecptr, uae_u32) REGPARAM; \ +static void REGPARAM3 NOWARN_UNUSED(name ## _wput) (uaecptr, uae_u32) REGPARAM; \ +static void REGPARAM3 NOWARN_UNUSED(name ## _bput) (uaecptr, uae_u32) REGPARAM; \ +static int REGPARAM3 NOWARN_UNUSED(name ## _check) (uaecptr addr, uae_u32 size) REGPARAM; \ +static uae_u8 *REGPARAM3 NOWARN_UNUSED(name ## _xlate) (uaecptr addr) REGPARAM; + +#define DECLARE_MEMORY_FUNCTIONS_WITH_SUFFIX(name, suffix) \ +static uae_u32 REGPARAM3 NOWARN_UNUSED(name ## _lget_ ## suffix) (uaecptr) REGPARAM; \ +static uae_u32 REGPARAM3 NOWARN_UNUSED(name ## _lgeti_ ## suffix) (uaecptr) REGPARAM; \ +static uae_u32 REGPARAM3 NOWARN_UNUSED(name ## _wget_ ## suffix) (uaecptr) REGPARAM; \ +static uae_u32 REGPARAM3 NOWARN_UNUSED(name ## _wgeti_ ## suffix) (uaecptr) REGPARAM; \ +static uae_u32 REGPARAM3 NOWARN_UNUSED(name ## _bget_ ## suffix) (uaecptr) REGPARAM; \ +static void REGPARAM3 NOWARN_UNUSED(name ## _lput_ ## suffix) (uaecptr, uae_u32) REGPARAM; \ +static void REGPARAM3 NOWARN_UNUSED(name ## _wput_ ## suffix) (uaecptr, uae_u32) REGPARAM; \ +static void REGPARAM3 NOWARN_UNUSED(name ## _bput_ ## suffix) (uaecptr, uae_u32) REGPARAM; \ +static int REGPARAM3 NOWARN_UNUSED(name ## _check_ ## suffix) (uaecptr addr, uae_u32 size) REGPARAM; \ +static uae_u8 *REGPARAM3 NOWARN_UNUSED(name ## _xlate_ ## suffix) (uaecptr addr) REGPARAM; #define MEMORY_FUNCTIONS(name) \ MEMORY_LGET(name, 0); \ @@ -437,6 +449,9 @@ extern void reload_roms(void); STATIC_INLINE uae_u32 get_long (uaecptr addr) { +#if 0 + printf("get_long %08x -> %08x\n", addr, longget(addr)); +#endif return longget (addr); } STATIC_INLINE uae_u32 get_word (uaecptr addr) @@ -583,6 +598,8 @@ typedef struct shmpiece_reg { extern shmpiece *shm_start; +extern uae_u8* natmem_offset; + #endif extern bool mapped_malloc (addrbank*); @@ -599,7 +616,7 @@ extern void memcpyah_safe (uae_u8 *dst, uaecptr src, int size); extern void memcpyah (uae_u8 *dst, uaecptr src, int size); extern uae_s32 getz2size (struct uae_prefs *p); -extern ULONG getz2endaddr (void); +uae_u32 getz2endaddr (void); #define UAE_MEMORY_REGIONS_MAX 64 #define UAE_MEMORY_REGION_NAME_LENGTH 64 @@ -612,7 +629,7 @@ extern ULONG getz2endaddr (void); typedef struct UaeMemoryRegion { uaecptr start; - int size; + uae_u32 size; TCHAR name[UAE_MEMORY_REGION_NAME_LENGTH]; TCHAR rom_name[UAE_MEMORY_REGION_NAME_LENGTH]; uaecptr alias; @@ -627,4 +644,4 @@ typedef struct UaeMemoryMap { void uae_memory_map(UaeMemoryMap *map); -#endif /* MEMORY_H */ +#endif /* UAE_MEMORY_H */ diff --git a/include/mmu_common.h b/include/mmu_common.h index 6f061d2d..d3caf6e5 100644 --- a/include/mmu_common.h +++ b/include/mmu_common.h @@ -1,16 +1,13 @@ +#ifndef UAE_MMU_COMMON_H +#define UAE_MMU_COMMON_H -#ifndef MMU_COMMON_H -#define MMU_COMMON_H +#include "uae/types.h" +#include "uae/likely.h" #define MMUDEBUG 0 #define MMUINSDEBUG 0 #define MMUDEBUGMISC 0 -#ifdef _MSC_VER -#define unlikely(x) x -#define likely(x) x -#endif - #ifdef __cplusplus struct m68k_exception { int prb; @@ -156,4 +153,4 @@ extern void(*x_phys_put_byte)(uaecptr, uae_u32); extern void(*x_phys_put_word)(uaecptr, uae_u32); extern void(*x_phys_put_long)(uaecptr, uae_u32); -#endif +#endif /* UAE_MMU_COMMON_H */ diff --git a/include/moduleripper.h b/include/moduleripper.h index 5dd3830a..6e345723 100644 --- a/include/moduleripper.h +++ b/include/moduleripper.h @@ -1,3 +1,7 @@ +#ifndef UAE_MODULERIPPER_H +#define UAE_MODULERIPPER_H extern "C" int prowizard_search (unsigned char *in_data, int in_size); extern void moduleripper (void); + +#endif /* UAE_MODULERIPPER_H */ diff --git a/include/native2amiga.h b/include/native2amiga.h index a4b7eb63..7a3bafe1 100644 --- a/include/native2amiga.h +++ b/include/native2amiga.h @@ -10,8 +10,11 @@ * and some of it needs thread support. */ -#include "native2amiga_api.h" +#ifndef UAE_NATIVE2AMIGA_H +#define UAE_NATIVE2AMIGA_H +#include "uae/types.h" +#include "native2amiga_api.h" #include "traps.h" /* @@ -52,3 +55,5 @@ STATIC_INLINE void do_uae_int_requested (void) uae_int_requested |= 1; set_uae_int_flag (); } + +#endif /* UAE_NATIVE2AMIGA_H */ diff --git a/include/native2amiga_api.h b/include/native2amiga_api.h index ffa8ba12..df2ea8b4 100644 --- a/include/native2amiga_api.h +++ b/include/native2amiga_api.h @@ -3,6 +3,12 @@ * Amiga counterpart, but can be called in situation where calling * the exec.library functions is impossible. */ + +#ifndef UAE_NATIVE2AMIGA_API_H +#define UAE_NATIVE2AMIGA_API_H + +#include "uae/types.h" + #ifdef SUPPORT_THREADS void uae_Cause(uaecptr interrupt); void uae_ReplyMsg(uaecptr msg); @@ -11,4 +17,6 @@ void uae_Signal(uaecptr task, uae_u32 mask); void uae_NotificationHack(uaecptr, uaecptr); #endif void uae_NewList(uaecptr list); -int native2amiga_isfree (void); \ No newline at end of file +int native2amiga_isfree (void); + +#endif /* UAE_NATIVE2AMIGA_API_H */ diff --git a/include/ncr9x_scsi.h b/include/ncr9x_scsi.h index 95b023ea..c38ea88d 100644 --- a/include/ncr9x_scsi.h +++ b/include/ncr9x_scsi.h @@ -1,4 +1,7 @@ +#ifndef UAE_NCR9X_SCSI_H +#define UAE_NCR9X_SCSI_H +#include "uae/types.h" extern void ncr9x_init(void); extern void ncr9x_free(void); @@ -40,3 +43,4 @@ void ncr_masoboshi_autoconfig_init(struct romconfig*, uaecptr); #define CYBERSTORM_MK1_DMA_OFFSET 0xf800 #define CYBERSTORM_MK1_JUMPER_OFFSET 0xfc02 +#endif /* UAE_NCR9X_SCSI_H */ diff --git a/include/ncr_scsi.h b/include/ncr_scsi.h index 02ff459f..33f7a051 100644 --- a/include/ncr_scsi.h +++ b/include/ncr_scsi.h @@ -1,3 +1,7 @@ +#ifndef UAE_NCR_SCSI_H +#define UAE_NCR_SCSI_H + +#include "uae/types.h" void ncr710_io_bput_a4000t(uaecptr, uae_u32); uae_u32 ncr710_io_bget_a4000t(uaecptr); @@ -28,3 +32,4 @@ extern void blizzardppc_add_scsi_unit(int ch, struct uaedev_config_info *ci, str extern void a4091_add_scsi_unit(int ch, struct uaedev_config_info *ci, struct romconfig *rc); extern void wildfire_add_scsi_unit(int ch, struct uaedev_config_info *ci, struct romconfig *rc); +#endif /* UAE_NCR_SCSI_H */ diff --git a/include/newcpu.h b/include/newcpu.h index 1b1eb3bc..37adf067 100644 --- a/include/newcpu.h +++ b/include/newcpu.h @@ -6,10 +6,13 @@ * Copyright 1995 Bernd Schmidt */ +#ifndef UAE_NEWCPU_H +#define UAE_NEWCPU_H + +#include "uae/types.h" #include "readcpu.h" #include "machdep/m68k.h" #include "events.h" - #ifdef WITH_SOFTFLOAT #include #endif @@ -650,11 +653,11 @@ extern cpuop_func *cpufunctbl[65536] ASM_SYM_FOR_FUNC ("cpufunctbl"); extern void flush_icache(uaecptr, int); extern void flush_icache_hard(uaecptr, int); extern void compemu_reset(void); -extern bool check_prefs_changed_comp (void); #else #define flush_icache(uaecptr, int) do {} while (0) #define flush_icache_hard(uaecptr, int) do {} while (0) #endif +bool check_prefs_changed_comp (void); extern void flush_dcache (uaecptr, int); extern void flush_mmu (uaecptr, int); @@ -686,3 +689,5 @@ void cpu_semaphore_get(void); void cpu_semaphore_release(void); bool execute_other_cpu(int until); void execute_other_cpu_single(void); + +#endif /* UAE_NEWCPU_H */ diff --git a/include/options.h b/include/options.h index 5065be9c..2c78af73 100644 --- a/include/options.h +++ b/include/options.h @@ -10,6 +10,8 @@ #ifndef UAE_OPTIONS_H #define UAE_OPTIONS_H +#include "uae/types.h" + #define UAEMAJOR 3 #define UAEMINOR 2 #define UAESUBREV 0 @@ -676,7 +678,7 @@ struct uae_prefs { bool win32_filesystem_mangle_reserved_names; bool right_control_is_right_win_key; #ifdef WITH_SLIRP - struct slirp_redir slirp_redirs[MAX_SLIRP_REDIRS]; + struct slirp_redir slirp_redirs[MAX_SLIRP_REDIRS]; #endif int statecapturerate, statecapturebuffersize; diff --git a/include/osemu.h b/include/osemu.h index 4295f55c..2821691e 100644 --- a/include/osemu.h +++ b/include/osemu.h @@ -6,6 +6,11 @@ * Copyright 1996 Bernd Schmidt */ +#ifndef UAE_OSEMU_H +#define UAE_OSEMU_H + +#include "uae/types.h" + STATIC_INLINE char *raddr(uaecptr p) { return p == 0 ? NULL : (char *)get_real_address (p); @@ -17,3 +22,4 @@ extern void gfxlib_install(void); extern int GFX_WritePixel(uaecptr rp, int x, int y); +#endif /* UAE_OSEMU_H */ diff --git a/include/packed.h b/include/packed.h index 0ac0fd64..ac2af01d 100644 --- a/include/packed.h +++ b/include/packed.h @@ -1,5 +1,2 @@ -#ifdef _MSC_VER #define PACKED #pragma pack(push,1) -#endif - diff --git a/include/parallel.h b/include/parallel.h index 70d30197..7ebbb102 100644 --- a/include/parallel.h +++ b/include/parallel.h @@ -1,7 +1,13 @@ +#ifndef UAE_PARALLEL_H +#define UAE_PARALLEL_H + +#include "uae/types.h" extern int isprinter (void); extern void doprinter (uae_u8); extern void flushprinter (void); extern void closeprinter (void); extern int isprinteropen (void); -extern void initparallel (void); \ No newline at end of file +extern void initparallel (void); + +#endif /* UAE_PARALLEL_H */ diff --git a/include/pci.h b/include/pci.h index 63f0e6a6..6b8d86fa 100644 --- a/include/pci.h +++ b/include/pci.h @@ -1,3 +1,5 @@ +#ifndef UAE_PCI_H +#define UAE_PCI_H extern void pci_free(void); extern void pci_reset(void); @@ -11,3 +13,5 @@ extern addrbank *cbvision_init(struct romconfig *rc);; extern addrbank *grex_init(struct romconfig *rc); extern addrbank *mediator_init(struct romconfig *rc); extern addrbank *mediator_init2(struct romconfig *rc); + +#endif /* UAE_PCI_H */ diff --git a/include/pci_hw.h b/include/pci_hw.h index cefb693a..508db125 100644 --- a/include/pci_hw.h +++ b/include/pci_hw.h @@ -1,4 +1,7 @@ +#ifndef UAE_PCI_HW_H +#define UAE_PCI_HW_H +#include "uae/types.h" #define MAX_PCI_BOARDS 6 #define MAX_PCI_BARS 7 @@ -120,3 +123,5 @@ extern const struct pci_board es1370_pci_board; extern const struct pci_board fm801_pci_board; extern const struct pci_board fm801_pci_board_func1; extern const struct pci_board solo1_pci_board; + +#endif /* UAE_PCI_HW_H */ diff --git a/include/picasso96.h b/include/picasso96.h index 0d6930af..b573624d 100644 --- a/include/picasso96.h +++ b/include/picasso96.h @@ -1,3 +1,11 @@ +#ifndef UAE_PICASSO96_H +#define UAE_PICASSO96_H + +#include "uae/types.h" +#include "traps.h" + +void picasso96_alloc (TrapContext* ctx); +uae_u32 picasso_demux (uae_u32 arg, TrapContext *ctx); #ifdef WIN32 @@ -585,3 +593,5 @@ extern int p96refresh_active; #endif #endif + +#endif /* UAE_PICASSO96_H */ diff --git a/include/readcpu.h b/include/readcpu.h index 02043fad..d1bf8011 100644 --- a/include/readcpu.h +++ b/include/readcpu.h @@ -1,5 +1,7 @@ -#ifndef READCPU_H -#define READCPU_H +#ifndef UAE_READCPU_H +#define UAE_READCPU_H + +#include "uae/types.h" ENUMDECL { Dreg, Areg, Aind, Aipi, Apdi, Ad16, Ad8r, @@ -114,4 +116,4 @@ extern void do_merges (void); extern int get_no_mismatches (void); extern int nr_cpuop_funcs; -#endif /* READCPU_H */ \ No newline at end of file +#endif /* UAE_READCPU_H */ diff --git a/include/rtgmodes.h b/include/rtgmodes.h index 41818fbf..4ca2f62f 100644 --- a/include/rtgmodes.h +++ b/include/rtgmodes.h @@ -1,3 +1,6 @@ +#ifndef UAE_RTGMODES_H +#define UAE_RTGMODES_H + /* Types for RGBFormat used */ typedef enum { RGBFB_NONE, /* no valid RGB format (should not happen) */ @@ -63,3 +66,5 @@ typedef enum { #define RGBFB_PLANAR RGBFB_NONE #define RGBFB_CHUNKY RGBFB_CLUT + +#endif /* UAE_RTGMODES_H */ diff --git a/include/sampler.h b/include/sampler.h index 471ecb1b..39bc5dca 100644 --- a/include/sampler.h +++ b/include/sampler.h @@ -1,6 +1,11 @@ +#ifndef UAE_SAMPLER_H +#define UAE_SAMPLER_H + +#include "uae/types.h" extern uae_u8 sampler_getsample (int); extern int sampler_init (void); extern void sampler_free (void); extern void sampler_vsync (void); +#endif /* UAE_SAMPLER_H */ diff --git a/include/sana2.h b/include/sana2.h index db4691d0..b5bb7bed 100644 --- a/include/sana2.h +++ b/include/sana2.h @@ -6,6 +6,11 @@ * (c) 2007 Toni Wilen */ +#ifndef UAE_SANA2_H +#define UAE_SANA2_H + +#include "uae/types.h" + #define MAX_TOTAL_NET_DEVICES 10 uaecptr netdev_startup (uaecptr resaddr); @@ -14,3 +19,5 @@ void netdev_reset (void); void netdev_start_threads (void); extern int log_net; + +#endif /* UAE_SANA2_H */ diff --git a/include/savestate.h b/include/savestate.h index af628a3a..83e37562 100644 --- a/include/savestate.h +++ b/include/savestate.h @@ -6,6 +6,10 @@ * (c) 1999-2001 Toni Wilen */ +#ifndef UAE_SAVESTATE_H +#define UAE_SAVESTATE_H + +#include "uae/types.h" /* functions to save byte,word or long word * independent of CPU's endianess */ @@ -248,3 +252,5 @@ extern int savestate_dorewind (int); extern void savestate_listrewind (void); extern void statefile_save_recording (const TCHAR*); extern void savestate_capture_request (void); + +#endif /* UAE_SAVESTATE_H */ diff --git a/include/scp.h b/include/scp.h index 1f73cdce..574420f4 100644 --- a/include/scp.h +++ b/include/scp.h @@ -1,3 +1,8 @@ +#ifndef UAE_SCP_H +#define UAE_SCP_H + +#include "uae/types.h" + int scp_open(struct zfile *zf, int drv, int *num_tracks); void scp_close(int drv); int scp_loadtrack( @@ -7,3 +12,5 @@ int scp_loadtrack( void scp_loadrevolution( uae_u16 *mfmbuf, int drv, uae_u16 *tracktiming, int *tracklength); + +#endif /* UAE_SCP_H */ diff --git a/include/scsi.h b/include/scsi.h index b9665c89..d7f28e1c 100644 --- a/include/scsi.h +++ b/include/scsi.h @@ -1,3 +1,7 @@ +#ifndef UAE_SCSI_H +#define UAE_SCSI_H + +#include "uae/types.h" #define SCSI_DEFAULT_DATA_BUFFER_SIZE (256 * 512) @@ -126,27 +130,27 @@ void scsi_addnative(struct scsi_data **sd); #define SCSI_MEMORY_FUNCTIONS(x, y, z) \ static void REGPARAM2 x ## _bput(uaecptr addr, uae_u32 b) \ { \ - y ## _bput(& ## z, addr, b); \ + y ## _bput(&z, addr, b); \ } \ static void REGPARAM2 x ## _wput(uaecptr addr, uae_u32 b) \ { \ - y ## _wput(& ## z, addr, b); \ + y ## _wput(&z, addr, b); \ } \ static void REGPARAM2 x ## _lput(uaecptr addr, uae_u32 b) \ { \ - y ## _lput(& ## z, addr, b); \ + y ## _lput(&z, addr, b); \ } \ static uae_u32 REGPARAM2 x ## _bget(uaecptr addr) \ { \ -return y ## _bget(& ## z, addr); \ +return y ## _bget(&z, addr); \ } \ static uae_u32 REGPARAM2 x ## _wget(uaecptr addr) \ { \ -return y ## _wget(& ## z, addr); \ +return y ## _wget(&z, addr); \ } \ static uae_u32 REGPARAM2 x ## _lget(uaecptr addr) \ { \ -return y ## _lget(& ## z, addr); \ +return y ## _lget(&z, addr); \ } void soft_scsi_put(uaecptr addr, int size, uae_u32 v); @@ -237,3 +241,5 @@ void x86_xt_hd_bput(int, uae_u8); uae_u8 x86_xt_hd_bget(int); addrbank *x86_xt_hd_init(struct romconfig *rc); void x86_add_xt_hd_unit(int ch, struct uaedev_config_info *ci, struct romconfig *rc); + +#endif /* UAE_SCSI_H */ diff --git a/include/scsidev.h b/include/scsidev.h index aaa542f7..3f25ad8e 100644 --- a/include/scsidev.h +++ b/include/scsidev.h @@ -8,6 +8,11 @@ * (c) 2001-2005 Toni Wilen */ +#ifndef UAE_SCSIDEV_H +#define UAE_SCSIDEV_H + +#include "uae/types.h" + uaecptr scsidev_startup (uaecptr resaddr); void scsidev_install (void); void scsidev_reset (void); @@ -25,4 +30,6 @@ extern int log_scsi; #define UAESCSI_SPTI 1 #define UAESCSI_SPTISCAN 2 #define UAESCSI_LAST 2 -#endif \ No newline at end of file +#endif + +#endif /* UAE_SCSIDEV_H */ diff --git a/include/serial.h b/include/serial.h index bdfee4e4..89e1412f 100644 --- a/include/serial.h +++ b/include/serial.h @@ -7,6 +7,11 @@ * Copyright 1997 Christian Schmitt */ +#ifndef UAE_SERIAL_H +#define UAE_SERIAL_H + +#include "uae/types.h" + extern void serial_init (void); extern void serial_exit (void); extern void serial_dtr_off (void); @@ -29,7 +34,7 @@ extern void serial_flush_buffer (void); extern void serial_hsynchandler (void); extern void serial_check_irq (void); -extern int uaeser_getdatalenght (void); +extern int uaeser_getdatalength (void); extern int uaeser_getbytespending (void*); extern int uaeser_open (void*, void*, int); extern void uaeser_close (void*); @@ -47,3 +52,5 @@ extern int enet_readseravail (void); extern int enet_readser (uae_u16 *buffer); extern int enet_open (TCHAR *name); extern void enet_close (void); + +#endif /* UAE_SERIAL_H */ diff --git a/include/sndboard.h b/include/sndboard.h index 4793aa64..3cd708da 100644 --- a/include/sndboard.h +++ b/include/sndboard.h @@ -1,3 +1,7 @@ +#ifndef UAE_SNDBOARD_H +#define UAE_SNDBOARD_H + +#include "uae/types.h" addrbank *sndboard_init(int devnum); void sndboard_free(void); @@ -8,3 +12,4 @@ void update_sndboard_sound(double); void sndboard_reset(void); void sndboard_ext_volume(void); +#endif /* UAE_SNDBOARD_H */ diff --git a/include/specialmonitors.h b/include/specialmonitors.h index ee82198e..efe09f35 100644 --- a/include/specialmonitors.h +++ b/include/specialmonitors.h @@ -1,7 +1,13 @@ +#ifndef UAE_SPECIALMONITORS_H +#define UAE_SPECIALMONITORS_H -bool emulate_specialmonitors (struct vidbuffer*, struct vidbuffer*); +#include "memory.h" + +bool emulate_specialmonitors(struct vidbuffer *src, struct vidbuffer *dst); void specialmonitor_store_fmode(int vpos, int hpos, uae_u16 fmode); void specialmonitor_reset(void); bool specialmonitor_need_genlock(void); addrbank *specialmonitor_autoconfig_init(int devnum); bool emulate_genlock(struct vidbuffer*, struct vidbuffer*); + +#endif /* UAE_SPECIALMONITORS_H */ diff --git a/include/statusline.h b/include/statusline.h index 5fafc7ef..31f5a2d5 100644 --- a/include/statusline.h +++ b/include/statusline.h @@ -1,6 +1,8 @@ #ifndef UAE_STATUSLINE_H #define UAE_STATUSLINE_H +#include "uae/types.h" + #define TD_PADX 4 #define TD_PADY 2 #define TD_WIDTH 30 @@ -39,4 +41,4 @@ extern void statusline_updated(void); extern bool has_statusline_updated(void); extern const TCHAR *statusline_fetch(void); -#endif // UAE_STATUSLINE_H +#endif /* UAE_STATUSLINE_H */ diff --git a/include/sysdeps.h b/include/sysdeps.h index 68f4ffba..1e7c0e61 100644 --- a/include/sysdeps.h +++ b/include/sysdeps.h @@ -14,8 +14,13 @@ * * Copyright 1996, 1997 Bernd Schmidt */ +#ifdef __cplusplus #include using namespace std; +#else +#include +#include +#endif #include #include #include @@ -282,8 +287,11 @@ extern void to_upper (TCHAR *s, int len); #define DONT_HAVE_POSIX #endif -#if defined _WIN32 +#if !defined(FSUAE) && defined _WIN32 +//#ifdef FSUAE +//#error _WIN32 should not be defined here +//#endif #if defined __WATCOMC__ #define O_NDELAY 0 @@ -294,9 +302,22 @@ extern void to_upper (TCHAR *s, int len); #elif defined __MINGW32__ +#include + #define O_NDELAY 0 + +#define FILEFLAG_DIR 0x1 +#define FILEFLAG_ARCHIVE 0x2 +#define FILEFLAG_WRITE 0x4 +#define FILEFLAG_READ 0x8 +#define FILEFLAG_EXECUTE 0x10 +#define FILEFLAG_SCRIPT 0x20 +#define FILEFLAG_PURE 0x40 + #define mkdir(a,b) mkdir(a) +#include "uae/regparam.h" + #elif defined _MSC_VER #ifdef HAVE_GETTIMEOFDAY @@ -443,8 +464,8 @@ extern void mallocemu_free (void *ptr); #endif #if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 6 -extern void write_log (const TCHAR *, ...) __attribute__ ((format (printf, 1, 2))); -extern void write_log (char *, ...) __attribute__ ((format (printf, 1, 2))); +extern void write_log (const TCHAR *, ...); +extern void write_log (const char *, ...) __attribute__ ((format (printf, 1, 2))); #else extern void write_log (const TCHAR *, ...); extern void write_log (const char *, ...); @@ -492,7 +513,6 @@ extern void log_close (FILE *f); #define NORETURN #endif #endif - /* Every Amiga hardware clock cycle takes this many "virtual" cycles. This used to be hardcoded as 1, but using higher values allows us to time some stuff more precisely. @@ -538,8 +558,6 @@ extern void log_close (FILE *f); # endif #endif -#endif - #ifndef __cplusplus #define xmalloc(T, N) malloc(sizeof (T) * (N)) @@ -563,3 +581,11 @@ extern void xfree (const void*); #endif #define DBLEQU(f, i) (abs ((f) - (i)) < 0.000001) + +#ifdef HAVE_VAR_ATTRIBUTE_UNUSED +#define NOWARN_UNUSED(x) __attribute__((unused)) x +#else +#define NOWARN_UNUSED(x) x +#endif + +#endif /* UAE_SYSDEPS_H */ diff --git a/include/tabletlibrary.h b/include/tabletlibrary.h index 211ea5c0..f0931939 100644 --- a/include/tabletlibrary.h +++ b/include/tabletlibrary.h @@ -1,3 +1,7 @@ +#ifndef UAE_TABLETLIBRARY_H +#define UAE_TABLETLIBRARY_H + +#include "uae/types.h" uaecptr tabletlib_startup (uaecptr resaddr); void tabletlib_install (void); @@ -6,3 +10,5 @@ extern void tabletlib_tablet (int x, int y, int z, int pressure, int maxpressure, uae_u32 buttonbits, int inproximity, int ax, int ay, int az); extern void tabletlib_tablet_info (int maxx, int maxy, int maxz, int maxax, int maxay, int maxaz, int xres, int yres); + +#endif /* UAE_TABLETLIBRARY_H */ diff --git a/include/traps.h b/include/traps.h index e196d96c..1271abea 100644 --- a/include/traps.h +++ b/include/traps.h @@ -10,8 +10,10 @@ * Copyright 1996 Ed Hanway */ -#ifndef TRAPS_H -#define TRAPS_H +#ifndef UAE_TRAPS_H +#define UAE_TRAPS_H + +#include "uae/types.h" /* * Data passed to a trap handler @@ -55,4 +57,4 @@ void init_extended_traps (void); #define deftrap2(f, mode, str) define_trap((f), (mode), (str)) #define deftrapres(f, mode, str) define_trap((f), (mode | TRAPFLAG_UAERES), (str)) -#endif +#endif /* UAE_TRAPS_H */ diff --git a/include/uae.h b/include/uae.h index c0db69fc..12f71bac 100644 --- a/include/uae.h +++ b/include/uae.h @@ -6,6 +6,11 @@ * Copyright 1996 Bernd Schmidt */ +#ifndef UAE_UAE_H +#define UAE_UAE_H + +#include "uae/types.h" + extern void do_start_program (void); extern void start_program (void); extern void leave_program (void); @@ -75,3 +80,10 @@ extern uae_u32 uaerand (void); extern uae_u32 uaesrand (uae_u32 seed); extern uae_u32 uaerandgetseed (void); +/* the following prototypes should probably be moved somewhere else */ + +int get_guid_target (uae_u8 *out); +void filesys_addexternals (void); +void jit_abort (const TCHAR *format,...); + +#endif /* UAE_UAE_H */ diff --git a/include/uae/attributes.h b/include/uae/attributes.h index ec768df0..1047c845 100644 --- a/include/uae/attributes.h +++ b/include/uae/attributes.h @@ -21,4 +21,6 @@ #define UAE_PRINTF_FORMAT(f, a) #endif +#define UAE_WPRINTF_FORMAT(f, a) + #endif /* UAE_ATTRIBUTES_H */ diff --git a/include/uae/cdrom.h b/include/uae/cdrom.h index 81f4f6d9..ca813568 100644 --- a/include/uae/cdrom.h +++ b/include/uae/cdrom.h @@ -1,6 +1,8 @@ #ifndef UAE_CDROM_H #define UAE_CDROM_H +#include "uae/types.h" + void encode_l2(uae_u8 *p, int address); #endif /* UAE_CDROM_H */ diff --git a/include/uae/dlopen.h b/include/uae/dlopen.h index 04719d57..1162b8e9 100644 --- a/include/uae/dlopen.h +++ b/include/uae/dlopen.h @@ -17,6 +17,8 @@ #define UAE_DLHANDLE void * #endif +/* General loadable module support */ + UAE_DLHANDLE uae_dlopen(const TCHAR *path); void *uae_dlsym(UAE_DLHANDLE handle, const char *symbol); void uae_dlclose(UAE_DLHANDLE handle); diff --git a/include/uae/likely.h b/include/uae/likely.h new file mode 100644 index 00000000..635ed392 --- /dev/null +++ b/include/uae/likely.h @@ -0,0 +1,16 @@ +#ifndef UAE_LIKELY_H +#define UAE_LIKELY_H + +#ifdef HAVE___BUILTIN_EXPECT + +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) + +#else + +#define likely(x) x +#define unlikely(x) x + +#endif + +#endif /* UAE_LIKELY_H */ diff --git a/include/uae/log.h b/include/uae/log.h index 385942b8..f4801951 100644 --- a/include/uae/log.h +++ b/include/uae/log.h @@ -6,8 +6,8 @@ * See the file 'COPYING' for full license text. */ -#ifndef UAE_LOGGING_H -#define UAE_LOGGING_H +#ifndef UAE_LOG_H +#define UAE_LOG_H /* This file is intended to be included by external libraries as well, * so don't pull in too much UAE-specific stuff. */ @@ -47,6 +47,10 @@ void uae_fatal(const char *format, ...) UAE_PRINTF_FORMAT(1, 2); /* Helpers to log use of stubbed functions */ +#ifdef _MSC_VER +#define __func__ __FUNCTION__ +#endif + #define UAE_LOG_STUB(format, ...) \ { \ uae_log(" -- stub -- %s " format "\n", __func__, ##__VA_ARGS__); \ @@ -75,7 +79,7 @@ void uae_fatal(const char *format, ...) UAE_PRINTF_FORMAT(1, 2); void write_log (const char *, ...) UAE_PRINTF_FORMAT(1, 2); #if SIZEOF_TCHAR != 1 -void write_log (const TCHAR *, ...) UAE_PRINTF_FORMAT(1, 2); +void write_log (const TCHAR *, ...) UAE_WPRINTF_FORMAT(1, 2); #endif #endif @@ -91,4 +95,4 @@ void write_log (const TCHAR *, ...) UAE_PRINTF_FORMAT(1, 2); #endif -#endif /* UAE_LOGGING_H */ +#endif /* UAE_LOG_H */ diff --git a/include/uae/ppc.h b/include/uae/ppc.h index 0042a973..c1f0d0af 100644 --- a/include/uae/ppc.h +++ b/include/uae/ppc.h @@ -27,6 +27,7 @@ #ifdef UAE void uae_ppc_get_model(const TCHAR **model, uint32_t *hid1); + void uae_ppc_doze(void); void uae_ppc_crash(void); void uae_ppc_cpu_reboot(void); @@ -94,7 +95,7 @@ typedef struct PPCMemoryRegion { uint32_t start; uint32_t size; void *memory; - const char *name; + char *name; uint32_t alias; } PPCMemoryRegion; @@ -120,6 +121,7 @@ void PPCCALL ppc_cpu_reset(void); //int PPCCALL ppc_cpu_get_state(); bool PPCCALL ppc_cpu_check_state(int state); void PPCCALL ppc_cpu_set_state(int state); + /* Other PPC defines */ #define PPC_IMPLEMENTATION_AUTO 0 diff --git a/include/uae/qemu.h b/include/uae/qemu.h index 97feaa43..8e6638e6 100644 --- a/include/uae/qemu.h +++ b/include/uae/qemu.h @@ -4,13 +4,14 @@ /* This file is intended to be included by external libraries as well, * so don't pull in too much UAE-specific stuff. */ +#include "uae/types.h" #include "uae/api.h" /* The qemu-uae major version must match this */ #define QEMU_UAE_VERSION_MAJOR 3 /* The qemu-uae minor version must be at least this */ -#define QEMU_UAE_VERSION_MINOR 4 +#define QEMU_UAE_VERSION_MINOR 5 UAE_DECLARE_IMPORT_FUNCTION( void, qemu_uae_version, int *major, int *minor, int *revision) diff --git a/include/uae/types.h b/include/uae/types.h index 5cb7448d..b7162f24 100644 --- a/include/uae/types.h +++ b/include/uae/types.h @@ -34,11 +34,15 @@ typedef uint32_t uae_u32; #ifndef uae_s64 typedef long long int uae_s64; #endif - #ifndef uae_u64 typedef unsigned long long int uae_u64; #endif +#ifdef HAVE___UINT128_T +#define HAVE_UAE_U128 +typedef __uint128_t uae_u128; +#endif + /* Parts of the UAE/WinUAE code uses the bool type (from C++). * Including stdbool.h lets this be valid also when compiling with C. */ @@ -78,9 +82,6 @@ typedef char TCHAR; #endif #endif -#ifndef BOOL -#define BOOL int -#endif #ifndef FALSE #define FALSE 0 #endif diff --git a/include/uaeexe.h b/include/uaeexe.h index c215b3b0..7423fec6 100644 --- a/include/uaeexe.h +++ b/include/uaeexe.h @@ -4,6 +4,11 @@ * (c) 1997 by Samuel Devulder */ +#ifndef UAE_UAEEXE_H +#define UAE_UAEEXE_H + +#include "uae/types.h" + struct uae_xcmd { struct uae_xcmd *prev, *next; TCHAR *cmd; @@ -18,4 +23,4 @@ struct uae_xcmd { extern void uaeexe_install (void); extern int uaeexe (const TCHAR *cmd); - +#endif /* UAE_UAEEXE_H */ diff --git a/include/uaeipc.h b/include/uaeipc.h index 94b6af2a..fb693555 100644 --- a/include/uaeipc.h +++ b/include/uaeipc.h @@ -1,3 +1,7 @@ +#ifndef UAE_UAEIPC_H +#define UAE_UAEIPC_H + +#include "uae/types.h" extern void *createIPC (const TCHAR *name, int); extern void closeIPC (void*); @@ -6,3 +10,5 @@ extern void *geteventhandleIPC (void*); extern int sendBinIPC (void*, uae_u8 *msg, int len); extern int sendIPC (void*, TCHAR *msg); extern int isIPC (const TCHAR *pipename); + +#endif /* UAE_UAEIPC_H */ diff --git a/include/uaenative.h b/include/uaenative.h index b06af08f..bedf9dde 100644 --- a/include/uaenative.h +++ b/include/uaenative.h @@ -6,23 +6,12 @@ * Copyright 2013-2014 Frode Solheim */ -#ifndef _UAE_UAENATIVE_H_ -#define _UAE_UAENATIVE_H_ +#ifndef UAE_UAENATIVE_H +#define UAE_UAENATIVE_H #ifdef WITH_UAENATIVE -#if defined(_WIN32) || defined(WINDOWS) - - #define UNIAPI __declspec(dllimport) - #define UNICALL __cdecl - -#else // _WIN32 not defined - - #define UNIAPI - #define UNICALL - -#endif - +#define UNI_IMPORT #include "uni_common.h" #define UNI_FLAG_ASYNCHRONOUS 1 @@ -44,6 +33,6 @@ uaecptr uaenative_startup (uaecptr resaddr); * be de-allocated. */ const TCHAR **uaenative_get_library_dirs(void); -#endif // WITH_UAENATIVE +#endif /* WITH_UAENATIVE */ -#endif // _UAE_UAENATIVE_H_ +#endif /* UAE_UAENATIVE_H */ diff --git a/include/uaeresource.h b/include/uaeresource.h index 46828d45..22766d66 100644 --- a/include/uaeresource.h +++ b/include/uaeresource.h @@ -1,3 +1,9 @@ +#ifndef UAE_UAERESOURCE_H +#define UAE_UAERESOURCE_H + +#include "uae/types.h" uaecptr uaeres_startup (uaecptr resaddr); -void uaeres_install (void); \ No newline at end of file +void uaeres_install (void); + +#endif /* UAE_UAERESOURCE_H */ diff --git a/include/uaeserial.h b/include/uaeserial.h index 30d4bce9..b69d30cb 100644 --- a/include/uaeserial.h +++ b/include/uaeserial.h @@ -6,6 +6,11 @@ * (c) 2006 Toni Wilen */ +#ifndef UAE_UAESERIAL_H +#define UAE_UAESERIAL_H + +#include "uae/types.h" + uaecptr uaeserialdev_startup (uaecptr resaddr); void uaeserialdev_install (void); void uaeserialdev_reset (void); @@ -20,3 +25,5 @@ struct uaeserialdata void *writeevent; #endif }; + +#endif /* UAE_UAESERIAL_H */ diff --git a/include/uni_common.h b/include/uni_common.h index 47487ad2..d0c1abda 100644 --- a/include/uni_common.h +++ b/include/uni_common.h @@ -6,17 +6,29 @@ * Copyright 2013-2014 Frode Solheim */ -#ifndef _UAE_UNI_COMMON_H_ -#define _UAE_UNI_COMMON_H_ +#ifndef UAE_UNI_COMMON_H +#define UAE_UNI_COMMON_H #define UNI_VERSION 1 #ifndef UNI_MIN_VERSION // MIN_UNI_VERSION decides which callback functions are declared available. -// The default, unless overriden is to required the current UNI version. +// The default, unless overridden is to require the current UNI version. #define UNI_MIN_VERSION UNI_VERSION #endif +#ifdef _WIN32 +#ifdef UNI_IMPORT +#define UNIAPI __declspec(dllimport) +#else +#define UNIAPI __declspec(dllexport) +#endif +#define UNICALL __cdecl +#else +#define UNIAPI +#define UNICALL +#endif + #define UNI_ERROR_NOT_ENABLED 0x70000001 #define UNI_ERROR_INVALID_LIBRARY 0x70000002 #define UNI_ERROR_INVALID_FUNCTION 0x70000002 @@ -29,22 +41,27 @@ #define UNI_ERROR_INIT_FAILED 0x70000009 #define UNI_ERROR_INTERFACE_TOO_OLD 0x7000000a -// these errors are only return from the Amiga-side uni wrappers +// these errors are only returned from the Amiga-side uni wrappers #define UNI_ERROR_AMIGALIB_NOT_OPEN 0x71000000 -// On all current platforms, char, short and int short be 1, 2 and 4 bytes -// respectively, so we just use these simple types. +#include + +typedef int8_t uni_byte; +typedef uint8_t uni_ubyte; +typedef int16_t uni_word; +typedef uint16_t uni_uword; +typedef int32_t uni_long; +typedef uint32_t uni_ulong; -typedef char uni_char; -typedef unsigned char uni_uchar; -typedef short uni_short; -typedef unsigned short uni_ushort; -typedef int uni_long; -typedef unsigned int uni_ulong; +// deprecated typedefs +typedef int8_t uni_char; +typedef uint8_t uni_uchar; +typedef int16_t uni_short; +typedef uint16_t uni_ushort; typedef int (UNICALL *uni_version_function)(); typedef void * (UNICALL *uni_resolve_function)(uni_ulong ptr); -typedef const uni_char * (UNICALL *uni_uae_version_function)(void); +typedef const char * (UNICALL *uni_uae_version_function)(void); struct uni { uni_long d1; @@ -77,4 +94,4 @@ struct uni { #endif }; -#endif // _UAE_UNI_COMMON_H_ +#endif /* UAE_UNI_COMMON_H */ diff --git a/include/unpacked.h b/include/unpacked.h index c5608d67..e4ef9612 100644 --- a/include/unpacked.h +++ b/include/unpacked.h @@ -1,8 +1,3 @@ -#ifdef _MSC_VER ; #pragma pack(pop) #undef PACKED -#else -PACKED__; -#endif - diff --git a/include/x86.h b/include/x86.h index 8ec53ac8..4d5bb1f8 100644 --- a/include/x86.h +++ b/include/x86.h @@ -1,3 +1,5 @@ +#ifndef UAE_X86_H +#define UAE_X86_H extern addrbank *a1060_init(struct romconfig *rc); extern addrbank *a2088xt_init(struct romconfig *rc); @@ -17,3 +19,5 @@ void x86_bridge_sync_change(void); int is_x86_cpu(struct uae_prefs*); void x86_bridge_execute_until(int until); extern bool x86_turbo_on; + +#endif /* UAE_X86_H */ diff --git a/include/xwin.h b/include/xwin.h index 0cdbe689..14fc5920 100644 --- a/include/xwin.h +++ b/include/xwin.h @@ -6,6 +6,10 @@ * Copyright 1995-1997 Bernd Schmidt */ +#ifndef UAE_XWIN_H +#define UAE_XWIN_H + +#include "uae/types.h" #include "machdep/rpt.h" typedef uae_u32 xcolnr; @@ -27,7 +31,10 @@ extern void setup_brkhandler (void); extern int isfullscreen (void); extern void toggle_fullscreen (int); extern bool toggle_rtg (int); + extern void toggle_mousegrab (void); +void setmouseactivexy (int x, int y, int dir); + extern void desktop_coords (int *dw, int *dh, int *x, int *y, int *w, int *h); extern bool vsync_switchmode (int); extern frame_time_t vsync_busywait_end (int*); @@ -54,9 +61,13 @@ extern int lockscr (struct vidbuffer*, bool); extern void unlockscr (struct vidbuffer*); extern bool target_graphics_buffer_update (void); +void getgfxoffset (float *dxp, float *dyp, float *mxp, float *myp); +double getcurrentvblankrate (void); /* todo: remove from od-win32/win32gfx.h */ + extern int debuggable (void); extern void LED (int); extern void screenshot (int,int); +void refreshtitle (void); extern int bits_in_mask (unsigned long mask); extern int mask_shift (unsigned long mask); @@ -161,3 +172,4 @@ extern struct vidbuf_description gfxvidinfo; extern struct bstring *video_mode_menu; extern void vidmode_menu_selected(int); +#endif /* UAE_XWIN_H */ diff --git a/include/zarchive.h b/include/zarchive.h index 49b23e31..07ac17cd 100644 --- a/include/zarchive.h +++ b/include/zarchive.h @@ -1,3 +1,7 @@ +#ifndef UAE_ZARCHIVE_H +#define UAE_ZARCHIVE_H + +#include "uae/types.h" typedef uae_s64 (*ZFILEREAD)(void*, uae_u64, uae_u64, struct zfile*); typedef uae_s64 (*ZFILEWRITE)(const void*, uae_u64, uae_u64, struct zfile*); @@ -144,3 +148,5 @@ extern struct zfile *archive_getzfile (struct znode *zn, unsigned int id, int fl extern struct zfile *archive_unpackzfile (struct zfile *zf); extern struct zfile *decompress_zfd (struct zfile*); + +#endif /* UAE_ZARCHIVE_H */ diff --git a/include/zfile.h b/include/zfile.h index 4f08aded..ac3c0739 100644 --- a/include/zfile.h +++ b/include/zfile.h @@ -9,6 +9,8 @@ #ifndef UAE_ZFILE_H #define UAE_ZFILE_H +#include "uae/types.h" + struct zfile; struct zvolume; struct zdirectory; @@ -153,4 +155,4 @@ struct mystat extern void timeval_to_amiga (struct mytimeval *tv, int* days, int* mins, int* ticks, int tickcount); extern void amiga_to_timeval (struct mytimeval *tv, int days, int mins, int ticks, int tickcount); -#endif // UAE_ZFILE_H +#endif /* UAE_ZFILE_H */ diff --git a/memory.cpp b/memory.cpp index 7084ad9e..ad8ad73d 100644 --- a/memory.cpp +++ b/memory.cpp @@ -2217,7 +2217,7 @@ uae_s32 getz2size (struct uae_prefs *p) return start; } -ULONG getz2endaddr (void) +uae_u32 getz2endaddr (void) { ULONG start; start = currprefs.fastmem_size; diff --git a/od-win32/parser.cpp b/od-win32/parser.cpp index 7de11372..ff646ef4 100644 --- a/od-win32/parser.cpp +++ b/od-win32/parser.cpp @@ -557,7 +557,7 @@ struct uaeserialdatawin32 void *user; }; -int uaeser_getdatalenght (void) +int uaeser_getdatalength (void) { return sizeof (struct uaeserialdatawin32); } diff --git a/uaeserial.cpp b/uaeserial.cpp index 9e3d6629..154d9687 100644 --- a/uaeserial.cpp +++ b/uaeserial.cpp @@ -277,7 +277,7 @@ static uae_u32 REGPARAM2 dev_open (TrapContext *context) if (i == MAX_TOTAL_DEVICES) return openfail (ioreq, IOERR_OPENFAIL); dev = &devst[i]; - dev->sysdata = xcalloc (uae_u8, uaeser_getdatalenght ()); + dev->sysdata = xcalloc (uae_u8, uaeser_getdatalength ()); if (!uaeser_open (dev->sysdata, dev, unit)) { xfree (dev->sysdata); return openfail (ioreq, IOERR_OPENFAIL);