vice-emu-commit Mailing List for VICE (Page 9)
Versatile Commodore Emulator
Brought to you by:
blackystardust,
gpz
You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
(38) |
May
(60) |
Jun
(122) |
Jul
(148) |
Aug
(178) |
Sep
(151) |
Oct
(131) |
Nov
(208) |
Dec
(129) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(193) |
Feb
(209) |
Mar
(221) |
Apr
(243) |
May
(165) |
Jun
(168) |
Jul
(198) |
Aug
(161) |
Sep
(103) |
Oct
(98) |
Nov
(168) |
Dec
(99) |
| 2010 |
Jan
(263) |
Feb
(156) |
Mar
(57) |
Apr
(93) |
May
(85) |
Jun
(124) |
Jul
(57) |
Aug
(58) |
Sep
(113) |
Oct
(148) |
Nov
(114) |
Dec
(193) |
| 2011 |
Jan
(200) |
Feb
(207) |
Mar
(91) |
Apr
(91) |
May
(142) |
Jun
(104) |
Jul
(115) |
Aug
(137) |
Sep
(266) |
Oct
(91) |
Nov
(85) |
Dec
(186) |
| 2012 |
Jan
(98) |
Feb
(146) |
Mar
(160) |
Apr
(99) |
May
(59) |
Jun
(257) |
Jul
(84) |
Aug
(103) |
Sep
(169) |
Oct
(206) |
Nov
(90) |
Dec
(296) |
| 2013 |
Jan
(294) |
Feb
(130) |
Mar
(36) |
Apr
(14) |
May
(51) |
Jun
(74) |
Jul
(180) |
Aug
(85) |
Sep
(26) |
Oct
(45) |
Nov
(29) |
Dec
(21) |
| 2014 |
Jan
(56) |
Feb
(40) |
Mar
(57) |
Apr
(30) |
May
(31) |
Jun
(11) |
Jul
(107) |
Aug
(135) |
Sep
(142) |
Oct
(195) |
Nov
(139) |
Dec
(133) |
| 2015 |
Jan
(293) |
Feb
(161) |
Mar
(146) |
Apr
(85) |
May
(139) |
Jun
(51) |
Jul
(21) |
Aug
(24) |
Sep
(29) |
Oct
(136) |
Nov
(212) |
Dec
(118) |
| 2016 |
Jan
(119) |
Feb
(165) |
Mar
(229) |
Apr
(219) |
May
(134) |
Jun
(119) |
Jul
(134) |
Aug
(236) |
Sep
(203) |
Oct
(215) |
Nov
(300) |
Dec
(140) |
| 2017 |
Jan
(188) |
Feb
(20) |
Mar
(147) |
Apr
(198) |
May
(26) |
Jun
(21) |
Jul
(67) |
Aug
(219) |
Sep
(209) |
Oct
(194) |
Nov
(144) |
Dec
(99) |
| 2018 |
Jan
(139) |
Feb
(122) |
Mar
(116) |
Apr
(85) |
May
(232) |
Jun
(181) |
Jul
(190) |
Aug
(105) |
Sep
(92) |
Oct
(178) |
Nov
(105) |
Dec
(86) |
| 2019 |
Jan
(119) |
Feb
(79) |
Mar
(74) |
Apr
(117) |
May
(115) |
Jun
(307) |
Jul
(107) |
Aug
(131) |
Sep
(103) |
Oct
(60) |
Nov
(118) |
Dec
(70) |
| 2020 |
Jan
(114) |
Feb
(103) |
Mar
(77) |
Apr
(121) |
May
(193) |
Jun
(110) |
Jul
(214) |
Aug
(210) |
Sep
(179) |
Oct
(260) |
Nov
(237) |
Dec
(334) |
| 2021 |
Jan
(163) |
Feb
(186) |
Mar
(58) |
Apr
(81) |
May
(108) |
Jun
(175) |
Jul
(154) |
Aug
(180) |
Sep
(217) |
Oct
(204) |
Nov
(232) |
Dec
(190) |
| 2022 |
Jan
(253) |
Feb
(134) |
Mar
(229) |
Apr
(190) |
May
(125) |
Jun
(70) |
Jul
(8) |
Aug
(22) |
Sep
(19) |
Oct
(33) |
Nov
(94) |
Dec
(164) |
| 2023 |
Jan
(158) |
Feb
(366) |
Mar
(272) |
Apr
(109) |
May
(198) |
Jun
(226) |
Jul
(200) |
Aug
(94) |
Sep
(108) |
Oct
(62) |
Nov
(175) |
Dec
(116) |
| 2024 |
Jan
(35) |
Feb
(40) |
Mar
(51) |
Apr
(89) |
May
(24) |
Jun
(26) |
Jul
(53) |
Aug
(71) |
Sep
(23) |
Oct
(11) |
Nov
(22) |
Dec
(58) |
| 2025 |
Jan
(26) |
Feb
(40) |
Mar
(107) |
Apr
(39) |
May
(35) |
Jun
(20) |
Jul
(11) |
Aug
(24) |
Sep
(35) |
Oct
(26) |
Nov
|
Dec
|
|
From: <co...@us...> - 2025-03-30 06:06:33
|
Revision: 45606
http://sourceforge.net/p/vice-emu/code/45606
Author: compyx
Date: 2025-03-30 06:06:21 +0000 (Sun, 30 Mar 2025)
Log Message:
-----------
Joystick: update NetBSD/FreeBSD driver
Update `joy_axis_event()`, `joy_button_event()` and `joy_hat_event()` calls
in line with latest API change.
Modified Paths:
--------------
branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_bsd.c
Modified: branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_bsd.c
===================================================================
--- branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_bsd.c 2025-03-30 06:01:28 UTC (rev 45605)
+++ branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_bsd.c 2025-03-30 06:06:21 UTC (rev 45606)
@@ -234,7 +234,7 @@
prev = priv->prev_axes[axis->index];
if (value != prev) {
priv->prev_axes[axis->index] = value;
- joy_axis_event(joydev, axis, (int32_t)value);
+ joy_axis_event(axis, (int32_t)value);
}
}
break;
@@ -246,7 +246,7 @@
prev = priv->prev_hats[hat->index];
if (prev != value) {
priv->prev_hats[hat->index] = value;
- joy_hat_event(joydev, hat, (int32_t)value);
+ joy_hat_event(hat, (int32_t)value);
}
}
break;
@@ -261,7 +261,7 @@
prev = priv->prev_buttons[button->index];
if (prev != value) {
priv->prev_buttons[button->index] = value;
- joy_button_event(joydev, button, (int32_t)value);
+ joy_button_event(button, (int32_t)value);
}
}
break;
@@ -276,7 +276,7 @@
prev = priv->prev_buttons[button->index];
if (prev != value) {
priv->prev_buttons[button->index] = value;
- joy_button_event(joydev, button, (int32_t)value);
+ joy_button_event(button, (int32_t)value);
}
}
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-03-30 06:01:36
|
Revision: 45605
http://sourceforge.net/p/vice-emu/code/45605
Author: compyx
Date: 2025-03-30 06:01:28 +0000 (Sun, 30 Mar 2025)
Log Message:
-----------
Joystick: store parent device reference in axis, button and hat objects
Further simplify API by storing the parent device of axes, buttons and hats in
the respective objects. Makes event handlers accept (event-object, event-value).
Windows and Free/NetBSD drivers will need updating.
Modified Paths:
--------------
branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_linux_evdev.c
branches/compyx/joymap-001/vice/src/arch/sdl/joy.c
branches/compyx/joymap-001/vice/src/arch/sdl/ui.c
branches/compyx/joymap-001/vice/src/arch/sdl/uimenu.c
branches/compyx/joymap-001/vice/src/joyport/joystick.c
branches/compyx/joymap-001/vice/src/joyport/joystick.h
Modified: branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_linux_evdev.c
===================================================================
--- branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_linux_evdev.c 2025-03-30 05:37:26 UTC (rev 45604)
+++ branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_linux_evdev.c 2025-03-30 06:01:28 UTC (rev 45605)
@@ -145,7 +145,7 @@
button = joystick_button_from_code(joydev, event->code);
if (button != NULL) {
- joy_button_event(joydev, button, event->value);
+ joy_button_event(button, event->value);
}
} else if (event->type == EV_ABS) {
@@ -157,7 +157,7 @@
#endif
axis = joystick_axis_from_code(joydev, event->code);
if (axis != NULL) {
- joy_axis_event(joydev, axis, event->value);
+ joy_axis_event(axis, event->value);
}
}
}
Modified: branches/compyx/joymap-001/vice/src/arch/sdl/joy.c
===================================================================
--- branches/compyx/joymap-001/vice/src/arch/sdl/joy.c 2025-03-30 05:37:26 UTC (rev 45604)
+++ branches/compyx/joymap-001/vice/src/arch/sdl/joy.c 2025-03-30 06:01:28 UTC (rev 45605)
@@ -684,7 +684,7 @@
cur = sdljoy_axis_direction(value, prev);
#endif
- joy_axis_event(joydev, axis, value);
+ joy_axis_event(axis, value);
}
static ui_menu_action_t sdljoy_perform_event_for_menu_action(joystick_mapping_t* event, Sint16 value)
Modified: branches/compyx/joymap-001/vice/src/arch/sdl/ui.c
===================================================================
--- branches/compyx/joymap-001/vice/src/arch/sdl/ui.c 2025-03-30 05:37:26 UTC (rev 45604)
+++ branches/compyx/joymap-001/vice/src/arch/sdl/ui.c 2025-03-30 06:01:28 UTC (rev 45605)
@@ -283,12 +283,12 @@
case SDL_JOYBUTTONUP:
if (sdljoy_get_joy_for_event((VICE_SDL_JoystickID)e.jbutton.which, &joydev, &joynum)) {
button = joydev->buttons[e.jbutton.button];
- joy_button_event(joydev, button, e.type == SDL_JOYBUTTONDOWN ? 1: 0);
+ joy_button_event(button, e.type == SDL_JOYBUTTONDOWN ? 1: 0);
}
break;
case SDL_JOYHATMOTION:
if (sdljoy_get_joy_for_event((VICE_SDL_JoystickID)e.jaxis.which, &joydev, &joynum)) {
- joy_hat_event(joydev, joydev->hats[e.jhat.hat], hat_map[e.jhat.value]);
+ joy_hat_event(joydev->hats[e.jhat.hat], hat_map[e.jhat.value]);
}
break;
#endif
Modified: branches/compyx/joymap-001/vice/src/arch/sdl/uimenu.c
===================================================================
--- branches/compyx/joymap-001/vice/src/arch/sdl/uimenu.c 2025-03-30 05:37:26 UTC (rev 45604)
+++ branches/compyx/joymap-001/vice/src/arch/sdl/uimenu.c 2025-03-30 06:01:28 UTC (rev 45605)
@@ -1208,14 +1208,13 @@
case SDL_JOYBUTTONDOWN: /* fall through */
case SDL_JOYBUTTONUP:
if (sdljoy_get_joy_for_event(e.jbutton.which, &joydev, &joynum)) {
- joy_button_event(joydev,
- joydev->buttons[e.jbutton.button],
+ joy_button_event(joydev->buttons[e.jbutton.button],
e.type == SDL_JOYBUTTONDOWN ? 1 : 0);
}
break;
case SDL_JOYHATMOTION:
if (sdljoy_get_joy_for_event(e.jhat.which, &joydev, &joynum)) {
- joy_hat_event(joydev, joydev->hats[e.jhat.hat], e.jhat.value);
+ joy_hat_event(joydev->hats[e.jhat.hat], e.jhat.value);
}
break;
#endif
Modified: branches/compyx/joymap-001/vice/src/joyport/joystick.c
===================================================================
--- branches/compyx/joymap-001/vice/src/joyport/joystick.c 2025-03-30 05:37:26 UTC (rev 45604)
+++ branches/compyx/joymap-001/vice/src/joyport/joystick.c 2025-03-30 06:01:28 UTC (rev 45605)
@@ -2988,13 +2988,16 @@
}
-void joy_axis_event(joystick_device_t *joydev,
- joystick_axis_t *axis,
- int32_t value)
+/** \brief Handle joystick axis event
+ *
+ * \param[in] axis joystick axis
+ * \param[in] value raw value for \a axis
+ */
+void joy_axis_event(joystick_axis_t *axis, int32_t value)
{
joystick_axis_value_t direction = JOY_AXIS_MIDDLE;
joystick_axis_value_t prev = axis->prev;
- int joyport = joydev->joyport;
+ int joyport = axis->device->joyport;
/* digital axes don't require calibration: */
@@ -3041,7 +3044,7 @@
}
DBG(("joy_axis_event: joy: %s axis: %d value: %d: direction: %d prev: %d\n",
- joydev->name, axis->index, value, direction, prev));
+ axis->device->name, axis->index, value, direction, prev));
/* release directions first if needed */
if (prev == JOY_AXIS_POSITIVE) {
@@ -3062,9 +3065,13 @@
axis->prev = direction;
}
-void joy_button_event(joystick_device_t *joydev,
- joystick_button_t *button,
- int32_t value)
+
+/** \brief Handle joystick button event
+ *
+ * \param[in] button joystick button
+ * \param[in] value raw value for \a button
+ */
+void joy_button_event(joystick_button_t *button, int32_t value)
{
int32_t pressed = value ? 1 : 0;
#if 0
@@ -3082,18 +3089,21 @@
#endif
if (value != button->prev) {
DBG(("joy_button_event: joy: %s, button: %d (%s) pressed: %d\n",
- joydev->name, button->index, button->name, pressed));
- joy_perform_event(&button->mapping, joydev->joyport, pressed);
+ button->device->name, button->index, button->name, pressed));
+ joy_perform_event(&button->mapping, button->device->joyport, pressed);
button->prev = value;
}
}
-void joy_hat_event(joystick_device_t *joydev,
- joystick_hat_t *hat,
- int32_t value)
+/** \brief Handle joystick hat event
+ *
+ * \param[in] hat joystick hat
+ * \param[in] value direction bitmask for \a hat
+ */
+void joy_hat_event(joystick_hat_t *hat, int32_t value)
{
- int joyport = joydev->joyport;
+ int joyport = hat->device->joyport;
int32_t prev = hat->prev;
if (value == prev) {
@@ -3802,6 +3812,7 @@
axis->minimum = INT16_MIN;
axis->maximum = INT16_MAX;
axis->digital = false;
+ axis->device = NULL;
joystick_mapping_init(&axis->mapping.negative);
joystick_mapping_init(&axis->mapping.positive);
axis->mapping.pot = 0; /* no POT mapped */
@@ -3817,10 +3828,11 @@
*/
static void joystick_button_init(joystick_button_t *button)
{
- button->code = 0;
- button->name = NULL;
- button->prev = 0;
- button->index = -1;
+ button->code = 0;
+ button->name = NULL;
+ button->prev = 0;
+ button->index = -1;
+ button->device = NULL;
joystick_mapping_init(&button->mapping);
joystick_calibration_init(&button->calibration);
}
@@ -3834,10 +3846,11 @@
*/
static void joystick_hat_init(joystick_hat_t *hat)
{
- hat->code = 0;
- hat->name = NULL;
- hat->prev = 0;
- hat->index = -1;
+ hat->code = 0;
+ hat->name = NULL;
+ hat->prev = 0;
+ hat->index = -1;
+ hat->device = NULL;
joystick_mapping_init(&hat->mapping.up);
joystick_mapping_init(&hat->mapping.down);
joystick_mapping_init(&hat->mapping.left);
@@ -3972,10 +3985,14 @@
/* set default calibration */
joystick_calibration_default_for_axis(axis);
+#if 0
printf("AXIS %d: min: %d, N-threshold: %d, P-threshold: %d, max: %d\n",
joydev->num_axes,
axis->minimum, axis->calibration.threshold.negative,
axis->calibration.threshold.positive, axis->maximum);
+#endif
+ /* store parent device */
+ axis->device = joydev;
joydev->axes[joydev->num_axes++] = axis;
}
@@ -4005,6 +4022,8 @@
joydev->buttons = lib_realloc(joydev->buttons,
sizeof *joydev->buttons * (size_t)joydev->max_buttons);
}
+
+ button->device = joydev;
joydev->buttons[joydev->num_buttons++] = button;
}
@@ -4033,6 +4052,8 @@
joydev->hats = lib_realloc(joydev->hats,
sizeof *joydev->hats * (size_t)joydev->max_hats);
}
+
+ hat->device = joydev;
joydev->hats[joydev->num_hats++] = hat;
}
@@ -4050,9 +4071,6 @@
for (i = 0; i < joydev->num_axes; i++) {
if (joydev->axes[i]->code == code) {
return joydev->axes[i];
- } else if (joydev->axes[i]->code > code) {
- /* codes are in-order: done */
- return NULL;
}
}
return NULL;
@@ -4072,9 +4090,6 @@
for (i = 0; i < joydev->num_buttons; i++) {
if (joydev->buttons[i]->code == code) {
return joydev->buttons[i];
- } else if (joydev->buttons[i]->code > code) {
- /* codes are in-order: done */
- return NULL;
}
}
return NULL;
@@ -4094,9 +4109,6 @@
for (i = 0; i < joydev->num_hats; i++) {
if (joydev->hats[i]->code == code) {
return joydev->hats[i];
- } else if (joydev->hats[i]->code > code) {
- /* codes are in-order: done */
- return NULL;
}
}
return NULL;
Modified: branches/compyx/joymap-001/vice/src/joyport/joystick.h
===================================================================
--- branches/compyx/joymap-001/vice/src/joyport/joystick.h 2025-03-30 05:37:26 UTC (rev 45604)
+++ branches/compyx/joymap-001/vice/src/joyport/joystick.h 2025-03-30 06:01:28 UTC (rev 45605)
@@ -191,12 +191,13 @@
* Information on a host device button input.
*/
typedef struct joystick_button_s {
- uint32_t code; /**< event code */
- char *name; /**< button name */
- int32_t prev; /**< previous polled value */
- int32_t index; /**< index in buttons array */
- joystick_mapping_t mapping; /**< button mapping */
- joystick_calibration_t calibration; /**< button calibration */
+ uint32_t code; /**< event code */
+ char *name; /**< button name */
+ int32_t prev; /**< previous polled value */
+ int32_t index; /**< index in buttons array */
+ joystick_mapping_t mapping; /**< button mapping */
+ joystick_calibration_t calibration; /**< button calibration */
+ struct joystick_device_s *device; /**< parent joystick device */
} joystick_button_t;
@@ -213,7 +214,6 @@
int32_t minimum; /**< minimum axis value */
int32_t maximum; /**< maximum axis value */
bool digital; /**< axis is digital (reports -1, 0, 1) */
-
struct {
joystick_mapping_t negative; /**< negative direction */
joystick_mapping_t positive; /**< positive direction */
@@ -221,9 +221,9 @@
} mapping; /**< mapping for negative and positive directions, and
pot. TODO: support pot values other than on/off so
emulated paddles and mice can be mapped to axes. */
+ joystick_calibration_t calibration; /**< axis calibration */
+ struct joystick_device_s *device; /**< parent joystick device */
- joystick_calibration_t calibration; /**< axis calibration */
-
} joystick_axis_t;
@@ -242,8 +242,9 @@
joystick_mapping_t left; /**< mapping for 'left' direction */
joystick_mapping_t right; /**< mapping for 'right' direction */
} mapping; /**< mappings per direction */
- joystick_calibration_t calibration; /* XXX: no idea if this makes sense
+ joystick_calibration_t calibration; /* XXX: no idea if this makes sense
for hats */
+ struct joystick_device_s *device; /**< parent joystick device */
} joystick_hat_t;
@@ -394,9 +395,9 @@
void joystick_set_snes_mapping(int port);
-void joy_axis_event (joystick_device_t *joydev, joystick_axis_t *axis, int32_t value);
-void joy_button_event(joystick_device_t *joydev, joystick_button_t *button, int32_t value);
-void joy_hat_event (joystick_device_t *joydev, joystick_hat_t *hat, int32_t value);
+void joy_axis_event (joystick_axis_t *axis, int32_t value);
+void joy_button_event(joystick_button_t *button, int32_t value);
+void joy_hat_event (joystick_hat_t *hat, int32_t value);
void joystick(void);
void joystick_close(void);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-03-30 05:37:27
|
Revision: 45604
http://sourceforge.net/p/vice-emu/code/45604
Author: compyx
Date: 2025-03-30 05:37:26 +0000 (Sun, 30 Mar 2025)
Log Message:
-----------
Start documenting the changes in joystick API
Create `doc/joystick.md` to document the joystick API and provide instructions
on how to create an arch-specific driver. WIP, subject to change.
Modified Paths:
--------------
branches/compyx/joymap-001/vice/doc/Makefile.am
Added Paths:
-----------
branches/compyx/joymap-001/vice/doc/joystick.md
Modified: branches/compyx/joymap-001/vice/doc/Makefile.am
===================================================================
--- branches/compyx/joymap-001/vice/doc/Makefile.am 2025-03-29 18:03:17 UTC (rev 45603)
+++ branches/compyx/joymap-001/vice/doc/Makefile.am 2025-03-30 05:37:26 UTC (rev 45604)
@@ -6,6 +6,7 @@
Documentation-Howto.txt \
Doxygen-Howto.txt \
iec-bus.txt \
+ joystick.md \
Release-Howto.txt \
vice.texi \
gpl.texi
Added: branches/compyx/joymap-001/vice/doc/joystick.md
===================================================================
--- branches/compyx/joymap-001/vice/doc/joystick.md (rev 0)
+++ branches/compyx/joymap-001/vice/doc/joystick.md 2025-03-30 05:37:26 UTC (rev 45604)
@@ -0,0 +1,61 @@
+# VICE Joystick API
+
+
+## Preface
+
+This document describes the updated joystick API, which currently is a **work in
+progress**. All information herein is subject to change while the joystick code
+is being worked on. The inner workings of the actual emulation of the I/O system
+will not be described, just the translation of host device input to emulated
+joystick device, so no actual CIA/VIA emulation.
+
+
+## Overview of the joystick system in VICE
+
+The joystick system in VICE is split into two parts: **common code** and
+**driver code**. The driver code is specific to an OS/UI, while the common code,
+as the name implies, is used for every OS/UI.
+
+### Common code
+
+The common code (in `src/joyport/`) is responsible for interpreting data from
+the drivers and passing that to the emulation, as well as handling mapping and
+calibration of host inputs to emulated inputs. It is also responsible for
+providing the UI with information on host and emulated devices, and at a later
+point, passing host input to the UI for mapping and calibration dialogs.
+
+### Driver code
+
+The driver code is responsible for reading data from a host device and passing
+that back to the common code, as well as providing the common code with a list
+of available host devices and their properties.
+
+
+## Changes in the separation of driver and common code
+
+I've tried to keep the code required to implement a driver as small as possible,
+moving a number of responsibilities from the drivers to the common code.
+
+* The old code would let the driver interpret raw axis and button values and
+ send that back to the emulation (during the `poll()` callback). The drivers
+ now simply pass the raw values to the common code, and the common code
+ interprets those values with the help of the information on the host devices
+ provided by the driver (while also doing calibration).
+
+* A driver no longer needs to concern itself with ordering inputs, the common
+ code handles that.
+
+* Every input now has a unique *code*, which can be an event code (like with
+ Linux' evdev), a simple index of the input (as in SDL) or a HID usage code
+ (as on FreeBSD/NetBSD). The API provides drivers with methods of looking up
+ axis, button and hat objects through their respective code.
+
+* Event handlers in the common code now refer to inputs by instance, not index.
+ So for an axis event a driver would call `joy_axis_event()` with a host device
+ instance, axis instance and raw axis value.
+
+
+**TODO**: Proper (simple) description of `joystick_device_t` and its members
+ `joystick_axis_t`, `joystick_button_t` and `joystick_hat_t`.
+**TODO**: Explain ownership of objects (container assumes ownership of its
+ elements and is responsible for freeing them after use, etc).
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gp...@us...> - 2025-03-29 18:03:20
|
Revision: 45603
http://sourceforge.net/p/vice-emu/code/45603
Author: gpz
Date: 2025-03-29 18:03:17 +0000 (Sat, 29 Mar 2025)
Log Message:
-----------
remove support for ancient libnet, remove VICE_USE_LIBNET_1_1, fix HAVE_LIBNET logic so it even might get used now :)
Modified Paths:
--------------
trunk/vice/configure.ac
trunk/vice/src/arch/shared/rawnetarch_unix.c
trunk/vice/src/vicefeatures.c
Modified: trunk/vice/configure.ac
===================================================================
--- trunk/vice/configure.ac 2025-03-29 13:27:28 UTC (rev 45602)
+++ trunk/vice/configure.ac 2025-03-29 18:03:17 UTC (rev 45603)
@@ -2433,7 +2433,7 @@
AC_DEFINE(HAVE_PCAP,,[Support for PCAP library.])
AC_DEFINE(HAVE_RAWNET,,[Support for CS8900A ethernet controller.])
HAVE_RAWNET_SUPPORT="yes";
- AC_DEFINE(VICE_USE_LIBNET_1_1,,[Support for The Final Ethernet])
+ AC_DEFINE(HAVE_LIBNET,,[Support for libnet library])
TFE_LIBS="-lpcap `libnet-config --libs`"
libnet_cflags="`libnet-config --defines`"
],,$LIBS)],,$LIBS)
@@ -2444,6 +2444,7 @@
AC_DEFINE(HAVE_PCAP,,[Support for PCAP library.])
AC_DEFINE(HAVE_RAWNET,,[Support for CS8900A ethernet controller.])
HAVE_RAWNET_SUPPORT="yes";
+ AC_DEFINE(HAVE_LIBNET,,[Support for libnet library])
TFE_LIBS="-lpcap `libnet-config --libs`"
libnet_cflags="`libnet-config --defines`"
],,$LIBS)],,$LIBS)
Modified: trunk/vice/src/arch/shared/rawnetarch_unix.c
===================================================================
--- trunk/vice/src/arch/shared/rawnetarch_unix.c 2025-03-29 13:27:28 UTC (rev 45602)
+++ trunk/vice/src/arch/shared/rawnetarch_unix.c 2025-03-29 18:03:17 UTC (rev 45603)
@@ -96,14 +96,8 @@
static pcap_t *rawnet_pcap_fp = NULL;
#ifdef HAVE_LIBNET
-#ifdef VICE_USE_LIBNET_1_1
static libnet_t *TfeLibnetFP = NULL;
-#else /* VICE_USE_LIBNET_1_1 */
-static struct libnet_link_int *TfeLibnetFP = NULL;
-#endif /* VICE_USE_LIBNET_1_1 */
-
static char TfeLibnetErrBuf[LIBNET_ERRBUF_SIZE];
-
#endif /* HAVE_LIBNET */
@@ -202,11 +196,7 @@
#ifdef HAVE_LIBNET
/* now, open the libnet device to be able to send afterwards */
-#ifdef VICE_USE_LIBNET_1_1
TfeLibnetFP = libnet_init(LIBNET_LINK, (char *)interface_name, TfeLibnetErrBuf);
-#else /* VICE_USE_LIBNET_1_1 */
- TfeLibnetFP = libnet_open_link_interface(interface_name, TfeLibnetErrBuf);
-#endif /* VICE_USE_LIBNET_1_1 */
if (TfeLibnetFP == NULL) {
log_message(rawnet_arch_log, "Libnet interface could not be opened: '%s'", TfeLibnetErrBuf);
@@ -334,10 +324,8 @@
#ifdef HAVE_LIBNET
-# ifdef VICE_USE_LIBNET_1_1
+#define RAWNET_ARCH_TRANSMIT rawnet_arch_transmit_libnet_1_1
-# define RAWNET_ARCH_TRANSMIT rawnet_arch_transmit_libnet_1_1
-
static void rawnet_arch_transmit_libnet_1_1(int force, int onecoll,
int inhibit_crc, int tx_pad_dis, int txlength, uint8_t *txframe)
{
@@ -373,35 +361,6 @@
} while (0);
}
-# else /* VICE_USE_LIBNET_1_1 */
-
-# define RAWNET_ARCH_TRANSMIT rawnet_arch_transmit_libnet_1_0
-
-static void rawnet_arch_transmit_libnet_1_0(int force, int onecoll,
- int inhibit_crc, int tx_pad_dis, int txlength, uint8_t *txframe)
-{
- u_char *plibnet_buffer = NULL;
-
- /* we want to send via libnet 1.0 */
-
- if (libnet_init_packet(txlength, &plibnet_buffer)==-1) {
- log_message(rawnet_arch_log, "WARNING! Could not send packet!");
- } else {
- if (plibnet_buffer) {
- memcpy(plibnet_buffer, txframe, txlength);
- libnet_write_link_layer(TfeLibnetFP, "eth0", plibnet_buffer, txlength);
- libnet_destroy_packet(&plibnet_buffer);
- } else {
- log_message(rawnet_arch_log,
- "WARNING! Could not send packet: plibnet_buffer==NULL, "
- "but libnet_init_packet() did NOT fail!!");
- }
- }
-
-}
-
-# endif
-
#else /* HAVE_LIBNET */
# define RAWNET_ARCH_TRANSMIT rawnet_arch_transmit_pcap
Modified: trunk/vice/src/vicefeatures.c
===================================================================
--- trunk/vice/src/vicefeatures.c 2025-03-29 13:27:28 UTC (rev 45602)
+++ trunk/vice/src/vicefeatures.c 2025-03-29 18:03:17 UTC (rev 45603)
@@ -196,16 +196,6 @@
1 },
#endif
-/* FIXME: support for libnet < 1.1 should get removed */
-#if defined(UNIX_COMPILE) /* (unix) */
- { "VICE_USE_LIBNET_1_1", "Enable support for libnet 1.1",
-#ifndef VICE_USE_LIBNET_1_1
- 0 },
-#else
- 1 },
-#endif
-#endif
-
#if defined(UNIX_COMPILE) || defined(WINDOWS_COMPILE) /* (unix/windows) */
{ "HAVE_REALDEVICE", "Support for OpenCBM", /* (former CBM4Linux). */
#ifndef HAVE_REALDEVICE
@@ -324,6 +314,15 @@
1 },
#endif
+#if defined(UNIX_COMPILE) /* (unix) */
+ { "HAVE_LIBNET", "Use the libnet library.",
+#ifndef HAVE_LIBNET
+ 0 },
+#else
+ 1 },
+#endif
+#endif
+
#if !defined(WINDOWS_COMPILE) /* not windows */
{ "HAVE_TUNTAP", "Support for TUN/TAP virtual network interface.",
#ifndef HAVE_TUNTAP
@@ -485,29 +484,12 @@
#if 0
/* FIXME: appear in config.h but are not used in code: */
-/* Support for direct PCI I/O access Catweasel MKIII. */
-#define HAVE_CATWEASELMKIII_IO /**/
-/* Enable Fullscreen support. */
-/* #undef HAVE_FULLSCREEN */
-/* Support for PCI/ISA HardSID. */
-#define HAVE_HARDSID_IO /**/
-/* Enable support for BSD style joysticks. */
-/* #undef BSD_JOYSTICK */
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
-/* WARNING win32 and osx bindist greps for this in config.h! */
+/* WARNING osx bindist greps for this in config.h! */
/* External FFMPEG libraries are used */
#define EXTERNAL_FFMPEG /**/
/* WARNING osx bindist greps for this in config.h! */
/* External linking for lame libs */
#define HAVE_EXTERNAL_LAME /**/
-/* WARNING: seems to be used in makefiles all over the place */
-/* Enable the readline library */
-/* #undef HAVE_READLINE */
-
-/* appear in code, but should get removed */
-
-/* FIXME: support for libnet < 1.1 should get removed (unix) */
-/* Enable support for libnet 1.1 */
-#define VICE_USE_LIBNET_1_1
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-03-29 13:27:34
|
Revision: 45602
http://sourceforge.net/p/vice-emu/code/45602
Author: compyx
Date: 2025-03-29 13:27:28 +0000 (Sat, 29 Mar 2025)
Log Message:
-----------
Merge trunk (r45594:HEAD) into branch
Modified Paths:
--------------
branches/compyx/joymap-001/vice/data/CBM-II/Makefile.am
branches/compyx/joymap-001/vice/data/CBM-II/sdl_pos.vkm
branches/compyx/joymap-001/vice/data/CBM-II/sdl_sym.vkm
branches/compyx/joymap-001/vice/data/PLUS4/gtk3_pos.vkm
branches/compyx/joymap-001/vice/data/PLUS4/gtk3_pos_de.vkm
branches/compyx/joymap-001/vice/data/PLUS4/gtk3_sym.vkm
branches/compyx/joymap-001/vice/data/PLUS4/gtk3_sym_de.vkm
branches/compyx/joymap-001/vice/data/PLUS4/sdl_pos.vkm
branches/compyx/joymap-001/vice/data/PLUS4/sdl_sym.vkm
branches/compyx/joymap-001/vice/data/PLUS4/sdl_sym_de.vkm
branches/compyx/joymap-001/vice/src/monitor/monitor_binary.c
branches/compyx/joymap-001/vice/src/vic20/vic20-snapshot.c
branches/compyx/joymap-001/vice/src/vic20/vic20.c
branches/compyx/joymap-001/vice/src/vic20/vic20datasette.c
branches/compyx/joymap-001/vice/src/vic20/vic20iec.c
branches/compyx/joymap-001/vice/src/vic20/vic20rsuser.c
branches/compyx/joymap-001/vice/src/vic20/vic20via.h
branches/compyx/joymap-001/vice/src/vic20/vic20via1.c
branches/compyx/joymap-001/vice/src/vic20/vic20via2.c
Added Paths:
-----------
branches/compyx/joymap-001/vice/data/CBM-II/sdl_sym_de.vkm
Modified: branches/compyx/joymap-001/vice/data/CBM-II/Makefile.am
===================================================================
--- branches/compyx/joymap-001/vice/data/CBM-II/Makefile.am 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/data/CBM-II/Makefile.am 2025-03-29 13:27:28 UTC (rev 45602)
@@ -56,6 +56,7 @@
sdl_keymaps = \
sdl_sym.vkm \
+ sdl_sym_de.vkm \
sdl_pos.vkm
if USE_SDLUI
Modified: branches/compyx/joymap-001/vice/data/CBM-II/sdl_pos.vkm
===================================================================
--- branches/compyx/joymap-001/vice/data/CBM-II/sdl_pos.vkm 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/data/CBM-II/sdl_pos.vkm 2025-03-29 13:27:28 UTC (rev 45602)
@@ -178,7 +178,7 @@
91 1 4 8 /* [ -> [ */
93 2 3 8 /* ] -> ] */
13 2 5 8 /* Return -> pi */
-306 8 5 8 /* Left Ctrl -> CTRL */
+306 8 5 0x4008 /* Left Ctrl -> CTRL */
97 9 3 8 /* A -> A */
115 10 3 8 /* S -> S */
100 11 3 8 /* D -> D */
@@ -225,7 +225,7 @@
19 2 5 8 /* Pause/Break -> Pi */
280 5 0 8 /* PgUp -> Rev/Off */
279 5 1 8 /* End -> CE */
-305 3 4 8 /* Right Ctrl -> C= */
+305 3 4 0x2008 /* Right Ctrl -> C= */
271 7 4 8 /* Numpad Enter -> Numpad Enter */
267 7 1 8 /* Numpad / -> Numpad / */
263 4 2 8 /* Numpad 7 -> Numpad 7 */
Modified: branches/compyx/joymap-001/vice/data/CBM-II/sdl_sym.vkm
===================================================================
--- branches/compyx/joymap-001/vice/data/CBM-II/sdl_sym.vkm 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/data/CBM-II/sdl_sym.vkm 2025-03-29 13:27:28 UTC (rev 45602)
@@ -180,7 +180,7 @@
91 1 4 8 /* [ -> [ */
93 2 3 8 /* ] -> ] */
13 2 4 8 /* Return -> Return */
-306 8 5 8 /* Left Ctrl -> CTRL */
+306 8 5 0x4008 /* Left Ctrl -> CTRL */
97 9 3 8 /* A -> A */
115 10 3 8 /* S -> S */
100 11 3 8 /* D -> D */
@@ -203,9 +203,13 @@
109 14 4 8 /* M -> M */
44 15 4 8 /* , -> , */
46 15 5 8 /* . -> . */
-47 0 5 8 /* / -> / */
+
+47 0 5 0x28 /* / -> / */
+47 4 1 0x201 /* ctrl / -> / */
+
303 8 4 4 /* Right Shift -> Shift */
32 14 5 8 /* Space -> Space */
+
282 8 0 8 /* F1 -> F1 */
283 9 0 8 /* F2 -> F2 */
284 10 0 8 /* F3 -> F3 */
@@ -216,20 +220,27 @@
289 15 0 8 /* F8 -> F8 */
290 0 0 8 /* F9 -> F9 */
291 1 0 8 /* F10 -> F10 */
-278 4 0 8 /* Home -> CLR/HOME */
+292 2 5 8 /* F11 -> pi */
+#293 1 0 8 /* F12 -> run/stop */
+
+
273 3 0 8 /* Up -> CRSR UP */
276 3 1 8 /* Left -> CRSR LEFT */
275 3 2 8 /* Right -> CRSR RIGHT */
274 2 0 8 /* Down -> CRSR DOWN */
-277 2 2 8 /* Ins -> Pound */
-127 4 1 8 /* Del -> ? */
+
+277 6 5 8 /* Ins -> KP 00 */
+127 5 1 8 /* Del -> KP CE */
+278 4 0 8 /* Home -> CLR/HOME */
+279 5 0 8 /* End -> Rev/Off */
+280 7 0 8 /* PgUp -> Run/Stop */
281 6 0 8 /* PgDown -> Norm/Graph */
-19 2 5 8 /* Pause/Break -> Pi */
-280 5 0 8 /* PgUp -> Rev/Off */
-279 5 1 8 /* End -> CE */
-305 3 4 8 /* Right Ctrl -> C= */
+
+305 3 4 0x2008 /* Right Ctrl -> C= */
+
271 7 4 8 /* Numpad Enter -> Numpad Enter */
267 7 1 8 /* Numpad / -> Numpad / */
+268 6 1 8 /* Numpad * -> Numpad * */
263 4 2 8 /* Numpad 7 -> Numpad 7 */
264 5 2 8 /* Numpad 8 -> Numpad 8 */
265 6 2 8 /* Numpad 9 -> Numpad 9 */
Copied: branches/compyx/joymap-001/vice/data/CBM-II/sdl_sym_de.vkm (from rev 45601, trunk/vice/data/CBM-II/sdl_sym_de.vkm)
===================================================================
--- branches/compyx/joymap-001/vice/data/CBM-II/sdl_sym_de.vkm (rev 0)
+++ branches/compyx/joymap-001/vice/data/CBM-II/sdl_sym_de.vkm 2025-03-29 13:27:28 UTC (rev 45602)
@@ -0,0 +1,288 @@
+# VICE keyboard mapping file
+#
+# A Keyboard map is read in as patch to the current map.
+#
+# File format:
+# - comment lines start with '#'
+# - keyword lines start with '!keyword'
+# - normal lines have 'keysym/scancode row column shiftflag'
+#
+# Keywords and their lines are:
+# '!CLEAR' clear whole table
+# '!INCLUDE filename' read file as mapping file
+# '!LSHIFT row col' left shift keyboard row/column
+# '!RSHIFT row col' right shift keyboard row/column
+# '!VSHIFT shiftkey' virtual shift key (RSHIFT or LSHIFT)
+# '!SHIFTL shiftkey' shift lock key (RSHIFT or LSHIFT)
+# for emulated keyboards that have only one shift key, set both LSHIFT
+# and RSHIFT to the same row/col and use RSHIFT for VSHIFT and SHIFTL.
+# '!LCTRL row col' left control keyboard row/column
+# '!VCTRL ctrlkey' virtual control key (LCTRL)
+# '!LCBM row col' left CBM keyboard row/column
+# '!VCBM cbmkey' virtual CBM key (LCBM)
+# '!UNDEF keysym' remove keysym from table
+#
+# Shiftflag can have these values, flags can be ORed to combine them:
+# 0x0000 0 key is not shifted for this keysym/scancode
+# 0x0001 1 key is combined with shift for this keysym/scancode
+# 0x0002 2 key is left shift on emulated machine
+# 0x0004 4 key is right shift on emulated machine (use only this one
+# for emulated keyboards that have only one shift key)
+# 0x0008 8 key can be shifted or not with this keysym/scancode
+# 0x0010 16 deshift key for this keysym/scancode
+# 0x0020 32 another definition for this keysym/scancode follows
+# 0x0040 64 key is shift-lock on emulated machine
+# 0x0080 128 shift modifier required on host
+# 0x0100 256 key is used for an alternative keyboard mapping, e.g. C64 mode in x128
+# 0x0200 512 alt-r (alt-gr) modifier required on host
+# 0x0400 1024 ctrl modifier required on host
+# 0x0800 2048 key is combined with cbm for this keysym/scancode
+# 0x1000 4096 key is combined with ctrl for this keysym/scancode
+# 0x2000 8192 key is (left) cbm on emulated machine
+# 0x4000 16384 key is (left) ctrl on emulated machine
+#
+# Negative row values:
+# 'keysym -1 n' joystick keymap A, direction n
+# 'keysym -2 n' joystick keymap B, direction n
+# 'keysym -3 0' first RESTORE key
+# 'keysym -3 1' second RESTORE key
+# 'keysym -4 0' 40/80 column key (x128)
+# 'keysym -4 1' CAPS (ASCII/DIN) key (x128)
+# 'keysym -5 n' joyport keypad, key n (not supported in x128)
+#
+# Joystick direction values:
+# 0 Fire
+# 1 South/West
+# 2 South
+# 3 South/East
+# 4 West
+# 5 East
+# 6 North/West
+# 7 North
+# 8 North/East
+#
+# Joyport keypad key layout:
+# --------------------------
+# | 0 | 1 | 2 | 3 | 4 |
+# --------------------------
+# | 5 | 6 | 7 | 8 | 9 |
+# --------------------------
+# | 10 | 11 | 12 | 13 | 14 |
+# --------------------------
+# | 15 | 16 | 17 | 18 | 19 |
+# --------------------------
+#
+# When a bigger spaced key is used,
+# it uses the upper left most key value.
+
+# Symbolic Mapping, DE Layout, CBM2, SDL
+
+# note: For some reason SDL does not get keyboard events for "dead keys" at all,
+# so a "nodeadkeys" layout must be used. CAUTION: apparently SDL generates
+# some tables internally at startup - switching the host layout while
+# the emulator is running produces unpredictable results (broken keycodes)
+
+# Commodore cbm2 keyboard matrix:
+#
+# references:
+# http://www.zimmers.net/anonftp/pub/cbm/b/documents/de/keyboard-matrix.gif
+# http://www.zimmers.net/anonftp/pub/cbm/b/documents/keymap-us.gif
+# http://www.zimmers.net/anonftp/pub/cbm/schematics/computers/b/p500-keyboard.txt
+# http://www.floodgap.com/retrobits/ckb/secret/cbm-610-keyboard.jpg
+#
+# Keys starting with 'KP' are on the number pad. Both shifts and shift lock
+# are in parallel at one point in matrix.
+#
+# 0 1 2 3 4 5
+# +--------+--------+--------+--------+--------+--------+
+# 0 | F9 | 9 ( | O | L | ; : | / ? |
+# +--------+--------+--------+--------+--------+--------+
+# 1 | F10 | 0 ) | - | P | [ | ' " |
+# +--------+--------+--------+--------+--------+--------+
+# 2 | c.down | = + |<- pound| ] | return | pi |
+# +--------+--------+--------+--------+--------+--------+
+# 3 | c.up | c.left | c.right|del ins | CBM |########|
+# +--------+--------+--------+--------+--------+--------+
+# 4 |home/clr|KP ? |KP 7 |KP 4 |KP 1 |KP 0 |
+# +--------+--------+--------+--------+--------+--------+
+# 5 |rvs/off |KP CE |KP 8 |KP 5 |KP 2 |KP . |
+# +--------+--------+--------+--------+--------+--------+
+# 6 | graph |KP * |KP 9 |KP 6 |KP 3 |KP 00 |
+# +--------+--------+--------+--------+--------+--------+
+# 7 |run/stop|KP / |KP - |KP + |KP enter|########|
+# +--------+--------+--------+--------+--------+--------+
+# 8 | F1 | escape | TAB |########| Shift | CTRL |
+# +--------+--------+--------+--------+--------+--------+
+# 9 | F2 | 1 ! | Q | A | Z |########|
+# +--------+--------+--------+--------+--------+--------+
+#10 | F3 | 2 @ | W | S | X | C |
+# +--------+--------+--------+--------+--------+--------+
+#11 | F4 | 3 # | E | D | F | V |
+# +--------+--------+--------+--------+--------+--------+
+#12 | F5 | 4 $ | R | T | G | B |
+# +--------+--------+--------+--------+--------+--------+
+#13 | F6 | 5 % | 6 ^ | Y | H | N |
+# +--------+--------+--------+--------+--------+--------+
+#14 | F7 | 7 & | U | J | M | space |
+# +--------+--------+--------+--------+--------+--------+
+#15 | F8 | 8 * | I | K | , < | . > |
+# +--------+--------+--------+--------+--------+--------+
+
+# CBM2 Keyboard layout:
+#
+# F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 down up left right clr rvs graph r/s
+#
+# ESC 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) - =+ arrow/pound del ? CE * /
+# TAB q w e r t y u i o p [ ] return 7 8 9 -
+# SL a s d f g h j k l ;: '" pi 4 5 6 +
+# LS z x c v b n m ,< .> /? RS CBM 1 2 3
+# CTRL SPACE 0 . 00 enter
+
+!CLEAR
+!LSHIFT 8 4
+!RSHIFT 8 4
+!VSHIFT RSHIFT
+!SHIFTL RSHIFT
+!LCBM 3 4
+!VCBM LCBM
+!LCTRL 8 5
+!VCTRL LCTRL
+
+27 8 1 8 /* ESC -> ESC */
+
+49 9 1 8 /* 1 -> 1 */
+50 10 1 0x20 /* 2 -> 2 */
+50 1 5 0x80 /* shift 2 -> " */
+51 11 1 8 /* 3 -> 3 */
+52 12 1 8 /* 4 -> 4 */
+53 13 1 8 /* 5 -> 5 */
+54 13 2 0x20 /* 6 -> 6 */
+54 14 1 0x81 /* shift 6 -> & shift+7 */
+55 14 1 0x20 /* 7 -> 7 */
+55 0 5 0x90 /* shift 7 -> / */
+56 15 1 0x20 /* 8 -> 8 */
+56 0 1 0x80 /* shift 8 -> ( shift+9 */
+57 0 1 0x20 /* 9 -> 9 */
+57 1 1 0x80 /* shift 9 -> ) shift+0 */
+48 1 1 0x20 /* 0 -> 0 */
+48 2 1 0x90 /* shift 0 -> = */
+
+223 4 1 0x00b0 /* shift ? -> ? */
+223 4 1 0x0201 /* ctrl ? -> ctrl+ */
+
+180 2 2 8 /* ´ ` -> pound */
+
+45 1 2 0x20 /* Minus -> Minus */
+45 2 2 0x90 /* shift+Minus -> left arrow */
+
+306 8 5 0x4008 /* Left Ctrl -> CTRL */
+305 3 4 0x2008 /* Right Ctrl -> CBM */
+
+304 8 4 4 /* Left Shift -> Shift */
+301 8 4 64 /* Caps Lock -> Shift Lock */
+303 8 4 4 /* Right Shift -> Shift */
+
+32 14 5 8 /* Space -> Space */
+8 3 3 8 /* Backspace -> Del */
+9 8 2 8 /* TAB -> TAB */
+13 2 4 8 /* Return -> Return */
+
+44 15 4 0x20 /* , -> , */
+44 0 4 0x90 /* shift , -> ; */
+
+46 15 5 0x20 /* . -> . */
+46 0 4 0x420 /* ctrl . -> . */
+46 0 4 0x80 /* shift . -> : */
+
+#47 0 5 8 /* / -> / */
+
+60 15 4 0x021 /* < -> ,+shift */
+60 15 5 0x080 /* shift > -> .+shift */
+
+43 2 1 0x21 /* + -> Plus */
+43 15 1 0x80 /* shift++ -> * */
+
+252 10 1 1 /* ue -> @ */
+246 1 4 8 /* oe -> [ */
+228 2 3 8 /* ae -> ] */
+
+35 11 1 33 /* # -> 3+shift */
+35 1 5 0x420 /* ctrl # -> '+ctrl */
+35 1 5 0x90 /* ' -> 7+shift */
+
+94 13 2 0x021 /* ^ -> shift+6 (arrow up) */
+94 2 5 0x420 /* ctrl ^ -> pi */
+94 2 5 0x8b0 /* shift ^ -> pi */
+
+113 9 2 0x28 /* Q -> Q */
+113 10 1 0x201 /* altgr Q -> @ */
+
+119 10 2 8 /* W -> W */
+101 11 2 8 /* E -> E */
+114 12 2 8 /* R -> R */
+116 12 3 8 /* T -> T */
+121 13 3 8 /* Y -> Y */
+117 14 2 8 /* U -> U */
+105 15 2 8 /* I -> I */
+111 0 2 8 /* O -> O */
+112 1 3 8 /* P -> P */
+97 9 3 8 /* A -> A */
+115 10 3 8 /* S -> S */
+100 11 3 8 /* D -> D */
+102 11 4 8 /* F -> F */
+103 12 4 8 /* G -> G */
+104 13 4 8 /* H -> H */
+106 14 3 8 /* J -> J */
+107 15 3 8 /* K -> K */
+108 0 3 8 /* L -> L */
+122 9 4 8 /* Z -> Z */
+120 10 4 8 /* X -> X */
+99 10 5 8 /* C -> C */
+118 11 5 8 /* V -> V */
+98 12 5 8 /* B -> B */
+110 13 5 8 /* N -> N */
+109 14 4 8 /* M -> M */
+
+
+282 8 0 8 /* F1 -> F1 */
+283 9 0 8 /* F2 -> F2 */
+284 10 0 8 /* F3 -> F3 */
+285 11 0 8 /* F4 -> F4 */
+286 12 0 8 /* F5 -> F5 */
+287 13 0 8 /* F6 -> F6 */
+288 14 0 8 /* F7 -> F7 */
+289 15 0 8 /* F8 -> F8 */
+290 0 0 8 /* F9 -> F9 */
+291 1 0 8 /* F10 -> F10 */
+
+#292 1 0 8 /* F11 -> (unused) */
+#293 1 0 8 /* F12 -> run/stop */
+
+273 3 0 8 /* Up -> CRSR UP */
+276 3 1 8 /* Left -> CRSR LEFT */
+275 3 2 8 /* Right -> CRSR RIGHT */
+274 2 0 8 /* Down -> CRSR DOWN */
+
+277 6 5 8 /* Ins -> KP 00 */
+127 5 1 8 /* Del -> KP CE */
+278 4 0 8 /* Home -> CLR/HOME */
+279 5 0 8 /* End -> Rev/Off */
+280 7 0 8 /* PgUp -> Run/Stop */
+281 6 0 8 /* PgDown -> Norm/Graph */
+
+271 7 4 8 /* Numpad Enter -> Numpad Enter */
+267 7 1 8 /* Numpad / -> Numpad / */
+268 6 1 8 /* Numpad * -> Numpad * */
+263 4 2 8 /* Numpad 7 -> Numpad 7 */
+264 5 2 8 /* Numpad 8 -> Numpad 8 */
+265 6 2 8 /* Numpad 9 -> Numpad 9 */
+269 7 2 8 /* Numpad - -> Numpad - */
+260 4 3 8 /* Numpad 4 -> Numpad 4 */
+261 5 3 8 /* Numpad 5 -> Numpad 5 */
+262 6 3 8 /* Numpad 6 -> Numpad 6 */
+270 7 3 8 /* Numpad + -> Numpad + */
+257 4 4 8 /* Numpad 1 -> Numpad 1 */
+258 5 4 8 /* Numpad 2 -> Numpad 2 */
+259 6 4 8 /* Numpad 3 -> Numpad 3 */
+256 4 5 8 /* Numpad 0 -> Numpad 0 */
+266 5 5 8 /* Numpad . -> Numpad . */
Modified: branches/compyx/joymap-001/vice/data/PLUS4/gtk3_pos.vkm
===================================================================
--- branches/compyx/joymap-001/vice/data/PLUS4/gtk3_pos.vkm 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/data/PLUS4/gtk3_pos.vkm 2025-03-29 13:27:28 UTC (rev 45602)
@@ -93,7 +93,7 @@
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 5 |DOWN |P |L |UP |. > |: [ |- |, < |
# +--------+--------+--------+--------+--------+--------+--------+--------+
-# 6 |LEFT |* |; ] |RIGHT |ESC |= |+ |/ ? |
+# 6 |LEFT |* |; ] |RIGHT |ESC |= <- pi |+ |/ ? |
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 7 |1 ! |CLR/HOME| CTRLs |2 " |SPACE |CBM |Q |RUN/STOP|
# +--------+--------+--------+--------+--------+--------+--------+--------+
@@ -338,5 +338,7 @@
Print -5 15
KP_0 -5 16
KP_Delete -5 17
+KP_Decimal -5 17
+KP_Separator -5 17
KP_Enter -5 18
KP_Add -5 19
Modified: branches/compyx/joymap-001/vice/data/PLUS4/gtk3_pos_de.vkm
===================================================================
--- branches/compyx/joymap-001/vice/data/PLUS4/gtk3_pos_de.vkm 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/data/PLUS4/gtk3_pos_de.vkm 2025-03-29 13:27:28 UTC (rev 45602)
@@ -93,7 +93,7 @@
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 5 |DOWN |P |L |UP |. > |: [ |- |, < |
# +--------+--------+--------+--------+--------+--------+--------+--------+
-# 6 |LEFT |* |; ] |RIGHT |ESC |= |+ |/ ? |
+# 6 |LEFT |* |; ] |RIGHT |ESC |= <- pi |+ |/ ? |
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 7 |1 ! |CLR/HOME| CTRLs |2 " |SPACE |CBM |Q |RUN/STOP|
# +--------+--------+--------+--------+--------+--------+--------+--------+
@@ -344,5 +344,6 @@
KP_0 -5 16
KP_Delete -5 17
KP_Decimal -5 17
+KP_Separator -5 17
KP_Enter -5 18
KP_Add -5 19
Modified: branches/compyx/joymap-001/vice/data/PLUS4/gtk3_sym.vkm
===================================================================
--- branches/compyx/joymap-001/vice/data/PLUS4/gtk3_sym.vkm 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/data/PLUS4/gtk3_sym.vkm 2025-03-29 13:27:28 UTC (rev 45602)
@@ -93,7 +93,7 @@
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 5 |DOWN |P |L |UP |. > |: [ |- |, < |
# +--------+--------+--------+--------+--------+--------+--------+--------+
-# 6 |LEFT |* |; ] |RIGHT |ESC |= |+ |/ ? |
+# 6 |LEFT |* |; ] |RIGHT |ESC |= <- pi |+ |/ ? |
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 7 |1 ! |CLR/HOME| CTRLs |2 " |SPACE |CBM |Q |RUN/STOP|
# +--------+--------+--------+--------+--------+--------+--------+--------+
@@ -204,8 +204,8 @@
at 0 7 16
# \ = Pound Sterling
backslash 0 2 8
-# | = Shift-minus
-bar 5 6 1
+# | = Shift-Pound
+bar 0 2 1
# { -> CBM-W graphic
braceleft 1 1 2064
@@ -350,5 +350,7 @@
Print -5 15
KP_0 -5 16
KP_Delete -5 17
+KP_Decimal -5 17
+KP_Separator -5 17
KP_Enter -5 18
KP_Add -5 19
Modified: branches/compyx/joymap-001/vice/data/PLUS4/gtk3_sym_de.vkm
===================================================================
--- branches/compyx/joymap-001/vice/data/PLUS4/gtk3_sym_de.vkm 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/data/PLUS4/gtk3_sym_de.vkm 2025-03-29 13:27:28 UTC (rev 45602)
@@ -93,7 +93,7 @@
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 5 |DOWN |P |L |UP |. > |: [ |- |, < |
# +--------+--------+--------+--------+--------+--------+--------+--------+
-# 6 |LEFT |* |; ] |RIGHT |ESC |= |+ |/ ? |
+# 6 |LEFT |* |; ] |RIGHT |ESC |= <- pi |+ |/ ? |
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 7 |1 ! |CLR-HOME|CTRL |2 " |SPACE |CBM |Q |RUN-STOP|
# +--------+--------+--------+--------+--------+--------+--------+--------+
@@ -322,5 +322,6 @@
KP_0 -5 16
KP_Delete -5 17
KP_Decimal -5 17
+KP_Separator -5 17
KP_Enter -5 18
KP_Add -5 19
Modified: branches/compyx/joymap-001/vice/data/PLUS4/sdl_pos.vkm
===================================================================
--- branches/compyx/joymap-001/vice/data/PLUS4/sdl_pos.vkm 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/data/PLUS4/sdl_pos.vkm 2025-03-29 13:27:28 UTC (rev 45602)
@@ -98,7 +98,7 @@
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 5 |DOWN |P |L |UP |. > |: [ |- |, < |
# +--------+--------+--------+--------+--------+--------+--------+--------+
-# 6 |LEFT |* |; ] |RIGHT |ESC |= |+ |/ ? |
+# 6 |LEFT |* |; ] |RIGHT |ESC |= <- pi |+ |/ ? |
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 7 |1 ! |CLR/HOME| CTRLs |2 " |SPACE |CBM |Q |RUN/STOP|
# +--------+--------+--------+--------+--------+--------+--------+--------+
@@ -196,14 +196,20 @@
287 0 6 1 /* F6 -> F6 */
288 0 3 1 /* F7 -> F7 */
289 0 3 8 /* F8 -> HELP */
+
278 7 1 8 /* Home -> CLR/HOME */
273 5 3 8 /* Up -> CRSR UP */
276 6 0 8 /* Left -> CRSR LEFT */
275 6 3 8 /* Right -> CRSR RIGHT */
274 5 0 8 /* Down -> CRSR DOWN */
+
277 6 5 8 /* Ins -> = */
127 6 1 8 /* Del -> * */
+# Restore key mappings
+#280 -3 0 /* Page Up -> RESTORE */
+280 6 4 8 /* Page Up -> Escape */
+
# Joyport-attached keypad key mappings
300 -5 0 /* NumLock -> keypad x0 */
263 -5 1 /* NumPad 7 -> keypad 7 */
Modified: branches/compyx/joymap-001/vice/data/PLUS4/sdl_sym.vkm
===================================================================
--- branches/compyx/joymap-001/vice/data/PLUS4/sdl_sym.vkm 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/data/PLUS4/sdl_sym.vkm 2025-03-29 13:27:28 UTC (rev 45602)
@@ -98,7 +98,7 @@
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 5 |DOWN |P |L |UP |. > |: [ |- |, < |
# +--------+--------+--------+--------+--------+--------+--------+--------+
-# 6 |LEFT |* |; ] |RIGHT |ESC |= |+ |/ ? |
+# 6 |LEFT |* |; ] |RIGHT |ESC |= <- pi |+ |/ ? |
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 7 |1 ! |CLR/HOME| CTRLs |2 " |SPACE |CBM |Q |RUN/STOP|
# +--------+--------+--------+--------+--------+--------+--------+--------+
@@ -133,6 +133,10 @@
!VCTRL LCTRL
27 7 7 8 /* ESC -> Run/Stop */
+
+96 3 0 0x21 /* ` -> shift+7 */
+96 6 5 0x81 /* shift ` -> arrow left */
+
49 7 0 8 /* 1 -> 1 */
50 7 3 32 /* 2 -> 2 */
50 0 7 0x90 /* @ -> @ */
@@ -154,6 +158,7 @@
61 6 5 32 /* Equal -> Equal */
61 6 6 0x90 /* + -> + */
8 0 0 8 /* Backspace -> Del */
+
9 7 5 8200 /* TAB -> CBM */
113 7 6 8 /* Q -> Q */
119 1 1 8 /* W -> W */
@@ -168,6 +173,7 @@
91 5 5 1 /* [ -> [ */
93 6 2 1 /* ] -> ] */
13 0 1 8 /* Return -> Return */
+
306 7 2 16392 /* Left Ctrl -> CTRL */
97 1 2 8 /* A -> A */
115 1 5 8 /* S -> S */
@@ -182,8 +188,8 @@
59 5 5 0x90 /* : -> : */
39 3 0 33 /* ' -> ' */
39 7 3 0x80 /* " -> " */
-96 6 4 8 /* ` -> Esc */
-92 6 1 8 /* \ -> * */
+
+92 0 2 8 /* \ -> pound */
301 1 7 64 /* Caps Lock -> Shift Lock */
304 1 7 4 /* Left Shift -> Left Shift */
122 1 4 8 /* Z -> Z */
@@ -206,14 +212,24 @@
287 0 6 1 /* F6 -> F6 */
288 0 3 1 /* F7 -> F7 */
289 0 3 8 /* F8 -> HELP */
-278 7 1 8 /* Home -> CLR/HOME */
+
273 5 3 8 /* Up -> CRSR UP */
276 6 0 8 /* Left -> CRSR LEFT */
275 6 3 8 /* Right -> CRSR RIGHT */
274 5 0 8 /* Down -> CRSR DOWN */
-277 6 5 8 /* Ins -> = */
-127 6 1 8 /* Del -> * */
+277 0 0 1 /* Ins -> Insert */
+127 0 0 8 /* Del -> Delete */
+278 7 1 8 /* Home -> CLR/HOME */
+279 6 5 1 /* End -> arrow left */
+
+281 6 5 0x820 /* page down -> pi */
+281 4 3 0x81 /* shift page down -> arrow up */
+
+# Restore key mappings
+#280 -3 0 /* Page Up -> RESTORE */
+280 6 4 8 /* Page Up -> Escape */
+
# Joyport-attached keypad key mappings
300 -5 0 /* NumLock -> keypad x0 */
263 -5 1 /* NumPad 7 -> keypad 7 */
Modified: branches/compyx/joymap-001/vice/data/PLUS4/sdl_sym_de.vkm
===================================================================
--- branches/compyx/joymap-001/vice/data/PLUS4/sdl_sym_de.vkm 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/data/PLUS4/sdl_sym_de.vkm 2025-03-29 13:27:28 UTC (rev 45602)
@@ -98,7 +98,7 @@
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 5 |DOWN |P |L |UP |. > |: [ |- |, < |
# +--------+--------+--------+--------+--------+--------+--------+--------+
-# 6 |LEFT |* |; ] |RIGHT |ESC |= |+ |/ ? |
+# 6 |LEFT |* |; ] |RIGHT |ESC |= <- pi |+ |/ ? |
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 7 |1 ! |CLR/HOME| CTRLs |2 " |SPACE |CBM |Q |RUN/STOP|
# +--------+--------+--------+--------+--------+--------+--------+--------+
@@ -142,8 +142,11 @@
286 0 5 1 /* F5 -> F5 */
284 0 6 8 /* F3 -> F3 */
287 0 6 1 /* F6 -> F6 */
+
113 7 6 40 /* Q -> Q */
113 0 7 512 /* altgr + q -> @ */
+109 4 4 0x0028 /* M -> M */
+109 6 5 0x0a00 /* altgr + M -> pi */
301 1 7 64 /* Caps Lock -> Shift Lock */
304 1 7 4 /* Left Shift -> Left Shift */
@@ -152,11 +155,10 @@
27 7 7 8 /* ESC -> Run/Stop */
9 7 5 8200 /* TAB -> CBM */
+252 0 7 8 /* ue -> @ */
+246 5 5 8 /* oe -> [ */
+228 6 2 8 /* ae -> ] */
-252 0 7 8 /* (de) ue -> @ */
-246 5 5 8 /* (de) oe -> [ */
-228 6 2 8 /* (de) ae -> ] */
-
274 5 0 8 /* Down -> CRSR DOWN */
273 5 3 8 /* Up -> CRSR UP */
276 6 0 8 /* Left -> CRSR LEFT */
@@ -164,9 +166,13 @@
46 5 4 32 /* . -> . */
46 5 5 144 /* shift+. -> : */
-60 5 7 33 /* < -> ,+shift */
-60 5 4 128 /* > -> .+shift */
+60 5 7 0x021 /* < -> ,+shift */
+60 5 4 0x0a0 /* > -> .+shift */
+60 0 2 0x210 /* altgr + < -> pound */
+
+180 0 2 8 /* ´ ` -> pound */
+
43 6 6 32 /* + -> Plus */
43 6 1 144 /* shift++ -> * */
@@ -177,9 +183,15 @@
45 6 5 128 /* shift+- -> shift+= */
96 6 4 8 /* ` -> Esc */
-223 6 7 1 /* ? -> ? */
+223 6 5 0x0021 /* ß -> arrow left */
+223 6 7 0x00a0 /* shift ? -> ? */
+223 6 5 0x0a00 /* altgr \ -> pi */
278 7 1 8 /* Home -> CLR/HOME */
+279 6 5 1 /* End -> arrow left */
+277 0 0 1 /* Ins -> Insert */
+127 0 0 8 /* Del -> Delete */
+
32 7 4 8 /* Space -> Space */
35 1 0 33 /* # -> 3+shift */
@@ -211,8 +223,10 @@
48 4 3 32 /* 0 -> 0 */
# 128+16 shifted on host, deshifted on C16
48 6 5 144 /* = -> = */
-94 4 3 1 /* ^ -> shift+0 (arrow up) */
+94 4 3 0x021 /* ^ -> shift+0 (arrow up) */
+94 6 5 0x890 /* shift ^ -> pi */
+
97 1 2 8 /* A -> A */
98 3 4 8 /* B -> B */
99 2 4 8 /* C -> C */
@@ -225,7 +239,7 @@
106 4 2 8 /* J -> J */
107 4 5 8 /* K -> K */
108 5 2 8 /* L -> L */
-109 4 4 8 /* M -> M */
+#109 4 4 8 /* M -> M */
110 4 7 8 /* N -> N */
111 4 6 8 /* O -> O */
112 5 1 8 /* P -> P */
@@ -241,7 +255,8 @@
122 1 4 8 /* Z -> Z */
# Restore key mappings
-280 -3 0 /* Page Up -> RESTORE */
+#280 -3 0 /* Page Up -> RESTORE */
+280 6 4 8 /* Page Up -> Escape */
# Joyport-attached keypad key mappings
300 -5 0 /* NumLock -> keypad x0 */
Modified: branches/compyx/joymap-001/vice/src/monitor/monitor_binary.c
===================================================================
--- branches/compyx/joymap-001/vice/src/monitor/monitor_binary.c 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/src/monitor/monitor_binary.c 2025-03-29 13:27:28 UTC (rev 45602)
@@ -1602,7 +1602,7 @@
++response_cursor;
}
- monitor_binary_response(response_size, e_MON_RESPONSE_CPUHISTORY_GET, e_MON_ERR_OK, command->request_id, response);
+ monitor_binary_response((uint32_t)response_size, e_MON_RESPONSE_CPUHISTORY_GET, e_MON_ERR_OK, command->request_id, response);
lib_free(templates);
lib_free(response);
Modified: branches/compyx/joymap-001/vice/src/vic20/vic20-snapshot.c
===================================================================
--- branches/compyx/joymap-001/vice/src/vic20/vic20-snapshot.c 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/src/vic20/vic20-snapshot.c 2025-03-29 13:27:28 UTC (rev 45602)
@@ -58,7 +58,7 @@
#define SNAP_MAJOR 3
-#define SNAP_MINOR 0
+#define SNAP_MINOR 1
int vic20_snapshot_write(const char *name, int save_roms, int save_disks,
Modified: branches/compyx/joymap-001/vice/src/vic20/vic20.c
===================================================================
--- branches/compyx/joymap-001/vice/src/vic20/vic20.c 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/src/vic20/vic20.c 2025-03-29 13:27:28 UTC (rev 45602)
@@ -287,23 +287,23 @@
/* ------------------------------------------------------------------------ */
-static int via2_dump(void)
+static int via1_dump(void)
{
- return viacore_dump(machine_context.via2);
+ return viacore_dump(machine_context.via1);
}
-static int via1_dump(void)
+static int via2_dump(void)
{
- return viacore_dump(machine_context.via1);
+ return viacore_dump(machine_context.via2);
}
static void vic_via1_via2_store(uint16_t addr, uint8_t data)
{
if (addr & 0x10) {
- via2_store(addr, data);
+ via1_store(addr, data);
}
if (addr & 0x20) {
- via1_store(addr, data);
+ via2_store(addr, data);
}
vic_store(addr, data);
}
@@ -313,11 +313,11 @@
uint8_t retval = vic_read(addr);
if (addr & 0x10) {
- retval &= via2_read(addr);
+ retval &= via1_read(addr);
}
if (addr & 0x20) {
- retval &= via1_read(addr);
+ retval &= via2_read(addr);
}
return retval;
@@ -328,11 +328,11 @@
uint8_t retval = vic_peek(addr);
if (addr & 0x10) {
- retval &= via2_peek(addr);
+ retval &= via1_peek(addr);
}
if (addr & 0x20) {
- retval &= via1_peek(addr);
+ retval &= via2_peek(addr);
}
return retval;
@@ -341,10 +341,10 @@
static void via1_via2_store(uint16_t addr, uint8_t data)
{
if (addr & 0x10) {
- via2_store(addr, data);
+ via1_store(addr, data);
}
if (addr & 0x20) {
- via1_store(addr, data);
+ via2_store(addr, data);
}
}
@@ -353,11 +353,11 @@
uint8_t retval = 0xff;
if (addr & 0x10) {
- retval &= via2_read(addr);
+ retval &= via1_read(addr);
}
if (addr & 0x20) {
- retval &= via1_read(addr);
+ retval &= via2_read(addr);
}
return retval;
@@ -368,11 +368,11 @@
uint8_t retval = 0xff;
if (addr & 0x10) {
- retval &= via2_peek(addr);
+ retval &= via1_peek(addr);
}
if (addr & 0x20) {
- retval &= via1_peek(addr);
+ retval &= via2_peek(addr);
}
return retval;
@@ -404,8 +404,8 @@
/* FIXME: the upper 4 bits of the mask are used to indicate the register size if not equal to the mask,
this is done as a temporary HACK to keep mirrors working and still get the correct register size,
this needs to be fixed properly after the 3.6 release */
-static io_source_t via2_device = {
- "VIA2", /* name of the chip */
+static io_source_t via1_device = {
+ "VIA1", /* name of the chip */
IO_DETACH_NEVER, /* chip is never involved in collisions, so no detach */
IO_DETACH_NO_RESOURCE, /* does not use a resource for detach */
#if 0
@@ -417,7 +417,7 @@
NULL, /* NO poke function */
via1_via2_read, /* read function */
via1_via2_peek, /* peek function */
- via2_dump, /* chip state information dump function */
+ via1_dump, /* chip state information dump function */
IO_CART_ID_NONE, /* not a cartridge */
IO_PRIO_HIGH, /* high priority, chip and mirrors never involved in collisions */
0, /* insertion order, gets filled in by the registration function */
@@ -427,8 +427,8 @@
/* FIXME: the upper 4 bits of the mask are used to indicate the register size if not equal to the mask,
this is done as a temporary HACK to keep mirrors working and still get the correct register size,
this needs to be fixed properly after the 3.6 release */
-static io_source_t via1_device = {
- "VIA1", /* name of the chip */
+static io_source_t via2_device = {
+ "VIA2", /* name of the chip */
IO_DETACH_NEVER, /* chip is never involved in collisions, so no detach */
IO_DETACH_NO_RESOURCE, /* does not use a resource for detach */
#if 0
@@ -440,7 +440,7 @@
NULL, /* NO poke function */
via1_via2_read, /* read function */
via1_via2_peek, /* peek function */
- via1_dump, /* chip state information dump function */
+ via2_dump, /* chip state information dump function */
IO_CART_ID_NONE, /* not a cartridge */
IO_PRIO_HIGH, /* high priority, chip and mirrors never involved in collisions */
0, /* insertion order, gets filled in by the registration function */
@@ -1028,7 +1028,7 @@
#endif
/* Register joystick callback (for lightpen triggering via fire button) */
- joystick_register_machine(via2_check_lightpen);
+ joystick_register_machine(via1_check_lightpen);
#ifdef HAVE_MIDI
midi_init();
@@ -1121,7 +1121,7 @@
void machine_set_restore_key(int v)
{
- viacore_signal(machine_context.via2,
+ viacore_signal(machine_context.via1,
VIA_SIG_CA1, v ? VIA_SIG_FALL : VIA_SIG_RISE);
}
@@ -1285,7 +1285,7 @@
static void vic20_userport_set_flag(uint8_t b)
{
- viacore_signal(machine_context.via2, VIA_SIG_CB1, b ? VIA_SIG_RISE : VIA_SIG_FALL);
+ viacore_signal(machine_context.via1, VIA_SIG_CB1, b ? VIA_SIG_RISE : VIA_SIG_FALL);
}
static userport_port_props_t userport_props = {
Modified: branches/compyx/joymap-001/vice/src/vic20/vic20datasette.c
===================================================================
--- branches/compyx/joymap-001/vice/src/vic20/vic20datasette.c 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/src/vic20/vic20datasette.c 2025-03-29 13:27:28 UTC (rev 45602)
@@ -37,7 +37,7 @@
void machine_trigger_flux_change(int port, unsigned int on)
{
if (port == TAPEPORT_PORT_1) {
- viacore_signal(machine_context.via1, VIA_SIG_CA1, VIA_SIG_FALL);
+ viacore_signal(machine_context.via2, VIA_SIG_CA1, VIA_SIG_FALL);
}
}
@@ -44,7 +44,7 @@
void machine_set_tape_sense(int port, int sense)
{
if (port == TAPEPORT_PORT_1) {
- via2_set_tape_sense(sense);
+ via1_set_tape_sense(sense);
}
}
@@ -51,7 +51,7 @@
void machine_set_tape_write_in(int port, int val)
{
if (port == TAPEPORT_PORT_1) {
- via2_set_tape_write_in(val);
+ via1_set_tape_write_in(val);
}
}
@@ -58,6 +58,6 @@
void machine_set_tape_motor_in(int port, int val)
{
if (port == TAPEPORT_PORT_1) {
- via2_set_tape_motor_in(val);
+ via1_set_tape_motor_in(val);
}
}
Modified: branches/compyx/joymap-001/vice/src/vic20/vic20iec.c
===================================================================
--- branches/compyx/joymap-001/vice/src/vic20/vic20iec.c 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/src/vic20/vic20iec.c 2025-03-29 13:27:28 UTC (rev 45602)
@@ -129,16 +129,16 @@
/*
The VIC20 has a strange bus layout for the serial IEC bus.
- VIA1 CA2 CLK out
- VIA1 CB1 SRQ in
- VIA1 CB2 DATA out
- VIA2 PA0 CLK in
- VIA2 PA1 DATA in
- VIA2 PA7 ATN out
+ VIA1 PA0 CLK in
+ VIA1 PA1 DATA in
+ VIA1 PA7 ATN out
+ VIA2 CA2 CLK out
+ VIA2 CB1 SRQ in
+ VIA2 CB2 DATA out
*/
-/* These two routines are called for VIA2 Port A. */
+/* These two routines are called for VIA1 Port A. */
uint8_t iec_pa_read(void)
{
@@ -213,7 +213,7 @@
}
-/* This routine is called for VIA1 PCR (= CA2 and CB2).
+/* This routine is called for VIA2 PCR (= CA2 and CB2).
Although Cx2 uses three bits for control, we assume the calling routine has
set bit 5 and bit 1 to the real output value for CB2 (DATA out) and CA2
(CLK out) resp. (25apr1997 AF) */
Modified: branches/compyx/joymap-001/vice/src/vic20/vic20rsuser.c
===================================================================
--- branches/compyx/joymap-001/vice/src/vic20/vic20rsuser.c 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/src/vic20/vic20rsuser.c 2025-03-29 13:27:28 UTC (rev 45602)
@@ -46,8 +46,8 @@
static void vic20_trigger_start(void)
{
- viacore_signal(machine_context.via2, VIA_SIG_CB1, VIA_SIG_FALL);
- viacore_signal(machine_context.via2, VIA_SIG_CB1, VIA_SIG_RISE);
+ viacore_signal(machine_context.via1, VIA_SIG_CB1, VIA_SIG_FALL);
+ viacore_signal(machine_context.via1, VIA_SIG_CB1, VIA_SIG_RISE);
}
void vic20_rsuser_init(void)
Modified: branches/compyx/joymap-001/vice/src/vic20/vic20via.h
===================================================================
--- branches/compyx/joymap-001/vice/src/vic20/vic20via.h 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/src/vic20/vic20via.h 2025-03-29 13:27:28 UTC (rev 45602)
@@ -45,10 +45,10 @@
uint8_t via2_read(uint16_t addr);
uint8_t via2_peek(uint16_t addr);
-void via2_set_tape_sense(int v);
-void via2_set_tape_write_in(int v);
-void via2_set_tape_motor_in(int v);
-void via2_check_lightpen(void);
+void via1_set_tape_sense(int v);
+void via1_set_tape_write_in(int v);
+void via1_set_tape_motor_in(int v);
+void via1_check_lightpen(void);
extern int vic20_vflihack_userport;
Modified: branches/compyx/joymap-001/vice/src/vic20/vic20via1.c
===================================================================
--- branches/compyx/joymap-001/vice/src/vic20/vic20via1.c 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/src/vic20/vic20via1.c 2025-03-29 13:27:28 UTC (rev 45602)
@@ -33,17 +33,32 @@
#include "datasette.h"
#include "interrupt.h"
#include "joyport.h"
+#include "joystick.h"
#include "keyboard.h"
#include "lib.h"
#include "maincpu.h"
#include "tapeport.h"
#include "types.h"
+#include "userport.h"
#include "via.h"
+#include "vic.h"
#include "vic20.h"
+#include "vic20-resources.h"
#include "vic20iec.h"
#include "vic20via.h"
+int vic20_vflihack_userport = 0xff;
+static int userport_pa6 = 1; /* HACK: pin 8, this is also connected to tape sense */
+static int userport_pb = 0xff;
+
+/* HACK: on the C64, pin 8 is connected to PC2, which automatically generates a pulse
+ when PB is written, which is why both is updated by the same function. */
+static void update_portbits(void)
+{
+ store_userport_pbx(userport_pb, userport_pa6 ? USERPORT_NO_PULSE : USERPORT_PULSE);
+}
+
void via1_store(uint16_t addr, uint8_t data)
{
viacore_store(machine_context.via1, addr, data);
@@ -65,57 +80,94 @@
static void set_cb2(via_context_t *via_context, int state, int offset)
{
+ if (!via_context->cb2_is_input) {
+ /* CB2 goes to userport pin M */
+ store_userport_pa2(state);
+ }
}
-static void set_int(via_context_t *via_context, unsigned int int_num,
- int value, CLOCK rclk)
+static void set_int(via_context_t *via_context, unsigned int int_num, int value, CLOCK rclk)
{
- interrupt_set_irq(maincpu_int_status, int_num, value, rclk);
+ interrupt_set_nmi(maincpu_int_status, int_num, value, rclk);
}
static void restore_int(via_context_t *via_context, unsigned int int_num, int value)
{
- interrupt_restore_irq(maincpu_int_status, int_num, value);
+ interrupt_restore_nmi(maincpu_int_status, int_num, value);
}
-static void undump_acr(via_context_t *via_context, uint8_t byte)
+static int tape_sense = 0;
+static int tape_write_in = 0;
+static int tape_motor_in = 0;
+
+void via1_set_tape_sense(int v)
{
+ tape_sense = v;
}
-static void store_acr(via_context_t *via_context, uint8_t byte)
+/* FIXME: find out how to set the write in and motor in lines */
+void via1_set_tape_write_in(int v)
{
+ tape_write_in = v;
}
-static void store_sr(via_context_t *via_context, uint8_t byte)
+void via1_set_tape_motor_in(int v)
{
+ tape_motor_in = v;
}
-static void store_t2l(via_context_t *via_context, uint8_t byte)
+static void via1_internal_lightpen_check(uint8_t pa)
{
+ uint8_t b = read_joyport_dig(JOYPORT_1);
+
+ b &= pa;
+
+ vic_set_light_pen(maincpu_clk, !(b & 0x20));
}
+void via1_check_lightpen(void)
+{
+ uint8_t pa = machine_context.via1->via[VIA_PRA] | ~(machine_context.via1->via[VIA_DDRA]);
+
+ via1_internal_lightpen_check(pa);
+}
+
static void undump_pra(via_context_t *via_context, uint8_t byte)
{
+ iec_pa_write(byte);
}
static void store_pra(via_context_t *via_context, uint8_t byte, uint8_t myoldpa,
uint16_t addr)
{
+ uint8_t joy_bits = 0;
+
+ via1_internal_lightpen_check(byte);
+ iec_pa_write(byte);
+
+ joy_bits = ((byte & 0x20) >> 1) | ((byte & 0x1c) >> 2);
+ store_joyport_dig(JOYPORT_1, joy_bits, 0x17);
+
+ tapeport_set_sense_out(TAPEPORT_PORT_1, byte & 0x40 ? 1 : 0);
+
+ userport_pa6 = byte & 0x40 ? 1 : 0;
+ update_portbits(); /* HACK: see above */
}
static void undump_prb(via_context_t *via_context, uint8_t byte)
{
+ userport_pb = byte;
+ update_portbits(); /* HACK: see above */
}
static void store_prb(via_context_t *via_context, uint8_t byte, uint8_t myoldpb,
uint16_t addr)
{
- uint8_t joy_bit = (byte & 0x80) >> 4;
+ /* for mike's VFLI hack, PB0-PB3 are used as A10-A13 of the color ram */
+ vic20_vflihack_userport = byte & 0x0f;
- if ((byte ^ myoldpb) & 8) {
- tapeport_toggle_write_bit(TAPEPORT_PORT_1, (~(via_context->via[VIA_DDRB]) | byte) & 0x8);
- }
- store_joyport_dig(JOYPORT_1, joy_bit, 8);
+ userport_pb = byte;
+ update_portbits(); /* HACK: see above */
}
static void undump_pcr(via_context_t *via_context, uint8_t byte)
@@ -124,12 +176,15 @@
static void reset(via_context_t *via_context)
{
-/*iec_pcr_write(0x22);*/
+ userport_pb = 0xff;
+ userport_pa6 = 1;
+ store_userport_pbx(0xff, USERPORT_NO_PULSE);
+ store_userport_pa2(1);
}
static uint8_t store_pcr(via_context_t *via_context, uint8_t byte, uint16_t addr)
{
- /* FIXME: this should use via_set_ca2() and via_set_cb2() */
+ /* FIXME: should use via_set_ca2() and via_set_cb2() */
if (byte != via_context->via[VIA_PCR]) {
register uint8_t tmp = byte;
/* first set bit 1 and 5 to the real output values */
@@ -139,55 +194,74 @@
if ((tmp & 0xc0) != 0xc0) {
tmp |= 0x20;
}
- iec_pcr_write(tmp);
+
+ tapeport_set_motor(TAPEPORT_PORT_1, !(byte & 0x02));
+
+ store_userport_pa2((uint8_t)((byte & 0x20) >> 5));
}
return byte;
}
-static uint8_t read_pra(via_context_t *via_context, uint16_t addr)
+static void undump_acr(via_context_t *via_context, uint8_t byte)
{
- uint8_t byte;
- /* FIXME: not 100% sure about this... */
- uint8_t val = ~(via_context->via[VIA_DDRA]);
- uint8_t msk = via_context->oldpb;
- uint8_t m;
- int i;
+}
- for (m = 0x1, i = 0; i < 8; m <<= 1, i++) {
- if (!(msk & m)) {
- val &= ~rev_keyarr[i];
- }
- }
+inline static void store_acr(via_context_t *via_context, uint8_t byte)
+{
+}
- byte = val | (via_context->via[VIA_PRA] & via_context->via[VIA_DDRA]);
- return byte;
+inline static void store_sr(via_context_t *via_context, uint8_t byte)
+{
}
-static uint8_t read_prb(via_context_t *via_context)
+inline static void store_t2l(via_context_t *via_context, uint8_t byte)
{
+}
+
+inline static uint8_t read_pra(via_context_t *via_context, uint16_t addr)
+{
uint8_t byte;
- /* FIXME: not 100% sure about this... */
- uint8_t val = ~(via_context->via[VIA_DDRB]);
- uint8_t msk = via_context->oldpa;
- uint8_t joy = ~read_joyport_dig(JOYPORT_1);
- int m, i;
+ uint8_t joy_bits;
- for (m = 0x1, i = 0; i < 8; m <<= 1, i++) {
- if (!(msk & m)) {
- val &= ~keyarr[i];
- }
- }
+ /*
+ Port A is connected this way:
- /* Bit 7 is mapped to the right direction of the joystick (bit
- 3 in `joystick_value[]'). */
- if (joy & 0x8) {
- val &= 0x7f;
- }
+ bit 0 IEC clock
+ bit 1 IEC data
+ bit 2 joystick switch 0 (up)
+ bit 3 joystick switch 1 (down)
+ bit 4 joystick switch 2 (left)
+ bit 5 joystick switch 4 (fire)
+ bit 6 tape sense
+ bit 7 IEC ATN
+ */
- byte = val | (via_context->via[VIA_PRB] & via_context->via[VIA_DDRB]);
+ /* Setup joy bits (2 through 5). Use the `or' of the values
+ of both joysticks so that it works with every joystick
+ setting. This is a bit slow... we might think of a
+ faster method. */
+ joy_bits = read_joyport_dig(JOYPORT_1);
+ joy_bits = ((joy_bits & 0x7) << 2) | ((joy_bits & 0x10) << 1);
+
+ joy_bits |= tape_sense ? 0 : 0x40;
+
+ /* We assume `iec_pa_read()' returns the non-IEC bits
+ as zeroes. */
+ byte = ((via_context->via[VIA_PRA] & via_context->via[VIA_DDRA])
+ | ((iec_pa_read() | joy_bits) & ~(via_context->via[VIA_DDRA])));
return byte;
}
+inline static uint8_t read_prb(via_context_t *via_context)
+{
+ uint8_t byte = 0xff;
+ byte = via_context->via[VIA_PRB] | ~(via_context->via[VIA_DDRB]);
+
+ byte = read_userport_pbx(byte);
+
+ return byte;
+}
+
void via1_init(via_context_t *via_context)
{
viacore_init(machine_context.via1, maincpu_alarm_context,
@@ -214,7 +288,7 @@
via->write_offset = 0;
- via->irq_line = IK_IRQ;
+ via->irq_line = IK_NMI;
via->undump_pra = undump_pra;
via->undump_prb = undump_prb;
Modified: branches/compyx/joymap-001/vice/src/vic20/vic20via2.c
===================================================================
--- branches/compyx/joymap-001/vice/src/vic20/vic20via2.c 2025-03-29 06:38:01 UTC (rev 45601)
+++ branches/compyx/joymap-001/vice/src/vic20/vic20via2.c 2025-03-29 13:27:28 UTC (rev 45602)
@@ -33,32 +33,17 @@
#include "datasette.h"
#include "interrupt.h"
#include "joyport.h"
-#include "joystick.h"
#include "keyboard.h"
#include "lib.h"
#include "maincpu.h"
#include "tapeport.h"
#include "types.h"
-#include "userport.h"
#include "via.h"
-#include "vic.h"
#include "vic20.h"
-#include "vic20-resources.h"
#include "vic20iec.h"
#include "vic20via.h"
-int vic20_vflihack_userport = 0xff;
-static int userport_pa6 = 1; /* HACK: pin 8, this is also connected to tape sense */
-static int userport_pb = 0xff;
-
-/* HACK: on the C64, pin 8 is connected to PC2, which automatically generates a pulse
- when PB is written, which is why both is updated by the same function. */
-static void update_portbits(void)
-{
- store_userport_pbx(userport_pb, userport_pa6 ? USERPORT_NO_PULSE : USERPORT_PULSE);
-}
-
void via2_store(uint16_t addr, uint8_t data)
{
viacore_store(machine_context.via2, addr, data);
@@ -80,94 +65,57 @@
static void set_cb2(via_context_t *via_context, int state, int offset)
{
- if (!via_context->cb2_is_input) {
- /* CB2 goes to userport pin M */
- store_userport_pa2(state);
- }
}
-static void set_int(via_context_t *via_context, unsigned int int_num, int value, CLOCK rclk)
+static void set_int(via_context_t *via_context, unsigned int int_num,
+ int value, CLOCK rclk)
{
- interrupt_set_nmi(maincpu_int_status, int_num, value, rclk);
+ interrupt_set_irq(maincpu_int_status, int_num, value, rclk);
}
static void restore_int(via_context_t *via_context, unsigned int int_num, int value)
{
- interrupt_restore_nmi(maincpu_int_status, int_num, value);
+ interrupt_restore_irq(maincpu_int_status, int_num, value);
}
-static int tape_sense = 0;
-static int tape_write_in = 0;
-static int tape_motor_in = 0;
-
-void via2_set_tape_sense(int v)
+static void undump_acr(via_context_t *via_context, uint8_t byte)
{
- tape_sense = v;
}
-/* FIXME: find out how to set the write in and motor in lines */
-void via2_set_tape_write_in(int v)
+static void store_acr(via_context_t *via_context, uint8_t byte)
{
- tape_write_in = v;
}
-void via2_set_tape_motor_in(int v)
+static void store_sr(via_context_t *via_context, uint8_t byte)
{
- tape_motor_in = v;
}
-static void via2_internal_lightpen_check(uint8_t pa)
+static void store_t2l(via_context_t *via_context, uint8_t byte)
{
- uint8_t b = read_joyport_dig(JOYPORT_1);
-
- b &= pa;
-
- vic_set_light_pen(maincpu_clk, !(b & 0x20));
}
-void via2_check_lightpen(void)
-{
- uint8_t pa = machine_context.via2->via[VIA_PRA] | ~(machine_context.via2->via[VIA_DDRA]);
-
- via2_internal_lightpen_check(pa);
-}
-
static void undump_pra(via_context_t *via_context, uint8_t byte)
{
- iec_pa_write(byte);
}
static void store_pra(via_context_t *via_context, uint8_t byte, uint8_t myoldpa,
uint16_t addr)
{
- uint8_t joy_bits = 0;
-
- via2_internal_lightpen_check(byte);
- iec_pa_write(byte);
-
- joy_bits = ((byte & 0x20) >> 1) | ((byte & 0x1c) >> 2);
- store_joyport_dig(JOYPORT_1, joy_bits, 0x17);
-
- tapeport_set_sense_out(TAPEPORT_PORT_1, byte & 0x40 ? 1 : 0);
-
- userport_pa6 = byte & 0x40 ? 1 : 0;
- update_portbits(); /* HACK: see above */
}
static void undump_prb(via_context_t *via_context, uint8_t byte)
{
- userport_pb = byte;
- update_portbits(); /* HACK: see above */
}
static void store_prb(via_context_t *via_context, uint8_t byte, uint8_t myoldpb,
uint16_t addr)
{
- /* for mike's VFLI hack, PB0-PB3 are used as A10-A13 of the color ram */
- vic20_vflihack_userport = byte & 0x0f;
+ uint8_t joy_bit = (byte & 0x80) >> 4;
- userport_pb = byte;
- update_portbits(); /* HACK: see above */
+ if ((byte ^ myoldpb) & 8) {
+ tapeport_toggle_write_bit(TAPEPORT_PORT_1, (~(via_context->via[VIA_DDRB]) | byte) & 0x8);
+ }
+ store_joyport_dig(JOYPORT_1, joy_bit, 8);
}
static void undump_pcr(via_context_t *via_context, uint8_t byte)
@@ -176,15 +124,12 @@
static void reset(via_context_t *via_context)
{
- userport_pb = 0xff;
- userport_pa6 = 1;
- store_userport_pbx(0xff, USERPORT_NO_PULSE);
- store_userport_pa2(1);
+/*iec_pcr_write(0x22);*/
}
static uint8_t store_pcr(via_context_t *via_context, uint8_t byte, uint16_t addr)
{
- /* FIXME: should use via_set_ca2() and via_set_cb2() */
+ /* FIXME: this should use via_set_ca2() and via_set_cb2() */
if (byte != via_context->via[VIA_PCR]) {
register uint8_t tmp = byte;
/* first set bit 1 and 5 to the real output values */
@@ -194,74 +139,55 @@
if ((tmp & 0xc0) != 0xc0) {
tmp |= 0x20;
}
-
- tapeport_set_motor(TAPEPORT_PORT_1, !(byte & 0x02));
-
- store_userport_pa2((uint8_t)((byte & 0x20) >> 5));
+ iec_pcr_write(tmp);
}
return byte;
}
-static void undump_acr(via_context_t *via_context, uint8_t byte)
+static uint8_t read_pra(via_context_t *via_context, uint16_t addr)
{
-}
+ uint8_t byte;
+ /* FIXME: not 100% sure about this... */
+ uint8_t val = ~(via_context->via[VIA_DDRA]);
+ uint8_t msk = via_context->oldpb;
+ uint8_t m;
+ int i;
-inline static void store_acr(via_context_t *via_context, uint8_t byte)
-{
-}
+ for (m = 0x1, i = 0; i < 8; m <<= 1, i++) {
+ if (!(msk & m)) {
+ val &= ~rev_keyarr[i];
+ }
+ }
-inline static void store_sr(via_context_t *via_context, uint8_t byte)
-{
+ byte = val | (via_context->via[VIA_PRA] & via_context->via[VIA_DDRA]);
+ return byte;
}
-inline static void store_t2l(via_context_t *via_context, uint8_t byte)
+static uint8_t read_prb(via_context_t *via_context)
{
-}
-
-inline static uint8_t read_pra(via_context_t *via_context, uint16_t addr)
-{
uint8_t byte;
- uint8_t joy_bits;
+ /* FIXME: not 100% sure about this... */
+ uint8_t val = ~(via_context->via[VIA_DDRB]);
+ uint8_t msk = via_context->oldpa;
+ uint8_t joy = ~read_joyport_dig(JOYPORT_1);
+ int m, i;
- /*
- Port A is connected this way:
+ for (m = 0x1, i = 0; i < 8; m <<= 1, i++) {
+ if (!(msk & m)) {
+ val &= ~keyarr[i];
+ }
+ }
- bit 0 IEC clock
- bit 1 IEC data
- bit 2 joystick switch 0 (up)
- bit 3 joystick switch 1 (down)
- bit 4 joystick switch 2 (left)
- bit 5 joystick switch 4 (fire)
- bit 6 tape sense
- bit 7 IEC ATN
- */
+ /* Bit 7 is mapped to the right direction of the joystick (bit
+ 3 in `joystick_value[]'). */
+ if (joy & 0x8) {
+ val &= 0x7f;
+ }
- /* Setup joy bits (2 through 5). Use the `or' of the values
- of both joysticks so that it works with every joystick
- setting. This is a bit slow... we might think of a
- faster method. */
- joy_bits = read_joyport_dig(JOYPORT_1);
- joy_bits = ((joy_bits & 0x7) << 2) | ((joy_bits & 0x10) << 1);
-
- joy_bits |= tape_sense ? 0 : 0x40;
-
- /* We assume `iec_pa_read()' returns the non-IEC bits
- as zeroes. */
- byte = ((via_context->via[VIA_PRA] & via_context->via[VIA_DDRA])
- | ((iec_pa_read() | joy_bits) & ~(via_context->via[VIA_DDRA])));
+ byte = val | (via_context->via[VIA_PRB] & via_context->via[VIA_DDRB]);
return byte;
}
-inline static uint8_t read_prb(via_context_t *via_context)
-{
- uint8_t byte = 0xff;
- byte = via_context->via[VIA_PRB] | ~(via_context->via[VIA_DDRB]);
-
- byte = read_userp...
[truncated message content] |
|
From: <co...@us...> - 2025-03-29 06:38:10
|
Revision: 45601
http://sourceforge.net/p/vice-emu/code/45601
Author: compyx
Date: 2025-03-29 06:38:01 +0000 (Sat, 29 Mar 2025)
Log Message:
-----------
Fix -Wshorten-64-to-32 warning
Modified Paths:
--------------
trunk/vice/src/monitor/monitor_binary.c
Modified: trunk/vice/src/monitor/monitor_binary.c
===================================================================
--- trunk/vice/src/monitor/monitor_binary.c 2025-03-28 18:21:24 UTC (rev 45600)
+++ trunk/vice/src/monitor/monitor_binary.c 2025-03-29 06:38:01 UTC (rev 45601)
@@ -1602,7 +1602,7 @@
++response_cursor;
}
- monitor_binary_response(response_size, e_MON_RESPONSE_CPUHISTORY_GET, e_MON_ERR_OK, command->request_id, response);
+ monitor_binary_response((uint32_t)response_size, e_MON_RESPONSE_CPUHISTORY_GET, e_MON_ERR_OK, command->request_id, response);
lib_free(templates);
lib_free(response);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gp...@us...> - 2025-03-28 18:21:31
|
Revision: 45600
http://sourceforge.net/p/vice-emu/code/45600
Author: gpz
Date: 2025-03-28 18:21:24 +0000 (Fri, 28 Mar 2025)
Log Message:
-----------
forgot :)
Modified Paths:
--------------
trunk/vice/src/vic20/vic20via1.c
Modified: trunk/vice/src/vic20/vic20via1.c
===================================================================
--- trunk/vice/src/vic20/vic20via1.c 2025-03-28 18:10:56 UTC (rev 45599)
+++ trunk/vice/src/vic20/vic20via1.c 2025-03-28 18:21:24 UTC (rev 45600)
@@ -281,8 +281,8 @@
via->rmw_flag = &maincpu_rmw_flag;
via->clk_ptr = &maincpu_clk;
- via->myname = lib_msprintf("Via2");
- via->my_module_name = lib_msprintf("VIA2");
+ via->myname = lib_msprintf("Via1");
+ via->my_module_name = lib_msprintf("VIA1");
viacore_setup_context(via);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gp...@us...> - 2025-03-28 18:11:03
|
Revision: 45599
http://sourceforge.net/p/vice-emu/code/45599
Author: gpz
Date: 2025-03-28 18:10:56 +0000 (Fri, 28 Mar 2025)
Log Message:
-----------
swap vic20via1/2.c
Modified Paths:
--------------
trunk/vice/src/vic20/vic20via1.c
trunk/vice/src/vic20/vic20via2.c
Modified: trunk/vice/src/vic20/vic20via1.c
===================================================================
--- trunk/vice/src/vic20/vic20via1.c 2025-03-28 18:04:09 UTC (rev 45598)
+++ trunk/vice/src/vic20/vic20via1.c 2025-03-28 18:10:56 UTC (rev 45599)
@@ -1,5 +1,5 @@
/*
- * vic20via1.c - VIA2 emulation in the VIC20.
+ * vic20via1.c - VIA1 emulation in the VIC20.
*
* Written by
* Andre Fachat <fa...@ph...>
@@ -33,32 +33,47 @@
#include "datasette.h"
#include "interrupt.h"
#include "joyport.h"
+#include "joystick.h"
#include "keyboard.h"
#include "lib.h"
#include "maincpu.h"
#include "tapeport.h"
#include "types.h"
+#include "userport.h"
#include "via.h"
+#include "vic.h"
#include "vic20.h"
+#include "vic20-resources.h"
#include "vic20iec.h"
#include "vic20via.h"
+int vic20_vflihack_userport = 0xff;
-void via2_store(uint16_t addr, uint8_t data)
+static int userport_pa6 = 1; /* HACK: pin 8, this is also connected to tape sense */
+static int userport_pb = 0xff;
+
+/* HACK: on the C64, pin 8 is connected to PC2, which automatically generates a pulse
+ when PB is written, which is why both is updated by the same function. */
+static void update_portbits(void)
{
- viacore_store(machine_context.via2, addr, data);
+ store_userport_pbx(userport_pb, userport_pa6 ? USERPORT_NO_PULSE : USERPORT_PULSE);
}
-uint8_t via2_read(uint16_t addr)
+void via1_store(uint16_t addr, uint8_t data)
{
- return viacore_read(machine_context.via2, addr);
+ viacore_store(machine_context.via1, addr, data);
}
-uint8_t via2_peek(uint16_t addr)
+uint8_t via1_read(uint16_t addr)
{
- return viacore_peek(machine_context.via2, addr);
+ return viacore_read(machine_context.via1, addr);
}
+uint8_t via1_peek(uint16_t addr)
+{
+ return viacore_peek(machine_context.via1, addr);
+}
+
static void set_ca2(via_context_t *via_context, int state)
{
}
@@ -65,57 +80,94 @@
static void set_cb2(via_context_t *via_context, int state, int offset)
{
+ if (!via_context->cb2_is_input) {
+ /* CB2 goes to userport pin M */
+ store_userport_pa2(state);
+ }
}
-static void set_int(via_context_t *via_context, unsigned int int_num,
- int value, CLOCK rclk)
+static void set_int(via_context_t *via_context, unsigned int int_num, int value, CLOCK rclk)
{
- interrupt_set_irq(maincpu_int_status, int_num, value, rclk);
+ interrupt_set_nmi(maincpu_int_status, int_num, value, rclk);
}
static void restore_int(via_context_t *via_context, unsigned int int_num, int value)
{
- interrupt_restore_irq(maincpu_int_status, int_num, value);
+ interrupt_restore_nmi(maincpu_int_status, int_num, value);
}
-static void undump_acr(via_context_t *via_context, uint8_t byte)
+static int tape_sense = 0;
+static int tape_write_in = 0;
+static int tape_motor_in = 0;
+
+void via1_set_tape_sense(int v)
{
+ tape_sense = v;
}
-static void store_acr(via_context_t *via_context, uint8_t byte)
+/* FIXME: find out how to set the write in and motor in lines */
+void via1_set_tape_write_in(int v)
{
+ tape_write_in = v;
}
-static void store_sr(via_context_t *via_context, uint8_t byte)
+void via1_set_tape_motor_in(int v)
{
+ tape_motor_in = v;
}
-static void store_t2l(via_context_t *via_context, uint8_t byte)
+static void via1_internal_lightpen_check(uint8_t pa)
{
+ uint8_t b = read_joyport_dig(JOYPORT_1);
+
+ b &= pa;
+
+ vic_set_light_pen(maincpu_clk, !(b & 0x20));
}
+void via1_check_lightpen(void)
+{
+ uint8_t pa = machine_context.via1->via[VIA_PRA] | ~(machine_context.via1->via[VIA_DDRA]);
+
+ via1_internal_lightpen_check(pa);
+}
+
static void undump_pra(via_context_t *via_context, uint8_t byte)
{
+ iec_pa_write(byte);
}
static void store_pra(via_context_t *via_context, uint8_t byte, uint8_t myoldpa,
uint16_t addr)
{
+ uint8_t joy_bits = 0;
+
+ via1_internal_lightpen_check(byte);
+ iec_pa_write(byte);
+
+ joy_bits = ((byte & 0x20) >> 1) | ((byte & 0x1c) >> 2);
+ store_joyport_dig(JOYPORT_1, joy_bits, 0x17);
+
+ tapeport_set_sense_out(TAPEPORT_PORT_1, byte & 0x40 ? 1 : 0);
+
+ userport_pa6 = byte & 0x40 ? 1 : 0;
+ update_portbits(); /* HACK: see above */
}
static void undump_prb(via_context_t *via_context, uint8_t byte)
{
+ userport_pb = byte;
+ update_portbits(); /* HACK: see above */
}
static void store_prb(via_context_t *via_context, uint8_t byte, uint8_t myoldpb,
uint16_t addr)
{
- uint8_t joy_bit = (byte & 0x80) >> 4;
+ /* for mike's VFLI hack, PB0-PB3 are used as A10-A13 of the color ram */
+ vic20_vflihack_userport = byte & 0x0f;
- if ((byte ^ myoldpb) & 8) {
- tapeport_toggle_write_bit(TAPEPORT_PORT_1, (~(via_context->via[VIA_DDRB]) | byte) & 0x8);
- }
- store_joyport_dig(JOYPORT_1, joy_bit, 8);
+ userport_pb = byte;
+ update_portbits(); /* HACK: see above */
}
static void undump_pcr(via_context_t *via_context, uint8_t byte)
@@ -124,12 +176,15 @@
static void reset(via_context_t *via_context)
{
-/*iec_pcr_write(0x22);*/
+ userport_pb = 0xff;
+ userport_pa6 = 1;
+ store_userport_pbx(0xff, USERPORT_NO_PULSE);
+ store_userport_pa2(1);
}
static uint8_t store_pcr(via_context_t *via_context, uint8_t byte, uint16_t addr)
{
- /* FIXME: this should use via_set_ca2() and via_set_cb2() */
+ /* FIXME: should use via_set_ca2() and via_set_cb2() */
if (byte != via_context->via[VIA_PCR]) {
register uint8_t tmp = byte;
/* first set bit 1 and 5 to the real output values */
@@ -139,67 +194,86 @@
if ((tmp & 0xc0) != 0xc0) {
tmp |= 0x20;
}
- iec_pcr_write(tmp);
+
+ tapeport_set_motor(TAPEPORT_PORT_1, !(byte & 0x02));
+
+ store_userport_pa2((uint8_t)((byte & 0x20) >> 5));
}
return byte;
}
-static uint8_t read_pra(via_context_t *via_context, uint16_t addr)
+static void undump_acr(via_context_t *via_context, uint8_t byte)
{
- uint8_t byte;
- /* FIXME: not 100% sure about this... */
- uint8_t val = ~(via_context->via[VIA_DDRA]);
- uint8_t msk = via_context->oldpb;
- uint8_t m;
- int i;
+}
- for (m = 0x1, i = 0; i < 8; m <<= 1, i++) {
- if (!(msk & m)) {
- val &= ~rev_keyarr[i];
- }
- }
+inline static void store_acr(via_context_t *via_context, uint8_t byte)
+{
+}
- byte = val | (via_context->via[VIA_PRA] & via_context->via[VIA_DDRA]);
- return byte;
+inline static void store_sr(via_context_t *via_context, uint8_t byte)
+{
}
-static uint8_t read_prb(via_context_t *via_context)
+inline static void store_t2l(via_context_t *via_context, uint8_t byte)
{
+}
+
+inline static uint8_t read_pra(via_context_t *via_context, uint16_t addr)
+{
uint8_t byte;
- /* FIXME: not 100% sure about this... */
- uint8_t val = ~(via_context->via[VIA_DDRB]);
- uint8_t msk = via_context->oldpa;
- uint8_t joy = ~read_joyport_dig(JOYPORT_1);
- int m, i;
+ uint8_t joy_bits;
- for (m = 0x1, i = 0; i < 8; m <<= 1, i++) {
- if (!(msk & m)) {
- val &= ~keyarr[i];
- }
- }
+ /*
+ Port A is connected this way:
- /* Bit 7 is mapped to the right direction of the joystick (bit
- 3 in `joystick_value[]'). */
- if (joy & 0x8) {
- val &= 0x7f;
- }
+ bit 0 IEC clock
+ bit 1 IEC data
+ bit 2 joystick switch 0 (up)
+ bit 3 joystick switch 1 (down)
+ bit 4 joystick switch 2 (left)
+ bit 5 joystick switch 4 (fire)
+ bit 6 tape sense
+ bit 7 IEC ATN
+ */
- byte = val | (via_context->via[VIA_PRB] & via_context->via[VIA_DDRB]);
+ /* Setup joy bits (2 through 5). Use the `or' of the values
+ of both joysticks so that it works with every joystick
+ setting. This is a bit slow... we might think of a
+ faster method. */
+ joy_bits = read_joyport_dig(JOYPORT_1);
+ joy_bits = ((joy_bits & 0x7) << 2) | ((joy_bits & 0x10) << 1);
+
+ joy_bits |= tape_sense ? 0 : 0x40;
+
+ /* We assume `iec_pa_read()' returns the non-IEC bits
+ as zeroes. */
+ byte = ((via_context->via[VIA_PRA] & via_context->via[VIA_DDRA])
+ | ((iec_pa_read() | joy_bits) & ~(via_context->via[VIA_DDRA])));
return byte;
}
-void via2_init(via_context_t *via_context)
+inline static uint8_t read_prb(via_context_t *via_context)
{
- viacore_init(machine_context.via2, maincpu_alarm_context,
+ uint8_t byte = 0xff;
+ byte = via_context->via[VIA_PRB] | ~(via_context->via[VIA_DDRB]);
+
+ byte = read_userport_pbx(byte);
+
+ return byte;
+}
+
+void via1_init(via_context_t *via_context)
+{
+ viacore_init(machine_context.via1, maincpu_alarm_context,
maincpu_int_status);
}
-void vic20via2_setup_context(machine_context_t *machinecontext)
+void vic20via1_setup_context(machine_context_t *machinecontext)
{
via_context_t *via;
- machinecontext->via2 = lib_malloc(sizeof(via_context_t));
- via = machinecontext->via2;
+ machinecontext->via1 = lib_malloc(sizeof(via_context_t));
+ via = machinecontext->via1;
via->prv = NULL;
via->context = NULL;
@@ -214,7 +288,7 @@
via->write_offset = 0;
- via->irq_line = IK_IRQ;
+ via->irq_line = IK_NMI;
via->undump_pra = undump_pra;
via->undump_prb = undump_prb;
Modified: trunk/vice/src/vic20/vic20via2.c
===================================================================
--- trunk/vice/src/vic20/vic20via2.c 2025-03-28 18:04:09 UTC (rev 45598)
+++ trunk/vice/src/vic20/vic20via2.c 2025-03-28 18:10:56 UTC (rev 45599)
@@ -1,5 +1,5 @@
/*
- * vic20via2.c - VIA1 emulation in the VIC20.
+ * vic20via2.c - VIA2 emulation in the VIC20.
*
* Written by
* Andre Fachat <fa...@ph...>
@@ -33,47 +33,32 @@
#include "datasette.h"
#include "interrupt.h"
#include "joyport.h"
-#include "joystick.h"
#include "keyboard.h"
#include "lib.h"
#include "maincpu.h"
#include "tapeport.h"
#include "types.h"
-#include "userport.h"
#include "via.h"
-#include "vic.h"
#include "vic20.h"
-#include "vic20-resources.h"
#include "vic20iec.h"
#include "vic20via.h"
-int vic20_vflihack_userport = 0xff;
-static int userport_pa6 = 1; /* HACK: pin 8, this is also connected to tape sense */
-static int userport_pb = 0xff;
-
-/* HACK: on the C64, pin 8 is connected to PC2, which automatically generates a pulse
- when PB is written, which is why both is updated by the same function. */
-static void update_portbits(void)
+void via2_store(uint16_t addr, uint8_t data)
{
- store_userport_pbx(userport_pb, userport_pa6 ? USERPORT_NO_PULSE : USERPORT_PULSE);
+ viacore_store(machine_context.via2, addr, data);
}
-void via1_store(uint16_t addr, uint8_t data)
+uint8_t via2_read(uint16_t addr)
{
- viacore_store(machine_context.via1, addr, data);
+ return viacore_read(machine_context.via2, addr);
}
-uint8_t via1_read(uint16_t addr)
+uint8_t via2_peek(uint16_t addr)
{
- return viacore_read(machine_context.via1, addr);
+ return viacore_peek(machine_context.via2, addr);
}
-uint8_t via1_peek(uint16_t addr)
-{
- return viacore_peek(machine_context.via1, addr);
-}
-
static void set_ca2(via_context_t *via_context, int state)
{
}
@@ -80,94 +65,57 @@
static void set_cb2(via_context_t *via_context, int state, int offset)
{
- if (!via_context->cb2_is_input) {
- /* CB2 goes to userport pin M */
- store_userport_pa2(state);
- }
}
-static void set_int(via_context_t *via_context, unsigned int int_num, int value, CLOCK rclk)
+static void set_int(via_context_t *via_context, unsigned int int_num,
+ int value, CLOCK rclk)
{
- interrupt_set_nmi(maincpu_int_status, int_num, value, rclk);
+ interrupt_set_irq(maincpu_int_status, int_num, value, rclk);
}
static void restore_int(via_context_t *via_context, unsigned int int_num, int value)
{
- interrupt_restore_nmi(maincpu_int_status, int_num, value);
+ interrupt_restore_irq(maincpu_int_status, int_num, value);
}
-static int tape_sense = 0;
-static int tape_write_in = 0;
-static int tape_motor_in = 0;
-
-void via1_set_tape_sense(int v)
+static void undump_acr(via_context_t *via_context, uint8_t byte)
{
- tape_sense = v;
}
-/* FIXME: find out how to set the write in and motor in lines */
-void via1_set_tape_write_in(int v)
+static void store_acr(via_context_t *via_context, uint8_t byte)
{
- tape_write_in = v;
}
-void via1_set_tape_motor_in(int v)
+static void store_sr(via_context_t *via_context, uint8_t byte)
{
- tape_motor_in = v;
}
-static void via1_internal_lightpen_check(uint8_t pa)
+static void store_t2l(via_context_t *via_context, uint8_t byte)
{
- uint8_t b = read_joyport_dig(JOYPORT_1);
-
- b &= pa;
-
- vic_set_light_pen(maincpu_clk, !(b & 0x20));
}
-void via1_check_lightpen(void)
-{
- uint8_t pa = machine_context.via1->via[VIA_PRA] | ~(machine_context.via1->via[VIA_DDRA]);
-
- via1_internal_lightpen_check(pa);
-}
-
static void undump_pra(via_context_t *via_context, uint8_t byte)
{
- iec_pa_write(byte);
}
static void store_pra(via_context_t *via_context, uint8_t byte, uint8_t myoldpa,
uint16_t addr)
{
- uint8_t joy_bits = 0;
-
- via1_internal_lightpen_check(byte);
- iec_pa_write(byte);
-
- joy_bits = ((byte & 0x20) >> 1) | ((byte & 0x1c) >> 2);
- store_joyport_dig(JOYPORT_1, joy_bits, 0x17);
-
- tapeport_set_sense_out(TAPEPORT_PORT_1, byte & 0x40 ? 1 : 0);
-
- userport_pa6 = byte & 0x40 ? 1 : 0;
- update_portbits(); /* HACK: see above */
}
static void undump_prb(via_context_t *via_context, uint8_t byte)
{
- userport_pb = byte;
- update_portbits(); /* HACK: see above */
}
static void store_prb(via_context_t *via_context, uint8_t byte, uint8_t myoldpb,
uint16_t addr)
{
- /* for mike's VFLI hack, PB0-PB3 are used as A10-A13 of the color ram */
- vic20_vflihack_userport = byte & 0x0f;
+ uint8_t joy_bit = (byte & 0x80) >> 4;
- userport_pb = byte;
- update_portbits(); /* HACK: see above */
+ if ((byte ^ myoldpb) & 8) {
+ tapeport_toggle_write_bit(TAPEPORT_PORT_1, (~(via_context->via[VIA_DDRB]) | byte) & 0x8);
+ }
+ store_joyport_dig(JOYPORT_1, joy_bit, 8);
}
static void undump_pcr(via_context_t *via_context, uint8_t byte)
@@ -176,15 +124,12 @@
static void reset(via_context_t *via_context)
{
- userport_pb = 0xff;
- userport_pa6 = 1;
- store_userport_pbx(0xff, USERPORT_NO_PULSE);
- store_userport_pa2(1);
+/*iec_pcr_write(0x22);*/
}
static uint8_t store_pcr(via_context_t *via_context, uint8_t byte, uint16_t addr)
{
- /* FIXME: should use via_set_ca2() and via_set_cb2() */
+ /* FIXME: this should use via_set_ca2() and via_set_cb2() */
if (byte != via_context->via[VIA_PCR]) {
register uint8_t tmp = byte;
/* first set bit 1 and 5 to the real output values */
@@ -194,86 +139,67 @@
if ((tmp & 0xc0) != 0xc0) {
tmp |= 0x20;
}
-
- tapeport_set_motor(TAPEPORT_PORT_1, !(byte & 0x02));
-
- store_userport_pa2((uint8_t)((byte & 0x20) >> 5));
+ iec_pcr_write(tmp);
}
return byte;
}
-static void undump_acr(via_context_t *via_context, uint8_t byte)
+static uint8_t read_pra(via_context_t *via_context, uint16_t addr)
{
-}
+ uint8_t byte;
+ /* FIXME: not 100% sure about this... */
+ uint8_t val = ~(via_context->via[VIA_DDRA]);
+ uint8_t msk = via_context->oldpb;
+ uint8_t m;
+ int i;
-inline static void store_acr(via_context_t *via_context, uint8_t byte)
-{
-}
+ for (m = 0x1, i = 0; i < 8; m <<= 1, i++) {
+ if (!(msk & m)) {
+ val &= ~rev_keyarr[i];
+ }
+ }
-inline static void store_sr(via_context_t *via_context, uint8_t byte)
-{
+ byte = val | (via_context->via[VIA_PRA] & via_context->via[VIA_DDRA]);
+ return byte;
}
-inline static void store_t2l(via_context_t *via_context, uint8_t byte)
+static uint8_t read_prb(via_context_t *via_context)
{
-}
-
-inline static uint8_t read_pra(via_context_t *via_context, uint16_t addr)
-{
uint8_t byte;
- uint8_t joy_bits;
+ /* FIXME: not 100% sure about this... */
+ uint8_t val = ~(via_context->via[VIA_DDRB]);
+ uint8_t msk = via_context->oldpa;
+ uint8_t joy = ~read_joyport_dig(JOYPORT_1);
+ int m, i;
- /*
- Port A is connected this way:
+ for (m = 0x1, i = 0; i < 8; m <<= 1, i++) {
+ if (!(msk & m)) {
+ val &= ~keyarr[i];
+ }
+ }
- bit 0 IEC clock
- bit 1 IEC data
- bit 2 joystick switch 0 (up)
- bit 3 joystick switch 1 (down)
- bit 4 joystick switch 2 (left)
- bit 5 joystick switch 4 (fire)
- bit 6 tape sense
- bit 7 IEC ATN
- */
+ /* Bit 7 is mapped to the right direction of the joystick (bit
+ 3 in `joystick_value[]'). */
+ if (joy & 0x8) {
+ val &= 0x7f;
+ }
- /* Setup joy bits (2 through 5). Use the `or' of the values
- of both joysticks so that it works with every joystick
- setting. This is a bit slow... we might think of a
- faster method. */
- joy_bits = read_joyport_dig(JOYPORT_1);
- joy_bits = ((joy_bits & 0x7) << 2) | ((joy_bits & 0x10) << 1);
-
- joy_bits |= tape_sense ? 0 : 0x40;
-
- /* We assume `iec_pa_read()' returns the non-IEC bits
- as zeroes. */
- byte = ((via_context->via[VIA_PRA] & via_context->via[VIA_DDRA])
- | ((iec_pa_read() | joy_bits) & ~(via_context->via[VIA_DDRA])));
+ byte = val | (via_context->via[VIA_PRB] & via_context->via[VIA_DDRB]);
return byte;
}
-inline static uint8_t read_prb(via_context_t *via_context)
+void via2_init(via_context_t *via_context)
{
- uint8_t byte = 0xff;
- byte = via_context->via[VIA_PRB] | ~(via_context->via[VIA_DDRB]);
-
- byte = read_userport_pbx(byte);
-
- return byte;
-}
-
-void via1_init(via_context_t *via_context)
-{
- viacore_init(machine_context.via1, maincpu_alarm_context,
+ viacore_init(machine_context.via2, maincpu_alarm_context,
maincpu_int_status);
}
-void vic20via1_setup_context(machine_context_t *machinecontext)
+void vic20via2_setup_context(machine_context_t *machinecontext)
{
via_context_t *via;
- machinecontext->via1 = lib_malloc(sizeof(via_context_t));
- via = machinecontext->via1;
+ machinecontext->via2 = lib_malloc(sizeof(via_context_t));
+ via = machinecontext->via2;
via->prv = NULL;
via->context = NULL;
@@ -288,7 +214,7 @@
via->write_offset = 0;
- via->irq_line = IK_NMI;
+ via->irq_line = IK_IRQ;
via->undump_pra = undump_pra;
via->undump_prb = undump_prb;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gp...@us...> - 2025-03-28 18:04:17
|
Revision: 45598
http://sourceforge.net/p/vice-emu/code/45598
Author: gpz
Date: 2025-03-28 18:04:09 +0000 (Fri, 28 Mar 2025)
Log Message:
-----------
third step of 3-way commit in order to rename the via functions, this one renames via3->via1 in code.
Modified Paths:
--------------
trunk/vice/src/vic20/vic20-snapshot.c
trunk/vice/src/vic20/vic20.c
trunk/vice/src/vic20/vic20.h
trunk/vice/src/vic20/vic20datasette.c
trunk/vice/src/vic20/vic20rsuser.c
trunk/vice/src/vic20/vic20via.h
trunk/vice/src/vic20/vic20via2.c
Modified: trunk/vice/src/vic20/vic20-snapshot.c
===================================================================
--- trunk/vice/src/vic20/vic20-snapshot.c 2025-03-28 17:58:37 UTC (rev 45597)
+++ trunk/vice/src/vic20/vic20-snapshot.c 2025-03-28 18:04:09 UTC (rev 45598)
@@ -79,7 +79,7 @@
if (maincpu_snapshot_write_module(s) < 0
|| vic20_snapshot_write_module(s, save_roms) < 0
|| vic_snapshot_write_module(s) < 0
- || viacore_snapshot_write_module(machine_context.via3, s) < 0
+ || viacore_snapshot_write_module(machine_context.via1, s) < 0
|| viacore_snapshot_write_module(machine_context.via2, s) < 0
|| drive_snapshot_write_module(s, save_disks, save_roms) < 0
|| fsdrive_snapshot_write_module(s) < 0
@@ -129,7 +129,7 @@
if (maincpu_snapshot_read_module(s) < 0
|| vic20_snapshot_read_module(s) < 0
|| vic_snapshot_read_module(s) < 0
- || viacore_snapshot_read_module(machine_context.via3, s) < 0
+ || viacore_snapshot_read_module(machine_context.via1, s) < 0
|| viacore_snapshot_read_module(machine_context.via2, s) < 0
|| drive_snapshot_read_module(s) < 0
|| fsdrive_snapshot_read_module(s) < 0
Modified: trunk/vice/src/vic20/vic20.c
===================================================================
--- trunk/vice/src/vic20/vic20.c 2025-03-28 17:58:37 UTC (rev 45597)
+++ trunk/vice/src/vic20/vic20.c 2025-03-28 18:04:09 UTC (rev 45598)
@@ -287,9 +287,9 @@
/* ------------------------------------------------------------------------ */
-static int via3_dump(void)
+static int via1_dump(void)
{
- return viacore_dump(machine_context.via3);
+ return viacore_dump(machine_context.via1);
}
static int via2_dump(void)
@@ -300,7 +300,7 @@
static void vic_via1_via2_store(uint16_t addr, uint8_t data)
{
if (addr & 0x10) {
- via3_store(addr, data);
+ via1_store(addr, data);
}
if (addr & 0x20) {
via2_store(addr, data);
@@ -313,7 +313,7 @@
uint8_t retval = vic_read(addr);
if (addr & 0x10) {
- retval &= via3_read(addr);
+ retval &= via1_read(addr);
}
if (addr & 0x20) {
@@ -328,7 +328,7 @@
uint8_t retval = vic_peek(addr);
if (addr & 0x10) {
- retval &= via3_peek(addr);
+ retval &= via1_peek(addr);
}
if (addr & 0x20) {
@@ -341,7 +341,7 @@
static void via1_via2_store(uint16_t addr, uint8_t data)
{
if (addr & 0x10) {
- via3_store(addr, data);
+ via1_store(addr, data);
}
if (addr & 0x20) {
via2_store(addr, data);
@@ -353,7 +353,7 @@
uint8_t retval = 0xff;
if (addr & 0x10) {
- retval &= via3_read(addr);
+ retval &= via1_read(addr);
}
if (addr & 0x20) {
@@ -368,7 +368,7 @@
uint8_t retval = 0xff;
if (addr & 0x10) {
- retval &= via3_peek(addr);
+ retval &= via1_peek(addr);
}
if (addr & 0x20) {
@@ -404,8 +404,8 @@
/* FIXME: the upper 4 bits of the mask are used to indicate the register size if not equal to the mask,
this is done as a temporary HACK to keep mirrors working and still get the correct register size,
this needs to be fixed properly after the 3.6 release */
-static io_source_t via3_device = {
- "VIA3", /* name of the chip */
+static io_source_t via1_device = {
+ "VIA1", /* name of the chip */
IO_DETACH_NEVER, /* chip is never involved in collisions, so no detach */
IO_DETACH_NO_RESOURCE, /* does not use a resource for detach */
#if 0
@@ -417,7 +417,7 @@
NULL, /* NO poke function */
via1_via2_read, /* read function */
via1_via2_peek, /* peek function */
- via3_dump, /* chip state information dump function */
+ via1_dump, /* chip state information dump function */
IO_CART_ID_NONE, /* not a cartridge */
IO_PRIO_HIGH, /* high priority, chip and mirrors never involved in collisions */
0, /* insertion order, gets filled in by the registration function */
@@ -448,13 +448,13 @@
};
static io_source_list_t *vic_list_item = NULL;
-static io_source_list_t *via3_list_item = NULL;
+static io_source_list_t *via1_list_item = NULL;
static io_source_list_t *via2_list_item = NULL;
static void vic20io0_init(void)
{
vic_list_item = io_source_register(&vic_device);
- via3_list_item = io_source_register(&via3_device);
+ via1_list_item = io_source_register(&via1_device);
via2_list_item = io_source_register(&via2_device);
}
@@ -892,7 +892,7 @@
void machine_setup_context(void)
{
- vic20via3_setup_context(&machine_context);
+ vic20via1_setup_context(&machine_context);
vic20via2_setup_context(&machine_context);
vic20ieeevia1_setup_context(&machine_context);
vic20ieeevia2_setup_context(&machine_context);
@@ -960,7 +960,7 @@
return -1;
}
- via3_init(machine_context.via3);
+ via1_init(machine_context.via1);
via2_init(machine_context.via2);
ieeevia1_init(machine_context.ieeevia1);
@@ -1028,7 +1028,7 @@
#endif
/* Register joystick callback (for lightpen triggering via fire button) */
- joystick_register_machine(via3_check_lightpen);
+ joystick_register_machine(via1_check_lightpen);
#ifdef HAVE_MIDI
midi_init();
@@ -1046,7 +1046,7 @@
serial_traps_reset();
- viacore_reset(machine_context.via3);
+ viacore_reset(machine_context.via1);
viacore_reset(machine_context.via2);
vic_reset();
sid_reset();
@@ -1090,7 +1090,7 @@
/* and cartridge */
cartridge_detach_image(-1);
- viacore_shutdown(machine_context.via3);
+ viacore_shutdown(machine_context.via1);
viacore_shutdown(machine_context.via2);
viacore_shutdown(machine_context.ieeevia1);
viacore_shutdown(machine_context.ieeevia2);
@@ -1121,7 +1121,7 @@
void machine_set_restore_key(int v)
{
- viacore_signal(machine_context.via3,
+ viacore_signal(machine_context.via1,
VIA_SIG_CA1, v ? VIA_SIG_FALL : VIA_SIG_RISE);
}
@@ -1285,7 +1285,7 @@
static void vic20_userport_set_flag(uint8_t b)
{
- viacore_signal(machine_context.via3, VIA_SIG_CB1, b ? VIA_SIG_RISE : VIA_SIG_FALL);
+ viacore_signal(machine_context.via1, VIA_SIG_CB1, b ? VIA_SIG_RISE : VIA_SIG_FALL);
}
static userport_port_props_t userport_props = {
Modified: trunk/vice/src/vic20/vic20.h
===================================================================
--- trunk/vice/src/vic20/vic20.h 2025-03-28 17:58:37 UTC (rev 45597)
+++ trunk/vice/src/vic20/vic20.h 2025-03-28 18:04:09 UTC (rev 45598)
@@ -78,7 +78,7 @@
struct via_context_s;
typedef struct machine_context_s {
- struct via_context_s *via3;
+ struct via_context_s *via1;
struct via_context_s *via2;
struct via_context_s *ieeevia1;
struct via_context_s *ieeevia2;
Modified: trunk/vice/src/vic20/vic20datasette.c
===================================================================
--- trunk/vice/src/vic20/vic20datasette.c 2025-03-28 17:58:37 UTC (rev 45597)
+++ trunk/vice/src/vic20/vic20datasette.c 2025-03-28 18:04:09 UTC (rev 45598)
@@ -44,7 +44,7 @@
void machine_set_tape_sense(int port, int sense)
{
if (port == TAPEPORT_PORT_1) {
- via3_set_tape_sense(sense);
+ via1_set_tape_sense(sense);
}
}
@@ -51,7 +51,7 @@
void machine_set_tape_write_in(int port, int val)
{
if (port == TAPEPORT_PORT_1) {
- via3_set_tape_write_in(val);
+ via1_set_tape_write_in(val);
}
}
@@ -58,6 +58,6 @@
void machine_set_tape_motor_in(int port, int val)
{
if (port == TAPEPORT_PORT_1) {
- via3_set_tape_motor_in(val);
+ via1_set_tape_motor_in(val);
}
}
Modified: trunk/vice/src/vic20/vic20rsuser.c
===================================================================
--- trunk/vice/src/vic20/vic20rsuser.c 2025-03-28 17:58:37 UTC (rev 45597)
+++ trunk/vice/src/vic20/vic20rsuser.c 2025-03-28 18:04:09 UTC (rev 45598)
@@ -46,8 +46,8 @@
static void vic20_trigger_start(void)
{
- viacore_signal(machine_context.via3, VIA_SIG_CB1, VIA_SIG_FALL);
- viacore_signal(machine_context.via3, VIA_SIG_CB1, VIA_SIG_RISE);
+ viacore_signal(machine_context.via1, VIA_SIG_CB1, VIA_SIG_FALL);
+ viacore_signal(machine_context.via1, VIA_SIG_CB1, VIA_SIG_RISE);
}
void vic20_rsuser_init(void)
Modified: trunk/vice/src/vic20/vic20via.h
===================================================================
--- trunk/vice/src/vic20/vic20via.h 2025-03-28 17:58:37 UTC (rev 45597)
+++ trunk/vice/src/vic20/vic20via.h 2025-03-28 18:04:09 UTC (rev 45598)
@@ -33,11 +33,11 @@
struct machine_context_s;
struct via_context_s;
-void vic20via3_setup_context(struct machine_context_s *machine_context);
-void via3_init(struct via_context_s *via_context);
-void via3_store(uint16_t addr, uint8_t byte);
-uint8_t via3_read(uint16_t addr);
-uint8_t via3_peek(uint16_t addr);
+void vic20via1_setup_context(struct machine_context_s *machine_context);
+void via1_init(struct via_context_s *via_context);
+void via1_store(uint16_t addr, uint8_t byte);
+uint8_t via1_read(uint16_t addr);
+uint8_t via1_peek(uint16_t addr);
void vic20via2_setup_context(struct machine_context_s *machine_context);
void via2_init(struct via_context_s *via_context);
@@ -45,10 +45,10 @@
uint8_t via2_read(uint16_t addr);
uint8_t via2_peek(uint16_t addr);
-void via3_set_tape_sense(int v);
-void via3_set_tape_write_in(int v);
-void via3_set_tape_motor_in(int v);
-void via3_check_lightpen(void);
+void via1_set_tape_sense(int v);
+void via1_set_tape_write_in(int v);
+void via1_set_tape_motor_in(int v);
+void via1_check_lightpen(void);
extern int vic20_vflihack_userport;
Modified: trunk/vice/src/vic20/vic20via2.c
===================================================================
--- trunk/vice/src/vic20/vic20via2.c 2025-03-28 17:58:37 UTC (rev 45597)
+++ trunk/vice/src/vic20/vic20via2.c 2025-03-28 18:04:09 UTC (rev 45598)
@@ -59,19 +59,19 @@
store_userport_pbx(userport_pb, userport_pa6 ? USERPORT_NO_PULSE : USERPORT_PULSE);
}
-void via3_store(uint16_t addr, uint8_t data)
+void via1_store(uint16_t addr, uint8_t data)
{
- viacore_store(machine_context.via3, addr, data);
+ viacore_store(machine_context.via1, addr, data);
}
-uint8_t via3_read(uint16_t addr)
+uint8_t via1_read(uint16_t addr)
{
- return viacore_read(machine_context.via3, addr);
+ return viacore_read(machine_context.via1, addr);
}
-uint8_t via3_peek(uint16_t addr)
+uint8_t via1_peek(uint16_t addr)
{
- return viacore_peek(machine_context.via3, addr);
+ return viacore_peek(machine_context.via1, addr);
}
static void set_ca2(via_context_t *via_context, int state)
@@ -100,23 +100,23 @@
static int tape_write_in = 0;
static int tape_motor_in = 0;
-void via3_set_tape_sense(int v)
+void via1_set_tape_sense(int v)
{
tape_sense = v;
}
/* FIXME: find out how to set the write in and motor in lines */
-void via3_set_tape_write_in(int v)
+void via1_set_tape_write_in(int v)
{
tape_write_in = v;
}
-void via3_set_tape_motor_in(int v)
+void via1_set_tape_motor_in(int v)
{
tape_motor_in = v;
}
-static void via3_internal_lightpen_check(uint8_t pa)
+static void via1_internal_lightpen_check(uint8_t pa)
{
uint8_t b = read_joyport_dig(JOYPORT_1);
@@ -125,11 +125,11 @@
vic_set_light_pen(maincpu_clk, !(b & 0x20));
}
-void via3_check_lightpen(void)
+void via1_check_lightpen(void)
{
- uint8_t pa = machine_context.via3->via[VIA_PRA] | ~(machine_context.via3->via[VIA_DDRA]);
+ uint8_t pa = machine_context.via1->via[VIA_PRA] | ~(machine_context.via1->via[VIA_DDRA]);
- via3_internal_lightpen_check(pa);
+ via1_internal_lightpen_check(pa);
}
static void undump_pra(via_context_t *via_context, uint8_t byte)
@@ -142,7 +142,7 @@
{
uint8_t joy_bits = 0;
- via3_internal_lightpen_check(byte);
+ via1_internal_lightpen_check(byte);
iec_pa_write(byte);
joy_bits = ((byte & 0x20) >> 1) | ((byte & 0x1c) >> 2);
@@ -262,18 +262,18 @@
return byte;
}
-void via3_init(via_context_t *via_context)
+void via1_init(via_context_t *via_context)
{
- viacore_init(machine_context.via3, maincpu_alarm_context,
+ viacore_init(machine_context.via1, maincpu_alarm_context,
maincpu_int_status);
}
-void vic20via3_setup_context(machine_context_t *machinecontext)
+void vic20via1_setup_context(machine_context_t *machinecontext)
{
via_context_t *via;
- machinecontext->via3 = lib_malloc(sizeof(via_context_t));
- via = machinecontext->via3;
+ machinecontext->via1 = lib_malloc(sizeof(via_context_t));
+ via = machinecontext->via1;
via->prv = NULL;
via->context = NULL;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gp...@us...> - 2025-03-28 17:58:50
|
Revision: 45597
http://sourceforge.net/p/vice-emu/code/45597
Author: gpz
Date: 2025-03-28 17:58:37 +0000 (Fri, 28 Mar 2025)
Log Message:
-----------
second step of 3-way commit in order to rename the via functions, this one renames via1->via2 in code
Modified Paths:
--------------
trunk/vice/src/vic20/vic20-snapshot.c
trunk/vice/src/vic20/vic20.c
trunk/vice/src/vic20/vic20.h
trunk/vice/src/vic20/vic20datasette.c
trunk/vice/src/vic20/vic20via.h
trunk/vice/src/vic20/vic20via1.c
Modified: trunk/vice/src/vic20/vic20-snapshot.c
===================================================================
--- trunk/vice/src/vic20/vic20-snapshot.c 2025-03-28 17:47:13 UTC (rev 45596)
+++ trunk/vice/src/vic20/vic20-snapshot.c 2025-03-28 17:58:37 UTC (rev 45597)
@@ -58,7 +58,7 @@
#define SNAP_MAJOR 3
-#define SNAP_MINOR 0
+#define SNAP_MINOR 1
int vic20_snapshot_write(const char *name, int save_roms, int save_disks,
@@ -79,8 +79,8 @@
if (maincpu_snapshot_write_module(s) < 0
|| vic20_snapshot_write_module(s, save_roms) < 0
|| vic_snapshot_write_module(s) < 0
- || viacore_snapshot_write_module(machine_context.via1, s) < 0
|| viacore_snapshot_write_module(machine_context.via3, s) < 0
+ || viacore_snapshot_write_module(machine_context.via2, s) < 0
|| drive_snapshot_write_module(s, save_disks, save_roms) < 0
|| fsdrive_snapshot_write_module(s) < 0
|| event_snapshot_write_module(s, event_mode) < 0
@@ -129,8 +129,8 @@
if (maincpu_snapshot_read_module(s) < 0
|| vic20_snapshot_read_module(s) < 0
|| vic_snapshot_read_module(s) < 0
- || viacore_snapshot_read_module(machine_context.via1, s) < 0
|| viacore_snapshot_read_module(machine_context.via3, s) < 0
+ || viacore_snapshot_read_module(machine_context.via2, s) < 0
|| drive_snapshot_read_module(s) < 0
|| fsdrive_snapshot_read_module(s) < 0
|| event_snapshot_read_module(s, event_mode) < 0
Modified: trunk/vice/src/vic20/vic20.c
===================================================================
--- trunk/vice/src/vic20/vic20.c 2025-03-28 17:47:13 UTC (rev 45596)
+++ trunk/vice/src/vic20/vic20.c 2025-03-28 17:58:37 UTC (rev 45597)
@@ -292,9 +292,9 @@
return viacore_dump(machine_context.via3);
}
-static int via1_dump(void)
+static int via2_dump(void)
{
- return viacore_dump(machine_context.via1);
+ return viacore_dump(machine_context.via2);
}
static void vic_via1_via2_store(uint16_t addr, uint8_t data)
@@ -303,7 +303,7 @@
via3_store(addr, data);
}
if (addr & 0x20) {
- via1_store(addr, data);
+ via2_store(addr, data);
}
vic_store(addr, data);
}
@@ -317,7 +317,7 @@
}
if (addr & 0x20) {
- retval &= via1_read(addr);
+ retval &= via2_read(addr);
}
return retval;
@@ -332,7 +332,7 @@
}
if (addr & 0x20) {
- retval &= via1_peek(addr);
+ retval &= via2_peek(addr);
}
return retval;
@@ -344,7 +344,7 @@
via3_store(addr, data);
}
if (addr & 0x20) {
- via1_store(addr, data);
+ via2_store(addr, data);
}
}
@@ -357,7 +357,7 @@
}
if (addr & 0x20) {
- retval &= via1_read(addr);
+ retval &= via2_read(addr);
}
return retval;
@@ -372,7 +372,7 @@
}
if (addr & 0x20) {
- retval &= via1_peek(addr);
+ retval &= via2_peek(addr);
}
return retval;
@@ -427,8 +427,8 @@
/* FIXME: the upper 4 bits of the mask are used to indicate the register size if not equal to the mask,
this is done as a temporary HACK to keep mirrors working and still get the correct register size,
this needs to be fixed properly after the 3.6 release */
-static io_source_t via1_device = {
- "VIA1", /* name of the chip */
+static io_source_t via2_device = {
+ "VIA2", /* name of the chip */
IO_DETACH_NEVER, /* chip is never involved in collisions, so no detach */
IO_DETACH_NO_RESOURCE, /* does not use a resource for detach */
#if 0
@@ -440,7 +440,7 @@
NULL, /* NO poke function */
via1_via2_read, /* read function */
via1_via2_peek, /* peek function */
- via1_dump, /* chip state information dump function */
+ via2_dump, /* chip state information dump function */
IO_CART_ID_NONE, /* not a cartridge */
IO_PRIO_HIGH, /* high priority, chip and mirrors never involved in collisions */
0, /* insertion order, gets filled in by the registration function */
@@ -448,14 +448,14 @@
};
static io_source_list_t *vic_list_item = NULL;
-static io_source_list_t *via1_list_item = NULL;
static io_source_list_t *via3_list_item = NULL;
+static io_source_list_t *via2_list_item = NULL;
static void vic20io0_init(void)
{
vic_list_item = io_source_register(&vic_device);
- via1_list_item = io_source_register(&via1_device);
via3_list_item = io_source_register(&via3_device);
+ via2_list_item = io_source_register(&via2_device);
}
/* ------------------------------------------------------------------------ */
@@ -892,8 +892,8 @@
void machine_setup_context(void)
{
- vic20via1_setup_context(&machine_context);
vic20via3_setup_context(&machine_context);
+ vic20via2_setup_context(&machine_context);
vic20ieeevia1_setup_context(&machine_context);
vic20ieeevia2_setup_context(&machine_context);
machine_printer_setup_context(&machine_context);
@@ -960,8 +960,8 @@
return -1;
}
- via1_init(machine_context.via1);
via3_init(machine_context.via3);
+ via2_init(machine_context.via2);
ieeevia1_init(machine_context.ieeevia1);
ieeevia2_init(machine_context.ieeevia2);
@@ -1046,8 +1046,8 @@
serial_traps_reset();
- viacore_reset(machine_context.via1);
viacore_reset(machine_context.via3);
+ viacore_reset(machine_context.via2);
vic_reset();
sid_reset();
@@ -1090,8 +1090,8 @@
/* and cartridge */
cartridge_detach_image(-1);
- viacore_shutdown(machine_context.via1);
viacore_shutdown(machine_context.via3);
+ viacore_shutdown(machine_context.via2);
viacore_shutdown(machine_context.ieeevia1);
viacore_shutdown(machine_context.ieeevia2);
Modified: trunk/vice/src/vic20/vic20.h
===================================================================
--- trunk/vice/src/vic20/vic20.h 2025-03-28 17:47:13 UTC (rev 45596)
+++ trunk/vice/src/vic20/vic20.h 2025-03-28 17:58:37 UTC (rev 45597)
@@ -78,8 +78,8 @@
struct via_context_s;
typedef struct machine_context_s {
- struct via_context_s *via1;
struct via_context_s *via3;
+ struct via_context_s *via2;
struct via_context_s *ieeevia1;
struct via_context_s *ieeevia2;
struct printer_context_s *printer[3];
Modified: trunk/vice/src/vic20/vic20datasette.c
===================================================================
--- trunk/vice/src/vic20/vic20datasette.c 2025-03-28 17:47:13 UTC (rev 45596)
+++ trunk/vice/src/vic20/vic20datasette.c 2025-03-28 17:58:37 UTC (rev 45597)
@@ -37,7 +37,7 @@
void machine_trigger_flux_change(int port, unsigned int on)
{
if (port == TAPEPORT_PORT_1) {
- viacore_signal(machine_context.via1, VIA_SIG_CA1, VIA_SIG_FALL);
+ viacore_signal(machine_context.via2, VIA_SIG_CA1, VIA_SIG_FALL);
}
}
Modified: trunk/vice/src/vic20/vic20via.h
===================================================================
--- trunk/vice/src/vic20/vic20via.h 2025-03-28 17:47:13 UTC (rev 45596)
+++ trunk/vice/src/vic20/vic20via.h 2025-03-28 17:58:37 UTC (rev 45597)
@@ -33,12 +33,6 @@
struct machine_context_s;
struct via_context_s;
-void vic20via1_setup_context(struct machine_context_s *machine_context);
-void via1_init(struct via_context_s *via_context);
-void via1_store(uint16_t addr, uint8_t byte);
-uint8_t via1_read(uint16_t addr);
-uint8_t via1_peek(uint16_t addr);
-
void vic20via3_setup_context(struct machine_context_s *machine_context);
void via3_init(struct via_context_s *via_context);
void via3_store(uint16_t addr, uint8_t byte);
@@ -45,6 +39,12 @@
uint8_t via3_read(uint16_t addr);
uint8_t via3_peek(uint16_t addr);
+void vic20via2_setup_context(struct machine_context_s *machine_context);
+void via2_init(struct via_context_s *via_context);
+void via2_store(uint16_t addr, uint8_t byte);
+uint8_t via2_read(uint16_t addr);
+uint8_t via2_peek(uint16_t addr);
+
void via3_set_tape_sense(int v);
void via3_set_tape_write_in(int v);
void via3_set_tape_motor_in(int v);
Modified: trunk/vice/src/vic20/vic20via1.c
===================================================================
--- trunk/vice/src/vic20/vic20via1.c 2025-03-28 17:47:13 UTC (rev 45596)
+++ trunk/vice/src/vic20/vic20via1.c 2025-03-28 17:58:37 UTC (rev 45597)
@@ -44,19 +44,19 @@
#include "vic20via.h"
-void via1_store(uint16_t addr, uint8_t data)
+void via2_store(uint16_t addr, uint8_t data)
{
- viacore_store(machine_context.via1, addr, data);
+ viacore_store(machine_context.via2, addr, data);
}
-uint8_t via1_read(uint16_t addr)
+uint8_t via2_read(uint16_t addr)
{
- return viacore_read(machine_context.via1, addr);
+ return viacore_read(machine_context.via2, addr);
}
-uint8_t via1_peek(uint16_t addr)
+uint8_t via2_peek(uint16_t addr)
{
- return viacore_peek(machine_context.via1, addr);
+ return viacore_peek(machine_context.via2, addr);
}
static void set_ca2(via_context_t *via_context, int state)
@@ -188,18 +188,18 @@
return byte;
}
-void via1_init(via_context_t *via_context)
+void via2_init(via_context_t *via_context)
{
- viacore_init(machine_context.via1, maincpu_alarm_context,
+ viacore_init(machine_context.via2, maincpu_alarm_context,
maincpu_int_status);
}
-void vic20via1_setup_context(machine_context_t *machinecontext)
+void vic20via2_setup_context(machine_context_t *machinecontext)
{
via_context_t *via;
- machinecontext->via1 = lib_malloc(sizeof(via_context_t));
- via = machinecontext->via1;
+ machinecontext->via2 = lib_malloc(sizeof(via_context_t));
+ via = machinecontext->via2;
via->prv = NULL;
via->context = NULL;
@@ -207,8 +207,8 @@
via->rmw_flag = &maincpu_rmw_flag;
via->clk_ptr = &maincpu_clk;
- via->myname = lib_msprintf("Via1");
- via->my_module_name = lib_msprintf("VIA1");
+ via->myname = lib_msprintf("Via2");
+ via->my_module_name = lib_msprintf("VIA2");
viacore_setup_context(via);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gp...@us...> - 2025-03-28 17:47:22
|
Revision: 45596
http://sourceforge.net/p/vice-emu/code/45596
Author: gpz
Date: 2025-03-28 17:47:13 +0000 (Fri, 28 Mar 2025)
Log Message:
-----------
first step of 3-way commit in order to rename the via functions, this one renames via2->via3 in code, and swaps via1<>via2 in comments
Modified Paths:
--------------
trunk/vice/src/vic20/vic20-snapshot.c
trunk/vice/src/vic20/vic20.c
trunk/vice/src/vic20/vic20.h
trunk/vice/src/vic20/vic20datasette.c
trunk/vice/src/vic20/vic20iec.c
trunk/vice/src/vic20/vic20rsuser.c
trunk/vice/src/vic20/vic20via.h
trunk/vice/src/vic20/vic20via1.c
trunk/vice/src/vic20/vic20via2.c
Modified: trunk/vice/src/vic20/vic20-snapshot.c
===================================================================
--- trunk/vice/src/vic20/vic20-snapshot.c 2025-03-27 19:02:17 UTC (rev 45595)
+++ trunk/vice/src/vic20/vic20-snapshot.c 2025-03-28 17:47:13 UTC (rev 45596)
@@ -80,7 +80,7 @@
|| vic20_snapshot_write_module(s, save_roms) < 0
|| vic_snapshot_write_module(s) < 0
|| viacore_snapshot_write_module(machine_context.via1, s) < 0
- || viacore_snapshot_write_module(machine_context.via2, s) < 0
+ || viacore_snapshot_write_module(machine_context.via3, s) < 0
|| drive_snapshot_write_module(s, save_disks, save_roms) < 0
|| fsdrive_snapshot_write_module(s) < 0
|| event_snapshot_write_module(s, event_mode) < 0
@@ -130,7 +130,7 @@
|| vic20_snapshot_read_module(s) < 0
|| vic_snapshot_read_module(s) < 0
|| viacore_snapshot_read_module(machine_context.via1, s) < 0
- || viacore_snapshot_read_module(machine_context.via2, s) < 0
+ || viacore_snapshot_read_module(machine_context.via3, s) < 0
|| drive_snapshot_read_module(s) < 0
|| fsdrive_snapshot_read_module(s) < 0
|| event_snapshot_read_module(s, event_mode) < 0
Modified: trunk/vice/src/vic20/vic20.c
===================================================================
--- trunk/vice/src/vic20/vic20.c 2025-03-27 19:02:17 UTC (rev 45595)
+++ trunk/vice/src/vic20/vic20.c 2025-03-28 17:47:13 UTC (rev 45596)
@@ -287,9 +287,9 @@
/* ------------------------------------------------------------------------ */
-static int via2_dump(void)
+static int via3_dump(void)
{
- return viacore_dump(machine_context.via2);
+ return viacore_dump(machine_context.via3);
}
static int via1_dump(void)
@@ -300,7 +300,7 @@
static void vic_via1_via2_store(uint16_t addr, uint8_t data)
{
if (addr & 0x10) {
- via2_store(addr, data);
+ via3_store(addr, data);
}
if (addr & 0x20) {
via1_store(addr, data);
@@ -313,7 +313,7 @@
uint8_t retval = vic_read(addr);
if (addr & 0x10) {
- retval &= via2_read(addr);
+ retval &= via3_read(addr);
}
if (addr & 0x20) {
@@ -328,7 +328,7 @@
uint8_t retval = vic_peek(addr);
if (addr & 0x10) {
- retval &= via2_peek(addr);
+ retval &= via3_peek(addr);
}
if (addr & 0x20) {
@@ -341,7 +341,7 @@
static void via1_via2_store(uint16_t addr, uint8_t data)
{
if (addr & 0x10) {
- via2_store(addr, data);
+ via3_store(addr, data);
}
if (addr & 0x20) {
via1_store(addr, data);
@@ -353,7 +353,7 @@
uint8_t retval = 0xff;
if (addr & 0x10) {
- retval &= via2_read(addr);
+ retval &= via3_read(addr);
}
if (addr & 0x20) {
@@ -368,7 +368,7 @@
uint8_t retval = 0xff;
if (addr & 0x10) {
- retval &= via2_peek(addr);
+ retval &= via3_peek(addr);
}
if (addr & 0x20) {
@@ -404,8 +404,8 @@
/* FIXME: the upper 4 bits of the mask are used to indicate the register size if not equal to the mask,
this is done as a temporary HACK to keep mirrors working and still get the correct register size,
this needs to be fixed properly after the 3.6 release */
-static io_source_t via2_device = {
- "VIA2", /* name of the chip */
+static io_source_t via3_device = {
+ "VIA3", /* name of the chip */
IO_DETACH_NEVER, /* chip is never involved in collisions, so no detach */
IO_DETACH_NO_RESOURCE, /* does not use a resource for detach */
#if 0
@@ -417,7 +417,7 @@
NULL, /* NO poke function */
via1_via2_read, /* read function */
via1_via2_peek, /* peek function */
- via2_dump, /* chip state information dump function */
+ via3_dump, /* chip state information dump function */
IO_CART_ID_NONE, /* not a cartridge */
IO_PRIO_HIGH, /* high priority, chip and mirrors never involved in collisions */
0, /* insertion order, gets filled in by the registration function */
@@ -449,13 +449,13 @@
static io_source_list_t *vic_list_item = NULL;
static io_source_list_t *via1_list_item = NULL;
-static io_source_list_t *via2_list_item = NULL;
+static io_source_list_t *via3_list_item = NULL;
static void vic20io0_init(void)
{
vic_list_item = io_source_register(&vic_device);
via1_list_item = io_source_register(&via1_device);
- via2_list_item = io_source_register(&via2_device);
+ via3_list_item = io_source_register(&via3_device);
}
/* ------------------------------------------------------------------------ */
@@ -893,7 +893,7 @@
void machine_setup_context(void)
{
vic20via1_setup_context(&machine_context);
- vic20via2_setup_context(&machine_context);
+ vic20via3_setup_context(&machine_context);
vic20ieeevia1_setup_context(&machine_context);
vic20ieeevia2_setup_context(&machine_context);
machine_printer_setup_context(&machine_context);
@@ -961,7 +961,7 @@
}
via1_init(machine_context.via1);
- via2_init(machine_context.via2);
+ via3_init(machine_context.via3);
ieeevia1_init(machine_context.ieeevia1);
ieeevia2_init(machine_context.ieeevia2);
@@ -1028,7 +1028,7 @@
#endif
/* Register joystick callback (for lightpen triggering via fire button) */
- joystick_register_machine(via2_check_lightpen);
+ joystick_register_machine(via3_check_lightpen);
#ifdef HAVE_MIDI
midi_init();
@@ -1047,7 +1047,7 @@
serial_traps_reset();
viacore_reset(machine_context.via1);
- viacore_reset(machine_context.via2);
+ viacore_reset(machine_context.via3);
vic_reset();
sid_reset();
@@ -1091,7 +1091,7 @@
cartridge_detach_image(-1);
viacore_shutdown(machine_context.via1);
- viacore_shutdown(machine_context.via2);
+ viacore_shutdown(machine_context.via3);
viacore_shutdown(machine_context.ieeevia1);
viacore_shutdown(machine_context.ieeevia2);
@@ -1121,7 +1121,7 @@
void machine_set_restore_key(int v)
{
- viacore_signal(machine_context.via2,
+ viacore_signal(machine_context.via3,
VIA_SIG_CA1, v ? VIA_SIG_FALL : VIA_SIG_RISE);
}
@@ -1285,7 +1285,7 @@
static void vic20_userport_set_flag(uint8_t b)
{
- viacore_signal(machine_context.via2, VIA_SIG_CB1, b ? VIA_SIG_RISE : VIA_SIG_FALL);
+ viacore_signal(machine_context.via3, VIA_SIG_CB1, b ? VIA_SIG_RISE : VIA_SIG_FALL);
}
static userport_port_props_t userport_props = {
Modified: trunk/vice/src/vic20/vic20.h
===================================================================
--- trunk/vice/src/vic20/vic20.h 2025-03-27 19:02:17 UTC (rev 45595)
+++ trunk/vice/src/vic20/vic20.h 2025-03-28 17:47:13 UTC (rev 45596)
@@ -79,7 +79,7 @@
typedef struct machine_context_s {
struct via_context_s *via1;
- struct via_context_s *via2;
+ struct via_context_s *via3;
struct via_context_s *ieeevia1;
struct via_context_s *ieeevia2;
struct printer_context_s *printer[3];
Modified: trunk/vice/src/vic20/vic20datasette.c
===================================================================
--- trunk/vice/src/vic20/vic20datasette.c 2025-03-27 19:02:17 UTC (rev 45595)
+++ trunk/vice/src/vic20/vic20datasette.c 2025-03-28 17:47:13 UTC (rev 45596)
@@ -44,7 +44,7 @@
void machine_set_tape_sense(int port, int sense)
{
if (port == TAPEPORT_PORT_1) {
- via2_set_tape_sense(sense);
+ via3_set_tape_sense(sense);
}
}
@@ -51,7 +51,7 @@
void machine_set_tape_write_in(int port, int val)
{
if (port == TAPEPORT_PORT_1) {
- via2_set_tape_write_in(val);
+ via3_set_tape_write_in(val);
}
}
@@ -58,6 +58,6 @@
void machine_set_tape_motor_in(int port, int val)
{
if (port == TAPEPORT_PORT_1) {
- via2_set_tape_motor_in(val);
+ via3_set_tape_motor_in(val);
}
}
Modified: trunk/vice/src/vic20/vic20iec.c
===================================================================
--- trunk/vice/src/vic20/vic20iec.c 2025-03-27 19:02:17 UTC (rev 45595)
+++ trunk/vice/src/vic20/vic20iec.c 2025-03-28 17:47:13 UTC (rev 45596)
@@ -129,16 +129,16 @@
/*
The VIC20 has a strange bus layout for the serial IEC bus.
- VIA1 CA2 CLK out
- VIA1 CB1 SRQ in
- VIA1 CB2 DATA out
- VIA2 PA0 CLK in
- VIA2 PA1 DATA in
- VIA2 PA7 ATN out
+ VIA1 PA0 CLK in
+ VIA1 PA1 DATA in
+ VIA1 PA7 ATN out
+ VIA2 CA2 CLK out
+ VIA2 CB1 SRQ in
+ VIA2 CB2 DATA out
*/
-/* These two routines are called for VIA2 Port A. */
+/* These two routines are called for VIA1 Port A. */
uint8_t iec_pa_read(void)
{
@@ -213,7 +213,7 @@
}
-/* This routine is called for VIA1 PCR (= CA2 and CB2).
+/* This routine is called for VIA2 PCR (= CA2 and CB2).
Although Cx2 uses three bits for control, we assume the calling routine has
set bit 5 and bit 1 to the real output value for CB2 (DATA out) and CA2
(CLK out) resp. (25apr1997 AF) */
Modified: trunk/vice/src/vic20/vic20rsuser.c
===================================================================
--- trunk/vice/src/vic20/vic20rsuser.c 2025-03-27 19:02:17 UTC (rev 45595)
+++ trunk/vice/src/vic20/vic20rsuser.c 2025-03-28 17:47:13 UTC (rev 45596)
@@ -46,8 +46,8 @@
static void vic20_trigger_start(void)
{
- viacore_signal(machine_context.via2, VIA_SIG_CB1, VIA_SIG_FALL);
- viacore_signal(machine_context.via2, VIA_SIG_CB1, VIA_SIG_RISE);
+ viacore_signal(machine_context.via3, VIA_SIG_CB1, VIA_SIG_FALL);
+ viacore_signal(machine_context.via3, VIA_SIG_CB1, VIA_SIG_RISE);
}
void vic20_rsuser_init(void)
Modified: trunk/vice/src/vic20/vic20via.h
===================================================================
--- trunk/vice/src/vic20/vic20via.h 2025-03-27 19:02:17 UTC (rev 45595)
+++ trunk/vice/src/vic20/vic20via.h 2025-03-28 17:47:13 UTC (rev 45596)
@@ -39,16 +39,16 @@
uint8_t via1_read(uint16_t addr);
uint8_t via1_peek(uint16_t addr);
-void vic20via2_setup_context(struct machine_context_s *machine_context);
-void via2_init(struct via_context_s *via_context);
-void via2_store(uint16_t addr, uint8_t byte);
-uint8_t via2_read(uint16_t addr);
-uint8_t via2_peek(uint16_t addr);
+void vic20via3_setup_context(struct machine_context_s *machine_context);
+void via3_init(struct via_context_s *via_context);
+void via3_store(uint16_t addr, uint8_t byte);
+uint8_t via3_read(uint16_t addr);
+uint8_t via3_peek(uint16_t addr);
-void via2_set_tape_sense(int v);
-void via2_set_tape_write_in(int v);
-void via2_set_tape_motor_in(int v);
-void via2_check_lightpen(void);
+void via3_set_tape_sense(int v);
+void via3_set_tape_write_in(int v);
+void via3_set_tape_motor_in(int v);
+void via3_check_lightpen(void);
extern int vic20_vflihack_userport;
Modified: trunk/vice/src/vic20/vic20via1.c
===================================================================
--- trunk/vice/src/vic20/vic20via1.c 2025-03-27 19:02:17 UTC (rev 45595)
+++ trunk/vice/src/vic20/vic20via1.c 2025-03-28 17:47:13 UTC (rev 45596)
@@ -1,5 +1,5 @@
/*
- * vic20via1.c - VIA1 emulation in the VIC20.
+ * vic20via1.c - VIA2 emulation in the VIC20.
*
* Written by
* Andre Fachat <fa...@ph...>
Modified: trunk/vice/src/vic20/vic20via2.c
===================================================================
--- trunk/vice/src/vic20/vic20via2.c 2025-03-27 19:02:17 UTC (rev 45595)
+++ trunk/vice/src/vic20/vic20via2.c 2025-03-28 17:47:13 UTC (rev 45596)
@@ -1,5 +1,5 @@
/*
- * vic20via2.c - VIA2 emulation in the VIC20.
+ * vic20via2.c - VIA1 emulation in the VIC20.
*
* Written by
* Andre Fachat <fa...@ph...>
@@ -59,19 +59,19 @@
store_userport_pbx(userport_pb, userport_pa6 ? USERPORT_NO_PULSE : USERPORT_PULSE);
}
-void via2_store(uint16_t addr, uint8_t data)
+void via3_store(uint16_t addr, uint8_t data)
{
- viacore_store(machine_context.via2, addr, data);
+ viacore_store(machine_context.via3, addr, data);
}
-uint8_t via2_read(uint16_t addr)
+uint8_t via3_read(uint16_t addr)
{
- return viacore_read(machine_context.via2, addr);
+ return viacore_read(machine_context.via3, addr);
}
-uint8_t via2_peek(uint16_t addr)
+uint8_t via3_peek(uint16_t addr)
{
- return viacore_peek(machine_context.via2, addr);
+ return viacore_peek(machine_context.via3, addr);
}
static void set_ca2(via_context_t *via_context, int state)
@@ -100,23 +100,23 @@
static int tape_write_in = 0;
static int tape_motor_in = 0;
-void via2_set_tape_sense(int v)
+void via3_set_tape_sense(int v)
{
tape_sense = v;
}
/* FIXME: find out how to set the write in and motor in lines */
-void via2_set_tape_write_in(int v)
+void via3_set_tape_write_in(int v)
{
tape_write_in = v;
}
-void via2_set_tape_motor_in(int v)
+void via3_set_tape_motor_in(int v)
{
tape_motor_in = v;
}
-static void via2_internal_lightpen_check(uint8_t pa)
+static void via3_internal_lightpen_check(uint8_t pa)
{
uint8_t b = read_joyport_dig(JOYPORT_1);
@@ -125,11 +125,11 @@
vic_set_light_pen(maincpu_clk, !(b & 0x20));
}
-void via2_check_lightpen(void)
+void via3_check_lightpen(void)
{
- uint8_t pa = machine_context.via2->via[VIA_PRA] | ~(machine_context.via2->via[VIA_DDRA]);
+ uint8_t pa = machine_context.via3->via[VIA_PRA] | ~(machine_context.via3->via[VIA_DDRA]);
- via2_internal_lightpen_check(pa);
+ via3_internal_lightpen_check(pa);
}
static void undump_pra(via_context_t *via_context, uint8_t byte)
@@ -142,7 +142,7 @@
{
uint8_t joy_bits = 0;
- via2_internal_lightpen_check(byte);
+ via3_internal_lightpen_check(byte);
iec_pa_write(byte);
joy_bits = ((byte & 0x20) >> 1) | ((byte & 0x1c) >> 2);
@@ -262,18 +262,18 @@
return byte;
}
-void via2_init(via_context_t *via_context)
+void via3_init(via_context_t *via_context)
{
- viacore_init(machine_context.via2, maincpu_alarm_context,
+ viacore_init(machine_context.via3, maincpu_alarm_context,
maincpu_int_status);
}
-void vic20via2_setup_context(machine_context_t *machinecontext)
+void vic20via3_setup_context(machine_context_t *machinecontext)
{
via_context_t *via;
- machinecontext->via2 = lib_malloc(sizeof(via_context_t));
- via = machinecontext->via2;
+ machinecontext->via3 = lib_malloc(sizeof(via_context_t));
+ via = machinecontext->via3;
via->prv = NULL;
via->context = NULL;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gp...@us...> - 2025-03-27 19:02:20
|
Revision: 45595
http://sourceforge.net/p/vice-emu/code/45595
Author: gpz
Date: 2025-03-27 19:02:17 +0000 (Thu, 27 Mar 2025)
Log Message:
-----------
plus4 and cbm2 keymap fixes
Modified Paths:
--------------
trunk/vice/data/CBM-II/Makefile.am
trunk/vice/data/CBM-II/sdl_pos.vkm
trunk/vice/data/CBM-II/sdl_sym.vkm
trunk/vice/data/PLUS4/gtk3_pos.vkm
trunk/vice/data/PLUS4/gtk3_pos_de.vkm
trunk/vice/data/PLUS4/gtk3_sym.vkm
trunk/vice/data/PLUS4/gtk3_sym_de.vkm
trunk/vice/data/PLUS4/sdl_pos.vkm
trunk/vice/data/PLUS4/sdl_sym.vkm
trunk/vice/data/PLUS4/sdl_sym_de.vkm
Added Paths:
-----------
trunk/vice/data/CBM-II/sdl_sym_de.vkm
Modified: trunk/vice/data/CBM-II/Makefile.am
===================================================================
--- trunk/vice/data/CBM-II/Makefile.am 2025-03-27 15:08:19 UTC (rev 45594)
+++ trunk/vice/data/CBM-II/Makefile.am 2025-03-27 19:02:17 UTC (rev 45595)
@@ -56,6 +56,7 @@
sdl_keymaps = \
sdl_sym.vkm \
+ sdl_sym_de.vkm \
sdl_pos.vkm
if USE_SDLUI
Modified: trunk/vice/data/CBM-II/sdl_pos.vkm
===================================================================
--- trunk/vice/data/CBM-II/sdl_pos.vkm 2025-03-27 15:08:19 UTC (rev 45594)
+++ trunk/vice/data/CBM-II/sdl_pos.vkm 2025-03-27 19:02:17 UTC (rev 45595)
@@ -178,7 +178,7 @@
91 1 4 8 /* [ -> [ */
93 2 3 8 /* ] -> ] */
13 2 5 8 /* Return -> pi */
-306 8 5 8 /* Left Ctrl -> CTRL */
+306 8 5 0x4008 /* Left Ctrl -> CTRL */
97 9 3 8 /* A -> A */
115 10 3 8 /* S -> S */
100 11 3 8 /* D -> D */
@@ -225,7 +225,7 @@
19 2 5 8 /* Pause/Break -> Pi */
280 5 0 8 /* PgUp -> Rev/Off */
279 5 1 8 /* End -> CE */
-305 3 4 8 /* Right Ctrl -> C= */
+305 3 4 0x2008 /* Right Ctrl -> C= */
271 7 4 8 /* Numpad Enter -> Numpad Enter */
267 7 1 8 /* Numpad / -> Numpad / */
263 4 2 8 /* Numpad 7 -> Numpad 7 */
Modified: trunk/vice/data/CBM-II/sdl_sym.vkm
===================================================================
--- trunk/vice/data/CBM-II/sdl_sym.vkm 2025-03-27 15:08:19 UTC (rev 45594)
+++ trunk/vice/data/CBM-II/sdl_sym.vkm 2025-03-27 19:02:17 UTC (rev 45595)
@@ -180,7 +180,7 @@
91 1 4 8 /* [ -> [ */
93 2 3 8 /* ] -> ] */
13 2 4 8 /* Return -> Return */
-306 8 5 8 /* Left Ctrl -> CTRL */
+306 8 5 0x4008 /* Left Ctrl -> CTRL */
97 9 3 8 /* A -> A */
115 10 3 8 /* S -> S */
100 11 3 8 /* D -> D */
@@ -203,9 +203,13 @@
109 14 4 8 /* M -> M */
44 15 4 8 /* , -> , */
46 15 5 8 /* . -> . */
-47 0 5 8 /* / -> / */
+
+47 0 5 0x28 /* / -> / */
+47 4 1 0x201 /* ctrl / -> / */
+
303 8 4 4 /* Right Shift -> Shift */
32 14 5 8 /* Space -> Space */
+
282 8 0 8 /* F1 -> F1 */
283 9 0 8 /* F2 -> F2 */
284 10 0 8 /* F3 -> F3 */
@@ -216,20 +220,27 @@
289 15 0 8 /* F8 -> F8 */
290 0 0 8 /* F9 -> F9 */
291 1 0 8 /* F10 -> F10 */
-278 4 0 8 /* Home -> CLR/HOME */
+292 2 5 8 /* F11 -> pi */
+#293 1 0 8 /* F12 -> run/stop */
+
+
273 3 0 8 /* Up -> CRSR UP */
276 3 1 8 /* Left -> CRSR LEFT */
275 3 2 8 /* Right -> CRSR RIGHT */
274 2 0 8 /* Down -> CRSR DOWN */
-277 2 2 8 /* Ins -> Pound */
-127 4 1 8 /* Del -> ? */
+
+277 6 5 8 /* Ins -> KP 00 */
+127 5 1 8 /* Del -> KP CE */
+278 4 0 8 /* Home -> CLR/HOME */
+279 5 0 8 /* End -> Rev/Off */
+280 7 0 8 /* PgUp -> Run/Stop */
281 6 0 8 /* PgDown -> Norm/Graph */
-19 2 5 8 /* Pause/Break -> Pi */
-280 5 0 8 /* PgUp -> Rev/Off */
-279 5 1 8 /* End -> CE */
-305 3 4 8 /* Right Ctrl -> C= */
+
+305 3 4 0x2008 /* Right Ctrl -> C= */
+
271 7 4 8 /* Numpad Enter -> Numpad Enter */
267 7 1 8 /* Numpad / -> Numpad / */
+268 6 1 8 /* Numpad * -> Numpad * */
263 4 2 8 /* Numpad 7 -> Numpad 7 */
264 5 2 8 /* Numpad 8 -> Numpad 8 */
265 6 2 8 /* Numpad 9 -> Numpad 9 */
Added: trunk/vice/data/CBM-II/sdl_sym_de.vkm
===================================================================
--- trunk/vice/data/CBM-II/sdl_sym_de.vkm (rev 0)
+++ trunk/vice/data/CBM-II/sdl_sym_de.vkm 2025-03-27 19:02:17 UTC (rev 45595)
@@ -0,0 +1,288 @@
+# VICE keyboard mapping file
+#
+# A Keyboard map is read in as patch to the current map.
+#
+# File format:
+# - comment lines start with '#'
+# - keyword lines start with '!keyword'
+# - normal lines have 'keysym/scancode row column shiftflag'
+#
+# Keywords and their lines are:
+# '!CLEAR' clear whole table
+# '!INCLUDE filename' read file as mapping file
+# '!LSHIFT row col' left shift keyboard row/column
+# '!RSHIFT row col' right shift keyboard row/column
+# '!VSHIFT shiftkey' virtual shift key (RSHIFT or LSHIFT)
+# '!SHIFTL shiftkey' shift lock key (RSHIFT or LSHIFT)
+# for emulated keyboards that have only one shift key, set both LSHIFT
+# and RSHIFT to the same row/col and use RSHIFT for VSHIFT and SHIFTL.
+# '!LCTRL row col' left control keyboard row/column
+# '!VCTRL ctrlkey' virtual control key (LCTRL)
+# '!LCBM row col' left CBM keyboard row/column
+# '!VCBM cbmkey' virtual CBM key (LCBM)
+# '!UNDEF keysym' remove keysym from table
+#
+# Shiftflag can have these values, flags can be ORed to combine them:
+# 0x0000 0 key is not shifted for this keysym/scancode
+# 0x0001 1 key is combined with shift for this keysym/scancode
+# 0x0002 2 key is left shift on emulated machine
+# 0x0004 4 key is right shift on emulated machine (use only this one
+# for emulated keyboards that have only one shift key)
+# 0x0008 8 key can be shifted or not with this keysym/scancode
+# 0x0010 16 deshift key for this keysym/scancode
+# 0x0020 32 another definition for this keysym/scancode follows
+# 0x0040 64 key is shift-lock on emulated machine
+# 0x0080 128 shift modifier required on host
+# 0x0100 256 key is used for an alternative keyboard mapping, e.g. C64 mode in x128
+# 0x0200 512 alt-r (alt-gr) modifier required on host
+# 0x0400 1024 ctrl modifier required on host
+# 0x0800 2048 key is combined with cbm for this keysym/scancode
+# 0x1000 4096 key is combined with ctrl for this keysym/scancode
+# 0x2000 8192 key is (left) cbm on emulated machine
+# 0x4000 16384 key is (left) ctrl on emulated machine
+#
+# Negative row values:
+# 'keysym -1 n' joystick keymap A, direction n
+# 'keysym -2 n' joystick keymap B, direction n
+# 'keysym -3 0' first RESTORE key
+# 'keysym -3 1' second RESTORE key
+# 'keysym -4 0' 40/80 column key (x128)
+# 'keysym -4 1' CAPS (ASCII/DIN) key (x128)
+# 'keysym -5 n' joyport keypad, key n (not supported in x128)
+#
+# Joystick direction values:
+# 0 Fire
+# 1 South/West
+# 2 South
+# 3 South/East
+# 4 West
+# 5 East
+# 6 North/West
+# 7 North
+# 8 North/East
+#
+# Joyport keypad key layout:
+# --------------------------
+# | 0 | 1 | 2 | 3 | 4 |
+# --------------------------
+# | 5 | 6 | 7 | 8 | 9 |
+# --------------------------
+# | 10 | 11 | 12 | 13 | 14 |
+# --------------------------
+# | 15 | 16 | 17 | 18 | 19 |
+# --------------------------
+#
+# When a bigger spaced key is used,
+# it uses the upper left most key value.
+
+# Symbolic Mapping, DE Layout, CBM2, SDL
+
+# note: For some reason SDL does not get keyboard events for "dead keys" at all,
+# so a "nodeadkeys" layout must be used. CAUTION: apparently SDL generates
+# some tables internally at startup - switching the host layout while
+# the emulator is running produces unpredictable results (broken keycodes)
+
+# Commodore cbm2 keyboard matrix:
+#
+# references:
+# http://www.zimmers.net/anonftp/pub/cbm/b/documents/de/keyboard-matrix.gif
+# http://www.zimmers.net/anonftp/pub/cbm/b/documents/keymap-us.gif
+# http://www.zimmers.net/anonftp/pub/cbm/schematics/computers/b/p500-keyboard.txt
+# http://www.floodgap.com/retrobits/ckb/secret/cbm-610-keyboard.jpg
+#
+# Keys starting with 'KP' are on the number pad. Both shifts and shift lock
+# are in parallel at one point in matrix.
+#
+# 0 1 2 3 4 5
+# +--------+--------+--------+--------+--------+--------+
+# 0 | F9 | 9 ( | O | L | ; : | / ? |
+# +--------+--------+--------+--------+--------+--------+
+# 1 | F10 | 0 ) | - | P | [ | ' " |
+# +--------+--------+--------+--------+--------+--------+
+# 2 | c.down | = + |<- pound| ] | return | pi |
+# +--------+--------+--------+--------+--------+--------+
+# 3 | c.up | c.left | c.right|del ins | CBM |########|
+# +--------+--------+--------+--------+--------+--------+
+# 4 |home/clr|KP ? |KP 7 |KP 4 |KP 1 |KP 0 |
+# +--------+--------+--------+--------+--------+--------+
+# 5 |rvs/off |KP CE |KP 8 |KP 5 |KP 2 |KP . |
+# +--------+--------+--------+--------+--------+--------+
+# 6 | graph |KP * |KP 9 |KP 6 |KP 3 |KP 00 |
+# +--------+--------+--------+--------+--------+--------+
+# 7 |run/stop|KP / |KP - |KP + |KP enter|########|
+# +--------+--------+--------+--------+--------+--------+
+# 8 | F1 | escape | TAB |########| Shift | CTRL |
+# +--------+--------+--------+--------+--------+--------+
+# 9 | F2 | 1 ! | Q | A | Z |########|
+# +--------+--------+--------+--------+--------+--------+
+#10 | F3 | 2 @ | W | S | X | C |
+# +--------+--------+--------+--------+--------+--------+
+#11 | F4 | 3 # | E | D | F | V |
+# +--------+--------+--------+--------+--------+--------+
+#12 | F5 | 4 $ | R | T | G | B |
+# +--------+--------+--------+--------+--------+--------+
+#13 | F6 | 5 % | 6 ^ | Y | H | N |
+# +--------+--------+--------+--------+--------+--------+
+#14 | F7 | 7 & | U | J | M | space |
+# +--------+--------+--------+--------+--------+--------+
+#15 | F8 | 8 * | I | K | , < | . > |
+# +--------+--------+--------+--------+--------+--------+
+
+# CBM2 Keyboard layout:
+#
+# F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 down up left right clr rvs graph r/s
+#
+# ESC 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) - =+ arrow/pound del ? CE * /
+# TAB q w e r t y u i o p [ ] return 7 8 9 -
+# SL a s d f g h j k l ;: '" pi 4 5 6 +
+# LS z x c v b n m ,< .> /? RS CBM 1 2 3
+# CTRL SPACE 0 . 00 enter
+
+!CLEAR
+!LSHIFT 8 4
+!RSHIFT 8 4
+!VSHIFT RSHIFT
+!SHIFTL RSHIFT
+!LCBM 3 4
+!VCBM LCBM
+!LCTRL 8 5
+!VCTRL LCTRL
+
+27 8 1 8 /* ESC -> ESC */
+
+49 9 1 8 /* 1 -> 1 */
+50 10 1 0x20 /* 2 -> 2 */
+50 1 5 0x80 /* shift 2 -> " */
+51 11 1 8 /* 3 -> 3 */
+52 12 1 8 /* 4 -> 4 */
+53 13 1 8 /* 5 -> 5 */
+54 13 2 0x20 /* 6 -> 6 */
+54 14 1 0x81 /* shift 6 -> & shift+7 */
+55 14 1 0x20 /* 7 -> 7 */
+55 0 5 0x90 /* shift 7 -> / */
+56 15 1 0x20 /* 8 -> 8 */
+56 0 1 0x80 /* shift 8 -> ( shift+9 */
+57 0 1 0x20 /* 9 -> 9 */
+57 1 1 0x80 /* shift 9 -> ) shift+0 */
+48 1 1 0x20 /* 0 -> 0 */
+48 2 1 0x90 /* shift 0 -> = */
+
+223 4 1 0x00b0 /* shift ? -> ? */
+223 4 1 0x0201 /* ctrl ? -> ctrl+ */
+
+180 2 2 8 /* ´ ` -> pound */
+
+45 1 2 0x20 /* Minus -> Minus */
+45 2 2 0x90 /* shift+Minus -> left arrow */
+
+306 8 5 0x4008 /* Left Ctrl -> CTRL */
+305 3 4 0x2008 /* Right Ctrl -> CBM */
+
+304 8 4 4 /* Left Shift -> Shift */
+301 8 4 64 /* Caps Lock -> Shift Lock */
+303 8 4 4 /* Right Shift -> Shift */
+
+32 14 5 8 /* Space -> Space */
+8 3 3 8 /* Backspace -> Del */
+9 8 2 8 /* TAB -> TAB */
+13 2 4 8 /* Return -> Return */
+
+44 15 4 0x20 /* , -> , */
+44 0 4 0x90 /* shift , -> ; */
+
+46 15 5 0x20 /* . -> . */
+46 0 4 0x420 /* ctrl . -> . */
+46 0 4 0x80 /* shift . -> : */
+
+#47 0 5 8 /* / -> / */
+
+60 15 4 0x021 /* < -> ,+shift */
+60 15 5 0x080 /* shift > -> .+shift */
+
+43 2 1 0x21 /* + -> Plus */
+43 15 1 0x80 /* shift++ -> * */
+
+252 10 1 1 /* ue -> @ */
+246 1 4 8 /* oe -> [ */
+228 2 3 8 /* ae -> ] */
+
+35 11 1 33 /* # -> 3+shift */
+35 1 5 0x420 /* ctrl # -> '+ctrl */
+35 1 5 0x90 /* ' -> 7+shift */
+
+94 13 2 0x021 /* ^ -> shift+6 (arrow up) */
+94 2 5 0x420 /* ctrl ^ -> pi */
+94 2 5 0x8b0 /* shift ^ -> pi */
+
+113 9 2 0x28 /* Q -> Q */
+113 10 1 0x201 /* altgr Q -> @ */
+
+119 10 2 8 /* W -> W */
+101 11 2 8 /* E -> E */
+114 12 2 8 /* R -> R */
+116 12 3 8 /* T -> T */
+121 13 3 8 /* Y -> Y */
+117 14 2 8 /* U -> U */
+105 15 2 8 /* I -> I */
+111 0 2 8 /* O -> O */
+112 1 3 8 /* P -> P */
+97 9 3 8 /* A -> A */
+115 10 3 8 /* S -> S */
+100 11 3 8 /* D -> D */
+102 11 4 8 /* F -> F */
+103 12 4 8 /* G -> G */
+104 13 4 8 /* H -> H */
+106 14 3 8 /* J -> J */
+107 15 3 8 /* K -> K */
+108 0 3 8 /* L -> L */
+122 9 4 8 /* Z -> Z */
+120 10 4 8 /* X -> X */
+99 10 5 8 /* C -> C */
+118 11 5 8 /* V -> V */
+98 12 5 8 /* B -> B */
+110 13 5 8 /* N -> N */
+109 14 4 8 /* M -> M */
+
+
+282 8 0 8 /* F1 -> F1 */
+283 9 0 8 /* F2 -> F2 */
+284 10 0 8 /* F3 -> F3 */
+285 11 0 8 /* F4 -> F4 */
+286 12 0 8 /* F5 -> F5 */
+287 13 0 8 /* F6 -> F6 */
+288 14 0 8 /* F7 -> F7 */
+289 15 0 8 /* F8 -> F8 */
+290 0 0 8 /* F9 -> F9 */
+291 1 0 8 /* F10 -> F10 */
+
+#292 1 0 8 /* F11 -> (unused) */
+#293 1 0 8 /* F12 -> run/stop */
+
+273 3 0 8 /* Up -> CRSR UP */
+276 3 1 8 /* Left -> CRSR LEFT */
+275 3 2 8 /* Right -> CRSR RIGHT */
+274 2 0 8 /* Down -> CRSR DOWN */
+
+277 6 5 8 /* Ins -> KP 00 */
+127 5 1 8 /* Del -> KP CE */
+278 4 0 8 /* Home -> CLR/HOME */
+279 5 0 8 /* End -> Rev/Off */
+280 7 0 8 /* PgUp -> Run/Stop */
+281 6 0 8 /* PgDown -> Norm/Graph */
+
+271 7 4 8 /* Numpad Enter -> Numpad Enter */
+267 7 1 8 /* Numpad / -> Numpad / */
+268 6 1 8 /* Numpad * -> Numpad * */
+263 4 2 8 /* Numpad 7 -> Numpad 7 */
+264 5 2 8 /* Numpad 8 -> Numpad 8 */
+265 6 2 8 /* Numpad 9 -> Numpad 9 */
+269 7 2 8 /* Numpad - -> Numpad - */
+260 4 3 8 /* Numpad 4 -> Numpad 4 */
+261 5 3 8 /* Numpad 5 -> Numpad 5 */
+262 6 3 8 /* Numpad 6 -> Numpad 6 */
+270 7 3 8 /* Numpad + -> Numpad + */
+257 4 4 8 /* Numpad 1 -> Numpad 1 */
+258 5 4 8 /* Numpad 2 -> Numpad 2 */
+259 6 4 8 /* Numpad 3 -> Numpad 3 */
+256 4 5 8 /* Numpad 0 -> Numpad 0 */
+266 5 5 8 /* Numpad . -> Numpad . */
Modified: trunk/vice/data/PLUS4/gtk3_pos.vkm
===================================================================
--- trunk/vice/data/PLUS4/gtk3_pos.vkm 2025-03-27 15:08:19 UTC (rev 45594)
+++ trunk/vice/data/PLUS4/gtk3_pos.vkm 2025-03-27 19:02:17 UTC (rev 45595)
@@ -93,7 +93,7 @@
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 5 |DOWN |P |L |UP |. > |: [ |- |, < |
# +--------+--------+--------+--------+--------+--------+--------+--------+
-# 6 |LEFT |* |; ] |RIGHT |ESC |= |+ |/ ? |
+# 6 |LEFT |* |; ] |RIGHT |ESC |= <- pi |+ |/ ? |
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 7 |1 ! |CLR/HOME| CTRLs |2 " |SPACE |CBM |Q |RUN/STOP|
# +--------+--------+--------+--------+--------+--------+--------+--------+
@@ -338,5 +338,7 @@
Print -5 15
KP_0 -5 16
KP_Delete -5 17
+KP_Decimal -5 17
+KP_Separator -5 17
KP_Enter -5 18
KP_Add -5 19
Modified: trunk/vice/data/PLUS4/gtk3_pos_de.vkm
===================================================================
--- trunk/vice/data/PLUS4/gtk3_pos_de.vkm 2025-03-27 15:08:19 UTC (rev 45594)
+++ trunk/vice/data/PLUS4/gtk3_pos_de.vkm 2025-03-27 19:02:17 UTC (rev 45595)
@@ -93,7 +93,7 @@
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 5 |DOWN |P |L |UP |. > |: [ |- |, < |
# +--------+--------+--------+--------+--------+--------+--------+--------+
-# 6 |LEFT |* |; ] |RIGHT |ESC |= |+ |/ ? |
+# 6 |LEFT |* |; ] |RIGHT |ESC |= <- pi |+ |/ ? |
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 7 |1 ! |CLR/HOME| CTRLs |2 " |SPACE |CBM |Q |RUN/STOP|
# +--------+--------+--------+--------+--------+--------+--------+--------+
@@ -344,5 +344,6 @@
KP_0 -5 16
KP_Delete -5 17
KP_Decimal -5 17
+KP_Separator -5 17
KP_Enter -5 18
KP_Add -5 19
Modified: trunk/vice/data/PLUS4/gtk3_sym.vkm
===================================================================
--- trunk/vice/data/PLUS4/gtk3_sym.vkm 2025-03-27 15:08:19 UTC (rev 45594)
+++ trunk/vice/data/PLUS4/gtk3_sym.vkm 2025-03-27 19:02:17 UTC (rev 45595)
@@ -93,7 +93,7 @@
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 5 |DOWN |P |L |UP |. > |: [ |- |, < |
# +--------+--------+--------+--------+--------+--------+--------+--------+
-# 6 |LEFT |* |; ] |RIGHT |ESC |= |+ |/ ? |
+# 6 |LEFT |* |; ] |RIGHT |ESC |= <- pi |+ |/ ? |
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 7 |1 ! |CLR/HOME| CTRLs |2 " |SPACE |CBM |Q |RUN/STOP|
# +--------+--------+--------+--------+--------+--------+--------+--------+
@@ -204,8 +204,8 @@
at 0 7 16
# \ = Pound Sterling
backslash 0 2 8
-# | = Shift-minus
-bar 5 6 1
+# | = Shift-Pound
+bar 0 2 1
# { -> CBM-W graphic
braceleft 1 1 2064
@@ -350,5 +350,7 @@
Print -5 15
KP_0 -5 16
KP_Delete -5 17
+KP_Decimal -5 17
+KP_Separator -5 17
KP_Enter -5 18
KP_Add -5 19
Modified: trunk/vice/data/PLUS4/gtk3_sym_de.vkm
===================================================================
--- trunk/vice/data/PLUS4/gtk3_sym_de.vkm 2025-03-27 15:08:19 UTC (rev 45594)
+++ trunk/vice/data/PLUS4/gtk3_sym_de.vkm 2025-03-27 19:02:17 UTC (rev 45595)
@@ -93,7 +93,7 @@
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 5 |DOWN |P |L |UP |. > |: [ |- |, < |
# +--------+--------+--------+--------+--------+--------+--------+--------+
-# 6 |LEFT |* |; ] |RIGHT |ESC |= |+ |/ ? |
+# 6 |LEFT |* |; ] |RIGHT |ESC |= <- pi |+ |/ ? |
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 7 |1 ! |CLR-HOME|CTRL |2 " |SPACE |CBM |Q |RUN-STOP|
# +--------+--------+--------+--------+--------+--------+--------+--------+
@@ -322,5 +322,6 @@
KP_0 -5 16
KP_Delete -5 17
KP_Decimal -5 17
+KP_Separator -5 17
KP_Enter -5 18
KP_Add -5 19
Modified: trunk/vice/data/PLUS4/sdl_pos.vkm
===================================================================
--- trunk/vice/data/PLUS4/sdl_pos.vkm 2025-03-27 15:08:19 UTC (rev 45594)
+++ trunk/vice/data/PLUS4/sdl_pos.vkm 2025-03-27 19:02:17 UTC (rev 45595)
@@ -98,7 +98,7 @@
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 5 |DOWN |P |L |UP |. > |: [ |- |, < |
# +--------+--------+--------+--------+--------+--------+--------+--------+
-# 6 |LEFT |* |; ] |RIGHT |ESC |= |+ |/ ? |
+# 6 |LEFT |* |; ] |RIGHT |ESC |= <- pi |+ |/ ? |
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 7 |1 ! |CLR/HOME| CTRLs |2 " |SPACE |CBM |Q |RUN/STOP|
# +--------+--------+--------+--------+--------+--------+--------+--------+
@@ -196,14 +196,20 @@
287 0 6 1 /* F6 -> F6 */
288 0 3 1 /* F7 -> F7 */
289 0 3 8 /* F8 -> HELP */
+
278 7 1 8 /* Home -> CLR/HOME */
273 5 3 8 /* Up -> CRSR UP */
276 6 0 8 /* Left -> CRSR LEFT */
275 6 3 8 /* Right -> CRSR RIGHT */
274 5 0 8 /* Down -> CRSR DOWN */
+
277 6 5 8 /* Ins -> = */
127 6 1 8 /* Del -> * */
+# Restore key mappings
+#280 -3 0 /* Page Up -> RESTORE */
+280 6 4 8 /* Page Up -> Escape */
+
# Joyport-attached keypad key mappings
300 -5 0 /* NumLock -> keypad x0 */
263 -5 1 /* NumPad 7 -> keypad 7 */
Modified: trunk/vice/data/PLUS4/sdl_sym.vkm
===================================================================
--- trunk/vice/data/PLUS4/sdl_sym.vkm 2025-03-27 15:08:19 UTC (rev 45594)
+++ trunk/vice/data/PLUS4/sdl_sym.vkm 2025-03-27 19:02:17 UTC (rev 45595)
@@ -98,7 +98,7 @@
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 5 |DOWN |P |L |UP |. > |: [ |- |, < |
# +--------+--------+--------+--------+--------+--------+--------+--------+
-# 6 |LEFT |* |; ] |RIGHT |ESC |= |+ |/ ? |
+# 6 |LEFT |* |; ] |RIGHT |ESC |= <- pi |+ |/ ? |
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 7 |1 ! |CLR/HOME| CTRLs |2 " |SPACE |CBM |Q |RUN/STOP|
# +--------+--------+--------+--------+--------+--------+--------+--------+
@@ -133,6 +133,10 @@
!VCTRL LCTRL
27 7 7 8 /* ESC -> Run/Stop */
+
+96 3 0 0x21 /* ` -> shift+7 */
+96 6 5 0x81 /* shift ` -> arrow left */
+
49 7 0 8 /* 1 -> 1 */
50 7 3 32 /* 2 -> 2 */
50 0 7 0x90 /* @ -> @ */
@@ -154,6 +158,7 @@
61 6 5 32 /* Equal -> Equal */
61 6 6 0x90 /* + -> + */
8 0 0 8 /* Backspace -> Del */
+
9 7 5 8200 /* TAB -> CBM */
113 7 6 8 /* Q -> Q */
119 1 1 8 /* W -> W */
@@ -168,6 +173,7 @@
91 5 5 1 /* [ -> [ */
93 6 2 1 /* ] -> ] */
13 0 1 8 /* Return -> Return */
+
306 7 2 16392 /* Left Ctrl -> CTRL */
97 1 2 8 /* A -> A */
115 1 5 8 /* S -> S */
@@ -182,8 +188,8 @@
59 5 5 0x90 /* : -> : */
39 3 0 33 /* ' -> ' */
39 7 3 0x80 /* " -> " */
-96 6 4 8 /* ` -> Esc */
-92 6 1 8 /* \ -> * */
+
+92 0 2 8 /* \ -> pound */
301 1 7 64 /* Caps Lock -> Shift Lock */
304 1 7 4 /* Left Shift -> Left Shift */
122 1 4 8 /* Z -> Z */
@@ -206,14 +212,24 @@
287 0 6 1 /* F6 -> F6 */
288 0 3 1 /* F7 -> F7 */
289 0 3 8 /* F8 -> HELP */
-278 7 1 8 /* Home -> CLR/HOME */
+
273 5 3 8 /* Up -> CRSR UP */
276 6 0 8 /* Left -> CRSR LEFT */
275 6 3 8 /* Right -> CRSR RIGHT */
274 5 0 8 /* Down -> CRSR DOWN */
-277 6 5 8 /* Ins -> = */
-127 6 1 8 /* Del -> * */
+277 0 0 1 /* Ins -> Insert */
+127 0 0 8 /* Del -> Delete */
+278 7 1 8 /* Home -> CLR/HOME */
+279 6 5 1 /* End -> arrow left */
+
+281 6 5 0x820 /* page down -> pi */
+281 4 3 0x81 /* shift page down -> arrow up */
+
+# Restore key mappings
+#280 -3 0 /* Page Up -> RESTORE */
+280 6 4 8 /* Page Up -> Escape */
+
# Joyport-attached keypad key mappings
300 -5 0 /* NumLock -> keypad x0 */
263 -5 1 /* NumPad 7 -> keypad 7 */
Modified: trunk/vice/data/PLUS4/sdl_sym_de.vkm
===================================================================
--- trunk/vice/data/PLUS4/sdl_sym_de.vkm 2025-03-27 15:08:19 UTC (rev 45594)
+++ trunk/vice/data/PLUS4/sdl_sym_de.vkm 2025-03-27 19:02:17 UTC (rev 45595)
@@ -98,7 +98,7 @@
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 5 |DOWN |P |L |UP |. > |: [ |- |, < |
# +--------+--------+--------+--------+--------+--------+--------+--------+
-# 6 |LEFT |* |; ] |RIGHT |ESC |= |+ |/ ? |
+# 6 |LEFT |* |; ] |RIGHT |ESC |= <- pi |+ |/ ? |
# +--------+--------+--------+--------+--------+--------+--------+--------+
# 7 |1 ! |CLR/HOME| CTRLs |2 " |SPACE |CBM |Q |RUN/STOP|
# +--------+--------+--------+--------+--------+--------+--------+--------+
@@ -142,8 +142,11 @@
286 0 5 1 /* F5 -> F5 */
284 0 6 8 /* F3 -> F3 */
287 0 6 1 /* F6 -> F6 */
+
113 7 6 40 /* Q -> Q */
113 0 7 512 /* altgr + q -> @ */
+109 4 4 0x0028 /* M -> M */
+109 6 5 0x0a00 /* altgr + M -> pi */
301 1 7 64 /* Caps Lock -> Shift Lock */
304 1 7 4 /* Left Shift -> Left Shift */
@@ -152,11 +155,10 @@
27 7 7 8 /* ESC -> Run/Stop */
9 7 5 8200 /* TAB -> CBM */
+252 0 7 8 /* ue -> @ */
+246 5 5 8 /* oe -> [ */
+228 6 2 8 /* ae -> ] */
-252 0 7 8 /* (de) ue -> @ */
-246 5 5 8 /* (de) oe -> [ */
-228 6 2 8 /* (de) ae -> ] */
-
274 5 0 8 /* Down -> CRSR DOWN */
273 5 3 8 /* Up -> CRSR UP */
276 6 0 8 /* Left -> CRSR LEFT */
@@ -164,9 +166,13 @@
46 5 4 32 /* . -> . */
46 5 5 144 /* shift+. -> : */
-60 5 7 33 /* < -> ,+shift */
-60 5 4 128 /* > -> .+shift */
+60 5 7 0x021 /* < -> ,+shift */
+60 5 4 0x0a0 /* > -> .+shift */
+60 0 2 0x210 /* altgr + < -> pound */
+
+180 0 2 8 /* ´ ` -> pound */
+
43 6 6 32 /* + -> Plus */
43 6 1 144 /* shift++ -> * */
@@ -177,9 +183,15 @@
45 6 5 128 /* shift+- -> shift+= */
96 6 4 8 /* ` -> Esc */
-223 6 7 1 /* ? -> ? */
+223 6 5 0x0021 /* ß -> arrow left */
+223 6 7 0x00a0 /* shift ? -> ? */
+223 6 5 0x0a00 /* altgr \ -> pi */
278 7 1 8 /* Home -> CLR/HOME */
+279 6 5 1 /* End -> arrow left */
+277 0 0 1 /* Ins -> Insert */
+127 0 0 8 /* Del -> Delete */
+
32 7 4 8 /* Space -> Space */
35 1 0 33 /* # -> 3+shift */
@@ -211,8 +223,10 @@
48 4 3 32 /* 0 -> 0 */
# 128+16 shifted on host, deshifted on C16
48 6 5 144 /* = -> = */
-94 4 3 1 /* ^ -> shift+0 (arrow up) */
+94 4 3 0x021 /* ^ -> shift+0 (arrow up) */
+94 6 5 0x890 /* shift ^ -> pi */
+
97 1 2 8 /* A -> A */
98 3 4 8 /* B -> B */
99 2 4 8 /* C -> C */
@@ -225,7 +239,7 @@
106 4 2 8 /* J -> J */
107 4 5 8 /* K -> K */
108 5 2 8 /* L -> L */
-109 4 4 8 /* M -> M */
+#109 4 4 8 /* M -> M */
110 4 7 8 /* N -> N */
111 4 6 8 /* O -> O */
112 5 1 8 /* P -> P */
@@ -241,7 +255,8 @@
122 1 4 8 /* Z -> Z */
# Restore key mappings
-280 -3 0 /* Page Up -> RESTORE */
+#280 -3 0 /* Page Up -> RESTORE */
+280 6 4 8 /* Page Up -> Escape */
# Joyport-attached keypad key mappings
300 -5 0 /* NumLock -> keypad x0 */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-03-27 15:08:21
|
Revision: 45594
http://sourceforge.net/p/vice-emu/code/45594
Author: compyx
Date: 2025-03-27 15:08:19 +0000 (Thu, 27 Mar 2025)
Log Message:
-----------
Joystick: fix headless build
Modified Paths:
--------------
branches/compyx/joymap-001/vice/src/joyport/joystick.c
branches/compyx/joymap-001/vice/src/machine.c
Modified: branches/compyx/joymap-001/vice/src/joyport/joystick.c
===================================================================
--- branches/compyx/joymap-001/vice/src/joyport/joystick.c 2025-03-27 14:01:49 UTC (rev 45593)
+++ branches/compyx/joymap-001/vice/src/joyport/joystick.c 2025-03-27 15:08:19 UTC (rev 45594)
@@ -2724,21 +2724,7 @@
#endif
/* Initialize arch-specific driver: registers driver and devices */
-#if 0
-#if defined(LINUX_JOYSTICK) && !defined(HAVE_LINUX_EVDEV)
- linux_joystick_init();
-#elif defined(HAVE_LINUX_EVDEV)
- linux_joystick_evdev_init();
-#elif defined HAS_USB_JOYSTICK
- bsd_joystick_init();
-#elif defined MAC_JOYSTICK
- joy_hidlib_init();
-#elif defined HAVE_DINPUT
- win32_joystick_init();
-#elif defined HAVE_SDL_NUMJOYSTICKS
- joy_sdl_init();
-#endif
-#else
+#if !defined(USE_HEADLESSUI)
joystick_arch_init();
#endif
Modified: branches/compyx/joymap-001/vice/src/machine.c
===================================================================
--- branches/compyx/joymap-001/vice/src/machine.c 2025-03-27 14:01:49 UTC (rev 45593)
+++ branches/compyx/joymap-001/vice/src/machine.c 2025-03-27 15:08:19 UTC (rev 45594)
@@ -378,8 +378,9 @@
#ifdef MAC_JOYSTICK
joy_hidlib_exit();
#endif
+#if !defined(USE_HEADLESSUI)
joystick_arch_shutdown();
-
+#endif
sound_close();
printer_shutdown();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-03-27 14:02:01
|
Revision: 45593
http://sourceforge.net/p/vice-emu/code/45593
Author: compyx
Date: 2025-03-27 14:01:49 +0000 (Thu, 27 Mar 2025)
Log Message:
-----------
Merge trunk (r45582:HEAD) into branch
Modified Paths:
--------------
branches/compyx/joymap-001/vice/src/arch/gtk3/linenoise.c
branches/compyx/joymap-001/vice/src/monitor/monitor_binary.c
Modified: branches/compyx/joymap-001/vice/src/arch/gtk3/linenoise.c
===================================================================
--- branches/compyx/joymap-001/vice/src/arch/gtk3/linenoise.c 2025-03-27 13:59:36 UTC (rev 45592)
+++ branches/compyx/joymap-001/vice/src/arch/gtk3/linenoise.c 2025-03-27 14:01:49 UTC (rev 45593)
@@ -5,9 +5,14 @@
*
* Modified for the VICE project by Fabrizio Gennari,
* for use in combination with a terminal
- * not represented by a couple of file descrptors
+ * not represented by a couple of file descriptors
* (abstracted buy the opaque struct console_private_s)
*
+ * NOTE: Due to the above, it is not possible to share this modified library
+ * with anything else. Also due to how the GTK monitor works, we can not replace
+ * this modified library by a standard linenoise (or -ng), which works on top
+ * of file descriptors.
+ *
* You can find the latest source code at:
*
* http://github.com/antirez/linenoise
Modified: branches/compyx/joymap-001/vice/src/monitor/monitor_binary.c
===================================================================
--- branches/compyx/joymap-001/vice/src/monitor/monitor_binary.c 2025-03-27 13:59:36 UTC (rev 45592)
+++ branches/compyx/joymap-001/vice/src/monitor/monitor_binary.c 2025-03-27 14:01:49 UTC (rev 45593)
@@ -1455,7 +1455,7 @@
unsigned char *response_cursor;
uint8_t instruction_length = 4;
uint16_t requested_count, count = 0;
- uint32_t response_size;
+ uint64_t response_size;
int item_size = 2 + registers_per_row * (MON_REGISTER_ITEM_SIZE + 1) + 8 + 1 + instruction_length;
cpuhistory_t *current;
@@ -1495,9 +1495,16 @@
}
response_size = 4 + count * (item_size + 1);
+ if (response_size > UINT32_MAX) {
+ monitor_binary_error(e_MON_ERR_INVALID_PARAMETER, command->request_id);
+ log_message(LOG_DEFAULT, "monitor binary cpuhistory: Response too long %lu", response_size);
+ return;
+ }
+
response = lib_malloc(response_size);
response_cursor = response;
+
regs = lib_calloc(1, sizeof(mon_reg_list_t) * (registers_per_row + 1));
templates = mon_register_list_get(memspace);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-03-27 13:59:39
|
Revision: 45592
http://sourceforge.net/p/vice-emu/code/45592
Author: compyx
Date: 2025-03-27 13:59:36 +0000 (Thu, 27 Mar 2025)
Log Message:
-----------
mkdoxy.sh: add `src/arch/gtk3/joystickdrv/ and `src/joyport/` to INPUT
Also delete a few directories that no longer exist in the current tree.
Modified Paths:
--------------
branches/compyx/joymap-001/vice/doc/mkdoxy.sh
branches/compyx/joymap-001/vice/src/joyport/joystick.c
Modified: branches/compyx/joymap-001/vice/doc/mkdoxy.sh
===================================================================
--- branches/compyx/joymap-001/vice/doc/mkdoxy.sh 2025-03-27 07:14:16 UTC (rev 45591)
+++ branches/compyx/joymap-001/vice/doc/mkdoxy.sh 2025-03-27 13:59:36 UTC (rev 45592)
@@ -73,6 +73,7 @@
ARCH_GTK3_INPUT=" ../src/arch/gtk3"
ARCH_GTK3_INPUT+=" ../src/arch/gtk3/widgets"
ARCH_GTK3_INPUT+=" ../src/arch/gtk3/widgets/base"
+ARCH_GTK3_INPUT+=" ../src/arch/gtk3/joystickdrv"
ARCH_SDL_INPUT=" ../src/arch/sdl"
@@ -87,6 +88,7 @@
INPUT+=" ../src/hwsiddrv"
INPUT+=" ../src/iecbus"
INPUT+=" ../src/imagecontents"
+INPUT+=" ../src/joyport"
INPUT+=" ../src/monitor"
INPUT+=" ../src/parallel"
INPUT+=" ../src/printerdrv"
Modified: branches/compyx/joymap-001/vice/src/joyport/joystick.c
===================================================================
--- branches/compyx/joymap-001/vice/src/joyport/joystick.c 2025-03-27 07:14:16 UTC (rev 45591)
+++ branches/compyx/joymap-001/vice/src/joyport/joystick.c 2025-03-27 13:59:36 UTC (rev 45592)
@@ -3711,6 +3711,7 @@
return (int)num_joystick_devices;
}
+
/** \brief Set joystick device name
*
* Set name of \a joydev to \a name, deallocating the old name if present.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-03-27 07:14:19
|
Revision: 45591
http://sourceforge.net/p/vice-emu/code/45591
Author: compyx
Date: 2025-03-27 07:14:16 +0000 (Thu, 27 Mar 2025)
Log Message:
-----------
Joystick: Add `joystick_device_set_name()` and `joystick_device_set_node()`
Using these functions makes sure `lib_malloc()` is used to allocate memory for
the name and node strings of a device. Might avoid possible pitfalls for future
joystick driver writers.
Modified Paths:
--------------
branches/compyx/joymap-001/vice/src/joyport/joystick.c
branches/compyx/joymap-001/vice/src/joyport/joystick.h
Modified: branches/compyx/joymap-001/vice/src/joyport/joystick.c
===================================================================
--- branches/compyx/joymap-001/vice/src/joyport/joystick.c 2025-03-27 06:54:00 UTC (rev 45590)
+++ branches/compyx/joymap-001/vice/src/joyport/joystick.c 2025-03-27 07:14:16 UTC (rev 45591)
@@ -3711,7 +3711,42 @@
return (int)num_joystick_devices;
}
+/** \brief Set joystick device name
+ *
+ * Set name of \a joydev to \a name, deallocating the old name if present.
+ *
+ * \param[in] joydev joystick device
+ * \param[in] name joystick name
+ */
+void joystick_device_set_name(joystick_device_t *joydev, const char *name)
+{
+ lib_free(joydev->name);
+ if (name != NULL) {
+ joydev->name = lib_strdup(name);
+ } else {
+ joydev->name = NULL;
+ }
+}
+
+/** \brief Set joystick device node
+ *
+ * Set node of \a joydev to \a node, deallocating the old node if present.
+ *
+ * \param[in] joydev joystick device
+ * \param[in] node joystick node
+ */
+void joystick_device_set_node(joystick_device_t *joydev, const char *node)
+{
+ lib_free(joydev->node);
+ if (node != NULL) {
+ joydev->node = lib_strdup(node);
+ } else {
+ joydev->node = NULL;
+ }
+}
+
+
/** \brief Initialize joystick mapping
*
* \param[in] mapping joystick mapping
Modified: branches/compyx/joymap-001/vice/src/joyport/joystick.h
===================================================================
--- branches/compyx/joymap-001/vice/src/joyport/joystick.h 2025-03-27 06:54:00 UTC (rev 45590)
+++ branches/compyx/joymap-001/vice/src/joyport/joystick.h 2025-03-27 07:14:16 UTC (rev 45591)
@@ -444,6 +444,11 @@
joystick_device_t *joystick_device_by_index (int index);
int joystick_device_count (void);
+void joystick_device_set_name (joystick_device_t *joydev,
+ const char *name);
+void joystick_device_set_node (joystick_device_t *joydev,
+ const char *node);
+
void joystick_device_add_axis (joystick_device_t *joydev,
joystick_axis_t *axis);
void joystick_device_add_button(joystick_device_t *joydev,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-03-27 06:54:03
|
Revision: 45590
http://sourceforge.net/p/vice-emu/code/45590
Author: compyx
Date: 2025-03-27 06:54:00 +0000 (Thu, 27 Mar 2025)
Log Message:
-----------
Joystick: implement inverting button and axis values if requested
Use the calibration struct's `invert` member to determine if we need to invert
the value of a button or an axis event. Can be used if our assumptions on axis
(low = left/up, high = right/down) and button (0 = released, non-0 = pressed)
don't hold.
Modified Paths:
--------------
branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_linux_evdev.c
branches/compyx/joymap-001/vice/src/joyport/joystick.c
Modified: branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_linux_evdev.c
===================================================================
--- branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_linux_evdev.c 2025-03-26 13:02:33 UTC (rev 45589)
+++ branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_linux_evdev.c 2025-03-27 06:54:00 UTC (rev 45590)
@@ -249,8 +249,15 @@
*/
static void linux_joystick_customize(joystick_device_t *joydev)
{
+#if 0
printf("%s() called for device %04x:%04x\n",
__func__, (unsigned int)joydev->vendor, (unsigned int)joydev->product);
+
+ if (joydev->vendor == 0x46d && joydev->product == 0xc21f) {
+ printf("%s(): inverting Y axis for F710\n", __func__);
+ joydev->axes[1]->calibration.invert = true;
+ }
+#endif
}
/** \brief Filter callback for scandir(3)
Modified: branches/compyx/joymap-001/vice/src/joyport/joystick.c
===================================================================
--- branches/compyx/joymap-001/vice/src/joyport/joystick.c 2025-03-26 13:02:33 UTC (rev 45589)
+++ branches/compyx/joymap-001/vice/src/joyport/joystick.c 2025-03-27 06:54:00 UTC (rev 45590)
@@ -3013,6 +3013,10 @@
/* digital axes don't require calibration: */
if (axis->digital) {
+ /* calibration: invert value? */
+ if (axis->calibration.invert) {
+ value *= -1;
+ }
if (value < 0) {
direction = JOY_AXIS_NEGATIVE;
} else if (value > 0) {
@@ -3020,6 +3024,25 @@
}
} else {
/* here we apply calibration */
+ if (axis->calibration.invert) {
+ /* invert value by calculating the distance from center and taking
+ * the opposite side of the center */
+ uint32_t range = axis->maximum - axis->minimum;
+ int32_t center;
+
+ /* integer range: add 1 but avoid overflow (unlikely since HID
+ * axis values appear to be 16-bit signed integers) */
+ if (range < UINT32_MAX) {
+ range++;
+ }
+
+ center = axis->maximum - (range / 2);
+#if 0
+ printf("%s(): inverting %d: [%d-%d] -> %d\n",
+ __func__, value, axis->minimum, axis->maximum, center - value);
+#endif
+ value = center - value;
+ }
if (value <= axis->calibration.threshold.negative) {
direction = JOY_AXIS_NEGATIVE;
} else if (value >= axis->calibration.threshold.positive) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <emp...@us...> - 2025-03-26 13:02:45
|
Revision: 45589
http://sourceforge.net/p/vice-emu/code/45589
Author: empathicqubit
Date: 2025-03-26 13:02:33 +0000 (Wed, 26 Mar 2025)
Log Message:
-----------
Make sure the CPU history response isn't too long before sending.
Modified Paths:
--------------
trunk/vice/src/monitor/monitor_binary.c
Modified: trunk/vice/src/monitor/monitor_binary.c
===================================================================
--- trunk/vice/src/monitor/monitor_binary.c 2025-03-26 07:36:35 UTC (rev 45588)
+++ trunk/vice/src/monitor/monitor_binary.c 2025-03-26 13:02:33 UTC (rev 45589)
@@ -1455,7 +1455,7 @@
unsigned char *response_cursor;
uint8_t instruction_length = 4;
uint16_t requested_count, count = 0;
- uint32_t response_size;
+ uint64_t response_size;
int item_size = 2 + registers_per_row * (MON_REGISTER_ITEM_SIZE + 1) + 8 + 1 + instruction_length;
cpuhistory_t *current;
@@ -1495,9 +1495,16 @@
}
response_size = 4 + count * (item_size + 1);
+ if (response_size > UINT32_MAX) {
+ monitor_binary_error(e_MON_ERR_INVALID_PARAMETER, command->request_id);
+ log_message(LOG_DEFAULT, "monitor binary cpuhistory: Response too long %lu", response_size);
+ return;
+ }
+
response = lib_malloc(response_size);
response_cursor = response;
+
regs = lib_calloc(1, sizeof(mon_reg_list_t) * (registers_per_row + 1));
templates = mon_register_list_get(memspace);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-03-26 07:36:49
|
Revision: 45588
http://sourceforge.net/p/vice-emu/code/45588
Author: compyx
Date: 2025-03-26 07:36:35 +0000 (Wed, 26 Mar 2025)
Log Message:
-----------
Joystick: BSD: only trigger events when values actually changed
Avoid floods of callbacks to `joy_foo_event()` in common code by checking if
the raw value of an input has actually changed before calling a joystick event
handler in common code.
Modified Paths:
--------------
branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_bsd.c
Modified: branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_bsd.c
===================================================================
--- branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_bsd.c 2025-03-26 07:15:13 UTC (rev 45587)
+++ branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_bsd.c 2025-03-26 07:36:35 UTC (rev 45588)
@@ -98,11 +98,14 @@
/** \brief Driver-specific data
*/
typedef struct joy_priv_s {
- void *buffer; /**< buffer for reading HID data */
- report_desc_t rep_desc; /**< HID report descriptor */
- int rep_size; /**< size of \c rep_desc */
- int rep_id; /**< report ID */
- int fd; /**< file descriptor associated with a HID device */
+ void *buffer; /**< buffer for reading HID data */
+ report_desc_t rep_desc; /**< HID report descriptor */
+ int rep_size; /**< size of \c rep_desc */
+ int rep_id; /**< report ID */
+ int fd; /**< file descriptor of HID device */
+ int *prev_axes; /**< previous raw value of axes */
+ int *prev_buttons; /**< previous raw value of buttons */
+ int *prev_hats; /**< previous raw value of hats */
} joy_priv_t;
@@ -140,6 +143,9 @@
priv->rep_size = 0;
priv->fd = -1;
priv->rep_id = 0;
+ priv->prev_axes = NULL;
+ priv->prev_buttons = NULL;
+ priv->prev_hats = NULL;
return priv;
}
@@ -158,12 +164,13 @@
if (p->fd >= 0) {
close(p->fd);
}
- if (p->buffer != NULL) {
- lib_free(p->buffer);
- }
+ lib_free(p->buffer);
if (p->rep_desc != NULL) {
hid_dispose_report_desc(p->rep_desc);
}
+ lib_free(p->prev_axes);
+ lib_free(p->prev_buttons);
+ lib_free(p->prev_hats);
lib_free(p);
}
}
@@ -204,6 +211,7 @@
int value = hid_get_data(priv->buffer, &item);
int usage = HID_USAGE(item.usage);
unsigned int page = HID_PAGE(item.usage);
+ int prev;
switch (page) {
case HUP_GENERIC_DESKTOP:
@@ -223,7 +231,11 @@
* So for FreeBSD we'd need calibration to be
* implemented for the F710 to work.
*/
- joy_axis_event(joydev, axis, (int32_t)value);
+ prev = priv->prev_axes[axis->index];
+ if (value != prev) {
+ priv->prev_axes[axis->index] = value;
+ joy_axis_event(joydev, axis, (int32_t)value);
+ }
}
break;
@@ -231,7 +243,11 @@
/* hat */
hat = joystick_hat_from_code(joydev, (uint32_t)usage);
if (hat != NULL) {
- joy_hat_event(joydev, hat, (int32_t)value);
+ prev = priv->prev_hats[hat->index];
+ if (prev != value) {
+ priv->prev_hats[hat->index] = value;
+ joy_hat_event(joydev, hat, (int32_t)value);
+ }
}
break;
@@ -242,7 +258,11 @@
/* D-Pad is mapped as buttons */
button = joystick_button_from_code(joydev, (uint32_t)usage);
if (button != NULL) {
- joy_button_event(joydev, button, (int32_t)value);
+ prev = priv->prev_buttons[button->index];
+ if (prev != value) {
+ priv->prev_buttons[button->index] = value;
+ joy_button_event(joydev, button, (int32_t)value);
+ }
}
break;
default:
@@ -253,7 +273,11 @@
/* button event */
button = joystick_button_from_code(joydev, (uint32_t)usage);
if (button != NULL) {
- joy_button_event(joydev, button, (int32_t)value);
+ prev = priv->prev_buttons[button->index];
+ if (prev != value) {
+ priv->prev_buttons[button->index] = value;
+ joy_button_event(joydev, button, (int32_t)value);
+ }
}
break;
default:
@@ -602,8 +626,19 @@
"failed to register device %s (\"%s\")",
joydev->node, joydev->name);
joystick_device_free(joydev);
+ } else {
+ /* allocate arrays for previous values of inputs */
+ joy_priv_t *priv = joydev->priv;
+
+ priv->prev_axes = lib_malloc((size_t)joydev->num_axes *
+ sizeof *priv->prev_axes);
+ priv->prev_buttons = lib_malloc((size_t)joydev->num_buttons *
+ sizeof *priv->prev_buttons);
+ priv->prev_hats = lib_malloc((size_t)joydev->num_hats *
+ sizeof *priv->prev_hats);
}
} else {
+ /* failure while scanning: log and free invalid device */
log_warning(bsd_joy_log,
"failed to scan inputs for device %s (\"%s\")",
joydev->node, joydev->name);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-03-26 07:15:16
|
Revision: 45587
http://sourceforge.net/p/vice-emu/code/45587
Author: compyx
Date: 2025-03-26 07:15:13 +0000 (Wed, 26 Mar 2025)
Log Message:
-----------
Joystick: make sure to regenerate indexes of inputs after sorting
Modified Paths:
--------------
branches/compyx/joymap-001/vice/src/joyport/joystick.c
Modified: branches/compyx/joymap-001/vice/src/joyport/joystick.c
===================================================================
--- branches/compyx/joymap-001/vice/src/joyport/joystick.c 2025-03-26 07:09:00 UTC (rev 45586)
+++ branches/compyx/joymap-001/vice/src/joyport/joystick.c 2025-03-26 07:15:13 UTC (rev 45587)
@@ -3565,6 +3565,8 @@
*/
static void order_inputs_on_code(joystick_device_t *joydev)
{
+ int i;
+
#if 0
printf("%s(): == BEFORE SORTING ==\n", __func__);
dump_axes(joydev);
@@ -3580,6 +3582,18 @@
if (joydev->num_hats > 1) {
qsort(joydev->hats, (size_t)(joydev->num_hats), sizeof joydev->hats[0], cmp_hats);
}
+
+ /* regenerate indexes of inputs */
+ for (i = 0; i < joydev->num_axes; i++) {
+ joydev->axes[i]->index = i;
+ }
+ for (i = 0; i < joydev->num_buttons; i++) {
+ joydev->buttons[i]->index = i;
+ }
+ for (i = 0; i < joydev->num_hats; i++) {
+ joydev->hats[i]->index = i;
+ }
+
#if 0
printf("%s(): == AFTER SORTING ==\n", __func__);
dump_axes(joydev);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-03-26 07:09:07
|
Revision: 45586
http://sourceforge.net/p/vice-emu/code/45586
Author: compyx
Date: 2025-03-26 07:09:00 +0000 (Wed, 26 Mar 2025)
Log Message:
-----------
Joystick: BSD: add missing Doxygen docblocks
Modified Paths:
--------------
branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_bsd.c
Modified: branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_bsd.c
===================================================================
--- branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_bsd.c 2025-03-25 21:28:12 UTC (rev 45585)
+++ branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_bsd.c 2025-03-26 07:09:00 UTC (rev 45586)
@@ -78,18 +78,31 @@
#include "types.h"
#include "util.h"
+/* Constants used when calling scandir(3) and (re)constructing nodes in the
+ * file system of HID devices
+ */
+
+/** \brief Root directory of \c uhid* files */
#define ROOT_NODE "/dev"
+
+/** \brief Length of the #ROOT_NODE */
#define ROOT_NODE_LEN 4
+
+/** \brief Prefix of HID files in the \c /dev virtual file system */
#define NODE_PREFIX "uhid"
+
+/** \brief Length of the #NODE_PREIFX */
#define NODE_PREFIX_LEN 4
+/** \brief Driver-specific data
+ */
typedef struct joy_priv_s {
- void *buffer;
- report_desc_t rep_desc;
- int rep_size;
- int rep_id;
- int fd;
+ void *buffer; /**< buffer for reading HID data */
+ report_desc_t rep_desc; /**< HID report descriptor */
+ int rep_size; /**< size of \c rep_desc */
+ int rep_id; /**< report ID */
+ int fd; /**< file descriptor associated with a HID device */
} joy_priv_t;
@@ -155,11 +168,19 @@
}
}
+/** \brief Open joystick device for polling
+ *
+ * \param[in] joydev joystick device
+ */
static bool bsd_joy_open (joystick_device_t *joydev)
{
return true; /* NOP */
}
+/** \brief Poll joystick device
+ *
+ * \param[in] joydev joystick device
+ */
static void bsd_joy_poll(joystick_device_t *joydev)
{
joy_priv_t *priv = joydev->priv;
@@ -250,6 +271,10 @@
}
}
+/** \brief Close joystick device
+ *
+ * \param[in] joydev joystick device
+ */
static void bsd_joy_close(joystick_device_t *joydev)
{
if (joydev != NULL && joydev->priv != NULL) {
@@ -593,6 +618,10 @@
}
+/** \brief Driver-specific cleanup
+ *
+ * Currently doesn't do anything, just here to satisfy the API
+ */
void joystick_arch_shutdown(void)
{
/* NOP */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-03-25 21:28:29
|
Revision: 45585
http://sourceforge.net/p/vice-emu/code/45585
Author: compyx
Date: 2025-03-25 21:28:12 +0000 (Tue, 25 Mar 2025)
Log Message:
-----------
Joystick: rename `bsd_joystick_init()` to `joystick_arch_init()`
Also implement `joystick_arch_shutdown()`, which currently does nothing.
Modified Paths:
--------------
branches/compyx/joymap-001/vice/doc/html/index.html
branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_bsd.c
Modified: branches/compyx/joymap-001/vice/doc/html/index.html
===================================================================
--- branches/compyx/joymap-001/vice/doc/html/index.html 2025-03-25 18:58:50 UTC (rev 45584)
+++ branches/compyx/joymap-001/vice/doc/html/index.html 2025-03-25 21:28:12 UTC (rev 45585)
@@ -371,7 +371,24 @@
<!--teamstart-->
<p>
Current VICE team members:
-.
+Pottendo,
+Marco van den Heuvel,
+Fabrizio Gennari,
+Groepaz,
+Errol Smith,
+Ingo Korb,
+Olaf Seibert,
+Marcus Sutton,
+Kajtar Zsolt,
+AreaScout,
+Bas Wassink,
+Michael C. Martin,
+Christopher Phillips,
+David Hogan,
+Empathic Qubit,
+Roberto Muscedere,
+June Tate-Gans,
+Pablo Roldan.
</p>
<p>Of course our warm thanks go to everyone who has helped us in developing
@@ -385,7 +402,60 @@
<p>
The VICE is copyrighted to:
-.
+Pottendo,
+Marco van den Heuvel,
+Fabrizio Gennari,
+Groepaz,
+Errol Smith,
+Ingo Korb,
+Olaf Seibert,
+Marcus Sutton,
+Kajtar Zsolt,
+AreaScout,
+Bas Wassink,
+Michael C. Martin,
+Christopher Phillips,
+David Hogan,
+Empathic Qubit,
+Roberto Muscedere,
+June Tate-Gans,
+Pablo Roldan,
+Stefan Haubenthal,
+BSzili,
+Andreas Matthies,
+Daniel Kahlin,
+Benjamin 'BeRo' Rosseaux,
+Ulrich Schulz,
+Thomas Giesel,
+Antti S. Lankila,
+Christian Vogelgsang,
+Dag Lem,
+Spiro Trikaliotis,
+Hannu Nuotio,
+Andreas Boose,
+Tibor Biczo,
+M. Kiesel,
+Andreas Dehmel,
+David Hansel,
+Markus Brenner,
+Thomas Bretz,
+Daniel Sladic,
+Andre Fachat,
+Ettore Perazzoli,
+Teemu Rantanen,
+Jouko Valta,
+Jarkko Sonninen,
+Mikkel Holm Olsen,
+Manuel Antonio Rodriguez Bas,
+Paul Dube,
+Czirkos Zoltan,
+Karai Csaba,
+Andrea Musuruane,
+Jesse Lee,
+Jarek Sobolewski,
+Michael Litvinov,
+Peter Krefting,
+Emir Akaydin.
<!--teamend-->
</p><p>
<b>VICE</b> is free software; you can redistribute it and/or modify it
Modified: branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_bsd.c
===================================================================
--- branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_bsd.c 2025-03-25 18:58:50 UTC (rev 45584)
+++ branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_bsd.c 2025-03-25 21:28:12 UTC (rev 45585)
@@ -529,7 +529,7 @@
/** \brief Initialize BSD joystick driver and add available devices
*/
-void bsd_joystick_init(void)
+void joystick_arch_init(void)
{
struct dirent **namelist = NULL;
int nl_count;
@@ -542,6 +542,7 @@
/* Initialize HID library so we can retrieve strings for page and usage;
* without this button names will be "0x00001" etc, not very informative.
+ * (Parses /usr/share/misc/ubs_hid_usages on FreeBSD)
*/
hid_init(NULL);
@@ -590,3 +591,9 @@
free(namelist);
}
+
+
+void joystick_arch_shutdown(void)
+{
+ /* NOP */
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-03-25 18:58:59
|
Revision: 45584
http://sourceforge.net/p/vice-emu/code/45584
Author: compyx
Date: 2025-03-25 18:58:50 +0000 (Tue, 25 Mar 2025)
Log Message:
-----------
Joystick: rename `win32_joystick_init()` to `joystick_arch_init()`
Modified Paths:
--------------
branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_win32_directinput.c
Modified: branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_win32_directinput.c
===================================================================
--- branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_win32_directinput.c 2025-03-25 18:15:13 UTC (rev 45583)
+++ branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_win32_directinput.c 2025-03-25 18:58:50 UTC (rev 45584)
@@ -455,7 +455,7 @@
/** \brief Initialize driver and enumerate and register devices
*/
-void win32_joystick_init(void)
+void joystick_arch_init(void)
{
HRESULT result;
@@ -491,3 +491,8 @@
log_err_helper("IDirectInput8::EnumDevices() failed", result);
}
}
+
+
+void joystick_arch_shutdown(void)
+{
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-03-25 18:15:26
|
Revision: 45583
http://sourceforge.net/p/vice-emu/code/45583
Author: compyx
Date: 2025-03-25 18:15:13 +0000 (Tue, 25 Mar 2025)
Log Message:
-----------
Joystick: add `joystick_arch_init()` and `joystick_arch_shutdown()`
Instead of the individual `linux_joystick_evdev_init()`, `win32_joystick_init()`
etc arch-specific joystick initialization functions we now use a single name
`joystick_arch_init()`. Also add `joystick_arch_shutdown()`, which is called
after `joystick_close()` closes joystick devices and frees their associated
resources. This function can be used to clean up arch-specific resources
allocated by `joystick_arch_init()`: at least MacOS appears to need this with
`joy_hidlib_exit()` in `src/machine.c`'.
Modified Paths:
--------------
branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_linux_evdev.c
branches/compyx/joymap-001/vice/src/arch/sdl/joy.c
branches/compyx/joymap-001/vice/src/joyport/joystick.c
branches/compyx/joymap-001/vice/src/joyport/joystick.h
branches/compyx/joymap-001/vice/src/machine.c
Modified: branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_linux_evdev.c
===================================================================
--- branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_linux_evdev.c 2025-03-25 15:37:55 UTC (rev 45582)
+++ branches/compyx/joymap-001/vice/src/arch/gtk3/joystickdrv/joystick_linux_evdev.c 2025-03-25 18:15:13 UTC (rev 45583)
@@ -241,6 +241,18 @@
}
}
+/** \brief Custom mapping/calibration callback
+ *
+ * Just for debugging/testing right now.
+ *
+ * \param[in] joydev joystick device
+ */
+static void linux_joystick_customize(joystick_device_t *joydev)
+{
+ printf("%s() called for device %04x:%04x\n",
+ __func__, (unsigned int)joydev->vendor, (unsigned int)joydev->product);
+}
+
/** \brief Filter callback for scandir(3)
*
* \param[in] de dirent instance
@@ -353,8 +365,6 @@
}
-static void linux_joystick_customize(joystick_device_t *joydev);
-
/** \brief Object used to register driver for devices
*
* The address of this object is used in the joystick code, it isn't copied,
@@ -372,9 +382,8 @@
/** \brief Initialize Linux evdev joystick driver
*
* Scan device nodes in \c /dev/input/ for supported joysticks/gamepads.
- * Devices with less than one button or less than two axes are rejected.
*/
-void linux_joystick_evdev_init(void)
+void joystick_arch_init(void)
{
struct dirent **namelist = NULL;
int sd_result;
@@ -397,24 +406,10 @@
//log_message(joy_evdev_log, "Possible device '%s'", namelist[i]->d_name);
joydev = scan_device(namelist[i]->d_name);
if (joydev != NULL) {
- if (joydev->num_axes < 2u || joydev->num_buttons < 1u) {
- /* reject device */
- //log_message(joy_evdev_log,
- // "Invalid geometry for %s: axes: %d, buttons: %d",
- // joydev->name, joydev->num_axes, joydev->num_buttons);
+ if (!joystick_device_register(joydev)) {
+ log_message(joy_evdev_log,
+ "Failed to add device, continuing with next device.");
joystick_device_free(joydev);
- } else {
- //log_message(joy_evdev_log,
- // "Adding device: %s [%04x:%04x] (%d axes, %d buttons)",
- // joydev->name,
- // (unsigned int)joydev->vendor, (unsigned int)joydev->product,
- // joydev->num_axes, joydev->num_buttons);
-
- if (!joystick_device_register(joydev)) {
- log_message(joy_evdev_log,
- "Failed to add device, continuing with next device.");
- joystick_device_free(joydev);
- }
}
}
}
@@ -422,14 +417,11 @@
}
-/** \brief Custom mapping/calibration callback
+/** \brief Linux evdev-specific shutdown
*
- * Just for debugging/testing right now.
- *
- * \param[in] joydev joystick device
+ * Runs after `joystick_close()` closed and freed all devices.
*/
-static void linux_joystick_customize(joystick_device_t *joydev)
+void joystick_arch_shutdown(void)
{
- printf("%s() called for device %04x:%04x\n",
- __func__, (unsigned int)joydev->vendor, (unsigned int)joydev->product);
+ printf("%s(): called\n", __func__);
}
Modified: branches/compyx/joymap-001/vice/src/arch/sdl/joy.c
===================================================================
--- branches/compyx/joymap-001/vice/src/arch/sdl/joy.c 2025-03-25 15:37:55 UTC (rev 45582)
+++ branches/compyx/joymap-001/vice/src/arch/sdl/joy.c 2025-03-25 18:15:13 UTC (rev 45583)
@@ -226,25 +226,21 @@
static bool sdljoy_get_devices(void);
-int joy_sdl_init(void)
+
+void joystick_arch_init(void)
{
sdljoy_log = log_open("SDLJoystick");
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK)) {
log_error(sdljoy_log, "Subsystem init failed!");
- return -1;
}
joystick_driver_register(&sdl_joystick_driver);
-
sdljoy_get_devices();
-
-
// sdljoy_rescan();
-
- return 0;
}
+
static joystick_device_t *scan_device(SDL_Joystick *sdldev, int index)
{
joystick_device_t *joydev = joystick_device_new();
@@ -879,6 +875,11 @@
return _sdljoy_swap_ports;
}
+void joystick_arch_shutdown(void)
+{
+}
+
+
/* ------------------------------------------------------------------------- */
#else
Modified: branches/compyx/joymap-001/vice/src/joyport/joystick.c
===================================================================
--- branches/compyx/joymap-001/vice/src/joyport/joystick.c 2025-03-25 15:37:55 UTC (rev 45582)
+++ branches/compyx/joymap-001/vice/src/joyport/joystick.c 2025-03-25 18:15:13 UTC (rev 45583)
@@ -2723,6 +2723,8 @@
kbd_initialize_numpad_joykeys(joykeys[0]);
#endif
+ /* Initialize arch-specific driver: registers driver and devices */
+#if 0
#if defined(LINUX_JOYSTICK) && !defined(HAVE_LINUX_EVDEV)
linux_joystick_init();
#elif defined(HAVE_LINUX_EVDEV)
@@ -2736,6 +2738,9 @@
#elif defined HAVE_SDL_NUMJOYSTICKS
joy_sdl_init();
#endif
+#else
+ joystick_arch_init();
+#endif
int i;
for (i = 0; i < JOYPORT_MAX_PORTS; i++) {
Modified: branches/compyx/joymap-001/vice/src/joyport/joystick.h
===================================================================
--- branches/compyx/joymap-001/vice/src/joyport/joystick.h 2025-03-25 15:37:55 UTC (rev 45582)
+++ branches/compyx/joymap-001/vice/src/joyport/joystick.h 2025-03-25 18:15:13 UTC (rev 45583)
@@ -372,6 +372,8 @@
int joystick_joyport_register(void);
+/* Replaced with joystick_arch_init()` */
+#if 0
void linux_joystick_init(void);
void linux_joystick_evdev_init(void);
void bsd_joystick_init(void);
@@ -378,7 +380,9 @@
void joy_hidlib_init(void);
void joy_hidlib_exit(void);
void win32_joystick_init(void);
+#endif
+
uint16_t get_joystick_value(int index);
typedef void (*joystick_machine_func_t)(void);
@@ -422,6 +426,15 @@
#endif
+/*
+ * Arch-specific functions
+ */
+
+void joystick_arch_init (void);
+void joystick_arch_shutdown(void);
+
+
+
void joystick_driver_register (const joystick_driver_t *driver);
joystick_device_t *joystick_device_new (void);
Modified: branches/compyx/joymap-001/vice/src/machine.c
===================================================================
--- branches/compyx/joymap-001/vice/src/machine.c 2025-03-25 15:37:55 UTC (rev 45582)
+++ branches/compyx/joymap-001/vice/src/machine.c 2025-03-25 18:15:13 UTC (rev 45583)
@@ -378,6 +378,7 @@
#ifdef MAC_JOYSTICK
joy_hidlib_exit();
#endif
+ joystick_arch_shutdown();
sound_close();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gp...@us...> - 2025-03-25 15:38:14
|
Revision: 45582
http://sourceforge.net/p/vice-emu/code/45582
Author: gpz
Date: 2025-03-25 15:37:55 +0000 (Tue, 25 Mar 2025)
Log Message:
-----------
make comment more clear
Modified Paths:
--------------
trunk/vice/src/arch/gtk3/linenoise.c
Modified: trunk/vice/src/arch/gtk3/linenoise.c
===================================================================
--- trunk/vice/src/arch/gtk3/linenoise.c 2025-03-25 14:14:52 UTC (rev 45581)
+++ trunk/vice/src/arch/gtk3/linenoise.c 2025-03-25 15:37:55 UTC (rev 45582)
@@ -5,9 +5,14 @@
*
* Modified for the VICE project by Fabrizio Gennari,
* for use in combination with a terminal
- * not represented by a couple of file descrptors
+ * not represented by a couple of file descriptors
* (abstracted buy the opaque struct console_private_s)
*
+ * NOTE: Due to the above, it is not possible to share this modified library
+ * with anything else. Also due to how the GTK monitor works, we can not replace
+ * this modified library by a standard linenoise (or -ng), which works on top
+ * of file descriptors.
+ *
* You can find the latest source code at:
*
* http://github.com/antirez/linenoise
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|