Revision: 45719
http://sourceforge.net/p/vice-emu/code/45719
Author: gpz
Date: 2025-07-30 23:50:48 +0000 (Wed, 30 Jul 2025)
Log Message:
-----------
hotfix for #2155 - the proper fix will be to convert ps/2 mouse and hummer-adc to the new userport system
Modified Paths:
--------------
trunk/vice/src/c64dtv/c64dtvcia2.c
trunk/vice/src/c64dtv/hummeradc.c
Modified: trunk/vice/src/c64dtv/c64dtvcia2.c
===================================================================
--- trunk/vice/src/c64dtv/c64dtvcia2.c 2025-07-29 23:17:47 UTC (rev 45718)
+++ trunk/vice/src/c64dtv/c64dtvcia2.c 2025-07-30 23:50:48 UTC (rev 45719)
@@ -56,9 +56,13 @@
void cia2_store(uint16_t addr, uint8_t data)
{
if ((addr & 0x1f) == 1) {
- store_userport_pbx(data, USERPORT_NO_PULSE);
+ /* HACK: for now only call the userport system when neither ps/2 mouse
+ nor hummer adc is enabled */
+ if (!c64dtv_hummer_adc_enabled && !ps2mouse_enabled) {
+ store_userport_pbx(data, USERPORT_NO_PULSE);
+ }
- /* The functions below will gradually be removed as the functionality is added to the new userport system. */
+ /* FIXME: convert hummer adc and ps/2 mouse support to new userport system */
if (c64dtv_hummer_adc_enabled) {
hummeradc_store(data);
}
@@ -75,9 +79,13 @@
uint8_t retval = 0xff;
if ((addr & 0x1f) == 1) {
- retval = read_userport_pbx(retval);
+ /* HACK: for now only call the userport system when neither ps/2 mouse
+ nor hummer adc is enabled */
+ if (!c64dtv_hummer_adc_enabled && !ps2mouse_enabled) {
+ retval = read_userport_pbx(retval);
+ }
- /* The functions below will gradually be removed as the functionality is added to the new userport system. */
+ /* FIXME: convert hummer adc and ps/2 mouse support to new userport system */
if (ps2mouse_enabled) {
retval &= (ps2mouse_read() | 0x3f);
}
Modified: trunk/vice/src/c64dtv/hummeradc.c
===================================================================
--- trunk/vice/src/c64dtv/hummeradc.c 2025-07-29 23:17:47 UTC (rev 45718)
+++ trunk/vice/src/c64dtv/hummeradc.c 2025-07-30 23:50:48 UTC (rev 45719)
@@ -45,6 +45,7 @@
#define ADC_DIO_BIT 0x01
/* Hummer ADC variables */
+/* FIXME: move code from c64dtvmemsnapshot.c here, make static */
uint8_t hummeradc_value;
uint8_t hummeradc_channel;
uint8_t hummeradc_control;
@@ -112,7 +113,7 @@
{
uint16_t joyport_3_joystick_value;
#ifdef HUMMERADC_DEBUG_ENABLED
- HUMMERADC_DEBUG("write: value %02x, state %i", value, hummeradc_state);
+ HUMMERADC_DEBUG("write: value %02x, state %i, ADC:%2x", value, hummeradc_state, hummeradc_value);
#endif
if (value & ADC_START_BIT) {
hummeradc_state = ADC_START;
@@ -232,13 +233,13 @@
- "inertia" (hold down left/right for value++/--), handled elsewhere */
joyport_3_joystick_value = get_joystick_value(JOYPORT_3);
switch (joyport_3_joystick_value & 0x0c) {
- case 4:
+ case 4: /* left */
hummeradc_value = 0x00;
break;
- case 8:
+ case 8: /* right */
hummeradc_value = 0xff;
break;
- default:
+ default: /* neutral */
hummeradc_value = 0x80;
break;
}
@@ -303,7 +304,7 @@
break;
}
#ifdef HUMMERADC_DEBUG_ENABLED
- HUMMERADC_DEBUG(" read: value %02x, state %i", retval, hummeradc_state);
+ HUMMERADC_DEBUG(" read: value %02x, state %i, ADC:%2x", retval, hummeradc_state, hummeradc_value);
#endif
return retval;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|