Revision: 45645
http://sourceforge.net/p/vice-emu/code/45645
Author: gpz
Date: 2025-04-27 21:09:22 +0000 (Sun, 27 Apr 2025)
Log Message:
-----------
in some places we share code between the C64 and the C128 emulator, which uses the board_type resource/setting. this change makes sure we use different values for C64 and C128 boards everywhere, and we don't use values that do not for the resource
Modified Paths:
--------------
trunk/vice/src/c128/c128-resources.c
trunk/vice/src/c128/c128model.h
trunk/vice/src/c64/c64-resources.c
trunk/vice/src/c64/c64model.h
Modified: trunk/vice/src/c128/c128-resources.c
===================================================================
--- trunk/vice/src/c128/c128-resources.c 2025-04-27 17:41:07 UTC (rev 45644)
+++ trunk/vice/src/c128/c128-resources.c 2025-04-27 21:09:22 UTC (rev 45645)
@@ -133,7 +133,7 @@
int cia1_model = CIA_MODEL_6526A;
int cia2_model = CIA_MODEL_6526A;
-static int board_type = BOARD_C128D;
+int board_type = BOARD_C128D;
static int set_c128_full_banks(int val, void *param)
{
@@ -178,7 +178,7 @@
static int set_board_type(int val, void *param)
{
int old_board_type = board_type;
- if ((val < 0) || (val > 1)) {
+ if ((val < BOARD_C128) || (val > BOARD_LAST)) {
return -1;
}
board_type = val;
Modified: trunk/vice/src/c128/c128model.h
===================================================================
--- trunk/vice/src/c128/c128model.h 2025-04-27 17:41:07 UTC (rev 45644)
+++ trunk/vice/src/c128/c128model.h 2025-04-27 21:09:22 UTC (rev 45645)
@@ -44,8 +44,7 @@
#define C128MODEL_UNKNOWN 99
-#define BOARD_C128 0
-#define BOARD_C128D 1
+#include "c64model.h" /* for the BOARD_ constants */
#define OLD_CIA 0
#define NEW_CIA 1
Modified: trunk/vice/src/c64/c64-resources.c
===================================================================
--- trunk/vice/src/c64/c64-resources.c 2025-04-27 17:41:07 UTC (rev 45644)
+++ trunk/vice/src/c64/c64-resources.c 2025-04-27 21:09:22 UTC (rev 45645)
@@ -135,7 +135,7 @@
static int set_board_type(int val, void *param)
{
int old_board_type = board_type;
- if ((val < 0) || (val > BOARD_LAST)) {
+ if ((val < 0) || (val > BOARD_LAST_C64)) {
return -1;
}
board_type = val;
Modified: trunk/vice/src/c64/c64model.h
===================================================================
--- trunk/vice/src/c64/c64model.h 2025-04-27 17:41:07 UTC (rev 45644)
+++ trunk/vice/src/c64/c64model.h 2025-04-27 21:09:22 UTC (rev 45645)
@@ -70,11 +70,15 @@
#define GLUE_DISCRETE 0
#define GLUE_CUSTOM_IC 1
-#define BOARD_C64 0
-#define BOARD_MAX 1
-#define BOARD_SX64 2
-#define BOARD_C128 3
-#define BOARD_LAST 3
+/* CAUTION: these are shared with x128 */
+#define BOARD_C64 0
+#define BOARD_MAX 1
+#define BOARD_SX64 2
+#define BOARD_LAST_C64 2
+/* put all C128 boards last */
+#define BOARD_C128 3
+#define BOARD_C128D 4
+#define BOARD_LAST 4
#define IEC_HARD_RESET 0
#define IEC_SOFT_RESET 1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|