Version 0.3.0
authordrdani <drdani@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 18 Jun 2001 09:22:23 +0000 (09:22 +0000)
committerdrdani <drdani@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 18 Jun 2001 09:22:23 +0000 (09:22 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@903 4a8a32a2-be11-0410-ad9d-d568d2c75423

27 files changed:
sim/ucsim/.version
sim/ucsim/Makefile
sim/ucsim/avr.src/savr.cc
sim/ucsim/avr.src/simavr.cc
sim/ucsim/avr.src/simavrcl.h
sim/ucsim/cmd.src/newcmd.cc
sim/ucsim/cmd.src/newcmdcl.h
sim/ucsim/main_in.mk
sim/ucsim/s51.src/s51.cc
sim/ucsim/s51.src/sim51.cc
sim/ucsim/s51.src/sim51cl.h
sim/ucsim/s51.src/test_extit.c
sim/ucsim/s51.src/test_idlepd.c
sim/ucsim/s51.src/test_ser.c
sim/ucsim/s51.src/uc51.cc
sim/ucsim/sim.src/Makefile.in
sim/ucsim/sim.src/app.cc
sim/ucsim/sim.src/appcl.h
sim/ucsim/sim.src/mem.cc
sim/ucsim/sim.src/memcl.h
sim/ucsim/sim.src/sim.cc
sim/ucsim/sim.src/simcl.h
sim/ucsim/sim.src/test_mem_speed.cc [new file with mode: 0644]
sim/ucsim/ucsim.cc [new file with mode: 0644]
sim/ucsim/z80.src/simz80.cc
sim/ucsim/z80.src/simz80cl.h
sim/ucsim/z80.src/sz80.cc

index 12ebfcf73fa86cc610dbf941477ba520f4b5a9dd..0d91a54c7d439e84e3dd17d3594f1b2b6737f430 100644 (file)
@@ -1 +1 @@
-0.2.39
+0.3.0
index d59300c1053b3edb8ce5edc062b462dbc13af477..27fd11dffefa8ff306f8e5d2f1dc4bcc7a9238e0 100644 (file)
@@ -21,6 +21,7 @@ all: checkconf
        @for pkg in $(PKGS); do\
          cd $$pkg && $(MAKE) $$pkg ; cd ..;\
        done
+       $(MAKE) -f main.mk main_app
 
 libs: main.mk
        $(MAKE) -f main.mk libs
index 6776fe395b23157f23340985f01ee999f37e4110..6932c2cc515eb9ca59dc7a20a7d6b786dd8650f9 100644 (file)
@@ -27,20 +27,26 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include <stdio.h>
 
-#include "globals.h"
+// sim.src
+#include "appcl.h"
 
+// local
 #include "simavrcl.h"
 
 
 int
 main(int argc, char *argv[])
 {
+  class cl_app *app;
   class cl_sim *sim;
   
-  sim= new cl_simavr(argc, argv);
+  app= new cl_app();
+  app->init();
+  sim= new cl_simavr(app, argc, argv);
   sim->init();
+  app->set_simulator(sim);
   sim->main();
-  delete sim;
+  delete app;
   return(0);
 }
 
index bb885512f3c4cfe422fa5c936443268de3aef947..e337290477d42f8c2b09340ea847548fe1a1cff0 100644 (file)
@@ -28,12 +28,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include <ctype.h>
 
+// sim.src
+#include "appcl.h"
+
+// local
 #include "simavrcl.h"
 #include "avrcl.h"
 
 
-cl_simavr::cl_simavr(int iargc, char *iargv[]):
-  cl_sim("h", iargc, iargv)
+cl_simavr::cl_simavr(class cl_app *the_app, int iargc, char *iargv[]):
+  cl_sim(the_app, "h", iargc, iargv)
 {}
 
 
index 34bbe94aaf1263d27c5d801893006fc6b9552c28..f0bd44674a292314b8f25840d9386d001715c450 100644 (file)
@@ -34,7 +34,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 class cl_simavr: public cl_sim
 {
 public:
-  cl_simavr(int iargc, char *iargv[]);
+  cl_simavr(class cl_app *the_app, int iargc, char *iargv[]);
   virtual int proc_arg(char optopt, char *optarg);
 
   virtual class cl_uc *mk_controller(void);
index c1ca1db61f3281cb81d2a209f7b50f4f0ce422f0..a01073181003da01739fc107f326bc161596df24 100644 (file)
@@ -51,6 +51,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 // sim
 #include "simcl.h"
 #include "argcl.h"
+#include "appcl.h"
 
 // local
 #include "newcmdcl.h"
@@ -984,7 +985,7 @@ cl_console::read_line(void)
 }
 
 int
-cl_console::proc_input(class cl_cmdset *cmdset)
+cl_console::proc_input(class cl_app *app, class cl_cmdset *cmdset)
 {
   int retval= 0;
 
@@ -1008,7 +1009,12 @@ cl_console::proc_input(class cl_cmdset *cmdset)
       class cl_cmd *cm;
       cmdline= new cl_cmdline(cmdstr, this);
       cmdline->init();
-      cm= cmdset->get_cmd(cmdline);
+      cm= 0;
+      if (app)
+       cm= app->get_cmd(cmdline);
+      if (cm == 0 &&
+         cmdset)
+       cm= cmdset->get_cmd(cmdline);
       if (cm)
        retval= cm->work(sim, cmdline, this);
       delete cmdline;
@@ -1099,9 +1105,11 @@ cl_listen_console::proc_input(class cl_cmdset *cmdset)
  *____________________________________________________________________________
  */
 
-cl_commander::cl_commander(class cl_cmdset *acmdset, class cl_sim *asim):
+cl_commander::cl_commander(class cl_app *the_app,
+                          class cl_cmdset *acmdset, class cl_sim *asim):
   cl_base()
 {
+  app= the_app;
   cons= new cl_list(1, 1); 
   actual_console= frozen_console= 0;
   cmdset= acmdset;
@@ -1353,7 +1361,7 @@ cl_commander::proc_input(void)
            if (c->match(i))
              {
                actual_console= c;
-               int retval= c->proc_input(cmdset);
+               int retval= c->proc_input(app, cmdset);
                if (retval)
                  {
                    del_console(c);
index 7a8500ae1fdad2b6e35ee84fbd49358f25b63afb..c0693331efadca2117add80e658a2943188eeb31 100644 (file)
@@ -240,7 +240,7 @@ public:
   virtual int  get_in_fd(void);
   virtual int  input_avail(void);
   virtual char *read_line(void);
-  virtual int  proc_input(class cl_cmdset *cmdset);
+  virtual int  proc_input(class cl_app *app, class cl_cmdset *cmdset);
   virtual bool interpret(char *cmd);
 };
 
@@ -269,6 +269,7 @@ public:
 class cl_commander: public cl_base
 {
 public:
+  class cl_app *app;
   class cl_list *cons;
   fd_set read_set, active_set;
   int fd_num;
@@ -277,7 +278,8 @@ public:
   class cl_cmdset *cmdset;
 
 public:
-  cl_commander(class cl_cmdset *acmdset, class cl_sim *asim);
+  cl_commander(class cl_app *the_app,
+              class cl_cmdset *acmdset, class cl_sim *asim);
   ~cl_commander(void);
   virtual int init(void);
 
index d3d7800ada95d1415f63268a54dda8aa578f886e..b9e4c989a670fd9f2d4d20fa239516f9319051a0 100644 (file)
@@ -14,14 +14,17 @@ RANLIB              = @RANLIB@
 INSTALL                = @INSTALL@
 
 PRJDIR         = .
+SIMDIR         = sim.src
 
 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
 # FIXME: -Imcs51 must be removed!!!
-CPPFLAGS        = @CPPFLAGS@ -I$(PRJDIR)
+CPPFLAGS        = @CPPFLAGS@ -I$(PRJDIR) -I$(PRJDIR)/$(SIMDIR)
 CFLAGS          = @CFLAGS@ -I$(PRJDIR) -Wall
 CXXFLAGS        = @CXXFLAGS@ -I$(PRJDIR) -Wall
 M_OR_MM         = @M_OR_MM@
 
+UCSIM_LIBS     = -lsim -lcmd -lutil
+
 prefix          = @prefix@
 exec_prefix     = @exec_prefix@
 bindir          = @bindir@
@@ -35,6 +38,10 @@ infodir         = @infodir@
 srcdir          = @srcdir@
 
 OBJECTS         = pobj.o globals.o utils.o
+SOURCES                = $(patsubst %.o,%.cc,$(OBJECTS))
+UCSIM_OBJECTS  = ucsim.o
+UCSIM_SOURCES  = $(patsubst %.o,%.cc,$(UCSIM_OBJECTS))
+ALL_SOURCES    = $(SOURCES) $(UCSIM_SOURCES)
 
 
 # Compiling entire program or any subproject
@@ -43,6 +50,8 @@ all: checkconf libs
 
 libs: libutil.a
 
+main_app: checkconf ucsim_app
+
 # Compiling and installing everything and runing test
 # ---------------------------------------------------
 install: all installdirs
@@ -76,8 +85,8 @@ installdirs:
 # ---------------------
 dep: main.dep
 
-main.dep: *.cc *.h
-       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >main.dep
+main.dep: $(ALL_SOURCES) *.h
+       $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(ALL_SOURCES) >main.dep
 
 include main.dep
 include clean.mk
@@ -88,11 +97,15 @@ include clean.mk
 
 # My rules
 # --------
-
 libutil.a: $(OBJECTS)
        ar -rcu $*.a $(OBJECTS)
        $(RANLIB) $*.a
 
+ucsim_app: libs ucsim
+
+ucsim: $(UCSIM_OBJECTS) $()
+       $(CXX) $(CXXFLAGS) -o $@ $< -L$(PRJDIR) $(UCSIM_LIBS)
+
 .cc.o:
        $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
 
index 117a1ecbb2d3c0c0a4a32eeb50cb91b26af405b9..50a80e0aab6236f59279f47afe73668564e29d81 100644 (file)
@@ -27,10 +27,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include "ddconfig.h"
 
-//#include <stdio.h>
-
-//#include "globals.h"
+// sim.src
+#include "appcl.h"
 
+// local
 #include "sim51cl.h"
 
 
@@ -42,13 +42,17 @@ int
 main(int argc, char *argv[])
 {
   int retval;
+  class cl_app *app;
   class cl_sim *sim;
   
-  sim= new cl_sim51(argc, argv);
+  app= new cl_app();
+  app->init();
+  sim= new cl_sim51(app, argc, argv);
   if (sim->init())
     return(1);
+  app->set_simulator(sim);
   retval= sim->main();
-  delete sim;
+  delete app;
   
   return(retval);
 }
index 7b40348951be0a7dc7278d0503f6df8eb7ad7578..811c862c5d9011aeb915d0e4c2a9c2ba39a2a4c3 100644 (file)
@@ -50,8 +50,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "glob.h"
 
 
-cl_sim51::cl_sim51(int iargc, char *iargv[]):
-  cl_sim("t:s:S:hHk:", iargc, iargv)
+cl_sim51::cl_sim51(class cl_app *the_app, int iargc, char *iargv[]):
+  cl_sim(the_app, "t:s:S:hHk:", iargc, iargv)
 {}
 
 static void
index e15cd2d31b7733f6c061f16b5ff923ce6bbf6a19..0365ab1d892a088080c614d39ba97dc90b8339cb 100644 (file)
@@ -34,7 +34,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 class cl_sim51: public cl_sim
 {
 public:
-  cl_sim51(int iargc, char *iargv[]);
+  cl_sim51(class cl_app *the_app, int iargc, char *iargv[]);
   virtual int proc_arg(char optopt, char *optarg);
   virtual class cl_uc *mk_controller(void);
 };
index a3d7060e9e0d76b259a759be6a90e37b6727b02d..f61fd41fc7c61dc2e6e798342af1017824c126fb 100644 (file)
@@ -1,4 +1,4 @@
-#include <8051.h>
+#include <reg51.h>
 
 sfr at 0xa6 WDTRST;
 
index 59b2f6eb08956dd369dd2dfab8cc4f177a75dd95..56b6aaaa0f9e6c6ffece84e15c9d872977fe5ef1 100644 (file)
@@ -1,4 +1,4 @@
-#include <8051.h>
+#include <reg51.h>
 
 sfr at 0xa6 WDTRST;
 
index cac1c03f0288fb35b4431f6ce12ebff209391a35..1af12abc9bd6ba62941c02aa7f49d1fbde37d99d 100644 (file)
@@ -1,4 +1,4 @@
-#include <8051.h>
+#include <reg51.h>
 
 #define BUFSIZE 16
 #define T0H 0xfc
index 99e01aa19d8acfee17c369e53fc753c8817ee54a..8f64eb2a84669238a9c4311fab89c66c153499eb 100644 (file)
@@ -1219,9 +1219,10 @@ t_uc51::do_timer0(int cycles)
                  // mod 0, TH= 8 bit t/c, TL= 5 bit precounter
                  //(MEM(MEM_SFR)[TL0])++;
                  sfr->add(TL0, 1);
-                 if (sfr->get(TL0) > 0x1f)
+                 if ((sfr->get(TL0) & 0x1f) == 0)
                    {
-                     sfr->set_bit0(TL0, ~0x1f);
+                     //sfr->set_bit0(TL0, ~0x1f);
+                     sfr->set(TL0, 0);
                      if (!/*++(MEM(MEM_SFR)[TH0])*/sfr->add(TH0, 1))
                        {
                          sfr->set_bit1(TCON, bmTF0);
@@ -1333,9 +1334,10 @@ t_uc51::do_timer1(int cycles)
              while (cycles--)
                {
                  // mod 0, TH= 8 bit t/c, TL= 5 bit precounter
-                 if (/*++(MEM(MEM_SFR)[TL1])*/sfr->add(TL1, 1) > 0x1f)
+                 if (/*++(MEM(MEM_SFR)[TL1])*/(sfr->add(TL1, 1) & 0x1f) == 0)
                    {
-                     sfr->set_bit0(TL1, ~0x1f);
+                     //sfr->set_bit0(TL1, ~0x1f);
+                     sfr->set(TL1, 0);
                      if (!/*++(MEM(MEM_SFR)[TH1])*/sfr->add(TH1, 1))
                        {
                          sfr->set_bit1(TCON, bmTF1);
index f01b32f408c4efd9dc9d680bf6c3f832f435e7de..8eeeb05a07677a895ac9a6a1b2c5c69846ca3b05 100644 (file)
@@ -40,7 +40,10 @@ OBJECTS         = app.o sim.o itsrc.o brk.o option.o arg.o stack.o \
 
 # Compiling entire program or any subproject
 # ------------------------------------------
-all: checkconf sim_lib
+all: checkconf sim_lib test_mem_speed
+
+test_mem_speed: test_mem_speed.o
+       $(CC) -o $@ $< -L$(PRJDIR) -lsim -lutil
 
 sim.src: all
 
index 27faec2fbb01eb9d81bbe5d496853b3c94e40cba..873bab1743df47c4ad5aa7bc3afdaccf50f8676f 100644 (file)
@@ -31,6 +31,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 // prj
 #include "i_string.h"
 
+// sim.src
+#include "simcl.h"
+
 // local
 #include "appcl.h"
 
@@ -39,7 +42,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
  * Program options
  */
 
-cl_option::cl_option(int atype, char sn, char *ln)
+/*cl_option::cl_option(int atype, char sn, char *ln)
 {
   type= atype;
   short_name= sn;
@@ -70,14 +73,14 @@ cl_option::get_value(int index)
   if (index > values->count - 1)
     return(0);
   return((char*)(values->at(index)));
-}
+}*/
 
 /* List of options */
 
-cl_options::cl_options(void):
+/*cl_options::cl_options(void):
   cl_list(2, 2)
 {
-}
+}*/
 
 
 /*
@@ -87,12 +90,71 @@ cl_options::cl_options(void):
 
 cl_app::cl_app(void)
 {
-  options= new cl_options();
+  //options= new cl_options();
+  sim= 0;
 }
 
 cl_app::~cl_app(void)
 {
-  delete options;
+  //delete options;
+  remove_simulator();
+}
+
+int
+cl_app::init(void)
+{
+  cl_base::init();
+
+  return(0);
+}
+
+/* Main cycle */
+
+int
+cl_app::run(void)
+{
+  return(0);
+}
+
+void
+cl_app::done(void)
+{
+}
+
+
+/* Command handling */
+
+class cl_cmd *
+cl_app::get_cmd(class cl_cmdline *cmdline)
+{
+  return(0);
+}
+
+
+/* Adding and removing comonents */
+
+void
+cl_app::set_simulator(class cl_sim *simulator)
+{
+  if (sim)
+    remove_simulator();
+  sim= simulator;
+  
+}
+
+void
+cl_app::remove_simulator(void)
+{
+  if (!sim)
+    return;
+  delete sim;
+  sim= 0;
+}
+
+void
+cl_app::build_cmdset(class cl_cmdset *cs)
+{
+  
 }
 
 
index e1e4e3ddcf852e293b04b17918d91fb43355a314..610eba30974407c50d95e79477c4c56635203d62 100644 (file)
@@ -44,7 +44,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #define OPT_Z80                0x0040
 #define OPT_TARGET     (OPT_51|OPT_AVR|OPT_Z80)
 
-class cl_option: public cl_base
+/*class cl_option: public cl_base
 {
 public:
   int type;    // See OPT_XXX
@@ -64,19 +64,36 @@ class cl_options: public cl_list
 {
 public:
   cl_options(void);
-};
+};*/
 
 
 /* Application */
 
 class cl_app: public cl_base
 {
-public:
-  class cl_options *options;
+protected:
+  //class cl_options *options;
+  class cl_sim *sim;
+  class cl_cmdset *cmdset;
 
 public:
   cl_app(void);
   ~cl_app(void);
+
+public:
+  virtual int init(void);
+  virtual int run(void);
+  virtual void done(void);
+
+public:
+  virtual class cl_cmd *get_cmd(class cl_cmdline *cmdline);
+
+public:
+  virtual void set_simulator(class cl_sim *simulator);
+  virtual void remove_simulator(void);
+
+protected:
+  virtual void build_cmdset(class cl_cmdset *cs);
 };
 
 
index 5c9aa49f096bc4ce32a99233fae6a0aef9397c83..11c20563d22bbd117149a522aba8e19dd8e7b732 100644 (file)
@@ -127,6 +127,21 @@ cl_memloc_coll::get_loc(t_addr address)
 }
 
 
+/*
+ */
+
+cl_cell::cl_cell(void):
+  cl_base()
+{
+  data= 0;
+}
+
+cl_cell::cl_cell(t_mem idata):
+  cl_base()
+{
+  data= idata;
+}
+
 /*
  * Memory
  ******************************************************************************
index 3e0dcf7552d4239165f88317c27ad7b1b7dc1a43..2ccd3bf36dbe6ef60fcf95ef64e14a0d63d4eef8 100644 (file)
@@ -64,6 +64,16 @@ public:
 };
 
 
+class cl_cell: public cl_base
+{
+public:
+  t_mem data;
+  
+public:
+  cl_cell(void);
+  cl_cell(t_mem idata);
+};
+
 /* Memory */
 
 class cl_mem: public cl_guiobj
index b80e8cae7f4038a24232819a74c445c9d2087b66..73e1d6397aac8f39005692e39ac584c213aa5780 100644 (file)
@@ -58,9 +58,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
  * Simulator
  */
 
-cl_sim::cl_sim(char *more_args, int iargc, char *iargv[]):
+cl_sim::cl_sim(class cl_app *the_app,
+              char *more_args, int iargc, char *iargv[]):
   cl_base()
 {
+  app= the_app;
   argc= iargc; argv= iargv;
   uc= 0;
   cmd= 0;
@@ -83,7 +85,7 @@ cl_sim::init(void)
   if (!(uc= mk_controller()))
     return(1);
   uc->init();
-  cmd= new cl_commander(cmdset, this);
+  cmd= new cl_commander(app, cmdset, this);
   cmd->init();
   char *Config= get_sarg(0, "Config");
   if (Config)
index f4fbec207d44121c535c0adb6ca953f060933ed0..9a7b0f296e0cb5e63b8bb389068b41c031899f37 100644 (file)
@@ -46,6 +46,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 class cl_sim: public cl_base
 {
+protected:
+  class cl_app *app;
 public:
   int state; // See SIM_XXXX
   int argc; char **argv;
@@ -59,7 +61,7 @@ public:
   class cl_list *arguments;
   
 public:
-  cl_sim(char *more_args, int iargc, char *iargv[]);
+  cl_sim(class cl_app *the_app, char *more_args, int iargc, char *iargv[]);
   ~cl_sim(void);
   virtual int init(void);
   
diff --git a/sim/ucsim/sim.src/test_mem_speed.cc b/sim/ucsim/sim.src/test_mem_speed.cc
new file mode 100644 (file)
index 0000000..05a046a
--- /dev/null
@@ -0,0 +1,18 @@
+#include "memcl.h"
+
+int
+main(void)
+{
+  class cl_mem *mem;
+  t_addr a;
+  t_mem d;
+
+  mem= new cl_mem(MEM_SFR, "egy", 0x10000, 8);
+  for (a= 0; a < mem->size; a++)
+    {
+      t_mem d2= a;
+      mem->write(a, &d2);
+      d= mem->read(a);
+    }
+  return(0);
+}
diff --git a/sim/ucsim/ucsim.cc b/sim/ucsim/ucsim.cc
new file mode 100644 (file)
index 0000000..145b799
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Simulator of microcontrollers (ucsim.cc)
+ *
+ * Copyright (C) 2001,01 Drotos Daniel, Talker Bt.
+ * 
+ * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
+ *
+ */
+
+/* This file is part of microcontroller simulator: ucsim.
+
+UCSIM is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+UCSIM is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with UCSIM; see the file COPYING.  If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+/*@1@*/
+
+#include "appcl.h"
+
+int
+main(int argc, char *argv[])
+{
+  class cl_app *app;
+  int ret;
+
+  app= new cl_app();
+  app->init();
+  ret= app->run();
+  app->done();
+  return(ret);
+}
+
+/* End of sim.src/ucsim.cc */
index 6a66e2bdfac85c97d75b8b23f675588aaf7199c4..5da4084fe0104860ecbff5176962ad60e03bd720 100644 (file)
@@ -26,12 +26,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 /*@1@*/
 
 
+// local
 #include "simz80cl.h"
 #include "z80cl.h"
 
 
-cl_simz80::cl_simz80(char *more_args, int iargc, char *iargv[]):
-  cl_sim(more_args, iargc, iargv)
+cl_simz80::cl_simz80(class cl_app *the_app,
+                    char *more_args, int iargc, char *iargv[]):
+  cl_sim(the_app, more_args, iargc, iargv)
 {}
 
 class cl_uc *
index 022b87b885eb86114be0e91fe1f9a33c4426b67d..9ccaa6bb5c609a62b9009a7940ea07ec725e2d94 100644 (file)
@@ -34,7 +34,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 class cl_simz80: public cl_sim
 {
 public:
-  cl_simz80(char *more_args, int iargc, char *iargv[]);
+  cl_simz80(class cl_app *the_app, char *more_args, int iargc, char *iargv[]);
 
   virtual class cl_uc *mk_controller(void);
 };
index 9668b567f3e0bf9ee53596cb1012a62a32646c6f..5de66781cd431f3b63616b5b1a09cfb7fd43a06d 100644 (file)
@@ -25,20 +25,26 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA. */
 /*@1@*/
 
-#include <stdio.h>
-
-#include "globals.h"
+// sim.src
+#include "appcl.h"
 
+// local
 #include "simz80cl.h"
 
 
 int
 main(int argc, char *argv[])
 {
-  class cl_sim *sim= new cl_simz80(0, argc, argv);
+  class cl_app *app;
+  class cl_sim *sim;
+
+  app= new cl_app();
+  app->init();
+  sim= new cl_simz80(app, 0, argc, argv);
   sim->init();
+  app->set_simulator(sim);
   sim->main();
-  delete sim;
+  delete app;
   return(0);
 }