static int unitnum = -1;
static int cdromok = 0;
static int cd_hunt;
+static bool akiko_inited;
static volatile int mediachanged, mediacheckcounter;
static volatile int frame2counter;
sys_command_cd_play (DF_IOCTL, unitnum, startmsf, endmsf, scan);
}
+static bool isaudiotrack (uae_u32 startmsf)
+{
+ uae_u8 *buf = cdrom_toc_cd_buffer;
+ uae_u8 *s = NULL;
+ uae_u32 addr;
+ int i;
+
+ if (!cdrom_toc_entries)
+ return false;
+ for (i = 0; i < cdrom_toc_entries; i++) {
+ s = buf + 4 + i * 11;
+ addr = (s[8] << 16) | (s[9] << 8) | (s[10] << 0);
+ if (s[3] > 0 && s[3] < 100 && addr >= startmsf)
+ break;
+ }
+ if (s && (s[1] & 0x0c) == 0x04) {
+ write_log (L"tried to play data track %d!\n", s[3]);
+ return false;
+ }
+ return true;
+}
+
+
static uae_u32 last_play_end;
static int cd_play_audio (uae_u32 startmsf, uae_u32 endmsf, int scan)
{
-#if 1
uae_u8 *buf = cdrom_toc_cd_buffer;
- uae_u8 *s;
+ uae_u8 *s = NULL;
uae_u32 addr;
int i;
+ if (!cdrom_toc_entries)
+ return 0;
for (i = 0; i < cdrom_toc_entries; i++) {
s = buf + 4 + i * 11;
addr = (s[8] << 16) | (s[9] << 8) | (s[10] << 0);
if (s[3] > 0 && s[3] < 100 && addr >= startmsf)
break;
}
- if ((s[1] & 0x0c) == 0x04) {
+ if (s && (s[1] & 0x0c) == 0x04) {
write_log (L"tried to play data track %d!\n", s[3]);
s += 11;
startmsf = (s[8] << 16) | (s[9] << 8) | (s[10] << 0);
//cdrom_audiotimeout = 312;
return 0;
}
-#endif
last_play_end = endmsf;
cdrom_audiotimeout = 0;
- write_comm_pipe_u32 (&requests, 0x110, 0);
+ write_comm_pipe_u32 (&requests, 0x0110, 0);
write_comm_pipe_u32 (&requests, startmsf, 0);
write_comm_pipe_u32 (&requests, endmsf, 0);
write_comm_pipe_u32 (&requests, scan, 1);
{
int v = cdrom_command_buffer[1];
int old = cdrom_led;
- cdrom_led &= ~1;
- cdrom_led |= v & 1;
+ cdrom_led &= ~LED_CD_ACTIVE;
+ cdrom_led |= (v & 1) ? LED_CD_ACTIVE : 0;
if (cdrom_led != old)
gui_flicker_led (LED_CD, 0, cdrom_led);
if (v & 0x80) { // result wanted?
cdrom_result_buffer[0] = cdrom_command;
- cdrom_result_buffer[1] = cdrom_led & 1;
+ cdrom_result_buffer[1] = (cdrom_led & LED_CD_ACTIVE) ? 1 : 0;
return 2;
}
return 0;
{
static int framecounter;
- if (!currprefs.cs_cd32cd)
+ if (!currprefs.cs_cd32cd || !akiko_inited)
return;
if (cd_hunt) {
}
akiko_cdrom_free ();
mediacheckcounter = 0;
+ akiko_inited = false;
}
init_comm_pipe (&requests, 100, 1);
uae_start_thread (L"akiko", akiko_thread, 0, NULL);
}
+ akiko_inited = true;
return 1;
}
#ifdef SAVESTATE
-uae_u8 *save_akiko(int *len)
+uae_u8 *save_akiko (int *len)
{
uae_u8 *dstbak, *dst;
int i;
uae_u32 v;
int i;
+ akiko_free ();
if (!currprefs.cs_cd32cd || !cdromok) {
changed_prefs.cs_cd32c2p = changed_prefs.cs_cd32cd = changed_prefs.cs_cd32nvram = true;
currprefs.cs_cd32c2p = currprefs.cs_cd32cd = currprefs.cs_cd32nvram = true;
{
if (!currprefs.cs_cd32cd)
return;
+ akiko_init ();
akiko_c2p_do ();
+ cdrom_toc ();
write_comm_pipe_u32 (&requests, 0x0102, 1); // pause
write_comm_pipe_u32 (&requests, 0x0104, 1); // stop
write_comm_pipe_u32 (&requests, 0x0103, 1); // unpause
- if (cdrom_playing) {
+ if (cdrom_playing && isaudiotrack (last_play_pos)) {
write_comm_pipe_u32 (&requests, 0x0103, 1); // unpause
write_comm_pipe_u32 (&requests, 0x0110, 0); // play
write_comm_pipe_u32 (&requests, last_play_pos, 0);
#define MAX_EV ~0ul
//#define DEBUG_AUDIO
-#define DEBUG_CHANNEL_MASK 2
+#define DEBUG_CHANNEL_MASK 15
//#define TEST_AUDIO
#define PERIOD_MIN 4
static void zerostate (int nr)
{
struct audio_channel_data *cdp = audio_channel + nr;
+#ifdef DEBUG_AUDIO
+ write_log (L"%d: ZEROSTATE\n", nr);
+#endif
cdp->state = 0;
cdp->evtime = MAX_EV;
cdp->intreq2 = 0;
cdp->dsr = cdp->dr = false;
+ cdp->dmaenstore = false;
#ifdef TEST_AUDIO
cdp->have_dat = false;
#endif
+
}
static void schedule_audio (void)
{
struct audio_channel_data *cdp = audio_channel + nr;
bool chan_ena = (dmacon & DMA_MASTER) && (dmacon & (1 << nr));
+ bool old_dma = cdp->dmaenstore;
int audav = adkcon & (0x01 << nr);
int audap = adkcon & (0x10 << nr);
int napnav = (!audav && !audap) || audav;
int hpos = current_hpos ();
-#ifdef DEBUG_AUDIO
- if (debugchannel (nr)) {
- if (cdp->dmaenstore != chan_ena) {
- cdp->dmaenstore = chan_ena;
- write_log (L"%d:DMA=%d IRQ=%d PC=%08x\n", nr, chan_ena, isirq (nr) ? 1 : 0, M68K_GETPC);
- }
+ cdp->dmaenstore = chan_ena;
+
+ if (currprefs.produce_sound == 0) {
+ zerostate (nr);
+ return;
}
+ audio_activate ();
+
+ if ((cdp->state == 2 || cdp->state == 3) && (currprefs.cpu_model >= 68020 || currprefs.m68k_speed != 0) && !chan_ena && old_dma) {
+ // DMA switched off, state=2/3 and "too fast CPU": kill DMA instantly
+ // or CPU timed DMA wait routines in common tracker players will lose notes
+#ifdef DEBUG_AUDIO
+ write_log (L"%d: INSTADMAOFF\n", nr, M68K_GETPC);
#endif
- if (currprefs.produce_sound == 0) {
zerostate (nr);
return;
}
+
+#ifdef DEBUG_AUDIO
+ if (debugchannel (nr) && old_dma != chan_ena) {
+ write_log (L"%d:DMA=%d IRQ=%d PC=%08x\n", nr, chan_ena, isirq (nr) ? 1 : 0, M68K_GETPC);
+ }
+#endif
switch (cdp->state)
{
case 0:
}
break;
case 1:
+ cdp->evtime = MAX_EV;
if (!cdp->dat_written)
return;
#ifdef TEST_AUDIO
cdp->state = 5;
break;
case 5:
+ cdp->evtime = MAX_EV;
if (!cdp->dat_written)
return;
#ifdef DEBUG_AUDIO
}
for (i = 0; i < 4; i++) {
- if (audio_channel[i].evtime == 0)
+ if (audio_channel[i].evtime == 0) {
audio_state_channel (i, true);
+ if (audio_channel[i].evtime == 0) {
+ write_log (L"evtime==0 sound bug channel %d\n");
+ audio_channel[i].evtime = MAX_EV;
+ }
+ }
}
}
end:
if (dstptr)
dstbak = dst = dstptr;
else
- dstbak = dst = (uae_u8*)malloc (100);
+ dstbak = dst = xmalloc (uae_u8, 100);
acd = audio_channel + i;
save_u8 ((uae_u8)acd->state);
save_u8 (acd->vol);
device_func[DF_IOCTL] = NULL;
device_func[DF_SCSI] = &devicefunc_win32_aspi;
- if (devicefunc_cdimage.openbus (flags)) {
+ if (devicefunc_cdimage.checkbus (flags | DEVICE_TYPE_CHECKAVAIL)) {
device_func[DF_IOCTL] = &devicefunc_cdimage;
device_func[DF_SCSI] = NULL;
return;
device_func[DF_IOCTL] = 0;
}
#endif
+ if (device_func[DF_SCSI])
+ device_func[DF_SCSI]->checkbus (DEVICE_TYPE_CHECKAVAIL);
+ if (device_func[DF_IOCTL])
+ device_func[DF_IOCTL]->checkbus (DEVICE_TYPE_CHECKAVAIL);
}
#endif
flags = restore_u32 ();
s = restore_string ();
- if ((flags & 4) && unit == 0)
+ if ((flags & 4) && unit == 0) {
_tcscpy (changed_prefs.cdimagefile, s);
+ _tcscpy (currprefs.cdimagefile, s);
+ }
return src;
}
static int cdda_start, cdda_end;
static int imagechange;
-static bool donotmountme;
+static int donotmountme;
static TCHAR newfile[MAX_DPATH];
/* convert minutes, seconds and frames -> logical sector number */
p = buf + 4;
- if (pos >= 150)
- trk = 0;
start = end = 0;
for (trk = 0; trk <= tracks; trk++) {
struct cdtoc *td = &toc[trk];
pos -= start;
if (pos < 0)
pos = 0;
- msf = lsn2msf (pos);
- p[9] = (pos >> 16) & 0xff;
- p[10] = (pos >> 8) & 0xff;
- p[11] = (pos >> 0) & 0xff;
+ msf = lsn2msf (pos - 150);
+ p[9] = (msf >> 16) & 0xff;
+ p[10] = (msf >> 8) & 0xff;
+ p[11] = (msf >> 0) & 0xff;
return buf;
}
{
if (unitnum)
return 0;
- parse_image ();
+ if (!tracks)
+ parse_image ();
return 1;
}
unload_image ();
}
-static bool mountme (void)
+static int mountme (bool checkparse)
{
sys_command_setunit (-1);
+
bool sel = false;
- donotmountme = true;
+ donotmountme = 1;
device_func_init (DEVICE_TYPE_ANY);
for (int i = 0; i < MAX_TOTAL_DEVICES && !sel; i++) {
int opened = sys_command_isopen (i);
if (!_tcsicmp (currprefs.cdimagefile, discsi->label)) {
sys_command_setunit (i);
write_log (L"Drive '%s' (unit=%d) selected (media=%d)\n", discsi->label, i, discsi->media_inserted);
- sel = true;
+ donotmountme = false;
+ return -1;
}
}
}
}
- donotmountme = false;
- if (!sel) {
+ donotmountme = -1;
+ device_func_init (DEVICE_TYPE_ANY); // activate us again
+ donotmountme = 0;
+ if (checkparse) {
sys_command_setunit (0);
- device_func_init (DEVICE_TYPE_ANY); // activate us again
parse_image ();
int media = tracks > 0;
write_log (L"IMG_EMU (%s) selected (media=%d)\n", currprefs.cdimagefile, media);
- return true;
+ return 1;
}
- return false;
+ return 0;
}
void cdimage_vsync (void)
newfile[0] = 0;
write_log (L"CD: delayed insert '%s'\n", currprefs.cdimagefile[0] ? currprefs.cdimagefile : L"<EMPTY>");
if (currprefs.scsi) {
- donotmountme = true;
+ donotmountme = 1;
int un = scsi_do_disk_device_change ();
- donotmountme = false;
+ donotmountme = 0;
if (un < 0) {
+ donotmountme = -1;
device_func_init (DEVICE_TYPE_ANY); // activate us again
+ donotmountme = 0;
parse_image ();
scsi_do_disk_change (255, 1);
}
} else {
- mountme ();
+ mountme (true);
}
#ifdef RETROPLATFORM
rp_cd_image_change (0, currprefs.cdimagefile);
return tracks > 0 ? 1 : 0;
}
-static int open_bus (int flags)
+static int check_bus (int flags)
{
- int v;
-
- if (donotmountme && !(flags & DEVICE_TYPE_ALLOWEMU))
+ if (!(flags & DEVICE_TYPE_CHECKAVAIL))
+ return 1;
+ if (donotmountme > 0)
return 0;
+ if (donotmountme < 0)
+ return 1;
if (imagechange)
return 1;
- v = currprefs.cdimagefile[0] ? 1 : 0;
+ int v = currprefs.cdimagefile[0] ? 1 : 0;
if (v) {
- if (!mountme ())
+ if (mountme (false) < 0) // is it supported <drive letter:>\?
return 0;
}
if (currprefs.cdimagefileuse) {
v = 1;
}
+ return v;
+}
+
+static int open_bus (int flags)
+{
+ if (!(flags & DEVICE_TYPE_CHECKAVAIL))
+ return 1;
+ if (donotmountme > 0)
+ return 0;
+ if (donotmountme < 0)
+ return 1;
+
+ mountme (true);
#ifdef RETROPLATFORM
rp_cd_change (0, 0);
rp_cd_image_change (0, currprefs.cdimagefile);
#endif
- return v;
+ return 1;
}
static void close_bus (void)
}
struct device_functions devicefunc_cdimage = {
- open_bus, close_bus, open_device, close_device, info_device,
+ check_bus, open_bus, close_bus, open_device, close_device, info_device,
0, 0, 0,
command_pause, command_stop, command_play, command_volume, command_qcode,
command_toc, command_read, command_rawread, 0,
#include "uae.h"
#include "zfile.h"
+#define DRIVER
#include <catweasl_usr.h>
struct catweasel_contr cwc;
#include "threaddep/thread.h"
#include "a2091.h"
#include "uae.h"
+#include "savestate.h"
/* DMAC CNTR bits. */
#define CNTR_TCEN (1<<7)
static volatile int activate_stch, cdrom_command_done, play_state, play_state_cmd, play_statewait;
static volatile int cdrom_sector, cdrom_sectors, cdrom_length, cdrom_offset;
static volatile int cd_playing, cd_paused, cd_motor, cd_media, cd_error, cd_finished, cd_isready, cd_hunt;
+static uae_u32 last_play_pos, last_play_end;
static volatile int cdtv_hsync, dma_finished, cdtv_sectorsize;
static volatile uae_u64 dma_wait;
memcpy (cdrom_qcode, s, 16);
if (cd_playing) {
if (s[1] == AUDIO_STATUS_IN_PROGRESS) {
- int end = msf2lsn((s[5 + 4] << 16) | (s[6 + 4] << 8) | (s[7 + 4]));
+ int end = msf2lsn ((s[5 + 4] << 16) | (s[6 + 4] << 8) | (s[7 + 4]));
if (end >= play_end - 75)
finished_cdplay ();
} else if (s[1] == AUDIO_STATUS_PLAY_COMPLETE) {
}
play_end = msf2lsn (end);
play_start = msf2lsn (start);
+ last_play_end = start;
+ last_play_end = end;
#ifdef CDTV_DEBUG
write_log (L"PLAY CD AUDIO from %d-%d, %06X (%d) to %06X (%d)\n",
track_start, track_end,
out[10] = (msflsn ? trackposmsf : trackposlsn) >> 8;
out[11] = (msflsn ? trackposmsf : trackposlsn) >> 0;
out[12] = 0;
-
return 13;
}
for (;;) {
uae_u32 b = read_comm_pipe_u32_blocking (&requests);
+ if (b == 0xffff) {
+ thread_alive = -1;
+ return NULL;
+ }
if (unitnum < 0)
continue;
case 0x0110: // do_play!
do_play ();
break;
- case 0xffff:
- thread_alive = -1;
- return NULL;
default:
cdrom_command_thread (b);
break;
cd_led |= LED_CD_AUDIO;
else
cd_led &= ~LED_CD_AUDIO;
- if (dmac_dma)
+ if (dmac_dma || dma_finished)
cd_led |= LED_CD_ACTIVE;
else
cd_led &= ~LED_CD_ACTIVE;
};
-void cdtv_entergui (void)
-{
- if (cd_playing && !cd_paused)
- write_comm_pipe_u32 (&requests, 0x102, 1);
-}
-void cdtv_exitgui (void)
-{
- if (cd_playing && !cd_paused)
- write_comm_pipe_u32 (&requests, 0x103, 1);
-}
-
-
/* CDTV batterybacked RAM emulation */
#define CDTV_NVRAM_MASK 16383
#define CDTV_NVRAM_SIZE 32768
static uae_u8 cdtv_battram[CDTV_NVRAM_SIZE];
-void cdtv_loadcardmem(uae_u8 *p, int size)
+void cdtv_loadcardmem (uae_u8 *p, int size)
{
struct zfile *f;
zfile_fclose (f);
}
-void cdtv_savecardmem(uae_u8 *p, int size)
+void cdtv_savecardmem (uae_u8 *p, int size)
{
struct zfile *f;
cdtv_battram_reset ();
open_unit ();
}
+
+#ifdef SAVESTATE
+
+uae_u8 *save_cdtv (int *len)
+{
+ uae_u8 *dstbak, *dst;
+ int i;
+
+ if (!currprefs.cs_cd32cd)
+ return NULL;
+ return NULL;
+ dstbak = dst = xmalloc (uae_u8, 1000);
+ *len = dst - dstbak;
+ return dstbak;
+}
+
+uae_u8 *restore_cdtv (uae_u8 *src)
+{
+ uae_u32 v;
+ int i;
+
+ cdtv_free ();
+ if (!currprefs.cs_cdtvcd) {
+ changed_prefs.cs_cdtvcd = changed_prefs.cs_cdtvram = true;
+ currprefs.cs_cdtvcd = currprefs.cs_cdtvram = true;
+ cdtv_init ();
+ }
+ return src;
+}
+
+void restore_cdtv_finish (void)
+{
+ if (!currprefs.cs_cdtvcd)
+ return;
+ cdtv_init ();
+ get_toc ();
+ write_comm_pipe_u32 (&requests, 0x0102, 1); // pause
+ write_comm_pipe_u32 (&requests, 0x0104, 1); // stop
+ write_comm_pipe_u32 (&requests, 0x0103, 1); // unpause
+ if (cd_playing) {
+ write_comm_pipe_u32 (&requests, 0x0103, 1); // unpause
+ write_comm_pipe_u32 (&requests, 0x0110, 0); // play
+ write_comm_pipe_u32 (&requests, last_play_pos, 0);
+ write_comm_pipe_u32 (&requests, last_play_end, 0);
+ write_comm_pipe_u32 (&requests, 0, 1);
+ }
+}
+
+#endif
+
+void cdtv_entergui (void)
+{
+ if (cd_playing && !cd_paused)
+ write_comm_pipe_u32 (&requests, 0x102, 1);
+}
+void cdtv_exitgui (void)
+{
+ if (cd_playing && !cd_paused)
+ write_comm_pipe_u32 (&requests, 0x103, 1);
+}
DISK_select (ciabprb);
}
#ifdef CD32
- if (savestate_state != STATE_RESTORE) {
+ if (savestate_state != STATE_RESTORE && savestate_state != STATE_DORESTORE) {
akiko_reset ();
if (!akiko_init ())
currprefs.cs_cd32cd = changed_prefs.cs_cd32cd = 0;
{
int v;
- debug_wputpeekdma (0xdff000 + addr, value);
+ value = debug_wputpeekdma (0xdff000 + addr, value);
copper_access = 1;
v = custom_wput_1 (hpos, addr, value, noget);
copper_access = 0;
return debug_mem_banks[munge24 (addr) >> 16]->xlateaddr (addr);
}
-void debug_wputpeekdma (uaecptr addr, uae_u32 v)
+uae_u16 debug_wputpeekdma (uaecptr addr, uae_u32 v)
{
if (!memwatch_enabled)
- return;
+ return v;
memwatch_func (addr, 2, 2, &v);
+ return v;
}
-void debug_wgetpeekdma (uaecptr addr, uae_u32 v)
+uae_u16 debug_wgetpeekdma (uaecptr addr, uae_u32 v)
{
uae_u32 vv = v;
if (!memwatch_enabled)
- return;
+ return v;
memwatch_func (addr, 1, 2, &vv);
+ return vv;
}
void debug_putlpeek (uaecptr addr, uae_u32 v)
#define DEVICE_TYPE_ANY 1
#define DEVICE_TYPE_SCSI 2
-#define DEVICE_TYPE_ALLOWEMU 0x100
+#define DEVICE_TYPE_ALLOWEMU 0x10000000
+#define DEVICE_TYPE_CHECKAVAIL 0x20000000
#define DF_SCSI 0
#define DF_IOCTL 1
uae_u16 sactual;
};
+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);
typedef int (*ismedia_func)(int, int);
struct device_functions {
+ check_bus_func checkbus;
open_bus_func openbus;
close_bus_func closebus;
open_device_func opendev;
extern void memwatch_dump2 (TCHAR *buf, int bufsize, int num);
-void debug_wgetpeekdma (uaecptr addr, uae_u32 v);
-void debug_wputpeekdma (uaecptr addr, uae_u32 v);
+uae_u16 debug_wgetpeekdma (uaecptr addr, uae_u32 v);
+uae_u16 debug_wputpeekdma (uaecptr addr, uae_u32 v);
void debug_lgetpeek (uaecptr addr, uae_u32 v);
void debug_wgetpeek (uaecptr addr, uae_u32 v);
void debug_bgetpeek (uaecptr addr, uae_u32 v);
extern uae_u8 *restore_keyboard (uae_u8 *);
extern uae_u8 *save_keyboard (int *);
-extern uae_u8 *restore_akiko(uae_u8 *src);
-extern uae_u8 *save_akiko(int *len);
-extern void restore_akiko_finish(void);
+extern uae_u8 *restore_akiko (uae_u8 *src);
+extern uae_u8 *save_akiko (int *len);
+extern void restore_akiko_finish (void);
+
+extern uae_u8 *restore_cdtv (uae_u8 *src);
+extern uae_u8 *save_cdtv (int *len);
+extern void restore_cdtv_finish (void);
extern uae_u8 *restore_filesys (uae_u8 *src);
extern uae_u8 *save_filesys (int num, int *len);
nero = frog = 0;
_tcscpy (path, L"WNASPI32");
if (currprefs.win32_uaescsimode == UAESCSI_NEROASPI) {
- const TCHAR *p = get_aspi_path(1);
+ const TCHAR *p = get_aspi_path (1);
if (p) {
_tcscpy (path, p);
nero = 1;
}
} else if (currprefs.win32_uaescsimode == UAESCSI_FROGASPI) {
- const TCHAR *p = get_aspi_path(2);
+ const TCHAR *p = get_aspi_path (2);
if (p) {
_tcscpy (path, p);
frog = 1;
write_log (L"ASPI: open_driver HostASPIStatus=0x%x HACount=0x%x\n", ASPIStatus, HACount);
+ if (!scgp)
+ return TRUE;
+
for (i=0; i < busses; i++) {
SRB_HAInquiry s;
ha_inquiry(scgp, i, &s);
static SCSI *scsi_handle;
+static int check_scsi_bus (int flags)
+{
+ if (open_driver (NULL)) {
+ close_driver ();
+ return 1;
+ }
+ return 0;
+}
+
static int open_scsi_bus (int flags)
{
SCSI *scgp = openscsi (-1, -1, -1);
- unitcnt = 0;
if (scgp) {
+ unitcnt = 0;
scan_scsi_bus (scgp, flags);
uae_sem_init (&scgp_sem, 0, 1);
+ scsi_handle = scgp;
}
- scsi_handle = scgp;
return scgp ? 1 : 0;
}
+static void close_scsi_bus (void)
+{
+ closescsi (scsi_handle);
+ scsi_handle = 0;
+}
+
static int mediacheck (int unitnum)
{
uae_u8 cmd [6] = { 0,0,0,0,0,0 }; /* TEST UNIT READY */
si[unitnum].handle = 0;
}
-static void close_scsi_bus (void)
-{
- closescsi (scsi_handle);
- scsi_handle = 0;
-}
-
static int execscsicmd_direct (int unitnum, struct amigascsi *as)
{
int sactual = 0, i, parm;
}
struct device_functions devicefunc_win32_aspi = {
- open_scsi_bus, close_scsi_bus, open_scsi_device, close_scsi_device, info_device,
+ check_scsi_bus, open_scsi_bus, close_scsi_bus, open_scsi_device, close_scsi_device, info_device,
execscsicmd_out, execscsicmd_in, execscsicmd_direct,
0, 0, 0, 0, 0, 0, 0, 0, 0, check_isatapi, scsi_info, 0
};
} else if (ciw->cdda) {
- if (!open_createfile (unitnum, 1))
+ if (!open_createfile (unitnum, 0))
return 0;
ciw->cdda_paused = 0;
ciw->cdda_play_finished = 0;
if (pos < 0)
pos = 0;
msf = lsn2msf (pos);
- p[9] = (pos >> 16) & 0xff;
- p[10] = (pos >> 8) & 0xff;
- p[11] = (pos >> 0) & 0xff;
+ p[9] = (msf >> 16) & 0xff;
+ p[10] = (msf >> 8) & 0xff;
+ p[11] = (msf >> 0) & 0xff;
return buf;
static int total_devices;
+static int check_bus (int flags)
+{
+ return 1;
+}
+
static int open_bus (int flags)
{
int dwDriveMask;
}
struct device_functions devicefunc_win32_ioctl = {
- open_bus, close_bus, open_device, close_device, info_device,
+ check_bus, open_bus, close_bus, open_device, close_device, info_device,
0, 0, 0,
ioctl_command_pause, ioctl_command_stop, ioctl_command_play, ioctl_command_volume, ioctl_command_qcode,
ioctl_command_toc, ioctl_command_read, ioctl_command_rawread, ioctl_command_write,
}
static int rescan (void);
+
+static int check_scsi_bus (int flags)
+{
+ return 1;
+}
+
static int open_scsi_bus (int flags)
{
int i;
}
struct device_functions devicefunc_win32_spti = {
- open_scsi_bus, close_scsi_bus, open_scsi_device, close_scsi_device, info_device,
+ check_scsi_bus, open_scsi_bus, close_scsi_bus, open_scsi_device, close_scsi_device, info_device,
execscsicmd_out, execscsicmd_in, execscsicmd_direct,
0, 0, 0, 0, 0, 0, 0, 0, 0, check_isatapi, scsi_info, 0
};
int canusefile = 0, existsfile = 0;
get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), L"filtershaders\\direct3d");
- _tcscpy (tmp, shaderfile);
+ _tcscat (tmp, shaderfile);
if (!full) {
struct zfile *z = zfile_fopen (tmp, L"r", 0);
if (z) {
for (int i = 0; i < 2; i++) {
if (i == 0) {
get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), L"overlays");
- _tcscpy (tmp, filename);
+ _tcscat (tmp, filename);
} else {
_tcscpy (tmp, filename);
}
return 0;
tx = NULL;
get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), L"masks");
- _tcscpy (tmp, filename);
+ _tcscat (tmp, filename);
zf = zfile_fopen (tmp, L"rb", ZFD_NORMAL);
if (!zf) {
zf = zfile_fopen (filename, L"rb", ZFD_NORMAL);
#define WINUAEPUBLICBETA 1
#define LANG_DLL 1
-#define WINUAEBETA L"1"
-#define WINUAEDATE MAKEBD(2010, 7, 6)
+#define WINUAEBETA L"2"
+#define WINUAEDATE MAKEBD(2010, 7, 8)
#define WINUAEEXTRA L""
#define WINUAEREV L""
+
+- CD32/CDTV image mounting broke in b1 (can still be broken in some situations)
+- new audio state machine emulation froze in some situations
+- re-added "too fast CPU" hack that fixes missing sounds with sound routines that use CPU loops
+ in DMA waits (also needed in 68020 "CE" mode because short loops are currently too fast)
+- automatic audio switching detected idle audio when playing long samples
+- CD32 statefile restore ignored possible CD image file path in statefile
+- CDTV CD led flicker was practically non-existing when reading data
+- (I also noticed CDTV statefile support is still missing..)
+- old CD audio timecode relative track position bug fixed (CDTV audio CD player slow time display)
+- built-in image mounter cd audio timecode relative track position had 2 second offset
+- real cd audio cd playback asked for exclusive CD access when shared also works fine
+- do not parse mounted images (cue files) twice when booting in CD32 or CDTV mode
+- path update in b1 broke D3D related paths
+- CDTV processing thread stalled if no drive was detected when exiting
+
Beta 1:
- fixed Z3/RTG RAM leaking when restarting
#ifdef CD32
else if (!_tcscmp (name, L"CD32"))
end = restore_akiko (chunk);
+#endif
+#ifdef CDTV
+ else if (!_tcscmp (name, L"CDTV"))
+ end = restore_cdtv (chunk);
#endif
else if (!_tcscmp (name, L"GAYL"))
end = restore_gayle (chunk);
restore_disk_finish ();
restore_blitter_finish ();
restore_akiko_finish ();
+ restore_cdtv_finish ();
restore_p96_finish ();
target_addtorecent (filename, 0);
return;
save_chunk (f, dst, len, L"CD32", 0);
xfree (dst);
#endif
+#ifdef CDTV
+ dst = save_cdtv (&len);
+ save_chunk (f, dst, len, L"CDTV", 0);
+ xfree (dst);
+#endif
+
#ifdef ACTION_REPLAY
dst = save_action_replay (&len, 0);
save_chunk (f, dst, len, L"ACTR", comp);