diff --git a/AndroidAppSettings.cfg b/AndroidAppSettings.cfg index 3cfdcf3..86c16ef 100755 --- a/AndroidAppSettings.cfg +++ b/AndroidAppSettings.cfg @@ -194,10 +194,10 @@ MultiABI='armeabi-v7a arm64-v8a' AppMinimumRAM=256 # Application version code (integer) -AppVersionCode=010308 +AppVersionCode=010410 # Application user-visible version name (string) -AppVersionName="1.0.4.0" +AppVersionName="1.0.4.1" # Reset SDL config when updating application to the new version (y) / (n) ResetSdlConfigForThisVersion=n diff --git a/src/akiko.cpp b/src/akiko.cpp index 2d41f35..e7c7606 100755 --- a/src/akiko.cpp +++ b/src/akiko.cpp @@ -1959,7 +1959,7 @@ uae_u8 *save_akiko (int *len, uae_u8 *dstptr) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = xmalloc (uae_u8, 1000); + dstbak = dst = xmalloc (uae_u8, 256); save_u16 (0); save_u16 (0xCAFE); save_u32 (cdrom_intreq); diff --git a/src/audio.cpp b/src/audio.cpp index bb0f553..7902739 100755 --- a/src/audio.cpp +++ b/src/audio.cpp @@ -1554,7 +1554,7 @@ uae_u8 *save_audio (int nr, int *len, uae_u8 *dstptr) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = xmalloc (uae_u8, 100); + dstbak = dst = xmalloc (uae_u8, 32); save_u8 (acd->state); save_u8 (acd->data.audvol); save_u8 (acd->intreq2); diff --git a/src/blitter.cpp b/src/blitter.cpp index b64fcc7..96135ef 100755 --- a/src/blitter.cpp +++ b/src/blitter.cpp @@ -1547,7 +1547,7 @@ uae_u8 *save_blitter_new (int *len, uae_u8 *dstptr) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = xmalloc (uae_u8, 1000); + dstbak = dst = xmalloc (uae_u8, 256); uae_u8 state; save_u8 (blitter_cycle_exact ? 3 : 0); diff --git a/src/blkdev.cpp b/src/blkdev.cpp index eddea8f..ffd29b3 100755 --- a/src/blkdev.cpp +++ b/src/blkdev.cpp @@ -1813,7 +1813,7 @@ uae_u8 *save_cd (int num, int *len) return NULL; if (!currprefs.cs_cd32cd && !currprefs.scsi) return NULL; - dstbak = dst = xmalloc (uae_u8, 4 + MAX_DPATH + 4 + 4 + 4 + 2 * MAX_DPATH); + dstbak = dst = xmalloc (uae_u8, 4 + MAX_DPATH + 4 + 4 + 4 + SUBQ_SIZE + 2 * MAX_DPATH); save_u32 (4 | 8 | 16); save_path (currprefs.cdslots[num].name, SAVESTATE_PATH_CD); save_u32 (currprefs.cdslots[num].type); diff --git a/src/cia.cpp b/src/cia.cpp index 576a16c..e37f684 100755 --- a/src/cia.cpp +++ b/src/cia.cpp @@ -1731,7 +1731,8 @@ uae_u8 *restore_cia (int num, uae_u8 *src) div10 = CYCLE_UNIT * b; b = restore_u8 (); if (num) ciabsdr_cnt = b; else ciaasdr_cnt = b; - if (num) ciabsdr_buf = b; + b = restore_u8 (); + if (num) ciabsdr_buf = b; else ciaasdr_buf = b; return src; } diff --git a/src/custom.cpp b/src/custom.cpp index f41cef6..c579588 100755 --- a/src/custom.cpp +++ b/src/custom.cpp @@ -7666,7 +7666,7 @@ void custom_prepare_savestate (void) uae_u8 *restore_custom (uae_u8 *src) { - uae_u16 dsklen, dskbytr, ru16; + uae_u16 dsklen, dskbytr; int dskpt; int i; @@ -7709,30 +7709,30 @@ uae_u8 *restore_custom (uae_u8 *src) BLTCON1(0, RW); /* 042 BLTCON1 */ BLTAFWM(0, RW); /* 044 BLTAFWM */ BLTALWM(0, RW); /* 046 BLTALWM */ - bltcpt = RL; /* 048-04B BLTCPT */ - bltbpt = RL; /* 04C-04F BLTBPT */ - bltapt = RL; /* 050-053 BLTAPT */ - bltdpt = RL; /* 054-057 BLTDPT */ + BLTCPTH (0, RW);BLTCPTL(0, RW); /* 048-04B BLTCPT */ + BLTBPTH (0, RW);BLTBPTL(0, RW); /* 04C-04F BLTBPT */ + BLTAPTH (0, RW);BLTAPTL(0, RW); /* 050-053 BLTAPT */ + BLTDPTH (0, RW);BLTDPTL(0, RW); /* 054-057 BLTDPT */ RW; /* 058 BLTSIZE */ RW; /* 05A BLTCON0L -> see 040 */ blt_info.vblitsize=RW; /* 05C BLTSIZV */ blt_info.hblitsize=RW; /* 05E BLTSIZH */ - blt_info.bltcmod = RW; /* 060 BLTCMOD */ - blt_info.bltbmod = RW; /* 062 BLTBMOD */ - blt_info.bltamod = RW; /* 064 BLTAMOD */ - blt_info.bltdmod = RW; /* 066 BLTDMOD */ + BLTCMOD (0, RW); /* 060 BLTCMOD */ + BLTBMOD (0, RW); /* 062 BLTBMOD */ + BLTAMOD (0, RW); /* 064 BLTAMOD */ + BLTDMOD (0, RW); /* 066 BLTDMOD */ RW; /* 068 ? */ RW; /* 06A ? */ RW; /* 06C ? */ RW; /* 06E ? */ - blt_info.bltcdat =RW; /* 070 BLTCDAT */ + BLTCDAT (0, RW); /* 070 BLTCDAT */ BLTBDAT(0, RW); /* 072 BLTBDAT */ - blt_info.bltadat=RW; /* 074 BLTADAT */ + BLTADAT (0, RW); /* 074 BLTADAT */ RW; /* 076 ? */ RW; /* 078 ? */ RW; /* 07A ? */ RW; /* 07C LISAID */ - ru16=RW; DSKSYNC(-1, ru16); /* 07E DSKSYNC */ + DSKSYNC (-1, RW); /* 07E DSKSYNC */ cop1lc = RL; /* 080/082 COP1LC */ cop2lc = RL; /* 084/086 COP2LC */ RW; /* 088 COPJMP1 */ @@ -7757,7 +7757,7 @@ uae_u8 *restore_custom (uae_u8 *src) bpl1mod = RW; /* 108 BPL1MOD */ bpl2mod = RW; /* 10A BPL2MOD */ bplcon4 = RW; /* 10C BPLCON4 */ - CLXCON2(RW); /* 10E CLXCON2* */ + clxcon2 = RW; /* 10E CLXCON2* */ for(i = 0; i < 8; i++) fetched[i] = RW; /* BPLXDAT */ /* 120 - 17E Sprite regs */ @@ -8130,7 +8130,7 @@ uae_u8 *save_custom_extra (int *len, uae_u8 *dstptr) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = xmalloc (uae_u8, 1000); + dstbak = dst = xmalloc (uae_u8, 32); SL ((currprefs.cs_compatible << 24) | (&get_mem_bank (0) != &chipmem_bank ? 2 : 0) | 1); SB (currprefs.cs_rtc); @@ -8190,7 +8190,7 @@ uae_u8 *save_custom_event_delay (int *len, uae_u8 *dstptr) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = xmalloc (uae_u8, 1000); + dstbak = dst = xmalloc (uae_u8, 256); save_u32 (1); save_u8 (cnt); @@ -8200,7 +8200,6 @@ uae_u8 *save_custom_event_delay (int *len, uae_u8 *dstptr) save_u8 (1); save_u64 (e->evtime - get_cycles ()); save_u32 (e->data); - } } @@ -8214,7 +8213,7 @@ uae_u8 *save_cycles (int *len, uae_u8 *dstptr) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = xmalloc (uae_u8, 1000); + dstbak = dst = xmalloc (uae_u8, 32); save_u32 (1); save_u32 (CYCLE_UNIT); save_u64 (get_cycles ()); diff --git a/src/disk.cpp b/src/disk.cpp index 4cdfeb3..2bdbeb3 100755 --- a/src/disk.cpp +++ b/src/disk.cpp @@ -4242,7 +4242,7 @@ uae_u8 *save_disk (int num, int *len, uae_u8 *dstptr, bool usepath) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = xmalloc (uae_u8, 2 + 1 + 1 + 1 + 1 + 4 + 4 + MAX_DPATH + 2 + 2 + 4 + 2 * MAX_DPATH); + dstbak = dst = xmalloc (uae_u8, 4 + 1 + 1 + 1 + 1 + 4 + 4 + MAX_DPATH + 2 + 2 + 4 + 2 * MAX_DPATH); save_u32 (drv->drive_id); /* drive type ID */ save_u8 ((drv->motoroff ? 0 : 1) | ((disabled & (1 << num)) ? 2 : 0) | (drv->idbit ? 4 : 0) | (drv->dskchange ? 8 : 0) | (side ? 16 : 0) | (drv->wrprot ? 32 : 0)); save_u8 (drv->cyl); /* cylinder */ diff --git a/src/expansion.cpp b/src/expansion.cpp index 6791183..fb12996 100755 --- a/src/expansion.cpp +++ b/src/expansion.cpp @@ -2556,6 +2556,7 @@ void restore_expansion_finish(void) ec->aci.doinit = true; } } + restore_cardno = 0; } #endif /* SAVESTATE */ diff --git a/src/filesys.cpp b/src/filesys.cpp index a42ee11..c30453b 100755 --- a/src/filesys.cpp +++ b/src/filesys.cpp @@ -8234,7 +8234,7 @@ uae_u8 *save_filesys_common (int *len) uae_u8 *dstbak, *dst; if (nr_units() == 0) return NULL; - dstbak = dst = xmalloc (uae_u8, 1000); + dstbak = dst = xmalloc (uae_u8, 32); save_u32 (2); save_u64 (a_uniq); save_u64 (key_uniq); diff --git a/src/fpp.cpp b/src/fpp.cpp index 02da4b0..f88ef94 100755 --- a/src/fpp.cpp +++ b/src/fpp.cpp @@ -2815,7 +2815,7 @@ uae_u8 *save_fpu (int *len, uae_u8 *dstptr) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = xmalloc (uae_u8, 4+4+8*10+4+4+4+4+4+2*10+3*(4+2)); + dstbak = dst = xmalloc (uae_u8, 4+4+8*10+4+4+4+4+4+4+2+4+4*4+20*4+16); save_u32 (currprefs.fpu_model); save_u32 (0x80000000 | 0x20000000 | (regs.fp_ea_set ? 0x00000001 : 0x00000000)); for (i = 0; i < 8; i++) { diff --git a/src/gayle.cpp b/src/gayle.cpp index d82a010..d8ed3f1 100755 --- a/src/gayle.cpp +++ b/src/gayle.cpp @@ -842,7 +842,7 @@ uae_u8 *save_gayle (int *len, uae_u8 *dstptr) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = xmalloc (uae_u8, 1000); + dstbak = dst = xmalloc (uae_u8, 32); save_u8 (currprefs.cs_ide); save_u8 (gayle_int); save_u8 (gayle_irq); @@ -868,7 +868,7 @@ uae_u8 *save_gayle_ide (int num, int *len, uae_u8 *dstptr) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = xmalloc (uae_u8, 1000); + dstbak = dst = xmalloc (uae_u8, 32); save_u32 (num); dst = ide_save_state(dst, ide); *len = dst - dstbak; diff --git a/src/include/options.h.orig b/src/include/options.h.orig deleted file mode 100755 index 7bcea21..0000000 --- a/src/include/options.h.orig +++ /dev/null @@ -1,544 +0,0 @@ - /* - * UAE - The Un*x Amiga Emulator - * - * Stuff - * - * Copyright 1995, 1996 Ed Hanway - * Copyright 1995-2001 Bernd Schmidt - */ - -#ifndef UAE_OPTIONS_H -#define UAE_OPTIONS_H - -#include "uae/types.h" - -#include "traps.h" - -#define UAEMAJOR 4 -#define UAEMINOR 3 -#define UAESUBREV 0 - -typedef enum { KBD_LANG_US, KBD_LANG_DK, KBD_LANG_DE, KBD_LANG_SE, KBD_LANG_FR, KBD_LANG_IT, KBD_LANG_ES } KbdLang; - -extern uae_s32 version; - -#define MAX_PATHS 1 - -struct multipath { - TCHAR path[MAX_PATHS][PATH_MAX]; -}; - -#define PATH_NONE -1 -#define PATH_FLOPPY 0 -#define PATH_CD 1 -#define PATH_DIR 2 -#define PATH_HDF 3 -#define PATH_FS 4 -#define PATH_ROM 9 - -struct strlist { - struct strlist *next; - TCHAR *option, *value; - int unknown; -}; - -#define MAX_TOTAL_SCSI_DEVICES 1 - -/* maximum number native input devices supported (single type) */ -#define MAX_INPUT_DEVICES 8 -/* maximum number of native input device's buttons and axles supported */ -#define MAX_INPUT_DEVICE_EVENTS 256 -/* 4 different customization settings */ -#define MAX_INPUT_SETTINGS 4 -#define GAMEPORT_INPUT_SETTINGS 3 // last slot is for gameport panel mappings - -#define MAX_INPUT_SUB_EVENT 8 -#define MAX_INPUT_SUB_EVENT_ALL 9 -#define SPARE_SUB_EVENT 8 - -#define INTERNALEVENT_COUNT 1 - -struct uae_input_device { - TCHAR *name; - TCHAR *configname; - uae_s16 eventid[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT_ALL]; - uae_u64 flags[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT_ALL]; - uae_s8 port[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT_ALL]; - uae_s16 extra[MAX_INPUT_DEVICE_EVENTS]; - uae_s8 enabled; -}; - -#define MAX_JPORTS 4 -#define NORMAL_JPORTS 2 -#define MAX_JPORT_NAME 128 -#define MAX_JPORT_CONFIG 256 -struct inputdevconfig { - TCHAR name[MAX_JPORT_NAME]; - TCHAR configname[MAX_JPORT_CONFIG]; - TCHAR shortid[16]; -}; -struct jport { - int id; - int mode; // 0=def,1=mouse,2=joy,3=anajoy - int submode; - int autofire; - struct inputdevconfig idc; - bool nokeyboardoverride; - bool changed; -}; -#define JPORT_UNPLUGGED -2 -#define JPORT_NONE -1 - -#define JPORT_AF_NORMAL 1 -#define JPORT_AF_TOGGLE 2 -#define JPORT_AF_ALWAYS 3 - -#define MAX_CUSTOM_MEMORY_ADDRS 2 - -#define CONFIG_TYPE_ALL -1 -#define CONFIG_TYPE_DEFAULT 0 -#define CONFIG_TYPE_HARDWARE 1 -#define CONFIG_TYPE_HOST 2 -#define CONFIG_TYPE_NORESET 4 -#define CONFIG_BLEN 2560 - -#define TABLET_OFF 0 -#define TABLET_MOUSEHACK 1 - -struct cdslot -{ - TCHAR name[MAX_DPATH]; - bool inuse; - bool delayed; - bool temporary; - int type; -}; -struct floppyslot -{ - TCHAR df[MAX_DPATH]; - int dfxtype; - bool forcedwriteprotect; -}; - -struct wh { - int x, y; - int width, height; -}; - -#define MOUNT_CONFIG_SIZE 30 -#define UAEDEV_DIR 0 -#define UAEDEV_HDF 1 - -#define HD_LEVEL_SCSI_1 0 -#define HD_LEVEL_SCSI_2 1 - -#define HD_LEVEL_ATA_1 0 -#define HD_LEVEL_ATA_2 1 -#define HD_LEVEL_ATA_2S 2 - -#define BOOTPRI_NOAUTOBOOT -128 -#define BOOTPRI_NOAUTOMOUNT -129 -#define ISAUTOBOOT(ci) ((ci)->bootpri > BOOTPRI_NOAUTOBOOT) -#define ISAUTOMOUNT(ci) ((ci)->bootpri > BOOTPRI_NOAUTOMOUNT) -struct uaedev_config_info { - int type; - TCHAR devname[MAX_DPATH]; - TCHAR volname[MAX_DPATH]; - TCHAR rootdir[MAX_DPATH]; - bool readonly; - bool lock; - int bootpri; - TCHAR filesys[MAX_DPATH]; - int lowcyl; - int highcyl; // zero if detected from size - int cyls; // calculated/corrected highcyl - int surfaces; - int sectors; - int reserved; - int blocksize; - uae_u64 max_lba; - int controller_type; - int controller_type_unit; - int controller_unit; - int unit_feature_level; - int unit_special_flags; - int pcyls, pheads, psecs; - int flags; - int buffers; - int bufmemtype; - int stacksize; - int priority; - uae_u32 mask; - int maxtransfer; - uae_u32 dostype; - int unit; - int interleave; - int sectorsperblock; - int forceload; - int uae_unitnum; // mountunit nr -}; - -struct uaedev_config_data -{ - struct uaedev_config_info ci; - int configoffset; // HD config entry index -}; - -enum { CP_GENERIC = 1, CP_CD32, CP_A500, CP_A500P, CP_A600, - CP_A1200, CP_A2000, CP_A4000 }; - -#define IDE_A600A1200 1 -#define IDE_A4000 2 - -#define MAX_CHIPSET_REFRESH 1 -#define MAX_CHIPSET_REFRESH_TOTAL (MAX_CHIPSET_REFRESH + 2) -#define CHIPSET_REFRESH_PAL (MAX_CHIPSET_REFRESH + 0) -#define CHIPSET_REFRESH_NTSC (MAX_CHIPSET_REFRESH + 1) -struct chipset_refresh -{ - bool inuse; - int index; - bool rtg; - int horiz; - int vert; - int lace; - int resolution; - int ntsc; - double rate; - TCHAR label[16]; -}; - -#define APMODE_NATIVE 0 -#define APMODE_RTG 1 - -struct apmode -{ - int gfx_refreshrate; -}; - - -#define MAX_DUPLICATE_EXPANSION_BOARDS 1 -#define MAX_EXPANSION_BOARDS 20 -#define ROMCONFIG_CONFIGTEXT_LEN 256 -struct boardromconfig; -struct romconfig -{ - TCHAR romfile[MAX_DPATH]; - TCHAR romident[256]; - uae_u32 board_ram_size; - bool inserted; - struct boardromconfig *back; -}; -#define MAX_BOARD_ROMS 2 -struct boardromconfig -{ - int device_type; - int device_num; - int device_order; - struct romconfig roms[MAX_BOARD_ROMS]; -}; -#define MAX_RTG_BOARDS 1 -struct rtgboardconfig -{ - int rtgmem_type; - uae_u32 rtgmem_size; - int device_order; -}; -#define MAX_RAM_BOARDS 1 -struct ramboard -{ - uae_u32 size; - uae_u8 autoconfig[16]; - int device_order; -}; -struct expansion_params -{ - int device_order; -}; - -#define Z3MAPPING_AUTO 0 -#define Z3MAPPING_UAE 1 -#define Z3MAPPING_REAL 2 - -struct monconfig -{ - struct wh gfx_size; -}; - -struct uae_prefs { - - struct strlist *all_lines; - - TCHAR description[256]; - TCHAR info[256]; - int config_version; - - bool socket_emu; - - bool start_gui; - - KbdLang keyboard_lang; - - int produce_sound; - int sound_stereo; - int sound_stereo_separation; - int sound_mixed_stereo_delay; - int sound_freq; - int sound_interpol; - int sound_filter; - int sound_filter_type; - int sound_volume_paula; - int sound_volume_cd; - - bool compfpu; - int cachesize; - bool fpu_strict; - - struct monconfig gfx_monitor; - int gfx_framerate; - struct apmode gfx_apmode[2]; - int gfx_resolution; - int gfx_vresolution; - int color_mode; - - bool immediate_blits; - int waiting_blits; - unsigned int chipset_mask; - bool ntscmode; - double chipset_refreshrate; - struct chipset_refresh cr[MAX_CHIPSET_REFRESH + 2]; - int collision_level; - int leds_on_screen; - int leds_on_screen_mask[2]; - int scsi; - int fast_copper; - int floppy_speed; - int floppy_write_length; - int floppy_auto_ext2; - int cd_speed; - int boot_rom; - int filesys_limit; - int filesys_max_name; - - int cs_compatible; - int cs_ciaatod; - int cs_rtc; - bool cs_ksmirror_e0; - bool cs_ksmirror_a8; - bool cs_ciaoverlay; - bool cs_cd32cd; - bool cs_cd32c2p; - bool cs_cd32nvram; - bool cs_cd32fmv; - int cs_cd32nvram_size; - int cs_ide; - bool cs_pcmcia; - int cs_fatgaryrev; - int cs_ramseyrev; - bool cs_df0idhw; - bool cs_ciatodbug; - bool cs_z3autoconfig; - bool cs_bytecustomwritebug; - int cs_unmapped_space; - int cs_ciatype[2]; - - struct boardromconfig expansionboard[MAX_EXPANSION_BOARDS]; - - TCHAR romfile[MAX_DPATH]; - TCHAR romident[256]; - TCHAR romextfile[MAX_DPATH]; - TCHAR romextident[256]; - TCHAR flashfile[MAX_DPATH]; - TCHAR cartfile[MAX_DPATH]; - TCHAR cartident[256]; - int cart_internal; - struct cdslot cdslots[MAX_TOTAL_SCSI_DEVICES]; - - struct multipath path_floppy; - struct multipath path_hardfile; - struct multipath path_rom; - struct multipath path_cd; - - int m68k_speed; - int cpu_model; - int fpu_model; - bool cpu_compatible; - bool fpu_no_unimplemented; - bool address_space_24; - int picasso96_modeflags; - - uae_u32 z3autoconfig_start; - struct ramboard z3fastmem[MAX_RAM_BOARDS]; - struct ramboard fastmem[MAX_RAM_BOARDS]; - uae_u32 chipmem_size; - uae_u32 bogomem_size; - uae_u32 mbresmem_low_size; - uae_u32 mbresmem_high_size; - struct rtgboardconfig rtgboards[MAX_RTG_BOARDS]; - uae_u32 custom_memory_addrs[MAX_CUSTOM_MEMORY_ADDRS]; - uae_u32 custom_memory_sizes[MAX_CUSTOM_MEMORY_ADDRS]; - uae_u32 custom_memory_mask[MAX_CUSTOM_MEMORY_ADDRS]; - int uaeboard; - int uaeboard_order; - - int z3_mapping_mode; - - int mountitems; - struct uaedev_config_data mountconfig[MOUNT_CONFIG_SIZE]; - - int nr_floppies; - struct floppyslot floppyslots[4]; - bool floppy_read_only; - bool harddrive_read_only; - - /* Target specific options */ - -#ifdef PANDORA - int pandora_cpu_speed; - int pandora_tapDelay; -#endif - -#ifdef RASPBERRY - int gfx_correct_aspect; - int gfx_fullscreen_ratio; - int kbd_led_num; - int kbd_led_scr; - int kbd_led_cap; -#endif - - /* input */ - - struct jport jports[MAX_JPORTS]; - int input_selected_setting; - int input_joymouse_multiplier; - int input_joymouse_deadzone; - int input_joystick_deadzone; - int input_joymouse_speed; - int input_analog_joystick_mult; - int input_analog_joystick_offset; - int input_autofire_linecnt; - int input_mouse_speed; - int input_tablet; - int input_keyboard_type; - - /* ANDROID */ -#ifdef ANDROIDSDL -int onScreen; -int onScreen_textinput; -int onScreen_dpad; -int onScreen_button1; -int onScreen_button2; -int onScreen_button3; -int onScreen_button4; -int onScreen_button5; -int onScreen_button6; -int custom_position; -int pos_x_textinput; -int pos_y_textinput; -int pos_x_dpad; -int pos_y_dpad; -int pos_x_button1; -int pos_y_button1; -int pos_x_button2; -int pos_y_button2; -int pos_x_button3; -int pos_y_button3; -int pos_x_button4; -int pos_y_button4; -int pos_x_button5; -int pos_y_button5; -int pos_x_button6; -int pos_y_button6; -int extfilter; -int quickSwitch; -int floatingJoystick; -int disableMenuVKeyb; -#endif - - struct uae_input_device joystick_settings[MAX_INPUT_SETTINGS][MAX_INPUT_DEVICES]; - struct uae_input_device mouse_settings[MAX_INPUT_SETTINGS][MAX_INPUT_DEVICES]; - struct uae_input_device keyboard_settings[MAX_INPUT_SETTINGS][MAX_INPUT_DEVICES]; - struct uae_input_device internalevent_settings[MAX_INPUT_SETTINGS][INTERNALEVENT_COUNT]; - TCHAR input_config_name[GAMEPORT_INPUT_SETTINGS][256]; -}; - -extern int config_changed; -extern void config_check_vsync (void); -extern void set_config_changed (void); - -extern void cfgfile_write (struct zfile *, const TCHAR *option, const TCHAR *format,...); -extern void cfgfile_dwrite (struct zfile *, const TCHAR *option, const TCHAR *format,...); -extern void cfgfile_target_write (struct zfile *, const TCHAR *option, const TCHAR *format,...); -extern void cfgfile_target_dwrite (struct zfile *, const TCHAR *option, const TCHAR *format,...); - -extern void cfgfile_write_bool (struct zfile *f, const TCHAR *option, bool b); -extern void cfgfile_target_write_bool (struct zfile *f, const TCHAR *option, bool b); -extern void cfgfile_target_dwrite_bool (struct zfile *f, const TCHAR *option, bool b); - -extern void cfgfile_write_str (struct zfile *f, const TCHAR *option, const TCHAR *value); -extern void cfgfile_dwrite_str (struct zfile *f, const TCHAR *option, const TCHAR *value); -extern void cfgfile_target_write_str (struct zfile *f, const TCHAR *option, const TCHAR *value); -extern void cfgfile_target_dwrite_str (struct zfile *f, const TCHAR *option, const TCHAR *value); - -extern struct uaedev_config_data *add_filesys_config (struct uae_prefs *p, int index, struct uaedev_config_info*); -extern void uci_set_defaults (struct uaedev_config_info *uci, bool rdb); - -extern void error_log (const TCHAR*, ...); - -extern void default_prefs (struct uae_prefs *, bool, int); -extern void discard_prefs (struct uae_prefs *, int); -extern void copy_prefs(struct uae_prefs *src, struct uae_prefs *dst); -extern int bip_a500 (struct uae_prefs *p, int rom); -extern int bip_a500plus (struct uae_prefs *p, int rom); -extern int bip_a1200 (struct uae_prefs *p, int rom); -extern int bip_a2000 (struct uae_prefs *p, int rom); -extern int bip_a4000 (struct uae_prefs *p, int rom); -extern int bip_cd32 (struct uae_prefs *p, int rom); - -int parse_cmdline_option (struct uae_prefs *, TCHAR, const TCHAR *); - -extern int cfgfile_separate_linea (const TCHAR *filename, char *line, TCHAR *line1b, TCHAR *line2b); -extern int cfgfile_yesno (const TCHAR *option, const TCHAR *value, const TCHAR *name, bool *location); -extern int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, int scale); -extern int cfgfile_strval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, const TCHAR *table[], int more); -extern int cfgfile_string (const TCHAR *option, const TCHAR *value, const TCHAR *name, TCHAR *location, int maxsz); - -extern TCHAR *target_expand_environment (const TCHAR *path, TCHAR *out, int maxlen); -extern int target_parse_option (struct uae_prefs *, const TCHAR *option, const TCHAR *value); -extern void target_save_options (struct zfile*, struct uae_prefs *); -extern void target_default_options (struct uae_prefs *, int type); -extern void target_fixup_options (struct uae_prefs *); -extern int target_cfgfile_load (struct uae_prefs *, const TCHAR *filename, int type, int isdefault); -extern void cfgfile_resolve_path_out_load(const TCHAR *path, TCHAR *out, int size, int type); -extern void cfgfile_resolve_path_load(TCHAR *path, int size, int type); -extern void cfgfile_resolve_path_out_save(const TCHAR *path, TCHAR *out, int size, int type); - -extern struct uae_prefs *cfgfile_open(const TCHAR *filename, int *type); -extern void cfgfile_close(struct uae_prefs *p); -extern int cfgfile_load (struct uae_prefs *p, const TCHAR *filename, int *type, int userconfig); -extern int cfgfile_save (struct uae_prefs *p, const TCHAR *filename, int); -extern void cfgfile_parse_line (struct uae_prefs *p, TCHAR *, int); -extern int cfgfile_parse_option (struct uae_prefs *p, const TCHAR *option, TCHAR *value, int); -extern int cfgfile_get_description (struct uae_prefs *p, const TCHAR *filename, TCHAR *description, int *type); -extern uae_u32 cfgfile_uaelib (TrapContext *ctx, int mode, uae_u32 name, uae_u32 dst, uae_u32 maxlen); -extern uae_u32 cfgfile_uaelib_modify (TrapContext *ctx, uae_u32 mode, uae_u32 parms, uae_u32 size, uae_u32 out, uae_u32 outsize); -extern void cfgfile_addcfgparam (TCHAR *); -extern int built_in_prefs (struct uae_prefs *p, int model, int config, int compa, int romcheck); -extern int built_in_chipset_prefs (struct uae_prefs *p); -extern void fixup_prefs_dimensions (struct uae_prefs *prefs); -extern void fixup_prefs (struct uae_prefs *prefs, bool userconfig); -extern void fixup_cpu (struct uae_prefs *prefs); -extern void cfgfile_compatibility_romtype(struct uae_prefs *p); -extern bool cfgfile_createconfigstore(struct uae_prefs *p); - -extern void check_prefs_changed_custom (void); -extern void check_prefs_changed_cpu (void); -extern void check_prefs_changed_audio (void); -extern int check_prefs_changed_gfx (void); - -extern struct uae_prefs currprefs, changed_prefs; - -extern int machdep_init (void); -extern void machdep_free (void); - -#endif /* UAE_OPTIONS_H */ diff --git a/src/inputdevice.cpp b/src/inputdevice.cpp index 3498d3a..049d220 100755 --- a/src/inputdevice.cpp +++ b/src/inputdevice.cpp @@ -286,7 +286,7 @@ uae_u8 *save_input (int *len, uae_u8 *dstptr) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = xmalloc (uae_u8, 1000); + dstbak = dst = xmalloc (uae_u8, 32); save_u32 (0); for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { diff --git a/src/jit/compemu_midfunc_armA64_2.cpp b/src/jit/compemu_midfunc_armA64_2.cpp index 3e1827d..520d86f 100644 --- a/src/jit/compemu_midfunc_armA64_2.cpp +++ b/src/jit/compemu_midfunc_armA64_2.cpp @@ -3137,8 +3137,9 @@ MIDFUNC(2,jnf_DIVS,(RW4 d, RR4 s)) int init_regs_used = 0; int targetIsReg; int s_is_d; + uae_s16 tmp; if (isconst(s) && (uae_s16)live.state[s].val != 0) { - uae_s16 tmp = (uae_s16)live.state[s].val; + tmp = (uae_s16)live.state[s].val; d = rmw(d); SIGNED16_IMM_2_REG(REG_WORK3, tmp); } else { @@ -3173,7 +3174,10 @@ MIDFUNC(2,jnf_DIVS,(RW4 d, RR4 s)) BNE_i(8); // overflow -> end_of_op // Here we have to calc remainder - SIGNED16_REG_2_REG(REG_WORK3, s); + if (init_regs_used) + SIGNED16_REG_2_REG(REG_WORK3, s); + else + SIGNED16_IMM_2_REG(REG_WORK3, tmp); MSUB_wwww(REG_WORK2, REG_WORK1, REG_WORK3, d); // REG_WORK2 contains remainder EOR_www(REG_WORK3, REG_WORK2, d); // If sign of remainder and first operand differs, change sign of remainder @@ -3199,8 +3203,9 @@ MIDFUNC(2,jff_DIVS,(RW4 d, RR4 s)) int init_regs_used = 0; int targetIsReg; int s_is_d; + uae_s16 tmp; if (isconst(s) && (uae_s16)live.state[s].val != 0) { - uae_s16 tmp = (uae_s16)live.state[s].val; + tmp = (uae_s16)live.state[s].val; d = rmw(d); SIGNED16_IMM_2_REG(REG_WORK3, tmp); } else { @@ -3259,7 +3264,10 @@ MIDFUNC(2,jff_DIVS,(RW4 d, RR4 s)) TST_ww(REG_WORK2, REG_WORK2); // N and Z ok, C and V cleared // calc remainder - SIGNED16_REG_2_REG(REG_WORK3, s); + if (init_regs_used) + SIGNED16_REG_2_REG(REG_WORK3, s); + else + SIGNED16_IMM_2_REG(REG_WORK3, tmp); MSUB_wwww(REG_WORK2, REG_WORK1, REG_WORK3, d); // REG_WORK2 contains remainder EOR_www(REG_WORK3, REG_WORK2, d); // If sign of remainder and first operand differs, change sign of remainder @@ -3402,7 +3410,7 @@ MIDFUNC(3,jff_DIVLS32,(RW4 d, RR4 s1, W4 rem)) MOV_ww(d, REG_WORK1); TST_ww(d, d); - + // end_of_op flags_carry_inverted = false; diff --git a/src/newcpu.cpp b/src/newcpu.cpp index fffd738..aec3bb0 100755 --- a/src/newcpu.cpp +++ b/src/newcpu.cpp @@ -2871,7 +2871,7 @@ void m68k_go (int may_quit) uae_u8 *restore_cpu (uae_u8 *src) { - int flags, model; + uae_u32 flags, model; uae_u32 l; currprefs.cpu_model = changed_prefs.cpu_model = model = restore_u32 (); @@ -2927,7 +2927,9 @@ uae_u8 *restore_cpu (uae_u8 *src) } if (flags & 0x80000000) { int khz = restore_u32(); - if (khz > 0 && khz < 800000) + if (khz < 0) + currprefs.m68k_speed = changed_prefs.m68k_speed = -1; + else if (khz > 0 && khz < 800000) currprefs.m68k_speed = changed_prefs.m68k_speed = 0; } set_cpu_caches(true); @@ -3110,7 +3112,7 @@ uae_u8 *save_cpu_extra (int *len, uae_u8 *dstptr) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = xmalloc (uae_u8, 1000); + dstbak = dst = xmalloc (uae_u8, 16); flags = 0; flags |= currprefs.cpu_cycle_exact ? 1 : 0; flags |= currprefs.cpu_compatible ? 2 : 0; @@ -3129,6 +3131,7 @@ uae_u8 *save_cpu (int *len, uae_u8 *dstptr) { uae_u8 *dstbak,*dst; int model, khz; + uae_u32 flags; if (dstptr) dstbak = dst = dstptr; @@ -3136,7 +3139,8 @@ uae_u8 *save_cpu (int *len, uae_u8 *dstptr) dstbak = dst = xmalloc (uae_u8, 1000); model = currprefs.cpu_model; save_u32 (model); /* MODEL */ - save_u32(0x80000000 | 0x40000000 | 0x20000000 | 0x10000000 | 0x8000000 | 0x4000000 | 0x2000000 | (currprefs.address_space_24 ? 1 : 0)); /* FLAGS */ + flags = 0x80000000 | 0x40000000 | 0x20000000 | 0x10000000 | 0x8000000 | 0x4000000 | (currprefs.cpu_model <= 68010 ? 0x2000000 : 0) | (currprefs.address_space_24 ? 1 : 0); + save_u32(flags); /* FLAGS */ for(int i = 0;i < 15; i++) save_u32 (regs.regs[i]); /* D0-D7 A0-A6 */ save_u32 (m68k_getpc ()); /* PC */