init_comm_pipe (&requests, 100, 1);
uae_start_thread (_T("akiko"), akiko_thread, 0, NULL);
}
+ gui_flicker_led (LED_HD, 0, -1);
akiko_inited = true;
return 1;
}
cdtv_battram_reset ();
open_unit ();
+ gui_flicker_led (LED_CD, 0, -1);
}
void cdtv_check_banks (void)
cfgfile_write_str (f, _T("kickstart_ext_rom="), p->romextident);
cfgfile_write_path (f, &p->path_rom, _T("flash_file"), p->flashfile);
cfgfile_write_path (f, &p->path_rom, _T("cart_file"), p->cartfile);
+ cfgfile_write_path (f, &p->path_rom, _T("rtc_file"), p->rtcfile);
if (p->cartident[0])
cfgfile_write_str (f, _T("cart"), p->cartident);
if (p->amaxromfile[0])
cfgfile_write_str (f, _T("gfx_colour_mode"), colormode1[p->color_mode]);
cfgfile_write_bool (f, _T("gfx_blacker_than_black"), p->gfx_blackerthanblack);
cfgfile_write_str (f, _T("gfx_api"), filterapi[p->gfx_api]);
+ cfgfile_dwrite (f, _T("gfx_horizontal_tweak"), _T("%d"), p->gfx_extrawidth);
#ifdef GFXFILTER
if (p->gfx_filtershader[0] && p->gfx_api) {
|| cfgfile_intval (option, value, _T("gfx_contrast"), &p->gfx_contrast, 1)
|| cfgfile_intval (option, value, _T("gfx_gamma"), &p->gfx_gamma, 1)
|| cfgfile_intval (option, value, _T("gfx_filter_keep_autoscale_aspect"), &p->gfx_filter_keep_autoscale_aspect, 1)
+ || cfgfile_intval (option, value, _T("gfx_horizontal_tweak"), &p->gfx_extrawidth, 1)
|| cfgfile_string (option, value, _T("gfx_filter_mask"), p->gfx_filtermask, sizeof p->gfx_filtermask / sizeof (TCHAR))
|| cfgfile_intval (option, value, _T("filesys_max_size"), &p->filesys_limit, 1)
|| cfgfile_yesno (option, value, _T("filesys_no_fsdb"), &p->filesys_no_uaefsdb)
|| cfgfile_yesno (option, value, _T("gfx_blacker_than_black"), &p->gfx_blackerthanblack)
|| cfgfile_yesno (option, value, _T("gfx_flickerfixer"), &p->gfx_scandoubler)
- || cfgfile_yesno (option, value, _T("synchronize_clock"), &p->tod_hack)
|| cfgfile_yesno (option, value, _T("magic_mouse"), &p->input_magic_mouse)
|| cfgfile_yesno (option, value, _T("warp"), &p->turbo_emulation)
|| cfgfile_yesno (option, value, _T("headless"), &p->headless)
|| cfgfile_yesno (option, value, _T("fastmem_autoconfig"), &p->fastmem_autoconfig)
|| cfgfile_yesno (option, value, _T("gfxcard_hardware_vblank"), &p->rtg_hardwareinterrupt)
|| cfgfile_yesno (option, value, _T("gfxcard_hardware_sprite"), &p->rtg_hardwaresprite)
+ || cfgfile_yesno (option, value, _T("synchronize_clock"), &p->tod_hack)
|| cfgfile_yesno (option, value, _T("kickshifter"), &p->kickshifter)
|| cfgfile_yesno (option, value, _T("ntsc"), &p->ntscmode)
return 1;
if (cfgfile_strval (option, value, _T("comp_trustbyte"), &p->comptrustbyte, compmode, 0)
- || cfgfile_strval (option, value, _T("chipset_compatible"), &p->cs_compatible, cscompa, 0)
|| cfgfile_strval (option, value, _T("rtc"), &p->cs_rtc, rtctype, 0)
|| cfgfile_strval (option, value, _T("ciaatod"), &p->cs_ciaatod, ciaatodmode, 0)
|| cfgfile_strval (option, value, _T("ide"), &p->cs_ide, idemode, 0)
|| cfgfile_path (option, value, _T("amax_rom_file"), p->amaxromfile, sizeof p->amaxromfile / sizeof (TCHAR))
|| cfgfile_path (option, value, _T("flash_file"), p->flashfile, sizeof p->flashfile / sizeof (TCHAR), &p->path_rom)
|| cfgfile_path (option, value, _T("cart_file"), p->cartfile, sizeof p->cartfile / sizeof (TCHAR), &p->path_rom)
+ || cfgfile_path (option, value, _T("rtc_file"), p->rtcfile, sizeof p->rtcfile / sizeof (TCHAR), &p->path_rom)
|| cfgfile_string (option, value, _T("pci_devices"), p->pci_devices, sizeof p->pci_devices / sizeof (TCHAR))
|| cfgfile_string (option, value, _T("ghostscript_parameters"), p->ghostscript_parameters, sizeof p->ghostscript_parameters / sizeof (TCHAR)))
return 1;
+ if (cfgfile_strval (option, value, _T("chipset_compatible"), &p->cs_compatible, cscompa, 0)) {
+ built_in_chipset_prefs (p);
+ return 1;
+ }
+
+
if (cfgfile_strval (option, value, _T("cart_internal"), &p->cart_internal, cartsmode, 0)) {
if (p->cart_internal) {
struct romdata *rd = getromdatabyid (63);
p->romextfile2addr = 0;
_tcscpy (p->flashfile, _T(""));
_tcscpy (p->cartfile, _T(""));
+ _tcscpy (p->rtcfile, _T(""));
_tcscpy (p->path_rom.path[0], _T("./"));
_tcscpy (p->path_floppy.path[0], _T("./"));
_tcscpy (p->romextfile, _T(""));
_tcscpy (p->flashfile, _T(""));
_tcscpy (p->cartfile, _T(""));
+ _tcscpy (p->rtcfile, _T(""));
_tcscpy (p->amaxromfile, _T(""));
p->prtname[0] = 0;
p->sername[0] = 0;
#include "sampler.h"
#include "dongle.h"
#include "inputrecord.h"
+#include "autoconf.h"
#define CIAA_DEBUG_R 0
#define CIAA_DEBUG_W 0
#define CIAB_DEBUG_W 0
#define DONGLE_DEBUG 0
#define KB_DEBUG 0
+#define CLOCK_DEBUG 0
#define TOD_HACK
static uae_u8 serbits;
static int warned = 10;
+static int rtc_delayed_write;
+
static void setclr (unsigned int *p, unsigned int val)
{
#ifdef TOD_HACK
static uae_u64 tod_hack_tv, tod_hack_tod, tod_hack_tod_last;
static int tod_hack_enabled;
+#define TOD_HACK_TIME 312 * 50 * 10
static void tod_hack_reset (void)
{
struct timeval tv;
}
#endif
+static int heartbeat_cnt;
+void cia_heartbeat (void)
+{
+ heartbeat_cnt = 10;
+}
+
static void do_tod_hack (int dotod)
{
struct timeval tv;
if (tod_hack_enabled == 0)
return;
+ if (!heartbeat_cnt) {
+ if (tod_hack_enabled > 0)
+ tod_hack_enabled = -1;
+ return;
+ }
+ if (tod_hack_enabled < 0) {
+ tod_hack_enabled = TOD_HACK_TIME;
+ return;
+ }
if (tod_hack_enabled > 1) {
tod_hack_enabled--;
if (tod_hack_enabled == 1) {
led_cycle = get_cycles ();
}
+static void write_battclock (void);
void CIA_vsync_prehandler (void)
{
+ if (rtc_delayed_write < 0) {
+ rtc_delayed_write = 50;
+ } else if (rtc_delayed_write > 0) {
+ rtc_delayed_write--;
+ if (rtc_delayed_write == 0)
+ write_battclock ();
+ }
led_vsync ();
CIA_handler ();
if (kblostsynccnt > 0) {
void CIA_vsync_posthandler (bool dotod)
{
+ if (heartbeat_cnt > 0)
+ heartbeat_cnt--;
#ifdef TOD_HACK
if (currprefs.tod_hack && tod_hack_enabled == 1)
return;
tod_hack_tod = 0;
tod_hack_enabled = 0;
if (currprefs.tod_hack)
- tod_hack_enabled = 312 * 50 * 10;
+ tod_hack_enabled = TOD_HACK_TIME;
#endif
kblostsynccnt = 0;
oldcd32mute = 1;
oldled = true;
resetwarning_phase = resetwarning_timer = 0;
+ heartbeat_cnt = 0;
if (!savestate_state) {
oldovl = true;
// Gayle or Fat Gary does not enable CIA /CS lines if both CIAs are selected
// Old Gary based Amigas enable both CIAs in this situation
-STATIC_INLINE int issinglecia (void)
+STATIC_INLINE bool issinglecia (void)
{
return currprefs.cs_ide || currprefs.cs_pcmcia || currprefs.cs_mbdmac;
}
+STATIC_INLINE bool isgayle (void)
+{
+ return currprefs.cs_ide || currprefs.cs_pcmcia;
+}
static void cia_wait_pre (void)
{
}
}
+static bool isgaylenocia (uaecptr addr)
+{
+ // gayle CIA region is only 4096 bytes at 0xbfd000 and 0xbfe000
+ if (!isgayle ())
+ return true;
+ uaecptr mask = addr & 0xf000;
+ bool cia = mask == 0xe000 || mask == 0xd000;
+ return cia;
+}
+
static uae_u32 REGPARAM2 cia_bget (uaecptr addr)
{
int r = (addr & 0xf00) >> 8;
- uae_u8 v;
-
+ uae_u8 v = 0xff;
#ifdef JIT
special_mem |= S_READ;
#endif
+
+ if (!isgaylenocia (addr))
+ return v;
+
cia_wait_pre ();
- v = 0xff;
switch ((addr >> 12) & 3) {
case 0:
if (!issinglecia ())
static uae_u32 REGPARAM2 cia_wget (uaecptr addr)
{
int r = (addr & 0xf00) >> 8;
- uae_u16 v;
+ uae_u16 v = 0xffff;
#ifdef JIT
special_mem |= S_READ;
#endif
+
+ if (!isgaylenocia (addr))
+ return 0xffffffff;
+
cia_wait_pre ();
- v = 0xffff;
switch ((addr >> 12) & 3)
{
case 0:
#ifdef JIT
special_mem |= S_WRITE;
#endif
+
+ if (!isgaylenocia (addr))
+ return;
+
cia_wait_pre ();
if (!issinglecia () || (addr & 0x3000) != 0) {
if ((addr & 0x2000) == 0)
#ifdef JIT
special_mem |= S_WRITE;
#endif
+
+ if (!isgaylenocia (addr))
+ return;
+
cia_wait_pre ();
if (!issinglecia () || (addr & 0x3000) != 0) {
if ((addr & 0x2000) == 0)
#define RF5C01A_RAM_SIZE 16
static uae_u8 rtc_memory[RF5C01A_RAM_SIZE], rtc_alarm[RF5C01A_RAM_SIZE];
+static uae_u8 getclockreg (int addr, struct tm *ct)
+{
+ uae_u8 v = 0;
+
+ if (currprefs.cs_rtc == 1) { /* MSM6242B */
+ switch (addr) {
+ case 0x0: v = ct->tm_sec % 10; break;
+ case 0x1: v = ct->tm_sec / 10; break;
+ case 0x2: v = ct->tm_min % 10; break;
+ case 0x3: v = ct->tm_min / 10; break;
+ case 0x4: v = ct->tm_hour % 10; break;
+ case 0x5:
+ if (clock_control_f & 4) {
+ v = ct->tm_hour / 10; // 24h
+ } else {
+ v = (ct->tm_hour % 12) / 10; // 12h
+ v |= ct->tm_hour >= 12 ? 4 : 0; // AM/PM bit
+ }
+ break;
+ case 0x6: v = ct->tm_mday % 10; break;
+ case 0x7: v = ct->tm_mday / 10; break;
+ case 0x8: v = (ct->tm_mon + 1) % 10; break;
+ case 0x9: v = (ct->tm_mon + 1) / 10; break;
+ case 0xA: v = ct->tm_year % 10; break;
+ case 0xB: v = (ct->tm_year / 10) & 0x0f; break;
+ case 0xC: v = ct->tm_wday; break;
+ case 0xD: v = clock_control_d; break;
+ case 0xE: v = clock_control_e; break;
+ case 0xF: v = clock_control_f; break;
+ }
+ } else if (currprefs.cs_rtc == 2) { /* RF5C01A */
+ int bank = clock_control_d & 3;
+ /* memory access */
+ if (bank >= 2 && addr < 0x0d)
+ return (rtc_memory[addr] >> ((bank == 2) ? 0 : 4)) & 0x0f;
+ /* alarm */
+ if (bank == 1 && addr < 0x0d) {
+ v = rtc_alarm[addr];
+#if CLOCK_DEBUG
+ write_log (_T("CLOCK ALARM R %X: %X\n"), addr, v);
+#endif
+ return v;
+ }
+ switch (addr) {
+ case 0x0: v = ct->tm_sec % 10; break;
+ case 0x1: v = ct->tm_sec / 10; break;
+ case 0x2: v = ct->tm_min % 10; break;
+ case 0x3: v = ct->tm_min / 10; break;
+ case 0x4: v = ct->tm_hour % 10; break;
+ case 0x5:
+ if (rtc_alarm[10] & 1)
+ v = ct->tm_hour / 10; // 24h
+ else
+ v = ((ct->tm_hour % 12) / 10) | (ct->tm_hour >= 12 ? 2 : 0); // 12h
+ break;
+ case 0x6: v = ct->tm_wday; break;
+ case 0x7: v = ct->tm_mday % 10; break;
+ case 0x8: v = ct->tm_mday / 10; break;
+ case 0x9: v = (ct->tm_mon + 1) % 10; break;
+ case 0xA: v = (ct->tm_mon + 1) / 10; break;
+ case 0xB: v = (ct->tm_year % 100) % 10; break;
+ case 0xC: v = (ct->tm_year % 100) / 10; break;
+ case 0xD: v = clock_control_d; break;
+ /* E and F = write-only, reads as zero */
+ case 0xE: v = 0; break;
+ case 0xF: v = 0; break;
+ }
+ }
+#if CLOCK_DEBUG
+ write_log(_T("CLOCK R: %X = %X, PC=%08x\n"), addr, v, M68K_GETPC);
+#endif
+ return v;
+}
+
static void write_battclock (void)
{
- struct zfile *f = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL);
- if (!f) {
- f = zfile_fopen (currprefs.flashfile, _T("wb"), 0);
- if (f) {
- zfile_fwrite (rtc_memory, RF5C01A_RAM_SIZE, 1, f);
+ if (!currprefs.rtcfile[0] || currprefs.cs_rtc == 0)
+ return;
+ struct zfile *f = zfile_fopen (currprefs.rtcfile, _T("wb"));
+ if (f) {
+ uae_u8 zero[13] = { 0 };
+ struct tm *ct;
+ time_t t = time (0);
+ t += currprefs.cs_rtc_adjust;
+ ct = localtime (&t);
+ uae_u8 od = clock_control_d;
+ if (currprefs.cs_rtc == 2)
+ clock_control_d &= ~3;
+ for (int i = 0; i < 13; i++) {
+ uae_u8 v = getclockreg (i, ct);
+ zfile_fwrite (&v, 1, 1, f);
+ }
+ clock_control_d = od;
+ zfile_fwrite (&clock_control_d, 1, 1, f);
+ zfile_fwrite (&clock_control_e, 1, 1, f);
+ zfile_fwrite (&clock_control_f, 1, 1, f);
+ if (currprefs.cs_rtc == 2) {
zfile_fwrite (rtc_alarm, RF5C01A_RAM_SIZE, 1, f);
- zfile_fclose (f);
+ zfile_fwrite (rtc_memory, RF5C01A_RAM_SIZE, 1, f);
}
- return;
- }
- zfile_fseek (f, 0, SEEK_END);
- if (zfile_ftell (f) <= 2 * RF5C01A_RAM_SIZE) {
- zfile_fseek (f, 0, SEEK_SET);
- zfile_fwrite (rtc_memory, RF5C01A_RAM_SIZE, 1, f);
- zfile_fwrite (rtc_alarm, RF5C01A_RAM_SIZE, 1, f);
+ zfile_fclose (f);
}
- zfile_fclose (f);
}
void rtc_hardreset (void)
{
+ rtc_delayed_write = 0;
if (currprefs.cs_rtc == 1) { /* MSM6242B */
clock_bank.name = _T("Battery backed up clock (MSM6242B)");
clock_control_d = 0x1;
clock_control_f = 0x4; /* 24/12 */
} else if (currprefs.cs_rtc == 2) { /* RF5C01A */
clock_bank.name = _T("Battery backed up clock (RF5C01A)");
- clock_control_d = 0x4; /* Timer EN */
+ clock_control_d = 0x8; /* Timer EN */
clock_control_e = 0;
clock_control_f = 0;
memset (rtc_memory, 0, RF5C01A_RAM_SIZE);
memset (rtc_alarm, 0, RF5C01A_RAM_SIZE);
-#if 0
- struct zfile *f;
- f = zfile_fopen (currprefs.flashfile, "rb", ZFD_NORMAL);
+ rtc_alarm[10] = 1; /* 24H mode */
+ }
+ if (currprefs.rtcfile[0]) {
+ struct zfile *f = zfile_fopen (currprefs.rtcfile, _T("rb"));
if (f) {
- zfile_fread (rtc_memory, RF5C01A_RAM_SIZE, 1, f);
+ uae_u8 empty[13];
+ zfile_fread (empty, 13, 1, f);
+ zfile_fread (&clock_control_d, 1, 1, f);
+ zfile_fread (&clock_control_e, 1, 1, f);
+ zfile_fread (&clock_control_f, 1, 1, f);
zfile_fread (rtc_alarm, RF5C01A_RAM_SIZE, 1, f);
+ zfile_fread (rtc_memory, RF5C01A_RAM_SIZE, 1, f);
zfile_fclose (f);
}
-#endif
}
}
-static uae_u8 tobcd (int val)
-{
- return (val / 10) * 16 + (val % 10);
-}
-
static uae_u32 REGPARAM2 clock_lget (uaecptr addr)
{
return (clock_wget (addr) << 16) | clock_wget (addr + 2);
{
time_t t;
struct tm *ct;
+ uae_u8 v = 0;
#ifdef JIT
special_mem |= S_READ;
#endif
-// write_log(_T("R: %x (%x), PC=%08x\n"), addr, (addr & 0xff) >> 2, M68K_GETPC);
#ifdef CDTV
if (currprefs.cs_cdtvram && addr >= 0xdc8000)
return cdtv_battram_read (addr);
#endif
addr &= 0x3f;
if ((addr & 3) == 2 || (addr & 3) == 0 || currprefs.cs_rtc == 0) {
- int v = 0;
if (currprefs.cpu_model == 68000 && currprefs.cpu_compatible)
v = regs.irc >> 8;
return v;
t += currprefs.cs_rtc_adjust;
ct = localtime (&t);
addr >>= 2;
- if (currprefs.cs_rtc == 1) { /* MSM6242B */
- switch (addr) {
- case 0x0: return ct->tm_sec % 10;
- case 0x1: return ct->tm_sec / 10;
- case 0x2: return ct->tm_min % 10;
- case 0x3: return ct->tm_min / 10;
- case 0x4: return ct->tm_hour % 10;
- case 0x5: return ct->tm_hour / 10;
- case 0x6: return ct->tm_mday % 10;
- case 0x7: return ct->tm_mday / 10;
- case 0x8: return (ct->tm_mon + 1) % 10;
- case 0x9: return (ct->tm_mon + 1) / 10;
- case 0xA: return ct->tm_year % 10;
- case 0xB: return tobcd (ct->tm_year / 10);
- case 0xC: return ct->tm_wday;
- case 0xD: return clock_control_d;
- case 0xE: return clock_control_e;
- case 0xF: return clock_control_f;
- }
- } else if (currprefs.cs_rtc == 2) { /* RF5C01A */
- int bank = clock_control_d & 3;
- /* memory access */
- if (bank >= 2 && addr < 0x0d)
- return (rtc_memory[addr] >> ((bank == 2) ? 0 : 4)) & 0x0f;
- /* alarm */
- if (bank == 1 && addr < 0x0d)
- return rtc_alarm[addr];
- switch (addr) {
- case 0x0: return ct->tm_sec % 10;
- case 0x1: return ct->tm_sec / 10;
- case 0x2: return ct->tm_min % 10;
- case 0x3: return ct->tm_min / 10;
- case 0x4: return ct->tm_hour % 10;
- case 0x5: return ct->tm_hour / 10;
- case 0x6: return ct->tm_wday;
- case 0x7: return ct->tm_mday % 10;
- case 0x8: return ct->tm_mday / 10;
- case 0x9: return (ct->tm_mon + 1) % 10;
- case 0xA: return (ct->tm_mon + 1) / 10;
- case 0xB: return ct->tm_year % 10;
- case 0xC: return tobcd (ct->tm_year / 10);
- case 0xD: return clock_control_d;
- /* E and F = write-only */
- }
- }
- return 0;
+ return getclockreg (addr, ct);
}
static void REGPARAM2 clock_lput (uaecptr addr, uae_u32 value)
addr >>= 2;
value &= 0x0f;
if (currprefs.cs_rtc == 1) { /* MSM6242B */
+#if CLOCK_DEBUG
+ write_log (_T("CLOCK W %X: %X\n"), addr, value);
+#endif
switch (addr)
{
case 0xD: clock_control_d = value & (1|8); break;
int bank = clock_control_d & 3;
/* memory access */
if (bank >= 2 && addr < 0x0d) {
+ uae_u8 ov = rtc_memory[addr];
rtc_memory[addr] &= ((bank == 2) ? 0xf0 : 0x0f);
rtc_memory[addr] |= value << ((bank == 2) ? 0 : 4);
-#if 0
- uae_u8 ov = rtc_memory[addr];
if (rtc_memory[addr] != ov)
- write_battclock ();
-#endif
+ rtc_delayed_write = -1;
return;
}
/* alarm */
if (bank == 1 && addr < 0x0d) {
+#if CLOCK_DEBUG
+ write_log (_T("CLOCK ALARM W %X: %X\n"), addr, value);
+#endif
+ uae_u8 ov = rtc_alarm[addr];
rtc_alarm[addr] = value;
rtc_alarm[0] = rtc_alarm[1] = rtc_alarm[9] = rtc_alarm[12] = 0;
rtc_alarm[3] &= ~0x8;
rtc_alarm[8] &= ~0xc;
rtc_alarm[10] &= ~0xe;
rtc_alarm[11] &= ~0xc;
-#if 0
- uae_u8 ov = rtc_alarm[addr];
- if (rtc_alarm[addr] != value)
- write_battclock ();
-#endif
+ if (rtc_alarm[addr] != ov)
+ rtc_delayed_write = -1;
return;
}
+#if CLOCK_DEBUG
+ write_log (_T("CLOCK W %X: %X\n"), addr, value);
+#endif
switch (addr)
{
case 0xD: clock_control_d = value; break;
case 0xF: clock_control_f = value; break;
}
}
-
+ rtc_delayed_write = -1;
}
#ifdef SAVESTATE
} else {
gfxvidinfo.drawbuffer.inwidth = AMIGA_WIDTH_MAX << currprefs.gfx_resolution;
- gfxvidinfo.drawbuffer.extrawidth = 8;
+ gfxvidinfo.drawbuffer.extrawidth = currprefs.gfx_extrawidth ? currprefs.gfx_extrawidth : -1;
gfxvidinfo.drawbuffer.inwidth2 = gfxvidinfo.drawbuffer.inwidth;
gfxvidinfo.drawbuffer.inheight = (maxvpos_nom - minfirstline + 1) << currprefs.gfx_vresolution;
gfxvidinfo.drawbuffer.inheight2 = gfxvidinfo.drawbuffer.inheight;
}
} else if (gfxvidinfo.drawbuffer.extrawidth) {
visible_left_border = max_diwlastword - w;
- visible_left_border += gfxvidinfo.drawbuffer.extrawidth << currprefs.gfx_resolution;
+ if (gfxvidinfo.drawbuffer.extrawidth > 0)
+ visible_left_border += gfxvidinfo.drawbuffer.extrawidth << currprefs.gfx_resolution;
} else {
if (gfxvidinfo.drawbuffer.inxoffset < 0) {
visible_left_border = 0;
}
}
-
if (visible_left_border > max_diwlastword - 32)
visible_left_border = max_diwlastword - 32;
if (visible_left_border < 0)
} else {
get_new_device (type, parmpacket, &cdname, &cdname_amiga, cd_unit_no);
}
+ gui_flicker_led (LED_CD, cd_unit_no, -1);
write_log (_T("Mounting uaescsi.device %d: (%d)\n"), cd_unit_no, unit_no);
put_long (parmpacket + 0, cdname_amiga);
} else {
+ gui_flicker_led (LED_HD, unit_no, -1);
type = is_hardfile (unit_no);
if (type == FILESYS_HARDFILE_RDB || type == FILESYS_HARDDRIVE) {
/* RDB hardfile */
return 1;
}
+extern void cia_heartbeat (void);
void filesys_vsync (void)
{
Unit *u;
+ if (!uae_boot_rom)
+ return;
if (heartbeat == get_long (rtarea_base + RTAREA_HEARTBEAT)) {
if (heartbeat_count > 0)
heartbeat_count--;
return;
}
heartbeat = get_long (rtarea_base + RTAREA_HEARTBEAT);
+ cia_heartbeat ();
for (u = units; u; u = u->next) {
if (u->reinsertdelay > 0) {
ide->status = 0;
ide->data_offset = 0;
ide->data_size = 0;
+ gui_flicker_led (LED_HD, ch, -1);
return ide;
}
bool drive_writing[4]; /* drive is writing */
bool drive_disabled[4]; /* drive is disabled */
bool powerled; /* state of power led */
- uae_u8 powerled_brightness; /* 0 to 255 */
- uae_u8 drive_side; /* floppy side */
- uae_u8 hd; /* harddrive */
- uae_u8 cd; /* CD */
- uae_u8 md; /* CD32 or CDTV internal storage */
+ uae_s8 powerled_brightness; /* 0 to 255 */
+ uae_s8 drive_side; /* floppy side */
+ uae_s8 hd; /* harddrive */
+ uae_s8 cd; /* CD */
+ uae_s8 md; /* CD32 or CDTV internal storage */
int fps, idle;
int fps_color;
int sndbuf, sndbuf_status;
bool gfx_blackerthanblack;
int gfx_api;
int color_mode;
+ int gfx_extrawidth;
int gfx_filter;
TCHAR gfx_filtershader[MAX_DPATH];
TCHAR romextfile2[MAX_DPATH];
TCHAR romextident[256];
TCHAR flashfile[MAX_DPATH];
+ TCHAR rtcfile[MAX_DPATH];
TCHAR cartfile[MAX_DPATH];
TCHAR cartident[256];
int cart_internal;
TCHAR win32_parjoyport0[MAX_DPATH];
TCHAR win32_parjoyport1[MAX_DPATH];
TCHAR win32_guipage[32];
+ TCHAR win32_guiactivepage[32];
bool win32_filesystem_mangle_reserved_names;
int statecapturerate, statecapturebuffersize;
extern void target_addtorecent (const TCHAR*, int);
extern void target_run (void);
extern void target_quit (void);
+extern void target_restart (void);
extern bool get_plugin_path (TCHAR *out, int size, const TCHAR *path);
extern void stripslashes (TCHAR *p);
extern void fixtrailing (TCHAR *p);
if (p->tod_hack && p->cs_ciaatod == 0)
p->cs_ciaatod = p->ntscmode ? 2 : 1;
+ built_in_chipset_prefs (p);
blkdev_fix_prefs (p);
-
target_fixup_options (p);
}
default_config = 0;
if (cfgfile)
_tcscpy (restart_config, cfgfile);
+ target_restart ();
}
#ifndef DONT_PARSE_CMDLINE
}
}
+ memset (&gui_data, 0, sizeof gui_data);
+ gui_data.cd = -1;
+ gui_data.hd = -1;
logging_init (); /* Yes, we call this twice - the first case handles when the user has loaded
a config using the cmd-line. This case handles loads through the GUI. */
return;
disabledleds = 0;
for (i = 0; i < 3; i++) {
- if (currprefs.keyboard_leds[i] == num + 1) {
- newleds &= ~(1 << i);
- if (state)
- newleds |= 1 << i;
- } else if (currprefs.keyboard_leds[i] <= 0) {
- disabledleds |= 1 << i;
+ if (state >= 0) {
+ if (currprefs.keyboard_leds[i] == num + 1) {
+ newleds &= ~(1 << i);
+ if (state)
+ newleds |= 1 << i;
+ } else if (currprefs.keyboard_leds[i] <= 0) {
+ disabledleds |= 1 << i;
+ }
}
}
}
lgLcdUpdateBitmap (device, lbh, LGLCD_PRIORITY_IDLE_NO_SHOW);
return;
}
+ if (on < 0)
+ return;
if (led >= 1 && led <= 4) {
x = 23 + (led - 1) * 40;
#define IDC_CARTCHOOSER 1399
#define IDC_SAVE 1400
#define IDC_LOAD 1401
+#define IDC_FLASHCHOOSER2 1401
+#define IDC_RTCCHOOSER 1401
#define IDC_DELETE 1403
#define IDC_CONFIGLIST 1404
#define IDC_EDITNAME 1405
#define IDC_QUICKLOAD 1409
#define IDC_EXIT 1410
#define IDC_EDITPATH 1410
+#define IDC_RTCFILE 1411
#define IDC_HDF_RDB 1500
#define IDC_HFSIZE 1501
#define IDC_HF_SIZE 1501
#define IDC_NOFLAGS 1581
#define IDC_SOUNDDRIVEVOLUME2 1581
#define IDC_CS_CACHE_TEXT 1582
-#define IDC_SOUNDVOLUME3 1582
#define IDC_SOUNDVOLUMECD2 1582
#define IDC_CS_CACHE_TEXT2 1583
#define IDC_COLLISIONS 1584
// Dialog\r
//\r
\r
-IDD_KICKSTART DIALOGEX 0, 0, 396, 195\r
+IDD_KICKSTART DIALOGEX 0, 0, 396, 217\r
STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD\r
EXSTYLE WS_EX_CONTEXTHELP\r
FONT 8, "MS Sans Serif", 0, 0, 0x1\r
BEGIN\r
- GROUPBOX "System ROM Settings",-1,1,0,394,93\r
+ GROUPBOX "System ROM Settings",IDC_STATIC,1,0,394,93\r
LTEXT "Main ROM file:",IDC_ROMTEXT,14,13,263,10\r
COMBOBOX IDC_ROMFILE,12,26,361,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP\r
PUSHBUTTON "...",IDC_KICKCHOOSER,376,25,10,15\r
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,87,77,104,12\r
CONTROL "ShapeShifter support [] Patches the system ROM for ShapeShifter compatibility.",IDC_KICKSHIFTER,\r
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,195,77,106,13\r
- GROUPBOX "Miscellaneous",-1,1,98,394,90\r
+ GROUPBOX "Miscellaneous",IDC_STATIC,1,98,394,116\r
LTEXT "Cartridge ROM file:",IDC_FLASHTEXT2,12,112,265,10\r
COMBOBOX IDC_CARTFILE,12,125,361,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP\r
PUSHBUTTON "...",IDC_CARTCHOOSER,376,124,10,15\r
LTEXT "Flash RAM file:",IDC_FLASHTEXT,12,144,265,10\r
EDITTEXT IDC_FLASHFILE,12,157,361,12,ES_AUTOHSCROLL\r
PUSHBUTTON "...",IDC_FLASHCHOOSER,376,156,10,15\r
+ LTEXT "Real Time Clock file",IDC_STATIC,12,174,313,15,SS_CENTERIMAGE\r
+ EDITTEXT IDC_RTCFILE,12,191,361,12,ES_AUTOHSCROLL\r
+ PUSHBUTTON "...",IDC_RTCCHOOSER,376,189,10,15\r
END\r
\r
IDD_DISPLAY DIALOGEX 0, 0, 396, 272\r
BEGIN\r
IDD_KICKSTART, DIALOG\r
BEGIN\r
+ BOTTOMMARGIN, 214\r
END\r
\r
IDD_DISPLAY, DIALOG\r
return;
if (led < 0 || led > 4)
return;
+ if (onoff < 0)
+ return;
switch (led)
{
case 0:
cfgfile_target_dwrite_str (f, _T("parjoyport0"), p->win32_parjoyport0);
cfgfile_target_dwrite_str (f, _T("parjoyport1"), p->win32_parjoyport1);
cfgfile_target_dwrite_str (f, _T("gui_page"), p->win32_guipage);
+ cfgfile_target_dwrite_str (f, _T("gui_active_page"), p->win32_guiactivepage);
cfgfile_target_dwrite_bool (f, _T("filesystem_mangle_reserved_names"), p->win32_filesystem_mangle_reserved_names);
}
+void target_restart (void)
+{
+ gui_restart ();
+}
+
static int fetchpri (int pri, int defpri)
{
int i = 0;
|| cfgfile_string (option, value, _T("parjoyport0"), p->win32_parjoyport0, sizeof p->win32_parjoyport0 / sizeof (TCHAR))
|| cfgfile_string (option, value, _T("parjoyport1"), p->win32_parjoyport1, sizeof p->win32_parjoyport1 / sizeof (TCHAR))
|| cfgfile_string (option, value, _T("gui_page"), p->win32_guipage, sizeof p->win32_guipage / sizeof (TCHAR))
+ || cfgfile_string (option, value, _T("gui_active_page"), p->win32_guiactivepage, sizeof p->win32_guiactivepage / sizeof (TCHAR))
|| cfgfile_intval (option, value, _T("guikey"), &p->win32_guikey, 1)
|| cfgfile_intval (option, value, _T("kbledmode"), &p->win32_kbledmode, 1)
|| cfgfile_yesno (option, value, _T("filesystem_mangle_reserved_names"), &p->win32_filesystem_mangle_reserved_names)
#define LANG_DLL 1
//#define WINUAEBETA _T("")
-#define WINUAEBETA _T("19")
-#define WINUAEDATE MAKEBD(2012, 10, 1)
+#define WINUAEBETA _T("20")
+#define WINUAEDATE MAKEBD(2012, 10, 7)
#define WINUAEEXTRA _T("")
//#define WINUAEEXTRA _T("AmiKit Preview")
#define WINUAEREV _T("")
extern void disablecapture (void);
extern void fullscreentoggle (void);
extern int isfocus (void);
+extern void gui_restart (void);
extern void setmouseactive (int active);
extern void minimizewindow (void);
if (startactive) {
setpriority (&priorities[currprefs.win32_active_capture_priority]);
for (i = 0; i < NUM_LEDS; i++)
- gui_led (i, 0);
+ gui_led (i, -1);
gui_fps (0, 0, 0);
inputdevice_acquire (TRUE);
} else if (startminimized) {
_tcscpy (workprefs.flashfile, full_path);
fullpath (workprefs.flashfile, MAX_DPATH);
break;
+ case IDC_RTCFILE:
+ _tcscpy (workprefs.rtcfile, full_path);
+ fullpath (workprefs.rtcfile, MAX_DPATH);
+ break;
case IDC_CARTFILE:
_tcscpy (workprefs.cartfile, full_path);
fullpath (workprefs.cartfile, MAX_DPATH);
regclosetree (fkey);
SetDlgItemText(hDlg, IDC_FLASHFILE, workprefs.flashfile);
+ SetDlgItemText(hDlg, IDC_RTCFILE, workprefs.rtcfile);
CheckDlgButton(hDlg, IDC_KICKSHIFTER, workprefs.kickshifter);
CheckDlgButton(hDlg, IDC_MAPROM, workprefs.maprom);
}
DiskSelection(hDlg, IDC_FLASHFILE, 11, &workprefs, path);
values_to_kickstartdlg (hDlg);
break;
+ case IDC_RTCCHOOSER:
+ DiskSelection(hDlg, IDC_RTCFILE, 6, &workprefs, path);
+ values_to_kickstartdlg (hDlg);
+ break;
case IDC_CARTCHOOSER:
DiskSelection(hDlg, IDC_CARTFILE, 6, &workprefs, path);
values_to_kickstartdlg (hDlg);
values_to_kickstartdlg (hDlg);
setmultiautocomplete (hDlg, ids);
setac (hDlg, IDC_FLASHFILE);
+ setac (hDlg, IDC_RTCFILE);
return TRUE;
}
{
int id = GetDlgCtrlID((HWND)wParam);
if (id == IDC_KICKCHOOSER || id == IDC_ROMCHOOSER2
- || id == IDC_FLASHCHOOSER || id == IDC_CARTCHOOSER) {
+ || id == IDC_FLASHCHOOSER || id == IDC_CARTCHOOSER || id == IDC_RTCCHOOSER) {
TCHAR *s = favoritepopup (hDlg);
if (s) {
TCHAR newfile[MAX_DPATH];
GetWindowText (GetDlgItem (hDlg, IDC_FLASHFILE), tmp, sizeof (tmp) / sizeof (TCHAR));
_tcscpy (workprefs.flashfile, tmp);
break;
+ case IDC_RTCFILE:
+ GetWindowText (GetDlgItem (hDlg, IDC_RTCFILE), tmp, sizeof (tmp) / sizeof (TCHAR));
+ _tcscpy (workprefs.rtcfile, tmp);
+ break;
case IDC_KICKSHIFTER:
workprefs.kickshifter = ischecked (hDlg, IDC_KICKSHIFTER);
-1,
IDD_INPUT, IDC_INPUTDEVICE, IDC_INPUTLIST, IDC_INPUTAMIGA,
-1,
- IDD_KICKSTART, IDC_ROMFILE, IDC_ROMFILE2, IDC_CARTFILE, IDC_FLASHFILE,
+ IDD_KICKSTART, IDC_ROMFILE, IDC_ROMFILE2, IDC_CARTFILE, IDC_FLASHFILE, IDC_RTCFILE,
-1,
IDD_LOADSAVE, IDC_CONFIGTREE, IDC_EDITNAME, IDC_EDITDESCRIPTION, IDC_CONFIGLINK, IDC_EDITPATH,
-1,
return panelDlg;
}
+static bool panel_done, panel_active_done;
+
static void checkpagelabel (int id, int sub, const TCHAR *label)
{
- if (!label || _tcsicmp (label, currprefs.win32_guipage))
- return;
+ if (full_property_sheet) {
+ if (panel_done)
+ return;
+ if (!label || _tcsicmp (label, currprefs.win32_guipage) != 0)
+ return;
+ panel_done = true;
+ } else {
+ if (panel_active_done)
+ return;
+ if (!label || _tcsicmp (label, currprefs.win32_guiactivepage) != 0)
+ return;
+ panel_active_done = true;
+ }
currentpage = id;
configtypepanel = configtype = sub;
}
+void gui_restart (void)
+{
+ panel_done = panel_active_done = false;
+}
+
+
static HTREEITEM CreateFolderNode (HWND TVhDlg, int nameid, HTREEITEM parent, int nodeid, int sub, const TCHAR *label)
{
TVINSERTSTRUCT is;
static void gui_flicker_led2 (int led, int unitnum, int status)
{
static int resetcounter[LED_MAX];
- uae_u8 old;
- uae_u8 *p;
+ uae_s8 old;
+ uae_s8 *p;
if (led == LED_HD)
p = &gui_data.hd;
else
return;
old = *p;
+ if (status < 0) {
+ if (old < 0) {
+ *p = 0;
+ gui_led (led, 0);
+ }
+ return;
+ }
+ if (status == 0 && old < 0) {
+ resetcounter[led] = 0;
+ return;
+ }
if (status == 0) {
resetcounter[led]--;
if (resetcounter[led] > 0)
pos = 5;
ptr = _tcscpy (drive_text + pos * 16, _T("CD"));
center = 1;
- if (on & LED_CD_AUDIO)
- playing = 1;
- else if (on & LED_CD_ACTIVE2)
- active2 = 1;
- on &= 1;
+ if (on >= 0) {
+ if (on & LED_CD_AUDIO)
+ playing = 1;
+ else if (on & LED_CD_ACTIVE2)
+ active2 = 1;
+ on &= 1;
+ }
} else if (led == LED_FPS) {
double fps = (double)gui_data.fps / 10.0;
extern double p96vblank;
ptr = _tcscpy (drive_text + pos * 16, _T("NV"));
}
+ if (on < 0)
+ return;
+
type = SBT_OWNERDRAW;
if (pos >= 0) {
ptr[_tcslen (ptr) + 1] = 0;
-- Merged SVN updates.
-- Check dos.library's version, not exec's, to detect KS version. Exec version is v37 on CDTV with KS 1.3 + 2.x extended ROM.
-- Enabled removable media support.
-- Fixed ACTION_DIE (unmount) crash.
-- 1.x C:Info does not anymore report no disk state.
-
- restore only single input target to default.
+Beta 20:
+
+- Reduced Gayle based configuration CIA memory bank size to 4096 bytes, only accesses to bfdxxx and bfexxx goes to CIA chips if Gayle.
+- Reverted b19 horizontal change, I forgot that it was made to fit max overscan modes better..
+ (Manually adding "gfx_horizontal_tweak=8" to config file can be used as a workaround, if needed for some reason)
+- RTC update in b11 was not compatible with KS 1.x.
+- improved RF5C01A RTC emulation, previously KS2.0+ detected stopped clock and attempted to reset it (which is no-op because
+ emulated clock's time is currently read-only) and after reset it finally read the time.
+- RTC year value is saved differently depending on OS version, Pre-2.0: RTC year value = current year - 1900,
+ 2.0+: year value = last 2 digits. Both methods supported when reading. WinUAE now uses pre-2.0 method if
+ MSM clock chip (because this is the only type that KS1.x supports), 2.0+ if RF clock chip, previously always used -1900 method.
+- RTC 12/24h bit emulated, this is not used by AOS.
+- RTC time/date, alarm and memory data save/load to file supported (alarm time/date, note that alarm interrupt pin is not connected in Amigas,
+ and 104 bits of memory, used mainly for A3000 SCSI settings, included with RF clock chip type). Date/time ignored when loading.
+- added win32.gui_active_page=name, sets default GUI panel after emulation has been started (Old win32.gui_page = before emulation starts)
+- In some situations adv. chipset may have used incompatible data stored in config file even if compatible settings was ticked.
+- Syncronize clock on the fly CIA TOD adjustment is now only active if heartbeat signal (b11) is detected.
+- b11 heartbeat system was not fully disabled when UAE boot rom was unavailable.
+- On screen led HD/CD/NVRAM indicator is blank if device is not available (like floppies already did).
+
Beta 19:
- GamePorts panel Test function now shows all currently mapped input target(s). Can be used to test any kind of input event mapping.
off_rgb = 0x330000;
} else if (led == LED_CD) {
pos = 5;
- on = gui_data.cd & (LED_CD_AUDIO | LED_CD_ACTIVE);
- on_rgb = (on & LED_CD_AUDIO) ? 0x00cc00 : 0x0000cc;
- if ((gui_data.cd & LED_CD_ACTIVE2) && !(gui_data.cd & LED_CD_AUDIO)) {
- on_rgb &= 0xfefefe;
- on_rgb >>= 1;
+ if (gui_data.cd >= 0) {
+ on = gui_data.cd & (LED_CD_AUDIO | LED_CD_ACTIVE);
+ on_rgb = (on & LED_CD_AUDIO) ? 0x00cc00 : 0x0000cc;
+ if ((gui_data.cd & LED_CD_ACTIVE2) && !(gui_data.cd & LED_CD_AUDIO)) {
+ on_rgb &= 0xfefefe;
+ on_rgb >>= 1;
+ }
+ off_rgb = 0x000033;
+ num1 = -1;
+ num2 = 10;
+ num3 = 12;
}
- off_rgb = 0x000033;
- num1 = -1;
- num2 = 10;
- num3 = 12;
} else if (led == LED_HD) {
pos = 4;
- on = gui_data.hd;
- on_rgb = on == 2 ? 0xcc0000 : 0x0000cc;
- off_rgb = 0x000033;
- num1 = -1;
- num2 = 11;
- num3 = 12;
+ if (gui_data.hd >= 0) {
+ on = gui_data.hd;
+ on_rgb = on == 2 ? 0xcc0000 : 0x0000cc;
+ off_rgb = 0x000033;
+ num1 = -1;
+ num2 = 11;
+ num3 = 12;
+ }
} else if (led == LED_FPS) {
int fps = (gui_data.fps + 5) / 10;
pos = 2;