Revision: 18967
http://vice-emu.svn.sourceforge.net/vice-emu/?rev=18967&view=rev
Author: strik
Date: 2008-07-07 11:15:00 -0700 (Mon, 07 Jul 2008)
Log Message:
-----------
2008-07-07 Spiro Trikaliotis <spi...@gm...>
* src/init.c, src/autostart.c, src/autostart.h,
src/translate.txt, src/translate.c: Added new command-line
options -autostartrunwithcolon and +autostartrunwithcolon along
with corresponding vicerc option AutostartRunWithColon=x.
Modified Paths:
--------------
trunk/vice/src/ChangeLog
trunk/vice/src/autostart.c
trunk/vice/src/autostart.h
trunk/vice/src/init.c
trunk/vice/src/translate.c
trunk/vice/src/translate.txt
Modified: trunk/vice/src/ChangeLog
===================================================================
--- trunk/vice/src/ChangeLog 2008-07-07 17:55:09 UTC (rev 18966)
+++ trunk/vice/src/ChangeLog 2008-07-07 18:15:00 UTC (rev 18967)
@@ -1,3 +1,10 @@
+2008-07-07 Spiro Trikaliotis <spi...@gm...>
+
+ * init.c, autostart.c, autostart.h, translate.txt, translate.c:
+ Added new command-line options -autostartrunwithcolon and
+ +autostartrunwithcolon along with corresponding vicerc option
+ AutostartRunWithColon=x.
+
2008-07-07 Marco van den Heuvel <bla...@ya...>
* arch/beos/Makefile.am, arch/beos/constants.h, arch/beos/ui.cc,
Modified: trunk/vice/src/autostart.c
===================================================================
--- trunk/vice/src/autostart.c 2008-07-07 17:55:09 UTC (rev 18966)
+++ trunk/vice/src/autostart.c 2008-07-07 18:15:00 UTC (rev 18967)
@@ -37,6 +37,7 @@
#include "archdep.h"
#include "autostart.h"
#include "attach.h"
+#include "cmdline.h"
#include "datasette.h"
#include "drive.h"
#include "fileio.h"
@@ -112,6 +113,89 @@
static int autostart_wait_for_reset;
/* ------------------------------------------------------------------------- */
+static int AutostartRunWithColon = 0;
+
+static const char * const AutostartRunCommandsAvailable[] = { "RUN\r", "RUN:\r" };
+
+static const char * AutostartRunCommand = NULL;
+
+/*! \internal \brief set the reu to the enabled or disabled state
+
+ \param val
+ if 0, disable the REU; else, enable it.
+
+ \param param
+ unused
+
+ \return
+ 0 on success. else -1.
+*/
+static int set_autostart_run_with_colon(int val, void *param)
+{
+ AutostartRunWithColon = val ? 1 : 0;
+
+ AutostartRunCommand = AutostartRunCommandsAvailable[AutostartRunWithColon];
+
+ return 0;
+}
+
+
+/*! \brief integer resources used by the REU module */
+static const resource_int_t resources_int[] = {
+ { "AutostartRunWithColon", 0, RES_EVENT_NO, (resource_value_t)0,
+ &AutostartRunWithColon, set_autostart_run_with_colon, NULL },
+ { NULL }
+};
+
+/*! \brief initialize the resources
+ \return
+ 0 on success, else -1.
+
+ \remark
+ Registers the integer resources
+*/
+int autostart_resources_init(void)
+{
+ return resources_register_int(resources_int);
+}
+
+/* ------------------------------------------------------------------------- */
+
+#ifdef HAS_TRANSLATION
+static const cmdline_option_t cmdline_options[] =
+{
+ { "-autostartwithcolon", SET_RESOURCE, 0, NULL, NULL, "AutostartRunWithColon", (resource_value_t)1,
+ 0, IDCLS_ENABLE_AUTOSTARTWITHCOLON },
+ { "+autostartwithcolon", SET_RESOURCE, 0, NULL, NULL, "AutostartRunWithColon", (resource_value_t)0,
+ 0, IDCLS_DISABLE_AUTOSTARTWITHCOLON },
+ { NULL }
+};
+#else
+static const cmdline_option_t cmdline_options[] =
+{
+ { "-autostartwithcolon", SET_RESOURCE, 0, NULL, NULL, "AutostartRunWithColon", (resource_value_t)1,
+ NULL, N_("On autostart, use the 'RUN' command with a colon, i.e., 'RUN:'") },
+ { "+autostartwithcolon", SET_RESOURCE, 0, NULL, NULL, "AutostartRunWithColon", (resource_value_t)0,
+ NULL, N_("On autostart, do not use the 'RUN' command with a colon; i.e., 'RUN'") },
+ { NULL }
+};
+#endif
+
+/*! \brief initialize the command-line options
+
+ \return
+ 0 on success, else -1.
+
+ \remark
+ Registers the command-line options
+*/
+int autostart_cmdline_options_init(void)
+{
+ return cmdline_register_options(cmdline_options);
+}
+
+/* ------------------------------------------------------------------------- */
+
/* Deallocate program name if we have one */
static void deallocate_program_name(void)
{
@@ -273,7 +357,7 @@
static void disk_attention_callback(void)
{
if (autostart_run_mode == AUTOSTART_MODE_RUN)
- kbdbuf_feed("RUN:\r");
+ kbdbuf_feed(AutostartRunCommand);
machine_bus_attention_callback_set(NULL);
@@ -333,7 +417,7 @@
switch (check("READY.", AUTOSTART_WAIT_BLINK)) {
case YES:
log_message(autostart_log, "Starting program.");
- kbdbuf_feed("RUN:\r");
+ kbdbuf_feed(AutostartRunCommand);
autostartmode = AUTOSTART_DONE;
break;
case NO:
@@ -382,7 +466,7 @@
if (!traps) {
if (autostart_run_mode == AUTOSTART_MODE_RUN)
- kbdbuf_feed("RUN:\r");
+ kbdbuf_feed(AutostartRunCommand);
autostartmode = AUTOSTART_DONE;
} else {
autostartmode = AUTOSTART_LOADINGDISK;
Modified: trunk/vice/src/autostart.h
===================================================================
--- trunk/vice/src/autostart.h 2008-07-07 17:55:09 UTC (rev 18966)
+++ trunk/vice/src/autostart.h 2008-07-07 18:15:00 UTC (rev 18967)
@@ -34,6 +34,9 @@
#define AUTOSTART_MODE_RUN 0
#define AUTOSTART_MODE_LOAD 1
+extern int autostart_resources_init(void);
+extern int autostart_cmdline_options_init(void);
+
extern int autostart_init(CLOCK min_cycles, int handle_drive_true_emulation,
int blnsw, int pnt, int pntr, int lnmx);
extern void autostart_shutdown(void);
Modified: trunk/vice/src/init.c
===================================================================
--- trunk/vice/src/init.c 2008-07-07 17:55:09 UTC (rev 18966)
+++ trunk/vice/src/init.c 2008-07-07 18:15:00 UTC (rev 18967)
@@ -29,6 +29,7 @@
#include "archdep.h"
#include "attach.h"
+#include "autostart.h"
#include "cmdline.h"
#include "console.h"
#include "debug.h"
@@ -81,6 +82,10 @@
init_resource_fail("system file locator");
return -1;
}
+ if (autostart_resources_init() < 0) {
+ init_resource_fail("autostart");
+ return -1;
+ }
if (romset_resources_init() < 0) {
init_resource_fail("romset");
return -1;
@@ -166,6 +171,10 @@
init_cmdline_options_fail("UI");
return -1;
}
+ if (autostart_cmdline_options_init() < 0) {
+ init_resource_fail("autostart");
+ return -1;
+ }
if (fliplist_cmdline_options_init() < 0) {
init_cmdline_options_fail("flip list");
return -1;
Modified: trunk/vice/src/translate.c
===================================================================
--- trunk/vice/src/translate.c 2008-07-07 17:55:09 UTC (rev 18966)
+++ trunk/vice/src/translate.c 2008-07-07 18:15:00 UTC (rev 18967)
@@ -657,6 +657,26 @@
/* ------------------------ COMMAND LINE OPTION STRINGS -------------------- */
+/* autostart.c */
+/* en */ {IDCLS_ENABLE_AUTOSTARTWITHCOLON, "On autostart, use the 'RUN' command with a colon, i.e., 'RUN:'"},
+/* de */ {IDCLS_ENABLE_AUTOSTARTWITHCOLON_DE, ""}, /* fuzzy */
+/* fr */ {IDCLS_ENABLE_AUTOSTARTWITHCOLON_FR, ""}, /* fuzzy */
+/* hu */ {IDCLS_ENABLE_AUTOSTARTWITHCOLON_HU, ""}, /* fuzzy */
+/* it */ {IDCLS_ENABLE_AUTOSTARTWITHCOLON_IT, ""}, /* fuzzy */
+/* nl */ {IDCLS_ENABLE_AUTOSTARTWITHCOLON_NL, ""}, /* fuzzy */
+/* pl */ {IDCLS_ENABLE_AUTOSTARTWITHCOLON_PL, ""}, /* fuzzy */
+/* sv */ {IDCLS_ENABLE_AUTOSTARTWITHCOLON_SV, ""}, /* fuzzy */
+
+/* autostart.c */
+/* en */ {IDCLS_DISABLE_AUTOSTARTWITHCOLON, "On autostart, do not use the 'RUN' command with a colon; i.e., 'RUN'"},
+/* de */ {IDCLS_DISABLE_AUTOSTARTWITHCOLON_DE, ""}, /* fuzzy */
+/* fr */ {IDCLS_DISABLE_AUTOSTARTWITHCOLON_FR, ""}, /* fuzzy */
+/* hu */ {IDCLS_DISABLE_AUTOSTARTWITHCOLON_HU, ""}, /* fuzzy */
+/* it */ {IDCLS_DISABLE_AUTOSTARTWITHCOLON_IT, ""}, /* fuzzy */
+/* nl */ {IDCLS_DISABLE_AUTOSTARTWITHCOLON_NL, ""}, /* fuzzy */
+/* pl */ {IDCLS_DISABLE_AUTOSTARTWITHCOLON_PL, ""}, /* fuzzy */
+/* sv */ {IDCLS_DISABLE_AUTOSTARTWITHCOLON_SV, ""}, /* fuzzy */
+
/* c128/c128-cmdline-options.c, c64/c64-cmdline-options.c,
c64/psid.c, plus4/plus4-cmdline-options.c,
vic20/vic20-cmdline-options.c */
Modified: trunk/vice/src/translate.txt
===================================================================
--- trunk/vice/src/translate.txt 2008-07-07 17:55:09 UTC (rev 18966)
+++ trunk/vice/src/translate.txt 2008-07-07 18:15:00 UTC (rev 18967)
@@ -163,6 +163,12 @@
/* COMMAND-LINE STRING ID DEFINITIONS */
+/* autostart.c */
+IDCLS_ENABLE_AUTOSTARTWITHCOLON
+
+/* autostart.c */
+IDCLS_DISABLE_AUTOSTARTWITHCOLON
+
/* c128/c128-cmdline-options.c, c64/c64-cmdline-options.c,
c64/psid.c, plus4/plus4-cmdline-options.c,
vic20/vic20-cmdline-options.c */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|