diff options
| author | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-18 00:31:54 +0200 |
|---|---|---|
| committer | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-18 00:31:54 +0200 |
| commit | 268a53de823a6750d6256ee1fb1e7707b4b45740 (patch) | |
| tree | 42c1799a9a82b2f7d9790ee9fe181d72a7274751 /sim/ucsim/gui.src/obsolete/portmon.src | |
| download | sdcc-gas-268a53de823a6750d6256ee1fb1e7707b4b45740.tar.gz | |
sdcc-3.9.0 fork implementing GNU assembler syntax
This fork aims to provide better support for stm8-binutils
Diffstat (limited to 'sim/ucsim/gui.src/obsolete/portmon.src')
| -rw-r--r-- | sim/ucsim/gui.src/obsolete/portmon.src/(c).1 | 25 | ||||
| -rw-r--r-- | sim/ucsim/gui.src/obsolete/portmon.src/Makefile.in | 131 | ||||
| -rw-r--r-- | sim/ucsim/gui.src/obsolete/portmon.src/clean.mk | 28 | ||||
| -rw-r--r-- | sim/ucsim/gui.src/obsolete/portmon.src/conf.mk | 12 | ||||
| -rw-r--r-- | sim/ucsim/gui.src/obsolete/portmon.src/pmapp.cc | 113 | ||||
| -rw-r--r-- | sim/ucsim/gui.src/obsolete/portmon.src/pmappcl.h | 48 | ||||
| -rw-r--r-- | sim/ucsim/gui.src/obsolete/portmon.src/port.cc | 143 | ||||
| -rw-r--r-- | sim/ucsim/gui.src/obsolete/portmon.src/portcl.h | 64 | ||||
| -rw-r--r-- | sim/ucsim/gui.src/obsolete/portmon.src/portmon.cc | 68 |
9 files changed, 632 insertions, 0 deletions
diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/(c).1 b/sim/ucsim/gui.src/obsolete/portmon.src/(c).1 new file mode 100644 index 0000000..d673f9f --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/(c).1 @@ -0,0 +1,25 @@ +/* + * Simulator of microcontrollers (@@F@@) + * + * Copyright (C) @@S@@,@@Y@@ 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. */ diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/Makefile.in b/sim/ucsim/gui.src/obsolete/portmon.src/Makefile.in new file mode 100644 index 0000000..0169421 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/Makefile.in @@ -0,0 +1,131 @@ +# +# uCsim gui.src/portmon.src/Makefile +# +# (c) Drotos Daniel, Talker Bt. 1999 +# + +SHELL = /bin/sh +CXX = @CXX@ +CPP = @CPP@ +CXXCPP = @CXXCPP@ +RANLIB = @RANLIB@ +INSTALL = @INSTALL@ +MAKEDEP = @MAKEDEP + +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +PKGDIR = ../ + +DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@) +CPPFLAGS = @CPPFLAGS@ -I. -I$(top_builddir) -I$(PKGDIR) +CFLAGS = @CFLAGS@ @WALL_FLAG@ +CXXFLAGS = @CXXFLAGS@ @WALL_FLAG@ + +LIBS = -L$(top_builddir) -L$(PKGDIR) -lgui @CURSES_LIBS@ -lutil @LIBS@ + +curses_ok = @curses_ok@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ +datadir = @datadir@ +includedir = @includedir@ +mandir = @mandir@ +man1dir = $(mandir)/man1 +man2dir = $(mandir)/man2 +infodir = @infodir@ +srcdir = @srcdir@ + +OBJECTS = portmon.o \ + pmapp.o port.o + + +# Compiling entire program or any subproject +# ------------------------------------------ +all: checkconf otherlibs portmon.src + + +# Compiling and installing everything and runing test +# --------------------------------------------------- +install: all installdirs + $(INSTALL) -s portmon $(bindir) + + +# Deleting all the installed files +# -------------------------------- +uninstall: + rm -f $(bindir)/portmon + + +# Performing self-test +# -------------------- +check: + + +# Performing installation test +# ---------------------------- +installcheck: + + +# Creating installation directories +# --------------------------------- +installdirs: + test -d $(bindir) || $(INSTALL) -d $(bindir) + + +# Creating dependencies +# --------------------- +dep: Makefile.dep + +Makefile.dep: $(srcdir)/*.cc $(top_builddir)/*.h $(PKGDIR)/*.h + $(MAKEDEP) $(CPPFLAGS) $(filter %.cc,$^) >Makefile.dep + +-include Makefile.dep +include clean.mk + +#parser.cc: parser.y + +#plex.cc: plex.l + +# My rules +# -------- +ifeq ($(curses_ok),yes) +portmon.src: portmon +else +portmon.src: +endif + +portmon: $(OBJECTS) $(top_builddir)/*.a $(PKGDIR)/*.a + $(CXX) $(CXXFLAGS) -o portmon $(OBJECTS) $(LIBS) + +ifeq ($(curses_ok),yes) +otherlibs: + $(MAKE) -C $(top_builddir) libs + $(MAKE) -C $(PKGDIR) libs +else +otherlibs: +endif + +.cc.o: + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@ + +.y.cc: + rm -f $*.cc $*.h + $(YACC) -d $< + mv y.tab.c $*.cc + mv y.tab.h $*.h + +.l.cc: + rm -f $*.cc + $(LEX) -t $< >$*.cc + + +# Remaking configuration +# ---------------------- +checkconf: + @if [ -f $(top_builddir)/devel ]; then\ + $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\ + fi + +# End of gui.src/portmon.src/Makefile.in diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/clean.mk b/sim/ucsim/gui.src/obsolete/portmon.src/clean.mk new file mode 100644 index 0000000..02760e9 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/clean.mk @@ -0,0 +1,28 @@ +# uCsim gui.src/portmon.src/clean.mk + +# Deleting all files created by building the program +# -------------------------------------------------- +clean: + rm -f *core *[%~] *.[oa] + rm -f .[a-z]*~ + rm -f portmon + + +# Deleting all files created by configuring or building the program +# ----------------------------------------------------------------- +distclean: clean + rm -f config.cache config.log config.status + rm -f Makefile *.dep + + +# Like clean but some files may still exist +# ----------------------------------------- +mostlyclean: clean + + +# Deleting everything that can reconstructed by this Makefile. It deletes +# everything deleted by distclean plus files created by bison, etc. +# ----------------------------------------------------------------------- +realclean: distclean + +# End of gui.src/portmon.src/clean.mk diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/conf.mk b/sim/ucsim/gui.src/obsolete/portmon.src/conf.mk new file mode 100644 index 0000000..fe3dcfe --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/conf.mk @@ -0,0 +1,12 @@ +# uCsim gui.src/portmon.src/conf.mk + +# +# Makefile targets to remake configuration +# + +freshconf: Makefile + +Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.ac + cd $(top_builddir) && $(SHELL) ./config.status + +# End of gui.src/portmon.src/conf.mk diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/pmapp.cc b/sim/ucsim/gui.src/obsolete/portmon.src/pmapp.cc new file mode 100644 index 0000000..2605a22 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/pmapp.cc @@ -0,0 +1,113 @@ +/* + * Simulator of microcontrollers (pmapp.cc) + * + * Copyright (C) 1999,99 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 "wincl.h" +#include "labelcl.h" + +#include "pmappcl.h" +#include "portcl.h" + + +int +cl_pmapp::mk_views(class cl_group *ins_to) +{ + class cl_view *v; + //class cl_win *w; + class cl_box *b; + + b= new cl_box(0,0,0,0); + + if (!ins_to) + return(0); + + b->set(43,2,14,13); + v= new cl_portw(b, 3, "Port #3", this); + v->init(); + ins_to->insert(v); + + b->set(29,2,14,13); + v= new cl_portw(b, 2, "Port #2", this); + v->init(); + ins_to->insert(v); + /* + b->set(15,2,14,13); + ins_to->insert(v= new cl_portw(b, 1, "Port #1", this)); + v->init(); + + b->set(1,2,14,13); + ins_to->insert(v= new cl_portw(b, 0, "Port #0", this)); + v->init(); + + b->set(59,3,19,11); + v= new cl_label(b, this, +"Next win: n,TAB\nPrev win: p\nCursor : u,d,l,r,\n arrows\nToggle : space,CR\nQuit : q"); + v->init(); + b->move_rel(-1,-1); + b->grow(2,2); + + b->set(58,2,21,13); + w= new cl_win(b, "Help", this); + w->options&= ~OF_SELECTABLE; + w->init(); + w->insert(v); + ins_to->insert(w); + w->draw(); + */ + delete b; + + return(0); +} + +int * +cl_pmapp::mk_palette(void) +{ + return(cl_app::mk_palette()); +} + +int +cl_pmapp::handle_event(struct t_event *event) +{ + if (event->what == EV_KEY) + switch (event->event.key) + { + case 'q': + event->what= EV_COMMAND; + event->event.msg.cmd= CMD_QUIT; + return(0); + case 'p': + desk->select_prev(); + return(1); + case 'n': case '\t': + desk->select_next(); + return(1); + + } + return(cl_app::handle_event(event)); +} + + +/* End of gui.src/portmon.src/pmapp.cc */ diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/pmappcl.h b/sim/ucsim/gui.src/obsolete/portmon.src/pmappcl.h new file mode 100644 index 0000000..d9f3011 --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/pmappcl.h @@ -0,0 +1,48 @@ +/* + * Simulator of microcontrollers (pmappcl.h) + * + * Copyright (C) 1999,99 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@*/ + +#ifndef PMAPPCL_HEADER +#define PMAPPCL_HEADER + +#include "appcl.h" + + +class cl_pmapp: public cl_app +{ +public: + cl_pmapp(char *iname): cl_app(iname) {} + + virtual int mk_views(class cl_group *ins_to); + virtual int *mk_palette(void); + + virtual int handle_event(struct t_event *event); +}; + + +#endif + +/* End of gui.src/portmon.src/pmappcl.h */ diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/port.cc b/sim/ucsim/gui.src/obsolete/portmon.src/port.cc new file mode 100644 index 0000000..010ec3e --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/port.cc @@ -0,0 +1,143 @@ +/*@1@*/ + +#include "portcl.h" + + +/* + * Viewer of the port + */ + +cl_port::cl_port(class cl_box *ipos, int iid, char *iname, class cl_app *iapp): + cl_view(ipos, iname, iapp) +{ + id= iid; + sfr= 0; + pin= 0; + curs_x= curs_y= 0; +} + +int +cl_port::draw(void) +{ + int x, y, mask, hc, nc; + + cl_view::draw(); + + nc= hc= get_color(C_WIN_NORMAL); + if (state & SF_SELECTED) + hc= get_color(C_WIN_SELECTED); + mvwprintw(window, 0,0, "SFR PORT PIN"); + for (x= 0, mask= 0x80, y= 1; mask; mask>>= 1,y++) + { + wattrset(window, (curs_x)?nc:(curs_y==y-1?hc:nc)); + mvwprintw(window, y,x, " %c", (sfr&mask)?'1':'0'); + } + wattrset(window, nc); + for (x= 5, mask= 0x80, y= 1; mask; mask>>= 1,y++) + mvwprintw(window, y,x, "%c", (sfr&pin&mask)?'1':'0'); + for (x=9, mask= 0x80, y= 1; mask; mask>>= 1,y++) + { + wattrset(window, curs_x?(curs_y==y-1?hc:nc):nc); + mvwprintw(window, y,x, "%c ", (pin&mask)?'1':'0'); + } + wattrset(window, nc); + mvwprintw(window, 9,0, "0x%02x 0x%02x", sfr, pin); + mvwprintw(window, 10,4, "0x%02x", sfr&pin); + app->drawn++; + return(0); +} + +int +cl_port::handle_event(struct t_event *event) +{ + if (event->what == EV_KEY) + switch (event->event.key) + { + case KEY_HOME: + curs_y= 0; draw(); return(1); + case KEY_A1: + curs_x= curs_y= 0; draw(); return(1); + case KEY_A3: + curs_y= 0; curs_x= 1; draw(); return(1); + case KEY_C1: + curs_x= 0; curs_y= 7; draw(); return(1); + case KEY_C3: + curs_x= 1; curs_y= 7; draw(); return(1); + case KEY_LEFT: case KEY_RIGHT: case 'j': case 'k': case 'l': case 'r': + if (curs_x) + curs_x= 0; + else + curs_x= 1; + draw(); + return(1); + case KEY_UP: case 'u': + curs_y--; + if (curs_y < 0) + curs_y= 7; + draw(); + return(1); + case KEY_DOWN: case 'd': + curs_y++; + if (curs_y > 7) + curs_y= 0; + draw(); + return(1); + case ' ': case '\n': case '\r': + if (curs_x) + toggle_pin(7-curs_y); + else + toggle_sfr(7-curs_y); + return(1); + } + return(cl_view::handle_event(event)); +} + +int +cl_port::toggle_sfr(int bitnr) +{ + int mask= 1<<bitnr; + sfr^= mask; + draw(); + return(0); +} + +int +cl_port::toggle_pin(int bitnr) +{ + int mask= 1<<bitnr; + pin^= mask; + draw(); + return(0); +} + +/* + * Window to show port viewer + ****************************************************************************** + */ + +cl_portw::cl_portw(class cl_box *ipos, int iid, char *ititle, + class cl_app *iapp): + cl_win(ipos, ititle, iapp) +{ + id= iid; +} + +class cl_view * +cl_portw::mk_intern(class cl_box *ipos) +{ + char n[100]= ""; + + sprintf(n, "port%dviewer", id); + class cl_view *v= new cl_port(ipos, id, n, app); + v->init(); + return(v); +} + +int +cl_portw::handle_event(struct t_event *event) +{ + return(cl_win::handle_event(event)); +} + + +/* End of gui.src/portmap.src/port.cc */ diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/portcl.h b/sim/ucsim/gui.src/obsolete/portmon.src/portcl.h new file mode 100644 index 0000000..760f0ad --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/portcl.h @@ -0,0 +1,64 @@ +/* + * Simulator of microcontrollers (portcl.h) + * + * Copyright (C) 1999,99 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@*/ + +#ifndef PORTCL_HEADER +#define PORTCL_HEADER + +#include "viewcl.h" +#include "wincl.h" + + +class cl_port: public cl_view +{ +public: + int id; + int sfr, pin; + int curs_x, curs_y; +public: + cl_port(class cl_box *ipos, int iid, char *iname, class cl_app *iapp); + + virtual int draw(void); + virtual int handle_event(struct t_event *event); + int toggle_sfr(int bitnr); + int toggle_pin(int bitnr); +}; + +class cl_portw: public cl_win +{ +public: + int id; +public: + cl_portw(class cl_box *ipos, int iid, char *ititle, class cl_app *iapp); + virtual class cl_view *mk_intern(class cl_box *ipos); + + virtual int handle_event(struct t_event *event); +}; + + +#endif + +/* End of gui.src/portmon.src/portcl.h */ diff --git a/sim/ucsim/gui.src/obsolete/portmon.src/portmon.cc b/sim/ucsim/gui.src/obsolete/portmon.src/portmon.cc new file mode 100644 index 0000000..50d3b3a --- /dev/null +++ b/sim/ucsim/gui.src/obsolete/portmon.src/portmon.cc @@ -0,0 +1,68 @@ +/* + * Simulator of microcontrollers (portmon.cc) + * + * Copyright (C) 1999,99 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 <curses.h> + +#include "pmappcl.h" + + +class cl_pmapp *app; + +void xx(class cl_view *v) +{ + fprintf(stderr,"%s 0x%x ", v->name, v->state); +} + +int +main(int argc, char *argv) +{ + app= new cl_pmapp("portmon"); + app->init(); + { + class cl_view *v= app; + while (v) + { + if (v->is_group()) + { + class cl_group *g= (class cl_group *)v; + fprintf(stderr, "%s->%s\n", g->name,(g->current)?(g->current->name):"none"); + g->for_each(xx); + fprintf(stderr, "\n"); + v= g->current; + } + else + v= 0; + } + } + app->run(); + //getch(); + delete app; + return(0); +} + + +/* End of gui.src/portmon.src/portmon.cc */ |
