static const TCHAR *ksmirrortype[] = { _T("none"), _T("e0"), _T("a8+e0"), 0 };
static const TCHAR *cscompa[] = {
_T("-"), _T("Generic"), _T("CDTV"), _T("CDTV-CR"), _T("CD32"), _T("A500"), _T("A500+"), _T("A600"),
- _T("A1000"), _T("A1200"), _T("A2000"), _T("A3000"), _T("A3000T"), _T("A4000"), _T("A4000T"), 0
+ _T("A1000"), _T("A1200"), _T("A2000"), _T("A3000"), _T("A3000T"), _T("A4000"), _T("A4000T"),
+ _T("Velvet"),
+ NULL
};
static const TCHAR *qsmodes[] = {
_T("A500"), _T("A500+"), _T("A600"), _T("A1000"), _T("A1200"), _T("A3000"), _T("A4000"), _T(""), _T("CD32"), _T("CDTV"), _T("CDTV-CR"), _T("ARCADIA"), NULL };
return configure_rom (p, roms, romcheck);
}
+static int bip_velvet(struct uae_prefs *p, int config, int compa, int romcheck)
+{
+ int roms[2];
+
+ roms[0] = 125;
+ roms[1] = -1;
+ p->chipset_mask = 0;
+ p->bogomem_size = 0;
+ p->sound_filter = FILTER_SOUND_ON;
+ set_68000_compa (p, compa);
+ p->floppyslots[1].dfxtype = DRV_NONE;
+ p->cs_compatible = CP_VELVET;
+ p->cs_slowmemisfast = 1;
+ p->cs_dipagnus = 1;
+ p->cs_agnusbltbusybug = 1;
+ built_in_chipset_prefs (p);
+ p->cs_denisenoehb = 1;
+ p->cs_cia6526 = 1;
+ p->chipmem_size = 0x40000;
+ return configure_rom (p, roms, romcheck);
+}
+
static int bip_a1000 (struct uae_prefs *p, int config, int compa, int romcheck)
{
int roms[2];
p->cs_denisenoehb = 1;
if (config > 1)
p->chipmem_size = 0x40000;
+ if (config > 2)
+ bip_velvet(p, config, compa, romcheck);
return configure_rom (p, roms, romcheck);
}
}
}
+static uae_u32 getciatod(uae_u32 tod)
+{
+ if (!currprefs.cs_cia6526)
+ return tod;
+ uae_u32 bcdtod = 0;
+ for (int i = 0; i < 4; i++) {
+ int val = tod % 10;
+ bcdtod *= 16;
+ bcdtod += val;
+ tod /= 10;
+ }
+ return bcdtod;
+}
+static void setciatod(unsigned long *tod, uae_u32 v)
+{
+ if (!currprefs.cs_cia6526) {
+ *tod = v;
+ return;
+ }
+ uae_u32 bintod = 0;
+ for (int i = 0; i < 4; i++) {
+ int val = v / 16;
+ bintod *= 10;
+ bintod += val;
+ v /= 16;
+ }
+ *tod = bintod;
+}
+
static uae_u8 ReadCIAA (unsigned int addr)
{
unsigned int tmp;
case 8:
if (ciaatlatch) {
ciaatlatch = 0;
- return (uae_u8)ciaatol;
+ return getciatod(ciaatol);
} else
- return (uae_u8)ciaatod;
+ return getciatod(ciaatod);
case 9:
if (ciaatlatch)
- return (uae_u8)(ciaatol >> 8);
+ return getciatod(ciaatol) >> 8;
else
- return (uae_u8)(ciaatod >> 8);
+ return getciatod(ciaatod) >> 8;
case 10:
- if (!ciaatlatch) { /* only if not already latched. A1200 confirmed. (TW) */
- /* no latching if ALARM is set */
- if (!(ciaacrb & 0x80))
- ciaatlatch = 1;
- ciaatol = ciaatod;
+ /* only if not already latched. A1200 confirmed. (TW) */
+ if (!currprefs.cs_cia6526) {
+ if (!ciaatlatch) {
+ /* no latching if ALARM is set */
+ if (!(ciaacrb & 0x80))
+ ciaatlatch = 1;
+ ciaatol = ciaatod;
+ }
+ return getciatod(ciaatol) >> 16;
+ } else {
+ if (ciaatlatch)
+ return getciatod(ciaatol) >> 16;
+ else
+ return getciatod(ciaatod) >> 16;
+ }
+ break;
+ case 11:
+ if (currprefs.cs_cia6526) {
+ if (!ciaatlatch) {
+ if (!(ciaacrb & 0x80))
+ ciaatlatch = 1;
+ ciaatol = ciaatod;
+ }
+ if (ciaatlatch)
+ return getciatod(ciaatol) >> 24;
+ else
+ return getciatod(ciaatod) >> 24;
}
- return (uae_u8)(ciaatol >> 16);
+ break;
case 12:
#if KB_DEBUG
write_log (_T("CIAA serial port: %02x %08x\n"), ciaasdr, M68K_GETPC);
CIAB_tod_check ();
if (ciabtlatch) {
ciabtlatch = 0;
- return (uae_u8)ciabtol;
+ return getciatod(ciabtol);
} else
- return (uae_u8)ciabtod;
+ return getciatod(ciabtod);
case 9:
CIAB_tod_check ();
if (ciabtlatch)
- return (uae_u8)(ciabtol >> 8);
+ return getciatod(ciabtol) >> 8;
else
- return (uae_u8)(ciabtod >> 8);
+ return getciatod(ciabtod) >> 8;
case 10:
CIAB_tod_check ();
- if (!ciabtlatch) {
- /* no latching if ALARM is set */
- if (!(ciabcrb & 0x80))
- ciabtlatch = 1;
- ciabtol = ciabtod;
+ if (!currprefs.cs_cia6526) {
+ if (!ciabtlatch) {
+ /* no latching if ALARM is set */
+ if (!(ciabcrb & 0x80))
+ ciabtlatch = 1;
+ ciabtol = ciabtod;
+ }
+ return getciatod(ciabtol) >> 16;
+ } else {
+ if (ciabtlatch)
+ return getciatod(ciabtol) >> 16;
+ else
+ return getciatod(ciabtod) >> 16;
+ }
+ case 11:
+ if (currprefs.cs_cia6526) {
+ if (!ciabtlatch) {
+ if (!(ciabcrb & 0x80))
+ ciabtlatch = 1;
+ ciabtol = ciabtod;
+ }
+ if (ciabtlatch)
+ return getciatod(ciabtol) >> 24;
+ else
+ return getciatod(ciabtod) >> 24;
}
- return (uae_u8)(ciabtol >> 16);
+ break;
case 12:
return ciabsdr;
case 13:
break;
case 8:
if (ciaacrb & 0x80) {
- ciaaalarm = (ciaaalarm & ~0xff) | val;
+ setciatod(&ciaaalarm , (getciatod(ciaaalarm) & ~0xff) | val);
} else {
- ciaatod = (ciaatod & ~0xff) | val;
+ setciatod(&ciaatod, (getciatod(ciaatod) & ~0xff) | val);
ciaatodon = 1;
ciaa_checkalarm (false);
}
break;
case 9:
if (ciaacrb & 0x80) {
- ciaaalarm = (ciaaalarm & ~0xff00) | (val << 8);
+ setciatod(&ciaaalarm, (getciatod(ciaaalarm) & ~0xff00) | (val << 8));
} else {
- ciaatod = (ciaatod & ~0xff00) | (val << 8);
+ setciatod(&ciaatod, (getciatod(ciaatod) & ~0xff00) | (val << 8));
}
break;
case 10:
if (ciaacrb & 0x80) {
- ciaaalarm = (ciaaalarm & ~0xff0000) | (val << 16);
+ setciatod(&ciaaalarm, (getciatod(ciaaalarm) & ~0xff0000) | (val << 16));
} else {
- ciaatod = (ciaatod & ~0xff0000) | (val << 16);
- ciaatodon = 0;
+ setciatod(&ciaatod, (getciatod(ciaatod) & ~0xff0000) | (val << 16));
+ if (!currprefs.cs_cia6526)
+ ciaatodon = 0;
+ }
+ break;
+ case 11:
+ if (currprefs.cs_cia6526) {
+ if (ciaacrb & 0x80) {
+ setciatod(&ciaaalarm, (getciatod(ciaaalarm) & ~0xff000000) | (val << 24));
+ } else {
+ setciatod(&ciaatod, (getciatod(ciaatod) & ~0xff000000) | (val << 24));
+ ciaatodon = 0;
+ }
}
break;
case 12:
case 8:
CIAB_tod_check ();
if (ciabcrb & 0x80) {
- ciabalarm = (ciabalarm & ~0xff) | val;
+ setciatod(&ciabalarm, (getciatod(ciabalarm) & ~0xff) | val);
} else {
- ciabtod = (ciabtod & ~0xff) | val;
+ setciatod(&ciabtod, (getciatod(ciabtod) & ~0xff) | val);
ciabtodon = 1;
ciab_checkalarm (false, true);
}
case 9:
CIAB_tod_check ();
if (ciabcrb & 0x80) {
- ciabalarm = (ciabalarm & ~0xff00) | (val << 8);
+ setciatod(&ciabalarm, (getciatod(ciabalarm) & ~0xff00) | (val << 8));
} else {
- ciabtod = (ciabtod & ~0xff00) | (val << 8);
+ setciatod(&ciabtod, (getciatod(ciabtod) & ~0xff00) | (val << 8));
}
break;
case 10:
CIAB_tod_check ();
if (ciabcrb & 0x80) {
- ciabalarm = (ciabalarm & ~0xff0000) | (val << 16);
+ setciatod(&ciabalarm, (getciatod(ciabalarm) & ~0xff0000) | (val << 16));
} else {
- ciabtod = (ciabtod & ~0xff0000) | (val << 16);
- ciabtodon = 0;
+ setciatod(&ciabtod, (getciatod(ciabtod) & ~0xff0000) | (val << 16));
+ if (!currprefs.cs_cia6526)
+ ciabtodon = 0;
+ }
+ break;
+ case 11:
+ if (currprefs.cs_cia6526) {
+ CIAB_tod_check ();
+ if (ciabcrb & 0x80) {
+ setciatod(&ciabalarm, (getciatod(ciabalarm) & ~0xff000000) | (val << 24));
+ } else {
+ setciatod(&ciabtod, (getciatod(ciabtod) & ~0xff000000) | (val << 24));
+ ciabtodon = 0;
+ }
}
break;
case 12: