Skip to content

Commit fc7ebf8

Browse files
committed
Added FunMP3 userport cartridge support
git-svn-id: https://svn.code.sf.net/p/vice-emu/code/trunk@45796 379a1393-f5fb-40a0-bcee-ef074d9b53f7
1 parent af24424 commit fc7ebf8

File tree

11 files changed

+70
-2
lines changed

11 files changed

+70
-2
lines changed

vice/configure.ac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3148,6 +3148,11 @@ if test x"$with_mpg123" = "xyes"; then
31483148
if test x"$USE_MPG123_SUPPORT" != "xyes"; then
31493149
AC_MSG_ERROR([MPG123 support requested but missing])
31503150
fi
3151+
if test x"$is_win32_gtk3" = "xyes"; then
3152+
AC_DEFINE(HAVE_GLOB_H,,)
3153+
else
3154+
AC_CHECK_HEADERS(glob.h,,)
3155+
fi
31513156
fi
31523157

31533158
dnl Check for libraries and header files

vice/doc/vice.texi

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8782,6 +8782,9 @@ Set the device attached to the userport (see table below):
87828782
@item 27
87838783
@tab Userport PS/2 Mouse
87848784
@tab x64dtv
8785+
@item 27
8786+
@tab Userport FunMP3
8787+
@tab x64, x64sc, x128, xscpu64, xpet, xvic
87858788
@end multitable
87868789

87878790
@table @code
@@ -8855,6 +8858,11 @@ Integer, WiC64 trace level, 0: no trace, 1: standard, 2: verbose,
88558858
3: debug
88568859
(vic20, x64, x64sc, xscpu64 and x128 only).
88578860

8861+
@vindex FunMP3Dir
8862+
@item FunMP3Dir
8863+
String specifying the path to the directory where mp3's are lookup up
8864+
for playing
8865+
(vic20, x64, x64sc, xscpu64, x128 and xpet only).
88588866
@end table
88598867

88608868
@c @node FIXME
@@ -8937,6 +8945,10 @@ Specify WiC64 security token
89378945
Enable/disable automatically setting the local IP address (default: enabled)
89388946
(vic20, x64, x64sc, xscpu64 and x128 only).
89398947

8948+
@findex -funmp3dir
8949+
@item -funmp3dir <path>
8950+
Specify path to search for mp3 files used by the FunMP3 module
8951+
(vic20, x64, x64sc, xscpu64, x128, xpet only).
89408952
@end table
89418953

89428954
@c -----------------------------------------------------------------------------
@@ -36712,6 +36724,7 @@ The VICE core team:
3671236724
@b{Pottendo}
3671336725
Fixed WiC64 support. Most of the former contributions (pre V3.x) have
3671436726
been taken over and/or replaced by other's contributions.
36727+
Added FunMP3 userport cartdridge support.
3671536728

3671636729
@item
3671736730
@b{Marco van den Heuvel}

vice/src/arch/shared/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ libarchdep_a_SOURCES = \
8787
archdep_get_vice_hotkeysdir.c \
8888
archdep_get_vice_machinedir.c \
8989
archdep_getcwd.c \
90+
archdep_glob.c \
9091
archdep_home_path.c \
9192
archdep_icon_path.c \
9293
archdep_is_haiku.c \
@@ -199,6 +200,7 @@ EXTRA_DIST = \
199200
archdep_get_vice_hotkeysdir.h \
200201
archdep_get_vice_machinedir.h \
201202
archdep_getcwd.h \
203+
archdep_glob.h \
202204
archdep_home_path.h \
203205
archdep_icon_path.h \
204206
archdep_is_haiku.h \

vice/src/arch/shared/archapi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
#include "archdep_get_vice_hotkeysdir.h"
8383
#include "archdep_get_vice_machinedir.h"
8484
#include "archdep_getcwd.h"
85+
#include "archdep_glob.h"
8586
#include "archdep_home_path.h"
8687
#include "archdep_icon_path.h"
8788
#include "archdep_is_haiku.h"

vice/src/c128/c128.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
#include "userport_superpad64.h"
143143
#include "userport_synergy_joystick.h"
144144
#include "userport_wic64.h"
145+
#include "userport_funmp3.h"
145146
#include "userport_woj_joystick.h"
146147
#include "vdc.h"
147148
#include "vdc-mem.h"
@@ -1149,7 +1150,9 @@ int machine_specific_init(void)
11491150
#ifdef USE_MPG123
11501151
clockport_mp3at64_sound_chip_init();
11511152
#endif
1152-
1153+
#if defined(USE_MPG123) && defined (HAVE_GLOB_H)
1154+
userport_funmp3_sound_chip_init();
1155+
#endif
11531156
drive_sound_init();
11541157
datasette_sound_init();
11551158
video_sound_init();

vice/src/c64/c64.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144
#include "userport_synergy_joystick.h"
145145
#include "userport_wic64.h"
146146
#include "userport_woj_joystick.h"
147+
#include "userport_funmp3.h"
147148
#include "vice-event.h"
148149
#include "vicii.h"
149150
#include "vicii-mem.h"
@@ -1103,10 +1104,13 @@ int machine_specific_init(void)
11031104
userport_dac_sound_chip_init();
11041105
userport_digimax_sound_chip_init();
11051106

1106-
/* Initialize mp3@64 */
1107+
/* Initialize mp3@64, funmp3 */
11071108
#ifdef USE_MPG123
11081109
clockport_mp3at64_sound_chip_init();
11091110
#endif
1111+
#if defined(USE_MPG123) && defined (HAVE_GLOB_H)
1112+
userport_funmp3_sound_chip_init();
1113+
#endif
11101114

11111115
drive_sound_init();
11121116
datasette_sound_init();

vice/src/pet/pet.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
#include "userport_spt_joystick.h"
112112
#include "userport_synergy_joystick.h"
113113
#include "userport_woj_joystick.h"
114+
#include "userport_funmp3.h"
114115
#include "util.h"
115116
#include "via.h"
116117
#include "vice-event.h"
@@ -431,6 +432,12 @@ int machine_resources_init(void)
431432
init_resource_fail("debug cart");
432433
return -1;
433434
}
435+
#if defined(USE_MPG123) && defined (HAVE_GLOB_H)
436+
if (userport_funmp3_resources_init() < 0) {
437+
init_resource_fail("funmp3 cart");
438+
return -1;
439+
}
440+
#endif
434441
return 0;
435442
}
436443

@@ -582,6 +589,12 @@ int machine_cmdline_options_init(void)
582589
init_cmdline_options_fail("debug cart");
583590
return -1;
584591
}
592+
#if defined(USE_MPG123) && defined (HAVE_GLOB_H)
593+
if (userport_funmp3_cmdline_options_init() < 0) {
594+
init_cmdline_options_fail("funmp3 cart");
595+
return -1;
596+
}
597+
#endif
585598
return 0;
586599
}
587600

@@ -706,6 +719,11 @@ int machine_specific_init(void)
706719
/* Initialize userport based sound chips */
707720
userport_dac_sound_chip_init();
708721

722+
/* Initialize funmp3 */
723+
#if defined(USE_MPG123) && defined (HAVE_GLOB_H)
724+
userport_funmp3_sound_chip_init();
725+
#endif
726+
709727
drive_sound_init();
710728
datasette_sound_init();
711729
video_sound_init();

vice/src/userport/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ libuserport_a_SOURCES = \
6363
userport_synergy_joystick.h \
6464
userport_wic64.c \
6565
userport_wic64.h \
66+
userport_funmp3.c \
67+
userport_funmp3.h \
6668
userport_woj_joystick.c \
6769
userport_woj_joystick.h
6870

vice/src/userport/userport.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@
152152
#include "userport_superpad64.h"
153153
#include "userport_synergy_joystick.h"
154154
#include "userport_wic64.h"
155+
#include "userport_funmp3.h"
155156

156157
#include "c64parallel.h"
157158
#include "plus4parallel.h"
@@ -786,6 +787,14 @@ static userport_init_t userport_devices_init[] = {
786787
NULL, /* resources shutdown function */
787788
NULL /* cmdline options init function */
788789
},
790+
#if defined(USE_MPG123) && defined (HAVE_GLOB_H)
791+
{ USERPORT_DEVICE_FUNMP3, /* device id */
792+
UP_C64 | UP_VIC20, /* emulators this device works on */
793+
userport_funmp3_resources_init, /* resources init function */
794+
userport_funmp3_resources_shutdown, /* resources shutdown function */
795+
userport_funmp3_cmdline_options_init /* cmdline options init function */
796+
},
797+
#endif
789798

790799
{ USERPORT_DEVICE_NONE, VICE_MACHINE_NONE, NULL, NULL, NULL }, /* end of the devices list */
791800
};
@@ -930,6 +939,10 @@ static const struct userport_opt_s id_match[] = {
930939
#endif
931940
{ "space", USERPORT_DEVICE_SPACEBALLS },
932941
{ "spaceballs", USERPORT_DEVICE_SPACEBALLS },
942+
#if defined(USE_MPG123) && defined (HAVE_GLOB_H)
943+
{ "funmp3", USERPORT_DEVICE_FUNMP3 },
944+
#endif
945+
933946
{ NULL, -1 }
934947
};
935948

vice/src/userport/userport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ enum {
7171
USERPORT_DEVICE_SPT_JOYSTICK,
7272
USERPORT_DEVICE_DIAGNOSTIC_PIN,
7373
USERPORT_DEVICE_MOUSE_PS2,
74+
USERPORT_DEVICE_FUNMP3,
7475

7576
/* This item always needs to be at the end */
7677
USERPORT_MAX_DEVICES

0 commit comments

Comments
 (0)