#include "newcpu.h"
#define AKIKO_DEBUG_NVRAM 0
-#define AKIKO_DEBUG_IO 1
-#define AKIKO_DEBUG_IO_CMD 1
+#define AKIKO_DEBUG_IO 0
+#define AKIKO_DEBUG_IO_CMD 0
// 43 48 49 4E 4F 4E 20 20 4F 2D 36 35 38 2D 32 20 32 34
#define FIRMWAREVERSION "CHINON O-658-2 24"
/* close device */
static void sys_cddev_close (void)
{
- cdaudiostop_do ();
- sys_command_close (unitnum);
+ if (unitnum >= 0) {
+ cdaudiostop_do ();
+ sys_command_close (unitnum);
+ }
+ unitnum = -1;
+
}
static int command_lengths[] = { 1,2,1,1,12,2,1,1,4,1,-1,-1,-1,-1,-1,-1 };
static void akiko_cdrom_free (void)
{
- if (unitnum >= 0)
- sys_cddev_close ();
- unitnum = -1;
+ sys_cddev_close ();
xfree (sector_buffer_1);
xfree (sector_buffer_2);
xfree (sector_buffer_info_1);
cdcomtxinx = 0;
cdcomrxinx = 0;
cdcomtxcmp = 0;
+ lastmediastate = 0;
}
cdrom_led = 0;
- lastmediastate = 0;
cdrom_receive_started = 0;
cd_initialized = 0;
akiko_read_offset = restore_u8 ();
akiko_write_offset = restore_u8 ();
- cdrom_playing = cdrom_paused = 0;
+ cdrom_playing = cdrom_paused = cdrom_disk = 0;
v = restore_u32 ();
if (v & 1)
cdrom_playing = 1;
if (v & 2)
cdrom_paused = 1;
+ if (v & 4)
+ cdrom_disk = 1;
+ lastmediastate = cdrom_disk;
last_play_pos = msf2lsn (restore_u32 ());
last_play_end = msf2lsn (restore_u32 ());
static struct device_functions *device_func[MAX_TOTAL_SCSI_DEVICES];
static int openlist[MAX_TOTAL_SCSI_DEVICES];
-static int waspaused[MAX_TOTAL_SCSI_DEVICES];
+static int waspaused[MAX_TOTAL_SCSI_DEVICES], wasslow[MAX_TOTAL_SCSI_DEVICES];
/* convert minutes, seconds and frames -> logical sector number */
int msf2lsn (int msf)
}
-static int sys_command_open_internal (int unitnum, const TCHAR *ident)
+static int sys_command_open_internal (int unitnum, const TCHAR *ident, cd_standard_unit csu)
{
int ret = 0;
if (openlist[unitnum])
write_log (L"BUG unit %d open: opencnt=%d!\n", unitnum, openlist[unitnum]);
if (device_func[unitnum]) {
- ret = device_func[unitnum]->opendev (unitnum, ident);
+ ret = device_func[unitnum]->opendev (unitnum, ident, csu != CD_STANDARD_UNIT_DEFAULT);
if (ret)
openlist[unitnum]++;
}
int unitnum = 0;
if (currprefs.cdslots[unitnum].name[0] || currprefs.cdslots[unitnum].inuse) {
device_func_init (SCSI_UNIT_IOCTL);
- if (!sys_command_open_internal (unitnum, currprefs.cdslots[unitnum].name)) {
+ if (!sys_command_open_internal (unitnum, currprefs.cdslots[unitnum].name, csu)) {
device_func_init (SCSI_UNIT_IMAGE);
- if (!sys_command_open_internal (unitnum, currprefs.cdslots[unitnum].name))
+ if (!sys_command_open_internal (unitnum, currprefs.cdslots[unitnum].name, csu))
goto fallback;
}
return unitnum;
_stprintf (vol, L"%c:\\", drive);
int drivetype = GetDriveType (vol);
if (drivetype == DRIVE_CDROM) {
- if (sys_command_open_internal (unitnum, vol)) {
+ if (sys_command_open_internal (unitnum, vol, csu)) {
struct device_info di;
write_log (L"Scanning drive %s: ", vol);
if (sys_command_info (unitnum, &di, 0)) {
if (isaudio) {
TCHAR vol[100];
_stprintf (vol, L"%c:\\", isaudio);
- if (sys_command_open_internal (unitnum, vol))
+ if (sys_command_open_internal (unitnum, vol, csu))
return unitnum;
}
fallback:
device_func_init (SCSI_UNIT_IMAGE);
- if (!sys_command_open_internal (unitnum, L"")) {
+ if (!sys_command_open_internal (unitnum, L"", csu)) {
write_log (L"image mounter failed to open as empty!?\n");
return -1;
}
int sys_command_open (int unitnum)
{
waspaused[unitnum] = 0;
- return sys_command_open_internal (unitnum, currprefs.cdslots[unitnum].name[0] ? currprefs.cdslots[unitnum].name : NULL);
+ return sys_command_open_internal (unitnum, currprefs.cdslots[unitnum].name[0] ? currprefs.cdslots[unitnum].name : NULL, CD_STANDARD_UNIT_DEFAULT);
}
struct device_info di;
device_func[unitnum]->info (unitnum, &di, 0);
wasopen[unitnum] = di.open;
+ wasslow[unitnum] = di.slow_unit;
if (wasopen[unitnum]) {
device_func[unitnum]->closedev (unitnum);
if (currprefs.scsi) {
write_log (L"CD: delayed insert '%s'\n", currprefs.cdslots[unitnum].name[0] ? currprefs.cdslots[unitnum].name : L"<EMPTY>");
device_func_init (0);
if (wasopen[unitnum]) {
- if (!device_func[unitnum]->opendev (unitnum, currprefs.cdslots[unitnum].name)) {
+ if (!device_func[unitnum]->opendev (unitnum, currprefs.cdslots[unitnum].name, wasslow[unitnum])) {
write_log (L"-> device open failed\n");
}
}
int cd_last_pos;
int cdda_start, cdda_end;
play_subchannel_callback cdda_subfunc;
+ bool slowunit;
int imagechange;
TCHAR newfile[MAX_DPATH];
while (cdimage_unpack_active == 0)
Sleep (10);
}
- firstloops = 150;
+ firstloops = cdu->slowunit ? 150 : 30;
while (cdu->cdda_paused && cdu->cdda_play > 0) {
Sleep (10);
firstloops = -1;
if (!cdu->enabled)
return NULL;
di->open = cdu->open;
+ di->slow_unit = cdu->slowunit;
di->removable = 1;
di->bus = unitnum;
di->target = 0;
}
-static int open_device (int unitnum, const TCHAR *ident)
+static int open_device (int unitnum, const TCHAR *ident, int flags)
{
struct cdunit *cdu = &cdunits[unitnum];
cdu->enabled = true;
cdu->cdda_volume[0] = 0x7fff;
cdu->cdda_volume[1] = 0x7fff;
+ cdu->slowunit = (flags & 1) != 0;
blkdev_cd_change (unitnum, currprefs.cdslots[unitnum].name);
if (cdimage_unpack_thread == 0) {
init_comm_pipe (&unpack_pipe, 10, 1);
case 'f':
if (inptr[0] == 'a') {
- next_char(&inptr);
+ next_char (&inptr);
find_ea (&inptr);
} else if (inptr[0] == 'p') {
inptr++;
- if (process_breakpoint(&inptr))
+ if (process_breakpoint (&inptr))
return;
} else {
if (instruction_breakpoint (&inptr))
}
-static uae_u32 notifyhash (TCHAR *s)
+static uae_u32 notifyhash (const TCHAR *s)
{
uae_u32 hash = 0;
while (*s)
TCHAR productid[18];
TCHAR revision[6];
TCHAR *backend;
+ int slow_unit;
struct cd_toc_head toc;
};
typedef int (*check_bus_func)(int flags);
typedef int (*open_bus_func)(int flags);
typedef void (*close_bus_func)(void);
-typedef int (*open_device_func)(int, const TCHAR*);
+typedef int (*open_device_func)(int, const TCHAR*, int);
typedef void (*close_device_func)(int);
typedef struct device_info* (*info_device_func)(int, struct device_info*, int);
typedef uae_u8* (*execscsicmd_out_func)(int, uae_u8*, int);
extern int isaudiotrack (struct cd_toc_head*, int block);
extern int isdatatrack (struct cd_toc_head*, int block);
-enum cd_standard_unit { CD_STANDARD_UNIT_AUDIO, CD_STANDARD_UNIT_CDTV, CD_STANDARD_UNIT_CD32 };
+enum cd_standard_unit { CD_STANDARD_UNIT_DEFAULT, CD_STANDARD_UNIT_AUDIO, CD_STANDARD_UNIT_CDTV, CD_STANDARD_UNIT_CD32 };
extern int get_standard_cd_unit (enum cd_standard_unit csu);
extern void close_standard_cd_unit (int);
int isbutton = getbuttonstate (joy, i == 0 ? JOYBUTTON_3 : JOYBUTTON_2);
if (cd32_pad_enabled[joy]) {
- if (i != 0) // 3rd button?
+ if (i == 0) // 3rd button?
continue;
if (cd32padmode (p5dir, p5dat))
continue;
potgor |= p5dat;
- if (!cd32_pad_enabled[i]) {
+ if (!cd32_pad_enabled[i] || !cd32padmode (p5dir, p5dat)) {
potgor &= ~p9dat;
if (pot_cap[i][1] > 100)
potgor |= p9dat;
#ifdef SAVESTATE
if (savestate_state == STATE_RESTORE || savestate_state == STATE_REWIND) {
m68k_setpc (regs.pc);
- /* MakeFromSR () must not swap stack pointer */
- regs.s = (regs.sr >> 13) & 1;
- MakeFromSR ();
+ SET_XFLG ((regs.sr >> 4) & 1);
+ SET_NFLG ((regs.sr >> 3) & 1);
+ SET_ZFLG ((regs.sr >> 2) & 1);
+ SET_VFLG ((regs.sr >> 1) & 1);
+ SET_CFLG (regs.sr & 1);
+ regs.t1 = (regs.sr >> 15) & 1;
+ regs.t0 = (regs.sr >> 14) & 1;
+ regs.s = (regs.sr >> 13) & 1;
+ regs.m = (regs.sr >> 12) & 1;
+ regs.intmask = (regs.sr >> 8) & 7;
/* set stack pointer */
if (regs.s)
m68k_areg (regs, 7) = regs.isp;
m68kpc_offset = addr - m68k_getpc ();
if (buf)
- memset (buf, 0, bufsize);
+ memset (buf, 0, bufsize * sizeof (TCHAR));
if (!table68k)
return;
while (cnt-- > 0) {
doint ();
if (regs.stopped)
set_special (SPCFLAG_STOP);
+ //activate_debugger ();
}
uae_u8 *restore_cpu_extra (uae_u8 *src)
save_u32 (model); /* MODEL */
save_u32 (0x80000000 | (currprefs.address_space_24 ? 1 : 0)); /* FLAGS */
for (i = 0;i < 15; i++)
- save_u32 (regs.regs[i]); /* D0-D7 A0-A6 */
+ save_u32 (regs.regs[i]); /* D0-D7 A0-A6 */
save_u32 (m68k_getpc ()); /* PC */
save_u16 (regs.irc); /* prefetch */
save_u16 (regs.ir); /* instruction prefetch */
MakeSR ();
save_u32 (!regs.s ? regs.regs[15] : regs.usp); /* USP */
save_u32 (regs.s ? regs.regs[15] : regs.isp); /* ISP */
- save_u16 (regs.sr); /* SR/CCR */
+ save_u16 (regs.sr); /* SR/CCR */
save_u32 (regs.stopped ? CPUMODE_HALT : 0); /* flags */
if (model >= 68010) {
- save_u32 (regs.dfc); /* DFC */
- save_u32 (regs.sfc); /* SFC */
- save_u32 (regs.vbr); /* VBR */
+ save_u32 (regs.dfc); /* DFC */
+ save_u32 (regs.sfc); /* SFC */
+ save_u32 (regs.vbr); /* VBR */
}
if (model >= 68020) {
- save_u32 (regs.caar); /* CAAR */
- save_u32 (regs.cacr); /* CACR */
- save_u32 (regs.msp); /* MSP */
+ save_u32 (regs.caar); /* CAAR */
+ save_u32 (regs.cacr); /* CACR */
+ save_u32 (regs.msp); /* MSP */
}
if (model >= 68030) {
save_u64 (crp_030); /* CRP */
save_u32 (tt0_030); /* TT0/AC0 */
save_u32 (tt1_030); /* TT1/AC1 */
save_u32 (tc_030); /* TCR */
- save_u16 (mmusr_030); /* MMUSR/ACUSR */
+ save_u16 (mmusr_030); /* MMUSR/ACUSR */
}
if (model >= 68040) {
- save_u32 (regs.itt0); /* ITT0 */
- save_u32 (regs.itt1); /* ITT1 */
- save_u32 (regs.dtt0); /* DTT0 */
- save_u32 (regs.dtt1); /* DTT1 */
- save_u32 (regs.tcr); /* TCR */
- save_u32 (regs.urp); /* URP */
- save_u32 (regs.srp); /* SRP */
+ save_u32 (regs.itt0); /* ITT0 */
+ save_u32 (regs.itt1); /* ITT1 */
+ save_u32 (regs.dtt0); /* DTT0 */
+ save_u32 (regs.dtt1); /* DTT1 */
+ save_u32 (regs.tcr); /* TCR */
+ save_u32 (regs.urp); /* URP */
+ save_u32 (regs.srp); /* SRP */
}
if (model >= 68060) {
- save_u32 (regs.buscr); /* BUSCR */
- save_u32 (regs.pcr); /* PCR */
+ save_u32 (regs.buscr); /* BUSCR */
+ save_u32 (regs.pcr); /* PCR */
}
khz = -1;
if (currprefs.m68k_speed == 0) {
return 1;
}
-static int open_scsi_device (int unitnum, const TCHAR *ident)
+static int open_scsi_device (int unitnum, const TCHAR *ident, int flags)
{
if (unitnum >= unitcnt)
return 0;
uae_sem_t sub_sem, sub_sem2;
bool open;
bool usesptiread;
+ bool slowunit;
};
static struct dev_info_ioctl ciw32[MAX_TOTAL_SCSI_DEVICES];
if (oldplay != ciw->cdda_play) {
cdda_pos = ciw->cdda_start;
oldplay = ciw->cdda_play;
- firstloops = 25;
+ firstloops = ciw->slowunit ? 25 : 5;
write_log (L"IOCTL%s CDDA: playing from %d to %d\n",
ciw->usesptiread ? L"(SPTI)" : L"", ciw->cdda_start, ciw->cdda_end);
ciw->subcodevalid = false;
di->type = ciw->type == DRIVE_CDROM ? INQ_ROMD : INQ_DASD;
di->unitnum = unitnum + 1;
_tcscpy (di->label, ciw->drvlettername);
+ di->slow_unit = ciw->slowunit;
di->backend = L"IOCTL";
}
write_log (L"IOCTL: device '%s' closed\n", ciw->devname, unitnum);
}
-static int open_device (int unitnum, const TCHAR *ident)
+static int open_device (int unitnum, const TCHAR *ident, int flags)
{
struct dev_info_ioctl *ciw = NULL;
if (ident && ident[0]) {
if (ciw->drvletter == 0)
return 0;
unittable[unitnum] = unitnum + 1;
+ ciw->slowunit = (flags & 1) != 0;
if (sys_cddev_open (ciw, unitnum) == 0)
return 1;
unittable[unitnum] = 0;
blkdev_cd_change (unitnum, ciw->drvlettername);
return 0;
}
+
static void close_device (int unitnum)
{
struct dev_info_ioctl *ciw = unitcheck (unitnum);
xfree (dev);
return 0;
}
-int open_scsi_device (int unitnum, const TCHAR *ident)
+
+int open_scsi_device (int unitnum, const TCHAR *ident, int flags)
{
struct dev_info_spti *di = NULL;
if (ident && ident[0]) {
{
if (!initialized)
return;
- if (!clipboard_data)
+ if (!clipboard_data || get_long (clipboard_data) != 0)
return;
if (clipboard_debug) {
debugwrite (L"clipboard_p2a", to_amiga, to_amiga_size);
}
-static void to_iff_text (TCHAR *pctxt)
+static void to_iff_text (const TCHAR *pctxt)
{
uae_u8 b[] = { 'F','O','R','M',0,0,0,0,'F','T','X','T','C','H','R','S',0,0,0,0 };
uae_u32 size;
'C','A','M','G',0,0,0, 4, 0,0,0,0,
};
- if (!GetObject(hbmp, sizeof bmp, &bmp))
+ if (!GetObject (hbmp, sizeof bmp, &bmp))
return;
w = bmp.bmWidth;
h = bmp.bmHeight;
xfree (bmp.bmBits);
}
-static uae_u8 *iff_decomp (uae_u8 *addr, int w, int h, int planes)
+static uae_u8 *iff_decomp (const uae_u8 *addr, int w, int h, int planes)
{
int y, i, w2;
uae_u8 *dst;
#define WINUAEPUBLICBETA 1
#define LANG_DLL 1
-#define WINUAEBETA L"7"
-#define WINUAEDATE MAKEBD(2010, 7, 28)
+#define WINUAEBETA L"8"
+#define WINUAEDATE MAKEBD(2010, 7, 30)
#define WINUAEEXTRA L""
#define WINUAEREV L""
#ifdef PICASSO96
}
#endif
- currentmode->current_depth = currprefs.color_mode == 1 ? 15
- : currprefs.color_mode == 2 ? 16 : 32;
+ currentmode->current_depth = currprefs.color_mode < 5 ? 16 : 32;
if (screen_is_picasso && currprefs.win32_rtgmatchdepth && isfullscreen () > 0) {
int pbits = picasso96_state.BytesPerPixel * 8;
if (pbits <= 8) {
static int scan_rom_2 (struct zfile *f, void *vrsd)
{
struct romscandata *rsd = (struct romscandata*)vrsd;
- TCHAR *path = zfile_getname(f);
+ const TCHAR *path = zfile_getname(f);
+ const TCHAR *romkey = L"rom.key";
struct romdata *rd;
scan_rom_hook (NULL, 0);
if (rd->type & ROMTYPE_KEY)
addkeyfile (path);
rsd->got = 1;
+ } else if (_tcslen (path) > _tcslen (romkey) && !_tcsicmp (path + _tcslen (path) - _tcslen (romkey), romkey)) {
+ addkeyfile (path);
}
return 0;
}
return FALSE;
}
-static HTREEITEM AddConfigNode (HWND hDlg, struct ConfigStruct *config, TCHAR *name, TCHAR *desc, TCHAR *path, int isdir, int expand, HTREEITEM parent)
+static HTREEITEM AddConfigNode (HWND hDlg, struct ConfigStruct *config, const TCHAR *name, const TCHAR *desc, const TCHAR *path, int isdir, int expand, HTREEITEM parent)
{
TVINSERTSTRUCT is;
HWND TVhDlg;
TCHAR s[MAX_DPATH] = L"";
- TCHAR file_name[MAX_DPATH], file_path[MAX_DPATH];
+ TCHAR file_name[MAX_DPATH] = L"", file_path[MAX_DPATH] = L"";
GetDlgItemText (hDlg, IDC_EDITNAME, file_name, MAX_DPATH);
GetDlgItemText (hDlg, IDC_EDITPATH, file_path, MAX_DPATH);
- TVhDlg = GetDlgItem(hDlg, IDC_CONFIGTREE);
+ TVhDlg = GetDlgItem (hDlg, IDC_CONFIGTREE);
memset (&is, 0, sizeof (is));
is.hInsertAfter = isdir < 0 ? TVI_ROOT : TVI_SORT;
is.hParent = parent;
is.itemex.mask = TVIF_TEXT | TVIF_STATE | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
- if (!_tcscmp (file_name, name) && !_tcscmp (file_path, path)) {
+ if (name && path && !_tcscmp (file_name, name) && !_tcscmp (file_path, path)) {
is.itemex.state |= TVIS_SELECTED;
is.itemex.stateMask |= TVIS_SELECTED;
}
switch (d2)
{
case 15:
- workprefs.color_mode = 1;
- d = 2;
- break;
case 16:
workprefs.color_mode = 2;
d = 2;
+Beta 8:
+
+- GUI configuration panel crash fix (b7)
+- do not emulate slow CDA startup in uaescsi.device mode
+- blue button was still broken in CD32 pad 2-button mode
+- removed obsolete 15-bit fullscreen mode support code
+- statefile restore failed if rarely used 68020 M status register bit was set
+- added protection against starting new transparent clipboard conversion
+ if previous hasn't fully finished yet
+
Beta 7:
- reverted b5 audio hack, it breaks other programs and also it does not seem to
if (buffer == NULL)
return 0;
- count = _vsntprintf (buffer, (*bufsize) - 1, format, parms);
+ count = _vsntprintf (buffer, (*bufsize) / sizeof (TCHAR) - 1, format, parms);
va_end (parms);
*bufsize -= _tcslen (buffer);
return buffer + _tcslen (buffer);
0x869ae1b1, 0x801bbab3,0x2e3d3738,0x6dd1636d,0x4f1d6fa7,0xe21d5874 },
{ L"Cloanto Amiga Forever 2006 ROM key", 0, 0, 0, 0, 0, 750, 48, 0, 1, ROMTYPE_KEY, 0, 0, NULL,
0xb01c4b56, 0xbba8e5cd,0x118b8d92,0xafed5693,0x5eeb9770,0x2a662d8f },
-// { L"Cloanto Amiga Forever 2010 ROM key", 0, 0, 0, 0, 0, 1544, 73, 0, 1, ROMTYPE_KEY, 0, 0, NULL,
-// 0x8c4dd05c, 0x05034f62,0x0b5bb7b2,0x86954ea9,0x164fdb90,0xfb2897a4 },
+ { L"Cloanto Amiga Forever 2010 ROM key", 0, 0, 0, 0, 0, 1544, 73, 0, 1, ROMTYPE_KEY, 0, 0, NULL,
+ 0x8c4dd05c, 0x05034f62,0x0b5bb7b2,0x86954ea9,0x164fdb90,0xfb2897a4 },
{ L"KS ROM v1.0 (A1000)(NTSC)", 1, 0, 1, 0, L"A1000\0", 262144, 1, 0, 0, ROMTYPE_KICK, 0, 0, NULL,
0x299790ff, 0x00C15406,0xBEB4B8AB,0x1A16AA66,0xC05860E1,0xA7C1AD79 },