Subversion Repositories shark

Compare Revisions

Regard whitespace Rev 1217 → Rev 1216

/demos/tags/rel_1_21/svgademo/initfile.c
File deleted
/demos/tags/rel_1_21/svgademo/svgademo.c
File deleted
/demos/tags/rel_1_21/svgademo/readme.txt
File deleted
/demos/tags/rel_1_21/svgademo/makefile
File deleted
/demos/tags/rel_1_21/loader/loader.c
File deleted
/demos/tags/rel_1_21/loader/dosread.h
File deleted
/demos/tags/rel_1_21/loader/loadfile.txt
File deleted
/demos/tags/rel_1_21/loader/parser.c
File deleted
/demos/tags/rel_1_21/loader/makefile
File deleted
/demos/tags/rel_1_21/loader/parser.h
File deleted
/demos/tags/rel_1_21/loader/dosread.c
File deleted
/demos/tags/rel_1_21/loader/fsfinit.c
File deleted
/demos/tags/rel_1_21/loader/initfile.c
File deleted
/demos/tags/rel_1_21/jumpball/rrn.c
File deleted
/demos/tags/rel_1_21/jumpball/rrp.c
File deleted
/demos/tags/rel_1_21/jumpball/demo.c
File deleted
/demos/tags/rel_1_21/jumpball/ern.c
File deleted
/demos/tags/rel_1_21/jumpball/ecp.c
File deleted
/demos/tags/rel_1_21/jumpball/jetctrl.c
File deleted
/demos/tags/rel_1_21/jumpball/demo.h
File deleted
/demos/tags/rel_1_21/jumpball/readme.txt
File deleted
/demos/tags/rel_1_21/jumpball/ball.c
File deleted
/demos/tags/rel_1_21/jumpball/makefile
File deleted
/demos/tags/rel_1_21/slsh/slshtest.c
File deleted
/demos/tags/rel_1_21/slsh/slsh.c
File deleted
/demos/tags/rel_1_21/slsh/readme.txt
File deleted
/demos/tags/rel_1_21/slsh/makefile
File deleted
/demos/tags/rel_1_21/slsh/slshinit.c
File deleted
/demos/tags/rel_1_21/slsh/slsh.h
File deleted
/demos/tags/rel_1_21/eli/eli.h
File deleted
/demos/tags/rel_1_21/eli/initfile.c
File deleted
/demos/tags/rel_1_21/eli/eli.c
File deleted
/demos/tags/rel_1_21/eli/makefile
File deleted
/demos/tags/rel_1_21/eli/draw.c
File deleted
/demos/tags/rel_1_21/base/sched.c
File deleted
/demos/tags/rel_1_21/base/fly.c
File deleted
/demos/tags/rel_1_21/base/talk.c
File deleted
/demos/tags/rel_1_21/base/makefile
File deleted
/demos/tags/rel_1_21/base/cabs.dat
File deleted
/demos/tags/rel_1_21/base/aster1.c
File deleted
/demos/tags/rel_1_21/base/jointest.c
File deleted
/demos/tags/rel_1_21/base/aster2.c
File deleted
/demos/tags/rel_1_21/base/aster3.c
File deleted
/demos/tags/rel_1_21/base/aster4.c
File deleted
/demos/tags/rel_1_21/base/isemdemo.c
File deleted
/demos/tags/rel_1_21/base/aster5.c
File deleted
/demos/tags/rel_1_21/base/aster6.c
File deleted
/demos/tags/rel_1_21/base/aster7.c
File deleted
/demos/tags/rel_1_21/base/aster8.c
File deleted
/demos/tags/rel_1_21/base/cabs.c
File deleted
/demos/tags/rel_1_21/base/iaster1.c
File deleted
/demos/tags/rel_1_21/base/srpdemo.c
File deleted
/demos/tags/rel_1_21/base/imdemo.c
File deleted
/demos/tags/rel_1_21/base/iaster3.c
File deleted
/demos/tags/rel_1_21/base/ego.c
File deleted
/demos/tags/rel_1_21/base/iaster4.c
File deleted
/demos/tags/rel_1_21/base/preempt.c
File deleted
/demos/tags/rel_1_21/base/ihello.c
File deleted
/demos/tags/rel_1_21/base/iaster6.c
File deleted
/demos/tags/rel_1_21/base/iaster7.c
File deleted
/demos/tags/rel_1_21/base/aster.c
File deleted
/demos/tags/rel_1_21/base/iaster8.c
File deleted
/demos/tags/rel_1_21/base/pcidemo.c
File deleted
/demos/tags/rel_1_21/base/sig.c
File deleted
/demos/tags/rel_1_21/base/keycode.c
File deleted
/demos/tags/rel_1_21/base/semdemo.c
File deleted
/demos/tags/rel_1_21/base/time.c
File deleted
/demos/tags/rel_1_21/base/intsem.c
File deleted
/demos/tags/rel_1_21/base/isched.c
File deleted
/demos/tags/rel_1_21/base/mdemo.c
File deleted
/demos/tags/rel_1_21/base/hello.c
File deleted
/demos/tags/rel_1_21/base/initfile.c
File deleted
/demos/tags/rel_1_21/base/pcdemo.c
File deleted
/demos/tags/rel_1_21/base/readme
File deleted
/demos/tags/rel_1_21/base/pidemo.c
File deleted
/demos/tags/rel_1_21/base/memtest.c
File deleted
/demos/tags/rel_1_21/base/condtest.c
File deleted
/demos/tags/rel_1_21/base/mousfind.c
File deleted
/demos/tags/rel_1_21/mpeg2/const.h
File deleted
/demos/tags/rel_1_21/mpeg2/store.c
File deleted
/demos/tags/rel_1_21/mpeg2/test.m2v
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/mpeg2/initfile.c
File deleted
/demos/tags/rel_1_21/mpeg2/verify.c
File deleted
/demos/tags/rel_1_21/mpeg2/motion.c
File deleted
/demos/tags/rel_1_21/mpeg2/global.h
File deleted
/demos/tags/rel_1_21/mpeg2/jetctrl.c
File deleted
/demos/tags/rel_1_21/mpeg2/getblk.c
File deleted
/demos/tags/rel_1_21/mpeg2/spatscal.c
File deleted
/demos/tags/rel_1_21/mpeg2/readme
File deleted
/demos/tags/rel_1_21/mpeg2/gvideo.c
File deleted
/demos/tags/rel_1_21/mpeg2/gethdr.c
File deleted
/demos/tags/rel_1_21/mpeg2/idctref.c
File deleted
/demos/tags/rel_1_21/mpeg2/spatial.doc
File deleted
/demos/tags/rel_1_21/mpeg2/idct.c
File deleted
/demos/tags/rel_1_21/mpeg2/todo
File deleted
/demos/tags/rel_1_21/mpeg2/makefile.ori
File deleted
/demos/tags/rel_1_21/mpeg2/getvlc.c
File deleted
/demos/tags/rel_1_21/mpeg2/mpeg2dec.c
File deleted
/demos/tags/rel_1_21/mpeg2/getvlc.h
File deleted
/demos/tags/rel_1_21/mpeg2/mpeg2dec.h
File deleted
/demos/tags/rel_1_21/mpeg2/makefile
File deleted
/demos/tags/rel_1_21/mpeg2/examples
File deleted
/demos/tags/rel_1_21/mpeg2/ieee1180
File deleted
/demos/tags/rel_1_21/mpeg2/makefile.lib
File deleted
/demos/tags/rel_1_21/mpeg2/getbits.c
File deleted
/demos/tags/rel_1_21/mpeg2/store.ori
File deleted
/demos/tags/rel_1_21/mpeg2/recon.c
File deleted
/demos/tags/rel_1_21/mpeg2/systems.c
File deleted
/demos/tags/rel_1_21/mpeg2/subspic.c
File deleted
/demos/tags/rel_1_21/mpeg2/config.h
File deleted
/demos/tags/rel_1_21/mpeg2/getpic.c
File deleted
/demos/tags/rel_1_21/mpeg2/m.bat
File deleted
/demos/tags/rel_1_21/mpeg2/changes
File deleted
/demos/tags/rel_1_21/kalm3d/readme.txt
File deleted
/demos/tags/rel_1_21/kalm3d/const.h
File deleted
/demos/tags/rel_1_21/kalm3d/kalm3d.c
File deleted
/demos/tags/rel_1_21/kalm3d/makefile
File deleted
/demos/tags/rel_1_21/kalm3d/carrello.c
File deleted
/demos/tags/rel_1_21/kalm3d/initfile.c
File deleted
/demos/tags/rel_1_21/readme.txt
File deleted
/demos/tags/rel_1_21/advtimer/initfile.c
File deleted
/demos/tags/rel_1_21/advtimer/readme.txt
File deleted
/demos/tags/rel_1_21/advtimer/advtimer.c
File deleted
/demos/tags/rel_1_21/advtimer/makefile
File deleted
/demos/tags/rel_1_21/base_cpp/hello.cpp
File deleted
/demos/tags/rel_1_21/base_cpp/readme
File deleted
/demos/tags/rel_1_21/base_cpp/ihello.c
File deleted
/demos/tags/rel_1_21/base_cpp/makefile
File deleted
/demos/tags/rel_1_21/oldexamples/fs/common.c
File deleted
/demos/tags/rel_1_21/oldexamples/fs/initfs.c
File deleted
/demos/tags/rel_1_21/oldexamples/fs/makefile
File deleted
/demos/tags/rel_1_21/oldexamples/fs/common.h
File deleted
/demos/tags/rel_1_21/oldexamples/fs/test0.c
File deleted
/demos/tags/rel_1_21/oldexamples/fs/tree1.c
File deleted
/demos/tags/rel_1_21/oldexamples/fs/test1.c
File deleted
/demos/tags/rel_1_21/oldexamples/fs/test2.c
File deleted
/demos/tags/rel_1_21/oldexamples/fs/tree2.c
File deleted
/demos/tags/rel_1_21/oldexamples/fs/hello.c
File deleted
/demos/tags/rel_1_21/oldexamples/fs/testu.c
File deleted
/demos/tags/rel_1_21/oldexamples/fs/testw0.c
File deleted
/demos/tags/rel_1_21/oldexamples/fs/testw1.c
File deleted
/demos/tags/rel_1_21/oldexamples/mpeg/common.c
File deleted
/demos/tags/rel_1_21/oldexamples/mpeg/mpg123.c
File deleted
/demos/tags/rel_1_21/oldexamples/mpeg/initfs.c
File deleted
/demos/tags/rel_1_21/oldexamples/mpeg/makefile
File deleted
/demos/tags/rel_1_21/oldexamples/mpeg/mplay.c
File deleted
/demos/tags/rel_1_21/oldexamples/mpeg/mplay2.c
File deleted
/demos/tags/rel_1_21/oldexamples/makefile
File deleted
/demos/tags/rel_1_21/oldexamples/stdio/common.c
File deleted
/demos/tags/rel_1_21/oldexamples/stdio/initfs.c
File deleted
/demos/tags/rel_1_21/oldexamples/stdio/makefile
File deleted
/demos/tags/rel_1_21/oldexamples/stdio/test0.c
File deleted
/demos/tags/rel_1_21/oldexamples/stdio/test1.c
File deleted
/demos/tags/rel_1_21/oldexamples/stdio/test2.c
File deleted
/demos/tags/rel_1_21/oldexamples/stdio/test3.c
File deleted
/demos/tags/rel_1_21/oldexamples/stdio/test4.c
File deleted
/demos/tags/rel_1_21/makefile
File deleted
/demos/tags/rel_1_21/dosfs/dosfs.c
File deleted
/demos/tags/rel_1_21/dosfs/myfile.txt
File deleted
/demos/tags/rel_1_21/dosfs/initfile.c
File deleted
/demos/tags/rel_1_21/dosfs/readme.txt
File deleted
/demos/tags/rel_1_21/dosfs/makefile
File deleted
/demos/tags/rel_1_21/orbit/makefile
File deleted
/demos/tags/rel_1_21/orbit/orbit.c
File deleted
/demos/tags/rel_1_21/orbit/initfile.c
File deleted
/demos/tags/rel_1_21/orbit/orbit.dat
File deleted
/demos/tags/rel_1_21/tracer/dfixed/dfixed.c
File deleted
/demos/tags/rel_1_21/tracer/dfixed/initfile.c
File deleted
/demos/tags/rel_1_21/tracer/dfixed/readme
File deleted
/demos/tags/rel_1_21/tracer/dfixed/makefile
File deleted
/demos/tags/rel_1_21/tracer/udp/initfile.c
File deleted
/demos/tags/rel_1_21/tracer/udp/udptrace.c
File deleted
/demos/tags/rel_1_21/tracer/udp/readme
File deleted
/demos/tags/rel_1_21/tracer/udp/makefile
File deleted
/demos/tags/rel_1_21/tracer/small/treec1.c
File deleted
/demos/tags/rel_1_21/tracer/small/hello.c
File deleted
/demos/tags/rel_1_21/tracer/small/treec2.c
File deleted
/demos/tags/rel_1_21/tracer/small/hello1.c
File deleted
/demos/tags/rel_1_21/tracer/small/hello2.c
File deleted
/demos/tags/rel_1_21/tracer/small/treef1.c
File deleted
/demos/tags/rel_1_21/tracer/small/common.c
File deleted
/demos/tags/rel_1_21/tracer/small/simple.c
File deleted
/demos/tags/rel_1_21/tracer/small/readme
File deleted
/demos/tags/rel_1_21/tracer/small/initfs.c
File deleted
/demos/tags/rel_1_21/tracer/small/makefile
File deleted
/demos/tags/rel_1_21/tracer/small/common.h
File deleted
/demos/tags/rel_1_21/tracer/small/test0.c
File deleted
/demos/tags/rel_1_21/tracer/readme
File deleted
/demos/tags/rel_1_21/tracer/makefile
File deleted
/demos/tags/rel_1_21/tracer/utils/sa.c
File deleted
/demos/tags/rel_1_21/tracer/utils/wait.c
File deleted
/demos/tags/rel_1_21/tracer/utils/distr.c
File deleted
/demos/tags/rel_1_21/tracer/utils/road.c
File deleted
/demos/tags/rel_1_21/tracer/utils/types.h
File deleted
/demos/tags/rel_1_21/tracer/utils/tdump.c
File deleted
/demos/tags/rel_1_21/tracer/utils/readme
File deleted
/demos/tags/rel_1_21/tracer/utils/makefile
File deleted
/demos/tags/rel_1_21/tracer/utils/util.c
File deleted
/demos/tags/rel_1_21/tracer/utils/udpdump.c
File deleted
/demos/tags/rel_1_21/tracer/utils/jdump.c
File deleted
/demos/tags/rel_1_21/tracer/utils/util.h
File deleted
/demos/tags/rel_1_21/simcity/proc.c
File deleted
/demos/tags/rel_1_21/simcity/initfile.c
File deleted
/demos/tags/rel_1_21/simcity/sem/green_u.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sem/red_l.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sem/yellow_l.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sem/red_r.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sem/green_l.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sem/yellow_r.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sem/red_d.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sem/red_u.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sem/yellow_d.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sem/yellow_u.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sem/green_r.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sem/green_d.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/car.c
File deleted
/demos/tags/rel_1_21/simcity/reading.c
File deleted
/demos/tags/rel_1_21/simcity/simcity.c
File deleted
/demos/tags/rel_1_21/simcity/tasks.c
File deleted
/demos/tags/rel_1_21/simcity/sprite/sp_0.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sprite/sp_1.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sprite/sp_2.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sprite/sp_3.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sprite/sp_4.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sprite/sp_5.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sprite/sp_6.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/sprite/sp_7.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/keyfunct.c
File deleted
/demos/tags/rel_1_21/simcity/img/car_000n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/Bb0.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/bb1.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_210n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_120n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_030n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_300n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/street.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_240n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_015n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_150n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_060n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_105n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_330n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_045n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/old_sk.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_180n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_090n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_270n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_135n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_225n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_315n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_075n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_165n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_255n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_345n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/old.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_195n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/img/car_285n.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/simcity/misc.c
File deleted
/demos/tags/rel_1_21/simcity/sem.raw
File deleted
/demos/tags/rel_1_21/simcity/makefile
File deleted
/demos/tags/rel_1_21/simcity/draw.c
File deleted
/demos/tags/rel_1_21/simcity/keyboard.c
File deleted
/demos/tags/rel_1_21/simcity/include/draw.h
File deleted
/demos/tags/rel_1_21/simcity/include/simcity.h
File deleted
/demos/tags/rel_1_21/simcity/include/proc.h
File deleted
/demos/tags/rel_1_21/simcity/include/states.h
File deleted
/demos/tags/rel_1_21/simcity/include/car.h
File deleted
/demos/tags/rel_1_21/simcity/include/keyfunct.h
File deleted
/demos/tags/rel_1_21/simcity/include/constant.h
File deleted
/demos/tags/rel_1_21/simcity/include/misc.h
File deleted
/demos/tags/rel_1_21/mesaref/readme.txt
File deleted
/demos/tags/rel_1_21/mesaref/makefile
File deleted
/demos/tags/rel_1_21/mesaref/test.png
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/mesaref/mesaref.c
File deleted
/demos/tags/rel_1_21/mesaref/initfile.c
File deleted
/demos/tags/rel_1_21/bttvdemo/initfile.c
File deleted
/demos/tags/rel_1_21/bttvdemo/readme.txt
File deleted
/demos/tags/rel_1_21/bttvdemo/makefile
File deleted
/demos/tags/rel_1_21/bttvdemo/bttv.c
File deleted
/demos/tags/rel_1_21/bca/bca.h
File deleted
/demos/tags/rel_1_21/bca/aereo.c
File deleted
/demos/tags/rel_1_21/bca/dummy.c
File deleted
/demos/tags/rel_1_21/bca/makefile
File deleted
/demos/tags/rel_1_21/bca/fab_lib/fab_tool.h
File deleted
/demos/tags/rel_1_21/bca/fab_lib/fab_grx.h
File deleted
/demos/tags/rel_1_21/bca/fab_lib/fab_show.h
File deleted
/demos/tags/rel_1_21/bca/fab_lib/fab_msg.h
File deleted
/demos/tags/rel_1_21/bca/fab_lib/fab_grx.sys
File deleted
/demos/tags/rel_1_21/bca/scenario.c
File deleted
/demos/tags/rel_1_21/bca/initfile.c
File deleted
/demos/tags/rel_1_21/bca/missile.c
File deleted
/demos/tags/rel_1_21/bca/bca_lib.c
File deleted
/demos/tags/rel_1_21/bca/readme
File deleted
/demos/tags/rel_1_21/bca/bca_raw/aereo1.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/bca/bca_raw/cannon.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/bca/bca_raw/aereo2.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/bca/bca_raw/aereo1_h.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/bca/bca_raw/cannon_h.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/bca/bca_raw/esplo1.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/bca/bca_raw/aereo2_h.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/bca/bca_raw/esplo2.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/bca/bca_raw/esplo3.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/bca/bca_raw/bca.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/bca/bca_raw/esplo4.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/bca/bca_raw/missile1.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/bca/bca_raw/esplo5.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/bca/bca_raw/missile2.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/bca/bca_raw/sfondo.raw
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/bca/fab_lib.c
File deleted
/demos/tags/rel_1_21/bca/control.c
File deleted
/demos/tags/rel_1_21/bca/cannone.c
File deleted
/demos/tags/rel_1_21/bca/esplo.c
File deleted
/demos/tags/rel_1_21/bca/bca.c
File deleted
/demos/tags/rel_1_21/astro/astro.c
File deleted
/demos/tags/rel_1_21/astro/asteroid.c
File deleted
/demos/tags/rel_1_21/astro/stat.c
File deleted
/demos/tags/rel_1_21/astro/makefile
File deleted
/demos/tags/rel_1_21/astro/rock.c
File deleted
/demos/tags/rel_1_21/astro/asteroid.h
File deleted
/demos/tags/rel_1_21/astro/initfile.c
File deleted
/demos/tags/rel_1_21/pngdemo/makefile
File deleted
/demos/tags/rel_1_21/pngdemo/test.png
File deleted
\ No newline at end of file
/demos/tags/rel_1_21/pngdemo/initfile.c
File deleted
/demos/tags/rel_1_21/pngdemo/pngdemo.c
File deleted
/demos/tags/rel_1_21/pngdemo/readme.txt
File deleted
/demos/tags/rel_1_21/servo/leg.h
File deleted
/demos/tags/rel_1_21/servo/makefile
File deleted
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: rel_1_21/servo/servo.c
===================================================================
--- rel_1_21/servo/servo.c (revision 1217)
+++ rel_1_21/servo/servo.c (nonexistent)
@@ -1,131 +0,0 @@
-#include "kernel/kern.h"
-
-#include "drivers/keyb.h"
-
-#include "servo.h"
-#include "leg.h"
-
-int main () {
-
- int res;
- char ch;
-/*
- servo_open(SERVO_COM2);
-
- cprintf("servo_set_RS232_baudrate\n");
- res = servo_set_RS232_baudrate(9600);
- cprintf("Res = %d\n",res);
-
- cprintf("servo_get_RS232_baudrate\n");
- res = servo_get_RS232_baudrate();
- cprintf("Res = %d\n",res);
-
- cprintf("servo_store_RS232_baudrate\n");
- res = servo_store_RS232_baudrate();
- cprintf("Res = %d\n",res);
-
- cprintf("servo_set_period\n");
- res = servo_set_period(20000);
- cprintf("Res = %d\n",res);
-
- ch = keyb_getch(BLOCK);
-
- cprintf("servo_get_period\n");
- res = servo_get_period();
- cprintf("Res = %d\n",res);
-
- ch = keyb_getch(BLOCK);
-
- cprintf("servo_store_period\n");
- res = servo_store_period();
- cprintf("Res = %d\n",res);
-
- ch = keyb_getch(BLOCK);
-
- cprintf("servo_get_setup_switch\n");
- res = servo_get_setup_switch();
- cprintf("Res = %d\n",res);
-
- ch = keyb_getch(BLOCK);
-
- cprintf("servo_set_RC5_switch\n");
- res = servo_set_RC5_switch(1);
- cprintf("Res = %d\n",res);
-
- ch = keyb_getch(BLOCK);
-
- cprintf("servo_turn_off\n");
- res = servo_turn_off(1);
- cprintf("Res = %d\n",res);
-
- ch = keyb_getch(BLOCK);
-
- cprintf("servo_turn_on\n");
- res = servo_turn_on(1);
- cprintf("Res = %d\n",res);
-
- ch = keyb_getch(BLOCK);
-
- cprintf("servo_turn_off_all\n");
- res = servo_turn_off_all();
- cprintf("Res = %d\n",res);
-
- ch = keyb_getch(BLOCK);
-
- cprintf("servo_turn_on_all\n");
- res = servo_turn_on_all();
- cprintf("Res = %d\n",res);
-
- ch = keyb_getch(BLOCK);
-
- cprintf("servo_set_levels\n");
- res = servo_set_levels(0x00,0x01);
- cprintf("Res = %d\n",res);
-
- ch = keyb_getch(BLOCK);
-
- cprintf("servo_get_levels\n");
- res = servo_get_levels();
- cprintf("Res = %d\n",res);
-
- ch = keyb_getch(BLOCK);
-
- cprintf("servo_store_levels\n");
- res = servo_store_levels();
- cprintf("Res = %d\n",res);
-
- ch = keyb_getch(BLOCK);
-
- cprintf("servo_set_angle_sec\n");
- res = servo_set_angle_sec(0,ANGLE2SEC(45,0,0));
- cprintf("Res = %d\n",res);
-
- ch = keyb_getch(BLOCK);
-
- cprintf("servo_store_default_position\n");
- res = servo_store_default_position(0);
- cprintf("Res = %d\n",res);
-
- ch = keyb_getch(BLOCK);
-
- cprintf("servo_get_angle_sec\n");
- res = servo_get_angle_sec(0);
- cprintf("Res = %d\n",res);
-
- ch = keyb_getch(BLOCK);
-
- cprintf("servo_get_analog\n");
- res = servo_get_analog(0);
- cprintf("Res = %d\n",res);
-
- ch = keyb_getch(BLOCK);
-
- servo_close();
-*/
- set_leg_position(8.0,-5.0,0.0);
- set_leg_position(8.0,0.0,0.0);
-
- return 0;
-
-}
-
Index: rel_1_21/servo/initfile.c
===================================================================
--- rel_1_21/servo/initfile.c (revision 1217)
+++ rel_1_21/servo/initfile.c (nonexistent)
@@ -1,83 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Giacomo Guidi <giacomo@gandalf.sssup.it>
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- //CBS_register_level(CBS_ENABLE_ALL, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- SEM_register_module();
-
- CABS_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- HARTPORT_init();
-
- //KEYB_init(NULL);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
/rel_1_21/servo/initfile.c
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: rel_1_21/servo/leg.c
===================================================================
--- rel_1_21/servo/leg.c (revision 1217)
+++ rel_1_21/servo/leg.c (nonexistent)
@@ -1,63 +0,0 @@
-#include <kernel/kern.h>
-#include <math.h>
-
-#include "servo.h"
-
-#define LEG_A 10.0
-#define LEG_B 10.0
-
-const double c0 = LEG_A * LEG_A;
-const double c1 = LEG_A * LEG_A - LEG_B * LEG_B;
-const double todeg = 180.0 / PI;
-
-int set_leg_position(double px, double py, double pz)
-{
-
- double px2 = px * px;
- double py2 = py * py;
- double pz2 = pz * pz;
-
- double pxz2 = pz2 + px2;
- double gamma1 = asin(pz/sqrt(pxz2)) * todeg;
-
- double s = pxz2 + py2;
- double k = c1 + s;
- double k2 = k * k;
-
- double delta_xy = py2 * k2 - s * (k2 - 4.0 * pxz2 * c0);
- double y1,dsqrt;
- double alfa1,beta1,alfa2,beta2;
- int alfa = 0, beta = 0, gamma = 0;
-
- if (delta_xy >= 0.0) {
- dsqrt = sqrt(delta_xy);
- y1 = (py * k + dsqrt) / (2.0 * s);
- alfa1 = asin(y1/LEG_A) * todeg;
- beta1 = asin((y1 - py)/LEG_B) * todeg + alfa1;
- y1 = (py * k - dsqrt) / (2.0 * s);
- alfa2 = asin(y1/LEG_A) * todeg;
- beta2 = asin((y1 - py)/LEG_B) * todeg + alfa2;
- cprintf("Alfa1 = %d Beta1 = %d\n",(int)alfa1,(int)beta1);
- cprintf("Alfa2 = %d Beta2 = %d\n",(int)alfa2,(int)beta2);
- if ((alfa1 >= -90.0 && alfa1 <= 90.0) && (beta1 >= 0.0 && beta1 <= 180.0)) {
- alfa = (int)(alfa1 * 3600.0);
- beta = (int)(beta1 * 3600.0);
- gamma = (int)(gamma1 * 3600.0);
- cprintf("Alfa Sec = %d Beta Sec = %d Gamma Sec = %d\n",alfa,beta,gamma);
- return 0;
- } else if ((alfa2 >= -90.0 && alfa2 <= 90.0) && (beta2 >= 0.0 && beta2 <= 180.0)) {
- alfa = (int)(alfa2 * 3600.0);
- beta = (int)(beta2 * 3600.0);
- gamma = (int)(gamma1 * 3600.0);
- cprintf("Alfa Sec = %d Beta Sec = %d Gamma Sec = %d\n",alfa,beta,gamma);
- return 0;
- } else {
- cprintf("No possible !\n");
- return 1;
- }
- } else {
- cprintf("No possible !\n");
- return 1;
- }
-
-}
Index: rel_1_21/telesco/makefile
===================================================================
--- rel_1_21/telesco/makefile (revision 1217)
+++ rel_1_21/telesco/makefile (nonexistent)
@@ -1,16 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS= tel
-
-include $(BASE)/config/example.mk
-
-tel:
- make -f $(SUBMAKE) APP=tel INIT= OTHEROBJS="initfile.o" OTHERINCL= SHARKOPT="__OLDCHAR__ __GRX__"
-
Index: rel_1_21/telesco/moon.h
===================================================================
--- rel_1_21/telesco/moon.h (revision 1217)
+++ rel_1_21/telesco/moon.h (nonexistent)
@@ -1,43 +0,0 @@
-// Immagine luna
-BYTE luna[900]={
-0, 0 , 0, 0, 0, 0, 0, 0, 4, 57, 212, 228, 204, 214, 235, 237, 208, 190, 179, 197, 229, 89, 4, 0,
-0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 208, 213, 178, 155, 139, 129, 123, 169, 170, 173, 157,
-191, 209, 236, 215, 5, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 36, 103, 146, 116, 93, 143, 119, 96,
-134, 123, 117, 120, 113, 102, 93, 156, 210, 184, 66, 4, 0, 0, 0, 0, 0, 0, 0, 0, 2, 64, 83, 88,
-72, 156, 144, 127, 99, 87, 91, 156, 158, 124, 144, 120, 109, 119, 175, 167, 180, 119, 3, 0,
-0, 0, 0, 0, 0, 5, 56, 59, 63, 58, 138, 104, 71, 46, 55, 68, 79, 89, 172, 146, 141, 152, 110, 126,
-134, 179, 148, 145, 134, 4, 0, 0, 0, 0, 4, 32, 58, 50, 49, 56, 105, 58, 38, 42, 45, 69, 64, 93,
-144, 155, 157, 147, 95, 111, 122, 158, 162, 174, 171, 79, 4, 0, 0, 0, 4, 67, 49, 47, 54, 63,
-51, 55, 43, 38, 48, 62, 55, 86, 89, 145, 92, 60, 99, 72, 97, 130, 184, 169, 195, 171, 3, 0, 0,
-3, 77, 52, 37, 51, 72, 54, 63, 48, 46, 46, 48, 55, 54, 92, 95, 80, 55, 47, 47, 52, 56, 170, 187,
-196, 190, 177, 190, 6, 0, 45, 84, 38, 40, 79, 73, 56, 43, 41, 46, 45, 51, 74, 98, 89, 68, 89,
-46, 40, 48, 45, 38, 171, 176, 152, 165, 133, 157, 107, 3, 154, 42, 34, 42, 68, 66, 47, 52, 62,
-55, 60, 50, 56, 50, 106, 127, 74, 38, 39, 58, 38, 42, 116, 87, 128, 148, 69, 59, 170, 2, 100,
-41, 31, 38, 41, 53, 53, 62, 63, 64, 62, 65, 63, 58, 105, 71, 60, 57, 44, 43, 38, 36, 81, 58, 125,
-205, 61, 43, 130, 37, 88, 39, 31, 33, 43, 52, 76, 66, 97, 116, 101, 96, 90, 56, 76, 47, 43, 135,
-46, 87, 40, 30, 33, 37, 84, 152, 86, 43, 131, 81, 131, 36, 35, 33, 36, 53, 91, 73, 124, 145,
-132, 95, 80, 50, 45, 45, 35, 49, 70, 59, 32, 30, 30, 30, 39, 75, 158, 92, 133, 138, 151, 41,
-39, 38, 39, 82, 125, 59, 89, 98, 84, 64, 68, 40, 104, 107, 85, 78, 115, 75, 34, 43, 39, 36, 47,
-78, 98, 142, 104, 122, 155, 49, 32, 36, 32, 57, 71, 58, 85, 97, 69, 49, 53, 40, 88, 124, 133,
-169, 141, 94, 40, 40, 46, 53, 52, 81, 49, 77, 107, 122, 146, 79, 31, 38, 31, 37, 37, 51, 64,
-59, 84, 72, 64, 96, 88, 132, 153, 158, 154, 149, 140, 109, 77, 125, 120, 54, 51, 59, 123, 86,
-111, 122, 35, 44, 35, 34, 38, 63, 55, 55, 87, 76, 103, 133, 148, 146, 160, 151, 145, 163, 194,
-92, 104, 136, 109, 54, 46, 65, 123, 53, 160, 144, 56, 46, 41, 39, 39, 91, 41, 47, 70, 75, 57,
-112, 116, 140, 168, 179, 161, 164, 188, 123, 100, 145, 162, 87, 51, 111, 140, 5, 172, 148,
-134, 86, 72, 75, 48, 50, 40, 45, 53, 106, 60, 108, 137, 135, 160, 157, 152, 169, 179, 191,
-109, 70, 150, 122, 94, 104, 128, 4, 167, 144, 140, 103, 98, 116, 64, 56, 84, 62, 60, 59, 48,
-80, 150, 143, 151, 187, 161, 147, 178, 219, 79, 69, 163, 132, 87, 108, 128, 0, 83, 195, 195,
-125, 138, 67, 35, 106, 98, 90, 58, 44, 60, 131, 161, 152, 178, 157, 149, 164, 164, 177, 107,
-119, 129, 119, 145, 133, 104, 0, 5, 181, 233, 190, 150, 78, 43, 62, 63, 87, 50, 53, 46, 81,
-157, 187, 155, 181, 189, 145, 166, 211, 170, 137, 166, 189, 188, 164, 5, 0, 0, 5, 167, 175,
-193, 193, 108, 114, 63, 118, 139, 125, 130, 202, 209, 221, 213, 180, 172, 201, 170, 175,
-186, 177, 210, 236, 204, 14, 0, 0, 0, 3, 62, 166, 183, 166, 106, 139, 102, 129, 179, 206, 212,
-240, 232, 224, 210, 208, 196, 173, 179, 177, 186, 191, 227, 185, 100, 2, 0, 0, 0, 0, 5, 125,
-196, 143, 163, 169, 169, 152, 181, 212, 239, 241, 237, 234, 217, 180, 206, 188, 199, 188,
-194, 202, 164, 120, 4, 0, 0, 0, 0, 0, 0, 5, 123, 180, 145, 147, 184, 184, 197, 223, 232, 224,
-227, 227, 220, 190, 179, 192, 192, 197, 204, 165, 120, 4, 0, 0, 0, 0, 0, 0, 0, 0, 5, 74, 162,
-135, 153, 176, 178, 204, 235, 232, 235, 231, 212, 201, 190, 189, 196, 202, 189, 70, 4, 0,
-0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 182, 167, 170, 184, 208, 218, 215, 206, 209, 179, 205, 196, 188,
-184, 193, 12, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 103, 202, 197, 201, 208, 235, 217, 203,
-197, 188, 185, 217, 131, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 89, 130, 218,
-195, 179, 165, 102, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0};
Index: rel_1_21/telesco/initfile.c
===================================================================
--- rel_1_21/telesco/initfile.c (revision 1217)
+++ rel_1_21/telesco/initfile.c (nonexistent)
@@ -1,133 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: initfile.c,v 1.1 2003-06-04 09:41:01 giacomo Exp $
-
- File: $File$
- Revision: $Revision: 1.1 $
- Last update: $Date: 2003-06-04 09:41:01 $
- ------------
-
- System initialization file
-
- This file contains the 2 functions needed to initialize the system.
-
- These functions register the following levels:
-
- an EDF (Earliest Deadline First) level
- a RR (Round Robin) level
- a CBS (Costant Bandwidth Server) level
- a Dummy level
-
- It can accept these task models:
-
- HARD_TASK_MODEL (wcet+mit) at level 0
- SOFT_TASK_MODEL (met, period) at level 1
- NRT_TASK_MODEL at level 2
-
- This file is similar to the configuration of kernel/init/hartik3.c
-
- TICK is set to 0 (one-shot timer is used)
-*/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-int argc;
-char *argv[100];
-
-void read_cfg_file(int argc, char **argv);
-
-int main(int argc, char **argv);
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- CBS_register_level(CBS_ENABLE_ALL, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- SEM_register_module();
-
- CABS_register_module();
-
- __compute_args__(mb, &argc, argv);
-
- read_cfg_file(argc, argv);
-
- //read_cfg_file(argc, argv);
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- keyb_def_ctrlC(kparms, NULL);
- keyb_def_map(kparms,itaMap);
- KEYB_init(&kparms);
-
- //__call_main__(mb);
- return (void *)main(argc,argv);
- //return (void *)0;
-}
-
Index: rel_1_21/telesco/tel.c
===================================================================
--- rel_1_21/telesco/tel.c (revision 1217)
+++ rel_1_21/telesco/tel.c (nonexistent)
@@ -1,709 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Bera Marco mbera@libero.it
- * Varasio Gabriele varasio@odino.unipv.it
- *
- * Universita' degli studi di Pavia
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: tel.c,v 1.1 2003-06-04 09:41:01 giacomo Exp $
-
- File: $File$
- Revision: $Revision: 1.1 $
- Last update: $Date: 2003-06-04 09:41:01 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai and Giorgio Buttazzo
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/****************************************************************/
-/* PERIODIC PROCESS TEST */
-/****************************************************************/
-
-#include <ll/i386/x-dos.h>
-#include <kernel/kern.h>
-#include <modules/cabs.h>
-#include <drivers/glib.h>
-#include <drivers/keyb.h>
-#include <math.h>
-#include <semaphore.h>
-#include <stdlib.h>
-#include "moon.h"
-
-
-#define N_MAX_TELESCOPI 5
-#define X0 10
-#define pi 3.14
-#define ex 2.71
-#define NCAB N_MAX_TELESCOPI+1
-#define dim_msg 8
-#define dim_x 49
-#define dim_y 49
-#define radius 9
-#define Y_TELESCOPI 300
-/* task periods */
-#define PERIOD_T1 80000
-#define PERIOD_T4 100000
-#define PERIOD_T5 100000
-#define WCET_T 5000
-int period_t1=0;
-#define SOGLIA 8
-
-char *cname[NCAB] = {"cab1", "cab2", "cab3", "cab4","cab5","cab6"};
-
-// posizioni dei telescopi e rispettivi poli
-
-int x[5] = {100, 200, 300, 400,500};
-//double poli[5]={-50,-30,-1, -20, -5};
-double poli[5];
-// guadagno proporzionale
-double kp=0.0;
-// flag per rilevare la pressione del tasto spazio
-int numero_telescopi=0;
-int flag=0;
-KEY_EVT move_tasto;
-// Immagini ausiliarie per il disegno della luna
-BYTE lunabkg[900];
-BYTE lunadest[900];
-
-
-/* A semaphore used to access Video Cards in mutual exclusion */
-sem_t mutex;
-sem_t mutex_tasto;
-
-/***************************************************************/
-
-// cab necessari allo scambio delle coordinate dell'oggetto e delle
-// immagini dei rispettivi telescopi
-
-CAB cid[NCAB];
-
-// vettori per memorizzare le immagini
-BYTE videobuf[dim_x*dim_y];
-BYTE videobuf1[dim_x*dim_y];
-BYTE videobuf2[dim_x*dim_y];
-BYTE videobuf3[dim_x*dim_y];
-BYTE videobuf4[dim_x*dim_y];
-BYTE videobuf5[dim_x*dim_y];
-
- // Variabili per il disegno delle stelle sullo sfondo
- int num_p;
- int y_p[7];
- int x_p[7];
- int dim_p[7];
- int col_p[7];
-
-
-
-TASK media(void *arg)
-{
-char *p;
-
-int i=0;
-int j=0;
-while(1)
-{
- p = cab_getmes(cid[1]);
- memcpy(videobuf,p,dim_x*dim_y*sizeof(BYTE));
- cab_unget(cid[1], p);
- p = cab_getmes(cid[2]);
- memcpy(videobuf1,p,dim_x*dim_y*sizeof(BYTE));
- cab_unget(cid[2], p);
- p = cab_getmes(cid[3]);
- memcpy(videobuf2,p,dim_x*dim_y*sizeof(BYTE));
- cab_unget(cid[3], p);
- p = cab_getmes(cid[4]);
- memcpy(videobuf4,p,dim_x*dim_y*sizeof(BYTE));
- cab_unget(cid[4], p);
-
- p = cab_getmes(cid[5]);
- memcpy(videobuf5,p,dim_x*dim_y*sizeof(BYTE));
- cab_unget(cid[5], p);
-
- // calcolo media
-
- for (i=0;i<dim_x;i++)
-
- {
- for(j=0;j<dim_y;j++)
- {
- videobuf3[i*dim_x+j]=(double)(videobuf[i*dim_x+j]+videobuf1[i*dim_x+j]+videobuf2[i*dim_x+j]+videobuf4[i*dim_x+j]+videobuf5[i*dim_x+j])/numero_telescopi;
- }
- }
-
- // visualizza immagine mediata
- sem_wait(&mutex);
- grx_putimage(570,10,570+dim_x-1,10+dim_y-1,videobuf3);
- sem_post(&mutex);
- task_endcycle();
- }
-}
-
-TASK move(void *arg)
-{
-//int i = (int)arg;
-char *p;
-int x_object=300; // posizione dell'oggetto da rilevare
-int y_object=200;
-// variabile contatore
-int z=0;
-char coord_x[dim_msg];
-p = cab_reserve(cid[0]);
-sprintf(coord_x,"%d %d",x_object,y_object);
-memcpy(p,coord_x,dim_msg*sizeof(char));
-cab_putmes(cid[0], p);
-
- //Normalizzazione
- for(z=0;z<900;z++)
- {
- if (luna[z]>0)
- {
- luna[z]=((luna[z])*16.0/255.0)+16;
- }
-
- }
-
-
- task_endcycle();
- while (1)
- {
-
- // Cancellazione Luna
- sem_wait(&mutex);
- grx_box(x_object-15,y_object-15,x_object+14,y_object+14,0);
- sem_post(&mutex);
- if (keyb_getcode(&move_tasto,NON_BLOCK))
- {
- if (move_tasto.ascii=='4')
- x_object=x_object-5;
- if (move_tasto.ascii=='6')
- x_object=x_object+5;
- if (move_tasto.ascii=='2')
- y_object=y_object+5;
- if (move_tasto.ascii=='8')
- y_object=y_object-5;
- if (move_tasto.ascii=='9'){
- y_object=y_object-5;
- x_object=x_object+5; }
- if (move_tasto.ascii=='1'){
- y_object=y_object+5;
- x_object=x_object-5; }
- if (move_tasto.ascii=='7'){
- y_object=y_object-5;
- x_object=x_object-5; }
- if (move_tasto.ascii=='3'){
- y_object=y_object+5;
- x_object=x_object+5;}
- if (move_tasto.ascii==' '){
- sem_wait(&mutex_tasto);
- flag=1;
- if(numero_telescopi<N_MAX_TELESCOPI)
- {
- numero_telescopi++;
- }
- sem_post(&mutex_tasto);
- }
- //CONTROLLI SULLA POSIZIONE
- if(y_object<(dim_y/2+70)) y_object=dim_y/2+70;
- if(y_object>(240-dim_y/2)) y_object=(240-dim_y/2);
- if(x_object<(dim_x/2+20 )) x_object=dim_x/2+20;
- if(x_object>(630-dim_x/2-10)) x_object=(630-dim_x/2-10);
- }
- p = cab_reserve(cid[0]);
- sprintf(coord_x,"%d %d",x_object,y_object);
- memcpy(p,coord_x,dim_msg*sizeof(char));
- cab_putmes(cid[0], p);
-
- for(z=0;z<7;z++)
- {
- if (sqrt(pow((x_object-x_p[z]),2)+pow((y_object-y_p[z]),2))<20+dim_p[z]+radius)
- grx_disc(x_p[z],y_p[z],dim_p[z],col_p[z]);
- }
-
-
- sem_wait(&mutex);
- // Gestione sfondo
- grx_getimage(x_object-15,y_object-15,x_object+14, y_object+14,lunabkg);
- for(z=0;z<900;z++)
- {
- if( luna[z]==0 && lunabkg!=0 )
- {
- lunadest[z]=lunabkg[z];
- }
- else
- {
- lunadest[z]=luna[z];
- }
- }
- grx_putimage(x_object-15,y_object-15,x_object+14, y_object+14,lunadest);
- sem_post(&mutex);
- task_endcycle();
- }
-}
-
-
-TASK tele(void *arg)
-{
-int i = (int)arg;
-int passi;
-char s[100];
-int x_object=300; // posizione dell'oggetto da rilevare
-int y_object=200;
-int x_start=500; // posizione iniziale dei telescopi
-int y_start=190;
-int x_current=x_start; // posizione corrente dei telescopi
-int y_current=y_start;
-int x_current_d[9];
-int y_current_d[9];
-int y= Y_TELESCOPI; // coordinata y dei telescopi
-double alpha_new=atan((y-(double)y_current)/((x[i]-(double)x_current)));
-double alpha=alpha_new;
-double distance=0.0;
-double alpha_target=0.0;
-double tc=0.1;
-double u=0.0;
-double u_old=0.0;
-double errore=0.0;
-double delta_x=0;
-double delta_y=0;
-
-char *p;
-//int j=0;
-// indice matrice per aggiunta di rumore
-int k=0;
-int q=0;
-double polo=poli[i];
-int val=0;
-
-
-
-BYTE videobuf[dim_x*dim_y];
-
- passi = 0;
- //srand(i);
- //srand(i+sys_gettime(NULL));
- alpha_target=atan((y-(double)y_object)/((double)x_object-x[i]));
-
- sem_wait(&mutex);
- grx_text("targ",4,340,12,0);
- sprintf(s,"%f",poli[i]);
- grx_text(s,x[i],y+60,12,0);
- grx_text("polo",4,y+60,12,0);
- grx_text("new",4,y+50,12,0);
- sprintf(s,"%1.6f",alpha_target);
- grx_text(s, x[i]-25,y+50,12,0);
- grx_rect(x[i]-40,y+25,x[i]+40,y+85,2);
- grx_rect(x[i]-40,y+90,x[i]+40,y+150,2);
- sem_post(&mutex);
-
- // Disegno telescopio
- grx_disc(x[i],y,19,i+1);
- grx_box( x[i]-19,y,x[i]+19,y+20,i+1);
-
-
- task_endcycle();
-
- while (1) {
- // legge di controllo
- passi++;
- //sprintf(s,"%d",passi);
- //grx_text(s, 50,110,12,0);
- p = cab_getmes(cid[0]);
- sscanf(p,"%d %d",&val,&y_object);
- cab_unget(cid[0], p);
- x_object=val;
- alpha_target=atan((y-(double)y_object)/((double)x_object-x[i]));
- if (alpha_target <0)
- {
- alpha_target=3.14+alpha_target;
- }
-
- errore=alpha_target-alpha_new;
- u=u_old+kp*tc*errore;
- //alpha_new=0.13*alpha+0.87*u;
- alpha_new=(exp(polo*tc))*alpha+(1-exp(polo*tc))*u;
- u_old=u;
- alpha=alpha_new;
-
- // implementazione dei limiti degli attuattori
- if (alpha_new > 3.14)
- alpha_new=3.14;
- if (alpha_new <0)
- alpha_new=0;
-
- distance=sqrt(((y-y_object)*(y-y_object))+((x_object-x[i])*(x_object-x[i])));
-
- sem_wait(&mutex);
- // Cancello braccio telescopio
- if (passi>1)
- {
- for (k=0; k<9 ; k++)
- {
- grx_line(delta_x,delta_y,x_current_d[k],y_current_d[k],0);
- }
- }
- x_current=x[i]+distance*cos(alpha_new);
- y_current=300-distance*sin(alpha_new);
-
- // lettura immagine
-
- grx_getimage(x_current-(dim_x/2),y_current-(dim_y/2),x_current+(dim_x/2),y_current+(dim_y/2),videobuf);
-
- //aggiunta rumore
-
- sem_post(&mutex);
- for (k=0;k<dim_x;k++)
- {
- for(q=0;q<dim_y;q++)
- {
- int num=0;
- num=rand();
- num=(num%10)+1;
- if (num>SOGLIA)
- {
- videobuf[k*dim_x+q]=videobuf[k*dim_x+q]+1;
- }
- }
- }
- sem_wait(&mutex);
-
- grx_putimage(x[i]-25,y+92,x[i]-25+dim_x-1,y+92+dim_y-1,videobuf);
-
- sprintf(s,"%3.4f",(180*(alpha_target/pi)));
- grx_text(s, x[i]-25,y+40,12,0);
- sprintf(s,"%3.4f",180*(alpha_new/pi));
- grx_text(s, x[i]-25,y+50,12,0);
-
- delta_x=x[i]+20*cos(alpha_new);
- delta_y=y-20*sin(alpha_new);
-
- for ( k=0; k<9 ; k++) {
- x_current_d[k]=x[i]+50*cos(alpha_new+(k-4)*0.01);
- y_current_d[k]=300-50*sin(alpha_new+(k-4)*0.01); }
-
- // Disegno braccio telescopio
- for(k=0 ; k<9 ; k++)
- grx_line(delta_x,delta_y,x_current_d[k],y_current_d[k],i+1);
-
- sem_post(&mutex);
-
- // scrive immagine nel cab
- p = cab_reserve(cid[i+1]);
- memcpy(p,videobuf,dim_x*dim_y*sizeof(BYTE));
- cab_putmes(cid[i+1], p);
-
- task_endcycle();
-
- }
-
-}
-
-
-/****************************************************************/
-
-/* This is the exception handler. It is called when an exception
- is raised.
- It exits from the graphical mode, then it prints a message and
- shutdown the kernel using sys_abort()
-*/
-
-void demo_exc_handler(int signo, siginfo_t *info, void *extra)
-{
- struct timespec t;
-
- grx_close();
-
- /* Default action for an kern exception is */
- kern_cli();
- ll_gettime(TIME_EXACT, &t),
- kern_printf("\nS.Ha.R.K. Exception raised!!!"
- "\nTime (s:ns) :%ld:%ld"
- "\nException number:%d (numbers in include/bits/errno.h)"
- "\nPID :%d\n",
- t.tv_sec, t.tv_nsec, info->si_value.sival_int,
- info->si_task);
- sys_abort(1);
-}
-
-/******************************************************************/
-
-/* This function is called when Alt-X is pressed.
- It simply shutdown the system using sys_end.
- Note that the byebye() function is called only if we exit from
- the system using sys_end()!!!!
-*/
-void my_end(KEY_EVT* e)
-{
- sys_end();
-}
-
-/******************************************************************/
-
-/* This function is called when the system exit correctly after Alt-X.
- It exits from the graphic mode and then it prints a small greeting.
- Note that:
- - The function calls grx_exit, so it must be registered using
- RUNLEVEL_BEFORE_EXIT (RUNLEVEL_AFTER_EXIT does not work because
- at that point the kernel is already returned in real mode!!!)
- - When an exception is raised, the exception handler is called.
- Since the exception handler already exits from the graphic mode,
- this funcion has not to be called. For this reason:
- . we registered byebye using the flag NO_AT_ABORT
- . the exception handler exits using sys_abort; in that way byebye is
- NOT called
-*/
-
-void byebye(void *arg)
-{
- grx_close();
- kern_printf("Bye Bye!\n");
-}
-
-/****************************** MAIN ******************************/
-
-int main(int argc, char **argv)
-{
- PID pid1, pid4,pid5;
- KEY_EVT emerg;
- int i=0;
- int z=0; // contatore per disegno dei pianeti
- HARD_TASK_MODEL m1, m4,m5;
- //FILE *fp;
-
- struct sigaction action;
-
- cid[0] = cab_create(cname[0], dim_msg, 5);
- cid[1] = cab_create(cname[1], dim_x*dim_y, 3);
- cid[2] = cab_create(cname[2], dim_x*dim_y, 3);
- cid[3] = cab_create(cname[3], dim_x*dim_y, 3);
- cid[4] = cab_create(cname[4], dim_x*dim_y, 4);
- cid[5] = cab_create(cname[5], dim_x*dim_y, 3);
- cid[6] = cab_create(cname[6], dim_x*dim_y, 3);
-
- /*fp=fopen("file.txt","r");
- fscanf(fp,"%d",a);
- fclose(fp);
- */
-
- /* Init the standard S.Ha.R.K. exception handler */
- action.sa_flags = SA_SIGINFO; /* Set the signal action */
- action.sa_sigaction = demo_exc_handler;
- action.sa_handler = 0;
- sigfillset(&action.sa_mask); /* we block all the other signals... */
-
- if (sigaction(SIGHEXC, &action, NULL) == -1) { /* set the signal */
- perror("Error initializing signals...");
- sys_end();
- }
-
- /* Set the closing function */
- sys_atrunlevel(byebye, NULL, RUNLEVEL_BEFORE_EXIT|NO_AT_ABORT);
-
- /* Initializes the semaphore */
- sem_init(&mutex,0,1);
-
- /* graphic card Initialization */
- if (grx_init() < 1) {
- sys_abort(1);
- }
-
- if (grx_open(640, 480, 8) < 0) {
- kern_printf("GRX Err\n");
- sys_abort(1);
- }
- kern_printf("Video card ok!\n");
-
-
-
- /* set the keyboard handler to exit correctly */
- emerg.ascii = 'x';
- emerg.scan = KEY_X;
- emerg.flag = ALTL_BIT;
- keyb_hook(emerg,my_end);
-
- srand(i+sys_gettime(NULL));
-
- emerg.ascii = 'x';
- emerg.scan = KEY_X;
- emerg.flag = ALTR_BIT;
- keyb_hook(emerg,my_end);
- sem_wait(&mutex);
- /* a small banner */
- grx_clear(0);
-
- grx_text("REALTIME TELESCOPES di Marco Bera e Gabriele Varasio",8,8,WHITE,0);
- grx_text("Premere Spazio per creare un telescopio",8,22,WHITE,0);
- grx_text("Premere Alt-X per uscire",8,32,WHITE,0);
- grx_text("Usare il tastierino numerico per muovere l'oggetto",8,42,WHITE,0);
-
- // DISEGNARE BORDI
- grx_rect(1,1,638,478,2);
- grx_rect(558,1,638,61,2);
- grx_rect(1,1,638,61,2);
-
-
- // Disegno sfondo
- for(z=0;z<7;z++)
- {
- num_p=rand();
- y_p[z]=100+((num_p%130)+1);
- x_p[z]=50+((num_p%540)+1);
- dim_p[z]=2+((num_p%5)+1);
- col_p[z]=((num_p%10)+1);
- grx_disc(x_p[z],y_p[z],dim_p[z],col_p[z]);
- }
- sem_post(&mutex);
-
-
- hard_task_default_model(m4);
- hard_task_def_ctrl_jet (m4);
- hard_task_def_arg (m4, (void *)3);
- hard_task_def_wcet (m4, 19000);
- hard_task_def_mit (m4, PERIOD_T4);
- hard_task_def_group (m4,1);
- pid4 = task_create("move", move, &m4, NULL);
- if (pid4 == NIL) {
- grx_close();
- perror("Could not create task <move>");
- sys_abort(1);
- }
- task_activate(pid4);
- hard_task_default_model(m5);
- hard_task_def_ctrl_jet (m5);
- hard_task_def_arg (m5, (void *)3);
- hard_task_def_wcet (m5, 19000);
- hard_task_def_mit (m5, PERIOD_T5);
- hard_task_def_group (m5,1);
- pid5 = task_create("media", media, &m5, NULL);
-
- if (pid5 == NIL) {
- grx_close();
- perror("Could not create task <move>");
- sys_abort(1);
- }
- task_activate(pid5);
- /* and finally we activate the three threads... */
-
-
-
- do {
- int val_flag=0;
- sem_wait(&mutex_tasto);
- val_flag=flag;
- sem_post(&mutex_tasto);
-
- if ((val_flag==1) && (i < N_MAX_TELESCOPI))
- {
- flag=0;
- hard_task_default_model(m1);
- hard_task_def_ctrl_jet (m1);
- hard_task_def_arg (m1, (void *)i);
- hard_task_def_wcet (m1, WCET_T);
-// hard_task_def_mit (m1, PERIOD_T1);
- hard_task_def_mit (m1, period_t1);
-
- hard_task_def_group (m1,1);
- pid1 = task_create("tele1", tele, &m1, NULL);
- if (pid1 == NIL)
- {
- grx_close();
- perror("Could not create task <tele1>");
- sys_abort(1);
- }
- task_activate(pid1);
- i++;
- }
- } while (1);
-
- /*
- now the task main ends, but the system does not shutdown because
- there are others.
-
- The demo will finish if a Alt-X key is pressed.
- */
-
- return 0;
-}
-/*********** lettura da file ********************/
-void read_cfg_file(int argc, char **argv)
-{
- int err;
- DOS_FILE *fp;
- char myfilebuf[1000];
- int myfilebuf_length;
-
-
-
- if (2)
- {
- fp = DOS_fopen("dati.cnf","r");
-
- if (fp)
- {
- /* read up to 1000 chars */
- myfilebuf_length = DOS_fread(&myfilebuf,1,1000,fp);
-
- /* check for errors */
- err = DOS_error();
-
- cprintf("Read %d bytes...\n", myfilebuf_length);
-
- if (err)
- {
- cprintf("Error %d reading file...Using default values\n", err);
- }
- else
- {
- //geti(myfilebuf, &pos, &NMouses); // Number of Mouses
- sscanf(myfilebuf,"%lf %lf %lf %lf %lf %lf %d",&poli[0],&poli[1],&poli[2],&poli[3],&poli[4],&kp,&period_t1);
- }
-
- DOS_fclose(fp);
- return;
-
- }
- else {
- /* error!! */
- err = DOS_error();
- /* note that if you call DOS_error() here, it return 0!!! */
- cprintf("Error %d opening myfile.txt...Using default values\n", err);
- }
-
- }
- else {
- cprintf("Wrong number of arguments...\n");
- l1_exit(0);
- }
-}
-
-
-/****************************************************************/
Index: rel_1_21/telesco/dati.cnf
===================================================================
--- rel_1_21/telesco/dati.cnf (revision 1217)
+++ rel_1_21/telesco/dati.cnf (nonexistent)
@@ -1,3 +0,0 @@
--1 -20 -30 -40 -50 0.5 100000
-# 5 poli kp(guadagno) periodo telescopio
-
Index: rel_1_21/autostr/autostr.c
===================================================================
--- rel_1_21/autostr/autostr.c (revision 1217)
+++ rel_1_21/autostr/autostr.c (nonexistent)
@@ -1,1171 +0,0 @@
-/***************************************************************************
- **************************************************************************
- *** Universita' di Pavia ***
- *** Corso : Informatoca Industriale ***
- **************************************************************************
- *** Progetto : MONITORAGGIO AUTOSTRADA ***
- **************************************************************************
- *** Realizzato da : Nino Verzellesi e Quadrubbi Giacomo ***
- **************************************************************************
- ***************************************************************************/
-
-
-/* ----------------------------------------------------------------------------- */
-
-#include <kernel/kern.h>
-#include <drivers/glib.h>
-#include <drivers/keyb.h>
-#include <semaphore.h>
-#include <stdlib.h>
-#include <math.h>
-
-/* ----------------------------------------------------------------------------- */
-
-
-/********************* DEFINIZIONE DELLE COSTANTI **************************/
-
-#define ESC 27 /* codice ASCII del tasto ESCAPE */
-#define MAX_V 35 /* massimo numero di veicoli */
-#define GRUPPO 1
-#define LUNGCAMION 40 /* lunghezza del camion */
-#define LARGCAMION 10 /* larghezza del camion */
-#define LUNGLENTA 16 /* lunghezza della macchina lenta */
-#define LARGLENTA 8 /* larghezza della macchina lenta */
-#define LUNGVELOCE 20 /* lunghezza della macchina veloce */
-#define LARGVELOCE 8 /* larghezza della macchina veloce */
-#define DT 0.04 /* passo del campionamento */
-#define CENTROCORSIA1 477 /* coordinata del centro della corsia 1 */
-#define CENTROCORSIA2 459 /* coordinata del centro della corsia 2 */
-#define CENTROCARREGGIATA 469 /* coordinata del centro della carreggiata */
-
-
-/* ----------------------------------------------------------------------------- */
-
-
-/****************** DEFINIZIONE DELLE VARIABILI GLOBALI ********************/
-
-double tick = 1.0; /* system tick = 1 ms */
-int periodo = 40000; /* periodo */
-int wcet = 1000; /* deadline */
-PID pid;
-sem_t mutex; /* semaforo per la grafica */
-sem_t strada; /* semaforo per le variabili corsia1 e corsia2 */
-int MAX_X; /* dimensione x della modalita' di visualizzazione dello schermo */
-int MAX_Y; /* dimensione y della modalita' di visualizzazione dello schermo */
-short corsia1[40000]; /* vettore della corsia1 */
-short corsia2[40000]; /* vettore della corsia2 */
-int xelic; /* cordinata dell'elicottero */
-char c; /* carattere da tastiera */
-
-
-/* ----------------------------------------------------------------------------- */
-
-
-/****************** FUNZIONE CHE DISEGNA I VEICOLI *************************/
-
-void draw_veicolo(int x, int y, int colore,int lunghezza,int larghezza)
-{
- int u; /* indice di ciclo */
- int v; /* variabile ausiliaria per la ricostruzione della segnaletica */
- int xreal; /* coordinata di fine veicolo */
-
- xreal=x-lunghezza; /* calcola la coordinata di fine veicolo */
- if (xreal<0) /* la pone a zero nel caso in cui sia minore di zero (veicolo non ancora interamente entrato in autostrada) */
- xreal=0;
-
- /* disegna il veicolo nella posizione indicata e con il colore indicato */
- sem_wait(&mutex);
- grx_box(xreal,(int)(y-larghezza/2),x,(int)(y+larghezza/2),colore);
- sem_post(&mutex);
-
- /* ricostruisce la segnaletica orrizzontale della strada nel caso in cui si sta' cancellando il veicolo dalla posizione precedente (ridisegna solo quella parte che e' stata cancellata) */
- if (colore==0)
- for (u=xreal;u<x;u++)
- {
- v=u%8;
- if ((v==0) || (v==1))
- {
- sem_wait(&mutex);
- grx_plot(u,CENTROCARREGGIATA,rgb16(255,255,255));
- sem_post(&mutex);
- }
- }
-}
-
-
-/* ----------------------------------------------------------------------------- */
-
-
-/** FUNZIONE CHE CALCOLA LA DISTANZA DAL VEICOLO CHE PRECEDE SULLA CORSIA **/
-
-int dist_ant(int pos_x,int pos_y,int distsic)
-{
- int libero; /* variabile che indica se l'attuale posizione puntata dal veicolo e' libera */
- int distant; /* distanza dal veicolo che ci precede */
- int fine; /* variabile ausiliaria per capire se sto' arrivando alla fine della strada */
-
- /* inizializzazione delle variabili */
- libero=0;
- distant=0;
-
- /* calcola la distanza da un eventuale veicolo che ci precede */
- sem_wait(&strada);
- if (pos_y<CENTROCARREGGIATA) /* controlla se il veicolo e' nella prima corsia, altrimenti e' in seconda corsia */
- while (libero==0 && distant<distsic) /* il calcolo della distanza da un veicolo che ci precede termina quando viene trovato un veicolo o si raggiunge la lunghezza massima di visione del sensore */
- {
- fine=pos_x+distant; /* nel caso in cui il veicolo si giunto alla fine dell'autostrada si assume che il sensore ritorni un valore come nel caso in cui non sia preceduto da nessun veicolo */
- if (fine>40000)
- distant=distsic;
- else
- if (corsia2[fine]!=0) /* se la strada e' occupata da un'altro veicolo pongo la variabile libero ad uno (strada occupata), altrimenti in caso contrario incremento la distanza analizzata dal sensore */
- libero=1;
- else
- distant++;
- }
- else /* il veicolo e' nella seconda corsia */
- while (libero==0 && distant<distsic) /* il calcolo della distanza da un veicolo che ci precede termina quando viene trovato un veicolo o si raggiunge la lunghezza massima di visione del sensore */
- {
- fine=pos_x+distant; /* nel caso in cui il veicolo si giunto alla fine dell'autostrada si assume che il sensore ritorni un valore come nel caso in cui non sia preceduto da nessun veicolo */
- if (fine>40000)
- distant=distsic;
- else
- if (corsia1[fine]!=0) /* se la strada e' occupata da un'altro veicolo pongo la variabile libero ad uno (strada occupata), altrimenti in caso contrario incremento la distanza analizzata dal sensore */
- libero=1;
- else
- distant++;
- }
- sem_post(&strada);
-
- return(distant); /* ritorna il valore della distanza misurata dal sensore , se non ha trovato nessun veicolo tale distanza e' pari alla massima lunghezza a cui puo' arrivare il sensore */
-}
-
-
-/* ----------------------------------------------------------------------------- */
-
-
-/** FUNZIONE CHE CALCOLA LA DISTANZA ANTERIORE DESTRA DI UN VEICOLO CHE PRECEDE **/
-
-int dist_ant_dx(int pos_x,int pos_y,int distsicdx)
-{
- int distantdx; /* distanza dal veicolo che ci precede a destra */
- int libero; /* variabile che indica se l'attuale posizione puntata dal veicolo e' libera */
- int fine; /* variabile ausiliaria per capire se sto' arrivando alla fine della strada */
-
- /* inizializzazione delle variabili */
- libero=0;
- distantdx=0;
-
- sem_wait(&strada);
- while (libero==0 && distantdx<distsicdx) /* il calcolo della distanza da un veicolo che ci precede a destra termina quando viene trovato un veicolo o si raggiunge la lunghezza massima di visione del sensore */
- {
- fine=pos_x+distantdx; /* nel caso in cui il veicolo sia giunto alla fine dell'autostrada si assume che il sensore ritorni un valore come nel caso in cui non sia preceduto da nessun veicolo */
- if (fine>40000)
- distantdx=distsicdx;
- else
- if (corsia1[fine]!=0) /* se la strada e' occupata da un'altro veicolo pongo la variabile libero ad uno (strada occupata), altrimenti in caso contrario incremento la distanza analizzata dal sensore */
- libero=1;
- else
- distantdx++;
- }
- sem_post(&strada);
-
- return(distantdx); /* ritorna il valore della distanza misurata dal sensore , se non ha trovato nessun veicolo tale distanza e' pari alla massima lunghezza a cui puo' arrivare il sensore */
-}
-
-
-/* ----------------------------------------------------------------------------- */
-
-
-/** FUNZIONE CHE CALCOLA LA DISTANZA ANTERIORE SINISTRA DI UN VEICOLO CHE PRECEDE **/
-
-int dist_ant_sx(int pos_x,int pos_y,int distsicsx)
-{
- int distantsx; /* distanza dal veicolo che ci precede a sinistra */
- int libero; /* variabile che indica se l'attuale posizione puntata dal veicolo e' libera */
- int fine; /* variabile ausiliaria per capire se sto' arrivando alla fine della strada */
-
- /* inizializzazione delle variabili */
- libero=0;
- distantsx=0;
-
- sem_wait(&strada);
- while (libero==0 && distantsx<distsicsx) /* il calcolo della distanza da un veicolo che ci precede a sinistra termina quando viene trovato un veicolo o si raggiunge la lunghezza massima di visione del sensore */
- {
- fine=pos_x+distantsx; /* nel caso in cui il veicolo si giunto alla fine dell'autostrada si assume che il sensore ritorni un valore come nel caso in cui non sia preceduto da nessun veicolo */
- if (fine>40000)
- distantsx=distsicsx;
- else
- if (corsia2[fine]!=0) /* se la strada e' occupata da un'altro veicolo pongo la variabile libero ad uno (strada occupata), altrimenti in caso contrario incremento la distanza analizzata dal sensore */
- libero=1;
- else
- distantsx++;
- }
- sem_post(&strada);
-
- return(distantsx); /* ritorna il valore della distanza misurata dal sensore , se non ha trovato nessun veicolo tale distanza e' pari alla massima lunghezza a cui puo' arrivare il sensore */
-}
-
-
-/* ----------------------------------------------------------------------------- */
-
-
-/** FUNZIONE CHE CALCOLA LA DISTANZA POSTERIORE SINISTRA DI UN VEICOLO CHE INSEGUE **/
-
-int dist_postsx (int pos_x,int pos_y,int distsorp)
-{
- int distpostsx; /* distanza dal veicolo che ci insegue a sinistra */
- int libero; /* variabile che indica se l'attuale posizione puntata dal veicolo e' libera */
- int inizio; /* variabile ausiliaria per capire se sono all'inizio della strada */
-
- /* inizializzazione delle variabili */
- distpostsx=0;
- libero=0;
-
- sem_wait(&strada);
- while (libero==0 && distpostsx<distsorp) /* il calcolo della distanza da un veicolo che ci insegue a sinistra termina quando viene trovato un veicolo o si raggiunge la lunghezza massima di visione del sensore */
- {
- inizio=pos_x-distpostsx; /* nel caso in cui il veicolo si giunto alla fine dell'autostrada si assume che il sensore ritorni un valore come nel caso in cui non sia insuguito da nessun veicolo */
- if (inizio<0)
- distpostsx=distsorp;
- else
- if (corsia2[inizio]!=0) /* se la strada e' occupata da un'altro veicolo pongo la variabile libero ad uno (strada occupata), altrimenti in caso contrario incremento la distanza analizzata dal sensore */
- libero=1;
- else
- distpostsx++;
- }
- sem_post(&strada);
-
- return(distpostsx); /* ritorna il valore della distanza misurata dal sensore , se non ha trovato nessun veicolo tale distanza e' pari alla massima lunghezza a cui puo' arrivare il sensore */
-}
-
-
-/* ----------------------------------------------------------------------------- */
-
-
-/** FUNZIONE CHE CALCOLA LA DISTANZA POSTERIORE DESTRA DI UN VEICOLO CHE INSEGUE **/
-
-int dist_postdx (int pos_x,int pos_y,int distrientro)
-{
- int distpostdx; /* distanza dal veicolo che ci insegue a destra */
- int libero; /* variabile che indica se l'attuale posizione puntata dal veicolo e' libera */
- int inizio; /* variabile ausiliaria per capire se sono all'inizio della strada */
-
- /* inizializzazione delle variabili */
- libero=0;
- distpostdx=0;
-
- sem_wait(&strada);
- while (libero==0 && distpostdx<distrientro) /* il calcolo della distanza da un veicolo che ci insegue a destra termina quando viene trovato un veicolo o si raggiunge la lunghezza massima di visione del sensore */
- {
- inizio=pos_x-distpostdx; /* nel caso in cui il veicolo si giunto alla fine dell'autostrada si assume che il sensore ritorni un valore come nel caso in cui non sia inseguito da nessun veicolo */
- if (inizio<0)
- distpostdx=distrientro;
- else
- if (corsia1[inizio]!=0) /* se la strada e' occupata da un'altro veicolo pongo la variabile libero ad uno (strada occupata), altrimenti in caso contrario incremento la distanza analizzata dal sensore */
- libero=1;
- else
- distpostdx++;
- }
- sem_post(&strada);
-
- return(distpostdx); /* ritorna il valore della distanza misurata dal sensore , se non ha trovato nessun veicolo tale distanza e' pari alla massima lunghezza a cui puo' arrivare il sensore */
-}
-
-
-/* ----------------------------------------------------------------------------- */
-
-
-/**************************** TASK AUTO LENTA ******************************/
-
-TASK auto_lenta(void *arg)
-{
- int x; /* posizione x assunta dal veicolo */
- int y; /* posizione y assunta dal veicolo */
- int oxelic; /* posizione vecchia dell'elicottero */
- int ox; /* posizione vecchia x dall'auto lenta */
- int oy; /* posizione vecchia y dall'auto lenta */
- int k; /* indice di ciclo */
- int estremo; /* distanza massima a cui ci possiamo spostare dall'elicottero (sia a destra che a sinistra) */
- int sorpasso; /* indica se il veicolo e' in fase di sorpasso */
- int rientro; /* indica se il veicolo e' in fase di rientro */
- int precedentedritto; /* distanza anteriore da un veicolo */
- int od; /* vecchia distanza anteriore da un veicolo */
- int tot; /* distanza massima raggiungibile del sensore posteriore sinistro */
- int tot3; /* distanza massima raggiungibile del sensore anteriore destro */
- int tot2; /* distanza massima raggiungibile del sensore posteriore destro */
- int i = (int)arg;
- int sensore_ant=200; /* distanza massima raggiungibile del sensore anteriore */
- char stri[22]; /* vettore di caratteri */
- char ostri[22]; /* vettore di caratteri */
- float vcrociera; /* velocita' desiderata */
- float vmax2=35.0; /* velocita' massima raggiungibile in seconda corsia */
- float vmax1=25.0; /* velocita' massima raggiungibile in prima corsia */
- float frenata=-7.0; /* valore massimo della frenata */
- float amax=10.0; /* valore massimo dell'accellerazione */
- float v; /* velocita' attuale */
- float a; /* accellerazione attuale */
- float ov; /* velocita' precedente */
- float oa; /* accellerazione precedente */
-
- /* inizializzazione delle variabili */
- v=5.0;
- a=0.0;
- x=LUNGLENTA;
- y=CENTROCORSIA1;
- sorpasso=0;
- rientro=0;
- tot=100;
- tot2=150;
- tot3=100;
- vcrociera=vmax1;
- oa=a;
- ov=v;
- od=0;
- oxelic=xelic;
- estremo=(int)((MAX_X/2)-1);
-
- while (1)
- {
- /* cancella il veicolo se era presente sull'autostrada vista dall'elicottero */
- if (abs(oxelic-ox)<estremo)
- draw_veicolo(ox-oxelic+estremo, oy, 0,LUNGLENTA,LARGLENTA);
-
- /* salva le vecchie coordinate */
- ox = x;
- oy = y;
-
- /* cancella il veicolo dalla vecchia posizione sulla corsia , andando a cancellarlo nel vettore della corsia in cui si trovava */
- sem_wait(&strada);
- for (k=0;k<LUNGLENTA;k++)
- {
- if ((oy<CENTROCORSIA1) && (oy>CENTROCORSIA2))
- {
- corsia1[ox-k]=0;
- corsia2[ox-k]=0;
- }
- else
- if (oy==CENTROCORSIA1)
- corsia1[ox-k]=0;
- else
- if (oy==CENTROCORSIA2)
- corsia2[ox-k]=0;
- }
- sem_post(&strada);
-
- /* cancella tutte le vecchie informazioni che compaiono sullo schermo */
- sprintf(stri,"posizione %d",(int)(ox*0.25));
- sem_wait(&mutex);
- grx_text(stri,70,50+i*10,rgb16(0,0,0),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(ostri,"a %nf",oa);
- sem_wait(&mutex);
- grx_text(ostri,300,50+i*10,rgb16(0,0,0),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(ostri,"v %nf",ov);
- sem_wait(&mutex);
- grx_text(ostri,200,50+i*10,rgb16(0,0,0),rgb16(0,0,0));
- sem_post(&mutex);
-
- /* legge la distanza dal sensore anteriore e nel caso in cui sia attaccato alla macchina che precede vengo eliminato */
- precedentedritto=dist_ant(x,y,sensore_ant);
- if (precedentedritto==1)
- task_abort(i);
-
- /* disegna il veicolo nella nuova posizione */
- if (abs(xelic-x)<estremo)
- draw_veicolo(x-xelic+estremo, y, rgb16(255,0,0),LUNGLENTA,LARGLENTA);
-
- /* varia la massima distanza vista dal sensore posteriore sinistro a seconda della velocita' */
- tot=(int)(v*4);
- if (tot<50)
- tot=50;
-
- if (precedentedritto<100) /* ci siamo avvicinando troppo alla macchina che ci precede */
- if ((sorpasso==0) && (dist_postsx(x,y,200)>tot)&&(dist_ant_sx(x,y,50)>40))
- {
- /* c'e' uno davanti e non sopraggiunge nessuno sulla corsia di sorpasso */
- sorpasso=1;
- rientro=0;
- vcrociera=vmax2;
- }
- else
- a=frenata; /* c'e qualcuno davanti ,ma non possiamo sorpassare */
- else /* siamo lontani da un veicolo che ci precede o non ci precede nessuno */
- if (v<vcrociera) /* accelleriamo gradualmente fino a portarci alla velocita' di crociera desiderata */
- a=amax-(amax/vcrociera)*v;
- else
- if(v>vcrociera) /* freniamo per portarci al valore della velocita'di crociera */
- a=frenata/3;
- else
- a=0.0; /* siamo alla velocita' di crociera */
-
- /* controlla se e' possibile la manovra di rientro dal sorpasso, aggiustando tutti i parametri nel modo corretto */
- if ((dist_postdx(x,y,200)>tot2) && (dist_ant_dx(x,y,200)>tot3) && (sorpasso==1))
- {
- rientro=1;
- sorpasso=0;
- vcrociera=vmax1;
- }
-
- /* aggiusta la cordinata y per far visualizzare il sorpasso o il rientro della macchina in modo graduale */
- if(y>CENTROCORSIA2 && sorpasso==1)
- y=y-1;
-
- if(y<CENTROCORSIA1 && rientro==1)
- y=y+1;
-
- /* calcola la velocita' e nel caso di v elocita' negative la pone a zero (non sono permesse le retromarcie) */
- v=v+a*DT;
- if (v<0)
- v=0.0;
-
- /* calcola la cordinata x a cui si trova la macchina */
- x=x+(int)((v*DT)/0.25);
-
- /* scrive a video i nuovi parametri appena calcolati */
- sprintf(stri,"posizione %d",(int)(x*0.25));
- sem_wait(&mutex);
- grx_text(stri,70,50+i*10,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(ostri,"v %nf",v);
- sem_wait(&mutex);
- grx_text(ostri,200,50+i*10,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(ostri,"a %nf",a);
- sem_wait(&mutex);
- grx_text(ostri,300,50+i*10,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- /* quando il veicolo arriva alla fine dell'autostrada viene eliminato */
- if (x>=40000)
- task_abort(i);
-
- /* salva la nuova posizione del veicolo */
- sem_wait(&strada);
- for (k=0;k<LUNGLENTA;k++)
- {
- if ((y<CENTROCORSIA1) && (y>CENTROCORSIA2))
- {
- corsia2[x-k]=1;
- corsia1[x-k]=1;
- }
- else
- if (y==CENTROCORSIA1)
- corsia1[x-k]=1;
- else
- if (y==CENTROCORSIA2)
- corsia2[x-k]=1;
- }
- sem_post(&strada);
-
- /* salvo i parametri che occorrono per il prossimo ciclo */
- oxelic=xelic;
- od=precedentedritto;
- ov=v;
- oa=a;
-
- task_endcycle(); /* termina le operazioni che il task deve eseguire */
- }
-}
-
-
-/* ----------------------------------------------------------------------------- */
-
-
-/************************** TASK AUTO VELOCE *******************************/
-
-TASK auto_veloce(void *arg)
-{
- int x; /* posizione x assunta dal veicolo */
- int y; /* posizione y assunta dal veicolo */
- int oxelic; /* posizione vecchia dell'elicottero */
- int ox; /* posizione vecchia x dall'auto veloce */
- int oy; /* posizione vecchia y dall'auto veloce */
- int k; /* indice di ciclo */
- int estremo; /* distanza massima a cui ci possiamo spostare dall'elicottero (sia a destra che a sinistra) */
- int sorpasso; /* indica se il veicolo e' in fase di sorpasso */
- int rientro; /* indica se il veicolo e' in fase di rientro */
- int precedentedritto; /* distanza anteriore da un veicolo */
- int od; /* vecchia distanza anteriore da un veicolo */
- int tot; /* distanza massima raggiungibile del sensore posteriore sinistro */
- int tot3; /* distanza massima raggiungibile del sensore anteriore destro */
- int tot2; /* distanza massima raggiungibile del sensore posteriore destro */
- int i = (int)arg;
- int sensore_ant=200; /* distanza massima raggiungibile del sensore anteriore */
- char stri[22]; /* vettore di caratteri */
- char ostri[22]; /* vettore di caratteri */
- float vcrociera; /* velocita' desiderata */
- float vmax1=35.0; /* velocita' massima raggiungibile in prima corsia */
- float vmax2=40.0; /* velocita' massima raggiungibile in seconda corsia */
- float frenata=-7.0; /* valore massimo della frenata */
- float amax=15.0; /* valore massimo del'accellerazione */
- float v; /* velocita' attuale */
- float a; /* accellerazione attuale */
- float ov; /* velocita' precedente */
- float oa; /* accellerazione precedente */
-
- /* inizializzazione delle variabili */
- v=5.0;
- a=0.0;
- x=LUNGVELOCE;
- y=CENTROCORSIA1;
- sorpasso=0;
- rientro=0;
- tot=100;
- tot2=150;
- tot3=100;
- oa=a;
- vcrociera=vmax1;
- ov=v;
- od=0;
- oxelic=xelic;
- estremo=(int)((MAX_X/2)-1);
-
- while (1)
- {
- /* cancella il veicolo se era presente sull'autostrada vista dall'elicottero */
- if (abs(oxelic-ox)<estremo)
- draw_veicolo(ox-oxelic+estremo, oy, 0,LUNGVELOCE,LARGVELOCE);
-
- /* salva le vecchie coordinate */
- ox = x;
- oy = y;
-
- /* cancella il veicolo dalla vecchia posizione sulla corsia , andando a cancellarlo nel vettore della corsia in cui si trovava */
- sem_wait(&strada);
- for (k=0;k<LUNGVELOCE;k++)
- {
- if ((oy<CENTROCORSIA1) && (oy>CENTROCORSIA2))
- {
- corsia1[ox-k]=0;
- corsia2[ox-k]=0;
- }
- else
- if (oy==CENTROCORSIA1)
- corsia1[ox-k]=0;
- else
- if (oy==CENTROCORSIA2)
- corsia2[ox-k]=0;
- }
- sem_post(&strada);
-
- /* cancella tutte le vecchie informazioni che compaiono sullo schermo */
- sprintf(stri,"posizione %d",(int)(ox*0.25));
- sem_wait(&mutex);
- grx_text(stri,70,50+i*10,rgb16(0,0,0),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(ostri,"v %nf",ov);
- sem_wait(&mutex);
- grx_text(ostri,200,50+i*10,rgb16(0,0,0),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(ostri,"a %nf",oa);
- sem_wait(&mutex);
- grx_text(ostri,300,50+i*10,rgb16(0,0,0),rgb16(0,0,0));
- sem_post(&mutex);
-
- /* legge la distanza dal sensore anteriore e nel caso in cui sia attaccato alla macchina che precede vengo eliminato */
- precedentedritto=dist_ant(x,y,sensore_ant);
- if (precedentedritto==1)
- task_abort(i);
-
- /* disegna il veicolo nella nuova posizione */
- if (abs(xelic-x)<estremo)
- draw_veicolo(x-xelic+estremo, y, rgb16(0,255,0),LUNGVELOCE,LARGVELOCE);
-
-
- /* varia la massima distanza vista dal sensore posteriore sinistro a seconda della velocita' */
- tot=(int)(v*4);
- if (tot<50)
- tot=50;
-
- if (precedentedritto<150) /* ci siamo avvicinando troppo alla macchina che ci precede */
- if ((sorpasso==0) && (dist_postsx(x,y,200)>tot)&&(dist_ant_sx(x,y,50)>40))
- {
- /* c'e' uno davanti e non sopraggiunge nessuno sulla corsia di sorpasso */
- sorpasso=1;
- rientro=0;
- vcrociera=vmax2;
- }
- else /* c'e qualcuno davanti ,ma non possiamo sorpassare */
- a=frenata;
- else /* siamo lontani da un veicolo che ci precede o non ci precede nessuno */
- if (v<vcrociera) /* accelleriamo gradualmente fino a portarci alla velocita' di crociera desiderata */
- a=amax-(amax/vcrociera)*v;
- else
- if(v>vcrociera) /* freniamo per portarci al valore della velocita'di crociera */
- a=frenata/3;
- else
- a=0.0; /* siamo alla velocita' di crociera */
-
- /* controlla se e' possibile la manovra di rientro dal sorpasso, aggiustando tutti i parametri nel modo corretto */
- if ((dist_postdx(x,y,200)>tot2) && (dist_ant_dx(x,y,200)>tot3) && (sorpasso==1))
- {
- rientro=1;
- sorpasso=0;
- vcrociera=vmax1;
- }
-
- /* aggiusta la cordinata y per far visualizzare il sorpasso o il rientro della macchina in modo graduale */
- if(y>CENTROCORSIA2 && sorpasso==1)
- y=y-1;
-
- if(y<CENTROCORSIA1 && rientro==1)
- y=y+1;
-
- /* calcola la velocita' e nel caso di v elocita' negative la pone a zero (non sono permesse le retromarcie) */
- v=v+a*DT;
- if (v<0)
- v=0.0;
-
- /* calcola la cordinata x a cui si trova la macchina */
- x=x+(int)((v*DT)/0.25);
-
- /* scrive a video i nuovi parametri appena calcolati */
- sprintf(stri,"posizione %d",(int)(x*0.25));
- sem_wait(&mutex);
- grx_text(stri,70,50+i*10,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(ostri,"v %nf",v);
- sem_wait(&mutex);
- grx_text(ostri,200,50+i*10,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(ostri,"a %nf",a);
- sem_wait(&mutex);
- grx_text(ostri,300,50+i*10,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- /* quando il veicolo arriva alla fine dell'autostrada viene eliminato */
- if (x>=40000)
- task_abort(i);
-
- /* salva la nuova posizione del veicolo */
- sem_wait(&strada);
- for (k=0;k<LUNGVELOCE;k++)
- {
- if ((y<CENTROCORSIA1) && (y>CENTROCORSIA2))
- {
- corsia2[x-k]=1;
- corsia1[x-k]=1;
- }
- else
- if (y==CENTROCORSIA1)
- corsia1[x-k]=1;
- else
- if (y==CENTROCORSIA2)
- corsia2[x-k]=1;
- }
- sem_post(&strada);
-
- /* salvo i parametri che occorrono per il prossimo ciclo */
- oxelic=xelic;
- od=precedentedritto;
- ov=v;
- oa=a;
-
- task_endcycle(); /* termina le operazioni che il task deve eseguire */
- }
-}
-
-
-/* ----------------------------------------------------------------------------- */
-
-
-/***************************** TASK AUTOCARRO ******************************/
-
-TASK auto_carro(void *arg)
-{
- int x; /* posizione x assunta dal veicolo */
- int y; /* posizione y assunta dal veicolo */
- int oxelic; /* posizione vecchia dell'elicottero */
- int ox; /* posizione vecchia x assunta dal camion */
- int oy; /* posizione vecchia y assunta dal camion */
- int k; /* indice di ciclo */
- int estremo; /* distanza massima a cui ci possiamo spostare dall'elicottero (sia a destra che a sinistra) */
- int sorpasso; /* indica se il veicolo e' in fase di sorpasso */
- int rientro; /* indica se il veicolo e' in fase di rientro */
- int precedentedritto; /* distanza anteriore da un veicolo */
- int od; /* vecchia distanza anteriore da un veicolo */
- int tot; /* distanza massima raggiungibile del sensore posteriore sinistro */
- int tot3; /* distanza massima raggiungibile del sensore anteriore destro */
- int tot2; /* distanza massima raggiungibile del sensore posteriore destro */
- int i = (int)arg;
- int sensore_ant=200; /* distanza massima raggiungibile del sensore anteriore */
- char stri[22]; /* vettore di caratteri */
- char ostri[22]; /* vettore di caratteri */
- float vcrociera; /* velocita' desiderata */
- float vmax1=15.0; /* velocita' massima raggiungibile in prima corsia */
- float vmax2=20.0; /* velocita' massima raggiungibile in seconda corsia */
- float frenata=-5.0; /* valore massimo della frenata */
- float amax=3.0; /* valore massimo del'accellerazione */
- float v; /* velocita' attuale */
- float a; /* accellerazione attuale */
- float ov; /* velocita' precedente */
- float oa; /* accellerazione precedente */
-
- /* inizializzazione delle variabili */
- v=5.0;
- a=0.0;
- x=LUNGCAMION;
- y=CENTROCORSIA1;
- sorpasso=0;
- rientro=0;
- tot=100;
- tot2=150;
- tot3=100;
- oa=a;
- vcrociera=vmax1;
- ov=v;
- od=0;
- oxelic=xelic;
- estremo=(int)((MAX_X/2)-1);
-
- while (1)
- {
- /* cancella il veicolo se era presente sull'autostrada vista dall'elicottero */
- if (abs(oxelic-ox)<estremo)
- draw_veicolo(ox-oxelic+estremo, oy, 0,LUNGCAMION,LARGCAMION);
-
- /* salva le vecchie coordinate */
- ox = x;
- oy = y;
-
- /* cancella il veicolo dalla vecchia posizione sulla corsia , andando a cancellarlo nel vettore della corsia in cui si trovava */
- sem_wait(&strada);
- for (k=0;k<LUNGCAMION;k++)
- {
- if ((oy<CENTROCORSIA1) && (oy>CENTROCORSIA2))
- {
- corsia1[ox-k]=0;
- corsia2[ox-k]=0;
- }
- else
- if (oy==CENTROCORSIA1)
- corsia1[ox-k]=0;
- else
- if (oy==CENTROCORSIA2)
- corsia2[ox-k]=0;
- }
- sem_post(&strada);
-
- /* cancella tutte le vecchie informazioni che compaiono sullo schermo */
- sprintf(stri,"posizione %d",(int)(ox*0.25));
- sem_wait(&mutex);
- grx_text(stri,70,50+i*10,rgb16(0,0,0),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(ostri,"v %nf",ov);
- sem_wait(&mutex);
- grx_text(ostri,200,50+i*10,rgb16(0,0,0),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(ostri,"a %nf",oa);
- sem_wait(&mutex);
- grx_text(ostri,300,50+i*10,rgb16(0,0,0),rgb16(0,0,0));
- sem_post(&mutex);
-
- /* legge la distanza dal sensore anteriore e nel caso in cui sia attaccato alla macchina che precede vengo eliminato */
- precedentedritto=dist_ant(x,y,sensore_ant);
- if (precedentedritto==1)
- task_abort(i);
-
- /* disegna il veicolo nella nuova posizione */
- if (abs(xelic-x)<estremo)
- draw_veicolo(x-xelic+estremo, y, rgb16(0,0,255),LUNGCAMION,LARGCAMION);
-
- /* varia la massima distanza vista dal sensore posteriore sinistro a seconda della velocita' */
- tot=(int)(v*4);
- if (tot<50)
- tot=50;
-
- if (precedentedritto<100) /* ci siamo avvicinando troppo alla macchina che ci precede */
- if ((sorpasso==0) && (dist_postsx(x,y,200)>tot)&&(dist_ant_sx(x,y,50)>40))
- {
- /* c'e' uno davanti e non sopraggiunge nessuno sulla corsia di sorpasso */
- sorpasso=1;
- rientro=0;
- vcrociera=vmax2;
- }
- else /* c'e qualcuno davanti ,ma non possiamo sorpassare */
- a=frenata;
- else /* siamo lontani da un veicolo che ci precede o non ci precede nessuno */
- if (v<vcrociera) /* accelleriamo gradualmente fino a portarci alla velocita' di crociera desiderata */
- a=amax-(amax/vcrociera)*v;
- else
- if(v>vcrociera) /* freniamo per portarci al valore della velocita'di crociera */
- a=frenata/3;
- else
- a=0.0; /* siamo alla velocita' di crociera */
-
- /* controlla se e' possibile la manovra di rientro dal sorpasso, aggiustando tutti i parametri nel modo corretto */
- if ((dist_postdx(x,y,200)>tot2) && (dist_ant_dx(x,y,200)>tot3) && (sorpasso==1))
- {
- rientro=1;
- sorpasso=0;
- vcrociera=vmax1;
- }
-
- /* aggiusta la cordinata y per far visualizzare il sorpasso o il rientro della macchina in modo graduale */
- if(y>CENTROCORSIA2 && sorpasso==1)
- y=y-1;
-
- if(y<CENTROCORSIA1 && rientro==1)
- y=y+1;
-
- /* calcola la velocita' e nel caso di v elocita' negative la pone a zero (non sono permesse le retromarcie) */
- v=v+a*DT;
- if (v<0)
- v=0.0;
-
- /* calcola la cordinata x a cui si trova la macchina */
- x=x+(int)((v*DT)/0.25);
-
- /* scrive a video i nuovi parametri appena calcolati */
- sprintf(stri,"posizione %d",(int)(x*0.25));
- sem_wait(&mutex);
- grx_text(stri,70,50+i*10,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(ostri,"v %nf",v);
- sem_wait(&mutex);
- grx_text(ostri,200,50+i*10,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(ostri,"a %nf",a);
- sem_wait(&mutex);
- grx_text(ostri,300,50+i*10,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- /* quando il veicolo arriva alla fine dell'autostrada viene eliminato */
- if (x>=40000)
- task_abort(i);
-
- /* salva la nuova posizione del veicolo */
- sem_wait(&strada);
- for (k=0;k<LUNGCAMION;k++)
- {
- if ((y<CENTROCORSIA1) && (y>CENTROCORSIA2))
- {
- corsia2[x-k]=1;
- corsia1[x-k]=1;
- }
- else
- if (y==CENTROCORSIA1)
- corsia1[x-k]=1;
- else
- if (y==CENTROCORSIA2)
- corsia2[x-k]=1;
- }
- sem_post(&strada);
-
- /* salvo i parametri che occorrono per il prossimo ciclo */
- oxelic=xelic;
- od=precedentedritto;
- ov=v;
- oa=a;
-
- task_endcycle(); /* termina le operazioni che il task deve eseguire */
- }
-}
-
-
-/* ----------------------------------------------------------------------------- */
-
-
-/***************************** TASK ELICOTTERO *****************************/
-
-TASK eli_cottero(void *arg)
-{
- int i = (int)arg;
- int oxelic; /* vecchia posizione dell'elicottero */
- char stri[22]; /* vettore di caratteri */
- char ostri[22]; /* vettore di caratteri */
-
- /* disegna le scritte per l'indicatore a barra e finestra della posizione dell'elicottero */
- sprintf(stri,"0 Km");
- sem_wait(&mutex);
- grx_text(stri,100,560,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(stri,"10 Km");
- sem_wait(&mutex);
- grx_text(stri,700,560,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- while (1)
- {
- oxelic=xelic; /* salva la posizione precedente dell'elicottero */
-
- if (c == '+') /* sposta l'elicottero a destra (verso la fine dell'autostrada */
- {
- xelic=xelic+50;
- if (xelic>40000-(int)((MAX_X/2)-1))
- xelic=40000-(int)((MAX_X/2)-1);
- }
- else
- if (c =='-') /* sposta l'elicottero a sinistra (verso l'inizio dell'autostrada */
- {
- xelic=xelic-30;
- if (xelic<(int)((MAX_X/2)-1))
- xelic=(int)((MAX_X/2)-1);
- }
-
- /* disegna le scritte innerenti all'elicottero e il valore della sua posizione (mediante scritta ed indicatore a barra con una finestra scorrevole) */
- sprintf(stri,"- <- xelic %d -> +",(int)(xelic*0.25));
- sprintf(ostri,"- <- xelic %d -> +",(int)(oxelic*0.25));
-
- sem_wait(&mutex);
- grx_text(ostri,MAX_X/2-50,500,rgb16(0,0,0),rgb16(0,0,0));
- grx_text(stri,MAX_X/2-50,500,rgb16(255,255,255),rgb16(0,0,0));
- grx_line(150,560,650,560,rgb16(255,255,255));
- grx_rect((int)((oxelic-(MAX_X/2))/80+150),540,(int)((oxelic+(MAX_X/2))/80+150) ,580 ,rgb16(0,0,0));
- grx_rect((int)((xelic-(MAX_X/2))/80+150),540,(int)((xelic+(MAX_X/2))/80+150) ,580 ,rgb16(255,255,255));
- sem_post(&mutex);
-
- c=' '; /* setta il carattere c */
-
- task_endcycle(); /* termina le operazioni che il task deve eseguire */
- }
-}
-
-
-/* -----------------------------------------------------------------------------*/
-
-
-/************* FUNZIONE DI USCITA DAL SISTEMA ******************************/
-
-void byebye(void *arg)
-{ /* questa funzione e' chiamata quando il sistema esce */
- grx_close(); /* chiude la grafica */
- kern_printf("Ciao Ciao "); /* scrive il messaggio indicato sul terminale */
-}
-
-
-/* -----------------------------------------------------------------------------*/
-
-
-/********************************* MAIN ************************************/
-
-int main(int argc, char **argv)
-{
- int n_task = 0; /* numero di task creati */
- int u;
- int v;
- char introduzione[100]; /* vettore di caratteri */
- HARD_TASK_MODEL autolenta; /* task auto lenta */
- HARD_TASK_MODEL autoveloce; /* task auto veloce */
- HARD_TASK_MODEL autocarro; /* task camion */
- HARD_TASK_MODEL elicottero; /* task elicottero */
-
-
- /* inizializza le corsie dell'autostrada */
- sem_wait(&strada);
- for (u=0;u<=40000;u++)
- {
- corsia1[u]=0;
- corsia2[u]=0;
- }
- sem_post(&strada);
-
- /* Set the exception handler */
- //set_exchandler_grx();
-
- /* Set the closing function */
- sys_atrunlevel(byebye, NULL, RUNLEVEL_BEFORE_EXIT);
-
- /* inizializzazione grafica */
- if (grx_init() < 1)
- sys_abort(1);
-
- /* scelta automatica della risoluzione applicabile con quella scheda video (scegliendola tra 800*600 e 1024*768 ) */
- if(grx_getmode(1024,768,16)==-1)
- {
- if (grx_open(800, 600, 16) < 0)
- {
- kern_printf("GRX Err\n");
- sys_abort(1);
- }
- MAX_X=800;
- MAX_Y=600;
- }
- else
- {
- if (grx_open(1024,768, 16) < 0)
- {
- kern_printf("GRX Err\n");
- sys_abort(1);
- }
- MAX_X=1024;
- MAX_Y=768;
- }
-
- kern_printf("La scheda video va'!!\n");
-
- /* posizione iniziale elicottero */
- xelic=(int)((MAX_X/2)-1);
-
- /* disegna lo scenario della strada ed il menu */
- sprintf(introduzione,"Monitoraggio dei mezzi che transitano su una autostrada.");
- sem_wait(&mutex);
- grx_text(introduzione,50,10,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(introduzione,"Sviluppato da: Verzellesi Quadrubbi");
- sem_wait(&mutex);
- grx_text(introduzione,50,20,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(introduzione,"MENU");
- sem_wait(&mutex);
- grx_text(introduzione,480,70,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(introduzione,"s = macchina sportiva");
- sem_wait(&mutex);
- grx_text(introduzione,480,80,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(introduzione,"c = mezzo pesante");
- sem_wait(&mutex);
- grx_text(introduzione,480,90,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(introduzione,"l = macchina lenta");
- sem_wait(&mutex);
- grx_text(introduzione,480,100,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(introduzione,"+ = sposta l'elicottero verso destra");
- sem_wait(&mutex);
- grx_text(introduzione,480,110,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(introduzione,"- = sposta l'elicottero verso sinistra");
- sem_wait(&mutex);
- grx_text(introduzione,480,120,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(introduzione,"esc = uscita");
- sem_wait(&mutex);
- grx_text(introduzione,480,130,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(introduzione,"NOTA");
- sem_wait(&mutex);
- grx_text(introduzione,480,140,rgb16(255,0,0),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(introduzione,"Se i veicoli tamponano ");
- sem_wait(&mutex);
- grx_text(introduzione,480,150,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- sprintf(introduzione," vengono eliminati");
- sem_wait(&mutex);
- grx_text(introduzione,480,160,rgb16(255,255,255),rgb16(0,0,0));
- sem_post(&mutex);
-
- grx_line(1,450,MAX_X,450,rgb16(255,255,255));
- grx_line(1,486,MAX_X,486,rgb16(255,255,255));
-
- for (u=0;u<MAX_X;u++)
- {
- v=u%8;
- if ((v==0) || (v==1))
- {
- sem_wait(&mutex);
- grx_plot(u,CENTROCARREGGIATA,rgb16(255,255,255));
- sem_post(&mutex);
- }
- }
-
- n_task=0; /* inizializzazione del numero dei task */
-
- /* definisce e crea il task elicottero */
- kern_printf("elicottero");
- hard_task_default_model (elicottero);
- hard_task_def_ctrl_jet (elicottero);
- hard_task_def_arg (elicottero, (void *)n_task);
- hard_task_def_wcet (elicottero,wcet);
- hard_task_def_mit (elicottero, periodo);
- hard_task_def_group (elicottero, GRUPPO);
- hard_task_def_usemath (elicottero);
- pid = task_create ("elicottero",eli_cottero, &elicottero, NULL);
- if (pid == NIL)
- {
- grx_close();
- perror("Non si puo' creare il task");
- sys_abort(1);
- }
- task_activate(pid);
-
- n_task=1; /* incremente il numero dei task (ha creato l'elicottero */
-
- /*Attesa di un carattere per creare un veicolo */
- c = keyb_getch(BLOCK);
- do {
- if (((c == 'c')||(c=='s')||(c=='l')) && (n_task < MAX_V)) /* in base al tasto premuto crea il task opportuno */
- {
- if (c == 'l') /* definisce e crea il task autolenta */
- {
- kern_printf("lenta");
- hard_task_default_model (autolenta);
- hard_task_def_ctrl_jet (autolenta);
- hard_task_def_arg (autolenta, (void *)n_task);
- hard_task_def_wcet (autolenta, wcet);
- hard_task_def_mit (autolenta, periodo);
- hard_task_def_group (autolenta, GRUPPO);
- hard_task_def_usemath (autolenta);
- pid = task_create ("autolenta",auto_lenta, &autolenta, NULL);
- }
- else
- if (c == 's') /* definisce e crea il task autoveloce */
- {
- hard_task_default_model (autoveloce);
- hard_task_def_ctrl_jet (autoveloce);
- hard_task_def_arg (autoveloce, (void *)n_task);
- hard_task_def_wcet (autoveloce, wcet);
- hard_task_def_mit (autoveloce, periodo);
- hard_task_def_group (autoveloce, GRUPPO);
- hard_task_def_usemath (autoveloce);
- pid = task_create ("autoveloce",auto_veloce, &autoveloce, NULL);
- }
- else
- if (c == 'c') /* definisce e crea il task autocarro */
- {
- hard_task_default_model (autocarro);
- hard_task_def_ctrl_jet (autocarro);
- hard_task_def_arg (autocarro, (void *)n_task);
- hard_task_def_wcet (autocarro, wcet);
- hard_task_def_mit (autocarro, periodo);
- hard_task_def_group (autocarro, GRUPPO);
- hard_task_def_usemath (autocarro);
- pid = task_create ("camion",auto_carro, &autocarro, NULL);
- }
-
- if (pid == NIL) /* nel caso in non si possano creare dei task chiude la grafica e con un messaggio segnala l'errore */
- {
- grx_close();
- perror("Non si puo' creare il task");
- sys_abort(1);
- }
-
- task_activate(pid); /* attiva i task */
- n_task++; /* incrementa il numero dei task creati */
- }
-
- c = keyb_getch(BLOCK);
-
- } while (c != ESC); /* termino il tutto solo quando e' stato premuto il tasto esc */
-
- sys_end(); /* esco dal sistema */
-
- return 0;
-}
Index: rel_1_21/autostr/initfile.c
===================================================================
--- rel_1_21/autostr/initfile.c (revision 1217)
+++ rel_1_21/autostr/initfile.c (nonexistent)
@@ -1,120 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: initfile.c,v 1.1 2003-06-04 09:41:15 giacomo Exp $
-
- File: $File$
- Revision: $Revision: 1.1 $
- Last update: $Date: 2003-06-04 09:41:15 $
- ------------
-
- System initialization file
-
- This file contains the 2 functions needed to initialize the system.
-
- These functions register the following levels:
-
- an EDF (Earliest Deadline First) level
- a RR (Round Robin) level
- a CBS (Costant Bandwidth Server) level
- a Dummy level
-
- It can accept these task models:
-
- HARD_TASK_MODEL (wcet+mit) at level 0
- SOFT_TASK_MODEL (met, period) at level 1
- NRT_TASK_MODEL at level 2
-
- This file is similar to the configuration of kernel/init/hartik3.c
-
- TICK is set to 0 (one-shot timer is used)
-*/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- CBS_register_level(CBS_ENABLE_ALL, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- SEM_register_module();
-
- CABS_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- keyb_def_ctrlC(kparms, NULL);
- keyb_def_map(kparms,itaMap);
- KEYB_init(&kparms);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
Index: rel_1_21/autostr/makefile
===================================================================
--- rel_1_21/autostr/makefile (revision 1217)
+++ rel_1_21/autostr/makefile (nonexistent)
@@ -1,17 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS= autostr
-
-include $(BASE)/config/example.mk
-
-autostr:
- make -f $(SUBMAKE) APP=autostr INIT= OTHEROBJS="initfile.o" OTHERINCL= SHARKOPT="__OLDCHAR__ __GRX__"
-
-
Index: rel_1_21/mesatex/initfile.c
===================================================================
--- rel_1_21/mesatex/initfile.c (revision 1217)
+++ rel_1_21/mesatex/initfile.c (nonexistent)
@@ -1,119 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: initfile.c,v 1.2 2003-04-28 11:14:08 giacomo Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-04-28 11:14:08 $
- ------------
-
- System initialization file
-
- This file contains the 2 functions needed to initialize the system.
-
- These functions register the following levels:
-
- an EDF (Earliest Deadline First) level
- a RR (Round Robin) level
- a CBS (Costant Bandwidth Server) level
- a Dummy level
-
- It can accept these task models:
-
- HARD_TASK_MODEL (wcet+mit) at level 0
- SOFT_TASK_MODEL (met, period) at level 1
- NRT_TASK_MODEL at level 2
-
- This file is similar to the configuration of kernel/init/hartik3.c
-
- TICK is set to 0 (one-shot timer is used)
-*/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-
-
-/*+ sysyem tick in us +*/
-#define TICK 1000
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- CBS_register_level(CBS_ENABLE_ALL, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- SEM_register_module();
-
- CABS_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- keyb_def_ctrlC(kparms, NULL);
- KEYB_init(&kparms);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
Index: rel_1_21/mesatex/mesatex.c
===================================================================
--- rel_1_21/mesatex/mesatex.c (revision 1217)
+++ rel_1_21/mesatex/mesatex.c (nonexistent)
@@ -1,407 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Giacomo Guidi <giacomo@gandalf.sssup.it>
- *
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-#include <drivers/vga.h>
-#include <drivers/keyb.h>
-
-#include <GL/osmesa.h>
-#include <GL/glut.h>
-
-#include <math.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <kernel/log.h>
-#include <kernel/kern.h>
-
-#ifndef M_PI
-#define M_PI 3.14159265
-#endif
-
-#define WIDTH 640
-#define HEIGHT 480
-#define BYTES_PP 2 //BytesPerPixel
-#define INITSTR G640x480x64K //SVGAlib standard mode definitions
-#define CARD VESA //Video driver
-
-OSMesaContext ctx;
-
-static GLuint TexObj[2];
-static GLfloat Angle = 0.0f;
-static GLboolean UseObj = GL_FALSE;
-
-#if defined(GL_VERSION_1_1) || defined(GL_VERSION_1_2)
-# define TEXTURE_OBJECT 1
-#elif defined(GL_EXT_texture_object)
-# define TEXTURE_OBJECT 1
-# define glBindTexture(A,B) glBindTextureEXT(A,B)
-# define glGenTextures(A,B) glGenTexturesEXT(A,B)
-# define glDeleteTextures(A,B) glDeleteTexturesEXT(A,B)
-#endif
-
-unsigned char *rgb_565_buf = NULL; //RGB 16 bpp Buffer
-unsigned char *video_buf = NULL; //Video Buffer
-
-unsigned long int VMEMLONG = WIDTH * HEIGHT * BYTES_PP / 4; // Used by copy_videomem_16to16
-unsigned long int RGB565MEM = WIDTH * HEIGHT * BYTES_PP; // Total video mem
-
-unsigned long int PERIOD_REFRESH = 60000;
-unsigned long int PERIOD_DISEGNA = 60000;
-
-unsigned long int WCET_REFRESH, WCET_DISEGNA;
-
-TASK refesh(void);
-TASK disegna(void);
-
-PID refresh_PID, disegna_PID;
-
-static void draw( void )
-{
- glDepthFunc(GL_EQUAL);
- /* glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );*/
- glClear( GL_COLOR_BUFFER_BIT );
-
- glColor3f( 1.0, 1.0, 1.0 );
-
- /* draw first polygon */
- glPushMatrix();
- glTranslatef( -1.0, 0.0, 0.0 );
- glRotatef( Angle, 0.0, 0.0, 1.0 );
- if (UseObj) {
-#ifdef TEXTURE_OBJECT
- glBindTexture( GL_TEXTURE_2D, TexObj[0] );
-#endif
- }
- else {
- glCallList( TexObj[0] );
- }
- glBegin( GL_POLYGON );
- glTexCoord2f( 0.0, 0.0 ); glVertex2f( -1.0, -1.0 );
- glTexCoord2f( 1.0, 0.0 ); glVertex2f( 1.0, -1.0 );
- glTexCoord2f( 1.0, 1.0 ); glVertex2f( 1.0, 1.0 );
- glTexCoord2f( 0.0, 1.0 ); glVertex2f( -1.0, 1.0 );
- glEnd();
- glPopMatrix();
-
- /* draw second polygon */
- glPushMatrix();
- glTranslatef( 1.0, 0.0, 0.0 );
- glRotatef( Angle-90.0, 0.0, 1.0, 0.0 );
- if (UseObj) {
-#ifdef TEXTURE_OBJECT
- glBindTexture( GL_TEXTURE_2D, TexObj[1] );
-#endif
- }
- else {
- glCallList( TexObj[1] );
- }
- glBegin( GL_POLYGON );
- glTexCoord2f( 0.0, 0.0 ); glVertex2f( -1.0, -1.0 );
- glTexCoord2f( 1.0, 0.0 ); glVertex2f( 1.0, -1.0 );
- glTexCoord2f( 1.0, 1.0 ); glVertex2f( 1.0, 1.0 );
- glTexCoord2f( 0.0, 1.0 ); glVertex2f( -1.0, 1.0 );
- glEnd();
- glPopMatrix();
-
-}
-
-
-static void gl_init()
-{
-
- static GLfloat h = (GLfloat) HEIGHT / (GLfloat) WIDTH;
- static int twidth=8, theight=8;
- static GLubyte tex1[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 1, 1, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 1, 1, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0 };
-
- static GLubyte tex2[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 2, 2, 0, 0, 0,
- 0, 0, 2, 0, 0, 2, 0, 0,
- 0, 0, 0, 0, 0, 2, 0, 0,
- 0, 0, 0, 0, 2, 0, 0, 0,
- 0, 0, 0, 2, 0, 0, 0, 0,
- 0, 0, 2, 2, 2, 2, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0 };
-
- GLubyte tex[64][3];
- GLint i, j;
-
- //Create the OSMesa Context
- ctx = OSMesaCreateContext(OSMESA_RGB_565, NULL);
-
- //Make Current Context
- OSMesaMakeCurrent(ctx, rgb_565_buf, GL_UNSIGNED_SHORT_5_6_5, WIDTH, HEIGHT);
-
- UseObj = GL_TRUE;
-
- glDisable( GL_DITHER );
-
- /* Setup texturing */
- glEnable( GL_TEXTURE_2D );
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL );
- glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST );
-
- /* generate texture object IDs */
- if (UseObj) {
-#ifdef TEXTURE_OBJECT
- glGenTextures( 2, TexObj );
-#endif
- }
- else {
- TexObj[0] = glGenLists(2);
- TexObj[1] = TexObj[0]+1;
- }
-
- /* setup first texture object */
- if (UseObj) {
-#ifdef TEXTURE_OBJECT
- glBindTexture( GL_TEXTURE_2D, TexObj[0] );
- assert(glIsTexture(TexObj[0]));
-#endif
- }
- else {
- glNewList( TexObj[0], GL_COMPILE );
- }
- /* red on white */
- for (i=0;i<theight;i++) {
- for (j=0;j<twidth;j++) {
- int p = i*twidth+j;
- if (tex1[(theight-i-1)*twidth+j]) {
- tex[p][0] = 255; tex[p][1] = 0; tex[p][2] = 0;
- }
- else {
- tex[p][0] = 255; tex[p][1] = 255; tex[p][2] = 255;
- }
- }
- }
-
- glTexImage2D( GL_TEXTURE_2D, 0, 3, twidth, theight, 0,
- GL_RGB, GL_UNSIGNED_BYTE, tex );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
- if (!UseObj) {
- glEndList();
- }
- /* end of texture object */
-
- /* setup second texture object */
- if (UseObj) {
-#ifdef TEXTURE_OBJECT
- glBindTexture( GL_TEXTURE_2D, TexObj[1] );
- assert(glIsTexture(TexObj[1]));
-#endif
- assert(!glIsTexture(TexObj[1] + 999));
- }
- else {
- glNewList( TexObj[1], GL_COMPILE );
- }
- /* green on blue */
- for (i=0;i<theight;i++) {
- for (j=0;j<twidth;j++) {
- int p = i*twidth+j;
- if (tex2[(theight-i-1)*twidth+j]) {
- tex[p][0] = 0; tex[p][1] = 255; tex[p][2] = 0;
- }
- else {
- tex[p][0] = 0; tex[p][1] = 0; tex[p][2] = 255;
- }
- }
- }
- glTexImage2D( GL_TEXTURE_2D, 0, 3, twidth, theight, 0,
- GL_RGB, GL_UNSIGNED_BYTE, tex );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
- if (!UseObj) {
- glEndList();
- }
- /* end texture object */
-
- glViewport(0, 0, (GLint)WIDTH, (GLint)HEIGHT);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- /* glOrtho( -3.0, 3.0, -3.0, 3.0, -10.0, 10.0 );*/
- glFrustum( -2.0, 2.0, 2.0, -2.0, 6.0, 20.0 );
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef( 0.0, 0.0, -8.0 );
-
-}
-
-static int screen(int mode)
-{
-
- vga_modeinfo *minf;
-
- vga_setmode(mode,CARD);
- minf = vga_getmodeinfo(mode);
- if(! (minf->flags & CAPABLE_LINEAR)){
- vga_setmode(TEXT,CARD);
- printk(KERN_INFO "The mode %d is not capable of linear\n",mode);
- return 1;
- }
- vga_setpage(0);
- if(vga_setlinearaddressing() == -1) {
- vga_setmode(TEXT,CARD);
- printk(KERN_INFO "Could not set linear addressing for mode %d\n",mode);
- return 1;
- }
-
- video_buf = vga_getgraphmem();
-
- grx_setbuffer(rgb_565_buf, WIDTH, HEIGHT); //Init of RGB16 version of grx functions
- //created to work with Mesa buffer
- return 0;
-
-}
-
-void program_end(void *arg)
-{
-
- OSMesaDestroyContext(ctx);
- free(rgb_565_buf);
-
- vga_setmode(TEXT,CARD);
-
- sys_end();
-
-}
-
-void program_key_end(KEY_EVT *k)
-{
-
- sys_end();
-
-}
-
-TASK refresh(void)
-{
-
- while(1) {
-
- copy_videomem_16to16(rgb_565_buf, video_buf, VMEMLONG);
- task_endcycle();
-
- }
-
- sys_end();
-
-}
-
-
-TASK disegna(void)
-{
-
- char text[100];
- TIME disegna_TIME, refresh_TIME;
-
- while(1) {
-
- jet_gettable(refresh_PID, &refresh_TIME, 1);
- jet_gettable(disegna_PID, &disegna_TIME, 1);
-
- Angle += 2.0;
-
- draw();
-
- sprintf(text,"Hard Task Refresh PER:%6d us EX:%6d us",(int)PERIOD_REFRESH,(int)refresh_TIME);
- grx_text(text,10,5,rgb16(0,0,255),0);
- sprintf(text,"Hard Task Draw PER:%6d us EX:%6d us",(int)PERIOD_DISEGNA,(int)disegna_TIME);
- grx_text(text,10,15,rgb16(0,0,255),0);
-
- task_endcycle();
-
- }
-
- sys_end();
-
-}
-
-int main (int argc, char *argv[])
-{
-
- HARD_TASK_MODEL ht_refresh, ht_disegna;
-
- sys_atrunlevel(program_end,NULL, RUNLEVEL_BEFORE_EXIT);
-
- clear();
-
- WCET_REFRESH =((long int) PERIOD_REFRESH * (0.45));
- WCET_DISEGNA =((long int) PERIOD_DISEGNA * (0.45));
-
- hard_task_default_model(ht_refresh);
- hard_task_def_wcet(ht_refresh,WCET_REFRESH);
- hard_task_def_mit(ht_refresh,PERIOD_REFRESH);
- hard_task_def_usemath(ht_refresh);
- hard_task_def_group(ht_refresh,1);
- hard_task_def_ctrl_jet(ht_refresh);
-
- refresh_PID = task_create("refresh", refresh, &ht_refresh, NULL);
- if (refresh_PID == -1) {
- sys_end();
- exit(4);
- }
-
- hard_task_default_model(ht_disegna);
- hard_task_def_mit(ht_disegna,PERIOD_DISEGNA);
- hard_task_def_wcet(ht_disegna,WCET_DISEGNA);
- hard_task_def_group(ht_disegna,1);
- hard_task_def_ctrl_jet(ht_disegna);
- hard_task_def_usemath(ht_disegna);
- hard_task_def_stack(ht_disegna,30000);
-
- disegna_PID = task_create("disegna", disegna, &ht_disegna, NULL);
- if (disegna_PID == -1) {
- sys_end();
- exit(4);
- }
-
- {
- KEY_EVT k;
- k.flag = ALTL_BIT;
- k.scan = KEY_C;
- k.ascii = 'c';
- keyb_hook(k,program_key_end);
- }
-
- rgb_565_buf = malloc(RGB565MEM);
-
- gl_init();
-
- if (screen(INITSTR)) {
- printk(KERN_INFO "Graphical initialization failed !!\n");
- sys_end();
- }
-
- memset(rgb_565_buf, 0, RGB565MEM);
-
- group_activate(1);
-
- return 0;
-
-}
Index: rel_1_21/mesatex/readme.txt
===================================================================
--- rel_1_21/mesatex/readme.txt (revision 1217)
+++ rel_1_21/mesatex/readme.txt (nonexistent)
@@ -1,44 +0,0 @@
---------------------------------------
-MESA Demo (tex)
-
-by
-
-Giacomo Guidi <giacomo@gandalf.sssup.it>
-
-Last update 17/03/2003
---------------------------------------
-
-This is a simple test demo for the MESA (5.0)
-libraries, the low level graphic drivers is
-the SVGA (from the SVGAlib)
-
-See drivers/svga/readme for supported cards
-
---------------------------------------
-
-The demo is composed by:
-
-MAKEFILE The makefile used to compile the application
-README.TXT This file
-INITFILE.C The init file
-MESATEX.C The MESA Demo
-
---------------------------------------
-
-- To specify your card change the line
-
-#define CARD <driver name>
-
-- The demo calls the grx and off-screen Mesa functions.
-The resolution must be 16 bitsperpixel (64K colors) and
-the graphic access mode must be linear.
-
-- There are two buffers
-
- The video buffer (video_buf)
- The virtual buffer (rgb_565_buf)
-
- copy_videomem_16to16 links these buffers
-
-
-
Index: rel_1_21/mesatex/makefile
===================================================================
--- rel_1_21/mesatex/makefile (revision 1217)
+++ rel_1_21/mesatex/makefile (nonexistent)
@@ -1,16 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS = mesatex
-
-include $(BASE)/config/example.mk
-
-mesatex:
- make -f $(SUBMAKE) APP=mesatex INIT= OTHEROBJS="initfile.o" SHARKOPT="__OSMESA__ __OLDCHAR__ __SVGA__"
-
Index: rel_1_21/auto/readme
===================================================================
--- rel_1_21/auto/readme (revision 1217)
+++ rel_1_21/auto/readme (nonexistent)
@@ -1,51 +0,0 @@
-AUTO - Another Unuseful Track simulatOr
----------------------------------------
-
-by Marco Dallera and Marco Fiocca, 2001
-
----------------------------------------
-
-This project was done as a Lab assignment during the course of
-"Informatica Industriale" at the University of Pavia, Italy.
-
-It simulates a race between cars under a set of 4 tracks.
-
-The authors provided also some pages that describes the application
-(auto.ps, in italian, on the website).
-
-To run the application, just compile it and call "x auto th" where tn is
-the track number (0 to 4).
-
-Since the control algorithm is quite complex, you need a quite powerful
-machine. If you get an exception 8 (WCET violation), you need a faster PC.
-You can anyway run the application making "auto2", that uses RR instead of
-EDF or CBS, or "auto3", that uses the EDFACT Module (you need yo copy
-the edfact.c and edfact.h files in the application directory to do that).
-
-To be run, the application needs to be compiled with the
-#define MAX_CAB set to a number greater than 20 (see include/modules/cabs.h).
-
-The control algorithm of the cars is not yet perfect, and if you look to
-the race for a long time, sometimes some cars go in the wrong direction.
-If you find a better algorithm, send me a patch :-)
-
-The code you can find in this directory is the original code of the
-students except for the MAX_CAB test into main(), and for the idle time
-monitor (that I took from the jumpball example) that can be useful to know
-when the system is overloaded. For example, on my PC there is idle time until
-the system has 9 cars. The tenth make the PC overloaded until one of them
-crashes :-).
-
-Finally note that the WCET and PERIODS specified by the authors are not so
-correct, and with this setting you can run 8 cars maximum before crashing the
-system.
-
-Have a nice race...
-
-Paolo
-pj@sssup.it
-
-PS: Sometimes on my portable the demo crashes. I wonder why!... If someone
-finds why, please tell me, I will patch it...
-
-
Index: rel_1_21/auto/initfil1.c
===================================================================
--- rel_1_21/auto/initfil1.c (revision 1217)
+++ rel_1_21/auto/initfil1.c (nonexistent)
@@ -1,108 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: initfil1.c,v 1.1.1.1 2002-09-02 09:37:42 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:42 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-#include "drivers/keyb.h"
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 2000
-
-void read_track(int);
-void read_sprites();
-
-int argc;
-char *argv[100];
-
-int main(int argc, char **argv);
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- CBS_register_level(CBS_ENABLE_ALL, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- SEM_register_module();
-
- CABS_register_module();
-
- __compute_args__(mb, &argc, argv);
-
- if (argc == 2)
- read_track(strtoi(argv[1], 10, NULL));
- else
- read_track(2);
-
- read_sprites();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- keyb_def_ctrlC(kparms, NULL);
- KEYB_init(&kparms);
-
- return (void *)main(argc,argv);
-}
Index: rel_1_21/auto/initfil2.c
===================================================================
--- rel_1_21/auto/initfil2.c (revision 1217)
+++ rel_1_21/auto/initfil2.c (nonexistent)
@@ -1,108 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: initfil2.c,v 1.1.1.1 2002-09-02 09:37:42 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:42 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/rr.h"
-#include "modules/rrsoft.h"
-#include "modules/dummy.h"
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-#include "drivers/keyb.h"
-
-/*+ sysyem tick in us +*/
-#define TICK 1000
-
-/*+ RR tick in us +*/
-#define RRTICK 2000
-
-void read_track(int);
-void read_sprites();
-
-int argc;
-char *argv[100];
-int main(int argc, char **argv);
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_HARD|RRSOFT_ONLY_SOFT);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- SEM_register_module();
-
- CABS_register_module();
-
- __compute_args__(mb, &argc, argv);
-
- if (argc == 2)
- read_track(strtoi(argv[1], 10, NULL));
- else
- read_track(0);
-
- read_sprites();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- keyb_def_ctrlC(kparms, NULL);
- KEYB_init(&kparms);
-
- return (void *)main(argc,argv);
-}
-
-
-
-
Index: rel_1_21/auto/control.c
===================================================================
--- rel_1_21/auto/control.c (revision 1217)
+++ rel_1_21/auto/control.c (nonexistent)
@@ -1,701 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-
-/**
- ------------
- CVS : $Id: control.c,v 1.2 2003-03-24 13:29:08 giacomo Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-03-24 13:29:08 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Marco Dallera and Marco Fiocca
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * AUTO
- *
- * Another Unuseful Track simulatOr
- *
- * Authors: Marco Dallera
- * Marco Fiocca
- *
- */
-
-/* ------------- */
-/* Car control */
-/* ------------- */
-
-#include "include/auto.h"
-#include "include/const.h"
-#include "include/utils.h"
-
-#define TURN_QUANTUM 2
-#define KM 18.0 // pixel
-#define HOUR 3600.0 // seconds
-#define KPH (KM/HOUR) // 0.005 pixel/second
-#define HIGHWAY_LIMIT 6
-#define MAZE_LIMIT 45
-#define CURVE_LIMIT 25 // il limite della curva per cui imposta la traiettoria
-#define BORDER_LIMIT ((1.0 / params.rage) * 2.0)
-#define STEERING_LIMIT 3 // limite di sterzata
-
-/* Road state */
-#define HIGHWAY 1
-#define MIXED 2
-#define MAZE 3
-#define CENTER 10
-#define TOO_LEFT 11
-#define TOO_RIGHT 12
-
-/* Opponents relationship */
-#define ATTACK 20
-#define DEFENSE 21
-#define SUPERATTACK 22
-
-/* Car parameters */
-#define MAX_SPEED (300 * KPH)
-#define MIN_SPEED (10 * KPH)
-#define MIN_ACC (-0.1)
-#define MAX_ACC (0.02)
-
-extern sem_t grx_mutex;
-
-char track_img[TRACK_WIDTH*TRACK_HEIGHT];
-char sprite[18][CAR_WIDTH*CAR_HEIGHT];
-
-/* Display functions */
-void put_transimage(int x1, int y1, int x2, int y2, BYTE *img,int car_color, int color);
-void draw_car(point_f old_pos, car_status cs, int car_color, int fumo);
-void put_trackbox(int x1, int y1, int x2, int y2);
-void show_display(int, int, float, float, float, float);
-void car_crash(PID sp, PID cp, point_f old_pos, int free);
-
-/* ------------------------------------------------------------------ */
-
-TASK control(int index) {
- int i = 0; // general purpose counter
- car_status old_car_status; // the previous car state
- car_status actual_car_status; // the actual car state
- road_info actual_road_info; // the actual road informations
- int road_state; // the state of the road: HIGHWAY, MIXED; MAZE
- int car_align; // the car alignment with respect to road limits
- int opps_state; // the relationship with other cars
- float old_speed = 0; // the previous car speed value
- float actual_speed = 0; // the actual car speed value
- float old_acc = 0; // the previous acceleration value
- float acc = 0; // the new acceleration
- point polepos;
-
- // Variabili che dipendono dal tipo di macchina
- float max_speed; // maximum car speed
- float min_acc; // minimum acceleration
- float max_acc; // maximum acceleration
-
- int killed = 0; // flag for killed cars
- int crashed = 0; // flag for crashed cars
-
- /* Timing variables */
- float t = 0;
- float dt = (float)CONTROL_PERIOD/100000.0; // time quantum
- time ts = int2time(t);
- float crash_t = 0;
- time crash_ts = int2time(crash_t);
- float bestlap = 999999999.9;
- time bestlap_s = int2time(bestlap);
- int bestlap_done = 0;
- int laps = 0;
-
- /* Display vars */
- point spd_p, acc_p, time_p, drv_p;
- char *txt;
-
- /* Car data */
- car_params params; // car data structure
-
- /* ----------------------------------------------------- */
-
- txt = (char *)malloc(15*sizeof(char));
-
- params = cars[index];
-
- max_speed = params.max_speed * MAX_SPEED; // maximum car speed
- min_acc = params.min_acc * MIN_ACC; // minimum acceleration
- max_acc = params.max_acc * MAX_ACC; // maximum acceleration
-
- /* Get track data */
- while (track_list[i].selected == 0)
- i++;
-
- /* Same pole for all */
- polepos.x = track_list[i].pole_pos.x;
- polepos.y = track_list[i].pole_pos.y;
- actual_car_status.pos.x = polepos.x;
- actual_car_status.pos.y = polepos.y;
- actual_car_status.orient = track_list[i].pole_orient;
- set_car_status(actual_car_status, params.car_status_cab);
-
- /* Initialize old values */
- old_car_status = actual_car_status;
- old_acc = acc;
- old_speed = actual_speed;
-
- /* POWER IS NOTHING WITHOUT CONTROL */
- while(1) {
-
- if (crashed) {
- crash_t += dt;
- crash_ts = int2time(crash_t);
- if (crash_ts.sec > 2) {
- car_crash(params.sensor_pid,params.control_pid,
- old_car_status.pos, 1);
- killed=1;
- }
- }
-
- else {
-
- /* Reads road informations */
- actual_road_info = get_road_info(params.road_status_cab);
-
- /* Defines the state of the road */
- if (fabs(actual_road_info.curve) < HIGHWAY_LIMIT ||
- actual_road_info.distance > 0.9*TEL_HEIGHT) {
- road_state = HIGHWAY;
- } else if (fabs(actual_road_info.curve) > MAZE_LIMIT ||
- actual_road_info.distance < 0.1*TEL_HEIGHT) {
- road_state = MAZE;
- } else {
- road_state = MIXED;
- }
-
- /* Defines the car position whitin road borders */
- if (actual_road_info.left_border < BORDER_LIMIT)
- car_align = TOO_LEFT;
- else if (actual_road_info.right_border < BORDER_LIMIT)
- car_align = TOO_RIGHT;
- else car_align = CENTER;
-
- /* Sets the power percentage */
- switch (road_state)
- {
- case HIGHWAY:
- acc = max_acc; // tarella!!!!
- break;
- case MIXED:
- actual_speed = params.rage * (((float)actual_road_info.distance/(float)TEL_HEIGHT) /
- (fabs(actual_road_info.curve)/90.0)) * max_speed;
- acc = (actual_speed - old_speed) / dt;
- break;
- case MAZE:
- actual_speed = params.rage * (1.0 - (fabs(actual_road_info.curve)/90.0)) * max_speed;
- acc = (actual_speed - old_speed) / dt;
- break;
- default:
- acc = 0.0;
- }
-
- /* Can't go off road */
- /* When car is near a border, it steers to come in */
- switch (car_align)
- {
- case TOO_LEFT:
- actual_car_status.orient -= TURN_QUANTUM;
- break;
- case TOO_RIGHT:
- actual_car_status.orient += TURN_QUANTUM;
- break;
- }
-
- if (road_state != HIGHWAY) {
- // C'e' una curva vicina.
- // Se la curva e' a destra si tiene vicino al bordo di sinistra
- // per impostare la traiettoria migliore e viceversa
- if (actual_road_info.curve < 0 && actual_road_info.left_border > BORDER_LIMIT
- && fabs(actual_road_info.curve) > CURVE_LIMIT)
- actual_car_status.orient += TURN_QUANTUM;
- else if (actual_road_info.curve > 0 && actual_road_info.right_border > BORDER_LIMIT
- && fabs(actual_road_info.curve) > CURVE_LIMIT)
- actual_car_status.orient -= TURN_QUANTUM;
-
- // Fa la curva dolcemente
- if (actual_road_info.distance < ((1.0/params.rage) * (TEL_HEIGHT * 0.25))) {
- actual_car_status.orient += actual_road_info.curve * (params.rage/8.0);
- //actual_car_status.orient += actual_road_info.curve / 4.0;
- }
- }
-
- /* Defines the state of interactions with other cars */
- if (actual_road_info.opps_number > 0)
- {
- if (road_state == HIGHWAY && actual_road_info.opps_list[0].y > (TEL_HEIGHT/3.0))
- opps_state = ATTACK;
- else if (road_state == MAZE && actual_road_info.opps_list[0].y < (TEL_HEIGHT/3.0))
- opps_state = DEFENSE;
- else if (actual_road_info.opps_list[0].y < (TEL_HEIGHT/6.0) &&
- actual_road_info.opps_list[0].x != 0 &&
- (abs(actual_road_info.opps_list[0].x) < CAR_W/2)) {
- // Defends and steers to avoid opponents
- opps_state = DEFENSE;
- acc *= -((TEL_HEIGHT/6.0) / (actual_road_info.opps_list[0].y));
- actual_car_status.orient -= ((actual_road_info.opps_list[0].x) /
- abs(actual_road_info.opps_list[0].x)) * TURN_QUANTUM/2;
- }
- else if (actual_road_info.opps_list[0].y < (TEL_HEIGHT/3.0) &&
- actual_road_info.opps_list[0].x != 0 &&
- abs(actual_road_info.opps_list[0].x) < CAR_W/2) {
- // Attacks and steers to override the opponent
- opps_state = ATTACK;
- actual_car_status.orient -= ((actual_road_info.opps_list[0].x) /
- abs(actual_road_info.opps_list[0].x)) * TURN_QUANTUM;
- }
- else
- opps_state = DEFENSE;
-
- // Response to opponents positions
- if (opps_state == ATTACK)
- acc = max_acc;
- else if (opps_state == DEFENSE)
- acc *= 0.5;
- }
-
-
- /* Checking car position: road/offroad */
- if (actual_road_info.left_border * actual_road_info.right_border < 0)
- acc = 0.5 * min_acc;
-
- if (actual_road_info.flag != ROAD_OK) {
- switch (actual_road_info.flag) {
- case LEFT_ONLY:
- if (actual_road_info.left_border < 0)
- actual_car_status.orient -= TURN_QUANTUM;
- acc = 0.5 * max_acc;
- break;
- case RIGHT_ONLY:
- if (actual_road_info.right_border < 0)
- actual_car_status.orient += TURN_QUANTUM;
- acc = 0.5 * max_acc;
- break;
- case NO_ROAD:
- crashed = 1;
- car_crash(params.sensor_pid,params.control_pid,
- old_car_status.pos, 0);
- break;
- }
- }
-
- /* Checking collisions... */
- if (actual_road_info.collision != NO_COLL) {
- switch(actual_road_info.collision) {
- case COLLISION_LEFT:
- actual_car_status.orient -= TURN_QUANTUM;
- acc *= (0.5 * params.rage);
- break;
- case COLLISION_RIGHT:
- actual_car_status.orient += TURN_QUANTUM;
- acc *= (0.5 * params.rage);
- break;
- }
- }
-
- /* Checking acceleration range... */
- acc = max(min(max_acc,acc),min_acc);
- actual_speed = old_speed + acc*dt;
-
- /* Checking speed range... */
- actual_speed = min(max(actual_speed,MIN_SPEED),max_speed);
-
- /* Checking steering angle ... */
- if (fabs(actual_car_status.orient - old_car_status.orient) >
- STEERING_LIMIT) {
- if ((actual_car_status.orient - old_car_status.orient) > 0)
- actual_car_status.orient = old_car_status.orient + STEERING_LIMIT;
- else
- actual_car_status.orient = old_car_status.orient - STEERING_LIMIT;
- }
-
- /* Setting new car position... */
- actual_car_status.pos.x += actual_speed * cos(degree_to_rad(actual_car_status.orient));
- actual_car_status.pos.y -= actual_speed * sin(degree_to_rad(actual_car_status.orient));
-
- /* Checking track limits... */
- if (actual_car_status.pos.x < MIN_CAR_X)
- actual_car_status.pos.x = MIN_CAR_X;
- if (actual_car_status.pos.x > MAX_CAR_X)
- actual_car_status.pos.x = MAX_CAR_X;
- if (actual_car_status.pos.y < MIN_CAR_Y)
- actual_car_status.pos.y = MIN_CAR_Y;
- if (actual_car_status.pos.y > MAX_CAR_Y)
- actual_car_status.pos.y = MAX_CAR_Y;
-
- /* Sends new status to car_status_cab */
- set_car_status(actual_car_status, params.car_status_cab);
-
- if (!crashed) {
- /* Updates car */
- if (acc == min_acc)
- draw_car(old_car_status.pos,actual_car_status, params.color, 1);
- else
- draw_car(old_car_status.pos,actual_car_status, params.color, 0);
- }
-
- /* Sets display points */
- spd_p.x = TRACK_X1 + TRACK_WIDTH + TEL_HEIGHT + TEL_WIDTH + 9;
- spd_p.y = TEL_HEIGHT*index + 1 + index + 1;
- bar_display(spd_p, 70, 4, GREEN, actual_speed, max_speed, LIGHTGRAY, "Spd");
-
- acc_p.x = spd_p.x;
- acc_p.y = spd_p.y + 24;
- bidir_bar_display(acc_p, 70, 4, GREEN, acc, max(fabs(min_acc), max_acc), LIGHTGRAY, "Acc");
-
- sem_wait(&grx_mutex);
-
- /* Displays driver's name */
- drv_p.x = spd_p.x + 80;
- drv_p.y = spd_p.y;
- grx_text(params.driver, drv_p.x, drv_p.y, params.color, BLACK);
-
- /* Displays timer */
- time_p.x = spd_p.x + 80;
- time_p.y = spd_p.y + 8;
- if( (!bestlap_done) || (bestlap_done && t > 50))
- {
- /* Mins */
- txt = itoa(ts.min, txt);
- grx_text(txt, time_p.x, time_p.y, WHITE, BLACK);
- grx_text(":", time_p.x + 8, time_p.y, WHITE, BLACK);
- /* Secs */
- txt = itoa(ts.sec, txt);
- if (ts.sec < 10) {
- grx_text("0", time_p.x+16, time_p.y, WHITE, BLACK);
- grx_text(txt, time_p.x+24, time_p.y, WHITE, BLACK);
- }
- else
- grx_text(txt, time_p.x+16, time_p.y, WHITE, BLACK);
- /* Decs */
- grx_text(":", time_p.x+32, time_p.y, WHITE, BLACK);
- txt = itoa(ts.dec, txt);
- grx_text(txt, time_p.x+40, time_p.y, WHITE, BLACK);
- }
-
- /* Displays the best lap */
- if(bestlap_done == 1)
- {
- time_p.x = spd_p.x + 80;
- time_p.y = spd_p.y + 16;
- /* Mins */
- txt = itoa(bestlap_s.min, txt);
- grx_text(txt, time_p.x, time_p.y, YELLOW, BLACK);
- grx_text(":", time_p.x + 8, time_p.y, YELLOW, BLACK);
- /* Secs */
- txt = itoa(bestlap_s.sec, txt);
- if (bestlap_s.sec < 10) {
- grx_text("0", time_p.x+16, time_p.y, YELLOW, BLACK);
- grx_text(txt, time_p.x+24, time_p.y, YELLOW, BLACK);
- }
- else
- grx_text(txt, time_p.x+16, time_p.y, YELLOW, BLACK);
- /* Decs */
- grx_text(":", time_p.x+32, time_p.y, YELLOW, BLACK);
- txt = itoa(bestlap_s.dec, txt);
- grx_text(txt, time_p.x+40, time_p.y, YELLOW, BLACK);
- }
-
- /* Displays lap number */
- time_p.x = spd_p.x + 80;
- time_p.y = spd_p.y + 24;
- grx_text("Lap ", time_p.x, time_p.y, LIGHTGRAY, BLACK);
- txt = itoa(laps, txt);
- grx_text(txt, time_p.x+32, time_p.y, LIGHTGRAY, BLACK);
-
- sem_post(&grx_mutex);
-
- /* Control the best lap */
- t += dt;
- ts = int2time(t);
-
- /* Finish line */
- if ((track_list[i].lap == CLOCK &&
- (actual_car_status.pos.x >= polepos.x) && (old_car_status.pos.x < polepos.x)
- && (actual_car_status.pos.y > polepos.y-20) && (actual_car_status.pos.y < polepos.y+20)) ||
- (track_list[i].lap == ANTICLOCK &&
- (actual_car_status.pos.x <= polepos.x) && (old_car_status.pos.x > polepos.x)
- && (actual_car_status.pos.y > polepos.y-20) && (actual_car_status.pos.y < polepos.y+20))) {
- laps++; // increases lap number
-
- bestlap = min(bestlap,t);
- bestlap_s = int2time(bestlap);
- bestlap_done = 1;
- t = 0;
- ts = int2time(t);
- }
-
- /* Updates old values */
- old_car_status = actual_car_status;
- old_acc = acc;
- old_speed = actual_speed;
-
- } // end crashed
-
- task_endcycle();
-
- // Esce se e' morto
- if (killed) return 0;
- }
-}
-
-/* ------------------------------------------------------------------ */
-
-void car_crash(PID sp, PID cp, point_f old_pos, int free)
-{
- point p1, p2;
- p1.x = round(old_pos.x) - CAR_WIDTH/2 - 1;
- p1.y = round(old_pos.y) - CAR_HEIGHT/2 - 1;
- p2.x = p1.x + CAR_WIDTH + 1;
- p2.y = p1.y + CAR_HEIGHT + 1;
-
- sem_wait(&grx_mutex);
- /* Find the track box to redraw */
- put_trackbox(p1.x,p1.y,p2.x,p2.y);
-
- if (free == 0) {
- // Draw the explosion
- put_transimage(p1.x+1,p1.y+1,p2.x-1,p2.y-1,&sprite[16][0],0,0);
- }
- else if (free == 1) {
- // Delete the explosion
- put_trackbox(p1.x,p1.y,p2.x,p2.y);
- task_kill(sp);
- task_kill(cp);
- }
- sem_post(&grx_mutex);
-}
-
-/* ------------------------------------------------------------------ */
-
-void draw_car(point_f old_pos, car_status cs, int car_color, int fumo)
-{
- int index;
- point p1, p2;
- p1.x = round(old_pos.x) - CAR_WIDTH/2 - 1;
- p1.y = round(old_pos.y) - CAR_HEIGHT/2 - 1;
- p2.x = p1.x + CAR_WIDTH + 1;
- p2.y = p1.y + CAR_HEIGHT + 1;
-
- sem_wait(&grx_mutex);
- /* Find the track box to redraw */
- put_trackbox(p1.x,p1.y,p2.x,p2.y);
-
-
- p1.x = round(cs.pos.x) + (CAR_WIDTH/2 * cos(degree_to_rad(cs.orient)));
- p1.y = round(cs.pos.y) - (CAR_HEIGHT/2 * sin(degree_to_rad(cs.orient)));
- p2.x = round(cs.pos.x) - (CAR_WIDTH/2 * cos(degree_to_rad(cs.orient)));
- p2.y = round(cs.pos.y) + (CAR_HEIGHT/2 * sin(degree_to_rad(cs.orient)));
-
- index = ((((int)cs.orient%360)+360)%360);
- index = (int)(index + 11.25)%360;
- index /= 22.5;
-
- put_transimage(round(cs.pos.x) - CAR_WIDTH/2 + 1,round(cs.pos.y) - CAR_HEIGHT/2 + 1,
- round(cs.pos.x) + CAR_WIDTH/2 ,round(cs.pos.y) + CAR_HEIGHT/2,
- &sprite[index][0], car_color, 0);
- if (fumo)
- put_transimage(round(cs.pos.x) - CAR_WIDTH/2 + 1,round(cs.pos.y) - CAR_HEIGHT/2 + 1,
- round(cs.pos.x) + CAR_WIDTH/2 ,round(cs.pos.y) + CAR_HEIGHT/2,
- &sprite[17][0], car_color, 0);
- sem_post(&grx_mutex);
-}
-
-/* ------------------------------------------------------------------ */
-
-/* Copy a box of track_image to screen */
-void put_trackbox(int x1, int y1, int x2, int y2)
-{
- int y;
- int tx1,ty1,tx2,ty2;
- BYTE *addr;
-
- tx1 = x1-TRACK_X1+1;
- ty1 = y1-TRACK_Y1;
- tx2 = x2-TRACK_X1+1;
- ty2 = y2-TRACK_Y1;
-
- if (tx1 < 0) tx1 = 0;
- if (ty1 < 0) ty1 = 0;
- if (tx2 > TRACK_WIDTH-1) tx2 = TRACK_WIDTH-1;
- if (ty2 > TRACK_HEIGHT-1) ty2 = TRACK_HEIGHT-1;
-
- tx1 = max(tx1,0);
- ty1 = max(ty1,0);
- tx2 = min(tx2,TRACK_WIDTH-1);
- ty2 = min(ty2,TRACK_HEIGHT-1);
-
- addr = &track_img[0] + tx1 + TRACK_WIDTH * ty1;
-
- x1 = max(0,x1);
- y1 = max(0,y1);
-
- for (y = y1; y <= y2; y++) {
- grx_putimage(x1+1, y, x2, y, addr);
- addr += TRACK_WIDTH;
- }
-}
-
-/* ------------------------------------------------------------------ */
-
-void put_transimage(int x1, int y1, int x2, int y2, BYTE *img, int car_color,
- int color)
-{
- int x,y;
- BYTE *addr;
- addr = img;
-
-
- for (y = y1; y < y2; y++) {
- for ( x = x1; x < x2; x++, addr++) {
- if (*addr != color) {
- if (*addr == 26)
- grx_plot(x,y,car_color);
- else
- grx_plot(x,y,*addr);
-
- }
- }
- addr++;
- }
-}
-
-/* ------------------------------------------------------------------ */
-
-void show_display(int rs, int ca, float speed, float max_speed,
- float acc, float max_acc)
-{
- point hw, mx, mz; // three road states
- point tl, ct, tr; // three car alignments
- point sp1, sp2; // speed display coordinates
- point ap1, ap2; // acceleration display coordinates
- int s_amp = 0;
- int a_amp = 0;
-
- /* Leds coordinates */
- hw.x = 10;
- hw.y = SCREEN_HEIGHT-50;
- mx.x = 25;
- mx.y = SCREEN_HEIGHT-50;
- mz.x = 40;
- mz.y = SCREEN_HEIGHT-50;
- tl.x = 10;
- tl.y = SCREEN_HEIGHT-35;
- ct.x = 25;
- ct.y = SCREEN_HEIGHT-35;
- tr.x = 40;
- tr.y = SCREEN_HEIGHT-35;
- sp1.x = 10;
- sp1.y = SCREEN_HEIGHT-75;
- sp2.x = 110;
- sp2.y = SCREEN_HEIGHT-65;
- ap1.x = 10;
- ap1.y = SCREEN_HEIGHT-90;
- ap2.x = 110;
- ap2.y = SCREEN_HEIGHT-80;
-
- sem_wait(&grx_mutex);
-
- /* Writes out controller titles */
- grx_text("Road", mz.x+15, mz.y, YELLOW, BLACK);
- grx_text("Curve", tr.x+15, tr.y, YELLOW, BLACK);
- switch (rs)
- {
- case HIGHWAY:
- grx_box(hw.x, hw.y, hw.x+10, hw.y+10, GREEN);
- grx_box(mx.x, mx.y, mx.x+10, mx.y+10, BLACK);
- grx_box(mz.x, mz.y, mz.x+10, mz.y+10, BLACK);
- break;
- case MIXED:
- grx_box(hw.x, hw.y, hw.x+10, hw.y+10, BLACK);
- grx_box(mx.x, mx.y, mx.x+10, mx.y+10, YELLOW);
- grx_box(mz.x, mz.y, mz.x+10, mz.y+10, BLACK);
- break;
- case MAZE:
- grx_box(hw.x, hw.y, hw.x+10, hw.y+10, BLACK);
- grx_box(mx.x, mx.y, mx.x+10, mx.y+10, BLACK);
- grx_box(mz.x, mz.y, mz.x+10, mz.y+10, RED);
- break;
- }
-
- switch (ca)
- {
- case TOO_LEFT:
- grx_box(tl.x, tl.y, tl.x+10, tl.y+10, RED);
- grx_box(ct.x, ct.y, ct.x+10, ct.y+10, BLACK);
- grx_box(tr.x, tr.y, tr.x+10, tr.y+10, BLACK);
- break;
- case TOO_RIGHT:
- grx_box(tl.x, tl.y, tl.x+10, tl.y+10, BLACK);
- grx_box(ct.x, ct.y, ct.x+10, ct.y+10, BLACK);
- grx_box(tr.x, tr.y, tr.x+10, tr.y+10, BLUE);
- break;
- default:
- grx_box(tl.x, tl.y, tl.x+10, tl.y+10, BLACK);
- grx_box(ct.x, ct.y, ct.x+10, ct.y+10, WHITE);
- grx_box(tr.x, tr.y, tr.x+10, tr.y+10, BLACK);
- }
-
- /* Draws speed display */
- grx_text("Speed", sp1.x+120, sp1.y, YELLOW, BLACK);
- grx_rect(sp1.x-1, sp1.y-1, sp2.x+1, sp2.y+1, GREEN);
- /* Updates speed display */
- grx_box(sp1.x, sp1.y, sp2.x, sp2.y, BLACK);
- s_amp = round( (speed * (float)(sp2.x-sp1.x)) / max_speed );
- grx_box(sp1.x, sp1.y, sp1.x+s_amp, sp2.y, LIGHTGRAY);
-
- /* Draws acceleration display */
- grx_text("Acceleration", ap1.x+120, ap1.y, YELLOW, BLACK);
- grx_rect(ap1.x-1, ap1.y-1, ap2.x+1, ap2.y+1, GREEN);
- /* Updates acceleration display */
- grx_box(ap1.x, ap1.y, ap2.x, ap2.y, BLACK);
- a_amp = round( (float)acc * (float)((ap2.x-ap1.x)/2) / (float)max_acc );
- if (a_amp >= 0)
- grx_box((ap1.x+ap2.x)/2, ap1.y, ((ap1.x+ap2.x)/2)+a_amp, ap2.y, LIGHTGRAY);
- else
- grx_box((ap1.x+ap2.x)/2+a_amp, ap1.y, ((ap1.x+ap2.x)/2), ap2.y, LIGHTGRAY);
- grx_line((ap1.x+ap2.x)/2, ap1.y-2, (ap1.x+ap2.x)/2, ap2.y+2, WHITE);
- sem_post(&grx_mutex);
-}
-
Index: rel_1_21/auto/initfil3.c
===================================================================
--- rel_1_21/auto/initfil3.c (revision 1217)
+++ rel_1_21/auto/initfil3.c (nonexistent)
@@ -1,107 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: initfil3.c,v 1.1.1.1 2002-09-02 09:37:42 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:42 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "edfact.h"
-#include "modules/cbs.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-#include "drivers/keyb.h"
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 2000
-
-void read_track(int);
-void read_sprites();
-
-int argc;
-char *argv[100];
-int main(int argc, char **argv);
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDFACT_register_level(0);
- CBS_register_level(0, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- SEM_register_module();
-
- CABS_register_module();
-
- __compute_args__(mb, &argc, argv);
-
- if (argc == 2)
- read_track(strtoi(argv[1], 10, NULL));
- else
- read_track(2);
-
- read_sprites();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- keyb_def_ctrlC(kparms, NULL);
- KEYB_init(&kparms);
-
- return (void *) main(argc,argv);
-}
Index: rel_1_21/auto/edfact.c
===================================================================
--- rel_1_21/auto/edfact.c (revision 1217)
+++ rel_1_21/auto/edfact.c (nonexistent)
@@ -1,567 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: edfact.c,v 1.4 2003-01-07 17:10:15 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.4 $
- Last update: $Date: 2003-01-07 17:10:15 $
- ------------
-**/
-
-/*
- * Copyright (C) 2001 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "edfact.h"
-#include <ll/stdio.h>
-#include <ll/string.h>
-#include <kernel/model.h>
-#include <kernel/descr.h>
-#include <kernel/var.h>
-#include <kernel/func.h>
-#include <kernel/trace.h>
-
-//#define edfact_printf kern_printf
-#define edfact_printf printk
-
-/*+ Status used in the level +*/
-#define EDFACT_READY MODULE_STATUS_BASE /*+ - Ready status +*/
-#define EDFACT_IDLE MODULE_STATUS_BASE+4 /*+ to wait the deadline +*/
-
-/*+ flags +*/
-#define EDFACT_FLAG_NORAISEEXC 2
-
-/*+ the level redefinition for the Earliest Deadline First level +*/
-typedef struct {
- level_des l; /*+ the standard level descriptor +*/
-
- TIME period[MAX_PROC]; /*+ The task periods; the deadlines are
- stored in the priority field +*/
- int deadline_timer[MAX_PROC];
- /*+ The task deadline timers +*/
-
- struct timespec deadline_timespec[MAX_PROC];
-
- int dline_miss[MAX_PROC]; /*+ Deadline miss counter +*/
- int wcet_miss[MAX_PROC]; /*+ Wcet miss counter +*/
-
- int nact[MAX_PROC]; /*+ Wcet miss counter +*/
-
- int flag[MAX_PROC];
- /*+ used to manage the JOB_TASK_MODEL and the
- periodicity +*/
-
- IQUEUE ready; /*+ the ready queue +*/
-
- int flags; /*+ the init flags... +*/
-
- bandwidth_t U; /*+ the used bandwidth +*/
-
-} EDFACT_level_des;
-
-
-static void EDFACT_timer_deadline(void *par);
-
-static void EDFACT_internal_activate(EDFACT_level_des *lev, PID p,
- struct timespec *t)
-{
- struct timespec *temp;
-
- temp = iq_query_timespec(p, &lev->ready);
-
- TIMESPEC_ASSIGN(temp,t);
- ADDUSEC2TIMESPEC(lev->period[p], temp);
-
- TIMESPEC_ASSIGN(&lev->deadline_timespec[p],
- temp);
-
- /* Insert task in the correct position */
- proc_table[p].status = EDFACT_READY;
- iq_timespec_insert(p,&lev->ready);
-
- /* needed because when there is a wcet miss I disable CONTROL_CAP */
- proc_table[p].control |= CONTROL_CAP;
-}
-
-static void EDFACT_timer_deadline(void *par)
-{
- PID p = (PID) par;
- EDFACT_level_des *lev;
-
- lev = (EDFACT_level_des *)level_table[proc_table[p].task_level];
-
- switch (proc_table[p].status) {
- case EDFACT_IDLE:
- edfact_printf("I%d",p);
-
- EDFACT_internal_activate(lev,p, &lev->deadline_timespec[p]);
-
- event_need_reschedule();
- break;
-
- default:
- edfact_printf("D%d",p);
- /* else, a deadline miss occurred!!! */
- lev->dline_miss[p]++;
-
- /* the task is into another state */
- lev->nact[p]++;
-
- /* Set the deadline timer */
- ADDUSEC2TIMESPEC(lev->period[p], &lev->deadline_timespec[p]);
- }
-
- /* Set the deadline timer */
- lev->deadline_timer[p] = kern_event_post(&lev->deadline_timespec[p],
- EDFACT_timer_deadline,
- (void *)p);
-
-}
-
-static void EDFACT_timer_guest_deadline(void *par)
-{
- PID p = (PID) par;
-
- edfact_printf("AAARRRGGGHHH!!!");
- kern_raise(XDEADLINE_MISS,p);
-}
-
-
-/* The scheduler only gets the first task in the queue */
-static PID EDFACT_public_scheduler(LEVEL l)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- return iq_query_first(&lev->ready);
-}
-
-/* The on-line guarantee is enabled only if the appropriate flag is set... */
-static int EDFACT_public_guarantee(LEVEL l, bandwidth_t *freebandwidth)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- if (lev->flags & EDFACT_FAILED_GUARANTEE) {
- *freebandwidth = 0;
- return 0;
- }
- else
- if (*freebandwidth >= lev->U) {
- *freebandwidth -= lev->U;
- return 1;
- }
- else
- return 0;
-
-}
-
-static int EDFACT_public_create(LEVEL l, PID p, TASK_MODEL *m)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- HARD_TASK_MODEL *h;
-
- if (m->pclass != HARD_PCLASS) return -1;
- if (m->level != 0 && m->level != l) return -1;
- h = (HARD_TASK_MODEL *)m;
- if (!h->wcet || !h->mit || h->periodicity != PERIODIC) return -1;
- /* now we know that m is a valid model */
-
- lev->period[p] = h->mit;
-
- lev->flag[p] = 0;
- lev->deadline_timer[p] = -1;
- lev->dline_miss[p] = 0;
- lev->wcet_miss[p] = 0;
- lev->nact[p] = 0;
-
- /* Enable wcet check */
- proc_table[p].avail_time = h->wcet;
- proc_table[p].wcet = h->wcet;
- proc_table[p].control |= CONTROL_CAP;
-
- /* update the bandwidth... */
- if (lev->flags & EDFACT_ENABLE_GUARANTEE) {
- bandwidth_t b;
- b = (MAX_BANDWIDTH / h->mit) * h->wcet;
-
- /* really update lev->U, checking an overflow... */
- if (MAX_BANDWIDTH - lev->U > b)
- lev->U += b;
- else
- /* The task can NOT be guaranteed (U>MAX_BANDWIDTH)...
- in this case, we don't raise an exception... in fact, after the
- EDFACT_task_create the task_create will call level_guarantee that return
- -1... return -1 in EDFACT_task_create isn't correct, because:
- . generally, the guarantee must be done when also the resources
- are registered
- . returning -1 will cause the task_create to return with an errno
- ETASK_CREATE instead of ENO_GUARANTEE!!!
-
- Why I use the flag??? because if the lev->U overflows, if i.e. I set
- it to MAX_BANDWIDTH, I lose the correct allocated bandwidth...
- */
- lev->flags |= EDFACT_FAILED_GUARANTEE;
- }
-
- return 0; /* OK, also if the task cannot be guaranteed... */
-}
-
-static void EDFACT_public_detach(LEVEL l, PID p)
-{
- /* the EDFACT level doesn't introduce any dinamic allocated new field.
- we have only to reset the NO_GUARANTEE FIELD and decrement the allocated
- bandwidth */
-
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- if (lev->flags & EDFACT_FAILED_GUARANTEE)
- lev->flags &= ~EDFACT_FAILED_GUARANTEE;
- else
- lev->U -= (MAX_BANDWIDTH / lev->period[p]) * proc_table[p].wcet;
-}
-
-static void EDFACT_public_dispatch(LEVEL l, PID p, int nostop)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- /* the task state is set EXE by the scheduler()
- we extract the task from the ready queue
- NB: we can't assume that p is the first task in the queue!!! */
- iq_extract(p, &lev->ready);
-}
-
-static void EDFACT_public_epilogue(LEVEL l, PID p)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- /* check if the wcet is finished... */
- if (proc_table[p].avail_time <= 0 && proc_table[p].control&CONTROL_CAP) {
- /* wcet finished: disable wcet event and count wcet miss */
- edfact_printf("W%d",p);
- proc_table[p].control &= ~CONTROL_CAP;
- lev->wcet_miss[p]++;
- }
-
- /* the task it returns into the ready queue... */
- iq_timespec_insert(p,&lev->ready);
- proc_table[p].status = EDFACT_READY;
-}
-
-static void EDFACT_public_activate(LEVEL l, PID p)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
- struct timespec t;
-
- /* Test if we are trying to activate a non sleeping task */
- /* save activation (only if needed... */
- if (proc_table[p].status != SLEEP) {
- /* a periodic task cannot be activated when it is already active */
- kern_raise(XACTIVATION,p);
- return;
- }
-
- kern_gettime(&t);
- EDFACT_internal_activate(lev,p, &t);
-
- /* Set the deadline timer */
- lev->deadline_timer[p] = kern_event_post(&lev->deadline_timespec[p],
- EDFACT_timer_deadline,
- (void *)p);
-
-}
-
-static void EDFACT_public_unblock(LEVEL l, PID p)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- /* Insert task in the coEDFect position */
- proc_table[p].status = EDFACT_READY;
- iq_timespec_insert(p,&lev->ready);
-}
-
-static void EDFACT_public_block(LEVEL l, PID p)
-{
-}
-
-static int EDFACT_public_message(LEVEL l, PID p, void *m)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
- struct timespec t;
-
- /* we reset the capacity counters... */
- proc_table[p].avail_time = proc_table[p].wcet;
-
- if (lev->nact[p] > 0) {
- edfact_printf("E%d",p);
-
- /* Pending activation: reactivate the thread!!! */
- lev->nact[p]--;
-
- /* see also EDFACT_timer_deadline */
- kern_gettime(&t);
- EDFACT_internal_activate(lev,p, &t);
-
- /* check if the deadline has already expired */
- if (TIMESPEC_A_LT_B(iq_query_timespec(p, &lev->ready), &schedule_time)) {
- /* count the deadline miss */
- lev->dline_miss[p]++;
- kern_event_delete(lev->deadline_timer[p]);
- }
-
- }
- else {
- edfact_printf("e%d",p);
-
- /* the task has terminated his job before it consume the wcet. All OK! */
- proc_table[p].status = EDFACT_IDLE;
-
- /* when the deadline timer fire, it recognize the situation and set
- correctly all the stuffs (like reactivation, etc... ) */
- }
-
- jet_update_endcycle(); /* Update the Jet data... */
- trc_logevent(TRC_ENDCYCLE,&exec_shadow); /* tracer stuff */
-
- return 0;
-}
-
-static void EDFACT_public_end(LEVEL l, PID p)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- edfact_printf("Û%d",p);
-
- /* we finally put the task in the ready queue */
- proc_table[p].status = FREE;
- iq_insertfirst(p,&freedesc);
- /* and free the allocated bandwidth */
- lev->U -= (MAX_BANDWIDTH/lev->period[p]) * proc_table[p].wcet;
-
- if (lev->deadline_timer[p] != -1) {
- edfact_printf("²%d",p);
- kern_event_delete(lev->deadline_timer[p]);
- }
-}
-
-
-/* Guest Functions
- These functions manages a JOB_TASK_MODEL, that is used to put
- a guest task in the EDFACT ready queue. */
-
-static void EDFACT_private_insert(LEVEL l, PID p, TASK_MODEL *m)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- JOB_TASK_MODEL *job;
-
- if (m->pclass != JOB_PCLASS || (m->level != 0 && m->level != l) ) {
- kern_raise(XINVALID_TASK, p);
- return;
- }
-
- job = (JOB_TASK_MODEL *)m;
-
- TIMESPEC_ASSIGN(iq_query_timespec(p, &lev->ready), &job->deadline);
-
- lev->deadline_timer[p] = -1;
- lev->dline_miss[p] = 0;
- lev->wcet_miss[p] = 0;
- lev->nact[p] = 0;
-
- if (job->noraiseexc)
- lev->flag[p] = EDFACT_FLAG_NORAISEEXC;
- else {
- lev->flag[p] = 0;
- lev->deadline_timer[p] = kern_event_post(iq_query_timespec(p, &lev->ready),
- EDFACT_timer_guest_deadline,
- (void *)p);
- }
-
- lev->period[p] = job->period;
-
- /* Insert task in the correct position */
- iq_timespec_insert(p,&lev->ready);
- proc_table[p].status = EDFACT_READY;
-
- /* there is no bandwidth guarantee at this level, it is performed
- by the level that inserts guest tasks... */
-}
-
-static void EDFACT_private_dispatch(LEVEL l, PID p, int nostop)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- /* the task state is set to EXE by the scheduler()
- we extract the task from the ready queue
- NB: we can't assume that p is the first task in the queue!!! */
- iq_extract(p, &lev->ready);
-}
-
-static void EDFACT_private_epilogue(LEVEL l, PID p)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- /* the task has been preempted. it returns into the ready queue... */
- iq_timespec_insert(p,&lev->ready);
- proc_table[p].status = EDFACT_READY;
-}
-
-static void EDFACT_private_extract(LEVEL l, PID p)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- //kern_printf("EDFACT_guest_end: dline timer %d\n",lev->deadline_timer[p]);
- if (proc_table[p].status == EDFACT_READY)
- {
- iq_extract(p, &lev->ready);
- //kern_printf("(g_end rdy extr)");
- }
-
- /* we remove the deadline timer, because the slice is finished */
- if (lev->deadline_timer[p] != NIL) {
-// kern_printf("EDFACT_guest_end: dline timer %d\n",lev->deadline_timer[p]);
- kern_event_delete(lev->deadline_timer[p]);
- lev->deadline_timer[p] = NIL;
- }
-
-}
-
-/* Registration functions */
-
-/*+ Registration function:
- int flags the init flags ... see EDFACT.h +*/
-LEVEL EDFACT_register_level(int flags)
-{
- LEVEL l; /* the level that we register */
- EDFACT_level_des *lev; /* for readableness only */
- PID i; /* a counter */
-
- printk("EDFACT_register_level\n");
-
- /* request an entry in the level_table */
- l = level_alloc_descriptor(sizeof(EDFACT_level_des));
-
- lev = (EDFACT_level_des *)level_table[l];
-
- printk(" lev=%d\n",(int)lev);
-
- /* fill the standard descriptor */
- lev->l.private_insert = EDFACT_private_insert;
- lev->l.private_extract = EDFACT_private_extract;
- lev->l.private_dispatch = EDFACT_private_dispatch;
- lev->l.private_epilogue = EDFACT_private_epilogue;
-
- lev->l.public_scheduler = EDFACT_public_scheduler;
- if (flags & EDFACT_ENABLE_GUARANTEE)
- lev->l.public_guarantee = EDFACT_public_guarantee;
- else
- lev->l.public_guarantee = NULL;
- lev->l.public_create = EDFACT_public_create;
- lev->l.public_detach = EDFACT_public_detach;
- lev->l.public_end = EDFACT_public_end;
- lev->l.public_dispatch = EDFACT_public_dispatch;
- lev->l.public_epilogue = EDFACT_public_epilogue;
- lev->l.public_activate = EDFACT_public_activate;
- lev->l.public_unblock = EDFACT_public_unblock;
- lev->l.public_block = EDFACT_public_block;
- lev->l.public_message = EDFACT_public_message;
-
- /* fill the EDFACT descriptor part */
- for(i=0; i<MAX_PROC; i++) {
- lev->period[i] = 0;
- lev->deadline_timer[i] = -1;
- lev->flag[i] = 0;
- lev->dline_miss[i] = 0;
- lev->wcet_miss[i] = 0;
- lev->nact[i] = 0;
- }
-
- iq_init(&lev->ready,&freedesc, 0);
- lev->flags = flags & 0x07;
- lev->U = 0;
-
- return l;
-}
-
-bandwidth_t EDFACT_usedbandwidth(LEVEL l)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- return lev->U;
-}
-
-int EDFACT_get_dline_miss(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- return lev->dline_miss[p];
-}
-
-int EDFACT_get_wcet_miss(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- return lev->wcet_miss[p];
-}
-
-int EDFACT_get_nact(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- return lev->nact[p];
-}
-
-int EDFACT_reset_dline_miss(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- lev->dline_miss[p] = 0;
- return 0;
-}
-
-int EDFACT_reset_wcet_miss(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- lev->wcet_miss[p] = 0;
- return 0;
-}
-
Index: rel_1_21/auto/tracks.c
===================================================================
--- rel_1_21/auto/tracks.c (revision 1217)
+++ rel_1_21/auto/tracks.c (nonexistent)
@@ -1,111 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-
-/**
- ------------
- CVS : $Id: tracks.c,v 1.1.1.1 2002-09-02 09:37:42 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:42 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Marco Dallera and Marco Fiocca
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * AUTO
- *
- * Another Unuseful Track simulatOr
- *
- * Authors: Marco Dallera
- * Marco Fiocca
- *
- */
-
-/* -------------- */
-/* Track loader */
-/* -------------- */
-
-#include "include/auto.h"
-#include "include/const.h"
-
-track track_list[TRACK_NUMBER];
-
-int track_init()
-{
- track demo1;
- track demo2;
- track brazil;
- track monaco;
-
- strcpy(demo1.name, "demo1.raw");
- demo1.pole_pos.x = 150;
- demo1.pole_pos.y = 35;
- demo1.pole_orient = 0.0;
- demo1.lap = CLOCK;
- demo1.selected = 0;
-
- strcpy(demo2.name, "demo2.raw");
- demo2.pole_pos.x = 150;
- demo2.pole_pos.y = 30;
- demo2.pole_orient = 0.0;
- demo2.lap = CLOCK;
- demo2.selected = 0;
-
- strcpy(brazil.name, "brazil.raw");
- brazil.pole_pos.x = 140;
- brazil.pole_pos.y = 185;
- brazil.pole_orient = 225.0;
- brazil.lap = ANTICLOCK;
- brazil.selected = 0;
-
- strcpy(monaco.name, "monaco.raw");
- monaco.pole_pos.x = 35;
- monaco.pole_pos.y = 315;
- monaco.pole_orient = 85.0;
- monaco.lap = CLOCK;
- monaco.selected = 0;
-
- track_list[0] = demo1;
- track_list[1] = demo2;
- track_list[2] = brazil;
- track_list[3] = monaco;
-
- return 0;
-}
Index: rel_1_21/auto/keyb.c
===================================================================
--- rel_1_21/auto/keyb.c (revision 1217)
+++ rel_1_21/auto/keyb.c (nonexistent)
@@ -1,105 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-
-/**
- ------------
- CVS : $Id: keyb.c,v 1.1.1.1 2002-09-02 09:37:42 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:42 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Marco Dallera and Marco Fiocca
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * AUTO
- *
- * Another Unuseful Track simulatOr
- *
- * Authors: Marco Dallera
- * Marco Fiocca
- *
- */
-
-/* ------------------ */
-/* Keyboard handler */
-/* ------------------ */
-
-#include "include/auto.h"
-#include "include/const.h"
-
-
-void keyb_handler() {
- KEY_EVT k;
- keyb_set_map(itaMap);
-
- /* Exit keys: ENTER */
- k.flag = 0;
- k.scan = KEY_ENT;
- k.ascii = 13;
- keyb_hook(k, endfun);
-
- /* Creates a new HARD car */
- k.flag = 0;
- k.scan = KEY_H;
- k.ascii = 'h';
- keyb_hook(k, hard_car_create);
-
- /* Creates a new SOFT car */
- k.flag = 0;
- k.scan = KEY_S;
- k.ascii = 's';
- keyb_hook(k, soft_car_create);
-}
-
-
-void endfun(KEY_EVT *k)
-{
- grx_close();
- cprintf("Ctrl-Brk pressed! Ending...\n");
- sys_end();
-}
-
-
-void my_close(void *arg)
-{
- kern_printf("my_close\n");
-}
-
Index: rel_1_21/auto/edfact.h
===================================================================
--- rel_1_21/auto/edfact.h (revision 1217)
+++ rel_1_21/auto/edfact.h (nonexistent)
@@ -1,152 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: edfact.h,v 1.2 2003-01-07 17:10:15 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-01-07 17:10:15 $
- ------------
-
- This file contains the server EDFACT (EDF with pending activations)
-
- Title:
- EDFACT
-
- Task Models Accepted:
- HARD_TASK_MODEL - Hard Tasks (only Periodic)
- wcet field and mit field must be != 0. They are used to set the wcet
- and period of the tasks.
- periodicity field can be only PERIODIC
- drel field is ignored
-
- Guest Models Accepted:
- JOB_TASK_MODEL - a single guest task activation
- Identified by an absolute deadline and a period.
- period field is ignored
-
- Description:
- This module schedule his tasks following the classic EDF scheme.
- The task guarantee is based on the factor utilization approach.
- The tasks scheduled are only periodic.
- All the task are put in a queue and the scheduling is based on the
- deadline value.
- NO GUARANTEE is performed on guest tasks. The guarantee must be performed
- by the level that inserts guest tasks in the EDF level.
- If a task miss a deadline a counter is incremented.
- If a task exausts the wcet a counter is incremented
- No ZOMBIE support!!!!!!
-
- Exceptions raised:
- XUNVALID_GUEST XUNVALID_TASK
- some primitives are not implemented:
- task_sleep, task_delay, guest_endcycle, guest_sleep, guest_delay
-
- XACTIVATION
- If a task is actiated through task_activate or guest_activate more than
- one time
-
- Restrictions & special features:
- - This level doesn't manage the main task.
- - At init time we have to specify:
- . guarantee check
- (when all task are created the system will check that the task_set
- will not use more than the available bandwidth)
- - A function to return the used bandwidth of the level is provided.
- - Functions to return and reset the nact, wcet and dline miss counters
-
-**/
-
-/*
- * Copyright (C) 2001 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#ifndef __EDFACT_H__
-#define __EDFACT_H__
-
-#include <ll/ll.h>
-#include <kernel/config.h>
-#include <sys/types.h>
-#include <kernel/types.h>
-
-
-
-
-
-
-
-
-/*+ flags... +*/
-#define EDFACT_ENABLE_GUARANTEE 1 /*+ Task Guarantee enabled +*/
-#define EDFACT_ENABLE_ALL 1
-
-#define EDFACT_FAILED_GUARANTEE 8 /*+ used in the module, unsettabl
- in EDF_register_level... +*/
-
-
-
-
-
-#define ELASTIC_HARD_PCLASS 0x0600
-
-#define EDFACT_LEVELNAME "EDFACT base"
-#define EDFACT_LEVEL_CODE 166
-#define EDFACT_LEVEL_VERSION 1
-
-
-/*+ Registration function:
- int flags Options to be used in this level instance...
-
- returns the level number at which the module has been registered.
-+*/
-LEVEL EDFACT_register_level(int flags);
-
-/*+ Returns the used bandwidth of a level +*/
-bandwidth_t EDFACT_usedbandwidth(LEVEL l);
-
-/*+ returns respectively the number of dline, wcet or nact; -1 if error +*/
-int EDFACT_get_dline_miss(PID p);
-int EDFACT_get_wcet_miss(PID p);
-int EDFACT_get_nact(PID p);
-
-/*+ resets respectively the number of dline, wcet miss; -1 if error +*/
-int EDFACT_reset_dline_miss(PID p);
-int EDFACT_reset_wcet_miss(PID p);
-
-#endif
-
Index: rel_1_21/auto/info.c
===================================================================
--- rel_1_21/auto/info.c (revision 1217)
+++ rel_1_21/auto/info.c (nonexistent)
@@ -1,154 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-
-/**
- ------------
- CVS : $Id: info.c,v 1.1.1.1 2002-09-02 09:37:42 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:42 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Marco Dallera and Marco Fiocca
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * AUTO
- *
- * Another Unuseful Track simulatOr
- *
- * Authors: Marco Dallera
- * Marco Fiocca
- *
- */
-
-/* ------------------- */
-/* Information panel */
-/* ------------------- */
-
-#include "include/auto.h"
-#include "include/const.h"
-#include "include/utils.h"
-
-extern sem_t grx_mutex;
-
-/* ------------------------------------------------------------------ */
-
-void bar_display(point p1, int width, int height, int border, float var, float max, int color, char *name)
-{
- int background = BLACK;
- int amp = 0;
- point p2;
-
- p2.x = p1.x + width;
- p2.y = p1.y + height;
-
- sem_wait(&grx_mutex);
-
- grx_text(name, p1.x, p1.y + height + 3, color, background);
- grx_rect(p1.x - 1, p1.y - 1, p2.x + 1, p2.y + 1, border);
-
- grx_box(p1.x, p1.y, p2.x, p2.y, BLACK);
- amp = abs(round( var * (float)(p2.x - p1.x) / max ));
- grx_box(p1.x, p1.y, p1.x + amp, p2.y, color);
-
- sem_post(&grx_mutex);
-}
-
-/* ------------------------------------------------------------------ */
-
-void bidir_bar_display(point p1, int width, int height, int border, float var, float max, int color, char *name)
-{
- int background = BLACK;
- int amp = 0;
- point p2;
-
- p2.x = p1.x + width;
- p2.y = p1.y + height;
-
- sem_wait(&grx_mutex);
-
- grx_text(name, p1.x, p1.y + height + 3, color, background);
- grx_rect(p1.x - 1, p1.y - 1, p2.x + 1, p2.y + 1, border);
-
- grx_box(p1.x, p1.y, p2.x, p2.y, BLACK);
- amp = round( var * (float)((p2.x - p1.x)/2) / max );
- if (amp >= 0)
- grx_box((p1.x+p2.x)/2, p1.y, ((p1.x+p2.x)/2)+amp, p2.y, color);
- else
- grx_box((p1.x+p2.x)/2+amp, p1.y, ((p1.x+p2.x)/2), p2.y, color);
- grx_line((p1.x+p2.x)/2, p1.y-2, (p1.x+p2.x)/2, p2.y+2, border);
-
- sem_post(&grx_mutex);
-}
-
-/* ------------------------------------------------------------------ */
-
-void cmd_display()
-{
- point p1;
-
- p1.x = TRACK_X1;
- p1.y = TRACK_Y2+3;
-
- sem_wait(&grx_mutex);
- grx_rect(p1.x, p1.y, p1.x+CMD_WIDTH, p1.y+CMD_HEIGHT, BLUE);
- grx_rect(p1.x+1, p1.y+1, p1.x+CMD_WIDTH-1, p1.y+CMD_HEIGHT-1, CYAN);
- grx_rect(p1.x+2, p1.y+2, p1.x+CMD_WIDTH-2, p1.y+CMD_HEIGHT-2, LIGHTBLUE);
- grx_text("## Another Unuseful Track simulatOr ##",
- p1.x+8, p1.y+8, YELLOW, BLACK);
- grx_text("## -------------------------------- ##",
- p1.x+8, p1.y+16, YELLOW, BLACK);
- grx_text("Marco Dallera", p1.x+8, p1.y+24, GREEN, BLACK);
- grx_text("marchicchio@libero.it", p1.x+120, p1.y+24, GREEN, BLACK);
- grx_text("Marco Fiocca", p1.x+8, p1.y+32, GREEN, BLACK);
- grx_text("marqinho@tiscalinet.it", p1.x+120, p1.y+32, GREEN, BLACK);
-
- grx_text("Command keys ", p1.x+8, p1.y+48, LIGHTBLUE, BLACK);
- grx_text("------------------------", p1.x+8, p1.y+56, LIGHTBLUE, BLACK);
- grx_text("h create a HARD car", p1.x+8, p1.y+64, CYAN, BLACK);
- grx_text("s create a SOFT car", p1.x+8, p1.y+72, CYAN, BLACK);
- grx_text("ENTER exit to DOS", p1.x+8, p1.y+80, CYAN, BLACK);
-
- sem_post(&grx_mutex);
-
-}
-
-/* ------------------------------------------------------------------ */
-
Index: rel_1_21/auto/makefile
===================================================================
--- rel_1_21/auto/makefile (revision 1217)
+++ rel_1_21/auto/makefile (nonexistent)
@@ -1,22 +0,0 @@
-#
-# Auto Makefile
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS= auto auto2 auto3
-
-include $(BASE)/config/example.mk
-
-auto:
- make -f $(SUBMAKE) APP=auto INIT= OTHEROBJS="initfil1.o sensor.o control.o keyb.o info.o utils.o tracks.o jetctrl.o" SHARKOPT="__OLDCHAR__ __GRX__"
-
-auto2:
- make -f $(SUBMAKE) APP=auto INIT= OTHEROBJS="initfil2.o sensor.o control.o keyb.o info.o utils.o tracks.o jetctrl.o" SHARKOPT="__OLDCHAR__ __GRX__"
-
-auto3:
- make -f $(SUBMAKE) APP=auto INIT= OTHEROBJS="initfil3.o sensor.o control.o keyb.o info.o utils.o tracks.o edfact.o jetctrl.o" SHARKOPT="__OLDCHAR__ __GRX__"
-
Index: rel_1_21/auto/utils.c
===================================================================
--- rel_1_21/auto/utils.c (revision 1217)
+++ rel_1_21/auto/utils.c (nonexistent)
@@ -1,131 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-
-/**
- ------------
- CVS : $Id: utils.c,v 1.1.1.1 2002-09-02 09:37:42 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:42 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Marco Dallera and Marco Fiocca
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * AUTO
- *
- * Another Unuseful Track simulatOr
- *
- * Authors: Marco Dallera
- * Marco Fiocca
- *
- */
-
-#include "include/auto.h"
-#include "include/utils.h"
-#include <string.h>
-#include <stdlib.h>
-
-float rand_01()
-{
- return (((float)(rand()%20) / 100.0) + 0.8);
-}
-
-int rand_color()
-{
- return (rand()%16);
-}
-
-int round(float value)
-{
- return ((int)(value + 0.5));
-}
-
-void reverse(char s[]) {
- int c, i, j;
-
- for (i = 0, j = strlen(s)-1; i<j; i++, j--) {
- c = s[i];
- s[i] = s[j];
- s[j] = c;
- }
-}
-
-char * itoa(int n, char *s) {
- int i, sign;
-
- if ((sign = n) < 0)
- n = -n;
- i = 0;
-
- do {
- s[i++] = n % 10 + '0';
- } while ((n /= 10) > 0);
-
- if (sign < 0)
- s[i++] = '-';
- s[i] = 0;
-
- reverse(s);
-
- return s;
-}
-
-time int2time(int t)
-{
- time ts;
-
- ts.dec = t % 10;
- ts.sec = (t/10) % 60;
- ts.min = (int)(t / 600);
-
- return ts;
-}
-
-
-
-
-
-
-
-
-
-
-
Index: rel_1_21/auto/include/utils.h
===================================================================
--- rel_1_21/auto/include/utils.h (revision 1217)
+++ rel_1_21/auto/include/utils.h (nonexistent)
@@ -1,76 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-
-/**
- ------------
- CVS : $Id: utils.h,v 1.1.1.1 2002-09-02 09:37:42 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:42 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Marco Dallera and Marco Fiocca
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * AUTO
- *
- * Another Unuseful Track simulatOr
- *
- * Authors: Marco Dallera
- * Marco Fiocca
- *
- */
-
-/* ------------------ */
-/* Useful functions */
-/* ------------------ */
-
-#ifndef __UTILS_H_
-
-#define __UTILS_H_
-
-float rand_01();
-int rand_color();
-int round(float value);
-char * itoa(int n, char *s);
-void reverse(char s[]);
-time int2time(int t);
-
-#endif
Index: rel_1_21/auto/include/const.h
===================================================================
--- rel_1_21/auto/include/const.h (revision 1217)
+++ rel_1_21/auto/include/const.h (nonexistent)
@@ -1,141 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-
-/**
- ------------
- CVS : $Id: const.h,v 1.1.1.1 2002-09-02 09:37:42 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:42 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Marco Dallera and Marco Fiocca
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * AUTO
- *
- * Another Unuseful Track simulatOr
- *
- * Authors: Marco Dallera
- * Marco Fiocca
- *
- */
-
-/* ------------------ */
-/* Useful constants */
-/* ------------------ */
-
-#ifndef __CONST_H_
-
-#define __CONST_H_
-
-/* Screen dimensions */
-#define SCREEN_WIDTH 800
-#define SCREEN_HEIGHT 600
-#define SCREEN_BIT_COLORS 8
-
-/* Visible area */
-#define TEL_WIDTH 50
-#define TEL_HEIGHT 50
-
-/* Car dimensions */
-#define CAR_WIDTH 12
-#define CAR_HEIGHT 12
-#define CAR_W 8
-#define CAR_H 10
-
-/* Track dimensions */
-#define TRACK_WIDTH 500
-#define TRACK_HEIGHT 500
-
-/* Track position */
-#define TRACK_X1 0
-#define TRACK_Y1 0
-#define TRACK_X2 TRACK_X1+TRACK_WIDTH-1
-#define TRACK_Y2 TRACK_Y1+TRACK_HEIGHT-1
-
-/* Max number of car on track */
-#define MAX_CAR_NUMBER 10
-#define DRIVERS_NUMBER 20
-#define MAX_DRIVER_NAME_LENGTH 20
-#define MAX_TRACK_NAME_LENGTH 20
-#define TRACK_NUMBER 4
-
-/* Lap direction */
-#define CLOCK 0
-#define ANTICLOCK 1
-
-/* Information display coords */
-#define CMD_WIDTH TRACK_WIDTH
-#define CMD_HEIGHT (SCREEN_HEIGHT-TRACK_HEIGHT-3)
-
-/* Car position limits */
-#define MIN_CAR_X (TRACK_X1 + CAR_WIDTH/2 + 4)
-#define MIN_CAR_Y (TRACK_Y1 + CAR_HEIGHT/2 + 4)
-#define MAX_CAR_X (TRACK_X2 - CAR_WIDTH/2 - 4)
-#define MAX_CAR_Y (TRACK_Y2 - CAR_HEIGHT/2 - 4)
-
-/* Road constants */
-#define LEFT_ONLY 10
-#define RIGHT_ONLY 11
-#define ROAD_OK 12
-#define NO_ROAD 13
-
-/* Collision constants */
-#define COLLISION_LEFT 20
-#define COLLISION_RIGHT 21
-#define COLLISION_BACK 22
-#define NO_COLL 0
-
-/* CAB constants */
-#define ROAD_MSG_DIM sizeof(road_info)
-#define ROAD_MSG_READER 4
-
-#define CAR_MSG_DIM sizeof(car_status)
-#define CAR_MSG_READER 5
-
-/* Tasks parameters */
-#define SENSOR_WCET 3000
-#define SENSOR_PERIOD 40000
-#define CONTROL_WCET 1000
-#define CONTROL_PERIOD 40000
-
-#endif
-
Index: rel_1_21/auto/include/auto.h
===================================================================
--- rel_1_21/auto/include/auto.h (revision 1217)
+++ rel_1_21/auto/include/auto.h (nonexistent)
@@ -1,188 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-
-/**
- ------------
- CVS : $Id: auto.h,v 1.1.1.1 2002-09-02 09:37:42 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:42 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Marco Dallera and Marco Fiocca
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * AUTO
- *
- * Another Unuseful Track simulatOr
- *
- * Authors: Marco Dallera
- * Marco Fiocca
- *
- */
-
-/* ------------------- */
-/* Useful structures */
-/* ------------------- */
-
-#ifndef __CAR_H_
-
-#define __CAR_H_
-
-#include <modules/cabs.h>
-#include <kernel/func.h>
-#include <kernel/model.h>
-#include <kernel/types.h>
-#include <drivers/keyb.h>
-#include <drivers/glib.h>
-#include <semaphore.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "const.h"
-
-#define degree_to_rad(a) ((M_PI/180.0)*(a))
-#define rad_to_degree(a) ((180.0/M_PI)*(a))
-
-typedef struct {
- int x;
- int y;
-} point;
-
-typedef struct {
- float x,y;
-} point_f;
-
-typedef struct {
- float mod;
- float phase;
-} vector;
-
-typedef struct {
- point_f pos;
- float orient;
-} car_status;
-
-typedef struct {
- int left_border;
- int right_border;
- int distance;
- float curve;
- point opps_list[MAX_CAR_NUMBER];
- int opps_number;
- int collision;
- int flag;
-} road_info;
-
-typedef struct {
- int left,center,right;
-} road_strip;
-
-typedef struct {
- PID sensor_pid,control_pid;
- int number;
- char driver[MAX_DRIVER_NAME_LENGTH];
- float max_speed, min_acc, max_acc;
- float rage;
- CAB road_status_cab;
- CAB car_status_cab;
- int color;
-} car_params;
-
-typedef struct {
- char name[MAX_TRACK_NAME_LENGTH]; // il nome del file
- point pole_pos; // la posizione di partenza
- float pole_orient; // la direzione di partenza
- int lap; // il senso di marcia: CLOCK, ANTICLOCK
- int selected; // it's a flag marking the actually selected track
-} track;
-
-typedef struct {
- int min;
- int sec;
- int dec;
-} time;
-
-extern car_params cars[MAX_CAR_NUMBER];
-extern char track_img[TRACK_WIDTH*TRACK_HEIGHT];
-extern track track_list[TRACK_NUMBER];
-
-/* ---------------------------------------- */
-/* Functions definition */
-/* ---------------------------------------- */
-
-/* CABs R/W functions */
-int set_car_status(car_status, CAB); // sends the new status according to the control law
-car_status get_car_status(CAB); // reads car status from a CAB
-int set_road_info(road_info, CAB); // sends the new road informations
-road_info get_road_info(CAB); // reads road status values from a CAB
-
-/* Keyboard functions */
-void keyb_handler();
-void endfun(KEY_EVT *);
-void my_close(void *);
-
-/* Display functions */
-void bar_display(point p1, int width, int height, int border, float var, float max, int color, char *name);
-void bidir_bar_display(point p1, int width, int height, int border, float var, float max, int color, char *name);
-void cmd_display();
-
-/* Closing function */
-void byebye();
-void error_msg();
-
-/* Tasks */
-TASK sensor(); // Camera car task
-TASK control(); // Car controller task
-TASK manual(); // Manual driving task
-TASK actuator(); // Graphic drawing task
-TASK info(); // Car informations display task
-
-/* Tasks management */
-void hard_car_create();
-void soft_car_create();
-void killcar();
-
-/* Tracks management */
-int track_init();
-
-#endif
-
Index: rel_1_21/auto/tracks/monaco.raw
===================================================================
--- rel_1_21/auto/tracks/monaco.raw (revision 1217)
+++ rel_1_21/auto/tracks/monaco.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/tracks/brazil.raw
===================================================================
--- rel_1_21/auto/tracks/brazil.raw (revision 1217)
+++ rel_1_21/auto/tracks/brazil.raw (nonexistent)
@@ -1,2 +0,0 @@
- -!"#
\ No newline at end of file
Index: rel_1_21/auto/tracks/demo1.raw
===================================================================
--- rel_1_21/auto/tracks/demo1.raw (revision 1217)
+++ rel_1_21/auto/tracks/demo1.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/tracks/demo2.raw
===================================================================
--- rel_1_21/auto/tracks/demo2.raw (revision 1217)
+++ rel_1_21/auto/tracks/demo2.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/jetctrl.c
===================================================================
--- rel_1_21/auto/jetctrl.c (revision 1217)
+++ rel_1_21/auto/jetctrl.c (nonexistent)
@@ -1,155 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: jetctrl.c,v 1.1.1.1 2002-09-02 09:37:42 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:42 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * this file is directly derived from the demos/jumpball/jetctrl.c .
- * I just added this controls to check when the system will become overloaded
- */
-
-#define WCET_JETDUMMY 200
-#define PERIOD_JETDUMMY 100000
-#define DUMMY_PID 1
-
-#define JET_DUMMY_WIDTH (CMD_WIDTH-370)
-#define JET_DUMMY_HEIGHT (CMD_HEIGHT-40)
-
-/* the point (x, y) is the top left corner */
-#define JET_DUMMY_X (TRACK_X1+360)
-#define JET_DUMMY_Y (TRACK_Y2+32)
-
-// JetControl
-
-#include "semaphore.h"
-#include "include/const.h"
-#include "kernel/func.h"
-#include "drivers/glib.h"
-
-extern sem_t grx_mutex;
-
-/* useful colors... */
-int white;
-int black;
-extern int red;
-extern int lightgray;
-
-TASK jetdummy_task(void *arg)
-{
- TIME now_dummy, last_dummy, diff_dummy, slice;
- struct timespec now, last, diff;
- int x = 0;
- int height;
-
- NULL_TIMESPEC(&last);
- last_dummy = 0;
- for (;;) {
- task_nopreempt();
- jet_getstat(DUMMY_PID, NULL, NULL, NULL, &now_dummy);
- sys_gettime(&now);
- task_preempt();
-
- SUBTIMESPEC(&now, &last, &diff);
- slice = diff.tv_sec * 1000000 + diff.tv_nsec/1000;
- diff_dummy = now_dummy - last_dummy;
-
- height = (int)(JET_DUMMY_HEIGHT*((float)diff_dummy)/((float)slice));
-
- TIMESPEC_ASSIGN(&last, &now);
- last_dummy = now_dummy;
-
- sem_wait(&grx_mutex);
- grx_line(JET_DUMMY_X+x,JET_DUMMY_Y,
- JET_DUMMY_X+x,JET_DUMMY_Y+height ,black);
- grx_line(JET_DUMMY_X+x,JET_DUMMY_Y+height,
- JET_DUMMY_X+x,JET_DUMMY_Y+JET_DUMMY_HEIGHT,white);
- grx_line(JET_DUMMY_X+(x+1)%JET_DUMMY_WIDTH,JET_DUMMY_Y,
- JET_DUMMY_X+(x+1)%JET_DUMMY_WIDTH,JET_DUMMY_Y+JET_DUMMY_HEIGHT,255);
- sem_post(&grx_mutex);
-
- x = (x+1)%JET_DUMMY_WIDTH;
-
- task_endcycle();
- }
-}
-
-void init_jetcontrol(void)
-{
- SOFT_TASK_MODEL m4;
-
- PID p4;
-
- /* useful colors ... */
- white = WHITE;
- black = BLACK;
-
- /* scenario */
- sem_wait(&grx_mutex);
- grx_text("System load",
- JET_DUMMY_X+8, JET_DUMMY_Y-10, lightgray, black);
- grx_rect(JET_DUMMY_X-1, JET_DUMMY_Y-1,
- JET_DUMMY_X+JET_DUMMY_WIDTH, JET_DUMMY_Y+JET_DUMMY_HEIGHT+1, lightgray);
-
- grx_text("100%", JET_DUMMY_X-40, JET_DUMMY_Y, lightgray, black);
- grx_text(" 0%", JET_DUMMY_X-40, JET_DUMMY_Y+JET_DUMMY_HEIGHT-8, lightgray, black);
-
- grx_line(JET_DUMMY_X-1, JET_DUMMY_Y, JET_DUMMY_X-5, JET_DUMMY_Y, lightgray);
- grx_line(JET_DUMMY_X-1, JET_DUMMY_Y+JET_DUMMY_HEIGHT, JET_DUMMY_X-5, JET_DUMMY_Y+JET_DUMMY_HEIGHT, lightgray);
- sem_post(&grx_mutex);
-
- /* jetdummy task */
- soft_task_default_model(m4);
- soft_task_def_period(m4, PERIOD_JETDUMMY);
- soft_task_def_met(m4, WCET_JETDUMMY);
- soft_task_def_usemath(m4);
- p4 = task_create("jdmy", jetdummy_task, &m4, NULL);
- if (p4 == -1) {
- grx_close();
- perror("Could not create task <jetdummy>");
- sys_end();
- }
- task_activate(p4);
-}
-
Index: rel_1_21/auto/cars/car0.raw
===================================================================
--- rel_1_21/auto/cars/car0.raw (revision 1217)
+++ rel_1_21/auto/cars/car0.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/cars/car1.raw
===================================================================
--- rel_1_21/auto/cars/car1.raw (revision 1217)
+++ rel_1_21/auto/cars/car1.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/cars/car2.raw
===================================================================
--- rel_1_21/auto/cars/car2.raw (revision 1217)
+++ rel_1_21/auto/cars/car2.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/cars/car3.raw
===================================================================
--- rel_1_21/auto/cars/car3.raw (revision 1217)
+++ rel_1_21/auto/cars/car3.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/cars/car4.raw
===================================================================
--- rel_1_21/auto/cars/car4.raw (revision 1217)
+++ rel_1_21/auto/cars/car4.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/cars/car5.raw
===================================================================
--- rel_1_21/auto/cars/car5.raw (revision 1217)
+++ rel_1_21/auto/cars/car5.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/cars/car6.raw
===================================================================
--- rel_1_21/auto/cars/car6.raw (revision 1217)
+++ rel_1_21/auto/cars/car6.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/cars/car7.raw
===================================================================
--- rel_1_21/auto/cars/car7.raw (revision 1217)
+++ rel_1_21/auto/cars/car7.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/cars/boom.raw
===================================================================
--- rel_1_21/auto/cars/boom.raw (revision 1217)
+++ rel_1_21/auto/cars/boom.raw (nonexistent)
@@ -1 +0,0 @@
-      
\ No newline at end of file
Index: rel_1_21/auto/cars/car8.raw
===================================================================
--- rel_1_21/auto/cars/car8.raw (revision 1217)
+++ rel_1_21/auto/cars/car8.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/cars/car9.raw
===================================================================
--- rel_1_21/auto/cars/car9.raw (revision 1217)
+++ rel_1_21/auto/cars/car9.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/cars/car10.raw
===================================================================
--- rel_1_21/auto/cars/car10.raw (revision 1217)
+++ rel_1_21/auto/cars/car10.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/cars/fumo.raw
===================================================================
--- rel_1_21/auto/cars/fumo.raw (revision 1217)
+++ rel_1_21/auto/cars/fumo.raw (nonexistent)
@@ -1 +0,0 @@
-!!!!!!!!!!!!!!!!!!!!!!
\ No newline at end of file
Index: rel_1_21/auto/cars/car11.raw
===================================================================
--- rel_1_21/auto/cars/car11.raw (revision 1217)
+++ rel_1_21/auto/cars/car11.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/cars/car12.raw
===================================================================
--- rel_1_21/auto/cars/car12.raw (revision 1217)
+++ rel_1_21/auto/cars/car12.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/cars/car13.raw
===================================================================
--- rel_1_21/auto/cars/car13.raw (revision 1217)
+++ rel_1_21/auto/cars/car13.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/cars/car14.raw
===================================================================
--- rel_1_21/auto/cars/car14.raw (revision 1217)
+++ rel_1_21/auto/cars/car14.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/cars/car15.raw
===================================================================
--- rel_1_21/auto/cars/car15.raw (revision 1217)
+++ rel_1_21/auto/cars/car15.raw (nonexistent)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: rel_1_21/auto/auto.c
===================================================================
--- rel_1_21/auto/auto.c (revision 1217)
+++ rel_1_21/auto/auto.c (nonexistent)
@@ -1,530 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-
-/**
- ------------
- CVS : $Id: auto.c,v 1.2 2003-01-07 17:10:15 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-01-07 17:10:15 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Marco Dallera and Marco Fiocca
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * AUTO
- *
- * Another Unuseful Track simulatOr
- *
- * Authors: Marco Dallera
- * Marco Fiocca
- *
- */
-
-#include "include/auto.h"
-#include "include/const.h"
-#include "include/utils.h"
-
-int car_number;
-car_params cars[MAX_CAR_NUMBER];
-char drivers[DRIVERS_NUMBER][MAX_DRIVER_NAME_LENGTH] = {
- "M.Schumacher",
- "D.Coulthard",
- "R.Schumacher",
- "M.Hakkinen",
- "R.Barrichello",
- "J.P.Montoya",
- "E.Irvine",
- "J.Trulli",
- "H.Frentzen",
- "J.Villeneuve",
- "J.Alesi",
- "G.Fisichella",
- "O.Panis",
- "O.Wurz",
- "J.Button",
- "P.P.Diniz",
- "P.De La Rosa",
- "T.Marques",
- "R.Zonta",
- "G.Mazzacane"
-};
-
-extern char sprite[18][CAR_WIDTH*CAR_HEIGHT];
-
-/* Semaphores */
-sem_t grx_mutex;
-
-/* Useful colors */
-int red = rgb16(255, 0, 0);
-int green = rgb16( 0, 255, 0);
-int blue = rgb16( 0, 0, 255);
-int lightgray = rgb16(192, 192, 192);
-
-/* JetCTRL Initialization */
-void init_jetcontrol(void);
-
-/* -------------------------------------------------------*/
-
-/* --------------------- */
-/* Handling car status */
-/* --------------------- */
-
-int set_car_status(car_status cs, CAB cab_id) {
- char *msg;
-
- msg = cab_reserve(cab_id);
- memcpy(msg, &cs, CAR_MSG_DIM);
- return(cab_putmes(cab_id, msg));
-}
-
-car_status get_car_status(CAB cab_id) {
- char *msg;
- car_status status;
-
- msg = cab_getmes(cab_id);
- memcpy(&status, msg, CAR_MSG_DIM);
- cab_unget(cab_id, msg);
-
- return (status);
-}
-
-/* ---------------------------- */
-/* Handling road informations */
-/* ---------------------------- */
-
-int set_road_info(road_info info, CAB road_status_cab) {
- char *msg;
-
- msg = cab_reserve(road_status_cab);
- memcpy(msg, &info, ROAD_MSG_DIM);
- return(cab_putmes(road_status_cab, msg));
-}
-
-road_info get_road_info(CAB road_status_cab) {
- char *msg;
- road_info info;
-
- msg = cab_getmes(road_status_cab);
- memcpy(&info, msg, ROAD_MSG_DIM);
- cab_unget(road_status_cab, msg);
-
- return (info);
-}
-
-/* -------------------------------------------------------*/
-
-/* Closing function */
-void byebye()
-{
- grx_close();
-
- // we need clear to reposition the cursor in the right place after
- // going back from the graphical mode.
- clear();
-
- kern_printf("Race is over!\n");
-}
-
-/* -------------------------------------------------------*/
-
-/* ------------------- */
-/* Hard car creation */
-/* ------------------- */
-
-void hard_car_create() {
- car_params cp;
- HARD_TASK_MODEL sensor_m, control_m;
- PID sensor_pid, control_pid;
- TIME seed; /* used to init the random seed */
- int drv_ind;
-
- if (car_number >= MAX_CAR_NUMBER) return;
-
- /* Randomize!!!! */
- seed = sys_gettime(NULL);
- srand(seed);
-
- /* CAB creation */
- cp.road_status_cab = cab_create("road_cab", ROAD_MSG_DIM, ROAD_MSG_READER);
- cp.car_status_cab = cab_create("car_cab", CAR_MSG_DIM, CAR_MSG_READER);
-
- /* Car parameters initialization */
- cp.max_speed = rand_01();
- cp.min_acc = cp.max_speed;
- cp.max_acc = cp.max_speed;
- cp.rage = cp.max_speed;
- cp.color = 3+car_number;
- cp.number = car_number;
- drv_ind = DRIVERS_NUMBER-1 - (int)(((cp.rage-0.8+0.005) * (float)DRIVERS_NUMBER) / 0.2);
-
- /* Sets driver's name without duplications */
- strcpy(cp.driver, drivers[drv_ind]);
- while (!strcmp(cp.driver,"***"))
- strcpy(cp.driver, drivers[++drv_ind%DRIVERS_NUMBER]);
- strcpy(drivers[drv_ind],"***");
-
- cars[car_number] = cp;
-
- /* ------------ */
- /* Task Calls */
- /* ------------ */
-
- /* sensor task creation */
- hard_task_default_model(sensor_m);
-
- hard_task_def_arg(sensor_m, (void *)car_number);
- hard_task_def_wcet(sensor_m, SENSOR_WCET);
- hard_task_def_mit(sensor_m, SENSOR_PERIOD);
- hard_task_def_usemath(sensor_m);
- sensor_pid = task_create("camera", sensor, &sensor_m, NULL);
- if(sensor_pid == -1)
- sys_end();
-
- /* control task creation */
- hard_task_default_model(control_m);
- hard_task_def_arg(control_m, (void *)car_number);
- hard_task_def_wcet(control_m, CONTROL_WCET);
- hard_task_def_mit(control_m, CONTROL_PERIOD);
- hard_task_def_usemath(control_m);
- control_pid = task_create("controller", control, &control_m, NULL);
- if(control_pid == -1)
- sys_end();
-
- cars[car_number].sensor_pid = sensor_pid;
- cars[car_number].control_pid = control_pid;
- car_number++; // increases cars number
-
- task_activate(sensor_pid);
- task_activate(control_pid);
-}
-
-/* -------------------------------------------------------*/
-
-/* ------------------- */
-/* Soft car creation */
-/* ------------------- */
-
-void soft_car_create() {
- car_params cp;
- SOFT_TASK_MODEL sensor_m, control_m;
- PID sensor_pid, control_pid;
- TIME seed; /* used to init the random seed */
- int drv_ind;
-
- if (car_number >= MAX_CAR_NUMBER) return;
-
- /* Randomize!!!! */
- seed = sys_gettime(NULL);
- srand(seed);
-
- /* CAB creation */
- cp.road_status_cab = cab_create("road_cab", ROAD_MSG_DIM, ROAD_MSG_READER);
- cp.car_status_cab = cab_create("car_cab", CAR_MSG_DIM, CAR_MSG_READER);
-
- /* Car parameters initialization */
- cp.max_speed = rand_01();
- cp.min_acc = cp.max_speed;
- cp.max_acc = cp.max_speed;
- cp.rage = cp.max_speed;
- cp.color = 8+car_number;
- cp.number = car_number;
- drv_ind = DRIVERS_NUMBER-1 - (int)(((cp.rage-0.8+0.005) * (float)DRIVERS_NUMBER) / 0.2);
-
- /* Sets driver's name without duplications */
- strcpy(cp.driver, drivers[drv_ind]);
- while (!strcmp(cp.driver,"***"))
- strcpy(cp.driver, drivers[++drv_ind%DRIVERS_NUMBER]);
- strcpy(drivers[drv_ind],"***");
- cars[car_number] = cp;
-
- /* ------------ */
- /* Task Calls */
- /* ------------ */
-
- /* sensor task creation */
- soft_task_default_model(sensor_m);
-
- soft_task_def_arg(sensor_m, (void *)car_number);
- soft_task_def_met(sensor_m, SENSOR_WCET);
- soft_task_def_period(sensor_m, SENSOR_PERIOD);
- soft_task_def_usemath(sensor_m);
- sensor_pid = task_create("camera", sensor, &sensor_m, NULL);
- if(sensor_pid == -1)
- sys_end();
-
- /* control task creation */
- soft_task_default_model(control_m);
- soft_task_def_arg(control_m, (void *)car_number);
- soft_task_def_met(control_m, CONTROL_WCET);
- soft_task_def_period(control_m, CONTROL_PERIOD);
- soft_task_def_usemath(control_m);
- control_pid = task_create("controller", control, &control_m, NULL);
- if(control_pid == -1)
- sys_end();
-
- cars[car_number].sensor_pid = sensor_pid;
- cars[car_number].control_pid = control_pid;
- car_number++; // increases cars number
-
- task_activate(sensor_pid);
- task_activate(control_pid);
-}
-
-/* -------------------------------------------------------*/
-
-/* ------------------- */
-/* The main function */
-/* ------------------- */
-
-int main(int argc, char **argv) {
- TIME seed; /* used to init the random seed */
-
- if (MAX_CAB < 30) {
- cprintf("The application needs at least 30 CABS.\n"
- "Please set the MAX_CAB #define to 30 or more...\n"
- "...(see include/modules/cabs.h)\n");
- sys_end();
- }
-
- /* Set the closing function */
- sys_atrunlevel(byebye, NULL, RUNLEVEL_BEFORE_EXIT);
-
- /* Keyboard handling */
- keyb_handler();
- kern_printf("KEYBOARD initialized...\n");
-
- /* Graphics mutex */
- sem_init(&grx_mutex, 0, 1);
-
- /* Graphics init */
- grx_init();
- grx_open(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BIT_COLORS);
-
- /* Track drawing */
- sem_wait(&grx_mutex);
- grx_setcolor(46,0,0,0);
- grx_setcolor(43,255,255,255);
- grx_setcolor(26,255,74,33);
- grx_setcolor(27,255,255,255);
- grx_setcolor(1,8,8,8);
- grx_setcolor(3,255,0,0);
- grx_setcolor(28,255,50,0);
- grx_setcolor(29,255,90,0);
- grx_setcolor(30,255,130,0);
- grx_setcolor(31,255,170,0);
- grx_setcolor(32,255,210,0);
- grx_setcolor(33,48,48,48);
-
- grx_putimage(TRACK_X1, TRACK_Y1, TRACK_X2, TRACK_Y2, track_img);
- sem_post(&grx_mutex);
-
- /* Command and info display */
- cmd_display();
-
- /* JetCTRL Initialization */
- init_jetcontrol();
-
- /* Randomize!!!! */
- seed = sys_gettime(NULL);
- srand(seed);
-
- car_number = 0;
-
- /* ------------ */
- /* Task Calls */
- /* ------------ */
-
- hard_car_create();
-
- return 0;
-}
-
-/* -------------------------------------------------------*/
-
-void read_track(int i)
-{
- DOS_FILE *f; // DOS file descriptor
- int file_length;
- int index;
- char filename[100];
- int err; // Error code
-
- /* Init track_list */
- track_init();
-
- /* Set the selected track from track_list */
- if (i < TRACK_NUMBER)
- index = i;
- else
- index = 0;
- cprintf("Selected index = %d\n", index);
-
- strcpy(filename, strcat("tracks/", track_list[index].name));
- cprintf("File to open = %s\n", filename);
- track_list[index].selected = 1;
-
- /* open the DOS file for reading (you can specify only "r" or "w") */
- f = DOS_fopen(filename,"r");
-
- /* check for open errors */
- if (!f) {
- err = DOS_error(); // error!!
-
- /* note that if you call DOS_error() here, it return 0!!! */
- cprintf("Error %d opening %s...\n", err, filename);
- file_length = 0;
- byebye();
- return;
- }
-
- /* read track file */
- file_length = DOS_fread(&track_img, 1, TRACK_WIDTH*TRACK_HEIGHT, f);
-
- /* check for errors */
- err = DOS_error();
-
- cprintf("Read %d bytes from %s...\n", file_length, filename);
-
- if (err) {
- cprintf("Error %d reading %s...\n", err, filename);
- file_length = 0;
- /* there is not return because I want to close the file! */
- }
-
- /* Close the file */
- cprintf("Closing file %s...\n", filename);
- DOS_fclose(f);
- cprintf("File %s closed successfully!\n", filename);
-
-}
-
-/* -------------------------------------------------------*/
-
-void read_sprites()
-{
- /* DOS file descriptor */
- DOS_FILE *f;
- int myfilebuf_length,i;
- char filename[100];
-
- /* Error code */
- int err;
- i=0;
-
- for ( i=0; i < 16; i++) {
- sprintf(filename,"cars/car%d.raw",i);
- f = DOS_fopen(filename,"r");
-
- // check for open errors
- if (!f) {
- // error!!
- err = DOS_error();
-
- // note that if you call DOS_error() here, it return 0!!!
- cprintf("Error %d opening %s...\n", err, filename);
- myfilebuf_length = 0;
- return;
- }
-
- // read from file
- myfilebuf_length = DOS_fread(&sprite[i][0],1,CAR_WIDTH*CAR_HEIGHT,f);
-
- // check for errors
- err = DOS_error();
-
- cprintf("Read %d bytes from %s...\n", myfilebuf_length, filename);
-
- if (err) {
- cprintf("Error %d reading %s...\n", err, filename);
- myfilebuf_length = 0;
- // there is not return because I want to close the file!
- }
-
- // Close the file
- DOS_fclose(f);
- }
-
- f = DOS_fopen("cars/boom.raw","r");
- if (!f) {
- err = DOS_error();
-
- cprintf("Error %d opening boom.raw...\n", err);
- myfilebuf_length = 0;
- return;
- }
-
- myfilebuf_length = DOS_fread(&sprite[16][0],1,CAR_WIDTH*CAR_HEIGHT,f);
-
- err = DOS_error();
-
- cprintf("Read %d bytes from boom.raw...\n", myfilebuf_length);
-
- if (err) {
- cprintf("Error %d reading boom.raw...\n", err);
- myfilebuf_length = 0;
- }
-
- DOS_fclose(f);
-
- f = DOS_fopen("cars/fumo.raw","r");
- if (!f) {
- err = DOS_error();
-
- cprintf("Error %d opening fumo.raw...\n", err);
- myfilebuf_length = 0;
- return;
- }
-
- myfilebuf_length = DOS_fread(&sprite[17][0],1,CAR_WIDTH*CAR_HEIGHT,f);
-
- err = DOS_error();
-
- cprintf("Read %d bytes from fumo.raw...\n", myfilebuf_length);
-
- if (err) {
- cprintf("Error %d reading fumo.raw...\n", err);
- myfilebuf_length = 0;
- }
-
- DOS_fclose(f);
-
-}
-
Index: rel_1_21/auto/sensor.c
===================================================================
--- rel_1_21/auto/sensor.c (revision 1217)
+++ rel_1_21/auto/sensor.c (nonexistent)
@@ -1,650 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-
-/**
- ------------
- CVS : $Id: sensor.c,v 1.1.1.1 2002-09-02 09:37:42 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:42 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Marco Dallera and Marco Fiocca
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * AUTO
- *
- * Another Unuseful Track simulatOr
- *
- * Authors: Marco Dallera
- * Marco Fiocca
- *
- */
-
-/* ------------ */
-/* Camera car */
-/* ------------ */
-
-#include "include/auto.h"
-#include "include/const.h"
-#include "include/utils.h"
-#include <drivers/glib.h>
-
-#define RADIUS 1
-#define TOLL_FACTOR 4.0
-#define MIN_DIFF 3
-#define ROAD_COLOR 27
-#define OFFROAD_COLOR 0
-#define DEBUG_COLOR GREEN
-#define OUT_OF_TRACK 230
-#define STRIP_DEFAULT TEL_WIDTH+1
-
-extern sem_t grx_mutex;
-extern car_params cars[MAX_CAR_NUMBER];
-
-void scanline(point_f *buffer, float x1, float y1, float x2, float y2, int factor);
-void get_camera_car(BYTE *buffer, car_status status);
-int find_track(BYTE *image, road_info *info);
-int find_opps(BYTE *image, road_info *info);
-void find_collision(BYTE *image, road_info *info, car_status status);
-
-/* ----------------------------------------------------------------- */
-
-TASK sensor(int index) {
- car_status actual_car_status; // the actual car state
- road_info actual_road_info; // the actual road informations
- BYTE image[TEL_WIDTH*TEL_HEIGHT]; // buffer contenente la visione della telecamera ruotata
-
- point sq1, sq2;
- point im1, im2;
-
- CAB road_status_cab = cars[index].road_status_cab;
- CAB car_status_cab = cars[index].car_status_cab;
-
- // Draws display squares
- sq1.x = TRACK_X1 + TRACK_WIDTH + TEL_HEIGHT;
- sq1.y = TEL_HEIGHT*index + 1 + index;
- sq2.x = sq1.x + TEL_WIDTH + 1;
- sq2.y = sq1.y + TEL_HEIGHT + 1;
-
- // Sets viewer coords
- im1.x = sq1.x + 1;
- im1.y = sq1.y + 1;
- im2.x = im1.x + TEL_WIDTH - 1;
- im2.y = im1.y + TEL_HEIGHT - 1;
-
- // Inizializza il cab della strada
- actual_road_info.left_border = TEL_WIDTH/2;
- actual_road_info.right_border = TEL_WIDTH/2;
- actual_road_info.distance = TEL_HEIGHT;
- actual_road_info.curve = 0.0;
- actual_road_info.opps_number = 0;
- actual_road_info.flag = ROAD_OK;
- actual_road_info.collision = NO_COLL;
- set_road_info(actual_road_info, road_status_cab);
-
- task_endcycle();
-
- while(1) {
- /* reads car informations */
- actual_car_status = get_car_status(car_status_cab);
-
- /* implementazione riconoscimento strada (sti cazzi!!!) */
- get_camera_car(image, actual_car_status);
- find_track(image, &actual_road_info);
- find_opps(image, &actual_road_info);
- find_collision(image, &actual_road_info, actual_car_status);
-
- sem_wait(&grx_mutex);
- grx_rect(sq1.x, sq1.y, sq2.x, sq2.y, cars[index].color);
- grx_putimage(im1.x, im1.y, im2.x, im2.y, image);
- sem_post(&grx_mutex);
-
- /* sends informations to control task */
- set_road_info(actual_road_info, road_status_cab);
- task_endcycle();
- }
-
-}
-
-/* ----------------------------------------------------------------- */
-
-void find_collision(BYTE *image, road_info *info, car_status status)
-{
- point_f lt,rt,lb,rb,ct;
- /* the lines used to scan the quadrilate */
- point_f height_line[CAR_HEIGHT];
- int i;
- BYTE pix;
-
- info->collision = NO_COLL;
-
- ct.x = status.pos.x + (float)(CAR_HEIGHT/2 + 1) * cos(degree_to_rad(status.orient));
- ct.y = status.pos.y - (float)(CAR_WIDTH/2 + 1) * sin(degree_to_rad(status.orient));
-
- lb.x = ct.x - (float)(CAR_WIDTH/2.0) * cos(degree_to_rad(90-status.orient));
- rb.x = ct.x + (float)(CAR_WIDTH/2.0) * cos(degree_to_rad(90-status.orient));
- lt.x = lb.x - (float)(CAR_HEIGHT) * cos(degree_to_rad(status.orient));
- rt.x = rb.x - (float)(CAR_HEIGHT) * cos(degree_to_rad(status.orient));
-
- lb.y = ct.y - (float)(CAR_WIDTH/2.0) * sin(degree_to_rad(90-status.orient));
- rb.y = ct.y + (float)(CAR_WIDTH/2.0) * sin(degree_to_rad(90-status.orient));
- lt.y = lb.y + (float)(CAR_HEIGHT) * sin(degree_to_rad(status.orient));
- rt.y = rb.y + (float)(CAR_HEIGHT) * sin(degree_to_rad(status.orient));
-
- sem_wait(&grx_mutex);
- scanline(height_line,rb.x,rb.y,rt.x,rt.y,CAR_HEIGHT);
- for (i=0; i < CAR_HEIGHT; i++) {
- pix = grx_getpixel(round(height_line[i].x),round(height_line[i].y));
- if (pix != OFFROAD_COLOR && pix != ROAD_COLOR)
- info->collision = COLLISION_RIGHT;
- }
- scanline(height_line,lb.x,lb.y,lt.x,lt.y,CAR_HEIGHT);
- for (i=0; i < CAR_HEIGHT; i++) {
- pix = grx_getpixel(round(height_line[i].x),round(height_line[i].y));
- if (pix != OFFROAD_COLOR && pix != ROAD_COLOR)
- info->collision = COLLISION_LEFT;
- }
- sem_post(&grx_mutex);
-
-}
-
-/* ----------------------------------------------------------------- */
-
-/* Puts in a buffer the image viewed from the camera according to the car status */
-void get_camera_car(BYTE *buffer, car_status status) {
- /*
- * lt ------ rt
- * | |
- * | |
- * lb --ct-- rb
- */
- point_f lt,rt,lb,rb,ct;
- /* the lines used to scan the quadrilate */
- point_f width_line[TEL_WIDTH];
- point_f height_line[TEL_HEIGHT];
- int i,j;
- int tmpx,tmpy,tx,ty;
- float x,y;
- BYTE *row;
-
- ct.x = status.pos.x + (float)(CAR_WIDTH/2 + 1) * cos(degree_to_rad(status.orient));
- ct.y = status.pos.y - (float)(CAR_WIDTH/2 + 1) * sin(degree_to_rad(status.orient));
-
- /* for now the visual starts from the center of the car */
- lb.x = ct.x - (float)(TEL_WIDTH/2.0) * cos(degree_to_rad(90-status.orient));
- rb.x = ct.x + (float)(TEL_WIDTH/2.0) * cos(degree_to_rad(90-status.orient));
- lt.x = lb.x + (float)(TEL_HEIGHT) * cos(degree_to_rad(status.orient));
- rt.x = rb.x + (float)(TEL_HEIGHT) * cos(degree_to_rad(status.orient));
-
- lb.y = ct.y - (float)(TEL_WIDTH/2.0) * sin(degree_to_rad(90-status.orient));
- rb.y = ct.y + (float)(TEL_WIDTH/2.0) * sin(degree_to_rad(90-status.orient));
- lt.y = lb.y - (float)(TEL_HEIGHT) * sin(degree_to_rad(status.orient));
- rt.y = rb.y - (float)(TEL_HEIGHT) * sin(degree_to_rad(status.orient));
-
- /* scan only 2 sense thanks to parallelism */
- /* ^ <-(height)
- * ! lt
- * ! |
- * ! |
- * ! lb ------ rb )
- * 0 -------------> <-(width
- */
- /* the width_line coordinates are relative, so in the for cycle
- they are summarized to absolute height_line values */
- scanline(width_line,0,0,rb.x - lb.x,rb.y - lb.y,TEL_WIDTH);
- scanline(height_line,lb.x,lb.y,lt.x,lt.y,TEL_HEIGHT);
-
- /* First fill row TEL_HEIGHT-1 of image and so on until row 0 */
- sem_wait(&grx_mutex);
- for (i=0; i < TEL_HEIGHT; i++) {
- x = height_line[i].x;
- y = height_line[i].y;
- row = &buffer[TEL_WIDTH * (TEL_HEIGHT-1-i)];
- for (j=0; j < TEL_WIDTH; j++) {
- tmpx = round(x + width_line[j].x);
- tmpy = round(y + width_line[j].y);
-
- // Test rispetto ai bordi
- if (tmpx >= 0 && tmpx < SCREEN_WIDTH && tmpy >= 0 && tmpy < SCREEN_HEIGHT) {
- tx = tmpx - TRACK_X1-1;
- ty = tmpy - TRACK_Y1-1;
- if (tx >= 0 && tx < TRACK_WIDTH && ty >= 0 && ty < TRACK_HEIGHT)
- row[j] = grx_getpixel(tmpx,tmpy);
- else
- row[j] = OUT_OF_TRACK;
- } else {
- row[j] = OUT_OF_TRACK;
- }
- }
- }
- sem_post(&grx_mutex);
-}
-
-/* ----------------------------------------------------------------- */
-
-void scanline(point_f *buffer, float x1, float y1, float x2, float y2, int factor) {
- int i;
- float x,y;
- float xstep,ystep;
-
- xstep = (x2 - x1) / factor;
- ystep = (y2 - y1) / factor;
-
- // Start scan at <x1, y1>
- x = x1;
- y = y1;
-
- for (i = 0; i < factor; i++) {
- buffer[i].x = x;
- buffer[i].y = y;
- x += xstep;
- y += ystep;
- }
-}
-
-/* ----------------------------------------------------------------- */
-
-/*
- * Approssima la curva quando non è più possibile farlo con la scansione
- * orizzontale
- * - image
- * - index l'indice da cui cominciare la ricerca della curva
- * - distance la distanza dalla curva
- */
-float approx_curve(BYTE *image, int index, int distance, int d_center, road_strip *strips) {
- BYTE *p,tmp;
- int i,j,k,ctrl=0;
- point ms_center,ct;
-
- // Decide se la curva e' verso sinistra o verso destra
- p = &image[(TEL_HEIGHT - index - 1) * TEL_WIDTH];
-
- ms_center.x = strips[index-1].left;
- for (i = 0; i < min(3,strips[index-1].left); i++) {
- // La curva è a destra
- tmp = *(p + round(ms_center.x) - i);
- if (tmp != ROAD_COLOR) {
- ms_center.x = strips[index-1].right;
- break;
- }
- }
-
- p += round(ms_center.x);
- // Scandisce la colonna fino alla fine della strada
- for (i = index; i < TEL_HEIGHT; i++, p -= TEL_WIDTH) {
- if (*p != ROAD_COLOR) break;
- }
-
- // Imposta il nuovo max_scost empirico
- ms_center.y = (i-1 + index) / 2;
-
- // i-1 è l'indice dell'ultima riga bianca
- p = &image[(TEL_HEIGHT - (i-1) - 1) * TEL_WIDTH + round(ms_center.x)];
- // scandisce da destra a sinistra
- if (round(ms_center.x) > 0) {
- for (j = 0; j < (round(ms_center.x) - strips[index-1].left); j++, p--) {
- if (*p != ROAD_COLOR) break;
- // scandisce dall'alto in basso finchè non trova nero
- for (k = i-1; k > index; k--) {
- tmp = *(p + (i-1-k)*TEL_WIDTH);
- if (tmp != ROAD_COLOR) {
- ms_center.y = (k + index) / 2;
- ctrl = 1;
- break;
- }
- }
- if (ctrl) break;
- }
- ct.x = ms_center.x - j/2;
- ct.y = ms_center.y;
- } else {
- // scandisce da sinistra a destra
- for (j = 0; j < (strips[index-1].right - round(ms_center.x)); j++, p++) {
- if (*p != ROAD_COLOR) break;
- // scandisce dall'alto in basso finchè non trova nero
- for (k = i-1; k > index; k--) {
- tmp = *(p + (i-1-k)*TEL_WIDTH);
- if (tmp != ROAD_COLOR) {
- ms_center.y = (k + index) / 2;
- ctrl = 1;
- break;
- }
- }
- if (ctrl) break;
- }
- ct.x = ms_center.x + j/2;
- ct.y = ms_center.y;
- }
-
- return rad_to_degree(atan2((double)(ct.y - distance),(double)(ct.x - d_center)));
-}
-
-/* ----------------------------------------------------------------- */
-
-int find_distance(road_strip *strips, int max_scost, int rett_tol) {
- int i, distance;
- int center_car = TEL_WIDTH/2;
-
- // La distanza non puo' essere maggiore del max_scost
- distance = max_scost;
-
- for (i=1; i < max_scost; i++) {
- // Calcola la distanza dalla curva
- if (abs(strips[i].center - center_car) > rett_tol) {
- distance = i;
- break;
- }
- }
- return distance;
-}
-
-/* ----------------------------------------------------------------- */
-
-/* Scandisce la linea row e inserisce nella strip index le informazioni.
- * Ritorna 1 se trova entrambi i bordi, altrimenti 0
- */
-int scan_strip(BYTE *row, int index, road_strip *strips) {
- // Tiene conto della posizione dei bordi precedenti per trattare
- // meglio il caso di curve molto strette, dove possono esistere
- // 2 bordi destri o sinistri
-
- // Per evitare problemi nei casi in cui siano possibili 2
- // bordi destri o sinistri
- int lfound = 0;
- int rfound = 0;
- int center_car = TEL_WIDTH/2;
- int i;
-
- // Parte dal secondo pixel e finisce al penultimo
- for(i=1; i < (TEL_WIDTH-1); i++) {
- // Se trova la strada controlla se si tratta di bordo
- // destro o sinistro
- if (row[i] == ROAD_COLOR) {
- // bordo sinistro
- if (row[i - 1] != ROAD_COLOR) {
- // Se ho già trovato questo tipo di bordo cerco
- // quello + plausibile ...
- if (lfound) {
- // Test sulla striscia precedente
- if (index > 0) {
- if (abs(i - strips[index-1].left) <
- abs(strips[index].left - strips[index-1].left))
- strips[index].left = i;
- } else {
- // Test sul centro della macchina
- if (abs(i - center_car) < abs(strips[0].left - center_car))
- strips[index].left = i;
- }
- lfound++;
- } else {
- // ... altrimenti lo inizializzo
- strips[index].left = i;
- lfound = 1;
- }
- // bordo destro
- } else if ((row[i + 1] != ROAD_COLOR) && lfound) {
- // Se ho già trovato questo tipo di bordo cerco
- // quello + plausibile ...
- if (rfound) {
- // Test sulla striscia precedente
- if (index > 0) {
- if (abs(i - strips[index-1].right) <
- abs(strips[index].right - strips[index-1].right))
- strips[index].right = i;
- } else {
- // Test sul centro della macchina
- if (abs(i - center_car) < abs(strips[0].right - center_car))
- strips[index].right = i;
- }
- rfound++;
- } else {
- // ... altrimenti lo inizializzo
- strips[index].right = i;
- rfound = 1;
- }
- }
- }
- }
-
- // Calcola il centro della strada se trova i bordi
- if (lfound && rfound)
- strips[index].center = (strips[index].left + strips[index].right) / 2;
-
- return (lfound && rfound);
-}
-
-/* ----------------------------------------------------------------- */
-
-void where_am_i(BYTE *row, road_strip strip, road_info *info) {
- int i;
- int lfound = 0;
- int rfound = 0;
- int car_center = TEL_WIDTH/2;
-
- for(i=1; i < (TEL_WIDTH-1); i++) {
- // Se trova la strada controlla se si tratta di bordo
- // destro o sinistro
- if (row[i] == ROAD_COLOR) {
- // bordo sinistro
- if (row[i - 1] != ROAD_COLOR) {
- strip.left = i;
- lfound = 1;
- break;
- } else if (row[i + 1] != ROAD_COLOR) {
- strip.right = i;
- rfound = 1;
- break;
- }
- }
- }
-
- if (lfound && rfound) {
- info->flag = ROAD_OK;
- }
- else if (lfound && !rfound) info->flag = LEFT_ONLY;
- else if (!lfound && rfound) info->flag = RIGHT_ONLY;
- else {
- if (row[car_center] == OFFROAD_COLOR) info->flag = NO_ROAD;
- else info->flag = ROAD_OK;
- }
- info->left_border = car_center - strip.left;
- info->right_border = strip.right - car_center;
-}
-
-/* ----------------------------------------------------------------- */
-
-/* Analizza l'immagine vista dalla telecamera inserendo le informazioni
- * necessarie in info, ovvero la distanza dai bordi destro e sinistro,
- * la distanza dalla prossima curva e il suo angolo di curvatura.
- * Per il momento ritorna -1 se non riesce a trovare entrambi i bordi della
- * strada; in futuro gestiremo anche questa situazione.
- */
-int find_track(BYTE *image, road_info *info) {
- // vettore contenente le informazioni su ogni striscia
- road_strip strips[TEL_HEIGHT];
- BYTE *row;
- int car_center = TEL_WIDTH/2;
- int max_scost=0;
- int once_scost=0;
- int j, rett_tol=0;
-
- info->flag = ROAD_OK;
-
- strips[0].left = STRIP_DEFAULT;
- strips[0].right = STRIP_DEFAULT;
- /* Tratta in modo personalizzato il primo tratto di strada per
- inizializzare alcune variabili e per capire situazioni particolari */
- row = &image[(TEL_HEIGHT - 1)*TEL_WIDTH];
- // Se trova i bordi ...
- if (scan_strip(row,0,strips)) {
- // ... calcola i bordi della strada e ...
- info->left_border = car_center - strips[0].left;
- info->right_border = strips[0].right - car_center;
- // ... inizializza la tolleranza per il rettilineo.
- rett_tol = (strips[0].right - strips[0].left) / TOLL_FACTOR;
- } else {
- // Se non trova il bordo ...
- // Mi sono perso, cercami la strada
- where_am_i(row,strips[0],info);
- return 1;
- }
-
- /* Ora controlla le altre strisce della strada */
-
- for(j=1; j < TEL_HEIGHT ; j++) {
- row = &image[(TEL_HEIGHT - j - 1)*TEL_WIDTH];
- // Se trova i bordi ...
- if (scan_strip(row, j, strips)) {
- // ... aggiorna l'indice di max scostamento.
- if (abs(strips[j].center - car_center) >
- abs(strips[max_scost].center - car_center)
- && abs(strips[j].center - car_center) > rett_tol) {
-
- max_scost = j;
- once_scost=1; // ha trovato almeno un max scost
- }
- } else {
- // Se max_scost non è mai stato settato, prendo il max
- if (!once_scost) {
- max_scost = j-1;
- once_scost = 1;
- }
-
- // se la distanza e il max_scost sono troppo vicini approssima la curva
- info->distance = find_distance(strips, max_scost, rett_tol);
- if ((max_scost - info->distance) < MIN_DIFF) {
- info->curve = approx_curve(image, j, info->distance,
- strips[info->distance].center,strips) - 90.0;
- return 1;
- }
- break;
- }
- }
-
- // Se max_scost non è mai stato settato, prendo il max
- if (!once_scost) max_scost = TEL_HEIGHT-1;
- max_scost = min(max_scost,TEL_HEIGHT-1);
-
- info->distance = find_distance(strips,max_scost,rett_tol);
-
- // calcola l'angolo di curvatura solo se il conto e' attendibile
- if ((info->distance < (TEL_HEIGHT*0.9)) &&
- ((max_scost - info->distance) >= MIN_DIFF))
- info->curve = rad_to_degree(atan2((double)(max_scost - info->distance),
- (double)(strips[max_scost].center - strips[info->distance].center)));
- else {
- // se i conti sono empirici, si guarda la posizione dei due centri
- if (strips[max_scost].center > strips[info->distance].center)
- info->curve = 88.0;
- else if (strips[max_scost].center < strips[info->distance].center)
- info->curve = 92.0;
- else
- info->curve = 90.0;
- }
- info->curve -= 90.0;
- return 0;
-}
-
-/* ----------------------------------------------------------------- */
-
-int find_opps(BYTE *image, road_info *info)
-{
- int i, j;
- int l_limit, r_limit; // the opposite empiric limits
- BYTE *row;
- int car_center = TEL_WIDTH/2;
- int opps_number = 0;
-
- // by default it needs to scan the entire row
- l_limit = TEL_WIDTH - 1;
- r_limit = 0;
-
- // Scans one row at a time
- for(j=1; j<TEL_HEIGHT; j++) {
- row = &image[(TEL_HEIGHT - j - 1) * TEL_WIDTH];
-
- // if some of the previous row has been identified as a car...
- if (opps_number > 0 &&
- j < (info->opps_list[opps_number - 1].y + CAR_HEIGHT + 1)) {
- // excludes CAR_HEIGHT lines from the bottom if the car
- l_limit = (car_center + info->opps_list[opps_number - 1].x) - CAR_WIDTH;
- r_limit = (car_center + info->opps_list[opps_number - 1].x) + CAR_WIDTH;
- }
- else {
- // it needs to scan the entire row
- l_limit = TEL_WIDTH - 1;
- r_limit = 0;
- }
-
- // Scans the current row
- for (i=0; i<TEL_WIDTH; i++) {
- if( (i < l_limit || i > r_limit) &&
- row[i] != ROAD_COLOR && row[i] != OFFROAD_COLOR &&
- row[i] != DEBUG_COLOR && row[i] != OUT_OF_TRACK) {
- // there is an opponent car!!
- // stores its position
- info->opps_list[opps_number].x = i - car_center; // left -, right +
- info->opps_list[opps_number].y = j;
-
- // increases number of opposites car in the sensor view range
- opps_number++;
- }
- }
- }
-
- info->opps_number = opps_number;
-
- return 0;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: rel_1_21/robots/initfile.c
===================================================================
--- rel_1_21/robots/initfile.c (revision 1217)
+++ rel_1_21/robots/initfile.c (nonexistent)
@@ -1,104 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: initfile.c,v 1.1.1.1 2002-09-02 09:37:43 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:43 $
- ------------
-**/
-
-/*
- * Copyright (C) 2001 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-#include "drivers/keyb.h"
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 2000
-
-void read_cfgfile(int);
-
-int argc;
-char *argv[100];
-
-void read_cfg_file(int argc, char **argv);
-
-int main(int argc, char **argv);
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(0);
- CBS_register_level(0, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- SEM_register_module();
-
- CABS_register_module();
-
- __compute_args__(mb, &argc, argv);
-
- read_cfg_file(argc, argv);
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- keyb_def_ctrlC(kparms, NULL);
- KEYB_init(&kparms);
-
- return (void *)main(argc,argv);
-}
Index: rel_1_21/robots/lab1m.txt
===================================================================
--- rel_1_21/robots/lab1m.txt (revision 1217)
+++ rel_1_21/robots/lab1m.txt (nonexistent)
@@ -1,9 +0,0 @@
-1
-540 380 15 270
-380 300 400 5
-430 060 460 400 0
-350 100 430 130 0
-000 100 300 130 0
-150 200 430 230 0
-120 300 150 400 0
-
Index: rel_1_21/robots/mouse2.c
===================================================================
--- rel_1_21/robots/mouse2.c (revision 1217)
+++ rel_1_21/robots/mouse2.c (nonexistent)
@@ -1,933 +0,0 @@
-/*--------------------------------------------------------------*/
-/* Title: Mouse */
-/* Autor: João Capucho */
-/* Date: 9/12/2000 */
-/* Description: */
-/* Simulation of small automats based on the */
-/* "micro-rato" conteste */
-/*--------------------------------------------------------------*/
-
-/*
- * Copyright (C) 2001 João Capucho
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-// Includes
-#include <ll/i386/x-dos.h>
-#include <kernel/kern.h>
-#include <drivers/glib.h>
-#include <drivers/keyb.h>
-#include <math.h>
-#include <stdlib.h>
-#include <limits.h>
-
-#define sqr(x) (x*x)
-
-// Error Types
-#define OK 0
-#define MEMORY_ERROR -1
-#define ILEGAL_PARAMETER -2
-
-// Types of sensors and motors
-#define NONE 0
-#define OBSTACLE 1
-#define BEACON 2
-#define GROUND 3
-#define STEP 4
-
-// Maze limits
-#define LAB_XMIN 40
-#define LAB_XMAX 600
-#define LAB_YMIN 40
-#define LAB_YMAX 440
-
-#define MOTOR_RIGHT 1
-#define MOTOR_LEFT 0
-
-#define BACKCOLOR 0 // Background color
-#define OUTCOLOR 14 // Color of the outside walls
-#define FINISHCOLOR 7 // Finishin area color
-#define NONBLOCKCOLOR 14 // Non block boxs
-#define BLOCKCOLOR 13 // Block boxs
-
-#define BOX_BLOCK 1 // The box blocks the beacon
-#define BOX_NON_BLOCK 2 // The box doesn´t block the beacon
-
-#define MAX_MOUSES 5 // Maximum of mouses in the Maze
-#define MAX_BOXS 100 // Maximum of boxs in the Maze
-#define MAX_SENSORS 20 // Maximum of sensors in each mouse
-#define SENSOR_MIN_GROUND 0 // Minimum value of a ground sensor
-#define SENSOR_MAX_GROUND 255 // Maximum value of a ground sensor
-#define SENSOR_MIN_OBSTACLE 77 // Minimum value of a obstacle sensor
-#define SENSOR_MAX_OBSTACLE 128 // Maximum value of a obstacle sensor
-#define SENSOR_MIN_BEACON 77 // Minimum value of a beacon sensor
-#define SENSOR_MAX_BEACON 128 // Maximum value of a beacon sensor
-#define BEACON_INTENSITY 400 // Maximun intensity of the beacon
-
-#define MOUSE_PERIOD 20000 // Period
-#define CALC_PERIOD 2000 // Period
-#define REFEREE_PERIOD 1000 // Period of the referee
-#define REDRAW_MOUSE_PERIOD 25000 // Period for redraw mouse
-#define REDRAW_MAZE_PERIOD 100000 // Period for redraw maze
-#define MOUSEGROUP 511
-
-struct SENSOR
-{
- int Type; // Tipe of sensor ( None - Obstacle - Beacon - Ground)
- int Radius; // Distance from de center of the mouse
- int Pos_Angle; // Angle between the sensor and the front of the mouse
- int Dir; // Angle between the direction of the sensores and the front of the mouse
- int Angle; // Half angle of visual field (between (Dir-Angle) and (Dir+Angle))
- int Intensity; // Sensativity of the sensor
- float Value; // Last value readed
-};
-
-struct MOTOR
-{
- int Radius; // Distance from de center of the mouse
- int V; // Current velocity
- float Old_V; // Previews velocity
-};
-
-struct MOUSE
-{
- float X, Y; // Current position of the center
- float Old_X, Old_Y; // Previous position of the center
- int Radius; // Size of the mouse ( every mouse is considered round )
- float Dir; // Points to the front
- float Old_Dir; // Previous front
- int NSensors; // Number of sensors in the mouse
- struct SENSOR Sensors[MAX_SENSORS]; // Pointer to the structer that contains the information of the sensors
- struct MOTOR Motors[2]; // Pointer to the structer that contains the information of the motors
- WORD NColision; // Total of colisions
- WORD PColision; // Auxiliar for colisions
- char Flag; // Initialization flag
-};
-
-
-
-struct BOX // Structer that represents the obstacles
-{ //in this case all the obstacles are boxs
- int Type; // Type of the obstatcle
- int X1, Y1, X2, Y2; // position of the box
-};
-
-struct SBEACON // Beacon information
-{
- int Intensity; // Intensity of the beacon
- int X, Y; // position of the beacon
-};
-
-struct MAZE
-{
- int X1, Y1, X2, Y2; // limites of the maze
- int NBoxs; // Number of objstacles in the maze
- struct BOX Boxs[MAX_BOXS]; // Information about all thr obstacles
- struct SBEACON Beacon; // Beacon data
- int Radius; // Size of the finishing area
-};
-
-int Seno[360+90]; // Sine table
-int Tang[180]; // Tangente table
-int NMouses=0;
-struct MOUSE Mouse[MAX_MOUSES]; // Global variable that represents all the mouses
-struct MAZE Maze; // Global variable that represents the maze
-
-// Init_Maze - Initialize the Maze
-// Beacon_X - Coordinate X of the beacon
-// Beacon_Y - Coordinate Y of the beacon
-// Intensity - Intensity of the beacon
-// NBoxs - Number of boxs in the maze
-// Return: OK - Sucess
-
-int Init_Maze(int Beacon_X, int Beacon_Y, int Intensity, int NBoxs)
-{
- int i;
- Maze.X1=LAB_XMIN;
- Maze.Y1=LAB_YMIN;
- Maze.X2=LAB_XMAX;
- Maze.Y2=LAB_YMAX;
- Maze.Beacon.X=Beacon_X+LAB_XMIN;
- Maze.Beacon.Y=Beacon_Y+LAB_YMIN;
- if (Intensity<BEACON_INTENSITY)
- Maze.Beacon.Intensity=Intensity;
- else
- Maze.Beacon.Intensity=BEACON_INTENSITY;
- if (NBoxs<MAX_BOXS)
- Maze.NBoxs=NBoxs;
- else
- Maze.NBoxs=MAX_BOXS;
- Maze.Radius=50;
- for(i=0; i < Maze.NBoxs; i++)
- Maze.Boxs[i].Type=NONE;
- return OK;
-}
-
-// Init_Box - Initialize data of the NBox obstacle
-// NBox - Identifier of the obstacle
-// X1 - Coordinate X
-// Y1 - Coordinate Y
-// X2 - Coordinate X
-// Y2 - Coordinate Y
-// Type - Type of the obstacle
-// Return: OK - Sucess
-
-int Init_Box(int NBox, int X1, int Y1, int X2, int Y2, int Type)
-{
- Maze.Boxs[NBox].Type=Type;
- if (X1<X2)
- {
- Maze.Boxs[NBox].X1=X1+LAB_XMIN;
- Maze.Boxs[NBox].X2=X2+LAB_XMIN;
- }
- else
- {
- Maze.Boxs[NBox].X1=X2+LAB_XMIN;
- Maze.Boxs[NBox].X2=X1+LAB_XMIN;
- }
- if (Y1<Y2)
- {
- Maze.Boxs[NBox].Y1=Y1+LAB_YMIN;
- Maze.Boxs[NBox].Y2=Y2+LAB_YMIN;
- }
- else
- {
- Maze.Boxs[NBox].Y1=Y2+LAB_YMIN;
- Maze.Boxs[NBox].Y2=Y1+LAB_YMIN;
- }
- return OK;
-}
-
-// Draw_Maze - Draws the outline of the maze and the obstacles
-// Return: OK - Sucess
-int Draw_Maze(void)
-{
- int i;
- grx_rect( Maze.X1, Maze.Y1, Maze.X2, Maze.Y2, OUTCOLOR);
- grx_rect( Maze.X1-1, Maze.Y1+1, Maze.X2+1, Maze.Y2+1, OUTCOLOR);
- grx_rect( Maze.X1-2, Maze.Y1+2, Maze.X2+2, Maze.Y2+2, OUTCOLOR);
- grx_circle(Maze.Beacon.X, Maze.Beacon.Y, Maze.Radius, FINISHCOLOR);
- grx_disc(Maze.Beacon.X, Maze.Beacon.Y, 10, 7);
- for (i=0; i<Maze.NBoxs; i++)
- {
- if (Maze.Boxs[i].Type==BOX_NON_BLOCK)
- grx_box(Maze.Boxs[i].X1, Maze.Boxs[i].Y1,
- Maze.Boxs[i].X2, Maze.Boxs[i].Y2, NONBLOCKCOLOR);
- if (Maze.Boxs[i].Type==BOX_BLOCK)
- grx_box(Maze.Boxs[i].X1, Maze.Boxs[i].Y1,
- Maze.Boxs[i].X2, Maze.Boxs[i].Y2, BLOCKCOLOR);
- }
- return OK;
-}
-
-int Init_Motor(int NMouse, int Motor, int Radius)
-{
- if ((NMouse<0) || (NMouse>=MAX_MOUSES))
- return ILEGAL_PARAMETER;
- if ((Motor<0) || (Motor>=2))
- return ILEGAL_PARAMETER;
- Mouse[NMouse].Motors[Motor].Radius=Radius;
- Mouse[NMouse].Motors[Motor].V=0;
- Mouse[NMouse].Motors[Motor].Old_V=0.0;
- return OK;
-}
-
-// Init_Mouse - inicialize the parameters of each mouse
-// NMouse - Identifier of the mouse
-// X - Coordinate X of the center
-// Y - Coordinate Y of the center
-// Radius - Radius of the mouse (size)
-// Dir - Angle of direction in witch i will start
-// NSensors - Number of sensors in the mouse (all types)
-//
-// Return: OK - Sucess
-// ILEGAL_PARAMETER - If NMouse negative of greater than maximum number of mouses
-// Note: All the types of sensors and motors are initialize to NONE
-
-int Init_Mouse(int NMouse, int X, int Y, int Radius, int Dir, int NSensors)
-{
- int i;
- if ((NMouse<0) || (NMouse>=MAX_MOUSES))
- return ILEGAL_PARAMETER;
- if ((NSensors<0) || (NSensors>MAX_SENSORS))
- return ILEGAL_PARAMETER;
- Mouse[NMouse].X=(float)X+LAB_XMIN;
- Mouse[NMouse].Y=(float)Y+LAB_YMIN;
- Mouse[NMouse].Radius=Radius;
- Mouse[NMouse].Dir=Dir;
- Mouse[NMouse].Old_Dir=Mouse[NMouse].Dir;
- Mouse[NMouse].NSensors=NSensors;
- Mouse[NMouse].Old_X=Mouse[NMouse].X;
- Mouse[NMouse].Old_Y=Mouse[NMouse].Y;
- Mouse[NMouse].NColision=0;
- Mouse[NMouse].PColision=0;
- for(i=0; i < Mouse[NMouse].NSensors; i++)
- Mouse[NMouse].Sensors[i].Type=NONE;
-
- Init_Motor(NMouse, MOTOR_LEFT, 10);
- Init_Motor(NMouse, MOTOR_RIGHT, -10);
-
- return OK;
-}
-
-// Init_Sensor - Initializes the sensor information
-// NMouse - Identifier of the mouse
-// Sensor - Identifier of the sensor to be used
-// Type - Type of sensor ( Ground, obstacle or beacon sensor )
-// Radius and Pos_Angle - Polar coordinates to determen the sensor position
-// Dir - Diretion of the sensor ( angle between the front and the sensor )
-// Angle - Half of the visual range
-// Intensity - Maximun distance of detect
-int Init_Sensor(int NMouse, int Sensor, int Type, int Radius,
- int Pos_Angle, int Dir, int Angle, int Intensity)
-{
- if ((NMouse<0) || (NMouse>=MAX_MOUSES))
- return ILEGAL_PARAMETER;
- if ((Sensor<0) || (Sensor>=Mouse[NMouse].NSensors))
- return ILEGAL_PARAMETER;
- Mouse[NMouse].Sensors[Sensor].Type=Type;
- Mouse[NMouse].Sensors[Sensor].Radius=Radius;
- Mouse[NMouse].Sensors[Sensor].Pos_Angle=Pos_Angle;
- Mouse[NMouse].Sensors[Sensor].Dir=Dir;
- Mouse[NMouse].Sensors[Sensor].Angle=Angle;
- Mouse[NMouse].Sensors[Sensor].Intensity=Intensity;
- if (Type == GROUND)
- Mouse[NMouse].Sensors[Sensor].Value=(float)SENSOR_MIN_GROUND;
- if (Type == OBSTACLE)
- Mouse[NMouse].Sensors[Sensor].Value=(float)SENSOR_MIN_OBSTACLE;
- if (Type == BEACON)
- Mouse[NMouse].Sensors[Sensor].Value=(float)SENSOR_MIN_BEACON;
- return OK;
-}
-
-int Set_Motor_Vel(int NMouse, int NMotor, int Vel)
-{
- if ((NMouse<0) || (NMouse>=MAX_MOUSES))
- return ILEGAL_PARAMETER;
- if ((NMotor<0) || (NMotor>2))
- return ILEGAL_PARAMETER;
- Mouse[NMouse].Motors[NMotor].V=Vel;
- return OK;
-}
-
-int Read_Sensor(int NMouse, int NSensor)
-{
- int X, Y, Dir, cr, sr, AuxX, AuxY;
- int Count, AuxCount, AngCount, AuxAngCount, RetColor, Intensity;
- float Auxf;
-
- /* Inicial verifications */
- if ((NMouse<0) || (NMouse>=MAX_MOUSES))
- return ILEGAL_PARAMETER;
- if ((NSensor<0) || (NSensor>Mouse[NMouse].NSensors))
- return ILEGAL_PARAMETER;
-
- /* If Sensor Not define exit */
- if ( Mouse[NMouse].Sensors[NSensor].Type == NONE )
- return OK;
-
- /* Calculate de position of the sensor and is direction */
- Dir=(int)Mouse[NMouse].Old_Dir+Mouse[NMouse].Sensors[NSensor].Dir;
- if (Dir >= 360)
- Dir -= 360;
- if (Dir < 0)
- Dir += 360;
- X= Mouse[NMouse].Old_X*65536.0+((Mouse[NMouse].Sensors[NSensor].Radius*Seno[Dir+90]));
- Y= Mouse[NMouse].Old_Y*65536.0+((Mouse[NMouse].Sensors[NSensor].Radius*Seno[Dir]));
-
- /* if the Sensor type is OBSTACLE */
- if ( Mouse[NMouse].Sensors[NSensor].Type == OBSTACLE )
- {
- Intensity=Mouse[NMouse].Sensors[NSensor].Intensity;
- AuxCount=Intensity;
- /* Scan all the visual field */
- for (AngCount=(-Mouse[NMouse].Sensors[NSensor].Angle);
- AngCount<=Mouse[NMouse].Sensors[NSensor].Angle;
- AngCount++)
- {
- AuxAngCount=Dir+AngCount;
- if (AuxAngCount >= 360)
- AuxAngCount -= 360;
- if (AuxAngCount < 0)
- AuxAngCount += 360;
- sr=Seno[AuxAngCount];
- cr=Seno[AuxAngCount+90];
- Count=Mouse[NMouse].Radius-Mouse[NMouse].Sensors[NSensor].Radius+2;
- AuxX = X+cr*Count;
- AuxY = Y+sr*Count;
- for (; Count<=AuxCount; Count++)
- {
- AuxX += cr;
- AuxY += sr;
- RetColor = grx_getpixel(AuxX >> 16, AuxY >> 16);
- if ((RetColor != BACKCOLOR)&&(RetColor != FINISHCOLOR))
- AuxCount=Count;
- }
- }
- Count=Mouse[NMouse].Sensors[NSensor].Intensity;
- Count*=Count;
- AuxCount*=AuxCount;
- Count = SENSOR_MAX_OBSTACLE-((SENSOR_MAX_OBSTACLE-SENSOR_MIN_OBSTACLE)
- *AuxCount)/Count;
- Mouse[NMouse].Sensors[NSensor].Value=
- (0.5*Mouse[NMouse].Sensors[NSensor].Value+0.5*(float)Count);
- }
- if ( Mouse[NMouse].Sensors[NSensor].Type == GROUND )
- {
- Mouse[NMouse].Sensors[NSensor].Value=(float)SENSOR_MIN_GROUND;
- AuxX=abs((X>>16)-Maze.Beacon.X);
- AuxY=abs((Y>>16)-Maze.Beacon.Y);
- if ((AuxX>50) || (AuxY>50))
- return OK;
- if ((AuxX*AuxX+AuxY*AuxY)<Maze.Radius*Maze.Radius)
- Mouse[NMouse].Sensors[NSensor].Value=(float)SENSOR_MAX_GROUND;
- }
-
- if ( Mouse[NMouse].Sensors[NSensor].Type == BEACON )
- {
- AuxX=(X>>16)-Maze.Beacon.X;
- AuxY=(Y>>16)-Maze.Beacon.Y;
- AngCount=0;
- if (AuxX!=0)
- {
- AuxAngCount=(AuxY<<16)/AuxX;
- if (AuxAngCount<0)
- AngCount=90;
- for (Count=AngCount;Count<AngCount+90;Count++)
- {
- if ((Tang[Count]<=AuxAngCount) && (Tang[Count+1]>AuxAngCount))
- break;
- }
- }
- else
- Count=90;
- if (AuxY<0)
- Count+=180;
- AuxAngCount=abs(180-abs(Dir-Count));
- Count=SENSOR_MIN_BEACON;
- if (AuxAngCount<Mouse[NMouse].Sensors[NSensor].Angle)
- {
- Count=AuxX*AuxX+AuxY*AuxY;
- AuxCount=(int)((float)Maze.Beacon.Intensity*(1.0+(0.4*(float)AuxAngCount)/(float)Mouse[NMouse].Sensors[NSensor].Angle));
- AuxCount*=AuxCount;
- if (Count<AuxCount)
- Count = SENSOR_MAX_OBSTACLE-((SENSOR_MAX_OBSTACLE-SENSOR_MIN_OBSTACLE)*Count)/AuxCount;
- else
- Count=SENSOR_MIN_BEACON;
- }
- Auxf=0.5*((float)Count);
- Auxf+=0.5*((float)Mouse[NMouse].Sensors[NSensor].Value);
- Mouse[NMouse].Sensors[NSensor].Value=Auxf;
- }
- return OK;
-}
-
-int GetSensor(int NMouse, int NSensor)
-{
- if ((NMouse<0) || (NMouse>=MAX_MOUSES))
- return ILEGAL_PARAMETER;
- if ((NSensor<0) || (NSensor>Mouse[NMouse].NSensors))
- return ILEGAL_PARAMETER;
- return (int)Mouse[NMouse].Sensors[NSensor].Value;
-}
-
-int Draw_Mouse(int NMouse, int Flag)
-{
- int Color;
- if (!Flag)
- Color=BACKCOLOR;
- else
- {
- Mouse[NMouse].Old_X=Mouse[NMouse].X;
- Mouse[NMouse].Old_Y=Mouse[NMouse].Y;
- Mouse[NMouse].Old_Dir=Mouse[NMouse].Dir;
- Color=2;
- }
- grx_circle(Mouse[NMouse].Old_X, Mouse[NMouse].Old_Y, Mouse[NMouse].Radius, Color);
- grx_line(Mouse[NMouse].Old_X, Mouse[NMouse].Old_Y,
- Mouse[NMouse].Old_X+((Mouse[NMouse].Radius*Seno[(int)Mouse[NMouse].Old_Dir+90]) >> 16),
- Mouse[NMouse].Old_Y+((Mouse[NMouse].Radius*Seno[(int)Mouse[NMouse].Old_Dir]) >> 16), Color);
- return OK;
-}
-
-TASK Redraw_Mouse_Task(int NMouse)
-{
- char str[40];
- TIME dwTicks;
- while(1)
- {
- dwTicks=sys_gettime(NULL);
- Draw_Mouse(NMouse, FALSE);
- Draw_Mouse(NMouse, TRUE);
- sprintf(str,"Colision: %4d", (int)Mouse[NMouse].NColision);
- grx_text(str, NMouse*150, 21, 7, 0);
- sprintf(str,"Motor: %4d Sensor 0: %4d Sensor 1: %4d Sensor 2: %4d Sensor 3: %4d",
- (int)Mouse[NMouse].Motors[0].Old_V+(int)Mouse[NMouse].Motors[1].Old_V,
- (int)Mouse[NMouse].Sensors[0].Value, (int)Mouse[NMouse].Sensors[1].Value,
- (int)Mouse[NMouse].Sensors[2].Value, (int)Mouse[NMouse].Sensors[3].Value);
- if (NMouse==0)
- grx_text(str, 1, 1, 7, 0);
- sprintf(str,"Sensor 4: %4d Sensor 5: %4d Ticks: %4d",
- (int)Mouse[NMouse].Sensors[4].Value, (int)Mouse[NMouse].Sensors[5].Value,
- (int)(sys_gettime(NULL)-dwTicks)/1000);
- if (NMouse==0)
- grx_text(str, 1, 11, 7, 0);
- task_endcycle();
- }
-}
-
-TASK Redraw_Maze_Task(void)
-{
- while(1)
- {
- Draw_Maze();
- task_endcycle();
- }
-}
-
-TASK Referee(void)
-{
- int Counter, Box_Min_X, Box_Max_X ,Box_Min_Y, Box_Max_Y;
- int deltaX, deltaY, Radius;
- int Colision;
- int NMouse;
-
- while(1)
- {
- for(NMouse=0;NMouse<NMouses;NMouse++)
- {
- Colision=0;
- Radius=Mouse[NMouse].Radius;
- if(Mouse[NMouse].Y<(Maze.Y1+Radius))
- Colision++;
- if(Mouse[NMouse].Y>(Maze.Y2-Radius))
- Colision++;
- if(Mouse[NMouse].X<(Maze.X1+Radius))
- Colision++;
- if(Mouse[NMouse].X>(Maze.X2-Radius))
- Colision++;
- for(Counter=0; Counter<Maze.NBoxs; Counter++)
- {
- Box_Min_X=Maze.Boxs[Counter].X1-1;
- Box_Max_X=Maze.Boxs[Counter].X2+1;
- Box_Min_Y=Maze.Boxs[Counter].Y1-1;
- Box_Max_Y=Maze.Boxs[Counter].Y2+1;
- Radius=Mouse[NMouse].Radius;
- if(Mouse[NMouse].Y<(Box_Min_Y-Radius))
- continue;
- if(Mouse[NMouse].Y>(Box_Max_Y+Radius))
- continue;
- if(Mouse[NMouse].X<(Box_Min_X-Radius))
- continue;
- if(Mouse[NMouse].X>(Box_Max_X+Radius))
- continue;
- if((Mouse[NMouse].X>=Box_Min_X) && (Mouse[NMouse].X<=Box_Max_X))
- if((Mouse[NMouse].Y>=(Box_Min_Y-Radius))
- && (Mouse[NMouse].Y<=(Box_Max_Y+Radius)))
- Colision++;
- if((Mouse[NMouse].Y>=Box_Min_Y) && (Mouse[NMouse].Y<=Box_Max_Y))
- if((Mouse[NMouse].X>=(Box_Min_X-Radius))
- && (Mouse[NMouse].X<=(Box_Max_X+Radius)))
- Colision++;
- Radius=sqr(Radius);
- deltaX=sqr(Mouse[NMouse].X-Box_Min_X);
- deltaY=sqr(Mouse[NMouse].Y-Box_Min_Y);
- if(deltaX+deltaY<=Radius)
- Colision++;
- deltaY=sqr(Mouse[NMouse].Y-Box_Max_Y);
- if(deltaX+deltaY<=Radius)
- Colision++;
- deltaX=sqr(Mouse[NMouse].X-Box_Max_X);
- deltaY=sqr(Mouse[NMouse].Y-Box_Min_Y);
- if(deltaX+deltaY<=Radius)
- Colision++;
- deltaY=sqr(Mouse[NMouse].Y-Box_Max_Y);
- if(deltaX+deltaY<=Radius)
- Colision++;
- }
- if (Mouse[NMouse].PColision && !Colision)
- Mouse[NMouse].NColision++;
-
- Mouse[NMouse].PColision=Colision;
- }
- task_endcycle();
- }
- return (void *)0;
-}
-
-TASK Calculate_Position(int NMouse)
-{
- float w, v, dt;
- int b;
- while(1)
- {
- b=(Mouse[NMouse].Motors[MOTOR_LEFT].Radius-
- Mouse[NMouse].Motors[MOTOR_RIGHT].Radius);
- if (b<0)
- b=-b;
- w=(Mouse[NMouse].Motors[MOTOR_LEFT].Old_V-
- Mouse[NMouse].Motors[MOTOR_RIGHT].Old_V);
- w/=(float)b;
- v=(Mouse[NMouse].Motors[MOTOR_LEFT].Old_V+
- Mouse[NMouse].Motors[MOTOR_RIGHT].Old_V);
- v/=2.0;
- dt=CALC_PERIOD/1000000.0;
- Mouse[NMouse].Dir += (180.0*w/PI)*dt;
- if (Mouse[NMouse].Dir >= 360)
- Mouse[NMouse].Dir -= 360;
- if (Mouse[NMouse].Dir < 0)
- Mouse[NMouse].Dir += 360;
- v *= dt/65536.0;
- b=(float)Seno[(int)Mouse[NMouse].Dir+90];
- Mouse[NMouse].X += v*b;
- b=(float)Seno[(int)Mouse[NMouse].Dir];
- Mouse[NMouse].Y += v*b;
- Mouse[NMouse].Motors[0].Old_V=
- (0.8187*Mouse[NMouse].Motors[0].Old_V+
- 0.1813*(float)Mouse[NMouse].Motors[0].V);
- Mouse[NMouse].Motors[1].Old_V=
- (0.8187*Mouse[NMouse].Motors[1].Old_V+
- 0.1813*(float)Mouse[NMouse].Motors[1].V);
- task_endcycle();
- }
-}
-
-#define SENSOR_LEFT 0
-#define SENSOR_FRONT 1
-#define SENSOR_RIGTH 2
-#define SENSOR_GROUND 3
-#define SENSOR_B_LEFT 4
-#define SENSOR_B_RIGHT 5
-#define MAX_SPEED 50
-#define DIST_DIR GetSensor(NMouse, SENSOR_RIGTH)
-#define DIST_ESQ GetSensor(NMouse, SENSOR_LEFT)
-#define DIST_FRENTE GetSensor(NMouse, SENSOR_FRONT)
-#define FAROL_ESQ GetSensor(NMouse, SENSOR_B_LEFT)
-#define FAROL_DIR GetSensor(NMouse, SENSOR_B_RIGHT)
-#define FAROL_LIM_INF SENSOR_MIN_BEACON+5
-
-#define DIST0 88 //Distancia minima optima
-#define DIST1 DIST0 + 5 // 60%
-#define DIST2 DIST1 + 10 // PARADO
-#define DIST3 DIST2 + 10 // TRAS
-
-#define DISTMAX 120
-#define NENHUM 0
-#define ESQUERDA 1
-#define DIREITA 2
-#define contorno ContornoArr[NMouse]
-
-TASK MouseTask(int NMouse)
-{
- int i;
- //char str[100];
- unsigned char flag;
- static unsigned char ContornoArr[MAX_MOUSES];
- signed char modulo;
-
- Init_Sensor(NMouse, SENSOR_LEFT, OBSTACLE, 14, -45, -45, 25, 15); // Left
- Init_Sensor(NMouse, SENSOR_FRONT, OBSTACLE, 14, 0, 0, 25, 15); // Center
- Init_Sensor(NMouse, SENSOR_RIGTH, OBSTACLE, 14, 45, 45, 25, 15); // Rigth
- Init_Sensor(NMouse, SENSOR_GROUND, GROUND, 10, 180, 180, 0, 20); // Ground
- Init_Sensor(NMouse, SENSOR_B_LEFT, BEACON, 4, -45, -25, 30, 0); // Left
- Init_Sensor(NMouse, SENSOR_B_RIGHT, BEACON, 4, 45, 25, 30, 0); // Rigth
- contorno = NENHUM;
- Mouse[NMouse].Flag=1;
-
- while(1)
- {
- for(i=0; i<8; i++)
- Read_Sensor(NMouse, i);
- Set_Motor_Vel(NMouse, MOTOR_RIGHT, MAX_SPEED);
- Set_Motor_Vel(NMouse, MOTOR_LEFT, MAX_SPEED);
-
- flag = ((DIST_DIR>DIST3) && contorno==ESQUERDA) ||
- ((DIST_ESQ>DIST3) && contorno==DIREITA);
-
- if ( (DIST_FRENTE>DISTMAX) || flag) {
- Set_Motor_Vel(NMouse, MOTOR_RIGHT, MAX_SPEED/2);
- Set_Motor_Vel(NMouse, MOTOR_LEFT, MAX_SPEED/2);
- if (contorno == ESQUERDA)
- Set_Motor_Vel(NMouse, MOTOR_RIGHT, -MAX_SPEED/2);
- else
- Set_Motor_Vel(NMouse, MOTOR_LEFT, -MAX_SPEED/2);
- }
- else {
-
- // ---------------- Contorno da Esquerda ---------------
- if (contorno!=DIREITA){
- if (DIST_ESQ>DIST1) { // Sensor da esquerda
- contorno = ESQUERDA;
- if (DIST_ESQ>DIST3) {
- Set_Motor_Vel(NMouse, MOTOR_RIGHT, -MAX_SPEED/2);
- Set_Motor_Vel(NMouse, MOTOR_LEFT, MAX_SPEED/2);
- }
- else
- if (DIST_ESQ>DIST2)
- Set_Motor_Vel(NMouse, MOTOR_RIGHT, 10);
- else
- Set_Motor_Vel(NMouse, MOTOR_RIGHT, MAX_SPEED*3/4);
- }
- else
- if (contorno== ESQUERDA) {
- if(DIST_ESQ<DIST0)
- Set_Motor_Vel(NMouse, MOTOR_LEFT, MAX_SPEED*3/10);
- }
- }
-
- // ---------------- Contorno da Direita ---------------
- if (contorno!=ESQUERDA){
- if (DIST_DIR>DIST1) { // Sensor da direita
- contorno = DIREITA;
- if (DIST_DIR>DIST3) {
- Set_Motor_Vel(NMouse, MOTOR_RIGHT, MAX_SPEED/2);
- Set_Motor_Vel(NMouse, MOTOR_LEFT, -MAX_SPEED/2);
- }
- else
- if (DIST_DIR>DIST2)
- Set_Motor_Vel(NMouse, MOTOR_LEFT, 10);
- else
- Set_Motor_Vel(NMouse, MOTOR_LEFT, MAX_SPEED*3/4);
- }
- else
- if (contorno== DIREITA) {
- if (DIST_DIR<DIST0)
- Set_Motor_Vel(NMouse, MOTOR_RIGHT, MAX_SPEED*3/10);
- }
- }
-
- // --------------- Desempancar contornos com o farol ------------
-
- if ((contorno == ESQUERDA && FAROL_DIR > FAROL_ESQ && FAROL_DIR > FAROL_LIM_INF) ||
- (contorno == DIREITA && FAROL_ESQ > FAROL_DIR && FAROL_ESQ > FAROL_LIM_INF) )
- contorno = NENHUM;
-
-
-
- if (contorno == NENHUM)
- {
- modulo = FAROL_DIR - FAROL_ESQ;
- if (modulo < 0 )
- modulo = - modulo;
-
- // Se nao estiver na direçao certa, ajustar
- if (modulo > 10) {
- if (FAROL_DIR > FAROL_ESQ)
- Set_Motor_Vel(NMouse, MOTOR_RIGHT, 0);
- else
- Set_Motor_Vel(NMouse, MOTOR_LEFT, 0);
- }
- else //velocidade controlada
- if (modulo > 2) {
- if (FAROL_DIR > FAROL_ESQ)
- Set_Motor_Vel(NMouse, MOTOR_RIGHT, MAX_SPEED*6/10);
- else
- Set_Motor_Vel(NMouse, MOTOR_LEFT, MAX_SPEED*6/10);
- }
- }
- }
- if (GetSensor(NMouse, SENSOR_GROUND)==SENSOR_MAX_GROUND)
- {
- Set_Motor_Vel(NMouse, MOTOR_RIGHT, 0);
- Set_Motor_Vel(NMouse, MOTOR_LEFT, 0);
- }
-
- task_endcycle();
- }
- return (void *)0;
-}
-
-void my_end(void *arg)
-{
- grx_close();
-}
-
-/* --------------------------------- Main program -----------------------------*/
-
-int main(int argc, char *argv[])
-{
- int i;
- char c;
- int pid;
-
- HARD_TASK_MODEL mp;
- SOFT_TASK_MODEL ms;
-
- // char StrAux[15];
-
- for (i=0; i<NMouses; i++)
- Mouse[i].Flag=0;
- for (i=0; i<(360+90); i++) // Inicializar a tabela de senos
- Seno[i]=(int)(65536.0*sin((float)i/180.0*PI));
-
- for (i=0; i<180; i++) // Inicializar a tabela de tangente
- if (i!=90)
- Tang[i]=(int)(((float)Seno[i]/(float)Seno[i+90])*65536.0);
- else
- Tang[i]=INT_MAX;
-
- // Definir fun‡Æo de saida
- sys_atrunlevel(my_end, (void *)NULL, RUNLEVEL_BEFORE_EXIT);
-
- hard_task_default_model(mp);
- hard_task_def_usemath(mp);
- hard_task_def_group(mp, MOUSEGROUP);
- hard_task_def_wcet(mp, 1); // wcet ignored by the configuration file!
-
- soft_task_default_model(ms);
- soft_task_def_group(ms, MOUSEGROUP);
- soft_task_def_met(ms, 1000);
-
- for (i=0;i<NMouses;i++)
- {
- hard_task_def_arg(mp, (void *)i);
- soft_task_def_arg(ms, (void *)i);
-
- hard_task_def_mit(mp, MOUSE_PERIOD);
- pid = task_create("Mouse", MouseTask, &mp, NULL);
- if (pid == NIL)
- {
- perror("Creating Mouse:");
- sys_end();
- }
-
- hard_task_def_mit(mp, CALC_PERIOD);
- pid = task_create("Calc", Calculate_Position, &mp, NULL);
- if (pid == NIL)
- {
- perror("Creating Calc:");
- sys_end();
- }
-
- soft_task_def_period(ms, REDRAW_MOUSE_PERIOD);
- pid = task_create("Redraw_Mouse", Redraw_Mouse_Task, &ms, NULL);
- if (pid == NIL)
- {
- perror("Creating Redraw_Moude:");
- sys_end();
- }
- }
-
- hard_task_def_mit(mp, REFEREE_PERIOD);
- pid = task_create("Referee1", Referee, &mp, NULL);
-
- hard_task_def_mit(mp, REDRAW_MAZE_PERIOD);
- pid = task_create("Redraw_Maze", Redraw_Maze_Task, &mp, NULL);
-
- grx_open(640,480,8);
- group_activate(MOUSEGROUP);
- do
- {
- c = keyb_getch(BLOCK);
- } while (c != ESC);
-
- task_nopreempt();
- sys_end();
- return 0;
-}
-
-/* the buffer b is scannedc to search for numbers
- at the first non-number the function stops */
-void geti(char *b, int *pos, int *res)
-{
- // skip first chars
- while (!isdigit(b[*pos]))
- (*pos)++;
-
-
- // read the numbers
- *res = 0;
- do {
- *res = (*res * 10) + b[*pos] - '0';
- (*pos)++;
- } while (isdigit(b[*pos]));
-}
-
-void read_cfg_file(int argc, char **argv)
-{
- int i, err, Temp1, Temp2, Temp3, Temp4, Temp5;
- DOS_FILE *fp;
- char myfilebuf[1000];
- int myfilebuf_length;
-
- int pos = 0;
-
- if (argc==2) {
- fp = DOS_fopen(argv[1],"r");
-
- if (fp) {
- /* read up to 1000 chars */
- myfilebuf_length = DOS_fread(&myfilebuf,1,1000,fp);
-
- /* check for errors */
- err = DOS_error();
-
- cprintf("Read %d bytes...\n", myfilebuf_length);
-
- if (err) {
- cprintf("Error %d reading file...Using default values\n", err);
- }
- else
- {
- geti(myfilebuf, &pos, &NMouses); // Number of Mouses
- for (i=0;i<NMouses;i++) {
- geti(myfilebuf, &pos, &Temp1); // Mouse X coordinate
- geti(myfilebuf, &pos, &Temp2); // Mouse Y coordinate
- geti(myfilebuf, &pos, &Temp3); // Mouse radius
- geti(myfilebuf, &pos, &Temp4); // Mouse orientation
- Init_Mouse(i, Temp1, Temp2, Temp3, Temp4, 6);
- }
- geti(myfilebuf, &pos, &Temp1); // Beacon X coordinate
- geti(myfilebuf, &pos, &Temp2); // Beacon Y coordinate
- geti(myfilebuf, &pos, &Temp3); // Beacon intensity
- geti(myfilebuf, &pos, &i); // Number of boxs
- Init_Maze(Temp1, Temp2, Temp3, i);
- for(; i>0; i--) {
- geti(myfilebuf, &pos, &Temp1); // Box X1 Coordinate
- geti(myfilebuf, &pos, &Temp2); // Box Y1 Coordinate
- geti(myfilebuf, &pos, &Temp3); // Box X2 Coordinate
- geti(myfilebuf, &pos, &Temp4); // Box Y2 Coordinate
- geti(myfilebuf, &pos, &Temp5); // Type of Box
- if (Temp5)
- Init_Box(i-1, Temp1, Temp2, Temp3, Temp4, BOX_BLOCK);
- else
- Init_Box(i-1, Temp1, Temp2, Temp3, Temp4, BOX_NON_BLOCK);
- }
- DOS_fclose(fp);
- return;
- }
- }
- else {
- /* error!! */
- err = DOS_error();
- /* note that if you call DOS_error() here, it return 0!!! */
- cprintf("Error %d opening myfile.txt...Using default values\n", err);
- }
-
- // Default value if no file is passed
- NMouses=2;
- Init_Maze(500, 350, 400, 1);
- Init_Box(0, 200, 200, 300, 250, BOX_NON_BLOCK);
- Init_Mouse(0, 100, 100, 15, 45, 6);
- Init_Mouse(1, 100, 150, 15, 90, 6);
- }
- else {
- cprintf("Wrong number of arguments...\n");
- l1_exit(0);
- }
-}
Index: rel_1_21/robots/lab.txt
===================================================================
--- rel_1_21/robots/lab.txt (revision 1217)
+++ rel_1_21/robots/lab.txt (nonexistent)
@@ -1,10 +0,0 @@
-2
-530 380 15 270
-480 380 15 270
-380 300 400 5
-430 060 460 400 0
-350 100 430 130 0
-000 100 300 130 0
-150 200 430 230 0
-120 300 150 400 0
-
Index: rel_1_21/robots/readme
===================================================================
--- rel_1_21/robots/readme (revision 1217)
+++ rel_1_21/robots/readme (nonexistent)
@@ -1,9 +0,0 @@
-Robots demo
------------
-
-This demo has been developed in the University of Alveiro, Portugal.
-
-See the included PDF files for more informations.
-
-Paolo
-pj@sssup.it
Index: rel_1_21/robots/makefile
===================================================================
--- rel_1_21/robots/makefile (revision 1217)
+++ rel_1_21/robots/makefile (nonexistent)
@@ -1,16 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS = mouse2
-
-include $(BASE)/config/example.mk
-
-mouse2:
- make -f $(SUBMAKE) APP=mouse2 INIT= OTHEROBJS="initfile.o" OTHERINCL= SHARKOPT="__OLDCHAR__ __GRX__"
-
Index: rel_1_21/robots/lab3.txt
===================================================================
--- rel_1_21/robots/lab3.txt (revision 1217)
+++ rel_1_21/robots/lab3.txt (nonexistent)
@@ -1,11 +0,0 @@
-3
-540 380 15 270
-510 380 15 270
-480 380 15 270
-380 300 400 5
-430 060 460 400 0
-350 100 430 130 0
-000 100 300 130 0
-150 200 430 230 0
-120 300 150 400 0
-
Index: rel_1_21/tftptest/makefile
===================================================================
--- rel_1_21/tftptest/makefile (revision 1217)
+++ rel_1_21/tftptest/makefile (nonexistent)
@@ -1,16 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS = tftptest
-
-include $(BASE)/config/example.mk
-
-tftptest:
- make -f $(SUBMAKE) APP=tftptest INIT= OTHEROBJS="initfile.o" OTHERINCL= SHARKOPT="__OLDCHAR__ __TFTP__"
-
Index: rel_1_21/tftptest/tftptest.c
===================================================================
--- rel_1_21/tftptest/tftptest.c (revision 1217)
+++ rel_1_21/tftptest/tftptest.c (nonexistent)
@@ -1,224 +0,0 @@
-#include <string.h>
-#include <kernel/func.h>
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-#include <drivers/udpip.h>
-#include "tftp.h"
-#include "endian.h"
-
-#include "modules/sem.h"
-
-#include <kernel/kern.h>
-#include <drivers/pci.h>
-#include <ll/i386/hw-instr.h>
-
-
-#define LOCAL_HOST_IP "192.168.0.134"
-#define REMOTE_HOST_IP "192.168.0.133"
-
-sem_t m1, m2;
-int handle, handle2;
-
-int prog = 0;
-
-/* This function is called when the user presses CTRL-C (stops the systems) */
-
-void esci(KEY_EVT *k)
-{
- cprintf("Exit from the program...\n");
- cprintf("Ctrl-C pressed!\n");
- sys_abort(500);
-}
-
-void augprog(KEY_EVT *k)
-{
- prog = 1;
-}
-
-void keyb_start(void) {
- KEY_EVT k;
-
- k.flag = CNTL_BIT;
- k.scan = KEY_C;
- k.ascii = 'C';
- keyb_hook(k, esci);
- k.flag = CNTR_BIT;
- k.scan = KEY_C;
- k.ascii = 'c';
- keyb_hook(k, esci);
-
- k.flag = CNTL_BIT;
- k.scan = KEY_A;
- k.ascii = 'A';
- keyb_hook(k, augprog);
- k.flag = CNTR_BIT;
- k.scan = KEY_A;
- k.ascii = 'a';
- keyb_hook(k, augprog);
-}
-
-TASK test_upload(void *arg) {
- int i;
- char msg[200];
- int bytes;
-
- i = 0;
- while (1) {
-
-// cprintf("uploader 1\n");
-
- sprintf(msg, "tftptest says: i = %5d\n", i);
- tftp_put(handle, msg, strlen(msg));
-
-// cprintf("uploader 2\n");
-
- bytes = tftp_usedbuffer(handle);
- /*!*/sprintf(msg, "buffer %d ", bytes);
- /*!*/puts_xy(BASE_X, 18, WHITE, msg);
-
-// cprintf("uploader 3\n");
- i++;
-
- task_endcycle();
- }
- return(0);
-}
-
-TASK test_upload2(void *arg) {
- int i;
- char msg[200];
- int bytes;
-
- i = 0;
- while (1) {
-
- sprintf(msg, "tftptest says: i = %5d\n", i);
- tftp_put(handle2, msg, strlen(msg));
-
- bytes = tftp_usedbuffer(handle2);
- /*!*/sprintf(msg, "buffer2 %d ", bytes);
- /*!*/puts_xy(BASE_X, 38, WHITE, msg);
- i++;
-
- task_endcycle();
- }
- return(0);
-}
-
-void wait() {
- char ch;
- do {
- ch = keyb_getch(NON_BLOCK);
- } while(prog == 0);
- prog = 0;
-}
-
-int main(void)
-{
- int err;
- HARD_TASK_MODEL hard_m;
- PID p1, p2;
-
- keyb_start();
- cprintf("main: Keyboard handler started\n");
-
- tftp_init();
- cprintf("main: Tftp library initialized\n");
-
- err = tftp_net_start(LOCAL_HOST_IP, REMOTE_HOST_IP, 1);
- cprintf("netval = %d\n", err);
- if (err == 1) {
- cprintf("Net Init from %s to %s\n", LOCAL_HOST_IP, REMOTE_HOST_IP);
- } else {
- cprintf("Net Init Failed...\n");
- sys_end();
- return(err);
- }
-
- sem_init(&m1, 0, 1);
-
-
- if ((handle = tftp_open("test.txt")) == -1) {
- cprintf("No slots available. Program aborted...\n");
- sys_end();
- return(1);
- }
-
- cprintf("Ctrl-A to proceed *** Ctrl-C to stop\n");
- wait();
- clear();
-
- cprintf("Handle = %d\n", handle);
-
- if ((err = tftp_upload(handle, 4096, &m1)) != 0) {
- cprintf("Error %d calling tftp_upload(). Program aborted...\n", err);
- sys_end();
- return(1);
- }
-
- /* First we set the sender's task properties...*/
- hard_task_default_model(hard_m);
- hard_task_def_wcet(hard_m, 10000);
- hard_task_def_mit(hard_m, 300000);
-
- if ((p1 = task_create("test_upload", test_upload, &hard_m, NULL)) == NIL) {
- cprintf("Error creating test_upload task. Program aborted...\n");
- sys_end();
- return(1);
- }
- if (task_activate(p1) == -1) {
- cprintf("Error activating test_upload task. Program aborted...\n");
- sys_end();
- return(1);
- }
-
-
- sem_init(&m2, 0, 1);
-
- if ((handle2 = tftp_open("test2.txt")) == -1) {
- cprintf("No second slot available. Program aborted...\n");
- sys_end();
- return(1);
- }
-
-
-
- cprintf("Handle2 = %d\n", handle2);
-
- if ((err = tftp_upload(handle2, 4096, &m2)) != 0) {
- cprintf("Error %d calling tftp_upload(). Program aborted...\n", err);
- sys_end();
- return(1);
- }
-
- /* First we set the sender's task properties...*/
- hard_task_default_model(hard_m);
- hard_task_def_wcet(hard_m, 10000);
- hard_task_def_mit(hard_m, 300000);
-
- if ((p2 = task_create("test_upload2", test_upload2, &hard_m, NULL)) == NIL) {
- cprintf("Error creating test_upload2 task. Program aborted...\n");
- sys_end();
- return(1);
- }
- if (task_activate(p2) == -1) {
- cprintf("Error activating test_upload2 task. Program aborted...\n");
- sys_end();
- return(1);
- }
-
-
- wait();
-
- tftp_close(handle, TFTP_STOP_NOW);
-
-
-// wait();
-
- tftp_close(handle2, TFTP_STOP_NOW);
-
- cprintf("\nProgram terminated correctly.\n");
- sys_end();
-
- return(0);
-}
Index: rel_1_21/tftptest/initfile.c
===================================================================
--- rel_1_21/tftptest/initfile.c (revision 1217)
+++ rel_1_21/tftptest/initfile.c (nonexistent)
@@ -1,114 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: initfile.c,v 1.1 2003-10-02 12:45:43 giacomo Exp $
-
- File: $File$
- Revision: $Revision: 1.1 $
- Last update: $Date: 2003-10-02 12:45:43 $
- ------------
-
- System initialization file
-
- This file contains the 2 functions needed to initialize the system.
-
- These functions register the following levels:
-
- an EDF (Earliest Deadline First) level
- a RR (Round Robin) level
- a CBS (Costant Bandwidth Server) level
- a Dummy level
-
- It can accept these task models:
-
- HARD_TASK_MODEL (wcet+mit) at level 0
- SOFT_TASK_MODEL (met, period) at level 1
- NRT_TASK_MODEL at level 2
-
- This file is similar to the configuration of kernel/init/hartik3.c
-
- TICK is set to 0 (one-shot timer is used)
-*/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-#include "modules/hartport.h"
-#include "modules/sem.h"
-#include "drivers/keyb.h"
-
-/*+ sysyem tick in us +*/
-#define TICK 1000
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- CBS_register_level(CBS_ENABLE_ALL, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- SEM_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- keyb_def_ctrlC(kparms, NULL);
- keyb_def_map(kparms,itaMap);
- KEYB_init(&kparms);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
Index: rel_1_21/fsdemo/xread.h
===================================================================
--- rel_1_21/fsdemo/xread.h (revision 1217)
+++ rel_1_21/fsdemo/xread.h (nonexistent)
@@ -1,46 +0,0 @@
-
-#ifndef XREAD_H_
-#define XREAD_H_
-
-#include <stdio.h>
-
-#define BUFFERMAXSIZE (128*1024l)
-
-struct xbuffer {
- int handle;
- char buffer[BUFFERMAXSIZE+8];
- int readptr;
- int writeptr;
-};
-extern struct xbuffer *table[OPEN_MAX];
-
-void x_init(void);
-
-/* rate in bit/sec */
-/* band in percentuale */
-int x_initbuffer(int group, FILE *f, int rate, int band);
-
-#define XUNUSEDPID 5821
-
-/*
- *
- */
-
-static __inline__ int filledspace(struct xbuffer *ptr)
-{
- int size;
-
- if (ptr->writeptr==ptr->readptr) return 0;
-
- size=ptr->writeptr-ptr->readptr;
- if (size<0) size+=BUFFERMAXSIZE;
-
- return size;
-}
-
-static __inline__ int freespace(struct xbuffer *ptr)
-{
- return BUFFERMAXSIZE-filledspace(ptr);
-}
-
-#endif
Index: rel_1_21/fsdemo/config.h
===================================================================
--- rel_1_21/fsdemo/config.h (revision 1217)
+++ rel_1_21/fsdemo/config.h (nonexistent)
@@ -1,44 +0,0 @@
-
-/*
- *
- */
-
-/* if def: does not use graphics */
-#define NOGRX 1
-#undef NOGRX
-
-/* if def: use a mutex for all graphics operations */
-#define GRXMUTEX 1
-#undef GRXMUTEX
-
-/* if def: use full color (16bits.. sigh) else use 8 bits/pixel grayscale */
-#define FULLCOLOR 1
-#undef FULLCOLOR
-
-/*
- *
- */
-
-/* if def: does not trace events (does not work) */
-#define NOTRACE 1
-//#undef NOTRACE
-
-/*
- *
- */
-
-/* if def: activate task buffering */
-#define ACTIVATE 1
-//#undef ACTIVATE
-
-/*
- *
- */
-
-/* if def: use bd_edf resource for I/O tasks */
-#define EDFSCHED 1
-#undef EDFSCHED
-
-/* if def: use bd_pscan resources for I/O tasks */
-#define PSCANSCHED 1
-#undef PSCANSCHED
Index: rel_1_21/fsdemo/readme
===================================================================
--- rel_1_21/fsdemo/readme (revision 1217)
+++ rel_1_21/fsdemo/readme (nonexistent)
@@ -1,21 +0,0 @@
-S.Ha.R.K. FSDEMO
-
-This demo has been made as a thesis demo by Massimiliano Giorgi
-(massy@gandalf.sssup.it). The following is the translations of some itailan
-notes left my Massy. For any problems, please contact us
-shark-help@gandalf.sssup.it...
-
-bye
-
-Paolo
-
-----------------------------------------------------------------------------
-
-mplay is the demo I used during my thesis presentation.
-
-To use the demo you need a few mpeg files (those listed into mplay.c) into the directory /temp/m/ and some BMP photos into the directory /temp/b/
-
-Note that only BMP 24bpp images are supported. They MUST have a DIB header,
-with a line length mujltiple of 4 pixels!!!
-
-Massy
Index: rel_1_21/fsdemo/gvideo.c
===================================================================
--- rel_1_21/fsdemo/gvideo.c (revision 1217)
+++ rel_1_21/fsdemo/gvideo.c (nonexistent)
@@ -1,292 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- * Copyright (C) 1999 Luca Abeni and Massimiliano Giorgi
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * CVS : $Id: gvideo.c,v 1.1.1.1 2002-09-02 09:37:41 pj Exp $
- *
- * File: $File$
- * Revision: $Revision: 1.1.1.1 $
- * Last update: $Date: 2002-09-02 09:37:41 $
- */
-
-#include "config.h"
-
-#include <kernel/func.h>
-#include <kernel/model.h>
-#include <kernel/const.h>
-
-#include <drivers/glib.h>
-
-#include <stdlib.h>
-
-#include "mpeg/video.h"
-#include "mpeg/util.h"
-#include "mpeg/dither.h"
-#include "mpeg/mpeg.h"
-
-#include "mutex.h"
-#include "gvideo.h"
-#include "gbuffer.h"
-#include "xread.h"
-
-#define STARTGROUP 513
-
-#define VIDEORATE 70
-#define READRATE 30
-
-/*
- * colors
- */
-
-#ifdef FULLCOLOR
-
-#define COLORFG rgb16(255,255,255)
-#define COLORBG rgb16(0,0,0)
-
-#define SP rgb16(0,128,0)
-#define FG rgb16(255,255,255)
-#define BG rgb16(0,0,0)
-
-#else
-
-/* for writing */
-#define COLORFG 255
-#define COLORBG 0
-
-/* for box */
-#define SP 128
-#define FG 255
-#define BG 0
-
-#endif
-
-/* border size (pixels) */
-#define BO 4
-
-/*
- *
- */
-
-#ifdef FULLCOLOR
-/* 16bits format 5:6:5 */
-/* 32bits format 8:8:8:0 */
-void down32to16(WORD *dst, BYTE *src, int size)
-{
- int i;
- return;
- for (i=0;i<size;i+=4,dst++,src+=4)
- /* blue green red */
- *dst=((src[2]&0xf8)>>3)|((src[1]&0xfc)<<3)|((src[0]&0xf8)<<8);
-}
-#endif
-
-/*
- *
- */
-
-void draw_frame(int x, int y, int dx, int dy)
-{
-#ifndef NOGRX
- grxlock();
- grx_box(x-1-BO,y-1-BO,x+dx+BO,y+dy+BO,SP);
- grx_rect(x-1-BO,y-1-BO,x+dx+BO,y+dy+BO,FG);
- grx_box(x,y,x+dx-1,y+dy-1,BG);
- grx_rect(x-1,y-1,x+dx,y+dy,FG);
- grxunlock();
-#endif
-}
-
-struct info {
- int x,y;
- ImageDesc *img;
-};
-
-static TASK play(void *arg)
-{
- struct info *ptr=(struct info*)arg;
- int x1,y1,x2,y2;
- BYTE *pixels; //,*image;
- int moreframes;
-
- pixels=(BYTE*)malloc(ptr->img->Size*sizeof(BYTE));
-#ifdef FULLCOLOR
- image=(BYTE*)malloc(ptr->img->Size/2*sizeof(BYTE));
-#endif
- x1=ptr->x;
- y1=ptr->y;
- x2=x1+ptr->img->Width-1;
- y2=y1+ptr->img->Height-1;
-
- moreframes=1;
- for (;;) {
- while (moreframes) {
- moreframes=GetMPEGFrame(ptr->img,pixels);
-#ifndef NOGRX
-#ifdef FULLCOLOR
- down32to16((WORD*)image,pixels,ptr->img->Size);
- grxlock();
- grx_putimage(x1, y1, x2, y2, pixels);
- grxunlock();
-#else
- grxlock();
- grx_putimage(x1, y1, x2, y2, pixels);
- grxunlock();
-#endif
-#else
- cprintf("%c",'0');
-#endif
- task_endcycle();
- }
- break;
-
- //if (!loop) break;
- //RewindMPEG (mpeg, img);
- //SetMPEGOption (img, MPEG_DITHER, GRAY_DITHER);
- //moreframes = TRUE;
- }
-
- return NULL;
-}
-
-int gvideo_init(char *title, struct gvideoinfo *ptr)
-{
- // static int groupcounter=0;
- struct info *info;
- SOFT_TASK_MODEL model;
- FILE *fin;
- PID pid,pid2;
- ImageDesc *img;
- int res;
- int i;
- int period,wcet;
- int group;
-
- img=(ImageDesc*)malloc(sizeof(ImageDesc));
- if (img==NULL) return -3;
- img->vid_stream=NULL;
- img->Colormap=NULL;
-
- info=(struct info*)malloc(sizeof(struct info));
- if (info==NULL) return -11;
- info->img=img;
- info->x=ptr->x;
- info->y=ptr->y;
-
- fin=fopen(ptr->pathname, "r");
- if (!fin) return -1;
-
- //group=STARTGROUP+groupcounter++;
- group=STARTGROUP;
- pid2=x_initbuffer(group,fin,ptr->bitrate,ptr->band*READRATE);
- if (pid2<0) return -2;
-
-#ifdef ACTIVATE
- gbuffer_init(table[fileno(fin)],group,20+12,450);
-#else
- gbuffer_init(NULL,group,20+12,450);
-#endif
-
- res=OpenMPEG(fin,img);
- if (!res) return -4;
-
-#ifdef FULLCOLOR
- SetMPEGOption(img,MPEG_DITHER,HALF_COLOR_DITHER);
-#else
- SetMPEGOption(img,MPEG_DITHER,GRAY_DITHER);
-#endif
-
- //cprintf("colrmap size=%8i\n",img->ColormapSize);
- //cprintf("picture rate=%8i\n",img->PictureRate);
- //cprintf("bit rate =%8i\n",img->BitRate);
-
-#ifndef FULLCOLOR
- if (group==STARTGROUP) {
- ColormapEntry *cp;
- cp=img->Colormap;
- for (i=0;i<img->ColormapSize;i++) {
-#ifndef NOGRX
- grxlock();
- grx_setcolor (i,img->Colormap[i].red/4,
- img->Colormap[i].green/4,
- img->Colormap[i].blue/4);
- grxunlock();
-#endif
- }
- }
-#endif
-
- draw_frame(info->x,info->y,img->Width,img->Height);
- ptr->w=img->Width;
- ptr->h=img->Height;
-
- {
- char buffer[256];
-
-#ifndef NOGRX
- grxlock();
- grx_text(title,ptr->x,ptr->y-14,COLORFG,COLORBG);
- grxunlock();
- sprintf(buffer,"Average bit rate: %i.%03i Mb/s",
- ptr->bitrate/1024/1024,(ptr->bitrate%(1024*1024))*1000/1024/1000);
- grxlock();
- grx_text(buffer,ptr->x,ptr->y+ptr->h+BO*2+2,COLORFG,COLORBG);
- grxunlock();
- sprintf(buffer,"Frame rate : %02.3f frame/sec",
- (double)ptr->framerate/100.0);
- grxlock();
- grx_text(buffer,ptr->x,ptr->y+ptr->h+BO*2+2+9,COLORFG,COLORBG);
- grxunlock();
-#endif
- }
-
- period=100000000/ptr->framerate;
- wcet=period*ptr->band*VIDEORATE/10000;
-
- soft_task_default_model(model);
- soft_task_def_met(model,wcet);
- soft_task_def_wcet(model,wcet);
- soft_task_def_period(model,period);
- soft_task_def_periodic(model);
- soft_task_def_arg(model,(void*)info);
- soft_task_def_group(model,group);
- soft_task_def_ctrl_jet(model);
-
- pid=task_create("Video",play,&model,NULL);
- if (pid==-1) return -6;
-
- return group;
-}
Index: rel_1_21/fsdemo/gbuffer.c
===================================================================
--- rel_1_21/fsdemo/gbuffer.c (revision 1217)
+++ rel_1_21/fsdemo/gbuffer.c (nonexistent)
@@ -1,129 +0,0 @@
-/*
- *
- *
- */
-
-#include "config.h"
-
-#include <kernel/func.h>
-#include <kernel/model.h>
-#include <kernel/const.h>
-
-#include <drivers/glib.h>
-
-#include <stdlib.h>
-#include <assert.h>
-
-#include "mutex.h"
-#include "xread.h"
-
-#define PERIOD 250000
-#define WCET 1000
-
-#ifdef FULLCOLOR
-
-#define BARCOLOR rgb16(255,0,0)
-#define BARBG rgb16(0,0,0)
-
-#define TEXTCOLOR rgb16(255,255,255)
-#define TEXTBG rgb16(0,0,0)
-
-#else
-
-#define BARCOLOR 128
-#define BARBG 0
-
-#define TEXTCOLOR 255
-#define TEXTBG 0
-
-#endif
-
-//#define XC 700
-//#define YC 400
-#define LEN 100
-#define BORDER 8
-
-extern void draw_frame(int x, int y, int dx, int dy);
-
-struct taskinfo{
- int XC,YC;
- struct xbuffer *ptr;
-};
-
-static TASK monitorbuffer(void *arg)
-{
- struct taskinfo *p=(struct taskinfo *)arg;
- int XC,YC;
- int oy,y;
- struct xbuffer *ptr;
- int sum,old;
-
- ptr=p->ptr;
- XC=p->XC;
- YC=p->YC;
-
- oy=YC+LEN-1;
- for (;;) {
- sum=freespace(ptr);
-#ifndef NOGRX
- y=YC+LEN*sum/BUFFERMAXSIZE-1;
- if (y!=oy) {
- grxlock();
- if (y<oy) grx_box(XC,y,XC+BORDER-1,oy,BARCOLOR);
- else grx_box(XC,oy,XC+BORDER-1,y,BARBG);
- grxunlock();
- oy=y;
- }
-#else
- cprintf("@%i@",sum);
-#endif
- old=sum;
- task_endcycle();
- }
- return 0;
-}
-
-int gbuffer_init(struct xbuffer *ptr, int group, int XC, int YC)
-{
- struct taskinfo *info;
- SOFT_TASK_MODEL model;
- PID pid;
-
-#ifdef ACTIVATE
- info=(struct taskinfo *)malloc(sizeof(struct taskinfo));
- if (info==NULL) sys_abort(912);
- info->XC=XC;
- info->YC=YC;
- info->ptr=ptr;
-
- soft_task_default_model(model);
- soft_task_def_met(model,WCET);
- soft_task_def_wcet(model,WCET);
- soft_task_def_period(model,PERIOD);
- soft_task_def_periodic(model);
- soft_task_def_group(model,group);
- soft_task_def_arg(model,(void*)info);
- /*soft_task_def_group(model,group);*/
-
- pid=task_create("bufferload",monitorbuffer,&model,NULL);
- if (pid==-1) return -6;
-
-#else
- pid=-1;
-#endif
-
-#ifndef NOGRX
- draw_frame(XC,YC,BORDER,LEN);
- grxlock();
- grx_text("Buffer",XC-18,YC+LEN+BORDER*2,TEXTCOLOR,TEXTBG);
- grx_text("100%",XC+BORDER*2+1,YC-4,TEXTCOLOR,TEXTBG);
- grx_text(" 75%",XC+BORDER*2+1,YC+LEN/4-4,TEXTCOLOR,TEXTBG);
- grx_text(" 50%",XC+BORDER*2+1,YC+LEN/4*2-4,TEXTCOLOR,TEXTBG);
- grx_text(" 25%",XC+BORDER*2+1,YC+LEN/4*3-4,TEXTCOLOR,TEXTBG);
- grx_text(" 0%",XC+BORDER*2+1,YC+LEN-4,TEXTCOLOR,TEXTBG);
- grxunlock();
-#endif
-
- return pid;
-}
-
Index: rel_1_21/fsdemo/gvideo.h
===================================================================
--- rel_1_21/fsdemo/gvideo.h (revision 1217)
+++ rel_1_21/fsdemo/gvideo.h (nonexistent)
@@ -1,22 +0,0 @@
-/*
- *
- *
- */
-
-#ifndef __GVIDEO_H
-#define __GVIDEO_H
-
-struct gvideoinfo {
- int x,y;
- int h,w; /* no fill */
-
- char *pathname;
-
- int bitrate; /* bytes/sec */
- int framerate; /* frames/sec */
- int band; /* CPU band in percent */
-};
-
-int gvideo_init(char *title, struct gvideoinfo *info);
-
-#endif
Index: rel_1_21/fsdemo/mplay.c
===================================================================
--- rel_1_21/fsdemo/mplay.c (revision 1217)
+++ rel_1_21/fsdemo/mplay.c (nonexistent)
@@ -1,393 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- * Copyright (C) 1999 Luca Abeni and Massimiliano Giorgi
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * CVS : $Id: mplay.c,v 1.3 2003-05-01 19:44:07 pj Exp $
- *
- * File: $File$
- * Revision: $Revision: 1.3 $
- * Last update: $Date: 2003-05-01 19:44:07 $
- */
-
-#include "config.h"
-
-//#include <ll/sys/types.h>
-
-#include <kernel/func.h>
-#include <kernel/const.h>
-
-#include <trace/trace.h>
-#include <trace/queues.h>
-
-#include <drivers/glib.h>
-#include <drivers/gd.h>
-#include <drivers/keyb.h>
-
-#include <fs/bdevinit.h>
-#include <fs/fsinit.h>
-#include <fs/bdev.h>
-
-#include <sys/types.h>
-#include <sys/mount.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <time.h>
-
-#include "gclock.h"
-#include "gvideo.h"
-#include "gload.h"
-#include "gbuffer.h"
-#include "gphoto.h"
-#include "mutex.h"
-#include "xread.h"
-
-void ctrlc_exit(KEY_EVT *k)
-{
- extern void dump_sem_table(void);
- extern void dump_nop_table(void);
-#ifndef NOGRX
- grx_close();
-#endif
- cprintf("CTRL-C pressed!\n");
- sys_end();
-}
-
-/*
- *
- *
- *
- */
-
-int __register_sub_init_prologue(void)
-{
- // int id;
-#ifndef NOTRACE
- TRC_init_phase1(NULL);
- trc_register_fixed_queue();
- id=trc_create_queue(TRC_FIXED_QUEUE,NULL);
- trc_trace_class(TRC_CLASS_USER);
- trc_assign_class_to_queue(TRC_CLASS_USER,id);
-#endif
- return 0;
-}
-
-int __register_sub_init(void)
-{
-#if defined(EDFSCHED)
- extern void BD_EDF_register_module(void);
- BD_EDF_register_module();
-#elif defined(PSCANSCHED)
- extern void BD_PSCAN_register_module(void);
- BD_PSCAN_register_module();
-#endif
- return 0;
-}
-
-dev_t root_device=-1;
-dev_t temp_device=-1;
-
-int choose_root_callback(dev_t dev,u_int8_t fs)
-{
- if (fs==FS_MSDOS) return dev;
- return -1;
-}
-
-int choose_temp_callback(__dev_t dev,__uint8_t fs)
-{
- static int flag=0;
- if (fs==FS_MSDOS) {
- if (flag) return dev;
- flag=1;
- }
- return -1;
-}
-
-int __bdev_sub_init(void)
-{
- BDEV_PARMS bdev=BASE_BDEV;
-
- bdev_def_showinfo(bdev,FALSE);
- bdev_init(&bdev);
-
- root_device=bdev_scan_devices(choose_root_callback);
- if (root_device<0) {
- sys_shutdown_message("can't find root device to mount on /!!!\n");
- sys_end();
- return -1;
- }
-
- /*
- temp_device=bdev_scan_devices(choose_temp_callback);
- if (temp_device<0) {
- cprintf("can't find a filesystem to mount on /TEMP!!!\n");
- }
- */
-
- return 0;
-}
-
-int __fs_sub_init(void)
-{
- extern int libc_initialize(void);
- FILESYSTEM_PARMS fs=BASE_FILESYSTEM;
- // struct mount_opts opts;
- // int res;
-
- filesystem_def_rootdevice(fs,root_device);
- filesystem_def_fs(fs,FS_MSDOS);
- filesystem_def_showinfo(fs,FALSE);
- filesystem_init(&fs);
-
- /*
- if (temp_device>=0) {
- memset(&opts,0,sizeof(struct mount_opts));
- opts.flags=MOUNT_FLAG_RW;
- res=mount(temp_device,FS_MSDOS,"/TEMP",&opts);
- if (res!=0) {
- cprintf("can't mount XXX on /TEMP (errno: %i)\n",errno);
- } else
- cprintf("mounted /TEMP rw\n");
- }
- */
-
- libc_initialize();
-
-#ifndef NOTRACE
- TRC_init_phase2();
-#endif
-
- return 0;
-}
-
-/*
- *
- *
- *
- */
-
-struct {
- char *filename;
- int bitrate;
- int framerate;
-} mpegs[16]={
- /* 0 */
- {"/temp/m/2jaeger.mpg", 573225, 3000}, /* 3.27 bad*/
- {"/temp/m/alien.mpg", 289000, 2500}, /* 10.12 I */
- {"/temp/m/b0.mpg", 1725251, 3000}, /* 3.33 IBBPBBPBBPBB */
- {"/temp/m/canyon.mpg", 237194, 3000}, /* 58.60 IBBPBB */
- /* 4 */
- {"/temp/m/earth-ci.mpg", 974900, 2500}, /* 28.80 IBBPBB */
- {"/temp/m/flower.mpg", 1147101, 2997}, /* 5.01 bad */
- {"/temp/m/frisco.mpg", 397262, 3000}, /* 1.70 bad */
- {"/temp/m/hulahoop.mpg", 684126, 3000}, /* 1.33 bad */
- /* 8 */
- {"/temp/m/iicm.mpg", 527308, 3000}, /* 26.70 bad */
- {"/temp/m/micky.mpg", 711240, 3000}, /* 0.66 bad */
- {"/temp/m/mobile.mpg", 114622, 2997}, /* 5.01 bad */
- {"/temp/m/redsnigh.mpg", 597776, 2500}, /* 48.40 IBBBBBBBBBPBBBBBBBBB*/
- /* 12 */
- {"/temp/m/son.mpg", 1134335, 2500}, /* 6.92 IBBPBBPBBPBB */
- {"/temp/m/stoelend.mpg", 2248942, 3000}, /* 0.53 IBBPBB */
- {"/temp/m/sukhoi.mpg", 481521, 3000}, /* 25.47 I */
- {"/temp/m/us.mpg", 681599, 3000} /* 24.37 IBBPBB */
-};
-
-#define DEFINDEX 3
-
-char *getfilename(int index)
-{
- return mpegs[index%16].filename;
-}
-
-int getbitrate(int index)
-{
- return mpegs[index%16].bitrate;
-}
-
-int getframerate(int index)
-{
- return mpegs[index%16].framerate;
-}
-
-/*
- *
- *
- *
- */
-
-#ifdef FULLCOLOR
-
-#define TEXTCOLOR rgb16(0,255,0)
-#define TEXTCOLOR2 rgb16(255,255,255)
-#define TEXTBG rgb16(0,0,0)
-
-#else
-
-#define TEXTCOLOR 255
-#define TEXTCOLOR2 255
-#define TEXTBG 0
-
-#endif
-
-#define SCREENX 800
-#define SCREENY 600
-
-#define MAINSLEEP 20000
-
-g_sem_t grxsem;
-
-int main(int argc, char *argv[])
-{
- struct gvideoinfo info;
- KEY_EVT k;
- int index;
- int mode;
- int esc;
- int pid,grp;
- // int i;
- int sx=20;
- PID ph1,ph2,ph3;
-
- g_sem_init(&grxsem,1);
-
- /*
- if (argc<2) {
- cprintf("Usage: %s mpegfileordinal\n",argv[0]);
- sys_abort(301);
- }
- */
-
- /* init the "file reader tasks" module */
- x_init();
-
- /* Init the graph... */
-#ifndef NOGRX
- if (grx_init()==-1) {
- cprintf("No init!!!\n");
- sys_abort(255);
- }
-#ifdef FULLCOLOR
- mode=grx_getmode(SCREENX,SCREENY,16);
-#else
- mode=grx_getmode(SCREENX,SCREENY,8);
-#endif
- if (mode==-1) {
- cprintf("Mode not present!!!\n");
- sys_abort(255);
- }
-#endif
-
- cprintf("[hit enter to continue]\n");
- esc=FALSE;
- while (!esc) {
- keyb_getcode(&k,BLOCK);
- if (k.ascii==13) esc=TRUE;
- }
-
-#ifndef NOGRX
- if (grx_setmode(mode) == -1) {
- cprintf("No SetMode!!!\n");
- sys_abort(255);
- }
-#endif
-
-#ifndef NOGRX
- grx_text("HARTIK 4.0 (Lego)",12*2,22,TEXTCOLOR,TEXTBG);
- grx_text("[Filesystem demo]",12*2,22+10,TEXTCOLOR,TEXTBG);
-
- grx_text("Video : 8bit/pixel",250,450,TEXTCOLOR2,TEXTBG);
- grx_text("Double buffer: YES",250,450+10,TEXTCOLOR2,TEXTBG);
- grx_text("Algorithm : FCFS",250,450+20,TEXTCOLOR2,TEXTBG);
-#endif
-
- pid=gclock_init(32+64+64,540);
- task_activate(pid);
-
- //for (i=0;i<argc-1;i++) {
-
- //index=atoi(argv[i+1]);
- index=4;
-
- info.x=sx+30;
- info.y=80;
- info.pathname=getfilename(index);
- info.bitrate=getbitrate(index);
- info.framerate=getframerate(index);
- info.band=25;
-
- grp=gvideo_init("Video: earth.mpg", &info);
- //if (grp>0) group_activate(grp);
-
- sx+=info.w+15;
- //}
-
- pid=gload_init(1);
- task_activate(pid);
-
- ph1=gphoto_show("Photo: galaxy","/temp/b/ph2a.bmp",500,25);
- ph2=gphoto_show("Photo: canyon","/temp/b/ph3a.bmp",500,225);
- ph3=gphoto_show("Photo: nicole","/temp/b/ph7a.bmp",500,425);
-
- if (grp>0) group_activate(grp);
-
- esc=0;
-
- {
- struct timespec delay;
-
- delay.tv_sec = MAINSLEEP/1000000;
- delay.tv_nsec = (MAINSLEEP%1000000)*1000;
-
- while (!esc) {
- if (keyb_getcode(&k,NON_BLOCK)) {
- if(k.ascii==13) esc=1;
- else if (k.ascii=='a') task_activate(ph1);
- else if (k.ascii=='s') task_activate(ph2);
- else if (k.ascii=='d') task_activate(ph3);
- }
- nanosleep(&delay, NULL);
- }
- }
-
-#ifndef NOGRX
- grx_close();
-#endif
-
- sys_end();
- return 0;
-}
Index: rel_1_21/fsdemo/gbuffer.h
===================================================================
--- rel_1_21/fsdemo/gbuffer.h (revision 1217)
+++ rel_1_21/fsdemo/gbuffer.h (nonexistent)
@@ -1,9 +0,0 @@
-
-#ifndef __GBUFFER_H
-#define __GBUFFER_H
-
-#include "xread.h"
-
-int gbuffer_init(struct xbuffer *ptr, int group, int XC, int YC);
-
-#endif
Index: rel_1_21/fsdemo/gload.c
===================================================================
--- rel_1_21/fsdemo/gload.c (revision 1217)
+++ rel_1_21/fsdemo/gload.c (nonexistent)
@@ -1,113 +0,0 @@
-/*
- *
- *
- */
-
-#include "config.h"
-
-#include <kernel/func.h>
-#include <kernel/model.h>
-#include <kernel/const.h>
-
-#include <drivers/glib.h>
-
-#include <stdlib.h>
-#include <assert.h>
-
-#include "mutex.h"
-#include "gload.h"
-
-#define PERIOD 250000
-#define WCET 1000
-
-#ifdef FULLCOLOR
-
-#define BARCOLOR rgb16(255,0,0)
-#define BARBG rgb16(0,0,0)
-
-#define TEXTCOLOR rgb16(255,255,255)
-#define TEXTBG rgb16(0,0,0)
-
-#else
-
-#define BARCOLOR 128
-#define BARBG 0
-
-#define TEXTCOLOR 255
-#define TEXTBG 0
-
-#endif
-
-#define XC (32+64)
-#define YC 450
-#define LEN 100
-#define BOR 8
-
-extern void draw_frame(int x, int y, int dx, int dy);
-
-/* only for NRT task */
-static TASK monitorload(void *arg)
-{
- int oy,y;
- PID pid=(PID)arg;
- TIME sum,old;
- int res;
-
- res=jet_getstat(pid,NULL,NULL,NULL,&old);
- task_endcycle();
-
- oy=YC+LEN-1;
- for (;;) {
- res=jet_getstat(pid,NULL,NULL,NULL,&sum);
- if (res==-1) break;
-#ifndef NOGRX
- y=YC+LEN*(sum-old)/PERIOD-1;
- if (y!=oy) {
- grxlock();
- if (y<oy) grx_box(XC,y,XC+BOR-1,oy,BARCOLOR);
- else grx_box(XC,oy,XC+BOR-1,y,BARBG);
- grxunlock();
- oy=y;
- }
-#else
- n++;
- if (n%4==0)
- cprintf("#%li,%i#",sum); //(1000-sum*1000/PERIOD);
-#endif
- old=sum;
- task_endcycle();
- }
- return 0;
-}
-
-int gload_init(int taskpid)
-{
- SOFT_TASK_MODEL model;
- PID pid;
-
- soft_task_default_model(model);
- soft_task_def_met(model,WCET);
- soft_task_def_wcet(model,WCET);
- soft_task_def_period(model,PERIOD);
- soft_task_def_periodic(model);
- soft_task_def_arg(model,(void*)taskpid);
- /*soft_task_def_group(model,group);*/
-
- pid=task_create("load",monitorload,&model,NULL);
- if (pid==-1) return -6;
-
-#ifndef NOGRX
- draw_frame(XC,YC,BOR,LEN);
- grxlock();
- grx_text("Load",XC-10,YC+LEN+BOR*2,TEXTCOLOR,TEXTBG);
- grx_text("100%",XC+BOR*2+1,YC-4,TEXTCOLOR,TEXTBG);
- grx_text(" 75%",XC+BOR*2+1,YC+LEN/4-4,TEXTCOLOR,TEXTBG);
- grx_text(" 50%",XC+BOR*2+1,YC+LEN/4*2-4,TEXTCOLOR,TEXTBG);
- grx_text(" 25%",XC+BOR*2+1,YC+LEN/4*3-4,TEXTCOLOR,TEXTBG);
- grx_text(" 0%",XC+BOR*2+1,YC+LEN-4,TEXTCOLOR,TEXTBG);
- grxunlock();
-#endif
-
- return pid;
-}
-
Index: rel_1_21/fsdemo/gphoto.ok
===================================================================
--- rel_1_21/fsdemo/gphoto.ok (revision 1217)
+++ rel_1_21/fsdemo/gphoto.ok (nonexistent)
@@ -1,222 +0,0 @@
-/*
- * Project: HARTIK (HA-rd R-eal TI-me K-ernel)
- *
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
- * Gerardo Lamastra <gerardo@sssup.it>
- *
- * Authors : Luca Abeni <luca@hartik.sssup.it>
- * Massimiliano Giorgi <massy@hartik.sssup.it>
- * (see authors.txt for full list of hartik's authors)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://hartik.sssup.it
- */
-
-/*
- * Copyright (C) 1999 Luca Abeni and Massimiliano Giorgi
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * CVS : $Id: gphoto.ok,v 1.1.1.1 2002-09-02 09:37:41 pj Exp $
- *
- * File: $File$
- * Revision: $Revision: 1.1.1.1 $
- * Last update: $Date: 2002-09-02 09:37:41 $
- */
-
-#include "config.h"
-
-#include <kernel/func.h>
-#include <kernel/model.h>
-#include <kernel/const.h>
-
-#include <drivers/glib.h>
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <fcntl.h>
-
-#include "mutex.h"
-#include "gphoto.h"
-
-#ifdef FULLCOLOR
-
-/* 16bits format 5:6:5 */
-/* 24bits format 8:8:8 */
-static void down24to16(WORD *dst, BYTE *src, int dx, int dy)
-{
- int x,y;
- /* row must be multiple of 4!!! (there are 3 bytes per pixel!)*/
- dst+=dx*(dy+1);
- for (y=0;y<dy;y++) {
- dst-=dx*2;
- for (x=0;x<dx;x++,src+=3,dst++)
- /* blue green red */
- *dst=((src[0]&0xf8)>>3)|((src[1]&0xfc)<<3)|((src[2]&0xf8)<<8);
- }
-}
-
-#define downscaleimage(x,y,z,k) down24to16((WORD*)x,y,z,k)
-
-#else
-
-static void down24to8(BYTE *dst, BYTE *src, int dx, int dy)
-{
- int x,y;
-
- dst+=dx*(dy+1);
- for (y=0;y<dy;y++) {
- dst-=dx*2;
- for (x=0;x<dx;x++,src+=3,dst++)
- *dst=(((int)src[0])*11+((int)src[1])*59+((int)src[2])*30)/100;
- }
-}
-
-#define downscaleimage(x,y,z,k) down24to8(x,y,z,k)
-
-#endif
-
-/*
- *
- */
-
-extern void draw_frame(int x, int y, int dx, int dy);
-
-int gphoto_show(char *pathname, int x, int y)
-{
- struct BITMAPFILEHEADER *bf;
- struct BITMAPINFOHEADER *bi;
- BYTE *src,*dst;
- long l;
- int h,n;
- int dx,dy;
-
- bf=(struct BITMAPFILEHEADER *)malloc(sizeof(struct BITMAPFILEHEADER));
- bi=(struct BITMAPINFOHEADER *)malloc(sizeof(struct BITMAPINFOHEADER));
-
- if (bf==NULL||bi==NULL) return -1;
-
- h=open(pathname,O_RDONLY);
- if (h==-1) {
- free(bf);
- free(bi);
- return -2;
- }
-
- n=read(h,bf,sizeof(struct BITMAPFILEHEADER));
- if (n!=sizeof(struct BITMAPFILEHEADER)) {
- close(h);
- free(bf);
- free(bi);
- return -4;
- }
-
- n=read(h,bi,sizeof(struct BITMAPINFOHEADER));
- if (n!=sizeof(struct BITMAPINFOHEADER)) {
- close(h);
- free(bf);
- free(bi);
- return -4;
- }
-
- //grx_close();
-
- /*
- cprintf("type: %c %c\n",bf->bfType&0xff,bf->bfType>>8);
- cprintf("size: %li\n",bf->bfSize);
- cprintf("tell: %li\n\n",bf->bfOffBits);
-
- cprintf("bitcoutn: %i\n",bi->biBitCount);
- cprintf("compress: %li\n",bi->biCompression);
- cprintf("dx: %li\n",bi->biWidth);
- cprintf("dy: %li\n",bi->biHeight);
- */
-
- //sys_end();
- //return 0;
-
- if (bf->bfType!='B'+256*'M'||
- bi->biBitCount!=24||
- bi->biCompression!=0||
- bi->biWidth%4!=0) {
- close(h);
- free(bf);
- free(bi);
- return -5;
- }
-
- dx=bi->biWidth;
- dy=bi->biHeight;
-
- src=(BYTE*)malloc(dx*dy*3);
- if (src==NULL) {
- close(h);
- free(bf);
- free(bi);
- return -6;
- }
-
- dst=(BYTE*)malloc(dx*dy*2);
- if (dst==NULL) {
- free(src);
- close(h);
- free(bf);
- free(bi);
- return -6;
- }
-
- l=lseek(h,bf->bfOffBits,SEEK_SET);
- if (l!=bf->bfOffBits) {
- free(dst);
- free(src);
- close(h);
- free(bf);
- free(bi);
- return -7;
- }
-
- n=read(h,src,dx*dy*3);
- if (n!=dx*dy*3) {
- free(dst);
- free(src);
- close(h);
- free(bf);
- free(bi);
- return -8;
- }
-
- downscaleimage(dst,src,dx,dy);
-
-#ifndef NOGRX
- draw_frame(x,y,dx,dy);
- grxlock();
- grx_putimage(x, y, x+dx-1, y+dy-1, dst);
- grxunlock();
-#endif
-
- free(dst);
- free(src);
- close(h);
- free(bi);
- free(bf);
-
- return 0;
-}
Index: rel_1_21/fsdemo/oldmakefile
===================================================================
--- rel_1_21/fsdemo/oldmakefile (revision 1217)
+++ rel_1_21/fsdemo/oldmakefile (nonexistent)
@@ -1,41 +0,0 @@
-#
-#
-#
-# TO REMAKE BETTER
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-.PHONY: test all install depend clean cleanall
-
-C_INC+= -I$(BASE)/ports
-LINK_LIB+= -lmpeg
-LINK_DEP+= $(LIB_PATH)/libmpeg.a
-
-#test:: tserv tserv2
-test:: mplay
-
-clean::
- rm -f *.o
- rm -f mplay
-
-OBJS= mplay.o xread.o gclock.o gvideo.o gload.o gbuffer.o gphoto.o
-
-mplay: $(OBJS) $(LIB_PATH)/initfs.o $(LIB_DEP)
- $(LD) $(LINK_OPT) $(LINK_STARTUP) \
- $(OBJS) \
- $(LIB_PATH)/initfs.o \
- --start-group $(LINK_LIB) --end-group \
- -o mplay
-
-depend::
- $(CC) $(C_OPT) -M $(OBJS:.o=.c) > deps
-
-deps:
- $(CC) $(C_OPT) -M $(OBJS:.o=.c) > deps
-
-include deps
Index: rel_1_21/fsdemo/gload.h
===================================================================
--- rel_1_21/fsdemo/gload.h (revision 1217)
+++ rel_1_21/fsdemo/gload.h (nonexistent)
@@ -1,7 +0,0 @@
-
-#ifndef __GLOAD_H
-#define __GLOAD_H
-
-int gload_init(int pid);
-
-#endif
Index: rel_1_21/fsdemo/makefile
===================================================================
--- rel_1_21/fsdemo/makefile (revision 1217)
+++ rel_1_21/fsdemo/makefile (nonexistent)
@@ -1,16 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS= mplay
-
-include $(BASE)/config/example.mk
-
-mplay:
- make -f $(SUBMAKE) APP=mplay INIT= OTHEROBJS="xread.o gclock.o gvideo.o gload.o gbuffer.o gphoto.o initfile.o" OTHERINCL="-I$(BASE)/ports" SHARKOPT="__OLDCHAR__ __GRX__"
-
Index: rel_1_21/fsdemo/gphoto.c
===================================================================
--- rel_1_21/fsdemo/gphoto.c (revision 1217)
+++ rel_1_21/fsdemo/gphoto.c (nonexistent)
@@ -1,302 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- * Copyright (C) 1999 Luca Abeni and Massimiliano Giorgi
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * CVS : $Id: gphoto.c,v 1.1.1.1 2002-09-02 09:37:41 pj Exp $
- *
- * File: $File$
- * Revision: $Revision: 1.1.1.1 $
- * Last update: $Date: 2002-09-02 09:37:41 $
- */
-
-#include "config.h"
-
-#include <kernel/func.h>
-#include <kernel/model.h>
-#include <kernel/const.h>
-
-#include <drivers/glib.h>
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <fcntl.h>
-
-#include "mutex.h"
-#include "gphoto.h"
-
-#ifdef FULLCOLOR
-#define COLORFG rgb16(255,255,255)
-#define COLORBG rgb16(0,0,0)
-#else
-#define COLORFG 255
-#define COLORBG 0
-#endif
-
-#ifdef FULLCOLOR
-
-/* 16bits format 5:6:5 */
-/* 24bits format 8:8:8 */
-static void down24to16(int h ,
- WORD *dst, BYTE *src,
- int xs, int ys, int dx, int dy)
-{
- WORD *pdst;
- BYTE *psrc;
- int x,y;
- int n;
-
- /* row must be multiple of 4!!! (there are 3 bytes per pixel!)*/
-
- for (y=0;y<dy;y++) {
- psrc=src;
- pdst=dst;
-
- n=read(h,src,dx*3);
- if (n!=dx*3) return;
-
- for (x=0;x<dx;x++,psrc+=3,pdst++)
- /* blue green red */
- *pdst=((psrc[0]&0xf8)>>3)|((psrc[1]&0xfc)<<3)|((psrc[2]&0xf8)<<8);
-
-#ifndef NOGRX
- grxlock();
- grx_putimage(xs, ys+dy-y-1, xs+dx-1, ys+dy-y-1, dst);
- grxunlock();
-#endif
-
- }
-
-}
-
-#define downscaleimage(h,x,y,a,b,c,d) down24to16(h,(WORD*)x,y,a,b,c,d)
-
-#else
-
-static void down24to8(int h,
- BYTE *dst, BYTE *src,
- int xs, int ys, int dx, int dy)
-{
- BYTE *pdst;
- BYTE *psrc;
- int x,y;
- int n;
-
- /* row must be multiple of 4!!! (there are 3 bytes per pixel!)*/
-
- for (y=0;y<dy;y++) {
- psrc=src;
- pdst=dst;
-
- n=read(h,src,dx*3);
- if (n!=dx*3) return;
-
- for (x=0;x<dx;x++,psrc+=3,pdst++)
- *pdst=(((int)psrc[0])*11+((int)psrc[1])*59+((int)psrc[2])*30)/100;
-
-#ifndef NOGRX
- grxlock();
- grx_putimage(xs, ys+dy-y-1, xs+dx-1, ys+dy-y-1, dst);
- grxunlock();
-#endif
-
- }
-}
-
-#define downscaleimage(h,x,y,a,b,c,d) down24to8(h,x,y,a,b,c,d)
-
-#endif
-
-/*
- *
- */
-
-struct taskinfo {
- int h;
- BYTE *dst,*src;
- int x,y;
- int dx,dy;
-};
-
-static TASK phototask(void *arg)
-{
- struct taskinfo *p=(struct taskinfo *)arg;
-
- downscaleimage(p->h,p->dst,p->src,p->x,p->y,p->dx,p->dy);
-
- free(p->dst);
- free(p->src);
- close(p->h);
-
- free(arg);
-
- return NULL;
-}
-
-
-/*
- *
- */
-
-extern void draw_frame(int x, int y, int dx, int dy);
-
-int gphoto_show(char *title, char *pathname, int x, int y)
-{
- NRT_TASK_MODEL model;
- struct BITMAPFILEHEADER *bf;
- struct BITMAPINFOHEADER *bi;
- struct taskinfo *info;
- BYTE *src,*dst;
- long l;
- int h,n;
- int dx,dy;
- PID pid;
-
- bf=(struct BITMAPFILEHEADER *)malloc(sizeof(struct BITMAPFILEHEADER));
- bi=(struct BITMAPINFOHEADER *)malloc(sizeof(struct BITMAPINFOHEADER));
-
- if (bf==NULL||bi==NULL) return -11;
-
- h=open(pathname,O_RDONLY);
- if (h==-1) {
- free(bf);
- free(bi);
- return -2;
- }
-
- n=read(h,bf,sizeof(struct BITMAPFILEHEADER));
- if (n!=sizeof(struct BITMAPFILEHEADER)) {
- close(h);
- free(bf);
- free(bi);
- return -4;
- }
-
- n=read(h,bi,sizeof(struct BITMAPINFOHEADER));
- if (n!=sizeof(struct BITMAPINFOHEADER)) {
- close(h);
- free(bf);
- free(bi);
- return -4;
- }
-
- //grx_close();
-
- /*
- cprintf("type: %c %c\n",bf->bfType&0xff,bf->bfType>>8);
- cprintf("size: %li\n",bf->bfSize);
- cprintf("tell: %li\n\n",bf->bfOffBits);
-
- cprintf("bitcoutn: %i\n",bi->biBitCount);
- cprintf("compress: %li\n",bi->biCompression);
- cprintf("dx: %li\n",bi->biWidth);
- cprintf("dy: %li\n",bi->biHeight);
- */
-
- //sys_end();
- //return 0;
-
- if (bf->bfType!='B'+256*'M'||
- bi->biBitCount!=24||
- bi->biCompression!=0||
- bi->biWidth%4!=0) {
- close(h);
- free(bf);
- free(bi);
- return -5;
- }
-
- dx=bi->biWidth;
- dy=bi->biHeight;
-
- src=(BYTE*)malloc(dx*3);
- if (src==NULL) {
- close(h);
- free(bf);
- free(bi);
- return -6;
- }
-
- dst=(BYTE*)malloc(dx*2);
- if (dst==NULL) {
- free(src);
- close(h);
- free(bf);
- free(bi);
- return -6;
- }
-
- l=lseek(h,bf->bfOffBits,SEEK_SET);
- if (l!=bf->bfOffBits) {
- free(dst);
- free(src);
- close(h);
- free(bf);
- free(bi);
- return -7;
- }
-
-#ifndef NOGRX
- draw_frame(x,y,dx,dy);
- grxlock();
- grx_text(title,x,y-14,COLORFG,COLORBG);
- grxunlock();
-#endif
-
- free(bi);
- free(bf);
-
- info=(struct taskinfo *)malloc(sizeof(struct taskinfo));
- if (info==NULL) {
- free(dst);
- free(src);
- close(h);
- return -8;
- }
- info->h=h;
- info->src=src;
- info->dst=dst;
- info->x=x;
- info->y=y;
- info->dx=dx;
- info->dy=dy;
-
- nrt_task_default_model(model);
- nrt_task_def_arg(model,info);
- pid=task_create("Photo",phototask,&model,NULL);
-
- return pid;
-}
Index: rel_1_21/fsdemo/gclock.c
===================================================================
--- rel_1_21/fsdemo/gclock.c (revision 1217)
+++ rel_1_21/fsdemo/gclock.c (nonexistent)
@@ -1,81 +0,0 @@
-
-#include "config.h"
-
-#include <kernel/func.h>
-#include <kernel/const.h>
-#include <kernel/model.h>
-#include <kernel/types.h>
-
-#include <drivers/glib.h>
-
-#include <stdlib.h>
-
-#include "mutex.h"
-#include "gclock.h"
-
-#ifdef FULLCOLOR
-#define COLORFG rgb16(255,255,255)
-#define COLORBG rgb16(0,0,0)
-#else
-#define COLORFG 255
-#define COLORBG 0
-#endif
-
-struct info {
- int x;
- int y;
-};
-
-static TASK grxclock(struct info *ptr)
-{
- char buffer[16];
- int min,sec;
-
- min=sec=0;
- for (;;) {
- sprintf(buffer,"%02i:%02i",min,sec);
-#ifndef NOGRX
- grxlock();
- grx_text(buffer,ptr->x,ptr->y,COLORFG,COLORBG);
- grxunlock();
-#endif
- sec++;
- if (sec==60) {
- sec=0;
- min++;
- if (min==60) min=0;
- }
- task_endcycle();
- }
- return NULL;
-}
-
-PID gclock_init(int x, int y)
-{
- SOFT_TASK_MODEL model;
- struct info *ptr;
-
- ptr=(struct info *)malloc(sizeof(struct info));
- if (ptr==NULL) return -1;
- ptr->x=x+1;
- ptr->y=y+1;
-
-#ifndef NOGRX
- grxlock();
- grx_box(x-1,y-1,x+GCLOCKDX-1,y+GCLOCKDY-1,COLORBG);
- grx_rect(x-1,y-1,x+GCLOCKDX-1,y+GCLOCKDY-1,COLORFG);
- grx_text("00:00",ptr->x,ptr->y,COLORFG,COLORBG);
- grx_text("Clock",ptr->x,ptr->y-12,COLORFG,COLORBG);
- grxunlock();
-#endif
-
- soft_task_default_model(model);
- soft_task_def_met(model,5000);
- soft_task_def_wcet(model,5000);
- soft_task_def_period(model,1000000);
- soft_task_def_periodic(model);
- soft_task_def_arg(model,(void*)ptr);
- //soft_task_def_ctrl_jet(model);
-
- return task_create("grxclock", grxclock, &model, NULL);
-}
Index: rel_1_21/fsdemo/initfile.c
===================================================================
--- rel_1_21/fsdemo/initfile.c (revision 1217)
+++ rel_1_21/fsdemo/initfile.c (nonexistent)
@@ -1,119 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * CVS : $Id: initfile.c,v 1.1.1.1 2002-09-02 09:37:41 pj Exp $
- *
- * File: $File$
- * Revision: $Revision: 1.1.1.1 $
- * Last update: $Date: 2002-09-02 09:37:41 $
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/rr.h"
-#include "modules/cbs.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-#include "modules/pi.h"
-#include "modules/pc.h"
-#include "modules/srp.h"
-#include "modules/npp.h"
-#include "modules/nop.h"
-#include "modules/nopm.h"
-
-#include "drivers/keyb.h"
-
-/*+ sysyem tick in us +*/
-#define TICK 1000
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
- extern int __register_sub_init_prologue(void);
- extern int __register_sub_init(void);
-
- __register_sub_init_prologue();
-
- EDF_register_level(EDF_ENABLE_ALL);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- CBS_register_level(CBS_ENABLE_ALL, 0);
- dummy_register_level();
-
- SEM_register_module();
-
- CABS_register_module();
-
- PI_register_module();
- PC_register_module();
- NPP_register_module();
- SRP_register_module();
- NOP_register_module();
- NOPM_register_module();
-
- __register_sub_init();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
- KEYB_PARMS keyb = BASE_KEYB;
- extern int __bdev_sub_init(void);
- extern int __fs_sub_init(void);
- extern void ctrlc_exit(KEY_EVT *k);
-
- HARTPORT_init();
-
- keyb_def_ctrlC(keyb, ctrlc_exit);
- KEYB_init(&keyb);
-
- __bdev_sub_init();
- __fs_sub_init();
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
Index: rel_1_21/fsdemo/xread.c
===================================================================
--- rel_1_21/fsdemo/xread.c (revision 1217)
+++ rel_1_21/fsdemo/xread.c (nonexistent)
@@ -1,240 +0,0 @@
-/*
- *
- *
- *
- *
- */
-
-#include "config.h"
-
-#include <ll/i386/cons.h>
-
-#include <kernel/func.h>
-#include <kernel/int_sem.h>
-#define seminit(s,v) internal_sem_init(s,v)
-#define semwait(s) internal_sem_wait(s)
-#define semsignal(s) internal_sem_post(s)
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <time.h>
-
-#include <assert.h>
-
-#include "xread.h"
-
-/**/
-
-/*
- */
-
-#ifndef ACTIVATE
-int x_fseek(FILE *file, long where, int from)
-{
- return fseek(file,where,from);
-}
-
-size_t x_fread(void *buffer, size_t size, size_t n, FILE *file)
-{
- return fread(buffer,size,n,file);
-}
-
-void x_init(void)
-{}
-
-int x_initbuffer(int group, FILE *f, int rate, int band)
-{
- return XUNUSEDPID;
-}
-
-#endif
-
-#ifdef ACTIVATE
-int x_fseek(FILE *file, long where, int from)
-{
- return -1;
-}
-
-#define BLOCKSIZE (512*4)
-#define BLOCKSPERBUFFER (BUFFERMAXSIZE/BLOCKSIZE)
-
-/* in millisecondi */
-#define PRELOAD 500
-
-struct xbuffer *table[OPEN_MAX];
-
-int end_counter=0;
-
-static TASK bufferfiller(void *arg)
-{
- struct xbuffer *ptr=(struct xbuffer *)arg;
- int n;
-
- for (;;) {
- if (freespace(ptr)>BLOCKSIZE+8) {
- //assert(ptr->writeptr>=0);
- //assert(ptr->writeptr+BLOCKSIZE<=BUFFERMAXSIZE);
- n=read(ptr->handle,ptr->buffer+ptr->writeptr,BLOCKSIZE);
-#ifdef NOGRX
- cprintf("²");
-#endif
- kern_cli();
- ptr->writeptr+=n;
- /* ipotesi: non si legge mai piu' di BUFFERMAXSIZE */
- if (ptr->writeptr>=BUFFERMAXSIZE) ptr->writeptr-=BUFFERMAXSIZE;
- kern_sti();
- if (n!=BLOCKSIZE) {
- //cprintf("<XXX>");
- break;
- }
- //assert(ptr->writeptr%512==0);
- }
- task_endcycle();
- }
-
- end_counter++;
-
- return NULL;
-}
-
-void x_init(void)
-{
- int i;
- for (i=0;i<OPEN_MAX;i++) table[i]=NULL;
-}
-
-/* rate in bits/sec */
-/* band in percentuale *100 */
-int x_initbuffer(int group, FILE *f, int rate, int band)
-{
-#ifdef EDFSCHED
- BDEDF_RES_MODEL resource;
-#endif
-#ifdef PSCANSCHED
- BDPSCAN_RES_MODEL resource;
-#endif
- SOFT_TASK_MODEL model;
- struct xbuffer *ptr;
- int handle;
- int period,wcet;
- int n,preload;
- PID pid;
-
- handle=fileno(f);
- if (handle>OPEN_MAX||handle<0) return -11;
-
- if (table[handle]!=NULL) return -2;
-
- ptr=table[handle]=(struct xbuffer *)malloc(sizeof(struct xbuffer));
- if (ptr==NULL) return -3;
-
- ptr->handle=handle;
- ptr->writeptr=ptr->readptr=0;
- n=lseek(ptr->handle,0,SEEK_SET);
- if (n!=0) {
- cprintf("can't seek to 0\n");
- return -12;
- }
-
- /* PRELOAD */
- preload=rate*PRELOAD/8/1000;
- if (preload<100*1024) preload=100*1024;
- preload=(preload/BLOCKSIZE+1)*BLOCKSIZE;
- if (preload>BUFFERMAXSIZE-BLOCKSIZE) return -4;
- n=read(ptr->handle,ptr->buffer,preload);
- if (n!=preload) {
- cprintf("preload: request %li bytes (%li returned)\n",
- (long)preload,(long)n);
- return -5;
- }
- ptr->writeptr+=n;
-
- //cprintf("%li bytes preloaded\n",(long)n);
- if (rate==0) sys_abort(997);
- period=1000000l*BLOCKSIZE/rate*8;
- wcet=period*band/10000;
-
- soft_task_default_model(model);
- soft_task_def_met(model,wcet);
- soft_task_def_wcet(model,wcet);
- soft_task_def_period(model,period);
- soft_task_def_periodic(model);
- soft_task_def_arg(model,(void*)ptr);
- soft_task_def_group(model,group);
-
-#if defined(EDFSCHED)
- BDEDF_res_default_model(resource);
- BDEDF_res_def_dl(resource,period);
- pid=task_createn("xfill", bufferfiller,(TASK_MODEL*)&model, &resource, NULL);
-#elif defined(PSCANSCHED)
- BDPSCAN_res_default_model(resource);
- BDPSCAN_res_def_priority(resource,0);
- pid=task_createn("xfill", bufferfiller,(TASK_MODEL*)&model, &resource, NULL);
-#else
- pid=task_create("xfill", bufferfiller, &model, NULL);
-#endif
- if (pid!=-1) {
- cprintf("task wcet=%10li period=%10li\n",(long)wcet,(long)period);
- }
-
- return pid;
-}
-
-size_t x_fread(void *buffer, size_t objsize, size_t n, FILE *file)
-{
- struct xbuffer *ptr;
- int size,sz;
- int nv;
-
- ptr=table[fileno(file)];
- if (ptr==NULL) {
- cprintf("x_fread with bad fd\n");
- return 0;
- }
-
- size=objsize*n;
- //cprintf("[for %i]",size);
-REDO:
- if (filledspace(ptr)<size) {
- /*
- cprintf("x_fread called for %li bytes (%li available)\n",
- (long)size,
- (long)filledspace(ptr));
- */
- nv=n;
- n=filledspace(ptr)/objsize;
- if (n==0) {
- struct timespec delay;
- delay.tv_sec=0;
- delay.tv_nsec=15000000;
- n=nv;
- nanosleep(&delay, 0);
- goto REDO;
- return 0;
- }
- size=objsize*n;
- /*cprintf("%i will return\n",size);*/
- }
-
- sz=BUFFERMAXSIZE-ptr->readptr;
- if (sz>=size) {
- //cprintf("X");
- memcpy(buffer,ptr->buffer+ptr->readptr,size);
- } else {
- //cprintf("Y");
- memcpy(buffer,ptr->buffer+ptr->readptr,sz);
- assert(size-sz>0);
- memcpy(buffer+sz,ptr->buffer,size-sz);
- }
-
- kern_cli();
- ptr->readptr+=size;
- /* ipotesi: non si legge mai piu' di BUFFERMAXSIZE */
- if (ptr->readptr>=BUFFERMAXSIZE) ptr->readptr-=BUFFERMAXSIZE;
- kern_sti();
-
- return n;
-}
-
-#endif
Index: rel_1_21/fsdemo/gphoto.h
===================================================================
--- rel_1_21/fsdemo/gphoto.h (revision 1217)
+++ rel_1_21/fsdemo/gphoto.h (nonexistent)
@@ -1,42 +0,0 @@
-/*
- *
- *
- */
-
-#ifndef __GPHOTO_H
-#define __GPHOTO_H
-
-#include <ll/sys/types.h>
-
-struct BITMAPFILEHEADER {
- WORD bfType;
- DWORD bfSize;
- WORD bfReserved1;
- WORD bfReserved2;
- DWORD bfOffBits;
-} __attribute__((packed));
-
-struct BITMAPINFOHEADER {
- DWORD biSize;
- DWORD biWidth;
- DWORD biHeight;
- WORD biPlanes;
- WORD biBitCount;
- DWORD biCompression;
- DWORD biSizeImage;
- DWORD biXPelsPerMeter;
- DWORD biYPelsPerMeter;
- DWORD biClrUsed;
- DWORD biClrImportant;
-} __attribute__((packed));
-
-struct RGBQUAD {
- BYTE rgbBlue;
- BYTE rgbGreen;
- BYTE rgbRed;
- BYTE rgbReserverd;
-} __attribute__((packed));
-
-int gphoto_show(char *title, char *pathname, int x, int y);
-
-#endif
Index: rel_1_21/fsdemo/gclock.h
===================================================================
--- rel_1_21/fsdemo/gclock.h (revision 1217)
+++ rel_1_21/fsdemo/gclock.h (nonexistent)
@@ -1,13 +0,0 @@
-
-
-#ifndef __GCLOCK_H
-#define __GCLOCK_H
-
-#include <kernel/types.h>
-
-PID gclock_init(int x, int y);
-
-#define GCLOCKDX (5*8+2)
-#define GCLOCKDY (1*8+2)
-
-#endif
Index: rel_1_21/fsdemo/mutex.h
===================================================================
--- rel_1_21/fsdemo/mutex.h (revision 1217)
+++ rel_1_21/fsdemo/mutex.h (nonexistent)
@@ -1,32 +0,0 @@
-
-#ifndef __GRXMUTEX_H
-#define __GRXMUTEX_H
-
-#include "config.h"
-
-#ifdef GRXMUTEX
-
-#include <kernel/int_sem.h>
-
-#define g_sem_t internal_sem_t
-
-#define g_sem_init(s,value) internal_sem_init(s,value)
-#define g_sem_wait(s) internal_sem_wait(s)
-#define g_sem_signal(s) internal_sem_post(s)
-
-#else
-
-#define g_sem_t int
-
-#define g_sem_init(s,value)
-#define g_sem_wait(s)
-#define g_sem_signal(s)
-
-#endif
-
-extern g_sem_t grxsem;
-
-#define grxlock() g_sem_wait(&grxsem)
-#define grxunlock() g_sem_signal(&grxsem)
-
-#endif
Index: rel_1_21/fsf/test1.c
===================================================================
--- rel_1_21/fsf/test1.c (revision 1217)
+++ rel_1_21/fsf/test1.c (nonexistent)
@@ -1,352 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Giacomo Guidi <giacomo@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- * Copyright (C) 2002 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-
-#include "modules/edf.h"
-#include "modules/cbs.h"
-
-#include "pthread.h"
-#include "modules/posix.h"
-
-#include "fsf_contract.h"
-#include "fsf_server.h"
-
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/pi.h"
-#include "modules/pc.h"
-
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-#include <stdlib.h>
-
-// --------------------------------------------------
-// --------------------------------------------------
-// Init Part
-// --------------------------------------------------
-// --------------------------------------------------
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
- int grubstar_level;
-
- EDF_register_level(EDF_ENABLE_ALL);
- POSIX_register_level(RRTICK, 1, mb, 32);
- grubstar_level = GRUBSTAR_register_level(4, 0);
- FSF_register_module(grubstar_level);
- dummy_register_level();
-
- // for the keyboard...
- CBS_register_level(CBS_ENABLE_ALL, 0);
-
- PI_register_module();
- PC_register_module();
-
- SEM_register_module();
-
- PTHREAD_register_module(1, 0, 1);
-
- return TICK;
-}
-
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- HARTPORT_init();
-
- KEYB_init(NULL);
-
- __call_main__(mb);
-
- return (void *)0;
-
-}
-
-// --------------------------------------------------
-// --------------------------------------------------
-// The Test
-// --------------------------------------------------
-// --------------------------------------------------
-
-pthread_t j1 = -1;
-pthread_t j2 = -1;
-pthread_t j3 = -1;
-pthread_t j4 = -1;
-fsf_server_id_t server1 = -1;
-fsf_server_id_t server2 = -1;
-fsf_server_id_t server3 = -1;
-fsf_server_id_t server4 = -1;
-fsf_contract_parameters_t contract1, contract2;
-
-pthread_mutex_t mux;
-
-#define TASK_PERIOD 1000000
-
-void *periodic_star(void *arg)
-{
- struct timespec actual,end,next_time;
- int actpersecond,act,cycle;
- int mean,nmean;
- bool was_deadline_missed, was_budget_overran;
-
- act = 0;
- actpersecond = 0;
- mean = 0;
- nmean = 0;
- cycle = 0;
- for (;;) {
-
- kern_gettime(&actual);
- cycle++;
-
- if (act == 0) {
- TIMESPEC_ASSIGN(&end,&actual);
- end.tv_sec++;
- }
-
- if (TIMESPEC_A_LT_B(&actual,&end)) {
- act++;
- } else {
- actpersecond = act;
- act = 0;
- mean = (mean * nmean + actpersecond) / (nmean+1);
- nmean++;
- }
-
- //pthread_mutex_lock(&mux);
- printf_xy(0,exec_shadow,WHITE,"Thread %3d Act_per_Second = %8d Mean = %8d Cycle = %8d",
- exec_shadow,actpersecond,mean,cycle);
- //pthread_mutex_unlock(&mux);
-
- kern_gettime(&next_time);
- ADDUSEC2TIMESPEC(TASK_PERIOD, &next_time);
- fsf_schedule_next_timed_job(NULL, NULL, NULL, &was_deadline_missed, &was_budget_overran);
-
- }
-
- return NULL;
-
-}
-
-void *star(void *arg)
-{
- struct timespec actual,end;
- int actpersecond,act;
- int mean,nmean,cycle;
-
- act = 0;
- actpersecond = 0;
- mean = 0;
- nmean = 0;
- cycle = 0;
- for (;;) {
-
- cycle++;
- kern_gettime(&actual);
-
- if (act == 0) {
- TIMESPEC_ASSIGN(&end,&actual);
- end.tv_sec++;
- }
-
- if (TIMESPEC_A_LT_B(&actual,&end)) {
- act++;
- } else {
- actpersecond = act;
- act = 0;
- mean = (mean * nmean + actpersecond) / (nmean+1);
- nmean++;
- }
-
- //pthread_mutex_lock(&mux);
- printf_xy(0,exec_shadow,WHITE,"Thread %3d Act_per_Second = %8d Mean = %8d Cycle = %8d",
- exec_shadow,actpersecond,mean,cycle);
- //pthread_mutex_unlock(&mux);
-
- }
-
- return NULL;
-
-}
-
-void *edftask(void *arg)
-{
- int i,j;
- while(1) {
- for (i=0;i<5; i++) {
- for (j=0; j<10; j++);
- //cputc('#');
- //cputs((char *)(arg));
- }
-
- task_endcycle();
- }
-
- return NULL;
-}
-
-
-void create()
-{
- HARD_TASK_MODEL mhard;
-
- struct timespec period1 = {0,100000000};
- struct timespec period2 = {0,100000000};
- struct timespec budget1 = {0,30000000};
- struct timespec budget2 = {0,30000000};
-
- PID t1, t2;
-
- kern_printf("(Start Create)");
-
- hard_task_default_model(mhard);
- hard_task_def_ctrl_jet(mhard);
- hard_task_def_mit(mhard,32000);
- hard_task_def_wcet(mhard,3000);
- hard_task_def_arg(mhard,(void *)"X");
- hard_task_def_group(mhard,1);
- hard_task_def_periodic(mhard);
-
- t1 = task_create("X", edftask, &mhard, NULL);
- if (t1 == NIL) {
- perror("Could not create task X ...");
- sys_end();
- }
-
- hard_task_def_mit(mhard,32000);
- hard_task_def_wcet(mhard,3000);
- hard_task_def_arg(mhard,(void *)"Y");
- t2 = task_create("Y", edftask, &mhard, NULL);
- if (t2 == NIL) {
- perror("Could not create task Y ...");
- sys_end();
- }
-
- group_activate(1);
-
- fsf_initialize_contract(&contract1);
- fsf_set_contract_basic_parameters(&contract1,&budget1,&period1,NULL,NULL,FSF_DEFAULT_WORKLOAD);
- fsf_initialize_contract(&contract2);
- fsf_set_contract_basic_parameters(&contract2,&budget2,&period2,NULL,NULL,FSF_DEFAULT_WORKLOAD);
-
- kern_printf("(End Create)");
-
-}
-
-int main(int argc, char **argv)
-{
-
- NRT_TASK_MODEL nrt;
- char ch = 0;
- int err;
-
- pthread_mutex_init(&mux,NULL);
-
- create();
-
- nrt_task_default_model(nrt);
- nrt_task_def_save_arrivals(nrt);
- nrt_task_def_ctrl_jet(nrt);
-
- do {
- ch = keyb_getch(BLOCK);
-
- switch(ch) {
- case '1':
- err = fsf_create_thread(server1,&j1,NULL,star,NULL,&nrt);
- kern_printf("(%d)",err);
- break;
- case '2':
- err = fsf_create_thread(server2,&j2,NULL,star,NULL,&nrt);
- kern_printf("(%d)",err);
- break;
- case '3':
- err = fsf_create_thread(server1,&j3,NULL,star,NULL,&nrt);
- kern_printf("(%d)",err);
- break;
- case '4':
- err = fsf_create_thread(server2,&j4,NULL,star,NULL,&nrt);
- kern_printf("(%d)",err);
- break;
- case 'q':
- err = fsf_negotiate_contract(&contract1,&server1);
- cprintf("(%d)",err);
- break;
- case 'w':
- err = fsf_negotiate_contract(&contract2,&server2);
- kern_printf("(%d)",err);
- break;
- case 'e':
- err = fsf_negotiate_contract(&contract1,&server3);
- kern_printf("(%d)",err);
- break;
- case 'r':
- err = fsf_cancel_contract(&server1);
- kern_printf("(%d)",err);
- break;
- case 't':
- err = fsf_cancel_contract(&server2);
- kern_printf("(%d)",err);
- break;
- case 'y':
- err = fsf_cancel_contract(&server3);
- kern_printf("(%d)",err);
- break;
-
- }
-
- } while(ch != ESC);
-
- sys_end();
-
- return 0;
-
-}
-
Index: rel_1_21/fsf/test2.c
===================================================================
--- rel_1_21/fsf/test2.c (revision 1217)
+++ rel_1_21/fsf/test2.c (nonexistent)
@@ -1,302 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Giacomo Guidi <giacomo@gandalf.sssup.it>
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "kernel/kern.h"
-
-#include "fsf_contract.h"
-
-#include "stdlib.h"
-#include "unistd.h"
-#include "string.h"
-
-#include "pthread.h"
-
-#include "drivers/keyb.h"
-#include "drivers/glib.h"
-
-#define TEST_PERIOD 50000
-
-mutex_t mux;
-
-void program_key_end(KEY_EVT *k)
-{
-
- sys_end();
-
-}
-
-void print_timer(int x, int y)
-{
-
- long nsec,sec,min,hrs,day;
- struct timespec actual_timer;
- char tmp[100];
-
- sys_gettime(&actual_timer);
-
- nsec = actual_timer.tv_nsec;
- sec = actual_timer.tv_sec;
- min = sec / 60;
- sec %= 60;
- hrs = min / 60;
- min %= 60;
- day = hrs / 24;
- hrs %= 24;
-
- sprintf(tmp,"Time: %2ld d %2ld h %2ld m %2ld s %12ld ns",day,hrs,min,sec,(long)nsec);
- //mutex_lock(&mux);
- grx_text(tmp,x,y,rgb16(255,255,255),0);
- //mutex_unlock(&mux);
-
-}
-
-#define LOAD_VARIATION 10
-
-#define MAX_V_QOS 30
-#define MIN_V_QOS 2
-
-void *test_task_variable(void *arg) {
-
- char tmp[100];
-
- long long i;
- int task_qos;
- int var_load, rd_per;
-
- TIME exectime;
-
- task_qos = 7;
- var_load = 5;
- rd_per = 0;
-
- while(1) {
-
- print_timer(307,10+30*exec_shadow);
- sprintf(tmp,"Test Thread V QOS = %5d PID = %3d VLOAD = %3d",task_qos,exec_shadow,var_load);
-
- //mutex_lock(&mux);
- grx_text(tmp,307,20+30*exec_shadow,rgb16(255,255,255),0);
- //mutex_unlock(&mux);
-
- jet_gettable(exec_shadow, &exectime, 1);
- sprintf(tmp,"Thread Exec Timer = %10d us",(int)exectime);
- grx_text(tmp,307,30+30*exec_shadow,rgb16(255,255,255),0);
-
- if (rd_per > LOAD_VARIATION) {
- var_load += rand()%3-1;
- if (var_load > 20) var_load = 20;
- if (var_load < 0) var_load = 0;
- rd_per = 0;
- } else {
- rd_per++;
- }
-
- for(i = 0; i < 10000*(task_qos+var_load); i++);
-
- }
-
- return NULL;
-
-}
-
-#define MAX_C_QOS 30
-#define MIN_C_QOS 2
-
-void *test_task_constant(void *arg) {
-
- char tmp[100];
-
- long long i;
- int task_qos;
-
- task_qos = 7;
-
- while(1) {
-
- print_timer(307,10+20*exec_shadow);
- sprintf(tmp,"Test Task C QOS = %5d PID = %3d",task_qos,exec_shadow);
- //mutex_lock(&mux);
- grx_text(tmp,307,20+20*exec_shadow,rgb16(255,255,255),0);
- //mutex_unlock(&mux);
-
- for(i = 0; i < 10000*task_qos; i++);
-
- }
-
- return NULL;
-
-}
-
-void draw_box(int x1, int y1, int x2, int y2)
-{
-
- grx_rect(x1,y1,x2,y2,rgb16(160,160,160));
- grx_rect(x1+2,y1+2,x2-2,y2-2,rgb16(210,210,210));
-
-}
-
-void layout_screen()
-{
-
- draw_box(0,0,300,500);
- grx_text("Application Task List",5,5,rgb16(255,255,255),0);
-
- draw_box(303,0,799,500);
- grx_text("Task Output",305,5,rgb16(255,255,255),0);
-
- draw_box(0,503,799,599);
- grx_line(140,505,140,597,rgb16(255,255,255));
- grx_line(140,583,797,583,rgb16(255,255,255));
-
- grx_text("Application Statistics",142,507,rgb16(255,255,255),0);
-
-}
-
-void program_end()
-{
-
- grx_close();
-
-}
-
-void *mpeg2decoder(void *arg);
-
-void add_posixstar_thread(fsf_server_id_t server)
-{
- NRT_TASK_MODEL nrt;
- pthread_t j = -1;
-
- nrt_task_default_model(nrt);
- fsf_create_thread(server, &j, NULL, test_task_variable, NULL, &nrt);
-
-}
-
-void add_edfstar_thread(fsf_server_id_t server)
-{
-
- pthread_t j = -1;
- HARD_TASK_MODEL ht;
-
- hard_task_default_model(ht);
- hard_task_def_mit(ht,100000);
- hard_task_def_wcet(ht,90000);
-
- fsf_create_thread(server, &j, NULL, mpeg2decoder, NULL, &ht);
-
-}
-
-int main(int argc, char **argv)
-{
-
- char ch;
- int err;
-
- KEY_EVT k;
-
- PI_mutexattr_t a;
-
- struct timespec period1 = {0,10000000};
- struct timespec period2 = {0,10000000};
- struct timespec budget1 = {0,4000000};
- struct timespec budget2 = {0,4000000};
-
- fsf_server_id_t server1, server2;
- fsf_contract_parameters_t contract1, contract2;
-
- sys_atrunlevel(program_end, NULL, RUNLEVEL_BEFORE_EXIT);
-
- k.flag = ALTL_BIT;
- k.scan = KEY_C;
- k.ascii = 'c';
- keyb_hook(k,program_key_end);
-
- srand(sys_gettime(NULL));
-
- // graphic card Initialization
- if (grx_init() < 1) {
- sys_end();
- }
-
- if (grx_open(800, 600, 16) < 0) {
- cprintf("GRX Err\n");
- sys_end();
- }
-
- layout_screen();
-
- PI_mutexattr_default(a);
-
- mutex_init(&mux,&a);
-
- fsf_initialize_contract(&contract1);
- fsf_set_contract_basic_parameters(&contract1,&budget1,&period1,NULL,NULL,FSF_DEFAULT_WORKLOAD);
- fsf_initialize_contract(&contract2);
- fsf_set_contract_basic_parameters(&contract2,&budget2,&period2,NULL,NULL,FSF_DEFAULT_WORKLOAD);
- fsf_set_local_scheduler_parameter(&contract2, FSF_SCHEDULER_EDF);
-
- err = fsf_negotiate_contract(&contract1,&server1);
- if (err) cprintf("(FSF ERROR %d)",err);
- err = fsf_negotiate_contract(&contract2,&server2);
- if (err) cprintf("(FSF ERROR %d)",err);
-
- ch = keyb_getch(BLOCK);
-
- while(ch != ESC) {
-
- switch (ch) {
-
- case '1':
- add_posixstar_thread(server1);
- break;
- case '2':
- add_edfstar_thread(server2);
- break;
- case '3':
- break;
- case '4':
- break;
- case '5':
- break;
- }
-
- ch = keyb_getch(BLOCK);
-
- }
-
- sys_end();
-
- return 0;
-
-}
Index: rel_1_21/fsf/test3.c
===================================================================
--- rel_1_21/fsf/test3.c (revision 1217)
+++ rel_1_21/fsf/test3.c (nonexistent)
@@ -1,379 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Giacomo Guidi <giacomo@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- * Copyright (C) 2002 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-
-#include "modules/edf.h"
-#include "modules/cbs.h"
-
-#include "pthread.h"
-#include "modules/posix.h"
-
-#include "fsf_contract.h"
-#include "fsf_server.h"
-
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/pi.h"
-#include "modules/pc.h"
-
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-#include <stdlib.h>
-
-// --------------------------------------------------
-// --------------------------------------------------
-// Init Part
-// --------------------------------------------------
-// --------------------------------------------------
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-int grubstar_level;
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- POSIX_register_level(RRTICK, 1, mb, 32);
- grubstar_level = GRUBSTAR_register_level(5, 0);
- FSF_register_module(grubstar_level);
- dummy_register_level();
-
- // for the keyboard...
- CBS_register_level(CBS_ENABLE_ALL, 0);
-
- PI_register_module();
- PC_register_module();
-
- SEM_register_module();
-
- PTHREAD_register_module(1, 0, 1);
-
- return TICK;
-}
-
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- HARTPORT_init();
-
- KEYB_init(NULL);
-
- __call_main__(mb);
-
- return (void *)0;
-
-}
-
-// --------------------------------------------------
-// --------------------------------------------------
-// The Test
-// --------------------------------------------------
-// --------------------------------------------------
-
-pthread_t jposix = -1;
-pthread_t j1 = -1;
-pthread_t j2 = -1;
-pthread_t j3 = -1;
-pthread_t j4 = -1;
-fsf_server_id_t server1 = -1;
-fsf_server_id_t server2 = -1;
-fsf_server_id_t server3 = -1;
-fsf_server_id_t server4 = -1;
-fsf_contract_parameters_t contract;
-
-pthread_mutex_t mux;
-
-void *posix(void *arg)
-{
- struct timespec actual,end;
- int actpersecond,act;
- int cycle;
-
- act = 0;
- actpersecond = 0;
- cycle = 0;
- for (;;) {
-
- cycle++;
- kern_gettime(&actual);
-
- if (act == 0) {
- TIMESPEC_ASSIGN(&end,&actual);
- end.tv_sec++;
- }
-
- if (TIMESPEC_A_LT_B(&actual,&end)) {
- act++;
- } else {
- actpersecond = act;
- act = 0;
- }
-
- pthread_mutex_lock(&mux);
- printf_xy(0,exec_shadow,GREEN,"Thread %3d Act_per_Second = %8d cycle = %8d",
- exec_shadow,actpersecond,cycle);
- pthread_mutex_unlock(&mux);
-
- }
-
- return NULL;
-
-}
-
-void *star(void *arg)
-{
- struct timespec actual,end;
- int actpersecond,act;
- int cycle,rec;
-
- act = 0;
- actpersecond = 0;
- cycle = 0;
- rec = 0;
- for (;;) {
-
- cycle++;
- kern_gettime(&actual);
- rec = SERVER_get_last_reclaiming(grubstar_level,exec_shadow);
-
- if (act == 0) {
- TIMESPEC_ASSIGN(&end,&actual);
- end.tv_sec++;
- }
-
- if (TIMESPEC_A_LT_B(&actual,&end)) {
- act++;
- } else {
- actpersecond = act;
- act = 0;
- }
-
- pthread_mutex_lock(&mux);
- printf_xy(0,exec_shadow,WHITE,"Thread %3d Act_per_Second = %8d cycle = %8d rec = %8d",
- exec_shadow,actpersecond,cycle,rec);
- pthread_mutex_unlock(&mux);
-
- }
-
- return NULL;
-
-}
-
-void *periodic_star(void *arg)
-{
- struct timespec actual,end;
- int actpersecond,act;
- int cycle,rec;
-
- act = 0;
- actpersecond = 0;
- cycle = 0;
- rec = 0;
- for (;;) {
-
- cycle++;
- kern_gettime(&actual);
- rec = SERVER_get_last_reclaiming(grubstar_level,exec_shadow);
-
- if (act == 0) {
- TIMESPEC_ASSIGN(&end,&actual);
- end.tv_sec++;
- }
-
- if (TIMESPEC_A_LT_B(&actual,&end)) {
- act++;
- } else {
- actpersecond = act;
- act = 0;
- }
-
- pthread_mutex_lock(&mux);
- printf_xy(0,exec_shadow,RED,"Thread %3d Act_per_Second = %8d cycle = %8d rec = %8d",
- exec_shadow,actpersecond,cycle,rec);
- pthread_mutex_unlock(&mux);
-
- task_endcycle();
-
- }
-
- return NULL;
-
-}
-
-int keyinc = 5;
-
-void *edftask(void *arg)
-{
- long long j;
- while(1) {
- for (j=0; j<10000*keyinc; j++);
- task_endcycle();
- }
-
- return NULL;
-}
-
-
-void create()
-{
- HARD_TASK_MODEL mhard;
- int err;
-
- struct timespec period1 = {0,90000000}; //30%
- struct timespec period2 = {0,300000000}; //20%
- struct timespec period3 = {0,300000000}; //10%
- struct timespec budget1 = {0,30000000};
- struct timespec budget2 = {0,60000000};
- struct timespec budget3 = {0,30000000};
-
- PID t1, t2;
-
- kern_printf("(Start Create)");
-
- hard_task_default_model(mhard);
- hard_task_def_ctrl_jet(mhard);
- hard_task_def_mit(mhard,30000); //5%
- hard_task_def_wcet(mhard,1500);
- hard_task_def_arg(mhard,(void *)"X");
- hard_task_def_group(mhard,1);
- hard_task_def_periodic(mhard);
- hard_task_def_level(mhard,0);
-
- t1 = task_create("X", edftask, &mhard, NULL);
- if (t1 == NIL) {
- perror("Could not create task X ...");
- sys_end();
- }
-
- hard_task_def_mit(mhard,30000); //5%
- hard_task_def_wcet(mhard,1500);
- hard_task_def_arg(mhard,(void *)"Y");
- t2 = task_create("Y", edftask, &mhard, NULL);
- if (t2 == NIL) {
- perror("Could not create task Y ...");
- sys_end();
- }
-
- group_activate(1);
-
- fsf_initialize_contract(&contract);
-
- fsf_set_contract_basic_parameters(&contract,&budget1,&period1,NULL,NULL,FSF_DEFAULT_WORKLOAD);
- fsf_negotiate_contract(&contract,&server1);
-
- fsf_set_contract_basic_parameters(&contract,&budget2,&period2,NULL,NULL,FSF_DEFAULT_WORKLOAD);
- fsf_negotiate_contract(&contract,&server2);
-
- fsf_set_contract_basic_parameters(&contract,&budget3,&period3,NULL,NULL,FSF_DEFAULT_WORKLOAD);
- fsf_negotiate_contract(&contract,&server3);
-
- fsf_set_contract_basic_parameters(&contract,&budget2,&period2,NULL,NULL,FSF_DEFAULT_WORKLOAD);
- fsf_set_local_scheduler_parameter(&contract, FSF_SCHEDULER_EDF);
- fsf_negotiate_contract(&contract,&server4);
-
- err = pthread_create(&jposix, NULL, posix, NULL);
- if (err) kern_printf("(Error creating posix task)");
-
- kern_printf("(End Create)");
-
-}
-
-int main(int argc, char **argv)
-{
-
- int err;
- HARD_TASK_MODEL ht;
- NRT_TASK_MODEL nrt;
- struct timespec endtimer;
-
- pthread_mutex_init(&mux,NULL);
-
- srand(kern_gettime(NULL));
- create();
-
- nrt_task_default_model(nrt);
-
- kern_gettime(&endtimer);
- endtimer.tv_sec += 20;
- kern_event_post(&endtimer, (void (*)(void *))(sys_end), NULL);
-
- err = fsf_create_thread(server1,&j1,NULL,star,NULL,&nrt);
- kern_printf("(%d)",err);
-
- err = fsf_create_thread(server2,&j2,NULL,star,NULL,&nrt);
- kern_printf("(%d)",err);
-
- err = fsf_create_thread(server3,&j3,NULL,star,NULL,&nrt);
- kern_printf("(%d)",err);
-
- hard_task_default_model(ht);
- hard_task_def_mit(ht,200000);
- hard_task_def_wcet(ht,50000);
- err = fsf_create_thread(server4,&j4,NULL,periodic_star,NULL,&ht);
- kern_printf("(%d)",err);
-
-/* hard_task_default_model(ht);
- hard_task_def_mit(ht,159000);
- hard_task_def_wcet(ht,50000);
- err = fsf_create_thread(server4,&j4,NULL,periodic_star,NULL,&ht);
- kern_printf("(%d)",err);
-*/
- err = fsf_create_thread(server1,&j1,NULL,star,NULL,&nrt);
- kern_printf("(%d)",err);
-
- err = fsf_create_thread(server2,&j2,NULL,star,NULL,&nrt);
- kern_printf("(%d)",err);
-
- err = fsf_create_thread(server3,&j3,NULL,star,NULL,&nrt);
- kern_printf("(%d)",err);
-
- return 0;
-
-}
-
Index: rel_1_21/fsf/initfile.c
===================================================================
--- rel_1_21/fsf/initfile.c (revision 1217)
+++ rel_1_21/fsf/initfile.c (nonexistent)
@@ -1,116 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Giacomo Guidi <giacomo@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "modules/posix.h"
-#include "pthread.h"
-#include "drivers/keyb.h"
-#include "modules/sem.h"
-#include "modules/dummy.h"
-#include "modules/hartport.h"
-
-#include "fsf_contract.h"
-#include "fsf_server.h"
-
-#include "modules/pi.h"
-#include "modules/pc.h"
-
-#define TICK 0
-
-#define RRTICK 10000
-
-void load_file();
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
- int grubstar_level;
-
- EDF_register_level(EDF_ENABLE_ALL);
- POSIX_register_level(RRTICK, 1, mb, 32);
- grubstar_level = GRUBSTAR_register_level(FSF_MAX_N_SERVERS, 0);
- FSF_register_module(grubstar_level);
- dummy_register_level();
-
- CBS_register_level(CBS_ENABLE_ALL,0);
-
- SEM_register_module();
-
- PI_register_module();
- PC_register_module();
-
- PTHREAD_register_module(1, 0, 1);
-
- load_file();
-
- return TICK;
-
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- HARTPORT_init();
-
- KEYB_init(NULL);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
-int dos_video_preload(void *filename, long max_size, void **start, void **end);
-
-void *start_file;
-void *end_file;
-
-void load_file()
-{
- start_file = NULL;
- end_file = NULL;
-
- dos_video_preload("test.m2v",5000000,&start_file,&end_file);
-
- cprintf("Start file ptr = %08lx\n",(long)(start_file));
- cprintf("End file ptr = %08lx\n",(long)(end_file));
- cprintf("Size = %8ld\n",(long)(end_file - start_file));
-
-}
-
Index: rel_1_21/fsf/demos.txt
===================================================================
--- rel_1_21/fsf/demos.txt (revision 1217)
+++ rel_1_21/fsf/demos.txt (nonexistent)
@@ -1,48 +0,0 @@
-FSF demo for S.Ha.R.K
-
-test1.c:
-
-This demo shows the main feature of service contract implementation.
-
-A set of 4 threads is created using the pthread standard functions.
-At the beginning, these threads run without temporal restrictions
-and they don't respect any deadline.
-
-Two service contracts are initialized and set
-
-fsf_initialize_contract(&contract1);
-fsf_initialize_contract(&contract2);
-fsf_set_contract_basic_parameters(&contract1,&budget1,&period1,NULL,NULL,FSF_DEFAULT_WORKLOAD);
-fsf_set_contract_basic_parameters(&contract2,&budget2,&period2,NULL,NULL,FSF_DEFAULT_WORKLOAD);
-
-whit the button 'q','w','e' you can respectively
-negotiate contract for a server
-
-[err = fsf_negotiate_contract(&contractX,&serverY);]
-
-'q' -> negotiate contract1 for server1
-'w' -> negotiate contract2 for server2
-'e' -> negotiate contract1 for server3
-
-now with button '1','2','3','4' you can bind the thread to a server
-
-[err = fsf_bind_thread_to_server(serverY,jZ);]
-
-'1' -> bind thread1 to server1
-'2' -> bind thread2 to server2
-'3' -> bind thread3 to server3
-'4' -> bind thread4 to server2
-
-threads will start to respect the assigned budget. It's possible
-to bind more threads to one server. The local scheduler specified in the
-contract define how the threads will get the server resources.
-
-With '5','6','7','8' the thread is unbind from the server
-
-[err = fsf_unbind_thread_from_server(jZ);]
-
-With 'r','t','y' a server is removed
-
-[err = fsf_cancel_contract(&server2);]
-
-
Index: rel_1_21/fsf/mpeg2/gvideo.c
===================================================================
--- rel_1_21/fsf/mpeg2/gvideo.c (revision 1217)
+++ rel_1_21/fsf/mpeg2/gvideo.c (nonexistent)
@@ -1,51 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-#include "drivers/glib.h"
-
-#include "fsf_contract.h"
-
-#include "config.h"
-#include "global.h"
-
-extern void *start_file;
-extern void *end_file;
-
-int Init_Mpeg_Decoder(void *start,void *end);
-int Decode_Bitstream();
-
-void *mpeg2decoder(void *arg)
-{
-
- int init = 1;
-
- Init_Mpeg_Decoder(start_file,end_file);
-
- while(1) {
-
- if (init == 1) {
- Decode_Bitstream();
- }
-
- }
-
- return 0;
-
-}
-
-
Index: rel_1_21/fsf/mpeg2/gethdr.c
===================================================================
--- rel_1_21/fsf/mpeg2/gethdr.c (revision 1217)
+++ rel_1_21/fsf/mpeg2/gethdr.c (nonexistent)
@@ -1,1074 +0,0 @@
-/* gethdr.c, header decoding */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include "config.h"
-#include "global.h"
-
-
-/* private prototypes */
-static void sequence_header _ANSI_ARGS_((void));
-static void group_of_pictures_header _ANSI_ARGS_((void));
-static void picture_header _ANSI_ARGS_((void));
-static void extension_and_user_data _ANSI_ARGS_((void));
-static void sequence_extension _ANSI_ARGS_((void));
-static void sequence_display_extension _ANSI_ARGS_((void));
-static void quant_matrix_extension _ANSI_ARGS_((void));
-static void sequence_scalable_extension _ANSI_ARGS_((void));
-static void picture_display_extension _ANSI_ARGS_((void));
-static void picture_coding_extension _ANSI_ARGS_((void));
-static void picture_spatial_scalable_extension _ANSI_ARGS_((void));
-static void picture_temporal_scalable_extension _ANSI_ARGS_((void));
-static int extra_bit_information _ANSI_ARGS_((void));
-static void copyright_extension _ANSI_ARGS_((void));
-static void user_data _ANSI_ARGS_((void));
-static void user_data _ANSI_ARGS_((void));
-
-
-
-
-/* introduced in September 1995 to assist spatial scalable decoding */
-static void Update_Temporal_Reference_Tacking_Data _ANSI_ARGS_((void));
-/* private variables */
-static int Temporal_Reference_Base = 0;
-static int True_Framenum_max = -1;
-static int Temporal_Reference_GOP_Reset = 0;
-
-#define RESERVED -1
-static double frame_rate_Table[16] =
-{
- 0.0,
- ((23.0*1000.0)/1001.0),
- 24.0,
- 25.0,
- ((30.0*1000.0)/1001.0),
- 30.0,
- 50.0,
- ((60.0*1000.0)/1001.0),
- 60.0,
-
- RESERVED,
- RESERVED,
- RESERVED,
- RESERVED,
- RESERVED,
- RESERVED,
- RESERVED
-};
-
-/*
- * decode headers from one input stream
- * until an End of Sequence or picture start code
- * is found
- */
-int Get_Hdr()
-{
- unsigned int code;
-
- for (;;)
- {
- /* look for next_start_code */
- next_start_code();
- code = Get_Bits32();
-
- switch (code)
- {
- case SEQUENCE_HEADER_CODE:
- sequence_header();
- break;
- case GROUP_START_CODE:
- group_of_pictures_header();
- break;
- case PICTURE_START_CODE:
- picture_header();
- return 1;
- break;
- case SEQUENCE_END_CODE:
- return 0;
- break;
- default:
- if (!Quiet_Flag)
- cprintf("Unexpected next_start_code %08x (ignored)\n",code);
- break;
- }
- }
-}
-
-
-/* align to start of next next_start_code */
-
-void next_start_code()
-{
- /* byte align */
- Flush_Buffer(ld->Incnt&7);
- while (Show_Bits(24)!=0x01L)
- Flush_Buffer(8);
-}
-
-
-/* decode sequence header */
-
-static void sequence_header()
-{
- int i;
- int pos;
-
- pos = ld->Bitcnt;
- horizontal_size = Get_Bits(12);
- vertical_size = Get_Bits(12);
- aspect_ratio_information = Get_Bits(4);
- frame_rate_code = Get_Bits(4);
- bit_rate_value = Get_Bits(18);
- marker_bit("sequence_header()");
- vbv_buffer_size = Get_Bits(10);
- constrained_parameters_flag = Get_Bits(1);
-
- if((ld->load_intra_quantizer_matrix = Get_Bits(1)))
- {
- for (i=0; i<64; i++)
- ld->intra_quantizer_matrix[scan[ZIG_ZAG][i]] = Get_Bits(8);
- }
- else
- {
- for (i=0; i<64; i++)
- ld->intra_quantizer_matrix[i] = default_intra_quantizer_matrix[i];
- }
-
- if((ld->load_non_intra_quantizer_matrix = Get_Bits(1)))
- {
- for (i=0; i<64; i++)
- ld->non_intra_quantizer_matrix[scan[ZIG_ZAG][i]] = Get_Bits(8);
- }
- else
- {
- for (i=0; i<64; i++)
- ld->non_intra_quantizer_matrix[i] = 16;
- }
-
- /* copy luminance to chrominance matrices */
- for (i=0; i<64; i++)
- {
- ld->chroma_intra_quantizer_matrix[i] =
- ld->intra_quantizer_matrix[i];
-
- ld->chroma_non_intra_quantizer_matrix[i] =
- ld->non_intra_quantizer_matrix[i];
- }
-
-#ifdef VERBOSE
- if (Verbose_Flag > NO_LAYER)
- {
- cprintf("sequence header (byte %d)\n",(pos>>3)-4);
- if (Verbose_Flag > SEQUENCE_LAYER)
- {
- cprintf(" horizontal_size=%d\n",horizontal_size);
- cprintf(" vertical_size=%d\n",vertical_size);
- cprintf(" aspect_ratio_information=%d\n",aspect_ratio_information);
- cprintf(" frame_rate_code=%d",frame_rate_code);
- cprintf(" bit_rate_value=%d\n",bit_rate_value);
- cprintf(" vbv_buffer_size=%d\n",vbv_buffer_size);
- cprintf(" constrained_parameters_flag=%d\n",constrained_parameters_flag);
- cprintf(" load_intra_quantizer_matrix=%d\n",ld->load_intra_quantizer_matrix);
- cprintf(" load_non_intra_quantizer_matrix=%d\n",ld->load_non_intra_quantizer_matrix);
- }
- }
-#endif /* VERBOSE */
-
-#ifdef VERIFY
- verify_sequence_header++;
-#endif /* VERIFY */
-
- extension_and_user_data();
-}
-
-
-
-/* decode group of pictures header */
-/* ISO/IEC 13818-2 section 6.2.2.6 */
-static void group_of_pictures_header()
-{
- int pos;
-
- if (ld == &base)
- {
- Temporal_Reference_Base = True_Framenum_max + 1; /* *CH* */
- Temporal_Reference_GOP_Reset = 1;
- }
- pos = ld->Bitcnt;
- drop_flag = Get_Bits(1);
- hour = Get_Bits(5);
- minute = Get_Bits(6);
- marker_bit("group_of_pictures_header()");
- sec = Get_Bits(6);
- frame = Get_Bits(6);
- closed_gop = Get_Bits(1);
- broken_link = Get_Bits(1);
-
-#ifdef VERBOSE
- if (Verbose_Flag > NO_LAYER)
- {
- cprintf("group of pictures (byte %d)\n",(pos>>3)-4);
- if (Verbose_Flag > SEQUENCE_LAYER)
- {
- cprintf(" drop_flag=%d\n",drop_flag);
- cprintf(" timecode %d:%02d:%02d:%02d\n",hour,minute,sec,frame);
- cprintf(" closed_gop=%d\n",closed_gop);
- cprintf(" broken_link=%d\n",broken_link);
- }
- }
-#endif /* VERBOSE */
-
-#ifdef VERIFY
- verify_group_of_pictures_header++;
-#endif /* VERIFY */
-
- extension_and_user_data();
-
-}
-
-
-/* decode picture header */
-
-/* ISO/IEC 13818-2 section 6.2.3 */
-static void picture_header()
-{
- int pos;
- int Extra_Information_Byte_Count;
-
- /* unless later overwritten by picture_spatial_scalable_extension() */
- ld->pict_scal = 0;
-
- pos = ld->Bitcnt;
- temporal_reference = Get_Bits(10);
- picture_coding_type = Get_Bits(3);
- vbv_delay = Get_Bits(16);
-
- if (picture_coding_type==P_TYPE || picture_coding_type==B_TYPE)
- {
- full_pel_forward_vector = Get_Bits(1);
- forward_f_code = Get_Bits(3);
- }
- if (picture_coding_type==B_TYPE)
- {
- full_pel_backward_vector = Get_Bits(1);
- backward_f_code = Get_Bits(3);
- }
-
-#ifdef VERBOSE
- if (Verbose_Flag>NO_LAYER)
- {
- cprintf("picture header (byte %d)\n",(pos>>3)-4);
- if (Verbose_Flag>SEQUENCE_LAYER)
- {
- cprintf(" temporal_reference=%d\n",temporal_reference);
- cprintf(" picture_coding_type=%d\n",picture_coding_type);
- cprintf(" vbv_delay=%d\n",vbv_delay);
- if (picture_coding_type==P_TYPE || picture_coding_type==B_TYPE)
- {
- cprintf(" full_pel_forward_vector=%d\n",full_pel_forward_vector);
- cprintf(" forward_f_code =%d\n",forward_f_code);
- }
- if (picture_coding_type==B_TYPE)
- {
- cprintf(" full_pel_backward_vector=%d\n",full_pel_backward_vector);
- cprintf(" backward_f_code =%d\n",backward_f_code);
- }
- }
- }
-#endif /* VERBOSE */
-
-#ifdef VERIFY
- verify_picture_header++;
-#endif /* VERIFY */
-
- Extra_Information_Byte_Count =
- extra_bit_information();
-
- extension_and_user_data();
-
- /* update tracking information used to assist spatial scalability */
- Update_Temporal_Reference_Tacking_Data();
-}
-
-/* decode slice header */
-
-/* ISO/IEC 13818-2 section 6.2.4 */
-int slice_header()
-{
- int slice_vertical_position_extension;
- int quantizer_scale_code;
- int pos;
- int slice_picture_id_enable = 0;
- int slice_picture_id = 0;
- int extra_information_slice = 0;
-
- pos = ld->Bitcnt;
-
- slice_vertical_position_extension =
- (ld->MPEG2_Flag && vertical_size>2800) ? Get_Bits(3) : 0;
-
- if (ld->scalable_mode==SC_DP)
- ld->priority_breakpoint = Get_Bits(7);
-
- quantizer_scale_code = Get_Bits(5);
- ld->quantizer_scale =
- ld->MPEG2_Flag ? (ld->q_scale_type ? Non_Linear_quantizer_scale[quantizer_scale_code] : quantizer_scale_code<<1) : quantizer_scale_code;
-
- /* slice_id introduced in March 1995 as part of the video corridendum
- (after the IS was drafted in November 1994) */
- if (Get_Bits(1))
- {
- ld->intra_slice = Get_Bits(1);
-
- slice_picture_id_enable = Get_Bits(1);
- slice_picture_id = Get_Bits(6);
-
- extra_information_slice = extra_bit_information();
- }
- else
- ld->intra_slice = 0;
-
-#ifdef VERBOSE
- if (Verbose_Flag>PICTURE_LAYER)
- {
- cprintf("slice header (byte %d)\n",(pos>>3)-4);
- if (Verbose_Flag>SLICE_LAYER)
- {
- if (ld->MPEG2_Flag && vertical_size>2800)
- cprintf(" slice_vertical_position_extension=%d\n",slice_vertical_position_extension);
-
- if (ld->scalable_mode==SC_DP)
- cprintf(" priority_breakpoint=%d\n",ld->priority_breakpoint);
-
- cprintf(" quantizer_scale_code=%d\n",quantizer_scale_code);
-
- cprintf(" slice_picture_id_enable = %d\n", slice_picture_id_enable);
-
- if(slice_picture_id_enable)
- cprintf(" slice_picture_id = %d\n", slice_picture_id);
-
- }
- }
-#endif /* VERBOSE */
-
-#ifdef VERIFY
- verify_slice_header++;
-#endif /* VERIFY */
-
-
- return slice_vertical_position_extension;
-}
-
-
-/* decode extension and user data */
-/* ISO/IEC 13818-2 section 6.2.2.2 */
-static void extension_and_user_data()
-{
- int code,ext_ID;
-
- next_start_code();
-
- while ((code = Show_Bits(32))==EXTENSION_START_CODE || code==USER_DATA_START_CODE)
- {
- if (code==EXTENSION_START_CODE)
- {
- Flush_Buffer32();
- ext_ID = Get_Bits(4);
- switch (ext_ID)
- {
- case SEQUENCE_EXTENSION_ID:
- sequence_extension();
- break;
- case SEQUENCE_DISPLAY_EXTENSION_ID:
- sequence_display_extension();
- break;
- case QUANT_MATRIX_EXTENSION_ID:
- quant_matrix_extension();
- break;
- case SEQUENCE_SCALABLE_EXTENSION_ID:
- sequence_scalable_extension();
- break;
- case PICTURE_DISPLAY_EXTENSION_ID:
- picture_display_extension();
- break;
- case PICTURE_CODING_EXTENSION_ID:
- picture_coding_extension();
- break;
- case PICTURE_SPATIAL_SCALABLE_EXTENSION_ID:
- picture_spatial_scalable_extension();
- break;
- case PICTURE_TEMPORAL_SCALABLE_EXTENSION_ID:
- picture_temporal_scalable_extension();
- break;
- case COPYRIGHT_EXTENSION_ID:
- copyright_extension();
- break;
- default:
- cprintf("reserved extension start code ID %d\n",ext_ID);
- break;
- }
- next_start_code();
- }
- else
- {
-#ifdef VERBOSE
- if (Verbose_Flag>NO_LAYER)
- cprintf("user data\n");
-#endif /* VERBOSE */
- Flush_Buffer32();
- user_data();
- }
- }
-}
-
-
-/* decode sequence extension */
-
-/* ISO/IEC 13818-2 section 6.2.2.3 */
-static void sequence_extension()
-{
- int horizontal_size_extension;
- int vertical_size_extension;
- int bit_rate_extension;
- int vbv_buffer_size_extension;
-
- /* derive bit position for trace */
-#ifdef VERBOSE
- pos = ld->Bitcnt;
-#endif
-
- ld->MPEG2_Flag = 1;
-
- ld->scalable_mode = SC_NONE; /* unless overwritten by sequence_scalable_extension() */
- layer_id = 0; /* unless overwritten by sequence_scalable_extension() */
-
- profile_and_level_indication = Get_Bits(8);
- progressive_sequence = Get_Bits(1);
- chroma_format = Get_Bits(2);
- horizontal_size_extension = Get_Bits(2);
- vertical_size_extension = Get_Bits(2);
- bit_rate_extension = Get_Bits(12);
- marker_bit("sequence_extension");
- vbv_buffer_size_extension = Get_Bits(8);
- low_delay = Get_Bits(1);
- frame_rate_extension_n = Get_Bits(2);
- frame_rate_extension_d = Get_Bits(5);
-
- frame_rate = frame_rate_Table[frame_rate_code] *
- ((frame_rate_extension_n+1)/(frame_rate_extension_d+1));
-
- /* special case for 422 profile & level must be made */
- if((profile_and_level_indication>>7) & 1)
- { /* escape bit of profile_and_level_indication set */
-
- /* 4:2:2 Profile @ Main Level */
- if((profile_and_level_indication&15)==5)
- {
- profile = PROFILE_422;
- level = MAIN_LEVEL;
- }
- }
- else
- {
- profile = profile_and_level_indication >> 4; /* Profile is upper nibble */
- level = profile_and_level_indication & 0xF; /* Level is lower nibble */
- }
-
-
- horizontal_size = (horizontal_size_extension<<12) | (horizontal_size&0x0fff);
- vertical_size = (vertical_size_extension<<12) | (vertical_size&0x0fff);
-
-
- /* ISO/IEC 13818-2 does not define bit_rate_value to be composed of
- * both the original bit_rate_value parsed in sequence_header() and
- * the optional bit_rate_extension in sequence_extension_header().
- * However, we use it for bitstream verification purposes.
- */
-
- bit_rate_value += (bit_rate_extension << 18);
- bit_rate = ((double) bit_rate_value) * 400.0;
- vbv_buffer_size += (vbv_buffer_size_extension << 10);
-
-#ifdef VERBOSE
- if (Verbose_Flag>NO_LAYER)
- {
- cprintf("sequence extension (byte %d)\n",(pos>>3)-4);
-
- if (Verbose_Flag>SEQUENCE_LAYER)
- {
- cprintf(" profile_and_level_indication=%d\n",profile_and_level_indication);
-
- if (profile_and_level_indication<128)
- {
- cprintf(" profile=%d, level=%d\n",profile,level);
- }
-
- cprintf(" progressive_sequence=%d\n",progressive_sequence);
- cprintf(" chroma_format=%d\n",chroma_format);
- cprintf(" horizontal_size_extension=%d\n",horizontal_size_extension);
- cprintf(" vertical_size_extension=%d\n",vertical_size_extension);
- cprintf(" bit_rate_extension=%d\n",bit_rate_extension);
- cprintf(" vbv_buffer_size_extension=%d\n",vbv_buffer_size_extension);
- cprintf(" low_delay=%d\n",low_delay);
- cprintf(" frame_rate_extension_n=%d\n",frame_rate_extension_n);
- cprintf(" frame_rate_extension_d=%d\n",frame_rate_extension_d);
- }
- }
-#endif /* VERBOSE */
-
-#ifdef VERIFY
- verify_sequence_extension++;
-#endif /* VERIFY */
-
-
-}
-
-
-/* decode sequence display extension */
-
-static void sequence_display_extension()
-{
- int pos;
-
- pos = ld->Bitcnt;
- video_format = Get_Bits(3);
- color_description = Get_Bits(1);
-
- if (color_description)
- {
- color_primaries = Get_Bits(8);
- transfer_characteristics = Get_Bits(8);
- matrix_coefficients = Get_Bits(8);
- }
-
- display_horizontal_size = Get_Bits(14);
- marker_bit("sequence_display_extension");
- display_vertical_size = Get_Bits(14);
-
-#ifdef VERBOSE
- if (Verbose_Flag>NO_LAYER)
- {
- cprintf("sequence display extension (byte %d)\n",(pos>>3)-4);
- if (Verbose_Flag>SEQUENCE_LAYER)
- {
-
- cprintf(" video_format=%d\n",video_format);
- cprintf(" color_description=%d\n",color_description);
-
- if (color_description)
- {
- cprintf(" color_primaries=%d\n",color_primaries);
- cprintf(" transfer_characteristics=%d\n",transfer_characteristics);
- cprintf(" matrix_coefficients=%d\n",matrix_coefficients);
- }
- cprintf(" display_horizontal_size=%d\n",display_horizontal_size);
- cprintf(" display_vertical_size=%d\n",display_vertical_size);
- }
- }
-#endif /* VERBOSE */
-
-#ifdef VERIFY
- verify_sequence_display_extension++;
-#endif /* VERIFY */
-
-}
-
-
-/* decode quant matrix entension */
-/* ISO/IEC 13818-2 section 6.2.3.2 */
-static void quant_matrix_extension()
-{
- int i;
- int pos;
-
- pos = ld->Bitcnt;
-
- if((ld->load_intra_quantizer_matrix = Get_Bits(1)))
- {
- for (i=0; i<64; i++)
- {
- ld->chroma_intra_quantizer_matrix[scan[ZIG_ZAG][i]]
- = ld->intra_quantizer_matrix[scan[ZIG_ZAG][i]]
- = Get_Bits(8);
- }
- }
-
- if((ld->load_non_intra_quantizer_matrix = Get_Bits(1)))
- {
- for (i=0; i<64; i++)
- {
- ld->chroma_non_intra_quantizer_matrix[scan[ZIG_ZAG][i]]
- = ld->non_intra_quantizer_matrix[scan[ZIG_ZAG][i]]
- = Get_Bits(8);
- }
- }
-
- if((ld->load_chroma_intra_quantizer_matrix = Get_Bits(1)))
- {
- for (i=0; i<64; i++)
- ld->chroma_intra_quantizer_matrix[scan[ZIG_ZAG][i]] = Get_Bits(8);
- }
-
- if((ld->load_chroma_non_intra_quantizer_matrix = Get_Bits(1)))
- {
- for (i=0; i<64; i++)
- ld->chroma_non_intra_quantizer_matrix[scan[ZIG_ZAG][i]] = Get_Bits(8);
- }
-
-#ifdef VERBOSE
- if (Verbose_Flag>NO_LAYER)
- {
- cprintf("quant matrix extension (byte %d)\n",(pos>>3)-4);
- cprintf(" load_intra_quantizer_matrix=%d\n",
- ld->load_intra_quantizer_matrix);
- cprintf(" load_non_intra_quantizer_matrix=%d\n",
- ld->load_non_intra_quantizer_matrix);
- cprintf(" load_chroma_intra_quantizer_matrix=%d\n",
- ld->load_chroma_intra_quantizer_matrix);
- cprintf(" load_chroma_non_intra_quantizer_matrix=%d\n",
- ld->load_chroma_non_intra_quantizer_matrix);
- }
-#endif /* VERBOSE */
-
-#ifdef VERIFY
- verify_quant_matrix_extension++;
-#endif /* VERIFY */
-
-}
-
-
-/* decode sequence scalable extension */
-/* ISO/IEC 13818-2 section 6.2.2.5 */
-static void sequence_scalable_extension()
-{
- int pos;
-
- pos = ld->Bitcnt;
-
- /* values (without the +1 offset) of scalable_mode are defined in
- Table 6-10 of ISO/IEC 13818-2 */
- ld->scalable_mode = Get_Bits(2) + 1; /* add 1 to make SC_DP != SC_NONE */
-
- layer_id = Get_Bits(4);
-
- if (ld->scalable_mode==SC_SPAT)
- {
- lower_layer_prediction_horizontal_size = Get_Bits(14);
- marker_bit("sequence_scalable_extension()");
- lower_layer_prediction_vertical_size = Get_Bits(14);
- horizontal_subsampling_factor_m = Get_Bits(5);
- horizontal_subsampling_factor_n = Get_Bits(5);
- vertical_subsampling_factor_m = Get_Bits(5);
- vertical_subsampling_factor_n = Get_Bits(5);
- }
-
- if (ld->scalable_mode==SC_TEMP)
- Error("temporal scalability not implemented\n");
-
-#ifdef VERBOSE
- if (Verbose_Flag>NO_LAYER)
- {
- cprintf("sequence scalable extension (byte %d)\n",(pos>>3)-4);
- if (Verbose_Flag>SEQUENCE_LAYER)
- {
- cprintf(" scalable_mode=%d\n",ld->scalable_mode-1);
- cprintf(" layer_id=%d\n",layer_id);
- if (ld->scalable_mode==SC_SPAT)
- {
- cprintf(" lower_layer_prediction_horiontal_size=%d\n",
- lower_layer_prediction_horizontal_size);
- cprintf(" lower_layer_prediction_vertical_size=%d\n",
- lower_layer_prediction_vertical_size);
- cprintf(" horizontal_subsampling_factor_m=%d\n",
- horizontal_subsampling_factor_m);
- cprintf(" horizontal_subsampling_factor_n=%d\n",
- horizontal_subsampling_factor_n);
- cprintf(" vertical_subsampling_factor_m=%d\n",
- vertical_subsampling_factor_m);
- cprintf(" vertical_subsampling_factor_n=%d\n",
- vertical_subsampling_factor_n);
- }
- }
- }
-#endif /* VERBOSE */
-
-#ifdef VERIFY
- verify_sequence_scalable_extension++;
-#endif /* VERIFY */
-
-}
-
-
-/* decode picture display extension */
-/* ISO/IEC 13818-2 section 6.2.3.3. */
-static void picture_display_extension()
-{
- int i;
- int number_of_frame_center_offsets;
- int pos;
-
- pos = ld->Bitcnt;
- /* based on ISO/IEC 13818-2 section 6.3.12
- (November 1994) Picture display extensions */
-
- /* derive number_of_frame_center_offsets */
- if(progressive_sequence)
- {
- if(repeat_first_field)
- {
- if(top_field_first)
- number_of_frame_center_offsets = 3;
- else
- number_of_frame_center_offsets = 2;
- }
- else
- {
- number_of_frame_center_offsets = 1;
- }
- }
- else
- {
- if(picture_structure!=FRAME_PICTURE)
- {
- number_of_frame_center_offsets = 1;
- }
- else
- {
- if(repeat_first_field)
- number_of_frame_center_offsets = 3;
- else
- number_of_frame_center_offsets = 2;
- }
- }
-
-
- /* now parse */
- for (i=0; i<number_of_frame_center_offsets; i++)
- {
- frame_center_horizontal_offset[i] = Get_Bits(16);
- marker_bit("picture_display_extension, first marker bit");
-
- frame_center_vertical_offset[i] = Get_Bits(16);
- marker_bit("picture_display_extension, second marker bit");
- }
-
-#ifdef VERBOSE
- if (Verbose_Flag>NO_LAYER)
- {
- cprintf("picture display extension (byte %d)\n",(pos>>3)-4);
- if (Verbose_Flag>SEQUENCE_LAYER)
- {
-
- for (i=0; i<number_of_frame_center_offsets; i++)
- {
- cprintf(" frame_center_horizontal_offset[%d]=%d\n",i,
- frame_center_horizontal_offset[i]);
- cprintf(" frame_center_vertical_offset[%d]=%d\n",i,
- frame_center_vertical_offset[i]);
- }
- }
- }
-#endif /* VERBOSE */
-
-#ifdef VERIFY
- verify_picture_display_extension++;
-#endif /* VERIFY */
-
-}
-
-
-/* decode picture coding extension */
-static void picture_coding_extension()
-{
- int pos;
-
- pos = ld->Bitcnt;
-
- f_code[0][0] = Get_Bits(4);
- f_code[0][1] = Get_Bits(4);
- f_code[1][0] = Get_Bits(4);
- f_code[1][1] = Get_Bits(4);
-
- intra_dc_precision = Get_Bits(2);
- picture_structure = Get_Bits(2);
- top_field_first = Get_Bits(1);
- frame_pred_frame_dct = Get_Bits(1);
- concealment_motion_vectors = Get_Bits(1);
- ld->q_scale_type = Get_Bits(1);
- intra_vlc_format = Get_Bits(1);
- ld->alternate_scan = Get_Bits(1);
- repeat_first_field = Get_Bits(1);
- chroma_420_type = Get_Bits(1);
- progressive_frame = Get_Bits(1);
- composite_display_flag = Get_Bits(1);
-
- if (composite_display_flag)
- {
- v_axis = Get_Bits(1);
- field_sequence = Get_Bits(3);
- sub_carrier = Get_Bits(1);
- burst_amplitude = Get_Bits(7);
- sub_carrier_phase = Get_Bits(8);
- }
-
-#ifdef VERBOSE
- if (Verbose_Flag>NO_LAYER)
- {
- cprintf("picture coding extension (byte %d)\n",(pos>>3)-4);
- if (Verbose_Flag>SEQUENCE_LAYER)
- {
- cprintf(" forward horizontal f_code=%d\n", f_code[0][0]);
- cprintf(" forward vertical f_code=%d\n", f_code[0][1]);
- cprintf(" backward horizontal f_code=%d\n", f_code[1][0]);
- cprintf(" backward_vertical f_code=%d\n", f_code[1][1]);
- cprintf(" intra_dc_precision=%d\n",intra_dc_precision);
- cprintf(" picture_structure=%d\n",picture_structure);
- cprintf(" top_field_first=%d\n",top_field_first);
- cprintf(" frame_pred_frame_dct=%d\n",frame_pred_frame_dct);
- cprintf(" concealment_motion_vectors=%d\n",concealment_motion_vectors);
- cprintf(" q_scale_type=%d\n",ld->q_scale_type);
- cprintf(" intra_vlc_format=%d\n",intra_vlc_format);
- cprintf(" alternate_scan=%d\n",ld->alternate_scan);
- cprintf(" repeat_first_field=%d\n",repeat_first_field);
- cprintf(" chroma_420_type=%d\n",chroma_420_type);
- cprintf(" progressive_frame=%d\n",progressive_frame);
- cprintf(" composite_display_flag=%d\n",composite_display_flag);
-
- if (composite_display_flag)
- {
- cprintf(" v_axis=%d\n",v_axis);
- cprintf(" field_sequence=%d\n",field_sequence);
- cprintf(" sub_carrier=%d\n",sub_carrier);
- cprintf(" burst_amplitude=%d\n",burst_amplitude);
- cprintf(" sub_carrier_phase=%d\n",sub_carrier_phase);
- }
- }
- }
-#endif /* VERBOSE */
-
-#ifdef VERIFY
- verify_picture_coding_extension++;
-#endif /* VERIFY */
-}
-
-
-/* decode picture spatial scalable extension */
-/* ISO/IEC 13818-2 section 6.2.3.5. */
-static void picture_spatial_scalable_extension()
-{
- int pos;
-
- pos = ld->Bitcnt;
-
- ld->pict_scal = 1; /* use spatial scalability in this picture */
-
- lower_layer_temporal_reference = Get_Bits(10);
- marker_bit("picture_spatial_scalable_extension(), first marker bit");
- lower_layer_horizontal_offset = Get_Bits(15);
- if (lower_layer_horizontal_offset>=16384)
- lower_layer_horizontal_offset-= 32768;
- marker_bit("picture_spatial_scalable_extension(), second marker bit");
- lower_layer_vertical_offset = Get_Bits(15);
- if (lower_layer_vertical_offset>=16384)
- lower_layer_vertical_offset-= 32768;
- spatial_temporal_weight_code_table_index = Get_Bits(2);
- lower_layer_progressive_frame = Get_Bits(1);
- lower_layer_deinterlaced_field_select = Get_Bits(1);
-
-#ifdef VERBOSE
- if (Verbose_Flag>NO_LAYER)
- {
- cprintf("picture spatial scalable extension (byte %d)\n",(pos>>3)-4);
- if (Verbose_Flag>SEQUENCE_LAYER)
- {
- cprintf(" lower_layer_temporal_reference=%d\n",lower_layer_temporal_reference);
- cprintf(" lower_layer_horizontal_offset=%d\n",lower_layer_horizontal_offset);
- cprintf(" lower_layer_vertical_offset=%d\n",lower_layer_vertical_offset);
- cprintf(" spatial_temporal_weight_code_table_index=%d\n",
- spatial_temporal_weight_code_table_index);
- cprintf(" lower_layer_progressive_frame=%d\n",lower_layer_progressive_frame);
- cprintf(" lower_layer_deinterlaced_field_select=%d\n",lower_layer_deinterlaced_field_select);
- }
- }
-#endif /* VERBOSE */
-
-#ifdef VERIFY
- verify_picture_spatial_scalable_extension++;
-#endif /* VERIFY */
-
-}
-
-
-/* decode picture temporal scalable extension
- *
- * not implemented
- */
-/* ISO/IEC 13818-2 section 6.2.3.4. */
-static void picture_temporal_scalable_extension()
-{
- Error("temporal scalability not supported\n");
-
-#ifdef VERIFY
- verify_picture_temporal_scalable_extension++;
-#endif /* VERIFY */
-}
-
-
-/* decode extra bit information */
-/* ISO/IEC 13818-2 section 6.2.3.4. */
-static int extra_bit_information()
-{
- int Byte_Count = 0;
-
- while (Get_Bits1())
- {
- Flush_Buffer(8);
- Byte_Count++;
- }
-
- return(Byte_Count);
-}
-
-
-
-/* ISO/IEC 13818-2 section 5.3 */
-/* Purpose: this function is mainly designed to aid in bitstream conformance
- testing. A simple Flush_Buffer(1) would do */
-void marker_bit(text)
-char *text;
-{
- int marker;
-
- marker = Get_Bits(1);
-
-#ifdef VERIFY
- if(!marker)
- cprintf("ERROR: %s--marker_bit set to 0",text);
-#endif
-}
-
-
-/* ISO/IEC 13818-2 sections 6.3.4.1 and 6.2.2.2.2 */
-static void user_data()
-{
- /* skip ahead to the next start code */
- next_start_code();
-}
-
-
-
-/* Copyright extension */
-/* ISO/IEC 13818-2 section 6.2.3.6. */
-/* (header added in November, 1994 to the IS document) */
-
-
-static void copyright_extension()
-{
- int pos;
- int reserved_data;
-
- pos = ld->Bitcnt;
-
-
- copyright_flag = Get_Bits(1);
- copyright_identifier = Get_Bits(8);
- original_or_copy = Get_Bits(1);
-
- /* reserved */
- reserved_data = Get_Bits(7);
-
- marker_bit("copyright_extension(), first marker bit");
- copyright_number_1 = Get_Bits(20);
- marker_bit("copyright_extension(), second marker bit");
- copyright_number_2 = Get_Bits(22);
- marker_bit("copyright_extension(), third marker bit");
- copyright_number_3 = Get_Bits(22);
-
- if(Verbose_Flag>NO_LAYER)
- {
- cprintf("copyright_extension (byte %d)\n",(pos>>3)-4);
- if (Verbose_Flag>SEQUENCE_LAYER)
- {
- cprintf(" copyright_flag =%d\n",copyright_flag);
-
- cprintf(" copyright_identifier=%d\n",copyright_identifier);
-
- cprintf(" original_or_copy = %d (original=1, copy=0)\n",
- original_or_copy);
-
- cprintf(" copyright_number_1=%d\n",copyright_number_1);
- cprintf(" copyright_number_2=%d\n",copyright_number_2);
- cprintf(" copyright_number_3=%d\n",copyright_number_3);
- }
- }
-
-#ifdef VERIFY
- verify_copyright_extension++;
-#endif /* VERIFY */
-}
-
-
-
-/* introduced in September 1995 to assist Spatial Scalability */
-static void Update_Temporal_Reference_Tacking_Data()
-{
- static int temporal_reference_wrap = 0;
- static int temporal_reference_old = 0;
-
- if (ld == &base) /* *CH* */
- {
- if (picture_coding_type!=B_TYPE && temporal_reference!=temporal_reference_old)
- /* check first field of */
- {
- /* non-B-frame */
- if (temporal_reference_wrap)
- {/* wrap occured at previous I- or P-frame */
- /* now all intervening B-frames which could
- still have high temporal_reference values are done */
- Temporal_Reference_Base += 1024;
- temporal_reference_wrap = 0;
- }
-
- /* distinguish from a reset */
- if (temporal_reference<temporal_reference_old && !Temporal_Reference_GOP_Reset)
- temporal_reference_wrap = 1; /* we must have just passed a GOP-Header! */
-
- temporal_reference_old = temporal_reference;
- Temporal_Reference_GOP_Reset = 0;
- }
-
- True_Framenum = Temporal_Reference_Base + temporal_reference;
-
- /* temporary wrap of TR at 1024 for M frames */
- if (temporal_reference_wrap && temporal_reference <= temporal_reference_old)
- True_Framenum += 1024;
-
- True_Framenum_max = (True_Framenum > True_Framenum_max) ?
- True_Framenum : True_Framenum_max;
- }
-}
Index: rel_1_21/fsf/mpeg2/idctref.c
===================================================================
--- rel_1_21/fsf/mpeg2/idctref.c (revision 1217)
+++ rel_1_21/fsf/mpeg2/idctref.c (nonexistent)
@@ -1,108 +0,0 @@
-/* Reference_IDCT.c, Inverse Discrete Fourier Transform, double precision */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-/* Perform IEEE 1180 reference (64-bit floating point, separable 8x1
- * direct matrix multiply) Inverse Discrete Cosine Transform
-*/
-
-
-/* Here we use math.h to generate constants. Compiler results may
- vary a little */
-
-#include <math.h>
-
-#include "config.h"
-
-#ifndef PI
-# ifdef M_PI
-# define PI M_PI
-# else
-# define PI 3.14159265358979323846
-# endif
-#endif
-
-/* global declarations */
-void Initialize_Fast_IDCTref _ANSI_ARGS_((void));
-void Reference_IDCT _ANSI_ARGS_((short *block));
-
-/* private data */
-
-/* cosine transform matrix for 8x1 IDCT */
-static double c[8][8];
-
-/* initialize DCT coefficient matrix */
-
-void Initialize_Reference_IDCT()
-{
- int freq, time;
- double scale;
-
- for (freq=0; freq < 8; freq++)
- {
- scale = (freq == 0) ? sqrt(0.125) : 0.5;
- for (time=0; time<8; time++)
- c[freq][time] = scale*cos((PI/8.0)*freq*(time + 0.5));
- }
-}
-
-/* perform IDCT matrix multiply for 8x8 coefficient block */
-
-void Reference_IDCT(block)
-short *block;
-{
- int i, j, k, v;
- double partial_product;
- double tmp[64];
-
- for (i=0; i<8; i++)
- for (j=0; j<8; j++)
- {
- partial_product = 0.0;
-
- for (k=0; k<8; k++)
- partial_product+= c[k][j]*block[8*i+k];
-
- tmp[8*i+j] = partial_product;
- }
-
- /* Transpose operation is integrated into address mapping by switching
- loop order of i and j */
-
- for (j=0; j<8; j++)
- for (i=0; i<8; i++)
- {
- partial_product = 0.0;
-
- for (k=0; k<8; k++)
- partial_product+= c[k][i]*tmp[8*k+j];
-
- v = (int) floor(partial_product+0.5);
- block[8*i+j] = (v<-256) ? -256 : ((v>255) ? 255 : v);
- }
-}
Index: rel_1_21/fsf/mpeg2/idct.c
===================================================================
--- rel_1_21/fsf/mpeg2/idct.c (revision 1217)
+++ rel_1_21/fsf/mpeg2/idct.c (nonexistent)
@@ -1,211 +0,0 @@
-/* idct.c, inverse fast discrete cosine transform */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-/**********************************************************/
-/* inverse two dimensional DCT, Chen-Wang algorithm */
-/* (cf. IEEE ASSP-32, pp. 803-816, Aug. 1984) */
-/* 32-bit integer arithmetic (8 bit coefficients) */
-/* 11 mults, 29 adds per DCT */
-/* sE, 18.8.91 */
-/**********************************************************/
-/* coefficients extended to 12 bit for IEEE1180-1990 */
-/* compliance sE, 2.1.94 */
-/**********************************************************/
-
-/* this code assumes >> to be a two's-complement arithmetic */
-/* right shift: (-2)>>1 == -1 , (-3)>>1 == -2 */
-
-#include "config.h"
-
-#define W1 2841 /* 2048*sqrt(2)*cos(1*pi/16) */
-#define W2 2676 /* 2048*sqrt(2)*cos(2*pi/16) */
-#define W3 2408 /* 2048*sqrt(2)*cos(3*pi/16) */
-#define W5 1609 /* 2048*sqrt(2)*cos(5*pi/16) */
-#define W6 1108 /* 2048*sqrt(2)*cos(6*pi/16) */
-#define W7 565 /* 2048*sqrt(2)*cos(7*pi/16) */
-
-/* global declarations */
-void Initialize_Fast_IDCT _ANSI_ARGS_((void));
-void Fast_IDCT _ANSI_ARGS_((short *block));
-
-/* private data */
-static short iclip[1024]; /* clipping table */
-static short *iclp;
-
-/* private prototypes */
-static void idctrow _ANSI_ARGS_((short *blk));
-static void idctcol _ANSI_ARGS_((short *blk));
-
-/* row (horizontal) IDCT
- *
- * 7 pi 1
- * dst[k] = sum c[l] * src[l] * cos( -- * ( k + - ) * l )
- * l=0 8 2
- *
- * where: c[0] = 128
- * c[1..7] = 128*sqrt(2)
- */
-
-static void idctrow(blk)
-short *blk;
-{
- int x0, x1, x2, x3, x4, x5, x6, x7, x8;
-
- /* shortcut */
- if (!((x1 = blk[4]<<11) | (x2 = blk[6]) | (x3 = blk[2]) |
- (x4 = blk[1]) | (x5 = blk[7]) | (x6 = blk[5]) | (x7 = blk[3])))
- {
- blk[0]=blk[1]=blk[2]=blk[3]=blk[4]=blk[5]=blk[6]=blk[7]=blk[0]<<3;
- return;
- }
-
- x0 = (blk[0]<<11) + 128; /* for proper rounding in the fourth stage */
-
- /* first stage */
- x8 = W7*(x4+x5);
- x4 = x8 + (W1-W7)*x4;
- x5 = x8 - (W1+W7)*x5;
- x8 = W3*(x6+x7);
- x6 = x8 - (W3-W5)*x6;
- x7 = x8 - (W3+W5)*x7;
-
- /* second stage */
- x8 = x0 + x1;
- x0 -= x1;
- x1 = W6*(x3+x2);
- x2 = x1 - (W2+W6)*x2;
- x3 = x1 + (W2-W6)*x3;
- x1 = x4 + x6;
- x4 -= x6;
- x6 = x5 + x7;
- x5 -= x7;
-
- /* third stage */
- x7 = x8 + x3;
- x8 -= x3;
- x3 = x0 + x2;
- x0 -= x2;
- x2 = (181*(x4+x5)+128)>>8;
- x4 = (181*(x4-x5)+128)>>8;
-
- /* fourth stage */
- blk[0] = (x7+x1)>>8;
- blk[1] = (x3+x2)>>8;
- blk[2] = (x0+x4)>>8;
- blk[3] = (x8+x6)>>8;
- blk[4] = (x8-x6)>>8;
- blk[5] = (x0-x4)>>8;
- blk[6] = (x3-x2)>>8;
- blk[7] = (x7-x1)>>8;
-}
-
-/* column (vertical) IDCT
- *
- * 7 pi 1
- * dst[8*k] = sum c[l] * src[8*l] * cos( -- * ( k + - ) * l )
- * l=0 8 2
- *
- * where: c[0] = 1/1024
- * c[1..7] = (1/1024)*sqrt(2)
- */
-static void idctcol(blk)
-short *blk;
-{
- int x0, x1, x2, x3, x4, x5, x6, x7, x8;
-
- /* shortcut */
- if (!((x1 = (blk[8*4]<<8)) | (x2 = blk[8*6]) | (x3 = blk[8*2]) |
- (x4 = blk[8*1]) | (x5 = blk[8*7]) | (x6 = blk[8*5]) | (x7 = blk[8*3])))
- {
- blk[8*0]=blk[8*1]=blk[8*2]=blk[8*3]=blk[8*4]=blk[8*5]=blk[8*6]=blk[8*7]=
- iclp[(blk[8*0]+32)>>6];
- return;
- }
-
- x0 = (blk[8*0]<<8) + 8192;
-
- /* first stage */
- x8 = W7*(x4+x5) + 4;
- x4 = (x8+(W1-W7)*x4)>>3;
- x5 = (x8-(W1+W7)*x5)>>3;
- x8 = W3*(x6+x7) + 4;
- x6 = (x8-(W3-W5)*x6)>>3;
- x7 = (x8-(W3+W5)*x7)>>3;
-
- /* second stage */
- x8 = x0 + x1;
- x0 -= x1;
- x1 = W6*(x3+x2) + 4;
- x2 = (x1-(W2+W6)*x2)>>3;
- x3 = (x1+(W2-W6)*x3)>>3;
- x1 = x4 + x6;
- x4 -= x6;
- x6 = x5 + x7;
- x5 -= x7;
-
- /* third stage */
- x7 = x8 + x3;
- x8 -= x3;
- x3 = x0 + x2;
- x0 -= x2;
- x2 = (181*(x4+x5)+128)>>8;
- x4 = (181*(x4-x5)+128)>>8;
-
- /* fourth stage */
- blk[8*0] = iclp[(x7+x1)>>14];
- blk[8*1] = iclp[(x3+x2)>>14];
- blk[8*2] = iclp[(x0+x4)>>14];
- blk[8*3] = iclp[(x8+x6)>>14];
- blk[8*4] = iclp[(x8-x6)>>14];
- blk[8*5] = iclp[(x0-x4)>>14];
- blk[8*6] = iclp[(x3-x2)>>14];
- blk[8*7] = iclp[(x7-x1)>>14];
-}
-
-/* two dimensional inverse discrete cosine transform */
-void Fast_IDCT(block)
-short *block;
-{
- int i;
-
- for (i=0; i<8; i++)
- idctrow(block+8*i);
-
- for (i=0; i<8; i++)
- idctcol(block+i);
-}
-
-void Initialize_Fast_IDCT()
-{
- int i;
-
- iclp = iclip+512;
- for (i= -512; i<512; i++)
- iclp[i] = (i<-256) ? -256 : ((i>255) ? 255 : i);
-}
Index: rel_1_21/fsf/mpeg2/getvlc.c
===================================================================
--- rel_1_21/fsf/mpeg2/getvlc.c (revision 1217)
+++ rel_1_21/fsf/mpeg2/getvlc.c (nonexistent)
@@ -1,797 +0,0 @@
-/* getvlc.c, variable length decoding */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include "config.h"
-#include "global.h"
-#include "getvlc.h"
-
-/* private prototypes */
-/* generic picture macroblock type processing functions */
-static int Get_I_macroblock_type _ANSI_ARGS_((void));
-static int Get_P_macroblock_type _ANSI_ARGS_((void));
-static int Get_B_macroblock_type _ANSI_ARGS_((void));
-static int Get_D_macroblock_type _ANSI_ARGS_((void));
-
-/* spatial picture macroblock type processing functions */
-static int Get_I_Spatial_macroblock_type _ANSI_ARGS_((void));
-static int Get_P_Spatial_macroblock_type _ANSI_ARGS_((void));
-static int Get_B_Spatial_macroblock_type _ANSI_ARGS_((void));
-static int Get_SNR_macroblock_type _ANSI_ARGS_((void));
-
-int Get_macroblock_type()
-{
- int macroblock_type = 0;
-
- if (ld->scalable_mode==SC_SNR)
- macroblock_type = Get_SNR_macroblock_type();
- else
- {
- switch (picture_coding_type)
- {
- case I_TYPE:
- macroblock_type = ld->pict_scal ? Get_I_Spatial_macroblock_type() : Get_I_macroblock_type();
- break;
- case P_TYPE:
- macroblock_type = ld->pict_scal ? Get_P_Spatial_macroblock_type() : Get_P_macroblock_type();
- break;
- case B_TYPE:
- macroblock_type = ld->pict_scal ? Get_B_Spatial_macroblock_type() : Get_B_macroblock_type();
- break;
- case D_TYPE:
- macroblock_type = Get_D_macroblock_type();
- break;
- default:
- cprintf("Get_macroblock_type(): unrecognized picture coding type\n");
- break;
- }
- }
-
- return macroblock_type;
-}
-
-static int Get_I_macroblock_type()
-{
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("macroblock_type(I) ");
-#endif /* TRACE */
-
- if (Get_Bits1())
- {
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("(1): Intra (1)\n");
-#endif /* TRACE */
- return 1;
- }
-
- if (!Get_Bits1())
- {
- if (!Quiet_Flag)
- cprintf("Invalid macroblock_type code\n");
- Fault_Flag = 1;
- }
-
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("(01): Intra, Quant (17)\n");
-#endif /* TRACE */
-
- return 17;
-}
-
-static char *MBdescr[]={
- "", "Intra", "No MC, Coded", "",
- "Bwd, Not Coded", "", "Bwd, Coded", "",
- "Fwd, Not Coded", "", "Fwd, Coded", "",
- "Interp, Not Coded", "", "Interp, Coded", "",
- "", "Intra, Quant", "No MC, Coded, Quant", "",
- "", "", "Bwd, Coded, Quant", "",
- "", "", "Fwd, Coded, Quant", "",
- "", "", "Interp, Coded, Quant", ""
-};
-
-static int Get_P_macroblock_type()
-{
- int code;
-
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("macroblock_type(P) (");
-#endif /* TRACE */
-
- if ((code = Show_Bits(6))>=8)
- {
- code >>= 3;
- Flush_Buffer(PMBtab0[code].len);
-#ifdef TRACE
- if (Trace_Flag)
- {
- Print_Bits(code,3,PMBtab0[code].len);
- cprintf("): %s (%d)\n",MBdescr[(int)PMBtab0[code].val],PMBtab0[code].val);
- }
-#endif /* TRACE */
- return PMBtab0[code].val;
- }
-
- if (code==0)
- {
- if (!Quiet_Flag)
- cprintf("Invalid macroblock_type code\n");
- Fault_Flag = 1;
- return 0;
- }
-
- Flush_Buffer(PMBtab1[code].len);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- Print_Bits(code,6,PMBtab1[code].len);
- cprintf("): %s (%d)\n",MBdescr[(int)PMBtab1[code].val],PMBtab1[code].val);
- }
-#endif /* TRACE */
-
- return PMBtab1[code].val;
-}
-
-static int Get_B_macroblock_type()
-{
- int code;
-
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("macroblock_type(B) (");
-#endif /* TRACE */
-
- if ((code = Show_Bits(6))>=8)
- {
- code >>= 2;
- Flush_Buffer(BMBtab0[code].len);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- Print_Bits(code,4,BMBtab0[code].len);
- cprintf("): %s (%d)\n",MBdescr[(int)BMBtab0[code].val],BMBtab0[code].val);
- }
-#endif /* TRACE */
-
- return BMBtab0[code].val;
- }
-
- if (code==0)
- {
- if (!Quiet_Flag)
- cprintf("Invalid macroblock_type code\n");
- Fault_Flag = 1;
- return 0;
- }
-
- Flush_Buffer(BMBtab1[code].len);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- Print_Bits(code,6,BMBtab1[code].len);
- cprintf("): %s (%d)\n",MBdescr[(int)BMBtab1[code].val],BMBtab1[code].val);
- }
-#endif /* TRACE */
-
- return BMBtab1[code].val;
-}
-
-static int Get_D_macroblock_type()
-{
- if (!Get_Bits1())
- {
- if (!Quiet_Flag)
- cprintf("Invalid macroblock_type code\n");
- Fault_Flag=1;
- }
-
- return 1;
-}
-
-/* macroblock_type for pictures with spatial scalability */
-static int Get_I_Spatial_macroblock_type()
-{
- int code;
-
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("macroblock_type(I,spat) (");
-#endif /* TRACE */
-
- code = Show_Bits(4);
-
- if (code==0)
- {
- if (!Quiet_Flag)
- cprintf("Invalid macroblock_type code\n");
- Fault_Flag = 1;
- return 0;
- }
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- Print_Bits(code,4,spIMBtab[code].len);
- cprintf("): %02x\n",spIMBtab[code].val);
- }
-#endif /* TRACE */
-
- Flush_Buffer(spIMBtab[code].len);
- return spIMBtab[code].val;
-}
-
-static int Get_P_Spatial_macroblock_type()
-{
- int code;
-
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("macroblock_type(P,spat) (");
-#endif /* TRACE */
-
- code = Show_Bits(7);
-
- if (code<2)
- {
- if (!Quiet_Flag)
- cprintf("Invalid macroblock_type code\n");
- Fault_Flag = 1;
- return 0;
- }
-
- if (code>=16)
- {
- code >>= 3;
- Flush_Buffer(spPMBtab0[code].len);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- Print_Bits(code,4,spPMBtab0[code].len);
- cprintf("): %02x\n",spPMBtab0[code].val);
- }
-#endif /* TRACE */
-
- return spPMBtab0[code].val;
- }
-
- Flush_Buffer(spPMBtab1[code].len);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- Print_Bits(code,7,spPMBtab1[code].len);
- cprintf("): %02x\n",spPMBtab1[code].val);
- }
-#endif /* TRACE */
-
- return spPMBtab1[code].val;
-}
-
-static int Get_B_Spatial_macroblock_type()
-{
- int code;
- VLCtab *p;
-
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("macroblock_type(B,spat) (");
-#endif /* TRACE */
-
- code = Show_Bits(9);
-
- if (code>=64)
- p = &spBMBtab0[(code>>5)-2];
- else if (code>=16)
- p = &spBMBtab1[(code>>2)-4];
- else if (code>=8)
- p = &spBMBtab2[code-8];
- else
- {
- if (!Quiet_Flag)
- cprintf("Invalid macroblock_type code\n");
- Fault_Flag = 1;
- return 0;
- }
-
- Flush_Buffer(p->len);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- Print_Bits(code,9,p->len);
- printf("): %02x\n",p->val);
- }
-#endif /* TRACE */
-
- return p->val;
-}
-
-static int Get_SNR_macroblock_type()
-{
- int code;
-
-#ifdef TRACE /* *CH* */
- if (Trace_Flag)
- cprintf("macroblock_type(SNR) (");
-#endif
-
- code = Show_Bits(3);
-
- if (code==0)
- {
- if (!Quiet_Flag)
- cprintf("Invalid macroblock_type code\n");
- Fault_Flag = 1;
- return 0;
- }
-
- Flush_Buffer(SNRMBtab[code].len);
-
-#ifdef TRACE /* *CH* */
- if (Trace_Flag)
- {
- Print_Bits(code,3,SNRMBtab[code].len);
- cprintf("): %s (%d)\n",MBdescr[(int)SNRMBtab[code].val],SNRMBtab[code].val);
- }
-#endif
-
-
- return SNRMBtab[code].val;
-}
-
-int Get_motion_code()
-{
- int code;
-
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("motion_code (");
-#endif /* TRACE */
-
- if (Get_Bits1())
- {
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("0): 0\n");
-#endif /* TRACE */
- return 0;
- }
-
- if ((code = Show_Bits(9))>=64)
- {
- code >>= 6;
- Flush_Buffer(MVtab0[code].len);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- Print_Bits(code,3,MVtab0[code].len);
- cprintf("%d): %d\n",
- Show_Bits(1),Show_Bits(1)?-MVtab0[code].val:MVtab0[code].val);
- }
-#endif /* TRACE */
-
- return Get_Bits1()?-MVtab0[code].val:MVtab0[code].val;
- }
-
- if (code>=24)
- {
- code >>= 3;
- Flush_Buffer(MVtab1[code].len);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- Print_Bits(code,6,MVtab1[code].len);
- cprintf("%d): %d\n",
- Show_Bits(1),Show_Bits(1)?-MVtab1[code].val:MVtab1[code].val);
- }
-#endif /* TRACE */
-
- return Get_Bits1()?-MVtab1[code].val:MVtab1[code].val;
- }
-
- if ((code-=12)<0)
- {
- if (!Quiet_Flag)
-/* HACK */
- cprintf("Invalid motion_vector code (MBA %d, pic %d)\n", global_MBA, global_pic);
- Fault_Flag=1;
- return 0;
- }
-
- Flush_Buffer(MVtab2[code].len);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- Print_Bits(code+12,9,MVtab2[code].len);
- cprintf("%d): %d\n",
- Show_Bits(1),Show_Bits(1)?-MVtab2[code].val:MVtab2[code].val);
- }
-#endif /* TRACE */
-
- return Get_Bits1() ? -MVtab2[code].val : MVtab2[code].val;
-}
-
-/* get differential motion vector (for dual prime prediction) */
-int Get_dmvector()
-{
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("dmvector (");
-#endif /* TRACE */
-
- if (Get_Bits(1))
- {
-#ifdef TRACE
- if (Trace_Flag)
- cprintf(Show_Bits(1) ? "11): -1\n" : "10): 1\n");
-#endif /* TRACE */
- return Get_Bits(1) ? -1 : 1;
- }
- else
- {
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("0): 0\n");
-#endif /* TRACE */
- return 0;
- }
-}
-
-int Get_coded_block_pattern()
-{
- int code;
-
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("coded_block_pattern_420 (");
-#endif /* TRACE */
-
- if ((code = Show_Bits(9))>=128)
- {
- code >>= 4;
- Flush_Buffer(CBPtab0[code].len);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- Print_Bits(code,5,CBPtab0[code].len);
- cprintf("): ");
- Print_Bits(CBPtab0[code].val,6,6);
- cprintf(" (%d)\n",CBPtab0[code].val);
- }
-#endif /* TRACE */
-
- return CBPtab0[code].val;
- }
-
- if (code>=8)
- {
- code >>= 1;
- Flush_Buffer(CBPtab1[code].len);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- Print_Bits(code,8,CBPtab1[code].len);
- cprintf("): ");
- Print_Bits(CBPtab1[code].val,6,6);
- cprintf(" (%d)\n",CBPtab1[code].val);
- }
-#endif /* TRACE */
-
- return CBPtab1[code].val;
- }
-
- if (code<1)
- {
- if (!Quiet_Flag)
- cprintf("Invalid coded_block_pattern code\n");
- Fault_Flag = 1;
- return 0;
- }
-
- Flush_Buffer(CBPtab2[code].len);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- Print_Bits(code,9,CBPtab2[code].len);
- cprintf("): ");
- Print_Bits(CBPtab2[code].val,6,6);
- cprintf(" (%d)\n",CBPtab2[code].val);
- }
-#endif /* TRACE */
-
- return CBPtab2[code].val;
-}
-
-int Get_macroblock_address_increment()
-{
- int code, val;
-
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("macroblock_address_increment (");
-#endif /* TRACE */
-
- val = 0;
-
- while ((code = Show_Bits(11))<24)
- {
- if (code!=15) /* if not macroblock_stuffing */
- {
- if (code==8) /* if macroblock_escape */
- {
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("00000001000 ");
-#endif /* TRACE */
-
- val+= 33;
- }
- else
- {
- if (!Quiet_Flag)
- cprintf("Invalid macroblock_address_increment code\n");
-
- Fault_Flag = 1;
- return 1;
- }
- }
- else /* macroblock suffing */
- {
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("00000001111 ");
-#endif /* TRACE */
- }
-
- Flush_Buffer(11);
- }
-
- /* macroblock_address_increment == 1 */
- /* ('1' is in the MSB position of the lookahead) */
- if (code>=1024)
- {
- Flush_Buffer(1);
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("1): %d\n",val+1);
-#endif /* TRACE */
- return val + 1;
- }
-
- /* codes 00010 ... 011xx */
- if (code>=128)
- {
- /* remove leading zeros */
- code >>= 6;
- Flush_Buffer(MBAtab1[code].len);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- Print_Bits(code,5,MBAtab1[code].len);
- printf("): %d\n",val+MBAtab1[code].val);
- }
-#endif /* TRACE */
-
-
- return val + MBAtab1[code].val;
- }
-
- /* codes 00000011000 ... 0000111xxxx */
- code-= 24; /* remove common base */
- Flush_Buffer(MBAtab2[code].len);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- Print_Bits(code+24,11,MBAtab2[code].len);
- cprintf("): %d\n",val+MBAtab2[code].val);
- }
-#endif /* TRACE */
-
- return val + MBAtab2[code].val;
-}
-
-/* combined MPEG-1 and MPEG-2 stage. parse VLC and
- perform dct_diff arithmetic.
-
- MPEG-1: ISO/IEC 11172-2 section
- MPEG-2: ISO/IEC 13818-2 section 7.2.1
-
- Note: the arithmetic here is presented more elegantly than
- the spec, yet the results, dct_diff, are the same.
-*/
-
-int Get_Luma_DC_dct_diff()
-{
- int code, size, dct_diff;
-
-#ifdef TRACE
-/*
- if (Trace_Flag)
- printf("dct_dc_size_luminance: (");
-*/
-#endif /* TRACE */
-
- /* decode length */
- code = Show_Bits(5);
-
- if (code<31)
- {
- size = DClumtab0[code].val;
- Flush_Buffer(DClumtab0[code].len);
-#ifdef TRACE
-/*
- if (Trace_Flag)
- {
- Print_Bits(code,5,DClumtab0[code].len);
- printf("): %d",size);
- }
-*/
-#endif /* TRACE */
- }
- else
- {
- code = Show_Bits(9) - 0x1f0;
- size = DClumtab1[code].val;
- Flush_Buffer(DClumtab1[code].len);
-
-#ifdef TRACE
-/*
- if (Trace_Flag)
- {
- Print_Bits(code+0x1f0,9,DClumtab1[code].len);
- printf("): %d",size);
- }
-*/
-#endif /* TRACE */
- }
-
-#ifdef TRACE
-/*
- if (Trace_Flag)
- printf(", dct_dc_differential (");
-*/
-#endif /* TRACE */
-
- if (size==0)
- dct_diff = 0;
- else
- {
- dct_diff = Get_Bits(size);
-#ifdef TRACE
-/*
- if (Trace_Flag)
- Print_Bits(dct_diff,size,size);
-*/
-#endif /* TRACE */
- if ((dct_diff & (1<<(size-1)))==0)
- dct_diff-= (1<<size) - 1;
- }
-
-#ifdef TRACE
-/*
- if (Trace_Flag)
- printf("): %d\n",dct_diff);
-*/
-#endif /* TRACE */
-
- return dct_diff;
-}
-
-
-int Get_Chroma_DC_dct_diff()
-{
- int code, size, dct_diff;
-
-#ifdef TRACE
-/*
- if (Trace_Flag)
- printf("dct_dc_size_chrominance: (");
-*/
-#endif /* TRACE */
-
- /* decode length */
- code = Show_Bits(5);
-
- if (code<31)
- {
- size = DCchromtab0[code].val;
- Flush_Buffer(DCchromtab0[code].len);
-
-#ifdef TRACE
-/*
- if (Trace_Flag)
- {
- Print_Bits(code,5,DCchromtab0[code].len);
- printf("): %d",size);
- }
-*/
-#endif /* TRACE */
- }
- else
- {
- code = Show_Bits(10) - 0x3e0;
- size = DCchromtab1[code].val;
- Flush_Buffer(DCchromtab1[code].len);
-
-#ifdef TRACE
-/*
- if (Trace_Flag)
- {
- Print_Bits(code+0x3e0,10,DCchromtab1[code].len);
- printf("): %d",size);
- }
-*/
-#endif /* TRACE */
- }
-
-#ifdef TRACE
-/*
- if (Trace_Flag)
- printf(", dct_dc_differential (");
-*/
-#endif /* TRACE */
-
- if (size==0)
- dct_diff = 0;
- else
- {
- dct_diff = Get_Bits(size);
-#ifdef TRACE
-/*
- if (Trace_Flag)
- Print_Bits(dct_diff,size,size);
-*/
-#endif /* TRACE */
- if ((dct_diff & (1<<(size-1)))==0)
- dct_diff-= (1<<size) - 1;
- }
-
-#ifdef TRACE
-/*
- if (Trace_Flag)
- printf("): %d\n",dct_diff);
-*/
-#endif /* TRACE */
-
- return dct_diff;
-}
Index: rel_1_21/fsf/mpeg2/mpeg2dec.c
===================================================================
--- rel_1_21/fsf/mpeg2/mpeg2dec.c (revision 1217)
+++ rel_1_21/fsf/mpeg2/mpeg2dec.c (nonexistent)
@@ -1,495 +0,0 @@
-
-/* mpeg2dec.c, main(), initialization, option processing */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include "stdlib.h"
-#include "drivers/glib.h"
-
-#include "fsf_contract.h"
-
-#define GLOBAL
-#include "config.h"
-#include "global.h"
-
-/* private prototypes */
-static int video_sequence _ANSI_ARGS_((int *framenum));
-static int Headers _ANSI_ARGS_((void));
-static void Initialize_Sequence _ANSI_ARGS_((void));
-static void Initialize_Decoder _ANSI_ARGS_((void));
-static void Deinitialize_Sequence _ANSI_ARGS_((void));
-
-/* #define DEBUG */
-
-static void Clear_Options();
-#ifdef DEBUG
-static void Print_Options();
-#endif
-
-#define MAX_M_QOS 0
-#define MIN_M_QOS 0
-
-int dos_video_preload(char *file_name, long max_size, void **start, void **end)
-{
- DOS_FILE* file;
- void *buf;
- long rd;
-
-
- file = DOS_fopen(file_name,"r");
- if (file == NULL) return -1;
-
- buf = malloc(max_size);
- *start = buf;
-
- while(((rd = DOS_fread(buf, sizeof(BYTE), 2048, file)) == 2048) &&
- ((buf - *start + rd) < (max_size-2048))) {
- buf += rd;
- }
-
- *end = buf + rd;
-
- DOS_fclose(file);
- return(0);
-
-}
-
-int Init_Mpeg_Decoder(void *start, void *end)
-{
- int code;
-
- Clear_Options();
-
-#ifdef DEBUG
- Print_Options();
-#endif
-
- ld = &base; /* select base layer context */
- ld->start_file_ptr = start;
- ld->end_file_ptr = end;
- ld->actual_file_ptr = ld->start_file_ptr;
-
- /* open MPEG base layer bitstream file(s) */
- /* NOTE: this is either a base layer stream or a spatial enhancement stream */
- if ((base.Infile=1)<0)
- {
- cprintf("Base layer input file %s not found\n", Main_Bitstream_Filename);
- }
-
-
- if(base.Infile != 0)
- {
- Initialize_Buffer();
-
- if(Show_Bits(8)==0x47)
- {
- sprintf(Error_Text,"Decoder currently does not parse transport streams\n");
- Error(Error_Text);
- }
-
- next_start_code();
- code = Show_Bits(32);
-
- switch(code)
- {
- case SEQUENCE_HEADER_CODE:
- break;
- case PACK_START_CODE:
- System_Stream_Flag = 1;
- case VIDEO_ELEMENTARY_STREAM:
- System_Stream_Flag = 1;
- break;
- default:
- sprintf(Error_Text,"Unable to recognize stream type\n");
- Error(Error_Text);
- break;
- }
-
- ld->actual_file_ptr = ld->start_file_ptr;
- Initialize_Buffer();
- }
-
- if(base.Infile!=0)
- {
- ld->actual_file_ptr = ld->start_file_ptr;
- }
-
- Initialize_Buffer();
-
- if(Two_Streams)
- {
- ld = &enhan; /* select enhancement layer context */
-
- if ((enhan.Infile = 1)<0)
- {
- sprintf(Error_Text,"enhancment layer bitstream file %s not found\n",
- Enhancement_Layer_Bitstream_Filename);
-
- Error(Error_Text);
- }
-
- Initialize_Buffer();
- ld = &base;
- }
-
- Initialize_Decoder();
-
- //Decode_Bitstream();
-
- return 0;
-}
-
-/* IMPLEMENTAION specific rouintes */
-static void Initialize_Decoder()
-{
- int i;
-
- /* Clip table */
- if (!(Clip=(unsigned char *)malloc(1024)))
- Error("Clip[] malloc failed\n");
-
- Clip += 384;
-
- for (i=-384; i<640; i++)
- Clip[i] = (i<0) ? 0 : ((i>255) ? 255 : i);
-
- /* IDCT */
- if (Reference_IDCT_Flag)
- Initialize_Reference_IDCT();
- else
- Initialize_Fast_IDCT();
-
-}
-
-/* mostly IMPLEMENTAION specific rouintes */
-static void Initialize_Sequence()
-{
- int cc, size;
- static int Table_6_20[3] = {6,8,12};
-
- /* check scalability mode of enhancement layer */
- if (Two_Streams && (enhan.scalable_mode!=SC_SNR) && (base.scalable_mode!=SC_DP))
- Error("unsupported scalability mode\n");
-
- /* force MPEG-1 parameters for proper decoder behavior */
- /* see ISO/IEC 13818-2 section D.9.14 */
- if (!base.MPEG2_Flag)
- {
- progressive_sequence = 1;
- progressive_frame = 1;
- picture_structure = FRAME_PICTURE;
- frame_pred_frame_dct = 1;
- chroma_format = CHROMA420;
- matrix_coefficients = 5;
- }
-
- /* round to nearest multiple of coded macroblocks */
- /* ISO/IEC 13818-2 section 6.3.3 sequence_header() */
- mb_width = (horizontal_size+15)/16;
- mb_height = (base.MPEG2_Flag && !progressive_sequence) ? 2*((vertical_size+31)/32)
- : (vertical_size+15)/16;
-
- Coded_Picture_Width = 16*mb_width;
- Coded_Picture_Height = 16*mb_height;
-
- /* ISO/IEC 13818-2 sections 6.1.1.8, 6.1.1.9, and 6.1.1.10 */
- Chroma_Width = (chroma_format==CHROMA444) ? Coded_Picture_Width
- : Coded_Picture_Width>>1;
- Chroma_Height = (chroma_format!=CHROMA420) ? Coded_Picture_Height
- : Coded_Picture_Height>>1;
-
- /* derived based on Table 6-20 in ISO/IEC 13818-2 section 6.3.17 */
- block_count = Table_6_20[chroma_format-1];
-
- for (cc=0; cc<3; cc++)
- {
- if (cc==0)
- size = Coded_Picture_Width*Coded_Picture_Height;
- else
- size = Chroma_Width*Chroma_Height;
-
- if (!(backward_reference_frame[cc] = (unsigned char *)malloc(size)))
- Error("backward_reference_frame[] malloc failed\n");
-
- if (!(forward_reference_frame[cc] = (unsigned char *)malloc(size)))
- Error("forward_reference_frame[] malloc failed\n");
-
- if (!(auxframe[cc] = (unsigned char *)malloc(size)))
- Error("auxframe[] malloc failed\n");
-
- if(Ersatz_Flag)
- if (!(substitute_frame[cc] = (unsigned char *)malloc(size)))
- Error("substitute_frame[] malloc failed\n");
-
-
- if (base.scalable_mode==SC_SPAT)
- {
- /* this assumes lower layer is 4:2:0 */
- if (!(llframe0[cc] = (unsigned char *)malloc((lower_layer_prediction_horizontal_size*lower_layer_prediction_vertical_size)/(cc?4:1))))
- Error("llframe0 malloc failed\n");
- if (!(llframe1[cc] = (unsigned char *)malloc((lower_layer_prediction_horizontal_size*lower_layer_prediction_vertical_size)/(cc?4:1))))
- Error("llframe1 malloc failed\n");
- }
- }
-
- /* SCALABILITY: Spatial */
- if (base.scalable_mode==SC_SPAT)
- {
- if (!(lltmp = (short *)malloc(lower_layer_prediction_horizontal_size*((lower_layer_prediction_vertical_size*vertical_subsampling_factor_n)/vertical_subsampling_factor_m)*sizeof(short))))
- Error("lltmp malloc failed\n");
- }
-
-#ifdef DISPLAY
- if (Output_Type==T_X11)
- {
- Initialize_Display_Process("");
- Initialize_Dither_Matrix();
- }
-#endif /* DISPLAY */
-
-}
-
-void Error(text)
-char *text;
-{
- cprintf(text);
-}
-
-/* Trace_Flag output */
-void Print_Bits(code,bits,len)
-int code,bits,len;
-{
- int i;
- for (i=0; i<len; i++)
- cprintf("%d",(code>>(bits-1-i))&1);
-}
-
-static int Headers()
-{
- int ret;
-
- ld = &base;
-
-
- /* return when end of sequence (0) or picture
- header has been parsed (1) */
-
- ret = Get_Hdr();
-
-
- if (Two_Streams)
- {
- ld = &enhan;
- if (Get_Hdr()!=ret && !Quiet_Flag)
- cprintf("streams out of sync\n");
- ld = &base;
- }
-
- return ret;
-}
-
-int Decode_Bitstream()
-{
- int ret;
- int Bitstream_Framenum;
-
- Bitstream_Framenum = 0;
-
- for(;;)
- {
-
-#ifdef VERIFY
- Clear_Verify_Headers();
-#endif /* VERIFY */
-
- ld->actual_file_ptr = ld->start_file_ptr;
-
- ret = Headers();
-
- if(ret==1)
- {
- ret = video_sequence(&Bitstream_Framenum);
- }
- else
- return(ret);
- }
-
-}
-
-
-static void Deinitialize_Sequence()
-{
- int i;
-
- /* clear flags */
- base.MPEG2_Flag=0;
-
- for(i=0;i<3;i++)
- {
- free(backward_reference_frame[i]);
- free(forward_reference_frame[i]);
- free(auxframe[i]);
-
- if (base.scalable_mode==SC_SPAT)
- {
- free(llframe0[i]);
- free(llframe1[i]);
- }
- }
-
- if (base.scalable_mode==SC_SPAT)
- free(lltmp);
-
-#ifdef DISPLAY
- if (Output_Type==T_X11)
- Terminate_Display_Process();
-#endif
-}
-
-
-static int video_sequence(Bitstream_Framenumber)
-int *Bitstream_Framenumber;
-{
- int Bitstream_Framenum;
- int Sequence_Framenum;
- int Return_Value;
-
- char tmp[100];
-
- Bitstream_Framenum = *Bitstream_Framenumber;
- Sequence_Framenum=0;
-
- Initialize_Sequence();
-
- /* decode picture whose header has already been parsed in
- Decode_Bitstream() */
-
- ld->px = 310+(rand()%(500-Coded_Picture_Width));
- ld->py = 100+(rand()%(400-Coded_Picture_Height));
-
- sprintf(tmp,"Wx = %3d Wy = %3d",Coded_Picture_Width,Coded_Picture_Height);
- grx_text(tmp,ld->px,ld->py-10,rgb16(255,255,255),0);
-
- Decode_Picture(Bitstream_Framenum, Sequence_Framenum);
-
- /* update picture numbers */
- if (!Second_Field)
- {
- Bitstream_Framenum++;
- Sequence_Framenum++;
- }
-
- fsf_schedule_next_timed_job(NULL, NULL, NULL, NULL, NULL);
-
- /* loop through the rest of the pictures in the sequence */
- while ((Return_Value=Headers()))
- {
- Decode_Picture(Bitstream_Framenum, Sequence_Framenum);
-
- if (!Second_Field)
- {
- Bitstream_Framenum++;
- Sequence_Framenum++;
- }
-
- fsf_schedule_next_timed_job(NULL, NULL, NULL, NULL, NULL);
-
- }
-
- /* put last frame */
- if (Sequence_Framenum!=0)
- {
- Output_Last_Frame_of_Sequence(Bitstream_Framenum);
- }
-
- Deinitialize_Sequence();
-
-#ifdef VERIFY
- Clear_Verify_Headers();
-#endif /* VERIFY */
-
- *Bitstream_Framenumber = Bitstream_Framenum;
- return(Return_Value);
-}
-
-
-
-static void Clear_Options()
-{
- Verbose_Flag = 0;
- Output_Type = 0;
- Output_Picture_Filename = " ";
- hiQdither = 0;
- Output_Type = 0;
- Frame_Store_Flag = 0;
- Spatial_Flag = 0;
- Lower_Layer_Picture_Filename = " ";
- Reference_IDCT_Flag = 0;
- Trace_Flag = 0;
- Quiet_Flag = 0;
- Ersatz_Flag = 0;
- Substitute_Picture_Filename = " ";
- Two_Streams = 0;
- Enhancement_Layer_Bitstream_Filename = " ";
- Big_Picture_Flag = 0;
- Main_Bitstream_Flag = 0;
- Main_Bitstream_Filename = " ";
- Verify_Flag = 0;
- Stats_Flag = 0;
- User_Data_Flag = 0;
-}
-
-
-#ifdef DEBUG
-static void Print_Options()
-{
-
- printf("Verbose_Flag = %d\n", Verbose_Flag);
- printf("Output_Type = %d\n", Output_Type);
- printf("Output_Picture_Filename = %s\n", Output_Picture_Filename);
- printf("hiQdither = %d\n", hiQdither);
- printf("Output_Type = %d\n", Output_Type);
- printf("Frame_Store_Flag = %d\n", Frame_Store_Flag);
- printf("Spatial_Flag = %d\n", Spatial_Flag);
- printf("Lower_Layer_Picture_Filename = %s\n", Lower_Layer_Picture_Filename);
- printf("Reference_IDCT_Flag = %d\n", Reference_IDCT_Flag);
- printf("Trace_Flag = %d\n", Trace_Flag);
- printf("Quiet_Flag = %d\n", Quiet_Flag);
- printf("Ersatz_Flag = %d\n", Ersatz_Flag);
- printf("Substitute_Picture_Filename = %s\n", Substitute_Picture_Filename);
- printf("Two_Streams = %d\n", Two_Streams);
- printf("Enhancement_Layer_Bitstream_Filename = %s\n", Enhancement_Layer_Bitstream_Filename);
- printf("Big_Picture_Flag = %d\n", Big_Picture_Flag);
- printf("Main_Bitstream_Flag = %d\n", Main_Bitstream_Flag);
- printf("Main_Bitstream_Filename = %s\n", Main_Bitstream_Filename);
- printf("Verify_Flag = %d\n", Verify_Flag);
- printf("Stats_Flag = %d\n", Stats_Flag);
- printf("User_Data_Flag = %d\n", User_Data_Flag);
-
-}
-#endif
Index: rel_1_21/fsf/mpeg2/getvlc.h
===================================================================
--- rel_1_21/fsf/mpeg2/getvlc.h (revision 1217)
+++ rel_1_21/fsf/mpeg2/getvlc.h (nonexistent)
@@ -1,491 +0,0 @@
-/* getvlc.h, variable length code tables */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-/* NOTE: #define constants such as MACROBLOCK_QUANT are upper case
- as per C programming convention. However, the MPEG document
- (ISO/IEC 13818-2) lists them in all lower case (e.g. Annex B) */
-
-/* NOTE: the VLC tables are in a flash format---a transformation
- of the tables in Annex B to a form more convenient towards
- parallel (more than one-bit-at-a-time) decoding */
-
-typedef struct {
- char val, len;
-} VLCtab;
-
-typedef struct {
- char run, level, len;
-} DCTtab;
-
-/* Table B-3, macroblock_type in P-pictures, codes 001..1xx */
-static VLCtab PMBtab0[8] = {
- {ERROR,0},
- {MACROBLOCK_MOTION_FORWARD,3},
- {MACROBLOCK_PATTERN,2}, {MACROBLOCK_PATTERN,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,1},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,1},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,1},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,1}
-};
-
-/* Table B-3, macroblock_type in P-pictures, codes 000001..00011x */
-static VLCtab PMBtab1[8] = {
- {ERROR,0},
- {MACROBLOCK_QUANT|MACROBLOCK_INTRA,6},
- {MACROBLOCK_QUANT|MACROBLOCK_PATTERN,5}, {MACROBLOCK_QUANT|MACROBLOCK_PATTERN,5},
- {MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,5}, {MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,5},
- {MACROBLOCK_INTRA,5}, {MACROBLOCK_INTRA,5}
-};
-
-/* Table B-4, macroblock_type in B-pictures, codes 0010..11xx */
-static VLCtab BMBtab0[16] = {
- {ERROR,0},
- {ERROR,0},
- {MACROBLOCK_MOTION_FORWARD,4},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,4},
- {MACROBLOCK_MOTION_BACKWARD,3},
- {MACROBLOCK_MOTION_BACKWARD,3},
- {MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,3},
- {MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,3},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,2}
-};
-
-/* Table B-4, macroblock_type in B-pictures, codes 000001..00011x */
-static VLCtab BMBtab1[8] = {
- {ERROR,0},
- {MACROBLOCK_QUANT|MACROBLOCK_INTRA,6},
- {MACROBLOCK_QUANT|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,6},
- {MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,6},
- {MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,5},
- {MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,5},
- {MACROBLOCK_INTRA,5},
- {MACROBLOCK_INTRA,5}
-};
-
-/* Table B-5, macroblock_type in spat. scal. I-pictures, codes 0001..1xxx */
-static VLCtab spIMBtab[16] = {
- {ERROR,0},
- {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS,4},
- {MACROBLOCK_QUANT|MACROBLOCK_INTRA,4},
- {MACROBLOCK_INTRA,4},
- {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS|MACROBLOCK_QUANT|MACROBLOCK_PATTERN,2}, {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS|MACROBLOCK_QUANT|MACROBLOCK_PATTERN,2},
- {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS|MACROBLOCK_QUANT|MACROBLOCK_PATTERN,2}, {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS|MACROBLOCK_QUANT|MACROBLOCK_PATTERN,2},
- {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS|MACROBLOCK_PATTERN,1}, {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS|MACROBLOCK_PATTERN,1},
- {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS|MACROBLOCK_PATTERN,1}, {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS|MACROBLOCK_PATTERN,1},
- {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS|MACROBLOCK_PATTERN,1}, {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS|MACROBLOCK_PATTERN,1},
- {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS|MACROBLOCK_PATTERN,1}, {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS|MACROBLOCK_PATTERN,1}
-};
-
-/* Table B-6, macroblock_type in spat. scal. P-pictures, codes 0010..11xx */
-static VLCtab spPMBtab0[16] =
-{
- {ERROR,0},
- {ERROR,0},
- {MACROBLOCK_MOTION_FORWARD,4},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_MOTION_FORWARD,4},
- {MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,3}, {MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,3},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,3}, {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,3},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,2},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,2},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,2},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,2},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,2}
-};
-
-/* Table B-6, macroblock_type in spat. scal. P-pictures, codes 0000010..000111x */
-static VLCtab spPMBtab1[16] = {
- {ERROR,0},
- {ERROR,0},
- {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS|MACROBLOCK_QUANT|MACROBLOCK_PATTERN,7},
- {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS,7},
- {MACROBLOCK_PATTERN,7},
- {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS|MACROBLOCK_PATTERN,7},
- {MACROBLOCK_QUANT|MACROBLOCK_INTRA,7},
- {MACROBLOCK_INTRA,7},
- {MACROBLOCK_QUANT|MACROBLOCK_PATTERN,6},
- {MACROBLOCK_QUANT|MACROBLOCK_PATTERN,6},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_QUANT|MACROBLOCK_PATTERN,6},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_QUANT|MACROBLOCK_PATTERN,6},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG,6},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG,6},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_PATTERN,6},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_PATTERN,6}
-};
-
-/* Table B-7, macroblock_type in spat. scal. B-pictures, codes 0010..11xx */
-static VLCtab spBMBtab0[14] = {
- {MACROBLOCK_MOTION_FORWARD,4},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,4},
- {MACROBLOCK_MOTION_BACKWARD,3},
- {MACROBLOCK_MOTION_BACKWARD,3},
- {MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,3},
- {MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,3},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,2},
- {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,2}
-};
-
-/* Table B-7, macroblock_type in spat. scal. B-pictures, codes 0000100..000111x */
-static VLCtab spBMBtab1[12] = {
- {MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,7},
- {MACROBLOCK_QUANT|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,7},
- {MACROBLOCK_INTRA,7},
- {MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,7},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_MOTION_FORWARD,6},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_MOTION_FORWARD,6},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,6},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,6},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_MOTION_BACKWARD,6},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_MOTION_BACKWARD,6},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,6},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,6}
-};
-
-/* Table B-7, macroblock_type in spat. scal. B-pictures, codes 00000100x..000001111 */
-static VLCtab spBMBtab2[8] = {
- {MACROBLOCK_QUANT|MACROBLOCK_INTRA,8},
- {MACROBLOCK_QUANT|MACROBLOCK_INTRA,8},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,8},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,8},
- {SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG|MACROBLOCK_QUANT|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,9},
- {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS|MACROBLOCK_QUANT|MACROBLOCK_PATTERN,9},
- {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS,9},
- {PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS|MACROBLOCK_PATTERN,9}
-};
-
-/* Table B-8, macroblock_type in spat. scal. B-pictures, codes 001..1xx */
-static VLCtab SNRMBtab[8] = {
- {ERROR,0},
- {0,3},
- {MACROBLOCK_QUANT|MACROBLOCK_PATTERN,2},
- {MACROBLOCK_QUANT|MACROBLOCK_PATTERN,2},
- {MACROBLOCK_PATTERN,1},
- {MACROBLOCK_PATTERN,1},
- {MACROBLOCK_PATTERN,1},
- {MACROBLOCK_PATTERN,1}
-};
-
-/* Table B-10, motion_code, codes 0001 ... 01xx */
-static VLCtab MVtab0[8] =
-{ {ERROR,0}, {3,3}, {2,2}, {2,2}, {1,1}, {1,1}, {1,1}, {1,1}
-};
-
-/* Table B-10, motion_code, codes 0000011 ... 000011x */
-static VLCtab MVtab1[8] =
-{ {ERROR,0}, {ERROR,0}, {ERROR,0}, {7,6}, {6,6}, {5,6}, {4,5}, {4,5}
-};
-
-/* Table B-10, motion_code, codes 0000001100 ... 000001011x */
-static VLCtab MVtab2[12] =
-{ {16,9}, {15,9}, {14,9}, {13,9},
- {12,9}, {11,9}, {10,8}, {10,8},
- {9,8}, {9,8}, {8,8}, {8,8}
-};
-
-/* Table B-9, coded_block_pattern, codes 01000 ... 111xx */
-static VLCtab CBPtab0[32] =
-{ {ERROR,0}, {ERROR,0}, {ERROR,0}, {ERROR,0},
- {ERROR,0}, {ERROR,0}, {ERROR,0}, {ERROR,0},
- {62,5}, {2,5}, {61,5}, {1,5}, {56,5}, {52,5}, {44,5}, {28,5},
- {40,5}, {20,5}, {48,5}, {12,5}, {32,4}, {32,4}, {16,4}, {16,4},
- {8,4}, {8,4}, {4,4}, {4,4}, {60,3}, {60,3}, {60,3}, {60,3}
-};
-
-/* Table B-9, coded_block_pattern, codes 00000100 ... 001111xx */
-static VLCtab CBPtab1[64] =
-{ {ERROR,0}, {ERROR,0}, {ERROR,0}, {ERROR,0},
- {58,8}, {54,8}, {46,8}, {30,8},
- {57,8}, {53,8}, {45,8}, {29,8}, {38,8}, {26,8}, {37,8}, {25,8},
- {43,8}, {23,8}, {51,8}, {15,8}, {42,8}, {22,8}, {50,8}, {14,8},
- {41,8}, {21,8}, {49,8}, {13,8}, {35,8}, {19,8}, {11,8}, {7,8},
- {34,7}, {34,7}, {18,7}, {18,7}, {10,7}, {10,7}, {6,7}, {6,7},
- {33,7}, {33,7}, {17,7}, {17,7}, {9,7}, {9,7}, {5,7}, {5,7},
- {63,6}, {63,6}, {63,6}, {63,6}, {3,6}, {3,6}, {3,6}, {3,6},
- {36,6}, {36,6}, {36,6}, {36,6}, {24,6}, {24,6}, {24,6}, {24,6}
-};
-
-/* Table B-9, coded_block_pattern, codes 000000001 ... 000000111 */
-static VLCtab CBPtab2[8] =
-{ {ERROR,0}, {0,9}, {39,9}, {27,9}, {59,9}, {55,9}, {47,9}, {31,9}
-};
-
-/* Table B-1, macroblock_address_increment, codes 00010 ... 011xx */
-static VLCtab MBAtab1[16] =
-{ {ERROR,0}, {ERROR,0}, {7,5}, {6,5}, {5,4}, {5,4}, {4,4}, {4,4},
- {3,3}, {3,3}, {3,3}, {3,3}, {2,3}, {2,3}, {2,3}, {2,3}
-};
-
-/* Table B-1, macroblock_address_increment, codes 00000011000 ... 0000111xxxx */
-static VLCtab MBAtab2[104] =
-{
- {33,11}, {32,11}, {31,11}, {30,11}, {29,11}, {28,11}, {27,11}, {26,11},
- {25,11}, {24,11}, {23,11}, {22,11}, {21,10}, {21,10}, {20,10}, {20,10},
- {19,10}, {19,10}, {18,10}, {18,10}, {17,10}, {17,10}, {16,10}, {16,10},
- {15,8}, {15,8}, {15,8}, {15,8}, {15,8}, {15,8}, {15,8}, {15,8},
- {14,8}, {14,8}, {14,8}, {14,8}, {14,8}, {14,8}, {14,8}, {14,8},
- {13,8}, {13,8}, {13,8}, {13,8}, {13,8}, {13,8}, {13,8}, {13,8},
- {12,8}, {12,8}, {12,8}, {12,8}, {12,8}, {12,8}, {12,8}, {12,8},
- {11,8}, {11,8}, {11,8}, {11,8}, {11,8}, {11,8}, {11,8}, {11,8},
- {10,8}, {10,8}, {10,8}, {10,8}, {10,8}, {10,8}, {10,8}, {10,8},
- {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7},
- {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7},
- {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7},
- {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7}
-};
-
-/* Table B-12, dct_dc_size_luminance, codes 00xxx ... 11110 */
-static VLCtab DClumtab0[32] =
-{ {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2},
- {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2},
- {0, 3}, {0, 3}, {0, 3}, {0, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3},
- {4, 3}, {4, 3}, {4, 3}, {4, 3}, {5, 4}, {5, 4}, {6, 5}, {ERROR, 0}
-};
-
-/* Table B-12, dct_dc_size_luminance, codes 111110xxx ... 111111111 */
-static VLCtab DClumtab1[16] =
-{ {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6},
- {8, 7}, {8, 7}, {8, 7}, {8, 7}, {9, 8}, {9, 8}, {10,9}, {11,9}
-};
-
-/* Table B-13, dct_dc_size_chrominance, codes 00xxx ... 11110 */
-static VLCtab DCchromtab0[32] =
-{ {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2},
- {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2},
- {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2},
- {3, 3}, {3, 3}, {3, 3}, {3, 3}, {4, 4}, {4, 4}, {5, 5}, {ERROR, 0}
-};
-
-/* Table B-13, dct_dc_size_chrominance, codes 111110xxxx ... 1111111111 */
-static VLCtab DCchromtab1[32] =
-{ {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6},
- {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6},
- {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7},
- {8, 8}, {8, 8}, {8, 8}, {8, 8}, {9, 9}, {9, 9}, {10,10}, {11,10}
-};
-
-/* Table B-14, DCT coefficients table zero,
- * codes 0100 ... 1xxx (used for first (DC) coefficient)
- */
-DCTtab DCTtabfirst[12] =
-{
- {0,2,4}, {2,1,4}, {1,1,3}, {1,1,3},
- {0,1,1}, {0,1,1}, {0,1,1}, {0,1,1},
- {0,1,1}, {0,1,1}, {0,1,1}, {0,1,1}
-};
-
-/* Table B-14, DCT coefficients table zero,
- * codes 0100 ... 1xxx (used for all other coefficients)
- */
-DCTtab DCTtabnext[12] =
-{
- {0,2,4}, {2,1,4}, {1,1,3}, {1,1,3},
- {64,0,2}, {64,0,2}, {64,0,2}, {64,0,2}, /* EOB */
- {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2}
-};
-
-/* Table B-14, DCT coefficients table zero,
- * codes 000001xx ... 00111xxx
- */
-DCTtab DCTtab0[60] =
-{
- {65,0,6}, {65,0,6}, {65,0,6}, {65,0,6}, /* Escape */
- {2,2,7}, {2,2,7}, {9,1,7}, {9,1,7},
- {0,4,7}, {0,4,7}, {8,1,7}, {8,1,7},
- {7,1,6}, {7,1,6}, {7,1,6}, {7,1,6},
- {6,1,6}, {6,1,6}, {6,1,6}, {6,1,6},
- {1,2,6}, {1,2,6}, {1,2,6}, {1,2,6},
- {5,1,6}, {5,1,6}, {5,1,6}, {5,1,6},
- {13,1,8}, {0,6,8}, {12,1,8}, {11,1,8},
- {3,2,8}, {1,3,8}, {0,5,8}, {10,1,8},
- {0,3,5}, {0,3,5}, {0,3,5}, {0,3,5},
- {0,3,5}, {0,3,5}, {0,3,5}, {0,3,5},
- {4,1,5}, {4,1,5}, {4,1,5}, {4,1,5},
- {4,1,5}, {4,1,5}, {4,1,5}, {4,1,5},
- {3,1,5}, {3,1,5}, {3,1,5}, {3,1,5},
- {3,1,5}, {3,1,5}, {3,1,5}, {3,1,5}
-};
-
-/* Table B-15, DCT coefficients table one,
- * codes 000001xx ... 11111111
-*/
-DCTtab DCTtab0a[252] =
-{
- {65,0,6}, {65,0,6}, {65,0,6}, {65,0,6}, /* Escape */
- {7,1,7}, {7,1,7}, {8,1,7}, {8,1,7},
- {6,1,7}, {6,1,7}, {2,2,7}, {2,2,7},
- {0,7,6}, {0,7,6}, {0,7,6}, {0,7,6},
- {0,6,6}, {0,6,6}, {0,6,6}, {0,6,6},
- {4,1,6}, {4,1,6}, {4,1,6}, {4,1,6},
- {5,1,6}, {5,1,6}, {5,1,6}, {5,1,6},
- {1,5,8}, {11,1,8}, {0,11,8}, {0,10,8},
- {13,1,8}, {12,1,8}, {3,2,8}, {1,4,8},
- {2,1,5}, {2,1,5}, {2,1,5}, {2,1,5},
- {2,1,5}, {2,1,5}, {2,1,5}, {2,1,5},
- {1,2,5}, {1,2,5}, {1,2,5}, {1,2,5},
- {1,2,5}, {1,2,5}, {1,2,5}, {1,2,5},
- {3,1,5}, {3,1,5}, {3,1,5}, {3,1,5},
- {3,1,5}, {3,1,5}, {3,1,5}, {3,1,5},
- {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
- {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
- {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
- {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
- {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
- {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
- {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
- {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
- {64,0,4}, {64,0,4}, {64,0,4}, {64,0,4}, /* EOB */
- {64,0,4}, {64,0,4}, {64,0,4}, {64,0,4},
- {64,0,4}, {64,0,4}, {64,0,4}, {64,0,4},
- {64,0,4}, {64,0,4}, {64,0,4}, {64,0,4},
- {0,3,4}, {0,3,4}, {0,3,4}, {0,3,4},
- {0,3,4}, {0,3,4}, {0,3,4}, {0,3,4},
- {0,3,4}, {0,3,4}, {0,3,4}, {0,3,4},
- {0,3,4}, {0,3,4}, {0,3,4}, {0,3,4},
- {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
- {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
- {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
- {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
- {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
- {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
- {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
- {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
- {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
- {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
- {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
- {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
- {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
- {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
- {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
- {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
- {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
- {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
- {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
- {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
- {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
- {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
- {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
- {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
- {0,4,5}, {0,4,5}, {0,4,5}, {0,4,5},
- {0,4,5}, {0,4,5}, {0,4,5}, {0,4,5},
- {0,5,5}, {0,5,5}, {0,5,5}, {0,5,5},
- {0,5,5}, {0,5,5}, {0,5,5}, {0,5,5},
- {9,1,7}, {9,1,7}, {1,3,7}, {1,3,7},
- {10,1,7}, {10,1,7}, {0,8,7}, {0,8,7},
- {0,9,7}, {0,9,7}, {0,12,8}, {0,13,8},
- {2,3,8}, {4,2,8}, {0,14,8}, {0,15,8}
-};
-
-/* Table B-14, DCT coefficients table zero,
- * codes 0000001000 ... 0000001111
- */
-DCTtab DCTtab1[8] =
-{
- {16,1,10}, {5,2,10}, {0,7,10}, {2,3,10},
- {1,4,10}, {15,1,10}, {14,1,10}, {4,2,10}
-};
-
-/* Table B-15, DCT coefficients table one,
- * codes 000000100x ... 000000111x
- */
-DCTtab DCTtab1a[8] =
-{
- {5,2,9}, {5,2,9}, {14,1,9}, {14,1,9},
- {2,4,10}, {16,1,10}, {15,1,9}, {15,1,9}
-};
-
-/* Table B-14/15, DCT coefficients table zero / one,
- * codes 000000010000 ... 000000011111
- */
-DCTtab DCTtab2[16] =
-{
- {0,11,12}, {8,2,12}, {4,3,12}, {0,10,12},
- {2,4,12}, {7,2,12}, {21,1,12}, {20,1,12},
- {0,9,12}, {19,1,12}, {18,1,12}, {1,5,12},
- {3,3,12}, {0,8,12}, {6,2,12}, {17,1,12}
-};
-
-/* Table B-14/15, DCT coefficients table zero / one,
- * codes 0000000010000 ... 0000000011111
- */
-DCTtab DCTtab3[16] =
-{
- {10,2,13}, {9,2,13}, {5,3,13}, {3,4,13},
- {2,5,13}, {1,7,13}, {1,6,13}, {0,15,13},
- {0,14,13}, {0,13,13}, {0,12,13}, {26,1,13},
- {25,1,13}, {24,1,13}, {23,1,13}, {22,1,13}
-};
-
-/* Table B-14/15, DCT coefficients table zero / one,
- * codes 00000000010000 ... 00000000011111
- */
-DCTtab DCTtab4[16] =
-{
- {0,31,14}, {0,30,14}, {0,29,14}, {0,28,14},
- {0,27,14}, {0,26,14}, {0,25,14}, {0,24,14},
- {0,23,14}, {0,22,14}, {0,21,14}, {0,20,14},
- {0,19,14}, {0,18,14}, {0,17,14}, {0,16,14}
-};
-
-/* Table B-14/15, DCT coefficients table zero / one,
- * codes 000000000010000 ... 000000000011111
- */
-DCTtab DCTtab5[16] =
-{
- {0,40,15}, {0,39,15}, {0,38,15}, {0,37,15},
- {0,36,15}, {0,35,15}, {0,34,15}, {0,33,15},
- {0,32,15}, {1,14,15}, {1,13,15}, {1,12,15},
- {1,11,15}, {1,10,15}, {1,9,15}, {1,8,15}
-};
-
-/* Table B-14/15, DCT coefficients table zero / one,
- * codes 0000000000010000 ... 0000000000011111
- */
-DCTtab DCTtab6[16] =
-{
- {1,18,16}, {1,17,16}, {1,16,16}, {1,15,16},
- {6,3,16}, {16,2,16}, {15,2,16}, {14,2,16},
- {13,2,16}, {12,2,16}, {11,2,16}, {31,1,16},
- {30,1,16}, {29,1,16}, {28,1,16}, {27,1,16}
-};
-
Index: rel_1_21/fsf/mpeg2/const.h
===================================================================
--- rel_1_21/fsf/mpeg2/const.h (revision 1217)
+++ rel_1_21/fsf/mpeg2/const.h (nonexistent)
@@ -1,141 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-
-/**
- ------------
- CVS : $Id: const.h,v 1.1 2003-09-11 13:55:59 giacomo Exp $
-
- File: $File$
- Revision: $Revision: 1.1 $
- Last update: $Date: 2003-09-11 13:55:59 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Marco Dallera and Marco Fiocca
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * AUTO
- *
- * Another Unuseful Track simulatOr
- *
- * Authors: Marco Dallera
- * Marco Fiocca
- *
- */
-
-/* ------------------ */
-/* Useful constants */
-/* ------------------ */
-
-#ifndef __CONST_H_
-
-#define __CONST_H_
-
-/* Screen dimensions */
-#define SCREEN_WIDTH 800
-#define SCREEN_HEIGHT 600
-#define SCREEN_BIT_COLORS 8
-
-/* Visible area */
-#define TEL_WIDTH 50
-#define TEL_HEIGHT 50
-
-/* Car dimensions */
-#define CAR_WIDTH 12
-#define CAR_HEIGHT 12
-#define CAR_W 8
-#define CAR_H 10
-
-/* Track dimensions */
-#define TRACK_WIDTH 500
-#define TRACK_HEIGHT 500
-
-/* Track position */
-#define TRACK_X1 0
-#define TRACK_Y1 0
-#define TRACK_X2 TRACK_X1+TRACK_WIDTH-1
-#define TRACK_Y2 TRACK_Y1+TRACK_HEIGHT-1
-
-/* Max number of car on track */
-#define MAX_CAR_NUMBER 10
-#define DRIVERS_NUMBER 20
-#define MAX_DRIVER_NAME_LENGTH 20
-#define MAX_TRACK_NAME_LENGTH 20
-#define TRACK_NUMBER 4
-
-/* Lap direction */
-#define CLOCK 0
-#define ANTICLOCK 1
-
-/* Information display coords */
-#define CMD_WIDTH TRACK_WIDTH
-#define CMD_HEIGHT (SCREEN_HEIGHT-TRACK_HEIGHT-3)
-
-/* Car position limits */
-#define MIN_CAR_X (TRACK_X1 + CAR_WIDTH/2 + 4)
-#define MIN_CAR_Y (TRACK_Y1 + CAR_HEIGHT/2 + 4)
-#define MAX_CAR_X (TRACK_X2 - CAR_WIDTH/2 - 4)
-#define MAX_CAR_Y (TRACK_Y2 - CAR_HEIGHT/2 - 4)
-
-/* Road constants */
-#define LEFT_ONLY 10
-#define RIGHT_ONLY 11
-#define ROAD_OK 12
-#define NO_ROAD 13
-
-/* Collision constants */
-#define COLLISION_LEFT 20
-#define COLLISION_RIGHT 21
-#define COLLISION_BACK 22
-#define NO_COLL 0
-
-/* CAB constants */
-#define ROAD_MSG_DIM sizeof(road_info)
-#define ROAD_MSG_READER 4
-
-#define CAR_MSG_DIM sizeof(car_status)
-#define CAR_MSG_READER 5
-
-/* Tasks parameters */
-#define SENSOR_WCET 3000
-#define SENSOR_PERIOD 40000
-#define CONTROL_WCET 1000
-#define CONTROL_PERIOD 40000
-
-#endif
-
Index: rel_1_21/fsf/mpeg2/mpeg2dec.h
===================================================================
--- rel_1_21/fsf/mpeg2/mpeg2dec.h (revision 1217)
+++ rel_1_21/fsf/mpeg2/mpeg2dec.h (nonexistent)
@@ -1,129 +0,0 @@
-/* mpeg2dec.h, MPEG specific defines */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#define ERROR (-1)
-
-#define PICTURE_START_CODE 0x100
-#define SLICE_START_CODE_MIN 0x101
-#define SLICE_START_CODE_MAX 0x1AF
-#define USER_DATA_START_CODE 0x1B2
-#define SEQUENCE_HEADER_CODE 0x1B3
-#define SEQUENCE_ERROR_CODE 0x1B4
-#define EXTENSION_START_CODE 0x1B5
-#define SEQUENCE_END_CODE 0x1B7
-#define GROUP_START_CODE 0x1B8
-#define SYSTEM_START_CODE_MIN 0x1B9
-#define SYSTEM_START_CODE_MAX 0x1FF
-
-#define ISO_END_CODE 0x1B9
-#define PACK_START_CODE 0x1BA
-#define SYSTEM_START_CODE 0x1BB
-
-#define VIDEO_ELEMENTARY_STREAM 0x1e0
-
-/* scalable_mode */
-#define SC_NONE 0
-#define SC_DP 1
-#define SC_SPAT 2
-#define SC_SNR 3
-#define SC_TEMP 4
-
-/* picture coding type */
-#define I_TYPE 1
-#define P_TYPE 2
-#define B_TYPE 3
-#define D_TYPE 4
-
-/* picture structure */
-#define TOP_FIELD 1
-#define BOTTOM_FIELD 2
-#define FRAME_PICTURE 3
-
-/* macroblock type */
-#define MACROBLOCK_INTRA 1
-#define MACROBLOCK_PATTERN 2
-#define MACROBLOCK_MOTION_BACKWARD 4
-#define MACROBLOCK_MOTION_FORWARD 8
-#define MACROBLOCK_QUANT 16
-#define SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG 32
-#define PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS 64
-
-
-/* motion_type */
-#define MC_FIELD 1
-#define MC_FRAME 2
-#define MC_16X8 2
-#define MC_DMV 3
-
-/* mv_format */
-#define MV_FIELD 0
-#define MV_FRAME 1
-
-/* chroma_format */
-#define CHROMA420 1
-#define CHROMA422 2
-#define CHROMA444 3
-
-/* extension start code IDs */
-
-#define SEQUENCE_EXTENSION_ID 1
-#define SEQUENCE_DISPLAY_EXTENSION_ID 2
-#define QUANT_MATRIX_EXTENSION_ID 3
-#define COPYRIGHT_EXTENSION_ID 4
-#define SEQUENCE_SCALABLE_EXTENSION_ID 5
-#define PICTURE_DISPLAY_EXTENSION_ID 7
-#define PICTURE_CODING_EXTENSION_ID 8
-#define PICTURE_SPATIAL_SCALABLE_EXTENSION_ID 9
-#define PICTURE_TEMPORAL_SCALABLE_EXTENSION_ID 10
-
-#define ZIG_ZAG 0
-
-#define PROFILE_422 (128+5)
-#define MAIN_LEVEL 8
-
-/* Layers: used by Verbose_Flag, Verifier_Flag, Stats_Flag, and Trace_Flag */
-#define NO_LAYER 0
-#define SEQUENCE_LAYER 1
-#define PICTURE_LAYER 2
-#define SLICE_LAYER 3
-#define MACROBLOCK_LAYER 4
-#define BLOCK_LAYER 5
-#define EVENT_LAYER 6
-#define ALL_LAYERS 7
-
-
-
-#define FILENAME_LENGTH 256
-
-
-
-
-#define MB_WEIGHT 32
-#define MB_CLASS4 64
-
Index: rel_1_21/fsf/mpeg2/store.c
===================================================================
--- rel_1_21/fsf/mpeg2/store.c (revision 1217)
+++ rel_1_21/fsf/mpeg2/store.c (nonexistent)
@@ -1,319 +0,0 @@
-/* store.c, picture output routines */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include <stdlib.h>
-
-#include "drivers/glib.h"
-
-#include "config.h"
-#include "global.h"
-
-extern DWORD flbaddr;
-
-static void conv422to444 _ANSI_ARGS_((unsigned char *src, unsigned char *dst));
-static void conv420to422 _ANSI_ARGS_((unsigned char *src, unsigned char *dst));
-
-__inline__ WORD down32to16(unsigned char r, unsigned char g, unsigned char b)
-{
- return ((b&0xf8)>>3)|((g&0xfc)<<3)|((r&0xf8)<<8);
-}
-
-void Write_Frame _ANSI_ARGS_((unsigned char *src[], int frame))
-{
- int i, j;
- int y, u, v, r, g, b;
-// int rm=0,gm=0,bm=0;
- int crv, cbu, cgu, cgv;
- unsigned char *py, *pu, *pv;
- int height, width, incr;
- static unsigned char *u422, *v422, *u444, *v444;
-
- incr = width = Coded_Picture_Width ;
- height = Coded_Picture_Height;
-
- if (chroma_format==CHROMA444)
- {
- u444 = src[1];
- v444 = src[2];
- }
- else
- {
- if (!u444)
- {
- if (chroma_format==CHROMA420)
- {
- if (!(u422 = (unsigned char *)malloc((Coded_Picture_Width>>1)
- *Coded_Picture_Height)))
- Error("malloc failed");
- if (!(v422 = (unsigned char *)malloc((Coded_Picture_Width>>1)
- *Coded_Picture_Height)))
- Error("malloc failed");
- }
-
- if (!(u444 = (unsigned char *)malloc(Coded_Picture_Width
- *Coded_Picture_Height)))
- Error("malloc failed");
-
- if (!(v444 = (unsigned char *)malloc(Coded_Picture_Width
- *Coded_Picture_Height)))
- Error("malloc failed");
- }
-
- if (chroma_format==CHROMA420)
- {
- conv420to422(src[1],u422);
- conv420to422(src[2],v422);
- conv422to444(u422,u444);
- conv422to444(v422,v444);
- }
- else
- {
- conv422to444(src[1],u444);
- conv422to444(src[2],v444);
- }
- }
-
- /* matrix coefficients */
- crv = Inverse_Table_6_9[matrix_coefficients][0];
- cbu = Inverse_Table_6_9[matrix_coefficients][1];
- cgu = Inverse_Table_6_9[matrix_coefficients][2];
- cgv = Inverse_Table_6_9[matrix_coefficients][3];
-
- for (i=0; i<height; i++)
- {
- py = src[0] + incr*i;
- pu = u444 + incr*i;
- pv = v444 + incr*i;
-
- for (j=0; j<width; j++)
- {
- u = *pu++ - 128;
- v = *pv++ - 128;
- y = 76309 * (*py++ - 16); /* (255/219)*65536 */
-
- r = Clip[(y + crv*v + 32768)>>16];
- g = Clip[(y - cgu*u - cgv*v + 32768)>>16];
- b = Clip[(y + cbu*u + 32786)>>16];
-
- *(WORD *)(flbaddr+((i+ld->py)*800+(j+ld->px))*2) = down32to16(r,g,b);
-
- }
- }
-
-}
-
-/*
-void Display_Image(Dithered_Image)
-unsigned char *Dithered_Image;
-{
- / * display dithered image */
-//}
-
-
-/* horizontal 1:2 interpolation filter */
-static void conv422to444(src,dst)
-unsigned char *src,*dst;
-{
- int i, i2, w, j, im3, im2, im1, ip1, ip2, ip3;
-
- w = Coded_Picture_Width>>1;
-
- if (base.MPEG2_Flag)
- {
- for (j=0; j<Coded_Picture_Height; j++)
- {
- for (i=0; i<w; i++)
- {
- i2 = i<<1;
- im2 = (i<2) ? 0 : i-2;
- im1 = (i<1) ? 0 : i-1;
- ip1 = (i<w-1) ? i+1 : w-1;
- ip2 = (i<w-2) ? i+2 : w-1;
- ip3 = (i<w-3) ? i+3 : w-1;
-
- /* FIR filter coefficients (*256): 21 0 -52 0 159 256 159 0 -52 0 21 */
- /* even samples (0 0 256 0 0) */
- dst[i2] = src[i];
-
- /* odd samples (21 -52 159 159 -52 21) */
- dst[i2+1] = Clip[(int)(21*(src[im2]+src[ip3])
- -52*(src[im1]+src[ip2])
- +159*(src[i]+src[ip1])+128)>>8];
- }
- src+= w;
- dst+= Coded_Picture_Width;
- }
- }
- else
- {
- for (j=0; j<Coded_Picture_Height; j++)
- {
- for (i=0; i<w; i++)
- {
-
- i2 = i<<1;
- im3 = (i<3) ? 0 : i-3;
- im2 = (i<2) ? 0 : i-2;
- im1 = (i<1) ? 0 : i-1;
- ip1 = (i<w-1) ? i+1 : w-1;
- ip2 = (i<w-2) ? i+2 : w-1;
- ip3 = (i<w-3) ? i+3 : w-1;
-
- /* FIR filter coefficients (*256): 5 -21 70 228 -37 11 */
- dst[i2] = Clip[(int)( 5*src[im3]
- -21*src[im2]
- +70*src[im1]
- +228*src[i]
- -37*src[ip1]
- +11*src[ip2]+128)>>8];
-
- dst[i2+1] = Clip[(int)( 5*src[ip3]
- -21*src[ip2]
- +70*src[ip1]
- +228*src[i]
- -37*src[im1]
- +11*src[im2]+128)>>8];
- }
- src+= w;
- dst+= Coded_Picture_Width;
- }
- }
-}
-
-/* vertical 1:2 interpolation filter */
-static void conv420to422(src,dst)
-unsigned char *src,*dst;
-{
- int w, h, i, j, j2;
- int jm6, jm5, jm4, jm3, jm2, jm1, jp1, jp2, jp3, jp4, jp5, jp6, jp7;
-
- w = Coded_Picture_Width>>1;
- h = Coded_Picture_Height>>1;
-
- if (progressive_frame)
- {
- /* intra frame */
- for (i=0; i<w; i++)
- {
- for (j=0; j<h; j++)
- {
- j2 = j<<1;
- jm3 = (j<3) ? 0 : j-3;
- jm2 = (j<2) ? 0 : j-2;
- jm1 = (j<1) ? 0 : j-1;
- jp1 = (j<h-1) ? j+1 : h-1;
- jp2 = (j<h-2) ? j+2 : h-1;
- jp3 = (j<h-3) ? j+3 : h-1;
-
- /* FIR filter coefficients (*256): 5 -21 70 228 -37 11 */
- /* New FIR filter coefficients (*256): 3 -16 67 227 -32 7 */
- dst[w*j2] = Clip[(int)( 3*src[w*jm3]
- -16*src[w*jm2]
- +67*src[w*jm1]
- +227*src[w*j]
- -32*src[w*jp1]
- +7*src[w*jp2]+128)>>8];
-
- dst[w*(j2+1)] = Clip[(int)( 3*src[w*jp3]
- -16*src[w*jp2]
- +67*src[w*jp1]
- +227*src[w*j]
- -32*src[w*jm1]
- +7*src[w*jm2]+128)>>8];
- }
- src++;
- dst++;
- }
- }
- else
- {
- /* intra field */
- for (i=0; i<w; i++)
- {
- for (j=0; j<h; j+=2)
- {
- j2 = j<<1;
-
- /* top field */
- jm6 = (j<6) ? 0 : j-6;
- jm4 = (j<4) ? 0 : j-4;
- jm2 = (j<2) ? 0 : j-2;
- jp2 = (j<h-2) ? j+2 : h-2;
- jp4 = (j<h-4) ? j+4 : h-2;
- jp6 = (j<h-6) ? j+6 : h-2;
-
- /* Polyphase FIR filter coefficients (*256): 2 -10 35 242 -18 5 */
- /* New polyphase FIR filter coefficients (*256): 1 -7 30 248 -21 5 */
- dst[w*j2] = Clip[(int)( 1*src[w*jm6]
- -7*src[w*jm4]
- +30*src[w*jm2]
- +248*src[w*j]
- -21*src[w*jp2]
- +5*src[w*jp4]+128)>>8];
-
- /* Polyphase FIR filter coefficients (*256): 11 -38 192 113 -30 8 */
- /* New polyphase FIR filter coefficients (*256):7 -35 194 110 -24 4 */
- dst[w*(j2+2)] = Clip[(int)( 7*src[w*jm4]
- -35*src[w*jm2]
- +194*src[w*j]
- +110*src[w*jp2]
- -24*src[w*jp4]
- +4*src[w*jp6]+128)>>8];
-
- /* bottom field */
- jm5 = (j<5) ? 1 : j-5;
- jm3 = (j<3) ? 1 : j-3;
- jm1 = (j<1) ? 1 : j-1;
- jp1 = (j<h-1) ? j+1 : h-1;
- jp3 = (j<h-3) ? j+3 : h-1;
- jp5 = (j<h-5) ? j+5 : h-1;
- jp7 = (j<h-7) ? j+7 : h-1;
-
- /* Polyphase FIR filter coefficients (*256): 11 -38 192 113 -30 8 */
- /* New polyphase FIR filter coefficients (*256):7 -35 194 110 -24 4 */
- dst[w*(j2+1)] = Clip[(int)( 7*src[w*jp5]
- -35*src[w*jp3]
- +194*src[w*jp1]
- +110*src[w*jm1]
- -24*src[w*jm3]
- +4*src[w*jm5]+128)>>8];
-
- dst[w*(j2+3)] = Clip[(int)( 1*src[w*jp7]
- -7*src[w*jp5]
- +30*src[w*jp3]
- +248*src[w*jp1]
- -21*src[w*jm1]
- +5*src[w*jm3]+128)>>8];
- }
- src++;
- dst++;
- }
- }
-}
-
Index: rel_1_21/fsf/mpeg2/getbits.c
===================================================================
--- rel_1_21/fsf/mpeg2/getbits.c (revision 1217)
+++ rel_1_21/fsf/mpeg2/getbits.c (nonexistent)
@@ -1,217 +0,0 @@
-/* getbits.c, bit level routines */
-
-/*
- * All modifications (mpeg2decode -> mpeg2play) are
- * Copyright (C) 1996, Stefan Eckart. All Rights Reserved.
- */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include <stdlib.h>
-
-#include "drivers/glib.h"
-
-#include "config.h"
-#include "global.h"
-
-/* initialize buffer, call once before first getbits or showbits */
-
-void Initialize_Buffer()
-{
- ld->Incnt = 0;
- ld->Rdptr = ld->Rdbfr + 2048;
- ld->Rdmax = ld->Rdptr;
-
-#ifdef VERIFY
- /* only the verifier uses this particular bit counter
- * Bitcnt keeps track of the current parser position with respect
- * to the video elementary stream being decoded, regardless
- * of whether or not it is wrapped within a systems layer stream
- */
- ld->Bitcnt = 0;
-#endif
-
- ld->Bfr = 0;
- Flush_Buffer(0); /* fills valid data into bfr */
-}
-
-int read(int Infile, void *Rdbfr, int rdsize) {
-
- if (ld->actual_file_ptr + 2048 > ld->end_file_ptr)
- rdsize = (int)(ld->end_file_ptr - ld->actual_file_ptr);
-
- if (rdsize < 0) return 0;
-
- memcpy(Rdbfr,ld->actual_file_ptr,rdsize);
- ld->actual_file_ptr += rdsize;
-
- return rdsize;
-
-}
-
-void Fill_Buffer()
-{
- int Buffer_Level;
-
- Buffer_Level = read(ld->Infile,ld->Rdbfr,2048);
- ld->Rdptr = ld->Rdbfr;
-
- if (System_Stream_Flag)
- ld->Rdmax -= 2048;
-
-
- /* end of the bitstream file */
- if (Buffer_Level < 2048)
- {
- /* just to be safe */
- if (Buffer_Level < 0)
- Buffer_Level = 0;
-
- /* pad until the next to the next 32-bit word boundary */
- while (Buffer_Level & 3)
- ld->Rdbfr[Buffer_Level++] = 0;
-
- /* pad the buffer with sequence end codes */
- while (Buffer_Level < 2048)
- {
- ld->Rdbfr[Buffer_Level++] = SEQUENCE_END_CODE>>24;
- ld->Rdbfr[Buffer_Level++] = SEQUENCE_END_CODE>>16;
- ld->Rdbfr[Buffer_Level++] = SEQUENCE_END_CODE>>8;
- ld->Rdbfr[Buffer_Level++] = SEQUENCE_END_CODE&0xff;
- }
- }
-}
-
-
-/* MPEG-1 system layer demultiplexer */
-
-int Get_Byte()
-{
- while(ld->Rdptr >= ld->Rdbfr+2048)
- {
- read(ld->Infile,ld->Rdbfr,2048);
- ld->Rdptr -= 2048;
- ld->Rdmax -= 2048;
- }
- return *ld->Rdptr++;
-}
-
-/* extract a 16-bit word from the bitstream buffer */
-int Get_Word()
-{
- int Val;
-
- Val = Get_Byte();
- return (Val<<8) | Get_Byte();
-}
-
-
-/* return next n bits (right adjusted) without advancing */
-
-unsigned int Show_Bits(N)
-int N;
-{
- return ld->Bfr >> (32-N);
-}
-
-
-/* return next bit (could be made faster than Get_Bits(1)) */
-
-unsigned int Get_Bits1()
-{
- return Get_Bits(1);
-}
-
-
-/* advance by n bits */
-
-void Flush_Buffer(N)
-int N;
-{
- int Incnt;
-
- ld->Bfr <<= N;
-
- Incnt = ld->Incnt -= N;
-
- if (Incnt <= 24)
- {
- if (System_Stream_Flag && (ld->Rdptr >= ld->Rdmax-4))
- {
- do
- {
- if (ld->Rdptr >= ld->Rdmax)
- Next_Packet();
- ld->Bfr |= Get_Byte() << (24 - Incnt);
- Incnt += 8;
- }
- while (Incnt <= 24);
- }
- else if (ld->Rdptr < ld->Rdbfr+2044)
- {
- do
- {
- ld->Bfr |= *ld->Rdptr++ << (24 - Incnt);
- Incnt += 8;
- }
- while (Incnt <= 24);
- }
- else
- {
- do
- {
- if (ld->Rdptr >= ld->Rdbfr+2048)
- Fill_Buffer();
- ld->Bfr |= *ld->Rdptr++ << (24 - Incnt);
- Incnt += 8;
- }
- while (Incnt <= 24);
- }
- ld->Incnt = Incnt;
- }
-
-#ifdef VERIFY
- ld->Bitcnt += N;
-#endif /* VERIFY */
-
-}
-
-
-/* return next n bits (right adjusted) */
-
-unsigned int Get_Bits(N)
-int N;
-{
- unsigned int Val;
-
- Val = Show_Bits(N);
- Flush_Buffer(N);
-
- return Val;
-}
-
Index: rel_1_21/fsf/mpeg2/verify.c
===================================================================
--- rel_1_21/fsf/mpeg2/verify.c (revision 1217)
+++ rel_1_21/fsf/mpeg2/verify.c (nonexistent)
@@ -1,300 +0,0 @@
-/* verify.c
- *
- * Bitstream verification routines
- *
- *
- */
-#ifdef VERIFY
-
-#include <stdlib.h>
-#include <math.h> /* needed for ceil() */
-
-#include "config.h"
-#include "global.h"
-
-/* #define DEBUG */
-#ifdef DEBUG
-#define PC
-#endif
-
-#ifdef PC
-#include <conio.h> /* needed for getch() */
-#endif /* PC */
-
-/*
- Check picture headers: due to the VBV definition of picture data,
- this routine must be called immediately before any picture data
- is parsed. (before the first slice start code, including any slice
- start code stuffing).
-*/
-
-
-static void Check_VBV_Delay _ANSI_ARGS_((int Bitstream_Framenum, int Sequence_Framenum));
-
-
-void Check_Headers(Bitstream_Framenum, Sequence_Framenum)
-int Bitstream_Framenum;
-int Sequence_Framenum;
-{
-
-
- if((!low_delay)&&(vbv_delay!=0)&&(vbv_delay!=0xFFFF))
- Check_VBV_Delay(Bitstream_Framenum, Sequence_Framenum);
-
- /* clear out the header tracking variables so we have an accurate
- count next time */
- Clear_Verify_Headers();
-}
-
-
-
-/*
- * Verify vbv_delay value in picture header
- * (low_delay==1 checks not implemented. this does not exhaustively test all
- * possibilities suggested in ISO/IEC 13818-2 Annex C. It only checks
- * for constant rate streams)
- *
- * Q:how do we tell a variable rate stream from a constant rate stream anyway?
- * it's not as simple as vbv_delay==0xFFFF, since we need meaningful
- * vbv_delay values to calculate the piecewise rate in the first place!
- *
- * Also: no special provisions at the beginning or end of a sequence
- */
-
-static void Check_VBV_Delay(Bitstream_Framenum, Sequence_Framenum)
-int Bitstream_Framenum;
-int Sequence_Framenum;
-{
- double B; /* buffer size */
- double Bn; /* buffer fullness for picture n */
- double R; /* bitrate */
- double I; /* time interval (t[n+1] - t[n]) */
- double T; /* inverse of the frame rate (frame period) */
-
- int d;
- int internal_vbv_delay;
-
- static int previous_IorP_picture_structure;
- static int previous_IorP_repeat_first_field;
- static int previous_IorP_top_field_first;
- static int previous_vbv_delay;
- static int previous_bitstream_position;
-
- static double previous_Bn;
- static double E; /* maximum quantization error or mismatch */
-
-
-
- if((Sequence_Framenum==0)&&(!Second_Field))
- { /* first coded picture of sequence */
-
- R = bit_rate;
-
- /* the initial buffer occupancy is taken on faith
- that is, we believe what is transmitted in the first coded picture header
- to be the true/actual buffer occupancy */
-
- Bn = (R * (double) vbv_delay) / 90000.0;
- B = 16 * 1024 * vbv_buffer_size;
-
-
- /* maximum quantization error in bitrate (bit_rate_value is quantized/
- rounded-up to units of 400 bits/sec as per ISO/IEC 13818-2
- section 6.3.3 */
-
- E = (400.0/frame_rate) + 400;
-
-#ifdef DEBUG
- cprintf("vbv_buffer_size (B) = %.0f, Bn=%f, E=%f, \nbitrate=%f, vbv_delay=%d frame_rate=%f\n",
- B, Bn, E, bit_rate, vbv_delay, frame_rate);
-#endif
-
- }
- else /* not the first coded picture of sequence */
- {
-
- /* derive the interval (I). The interval tells us how many constant rate bits
- * will have been downloaded to the buffer during the current picture period
- *
- * interval assumes that:
- * 1. whilst we are decoding the current I or P picture, we are displaying
- * the previous I or P picture which was stored in the reorder
- * buffer (pointed to by forward_reference_frame in this implementation)
- *
- * 2. B pictures are output ("displayed") at the time when they are decoded
- *
- */
-
- if(progressive_sequence) /* Annex C.9 (progressive_sequence==1, low_delay==0) */
- {
-
- T = 1/frame_rate; /* inverse of the frame rate (frame period) */
-
- if(picture_coding_type==B_TYPE)
- {
- if(repeat_first_field==1)
- {
- if(top_field_first==1)
- I = T*3; /* three frame periods */
- else
- I = T*2; /* two frame periods */
- }
- else
- I = T; /* one frame period */
- }
- else /* P or I frame */
- {
- if(previous_IorP_repeat_first_field==1)
- {
- if(previous_IorP_top_field_first==1)
- I = 3*T;
- else
- I = 2*T;
- }
- else
- I = T;
- }
- }
- else /* Annex C.11 (progressive_sequence==0, low_delay==0) */
- {
-
- T = 1/(2*frame_rate); /* inverse of two times the frame rate (field period) */
-
- if(picture_coding_type==B_TYPE)
- {
- if(picture_structure==FRAME_PICTURE)
- {
- if(repeat_first_field==0)
- I = 2*T; /* two field periods */
- else
- I = 3*T; /* three field periods */
- }
- else /* B field */
- {
- I = T; /* one field period */
- }
- }
- else /* I or P picture */
- {
- if(picture_structure==FRAME_PICTURE)
- {
- if(previous_IorP_repeat_first_field==0)
- I = 2*T;
- else
- I = 3*T;
- }
- else
- {
- if(Second_Field==0) /* first field of current frame */
- I = T;
- else /* second field of current frame */
- {
- /* formula: previous I or P display period (2*T or 3*T) minus the
- very recent decode period (T) of the first field of the current
- frame */
-
- if(previous_IorP_picture_structure!=FRAME_PICTURE
- || previous_IorP_repeat_first_field==0)
- I = 2*T - T; /* a net of one field period */
- else if(previous_IorP_picture_structure==FRAME_PICTURE
- && previous_IorP_repeat_first_field==1)
- I = 3*T - T; /* a net of two field periods */
- }
- }
- }
- }
-
- /* derive coded size of previous picture */
- d = ld->Bitcnt - previous_bitstream_position;
-
- /* Rate = Distance/Time */
-
- /* piecewise constant rate (variable rate stream) calculation
- * R = ((double) d /((previous_vbv_delay - vbv_delay)/90000 + I));
- */
-
- R = bit_rate;
-
- /* compute buffer fullness just before removing picture n
- *
- * Bn = previous_Bn + (I*R) - d; (recursive formula)
- *
- * where:
- *
- * n is the current picture
- *
- * Bn is the buffer fullness for the current picture
- *
- * previous_Bn is the buffer fullness of the previous picture
- *
- * (I*R ) is the bits accumulated during the current picture
- * period
- *
- * d is the number of bits removed during the decoding of the
- * previous picture
- */
-
- Bn = previous_Bn + (I*R) - d;
-
- /* compute internally derived vbv_delay (rouding up with ceil()) */
- internal_vbv_delay = (int) ceil((90000 * Bn / bit_rate));
-
-#ifdef DEBUG
- cprintf("\nvbv_delay: internal=%d, bitstream=%d\n", internal_vbv_delay, vbv_delay);
-
- cprintf("Bn=%f, prevBn=%f, I=%f, R=%f, d=%d\n", Bn, previous_Bn, I, R, d);
- cprintf("frame(%d), pictstruct(%d), picttype(%d)\n", Sequence_Framenum,
- picture_structure, picture_coding_type);
-
- /* report error */
- if(internal_vbv_delay != vbv_delay)
- {
- cprintf("WARNING: internal_vbv_delay(%d) != vbv_delay(%d)\n",
- internal_vbv_delay, vbv_delay);
- }
-#endif
-
- } /* not the first coded picture of sequence */
-
-
-#ifdef PC
- getch();
-#endif /* PC */
-
- /* update generic tracking variables */
- previous_bitstream_position = ld->Bitcnt ;
- previous_vbv_delay = vbv_delay;
- previous_Bn = Bn;
-
- /* reference picture: reordered/delayed output picture */
- if(picture_coding_type!=B_TYPE)
- {
- previous_IorP_repeat_first_field = repeat_first_field;
- previous_IorP_top_field_first = top_field_first;
- previous_IorP_picture_structure = picture_structure;
- }
-
-}
-
-
-
-/* variables to keep track of the occurance of redundant headers between pictures */
-void Clear_Verify_Headers()
-{
- verify_sequence_header = 0;
- verify_group_of_pictures_header = 0;
- verify_picture_header = 0;
- verify_slice_header = 0;
- verify_sequence_extension = 0;
- verify_sequence_display_extension = 0;
- verify_quant_matrix_extension = 0;
- verify_sequence_scalable_extension = 0;
- verify_picture_display_extension = 0;
- verify_picture_coding_extension = 0;
- verify_picture_spatial_scalable_extension = 0;
- verify_picture_temporal_scalable_extension = 0;
- verify_copyright_extension = 0;
-}
-
-#endif /* VERIFY */
-
Index: rel_1_21/fsf/mpeg2/global.h
===================================================================
--- rel_1_21/fsf/mpeg2/global.h (revision 1217)
+++ rel_1_21/fsf/mpeg2/global.h (nonexistent)
@@ -1,497 +0,0 @@
-/* global.h, global variables */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include "ll/sys/types.h"
-#include "kernel/kern.h"
-#include "mpeg2dec.h"
-
-/* choose between declaration (GLOBAL undefined)
- * and definition (GLOBAL defined)
- * GLOBAL is defined in exactly one file mpeg2dec.c)
- */
-
-#ifndef GLOBAL
-#define EXTERN extern
-#else
-#define EXTERN
-#endif
-
-/* prototypes of global functions */
-/* readpic.c */
-void Substitute_Frame_Buffer _ANSI_ARGS_ ((int bitstream_framenum,
- int sequence_framenum));
-
-/* Get_Bits.c */
-void Initialize_Buffer _ANSI_ARGS_((void));
-void Fill_Buffer _ANSI_ARGS_((void));
-unsigned int Show_Bits _ANSI_ARGS_((int n));
-unsigned int Get_Bits1 _ANSI_ARGS_((void));
-void Flush_Buffer _ANSI_ARGS_((int n));
-unsigned int Get_Bits _ANSI_ARGS_((int n));
-int Get_Byte _ANSI_ARGS_((void));
-int Get_Word _ANSI_ARGS_((void));
-
-/* systems.c */
-void Next_Packet _ANSI_ARGS_((void));
-int Get_Long _ANSI_ARGS_((void));
-void Flush_Buffer32 _ANSI_ARGS_((void));
-unsigned int Get_Bits32 _ANSI_ARGS_((void));
-
-
-/* getblk.c */
-void Decode_MPEG1_Intra_Block _ANSI_ARGS_((int comp, int dc_dct_pred[]));
-void Decode_MPEG1_Non_Intra_Block _ANSI_ARGS_((int comp));
-void Decode_MPEG2_Intra_Block _ANSI_ARGS_((int comp, int dc_dct_pred[]));
-void Decode_MPEG2_Non_Intra_Block _ANSI_ARGS_((int comp));
-
-/* gethdr.c */
-int Get_Hdr _ANSI_ARGS_((void));
-void next_start_code _ANSI_ARGS_((void));
-int slice_header _ANSI_ARGS_((void));
-void marker_bit _ANSI_ARGS_((char *text));
-
-/* getpic.c */
-void Decode_Picture _ANSI_ARGS_((int bitstream_framenum,
- int sequence_framenum));
-void Output_Last_Frame_of_Sequence _ANSI_ARGS_((int framenum));
-
-/* getvlc.c */
-int Get_macroblock_type _ANSI_ARGS_((void));
-int Get_motion_code _ANSI_ARGS_((void));
-int Get_dmvector _ANSI_ARGS_((void));
-int Get_coded_block_pattern _ANSI_ARGS_((void));
-int Get_macroblock_address_increment _ANSI_ARGS_((void));
-int Get_Luma_DC_dct_diff _ANSI_ARGS_((void));
-int Get_Chroma_DC_dct_diff _ANSI_ARGS_((void));
-
-/* idct.c */
-void Fast_IDCT _ANSI_ARGS_((short *block));
-void Initialize_Fast_IDCT _ANSI_ARGS_((void));
-
-/* Reference_IDCT.c */
-void Initialize_Reference_IDCT _ANSI_ARGS_((void));
-void Reference_IDCT _ANSI_ARGS_((short *block));
-
-/* motion.c */
-void motion_vectors _ANSI_ARGS_((int PMV[2][2][2], int dmvector[2],
- int motion_vertical_field_select[2][2], int s, int motion_vector_count,
- int mv_format, int h_r_size, int v_r_size, int dmv, int mvscale));
-void motion_vector _ANSI_ARGS_((int *PMV, int *dmvector,
- int h_r_size, int v_r_size, int dmv, int mvscale, int full_pel_vector));
-void Dual_Prime_Arithmetic _ANSI_ARGS_((int DMV[][2], int *dmvector, int mvx, int mvy));
-
-/* mpeg2dec.c */
-void Error _ANSI_ARGS_((char *text));
-void Warning _ANSI_ARGS_((char *text));
-void Print_Bits _ANSI_ARGS_((int code, int bits, int len));
-
-/* recon.c */
-void form_predictions _ANSI_ARGS_((int bx, int by, int macroblock_type,
- int motion_type, int PMV[2][2][2], int motion_vertical_field_select[2][2],
- int dmvector[2], int stwtype));
-
-/* spatscal.c */
-void Spatial_Prediction _ANSI_ARGS_((void));
-
-/* store.c */
-void Write_Frame _ANSI_ARGS_((unsigned char *src[], int frame));
-
-#ifdef DISPLAY
-/* display.c */
-void Initialize_Display_Process _ANSI_ARGS_((char *name));
-void Terminate_Display_Process _ANSI_ARGS_((void));
-void Display_Second_Field _ANSI_ARGS_((void));
-void dither _ANSI_ARGS_((unsigned char *src[]));
-void Initialize_Dither_Matrix _ANSI_ARGS_((void));
-#endif
-
-/* global variables */
-
-EXTERN char Version[]
-#ifdef GLOBAL
- ="mpeg2decode V1.2a, 96/07/19"
-#endif
-;
-
-EXTERN char Author[]
-#ifdef GLOBAL
- ="(C) 1996, MPEG Software Simulation Group"
-#endif
-;
-
-
-/* zig-zag and alternate scan patterns */
-EXTERN unsigned char scan[2][64]
-#ifdef GLOBAL
-=
-{
- { /* Zig-Zag scan pattern */
- 0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,
- 12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,
- 35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,
- 58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63
- },
- { /* Alternate scan pattern */
- 0,8,16,24,1,9,2,10,17,25,32,40,48,56,57,49,
- 41,33,26,18,3,11,4,12,19,27,34,42,50,58,35,43,
- 51,59,20,28,5,13,6,14,21,29,36,44,52,60,37,45,
- 53,61,22,30,7,15,23,31,38,46,54,62,39,47,55,63
- }
-}
-#endif
-;
-
-/* default intra quantization matrix */
-EXTERN unsigned char default_intra_quantizer_matrix[64]
-#ifdef GLOBAL
-=
-{
- 8, 16, 19, 22, 26, 27, 29, 34,
- 16, 16, 22, 24, 27, 29, 34, 37,
- 19, 22, 26, 27, 29, 34, 34, 38,
- 22, 22, 26, 27, 29, 34, 37, 40,
- 22, 26, 27, 29, 32, 35, 40, 48,
- 26, 27, 29, 32, 35, 40, 48, 58,
- 26, 27, 29, 34, 38, 46, 56, 69,
- 27, 29, 35, 38, 46, 56, 69, 83
-}
-#endif
-;
-
-/* non-linear quantization coefficient table */
-EXTERN unsigned char Non_Linear_quantizer_scale[32]
-#ifdef GLOBAL
-=
-{
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8,10,12,14,16,18,20,22,
- 24,28,32,36,40,44,48,52,
- 56,64,72,80,88,96,104,112
-}
-#endif
-;
-
-/* color space conversion coefficients
- * for YCbCr -> RGB mapping
- *
- * entries are {crv,cbu,cgu,cgv}
- *
- * crv=(255/224)*65536*(1-cr)/0.5
- * cbu=(255/224)*65536*(1-cb)/0.5
- * cgu=(255/224)*65536*(cb/cg)*(1-cb)/0.5
- * cgv=(255/224)*65536*(cr/cg)*(1-cr)/0.5
- *
- * where Y=cr*R+cg*G+cb*B (cr+cg+cb=1)
- */
-
-/* ISO/IEC 13818-2 section 6.3.6 sequence_display_extension() */
-
-EXTERN int Inverse_Table_6_9[8][4]
-#ifdef GLOBAL
-=
-{
- {117504, 138453, 13954, 34903}, /* no sequence_display_extension */
- {117504, 138453, 13954, 34903}, /* ITU-R Rec. 709 (1990) */
- {104597, 132201, 25675, 53279}, /* unspecified */
- {104597, 132201, 25675, 53279}, /* reserved */
- {104448, 132798, 24759, 53109}, /* FCC */
- {104597, 132201, 25675, 53279}, /* ITU-R Rec. 624-4 System B, G */
- {104597, 132201, 25675, 53279}, /* SMPTE 170M */
- {117579, 136230, 16907, 35559} /* SMPTE 240M (1987) */
-}
-#endif
-;
-
-
-
-
-
-/* output types (Output_Type) */
-#define T_YUV 0
-#define T_SIF 1
-#define T_TGA 2
-#define T_PPM 3
-#define T_X11 4
-#define T_X11HIQ 5
-
-/* decoder operation control variables */
-EXTERN int Output_Type;
-EXTERN int hiQdither;
-
-/* decoder operation control flags */
-EXTERN int Quiet_Flag;
-EXTERN int Trace_Flag;
-EXTERN int Fault_Flag;
-EXTERN int Verbose_Flag;
-EXTERN int Two_Streams;
-EXTERN int Spatial_Flag;
-EXTERN int Reference_IDCT_Flag;
-EXTERN int Frame_Store_Flag;
-EXTERN int System_Stream_Flag;
-EXTERN int Display_Progressive_Flag;
-EXTERN int Ersatz_Flag;
-EXTERN int Big_Picture_Flag;
-EXTERN int Verify_Flag;
-EXTERN int Stats_Flag;
-EXTERN int User_Data_Flag;
-EXTERN int Main_Bitstream_Flag;
-
-
-/* filenames */
-EXTERN char *Output_Picture_Filename;
-EXTERN char *Substitute_Picture_Filename;
-EXTERN char *Main_Bitstream_Filename;
-EXTERN char *Enhancement_Layer_Bitstream_Filename;
-
-
-/* buffers for multiuse purposes */
-EXTERN char Error_Text[256];
-EXTERN unsigned char *Clip;
-
-/* pointers to generic picture buffers */
-EXTERN unsigned char *backward_reference_frame[3];
-EXTERN unsigned char *forward_reference_frame[3];
-
-EXTERN unsigned char *auxframe[3];
-EXTERN unsigned char *current_frame[3];
-EXTERN unsigned char *substitute_frame[3];
-
-
-/* pointers to scalability picture buffers */
-EXTERN unsigned char *llframe0[3];
-EXTERN unsigned char *llframe1[3];
-
-EXTERN short *lltmp;
-EXTERN char *Lower_Layer_Picture_Filename;
-
-
-
-
-/* non-normative variables derived from normative elements */
-EXTERN int Coded_Picture_Width;
-EXTERN int Coded_Picture_Height;
-EXTERN int Chroma_Width;
-EXTERN int Chroma_Height;
-EXTERN int block_count;
-EXTERN int Second_Field;
-EXTERN int profile, level;
-
-/* normative derived variables (as per ISO/IEC 13818-2) */
-EXTERN int horizontal_size;
-EXTERN int vertical_size;
-EXTERN int mb_width;
-EXTERN int mb_height;
-EXTERN double bit_rate;
-EXTERN double frame_rate;
-
-
-
-/* headers */
-
-/* ISO/IEC 13818-2 section 6.2.2.1: sequence_header() */
-EXTERN int aspect_ratio_information;
-EXTERN int frame_rate_code;
-EXTERN int bit_rate_value;
-EXTERN int vbv_buffer_size;
-EXTERN int constrained_parameters_flag;
-
-/* ISO/IEC 13818-2 section 6.2.2.3: sequence_extension() */
-EXTERN int profile_and_level_indication;
-EXTERN int progressive_sequence;
-EXTERN int chroma_format;
-EXTERN int low_delay;
-EXTERN int frame_rate_extension_n;
-EXTERN int frame_rate_extension_d;
-
-/* ISO/IEC 13818-2 section 6.2.2.4: sequence_display_extension() */
-EXTERN int video_format;
-EXTERN int color_description;
-EXTERN int color_primaries;
-EXTERN int transfer_characteristics;
-EXTERN int matrix_coefficients;
-EXTERN int display_horizontal_size;
-EXTERN int display_vertical_size;
-
-/* ISO/IEC 13818-2 section 6.2.3: picture_header() */
-EXTERN int temporal_reference;
-EXTERN int picture_coding_type;
-EXTERN int vbv_delay;
-EXTERN int full_pel_forward_vector;
-EXTERN int forward_f_code;
-EXTERN int full_pel_backward_vector;
-EXTERN int backward_f_code;
-
-
-/* ISO/IEC 13818-2 section 6.2.3.1: picture_coding_extension() header */
-EXTERN int f_code[2][2];
-EXTERN int intra_dc_precision;
-EXTERN int picture_structure;
-EXTERN int top_field_first;
-EXTERN int frame_pred_frame_dct;
-EXTERN int concealment_motion_vectors;
-
-EXTERN int intra_vlc_format;
-
-EXTERN int repeat_first_field;
-
-EXTERN int chroma_420_type;
-EXTERN int progressive_frame;
-EXTERN int composite_display_flag;
-EXTERN int v_axis;
-EXTERN int field_sequence;
-EXTERN int sub_carrier;
-EXTERN int burst_amplitude;
-EXTERN int sub_carrier_phase;
-
-
-
-/* ISO/IEC 13818-2 section 6.2.3.3: picture_display_extension() header */
-EXTERN int frame_center_horizontal_offset[3];
-EXTERN int frame_center_vertical_offset[3];
-
-
-
-/* ISO/IEC 13818-2 section 6.2.2.5: sequence_scalable_extension() header */
-EXTERN int layer_id;
-EXTERN int lower_layer_prediction_horizontal_size;
-EXTERN int lower_layer_prediction_vertical_size;
-EXTERN int horizontal_subsampling_factor_m;
-EXTERN int horizontal_subsampling_factor_n;
-EXTERN int vertical_subsampling_factor_m;
-EXTERN int vertical_subsampling_factor_n;
-
-
-/* ISO/IEC 13818-2 section 6.2.3.5: picture_spatial_scalable_extension() header */
-EXTERN int lower_layer_temporal_reference;
-EXTERN int lower_layer_horizontal_offset;
-EXTERN int lower_layer_vertical_offset;
-EXTERN int spatial_temporal_weight_code_table_index;
-EXTERN int lower_layer_progressive_frame;
-EXTERN int lower_layer_deinterlaced_field_select;
-
-
-
-
-
-
-/* ISO/IEC 13818-2 section 6.2.3.6: copyright_extension() header */
-EXTERN int copyright_flag;
-EXTERN int copyright_identifier;
-EXTERN int original_or_copy;
-EXTERN int copyright_number_1;
-EXTERN int copyright_number_2;
-EXTERN int copyright_number_3;
-
-/* ISO/IEC 13818-2 section 6.2.2.6: group_of_pictures_header() */
-EXTERN int drop_flag;
-EXTERN int hour;
-EXTERN int minute;
-EXTERN int sec;
-EXTERN int frame;
-EXTERN int closed_gop;
-EXTERN int broken_link;
-
-
-
-/* layer specific variables (needed for SNR and DP scalability) */
-EXTERN struct layer_data {
- /* bit input */
- int Infile;
-
- void *start_file_ptr;
- void *actual_file_ptr;
- void *end_file_ptr;
-
- int px;
- int py;
-
- unsigned char Rdbfr[2048];
- unsigned char *Rdptr;
- unsigned char Inbfr[16];
- /* from mpeg2play */
- unsigned int Bfr;
- unsigned char *Rdmax;
- int Incnt;
- int Bitcnt;
- /* sequence header and quant_matrix_extension() */
- int intra_quantizer_matrix[64];
- int non_intra_quantizer_matrix[64];
- int chroma_intra_quantizer_matrix[64];
- int chroma_non_intra_quantizer_matrix[64];
-
- int load_intra_quantizer_matrix;
- int load_non_intra_quantizer_matrix;
- int load_chroma_intra_quantizer_matrix;
- int load_chroma_non_intra_quantizer_matrix;
-
- int MPEG2_Flag;
- /* sequence scalable extension */
- int scalable_mode;
- /* picture coding extension */
- int q_scale_type;
- int alternate_scan;
- /* picture spatial scalable extension */
- int pict_scal;
- /* slice/macroblock */
- int priority_breakpoint;
- int quantizer_scale;
- int intra_slice;
- short block[12][64];
-} base, enhan, *ld;
-
-#ifdef VERIFY
-EXTERN int verify_sequence_header;
-EXTERN int verify_group_of_pictures_header;
-EXTERN int verify_picture_header;
-EXTERN int verify_slice_header;
-EXTERN int verify_sequence_extension;
-EXTERN int verify_sequence_display_extension;
-EXTERN int verify_quant_matrix_extension;
-EXTERN int verify_sequence_scalable_extension;
-EXTERN int verify_picture_display_extension;
-EXTERN int verify_picture_coding_extension;
-EXTERN int verify_picture_spatial_scalable_extension;
-EXTERN int verify_picture_temporal_scalable_extension;
-EXTERN int verify_copyright_extension;
-#endif /* VERIFY */
-
-
-EXTERN int Decode_Layer;
-
-/* verify.c */
-#ifdef VERIFY
-void Check_Headers _ANSI_ARGS_((int Bitstream_Framenum, int Sequence_Framenum));
-void Clear_Verify_Headers _ANSI_ARGS_((void));
-#endif /* VERIFY */
-
-
-EXTERN int global_MBA;
-EXTERN int global_pic;
-EXTERN int True_Framenum;
-
Index: rel_1_21/fsf/mpeg2/motion.c
===================================================================
--- rel_1_21/fsf/mpeg2/motion.c (revision 1217)
+++ rel_1_21/fsf/mpeg2/motion.c (nonexistent)
@@ -1,234 +0,0 @@
-/* motion.c, motion vector decoding */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include "config.h"
-#include "global.h"
-
-/* private prototypes */
-static void decode_motion_vector _ANSI_ARGS_((int *pred, int r_size, int motion_code,
- int motion_residualesidual, int full_pel_vector));
-
-/* ISO/IEC 13818-2 sections 6.2.5.2, 6.3.17.2, and 7.6.3: Motion vectors */
-void motion_vectors(PMV,dmvector,
- motion_vertical_field_select,s,motion_vector_count,mv_format,h_r_size,v_r_size,dmv,mvscale)
-int PMV[2][2][2];
-int dmvector[2];
-int motion_vertical_field_select[2][2];
-int s, motion_vector_count, mv_format, h_r_size, v_r_size, dmv, mvscale;
-{
- if (motion_vector_count==1)
- {
- if (mv_format==MV_FIELD && !dmv)
- {
- motion_vertical_field_select[1][s] = motion_vertical_field_select[0][s] = Get_Bits(1);
-#ifdef TRACE
- if (Trace_Flag)
- {
- cprintf("motion_vertical_field_select[][%d] (%d): %d\n",s,
- motion_vertical_field_select[0][s],motion_vertical_field_select[0][s]);
- }
-#endif /* TRACE */
- }
-
- motion_vector(PMV[0][s],dmvector,h_r_size,v_r_size,dmv,mvscale,0);
-
- /* update other motion vector predictors */
- PMV[1][s][0] = PMV[0][s][0];
- PMV[1][s][1] = PMV[0][s][1];
- }
- else
- {
- motion_vertical_field_select[0][s] = Get_Bits(1);
-#ifdef TRACE
- if (Trace_Flag)
- {
- cprintf("motion_vertical_field_select[0][%d] (%d): %d\n",s,
- motion_vertical_field_select[0][s],motion_vertical_field_select[0][s]);
- }
-#endif /* TRACE */
- motion_vector(PMV[0][s],dmvector,h_r_size,v_r_size,dmv,mvscale,0);
-
- motion_vertical_field_select[1][s] = Get_Bits(1);
-#ifdef TRACE
- if (Trace_Flag)
- {
- cprintf("motion_vertical_field_select[1][%d] (%d): %d\n",s,
- motion_vertical_field_select[1][s],motion_vertical_field_select[1][s]);
- }
-#endif /* TRACE */
- motion_vector(PMV[1][s],dmvector,h_r_size,v_r_size,dmv,mvscale,0);
- }
-}
-
-/* get and decode motion vector and differential motion vector
- for one prediction */
-void motion_vector(PMV,dmvector,
- h_r_size,v_r_size,dmv,mvscale,full_pel_vector)
-int *PMV;
-int *dmvector;
-int h_r_size;
-int v_r_size;
-int dmv; /* MPEG-2 only: get differential motion vectors */
-int mvscale; /* MPEG-2 only: field vector in frame pic */
-int full_pel_vector; /* MPEG-1 only */
-{
- int motion_code, motion_residual;
-
- /* horizontal component */
- /* ISO/IEC 13818-2 Table B-10 */
- motion_code = Get_motion_code();
-
- motion_residual = (h_r_size!=0 && motion_code!=0) ? Get_Bits(h_r_size) : 0;
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- if (h_r_size!=0 && motion_code!=0)
- {
- cprintf("motion_residual (");
- Print_Bits(motion_residual,h_r_size,h_r_size);
- cprintf("): %d\n",motion_residual);
- }
- }
-#endif /* TRACE */
-
-
- decode_motion_vector(&PMV[0],h_r_size,motion_code,motion_residual,full_pel_vector);
-
- if (dmv)
- dmvector[0] = Get_dmvector();
-
-
- /* vertical component */
- motion_code = Get_motion_code();
- motion_residual = (v_r_size!=0 && motion_code!=0) ? Get_Bits(v_r_size) : 0;
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- if (v_r_size!=0 && motion_code!=0)
- {
- cprintf("motion_residual (");
- Print_Bits(motion_residual,v_r_size,v_r_size);
- cprintf("): %d\n",motion_residual);
- }
- }
-#endif /* TRACE */
-
- if (mvscale)
- PMV[1] >>= 1; /* DIV 2 */
-
- decode_motion_vector(&PMV[1],v_r_size,motion_code,motion_residual,full_pel_vector);
-
- if (mvscale)
- PMV[1] <<= 1;
-
- if (dmv)
- dmvector[1] = Get_dmvector();
-
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("PMV = %d,%d\n",PMV[0],PMV[1]);
-#endif /* TRACE */
-}
-
-/* calculate motion vector component */
-/* ISO/IEC 13818-2 section 7.6.3.1: Decoding the motion vectors */
-/* Note: the arithmetic here is more elegant than that which is shown
- in 7.6.3.1. The end results (PMV[][][]) should, however, be the same. */
-
-static void decode_motion_vector(pred,r_size,motion_code,motion_residual,full_pel_vector)
-int *pred;
-int r_size, motion_code, motion_residual;
-int full_pel_vector; /* MPEG-1 (ISO/IEC 11172-1) support */
-{
- int lim, vec;
-
- lim = 16<<r_size;
- vec = full_pel_vector ? (*pred >> 1) : (*pred);
-
- if (motion_code>0)
- {
- vec+= ((motion_code-1)<<r_size) + motion_residual + 1;
- if (vec>=lim)
- vec-= lim + lim;
- }
- else if (motion_code<0)
- {
- vec-= ((-motion_code-1)<<r_size) + motion_residual + 1;
- if (vec<-lim)
- vec+= lim + lim;
- }
- *pred = full_pel_vector ? (vec<<1) : vec;
-}
-
-
-/* ISO/IEC 13818-2 section 7.6.3.6: Dual prime additional arithmetic */
-void Dual_Prime_Arithmetic(DMV,dmvector,mvx,mvy)
-int DMV[][2];
-int *dmvector; /* differential motion vector */
-int mvx, mvy; /* decoded mv components (always in field format) */
-{
- if (picture_structure==FRAME_PICTURE)
- {
- if (top_field_first)
- {
- /* vector for prediction of top field from bottom field */
- DMV[0][0] = ((mvx +(mvx>0))>>1) + dmvector[0];
- DMV[0][1] = ((mvy +(mvy>0))>>1) + dmvector[1] - 1;
-
- /* vector for prediction of bottom field from top field */
- DMV[1][0] = ((3*mvx+(mvx>0))>>1) + dmvector[0];
- DMV[1][1] = ((3*mvy+(mvy>0))>>1) + dmvector[1] + 1;
- }
- else
- {
- /* vector for prediction of top field from bottom field */
- DMV[0][0] = ((3*mvx+(mvx>0))>>1) + dmvector[0];
- DMV[0][1] = ((3*mvy+(mvy>0))>>1) + dmvector[1] - 1;
-
- /* vector for prediction of bottom field from top field */
- DMV[1][0] = ((mvx +(mvx>0))>>1) + dmvector[0];
- DMV[1][1] = ((mvy +(mvy>0))>>1) + dmvector[1] + 1;
- }
- }
- else
- {
- /* vector for prediction from field of opposite 'parity' */
- DMV[0][0] = ((mvx+(mvx>0))>>1) + dmvector[0];
- DMV[0][1] = ((mvy+(mvy>0))>>1) + dmvector[1];
-
- /* correct for vertical field shift */
- if (picture_structure==TOP_FIELD)
- DMV[0][1]--;
- else
- DMV[0][1]++;
- }
-}
-
Index: rel_1_21/fsf/mpeg2/recon.c
===================================================================
--- rel_1_21/fsf/mpeg2/recon.c (revision 1217)
+++ rel_1_21/fsf/mpeg2/recon.c (nonexistent)
@@ -1,465 +0,0 @@
-/* Predict.c, motion compensation routines */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include "config.h"
-#include "global.h"
-
-/* private prototypes */
-static void form_prediction _ANSI_ARGS_((unsigned char *src[], int sfield,
- unsigned char *dst[], int dfield,
- int lx, int lx2, int w, int h, int x, int y, int dx, int dy,
- int average_flag));
-
-static void form_component_prediction _ANSI_ARGS_((unsigned char *src, unsigned char *dst,
- int lx, int lx2, int w, int h, int x, int y, int dx, int dy, int average_flag));
-
-void form_predictions(bx,by,macroblock_type,motion_type,PMV,motion_vertical_field_select,dmvector,stwtype)
-int bx, by;
-int macroblock_type;
-int motion_type;
-int PMV[2][2][2], motion_vertical_field_select[2][2], dmvector[2];
-int stwtype;
-{
- int currentfield;
- unsigned char **predframe;
- int DMV[2][2];
- int stwtop, stwbot;
-
- stwtop = stwtype%3; /* 0:temporal, 1:(spat+temp)/2, 2:spatial */
- stwbot = stwtype/3;
-
- if ((macroblock_type & MACROBLOCK_MOTION_FORWARD)
- || (picture_coding_type==P_TYPE))
- {
- if (picture_structure==FRAME_PICTURE)
- {
- if ((motion_type==MC_FRAME)
- || !(macroblock_type & MACROBLOCK_MOTION_FORWARD))
- {
- /* frame-based prediction (broken into top and bottom halves
- for spatial scalability prediction purposes) */
- if (stwtop<2)
- form_prediction(forward_reference_frame,0,current_frame,0,
- Coded_Picture_Width,Coded_Picture_Width<<1,16,8,bx,by,
- PMV[0][0][0],PMV[0][0][1],stwtop);
-
- if (stwbot<2)
- form_prediction(forward_reference_frame,1,current_frame,1,
- Coded_Picture_Width,Coded_Picture_Width<<1,16,8,bx,by,
- PMV[0][0][0],PMV[0][0][1],stwbot);
- }
- else if (motion_type==MC_FIELD) /* field-based prediction */
- {
- /* top field prediction */
- if (stwtop<2)
- form_prediction(forward_reference_frame,motion_vertical_field_select[0][0],
- current_frame,0,Coded_Picture_Width<<1,Coded_Picture_Width<<1,16,8,
- bx,by>>1,PMV[0][0][0],PMV[0][0][1]>>1,stwtop);
-
- /* bottom field prediction */
- if (stwbot<2)
- form_prediction(forward_reference_frame,motion_vertical_field_select[1][0],
- current_frame,1,Coded_Picture_Width<<1,Coded_Picture_Width<<1,16,8,
- bx,by>>1,PMV[1][0][0],PMV[1][0][1]>>1,stwbot);
- }
- else if (motion_type==MC_DMV) /* dual prime prediction */
- {
- /* calculate derived motion vectors */
- Dual_Prime_Arithmetic(DMV,dmvector,PMV[0][0][0],PMV[0][0][1]>>1);
-
- if (stwtop<2)
- {
- /* predict top field from top field */
- form_prediction(forward_reference_frame,0,current_frame,0,
- Coded_Picture_Width<<1,Coded_Picture_Width<<1,16,8,bx,by>>1,
- PMV[0][0][0],PMV[0][0][1]>>1,0);
-
- /* predict and add to top field from bottom field */
- form_prediction(forward_reference_frame,1,current_frame,0,
- Coded_Picture_Width<<1,Coded_Picture_Width<<1,16,8,bx,by>>1,
- DMV[0][0],DMV[0][1],1);
- }
-
- if (stwbot<2)
- {
- /* predict bottom field from bottom field */
- form_prediction(forward_reference_frame,1,current_frame,1,
- Coded_Picture_Width<<1,Coded_Picture_Width<<1,16,8,bx,by>>1,
- PMV[0][0][0],PMV[0][0][1]>>1,0);
-
- /* predict and add to bottom field from top field */
- form_prediction(forward_reference_frame,0,current_frame,1,
- Coded_Picture_Width<<1,Coded_Picture_Width<<1,16,8,bx,by>>1,
- DMV[1][0],DMV[1][1],1);
- }
- }
- else
- /* invalid motion_type */
- cprintf("invalid motion_type\n");
- }
- else /* TOP_FIELD or BOTTOM_FIELD */
- {
- /* field picture */
- currentfield = (picture_structure==BOTTOM_FIELD);
-
- /* determine which frame to use for prediction */
- if ((picture_coding_type==P_TYPE) && Second_Field
- && (currentfield!=motion_vertical_field_select[0][0]))
- predframe = backward_reference_frame; /* same frame */
- else
- predframe = forward_reference_frame; /* previous frame */
-
- if ((motion_type==MC_FIELD)
- || !(macroblock_type & MACROBLOCK_MOTION_FORWARD))
- {
- /* field-based prediction */
- if (stwtop<2)
- form_prediction(predframe,motion_vertical_field_select[0][0],current_frame,0,
- Coded_Picture_Width<<1,Coded_Picture_Width<<1,16,16,bx,by,
- PMV[0][0][0],PMV[0][0][1],stwtop);
- }
- else if (motion_type==MC_16X8)
- {
- if (stwtop<2)
- {
- form_prediction(predframe,motion_vertical_field_select[0][0],current_frame,0,
- Coded_Picture_Width<<1,Coded_Picture_Width<<1,16,8,bx,by,
- PMV[0][0][0],PMV[0][0][1],stwtop);
-
- /* determine which frame to use for lower half prediction */
- if ((picture_coding_type==P_TYPE) && Second_Field
- && (currentfield!=motion_vertical_field_select[1][0]))
- predframe = backward_reference_frame; /* same frame */
- else
- predframe = forward_reference_frame; /* previous frame */
-
- form_prediction(predframe,motion_vertical_field_select[1][0],current_frame,0,
- Coded_Picture_Width<<1,Coded_Picture_Width<<1,16,8,bx,by+8,
- PMV[1][0][0],PMV[1][0][1],stwtop);
- }
- }
- else if (motion_type==MC_DMV) /* dual prime prediction */
- {
- if (Second_Field)
- predframe = backward_reference_frame; /* same frame */
- else
- predframe = forward_reference_frame; /* previous frame */
-
- /* calculate derived motion vectors */
- Dual_Prime_Arithmetic(DMV,dmvector,PMV[0][0][0],PMV[0][0][1]);
-
- /* predict from field of same parity */
- form_prediction(forward_reference_frame,currentfield,current_frame,0,
- Coded_Picture_Width<<1,Coded_Picture_Width<<1,16,16,bx,by,
- PMV[0][0][0],PMV[0][0][1],0);
-
- /* predict from field of opposite parity */
- form_prediction(predframe,!currentfield,current_frame,0,
- Coded_Picture_Width<<1,Coded_Picture_Width<<1,16,16,bx,by,
- DMV[0][0],DMV[0][1],1);
- }
- else
- /* invalid motion_type */
- cprintf("invalid motion_type\n");
- }
- stwtop = stwbot = 1;
- }
-
- if (macroblock_type & MACROBLOCK_MOTION_BACKWARD)
- {
- if (picture_structure==FRAME_PICTURE)
- {
- if (motion_type==MC_FRAME)
- {
- /* frame-based prediction */
- if (stwtop<2)
- form_prediction(backward_reference_frame,0,current_frame,0,
- Coded_Picture_Width,Coded_Picture_Width<<1,16,8,bx,by,
- PMV[0][1][0],PMV[0][1][1],stwtop);
-
- if (stwbot<2)
- form_prediction(backward_reference_frame,1,current_frame,1,
- Coded_Picture_Width,Coded_Picture_Width<<1,16,8,bx,by,
- PMV[0][1][0],PMV[0][1][1],stwbot);
- }
- else /* field-based prediction */
- {
- /* top field prediction */
- if (stwtop<2)
- form_prediction(backward_reference_frame,motion_vertical_field_select[0][1],
- current_frame,0,Coded_Picture_Width<<1,Coded_Picture_Width<<1,16,8,
- bx,by>>1,PMV[0][1][0],PMV[0][1][1]>>1,stwtop);
-
- /* bottom field prediction */
- if (stwbot<2)
- form_prediction(backward_reference_frame,motion_vertical_field_select[1][1],
- current_frame,1,Coded_Picture_Width<<1,Coded_Picture_Width<<1,16,8,
- bx,by>>1,PMV[1][1][0],PMV[1][1][1]>>1,stwbot);
- }
- }
- else /* TOP_FIELD or BOTTOM_FIELD */
- {
- /* field picture */
- if (motion_type==MC_FIELD)
- {
- /* field-based prediction */
- form_prediction(backward_reference_frame,motion_vertical_field_select[0][1],
- current_frame,0,Coded_Picture_Width<<1,Coded_Picture_Width<<1,16,16,
- bx,by,PMV[0][1][0],PMV[0][1][1],stwtop);
- }
- else if (motion_type==MC_16X8)
- {
- form_prediction(backward_reference_frame,motion_vertical_field_select[0][1],
- current_frame,0,Coded_Picture_Width<<1,Coded_Picture_Width<<1,16,8,
- bx,by,PMV[0][1][0],PMV[0][1][1],stwtop);
-
- form_prediction(backward_reference_frame,motion_vertical_field_select[1][1],
- current_frame,0,Coded_Picture_Width<<1,Coded_Picture_Width<<1,16,8,
- bx,by+8,PMV[1][1][0],PMV[1][1][1],stwtop);
- }
- else
- /* invalid motion_type */
- cprintf("invalid motion_type\n");
- }
- }
-}
-
-static void form_prediction(src,sfield,dst,dfield,lx,lx2,w,h,x,y,dx,dy,average_flag)
-unsigned char *src[]; /* prediction source buffer */
-int sfield; /* prediction source field number (0 or 1) */
-unsigned char *dst[]; /* prediction destination buffer */
-int dfield; /* prediction destination field number (0 or 1)*/
-int lx,lx2; /* line strides */
-int w,h; /* prediction block/sub-block width, height */
-int x,y; /* pixel co-ordinates of top-left sample in current MB */
-int dx,dy; /* horizontal, vertical prediction address */
-int average_flag; /* add prediction error to prediction ? */
-{
- /* Y */
- form_component_prediction(src[0]+(sfield?lx2>>1:0),dst[0]+(dfield?lx2>>1:0),
- lx,lx2,w,h,x,y,dx,dy,average_flag);
-
- if (chroma_format!=CHROMA444)
- {
- lx>>=1; lx2>>=1; w>>=1; x>>=1; dx/=2;
- }
-
- if (chroma_format==CHROMA420)
- {
- h>>=1; y>>=1; dy/=2;
- }
-
- /* Cb */
- form_component_prediction(src[1]+(sfield?lx2>>1:0),dst[1]+(dfield?lx2>>1:0),
- lx,lx2,w,h,x,y,dx,dy,average_flag);
-
- /* Cr */
- form_component_prediction(src[2]+(sfield?lx2>>1:0),dst[2]+(dfield?lx2>>1:0),
- lx,lx2,w,h,x,y,dx,dy,average_flag);
-}
-
-/* ISO/IEC 13818-2 section 7.6.4: Forming predictions */
-/* NOTE: the arithmetic below produces numerically equivalent results
- * to 7.6.4, yet is more elegant. It differs in the following ways:
- *
- * 1. the vectors (dx, dy) are based on cartesian frame
- * coordiantes along a half-pel grid (always positive numbers)
- * In contrast, vector[r][s][t] are differential (with positive and
- * negative values). As a result, deriving the integer vectors
- * (int_vec[t]) from dx, dy is accomplished by a simple right shift.
- *
- * 2. Half pel flags (xh, yh) are equivalent to the LSB (Least
- * Significant Bit) of the half-pel coordinates (dx,dy).
- *
- *
- * NOTE: the work of combining predictions (ISO/IEC 13818-2 section 7.6.7)
- * is distributed among several other stages. This is accomplished by
- * folding line offsets into the source and destination (src,dst)
- * addresses (note the call arguments to form_prediction() in Predict()),
- * line stride variables lx and lx2, the block dimension variables (w,h),
- * average_flag, and by the very order in which Predict() is called.
- * This implementation design (implicitly different than the spec)
- * was chosen for its elegance.
-*/
-
-static void form_component_prediction(src,dst,lx,lx2,w,h,x,y,dx,dy,average_flag)
-unsigned char *src;
-unsigned char *dst;
-int lx; /* raster line increment */
-int lx2;
-int w,h;
-int x,y;
-int dx,dy;
-int average_flag; /* flag that signals bi-directional or Dual-Prime
- averaging (7.6.7.1 and 7.6.7.4). if average_flag==1,
- a previously formed prediction has been stored in
- pel_pred[] */
-{
- int xint; /* horizontal integer sample vector: analogous to int_vec[0] */
- int yint; /* vertical integer sample vectors: analogous to int_vec[1] */
- int xh; /* horizontal half sample flag: analogous to half_flag[0] */
- int yh; /* vertical half sample flag: analogous to half_flag[1] */
- int i, j, v;
- unsigned char *s; /* source pointer: analogous to pel_ref[][] */
- unsigned char *d; /* destination pointer: analogous to pel_pred[][] */
-
- /* half pel scaling for integer vectors */
- xint = dx>>1;
- yint = dy>>1;
-
- /* derive half pel flags */
- xh = dx & 1;
- yh = dy & 1;
-
- /* compute the linear address of pel_ref[][] and pel_pred[][]
- based on cartesian/raster cordinates provided */
- s = src + lx*(y+yint) + x + xint;
- d = dst + lx*y + x;
-
- if (!xh && !yh) /* no horizontal nor vertical half-pel */
- {
- if (average_flag)
- {
- for (j=0; j<h; j++)
- {
- for (i=0; i<w; i++)
- {
- v = d[i]+s[i];
- d[i] = (v+(v>=0?1:0))>>1;
- }
-
- s+= lx2;
- d+= lx2;
- }
- }
- else
- {
- for (j=0; j<h; j++)
- {
- for (i=0; i<w; i++)
- {
- d[i] = s[i];
- }
-
- s+= lx2;
- d+= lx2;
- }
- }
- }
- else if (!xh && yh) /* no horizontal but vertical half-pel */
- {
- if (average_flag)
- {
- for (j=0; j<h; j++)
- {
- for (i=0; i<w; i++)
- {
- v = d[i] + ((unsigned int)(s[i]+s[i+lx]+1)>>1);
- d[i]=(v+(v>=0?1:0))>>1;
- }
-
- s+= lx2;
- d+= lx2;
- }
- }
- else
- {
- for (j=0; j<h; j++)
- {
- for (i=0; i<w; i++)
- {
- d[i] = (unsigned int)(s[i]+s[i+lx]+1)>>1;
- }
-
- s+= lx2;
- d+= lx2;
- }
- }
- }
- else if (xh && !yh) /* horizontal but no vertical half-pel */
- {
- if (average_flag)
- {
- for (j=0; j<h; j++)
- {
- for (i=0; i<w; i++)
- {
- v = d[i] + ((unsigned int)(s[i]+s[i+1]+1)>>1);
- d[i] = (v+(v>=0?1:0))>>1;
- }
-
- s+= lx2;
- d+= lx2;
- }
- }
- else
- {
- for (j=0; j<h; j++)
- {
- for (i=0; i<w; i++)
- {
- d[i] = (unsigned int)(s[i]+s[i+1]+1)>>1;
- }
-
- s+= lx2;
- d+= lx2;
- }
- }
- }
- else /* if (xh && yh) horizontal and vertical half-pel */
- {
- if (average_flag)
- {
- for (j=0; j<h; j++)
- {
- for (i=0; i<w; i++)
- {
- v = d[i] + ((unsigned int)(s[i]+s[i+1]+s[i+lx]+s[i+lx+1]+2)>>2);
- d[i] = (v+(v>=0?1:0))>>1;
- }
-
- s+= lx2;
- d+= lx2;
- }
- }
- else
- {
- for (j=0; j<h; j++)
- {
- for (i=0; i<w; i++)
- {
- d[i] = (unsigned int)(s[i]+s[i+1]+s[i+lx]+s[i+lx+1]+2)>>2;
- }
-
- s+= lx2;
- d+= lx2;
- }
- }
- }
-}
Index: rel_1_21/fsf/mpeg2/systems.c
===================================================================
--- rel_1_21/fsf/mpeg2/systems.c (revision 1217)
+++ rel_1_21/fsf/mpeg2/systems.c (nonexistent)
@@ -1,195 +0,0 @@
-/* systems.c, systems-specific routines */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include <stdlib.h>
-
-#include "config.h"
-#include "global.h"
-
-/* initialize buffer, call once before first getbits or showbits */
-
-/* parse system layer, ignore everything we don't need */
-void Next_Packet()
-{
- unsigned int code;
- int l;
-
- for(;;)
- {
- code = Get_Long();
-
- /* remove system layer byte stuffing */
- while ((code & 0xffffff00) != 0x100)
- code = (code<<8) | Get_Byte();
-
- switch(code)
- {
- case PACK_START_CODE: /* pack header */
- /* skip pack header (system_clock_reference and mux_rate) */
- ld->Rdptr += 8;
- break;
- case VIDEO_ELEMENTARY_STREAM:
- code = Get_Word(); /* packet_length */
- ld->Rdmax = ld->Rdptr + code;
-
- code = Get_Byte();
-
- if((code>>6)==0x02)
- {
- ld->Rdptr++;
- code=Get_Byte(); /* parse PES_header_data_length */
- ld->Rdptr+=code; /* advance pointer by PES_header_data_length */
- cprintf("MPEG-2 PES packet\n");
- return;
- }
- else if(code==0xff)
- {
- /* parse MPEG-1 packet header */
- while((code=Get_Byte())== 0xFF);
- }
-
- /* stuffing bytes */
- if(code>=0x40)
- {
- if(code>=0x80)
- {
- cprintf("Error in packet header\n");
- }
- /* skip STD_buffer_scale */
- ld->Rdptr++;
- code = Get_Byte();
- }
-
- if(code>=0x30)
- {
- if(code>=0x40)
- {
- cprintf("Error in packet header\n");
- }
- /* skip presentation and decoding time stamps */
- ld->Rdptr += 9;
- }
- else if(code>=0x20)
- {
- /* skip presentation time stamps */
- ld->Rdptr += 4;
- }
- else if(code!=0x0f)
- {
- cprintf("Error in packet header\n");
- }
- return;
- case ISO_END_CODE: /* end */
- /* simulate a buffer full of sequence end codes */
- l = 0;
- while (l<2048)
- {
- ld->Rdbfr[l++] = SEQUENCE_END_CODE>>24;
- ld->Rdbfr[l++] = SEQUENCE_END_CODE>>16;
- ld->Rdbfr[l++] = SEQUENCE_END_CODE>>8;
- ld->Rdbfr[l++] = SEQUENCE_END_CODE&0xff;
- }
- ld->Rdptr = ld->Rdbfr;
- ld->Rdmax = ld->Rdbfr + 2048;
- return;
- default:
- if(code>=SYSTEM_START_CODE)
- {
- /* skip system headers and non-video packets*/
- code = Get_Word();
- ld->Rdptr += code;
- }
- else
- {
- cprintf("Unexpected startcode %08x in system layer\n",code);
- }
- break;
- }
- }
-}
-
-
-
-void Flush_Buffer32()
-{
- int Incnt;
-
- ld->Bfr = 0;
-
- Incnt = ld->Incnt;
- Incnt -= 32;
-
- if (System_Stream_Flag && (ld->Rdptr >= ld->Rdmax-4))
- {
- while (Incnt <= 24)
- {
- if (ld->Rdptr >= ld->Rdmax)
- Next_Packet();
- ld->Bfr |= Get_Byte() << (24 - Incnt);
- Incnt += 8;
- }
- }
- else
- {
- while (Incnt <= 24)
- {
- if (ld->Rdptr >= ld->Rdbfr+2048)
- Fill_Buffer();
- ld->Bfr |= *ld->Rdptr++ << (24 - Incnt);
- Incnt += 8;
- }
- }
- ld->Incnt = Incnt;
-
-#ifdef VERIFY
- ld->Bitcnt += 32;
-#endif /* VERIFY */
-}
-
-
-unsigned int Get_Bits32()
-{
- unsigned int l;
-
- l = Show_Bits(32);
- Flush_Buffer32();
-
- return l;
-}
-
-
-int Get_Long()
-{
- int i;
-
- i = Get_Word();
- return (i<<16) | Get_Word();
-}
-
-
Index: rel_1_21/fsf/mpeg2/subspic.c
===================================================================
--- rel_1_21/fsf/mpeg2/subspic.c (revision 1217)
+++ rel_1_21/fsf/mpeg2/subspic.c (nonexistent)
@@ -1,384 +0,0 @@
-/* #define DEBUG */
-/* subspic.c, Frame buffer substitution routines */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include <stdlib.h>
-
-#include "config.h"
-#include "global.h"
-
-/* private prototypes*/
-static void Read_Frame _ANSI_ARGS_((char *filename,
- unsigned char *frame_buffer[], int framenum));
-static void Copy_Frame _ANSI_ARGS_((unsigned char *src, unsigned char *dst,
- int width, int height, int parity, int incr));
-static int Read_Components _ANSI_ARGS_ ((char *filename,
- unsigned char *frame[3], int framenum));
-static int Read_Component _ANSI_ARGS_ ((char *fname, unsigned char *frame,
- int width, int height));
-static int Extract_Components _ANSI_ARGS_ ((char *filename,
- unsigned char *frame[3], int framenum));
-
-extern int read(int Infile, void *Rdbfr, int rdsize);
-
-/* substitute frame buffer routine */
-void Substitute_Frame_Buffer (bitstream_framenum, sequence_framenum)
-int bitstream_framenum;
-int sequence_framenum;
-{
- /* static tracking variables */
- static int previous_temporal_reference;
- static int previous_bitstream_framenum;
- static int previous_anchor_temporal_reference;
- static int previous_anchor_bitstream_framenum;
- static int previous_picture_coding_type;
- static int bgate;
-
- /* local temporary variables */
- int substitute_display_framenum;
-
-
-#ifdef DEBUG
- cprintf("SUB: seq fn(%d) bitfn(%d) tempref(%d) picstr(%d) type(%d)\n",
- sequence_framenum, bitstream_framenum, temporal_reference,
- picture_structure, picture_coding_type);
-#endif
-
- /* we don't substitute at the first picture of a sequence */
- if((sequence_framenum!=0)||(Second_Field))
- {
- /* only at the start of the frame */
- if ((picture_structure==FRAME_PICTURE)||(!Second_Field))
- {
- if(picture_coding_type==P_TYPE)
- {
- /* the most recently decoded reference frame needs substituting */
- substitute_display_framenum = bitstream_framenum - 1;
-
- Read_Frame(Substitute_Picture_Filename, forward_reference_frame,
- substitute_display_framenum);
- }
- /* only the first B frame in a consequitve set of B pictures
- loads a substitute backward_reference_frame since all subsequent
- B frames predict from the same reference pictures */
- else if((picture_coding_type==B_TYPE)&&(bgate!=1))
- {
- substitute_display_framenum =
- (previous_temporal_reference - temporal_reference)
- + bitstream_framenum - 1;
-
- Read_Frame(Substitute_Picture_Filename, backward_reference_frame,
- substitute_display_framenum);
- }
- } /* P fields can predict from the two most recently decoded fields, even
- from the first field of the same frame being decoded */
- else if(Second_Field && (picture_coding_type==P_TYPE))
- {
- /* our favourite case: the IP field picture pair */
- if((previous_picture_coding_type==I_TYPE)&&(picture_coding_type==P_TYPE))
- {
- substitute_display_framenum = bitstream_framenum;
- }
- else /* our more generic P field picture pair */
- {
- substitute_display_framenum =
- (temporal_reference - previous_anchor_temporal_reference)
- + bitstream_framenum - 1;
- }
-
- Read_Frame(Substitute_Picture_Filename, current_frame, substitute_display_framenum);
- }
-#ifdef DEBUG
- else if((picture_coding_type!=B_TYPE)||(picture_coding_type!=D_TYPE))
- {
- cprintf("NO SUBS FOR THIS PICTURE\n");
- }
-#endif
- }
-
-
- /* set b gate so we don't redundantly load next time around */
- if(picture_coding_type==B_TYPE)
- bgate = 1;
- else
- bgate = 0;
-
- /* update general tracking variables */
- if((picture_structure==FRAME_PICTURE)||(!Second_Field))
- {
- previous_temporal_reference = temporal_reference;
- previous_bitstream_framenum = bitstream_framenum;
- }
-
- /* update reference frame tracking variables */
- if((picture_coding_type!=B_TYPE) &&
- ((picture_structure==FRAME_PICTURE)||Second_Field))
- {
- previous_anchor_temporal_reference = temporal_reference;
- previous_anchor_bitstream_framenum = bitstream_framenum;
- }
-
- previous_picture_coding_type = picture_coding_type;
-
-}
-
-
-/* Note: fields are only read to serve as the same-frame reference for
- a second field */
-static void Read_Frame(fname,frame,framenum)
-char *fname;
-unsigned char *frame[];
-int framenum;
-{
- int parity;
- int rerr = 0;
- int field_mode;
-
- if(framenum<0)
- cprintf("ERROR: framenum (%d) is less than zero\n", framenum);
-
-
- if(Big_Picture_Flag)
- rerr = Extract_Components(fname, substitute_frame, framenum);
- else
- rerr = Read_Components(fname, substitute_frame, framenum);
-
- if(rerr!=0)
- {
- cprintf("was unable to substitute frame\n");
- }
-
- /* now copy to the appropriate buffer */
- /* first field (which we are attempting to substitute) must be
- of opposite field parity to the current one */
- if((Second_Field)&&(picture_coding_type==P_TYPE))
- {
- parity = (picture_structure==TOP_FIELD ? 1:0);
- field_mode = (picture_structure==FRAME_PICTURE ? 0:1);
- }
- else
- {
- /* Like frame structued pictures, B pictures only substitute an entire frame
- since both fields always predict from the same frame (with respect
- to forward/backwards directions) */
- parity = 0;
- field_mode = 0;
- }
-
-
- Copy_Frame(substitute_frame[0], frame[0], Coded_Picture_Width,
- Coded_Picture_Height, parity, field_mode);
-
- Copy_Frame(substitute_frame[1], frame[1], Chroma_Width, Chroma_Height,
- parity, field_mode);
-
- Copy_Frame(substitute_frame[2], frame[2], Chroma_Width, Chroma_Height,
- parity, field_mode);
-
-#ifdef VERBOSE
- if(Verbose_Flag > NO_LAYER)
- cprintf("substituted %s %d\n",
- (field_mode ? (parity?"bottom field":"bottom field"):"frame"), framenum);
-#endif
-}
-
-
-
-
-static int Read_Components(filename, frame, framenum)
-char *filename;
-unsigned char *frame[3];
-int framenum;
-{
- int err = 0;
- char outname[FILENAME_LENGTH];
- char name[FILENAME_LENGTH];
-
- sprintf(outname,filename,framenum);
-
-
- sprintf(name,"%s.Y",outname);
- err += Read_Component(name, frame[0], Coded_Picture_Width,
- Coded_Picture_Height);
-
- sprintf(name,"%s.U",outname);
- err += Read_Component(name, frame[1], Chroma_Width, Chroma_Height);
-
- sprintf(name,"%s.V",outname);
- err += Read_Component(name, frame[2], Chroma_Width, Chroma_Height);
-
- return(err);
-}
-
-
-static int Read_Component(Filename, Frame, Width, Height)
-char *Filename;
-unsigned char *Frame;
-int Width;
-int Height;
-{
- int Size;
- int Bytes_Read;
- int Infile;
-
- Size = Width*Height;
-
-#ifdef DEBUG
- cprintf("SUBS: reading %s\n", filename);
-#endif
-
- if(!(Infile=1)<0)
- {
- cprintf("ERROR: unable to open reference filename (%s)\n", Filename);
- return(-1);
- }
-
- Bytes_Read = read(Infile, Frame, Size);
-
- if(Bytes_Read!=Size)
- {
- cprintf("was able to read only %d bytes of %d of file %s\n",
- Bytes_Read, Size, Filename);
- }
-
- return(0);
-}
-
-
-/* optimization: do not open the big file each time. Open once at start
- of decoder, and close at the very last frame */
-
-/* Note: "big" files were used in E-mail exchanges almost exclusively by the
- MPEG Committee's syntax validation and conformance ad-hoc groups from
- the year 1993 until 1995 */
-static int Extract_Components(filename, frame, framenum)
-char *filename;
-unsigned char *frame[3];
-int framenum;
-{
-/* int err = 0; */
- int line;
- int size, offset;
-
- cprintf("Extract_Components\n");
-
- /* compute size of each frame (in bytes) */
- size = (Coded_Picture_Width*Coded_Picture_Height);
-
- if(chroma_format==CHROMA444)
- size = (size * 3);
- else if(chroma_format==CHROMA422)
- size = (size * 2);
- else if(chroma_format==CHROMA420)
- size = ((size*3)>>1);
- else
- cprintf("ERROR: chroma_format (%d) not recognized\n", chroma_format);
-
-
- /* compute distance into "big" file */
- offset = size*framenum;
-
-#ifdef DEBUG
- printf("EXTRACTING: frame(%d) offset(%d), size (%d) from %s\n",
- framenum, offset, size, filename);
-#endif
-
- /* seek to location in big file where desired frame begins */
- /* note: this offset cannot exceed a few billion bytes due to the */
- /* obvious limitations of 32-bit integers */
- //fseek(fd, offset, 0);
-
- /* Y */
- for (line=0; line<Coded_Picture_Height; line++)
- {
- //fread(frame[0]+(line*Coded_Picture_Width),1,Coded_Picture_Width,fd);
- }
-
- /* Cb */
- for (line=0; line<Chroma_Height; line++)
- {
- //fread(frame[1]+(line*Chroma_Width),1,Chroma_Width,fd);
- }
-
- /* Cr */
- for (line=0; line<Chroma_Height; line++)
- {
- //fread(frame[2]+(line*Chroma_Width),1,Chroma_Width,fd);
- }
-
-
- //fclose(fd);
- return(0);
-}
-
-
-static void Copy_Frame(src, dst, width, height, parity, field_mode)
-unsigned char *src;
-unsigned char *dst;
-int width;
-int height;
-int parity; /* field parity (top or bottom) to overwrite */
-int field_mode; /* 0 = frame, 1 = field */
-{
- int row, col;
- int s, d;
- int incr;
-
- s = d = 0;
-
-#ifdef DEBUG
- cprintf("COPYING (w=%d, h=%d, parity=%d, field_mode=%d)\n",
- width,height,parity,field_mode);
-#endif /* DEBUG */
-
- if(field_mode)
- {
- incr = 2;
-
- if(parity==0)
- s += width;
- }
- else
- {
- incr = 1;
- }
-
- for(row=0; row<height; row+=incr)
- {
- for(col=0; col<width; col++)
- {
- dst[d+col] = src[s+col];
- }
-
- d += (width*incr);
- s += (width*incr);
- }
-
-}
-
Index: rel_1_21/fsf/mpeg2/getblk.c
===================================================================
--- rel_1_21/fsf/mpeg2/getblk.c (revision 1217)
+++ rel_1_21/fsf/mpeg2/getblk.c (nonexistent)
@@ -1,571 +0,0 @@
-/* getblk.c, DCT block decoding */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include "config.h"
-#include "global.h"
-
-
-/* defined in getvlc.h */
-typedef struct {
- char run, level, len;
-} DCTtab;
-
-extern DCTtab DCTtabfirst[],DCTtabnext[],DCTtab0[],DCTtab1[];
-extern DCTtab DCTtab2[],DCTtab3[],DCTtab4[],DCTtab5[],DCTtab6[];
-extern DCTtab DCTtab0a[],DCTtab1a[];
-
-
-/* decode one intra coded MPEG-1 block */
-
-void Decode_MPEG1_Intra_Block(comp,dc_dct_pred)
-int comp;
-int dc_dct_pred[];
-{
- int val, i, j, sign;
- unsigned int code;
- DCTtab *tab;
- short *bp;
-
- bp = ld->block[comp];
-
- /* ISO/IEC 11172-2 section 2.4.3.7: Block layer. */
- /* decode DC coefficients */
- if (comp<4)
- bp[0] = (dc_dct_pred[0]+=Get_Luma_DC_dct_diff()) << 3;
- else if (comp==4)
- bp[0] = (dc_dct_pred[1]+=Get_Chroma_DC_dct_diff()) << 3;
- else
- bp[0] = (dc_dct_pred[2]+=Get_Chroma_DC_dct_diff()) << 3;
-
- if (Fault_Flag) return;
-
- /* D-pictures do not contain AC coefficients */
- if(picture_coding_type == D_TYPE)
- return;
-
- /* decode AC coefficients */
- for (i=1; ; i++)
- {
- code = Show_Bits(16);
- if (code>=16384)
- tab = &DCTtabnext[(code>>12)-4];
- else if (code>=1024)
- tab = &DCTtab0[(code>>8)-4];
- else if (code>=512)
- tab = &DCTtab1[(code>>6)-8];
- else if (code>=256)
- tab = &DCTtab2[(code>>4)-16];
- else if (code>=128)
- tab = &DCTtab3[(code>>3)-16];
- else if (code>=64)
- tab = &DCTtab4[(code>>2)-16];
- else if (code>=32)
- tab = &DCTtab5[(code>>1)-16];
- else if (code>=16)
- tab = &DCTtab6[code-16];
- else
- {
- if (!Quiet_Flag)
- cprintf("invalid Huffman code in Decode_MPEG1_Intra_Block()\n");
- Fault_Flag = 1;
- return;
- }
-
- Flush_Buffer(tab->len);
-
- if (tab->run==64) /* end_of_block */
- return;
-
- if (tab->run==65) /* escape */
- {
- i+= Get_Bits(6);
-
- val = Get_Bits(8);
- if (val==0)
- val = Get_Bits(8);
- else if (val==128)
- val = Get_Bits(8) - 256;
- else if (val>128)
- val -= 256;
-
- if((sign = (val<0)))
- val = -val;
- }
- else
- {
- i+= tab->run;
- val = tab->level;
- sign = Get_Bits(1);
- }
-
- if (i>=64)
- {
- if (!Quiet_Flag)
- cprintf("DCT coeff index (i) out of bounds (intra)\n");
- Fault_Flag = 1;
- return;
- }
-
- j = scan[ZIG_ZAG][i];
- val = (val*ld->quantizer_scale*ld->intra_quantizer_matrix[j]) >> 3;
-
- /* mismatch control ('oddification') */
- if (val!=0) /* should always be true, but it's not guaranteed */
- val = (val-1) | 1; /* equivalent to: if ((val&1)==0) val = val - 1; */
-
- /* saturation */
- if (!sign)
- bp[j] = (val>2047) ? 2047 : val; /* positive */
- else
- bp[j] = (val>2048) ? -2048 : -val; /* negative */
- }
-}
-
-
-/* decode one non-intra coded MPEG-1 block */
-
-void Decode_MPEG1_Non_Intra_Block(comp)
-int comp;
-{
- int val, i, j, sign;
- unsigned int code;
- DCTtab *tab;
- short *bp;
-
- bp = ld->block[comp];
-
- /* decode AC coefficients */
- for (i=0; ; i++)
- {
- code = Show_Bits(16);
- if (code>=16384)
- {
- if (i==0)
- tab = &DCTtabfirst[(code>>12)-4];
- else
- tab = &DCTtabnext[(code>>12)-4];
- }
- else if (code>=1024)
- tab = &DCTtab0[(code>>8)-4];
- else if (code>=512)
- tab = &DCTtab1[(code>>6)-8];
- else if (code>=256)
- tab = &DCTtab2[(code>>4)-16];
- else if (code>=128)
- tab = &DCTtab3[(code>>3)-16];
- else if (code>=64)
- tab = &DCTtab4[(code>>2)-16];
- else if (code>=32)
- tab = &DCTtab5[(code>>1)-16];
- else if (code>=16)
- tab = &DCTtab6[code-16];
- else
- {
- if (!Quiet_Flag)
- cprintf("invalid Huffman code in Decode_MPEG1_Non_Intra_Block()\n");
- Fault_Flag = 1;
- return;
- }
-
- Flush_Buffer(tab->len);
-
- if (tab->run==64) /* end_of_block */
- return;
-
- if (tab->run==65) /* escape */
- {
- i+= Get_Bits(6);
-
- val = Get_Bits(8);
- if (val==0)
- val = Get_Bits(8);
- else if (val==128)
- val = Get_Bits(8) - 256;
- else if (val>128)
- val -= 256;
-
- if((sign = (val<0)))
- val = -val;
- }
- else
- {
- i+= tab->run;
- val = tab->level;
- sign = Get_Bits(1);
- }
-
- if (i>=64)
- {
- if (!Quiet_Flag)
- cprintf("DCT coeff index (i) out of bounds (inter)\n");
- Fault_Flag = 1;
- return;
- }
-
- j = scan[ZIG_ZAG][i];
- val = (((val<<1)+1)*ld->quantizer_scale*ld->non_intra_quantizer_matrix[j]) >> 4;
-
- /* mismatch control ('oddification') */
- if (val!=0) /* should always be true, but it's not guaranteed */
- val = (val-1) | 1; /* equivalent to: if ((val&1)==0) val = val - 1; */
-
- /* saturation */
- if (!sign)
- bp[j] = (val>2047) ? 2047 : val; /* positive */
- else
- bp[j] = (val>2048) ? -2048 : -val; /* negative */
- }
-}
-
-
-/* decode one intra coded MPEG-2 block */
-
-void Decode_MPEG2_Intra_Block(comp,dc_dct_pred)
-int comp;
-int dc_dct_pred[];
-{
- int val, i, j, sign, nc, cc, run;
- unsigned int code;
- DCTtab *tab;
- short *bp;
- int *qmat;
- struct layer_data *ld1;
-
- /* with data partitioning, data always goes to base layer */
- ld1 = (ld->scalable_mode==SC_DP) ? &base : ld;
- bp = ld1->block[comp];
-
- if (base.scalable_mode==SC_DP) {
- if (base.priority_breakpoint<64)
- ld = &enhan;
- else
- ld = &base;
- }
-
- cc = (comp<4) ? 0 : (comp&1)+1;
-
- qmat = (comp<4 || chroma_format==CHROMA420)
- ? ld1->intra_quantizer_matrix
- : ld1->chroma_intra_quantizer_matrix;
-
- /* ISO/IEC 13818-2 section 7.2.1: decode DC coefficients */
- if (cc==0)
- val = (dc_dct_pred[0]+= Get_Luma_DC_dct_diff());
- else if (cc==1)
- val = (dc_dct_pred[1]+= Get_Chroma_DC_dct_diff());
- else
- val = (dc_dct_pred[2]+= Get_Chroma_DC_dct_diff());
-
- if (Fault_Flag) return;
-
- bp[0] = val << (3-intra_dc_precision);
-
- nc=0;
-
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("DCT(%d)i:",comp);
-#endif /* TRACE */
-
- /* decode AC coefficients */
- for (i=1; ; i++)
- {
- code = Show_Bits(16);
- if (code>=16384 && !intra_vlc_format)
- tab = &DCTtabnext[(code>>12)-4];
- else if (code>=1024)
- {
- if (intra_vlc_format)
- tab = &DCTtab0a[(code>>8)-4];
- else
- tab = &DCTtab0[(code>>8)-4];
- }
- else if (code>=512)
- {
- if (intra_vlc_format)
- tab = &DCTtab1a[(code>>6)-8];
- else
- tab = &DCTtab1[(code>>6)-8];
- }
- else if (code>=256)
- tab = &DCTtab2[(code>>4)-16];
- else if (code>=128)
- tab = &DCTtab3[(code>>3)-16];
- else if (code>=64)
- tab = &DCTtab4[(code>>2)-16];
- else if (code>=32)
- tab = &DCTtab5[(code>>1)-16];
- else if (code>=16)
- tab = &DCTtab6[code-16];
- else
- {
- if (!Quiet_Flag)
- cprintf("invalid Huffman code in Decode_MPEG2_Intra_Block()\n");
- Fault_Flag = 1;
- return;
- }
-
- Flush_Buffer(tab->len);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- printf(" (");
- Print_Bits(code,16,tab->len);
- }
-#endif /* TRACE */
-
- if (tab->run==64) /* end_of_block */
- {
-#ifdef TRACE
- if (Trace_Flag)
- printf("): EOB\n");
-#endif /* TRACE */
- return;
- }
-
- if (tab->run==65) /* escape */
- {
-#ifdef TRACE
- if (Trace_Flag)
- {
- putchar(' ');
- Print_Bits(Show_Bits(6),6,6);
- }
-#endif /* TRACE */
-
- i+= run = Get_Bits(6);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- putchar(' ');
- Print_Bits(Show_Bits(12),12,12);
- }
-#endif /* TRACE */
-
- val = Get_Bits(12);
- if ((val&2047)==0)
- {
- if (!Quiet_Flag)
- cprintf("invalid escape in Decode_MPEG2_Intra_Block()\n");
- Fault_Flag = 1;
- return;
- }
- if((sign = (val>=2048)))
- val = 4096 - val;
- }
- else
- {
- i+= run = tab->run;
- val = tab->level;
- sign = Get_Bits(1);
-
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("%d",sign);
-#endif /* TRACE */
- }
-
- if (i>=64)
- {
- if (!Quiet_Flag)
- cprintf("DCT coeff index (i) out of bounds (intra2)\n");
- Fault_Flag = 1;
- return;
- }
-
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("): %d/%d",run,sign ? -val : val);
-#endif /* TRACE */
-
- j = scan[ld1->alternate_scan][i];
- val = (val * ld1->quantizer_scale * qmat[j]) >> 4;
- bp[j] = sign ? -val : val;
- nc++;
-
- if (base.scalable_mode==SC_DP && nc==base.priority_breakpoint-63)
- ld = &enhan;
- }
-}
-
-
-/* decode one non-intra coded MPEG-2 block */
-
-void Decode_MPEG2_Non_Intra_Block(comp)
-int comp;
-{
- int val, i, j, sign, nc, run;
- unsigned int code;
- DCTtab *tab;
- short *bp;
- int *qmat;
- struct layer_data *ld1;
-
- /* with data partitioning, data always goes to base layer */
- ld1 = (ld->scalable_mode==SC_DP) ? &base : ld;
- bp = ld1->block[comp];
-
- if (base.scalable_mode==SC_DP) {
- if (base.priority_breakpoint<64)
- ld = &enhan;
- else
- ld = &base;
- }
-
- qmat = (comp<4 || chroma_format==CHROMA420)
- ? ld1->non_intra_quantizer_matrix
- : ld1->chroma_non_intra_quantizer_matrix;
-
- nc = 0;
-
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("DCT(%d)n:",comp);
-#endif /* TRACE */
-
- /* decode AC coefficients */
- for (i=0; ; i++)
- {
- code = Show_Bits(16);
- if (code>=16384)
- {
- if (i==0)
- tab = &DCTtabfirst[(code>>12)-4];
- else
- tab = &DCTtabnext[(code>>12)-4];
- }
- else if (code>=1024)
- tab = &DCTtab0[(code>>8)-4];
- else if (code>=512)
- tab = &DCTtab1[(code>>6)-8];
- else if (code>=256)
- tab = &DCTtab2[(code>>4)-16];
- else if (code>=128)
- tab = &DCTtab3[(code>>3)-16];
- else if (code>=64)
- tab = &DCTtab4[(code>>2)-16];
- else if (code>=32)
- tab = &DCTtab5[(code>>1)-16];
- else if (code>=16)
- tab = &DCTtab6[code-16];
- else
- {
- if (!Quiet_Flag)
- cprintf("invalid Huffman code in Decode_MPEG2_Non_Intra_Block()\n");
- Fault_Flag = 1;
- return;
- }
-
- Flush_Buffer(tab->len);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- cprintf(" (");
- Print_Bits(code,16,tab->len);
- }
-#endif /* TRACE */
-
- if (tab->run==64) /* end_of_block */
- {
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("): EOB\n");
-#endif /* TRACE */
- return;
- }
-
- if (tab->run==65) /* escape */
- {
-#ifdef TRACE
- if (Trace_Flag)
- {
- cprintf(" ");
- Print_Bits(Show_Bits(6),6,6);
- }
-#endif /* TRACE */
-
- i+= run = Get_Bits(6);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- cprintf(" ");
- Print_Bits(Show_Bits(12),12,12);
- }
-#endif /* TRACE */
-
- val = Get_Bits(12);
- if ((val&2047)==0)
- {
- if (!Quiet_Flag)
- cprintf("invalid escape in Decode_MPEG2_Intra_Block()\n");
- Fault_Flag = 1;
- return;
- }
- if((sign = (val>=2048)))
- val = 4096 - val;
- }
- else
- {
- i+= run = tab->run;
- val = tab->level;
- sign = Get_Bits(1);
-
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("%d",sign);
-#endif /* TRACE */
- }
-
- if (i>=64)
- {
- if (!Quiet_Flag)
- cprintf("DCT coeff index (i) out of bounds (inter2)\n");
- Fault_Flag = 1;
- return;
- }
-
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("): %d/%d",run,sign?-val:val);
-#endif /* TRACE */
-
- j = scan[ld1->alternate_scan][i];
- val = (((val<<1)+1) * ld1->quantizer_scale * qmat[j]) >> 5;
- bp[j] = sign ? -val : val;
- nc++;
-
- if (base.scalable_mode==SC_DP && nc==base.priority_breakpoint-63)
- ld = &enhan;
- }
-}
-
Index: rel_1_21/fsf/mpeg2/spatscal.c
===================================================================
--- rel_1_21/fsf/mpeg2/spatscal.c (revision 1217)
+++ rel_1_21/fsf/mpeg2/spatscal.c (nonexistent)
@@ -1,275 +0,0 @@
-
-#include "config.h"
-#include "global.h"
-
-/* private prototypes */
-static void Read_Lower_Layer_Component_Framewise _ANSI_ARGS_((int comp, int lw, int lh));
-static void Read_Lower_Layer_Component_Fieldwise _ANSI_ARGS_((int comp, int lw, int lh));
-static void Make_Spatial_Prediction_Frame _ANSI_ARGS_((int progressive_frame,
- int llprogressive_frame, unsigned char *fld0, unsigned char *fld1,
- short *tmp, unsigned char *dst, int llx0, int lly0, int llw, int llh,
- int horizontal_size, int vertical_size, int vm, int vn, int hm, int hn,
- int aperture));
-static void Deinterlace _ANSI_ARGS_((unsigned char *fld0, unsigned char *fld1,
- int j0, int lx, int ly, int aperture));
-static void Subsample_Vertical _ANSI_ARGS_((unsigned char *s, short *d,
- int lx, int lys, int lyd, int m, int n, int j0, int dj));
-static void Subsample_Horizontal _ANSI_ARGS_((short *s, unsigned char *d,
- int x0, int lx, int lxs, int lxd, int ly, int m, int n));
-
-
-
-/* get reference frame */
-void Spatial_Prediction()
-{
-
- if(Frame_Store_Flag)
- {
- Read_Lower_Layer_Component_Framewise(0,lower_layer_prediction_horizontal_size,
- lower_layer_prediction_vertical_size); /* Y */
- Read_Lower_Layer_Component_Framewise(1,lower_layer_prediction_horizontal_size>>1,
- lower_layer_prediction_vertical_size>>1); /* Cb ("U") */
- Read_Lower_Layer_Component_Framewise(2,lower_layer_prediction_horizontal_size>>1,
- lower_layer_prediction_vertical_size>>1); /* Cr ("V") */
- }
- else
- {
- Read_Lower_Layer_Component_Fieldwise(0,lower_layer_prediction_horizontal_size,
- lower_layer_prediction_vertical_size); /* Y */
- Read_Lower_Layer_Component_Fieldwise(1,lower_layer_prediction_horizontal_size>>1,
- lower_layer_prediction_vertical_size>>1); /* Cb ("U") */
- Read_Lower_Layer_Component_Fieldwise(2,lower_layer_prediction_horizontal_size>>1,
- lower_layer_prediction_vertical_size>>1); /* Cr ("V") */
- }
-
-
- Make_Spatial_Prediction_Frame /* Y */
- (progressive_frame,lower_layer_progressive_frame,llframe0[0],llframe1[0],
- lltmp,current_frame[0],lower_layer_horizontal_offset,
- lower_layer_vertical_offset,
- lower_layer_prediction_horizontal_size,
- lower_layer_prediction_vertical_size,
- horizontal_size,vertical_size,vertical_subsampling_factor_m,
- vertical_subsampling_factor_n,horizontal_subsampling_factor_m,
- horizontal_subsampling_factor_n,
- picture_structure!=FRAME_PICTURE); /* this changed from CD to DIS */
-
- Make_Spatial_Prediction_Frame /* Cb */
- (progressive_frame,lower_layer_progressive_frame,llframe0[1],llframe1[1],
- lltmp,current_frame[1],lower_layer_horizontal_offset/2,
- lower_layer_vertical_offset/2,
- lower_layer_prediction_horizontal_size>>1,
- lower_layer_prediction_vertical_size>>1,
- horizontal_size>>1,vertical_size>>1,vertical_subsampling_factor_m,
- vertical_subsampling_factor_n,horizontal_subsampling_factor_m,
- horizontal_subsampling_factor_n,1);
-
- Make_Spatial_Prediction_Frame /* Cr */
- (progressive_frame,lower_layer_progressive_frame,llframe0[2],llframe1[2],
- lltmp,current_frame[2],lower_layer_horizontal_offset/2,
- lower_layer_vertical_offset/2,
- lower_layer_prediction_horizontal_size>>1,
- lower_layer_prediction_vertical_size>>1,
- horizontal_size>>1,vertical_size>>1,vertical_subsampling_factor_m,
- vertical_subsampling_factor_n,horizontal_subsampling_factor_m,
- horizontal_subsampling_factor_n,1);
-
-}
-
-static void Read_Lower_Layer_Component_Framewise(comp,lw,lh)
- int comp;
- int lw, lh;
-{
- cprintf("Read_Lower_Layer_Component_Framewise\n");
-}
-
-
-static void Read_Lower_Layer_Component_Fieldwise(comp,lw,lh)
- int comp;
- int lw, lh;
-{
- cprintf("Read_Lower_Layer_Component_Fieldwise\n");
-}
-
-
-/* form spatial prediction */
-static void Make_Spatial_Prediction_Frame(progressive_frame,
- llprogressive_frame,fld0,fld1,tmp,dst,llx0,lly0,llw,llh,horizontal_size,
- vertical_size,vm,vn,hm,hn,aperture)
-int progressive_frame,llprogressive_frame;
-unsigned char *fld0,*fld1;
-short *tmp;
-unsigned char *dst;
-int llx0,lly0,llw,llh,horizontal_size,vertical_size,vm,vn,hm,hn,aperture;
-{
- int w, h, x0, llw2, llh2;
-
- llw2 = (llw*hn)/hm;
- llh2 = (llh*vn)/vm;
-
- if (llprogressive_frame)
- {
- /* progressive -> progressive / interlaced */
- Subsample_Vertical(fld0,tmp,llw,llh,llh2,vm,vn,0,1);
- }
- else if (progressive_frame)
- {
- /* interlaced -> progressive */
- if (lower_layer_deinterlaced_field_select)
- {
- Deinterlace(fld1,fld0,0,llw,llh,aperture);
- Subsample_Vertical(fld1,tmp,llw,llh,llh2,vm,vn,0,1);
- }
- else
- {
- Deinterlace(fld0,fld1,1,llw,llh,aperture);
- Subsample_Vertical(fld0,tmp,llw,llh,llh2,vm,vn,0,1);
- }
- }
- else
- {
- /* interlaced -> interlaced */
- Deinterlace(fld0,fld1,1,llw,llh,aperture);
- Deinterlace(fld1,fld0,0,llw,llh,aperture);
- Subsample_Vertical(fld0,tmp,llw,llh,llh2,vm,vn,0,2);
- Subsample_Vertical(fld1,tmp,llw,llh,llh2,vm,vn,1,2);
- }
-
- /* vertical limits */
- if (lly0<0)
- {
- tmp-= llw*lly0;
- llh2+= lly0;
- if (llh2<0)
- llh2 = 0;
- h = (vertical_size<llh2) ? vertical_size : llh2;
- }
- else
- {
- dst+= horizontal_size*lly0;
- h= vertical_size - lly0;
- if (h>llh2)
- h = llh2;
- }
-
- /* horizontal limits */
- if (llx0<0)
- {
- x0 = -llx0;
- llw2+= llx0;
- if (llw2<0)
- llw2 = 0;
- w = (horizontal_size<llw2) ? horizontal_size : llw2;
- }
- else
- {
- dst+= llx0;
- x0 = 0;
- w = horizontal_size - llx0;
- if (w>llw2)
- w = llw2;
- }
-
- Subsample_Horizontal(tmp,dst,x0,w,llw,horizontal_size,h,hm,hn);
-}
-
-/* deinterlace one field (interpolate opposite parity samples)
- *
- * deinterlacing is done in-place: if j0=1, fld0 contains the input field in
- * its even lines and the odd lines are interpolated by this routine
- * if j0=0, the input field is in the odd lines and the even lines are
- * interpolated
- *
- * fld0: field to be deinterlaced
- * fld1: other field (referenced by the two field aperture filter)
- * j0: 0: interpolate even (top) lines, 1: interpolate odd (bottom) lines
- * lx: width of fld0 and fld1
- * ly: height of the deinterlaced field (has to be even)
- * aperture: 1: use one field aperture filter (two field otherwise)
- */
-static void Deinterlace(fld0,fld1,j0,lx,ly,aperture)
-unsigned char *fld0,*fld1;
-int j0,lx,ly; /* ly has to be even */
-int aperture;
-{
- int i,j,v;
- unsigned char *p0, *p0m1, *p0p1, *p1, *p1m2, *p1p2;
-
- /* deinterlace one field */
- for (j=j0; j<ly; j+=2)
- {
- p0 = fld0+lx*j;
- p0m1 = (j==0) ? p0+lx : p0-lx;
- p0p1 = (j==ly-1) ? p0-lx : p0+lx;
-
- if (aperture)
- for (i=0; i<lx; i++)
- p0[i] = (unsigned int)(p0m1[i] + p0p1[i] + 1)>>1;
- else
- {
- p1 = fld1 + lx*j;
- p1m2 = (j<2) ? p1 : p1-2*lx;
- p1p2 = (j>=ly-2) ? p1 : p1+2*lx;
- for (i=0; i<lx; i++)
- {
- v = 8*(p0m1[i]+p0p1[i]) + 2*p1[i] - p1m2[i] - p1p2[i];
- p0[i] = Clip[(v + ((v>=0) ? 8 : 7))>>4];
- }
- }
- }
-}
-
-/* vertical resampling */
-static void Subsample_Vertical(s,d,lx,lys,lyd,m,n,j0,dj)
-unsigned char *s;
-short *d;
-int lx, lys, lyd, m, n, j0, dj;
-{
- int i, j, c1, c2, jd;
- unsigned char *s1, *s2;
- short *d1;
-
- for (j=j0; j<lyd; j+=dj)
- {
- d1 = d + lx*j;
- jd = (j*m)/n;
- s1 = s + lx*jd;
- s2 = (jd<lys-1)? s1+lx : s1;
- c2 = (16*((j*m)%n) + (n>>1))/n;
- c1 = 16 - c2;
- for (i=0; i<lx; i++)
- d1[i] = c1*s1[i] + c2*s2[i];
- }
-}
-
-/* horizontal resampling */
-static void Subsample_Horizontal(s,d,x0,lx,lxs,lxd,ly,m,n)
-short *s;
-unsigned char *d;
-int x0, lx, lxs, lxd, ly, m, n;
-{
- int i, i1, j, id, c1, c2, v;
- short *s1, *s2;
- unsigned char *d1;
-
- for (i1=0; i1<lx; i1++)
- {
- d1 = d + i1;
- i = x0 + i1;
- id = (i*m)/n;
- s1 = s+id;
- s2 = (id<lxs-1) ? s1+1 : s1;
- c2 = (16*((i*m)%n) + (n>>1))/n;
- c1 = 16 - c2;
- for (j=0; j<ly; j++)
- {
- v = c1*(*s1) + c2*(*s2);
- *d1 = (v + ((v>=0) ? 128 : 127))>>8;
- d1+= lxd;
- s1+= lxs;
- s2+= lxs;
- }
- }
-}
-
-
Index: rel_1_21/fsf/mpeg2/config.h
===================================================================
--- rel_1_21/fsf/mpeg2/config.h (revision 1217)
+++ rel_1_21/fsf/mpeg2/config.h (nonexistent)
@@ -1,45 +0,0 @@
-/* config.h, configuration defines */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-/* define NON_ANSI_COMPILER for compilers without function prototyping */
-/* #define NON_ANSI_COMPILER */
-
-#ifdef NON_ANSI_COMPILER
-#define _ANSI_ARGS_(x) ()
-#else
-#define _ANSI_ARGS_(x) x
-#endif
-
-#define RB "rb"
-#define WB "wb"
-
-#ifndef O_BINARY
-#define O_BINARY 0
-
-#endif
Index: rel_1_21/fsf/mpeg2/getpic.c
===================================================================
--- rel_1_21/fsf/mpeg2/getpic.c (revision 1217)
+++ rel_1_21/fsf/mpeg2/getpic.c (nonexistent)
@@ -1,1223 +0,0 @@
-/* getpic.c, picture decoding */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include "config.h"
-#include "global.h"
-
-/* private prototypes*/
-static void picture_data _ANSI_ARGS_((int framenum));
-static void macroblock_modes _ANSI_ARGS_((int *pmacroblock_type, int *pstwtype,
- int *pstwclass, int *pmotion_type, int *pmotion_vector_count, int *pmv_format, int *pdmv,
- int *pmvscale, int *pdct_type));
-static void Clear_Block _ANSI_ARGS_((int comp));
-static void Sum_Block _ANSI_ARGS_((int comp));
-static void Saturate _ANSI_ARGS_((short *bp));
-static void Add_Block _ANSI_ARGS_((int comp, int bx, int by,
- int dct_type, int addflag));
-static void Update_Picture_Buffers _ANSI_ARGS_((void));
-static void frame_reorder _ANSI_ARGS_((int bitstream_framenum,
- int sequence_framenum));
-static void Decode_SNR_Macroblock _ANSI_ARGS_((int *SNRMBA, int *SNRMBAinc,
- int MBA, int MBAmax, int *dct_type));
-
-static void motion_compensation _ANSI_ARGS_((int MBA, int macroblock_type,
- int motion_type, int PMV[2][2][2], int motion_vertical_field_select[2][2],
- int dmvector[2], int stwtype, int dct_type));
-
-static void skipped_macroblock _ANSI_ARGS_((int dc_dct_pred[3],
- int PMV[2][2][2], int *motion_type, int motion_vertical_field_select[2][2],
- int *stwtype, int *macroblock_type));
-
-static int slice _ANSI_ARGS_((int framenum, int MBAmax));
-
-static int start_of_slice _ANSI_ARGS_ ((int MBAmax, int *MBA,
- int *MBAinc, int dc_dct_pred[3], int PMV[2][2][2]));
-
-static int decode_macroblock _ANSI_ARGS_((int *macroblock_type,
- int *stwtype, int *stwclass, int *motion_type, int *dct_type,
- int PMV[2][2][2], int dc_dct_pred[3],
- int motion_vertical_field_select[2][2], int dmvector[2]));
-
-
-/* decode one frame or field picture */
-void Decode_Picture(bitstream_framenum, sequence_framenum)
-int bitstream_framenum, sequence_framenum;
-{
-
- if (picture_structure==FRAME_PICTURE && Second_Field)
- {
- /* recover from illegal number of field pictures */
- cprintf("odd number of field pictures\n");
- Second_Field = 0;
- }
-
- /* IMPLEMENTATION: update picture buffer pointers */
- Update_Picture_Buffers();
-
-#ifdef VERIFY
- Check_Headers(bitstream_framenum, sequence_framenum);
-#endif /* VERIFY */
-
- /* ISO/IEC 13818-4 section 2.4.5.4 "frame buffer intercept method" */
- /* (section number based on November 1995 (Dallas) draft of the
- conformance document) */
- if(Ersatz_Flag)
- Substitute_Frame_Buffer(bitstream_framenum, sequence_framenum);
-
- /* form spatial scalable picture */
-
- /* form spatial scalable picture */
- /* ISO/IEC 13818-2 section 7.7: Spatial scalability */
- if (base.pict_scal && !Second_Field)
- {
- Spatial_Prediction();
- }
-
- /* decode picture data ISO/IEC 13818-2 section 6.2.3.7 */
- picture_data(bitstream_framenum);
-
- /* write or display current or previously decoded reference frame */
- /* ISO/IEC 13818-2 section 6.1.1.11: Frame reordering */
- frame_reorder(bitstream_framenum, sequence_framenum);
-
- if (picture_structure!=FRAME_PICTURE)
- Second_Field = !Second_Field;
-}
-
-
-/* decode all macroblocks of the current picture */
-/* stages described in ISO/IEC 13818-2 section 7 */
-static void picture_data(framenum)
-int framenum;
-{
- int MBAmax;
- int ret;
-
- /* number of macroblocks per picture */
- MBAmax = mb_width*mb_height;
-
- if (picture_structure!=FRAME_PICTURE)
- MBAmax>>=1; /* field picture has half as mnay macroblocks as frame */
-
- for(;;)
- {
- if((ret=slice(framenum, MBAmax))<0)
- return;
- }
-
-}
-
-
-
-/* decode all macroblocks of the current picture */
-/* ISO/IEC 13818-2 section 6.3.16 */
-static int slice(framenum, MBAmax)
-int framenum, MBAmax;
-{
- int MBA;
- int MBAinc, macroblock_type, motion_type, dct_type;
- int dc_dct_pred[3];
- int PMV[2][2][2], motion_vertical_field_select[2][2];
- int dmvector[2];
- int stwtype, stwclass;
- int SNRMBA, SNRMBAinc;
- int ret;
-
- MBA = 0; /* macroblock address */
- MBAinc = 0;
-
- if((ret=start_of_slice(MBAmax, &MBA, &MBAinc, dc_dct_pred, PMV))!=1)
- return(ret);
-
- if (Two_Streams && enhan.scalable_mode==SC_SNR)
- {
- SNRMBA=0;
- SNRMBAinc=0;
- }
-
- Fault_Flag=0;
-
- for (;;)
- {
-
- /* this is how we properly exit out of picture */
- if (MBA>=MBAmax)
- return(-1); /* all macroblocks decoded */
-
-#ifdef TRACE
- if (Trace_Flag)
- cprintf("frame %d, MB %d\n",framenum,MBA);
-#endif /* TRACE */
-
-#ifdef DISPLAY
- if (!progressive_frame && picture_structure==FRAME_PICTURE
- && MBA==(MBAmax>>1) && framenum!=0 && Output_Type==T_X11
- && !Display_Progressive_Flag)
- {
- Display_Second_Field();
- }
-#endif
-
- ld = &base;
-
- if (MBAinc==0)
- {
- if (base.scalable_mode==SC_DP && base.priority_breakpoint==1)
- ld = &enhan;
-
- if (!Show_Bits(23) || Fault_Flag) /* next_start_code or fault */
- {
-resync: /* if Fault_Flag: resynchronize to next next_start_code */
- Fault_Flag = 0;
- return(0); /* trigger: go to next slice */
- }
- else /* neither next_start_code nor Fault_Flag */
- {
- if (base.scalable_mode==SC_DP && base.priority_breakpoint==1)
- ld = &enhan;
-
- /* decode macroblock address increment */
- MBAinc = Get_macroblock_address_increment();
-
- if (Fault_Flag) goto resync;
- }
- }
-
- if (MBA>=MBAmax)
- {
- /* MBAinc points beyond picture dimensions */
- if (!Quiet_Flag)
- cprintf("Too many macroblocks in picture\n");
- return(-1);
- }
-
- if (MBAinc==1) /* not skipped */
- {
- ret = decode_macroblock(&macroblock_type, &stwtype, &stwclass,
- &motion_type, &dct_type, PMV, dc_dct_pred,
- motion_vertical_field_select, dmvector);
-
- if(ret==-1)
- return(-1);
-
- if(ret==0)
- goto resync;
-
- }
- else /* MBAinc!=1: skipped macroblock */
- {
- /* ISO/IEC 13818-2 section 7.6.6 */
- skipped_macroblock(dc_dct_pred, PMV, &motion_type,
- motion_vertical_field_select, &stwtype, &macroblock_type);
- }
-
- /* SCALABILITY: SNR */
- /* ISO/IEC 13818-2 section 7.8 */
- /* NOTE: we currently ignore faults encountered in this routine */
- if (Two_Streams && enhan.scalable_mode==SC_SNR)
- Decode_SNR_Macroblock(&SNRMBA, &SNRMBAinc, MBA, MBAmax, &dct_type);
-
- /* ISO/IEC 13818-2 section 7.6 */
- motion_compensation(MBA, macroblock_type, motion_type, PMV,
- motion_vertical_field_select, dmvector, stwtype, dct_type);
-
-
- /* advance to next macroblock */
- MBA++;
- MBAinc--;
-
- /* SCALABILITY: SNR */
- if (Two_Streams && enhan.scalable_mode==SC_SNR)
- {
- SNRMBA++;
- SNRMBAinc--;
- }
-
- if (MBA>=MBAmax)
- return(-1); /* all macroblocks decoded */
- }
-}
-
-
-/* ISO/IEC 13818-2 section 6.3.17.1: Macroblock modes */
-static void macroblock_modes(pmacroblock_type,pstwtype,pstwclass,
- pmotion_type,pmotion_vector_count,pmv_format,pdmv,pmvscale,pdct_type)
- int *pmacroblock_type, *pstwtype, *pstwclass;
- int *pmotion_type, *pmotion_vector_count, *pmv_format, *pdmv, *pmvscale;
- int *pdct_type;
-{
- int macroblock_type;
- int stwtype, stwcode, stwclass;
- int motion_type = 0;
- int motion_vector_count, mv_format, dmv, mvscale;
- int dct_type;
- static unsigned char stwc_table[3][4]
- = { {6,3,7,4}, {2,1,5,4}, {2,5,7,4} };
- static unsigned char stwclass_table[9]
- = {0, 1, 2, 1, 1, 2, 3, 3, 4};
-
- /* get macroblock_type */
- macroblock_type = Get_macroblock_type();
-
- if (Fault_Flag) return;
-
- /* get spatial_temporal_weight_code */
- if (macroblock_type & MB_WEIGHT)
- {
- if (spatial_temporal_weight_code_table_index==0)
- stwtype = 4;
- else
- {
- stwcode = Get_Bits(2);
-#ifdef TRACE
- if (Trace_Flag)
- {
- cprintf("spatial_temporal_weight_code (");
- Print_Bits(stwcode,2,2);
- cprintf("): %d\n",stwcode);
- }
-#endif /* TRACE */
- stwtype = stwc_table[spatial_temporal_weight_code_table_index-1][stwcode];
- }
- }
- else
- stwtype = (macroblock_type & MB_CLASS4) ? 8 : 0;
-
- /* SCALABILITY: derive spatial_temporal_weight_class (Table 7-18) */
- stwclass = stwclass_table[stwtype];
-
- /* get frame/field motion type */
- if (macroblock_type & (MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD))
- {
- if (picture_structure==FRAME_PICTURE) /* frame_motion_type */
- {
- motion_type = frame_pred_frame_dct ? MC_FRAME : Get_Bits(2);
-#ifdef TRACE
- if (!frame_pred_frame_dct && Trace_Flag)
- {
- cprintf("frame_motion_type (");
- Print_Bits(motion_type,2,2);
- cprintf("): %s\n",motion_type==MC_FIELD?"Field":
- motion_type==MC_FRAME?"Frame":
- motion_type==MC_DMV?"Dual_Prime":"Invalid");
- }
-#endif /* TRACE */
- }
- else /* field_motion_type */
- {
- motion_type = Get_Bits(2);
-#ifdef TRACE
- if (Trace_Flag)
- {
- cprintf("field_motion_type (");
- Print_Bits(motion_type,2,2);
- cprintf("): %s\n",motion_type==MC_FIELD?"Field":
- motion_type==MC_16X8?"16x8 MC":
- motion_type==MC_DMV?"Dual_Prime":"Invalid");
- }
-#endif /* TRACE */
- }
- }
- else if ((macroblock_type & MACROBLOCK_INTRA) && concealment_motion_vectors)
- {
- /* concealment motion vectors */
- motion_type = (picture_structure==FRAME_PICTURE) ? MC_FRAME : MC_FIELD;
- }
-#if 0
- else
- {
- printf("maroblock_modes(): unknown macroblock type\n");
- motion_type = -1;
- }
-#endif
-
- /* derive motion_vector_count, mv_format and dmv, (table 6-17, 6-18) */
- if (picture_structure==FRAME_PICTURE)
- {
- motion_vector_count = (motion_type==MC_FIELD && stwclass<2) ? 2 : 1;
- mv_format = (motion_type==MC_FRAME) ? MV_FRAME : MV_FIELD;
- }
- else
- {
- motion_vector_count = (motion_type==MC_16X8) ? 2 : 1;
- mv_format = MV_FIELD;
- }
-
- dmv = (motion_type==MC_DMV); /* dual prime */
-
- /* field mv predictions in frame pictures have to be scaled
- * ISO/IEC 13818-2 section 7.6.3.1 Decoding the motion vectors
- * IMPLEMENTATION: mvscale is derived for later use in motion_vectors()
- * it displaces the stage:
- *
- * if((mv_format=="field")&&(t==1)&&(picture_structure=="Frame picture"))
- * prediction = PMV[r][s][t] DIV 2;
- */
-
- mvscale = ((mv_format==MV_FIELD) && (picture_structure==FRAME_PICTURE));
-
- /* get dct_type (frame DCT / field DCT) */
- dct_type = (picture_structure==FRAME_PICTURE)
- && (!frame_pred_frame_dct)
- && (macroblock_type & (MACROBLOCK_PATTERN|MACROBLOCK_INTRA))
- ? Get_Bits(1)
- : 0;
-
-#ifdef TRACE
- if (Trace_Flag && (picture_structure==FRAME_PICTURE)
- && (!frame_pred_frame_dct)
- && (macroblock_type & (MACROBLOCK_PATTERN|MACROBLOCK_INTRA)))
- cprintf("dct_type (%d): %s\n",dct_type,dct_type?"Field":"Frame");
-#endif /* TRACE */
-
- /* return values */
- *pmacroblock_type = macroblock_type;
- *pstwtype = stwtype;
- *pstwclass = stwclass;
- *pmotion_type = motion_type;
- *pmotion_vector_count = motion_vector_count;
- *pmv_format = mv_format;
- *pdmv = dmv;
- *pmvscale = mvscale;
- *pdct_type = dct_type;
-}
-
-
-/* move/add 8x8-Block from block[comp] to backward_reference_frame */
-/* copy reconstructed 8x8 block from block[comp] to current_frame[]
- * ISO/IEC 13818-2 section 7.6.8: Adding prediction and coefficient data
- * This stage also embodies some of the operations implied by:
- * - ISO/IEC 13818-2 section 7.6.7: Combining predictions
- * - ISO/IEC 13818-2 section 6.1.3: Macroblock
-*/
-static void Add_Block(comp,bx,by,dct_type,addflag)
-int comp,bx,by,dct_type,addflag;
-{
- int cc,i, j, iincr;
- unsigned char *rfp;
- short *bp;
-
-
- /* derive color component index */
- /* equivalent to ISO/IEC 13818-2 Table 7-1 */
- cc = (comp<4) ? 0 : (comp&1)+1; /* color component index */
-
- if (cc==0)
- {
- /* luminance */
-
- if (picture_structure==FRAME_PICTURE)
- if (dct_type)
- {
- /* field DCT coding */
- rfp = current_frame[0]
- + Coded_Picture_Width*(by+((comp&2)>>1)) + bx + ((comp&1)<<3);
- iincr = (Coded_Picture_Width<<1) - 8;
- }
- else
- {
- /* frame DCT coding */
- rfp = current_frame[0]
- + Coded_Picture_Width*(by+((comp&2)<<2)) + bx + ((comp&1)<<3);
- iincr = Coded_Picture_Width - 8;
- }
- else
- {
- /* field picture */
- rfp = current_frame[0]
- + (Coded_Picture_Width<<1)*(by+((comp&2)<<2)) + bx + ((comp&1)<<3);
- iincr = (Coded_Picture_Width<<1) - 8;
- }
- }
- else
- {
- /* chrominance */
-
- /* scale coordinates */
- if (chroma_format!=CHROMA444)
- bx >>= 1;
- if (chroma_format==CHROMA420)
- by >>= 1;
- if (picture_structure==FRAME_PICTURE)
- {
- if (dct_type && (chroma_format!=CHROMA420))
- {
- /* field DCT coding */
- rfp = current_frame[cc]
- + Chroma_Width*(by+((comp&2)>>1)) + bx + (comp&8);
- iincr = (Chroma_Width<<1) - 8;
- }
- else
- {
- /* frame DCT coding */
- rfp = current_frame[cc]
- + Chroma_Width*(by+((comp&2)<<2)) + bx + (comp&8);
- iincr = Chroma_Width - 8;
- }
- }
- else
- {
- /* field picture */
- rfp = current_frame[cc]
- + (Chroma_Width<<1)*(by+((comp&2)<<2)) + bx + (comp&8);
- iincr = (Chroma_Width<<1) - 8;
- }
- }
-
- bp = ld->block[comp];
-
- if (addflag)
- {
- for (i=0; i<8; i++)
- {
- for (j=0; j<8; j++)
- {
- *rfp = Clip[*bp++ + *rfp];
- rfp++;
- }
-
- rfp+= iincr;
- }
- }
- else
- {
- for (i=0; i<8; i++)
- {
- for (j=0; j<8; j++)
- *rfp++ = Clip[*bp++ + 128];
-
- rfp+= iincr;
- }
- }
-}
-
-
-/* ISO/IEC 13818-2 section 7.8 */
-static void Decode_SNR_Macroblock(SNRMBA, SNRMBAinc, MBA, MBAmax, dct_type)
- int *SNRMBA, *SNRMBAinc;
- int MBA, MBAmax;
- int *dct_type;
-{
- int SNRmacroblock_type, SNRcoded_block_pattern, SNRdct_type, dummy;
- int slice_vert_pos_ext, quantizer_scale_code, comp, code;
-
- ld = &enhan;
-
- if (*SNRMBAinc==0)
- {
- if (!Show_Bits(23)) /* next_start_code */
- {
- next_start_code();
- code = Show_Bits(32);
-
- if (code<SLICE_START_CODE_MIN || code>SLICE_START_CODE_MAX)
- {
- /* only slice headers are allowed in picture_data */
- if (!Quiet_Flag)
- cprintf("SNR: Premature end of picture\n");
- return;
- }
-
- Flush_Buffer32();
-
- /* decode slice header (may change quantizer_scale) */
- slice_vert_pos_ext = slice_header();
-
- /* decode macroblock address increment */
- *SNRMBAinc = Get_macroblock_address_increment();
-
- /* set current location */
- *SNRMBA =
- ((slice_vert_pos_ext<<7) + (code&255) - 1)*mb_width + *SNRMBAinc - 1;
-
- *SNRMBAinc = 1; /* first macroblock in slice: not skipped */
- }
- else /* not next_start_code */
- {
- if (*SNRMBA>=MBAmax)
- {
- if (!Quiet_Flag)
- cprintf("Too many macroblocks in picture\n");
- return;
- }
-
- /* decode macroblock address increment */
- *SNRMBAinc = Get_macroblock_address_increment();
- }
- }
-
- if (*SNRMBA!=MBA)
- {
- /* streams out of sync */
- if (!Quiet_Flag)
- cprintf("Cant't synchronize streams\n");
- return;
- }
-
- if (*SNRMBAinc==1) /* not skipped */
- {
- macroblock_modes(&SNRmacroblock_type, &dummy, &dummy,
- &dummy, &dummy, &dummy, &dummy, &dummy,
- &SNRdct_type);
-
- if (SNRmacroblock_type & MACROBLOCK_PATTERN)
- *dct_type = SNRdct_type;
-
- if (SNRmacroblock_type & MACROBLOCK_QUANT)
- {
- quantizer_scale_code = Get_Bits(5);
- ld->quantizer_scale =
- ld->q_scale_type ? Non_Linear_quantizer_scale[quantizer_scale_code] : quantizer_scale_code<<1;
- }
-
- /* macroblock_pattern */
- if (SNRmacroblock_type & MACROBLOCK_PATTERN)
- {
- SNRcoded_block_pattern = Get_coded_block_pattern();
-
- if (chroma_format==CHROMA422)
- SNRcoded_block_pattern = (SNRcoded_block_pattern<<2) | Get_Bits(2); /* coded_block_pattern_1 */
- else if (chroma_format==CHROMA444)
- SNRcoded_block_pattern = (SNRcoded_block_pattern<<6) | Get_Bits(6); /* coded_block_pattern_2 */
- }
- else
- SNRcoded_block_pattern = 0;
-
- /* decode blocks */
- for (comp=0; comp<block_count; comp++)
- {
- Clear_Block(comp);
-
- if (SNRcoded_block_pattern & (1<<(block_count-1-comp)))
- Decode_MPEG2_Non_Intra_Block(comp);
- }
- }
- else /* SNRMBAinc!=1: skipped macroblock */
- {
- for (comp=0; comp<block_count; comp++)
- Clear_Block(comp);
- }
-
- ld = &base;
-}
-
-
-
-/* IMPLEMENTATION: set scratch pad macroblock to zero */
-static void Clear_Block(comp)
-int comp;
-{
- short *Block_Ptr;
- int i;
-
- Block_Ptr = ld->block[comp];
-
- for (i=0; i<64; i++)
- *Block_Ptr++ = 0;
-}
-
-
-/* SCALABILITY: add SNR enhancement layer block data to base layer */
-/* ISO/IEC 13818-2 section 7.8.3.4: Addition of coefficients from the two layes */
-static void Sum_Block(comp)
-int comp;
-{
- short *Block_Ptr1, *Block_Ptr2;
- int i;
-
- Block_Ptr1 = base.block[comp];
- Block_Ptr2 = enhan.block[comp];
-
- for (i=0; i<64; i++)
- *Block_Ptr1++ += *Block_Ptr2++;
-}
-
-
-/* limit coefficients to -2048..2047 */
-/* ISO/IEC 13818-2 section 7.4.3 and 7.4.4: Saturation and Mismatch control */
-static void Saturate(Block_Ptr)
-short *Block_Ptr;
-{
- int i, sum, val;
-
- sum = 0;
-
- /* ISO/IEC 13818-2 section 7.4.3: Saturation */
- for (i=0; i<64; i++)
- {
- val = Block_Ptr[i];
-
- if (val>2047)
- val = 2047;
- else if (val<-2048)
- val = -2048;
-
- Block_Ptr[i] = val;
- sum+= val;
- }
-
- /* ISO/IEC 13818-2 section 7.4.4: Mismatch control */
- if ((sum&1)==0)
- Block_Ptr[63]^= 1;
-
-}
-
-
-/* reuse old picture buffers as soon as they are no longer needed
- based on life-time axioms of MPEG */
-static void Update_Picture_Buffers()
-{
- int cc; /* color component index */
- unsigned char *tmp; /* temporary swap pointer */
-
- for (cc=0; cc<3; cc++)
- {
- /* B pictures do not need to be save for future reference */
- if (picture_coding_type==B_TYPE)
- {
- current_frame[cc] = auxframe[cc];
- }
- else
- {
- /* only update at the beginning of the coded frame */
- if (!Second_Field)
- {
- tmp = forward_reference_frame[cc];
-
- /* the previously decoded reference frame is stored
- coincident with the location where the backward
- reference frame is stored (backwards prediction is not
- needed in P pictures) */
- forward_reference_frame[cc] = backward_reference_frame[cc];
-
- /* update pointer for potential future B pictures */
- backward_reference_frame[cc] = tmp;
- }
-
- /* can erase over old backward reference frame since it is not used
- in a P picture, and since any subsequent B pictures will use the
- previously decoded I or P frame as the backward_reference_frame */
- current_frame[cc] = backward_reference_frame[cc];
- }
-
- /* IMPLEMENTATION:
- one-time folding of a line offset into the pointer which stores the
- memory address of the current frame saves offsets and conditional
- branches throughout the remainder of the picture processing loop */
- if (picture_structure==BOTTOM_FIELD)
- current_frame[cc]+= (cc==0) ? Coded_Picture_Width : Chroma_Width;
- }
-}
-
-
-/* store last frame */
-
-void Output_Last_Frame_of_Sequence(Framenum)
-int Framenum;
-{
- if (Second_Field)
- cprintf("last frame incomplete, not stored\n");
- else
- Write_Frame(backward_reference_frame,Framenum-1);
-}
-
-
-
-static void frame_reorder(Bitstream_Framenum, Sequence_Framenum)
-int Bitstream_Framenum, Sequence_Framenum;
-{
- /* tracking variables to insure proper output in spatial scalability */
- static int Oldref_progressive_frame, Newref_progressive_frame;
-
- if (Sequence_Framenum!=0)
- {
- if (picture_structure==FRAME_PICTURE || Second_Field)
- {
- if (picture_coding_type==B_TYPE)
- Write_Frame(auxframe,Bitstream_Framenum-1);
- else
- {
- Newref_progressive_frame = progressive_frame;
- progressive_frame = Oldref_progressive_frame;
-
- Write_Frame(forward_reference_frame,Bitstream_Framenum-1);
-
- Oldref_progressive_frame = progressive_frame = Newref_progressive_frame;
- }
- }
-#ifdef DISPLAY
- else if (Output_Type==T_X11)
- {
- if(!Display_Progressive_Flag)
- Display_Second_Field();
- }
-#endif
- }
- else
- Oldref_progressive_frame = progressive_frame;
-
-}
-
-
-/* ISO/IEC 13818-2 section 7.6 */
-static void motion_compensation(MBA, macroblock_type, motion_type, PMV,
- motion_vertical_field_select, dmvector, stwtype, dct_type)
-int MBA;
-int macroblock_type;
-int motion_type;
-int PMV[2][2][2];
-int motion_vertical_field_select[2][2];
-int dmvector[2];
-int stwtype;
-int dct_type;
-{
- int bx, by;
- int comp;
-
- /* derive current macroblock position within picture */
- /* ISO/IEC 13818-2 section 6.3.1.6 and 6.3.1.7 */
- bx = 16*(MBA%mb_width);
- by = 16*(MBA/mb_width);
-
- /* motion compensation */
- if (!(macroblock_type & MACROBLOCK_INTRA))
- form_predictions(bx,by,macroblock_type,motion_type,PMV,
- motion_vertical_field_select,dmvector,stwtype);
-
- /* SCALABILITY: Data Partitioning */
- if (base.scalable_mode==SC_DP)
- ld = &base;
-
- /* copy or add block data into picture */
- for (comp=0; comp<block_count; comp++)
- {
- /* SCALABILITY: SNR */
- /* ISO/IEC 13818-2 section 7.8.3.4: Addition of coefficients from
- the two a layers */
- if (Two_Streams && enhan.scalable_mode==SC_SNR)
- Sum_Block(comp); /* add SNR enhancement layer data to base layer */
-
- /* MPEG-2 saturation and mismatch control */
- /* base layer could be MPEG-1 stream, enhancement MPEG-2 SNR */
- /* ISO/IEC 13818-2 section 7.4.3 and 7.4.4: Saturation and Mismatch control */
- if ((Two_Streams && enhan.scalable_mode==SC_SNR) || ld->MPEG2_Flag)
- Saturate(ld->block[comp]);
-
- /* ISO/IEC 13818-2 section Annex A: inverse DCT */
- if (Reference_IDCT_Flag)
- Reference_IDCT(ld->block[comp]);
- else
- Fast_IDCT(ld->block[comp]);
-
- /* ISO/IEC 13818-2 section 7.6.8: Adding prediction and coefficient data */
- Add_Block(comp,bx,by,dct_type,(macroblock_type & MACROBLOCK_INTRA)==0);
- }
-
-}
-
-
-
-/* ISO/IEC 13818-2 section 7.6.6 */
-static void skipped_macroblock(dc_dct_pred, PMV, motion_type,
- motion_vertical_field_select, stwtype, macroblock_type)
-int dc_dct_pred[3];
-int PMV[2][2][2];
-int *motion_type;
-int motion_vertical_field_select[2][2];
-int *stwtype;
-int *macroblock_type;
-{
- int comp;
-
- /* SCALABILITY: Data Paritioning */
- if (base.scalable_mode==SC_DP)
- ld = &base;
-
- for (comp=0; comp<block_count; comp++)
- Clear_Block(comp);
-
- /* reset intra_dc predictors */
- /* ISO/IEC 13818-2 section 7.2.1: DC coefficients in intra blocks */
- dc_dct_pred[0]=dc_dct_pred[1]=dc_dct_pred[2]=0;
-
- /* reset motion vector predictors */
- /* ISO/IEC 13818-2 section 7.6.3.4: Resetting motion vector predictors */
- if (picture_coding_type==P_TYPE)
- PMV[0][0][0]=PMV[0][0][1]=PMV[1][0][0]=PMV[1][0][1]=0;
-
- /* derive motion_type */
- if (picture_structure==FRAME_PICTURE)
- *motion_type = MC_FRAME;
- else
- {
- *motion_type = MC_FIELD;
-
- /* predict from field of same parity */
- /* ISO/IEC 13818-2 section 7.6.6.1 and 7.6.6.3: P field picture and B field
- picture */
- motion_vertical_field_select[0][0]=motion_vertical_field_select[0][1] =
- (picture_structure==BOTTOM_FIELD);
- }
-
- /* skipped I are spatial-only predicted, */
- /* skipped P and B are temporal-only predicted */
- /* ISO/IEC 13818-2 section 7.7.6: Skipped macroblocks */
- *stwtype = (picture_coding_type==I_TYPE) ? 8 : 0;
-
- /* IMPLEMENTATION: clear MACROBLOCK_INTRA */
- *macroblock_type&= ~MACROBLOCK_INTRA;
-
-}
-
-
-/* return==-1 means go to next picture */
-/* the expression "start of slice" is used throughout the normative
- body of the MPEG specification */
-static int start_of_slice(MBAmax, MBA, MBAinc,
- dc_dct_pred, PMV)
-int MBAmax;
-int *MBA;
-int *MBAinc;
-int dc_dct_pred[3];
-int PMV[2][2][2];
-{
- unsigned int code;
- int slice_vert_pos_ext;
-
- ld = &base;
-
- Fault_Flag = 0;
-
- next_start_code();
- code = Show_Bits(32);
-
- if (code<SLICE_START_CODE_MIN || code>SLICE_START_CODE_MAX)
- {
- /* only slice headers are allowed in picture_data */
- if (!Quiet_Flag)
- cprintf("start_of_slice(): Premature end of picture\n");
-
- return(-1); /* trigger: go to next picture */
- }
-
- Flush_Buffer32();
-
- /* decode slice header (may change quantizer_scale) */
- slice_vert_pos_ext = slice_header();
-
-
- /* SCALABILITY: Data Partitioning */
- if (base.scalable_mode==SC_DP)
- {
- ld = &enhan;
- next_start_code();
- code = Show_Bits(32);
-
- if (code<SLICE_START_CODE_MIN || code>SLICE_START_CODE_MAX)
- {
- /* only slice headers are allowed in picture_data */
- if (!Quiet_Flag)
- cprintf("DP: Premature end of picture\n");
- return(-1); /* trigger: go to next picture */
- }
-
- Flush_Buffer32();
-
- /* decode slice header (may change quantizer_scale) */
- slice_vert_pos_ext = slice_header();
-
- if (base.priority_breakpoint!=1)
- ld = &base;
- }
-
- /* decode macroblock address increment */
- *MBAinc = Get_macroblock_address_increment();
-
- if (Fault_Flag)
- {
- cprintf("start_of_slice(): MBAinc unsuccessful\n");
- return(0); /* trigger: go to next slice */
- }
-
- /* set current location */
- /* NOTE: the arithmetic used to derive macroblock_address below is
- * equivalent to ISO/IEC 13818-2 section 6.3.17: Macroblock
- */
- *MBA = ((slice_vert_pos_ext<<7) + (code&255) - 1)*mb_width + *MBAinc - 1;
- *MBAinc = 1; /* first macroblock in slice: not skipped */
-
- /* reset all DC coefficient and motion vector predictors */
- /* reset all DC coefficient and motion vector predictors */
- /* ISO/IEC 13818-2 section 7.2.1: DC coefficients in intra blocks */
- dc_dct_pred[0]=dc_dct_pred[1]=dc_dct_pred[2]=0;
-
- /* ISO/IEC 13818-2 section 7.6.3.4: Resetting motion vector predictors */
- PMV[0][0][0]=PMV[0][0][1]=PMV[1][0][0]=PMV[1][0][1]=0;
- PMV[0][1][0]=PMV[0][1][1]=PMV[1][1][0]=PMV[1][1][1]=0;
-
- /* successfull: trigger decode macroblocks in slice */
- return(1);
-}
-
-
-/* ISO/IEC 13818-2 sections 7.2 through 7.5 */
-static int decode_macroblock(macroblock_type, stwtype, stwclass,
- motion_type, dct_type, PMV, dc_dct_pred,
- motion_vertical_field_select, dmvector)
-int *macroblock_type;
-int *stwtype;
-int *stwclass;
-int *motion_type;
-int *dct_type;
-int PMV[2][2][2];
-int dc_dct_pred[3];
-int motion_vertical_field_select[2][2];
-int dmvector[2];
-{
- /* locals */
- int quantizer_scale_code;
- int comp;
-
- int motion_vector_count;
- int mv_format;
- int dmv;
- int mvscale;
- int coded_block_pattern;
-
- /* SCALABILITY: Data Patitioning */
- if (base.scalable_mode==SC_DP)
- {
- if (base.priority_breakpoint<=2)
- ld = &enhan;
- else
- ld = &base;
- }
-
- /* ISO/IEC 13818-2 section 6.3.17.1: Macroblock modes */
- macroblock_modes(macroblock_type, stwtype, stwclass,
- motion_type, &motion_vector_count, &mv_format, &dmv, &mvscale,
- dct_type);
-
- if (Fault_Flag) return(0); /* trigger: go to next slice */
-
- if (*macroblock_type & MACROBLOCK_QUANT)
- {
- quantizer_scale_code = Get_Bits(5);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- cprintf("quantiser_scale_code (");
- Print_Bits(quantizer_scale_code,5,5);
- cprintf("): %d\n",quantizer_scale_code);
- }
-#endif /* TRACE */
-
- /* ISO/IEC 13818-2 section 7.4.2.2: Quantizer scale factor */
- if (ld->MPEG2_Flag)
- ld->quantizer_scale =
- ld->q_scale_type ? Non_Linear_quantizer_scale[quantizer_scale_code]
- : (quantizer_scale_code << 1);
- else
- ld->quantizer_scale = quantizer_scale_code;
-
- /* SCALABILITY: Data Partitioning */
- if (base.scalable_mode==SC_DP)
- /* make sure base.quantizer_scale is valid */
- base.quantizer_scale = ld->quantizer_scale;
- }
-
- /* motion vectors */
-
-
- /* ISO/IEC 13818-2 section 6.3.17.2: Motion vectors */
-
- /* decode forward motion vectors */
- if ((*macroblock_type & MACROBLOCK_MOTION_FORWARD)
- || ((*macroblock_type & MACROBLOCK_INTRA)
- && concealment_motion_vectors))
- {
- if (ld->MPEG2_Flag)
- motion_vectors(PMV,dmvector,motion_vertical_field_select,
- 0,motion_vector_count,mv_format,f_code[0][0]-1,f_code[0][1]-1,
- dmv,mvscale);
- else
- motion_vector(PMV[0][0],dmvector,
- forward_f_code-1,forward_f_code-1,0,0,full_pel_forward_vector);
- }
-
- if (Fault_Flag) return(0); /* trigger: go to next slice */
-
- /* decode backward motion vectors */
- if (*macroblock_type & MACROBLOCK_MOTION_BACKWARD)
- {
- if (ld->MPEG2_Flag)
- motion_vectors(PMV,dmvector,motion_vertical_field_select,
- 1,motion_vector_count,mv_format,f_code[1][0]-1,f_code[1][1]-1,0,
- mvscale);
- else
- motion_vector(PMV[0][1],dmvector,
- backward_f_code-1,backward_f_code-1,0,0,full_pel_backward_vector);
- }
-
- if (Fault_Flag) return(0); /* trigger: go to next slice */
-
- if ((*macroblock_type & MACROBLOCK_INTRA) && concealment_motion_vectors)
- Flush_Buffer(1); /* remove marker_bit */
-
- if (base.scalable_mode==SC_DP && base.priority_breakpoint==3)
- ld = &enhan;
-
- /* macroblock_pattern */
- /* ISO/IEC 13818-2 section 6.3.17.4: Coded block pattern */
- if (*macroblock_type & MACROBLOCK_PATTERN)
- {
- coded_block_pattern = Get_coded_block_pattern();
-
- if (chroma_format==CHROMA422)
- {
- /* coded_block_pattern_1 */
- coded_block_pattern = (coded_block_pattern<<2) | Get_Bits(2);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- cprintf("coded_block_pattern_1: ");
- Print_Bits(coded_block_pattern,2,2);
- cprintf(" (%d)\n",coded_block_pattern&3);
- }
-#endif /* TRACE */
- }
- else if (chroma_format==CHROMA444)
- {
- /* coded_block_pattern_2 */
- coded_block_pattern = (coded_block_pattern<<6) | Get_Bits(6);
-
-#ifdef TRACE
- if (Trace_Flag)
- {
- cprintf("coded_block_pattern_2: ");
- Print_Bits(coded_block_pattern,6,6);
- cprintf(" (%d)\n",coded_block_pattern&63);
- }
-#endif /* TRACE */
- }
- }
- else
- coded_block_pattern = (*macroblock_type & MACROBLOCK_INTRA) ?
- (1<<block_count)-1 : 0;
-
- if (Fault_Flag) return(0); /* trigger: go to next slice */
-
- /* decode blocks */
- for (comp=0; comp<block_count; comp++)
- {
- /* SCALABILITY: Data Partitioning */
- if (base.scalable_mode==SC_DP)
- ld = &base;
-
- Clear_Block(comp);
-
- if (coded_block_pattern & (1<<(block_count-1-comp)))
- {
- if (*macroblock_type & MACROBLOCK_INTRA)
- {
- if (ld->MPEG2_Flag)
- Decode_MPEG2_Intra_Block(comp,dc_dct_pred);
- else
- Decode_MPEG1_Intra_Block(comp,dc_dct_pred);
- }
- else
- {
- if (ld->MPEG2_Flag)
- Decode_MPEG2_Non_Intra_Block(comp);
- else
- Decode_MPEG1_Non_Intra_Block(comp);
- }
-
- if (Fault_Flag) return(0); /* trigger: go to next slice */
- }
- }
-
- if(picture_coding_type==D_TYPE)
- {
- /* remove end_of_macroblock (always 1, prevents startcode emulation) */
- /* ISO/IEC 11172-2 section 2.4.2.7 and 2.4.3.6 */
- marker_bit("D picture end_of_macroblock bit");
- }
-
- /* reset intra_dc predictors */
- /* ISO/IEC 13818-2 section 7.2.1: DC coefficients in intra blocks */
- if (!(*macroblock_type & MACROBLOCK_INTRA))
- dc_dct_pred[0]=dc_dct_pred[1]=dc_dct_pred[2]=0;
-
- /* reset motion vector predictors */
- if ((*macroblock_type & MACROBLOCK_INTRA) && !concealment_motion_vectors)
- {
- /* intra mb without concealment motion vectors */
- /* ISO/IEC 13818-2 section 7.6.3.4: Resetting motion vector predictors */
- PMV[0][0][0]=PMV[0][0][1]=PMV[1][0][0]=PMV[1][0][1]=0;
- PMV[0][1][0]=PMV[0][1][1]=PMV[1][1][0]=PMV[1][1][1]=0;
- }
-
- /* special "No_MC" macroblock_type case */
- /* ISO/IEC 13818-2 section 7.6.3.5: Prediction in P pictures */
- if ((picture_coding_type==P_TYPE)
- && !(*macroblock_type & (MACROBLOCK_MOTION_FORWARD|MACROBLOCK_INTRA)))
- {
- /* non-intra mb without forward mv in a P picture */
- /* ISO/IEC 13818-2 section 7.6.3.4: Resetting motion vector predictors */
- PMV[0][0][0]=PMV[0][0][1]=PMV[1][0][0]=PMV[1][0][1]=0;
-
- /* derive motion_type */
- /* ISO/IEC 13818-2 section 6.3.17.1: Macroblock modes, frame_motion_type */
- if (picture_structure==FRAME_PICTURE)
- *motion_type = MC_FRAME;
- else
- {
- *motion_type = MC_FIELD;
- /* predict from field of same parity */
- motion_vertical_field_select[0][0] = (picture_structure==BOTTOM_FIELD);
- }
- }
-
- if (*stwclass==4)
- {
- /* purely spatially predicted macroblock */
- /* ISO/IEC 13818-2 section 7.7.5.1: Resetting motion vector predictions */
- PMV[0][0][0]=PMV[0][0][1]=PMV[1][0][0]=PMV[1][0][1]=0;
- PMV[0][1][0]=PMV[0][1][1]=PMV[1][1][0]=PMV[1][1][1]=0;
- }
-
- /* successfully decoded macroblock */
- return(1);
-
-} /* decode_macroblock */
-
-
Index: rel_1_21/fsf/makefile
===================================================================
--- rel_1_21/fsf/makefile (revision 1217)
+++ rel_1_21/fsf/makefile (nonexistent)
@@ -1,23 +0,0 @@
-#
-#
-
-BASE=../..
-include $(BASE)/config/config.mk
-
-PROGS= test1 test2 test3
-
-MPEG2 = ./mpeg2/getbits.o ./mpeg2/getblk.o ./mpeg2/gethdr.o ./mpeg2/getpic.o\
- ./mpeg2/getvlc.o ./mpeg2/idct.o ./mpeg2/idctref.o ./mpeg2/motion.o\
- ./mpeg2/mpeg2dec.o ./mpeg2/recon.o ./mpeg2/spatscal.o ./mpeg2/store.o\
- ./mpeg2/subspic.o ./mpeg2/systems.o ./mpeg2/verify.o ./mpeg2/gvideo.o
-
-include $(BASE)/config/example.mk
-
-test1:
- make -f $(SUBMAKE) APP=test1 INIT= OTHEROBJS= OTHERINCL= SHARKOPT="__OLDCHAR__ __FIRST__"
-
-test2:
- make -f $(SUBMAKE) APP=test2 INIT= OTHEROBJS="initfile.o $(MPEG2)" OTHERINCL= SHARKOPT="__OLDCHAR__ __GRX__ __FIRST__"
-test3:
- make -f $(SUBMAKE) APP=test3 INIT= OTHEROBJS= OTHERINCL= SHARKOPT="__OLDCHAR__ __FIRST__"
-
Index: rel_1_21/cash/initcash.c
===================================================================
--- rel_1_21/cash/initcash.c (revision 1217)
+++ rel_1_21/cash/initcash.c (nonexistent)
@@ -1,128 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: initcash.c,v 1.1.1.1 2002-09-02 09:37:41 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:41 $
- ------------
-
- System initialization file
-
- The tick is set to TICK ms.
-
- This file contains the 2 functions needed to initialize the system.
-
- These functions register the following levels:
-
- an EDF (Earliest Deadline First) level
- a RR (Round Robin) level
- a CBSHD (Constant Bandwidth Server with Hard Deadlines) level
- a Dummy level
-
-
-
-
- It can accept these task models (into () the mandatory fields):
-
- HARD_TASK_MODEL (wcet+mit) at level 0
- NRT_TASK_MODEL at level 1
- ELASTIC_HARD_TASK_MODEL (cnormal,period,wcet,maxperiod) at level 5
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/rr.h"
-#include "modules/tbs.h"
-#include "modules/cbs.h"
-#include "cash.h"
-#include "modules/dummy.h"
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "drivers/keyb.h"
-
-
-/*+ sysyem tick in us +*/
-#define TICK 300
-
-#define RRTICK 5000
-
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- CBSGHD_register_level(CBSGHD_ENABLE_ALL, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- /* CBS_register_level(CBS_ENABLE_ALL, 0); */
- //CBSHD_register_level(CBSHD_ENABLE_ALL, 0);
- dummy_register_level();
-
- SEM_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- HARTPORT_init();
-
- KEYB_init(NULL);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
-
-
-
-
-
-
-
-
-
Index: rel_1_21/cash/cash.h
===================================================================
--- rel_1_21/cash/cash.h (revision 1217)
+++ rel_1_21/cash/cash.h (nonexistent)
@@ -1,177 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: cash.h,v 1.2 2003-01-07 17:10:16 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-01-07 17:10:16 $
- ------------
-
- This file contains the server CBSHD (CASH Algorithm)
-
- Title:
- CBSHD (Constant Bandwidth Server with hard deadlines)
-
- Task Models Accepted:
- ELASTIC_HARD_TASK_MODEL - Elastic Hard Tasks
- wcet field must be != 0
- cnormal field must be != 0
- period field must be != 0
-
- Description:
- This module schedule his tasks following the CBSHD scheme.
- (see Marco Caccamo, Giorgio Buttazzo and Lui Sha
- "Elastic Feedback Control"
- Proceedings of the EUROMICRO 2000)
-
- The tasks are inserted in an EDF level (or similar) with a JOB_TASK_MODEL,
- and the CBSHD level expects that the task is scheduled with the absolute
- deadline passed in the model.
-
- The task guarantee is based on the factor utilization approach.
-
- Exceptions raised:
- XUNVALID_GUEST
- This level doesn't support guests. When a guest operation
- is called, the exception is raised.
-
- These exceptions are pclass-dependent...
- XDEADLINE_MISS
- If a task miss his deadline, the exception is raised.
-
- Restrictions & special features:
- - This level doesn't manage the main task.
- - At init time we have to specify:
- . guarantee check
- (when all task are created the system will check that the task_set
- will not use more than the available bandwidth)
- - A function to return the used bandwidth of the level is provided.
- - A function to return the pending activations of the task.
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#ifndef __CBSGHD_H__
-#define __CBSGHD_H__
-
-#include <ll/ll.h>
-#include <kernel/config.h>
-#include <sys/types.h>
-#include <kernel/types.h>
-
-
-
-
-
-
-
-
-/*+ flags... +*/
-#define CBSGHD_ENABLE_GUARANTEE 1 /*+ Task Guarantee enabled +*/
-#define CBSGHD_ENABLE_ALL 1
-
-#define CBSGHD_FAILED_GUARANTEE 8 /*+ used in the module, unsettabl
- in EDF_register_level... +*/
-
-
-
-
-
-#define ELASTIC_HARD_PCLASS 0x0600
-
-#define CBSGHD_LEVELNAME "CBSGHD base"
-#define CBSGHD_LEVEL_CODE 106
-#define CBSGHD_LEVEL_VERSION 1
-
-
-/* -----------------------------------------------------------------------
- ELASTIC_HARD_TASK_MODEL: elastic hard Tasks
- ----------------------------------------------------------------------- */
-
-
-typedef struct {
- TASK_MODEL t;
- TIME cnormal;
- TIME period;
- TIME wcet;
- TIME maxperiod;
-} ELASTIC_HARD_TASK_MODEL;
-
-#define elastic_hard_task_default_model(m) \
- task_default_model((m).t,ELASTIC_HARD_PCLASS), \
- (m).cnormal = 0, \
- (m).period = 0, \
- (m).wcet = 0, \
- (m).maxperiod = 0
-#define elastic_hard_task_def_level(m,l) task_def_level((m).t,l)
-#define elastic_hard_task_def_arg(m,a) task_def_arg((m).t,a)
-#define elastic_hard_task_def_stack(m,s) task_def_stack((m).t,s)
-#define elastic_hard_task_def_stackaddr(m,s) task_def_stackaddr((m).t,s)
-#define elastic_hard_task_def_group(m,g) task_def_group((m).t,g)
-#define elastic_hard_task_def_usemath(m) task_def_usemath((m).t)
-#define elastic_hard_task_def_system(m) task_def_system((m).t)
-#define elastic_hard_task_def_nokill(m) task_def_nokill((m).t)
-#define elastic_hard_task_def_ctrl_jet(m) task_def_ctrl_jet((m).t)
-#define elastic_hard_task_def_cnormal(m,c) (m).cnormal = (c)
-#define elastic_hard_task_def_period(m,p) (m).period = (p)
-#define elastic_hard_task_def_wcet(m,w) (m).wcet = (w)
-#define elastic_hard_task_def_maxperiod(m,p) (m).maxperiod = (p)
-#define elastic_hard_task_def_joinable(m) task_def_joinable((m).t)
-#define elastic_hard_task_def_unjoinable(m) task_def_unjoinable((m).t)
-
-
-
-
-/*+ Registration function:
- int flags Options to be used in this level instance...
- LEVEL master the level that must be used as master level for the
- CBSGHD tasks
-
- returns the level number at which the module has been registered.
-+*/
-LEVEL CBSGHD_register_level(int flags, LEVEL master);
-
-/*+ Returns the used bandwidth of a level +*/
-bandwidth_t CBSGHD_usedbandwidth(LEVEL l);
-
-#endif
-
Index: rel_1_21/cash/readme.txt
===================================================================
--- rel_1_21/cash/readme.txt (revision 1217)
+++ rel_1_21/cash/readme.txt (nonexistent)
@@ -1,6 +0,0 @@
-This Example has been made by Marco Caccamo.
-
-There is not a lot of documentation available, so if you have problems please
-send an e-mail to Marco ( http://gandalf.sssup.it/~caccamo/ )
-
-Paolo
Index: rel_1_21/cash/makefile
===================================================================
--- rel_1_21/cash/makefile (revision 1217)
+++ rel_1_21/cash/makefile (nonexistent)
@@ -1,17 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-
-include $(BASE)/config/config.mk
-
-PROGS=testcash
-
-include $(BASE)/config/example.mk
-
-testcash:
- make -f $(SUBMAKE) APP=testcash INIT= OTHEROBJS="initcash.o cash.o" OTHERINCL= SHARKOPT="__OLDCHAR__ __GRX__"
-
Index: rel_1_21/cash/testcash.c
===================================================================
--- rel_1_21/cash/testcash.c (revision 1217)
+++ rel_1_21/cash/testcash.c (nonexistent)
@@ -1,455 +0,0 @@
-/*
- * Project: HARTIK (HA-rd R-eal TI-me K-ernel)
- *
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
- * Gerardo Lamastra <gerardo@sssup.it>
- *
- * Authors : Paolo Gai <pj@hartik.sssup.it>
- * (see authors.txt for full list of hartik's authors)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://hartik.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: testcash.c,v 1.1.1.1 2002-09-02 09:37:41 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:41 $
- ------------
-
- testcash.c
- test for the CASH Module, directly derived from Test Number 13 (D)
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "cash.h"
-#include <math.h>
-#include <string.h>
-
-#define ASTER_LIM 60
-#define DISPLAY_MAX 15
-
-#define STAT_Y 9
-
-#define INPUT 0.5
-
-
-
-#define MAX_STAT 10000
-#define RVAL 1
-#define XVAL 2
-#define DVAL 3
-
-
-struct statistic {
- TIME r_time;
- TIME ex_time;
- long dead_post;
-};
-
-
-
- struct statistic stat[MAX_STAT];
- TIME val[MAX_STAT];
-
-int n_stat = 0;
-
-TASK hard_asteroide(void)
-{
- int i;
- int y = rand() % 7 + 1;
- double avg, l, fix, u;
- double wcet = 40200;
- int load1,j;
-
- char s[2];
-
- s[0] = 'H'; s[1] = 0;
- /* exponential distribution parameters */
- fix = wcet - 10.0/9.0 * wcet * (1 - INPUT);
- avg = 1.0/9.0 * wcet * (1 - INPUT);
- l = 10.0 / 9.0 * wcet * (1 - INPUT);
-
- for (;;) {
- i = 1;
- while (i < ASTER_LIM) {
- /* exponential distribution */
- u = (double)rand();
-
- u = u / (double)RAND_MAX;
-
- u = -avg * log(u);
- if (u > l)
- u = avg;
-
-
- load1 = fix + u;
-
- for (j=0; j<load1; j++) {
- puts_xy(i,y,rand()%15+1,s);
- }
- //kern_cli();
- //stat[n_stat].r_time = CBSGHD_get_response_time(1, exec_shadow);
- //jet_gettable(exec_shadow, &stat[n_stat].ex_time, 1);
- //kern_sti();
- //n_stat++;
- task_endcycle();
- puts_xy(i,y,WHITE," ");
- i++;
- }
- }
-}
-
-
-TASK hard_asteroide1(void)
-{
- int i;
- int y = rand() % 7 + 1;
-
- int load1,j;
-
- char s[2];
-
- s[0] = 'H'; s[1] = 0;
-
- for (;;) {
- i = 1;
- while (i < ASTER_LIM) {
- load1 = 40000 + rand()%20000;
- for (j=0; j<load1; j++) {
- puts_xy(i,y,rand()%15+1,s);
- }
- //kern_cli();
- //stat[n_stat].r_time = CBSGHD_get_response_time(1, exec_shadow);
- //jet_gettable(exec_shadow, &stat[n_stat].ex_time, 1);
- //kern_sti();
- //n_stat++;
- task_endcycle();
- puts_xy(i,y,WHITE," ");
- i++;
- }
- }
-}
-
-
-TASK hard_asteroide2(void)
-{
- int i;
- int y = rand() % 7 + 1;
-
- int load1,j;
-
- char s[2];
-
- s[0] = 'H'; s[1] = 0;
-
- for (;;) {
- i = 1;
- while (i < ASTER_LIM) {
- load1 = 80500; // + rand()%6000;
- for (j=0; j<load1; j++) {
- puts_xy(i,y,rand()%15+1,s);
- }
- //kern_cli();
- //stat[n_stat].r_time = CBSGHD_get_response_time(5, exec_shadow);
- //jet_gettable(exec_shadow, &stat[n_stat].ex_time, 1);
- //kern_sti();
- //n_stat++;
- task_endcycle();
- puts_xy(i,y,WHITE," ");
- i++;
- }
- }
-}
-
-TASK hard_asteroide3(void)
-{
- int i;
- int y = rand() % 7 + 1;
-
- int load1,j;
-
- char s[2];
-
- s[0] = 'T'; s[1] = 0;
-
- for (;;) {
- i = 1;
- while (i < ASTER_LIM) {
- load1 = 27000;
- for (j=0; j<load1; j++) {
- puts_xy(i,y,rand()%15+1,s);
- }
- //kern_cli();
- //stat[n_stat].r_time = CBSGHD_get_response_time(5, exec_shadow);
- //jet_gettable(exec_shadow, &stat[n_stat].ex_time, 1);
- //kern_sti();
- //n_stat++;
- task_endcycle();
- puts_xy(i,y,WHITE," ");
- i++;
- }
- }
-}
-
-
-TASK clock()
-{
- int s = 0, m = 0;
-
- while(1) {
- printf_xy(62,1,WHITE,"%2d:%2d",m,s);
- printf_xy(62,2,WHITE,"Utot=%12u",MAX_BANDWIDTH);
- printf_xy(62,3,WHITE,"Uedf=%12u",EDF_usedbandwidth(0));
- printf_xy(62,4,WHITE,"Ucbs=%12u",CBSGHD_usedbandwidth(1));
- task_endcycle();
-
- if (++s > 59) {
- s = 0;
- m++;
- }
- printf_xy(62,1,WHITE,"%2d:%2d",m,s);
- printf_xy(62,2,WHITE,"Utot=%12u",MAX_BANDWIDTH);
- printf_xy(62,3,WHITE,"Uedf=%12u",EDF_usedbandwidth(0));
- printf_xy(62,4,WHITE,"Ucbs=%12u",CBSGHD_usedbandwidth(1));
- task_endcycle();
- }
-}
-
-
-
-/* we consider the first ASTER_MAX + 2 tasks from the PID 2
- and plot on the screen the elapsed times... */
-TASK jetcontrol()
-{
- int i; /* a counter */
- TIME sum, max, curr, last[5];
- int nact;
- int j; /* the elements set by jet_gettable */
- PID p;
-
-
- kern_cli();
- printf_xy(0,STAT_Y,WHITE,"PID ³ Mean T.³ Max T. ³ N.A. ³ Curr. ³ Last1 ³ Last2 ³ Last3 ³ Last4 ³ Last5");
- kern_sti();
-
- for (;;) {
- for (i=0,p=0; i<DISPLAY_MAX+5 && p<MAX_PROC; p++) {
- if (jet_getstat(p, &sum, &max, &nact, &curr) == -1) continue;
-
- for (j=0; j<5; j++) last[j] = 0;
- jet_gettable(p, &last[0], 5);
- kern_cli();
- printf_xy(0,STAT_Y+i+1,WHITE,"%-3d ³ %-6ld ³ %-6ld ³ %-4d ³ %-7ld ³ %-5ld ³ %-5ld ³ %-5ld ³ %-5ld ³ %-5ld", p, sum/(nact==0 ? 1 : nact), max,
- nact, curr, last[0], last[1], last[2], last[3], last[4]);
- kern_sti();
- i++;
- }
- task_endcycle();
- }
-}
-
-
-void save_stat(struct statistic p[], int n, char *name, int type)
-{
- DOS_FILE *f;
- int i;
- char outstring[500];
-
-
- for(i = 0; i < 500; i++)
- outstring[i] = '0';
-
- f = DOS_fopen(name, "w");
- if (!f) {
- cprintf("Cannot open %s!!!", name);
- goto end1;
- }
-
- for(i = 0; i < n; i++) {
- if (type == RVAL)
- val[i] = p[i].r_time;
- if (type == XVAL)
- val[i] = p[i].ex_time;
- if (type == DVAL)
- val[i] = p[i].dead_post;
- }
-
- memset(outstring, 0, 300);
- sprintf(outstring, "%ld \n", (long int)n);
- cprintf("%s", outstring);
- DOS_fwrite(outstring, 1, strlen(outstring), f);
-
- for(i = 0; i < n; i++) {
- memset(outstring, 0, 300);
- sprintf(outstring, "%ld %lu\n", (long int)i, val[i]);
- //cprintf("%s", outstring);
- DOS_fwrite(outstring, 1, strlen(outstring), f);
- }
- DOS_fclose(f);
-end1:cprintf("OK?");
-}
-
-
-void result_save(void *p)
-{
- save_stat(stat, n_stat, "stat1.tim", RVAL);
-}
-
-
-void fine()
-{
- sys_end();
-}
-
-int main(int argc, char **argv)
-{
- PID p1,p2,p3, p4, p5, p6, p7;
-
- ELASTIC_HARD_TASK_MODEL m;
- // int i;
- struct timespec fineprg;
-
-
- //sys_atrunlevel(result_save, NULL, RUNLEVEL_AFTER_EXIT);
- srand(7);
-
- elastic_hard_task_default_model(m);
- elastic_hard_task_def_wcet(m,500);
- elastic_hard_task_def_maxperiod(m,500000);
- elastic_hard_task_def_cnormal(m,500);
- elastic_hard_task_def_period(m,500000);
- elastic_hard_task_def_group(m,1);
- elastic_hard_task_def_ctrl_jet(m);
-
-
- p1 = task_create("Clock",clock,&m,NULL);
- if (p1 == -1) {
- perror("testhd.c(main): Could not create task <Clock> ...");
- sys_end();
- }
-
-
-
-
- elastic_hard_task_def_wcet(m,1000);
- elastic_hard_task_def_maxperiod(m,100000);
- elastic_hard_task_def_cnormal(m,1000);
- elastic_hard_task_def_period(m,100000);
-
-
- p2 = task_create("JetControl",jetcontrol,&m,NULL);
- if (p2 == -1) {
- perror("testhd.c(main): Could not create task <JetControl> ...");
- sys_end();
- }
-
-
-
- elastic_hard_task_def_wcet(m,21000);
- elastic_hard_task_def_maxperiod(m,155000);
- elastic_hard_task_def_cnormal(m,21000);
- elastic_hard_task_def_period(m,155000);
-
-
- p3 = task_create("Hard_asteroide1",hard_asteroide1,&m,NULL);
- if (p3 == -1) {
- perror("testhd.c(main): Could not create task <Hard asteroide> ...");
- sys_end();
- }
-
- elastic_hard_task_def_wcet(m,12000);
- elastic_hard_task_def_maxperiod(m,61000);
- elastic_hard_task_def_cnormal(m,12000);
- elastic_hard_task_def_period(m,61000);
-
-
-
-
- p4 = task_create("Hard_asteroide2",hard_asteroide,&m,NULL);
- if (p4 == -1) {
- perror("testhd.c(main): Could not create task <Hard asteroide> ...");
- sys_end();
- }
-
-
- elastic_hard_task_def_wcet(m,30000);
- elastic_hard_task_def_maxperiod(m,200000);
- elastic_hard_task_def_cnormal(m,30000);
- elastic_hard_task_def_period(m,200000);
-
-
- p5 = task_create("Hard_asteroide3",hard_asteroide2,&m,NULL);
- if (p5 == -1) {
- perror("testhd.c(main): Could not create task <Hard asteroide> ...");
- sys_end();
- }
-
- elastic_hard_task_def_wcet(m,30000);
- elastic_hard_task_def_maxperiod(m,100000);
- elastic_hard_task_def_cnormal(m,30000);
- elastic_hard_task_def_period(m,100000);
-
-
- p6 = task_create("Hard_asteroide3",hard_asteroide2,&m,NULL);
- if (p6 == -1) {
- perror("testhd.c(main): Could not create task <Hard asteroide> ...");
- sys_end();
- }
-
- elastic_hard_task_def_wcet(m,10000);
- elastic_hard_task_def_maxperiod(m,200000);
- elastic_hard_task_def_cnormal(m,2500);
- elastic_hard_task_def_period(m,49000);
-
-
- p7 = task_create("Hard_asteroide3",hard_asteroide3,&m,NULL);
- if (p7 == -1) {
- perror("testhd.c(main): Could not create task <Hard asteroide> ...");
- sys_end();
- }
-
-
-
-
- printf_xy(0,STAT_Y + 15,WHITE,"Hard asteroide PID= %-3d ",p3);
- printf_xy(0,STAT_Y + 17,WHITE,"Clock PID= %-3d ",p1);
- printf_xy(0,STAT_Y + 18,WHITE,"JetControl PID= %-3d ",p2);
-
-
-
- task_nopreempt();
- fineprg.tv_sec = 30;
- fineprg.tv_nsec = 0;
- kern_event_post(&fineprg,fine,NULL);
- group_activate(1);
- return 0;
-}
-
Index: rel_1_21/cash/cash.c
===================================================================
--- rel_1_21/cash/cash.c (revision 1217)
+++ rel_1_21/cash/cash.c (nonexistent)
@@ -1,817 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: cash.c,v 1.4 2003-01-07 17:10:16 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.4 $
- Last update: $Date: 2003-01-07 17:10:16 $
- ------------
-
- This file contains the aperiodic server CBS (Total Bandwidth Server)
-
- Read CBS.h for further details.
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#include "cash.h"
-#include <ll/stdio.h>
-#include <ll/string.h>
-#include <kernel/model.h>
-#include <kernel/descr.h>
-#include <kernel/var.h>
-#include <kernel/func.h>
-#include <kernel/trace.h>
-
-
-/*+ Status used in the level +*/
-#define CBSGHD_IDLE APER_STATUS_BASE /*+ waiting the activation +*/
-#define CBSGHD_ZOMBIE APER_STATUS_BASE+1 /*+ waiting the period end +*/
-
-/* structure of an element of the capacity queue */
-struct cap_queue {
- int cap;
- struct timespec dead;
- struct cap_queue *next;
-};
-
-/*+ the level redefinition for the CBS_HD level +*/
-typedef struct {
- level_des l; /*+ the standard level descriptor +*/
-
- /* The wcet are stored in the task descriptor, but we need
- an array for the deadlines. We can't use the timespec_priority
- field because it is used by the master level!!!...
- Notice that however the use of the timespec_priority field
- does not cause any problem... */
-
- struct timespec cbsghd_dline[MAX_PROC]; /*+ CBSGHD deadlines +*/
-
- TIME period[MAX_PROC]; /*+ CBSGHD activation period +*/
-
- TIME maxperiod[MAX_PROC]; /*+ maximum period of each elastic task +*/
-
- int cremaining[MAX_PROC]; /*+ instance remaining computation time +*/
-
- TIME act_period[MAX_PROC]; /*+ actual period of each elastic task: it
- must be less than maxperiod!!! +*/
-
- struct timespec request_time[MAX_PROC]; /* used for the response time */
- TIME last_response_time[MAX_PROC]; /* response time of the last instance */
-
- TIME cnormal[MAX_PROC]; /*+ CBSGHD normal computation time +*/
-
- struct timespec reactivation_time[MAX_PROC];
- /*+ the time at witch the reactivation timer is post +*/
- int reactivation_timer[MAX_PROC];
- /*+ the recativation timer +*/
-
- struct cap_queue *queue; /* pointer to the spare capacity queue */
-
- int flags; /*+ the init flags... +*/
-
- bandwidth_t U; /*+ the used bandwidth by the server +*/
-
- int idle; /* the idle flag... */
-
- struct timespec start_idle; /*gives the start time of the last idle period */
-
- LEVEL scheduling_level;
-
-} CBSGHD_level_des;
-
-
-/* insert a capacity in the queue capacity ordering by deadline */
-
-static int c_insert(struct timespec dead, int cap, struct cap_queue **que,
- PID p)
-{
- struct cap_queue *prev, *n, *new;
-
- prev = NULL;
- n = *que;
-
- while ((n != NULL) &&
- !TIMESPEC_A_LT_B(&dead, &n->dead)) {
- prev = n;
- n = n->next;
- }
-
-
- new = (struct cap_queue *)kern_alloc(sizeof(struct cap_queue));
- if (new == NULL) {
- kern_printf("\nNew cash_queue element failed\n");
- kern_raise(XINVALID_TASK, p);
- return -1;
- }
- new->next = NULL;
- new->cap = cap;
- new->dead = dead;
-
- if (prev != NULL)
- prev->next = new;
- else
- *que = new;
-
- if (n != NULL)
- new->next = n;
- return 0;
-}
-
-/* extract the first element from the capacity queue */
-
-static int c_extractfirst(struct cap_queue **que)
-{
- struct cap_queue *p = *que;
-
-
- if (*que == NULL) return(-1);
-
- *que = (*que)->next;
-
- kern_free(p, sizeof(struct cap_queue));
- return(1);
-}
-
-/* read data of the first element from the capacity queue */
-
-static void c_readfirst(struct timespec *d, int *c, struct cap_queue *que)
-{
- *d = que->dead;
- *c = que->cap;
-}
-
-/* write data of the first element from the capacity queue */
-
-static void c_writefirst(struct timespec dead, int cap, struct cap_queue *que)
-{
- que->dead = dead;
- que->cap = cap;
-}
-
-
-static void CBSGHD_activation(CBSGHD_level_des *lev,
- PID p,
- struct timespec *acttime)
-{
- JOB_TASK_MODEL job;
-
-
- /* This rule is used when we recharge the budget at initial task activation
- and each time a new task instance must be activated */
-
- if (TIMESPEC_A_GT_B(acttime, &lev->cbsghd_dline[p])) {
- /* we modify the deadline ... */
- TIMESPEC_ASSIGN(&lev->cbsghd_dline[p], acttime);
- }
-
- lev->act_period[p] = 0;
-
- if (proc_table[p].avail_time > 0)
- proc_table[p].avail_time = 0;
-
-
-
-
- /* there is a while because if the wcet is << than the system tick
- we need to postpone the deadline many times */
- while (proc_table[p].avail_time <= 0) {
-
- /* A spare capacity is inserted in the capacity queue!! */
- ADDUSEC2TIMESPEC(lev->period[p], &lev->cbsghd_dline[p]);
- lev->act_period[p] += lev->period[p];
- c_insert(lev->cbsghd_dline[p], lev->cnormal[p], &lev->queue, p);
-
-
- /* it exploits available capacities from the capacity queue */
- while (proc_table[p].avail_time < (int)lev->cnormal[p] &&
- lev->queue != NULL) {
- struct timespec dead;
- int cap, delta;
- delta = lev->cnormal[p] - proc_table[p].avail_time;
- c_readfirst(&dead, &cap, lev->queue);
- if (!TIMESPEC_A_GT_B(&dead, &lev->cbsghd_dline[p])) {
- if (cap > delta) {
- proc_table[p].avail_time += delta;
- c_writefirst(dead, cap - delta, lev->queue);
- }
- else {
- proc_table[p].avail_time += cap;
- c_extractfirst(&lev->queue);
- }
- }
- else
- break;
- }
- }
-
- lev->cremaining[p] = proc_table[p].wcet - proc_table[p].avail_time;
-
-
-#ifdef TESTG
- if (starttime && p == 3) {
- oldx = x;
- x = ((lev->cbsghd_dline[p].tv_sec*1000000+lev->cbsghd_dline[p].tv_nsec/1000)/5000 - starttime) + 20;
- // kern_printf("(a%d)",lev->cbsghd_dline[p].tv_sec*1000000+lev->cbsghd_dline[p].tv_nsec/1000);
- if (oldx > x) sys_end();
- if (x<640)
- grx_plot(x, 15, 8);
- }
-#endif
-
- /* and, finally, we reinsert the task in the master level */
- job_task_default_model(job, lev->cbsghd_dline[p]);
- job_task_def_yesexc(job);
- level_table[ lev->scheduling_level ]->
- private_insert(lev->scheduling_level, p, (TASK_MODEL *)&job);
-}
-
-
-/* this is the periodic reactivation of the task... */
-static void CBSGHD_timer_reactivate(void *par)
-{
- PID p = (PID) par;
- CBSGHD_level_des *lev;
-
- lev = (CBSGHD_level_des *)level_table[proc_table[p].task_level];
-
- if (proc_table[p].status == CBSGHD_IDLE) {
- /* the task has finished the current activation and must be
- reactivated */
-
- /* request_time represents the time of the last instance release!! */
- TIMESPEC_ASSIGN(&lev->request_time[p], &lev->reactivation_time[p]);
-
- /* If idle=1, then we have to discharge the capacities stored in
- the capacity queue up to the length of the idle interval */
- if (lev->idle == 1) {
- TIME interval;
- struct timespec delta;
- lev->idle = 0;
- SUBTIMESPEC(&lev->request_time[p], &lev->start_idle, &delta);
- /* length of the idle interval expressed in usec! */
- interval = TIMESPEC2NANOSEC(&delta) / 1000;
-
- /* it discharge the available capacities from the capacity queue */
- while (interval > 0 && lev->queue != NULL) {
- struct timespec dead;
- int cap;
- c_readfirst(&dead, &cap, lev->queue);
- if (cap > interval) {
- c_writefirst(dead, cap - interval, lev->queue);
- interval = 0;
- }
- else {
- interval -= cap;
- c_extractfirst(&lev->queue);
- }
- }
- }
-
- CBSGHD_activation(lev,p,&lev->reactivation_time[p]);
-
- /* check the constraint on the maximum period permitted... */
- if (lev->act_period[p] > lev->maxperiod[p]) {
- kern_printf("Deadline miss(timer_react.! process:%d act_period:%lu maxperiod:%lu\n",
- p, lev->act_period[p], lev->maxperiod[p]);
- kern_raise(XDEADLINE_MISS,p);
- }
-
-
- /* Set the reactivation timer */
- TIMESPEC_ASSIGN(&lev->reactivation_time[p], &lev->cbsghd_dline[p]);
- lev->reactivation_timer[p] = kern_event_post(&lev->reactivation_time[p],
- CBSGHD_timer_reactivate,
- (void *)p);
- event_need_reschedule();
- }
- else {
- /* this situation cannot occur */
- kern_printf("Trying to reactivate a task which is not IDLE!!!/n");
- kern_raise(XINVALID_TASK,p);
- }
-}
-
-
-
-
-
-static void CBSGHD_avail_time_check(CBSGHD_level_des *lev, PID p)
-{
-
- /*+ if the capacity became negative the remaining computation time
- is diminuished.... +*/
- /* if (p==4)
- kern_printf("(old dead:%d av_time:%d crem:%d)\n",
- lev->cbsghd_dline[p].tv_sec*1000000+
- lev->cbsghd_dline[p].tv_nsec/1000, proc_table[p].avail_time,
- lev->cremaining[p]); */
-
-
- if (proc_table[p].avail_time < 0)
- lev->cremaining[p] += proc_table[p].avail_time;
-
- if (lev->cremaining[p] <= 0) {
- kern_printf("Task:%d WCET violation \n", p);
- kern_raise(XWCET_VIOLATION, p);
- ll_abort(666);
- }
-
-
- /* there is a while because if the wcet is << than the system tick
- we need to postpone the deadline many times */
- while (proc_table[p].avail_time <= 0) {
- /* it exploits available capacities from the capacity queue */
- while (proc_table[p].avail_time < lev->cremaining[p]
- && lev->queue != NULL) {
- struct timespec dead;
- int cap, delta;
- delta = lev->cremaining[p] - proc_table[p].avail_time;
- c_readfirst(&dead, &cap, lev->queue);
- if (!TIMESPEC_A_GT_B(&dead, &lev->cbsghd_dline[p])) {
- if (cap > delta) {
- proc_table[p].avail_time += delta;
- c_writefirst(dead, cap - delta, lev->queue);
- }
- else {
- proc_table[p].avail_time += cap;
- c_extractfirst(&lev->queue);
- }
- }
- else
- break;
- }
-
- /* if (p==5 && proc_table[p].avail_time <= 0 &&
- lev->cremaining[p] > lev->cnormal[p])
- kern_printf("(inter dead:%d av_time:%d crem:%d)\n",
- lev->cbsghd_dline[p].tv_sec*1000000+
- lev->cbsghd_dline[p].tv_nsec/1000, proc_table[p].avail_time,
- lev->cremaining[p]); */
-
-
- /* The remaining computation time is modified according
- to the new budget! */
- if (proc_table[p].avail_time > 0)
- lev->cremaining[p] -= proc_table[p].avail_time;
- else {
- /* the CBSGHD rule for recharging the capacity: */
- if (lev->cremaining[p] > lev->cnormal[p]) {
- ADDUSEC2TIMESPEC(lev->period[p], &lev->cbsghd_dline[p]);
- lev->act_period[p] += lev->period[p];
- /* A spare capacity is inserted in the capacity queue!! */
- c_insert(lev->cbsghd_dline[p], lev->cnormal[p], &lev->queue, p);
- }
- else {
- TIME t;
- t = (lev->cremaining[p] * lev->period[p]) / lev->cnormal[p];
- ADDUSEC2TIMESPEC(t, &lev->cbsghd_dline[p]);
- lev->act_period[p] += t;
- /* A spare capacity is inserted in the capacity queue!! */
- c_insert(lev->cbsghd_dline[p], lev->cremaining[p], &lev->queue, p);
- }
- }
- }
-
- /* if (p==4)
- kern_printf("n dead:%d av_time:%d crem:%d)\n",
- lev->cbsghd_dline[p].tv_sec*1000000+
- lev->cbsghd_dline[p].tv_nsec/1000, proc_table[p].avail_time,
- lev->cremaining[p]); */
-
- /* check the constraint on the maximum period permitted... */
- if (lev->act_period[p] > lev->maxperiod[p]) {
- /*kern_printf("n dead:%d av_time:%d crem:%d)\n",
- lev->cbsghd_dline[p].tv_sec*1000000+
- lev->cbsghd_dline[p].tv_nsec/1000, proc_table[p].avail_time,
- lev->cremaining[p]); */
- kern_printf("Deadline miss(av.time_check! process:%d act_period:%lu maxperiod:%lu\n",
- p, lev->act_period[p], lev->maxperiod[p]);
- kern_raise(XDEADLINE_MISS,p);
- }
-
-
-
- if (TIMESPEC_A_LT_B(&lev->reactivation_time[p], &lev->cbsghd_dline[p])) {
- /* we delete the reactivation timer */
- kern_event_delete(lev->reactivation_timer[p]);
- /* repost the event at the next instance deadline... */
- lev->reactivation_time[p] = lev->cbsghd_dline[p];
- lev->reactivation_timer[p] = kern_event_post(&lev->reactivation_time[p],
- CBSGHD_timer_reactivate,
- (void *)p);
- }
-
-#ifdef TESTG
- if (starttime && p == 3) {
- oldx = x;
- x = ((lev->cbsghd_dline[p].tv_sec*1000000+
- lev->cbsghd_dline[p].tv_nsec/1000)/5000 - starttime) + 20;
- // kern_printf("(e%d avail%d)",lev->cbsghd_dline[p].tv_sec*1000000+
- lev->cbsghd_dline[p].tv_nsec/1000,proc_table[p].avail_time);
- if (oldx > x) sys_end();
- if (x<640)
- grx_plot(x, 15, 2);
- }
-#endif
-
-}
-
-
-/*+ this function is called when a killed or ended task reach the
- period end +*/
-static void CBSGHD_timer_zombie(void *par)
-{
- PID p = (PID) par;
- CBSGHD_level_des *lev;
-
- lev = (CBSGHD_level_des *)level_table[proc_table[p].task_level];
-
- /* we finally put the task in the FREE status */
- proc_table[p].status = FREE;
- iq_insertfirst(p,&freedesc);
-
- /* and free the allocated bandwidth */
- lev->U -= (MAX_BANDWIDTH/lev->period[p]) * lev->cnormal[p];
-
-}
-
-static PID CBSGHD_public_scheduler(LEVEL l)
-{
- CBSGHD_level_des *lev = (CBSGHD_level_des *)(level_table[l]);
-
- /* it stores the actual time and set the IDLE flag in order to handle
- the capacity queue discharging!!! */
- lev->idle = 1;
- kern_gettime(&lev->start_idle);
-
-
- /* the CBSGHD don't schedule anything...
- it's an EDF level or similar that do it! */
- return NIL;
-}
-
-/* The on-line guarantee is enabled only if the appropriate flag is set... */
-static int CBSGHD_public_guarantee(LEVEL l, bandwidth_t *freebandwidth)
-{
- CBSGHD_level_des *lev = (CBSGHD_level_des *)(level_table[l]);
-
- if (lev->flags & CBSGHD_FAILED_GUARANTEE) {
- *freebandwidth = 0;
- //kern_printf("guarantee :garanzia fallita!!!!!!\n");
- return 0;
- }
- else if (*freebandwidth >= lev->U) {
- *freebandwidth -= lev->U;
- return 1;
- }
- else {
- //kern_printf("guarantee :garanzia fallita per mancanza di banda!!!!!!\n");
- //kern_printf("freeband: %d request band: %d", *freebandwidth, lev->U);
- return 0;
- }
-}
-
-static int CBSGHD_public_create(LEVEL l, PID p, TASK_MODEL *m)
-{
- CBSGHD_level_des *lev = (CBSGHD_level_des *)(level_table[l]);
- ELASTIC_HARD_TASK_MODEL *s;
- bandwidth_t b1, b2;
-
- if (m->pclass != ELASTIC_HARD_PCLASS) return -1;
- if (m->level != 0 && m->level != l) return -1;
- s = (ELASTIC_HARD_TASK_MODEL *)m;
-
- /* kern_printf("accept :ELASTIC TASK found!!!!!!\n"); */
- b1 = (MAX_BANDWIDTH / s->period) * s->cnormal;
- b2 = (MAX_BANDWIDTH / s->maxperiod) * s->wcet;
- if (!(s->wcet && s->cnormal && s->period && s->maxperiod &&
- s->wcet >= s->cnormal && b1 >= b2) )
- return -1;
- /* kern_printf("period: %d maxperiod: %d cnormal: %d wcet: %d, b1: %d b2:
- %d\n", s->period, s->maxperiod, s->cnormal, s->wcet, b1, b2); */
-
- /* now we know that m is a valid model */
-
-
- /* Enable wcet check */
- proc_table[p].avail_time = 0;
- proc_table[p].wcet = s->wcet;
- proc_table[p].control |= CONTROL_CAP;
-
- lev->period[p] = s->period;
- lev->maxperiod[p] = s->maxperiod;
- lev->cnormal[p] = s->cnormal;
- NULL_TIMESPEC(&lev->cbsghd_dline[p]);
- NULL_TIMESPEC(&lev->request_time[p]);
-
-
- /* update the bandwidth... */
- if (lev->flags & CBSGHD_ENABLE_GUARANTEE) {
- bandwidth_t b;
- b = (MAX_BANDWIDTH / s->period) * s->cnormal;
-
- /* really update lev->U, checking an overflow... */
- if (MAX_BANDWIDTH - lev->U > b)
- lev->U += b;
- else
- /* The task can NOT be guaranteed (U>MAX_BANDWIDTH)...
- (see EDF.c) */
- lev->flags |= CBSGHD_FAILED_GUARANTEE;
- }
-
-
-
- return 0; /* OK, also if the task cannot be guaranteed... */
-}
-
-static void CBSGHD_public_detach(LEVEL l, PID p)
-{
- /* the CBSGHD level doesn't introduce any dinamic allocated new field.
- we have only to reset the NO_GUARANTEE FIELD and decrement the allocated
- bandwidth */
-
- CBSGHD_level_des *lev = (CBSGHD_level_des *)(level_table[l]);
-
- if (lev->flags & CBSGHD_FAILED_GUARANTEE)
- lev->flags &= ~CBSGHD_FAILED_GUARANTEE;
- else
- lev->U -= (MAX_BANDWIDTH / lev->period[p]) * lev->cnormal[p];
-
-
-}
-
-static void CBSGHD_public_dispatch(LEVEL l, PID p, int nostop)
-{
- CBSGHD_level_des *lev = (CBSGHD_level_des *)(level_table[l]);
- level_table[ lev->scheduling_level ]->
- private_dispatch(lev->scheduling_level,p,nostop);
-
-}
-
-static void CBSGHD_public_epilogue(LEVEL l, PID p)
-{
- CBSGHD_level_des *lev = (CBSGHD_level_des *)(level_table[l]);
- JOB_TASK_MODEL job;
-
- /* check if the budget is finished... */
- if ( proc_table[p].avail_time <= 0) {
- /* we kill the current activation */
- level_table[ lev->scheduling_level ]->
- private_extract(lev->scheduling_level, p);
-
- /* we modify the deadline */
- CBSGHD_avail_time_check(lev, p);
-
- /* and, finally, we reinsert the task in the master level */
- job_task_default_model(job, lev->cbsghd_dline[p]);
- job_task_def_yesexc(job);
- level_table[ lev->scheduling_level ]->
- private_insert(lev->scheduling_level, p, (TASK_MODEL *)&job);
- // kern_printf("epil : dl %d per %d p %d |\n",
- // lev->cbsghd_dline[p].tv_nsec/1000,lev->period[p],p);
-
- }
- else
- /* the task has been preempted. it returns into the ready queue by
- calling the guest_epilogue... */
- level_table[ lev->scheduling_level ]->
- private_epilogue(lev->scheduling_level,p);
-}
-
-static void CBSGHD_public_activate(LEVEL l, PID p)
-{
- CBSGHD_level_des *lev = (CBSGHD_level_des *)(level_table[l]);
-
- kern_gettime(&lev->request_time[p]);
-
- /* If idle=1, then we have to discharge the capacities stored in
- the capacity queue up to the length of the idle interval */
- if (lev->idle == 1) {
- TIME interval;
- struct timespec delta;
- lev->idle = 0;
- SUBTIMESPEC(&lev->request_time[p], &lev->start_idle, &delta);
- /* length of the idle interval expressed in usec! */
- interval = TIMESPEC2NANOSEC(&delta) / 1000;
-
- /* it discharge the available capacities from the capacity queue */
- while (interval > 0 && lev->queue != NULL) {
- struct timespec dead;
- int cap;
- c_readfirst(&dead, &cap, lev->queue);
- if (cap > interval) {
- c_writefirst(dead, cap - interval, lev->queue);
- interval = 0;
- }
- else {
- interval -= cap;
- c_extractfirst(&lev->queue);
- }
- }
- }
-
- CBSGHD_activation(lev, p, &lev->request_time[p]);
-
-
- /* check the constraint on the maximum period permitted... */
- if (lev->act_period[p] > lev->maxperiod[p]) {
- kern_printf("Deadline miss(task_activ.! process:%d act_period:%lu maxperiod:%lu\n",
- p, lev->act_period[p], lev->maxperiod[p]);
- kern_raise(XDEADLINE_MISS,p);
- }
-
- /* Set the reactivation timer */
- TIMESPEC_ASSIGN(&lev->reactivation_time[p], &lev->cbsghd_dline[p]);
- lev->reactivation_timer[p] = kern_event_post(&lev->reactivation_time[p],
- CBSGHD_timer_reactivate,
- (void *)p);
-
- // kern_printf("act : %d %d |",lev->cbsghd_dline[p].tv_nsec/1000,p);
-}
-
-static void CBSGHD_public_unblock(LEVEL l, PID p)
-{
- printk("CBSGHD_task_insert\n");
- kern_raise(XINVALID_TASK,p);
-}
-
-static void CBSGHD_public_block(LEVEL l, PID p)
-{
- printk("CBSGHD_task_extract\n");
- kern_raise(XINVALID_TASK,p);
-}
-
-static int CBSGHD_public_message(LEVEL l, PID p, void *m)
-{
- CBSGHD_level_des *lev = (CBSGHD_level_des *)(level_table[l]);
- struct timespec act_time, res;
-
- /* It computes the response time of the current instance... */
- kern_gettime(&act_time);
- SUBTIMESPEC(&act_time, &lev->request_time[p], &res);
- /* response time expressed in usec! */
- lev->last_response_time[p] = TIMESPEC2NANOSEC(&res) / 1000;
-
- level_table[ lev->scheduling_level ]->
- private_extract(lev->scheduling_level,p);
-
-
- /* A spare capacity is inserted in the capacity queue!! */
- if (proc_table[p].avail_time > 0) {
- c_insert(lev->cbsghd_dline[p], proc_table[p].avail_time, &lev->queue, p);
- proc_table[p].avail_time = 0;
- }
-
-
- proc_table[p].status = CBSGHD_IDLE;
-
- jet_update_endcycle(); /* Update the Jet data... */
- trc_logevent(TRC_ENDCYCLE,&exec_shadow); /* tracer stuff */
-
- return 0;
-}
-
-static void CBSGHD_public_end(LEVEL l, PID p)
-{
- CBSGHD_level_des *lev = (CBSGHD_level_des *)(level_table[l]);
-
- /* check if the capacity became negative... */
- /* there is a while because if the wcet is << than the system tick
- we need to postpone the deadline many times */
- while (proc_table[p].avail_time < 0) {
- /* the CBSGHD rule for recharging the capacity */
- proc_table[p].avail_time += lev->cnormal[p];
- ADDUSEC2TIMESPEC(lev->period[p], &lev->cbsghd_dline[p]);
- }
-
- level_table[ lev->scheduling_level ]->
- private_extract(lev->scheduling_level,p);
-
- /* we delete the reactivation timer */
- kern_event_delete(lev->reactivation_timer[p]);
- lev->reactivation_timer[p] = -1;
-
-
- /* Finally, we post the zombie event. when the end period is reached,
- the task descriptor and banwidth are freed */
- proc_table[p].status = CBSGHD_ZOMBIE;
- lev->reactivation_timer[p] = kern_event_post(&lev->cbsghd_dline[p],
- CBSGHD_timer_zombie,
- (void *)p);
-}
-
-/* Registration functions */
-
-/*+ Registration function:
- int flags the init flags ... see CBS.h +*/
-LEVEL CBSGHD_register_level(int flags, LEVEL master)
-{
- LEVEL l; /* the level that we register */
- CBSGHD_level_des *lev; /* for readableness only */
- PID i; /* a counter */
-
- printk("CBSGHD_register_level\n");
-
- /* request an entry in the level_table */
- l = level_alloc_descriptor(sizeof(CBSGHD_level_des));
-
- lev = (CBSGHD_level_des *)level_table[l];
-
- printk(" lev=%d\n",(int)lev);
-
- /* fill the standard descriptor */
- lev->l.public_scheduler = CBSGHD_public_scheduler;
-
- if (flags & CBSGHD_ENABLE_GUARANTEE)
- lev->l.public_guarantee = CBSGHD_public_guarantee;
- else
- lev->l.public_guarantee = NULL;
-
- lev->l.public_create = CBSGHD_public_create;
- lev->l.public_detach = CBSGHD_public_detach;
- lev->l.public_end = CBSGHD_public_end;
- lev->l.public_dispatch = CBSGHD_public_dispatch;
- lev->l.public_epilogue = CBSGHD_public_epilogue;
- lev->l.public_activate = CBSGHD_public_activate;
- lev->l.public_unblock = CBSGHD_public_unblock;
- lev->l.public_block = CBSGHD_public_block;
- lev->l.public_message = CBSGHD_public_message;
-
- /* fill the CBSGHD descriptor part */
- for (i=0; i<MAX_PROC; i++) {
- NULL_TIMESPEC(&lev->cbsghd_dline[i]);
- lev->period[i] = 0;
- NULL_TIMESPEC(&lev->request_time[i]);
- lev->last_response_time[i] = 0;
- NULL_TIMESPEC(&lev->reactivation_time[i]);
- lev->reactivation_timer[i] = -1;
- }
-
-
- lev->U = 0;
- lev->idle = 0;
- lev->queue = NULL;
-
- lev->scheduling_level = master;
-
- lev->flags = flags & 0x07;
-
- return l;
-}
-
-
-int CBSGHD_get_response_time(LEVEL l, PID p)
-{
- CBSGHD_level_des *lev = (CBSGHD_level_des *)(level_table[l]);
-
- return lev->last_response_time[p];
-}
-
-
-bandwidth_t CBSGHD_usedbandwidth(LEVEL l)
-{
- CBSGHD_level_des *lev = (CBSGHD_level_des *)(level_table[l]);
-
- return lev->U;
-}
-
Index: rel_1_21/soccer/readme
===================================================================
--- rel_1_21/soccer/readme (revision 1217)
+++ rel_1_21/soccer/readme (nonexistent)
@@ -1,10 +0,0 @@
-S.Ha.R.K. SOCCER Demo
----------------------
-
-This demo has been developed by Merli Andrea and Zucchetti Alessandro
-in the context of an assignment during the course of industrial informatic
-at the University of Pavia, Italy.
-
-More informations in the soccer.ps file.
-
-Paolo
Index: rel_1_21/soccer/makefile
===================================================================
--- rel_1_21/soccer/makefile (revision 1217)
+++ rel_1_21/soccer/makefile (nonexistent)
@@ -1,17 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS= soccer
-
-include $(BASE)/config/example.mk
-
-soccer:
- make -f $(SUBMAKE) APP=soccer INIT= OTHEROBJS="initfile.o" SHARKOPT="__OLDCHAR__ __GRX__"
-
-
Index: rel_1_21/soccer/iniziali.h
===================================================================
--- rel_1_21/soccer/iniziali.h (revision 1217)
+++ rel_1_21/soccer/iniziali.h (nonexistent)
@@ -1,100 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: iniziali.h,v 1.1.1.1 2002-09-02 09:37:44 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:44 $
- ------------
-*/
-
-/*
- * Copyright (C) 2000 Merli Andrea and Zucchetti Alessandro
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#define YMENU 10 /* menu level */
-#define XMIN 1
-#define XMAX 799
-#define YMIN 100
-#define YMAX 599
-#define D 27
-#define VEL 10 /* linear velocity (def. = 6) */
-#define ANG 15 /* angolo massimo sterzata (15) */
-#define ESC 27 /* ASCII code of ESCAPE key */
-#define MAX_P 10 /* max number of calc */
-#define MAX_B 1
-#define GROUP_SOFT 4
-#define GROUP_PLAY 2
-#define GROUP_BALL 3
-#define PERIOD_BALL 30000
-#define PERIOD_CALC 100000
-#define PERIOD_PORT 30000
-#define CALC_WCET 5000
-#define PORT_WCET 4000
-#define BALL_WCET 5000
-#define BALL_RADIUS 5
-#define VER_RES 600
-#define ORI_RES 800
-#define COL_DEP 16
-#define FREE_MODE 0 /*il giocatore corre palla al piede*/
-#define PASS_MODE 1 /*il giocatore passa la palla rasoterra*/
-#define NO_BALL_MODE 4
-#define PENALTY_MODE_BLUE 5
-#define PENALTY_MODE_WHITE 6
-#define RESTART 6
-#define CANC 370
-#define RLEFT 1 /*RUN LEFT*/
-#define RDOWN 3 /*RUN DOWN*/
-#define RUP 5 /*RUN UP*/
-#define RRIGHT 7 /*RUN RIGHT*/
-#define RRUP 9 /*RUN RIGHT UP*/
-#define RRDW 15 /*RUN RIGHT DOWN*/
-#define RLUP 11 /*RUN LEFT UP*/
-#define RLDW 13 /*RUN LEFT DOWN*/
-#define RLEFT2 17 /*RUN LEFT*/
-#define RDOWN2 19 /*RUN DOWN*/
-#define RUP2 21 /*RUN UP*/
-#define RRIGHT2 23 /*RUN RIGHT*/
-#define RRUP2 25 /*RUN RIGHT UP*/
-#define RRDW2 27 /*RUN RIGHT DOWN*/
-#define RLUP2 29 /*RUN LEFT UP*/
-#define RLDW2 31 /*RUN LEFT DOWN*/
-#define NO_ACT 0
-#define GOAL_ACT 2
-#define MENU_ACT 3
-#define NO_PENALTY 0
-#define PENALTY 1
Index: rel_1_21/soccer/soccer.c
===================================================================
--- rel_1_21/soccer/soccer.c (revision 1217)
+++ rel_1_21/soccer/soccer.c (nonexistent)
@@ -1,1245 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: soccer.c,v 1.2 2003-01-07 17:10:18 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-01-07 17:10:18 $
- ------------
-*/
-
-/*
- * Copyright (C) 2000 Merli Andrea and Zucchetti Alessandro
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-/*--------------------------------------------------------------*/
-/* */
-/* S.Ha.R.K. SOCCER SIMULATOR 2001 */
-/* */
-/* */
-/*Autori: Merli Andrea */
-/* Zucchetti Alessandro */
-/*--------------------------------------------------------------*/
-
-#include <kernel/kern.h>
-#include <drivers/glib.h>
-#include <drivers/keyb.h>
-#include <semaphore.h>
-#include <stdlib.h>
-#include <math.h>
-#include <modules/cabs.h>
-#include <ll/sys/types.h>
-#include "images.h"
-#include "position.h"
-#include "iniziali.h"
-#include "calc.h"
-#include "calc2.h"
-#include "stadio.h"
-
-struct target{
-int x;
-int y;
-};
-
-void draw_calc(int x, int y, int c,int f); /*disegna i calciatori*/
-void draw_ball(int c); /*disegna la palla*/
-void draw_port(int c,int p,int yp,int xp); /*disegna i portieri*/
-void init_calc(); /*carica i task calc*/
-void init_position(int num,int *ox,int *oy); /*inizializza la posizione dei calciatori*/
-void init_calc_area(int i,int *x_min,int *x_max,int *y_min,int *y_max); /*inizializza la zona di campo die calciatori*/
-void get_target(int modo,int i,struct target * obj,int x_max,int x_min,int y_max,int y_min);/*seleziona l'obietivo dei calciatori*/
-void collision_detection(int i);/*gestisce le collisioni tra i calciatori*/
-int get_direction(int x,int y,int x2, int y2);
-void init_portiere(); /*carica i task portiere*/
-void init_ball(); /*carica il task ball*/
-void act_goal(); /*carica il task gol*/
-void draw_goal(); /*gestisce il tabellone facendo apparire la scritta GOAL!!*/
-void disegna_campo(); /*disegna il campo di gioco*/
-int yportiere(int y1, int y2);
-int xportiere(int x1, int x2);
-int goal_behaviour(int f); /*gestisce gli eventi in occasione di un gol*/
-int rigore=0;
-float t;
-double tick = 1.0; /* system tick = 1 ms */
-int xb=300,yb=300,xob=300,yob=300; /* coordinate globali della palla*/
-struct position pos_calc[MAX_P+2];
-PID pid_calc,pid_calc2,pid_ball,pid_port,pid_gol;
-sem_t mutex,mutex2;
-CAB cbi[4];
-
-
-/*--------------------------------------------------------------*/
-TASK ball(void *arg)
-{
-float dx=0, dy=0;//,df=0,dg=0;
-float acc =0.0; /*accelerazione*/
-float x; /*spostamento*/
-int g=10; /*accelerazione di gravit…*/
-float cattr=0.05; /*coeff di attrito tra palla e campo*/
-int col=1000;
-int ij=0;
-int r1=0,r2=0; /*gol segnati*/
-char tetaa[15];
-double r; /*angolo in radianti*/
-int flag =0; /*variabile generatrice di eventi*/
-int outy,outx; /*variabile per rilevare il rimbalzo della palla*/
-float vel1=0.0,vel2=0.0; /*variabili di velocita*/
-float tau = 1.0; /*tempo base*/
-char *m; /*modo*/
-char *a; /*angolo*/
-char *s; /*speed*/
-char modo;
-char *o; /*azione*/
-char azione;
-int teta=0;
-char velocita;
-char mode;
- ij=0;
- m = cab_getmes(cbi[0]);
- mode = *m;
- cab_unget(cbi[0],m);
- if(mode==NO_BALL_MODE){
- xb = xob =(XMIN+XMAX)/2;
- yb = yob =(YMIN+YMAX)/2;
- }
- if(mode ==PENALTY_MODE_BLUE){
-
- xb=700;
- yb=(YMIN+YMAX)/2;
- }
- if(mode == PENALTY_MODE_WHITE){
- xb=100;
- yb=(YMIN+YMAX)/2;
- }
-
- sprintf(tetaa,"BLUE FC %3d AC WHITE %3d",(r1),(r2));
- grx_text(tetaa,XMIN+270 ,YMENU+60, rgb16(255,255,255), rgb16(0,0,0));
-/***************************************************************************/
- while (1) { //WHILE(1);
- m = cab_getmes(cbi[0]);
- mode = *m;
- cab_unget(cbi[0],m);
- /*posiziono la palla sul dischetto del rigore*/
- if(mode ==PENALTY_MODE_BLUE){
- xb=700;
- yb=(YMIN+YMAX)/2;
- }
- if(mode == PENALTY_MODE_WHITE){
- xb=100;
- yb=(YMIN+YMAX)/2;
- }
- /*se rigore=NO_PENALTY si calcolano le coordinate della palla
- in base alla velocit… e alla direzione del tiro*/
- if(rigore ==NO_PENALTY){
- a = cab_getmes(cbi[1]); /*direzione*/
- cab_unget(cbi[1],a);
- s = cab_getmes(cbi[2]); /*velocit…*/
- velocita = *s;
- cab_unget(cbi[2],s);
- acc = (float)cattr * g;
- r = (double)(36*(*a)/12) * PI / 180.;
- if(mode==PASS_MODE){
- vel1= velocita;
- }
- vel2 = vel1 - acc*tau;
- if(vel2>0){
- x = vel1 *tau -0.5*acc*tau*tau;
- dx = (float)(x * cos(r));
- dy = (float)(x * sin(r));
- xb += dx;
- yb += dy;
- ij++;
- outx = (xb > XMAX-2) || (xb < XMIN+2);
- outy = (yb > YMAX-6) || (yb < YMIN+6);
-
- if (outx || outy) {
- if ((yb>=(YMIN+YMAX)/2-50) &&(yb<=(YMIN+YMAX)/2+50)){
- dx=0;
- dy=0;
- }
- xb = xb - dx;
- yb = yb - dy;
- if (outx) teta = 60 - (*a);
- if (outy) teta = 120-(*a);
- if (teta > 120) teta -= 120;
- if (teta < 0) teta += 120;
- *a =(char)teta;
- r = (double)(36*(*a)/12) * PI / 180.;
- dx = (float)(x * cos(r));
- dy = (float)(x * sin(r));
- if ((yb>=(YMIN+YMAX)/2-50) &&(yb<=(YMIN+YMAX)/2+50)){
- dx=0;
- dy=0;
- }
- xb += dx;
- yb += dy;
- }
- modo = NO_BALL_MODE;
- m = cab_reserve(cbi[0]);
- *m = modo;
- cab_putmes(cbi[0],m);
-
- vel1 = vel2;
- }
- if (yb< YMIN+5) yb = yb+10;
- if(xb< XMIN+5) xb = xb +10;
- /*se c'Š un gol*/
- if ((yb>=(YMIN+YMAX)/2-50) &&(yb<=(YMIN+YMAX)/2+50)&&((xb<=XMIN+7)||
- (xb >=XMAX-7))){
- /*aggiorno i risultati*/
- if(xb<XMIN+50) r2++;
- else r1++;
- /*assegno alle variabili i valori di riposo*/
- yb =(YMAX+YMIN)/2;
- xb =(XMIN+XMAX)/2;
- teta=0;
- velocita=0;
- flag =1;
- }
- /* in base al valore di flag modifico il tabellone*/
- flag = goal_behaviour(flag);
- /*scrivo il nuovo risultato nel tabellone*/
- if (flag == 80){
- sprintf(tetaa,"BLUE FC %3d AC WHITE %3d",(r1),(r2));
- grx_text(tetaa,XMIN+270 ,YMENU+60, rgb16(255,255,255), rgb16(0,0,0));
- flag =0;
- o = cab_reserve(cbi[3]);
- azione = NO_ACT; /*nessuna azione*/
- *o = azione;
- cab_putmes(cbi[3],o);
- modo = NO_BALL_MODE;
- m = cab_reserve(cbi[0]);
- *m = modo;
- cab_putmes(cbi[0],m);
- }
-
- }//fine if(rigore==NO_PENALTY)
- draw_ball(0);
- draw_ball(col);
- xob = xb; yob = yb;
-
- task_endcycle();
- }
-
-}
-
-
-/*--------------------------------------------------------------*/
-
-
-
-/******************************************************************/
-
-TASK calc(void *arg){
-
-struct target obj;
-int ox=200, oy=200;
-int alpha=0;
-int teta;
-int col=0;
-char speed;
-char *s;
-char modo;
-char *m;
-char angolo;
-char *a;
-int i = (int)arg;
-int x_min=0,y_min=0;
-int x_max=0,y_max=0;
-/*Posiziono i calciatori nel punto iniziale*/
-
- init_position(i,&ox,&oy);
-
-
- /*Definisco l'area di gioco del calciatore basandomi sul suo PID*/
-
- init_calc_area(i,&x_min,&x_max,&y_min,&y_max);
-
-while (1) {
- m = cab_getmes(cbi[0]);
- modo = *m;
- cab_unget(cbi[0],m);
-
- /*Individua l'obiettivo del calciatore a seconda del modo e del */
- /*ruolo in PENALTY_MODE un calciatore va sul pallone gli altri */
- /*ai lati del campo */
- /*in NO_BALL_MODE l'obiettivo Š la palla se essa Š */
- /*nell'area definita dalla funzione init_calc_area(..) */
- /*altrimenti Š la posizione iniziale definita con init_position(.)*/
-
-
- get_target(modo,i,&obj,x_max,x_min,y_max,y_min);
-
- /*se raggiungo l'obbiettivo mi fermo*/
- if(obj.x==pos_calc[i].x) pos_calc[i].dx=0;
- if(obj.y==pos_calc[i].y) pos_calc[i].dy=0;
-
- /*direzione tra il calciatore e l'obiettivo*/
-
- alpha= get_direction(pos_calc[i].x,pos_calc[i].y,obj.x,obj.y);
-
- /*direzione di corsa iniziale*/
-
- pos_calc[i].dy = -VEL*sin((alpha*PI)/180);
- pos_calc[i].dx = VEL*cos((alpha*PI)/180);
-
-
- /*Per evitare che il calciatore corra prima dell'inizio della
- partita gli impongo di non muoversi in posizione iniziale*/
-
- if((obj.x==300)&&(obj.y==300)) {
- pos_calc[i].dx=0;
- pos_calc[i].dy=0;
- }
- /*velocità di corsa*/
-
- pos_calc[i].x+=pos_calc[i].dx;
- pos_calc[i].y+=pos_calc[i].dy;
-
- /*verifico se mi trovo in una situazione di collisione con */
- /*un altro calciatore */
-
- collision_detection(i);
-
-
-
- /*se il calciatore arriva sulla palla tira*/
- if((modo==NO_BALL_MODE)||(i==7)||(i==2))
- if(((pos_calc[i].x>=xb-27)&&(pos_calc[i].x<=xb+27))&&((pos_calc[i].y>=yb-27)&&(pos_calc[i].y<=yb+27)))
- {
-
- if((i==7)||(i==2)) rigore =NO_PENALTY;
- modo = PASS_MODE;
- m = cab_reserve(cbi[0]);
- *m = modo;
- cab_putmes(cbi[0],m);
- if(i<5){
- a = cab_reserve(cbi[1]);
- teta =(rand()%(90) + 135 );
- if(teta >360) teta -= 360;
- if (teta<0) teta += 360;
- angolo = (char)(teta/3);
- *a = angolo;
- cab_putmes(cbi[1],a);
- }
- if(i>4){
- a = cab_reserve(cbi[1]);
- teta =(rand()%(90) -45);
- if(teta >360) teta -= 360;
- if (teta<0) teta += 360;
- teta = (teta/3);
- *a = teta;//angolo;
- cab_putmes(cbi[1],a);
- }
- s = cab_reserve(cbi[2]);
- speed=16;
- *s =speed;
- cab_putmes(cbi[2],s);
-
- }
-
-
-
- draw_calc(ox, oy, CANC,0);
-
- /*Disegna l'omino voltato nella direzione della palla*/
- if(i<5){
- DIREZ(alpha,col,158,203, RLEFT,pos_calc[i].x,pos_calc[i].y);/*runleft*/
- DIREZ(alpha,col,249,292, RDOWN,pos_calc[i].x,pos_calc[i].y);/*rundown*/
- DIREZ(alpha,col, 68,113, RUP,pos_calc[i].x,pos_calc[i].y);/*runup*/
- DIREZ(alpha,col, 0, 23,RRIGHT,pos_calc[i].x,pos_calc[i].y);/*runright*/
- DIREZ(alpha,col,337,360,RRIGHT,pos_calc[i].x,pos_calc[i].y);
- DIREZ(alpha,col, 23, 68, RRUP,pos_calc[i].x,pos_calc[i].y);/*runrightup*/
- DIREZ(alpha,col,113,158, RLUP,pos_calc[i].x,pos_calc[i].y);/*runleftup*/
- DIREZ(alpha,col,203,249, RLDW,pos_calc[i].x,pos_calc[i].y);/*runleftdown*/
- DIREZ(alpha,col,292,337, RRDW,pos_calc[i].x,pos_calc[i].y);/*runrightdown*/
- }
-
- if(i>4){
-
- DIREZ(alpha,col,158,203, RLEFT2,pos_calc[i].x,pos_calc[i].y);/*runleft*/
- DIREZ(alpha,col,249,292, RDOWN2,pos_calc[i].x,pos_calc[i].y);/*rundown*/
- DIREZ(alpha,col, 68,113, RUP2,pos_calc[i].x,pos_calc[i].y);/*runup*/
- DIREZ(alpha,col, 0, 23,RRIGHT2,pos_calc[i].x,pos_calc[i].y);/*runright*/
- DIREZ(alpha,col,337,360,RRIGHT2,pos_calc[i].x,pos_calc[i].y);
- DIREZ(alpha,col, 23, 68, RRUP2,pos_calc[i].x,pos_calc[i].y);/*runrightup*/
- DIREZ(alpha,col,113,158, RLUP2,pos_calc[i].x,pos_calc[i].y);/*runleftup*/
- DIREZ(alpha,col,203,249, RLDW2,pos_calc[i].x,pos_calc[i].y);/*runleftdown*/
- DIREZ(alpha,col,292,337, RRDW2,pos_calc[i].x,pos_calc[i].y);/*runrightdown*/
- }
-
-
- ox =pos_calc[i].x; oy = pos_calc[i].y;
-
- task_endcycle();
- }
-}
-/****************************************************************/
-TASK gol(void *arg)
-{
- while(1){
- draw_goal();
- task_endcycle();
- }
-}
-/****************************************************************/
-TASK portiere(void *arg)
-{
-int yp,yp1,yp0,ypo_0=(YMAX+YMIN)/2,ypo_1=(YMAX+YMIN)/2;
-int xp0,xp1,xpo_0,xpo_1,xo0,xo1;
-int np= (int)arg;
-char speed;
-char *s;
-char modo;
-char *m;
-char angolo;
-char *a;
-
- yp = (YMIN+YMAX)/2; /* y di attesa*/
- yp0 = (YMIN+YMAX)/2;
- yp1 = (YMIN+YMAX)/2;
- xp0 = xpo_0 = XMIN+3; /* xp ascissa attuale portiere, xpo ascissa vecchia posizione portiere*/
- xp1 = xpo_1 = XMAX-30;
- xo0 = XMIN+3; /* x di attesa*/
- xo1 = XMAX-30; /* x di attesa*/
- draw_port(1,np,yp,xo0);
- draw_port(1,np,yp,xo1);
-
- while(1){
- m = cab_getmes(cbi[0]);
- modo = *m;
- cab_unget(cbi[0],m);
- /*in base alla posizione della palla si calcola la posizione del portiere*/
- if ((np==0) && (xb < (XMIN+XMAX)/2) &&(xb > XMIN+150)){
- yp0 = yportiere(yb,yp0);
- xp0 = xportiere(xo0,xp0);
- }
- if ((np==0) &&(xb <= XMIN+150)){
- yp0 = yportiere(yb,yp0);
- xp0= xportiere(xb,xp0);
- }
- if ((np==0) && (xb > (XMIN+XMAX)/2)){
- yp0 = yportiere(yp,yp0);
- xp0 = xportiere(xo0,xp0);
- }
- /*il portiere non esce oltre questi limiti*/
- if ((yp0< (YMIN+YMAX)/2-100)|| (yp0>(YMIN+YMAX)/2+100))
- yp0 = ypo_0;
- if(xp0> XMIN+150)
- xp0 =xpo_0;
-
- pos_calc[10].x = xp0;
- pos_calc[10].y = yp0;
-
- /*in base alla posizione della palla si calcola la posizione del portiere*/
- if ((np==1) && (xb > (XMIN+XMAX)/2) && (xb< XMAX-150)){
- yp1 = yportiere(yb,yp1);
- xp1 = xportiere(xo1,xp1);
- }
- if ((np==1) && (xb >= XMAX-150)){
- yp1 = yportiere(yb,yp1);
- xp1 = xportiere(xb,xp1);
- }
- if ((np==1) && (xb < (XMIN+XMAX)/2)){
- yp1 = yportiere(yp,yp1);
- xp1 = xportiere(xo1,xp1);
- }
- /*il portiere non esce oltre questi limiti*/
- if ((yp1< (YMIN+YMAX)/2-100)|| (yp1>(YMIN+YMAX)/2+100))
- yp1 =ypo_1;
- if(xp1 < XMAX-150)
- xp1 =xpo_1;
-
- pos_calc[11].x = xp1;
- pos_calc[11].y = yp1;
-
- /*in caso di rigore il portiere aspetta il tiro sulla linea della porta*/
- if (rigore ==PENALTY) xp0= XMIN+3;
-
- if ((np==0)){
- draw_port(0,np,ypo_0,xpo_0);
- draw_port(1,np,yp0,xp0);
- ypo_0 = yp0;
- xpo_0 =xp0;
- }
-
- /*in caso di rigore il portiere aspetta il tiro sulla linea della porta*/
- if(rigore ==PENALTY) xp1= XMAX-30;
-
- if((np==1)){
- draw_port(0,np,ypo_1,xpo_1);
- draw_port(1,np,yp1,xp1);
- ypo_1 = yp1;
- xpo_1 = xp1;
- }
-
- /*se para rinvia immediatamente*/
- if( (yp0 >=yb-5) && (yp0<yb+20) && ((xb<=xp0+20)&&(xb>=xp0-30))){
- m = cab_reserve(cbi[0]);
- modo = PASS_MODE;
- *m = modo;
- cab_putmes(cbi[0],m);
- a = cab_reserve(cbi[1]);
- angolo =0;
- *a = angolo;
- cab_putmes(cbi[1],a);
- s = cab_reserve(cbi[2]);
- speed=20;
- *s =speed;
- cab_putmes(cbi[2],s);
- }
- /*se para rinvia immediatamente*/
- if((yp1 >=yb-5) && (yp1<yb+20) && (xb<=xp1+20)&&(xb>= xp1-30) ){
- m = cab_reserve(cbi[0]);
- modo = PASS_MODE;
- *m = modo;
- cab_putmes(cbi[0],m);
- a = cab_reserve(cbi[1]);
- angolo =60;
- *a = angolo;
- cab_putmes(cbi[1],a);
- s = cab_reserve(cbi[2]);
- speed=20;
- *s =speed;
- cab_putmes(cbi[2],s);
- }
- task_endcycle();
- }
-}
-
-/****************************************************************/
-/* This function is called when the system exits */
-void byebye(void *arg)
-{
- grx_close();
- kern_printf("Bye Bye!\n");
-}
-
-/****************************** MAIN ******************************/
-
-int main(int argc, char **argv)
-{
-
-
- char c; /* character from keyboard */
- int z=0;
- int p=0;
- int ij=0;
- char modo;
- char *m;
- char *s;
- char speed;
- char *a;
- char angolo;
- char *o;
- char azione;
-
-
- TIME seme; /* used to init the random seed */
-
- /* Set the closing function */
- sys_atrunlevel(byebye, NULL, RUNLEVEL_BEFORE_EXIT);
-
- /* graphic card Initialization */
- if (grx_init() < 1) {
- sys_abort(1);
- }
-
- if (grx_open(ORI_RES,VER_RES,COL_DEP) < 0) {
- kern_printf("GRX Err\n");
- sys_abort(1);
- }
- kern_printf("Video card ok!\n");
- cbi[1] = cab_create("direzione",10,15);
- cbi[0] = cab_create("modo",4,15);
- cbi[2] = cab_create("velocita",10,15);
- cbi[3] = cab_create("azione",3,3);
- m = cab_reserve(cbi[0]);
- modo = NO_BALL_MODE;
- *m = modo;
- cab_putmes(cbi[0],m);
- a = cab_reserve(cbi[1]);
- angolo =0;
- *a = angolo;
- cab_putmes(cbi[1],a);
- s = cab_reserve(cbi[2]);
- speed=0;
- *s =speed;
- cab_putmes(cbi[2],s);
- o = cab_reserve(cbi[3]);
- azione = NO_ACT;
- *o = azione;
- cab_putmes(cbi[3],o);
-
- /* The scenario */
-
- grx_box(0,0,ORI_RES,VER_RES,0);
- disegna_campo();
- for(p=0;p<scale_width;p++)
- for(z=0;z<scale_height;z++){
- grx_plot(100+p,0+z,rgb16(stadio_cmap[(unsigned char)scale_data[z*150+p]][0],stadio_cmap[(unsigned char)scale_data[z*150+p]][1],stadio_cmap[(unsigned char)scale_data[z*150+p]][2]));
- grx_plot(550+p,0+z,rgb16(stadio_cmap[(unsigned char)scale_data[z*150+p]][0],stadio_cmap[(unsigned char)scale_data[z*150+p]][1],stadio_cmap[(unsigned char)scale_data[z*150+p]][2]));
- }
- for(p=0;p<faro_width;p++)
- for(z=0;z<faro_height;z++){
- grx_plot(0+p,0+z,rgb16(stadio_cmap[(unsigned char)faros_data[z*100+p]][0],stadio_cmap[(unsigned char)faros_data[z*100+p]][1],stadio_cmap[(unsigned char)faros_data[z*100+p]][2]));
- grx_plot(700+p,0+z,rgb16(stadio_cmap[(unsigned char)farod_data[z*100+p]][0],stadio_cmap[(unsigned char)farod_data[z*100+p]][1],stadio_cmap[(unsigned char)farod_data[z*100+p]][2]));
- }
- for(p=0;p<schermo_width;p++)
- for(z=0;z<schermo_height;z++){
- grx_plot(250+p,0+z,rgb16(stadio_cmap[(unsigned char)schermo_data[z*schermo_width+p]][0],stadio_cmap[(unsigned char)schermo_data[z*schermo_width+p]][1],stadio_cmap[(unsigned char)schermo_data[z*schermo_width+p]][2]));
- }
- grx_text(" Simulation of Soccer", XMIN+260, YMENU+10, rgb16(255,255,255), rgb16(0,0,0));
- grx_text(" W rigore bianchi, E rigore blue", XMIN+260, YMENU+20, rgb16(255,255,255), rgb16(0,0,0));
- grx_text(" SPACE crea squadre, K kill all ", XMIN+260, YMENU+30, rgb16(255,255,255), rgb16(0,0,0));
- grx_text(" ESC Return to MS-DOS ", XMIN+260, YMENU+40, 12, rgb16(255,255,255));
- /* The program waits a space to create a calc */
- c = keyb_getch(BLOCK);
-
- /* randomize!!!!*/
- seme = sys_gettime(NULL);
- srand(seme);
-
- do {
- if ((c == ' ') &&(ij==0)) {
- init_ball();
- init_calc();
- init_portiere();
- ij++;
- }
- if ((c== 'w')){m = cab_reserve(cbi[0]);
- modo = PENALTY_MODE_WHITE;
- *m = modo;
- cab_putmes(cbi[0],m);
- rigore =PENALTY; }
- if ((c== 'e')){m = cab_reserve(cbi[0]);
- modo = PENALTY_MODE_BLUE;
- *m = modo;
- cab_putmes(cbi[0],m);
- rigore =PENALTY; }
- if ((c == 'k')) {
- group_kill(GROUP_PLAY);
- group_kill(GROUP_SOFT);
- group_kill(GROUP_BALL);
- ij=0;
- m = cab_reserve(cbi[0]);
- modo = NO_BALL_MODE;
- *m = modo;
- cab_putmes(cbi[0],m);
- disegna_campo();
- for(p=0;p<scale_width;p++)
- for(z=0;z<scale_height;z++){
- grx_plot(100+p,0+z,rgb16(stadio_cmap[(unsigned char)scale_data[z*150+p]][0],stadio_cmap[(unsigned char)scale_data[z*150+p]][1],stadio_cmap[(unsigned char)scale_data[z*150+p]][2]));
- grx_plot(550+p,0+z,rgb16(stadio_cmap[(unsigned char)scale_data[z*150+p]][0],stadio_cmap[(unsigned char)scale_data[z*150+p]][1],stadio_cmap[(unsigned char)scale_data[z*150+p]][2]));
- }
- for(p=0;p<faro_width;p++)
- for(z=0;z<faro_height;z++){
- grx_plot(0+p,0+z,rgb16(stadio_cmap[(unsigned char)faros_data[z*100+p]][0],stadio_cmap[(unsigned char)faros_data[z*100+p]][1],stadio_cmap[(unsigned char)faros_data[z*100+p]][2]));
- grx_plot(700+p,0+z,rgb16(stadio_cmap[(unsigned char)farod_data[z*100+p]][0],stadio_cmap[(unsigned char)farod_data[z*100+p]][1],stadio_cmap[(unsigned char)farod_data[z*100+p]][2]));
- }
- grx_text(" Simulation of Soccer", XMIN+260, YMENU+10, rgb16(255,255,255), rgb16(0,0,0));
- grx_text(" W rigore bianchi, E rigore blue", XMIN+260, YMENU+20, rgb16(255,255,255), rgb16(0,0,0));
- grx_text(" SPACE crea squadre, K kill all ", XMIN+260, YMENU+30, rgb16(255,255,255), rgb16(0,0,0));
- grx_text(" ESC Return to MS-DOS ", XMIN+260, YMENU+40, 12, rgb16(255,255,255));
- xb=(int)(XMAX-XMIN)/2;
- yb=(int)(YMIN+YMAX)/2;
- }
- c = keyb_getch(BLOCK);
- } while (c != ESC);
-
-
-
- sys_end();
-
- return 0;
-}
-
-/*--------------------------------------------------------------*/
-void draw_calc(int x, int y, int c,int f)
-{
- int i,j;/*needed in the macro*/
- sem_wait(&mutex);
- if(c==CANC){
-
- grx_box(x, y,x+27,y+27,SFONDO);
- if((x>(XMIN+XMAX)/2-27) && (x<(XMIN+XMAX)/2+27)){
- grx_line(XMIN+1,YMIN+1,XMAX-1,YMIN+1,rgb16(255,255,255));
- grx_line(XMIN+1,YMAX-1,XMAX-1,YMAX-1,rgb16(255,255,255));
- grx_line(XMIN+1,YMIN+1,XMIN+1,(YMIN+YMAX)/2-50,rgb16(255,255,255));
- grx_line(XMIN+1,(YMIN+YMAX)/2+50,XMIN+1,YMAX-1,rgb16(255,255,255));
- grx_line(XMAX-1,YMIN+1,XMAX-1,(YMIN+YMAX)/2-50,rgb16(255,255,255));
- grx_line(XMAX-1,(YMIN+YMAX)/2+50,XMAX-1,YMAX-1,rgb16(255,255,255));
- grx_line(((XMIN+XMAX)/2),YMIN,((XMIN+XMAX)/2),YMAX-1,rgb16(255,255,255));
- grx_circle((XMIN+XMAX)/2,(YMIN+YMAX)/2,54,rgb16(255,255,255));
- grx_line(XMIN,(YMIN+YMAX)/4+30,(XMIN+XMAX)/5,(YMIN+YMAX)/4+30,rgb16(255,255,255));
- grx_line((XMIN+XMAX)/5,(YMIN+YMAX)/4+30,(XMIN+XMAX)/5,3*(YMIN+YMAX)/4-30,rgb16(255,255,255));
- grx_line(XMIN,3*(YMIN+YMAX)/4-30,(XMIN+XMAX)/5,3*(YMIN+YMAX)/4-30,rgb16(255,255,255));
- grx_line(XMIN,(YMIN+YMAX)/2-70,(XMIN+XMAX)/10,(YMIN+YMAX)/2-70,rgb16(255,255,255));
- grx_line((XMIN+XMAX)/10,(YMIN+YMAX)/2-70,(XMIN+XMAX)/10,(YMIN+YMAX)/2+70,rgb16(255,255,255));
- grx_line(XMIN,(YMIN+YMAX)/2+70,(XMIN+XMAX)/10,(YMIN+YMAX)/2+70,rgb16(255,255,255));
- grx_line(4*(XMIN+XMAX)/5,(YMIN+YMAX)/4+30,XMAX,(YMIN+YMAX)/4+30,rgb16(255,255,255));
- grx_line(4*(XMIN+XMAX)/5,(YMIN+YMAX)/4+30,4*(XMIN+XMAX)/5,3*(YMIN+YMAX)/4-30,rgb16(255,255,255));
- grx_line(4*(XMIN+XMAX)/5,3*(YMIN+YMAX)/4-30,XMAX,3*(YMIN+YMAX)/4-30,rgb16(255,255,255));
- grx_line(9*(XMIN+XMAX)/10,(YMIN+YMAX)/2-70,XMAX,(YMIN+YMAX)/2-70,rgb16(255,255,255));
- grx_line(9*(XMIN+XMAX)/10,(YMIN+YMAX)/2-70,9*(XMIN+XMAX)/10,(YMIN+YMAX)/2+70,rgb16(255,255,255));
- grx_line(9*(XMIN+XMAX)/10,(YMIN+YMAX)/2+70,XMAX,(YMIN+YMAX)/2+70,rgb16(255,255,255));
- grx_line(XMIN+1,(YMIN+YMAX)/2-50,XMIN+1,(YMIN+YMAX)/2+50,rgb16(100,100,100));
- grx_line(XMAX-1,(YMIN+YMAX)/2-50,XMAX-1,(YMIN+YMAX)/2+50,rgb16(100,100,100));
- grx_box(XMIN,(YMIN+YMAX)/2-50,XMIN+2,(YMIN+YMAX)/2+50,rgb16(50,0,50));
- grx_box(XMAX-2,(YMIN+YMAX)/2-50,XMAX,(YMIN+YMAX)/2+50,rgb16(50,0,50));
- }
- }
- else
- if(c==RLEFT)
- DIRDRAW(x,y,((unsigned char)runup_data[i*27+j]));
- if(c==RLEFT+1)
- DIRDRAW(x,y,((unsigned char)runup2_data[i*27+j]));
- if(c==RDOWN)
- DIRDRAW(x,y,((unsigned char)rundes2_data[i*27+j]));
- if(c==RDOWN+1)
- DIRDRAW(x,y,((unsigned char)rundes_data[i*27+j]));
- if(c==RUP)
- DIRDRAW(x,y,((unsigned char)runleft2_data[i*27+j]));
- if(c==RUP+1)
- DIRDRAW(x,y,((unsigned char)runleft_data[i*27+j]));
- if(c==RRIGHT)
- DIRDRAW(x,y,((unsigned char)rundown2_data[i*27+j]));
- if(c==RRIGHT+1)
- DIRDRAW(x,y,((unsigned char)rundown_data[i*27+j]));
- if(c==RRUP)
- DIRDRAW(x,y,((unsigned char)runld2_data[i*27+j]));
- if(c==RRUP+1)
- DIRDRAW(x,y,((unsigned char)runld_data[i*27+j]));
- if(c==RLUP)
- DIRDRAW(x,y,((unsigned char)runlu2_data[i*27+j]));
- if(c==RLUP+1)
- DIRDRAW(x,y,((unsigned char)runlu_data[i*27+j]));
- if(c==RLDW)
- DIRDRAW(x,y,((unsigned char)runru2_data[i*27+j]));
- if(c==RLDW+1)
- DIRDRAW(x,y,((unsigned char)runru_data[i*27+j]));
- if(c==RRDW)
- DIRDRAW(x,y,((unsigned char)runrd2_data[i*27+j]));
- if(c==RRDW+1)
- DIRDRAW(x,y,((unsigned char)runrd_data[i*27+j]));
-/**********************************************************************/
- if(c==RLEFT2)
- DIRDRAW(x,y,((unsigned char)B_runup_data[i*27+j]));
- if(c==RLEFT2+1)
- DIRDRAW(x,y,((unsigned char)B_runup2_data[i*27+j]));
- if(c==RDOWN2)
- DIRDRAW(x,y,((unsigned char)B_rundes2_data[i*27+j]));
- if(c==RDOWN2+1)
- DIRDRAW(x,y,((unsigned char)B_rundes_data[i*27+j]));
- if(c==RUP2)
- DIRDRAW(x,y,((unsigned char)B_runleft2_data[i*27+j]));
- if(c==RUP2+1)
- DIRDRAW(x,y,((unsigned char)B_runleft_data[i*27+j]));
- if(c==RRIGHT2)
- DIRDRAW(x,y,((unsigned char)B_rundown2_data[i*27+j]));
- if(c==RRIGHT2+1)
- DIRDRAW(x,y,((unsigned char)B_rundown_data[i*27+j]));
- if(c==RRUP2)
- DIRDRAW(x,y,((unsigned char)B_runld2_data[i*27+j]));
- if(c==RRUP2+1)
- DIRDRAW(x,y,((unsigned char)B_runld_data[i*27+j]));
- if(c==RLUP2)
- DIRDRAW(x,y,((unsigned char)B_runlu2_data[i*27+j]));
- if(c==RLUP2+1)
- DIRDRAW(x,y,((unsigned char)B_runlu_data[i*27+j]));
- if(c==RLDW2)
- DIRDRAW(x,y,((unsigned char)B_runru2_data[i*27+j]));
- if(c==RLDW2+1)
- DIRDRAW(x,y,((unsigned char)B_runru_data[i*27+j]));
- if(c==RRDW2)
- DIRDRAW(x,y,((unsigned char)B_runrd2_data[i*27+j]));
- if(c==RRDW2+1)
- DIRDRAW(x,y,((unsigned char)B_runrd_data[i*27+j]));
- sem_post(&mutex);
-}
-/*--------------------------------------------------------------*/
-void draw_ball(int c)
-{
- sem_wait(&mutex);
- if(c==0)
- grx_box(xob, yob,xob+5,yob+5,SFONDO);
- else grx_putimage(xb, yb,xb+5,yb+5,pallone);
- sem_post(&mutex);
-}
-void draw_port(int c,int p,int yp,int xp)
-{
- int i,j;
- sem_wait(&mutex);
- if (c==0){
- if(p==0){
- /*ridisegna l'area*/
- grx_box(xp,yp-15,xp+30,yp+25,SFONDO);
- grx_line(XMIN,(YMIN+YMAX)/4+30,(XMIN+XMAX)/5,(YMIN+YMAX)/4+30,rgb16(255,255,255));
- grx_line((XMIN+XMAX)/5,(YMIN+YMAX)/4+30,(XMIN+XMAX)/5,3*(YMIN+YMAX)/4-30,rgb16(255,255,255));
- grx_line(XMIN,3*(YMIN+YMAX)/4-30,(XMIN+XMAX)/5,3*(YMIN+YMAX)/4-30,rgb16(255,255,255));
- grx_line(XMIN,(YMIN+YMAX)/2-70,(XMIN+XMAX)/10,(YMIN+YMAX)/2-70,rgb16(255,255,255));
- grx_line((XMIN+XMAX)/10,(YMIN+YMAX)/2-70,(XMIN+XMAX)/10,(YMIN+YMAX)/2+70,rgb16(255,255,255));
- grx_line(XMIN,(YMIN+YMAX)/2+70,(XMIN+XMAX)/10,(YMIN+YMAX)/2+70,rgb16(255,255,255));
- grx_box(XMIN,(YMIN+YMAX)/2-50,XMIN+2,(YMIN+YMAX)/2+50,rgb16(50,0,50));
- }
- if(p==1){
- /*ridisegna l'area*/
- grx_box(xp,yp-15,xp+27,yp+25,SFONDO);
- grx_line(4*(XMIN+XMAX)/5,(YMIN+YMAX)/4+30,XMAX,(YMIN+YMAX)/4+30,rgb16(255,255,255));
- grx_line(4*(XMIN+XMAX)/5,(YMIN+YMAX)/4+30,4*(XMIN+XMAX)/5,3*(YMIN+YMAX)/4-30,rgb16(255,255,255));
- grx_line(4*(XMIN+XMAX)/5,3*(YMIN+YMAX)/4-30,XMAX,3*(YMIN+YMAX)/4-30,rgb16(255,255,255));
- grx_line(9*(XMIN+XMAX)/10,(YMIN+YMAX)/2-70,XMAX,(YMIN+YMAX)/2-70,rgb16(255,255,255));
- grx_line(9*(XMIN+XMAX)/10,(YMIN+YMAX)/2-70,9*(XMIN+XMAX)/10,(YMIN+YMAX)/2+70,rgb16(255,255,255));
- grx_line(9*(XMIN+XMAX)/10,(YMIN+YMAX)/2+70,XMAX,(YMIN+YMAX)/2+70,rgb16(255,255,255));
- grx_box(XMAX-2,(YMIN+YMAX)/2-50,XMAX,(YMIN+YMAX)/2+50,rgb16(50,0,50));
- }
- }
- else{
- if(p==0)
- DIRDRAW(xp,yp,((unsigned char)portsx_data[i*27+j]));
- if(p==1)
- DIRDRAW(xp,yp,((unsigned char)portdx_data[i*27+j]));
- }
- sem_post(&mutex);
-}
-void init_ball(){
- HARD_TASK_MODEL m_ball;
- hard_task_default_model(m_ball);
- hard_task_def_ctrl_jet (m_ball);
- hard_task_def_arg (m_ball, (void *)0);
- hard_task_def_wcet (m_ball, BALL_WCET);
- hard_task_def_mit (m_ball, PERIOD_BALL);
- hard_task_def_group (m_ball, GROUP_BALL);
- hard_task_def_usemath (m_ball);
- pid_ball = task_create("ball", ball, &m_ball, NULL);
- if (pid_ball == NIL) {
- grx_close();
- perror("Could not create task <ball>");
- sys_abort(1);
- }
-
- task_activate(pid_ball);
-}
-void init_calc(){
- HARD_TASK_MODEL m_calc;
- int i;
- disegna_campo();
- for(i=0;i<MAX_P;i++){
- hard_task_default_model(m_calc);
- hard_task_def_ctrl_jet (m_calc);
- hard_task_def_arg (m_calc, (void *)i);
- hard_task_def_wcet (m_calc, CALC_WCET);
- hard_task_def_mit (m_calc, PERIOD_CALC);
- hard_task_def_group (m_calc, GROUP_PLAY);
- hard_task_def_usemath (m_calc);
- pid_calc = task_create("calc", calc, &m_calc, NULL);
- if (pid_calc == NIL) {
- grx_close();
- perror("Could not create task <calc>");
- sys_abort(1);
- }
- task_activate(pid_calc);
- }
- }
-void act_goal(){
-
-
- SOFT_TASK_MODEL m_goal;
- soft_task_default_model(m_goal);
- soft_task_def_arg (m_goal,(void*)0);
- soft_task_def_met (m_goal, 1000);
- soft_task_def_level (m_goal,1);
- soft_task_def_ctrl_jet (m_goal);
- soft_task_def_period (m_goal, 1200000);
- soft_task_def_group (m_goal, GROUP_SOFT);
- soft_task_def_usemath (m_goal);
- soft_task_def_aperiodic(m_goal);
-
- pid_gol = task_create("gol", gol, &m_goal, NULL);
- if (pid_gol == NIL) {
- grx_close();
- perror("Could not create task <port>");
- sys_abort(1);
- }
- task_activate(pid_gol);
- }
-void init_portiere(){
- HARD_TASK_MODEL m_port;
- int g;
- for(g=0;g<2;g++){
- hard_task_default_model(m_port);
- hard_task_def_arg (m_port, (void *)g);
- hard_task_def_wcet (m_port, PORT_WCET);
- hard_task_def_mit (m_port, PERIOD_PORT);
- hard_task_def_group (m_port, GROUP_SOFT);
- hard_task_def_usemath (m_port);
- pid_port = task_create("portiere", portiere, &m_port, NULL);
- if (pid_port == NIL) {
- grx_close();
- perror("Could not create task <port>");
- sys_abort(1);
- }
- task_activate(pid_port);
- }
-
- }
-void draw_goal(){
- int p,z;
- char *m;
- char modo;
- char *o;
- char azione;
- m = cab_reserve(cbi[0]);
- modo = NO_BALL_MODE;
- *m = modo;
- cab_putmes(cbi[0],m);
- o = cab_getmes(cbi[3]);
- azione = *o;
- cab_unget(cbi[3],o);
-
- /*scritta GOAL!!*/
- if(azione == GOAL_ACT){
- for(p=0;p<schermo_width;p++)
- for(z=0;z<schermo_height;z++){
- grx_plot(250+p,0+z,rgb16(stadio_cmap[(unsigned char)goal1_data[z*schermo_width+p]][0],stadio_cmap[(unsigned char)schermo_data[z*schermo_width+p]][1],stadio_cmap[(unsigned char)schermo_data[z*schermo_width+p]][2]));
- }
- o = cab_reserve(cbi[3]);
- azione = 0;
- *o = azione;
- cab_putmes(cbi[3],o);
- }
-
- /*risistema il menu sul tabellone*/
- if (azione == MENU_ACT){
- for(p=0;p<schermo_width;p++)
- for(z=0;z<schermo_height;z++){
- grx_plot(250+p,0+z,rgb16(stadio_cmap[(unsigned char)schermo_data[z*schermo_width+p]][0],stadio_cmap[(unsigned char)schermo_data[z*schermo_width+p]][1],stadio_cmap[(unsigned char)schermo_data[z*schermo_width+p]][2]));
- }
- o = cab_reserve(cbi[3]);
- azione = NO_ACT;
- *o = azione;
- cab_putmes(cbi[3],o);
- grx_text(" Simulation of Soccer", XMIN+260, YMENU+10, rgb16(255,255,255), rgb16(0,0,0));
- grx_text(" W rigore bianchi, E rigore blue", XMIN+260, YMENU+20, rgb16(255,255,255), rgb16(0,0,0));
- grx_text(" SPACE crea squadre, K kill all ", XMIN+260, YMENU+30, rgb16(255,255,255), rgb16(0,0,0));
- grx_text(" ESC Return to MS-DOS ", XMIN+260, YMENU+40, 12, rgb16(255,255,255));
- }
-}
-
-/*calcola la y del portiere in base alla yi in ingresso*/
-int yportiere(int yi,int yf){
- int speedy =3;
- int dy=0;
- int yp;
- /*Se sto per raggiungere la palla rallento*/
- if(abs(yi-yf)<VEL) speedy=1;
- /*se raggiungo la palla mi fermo*/
- if(yi==yf)dy=0;
- /*se palla in basso*/
- if(yi>yf) dy= speedy;
- /*se palla in alto*/
- if(yi<yf) dy=-speedy;
- yp =yf+dy;
- return(yp);
-}
-/*calcola la x del portiere in base alla xi in ingresso*/
-int xportiere(int xi, int xf){
- int speedx=3;
- int dx=0;
- int xp;
- if(abs(xi-xf)<VEL) speedx=1;
- if(xi==xf)dx=0;
- if(xi>xf) dx= speedx;
- if(xi<xf) dx=-speedx;
- xp = xf +dx;
- return(xp);
-}
-/*disegna il campo di gioco*/
-void disegna_campo(){
- //grx_box(0,0,ORI_RES,VER_RES,0);
- grx_box(XMIN, YMIN, XMAX, YMAX, SFONDO);
- grx_rect(XMIN+1, YMIN+1, XMAX-1, YMAX-1, rgb16(255,255,255));
- grx_line(((XMIN+XMAX)/2),YMIN,((XMIN+XMAX)/2),YMAX-1,rgb16(255,255,255));
- grx_circle((XMIN+XMAX)/2,(YMIN+YMAX)/2,54,rgb16(255,255,255));
- grx_rect(XMIN,(YMIN+YMAX)/4+30,(XMIN+XMAX)/5,3*(YMIN+YMAX)/4-30,rgb16(255,255,255));
- grx_rect(4*(XMIN+XMAX)/5,(YMIN+YMAX)/4+30,XMAX,3*(YMIN+YMAX)/4-30,rgb16(255,255,255));
- grx_rect(XMIN,(YMIN+YMAX)/2-70,(XMIN+XMAX)/10,(YMIN+YMAX)/2+70,rgb16(255,255,255));
- grx_rect(9*(XMIN+XMAX)/10,(YMIN+YMAX)/2-70,XMAX,(YMIN+YMAX)/2+70,rgb16(255,255,255));
- grx_box(XMIN,(YMIN+YMAX)/2-50,XMIN+2,(YMIN+YMAX)/2+50,rgb16(50,0,50));
- grx_box(XMAX-2,(YMIN+YMAX)/2-50,XMAX,(YMIN+YMAX)/2+50,rgb16(50,0,50));
-}
-void init_position(int num,int *ox,int *oy)
-{
- if(num<5){
- pos_calc[num].x = *ox = initial_calc_position[num].x+35;
- pos_calc[num].y = *oy = initial_calc_position[num].y;
- }
- if(num==2){
- pos_calc[num].x = *ox = initial_calc_position[num].x+100;
- pos_calc[num].y = *oy = initial_calc_position[num].y;
- }
- if(num>4){
- pos_calc[num].x = *ox = initial_calc_position[num-5].x;
- pos_calc[num].y = *oy = initial_calc_position[num-5].y+35;
- }
- if(num==7){
- pos_calc[num].x = *ox = initial_calc_position[num-5].x-100;
- pos_calc[num].y = *oy = initial_calc_position[num-5].y;
- }
-
-}
-void init_calc_area(int num,int *xmin,int *xmax,int *ymin,int *ymax){
-
-
- switch(num)
- {
- case 0: /*attaccante bianchi*/
- case 5: /*difensore blu*/
- {
- *xmin = XMIN;
- *ymin = YMIN;
- *xmax = 255;
- *ymax = 305;
- }
- break;
- case 1: /*attaccante bianchi*/
- case 6: /*difensore blu*/
- {
- *xmin = XMIN;
- *ymin = 295;
- *xmax = 255;
- *ymax = YMAX;
- }
- break;
- case 2: /*centrocampisti*/
- case 7:
- {
- *xmin = 255;
- *ymin = YMIN;
- *xmax = 525;
- *ymax = YMAX;
- } break;
- case 3: /*attaccante blu*/
- case 8: /*difensore bianco*/
- {
- *xmin = 525;
- *ymin = YMIN;
- *xmax = XMAX;
- *ymax = 305;
- }
- break;
- case 4: /*attaccante blu*/
- case 9: /*difensore bianco*/
- {
- *xmin = 505;
- *ymin = 305;
- *xmax = XMAX;
- *ymax = YMAX;
- }
- break;
- default:
- break;
- }
-}
-void get_target(int modo,int i,struct target * obj,int x_max,int x_min,int y_max,int y_min){
-
-
-
- if((modo==PENALTY_MODE_WHITE)||(modo==PENALTY_MODE_BLUE)){
-
-
-
- if((i<5)){
- obj->x = (XMAX)-100-50*i;
- if(pos_calc[i].y>(YMAX+YMIN)/2)
- obj->y = YMAX-60;
- if(pos_calc[i].y<(YMAX+YMIN)/2)
- obj->y = YMIN+60;
- if(modo==PENALTY_MODE_WHITE){
- if((i==2)){
- obj->x = xb;
- obj->y = yb;
- }
- }
- }
- if((i>4)){
- obj->x = (XMIN)+100+50*i;
- if(pos_calc[i].y>(YMAX+YMIN)/2)
- obj->y = YMAX-60;
- if(pos_calc[i].y<(YMAX+YMIN)/2)
- obj->y = YMIN+60;
- if(modo==PENALTY_MODE_BLUE){
- if((i==7)){
- obj->x = xb;
- obj->y = yb;
- }
- }
-
- }
- }
-
- if(modo==NO_BALL_MODE)
- {
-
- /*Valutazione se la palla sia in una zona di interesse per il */
- /*calciatore */
-
- if((xb>x_max)||(xb<x_min)||(yb>y_max)||(yb<y_min))
- {
- if(i<5)
- {
- obj->x=initial_calc_position[i].x;
- obj->y=initial_calc_position[i].y;
- }
- if(i>4)
- {
- obj->x=initial_calc_position[i-5].x;
- obj->y=initial_calc_position[i-5].y;
- }
- }
- else
- {
- obj->x=xb;
- obj->y=yb;
- }
- }
-
-
-
-
-}
-int get_direction(int x,int y,int x2,int y2){
-
-int ang=0;
- if((abs(x-x2) !=0)){
- if((x>x2)&&(y<=y2))
- ang = 180+
- atan((float)abs(y-y2)/
- (float)abs(x-x2))*
- 180/PI;
- if((x<x2)&&(y<y2))
- ang = 360-
- atan((float)abs(y-y2)/
- (float)abs(x-x2))*
- 180/PI;
- if((x<x2)&&(y>y2))
- ang =
- atan((float)abs(y-y2)/
- (float)abs(x-x2))*
- 180/PI;
- if((x>x2)&&(y>y2))
- ang = 180-
- atan((float)abs(y-y2)/
- (float)abs(x-x2))*
- 180/PI;
- }
-
-return ang;
-
-}
-
-void collision_detection(int i){
-
-int j;
-
-
-for(j=0;j<MAX_P+2;j++){
-
- if(i!=j){
- if(pos_calc[i].x<pos_calc[j].x+27 && pos_calc[i].x>pos_calc[j].x-27
- && pos_calc[i].y<pos_calc[j].y && pos_calc[i].y>pos_calc[j].y-27)
- {
- pos_calc[i].y=pos_calc[j].y-27;
- }
- if(pos_calc[i].x<pos_calc[j].x && pos_calc[i].x>pos_calc[j].x-27
- && pos_calc[i].y<pos_calc[j].y+27 && pos_calc[i].y>pos_calc[j].y-27)
- {
- pos_calc[i].x=pos_calc[j].x-27;
- }
- if(pos_calc[i].x<pos_calc[j].x+27 && pos_calc[i].x>pos_calc[j].x-27
- && pos_calc[i].y<pos_calc[j].y+27 && pos_calc[i].y>pos_calc[j].y)
- {
- pos_calc[i].y=pos_calc[j].y+27;
- }
- if(pos_calc[i].x<pos_calc[j].x+27 && pos_calc[i].x>pos_calc[j].x
- && pos_calc[i].y<pos_calc[j].y+27 && pos_calc[i].y>pos_calc[j].y)
- {
- pos_calc[i].x=pos_calc[j].x+27;
- }
- }
- }
-
- /*Per impedire un calciatore esca dal campo*/
-
- if(pos_calc[i].x>=XMAX-(pos_calc[i].dx+1)) pos_calc[i].x-=(pos_calc[i].dx+1);
- if(pos_calc[i].x<=XMIN+(pos_calc[i].dx+1)) pos_calc[i].x+=(pos_calc[i].dx+1);
- if(pos_calc[i].y>=YMAX-(pos_calc[i].dy+1)) pos_calc[i].y-=(pos_calc[i].dy+1);
- if(pos_calc[i].y<=YMIN+(pos_calc[i].dy+1)) pos_calc[i].y+=(pos_calc[i].dy+1);
-}
-
-int goal_behaviour(int flag){
-char *o;
-char azione;
-
- if (flag !=0) {
- flag++;
- yb =(YMAX+YMIN)/2;
- xb =(XMIN+XMAX)/2;
- }
- if (flag==20){
- yb =(YMAX+YMIN)/2;
- xb =(XMIN+XMAX)/2;
- /*seleziono l'azione da compiere sul tabellone*/
- o = cab_reserve(cbi[3]);
- azione = GOAL_ACT; /*scritta GOAL!!*/
- *o = azione;
- cab_putmes(cbi[3],o);
- /*carico il task gol*/
- act_goal();
- }
- if (flag==65){
- o = cab_reserve(cbi[3]);
- azione = MENU_ACT; /*sistema il menu su tabellone*/
- *o = azione;
- cab_putmes(cbi[3],o);
- /*carico il task gol*/
- act_goal();
- }
-
- return(flag);
-}
-
Index: rel_1_21/soccer/initfile.c
===================================================================
--- rel_1_21/soccer/initfile.c (revision 1217)
+++ rel_1_21/soccer/initfile.c (nonexistent)
@@ -1,120 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: initfile.c,v 1.1.1.1 2002-09-02 09:37:44 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:44 $
- ------------
-
- System initialization file
-
- This file contains the 2 functions needed to initialize the system.
-
- These functions register the following levels:
-
- an EDF (Earliest Deadline First) level
- a RR (Round Robin) level
- a CBS (Costant Bandwidth Server) level
- a Dummy level
-
- It can accept these task models:
-
- HARD_TASK_MODEL (wcet+mit) at level 0
- SOFT_TASK_MODEL (met, period) at level 1
- NRT_TASK_MODEL at level 2
-
- This file is similar to the configuration of kernel/init/hartik3.c
-
- TICK is set to 0 (one-shot timer is used)
-*/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- CBS_register_level(CBS_ENABLE_ALL, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- SEM_register_module();
-
- CABS_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- keyb_def_ctrlC(kparms, NULL);
- keyb_def_map(kparms,itaMap);
- KEYB_init(&kparms);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
Index: rel_1_21/soccer/calc.h
===================================================================
--- rel_1_21/soccer/calc.h (revision 1217)
+++ rel_1_21/soccer/calc.h (nonexistent)
@@ -1,1017 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: calc.h,v 1.1.1.1 2002-09-02 09:37:44 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:44 $
- ------------
-*/
-
-/*
- * Copyright (C) 2000 Merli Andrea and Zucchetti Alessandro
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/* GIMP header image file format (INDEXED): /mnt/disk/shark/base/images/runup//runup.h */
-
-//static unsigned int runup_width = 27;
-//static unsigned int runup_height = 27;
-
-
-/*Macro che disegan un calciatore che corre*/
-
-#define DIRDRAW(X,Y,D) \
- for(i=0;i<27;i++)\
- for(j=0;j<27;j++)\
- grx_plot(X+i,Y+j,rgb16(cmap[D][0],cmap[D][1],cmap[D][2]));\
- /* sprintf(a,"%d",f);\
- grx_text(a,X+30,Y+30, rgb16(255,255,255), rgb16(0,0,0));*/
-/*Macro che calcola i parametri di draw_calc*/
-#define DIREZ(A,C,G,S,F,X,Y) \
- if(col<12){\
- if( (A<=S)&&(A>=G)){ \
- if(C<=4) { \
- draw_calc(X, Y, F,i); \
- C++; \
- } \
- else if(C>4){ \
- draw_calc(X,Y,F+1,i); \
- C++; \
- if(C==8)C=0; \
- } \
- }\
- }
-
-/* Call this macro repeatedly. After each use, the pixel data can be extracted */
-
-#define HEADER_PIXEL(data,pixel) {\
-pixel[0] = runup_cmap[(unsigned char)data[0]][0]; \
-pixel[1] = runup_data_cmap[(unsigned char)data[0]][1]; \
-pixel[2] = runup_data_cmap[(unsigned char)data[0]][2]; \
-data ++; }
-
-static char cmap[256][3] = {
- { 0, 0, 0},
- { 0, 0, 64},
- { 0, 0,128},
- { 0, 0,255},
- { 0, 32, 0},
- { 0, 32, 64},
- { 0, 32,128},
- { 0, 32,255},
- { 0, 64, 0},
- { 0, 64, 64},
- { 0, 64,128},
- { 0, 64,255},
- { 0, 96, 0},
- { 0, 96, 64},
- { 0, 96,128},
- { 0, 96,255},
- { 0,128, 0},
- { 0,128, 64},
- { 0,128,128},
- { 0,128,255},
- { 0,160, 0},
- { 0,160, 64},
- { 0,160,128},
- { 0,160,255},
- { 0,192, 0},
- { 0,192, 64},
- { 0,192,128},
- { 0,192,255},
- { 0,255, 0},
- { 0,255, 64},
- { 0,255,128},
- { 0,255,255},
- { 32, 0, 0},
- { 32, 0, 64},
- { 32, 0,128},
- { 32, 0,255},
- { 32, 32, 0},
- { 32, 32, 64},
- { 32, 32,128},
- { 32, 32,255},
- { 32, 64, 0},
- { 32, 64, 64},
- { 32, 64,128},
- { 32, 64,255},
- { 32, 96, 0},
- { 32, 96, 64},
- { 32, 96,128},
- { 32, 96,255},
- { 32,128, 0},
- { 32,128, 64},
- { 32,128,128},
- { 32,128,255},
- { 32,160, 0},
- { 32,160, 64},
- { 32,160,128},
- { 32,160,255},
- { 32,192, 0},
- { 32,192, 64},
- { 32,192,128},
- { 32,192,255},
- { 32,255, 0},
- { 32,255, 64},
- { 32,255,128},
- { 32,255,255},
- { 64, 0, 0},
- { 64, 0, 64},
- { 64, 0,128},
- { 64, 0,255},
- { 64, 32, 0},
- { 64, 32, 64},
- { 64, 32,128},
- { 64, 32,255},
- { 64, 64, 0},
- { 64, 64, 64},
- { 64, 64,128},
- { 64, 64,255},
- { 64, 96, 0},
- { 64, 96, 64},
- { 64, 96,128},
- { 64, 96,255},
- { 64,128, 0},
- { 64,128, 64},
- { 64,128,128},
- { 64,128,255},
- { 64,160, 0},
- { 64,160, 64},
- { 64,160,128},
- { 64,160,255},
- { 64,192, 0},
- { 64,192, 64},
- { 64,192,128},
- { 64,192,255},
- { 64,255, 0},
- { 64,255, 64},
- { 64,255,128},
- { 64,255,255},
- { 96, 0, 0},
- { 96, 0, 64},
- { 96, 0,128},
- { 96, 0,255},
- { 96, 32, 0},
- { 96, 32, 64},
- { 96, 32,128},
- { 96, 32,255},
- { 96, 64, 0},
- { 96, 64, 64},
- { 96, 64,128},
- { 96, 64,255},
- { 96, 96, 0},
- { 96, 96, 64},
- { 96, 96,128},
- { 96, 96,255},
- { 96,128, 0},
- { 96,128, 64},
- { 96,128,128},
- { 96,128,255},
- { 96,160, 0},
- { 96,160, 64},
- { 96,160,128},
- { 96,160,255},
- { 96,192, 0},
- { 96,192, 64},
- { 96,192,128},
- { 96,192,255},
- { 96,255, 0},
- { 96,255, 64},
- { 96,255,128},
- { 96,255,255},
- {128, 0, 0},
- {128, 0, 64},
- {128, 0,128},
- {128, 0,255},
- {128, 32, 0},
- {128, 32, 64},
- {128, 32,128},
- {128, 32,255},
- {128, 64, 0},
- {128, 64, 64},
- {128, 64,128},
- {128, 64,255},
- {128, 96, 0},
- {128, 96, 64},
- {128, 96,128},
- {128, 96,255},
- {128,128, 0},
- {128,128, 64},
- {128,128,128},
- {128,128,255},
- {128,160, 0},
- {128,160, 64},
- {128,160,128},
- {128,160,255},
- {128,192, 0},
- {128,192, 64},
- {128,192,128},
- {128,192,255},
- {128,255, 0},
- {128,255, 64},
- {128,255,128},
- {128,255,255},
- {160, 0, 0},
- {160, 0, 64},
- {160, 0,128},
- {160, 0,255},
- {160, 32, 0},
- {160, 32, 64},
- {160, 32,128},
- {160, 32,255},
- {160, 64, 0},
- {160, 64, 64},
- {160, 64,128},
- {160, 64,255},
- {160, 96, 0},
- {160, 96, 64},
- {160, 96,128},
- {160, 96,255},
- {160,128, 0},
- {160,128, 64},
- {160,128,128},
- {160,128,255},
- {160,160, 0},
- {160,160, 64},
- {160,160,128},
- {160,160,255},
- {160,192, 0},
- {160,192, 64},
- {160,192,128},
- {160,192,255},
- {160,255, 0},
- {160,255, 64},
- {160,255,128},
- {160,255,255},
- {192, 0, 0},
- {192, 0, 64},
- {192, 0,128},
- {192, 0,255},
- {192, 32, 0},
- {192, 32, 64},
- {192, 32,128},
- {192, 32,255},
- {192, 64, 0},
- {192, 64, 64},
- {192, 64,128},
- {192, 64,255},
- {192, 96, 0},
- {192, 96, 64},
- {192, 96,128},
- {192, 96,255},
- {192,128, 0},
- {192,128, 64},
- {192,128,128},
- {192,128,255},
- {192,160, 0},
- {192,160, 64},
- {192,160,128},
- {192,160,255},
- {192,192, 0},
- {192,192, 64},
- {192,192,128},
- {192,192,255},
- {192,255, 0},
- {192,255, 64},
- {192,255,128},
- {192,255,255},
- {255, 0, 0},
- {255, 0, 64},
- {255, 0,128},
- {255, 0,255},
- {255, 32, 0},
- {255, 32, 64},
- {255, 32,128},
- {255, 32,255},
- {255, 64, 0},
- {255, 64, 64},
- {255, 64,128},
- {255, 64,255},
- {255, 96, 0},
- {255, 96, 64},
- {255, 96,128},
- {255, 96,255},
- {255,128, 0},
- {255,128, 64},
- {255,128,128},
- {255,128,255},
- {255,160, 0},
- {255,160, 64},
- {255,160,128},
- {255,160,255},
- {255,192, 0},
- {255,192, 64},
- {255,192,128},
- {255,192,255},
- {255,255, 0},
- {255,255, 64},
- {255,255,128},
- {255,255,255}
- };
-static char runup_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16, 0, 0, 0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16, 0, 0, 0, 0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16, 0, 0,255, 0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16, 0, 0,16,16,16,16, 0,255, 0, 0, 0, 0, 0,16,16,16,16,16,16,16,16,16,16,16,
- 16,16, 0,255,233, 0,16,16,16,16, 0,255,233,233,233, 0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16, 0,233, 0, 0, 0, 0, 0,16, 0,233,233,233,233, 0,233, 0,16,16,16,16,16,16,16,16,16,
- 16,16, 0, 0,255,255,255,255,255, 0, 0,233, 0,233, 0,233, 0, 0, 0, 0, 0,16,16,16,16,16,16,
- 16,16, 0,255,255,255,255,255,255, 0, 0, 0,233, 0,233, 0,233, 0,255,255, 0, 0, 0,16,16,16,16,
- 16,16,16, 0,255,255,255,255,255, 0, 0,233, 0,233, 0, 0, 0, 0,255,255,255,255,255, 0,16,16,16,
- 16,16,16, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0,233, 0, 0, 0,255,255,255,255,255,255, 0,16,16,
- 16,16,16,16,16, 0, 0, 0, 0,255, 0, 0,233, 0, 0, 0, 0,255,255,255,255,255,255,255, 0, 0,16,
- 16,16,16,16,16,16,16,16, 0, 0,255, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0,233, 0,16,
- 16,16,16,16,16,16,16,16,16, 0, 0,255,255,255,255, 0,255, 0, 0,16,16, 0, 0,233, 0, 0,16,
- 16,16,16,16,16,16,16,16,16,16, 0, 0, 0,255, 0,255, 0, 0, 0,233,16,16, 0, 0, 0,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16, 0, 0, 0, 0, 0,233,233, 0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 0,255,255,255, 0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 0,255,255, 0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 0,255, 0, 0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 0, 0, 0, 0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 0, 0, 0, 0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 0, 0, 0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
- };
-static char runup2_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,255,0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,0,255,0,16,16,16,16,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,233,233,233,255, 0,16,16,16,16,0,233,255,0,16,16,
- 16,16,16,16,16,16,16,16,16,0,233,0,233,233,233,233, 0,16,0,0,0,0,0,233,0,16,16,
- 16,16,16,16,16,16,0,0,0,0,0,233,0,233,0,233,0,0,255,255,255,255,255,0,0,16,16,
- 16,16,16,16,0,0,0,255,255,0,233,0,233,0,233,0,0,0,255,255,255,255,255,255,0,16,16,
- 16,16,16,0,255,255,255,255,255,0,0,0,0,233,0,233,0,0,255,255,255,255,255,0,16,16,16,
- 16,16,0,255,255,255,255,255,255,0,0,0,233,0,0,0,0,255,255,255,0,0,0,0,16,16,16,
- 16,0,0,255,255,255,255,255,255,255,0,0,0,0,233,0,0,255,0,0,0,0,16,16,16,16,16,
- 16,0,233,0,0,0,0,0,0,255,255,0,0,0,0,0, 255,0,0,16,16,16,16,16,16,16,16,
- 16,0,0,233,0,0,16,16,0,0,255,0,255,255,255,255, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,0,0,0,16,16,233,0,0,0,255,0,255,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,233,233,0,0,0,0,0,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,255,255,255,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,255,255,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,255,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
- };
-static char runru_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,4,77,0,12,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,4,100,246,169,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,8,37,68,68,68,8,16,16,16,16,16,12,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,8,219,255,219,0,8,16,16,16,4,0,0,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,0,219,255,255,219,0,12,16,4,36,36,0,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,4,110,255,255,255,219,4,16,45,219,218,73,4,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,8,0,110,255,255,255,41,8,36,182,0,4,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,12,0,146,255,255,73,0,32,233,242,165,0,12,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,218,182,0,0,132,133,233,233,165,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,219,146,32,201,133,132,233,233,165,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,146,0,0,32,100,32,132,132,32,68,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,146,36,165,64,100,100,132,133,100,100,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,219,110,64,0,132,100,0,165,64,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,37,255,110,0,0,0,0,0,73,110,4,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,37,255,255,73,36,0,37,73,255,255,73,4,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,4,37,110,73,219,219,255,255,255,255,37,8,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,4,110,73,110,146,109,255,255,255,255,37,8,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,12,36,73,68,0,0,4,73,255,255,255,218,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,12,77,255,238,133,137,48,8,73,255,255,182,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,12,4,146,255,255,101,72,16,4,0,73,255,110,8,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,4,36,218,182,109,4,16,16,8,32,100,137,0,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0,0,0,4,16,16,16,8,32,100,100,0,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,0,0,4,16,16,16,16,16,8,4,4,12,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,0,4,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,12,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
- };
-
- static char runru2_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,8,12,12,8,12,12,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,12,0,0,110,182,218,37,8,4,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,4,100,137,255,255,255,255,37,73,4,16,12,12,12,12,16,16,16,12,16,16,16,16,16,16,
- 16,16,4,100,100,73,255,255,255,255,255,110,0,100,68,0,0,12,16,4,0,8,16,16,16,16,16,
- 16,16,8,32,32,0,73,255,255,255,255,73,64,100,32,165,165,0,4,73,0,0,12,16,16,16,16,
- 16,16,16,8,8,4,8,73,255,255,73,0,165,133,132,233,233,165,0,218,36,0,16,16,16,16,16,
- 16,16,16,16,16,16,48,4,109,255,37,0,0,132,132,233,233,242,182,219,36,4,16,16,16,16,16,
- 16,16,16,16,16,72,137,0,146,219,0,0,100,100,32,132, 133,233,36,45,4,16,16,16,16,16,16,
- 16,16,16,16,4,101,133,0,110,219,36,0,132,100,100,133,132,32,8,16,16,16,16,16,16,16,16,
- 16,16,16,4,109,255,238,68,73,73,73,0,0,64,32,201,0,0,41,4,12,16,16,16,16,16,16,
- 16,16,4,0,182,255,255,73,110,110,255,110,64,165,0,32,0,73,255,219,0,8,8,8,12,16,16,
- 16,4,0,0,218,146,77,36,4,37,255,255,110,36,0,146,182,255,255,255,219,0,68,169,0,16,16,
- 12,0,0,0,36,4,12,12,16,4,37,37,219,146,146,219,218,255,255,255,255,219,68,246,77,16,16,
- 16,8,0,0,4,12,16,16,16,16,8,8,0,0,0,0,0,146,110,255,255,255,68,100,4,16,16,
- 16,16,12,16,16,16,16,16,16,16,16,16,12,12,16,12,12,0,0,110,219,219,37,4,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,12,8,4,0,8,8,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,12,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
- };
-
-static char rundes_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,0,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,233,0,0,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,233,0,255,255,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,0,255,255,255, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,255,255,255, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,255,255,255, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0,0,0,0,0,233,16,0,255,255,255, 255,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0,0,255,255,233,0,0,0,255,255,255, 255,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0,255,255,255,233,0,0,255,255,0,0, 0,0,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,0,0,0,0,255,0,0,255,255,0,0,0, 233,0,233,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0,255,0,0,0,0,0, 0,233,0,0,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0,255,0,0,233,0, 233,0,233,233,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,255,255,0,0,0,233, 0,233,233,233,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0,255,0,233,0,0, 233,0,233,233,0,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,255,0,0,0,233, 0,233,233,255,0,255,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,255,0,0,0, 0,0,0,0,255,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,255,255,0, 0,0,16,16,0,0,0,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,0,255,255, 255,255,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,255,255, 255,255,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,255, 255,255,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,255, 255,255,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,255, 255,255,0,233,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0, 255,0,233,255,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 0,0,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-
-static char rundes2_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 0,0,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0, 255,0,233,255,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,255, 255,255,0,233,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,255, 255,255,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,255, 255,255,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,255,255, 255,255,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,0,255,255, 255,255,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,255,255,0, 0,0,16,16,0,0,0,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,255,0,0,0, 0,0,0,0,255,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,255,0,0,0,233, 0,233,233,255,0,255,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0,255,0,233,0,0, 233,0,233,233,0,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,255,255,0,0,0,233, 0,233,233,233,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0,255,0,0,233,0, 233,0,233,233,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0,255,0,0,0,0,0, 0,233,0,0,0,16,16,16,16,16,16,
- 16,16,16,16,0,0,0,0,255,0,0,255,255,0,0,0, 233,0,233,0,16,16,16,16,16,16,16,
- 16,16,16,0,0,0,255,255,255,233,0,0,255,255,0,0, 0,0,0,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0,0,255,255,233,0,0,0,255,255,255, 255,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0,0,0,0,0,233,16,0,255,255,255, 255,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,255,255,255, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,255,255,255, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,0,255,255,255, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,233,0,255,255,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,233,0,0,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,0,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char runrd_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,12,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,0,4,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,0,0,4,16,16,16,16, 16,8,4,4,12,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0,0,0,4,16,16,16, 8,32,100,100,0,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,4,36,218,182,109,4,16,16, 8,32,100,137,0,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,12,4,146,255,255,101,72,16, 4,0,73,255,110,8,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,12,77,255,238,133,137,48, 8,73,255,255,182,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,12,36,73,68,0,0,4, 73,255,255,255,218,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,4,110,73,110,146,109, 255,255,255,255,37,8,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,4,37,110,73,219,219,255, 255,255,255,37,8,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,37,255,255,73,36,0,37, 73,255,255,73,4,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,37,255,110,0,0,0,0, 0,73,110,4,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,219,110,64,0,132,100,0, 165,64,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,146,36,165,64,100,100,132, 133,100,100,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,146,0,0,32,100,32,132, 132,32,68,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,219,146,32,201,133,132,233, 233,165,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,218,182,0,0,132,133,233, 233,165,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,12,0,146,255,255,73,0,32,233,242, 165,0,12,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,8,0,110,255,255,255,41,8,36,182, 0,4,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,4,110,255,255,255,219,4,16,45,219, 218,73,4,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,0,219,255,255,219,0,12,16,4,36, 36,0,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,8,219,255,219,0,8,16,16,16,4, 0,0,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,8,37,68,68,68,8,16,16,16,16, 16,12,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,4,100,246,169,8,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,4,77,0,12,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char runrd2_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,12,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,12,8,4,0,8,8,16,16,16,16,
- 16,16,12,16,16,16,16,16,16,16,16,16,12,12,16,12, 12,0,0,110,219,219,37,4,16,16,16,
- 16,8,0,0,4,12,16,16,16,16,8,8,0,0,0,0, 0,146,110,255,255,255,68,100,4,16,16,
- 12,0,0,0,36,4,12,12,16,4,37,37,219,146,146,219, 218,255,255,255,255,219,68,246,77,16,16,
- 16,4,0,0,218,146,77,36,4,37,255,255,110,36,0,146, 182,255,255,255,219,0,68,169,0,16,16,
- 16,16,4,0,182,255,255,73,110,110,255,110,64,165,0,32, 0,73,255,219,0,8,8,8,12,16,16,
- 16,16,16,4,109,255,238,68,73,73,73,0,0,64,32,201, 0,0,41,4,12,16,16,16,16,16,16,
- 16,16,16,16,4,101,133,0,110,219,36,0,132,100,100,133, 132,32,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,72,137,0,146,219,0,0,100,100,32,132, 133,233,36,45,4,16,16,16,16,16,16,
- 16,16,16,16,16,16,48,4,109,255,37,0,0,132,132,233, 233,242,182,219,36,4,16,16,16,16,16,
- 16,16,16,8,8,4,8,73,255,255,73,0,165,133,132,233, 233,165,0,218,36,0,16,16,16,16,16,
- 16,16,8,32,32,0,73,255,255,255,255,73,64,100,32,165, 165,0,4,73,0,0,12,16,16,16,16,
- 16,16,4,100,100,73,255,255,255,255,255,110,0,100,68,0, 0,12,16,4,0,8,16,16,16,16,16,
- 16,16,4,100,137,255,255,255,255,37,73,4,16,12,12,12, 12,16,16,16,12,16,16,16,16,16,16,
- 16,16,12,0,0,110,182,218,37,8,4,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,8,12,12,8,12,12,8,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char rundown_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,255,0,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,255,255,0,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,255,255,255,0,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,233,233,0,0,0,0,0,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,0,0,0,16,16,233,0,0,0,255,0,255,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,0,0,233,0,0,16,16,0,0,255,0,255,255,255,255, 0,0,16,16,16,16,16,16,16,16,16,
- 16,0,233,0,0,0,0,0,0,255,255,0,0,0,0,0, 255,0,0,16,16,16,16,16,16,16,16,
- 16,0,0,255,255,255,255,255,255,255,0,0,0,0,233,0, 0,255,0,0,0,0,16,16,16,16,16,
- 16,16,0,255,255,255,255,255,255,0,0,0,233,0,0,0, 0,255,255,255,0,0,0,0,16,16,16,
- 16,16,16,0,255,255,255,255,255,0,0,0,0,233,0,233, 0,0,255,255,255,255,255,0,16,16,16,
- 16,16,16,16,0,0,0,255,255,0,233,0,233,0,233,0, 0,0,255,255,255,255,255,255,0,16,16,
- 16,16,16,16,16,16,0,0,0,0,0,233,0,233,0,233, 0,0,255,255,255,255,255,0,0,16,16,
- 16,16,16,16,16,16,16,16,16,0,233,0,233,233,233,233, 0,16,0,0,0,0,0,233,0,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,233,233,233,255, 0,16,16,16,16,0,233,255,0,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,0, 255,0,16,16,16,16,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,255, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char rundown2_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,255,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,255,255,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,255,255,255,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,0,233,233,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,0,255,0,255,0,0,0,233,16,16,0,0,0,16,16,
- 16,16,16,16,16,16,16,16,16,0,0,255,255,255,255,0,255,0,0,16,16,0,0,233,0,0,16,
- 16,16,16,16,16,16,16,16,0,0,255,0,0,0,0,0,255,255,0,0,0,0,0,0,233,0,16,
- 16,16,16,16,16,0,0,0,0,255,0,0,233,0,0,0,0,255,255,255,255,255,255,255,0,0,16,
- 16,16,16,0,0,0,0,255,255,255,0,0,0,0,233,0,0,0,255,255,255,255,255,255,0,16,16,
- 16,16,16,0,255,255,255,255,255,0,0,233,0,233,0,0,0,0,255,255,255,255,255,0,16,16,16,
- 16,16,0,255,255,255,255,255,255,0,0,0,233,0,233,0,233,0,255,255,0,0,0,16,16,16,16,
- 16,16,0,0,255,255,255,255,255,0,0,233,0,233,0,233,0,0,0,0,0,16,16,16,16,16,16,
- 16,16,0,233,0,0,0,0,0,16,0,233,233,233,233,0,233,0,16,16,16,16,16,16,16,16,16,
- 16,16,0,255,233,0,16,16,16,16,0,255,233,233,233,0,0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,16,16,16,16,0,255,0,0,0,0,0,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0,255,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
- };
-
-static char runld_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,12,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 4,0,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,12,4,4,8,16,16,16,16,16,4, 0,0,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,0,100,100,32,8,16,16,16,4,0, 0,0,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,0,137,100,32,8,16,16,4,109,182, 218,36,4,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,8,110,255,73,0,4,16,72,101,255,255, 146,4,12,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,182,255,255,73,8,48,137,133,238,255, 77,12,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,218,255,255,255,73,4,0,0,68,73, 36,12,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,8,37,255,255,255,255,109,146,110,73,110, 4,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,8,37,255,255,255,255,219,219,73,110, 37,4,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,4,73,255,255,73,37,0,36,73,255, 255,37,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,4,110,73,0,0,0,0,0,110, 255,37,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,64,165,0,100,132,0,64, 110,219,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,100,100,133,132,100,100,64,165, 36,146,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,68,32,132,132,32,100,32,0, 0,146,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,165,233,233,132,133,201,32, 146,219,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,165,233,233,133,132,0,0, 182,218,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,12,0,165,242,233,32,0,73, 255,255,146,0,12,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,4,0,182,36,8,41,255, 255,255,110,0,8,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,4,73,218,219,45,16,4,219, 255,255,255,110,4,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,0,36,36,4,16,12,0, 219,255,255,219,0,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,0,0,4,16,16,16,8, 0,219,255,219,8,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,12,16,16,16,16,16,8, 68,68,68,37,8,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,8, 169,246,100,4,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,12, 0,77,4,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char runld2_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,12,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,8,8,0,4,8,12,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,4,37,219,219,110,0,0,12,12,16,12,12,16, 16,16,16,16,16,16,16,16,12,16,16,
- 16,16,4,100,68,255,255,255,110,146,0,0,0,0,0,8, 8,16,16,16,16,12,4,0,0,8,16,
- 16,16,77,246,68,219,255,255,255,255,218,219,146,146,219,37, 37,4,16,12,12,4,36,0,0,0,12,
- 16,16,0,169,68,0,219,255,255,255,182,146,0,36,110,255, 255,37,4,36,77,146,218,0,0,4,16,
- 16,16,12,8,8,8,0,219,255,73,0,32,0,165,64,110, 255,110,110,73,255,255,182,0,4,16,16,
- 16,16,16,16,16,16,12,4,41,0,0,201,32,64,0,0, 73,73,73,68,238,255,109,4,16,16,16,
- 16,16,16,16,16,16,16,16,8,32,132,133,100,100,132,0, 36,219,110,0,133,101,4,16,16,16,16,
- 16,16,16,16,16,16,4,45,36,233,133,132,32,100,100,0, 0,219,146,0,137,72,16,16,16,16,16,
- 16,16,16,16,16,4,36,219,182,242,233,233,132,132,0,0, 37,255,109,4,48,16,16,16,16,16,16,
- 16,16,16,16,16,0,36,218,0,165,233,233,132,133,165,0, 73,255,255,73,8,4,8,8,16,16,16,
- 16,16,16,16,12,0,0,73,4,0,165,165,32,100,64,73, 255,255,255,255,73,0,32,32,8,16,16,
- 16,16,16,16,16,8,0,4,16,12,0,0,68,100,0,110, 255,255,255,255,255,73,100,100,4,16,16,
- 16,16,16,16,16,16,12,16,16,16,12,12,12,12,16,4, 73,37,255,255,255,255,137,100,4,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 4,8,37,218,182,110,0,0,12,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,8,12,12,8,12,12,8,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char runleft_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,0,233,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,255,255,0,233, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,255,255,255,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,255,255,255,0,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0,255,255,255,0,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,255,255,255,255,0,16, 233,0,0,0,0,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,255,255,255,255,0,0, 0,233,255,255,0,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,0,0,0,0,0,255,255,0, 0,233,255,255,255,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,0,233,0,233,0,0,0,255,255, 0,0,255,0,0,0,0,16,16,16,16,
- 16,16,16,16,16,16,0,0,0,233,0,0,0,0,0,0, 255,0,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,233,233,0,233,0,233,0,0,255, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,233,233,233,0,233,0,0,0,255, 255,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0,0,233,233,0,233,0,0,233,0,255, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,255,0,255,233,233,0,233,0,0,0,255, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0,255,0,0,0,0,0,0,0,255,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,0,0,0,16,16,0,0,0,255,255,0,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,255,255,255,255,0,0,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,255,255,255,255,0,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,255,255,255,0,0,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,255,255,255,0,0,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,233,0,255,255,255,0,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,255,233,0,255,0,0,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char runleft2_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,255,233,0,255,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,233,0,255,255,255,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,255,255,255,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,255,255,255,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,255,255,255,255,0,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,255,255,255,255,0,0,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,0,0,0,16,16,0,0,0,255,255,0,0,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0,255,0,0,0,0,0,0,0,255,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,255,0,255,233,233,0,233,0,0,0,255,0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0,0,233,233,0,233,0,0,233,0,255,0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,233,233,233,0,233,0,0,0,255,255,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,233,233,0,233,0,233,0,0,255,0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,0,0,233,0,0,0,0,0,0,255,0,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,233,0,233,0,0,0,255,255,0,0,255,0,0,0,0,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0,0,0,0,255,255,0,0,233,255,255,255,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,255,255,255,255,0,0,0,233,255,255,0,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,255,255,255,255,0,16,233,0,0,0,0,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0,255,255,255,0,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,255,255,255,0,0,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,255,255,255,0,0,0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,255,255,0,233,0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,0,233,0,0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
- };
-
-static char runlu_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,12, 0,77,4,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,8, 169,246,100,4,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,12,16,16,16,16,16,8, 68,68,68,37,8,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,0,0,4,16,16,16,8, 0,219,255,219,8,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,0,36,36,4,16,12,0, 219,255,255,219,0,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,4,73,218,219,45,16,4,219, 255,255,255,110,4,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,4,0,182,36,8,41,255, 255,255,110,0,8,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,12,0,165,242,233,32,0,73, 255,255,146,0,12,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,165,233,233,133,132,0,0, 182,218,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,165,233,233,132,133,201,32, 146,219,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,68,32,132,132,32,100,32,0, 0,146,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,100,100,133,132,100,100,64,165, 36,146,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,64,165,0,100,132,0,64, 110,219,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,4,110,73,0,0,0,0,0,110, 255,37,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,4,73,255,255,73,37,0,36,73,255, 255,37,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,8,37,255,255,255,255,219,219,73,110, 37,4,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,8,37,255,255,255,255,109,146,110,73,110, 4,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,218,255,255,255,73,4,0,0,68,73, 36,12,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,182,255,255,73,8,48,137,133,238,255, 77,12,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,8,110,255,73,0,4,16,72,101,255,255, 146,4,12,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,0,137,100,32,8,16,16,4,109,182, 218,36,4,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,0,100,100,32,8,16,16,16,4,0, 0,0,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,12,4,4,8,16,16,16,16,16,4, 0,0,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 4,0,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,12,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char runlu2_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,8,12,12,8,12,12,8,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 4,8,37,218,182,110,0,0,12,16,16,
- 16,16,16,16,16,16,12,16,16,16,12,12,12,12,16,4, 73,37,255,255,255,255,137,100,4,16,16,
- 16,16,16,16,16,8,0,4,16,12,0,0,68,100,0,110,255,255,255,255,255,73,100,100,4,16,16,
- 16,16,16,16,12,0,0,73,4,0,165,165,32,100,64,73,255,255,255,255,73,0,32,32,8,16,16,
- 16,16,16,16,16,0,36,218,0,165,233,233,132,133,165,0, 73,255,255,73,8,4,8,8,16,16,16,
- 16,16,16,16,16,4,36,219,182,242,233,233,132,132,0,0, 37,255,109,4,48,16,16,16,16,16,16,
- 16,16,16,16,16,16,4,45,36,233,133,132,32,100,100,0, 0,219,146,0,137,72,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,32,132,133,100,100,132,0, 36,219,110,0,133,101,4,16,16,16,16,
- 16,16,16,16,16,16,12,4,41,0,0,201,32,64,0,0, 73,73,73,68,238,255,109,4,16,16,16,
- 16,16,12,8,8,8,0,219,255,73,0,32,0,165,64,110, 255,110,110,73,255,255,182,0,4,16,16,
- 16,16,0,169,68,0,219,255,255,255,182,146,0,36,110,255, 255,37,4,36,77,146,218,0,0,4,16,
- 16,16,77,246,68,219,255,255,255,255,218,219,146,146,219,37, 37,4,16,12,12,4,36,0,0,0,12,
- 16,16,4,100,68,255,255,255,110,146,0,0,0,0,0,8, 8,16,16,16,16,12,4,0,0,8,16,
- 16,16,16,4,37,219,219,110,0,0,12,12,16,12,12,16, 16,16,16,16,16,16,16,16,12,16,16,
- 16,16,16,16,8,8,0,4,8,12,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,12,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-
-/*static char calcdes_data[] = {
- 16 ,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16,16,16, 0, 0, 0, 0,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16,16, 0, 0,255, 0,233, 0,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16, 0,255,255,255,255, 0,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16, 0,255,255,255, 0,16,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16, 0, 0,255,255,255,255, 0,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16, 0,255,255,255,255,255,255, 0,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16, 0,255,255, 0, 0, 0, 0, 0, 0,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16, 0,255, 0, 0, 0, 0,233,233,233, 0, 0,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16, 0,255, 0, 0,233, 0,233, 0,233,233,255, 0,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16, 0,255,255, 0, 0, 0,233, 0,233, 0,233,233, 0,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16, 0,255,255, 0, 0, 0, 0,233, 0,233, 0,233, 0,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16, 0,255,255, 0, 0, 0, 0, 0,233, 0,233, 0, 0,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16, 0,255, 0, 0, 0,233, 0, 0,233, 0, 0,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16, 0, 0,255,255, 0, 0, 0, 0, 0, 0,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16, 0,255,255,255,255,255,255,255, 0,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16, 0,255,255,255,255,255,255, 0,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16, 0, 0,255,255,255,255, 0,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16, 0,255,255,255, 0,16,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16, 0,255,255,255,255, 0,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16,16, 0, 0,255, 0,233, 0,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16,16,16, 0, 0, 0, 0,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16 ,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16 ,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
- };
-
-static char calcdown_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,255,255,255, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,255,255,255,255, 255,255,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0,255,255,0,0,0,0, 0,0,255,0,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,0,0,255,255,255,0,0,0,0, 0,0,255,255,0,0,0,16,16,16,16,
- 16,16,16,16,16,0,255,255,255,255,255,0,0,0,0,0, 233,0,0,255,255,255,255,0,16,16,16,
- 16,16,16,16,0,0,255,255,255,255,255,0,233,0,0,233, 0,0,0,255,255,255,255,0,0,16,16,
- 16,16,16,16,0,255,255,255,255,255,255,0,0,0,233,0, 233,233,0,255,255,255,255,255,0,16,16,
- 16,16,16,16,0,0,255,0,255,255,255,0,0,233,0,233, 0,233,0,255,255,0,255,0,0,16,16,
- 16,16,16,16,0,233,0,16,0,255,255,0,233,0,233,0, 233,233,0,255,0,16,0,233,0,16,16,
- 16,16,16,16,16,0,16,16,16,0,0,0,0,233,0,233, 233,0,0,0,16,16,16,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,0,233,233, 255,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-
-static char calcleft_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,233,0,255,0,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,255,255,255,255, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,255,255,255, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,255,255,255,255, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,255,255,255,255,255, 255,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,0,0,0,0, 255,255,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0,233,233,233,0,0, 0,0,255,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,255,233,233,0,233,0,233, 0,0,255,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,233,233,0,233,0,233,0, 0,0,255,255,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,233,0,233,0,233,0,0, 0,0,255,255,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0,233,0,233,0,0,0, 0,0,255,255,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0,233,0,0,233,0, 0,0,255,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,0,0,0,0, 255,255,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,255,255,255,255,255, 255,255,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,255,255,255,255,255, 255,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,255,255,255,255, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,255,255,255, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,255,255,255,255, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,233,0,255,0,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char calcup_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,0,233,233, 255,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,0,16,16,16,0,0,0,0,233,0,233, 233,0,0,0,16,16,16,0,16,16,16,
- 16,16,16,16,0,233,0,16,0,255,255,0,233,0,233,0, 233,233,0,255,0,16,0,233,0,16,16,
- 16,16,16,16,0,0,255,0,255,255,255,0,0,233,0,233, 0,233,0,255,255,0,255,0,0,16,16,
- 16,16,16,16,0,255,255,255,255,255,255,0,0,0,233,0, 233,233,0,255,255,255,255,255,0,16,16,
- 16,16,16,16,0,0,255,255,255,255,255,0,233,0,0,233, 0,0,0,255,255,255,255,0,0,16,16,
- 16,16,16,16,16,0,255,255,255,255,255,0,0,0,0,0, 233,0,0,255,255,255,255,0,16,16,16,
- 16,16,16,16,16,16,0,0,0,255,255,255,0,0,0,0, 0,0,255,255,0,0,0,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0,255,255,0,0,0,0, 0,0,255,0,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,255,255,255,255, 255,255,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,255,255,255, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- }; */
-static char portsx_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,220,220,220, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,220,220,220,220, 220,220,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0,220,220,0,0,0,0, 0,0,220,0,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,0,0,220,220,220,0,0,0,0, 0,0,220,220,0,0,0,16,16,16,16,
- 16,16,16,16,16,0,220,220,220,220,220,0,0,0,0,0, 233,0,0,220,220,220,220,0,16,16,16,
- 16,16,16,16,0,0,220,220,220,220,220,0,233,0,0,233, 0,0,0,220,220,220,220,0,0,16,16,
- 16,16,16,16,0,220,220,220,220,220,220,0,0,0,233,0, 233,233,0,220,220,220,220,220,0,16,16,
- 16,16,16,16,0,0,220,0,220,220,220,0,0,233,0,233, 0,233,0,220,220,0,220,0,0,16,16,
- 16,16,16,16,0,233,0,16,0,220,220,0,233,0,233,0, 233,233,0,220,0,16,0,233,0,16,16,
- 16,16,16,16,16,0,16,16,16,0,0,0,0,233,0,233, 233,0,0,0,16,16,16,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,0,233,233, 220,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char portdx_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,0,233,233, 130,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,0,16,16,16,0,0,0,0,233,0,233, 233,0,0,0,16,16,16,0,16,16,16,
- 16,16,16,16,0,233,0,16,0,130,130,0,233,0,233,0, 233,233,0,130,0,16,0,233,0,16,16,
- 16,16,16,16,0,0,130,0,130,130,130,0,0,233,0,233, 0,233,0,130,130,0,130,0,0,16,16,
- 16,16,16,16,0,130,130,130,130,130,130,0,0,0,233,0, 233,233,0,130,130,130,130,130,0,16,16,
- 16,16,16,16,0,0,130,130,130,130,130,0,233,0,0,233, 0,0,0,130,130,130,130,0,0,16,16,
- 16,16,16,16,16,0,130,130,130,130,130,0,0,0,0,0, 233,0,0,130,130,130,130,0,16,16,16,
- 16,16,16,16,16,16,0,0,0,130,130,130,0,0,0,0, 0,0,130,130,0,0,0,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0,130,130,0,0,0,0, 0,0,130,0,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,130,130,130,130, 130,130,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,130,130,130, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-
-
Index: rel_1_21/soccer/stadio.h
===================================================================
--- rel_1_21/soccer/stadio.h (revision 1217)
+++ rel_1_21/soccer/stadio.h (nonexistent)
@@ -1,8435 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: stadio.h,v 1.1.1.1 2002-09-02 09:37:44 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:44 $
- ------------
-*/
-
-/*
- * Copyright (C) 2000 Merli Andrea and Zucchetti Alessandro
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-static unsigned int faro_width = 100;
-static unsigned int faro_height = 100;
-static unsigned int scale_width = 150;
-static unsigned int scale_height = 100;
-static unsigned int schermo_width = 300;
-static unsigned int schermo_height = 100;
-
-
-static char stadio_cmap[256][3] = {
- { 0, 0, 0},
- { 0, 0, 51},
- { 0, 0,102},
- { 0, 0,153},
- { 0, 0,204},
- { 0, 0,255},
- { 51, 0, 0},
- { 51, 0, 51},
- { 51, 0,102},
- { 51, 0,153},
- { 51, 0,204},
- { 51, 0,255},
- {102, 0, 0},
- {102, 0, 51},
- {102, 0,102},
- {102, 0,153},
- {102, 0,204},
- {102, 0,255},
- {153, 0, 0},
- {153, 0, 51},
- {153, 0,102},
- {153, 0,153},
- {153, 0,204},
- {153, 0,255},
- {204, 0, 0},
- {204, 0, 51},
- {204, 0,102},
- {204, 0,153},
- {204, 0,204},
- {204, 0,255},
- {255, 0, 0},
- {255, 0, 51},
- {255, 0,102},
- {255, 0,153},
- {255, 0,204},
- {255, 0,255},
- { 0, 51, 0},
- { 0, 51, 51},
- { 0, 51,102},
- { 0, 51,153},
- { 0, 51,204},
- { 0, 51,255},
- { 51, 51, 0},
- { 51, 51, 51},
- { 51, 51,102},
- { 51, 51,153},
- { 51, 51,204},
- { 51, 51,255},
- {102, 51, 0},
- {102, 51, 51},
- {102, 51,102},
- {102, 51,153},
- {102, 51,204},
- {102, 51,255},
- {153, 51, 0},
- {153, 51, 51},
- {153, 51,102},
- {153, 51,153},
- {153, 51,204},
- {153, 51,255},
- {204, 51, 0},
- {204, 51, 51},
- {204, 51,102},
- {204, 51,153},
- {204, 51,204},
- {204, 51,255},
- {255, 51, 0},
- {255, 51, 51},
- {255, 51,102},
- {255, 51,153},
- {255, 51,204},
- {255, 51,255},
- { 0,102, 0},
- { 0,102, 51},
- { 0,102,102},
- { 0,102,153},
- { 0,102,204},
- { 0,102,255},
- { 51,102, 0},
- { 51,102, 51},
- { 51,102,102},
- { 51,102,153},
- { 51,102,204},
- { 51,102,255},
- {102,102, 0},
- {102,102, 51},
- {102,102,102},
- {102,102,153},
- {102,102,204},
- {102,102,255},
- {153,102, 0},
- {153,102, 51},
- {153,102,102},
- {153,102,153},
- {153,102,204},
- {153,102,255},
- {204,102, 0},
- {204,102, 51},
- {204,102,102},
- {204,102,153},
- {204,102,204},
- {204,102,255},
- {255,102, 0},
- {255,102, 51},
- {255,102,102},
- {255,102,153},
- {255,102,204},
- {255,102,255},
- { 0,153, 0},
- { 0,153, 51},
- { 0,153,102},
- { 0,153,153},
- { 0,153,204},
- { 0,153,255},
- { 51,153, 0},
- { 51,153, 51},
- { 51,153,102},
- { 51,153,153},
- { 51,153,204},
- { 51,153,255},
- {102,153, 0},
- {102,153, 51},
- {102,153,102},
- {102,153,153},
- {102,153,204},
- {102,153,255},
- {153,153, 0},
- {153,153, 51},
- {153,153,102},
- {153,153,153},
- {153,153,204},
- {153,153,255},
- {204,153, 0},
- {204,153, 51},
- {204,153,102},
- {204,153,153},
- {204,153,204},
- {204,153,255},
- {255,153, 0},
- {255,153, 51},
- {255,153,102},
- {255,153,153},
- {255,153,204},
- {255,153,255},
- { 0,204, 0},
- { 0,204, 51},
- { 0,204,102},
- { 0,204,153},
- { 0,204,204},
- { 0,204,255},
- { 51,204, 0},
- { 51,204, 51},
- { 51,204,102},
- { 51,204,153},
- { 51,204,204},
- { 51,204,255},
- {102,204, 0},
- {102,204, 51},
- {102,204,102},
- {102,204,153},
- {102,204,204},
- {102,204,255},
- {153,204, 0},
- {153,204, 51},
- {153,204,102},
- {153,204,153},
- {153,204,204},
- {153,204,255},
- {204,204, 0},
- {204,204, 51},
- {204,204,102},
- {204,204,153},
- {204,204,204},
- {204,204,255},
- {255,204, 0},
- {255,204, 51},
- {255,204,102},
- {255,204,153},
- {255,204,204},
- {255,204,255},
- { 0,255, 0},
- { 0,255, 51},
- { 0,255,102},
- { 0,255,153},
- { 0,255,204},
- { 0,255,255},
- { 51,255, 0},
- { 51,255, 51},
- { 51,255,102},
- { 51,255,153},
- { 51,255,204},
- { 51,255,255},
- {102,255, 0},
- {102,255, 51},
- {102,255,102},
- {102,255,153},
- {102,255,204},
- {102,255,255},
- {153,255, 0},
- {153,255, 51},
- {153,255,102},
- {153,255,153},
- {153,255,204},
- {153,255,255},
- {204,255, 0},
- {204,255, 51},
- {204,255,102},
- {204,255,153},
- {204,255,204},
- {204,255,255},
- {255,255, 0},
- {255,255, 51},
- {255,255,102},
- {255,255,153},
- {255,255,204},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255},
- {255,255,255}
- };
-static char farod_data[] = {
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,0,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,0,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,0,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,0,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,0,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,173,173,173,173,0,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,0,0,173,173,173,173,0,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,0,0,173,173,173,173,0,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,102,102,0,0,173,173,173,173,0,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,0,102,102,0,0,173,173,173,173,
- 0,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,176,176,176,176,176,176,176,176,176,11,11,11,11,176,
- 176,176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,
- 176,176,176,176,176,11,11,11,0,102,102,0,0,173,173,173,
- 173,0,90,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,102,102,102,0,0,90,90,
- 173,90,0,90,108,108,0,0,0,0,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,0,102,102,102,0,0,90,
- 90,0,90,90,90,0,0,0,0,0,0,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,0,102,102,102,0,0,
- 90,90,0,90,0,0,0,90,90,0,0,0,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,0,102,102,102,0,
- 0,90,90,0,0,0,90,90,90,90,0,0,0,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,0,102,102,102,
- 0,0,90,0,0,90,90,90,90,90,90,0,0,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,0,102,102,
- 102,0,0,0,0,90,90,90,90,90,90,0,0,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,0,102,
- 102,102,0,0,0,90,90,90,90,90,90,0,0,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,6,6,6,6,6,6,6,0,
- 102,102,90,0,0,0,90,90,90,90,0,0,0,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,197,210,210,210,210,210,210,210,
- 0,102,102,0,0,0,0,0,0,0,0,0,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,11,197,210,210,210,210,210,210,
- 210,0,102,102,0,0,0,0,0,0,0,90,90,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,197,215,210,210,210,210,
- 210,210,0,102,102,0,0,0,0,0,0,90,90,90,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,11,11,11,11,197,215,210,210,210,
- 210,210,210,0,102,102,0,0,0,90,90,0,90,90,90,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,197,215,210,210,
- 210,210,210,210,0,102,102,0,0,0,90,90,0,90,90,90,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,176,176,176,176,176,176,176,176,176,11,11,11,11,176,
- 176,176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,
- 176,176,176,176,176,11,11,11,11,11,11,11,11,197,215,210,
- 210,210,210,210,6,0,102,102,0,0,0,90,90,0,90,90,
- 90,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,11,11,11,11,11,11,197,215,
- 210,210,210,210,6,11,0,102,102,0,0,0,90,90,0,90,
- 90,90,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,197,
- 215,210,210,210,6,11,11,0,102,102,0,0,0,90,90,0,
- 90,90,90,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 197,210,210,210,6,11,11,11,0,102,102,0,0,0,90,90,
- 0,90,90,90,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,197,210,210,6,11,11,11,11,0,102,102,0,0,0,90,
- 90,0,90,90,90,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,197,210,6,11,11,11,11,11,0,102,102,0,0,0,
- 90,90,0,90,90,90,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,197,6,11,11,11,11,11,11,0,102,102,0,0,
- 0,90,90,0,90,90,90,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,0,102,102,0,
- 0,0,90,90,0,90,90,90,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,0,102,102,
- 0,0,0,90,90,0,90,90,90,108,108,108,0,0,0,0,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,102,
- 102,0,0,0,90,90,0,90,90,90,108,0,0,0,0,0,
- 0,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,
- 102,102,0,0,0,90,90,0,90,90,0,0,0,90,90,0,
- 0,0,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 0,102,102,0,0,0,90,90,0,0,0,0,90,90,90,90,
- 0,0,0,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,0,102,102,0,0,0,90,0,0,0,90,90,90,90,90,
- 90,0,0,0,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,0,102,102,0,0,0,0,0,90,90,90,90,90,90,
- 90,90,0,0,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,176,176,176,176,176,176,176,176,176,11,11,11,11,176,
- 176,176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,
- 176,176,176,176,176,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,6,6,6,
- 6,6,6,0,102,102,0,0,0,0,90,90,90,90,90,90,
- 90,90,0,0,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,197,210,210,
- 210,210,210,210,0,102,102,0,0,0,90,90,90,90,90,90,
- 90,90,0,0,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,197,210,
- 210,210,210,210,210,0,102,102,0,0,0,90,90,90,90,90,
- 90,0,0,0,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,197,
- 210,210,210,210,210,210,0,102,102,0,0,0,90,90,90,90,
- 0,0,0,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 197,210,210,210,210,210,210,0,102,102,0,0,0,0,0,0,
- 0,0,0,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,197,210,210,210,210,210,210,0,102,102,0,0,0,0,0,
- 0,0,173,0,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,197,210,210,210,210,210,210,0,102,102,0,0,0,90,
- 90,173,173,173,0,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,197,210,210,210,210,210,210,0,102,102,0,0,0,
- 90,90,173,173,173,0,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,197,210,210,210,210,210,6,0,102,102,102,102,
- 0,90,173,173,173,0,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,197,210,210,210,210,6,11,0,102,102,102,
- 102,0,173,173,0,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,197,210,210,210,6,11,11,0,102,102,
- 102,102,0,0,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,197,210,210,6,11,11,11,0,102,
- 102,102,0,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,197,210,6,11,11,11,11,0,
- 102,0,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,197,6,11,11,11,11,11,
- 0,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,176,176,176,176,176,176,176,176,176,11,11,11,11,176,
- 176,176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,
- 176,176,176,176,176,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,0,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,0,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,0,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,0,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,0,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,0,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,0,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,0,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,0,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,0,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,0,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,0,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,176,176,176,176,176,176,176,176,176,11,11,11,11,176,
- 176,176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,
- 176,176,176,176,176,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,0,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 0,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,0,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,0,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,0,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,0,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,0,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,0,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,0,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,0,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,0,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,211,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,0,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,211,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,0,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,211,211,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,11,0,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,211,211,
- 211,211,211,211,211,211,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,0,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,104,104,211,211,
- 211,211,211,211,211,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,104,104,104,104,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,104,104,104,104,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,104,104,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108
- };
-static char faros_data[] = {
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,0,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,0,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,0,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,0,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,0,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,0,173,173,173,173,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,0,173,173,173,173,0,0,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,0,173,173,173,173,0,0,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,0,173,173,173,173,0,0,102,102,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,0,173,173,173,173,0,0,102,102,0,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,90,0,173,173,173,173,0,0,102,102,0,11,11,11,176,
- 176,176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,
- 176,176,176,176,176,11,11,11,11,176,176,176,176,176,176,176,
- 176,176,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,0,0,0,0,108,108,
- 90,0,90,173,90,90,0,0,102,102,102,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,0,0,0,0,0,0,90,
- 90,90,0,90,90,0,0,102,102,102,0,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,0,0,0,90,90,0,0,0,
- 90,0,90,90,0,0,102,102,102,0,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,0,0,0,90,90,90,90,0,0,
- 0,90,90,0,0,102,102,102,0,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,0,0,90,90,90,90,90,90,0,
- 0,90,0,0,102,102,102,0,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,0,0,90,90,90,90,90,90,0,
- 0,0,0,102,102,102,0,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,0,0,90,90,90,90,90,90,0,
- 0,0,102,102,102,0,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,0,0,0,90,90,90,90,0,0,
- 0,90,102,102,0,6,6,6,6,6,6,6,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,0,0,0,0,0,0,0,0,
- 0,102,102,0,210,210,210,210,210,210,210,197,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,90,90,0,0,0,0,0,0,0,
- 102,102,0,210,210,210,210,210,210,210,197,11,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,90,90,90,0,0,0,0,0,0,102,
- 102,0,210,210,210,210,210,210,215,197,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,90,90,90,0,90,90,0,0,0,102,102,
- 0,210,210,210,210,210,210,215,197,11,11,11,11,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,90,90,90,0,90,90,0,0,0,102,102,0,
- 210,210,210,210,210,210,215,197,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,90,90,90,0,90,90,0,0,0,102,102,0,6,
- 210,210,210,210,210,215,197,11,11,11,11,11,11,11,11,176,
- 176,176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,
- 176,176,176,176,176,11,11,11,11,176,176,176,176,176,176,176,
- 176,176,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,90,90,90,0,90,90,0,0,0,102,102,0,11,6,
- 210,210,210,210,215,197,11,11,11,11,11,11,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,90,90,90,0,90,90,0,0,0,102,102,0,11,11,6,
- 210,210,210,215,197,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 90,90,90,0,90,90,0,0,0,102,102,0,11,11,11,6,
- 210,210,210,197,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,90,
- 90,90,0,90,90,0,0,0,102,102,0,11,11,11,11,6,
- 210,210,197,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,90,90,
- 90,0,90,90,0,0,0,102,102,0,11,11,11,11,11,6,
- 210,197,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,90,90,90,
- 0,90,90,0,0,0,102,102,0,11,11,11,11,11,11,6,
- 197,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,90,90,90,0,
- 90,90,0,0,0,102,102,0,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,0,0,0,0,108,108,108,90,90,90,0,90,
- 90,0,0,0,102,102,0,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,0,0,0,0,0,0,108,90,90,90,0,90,90,
- 0,0,0,102,102,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,0,0,0,90,90,0,0,0,90,90,0,90,90,0,
- 0,0,102,102,0,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,0,0,0,90,90,90,90,0,0,0,0,90,90,0,0,
- 0,102,102,0,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 0,0,0,90,90,90,90,90,90,0,0,0,90,0,0,0,
- 102,102,0,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 0,0,90,90,90,90,90,90,90,90,0,0,0,0,0,102,
- 102,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 0,0,90,90,90,90,90,90,90,90,0,0,0,0,102,102,
- 0,6,6,6,6,6,6,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,176,
- 176,176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,
- 176,176,176,176,176,11,11,11,11,176,176,176,176,176,176,176,
- 176,176,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 0,0,90,90,90,90,90,90,90,90,0,0,0,102,102,0,
- 210,210,210,210,210,210,197,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 0,0,0,90,90,90,90,90,90,0,0,0,102,102,0,210,
- 210,210,210,210,210,197,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,0,0,0,90,90,90,90,0,0,0,102,102,0,210,210,
- 210,210,210,210,197,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,0,0,0,0,0,0,0,0,0,102,102,0,210,210,210,
- 210,210,210,197,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 0,173,0,0,0,0,0,0,0,102,102,0,210,210,210,210,
- 210,210,197,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,0,
- 173,173,173,90,90,0,0,0,102,102,0,210,210,210,210,210,
- 210,197,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,0,173,
- 173,173,90,90,0,0,0,102,102,0,210,210,210,210,210,210,
- 197,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,0,173,
- 173,173,90,0,102,102,102,102,0,6,210,210,210,210,210,197,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,0,
- 173,173,0,102,102,102,102,0,11,6,210,210,210,210,197,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 0,0,102,102,102,102,0,11,11,6,210,210,210,197,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,0,102,102,102,0,11,11,11,6,210,210,197,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,0,102,0,11,11,11,11,6,210,197,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,0,11,11,11,11,11,6,197,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,0,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,176,
- 176,176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,
- 176,176,176,176,176,11,11,11,11,176,176,176,176,176,176,176,
- 176,176,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,0,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,0,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,0,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,0,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,0,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,0,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,0,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,0,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,0,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,176,
- 176,176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,
- 176,176,176,176,176,11,11,11,11,176,176,176,176,176,176,176,
- 176,176,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,0,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,0,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,0,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,0,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,0,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,0,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,0,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,0,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,0,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,0,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,0,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,211,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,211,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,211,211,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,211,211,211,211,211,211,211,211,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,104,
- 104,211,211,211,211,211,211,211,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,0,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,104,104,
- 104,104,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,104,104,
- 104,104,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,104,
- 104,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108
-};
-static char scale_data[] = {
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,11,11,11,176,
- 176,176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,
- 176,176,176,176,176,11,11,11,11,176,176,176,176,176,176,176,
- 176,176,11,11,11,11,176,176,176,176,176,176,176,176,176,11,
- 11,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
- 38,38,38,38,38,11,11,176,176,176,176,176,176,176,176,176,
- 11,11,11,11,176,176,176,176,176,176,176,176,176,11,11,11,
- 11,176,176,176,176,176,176,176,176,176,11,11,11,11,176,176,
- 176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,176,
- 176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,0,0,0,0,0,0,0,0,0,
- 0,11,11,0,0,0,0,0,0,0,0,0,0,0,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,0,
- 0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,0,
- 0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
- 38,38,38,38,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,0,0,0,0,0,0,0,0,0,
- 0,11,11,0,0,0,0,0,0,0,0,0,0,0,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,0,
- 0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,0,
- 0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
- 38,38,38,38,38,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,11,11,11,176,
- 176,176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,
- 176,176,176,176,176,11,11,11,11,176,176,176,176,176,176,176,
- 176,176,11,11,11,11,176,176,176,176,176,176,176,176,176,11,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,11,176,176,176,176,176,176,176,176,176,
- 11,11,11,11,176,176,176,176,176,176,176,176,176,11,11,11,
- 11,176,176,176,176,176,176,176,176,176,11,11,11,11,176,176,
- 176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,176,
- 176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,0,0,0,0,0,0,0,0,0,
- 0,11,11,0,0,0,0,0,0,0,0,0,0,0,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,0,
- 0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,0,
- 0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
- 38,38,38,38,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
- 38,38,38,38,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,0,0,0,0,0,0,0,0,0,
- 0,11,11,0,0,0,0,0,0,0,0,0,0,0,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,0,
- 0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,0,
- 0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,11,11,11,176,
- 176,176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,
- 176,176,176,176,176,11,11,11,11,176,176,176,176,176,176,176,
- 176,176,11,11,11,11,176,176,176,176,176,176,176,176,176,11,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,11,176,176,176,176,176,176,176,176,176,
- 11,11,11,11,176,176,176,176,176,176,176,176,176,11,11,11,
- 11,176,176,176,176,176,176,176,176,176,11,11,11,11,176,176,
- 176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,176,
- 176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,
- 11,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
- 38,38,38,38,38,11,0,0,0,0,0,0,0,0,0,0,
- 0,11,11,0,0,0,0,0,0,0,0,0,0,0,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,0,
- 0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,0,
- 0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
- 38,38,38,38,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,0,0,0,0,0,0,0,0,0,
- 0,11,11,0,0,0,0,0,0,0,0,0,0,0,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,0,
- 0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,0,
- 0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
- 38,38,38,38,38,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,11,11,11,176,
- 176,176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,
- 176,176,176,176,176,11,11,11,11,176,176,176,176,176,176,176,
- 176,176,11,11,11,11,176,176,176,176,176,176,176,176,176,11,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,11,176,176,176,176,176,176,176,176,176,
- 11,11,11,11,176,176,176,176,176,176,176,176,176,11,11,11,
- 11,176,176,176,176,176,176,176,176,176,11,11,11,11,176,176,
- 176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,176,
- 176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,0,0,0,0,0,0,0,0,0,
- 0,11,11,0,0,0,0,0,0,0,0,0,0,0,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,0,
- 0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,0,
- 0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
- 38,38,38,38,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,0,0,0,0,0,0,0,0,0,
- 0,11,11,0,0,0,0,0,0,0,0,0,0,0,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,0,
- 0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,0,
- 0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
- 38,38,38,38,38,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,11,11,11,176,
- 176,176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,
- 176,176,176,176,176,11,11,11,11,176,176,176,176,176,176,176,
- 176,176,11,11,11,11,176,176,176,176,176,176,176,176,176,11,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,11,176,176,176,176,176,176,176,176,176,
- 11,11,11,11,176,176,176,176,176,176,176,176,176,11,11,11,
- 11,176,176,176,176,176,176,176,176,176,11,11,11,11,176,176,
- 176,176,176,176,176,176,176,11,11,11,11,176,176,176,176,176,
- 176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,0,0,0,0,0,0,0,0,0,
- 0,11,11,0,0,0,0,0,0,0,0,0,0,0,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,0,
- 0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,0,
- 0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
- 38,38,38,38,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,
- 176,176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,
- 176,176,176,176,176,0,11,11,0,176,176,176,176,176,176,176,
- 176,176,0,11,11,0,176,176,176,176,176,176,176,176,176,0,
- 11,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
- 38,38,38,38,38,11,0,176,176,176,176,176,176,176,176,176,
- 0,11,11,0,176,176,176,176,176,176,176,176,176,0,11,11,
- 0,176,176,176,176,176,176,176,176,176,0,11,11,0,176,176,
- 176,176,176,176,176,176,176,0,11,11,0,176,176,176,176,176,
- 176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,
- 0,0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,
- 0,0,0,0,0,0,11,11,0,0,0,0,0,0,0,0,
- 0,0,0,11,11,0,0,0,0,0,0,0,0,0,0,0,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,0,0,0,0,0,0,0,0,0,0,
- 0,11,11,0,0,0,0,0,0,0,0,0,0,0,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,11,11,0,0,0,
- 0,0,0,0,0,0,0,0,11,11,0,0,0,0,0,0,
- 0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,38,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,38,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
- 38,38,38,38,38,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108
-};
-static char schermo_data[] = {
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,
- 0,0,0,0,0,0,0,0,0,0,0,0,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,176,176,176,176,176,176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,176,176,176,176,176,176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,176,176,176,176,176,176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,176,176,176,176,176,176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,176,176,176,176,176,176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,38,
- 38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
- 38,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,38,38,38,38,38,38,38,38,
- 38,38,38,38,38,38,38,38,38,38,38,38,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108
-};
-/*
-static char goal2_data[] = {
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,
- 0,0,0,0,0,0,0,0,0,0,0,0,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,176,176,176,176,176,176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,0,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,0,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,0,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,215,215,215,215,0,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,215,181,181,181,
- 181,215,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,215,181,181,
- 181,181,215,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,215,181,181,181,181,
- 181,181,181,181,181,181,181,181,215,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,215,181,181,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,215,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,215,181,181,
- 181,181,181,215,181,181,181,181,181,181,181,181,215,215,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,215,181,181,181,
- 181,181,181,181,181,181,181,181,215,181,181,181,181,181,181,181,
- 181,181,181,181,181,215,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,215,181,181,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,215,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 11,176,176,176,176,176,176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,215,181,
- 181,181,181,181,215,215,181,181,181,181,181,181,181,181,215,215,
- 181,181,181,181,181,181,181,181,181,181,181,181,215,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,215,181,181,181,
- 181,181,181,181,181,181,181,181,215,181,181,181,181,181,181,181,
- 181,181,181,181,181,215,181,181,181,181,215,215,215,181,181,181,
- 181,181,181,181,181,181,181,181,181,215,181,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,215,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,215,181,
- 181,181,181,181,215,181,215,181,181,181,181,181,181,181,181,181,
- 215,215,181,181,181,181,181,181,181,181,181,181,215,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,215,181,181,
- 181,181,181,181,181,181,181,181,181,215,181,181,181,181,181,181,
- 181,181,181,181,181,181,215,215,215,215,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,215,181,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,215,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,215,
- 181,181,181,181,215,181,181,215,181,181,181,181,181,181,181,181,
- 181,181,215,215,215,181,215,215,215,215,181,181,215,0,0,0,
- 0,0,0,181,181,181,181,181,181,181,181,181,181,215,181,181,
- 181,181,181,181,181,181,181,181,181,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,215,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,215,
- 181,181,181,181,181,215,181,181,215,181,181,181,181,181,181,181,
- 181,181,181,181,181,215,215,181,181,181,215,0,0,215,215,215,
- 215,215,215,0,0,181,181,181,181,181,181,181,181,181,215,181,
- 181,181,181,181,181,181,181,181,181,215,181,181,215,215,215,215,
- 215,181,181,181,181,181,215,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,215,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,215,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 215,181,181,181,181,215,181,181,181,215,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,215,215,0,0,215,215,215,0,215,
- 215,215,215,215,215,0,0,181,181,181,181,181,181,181,215,181,
- 181,181,181,181,181,181,181,181,215,215,215,215,181,181,181,181,
- 181,181,181,181,181,181,215,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,215,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,215,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 215,181,181,181,181,181,215,181,181,181,215,215,181,181,181,181,
- 181,181,181,181,181,181,181,181,0,215,0,215,215,0,0,0,
- 215,215,0,215,215,215,215,0,215,215,215,215,215,215,181,215,
- 181,181,181,215,215,215,215,215,181,215,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,215,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,215,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,215,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 181,215,181,181,181,181,215,181,181,181,181,181,215,181,181,181,
- 181,181,181,181,181,181,181,181,0,0,0,0,215,0,0,0,
- 215,0,0,0,215,215,215,0,181,181,181,181,181,181,215,215,
- 215,215,215,215,215,181,181,181,181,181,215,181,181,181,181,181,
- 181,181,181,181,181,181,181,215,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,215,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,215,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 181,181,215,181,181,181,181,215,181,181,181,181,181,215,181,181,
- 181,181,181,181,181,181,181,0,215,0,0,0,215,0,0,0,
- 215,0,0,0,215,215,0,215,0,181,215,215,215,215,181,181,
- 215,181,181,181,181,215,215,215,215,215,215,181,181,181,181,181,
- 181,181,181,181,181,181,181,215,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,215,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,215,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 181,181,215,181,181,181,181,215,181,181,181,181,181,181,215,181,
- 181,181,181,181,181,181,181,0,215,0,0,0,215,215,0,215,
- 215,0,0,0,215,0,0,0,0,215,181,181,181,181,181,181,
- 215,181,181,181,181,181,181,181,181,181,215,215,215,215,215,215,
- 215,215,181,181,181,181,181,215,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,215,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,181,215,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 181,181,181,215,181,181,181,181,215,181,181,181,181,181,181,215,
- 181,181,181,181,181,181,0,215,215,215,0,215,215,215,215,215,
- 215,215,0,215,215,0,0,0,215,0,181,181,181,181,181,181,
- 181,215,181,181,181,181,181,181,181,181,215,181,181,181,181,181,
- 181,181,215,215,215,215,215,215,215,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,215,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,181,215,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 181,181,181,215,181,181,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,0,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,0,0,0,215,0,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,0,215,215,215,215,0,181,181,181,181,181,181,215,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 181,181,181,181,215,181,181,181,181,215,181,181,181,181,181,181,
- 181,181,215,181,181,181,0,215,215,0,215,215,215,215,215,215,
- 215,215,215,215,215,215,0,215,215,0,181,181,181,181,181,181,
- 181,181,215,181,181,181,181,181,181,181,181,215,181,181,181,181,
- 181,181,181,181,181,181,181,181,215,181,181,181,181,181,181,215,
- 215,215,215,181,181,181,181,181,181,181,181,181,181,215,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,181,181,215,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 181,181,181,181,215,181,181,181,181,215,181,181,181,181,181,181,
- 181,181,181,215,215,215,0,215,0,0,0,215,215,215,215,215,
- 0,215,215,215,215,215,215,215,215,0,215,181,181,181,181,181,
- 181,181,215,181,181,181,181,181,181,181,181,215,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,215,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,215,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,181,181,181,
- 215,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 181,181,181,181,181,215,181,181,181,181,215,181,181,181,181,181,
- 215,215,215,181,215,181,0,215,0,0,0,215,215,215,215,0,
- 0,0,215,215,215,215,215,215,215,0,181,215,215,215,181,181,
- 181,181,181,215,181,181,181,181,181,181,181,215,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,215,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,215,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,181,181,181,
- 215,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 11,176,176,176,176,176,176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 181,181,181,181,181,215,181,181,181,181,215,181,181,181,181,181,
- 181,181,181,181,181,181,0,215,0,0,0,215,215,215,215,0,
- 0,0,215,215,0,215,215,215,215,0,181,181,181,181,215,215,
- 181,181,181,215,181,181,181,181,181,181,181,215,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,215,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,215,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,181,181,181,
- 181,215,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 181,181,181,181,181,181,215,181,181,181,181,215,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,0,215,215,215,215,215,0,
- 0,0,215,0,0,0,215,215,0,181,181,181,181,181,181,181,
- 215,215,181,181,215,181,181,181,181,181,181,181,215,181,181,181,
- 181,181,181,181,181,181,181,181,181,215,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,215,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,181,181,181,
- 181,215,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 181,181,181,181,181,181,215,181,181,181,181,215,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,215,215,215,0,215,215,
- 0,215,215,0,0,0,215,215,0,181,181,181,181,181,181,181,
- 181,181,215,215,181,181,181,181,181,181,181,181,215,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,215,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,181,181,181,
- 181,181,215,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 181,181,181,181,181,181,181,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,0,215,215,215,0,0,0,215,
- 215,215,215,0,0,0,215,0,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,0,215,215,215,215,0,215,215,215,215,215,215,215,
- 215,215,215,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 181,181,181,181,181,181,181,215,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,0,215,215,215,0,0,0,215,
- 215,215,215,215,0,215,215,0,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,181,181,181,
- 181,215,181,215,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 181,181,181,181,181,215,215,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,0,0,215,0,0,0,215,
- 215,215,215,215,215,0,0,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,181,181,181,
- 181,215,181,215,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 181,181,181,181,215,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,0,0,0,215,215,
- 215,215,215,0,0,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,181,181,181,
- 215,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 181,181,181,215,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,0,0,0,
- 0,0,0,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,181,181,215,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 181,215,215,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,181,215,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,181,
- 215,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,181,215,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,181,181,215,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,181,215,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,181,215,215,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,181,215,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,181,215,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,215,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,215,215,0,215,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,0,215,215,215,215,0,181,181,215,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 11,176,176,176,176,176,176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,0,0,0,0,215,215,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,215,215,0,215,215,215,215,0,181,215,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,0,215,215,215,215,0,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
- 215,215,215,215,215,215,215,215,215,215,215,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,215,181,215,215,215,215,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,215,0,0,0,0,0,0,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,215,215,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,215,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,215,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,215,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,215,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,215,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,215,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,215,215,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,215,
- 215,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,215,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,215,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,215,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,215,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 215,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,215,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,215,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,215,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,215,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,215,215,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,215,215,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,215,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,215,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 11,176,176,176,176,176,176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,215,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,215,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,215,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
- 181,181,181,181,181,181,181,181,181,181,181,181,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,38,
- 38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
- 38,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,38,38,38,38,38,38,38,38,
- 38,38,38,38,38,38,38,38,38,38,38,38,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108
-};
-*/
-static char goal1_data[] = {
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,
- 102,102,102,102,102,102,102,102,102,102,102,102,
- 0,0,0,0,0,0,0,0,0,0,0,0,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,176,176,176,176,176,176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,176,176,176,176,176,176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,204,204,204,204,204,204,204,204,204,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,204,204,204,204,204,204,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,204,204,204,204,204,204,204,204,204,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,204,204,204,204,204,204,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,204,204,204,204,204,204,204,204,204,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,204,204,204,204,204,204,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,204,204,204,204,204,204,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,204,204,204,204,204,204,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,204,204,204,204,204,204,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,204,204,204,204,204,204,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,204,204,204,204,204,204,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,204,204,204,204,204,204,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,204,204,204,204,204,204,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,204,204,204,204,204,204,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,204,204,204,204,204,204,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,0,0,0,0,0,0,0,0,0,0,0,0,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,204,204,204,204,204,204,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,176,176,176,176,176,176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,0,0,0,0,0,0,0,0,0,0,0,0,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,204,204,204,204,204,204,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,0,0,0,0,0,0,0,0,0,0,0,0,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,204,204,204,204,204,204,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,204,204,204,204,204,204,204,204,
- 204,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,204,204,204,204,204,204,204,204,
- 204,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,204,204,204,204,204,204,204,204,
- 204,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,204,204,204,204,204,204,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,204,204,204,204,204,204,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,204,204,204,204,204,204,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,204,204,204,204,204,204,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,204,204,204,204,204,204,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,204,204,204,204,204,204,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,204,204,204,204,204,204,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,204,204,204,204,204,204,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,204,204,204,204,204,204,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,204,204,204,204,204,204,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,176,176,176,176,176,176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,204,204,204,204,204,204,204,204,204,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,204,204,204,204,204,204,204,204,
- 204,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,204,204,204,204,204,204,204,204,204,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,204,204,204,204,204,204,204,204,
- 204,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,204,204,204,204,204,204,204,204,204,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,204,204,204,204,204,204,204,204,
- 204,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,0,0,0,0,0,0,0,0,0,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,0,0,0,0,0,0,0,0,0,0,0,0,204,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,204,
- 204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,204,204,204,204,204,204,204,204,204,204,
- 204,204,204,204,204,204,204,204,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 204,204,204,204,204,204,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,204,204,204,204,204,204,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,176,176,176,176,176,176,176,176,176,11,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 11,176,176,176,176,176,176,176,176,176,11,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,176,176,176,176,176,176,176,176,176,0,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 0,176,176,176,176,176,176,176,176,176,0,11,
- 11,0,0,0,0,0,0,0,0,0,0,0,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 0,0,0,0,0,0,0,0,0,0,0,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 11,11,11,11,11,11,11,11,11,11,11,11,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,38,
- 38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
- 38,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,38,38,38,38,38,38,38,38,
- 38,38,38,38,38,38,38,38,38,38,38,38,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
- 108,108,108,108,108,108,108,108,108,108,108,108
- };
-
-
-
-
-
-
-
-
Index: rel_1_21/soccer/calc2.h
===================================================================
--- rel_1_21/soccer/calc2.h (revision 1217)
+++ rel_1_21/soccer/calc2.h (nonexistent)
@@ -1,693 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: calc2.h,v 1.1.1.1 2002-09-02 09:37:43 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:43 $
- ------------
-*/
-
-/*
- * Copyright (C) 2000 Merli Andrea and Zucchetti Alessandro
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/* GIMP header image file format (INDEXED): /mnt/disk/shark/base/images/runup//runup.h */
-static char B_runup_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16, 0, 0, 0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16, 0, 0, 0, 0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16, 0, 0, 35, 0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16, 0, 0,16,16,16,16, 0, 35, 0, 0, 0, 0, 0,16,16,16,16,16,16,16,16,16,16,16,
- 16,16, 0, 35,233, 0,16,16,16,16, 0, 35,233,233,233, 0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16, 0,233, 0, 0, 0, 0, 0,16, 0,233,233,233,233, 0,233, 0,16,16,16,16,16,16,16,16,16,
- 16,16, 0, 0, 35, 35, 35, 35, 35, 0, 0,233, 0,233, 0,233, 0, 0, 0, 0, 0,16,16,16,16,16,16,
- 16,16, 0, 35, 35, 35, 35, 35, 35, 0, 0, 0,233, 0,233, 0,233, 0, 35, 35, 0, 0, 0,16,16,16,16,
- 16,16,16, 0, 35, 35, 35, 35, 35, 0, 0,233, 0,233, 0, 0, 0, 0, 35, 35, 35, 35, 35, 0,16,16,16,
- 16,16,16, 0, 0, 0, 0, 35, 35, 35, 0, 0, 0, 0,233, 0, 0, 0, 35, 35, 35, 35, 35, 35, 0,16,16,
- 16,16,16,16,16, 0, 0, 0, 0, 35, 0, 0,233, 0, 0, 0, 0, 35, 35, 35, 35, 35, 35, 35, 0, 0,16,
- 16,16,16,16,16,16,16,16, 0, 0, 35, 0, 0, 0, 0, 0, 35, 35, 0, 0, 0, 0, 0, 0,233, 0,16,
- 16,16,16,16,16,16,16,16,16, 0, 0, 35, 35, 35, 35, 0, 35, 0, 0,16,16, 0, 0,233, 0, 0,16,
- 16,16,16,16,16,16,16,16,16,16, 0, 0, 0, 35, 0, 35, 0, 0, 0,233,16,16, 0, 0, 0,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16, 0, 0, 0, 0, 0,233,233, 0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 0, 35, 35, 35, 0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 0, 35, 35, 0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 0, 35, 0, 0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 0, 0, 0, 0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 0, 0, 0, 0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 0, 0, 0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
- };
-static char B_runup2_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0, 35,0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,0, 35,0,16,16,16,16,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,233,233,233, 35, 0,16,16,16,16,0,233, 35,0,16,16,
- 16,16,16,16,16,16,16,16,16,0,233,0,233,233,233,233, 0,16,0,0,0,0,0,233,0,16,16,
- 16,16,16,16,16,16,0,0,0,0,0,233,0,233,0,233,0,0, 35, 35, 35, 35, 35,0,0,16,16,
- 16,16,16,16,0,0,0, 35, 35,0,233,0,233,0,233,0,0,0, 35, 35, 35, 35, 35, 35,0,16,16,
- 16,16,16,0, 35, 35, 35, 35, 35,0,0,0,0,233,0,233,0,0, 35, 35, 35, 35, 35,0,16,16,16,
- 16,16,0, 35, 35, 35, 35, 35, 35,0,0,0,233,0,0,0,0, 35, 35, 35,0,0,0,0,16,16,16,
- 16,0,0, 35, 35, 35, 35, 35, 35, 35,0,0,0,0,233,0,0, 35,0,0,0,0,16,16,16,16,16,
- 16,0,233,0,0,0,0,0,0, 35, 35,0,0,0,0,0, 35,0,0,16,16,16,16,16,16,16,16,
- 16,0,0,233,0,0,16,16,0,0, 35,0, 35, 35, 35, 35, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,0,0,0,16,16,233,0,0,0, 35,0, 35,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,233,233,0,0,0,0,0,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0, 35, 35, 35,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0, 35, 35,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0, 35,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
- };
-static char B_runru_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,4,77,0,12,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,4,100,246,169,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,8,37,68,68,68,8,16,16,16,16,16,12,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,8,219, 35,219,0,8,16,16,16,4,0,0,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,0,219, 35, 35,219,0,12,16,4,36,36,0,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,4,110, 35, 35, 35,219,4,16,45,219,218,73,4,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,8,0,110, 35, 35, 35,41,8,36,182,0,4,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,12,0,146, 35, 35,73,0,32,233,242,165,0,12,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,218,182,0,0,132,133,233,233,165,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,219,146,32,201,133,132,233,233,165,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,146,0,0,32,100,32,132,132,32,68,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,146,36,165,64,100,100,132,133,100,100,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,219,110,64,0,132,100,0,165,64,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,37, 35,110,0,0,0,0,0,73,110,4,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,37, 35, 35,73,36,0,37,73, 35, 35,73,4,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,4,37,110,73,219,219, 35, 35, 35, 35,37,8,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,4,110,73,110,146,109, 35, 35, 35, 35,37,8,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,12,36,73,68,0,0,4,73, 35, 35, 35,218,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,12,77, 35,238,133,137,48,8,73, 35, 35,182,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,12,4,146, 35, 35,101,72,16,4,0,73, 35,110,8,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,4,36,218,182,109,4,16,16,8,32,100,137,0,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0,0,0,4,16,16,16,8,32,100,100,0,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,0,0,4,16,16,16,16,16,8,4,4,12,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,0,4,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,12,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
- };
-
- static char B_runru2_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,8,12,12,8,12,12,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,12,0,0,110,182,218,37,8,4,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,4,100,137, 35, 35, 35, 35,37,73,4,16,12,12,12,12,16,16,16,12,16,16,16,16,16,16,
- 16,16,4,100,100,73, 35, 35, 35, 35, 35,110,0,100,68,0,0,12,16,4,0,8,16,16,16,16,16,
- 16,16,8,32,32,0,73, 35, 35, 35, 35,73,64,100,32,165,165,0,4,73,0,0,12,16,16,16,16,
- 16,16,16,8,8,4,8,73, 35, 35,73,0,165,133,132,233,233,165,0,218,36,0,16,16,16,16,16,
- 16,16,16,16,16,16,48,4,109, 35,37,0,0,132,132,233,233,242,182,219,36,4,16,16,16,16,16,
- 16,16,16,16,16,72,137,0,146,219,0,0,100,100,32,132, 133,233,36,45,4,16,16,16,16,16,16,
- 16,16,16,16,4,101,133,0,110,219,36,0,132,100,100,133,132,32,8,16,16,16,16,16,16,16,16,
- 16,16,16,4,109, 35,238,68,73,73,73,0,0,64,32,201,0,0,41,4,12,16,16,16,16,16,16,
- 16,16,4,0,182, 35, 35,73,110,110, 35,110,64,165,0,32,0,73, 35,219,0,8,8,8,12,16,16,
- 16,4,0,0,218,146,77,36,4,37, 35, 35,110,36,0,146,182, 35, 35, 35,219,0,68,169,0,16,16,
- 12,0,0,0,36,4,12,12,16,4,37,37,219,146,146,219,218, 35, 35, 35, 35,219,68,246,77,16,16,
- 16,8,0,0,4,12,16,16,16,16,8,8,0,0,0,0,0,146,110, 35, 35, 35,68,100,4,16,16,
- 16,16,12,16,16,16,16,16,16,16,16,16,12,12,16,12,12,0,0,110,219,219,37,4,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,12,8,4,0,8,8,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,12,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
- };
-
-static char B_rundes_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,0,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,233,0,0,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,233,0, 35, 35,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,0, 35, 35, 35, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0, 35, 35, 35, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0,0,0,0,0,233,16,0, 35, 35, 35, 35,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0,0, 35, 35,233,0,0,0, 35, 35, 35, 35,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0, 35, 35, 35,233,0,0, 35, 35,0,0, 0,0,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,0,0,0,0, 35,0,0, 35, 35,0,0,0, 233,0,233,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0, 35,0,0,0,0,0, 0,233,0,0,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0, 35,0,0,233,0, 233,0,233,233,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0, 35, 35,0,0,0,233, 0,233,233,233,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0, 35,0,233,0,0, 233,0,233,233,0,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0, 35,0,0,0,233, 0,233,233, 35,0, 35,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0, 35,0,0,0, 0,0,0,0, 35,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0, 35, 35,0, 0,0,16,16,0,0,0,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,0, 35, 35, 35, 35,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35, 35,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0, 35, 35, 35,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0, 35, 35, 35,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35,0,233,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0, 35,0,233, 35,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 0,0,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-
-static char B_rundes2_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 0,0,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0, 35,0,233, 35,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35,0,233,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0, 35, 35, 35,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0, 35, 35, 35,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35, 35,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,0, 35, 35, 35, 35,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0, 35, 35,0, 0,0,16,16,0,0,0,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0, 35,0,0,0, 0,0,0,0, 35,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0, 35,0,0,0,233, 0,233,233, 35,0, 35,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0, 35,0,233,0,0, 233,0,233,233,0,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,0, 35, 35,0,0,0,233, 0,233,233,233,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0, 35,0,0,233,0, 233,0,233,233,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0, 35,0,0,0,0,0, 0,233,0,0,0,16,16,16,16,16,16,
- 16,16,16,16,0,0,0,0, 35,0,0, 35, 35,0,0,0, 233,0,233,0,16,16,16,16,16,16,16,
- 16,16,16,0,0,0, 35, 35, 35,233,0,0, 35, 35,0,0, 0,0,0,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0,0, 35, 35,233,0,0,0, 35, 35, 35, 35,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0,0,0,0,0,233,16,0, 35, 35, 35, 35,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0, 35, 35, 35, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,0, 35, 35, 35, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,233,0, 35, 35,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,233,0,0,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,0,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char B_runrd_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,12,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,0,4,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,0,0,4,16,16,16,16, 16,8,4,4,12,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0,0,0,4,16,16,16, 8,32,100,100,0,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,4,36,218,182,109,4,16,16, 8,32,100,137,0,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,12,4,146, 35, 35,101,72,16, 4,0,73, 35,110,8,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,12,77, 35,238,133,137,48, 8,73, 35, 35,182,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,12,36,73,68,0,0,4, 73, 35, 35, 35,218,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,4,110,73,110,146,109, 35, 35, 35, 35,37,8,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,4,37,110,73,219,219, 35, 35, 35, 35,37,8,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,37, 35, 35,73,36,0,37, 73, 35, 35,73,4,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,37, 35,110,0,0,0,0, 0,73,110,4,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,219,110,64,0,132,100,0, 165,64,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,146,36,165,64,100,100,132, 133,100,100,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,146,0,0,32,100,32,132, 132,32,68,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,219,146,32,201,133,132,233, 233,165,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,218,182,0,0,132,133,233, 233,165,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,12,0,146, 35, 35,73,0,32,233,242, 165,0,12,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,8,0,110, 35, 35, 35,41,8,36,182, 0,4,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,4,110, 35, 35, 35,219,4,16,45,219, 218,73,4,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,0,219, 35, 35,219,0,12,16,4,36, 36,0,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,8,219, 35,219,0,8,16,16,16,4, 0,0,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,8,37,68,68,68,8,16,16,16,16, 16,12,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,4,100,246,169,8,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,4,77,0,12,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char B_runrd2_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,12,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,12,8,4,0,8,8,16,16,16,16,
- 16,16,12,16,16,16,16,16,16,16,16,16,12,12,16,12, 12,0,0,110,219,219,37,4,16,16,16,
- 16,8,0,0,4,12,16,16,16,16,8,8,0,0,0,0, 0,146,110, 35, 35, 35,68,100,4,16,16,
- 12,0,0,0,36,4,12,12,16,4,37,37,219,146,146,219, 218, 35, 35, 35, 35,219,68,246,77,16,16,
- 16,4,0,0,218,146,77,36,4,37, 35, 35,110,36,0,146, 182, 35, 35, 35,219,0,68,169,0,16,16,
- 16,16,4,0,182, 35, 35,73,110,110, 35,110,64,165,0,32, 0,73, 35,219,0,8,8,8,12,16,16,
- 16,16,16,4,109, 35,238,68,73,73,73,0,0,64,32,201, 0,0,41,4,12,16,16,16,16,16,16,
- 16,16,16,16,4,101,133,0,110,219,36,0,132,100,100,133, 132,32,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,72,137,0,146,219,0,0,100,100,32,132, 133,233,36,45,4,16,16,16,16,16,16,
- 16,16,16,16,16,16,48,4,109, 35,37,0,0,132,132,233, 233,242,182,219,36,4,16,16,16,16,16,
- 16,16,16,8,8,4,8,73, 35, 35,73,0,165,133,132,233, 233,165,0,218,36,0,16,16,16,16,16,
- 16,16,8,32,32,0,73, 35, 35, 35, 35,73,64,100,32,165, 165,0,4,73,0,0,12,16,16,16,16,
- 16,16,4,100,100,73, 35, 35, 35, 35, 35,110,0,100,68,0, 0,12,16,4,0,8,16,16,16,16,16,
- 16,16,4,100,137, 35, 35, 35, 35,37,73,4,16,12,12,12, 12,16,16,16,12,16,16,16,16,16,16,
- 16,16,12,0,0,110,182,218,37,8,4,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,8,12,12,8,12,12,8,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char B_rundown_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0, 35,0,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0, 35, 35,0,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0, 35, 35, 35,0,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,233,233,0,0,0,0,0,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,0,0,0,16,16,233,0,0,0, 35,0, 35,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,0,0,233,0,0,16,16,0,0, 35,0, 35, 35, 35, 35, 0,0,16,16,16,16,16,16,16,16,16,
- 16,0,233,0,0,0,0,0,0, 35, 35,0,0,0,0,0, 35,0,0,16,16,16,16,16,16,16,16,
- 16,0,0, 35, 35, 35, 35, 35, 35, 35,0,0,0,0,233,0, 0, 35,0,0,0,0,16,16,16,16,16,
- 16,16,0, 35, 35, 35, 35, 35, 35,0,0,0,233,0,0,0, 0, 35, 35, 35,0,0,0,0,16,16,16,
- 16,16,16,0, 35, 35, 35, 35, 35,0,0,0,0,233,0,233, 0,0, 35, 35, 35, 35, 35,0,16,16,16,
- 16,16,16,16,0,0,0, 35, 35,0,233,0,233,0,233,0, 0,0, 35, 35, 35, 35, 35, 35,0,16,16,
- 16,16,16,16,16,16,0,0,0,0,0,233,0,233,0,233, 0,0, 35, 35, 35, 35, 35,0,0,16,16,
- 16,16,16,16,16,16,16,16,16,0,233,0,233,233,233,233, 0,16,0,0,0,0,0,233,0,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,233,233,233, 35, 0,16,16,16,16,0,233, 35,0,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,0, 35,0,16,16,16,16,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0, 35, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char B_rundown2_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0, 35,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0, 35, 35,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,0,233,233,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,0, 35,0, 35,0,0,0,233,16,16,0,0,0,16,16,
- 16,16,16,16,16,16,16,16,16,0,0, 35, 35, 35, 35,0, 35,0,0,16,16,0,0,233,0,0,16,
- 16,16,16,16,16,16,16,16,0,0, 35,0,0,0,0,0, 35, 35,0,0,0,0,0,0,233,0,16,
- 16,16,16,16,16,0,0,0,0, 35,0,0,233,0,0,0,0, 35, 35, 35, 35, 35, 35, 35,0,0,16,
- 16,16,16,0,0,0,0, 35, 35, 35,0,0,0,0,233,0,0,0, 35, 35, 35, 35, 35, 35,0,16,16,
- 16,16,16,0, 35, 35, 35, 35, 35,0,0,233,0,233,0,0,0,0, 35, 35, 35, 35, 35,0,16,16,16,
- 16,16,0, 35, 35, 35, 35, 35, 35,0,0,0,233,0,233,0,233,0, 35, 35,0,0,0,16,16,16,16,
- 16,16,0,0, 35, 35, 35, 35, 35,0,0,233,0,233,0,233,0,0,0,0,0,16,16,16,16,16,16,
- 16,16,0,233,0,0,0,0,0,16,0,233,233,233,233,0,233,0,16,16,16,16,16,16,16,16,16,
- 16,16,0, 35,233,0,16,16,16,16,0, 35,233,233,233,0,0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,16,16,16,16,0, 35,0,0,0,0,0,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0, 35,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
- };
-
-static char B_runld_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,12,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 4,0,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,12,4,4,8,16,16,16,16,16,4, 0,0,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,0,100,100,32,8,16,16,16,4,0, 0,0,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,0,137,100,32,8,16,16,4,109,182, 218,36,4,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,8,110, 35,73,0,4,16,72,101, 35, 35, 146,4,12,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,182, 35, 35,73,8,48,137,133,238, 35, 77,12,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,218, 35, 35, 35,73,4,0,0,68,73, 36,12,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,8,37, 35, 35, 35, 35,109,146,110,73,110, 4,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,8,37, 35, 35, 35, 35,219,219,73,110, 37,4,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,4,73, 35, 35,73,37,0,36,73, 35, 35,37,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,4,110,73,0,0,0,0,0,110, 35,37,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,64,165,0,100,132,0,64, 110,219,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,100,100,133,132,100,100,64,165, 36,146,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,68,32,132,132,32,100,32,0, 0,146,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,165,233,233,132,133,201,32, 146,219,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,165,233,233,133,132,0,0, 182,218,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,12,0,165,242,233,32,0,73, 35, 35,146,0,12,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,4,0,182,36,8,41, 35, 35, 35,110,0,8,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,4,73,218,219,45,16,4,219, 35, 35, 35,110,4,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,0,36,36,4,16,12,0, 219, 35, 35,219,0,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,0,0,4,16,16,16,8, 0,219, 35,219,8,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,12,16,16,16,16,16,8, 68,68,68,37,8,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,8, 169,246,100,4,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,12, 0,77,4,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char B_runld2_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,12,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,8,8,0,4,8,12,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,4,37,219,219,110,0,0,12,12,16,12,12,16, 16,16,16,16,16,16,16,16,12,16,16,
- 16,16,4,100,68, 35, 35, 35,110,146,0,0,0,0,0,8, 8,16,16,16,16,12,4,0,0,8,16,
- 16,16,77,246,68,219, 35, 35, 35, 35,218,219,146,146,219,37, 37,4,16,12,12,4,36,0,0,0,12,
- 16,16,0,169,68,0,219, 35, 35, 35,182,146,0,36,110, 35, 35,37,4,36,77,146,218,0,0,4,16,
- 16,16,12,8,8,8,0,219, 35,73,0,32,0,165,64,110, 35,110,110,73, 35, 35,182,0,4,16,16,
- 16,16,16,16,16,16,12,4,41,0,0,201,32,64,0,0, 73,73,73,68,238, 35,109,4,16,16,16,
- 16,16,16,16,16,16,16,16,8,32,132,133,100,100,132,0, 36,219,110,0,133,101,4,16,16,16,16,
- 16,16,16,16,16,16,4,45,36,233,133,132,32,100,100,0, 0,219,146,0,137,72,16,16,16,16,16,
- 16,16,16,16,16,4,36,219,182,242,233,233,132,132,0,0, 37, 35,109,4,48,16,16,16,16,16,16,
- 16,16,16,16,16,0,36,218,0,165,233,233,132,133,165,0, 73, 35, 35,73,8,4,8,8,16,16,16,
- 16,16,16,16,12,0,0,73,4,0,165,165,32,100,64,73, 35, 35, 35, 35,73,0,32,32,8,16,16,
- 16,16,16,16,16,8,0,4,16,12,0,0,68,100,0,110, 35, 35, 35, 35, 35,73,100,100,4,16,16,
- 16,16,16,16,16,16,12,16,16,16,12,12,12,12,16,4, 73,37, 35, 35, 35, 35,137,100,4,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 4,8,37,218,182,110,0,0,12,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,8,12,12,8,12,12,8,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char B_runleft_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,0,233,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0, 35, 35,0,233, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35,0,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0, 35, 35, 35,0,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0, 35, 35, 35, 35,0,16, 233,0,0,0,0,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,0, 35, 35, 35, 35,0,0, 0,233, 35, 35,0,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,0,0,0,0,0, 35, 35,0, 0,233, 35, 35, 35,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,0,233,0,233,0,0,0, 35, 35, 0,0, 35,0,0,0,0,16,16,16,16,
- 16,16,16,16,16,16,0,0,0,233,0,0,0,0,0,0, 35,0,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,233,233,0,233,0,233,0,0, 35, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,233,233,233,0,233,0,0,0, 35, 35,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0,0,233,233,0,233,0,0,233,0, 35, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0, 35,0, 35,233,233,0,233,0,0,0, 35, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0, 35,0,0,0,0,0,0,0, 35,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,0,0,0,16,16,0,0,0, 35, 35,0,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0, 35, 35, 35, 35,0,0,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0, 35, 35, 35, 35,0,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0, 35, 35, 35,0,0,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0, 35, 35, 35,0,0,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,233,0, 35, 35, 35,0,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0, 35,233,0, 35,0,0,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char B_runleft2_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0, 35,233,0, 35,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,233,0, 35, 35, 35,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0, 35, 35, 35,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0, 35, 35, 35,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0, 35, 35, 35, 35,0,16,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0, 35, 35, 35, 35,0,0,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,0,0,0,16,16,0,0,0, 35, 35,0,0,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0, 35,0,0,0,0,0,0,0, 35,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0, 35,0, 35,233,233,0,233,0,0,0, 35,0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,0,0,0,0,233,233,0,233,0,0,233,0, 35,0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,233,233,233,0,233,0,0,0, 35, 35,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,233,233,0,233,0,233,0,0, 35,0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,0,0,233,0,0,0,0,0,0, 35,0,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,233,0,233,0,0,0, 35, 35,0,0, 35,0,0,0,0,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0,0,0,0, 35, 35,0,0,233, 35, 35, 35,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,0, 35, 35, 35, 35,0,0,0,233, 35, 35,0,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,0, 35, 35, 35, 35,0,16,233,0,0,0,0,0,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0, 35, 35, 35,0,16,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35,0,0,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35,0,0,0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0, 35, 35,0,233,0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,0,233,0,0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
- };
-
-static char B_runlu_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,12, 0,77,4,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,8, 169,246,100,4,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,12,16,16,16,16,16,8, 68,68,68,37,8,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,0,0,4,16,16,16,8, 0,219, 35,219,8,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,0,36,36,4,16,12,0, 219, 35, 35,219,0,12,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,4,73,218,219,45,16,4,219, 35, 35, 35,110,4,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,4,0,182,36,8,41, 35, 35, 35,110,0,8,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,12,0,165,242,233,32,0,73, 35, 35,146,0,12,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,165,233,233,133,132,0,0, 182,218,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,0,165,233,233,132,133,201,32, 146,219,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,68,32,132,132,32,100,32,0, 0,146,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,12,100,100,133,132,100,100,64,165, 36,146,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,64,165,0,100,132,0,64, 110,219,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,4,110,73,0,0,0,0,0,110, 35,37,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,4,73, 35, 35,73,37,0,36,73, 35, 35,37,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,8,37, 35, 35, 35, 35,219,219,73,110, 37,4,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,8,37, 35, 35, 35, 35,109,146,110,73,110, 4,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,218, 35, 35, 35,73,4,0,0,68,73, 36,12,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,182, 35, 35,73,8,48,137,133,238, 35, 77,12,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,8,110, 35,73,0,4,16,72,101, 35, 35, 146,4,12,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,0,137,100,32,8,16,16,4,109,182, 218,36,4,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,12,0,100,100,32,8,16,16,16,4,0, 0,0,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,12,4,4,8,16,16,16,16,16,4, 0,0,0,12,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 4,0,8,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,12,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char B_runlu2_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,8,12,12,8,12,12,8,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 4,8,37,218,182,110,0,0,12,16,16,
- 16,16,16,16,16,16,12,16,16,16,12,12,12,12,16,4, 73,37, 35, 35, 35, 35,137,100,4,16,16,
- 16,16,16,16,16,8,0,4,16,12,0,0,68,100,0,110, 35, 35, 35, 35, 35,73,100,100,4,16,16,
- 16,16,16,16,12,0,0,73,4,0,165,165,32,100,64,73, 35, 35, 35, 35,73,0,32,32,8,16,16,
- 16,16,16,16,16,0,36,218,0,165,233,233,132,133,165,0, 73, 35, 35,73,8,4,8,8,16,16,16,
- 16,16,16,16,16,4,36,219,182,242,233,233,132,132,0,0, 37, 35,109,4,48,16,16,16,16,16,16,
- 16,16,16,16,16,16,4,45,36,233,133,132,32,100,100,0, 0,219,146,0,137,72,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,8,32,132,133,100,100,132,0, 36,219,110,0,133,101,4,16,16,16,16,
- 16,16,16,16,16,16,12,4,41,0,0,201,32,64,0,0, 73,73,73,68,238, 35,109,4,16,16,16,
- 16,16,12,8,8,8,0,219, 35,73,0,32,0,165,64,110, 35,110,110,73, 35, 35,182,0,4,16,16,
- 16,16,0,169,68,0,219, 35, 35, 35,182,146,0,36,110, 35, 35,37,4,36,77,146,218,0,0,4,16,
- 16,16,77,246,68,219, 35, 35, 35, 35,218,219,146,146,219,37, 37,4,16,12,12,4,36,0,0,0,12,
- 16,16,4,100,68, 35, 35, 35,110,146,0,0,0,0,0,8, 8,16,16,16,16,12,4,0,0,8,16,
- 16,16,16,4,37,219,219,110,0,0,12,12,16,12,12,16, 16,16,16,16,16,16,16,16,12,16,16,
- 16,16,16,16,8,8,0,4,8,12,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,12,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-/*
-static char portesx_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0,0,0,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,0, 100,0,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0, 100, 100,0,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0, 100, 100, 100,0,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,0,233,233,0,0,0,0,0,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,0,0,0,16,16,233,0,0,0, 100,0, 100,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,0,0,233,0,0,16,16,0,0, 100,0, 100, 100, 100, 100, 0,0,16,16,16,16,16,16,16,16,16,
- 16,0,233,0,0,0,0,0,0, 100, 100,0,0,0,0,0, 100,0,0,16,16,16,16,16,16,16,16,
- 16,0,0, 100, 100, 100, 100, 100, 100, 100,0,0,0,0,233,0, 0, 100,0,0,0,0,16,16,16,16,16,
- 16,16,0, 100, 100, 100, 100, 100, 100,0,0,0,233,0,0,0, 0, 100, 100, 100,0,0,0,0,16,16,16,
- 16,16,16,0, 100, 100, 100, 100, 100,0,0,0,0,233,0,233, 0,0, 100, 100, 100, 100, 100,0,16,16,16,
- 16,16,16,16,0,0,0, 100, 100,0,233,0,233,0,233,0, 0,0, 100, 100, 100, 100, 100, 100,0,16,16,
- 16,16,16,16,16,16,0,0,0,0,0,233,0,233,0,233, 0,0, 100, 100, 100, 100, 100,0,0,16,16,
- 16,16,16,16,16,16,16,16,16,0,233,0,233,233,233,233, 0,16,0,0,0,0,0,233,0,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,233,233,233, 100, 0,16,16,16,16,0,233, 100,0,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,0, 100,0,16,16,16,16,0,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0, 100, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-
-
-static char calcdes_data[] = {
- 16 ,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16,16,16, 0, 0, 0, 0,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16,16, 0, 0, 35, 0,233, 0,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16, 0, 35, 35, 35, 35, 0,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16, 0, 35, 35, 35, 0,16,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16, 0, 0, 35, 35, 35, 35, 0,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16, 0, 35, 35, 35, 35, 35, 35, 0,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16, 0, 35, 35, 0, 0, 0, 0, 0, 0,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16, 0, 35, 0, 0, 0, 0,233,233,233, 0, 0,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16, 0, 35, 0, 0,233, 0,233, 0,233,233, 35, 0,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16, 0, 35, 35, 0, 0, 0,233, 0,233, 0,233,233, 0,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16, 0, 35, 35, 0, 0, 0, 0,233, 0,233, 0,233, 0,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16, 0, 35, 35, 0, 0, 0, 0, 0,233, 0,233, 0, 0,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16, 0, 35, 0, 0, 0,233, 0, 0,233, 0, 0,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16, 0, 0, 35, 35, 0, 0, 0, 0, 0, 0,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16, 0, 35, 35, 35, 35, 35, 35, 35, 0,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16, 0, 35, 35, 35, 35, 35, 35, 0,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16, 0, 0, 35, 35, 35, 35, 0,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16, 0, 35, 35, 35, 0,16,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16, 0, 35, 35, 35, 35, 0,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16,16, 0, 0, 35, 0,233, 0,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16,16,16, 0, 0, 0, 0,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16 ,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
-
- 16 ,16 ,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
- };
-
-static char calcdown_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0, 35, 35, 35, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0, 35, 35, 35, 35, 35, 35,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0, 35, 35,0,0,0,0, 0,0, 35,0,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,0,0,0, 35, 35, 35,0,0,0,0, 0,0, 35, 35,0,0,0,16,16,16,16,
- 16,16,16,16,16,0, 35, 35, 35, 35, 35,0,0,0,0,0, 233,0,0, 35, 35, 35, 35,0,16,16,16,
- 16,16,16,16,0,0, 35, 35, 35, 35, 35,0,233,0,0,233, 0,0,0, 35, 35, 35, 35,0,0,16,16,
- 16,16,16,16,0, 35, 35, 35, 35, 35, 35,0,0,0,233,0, 233,233,0, 35, 35, 35, 35, 35,0,16,16,
- 16,16,16,16,0,0, 35,0, 35, 35, 35,0,0,233,0,233, 0,233,0, 35, 35,0, 35,0,0,16,16,
- 16,16,16,16,0,233,0,16,0, 35, 35,0,233,0,233,0, 233,233,0, 35,0,16,0,233,0,16,16,
- 16,16,16,16,16,0,16,16,16,0,0,0,0,233,0,233, 233,0,0,0,16,16,16,0,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,0,233,233, 35,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char calcleft_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,233,0, 35,0,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35, 35, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35, 35, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35, 35, 35, 35,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,0,0,0,0, 35, 35,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0,233,233,233,0,0, 0,0, 35,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0, 35,233,233,0,233,0,233, 0,0, 35,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,233,233,0,233,0,233,0, 0,0, 35, 35,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,233,0,233,0,233,0,0, 0,0, 35, 35,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0,233,0,233,0,0,0, 0,0, 35, 35,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,0,0,233,0,0,233,0, 0,0, 35,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0,0,0,0,0, 35, 35,0,0,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35, 35, 35, 35, 35,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35, 35, 35, 35,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35, 35, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0, 35, 35, 35, 35, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,233,0, 35,0,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };
-static char calcup_data[] = {
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0, 0,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,0,0,233,233, 35,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,0,16,16,16,0,0,0,0,233,0,233, 233,0,0,0,16,16,16,0,16,16,16,
- 16,16,16,16,0,233,0,16,0, 35, 35,0,233,0,233,0, 233,233,0, 35,0,16,0,233,0,16,16,
- 16,16,16,16,0,0, 35,0, 35, 35, 35,0,0,233,0,233, 0,233,0, 35, 35,0, 35,0,0,16,16,
- 16,16,16,16,0, 35, 35, 35, 35, 35, 35,0,0,0,233,0, 233,233,0, 35, 35, 35, 35, 35,0,16,16,
- 16,16,16,16,0,0, 35, 35, 35, 35, 35,0,233,0,0,233, 0,0,0, 35, 35, 35, 35,0,0,16,16,
- 16,16,16,16,16,0, 35, 35, 35, 35, 35,0,0,0,0,0, 233,0,0, 35, 35, 35, 35,0,16,16,16,
- 16,16,16,16,16,16,0,0,0, 35, 35, 35,0,0,0,0, 0,0, 35, 35,0,0,0,16,16,16,16,
- 16,16,16,16,16,16,16,16,0,0, 35, 35,0,0,0,0, 0,0, 35,0,0,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,0,0, 35, 35, 35, 35, 35, 35,0,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,0,0, 35, 35, 35, 0,0,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,
- 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16
- };*/
-
Index: rel_1_21/soccer/position.h
===================================================================
--- rel_1_21/soccer/position.h (revision 1217)
+++ rel_1_21/soccer/position.h (nonexistent)
@@ -1,57 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: position.h,v 1.1.1.1 2002-09-02 09:37:44 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:44 $
- ------------
-*/
-
-/*
- * Copyright (C) 2000 Merli Andrea and Zucchetti Alessandro
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "iniziali.h"
-
-struct position{
- int x;
- int y;
- float dx;
- float dy;
-} initial_calc_position[]={{ORI_RES/5,VER_RES/5+100},{ORI_RES/5,8*VER_RES/10},{ORI_RES/2,VER_RES/2+40},{9*ORI_RES/10,VER_RES/5+100},{9*ORI_RES/10,8*VER_RES/10}};
-
-
Index: rel_1_21/soccer/images.h
===================================================================
--- rel_1_21/soccer/images.h (revision 1217)
+++ rel_1_21/soccer/images.h (nonexistent)
@@ -1,82 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: images.h,v 1.1.1.1 2002-09-02 09:37:44 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:44 $
- ------------
-*/
-
-/*
- * Copyright (C) 2000 Merli Andrea and Zucchetti Alessandro
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#define SFONDO rgb16(0,128,0)
-#define B 255 /*BIANCO*/
-#define V 16 /*verde*/
-#define M 200 /*marrone*/
-#define C 15 /*bianco*/
-#define G 14 /*Giallo*/
-#define N 0 /*NERO*/
-#define P 13 /*Rosa*/
-
-char pallone[64]={ V,V,V,V,V,V,V,V,
- V,V,B,B,B,B,V,V,
- V,N,B,B,B,B,N,V,
- B,B,N,B,B,N,B,B,
- B,B,B,N,N,B,B,B,
- B,B,N,B,B,N,B,B,
- V,N,B,B,B,B,N,V,
- V,V,B,B,B,B,V,V,
- };
-char goal_data[]={N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
- N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
- N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
- N,N,G,G,G,G,N,G,G,G,N,G,G,G,N,G,N,N,N,N,
- N,N,G,N,N,N,N,G,N,G,N,G,N,G,N,G,N,N,N,N,
- N,N,G,N,N,N,N,G,N,G,N,G,N,G,N,G,N,N,N,N,
- N,N,G,N,N,N,N,G,N,G,N,G,N,G,N,G,N,N,N,N,
- N,N,G,N,N,N,N,G,N,G,N,G,N,G,N,G,N,N,N,N,
- N,N,G,N,G,G,N,G,N,G,N,G,G,G,N,G,N,N,N,N,
- N,N,G,N,N,G,N,G,N,G,N,G,N,G,N,G,N,N,N,N,
- N,N,G,G,G,G,N,G,G,G,N,G,N,G,N,G,G,G,N,N,
- N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
- N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
- N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
- N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
- };
-
Index: rel_1_21/thdemo/fft.c
===================================================================
--- rel_1_21/thdemo/fft.c (revision 1217)
+++ rel_1_21/thdemo/fft.c (nonexistent)
@@ -1,533 +0,0 @@
-// FFT Part
-/*
-
-FFTPlay 1.0
------------
-
-This application reads data from the audio microphone and then put it
-to the screen in a graphical oscilloscope-like form (both standard Hartik
-SB driver and Alsa driver can be used).
-
-The application also calculate a FFT on the latest values, and displays
-the power spectrum in tho ways, one like an equalizator, and the other in a
-2D form.
-
-A resolution of 1024x768, 64K colors is used.
-
-The task set is composed by these tasks and functions:
-
-Self buffering functions (SB only)
-----------------------------------
-this function takes the samples read by the mic and then makes a window
-with the last WINDATA_NSAMPLES samples. The window is then put in
-the CAB windata.
-
-Task raw and task mixer (ALSA only)
------------------------------------
-These tasks are used with the Alsa driver; because it doesn't support the
-self-buffering mode, we have to do a forever cycle in witch we have to read
-all the data. Then the data are managed like the self-buffering functions of
-the SB driver or sent to the mixer task (with a STREAM mailbox) which makes
-the window.
-(This approach is not good for realtime...)
-
-Task wave
----------
-This task read the last window and then put it on the screen in a wave form
-on the top of the screen.
-The task's period is set to 40 ms (25 fps).
-
-Task fft
---------
-This task read the last window and then it computes the FFT.
-With the FFT data it computes the power spectrum, whitch is sent to the
-CAB pwrdata.
-The task's period is set to 10 ms (good for the 2D story task).
-This task is the only Hard Task.
-
-Task equ
---------
-This task read the last power spectrum and displays it in a graphical
-form, like a hi-fi equalizator.
-The Histograms can be white or coloured like the equ2D task (see EQU_SHADE)
-The task's period is set to 40 ms (25 fps).
-
-Task equ2D
-----------
-This task read the lasf power spectrum and displays it in a graphical
-one-line form. Each pixel is a power coefficient, and its colour shade
-from black (no power) to red (high power) passing through green and blue.
-The task display the last EQU2D_WIDTH power lines.
-The task's period is set to 10 ms (good for the 2D story task).
-
-****************************************************************************
-TASK LOAD
-****************************************************************************
-
- period wcet
-task tick (ms) us %
---------------------------------------------------------
-sound driver 24->3 12->1.5 200 0.016->0.133
-wave 80 40 11500 0.2875
-fft 20 10 3000 0.3000
-equ 80 40 7000 0.1750
-equ2D 20 10 500 0.0500
- -------------
- 0.812 (last 4)
-*/
-
-#include "demo.h"
-//#include <ll/ll.h>
-
-//#include <kernel/types.h>
-#include <kernel/model.h>
-#include <kernel/func.h>
-
-#include <modules/cabs.h>
-
-//#include <string.h>
-//#include <stdlib.h>
-#include <semaphore.h>
-
-//#include <drivers/keyb.h>
-//#include <drivers/crtwin.h>
-#include <drivers/glib.h>
-#include <drivers/sound.h>
-#include <rfftw.h>
-
-/* CAB ports... */
-CAB cab_windata; /* a window on the last WINDATA_DIM samples */
-CAB cab_pwrdata; /* the last power spectrum */
-
-/* for the cab_windata */
-typedef struct {
- int start;
- SAMPLE sample[WINDATA_NSAMPLES];
-} window;
-
-/* for the cab_pwrdata */
-typedef struct {
- fftw_real p[PWR_NSAMPLES];
-} power;
-
-
-// win is global... because is used by raw_infun...
-window win;
-
-/*
- This is the self-buffering function: read the samples and put their mean
- value in a CAB
-*/
-int raw_infun(void *b)
-{
- int i;
- char *w;
- SAMPLE *audiobuf = (SAMPLE *)b;
-
- for (i=0; i<rawdata_nsamples/2; i++) {
- win.sample[win.start] = audiobuf[i];
- win.start = (win.start+1) % WINDATA_NSAMPLES;
- }
-
- w = cab_reserve(cab_windata);
- memcpy(w, &win, sizeof(window));
- cab_putmes(cab_windata,w);
-
- #if defined(NO_GRX)
- cprintf("X"); //"XXX%d\n",win.sample[win.start]);
- #endif
- return 0;
-}
-
-
-
-void init_rawdata()
-{
- int i;
- char *w;
-
- win.start = 0;
- for (i=0; i<WINDATA_NSAMPLES; i++)
- win.sample[i] = 0;
-
- w = cab_reserve(cab_windata);
- memcpy(w, &win, sizeof(window));
- cab_putmes(cab_windata,w);
-}
-
-
-
-
-
-TASK wave_task()
-{
- window *p;
- int x,y;
- int s;
-
- while(1)
- {
- p = (window *)cab_getmes(cab_windata);
-
- /* let's print the wave */
- mutex_lock(&mutex);
- for(x = WAVE_X, s = p->start;
- x < WAVE_X+WAVE_NSAMPLES;
- x++, s = (s+1)%WINDATA_NSAMPLES )
- {
- y = WAVE_Y + (WAVE_HEIGHT * p->sample[s]) / MAX_SAMPLE;
- SHORT_CRITICAL_SECTIONS(x);
- grx_plot(x,y,white);
- }
- mutex_unlock(&mutex);
-
- task_endcycle();
-
- /* let's erase the wave */
- mutex_lock(&mutex);
- for(x = WAVE_X, s = p->start;
- x < WAVE_X+WAVE_NSAMPLES;
- x++, s = (s+1)%WINDATA_NSAMPLES )
- {
- y = WAVE_Y + (WAVE_HEIGHT * p->sample[s]) / MAX_SAMPLE;
- SHORT_CRITICAL_SECTIONS(x);
- grx_plot(x,y,black);
- }
- mutex_unlock(&mutex);
-
- cab_unget(cab_windata,(char *)p);
-
- }
-}
-
-
-rfftw_plan plan;
-
-void fft_close(void *arg)
-{
- rfftw_destroy_plan(plan);
-}
-
-
-TASK fft_task()
-{
- fftw_real in[FFT_NSAMPLES], out[FFT_NSAMPLES];
- power power_spectrum;
-
- #if defined(NO_GRX)
- fftw_real max = 0.0;
- #endif
-
- char *m;
-
- int k, i;
-
- window *p;
-
- plan = rfftw_create_plan(FFT_NSAMPLES, FFTW_REAL_TO_COMPLEX, FFTW_ESTIMATE);
-
- sys_atrunlevel(fft_close, NULL, RUNLEVEL_BEFORE_EXIT);
-
- while(1)
- {
- /* Let's prepare the intput FFT data */
- p = (window *)cab_getmes(cab_windata);
-
- for (k = 0, i = p->start;
- k < FFT_NSAMPLES;
- k++, i = (i+1)%WINDATA_NSAMPLES)
- in[k] = p->sample[i]/FFT_SCALE;
-
- cab_unget(cab_windata,(char *)p);
-
- /* zero-padding if needed */
- for (k=WINDATA_NSAMPLES; k < FFT_NSAMPLES; k++)
- in[k] = 0.0;
-
- rfftw_one(plan, in, out);
-
- /* power spectrum computation */
- power_spectrum.p[0] = out[0]*out[0]; /* DC component */
- for (k = 1; k < PWR_NSAMPLES; ++k) /* (k < N/2 rounded up) */
- power_spectrum.p[k] = out[k]*out[k] + out[FFT_NSAMPLES-k]*out[FFT_NSAMPLES-k];
- if (FFT_NSAMPLES % 2 == 0) /* N is even */
- power_spectrum.p[FFT_NSAMPLES/2] = out[FFT_NSAMPLES/2]*out[FFT_NSAMPLES/2]; /* Nyquist freq. */
-
- m = cab_reserve(cab_pwrdata);
- memcpy(m, &power_spectrum, sizeof(power));
- cab_putmes(cab_pwrdata,m);
-
- #if defined(NO_GRX)
- max = 0.0;
- for (k=0; k<PWR_NSAMPLES; k++)
- if (power_spectrum.p[k] > max)
- max = power_spectrum.p[k];
-
- //cprintf("%f %f\n",max,(max / EQU_SCALE) );
- #endif
-
- task_endcycle();
-
- }
-}
-
-/* structure is like the wave task... */
-TASK equ_task()
-{
- power *p;
-
- int x[PWR_NSAMPLES];
- int y;
- int s;
-
- int r,g,b;
-
- while(1)
- {
- p = (power *)cab_getmes(cab_pwrdata);
-
- /* print the lines */
- mutex_lock(&mutex);
- for(y = EQU_Y, s = 0;
- s < EQU_NSAMPLES;
- y++, s++ )
- {
- x[s] = (int)(p->p[s] / EQU_SCALE);
-
- if (x[s] > EQU_HEIGHT)
- x[s] = EQU_HEIGHT;
-
- x[s] = EQU_X - x[s];
-
-
- #if defined(EQU_SHADE)
-
- /* like the task equ2d... */
- r = (int)(p->p[s] / EQU2D_SCALE);
- if (r > EQU2D_CLIP)
- r = EQU2D_CLIP;
-
- if (r< 64) g = r * 4;
- else if (r<128) g = (128-r) * 4;
- else g = 0;
-
- if (r<128) b = 0;
- else if (r<192) b = (r-128) * 4;
- else b = (256-r) * 4;
-
- SHORT_CRITICAL_SECTIONS(y);
- grx_line(EQU_X,y,x[s],y,rgb16(r,g,b));
- #else
- SHORT_CRITICAL_SECTIONS(y);
- grx_line(EQU_X,y,x[s],y,white);
- #endif
- }
- mutex_unlock(&mutex);
-
- task_endcycle();
-
- /* erase the lines... */
- mutex_lock(&mutex);
- for(y = EQU_Y, s = 0;
- s < EQU_NSAMPLES;
- y++, s++ )
- {
- SHORT_CRITICAL_SECTIONS(y);
- grx_line(EQU_X,y,x[s],y,black);
- }
- mutex_unlock(&mutex);
-
- cab_unget(cab_pwrdata,(char *)p);
-
- }
-}
-
-TASK equ2d_task()
-{
- power *p;
-
- int pwrint;
-
- int x = 0;
-
- int y,s;
-
- int r,g,b;
-
- while(1)
- {
-
- p = (power *)cab_getmes(cab_pwrdata);
-
- /* print the line */
- mutex_lock(&mutex);
-
- for(y = EQU2D_Y, s = 0;
- s < EQU2D_NSAMPLES;
- y++, s++ )
- {
- pwrint = (int)(p->p[s] / EQU2D_SCALE);
-
- if (pwrint > EQU2D_CLIP)
- pwrint = EQU2D_CLIP;
-
- r = pwrint;
-
- if (pwrint< 64) g = pwrint * 4;
- else if (pwrint<128) g = (128-pwrint) * 4;
- else g = 0;
-
- if (pwrint<128) b = 0;
- else if (pwrint<192) b = (pwrint-128) * 4;
- else b = (256-pwrint) * 4;
-
- SHORT_CRITICAL_SECTIONS(y);
- grx_plot(EQU2D_X+x,y,rgb16(r,g,b));
- }
-
- x = (x+1) % EQU2D_WIDTH;
- grx_line(EQU2D_X+x,EQU2D_Y,EQU2D_X+x,EQU2D_Y+EQU2D_NSAMPLES-1,white);
-
- mutex_unlock(&mutex);
-
- cab_unget(cab_pwrdata,(char *)p);
-
- task_endcycle();
- }
-}
-
-
-void init_fftplay(int freq)
-{
- SOFT_TASK_MODEL m3, m4, m5, m6;
-
- PID p3,p4,p5,p6;
-
- cab_windata = cab_create("windata", sizeof(window), 5);
- cab_pwrdata = cab_create("pwr", sizeof(power), 5);
-
- /* Init the sound lib */
- sound_init((rawdata_nsamples * sizeof(SAMPLE)), NULL);
- sound_info();
-
- /* Init the data used by the raw_infun */
- init_rawdata();
-
- /* Start the self-buffering sampling operation */
- sound_setfun(raw_infun, (int (*)(void *))-1);
- sound_sample(NULL, freq, 0, DMA_OP | PCM16 | MYFUN, NULL);
-
- soft_task_default_model(m3);
- soft_task_def_level(m3,1);
- soft_task_def_period(m3, PERIOD_WAVE);
- soft_task_def_met(m3, WCET_WAVE);
- soft_task_def_ctrl_jet(m3);
- soft_task_def_group(m3, 1);
- p3 = task_create("wave", wave_task, &m3, NULL);
- if (p3 == -1) {
- grx_close();
- perror("FFTPlay: Could not create task <wave>\n");
- ll_abort(54);
- sys_end();
- }
-
- soft_task_default_model(m4);
- soft_task_def_level(m4,1);
- soft_task_def_period(m4, PERIOD_FFT);
- soft_task_def_met(m4, WCET_FFT);
- soft_task_def_group(m4, 1);
- soft_task_def_stack(m4,32*1024);
- soft_task_def_usemath(m4);
- soft_task_def_ctrl_jet(m4);
- p4 = task_create("fft", fft_task, &m4, NULL);
- if (p4 == -1) {
- grx_close();
- perror("FFTPlay: Could not create task <fft>\n");
- ll_abort(54);
- sys_end();
- }
-
- soft_task_default_model(m5);
- soft_task_def_level(m5,1);
- soft_task_def_period(m5, PERIOD_EQU);
- soft_task_def_met(m5, WCET_EQU);
- soft_task_def_group(m5, 1);
- soft_task_def_stack(m5,32*1024);
- soft_task_def_usemath(m5);
- soft_task_def_ctrl_jet(m5);
- p5 = task_create("equ", equ_task, &m5, NULL);
- if (p5 == -1) {
- grx_close();
- perror("FFTPlay: Could not create task <equ>\n");
- ll_abort(54);
- perror("FFTPlay: Could not create task <equ>\n");
- sys_end();
- }
-
- soft_task_default_model(m6);
- soft_task_def_level(m6,1);
- soft_task_def_period(m6, PERIOD_EQU2D);
- soft_task_def_met(m6, WCET_EQU2D);
- soft_task_def_group(m6, 1);
- soft_task_def_stack(m6,32*1024);
- soft_task_def_usemath(m6);
- soft_task_def_ctrl_jet(m6);
- p6 = task_create("equ2D", equ2d_task, &m6, NULL);
- if (p6 == -1) {
- grx_close();
- perror("FFTPlay: Could not create task <equ2d>\n");
- ll_abort(54);
- perror("FFTPlay: Could not create task <equ2D>\n");
- sys_end();
- }
-}
-
-void scenario_fftplay(int f)
-{
- int i,y;
- char s[50];
-
- grx_line(0,WAVE_Y-WAVE_HEIGHT-1,383,WAVE_Y-WAVE_HEIGHT-1,red);
- grx_line(0,WAVE_Y+WAVE_HEIGHT+1,383,WAVE_Y+WAVE_HEIGHT+1,red);
- grx_line(0,EQU_Y-11 ,383,EQU_Y-11 ,red);
-
-
-
- /* lines near the frequencies */
- grx_line(EQU_X +1,EQU_Y,EQU_X +1,EQU_Y+EQU_NSAMPLES-1,red);
- grx_line(EQU2D_X-1,EQU_Y,EQU2D_X-1,EQU_Y+EQU_NSAMPLES-1,red);
-
- for (i=0; i<SCENARIO_NLABEL; i++)
- {
- y = (i*EQU_NSAMPLES)/(SCENARIO_NLABEL-1);
- if (i == SCENARIO_NLABEL-1) y--;
- grx_line(EQU_X +1,EQU_Y+y,EQU_X +4,EQU_Y+y,red);
- grx_line(EQU2D_X-1,EQU_Y+y,EQU2D_X-4,EQU_Y+y,red);
-
- itoa((i*f)/(SCENARIO_NLABEL-1),s);
- grx_text(s,EQU_X+20,EQU_Y+y-8,white,black);
- }
-
- grx_text("Power Spectrum" , 0, EQU_Y-21, rgb16(0,0,255), black);
- grx_text("Power Spectrum Story", EQU2D_X+EQU2D_WIDTH-160, EQU_Y-21, rgb16(0,0,255), black);
- grx_text("Waveform" , 0, WAVE_Y-WAVE_HEIGHT-10, rgb16(0,0,255), black);
-}
-
-void compute_params(int *freq,WORD *nsamp)
-{
- if (*freq< 2000)
- {
- cprintf("WARNING: frequency less than 2000Hz\n ---> frequency set to 2000Hz\n");
- *freq = 2000;
- }
- if (*freq<= 8000) { *nsamp = 64; return; } //128
- if (*freq<=16000) { *nsamp = 64; return; } //256
- if (*freq<=24000) { *nsamp = 64; return; } //512
- if (*freq>48000)
- {
- cprintf("WARNING: frequency greather than 48000Hz\n ---> frequency set to 48000Hz\n");
- *freq = 48000;
- }
- if (*freq<=48000) { *nsamp = 64; return; } //1024
-}
-
Index: rel_1_21/thdemo/initfile.c
===================================================================
--- rel_1_21/thdemo/initfile.c (revision 1217)
+++ rel_1_21/thdemo/initfile.c (nonexistent)
@@ -1,146 +0,0 @@
-/*
- * Project: HARTIK (HA-rd R-eal TI-me K-ernel)
- *
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
- * Gerardo Lamastra <gerardo@sssup.it>
- *
- * Authors : Paolo Gai <pj@hartik.sssup.it>
- * (see authors.txt for full list of hartik's authors)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://hartik.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: initfile.c,v 1.1.1.1 2002-09-02 09:37:41 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:41 $
- ------------
-
- System initialization file
-
- h3pi.c
-
- This file is equal to hartik3.c plus the resources module...
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-//#define PI
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "modules/rr.h"
-
-#ifndef PI
-#include "modules/rrsoft.h"
-#endif
-
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-#include "modules/pi.h"
-#include "modules/pc.h"
-#include "modules/srp.h"
-#include "modules/npp.h"
-#include "modules/nop.h"
-
-#include "drivers/keyb.h"
-
-
-/*+ sysyem tick in us +*/
-#define TICK 1000
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-//#define RRTICK 3000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
-#ifdef PI
- EDF_register_level(EDF_ENABLE_ALL);
- CBS_register_level(CBS_ENABLE_ALL, 0);
-#else
- RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_HARD|RRSOFT_ONLY_SOFT);
- RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_SOFT); //cbs
-#endif
-
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
-
- SEM_register_module();
-
- CABS_register_module();
-
- PI_register_module();
- NOP_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- HARTPORT_init();
-
- kern_printf("TIME=%ld\n",sys_gettime(NULL));
- KEYB_init(NULL);
- kern_printf("TIME=%ld\n",sys_gettime(NULL));
-// KEYB_init(NULL);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
-
-#ifdef PI
-void app_mutex_init(mutex_t *m)
-{
- PI_mutexattr_t attr;
-
- PI_mutexattr_default(attr);
-
- mutex_init(m, &attr);
-}
-#else
-void app_mutex_init(mutex_t *m)
-{
- NOP_mutexattr_t attr;
-
- NOP_mutexattr_default(attr);
-
- mutex_init(m, &attr);
-}
-#endif
Index: rel_1_21/thdemo/demo.c
===================================================================
--- rel_1_21/thdemo/demo.c (revision 1217)
+++ rel_1_21/thdemo/demo.c (nonexistent)
@@ -1,260 +0,0 @@
-/* Project: HARTIK 3.0 */
-/* Description: Hard Real TIme Kernel for 386 & higher machines */
-/* Author: Paolo Gai <pgai@rsk.it> */
-/* Advanced Linux Sound Architecture (ALSA) */
-/* Copyright (c) by Jaroslav Kysela <perex@jcu.cz> */
-/* Luca Abeni */
-/* FFTW by M. Frigo and S. G. Johnson */
-
-/* Date: 08/09/1999 */
-
-/* File: fftplay.c */
-/* Revision: 1.00 (Kernel 0.1.4; Library 0.0.9; Util 0.0.4) */
-
-
-
-#include "demo.h"
-
-//#include <kernel/types.h>
-//#include <kernel/model.h>
-#include <kernel/func.h>
-
-//#include <modules/cabs.h>
-
-#include <string.h>
-#include <stdlib.h>
-
-#include <drivers/keyb.h>
-//#include <drivers/crtwin.h>
-#include <drivers/glib.h>
-//#include <drivers/sound.h>
-//#include <ports/rfftw.h>
-
-
-
-/* Informations about the sampling rate and buffers */
-WORD rawdata_nsamples;
-WORD rawdata_buffer_size;
-WORD rawdata_freq;
-
-/* graphic mutex... */
-mutex_t mutex;
-
-/* useful colors... */
-int white;
-int black;
-int red;
-int gray;
-
-void app_mutex_init(mutex_t *m);
-
-
-static void version( void )
-{
- cprintf( "Hartik FFT Play 1.0\n" );
- cprintf( "-----------------------\n" );
- cprintf( "by Paolo Gai 1999\n" );
- cprintf( " <pj@hartik.sssup.it>\n" );
- cprintf( "-----------------------\n" );
-}
-
-void reverse(char s[])
-{
- int c, i, j;
-
- for (i = 0, j = strlen(s)-1; i<j; i++, j--)
- {
- c = s[i];
- s[i] = s[j];
- s[j] = c;
- }
-}
-
-char * itoa(int n, char *s)
-{
- int i, sign;
-
- if ((sign = n) < 0)
- n = -n;
-
- i = 0;
-
- do
- {
- s[i++] = n % 10 + '0';
- } while ((n /= 10) > 0);
-
- if (sign < 0)
- s[i++] = '-';
-
- s[i] = 0;
-
- reverse(s);
-
- return s;
-}
-
-void display_jet(PID i)
-{
- char st[200];
- TIME sum, max;
- int n;
-
- if (jet_getstat(i, &sum, &max, &n, NULL) != -1) {
- if (n==0) n=1;
- sprintf(st, "PID=%2d st=%3d Mean=%5d Max=%5d na=%10s",
- (int)i,
- (int)proc_table[i].status, (int)sum/n, (int)max,
- proc_table[i].name);
- mutex_lock(&mutex);
- grx_text(st, 0, 400+i*8, 255, 0);
- mutex_unlock(&mutex);
- }
-}
-
-
-
-void scenario(int f)
-{
- grx_text("HARTIK 4.0 - LEGO Version" , 0,0, rgb16(0,255,0), black );
- grx_text("Thesis Demo", 0,8, rgb16(0,255,0), black );
-
- #ifdef FFT_ON
- scenario_fftplay(f);
- #endif
-
- #ifdef FRAMEGRABBER_ON
- scenario_framegrabber();
- #endif
-
- #ifdef JET_ON
- scenario_jetcontrol();
- #endif
-
- #ifdef BALL_ON
- scenario_ball();
- #endif
-}
-
-
-void my_close(void *arg)
-{
- grx_close();
-}
-
-
-void endfun(KEY_EVT *k)
-{
- grx_close();
- cprintf("Ctrl-Brk pressed! Ending...\n");
- sys_end();
-}
-
-void zerofun(KEY_EVT *k)
-{
- int i;
- for (i=0; i<MAX_PROC; i++) jet_delstat(i);
-}
-
-void printeventqueue(void *arg)
-{
- struct event *p;
- extern struct event *firstevent;
-
- kern_cli();
- grx_close();
- kern_cli();
- for (p = firstevent; p != NULL; p = p->next) {
- kern_printf("par:%d time:%ld.%ld p:%d handler:%d\n",
- (int)p->par, p->time.tv_sec, p->time.tv_nsec/1000, (int)p, (int)p->handler);
- }
- kern_sti();
-}
-
-int main(int argc, char **argv)
-{
- int modenum;
-
- int f;
-
- KEY_EVT k;
-
- srand(4);
-
- version();
-
- #ifdef FRAMEGRABBER_ON
- if (argc == 1)
- {
- cprintf("type x fftplay <freq>");
- return 0;
- }
-
- f = atoi(argv[1]);
- compute_params(&f,&rawdata_nsamples);
- #endif
-
- keyb_set_map(itaMap);
- k.flag = CNTR_BIT;
- k.scan = KEY_C;
- k.ascii = 'c';
- keyb_hook(k,endfun);
- k.flag = CNTL_BIT;
- k.scan = KEY_C;
- k.ascii = 'c';
- keyb_hook(k,endfun);
- k.flag = ALTL_BIT;
- k.scan = KEY_C;
- k.ascii = 'c';
- keyb_hook(k,zerofun);
- k.flag = 0;
- k.scan = KEY_ENT;
- k.ascii = 13;
- keyb_hook(k,endfun);
-
- sys_atrunlevel(my_close, NULL, RUNLEVEL_BEFORE_EXIT);
-
-
- grx_init();
- modenum = grx_getmode(640, 480, 16);
-
- grx_setmode(modenum);
-
- /* init the graphic mutex */
- app_mutex_init(&mutex);
-
- /* useful colors ... */
- white = rgb16(255,255,255);
- black = rgb16(0,0,0);
- red = rgb16(255,0,0);
- gray = rgb16(128,128,128);
-
- scenario(f/2);
-// grx_close();
-// clear();
- #ifdef FFT_ON
- init_fftplay(f);
- #endif
-
- #ifdef FRAMEGRABBER_ON
- init_framegrabber();
- #endif
-
- #ifdef JET_ON
- init_jetcontrol();
- #endif
-
- #ifdef BALL_ON
- init_ball();
- #endif
-
- group_activate(1);
-
- #ifdef FRAMEGRABBER_ON
- start_framegrabber();
- #endif
-
- return 0;
-}
-
-
Index: rel_1_21/thdemo/fftplay.c
===================================================================
--- rel_1_21/thdemo/fftplay.c (revision 1217)
+++ rel_1_21/thdemo/fftplay.c (nonexistent)
@@ -1,769 +0,0 @@
-/* Project: HARTIK 3.0 */
-/* Description: Hard Real TIme Kernel for 386 & higher machines */
-/* Author: Paolo Gai <pgai@rsk.it> */
-/* Advanced Linux Sound Architecture (ALSA) */
-/* Copyright (c) by Jaroslav Kysela <perex@jcu.cz> */
-/* Luca Abeni */
-/* FFTW by M. Frigo and S. G. Johnson */
-
-/* Date: 08/09/1999 */
-
-/* File: fftplay.c */
-/* Revision: 1.00 (Kernel 0.1.4; Library 0.0.9; Util 0.0.4) */
-
-
-/*
-
-FFTPlay 1.0
------------
-
-This application reads data from the audio microphone and then put it
-to the screen in a graphical oscilloscope-like form (both standard Hartik
-SB driver and Alsa driver can be used).
-
-The application also calculate a FFT on the latest values, and displays
-the power spectrum in tho ways, one like an equalizator, and the other in a
-2D form.
-
-A resolution of 1024x768, 64K colors is used.
-
-The task set is composed by these tasks and functions:
-
-Self buffering functions (SB only)
-----------------------------------
-this function takes the samples read by the mic and then makes a window
-with the last WINDATA_NSAMPLES samples. The window is then put in
-the CAB windata.
-
-Task raw and task mixer (ALSA only)
------------------------------------
-These tasks are used with the Alsa driver; because it doesn't support the
-self-buffering mode, we have to do a forever cycle in witch we have to read
-all the data. Then the data are managed like the self-buffering functions of
-the SB driver or sent to the mixer task (with a STREAM mailbox) which makes
-the window.
-(This approach is not good for realtime...)
-
-Task wave
----------
-This task read the last window and then put it on the screen in a wave form
-on the top of the screen.
-The task's period is set to 40 ms (25 fps).
-
-Task fft
---------
-This task read the last window and then it computes the FFT.
-With the FFT data it computes the power spectrum, whitch is sent to the
-CAB pwrdata.
-The task's period is set to 10 ms (good for the 2D story task).
-This task is the only Hard Task.
-
-Task equ
---------
-This task read the last power spectrum and displays it in a graphical
-form, like a hi-fi equalizator.
-The Histograms can be white or coloured like the equ2D task (see EQU_SHADE)
-The task's period is set to 40 ms (25 fps).
-
-Task equ2D
-----------
-This task read the lasf power spectrum and displays it in a graphical
-one-line form. Each pixel is a power coefficient, and its colour shade
-from black (no power) to red (high power) passing through green and blue.
-The task display the last EQU2D_WIDTH power lines.
-The task's period is set to 10 ms (good for the 2D story task).
-
-****************************************************************************
-TASK LOAD
-****************************************************************************
-
- period wcet
-task tick (ms) us %
---------------------------------------------------------
-sound driver 24->3 12->1.5 200 0.016->0.133
-wave 80 40 11500 0.2875
-fft 20 10 3000 0.3000
-equ 80 40 7000 0.1750
-equ2D 20 10 500 0.0500
- -------------
- 0.812 (last 4)
-*/
-
-#include <ll/ll.h>
-
-#include <kernel/types.h>
-#include <kernel/model.h>
-#include <kernel/func.h>
-
-#include <modules/cabs.h>
-
-#include <string.h>
-#include <stdlib.h>
-#include <semaphore.h>
-
-#include <drivers/keyb.h>
-#include <drivers/crtwin.h>
-#include <drivers/glib.h>
-#include <drivers/sound.h>
-#include <ports/rfftw.h>
-
-/* now the load constants... */
-
-#define WCET_WAVE 11500
-#define WCET_FFT 3000
-#define WCET_EQU 500
-#define WCET_EQU2D 500
-
-#define PERIOD_WAVE 40000
-#define PERIOD_FFT 10000
-#define PERIOD_EQU 40000
-#define PERIOD_EQU2D 10000
-
-/* define if shorts critical sections wanted */
-#define SHORT_CRITICAL_SECTIONS(x) \
- if (!((x)%64)) \
- { \
- sem_post(&mutex); \
- sem_wait(&mutex); \
- }
-
-/* define if you want NRT or SOFT... */
-#define TASK_TYPE SOFT
-//#define TASK_TYPE NRT
-
-
-
-/* Only 4 Debug... */
-/*#define NO_GRX */
-
-/* Samples are 16-bit signed integers */
-typedef short SAMPLE;
-#define MAX_SAMPLE 32768
-
-/* Informations about the sampling rate and buffers */
-WORD rawdata_nsamples;
-WORD rawdata_buffer_size;
-WORD rawdata_freq;
-
-/* Numbers of samples of the sample window */
-#define WINDATA_NSAMPLES 1024
-
-/* task WAVE */
-/* the point (wave_x,wave_y) is on the center left of the area... */
-#define WAVE_NSAMPLES 1024
-#define WAVE_X 0
-#define WAVE_Y 130
-#define WAVE_HEIGHT 80
-
-/* task FFT */
-#define FFT_NSAMPLES WINDATA_NSAMPLES
-#define PWR_NSAMPLES (FFT_NSAMPLES/2+1)
-
-/* task EQU */
-/* the point (equ_x, equ_y) is the top right corner */
-#define EQU_NSAMPLES PWR_NSAMPLES
-#define EQU_X 170
-#define EQU_Y 255
-#define EQU_HEIGHT 170
-#define EQU_SHADE
-
-/* task EQU2D */
-/* the point (equ2d_x, equ2d_y) is the top left corner */
-#define EQU2D_NSAMPLES EQU_NSAMPLES
-#define EQU2D_X 255
-#define EQU2D_Y EQU_Y
-#define EQU2D_WIDTH 768
-#define EQU2D_CLIP 255
-
-/* scenario */
-#define SCENARIO_NLABEL 16
-
-/* Scale factors */
-#define FFT_SCALE (16384.0)
-#define EQU_SCALE (32.0)
-#define EQU2D_SCALE (8.0)
-//#define EQU_SCALE (64.0)
-//#define EQU2D_SCALE (16.0)
-
-
-/* CAB ports... */
-CAB cab_windata; /* a window on the last WINDATA_DIM samples */
-CAB cab_pwrdata; /* the last power spectrum */
-
-/* for the cab_windata */
-typedef struct {
- int start;
- SAMPLE sample[WINDATA_NSAMPLES];
-} window;
-
-/* for the cab_pwrdata */
-typedef struct {
- fftw_real p[PWR_NSAMPLES];
-} power;
-
-/* graphic mutex... */
-sem_t mutex;
-
-// win is global... because is used by raw_infun...
-window win;
-
-
-
-/* useful colors... */
-int white;
-int black;
-int red;
-
-static void version( void )
-{
- cprintf( "Hartik FFT Play 1.0\n" );
- cprintf( "-----------------------\n" );
- cprintf( "by Paolo Gai 1999\n" );
- cprintf( " <pj@hartik.sssup.it>\n" );
- cprintf( "-----------------------\n" );
-}
-
-void reverse(char s[])
-{
- int c, i, j;
-
- for (i = 0, j = strlen(s)-1; i<j; i++, j--)
- {
- c = s[i];
- s[i] = s[j];
- s[j] = c;
- }
-}
-
-char * itoa(int n, char *s)
-{
- int i, sign;
-
- if ((sign = n) < 0)
- n = -n;
-
- i = 0;
-
- do
- {
- s[i++] = n % 10 + '0';
- } while ((n /= 10) > 0);
-
- if (sign < 0)
- s[i++] = '-';
-
- s[i] = 0;
-
- reverse(s);
-
- return s;
-}
-
-
-
-/*
- This is the self-buffering function: read the samples and put their mean
- value in a CAB
-*/
-int raw_infun(void *b)
-{
- int i;
- char *w;
- SAMPLE *audiobuf = (SAMPLE *)b;
-
- for (i=0; i<rawdata_nsamples/2; i++) {
- win.sample[win.start] = audiobuf[i];
- win.start = (win.start+1) % WINDATA_NSAMPLES;
- }
-
- w = cab_reserve(cab_windata);
- memcpy(w, &win, sizeof(window));
- cab_putmes(cab_windata,w);
-
- #if defined(NO_GRX)
- cprintf("X"); //"XXX%d\n",win.sample[win.start]);
- #endif
- return 0;
-}
-
-
-
-void init_rawdata()
-{
- int i;
- char *w;
-
- win.start = 0;
- for (i=0; i<WINDATA_NSAMPLES; i++)
- win.sample[i] = 0;
-
- w = cab_reserve(cab_windata);
- memcpy(w, &win, sizeof(window));
- cab_putmes(cab_windata,w);
-}
-
-
-
-
-
-TASK wave_task()
-{
- window *p;
- int x,y;
- int s;
-
- while(1)
- {
- p = (window *)cab_getmes(cab_windata);
-
- /* let's print the wave */
- sem_wait(&mutex);
- for(x = WAVE_X, s = p->start;
- x < WAVE_X+WAVE_NSAMPLES;
- x++, s = (s+1)%WINDATA_NSAMPLES )
- {
- y = WAVE_Y + (WAVE_HEIGHT * p->sample[s]) / MAX_SAMPLE;
- SHORT_CRITICAL_SECTIONS(x);
- grx_plot(x,y,white);
- }
- sem_post(&mutex);
-
- task_endcycle();
-
- /* let's erase the wave */
- sem_wait(&mutex);
- for(x = WAVE_X, s = p->start;
- x < WAVE_X+WAVE_NSAMPLES;
- x++, s = (s+1)%WINDATA_NSAMPLES )
- {
- y = WAVE_Y + (WAVE_HEIGHT * p->sample[s]) / MAX_SAMPLE;
- SHORT_CRITICAL_SECTIONS(x);
- grx_plot(x,y,black);
- }
- sem_post(&mutex);
-
- cab_unget(cab_windata,(char *)p);
-
- }
-}
-
-
-rfftw_plan plan;
-
-void fft_close(void *arg)
-{
- rfftw_destroy_plan(plan);
-}
-
-
-TASK fft_task()
-{
- fftw_real in[FFT_NSAMPLES], out[FFT_NSAMPLES];
- power power_spectrum;
-
- #if defined(NO_GRX)
- fftw_real max = 0.0;
- #endif
-
- char *m;
-
- int k, i;
-
- window *p;
-
- plan = rfftw_create_plan(FFT_NSAMPLES, FFTW_REAL_TO_COMPLEX, FFTW_ESTIMATE);
-
- sys_atrunlevel(fft_close, NULL, RUNLEVEL_BEFORE_EXIT);
-
- while(1)
- {
- /* Let's prepare the intput FFT data */
- p = (window *)cab_getmes(cab_windata);
-
- for (k = 0, i = p->start;
- k < FFT_NSAMPLES;
- k++, i = (i+1)%WINDATA_NSAMPLES)
- in[k] = p->sample[i]/FFT_SCALE;
-
- cab_unget(cab_windata,(char *)p);
-
- /* zero-padding if needed */
- for (k=WINDATA_NSAMPLES; k < FFT_NSAMPLES; k++)
- in[k] = 0.0;
-
- rfftw_one(plan, in, out);
-
- /* power spectrum computation */
- power_spectrum.p[0] = out[0]*out[0]; /* DC component */
- for (k = 1; k < PWR_NSAMPLES; ++k) /* (k < N/2 rounded up) */
- power_spectrum.p[k] = out[k]*out[k] + out[FFT_NSAMPLES-k]*out[FFT_NSAMPLES-k];
- if (FFT_NSAMPLES % 2 == 0) /* N is even */
- power_spectrum.p[FFT_NSAMPLES/2] = out[FFT_NSAMPLES/2]*out[FFT_NSAMPLES/2]; /* Nyquist freq. */
-
- m = cab_reserve(cab_pwrdata);
- memcpy(m, &power_spectrum, sizeof(power));
- cab_putmes(cab_pwrdata,m);
-
- #if defined(NO_GRX)
- max = 0.0;
- for (k=0; k<PWR_NSAMPLES; k++)
- if (power_spectrum.p[k] > max)
- max = power_spectrum.p[k];
-
- //cprintf("%f %f\n",max,(max / EQU_SCALE) );
- #endif
-
- task_endcycle();
-
- }
-}
-
-/* structure is like the wave task... */
-TASK equ_task()
-{
- power *p;
-
- int x[PWR_NSAMPLES];
- int y;
- int s;
-
- int r,g,b;
-
- while(1)
- {
- p = (power *)cab_getmes(cab_pwrdata);
-
- /* print the lines */
- sem_wait(&mutex);
- for(y = EQU_Y, s = 0;
- s < EQU_NSAMPLES;
- y++, s++ )
- {
- x[s] = (int)(p->p[s] / EQU_SCALE);
-
- if (x[s] > EQU_HEIGHT)
- x[s] = EQU_HEIGHT;
-
- x[s] = EQU_X - x[s];
-
-
- #if defined(EQU_SHADE)
-
- /* like the task equ2d... */
- r = (int)(p->p[s] / EQU2D_SCALE);
- if (r > EQU2D_CLIP)
- r = EQU2D_CLIP;
-
- if (r< 64) g = r * 4;
- else if (r<128) g = (128-r) * 4;
- else g = 0;
-
- if (r<128) b = 0;
- else if (r<192) b = (r-128) * 4;
- else b = (256-r) * 4;
-
- SHORT_CRITICAL_SECTIONS(y);
- grx_line(EQU_X,y,x[s],y,rgb16(r,g,b));
- #else
- SHORT_CRITICAL_SECTIONS(y);
- grx_line(EQU_X,y,x[s],y,white);
- #endif
- }
- sem_post(&mutex);
-
- task_endcycle();
-
- /* erase the lines... */
- sem_wait(&mutex);
- for(y = EQU_Y, s = 0;
- s < EQU_NSAMPLES;
- y++, s++ )
- {
- SHORT_CRITICAL_SECTIONS(y);
- grx_line(EQU_X,y,x[s],y,black);
- }
- sem_post(&mutex);
-
- cab_unget(cab_pwrdata,(char *)p);
-
- }
-}
-
-TASK equ2d_task()
-{
- power *p;
-
- int pwrint;
-
- int x = 0;
-
- int y,s;
-
- int r,g,b;
-
- while(1)
- {
-
- p = (power *)cab_getmes(cab_pwrdata);
-
- /* print the line */
- sem_wait(&mutex);
-
- for(y = EQU2D_Y, s = 0;
- s < EQU2D_NSAMPLES;
- y++, s++ )
- {
- pwrint = (int)(p->p[s] / EQU2D_SCALE);
-
- if (pwrint > EQU2D_CLIP)
- pwrint = EQU2D_CLIP;
-
- r = pwrint;
-
- if (pwrint< 64) g = pwrint * 4;
- else if (pwrint<128) g = (128-pwrint) * 4;
- else g = 0;
-
- if (pwrint<128) b = 0;
- else if (pwrint<192) b = (pwrint-128) * 4;
- else b = (256-pwrint) * 4;
-
- SHORT_CRITICAL_SECTIONS(y);
- grx_plot(EQU2D_X+x,y,rgb16(r,g,b));
- }
-
- x = (x+1) % EQU2D_WIDTH;
- grx_line(EQU2D_X+x,EQU2D_Y,EQU2D_X+x,EQU2D_Y+EQU2D_NSAMPLES,white);
-
- sem_post(&mutex);
-
- cab_unget(cab_pwrdata,(char *)p);
-
- task_endcycle();
- }
-}
-
-TASK prova_task()
-{
- window *p;
-
- while(1)
- {
- p = (window *)cab_getmes(cab_windata);
- cprintf("%d %d %d\t", p->start /*sample[0]*/,p->sample[1],p->sample[2]);
- cab_unget(cab_windata,(char *)p);
-
- task_endcycle();
- }
-}
-
-
-void scenario(int f)
-{
- int i,y;
- char s[6];
-
- grx_line(0,WAVE_Y-WAVE_HEIGHT-1,1023,WAVE_Y-WAVE_HEIGHT-1,red);
- grx_line(0,WAVE_Y+WAVE_HEIGHT+1,1023,WAVE_Y+WAVE_HEIGHT+1,red);
- grx_line(0,EQU_Y-11 ,1023,EQU_Y-11 ,red);
-
-
-
- /* lines near the frequencies */
- grx_line(EQU_X +1,EQU_Y,EQU_X +1,EQU_Y+EQU_NSAMPLES,red);
- grx_line(EQU2D_X-1,EQU_Y,EQU2D_X-1,EQU_Y+EQU_NSAMPLES,red);
-
- for (i=0; i<SCENARIO_NLABEL; i++)
- {
- y = (i*EQU_NSAMPLES)/(SCENARIO_NLABEL-1);
- if (i == SCENARIO_NLABEL-1) y--;
- grx_line(EQU_X +1,EQU_Y+y,EQU_X +10,EQU_Y+y,red);
- grx_line(EQU2D_X-1,EQU_Y+y,EQU2D_X-10,EQU_Y+y,red);
-
- itoa((i*f)/(SCENARIO_NLABEL-1),s);
- grx_text(s,EQU_X+20,EQU_Y+y-8,white,black);
- }
-
- grx_text("FFTPlay 1.0 - by Paolo Gai 1999 <pj@hartik.sssup.it>", 0,8, rgb16(0,255,0), black );
- grx_text("...press ENTER key to exit..." , 0,24, rgb16(0,255,0), black );
-
- grx_text("FFT Power Spectrum", 0 , EQU_Y-21, rgb16(0,0,255), black);
- grx_text("FFT Power Story", EQU2D_X+16, EQU_Y-21, rgb16(0,0,255), black);
- grx_text("Waveform" , 0, WAVE_Y-WAVE_HEIGHT-10, rgb16(0,0,255), black);
-
-}
-
-
-
-
-void compute_params(int *freq,WORD *nsamp, WORD *per)
-{
- if (*freq< 2000)
- {
- cprintf("WARNING: frequency less than 2000Hz\n ---> frequency set to 2000Hz\n");
- *freq = 2000;
- }
- if (*freq<= 8000) { *nsamp = 128; *per = 10; return; }
- if (*freq<=16000) { *nsamp = 256; *per = 10; return; }
- if (*freq<=24000) { *nsamp = 512; *per = 10; return; }
- if (*freq>48000)
- {
- cprintf("WARNING: frequency greather than 48000Hz\n ---> frequency set to 48000Hz\n");
- *freq = 48000;
- }
- if (*freq<=48000) { *nsamp = 1024;*per = 10; return; }
-}
-
-
-
-void my_close(void *arg)
-{
- grx_close();
-}
-
-
-void endfun(KEY_EVT *k)
-{
- cprintf("Ctrl-Brk pressed! Ending...\n");
- sys_end();
-}
-
-int main(int argc, char **argv)
-{
- int modenum;
-
- int f;
-
- /* irq period... */
- WORD period;
-
- KEY_EVT k;
-
- SOFT_TASK_MODEL m3, m4, m5, m6;
-
- PID p3,p4,p5,p6;
-
- version();
-
- if (argc == 1)
- {
- cprintf("type x fftplay <freq>");
- return 0;
- }
-
- f = atoi(argv[1]);
- compute_params(&f,&rawdata_nsamples,&period);
-
- keyb_set_map(itaMap);
- k.flag = CNTR_BIT;
- k.scan = KEY_C;
- k.ascii = 'c';
- keyb_hook(k,endfun);
- k.flag = CNTL_BIT;
- k.scan = KEY_C;
- k.ascii = 'c';
- keyb_hook(k,endfun);
-
- cab_windata = cab_create("windata", sizeof(window), 4);
- cab_pwrdata = cab_create("pwr", sizeof(power), 4);
-
- /* Init the sound lib */
- sound_init((rawdata_nsamples * sizeof(SAMPLE)), NULL);
- sound_info();
-
- /* Init the data used by the raw_infun */
- init_rawdata();
-
- /* Start the self-buffering sampling operation */
- sound_setfun(raw_infun, (int (*)(void *))-1);
- sound_sample(NULL, f, 0, DMA_OP | PCM16 | MYFUN, NULL);
-
- cprintf("Press Enter...");
- while (keyb_getchar() != 13);
-
- sys_atrunlevel(my_close, NULL, RUNLEVEL_BEFORE_EXIT);
-
- #if !defined(NO_GRX)
- grx_init();
- modenum = grx_getmode(1024, 768, 16);
- grx_setmode(modenum);
-
- /* init the graphic mutex */
- sem_init(&mutex, 0, 1);
-
- /* useful colors ... */
- white = rgb16(255,255,255);
- black = rgb16(0,0,0);
- red = rgb16(255,0,0);
-
- scenario(f/2);
-
- #endif
-
- #if !defined(NO_GRX)
- soft_task_default_model(m3);
- soft_task_def_period(m3, PERIOD_WAVE);
- soft_task_def_met(m3, WCET_WAVE);
- soft_task_def_group(m3, 1);
- p3 = task_create("wave", wave_task, &m3, NULL);
- if (p3 == -1) {
- perror("FFTPlay: Could not create task <wave>\n");
- sys_end();
- }
- #endif
-
- soft_task_default_model(m4);
- soft_task_def_period(m4, PERIOD_FFT);
- soft_task_def_met(m4, WCET_FFT);
- soft_task_def_group(m4, 1);
- soft_task_def_stack(m4,32*1024);
- soft_task_def_usemath(m4);
- p4 = task_create("fft", fft_task, &m4, NULL);
- if (p4 == -1) {
- perror("FFTPlay: Could not create task <fft>\n");
- sys_end();
- }
-
- #if !defined(NO_GRX)
- soft_task_default_model(m5);
- soft_task_def_period(m5, PERIOD_EQU);
- soft_task_def_met(m5, WCET_EQU);
- soft_task_def_group(m5, 1);
- soft_task_def_stack(m5,32*1024);
- soft_task_def_usemath(m5);
- p5 = task_create("equ", equ_task, &m5, NULL);
- if (p5 == -1) {
- perror("FFTPlay: Could not create task <equ>\n");
- sys_end();
- }
- #endif
-
- #if !defined(NO_GRX)
- soft_task_default_model(m6);
- soft_task_def_period(m6, PERIOD_EQU2D);
- soft_task_def_met(m6, WCET_EQU2D);
- soft_task_def_group(m6, 1);
- soft_task_def_stack(m6,32*1024);
- soft_task_def_usemath(m6);
- p6 = task_create("equ2D", equ2d_task, &m5, NULL);
- if (p6 == -1) {
- perror("FFTPlay: Could not create task <equ2D>\n");
- sys_end();
- }
- #else
- /* Start the prova task */
- //task_def_wcet(m6,1000);
- //task_activate(task_create("prova",prova_task,TASK_TYPE,PERIODIC,200,&m6));
- #endif
-
- group_activate(1);
-
- /* Wait until the user get bored */
- while (keyb_getchar() != 13);
-
- sys_end();
-
- return 0;
-}
-
-
Index: rel_1_21/thdemo/jetctrl.c
===================================================================
--- rel_1_21/thdemo/jetctrl.c (revision 1217)
+++ rel_1_21/thdemo/jetctrl.c (nonexistent)
@@ -1,200 +0,0 @@
-// JetControl
-
-#include "demo.h"
-#include "kernel/func.h"
-
-TASK jetdummy_task(void *arg)
-{
- TIME now_dummy, last_dummy, diff_dummy, slice;
- struct timespec now, last, diff;
- int x = 0;
- int height;
-
- NULL_TIMESPEC(&last);
- last_dummy = 0;
- for (;;) {
- task_nopreempt();
- jet_getstat(DUMMY_PID, NULL, NULL, NULL, &now_dummy);
- sys_gettime(&now);
- task_preempt();
-
- SUBTIMESPEC(&now, &last, &diff);
- slice = diff.tv_sec * 1000000 + diff.tv_nsec/1000;
- diff_dummy = now_dummy - last_dummy;
-
- height = (int)(JET_DUMMY_HEIGHT*((float)diff_dummy)/((float)slice));
-
- TIMESPEC_ASSIGN(&last, &now);
- last_dummy = now_dummy;
-
- mutex_lock(&mutex);
- grx_line(JET_DUMMY_X+x,JET_DUMMY_Y,
- JET_DUMMY_X+x,JET_DUMMY_Y+height ,black);
- grx_line(JET_DUMMY_X+x,JET_DUMMY_Y+height,
- JET_DUMMY_X+x,JET_DUMMY_Y+JET_DUMMY_HEIGHT,white);
- grx_line(JET_DUMMY_X+(x+1)%JET_DUMMY_WIDTH,JET_DUMMY_Y,
- JET_DUMMY_X+(x+1)%JET_DUMMY_WIDTH,JET_DUMMY_Y+JET_DUMMY_HEIGHT,255);
- mutex_unlock(&mutex);
-
- x = (x+1)%JET_DUMMY_WIDTH;
-
- task_endcycle();
- }
-}
-
-
-TASK jetctrl_task(void *arg)
-{
- char st[50];
- TIME sum, max;
- int n;
-
- PID i;
- int printed = 0;
-
- for (;;) {
- for (i=2, printed=0; i<MAX_PROC && printed<JET_NTASK; i++) {
- if (jet_getstat(i, &sum, &max, &n, NULL) != -1) {
- if (!n) n=1;
- sprintf(st, "%6d %6d %10s", (int)sum/n, (int)max, proc_table[i].name);
- mutex_lock(&mutex);
- grx_text(st, 384, JET_Y_NAME+16+printed*8, gray, black);
- mutex_unlock(&mutex);
- printed++;
- }
- }
- while (printed<JET_NTASK) {
- mutex_lock(&mutex);
- grx_text(" ",
- 384, JET_Y_NAME+16+printed*8, gray, black);
- mutex_unlock(&mutex);
- printed++;
- }
- task_endcycle();
- }
-}
-
-TASK jetslide_task(void *arg)
-{
- TIME sum, curr, max;
-
- TIME total[JET_NTASK];
- int slides[JET_NTASK];
-
- PID i;
- int printed = 0;
-
- for (;;) {
- // Fill the total array in a nonpreemptive section
- task_nopreempt();
- for (i=2, printed=0; i<MAX_PROC && printed<JET_NTASK; i++) {
- if (jet_getstat(i, &sum, NULL, NULL, &curr) != -1) {
- total[printed] = sum+curr;
- printed++;
- }
- }
- task_preempt();
-
- while (printed < JET_NTASK)
- total[printed++] = 0;
-
- // Compute the Max elapsed time
- max = 0;
- for (i=0; i<JET_NTASK; i++)
- if (total[i] > max) max = total[i];
- if (!max) max = 1;
-
- // Compute the slides width
- for (i=0; i<JET_NTASK; i++)
- slides[i] = (int)( (((float)total[i])/max) * JET_SLIDE_WIDTH);
-
- // print the data
- mutex_lock(&mutex);
- for (i=0; i<JET_NTASK; i++) {
- grx_box(JET_SLIDE_X, JET_Y_NAME+16+i*8,
- JET_SLIDE_X+slides[i], JET_Y_NAME+23+i*8, gray);
- grx_box(JET_SLIDE_X+slides[i], JET_Y_NAME+16+i*8,
- JET_SLIDE_X+JET_SLIDE_WIDTH, JET_Y_NAME+23+i*8, black);
- }
-
- while (i<JET_NTASK) {
- grx_box(JET_SLIDE_X, JET_Y_NAME+16+i*8,
- JET_SLIDE_X+JET_SLIDE_WIDTH, JET_Y_NAME+20+i*8, black);
- i++;
- }
- mutex_unlock(&mutex);
- task_endcycle();
- }
-}
-
-
-void scenario_jetcontrol(void)
-{
- grx_text("System load" , 384, 248, rgb16(0,0,255), black);
- grx_line(384,258,639,258,red);
-
- grx_text(" Mean Max Name Slide", 384, JET_Y_NAME, gray, black);
- grx_line(384,JET_Y_NAME+10,639,JET_Y_NAME+10,gray);
-
- grx_rect(JET_DUMMY_X-1, JET_DUMMY_Y-1,
- JET_DUMMY_X+JET_DUMMY_WIDTH, JET_DUMMY_Y+JET_DUMMY_HEIGHT+1, gray);
-
- grx_text("100%", JET_DUMMY_X-40, JET_DUMMY_Y, gray, black);
- grx_text(" 0%", JET_DUMMY_X-40, JET_DUMMY_Y+JET_DUMMY_HEIGHT-8, gray, black);
-
- grx_line(JET_DUMMY_X-1, JET_DUMMY_Y, JET_DUMMY_X-5, JET_DUMMY_Y, gray);
- grx_line(JET_DUMMY_X-1, JET_DUMMY_Y+JET_DUMMY_HEIGHT, JET_DUMMY_X-5, JET_DUMMY_Y+JET_DUMMY_HEIGHT, gray);
- grx_line(384,258,639,258,red);
-}
-
-void init_jetcontrol(void)
-{
- SOFT_TASK_MODEL m3, m4, m5;
-
- PID p3, p4, p5;
-
- soft_task_default_model(m3);
- soft_task_def_level(m3,1);
- soft_task_def_period(m3, PERIOD_JETCTRL);
- soft_task_def_met(m3, WCET_JETCTRL);
- soft_task_def_ctrl_jet(m3);
- soft_task_def_group(m3, 1);
- p3 = task_create("jctrl", jetctrl_task, &m3, NULL);
- if (p3 == -1) {
- grx_close();
- perror("FFTPlay: Could not create task <jetctrl>\n");
- ll_abort(54);
- sys_end();
- }
-
- soft_task_default_model(m4);
- soft_task_def_level(m4,1);
- soft_task_def_period(m4, PERIOD_JETDUMMY);
- soft_task_def_met(m4, WCET_JETDUMMY);
- soft_task_def_group(m4, 1);
- soft_task_def_usemath(m4);
- soft_task_def_ctrl_jet(m4);
- p4 = task_create("jdmy", jetdummy_task, &m4, NULL);
- if (p4 == -1) {
- grx_close();
- perror("FFTPlay: Could not create task <jetdummy>\n");
- ll_abort(54);
- sys_end();
- }
-
- soft_task_default_model(m5);
- soft_task_def_level(m5,1);
- soft_task_def_period(m5, PERIOD_JETSLIDE);
- soft_task_def_met(m5, WCET_JETSLIDE);
- soft_task_def_group(m5, 1);
- soft_task_def_usemath(m5);
- soft_task_def_ctrl_jet(m5);
- p5 = task_create("jsli", jetslide_task, &m5, NULL);
- if (p5 == -1) {
- grx_close();
- perror("FFTPlay: Could not create task <jetslide>\n");
- ll_abort(54);
- sys_end();
- }
-}
-
Index: rel_1_21/thdemo/camera.c
===================================================================
--- rel_1_21/thdemo/camera.c (revision 1217)
+++ rel_1_21/thdemo/camera.c (nonexistent)
@@ -1,516 +0,0 @@
-// framegrabber stuffs
-
-/* File name ......... : ELABOR.C
- * Project............ :
- * Object ............ :
- * Author ............ : Facchinetti Tullio
- * Language .......... : C
- * Compiler .......... : GNU C
- * Operative system .. : MS-DOS/HARTIK
- * Creation data ..... : 04/03/2000
- * Last modify ....... : 19/11/99
- */
-
-
-
-
-#include <kernel/func.h>
-#include <modules/cabs.h>
-#include <stdio.h>
-#include <drivers/pxc.h>
-#include "demo.h"
-
-PID camera_PID;
-PID tracking_PID;
-
-static CAB frameCAB; // CAB di deposito delle immagini
-static CAB trackingCAB; // CAB di deposito delle info di tracking
-
-
-int img_border = 10;
-int window_width = 40;
-int window_height = 40;
-TPixel pix_threshold = 128;
-
-// a 256 grayscale palette
-WORD gray_palette[256];
-
-// the image to be putted on the screen
-WORD converted_image[IMG_COL*IMG_ROW];
-
-TDataObj sequence[N_FRAMES];
-
-
-
-void border_up_function(KEY_EVT key)
-{
- img_border++;
-}
-
-void border_down_function(KEY_EVT key)
-{
- img_border--;
-}
-
-void threshold_up_function(KEY_EVT key)
-{
- char st[50];
- pix_threshold++;
- sprintf(st, "threshold %4d", pix_threshold);
- mutex_lock(&mutex);
- grx_text(st, 400, 100, 255, 0);
- mutex_unlock(&mutex);
-}
-
-void threshold_down_function(KEY_EVT key)
-{
- char st[50];
- pix_threshold--;
- sprintf(st, "threshold %4d", pix_threshold);
- mutex_lock(&mutex);
- grx_text(st, 400, 100, 255, 0);
- mutex_unlock(&mutex);
-}
-
-float distance(unsigned int x1, unsigned int y1,
- unsigned int x2, unsigned int y2)
-{
- return(sqrt(((y2 - y1) * (y2 - y1)) + ((x2 - x1) * (x2 - x1))));
-}
-
-char scan_window_frame(TDataObj *data, TPixel *in_frame,
- unsigned int xc, unsigned int yc, int border)
-{
- unsigned long int offset;
- unsigned int i, j;
- TPixel pix;
- double sum_x = 0.0, sum_y = 0.0;
- unsigned int n_pix = 0;
- int x1, y1, x2, y2; // Must be int!!!
- char found;
-
- data->x1 = N_COL;
- data->y1 = N_ROW;
- data->x2 = data->y2 = 0;
- data->xb = data->yb = -1;
- data->time_stamp = -1;
-
- found = 0;
-
- x1 = MAX_NUM((xc - window_width / 2), (border));
- y1 = MAX_NUM((yc - window_height / 2), (border));
- x2 = MIN_NUM((xc + window_width / 2), (N_COL - border));
- y2 = MIN_NUM((yc + window_height / 2), (N_ROW - border));
-
- for (i = y1; i < y2; i++) {
- for (j = x1; j < x2; j++) {
- offset = i * N_COL + j;
- pix = *(in_frame + offset);
-
-#ifdef __BLACK_ON_WHITE
- // Pixel found (object is black, background is white)
- if (pix < pix_threshold) {
-#else
- // Pixel found (object is white, background is black)
- if (pix > pix_threshold) {
-#endif
- data->time_stamp = sys_gettime(NULL);
- found = 1;
- n_pix++;
- sum_x += j;
- sum_y += i;
-// *(in_frame + offset) = 0;
- if (i < data->y1)
- data->y1 = i;
- if (i > data->y2)
- data->y2 = i;
- if (j < data->x1)
- data->x1 = j;
- if (j > data->x2)
- data->x2 = j;
-
- } else {
-// *(in_frame + offset) = 255;
- }
- }
- }
- data->xb = sum_x / n_pix;
- data->yb = sum_y / n_pix;
- return(found);
-}
-
-char scan_all_frame(TDataObj *data, TPixel *in_frame)
-{
- unsigned long int offset;
- unsigned int i, j;
- TPixel pix;
- double sum_x = 0.0, sum_y = 0.0;
- unsigned int n_pix = 0;
- char found;
-
- data->x1 = N_COL;
- data->y1 = N_ROW;
- data->x2 = data->y2 = 0;
- data->xb = data->yb = -1;
- data->time_stamp = -1;
-
- found = 0;
-
- // In a single image scanning it performs thresholding and computation
- for (i = img_border; i < N_ROW - img_border; i++) {
- for (j = img_border; j < N_COL - img_border; j++) {
- offset = i * N_COL + j;
- pix = *(in_frame + offset);
-
-#ifdef __BLACK_ON_WHITE
- // Pixel found (object is black, background is white)
- if (pix < pix_threshold) {
-#else
- // Pixel found (object is white, background is black)
- if (pix > pix_threshold) {
-#endif
- data->time_stamp = sys_gettime(NULL);
- found = 1;
- n_pix++;
- sum_x += j;
- sum_y += i;
-// *(in_frame + offset) = 0;
- if (i < data->y1)
- data->y1 = i;
- if (i > data->y2)
- data->y2 = i;
- if (j < data->x1)
- data->x1 = j;
- if (j > data->x2)
- data->x2 = j;
-
- } else {
-// *(in_frame + offset) = 255;
- }
- }
- }
- data->xb = sum_x / n_pix;
- data->yb = sum_y / n_pix;
- return(found);
-}
-
-void tracking(int top_frame, int *track_x, int *track_y, int *int_vx, int *int_vy, int time_to)
-{
- float vx, vy;
-
- vx = (float)(sequence[top_frame - 1].xb - sequence[top_frame - 2].xb) /
- (float)(sequence[top_frame - 1].time_stamp - sequence[top_frame - 2].time_stamp);
- vx *= 1000;
-
- vy = (float)(sequence[top_frame - 1].yb - sequence[top_frame - 2].yb) /
- (float)(sequence[top_frame - 1].time_stamp - sequence[top_frame - 2].time_stamp);
- vy *= 1000;
-
- *track_x = sequence[top_frame - 1].xb + vx * time_to;
- *track_y = sequence[top_frame - 1].yb + vy * time_to;
-
- *int_vx = vx * 1000;
- *int_vy = vy * 1000;
-}
-
-TASK tracking_task(void *arg)
-{
-// static unsigned int n_frame = 0;
- char found;
- TPixel *grabber_frame;
- int top_frame = 0;
- TDataObj current;
- TTracking *track;
-
- frameCAB = PXC_GetCab();
-
- grabber_frame = cab_getmes(frameCAB);
-
- // Executes first time
- found = scan_all_frame(&current, grabber_frame);
- if (found) {
- memcpy(&sequence[top_frame], &current, sizeof(TDataObj));
- top_frame++;
- }
-
- cab_unget(frameCAB, grabber_frame);
-
- task_endcycle();
-
- while (1) {
- // Acquisizione immagine corrente
- grabber_frame = (TPixel *)cab_getmes(frameCAB);
- track = (TTracking *)cab_reserve(trackingCAB);
-
- // Estrazione della nuova trasformata sul frame corrente
- if (found) {
- found = scan_window_frame(&current, grabber_frame, current.xb, current.yb, img_border);
- } else {
- found = scan_all_frame(&current, grabber_frame);
- }
-
- track->found = found;
-
- if (found) {
- if (top_frame < N_FRAMES) {
- memcpy(&sequence[top_frame], &current, sizeof(TDataObj));
- top_frame++;
- } else {
- top_frame = 0;
- memcpy(&sequence[top_frame], &current, sizeof(TDataObj));
- }
-
- track->top_frame = top_frame;
- memcpy(&track->current, &current, sizeof(TDataObj));
-
- if (top_frame > 1) {
- tracking(top_frame, &track->predx, &track->predy,
- &track->vx, &track->vy, 100);
- }
- } else {
- track->top_frame = top_frame = 0;
- }
-
- // Release CABs
- cab_putmes(trackingCAB, (char *)track);
- cab_unget(frameCAB, grabber_frame);
-
- task_endcycle();
- }
-}
-
-
-
-
-
-
-
-/*
- *
- *
- *
- * Camera task
- *
- *
- *
- *
- */
-
-
-TASK camera_task(void *arg)
-{
- register int i,j,col,row;
- static unsigned int n_frame = 0;
- TPixel *grabber_frame;
- TTracking *track;
- char st[50];
-
- // Inizializzazione del task
- frameCAB = PXC_GetCab();
-
- while (1) {
- n_frame++;
- sprintf(st, "frame n. %5d", n_frame);
-
- grx_text(st, 400, 224, white, 0);
-
- // Acquisizione immagine corrente
- grabber_frame = cab_getmes(frameCAB);
-
- for (i=1; i<IMG_ROW-1; i++)
- for (j=0; j<IMG_COL; j++) {
- col = (j*(N_COL-1))/(IMG_COL-1);
- row = (i*(N_ROW-1))/(IMG_ROW-1);
- converted_image[i*IMG_COL+j] = gray_palette[*(grabber_frame+row*N_COL+col)];
- }
-
- // Release CAB
- cab_unget(frameCAB, grabber_frame);
-
- for (j=0; j<IMG_COL; j++) {
- converted_image[j] = gray_palette[0];
- converted_image[(IMG_ROW-1)*IMG_COL+j] = gray_palette[0];
- }
-
- mutex_lock(&mutex);
- grx_putimage(IMG_X, IMG_Y, IMG_X+IMG_COL-1, IMG_Y+IMG_ROW-1,
- (BYTE *)converted_image);
- mutex_unlock(&mutex);
-
- track = (TTracking *)cab_getmes(trackingCAB);
-
- if (track->found) {
- mutex_lock(&mutex);
-// sprintf(st, "found: %d", track->found);
-// grx_text(st, 400, 280, 255, 0);
-
- if (track->top_frame > 1) {
- int px, py;
-
-// sprintf(st, "top_frame %5d", track->top_frame);
-// grx_text(st, 400, 270, 255, 0);
-
- if (track->predx < img_border)
- px = img_border;
- else if (track->predx > N_COL-img_border)
- px = N_COL-img_border;
- else
- px = track->predx;
-
- if (track->predy < img_border)
- py = img_border;
- else if (track->predy > N_ROW-img_border)
- py = N_ROW-img_border;
- else
- py = track->predy;
-
- grx_disc(IMG_X+(px*2)/3, IMG_Y+(py*2)/3, 3, 127);
-
-// grx_disc(IMG_X+(current.xb*2)/3, IMG_Y+(current.yb*2)/3, 3, 127);
- grx_rect(IMG_X+(track->current.x1*2)/3, IMG_Y+(track->current.y1*2)/3,
- IMG_X+(track->current.x2*2)/3, IMG_Y+(track->current.y2*2)/3, 127);
-
- sprintf(st, "speed = (%5d, %5d) pix/s", track->vx, track->vy);
- grx_text(st, 400, 232, white, 0);
- }
- mutex_unlock(&mutex);
- }
- cab_unget(trackingCAB, (char *)track);
-
- task_endcycle();
- }
-}
-
-
-
-
-
-/*
- *
- *
- *
- * Framegrabber Initialization
- *
- *
- *
- *
- */
-
-void start_listener(TIME p);
-
-void framegrabber_close(void *arg)
-{
- PXC_Close();
-}
-
-void scenario_framegrabber()
-{
- grx_text("Camera" , 384, WAVE_Y-WAVE_HEIGHT-10, rgb16(0,0,255), black);
- grx_line(384,WAVE_Y-WAVE_HEIGHT-1,639,WAVE_Y-WAVE_HEIGHT-1,red);
-}
-
-void init_framegrabber(void)
-{
- register int i;
- KEY_EVT my_key;
- TIME period;
-
- my_key.ascii = 'a';
- my_key.scan = KEY_A;
- keyb_hook(my_key, (void (*)(KEY_EVT *))threshold_up_function);
-
- my_key.ascii = 'z';
- my_key.scan = KEY_Z;
- keyb_hook(my_key, (void (*)(KEY_EVT *))threshold_down_function);
-
- my_key.ascii = 's';
- my_key.scan = KEY_S;
- keyb_hook(my_key, (void (*)(KEY_EVT *))border_up_function);
-
- my_key.ascii = 'x';
- my_key.scan = KEY_X;
- keyb_hook(my_key, (void (*)(KEY_EVT *))border_down_function);
-
- // Aggiusta la palette
- for (i = 0; i < 256; i++)
- gray_palette[i] = rgb16(i,i,i);
- //for (i = 0; i < 256; i++)
- // grx_setcolor(i, i/4, i/4, i/4);
-
- mutex_lock(&mutex);
-// grx_text("Grabber enabled: no test!", 10, 10, 255, 0);
-
- // Some messages on screen
-// grx_text("A-Z change threshold", 400, 240, 255, 0);
-// grx_text("S-X change window borders", 400, 250, 255, 0);
- mutex_unlock(&mutex);
-
- period = PXC_Initiate(4);
-
- if (!period) {
- grx_close();
- cprintf("Problemi nell'inizializzazione del framegrabber\n");
- halt();
- sys_end();
- } else {
- TTracking *trdata;
- // tracking CAB init
- trackingCAB = cab_create("trackingCAB", sizeof(TTracking), 3);
- trdata = (TTracking *)cab_reserve(trackingCAB);
- trdata->found = 0;
- cab_putmes(trackingCAB, (char *)trdata);
-
- start_listener(period);
- }
-
- sys_atrunlevel(framegrabber_close, NULL, RUNLEVEL_BEFORE_EXIT);
-}
-
-
-void start_listener(TIME period)
-{
- SOFT_TASK_MODEL m1, m2;
-
- soft_task_default_model(m1);
- soft_task_def_level(m1,1);
- soft_task_def_met(m1,WCET_TRACKING);
- soft_task_def_usemath(m1);
-// soft_task_def_aperiodic(m1);
- soft_task_def_period(m1,(PERIOD_TRACKING));
- soft_task_def_group(m1,1);
- soft_task_def_ctrl_jet(m1);
- soft_task_def_skip_arrivals(m1);
- tracking_PID = task_create("track", tracking_task, &m1, NULL);
- if (tracking_PID == -1) {
- grx_close();
- perror("FFTPlay: Could not create task <tra>\n");
- ll_abort(54);
- perror("FFTPlay: Could not create task <tracking>\n");
- sys_end();
- }
-
- soft_task_default_model(m2);
- soft_task_def_level(m2,1);
- soft_task_def_met(m2,WCET_CAMERA);
- soft_task_def_usemath(m2);
-// soft_task_def_aperiodic(m2);
- soft_task_def_period(m2,PERIOD_CAMERA);
- soft_task_def_group(m2,1);
- soft_task_def_ctrl_jet(m2);
-// soft_task_def_skip_arrivals(m2);
- camera_PID = task_create("cam", camera_task, &m2, NULL);
- if (camera_PID == -1) {
- grx_close();
- perror("FFTPlay: Could not create task <came>\n");
- ll_abort(54);
- perror("FFTPlay: Could not create task <camera>\n");
- sys_end();
- }
-
-}
-
-void start_framegrabber()
-{
-// PXC_Push_Listener(tracking_PID,2);
- PXC_Start();
-}
Index: rel_1_21/thdemo/demo.h
===================================================================
--- rel_1_21/thdemo/demo.h (revision 1217)
+++ rel_1_21/thdemo/demo.h (nonexistent)
@@ -1,280 +0,0 @@
-
-
-#include <ll/ll.h>
-#include <kernel/types.h>
-#include <kernel/descr.h>
-#include <math.h>
-#include <drivers/glib.h>
-#include <drivers/keyb.h>
-
-
-#define FFT_ON
-#define FRAMEGRABBER_ON
-#define JET_ON
-#define BALL_ON
-
-/*
- *
- * WCET, Periods and Models
- *
- */
-
-
-/* define if you want NRT or SOFT... */
-#define TASK_TYPE SOFT
-//#define TASK_TYPE NRT
-
-// on Celeron 366
-#define WCET_WAVE 450
-#define WCET_FFT 722
-#define WCET_EQU 1000
-#define WCET_EQU2D 318
-
-#define PERIOD_WAVE 40000
-#define PERIOD_FFT 3000
-#define PERIOD_EQU 40000
-#define PERIOD_EQU2D 3000
-
-
-
-
-#define WCET_TRACKING 4000
-#define WCET_CAMERA 7000
-
-#define PERIOD_TRACKING 40000
-#define PERIOD_CAMERA 40000
-
-
-#define WCET_JETCTRL 2600
-#define WCET_JETDUMMY 1000
-#define WCET_JETSLIDE 1000
-
-#define PERIOD_JETCTRL 100000
-#define PERIOD_JETDUMMY 100000
-#define PERIOD_JETSLIDE 100000
-
-
-#define WCET_BALL 60
-
-#define PERIOD_BALL 10000
-
-
-/*
- *
- * Soundcard related defines
- *
- */
-
-
-/* Samples are 16-bit signed integers */
-typedef short SAMPLE;
-#define MAX_SAMPLE 32768
-
-
-
-/*
- *
- * FFT defines
- *
- */
-
-/* Numbers of samples of the sample window */
-#define WINDATA_NSAMPLES 512
-
-/* task WAVE */
-/* the point (wave_x,wave_y) is on the center left of the area... */
-#define WAVE_NSAMPLES 384
-#define WAVE_X 0
-#define WAVE_Y 64
-#define WAVE_HEIGHT 32
-
-/* task FFT */
-#define FFT_NSAMPLES 512
-#define PWR_NSAMPLES (FFT_NSAMPLES/2+1)
-
-/* task EQU */
-/* the point (equ_x, equ_y) is the top right corner */
-#define EQU_NSAMPLES PWR_NSAMPLES
-#define EQU_X 64
-#define EQU_Y 128
-#define EQU_HEIGHT 64
-#define EQU_SHADE
-
-/* task EQU2D */
-/* the point (equ2d_x, equ2d_y) is the top left corner */
-#define EQU2D_NSAMPLES EQU_NSAMPLES
-#define EQU2D_X 128
-#define EQU2D_Y EQU_Y
-#define EQU2D_WIDTH 255
-#define EQU2D_CLIP 255
-
-/* scenario */
-#define SCENARIO_NLABEL 16
-
-/* Scale factors */
-#define FFT_SCALE (16384.0)
-#define EQU_SCALE (32.0)
-#define EQU2D_SCALE (8.0)
-//#define EQU_SCALE (64.0)
-//#define EQU2D_SCALE (16.0)
-
-
-
-/* Informations about the sampling rate and buffers */
-extern WORD rawdata_nsamples;
-extern WORD rawdata_buffer_size;
-extern WORD rawdata_freq;
-
-
-
-/*
- *
- * Global Stuffs
- *
- */
-
-/* graphic mutex... */
-extern mutex_t mutex;
-
-/* useful colors... */
-extern int white;
-extern int black;
-extern int red;
-extern int gray;
-
-/* define if shorts critical sections wanted */
-#define SHORT_CRITICAL_SECTIONS(x) \
- if (!((x)%64)) \
- { \
- mutex_lock(&mutex); \
- mutex_unlock(&mutex); \
- }
-
-void init_fftplay(int freq);
-void init_framegrabber();
-void init_jetcontrol();
-void init_ball(void);
-void start_framegrabber();
-
-
-void scenario_jetcontrol(void);
-void scenario_fftplay(int f);
-void scenario_framegrabber();
-void scenario_ball();
-
-void compute_params(int *freq,WORD *nsamp);
-
-char * itoa(int n, char *s);
-
-/*
- *
- * Framegrabber stuffs
- *
- */
-
-// if defined... object black on a white background
-#ifndef __BLACK_ON_WHITE
-#define __BLACK_ON_WHITE
-#endif
-
-#define ABS_NUM(a) ((a >= 0) ? a : -a)
-#define MIN_NUM(a, b) ((a < b) ? a : b)
-#define MAX_NUM(a, b) ((a > b) ? a : b)
-
-
-// Cols and rows of the framegrabber image
-#define N_COL 384
-#define N_ROW 288
-#define N_BPS 8 // Bits per pixel
-#define N_GRIGI 256
-
-#define N_FRAMES 100
-
-/* pixel of the video image */
-#define IMG_COL 256
-#define IMG_ROW 192
-
-/* position of the video image */
-#define IMG_X 384
-#define IMG_Y 32
-
-// I singoli pixel sono caratteri a 8 bit
-typedef unsigned char TPixel;
-
-typedef struct {
- int x1, y1;
- int x2, y2;
- int xb, yb;
- TIME time_stamp;
-} TDataObj;
-
-typedef struct {
- int found;
- int top_frame;
- int vx,vy;
- int predx;
- int predy;
- TDataObj current;
-} TTracking;
-
-
-float distance(unsigned int x1, unsigned int y1,
- unsigned int x2, unsigned int y2);
-
-char scan_all_frame(TDataObj *data, TPixel *in_frame);
-
-char scan_window_frame(TDataObj *data, TPixel *in_frame,
- unsigned int xc, unsigned int yc, int border);
-
-void threshold_up_function(KEY_EVT key);
-void threshold_down_function(KEY_EVT key);
-
-void border_up_function(KEY_EVT key);
-void border_down_function(KEY_EVT key);
-
-void tracking(int top_frame, int *track_x, int *track_y, int *int_vx, int *int_vy, int time_to);
-
-TASK elab_image_TASK(void);
-
-
-
-/*
- *
- * JETCONTROL stuffs
- *
- */
-
-#define JET_NTASK 18
-#define JET_Y_NAME 320
-
-#define DUMMY_PID 1
-
-#define JET_DUMMY_WIDTH 210
-#define JET_DUMMY_HEIGHT 40
-
-/* the point (x, y) is the top left corner */
-#define JET_DUMMY_X 428
-#define JET_DUMMY_Y 264
-
-#define JET_SLIDE_WIDTH 50
-#define JET_SLIDE_X 576
-
-
-
-
-/*
- *
- * BALL stuffs
- *
- */
-
-// x and y corners are specified whithout consider a border of 3 pixels
-#define BALL_Y 475 /* position of the floor */
-#define BALL_HEIGHT 70 /* initial height of the ball */
-#define BALL_XMIN 3 /* min position X of the ball */
-#define BALL_XMAX 380 /* max position X of the ball */
-#define BALL_VELX 5. /* horizontal ball velocity */
-#define BALL_VYMIN 11. /* velocit… minima per suono */
-#define BALL_MAX_P 50 /* max number of balls */
-
-#define BALL_GROUP 2 /* task group of the balls */
Index: rel_1_21/thdemo/readme.txt
===================================================================
--- rel_1_21/thdemo/readme.txt (revision 1217)
+++ rel_1_21/thdemo/readme.txt (nonexistent)
@@ -1,17 +0,0 @@
-PJ's Thesis demo
-----------------
-
-This is my Thesis Demo. The demo works correctly on my PC :-)
-(a celeron 366 Mhz), Probably It will have some problems with other slower PCs.
-
-The demo simply reads data from the soundblaster, then print the sound wave, compute a power spectrun and display it on the screen.
-
-Then there is another few tasks that reads data from a framegrabber and track a black image on a white board.
-
-Moreover, there are some noise balls to test the system in overload conditions, and there are finally a few tasks that displays the system load.
-
-If you have any problems using this demo, please contact pj@sssup.it
-
-bye
-
-Paolo
Index: rel_1_21/thdemo/camera2.c
===================================================================
--- rel_1_21/thdemo/camera2.c (revision 1217)
+++ rel_1_21/thdemo/camera2.c (nonexistent)
@@ -1,424 +0,0 @@
-// framegrabber stuffs
-
-/* File name ......... : ELABOR.C
- * Project............ :
- * Object ............ :
- * Author ............ : Facchinetti Tullio
- * Language .......... : C
- * Compiler .......... : GNU C
- * Operative system .. : MS-DOS/HARTIK
- * Creation data ..... : 04/03/2000
- * Last modify ....... : 19/11/99
- */
-
-
-
-
-#include <kernel/func.h>
-#include <modules/cabs.h>
-#include <stdio.h>
-#include <drivers/pxc.h>
-#include "demo.h"
-
-PID image_elab_PID;
-TIME periodo;
-CAB PXC_CAB;
-
-static CAB frameCAB; // CAB di deposito delle immagini
-static TDataObj current, older;
-
-// extern in INIT.C
-int img_border = 10;
-int window_width = 40;
-int window_height = 40;
-
-// a 256 grayscale palette
-WORD gray_palette[256];
-
-// the image to be putted on the screen
-WORD converted_image[IMG_COL*IMG_ROW];
-
-
-#ifdef __BLACK_ON_WHITE
-TPixel pix_threshold = 64;
-#else
-TPixel pix_threshold = 243;
-#endif
-
-
-// Global for testing!!!
-static char st[50];
-TIME before;
-
-TDataObj sequence[N_FRAMES];
-int top_frame = 0;
-
-double dist, speed;
-
-static TPixel *grabber_frame;
-
-void border_up_function(KEY_EVT key)
-{
- img_border++;
-}
-
-void border_down_function(KEY_EVT key)
-{
- img_border--;
-}
-
-void threshold_up_function(KEY_EVT key)
-{
- pix_threshold++;
- sprintf(st, "threshold %4d", pix_threshold);
- mutex_lock(&mutex);
- //grx_text(st, 400, 300, 255, 0);
- mutex_unlock(&mutex);
-}
-
-void threshold_down_function(KEY_EVT key)
-{
- pix_threshold--;
- sprintf(st, "threshold %4d", pix_threshold);
- mutex_lock(&mutex);
- //grx_text(st, 400, 300, 255, 0);
- mutex_unlock(&mutex);
-}
-
-float distance(unsigned int x1, unsigned int y1,
- unsigned int x2, unsigned int y2)
-{
- return(sqrt(((y2 - y1) * (y2 - y1)) + ((x2 - x1) * (x2 - x1))));
-}
-
-char scan_window_frame(TDataObj *data, TPixel *in_frame,
- unsigned int xc, unsigned int yc, int border)
-{
- unsigned long int offset;
- unsigned int i, j;
- TPixel pix;
- double sum_x = 0.0, sum_y = 0.0;
- unsigned int n_pix = 0;
- int x1, y1, x2, y2; // Must be int!!!
- char found;
-
- data->x1 = N_COL;
- data->y1 = N_ROW;
- data->x2 = data->y2 = 0;
- data->xb = data->yb = -1;
- data->time_stamp = -1;
-
- found = 0;
-
- x1 = MAX_NUM((xc - window_width / 2), (border));
- y1 = MAX_NUM((yc - window_height / 2), (border));
- x2 = MIN_NUM((xc + window_width / 2), (N_COL - border));
- y2 = MIN_NUM((yc + window_height / 2), (N_ROW - border));
-
- for (i = y1; i < y2; i++) {
- for (j = x1; j < x2; j++) {
- offset = i * N_COL + j;
- pix = *(in_frame + offset);
-
-#ifdef __BLACK_ON_WHITE
- // Pixel found (object is black, background is white)
- if (pix < pix_threshold) {
-#else
- // Pixel found (object is white, background is black)
- if (pix > pix_threshold) {
-#endif
- data->time_stamp = sys_gettime(NULL);
- found = 1;
- n_pix++;
- sum_x += j;
- sum_y += i;
- *(in_frame + offset) = 0;
- if (i < data->y1)
- data->y1 = i;
- if (i > data->y2)
- data->y2 = i;
- if (j < data->x1)
- data->x1 = j;
- if (j > data->x2)
- data->x2 = j;
-
- } else {
- *(in_frame + offset) = 255;
- }
- }
- }
- data->xb = sum_x / n_pix;
- data->yb = sum_y / n_pix;
- return(found);
-}
-
-char scan_all_frame(TDataObj *data, TPixel *in_frame)
-{
- unsigned long int offset;
- unsigned int i, j;
- TPixel pix;
- double sum_x = 0.0, sum_y = 0.0;
- unsigned int n_pix = 0;
- char found;
-
- data->x1 = N_COL;
- data->y1 = N_ROW;
- data->x2 = data->y2 = 0;
- data->xb = data->yb = -1;
- data->time_stamp = -1;
-
- found = 0;
-
- // In a single image scanning it performs thresholding and computation
- for (i = img_border; i < N_ROW - img_border; i++) {
- for (j = img_border; j < N_COL - img_border; j++) {
- offset = i * N_COL + j;
- pix = *(in_frame + offset);
-
-#ifdef __BLACK_ON_WHITE
- // Pixel found (object is black, background is white)
- if (pix < pix_threshold) {
-#else
- // Pixel found (object is white, background is black)
- if (pix > pix_threshold) {
-#endif
- data->time_stamp = sys_gettime(NULL);
- found = 1;
- n_pix++;
- sum_x += j;
- sum_y += i;
- *(in_frame + offset) = 0;
- if (i < data->y1)
- data->y1 = i;
- if (i > data->y2)
- data->y2 = i;
- if (j < data->x1)
- data->x1 = j;
- if (j > data->x2)
- data->x2 = j;
-
- } else {
- *(in_frame + offset) = 255;
- }
- }
- }
- data->xb = sum_x / n_pix;
- data->yb = sum_y / n_pix;
- return(found);
-}
-
-void tracking(int *track_x, int *track_y, int time_to)
-{
- float vx, vy;
-
- vx = (float)(sequence[top_frame - 1].xb - sequence[top_frame - 2].xb) /
- (float)(sequence[top_frame - 1].time_stamp - sequence[top_frame - 2].time_stamp);
- vx *= 1000000;
-
- vy = (float)(sequence[top_frame - 1].yb - sequence[top_frame - 2].yb) /
- (float)(sequence[top_frame - 1].time_stamp - sequence[top_frame - 2].time_stamp);
- vy *= 1000000;
-
- (*track_x) = sequence[top_frame - 1].xb + vx * time_to;
- (*track_y) = sequence[top_frame - 1].yb + vy * time_to;
-
- sprintf(st, "speed = (%5d, %5d) pix/s", (int)vx, (int)vy);
- mutex_lock(&mutex);
- //grx_text(st, 400, 410, 255, 0);
- mutex_unlock(&mutex);
-}
-
-void put_frame(TPixel *frame)
-{
- register int i,j,col,row;
-
- for (i=0; i<IMG_ROW; i++)
- for (j=0; j<IMG_COL; j++) {
- col = (j*(N_COL-1))/(IMG_COL-1);
- row = (i*(N_ROW-1))/(IMG_ROW-1);
- converted_image[i*IMG_COL+j] = gray_palette[*(frame+row*N_COL+col)];
- }
-
- mutex_lock(&mutex);
- //grx_putimage(IMG_X, IMG_Y, IMG_X+IMG_COL-1, IMG_Y+IMG_ROW-1,
- // (BYTE *)converted_image);
- mutex_unlock(&mutex);
-}
-
-
-TASK elab_image_TASK(void)
-{
-// register int i, j;
- static unsigned int n_frame = 0;
- char found;
- int pred_x, pred_y;
-
- // Inizializzazione del task
- frameCAB = PXC_GetCab();
-
- grabber_frame = cab_getmes(frameCAB);
-
- // Executes first time
- found = scan_all_frame(&current, grabber_frame);
-// found =0;
- if (found) {
- memcpy(&sequence[top_frame], &current, sizeof(TDataObj));
- top_frame++;
- }
-
- cab_unget(frameCAB, grabber_frame);
-
- task_endcycle();
-
- while (1) {
-
-// before = sys_gettime(NULL);
-
- n_frame++;
- sprintf(st, "frame n. %5d", n_frame);
-
- mutex_lock(&mutex);
- //grx_text(st, 400, 290, 255, 0);
-
- sprintf(st, "top_frame %5d", top_frame);
- //grx_text(st, 400, 270, 255, 0);
-
- sprintf(st, "found: %d!", found);
- //grx_text(st, 400, 280, 255, 0);
- mutex_unlock(&mutex);
-
- // Acquisizione immagine corrente
- grabber_frame = cab_getmes(frameCAB);
-
- // copy current in older
- memcpy(&older, &current, sizeof(TDataObj));
-
- // Estrazione della nuova trasformata sul frame corrente
- if (found) {
- found = scan_window_frame(&current, grabber_frame, current.xb, current.yb, img_border);
- } else {
- found = scan_all_frame(&current, grabber_frame);
- }
-
-// //grx_putimage(0, 0, N_COL - 1, N_ROW - 1, grabber_frame);
- put_frame(grabber_frame);
-
- if (found) {
- if (top_frame < N_FRAMES) {
- memcpy(&sequence[top_frame], &current, sizeof(TDataObj));
- top_frame++;
- } else {
- top_frame = 0;
- memcpy(&sequence[top_frame], &current, sizeof(TDataObj));
- }
-
- if (top_frame > 1) {
- tracking(&pred_x, &pred_y, 100);
-
- mutex_lock(&mutex);
-// //grx_disc(IMG_X+(pred_x*2)/3, IMG_Y+(pred_y*2)/3, 3, 127);
-
- //grx_disc(IMG_X+(current.xb*2)/3, IMG_Y+(current.yb*2)/3, 3, 127);
- //grx_rect(IMG_X+(current.x1*2)/3, IMG_Y+(current.y1*2)/3,
- // IMG_X+(current.x2*2)/3, IMG_Y+(current.y2*2)/3, 127);
- mutex_unlock(&mutex);
-
- }
- } else {
- top_frame = 0;
- }
-
- // Release CAB
- cab_unget(frameCAB, grabber_frame);
-
-// sprintf(st, "durata = %3d ms", (int)(sys_gettime(NULL) - before)/1000);
-// mutex_lock(&mutex);
-// //grx_text(st, 400, 400, 255, 0);
-// mutex_unlock(&mutex);
-
- task_endcycle();
- }
-}
-
-
-void start_listener(void);
-
-void framegrabber_close(void *arg)
-{
- PXC_Close();
-}
-
-void init_framegrabber(void)
-{
- register int i;
- KEY_EVT my_key;
-
- my_key.ascii = 'a';
- my_key.scan = KEY_A;
- keyb_hook(my_key, (void (*)(KEY_EVT *))threshold_up_function);
-
- my_key.ascii = 'z';
- my_key.scan = KEY_Z;
- keyb_hook(my_key, (void (*)(KEY_EVT *))threshold_down_function);
-
- my_key.ascii = 's';
- my_key.scan = KEY_S;
- keyb_hook(my_key, (void (*)(KEY_EVT *))border_up_function);
-
- my_key.ascii = 'x';
- my_key.scan = KEY_X;
- keyb_hook(my_key, (void (*)(KEY_EVT *))border_down_function);
-
- // Aggiusta la palette
- for (i = 0; i < 256; i++)
- gray_palette[i] = rgb16(i,i,i);
- //for (i = 0; i < 256; i++)
- // grx_setcolor(i, i/4, i/4, i/4);
-
- mutex_lock(&mutex);
-// grx_text("Grabber enabled: no test!", 10, 10, 255, 0);
-
- // Some messages on screen
- //grx_text("A-Z change threshold", 400, 240, 255, 0);
- //grx_text("S-X change window borders", 400, 250, 255, 0);
- mutex_unlock(&mutex);
-
- periodo = PXC_Initiate(3);
- PXC_CAB = PXC_GetCab();
-
- if (!periodo) {
- //grx_close();
- cprintf("Problemi nell'inizializzazione del driver\n");
- sys_end();
- } else {
- start_listener();
- }
-
- sys_atrunlevel(framegrabber_close, NULL, RUNLEVEL_BEFORE_EXIT);
-}
-
-
-void start_listener(void)
-{
- SOFT_TASK_MODEL m_soft;
-
- soft_task_default_model(m_soft);
- soft_task_def_met(m_soft,IMAGING_WCET);
- soft_task_def_usemath(m_soft);
- soft_task_def_aperiodic(m_soft);
- soft_task_def_period(m_soft,(periodo*3));
- soft_task_def_group(m_soft,1);
- soft_task_def_ctrl_jet(m_soft);
-
- image_elab_PID = task_create("imaging", elab_image_TASK, &m_soft, NULL);
-
-/* task_activate( image_elab_PID);
- PXC_Push_Listener(image_elab_PID,2);
- PXC_Start();*/
-}
-
-void start_framegrabber()
-{
- PXC_Push_Listener(image_elab_PID,2);
- PXC_Start();
-}
Index: rel_1_21/thdemo/ball.c
===================================================================
--- rel_1_21/thdemo/ball.c (revision 1217)
+++ rel_1_21/thdemo/ball.c (nonexistent)
@@ -1,164 +0,0 @@
-/*--------------------------------------------------------------*/
-/* SIMULATION OF JUMPING BALLS */
-/*--------------------------------------------------------------*/
-
-/* CVS $Id: ball.c,v 1.1.1.1 2002-09-02 09:37:41 pj Exp $ */
-
-
-#include "demo.h"
-#include <kernel/func.h>
-#include <stdlib.h>
-
-#define R 2 /* dimension of a ball */
-#define G 9.8 /* acceleration of gravity */
-
-static int ballexit = 0;
-static int npc = 0; /* number of tasks created */
-
-/*--------------------------------------------------------------*/
-/* Periodic task for ball simulation */
-/*--------------------------------------------------------------*/
-
-TASK palla(int i)
-{
-int x, y; /* coordinate grafiche pallina */
-int ox, oy; /* vecchia posizione pallina */
-int x0, y0; /* posizione iniziale X pallina */
-float vx, vy; /* velocit… della pallina */
-float vy0; /* velocita' pallina al primo rimbalzo */
-float ty, tx; /* variabile temporale */
-float dt; /* incremento temporale */
-
- y = oy = y0 = BALL_HEIGHT;
- x = ox = x0 = BALL_XMIN;
-
- vy0= sqrt(2. * G * (float)BALL_HEIGHT);
- vy = 0;
- vx = BALL_VELX + rand()%9;
- tx = 0;
- ty = 0;
- dt = ((float)PERIOD_BALL)/100000;
-
- while (1) {
- y = y0 + vy*ty - .5*G*ty*ty;
- x = x0 + vx * tx;
-
- if (y < 0) {
- y = 0;
-
- if (vy == 0.0)
- vy = vy0;
- else if (vy < BALL_VYMIN)
- vy = vy0 * (1.0 - (rand()%50)/100.0);
- else
- vy = 0.9 * vy;
-
- ty = 0.0;
- y0 = 0;
- }
-
- if (x > BALL_XMAX) {
- tx = 0.0;
- x0 = BALL_XMAX;
- vx = -vx;
- x = x0 + vx * tx;
- }
-
- if (x < BALL_XMIN) {
- tx = 0.0;
- x0 = BALL_XMIN;
- vx = -vx;
- x = x0 + vx * tx;
- }
-
- mutex_lock(&mutex);
- grx_disc(ox, oy, R, 0);
- ox = x;
- oy = BALL_Y - y;
- mutex_unlock(&mutex);
-
- if (ballexit) {
- npc--;
- return 0;
- }
-
- mutex_lock(&mutex);
- grx_disc(ox, oy, R, i);
- mutex_unlock(&mutex);
-
- {
- int xxx;
- for (xxx=0; xxx<10000; xxx++);
- }
- ty += dt;
- tx += dt;
- task_endcycle();
- }
-}
-
-void killball(KEY_EVT *k)
-{
- ballexit = 1;
-}
-
-void ballfun(KEY_EVT *k)
-{
- SOFT_TASK_MODEL mp;
- int r,g,b;
- PID pid;
-
- if (npc == BALL_MAX_P) return;
-
- ballexit = 0;
-
- r = 64 + rand()%192;
- g = 64 + rand()%192;
- b = 64 + rand()%192;
-
- soft_task_default_model(mp);
- soft_task_def_level(mp,1);
- soft_task_def_ctrl_jet(mp);
- soft_task_def_arg(mp, (void *)rgb16(r,g,b));
- soft_task_def_group(mp, BALL_GROUP);
- soft_task_def_met(mp, WCET_BALL);
- soft_task_def_period(mp,PERIOD_BALL);
- soft_task_def_usemath(mp);
- pid = task_create("palla", palla, &mp, NULL);
- if (pid != NIL) {
- task_activate(pid);
- npc++;
- }
-}
-
-
-/*--------------------------------------------------------------*/
-/* MAIN process */
-/*--------------------------------------------------------------*/
-
-void scenario_ball()
-{
- grx_text("Noise", 0, BALL_Y-BALL_HEIGHT-15, rgb16(0,0,255), black);
- grx_line(0,BALL_Y-BALL_HEIGHT-6,383,BALL_Y-BALL_HEIGHT-6,red);
-}
-
-void init_ball(void)
-{
- KEY_EVT k;
-
- mutex_lock(&mutex);
- grx_rect(BALL_XMIN-R-1, BALL_Y-BALL_HEIGHT-R-1,
- BALL_XMAX+R+1, BALL_Y+R+1, rgb16(0,200,0));
- mutex_unlock(&mutex);
-
- k.flag = 0;
- k.scan = KEY_SPC;
- k.ascii = ' ';
- keyb_hook(k,ballfun);
-
- k.flag = 0;
- k.scan = KEY_BKS;
- k.ascii = ' ';
- keyb_hook(k,killball);
-}
-
-/*--------------------------------------------------------------*/
Index: rel_1_21/thdemo/camera4.c
===================================================================
--- rel_1_21/thdemo/camera4.c (revision 1217)
+++ rel_1_21/thdemo/camera4.c (nonexistent)
@@ -1,168 +0,0 @@
-// framegrabber stuffs
-
-/* File name ......... : ELABOR.C
- * Project............ :
- * Object ............ :
- * Author ............ : Facchinetti Tullio
- * Language .......... : C
- * Compiler .......... : GNU C
- * Operative system .. : MS-DOS/HARTIK
- * Creation data ..... : 04/03/2000
- * Last modify ....... : 19/11/99
- */
-
-
-
-
-#include <kernel/func.h>
-#include <modules/cabs.h>
-#include <stdio.h>
-#include <drivers/pxc.h>
-#include "demo.h"
-
-PID image_elab_PID;
-TIME periodo;
-CAB PXC_CAB;
-
-static CAB frameCAB; // CAB di deposito delle immagini
-static TDataObj current, older;
-
-// extern in INIT.C
-int img_border = 10;
-int window_width = 40;
-int window_height = 40;
-
-// a 256 grayscale palette
-WORD gray_palette[256];
-
-// the image to be putted on the screen
-WORD converted_image[IMG_COL*IMG_ROW];
-
-
-#ifdef __BLACK_ON_WHITE
-TPixel pix_threshold = 64;
-#else
-TPixel pix_threshold = 243;
-#endif
-
-
-// Global for testing!!!
-static char st[50];
-TIME before;
-
-TDataObj sequence[N_FRAMES];
-int top_frame = 0;
-
-double dist, speed;
-
-static TPixel *grabber_frame;
-
-void put_frame(TPixel *frame)
-{
- register int i,j,col,row;
-
- for (i=1; i<IMG_ROW-1; i++)
- for (j=0; j<IMG_COL; j++) {
- col = (j*(N_COL-1))/(IMG_COL-1);
- row = (i*(N_ROW-1))/(IMG_ROW-1);
- converted_image[i*IMG_COL+j] = gray_palette[*(frame+row*N_COL+col)];
- }
-
- for (j=0; j<IMG_COL; j++) {
- converted_image[j] = gray_palette[0];
- converted_image[(IMG_ROW-1)*IMG_COL+j] = gray_palette[0];
- }
-
- mutex_lock(&mutex);
- grx_putimage(IMG_X, IMG_Y, IMG_X+IMG_COL-1, IMG_Y+IMG_ROW-1,
- (BYTE *)converted_image);
- mutex_unlock(&mutex);
-}
-
-
-TASK elab_image_TASK(void)
-{
-// register int i, j;
- static unsigned int n_frame = 0;
- char found;
- int pred_x, pred_y;
-
- // Inizializzazione del task
- frameCAB = PXC_GetCab();
-
- while (1) {
- n_frame++;
- sprintf(st, "frame n. %5d", n_frame);
-
- mutex_lock(&mutex);
- grx_text(st, 400, 290, 255, 0);
- mutex_unlock(&mutex);
-
- // Acquisizione immagine corrente
- grabber_frame = cab_getmes(frameCAB);
-
- put_frame(grabber_frame);
-
- // Release CAB
- cab_unget(frameCAB, grabber_frame);
-
- task_endcycle();
- }
-}
-
-
-void start_listener(void);
-
-void framegrabber_close(void *arg)
-{
- PXC_Close();
-}
-
-void init_framegrabber(void)
-{
- register int i;
- KEY_EVT my_key;
-
- // Aggiusta la palette
- for (i = 0; i < 256; i++)
- gray_palette[i] = rgb16(i,i,i);
-
- periodo = PXC_Initiate(3);
- PXC_CAB = PXC_GetCab();
-
- if (!periodo) {
- grx_close();
- cprintf("Problemi nell'inizializzazione del driver\n");
- sys_end();
- } else {
- start_listener();
- }
-
- sys_atrunlevel(framegrabber_close, NULL, RUNLEVEL_BEFORE_EXIT);
-}
-
-
-void start_listener(void)
-{
- SOFT_TASK_MODEL m_soft;
-
- soft_task_default_model(m_soft);
- soft_task_def_met(m_soft,IMAGING_WCET);
- soft_task_def_usemath(m_soft);
- soft_task_def_aperiodic(m_soft);
- soft_task_def_period(m_soft,(periodo));
- soft_task_def_group(m_soft,1);
- soft_task_def_ctrl_jet(m_soft);
-
- image_elab_PID = task_create("imaging", elab_image_TASK, &m_soft, NULL);
-
-/* task_activate( image_elab_PID);
- PXC_Push_Listener(image_elab_PID,2);
- PXC_Start();*/
-}
-
-void start_framegrabber()
-{
- PXC_Push_Listener(image_elab_PID,1);
- PXC_Start();
-}
Index: rel_1_21/thdemo/ball2.c
===================================================================
--- rel_1_21/thdemo/ball2.c (revision 1217)
+++ rel_1_21/thdemo/ball2.c (nonexistent)
@@ -1,156 +0,0 @@
-/*--------------------------------------------------------------*/
-/* SIMULATION OF JUMPING BALLS */
-/*--------------------------------------------------------------*/
-
-/* CVS $Id: ball2.c,v 1.1.1.1 2002-09-02 09:37:41 pj Exp $ */
-
-
-#include "demo.h"
-#include <kernel/func.h>
-#include <stdlib.h>
-//#include <drivers/glib.h>
-//#include <drivers/keyb.h>
-//#include <math.h>
-
-#define R 2 /* dimension of a ball */
-#define G 9.8 /* acceleration of gravity */
-#define BASE 30 /* position of the floor */
-#define TOP 80 /* initial height of the ball */
-#define XMIN 3 /* min position X of the ball */
-#define XMAX 380 /* max position X of the ball */
-#define VELX 5. /* horizontal ball velocity */
-#define VMIN 11. /* velocit… minima per suono */
-#define ESC 27 /* ASCII code of ESCAPE key */
-#define MAX_P 50 /* max number of balls */
-
-double v0[MAX_P]; /* impact velocity with floor */
-
-/*--------------------------------------------------------------*/
-/* Periodic task for ball simulation */
-/*--------------------------------------------------------------*/
-
-TASK palla(int i)
-{
-int x, y; /* coordinate grafiche pallina */
-int ox, oy; /* vecchia posizione pallina */
-int x0; /* posizione iniziale X pallina */
-float vx, vy; /* velocit… della pallina */
-float t, tx; /* variabile temporale */
-float dt; /* incremento temporale */
-double arg; /* variabile di appoggio */
-
- y = oy = TOP;
- x = ox = x0 = XMIN;
-
- arg = 2. * G * (float)TOP;
- vy = sqrt(arg);
- vx = VELX;// + rand()%10;
- tx = 0.0;
- t = vy / G;
- dt = 0.1;
-
- while (1) {
- y = TOP + vy*t - .5*G*t*t;
- x = x0 + vx * tx;
-
- if (y < BASE) {
- t = 0.0;
- v0[i] = .9 * v0[i];
- // if (v0[i]<VMIN) {
-
- // v0[i] = sqrt(2. * G * (float)TOP);
- // v0[i] = sqrt(arg);// * (1-((float)(rand()%20))/100);
- //vx = vx + rand()%5 - 2;
- //tx = 0.0;
- //x0 = x;
- // }
-
- vy = v0[i];
- y = TOP + vy*t - .5*G*t*t;
- }
-
-
- if (x > XMAX) {
- tx = 0.0;
- x0 = XMAX;
- vx = -vx;
- x = x0 + vx * tx;
- }
-
- if (x < XMIN) {
- tx = 0.0;
- x0 = XMIN;
- vx = -vx;
- x = x0 + vx * tx;
- }
- y = 480-y;
-
- mutex_lock(&mutex);
- grx_disc(ox, oy, R, 0);
- grx_disc(x, y, R, i);
- mutex_unlock(&mutex);
-
- oy = y; ox = x;
- t += dt;
- tx += dt;
- task_endcycle();
- }
-}
-
-
-void ballfun(KEY_EVT *k)
-{
- static int npc = 0; /* number of tasks created */
- SOFT_TASK_MODEL mp;
- int r,g,b;
- PID pid;
-
- if (npc == MAX_P) return;
-
- r = 64 + rand()%192;
- g = 64 + rand()%192;
- b = 64 + rand()%192;
-
- soft_task_default_model(mp);
- soft_task_def_level(mp,1);
- soft_task_def_ctrl_jet(mp);
- soft_task_def_arg(mp, rgb16(r,g,b));
- soft_task_def_group(mp, 1);
- soft_task_def_met(mp, WCET_BALL);
- soft_task_def_period(mp,PERIOD_BALL);
- soft_task_def_usemath(mp);
- pid = task_create("palla", palla, &mp, NULL);
- if (pid != NIL) {
- task_activate(pid);
- npc++;
- }
-}
-
-
-/*--------------------------------------------------------------*/
-/* MAIN process */
-/*--------------------------------------------------------------*/
-
-
-void init_ball(void)
-{
- char c; /* character from keyboard */
- int i; /* pressed number */
- double arg; /* temporary variable */
- KEY_EVT k;
-
- arg = 2. * G * (float)TOP;
- for (i=0; i<MAX_P; i++) v0[i] = sqrt(arg);
-
- mutex_lock(&mutex);
- grx_rect(XMIN-R-1, 480-TOP-BASE-R-1, XMAX+R+1, 480-BASE+R+1, 14);
- mutex_unlock(&mutex);
-
- k.flag = 0;
- k.scan = KEY_SPC;
- k.ascii = ' ';
- keyb_hook(k,ballfun);
-
-}
-
-/*--------------------------------------------------------------*/
Index: rel_1_21/thdemo/makefile
===================================================================
--- rel_1_21/thdemo/makefile (revision 1217)
+++ rel_1_21/thdemo/makefile (nonexistent)
@@ -1,17 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS= demo
-
-include $(BASE)/config/example.mk
-
-demo:
- make -f $(SUBMAKE) APP=demo INIT= OTHEROBJS="fft.o camera.o initfile.o jetctrl.o ball.o" SHARKOPT="__FFT__ __OLDCHAR__ __PXC__ __GRX__"
-
-
Index: rel_1_21/oscilloscopio/osc.c
===================================================================
--- rel_1_21/oscilloscopio/osc.c (revision 1217)
+++ rel_1_21/oscilloscopio/osc.c (nonexistent)
@@ -1,871 +0,0 @@
-/*****************************************************************************
-* Filename: osc.c *
-* Author: Ghiro Andrea,Franchino Gianluca *
-* Date: 09/2003 *
-* Description: Oscilloscope and function generator for PCI6025E *
-*----------------------------------------------------------------------------*
-* Notes: Connect DAC output pin (21) to ADC input pins (3-18) and *
-* watch the waveforms. *
-*****************************************************************************/
-
-/* This file is part of the S.Ha.R.K. Project - http://shark.sssup.it
- *
- * Copyright (C) 2003 Ghiro Andrea,Franchino Gianluca
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#include <drivers/glib.h>
-#include <drivers/keyb.h>
-#include <math.h>
-#include <drivers/pci6025e/dac.h>
-#include <modules/hartport.h>
-#include <modules/srp.h>
-#include "adc.h"
-
-#define MAX_VAL 500
-#define NUM_POINT 20
-#define GRAPH_PERIOD 50000
-#define GRAPH_WCET 2000
-#define WAVE_WCET 200
-#define OSC_WCET 200
-#define TASK_GROUP 1
-#define CHFREQ_PERIOD 5000
-#define CHFREQ_WCET 200
-
-void drawInterface(void);
-void endfun(KEY_EVT *);
-void close_event(void *);
-void createWaves(void);
-void change_disp(KEY_EVT *);
-void change_mode(KEY_EVT *);
-void change_wave(KEY_EVT *);
-void change_passo(KEY_EVT *);
-void change_channel(KEY_EVT *);
-void inc(KEY_EVT *);
-void dec(KEY_EVT *);
-
-TASK video_body(int);
-TASK wave_body(int);
-TASK osc_body(int);
-TASK chfreq_body(int);
-
-HARD_TASK_MODEL wave0;
-HARD_TASK_MODEL chfreq;
-HARD_TASK_MODEL osc;
-SRP_RES_MODEL r;
-SRP_mutexattr_t a;
-
-PID wave0_pid;
-PID chfreq_pid;
-PID osc_pid;
-
-mutex_t m1 ;
-
-int black = rgb16(0,0,0),
- white = rgb16(255, 255, 255);
-
-int wave = 3,
- varfun = 0,
- varosc = 0,
- flagch = 0,
- channel = 0;
-
-float vfun = 0,
- vosc = 2.5,
- ffun = 1,
- tbase = 75,
- yr[MAX_VAL],
- yrdac[NUM_POINT],
- ys[MAX_VAL],
- ysdac[NUM_POINT],
- yq[MAX_VAL],
- yqdac[NUM_POINT];
-
-BYTE disp = 0,
- modefun= 0,
- modeosc= 0,
- lib = 0,
- sys = 0;
-
-short yoscold[MAX_VAL];
-
-unsigned int period= 1e6/NUM_POINT;
-unsigned int oscperiod = 1500;
-
-int main(int argc, char **argv)
-{
- KEY_EVT k;
-
- HARD_TASK_MODEL video;
- PID video_pid;
-
- int modenum;
-
- k.flag = CNTR_BIT;
- k.scan = KEY_X;
- k.ascii = 'x';
- keyb_hook(k, endfun);
-
- k.flag = CNTL_BIT;
- keyb_hook(k, endfun);
-
- k.flag = 0;
- k.scan = KEY_A;
- k.ascii = 'a';
- keyb_hook(k, change_disp);
-
- k.flag = 0;
- k.scan = KEY_S;
- k.ascii = 's';
- keyb_hook(k, change_mode);
-
- k.flag = 0;
- k.scan = KEY_F;
- k.ascii = 'f';
- keyb_hook(k, change_wave);
-
- k.flag = 0;
- k.scan = KEY_G;
- k.ascii = 'g';
- keyb_hook(k, change_wave);
-
- k.flag = 0;
- k.scan = KEY_H;
- k.ascii = 'H';
- keyb_hook(k, change_wave);
-
- k.flag = 0;
- k.scan = KEY_D;
- k.ascii = 'd';
- keyb_hook(k, change_passo);
-
- k.flag = 0;
- k.scan = KEY_J;
- k.ascii = 'j';
- keyb_hook(k, change_channel);
-
- k.flag = 0;
- k.scan = 78;
- k.ascii = 43;
- keyb_hook(k, inc);
-
- k.flag = 0;
- k.scan = 74;
- k.ascii = 45;
- keyb_hook(k, dec);
-
- sys_atrunlevel(close_event, NULL, RUNLEVEL_BEFORE_EXIT);
-
- /*initialize the srp mutex*/
- SRP_mutexattr_default(a);
- mutex_init(&m1,&a);
-
- hard_task_default_model(wave0);
- hard_task_def_wcet(wave0, WAVE_WCET);
- hard_task_def_mit(wave0, period);
- hard_task_def_group(wave0, TASK_GROUP);
- if( (wave0_pid = task_create("Wave 0", wave_body, &wave0, NULL)) == NIL )
- {
- sys = 10;
- sys_end();
- }
-
- hard_task_default_model(video);
- hard_task_def_wcet(video, GRAPH_WCET);
- hard_task_def_mit(video, GRAPH_PERIOD);
- hard_task_def_group(video, TASK_GROUP);
- SRP_res_default_model(r,2);
- if( (video_pid = task_createn("Video task", video_body, &video, &r,
- SRP_usemutex(&m1), NULL))== NIL )
- {
- sys = 12;
- sys_end();
- }
-
- hard_task_default_model(osc);
- hard_task_def_wcet(osc, OSC_WCET);
- hard_task_def_mit(osc, oscperiod);
- hard_task_def_group(osc, TASK_GROUP);
- SRP_res_default_model(r,1);
- if((osc_pid = task_createn("osc task", osc_body, &osc, &r,
- SRP_usemutex(&m1), NULL))== NIL )
- {
- sys = 11;
- sys_end();
- }
-
- hard_task_default_model(chfreq);
- hard_task_def_wcet(chfreq, CHFREQ_WCET);
- hard_task_def_mit(chfreq, CHFREQ_PERIOD);
- hard_task_def_group(chfreq, TASK_GROUP);
- if( (chfreq_pid = task_create("chfreq", chfreq_body, &chfreq, NULL)) == NIL )
- {
- sys = 13;
- sys_end();
- }
-
- if(grx_init() == -1)
- {
- sys = 30;
- sys_end();
- }
-
- if((modenum = grx_getmode(800, 600, 16)) == -1)
- {
- sys = 31;
- sys_end();
- }
-
- if(pci_init() == -1)
- {
- sys = 20;
- sys_end();
- }
-
- if(!reMap())
- {
- sys = 21;
- sys_end();
- }
-
- grx_setmode(modenum);
-
- createWaves();
- drawInterface();
-
- DAC_Init(); //Program the DAQ-STC AOTM
- Configure_Board(channel); //Configure the board with the channel settings.
- ADC_Init(); //Program the DAQ-STC AITM
-
- group_activate(TASK_GROUP);
-
- return 0;
-}
-
-void endfun(KEY_EVT *k)
-{
- sys_end();
-}
-
-void close_event(void *arg)
-{
- grx_close();
- switch(sys)
- {
- case 0: cprintf("Regular End!\n"); break;
- case 10: cprintf("Cannot create <wave 0> task!\n"); break;
- case 11: cprintf("Cannot create <osc> task!\n"); break;
- case 12: cprintf("Cannot create <video> task!\n"); break;
- case 13: cprintf("Cannot create <chfreq> task!\n"); break;
- case 14: cprintf("Cannot kill <wave 0> task!\n"); break;
- case 15: cprintf("Cannot kill <osc> task\n");break;
- case 20: cprintf("No PCI bus found!\n"); break;
- case 21: cprintf("No NATIONAL PCI E-Series board found on PCI bus!\n");break;
- case 30: cprintf("Cannot start graphic envirorment!\n"); break;
- case 31: cprintf("800x600x16 video mode not supported!\n");break;
- default: cprintf("Unknown exit event!\n"); break;
- }
-}
-
-/*
-* kill wave0 or osc when frequency change
-*/
-
-TASK chfreq_body(int w)
-{
- PORT p;
- char msg[1];
- p = port_create("activation",1,1,STREAM,WRITE);
-
- while(1)
- {
- if(flagch == 1)
- {
- if(task_kill(wave0_pid)!=0)
- {
- sys=14;
- sys_end();
- }
- hard_task_def_mit(wave0, period);
- if( (wave0_pid = task_create("wave 0", wave_body, &wave0, NULL))== NIL )
- {
- sys = 10;
- sys_end();
- }
- flagch = 0;
- task_activate(wave0_pid);
- }
-
- if(flagch == 2)
- {
- if(task_kill(osc_pid)!=0)
- {
- sys=15;
- sys_end();
- }
- hard_task_def_mit(osc, oscperiod);
- if( (osc_pid = task_createn("osc", osc_body, &osc, &r,
- SRP_usemutex(&m1), NULL))== NIL )
- {
- sys = 11;
- sys_end();
- }
- flagch = 0;
- msg[0]=1;
- port_send(p,msg,NON_BLOCK);
- }
- task_endcycle();
- }
-}
-
-/*
-* acquisition of input samples
-*/
-
-TASK osc_body(int wv)
-{
- int i = 0 ;
- short y = 0;
- WORD Status = 0;
-
- while(1)
- {
- mutex_lock(&m1);
- if(lib)
- {
- mutex_unlock(&m1);
- AI_Start_The_Acquisition();
- do {
- Status = DAQ_STC_Windowed_Mode_Read(AI_STATUS_1);
- if (!( (Status & 0x1000) == 0x1000 ) )
- y = Immediate_Readw(ADC_DATA_READ);
- } while(((Status & 0x1000) == 0x1000));
- y = (2.5/vosc)*(y-40)/20;
- if(abs(y)<=100)
- {
- grx_plot(19+i,483-y,rgb16(255,255,0));
- }
- yoscold[i]=y;
- i=(i+1)%500;
- if(i==0)
- {
- mutex_lock(&m1);
- lib=0;
- mutex_unlock(&m1);
- task_testcancel();
- }
- }
- else mutex_unlock(&m1);
- task_endcycle();
- }
-}
-
-/*
-* Sends out waves' samples
-*/
-
-TASK wave_body(int wv)
-{
- int i = 0;
- int y = 0;
- while(1)
- {
- if(wave==0)
- {
- y=vfun*(yrdac[i]*20);
- y=(y & 0x0FFF);
- }
- if(wave==1)
- {
- y=vfun*(ysdac[i]*20);
- y=(y & 0x0FFF);
- }
- if(wave==2)
- {
- y=vfun*(yqdac[i]*20);
- y=(y & 0x0FFF);
- }
- DAC_output(DAC1,y);
- i = (i + 1) % NUM_POINT;
- task_testcancel();
- task_endcycle();
- }
-}
-
-/*
-* Shows setting,wave,grid and clear display
-*/
-
-TASK video_body(int dummy)
-{
- BYTE dispold = 1,
- modefunold = 1,
- modeoscold = 1,
- new = 0;
-
- int waveold = 3,
- varfunold = 2,
- i = 0,
- y = 0,
- channelold = 16,
- yold[MAX_VAL];
-
-
- float vfunold = 1,
- voscold = 1,
- ffunold = 0,
- tbaseold = 1;
-
- char st[20];
-
- PORT p;
- char msg[1];
- p=port_connect("activation",1,STREAM,READ);
-
- while(1)
- {
- mutex_lock(&m1);
- if(!lib)
- {
- mutex_unlock(&m1);
- for(i=0;i<MAX_VAL;i++)
- {
- if(abs(yoscold[i])<=100)
- {
- grx_plot(19+i,483-yoscold[i],rgb16(0,0,0));
- }
- }
- //OSCILLOSCOPE GRID
- grx_line(19, 385, 519, 385, rgb16(150,150,150));
- grx_line(19, 410, 519, 410, rgb16(150,150,150));
- grx_line(19, 435, 519, 435, rgb16(150,150,150));
- grx_line(19, 460, 519, 460, rgb16(150,150,150));
- grx_line(19, 485, 519, 485, rgb16(150,150,150));
- grx_line(19, 510, 519, 510, rgb16(150,150,150));
- grx_line(19, 535, 519, 535, rgb16(150,150,150));
- grx_line(19, 560, 519, 560, rgb16(150,150,150));
- grx_line(19, 585, 519, 585, rgb16(150,150,150));
- grx_line(19, 385, 19, 585, rgb16(150,150,150));
- grx_line(69, 385, 69, 585, rgb16(150,150,150));
- grx_line(119, 385, 119, 585, rgb16(150,150,150));
- grx_line(169, 385, 169, 585, rgb16(150,150,150));
- grx_line(219, 385, 219, 585, rgb16(150,150,150));
- grx_line(269, 385, 269, 585, rgb16(150,150,150));
- grx_line(319, 385, 319, 585, rgb16(150,150,150));
- grx_line(369, 385, 369, 585, rgb16(150,150,150));
- grx_line(419, 385, 419, 585, rgb16(150,150,150));
- grx_line(469, 385, 469, 585, rgb16(150,150,150));
- grx_line(519, 385, 519, 585, rgb16(150,150,150));
- mutex_lock(&m1);
- lib=1;
- mutex_unlock(&m1);
- port_receive(p,msg,NON_BLOCK);
- if(msg[0]==1)
- {
- task_activate(osc_pid);
- }
- }
- else mutex_unlock(&m1);
- if(disp != dispold)
- {
- dispold = disp;
- grx_disc(780,120,10,rgb16(255*(1-disp),0,0));
- grx_disc(780,390,10,rgb16(0,255*disp,0));
- }
-
- if(modefun != modefunold)
- {
- modefunold = modefun;
- grx_disc(780,237,5,rgb16(255*(1-modefun),0,0));
- grx_disc(780,267,5,rgb16(255*(modefun),0,0));
- }
-
- if(modeosc != modeoscold)
- {
- modeoscold = modeosc;
- grx_disc(780,502,5,rgb16(0,255*(1-modeosc),0));
- grx_disc(780,532,5,rgb16(0,255*(modeosc),0));
- }
-
- if(wave != waveold)
- {
- waveold = wave;
- grx_disc(730,127,3,rgb16(127*(1-wave)*(2-wave),0,0));
- grx_disc(730,142,3,rgb16(254*wave*(2-wave),0,0));
- grx_disc(730,157,3,rgb16(254*wave*(wave-1),0,0));
- new=1;
- }
-
- if(varfun != varfunold)
- {
- varfunold = varfun;
- grx_disc(675,292,3,rgb16(42*(1-varfun)*(2-varfun)*(3-varfun),0,0));
- grx_disc(775,292,3,rgb16(126*varfun*(2-varfun)*(3-varfun),0,0));
- grx_disc(675,307,3,rgb16(252*varfun*(varfun-1)*(3-varfun),0,0));
- grx_disc(775,307,3,rgb16(42*varfun*(varfun-1)*(varfun-2),0,0));
- }
-
-
- if(channel != channelold)
- {
- sprintf(st,"%2d",channel);
- grx_text(" ",660,470,black,white);
- grx_text(st,660,470,black,white);
- }
-
- if(ffun != ffunold)
- {
- ffunold = ffun;
- sprintf(st,"%10f",ffun);
- grx_text(" ",660,265,black,white);
- grx_text(st,660,265,black,white);
- }
-
- if(tbase != tbaseold)
- {
- tbaseold = tbase;
- sprintf(st,"%10f",tbase);
- grx_text(" ",660,530,black,white);
- grx_text(st,660,530,black,white);
- }
-
- if(vfun != vfunold)
- {
- vfunold = vfun;
- sprintf(st,"%3.1f",vfun);
- grx_text(" ",660,235,black,white);
- grx_text(st,660,235,black,white);
- new=1;
- }
-
- if(vosc != voscold)
- {
- voscold = vosc;
- sprintf(st,"%3.1f",vosc);
- grx_text(" ",660,500,black,white);
- grx_text(st,660,500,black,white);
- }
-
- if(new)
- {
- for(i=0; i<MAX_VAL; i++)
- {
- grx_plot(19+i, 215-yold[i],rgb16(0, 0, 0));
- }
-
- //FUNCTION GENERATOR GRID
- grx_line(22, 115, 525, 115, rgb16(150,150,150));
- grx_line(22, 165, 525, 165, rgb16(150,150,150));
- grx_line(22, 265, 525, 265, rgb16(150,150,150));
- grx_line(22, 315, 525, 315, rgb16(150,150,150));
- grx_line(19, 110, 19, 320, rgb16(150,150,150));
- grx_line(14, 215, 525, 215, rgb16(150,150,150));
-
- if(wave==0)
- {
- for(i=0;i<MAX_VAL;i++)
- {
- y=(vfun)*yr[i];
- grx_plot(19+i,215-y,rgb16(255,255,0));
- yold[i]=y;
- }
- }
-
- if(wave==1)
- {
- for(i=0;i<MAX_VAL;i++)
- {
- y=(vfun)*ys[i];
- grx_plot(19+i,215-y,rgb16(255,255,0));
- yold[i]=y;
- }
- }
-
- if(wave==2)
- {
- for(i=0;i<MAX_VAL;i++)
- {
- y=(vfun)*yq[i];
- grx_plot(19+i,215-y,rgb16(255,255,0));
- yold[i]=y;
- }
- }
-
- new=0;
- }
- task_endcycle();
- }
-}
-
-/*
-* create wave triangular,sinusoidal and square
-*/
-
-void createWaves(void)
-{
- float u=0,
- qdac= 2*PI/NUM_POINT,
- q = 2*PI/(MAX_VAL/2);
-
- register int i;
-
- BYTE direction=0;
-/*create the vectors for the video task*/
- for(i=0;i<MAX_VAL/2;i++)
- {
- yr[i]=yr[i+MAX_VAL/2]=u/10;
- if(!direction) u += 1.613;
- else u -= 1.613;
- if(u >= 100) direction = 1;
- if(u <= -101) direction = 0;
-
- ys[i]=ys[i+MAX_VAL/2] = (sin(i*q)*10);
-
- if((i>=(MAX_VAL/4) && i< (MAX_VAL/2))) yq[i]=yq[i+MAX_VAL/2]=0;
- else yq[i]=yq[i+MAX_VAL/2]=10;
- }
-/*create the vectors for the wave_body task*/
- direction=0;
- u = 0;
- for(i=0;i<NUM_POINT;i++)
- {
- yrdac[i]=u/10;
- if(!direction) u += (400/NUM_POINT);
- else u -= (400/NUM_POINT);
- if(u >= 100) direction = 1;
- if(u <= -100) direction = 0;
-
- ysdac[i]=(sin(i*qdac)*10);
-
- if((i>=(NUM_POINT/2) && i<NUM_POINT)) yqdac[i]=0;
- else yqdac[i]=10;
- }
-}
-
-/*
-* select device (0 function generator,1 oscilloscope)
-*/
-
-void change_disp(KEY_EVT *k)
-{
- if(disp) disp = 0;
- else disp = 1;
-}
-
-/*
-* select volt or frequency
-*/
-
-void change_mode(KEY_EVT *k)
-{
- if(disp && modeosc) modeosc = 0;
- else
- if(disp && !modeosc) modeosc = 1;
- else
- if(!disp && modefun) modefun = 0;
- else
- if(!disp && !modefun) modefun =1;
-}
-
-/*
-* select wave (0 triangular,1 sinusoindal,2 square
-*/
-
-void change_wave(KEY_EVT *k)
-{
- if(!disp && k->ascii =='f')
- {
- wave=0;
- }
- else
- if(!disp && k->ascii =='g')
- {
- wave=1;
- }
- else
- if(!disp && k->ascii =='h')
- {
- wave=2;
- }
-}
-
-/*
-* select increase or decrease step
-*/
-
-void change_passo(KEY_EVT *k)
-{
- if(!disp && modefun)
- {
- varfun=(varfun+1)%2;
- }
-}
-
-/*
-* select input channel
-*/
-
-void change_channel(KEY_EVT *k)
-{
- if(disp)
- {
- channel=(channel+1)%16;
- Configure_Board(channel);
- }
-}
-
-/*
-* increase selected variable
-*/
-
-void inc(KEY_EVT *k)
-{
- if(disp && modeosc && tbase<300)
- {
- flagch=2;
- switch(varosc)
- {
- case(0): tbase = tbase*2;
- oscperiod=(tbase/50)*1000;
- break;
- }
- }
- else
- if(disp && !modeosc && vosc<10) vosc += 0.1;
- else
- if(!disp && modefun && ffun<(1e6/(1020*NUM_POINT))-1)
- {
- flagch=1;
- switch(varfun)
- {
- case(0): ffun += 1;
- period = 1e6/(NUM_POINT*ffun);
- break;
- case(1): ffun += 10;
- period = 1e6/(NUM_POINT*ffun);
- break;
- }
- }
- else
- if(!disp && !modefun && vfun<10) vfun += 0.1;
-}
-
-/*
-* decrease selected variable
-*/
-
-void dec(KEY_EVT *k)
-{
- if(disp && modeosc && tbase> 75)
- {
- flagch=2;
- switch(varosc)
- {
- case(0): tbase = tbase/2;
- oscperiod=(tbase/50)*1000;
- break;
- }
- }
- else
- if(disp && !modeosc && vosc> 0.2) vosc -= 0.1;
- else
- if(!disp && modefun && ffun> 0)
- {
- flagch = 1;
- switch(varfun)
- {
- case(0): ffun -= 1;
- if(ffun == 0) period =1e6;
- else
- period = 1e6/(NUM_POINT*ffun);
- break;
- case(1): ffun -= 10;
- if(ffun == 0) period =1e6;
- else
- period = 1e6/(NUM_POINT*ffun);
- break;
- }
- }
- else
- if(!disp && !modefun && vfun> -10) vfun -= 0.1;
-}
-
-/*
-* draw interface
-*/
-
-void drawInterface(void)
-{
- //TITLE
- grx_rect(1, 1, 799, 69, rgb16(105, 0, 105));
- grx_rect(2, 2, 798, 68, rgb16(155, 0, 155));
- grx_rect(3, 3, 797, 67, rgb16(205, 0, 205));
- grx_rect(4, 4, 796, 66, rgb16(255, 0, 255));
- grx_text("Oscilloscope and function generator for PCI6025E",7, 10, rgb16(50, 255, 50), black);
- grx_text("Pin ADC 3-18, DAC 21",7, 25, rgb16(0, 255, 255), black);
- grx_text("A for select Oscilloscope or Function generator",7, 40, rgb16(0, 255, 255), black);
- grx_text("CTRL-X for Exit", 7, 55, rgb16(200, 200, 0), black);
-
- //FUNCTION GENERATOR
- grx_text("FUNCTION GENERATOR", 100, 92, rgb16(200, 200, 0), black);
- grx_rect(1, 100, 549, 325, rgb16(0, 105, 0));
- grx_rect(2, 101, 548, 324, rgb16(0, 155, 0));
- grx_rect(3, 102, 547, 323, rgb16(0, 205, 0));
- grx_rect(4, 103, 546, 322, rgb16(0, 255, 0));
- grx_rect(579, 100, 799, 325, rgb16(0, 105, 0));
- grx_rect(580, 101, 798, 324, rgb16(0, 155, 0));
- grx_rect(581, 102, 797, 323, rgb16(0, 205, 0));
- grx_rect(582, 103, 796, 322, rgb16(0, 255, 0));
- grx_text("Wave selection",589,110,rgb16(0, 255, 0), black);
- grx_text("f -->triangular",589,125,rgb16(200, 200, 0), black);
- grx_text("g -->sin",589,140,rgb16(200, 200, 0), black);
- grx_text("h -->square",589,155,rgb16(200, 200, 0), black);
- grx_text("s -->select volt/freq",589,180,rgb16(200, 200, 0), black);
- grx_text("+/- -->set volt/freq",589,195,rgb16(200, 200, 0), black);
- grx_text("d -->frequency increase",589,210,rgb16(200, 200, 0),black);
- grx_text("Vpicco V",589,235,rgb16(0, 255, 0),black);
- grx_text("Freq Hz",589,265,rgb16(0, 255, 0),black);
- grx_text("+/- 1 Hz",589,290,rgb16(0, 255, 0),black);
- grx_text("+/- 10 HZ",689,290,rgb16(0, 255, 0),black);
-
- //OSCILLOSCOPE
- grx_text("OSCILLOSCOPE", 100, 362, rgb16(200, 200, 0), black);
- grx_rect(1, 370, 549, 595, rgb16(105, 0, 0));
- grx_rect(2, 371, 548, 594, rgb16(155, 0, 0));
- grx_rect(3, 372, 547, 593, rgb16(205, 0, 0));
- grx_rect(4, 373, 546, 592, rgb16(255, 0, 0));
- grx_rect(579, 370, 799, 595, rgb16(105, 0, 0));
- grx_rect(580, 371, 798, 594, rgb16(155, 0, 0));
- grx_rect(581, 372, 797, 593, rgb16(205, 0, 0));
- grx_rect(582, 373, 796, 592, rgb16(255, 0, 0));
- grx_text("Scale selection",589,380,rgb16(255, 0, 0), black);
- grx_text("s -->select volt/freq",589,400,rgb16(200, 200, 0), black);
- grx_text("+/- -->set volt/freq",589,415,rgb16(200, 200, 0), black);
- grx_text("j -->change channel",589,430,rgb16(200, 200, 0),black);
- grx_text("Channel",589,470,rgb16(255, 0, 0),black);
- grx_text("Volt/div V",589,500,rgb16(255, 0, 0),black);
- grx_text("Time/div ms",589,530,rgb16(255, 0, 0),black);
-
- //LABEL
- grx_text("0 V", 555, 211, rgb16(0, 255, 0), black);
- grx_text("+10", 555, 111, rgb16(0, 255, 0), black);
- grx_text("+5", 555, 161, rgb16(0, 255, 0), black);
- grx_text("-5", 555, 261, rgb16(0, 255, 0), black);
- grx_text("-10", 555, 311, rgb16(0, 255 , 0), black);
- grx_text("0 V", 555, 481, rgb16(255, 0, 0), black);
-}
Index: rel_1_21/oscilloscopio/adc.c
===================================================================
--- rel_1_21/oscilloscopio/adc.c (revision 1217)
+++ rel_1_21/oscilloscopio/adc.c (nonexistent)
@@ -1,400 +0,0 @@
-/*****************************************************************************
-* Filename: ADC.C *
-* Author: Ghiro Andrea,Franchino Gianluca *
-* Date: 06/06/2001 *
-* Description: Analog 2 digital conversion functions *
-*----------------------------------------------------------------------------*
-* Notes: Funcion for one sample from Ch0 *
-*****************************************************************************/
-
-/* This file is part of the S.Ha.R.K. Project - http://shark.sssup.it
- *
- * Copyright (C) 2003 Ghiro Andrea,Franchino Gianluca
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "adc.h"
-
-/*
-* Call this function to configure board options.
-*/
-
-void Configure_Board(BYTE numch)
-{
-WORD memhi;
- /*
- * Writing to register Write_Strobe_0_Register with address 82.
- * Write_Strobe_0 <= 1
- * New pattern = 0x0001
- */
- DAQ_STC_Windowed_Mode_Write(WRITE_STROBE_0,0x0001);
-
- /*
- * Writing to register Write_Strobe_1_Register with address 83.
- * Write_Strobe_1 <= 1
- * New pattern = 0x0001
- */
- DAQ_STC_Windowed_Mode_Write(WRITE_STROBE_1,0x0001);
-
- /*
- * Writing to register Config_Memory_High_Register with address 18.
- * CM_Channel_Number <= channel_number (0)
- * CM_Channel_Bank <= channel_bank (0)
- * CM_Channel_Type <= channel_type_for_rev_b (3)
- * New pattern = 0x3000
- */
- memhi = 0x3000 | numch;
- Immediate_Writew(ADC_CONFIG_HI,memhi);
-
- /*
- * Writing to register Config_Memory_Low_Register with address 16.
- * CM_Last_Channel <= last_channel (1)
- * CM_Trigger <= trigger (0)
- * CM_AI_Gain <= ai_gain (1)
- * CM_AI_Polarity <= ai_polarity (0)
- * CM_AI_Dither_Enable <= ai_dither_enable (0)
- * New pattern = 0x8001
- */
- Immediate_Writew(ADC_CONFIG_LO,0x8100);
- return;
- }
-
-/*
-* program the ADC_STC
-*/
-
-void ADC_Init()
-{
-/*
-* configure the timebase options.
-*/
- /*
- * Writing to register Clock_and_FOUT_Register with address 56.
- * Slow_Internal_Timebase <= p->msc_slow_int_tb_enable (1)
- * Slow_Internal_Time_Divide_By_2 <= p->msc_slow_int_tb_divide_by_2 (1)
- * Clock_To_Board <= p->msc_clock_to_board_enable (1)
- * Clock_To_Board_Divide_By_2 <= p->msc_clock_to_board_divide_by_2 (1)
- * New pattern = 0x1B00
- */
- DAQ_STC_Windowed_Mode_Write(CLOCK_AND_FOUT,0x1B00);
-
-/*
-* clear the AI FIFO.
-*/
- /*
- * Writing to register Write_Strobe_1_Register with address 83.
- * Write_Strobe_1 <= 1
- * New pattern = 0x0001
- */
- DAQ_STC_Windowed_Mode_Write(WRITE_STROBE_1,0x0001);
-
-/*
-* stop any activities in progress.
-*/
- /*
- * Writing to register Joint_Reset_Register with address 72.
- * AI_Reset <= 1
- * New pattern = 0x0001
- */
- DAQ_STC_Windowed_Mode_Write(JOINT_RESET,0x0001);
-
- /*
- * Writing to register Joint_Reset_Register with address 72.
- * AI_Configuration_Start <= 1
- * New pattern = 0x0010
- */
- DAQ_STC_Windowed_Mode_Write(JOINT_RESET,0x0010);
-
- /*
- * Writing to register Interrupt_A_Ack_Register with address 2.
- * AI_SC_TC_Error_Confirm <= 1
- * AI_SC_TC_Interrupt_Ack <= 1
- * AI_START1_Interrupt_Ack <= 1
- * AI_START2_Interrupt_Ack <= 1
- * AI_START_Interrupt_Ack <= 1
- * AI_STOP_Interrupt_Ack <= 1
- * AI_Error_Interrupt_Ack <= 1
- * New pattern = 0x3F80
- */
- DAQ_STC_Windowed_Mode_Write(INTERRUPT_A_ACK,0x3F80);
-
- /*
- * Writing to register AI_Command_1_Register with address 8.
- * AI_Command_1_Register <= 0
- * New pattern = 0x0000
- */
- DAQ_STC_Windowed_Mode_Write(AI_COMMAND_1,0x0000);
-
- /*
- * Writing to register AI_Mode_1_Register with address 12.
- * Reserved_One <= 1
- * AI_Start_Stop <= 1
- * New pattern = 0x000C
- */
- DAQ_STC_Windowed_Mode_Write(AI_MODE_1,0x000C);
-
- /*
- * Writing to register Joint_Reset_Register with address 72.
- * AI_Configuration_Start <= 0
- * AI_Configuration_End <= 1
- * New pattern = 0x0100
- */
- DAQ_STC_Windowed_Mode_Write(JOINT_RESET,0x0100);
-
-/*
-* setup the board.
-*/
- /*
- * Writing to register Joint_Reset_Register with address 72.
- * AI_Configuration_Start <= 1
- * New pattern = 0x0010
- */
- DAQ_STC_Windowed_Mode_Write(JOINT_RESET,0x0010);
-
- /*
- * Writing to register Clock_and_FOUT_Register with address 56.
- * AI_Source_Divide_By_2 <= p->ai_source_divide_by_2 (0)
- * AI_Output_Divide_By_2 <= p->ai_output_divide_by_2 (1)
- * New pattern = 0x1B80
- */
- DAQ_STC_Windowed_Mode_Write(CLOCK_AND_FOUT,0x1B80);
-
- /*
- * Writing to register AI_Personal_Register with address 77.
- * AI_CONVERT_Pulse_Timebase <= p->ai_convert_pulse_timebase (0)
- * AI_CONVERT_Pulse_Width <= p->ai_convert_pulse_width (1)
- * AI_FIFO_Flags_Polarity <= p->ai_fifo_flags_polarity (0)
- * AI_LOCALMUX_CLK_Pulse_Width <= p->ai_localmux_clk_pulse_width (1)
- * AI_AIFREQ_Polarity <= p->ai_aifreq_polarity (0)
- * AI_SHIFTIN_Polarity <= p->ai_shiftin_polarity (0)
- * AI_SHIFTIN_Pulse_Width <= p->ai_shiftin_pulse_width (1)
- * AI_EOC_Polarity <= p->ai_eoc_polarity (0)
- * AI_SOC_Polarity <= p->ai_soc_polarity (1)
- * AI_Overrun_Mode <= p->ai_overrun_mode (1)
- * New pattern = 0xA4A0
- */
- DAQ_STC_Windowed_Mode_Write(AI_PERSONAL,0xA4A0);
-
- /*
- * Writing to register AI_Output_Control_Register with address 60.
- * AI_CONVERT_Output_Select <= p->ai_convert_output_select (2)
- * AI_SC_TC_Output_Select <= p->ai_sc_tc_output_select (3)
- * AI_SCAN_IN_PROG_Output_Select <= p->ai_scan_in_prog_output_select (3)
- * AI_LOCALMUX_CLK_Output_Select <= p->ai_localmux_clk_output_select (2)
- * New pattern = 0x032E
- */
- DAQ_STC_Windowed_Mode_Write(AI_OUTPUT_CONTROL,0x032E);
-
- /*
- * Writing to register Joint_Reset_Register with address 72.
- * AI_Configuration_Start <= 0
- * AI_Configuration_End <= 1
- * New pattern = 0x0100
- */
- DAQ_STC_Windowed_Mode_Write(JOINT_RESET,0x0100);
-
-/*
-* access the first value in the configuration
-* FIFO.
-*/
- /*
- * Writing to register AI_Command_1_Register with address 8.
- * AI_CONVERT_Pulse <= 1
- * New pattern = 0x0001
- */
- DAQ_STC_Windowed_Mode_Write(AI_COMMAND_1,0x0001);
-
-/*
-* setup for external hardware.
-*/
- /*
- * Writing to register Joint_Reset_Register with address 72.
- * AI_Configuration_Start <= 1
- * New pattern = 0x0010
- */
- DAQ_STC_Windowed_Mode_Write(JOINT_RESET,0x0010);
-
- /*
- * Writing to register AI_Mode_2_Register with address 13.
- * AI_External_MUX_Present <= 0
- * New pattern = 0x0000
- */
- DAQ_STC_Windowed_Mode_Write(AI_MODE_2,0x0000);
-
- /*
- * Writing to register AI_Output_Control_Register with address 60.
- * AI_EXTMUX_CLK_Output_Select <= p->ai_extmux_clk_output_select (0)
- * New pattern = 0x032E
- */
- DAQ_STC_Windowed_Mode_Write(AI_OUTPUT_CONTROL,0x032E);
-
- /*
- * Writing to register Joint_Reset_Register with address 72.
- * AI_Configuration_Start <= 0
- * AI_Configuration_End <= 1
- * New pattern = 0x0100
- */
- DAQ_STC_Windowed_Mode_Write(JOINT_RESET,0x0100);
-
-/*
-* enable or disable retriggering.
-*/
- /*
- * Writing to register Joint_Reset_Register with address 72.
- * AI_Configuration_Start <= 1
- * New pattern = 0x0010
- */
- DAQ_STC_Windowed_Mode_Write(JOINT_RESET,0x0010);
-
- /*
- * Writing to register AI_Mode_1_Register with address 12.
- * AI_Trigger_Once <= 1
- * New pattern = 0x000D
- */
- DAQ_STC_Windowed_Mode_Write(AI_MODE_1,0x000D);
-
- /*
- * Writing to register AI_Trigger_Select_Register with address 63.
- * AI_START1_Select <= 0
- * AI_START1_Polarity <= 0
- * AI_START1_Edge <= 1
- * AI_START1_Sync <= 1
- * New pattern = 0x0060
- */
- DAQ_STC_Windowed_Mode_Write(AI_TRIGGER_SELECT,0x0060);
-
- /*
- * Writing to register Joint_Reset_Register with address 72.
- * AI_Configuration_Start <= 0
- * AI_Configuration_End <= 1
- * New pattern = 0x0100
- */
- DAQ_STC_Windowed_Mode_Write(JOINT_RESET,0x0100);
-
-/*
-* select the number of scans.
-*/
-/*
- * Writing to register Joint_Reset_Register with address 72.
- * AI_Configuration_Start <= 1
- * New pattern = 0x0010
- */
- DAQ_STC_Windowed_Mode_Write(JOINT_RESET,0x0010);
-
- DAQ_STC_Windowed_Mode_Write(AI_MODE_1,0x000F);
-
- /*
- * Writing to register Joint_Reset_Register with address 72.
- * AI_Configuration_Start <= 0
- * AI_Configuration_End <= 1
- * New pattern = 0x0100
- */
- DAQ_STC_Windowed_Mode_Write(JOINT_RESET,0x0100);
-
-/*
-* select the scan start event.
-*/
- /*
- * Writing to register Joint_Reset_Register with address 72.
- * AI_Configuration_Start <= 1
- * New pattern = 0x0010
- */
- DAQ_STC_Windowed_Mode_Write(JOINT_RESET,0x0010);
-
- /*
- * Writing to register AI_START_STOP_Select_Register with address 62.
- * AI_START_Select <= 0
- * AI_START_Edge <= 1
- * AI_START_Sync <= 1
- * AI_START_Polarity <= 0
- * New pattern = 0x0060
- */
- DAQ_STC_Windowed_Mode_Write(AI_START_STOP_SELECT,0x0060);
-
-
- /*
- * Writing to register Joint_Reset_Register with address 72.
- * AI_Configuration_Start <= 0
- * AI_Configuration_End <= 1
- * New pattern = 0x0100
- */
- DAQ_STC_Windowed_Mode_Write(JOINT_RESET,0x0100);
-
-/*
-* select the end of scan event.
-*/
- /*
- * Writing to register Joint_Reset_Register with address 72.
- * AI_Configuration_Start <= 1
- * New pattern = 0x0010
- */
- DAQ_STC_Windowed_Mode_Write(JOINT_RESET,0x0010);
-
- /*
- * Writing to register AI_START_STOP_Select_Register with address 62.
- * AI_STOP_Select <= p->ai_stop_select (19)
- * AI_STOP_Edge <= 0
- * AI_STOP_Polarity <= p->ai_stop_polarity (0)
- * AI_STOP_Sync <= 1
- * New pattern = 0x29E0
- */
- DAQ_STC_Windowed_Mode_Write(AI_START_STOP_SELECT,0x29E0);
-
- /*
- * Writing to register Joint_Reset_Register with address 72.
- * AI_Configuration_Start <= 0
- * AI_Configuration_End <= 1
- * New pattern = 0x0100
- */
- DAQ_STC_Windowed_Mode_Write(JOINT_RESET,0x0100);
-
-/*
-* clear the AI FIFO.
-*/
- /*
- * Writing to register Write_Strobe_1_Register with address 83.
- * Write_Strobe_1 <= 1
- * New pattern = 0x0001
- */
- DAQ_STC_Windowed_Mode_Write(WRITE_STROBE_1,0x0001);
-return;
-}
-
-/*
-* Call this function to start the acquistion.
-*/
-
-void AI_Start_The_Acquisition()
-{
- /*
- * Writing to register AI_Command_1_Register with address 8.
- * AI_CONVERT_Pulse <= 1
- * New pattern = 0x0001
- */
- DAQ_STC_Windowed_Mode_Write(AI_COMMAND_1,0x0001);
- return;
- }
-
-/*End of file: adc.c*/
-
-
-
-
-
-
-
-
Index: rel_1_21/oscilloscopio/initosc.c
===================================================================
--- rel_1_21/oscilloscopio/initosc.c (revision 1217)
+++ rel_1_21/oscilloscopio/initosc.c (nonexistent)
@@ -1,69 +0,0 @@
-/*
-* Filename: Initosc.c
-* Author: Ghiro Andrea, Franchino Gianluca
-* Date: 09/03
-* Description: this file is for osc
-*/
-
-/* This file is part of the S.Ha.R.K. Project - http://shark.sssup.it
- *
- * Copyright (C) 2003 Ghiro Andrea Franchino Gianluca
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <kernel/kern.h>
-#include <modules/edf.h>
-#include <modules/cbs.h>
-#include <modules/rr.h>
-#include <modules/hartport.h>
-#include <modules/dummy.h>
-#include <modules/sem.h>
-#include <modules/srp.h>
-
-#include <drivers/keyb.h>
-
-#define TICK 1000
-#define RRTICK 5000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- CBS_register_level(CBS_ENABLE_ALL, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
-
- dummy_register_level();
-
- SEM_register_module();
-
- SRP_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- HARTPORT_init();
- KEYB_init(NULL);
-
- __call_main__(mb);
-
- return (void *)0;
-}
Index: rel_1_21/oscilloscopio/readme.txt
===================================================================
--- rel_1_21/oscilloscopio/readme.txt (revision 1217)
+++ rel_1_21/oscilloscopio/readme.txt (nonexistent)
@@ -1 +0,0 @@
-Verione con tutti i task periodici Hard
Index: rel_1_21/oscilloscopio/adc.h
===================================================================
--- rel_1_21/oscilloscopio/adc.h (revision 1217)
+++ rel_1_21/oscilloscopio/adc.h (nonexistent)
@@ -1,48 +0,0 @@
-/*****************************************************************************
-* Filename: ADC.H *
-* Author: Ghiro Andrea,Franchino Gianluca *
-* Date: 09/2003 *
-* Description: Analog 2 digital conversion package header file *
-*----------------------------------------------------------------------------*
-* Notes: *
-*****************************************************************************/
-
-/* This file is part of the S.Ha.R.K. Project - http://shark.sssup.it
- *
- * Copyright (C) 2003 Ghiro Andrea,Franchino Gianluca
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#ifndef _MY_ADC_H_
-#define _MY_ADC_H_
-
-#include <drivers/pci6025e/pci6025e.h>
-#include <drivers/pci6025e/regconst.h>
-#include "ll/sys/cdefs.h"
-
-__BEGIN_DECLS
-
-//Analog input releted functions
-void Configure_Board(BYTE);
-void ADC_Init(void);
-void AI_Start_The_Acquisition(void);
-
-__END_DECLS
-#endif
-/*End of file: adc.h*/
-
Index: rel_1_21/oscilloscopio/makefile
===================================================================
--- rel_1_21/oscilloscopio/makefile (revision 1217)
+++ rel_1_21/oscilloscopio/makefile (nonexistent)
@@ -1,18 +0,0 @@
-#
-#
-# PCI6025E Examples and Test programs
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS= osc
-
-include $(BASE)/config/example.mk
-
-osc:
- make -f $(SUBMAKE) APP=osc OTHEROBJS="initosc.o adc.o" SHARKOPT="__6025E__ __OLDCHAR__ __GRX__"
-
Index: rel_1_21/biliardo/biliardo.c
===================================================================
--- rel_1_21/biliardo/biliardo.c (revision 1217)
+++ rel_1_21/biliardo/biliardo.c (nonexistent)
@@ -1,240 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: biliardo.c,v 1.1 2003-06-04 09:41:32 giacomo Exp $
-
- File: $File$
- Revision: $Revision: 1.1 $
- Last update: $Date: 2003-06-04 09:41:32 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "biliardo.h"
-#include <kernel/func.h>
-#include <string.h>
-#include <stdlib.h>
-#include <drivers/keyb.h>
-#include <drivers/glib.h>
-
-/* graphic mutex... */
-mutex_t mutex;
-
-mutex_t palmutex;
-mutex_t delmutex;
-//mutex_t punmutex;
-
-/* useful colors... */
-int white;
-int black;
-int red;
-int gray;
-int green;
-int lime;
-int brown;
-
-void app_mutex_init(mutex_t *m);
-
-static void version( void )
-{
- cprintf( "S.Ha.R.K. San Martino Sicc. Demo 1.0\n" );
-}
-
-int myrand(int x)
-{
- return rand()%x;
-}
-
-void reverse(char s[])
-{
- int c, i, j;
-
- for (i = 0, j = strlen(s)-1; i<j; i++, j--)
- {
- c = s[i];
- s[i] = s[j];
- s[j] = c;
- }
-}
-
-char * itoa(int n, char *s)
-{
- int i, sign;
-
- if ((sign = n) < 0)
- n = -n;
-
- i = 0;
-
- do
- {
- s[i++] = n % 10 + '0';
- } while ((n /= 10) > 0);
-
- if (sign < 0)
- s[i++] = '-';
-
- s[i] = 0;
-
- reverse(s);
-
- return s;
-}
-
-
-void scenario()
-{
- grx_text("S.Ha.R.K. - Biliardo rivisitato", 322,2, white, black );
- grx_text("q : uscita",322, 18, gray, black );
- grx_text("i : inizio partita",322,28, gray, black );
- grx_text("Space : scocca il colpo" ,322,38, gray, black );
- grx_text("a,z : calibra la forza" ,322,48, gray, black );
- grx_text("Freccie : posiziona cursore" ,322,58, gray, black );
- grx_text("Backspace : nuova partita" ,322,68, gray, black );
-
-
- #ifdef JET_ON
- scenario_jetcontrol();
- #endif
-
- #ifdef BALL_ON
- scenario_ball();
- #endif
-}
-
-
-void demo_exc_handler(int signo, siginfo_t *info, void *extra)
-{
- struct timespec t;
-
- grx_close();
-
- /* Default action for an kern exception is */
- kern_cli();
- ll_gettime(TIME_EXACT, &t),
- kern_printf("\nS.Ha.R.K. Exception raised!!!"
- "\nTime (s:ns) :%d:%d"
- "\nException number:%d"
- "\nPID :%d\n",
- t.tv_sec, t.tv_nsec, info->si_value.sival_int,
- info->si_task);
- sys_end();
-}
-
-void my_close(void *arg)
-{
- grx_close();
- kern_printf("Termine programma\n");
-}
-
-
-void endfun(KEY_EVT *k)
-{
- cprintf("Tasto q premuto, termine programma\n");
- sys_end();
-}
-
-void zerofun(KEY_EVT *k)
-{
- int i;
- for (i=0; i<MAX_PROC; i++) jet_delstat(i);
-}
-
-void printeventqueue(void *arg)
-{
- struct event *p;
- extern struct event *firstevent;
-
- kern_cli();
- grx_close();
- kern_cli();
- for (p = firstevent; p != NULL; p = p->next) {
- kern_printf("par:%d time:%d.%d p:%d handler:%d\n",
- p->par, p->time.tv_sec, p->time.tv_nsec/1000, p, p->handler);
- }
- kern_sti();
-}
-
-int main(int argc, char **argv)
-{
- int modenum;
-
- KEY_EVT k;
-
-// Evento di termine programma
- k.flag = 0;
- k.scan = KEY_Q;
- k.ascii = 'q';
- keyb_hook(k,endfun);
-
- //set_exchandler_grx();
- sys_atrunlevel(my_close, NULL, RUNLEVEL_BEFORE_EXIT);
-
- grx_init();
- modenum = grx_getmode(640, 480, 16);
-
- grx_setmode(modenum);
-
- /* init the graphic mutex */
- app_mutex_init(&mutex);
-
- /* useful colors ... */
- white = rgb16(255,255,255);
- black = rgb16(0,0,0);
- red = rgb16(255,0,0);
- gray = rgb16(128,128,128);
- green = rgb16(0,128,0);
- lime = rgb16(0,255,0);
- brown = rgb16(128,0,0);
-
- scenario();
-
- init_jetcontrol();
-
- app_mutex_init(&palmutex);
- app_mutex_init(&delmutex);
- init_ball();
-
- initSched();
-
- group_activate(JET_GROUP);
-
- return 0;
-}
-
-
Index: rel_1_21/biliardo/jetctrl.c
===================================================================
--- rel_1_21/biliardo/jetctrl.c (revision 1217)
+++ rel_1_21/biliardo/jetctrl.c (nonexistent)
@@ -1,194 +0,0 @@
-// ****************** JetControl ******************
-
-#include "biliardo.h"
-#include "kernel/func.h"
-
-TASK jetdummy_task(void *arg)
-{
- TIME now_dummy, last_dummy, diff_dummy, slice;
- struct timespec now, last, diff;
- int x = 0;
- int height;
-
- NULL_TIMESPEC(&last);
- last_dummy = 0;
- for (;;) {
- task_nopreempt();
- jet_getstat(DUMMY_PID, NULL, NULL, NULL, &now_dummy);
- sys_gettime(&now);
- task_preempt();
-
- SUBTIMESPEC(&now, &last, &diff);
- slice = diff.tv_sec * 1000000 + diff.tv_nsec/1000;
- diff_dummy = now_dummy - last_dummy;
-
- height = (int)(JET_DUMMY_HEIGHT*((float)diff_dummy)/((float)slice));
-
- TIMESPEC_ASSIGN(&last, &now);
- last_dummy = now_dummy;
-
- mutex_lock(&mutex);
- grx_line(JET_DUMMY_X+x,JET_DUMMY_Y,
- JET_DUMMY_X+x,JET_DUMMY_Y+height ,black);
- grx_line(JET_DUMMY_X+x,JET_DUMMY_Y+height,
- JET_DUMMY_X+x,JET_DUMMY_Y+JET_DUMMY_HEIGHT,white);
- grx_line(JET_DUMMY_X+(x+1)%JET_DUMMY_WIDTH,JET_DUMMY_Y,
- JET_DUMMY_X+(x+1)%JET_DUMMY_WIDTH,JET_DUMMY_Y+JET_DUMMY_HEIGHT,white);
-
- mutex_unlock(&mutex);
-
-
- x = (x+1)%JET_DUMMY_WIDTH;
-
- task_endcycle();
- }
-}
-
-
-TASK jetctrl_task(void *arg)
-{
- char st[50];
- TIME sum, max;
- int n;
-
- PID i;
- int printed = 0;
-
- for (;;) {
- for (i=2, printed=0; i<MAX_PROC && printed<JET_NTASK; i++) {
- if (jet_getstat(i, &sum, &max, &n, NULL) != -1) {
- if (!n) n=1;
- sprintf(st, "%6d %6d %10s ", (int)sum/n, (int)max, proc_table[i].name);
- mutex_lock(&mutex);
- grx_text(st, JET_DUMMY_X-45, JET_Y_NAME+16+printed*8, gray, black);
- mutex_unlock(&mutex);
- printed++;
- }
- }
- while (printed<JET_NTASK) {
- mutex_lock(&mutex);
- grx_text(" ",
- JET_DUMMY_X-45, JET_Y_NAME+16+printed*8, gray, black);
- mutex_unlock(&mutex);
- printed++;
- }
- task_endcycle();
- }
-}
-
-TASK jetslide_task(void *arg)
-{
- TIME sum, curr, max;
-
- TIME total[JET_NTASK];
- int slides[JET_NTASK];
-
- PID i;
- int printed = 0;
-
- for (;;) {
- // Fill the total array in a nonpreemptive section
- task_nopreempt();
- for (i=2, printed=0; i<MAX_PROC && printed<JET_NTASK; i++) {
- if (jet_getstat(i, &sum, NULL, NULL, &curr) != -1) {
- total[printed] = sum+curr;
- printed++;
- }
- }
- task_preempt();
-
- while (printed < JET_NTASK)
- total[printed++] = 0;
-
- // Compute the Max elapsed time
- max = 0;
- for (i=0; i<JET_NTASK; i++)
- if (total[i] > max) max = total[i];
- if (!max) max = 1;
-
- // Compute the slides width
- for (i=0; i<JET_NTASK; i++)
- slides[i] = (int)( (((float)total[i])/max) * JET_SLIDE_WIDTH);
-
- // print the data
- mutex_lock(&mutex);
- for (i=0; i<JET_NTASK; i++) {
- grx_box(JET_SLIDE_X, JET_Y_NAME+16+i*8,
- JET_SLIDE_X+slides[i], JET_Y_NAME+23+i*8, gray);
- grx_box(JET_SLIDE_X+slides[i], JET_Y_NAME+16+i*8,
- JET_SLIDE_X+JET_SLIDE_WIDTH, JET_Y_NAME+23+i*8, black);
- }
-
- while (i<JET_NTASK) {
- grx_box(JET_SLIDE_X, JET_Y_NAME+16+i*8,
- JET_SLIDE_X+JET_SLIDE_WIDTH, JET_Y_NAME+20+i*8, black);
- i++;
- }
- mutex_unlock(&mutex);
- task_endcycle();
- }
-}
-
-
-void scenario_jetcontrol(void)
-{
-
- grx_text(" Medio Massimo Processo Slide", JET_DUMMY_X-40, JET_Y_NAME, gray, black);
- grx_line(JET_DUMMY_X-40,JET_Y_NAME+10,JET_DUMMY_X+250,JET_Y_NAME+10,lime);
-
- grx_rect(JET_DUMMY_X-1, JET_DUMMY_Y-1,
- JET_DUMMY_X+JET_DUMMY_WIDTH, JET_DUMMY_Y+JET_DUMMY_HEIGHT+1, lime);
-
- grx_text("100%", JET_DUMMY_X-40, JET_DUMMY_Y, lime, black);
- grx_text(" 0%", JET_DUMMY_X-40, JET_DUMMY_Y+JET_DUMMY_HEIGHT-8, lime, black);
-
-}
-
-void init_jetcontrol(void)
-{
- SOFT_TASK_MODEL m3, m4, m5;
-
- PID p3, p4, p5;
-
- soft_task_default_model(m3);
- soft_task_def_level(m3,1);
- soft_task_def_period(m3, PERIOD_JETCTRL);
- soft_task_def_met(m3, WCET_JETCTRL);
- soft_task_def_ctrl_jet(m3);
- soft_task_def_group(m3, JET_GROUP);
- p3 = task_create("jctrl", jetctrl_task, &m3, NULL);
- if (p3 == -1) {
- grx_close();
- perror("Could not create task <jetctrl>");
- sys_end();
- }
-
- soft_task_default_model(m4);
- soft_task_def_level(m4,1);
- soft_task_def_period(m4, PERIOD_JETDUMMY);
- soft_task_def_met(m4, WCET_JETDUMMY);
- soft_task_def_group(m4, JET_GROUP);
- soft_task_def_usemath(m4);
- soft_task_def_ctrl_jet(m4);
- p4 = task_create("jdmy", jetdummy_task, &m4, NULL);
- if (p4 == -1) {
- grx_close();
- perror("Could not create task <jetdummy>");
- sys_end();
- }
-
- soft_task_default_model(m5);
- soft_task_def_level(m5,1);
- soft_task_def_period(m5, PERIOD_JETSLIDE);
- soft_task_def_met(m5, WCET_JETSLIDE);
- soft_task_def_group(m5, JET_GROUP);
- soft_task_def_usemath(m5);
- soft_task_def_ctrl_jet(m5);
- p5 = task_create("jsli", jetslide_task, &m5, NULL);
- if (p5 == -1) {
- grx_close();
- perror("Could not create task <jetslide>");
- sys_end();
- }
-}
-
Index: rel_1_21/biliardo/demo.h
===================================================================
--- rel_1_21/biliardo/demo.h (revision 1217)
+++ rel_1_21/biliardo/demo.h (nonexistent)
@@ -1,170 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: demo.h,v 1.1 2003-06-04 09:41:32 giacomo Exp $
-
- File: $File$
- Revision: $Revision: 1.1 $
- Last update: $Date: 2003-06-04 09:41:32 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#include <ll/ll.h>
-#include <kernel/types.h>
-#include <kernel/descr.h>
-#include <math.h>
-#include <drivers/glib.h>
-#include <drivers/keyb.h>
-
-#include <modules/hartport.h>
-#include <modules/sem.h>
-
-#define JET_ON
-#define BALL_ON
-
-/*
- *
- * WCET, Periods and Models
- *
- */
-
-
-/* define if you want NRT or SOFT... */
-#define TASK_TYPE SOFT
-//#define TASK_TYPE NRT
-
-#define WCET_JETCTRL 7500
-#define WCET_JETDUMMY 200
-#define WCET_JETSLIDE 2100
-
-#define PERIOD_JETCTRL 100000
-#define PERIOD_JETDUMMY 100000
-#define PERIOD_JETSLIDE 100000
-
-
-//#define WCET_BALL 100
-#define WCET_BALL 500
-
-#define PERIOD_BALL 25000
-
-#define WCET_SCHED 450
-
-#define PERIOD_SCHED 15000
-
-/*
- *
- * Global Stuffs
- *
- */
-
-/* graphic mutex... */
-extern mutex_t mutex;
-
-/* sincronizzazione */
-//extern sem_t pmutex;
-extern mutex_t palmutex;
-
-/* useful colors... */
-extern int white;
-extern int black;
-extern int red;
-extern int gray;
-extern int green;
-
-void init_jetcontrol();
-void init_ball(void);
-void scenario_jetcontrol();
-void scenario_ball();
-char *itoa(int n, char *s);
-int myrand(int x);
-
-void initSched(void);
-void setPalla (int);
-void inizioPartita (void);
-void collisioneRilevata(int);
-int controlloBuche (float, float, int);
-void hardSched (void);
-void hardball (void);
-
-/*
- *
- * JETCONTROL stuffs
- *
- */
-
-#define JET_NTASK 15
-#define JET_Y_NAME 170
-
-#define DUMMY_PID 1
-
-#define JET_DUMMY_WIDTH 210
-#define JET_DUMMY_HEIGHT 80
-
-/* the point (x, y) is the top left corner */
-#define JET_DUMMY_X 428
-#define JET_DUMMY_Y 65
-
-#define JET_SLIDE_WIDTH 50
-#define JET_SLIDE_X 576
-
-
-
-
-/*
- *
- * BALL stuffs
- *
- */
-
-// x and y corners are specified whithout consider a border of 3 pixels
-#define BALL_YMAX 390 /* position of the ceil */
-#define BALL_Y 425 /* position of the floor */
-#define BALL_VELY .1 /* vertical ball velocity */
-#define BALL_HEIGHT 5 /* initial height of the ball */
-#define BALL_XMIN 65 /* min position X of the ball */
-#define BALL_XMAX 255 /* max position X of the ball */
-#define BALL_VELX 0. /* horizontal ball velocity */
-#define BALL_VYMIN 11. /* min ground speed */
-#define BALL_MAX_P 11 /* max number of balls */
-
-#define BALL_GROUP 2 /* task group of the balls */
-
-#define COLLISION 1
-#define NO_COLLISION 0
Index: rel_1_21/biliardo/palla.c
===================================================================
--- rel_1_21/biliardo/palla.c (revision 1217)
+++ rel_1_21/biliardo/palla.c (nonexistent)
@@ -1,1169 +0,0 @@
-/*--------------------------------------------------------------*/
-/* BILIARDO: FILE CONTENENTE TASK PALLA E SCHEDULAZIONE */
-/*--------------------------------------------------------------*/
-
-#include <kernel/func.h>
-#include <stdlib.h>
-#include <math.h>
-#include "biliardo.h"
-#include "posizion.h"
-
-#define R 4 // dimensioni della palla
-#define RB 7 // dimensioni della buca
-#define COD_FRECCIA 64
-
-static int ballexit[BALL_MAX_P]; // controllo eliminazione task palla
-static int npc = 0; // numero dei task palla in gioco
-struct posizione PosPalla[BALL_MAX_P]; // posizione delle palle in gioco
-int FlagPartita = 0;
-int ch = 0, curs = 0;
-int punteggio[2]; // punteggio relativo al giocatore
-int giocatore = 0; // giocatore
-int bForza;
-
-
-TASK palla(int i) {
-
- float oxf, oyf; // posizione precedente della palla
- int col;
-
- setPalla (i);
-
- mutex_lock(&palmutex);
- col = PosPalla[i].col;
- oxf = PosPalla[i].x;
- oyf = BALL_Y - PosPalla[i].y;
- mutex_unlock(&palmutex);
-
- mutex_lock(&mutex);
- grx_disc(oxf, oyf, R, col);
- grx_text(" ",432,85, black, black);
- mutex_unlock(&mutex);
-
- while (1) {
-
- mutex_lock(&mutex);
- grx_disc(oxf, oyf, R, 0);
-// grx_line(oxf, oyf, oxf+vx, oyf-vy, 0);
- mutex_unlock(&mutex);
-
- mutex_lock(&palmutex);
- oxf = PosPalla[i].x;
- oyf = BALL_Y - PosPalla[i].y;
- mutex_unlock(&palmutex);
-
- mutex_lock (&delmutex);
- if (ballexit[i]) {
- npc--;
- mutex_unlock (&delmutex);
- return 0;
- }
- mutex_unlock (&delmutex);
-
- mutex_lock(&mutex);
- grx_disc(oxf, oyf, R, col);
-// grx_line(oxf, oyf, oxf+vx, oyf-vy, col);
- mutex_unlock(&mutex);
-
- task_endcycle();
- }
-}
-
-TASK sched() {
-
- int i, j;
- int k;
-
- char strTmp[21];
- struct posizione posIn[BALL_MAX_P];
- struct posizione posOut[BALL_MAX_P];
- struct posizione pos[BALL_MAX_P];
-
-
- int flag, bBevuta = 0;
- float dist = 0;
-
-
- float dx, dy; // variazione coordinate
- float dt; /* incremento temporale */
- float modx, mody;
-
- // angolo formato dalla retta passante per il baricentro delle palle in collisione
- float thetaB1 = 0, thetaB2 = 0;
- float tratto; //tratto percorso
- float thetaO1, thetaO2;
-
- float attr = 0.0021; // attrito applicato ad ogni palla
- float acc;
- float g = 9.86; // forza di gravit… utilizzata per il calcolo dell'attrito
- float v0 = 0;
-
- float xCurs, yCurs;
- int bRiposiz = 1;
- int punteggio[2];
- int giocatore = 0;
- int sign;
- float v1x, v1y, v2x, v2y;
- float phi;
- float thetaV1, thetaV2;
- float thetaBarOld1, thetaBarOld2;
- // evita che venga segnalata pi— volte una collisione
- int flag1coll[BALL_MAX_P];
- // segna nella locazione di una palla con quale altra palla ha colliso
- int flagCollCorr[BALL_MAX_P];
- // ricorda per ogni palla quale Š stata la collisione precedente
- int flagCollPrec[BALL_MAX_P];
- int flagAgg[BALL_MAX_P];
- int flagAggNum[BALL_MAX_P];
-
- for (i=0; i<BALL_MAX_P; i++) {
- flagCollPrec[i] = -1;
- }
-
- dt = ((float)PERIOD_BALL)/40000;
-
- acc = attr * g;
-
- flag = 1;
- k = 0;
-
- while (1) {
- if (ch == 'i') {
- punteggio[0] = 0, punteggio[1] = 0;
- ch = 0;
- }
-
- if (FlagPartita) {
-
-// inizio mutex
- mutex_lock(&palmutex);
-
- if (PosPalla[i].theta < 0)
- PosPalla[i].theta += 2*PI;
- else
- if (PosPalla[i].theta > 2*PI)
- PosPalla[i].theta -= 2*PI;
-
- for(i=0; i<BALL_MAX_P; i++) {
- flag1coll[i] = 0;
- flagCollCorr[i] = -1;
- flagAgg[i] = 0;
- posIn[i].x = posOut[i].x = PosPalla[i].x;
- posIn[i].y = posOut[i].y = PosPalla[i].y;
- posIn[i].v = posOut[i].v = PosPalla[i].v;
- posIn[i].theta = posOut[i].theta = PosPalla[i].theta;
-
-
- }
-
- mutex_unlock(&palmutex);
-
-// fine mutex
-
- for(i=0; i<BALL_MAX_P; i++) {
-
- for(j=0; j<BALL_MAX_P; j++) {
-
- if (i < j && flagCollCorr[i] == -1) {
-
- if(posIn[i].x-R >= posIn[j].x-R && posIn[i].x-R <= posIn[j].x+R
- && posIn[i].y-R >= posIn[j].y-R && posIn[i].y-R <= posIn[j].y+R) {
-
- flagCollCorr[i] = j;
- flagCollCorr[j] = i;
- break;
- }
- else
-
- if(posIn[i].x-R >= posIn[j].x-R && posIn[i].x-R <= posIn[j].x+R
- && posIn[i].y+R >= posIn[j].y-R && posIn[i].y+R <= posIn[j].y+R) {
-
- flagCollCorr[i] = j;
- flagCollCorr[j] = i;
- break;
- }
- else
-
- if(posIn[i].x+R >= posIn[j].x-R && posIn[i].x+R <= posIn[j].x+R
- && posIn[i].y+R >= posIn[j].y-R && posIn[i].y+R <= posIn[j].y+R) {
-
- flagCollCorr[i] = j;
- flagCollCorr[j] = i;
- break;
- }
- else
-
- if(posIn[i].x+R >= posIn[j].x-R && posIn[i].x+R <= posIn[j].x+R
- && posIn[i].y-R >= posIn[j].y-R && posIn[i].y-R <= posIn[j].y+R) {
-
- flagCollCorr[i] = j;
- flagCollCorr[j] = i;
- break;
- }
- else {
- flagCollCorr[i] = -1;
- flagCollPrec[i] = -1;
- }
-
-
- } // fine if(i!=j)
- } // fine ciclo for(j)
-
-
- if (flagCollCorr[i] != -1 && flagCollCorr[i] != flagCollPrec[i]) {
-
-
- dist = sqrt(pow(posIn[i].x - posIn[flagCollCorr[i]].x,2)
- + pow(posIn[i].y - posIn[flagCollCorr[i]].y,2));
- if (dist < 2*R) {
- flagAgg[i] = 1;
- flagAgg[flagCollCorr[i]] = 1;
- dist = ceil (2*R-dist);
- if ((int)dist%2 != 0)
- dist += 1;
- flagAggNum[i] = (int)dist/2;
-
- }
-
- // permette la sola collisione di due palle contemporaneamente
- flag1coll[i] = 1;
-
- flagCollPrec[i] = flagCollCorr[i];
-
- }
-
- } // fine ciclo for(i)
-
-
- for(i=0; i<BALL_MAX_P; i++) { // inizio ciclo for calcolo collisioni
-
- if (flag1coll[i]) {
-
- if (flag1coll[0])
- bBevuta = 0;
-
-
-
- sign = 1;
- modx = posIn[i].x - posIn[flagCollCorr[i]].x;
- mody = posIn[i].y - posIn[flagCollCorr[i]].y;
- if (modx*mody < 0) sign = 0;
- if (modx < 0) modx = -modx;
- if (mody < 0) mody = -mody;
-
-// prima palla
- if (posIn[i].x <= posIn[flagCollCorr[i]].x && posIn[i].y <= posIn[flagCollCorr[i]].y) {
- // angolo formato dalla retta passante per il baricentro delle due palle
- thetaB1 = atan (mody / modx);
-
- if (flagAgg[i]) {
- posOut[i].x -=flagAggNum[i], posOut[i].y -=flagAggNum[i];
- flagAgg[i] = 0;
- }
-
- }
- else
- if (posIn[i].x >= posIn[flagCollCorr[i]].x && posIn[i].y <= posIn[flagCollCorr[i]].y) {
- thetaB1 = PI - atan (mody / modx);
-
- if (flagAgg[i]) {
- posOut[i].x +=flagAggNum[i], posOut[i].y -=flagAggNum[i];
- flagAgg[i] = 0;
- }
-
- }
- else
- if (posIn[i].x >= posIn[flagCollCorr[i]].x && posIn[i].y >= posIn[flagCollCorr[i]].y) {
- thetaB1 = PI + atan (mody / modx);
-
- if (flagAgg[i]) {
- posOut[i].x +=flagAggNum[i], posOut[i].y +=flagAggNum[i];
- flagAgg[i] = 0;
- }
-
- }
- else
- if (posIn[i].x <= posIn[flagCollCorr[i]].x && posIn[i].y >= posIn[flagCollCorr[i]].y) {
- thetaB1 = 2*PI - atan (mody / modx);
-
- if (flagAgg[i]) {
- posOut[i].x -=flagAggNum[i], posOut[i].y +=flagAggNum[i];
- flagAgg[i] = 0;
- }
-
- }
-
- if (thetaB1 < 0)
- thetaB1 += 2*PI;
- else
- if (thetaB1 > 2*PI)
- thetaB1 -= 2*PI;
-
-// seconda palla
- if (posIn[i].x >= posIn[flagCollCorr[i]].x && posIn[i].y >= posIn[flagCollCorr[i]].y) {
- // angolo formato dalla retta passante per il baricentro delle due palle
- thetaB2 = atan (mody / modx);
- }
- else
- if (posIn[i].x <= posIn[flagCollCorr[i]].x && posIn[i].y >= posIn[flagCollCorr[i]].y) {
- thetaB2 = PI - atan (mody / modx);
- }
- else
- if (posIn[i].x <= posIn[flagCollCorr[i]].x && posIn[i].y <= posIn[flagCollCorr[i]].y) {
- thetaB2 = PI + atan (mody / modx);
- }
- else
- if (posIn[i].x >= posIn[flagCollCorr[i]].x && posIn[i].y <= posIn[flagCollCorr[i]].y) {
- thetaB2 = 2*PI - atan (mody / modx);
- }
-
- if (thetaB2 < 0)
- thetaB2 += 2*PI;
- else
- if (thetaB2 > 2*PI)
- thetaB2 -= 2*PI;
-
-
-
-
-// aggiorno gli angoli rispetto al nuovo sistema di riferimento della prima palla
-// con 0 in thetaB1-PI/2
- posOut[i].theta = posIn[i].theta + PI/2 - thetaB1;
- if (posOut[i].theta < 0)
- posOut[i].theta += 2*PI;
- else
- if (posOut[i].theta > 2*PI)
- posOut[i].theta -= 2*PI;
-
- thetaO1 = posOut[i].theta;
-
-// stessa cosa per la seconda palla con 0 in thetaB2-PI/2
- posOut[flagCollCorr[i]].theta = posIn[flagCollCorr[i]].theta + PI/2 - thetaB2;
- if (posOut[flagCollCorr[i]].theta < 0)
- posOut[flagCollCorr[i]].theta += 2*PI;
- else
- if (posOut[flagCollCorr[i]].theta > 2*PI)
- posOut[flagCollCorr[i]].theta -= 2*PI;
- thetaO2 = posOut[flagCollCorr[i]].theta;
-
-
-
- thetaBarOld1 = thetaB1;
- thetaBarOld2 = thetaB2;
- thetaB1 = PI/2;
- thetaB2 = PI/2;
-
-
-
-
-// Ho l'angolo formato dalle due palle => aggiorno gli angoli rispetto
-// al nuovo sistema di riferimento
-
-
-
- if (cos(posOut[i].theta) <= 0)
- thetaV1 = PI - posOut[i].theta;
- else
- thetaV1 = -posOut[i].theta;
- if (thetaV1 < 0)
- thetaV1 = -thetaV1;
-
-
- if (cos(posOut[flagCollCorr[i]].theta) <= 0)
- thetaV2 = PI - posOut[flagCollCorr[i]].theta;
- else
- thetaV2 = -posOut[flagCollCorr[i]].theta;
- if (thetaV2 < 0)
- thetaV2 = -thetaV2;
-
-
-
- v1x = posIn[i].v * pow(cos(thetaV1), 2);
- v1y = posIn[i].v * pow(sin(thetaV1), 2);
- v2x = posIn[flagCollCorr[i]].v * pow(cos(thetaV2), 2);
- v2y = posIn[flagCollCorr[i]].v * pow(sin(thetaV2), 2);
-
-// aggiusto i segni secondo il sistema della prima palla
- if (cos(posOut[i].theta) < 0)
- v1x = -v1x;
- if (sin(posOut[i].theta) < 0)
- v1y = -v1y;
- if (cos(posOut[flagCollCorr[i]].theta) > 0)
- v2x = -v2x;
- if (sin(posOut[flagCollCorr[i]].theta) > 0)
- v2y = -v2y;
-
- if (!v1y && v2y > 0) {
- v2y = 0;
- }
-
- if (v1y < 0 && v1y < v2y) {
- v2y = v1y;
-
- }
-
-
- // nuovo modulo della velocit… della palla 1
- posOut[i].v = sqrt(pow(v1x, 2) + pow(v2y, 2));
-
-
- if (v1x) {
- phi = atan (v2y / v1x);
- if (phi < 0)
- phi = -phi;
- }
- else
- phi = PI/2;
-
- if (v1x >= 0 && v2y >= 0) {
- // primo quadrante
- phi = phi;
- }
- else
- if (v1x <= 0 && v2y >= 0) {
- // secondo quadrante
- phi = PI/2 + (PI/2-phi);
- }
- else
- if (v1x <= 0 && v2y <= 0)
- // terzo quadrante
- phi = PI + phi;
- else
- if (v1x >= 0 && v2y <= 0)
- // quarto quadrante
- phi = 3*PI/2 + (PI/2-phi);
-
- posOut[i].theta = phi;
-
-
- if (posOut[i].theta > 2*PI )
- posOut[i].theta = posOut[i].theta - 2*PI;
- else
- posOut[i].theta = posOut[i].theta;
-
-
-
-// riporto tutto nel sistema di riferimento iniziale
- posOut[i].theta += -PI/2 + thetaBarOld1;
- if (posOut[i].theta < 0)
- posOut[i].theta += 2*PI;
- else
- if (posOut[i].theta > 2*PI)
- posOut[i].theta -= 2*PI;
- posOut[flagCollCorr[i]].theta += (-PI/2 + thetaBarOld2);
- if (posOut[flagCollCorr[i]].theta < 0)
- posOut[flagCollCorr[i]].theta += 2*PI;
- else
- if (posOut[flagCollCorr[i]].theta > 2*PI)
- posOut[flagCollCorr[i]].theta -= 2*PI;
-
-
-
-
- thetaB1 = thetaBarOld1;
- thetaB2 = thetaBarOld2;
-
-
-/* if (flag2 < 4) {
-
- itoa (i, strTmp);
- grx_text(strTmp,322,185+flag2*22, gray, black );
- itoa (flagCollCorr[i], strTmp);
- grx_text(strTmp,322,195+flag2*22, gray, black );
-
- sprintf (strTmp, "%f", posIn[i].theta*360/(2*PI));
- grx_text(strTmp,342,185+flag2*22, gray, black );
- sprintf (strTmp, "%f", posIn[flagCollCorr[i]].theta*360/(2*PI));
- grx_text(strTmp,342,195+flag2*22, gray, black );
-
- sprintf (strTmp, "%f", posOut[i].theta*360/(2*PI));
- grx_text(strTmp,432,185+flag2*22, gray, black );
- sprintf (strTmp, "%f", posOut[flagCollCorr[i]].theta*360/(2*PI));
- grx_text(strTmp,432,195+flag2*22, gray, black );
-
- sprintf (strTmp, "%f", thetaB1*360/(2*PI));
- grx_text(strTmp,522,185+flag2*22, gray, black );
- sprintf (strTmp, "%f", thetaB2*360/(2*PI));
- grx_text(strTmp,522,195+flag2*22, gray, black );
-// -----------------------
- sprintf (strTmp, "%f", posIn[i].v);
- grx_text(strTmp,322,290+flag2*22, gray, black );
- sprintf (strTmp, "%f", posIn[flagCollCorr[i]].v);
- grx_text(strTmp,322,300+flag2*22, gray, black );
-
- sprintf (strTmp, "%f", v1x);
- grx_text(strTmp,412,290+flag2*22, gray, black );
- sprintf (strTmp, "%f", v2x);
- grx_text(strTmp,412,300+flag2*22, gray, black );
-
- sprintf (strTmp, "%f", v1y);
- grx_text(strTmp,502,290+flag2*22, gray, black );
- sprintf (strTmp, "%f", v2y);
- grx_text(strTmp,502,300+flag2*22, gray, black );
-
- sprintf (strTmp, "%f", posOut[i].v);
- grx_text(strTmp,582,290+flag2*22, gray, black );
- sprintf (strTmp, "%f", posOut[flagCollCorr[i]].v);
- grx_text(strTmp,582,300+flag2*22, gray, black );
-// -----------------------
- sprintf (strTmp, "%f", thetaV1*360/(2*PI));
- grx_text(strTmp,322,390+flag2*22, gray, black );
- sprintf (strTmp, "%f", thetaV2*360/(2*PI));
- grx_text(strTmp,322,400+flag2*22, gray, black );
-
- sprintf (strTmp, "%f", thetaO1*360/(2*PI));
- grx_text(strTmp,402,390+flag2*22, gray, black );
- sprintf (strTmp, "%f", thetaO2*360/(2*PI));
- grx_text(strTmp,412,400+flag2*22, gray, black );
-
- flag2++;
- }
-*/
-
- } // fine if flag1coll
-
-
-
-
-
- // questo if fa i conti del movimento di ogni pallina
- if(posOut[i].v > 0) {
-
- posOut[i].v -= acc * dt;
-
- tratto = posOut[i].v * dt -0.5*acc*dt*dt;
-
- dx = (float) (tratto * cos(posOut[i].theta));
- dy = (float) (tratto * sin(posOut[i].theta));
-
- posOut[i].x += dx;
- posOut[i].y += dy;
-
-
-
- if (posOut[i].x > BALL_XMAX) {
- posOut[i].x = BALL_XMAX;
- posOut[i].theta = PI - posOut[i].theta;
- }
-
- if (posOut[i].x < BALL_XMIN) {
- posOut[i].x = BALL_XMIN;
- posOut[i].theta = PI - posOut[i].theta;
- }
-
- if (posOut[i].y > BALL_YMAX) {
- posOut[i].y = BALL_YMAX;
- posOut[i].theta = -posOut[i].theta;
- }
-
- if (posOut[i].y < 0) {
- posOut[i].y = 0;
- posOut[i].theta = -posOut[i].theta;
- }
- }
-
- pos[i].x = posOut[i].x;
- pos[i].y = posOut[i].y;
- pos[i].v = posOut[i].v;
- pos[i].theta = posOut[i].theta;
-
- } //fine ciclo for calcolo collisioni
-
- if (!pos[0].v && !pos[1].v && !pos[2].v && !pos[3].v && !pos[4].v && !pos[5].v &&
- !pos[6].v && !pos[7].v && !pos[8].v && !pos[9].v && !pos[10].v) {
-
- for (i=0; i<BALL_MAX_P; i++) {
- flagCollPrec[i] = -1;
- }
-
- }
-
- if (bRiposiz && flag) {
- mutex_lock(&mutex);
- grx_text("Modo riposizionamento palla bianca",322,85, white, black);
- mutex_unlock(&mutex);
- flag = 0;
- }
-
-// posizionamento palla 0
- if (bRiposiz && curs) {
- if (curs == 77 && pos[0].x+R/2 <= BALL_XMAX) pos[0].x += 3;
- if (curs == 75 && pos[0].x-R >= BALL_XMIN) pos[0].x -= 3;
- curs = 0;
- }
-
-// entra in modalit… calibrazione forza
- if (ch == ' ' && !bForza && (!pos[0].v && !pos[1].v && !pos[2].v
- && !pos[3].v && !pos[4].v && !pos[5].v && !pos[6].v &&
- !pos[7].v && !pos[8].v && !pos[9].v && !pos[10].v)) {
-
- bForza = 1;
- ch = 0, v0 = 3.5;
- xCurs = pos[0].x, yCurs = BALL_Y-pos[0].y+10;
- if (yCurs >= BALL_Y) yCurs = BALL_Y-pos[0].y;
-
- mutex_lock(&mutex);
- grx_text("Modo riposizionamento palla bianca",322,85, black, black);
- grx_text("Modo calibrazione forza",322,85, white, black);
- grx_text("Forza: ",322,95, white, black);
- sprintf (strTmp, "%2f", v0);
- grx_text(strTmp,402,95, red, black);
- grx_line(xCurs-2, yCurs, xCurs+2, yCurs, red);
- grx_line(xCurs, yCurs+2, xCurs, yCurs-2, red);
- mutex_unlock(&mutex);
-
- bRiposiz = 0;
- }
-
-// calibrazione forza
- if (ch == 'a' && bForza) {
- if (v0 < 7.5)
- v0 += 0.3;
- if (v0 > 7.5)
- v0 = 7.5;
- ch = 0;
-
- mutex_lock(&mutex);
- grx_text(" ",402,95, black, black);
- sprintf (strTmp, "%2f", v0);
- grx_text(strTmp,402,95, red, black);
- mutex_unlock(&mutex);
- }
- else
- if (ch == 'z' && bForza) {
- if (v0 > 0)
- v0 -= 0.1;
- if (v0 < 0)
- v0 = 0;
- ch = 0;
-
- mutex_lock(&mutex);
- grx_text(" ",402,95, black, black);
- sprintf (strTmp, "%2f", v0);
- grx_text(strTmp,402,95, red, black);
- mutex_unlock(&mutex);
-
- }
-
-// aggiusta il mirino
- if (bForza && curs) {
- mutex_lock(&mutex);
- grx_line(xCurs-2, yCurs, xCurs+2, yCurs, black);
- grx_line(xCurs, yCurs+2, xCurs, yCurs-2, black);
- if (curs == 72 && yCurs >= BALL_Y-BALL_YMAX-1) yCurs -= 2;
- if (curs == 80 && yCurs <= BALL_Y) yCurs += 2;
- if (curs == 77 && xCurs <= BALL_XMAX) xCurs += 2;
- if (curs == 75 && xCurs >= BALL_XMIN) xCurs -= 2;
- grx_line(xCurs-2, yCurs, xCurs+2, yCurs, red);
- grx_line(xCurs, yCurs+2, xCurs, yCurs-2, red);
- mutex_unlock(&mutex);
- curs = 0;
- bRiposiz = 0;
-
- }
-
-// bevuta
- if (!pos[0].v && bBevuta) {
- pos[0].x = BALL_XMIN+100;
- pos[0].y = 50;
- pos[0].v = 0;
- pos[0].theta = 0;
- bRiposiz = 1;
- flag = 1;
- if (giocatore)
- giocatore = 0;
- else
- giocatore = 1;
- bBevuta = 0;
- mutex_lock(&mutex);
- grx_text("Modo riposizionamento palla bianca",322,85, white, black);
- mutex_unlock(&mutex);
-
- }
-
-// scocca il colpo di stecca
- if (bForza && ch == ' ') {
-
-// mutex_lock(&palmutex);
- pos[0].v = v0;
- if (pos[0].x-xCurs)
- pos[0].theta = atan ((BALL_Y-pos[0].y-yCurs)/(pos[0].x-xCurs));
- else
- pos[0].theta = PI/2;
-
- if (pos[0].theta <0)
- pos[0].theta = -pos[0].theta;
-
- if (xCurs <= pos[0].x && yCurs >= BALL_Y-pos[0].y)
- // primo quadrante
- pos[0].theta = pos[0].theta;
- else
- if (xCurs >= pos[0].x && yCurs >= BALL_Y-pos[0].y)
- // secondo quadrante
- pos[0].theta = PI/2 + (PI/2-pos[0].theta);
- else
- if (xCurs >= pos[0].x && yCurs <= BALL_Y-pos[0].y)
- // terzo quadrante
- pos[0].theta = PI + pos[0].theta;
- else
- if (xCurs <= pos[0].x && yCurs <= BALL_Y-pos[0].y)
- // quarto quadrante
- pos[0].theta = 3*PI/2 + (PI/2-pos[0].theta);
-
-
-// mutex_unlock(&palmutex);
- mutex_lock(&mutex);
- grx_line(xCurs-2, yCurs, xCurs+2, yCurs, black);
- grx_line(xCurs, yCurs+2, xCurs, yCurs-2, black);
- grx_text("Modo calibrazione forza",322,85, black, black);
- grx_text("Forza: ",322,95, black, black);
- grx_text(" ",402,95, black, black);
- mutex_unlock(&mutex);
- ch = bForza = 0;
- v0 = 0;
- bBevuta = 1;
- }
-
- if (ch == 'x') {
- for (i=0; i<BALL_MAX_P; i++) {
- flagCollPrec[i] = -1;
- }
- ch = 0;
-
- }
-
- itoa (giocatore, strTmp);
- mutex_lock(&mutex);
- grx_text(strTmp,432,110, red, black );
- itoa (punteggio[giocatore], strTmp);
- grx_text(strTmp,432,120, red, black );
- mutex_unlock(&mutex);
-
-
-// aggiornamento della posizione delle palle
- mutex_lock(&palmutex);
-
- for (i=0; i<BALL_MAX_P; i++) {
- if (controlloBuche (pos[i].x, pos[i].y, i)) {
-
- if (i) {
- pos[i].x = -10;
- pos[i].y = 30;
- pos[i].v = 0;
- pos[i].theta = 0;
- punteggio[giocatore]++;
-// itoa (npc, strTmp);
-// grx_text(strTmp,322,285, black, red );
- if (punteggio[giocatore] >= 5) {
-
- itoa (punteggio[giocatore], strTmp);
-
- if (punteggio[giocatore] > 5) {
- mutex_lock(&mutex);
- grx_text(strTmp,432,120, red, black );
- grx_text("Vittoria giocatore:",432,85, red, black);
- itoa (giocatore, strTmp);
- grx_text(strTmp,592,85, red, black );
- mutex_unlock(&mutex);
- killball ();
- }
- if (punteggio[giocatore] == 5 && npc == 2) {
- mutex_lock(&mutex);
- grx_text(strTmp,432,120, red, black );
- grx_text("Pareggio",432,85, red, black);
- mutex_unlock(&mutex);
- killball ();
- }
- }
- }
- else {
- pos[i].x = BALL_XMIN+100;
- pos[i].y = 50;
- pos[i].v = 0;
- pos[i].theta = 0;
-
- mutex_lock (&delmutex);
- ballexit[i] = 0;
- mutex_unlock (&delmutex);
-
- bRiposiz = 1;
- flag = 1;
- if (giocatore)
- giocatore = 0;
- else
- giocatore = 1;
- bBevuta = 0;
-
- }
- }
-
- PosPalla[i].x = pos[i].x;
- PosPalla[i].y = pos[i].y;
- if (pos[i].v >= 0) {
- PosPalla[i].v = pos[i].v;
- if (pos[i].theta > 2*PI )
- PosPalla[i].theta = pos[i].theta - 2*PI;
- else
- if (pos[i].theta < 0 )
- PosPalla[i].theta = pos[i].theta + 2*PI;
- else
- PosPalla[i].theta = pos[i].theta;
- }
- else {
- PosPalla[i].v = 0;
- PosPalla[i].theta = 0;
- }
- }
-
- mutex_unlock(&palmutex);
-
-
- }
- else {
- bRiposiz = 1, flag = 1;
- bBevuta = 0;
- }
-
- task_endcycle();
- } // fine ciclo while esterno
-
-}
-
-void inizioPartita () {
- if (!FlagPartita) {
- hardball();
- giocatore = 0;
- punteggio[0] = 0;
- punteggio[1] = 0;
- FlagPartita = 1;
- }
-}
-
-
-void killball() {
- int i;
-
- bForza = 0;
- mutex_lock (&delmutex);
- for (i=0; i<BALL_MAX_P; i++)
- ballexit[i] = 1;
- mutex_unlock (&delmutex);
- FlagPartita = 0;
-}
-
-
-void assegnaForza(KEY_EVT *k) {
- ch = k->ascii;
-}
-
-void movCursore (KEY_EVT *k) {
- curs = k->ascii;
-}
-
-/*
-void ballfun(KEY_EVT *k)
-{
- SOFT_TASK_MODEL mp;
- int r,g,b;
- PID pid;
- char palla_str[]="palla ";
-
- soft_task_default_model(mp);
- soft_task_def_level(mp,1);
- soft_task_def_ctrl_jet(mp);
- soft_task_def_arg(mp);
- soft_task_def_group(mp, BALL_GROUP);
- soft_task_def_met(mp, WCET_BALL);
- soft_task_def_period(mp,PERIOD_BALL);
- soft_task_def_usemath(mp);
- pid = task_create(palla_str, palla, &mp, NULL);
-
- if (pid != NIL) {
- task_activate(pid);
- }
-}
-*/
-
-// avvio dei task palla
-void hardball()
-{
- HARD_TASK_MODEL mp;
-
- PID pid;
- char pallaStr[]="palla ";
- int i;
-
- if (npc == BALL_MAX_P) return;
-
- for(i=0;i<BALL_MAX_P;i++) {
-
- ballexit[i] = 0;
-
- itoa(i,pallaStr+6);
-
- hard_task_default_model(mp);
- hard_task_def_ctrl_jet(mp);
- hard_task_def_arg(mp, (void *)i);
- hard_task_def_wcet(mp, WCET_BALL);
- hard_task_def_mit(mp,PERIOD_BALL);
- hard_task_def_group(mp, BALL_GROUP);
- hard_task_def_usemath(mp);
- pid = task_create(pallaStr, palla, &mp, NULL);
-
- if (pid == NIL) {
- grx_close();
- perror("Could not create task <pallaEDF>");
- sys_end();
- }
- else {
- npc++;
- }
- }
- group_activate (BALL_GROUP);
-}
-
-// avvio del task di contollo
-void hardSched()
-{
- HARD_TASK_MODEL mp;
-
- PID pid;
-
- hard_task_default_model(mp);
- hard_task_def_ctrl_jet(mp);
-// hard_task_def_arg(mp, (void *)1);
- hard_task_def_wcet(mp, WCET_SCHED);
- hard_task_def_mit(mp, PERIOD_SCHED);
- hard_task_def_usemath(mp);
- pid = task_create("Schedular", sched, &mp, NULL);
- if (pid == NIL) {
- grx_close();
- perror("Could not create task <Schedulatore>");
- sys_end();
- }
- else
- task_activate(pid);
-}
-
-
-
-/*--------------------------------------------------------------*/
-/* MAIN process */
-/*--------------------------------------------------------------*/
-
-void scenario_ball()
-{
- int i;
-
-
-// Margine dello schermo
- grx_rect(0, 0, 639, 479, red);
-
- grx_line(320,78,639,78,red);
- grx_line(320,0,320,479,red);
-
-// Tavolo da biliardo
- grx_rect(60,30,260,430,lime);
- for (i=1; i<27; i++) {
- grx_rect(60-i,30-i,260+i,430+i,brown);
- }
-
-// buche del tavolo
- grx_disc(62, 32, RB, black);
- grx_disc(258, 32, RB, black);
- grx_disc(62, 230, RB, black);
- grx_disc(258, 230, RB, black);
- grx_disc(62, 428, RB, black);
- grx_disc(258, 428, RB, black);
-
- grx_line(320,105,639,105,red);
- grx_line(320,130,639,130,red);
- grx_text("Giocatore:" ,322,110, red, black );
- grx_text("Punteggio:" ,322,120, red, black );
-
-}
-
-void init_ball(void)
-{
- KEY_EVT k;
-
- k.flag = 0;
- k.scan = KEY_I;
- k.ascii = 'i';
- keyb_hook(k,assegnaForza);
- keyb_hook(k,inizioPartita);
-
-
-/* intercetta il tasto 'spazio' per passare in modo posizionamento
- e modo forza, mi serve per dare un colpo di stecca */
-
- k.flag = 0;
- k.scan = KEY_SPC;
- k.ascii = ' ';
- keyb_hook(k,assegnaForza);
-
-// inizia una nuova partita
- k.flag = 0;
- k.scan = KEY_BKS;
- k.ascii = ' ';
- keyb_hook(k,killball);
-
- k.flag = 0;
- k.scan = KEY_X;
- k.ascii = 'x';
- keyb_hook(k,assegnaForza);
-
-
- k.flag = 0;
- k.scan = KEY_A;
- k.ascii = 'a';
- keyb_hook(k,assegnaForza);
-
- k.flag = 0;
- k.scan = KEY_Z;
- k.ascii = 'z';
- keyb_hook(k,assegnaForza);
-
- k.flag = COD_FRECCIA;
- k.scan = 72;
- k.ascii = 72;
- keyb_hook(k,movCursore);
-
- k.flag = COD_FRECCIA;
- k.scan = 75;
- k.ascii = 75;
- keyb_hook(k,movCursore);
-
- k.flag = COD_FRECCIA;
- k.scan = 77;
- k.ascii = 77;
- keyb_hook(k,movCursore);
-
- k.flag = COD_FRECCIA;
- k.scan = 80;
- k.ascii = 80;
- keyb_hook(k,movCursore);
-
-}
-
-// inizializzzazione task di schedulazione
-void initSched(void) {
-
- hardSched();
-}
-
-// inizializzazione delle posizioni delle palle
-void setPalla (int num) {
-
- int nPalla = num;
-
- nPalla++;
-
- switch(nPalla) {
- case 1:
- PosPalla[nPalla-1].x = BALL_XMIN + 100;
- PosPalla[nPalla-1].y = 50;
- PosPalla[nPalla-1].v = 0;
- PosPalla[nPalla-1].theta = 0;
- PosPalla[nPalla-1].col = white;
- break;
- case 2:
- PosPalla[nPalla-1].x = BALL_XMIN + 100;
- PosPalla[nPalla-1].y = 300;
- PosPalla[nPalla-1].v = 0;
- PosPalla[nPalla-1].theta = 0;
- PosPalla[nPalla-1].col = green;
- break;
- case 3:
- PosPalla[nPalla-1].x = BALL_XMIN + 90;
- PosPalla[nPalla-1].y = 310;
- PosPalla[nPalla-1].v = 0;
- PosPalla[nPalla-1].theta = 0;
- PosPalla[nPalla-1].col = green;
- break;
- case 4:
- PosPalla[nPalla-1].x = BALL_XMIN + 110;
- PosPalla[nPalla-1].y = 310;
- PosPalla[nPalla-1].v = 0;
- PosPalla[nPalla-1].theta = 0;
- PosPalla[nPalla-1].col = green;
- break;
- case 5:
- PosPalla[nPalla-1].x = BALL_XMIN + 80;
- PosPalla[nPalla-1].y = 320;
- PosPalla[nPalla-1].v = 0;
- PosPalla[nPalla-1].theta = 0;
- PosPalla[nPalla-1].col = green;
- break;
- case 6:
- PosPalla[nPalla-1].x = BALL_XMIN + 100;
- PosPalla[nPalla-1].y = 320;
- PosPalla[nPalla-1].v = 0;
- PosPalla[nPalla-1].theta = 0;
- PosPalla[nPalla-1].col = green;
- break;
- case 7:
- PosPalla[nPalla-1].x = BALL_XMIN + 120;
- PosPalla[nPalla-1].y = 320;
- PosPalla[nPalla-1].v = 0;
- PosPalla[nPalla-1].theta = 0;
- PosPalla[nPalla-1].col = green;
- break;
- case 8:
- PosPalla[nPalla-1].x = BALL_XMIN + 70;
- PosPalla[nPalla-1].y = 330;
- PosPalla[nPalla-1].v = 0;
- PosPalla[nPalla-1].theta = 0;
- PosPalla[nPalla-1].col = green;
- break;
- case 9:
- PosPalla[nPalla-1].x = BALL_XMIN + 90;
- PosPalla[nPalla-1].y = 330;
- PosPalla[nPalla-1].v = 0;
- PosPalla[nPalla-1].theta = 0;
- PosPalla[nPalla-1].col = green;
- break;
- case 10:
- PosPalla[nPalla-1].x = BALL_XMIN + 110;
- PosPalla[nPalla-1].y = 330;
- PosPalla[nPalla-1].v = 0;
- PosPalla[nPalla-1].theta = 0;
- PosPalla[nPalla-1].col = green;
- break;
- case 11:
- PosPalla[nPalla-1].x = BALL_XMIN + 130;
- PosPalla[nPalla-1].y = 330;
- PosPalla[nPalla-1].v = 0;
- PosPalla[nPalla-1].theta = 0;
- PosPalla[nPalla-1].col = green;
- break;
- default:
- PosPalla[nPalla-1].x = BALL_XMIN;
- PosPalla[nPalla-1].y = 0;
- PosPalla[nPalla-1].v = 0;
- PosPalla[nPalla-1].theta = 0;
- PosPalla[nPalla-1].col = green;
- break;
- }
-
-}
-
-// controllo quando una palla finisce in buca
-int controlloBuche (float x, float yRel, int i) {
-
- float y;
-
- y = BALL_Y - yRel;
- if ((x <= 62+RB && y <= 32+RB) || (x >= 258-RB && y <= 32+RB) ||
- (x <= 62+RB && (y >= 230-RB && y <= 230+RB)) || (x >= 258-RB && (y >= 230-RB && y <= 230+RB)) ||
- (x <= 62+RB && y >= 428-RB) || (x >= 258-RB && y >= 428-RB)){
-
- // palla in buca
- mutex_lock (&delmutex);
- ballexit[i] = 1;
- mutex_unlock (&delmutex);
-
- return (1);
- }
- return (0);
-}
Index: rel_1_21/biliardo/biliardo.h
===================================================================
--- rel_1_21/biliardo/biliardo.h (revision 1217)
+++ rel_1_21/biliardo/biliardo.h (nonexistent)
@@ -1,102 +0,0 @@
-#include <ll/ll.h>
-#include <kernel/types.h>
-#include <kernel/descr.h>
-#include <math.h>
-#include <drivers/glib.h>
-#include <drivers/keyb.h>
-
-#include <modules/hartport.h>
-#include <modules/sem.h>
-
-#define JET_ON
-#define BALL_ON
-
-/*
- *
- * WCET, Periods and Models
- *
- */
-
-
-/* define if you want NRT or SOFT... */
-#define TASK_TYPE SOFT
-//#define TASK_TYPE NRT
-
-#define WCET_JETCTRL 7500
-#define WCET_JETDUMMY 200
-#define WCET_JETSLIDE 2100
-
-#define PERIOD_JETCTRL 100000
-#define PERIOD_JETDUMMY 100000
-#define PERIOD_JETSLIDE 100000
-
-#define JET_GROUP 1
-
-
-#define WCET_BALL 600
-
-#define PERIOD_BALL 20000
-
-#define WCET_SCHED 1200
-
-#define PERIOD_SCHED 15000
-
-
-/* graphic mutex... */
-extern mutex_t mutex;
-
-extern mutex_t palmutex;
-extern mutex_t delmutex;
-
-/* useful colors... */
-extern int white;
-extern int black;
-extern int red;
-extern int gray;
-extern int green;
-extern int lime;
-extern int brown;
-
-void init_jetcontrol();
-void init_ball(void);
-void scenario_jetcontrol();
-void scenario_ball();
-char *itoa(int n, char *s);
-int myrand(int x);
-
-void initSched(void);
-void setPalla (int);
-void inizioPartita (void);
-void collisioneRilevata(int);
-int controlloBuche (float, float, int);
-void hardSched (void);
-void hardball (void);
-void killball (void);
-void assegnaForza (KEY_EVT *);
-
-
-#define JET_NTASK 15
-#define JET_Y_NAME 260
-
-#define DUMMY_PID 1
-
-#define JET_DUMMY_WIDTH 250
-#define JET_DUMMY_HEIGHT 80
-
-#define JET_DUMMY_X 370
-#define JET_DUMMY_Y 150
-
-#define JET_SLIDE_WIDTH 50
-#define JET_SLIDE_X 566
-
-
-
-#define BALL_YMAX 390 /* position of the ceil */
-#define BALL_Y 425 /* position of the floor */
-#define BALL_XMIN 65 /* min position X of the ball */
-#define BALL_XMAX 255 /* max position X of the ball */
-#define BALL_MAX_P 11 // numero di palle
-
-#define BALL_GROUP 2 // gruppo palla
-
-
Index: rel_1_21/biliardo/makefile
===================================================================
--- rel_1_21/biliardo/makefile (revision 1217)
+++ rel_1_21/biliardo/makefile (nonexistent)
@@ -1,16 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS=biliardo
-
-include $(BASE)/config/example.mk
-
-biliardo:
- make -f $(SUBMAKE) APP=biliardo INIT= OTHEROBJS="initfil1.o jetctrl.o palla.o" OTHERINCL= SHARKOPT="__OLDCHAR__ __GRX__"
-
Index: rel_1_21/biliardo/posizion.h
===================================================================
--- rel_1_21/biliardo/posizion.h (revision 1217)
+++ rel_1_21/biliardo/posizion.h (nonexistent)
@@ -1,11 +0,0 @@
-// definizione della struttura contenente la posizione delle palle
-
-struct posizione {
- float x;
- float y;
- float v;
- float theta;
- int col;
-} ;
-
-
Index: rel_1_21/biliardo/initfil1.c
===================================================================
--- rel_1_21/biliardo/initfil1.c (revision 1217)
+++ rel_1_21/biliardo/initfil1.c (nonexistent)
@@ -1,70 +0,0 @@
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-#include "modules/pi.h"
-#include "modules/pc.h"
-#include "modules/srp.h"
-#include "modules/npp.h"
-#include "modules/nop.h"
-
-#include "drivers/keyb.h"
-
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 2000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- CBS_register_level(CBS_ENABLE_ALL, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
-
- SEM_register_module();
-
- CABS_register_module();
-
- PI_register_module();
- NOP_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- keyb_def_ctrlC(kparms, NULL);
- KEYB_init(&kparms);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
-
-void app_mutex_init(mutex_t *m)
-{
- PI_mutexattr_t attr;
-
- PI_mutexattr_default(attr);
-
- mutex_init(m, &attr);
-}
-
Index: rel_1_21/edfact/edfact.c
===================================================================
--- rel_1_21/edfact/edfact.c (revision 1217)
+++ rel_1_21/edfact/edfact.c (nonexistent)
@@ -1,567 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: edfact.c,v 1.4 2003-01-07 17:10:16 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.4 $
- Last update: $Date: 2003-01-07 17:10:16 $
- ------------
-**/
-
-/*
- * Copyright (C) 2001 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "edfact.h"
-#include <ll/stdio.h>
-#include <ll/string.h>
-#include <kernel/model.h>
-#include <kernel/descr.h>
-#include <kernel/var.h>
-#include <kernel/func.h>
-#include <kernel/trace.h>
-
-//#define edfact_printf kern_printf
-#define edfact_printf printk
-
-/*+ Status used in the level +*/
-#define EDFACT_READY MODULE_STATUS_BASE /*+ - Ready status +*/
-#define EDFACT_IDLE MODULE_STATUS_BASE+4 /*+ to wait the deadline +*/
-
-/*+ flags +*/
-#define EDFACT_FLAG_NORAISEEXC 2
-
-/*+ the level redefinition for the Earliest Deadline First level +*/
-typedef struct {
- level_des l; /*+ the standard level descriptor +*/
-
- TIME period[MAX_PROC]; /*+ The task periods; the deadlines are
- stored in the priority field +*/
- int deadline_timer[MAX_PROC];
- /*+ The task deadline timers +*/
-
- struct timespec deadline_timespec[MAX_PROC];
-
- int dline_miss[MAX_PROC]; /*+ Deadline miss counter +*/
- int wcet_miss[MAX_PROC]; /*+ Wcet miss counter +*/
-
- int nact[MAX_PROC]; /*+ Wcet miss counter +*/
-
- int flag[MAX_PROC];
- /*+ used to manage the JOB_TASK_MODEL and the
- periodicity +*/
-
- IQUEUE ready; /*+ the ready queue +*/
-
- int flags; /*+ the init flags... +*/
-
- bandwidth_t U; /*+ the used bandwidth +*/
-
-} EDFACT_level_des;
-
-
-static void EDFACT_timer_deadline(void *par);
-
-static void EDFACT_internal_activate(EDFACT_level_des *lev, PID p,
- struct timespec *t)
-{
- struct timespec *temp;
-
- temp = iq_query_timespec(p, &lev->ready);
-
- TIMESPEC_ASSIGN(temp,t);
- ADDUSEC2TIMESPEC(lev->period[p], temp);
-
- TIMESPEC_ASSIGN(&lev->deadline_timespec[p],
- temp);
-
- /* Insert task in the correct position */
- proc_table[p].status = EDFACT_READY;
- iq_timespec_insert(p,&lev->ready);
-
- /* needed because when there is a wcet miss I disable CONTROL_CAP */
- proc_table[p].control |= CONTROL_CAP;
-}
-
-static void EDFACT_timer_deadline(void *par)
-{
- PID p = (PID) par;
- EDFACT_level_des *lev;
-
- lev = (EDFACT_level_des *)level_table[proc_table[p].task_level];
-
- switch (proc_table[p].status) {
- case EDFACT_IDLE:
- edfact_printf("I%d",p);
-
- EDFACT_internal_activate(lev,p, &lev->deadline_timespec[p]);
-
- event_need_reschedule();
- break;
-
- default:
- edfact_printf("D%d",p);
- /* else, a deadline miss occurred!!! */
- lev->dline_miss[p]++;
-
- /* the task is into another state */
- lev->nact[p]++;
-
- /* Set the deadline timer */
- ADDUSEC2TIMESPEC(lev->period[p], &lev->deadline_timespec[p]);
- }
-
- /* Set the deadline timer */
- lev->deadline_timer[p] = kern_event_post(&lev->deadline_timespec[p],
- EDFACT_timer_deadline,
- (void *)p);
-
-}
-
-static void EDFACT_timer_guest_deadline(void *par)
-{
- PID p = (PID) par;
-
- edfact_printf("AAARRRGGGHHH!!!");
- kern_raise(XDEADLINE_MISS,p);
-}
-
-
-/* The scheduler only gets the first task in the queue */
-static PID EDFACT_public_scheduler(LEVEL l)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- return iq_query_first(&lev->ready);
-}
-
-/* The on-line guarantee is enabled only if the appropriate flag is set... */
-static int EDFACT_public_guarantee(LEVEL l, bandwidth_t *freebandwidth)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- if (lev->flags & EDFACT_FAILED_GUARANTEE) {
- *freebandwidth = 0;
- return 0;
- }
- else
- if (*freebandwidth >= lev->U) {
- *freebandwidth -= lev->U;
- return 1;
- }
- else
- return 0;
-
-}
-
-static int EDFACT_public_create(LEVEL l, PID p, TASK_MODEL *m)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- HARD_TASK_MODEL *h;
-
- if (m->pclass != HARD_PCLASS) return -1;
- if (m->level != 0 && m->level != l) return -1;
- h = (HARD_TASK_MODEL *)m;
- if (!h->wcet || !h->mit || h->periodicity != PERIODIC) return -1;
- /* now we know that m is a valid model */
-
- lev->period[p] = h->mit;
-
- lev->flag[p] = 0;
- lev->deadline_timer[p] = -1;
- lev->dline_miss[p] = 0;
- lev->wcet_miss[p] = 0;
- lev->nact[p] = 0;
-
- /* Enable wcet check */
- proc_table[p].avail_time = h->wcet;
- proc_table[p].wcet = h->wcet;
- proc_table[p].control |= CONTROL_CAP;
-
- /* update the bandwidth... */
- if (lev->flags & EDFACT_ENABLE_GUARANTEE) {
- bandwidth_t b;
- b = (MAX_BANDWIDTH / h->mit) * h->wcet;
-
- /* really update lev->U, checking an overflow... */
- if (MAX_BANDWIDTH - lev->U > b)
- lev->U += b;
- else
- /* The task can NOT be guaranteed (U>MAX_BANDWIDTH)...
- in this case, we don't raise an exception... in fact, after the
- EDFACT_task_create the task_create will call level_guarantee that return
- -1... return -1 in EDFACT_task_create isn't correct, because:
- . generally, the guarantee must be done when also the resources
- are registered
- . returning -1 will cause the task_create to return with an errno
- ETASK_CREATE instead of ENO_GUARANTEE!!!
-
- Why I use the flag??? because if the lev->U overflows, if i.e. I set
- it to MAX_BANDWIDTH, I lose the correct allocated bandwidth...
- */
- lev->flags |= EDFACT_FAILED_GUARANTEE;
- }
-
- return 0; /* OK, also if the task cannot be guaranteed... */
-}
-
-static void EDFACT_public_detach(LEVEL l, PID p)
-{
- /* the EDFACT level doesn't introduce any dinamic allocated new field.
- we have only to reset the NO_GUARANTEE FIELD and decrement the allocated
- bandwidth */
-
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- if (lev->flags & EDFACT_FAILED_GUARANTEE)
- lev->flags &= ~EDFACT_FAILED_GUARANTEE;
- else
- lev->U -= (MAX_BANDWIDTH / lev->period[p]) * proc_table[p].wcet;
-}
-
-static void EDFACT_public_dispatch(LEVEL l, PID p, int nostop)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- /* the task state is set EXE by the scheduler()
- we extract the task from the ready queue
- NB: we can't assume that p is the first task in the queue!!! */
- iq_extract(p, &lev->ready);
-}
-
-static void EDFACT_public_epilogue(LEVEL l, PID p)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- /* check if the wcet is finished... */
- if (proc_table[p].avail_time <= 0 && proc_table[p].control&CONTROL_CAP) {
- /* wcet finished: disable wcet event and count wcet miss */
- edfact_printf("W%d",p);
- proc_table[p].control &= ~CONTROL_CAP;
- lev->wcet_miss[p]++;
- }
-
- /* the task it returns into the ready queue... */
- iq_timespec_insert(p,&lev->ready);
- proc_table[p].status = EDFACT_READY;
-}
-
-static void EDFACT_public_activate(LEVEL l, PID p)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
- struct timespec t;
-
- /* Test if we are trying to activate a non sleeping task */
- /* save activation (only if needed... */
- if (proc_table[p].status != SLEEP) {
- /* a periodic task cannot be activated when it is already active */
- kern_raise(XACTIVATION,p);
- return;
- }
-
- kern_gettime(&t);
- EDFACT_internal_activate(lev,p, &t);
-
- /* Set the deadline timer */
- lev->deadline_timer[p] = kern_event_post(&lev->deadline_timespec[p],
- EDFACT_timer_deadline,
- (void *)p);
-
-}
-
-static void EDFACT_public_unblock(LEVEL l, PID p)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- /* Insert task in the coEDFect position */
- proc_table[p].status = EDFACT_READY;
- iq_timespec_insert(p,&lev->ready);
-}
-
-static void EDFACT_public_block(LEVEL l, PID p)
-{
-}
-
-static int EDFACT_public_message(LEVEL l, PID p, void *m)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
- struct timespec t;
-
- /* we reset the capacity counters... */
- proc_table[p].avail_time = proc_table[p].wcet;
-
- if (lev->nact[p] > 0) {
- edfact_printf("E%d",p);
-
- /* Pending activation: reactivate the thread!!! */
- lev->nact[p]--;
-
- /* see also EDFACT_timer_deadline */
- kern_gettime(&t);
- EDFACT_internal_activate(lev,p, &t);
-
- /* check if the deadline has already expired */
- if (TIMESPEC_A_LT_B(iq_query_timespec(p, &lev->ready), &schedule_time)) {
- /* count the deadline miss */
- lev->dline_miss[p]++;
- kern_event_delete(lev->deadline_timer[p]);
- }
-
- }
- else {
- edfact_printf("e%d",p);
-
- /* the task has terminated his job before it consume the wcet. All OK! */
- proc_table[p].status = EDFACT_IDLE;
-
- /* when the deadline timer fire, it recognize the situation and set
- correctly all the stuffs (like reactivation, etc... ) */
- }
-
- jet_update_endcycle(); /* Update the Jet data... */
- trc_logevent(TRC_ENDCYCLE,&exec_shadow); /* tracer stuff */
-
- return 0;
-}
-
-static void EDFACT_public_end(LEVEL l, PID p)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- edfact_printf("Û%d",p);
-
- /* we finally put the task in the ready queue */
- proc_table[p].status = FREE;
- iq_insertfirst(p,&freedesc);
- /* and free the allocated bandwidth */
- lev->U -= (MAX_BANDWIDTH/lev->period[p]) * proc_table[p].wcet;
-
- if (lev->deadline_timer[p] != -1) {
- edfact_printf("²%d",p);
- kern_event_delete(lev->deadline_timer[p]);
- }
-}
-
-
-/* Guest Functions
- These functions manages a JOB_TASK_MODEL, that is used to put
- a guest task in the EDFACT ready queue. */
-
-static void EDFACT_private_insert(LEVEL l, PID p, TASK_MODEL *m)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- JOB_TASK_MODEL *job;
-
- if (m->pclass != JOB_PCLASS || (m->level != 0 && m->level != l) ) {
- kern_raise(XINVALID_TASK, p);
- return;
- }
-
- job = (JOB_TASK_MODEL *)m;
-
- TIMESPEC_ASSIGN(iq_query_timespec(p, &lev->ready), &job->deadline);
-
- lev->deadline_timer[p] = -1;
- lev->dline_miss[p] = 0;
- lev->wcet_miss[p] = 0;
- lev->nact[p] = 0;
-
- if (job->noraiseexc)
- lev->flag[p] = EDFACT_FLAG_NORAISEEXC;
- else {
- lev->flag[p] = 0;
- lev->deadline_timer[p] = kern_event_post(iq_query_timespec(p, &lev->ready),
- EDFACT_timer_guest_deadline,
- (void *)p);
- }
-
- lev->period[p] = job->period;
-
- /* Insert task in the correct position */
- iq_timespec_insert(p,&lev->ready);
- proc_table[p].status = EDFACT_READY;
-
- /* there is no bandwidth guarantee at this level, it is performed
- by the level that inserts guest tasks... */
-}
-
-static void EDFACT_private_dispatch(LEVEL l, PID p, int nostop)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- /* the task state is set to EXE by the scheduler()
- we extract the task from the ready queue
- NB: we can't assume that p is the first task in the queue!!! */
- iq_extract(p, &lev->ready);
-}
-
-static void EDFACT_private_epilogue(LEVEL l, PID p)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- /* the task has been preempted. it returns into the ready queue... */
- iq_timespec_insert(p,&lev->ready);
- proc_table[p].status = EDFACT_READY;
-}
-
-static void EDFACT_private_extract(LEVEL l, PID p)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- //kern_printf("EDFACT_guest_end: dline timer %d\n",lev->deadline_timer[p]);
- if (proc_table[p].status == EDFACT_READY)
- {
- iq_extract(p, &lev->ready);
- //kern_printf("(g_end rdy extr)");
- }
-
- /* we remove the deadline timer, because the slice is finished */
- if (lev->deadline_timer[p] != NIL) {
-// kern_printf("EDFACT_guest_end: dline timer %d\n",lev->deadline_timer[p]);
- kern_event_delete(lev->deadline_timer[p]);
- lev->deadline_timer[p] = NIL;
- }
-
-}
-
-/* Registration functions */
-
-/*+ Registration function:
- int flags the init flags ... see EDFACT.h +*/
-LEVEL EDFACT_register_level(int flags)
-{
- LEVEL l; /* the level that we register */
- EDFACT_level_des *lev; /* for readableness only */
- PID i; /* a counter */
-
- printk("EDFACT_register_level\n");
-
- /* request an entry in the level_table */
- l = level_alloc_descriptor(sizeof(EDFACT_level_des));
-
- lev = (EDFACT_level_des *)level_table[l];
-
- printk(" lev=%d\n",(int)lev);
-
- /* fill the standard descriptor */
- lev->l.private_insert = EDFACT_private_insert;
- lev->l.private_extract = EDFACT_private_extract;
- lev->l.private_dispatch = EDFACT_private_dispatch;
- lev->l.private_epilogue = EDFACT_private_epilogue;
-
- lev->l.public_scheduler = EDFACT_public_scheduler;
- if (flags & EDFACT_ENABLE_GUARANTEE)
- lev->l.public_guarantee = EDFACT_public_guarantee;
- else
- lev->l.public_guarantee = NULL;
- lev->l.public_create = EDFACT_public_create;
- lev->l.public_detach = EDFACT_public_detach;
- lev->l.public_end = EDFACT_public_end;
- lev->l.public_dispatch = EDFACT_public_dispatch;
- lev->l.public_epilogue = EDFACT_public_epilogue;
- lev->l.public_activate = EDFACT_public_activate;
- lev->l.public_unblock = EDFACT_public_unblock;
- lev->l.public_block = EDFACT_public_block;
- lev->l.public_message = EDFACT_public_message;
-
- /* fill the EDFACT descriptor part */
- for(i=0; i<MAX_PROC; i++) {
- lev->period[i] = 0;
- lev->deadline_timer[i] = -1;
- lev->flag[i] = 0;
- lev->dline_miss[i] = 0;
- lev->wcet_miss[i] = 0;
- lev->nact[i] = 0;
- }
-
- iq_init(&lev->ready,&freedesc, 0);
- lev->flags = flags & 0x07;
- lev->U = 0;
-
- return l;
-}
-
-bandwidth_t EDFACT_usedbandwidth(LEVEL l)
-{
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- return lev->U;
-}
-
-int EDFACT_get_dline_miss(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- return lev->dline_miss[p];
-}
-
-int EDFACT_get_wcet_miss(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- return lev->wcet_miss[p];
-}
-
-int EDFACT_get_nact(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- return lev->nact[p];
-}
-
-int EDFACT_reset_dline_miss(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- lev->dline_miss[p] = 0;
- return 0;
-}
-
-int EDFACT_reset_wcet_miss(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- EDFACT_level_des *lev = (EDFACT_level_des *)(level_table[l]);
-
- lev->wcet_miss[p] = 0;
- return 0;
-}
-
Index: rel_1_21/edfact/testact.c
===================================================================
--- rel_1_21/edfact/testact.c (revision 1217)
+++ rel_1_21/edfact/testact.c (nonexistent)
@@ -1,245 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: testact.c,v 1.1.1.1 2002-09-02 09:37:41 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:41 $
- ------------
-**/
-
-/*
- * Copyright (C) 2001 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/* the demo tests EDFACT with my Celeron 366 Mhz.
-Aster1 meet all wcets and all deadlines
-Aster2 miss all wcets but hits all the deadlines
-Aster3 blocks on a semaphore so it miss all the deadlines and it accumulates
- pending activations
-Aster4 does 5 states:
- 1: is a cycle, long enough to cope a little more than 2 periods
- 2-5: like aster1, they meets all the wcet and deadlines
- the debug pattern is something like
- WDDEEeIeIeI
- W wcet violated
- D deadline miss event
- E endcycle with automatic reactivation due to pending activations
- e normal endcycle
- I normal reactivation event
-
-
-*/
-
-
-#include <kernel/kern.h>
-#include <semaphore.h>
-#include "edfact.h"
-
-PID p1,p2,p3,p4;
-
-sem_t sem;
-
-#define ASTER_LIM 77
-
-TASK aster1(void *arg)
-{
- int i = 10;
- int y = 10+exec_shadow;
-
- printf_xy(1,y,WHITE,"%d", exec_shadow);
- while (i < ASTER_LIM) {
- puts_xy(i,y,WHITE,"*");
- task_endcycle();
-
- puts_xy(i,y,WHITE," ");
- i++;
- }
-
- return 0;
-}
-
-TASK aster2(void *arg)
-{
- int i = 10;
- int y = 10+exec_shadow;
- int x;
-
- printf_xy(1,y,WHITE,"%d", exec_shadow);
- while (i < ASTER_LIM) {
- puts_xy(i,y,WHITE,"*");
- for(x=0; x<1000000; x++);
- task_endcycle();
-
- puts_xy(i,y,WHITE," ");
- i++;
- }
-
- return 0;
-}
-
-TASK aster3(void *arg)
-{
- int i = 10;
- int y = 10+exec_shadow;
-
- printf_xy(1,y,WHITE,"%d", exec_shadow);
- while (i < ASTER_LIM) {
- puts_xy(i,y,WHITE,"*");
- sem_wait(&sem);
- task_endcycle();
-
- puts_xy(i,y,WHITE," ");
- i++;
- }
-
- return 0;
-}
-
-TASK aster4(void *arg)
-{
- int i = 10;
- int y = 10+exec_shadow;
- int x;
- int flag = 0;
-
- printf_xy(1,y,WHITE,"%d", exec_shadow);
- while (i < ASTER_LIM) {
- puts_xy(i,y,WHITE,"*");
-
- switch (flag) {
- case 0:
- kern_printf("!");
- for(x=0; x<5000000; x++) flag=1;
- break;
- case 1:
- flag = 2;
- break;
- case 2:
- flag = 3;
- break;
- case 3:
- flag = 4;
- break;
- case 4:
- flag = 0;
- break;
- }
-
- task_endcycle();
-
- puts_xy(i,y,WHITE," ");
- i++;
- }
-
- return 0;
-}
-
-
-
-TASK clock()
-{
- printf_xy(50,19,WHITE,"PID miss wcet nact");
- while(1) {
- printf_xy(50,20,WHITE,"%3d %4d %4d %4d",
- p1, EDFACT_get_dline_miss(p1),
- EDFACT_get_wcet_miss(p1),
- EDFACT_get_nact(p1));
- printf_xy(50,21,WHITE,"%3d %4d %4d %4d",
- p2, EDFACT_get_dline_miss(p2),
- EDFACT_get_wcet_miss(p2),
- EDFACT_get_nact(p2));
- printf_xy(50,22,WHITE,"%3d %4d %4d %4d",
- p3, EDFACT_get_dline_miss(p3),
- EDFACT_get_wcet_miss(p3),
- EDFACT_get_nact(p3));
- printf_xy(50,23,WHITE,"%3d %4d %4d %4d",
- p4, EDFACT_get_dline_miss(p4),
- EDFACT_get_wcet_miss(p4),
- EDFACT_get_nact(p4));
- }
-}
-
-int main(int argc, char **argv)
-{
- NRT_TASK_MODEL n;
-
- HARD_TASK_MODEL m;
-
- kern_printf("\nCtrl-C = end demo\n");
-
- hard_task_default_model(m);
- hard_task_def_mit(m,200000);
- hard_task_def_group(m,1);
-
- sem_init(&sem,0,0);
-
- hard_task_def_wcet(m,2000);
- p1 = task_create("1",aster1,&m,NULL);
- if (p1 == -1) {
- perror("Aster.C(main): Could not create task <aster> ...");
- sys_end();
- }
-
- hard_task_def_wcet(m,2000);
- p2 = task_create("1",aster2,&m,NULL);
- if (p2 == -1) {
- perror("Aster.C(main): Could not create task <aster> ...");
- sys_end();
- }
-
- hard_task_def_wcet(m,2000);
- p3 = task_create("1",aster3,&m,NULL);
- if (p3 == -1) {
- perror("Aster.C(main): Could not create task <aster> ...");
- sys_end();
- }
-
- hard_task_def_mit(m,20000);
- hard_task_def_wcet(m,500);
- p4 = task_create("1",aster4,&m,NULL);
- if (p4 == -1) {
- perror("Aster.C(main): Could not create task <aster> ...");
- sys_end();
- }
-
- group_activate(1);
-
- nrt_task_default_model(n);
- task_activate(task_create("Clock",clock,&n,NULL));
- return 0;
-}
-
Index: rel_1_21/edfact/edfact.h
===================================================================
--- rel_1_21/edfact/edfact.h (revision 1217)
+++ rel_1_21/edfact/edfact.h (nonexistent)
@@ -1,152 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: edfact.h,v 1.2 2003-01-07 17:10:16 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-01-07 17:10:16 $
- ------------
-
- This file contains the server EDFACT (EDF with pending activations)
-
- Title:
- EDFACT
-
- Task Models Accepted:
- HARD_TASK_MODEL - Hard Tasks (only Periodic)
- wcet field and mit field must be != 0. They are used to set the wcet
- and period of the tasks.
- periodicity field can be only PERIODIC
- drel field is ignored
-
- Guest Models Accepted:
- JOB_TASK_MODEL - a single guest task activation
- Identified by an absolute deadline and a period.
- period field is ignored
-
- Description:
- This module schedule his tasks following the classic EDF scheme.
- The task guarantee is based on the factor utilization approach.
- The tasks scheduled are only periodic.
- All the task are put in a queue and the scheduling is based on the
- deadline value.
- NO GUARANTEE is performed on guest tasks. The guarantee must be performed
- by the level that inserts guest tasks in the EDF level.
- If a task miss a deadline a counter is incremented.
- If a task exausts the wcet a counter is incremented
- No ZOMBIE support!!!!!!
-
- Exceptions raised:
- XUNVALID_GUEST XUNVALID_TASK
- some primitives are not implemented:
- task_sleep, task_delay, guest_endcycle, guest_sleep, guest_delay
-
- XACTIVATION
- If a task is actiated through task_activate or guest_activate more than
- one time
-
- Restrictions & special features:
- - This level doesn't manage the main task.
- - At init time we have to specify:
- . guarantee check
- (when all task are created the system will check that the task_set
- will not use more than the available bandwidth)
- - A function to return the used bandwidth of the level is provided.
- - Functions to return and reset the nact, wcet and dline miss counters
-
-**/
-
-/*
- * Copyright (C) 2001 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#ifndef __EDFACT_H__
-#define __EDFACT_H__
-
-#include <ll/ll.h>
-#include <kernel/config.h>
-#include <sys/types.h>
-#include <kernel/types.h>
-
-
-
-
-
-
-
-
-/*+ flags... +*/
-#define EDFACT_ENABLE_GUARANTEE 1 /*+ Task Guarantee enabled +*/
-#define EDFACT_ENABLE_ALL 1
-
-#define EDFACT_FAILED_GUARANTEE 8 /*+ used in the module, unsettabl
- in EDF_register_level... +*/
-
-
-
-
-
-#define ELASTIC_HARD_PCLASS 0x0600
-
-#define EDFACT_LEVELNAME "EDFACT base"
-#define EDFACT_LEVEL_CODE 166
-#define EDFACT_LEVEL_VERSION 1
-
-
-/*+ Registration function:
- int flags Options to be used in this level instance...
-
- returns the level number at which the module has been registered.
-+*/
-LEVEL EDFACT_register_level(int flags);
-
-/*+ Returns the used bandwidth of a level +*/
-bandwidth_t EDFACT_usedbandwidth(LEVEL l);
-
-/*+ returns respectively the number of dline, wcet or nact; -1 if error +*/
-int EDFACT_get_dline_miss(PID p);
-int EDFACT_get_wcet_miss(PID p);
-int EDFACT_get_nact(PID p);
-
-/*+ resets respectively the number of dline, wcet miss; -1 if error +*/
-int EDFACT_reset_dline_miss(PID p);
-int EDFACT_reset_wcet_miss(PID p);
-
-#endif
-
Index: rel_1_21/edfact/readme
===================================================================
--- rel_1_21/edfact/readme (revision 1217)
+++ rel_1_21/edfact/readme (nonexistent)
@@ -1,31 +0,0 @@
-EDFACT Scheduling Module
-------------------------
-by Paolo Gai 2001
-
-
-Pisa, 6, Jun 2001
-
-This Module implements a EDF scheduler.
-
-It is very similar to the EDF Module distributed with the kernel sources,
-except that:
-- It does not support hard sporadic tasks
-- It does not raise a deadline exception
-- It does not raise a wcet violation exception
-- Instead of raising an exception, the module simply COUNTS deadline misses
- and wcet exaustions..
-
-Since a large part of the applications use only periodic tasks, this Module
-can be a great improvement because the application will not hang up at
-the first exception!!! (and this happens frequently when switching to a
-slower PC :-( )
-
-I also wrote a simple test to show how the module works...
-
-To use the Module in your applications, simply copy the edfact.c and edfact.h
-into your application directory, and register edfact instead of the
-tradictional edf...
-
-For bugs, questions and comments please write to pj@sssup.it
-
-Paolo
Index: rel_1_21/edfact/makefile
===================================================================
--- rel_1_21/edfact/makefile (revision 1217)
+++ rel_1_21/edfact/makefile (nonexistent)
@@ -1,16 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS= testact
-
-include $(BASE)/config/example.mk
-
-testact:
- make -f $(SUBMAKE) APP=testact INIT= OTHEROBJS="initfile.o edfact.o" OTHERINCL= SHARKOPT=__OLDCHAR__
-
Index: rel_1_21/edfact/initfile.c
===================================================================
--- rel_1_21/edfact/initfile.c (revision 1217)
+++ rel_1_21/edfact/initfile.c (nonexistent)
@@ -1,99 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: initfile.c,v 1.1.1.1 2002-09-02 09:37:41 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:41 $
- ------------
-*/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "edfact.h"
-#include "modules/cbs.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDFACT_register_level(EDFACT_ENABLE_ALL);
- CBS_register_level(CBS_ENABLE_ALL, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- SEM_register_module();
-
- CABS_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- //keyb_def_ctrlC(kparms, NULL);
- keyb_def_map(kparms,itaMap);
- KEYB_init(&kparms);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
Index: rel_1_21/parport/makefile
===================================================================
--- rel_1_21/parport/makefile (revision 1217)
+++ rel_1_21/parport/makefile (nonexistent)
@@ -1,16 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS= ppdemo
-
-include $(BASE)/config/example.mk
-
-ppdemo:
- make -f $(SUBMAKE) APP=ppdemo INIT= OTHEROBJS="initfile.o" OTHERINCL= SHARKOPT="__OLDCHAR__ __PPORT__ __GRX__"
-
Index: rel_1_21/parport/initfile.c
===================================================================
--- rel_1_21/parport/initfile.c (revision 1217)
+++ rel_1_21/parport/initfile.c (nonexistent)
@@ -1,120 +0,0 @@
-/*
- *
- * Project:
- * Parallel Port S.Ha.R.K. Project
- *
- * Module:
- * Initfile.c
- *
- * Description:
- * System initialization file
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors:
- * Andrea Battistotti <btandrea@libero.it>
- * Armando Leggio <a_leggio@hotmail.com>
- *
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- *
-
-
- System initialization file
-
- This file contains the 2 functions needed to initialize the system.
-
- These functions register the following levels:
-
- an EDF (Earliest Deadline First) level
- a RR (Round Robin) level
- a CBS (Costant Bandwidth Server) level
- a Dummy level
-
- It can accept these task models:
-
- HARD_TASK_MODEL (wcet+mit) at level 0
- SOFT_TASK_MODEL (met, period) at level 1
- NRT_TASK_MODEL at level 2
-
- This file is similar to the configuration of kernel/init/hartik3.c
-
- TICK is set to 0 (one-shot timer is used)
-*/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-/* #define TICK 100 */
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- CBS_register_level(CBS_ENABLE_ALL, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- SEM_register_module();
-
- CABS_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- keyb_def_ctrlC(kparms, NULL);
- keyb_def_map(kparms,itaMap);
- KEYB_init(&kparms);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
Index: rel_1_21/parport/ppdemo.c
===================================================================
--- rel_1_21/parport/ppdemo.c (revision 1217)
+++ rel_1_21/parport/ppdemo.c (nonexistent)
@@ -1,495 +0,0 @@
-/*
- *
- * Project:
- * Parallel Port S.Ha.R.K. Project
- *
- * Module:
- * ppDemo.c
- *
- * Description:
- * file contents description
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors:
- * Andrea Battistotti <btandrea@libero.it>
- * Armando Leggio <a_leggio@hotmail.com>
- *
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- *
- */
-
-/**
- ------------
- CVS : $Id: ppdemo.c,v 1.3 2003-03-24 11:18:19 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.3 $
- Last update: $Date: 2003-03-24 11:18:19 $
- ------------
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai and Giorgio Buttazzo
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/****************************************************************/
-/* PERIODIC PROCESS TEST */
-/****************************************************************/
-
-
-#include <drivers/parport.h>
-#include <drivers/keyb.h>
-#include <drivers/glib.h>
-
-#define TSK_PERIOD 250000 /*400000 ok for debug...*/
-#define TSK_WCET 70000
-
-
-#define YMENU 10 /* menu level */
-#define XMIN 10
-#define XMAX 630
-#define YMIN 10
-#define YMAX 470
-#define ESC 27 /* ASCII code of ESCAPE key */
-#define X0
-#define GRXWND_COLS 33
-#define GRXWND_LINS 15
-
-
-
-void ppInitGrxWnd(void)
-{
- /* graphic preparation */
- /* graphic card Initialization */
- if (grx_init() < 1) {
- sys_abort(1);
- }
-
- if (grx_open(640, 480, 8) < 0) {
- kern_printf("GRX Err\n");
- sys_abort(1);
- }
- kern_printf("Video card ok!\n");
- /* The scenario */
-
- // Background
- grx_clear(6);
-
- // Frame
- grx_rect(XMIN-1, YMIN-1, XMAX+1, YMAX+1, 0);
-
- // Window 1
- grx_box(XMIN+14,YMIN+14,XMAX-317,YMAX-235,7); //window
- grx_box(XMIN+17,YMIN+17,XMAX-320,YMAX-427,1); //bar
- grx_box(XMIN+17,YMIN+42,XMAX- 320,YMAX-238,0); //workspace
- grx_box(XMIN+286,YMIN+19,XMAX-322,YMAX-429,7);//button
- grx_text("PPDemo", XMIN+30, YMIN+21, 15, 1); //title
- grx_text("**********************************", XMIN+25, YMIN+55, 10, 0);
- grx_text("* PARALLEL PORT DEMONSTRATION *", XMIN+25, YMIN+70, 10, 0);
- grx_text("**********************************", XMIN+25, YMIN+85, 10, 0);
- grx_text("Press ALT X to exit", XMIN+25, YMIN+115, 10, 0);
- grx_text("other keys to communicate with", XMIN+25, YMIN+130, 10, 0);
- grx_text("remote terminal", XMIN+25, YMIN+145, 10, 0);
- grx_text("(c) Copyright 2002", XMIN+25, YMIN+190, 10, 0);
- grx_text("Andrea Battistotti, Armando Leggio", XMIN+25, YMIN+205, 10, 0);
-
- // Window 2
- grx_box(XMIN+317,YMIN+14,XMAX-14,YMAX-235,7);
- grx_box(XMIN+320,YMIN+17,XMAX-17,YMAX-427,1);
- grx_box(XMIN+320,YMIN+42,XMAX-17,YMAX-238,0);
- grx_box(XMIN+589,YMIN+19,XMAX-19,YMAX-429,7);
- grx_text("Statistics", XMIN+333, YMIN+21, 15, 1);
-
-}
-
-
-void ppInitGrxWnd_b(void)
-{
- // Window 3
- grx_box(XMIN+14,YMIN+243,XMAX-317,YMAX-6,7);
- grx_box(XMIN+17,YMIN+246,XMAX-320,YMAX-198,1);
- grx_box(XMIN+17,YMIN+271,XMAX-320,YMAX-9,0);
- grx_box(XMIN+286,YMIN+248,XMAX-322,YMAX-200,7);
- grx_text("Local Terminal", XMIN+30, YMIN+250, 15, 1);
-
- // Window 4
- grx_box(XMIN+317,YMIN+243,XMAX-14,YMAX-6,7);
- grx_box(XMIN+320,YMIN+246,XMAX-17,YMAX-198,1);
- grx_box(XMIN+320,YMIN+271,XMAX-17,YMAX-9,0);
- grx_box(XMIN+589,YMIN+248,XMAX-19,YMAX-200,7);
- grx_text("Remote Terminal", XMIN+333, YMIN+250, 15, 1);
-
-}
-
-
-void ppGrxWnd2(char *c) /* sys msg wind */
-{
- static int i,j;
- static char sysmsg[GRXWND_LINS+1][GRXWND_COLS+1];
- char s[2];
-
- s[1]='\0';
-
-
- while ((s[0]=*c++)) // *c != 0
- {
- sysmsg[i][j]=s[0] ;
- switch (s[0])
- {
- case '\r': case '\n':
- j=0;i++;
- break;
-
- case '\b':
- if (j>0)
- {
- j--;s[0]=' ';
- grx_text(s, XMIN+330+8*j, YMIN+49+10*i,10,0);
- //statistics grx_text(s, XMIN+330+8*j, YMIN+49+10*i,10,0);
- //statistics
- }
- break;
-
- default:
- grx_text(s, XMIN+330+8*j, YMIN+49+10*i,10,0); //statistics
- j++;
- break;
-
- }
- if (j>=GRXWND_COLS)
- {i++;
- j=0;}
- if (i>=GRXWND_LINS) {
- s[0]=' ';
- for (i=0;i<GRXWND_LINS;i++){
- for (j=0;j<GRXWND_COLS;j++){
- grx_text(s, XMIN+330+8*j, YMIN+49+10*i,10,0); //statistics
- };
- };
- i=0; j=0;
- };
- } // end while
-}
-
-
-void ppGrxWnd3(char c)
-{
- static int i,j;
- char talk[GRXWND_LINS+1][GRXWND_COLS+1];
- char s[2];
- s[1]='\0';
-
- talk[i][j]=c;
- s[0] = c;
- switch (c)
- {
- case '\r': case '\n':
- j=0;i++;
- break;
-
-
- case '\b':
- if (j>0)
- {
- j--;s[0]=' ';
- grx_text(s, XMIN+27+8*j, YMIN+278+10*i,10,0); //local term
-
- }
- break;
-
- default:
- grx_text(s, XMIN+27+8*j, YMIN+278+10*i,10,0); //local term
- j++;
- break;
-
- }
- if(j==GRXWND_COLS) {i++; j=0;};
- if(i==GRXWND_LINS) {
- s[0]=' ';
- for (i=0;i<GRXWND_LINS;i++){
- for (j=0;j<GRXWND_COLS;j++){
- grx_text(s, XMIN+27+8*j, YMIN+278+10*i,10,0); //local term
- };
- };
- i=0; j=0;
- }
-}
-
-
-void ppGrxWnd4(char c)
-{
- static int i,j;
- char talk[GRXWND_LINS][GRXWND_COLS];
- char s[2];
- s[1]='\0';
-
- talk[i][j]=c;
- s[0] = c;
- switch (c)
- {
- case '\r': case '\n':
- j=0;i++;break;
-
- case '\b':
- if (j>0)
- {
- j--;s[0]=' ';
- grx_text(s, XMIN+330+8*j, YMIN+278+10*i,10,0); //remote term
- }
- break;
- default:
- grx_text(s, XMIN+330+8*j, YMIN+278+10*i,10,0); //remote term
- j++;
- break;
- }
-
- if(j==GRXWND_COLS) {i++; j=0;}
- if(i==GRXWND_LINS) {
- s[0]=' ';
- for (i=0;i<GRXWND_LINS;i++){
- for (j=0;j<GRXWND_COLS;j++){
- grx_text(s, XMIN+330+8*j, YMIN+278+10*i,10,0); //remote term
- };
- };
- i=0; j=0;
- }
-}
-
-
-/***************************************************************/
-
-TASK ppChat(void *arg)
-{
- char sysmsg[SYS_MSG_COLS+1];
- long xposTx;
- KEY_EVT k;
- BYTE b;
-
-
- k.ascii = 0;
- xposTx=9430 ; // any 16 bit test value...
-
- task_endcycle();
-
- while (1) {
-#if PP_DEBUG == 1
- //kern_printf("ppchat \n");
-#endif
- /* read char buffer */
- if (keyb_getcode(&k,NON_BLOCK))
- {
- /* if any send it to ppDrv ...*/
- b=k.ascii;
-#if PP_DEBUG == 1
- kern_printf("Send char: %i , %c \n",b,b);
-#endif
- //kern_printf("--- Transmit value for xposTx: %d \n",xposTx);
- //ppTxBytes( (BYTE *) &xposTx, sizeof(xposTx) );
- ppGrxWnd3(b);
- ppTxOneByte(b);
- }
-
- if (ppRxOneByte(&b)==PP_COMM_OK)
- //if (ppRxBytes((BYTE *) &xposRx, sizeof(xposRx))==PP_COMM_OK)
- {
- ppGrxWnd4(b);
- //kern_printf("%c",b);
- //kern_printf("--- Received value for xposRx: %d \n", xposRx);
- }
-
- if (ppReadSysMsg(sysmsg)==PP_SYSMSG_OK) ppGrxWnd2(sysmsg);
-
-
- /* ..and show it in upper screen..*/
-
- task_endcycle();
- }
-}
-
-
-/****************************************************************/
-
-/* This function is called when Alt-X is pressed.
- It simply shutdown the system using sys_end.
- Note that the byebye() function is called only if we exit from
- the system using sys_end()!!!!
-*/
-void my_end(KEY_EVT* e)
-{
-
- sys_end();
-}
-
-/******************************************************************/
-
-/* This function is called when the system exit correctly after Alt-X.
- It exits from the graphic mode and then it prints a small greeting.
- Note that:
- - The function calls grx_exit, so it must be registered using
- RUNLEVEL_BEFORE_EXIT (RUNLEVEL_AFTER_EXIT does not work because
- at that point the kernel is already returned in real mode!!!)
- - When an exception is raised, the exception handler is called.
- Since the exception handler already exits from the graphic mode,
- this funcion has not to be called. For this reason:
- . we registered byebye using the flag NO_AT_ABORT
- . the exception handler exits using sys_abort; in that way byebye is
- NOT called
-*/
-
-void byebye(void *arg)
-{
- grx_close();
- kern_printf("Bye Bye!\n");
-}
-
-/****************************** MAIN ******************************/
-
-int main(int argc, char **argv)
-{
- PID pid2, pid;
- KEY_EVT emerg;
-
- HARD_TASK_MODEL m2;
- SOFT_TASK_MODEL mp;
-
- /* Set the closing function */
- sys_atrunlevel(byebye, NULL, RUNLEVEL_BEFORE_EXIT);
-
-
-
-
- keyb_set_map(itaMap);
- /* set the keyboard handler to exit correctly */
- emerg.ascii = 'x';
- emerg.scan = KEY_X;
- emerg.flag = ALTL_BIT;
- keyb_hook(emerg,my_end);
-
- emerg.ascii = 'x';
- emerg.scan = KEY_X;
- emerg.flag = ALTR_BIT;
- keyb_hook(emerg,my_end);
-
- /* a small banner */
- kern_printf("ppChat Demo\n");
- kern_printf("Press Alt-X to exit\n");
-
- /* graphics */
- ppInitGrxWnd();
-
-
- /* graphic card Initialization */
- //kern_printf("Video card ok!\n");
-
-
-
- /* ppDrv creation */
- ppGrxWnd2("Initing Drv...\n");
- ppInitDrv(ppGrxWnd2); /* pass output fnc for init debug...*/
-
- ppInitGrxWnd_b();
-
-
- /* MODEL TASK EXAMPLES */
- soft_task_default_model(mp);
- soft_task_def_level(mp,1);
- soft_task_def_ctrl_jet(mp);
- soft_task_def_arg(mp, (void *)0);
- soft_task_def_group(mp, 1);
- soft_task_def_met(mp, PPDRV_WCET);
- soft_task_def_period(mp,PPDRV_PERIOD);
- soft_task_def_usemath(mp);
- pid = task_create("ppDrv", ppPollingSvr, &mp, NULL);
- if (pid != NIL) task_activate(pid);
- /**/
-
- //hard_task_default_model(m1);
- //hard_task_def_ctrl_jet (m1);
- //hard_task_def_arg (m1, (void *)0);
- //hard_task_def_wcet (m1, PPDRV_WCET);
- //hard_task_def_mit (m1, PPDRV_PERIOD);
- //hard_task_def_group (m1,1);
- //pid1 = task_create("ppDrv", ppPollingSvr, &m1, NULL);
- //if (pid1 == NIL) {/*grx_close();*/ perror("Could not create task <ppDrv>");sys_abort(1);}
- //if(task_activate(pid1)==-1) {/*grx_close();*/ perror("Could not create task <ppDrv>");sys_abort(1);};
-
- //(" Task ppDrv Activate...PID: %i\n",pid1);
- // kern_printf("---------------------\n");
-
-
- /* ppChat creation */
- hard_task_default_model(m2);
- hard_task_def_ctrl_jet (m2);
- hard_task_def_arg (m2, (void *)1);
- hard_task_def_wcet (m2, TSK_WCET);
- hard_task_def_mit (m2, TSK_PERIOD);
- hard_task_def_group (m2,2);
- pid2 = task_create("ppChat", ppChat, &m2, NULL);
- if (pid2 == NIL) {/*grx_close();*/ perror("Could not create task <ppChat>");sys_abort(1);}
- task_activate(pid2);
- //kern_printf("Task Chat Activate...PID: %i\n",pid2);
-
- //kern_printf("---------------------\n");
-
-
- /*
- now the task main ends, but the system does not shutdown because
- there are the three task ego1, ego2, and ego3 running.
- The demo will finish if a Alt-X key is pressed.
- */
-
- return 0;
-}
-
-/* MODEL TASK EXAMPLES (from jumpball demo)
-
- SOFT_TASK_MODEL mp;
-
- soft_task_default_model(mp);
- soft_task_def_level(mp,1);
- soft_task_def_ctrl_jet(mp);
- soft_task_def_arg(mp, (void *)rgb16(r,g,b));
- soft_task_def_group(mp, BALL_GROUP);
- soft_task_def_met(mp, WCET_BALL);
- soft_task_def_period(mp,PERIOD_BALL);
- soft_task_def_usemath(mp);
- pid = task_create(palla_str, palla, &mp, NULL);
-
- if (pid != NIL) task_activate(pid);
-
-
- HARD TASK EXAMPLES
-
- HARD_TASK_MODEL mp;
-
- hard_task_default_model(mp);
- hard_task_def_ctrl_jet(mp);
- hard_task_def_arg(mp, (void *)rgb16(r,g,b));
- hard_task_def_wcet(mp, 380);
- hard_task_def_mit(mp,PERIOD_BALL);
- hard_task_def_usemath(mp);
- pid = task_create("pallaEDF", palla, &mp, NULL);
-
- if (pid != NIL) task_activate(pid);
-*/
Index: rel_1_21/parport/readme.txt
===================================================================
--- rel_1_21/parport/readme.txt (revision 1217)
+++ rel_1_21/parport/readme.txt (nonexistent)
@@ -1,27 +0,0 @@
-Hi,
-
-This directory contains a small demo that uses the Shark Parallel Port driver.
-
-Full documentation is available on the Shark Web Page.
-
-PJ
-
-PS: The following text is the original text made by the authors.
-------------------------------------------------------------------------------
-
-Universita' degli Studi di Pavia
-Facoltà di Ingegneria
-Dipartimento di Informatica e Sistemistica
-
--------------------------------------------------------------
- PARALLEL PORT SHARK PROJECT
- COMUNICAZIONE TRA PERSONAL COMPUTER TRAMITE PORTA PARALLELA
--------------------------------------------------------------
-Corso: Informatica Industriale - A.A. 2001/2002
-Docente: Prof. Giorgio Buttazzo
-Responsabili: Prof. Giorgio Buttazzo - Ing. Paolo Gai
-
-Progetto: Parallel Port Shark Project
-Autori: Andrea Battistotti, Armando Leggio
-
-(C) Copyright 2002 Andrea Battistotti & Armando Leggio
Index: rel_1_21/static/static.c
===================================================================
--- rel_1_21/static/static.c (revision 1217)
+++ rel_1_21/static/static.c (nonexistent)
@@ -1,264 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: static.c,v 1.4 2003-01-07 17:10:18 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.4 $
- Last update: $Date: 2003-01-07 17:10:18 $
- ------------
-**/
-
-/*
- * Copyright (C) 2001 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "static.h"
-#include <ll/stdio.h>
-#include <ll/string.h>
-#include <kernel/model.h>
-#include <kernel/descr.h>
-#include <kernel/var.h>
-#include <kernel/func.h>
-#include <kernel/trace.h>
-
-#define STATIC_printf kern_printf
-//#define STATIC_printf printk
-
-/*+ Status used in the level +*/
-#define STATIC_READY MODULE_STATUS_BASE /*+ - Ready status +*/
-#define STATIC_IDLE MODULE_STATUS_BASE+4 /*+ to wait the deadline +*/
-
-/*+ flags +*/
-#define STATIC_FLAG_NORAISEEXC 2
-
-/*+ the level redefinition for the Earliest Deadline First level +*/
-typedef struct {
- level_des l; /*+ the standard level descriptor +*/
-
- IQUEUE mytable;
-
- PID currenttask;
-
- struct timespec hp;
- struct timespec ref;
-
-} STATIC_level_des;
-
-static void STATIC_offset_activate(void *par)
-{
- PID p = (PID) par;
- STATIC_level_des *lev;
-
- lev = (STATIC_level_des *)level_table[proc_table[p].task_level];
-
- lev->currenttask = p;
- event_need_reschedule();
-
- // STATIC_printf("(o p%d t%d)", p, (int)proc_table[p].timespec_priority.tv_sec);
-}
-
-static void STATIC_activateall(STATIC_level_des *lev)
-{
- PID my_table_index;
- struct timespec x;
-
- STATIC_printf("(A ");
-
- for (my_table_index = iq_query_first(&lev->mytable);
- my_table_index != NIL;
- my_table_index = iq_query_next(my_table_index, &lev->mytable)) {
- ADDTIMESPEC(&lev->ref,iq_query_timespec(my_table_index, &lev->mytable),&x);
- kern_event_post(&x, STATIC_offset_activate,(void *)my_table_index);
-
- STATIC_printf("|p%d t%d ",
- my_table_index,
- (int)iq_query_timespec(my_table_index, &lev->mytable)->tv_sec);
- }
-
- STATIC_printf(")");
-
-}
-
-static void STATIC_hyperperiod(void *par)
-{
- STATIC_level_des *lev;
- struct timespec x;
-
- lev = (STATIC_level_des *)level_table[(LEVEL)par];
-
- STATIC_printf("(hp %d)", (int)lev->ref.tv_sec);
-
- STATIC_activateall(lev);
-
- ADDTIMESPEC(&lev->ref, &lev->hp, &x);
- lev->ref = x;
-
- kern_event_post(&x, STATIC_hyperperiod, par);
-}
-
-
-/* The scheduler only gets the first task in the queue */
-static PID STATIC_public_scheduler(LEVEL l)
-{
- STATIC_level_des *lev = (STATIC_level_des *)(level_table[l]);
-
- return lev->currenttask;
-}
-
-static int STATIC_public_create(LEVEL l, PID p, TASK_MODEL *m)
-{
- STATIC_level_des *lev = (STATIC_level_des *)(level_table[l]);
-
- /* if the STATIC_task_create is called, then the pclass must be a
- valid pclass. */
-
- STATIC_TASK_MODEL *h = (STATIC_TASK_MODEL *)m;
-
- if (m->pclass != STATIC_PCLASS) return -1;
- if (m->level != 0 && m->level != l) return -1;
-
- iq_query_timespec(p, &lev->mytable)->tv_sec = h->offset.tv_sec;
- iq_query_timespec(p, &lev->mytable)->tv_nsec = h->offset.tv_nsec;
- iq_timespec_insert(p,&lev->mytable);
-
- return 0; /* OK, also if the task cannot be guaranteed... */
-}
-
-static void STATIC_public_dispatch(LEVEL l, PID p, int nostop)
-{
-}
-
-static void STATIC_public_epilogue(LEVEL l, PID p)
-{
-}
-
-static void STATIC_public_activate(LEVEL l, PID p)
-{
-}
-
-static void STATIC_public_unblock(LEVEL l, PID p)
-{
-}
-
-static void STATIC_public_block(LEVEL l, PID p)
-{
-}
-
-static int STATIC_public_message(LEVEL l, PID p, void *m)
-{
- STATIC_level_des *lev = (STATIC_level_des *)(level_table[l]);
-
- lev->currenttask = NIL;
-
- jet_update_endcycle(); /* Update the Jet data... */
- trc_logevent(TRC_ENDCYCLE,&exec_shadow); /* tracer stuff */
-
- return 0;
-}
-
-static void STATIC_public_end(LEVEL l, PID p)
-{
- STATIC_level_des *lev = (STATIC_level_des *)(level_table[l]);
-
- lev->currenttask = NIL;
-
- iq_extract(p,&lev->mytable);
-
- /* we finally put the task in the ready queue */
- proc_table[p].status = FREE;
- iq_insertfirst(p,&freedesc);
-}
-
-/* Registration functions */
-
-/*+ Registration function:
- int flags the init flags ... see STATIC.h +*/
-LEVEL STATIC_register_level()
-{
- LEVEL l; /* the level that we register */
- STATIC_level_des *lev; /* for readableness only */
-
- printk("STATIC_register_level\n");
-
- /* request an entry in the level_table */
- l = level_alloc_descriptor(sizeof(STATIC_level_des));
-
- lev = (STATIC_level_des *)level_table[l];
-
- printk(" lev=%d\n",(int)lev);
-
- /* fill the standard descriptor */
- lev->l.public_scheduler = STATIC_public_scheduler;
- lev->l.public_create = STATIC_public_create;
- lev->l.public_end = STATIC_public_end;
- lev->l.public_dispatch = STATIC_public_dispatch;
- lev->l.public_epilogue = STATIC_public_epilogue;
- lev->l.public_activate = STATIC_public_activate;
- lev->l.public_unblock = STATIC_public_unblock;
- lev->l.public_block = STATIC_public_block;
- lev->l.public_message = STATIC_public_message;
-
- /* fill the STATIC descriptor part */
-
- iq_init(&lev->mytable, &freedesc, 0);
- lev->currenttask = NIL;
-
- NULL_TIMESPEC(&lev->hp);
- NULL_TIMESPEC(&lev->ref);
-
- return l;
-}
-
-void STATIC_start(LEVEL l, struct timespec *h, struct timespec *o)
-{
- STATIC_level_des *lev = (STATIC_level_des *)(level_table[l]);
- struct timespec x;
-
- kern_cli();
- kern_gettime(&x);
- lev->hp = *h;
-
- ADDTIMESPEC(&x,o,&lev->ref);
- STATIC_printf("(ST: ref:%d.%d x:%d.%d)\n",
- (int)lev->ref.tv_sec, (int)lev->ref.tv_nsec,
- (int)x.tv_sec, (int)x.tv_nsec);
-
- kern_event_post(&x, STATIC_hyperperiod,(void *)l);
-
- kern_sti();
-}
-
-
Index: rel_1_21/static/test1st.c
===================================================================
--- rel_1_21/static/test1st.c (revision 1217)
+++ rel_1_21/static/test1st.c (nonexistent)
@@ -1,129 +0,0 @@
-/*
- * Project: HARTIK (HA-rd R-eal TI-me K-ernel)
- *
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
- * Gerardo Lamastra <gerardo@sssup.it>
- *
- * Authors : Paolo Gai <pj@hartik.sssup.it>
- * (see authors.txt for full list of hartik's authors)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://hartik.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: test1st.c,v 1.2 2002-11-11 07:55:13 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2002-11-11 07:55:13 $
- ------------
-
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "static.h"
-#include <math.h>
-#include <string.h>
-
-int theend = 0;
-
-void *mytask(void *arg)
-{
- struct timespec t;
-
- for (;;)
- {
- sys_gettime(&t);
-
- cprintf("I am task %s at time %d.%d\n", (char *)arg, (int)t.tv_sec, (int)t.tv_nsec);
-
- theend++;
-
- if (theend > 10) sys_end();
-
- task_endcycle();
- }
-
-}
-
-
-int main(int argc, char **argv)
-{
- PID p1;
-
- STATIC_TASK_MODEL m;
-
- struct timespec my_time, h, o;
-
- my_time.tv_nsec=0;
-
-
- my_time.tv_sec = 0;
- my_time.tv_nsec = 500000000;
- static_task_default_model(m, my_time);
- static_task_def_arg(m, "A");
-
- p1 = task_create("TaskA",mytask,&m,NULL);
- if (p1 == -1) {
- perror("Could not create task <A> ...");
- sys_end();
- }
-
- my_time.tv_sec = 1;
- my_time.tv_nsec = 0;
- static_task_default_model(m, my_time);
- static_task_def_arg(m, "B");
-
- p1 = task_create("TaskB",mytask,&m,NULL);
- if (p1 == -1) {
- perror("Could not create task <B> ...");
- sys_end();
- }
-
- my_time.tv_sec = 1;
- my_time.tv_nsec = 500000000;
- static_task_default_model(m, my_time);
- static_task_def_arg(m, "C");
-
- p1 = task_create("TaskC",mytask,&m,NULL);
- if (p1 == -1) {
- perror("Could not create task <C> ...");
- sys_end();
- }
-
- h.tv_sec = 3;
- h.tv_nsec = 0;
-
- o.tv_sec = 1;
- o.tv_nsec = 0;
-
- STATIC_start(0, &h, &o);
-
- return 0;
-}
-
Index: rel_1_21/static/static.h
===================================================================
--- rel_1_21/static/static.h (revision 1217)
+++ rel_1_21/static/static.h (nonexistent)
@@ -1,117 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: static.h,v 1.2 2003-01-07 17:10:18 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-01-07 17:10:18 $
- ------------
-
- Static scheduler demo (FIRST Project Hand-off)
-
-**/
-
-/*
- * Copyright (C) 2001 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#ifndef __STATIC_H__
-#define __STATIC_H__
-
-#include <ll/ll.h>
-#include <kernel/config.h>
-#include <sys/types.h>
-#include <kernel/types.h>
-
-
-
-
-
-
-
-
-/*+ flags... +*/
-
-/* no flags for the static scheduler */
-
-
-
-
-#define STATIC_PCLASS 0x1000
-
-#define STATIC_LEVELNAME "STATIC 1st Project"
-#define STATIC_LEVEL_CODE 167
-#define STATIC_LEVEL_VERSION 1
-
-
-
-typedef struct {
- TASK_MODEL t;
- struct timespec offset;
-} STATIC_TASK_MODEL;
-
-#define static_task_default_model(m,o) \
- task_default_model((m).t,STATIC_PCLASS), \
- ((m).offset).tv_sec = (o).tv_sec, \
- ((m).offset).tv_nsec = (o).tv_nsec
-#define static_task_def_level(m,l) task_def_level((m).t,l)
-#define static_task_def_arg(m,a) task_def_arg((m).t,a)
-#define static_task_def_stack(m,s) task_def_stack((m).t,s)
-#define static_task_def_stackaddr(m,s) task_def_stackaddr((m).t,s)
-#define static_task_def_group(m,g) task_def_group((m).t,g)
-#define static_task_def_usemath(m) task_def_usemath((m).t)
-#define static_task_def_system(m) task_def_system((m).t)
-#define static_task_def_nokill(m) task_def_nokill((m).t)
-#define static_task_def_ctrl_jet(m) task_def_ctrl_jet((m).t)
-#define static_task_def_joinable(m) task_def_joinable((m).t)
-#define static_task_def_unjoinable(m) task_def_unjoinable((m).t)
-
-
-
-
-
-/*+ Registration function:
- int flags Options to be used in this level instance...
-+*/
-LEVEL STATIC_register_level(void);
-
-void STATIC_start(LEVEL l, struct timespec *h, struct timespec *o);
-
-#endif
-
Index: rel_1_21/static/readme
===================================================================
--- rel_1_21/static/readme (revision 1217)
+++ rel_1_21/static/readme (nonexistent)
@@ -1,16 +0,0 @@
-STATIC Scheduling Module
-------------------------
-
-This is the scheduling module created on the FIRST Project Meeting in
-Vasteras, July 2002.
-
-The module accept a new Task Model called STATIC_TASK_MODEL that
-contains the information about the starting time of a task. After
-creating all the tasks, the static scheduling starts calling the
-function static_start.
-
-For comments, bugfixes & co, write to pj@sssup.it.
-
-Bye
-
-PJ
Index: rel_1_21/static/makefile
===================================================================
--- rel_1_21/static/makefile (revision 1217)
+++ rel_1_21/static/makefile (nonexistent)
@@ -1,16 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS= test1st
-
-include $(BASE)/config/example.mk
-
-test1st:
- make -f $(SUBMAKE) APP=test1st INIT= OTHEROBJS="initfile.o static.o" OTHERINCL= SHARKOPT=__OLDCHAR__
-
Index: rel_1_21/static/initfile.c
===================================================================
--- rel_1_21/static/initfile.c (revision 1217)
+++ rel_1_21/static/initfile.c (nonexistent)
@@ -1,81 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: initfile.c,v 1.1.1.1 2002-09-02 09:37:48 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:48 $
- ------------
-*/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "static.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "drivers/keyb.h"
-
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- STATIC_register_level();
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
Index: rel_1_21/first/posixstar.c
===================================================================
--- rel_1_21/first/posixstar.c (revision 1217)
+++ rel_1_21/first/posixstar.c (nonexistent)
@@ -1,544 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Trimarchi Michael <trimarchi@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: posixstar.c,v 1.2 2003-08-01 13:20:38 trimarchi Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-08-01 13:20:38 $
- ------------
-
- This file contains the scheduling module compatible with POSIX
- specifications
-
- Read posixstar.h for further details.
-
- RR tasks have the CONTROL_CAP bit set
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARR2ANTY; without even the implied waRR2anty 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#include <ll/stdio.h>
-#include <ll/string.h>
-#include <kernel/model.h>
-#include <kernel/descr.h>
-#include <kernel/var.h>
-#include <kernel/func.h>
-#include <kernel/trace.h>
-#include "posixstar.h"
-#include "cbsstar.h"
-//#define POSIXSTAR_DEBUG
-/*+ Status used in the level +*/
-#define POSIXSTAR_READY MODULE_STATUS_BASE
-
-/*+ the level redefinition for the Round Robin level +*/
-typedef struct {
- level_des l; /*+ the standard level descriptor +*/
-
- int nact[MAX_PROC]; /*+ number of pending activations +*/
-
- int priority[MAX_PROC]; /*+ priority of each task +*/
-
- IQUEUE *ready; /*+ the ready queue array +*/
-
- int slice; /*+ the level's time slice +*/
-
-// the multiboot is not usefull for this module
-// struct multiboot_info *multiboot; /*+ used if the level have to insert
- // the main task +*/
- int maxpriority; /*+ the priority are from 0 to maxpriority
- (i.e 0 to 31) +*/
-
- int yielding; /*+ equal to 1 when a sched_yield is called +*/
-
- int budget;
-
- PID activated;
- int scheduling_level;
-
-} POSIXSTAR_level_des;
-
-/* the private scheduler choice a task and insert in cbsstar module */
-/* This is not efficient but very fair :-)
- The need of all this stuff is because if a task execute a long time
- due to (shadow!) priority inheritance, then the task shall go to the
- tail of the queue many times... */
-
-static void POSIXSTAR_private_scheduler(POSIXSTAR_level_des * lev)
-{
- /* the old posix scheduler select the private job for CBS */
- PID p=NIL;
-
- int prio;
-
- prio = lev->maxpriority;
-
- for (;;) {
- p = iq_query_first(&lev->ready[prio]);
- if (p == NIL) {
- if (prio) {
- prio--;
- continue;
- }
- else {
- p=NIL;
- break;
- }
- }
- //if (p != NIL && (proc_table[p].control & CONTROL_CAP))
- // kern_printf("CC SET %d",p);
-
- //kern_printf("task %d", p);
-
- if ((proc_table[p].control & CONTROL_CAP) &&
- (proc_table[p].avail_time <= 0)) {
- if (proc_table[p].avail_time<=0)
- proc_table[p].avail_time += proc_table[p].wcet;
- //kern_printf("RR policy");
- iq_extract(p,&lev->ready[prio]);
- iq_insertlast(p,&lev->ready[prio]);
- }
- else {
- break;
- }
- }
-
- if (p!=lev->activated) {
- if (lev->activated != NIL ) {
- level_table[ lev->scheduling_level ]->
- private_extract(lev->scheduling_level, lev->activated);
- //kern_printf("CBS ext %d",p);
- }
- lev->activated = p;
-
- if (p != NIL) {
- BUDGET_TASK_MODEL b;
- budget_task_default_model(b, lev->budget);
- //kern_printf("(Act %d",p);
- level_table[ lev->scheduling_level ]->
- private_insert(lev->scheduling_level, p, (TASK_MODEL *)&b);
- }
- }
-}
-
-static int POSIXSTAR_public_eligible(LEVEL l, PID p)
-{
- POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
- if (p==lev->activated) {
- //kern_printf("eli %d", p);
-
- return level_table[ lev->scheduling_level ]->
- private_eligible(lev->scheduling_level,p);
- }
- return 0;
-}
-
-
-static int POSIXSTAR_public_create(LEVEL l, PID p, TASK_MODEL *m)
-{
- POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
- NRT_TASK_MODEL *nrt;
-
- if (m->pclass != NRT_PCLASS) return -1;
- if (m->level != 0 && m->level != l) return -1;
-
- nrt = (NRT_TASK_MODEL *)m;
-
- /* the task state is set at SLEEP by the general task_create */
-
- /* I used the wcet field because using wcet can account if a task
- consume more than the timeslice... */
-
- if (nrt->inherit == NRT_INHERIT_SCHED &&
- proc_table[exec_shadow].task_level == l) {
- /* We inherit the scheduling properties if the scheduling level
- *is* the same */
- lev->priority[p] = lev->priority[exec_shadow];
-
- proc_table[p].avail_time = proc_table[exec_shadow].avail_time;
- proc_table[p].wcet = proc_table[exec_shadow].wcet;
-
- proc_table[p].control = (proc_table[p].control & ~CONTROL_CAP) |
- (proc_table[exec_shadow].control & CONTROL_CAP);
-
- lev->nact[p] = (lev->nact[exec_shadow] == -1) ? -1 : 0;
- }
- else {
- if (nrt->weight<=lev->maxpriority)
- lev->priority[p] = nrt->weight;
- else lev->priority[p]=lev->maxpriority;
-
- if (nrt->slice) {
- proc_table[p].avail_time = nrt->slice;
- proc_table[p].wcet = nrt->slice;
- }
- else {
- proc_table[p].avail_time = lev->slice;
- proc_table[p].wcet = lev->slice;
- }
-
- if (nrt->policy == NRT_RR_POLICY) {
- proc_table[p].control |= CONTROL_CAP;
- //kern_printf("CCAP set:%d",p);
-
- }
- if (nrt->arrivals == SAVE_ARRIVALS)
- lev->nact[p] = 0;
- else
- lev->nact[p] = -1;
- }
-
- return 0; /* OK */
-}
-
-static void POSIXSTAR_public_dispatch(LEVEL l, PID p, int nostop)
-{
- POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
-
- //#ifdef POSIXSTAR_DEBUG
-
- //#endif
-
- /* the task state is set EXE by the scheduler()
- we extract the task from the ready queue
- NB: we can't assume that p is the first task in the queue!!! */
- //iq_extract(p, &lev->ready[lev->priority[p]]);
- //if (!nostop) {
- //kern_printf("PDisp:%d(%d)",p, lev->activated);
- if (p==lev->activated)
- level_table[lev->scheduling_level]->private_dispatch(lev->scheduling_level, p, nostop);
- //} else
- // kern_printf("PDisp:%d(%d)",p, lev->activated);
-}
-
-static void POSIXSTAR_public_epilogue(LEVEL l, PID p)
-{
- POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
- //#ifdef POSIXSTAR_DEBUG
- //kern_printf("PEpic:%d",p);
- //#endif
- if (p==lev->activated) {
- if (lev->yielding) {
- lev->yielding = 0;
- iq_extract(p,&lev->ready[lev->priority[p]]);
- iq_insertlast(p,&lev->ready[lev->priority[p]]);
- }
- /* check if the slice is finished and insert the task in the coPOSIXect
- qqueue position */
- else if (proc_table[p].control & CONTROL_CAP &&
- proc_table[p].avail_time <= 0) {
-
- //proc_table[p].avail_time += proc_table[p].wcet;
- //kern_printf("avail_time %d", proc_table[p].avail_time);
- iq_extract(p,&lev->ready[lev->priority[p]]);
- iq_insertlast(p,&lev->ready[lev->priority[p]]);
- //level_table[lev->scheduling_level]->private_extract(lev->scheduling_level,p);
- //lev->activated=NIL;
-
- POSIXSTAR_private_scheduler(lev);
- if (p==lev->activated)
- level_table[lev->scheduling_level]->private_epilogue(lev->scheduling_level,p);
-
- }
- else {
- //iq_insertfirst(p,&lev->ready[lev->priority[p]]);
- level_table[lev->scheduling_level]->private_epilogue(lev->scheduling_level,p);
-
- }
-
- proc_table[p].status = POSIXSTAR_READY;
-
- }
-
-
-}
-
-static void POSIXSTAR_internal_activate(POSIXSTAR_level_des *lev, PID p)
-{
-
- /* Insert task in the correct position */
- proc_table[p].status = POSIXSTAR_READY;
- iq_insertlast(p,&lev->ready[lev->priority[p]]);
-
-}
-
-
-static void POSIXSTAR_public_activate(LEVEL l, PID p)
-{
- POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
-
- /* Test if we are trying to activate a non sleeping task */
- /* save activation (only if needed...) */
- if (proc_table[p].status != SLEEP) {
- if (lev->nact[p] != -1)
- lev->nact[p]++;
- return;
- }
-#ifdef POSIXSTAR_DEBUG
- kern_printf("PA:%d",p);
-#endif
- POSIXSTAR_internal_activate(lev, p);
- POSIXSTAR_private_scheduler(lev);
-
-}
-
-
-static void POSIXSTAR_public_unblock(LEVEL l, PID p)
-{
- POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
-
- /* Similar to POSIX_task_activate, but we don't check in what state
- the task is */
-
- /* Insert task in the coPOSIXect position */
- //kern_printf("PU:%d", p);
- proc_table[p].status = POSIXSTAR_READY;
- iq_insertlast(p,&lev->ready[lev->priority[p]]);
- POSIXSTAR_private_scheduler(lev);
-}
-
-static void POSIXSTAR_public_block(LEVEL l, PID p)
-{
- POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
-
- /* Extract the running task from the level
- . we have already extract it from the ready queue at the dispatch time.
- . the capacity event have to be removed by the generic kernel
- . the wcet don't need modification...
- . the state of the task is set by the calling function
-
- So, we do nothing!!!
- */
-
-//#ifdef POSIXSTAR_DEBUG
-//kern_printf("PB:%d", p);
-//#endif
- iq_extract(p,&lev->ready[lev->priority[p]]);
- POSIXSTAR_private_scheduler(lev);
-
-}
-
-static int POSIXSTAR_public_message(LEVEL l, PID p, void *m)
-{
- POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
-
- if (lev->nact[p] > 0) {
- /* continue!!!! */
- lev->nact[p]--;
- iq_extract(p,&lev->ready[lev->priority[p]]);
- iq_insertfirst(p,&lev->ready[lev->priority[p]]);
- proc_table[p].status = POSIXSTAR_READY;
- }
- else {
- proc_table[p].status = SLEEP;
-
- }
- //#ifdef POSIXSTAR_DEBUG
- kern_printf("PM:%d",p);
- //#endif
- //jet_update_endcycle(); /* Update the Jet data... */
- //trc_logevent(TRC_ENDCYCLE,&exec_shadow); /* tracer stuff */
- POSIXSTAR_private_scheduler(lev);
- return 0;
-}
-
-static void POSIXSTAR_public_end(LEVEL l, PID p)
-{
- POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
-#ifdef POSIXSTAR_DEBUG
- kern_printf("PEnd:%d", p);
-#endif
- lev->nact[p] = -1;
-
- /* then, we insert the task in the free queue */
- proc_table[p].status = FREE;
- iq_priority_insert(p,NULL);
- POSIXSTAR_private_scheduler(lev);
-}
-
-/* Registration functions */
-
-/*+ Registration function:
- TIME slice the slice for the Round Robin queue
- struct multiboot_info *mb used if createmain specified +*/
-LEVEL POSIXSTAR_register_level(int budget, int master, TIME slice,
- int prioritylevels)
-{
- LEVEL l; /* the level that we register */
- POSIXSTAR_level_des *lev; /* for readableness only */
- PID i; /* a counter */
- int x; /* a counter */
-
- printk("POSIXSTAR_register_level\n");
-
- l = level_alloc_descriptor(sizeof(POSIXSTAR_level_des));
-
- lev = (POSIXSTAR_level_des *)level_table[l];
-
- printk(" lev=%d\n",(int)lev);
-
- /* fill the standard descriptor */
- /*
- lev->l.private_insert = NULL;
- lev->l.private_extract = NULL;
- lev->l.private_dispatch = NULL;
- lev->l.private_epilogue = NULL;
- */
-
- //lev->l.public_scheduler = NULL;
- lev->l.public_create = POSIXSTAR_public_create;
- lev->l.public_end = POSIXSTAR_public_end;
- lev->l.public_dispatch = POSIXSTAR_public_dispatch;
- lev->l.public_epilogue = POSIXSTAR_public_epilogue;
- lev->l.public_activate = POSIXSTAR_public_activate;
- lev->l.public_unblock = POSIXSTAR_public_unblock;
- lev->l.public_block = POSIXSTAR_public_block;
- lev->l.public_message = POSIXSTAR_public_message;
- lev->l.public_eligible = POSIXSTAR_public_eligible;
-
- /* fill the POSIX descriptor part */
- for (i = 0; i < MAX_PROC; i++)
- lev->nact[i] = -1;
-
- lev->maxpriority = prioritylevels -1;
-
- lev->ready = (IQUEUE *)kern_alloc(sizeof(IQUEUE) * prioritylevels);
-
- for (x = 0; x < prioritylevels; x++)
- iq_init(&lev->ready[x], NULL, 0);
-
- if (slice < POSIXSTAR_MINIMUM_SLICE) slice = POSIXSTAR_MINIMUM_SLICE;
- if (slice > POSIXSTAR_MAXIMUM_SLICE) slice = POSIXSTAR_MAXIMUM_SLICE;
- lev->slice = slice;
- lev->activated=NIL;
- lev->budget = budget;
- lev->scheduling_level = master;
- //lev->multiboot = mb;
-
- //if (createmain)
- // sys_atrunlevel(POSIXSTAR_call_main,(void *) l, RUNLEVEL_INIT);
-
- return l;
-}
-
-/*+ this function forces the running task to go to his queue tail;
- (it works only on the POSIX level) +*/
-int POSIXSTAR_sched_yield(LEVEL l)
-{
- POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
-
- if (proc_table[exec_shadow].task_level != l)
- return -1;
-
- proc_table[exec_shadow].context = kern_context_save();
- lev->yielding = 1;
- scheduler();
- kern_context_load(proc_table[exec_shadow].context);
- return 0;
-}
-
-/*+ this function returns the maximum level allowed for the POSIX level +*/
-int POSIXSTAR_get_priority_max(LEVEL l)
-{
- POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
- return lev->maxpriority;
-}
-
-/*+ this function returns the default timeslice for the POSIX level +*/
-int POSIXSTAR_rr_get_interval(LEVEL l)
-{
- POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
- return lev->slice;
-}
-
-/*+ this functions returns some paramaters of a task;
- policy must be NRT_RR_POLICY or NRT_FIFO_POLICY;
- priority must be in the range [0..prioritylevels]
- returns ENOSYS or ESRCH if there are problems +*/
-int POSIXSTAR_getschedparam(LEVEL l, PID p, int *policy, int *priority)
-{
- if (p<0 || p>= MAX_PROC || proc_table[p].status == FREE)
- return ESRCH;
-
- if (proc_table[p].task_level != l)
- return ENOSYS;
-
- if (proc_table[p].control & CONTROL_CAP)
- *policy = NRT_RR_POLICY;
- else
- *policy = NRT_FIFO_POLICY;
-
- *priority = ((POSIXSTAR_level_des *)(level_table[l]))->priority[p];
-
- return 0;
-}
-
-/*+ this functions sets paramaters of a task +*/
-int POSIXSTAR_setschedparam(LEVEL l, PID p, int policy, int priority)
-{
- POSIXSTAR_level_des *lev = (POSIXSTAR_level_des *)(level_table[l]);
-
- if (p<0 || p>= MAX_PROC || proc_table[p].status == FREE)
- return ESRCH;
-
- if (proc_table[p].task_level != l)
- return ENOSYS;
-
- if (policy == SCHED_RR)
- proc_table[p].control |= CONTROL_CAP;
- else if (policy == SCHED_FIFO)
- proc_table[p].control &= ~CONTROL_CAP;
- else
- return EINVAL;
-
- if (lev->priority[p] != priority) {
- if (proc_table[p].status == POSIXSTAR_READY) {
- iq_extract(p,&lev->ready[lev->priority[p]]);
- lev->priority[p] = priority;
- iq_insertlast(p,&lev->ready[priority]);
- }
- else
- lev->priority[p] = priority;
- }
-
- return 0;
-}
-
-
-
Index: rel_1_21/first/makefile
===================================================================
--- rel_1_21/first/makefile (revision 1217)
+++ rel_1_21/first/makefile (nonexistent)
@@ -1,35 +0,0 @@
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS= test1 test2 test3 test4 test5 test6 test7 testiq
-
-include $(BASE)/config/example.mk
-
-test1:
- make -f $(SUBMAKE) APP=test1 INIT= OTHEROBJS="edfstar.o cbsstar.o" OTHERINCL= SHARKOPT=__OLDCHAR__
-
-test2:
- make -f $(SUBMAKE) APP=test2 INIT= OTHEROBJS="edfstar.o cbsstar.o" OTHERINCL= SHARKOPT=__OLDCHAR__
-
-test3:
- make -f $(SUBMAKE) APP=test3 INIT= OTHEROBJS="edfstar.o cbsstar.o" OTHERINCL= SHARKOPT=__OLDCHAR__
-
-test4:
- make -f $(SUBMAKE) APP=test4 INIT= OTHEROBJS="edfstar.o cbsstar.o" OTHERINCL= SHARKOPT=__OLDCHAR__
-
-test5:
- make -f $(SUBMAKE) APP=test5 INIT= OTHEROBJS="edfstar.o cbsstar.o" OTHERINCL= SHARKOPT=__OLDCHAR__
-
-test6:
- make -f $(SUBMAKE) APP=test6 INIT= OTHEROBJS="rmstar.o cbsstar.o" OTHERINCL= SHARKOPT=__OLDCHAR__
-
-test7:
- make -f $(SUBMAKE) APP=test7 INIT= OTHEROBJS="posixstar.o cbsstar.o" OTHERINCL= SHARKOPT=__OLDCHAR__
-
-#testiq:
-# make -f $(SUBMAKE) APP=testiq INIT= OTHEROBJS="iqueue.o " OTHERINCL=
Index: rel_1_21/first/iqueue.c
===================================================================
--- rel_1_21/first/iqueue.c (revision 1217)
+++ rel_1_21/first/iqueue.c (nonexistent)
@@ -1,221 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: iqueue.c,v 1.1 2002-09-02 10:29:30 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1 $
- Last update: $Date: 2002-09-02 10:29:30 $
- ------------
-
-*/
-
-/*
- * Copyright (C) 2002 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "iqueue.h"
-#include <kernel/mem.h>
-
-void iq_init (IQUEUE *q, IQUEUE *share, int flags)
-{
- q->first = NIL;
- q->last = NIL;
-
- if (share)
- q->s = share->s;
- else {
- q->s = (struct IQUEUE_shared *)kern_alloc(sizeof(struct IQUEUE_shared));
-
- if (!(flags & IQUEUE_NO_PRIORITY))
- q->s->priority = (DWORD *)kern_alloc(sizeof(DWORD) * MAX_PROC);
- if (!(flags & IQUEUE_NO_TIMESPEC))
- q->s->timespec_priority = (struct timespec *)
- kern_alloc(sizeof(struct timespec) * MAX_PROC);
- }
-}
-
-/*+
- This function insert the task with PID i in the queue que.
- The insertion is made respecting the priority field.
- (the first item in the queue have the less priority)
-+*/
-void iq_priority_insert (PID i, IQUEUE *que)
-{
- DWORD prio;
- PID p,q;
-
- p = NIL;
- q = que->first;
- prio = que->s->priority[i];
-
- while ((q != NIL) && (prio >= que->s->priority[q])) {
- p = q;
- q = que->s->next[q];
- }
-
- if (p != NIL)
- que->s->next[p] = i;
- else
- que->first = i;
-
- if (q != NIL)
- que->s->prev[q] = i;
- else
- que->last = i;
-
- que->s->next[i] = q;
- que->s->prev[i] = p;
-}
-
-
-/*
- This function insert the task with PID i in the queue que.
- The insertion is made respecting the timespec priority field.
- (the first item in the queue have the less priority)
-*/
-void iq_timespec_insert(PID i, IQUEUE *que)
-{
- struct timespec prio;
- PID p,q;
-
- p = NIL;
- q = que->first;
-
- TIMESPEC_ASSIGN(&prio, &que->s->timespec_priority[i]);
-
- while ((q != NIL) &&
- !TIMESPEC_A_LT_B(&prio, &que->s->timespec_priority[q])) {
- p = q;
- q = que->s->next[q];
- }
-
- if (p != NIL)
- que->s->next[p] = i;
- else
- que->first = i;
-
- if (q != NIL)
- que->s->prev[q] = i;
- else
- que->last = i;
-
- que->s->next[i] = q;
- que->s->prev[i] = p;
-}
-
-
-
-void iq_insertfirst(PID p, IQUEUE *q)
-{
- if (q->first != NIL) {
- q->s->next[p] = q->first;
- q->s->prev[q->first] = p;
- }
- else {
- q->last = p;
- q->s->next[p] = NIL;
- }
- q->s->prev[p] = NIL;
- q->first = p;
-}
-
-
-void iq_insertlast(PID p, IQUEUE *q)
-{
- if (q->last != NIL) {
- q->s->prev[p] = q->last;
- q->s->next[q->last] = p;
- }
- else {
- q->first = p;
- q->s->prev[p] = NIL;
- }
- q->s->next[p] = NIL;
- q->last = p;
-}
-
-
-void iq_extract(PID i, IQUEUE *que)
-{
- PID p,q;
-
- p = que->s->prev[i];
- q = que->s->next[i];
-
- if (p != NIL)
- que->s->next[p] = que->s->next[i];
- else
- que->first = q;
-
- if (q != NIL)
- que->s->prev[q] = que->s->prev[i];
- else
- que->last = p;
-}
-
-PID iq_getfirst(IQUEUE *q)
-{
- PID p = q->first;
-
- if (p == NIL)
- return NIL;
-
- q->first = q->s->next[q->first];
-
- if (q->first != NIL)
- q->s->prev[q->first] = NIL;
- else
- q->last = NIL;
-
- return p;
-}
-
-PID iq_getlast(IQUEUE *q)
-{
- PID p = q->last;
-
- if (p == NIL)
- return NIL;
-
- q->last = q->s->prev[q->last];
-
- if (q->last != NIL)
- q->s->next[q->last] = NIL;
- else
- q->first = NIL;
-
- return p;
-}
Index: rel_1_21/first/edfstar.h
===================================================================
--- rel_1_21/first/edfstar.h (revision 1217)
+++ rel_1_21/first/edfstar.h (nonexistent)
@@ -1,138 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: edfstar.h,v 1.2 2003-01-07 17:10:17 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-01-07 17:10:17 $
- ------------
-
- Title:
- EDFSTAR
-
- Task Models Accepted:
- HARD_TASK_MODEL - Hard Tasks (only Periodic)
- wcet field and mit field must be != 0. They are used to set the wcet
- and period of the tasks.
- periodicity field can be only PERIODIC
- drel field is ignored
-
- Guest Models Accepted:
- JOB_TASK_MODEL - a single guest task activation
- Identified by an absolute deadline and a period.
- period field is ignored
-
- Description:
-
- This module schedule his tasks following the classic EDF
- scheme. This module is derived from the EDFACT Scheduling Module.
-
- This module can not stay alone: when it have to schedule a task, it
- simply inserts it into another master module using a
- BUDGET_TASK_MODEL.
-
- No Task guarantee is performed at all.
- The tasks scheduled are only periodic.
- All the task are put in a queue and the scheduling is based on the
- deadline value.
- If a task miss a deadline a counter is incremented.
- If a task exausts the wcet a counter is incremented
- No ZOMBIE support!!!!!!
-
- Exceptions raised:
- XUNVALID_GUEST XUNVALID_TASK
- some primitives are not implemented:
- task_sleep, task_delay, guest_endcycle, guest_sleep, guest_delay
-
- XACTIVATION
- If a task is actiated through task_activate or guest_activate more than
- one time
-
- Restrictions & special features:
- - This level doesn't manage the main task.
- - Functions to return and reset the nact, wcet and dline miss
- counters are provided
-
-**/
-
-/*
- * Copyright (C) 2001 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#ifndef __EDFSTAR_H__
-#define __EDFSTAR_H__
-
-#include <ll/ll.h>
-#include <kernel/config.h>
-#include <sys/types.h>
-#include <kernel/types.h>
-
-
-
-/* flags... */
-#define EDFSTAR_ENABLE_GUARANTEE 1 /* Task Guarantee enabled */
-#define EDFSTAR_ENABLE_ALL 1
-
-#define EDFSTAR_FAILED_GUARANTEE 8 /* used in the module, unsettabl
- in EDF_register_level... */
-
-
-
-#define EDFSTAR_LEVELNAME "EDFSTAR base"
-#define EDFSTAR_LEVEL_CODE 166
-#define EDFSTAR_LEVEL_VERSION 1
-
-
-/* Registration function:
- int budget The budget used by this module (see CBSSTAR.h)
- int master The master module used by EDFSTAR
-*/
-LEVEL EDFSTAR_register_level(int budget, int master);
-
-/* returns respectively the number of dline, wcet or nact; -1 if error */
-int EDFSTAR_get_dline_miss(PID p);
-int EDFSTAR_get_wcet_miss(PID p);
-int EDFSTAR_get_nact(PID p);
-
-/* resets respectively the number of dline, wcet miss; -1 if error */
-int EDFSTAR_reset_dline_miss(PID p);
-int EDFSTAR_reset_wcet_miss(PID p);
-
-#endif
-
Index: rel_1_21/first/test1.c
===================================================================
--- rel_1_21/first/test1.c (revision 1217)
+++ rel_1_21/first/test1.c (nonexistent)
@@ -1,247 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: test1.c,v 1.2 2003-01-07 17:10:17 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-01-07 17:10:17 $
- ------------
-
- this test shows a set of 5 tasks (+main+dummy+keyboard driver).
-
- The first 4 tasks are scheduled by a EDFSTAR Module, whereas the
- fifth one is a standard traditional EDF task. The 4 tasks uses a
- budget of 10000/100000.
-
- if edfstar.c is compiled with edfstar_printf3 active, a couple
- (dline, curtime) is showed (in ms).
-
- if cbsstar.c is compiled with cbsstar_printf3 active, the budget
- replenishments are showed.
-*/
-
-/*
- * Copyright (C) 2002 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "cbsstar.h"
-#include "edfstar.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-
-
-// --------------------------------------------------
-// --------------------------------------------------
-// Init Part
-// --------------------------------------------------
-// --------------------------------------------------
-
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
- int cbsstar_level, edfstar_level, mybudget;
-
- EDF_register_level(EDF_ENABLE_ALL);
-
- cbsstar_level = CBSSTAR_register_level(3, 0);
- mybudget = CBSSTAR_setbudget(cbsstar_level, 10000, 100000);
- edfstar_level = EDFSTAR_register_level(mybudget, cbsstar_level);
-
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- // for the keyboard...
- CBS_register_level(CBS_ENABLE_ALL, 0);
-
- SEM_register_module();
-
- CABS_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- //keyb_def_ctrlC(kparms, NULL);
- //keyb_def_map(kparms,itaMap);
- KEYB_init(&kparms);
- __call_main__(mb);
-
- return (void *)0;
-}
-
-// --------------------------------------------------
-// --------------------------------------------------
-// The Test
-// --------------------------------------------------
-// --------------------------------------------------
-
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-
-void *star(void *arg)
-{
- int i,j;
-
- for (i=0; i<5; i++) {
- for (j=0; j<100000; j++);
- cputc('°');
- cputs((char *)arg);
- task_endcycle();
- }
-
- return NULL;
-}
-
-void *edftask(void *arg)
-{
- int i,j;
-
- for (i=0; i<5; i++) {
- for (j=0; j<100000; j++);
- cputc('°');
- cputs((char *)arg);
- task_endcycle();
- }
-
- return NULL;
-}
-
-void create1()
-{
- HARD_TASK_MODEL m1, m2;
- PID p1a, p1b, p1c, p1d, p2;
-
- hard_task_default_model(m1);
- hard_task_def_wcet(m1, 5000);
- hard_task_def_level(m1,2);
- hard_task_def_group(m1,1);
- hard_task_def_periodic(m1);
-
- hard_task_def_arg(m1,(void *)"a");
- hard_task_def_mit(m1,10000);
- p1a = task_create("a", star, &m1, NULL);
- if (p1a == -1) {
- perror("Could not create task a ...");
- sys_end();
- }
-
- hard_task_def_arg(m1,(void *)"b");
- hard_task_def_mit(m1,15000);
- p1b = task_create("b", star, &m1, NULL);
- if (p1b == -1) {
- perror("Could not create task b ...");
- sys_end();
- }
-
- hard_task_def_arg(m1,(void *)"c");
- hard_task_def_mit(m1,20000);
- p1c = task_create("c", star, &m1, NULL);
- if (p1c == -1) {
- perror("Could not create task c ...");
- sys_end();
- }
-
- hard_task_def_arg(m1,(void *)"d");
- hard_task_def_mit(m1,30000);
- p1d = task_create("d", star, &m1, NULL);
- if (p1d == -1) {
- perror("Could not create task d ...");
- sys_end();
- }
-
- hard_task_default_model(m2);
- hard_task_def_mit(m2,50000); // the budget has dline 100,000!
- hard_task_def_wcet(m2, 5000);
- hard_task_def_arg(m2,(void *)"Û");
- hard_task_def_group(m2,1);
- hard_task_def_periodic(m2);
-
- p2 = task_create("2", edftask, &m2, NULL);
- if (p2 == -1) {
- perror("Could not create task edf ...");
- sys_end();
- }
-
- cprintf("stars=%d %d %d %d, star2=%d\n", p1a, p1b, p1c, p1d, p2);
-
- group_activate(1);
-}
-
-int main(int argc, char **argv)
-{
- char c;
-
- clear();
-
- cprintf("Hello, world!\nPress ESC to end the demo...\n");
-
- create1();
-
- do {
- c =keyb_getch(BLOCK);
- } while (c != ESC);
-
- cprintf("ESC pressed!");
-
- sys_end();
-
- return 0;
-}
-
Index: rel_1_21/first/test2.c
===================================================================
--- rel_1_21/first/test2.c (revision 1217)
+++ rel_1_21/first/test2.c (nonexistent)
@@ -1,241 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: test2.c,v 1.2 2003-01-07 17:10:17 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-01-07 17:10:17 $
- ------------
-
- The purpose of this test is to show that two budgets with different
- period and capacity schedules correctly.
-
- 4 periodic tasks are involved
-*/
-
-/*
- * Copyright (C) 2002 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "cbsstar.h"
-#include "edfstar.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-
-
-// --------------------------------------------------
-// --------------------------------------------------
-// Init Part
-// --------------------------------------------------
-// --------------------------------------------------
-
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
- int cbsstar_level, edfstar_level, edfstar_level2, mybudget, mybudget2;
- clear();
- EDF_register_level(EDF_ENABLE_ALL);
-
- cbsstar_level = CBSSTAR_register_level(3, 0);
-
- mybudget = CBSSTAR_setbudget(cbsstar_level, 1000, 50000);
- edfstar_level = EDFSTAR_register_level(mybudget, cbsstar_level);
-
- mybudget2 = CBSSTAR_setbudget(cbsstar_level, 10000, 25000);
- edfstar_level2 = EDFSTAR_register_level(mybudget2, cbsstar_level);
-
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- cprintf("edfstar_level=%d, edfstar_level2=%d\n",
- edfstar_level,edfstar_level2);
-
- // for the keyboard...
- CBS_register_level(CBS_ENABLE_ALL, 0);
-
- SEM_register_module();
-
- CABS_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- KEYB_init(&kparms);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
-// --------------------------------------------------
-// --------------------------------------------------
-// The Test
-// --------------------------------------------------
-// --------------------------------------------------
-
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-
-void *star(void *arg)
-{
- int i,j,z;
-
- for (i=0; i<100; i++) {
- for (z=0; z<5; z++) {
- for (j=0; j<60000; j++);
- cputs((char *)arg);
- }
- task_endcycle();
- }
-
- return NULL;
-}
-
-// version for the "slow" budget
-void *slow(void *arg)
-{
- int i,j,z;
-
- for (i=0; i<15; i++) {
- for (z=0; z<5; z++) {
- for (j=0; j<200000; j++);
- cputs((char *)arg);
- }
- task_endcycle();
- }
-
- return NULL;
-}
-
-void create1()
-{
- HARD_TASK_MODEL m1;
- PID p1a, p1b, p1c, p1d;
-
- hard_task_default_model(m1);
- hard_task_def_wcet(m1, 5000);
- hard_task_def_group(m1,1);
- hard_task_def_periodic(m1);
-
-
-
-
- hard_task_def_level(m1,2);
-
- hard_task_def_arg(m1,(void *)".");
- hard_task_def_mit(m1,5000);
- p1a = task_create("a", slow, &m1, NULL);
- if (p1a == -1) {
- perror("Could not create task a ...");
- sys_end();
- }
-
- hard_task_def_arg(m1,(void *)",");
- hard_task_def_mit(m1,5000);
- p1b = task_create("b", slow, &m1, NULL);
- if (p1b == -1) {
- perror("Could not create task b ...");
- sys_end();
- }
-
-
-
-
- hard_task_def_level(m1,3);
-
- hard_task_def_arg(m1,(void *)"o");
- hard_task_def_mit(m1,5000);
- p1c = task_create("c", star, &m1, NULL);
- if (p1c == -1) {
- perror("Could not create task c ...");
- sys_end();
- }
-
- hard_task_def_arg(m1,(void *)"O");
- hard_task_def_mit(m1,5000);
- p1d = task_create("d", star, &m1, NULL);
- if (p1d == -1) {
- perror("Could not create task d ...");
- sys_end();
- }
-
- group_activate(1);
-}
-
-int main(int argc, char **argv)
-{
- char c;
-
- cprintf("Hello, world!");
-
- create1();
-
- do {
- c =keyb_getch(BLOCK);
- } while (c != ESC);
-
- cprintf("ESC pressed!");
-
- sys_end();
-
- return 0;
-}
-
Index: rel_1_21/first/cbsstar.c
===================================================================
--- rel_1_21/first/cbsstar.c (revision 1217)
+++ rel_1_21/first/cbsstar.c (nonexistent)
@@ -1,674 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: cbsstar.c,v 1.6 2003-08-01 13:20:38 trimarchi Exp $
-
- File: $File$
- Revision: $Revision: 1.6 $
- Last update: $Date: 2003-08-01 13:20:38 $
- ------------
-
- Read CBSSTAR.h for general details.
-
- Basically, a budget can be in 2 states:
- - Active -> the budget queue is not empty
- - Idle -> the budget queue is empty
-
- The fact that a task into a budget is inserted into the master module depends
- on the value of the remaining time the tasks can spend in the period.
-
- The module does handle only one oslib event, used to enforce the
- temporal isolation between buffers. Note that all is implemented
- without using the CONTROL_CAP field.
-
- Basically, for each budget there can be at most one task inserted
- into the master level. Its deadline is modified according to the
- usage of its capacity, that is, when a budget is exausted its
- deadline is postponed.
-
-*/
-
-/*
- * Copyright (C) 2002 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#include "cbsstar.h"
-#include <ll/string.h>
-
-#define ACTIVE 1
-#define NOACTIVE 0
-#define INIT 2
-
-#define CBSSTAR_IDLE APER_STATUS_BASE
-/*
- * DEBUG stuffs begin
- */
-
-//#define CBSSTAR_DEBUG
-int event_monitor;
-#ifdef CBSSTAR_DEBUG
-
-
-static __inline__ void fake_printf(char *fmt, ...) {}
-
-//#define cbsstar_printf kern_printf
-//#define cbsstar_printf2 kern_printf
-//#define cbsstar_printf3 kern_printf
-
-#define cbsstar_printf fake_printf
-#define cbsstar_printf2 fake_printf
-#define cbsstar_printf3 fake_printf
-
-#if 0
-void cbsstar_printq(QQUEUE *q)
-{
- PID p;
- kern_printf("[");
- p = q->first;
- kern_printf("->%d",p);
- while (p != NIL) {
- p = proc_table[p].next;
- kern_printf("->%d",p);
- }
- kern_printf("]");
-}
-#else
-static __inline__ void cbsstar_printq(QQUEUE *q) {}
-#endif
-
-#if 0
-static __inline__ void cbsstar_printblob(int x) { if (x) cputc('±'); else cputc('Û'); }
-#else
-static __inline__ void cbsstar_printblob(int x) {}
-#endif
-
-#endif
-
-/*
- * DEBUG stuffs end
- */
-/*+ Status used in the level +*/
-#define CBSSTAR_WAIT APER_STATUS_BASE /*+ waiting the service +*/
-
-/* this structure contains the status for a single budget */
-struct budget_struct {
- TIME Q; /* budget */
- TIME T; /* period */
-
- struct timespec dline; /* deadline */
- int dline_timer; /* oslib event for budget reactivation*/
- int avail; /* current budget */
-
- PID current; /* the task currently put in execution */
-
- int flags;
-
- IQUEUE tasks; /* a FIFO queue for the tasks handled
- using the budget */
-};
-
-typedef struct {
- level_des l; /* the standard level descriptor */
-
- struct budget_struct *b; /* the budgets! */
- int n; /* the maximum index for the budgets */
- int freebudgets; /* number of free budgets; starts from n */
-
- int tb[MAX_PROC]; /* link task->budget (used in guest_end) */
-
- bandwidth_t U; /*+ the used bandwidth by the server +*/
-
- int cap_lev;
-
- PID on_shadow;
-
- LEVEL scheduling_level;
-
-} CBSSTAR_level_des;
-
-
-static void CBSSTAR_deadline_timer_hardreservation(void *a)
-{
- struct budget_struct *b = a;
- struct timespec t;
-
- //kern_printf("*********** %d", b->dline_timer);
- b->dline_timer=NIL;
- /* we modify the deadline according to rule 4 ... */
- /* there is a while because if the wcet is << than the system tick
- we need to postpone the deadline many times */
- if (b->avail<=0) {
- b->avail += b->Q;
- if (b->avail>b->Q) b->avail=b->Q;
-
- //kern_printf("budget recharge %d", b);
- }
-
- if (b->avail>0) b->flags=ACTIVE;
-
- /* avail may be <0 because a task executed via a shadow fo many time
- b->current == NIL only if the prec task was finished and there
- was not any other task to be put in the ready queue
- ... we are now activating the next task */
- if (b->current == NIL && b->flags) {
- if (iq_query_first(&(b->tasks)) != NIL) {
- //struct timespec t;
- CBSSTAR_level_des *lev;
- PID p;
- JOB_TASK_MODEL job;
- //kern_gettime(&t);
- //TIMESPEC_ASSIGN(&b->dline, &schedule_time);
- //ADDUSEC2TIMESPEC(b->T, &b->dline);
- kern_gettime(&t);
- TIMESPEC_ASSIGN(&b->dline, &t);
- ADDUSEC2TIMESPEC(b->T, &b->dline);
-
- p = iq_getfirst(&(b->tasks));
- b->current=p;
- lev = (CBSSTAR_level_des *)(level_table[proc_table[p].task_level]);
- //kern_printf("reinsert task p = %d lev = %d ",p,proc_table[p].task_level);
- /* and, finally, we reinsert the task in the master level */
- job_task_default_model(job, b->dline);
- job_task_def_noexc(job);
- //kern_printf("(CR:iact p%d %ld.%ld av=%d)",p,b->dline.tv_sec,b->dline.tv_nsec/1000, b->avail);
- //kern_printf("**");
- level_table[ lev->scheduling_level ]->
- private_insert(lev->scheduling_level, p, (TASK_MODEL *)&job);
-
- event_need_reschedule();
- }
- } else
- if (b->current !=NIL && b->avail>0) {
- kern_printf("(cap&nil ");
- }
- if (b->flags==NOACTIVE && b->dline_timer!=NIL){
- kern_gettime(&t);
- TIMESPEC_ASSIGN(&b->dline, &t);
- ADDUSEC2TIMESPEC(b->T, &b->dline);
-
- b->dline_timer=kern_event_post(&b->dline, CBSSTAR_deadline_timer_hardreservation, b);
- event_monitor=b->dline_timer;
- //kern_printf("(dline hard %ld.%ld ev %d)",b->dline.tv_sec,b->dline.tv_nsec/1000, b->dline_timer);
- }
-}
-static void CBSSTAR_activation(CBSSTAR_level_des *lev,
- PID p,
- struct timespec *acttime)
-{
- JOB_TASK_MODEL job;
- struct budget_struct *b = &lev->b[lev->tb[p]];
- /* we have to check if the deadline and the wcet are correct before
- activating a new task or an old task... */
-
- /* check 1: if the deadline is before than the actual scheduling time */
-
- /* check 2: if ( avail_time >= (cbs_dline - acttime)* (wcet/period) )
- (rule 7 in the CBS article!) */
- TIME t;
- struct timespec t2,t3;
-
- t = (b->T * b->avail) / b->Q;
- t3.tv_sec = t / 1000000;
- t3.tv_nsec = (t % 1000000) * 1000;
-
- SUBTIMESPEC(&b->dline, acttime, &t2);
- if (/* 1 */ TIMESPEC_A_LT_B(&b->dline, acttime) ||
- /* 2 */ TIMESPEC_A_GT_B(&t3, &t2) ) {
- TIMESPEC_ASSIGN(&b->dline, acttime);
- ADDUSEC2TIMESPEC(b->T, &b->dline);
- }
-
- /* and the capacity */
- if (b->flags==INIT) {
- b->avail = b->Q;
- b->flags=ACTIVE;
- }
-
-
-#ifdef CBSSTAR_DEBUG
- cbsstar_printf3("±%d±",lev->tb[p]);
- cbsstar_printblob(lev->tb[p]);
-#endif
- //}
- //#endif
-
- /* record the current task inserted in the master module */
- b->current = p;
-
- //#ifdef CBSSTAR_DEBUG
- //kern_printf("(CA:iact p%d %ld.%ld av=%d at=%ld.%ld)",p,b->dline.tv_sec,b->dline.tv_nsec/1000, b->avail, acttime->tv_sec, acttime->tv_nsec/1000);
- //#endif
- /* and, finally, we reinsert the task in the master level */
- job_task_default_model(job, b->dline);
- job_task_def_noexc(job);
- level_table[ lev->scheduling_level ]->
- private_insert(lev->scheduling_level, p, (TASK_MODEL *)&job);
- //b->dline_timer=kern_event_post(&b->dline, CBSSTAR_deadline_timer_hardreservation, b);
-}
-
-static void CBSSTAR_account_capacity(CBSSTAR_level_des *lev, PID p)
-{
- struct timespec ty;
- TIME tx;
- struct budget_struct *b = &lev->b[lev->tb[p]];
- TIME t;
- struct timespec t2,t3, acttime;
-
- if (lev->cap_lev!=NIL && b->current==p) {
- kern_event_delete(lev->cap_lev);
- lev->cap_lev=NIL;
- }
-
- kern_gettime(&acttime);
- t = (b->T * b->avail) / b->Q;
- t3.tv_sec = t / 1000000;
- t3.tv_nsec = (t % 1000000) * 1000;
-
- SUBTIMESPEC(&b->dline, &acttime, &t2);
-
- SUBTIMESPEC(&schedule_time, &cap_lasttime, &ty);
- tx = TIMESPEC2USEC(&ty);
- lev->b[lev->tb[p]].avail -= tx;
-
-#ifdef CBSSTAR_DEBUG
- cbsstar_printf2("(C:cap p%d av=%d)", p, lev->b[lev->tb[p]].avail);
-#endif
- if (lev->b[lev->tb[p]].avail<=0 || TIMESPEC_A_GT_B(&t3, &t2)) lev->b[lev->tb[p]].flags=NOACTIVE;
-
- if ( TIMESPEC_A_LT_B(&b->dline, &schedule_time) ) {
-
- /* we modify the deadline ... */
- TIMESPEC_ASSIGN(&b->dline, &schedule_time);
- ADDUSEC2TIMESPEC(b->T, &b->dline);
- }
-
- //if (b->flags==NOACTIVE && b->dline_timer!=NIL)
- // kern_printf("flags %d, dline_timer %d", b->flags, b->dline_timer);
-
- if (b->flags==NOACTIVE && b->dline_timer==NIL) {
- b->dline_timer=kern_event_post(&b->dline, CBSSTAR_deadline_timer_hardreservation, b);
- event_monitor=b->dline_timer;
- //kern_printf("(dline %ld.%ld ev %d)",b->dline.tv_sec,b->dline.tv_nsec/1000, b->dline_timer);
- }
-
-
-}
-
-
-/* The on-line guarantee is enabled only if the appropriate flag is set... */
-static int CBSSTAR_public_guarantee(LEVEL l, bandwidth_t *freebandwidth)
-{
- CBSSTAR_level_des *lev = (CBSSTAR_level_des *)(level_table[l]);
-
-#ifdef CBSSTAR_DEBUG
- cbsstar_printf("(C:gua)");
-#endif
-
- if (*freebandwidth >= lev->U) {
- *freebandwidth -= lev->U;
- return 1;
- }
- else
- return 0;
-}
-
-static void capacity_handler(void *l)
-{
- //kern_printf("!");
- CBSSTAR_level_des *lev =l;
- lev->cap_lev=NIL;
- event_need_reschedule();
-
-}
-
-static int CBSSTAR_private_eligible(LEVEL l, PID p)
-{
- CBSSTAR_level_des *lev = (CBSSTAR_level_des *)(level_table[l]);
- struct budget_struct *b = &lev->b[lev->tb[p]];
- JOB_TASK_MODEL job;
-
-#ifdef CBSSTAR_DEBUG
- //kern_printf("(C:eli %d",p);
-#endif
-
- /* we have to check if the deadline and the wcet are correct...
- if the CBSSTAR level schedules in background with respect to others
- levels, there can be the case in witch a task is scheduled by
- schedule_time > CBSSTAR_deadline; in this case (not covered in the
- article because if there is only the standard scheduling policy
- this never apply) we reassign the deadline */
- if (b->current==p) {
- if ( TIMESPEC_A_LT_B(&b->dline, &schedule_time)) {
- if (lev->cap_lev!=NIL) {
- kern_event_delete(lev->cap_lev);
- lev->cap_lev=NIL;
- }
-
- /* we kill the current activation */
- level_table[ lev->scheduling_level ]->
- private_extract(lev->scheduling_level, p);
- /* we modify the deadline ... */
- TIMESPEC_ASSIGN(&b->dline, &schedule_time);
- ADDUSEC2TIMESPEC(b->T, &b->dline);
-
- /* and the capacity */
- b->avail = b->Q;
- b->flags=ACTIVE;
-
- if (b->dline_timer!=NIL) {
- kern_event_delete(b->dline_timer);
- b->dline_timer=NIL;
- }
-
- //#ifdef CBSSTAR_DEBUG
- //kern_printf(" %ld.%ld av=%d)",b->dline.tv_sec,b->dline.tv_nsec/1000, b->Q);
- //cbsstar_printf3("±%d±",lev->tb[p]);
- //cbsstar_printblob(lev->tb[p]);
- //#endif
-
- /* and, finally, we reinsert the task in the master level */
- job_task_default_model(job, b->dline);
- job_task_def_noexc(job);
- //kern_printf("(CE:iact p%d %ld.%ld av=%d)",p,b->dline.tv_sec,b->dline.tv_nsec/1000, b->avail);
- level_table[ lev->scheduling_level ]->
- private_insert(lev->scheduling_level, p, (TASK_MODEL *)&job);
- //kern_printf("task %d, avail %d", p, b->avail);
- return -1;
- }
-}
-#ifdef CBSSTAR_DEBUG
- cbsstar_printf(")");
-#endif
-
- return 0;
-}
-
-static void CBSSTAR_private_insert(LEVEL l, PID p, TASK_MODEL *m)
-{
- /* A task has been activated for some reason. Basically, the task is
- inserted in the queue if the queue is empty, otherwise the task is
- inserted into the master module, and an oslib event is posted. */
-
- CBSSTAR_level_des *lev = (CBSSTAR_level_des *)(level_table[l]);
- BUDGET_TASK_MODEL *budget;
-
- if (m->pclass != BUDGET_PCLASS ||
- (m->level != 0 && m->level != l)) {
- kern_raise(XINVALID_TASK, p);
- return;
- }
- budget = (BUDGET_TASK_MODEL *)m;
-
-#ifdef CBSSTAR_DEBUG
- cbsstar_printf("(C:gcr %d b%d", p, budget->b);
-#endif
-
- lev->tb[p] = budget->b;
-
- if (lev->b[budget->b].current == NIL && lev->b[budget->b].flags ) {
- /* This is the first task in the budget,
- the task have to be inserted into the master module */
- struct timespec t;
- kern_gettime(&t);
- CBSSTAR_activation(lev,p,&t);
- } else {
- /* The budget is not empty, another task is already into the
- master module, so the task is inserted at the end of the budget
- queue */
- iq_insertlast(p,&lev->b[budget->b].tasks);
-//#ifdef CBSSTAR_DEBUG
- //kern_printf(" ilast flag %d task %d",lev->b[budget->b].flags,lev->b[budget->b].current);
- // cbsstar_printq(&lev->b[budget->b].tasks);
-//#endif
- }
-#ifdef CBSSTAR_DEBUG
- cbsstar_printf(")");
-#endif
-}
-
-static void CBSSTAR_private_extract(LEVEL l, PID p)
-{
- CBSSTAR_level_des *lev = (CBSSTAR_level_des *)(level_table[l]);
-
-//#ifdef CBSSTAR_DEBUG
- //kern_printf("(C:gend p%d c%d av=%d)", p, lev->b[lev->tb[p]].current, lev->b[lev->tb[p]].avail);
- //cbsstar_printq(&lev->b[lev->tb[p]].tasks);
-//#endif
-
- /* a task is removed from execution for some reasons. It must be
- that it is the first in its budget queue (only the first task in
- a budget queue is put into execution!) */
-
- /* remove the task from execution (or from the ready queue) */
- if (lev->b[lev->tb[p]].current == p) {
-
- CBSSTAR_account_capacity(lev,p);
- /* remove the task from the master module */
- level_table[ lev->scheduling_level ]->
- private_extract(lev->scheduling_level, p);
-
-#ifdef CBSSTAR_DEBUG
- cbsstar_printq(&lev->b[lev->tb[p]].tasks);
-#endif
-
- /* check if the buffer has someone else to schedule */
- if (iq_query_first(&lev->b[lev->tb[p]].tasks) == NIL) {
- /* the buffer has no tasks! */
- lev->b[lev->tb[p]].current = NIL;
- }
- else if (lev->b[lev->tb[p]].flags) {
- /* if so, insert the new task into the master module */
- PID n;
- struct timespec t;
-
- kern_gettime(&t);
- n = iq_getfirst(&lev->b[lev->tb[p]].tasks);
-//#ifdef CBSSTAR_DEBUG
- //kern_printf("{p%d n%d}",p,n);
-//#endif
- CBSSTAR_activation(lev,n,&t); // it modifies b[lev->tb[p]].current
- }
- else
- lev->b[lev->tb[p]].current=NIL;
-
- }
- else {
- iq_extract(p, &lev->b[lev->tb[p]].tasks);
- }
-}
-
-static void CBSSTAR_private_dispatch(LEVEL l, PID p, int nostop)
-{
- CBSSTAR_level_des *lev = (CBSSTAR_level_des *)(level_table[l]);
- struct timespec ty;
-
-//#ifdef CBSSTAR_DEBUG
- //kern_printf("(C:gdisp p%d c%d av=%d)", p, lev->b[lev->tb[p]].current, lev->b[lev->tb[p]].avail);
-// cbsstar_printq(&lev->b[lev->tb[p]].tasks);
-//#endif
-
- /* the current task (that is the only one inserted in the master module
- for the corresponding budget) is dispatched. Note that the current
- task is not inserted in any FIFO queue, so the task does not have to
- be extracted! */
-
- /* ... then, we dispatch it to the master level */
- level_table[ lev->scheduling_level ]->
- private_dispatch(lev->scheduling_level,p,nostop);
-
- /* ...and finally, we have to post a capacity event */
- if (!nostop) {
- TIMESPEC_ASSIGN(&ty, &schedule_time);
- ADDUSEC2TIMESPEC(lev->b[lev->tb[p]].avail,&ty);
- lev->cap_lev = kern_event_post(&ty,capacity_handler, lev);
- }
-
-}
-
-static void CBSSTAR_private_epilogue(LEVEL l, PID p)
-{
- CBSSTAR_level_des *lev = (CBSSTAR_level_des *)(level_table[l]);
- struct budget_struct *b = &lev->b[lev->tb[p]];
-
-
- //#ifdef CBSSTAR_DEBUG
- //kern_printf("(C:gepi %d %d",p, b->current);
- //#endif
-
- if (p==b->current) {
-
- CBSSTAR_account_capacity(lev,p);
-
- // L'evento di capacità va cancellato perchè sarà ripristinato nella successiva dispatch
- /* we have to check if the capacity is still available */
- if (b->flags) {
- /* there is capacity available, maybe it is simply a preemption;
- the task have to return to the ready queue */
- level_table[ lev->scheduling_level ]->
- private_epilogue(lev->scheduling_level,p);
-#ifdef CBSSTAR_DEBUG
- //kern_printf("(ep *av=%d", b->avail);
-#endif
-
-
- } else {
- /* we kill the current activation */
- level_table[ lev->scheduling_level ]->
- private_extract(lev->scheduling_level, p);
- //kern_printf("extract");
- iq_insertfirst(p, &b->tasks);
- proc_table[p].status = CBSSTAR_IDLE;
- b->current = NIL;
-
- //kern_printf("budget finish %d", b);
- }
-#ifdef CBSSTAR_DEBUG
- cbsstar_printf(")");
-#endif
- }
-
-}
-
-/* Registration functions }*/
-
-/*+ Registration function:
- int flags the init flags ... see CBSSTAR.h +*/
-LEVEL CBSSTAR_register_level(int n, LEVEL master)
-{
- LEVEL l; /* the level that we register */
- CBSSTAR_level_des *lev; /* for readableness only */
- PID i; /* a counter */
-
-#ifdef CBSSTAR_DEBUG
- cbsstar_printf("CBSSTAR_register_level\n");
-#endif
-
- /* request an entry in the level_table */
- l = level_alloc_descriptor(sizeof(CBSSTAR_level_des));
-
- lev = (CBSSTAR_level_des *)level_table[l];
-
- printk(" lev=%d\n",(int)lev);
-
- /* fill the standard descriptor */
- lev->l.private_insert = CBSSTAR_private_insert;
- lev->l.private_extract = CBSSTAR_private_extract;
- lev->l.private_eligible = CBSSTAR_private_eligible;
- lev->l.private_dispatch = CBSSTAR_private_dispatch;
- lev->l.private_epilogue = CBSSTAR_private_epilogue;
-
- lev->l.public_guarantee = CBSSTAR_public_guarantee;
-
- /* fill the CBSSTAR descriptor part */
- lev->b = (struct budget_struct *)kern_alloc(sizeof(struct budget_struct)*n);
-
- for (i=0; i<n; i++) {
- lev->b[i].Q = 0;
- lev->b[i].T = 0;
- NULL_TIMESPEC(&lev->b[i].dline);
- lev->b[i].dline_timer = NIL;
- lev->b[i].avail = 0;
- lev->b[i].current = -1;
- lev->b[i].flags=INIT;
- iq_init(&lev->b[i].tasks, &freedesc, 0);
- }
-
- lev->n = n;
- lev->freebudgets = 0;
-
- for (i=0; i<MAX_PROC; i++)
- lev->tb[i] = NIL;
-
- lev->U = 0;
- lev->cap_lev=NIL;
- lev->scheduling_level = master;
- lev->on_shadow=NIL;
-
- return l;
-}
-
-int CBSSTAR_setbudget(LEVEL l, TIME Q, TIME T)
-{
- CBSSTAR_level_des *lev = (CBSSTAR_level_des *)(level_table[l]);
-
-#ifdef CBSSTAR_DEBUG
- cbsstar_printf("(C:sbud)");
-#endif
-
- if (lev->freebudgets != lev->n) {
- bandwidth_t b;
- b = (MAX_BANDWIDTH / T) * Q;
-
- /* really update lev->U, checking an overflow... */
- if (Q< T && MAX_BANDWIDTH - lev->U > b) {
- int r = lev->freebudgets; // the return value
-
- lev->U += b;
- lev->freebudgets++;
-
- lev->b[r].Q = Q;
- lev->b[r].T = T;
-
- return r;
- }
- else
- return -2;
- }
- else
- return -1;
-}
Index: rel_1_21/first/posixstar.h
===================================================================
--- rel_1_21/first/posixstar.h (revision 1217)
+++ rel_1_21/first/posixstar.h (nonexistent)
@@ -1,142 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-
-/**
- ------------
- CVS : $Id: posixstar.h,v 1.1 2003-06-18 08:13:53 trimarchi Exp $
-
- File: $File$
- Revision: $Revision: 1.1 $
- Last update: $Date: 2003-06-18 08:13:53 $
- ------------
-
- This file contains the scheduling module compatible with POSIX
- specifications
-
- Title:
- POSIX version 1
-
- Task Models Accepted:
- NRT_TASK_MODEL - Non-Realtime Tasks
- weight field is ignored
- slice field is used to set the slice of a task, if it is !=0
- policy field is ignored
- inherit field is ignored
-
- Description:
- This module schedule his tasks following the POSIX specifications...
-
- A task can be scheduled in a Round Robin way or in a FIFO way.
- The tasks have also a priority field.
-
- The slices can be different one task from one another.
-
- The module can SAVE or SKIP activations
-
- Exceptions raised:
- XUNVALID_GUEST
- This level doesn't support guests. When a guest operation
- is called, the exception is raised.
-
- Restrictions & special features:
- - if specified, it creates at init time a task,
- called "Main", attached to the function __init__().
- - There must be only one module in the system that creates a task
- attached to the function __init__().
- - The level tries to guarantee that a RR task uses a "full" timeslice
- before going to the queue tail. "full" means that a task can execute
- a maximum time of slice+sys_tick due to the approx. done by
- the Virtual Machine. If a task execute more time than the slice,
- the next time it execute less...
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#ifndef __POSIXSTAR_H__
-#define __POSIXSTAR_H__
-
-#include <ll/ll.h>
-#include <kernel/config.h>
-#include <sys/types.h>
-#include <kernel/types.h>
-//#define POSIXSTAR_DEBUG
-
-/*+ Const: +*/
-#define POSIXSTAR_MINIMUM_SLICE 1000 /*+ Minimum Timeslice +*/
-#define POSIXSTAR_MAXIMUM_SLICE 500000 /*+ Maximum Timeslice +*/
-
-/*+ Registration function:
- TIME slice the slice for the Round Robin queue
- int createmain 1 if the level creates the main task 0 otherwise
- struct multiboot_info *mb used if createmain specified
-
- returns the level number at which the module has been registered.
-+*/
-LEVEL POSIXSTAR_register_level(int budget, int master, TIME slice,
- int prioritylevels);
-
-/*+ this function forces the running task to go to his queue tail,
- then calls the scheduler and changes the context
- (it works only on the POSIX level) +*/
-int POSIXSTAR_sched_yield(LEVEL l);
-
-/* the following functions have to be called with interruptions DISABLED! */
-
-/*+ this function returns the maximum level allowed for the POSIX level +*/
-int POSIXSTAR_get_priority_max(LEVEL l);
-
-/*+ this function returns the default timeslice for the POSIX level +*/
-int POSIXSTAR_rr_get_interval(LEVEL l);
-
-/*+ this functions returns some paramaters of a task;
- policy must be NRT_RR_POLICY or NRT_FIFO_POLICY;
- priority must be in the range [0..prioritylevels]
- returns ENOSYS or ESRCH if there are problems +*/
-int POSIXSTAR_getschedparam(LEVEL l, PID p, int *policy, int *priority);
-
-/*+ this functions sets paramaters of a task +*/
-int POSIXSTAR_setschedparam(LEVEL l, PID p, int policy, int priority);
-
-#endif
-
-/*
-MANCANO
-13.3.6 GETPRIORITYMin da mettere a 0
-*/
Index: rel_1_21/first/test3.c
===================================================================
--- rel_1_21/first/test3.c (revision 1217)
+++ rel_1_21/first/test3.c (nonexistent)
@@ -1,213 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: test3.c,v 1.2 2003-01-07 17:10:17 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-01-07 17:10:17 $
- ------------
-
- The purpose of this test is to show that two budgets with different
- period and budgets schedules correctly.
-
- 2 never ending tasks are involved
-*/
-
-/*
- * Copyright (C) 2002 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "cbsstar.h"
-#include "edfstar.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-
-// --------------------------------------------------
-// --------------------------------------------------
-// Init Part
-// --------------------------------------------------
-// --------------------------------------------------
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
- int cbsstar_level, edfstar_level, edfstar_level2, mybudget, mybudget2;
- clear();
- EDF_register_level(EDF_ENABLE_ALL);
-
- cbsstar_level = CBSSTAR_register_level(3, 0);
-
- mybudget = CBSSTAR_setbudget(cbsstar_level, 2000, 50000);
- edfstar_level = EDFSTAR_register_level(mybudget, cbsstar_level);
-
- mybudget2 = CBSSTAR_setbudget(cbsstar_level, 10000, 25000);
- edfstar_level2 = EDFSTAR_register_level(mybudget2, cbsstar_level);
-
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- cprintf("edfstar_level=%d, edfstar_level2=%d\n",
- edfstar_level,edfstar_level2);
-
- // for the keyboard...
- CBS_register_level(CBS_ENABLE_ALL, 0);
-
- SEM_register_module();
-
- CABS_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- KEYB_init(&kparms);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
-// --------------------------------------------------
-// --------------------------------------------------
-// The Test
-// --------------------------------------------------
-// --------------------------------------------------
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-#include <semaphore.h>
-
-sem_t s;
-
-void *star(void *arg)
-{
- int j,z;
-
- for (;;) {
- for (z=0; z<5; z++) {
- for (j=0; j<60000; j++);
- sem_wait(&s);
- cputs((char *)arg);
- sem_post(&s);
- }
- }
-
- return NULL;
-}
-
-
-void create1()
-{
- HARD_TASK_MODEL m1;
- PID p1a, p1c;
-
- hard_task_default_model(m1);
- hard_task_def_wcet(m1, 5000);
- hard_task_def_group(m1,1);
- hard_task_def_periodic(m1);
-
-
-
-
- hard_task_def_level(m1,2);
-
- hard_task_def_arg(m1,(void *)"O");
- hard_task_def_mit(m1,5000);
- p1a = task_create("a", star, &m1, NULL);
- if (p1a == -1) {
- perror("Could not create task a ...");
- sys_end();
- }
-
-
- hard_task_def_level(m1,3);
-
- hard_task_def_arg(m1,(void *)".");
- hard_task_def_mit(m1,5000);
- p1c = task_create("c", star, &m1, NULL);
- if (p1c == -1) {
- perror("Could not create task c ...");
- sys_end();
- }
-
- group_activate(1);
-}
-
-void endfun(KEY_EVT *k)
-{
- cprintf("ESC pressed!");
-
- sys_end();
-}
-
-int main(int argc, char **argv)
-{
- KEY_EVT k;
-
- sem_init(&s,0,1);
-
- k.flag = 0;
- k.scan = KEY_ESC;
- k.ascii = 27;
- keyb_hook(k,endfun);
-
- create1();
-
- return 0;
-}
-
Index: rel_1_21/first/iqueue.h
===================================================================
--- rel_1_21/first/iqueue.h (revision 1217)
+++ rel_1_21/first/iqueue.h (nonexistent)
@@ -1,172 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: iqueue.h,v 1.1 2002-09-02 10:29:30 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1 $
- Last update: $Date: 2002-09-02 10:29:30 $
- ------------
-
-*/
-
-/*
- * Copyright (C) 2002 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-/*
- IQUEUEs
-
- This file contains functions that helps to manage task queues.
-
- These functions are different from the functions that manages the
- QUEUE and QQUEUE types. In particular, these functions no more relies
- on the prev & next fields of the task descriptor. In that way, tasks
- can be inserted in more than one queue at a time.
-
- Basically, an IQUEUE has an "I"nternal prev/next structure, that may
- be shared between one or more queue. Of course, the user MUST
- guarantee that the same task will not be inserted in two IQUEUEs that
- share the same prev/next buffer.
-
- The queue insertion is made by the following functions:
- iq_insert -> insertion based on the priority field.
- iq_timespec_insert -> same as above but use the timespec_priority field
- iq_insertfirst -> insert in the first position of the queue
-*/
-
-#include <kernel/const.h>
-#include <kernel/types.h>
-#include <sys/types.h>
-
-#define IQUEUE_NO_PRIORITY 1
-#define IQUEUE_NO_TIMESPEC 2
-
-struct IQUEUE_shared {
- PID prev[MAX_PROC];
- PID next[MAX_PROC];
- struct timespec *timespec_priority;
- DWORD *priority;
-};
-
-typedef struct {
- PID first;
- PID last;
- struct IQUEUE_shared *s;
-} IQUEUE;
-
-
-
-/* Internal queue initialization:
-
- share = &x -> the internal data structure of the IQUEUE x is used
- to enqueue the tasks.
-
- share = NULL -> an internal data structure to handle prev/next
- pairs is dynamically allocated (The amount of
- memory that is allocated can be reduced using the
- flags).
-
- flags can be used to reduce the memory usage of an IQUEUE when share=NULL:
- IQUEUE_NO_PRIORITY -> the iqueue do not provide internally a priority field
- IQUEUE_NO_TIMESPEC -> the iqueue do not provide internally a timespec field
-
- - note that, if these flags are used, the corresponding insert
- functions will not work!
- - the default value for the flags is, of course, 0
-*/
-void iq_init (IQUEUE *q, IQUEUE *share, int flags);
-
-/* Queue insert functions:
-
- - inserts a p into the q. p must not be already inserted into q.
- - four versions of the function;
- - iq_priority_insert -> ordered insertion using the priority field
- - iq_timespec_insert -> ordered insertion using the timespec field
- - iq_insertfirst -> insert at the first position of the queue
- - iq_insertlast -> insert at the last position of the queue
-*/
-void iq_priority_insert (PID p, IQUEUE *q);
-void iq_timespec_insert (PID p, IQUEUE *q);
-void iq_insertfirst (PID p, IQUEUE *q);
-void iq_insertlast (PID p, IQUEUE *q);
-
-/* Queue extract functions:
-
- - extracts a task p from the queue q.
- - three versions of the function;
- - iq_extract -> extracts given a task p
- (that must be inserted in the queue)
-
- - iq_getfirst -> extracts the first task in the queue,
- NIL if the queue is empty
-
- - iq_getlast -> extracts the last task in the queue,
- NIL if the queue is empty
-
-*/
-void iq_extract (PID p, IQUEUE *q);
-PID iq_getfirst ( IQUEUE *q);
-PID iq_getlast ( IQUEUE *q);
-
-
-/* Queue query functions:
-
- The first two functions return the first and the last task in the queue,
- NIL if the queue is empty.
-
- The second two functions can be used to get/set the priority or the
- timespec field used when queuing.
-*/
-static __inline__ PID iq_queryfirst(IQUEUE *q)
-{
- return q->first;
-}
-
-static __inline__ PID iq_querylast(IQUEUE *q)
-{
- return q->last;
-}
-
-static __inline__ struct timespec *iq_query_timespec(PID p, IQUEUE *q)
-{
- return &q->s->timespec_priority[p];
-}
-
-static __inline__ DWORD *iq_query_priority (PID p, IQUEUE *q)
-{
- return &q->s->priority[p];
-}
Index: rel_1_21/first/test4.c
===================================================================
--- rel_1_21/first/test4.c (revision 1217)
+++ rel_1_21/first/test4.c (nonexistent)
@@ -1,231 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: test4.c,v 1.2 2003-01-07 17:10:17 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-01-07 17:10:17 $
- ------------
-
- The purpose of this test is to show that two budgets with different
- period and budgets schedules correctly.
-
- 2 never ending tasks are involved
-*/
-
-/*
- * Copyright (C) 2002 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "cbsstar.h"
-#include "edfstar.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-
-// --------------------------------------------------
-// --------------------------------------------------
-// Init Part
-// --------------------------------------------------
-// --------------------------------------------------
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
- int cbsstar_level;
- int edfstar_level, edfstar_level2, edfstar_level3;
- int mybudget, mybudget2;
-
- clear();
-
- EDF_register_level(EDF_ENABLE_ALL);
-
- cbsstar_level = CBSSTAR_register_level(3, 0);
-
- mybudget = CBSSTAR_setbudget(cbsstar_level, 2000, 50000);
- edfstar_level = EDFSTAR_register_level(mybudget, cbsstar_level);
-
- mybudget2 = CBSSTAR_setbudget(cbsstar_level, 10000, 25000);
- edfstar_level2 = EDFSTAR_register_level(mybudget2, cbsstar_level);
- edfstar_level3 = EDFSTAR_register_level(mybudget2, cbsstar_level);
-
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- cprintf("edfstar_level=%d, edfstar_level2=%d\n",
- edfstar_level,edfstar_level2);
-
- // for the keyboard...
- CBS_register_level(CBS_ENABLE_ALL, 0);
-
- SEM_register_module();
-
- CABS_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- //keyb_def_ctrlC(kparms, NULL);
- //keyb_def_map(kparms,itaMap);
- KEYB_init(&kparms);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
-// --------------------------------------------------
-// --------------------------------------------------
-// The Test
-// --------------------------------------------------
-// --------------------------------------------------
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-#include <semaphore.h>
-
-sem_t s;
-
-void *star(void *arg)
-{
- int j,z;
-
- for (;;) {
- for (z=0; z<50; z++) {
- for (j=0; j<60000; j++);
-// sem_wait(&s);
- cputs((char *)arg);
-// sem_post(&s);
- }
- task_endcycle();
- }
-
- return NULL;
-}
-
-
-void create1()
-{
- HARD_TASK_MODEL m1;
- PID p1a, p1b, p1c;
-
- hard_task_default_model(m1);
- hard_task_def_wcet(m1, 5000);
- hard_task_def_group(m1,1);
- hard_task_def_periodic(m1);
-
-
-
-
- hard_task_def_level(m1,2);
-
- hard_task_def_arg(m1,(void *)"O");
- hard_task_def_mit(m1,5000);
- p1a = task_create("a", star, &m1, NULL);
- if (p1a == -1) {
- perror("Could not create task a ...");
- sys_end();
- }
-
-
- hard_task_def_level(m1,3);
-
- hard_task_def_arg(m1,(void *)".");
- hard_task_def_mit(m1,5000);
- p1b = task_create("b", star, &m1, NULL);
- if (p1b == -1) {
- perror("Could not create task c ...");
- sys_end();
- }
-
- hard_task_def_level(m1,4);
-
- hard_task_def_arg(m1,(void *)",");
- hard_task_def_mit(m1,5000);
- p1c = task_create("c", star, &m1, NULL);
- if (p1c == -1) {
- perror("Could not create task c ...");
- sys_end();
- }
-
- group_activate(1);
-}
-
-void endfun(KEY_EVT *k)
-{
- cprintf("ESC pressed!");
-
- sys_end();
-}
-
-int main(int argc, char **argv)
-{
- KEY_EVT k;
-
- sem_init(&s,0,1);
-
- k.flag = 0;
- k.scan = KEY_ESC;
- k.ascii = 27;
- keyb_hook(k,endfun);
-
- create1();
-
- return 0;
-}
-
Index: rel_1_21/first/test5.c
===================================================================
--- rel_1_21/first/test5.c (revision 1217)
+++ rel_1_21/first/test5.c (nonexistent)
@@ -1,248 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: test5.c,v 1.2 2003-01-07 17:10:17 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-01-07 17:10:17 $
- ------------
-
- The purpose of this test is to show that two budgets with different
- period and budgets schedules correctly.
-
- 2 never ending tasks are involved
-*/
-
-/*
- * Copyright (C) 2002 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "cbsstar.h"
-#include "edfstar.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-
-// --------------------------------------------------
-// --------------------------------------------------
-// Init Part
-// --------------------------------------------------
-// --------------------------------------------------
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
- int cbsstar_level;
- int edfstar_level, edfstar_level2, edfstar_level3;
- int mybudget, mybudget2;
-
- clear();
-
- EDF_register_level(EDF_ENABLE_ALL);
-
- cbsstar_level = CBSSTAR_register_level(3, 0);
-
- mybudget = CBSSTAR_setbudget(cbsstar_level, 2000, 50000);
- edfstar_level = EDFSTAR_register_level(mybudget, cbsstar_level);
-
- mybudget2 = CBSSTAR_setbudget(cbsstar_level, 10000, 25000);
- edfstar_level2 = EDFSTAR_register_level(mybudget2, cbsstar_level);
- edfstar_level3 = EDFSTAR_register_level(mybudget2, cbsstar_level);
-
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- cprintf("edfstar_level=%d, edfstar_level2=%d\n",
- edfstar_level,edfstar_level2);
-
- // for the keyboard...
- CBS_register_level(CBS_ENABLE_ALL, 0);
-
- CBS_register_level(CBS_ENABLE_ALL, edfstar_level3);
-
- SEM_register_module();
-
- CABS_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- //keyb_def_ctrlC(kparms, NULL);
- //keyb_def_map(kparms,itaMap);
- KEYB_init(&kparms);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
-// --------------------------------------------------
-// --------------------------------------------------
-// The Test
-// --------------------------------------------------
-// --------------------------------------------------
-
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-#include <semaphore.h>
-
-sem_t s;
-
-void *star(void *arg)
-{
- int j,z;
-
- for (;;) {
- for (z=0; z<50; z++) {
- for (j=0; j<60000; j++);
-// sem_wait(&s);
- cputs((char *)arg);
-// sem_post(&s);
- }
- task_endcycle();
- }
-
- return NULL;
-}
-
-
-void create1()
-{
- HARD_TASK_MODEL m1;
- SOFT_TASK_MODEL ms;
- PID p1a, p1b, p1c, p2;
-
- hard_task_default_model(m1);
- hard_task_def_wcet(m1, 5000);
- hard_task_def_group(m1,1);
- hard_task_def_periodic(m1);
-
-
-
-
- hard_task_def_level(m1,2);
-
- hard_task_def_arg(m1,(void *)"O");
- hard_task_def_mit(m1,5000);
- p1a = task_create("a", star, &m1, NULL);
- if (p1a == -1) {
- perror("Could not create task a ...");
- sys_end();
- }
-
-
- hard_task_def_level(m1,3);
-
- hard_task_def_arg(m1,(void *)".");
- hard_task_def_mit(m1,50000);
- p1b = task_create("b", star, &m1, NULL);
- if (p1b == -1) {
- perror("Could not create task c ...");
- sys_end();
- }
-
- hard_task_def_level(m1,4);
-
- hard_task_def_arg(m1,(void *)",");
- hard_task_def_mit(m1,50000);
- p1c = task_create("c", star, &m1, NULL);
- if (p1c == -1) {
- perror("Could not create task c ...");
- sys_end();
- }
-
- soft_task_default_model(ms);
- soft_task_def_met(ms, 5000);
- soft_task_def_period(ms, 30000);
- soft_task_def_group(ms,1);
- soft_task_def_periodic(ms);
- soft_task_def_level(ms,8);
- soft_task_def_arg(ms,(void *)"X");
- p2 = task_create("S", star, &ms, NULL);
- if (p2 == -1) {
- perror("Could not create task S ...");
- sys_end();
- }
-
- group_activate(1);
-}
-
-void endfun(KEY_EVT *k)
-{
- cprintf("ESC pressed!");
-
- sys_end();
-}
-
-int main(int argc, char **argv)
-{
- KEY_EVT k;
-
- sem_init(&s,0,1);
-
- k.flag = 0;
- k.scan = KEY_ESC;
- k.ascii = 27;
- keyb_hook(k,endfun);
-
- create1();
-
- return 0;
-}
-
Index: rel_1_21/first/test6.c
===================================================================
--- rel_1_21/first/test6.c (revision 1217)
+++ rel_1_21/first/test6.c (nonexistent)
@@ -1,248 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: test6.c,v 1.2 2003-01-07 17:10:17 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-01-07 17:10:17 $
- ------------
-
- this test shows a set of 5 tasks (+main+dummy+keyboard driver).
-
- The first 4 tasks are scheduled by a RMSTAR Module, whereas the
- fifth one is a standard traditional EDF task. The 4 tasks uses a
- budget of 10000/100000.
-
- if edfstar.c is compiled with edfstar_printf3 active, a couple
- (dline, curtime) is showed (in ms).
-
- if cbsstar.c is compiled with cbsstar_printf3 active, the budget
- replenishments are showed.
-*/
-
-/*
- * Copyright (C) 2002 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "cbsstar.h"
-#include "rmstar.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-
-
-// --------------------------------------------------
-// --------------------------------------------------
-// Init Part
-// --------------------------------------------------
-// --------------------------------------------------
-
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
- int cbsstar_level, rmstar_level, mybudget;
-
- EDF_register_level(EDF_ENABLE_ALL);
-
- cbsstar_level = CBSSTAR_register_level(3, 0);
- mybudget = CBSSTAR_setbudget(cbsstar_level, 10000, 100000);
- rmstar_level = RMSTAR_register_level(mybudget, cbsstar_level);
-
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- // for the keyboard...
- CBS_register_level(CBS_ENABLE_ALL, 0);
-
- SEM_register_module();
-
- CABS_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- //keyb_def_ctrlC(kparms, NULL);
- //keyb_def_map(kparms,itaMap);
- KEYB_init(&kparms);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
-// --------------------------------------------------
-// --------------------------------------------------
-// The Test
-// --------------------------------------------------
-// --------------------------------------------------
-
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-
-void *star(void *arg)
-{
- int i,j;
-
- for (i=0; i<5; i++) {
- for (j=0; j<100000; j++);
- cputc('°');
- cputs((char *)arg);
- task_endcycle();
- }
-
- return NULL;
-}
-
-void *edftask(void *arg)
-{
- int i,j;
-
- for (i=0; i<5; i++) {
- for (j=0; j<100000; j++);
- cputc('°');
- cputs((char *)arg);
- task_endcycle();
- }
-
- return NULL;
-}
-
-void create1()
-{
- HARD_TASK_MODEL m1, m2;
- PID p1a, p1b, p1c, p1d, p2;
-
- hard_task_default_model(m1);
- hard_task_def_wcet(m1, 5000);
- hard_task_def_level(m1,2);
- hard_task_def_group(m1,1);
- hard_task_def_periodic(m1);
-
- hard_task_def_arg(m1,(void *)"a");
- hard_task_def_mit(m1,10000);
- p1a = task_create("a", star, &m1, NULL);
- if (p1a == -1) {
- perror("Could not create task a ...");
- sys_end();
- }
-
- hard_task_def_arg(m1,(void *)"b");
- hard_task_def_mit(m1,15000);
- p1b = task_create("b", star, &m1, NULL);
- if (p1b == -1) {
- perror("Could not create task b ...");
- sys_end();
- }
-
- hard_task_def_arg(m1,(void *)"c");
- hard_task_def_mit(m1,20000);
- p1c = task_create("c", star, &m1, NULL);
- if (p1c == -1) {
- perror("Could not create task c ...");
- sys_end();
- }
-
- hard_task_def_arg(m1,(void *)"d");
- hard_task_def_mit(m1,30000);
- p1d = task_create("d", star, &m1, NULL);
- if (p1d == -1) {
- perror("Could not create task d ...");
- sys_end();
- }
-
- hard_task_default_model(m2);
- hard_task_def_mit(m2,50000); // the budget has dline 100,000!
- hard_task_def_wcet(m2, 5000);
- hard_task_def_arg(m2,(void *)"Û");
- hard_task_def_group(m2,1);
- hard_task_def_periodic(m2);
-
- p2 = task_create("2", edftask, &m2, NULL);
- if (p2 == -1) {
- perror("Could not create task edf ...");
- sys_end();
- }
-
- cprintf("stars=%d %d %d %d, star2=%d\n", p1a, p1b, p1c, p1d, p2);
-
- group_activate(1);
-}
-
-int main(int argc, char **argv)
-{
- char c;
-
- clear();
-
- cprintf("Hello, world!");
-
- create1();
-
- do {
- c =keyb_getch(BLOCK);
- } while (c != ESC);
-
- cprintf("ESC pressed!");
-
- sys_end();
-
- return 0;
-}
-
Index: rel_1_21/first/cbsstar.h
===================================================================
--- rel_1_21/first/cbsstar.h (revision 1217)
+++ rel_1_21/first/cbsstar.h (nonexistent)
@@ -1,157 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-
-/*
- ------------
- CVS : $Id: cbsstar.h,v 1.1 2002-09-02 10:29:30 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1 $
- Last update: $Date: 2002-09-02 10:29:30 $
- ------------
-
- This file contains the budget support for the multiapplication
- scheduling algorithm proposed in the framework of the FIRST Project
-
- Title:
- CBSSTAR
-
- Task Models Accepted:
- None!
-
- Guest Models Accepted:
- BUDGET_TASK_MODEL - A task that is attached to a budget
- int b; --> the number of the budget which the task is attached to
-
- Description:
- This module schedule its tasks following the CBS scheme.
- Every task is inserted using the guest calls.
-
- The module defines a limited set of budgets that the application
- can use. Every guest task will use a particular budget; FIFO
- scheduling is used inside a budget to schedule more than one ready
- task attached to the same budget.
-
- The tasks are inserted in an EDF level (or similar) with a JOB_TASK_MODEL,
- and the CBS level expects that the task is scheduled with the absolute
- deadline passed in the model.
-
- This module tries to implement a simplified version of the guest
- task interface:
- - To insert a guest task, use guest_create
- - When a task is dispatched, use guest_dispatch
- - When a task have to be suspended, you have to use:
- -> preemption: use guest_epilogue
- -> synchronization, end: use guest_end
- Remember: no check is done on the budget number passed with the model!!!
-
- Exceptions raised:
- XUNVALID_TASK
- This level doesn't support normal tasks, but just guest tasks.
- When a task operation is called, an exception is raised.
-
- Restrictions & special features:
- - This level doesn't manage the main task.
- - At init time we have to specify:
- . guarantee check
- (when all task are created the system will check that the task_set
- will not use more than the available bandwidth)
- - A function to return the used bandwidth of the level is provided.
-
- - A function is provided to allocate a buffer.
-*/
-
-/*
- * Copyright (C) 2002 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#ifndef __CBSSTAR_H__
-#define __CBSSTAR_H__
-
-#include <kernel/kern.h>
-
-//#include <ll/ll.h>
-//#include <kernel/config.h>
-//#include <sys/types.h>
-//#include <kernel/types.h>
-//#include <modules/codes.h>
-
-/* -----------------------------------------------------------------------
- BUDGET_TASK_MODEL: a model for guest tasks
- ----------------------------------------------------------------------- */
-
-#define BUDGET_PCLASS 0x0600
-
-typedef struct {
- TASK_MODEL t;
- int b;
-} BUDGET_TASK_MODEL;
-
-#define budget_task_default_model(m,buf) \
- task_default_model((m).t, BUDGET_PCLASS), \
- (m).b = (buf);
-
-
-
-/* some constants for registering the Module in the right place */
-#define CBSSTAR_LEVELNAME "CBSSTAR"
-#define CBSSTAR_LEVEL_CODE 106
-#define CBSSTAR_LEVEL_VERSION 1
-
-
-
-
-/* Registration function:
- int N Maximum number of budgets allocated for the applications
- LEVEL master the level that must be used as master level for the
- CBS tasks
-*/
-LEVEL CBSSTAR_register_level(int n, LEVEL master);
-
-/* Allocates a budget to be used for an application.
- Input parameters:
- Q The budget
- T The period of the budget
- Return value:
- 0..N The ID of the budget
- -1 no more free budgets
- -2 The budgets allocated locally to this module have bandwidth > 1
- -3 wrong LEVEL id
-*/
-int CBSSTAR_setbudget(LEVEL l, TIME Q, TIME T);
-
-#endif
Index: rel_1_21/first/test7.c
===================================================================
--- rel_1_21/first/test7.c (revision 1217)
+++ rel_1_21/first/test7.c (nonexistent)
@@ -1,338 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: test7.c,v 1.2 2003-08-01 13:20:38 trimarchi Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-08-01 13:20:38 $
- ------------
-
- this test shows a set of 5 tasks (+main+dummy+keyboard driver).
-
- The first 4 tasks are scheduled by a EDFSTAR Module, whereas the
- fifth one is a standard traditional EDF task. The 4 tasks uses a
- budget of 10000/100000.
-
- if edfstar.c is compiled with edfstar_printf3 active, a couple
- (dline, curtime) is showed (in ms).
-
- if cbsstar.c is compiled with cbsstar_printf3 active, the budget
- replenishments are showed.
-*/
-
-/*
- * Copyright (C) 2002 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "cbsstar.h"
-#include "posixstar.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "modules/pi.h"
-#include "modules/nop.h"
-
-// --------------------------------------------------
-// --------------------------------------------------
-// Init Part
-// --------------------------------------------------
-// --------------------------------------------------
-
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
- int cbsstar_level, posixstar_level, mybudget, mybudget1, posixstar_level1;
-
- EDF_register_level(EDF_ENABLE_ALL);
-
- cbsstar_level = CBSSTAR_register_level(3, 0);
- mybudget = CBSSTAR_setbudget(cbsstar_level, 15000, 30000);
- mybudget1 = CBSSTAR_setbudget(cbsstar_level, 14000, 56000);
- posixstar_level = POSIXSTAR_register_level(mybudget, cbsstar_level, 3000,1);
- posixstar_level1 = POSIXSTAR_register_level(mybudget1, cbsstar_level, 5000,1);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- // for the keyboard...
- //CBS_register_level(CBS_ENABLE_ALL, 0);
-
- //SEM_register_module();
- PI_register_module();
- NOP_register_module();
- return TICK;
-}
-
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
- //CABS_register_module();
- //keyb_def_map(kparms,itaMap);
- //KEYB_init(&kparms);
- __call_main__(mb);
-
- return (void *)0;
-}
-
-// --------------------------------------------------
-// --------------------------------------------------
-// The Test
-// --------------------------------------------------
-// --------------------------------------------------
-
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-#include <semaphore.h>
-
-mutex_t s;
-
-void *star(void *arg)
-{
- int j;
- for (;;) {
- for (j=0; j<5000; j++);
- //sem_wait(&s);
- mutex_lock(&s);
- cputc('°');
- cputs((char *)arg);
- mutex_unlock(&s);
- //kern_printf("ril");
- //sem_post(&s);
- //task_endcycle();
- }
-
- return NULL;
-}
-
-void *edftask(void *arg)
-{
- int i,j;
- while(1) {
- for (i=0;i<5; i++) {
- for (j=0; j<10; j++);
- //sem_wait(&s);
- //mutex_lock(&s);
- cputc('°');
- cputs((char *)arg);
- //mutex_unlock(&s);
- //sem_post(&s);
- }
-
- task_endcycle();
- }
-
- return NULL;
-}
-
-
-void create1()
-{
- int i;
- NRT_TASK_MODEL m1;
- HARD_TASK_MODEL m2;
- PID p1a, p1b, p1c[20],p2,p3;
- struct timespec fineprg;
- nrt_task_default_model(m1);
- nrt_task_def_group(m1, 1);
- nrt_task_def_level(m1,2);
- nrt_task_def_arg(m1,(void *)"A");
- nrt_task_def_weight(m1,0);
- p1a = task_create("a",star,&m1,NULL);
- if (p1a == -1) {
- perror("Could not create task <Write>");
- sys_abort(-1);
- }
-
- nrt_task_def_arg(m1,(void *)"B");
- nrt_task_def_group(m1, 1);
- nrt_task_def_level(m1,2);
- p1b = task_create("b", star, &m1, NULL);
- if (p1b == -1) {
- perror("Could not create task b ...");
- sys_end();
- }
-
- nrt_task_def_arg(m1,(void *)"1");
- nrt_task_def_group(m1, 1);
- nrt_task_def_level(m1,2);
-
- p1c[5] = task_create("1", star, &m1, NULL);
- if (p1c[5] == -1) {
- perror("Could not create task b ...");
- sys_end();
- }
-
-
- nrt_task_def_arg(m1,(void *)"C");
- nrt_task_def_group(m1, 1);
- nrt_task_def_level(m1,2);
-
- p1c[4] = task_create("c", star, &m1, NULL);
- if (p1c[4] == -1) {
- perror("Could not create task b ...");
- sys_end();
- }
-
- nrt_task_def_arg(m1,(void *)"D");
- nrt_task_def_group(m1, 1);
- nrt_task_def_level(m1,2);
-
- p1c[5] = task_create("d", star, &m1, NULL);
- if (p1c[5] == -1) {
- perror("Could not create task b ...");
- sys_end();
- }
-
- nrt_task_def_arg(m1,(void *)"E");
- nrt_task_def_group(m1, 1);
- nrt_task_def_level(m1,2);
-
- p1c[0] = task_create("e", star, &m1, NULL);
- if (p1c[0] == -1) {
- perror("Could not create task b ...");
- sys_end();
- }
-
- nrt_task_def_arg(m1,(void *)"F");
- p1c[1] = task_create("f", star, &m1, NULL);
- if (p1c[1] == -1) {
- perror("Could not create task b ...");
- sys_end();
- }
-
-
- nrt_task_def_arg(m1,(void *)"G");
- nrt_task_def_group(m1, 1);
- nrt_task_def_level(m1,2);
-
- p1c[2] = task_create("g", star, &m1, NULL);
- if (p1c[2] == -1) {
- perror("Could not create task b ...");
- sys_end();
- }
-
- nrt_task_def_arg(m1,(void *)"H");
- p1c[3] = task_create("h", star, &m1, NULL);
- if (p1c[3] == -1) {
- perror("Could not create task b ...");
- sys_end();
- }
-
- nrt_task_def_arg(m1,(void *)"I");
- p1c[4] = task_create("h", star, &m1, NULL);
- if (p1c[4] == -1) {
- perror("Could not create task b ...");
- sys_end();
- }
-
-
-
- hard_task_default_model(m2);
- hard_task_def_ctrl_jet(m2);
- hard_task_def_mit(m2,32000); // the budget has dline 100,000!
- hard_task_def_wcet(m2, 3000);
- hard_task_def_arg(m2,(void *)"X");
- hard_task_def_group(m2,1);
- hard_task_def_periodic(m2);
-
- p2 = task_create("2", edftask, &m2, NULL);
- if (p2 == -1) {
- perror("Could not create task edf ...");
- sys_end();
- }
-
- hard_task_def_mit(m2,32000); // the budget has dline 100,000!
- hard_task_def_wcet(m2, 3000);
- hard_task_def_arg(m2,(void *)"K");
- p3 = task_create("3", edftask, &m2, NULL);
- if (p3 == -1) {
- perror("Could not create task edf ...");
- sys_end();
- }
-
- cprintf("stars=%d", p2);
- fineprg.tv_sec=140;
- fineprg.tv_nsec=0;
- kern_event_post(&fineprg,(void(*)(void *))sys_end, NULL);
- group_activate(1);
-}
-
-int main(int argc, char **argv)
-{
- char c='t';
- PI_mutexattr_t a;
- PI_mutexattr_default(a);
-
- //NOP_mutexattr_t a;
- //NOP_mutexattr_default(a);
-
-
- mutex_init(&s,&a);
-
- clear();
-
-
- cprintf("Hello, world!\nPress ESC to end the demo...\n");
-
- create1();
-
- do {
- //c =keyb_getch(BLOCK);
- // cprintf("[]");
- } while (c != ESC);
-
- cprintf("ESC pressed!");
-
- sys_end();
-
- return 0;
-}
-
Index: rel_1_21/first/rmstar.c
===================================================================
--- rel_1_21/first/rmstar.c (revision 1217)
+++ rel_1_21/first/rmstar.c (nonexistent)
@@ -1,642 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: rmstar.c,v 1.4 2003-01-07 17:10:17 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.4 $
- Last update: $Date: 2003-01-07 17:10:17 $
- ------------
-**/
-
-/*
- * Copyright (C) 2001 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "rmstar.h"
-#include <ll/stdio.h>
-#include <ll/string.h>
-#include <kernel/model.h>
-#include <kernel/descr.h>
-#include <kernel/var.h>
-#include <kernel/func.h>
-#include <kernel/trace.h>
-
-/* for iqueues */
-/* #include "iqueue.h" Now iqueues are the only queue type into the kernel */
-
-/* for BUDGET_TASK_MODEL */
-#include "cbsstar.h"
-
-/*
- * DEBUG stuffs begin
- */
-
-//#define RMSTAR_DEBUG
-
-#ifdef RMSTAR_DEBUG
-
-static __inline__ fake_printf(char *fmt, ...) {}
-
-#define rmstar_printf fake_printf
-#define rmstar_printf2 fake_printf
-#define rmstar_printf3 fake_printf
-
-//#define rmstar_printf kern_printf
-//#define rmstar_printf2 kern_printf
-//#define rmstar_printf3 kern_printf
-#endif
-
-/*
- * DEBUG stuffs end
- */
-
-/* Status used in the level */
-#define RMSTAR_READY MODULE_STATUS_BASE /* - Ready status */
-#define RMSTAR_IDLE MODULE_STATUS_BASE+4 /* to wait the deadline */
-
-/* flags */
-#define RMSTAR_FLAG_NORAISEEXC 2
-
-/* the level redefinition for the Earliest Deadline First level */
-typedef struct {
- level_des l; /* the standard level descriptor */
-
- TIME period[MAX_PROC]; /* The task periods; the deadlines are
- stored in the priority field */
- int deadline_timer[MAX_PROC];
- /* The task deadline timers */
-
- struct timespec deadline_timespec[MAX_PROC];
-
- int dline_miss[MAX_PROC]; /* Deadline miss counter */
- int wcet_miss[MAX_PROC]; /* Wcet miss counter */
-
- int nact[MAX_PROC]; /* Wcet miss counter */
-
- int flag[MAX_PROC];
- /* used to manage the JOB_TASK_MODEL and the
- periodicity */
-
- IQUEUE ready; /* the ready queue */
-
- PID activated; /* the task that has been inserted into the
- master module */
-
- int budget;
-
- int scheduling_level;
-} RMSTAR_level_des;
-
-static void RMSTAR_check_preemption(RMSTAR_level_des *lev)
-{
- PID first;
-
-#ifdef RMSTAR_DEBUG
- rmstar_printf("(E:chk)");
-#endif
-
- if ((first = iq_query_first(&lev->ready)) != lev->activated) {
- if (lev->activated != NIL)
- level_table[ lev->scheduling_level ]->
- private_extract(lev->scheduling_level, lev->activated);
-
- lev->activated = first;
-
- if (first != NIL) {
- BUDGET_TASK_MODEL b;
- budget_task_default_model(b, lev->budget);
-
- level_table[ lev->scheduling_level ]->
- private_insert(lev->scheduling_level, first, (TASK_MODEL *)&b);
- }
- }
-}
-
-static void RMSTAR_timer_deadline(void *par);
-
-static void RMSTAR_internal_activate(RMSTAR_level_des *lev, PID p,
- struct timespec *t)
-{
-#ifdef RMSTAR_DEBUG
- rmstar_printf("(E:iact)");
-#endif
-
- ADDUSEC2TIMESPEC(lev->period[p], t);
-
- *iq_query_timespec(p, &lev->ready) = *t;
- lev->deadline_timespec[p] = *t;
-
- /* Insert task in the correct position */
- proc_table[p].status = RMSTAR_READY;
- iq_priority_insert(p,&lev->ready);
-
- /* needed because when there is a wcet miss I disable CONTROL_CAP */
- proc_table[p].control |= CONTROL_CAP;
-
- /* check for preemption */
- RMSTAR_check_preemption(lev);
-}
-
-static void RMSTAR_timer_deadline(void *par)
-{
- PID p = (PID) par;
- RMSTAR_level_des *lev;
-
-#ifdef RMSTAR_DEBUG
-// rmstar_printf("(E:tdl ");
-#endif
-
- lev = (RMSTAR_level_des *)level_table[proc_table[p].task_level];
-
- switch (proc_table[p].status) {
- case RMSTAR_IDLE:
-#ifdef RMSTAR_DEBUG
-// rmstar_printf2("I%d",p);
-#endif
- /* set the request time */
- RMSTAR_internal_activate(lev,p,iq_query_timespec(p, &lev->ready));
-
- event_need_reschedule();
- break;
-
- default:
-#ifdef RMSTAR_DEBUG
-// rmstar_printf2("D%d",p);
-#endif
- /* else, a deadline miss occurred!!! */
- lev->dline_miss[p]++;
-
- /* the task is into another state */
- lev->nact[p]++;
-
- /* Set the deadline timer */
- ADDUSEC2TIMESPEC(lev->period[p], &lev->deadline_timespec[p]);
- }
-
- /* Set the deadline timer */
- lev->deadline_timer[p] = kern_event_post(&lev->deadline_timespec[p],
- RMSTAR_timer_deadline,
- (void *)p);
-
-#ifdef RMSTAR_DEBUG
-// rmstar_printf(")");
-#endif
-}
-
-static void RMSTAR_timer_guest_deadline(void *par)
-{
- PID p = (PID) par;
-
-#ifdef RMSTAR_DEBUG
- rmstar_printf("(E:gdl)");
-#endif
-
- kern_raise(XDEADLINE_MISS,p);
-}
-
-static int RMSTAR_public_create(LEVEL l, PID p, TASK_MODEL *m)
-{
- RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
-
- /* if the RMSTAR_task_create is called, then the pclass must be a
- valid pclass. */
- HARD_TASK_MODEL *h;
-
- if (m->pclass != HARD_PCLASS) return -1;
- if (m->level != 0 && m->level != l) return -1;
- h = (HARD_TASK_MODEL *)m;
- if (!h->wcet || !h->mit || h->periodicity != PERIODIC) return -1;
- /* now we know that m is a valid model */
-
-#ifdef RMSTAR_DEBUG
- rmstar_printf("(E:tcr)");
-#endif
-
- lev->period[p] = h->mit;
- *iq_query_priority(p, &lev->ready) = h->mit;
-
- lev->flag[p] = 0;
- lev->deadline_timer[p] = -1;
- lev->dline_miss[p] = 0;
- lev->wcet_miss[p] = 0;
- lev->nact[p] = 0;
-
- /* Enable wcet check */
- proc_table[p].avail_time = h->wcet;
- proc_table[p].wcet = h->wcet;
- proc_table[p].control |= CONTROL_CAP;
-
- return 0; /* OK, also if the task cannot be guaranteed... */
-}
-
-static void RMSTAR_public_dispatch(LEVEL l, PID p, int nostop)
-{
- RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
-
-#ifdef RMSTAR_DEBUG
- rmstar_printf("(E:dis)");
-
- rmstar_printf3("(%d %d)",
- iq_query_timespec(p, &lev->ready)->tv_nsec/1000000,
- schedule_time.tv_nsec/1000000);
-#endif
-
- level_table[ lev->scheduling_level ]->
- private_dispatch(lev->scheduling_level,p,nostop);
-}
-
-static void RMSTAR_public_epilogue(LEVEL l, PID p)
-{
- RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
-
-#ifdef RMSTAR_DEBUG
- rmstar_printf("(E:epi ");
-#endif
-
- /* check if the wcet is finished... */
- if (proc_table[p].avail_time <= 0 && proc_table[p].control&CONTROL_CAP) {
- /* wcet finished: disable wcet event and count wcet miss */
-#ifdef RMSTAR_DEBUG
- rmstar_printf2("W%d",p);
-#endif
- proc_table[p].control &= ~CONTROL_CAP;
- lev->wcet_miss[p]++;
- }
-#ifdef RMSTAR_DEBUG
- rmstar_printf(")");
-#endif
-
- level_table[ lev->scheduling_level ]->
- private_epilogue(lev->scheduling_level,p);
-
- proc_table[p].status = RMSTAR_READY;
-}
-
-static void RMSTAR_public_activate(LEVEL l, PID p)
-{
- RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
- struct timespec t;
-
-#ifdef RMSTAR_DEBUG
- rmstar_printf("(E:act)");
-#endif
-
- /* Test if we are trying to activate a non sleeping task */
- /* save activation (only if needed... */
- if (proc_table[p].status != SLEEP) {
- /* a periodic task cannot be activated when it is already active */
- kern_raise(XACTIVATION,p);
- return;
- }
-
- kern_gettime(&t);
-
- RMSTAR_internal_activate(lev,p, &t);
-
- /* Set the deadline timer */
- lev->deadline_timer[p] = kern_event_post(&lev->deadline_timespec[p],
- RMSTAR_timer_deadline,
- (void *)p);
-
-}
-
-static void RMSTAR_public_unblock(LEVEL l, PID p)
-{
- RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
-
-#ifdef RMSTAR_DEBUG
- rmstar_printf("(E:ins)");
-#endif
-
- /* Insert task in the correct position */
- proc_table[p].status = RMSTAR_READY;
- iq_priority_insert(p,&lev->ready);
-
- /* and check for preemption! */
- RMSTAR_check_preemption(lev);
-}
-
-static void RMSTAR_public_block(LEVEL l, PID p)
-{
- RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
-
-#ifdef RMSTAR_DEBUG
- rmstar_printf("(E:ext)");
-#endif
-
- /* the task is blocked on a synchronization primitive. we have to
- remove it from the master module -and- from the local queue! */
- iq_extract(p,&lev->ready);
-
- /* and finally, a preemption check! (it will also call guest_end) */
- RMSTAR_check_preemption(lev);
-}
-
-static int RMSTAR_public_message(LEVEL l, PID p, void *m)
-{
- RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
- struct timespec temp;
-
-#ifdef RMSTAR_DEBUG
- rmstar_printf("(E:ecy ");
-#endif
-
- /* we call guest_end directly here because the same task may
- be reinserted in the queue before calling the preemption check! */
- level_table[ lev->scheduling_level ]->
- private_extract(lev->scheduling_level,p); lev->activated = NIL;
-
- iq_extract(p,&lev->ready);
-
- /* we reset the capacity counters... */
- proc_table[p].avail_time = proc_table[p].wcet;
-
- if (lev->nact[p] > 0) {
-#ifdef RMSTAR_DEBUG
- rmstar_printf2("E%d",p);
-#endif
-
- /* Pending activation: reactivate the thread!!! */
- lev->nact[p]--;
-
- /* see also RMSTAR_timer_deadline */
- kern_gettime(&temp);
-
- RMSTAR_internal_activate(lev,p,&temp);
-
- /* check if the deadline has already expired */
- temp = *iq_query_timespec(p, &lev->ready);
- if (TIMESPEC_A_LT_B(&temp, &schedule_time)) {
- /* count the deadline miss */
- lev->dline_miss[p]++;
- kern_event_delete(lev->deadline_timer[p]);
- }
-
- }
- else {
-#ifdef RMSTAR_DEBUG
- rmstar_printf("e%d",p);
-#endif
-
- /* the task has terminated his job before it consume the wcet. All OK! */
- proc_table[p].status = RMSTAR_IDLE;
-
- /* and finally, a preemption check! */
- RMSTAR_check_preemption(lev);
-
- /* when the deadline timer fire, it recognize the situation and set
- correctly all the stuffs (like reactivation, etc... ) */
- }
-#ifdef RMSTAR_DEBUG
- rmstar_printf(")");
-#endif
-
- jet_update_endcycle(); /* Update the Jet data... */
- trc_logevent(TRC_ENDCYCLE,&exec_shadow); /* tracer stuff */
-
- return 0;
-}
-
-static void RMSTAR_public_end(LEVEL l, PID p)
-{
- RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
-
-#ifdef RMSTAR_DEBUG
- rmstar_printf("(E:end)");
-#endif
-
- iq_extract(p,&lev->ready);
-
- /* we finally put the task in the ready queue */
- proc_table[p].status = FREE;
-
- iq_insertfirst(p,&freedesc);
-
- if (lev->deadline_timer[p] != -1) {
- kern_event_delete(lev->deadline_timer[p]);
- }
-
- /* and finally, a preemption check! (it will also call guest_end) */
- RMSTAR_check_preemption(lev);
-}
-
-
-/* Guest Functions
- These functions manages a JOB_TASK_MODEL, that is used to put
- a guest task in the RMSTAR ready queue. */
-
-static void RMSTAR_private_insert(LEVEL l, PID p, TASK_MODEL *m)
-{
- RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
- JOB_TASK_MODEL *job;
-
- if (m->pclass != JOB_PCLASS || (m->level != 0 && m->level != l) ) {
- kern_raise(XINVALID_TASK, p);
- return;
- }
-
- job = (JOB_TASK_MODEL *)m;
-
- *iq_query_timespec(p, &lev->ready) = job->deadline;
-
- lev->deadline_timer[p] = -1;
- lev->dline_miss[p] = 0;
- lev->wcet_miss[p] = 0;
- lev->nact[p] = 0;
-
- if (job->noraiseexc)
- lev->flag[p] = RMSTAR_FLAG_NORAISEEXC;
- else {
- lev->flag[p] = 0;
- lev->deadline_timer[p] = kern_event_post(iq_query_timespec(p, &lev->ready),
- RMSTAR_timer_guest_deadline,
- (void *)p);
- }
-
- lev->period[p] = job->period;
- *iq_query_priority(p, &lev->ready) = job->period;
-
- /* there is no bandwidth guarantee at this level, it is performed
- by the level that inserts guest tasks... */
-
- /* Insert task in the correct position */
- iq_priority_insert(p,&lev->ready);
- proc_table[p].status = RMSTAR_READY;
-
- /* check for preemption */
- RMSTAR_check_preemption(lev);
-}
-
-static void RMSTAR_private_dispatch(LEVEL l, PID p, int nostop)
-{
- RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
-
- level_table[ lev->scheduling_level ]->
- private_dispatch(lev->scheduling_level,p,nostop);
-}
-
-static void RMSTAR_private_epilogue(LEVEL l, PID p)
-{
- RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
-
- /* the task has been preempted. it returns into the ready queue... */
- level_table[ lev->scheduling_level ]->
- private_epilogue(lev->scheduling_level,p);
-
- proc_table[p].status = RMSTAR_READY;
-}
-
-static void RMSTAR_private_extract(LEVEL l, PID p)
-{
- RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
-
-#ifdef RMSTAR_DEBUG
- //kern_printf("RMSTAR_guest_end: dline timer %d\n",lev->deadline_timer[p]);
-#endif
-
- iq_extract(p, &lev->ready);
-
- /* we remove the deadline timer, because the slice is finished */
- if (lev->deadline_timer[p] != NIL) {
-#ifdef RMSTAR_DEBUG
-// kern_printf("RMSTAR_guest_end: dline timer %d\n",lev->deadline_timer[p]);
-#endif
- kern_event_delete(lev->deadline_timer[p]);
- lev->deadline_timer[p] = NIL;
- }
-
- /* and finally, a preemption check! (it will also call guest_end() */
- RMSTAR_check_preemption(lev);
-}
-
-/* Registration functions */
-
-/* Registration function:
- int flags the init flags ... see RMSTAR.h */
-LEVEL RMSTAR_register_level(int budget, int master)
-{
- LEVEL l; /* the level that we register */
- RMSTAR_level_des *lev; /* for readableness only */
- PID i; /* a counter */
-
-#ifdef RMSTAR_DEBUG
- printk("RMSTAR_register_level\n");
-#endif
-
- /* request an entry in the level_table */
- l = level_alloc_descriptor(sizeof(RMSTAR_level_des));
-
- lev = (RMSTAR_level_des *)level_table[l];
-
- printk(" lev=%d\n",(int)lev);
-
- /* fill the standard descriptor */
- lev->l.private_insert = RMSTAR_private_insert;
- lev->l.private_extract = RMSTAR_private_extract;
- lev->l.private_dispatch = RMSTAR_private_dispatch;
- lev->l.private_epilogue = RMSTAR_private_epilogue;
-
- lev->l.public_guarantee = NULL;
- lev->l.public_create = RMSTAR_public_create;
- lev->l.public_end = RMSTAR_public_end;
- lev->l.public_dispatch = RMSTAR_public_dispatch;
- lev->l.public_epilogue = RMSTAR_public_epilogue;
- lev->l.public_activate = RMSTAR_public_activate;
- lev->l.public_unblock = RMSTAR_public_unblock;
- lev->l.public_block = RMSTAR_public_block;
- lev->l.public_message = RMSTAR_public_message;
-
- /* fill the RMSTAR descriptor part */
- for(i=0; i<MAX_PROC; i++) {
- lev->period[i] = 0;
- lev->deadline_timer[i] = -1;
- lev->flag[i] = 0;
- lev->dline_miss[i] = 0;
- lev->wcet_miss[i] = 0;
- lev->nact[i] = 0;
- }
-
- iq_init(&lev->ready, NULL, 0);
- lev->activated = NIL;
-
- lev->budget = budget;
- lev->scheduling_level = master;
-
- return l;
-}
-
-int RMSTAR_get_dline_miss(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
-
- return lev->dline_miss[p];
-}
-
-int RMSTAR_get_wcet_miss(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
-
- return lev->wcet_miss[p];
-}
-
-int RMSTAR_get_nact(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
-
- return lev->nact[p];
-}
-
-int RMSTAR_reset_dline_miss(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
-
- lev->dline_miss[p] = 0;
- return 0;
-}
-
-int RMSTAR_reset_wcet_miss(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- RMSTAR_level_des *lev = (RMSTAR_level_des *)(level_table[l]);
-
- lev->wcet_miss[p] = 0;
- return 0;
-}
-
Index: rel_1_21/first/testiq.c
===================================================================
--- rel_1_21/first/testiq.c (revision 1217)
+++ rel_1_21/first/testiq.c (nonexistent)
@@ -1,260 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: testiq.c,v 1.3 2003-01-07 17:10:17 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.3 $
- Last update: $Date: 2003-01-07 17:10:17 $
- ------------
-
- The purpose of this test is to show that two budgets with different
- period and budgets schedules correctly.
-
- 2 never ending tasks are involved
-
- This test cannot compile because of the fact that QUEUE and QQUEUE
- types does not exist anymore!
-*/
-
-/*
- * Copyright (C) 2002 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "cbsstar.h"
-#include "edfstar.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-
-// --------------------------------------------------
-// --------------------------------------------------
-// Init Part
-// --------------------------------------------------
-// --------------------------------------------------
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- clear();
-
- EDF_register_level(EDF_ENABLE_ALL);
-
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- // for the keyboard...
- CBS_register_level(CBS_ENABLE_ALL, 0);
-
- SEM_register_module();
-
- CABS_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- //keyb_def_ctrlC(kparms, NULL);
- //keyb_def_map(kparms,itaMap);
- KEYB_init(&kparms);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
-// --------------------------------------------------
-// --------------------------------------------------
-// The Test
-// --------------------------------------------------
-// --------------------------------------------------
-
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-#include "iqueue.h"
-
-sem_t s;
-
-PID p2,p3,p4;
-
-void *star(void *arg)
-{
- int j;
- TIME last[5];
-
- QUEUE i = NIL;
- IQUEUE ii;
-
- q_timespec_insert(p2,&i);
- q_timespec_insert(p3,&i);
-
- iq_init(&ii,NULL,0);
- *iq_query_timespec(p2,&ii) = proc_table[p2].timespec_priority;
- *iq_query_timespec(p3,&ii) = proc_table[p3].timespec_priority;
- *iq_query_timespec(p4,&ii) = proc_table[p4].timespec_priority;
- iq_timespec_insert(p2,&ii);
- iq_timespec_insert(p3,&ii);
-
- cprintf("p2=%ld.%ld\n",proc_table[p2].timespec_priority.tv_sec,proc_table[p2].timespec_priority.tv_nsec/1000);
- cprintf("p3=%ld.%ld\n",proc_table[p3].timespec_priority.tv_sec,proc_table[p3].timespec_priority.tv_nsec/1000);
- cprintf("p4=%ld.%ld\n",proc_table[p4].timespec_priority.tv_sec,proc_table[p4].timespec_priority.tv_nsec/1000);
-
- task_endcycle();
-
- for (j=0; j<200000; j++) {
- q_timespec_insert(p4,&i);
- q_extract(p4,&i);
- }
-
-
- task_endcycle();
-
- for (j=0; j<200000; j++) {
- iq_timespec_insert(p4,&ii);
- iq_extract(p4,&ii);
- }
-
- task_endcycle();
-
- jet_gettable(exec_shadow, &last[0], 3);
-
- cprintf("\ninit=%d queue=%d iqueue=%d\n",
- (int)last[0], (int)last[1], (int)last[2]);
-
- sys_end();
- return NULL;
-}
-
-void *fake(void *arg)
-{
- cputs("#");
- task_endcycle();
-
- return NULL;
-}
-
-
-void create1()
-{
- HARD_TASK_MODEL m1;
- PID p1a;
-
- hard_task_default_model(m1);
- hard_task_def_wcet(m1, 500000);
- hard_task_def_group(m1,1);
- hard_task_def_periodic(m1);
- hard_task_def_mit(m1,1000000);
- hard_task_def_ctrl_jet(m1);
- p1a = task_create("a", star, &m1, NULL);
- if (p1a == -1) {
- perror("Could not create task a ...");
- sys_end();
- }
-
- hard_task_default_model(m1);
- hard_task_def_wcet(m1, 5000);
- hard_task_def_aperiodic(m1);
- hard_task_def_group(m1,1);
-
- hard_task_def_mit(m1,100000);
- p2 = task_create("a", fake, &m1, NULL);
- if (p1a == -1) {
- perror("Could not create task a ...");
- sys_end();
- }
-
- hard_task_def_mit(m1,100001);
- p3 = task_create("a", fake, &m1, NULL);
- if (p1a == -1) {
- perror("Could not create task a ...");
- sys_end();
- }
-
- hard_task_def_mit(m1,100002);
- p4 = task_create("a", fake, &m1, NULL);
- if (p1a == -1) {
- perror("Could not create task a ...");
- sys_end();
- }
-
- group_activate(1);
-}
-
-void endfun(KEY_EVT *k)
-{
- cprintf("ESC pressed!");
-
- sys_end();
-}
-
-int main(int argc, char **argv)
-{
- KEY_EVT k;
-
- sem_init(&s,0,1);
-
- k.flag = 0;
- k.scan = KEY_ESC;
- k.ascii = 27;
- keyb_hook(k,endfun);
-
- create1();
-
- return 0;
-}
-
Index: rel_1_21/first/rmstar.h
===================================================================
--- rel_1_21/first/rmstar.h (revision 1217)
+++ rel_1_21/first/rmstar.h (nonexistent)
@@ -1,128 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * Massimiliano Giorgi <massy@gandalf.sssup.it>
- * Luca Abeni <luca@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: rmstar.h,v 1.2 2003-01-07 17:10:17 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-01-07 17:10:17 $
- ------------
-
- Title:
- RMSTAR
-
- Task Models Accepted:
- HARD_TASK_MODEL - Hard Tasks (only Periodic)
- wcet field and mit field must be != 0. They are used to set the wcet
- and period of the tasks.
- periodicity field can be only PERIODIC
- drel field is ignored
-
- Guest Models Accepted:
- JOB_TASK_MODEL - a single guest task activation
- Identified by an absolute deadline and a period.
- period field is ignored
-
- Description:
-
- This module schedule his tasks following the classic RM
- scheme.
-
- Note: This module is derived from the EDFSTAR Scheduling Module. I
- have just changed RM in EDF and iq_timespec_insert with
- iq_priority_insert...
-
- Exceptions raised:
- XUNVALID_GUEST XUNVALID_TASK
- some primitives are not implemented:
- task_sleep, task_delay, guest_endcycle, guest_sleep, guest_delay
-
- XACTIVATION
- If a task is actiated through task_activate or guest_activate more than
- one time
-
- Restrictions & special features:
- see edfstar.h
-
-**/
-
-/*
- * Copyright (C) 2001 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#ifndef __RMSTAR_H__
-#define __RMSTAR_H__
-
-#include <ll/ll.h>
-#include <kernel/config.h>
-#include <sys/types.h>
-#include <kernel/types.h>
-
-
-
-/* flags... */
-#define RMSTAR_ENABLE_GUARANTEE 1 /* Task Guarantee enabled */
-#define RMSTAR_ENABLE_ALL 1
-
-#define RMSTAR_FAILED_GUARANTEE 8 /* used in the module, unsettabl
- in RM_register_level... */
-
-
-
-#define RMSTAR_LEVELNAME "RMSTAR base"
-#define RMSTAR_LEVEL_CODE 166
-#define RMSTAR_LEVEL_VERSION 1
-
-
-/* Registration function:
- int budget The budget used by this module (see CBSSTAR.h)
- int master The master module used by RMSTAR
-*/
-LEVEL RMSTAR_register_level(int budget, int master);
-
-/* returns respectively the number of dline, wcet or nact; -1 if error */
-int RMSTAR_get_dline_miss(PID p);
-int RMSTAR_get_wcet_miss(PID p);
-int RMSTAR_get_nact(PID p);
-
-/* resets respectively the number of dline, wcet miss; -1 if error */
-int RMSTAR_reset_dline_miss(PID p);
-int RMSTAR_reset_wcet_miss(PID p);
-
-#endif
-
Index: rel_1_21/first/edfstar.c
===================================================================
--- rel_1_21/first/edfstar.c (revision 1217)
+++ rel_1_21/first/edfstar.c (nonexistent)
@@ -1,659 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: edfstar.c,v 1.5 2003-06-18 08:13:02 trimarchi Exp $
-
- File: $File$
- Revision: $Revision: 1.5 $
- Last update: $Date: 2003-06-18 08:13:02 $
- ------------
-**/
-
-/*
- * Copyright (C) 2001 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "edfstar.h"
-#include <ll/stdio.h>
-#include <ll/string.h>
-#include <kernel/model.h>
-#include <kernel/descr.h>
-#include <kernel/var.h>
-#include <kernel/func.h>
-#include <kernel/trace.h>
-
-/* for iqueues */
-/* #include "iqueue.h" Now iqueues are the only queue type available
- into the kernel */
-#include <kernel/iqueue.h>
-
-/* for BUDGET_TASK_MODEL */
-#include "cbsstar.h"
-
-/*
- * DEBUG stuffs begin
- */
-
-//#define EDFSTAR_DEBUG
-
-#ifdef EDFSTAR_DEBUF
-
-static __inline__ fake_printf(char *fmt, ...) {}
-
-#define edfstar_printf fake_printf
-#define edfstar_printf2 fake_printf
-#define edfstar_printf3 fake_printf
-
-//#define edfstar_printf kern_printf
-//#define edfstar_printf2 kern_printf
-//#define edfstar_printf3 kern_printf
-#endif
-
-/*
- * DEBUG stuffs end
- */
-
-/* Status used in the level */
-#define EDFSTAR_READY MODULE_STATUS_BASE /* - Ready status */
-#define EDFSTAR_IDLE MODULE_STATUS_BASE+4 /* to wait the deadline */
-
-/* flags */
-#define EDFSTAR_FLAG_NORAISEEXC 2
-
-/* the level redefinition for the Earliest Deadline First level */
-typedef struct {
- level_des l; /* the standard level descriptor */
-
- TIME period[MAX_PROC]; /* The task periods; the deadlines are
- stored in the priority field */
- int deadline_timer[MAX_PROC];
- /* The task deadline timers */
-
- struct timespec deadline_timespec[MAX_PROC];
-
- int dline_miss[MAX_PROC]; /* Deadline miss counter */
- int wcet_miss[MAX_PROC]; /* Wcet miss counter */
-
- int nact[MAX_PROC]; /* Wcet miss counter */
-
- int flag[MAX_PROC];
- /* used to manage the JOB_TASK_MODEL and the
- periodicity */
-
- IQUEUE ready; /* the ready queue */
-
- PID activated; /* the task that has been inserted into the
- master module */
-
- int budget;
-
- int scheduling_level;
-} EDFSTAR_level_des;
-
-static void EDFSTAR_check_preemption(EDFSTAR_level_des *lev)
-{
- PID first;
-
-#ifdef EDFSTAR_DEBUG
- edfstar_printf("(E:chk)");
-#endif
-
- if ((first = iq_query_first(&lev->ready)) != lev->activated) {
- if (lev->activated != NIL)
- level_table[ lev->scheduling_level ]->
- private_extract(lev->scheduling_level, lev->activated);
-
- lev->activated = first;
-
- if (first != NIL) {
- BUDGET_TASK_MODEL b;
- budget_task_default_model(b, lev->budget);
-
- level_table[ lev->scheduling_level ]->
- private_insert(lev->scheduling_level, first, (TASK_MODEL *)&b);
- }
- }
-}
-
-static void EDFSTAR_timer_deadline(void *par);
-
-static void EDFSTAR_internal_activate(EDFSTAR_level_des *lev, PID p,
- struct timespec *t)
-{
-#ifdef EDFSTAR_DEBUG
- edfstar_printf("(E:iact)");
-#endif
-
- ADDUSEC2TIMESPEC(lev->period[p], t);
-
- *iq_query_timespec(p, &lev->ready) = *t;
- lev->deadline_timespec[p] = *t;
-
- /* Insert task in the correct position */
- proc_table[p].status = EDFSTAR_READY;
- iq_timespec_insert(p,&lev->ready);
-
- /* needed because when there is a wcet miss I disable CONTROL_CAP */
- proc_table[p].control |= CONTROL_CAP;
-
- /* check for preemption */
- EDFSTAR_check_preemption(lev);
-}
-
-static void EDFSTAR_timer_deadline(void *par)
-{
- PID p = (PID) par;
- EDFSTAR_level_des *lev;
-
-#ifdef EDFSTAR_DEBUG
-// edfstar_printf("(E:tdl ");
-#endif
-
- lev = (EDFSTAR_level_des *)level_table[proc_table[p].task_level];
-
- switch (proc_table[p].status) {
- case EDFSTAR_IDLE:
-#ifdef EDFSTAR_DEBUG
-// edfstar_printf2("I%d",p);
-#endif
- /* set the request time */
- EDFSTAR_internal_activate(lev,p,iq_query_timespec(p, &lev->ready));
-
- event_need_reschedule();
- break;
-
- default:
-#ifdef EDFSTAR_DEBUG
-// edfstar_printf2("D%d",p);
-#endif
- /* else, a deadline miss occurred!!! */
- lev->dline_miss[p]++;
-
- /* the task is into another state */
- lev->nact[p]++;
-
- /* Set the deadline timer */
- ADDUSEC2TIMESPEC(lev->period[p], &lev->deadline_timespec[p]);
- }
-
- /* Set the deadline timer */
- lev->deadline_timer[p] = kern_event_post(&lev->deadline_timespec[p],
- EDFSTAR_timer_deadline,
- (void *)p);
-
-#ifdef EDFSTAR_DEBUG
-// edfstar_printf(")");
-#endif
-}
-
-static void EDFSTAR_timer_guest_deadline(void *par)
-{
- PID p = (PID) par;
-
-#ifdef EDFSTAR_DEBUG
- edfstar_printf("(E:gdl)");
-#endif
-
- kern_raise(XDEADLINE_MISS,p);
-}
-
-static int EDFSTAR_public_create(LEVEL l, PID p, TASK_MODEL *m)
-{
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
-
- /* if the EDFSTAR_task_create is called, then the pclass must be a
- valid pclass. */
- HARD_TASK_MODEL *h;
-
- if (m->pclass != HARD_PCLASS) return -1;
- if (m->level != 0 && m->level != l) return -1;
- h = (HARD_TASK_MODEL *)m;
- if (!h->wcet || !h->mit || h->periodicity != PERIODIC) return -1;
- /* now we know that m is a valid model */
-
-
-#ifdef EDFSTAR_DEBUG
- edfstar_printf("(E:tcr)");
-#endif
-
- lev->period[p] = h->mit;
-
- lev->flag[p] = 0;
- lev->deadline_timer[p] = -1;
- lev->dline_miss[p] = 0;
- lev->wcet_miss[p] = 0;
- lev->nact[p] = 0;
-
- /* Enable wcet check */
- proc_table[p].avail_time = h->wcet;
- proc_table[p].wcet = h->wcet;
- proc_table[p].control |= CONTROL_CAP;
-
- return 0; /* OK, also if the task cannot be guaranteed... */
-}
-
-static int EDFSTAR_public_eligible(LEVEL l, PID p)
-{
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
-
-#ifdef EDFSTAR_DEBUG
- edfstar_printf2("(E:eli)");
-#endif
-
- return level_table[ lev->scheduling_level ]->
- private_eligible(lev->scheduling_level,p);
-}
-
-static void EDFSTAR_public_dispatch(LEVEL l, PID p, int nostop)
-{
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
-
-#ifdef EDFSTAR_DEBUG
- edfstar_printf("(E:dis)");
-
- edfstar_printf3("(%d %d)",
- iq_query_timespec(p, &lev->ready)->tv_nsec/1000000,
- schedule_time.tv_nsec/1000000);
-#endif
-
- level_table[ lev->scheduling_level ]->
- private_dispatch(lev->scheduling_level,p,nostop);
-}
-
-static void EDFSTAR_public_epilogue(LEVEL l, PID p)
-{
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
-
-#ifdef EDFSTAR_DEBUG
- edfstar_printf("(E:epi ");
-#endif
-
- /* check if the wcet is finished... */
- if (proc_table[p].avail_time <= 0 && proc_table[p].control&CONTROL_CAP) {
- /* wcet finished: disable wcet event and count wcet miss */
-#ifdef EDFSTAR_DEBUG
- edfstar_printf2("W%d",p);
-#endif
- proc_table[p].control &= ~CONTROL_CAP;
- lev->wcet_miss[p]++;
- }
-#ifdef EDFSTAR_DEBUG
- edfstar_printf(")");
-#endif
-
- level_table[ lev->scheduling_level ]->
- private_epilogue(lev->scheduling_level,p);
-
- proc_table[p].status = EDFSTAR_READY;
-}
-
-static void EDFSTAR_public_activate(LEVEL l, PID p)
-{
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
- struct timespec t;
-
-#ifdef EDFSTAR_DEBUG
- edfstar_printf("(E:act)");
-#endif
-
- /* Test if we are trying to activate a non sleeping task */
- /* save activation (only if needed... */
- if (proc_table[p].status != SLEEP) {
- /* a periodic task cannot be activated when it is already active */
- kern_raise(XACTIVATION,p);
- return;
- }
-
- kern_gettime(&t);
-
- EDFSTAR_internal_activate(lev,p, &t);
-
- /* Set the deadline timer */
- lev->deadline_timer[p] = kern_event_post(&lev->deadline_timespec[p],
- EDFSTAR_timer_deadline,
- (void *)p);
-
-}
-
-static void EDFSTAR_public_unblock(LEVEL l, PID p)
-{
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
-
-#ifdef EDFSTAR_DEBUG
- edfstar_printf("(E:ins)");
-#endif
-
- /* Insert task in the correct position */
- proc_table[p].status = EDFSTAR_READY;
- iq_timespec_insert(p,&lev->ready);
-
- /* and check for preemption! */
- EDFSTAR_check_preemption(lev);
-}
-
-static void EDFSTAR_public_block(LEVEL l, PID p)
-{
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
-
-#ifdef EDFSTAR_DEBUG
- edfstar_printf("(E:ext)");
-#endif
-
- /* the task is blocked on a synchronization primitive. we have to
- remove it from the master module -and- from the local queue! */
- iq_extract(p,&lev->ready);
-
- /* and finally, a preemption check! (it will also call guest_end) */
- EDFSTAR_check_preemption(lev);
-}
-
-static int EDFSTAR_public_message(LEVEL l, PID p, void *m)
-{
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
- struct timespec temp;
-
-#ifdef EDFSTAR_DEBUG
- edfstar_printf("(E:ecy ");
-#endif
-
- /* we call guest_end directly here because the same task may
- be reinserted in the queue before calling the preemption check! */
- level_table[ lev->scheduling_level ]->
- private_extract(lev->scheduling_level,p);
- lev->activated = NIL;
-
- iq_extract(p,&lev->ready);
-
- /* we reset the capacity counters... */
- proc_table[p].avail_time = proc_table[p].wcet;
-
- if (lev->nact[p] > 0) {
-#ifdef EDFSTAR_DEBUG
- edfstar_printf2("E%d",p);
-#endif
-
- /* Pending activation: reactivate the thread!!! */
- lev->nact[p]--;
-
- /* see also EDFSTAR_timer_deadline */
- kern_gettime(&temp);
-
- EDFSTAR_internal_activate(lev,p, &temp);
-
- /* check if the deadline has already expired */
- temp = *iq_query_timespec(p, &lev->ready);
- if (TIMESPEC_A_LT_B(&temp, &schedule_time)) {
- /* count the deadline miss */
- lev->dline_miss[p]++;
- kern_event_delete(lev->deadline_timer[p]);
- }
-
- }
- else {
-#ifdef EDFSTAR_DEBUG
- edfstar_printf("e%d",p);
-#endif
-
- /* the task has terminated his job before it consume the wcet. All OK! */
- proc_table[p].status = EDFSTAR_IDLE;
-
- /* and finally, a preemption check! */
- EDFSTAR_check_preemption(lev);
-
- /* when the deadline timer fire, it recognize the situation and set
- correctly all the stuffs (like reactivation, etc... ) */
- }
-#ifdef EDFSTAR_DEBUG
- edfstar_printf(")");
-#endif
-
- jet_update_endcycle(); /* Update the Jet data... */
- trc_logevent(TRC_ENDCYCLE,&exec_shadow); /* tracer stuff */
-
- return 0;
-}
-
-static void EDFSTAR_public_end(LEVEL l, PID p)
-{
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
-
-#ifdef EDFSTAR_DEBUG
- edfstar_printf("(E:end)");
-#endif
-
- iq_extract(p,&lev->ready);
-
- /* we finally put the task in the ready queue */
- proc_table[p].status = FREE;
-
- iq_insertfirst(p,&freedesc);
-
- if (lev->deadline_timer[p] != -1) {
- kern_event_delete(lev->deadline_timer[p]);
- }
-
- /* and finally, a preemption check! (it will also call guest_end) */
- EDFSTAR_check_preemption(lev);
-}
-
-/* Guest Functions
- These functions manages a JOB_TASK_MODEL, that is used to put
- a guest task in the EDFSTAR ready queue. */
-
-static void EDFSTAR_private_insert(LEVEL l, PID p, TASK_MODEL *m)
-{
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
- JOB_TASK_MODEL *job;
-
- if (m->pclass != JOB_PCLASS || (m->level != 0 && m->level != l) ) {
- kern_raise(XINVALID_TASK, p);
- return;
- }
-
- job = (JOB_TASK_MODEL *)m;
-
- /* if the EDFSTAR_guest_create is called, then the pclass must be a
- valid pclass. */
-
- *iq_query_timespec(p, &lev->ready) = job->deadline;
-
- lev->deadline_timer[p] = -1;
- lev->dline_miss[p] = 0;
- lev->wcet_miss[p] = 0;
- lev->nact[p] = 0;
-
- if (job->noraiseexc)
- lev->flag[p] = EDFSTAR_FLAG_NORAISEEXC;
- else {
- lev->flag[p] = 0;
- lev->deadline_timer[p] = kern_event_post(iq_query_timespec(p, &lev->ready),
- EDFSTAR_timer_guest_deadline,
- (void *)p);
- }
-
- lev->period[p] = job->period;
-
- /* Insert task in the correct position */
- iq_timespec_insert(p,&lev->ready);
- proc_table[p].status = EDFSTAR_READY;
-
- /* check for preemption */
- EDFSTAR_check_preemption(lev);
-
- /* there is no bandwidth guarantee at this level, it is performed
- by the level that inserts guest tasks... */
-}
-
-static void EDFSTAR_private_dispatch(LEVEL l, PID p, int nostop)
-{
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
-
- level_table[ lev->scheduling_level ]->
- private_dispatch(lev->scheduling_level,p,nostop);
-}
-
-static void EDFSTAR_private_epilogue(LEVEL l, PID p)
-{
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
-
- /* the task has been preempted. it returns into the ready queue... */
- level_table[ lev->scheduling_level ]->
- private_epilogue(lev->scheduling_level,p);
-
- proc_table[p].status = EDFSTAR_READY;
-}
-
-static void EDFSTAR_private_extract(LEVEL l, PID p)
-{
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
-
-#ifdef EDFSTAR_DEBUG
- //kern_printf("EDFSTAR_guest_end: dline timer %d\n",lev->deadline_timer[p]);
-#endif
-
- iq_extract(p, &lev->ready);
-
- /* we remove the deadline timer, because the slice is finished */
- if (lev->deadline_timer[p] != NIL) {
-#ifdef EDFSTAR_DEBUG
-// kern_printf("EDFSTAR_guest_end: dline timer %d\n",lev->deadline_timer[p]);
-#endif
- kern_event_delete(lev->deadline_timer[p]);
- lev->deadline_timer[p] = NIL;
- }
-
- /* and finally, a preemption check! (it will also call guest_end() */
- EDFSTAR_check_preemption(lev);
-}
-
-/* Registration functions */
-
-/* Registration function:
- int flags the init flags ... see EDFSTAR.h */
-LEVEL EDFSTAR_register_level(int budget, int master)
-{
- LEVEL l; /* the level that we register */
- EDFSTAR_level_des *lev; /* for readableness only */
- PID i; /* a counter */
-
-#ifdef EDFSTAR_DEBUG
- printk("EDFSTAR_register_level\n");
-#endif
-
- /* request an entry in the level_table */
- l = level_alloc_descriptor(sizeof(EDFSTAR_level_des));
-
- lev = (EDFSTAR_level_des *)level_table[l];
-
- printk(" lev=%d\n",(int)lev);
-
- /* fill the standard descriptor */
- lev->l.private_insert = EDFSTAR_private_insert;
- lev->l.private_extract = EDFSTAR_private_extract;
- lev->l.private_dispatch = EDFSTAR_private_dispatch;
- lev->l.private_epilogue = EDFSTAR_private_epilogue;
-
- lev->l.public_guarantee = NULL;
- lev->l.public_eligible = EDFSTAR_public_eligible;
- lev->l.public_create = EDFSTAR_public_create;
- lev->l.public_end = EDFSTAR_public_end;
- lev->l.public_dispatch = EDFSTAR_public_dispatch;
- lev->l.public_epilogue = EDFSTAR_public_epilogue;
- lev->l.public_activate = EDFSTAR_public_activate;
- lev->l.public_unblock = EDFSTAR_public_unblock;
- lev->l.public_block = EDFSTAR_public_block;
- lev->l.public_message = EDFSTAR_public_message;
-
- /* fill the EDFSTAR descriptor part */
- for(i=0; i<MAX_PROC; i++) {
- lev->period[i] = 0;
- lev->deadline_timer[i] = -1;
- lev->flag[i] = 0;
- lev->dline_miss[i] = 0;
- lev->wcet_miss[i] = 0;
- lev->nact[i] = 0;
- }
-
- iq_init(&lev->ready, NULL, IQUEUE_NO_PRIORITY);
- lev->activated = NIL;
-
- lev->budget = budget;
- lev->scheduling_level = master;
-
- return l;
-}
-
-int EDFSTAR_get_dline_miss(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
-
- return lev->dline_miss[p];
-}
-
-int EDFSTAR_get_wcet_miss(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
-
- return lev->wcet_miss[p];
-}
-
-int EDFSTAR_get_nact(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
-
- return lev->nact[p];
-}
-
-int EDFSTAR_reset_dline_miss(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
-
- lev->dline_miss[p] = 0;
- return 0;
-}
-
-int EDFSTAR_reset_wcet_miss(PID p)
-{
- LEVEL l = proc_table[p].task_level;
- EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
-
- lev->wcet_miss[p] = 0;
- return 0;
-}
-
Index: rel_1_21/block/idetest0.c
===================================================================
--- rel_1_21/block/idetest0.c (revision 1217)
+++ rel_1_21/block/idetest0.c (nonexistent)
@@ -1,15 +0,0 @@
-/*
- *
- *
- *
- */
-
-#include <fs/bdev.h>
-
-#include "common.h"
-
-int main(int argc,char *argv[])
-{
- showmessage("Have ide devices been found?\n");
- return 0;
-}
Index: rel_1_21/block/idetest1.c
===================================================================
--- rel_1_21/block/idetest1.c (revision 1217)
+++ rel_1_21/block/idetest1.c (nonexistent)
@@ -1,20 +0,0 @@
-/*
- *
- *
- *
- */
-
-#include <fs/bdev.h>
-
-#include "common.h"
-
-int main(int argc,char *argv[])
-{
-
- showmessage("This test try to identify the partions of all hard disks\n");
-
- bdev_dump_names();
-
- waitend();
- return 0;
-}
Index: rel_1_21/block/idetest2.c
===================================================================
--- rel_1_21/block/idetest2.c (revision 1217)
+++ rel_1_21/block/idetest2.c (nonexistent)
@@ -1,77 +0,0 @@
-/*
- *
- *
- *
- */
-
-#include <ll/i386/cons.h>
-#include <drivers/keyb.h>
-
-#include <fs/bdevinit.h>
-#include <fs/bdev.h>
-
-#include <string.h>
-
-#include "common.h"
-
-#define DISKDEVICE "ide/hda1"
-
-__uint8_t buffer[2048] __attribute__ ((aligned (4)));
-__dev_t dev;
-
-extern char *ide_error_msg[];
-
-int main(int argc,char *argv[])
-{
- __blkcnt_t blk;
- int res;
- int c;
-
- showmessage("This test try to read some blocks from first hard disk\n");
-
- dev=bdev_find_byname(DISKDEVICE);
- if (dev<0) {
- cprintf("Can't find device to operate with\n");
- return -1;
- }
- cprintf("Using device %s (dev=%04x)\n",DISKDEVICE,dev);
-
- blk=0;
- for (;;) {
- cprintf("Commands: x-exit r-read n-next block p-prev block\n");
- c = keyb_getchar();
- switch(c) {
- case 'x':
- return 0;
-
- case 'n':
- blk++;
- cprintf("Block %li\n",(long)blk);
- break;
-
- case 'p':
- if (blk>=0) blk--;
- cprintf("Block %li\n",(long)blk);
- break;
-
- case 'r':
- cprintf("Reading block %li...\n",(long)blk);
- memset(buffer,0xff,sizeof(buffer));
- res=bdev_read(dev,blk,buffer);
- cprintf("Result %i\n",res);
- //cprintf("Soft reset done %i\n",ide[0].errors);
- if (res!=0) {
- cprintf(" %s\n",(char*)ide_error_msg[-res]);
- }
- debug_dump_buffer(buffer,64);
- break;
-
- default:
- cprintf("Invalid command!\n");
- break;
- }
- cprintf("\n");
- }
-
- return 0;
-}
Index: rel_1_21/block/idelin.c
===================================================================
--- rel_1_21/block/idelin.c (revision 1217)
+++ rel_1_21/block/idelin.c (nonexistent)
@@ -1,71 +0,0 @@
-/*
- *
- *
- *
- */
-
-#include <ll/i386/cons.h>
-#include <kernel/func.h>
-
-#include <fs/bdevinit.h>
-#include <fs/bdev.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "common.h"
-
-#define DISKDEVICE "ide/hda"
-
-#define TEST_MB 16
-
-#define NUMBLOCK (TEST_MB*1024l*1024l/512l)
-
-__dev_t dev;
-
-__uint8_t buffer[2048];
-
-int main(int argc,char *argv[])
-{
- __blkcnt_t blk;
- int res;
- int errors;
- TIME sttime,etime;
-
- showmessage("\n"
- "This test read data from first hard disk to test\n"
- "disk throughtput.\n"
- "Remeber that the reads are made block by block so\n"
- "don't worry if you see a low throughtput.\n"
- );
-
- dev=bdev_find_byname(DISKDEVICE);
- if (dev<0) {
- cprintf("\nCan't find device to operate with\n");
- return -1;
- }
- cprintf("\nUsing device %s (dev=%04x)\n",DISKDEVICE,dev);
-
- cprintf("Please wait (reading %i MB linearly?!?)...",TEST_MB);
-
- sttime=sys_gettime(NULL);
- errors=0;
- for (blk=0;blk<NUMBLOCK;blk++) {
- res=bdev_read(dev,blk,buffer);
- //res=bdev_seek(dev,blk);
- if (res!=0) errors++;
- }
- etime=sys_gettime(NULL)-sttime;
-
- cprintf("\nDone\n\n");
- cprintf("elapse time : %li sec %li msec\n",
- etime/1000000l,
- (etime/1000l)%1000l);
- cprintf("throughtput : %6.3f MB/s\n",
- NUMBLOCK*512.0/1024.0/1024.0/etime*1000000.0);
- //cprintf("soft reset made: %i\n",ide[0].errors);
- cprintf("errors : %i\n",errors);
- cprintf("\n");
-
- return 0;
-}
Index: rel_1_21/block/idetest3.c
===================================================================
--- rel_1_21/block/idetest3.c (revision 1217)
+++ rel_1_21/block/idetest3.c (nonexistent)
@@ -1,66 +0,0 @@
-/*
- *
- *
- *
- */
-
-#include <ll/i386/cons.h>
-#include <drivers/keyb.h>
-
-#include <fs/bdevinit.h>
-#include <fs/bdev.h>
-
-#include <string.h>
-
-#include "common.h"
-
-#define DISKDEVICE "ide/hda1"
-#define BLOCKNUMBER 58549
-
-__uint8_t buffer[2048] __attribute__ ((aligned (4)));
-
-extern char *ide_error_msg[];
-
-int main(int argc,char *argv[])
-{
- __dev_t dev;
- __blkcnt_t blk;
- int res;
- // int c;
-
- showmessage("This test tries to read a block from the first hard disk\n"
- "and then it tries to write it to disk\n"
- "Press [CTRL-C] to abort...");
-
- dev=bdev_find_byname(DISKDEVICE);
- if ((int)dev<0) {
- cprintf("Can't find device to operate with\n");
- cprintf("%s not present!\n",DISKDEVICE);
- return -1;
- }
- cprintf("Using device %s (dev=%04x)\n",DISKDEVICE,dev);
-
- blk=BLOCKNUMBER;
-
- cprintf("Reading block %li...\n",(long)blk);
- memset(buffer,0xff,sizeof(buffer));
- res=bdev_read(dev,blk,buffer);
- cprintf("Result %i\n",res);
- //cprintf("Soft reset done %i\n",ide[0].errors);
- if (res!=0) {
- cprintf(" %s\n",(char*)ide_error_msg[-res]);
- return -1;
- }
- debug_dump_buffer(buffer,64);
-
- cprintf("Writing block %li...\n",(long)blk);
- res=bdev_write(dev,blk,buffer);
- cprintf("Result %i\n",res);
- //cprintf("Soft reset done %i\n",ide[0].errors);
- if (res!=0) {
- cprintf(" %s\n",(char*)ide_error_msg[-res]);
- }
-
- waitend();
- return 0;
-}
Index: rel_1_21/block/idernd.c
===================================================================
--- rel_1_21/block/idernd.c (revision 1217)
+++ rel_1_21/block/idernd.c (nonexistent)
@@ -1,68 +0,0 @@
-/*
- *
- *
- *
- */
-
-#include <ll/i386/cons.h>
-#include <kernel/func.h>
-
-#include <fs/bdevinit.h>
-#include <fs/bdev.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "common.h"
-
-#define DISKDEVICE "ide/hda1"
-
-#define NUMBLOCK 1000
-
-__dev_t dev;
-__uint8_t buffer[2048];
-
-int main(int argc,char *argv[])
-{
- __blkcnt_t blk;
- int res;
- int errors;
- TIME sttime,etime;
-
- showmessage("\n"
- "This test read RAMDOMLY data from first hard disk to test\n"
- "disk throughtput.\n"
- "Remeber that the reads are made RANDOMLY block by block so\n"
- "don't worry if you see a VERY low throughtput.\n"
- );
- srand(7);
-
- dev=bdev_find_byname(DISKDEVICE);
- if (dev<0) {
- cprintf("\nCan't find device to operate with\n");
- return -1;
- }
- cprintf("\nUsing device %s (dev=%04x)\n",DISKDEVICE,dev);
-
- cprintf("Please wait (reading %i KB ramdomly)...",NUMBLOCK/2);
-
- sttime=sys_gettime(NULL);
- errors=0;
- for (blk=0;blk<NUMBLOCK;blk++) {
- res=bdev_read(dev,rand()%5000,buffer);
- if (res!=0) errors++;
- }
- etime=sys_gettime(NULL)-sttime;
-
- cprintf("\nDone\n\n");
- cprintf("elapse time : %li sec %li msec\n",
- etime/1000000l,
- (etime/1000l)%1000l);
- cprintf("throughtput : %6.3f KB/s\n",
- NUMBLOCK*512.0/1024.0/etime*1000000.0);
- //cprintf("soft reset made: %i\n",ide[0].errors);
- cprintf("errors : %i\n",errors);
- cprintf("\n");
-
- return 0;
-}
Index: rel_1_21/block/common.c
===================================================================
--- rel_1_21/block/common.c (revision 1217)
+++ rel_1_21/block/common.c (nonexistent)
@@ -1,74 +0,0 @@
-
-#include <kernel/func.h>
-
-#include <fs/bdevinit.h>
-#include <fs/fsinit.h>
-#include <fs/bdev.h>
-
-#include <drivers/keyb.h>
-
-#include <sys/mount.h>
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-
-/* -- */
-
-int __register_sub_init(void)
-{
- return 0;
-}
-
-/* -- */
-
-int __bdev_sub_init(void)
-{
- BDEV_PARMS bdev=BASE_BDEV;
-
- bdev_def_showinfo(bdev,TRUE);
- bdev_init(&bdev);
-
- return 0;
-}
-
-/* -- */
-
-void ctrlc_exit(KEY_EVT *k)
-{
- cprintf("CTRL-C pressed!\n");
- sys_end();
-}
-
-/* -- */
-
-void showmessage(char *s)
-{
- cputs(s);
- cprintf("Press [x] to begin...");
- while (keyb_getchar()!='x');
- cprintf("\n");
-}
-
-void waitend(void)
-{
- int c;
- cprintf("Press [x] to exit...");
- while ((c=keyb_getchar())!='x');
- cprintf("\n");
-}
-
-/* -- */
-
-void debug_dump_buffer(char *buf, int size)
-{
- int i;
- for (i=0;i<size;i++) {
- if (i%16==0) {
- if (i!=0) cprintf("\n");
- cprintf("%04x: ",i);
- }
- cprintf("%02x ",(unsigned char)*(buf+i));
- }
- cprintf("\n");
-}
Index: rel_1_21/block/readme
===================================================================
--- rel_1_21/block/readme (revision 1217)
+++ rel_1_21/block/readme (nonexistent)
@@ -1,33 +0,0 @@
-Hi,
-
-These are the block devices demos.
-
-- THEY DO NOT WRITE ON YOUR HD, so they are not dangerous.
-
-- They do not require a FAT16 Filesystem.
-
-
-idetest0:
-The demo identifies your Hard Disk characteristics and prints it on
-the screen.
-
-idetest1:
-The demo identifies all the partitions of your HD.
-
-idetest2:
-The demo allows you to select a sector on the HD and to read it.
-
-idetest3:
-The demo reads a random sector and then it writes it in the same position.
-
-idelin:
-The demo reads 16Mb of data from the HD. The data is read block by
-block, linearly.
-
-idernd:
-The demo reads 512Kb of data from the HD. The data is read block by
-block, randomly.
-
-Enjoy,
-
-PJ
Index: rel_1_21/block/initblk.c
===================================================================
--- rel_1_21/block/initblk.c (revision 1217)
+++ rel_1_21/block/initblk.c (nonexistent)
@@ -1,113 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*
- * CVS : $Id: initblk.c,v 1.1 2002-11-11 08:24:49 pj Exp $
- *
- * File: $File$
- * Revision: $Revision: 1.1 $
- * Last update: $Date: 2002-11-11 08:24:49 $
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/rr.h"
-#include "modules/cbs.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-#include "modules/pi.h"
-#include "modules/pc.h"
-#include "modules/srp.h"
-#include "modules/npp.h"
-#include "modules/nop.h"
-#include "modules/nopm.h"
-
-#include "drivers/keyb.h"
-
-/*+ sysyem tick in us +*/
-#define TICK 1000
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
- extern int __register_sub_init(void);
-
- EDF_register_level(EDF_ENABLE_ALL);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- CBS_register_level(CBS_ENABLE_ALL, 0);
- dummy_register_level();
-
- SEM_register_module();
-
- CABS_register_module();
-
- PI_register_module();
- PC_register_module();
- NPP_register_module();
- SRP_register_module();
- NOP_register_module();
- NOPM_register_module();
-
- __register_sub_init();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
- KEYB_PARMS keyb = BASE_KEYB;
- extern int __bdev_sub_init(void);
- extern void ctrlc_exit(KEY_EVT *k);
-
- HARTPORT_init();
-
- keyb_def_ctrlC(keyb, ctrlc_exit);
- KEYB_init(&keyb);
-
- __bdev_sub_init();
-
- __call_main__(mb);
-
- return (void *)0;
-}
Index: rel_1_21/block/makefile
===================================================================
--- rel_1_21/block/makefile (revision 1217)
+++ rel_1_21/block/makefile (nonexistent)
@@ -1,34 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS=idetest0 idetest1 idetest2 idetest3 idelin idernd idetx430
-
-include $(BASE)/config/example.mk
-
-#
-#
-#
-
-idetest0:
- make -f $(SUBMAKE) BASE=$(BASE) APP=idetest0 OTHEROBJS="common.o initblk.o" SHARKOPT=__OLDCHAR__
-
-idetest1:
- make -f $(SUBMAKE) BASE=$(BASE) APP=idetest1 OTHEROBJS="common.o initblk.o" SHARKOPT=__OLDCHAR__
-
-idetest2:
- make -f $(SUBMAKE) BASE=$(BASE) APP=idetest2 OTHEROBJS="common.o initblk.o" SHARKOPT=__OLDCHAR__
-
-idetest3:
- make -f $(SUBMAKE) BASE=$(BASE) APP=idetest3 OTHEROBJS="common.o initblk.o" SHARKOPT=__OLDCHAR__
-
-idelin:
- make -f $(SUBMAKE) BASE=$(BASE) APP=idelin OTHEROBJS="common.o initblk.o" SHARKOPT=__OLDCHAR__
-
-idernd:
- make -f $(SUBMAKE) BASE=$(BASE) APP=idernd OTHEROBJS="common.o initblk.o" SHARKOPT=__OLDCHAR__
Index: rel_1_21/block/common.h
===================================================================
--- rel_1_21/block/common.h (revision 1217)
+++ rel_1_21/block/common.h (nonexistent)
@@ -1,11 +0,0 @@
-
-#ifndef __COMMON_H
-#define __COMMON_H
-
-void showmessage(char *s);
-void waitend(void);
-
-void debug_dump_buffer(char *buf, int size);
-
-#endif
-
Index: rel_1_21/mesademo/initfile.c
===================================================================
--- rel_1_21/mesademo/initfile.c (revision 1217)
+++ rel_1_21/mesademo/initfile.c (nonexistent)
@@ -1,118 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: initfile.c,v 1.2 2003-04-28 11:12:24 giacomo Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-04-28 11:12:24 $
- ------------
-
- System initialization file
-
- This file contains the 2 functions needed to initialize the system.
-
- These functions register the following levels:
-
- an EDF (Earliest Deadline First) level
- a RR (Round Robin) level
- a CBS (Costant Bandwidth Server) level
- a Dummy level
-
- It can accept these task models:
-
- HARD_TASK_MODEL (wcet+mit) at level 0
- SOFT_TASK_MODEL (met, period) at level 1
- NRT_TASK_MODEL at level 2
-
- This file is similar to the configuration of kernel/init/hartik3.c
-
-*/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-
-
-/*+ sysyem tick in us +*/
-#define TICK 1000
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- CBS_register_level(CBS_ENABLE_ALL, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- SEM_register_module();
-
- CABS_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- keyb_def_ctrlC(kparms, NULL);
- KEYB_init(&kparms);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
Index: rel_1_21/mesademo/mesademo.c
===================================================================
--- rel_1_21/mesademo/mesademo.c (revision 1217)
+++ rel_1_21/mesademo/mesademo.c (nonexistent)
@@ -1,411 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Giacomo Guidi <giacomo@gandalf.sssup.it>
- *
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-#include <drivers/vga.h>
-#include <drivers/keyb.h>
-
-#include <GL/osmesa.h>
-#include <GL/glut.h>
-
-#include <math.h>
-#include <stdlib.h>
-
-#include <kernel/log.h>
-#include <kernel/kern.h>
-
-#ifndef M_PI
-#define M_PI 3.14159265
-#endif
-
-#define WIDTH 640
-#define HEIGHT 480
-#define BYTES_PP 2 //BytesPerPixel
-#define INITSTR G640x480x64K //SVGAlib standard mode definitions
-#define CARD VESA //Video driver
-
-OSMesaContext ctx;
-
-unsigned char *rgb_565_buf = NULL; //RGB 16 bpp Buffer
-unsigned char *video_buf = NULL; //Video Buffer
-
-unsigned long int VMEMLONG = WIDTH * HEIGHT * BYTES_PP / 4; // Used by copy_videomem_16to16
-unsigned long int RGB565MEM = WIDTH * HEIGHT * BYTES_PP; // Total video mem
-
-unsigned long int PERIOD_REFRESH = 100000;
-unsigned long int PERIOD_DISEGNA = 100000;
-
-unsigned long int WCET_REFRESH, WCET_DISEGNA;
-
-TASK refesh(void);
-TASK disegna(void);
-
-PID refresh_PID, disegna_PID;
-
-static void
-gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
- GLint teeth, GLfloat tooth_depth)
-{
- GLint i;
- GLfloat r0, r1, r2;
- GLfloat angle, da;
- GLfloat u, v, len;
-
- r0 = inner_radius;
- r1 = outer_radius - tooth_depth / 2.0;
- r2 = outer_radius + tooth_depth / 2.0;
-
- da = 2.0 * M_PI / teeth / 4.0;
-
- glShadeModel(GL_FLAT);
-
- glNormal3f(0.0, 0.0, 1.0);
-
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
- glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
- glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
- if (i < teeth) {
- glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
- }
- }
- glEnd();
-
- glBegin(GL_QUADS);
- da = 2.0 * M_PI / teeth / 4.0;
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
-
- glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
- glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
- glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5);
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
- }
- glEnd();
-
- glNormal3f(0.0, 0.0, -1.0);
-
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
- glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
- glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
- if (i < teeth) {
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
- glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
- }
- }
- glEnd();
-
- glBegin(GL_QUADS);
- da = 2.0 * M_PI / teeth / 4.0;
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
-
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
- glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5);
- glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
- glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
- }
- glEnd();
-
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i < teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
-
- glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
- glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
- u = r2 * cos(angle + da) - r1 * cos(angle);
- v = r2 * sin(angle + da) - r1 * sin(angle);
- len = sqrt(u * u + v * v);
- u /= len;
- v /= len;
- glNormal3f(v, -u, 0.0);
- glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
- glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
- glNormal3f(cos(angle), sin(angle), 0.0);
- glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5);
- glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5);
- u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
- v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
- glNormal3f(v, -u, 0.0);
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
- glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
- glNormal3f(cos(angle), sin(angle), 0.0);
- }
-
- glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
- glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
-
- glEnd();
-
- glShadeModel(GL_SMOOTH);
-
- glBegin(GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- angle = i * 2.0 * M_PI / teeth;
- glNormal3f(-cos(angle), -sin(angle), 0.0);
- glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
- glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
- }
- glEnd();
-
-}
-
-static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
-static GLint gear1, gear2, gear3;
-static GLfloat angle = 0.0;
-
-static void draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glPushMatrix();
- glRotatef(view_rotx, 1.0, 0.0, 0.0);
- glRotatef(view_roty, 0.0, 1.0, 0.0);
- glRotatef(view_rotz, 0.0, 0.0, 1.0);
-
- glPushMatrix();
- glTranslatef(-3.0, -2.0, 0.0);
- glRotatef(angle, 0.0, 0.0, 1.0);
- glCallList(gear1);
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef(3.1, -2.0, 0.0);
- glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0);
- glCallList(gear2);
- glPopMatrix();
-
- glPushMatrix();
- glTranslatef(-3.1, 4.2, 0.0);
- glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0);
- glCallList(gear3);
- glPopMatrix();
-
- glPopMatrix();
-
- glFinish();
-
-}
-
-static void gl_init()
-{
-
- static GLfloat red[4] = {1.0, 0.0, 0.0, 1.0};
- static GLfloat green[4] = {0.0, 0.8, 0.2, 1.0};
- static GLfloat blue[4] = {0.2, 0.2, 1.0, 1.0};
- static GLfloat pos[4] = {5.0, 5.0, 10.0, 1.0};
- static GLfloat h = (GLfloat) HEIGHT / (GLfloat) WIDTH;
-
- //Create the OSMesa Context
- ctx = OSMesaCreateContext(OSMESA_RGB_565, NULL);
-
- //Make Current Context
- OSMesaMakeCurrent(ctx, rgb_565_buf, GL_UNSIGNED_SHORT_5_6_5, WIDTH, HEIGHT);
-
- glLightfv(GL_LIGHT0, GL_POSITION, pos);
- glEnable(GL_CULL_FACE);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_DEPTH_TEST);
-
- /* make the gears */
- gear1 = glGenLists(1);
- glNewList(gear1, GL_COMPILE);
- glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
- gear(1.0, 4.0, 1.0, 20, 0.7);
- glEndList();
-
- gear2 = glGenLists(1);
- glNewList(gear2, GL_COMPILE);
- glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
- gear(0.5, 2.0, 2.0, 10, 0.7);
- glEndList();
-
- gear3 = glGenLists(1);
- glNewList(gear3, GL_COMPILE);
- glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
- gear(1.3, 2.0, 0.5, 10, 0.7);
- glEndList();
-
- glEnable(GL_NORMALIZE);
-
- glViewport(0, 0, (GLint) WIDTH, (GLint) HEIGHT);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0.0, 0.0, -40.0);
-
-}
-
-static int screen(int mode)
-{
-
- vga_modeinfo *minf;
-
- vga_setmode(mode,CARD);
- minf = vga_getmodeinfo(mode);
- if(! (minf->flags & CAPABLE_LINEAR)){
- vga_setmode(TEXT,CARD);
- printk(KERN_INFO "The mode %d is not capable of linear\n",mode);
- return 1;
- }
- vga_setpage(0);
- if(vga_setlinearaddressing() == -1) {
- vga_setmode(TEXT,CARD);
- printk(KERN_INFO "Could not set linear addressing for mode %d\n",mode);
- return 1;
- }
-
- video_buf = vga_getgraphmem();
-
- grx_setbuffer(rgb_565_buf, WIDTH, HEIGHT); //Init of RGB16 version of grx functions
- //created to work with Mesa buffer
- return 0;
-
-}
-
-void program_end(void *arg)
-{
-
- OSMesaDestroyContext(ctx);
- free(rgb_565_buf);
-
- vga_setmode(TEXT,CARD);
-
- sys_end();
-
-}
-
-void program_key_end(KEY_EVT *k)
-{
-
- sys_end();
-
-}
-
-TASK refresh(void)
-{
-
- while(1) {
-
- copy_videomem_16to16(rgb_565_buf, video_buf, VMEMLONG);
- task_endcycle();
-
- }
-
- sys_end();
-
-}
-
-
-TASK disegna(void)
-{
-
- char text[100];
- TIME disegna_TIME, refresh_TIME;
-
- while(1) {
-
- jet_gettable(refresh_PID, &refresh_TIME, 1);
- jet_gettable(disegna_PID, &disegna_TIME, 1);
-
- angle += 1.0;
-
- draw();
-
- sprintf(text,"Hard Task Refresh PER:%6d us EX:%6d us",(int)PERIOD_REFRESH,(int)refresh_TIME);
- grx_text(text,10,5,rgb16(0,0,255),0);
- sprintf(text,"Hard Task Draw PER:%6d us EX:%6d us",(int)PERIOD_DISEGNA,(int)disegna_TIME);
- grx_text(text,10,15,rgb16(0,0,255),0);
-
- task_endcycle();
-
- }
-
- sys_end();
-
-}
-
-int main (int argc, char *argv[])
-{
-
- HARD_TASK_MODEL ht_refresh, ht_disegna;
-
- sys_atrunlevel(program_end,NULL, RUNLEVEL_BEFORE_EXIT);
-
- clear();
-
- WCET_REFRESH =((long int) PERIOD_REFRESH * (0.25));
- WCET_DISEGNA =((long int) PERIOD_DISEGNA * (0.6));
-
- hard_task_default_model(ht_refresh);
- hard_task_def_wcet(ht_refresh,WCET_REFRESH);
- hard_task_def_mit(ht_refresh,PERIOD_REFRESH);
- hard_task_def_usemath(ht_refresh);
- hard_task_def_group(ht_refresh,1);
- hard_task_def_ctrl_jet(ht_refresh);
-
- refresh_PID = task_create("refresh", refresh, &ht_refresh, NULL);
- if (refresh_PID == -1) {
- sys_end();
- exit(4);
- }
-
- hard_task_default_model(ht_disegna);
- hard_task_def_mit(ht_disegna,PERIOD_DISEGNA);
- hard_task_def_wcet(ht_disegna,WCET_DISEGNA);
- hard_task_def_group(ht_disegna,1);
- hard_task_def_ctrl_jet(ht_disegna);
- hard_task_def_usemath(ht_disegna);
- hard_task_def_stack(ht_disegna,30000); //VERY IMPORTANT FOR glCallList !!
-
- disegna_PID = task_create("disegna", disegna, &ht_disegna, NULL);
- if (disegna_PID == -1) {
- sys_end();
- exit(4);
- }
-
- {
- KEY_EVT k;
- k.flag = ALTL_BIT;
- k.scan = KEY_C;
- k.ascii = 'c';
- keyb_hook(k,program_key_end);
- }
-
- rgb_565_buf = malloc(RGB565MEM);
-
- gl_init();
-
- if (screen(INITSTR)) {
- printk(KERN_INFO "Graphical initialization failed !!\n");
- sys_end();
- }
-
- memset(rgb_565_buf, 0, RGB565MEM);
-
- group_activate(1);
-
- return 0;
-
-}
Index: rel_1_21/mesademo/readme.txt
===================================================================
--- rel_1_21/mesademo/readme.txt (revision 1217)
+++ rel_1_21/mesademo/readme.txt (nonexistent)
@@ -1,44 +0,0 @@
---------------------------------------
-MESA Demo (gears)
-
-by
-
-Giacomo Guidi <giacomo@gandalf.sssup.it>
-
-Last update 17/03/2003
---------------------------------------
-
-This is a simple test demo for the MESA (5.0)
-libraries, the low level graphic drivers is
-the SVGA (from the SVGAlib)
-
-See drivers/svga/readme for supported cards
-
---------------------------------------
-
-The demo is composed by:
-
-MAKEFILE The makefile used to compile the application
-README.TXT This file
-INITFILE.C The init file
-MESADEMO.C The MESA Demo
-
---------------------------------------
-
-- To specify your card change the line
-
-#define CARD <driver name>
-
-- The demo calls the grx and off-screen Mesa functions.
-The resolution must be 16 bitsperpixel (64K colors) and
-the graphic access mode must be linear.
-
-- There are two buffers
-
- The video buffer (video_buf)
- The virtual buffer (rgb_565_buf)
-
- copy_videomem_16to16 links these buffers
-
-
-
Index: rel_1_21/mesademo/makefile
===================================================================
--- rel_1_21/mesademo/makefile (revision 1217)
+++ rel_1_21/mesademo/makefile (nonexistent)
@@ -1,16 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS = mesademo
-
-include $(BASE)/config/example.mk
-
-mesademo:
- make -f $(SUBMAKE) APP=mesademo INIT= OTHEROBJS="initfile.o" SHARKOPT="__OSMESA__ __OLDCHAR__ __SVGA__"
-
Index: rel_1_21/lights/makefile
===================================================================
--- rel_1_21/lights/makefile (revision 1217)
+++ rel_1_21/lights/makefile (nonexistent)
@@ -1,16 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS= simlight
-
-include $(BASE)/config/example.mk
-
-simlight:
- make -f $(SUBMAKE) APP=simlight INIT= OTHEROBJS="initfile.o " SHARKOPT="__FFT__ __OLDCHAR__ __GRX__"
-
Index: rel_1_21/lights/simlight.c
===================================================================
--- rel_1_21/lights/simlight.c (revision 1217)
+++ rel_1_21/lights/simlight.c (nonexistent)
@@ -1,482 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* U N I V E R S I T A D I P A V I A */
-/* DIPARTIMENTO DI INFORMATICA e SISTEMSTICA */
-/* corso di INFORMATICA INDUSTRIALE */
-/* prof. G. Buttazzo */
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* S I M L I G H T */
-/* progetto con S.H.A.R.K. : */
-/* SIMULAZIONE FARI DA PALCO / DISCOTECA */
-/* (C) 2001 by G. Vadruccio */
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*
- * Copyright (C) 2001 G. Vadruccio
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <ll/ll.h>
-#include <kernel/types.h>
-#include <kernel/model.h>
-#include <kernel/func.h>
-#include <modules/cabs.h>
-#include <string.h>
-#include <stdlib.h>
-#include <semaphore.h>
-#include <drivers/keyb.h>
-#include <drivers/crtwin.h>
-#include <drivers/glib.h>
-#include <drivers/sound.h>
-#include <rfftw.h>
-#include <math.h>
-#include "blaster.h"
-
-#define FFT_SCALE (16384.0) // fatt. scala usato dal task fft
-
-typedef short SAMPLE; // campioni letti da SB a 16-bit
-
-typedef struct { // per il CAB cab_camdata
- int start;
- SAMPLE sample[1000];
-} campione;
-
-typedef struct { // per il CAB cab_prwdata
- fftw_real p[501];
-} power;
-
-typedef struct { // per il CAB cab_lightdata
- int l[8];
-} lights;
-
-CAB cab_camdata; // CAB dati campionati dalla SB
-CAB cab_pwrdata; // CAB dati spettro di potenza
-CAB cab_lghdata; // CAB dati intensit… luci
-sem_t mutex; // semaforo di mutua esclusione
-campione cam; // struttura dei campioni
-rfftw_plan plan; // usato dalla libreria fft
-char fbuf[1000];
-int flen,
- WCET_FFT, WCET_LIV, WCET_LIGHT,
- PERIOD_FFT, PERIOD_LIV, PERIOD_LIGHT,
- AGCOP, MICLEV,
- ATT1, ATT2, ATT3, ATT4, ATT5, ATT6, ATT7; // parametri letti da file ext.
-
-
-void read_file(void) // funzione di lettura file di
-{ // testo 'PARAM.DAT' contenente
-int err; // i parametri di funzionamento
-DOS_FILE *fp;
- fp = DOS_fopen("param.dat","r");
- if (!fp) {
- err = DOS_error();
- cprintf("Error %d opening param.dat...\n", err);
- flen = 0;
- return;
- }
- flen = DOS_fread(&fbuf, 1, 325, fp);
- cprintf("Read %d bytes from orbit.dat\n", flen);
- DOS_fclose(fp);
-}
-
-
-void get_par(void) // scansione dei parametri
-{
-int x = 0;
-
- while ((fbuf[x] != ':') && (x < flen)) x++;
- x++;
- sscanf(&fbuf[x], "%d", &WCET_FFT); // lettura wcet task fft
- while ((fbuf[x] != ':') && (x < flen)) x++;
- x++;
- sscanf(&fbuf[x], "%d", &PERIOD_FFT); // lettura periodo task fft
- while ((fbuf[x] != ':') && (x < flen)) x++;
- x++;
- sscanf(&fbuf[x], "%d", &WCET_LIV); // lettura wcet task livelli
- while ((fbuf[x] != ':') && (x < flen)) x++;
- x++;
- sscanf(&fbuf[x], "%d", &PERIOD_LIV); // lettura periodo task livelli
- while ((fbuf[x] != ':') && (x < flen)) x++;
- x++;
- sscanf(&fbuf[x], "%d", &WCET_LIGHT); // lettura wcet task light
- while ((fbuf[x] != ':') && (x < flen)) x++;
- x++;
- sscanf(&fbuf[x], "%d", &PERIOD_LIGHT); // lettura periodo task light
- while ((fbuf[x] != ':') && (x < flen)) x++;
- x++;
- sscanf(&fbuf[x], "%d", &AGCOP); // lettura opzione AGC
- while ((fbuf[x] != ':') && (x < flen)) x++;
- x++;
- sscanf(&fbuf[x], "%d", &MICLEV); // letura livello microfonico
- while ((fbuf[x] != ':') && (x < flen)) x++;
- x++;
- sscanf(&fbuf[x], "%d", &ATT1); // lettura attenuazione faro 1
- while ((fbuf[x] != ':') && (x < flen)) x++;
- x++;
- sscanf(&fbuf[x], "%d", &ATT2); // lettura attenuazione faro 2
- while ((fbuf[x] != ':') && (x < flen)) x++;
- x++;
- sscanf(&fbuf[x], "%d", &ATT3); // lettura attenuazione faro 3
- while ((fbuf[x] != ':') && (x < flen)) x++;
- x++;
- sscanf(&fbuf[x], "%d", &ATT4); // lettura attenuazione faro 4
- while ((fbuf[x] != ':') && (x < flen)) x++;
- x++;
- sscanf(&fbuf[x], "%d", &ATT5); // lettura attenuazione faro 5
- while ((fbuf[x] != ':') && (x < flen)) x++;
- x++;
- sscanf(&fbuf[x], "%d", &ATT6); // lettura attenuazione faro 6
- while ((fbuf[x] != ':') && (x < flen)) x++;
- x++;
- sscanf(&fbuf[x], "%d", &ATT7); // lettura attenuazione faro 7
-}
-
-
-void set_new_palette(void) // funzione di preparazione della
-{ // palette di colori usata
- int k, j;
-
- for (k=0; k<7; k++)
- for (j=(k*36); j<=(k*36)+4; j++) grx_setcolor(j,0,0,0); // nero
- for (k=252; k<256; k++) grx_setcolor(k,0,0,0); // nero
- for (k=1; k<=31; k++) {
- grx_setcolor(k+4,(k*2)+1,0,0); // sfumatura rosso FARO 1
- grx_setcolor(k+40,(k*2)+1,(k*2)+1,0); // sfumatura giallo FARO 2
- grx_setcolor(k+76,0,(k*2)+1,0); // sfumatura verde FARO 3
- grx_setcolor(k+112,0,(k*2)+1,(k*2)+1); // sfumarura azzurra FARO 4
- grx_setcolor(k+148,0,0,(k*2)+1); // sfumatura blu FARO 5
- grx_setcolor(k+184,(k*2)+1,0,(k*2)+1); // sfumatura magenta FARO 6
- grx_setcolor(k+220,(k*2)+1,(k*2)+1,(k*2)+1); // sfumatura bianco FARO 7
- }
-}
-
-
-void crea_scenario(void) // funzione di creazione scenario
-{ // (trave e campane del palco)
- int j;
- int cs=238;
-
- for (j=0; j<16; j++) grx_line(40*j,12,(40*j)+20,0,cs);
- for (j=0; j<16; j++) grx_line(40*j+20,0,(40*j)+40,12,cs);
- grx_rect(0,0,639,12,cs);
- for (j=0; j<7; j++) {
- grx_line(49+(j*83),12,49+(j*83),35,cs);
- grx_line(49+(j*83),35,55+(j*83),35,cs);
- grx_box(52+(j*83),32,88+(j*83),59,cs);
- grx_disc(70+(j*83),33,18,cs);
- grx_line(84+(j*83),35,91+(j*83),35,cs);
- grx_line(91+(j*83),35,91+(j*83),12,cs);
- }
-}
-
-
-int raw_infun(void *b) // funzione di self-buffering per
-{ // la lettura dei campioni da SB
- int i; // e scrittura nel cab
- char *w; // dei campioni
- SAMPLE *audiobuf = (SAMPLE *)b;
-
- for (i=0; i<500; i++) {
- cam.sample[cam.start] = audiobuf[i];
- cam.start = (cam.start+1) % 1000;
- }
- w = cab_reserve(cab_camdata);
- memcpy(w, &cam, sizeof(campione));
- cab_putmes(cab_camdata,w);
- return 0;
-}
-
-
-void init_rawdata() // funzione per inizializzare
-{ // il CAB dei campioni letti da SB
- int i;
- char *w;
-
- cam.start = 0;
- for (i=0; i<1000; i++)
- cam.sample[i] = 0;
- w = cab_reserve(cab_camdata);
- memcpy(w, &cam, sizeof(campione));
- cab_putmes(cab_camdata,w);
-}
-
-
-void fft_close(void *arg) // fun. in uscita da task fft_task
-{
- rfftw_destroy_plan(plan);
-}
-
-
-TASK fft_task() // task per calcolo della fft:
-{ // legge dal CAB dei dati
- fftw_real in[1000], out[1000]; // campionati e scrive nal CAB
- power power_spectrum; // dello spettro di potenza
- campione *p;
- char *m;
- int k, i;
-
- plan = rfftw_create_plan(1000, FFTW_REAL_TO_COMPLEX, FFTW_ESTIMATE);
- sys_atrunlevel(fft_close, NULL, RUNLEVEL_BEFORE_EXIT);
- while(1)
- {
- p = (campione *)cab_getmes(cab_camdata);// lettura CAB dati campionati
- for (k = 0, i = p->start;
- k < 1000;
- k++, i = (i+1)%1000)
- in[k] = p->sample[i]/FFT_SCALE;
- cab_unget(cab_camdata,(char *)p);
- rfftw_one(plan, in, out);
- power_spectrum.p[0] = out[0]*out[0]; // calcolo spettro potenza
- for (k = 1; k < 501; ++k)
- power_spectrum.p[k] = out[k]*out[k] + out[1000-k]*out[1000-k];
- power_spectrum.p[500] = out[500]*out[500]; // Nyquist freq.
- m = cab_reserve(cab_pwrdata); // scrittura nel CAB dello spettro
- memcpy(m, &power_spectrum, sizeof(power));
- cab_putmes(cab_pwrdata,m);
- task_endcycle();
- }
-}
-
-
-TASK livello() // task per il calcolo dei livelli
-{ // luminosi dei fari: legge dal
- power *p; // CAB dello spettro di potenza
- lights *l; // e dal CAB dei livelli luminosi
- lights w; // e aggiorna il CAB dei livelli
- char *m; // luminosi
- int j[8]={0,0,0,0,0,0,0,0};
- int k[8]={0,0,0,0,0,0,0,0};
- int y[501];
- int i;
- long add;
- while(1) {
- p = (power *)cab_getmes(cab_pwrdata); // lettura del CAB dello spettro
- l = (lights *)cab_getmes(cab_lghdata);// lettura CAB livelli luminosi
- for (i=1; i<=7; i++) j[i]=l->l[i];
- cab_unget(cab_lghdata,(char *)l);
- for (i = 1; i < 501; i++) {
- if ((int)(p->p[i])>650000) y[i]=650000; //controllo range distorsione
- else y[i]=(int)(p->p[i]);
- }
- cab_unget(cab_pwrdata,(char *)p);
- /***************** calocolo livello FARO 1 **************/
- add=0;
- for (i=1; i<4; i++) add+=(long)(y[i]);
- k[1]=(int)(add/ATT1);
- if (k[1]>31) k[1]=31;
- if (k[1]<0) k[1]=0;
- if ((k[1]-j[1])<13) w.l[1]=j[1]-(int)((j[1]/8)+1);
- else w.l[1]=k[1];
- if (w.l[1]>31) w.l[1]=31;
- if (w.l[1]<0) w.l[1]=0;
- /***************** calocolo livello FARO 2 **************/
- add=0;
- for (i=6; i<20; i++) add+=(long)(y[i]/1);
- for (i=90; i<100; i++) add+=(long)(y[i]*3);
- k[2]=(int)(add/ATT2);
- if (k[2]<13) k[2]=0;
- if (k[2]>31) k[2]=31;
- if ((k[2]-j[2])<5) w.l[2]=j[2]-(int)((j[2]/10)+1);
- else w.l[2]=k[2];
- if (w.l[2]>31) w.l[2]=31;
- if (w.l[2]<0) w.l[2]=0;
- /***************** calocolo livello FARO 3 **************/
- add=0;
- for (i=13; i<40; i++) add+=(long)(y[i]);
- k[3]=(int)(add/ATT3);
- if (k[3]<13) k[3]=0;
- if (k[3]>31) k[3]=31;
- if ((k[3]-j[3])<8) w.l[3]=j[3]-3;
- else w.l[3]=k[3];
- if (w.l[3]>31) w.l[3]=31;
- if (w.l[3]<0) w.l[3]=0;
- /***************** calocolo livello FARO 4 **************/
- add=0;
- for (i=40; i<60; i++) add+=(long)(y[i]);
- k[4]=(int)(add/ATT4);
- if (k[4]<11) k[4]=0;
- if (k[4]>31) k[4]=31;
- if ((k[4]-j[4])<4) w.l[4]=j[4]-3;
- else w.l[4]=j[4]+3;
- if (w.l[4]>31) w.l[4]=31;
- if (w.l[4]<0) w.l[4]=0;
- /***************** calocolo livello FARO 5 **************/
- add=0;
- for (i=90; i<120; i++) add+=(long)(y[i]);
- for (i=15; i<30; i++) add+=(long)(y[i]/6);
- k[5]=(int)(add/ATT5);
- if (k[5]<13) k[5]=0;
- if (k[5]>31) k[5]=31;
- if ((k[5]-j[5])<4) w.l[5]=j[5]-3;
- else w.l[5]=k[5];
- if (w.l[5]>31) w.l[5]=31;
- if (w.l[5]<0) w.l[5]=0;
- /***************** calocolo livello FARO 6 **************/
- add=0;
- for (i=170; i<230; i++) add+=(long)(y[i]);
- k[6]=(int)(add/ATT6);
- if (k[6]<13) k[6]=0;
- if (k[6]>31) k[6]=31;
- if ((k[6]-j[6])<6) w.l[6]=j[6]-(int)((j[6]/9)+1);
- else w.l[6]=j[6]+((k[6]-j[6])/3);
- if (w.l[6]>31) w.l[6]=31;
- if (w.l[6]<0) w.l[6]=0;
- /***************** calocolo livello FARO 7 **************/
- add=0;
- for (i=200; i<450; i++) add+=(long)(y[i]);
- k[7]=(int)(add/ATT7);
- if (k[7]<13) k[7]=0;
- if (k[7]<13) k[7]=0;
- if (k[7]>31) k[7]=31;
- if ((k[7]-j[7])<5) w.l[7]=k[7]-(int)((j[7]/10)+1);
- else w.l[7]=(int)((k[7]+j[7])/2);
- if (w.l[7]>31) w.l[7]=31;
- if (w.l[7]<0) w.l[7]=0;
-
- m=cab_reserve(cab_lghdata); // scrittura CAB livelli luminosi
- memcpy(m, &w, sizeof(lights));
- cab_putmes(cab_lghdata,m);
- task_endcycle();
- }
-}
-
-
-TASK light(void *arg) // task per l'accensione grafica
-{ // delle luci: legge dal CAB dei
- lights *p; // livelli luminosi
- int i = (int)arg; // i = n. del task
- int a, c, pos, liv;
-
- while(1) {
- p = (lights *)cab_getmes(cab_lghdata);// lettura CAB livelli luminosi
- liv=p->l[i]; // livello del faro selezionato
- sem_wait(&mutex); // inizio sezione critica
- c=((36*i)-32)+liv; // colore del faro selezionato
- pos=(83*i)-13; // posizione del faro seleionato
- grx_box(pos-14,60,pos+14,440,c); // disegna il raggio lumonoso
- for (a=15; a<=18; a++) grx_line(pos-15,60,pos-a,440,c);
- grx_line(pos-15,60,pos-19,440,c-1);
- for (a=20; a<=22; a++) grx_line(pos-16,60,pos-a,440,c-1);
- grx_line(pos-16,60,pos-23,440,c-2);
- for (a=24; a<=26; a++) grx_line(pos-17,60,pos-a,440,c-2);
- for (a=27; a<=30; a++) grx_line(pos-17,60,pos-a,440,c-3);
- for (a=31; a<=34; a++) grx_line(pos-17,60,pos-a,440,c-3);
- for (a=15; a<=18; a++) grx_line(pos+15,60,pos+a,440,c);
- grx_line(pos+15,60,pos+19,440,c-1);
- for (a=20; a<=22; a++) grx_line(pos+16,60,pos+a,440,c-1);
- grx_line(pos+16,60,pos+23,440,c-2);
- for (a=24; a<=26; a++) grx_line(pos+17,60,pos+a,440,c-2);
- for (a=27; a<=30; a++) grx_line(pos+17,60,pos+a,440,c-3);
- for (a=31; a<=34; a++) grx_line(pos+17,60,pos+a,440,c-3);
- sem_post(&mutex); // fine sezione critica
- cab_unget(cab_lghdata,(char *)p);
- task_endcycle();
- }
-}
-
- // funzione in uscita
-void my_close(void *arg)
-{
- grx_close();
- kern_printf("Bye Bye!\n");
-}
-
-
-int main(int argc, char **argv)
-{
- int modenum;
- int f=48000; // frequenza di campionamento
- int i=1;
- HARD_TASK_MODEL m1, m2, m3;
- PID p1, p2, p3;
-
- cab_camdata = cab_create("camdata", sizeof(campione), 4);
- cab_pwrdata = cab_create("pwr", sizeof(power), 4);
- cab_lghdata = cab_create("lghdata", sizeof (lights),4);
- read_file();
- get_par();
- sound_init((1000 * sizeof(SAMPLE)), NULL); // init sound card
- sound_info(); // visualizza info sound card
- init_rawdata(); // init dati usati da raw_infun
- sbmixer_setoutput(0x01,ENABLE); // abilita output sonoro
- sbmixer_setmiclev(MICLEV); // imposta sensibilt… input-mic
- sbmixer_setAGC(AGCOP); // opzione guadagno automatico
- sound_setfun(raw_infun, (int (*)(void *))-1); // inizia self-buffering
- sound_sample(NULL, f, 0, DMA_OP | PCM16 | MYFUN, NULL);
- cprintf("Press Enter...");
- while (keyb_getchar() != 13); // premi un tasto per iniziare
- sys_atrunlevel(my_close, NULL, RUNLEVEL_BEFORE_EXIT); // fun in uscita
- grx_init(); // attiva grafica
- modenum = grx_getmode(640, 480, 8);
- grx_setmode(modenum);
- set_new_palette(); // prepara la palette
- crea_scenario(); // crea lo scenario
- sem_init(&mutex, 0, 1); // init graphics mutex
-
- hard_task_default_model(m1); // define task m1 (fft)
- hard_task_def_periodic(m1);
- hard_task_def_mit(m1, PERIOD_FFT);
- hard_task_def_wcet(m1, WCET_FFT);
- hard_task_def_usemath(m1);
- hard_task_def_group(m1, 1);
- hard_task_def_stack(m1,32*1024);
- p1 = task_create("fft", fft_task, &m1, NULL); // crea task m1 (fft)
- if (p1 == -1) {
- perror("Could not create task <fft>\n");
- sys_end();
- }
- task_activate(p1); // attiva task m1 (fft)
-
- hard_task_default_model(m2); // define task m2 (livello)
- hard_task_def_periodic (m2);
- hard_task_def_mit (m2, PERIOD_LIV);
- hard_task_def_wcet (m2, WCET_LIV);
- hard_task_def_usemath (m2);
- hard_task_def_group (m2, 1);
- hard_task_def_ctrl_jet (m2);
- p2 = task_create("livello", livello, &m2, NULL); // crea task m2 (livello)
- if (p2 == NIL) {
- grx_close();
- perror("Could not create task <livello>");
- sys_abort(1);
- }
- task_activate(p2); // attiva task m2 (livello)
-
- do {
- hard_task_default_model(m3); // define 7 task m3 (light)
- hard_task_def_periodic (m3);
- hard_task_def_mit (m3, PERIOD_LIGHT);
- hard_task_def_wcet (m3, WCET_LIGHT);
- hard_task_def_usemath (m3);
- hard_task_def_group (m3, 1);
- hard_task_def_ctrl_jet (m3);
- hard_task_def_arg (m3, (void *)i);
- p3 = task_create("light", light, &m3, NULL); // crea 7 task m3 (light)
- if (p3 == NIL) {
- grx_close();
- perror("Could not create task <light>");
- sys_abort(1);
- }
- task_activate(p3); // attiva 7 task m3 (light)
- i++;
- } while (i<8);
-
- while (keyb_getchar() != 13); // premere Invio per terminare
- sys_end();
- return 0;
-}
-
-
Index: rel_1_21/lights/blaster.h
===================================================================
--- rel_1_21/lights/blaster.h (revision 1217)
+++ rel_1_21/lights/blaster.h (nonexistent)
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2000 Luca Abeni
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "semaphore.h"
-
-
-typedef struct sb_device {
- DWORD BaseAddress;
- BYTE IntLine;
- BYTE DMA8Channel;
- BYTE DMA16Channel;
- BYTE DSPVersionM;
- BYTE DSPVersionm;
-// WORD period;
-// BYTE pwarning;
- TASK_MODEL *m;
-} SB_DEVICE;
-
-typedef struct sound_buffer {
- sem_t synchr;
- BYTE synch;
- struct dma_buff *sound_dma;
- int (*fun)(struct dma_buff *buff);
-} SOUND_BUFFER;
-
-typedef struct rawfuncs {
- int (*infun)(void *rawbuffer);
- BYTE infunpresent;
- int (*outfun)(void *rawbuffer);
- BYTE outfunpresent;
-} RAWFUNCS;
-
-void sb_spkoff (void);
-void sb_spkon (void);
-int sb_init (void); // return 0 if ok or ENODEV otherwise
-void sbmixer_setmiclev(BYTE level);
-void sbmixer_setoutput(BYTE in, BYTE onoff);
-void sbmixer_setinput(BYTE in, BYTE onoff);
-void sbmixer_reset(void);
-void sbmixer_setingainlev(BYTE level);
-void sbmixer_setAGC(BYTE onoff);
-void sb_setrate (int sps, BYTE i_o);
-void sb_dmaop(BYTE i_o);
-void sb_dma16op(BYTE i_o);
-void sb_dmabuffop(BYTE i_o);
-void sb_dma16buffop(BYTE i_o);
-void sb_stopdsp(BYTE b);
-void sb_show(void);
Index: rel_1_21/lights/initfile.c
===================================================================
--- rel_1_21/lights/initfile.c (revision 1217)
+++ rel_1_21/lights/initfile.c (nonexistent)
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2001 G. Vadruccio
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-// INITFILE.C per il programma SIMLIGHT
-// Progetto SHARK
-// Contiene le funzioni necessarie per inizializzare il sistema.
-// Le funzioni registrano i moduli:
-// EDF (Earliest Deadline First) level
-// RR (Round Robin) level
-// CBS (Costant Bandwidth Server) level
-// Dummy level
-// Task attivabili:
-// HARD_TASK_MODEL (wcet+mit) at level 0
-// SOFT_TASK_MODEL (met, period) at level 1
-// NRT_TASK_MODEL at level 2
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-
-
-/*+ sysyem tick in us +*/
-#define TICK 1000
-
-/*+ RR tick in us +*/
-#define RRTICK 1000
-
-void read_file(void);
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- CBS_register_level(CBS_ENABLE_ALL, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- SEM_register_module();
-
- CABS_register_module();
-
- read_file();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- keyb_def_ctrlC(kparms, NULL);
- keyb_def_map(kparms,itaMap);
- KEYB_init(&kparms);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
Index: rel_1_21/lights/param.dat
===================================================================
--- rel_1_21/lights/param.dat (revision 1217)
+++ rel_1_21/lights/param.dat (nonexistent)
@@ -1,21 +0,0 @@
-----------------------------------------------------
-WCET_FFT: 2850
-PERIOD_FFT: 30000
-
-WCET_LIV: 2850
-PERIOD_LIV: 30000
-
-WCET_LIGHT: 3900
-PERIOD_LIGHT: 43500
-
-AGC: 0
-MICLEV: 22
-
-ATT1: 9500
-ATT2: 1800
-ATT3: 1600
-ATT4: 100
-ATT5: 400
-ATT6: 300
-ATT7: 200
-----------------------------------------------------
Index: rel_1_21/lights/readme.txt
===================================================================
--- rel_1_21/lights/readme.txt (revision 1217)
+++ rel_1_21/lights/readme.txt (nonexistent)
@@ -1,71 +0,0 @@
-Simlight
---------
-
-This project was done by Giancarlo Vadruccio, university of Pavia, as
-an Assignment in the corse of Informatic Engineering.
-
-Unfortunately part of the documentation is in italian, if you have any problem
-please send me an e-mail.
-
-Paolo
-
-...and here is the original description...
-
-S I M L I G H T
-Progetto SHARK realizzato da Giancarlo Vadruccio.
-
-- DESCRIZIONE DEL PROGRAMMA
-Il programma simula graficamente l'azionamento automatico di luci pilotato da
-un segnale audio collegato all'ingresso microfonico di una scheda audio Sound
-Blaster 16. L'intensit… luminosa del faro dipende dalla potenza del segnale
-audio e ogni faro Š sensibile ad una determinata gamma di frequenze sonore e
-quindi di strumenti. Ciascun faro, infatti, Š azionato dal valore medio della
-potenza di una determinata banda di frequenze. I fari sono disposti in ordine
-da sinistra verso destra, dalle frequenze pi— basse (grancassa, basso, ecc..)
-a quelle pi— alte (crash, piatti, charleston, ecc.).
-
-- REQUISITI DI SISTEMA
-Il programma Š stato realizzato su un sistema AMD DURON 800 MHz con bus di
-memoria a 133 MHz, sul quale funziona correttamente. Su sistemi pi— lenti, al
-fine di garantire la schedulabilit… dei processi, sarebbe necessario
-aumentare il periodo di ogni task (e il wcet) rischiando per• di rendere meno
-realistica la simulazione (periodo e wcet sono modificabili da file PARAM.DAT).
-Inoltre Š necessario installare una scheda audio Sound Blaster 16 con i
-relativi driver DOS.
-Tutte le funzioni e librerie usate sono quelle standard di SHARK
-(distribuzione Giugno 2001). Per usare il programma Š sufficiente lanciare
-(dall'ambiente DOS/SHARK) il comando <X SIMLIGHT> dalla directory
-dell'applicazione (se necessario ricompilare con il comando <MAKE> nella stessa
-directory).
-
-- SORGENTE SONORA
-Come sorgente sonora Š possibile usare un lettore CD o un microfono. In
-entrambi i casi l'uscita del segnale audio deve essere collegata all'ingresso
-microfonico della scheda audio tramite un apposito cavetto di collegamento.
-Se si usa un lettore CD, il cui segnale d'uscita Š molto pi— potente di quello
-di un microfono, Š necessario disabilitare la funzione AGC (Automatic Gain
-Control) modificando il file PARAM.DAT ed inoltre si deve regolare il volume
-di uscita della sorgente in modo da avere una buona dinamica della simulazione:
-un volume troppo alto saturerebbe i livelli di input facendo restare sempre
-accesi i fari, viceversa un volume troppo basso non sarebbe sufficiente ad
-accendere alcun faro. E' comunque possibile modificare la sensibilit…
-dell'ingresso variando il parametro MICLEV nel file PARAM.DAT.
-Se si usa un microfono come sorgente sonora Š necessario sia abilitare la
-funzione AGC sia portare al livello massimo la sensibilit… dell'ingresso
-modificando il parametro MICLEV, entrambi nel file PARAM.DAT.
-
-- MODIFICA DEI PARAMETRI NEL FILE PARAM.DAT
-Il file PARAM.DAT Š un file di testo contenente alcuni parametri
-dell'applicazione. In particolare contiene: i valori del periodo e del wcet dei
-task, la funzione AGC (0=disabilit., 1=abilit.), il valore della sensibilit…
-dell'ingresso (range 0-31 : 0=min sensibilità, 31=max sensibilità), i valori
-dell'attenuazione specifica di ogni faro espressi con un numero intero compreso
-tra 1 (minima attenuazione) e n.
-Questi ultimi valori dipendono dalla risposta in frequenza del particolare
-lettore CD o microfono che si usa: se alcune frequenze sono + o - attenuate
-di altre, alcuni fari risultano troppo luminosi e altri troppo poco. Variando
-i valori dell'attenuazione specifica di ogni faro Š possibile correggere questo
-comportamento (se un faro Š troppo acceso si deve aumentare il corrispondente
-valore di attenuazione, viceversa se Š poco luminoso, lo si deve diminuire).
-In ogni caso, prima di modificare questi parametri, si deve regolare in maniera
-ottimale il livello del volume della sorgente audio come specificato prima.
Index: rel_1_21/perf/perf2.c
===================================================================
--- rel_1_21/perf/perf2.c (revision 1217)
+++ rel_1_21/perf/perf2.c (nonexistent)
@@ -1,402 +0,0 @@
-/*
- * Project: HARTIK (HA-rd R-eal TI-me K-ernel)
- *
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
- * Gerardo Lamastra <gerardo@sssup.it>
- *
- * Authors : Paolo Gai <pj@hartik.sssup.it>
- * (see authors.txt for full list of hartik's authors)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://hartik.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: perf2.c,v 1.1 2002-11-11 08:24:49 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1 $
- Last update: $Date: 2002-11-11 08:24:49 $
- ------------
-
- Performance Test 2:
-
- This test tries to measure the time spent into the event handlers.
- It is based on test D.
-
- WARNING: the symbol __PERF_TEST2__ must be defined into the file
- kernel/config.h
-
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-
-int num_aster = 0;
-#define ASTER_LIM 60
-#define DISPLAY_MAX 15
-#define ASTER_MAX 70
-#define STAT_Y 9
-
-#define PER_MAX 5
-#define APER_MAX 8
-
-#define PER_WCET 8200
-#define APER_WCET 20400
-#define CLOCK_WCET 1600
-#define ASTER_WCET 1600
-#define SOFT_MET 3300
-
-#define APER_REP 22000
-
-PID aper_table[APER_MAX];
-
-int shutting_down = 0;
-
-TASK asteroide(void)
-{
- int i;
- int y = rand() % 7 + 1;
-
- int load1,j;
-
- char s[2];
-
- s[0] = '*'; s[1] = 0;
-
- for (;;) {
- i = 1;
- while (i < ASTER_LIM) {
- load1 = 10000; //8000 + rand()%2000;
- for (j=0; j<load1; j++) {
- s[0] = '*' + rand() % 100;
- puts_xy(i,y,rand()%15+1,s);
- }
-
- task_activate(aper_table[rand()%APER_MAX]);
- task_endcycle();
-
- puts_xy(i,y,WHITE," ");
- i++;
- }
- }
- //num_aster--;
-}
-
-TASK aper_asteroid(void *a)
-{
- int i;
- int y = rand() % 7 + 1;
-
- int load1,j;
- int c;
-
- char s[2];
-
- c = (int)a;
- s[0] = '*'; s[1] = 0;
-
- for (;;) {
- i = 1;
- while (i < ASTER_LIM) {
- load1 = APER_REP; //8000 + rand()%2000;
- for (j=0; j<load1; j++) {
- s[0] = '*' + rand() % 100;
- puts_xy(i,y,rand()%15+1,s);
- }
- s[0] = c;
- puts_xy(i,y,rand()%15+1,s);
-
- if (shutting_down) {
- kern_printf("±%d±",exec_shadow);
- return 0;
- }
-
- task_endcycle();
-
- puts_xy(i,y,WHITE," ");
- i++;
- }
- }
-}
-
-TASK soft_aster(void)
-{
- int i;
- int y = rand() % 7 + 1;
-
- int load1,j;
-
- char s[2];
-
- s[0] = '*'; s[1] = 0;
-
- /*for (;;)*/ {
- i = 1;
- while (i < ASTER_LIM) {
- load1 = 1000 + rand()%9000;
- for (j=0; j<load1; j++) {
- s[0] = '*' + rand() % 100;
- puts_xy(i,y,rand()%15+1,s);
- }
- s[0] = 1;
- puts_xy(i,y,rand()%15+1,s);
-
- task_activate(aper_table[rand()%APER_MAX]);
- task_endcycle();
-
- puts_xy(i,y,WHITE," ");
- i++;
- }
- }
- num_aster--;
- return 0;
-}
-
-TASK aster()
-{
- PID p;
-
- HARD_TASK_MODEL m;
- SOFT_TASK_MODEL m_soft;
- int r;
- int x; // adaptive bandwidth...
-
- srand(7);
-
- hard_task_default_model(m);
- hard_task_def_wcet(m,PER_WCET);
- hard_task_def_ctrl_jet(m);
- for (x=0; x<PER_MAX; x++) {
- r = (rand() % 200);
- hard_task_def_mit(m, (64+r)*1000);
- p = task_create("per",asteroide,&m,NULL);
- if (p!=-1) task_activate(p);
- }
-
- soft_task_default_model(m_soft);
- soft_task_def_met(m_soft,SOFT_MET);
- soft_task_def_ctrl_jet(m_soft);
-
- x = 64;
-
- while (1) {
- if (num_aster < ASTER_MAX) {
- r = (rand() % 200);
-
- soft_task_def_period(m_soft, (x+r)*1000);
- p = task_create("aaa",soft_aster,&m_soft,NULL);
- if (p == -1)
- {
- if (x < 500 && errno != ENO_AVAIL_TASK) x += 1;
- printf_xy(62,3,WHITE,"adapt=%3u err=%d",
- iq_query_first(&freedesc), errno);
- }
- else {
- num_aster++;
- printf_xy(62,3,WHITE,"adapt=%3u ",x);//,errno);
- task_activate(p);
- x /= 2;
- if (x<50) x = 50;
- }
- }
- task_endcycle();
- }
-}
-
-TASK clock()
-{
- int s = 0, m = 0;
-
- while(1) {
- printf_xy(62,1,WHITE,"%2d:%2d ast=%d",m,s, num_aster);
- printf_xy(62,2,WHITE,"Uedf=%12u",EDF_usedbandwidth(0));
- printf_xy(62,4,WHITE,"Ucbs=%12u",CBS_usedbandwidth(4));
- task_endcycle();
-
- if (++s > 59) {
- s = 0;
- m++;
- }
- printf_xy(62,1,WHITE,"%2d:%2d ast=%d",m,s, num_aster);
- printf_xy(62,2,WHITE,"Uedf=%12u",EDF_usedbandwidth(0));
- printf_xy(62,4,WHITE,"Ucbs=%12u",CBS_usedbandwidth(4));
- task_endcycle();
- }
-}
-
-
-
-/* we consider the first ASTER_MAX + 2 tasks from the PID 2
- and plot on the screen the elapsed times... */
-TASK jetcontrol()
-{
- int i; /* a counter */
- TIME sum, max, curr, last[5];
- int nact;
- int j; /* the elements set by jet_gettable */
- PID p;
-
-
- kern_cli();
- printf_xy(0,STAT_Y,WHITE,"PID ³ Mean T.³ Max T. ³ N.A. ³ Curr. ³ Last1 ³ Last2 ³ Last3 ³ Last4 ³ Last5");
- kern_sti();
-
- for (;;) {
- for (i=0,p=0; i<DISPLAY_MAX+5 && p<MAX_PROC; p++) {
- if (jet_getstat(p, &sum, &max, &nact, &curr) == -1 ||
- (proc_table[p].pclass & 0xFF00) == HARD_PCLASS) continue;
-
- for (j=0; j<5; j++) last[j] = 0;
- jet_gettable(p, &last[0], 5);
- kern_cli();
- if (proc_table[p].task_level == 4)
- printf_xy(0,STAT_Y+i+1,WHITE,"%-3d ³ %-6d ³ %-6d ³ %-4d ³ %-7d ³ %-5d ³ %-5d ³ %-5d ³ %-5d ³ %-5d",
- p, (int)sum/(nact==0 ? 1 : nact), (int)max, nact, (int)CBS_get_nact(4,p), (int)last[0], (int)last[1], (int)last[2], (int)last[3], (int)last[4]);
- else
- printf_xy(0,STAT_Y+i+1,WHITE,"%-3d ³ %-6d ³ %-6d ³ %-4d ³ %-7d ³ %-5d ³ %-5d ³ %-5d ³ %-5d ³ %-5d",
- p, (int)sum/(nact==0 ? 1 : nact), (int)max, nact, (int)curr, (int)last[0], (int)last[1], (int)last[2], (int)last[3], (int)last[4]);
- kern_sti();
- i++;
- }
- }
-}
-
-void fine()
-{
- sys_end();
-}
-
-void exiting(void *arg)
-{
- kern_printf("EXITING");
- shutting_down = 1;
-}
-
-TIME perftime_prol[10001];
-TIME perftime_epil[10001];
-int perftime_count = 0;
-
-void perftest_stat(void *arg)
-{
- int i;
- TIME d, sum=0, max=0;
-
- for (i=0; i<9000; i++) {
- d = perftime_epil[i]-perftime_prol[i];
- sum += d;
- if (max < d) max = d;
- kern_printf("Û%ld %ldÛ",perftime_epil[i],perftime_prol[i]);
- }
- kern_printf("\n°°° perftime_count=%u sum=%lu max=%lu °°°\n",perftime_count, sum, max);
-}
-
-int main(int argc, char **argv)
-{
- PID p1,p2,p3; //,p4,p5,p6;
- HARD_TASK_MODEL m;
-// NRT_TASK_MODEL m_nrt;
- SOFT_TASK_MODEL m_aper;
- SOFT_TASK_MODEL m_soft;
- int i;
- struct timespec fineprg;
-
- kern_cli();
-
- kern_sti();
-
- sys_atrunlevel(exiting, NULL, RUNLEVEL_SHUTDOWN);
- sys_atrunlevel(perftest_stat, NULL, RUNLEVEL_BEFORE_EXIT);
-
- hard_task_default_model(m);
- hard_task_def_wcet(m,ASTER_WCET);
- hard_task_def_mit(m,10000);
- hard_task_def_group(m,1);
- hard_task_def_ctrl_jet(m);
-
-// nrt_task_default_model(m_nrt);
-// nrt_task_def_group(m_nrt,1);
-// nrt_task_def_ctrl_jet(m_nrt);
-
- soft_task_default_model(m_soft);
- soft_task_def_met(m_soft,1000);
- soft_task_def_period(m_soft,100000);
- soft_task_def_group(m_soft,1);
- soft_task_def_ctrl_jet(m_soft);
- soft_task_def_aperiodic(m_soft);
-
-
- p1 = task_create("Aster",aster,&m,NULL);
- if (p1 == -1) {
- perror("test7.c(main): Could not create task <aster> ...");
- sys_end();
- l1_exit(-1);
- }
-
- hard_task_def_mit(m,500000);
- hard_task_def_wcet(m,CLOCK_WCET);
- p2 = task_create("Clock",clock,&m,NULL);
- if (p2 == -1) {
- perror("test7.c(main): Could not create task <Clock> ...");
- sys_end();
- l1_exit(-1);
- }
-
-// p3 = task_create("JetControl",jetcontrol,&m_nrt,NULL);
- p3 = task_create("JetControl",jetcontrol,&m_soft,NULL);
- if (p3 == -1) {
- perror("test7.c(main): Could not create task <JetControl> ...");
- sys_end();
- l1_exit(-1);
- }
-
- soft_task_default_model(m_aper);
- soft_task_def_wcet(m_aper,APER_WCET);
- soft_task_def_ctrl_jet(m_aper);
- soft_task_def_system(m_aper);
- soft_task_def_aperiodic(m_aper);
-
- for (i=0; i<APER_MAX; i++) {
- soft_task_def_level(m_aper, i/4 + 2);
- soft_task_def_arg(m_aper, (void *)(i/4 ? 'Û' : '±'));
- aper_table[i] = task_create("aper",aper_asteroid,&m_aper,NULL);
- if (aper_table[i] == -1) {
- perror("test7.c(main): Could not create task <aper> ...");
- sys_end();
- l1_exit(-1);
- }
- }
-
- task_nopreempt();
- fineprg.tv_sec = 60;
- fineprg.tv_nsec = 0;
- kern_event_post(&fineprg,fine,NULL);
- group_activate(1);
- return 0;
-}
-
Index: rel_1_21/perf/perf3.c
===================================================================
--- rel_1_21/perf/perf3.c (revision 1217)
+++ rel_1_21/perf/perf3.c (nonexistent)
@@ -1,435 +0,0 @@
-/*
- * Project: HARTIK (HA-rd R-eal TI-me K-ernel)
- *
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
- * Gerardo Lamastra <gerardo@sssup.it>
- *
- * Authors : Paolo Gai <pj@hartik.sssup.it>
- * (see authors.txt for full list of hartik's authors)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://hartik.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: perf3.c,v 1.2 2003-01-07 17:10:18 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-01-07 17:10:18 $
- ------------
-
- Performance Test 3:
-
- this test is based on test D.
-
- the test creates some random events. each event measure the difference
- beetween his activation time and thecurrent time.
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-
-int num_aster = 0;
-#define ASTER_LIM 60
-#define DISPLAY_MAX 15
-#define ASTER_MAX 70
-#define STAT_Y 9
-
-#define PER_MAX 5
-#define APER_MAX 8
-
-#define PER_WCET 8200
-#define APER_WCET 20400
-#define CLOCK_WCET 1600
-#define ASTER_WCET 1600
-#define SOFT_MET 3300
-
-#define APER_REP 22000
-
-PID aper_table[APER_MAX];
-
-int shutting_down = 0;
-
-TASK asteroide(void)
-{
- int i;
- int y = rand() % 7 + 1;
-
- int load1,j;
-
- char s[2];
-
- s[0] = '*'; s[1] = 0;
-
- for (;;) {
- i = 1;
- while (i < ASTER_LIM) {
- load1 = 10000; //8000 + rand()%2000;
- for (j=0; j<load1; j++) {
- s[0] = '*' + rand() % 100;
- puts_xy(i,y,rand()%15+1,s);
- }
-
- task_activate(aper_table[rand()%APER_MAX]);
- task_endcycle();
-
- puts_xy(i,y,WHITE," ");
- i++;
- }
- }
- //num_aster--;
-}
-
-TASK aper_asteroid(void *a)
-{
- int i;
- int y = rand() % 7 + 1;
-
- int load1,j;
- int c;
-
- char s[2];
-
- c = (int)a;
- s[0] = '*'; s[1] = 0;
-
- for (;;) {
- i = 1;
- while (i < ASTER_LIM) {
- load1 = APER_REP; //8000 + rand()%2000;
- for (j=0; j<load1; j++) {
- s[0] = '*' + rand() % 100;
- puts_xy(i,y,rand()%15+1,s);
- }
- s[0] = c;
- puts_xy(i,y,rand()%15+1,s);
-
- if (shutting_down) {
- kern_printf("±%d±",exec_shadow);
- return 0;
- }
-
- task_endcycle();
-
- puts_xy(i,y,WHITE," ");
- i++;
- }
- }
-}
-
-TASK soft_aster(void)
-{
- int i;
- int y = rand() % 7 + 1;
-
- int load1,j;
-
- char s[2];
-
- s[0] = '*'; s[1] = 0;
-
- /*for (;;)*/ {
- i = 1;
- while (i < ASTER_LIM) {
- load1 = 1000 + rand()%9000;
- for (j=0; j<load1; j++) {
- s[0] = '*' + rand() % 100;
- puts_xy(i,y,rand()%15+1,s);
- }
- s[0] = 1;
- puts_xy(i,y,rand()%15+1,s);
-
- task_activate(aper_table[rand()%APER_MAX]);
- task_endcycle();
-
- puts_xy(i,y,WHITE," ");
- i++;
- }
- }
- num_aster--;
- return 0;
-}
-
-TASK aster()
-{
- PID p;
-
- HARD_TASK_MODEL m;
- SOFT_TASK_MODEL m_soft;
- int r;
- int x; // adaptive bandwidth...
-
- srand(7);
-
- hard_task_default_model(m);
- hard_task_def_wcet(m,PER_WCET);
- hard_task_def_ctrl_jet(m);
- for (x=0; x<PER_MAX; x++) {
- r = (rand() % 200);
- hard_task_def_mit(m, (64+r)*1000);
- p = task_create("per",asteroide,&m,NULL);
- if (p!=-1) task_activate(p);
- }
-
- soft_task_default_model(m_soft);
- soft_task_def_met(m_soft,SOFT_MET);
- soft_task_def_ctrl_jet(m_soft);
-
- x = 64;
-
- while (1) {
- if (num_aster < ASTER_MAX) {
- r = (rand() % 200);
-
- soft_task_def_period(m_soft, (x+r)*1000);
- p = task_create("aaa",soft_aster,&m_soft,NULL);
- if (p == -1)
- {
- if (x < 500 && errno != ENO_AVAIL_TASK) x += 1;
- printf_xy(62,3,WHITE,"adapt=%3u err=%d",
- iq_query_first(&freedesc), errno);
- }
- else {
- num_aster++;
- printf_xy(62,3,WHITE,"adapt=%3u ",x);//,errno);
- task_activate(p);
- x /= 2;
- if (x<50) x = 50;
- }
- }
- task_endcycle();
- }
-}
-
-TASK clock()
-{
- int s = 0, m = 0;
-
- while(1) {
- printf_xy(62,1,WHITE,"%2d:%2d ast=%d",m,s, num_aster);
- printf_xy(62,2,WHITE,"Uedf=%12u",EDF_usedbandwidth(0));
- printf_xy(62,4,WHITE,"Ucbs=%12u",CBS_usedbandwidth(4));
- task_endcycle();
-
- if (++s > 59) {
- s = 0;
- m++;
- }
- printf_xy(62,1,WHITE,"%2d:%2d ast=%d",m,s, num_aster);
- printf_xy(62,2,WHITE,"Uedf=%12u",EDF_usedbandwidth(0));
- printf_xy(62,4,WHITE,"Ucbs=%12u",CBS_usedbandwidth(4));
- task_endcycle();
- }
-}
-
-
-
-/* we consider the first ASTER_MAX + 2 tasks from the PID 2
- and plot on the screen the elapsed times... */
-TASK jetcontrol()
-{
- int i; /* a counter */
- TIME sum, max, curr, last[5];
- int nact;
- int j; /* the elements set by jet_gettable */
- PID p;
-
-
- kern_cli();
- printf_xy(0,STAT_Y,WHITE,"PID ³ Mean T.³ Max T. ³ N.A. ³ Curr. ³ Last1 ³ Last2 ³ Last3 ³ Last4 ³ Last5");
- kern_sti();
-
- for (;;) {
- for (i=0,p=0; i<DISPLAY_MAX+5 && p<MAX_PROC; p++) {
- if (jet_getstat(p, &sum, &max, &nact, &curr) == -1 ||
- ((proc_table[p].pclass & 0xFF00) == HARD_PCLASS)) continue;
-
- for (j=0; j<5; j++) last[j] = 0;
- jet_gettable(p, &last[0], 5);
- kern_cli();
- if (proc_table[p].task_level == 4)
- printf_xy(0,STAT_Y+i+1,WHITE,"%-3d ³ %-6d ³ %-6d ³ %-4d ³ %-7d ³ %-5d ³ %-5d ³ %-5d ³ %-5d ³ %-5d",
- p, (int)sum/(nact==0 ? 1 : nact), (int)max, nact, (int)CBS_get_nact(4,p), (int)last[0], (int)last[1], (int)last[2], (int)last[3], (int)last[4]);
- else
- printf_xy(0,STAT_Y+i+1,WHITE,"%-3d ³ %-6d ³ %-6d ³ %-4d ³ %-7d ³ %-5d ³ %-5d ³ %-5d ³ %-5d ³ %-5d",
- p, (int)sum/(nact==0 ? 1 : nact), (int)max, nact, (int)curr, (int)last[0], (int)last[1], (int)last[2], (int)last[3], (int)last[4]);
- kern_sti();
- i++;
- }
- }
-}
-
-void fine()
-{
- sys_end();
-}
-
-void exiting(void *arg)
-{
- kern_printf("EXITING");
- shutting_down = 1;
-}
-
-
-
-
-
-struct timespec last_random_time;
-TIME max=0;
-TIME sum=0;
-int n=0;
-
-void random_event(void *arg)
-{
- struct timespec t, sub;
- TIME delta;
-
- // get the current time
- kern_gettime(&t);
-
- // compute the delta
- SUBTIMESPEC(&t, &last_random_time, &sub);
- delta = TIMESPEC2USEC(&sub);
-
- // update the statistics
- if (max < delta) max = delta;
- sum += delta;
- n++;
-
-/* kern_printf("sub=%d.%d t=%d.%d last=%d.%d °\n",sub.tv_sec, sub.tv_nsec/1000,
- t.tv_sec, t.tv_nsec/1000,
- last_random_time.tv_sec, last_random_time.tv_nsec/1000);
-*/ //return;
- // create a new event
- if (shutting_down)
- return;
-
- delta = (rand()%30000)+100;
- ADDUSEC2TIMESPEC(delta, &t);
- TIMESPEC_ASSIGN(&last_random_time, &t);
- kern_event_post(&last_random_time, random_event, NULL);
-}
-
-void perftest_printdata(void *arg)
-{
- kern_printf("\n°°° max=%ld sum=%ld n=%d °°°",max,sum,n);
-}
-
-int main(int argc, char **argv)
-{
- PID p2; //p1,p3; //,p4,p5,p6;
- HARD_TASK_MODEL m;
-// NRT_TASK_MODEL m_nrt;
- // SOFT_TASK_MODEL m_aper;
- SOFT_TASK_MODEL m_soft;
- int i;
- struct timespec fineprg;
-
- sys_atrunlevel(exiting, NULL, RUNLEVEL_SHUTDOWN);
- sys_atrunlevel(perftest_printdata, NULL, RUNLEVEL_BEFORE_EXIT);
-
- kern_printf("\n\n");
-
- srand(1234);
- NULL_TIMESPEC(&last_random_time);
- i = rand()%30000+2000;
- ADDUSEC2TIMESPEC(i, &last_random_time);
-// last_random_time.tv_sec = 2;
-// last_random_time.tv_nsec = 0;
- kern_cli();
- kern_event_post(&last_random_time, random_event, NULL);
- kern_sti();
-
- hard_task_default_model(m);
- hard_task_def_wcet(m,ASTER_WCET);
- hard_task_def_mit(m,10000);
- hard_task_def_group(m,1);
- hard_task_def_ctrl_jet(m);
-
-// nrt_task_default_model(m_nrt);
-// nrt_task_def_group(m_nrt,1);
-// nrt_task_def_ctrl_jet(m_nrt);
-
- soft_task_default_model(m_soft);
- soft_task_def_met(m_soft,1000);
- soft_task_def_period(m_soft,100000);
- soft_task_def_group(m_soft,1);
- soft_task_def_ctrl_jet(m_soft);
- soft_task_def_aperiodic(m_soft);
-
-/*
- p1 = task_create("Aster",aster,&m,NULL);
- if (p1 == -1) {
- perror("test7.c(main): Could not create task <aster> ...");
- sys_end();
- l1_exit(-1);
- }
-*/
- hard_task_def_mit(m,500000);
- hard_task_def_wcet(m,CLOCK_WCET);
- p2 = task_create("Clock",clock,&m,NULL);
- if (p2 == -1) {
- perror("test7.c(main): Could not create task <Clock> ...");
- sys_end();
- l1_exit(-1);
- }
-/*
-// p3 = task_create("JetControl",jetcontrol,&m_nrt,NULL);
- p3 = task_create("JetControl",jetcontrol,&m_soft,NULL);
- if (p3 == -1) {
- perror("test7.c(main): Could not create task <JetControl> ...");
- sys_end();
- l1_exit(-1);
- }
-
- soft_task_default_model(m_aper);
- soft_task_def_wcet(m_aper,APER_WCET);
- soft_task_def_ctrl_jet(m_aper);
- soft_task_def_system(m_aper);
- soft_task_def_aperiodic(m_aper);
-
- for (i=0; i<APER_MAX; i++) {
- soft_task_def_level(m_aper, i/4 + 2);
- soft_task_def_arg(m_aper, (void *)(i/4 ? 'Û' : '±'));
- aper_table[i] = task_create("aper",aper_asteroid,&m_aper,NULL);
- if (aper_table[i] == -1) {
- perror("test7.c(main): Could not create task <aper> ...");
- sys_end();
- l1_exit(-1);
- }
- }
-*/
- task_nopreempt();
- fineprg.tv_sec = 6;
- fineprg.tv_nsec = 0;
- kern_event_post(&fineprg,fine,NULL);
- group_activate(1);
- return 0;
-}
-
Index: rel_1_21/perf/perf4.c
===================================================================
--- rel_1_21/perf/perf4.c (revision 1217)
+++ rel_1_21/perf/perf4.c (nonexistent)
@@ -1,112 +0,0 @@
-/*
- * Project: HARTIK (HA-rd R-eal TI-me K-ernel)
- *
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
- * Gerardo Lamastra <gerardo@sssup.it>
- *
- * Authors : Paolo Gai <pj@hartik.sssup.it>
- * (see authors.txt for full list of hartik's authors)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://hartik.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: perf4.c,v 1.1 2002-11-11 08:24:49 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1 $
- Last update: $Date: 2002-11-11 08:24:49 $
- ------------
-
- Performance test 1:
-
- there is one RR task that is preempted N_EDF times by an EDF task.
-
- the test prints the differences of the execution time.
-
- the test have to be compiled with the one shot timer, and it does not
- use any init file.
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-#include "modules/pi.h"
-
-#define TIMESPEC_N 100
-#define RR_N 1000000000
-#define EDF_N 2500
-
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- RR_register_level(1000*1000*1000, RR_MAIN_NO, mb);
- RR_register_level(10000, RR_MAIN_YES, mb);
- dummy_register_level();
-
- PI_register_module();
-
- return 1200;
-}
-
-void *crash_RR(void *arg);
-void *crash_EDF(void *arg);
-
-void *__init__(void *arg)
-{
- TIME t1, t2;
- PI_mutexattr_t a;
- mutex_t m1;
- int i;
-
- PI_mutexattr_default(a);
-
- mutex_init(&m1, &a);
-
- t1 = sys_gettime(NULL);
- for (i=0; i<1000; i++) {
- mutex_lock(&m1);
- mutex_unlock(&m1);
- }
- t2 = sys_gettime(NULL);
-
- kern_printf("t1=%ld, t2=%ld\n",t1,t2);
-
- return 0;
-}
-
-// not used !!!
-int main(int argc, char **argv)
-{
- return 0;
-}
Index: rel_1_21/perf/initfile.c
===================================================================
--- rel_1_21/perf/initfile.c (revision 1217)
+++ rel_1_21/perf/initfile.c (nonexistent)
@@ -1,133 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: initfile.c,v 1.1 2002-11-11 08:24:49 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1 $
- Last update: $Date: 2002-11-11 08:24:49 $
- ------------
-
- System initialization file
-
- The tick is set to TICK ms.
-
- This file contains the 2 functions needed to initialize the system.
-
- These functions register the following levels:
-
- an EDF (Earliest Deadline First) level
- a RR (Round Robin) level
- a TBS (Total Bandwidth Server) level 0.1 Us
- a TBS (Total Bandwidth Server) level 0.3 Us
- a CBS (Constant Bandwidth Server) level
- a Dummy level
-
- The TBS bandwidth is TBS_NUM/TBS_DEN
-
-
- It can accept these task models (into () the mandatory fields):
-
- HARD_TASK_MODEL (wcet+mit) at level 0
- NRT_TASK_MODEL at level 1
- SOFT_TASK_MODEL (wcet, periodicity=APERIODIC) at level 2,3
- SOFT_TASK_MODEL (met,period) at level 4
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/rr.h"
-#include "modules/tbs.h"
-#include "modules/cbs.h"
-#include "modules/rrsoft.h"
-#include "modules/dummy.h"
-#include "drivers/keyb.h"
-#include "modules/sem.h"
-#include "modules/hartport.h"
-
-/*+ sysyem tick in us +*/
-//#define TICK 300
-#define TICK 0
-
-#define RRTICK 5000
-#define TBS_NUM 1
-#define TBS_DEN 10
-
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- TBS_register_level(TBS_ENABLE_ALL, 0, TBS_NUM, TBS_DEN);
- TBS_register_level(TBS_ENABLE_ALL, 0, TBS_NUM*3, TBS_DEN);
- CBS_register_level(CBS_ENABLE_ALL, 0);
-
-/* RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_HARD);
- RR_register_level(RRTICK, RR_MAIN_NO, mb);
- RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_SOFT); //cbs
- RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_SOFT); //tbs
- RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_SOFT); //tbs
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
-*/
-
- dummy_register_level();
-
- SEM_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- HARTPORT_init();
-
-// KEYB_init(NULL);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
Index: rel_1_21/perf/readme
===================================================================
--- rel_1_21/perf/readme (revision 1217)
+++ rel_1_21/perf/readme (nonexistent)
@@ -1,10 +0,0 @@
-Hi,
-
-these are some performance tests that I used to get some rough values
-for my master thesis.
-
-For more informations, please look on the S.Ha.R.K. website.
-
-Enjoy,
-
-PJ
Index: rel_1_21/perf/makefile
===================================================================
--- rel_1_21/perf/makefile (revision 1217)
+++ rel_1_21/perf/makefile (nonexistent)
@@ -1,22 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS+= perf1 perf2 perf3 perf4
-
-include $(BASE)/config/example.mk
-
-perf1:
- make -f $(SUBMAKE) BASE=$(BASE) APP=perf1 INIT= OTHEROBJS= SHARKOPT=__OLDCHAR__
-perf2:
- make -f $(SUBMAKE) BASE=$(BASE) APP=perf2 INIT= OTHEROBJS=initfile.o SHARKOPT=__OLDCHAR__
-perf3:
- make -f $(SUBMAKE) BASE=$(BASE) APP=perf3 INIT= OTHEROBJS=initfile.o SHARKOPT=__OLDCHAR__
-perf4:
- make -f $(SUBMAKE) BASE=$(BASE) APP=perf4 INIT= OTHEROBJS= SHARKOPT=__OLDCHAR__
-
Index: rel_1_21/perf/perf1.c
===================================================================
--- rel_1_21/perf/perf1.c (revision 1217)
+++ rel_1_21/perf/perf1.c (nonexistent)
@@ -1,187 +0,0 @@
-/*
- * Project: HARTIK (HA-rd R-eal TI-me K-ernel)
- *
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
- * Gerardo Lamastra <gerardo@sssup.it>
- *
- * Authors : Paolo Gai <pj@hartik.sssup.it>
- * (see authors.txt for full list of hartik's authors)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://hartik.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: perf1.c,v 1.2 2003-01-07 17:10:18 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-01-07 17:10:18 $
- ------------
-
- Performance test 1:
-
- there is one RR task that is preempted N_EDF times by an EDF task.
-
- the test prints the differences of the execution time.
-
- the test have to be compiled with the one shot timer, and it does not
- use any init file.
-
- NOTE: after the task_sleep() removal, the test may be "not so correct".
- That is because also the task end is accounted into the EDF time.
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#define TIMESPEC_N 100
-#define RR_N 1000000000
-#define EDF_N 2500
-
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- RR_register_level(1000*1000*1000, RR_MAIN_NO, mb);
- RR_register_level(10000, RR_MAIN_YES, mb);
- dummy_register_level();
-
- return 300;
-}
-
-void *crash_RR(void *arg);
-void *crash_EDF(void *arg);
-
-void *__init__(void *arg)
-{
- int i;
-
- PID p1,p2;
-
- HARD_TASK_MODEL m_hard;
- NRT_TASK_MODEL m_nrt;
-
- TIME t[TIMESPEC_N];
-
- // JET data
- TIME sum, max, curr;
- int nact;
-
-
-
- hard_task_default_model(m_hard);
- hard_task_def_mit (m_hard,2000);
- hard_task_def_wcet (m_hard,1000);
- hard_task_def_group (m_hard,1);
- hard_task_def_ctrl_jet (m_hard);
-
- nrt_task_default_model (m_nrt);
- nrt_task_def_group (m_nrt,1);
- nrt_task_def_ctrl_jet (m_nrt);
-
- p1 = task_create("crash_EDF",crash_EDF,&m_hard,NULL);
- if (p1 == -1) {
- perror("Could not create task <crask_EDF> ...");
- sys_end();
- }
-
- p2 = task_create("crash_RR",crash_RR,&m_nrt,NULL);
- if (p2 == -1) {
- perror("Could not create task <crask_RR> ...");
- sys_end();
- }
-
- kern_cli();
- /* timespec read time */
- for (i=0; i<TIMESPEC_N; i++) {
- t[i] = kern_gettime(NULL);
- }
- kern_sti();
-
- kern_printf("\n");
- for (i=0; i<TIMESPEC_N; i++) {
- kern_printf("%d: %ld Û", i, t[i]);
- }
- kern_printf("\n");
-
- task_activate(p2);
-
- jet_getstat(p2, &sum, &max, &nact, &curr);
- kern_printf("RR test (alone): sum=%ld, max=%ld, nact=%d, curr=%ld\n",
- sum, max, nact, curr);
- jet_delstat(p2);
-
- group_activate(1);
-
- jet_getstat(p2, &sum, &max, &nact, &curr);
- kern_printf("\nRR test : sum=%ld, max=%ld, nact=%d, curr=%ld\n",
- sum, max, nact, curr);
- jet_getstat(p1, &sum, &max, &nact, &curr);
- kern_printf("EDF test : sum=%ld, max=%ld, nact=%d, curr=%ld\n",
- sum, max, nact, curr);
-
- sys_end();
-
- return 0;
-}
-
-void *crash_RR(void *arg)
-{
- int i;
-
- for (;;) {
- for (i=0; i<RR_N; i++);
- task_endcycle();
- }
- return 0;
-}
-
-void *crash_EDF(void *arg)
-{
- int i;
-
- for (i=0; i<EDF_N; i++)
- task_endcycle();
-
- return 0;
-}
-
-// not used!!!
-int main(int argc, char **argv)
-{
- return 0;
-}
-
-
-
-
Index: rel_1_21/pse51/makefile
===================================================================
--- rel_1_21/pse51/makefile (revision 1217)
+++ rel_1_21/pse51/makefile (nonexistent)
@@ -1,25 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS+= ptest1 ptest2 ptest3 ptest4 ptest5 ptest6
-
-include $(BASE)/config/example.mk
-
-ptest1:
- make -f $(SUBMAKE) APP=ptest1 INIT= OTHEROBJS="pinit.o" SHARKOPT=__OLDCHAR__
-ptest2:
- make -f $(SUBMAKE) APP=ptest2 INIT= OTHEROBJS="pinit.o" SHARKOPT=__OLDCHAR__
-ptest3:
- make -f $(SUBMAKE) APP=ptest3 INIT= OTHEROBJS="pinit.o" SHARKOPT=__OLDCHAR__
-ptest4:
- make -f $(SUBMAKE) APP=ptest4 INIT= OTHEROBJS="pinit.o" SHARKOPT=__OLDCHAR__
-ptest5:
- make -f $(SUBMAKE) APP=ptest5 INIT= OTHEROBJS="pinit.o" SHARKOPT=__OLDCHAR__
-ptest6:
- make -f $(SUBMAKE) APP=ptest6 INIT= OTHEROBJS="pinit.o" SHARKOPT=__OLDCHAR__
Index: rel_1_21/pse51/ptest1.c
===================================================================
--- rel_1_21/pse51/ptest1.c (revision 1217)
+++ rel_1_21/pse51/ptest1.c (nonexistent)
@@ -1,221 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: ptest1.c,v 1.1.1.1 2002-09-02 09:37:47 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:47 $
- ------------
-
- Posix test 1:
-
- the main task create 4 tasks, J1, J2, J3, J4
- at t = 0.2 sec. it raise a signal to J1
- at t = 0.4 sec. it raise a signal to J2
- at t = 0.8 sec. it kill J4
-
- J1: it simply calls sigwait
-
- J2: it simply calls sigwaitinfo
-
- J3: it simply calls sigtimedwait with a timeout of 0.5 sec.
-
- J4: it simply calls sigtimedwait with a -long- timeout
- (J4 will be killed by main)
-
- non standard function used:
- cprintf
- sys_gettime
- keyboard stuffs
- sys_end
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <sys/types.h>
-#include <pthread.h>
-#include <signal.h>
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-
-void *J1(void *arg)
-{
- int sig, err;
- sigset_t mask;
-
- cprintf("J1 starts and call sigwait(31)\n");
-
- sigemptyset(&mask);
- sigaddset(&mask,31);
- err = sigwait(&mask,&sig);
-
- cprintf("J1 exit from sigwait(), err=%d, sig=%d\n", err, sig);
-
- return 0;
-}
-
-void *J2(void *arg)
-{
- int err;
- siginfo_t info;
- sigset_t mask;
-
- cprintf("J2 starts and call sigwaitinfo(30)\n");
-
- sigemptyset(&mask);
- sigaddset(&mask,30);
- err = sigwaitinfo(&mask,&info);
-
- cprintf("J2 exit from sigwaitinfo(), err=%d, signo=%d code=%d value=%d\n",
- err, info.si_signo, info.si_code, info.si_value.sival_int);
-
- return 0;
-}
-
-void *J3(void *arg)
-{
- int err;
- siginfo_t info;
- sigset_t mask;
- struct timespec t;
-
- cprintf("J3 starts and call sigtimedwait(29)\n");
-
- sigemptyset(&mask);
- sigaddset(&mask,29);
- t.tv_sec = 0;
- t.tv_nsec = 300000000;
- err = sigtimedwait(&mask,&info,&t);
-
- cprintf("J3 exit from sigtimedwait(), err=%d, signo=%d code=%d value=%d\n",
- err, info.si_signo, info.si_code, info.si_value.sival_int);
-
- return 0;
-}
-
-void uscitaJ4(void *arg)
-{
- cprintf("J4: AAAARRRRGGGHHH!!! killed by someone...\n");
-}
-
-void *J4(void *arg)
-{
- int err;
- siginfo_t info;
- sigset_t mask;
- struct timespec t;
-
- cprintf("J4 starts and call sigtimedwait(28)\n");
-
- sigemptyset(&mask);
- sigaddset(&mask,28);
- t.tv_sec = 10;
- t.tv_nsec = 0;
-
- pthread_cleanup_push(uscitaJ4,NULL);
- err = sigtimedwait(&mask,&info,&t);
- pthread_cleanup_pop(0);
-
- cprintf("J4 exit from sigtimedwait(), err=%d, signo=%d code=%d value=%d\n",
- err, info.si_signo, info.si_code, info.si_value.sival_int);
-
- return 0;
-}
-
-void fine(KEY_EVT *e)
-{
- sys_end();
-}
-
-
-int main(int argc, char **argv)
-{
- int err;
- sigset_t mask;
- pthread_t j1, j2, j3, j4;
- union sigval value;
-
- KEY_EVT emerg;
- //keyb_set_map(itaMap);
- emerg.ascii = 'x';
- emerg.scan = KEY_X;
- emerg.flag = ALTL_BIT;
- keyb_hook(emerg,fine);
-
-
- /* main blocks signals for all the tasks */
- sigfillset(&mask);
- pthread_sigmask(SIG_BLOCK, &mask, NULL);
-
- cprintf("main: creating J1\n");
- err = pthread_create(&j1, NULL, J1, NULL);
- if (err) cprintf("Error creating J1\n");
-
- cprintf("main: creating J2\n");
- err = pthread_create(&j2, NULL, J2, NULL);
- if (err) cprintf("Error creating J2\n");
-
- cprintf("main: creating J3\n");
- err = pthread_create(&j3, NULL, J3, NULL);
- if (err) cprintf("Error creating J3\n");
-
- cprintf("main: creating J4\n");
- err = pthread_create(&j4, NULL, J4, NULL);
- if (err) cprintf("Error creating J4\n");
-
- cprintf("main: waiting 0.2 sec\n");
- while (sys_gettime(NULL) < 200000);
-
- cprintf("main: kill(31), then wait until t=0.4 sec \n");
- kill(0, 31);
-
- while (sys_gettime(NULL) < 400000);
- cprintf("main: sigqueue(30), then wait until t=0.8 sec \n");
- value.sival_int = 300;
- sigqueue(0, 30, value);
-
- while (sys_gettime(NULL) < 800000);
- cprintf("main: kill(J4)\n");
- pthread_cancel(j4);
-
- cprintf("main: ending...\n");
-
- return 0;
-}
Index: rel_1_21/pse51/ptest2.c
===================================================================
--- rel_1_21/pse51/ptest2.c (revision 1217)
+++ rel_1_21/pse51/ptest2.c (nonexistent)
@@ -1,152 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: ptest2.c,v 1.1.1.1 2002-09-02 09:37:47 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:47 $
- ------------
-
- Posix test 2:
-
- pthread_once + thread_specific_data
-
- the main task:
- creates a key
- creates 2 tasks, J1, J2
- at t = 0.4 sec. it kills J1 and J2
-
- J1 and J2 will set and check the thread specific data
- and when the die, a destructor is called (twice, because the value
- is not set to null...)
-
- non standard function used:
- cprintf
- sys_gettime
- keyboard stuffs
- sys_end
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <sys/types.h>
-#include <pthread.h>
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-
-pthread_key_t prova_key;
-
-pthread_once_t once = PTHREAD_ONCE_INIT;
-
-void once_init()
-{
- cprintf("ONCE: (pid=%d)\n", exec_shadow);
-}
-
-void destr_key(void *arg)
-{
- cprintf("J (pid=%d) destructor called with value %d\n", exec_shadow,(int)arg);
- pthread_setspecific(prova_key,(void *)((int)arg/100));
-}
-
-void print_test()
-{
- int val;
-
- val = (int)pthread_getspecific(prova_key);
- cprintf("J (pid=%d) printtest value=%d\n", exec_shadow, val);
-}
-
-void *J(void *arg)
-{
- pthread_once(&once, once_init);
- cprintf("J (pid=%d) starts and call setspecific\n", exec_shadow);
- pthread_setspecific(prova_key,arg);
- print_test();
- cprintf("J (pid=%d) exits\n", exec_shadow);
-
- return 0;
-}
-
-void fine(KEY_EVT *e)
-{
- sys_end();
-}
-
-
-int main(int argc, char **argv)
-{
- int err;
- pthread_t j1, j2;
-
- KEY_EVT emerg;
- //keyb_set_map(itaMap);
- emerg.ascii = 'x';
- emerg.scan = KEY_X;
- emerg.flag = ALTL_BIT;
- keyb_hook(emerg,fine);
-
-
- cprintf("main: creating prova_key\n");
- pthread_key_create(&prova_key, destr_key);
-
- cprintf("main: provakey =%d\n", prova_key);
-
- cprintf("main: creating J1\n");
- err = pthread_create(&j1, NULL, J, (void *)1414);
- if (err) cprintf("Error creating J1\n");
- cprintf("main: J1 has PID %d\n",j1);
-
- cprintf("main: creating J2\n");
- err = pthread_create(&j2, NULL, J, (void *)3141);
- if (err) cprintf("Error creating J2\n");
- cprintf("main: J2 has PID %d\n",j2);
-
- cprintf("main: waiting 0.4 sec\n");
- while (sys_gettime(NULL) < 400000);
-
- cprintf("main: kill J1 and J2\n");
- pthread_cancel(j1);
- pthread_cancel(j2);
-
- cprintf("main: ending...\n");
-
- return 0;
-}
Index: rel_1_21/pse51/ptest3.c
===================================================================
--- rel_1_21/pse51/ptest3.c (revision 1217)
+++ rel_1_21/pse51/ptest3.c (nonexistent)
@@ -1,229 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: ptest3.c,v 1.1.1.1 2002-09-02 09:37:47 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:47 $
- ------------
-
- Posix test 3:
-
- timers...
- it creates two periodic timers that queues signals, a periodic timer
- that create tasks and an one-shot timer.
-
- non standard function used:
- cprintf
- sys_gettime
- keyboard stuffs
- sys_end
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <sys/types.h>
-#include <pthread.h>
-#include <time.h>
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-
-int count25 = 0, count26 = 0;
-
-void signal_handler(int signo, siginfo_t *info, void *extra)
-{
- switch (signo) {
- case 25:
- count25++;
- break;
- case 26:
- count26++;
- break;
- }
-
- cprintf("Signal %d code=%s value=%d task=%d count25=%d count26=%d time=%ldusec\n",
- info->si_signo,
- (info->si_code == SI_TIMER) ? "Timer" : "Other",
- info->si_value.sival_int,
- info->si_task,
- count25,
- count26,
- sys_gettime(NULL));
-}
-
-void fine(KEY_EVT *e)
-{
- sys_end();
-}
-
-void task_timer(union sigval value)
-{
- cprintf("task_timer: value = %d, time = %ldusec\n",
- value.sival_int, sys_gettime(NULL));
-}
-
-int main(int argc, char **argv)
-{
- int err;
- timer_t timer1, timer2, timer3;
- struct itimerspec timeout1, timeout2, timeout3, nulltimeout;
- struct sigaction sig_act;
- struct sigevent ev25, ev26, evtask;
- pthread_attr_t task_attr;
- struct sched_param task_param;
-
- KEY_EVT emerg;
- //keyb_set_map(itaMap);
- emerg.ascii = 'x';
- emerg.scan = KEY_X;
- emerg.flag = ALTL_BIT;
- keyb_hook(emerg,fine);
-
- sig_act.sa_sigaction = (void *) signal_handler;
- sig_act.sa_flags = SA_SIGINFO;
- sigemptyset(&sig_act.sa_mask);
-
- sigaction(25, &sig_act, NULL);
- sigaction(26, &sig_act, NULL);
-
- // set ev25, ev26, evtask
- ev25.sigev_notify = SIGEV_SIGNAL;
- ev25.sigev_signo = 25;
- ev25.sigev_value.sival_int = 555;
-
- ev26.sigev_notify = SIGEV_SIGNAL;
- ev26.sigev_signo = 26;
- ev26.sigev_value.sival_int = 666;
-
- evtask.sigev_notify = SIGEV_THREAD;
- evtask.sigev_value.sival_int = 777;
- evtask.sigev_notify_function = task_timer;
- evtask.sigev_notify_attributes = &task_attr;
-
- pthread_attr_init(&task_attr);
- pthread_attr_setdetachstate(&task_attr, PTHREAD_CREATE_DETACHED);
- pthread_attr_setschedpolicy(&task_attr, SCHED_FIFO);
- task_param.sched_priority = 10;
- pthread_attr_setschedparam(&task_attr, &task_param);
-
- // set timeout1, timeout2, nulltimeout
- timeout1.it_interval.tv_sec = 0;
- timeout1.it_interval.tv_nsec = 500000000;
- timeout1.it_value.tv_sec = 3;
- timeout1.it_value.tv_nsec = 0;
-
- timeout2.it_interval.tv_sec = 0;
- timeout2.it_interval.tv_nsec = 200000000;
- timeout2.it_value.tv_sec = 7;
- timeout2.it_value.tv_nsec = 0;
-
- timeout3.it_interval.tv_sec = 0;
- timeout3.it_interval.tv_nsec = 300000000;
- timeout3.it_value.tv_sec = 5;
- timeout3.it_value.tv_nsec = 0;
-
- NULL_TIMESPEC(&nulltimeout.it_value);
- NULL_TIMESPEC(&nulltimeout.it_interval);
-
- // create the timers
- err = timer_create(CLOCK_REALTIME, &ev25, &timer1);
- if (err == -1) { cprintf("main: unable to create timer 1\n"); }
-
- err = timer_create(CLOCK_REALTIME, &ev26, &timer2);
- if (err == -1) { cprintf("main: unable to create timer 2\n"); }
-
- err = timer_create(CLOCK_REALTIME, &evtask, &timer3);
- if (err == -1) { cprintf("main: unable to create timer 3\n"); }
-
- // arm the timers
- err = timer_settime(timer1, TIMER_ABSTIME, &timeout1, NULL);
- if (err == -1) { cprintf("main: unable to set timer 1\n"); }
-
- err = timer_settime(timer2, 0, &timeout2, NULL);
- if (err == -1) { cprintf("main: unable to set timer 2\n"); }
-
- err = timer_settime(timer3, TIMER_ABSTIME, &timeout3, NULL);
- if (err == -1) { cprintf("main: unable to set timer 3\n"); }
-
- cprintf("main: waiting signals...\n");
- while (sys_gettime(NULL) < 8500000) {
- //kern_deliver_pending_signals();
- }
-
- cprintf("main: disarm the timer2\n");
- err = timer_settime(timer2, 0, &nulltimeout, &timeout2);
- if (err == -1) { cprintf("main: unable to disarm timer 2\n"); }
-
- cprintf("main: timer2 disarmed, itvalue=%ld.%ld\n",
- timeout2.it_value.tv_sec,timeout2.it_value.tv_nsec/1000);
-
- while (sys_gettime(NULL) < 10000000) {
- //kern_deliver_pending_signals();
- }
-
- cprintf("main: disarm the timer1\n");
- err = timer_settime(timer1, TIMER_ABSTIME, &nulltimeout, &timeout1);
- if (err == -1) { cprintf("main: unable to disarm timer 1\n"); }
-
- cprintf("main: timer1 disarmed, itvalue=%ld.%ld\n",
- timeout1.it_value.tv_sec,timeout1.it_value.tv_nsec/1000);
-
- while (sys_gettime(NULL) < 12000000) {
- //kern_deliver_pending_signals();
- }
-
- cprintf("main: arm timer1\n");
- timeout1.it_interval.tv_sec = 0;
- timeout1.it_interval.tv_nsec = 0;
- timeout1.it_value.tv_sec = 13;
- timeout1.it_value.tv_nsec = 0;
- err = timer_settime(timer1, TIMER_ABSTIME, &timeout1, NULL);
- if (err == -1) { cprintf("main: unable to arm timer 1\n"); }
-
- while (sys_gettime(NULL) < 14000000) {
- //kern_deliver_pending_signals();
- }
-
-
-
- cprintf("main: ending...\n");
-
- return 0;
-}
Index: rel_1_21/pse51/pinit.c
===================================================================
--- rel_1_21/pse51/pinit.c (revision 1217)
+++ rel_1_21/pse51/pinit.c (nonexistent)
@@ -1,126 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: pinit.c,v 1.2 2003-10-07 09:30:18 giacomo Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-10-07 09:30:18 $
- ------------
-
- This is a minimal initialization file for the PSE51 profile.
-
- It initializes the POSIX scheduler, the Hartik Ports and the Keyboard driver.
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-
-#include "kernel/kern.h"
-#include "modules/posix.h"
-#include "modules/dummy.h"
-
-#include "modules/pi.h"
-#include "modules/pc.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-
-#include "drivers/keyb.h"
-
-#include "pthread.h"
-#include "time.h"
-
-
-/*+ sysyem tick in us +*/
-#define TICK 1000
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- POSIX_register_level(RRTICK, POSIX_MAIN_YES, mb, 32);
- dummy_register_level();
-
- PI_register_module();
- PC_register_module();
-
- SEM_register_module();
-
- /* for the Pthread library */
- PTHREAD_register_module(0, 0, 1);
-
- /* for the real time clock extensions */
- TIMER_register_module();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
- NRT_TASK_MODEL m; // the scheduling model for the Keyboard
-
- KEYB_PARMS k = BASE_KEYB;
- keyb_def_task(k, &m);
-
- nrt_task_default_model(m);
- nrt_task_def_arg(m,arg);
- nrt_task_def_usemath(m);
- nrt_task_def_ctrl_jet(m);
- nrt_task_def_save_arrivals(m);
- nrt_task_def_unjoinable(m);
- nrt_task_def_weight(m, sched_get_priority_max(SCHED_RR));
- nrt_task_def_policy(m,SCHED_RR);
- nrt_task_def_inherit(m,PTHREAD_EXPLICIT_SCHED);
- nrt_task_def_nokill(m);
- nrt_task_def_system(m);
-
- HARTPORT_init();
-
- if (KEYB_init(&k) < 0)
- kern_printf("Error during Keyboard Initialization!!!");
-
- __call_main__(mb);
-
- return (void *)0;
-}
Index: rel_1_21/pse51/ptest4.c
===================================================================
--- rel_1_21/pse51/ptest4.c (revision 1217)
+++ rel_1_21/pse51/ptest4.c (nonexistent)
@@ -1,151 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: ptest4.c,v 1.1.1.1 2002-09-02 09:37:47 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:47 $
- ------------
-
- Posix test 4:
-
- the main task create 3 tasks, J1, J2, J3
- at t = 1 sec. it raise a signal to J1
- at t = 2 sec. it kills J2
-
- J1,J2,J3: it simply calls nanosleep
-
- non standard function used:
- cprintf
- sys_gettime
- keyboard stuffs
- sys_end
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <sys/types.h>
-#include <pthread.h>
-#include <signal.h>
-#include <time.h>
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-
-void uscitaJ(void *arg)
-{
- cprintf("J: (pid=%d) AAAARRRRGGGHHH!!! killed by someone...\n", exec_shadow);
-}
-
-void *J(void *arg)
-{
- struct timespec t1, t2;
- int err;
-
- cprintf("J (pid=%d) starts and call nanosleep\n",exec_shadow);
-
- t1.tv_sec = 3;
- t1.tv_nsec = 0;
- NULL_TIMESPEC(&t2);
- pthread_cleanup_push(uscitaJ,NULL);
- err = nanosleep(&t1, &t2);
- pthread_cleanup_pop(0);
-
- cprintf("J (pid=%d) ending, nanosleep returns errno=%d, t2=%ld.%ld\n",
- exec_shadow, err, t2.tv_sec, t2.tv_nsec/1000);
-
- return 0;
-}
-
-void signal_handler(int signo, siginfo_t *info, void *extra)
-{
- cprintf("SIGNAL HANDLER: pid=%d\n",exec_shadow);
-}
-
-void fine(KEY_EVT *e)
-{
- sys_end();
-}
-
-
-int main(int argc, char **argv)
-{
- int err;
- pthread_t j1, j2, j3;
- struct sigaction sig_act;
-
- KEY_EVT emerg;
- //keyb_set_map(itaMap);
- emerg.ascii = 'x';
- emerg.scan = KEY_X;
- emerg.flag = ALTL_BIT;
- keyb_hook(emerg,fine);
-
- sig_act.sa_sigaction = (void *) signal_handler;
- sig_act.sa_flags = SA_SIGINFO;
- sigemptyset(&sig_act.sa_mask);
-
- sigaction(31, &sig_act, NULL);
-
- cprintf("main: creating J1\n");
- err = pthread_create(&j1, NULL, J, NULL);
- if (err) cprintf("Error creating J1\n");
-
- cprintf("main: creating J2\n");
- err = pthread_create(&j2, NULL, J, NULL);
- if (err) cprintf("Error creating J2\n");
-
- cprintf("main: creating J3\n");
- err = pthread_create(&j3, NULL, J, NULL);
- if (err) cprintf("Error creating J3\n");
-
- cprintf("main: waiting 1 sec\n");
- while (sys_gettime(NULL) < 1000000);
-
- cprintf("main: pthread_kill on j1, then wait until t=2 sec \n");
- pthread_kill(j1, 31);
-
- while (sys_gettime(NULL) < 2000000);
- cprintf("main: pthread_cancel(J2)\n");
- pthread_cancel(j2);
-
- cprintf("main: ending...\n");
-
- return 0;
-}
Index: rel_1_21/pse51/ptest5.c
===================================================================
--- rel_1_21/pse51/ptest5.c (revision 1217)
+++ rel_1_21/pse51/ptest5.c (nonexistent)
@@ -1,109 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: ptest5.c,v 1.1.1.1 2002-09-02 09:37:47 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:47 $
- ------------
-
- Posix test 5:
- an alarm test
-
- non standard function used:
- cprintf
- sys_gettime
- keyboard stuffs
- sys_end
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <sys/types.h>
-#include <pthread.h>
-#include <signal.h>
-#include <unistd.h>
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-
-
-
-void signal_handler(int signo, siginfo_t *info, void *extra)
-{
- cprintf("SIGNAL HANDLER: pid=%d\n",exec_shadow);
-}
-
-void fine(KEY_EVT *e)
-{
- sys_end();
-}
-
-
-int main(int argc, char **argv)
-{
- struct sigaction sig_act;
-
- KEY_EVT emerg;
- //keyb_set_map(itaMap);
- emerg.ascii = 'x';
- emerg.scan = KEY_X;
- emerg.flag = ALTL_BIT;
- keyb_hook(emerg,fine);
-
- sig_act.sa_sigaction = (void *) signal_handler;
- sig_act.sa_flags = SA_SIGINFO;
- sigemptyset(&sig_act.sa_mask);
-
- sigaction(SIGALRM, &sig_act, NULL);
-
- cprintf("main: alarm(5), waiting t=2 sec\n");
- alarm(5);
-
- while (sys_gettime(NULL) < 2000000);
-
- cprintf("main: alarm(3) return %d, waiting t=6 sec\n",alarm(3));
-
- pause();
-// while (sys_gettime(NULL) < 6000000);
-
- cprintf("main: ending...\n");
-
- return 0;
-}
Index: rel_1_21/pse51/ptest6.c
===================================================================
--- rel_1_21/pse51/ptest6.c (revision 1217)
+++ rel_1_21/pse51/ptest6.c (nonexistent)
@@ -1,300 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: ptest6.c,v 1.1.1.1 2002-09-02 09:37:47 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:47 $
- ------------
-
- Posix test 6:
-
- message queues
-
- main thread:
- set a sigevent to sigev_thread on a mailbox (that creates thread 2)
- creates thread 1
- waits t=3.5 sec.
- pthread_cancel(T4)
-
- thread 1:
- send a msg to the mailbox (the event fires and thread 2 is created)
-
- thread 2:
- receive the msg sent by thread 1
- set the event to a signal
- creates thread 3 and 4
- waits t = 1 sec
- send another msg
-
- thread 3:
- receive the msg sent by 2 (it blocks!)
- waits t = 2 sec
- send 5 msgs (with different priorities!!!
-
- thread 4:
- receives 5 msgs every 0.5 sec.
- then receive another message that never will arrive...
-
- non standard function used:
- cprintf
- sys_gettime
- keyboard stuffs
- sys_end
-
-**/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <sys/types.h>
-#include <pthread.h>
-#include <mqueue.h>
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-
-struct sigevent ev25, evtask;
-pthread_attr_t task_attr;
-struct sched_param task_param;
-mqd_t mq;
-pthread_t T1,T2,T3,T4,T5;
-
-#define MESSAGE_LENGTH 100
-
-void *t1(void *arg)
-{
- cprintf("T1: started, sending a message\n");
- if (mq_send(mq,"Donald Duck",12,1))
- { cprintf("T1: mq_send returns errno %d\n",errno); return 0; }
-
- cprintf("T1: ending...\n");
- return 0;
-}
-
-void *t4(void *arg);
-void *t3(void *arg);
-
-void t2(union sigval value)
-{
- ssize_t x;
- char buf[MESSAGE_LENGTH];
- int prio;
-
- cprintf("T2: value = %d, receiving a message\n", value.sival_int);
-
- x = mq_receive(mq,buf,MESSAGE_LENGTH,&prio);
-
- cprintf("T2: received message: length=%ld, prio=%d, text=°%s°, notify...\n",
- x,prio,buf);
-
- if (mq_notify(mq, &ev25))
- { cprintf("T2: mq_notify returns errno %d\n",errno); sys_end(); }
-
- cprintf("T2: waiting t = 1 sec.\n");
- while (sys_gettime(NULL)<1000000);
- cprintf("T2: 1 sec. reached, sending another message and creating T3 and T4, \n");
-
- if (mq_send(mq,"Mickey Mouse",13,1))
- { cprintf("T2: mq_send returns errno %d\n",errno); sys_end(); }
-
- pthread_create(&T3, NULL, t3, NULL);
- pthread_create(&T4, NULL, t4, NULL);
-
- cprintf("T2: ending...\n");
-}
-
-void *t3(void *arg)
-{
- ssize_t x;
- char buf[MESSAGE_LENGTH];
- int prio;
-
- cprintf("T3: waiting a message...\n");
-
- x = mq_receive(mq,buf,MESSAGE_LENGTH,&prio);
-
- // mickey mouse
- cprintf("T3: received message: length=%ld, prio=%d, text=°%s°\n",
- x,prio,buf);
-
- cprintf("T3: waiting t = 1.5 sec.\n");
- while (sys_gettime(NULL)<1500000);
- cprintf("T3: 2 sec. reached, sending 5 messages\n");
-
- if (mq_send(mq,"Goofy",6,1))
- { cprintf("T3: mq_send1 returns errno %d\n",errno); sys_end(); }
- cprintf("Û");
-
- if (mq_send(mq,"Minnie",7,1))
- { cprintf("T3: mq_send2 returns errno %d\n",errno); sys_end(); }
- cprintf("Û");
-
- if (mq_send(mq,"Pluto",6,2)) // NB: different priority!!!
- { cprintf("T3: mq_send3 returns errno %d\n",errno); sys_end(); }
- cprintf("Û");
-
- if (mq_send(mq,"Rocker Duck",12,2)) // NB: different priority!!!
- { cprintf("T3: mq_send4 returns errno %d\n",errno); sys_end(); }
- cprintf("Û");
-
- if (mq_send(mq,"Oncle Scroodge",15,2)) // NB: different priority!!!
- { cprintf("T3: mq_send5 returns errno %d\n",errno); sys_end(); }
- cprintf("Û");
-
- cprintf("T3: ending...\n");
-
- return 0;
-}
-
-void t4exit(void *arg)
-{
- cprintf("T4: AAAARRRRGGGHHH!!! killed by someone...\n");
-}
-
-void *t4(void *arg)
-{
- ssize_t x;
- char buf[MESSAGE_LENGTH];
- int prio;
-
- cprintf("T4: waiting t = 2.2 sec.\n");
-
- while (sys_gettime(NULL)<2200000);
- x = mq_receive(mq,buf,MESSAGE_LENGTH,&prio);
- cprintf("T4: received message: length=%ld, prio=%d, text=°%s°\n",x,prio,buf);
-
- while (sys_gettime(NULL)<2400000);
- x = mq_receive(mq,buf,MESSAGE_LENGTH,&prio);
- cprintf("T4: received message: length=%ld, prio=%d, text=°%s°\n",x,prio,buf);
- while (sys_gettime(NULL)<2600000);
-
- x = mq_receive(mq,buf,MESSAGE_LENGTH,&prio);
- cprintf("T4: received message: length=%ld, prio=%d, text=°%s°\n",x,prio,buf);
- while (sys_gettime(NULL)<2800000);
-
- x = mq_receive(mq,buf,MESSAGE_LENGTH,&prio);
- cprintf("T4: received message: length=%ld, prio=%d, text=°%s°\n",x,prio,buf);
- while (sys_gettime(NULL)<3000000);
-
- x = mq_receive(mq,buf,MESSAGE_LENGTH,&prio);
- cprintf("T4: received message: length=%ld, prio=%d, text=°%s°\n",x,prio,buf);
-
- pthread_cleanup_push(t4exit,NULL);
- x = mq_receive(mq,buf,MESSAGE_LENGTH,&prio);
- cprintf("T4: received message: length=%ld, prio=%d, text=°%s°\n",x,prio,buf);
- pthread_cleanup_pop(0);
-
- return 0;
-}
-
-void signal_handler(int signo, siginfo_t *info, void *extra)
-{
- cprintf("Signal %d code=%s value=%d task=%d time=%ldusec\n",
- info->si_signo,
- (info->si_code == SI_TIMER) ? "Timer" : "Other",
- info->si_value.sival_int,
- info->si_task,
- sys_gettime(NULL));
-}
-
-void fine(KEY_EVT *e)
-{
- sys_end();
-}
-
-int main(int argc, char **argv)
-{
-// int err;
- struct sigaction sig_act;
- struct mq_attr attr;
-
- KEY_EVT emerg;
- //keyb_set_map(itaMap);
- emerg.ascii = 'x';
- emerg.scan = KEY_X;
- emerg.flag = ALTL_BIT;
- keyb_hook(emerg,fine);
-
- sig_act.sa_sigaction = (void *) signal_handler;
- sig_act.sa_flags = SA_SIGINFO;
- sigemptyset(&sig_act.sa_mask);
- sigaction(25, &sig_act, NULL);
-
- // set ev25, evtask
- ev25.sigev_notify = SIGEV_SIGNAL;
- ev25.sigev_signo = 25;
- ev25.sigev_value.sival_int = 555;
-
- evtask.sigev_notify = SIGEV_THREAD;
- evtask.sigev_value.sival_int = 777;
- evtask.sigev_notify_function = t2;
- evtask.sigev_notify_attributes = &task_attr;
-
- // set pthread attributes
- pthread_attr_init(&task_attr);
- pthread_attr_setdetachstate(&task_attr, PTHREAD_CREATE_DETACHED);
- pthread_attr_setschedpolicy(&task_attr, SCHED_FIFO);
- task_param.sched_priority = 10;
- pthread_attr_setschedparam(&task_attr, &task_param);
-
- // set mqueue attributes
- attr.mq_flags = 0;
- attr.mq_maxmsg = 3;
- attr.mq_msgsize = MESSAGE_LENGTH;
-
- // create the message queue
- if ((mq = mq_open("mq", O_CREAT|O_RDWR, 0, &attr)) == -1)
- { cprintf("main: mq_open returns errno %d\n",errno); return 0; }
-
- if (mq_notify(mq, &evtask))
- { cprintf("main: mq_notify returns errno %d\n",errno); return 0; }
-
- cprintf("main: created mq, creating T1...\n");
-
- pthread_create(&T1, NULL, t1, NULL);
-
- cprintf("main: waiting t= 3.5 sec., then kill T4...\n");
-
- while (sys_gettime(NULL)<3500000);
-
- pthread_cancel(T4);
-
- cprintf("main: ending...\n");
-
- return 0;
-}
Index: rel_1_21/mix/mix.c
===================================================================
--- rel_1_21/mix/mix.c (revision 1217)
+++ rel_1_21/mix/mix.c (nonexistent)
@@ -1,761 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: mix.c,v 1.4 2003-03-24 11:18:19 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.4 $
- Last update: $Date: 2003-03-24 11:18:19 $
- ------------
-*/
-
-/*
- * Copyright (C) 2000 Giorgio Buttazzo and Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*--------------------------------------------------------------*/
-/* DEMO with 9 INDEPENDENT TASKS */
-/*--------------------------------------------------------------*/
-
-#include <kernel/kern.h>
-#include <drivers/glib.h>
-#include <drivers/keyb.h>
-#include <semaphore.h>
-#include <stdlib.h>
-#include <math.h>
-
-#define PIG 3.1415
-#define ESC 27 /* ASCII code for ESCAPE */
-#define DURATA 10000 /* counter duration in tick */
-
-#define LW 200 /* window length */
-#define HW 150 /* window height */
-#define HLOAD 30 /* Y level for the max load */
-#define LLOAD (HW-HLOAD-5) /* length for the max load */
-
-#define XWL 10 /* left X of LEFT window */
-#define XWM 220 /* left X of MIDDLE window */
-#define XWR 430 /* left X RIGHT window */
-
-#define YWH 5 /* top Y of HIGH window */
-#define YWM 165 /* top Y of MIDDLE window */
-#define YWL 325 /* top Y of LOW window */
-
-char fbuf[1000]; /* buffer for reading a file */
-int flen; /* file length */
-int fine = 0; /* ending flag */
-
-sem_t mx_mat, mx_grf; /* mutex semaphores */
-
-int wcet[10]; /* array of task wcets */
-int period[10]; /* array of task periods */
-double load(long); /* load evaluation function */
-
-PID ptas;
-char talk[5][25] = {" SHARK Demonstration ",
- " RETIS Lab -- Scuola ",
- " Superiore S. Anna ",
- " HARD REAL-TIME DEMO ",
- " June 5, 2001 "};
-
-/*------------------------------------------------------*/
-/* file reading */
-/*------------------------------------------------------*/
-
-void read_file(void)
-{
- int err;
- DOS_FILE *fp;
-
- fp = DOS_fopen("mix.dat","r");
-
- if (!fp) {
- err = DOS_error();
- cprintf("Error %d opening myfile.txt...\n", err);
- flen = 0;
- return;
- }
-
- flen = DOS_fread(&fbuf, 1, 1000, fp);
- cprintf("Read %d bytes from file\n", flen);
- DOS_fclose(fp);
-}
-
-/*------------------------------------------------------*/
-/* get data from buffer */
-/*------------------------------------------------------*/
-
-void get_par(void)
-{
- int x = 0;
- int i;
-
- for (i=1; i<=8; i++) {
- while ((fbuf[x] != ':') && (x < flen)) x++;
- x++;
- sscanf(&fbuf[x], "%d %d", &period[i], &wcet[i]);
- cprintf("per[%d] = %d, wcet[%d] = %d\n",
- i, period[i], i, wcet[i]);
- }
-}
-
-/*--------------------------------------------------------------*/
-
-void byebye()
-{
- grx_close();
- kern_printf("Bye Bye!\n");
-}
-
-/*--------------------------------------------------------------*/
-
-void finish1()
-{
- sys_end();
-}
-
-/*--------------------------------------------------------------*/
-
-void finish2()
-{
- fine = 1;
-}
-
-/****************************************************************/
-/* PROCESSO OROLOGIO */
-/****************************************************************/
-
-#define LLAN 40 /* length of watch stick */
-
-TASK watch()
-{
- int x0 = XWL + LW/2;
- int y0 = YWH + HW/2;
- int grad;
- int xg, yg;
- int xt, yt, d;
- int sec, min;
- char s[5];
- double rad, x, y;
-
- xg = x0;
- yg = y0 - LLAN;
- xt = XWL + 78;
- yt = YWH + 12;
- sec = min = 0;
-
- while (1) {
- sec = (sec + 1) % 60;
- if (sec == 0) min++;
- grad = 90 - sec * 6;
- rad = (double)grad * PIG / 180.;
-
- sem_wait(&mx_mat);
- x = (double)x0 + (double)LLAN * cos(rad);
- y = (double)y0 - (double)LLAN * sin(rad);
- sem_post(&mx_mat);
-
- sem_wait(&mx_grf);
- grx_line(x0, y0, xg, yg, 0);
- sem_post(&mx_grf);
-
- xg = x;
- yg = y;
-
- sem_wait(&mx_grf);
- grx_line(x0, y0, xg, yg, 14);
- sem_post(&mx_grf);
-
- sem_wait(&mx_grf);
- grx_text("0 :0 ", xt, yt, 14, 0);
- sprintf(s, "%d", min);
- grx_text(s, xt+8, yt, 14, 0);
- sprintf(s, "%d", sec);
- if (sec > 9) d = 24; else d = 32;
- grx_text(s, xt+d, yt, 14, 0);
- sem_post(&mx_grf);
-
- task_endcycle();
- }
-}
-
-/****************************************************************/
-/* PROCESSO DI RIEMPIMENTO */
-/****************************************************************/
-
-#define CIMA (YWH+5) /* fondo del recipiente */
-#define FONDO (YWH+HW-5) /* cima del recipiente */
-#define LREC (XWM+75) /* lato sinistro recipiente */
-#define DREC 50 /* diametro del recipiente */
-
-TASK tasto()
-{
- int x, y;
- int x0; /* coord. sinistra recipiente */
- int col, cliq, bkg;
- int i;
- int liv; /* livello del liquido */
-
- cliq = 9;
- bkg = 14;
- x0 = LREC;
- x = x0 + DREC/2;
- y = CIMA;
- liv = FONDO;
-
- while (1) {
-
- col = cliq;
- for (i=0; i<2; i++) { /* disegna goccia */
- while (y < liv) {
- sem_wait(&mx_grf);
- grx_plot(x,y,col);
- sem_post(&mx_grf);
- y++;
- }
- y = CIMA;
- col = bkg;
- }
-
- liv--;
- sem_wait(&mx_grf);
- grx_line(x0+1, liv, x0+DREC-1, liv, cliq);
- sem_post(&mx_grf);
-
- if (liv <= CIMA+1) { /* swap colors */
- i = bkg; bkg = cliq; cliq = i;
- liv = FONDO;
- }
-
- task_endcycle();
- }
-}
-
-/****************************************************************/
-
-void kboar()
-{
- task_activate(ptas);
-}
-
-/****************************************************************/
-/* PROCESSO PALLA */
-/****************************************************************/
-
-#define VMIN 11. /* velocit… minima per suono */
-#define LP 3 /* lato della pallina */
-
-TASK palla()
-{
- int ox, oy; /* vecchia posizione pallina */
- int x0; /* posizione iniziale pallina */
- int xmin, xmax;
- int base, top;
- int xg, yg; /* coordinate grafiche pallina */
- double x, y; /* coordinate pallina */
- double G = 9.8;
- double vx, vy, v0; /* velocit… della pallina */
- double t, tx; /* variabile temporale */
- double dt; /* incremento temporale */
- double arg; /* variabile di appoggio */
-
- xmin = XWR+LP+1;
- xmax = XWR+LW-LP-1;
- base = YWH+HW-LP-1;
- top = HW-10-LP;
- x = ox = x0 = xmin;
- y = oy = top;
- arg = 2.*G*(double)top;
- vy = v0 = sqrt(arg);
- vx = 15.;
- tx = 0.0;
- t = vy / G;
- dt = .02;
-
- while (1) {
- x = x0 + vx*tx;
- y = base - vy*t + .5*G*t*t;
- if (y >= base) {
- t = 0.0;
- vy = v0;
- y = base - vy*t + .5*G*t*t;
- }
- if (x >= xmax) {
- tx = 0.0;
- x0 = xmax;
- vx = -vx;
- x = x0 + vx*tx;
- }
- if (x <= xmin) {
- tx = 0.0;
- x0 = xmin;
- vx = -vx;
- x = x0 + vx*tx;
- }
- xg = x; yg = y;
- sem_wait(&mx_grf);
- grx_disc(ox,oy,LP,0);
- grx_disc(xg,yg,LP,10);
- sem_post(&mx_grf);
- oy = yg; ox = xg;
- t += dt;
- tx += dt;
- task_endcycle();
- }
-}
-
-/****************************************************************/
-/* PROCESSO MOSCA */
-/****************************************************************/
-
-TASK mosca()
-{
- int x, y, Ax, Ay, h;
- int x0, y0, tet;
- int xmax,ymax;
- double A, B;
- double r;
- double rnd;
-
- xmax = LW/2-1; ymax = HW/2-1;
- x = 0; y = 0; tet = 0;
- x0 = XWL+LW/2; y0 = YWM+HW/2;
- A = 5.; B = 30.;
-
- while (1) {
-
- rnd = (rand()%100)/100.; /* rnd = [0,1] */
- h = (2. * B * rnd) - B; /* h = [-B,B] */
- tet = tet + h;
-
- if (tet > 360) tet = tet - 360;
- if (tet < 0) tet = tet + 360;
- r = tet * PIG / 180.;
-
- sem_wait(&mx_mat);
- Ax = (double)(A * cos(r));
- Ay = (double)(A * sin(r));
- sem_post(&mx_mat);
- x = x + Ax;
- y = y + Ay;
-
- if ((x >= xmax) || (x <= -xmax) ||
- (y >= ymax) || (y <= -ymax)) {
- x = x - Ax;
- y = y - Ay;
- tet = tet - 180;
- if (tet > 360) tet = tet - 360;
- if (tet < 0) tet = tet + 360;
- r = tet * PIG / 180.;
- sem_wait(&mx_mat);
- Ax = (double)(A * cos(r));
- Ay = (double)(A * sin(r));
- sem_post(&mx_mat);
- x = x + Ax;
- y = y + Ay;
- }
- sem_wait(&mx_grf);
- grx_plot(x+x0, y+y0, 10);
- sem_post(&mx_grf);
- task_endcycle();
- }
-}
-
-/****************************************************************/
-/* PROCESSO INFORMAZIONI */
-/****************************************************************/
-
-TASK infor()
-{
- char s[2];
- int x, y;
- int r;
- int i = 0;
- int leng;
- int col = 0;
-
- r = 0;
- x = XWM + 16;
- y = YWM + 40;
- s[1] = 0;
-
- leng = 0;
- while (talk[0][leng] != 0) leng++;
-
- while (1) {
- s[0] = talk[r][i];
- sem_wait(&mx_grf);
- grx_text(s,x+i*8,y+r*8,col+10,1);
- sem_post(&mx_grf);
- i++;
- if (i == leng) {
- i = 0;
- r = (r + 1) % 5;
- if (r == 0) col = (col + 1) % 6;
- }
- task_endcycle();
- }
-}
-
-/****************************************************************/
-/* PROCESSO RUOTA */
-/****************************************************************/
-
-TASK ruota()
-{
- int x0 = XWR + LW/2;
- int y0 = YWM + HW/2;
- int grad = 90;
- int xg, yg;
- double rad, x, y;
-
- xg = x0;
- yg = y0 + LLAN;
-
- while (1) {
-
- rad = (double)grad * PIG / 180.;
-
- sem_wait(&mx_mat);
- x = (double)x0 + (double)LLAN * cos(rad);
- y = (double)y0 + (double)LLAN * sin(rad);
- sem_post(&mx_mat);
-
- sem_wait(&mx_grf);
- grx_disc(xg, yg, 4, 0);
- sem_post(&mx_grf);
-
- xg = x; yg = y;
-
- sem_wait(&mx_grf);
- grx_disc(xg, yg, 4, 13);
- sem_post(&mx_grf);
-
- grad = (grad + 1) % 360;
-
- task_endcycle();
- }
-}
-
-/****************************************************************/
-/* PROCESSO COLORI */
-/****************************************************************/
-
-TASK color()
-{
- int xx0 = XWL+5;
- int yy0 = YWL+5;
- int n, col;
- int x, y;
-
- x = 0; y = 0;
-
- while (1) {
- n = 19. * ((rand()%100)/100.);
- x = xx0 + n * 10;
- n = 14. * ((rand()%100)/100.);
- y = yy0 + n * 10;
- col = 16. * ((rand()%100)/100.);
-
- /* xg = xx0 + x;
- yg = yy0 + y;
- x = (x + 10)%(LW-10);
- y = (y + 10)%(HW-10);
- */
- sem_wait(&mx_grf);
- grx_box(x, y, x+9, y+9, col);
- sem_post(&mx_grf);
-
- task_endcycle();
- }
-}
-
-/****************************************************************/
-/* PROCESSO PENDOLO */
-/****************************************************************/
-
-TASK pendo()
-{
- int x0 = XWM+LW/2;
- int y0 = YWL+10;
- int xg, yg;
- int col = 11;
- double x, y, teta;
- double v, a, dt;
- double g, l;
-
- g = 9.8;
- l = 80.;
- dt = 0.1;
- teta = 40. * PIG / 180.;
- v = 0.;
- sem_wait(&mx_mat);
- x = l * sin((double)teta);
- y = l * cos((double)teta);
- a = -(g/l) * sin((double)teta);
- sem_post(&mx_mat);
- xg = x0 + x;
- yg = y0 + y;
-
- while (1) {
-
- v += a * dt;
- teta += v * dt;
- sem_wait(&mx_mat);
- x = l * sin((double)teta);
- y = l * cos((double)teta);
- a = -(g/l) * sin((double)teta);
- sem_post(&mx_mat);
-
- sem_wait(&mx_grf);
- grx_line(x0, y0, xg, yg, 0);
- grx_circle(xg, yg, 5, 0);
- grx_disc(xg, yg, 4, 0);
- sem_post(&mx_grf);
-
- xg = x0+x; yg = y0+y;
-
- sem_wait(&mx_grf);
- grx_line(x0, y0, xg, yg, col);
- grx_circle(xg, yg, 5, col+2);
- grx_disc(xg, yg, 4, col+1);
- sem_post(&mx_grf);
-
- task_endcycle();
- }
-}
-
-/****************************** gener ******************************/
-
-TASK gener()
-{
- HARD_TASK_MODEL m;
- SOFT_TASK_MODEL am;
- PID pid;
-
- //---------------------------------------------
- hard_task_default_model(m);
- hard_task_def_wcet (m, wcet[1]);
- hard_task_def_mit (m, period[1]);
- hard_task_def_usemath (m);
- pid = task_create("watch", watch, &m, NULL);
- task_activate(pid);
- keyb_getch(BLOCK);
- //---------------------------------------------
- soft_task_default_model(am);
- soft_task_def_met (am, wcet[2]);
- soft_task_def_period (am, period[2]);
- soft_task_def_aperiodic(am);
- soft_task_def_usemath (am);
- ptas = task_create("tasto", tasto, &am, NULL);
- task_activate(ptas);
- keyb_getch(BLOCK);
- //---------------------------------------------
- hard_task_default_model(m);
- hard_task_def_wcet (m, wcet[3]);
- hard_task_def_mit (m, period[3]);
- hard_task_def_usemath (m);
- pid = task_create("palla", palla, &m, NULL);
- task_activate(pid);
- keyb_getch(BLOCK);
- //---------------------------------------------
- hard_task_default_model(m);
- hard_task_def_wcet (m, wcet[4]);
- hard_task_def_mit (m, period[4]);
- hard_task_def_usemath (m);
- pid = task_create("mosca", mosca, &m, NULL);
- task_activate(pid);
- keyb_getch(BLOCK);
- //---------------------------------------------
- hard_task_default_model(m);
- hard_task_def_wcet (m, wcet[5]);
- hard_task_def_mit (m, period[5]);
- hard_task_def_usemath (m);
- pid = task_create("infor", infor, &m, NULL);
- task_activate(pid);
- keyb_getch(BLOCK);
- //---------------------------------------------
- hard_task_default_model(m);
- hard_task_def_wcet (m, wcet[6]);
- hard_task_def_mit (m, period[6]);
- hard_task_def_usemath (m);
- pid = task_create("ruota", ruota, &m, NULL);
- task_activate(pid);
- keyb_getch(BLOCK);
- //---------------------------------------------
- hard_task_default_model(m);
- hard_task_def_wcet (m, wcet[7]);
- hard_task_def_mit (m, period[7]);
- hard_task_def_usemath (m);
- pid = task_create("color", color, &m, NULL);
- task_activate(pid);
- keyb_getch(BLOCK);
- //---------------------------------------------
- hard_task_default_model(m);
- hard_task_def_wcet (m, wcet[8]);
- hard_task_def_mit (m, period[8]);
- hard_task_def_usemath (m);
- pid = task_create("pendo", pendo, &m, NULL);
- task_activate(pid);
- //---------------------------------------------
-
- return NULL;
-}
-
-/****************************** MAIN ******************************/
-
-int main()
-{
- char s[20]; /* carattere letto da tastiera */
- int x0, y0;
- int x, y;
- TIME t1, count; /* contatori valutazione carico */
- double car; /* valore del carico corrente */
- TIME seme;
- PID pid;
- NRT_TASK_MODEL m2;
- KEY_EVT eva, evx, evs;
-
- sys_atrunlevel(byebye, NULL, RUNLEVEL_BEFORE_EXIT);
-
- /* set the keyboard handler */
- eva.ascii = 'a';
- eva.scan = KEY_A;
- eva.flag = 0;
- keyb_hook(eva,kboar);
-
- evx.ascii = 'x';
- evx.scan = KEY_X;
- evx.flag = ALTL_BIT;
- keyb_hook(evx,finish1);
-
- evs.ascii = ESC;
- evs.scan = KEY_ESC;
- evs.flag = 0;
- keyb_hook(evs,finish2);
-
- sem_init(&mx_mat,0,1);
- sem_init(&mx_grf,0,1);
-
- seme = sys_gettime(NULL);
- srand(seme);
-
- get_par();
- keyb_getch(BLOCK);
-
- grx_init();
- grx_open(640, 480, 8);
-
- grx_rect(XWL,YWH,XWL+LW,YWH+HW,14);
- grx_rect(XWM,YWH,XWM+LW,YWH+HW,14);
- grx_rect(XWR,YWH,XWR+LW,YWH+HW,14);
-
- grx_rect(XWL,YWM,XWL+LW,YWM+HW,14);
- grx_rect(XWM,YWM,XWM+LW,YWM+HW,14);
- grx_rect(XWR,YWM,XWR+LW,YWM+HW,14);
-
- grx_rect(XWL,YWL,XWL+LW,YWL+HW,14);
- grx_rect(XWM,YWL,XWM+LW,YWL+HW,14);
- grx_rect(XWR,YWL,XWR+LW,YWL+HW,14);
-
- x0 = XWL + LW/2;
- y0 = YWH + HW/2;
- grx_circle(x0, y0, LLAN+3, 12);
- grx_rect(XWL+74, YWH+7, XWL+120, YWH+22, 12);
-
- x0 = LREC;
- grx_line(x0, CIMA, x0, FONDO, 15);
- grx_line(x0+DREC, CIMA, x0+DREC, FONDO, 15);
- grx_line(x0, FONDO, x0+DREC, FONDO, 15);
- grx_box(x0+1, CIMA, x0+DREC-1, FONDO-1, 14);
- grx_text("Press A", XWM+16, YWH+48, 10, 0);
- grx_text("to fill", XWM+16, YWH+64, 10, 0);
-
- grx_text("Press:", XWM+18, YWM+HW-50, 10, 0);
- grx_text("ESC to exit", XWM+18, YWM+HW-40, 10, 0);
- grx_text("SPACE to create", XWM+18, YWM+HW-30, 10, 0);
-
- x0 = XWR + LW/2;
- y0 = YWM + HW/2;
- grx_circle(x0, y0, LLAN/3, 14);
- grx_disc(x0, y0, LLAN/3-1, 12);
-
- x0 = XWR+5;
- y0 = YWL+HW-5;
- grx_line(x0, YWL+HLOAD, x0+LW-10, YWL+HLOAD, 12);
- grx_text("SYSTEM WORKLOAD:", x0+5, YWL+HLOAD-10, 10, 0);
-
- count = 0;
- t1 = sys_gettime(NULL);
- do count++; while (sys_gettime(NULL) < (t1 + DURATA));
-
- nrt_task_default_model(m2);
- pid = task_create("gener", gener, &m2, NULL);
- task_activate(pid);
-
- x = 0;
- while (!fine) {
- car = load(count);
- y = (double)LLOAD*car;
- sem_wait(&mx_grf);
- grx_line(x0+x, y0-LLOAD+1, x0+x, y0, 0);
- grx_line(x0+x, y0-y, x0+x, y0, 15);
- grx_text(" ", x0+LW-60, YWL+HLOAD-10, 0, 0);
- sprintf(s, "%.3f", car);
- grx_text(s, x0+LW-50, YWL+HLOAD-10, 15, 0);
- sem_post(&mx_grf);
- x = (x + 1) % (LW-10);
- }
-
- sys_end();
-
- return 0;
-}
-
-/****************************************************************/
-
-double load(long n)
-{
- TIME i, t1;
- double carico;
-
- i = 0;
- t1 = sys_gettime(NULL);
- do i++; while (sys_gettime(NULL) < (t1 + DURATA));
- carico = 1. - (double)i / (double)n;
- return(carico);
-}
-
-/****************************************************************/
Index: rel_1_21/mix/mix.dat
===================================================================
--- rel_1_21/mix/mix.dat (revision 1217)
+++ rel_1_21/mix/mix.dat (nonexistent)
@@ -1,12 +0,0 @@
-TASK NAME PERIOD WCET
-------------------------------------------
-task1 watch: 1000000 200
-task2 tasto: 2000 200
-task3 palla: 2000 200
-task4 mosca: 20000 200
-task5 infor: 20000 300
-task6 ruota: 5000 400
-task7 color: 2000 200
-task8 pendo: 5000 400
-------------------------------------------
-
Index: rel_1_21/mix/initfile.c
===================================================================
--- rel_1_21/mix/initfile.c (revision 1217)
+++ rel_1_21/mix/initfile.c (nonexistent)
@@ -1,124 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- ------------
- CVS : $Id: initfile.c,v 1.1.1.1 2002-09-02 09:37:45 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:45 $
- ------------
-
- System initialization file
-
- This file contains the 2 functions needed to initialize the system.
-
- These functions register the following levels:
-
- an EDF (Earliest Deadline First) level
- a RR (Round Robin) level
- a CBS (Costant Bandwidth Server) level
- a Dummy level
-
- It can accept these task models:
-
- HARD_TASK_MODEL (wcet+mit) at level 0
- SOFT_TASK_MODEL (met, period) at level 1
- NRT_TASK_MODEL at level 2
-
- This file is similar to the configuration of kernel/init/hartik3.c
-
- TICK is set to 0 (one-shot timer is used)
-*/
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "modules/rr.h"
-#include "modules/dummy.h"
-
-#include "modules/sem.h"
-#include "modules/hartport.h"
-#include "modules/cabs.h"
-
-#include "drivers/keyb.h"
-
-
-/*+ sysyem tick in us +*/
-#define TICK 0
-
-/*+ RR tick in us +*/
-#define RRTICK 10000
-
-void read_file();
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(0);
- CBS_register_level(0, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- SEM_register_module();
-
- CABS_register_module();
-
- read_file();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- KEYB_PARMS kparms = BASE_KEYB;
-
- HARTPORT_init();
-
- keyb_def_ctrlC(kparms, NULL);
- keyb_def_map(kparms,itaMap);
- KEYB_init(&kparms);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
Index: rel_1_21/mix/readme
===================================================================
--- rel_1_21/mix/readme (revision 1217)
+++ rel_1_21/mix/readme (nonexistent)
@@ -1,7 +0,0 @@
-MIX
----
-
-This simple applications is a pout-pourri of simple graphic tasks
-that does different things with different timing constraints...
-
-Paolo
\ No newline at end of file
Index: rel_1_21/mix/makefile
===================================================================
--- rel_1_21/mix/makefile (revision 1217)
+++ rel_1_21/mix/makefile (nonexistent)
@@ -1,16 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS= mix
-
-include $(BASE)/config/example.mk
-
-mix:
- make -f $(SUBMAKE) APP=mix INIT= OTHEROBJS="initfile.o" OTHERINCL= SHARKOPT="__OLDCHAR__ __GRX__"
-
Index: rel_1_21/pci6025e/wave.c
===================================================================
--- rel_1_21/pci6025e/wave.c (revision 1217)
+++ rel_1_21/pci6025e/wave.c (nonexistent)
@@ -1,328 +0,0 @@
-/*****************************************************************************
-* Filename: wave.c *
-* Author: Marco Ziglioli (Doctor Stein) *
-* Date: 12/06/2001 *
-* Description: Little test program for Analog Output section of PCI6025E *
-*----------------------------------------------------------------------------*
-* Notes: Connect an oscilloscope to DACs output pins (20 & 21) and *
-* watch the waveforms. *
-* and decrise voltage *
-*****************************************************************************/
-
-/* This file is part of the S.Ha.R.K. Project - http://shark.sssup.it
- *
- * Copyright (C) 2001 Marco Ziglioli
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-
-#include <drivers/glib.h>
-#include <drivers/keyb.h>
-#include <modules/sem.h>
-
-#include <drivers/pci6025e/dac.h>
-
-#define MAX_VAL 500
-
-#define WAVE_PERIOD 1000
-#define WAVE_WCET 200
-#define GRAPH_PERIOD 1000
-#define GRAPH_WCET 550
-
-#define TASK_GROUP 1
-
-#define DAC0_CONV 0.1
-#define DAC1_CONV 0.05
-
-#define INC 40
-
-void createWaves(void);
-void drawInterface(void);
-
-void endfun(KEY_EVT *);
-void close_event(void *);
-
-TASK wave_body(int);
-TASK video_body(int);
-
-WORD wave0[MAX_VAL], wave1[MAX_VAL];
-int black = rgb16(0,0,0),
- white = rgb16(255, 255, 255);
-
-BYTE sys = 0;
-
-int main(int argc, char **argv)
-{
- KEY_EVT k;
- HARD_TASK_MODEL wave0, wave1;
- HARD_TASK_MODEL video;
- PID wave0_pid, wave1_pid, video_pid;
- int modenum;
-
- k.flag = CNTR_BIT;
- k.scan = KEY_X;
- k.ascii = 'x';
- keyb_hook(k, endfun);
-
- k.flag = CNTL_BIT;
- keyb_hook(k, endfun);
-
- sys_atrunlevel(close_event, NULL, RUNLEVEL_BEFORE_EXIT);
-
- hard_task_default_model(wave0);
- hard_task_def_wcet(wave0, WAVE_WCET);
- hard_task_def_mit(wave0, WAVE_PERIOD);
- hard_task_def_arg(wave0, 0);
- hard_task_def_group(wave0, TASK_GROUP);
- if( (wave0_pid = task_create("Wave 0", wave_body, &wave0, NULL)) == NIL ){
- sys = 10;
- sys_end();
- }
-
- hard_task_default_model(wave1);
- hard_task_def_wcet(wave1, WAVE_WCET);
- hard_task_def_mit(wave1, WAVE_PERIOD);
- hard_task_def_arg(wave1, (void *)1);
- hard_task_def_group(wave1, TASK_GROUP);
- if( (wave1_pid = task_create("Wave 1", wave_body, &wave1, NULL)) == NIL ){
- sys = 11;
- sys_end();
- }
-
- hard_task_default_model(video);
- hard_task_def_wcet(video, GRAPH_WCET);
- hard_task_def_mit(video, GRAPH_PERIOD);
- hard_task_def_group(video, TASK_GROUP);
- if( (video_pid = task_create("Video task", video_body, &video, NULL))
- == NIL ){
- sys = 12;
- sys_end();
- }
-
- if(pci_init() == -1){
- sys = 20;
- sys_end();
- }
-
- if(!reMap()){
- sys = 21;
- sys_end();
- }
-
- if(grx_init() == -1){
- sys = 30;
- sys_end();
- }
-
- if( (modenum = grx_getmode(800, 600, 16)) == -1 ){
- sys = 31;
- sys_end();
- }
-
- grx_setmode(modenum);
-
- createWaves();
- drawInterface();
- //Analog output section set up
- DAC_Init();
-
- /*
- *AI_TIMEBASE div by 2; OUT_TIMEBASE div by 2; single DAC mode
- *TMRDACWR = 3 OUT_TIMEBASE period; FIFO flags polarity active low
- *TMRDACWR disabled; DMA PIO control = FIFO DATA interface mode
- *UPDATE signal timebase = AO_UPDATE pulse width
- *UPDATE pulsewidth = 3-3.5 OUT_TIMEBASE period
- *UPDATE signal polarity = HIGH Z
- */
- DAC_boardInit(0x02, 0x4000);
-
- /*
- *LDAC0 source = UPDATE
- *DAC0 update immediately
- *LDAC1 source = UPDATE
- *DAC1 update immediately
- */
- DAC_LDACSourceUpdate(0x00);
- //End of Analog output section setup
-
-
- group_activate(TASK_GROUP);
-
- return 0;
-}
-
-void endfun(KEY_EVT *k)
-{
- sys_end();
-}
-
-void close_event(void *arg)
-{
- grx_close();
- switch(sys){
- case 0: cprintf("Regular End!\n"); break;
- case 10: cprintf("Cannot create <wave 0> task!\n"); break;
- case 11: cprintf("Cannot create <wave 1> task!\n"); break;
- case 12: cprintf("Cannot create <video> task!\n"); break;
- case 20: cprintf("No PCI bus found!\n"); break;
- case 21: cprintf("No NATIONAL PCI E-Series board found on PCI bus!\n");
- break;
- case 30: cprintf("Cannot start graphic envirorment!\n"); break;
- case 31: cprintf("800x600x16 video mode not supported!\n");
- default: cprintf("Unknown exit event!\n"); break;
- }
-}
-
-/*
-* Wave's samples generation
-*/
-void createWaves(void)
-{
- int i;
- WORD value0, value1;
- BYTE direction;
-
- /* Wave0
- * * * * * * * *
- ** ** ** ** ** ** ** **
- * ** * * ** ** ** ** ** *
- * * ** * * * * * *
- --------------------------...
-
- Wave 1
- * *
- * * * *
- * * * *
- * * * *
- -------*-------*-------*--...
- * * *
- * * *
- * *
- * */
-
- value0 = 0;
- value1 = 0;
- direction = 0;
- for(i=0; i<MAX_VAL; i++){
- wave0[i] = (value0 & 0x0FFF);
- wave1[i] = (value1 & 0x0FFF);
-
- value0 = (value0 + INC) % 2000;
- if(!direction) value1 += INC;
- else value1 -= INC;
-
- if(value1 >= 2000) direction = 1;
- if(value1 <= -2000) direction = 0;
- }
-}
-
-void drawInterface(void)
-{
- int i;
-
- grx_rect(1, 1, 799, 69, rgb16(105, 0, 105));
- grx_rect(2, 2, 798, 68, rgb16(155, 0, 155));
- grx_rect(3, 3, 797, 67, rgb16(205, 0, 205));
- grx_rect(4, 4, 796, 66, rgb16(255, 0, 255));
-
- grx_text("Test program for Analog output section of PCI6025E",
- 7, 10, rgb16(50, 255, 50), black);
- grx_text("DAC0 and DAC1 should generate saw-toothed wave and triangular wave",
- 7, 33, rgb16(0, 255, 255), black);
- grx_text("Use an oscilloscope to test this software",
- 7, 40, rgb16(0, 255, 255), black);
-
- grx_text("CTRL-X for Exit", 7, 55, rgb16(200, 200, 0), black);
-
- grx_text("DAC 0", 100, 92, rgb16(200, 200, 0), black);
- grx_rect(1, 100, 799, 325, rgb16(0, 105, 0));
- grx_rect(2, 101, 798, 324, rgb16(0, 155, 0));
- grx_rect(3, 102, 797, 323, rgb16(0, 205, 0));
- grx_rect(4, 103, 796, 322, rgb16(0, 255, 0));
- grx_line(19, 115, 19, 320, white);
- grx_line(14, 315, 530, 315, white);
-
- grx_text("DAC 1", 100, 362, rgb16(200, 200, 0), black);
- grx_rect(1, 370, 799, 595, rgb16(105, 0, 0));
- grx_rect(2, 371, 798, 594, rgb16(155, 0, 0));
- grx_rect(3, 372, 797, 593, rgb16(205, 0, 0));
- grx_rect(4, 373, 796, 592, rgb16(255, 0, 0));
- grx_line(19, 385, 19, 585, white);
- grx_line(14, 485, 530, 485, white);
-
- for(i=22; i<530; i+=2){
- //DAC0
- grx_plot(i, 115, white);
- grx_plot(i, 215, white);
- //DAC1
- grx_plot(i, 385, white);
- grx_plot(i, 435, white);
- grx_plot(i, 535, white);
- grx_plot(i, 585, white);
- }
-
- grx_text("5 V", 540, 211, rgb16(0, 255, 0), black);
- grx_text("10 V", 540, 111, rgb16(0, 255, 0), black);
- grx_text("+5 V", 540, 431, rgb16(0, 255, 0), black);
- grx_text("+10 V", 540, 381, rgb16(0, 255, 0), black);
- grx_text("-5 V", 540, 531, rgb16(255, 0, 0), black);
- grx_text("-10 V", 540, 581, rgb16(255, 0 , 0), black);
-}
-
-/*
-* Sends out waves' samples
-*/
-TASK wave_body(int wv)
-{
- int i = 0;
- while(1){
- if(wv)
- DAC_output(DAC1, wave1[i]);
- else
- DAC_output(DAC0, wave0[i]);
-
- i = (i + 1) % 500;
- task_endcycle();
- }
-}
-
-/*
-* Shows wave on screen
-*/
-TASK video_body(int dummy)
-{
- int i = 0;
- int n_tmp, o_tmp;
- //char buf[10];
-
- while(1){
- o_tmp = n_tmp;
- if( (wave1[i] & 0x0800) != 0 ) n_tmp = wave1[i]-0x0FFF;
- else n_tmp = wave1[i];
-
- if(i>0){
- grx_line(19+i, 314-wave0[i-1]*DAC0_CONV,
- 20+i, 314-wave0[i]*DAC0_CONV, rgb16(255, 255, 0));
- grx_line(19+i, 485-o_tmp*DAC1_CONV,
- 20+i, 485-n_tmp*DAC1_CONV, rgb16(0, 255, 255));
- }
-
- i = (i + 1) % 500;
- task_endcycle();
- }
-}
Index: rel_1_21/pci6025e/initfile.c
===================================================================
--- rel_1_21/pci6025e/initfile.c (revision 1217)
+++ rel_1_21/pci6025e/initfile.c (nonexistent)
@@ -1,63 +0,0 @@
-/*
-* Filename: Initfile.c
-* Author: Marco Ziglioli (Doctor Stein)
-* Date: (I don't remeber... I'm sorry)
-* Description: this file is the same for every examples in this section
-*/
-
-/* This file is part of the S.Ha.R.K. Project - http://shark.sssup.it
- *
- * Copyright (C) 2001 Marco Ziglioli
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <kernel/kern.h>
-#include <modules/edf.h>
-#include <modules/cbs.h>
-#include <modules/rr.h>
-#include <modules/hartport.h>
-#include <modules/dummy.h>
-#include <modules/sem.h>
-
-#include <drivers/keyb.h>
-
-#define TICK 1000
-#define RRTICK 5000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- CBS_register_level(CBS_ENABLE_ALL, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- return TICK;
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- HARTPORT_init();
- KEYB_init(NULL);
-
- __call_main__(mb);
-
- return (void *)0;
-}
Index: rel_1_21/pci6025e/test_mes.c
===================================================================
--- rel_1_21/pci6025e/test_mes.c (revision 1217)
+++ rel_1_21/pci6025e/test_mes.c (nonexistent)
@@ -1,290 +0,0 @@
-/*****************************************************************************
-* Filename: test_mes.c *
-* Author: Marco Ziglioli (Doctor Stein) *
-* Date: 25/06/2001 *
-* Description: Test file for single period and pulsewidth measurement feature*
-* of PCI6025E timers/counters *
-*----------------------------------------------------------------------------*
-* Notes: board is configured to provide a frequency of 1 MHZ through its FOUT*
-* pin (50). PFI3 (41) and PFI6 (45) are configured like source pins *
-* counter 0 and counter 1. PFI4 (42) and PFI 5(44) are the gates for *
-* the two counters. Please connect DIO7(32) to PFI4 and DIO6(30) to *
-* PFI 5. *
-* With 'g' key a task is started which generate a square wave on DIO7 *
-* with a period of 2 secs. With 'h' key the same square wave is *
-* generated on DIO6. *
-* When measurement is performed data are stored into Hardware Save *
-* Registers: use key 's' to show this values *
-*****************************************************************************/
-
-
-/* This file is part of the S.Ha.R.K. Project - http://shark.sssup.it
- *
- * Copyright (C) 2001 Marco Ziglioli
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-#include <drivers/glib.h>
-
-#include <drivers/pci6025e/timer.h>
-#include <drivers/pci6025e/dio_ppi.h>
-
-#define TASK_MET 20000
-#define TASK_WCET 50000
-#define TASK_PERIOD 100000
-
-#define PERIOD 1000000
-
-void endFun(KEY_EVT *);
-void gateEvent(KEY_EVT *);
-
-void drawInterface(void);
-void closeEvent(void *);
-
-TASK show_body(int);
-TASK gate_body(int);
-
-BYTE sys = 0;
-PID c0_gate_pid, c1_gate_pid, show_pid;
-int black = rgb16(0, 0, 0);
-
-int main(int argc, char **argv)
-{
- KEY_EVT k;
- int modenum;
- SOFT_TASK_MODEL show_model;
- HARD_TASK_MODEL gating;
-
- sys_atrunlevel(closeEvent, NULL, RUNLEVEL_BEFORE_EXIT);
-
- k.flag = CNTL_BIT;
- k.scan = KEY_X;
- k.ascii = 'x';
- keyb_hook(k, endFun);
-
- k.flag = CNTR_BIT;
- keyb_hook(k, endFun);
-
- k.flag = 0;
- k.scan = KEY_G;
- k.ascii = 'g';
- keyb_hook(k, gateEvent);
-
- k.scan = KEY_H;
- k.ascii = 'h';
- keyb_hook(k, gateEvent);
-
- k.scan = KEY_S;
- k.ascii = 's';
- keyb_hook(k, gateEvent);
-
- if(pci_init()==-1){
- sys = 10;
- sys_end();
- }
-
- if(!reMap()){
- sys = 11;
- sys_end();
- }
-
- soft_task_default_model(show_model);
- soft_task_def_level(show_model, 1);
- soft_task_def_met(show_model, TASK_MET);
- soft_task_def_wcet(show_model, TASK_WCET);
- soft_task_def_aperiodic(show_model);
- soft_task_def_period(show_model, TASK_PERIOD);
- if( (show_pid = task_create("Show task", show_body, &show_model, NULL))
- == NIL ){
- sys = 20;
- sys_end();
- }
-
- hard_task_default_model(gating);
- hard_task_def_mit(gating, PERIOD);
- hard_task_def_wcet(gating, 20000);
- hard_task_def_arg(gating, C0);
- if( (c0_gate_pid = task_create("C0 Gate task", gate_body, &gating, NULL)) == NIL ){
- sys = 21;
- sys_end();
- }
-
- hard_task_def_arg(gating, (void *)C1);
- if( (c1_gate_pid = task_create("C1 Gate task", gate_body, &gating, NULL)) == NIL ){
- sys = 22;
- sys_end();
- }
-
- if(grx_init()==-1){
- sys = 30;
- sys_end();
- }
-
- if( (modenum = grx_getmode(800, 600, 16)) == 0 ){
- sys = 31;
- sys_end();
- }
-
- grx_setmode(modenum);
- drawInterface();
- //Enable DIO to manage gates
- DIO_init();
- DIO_setup(0xFF);
- DIO_write(0x00);
-
- //All PFI configured as input
- PFIprogramming(0x0000);
- //Fout provide 1MHz: timebase = 20MHz; divided by 2; on FOUT pin also divided by 10
- setIntClock(0, 1, 10);
-
- //Reset both counters
- TIM_reset(2);
-
- //Source PFI3(41); Gate PFI 4(42); Measure period
- TIM_timeMeasurement(C0, 0x04, 0x45, 0, 0x00, 0);
-
- //Source PFI6(45); Gate PFI 5(44); Measure pulsewidth
- TIM_timeMeasurement(C1, 0x87, 0x46, 1, 0x00, 0);
-
- //Arm both counter
- TIM_arm(2);
-
- return 0;
-}
-
-TASK show_body(int dummy)
-{
- DWORD val;
- char buf[20];
-
- while(1){
- val = TIM_readHWSaveReg(C0);
- sprintf(buf, "%ld", val);
- grx_text(buf, 600, 471, rgb16(0, 255, 0), black);
- val = TIM_readHWSaveReg(C1);
- sprintf(buf, "%ld", val);
- grx_text(buf, 200, 471, rgb16(255, 0, 0), black);
-
- task_endcycle();
- }
-}
-
-TASK gate_body(int counter)
-{
- BYTE out;
-
- if(counter == C0) out = 0x80;
- else out = 0x40;
-
- while(1){
- DIO_write(out);
- if(counter == C0){
- if(out) out = 0x00;
- else out = 0x80;
- } else {
- if(out) out = 0x40;
- else out = 0x00;
- }
-
- task_endcycle();
- }
-}
-
-void drawInterface(void)
-{
- grx_rect(1, 1, 799, 120, rgb16(105, 0, 0));
- grx_rect(2, 2, 798, 119, rgb16(155, 0, 0));
- grx_rect(3, 3, 797, 118, rgb16(205, 0, 0));
- grx_rect(4, 4, 796, 117, rgb16(255, 0, 0));
-
- grx_text("Test program for single period and pulsewidth measurement features",
- 7, 10, rgb16(200, 200, 0), black);
-
- grx_text("This program measures single period and pulsewidth of a square wave",
- 7, 20, rgb16(0, 255, 0), black);
- grx_text("with frequency of 0.5 Hz", 7, 28, rgb16(0, 255, 0), black);
- grx_text("Please connect PFI3 & PFI6 (41 & 45) to FOUT pin (50) or to 1Mhz frequency source",
- 7, 40, rgb16(255, 0, 0), black);
- grx_text("Connect also DIO7 (32) to PFI4 (42) and DIO6 to PFI5 (44)",
- 7, 48, rgb16(255, 0, 0), black);
- grx_text("Commands:", 7, 60, rgb16(0, 120, 0), black);
- grx_text("Use 'g' to start wave generation on DIO7",
- 7, 70, rgb16(0, 255, 255), black);
- grx_text("Use 'h' to start wave generation on DIO6",
- 7, 78, rgb16(0, 255, 255), black);
- grx_text("Use 's' to show Hardware Save Registers content",
- 7, 86, rgb16(0, 255, 255), black);
- grx_text("CTRL-X to exit", 7, 105, rgb16(255, 255, 0), black);
-
- grx_rect(197, 127, 603, 423, rgb16(0, 255, 0));
- grx_rect(198, 128, 602, 422, rgb16(0, 205, 0));
- grx_rect(199, 129, 601, 421, rgb16(0, 155, 0));
- grx_rect(200, 130, 600, 420, rgb16(0, 105, 0));
- grx_line(215, 405, 215, 150, rgb16(255, 255, 255));
- grx_line(210, 400, 580, 400, rgb16(255, 255, 255));
- grx_line(220, 395, 220, 170, rgb16(0, 0, 255));
- grx_line(220, 170, 390, 170, rgb16(0, 0, 255));
- grx_line(390, 170, 390, 395, rgb16(0, 0, 255));
- grx_line(390, 395, 560, 395, rgb16(0, 0, 255));
- grx_line(220, 150, 560, 150, rgb16(0, 255, 0));
- grx_line(220, 155, 390, 155, rgb16(255, 0, 0));
-
- grx_rect(1, 450, 390, 503, rgb16(105, 0, 0));
- grx_rect(2, 451, 389, 502, rgb16(155, 0, 0));
- grx_rect(3, 452, 388, 501, rgb16(205, 0, 0));
- grx_rect(4, 453, 387, 500, rgb16(255, 0, 0));
- grx_text("Pulsewidth: [us]", 7, 471, rgb16(255, 0, 0), black);
-
- grx_rect(410, 450, 799, 503, rgb16(105, 0, 0));
- grx_rect(411, 451, 798, 502, rgb16(155, 0, 0));
- grx_rect(412, 452, 797, 501, rgb16(205, 0, 0));
- grx_rect(413, 453, 796, 500, rgb16(255, 0, 0));
- grx_text("Period: [us]", 416, 471, rgb16(0, 255, 0), black);
-}
-
-void endFun(KEY_EVT *k)
-{
- sys_end();
-}
-
-void gateEvent(KEY_EVT *k)
-{
- if(k->scan == KEY_G) task_activate(c0_gate_pid);
- if(k->scan == KEY_H) task_activate(c1_gate_pid);
- if(k->scan == KEY_S) task_activate(show_pid);
-}
-
-void closeEvent(void *arg)
-{
- TIM_disarm(2);
- grx_close();
-
- switch(sys){
- case 0: cprintf("OK\n"); break;
- case 10: cprintf("No PCI bus found\n"); break;
- case 11: cprintf("No NATIONAL board found\n"); break;
- case 20: cprintf("task <show value> down!!\n"); break;
- case 21: cprintf("task <C0 gate manage> down!!!\n"); break;
- case 22: cprintf("task <C1 gate manage> down!!!\n"); break;
- case 30: cprintf("Cannot init graphic envirorment\n"); break;
- case 31: cprintf("graphic mode 800x600x16 not supported\n"); break;
- default: cprintf("???????????????\n"); break;
- }
-}
Index: rel_1_21/pci6025e/test_ec.c
===================================================================
--- rel_1_21/pci6025e/test_ec.c (revision 1217)
+++ rel_1_21/pci6025e/test_ec.c (nonexistent)
@@ -1,405 +0,0 @@
-/*****************************************************************************
-* Filename: test_ec.c *
-* Author: Marco Ziglioli (Doctor Stein) *
-* Date: 20/06/2001 *
-* Description: Test program for gated event counting using PCI6025E board *
-*----------------------------------------------------------------------------*
-* Notes: FOUT are enabled to provide a frequency of 6250 Hz. You could *
-* connect PFI3 (pin 41) and PFI6 (pin 45) to this source for counting *
-* edges. Gated counting are enabled and PFI4 (pin 42) is gate pin for *
-* counter 0 and PFI5 (pin 44) is gate pin for counter 0. DIO 7 and 6 *
-* are als configured to switch between 0 and 5 V. Connect DIO 7 to *
-* gate 0 and DIO 6 to gate 1. Use 'g' (counter 0) and 'h' (counter 1) *
-* to change DIO lines value. On left area of the screen you should *
-* see counter while counting and on the right area you should lock *
-* counter values by pressing 's' key. *
-* Notice that line parameters are enabled and accept inital value *
-* for the two counters. If they aren't specified or they are wrong *
-* counters start from 0x00FFFFFF (counter 0 which counts down) and *
-* 0x00000000 (counter 1 which counts up). *
-* Last time addiction: TC Interrupts and Gate interrupts are enabled *
-* Bottom squares indicates when an interrupt is *
-* raised *
-*****************************************************************************/
-
-/* This file is part of the S.Ha.R.K. Project - http://shark.sssup.it
- *
- * Copyright (C) 2001 Marco Ziglioli
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-#include <drivers/glib.h>
-
-#include <drivers/pci6025e/timer.h>
-#include <drivers/pci6025e/dio_ppi.h>
-
-#ifndef INT_NO
- #define INT_NO NIDevice_info[0].InterruptLevel
-#endif
-
-BYTE sys = 0;
-
-PID show_aper_pid;
-BYTE out = 0x00;
-
-int black = rgb16(0, 0, 0),
- white = rgb16(255, 255, 255);
-
-void endfun(KEY_EVT *);
-void close_event(void *);
-void show_evt(KEY_EVT *k);
-void gate_change(KEY_EVT *k);
-
-void drawInterface(void);
-
-void int_evt(int intno);
-
-TASK show_per(int);
-TASK show_aper(int);
-
-int main(int argc, char **argv)
-{
- KEY_EVT k;
- SOFT_TASK_MODEL show_per_mod, show_aper_mod;
- PID show_per_pid;
- int result, modenum;
- DWORD init_val_c0, init_val_c1;
-
- if(argc >= 3){
- if( (result = sscanf(argv[1], "%ld", &init_val_c0)) != 1)
- init_val_c0 = 0x00FFFFFF;
- if( (result = sscanf(argv[2], "%ld", &init_val_c1)) != 1)
- init_val_c1 = 0x00000000;
- }
- if(argc == 2){
- if( (result = sscanf(argv[1], "%ld", &init_val_c0)) != 1)
- init_val_c0 = 0x00FFFFFF;
- init_val_c1 = 0x00000000;
- }
- if(argc == 1){
- init_val_c0 = 0x00FFFFFF;
- init_val_c1 = 0x00000000;
- }
-
- sys_atrunlevel(close_event, NULL, RUNLEVEL_BEFORE_EXIT);
-
- k.flag = CNTL_BIT;
- k.scan = KEY_X;
- k.ascii = 'x';
- keyb_hook(k, endfun);
-
- k.flag = CNTR_BIT;
- keyb_hook(k, endfun);
-
- soft_task_default_model(show_aper_mod);
- soft_task_def_aperiodic(show_aper_mod);
- soft_task_def_level(show_aper_mod, 1);
- soft_task_def_period(show_aper_mod, 250000);
- soft_task_def_met(show_aper_mod, 30000);
- soft_task_def_wcet(show_aper_mod, 60000);
- if( (show_aper_pid = task_create("Show aperiodic task", show_aper, &show_aper_mod, NULL)) == NIL ){
- sys = 10;
- sys_end();
- }
-
- k.flag = 0;
- k.scan = KEY_S;
- k.ascii = 's';
- keyb_hook(k, show_evt);
-
- k.flag = 0;
- k.scan = KEY_G;
- k.ascii = 'g';
- keyb_hook(k, gate_change);
-
- k.scan = KEY_H;
- k.ascii = 'h';
- keyb_hook(k, gate_change);
-
- soft_task_default_model(show_per_mod);
- soft_task_def_level(show_per_mod, 1);
- soft_task_def_met(show_per_mod, 1000);
- soft_task_def_period(show_per_mod, 10000);
- if( (show_per_pid = task_create("Show periodic task", show_per, &show_per_mod, NULL)) == NIL){
- sys = 11;
- sys_end();
- }
-
- if(pci_init()==-1){
- sys = 20;
- sys_end();
- }
-
- if(!reMap()){
- sys = 21;
- sys_end();
- }
-
- if(grx_init()==-1){
- sys = 30;
- sys_end();
- }
-
- if( (modenum = grx_getmode(800, 600, 16)) == -1){
- sys = 31;
- sys_end();
- }
-
- grx_setmode(modenum);
-
- drawInterface();
-
- //Init DIO lines used to manage counters gates
- DIO_init();
- DIO_setup(0xFF);
- DIO_write(out);
-
- //All PFI are configured as input
- PFIprogramming(0x0000);
- //FOUT enable; Slow TIMEBASE, divided by two; divided by 16 on FOUT pin
- setIntClock(1, 1, 0);
-
- TIM_reset(2); //Reset both two counters
-
- //Source PFI3(41); Gate PFI 4(42); Down counting; counts rising edge;
- TIM_eventCounting(C0, 0x04, 0x45, 0x03, init_val_c0);
-
- //Source PFI6(45); Gate PFI 5(44); Up counting; counts rising edge;
- TIM_eventCounting(C1, 0x87, 0x46, 0x03, init_val_c1);
-
- //Set up interrupt group A and B enabling and programming to assert a request
- //both on line 2 and 3 respectively
- INT_setup(0x0A, 0x0B);
- INT_personalize(0x03); //Interrupt request polarity low; IRQ driven on line 0 and 1
-
- handler_set(INT_NO, int_evt, show_aper_pid);
-
- TIM_arm(2); //Arm both two counters
-
- task_activate(show_per_pid);
-
- return 0;
-}
-
-void drawInterface(void)
-{
- grx_rect(1, 1, 799, 99, rgb16(105, 0, 0));
- grx_rect(2, 2, 798, 98, rgb16(155, 0, 0));
- grx_rect(3, 3, 797, 97, rgb16(205, 0, 0));
- grx_rect(4, 4, 796, 96, rgb16(255, 0, 0));
-
- grx_text("Test program for Gated Event Counting capacity of PCI6025E timers",
- 7, 10, rgb16(50, 255, 50), black);
-
- grx_text("This program counting rise edges on counters source (PFI3 & PFI6) when releted gates",
- 7, 25, rgb16(0, 255, 255), black);
- grx_text("(PFI 42 & 44) are enabled. Frequency Out (FOUT) is enabled and provides a frequency of 6250 Hz",
- 7, 33, rgb16(0, 255, 255), black);
-
- grx_text("Instruction:",7, 43, rgb16(255, 0, 0), black);
- grx_text("Use 's' to lock counters value in right squares",
- 7, 51, rgb16(0, 255, 255), black);
- grx_text("Use 'g' to block or to release alternativly counter 0 (see top-left square)",
- 7, 58, rgb16(0, 255, 255), black);
-
- grx_text("Use 'h' to block or to release alternativly counter 1 (see bottom-left square)",
- 7, 65, rgb16(0, 255, 255), black);
-
- grx_text("Please connect DIO7 (pin 32) to PFI4 (pin 42) and DIO6 (pin 30) to PFI5 (pin 44)",
- 7, 78, rgb16(0, 255, 0), black);
- grx_text("CTRL-X for Exit", 7, 88, rgb16(200, 200, 0), black);
-
- grx_rect(1, 110, 355, 170, rgb16(0, 105, 0));
- grx_rect(2, 111, 354, 169, rgb16(0, 155, 0));
- grx_rect(3, 112, 353, 168, rgb16(0, 205, 0));
- grx_rect(4, 113, 352, 167, rgb16(0, 255, 0));
- grx_text("Counter 0 evolution", 7, 120, rgb16(255, 255, 0), black);
-
- grx_rect(455, 110, 799, 170, rgb16(0, 105, 0));
- grx_rect(456, 111, 798, 169, rgb16(0, 155, 0));
- grx_rect(457, 112, 797, 168, rgb16(0, 205, 0));
- grx_rect(458, 113, 796, 167, rgb16(0, 255, 0));
- grx_text("Counter 0 locked value", 461, 120, rgb16(255, 0, 255), black);
-
- grx_rect(360, 110, 450, 170, rgb16(0, 105, 0));
- grx_rect(361, 111, 449, 169, rgb16(0, 155, 0));
- grx_rect(362, 112, 448, 168, rgb16(0, 205, 0));
- grx_rect(363, 113, 447, 167, rgb16(0, 255, 0));
- grx_text("Gate0", 367, 120, rgb16(200, 255, 200), black);
- grx_text("0 V", 367, 145, rgb16(255, 0, 0), black);
-
- grx_rect(1, 190, 355, 260, rgb16(85, 85, 255));
- grx_rect(2, 191, 354, 259, rgb16(135, 135, 255));
- grx_rect(3, 192, 353, 258, rgb16(190, 190, 255));
- grx_rect(4, 193, 352, 257, rgb16(230, 239, 255));
- grx_text("Counter 1 evolution", 7, 200, white, black);
-
- grx_rect(455, 190, 799, 260, rgb16(85, 85, 255));
- grx_rect(456, 191, 798, 259, rgb16(135, 135, 255));
- grx_rect(457, 192, 797, 258, rgb16(190, 190, 255));
- grx_rect(458, 193, 796, 257, rgb16(230, 230, 255));
- grx_text("Counter 1 locked value", 461, 200, white, black);
-
- grx_rect(360, 190, 450, 260, rgb16(85, 85, 255));
- grx_rect(361, 191, 449, 259, rgb16(135, 135, 255));
- grx_rect(362, 192, 448, 258, rgb16(190, 190, 255));
- grx_rect(363, 193, 447, 257, rgb16(230, 230, 255));
- grx_text("Gate1", 367, 200, rgb16(255, 200, 255), black);
- grx_text("0 V", 367, 225, rgb16(255, 0, 0), black);
-
- grx_text("Counter 0 Interrupt events", 7, 340, rgb16(255, 200, 100), black);
- grx_text("Counter 1 Interrupt events", 461, 340, rgb16(255, 200, 100), black);
- grx_rect(1, 350, 355, 400, rgb16(105, 0, 0));
- grx_rect(2, 351, 354, 399, rgb16(155, 0, 0));
- grx_rect(3, 352, 353, 398, rgb16(205, 0, 0));
- grx_rect(4, 353, 352, 397, rgb16(255, 0, 0));
- grx_rect(455, 350, 799, 400, rgb16(105, 0, 0));
- grx_rect(456, 351, 798, 399, rgb16(155, 0, 0));
- grx_rect(457, 352, 797, 398, rgb16(205, 0, 0));
- grx_rect(458, 353, 796, 397, rgb16(255, 0, 0));
-}
-
-
-TASK show_per(int none)
-{
- DWORD val;
- char buf[30];
-
- while(1){
- val = TIM_readCounter(C0); //Read counter 0 value
- sprintf(buf, "HEX: %08lx DEC: %08ld", val ,val);
- grx_text(buf, 7, 145, rgb16(255, 0, 0), black);
-
- val = TIM_readCounter(C1); //Read counter 1 value
- sprintf(buf, "HEX: %08lx DEC: %08ld", val ,val);
- grx_text(buf, 7, 225, rgb16(255, 0, 0), black);
-
- task_endcycle();
- }
-}
-
-TASK show_aper(int dummy)
-{
- DWORD val;
- char buf[30];
-
- while(1){
- val = TIM_readCounter(C0);
- sprintf(buf, "HEX: %08lx DEC: %08ld", val, val);
- grx_text(buf, 461, 145, rgb16(80, 80, 255), black);
-
- val = TIM_readCounter(C1);
- sprintf(buf, "HEX: %08lx DEC: %08ld", val, val);
- grx_text(buf, 461, 225, rgb16(80, 80, 255), black);
-
- task_endcycle();
- }
-}
-
-void endfun(KEY_EVT *k)
-{
- sys_end();
-}
-
-void show_evt(KEY_EVT *k)
-{
- task_activate(show_aper_pid);
-}
-
-void gate_change(KEY_EVT *k)
-{
- if(k->ascii == 'g'){
- if( (out & 0x80) != 0){
- out &= 0x7F;
- grx_text("0 V", 367, 145, rgb16(255, 0, 0), black);
- } else {
- out |= 0x80;
- grx_text("5 V", 367, 145, rgb16(0, 255, 0), black);
- }
- } else {
- if( (out & 0x40) != 0){
- out &= 0xBF;
- grx_text("0 V", 367, 225, rgb16(255, 0, 0), black);
- } else {
- out |= 0x40;
- grx_text("5 V", 367, 225, rgb16(0, 255, 0), black);
- }
- }
-
- DIO_write(out);
-}
-
-void close_event(void *arg)
-{
- TIM_disarm(2); //Disable both two counters
- grx_close();
- handler_remove(INT_NO);
-
-
- switch(sys){
- case 0: cprintf("OK\n"); break;
- case 10: cprintf("Task <show aperiodic> down\n"); break;
- case 11: cprintf("Task <show periodic> down\n"); break;
- case 20: cprintf("No PCI bus\n"); break;
- case 21: cprintf("No National board on PCI bus\n"); break;
- case 30: cprintf("No graphic can be initialized\n"); break;
- case 31: cprintf("This graphic mode cannot be supported\n"); break;
- default: cprintf("???????????\n"); break;
- }
-}
-
-void int_evt(int intno)
-{
- WORD status;
-
- status = DAQ_STC_Windowed_Mode_Read(AI_STATUS_1);
- if( (status & 0x8000) != 0){
- if( (status & 0x0008) != 0){
- grx_text("INT Group A raised! G0 Rolls over", 7, 360, rgb16(0, 255, 0), black);
- set(interrupt_a_ack, 14);
- DAQ_STC_Windowed_Mode_Write(INTERRUPT_A_ACK, interrupt_a_ack);
- clr(interrupt_a_ack, 14);
- }
- if( (status & 0x0004) != 0){
- grx_text("INT Group A raised! G0 gate pressed", 7, 380, rgb16(0, 255, 0), black);
- set(interrupt_a_ack, 15);
- DAQ_STC_Windowed_Mode_Write(INTERRUPT_A_ACK, interrupt_a_ack);
- clr(interrupt_a_ack, 15);
- }
- return;
- }
-
- status = DAQ_STC_Windowed_Mode_Read(AO_STATUS_1);
- if( (status & 0x8000) != 0){
- if( (status & 0x0008) != 0){
- grx_text("INT Group B raised! G1 Rolls over", 461, 360, rgb16(0, 255, 0), black);
- set(interrupt_b_ack, 14);
- DAQ_STC_Windowed_Mode_Write(INTERRUPT_B_ACK, interrupt_b_ack);
- clr(interrupt_b_ack, 14);
- }
- if( (status & 0x0004) != 0){
- grx_text("INT Group B raised! G1 gate pressed", 461, 380, rgb16(0, 255, 0), black);
- set(interrupt_b_ack, 15);
- DAQ_STC_Windowed_Mode_Write(INTERRUPT_B_ACK, interrupt_b_ack);
- clr(interrupt_b_ack, 15);
- }
- return;
- }
-}
-/* End of file: Test_ec.c */
Index: rel_1_21/pci6025e/test_dac.c
===================================================================
--- rel_1_21/pci6025e/test_dac.c (revision 1217)
+++ rel_1_21/pci6025e/test_dac.c (nonexistent)
@@ -1,364 +0,0 @@
-/*****************************************************************************
-* Filename: test_dac.c *
-* Author: Marco Ziglioli (Doctor Stein) *
-* Date: 12/06/2001 *
-* Description: Little test program for Analog Output section of PCI6025E *
-*----------------------------------------------------------------------------*
-* Notes: Connect a multimeter to DAC1 output (pin 21) and watch *
-* tension value. Use '+' and '-' on numeric pad to increase *
-* and decrise voltage *
-* With this program it's possible to point out possible *
-* offset errors. To correct them no software are written but *
-* in National board package there's the program to calibrate *
-* the board. Otherwise you can see how much is the offset *
-* and you can compensate it through software value *
-*****************************************************************************/
-
-/* This file is part of the S.Ha.R.K. Project - http://shark.sssup.it
- *
- * Copyright (C) 2001 Marco Ziglioli
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <drivers/glib.h>
-#include <drivers/keyb.h>
-#include <drivers/pci6025e/dac.h>
-
-#define TASK_VOLT_PERIOD 150E3
-#define TASK_VOLT_WCET 080E3
-#define TASK_DAC_PERIOD 050E3
-#define TASK_DAC_WCET 020E3
-
-#define CONV 10/2048
-
-#define TASK_GROUP 1
-
-WORD dac0_value = 0,
- dac1_value = 0;
-
-BYTE sys = 0;
-BYTE dac = 0;
-
-//some colors
-int black = rgb16(0, 0, 0),
- white = rgb16(255, 255, 255);
-
-void drawInterface(void);
-void endfun(KEY_EVT *);
-void inc(KEY_EVT *);
-void dec(KEY_EVT *);
-void change_dac(KEY_EVT *);
-void close_event(void *);
-TASK Voltage_body(int);
-TASK DAC_Check_body(int);
-
-int main(int argc, char **argv)
-{
- int modenum;
- KEY_EVT k;
- HARD_TASK_MODEL m, d;
- PID pid_m, pid_d;
-
- sys_atrunlevel(close_event, NULL, RUNLEVEL_BEFORE_EXIT);
-
- keyb_set_map(itaMap);
- k.flag = CNTR_BIT;
- k.scan = KEY_X;
- k.ascii = 'x';
- keyb_hook(k, endfun);
-
- k.flag = CNTL_BIT;
- keyb_hook(k, endfun);
-
- k.flag = 0;
- k.scan = 78;
- k.ascii = 43;
- keyb_hook(k, inc);
-
- k.flag = 0;
- k.scan = 74;
- k.ascii = 45;
- keyb_hook(k, dec);
-
- k.flag = 0;
- k.scan = KEY_V;
- k.ascii = 'v';
- keyb_hook(k, change_dac);
-
- hard_task_default_model(m);
- hard_task_def_wcet(m, TASK_VOLT_WCET);
- hard_task_def_mit(m, TASK_VOLT_PERIOD);
- hard_task_def_group(m, TASK_GROUP);
- pid_m = task_create("Voltage", Voltage_body, &m, NULL);
- if(pid_m == NIL){
- sys = 30;
- sys_end();
- }
-
- hard_task_default_model(d);
- hard_task_def_wcet(d, TASK_DAC_WCET);
- hard_task_def_mit(d, TASK_DAC_PERIOD);
- hard_task_def_group(d, TASK_GROUP);
- pid_d = task_create("DAC Check", DAC_Check_body, &d, NULL);
- if(pid_d == NIL){
- sys = 31;
- sys_end();
- }
-
- //Check if PCI bus is present
- if(pci_init()==-1){
- sys = 10;
- sys_end();
- }
- //Check if a NI board is on PCI bus
- if(!reMap()){
- sys = 11;
- sys_end();
- }
-
- if(grx_init()==-1){
- sys = 20;
- sys_end();
- }
-
- modenum = grx_getmode(800, 600, 16);
- if(modenum == -1){
- sys = 21;
- sys_end();
- }
- grx_setmode(modenum);
-
- drawInterface();
-
- //Analog output section set up
- DAC_Init();
-
- /*
- *AI_TIMEBASE div by 2; OUT_TIMEBASE div by 2; single DAC mode
- *TMRDACWR = 3 OUT_TIMEBASE period; FIFO flags polarity active low
- *TMRDACWR disabled; DMA PIO control = FIFO DATA interface mode
- *UPDATE signal timebase = AO_UPDATE pulse width
- *UPDATE pulsewidth = 3-3.5 OUT_TIMEBASE period
- *UPDATE signal polarity = HIGH Z
- */
- DAC_boardInit(0x02, 0x4000);
- /*
- *LDAC0 source = UPDATE
- *DAC0 update immediately
- *LDAC1 source = UPDATE
- *DAC1 update immediately
- */
- DAC_LDACSourceUpdate(0x00);
- //End of Analog output section setup
-
- group_activate(TASK_GROUP);
-
- return 0;
-}
-
-/*
-* Every time operator select a new value to send to a DAc this TASK makes
-* actions needed to perform the operation
-*/
-TASK Voltage_body(int dac_work)
-{
- WORD old0_value, old1_value;
- char buf[6];
- float volt;
-
- old0_value = dac0_value;
- old1_value = dac1_value;
- while(1){
- if(dac){
- if(dac1_value != old1_value){
- DAC_output(DAC1, dac1_value);
- old1_value = dac1_value;
- sprintf(buf, "%04d", dac1_value);
- grx_text(buf, 70, 120, rgb16(180, 0, 0), rgb16(255,255,140));
- sprintf(buf, "%04x", dac1_value);
- grx_text(buf, 300, 120, rgb16(180, 0, 0), rgb16(255,255,140));
- if( (dac1_value & 0x0800) == 0 )
- volt = (float)dac1_value * (float)CONV;
- else
- volt = (float)(dac1_value-0x0FFF) * (float)CONV;
- sprintf(buf, "%05.2f", volt);
- grx_text(buf, 70, 177, rgb16(180, 40, 180), black);
- }
- } else {
- if(dac0_value != old0_value){
- DAC_output(DAC0, dac0_value);
- old0_value = dac0_value;
- sprintf(buf, "%04d", dac0_value);
- grx_text(buf, 521, 120, rgb16(180, 0, 0), rgb16(255,255,140));
- sprintf(buf, "%04x", dac0_value);
- grx_text(buf, 754, 120, rgb16(180, 0, 0), rgb16(255,255,140));
- if( (dac0_value & 0x0800) == 0 )
- volt = (float)dac0_value * (float)CONV;
- else
- volt = (float)(dac0_value-0x0FFF) * (float)CONV;
- sprintf(buf, "%05.2f", volt);
- grx_text(buf, 521, 177, rgb16(180, 40, 180), black);
- }
- }
- task_endcycle();
- }
-}
-
-/*
-* This TASK show which is the DAC active
-*/
-TASK DAC_Check_body(int dummy)
-{
- BYTE old = dac;
- char buf[8];
-
- while(1){
- if(dac != old){
- old = dac;
- sprintf(buf, "DAC %d", dac);
- grx_text(buf, 385, 90, rgb16(255*dac, 255*(1-dac), 0), black);
- }
- task_endcycle();
- }
-}
-
-void drawInterface(void)
-{
- grx_rect(1, 1, 799, 69, rgb16(105, 0, 0));
- grx_rect(2, 2, 798, 68, rgb16(155, 0, 0));
- grx_rect(3, 3, 797, 67, rgb16(205, 0, 0));
- grx_rect(4, 4, 796, 66, rgb16(255, 0, 0));
-
- grx_text("Test program for Analog output section of PCI6025E",
- 7, 10, rgb16(50, 255, 50), black);
- grx_text("Use '+' and '-' on numeric pad to change tension",
- 7, 25, rgb16(0, 255, 255), black);
- grx_text("Connect a tester to DAC1 output (pin21) or to DAC0 output (pin20)",
- 7, 33, rgb16(0, 255, 255), black);
- grx_text("Use 'v' to alternate change active DAC",
- 7, 40, rgb16(0, 255, 255), black);
-
- grx_text("CTRL-X for Exit", 7, 55, rgb16(200, 200, 0), black);
-
- grx_rect(1, 80, 355, 150, rgb16(0, 105, 0));
- grx_rect(2, 81, 354, 149, rgb16(0, 155, 0));
- grx_rect(3, 82, 353, 148, rgb16(0, 205, 0));
- grx_rect(4, 83, 352, 147, rgb16(0, 255, 0));
-
- grx_rect(1, 160, 355, 199, rgb16(0, 105, 0));
- grx_rect(2, 161, 354, 198, rgb16(0, 155, 0));
- grx_rect(3, 162, 353, 197, rgb16(0, 205, 0));
- grx_rect(4, 163, 352, 196, rgb16(0, 255, 0));
-
- grx_rect(455, 80, 799, 150, rgb16(105, 105, 0));
- grx_rect(456, 81, 798, 149, rgb16(155, 155, 0));
- grx_rect(457, 82, 797, 148, rgb16(205, 205, 0));
- grx_rect(458, 83, 796, 147, rgb16(255, 255, 0));
-
- grx_rect(455, 160, 799, 199, rgb16(105, 105, 0));
- grx_rect(456, 161, 798, 198, rgb16(155, 155, 0));
- grx_rect(457, 162, 797, 197, rgb16(205, 205, 0));
- grx_rect(458, 163, 796, 196, rgb16(255, 255, 0));
-
- grx_rect(360, 80, 450, 105, rgb16(85, 85, 255));
- grx_rect(361, 81, 449, 104, rgb16(125, 125, 255));
- grx_rect(362, 82, 448, 103, rgb16(175, 175, 255));
- grx_rect(363, 83, 447, 102, rgb16(225, 225, 255));
-
- grx_rect(153, 93, 195, 103, rgb16(255, 0, 0));
- grx_text("DAC 1", 155, 95, rgb16(255, 170, 170), black);
-
- grx_rect(607, 93, 649, 103, rgb16(255, 0, 0));
- grx_text("DAC 0", 609, 95, rgb16(255, 255, 210), black);
-
- grx_text("Decimal", 7, 120, rgb16(120, 120, 255), black);
- grx_text("Hexadecimal", 200, 120, rgb16(120, 120, 255), black);
- grx_text("Tension", 7, 177, rgb16(120, 120, 255), black);
-
- grx_text("Decimal", 461, 120, rgb16(255, 120, 120), black);
- grx_text("Hexadecimal", 654, 120, rgb16(255, 120, 120), black);
- grx_text("Tension", 461, 177, rgb16(255, 120, 120), black);
-}
-
-void close_event(void *arg)
-{
- grx_close();
- switch(sys){
- case 0 : cprintf("Regular End\n"); break;
- case 1 : cprintf("End fun invoked\n"); break;
- case 10: cprintf("Pci bus not found\n"); break;
- case 11: cprintf("No National board found\n"); break;
- case 20: cprintf("Cannot initialize graphic envirorment\n"); break;
- case 21: cprintf("Cannot start envirorment in 800x600x16\n"); break;
- case 30: cprintf("Cannot create task <voltage>\n"); break;
- case 31: cprintf("Canot create task <DAC Check>\n"); break;
- case 40: cprintf("Break on clock end event\n"); break;
- default: cprintf("Unkwon exit event\n"); break;
- }
-}
-
-void endfun(KEY_EVT *k)
-{
- sys = 1;
- sys_end();
-}
-
-/*
-* Capture correct key event and increase output tension of active DAC
-*/
-void inc(KEY_EVT *k)
-{
- if(dac){
- if( (dac1_value & 0x0800) == 0 && dac1_value > 0x07FF )
- dac1_value = 0;
- else
- dac1_value++;
- } else {
- if( (dac0_value & 0x0800) == 0 && dac0_value > 0x07FF )
- dac0_value = 0;
- else
- dac0_value++;
- }
-}
-
-/*
-* Same as above but decrease tension
-*/
-void dec(KEY_EVT *k)
-{
- if(dac){
- if(dac1_value < 1)
- dac1_value = 0x0FFF;
- else
- dac1_value -= 1;
- } else {
- if(dac0_value < 1)
- dac0_value = 0x0FFF;
- else
- dac0_value -= 1;
- }
-}
-
-/*
-* Capture correct key event and change active DAC
-*/
-void change_dac(KEY_EVT *k)
-{
- if(dac) dac = 0;
- else dac = 1;
-}
-
Index: rel_1_21/pci6025e/test_ppi.c
===================================================================
--- rel_1_21/pci6025e/test_ppi.c (revision 1217)
+++ rel_1_21/pci6025e/test_ppi.c (nonexistent)
@@ -1,190 +0,0 @@
-/*****************************************************************************
-* Filename: Test_ppi.c *
-* Author: Marco Ziglioli (Doctor Stein) *
-* Date: 22/05/2001 *
-* Description: Test PPI82C55MSM on NI DAQ PCI6025E *
-*----------------------------------------------------------------------------*
-* Notes: Configures port A and port C in input and port B in output *
-* Test 1: *
-* Now connect port B to port A and watch on video value changes *
-* in counting order. After connect port B to port C and watch *
-* the same events on port C *
-* Test 2: *
-* Connect 8 LEDs on port B and port A and port C lines to Vcc or*
-* GND. Now run this test and watch 8 diode changing in counting *
-* mode and on screen port A and port C values displayed *
-*****************************************************************************/
-
-/* This file is part of the S.Ha.R.K. Project - http://shark.sssup.it
- *
- * Copyright (C) 2001 Marco Ziglioli
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-
-#include <drivers/keyb.h>
-#include <drivers/glib.h>
-#include <drivers/pci6025e/dio_ppi.h>
-
-void exit_fun(KEY_EVT *);
-TASK test_ppi(int);
-void close_event(void *);
-void draw_screen(void);
-
-BYTE system = 0;
-
-int main(int argc, char **argv)
-{
- HARD_TASK_MODEL m;
- KEY_EVT k;
- PID pid_m;
- int modenum;
-
- sys_atrunlevel(close_event, NULL, RUNLEVEL_BEFORE_EXIT);
-
- keyb_set_map(itaMap);
- k.flag = CNTL_BIT;
- k.scan = KEY_C;
- k.ascii = 'c';
- keyb_hook(k, exit_fun);
- k.flag = CNTR_BIT;
- k.scan = KEY_C;
- k.ascii = 'c';
- keyb_hook(k, exit_fun);
-
- hard_task_default_model(m);
- hard_task_def_wcet(m, 90000);
- hard_task_def_mit(m, 250000);
- pid_m = task_create("TEST PPI", test_ppi, &m, NULL);
- if(pid_m == NIL){
- system = 10;
- sys_end();
- }
-
- //Check if PCI bus is present
- if(pci_init() == -1){
- system = 20;
- sys_end();
- }
-
- //Look for a National board on PCI bus
- if(!reMap()){
- system = 21;
- sys_end();
- }
-
- //Start configuring DIO module
- PPI_init();
-
- grx_init();
- modenum = grx_getmode(640, 480, 16);
- if(modenum == -1){
- system = 30;
- sys_end();
- }
- grx_setmode(modenum);
-
- draw_screen();
-
- task_activate(pid_m);
-
- return 0;
-}
-
-void draw_screen(void)
-{
- grx_rect(5, 5, 610, 130, rgb16(255, 0, 0));
- grx_rect(4, 4, 611, 131, rgb16(0,255,255));
- grx_rect(3, 3, 612, 132, rgb16(255, 0, 0));
- grx_rect(15, 45, 195, 100, rgb16(255, 0, 0));
- grx_rect(215, 45, 395, 100, rgb16(0, 255, 0));
- grx_rect(415, 45, 595, 100, rgb16(200, 200, 255));
- grx_text("Test of PPI82C55MSM function (Hosted on PCI6025E)",
- 9, 7, rgb16(0, 255, 0), rgb16(0, 0, 0));
- grx_text("PORT A and PORT C are configured in input mode",
- 9, 20, rgb16(255, 70, 70), rgb16(0, 0, 0));
- grx_text("PORT B is configured in output mode",
- 9, 28, rgb16(255, 70, 70), rgb16(0, 0, 0));
- grx_text("PORT B (Output)", 35, 50, rgb16(200, 0, 0), rgb16(0, 0, 0));
- grx_text("PORT A (Input)", 235, 50, rgb16(30,255,30), rgb16(0, 0, 0));
- grx_text("PORT C (Input)", 435, 50, rgb16(200,200,255), rgb16(0, 0, 0));
- grx_text("CTRL + C to exit", 9, 115, rgb16(255,255,0), rgb16(0,0,0));
-}
-
-/*
-* At each activation this task sends out value on port B and reads values from
-* port A and C
-*/
-TASK test_ppi(int dummy)
-{
- BYTE val, pA, pC;
- int i;
- char buf[10];
-
- PPI_config(0x99); //Mode 0 for all; Port A, Port C input; Port B output
- val = 0;
- while(1){
- PPI_write(PPI_PORT_B, val); //sends out value
- pA = PPI_read(PPI_PORT_A); //reads from port A
- pC = PPI_read(PPI_PORT_C); //reads from port C
-
- for(i=7; i>=0; i--){
- if( (val>>i)%2 )
- grx_text("1", 25+10*(7-i), 75, rgb16(255,0,0), rgb16(0,0,0));
- else
- grx_text("0", 25+10*(7-i), 75, rgb16(255,0,0), rgb16(0,0,0));
- if( (pA>>i)%2 )
- grx_text("1", 225+10*(7-i), 75, rgb16(0,255,0), rgb16(0,0,0));
- else
- grx_text("0", 225+10*(7-i), 75, rgb16(0,255,0), rgb16(0,0,0));
- if( (pC>>i)%2 )
- grx_text("1", 425+10*(7-i), 75, rgb16(200,200,255), rgb16(0,0,0));
- else
- grx_text("0", 425+10*(7-i), 75, rgb16(200,200,255), rgb16(0,0,0));
- }
- sprintf(buf, "%03d", val);
- grx_text(buf, 140, 75, rgb16(255,0,0), rgb16(0,0,0));
- sprintf(buf, "%03d", pA);
- grx_text(buf, 340, 75, rgb16(0,255,0), rgb16(0,0,0));
- sprintf(buf, "%03d", pC);
- grx_text(buf, 540, 75, rgb16(200,200,255), rgb16(0,0,0));
- val++;
- task_endcycle();
- }
-}
-
-void close_event(void *arg)
-{
- grx_close();
- switch(system){
- case 0: kern_printf("Regular end\n"); break;
- case 10:kern_printf("Cannot create task 'TEST PPI'\n"); break;
- case 20:kern_printf("Pci bus don't find\n"); break;
- case 21:kern_printf("No National board on PC\n"); break;
- case 30:kern_printf("Cannot start graphic envirorment\n"); break;
- default: kern_printf("Unknown exit\n"); break;
- }
-}
-
-void exit_fun(KEY_EVT *k)
-{
- system = 0;
- sys_end();
-}
-
-/*end of file: test_ppi.c*/
Index: rel_1_21/pci6025e/test_bec.c
===================================================================
--- rel_1_21/pci6025e/test_bec.c (revision 1217)
+++ rel_1_21/pci6025e/test_bec.c (nonexistent)
@@ -1,336 +0,0 @@
-/*****************************************************************************
-* Filename: test_bec.c *
-* Author: Marco Ziglioli (Doctor Stein) *
-* Date: 20/06/2001 *
-* Description: Test program for buffered gated event counting using PCI6025E *
-* board *
-*----------------------------------------------------------------------------*
-* Notes: FOUT are enabled to provide a frequency of 6250 Hz. You could *
-* connect PFI3 (pin 41) and PFI6 (pin 45) to this source for counting *
-* edges. Gated counting are enabled and PFI4 (pin 42) is gate pin for *
-* counter 0 and PFI5 (pin 44) is gate pin for counter 0. DIO 7 and 6 *
-* are als configured to switch between 0 and 5 V. Connect DIO 7 to *
-* gate 0 and DIO 6 to gate 1. Use 'g' (counter 0) and 'h' (counter 1) *
-* to change DIO lines value. On left area of the screen you should *
-* see counter while counting and on the right area you should lock *
-* counter values by pressing 's' key. *
-* Notice that line parameters are enabled and accept inital value *
-* for the two counters. If they aren't specified or they are wrong *
-* counters start from 0x00FFFFFF (counter 0 which counts down) and *
-* 0x00000000 (counter 1 which counts up). *
-*****************************************************************************/
-
-/* This file is part of the S.Ha.R.K. Project - http://shark.sssup.it
- *
- * Copyright (C) 2001 Marco Ziglioli
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-#include <drivers/glib.h>
-
-#include <drivers/pci6025e/timer.h>
-#include <drivers/pci6025e/dio_ppi.h>
-
-BYTE sys = 0;
-
-PID show_aper_pid;
-BYTE out = 0x00;
-
-int black = rgb16(0, 0, 0),
- white = rgb16(255, 255, 255);
-
-void endfun(KEY_EVT *);
-void close_event(void *);
-void show_evt(KEY_EVT *k);
-void gate_change(KEY_EVT *k);
-
-void drawInterface(void);
-
-TASK show_per(int);
-TASK show_aper(int);
-
-int main(int argc, char **argv)
-{
- KEY_EVT k;
- SOFT_TASK_MODEL show_per_mod, show_aper_mod;
- PID show_per_pid;
- int result, modenum;
- DWORD init_val_c0, init_val_c1;
-
- if(argc >= 3){
- if( (result = sscanf(argv[1], "%ld", &init_val_c0)) != 1)
- init_val_c0 = 0x00FFFFFF;
- if( (result = sscanf(argv[2], "%ld", &init_val_c1)) != 1)
- init_val_c1 = 0x00000000;
- }
- if(argc == 2){
- if( (result = sscanf(argv[1], "%ld", &init_val_c0)) != 1)
- init_val_c0 = 0x00FFFFFF;
- init_val_c1 = 0x00000000;
- }
- if(argc == 1){
- init_val_c0 = 0x00FFFFFF;
- init_val_c1 = 0x00000000;
- }
-
- sys_atrunlevel(close_event, NULL, RUNLEVEL_BEFORE_EXIT);
-
- k.flag = CNTL_BIT;
- k.scan = KEY_X;
- k.ascii = 'x';
- keyb_hook(k, endfun);
-
- k.flag = CNTR_BIT;
- keyb_hook(k, endfun);
-
- soft_task_default_model(show_aper_mod);
- soft_task_def_aperiodic(show_aper_mod);
- soft_task_def_level(show_aper_mod, 1);
- soft_task_def_period(show_aper_mod, 250000);
- soft_task_def_met(show_aper_mod, 30000);
- soft_task_def_wcet(show_aper_mod, 60000);
- if( (show_aper_pid = task_create("Show aperiodic task", show_aper, &show_aper_mod, NULL)) == NIL ){
- sys = 10;
- sys_end();
- }
-
- k.flag = 0;
- k.scan = KEY_S;
- k.ascii = 's';
- keyb_hook(k, show_evt);
-
- k.flag = 0;
- k.scan = KEY_G;
- k.ascii = 'g';
- keyb_hook(k, gate_change);
-
- k.scan = KEY_H;
- k.ascii = 'h';
- keyb_hook(k, gate_change);
-
- soft_task_default_model(show_per_mod);
- soft_task_def_level(show_per_mod, 1);
- soft_task_def_met(show_per_mod, 1000);
- soft_task_def_period(show_per_mod, 10000);
- if( (show_per_pid = task_create("Show periodic task", show_per, &show_per_mod, NULL)) == NIL){
- sys = 11;
- sys_end();
- }
-
- if(pci_init()==-1){
- sys = 20;
- sys_end();
- }
-
- if(!reMap()){
- sys = 21;
- sys_end();
- }
-
- if(grx_init()==-1){
- sys = 30;
- sys_end();
- }
-
- if( (modenum = grx_getmode(800, 600, 16)) == -1){
- sys = 31;
- sys_end();
- }
-
- grx_setmode(modenum);
-
- drawInterface();
-
- DIO_init();
- DIO_setup(0xFF);
- DIO_write(out);
-
- PFIprogramming(0x0000);
- setIntClock(1, 1, 0);
- TIM_reset(2); //Reset both two counters
-
-
- //Source PFI3(41); Gate PFI 4(42); Down counting; counts rising edge;
- TIM_bufferedEventCounting(C0, 0x04, 0x45, 0x01, init_val_c0);
-
- //Source PFI6(45); Gate PFI 5(44); Up counting; counts rising edge;
- TIM_bufferedEventCounting(C1, 0x87, 0x46, 0x00, init_val_c1);
-
- TIM_arm(2); //Arm both two counters
-
- task_activate(show_per_pid);
-
- return 0;
-}
-
-void drawInterface(void)
-{
- grx_rect(1, 1, 799, 99, rgb16(105, 0, 0));
- grx_rect(2, 2, 798, 98, rgb16(155, 0, 0));
- grx_rect(3, 3, 797, 97, rgb16(205, 0, 0));
- grx_rect(4, 4, 796, 96, rgb16(255, 0, 0));
-
- grx_text("Test program for Buffered Event Counting capacity of PCI6025E timers",
- 7, 10, rgb16(50, 255, 50), black);
-
- grx_text("This program counting rise edges on counters source (PFI3 & PFI6)",
- 7, 18, rgb16(0, 255, 255), black);
- grx_text("Counter 1 will be resetted every gate falling edge",
- 7, 26, rgb16(0, 255, 255), black);
- grx_text("(PFI 42 & 44) are enabled. Frequency Out (FOUT) is enabled and provides a frequency of 6250 Hz",
- 7, 34, rgb16(0, 255, 255), black);
-
- grx_text("Instruction:",7, 43, rgb16(255, 0, 0), black);
- grx_text("Use 's' to watch contents of Hardware save registers updated every time gate goes down",
- 7, 51, rgb16(0, 255, 255), black);
- grx_text("Use 'g' to generate an event on counter 0 gate (see top-left square)",
- 7, 58, rgb16(0, 255, 255), black);
-
- grx_text("Use 'h' to generate an event on counter 1 gate (see bottom-left square)",
- 7, 65, rgb16(0, 255, 255), black);
-
- grx_text("Please connect DIO7 (pin 32) to PFI4 (pin 42) and DIO6 (pin 30) to PFI5 (pin 44)",
- 7, 78, rgb16(0, 255, 0), black);
- grx_text("CTRL-X for Exit", 7, 88, rgb16(200, 200, 0), black);
-
- grx_rect(1, 110, 355, 170, rgb16(0, 105, 0));
- grx_rect(2, 111, 354, 169, rgb16(0, 155, 0));
- grx_rect(3, 112, 353, 168, rgb16(0, 205, 0));
- grx_rect(4, 113, 352, 167, rgb16(0, 255, 0));
- grx_text("Counter 0 evolution", 7, 120, rgb16(255, 255, 0), black);
-
- grx_rect(455, 110, 799, 170, rgb16(0, 105, 0));
- grx_rect(456, 111, 798, 169, rgb16(0, 155, 0));
- grx_rect(457, 112, 797, 168, rgb16(0, 205, 0));
- grx_rect(458, 113, 796, 167, rgb16(0, 255, 0));
- grx_text("Counter 0 locked value", 461, 120, rgb16(255, 0, 255), black);
-
- grx_rect(360, 110, 450, 170, rgb16(0, 105, 0));
- grx_rect(361, 111, 449, 169, rgb16(0, 155, 0));
- grx_rect(362, 112, 448, 168, rgb16(0, 205, 0));
- grx_rect(363, 113, 447, 167, rgb16(0, 255, 0));
- grx_text("Gate0", 367, 120, rgb16(200, 255, 200), black);
- grx_text("0 V", 367, 145, rgb16(255, 0, 0), black);
-
- grx_rect(1, 190, 355, 260, rgb16(85, 85, 255));
- grx_rect(2, 191, 354, 259, rgb16(135, 135, 255));
- grx_rect(3, 192, 353, 258, rgb16(190, 190, 255));
- grx_rect(4, 193, 352, 257, rgb16(230, 239, 255));
- grx_text("Counter 1 evolution", 7, 200, white, black);
-
- grx_rect(455, 190, 799, 260, rgb16(85, 85, 255));
- grx_rect(456, 191, 798, 259, rgb16(135, 135, 255));
- grx_rect(457, 192, 797, 258, rgb16(190, 190, 255));
- grx_rect(458, 193, 796, 257, rgb16(230, 230, 255));
- grx_text("Counter 1 locked value", 461, 200, white, black);
-
- grx_rect(360, 190, 450, 260, rgb16(85, 85, 255));
- grx_rect(361, 191, 449, 259, rgb16(135, 135, 255));
- grx_rect(362, 192, 448, 258, rgb16(190, 190, 255));
- grx_rect(363, 193, 447, 257, rgb16(230, 230, 255));
- grx_text("Gate1", 367, 200, rgb16(255, 200, 255), black);
- grx_text("0 V", 367, 225, rgb16(255, 0, 0), black);
-}
-
-TASK show_per(int none)
-{
- DWORD val;
- char buf[30];
-
- while(1){
- val = TIM_readCounter(C0); //Read from Hardware Save Register
- sprintf(buf, "HEX: %08lx DEC: %08ld", val ,val);
- grx_text(buf, 7, 145, rgb16(255, 0, 0), black);
-
- val = TIM_readCounter(C1); //Read from Hardware Save Register
- sprintf(buf, "HEX: %08lx DEC: %08ld", val ,val);
- grx_text(buf, 7, 225, rgb16(255, 0, 0), black);
-
- task_endcycle();
- }
-}
-
-TASK show_aper(int dummy)
-{
- DWORD val;
- char buf[30];
-
- while(1){
- val = TIM_readHWSaveReg(C0); //Read from Hardware Save Register
- sprintf(buf, "HEX: %08lx DEC: %08ld", val, val);
- grx_text(buf, 461, 145, rgb16(80, 80, 255), black);
-
- val = TIM_readHWSaveReg(C1); //Read from Hardware Save Register
- sprintf(buf, "HEX: %08lx DEC: %08ld", val, val);
- grx_text(buf, 461, 225, rgb16(80, 80, 255), black);
-
- task_endcycle();
- }
-}
-
-void endfun(KEY_EVT *k)
-{
- sys_end();
-}
-
-void show_evt(KEY_EVT *k)
-{
- task_activate(show_aper_pid);
-}
-
-void gate_change(KEY_EVT *k)
-{
- if(k->ascii == 'g'){
- if( (out & 0x80) != 0){
- out &= 0x7F;
- grx_text("0 V", 367, 145, rgb16(255, 0, 0), black);
- } else {
- out |= 0x80;
- grx_text("5 V", 367, 145, rgb16(0, 255, 0), black);
- }
- } else {
- if( (out & 0x40) != 0){
- out &= 0xBF;
- grx_text("0 V", 367, 225, rgb16(255, 0, 0), black);
- } else {
- out |= 0x40;
- grx_text("5 V", 367, 225, rgb16(0, 255, 0), black);
- }
- }
-
- DIO_write(out);
-}
-
-void close_event(void *arg)
-{
- TIM_disarm(2); //Disable both two counters
- grx_close();
-
- switch(sys){
- case 0: cprintf("OK\n"); break;
- case 10: cprintf("Task <show aperiodic> down\n"); break;
- case 11: cprintf("Task <show periodic> down\n"); break;
- case 20: cprintf("No PCI bus\n"); break;
- case 21: cprintf("No National board on PCI bus\n"); break;
- case 30: cprintf("No graphic can be initialized\n"); break;
- case 31: cprintf("This graphic mode cannot be supported\n"); break;
- default: cprintf("???????????\n"); break;
- }
-}
-/* End of file: Test_bec.c */
Index: rel_1_21/pci6025e/test_dio.c
===================================================================
--- rel_1_21/pci6025e/test_dio.c (revision 1217)
+++ rel_1_21/pci6025e/test_dio.c (nonexistent)
@@ -1,184 +0,0 @@
-/*****************************************************************************
-* Filename: Test_dio.c *
-* Author: Marco Ziglioli (Doctor Stein) *
-* Date: 22/03/2001 *
-* Last update: 22/03/2001 *
-* Description: Test STC digital lines (8 lines) *
-*----------------------------------------------------------------------------*
-* Notes: Configure DIO 4 5 6 7 in input and DIO 0 1 2 3 in output *
-* Two way to test this 8 lines: *
-* 1) Connect 4 LEDs to output lines and check LEDs lights *
-* themselves in counting order. Connect input lines to Vcc *
-* or GND and check on video that STC has readed the right *
-* nibble *
-* 2) Connect 4 output lines with 4 input lines and check on *
-* video that the nibble readed by STC change in counting *
-* order *
-*****************************************************************************/
-
-/* This file is part of the S.Ha.R.K. Project - http://shark.sssup.it
- *
- * Copyright (C) 2001 Marco Ziglioli
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <drivers/glib.h>
-#include <drivers/keyb.h>
-#include <drivers/pci6025e/dio_ppi.h>
-
-BYTE system = 0;
-
-void close_event(void *);
-TASK test_DIO(int dummy);
-void exit_fun(KEY_EVT *);
-void draw_screen(void);
-
-
-int main(int argc, char **argv)
-{
- HARD_TASK_MODEL m;
- KEY_EVT k;
- PID pid_m;
- int modenum;
-
- sys_atrunlevel(close_event, NULL, RUNLEVEL_BEFORE_EXIT);
-
- keyb_set_map(itaMap);
- k.flag = CNTL_BIT;
- k.scan = KEY_C;
- k.ascii = 'c';
- keyb_hook(k, exit_fun);
- k.flag = CNTR_BIT;
- k.scan = KEY_C;
- k.ascii = 'c';
- keyb_hook(k, exit_fun);
-
- hard_task_default_model(m);
- hard_task_def_wcet(m, 90000);
- hard_task_def_mit(m, 250000);
- pid_m = task_create("TEST DIO", test_DIO, &m, NULL);
- if(pid_m == NIL){
- system = 10;
- sys_end();
- }
-
- //Check if PCI bus is present
- if(pci_init() == -1){
- system = 20;
- sys_end();
- }
-
- //Look for a National board on PCI bus
- if(!reMap()){
- system = 21;
- sys_end();
- }
-
- //Start configuring DIO module
- DIO_init();
-
- grx_init();
- modenum = grx_getmode(640, 480, 16);
- if(modenum == -1){
- system = 30;
- sys_end();
- }
- grx_setmode(modenum);
-
- draw_screen();
-
- task_activate(pid_m);
-
- return 0;
-}
-
-void draw_screen(void)
-{
- grx_rect(5, 5, 405, 130, rgb16(255, 0, 0));
- grx_rect(4, 4, 406, 131, rgb16(0,255,255));
- grx_rect(3, 3, 407, 132, rgb16(255, 0, 0));
- grx_rect(15, 45, 195, 100, rgb16(255, 0, 0));
- grx_rect(215, 45, 395, 100, rgb16(0, 255, 0));
- grx_text("Test of PCI6025E DIO function",
- 9, 7, rgb16(0, 255, 0), rgb16(0, 0, 0));
- grx_text("DIO 4-5-6-7 are configured in input mode",
- 9, 20, rgb16(255, 70, 70), rgb16(0, 0, 0));
- grx_text("DIO 0-1-2-3 are configured in output mode",
- 9, 28, rgb16(255, 70, 70), rgb16(0, 0, 0));
- grx_text("Output bits", 35, 50, rgb16(200, 0, 0), rgb16(0, 0, 0));
- grx_text("input bits", 235, 50, rgb16(30,255,30), rgb16(0, 0, 0));
- grx_text("CTRL + C to exit", 9, 115, rgb16(255,255,0), rgb16(0,0,0));
-}
-
-/*
-* At each activation this task change output value of lowest digitals line
-* and read value on highest digital lines, showing them at video
-*/
-TASK test_DIO(int dummy)
-{
- BYTE out_val = 0x00,
- in_val = 0;
- int i;
- char buf[10];
-
- //DIO 0..3 configured as output
- //DIO 4..7 configured as input
- DIO_setup(0x0F);
-
- while(1){
- DIO_write(out_val); //sends out value
- in_val = DIO_read() >> 4; //reads value
-
- for(i=3; i>=0; i--){
- if( (out_val>>i)%2 )
- grx_text("1", 25+10*(3-i), 75, rgb16(255,0,0), rgb16(0,0,0));
- else
- grx_text("0", 25+10*(3-i), 75, rgb16(255,0,0), rgb16(0,0,0));
- if( (in_val>>i)%2 )
- grx_text("1", 225+10*(3-i), 75, rgb16(0,255,0), rgb16(0,0,0));
- else
- grx_text("0", 225+10*(3-i), 75, rgb16(0,255,0), rgb16(0,0,0));
- }
- sprintf(buf, "%03d", out_val);
- grx_text(buf, 80, 75, rgb16(255,0,0), rgb16(0,0,0));
- sprintf(buf, "%03d", in_val);
- grx_text(buf, 280, 75, rgb16(0,255,0), rgb16(0,0,0));
-
- out_val = (out_val+1)%16;
- task_endcycle();
- }
-}
-
-void close_event(void *arg)
-{
- grx_close();
- switch(system){
- case 0: kern_printf("Regular end\n"); break;
- case 10:kern_printf("Cannot create task TEST DIO\n"); break;
- case 20:kern_printf("Pci bus don't find\n"); break;
- case 21:kern_printf("No National board on PC\n"); break;
- case 30:kern_printf("Cannot start graphic envirorment\n"); break;
- default: kern_printf("Unknown exit\n"); break;
- }
-}
-
-void exit_fun(KEY_EVT *k)
-{
- system = 0;
- sys_end();
-}
-
Index: rel_1_21/pci6025e/readme
===================================================================
--- rel_1_21/pci6025e/readme (revision 1217)
+++ rel_1_21/pci6025e/readme (nonexistent)
@@ -1,7 +0,0 @@
-These are the demos available for the National Instruments PCI6025e boards.
-
-These demos and the PCI driver have been made by
-Marco Ziglioli (zi_mar@libero.it). Please send any comments to:
-zi_mar@libero.it or to shark-help@gandalf.sssup.it.
-
-Paolo
Index: rel_1_21/pci6025e/makefile
===================================================================
--- rel_1_21/pci6025e/makefile (revision 1217)
+++ rel_1_21/pci6025e/makefile (nonexistent)
@@ -1,32 +0,0 @@
-#
-#
-# PCI6025E Examples and Test programs
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS= test_dac wave test_dio test_ppi test_ec test_bec test_mes test_bms
-
-include $(BASE)/config/example.mk
-
-test_dac:
- make -f $(SUBMAKE) APP=test_dac OTHEROBJS=initfile.o SHARKOPT="__6025E__ __OLDCHAR__ __GRX__"
-wave:
- make -f $(SUBMAKE) APP=wave OTHEROBJS=initfile.o SHARKOPT="__6025E__ __OLDCHAR__ __GRX__"
-test_dio:
- make -f $(SUBMAKE) APP=test_dio OTHEROBJS=initfile.o SHARKOPT="__6025E__ __OLDCHAR__ __GRX__"
-test_ppi:
- make -f $(SUBMAKE) APP=test_ppi OTHEROBJS=initfile.o SHARKOPT="__6025E__ __OLDCHAR__ __GRX__"
-test_ec:
- make -f $(SUBMAKE) APP=test_ec OTHEROBJS=initfile.o SHARKOPT="__6025E__ __OLDCHAR__ __GRX__"
-test_bec:
- make -f $(SUBMAKE) APP=test_bec OTHEROBJS=initfile.o SHARKOPT="__6025E__ __OLDCHAR__ __GRX__"
-test_mes:
- make -f $(SUBMAKE) APP=test_mes OTHEROBJS=initfile.o SHARKOPT="__6025E__ __OLDCHAR__ __GRX__"
-test_bms:
- make -f $(SUBMAKE) APP=test_bms OTHEROBJS=initfile.o SHARKOPT="__6025E__ __OLDCHAR__ __GRX__"
-
Index: rel_1_21/pci6025e/test_bms.c
===================================================================
--- rel_1_21/pci6025e/test_bms.c (revision 1217)
+++ rel_1_21/pci6025e/test_bms.c (nonexistent)
@@ -1,279 +0,0 @@
-/*****************************************************************************
-* Filename: test_bms.c *
-* Author: Marco Ziglioli (Doctor Stein) *
-* Date: 27/06/2001 *
-* Description: Test program for buffered period and semiperiod measurement *
-* capacity of National PCI6025E board *
-*----------------------------------------------------------------------------*
-* Notes: FOUT are enable and avaiable on pin 50 to provide 1 Mhz frequency *
-* You should connect source 0 (PIN 41) and source 1 (pin 45) to this *
-* freq source. Gate 0 (pin 42) and gate 1 (pin 44) must be connected *
-* rispectivly to DIO7 (pin 32) and DIO6 (pin 30). *
-* Use 'g' button to activate gate_action_task which generate a square *
-* wave with a freq of 0.5 Hz and Duty cycle of 75%. *
-* 's' button should show counters countent but gate_action_task *
-* when active shows counters content automatically so 's' button isn't*
-* useful. *
-*****************************************************************************/
-
-/* This file is part of the S.Ha.R.K. Project - http://shark.sssup.it
- *
- * Copyright (C) 2001 Marco Ziglioli
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <kernel/kern.h>
-#include <drivers/keyb.h>
-#include <drivers/glib.h>
-
-#include <drivers/pci6025e/timer.h>
-#include <drivers/pci6025e/dio_ppi.h>
-
-#define SHOW_MET 30000
-#define SHOW_WCET 50000
-#define SHOW_PERIOD 1000000
-
-#define GATE_MET 2000
-#define GATE_WCET 5000
-#define GATE_PERIOD 2000000
-
-#define GATE_ACTION_P 500000
-#define GATE_ACTION_W 10000
-
-#define black rgb16(0, 0, 0)
-
-void endFun(KEY_EVT *);
-void gateEvent(KEY_EVT *);
-void showEvent(KEY_EVT *);
-
-void closeEvent(void *);
-
-void drawInterface(void);
-
-TASK show_val_body(int);
-TASK gate_action_body(int);
-
-BYTE sys = 0;
-PID show_val_pid, gate_action_pid;
-
-int main(int argc, char **argv)
-{
- KEY_EVT k;
- int modenum;
- SOFT_TASK_MODEL show_val_mod;
- HARD_TASK_MODEL gate_action_model;
-
- sys_atrunlevel(closeEvent, NULL, RUNLEVEL_BEFORE_EXIT);
-
- k.flag = CNTL_BIT;
- k.scan = KEY_X;
- k.ascii = 'x';
- keyb_hook(k, endFun);
-
- k.flag = CNTR_BIT;
- keyb_hook(k, endFun);
-
- k.flag = 0;
- k.scan = KEY_G;
- k.ascii = 'g';
- keyb_hook(k, gateEvent);
-
- k.scan = KEY_S;
- k.ascii = 's';
- keyb_hook(k, showEvent);
-
- if(pci_init()==-1){
- sys = 10;
- sys_end();
- }
-
- if(!reMap()){
- sys = 11;
- sys_end();
- }
-
- soft_task_default_model(show_val_mod);
- soft_task_def_aperiodic(show_val_mod);
- soft_task_def_level(show_val_mod, 1);
- soft_task_def_met(show_val_mod, SHOW_MET);
- soft_task_def_wcet(show_val_mod, SHOW_WCET);
- soft_task_def_period(show_val_mod, SHOW_PERIOD);
- if( (show_val_pid = task_create("Show task", show_val_body, &show_val_mod, NULL))
- == NIL ){
- sys = 20;
- sys_end();
- }
-
- hard_task_default_model(gate_action_model);
- hard_task_def_mit(gate_action_model, GATE_ACTION_P);
- hard_task_def_wcet(gate_action_model, GATE_ACTION_W);
- if( (gate_action_pid = task_create("Gate Action", gate_action_body, &gate_action_model, NULL))
- == NIL ){
- sys = 22;
- sys_end();
- }
-
- if(grx_init()==-1){
- sys = 30;
- sys_end();
- }
-
- if( (modenum = grx_getmode(800, 600, 16)) == -1){
- sys = 31;
- sys_end();
- }
-
- if(grx_setmode(modenum) == -1){
- sys = 32;
- sys_end();
- }
-
- drawInterface();
-
- DIO_init();
- DIO_setup(0xFF);
- DIO_write(0x00);
-
- //All PFI configured as input
- PFIprogramming(0x0000);
-
- //Fout provide 1MHz: timebase = 20MHz; divided by 2; on FOUT pin also divided by 10
- setIntClock(0, 1, 10);
-
- //Reset both counters
- TIM_reset(2);
-
- //C0 measures period on PFI3 with gate from PFI 4 driven by DIO7
- TIM_bufferedTimeMeasurement(C0, 0x04, 0x45, 0, 0);
-
- //C1 measures semiperiod on PFI 6 with gate from PFI 5 driven by FIO6
- TIM_bufferedTimeMeasurement(C1, 0x87, 0x46, 1, 0);
-
- //arm both counters
- TIM_arm(2);
-
- return 0;
-}
-
-void endFun(KEY_EVT *k)
-{
- sys_end();
-}
-
-void showEvent(KEY_EVT *k)
-{
- task_activate(show_val_pid);
-}
-
-void gateEvent(KEY_EVT *k)
-{
- task_activate(gate_action_pid);
-}
-
-void drawInterface(void)
-{
- grx_rect(1, 1, 799, 129, rgb16(105, 0, 0));
- grx_rect(2, 2, 798, 128, rgb16(155, 0, 0));
- grx_rect(3, 3, 797, 127, rgb16(205, 0, 0));
- grx_rect(4, 4, 796, 126, rgb16(255, 0, 0));
-
- grx_text("Test program for Buffered Period and Semiperiod measure through PCI6025E timers",
- 7, 10, rgb16(50, 255, 50), black);
-
- grx_text("This program counting rise edges on counters source (PFI3 & PFI6) between two rising",
- 7, 25, rgb16(0, 255, 255), black);
- grx_text("edges on gate (PFI 42) and beetwen each gate edge (PFI44).FOUT is enabled and",
- 7, 33, rgb16(0, 255, 255), black);
- grx_text("provides a frequency of 1 MHz", 7, 41, rgb16(0, 255, 255), black);
- grx_text("Instruction:",7, 53, rgb16(255, 0, 0), black);
- grx_text("Use 's' to see counters value",
- 7, 61, rgb16(0, 255, 255), black);
- grx_text("Use 'g' to enbale automatic tasks which generate square wave with freq of 0.5Hz",
- 7, 68, rgb16(0, 255, 255), black);
-
- grx_text("And duty cycle of 75%. Counter 0 must be loaded with about 2E6 ticks and counter 1",
- 7, 75, rgb16(0, 255, 255), black);
- grx_text("must be loaded alternativly with about 1.5E6 and 0.5E6 ticks",
- 7, 83, rgb16(0, 255, 255), black);
-
- grx_text("Please connect DIO7 (pin 32) to PFI4 (pin 42) and DIO6 (pin 30) to PFI5 (pin 44)",
- 7, 95, rgb16(0, 255, 0), black);
- grx_text("CTRL-X for Exit", 7, 110, rgb16(200, 200, 0), black);
-
- grx_rect(1, 147, 355, 183, rgb16(0, 105, 0));
- grx_rect(2, 148, 354, 182, rgb16(0, 155, 0));
- grx_rect(3, 149, 353, 181, rgb16(0, 205, 0));
- grx_rect(4, 150, 352, 180, rgb16(0, 255, 0));
- grx_text("Period", 7, 155, rgb16(255, 255, 0), black);
-
- grx_rect(455, 147, 799, 183, rgb16(0, 105, 0));
- grx_rect(456, 148, 798, 182, rgb16(0, 155, 0));
- grx_rect(457, 149, 797, 181, rgb16(0, 205, 0));
- grx_rect(458, 150, 796, 180, rgb16(0, 255, 0));
- grx_text("Semiperiod", 461, 155, rgb16(255, 0, 255), black);
-}
-
-TASK show_val_body(int dummy)
-{
- DWORD val;
- char buf[40];
-
- while(1){
- val = TIM_readHWSaveReg(C0);
- sprintf(buf,"C0 %07ld", val);
- grx_text(buf, 7, 165, rgb16(255, 0, 0), rgb16(0, 0, 0));
- val = TIM_readHWSaveReg(C1);
- sprintf(buf,"C1 %07ld", val);
- grx_text(buf, 461, 165, rgb16(0, 255, 0), rgb16(0, 0, 0));
-
- task_endcycle();
- }
-}
-
-TASK gate_action_body(int dummy)
-{
- int i;
- i = 0;
-
- while(1){
- if( (i%4)==0 ) DIO_write(0xC0);
- if( (i%4)==3 ) DIO_write(0x00);
-
- i++;
-
- task_activate(show_val_pid);
-
- task_endcycle();
- }
-}
-
-void closeEvent(void *arg)
-{
- grx_close();
- TIM_disarm(2);
- switch(sys){
- case 0: cprintf("Ok\n"); break;
- case 10: cprintf("No PCI\n"); break;
- case 11: cprintf("No National Board\n"); break;
- case 20: cprintf("task <show val> down\n"); break;
- case 22: cprintf("task <gate action> down\n"); break;
- case 30: cprintf("Cannot initialize grx\n"); break;
- case 31: cprintf("Resolution 800x600x16 not supported\n"); break;
- case 32: cprintf("Cannot sets up graphic envirorment\n"); break;
- default: cprintf("????????????\n"); break;
- }
-}
Index: rel_1_21/cbs_ft/cbs_ft.c
===================================================================
--- rel_1_21/cbs_ft/cbs_ft.c (revision 1217)
+++ rel_1_21/cbs_ft/cbs_ft.c (nonexistent)
@@ -1,812 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@hartik.sssup.it>
- *
- * Authors : Marco Caccamo and Paolo Gai
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: cbs_ft.c,v 1.4 2003-01-07 17:10:16 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.4 $
- Last update: $Date: 2003-01-07 17:10:16 $
- ------------
-
- This file contains the server CBS_FT
-
- Read CBS_FT.h for further details.
-
-**/
-
-/*
- * Copyright (C) 2000 Marco Caccamo and Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#include "cbs_ft.h"
-
-/*+ Status used in the level +*/
-#define CBS_FT_IDLE APER_STATUS_BASE /*+ waiting the activation +*/
-#define CBS_FT_ZOMBIE APER_STATUS_BASE+1 /*+ waiting the period end +*/
-
-/* structure of an element of the capacity queue */
-struct cap_queue {
- int cap;
- struct timespec dead;
- struct cap_queue *next;
-};
-
-/*+ the level redefinition for the CBS_FT level +*/
-typedef struct {
- level_des l; /*+ the standard level descriptor +*/
-
- /* The wcet are stored in the task descriptor, but we need
- an array for the deadlines. We can't use the timespec_priority
- field because it is used by the master level!!!...
- Notice that however the use of the timespec_priority field
- does not cause any problem... */
-
- struct timespec cbs_ft_dline[MAX_PROC]; /*+ CBS_FT deadlines +*/
-
-
- TIME period[MAX_PROC]; /*+ CBS_FT activation period +*/
-
-
- int maxcap[MAX_PROC]; /* amount of capacity reserved to a primary+backup
- couple */
-
- PID backup[MAX_PROC]; /* Backup task pointers, defined for primary tasks */
-
- char CP[MAX_PROC]; /* checkpoint flag */
-
- char P_or_B[MAX_PROC]; /* Type of task: PRIMARY or BACKUP */
-
-
- struct timespec reactivation_time[MAX_PROC];
- /*+ the time at witch the reactivation timer is post +*/
-
- int reactivation_timer[MAX_PROC]; /*+ the recativation timer +*/
-
- struct cap_queue *queue; /* pointer to the spare capacity queue */
-
- int flags; /*+ the init flags... +*/
-
- bandwidth_t U; /*+ the used bandwidth by the server +*/
-
- int idle; /* the idle flag... */
-
- struct timespec start_idle; /*gives the start time of the last idle period */
-
- LEVEL scheduling_level;
-
-} CBS_FT_level_des;
-
-
-
-/* insert a capacity in the queue capacity ordering by deadline */
-
-static int c_insert(struct timespec dead, int cap, struct cap_queue **que,
- PID p)
-{
- struct cap_queue *prev, *n, *new;
-
- prev = NULL;
- n = *que;
-
- while ((n != NULL) &&
- !TIMESPEC_A_LT_B(&dead, &n->dead)) {
- prev = n;
- n = n->next;
- }
-
-
- new = (struct cap_queue *)kern_alloc(sizeof(struct cap_queue));
- if (new == NULL) {
- kern_printf("\nNew cash_queue element failed\n");
- kern_raise(XINVALID_TASK, p);
- return -1;
- }
- new->next = NULL;
- new->cap = cap;
- new->dead = dead;
-
- if (prev != NULL)
- prev->next = new;
- else
- *que = new;
-
- if (n != NULL)
- new->next = n;
- return 0;
-
-}
-
-/* extract the first element from the capacity queue */
-
-int c_extractfirst(struct cap_queue **que)
-{
- struct cap_queue *p = *que;
-
-
- if (*que == NULL) return(-1);
-
- *que = (*que)->next;
-
- kern_free(p, sizeof(struct cap_queue));
- return(1);
-}
-
-/* read data of the first element from the capacity queue */
-
-static void c_readfirst(struct timespec *d, int *c, struct cap_queue *que)
-{
- *d = que->dead;
- *c = que->cap;
-}
-
-/* write data of the first element from the capacity queue */
-
-static void c_writefirst(struct timespec dead, int cap, struct cap_queue *que)
-{
- que->dead = dead;
- que->cap = cap;
-}
-
-
-static void CBS_FT_activation(CBS_FT_level_des *lev,
- PID p,
- struct timespec *acttime)
-{
- JOB_TASK_MODEL job;
- int capacity;
-
- /* This rule is used when we recharge the budget at initial task activation
- and each time a new task instance must be activated */
-
- if (TIMESPEC_A_GT_B(acttime, &lev->cbs_ft_dline[p])) {
- /* we modify the deadline ... */
- TIMESPEC_ASSIGN(&lev->cbs_ft_dline[p], acttime);
- }
-
-
- if (proc_table[p].avail_time > 0)
- proc_table[p].avail_time = 0;
-
-
-
- /* A spare capacity is inserted in the capacity queue!! */
- ADDUSEC2TIMESPEC(lev->period[p], &lev->cbs_ft_dline[p]);
- capacity = lev->maxcap[p] - proc_table[ lev->backup[p] ].wcet;
- c_insert(lev->cbs_ft_dline[p], capacity, &lev->queue, p);
-
-
- /* it exploits available capacities from the capacity queue */
- while (proc_table[p].avail_time < proc_table[p].wcet &&
- lev->queue != NULL) {
- struct timespec dead;
- int cap, delta;
- delta = proc_table[p].wcet - proc_table[p].avail_time;
- c_readfirst(&dead, &cap, lev->queue);
- if (!TIMESPEC_A_GT_B(&dead, &lev->cbs_ft_dline[p])) {
- if (cap > delta) {
- proc_table[p].avail_time += delta;
- c_writefirst(dead, cap - delta, lev->queue);
- }
- else {
- proc_table[p].avail_time += cap;
- c_extractfirst(&lev->queue);
- }
- }
- else
- break;
- }
-
- /* If the budget is still less than 0, an exception is raised */
- if (proc_table[p].avail_time <= 0) {
- kern_printf("\nnegative value for the budget!\n");
- kern_raise(XINVALID_TASK, p);
- return;
- }
-
-
-
- /*if (p==6)
- kern_printf("(act_time:%d dead:%d av_time:%d)\n",
- acttime->tv_sec*1000000+
- acttime->tv_nsec/1000,
- lev->cbs_ft_dline[p].tv_sec*1000000+
- lev->cbs_ft_dline[p].tv_nsec/1000,
- proc_table[p].avail_time); */
-
-
-
-
-
-
-#ifdef TESTG
- if (starttime && p == 3) {
- oldx = x;
- x = ((lev->cbs_ft_dline[p].tv_sec*1000000+lev->cbs_ft_dline[p].tv_nsec/1000)/5000 - starttime) + 20;
- // kern_printf("(a%d)",lev->cbs_ft_dline[p].tv_sec*1000000+lev->cbs_ft_dline[p].tv_nsec/1000);
- if (oldx > x) sys_end();
- if (x<640)
- grx_plot(x, 15, 8);
- }
-#endif
-
- /* and, finally, we reinsert the task in the master level */
- job_task_default_model(job, lev->cbs_ft_dline[p]);
- job_task_def_yesexc(job);
- level_table[ lev->scheduling_level ]->
- private_insert(lev->scheduling_level, p, (TASK_MODEL *)&job);
-}
-
-
-/* this is the periodic reactivation of the task... */
-static void CBS_FT_timer_reactivate(void *par)
-{
- PID p = (PID) par;
- CBS_FT_level_des *lev;
- struct timespec t;
-
- lev = (CBS_FT_level_des *)level_table[proc_table[p].task_level];
-
- if (proc_table[p].status == CBS_FT_IDLE) {
- /* the task has finished the current activation and must be
- reactivated */
-
- /* request_time represents the time of the last instance release!! */
- TIMESPEC_ASSIGN(&t, &lev->reactivation_time[p]);
-
- /* If idle=1, then we have to discharge the capacities stored in
- the capacity queue up to the length of the idle interval */
- if (lev->idle == 1) {
- TIME interval;
- struct timespec delta;
- lev->idle = 0;
- SUBTIMESPEC(&t, &lev->start_idle, &delta);
- /* length of the idle interval expressed in usec! */
- interval = TIMESPEC2NANOSEC(&delta) / 1000;
-
- /* it discharges the available capacities from the capacity queue */
- while (interval > 0 && lev->queue != NULL) {
- struct timespec dead;
- int cap;
- c_readfirst(&dead, &cap, lev->queue);
- if (cap > interval) {
- c_writefirst(dead, cap - interval, lev->queue);
- interval = 0;
- }
- else {
- interval -= cap;
- c_extractfirst(&lev->queue);
- }
- }
- }
-
- CBS_FT_activation(lev,p,&lev->reactivation_time[p]);
-
-
- /* Set the reactivation timer */
- TIMESPEC_ASSIGN(&lev->reactivation_time[p], &lev->cbs_ft_dline[p]);
- lev->reactivation_timer[p] = kern_event_post(&lev->reactivation_time[p],
- CBS_FT_timer_reactivate,
- (void *)p);
- event_need_reschedule();
- }
- else {
- /* this situation cannot occur */
- kern_printf("\nTrying to reactivate a primary task which is not IDLE!\n");
- kern_raise(XINVALID_TASK,p);
- }
-}
-
-
-
-static void CBS_FT_avail_time_check(CBS_FT_level_des *lev, PID p)
-{
-
- /*+ if the capacity became negative the remaining computation time
- is diminuished.... +*/
- /* if (p==4)
- kern_printf("(old dead:%d av_time:%d)\n",
- lev->cbs_ft_dline[p].tv_sec*1000000+
- lev->cbs_ft_dline[p].tv_nsec/1000,
- proc_table[p].avail_time); */
-
-
- int newcap = proc_table[p].wcet / 100 * 30;
- if (newcap <= 0)
- newcap = proc_table[p].wcet;
- /* it exploits available capacities from the capacity queue */
- while (proc_table[p].avail_time < newcap
- && lev->queue != NULL) {
- struct timespec dead;
- int cap, delta;
- delta = newcap - proc_table[p].avail_time;
- c_readfirst(&dead, &cap, lev->queue);
- if (!TIMESPEC_A_GT_B(&dead, &lev->cbs_ft_dline[p])) {
- if (cap > delta) {
- proc_table[p].avail_time += delta;
- c_writefirst(dead, cap - delta, lev->queue);
- }
- else {
- proc_table[p].avail_time += cap;
- c_extractfirst(&lev->queue);
- }
- }
- else
- break;
- }
-
-
-
- /*if (p==6)
- kern_printf("(ATC dead:%d av_time:%d)\n",
- lev->cbs_ft_dline[p].tv_sec*1000000+
- lev->cbs_ft_dline[p].tv_nsec/1000,
- proc_table[p].avail_time); */
-
-
-
- /* if the budget is still empty, the backup task must be woken up.
- Remind that a short chunk of primary will go ahead executing
- before the task switch occurs */
- if (proc_table[p].avail_time <= 0) {
- lev->CP[p] = 1;
- proc_table[p].avail_time += proc_table[ lev->backup[p] ].wcet;
- }
-
-
- /*if (p==6)
- kern_printf("(ATC1 dead:%d av_time:%d)\n",
- lev->cbs_ft_dline[p].tv_sec*1000000+
- lev->cbs_ft_dline[p].tv_nsec/1000,
- proc_table[p].avail_time); */
-
-
-
-}
-
-
-/*+ this function is called when a killed or ended task reach the
- period end +*/
-static void CBS_FT_timer_zombie(void *par)
-{
- PID p = (PID) par;
- CBS_FT_level_des *lev;
-
- lev = (CBS_FT_level_des *)level_table[proc_table[p].task_level];
-
- /* we finally put the task in the FREE status */
- proc_table[p].status = FREE;
- iq_insertfirst(p,&freedesc);
-
-
- /* and free the allocated bandwidth */
- lev->U -= (MAX_BANDWIDTH / lev->period[p]) * (TIME)lev->maxcap[p];
-}
-
-static PID CBS_FT_public_scheduler(LEVEL l)
-{
- CBS_FT_level_des *lev = (CBS_FT_level_des *)(level_table[l]);
-
- /* it stores the actual time and set the IDLE flag in order to handle
- the capacity queue discharging!!! */
- lev->idle = 1;
- kern_gettime(&lev->start_idle);
-
-
- /* the CBS_FT don't schedule anything...
- it's an EDF level or similar that do it! */
- return NIL;
-}
-
-
-/* The on-line guarantee is enabled only if the appropriate flag is set... */
-static int CBS_FT_public_guarantee(LEVEL l, bandwidth_t *freebandwidth)
-{
- CBS_FT_level_des *lev = (CBS_FT_level_des *)(level_table[l]);
-
- if (lev->flags & CBS_FT_FAILED_GUARANTEE) {
- *freebandwidth = 0;
- kern_printf("guarantee :garanzia fallita!!!!!!\n");
- return 0;
- }
- else if (*freebandwidth >= lev->U) {
- *freebandwidth -= lev->U;
- return 1;
- }
- else {
- kern_printf("guarantee :garanzia fallita per mancanza di banda!!!!!!\n");
- kern_printf("freeband: %d request band: %d", *freebandwidth, lev->U);
- return 0;
- }
-}
-
-
-static int CBS_FT_public_create(LEVEL l, PID p, TASK_MODEL *m)
-
-{
- CBS_FT_level_des *lev = (CBS_FT_level_des *)(level_table[l]);
- FT_TASK_MODEL *s;
-
- if (m->pclass != FT_PCLASS) return -1;
- if (m->level != 0 && m->level != l) return -1;
- s = (FT_TASK_MODEL *) m;
- //kern_printf("accept :FAULT TOLERANT TASK found!!!!!!\n"); */
- if (!(s->type == PRIMARY && s->execP > 0 && s->budget < (int)s->period
- && s->backup != NIL)) return -1;
- if (!(s->type == BACKUP && s->wcetB > 0))
- return -1;
- /* now we know that m is a valid model */
-
- /* Enable budget check */
- proc_table[p].control |= CONTROL_CAP;
-
- proc_table[p].avail_time = 0;
- NULL_TIMESPEC(&lev->cbs_ft_dline[p]);
-
-
- if (s->type == PRIMARY) {
- proc_table[p].wcet = (int)s->execP;
- lev->period[p] = s->period;
- lev->maxcap[p] = s->budget;
- lev->backup[p] = s->backup;
- lev->CP[p] = 0;
- lev->P_or_B[p] = PRIMARY;
-
- /* update the bandwidth... */
- if (lev->flags & CBS_FT_ENABLE_GUARANTEE) {
- bandwidth_t b;
- b = (MAX_BANDWIDTH / lev->period[p]) * (TIME)lev->maxcap[p];
-
- /* really update lev->U, checking an overflow... */
- if (MAX_BANDWIDTH - lev->U > b)
- lev->U += b;
- else
- /* The task can NOT be guaranteed (U>MAX_BANDWIDTH)...
- (see EDF.c) */
- lev->flags |= CBS_FT_FAILED_GUARANTEE;
- }
- }
- else {
- proc_table[p].wcet = (int)s->wcetB;
- lev->P_or_B[p] = BACKUP;
-
- /* Backup tasks are unkillable tasks! */
- proc_table[p].control |= NO_KILL;
- }
-
- return 0; /* OK, also if the task cannot be guaranteed... */
-}
-
-
-static void CBS_FT_public_detach(LEVEL l, PID p)
-{
- /* the CBS_FT level doesn't introduce any dynamic allocated new field.
- we have only to reset the NO_GUARANTEE FIELD and decrement the allocated
- bandwidth */
-
- CBS_FT_level_des *lev = (CBS_FT_level_des *)(level_table[l]);
-
- if (lev->flags & CBS_FT_FAILED_GUARANTEE)
- lev->flags &= ~CBS_FT_FAILED_GUARANTEE;
- else
- lev->U -= (MAX_BANDWIDTH / lev->period[p]) * (TIME)lev->maxcap[p];
-}
-
-
-static void CBS_FT_public_dispatch(LEVEL l, PID p, int nostop)
-{
- CBS_FT_level_des *lev = (CBS_FT_level_des *)(level_table[l]);
- level_table[ lev->scheduling_level ]->
- private_dispatch(lev->scheduling_level,p,nostop);
-}
-
-static void CBS_FT_public_epilogue(LEVEL l, PID p)
-{
- CBS_FT_level_des *lev = (CBS_FT_level_des *)(level_table[l]);
-
- /* check if the budget is finished... */
- if (proc_table[p].avail_time <= 0) {
-
- /* A backup task cannot ever exhaust its budget! */
- if (lev->P_or_B[p] == BACKUP) {
- kern_printf("\nBACKUP wcet violation!\n");
- kern_raise(XWCET_VIOLATION,p);
- /* we kill the current activation */
- level_table[ lev->scheduling_level ]->
- private_extract(lev->scheduling_level, p);
- return;
- }
-
- /* we try to recharge the budget */
- CBS_FT_avail_time_check(lev, p);
-
- /* The budget must be greater than 0! */
- if (proc_table[p].avail_time <= 0) {
- kern_printf("\nBackup task starting with exhausted budget\n");
- kern_raise(XINVALID_TASK, p);
- lev->CP[p] = 0;
- /* we kill the current activation */
- level_table[ lev->scheduling_level ]->
- private_extract(lev->scheduling_level, p);
- return;
- }
- }
-
- /* the task returns into the ready queue by
- calling the guest_epilogue... */
- level_table[ lev->scheduling_level ]->
- private_epilogue(lev->scheduling_level,p);
-}
-
-
-static void CBS_FT_public_activate(LEVEL l, PID p)
-{
- CBS_FT_level_des *lev = (CBS_FT_level_des *)(level_table[l]);
- struct timespec t;
-
- kern_gettime(&t);
-
- if (lev->P_or_B[p] == BACKUP) {
- kern_printf("\nTrying to activate a BACKUP task!\n");
- kern_raise(XINVALID_TASK, p);
- }
- else {
-
- /* If idle=1, then we have to discharge the capacities stored in
- the capacity queue up to the length of the idle interval */
- if (lev->idle == 1) {
- TIME interval;
- struct timespec delta;
- lev->idle = 0;
- SUBTIMESPEC(&t, &lev->start_idle, &delta);
- /* length of the idle interval expressed in usec! */
- interval = TIMESPEC2NANOSEC(&delta) / 1000;
-
- /* it discharge the available capacities from the capacity queue */
- while (interval > 0 && lev->queue != NULL) {
- struct timespec dead;
- int cap;
- c_readfirst(&dead, &cap, lev->queue);
- if (cap > interval) {
- c_writefirst(dead, cap - interval, lev->queue);
- interval = 0;
- }
- else {
- interval -= cap;
- c_extractfirst(&lev->queue);
- }
- }
- }
-
- CBS_FT_activation(lev, p, &t);
-
-
- /* Set the reactivation timer */
- TIMESPEC_ASSIGN(&lev->reactivation_time[p], &lev->cbs_ft_dline[p]);
- lev->reactivation_timer[p] = kern_event_post(&lev->reactivation_time[p],
- CBS_FT_timer_reactivate,
- (void *)p);
-
- // kern_printf("act : %d %d |",lev->cbs_ft_dline[p].tv_nsec/1000,p);
- }
-}
-
-static int CBS_FT_public_message(LEVEL l, PID p, void *m)
-{
- CBS_FT_level_des *lev = (CBS_FT_level_des *)(level_table[l]);
-
-
- level_table[ lev->scheduling_level ]->
- private_extract(lev->scheduling_level,p);
-
-
- proc_table[p].status = CBS_FT_IDLE;
-
-
- if (lev->P_or_B[p] == PRIMARY) {
- if (lev->CP[p]) {
- JOB_TASK_MODEL job;
-
- /* We have to start the backup task */
- TIMESPEC_ASSIGN(&lev->cbs_ft_dline[ lev->backup[p] ],
- &lev->cbs_ft_dline[p]);
- proc_table[ lev->backup[p] ].avail_time = proc_table[p].avail_time;
- lev->CP[p] = 0;
-
- /* and, finally, we insert the backup task in the master level */
- job_task_default_model(job, lev->cbs_ft_dline[p]);
- job_task_def_yesexc(job);
- level_table[ lev->scheduling_level ]->
- private_insert(lev->scheduling_level, lev->backup[p],
- (TASK_MODEL *)&job);
- }
- else {
- /* A spare capacity is inserted in the capacity queue!! */
- proc_table[p].avail_time += proc_table[ lev->backup[p] ].wcet;
- if (proc_table[p].avail_time > 0) {
- c_insert(lev->cbs_ft_dline[p], proc_table[p].avail_time,
- &lev->queue, p);
- proc_table[p].avail_time = 0;
- }
- }
- }
- else {
- /* this branch is for backup tasks:
- A spare capacity is inserted in the capacity queue!! */
- if (proc_table[p].avail_time > 0) {
- c_insert(lev->cbs_ft_dline[p], proc_table[p].avail_time,
- &lev->queue, p);
- proc_table[p].avail_time = 0;
- }
- }
-
- jet_update_endcycle(); /* Update the Jet data... */
- trc_logevent(TRC_ENDCYCLE,&exec_shadow); /* tracer stuff */
-
- return 0;
-}
-
-
-static void CBS_FT_public_end(LEVEL l, PID p)
-{
- CBS_FT_level_des *lev = (CBS_FT_level_des *)(level_table[l]);
-
- /* A backup task cannot be killed, this behaviour can be modified
- in a new release */
- if (lev->P_or_B[p] == BACKUP) {
- kern_printf("\nKilling a BACKUP task!\n");
- kern_raise(XINVALID_TASK, p);
- return;
- }
-
- /* check if the capacity becomes negative... */
- /* there is a while because if the wcet is << than the system tick
- we need to postpone the deadline many times */
- while (proc_table[p].avail_time < 0) {
- /* the CBS_FT rule for recharging the capacity */
- proc_table[p].avail_time += lev->maxcap[p];
- ADDUSEC2TIMESPEC(lev->period[p], &lev->cbs_ft_dline[p]);
- }
-
- level_table[ lev->scheduling_level ]->
- private_extract(lev->scheduling_level,p);
-
-
- /* we delete the reactivation timer */
- kern_event_delete(lev->reactivation_timer[p]);
- lev->reactivation_timer[p] = -1;
-
-
- /* Finally, we post the zombie event. when the end period is reached,
- the task descriptor and banwidth are freed */
- proc_table[p].status = CBS_FT_ZOMBIE;
- lev->reactivation_timer[p] = kern_event_post(&lev->cbs_ft_dline[p],
- CBS_FT_timer_zombie,
- (void *)p);
-}
-
-/* Registration functions */
-
-/*+ Registration function:
- int flags the init flags ... see CBS.h +*/
-LEVEL CBS_FT_register_level(int flags, LEVEL master)
-{
- LEVEL l; /* the level that we register */
- CBS_FT_level_des *lev; /* for readableness only */
- PID i; /* a counter */
-
- printk("CBS_FT_register_level\n");
-
- /* request an entry in the level_table */
- l = level_alloc_descriptor(sizeof(CBS_FT_level_des));
-
- lev = (CBS_FT_level_des *)level_table[l];
-
- printk(" lev=%d\n",(int)lev);
-
- /* fill the standard descriptor */
- lev->l.public_scheduler = CBS_FT_public_scheduler;
-
- if (flags & CBS_FT_ENABLE_GUARANTEE)
- lev->l.public_guarantee = CBS_FT_public_guarantee;
- else
- lev->l.public_guarantee = NULL;
-
- lev->l.public_create = CBS_FT_public_create;
- lev->l.public_detach = CBS_FT_public_detach;
- lev->l.public_end = CBS_FT_public_end;
- lev->l.public_dispatch = CBS_FT_public_dispatch;
- lev->l.public_epilogue = CBS_FT_public_epilogue;
- lev->l.public_activate = CBS_FT_public_activate;
- lev->l.public_message = CBS_FT_public_message;
-
- /* fill the CBS_FT descriptor part */
- for (i=0; i<MAX_PROC; i++) {
- NULL_TIMESPEC(&lev->cbs_ft_dline[i]);
- lev->period[i] = 0;
- NULL_TIMESPEC(&lev->reactivation_time[i]);
- lev->reactivation_timer[i] = -1;
- lev->maxcap[i] = 0;
- lev->backup[i] = NIL;
- lev->CP[i] = 0;
- lev->P_or_B[i] = PRIMARY;
- }
-
- lev->U = 0;
- lev->idle = 0;
- lev->queue = NULL;
-
- lev->scheduling_level = master;
-
- lev->flags = flags & 0x07;
-
- return l;
-}
-
-
-
-bandwidth_t CBS_FT_usedbandwidth(LEVEL l)
-{
- CBS_FT_level_des *lev = (CBS_FT_level_des *)(level_table[l]);
-
- return lev->U;
-}
-
-
-
-void CBS_FT_Primary_Abort()
-{
- PID p;
- CBS_FT_level_des *lev;
-
- kern_cli();
- p = exec_shadow;
- lev = (CBS_FT_level_des *)level_table[proc_table[p].task_level];
- lev->CP[p] = 1;
- kern_sti();
-}
-
-
-char CBS_FT_Checkpoint()
-{
- char f;
- PID p;
- CBS_FT_level_des *lev;
-
- kern_cli();
- p = exec_shadow;
- lev = (CBS_FT_level_des *)level_table[proc_table[p].task_level];
- f = lev->CP[p];
- kern_sti();
- return f;
-}
-
Index: rel_1_21/cbs_ft/initfile.c
===================================================================
--- rel_1_21/cbs_ft/initfile.c (revision 1217)
+++ rel_1_21/cbs_ft/initfile.c (nonexistent)
@@ -1,112 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@hartik.sssup.it>
- *
- * Authors : Marco caccamo and Paolo Gai
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: initfile.c,v 1.1.1.1 2002-09-02 09:37:41 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:41 $
- ------------
-
- This file contains the server CBS_FT
-
- Read CBS_FT.h for further details.
-
-**/
-
-/*
- * Copyright (C) 2000 Marco Caccamo and Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include <modules/edf.h>
-#include <modules/rr.h>
-#include "cbs_ft.h"
-#include <modules/cbs.h>
-#include <modules/dummy.h>
-#include <drivers/keyb.h>
-#include <modules/hartport.h>
-#include <modules/sem.h>
-#include <modules/cabs.h>
-
-/*+ system tick in us +*/
-#define TICK 300
-#define RRTICK 5000
-
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- CBS_FT_register_level(CBS_FT_ENABLE_ALL, 0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- CBS_register_level(CBS_ENABLE_ALL, 0);
- dummy_register_level();
-
- SEM_register_module();
- CABS_register_module();
-
- // periodic timer
- return TICK;
- // one-shot timer
- // return 0
-}
-
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- HARTPORT_init();
-
- KEYB_init(NULL);
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: rel_1_21/cbs_ft/cbs_ft.h
===================================================================
--- rel_1_21/cbs_ft/cbs_ft.h (revision 1217)
+++ rel_1_21/cbs_ft/cbs_ft.h (nonexistent)
@@ -1,167 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@hartik.sssup.it>
- *
- * Authors : Marco Caccamo and Paolo Gai
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: cbs_ft.h,v 1.2 2003-01-07 17:10:16 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.2 $
- Last update: $Date: 2003-01-07 17:10:16 $
- ------------
-
- This file contains the server CBS_FT
-
- Read CBS_FT.h for further details.
-
-**/
-
-/*
- * Copyright (C) 2000 Marco Caccamo and Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#ifndef __CBS_FT__
-#define __CBS_FT__
-
-
-
-#include <ll/string.h>
-#include <kernel/model.h>
-#include <kernel/descr.h>
-#include <kernel/var.h>
-#include <kernel/func.h>
-#include <kernel/trace.h>
-
-
-
-
-
-
-/*+ flags... +*/
-#define CBS_FT_ENABLE_GUARANTEE 1 /*+ Task Guarantee enabled +*/
-#define CBS_FT_ENABLE_ALL 1
-
-#define CBS_FT_FAILED_GUARANTEE 8 /*+ used in the module, unsettable
- in EDF_register_level... +*/
-
-
-#define PRIMARY 1
-#define BACKUP 2
-#define FT_PCLASS 0x0700 // Nuova classe di task, quelli fault_tolerant
-
-#define CBS_FT_LEVELNAME "CBSFT base"
-#define CBS_FT_LEVEL_CODE 110
-#define CBS_FT_LEVEL_VERSION 1
-
-
-/* The Fault-Tolerant Task model extends the base task model
- This model cannot be APERIODIC, only PERIODIC tasks are allowed.
- A faut-tolerant application is composed by two different tasks (primary and
- backup). The backup task is characterized by its WCET and its type (BACKUP).
- The primary task must define the task period, its average execution time
- (used as sort of prediction in order to recharge the budget using the
- capacity cash queue!), the budget (budget / period = U that is, the
- bandwidth assigned to the fault-tolerant application), its type (PRIMARY)
- and finally the PID of the corresponding backup task. */
-
-typedef struct {
- TASK_MODEL t;
-
- TIME wcetB; // WCET of the backup job (BACKUP TASK ONLY)
-
- TIME execP; // average exec. time of the primary job (PRIMARY TASK ONLY)
-
- TIME period; // period of the fault-tolerant task (PRIMARY TASK ONLY)
-
- int budget; // amount of guaranteed capacity (PRIMARY TASK ONLY)
-
- char type; // PRIMARY or BACKUP
-
- PID backup; // (PRIMARY TASK ONLY)
-
-} FT_TASK_MODEL;
-
-
-#define ft_task_default_model(m) \
- task_default_model((m).t,FT_PCLASS), \
- (m).period = 0, \
- (m).wcetB = 0, \
- (m).execP = 0, \
- (m).budget = 0, \
- (m).type = BACKUP, \
- (m).backup = NIL
-
-#define ft_task_def_level(m,l) task_def_level((m).t,l)
-#define ft_task_def_arg(m,a) task_def_arg((m).t,a)
-#define ft_task_def_stack(m,s) task_def_stack((m).t,s)
-#define ft_task_def_stackaddr(m,s) task_def_stackaddr((m).t,s)
-#define ft_task_def_usemath(m) task_def_usemath((m).t)
-#define ft_task_def_ctrl_jet(m) task_def_ctrl_jet((m).t)
-#define ft_task_def_group(m,g) task_def_group((m).t,g)
-#define ft_task_def_period(m,o) (m).period = (o)
-#define ft_task_def_budget(m,o) (m).budget = (o)
-#define ft_task_def_backup(m) (m).type = BACKUP
-#define ft_task_def_primary(m) (m).type = PRIMARY
-#define ft_task_def_backup_task(m,b) (m).backup = b
-#define ft_task_def_backup_wcet(m,b) (m).wcetB = b
-#define ft_task_def_primary_exec(m,b) (m).execP = b
-
-/************************************************************************/
-LEVEL CBS_FT_register_level(int flags, LEVEL master);
-
-
-bandwidth_t CBS_FT_usedbandwidth(LEVEL l);
-
-
-
-/* This function notifies to a primary task that the task itself has to
- suspend its execution (the task has to suspend itself with a
- task_endcycle() */
-char CBS_FT_Checkpoint(void);
-
-
-
-/* This function sets the checkpoint flag! hence, at the next checkpoint,
- that is:
-
- if (CBS_FT_Checkpoint()) {
- task_endcycle();
- continue;
- }
-
- the primary task will suspend itself switching to the backup task */
-void CBS_FT_Primary_Abort(void);
-
-/***************************************************************************/
-
-
-
-
-#endif
Index: rel_1_21/cbs_ft/prova.c
===================================================================
--- rel_1_21/cbs_ft/prova.c (revision 1217)
+++ rel_1_21/cbs_ft/prova.c (nonexistent)
@@ -1,429 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@hartik.sssup.it>
- *
- * Authors : Marco Caccamo and Paolo Gai
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/**
- ------------
- CVS : $Id: prova.c,v 1.1.1.1 2002-09-02 09:37:41 pj Exp $
-
- File: $File$
- Revision: $Revision: 1.1.1.1 $
- Last update: $Date: 2002-09-02 09:37:41 $
- ------------
-
- testcash.c
- test for the CASH Module, directly derived from Test Number 13 (D)
-
-**/
-
-/*
- * Copyright (C) 2000 Marco Caccamo and Paolo Gai
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-
-#include <modules/edf.h>
-#include "cbs_ft.h"
-#include <math.h>
-#include <stdlib.h>
-
-#define ASTER_LIM 60
-#define DISPLAY_MAX 15
-
-#define STAT_Y 9
-
-#define INPUT 0.5
-
-
-
-#define MAX_STAT 10000
-#define RVAL 1
-#define XVAL 2
-#define DVAL 3
-
-
-struct statistic {
- TIME r_time;
- TIME ex_time;
- long dead_post;
-};
-
-
-
- struct statistic stat[MAX_STAT];
- TIME val[MAX_STAT];
-
-int n_stat = 0;
-
-TASK hard_aster1p(void)
-{
- int i;
- int y = 1;
- int load1,j;
-
- char s[2];
-
- s[0] = 'P'; s[1] = 0;
-
-
- for (;;) {
- i = 1;
- while (i < ASTER_LIM) {
- load1 = 20000; //+ rand() % 25000;
- for (j=0; j<load1; j++) {
- if (CBS_FT_Checkpoint())
- break;
- puts_xy(i,y,rand()%15+1,s);
- }
- //kern_cli();
- //stat[n_stat].r_time = CBSGHD_get_response_time(1, exec_shadow);
- //jet_gettable(exec_shadow, &stat[n_stat].ex_time, 1);
- //kern_sti();
- //n_stat++;
- task_endcycle();
- puts_xy(i,y,WHITE," ");
- i++;
- }
- }
-}
-
-
-TASK hard_aster1b(void)
-{
- int i;
- int y = 1;
-
- int load1,j;
-
- char s[2];
-
- s[0] = 'B'; s[1] = 0;
-
- for (;;) {
- i = 1;
- while (i < ASTER_LIM) {
- load1 = 20000;// + rand()%4000;
- for (j=0; j<load1; j++) {
- puts_xy(i,y,rand()%15+1,s);
- }
- //kern_cli();
- //stat[n_stat].r_time = CBSGHD_get_response_time(1, exec_shadow);
- //jet_gettable(exec_shadow, &stat[n_stat].ex_time, 1);
- //kern_sti();
- //n_stat++;
- task_endcycle();
- puts_xy(i,y,WHITE," ");
- i++;
- }
- }
-}
-
-
-TASK hard_aster2p(void)
-{
- int i;
- int y = 3;
-
- int load1,j;
-
- char s[2];
-
- s[0] = 'P'; s[1] = 0;
-
- for (;;) {
- i = 1;
- while (i < ASTER_LIM) {
- load1 = 20000 + rand() % 20000;
- for (j=0; j<load1; j++) {
- if (CBS_FT_Checkpoint())
- break;
- puts_xy(i,y,rand()%15+1,s);
- }
- //kern_cli();
- //stat[n_stat].r_time = CBSGHD_get_response_time(5, exec_shadow);
- //jet_gettable(exec_shadow, &stat[n_stat].ex_time, 1);
- //kern_sti();
- //n_stat++;
- task_endcycle();
- puts_xy(i,y,WHITE," ");
- i++;
- }
- }
-}
-
-TASK hard_aster2b(void)
-{
- int i;
- int y = 3;
-
- int load1,j;
-
- char s[2];
-
- s[0] = 'T'; s[1] = 0;
-
- for (;;) {
- i = 1;
- while (i < ASTER_LIM) {
- load1 = 20000;
- for (j=0; j<load1; j++) {
- puts_xy(i,y,rand()%15+1,s);
- }
- //kern_cli();
- //stat[n_stat].r_time = CBSGHD_get_response_time(5, exec_shadow);
- //jet_gettable(exec_shadow, &stat[n_stat].ex_time, 1);
- //kern_sti();
- //n_stat++;
- task_endcycle();
- puts_xy(i,y,WHITE," ");
- i++;
- }
- }
-}
-
-
-TASK clock()
-{
- int s = 0, m = 0;
-
- while(1) {
- printf_xy(62,1,WHITE,"%2d:%2d",m,s);
- printf_xy(62,2,WHITE,"Utot=%12u",MAX_BANDWIDTH);
- printf_xy(62,3,WHITE,"Uedf=%12u",EDF_usedbandwidth(0));
- printf_xy(62,4,WHITE,"Ucbs=%12u",CBS_FT_usedbandwidth(1));
- task_endcycle();
-
- if (++s > 59) {
- s = 0;
- m++;
- }
- printf_xy(62,1,WHITE,"%2d:%2d",m,s);
- printf_xy(62,2,WHITE,"Utot=%12u",MAX_BANDWIDTH);
- printf_xy(62,3,WHITE,"Uedf=%12u",EDF_usedbandwidth(0));
- printf_xy(62,4,WHITE,"Ucbs=%12u",CBS_FT_usedbandwidth(1));
- task_endcycle();
- }
-}
-
-
-
-/* we consider the first ASTER_MAX + 2 tasks from the PID 2
- and plot on the screen the elapsed times... */
-TASK jetcontrol()
-{
- int i; /* a counter */
- TIME sum, max, curr, last[5];
- int nact;
- int j; /* the elements set by jet_gettable */
- PID p;
-
-
- kern_cli();
- printf_xy(0,STAT_Y,WHITE,"PID ³ Mean T.³ Max T. ³ N.A. ³ Curr. ³ Last1 ³ Last2 ³ Last3 ³ Last4 ³ Last5");
- kern_sti();
-
- for (;;) {
- for (i=0,p=0; i<DISPLAY_MAX+5 && p<MAX_PROC; p++) {
- if (jet_getstat(p, &sum, &max, &nact, &curr) == -1) continue;
-
- for (j=0; j<5; j++) last[j] = 0;
- jet_gettable(p, &last[0], 5);
- kern_cli();
- printf_xy(0,STAT_Y+i+1,WHITE,"%-3d ³ %-6ld ³ %-6ld ³ %-4d ³ %-7ld ³ %-5ld ³ %-5ld ³ %-5ld ³ %-5ld ³ %-5ld", p, sum/(nact==0 ? 1 : nact), max,
- nact, curr, last[0], last[1], last[2], last[3], last[4]);
- kern_sti();
- i++;
- }
- task_endcycle();
- }
-}
-
-
-void save_stat(struct statistic p[], int n, char *name, int type)
-{
- DOS_FILE *f;
- int i;
- char outstring[500];
-
-
- for(i = 0; i < 500; i++)
- outstring[i] = '0';
-
- f = DOS_fopen(name, "w");
- if (!f) {
- cprintf("Cannot open %s!!!", name);
- goto end1;
- }
-
- for(i = 0; i < n; i++) {
- if (type == RVAL)
- val[i] = p[i].r_time;
- if (type == XVAL)
- val[i] = p[i].ex_time;
- if (type == DVAL)
- val[i] = p[i].dead_post;
- }
-
- memset(outstring, 0, 300);
- sprintf(outstring, "%ld \n", (long int)n);
- cprintf("%s", outstring);
- DOS_fwrite(outstring, 1, strlen(outstring), f);
-
- for(i = 0; i < n; i++) {
- memset(outstring, 0, 300);
- sprintf(outstring, "%ld %lu\n", (long int)i, val[i]);
- //cprintf("%s", outstring);
- DOS_fwrite(outstring, 1, strlen(outstring), f);
- }
- DOS_fclose(f);
-end1:cprintf("OK?");
-}
-
-
-void result_save(void *p)
-{
- save_stat(stat, n_stat, "stat1.tim", RVAL);
-}
-
-
-void fine()
-{
- ll_abort(666);
-}
-
-int main(int argc, char **argv)
-{
- PID p1,p2,p3, p4, p5, p6;
-
- HARD_TASK_MODEL m;
- FT_TASK_MODEL ftb;
- FT_TASK_MODEL ftp;
-
- // int i;
- struct timespec fineprg;
-
-
- //sys_atrunlevel(result_save, NULL, RUNLEVEL_AFTER_EXIT);
- srand(7);
-
- hard_task_default_model(m);
- hard_task_def_wcet(m,500);
- hard_task_def_mit(m,500000);
- hard_task_def_periodic(m);
- hard_task_def_group(m,1);
- hard_task_def_ctrl_jet(m);
-
-
- p1 = task_create("Clock",clock,&m,NULL);
- if (p1 == -1) {
- perror("testhd.c(main): Could not create task <Clock> ...");
- sys_end();
- }
-
-
- hard_task_def_wcet(m,500);
- hard_task_def_periodic(m);
- hard_task_def_mit(m,100000);
-
-
- p2 = task_create("JetControl",jetcontrol,&m,NULL);
- if (p2 == -1) {
- perror("testhd.c(main): Could not create task <JetControl> ...");
- sys_end();
- }
-
-
- ft_task_default_model(ftb);
- ft_task_def_usemath(ftb);
- ft_task_def_backup(ftb);
- ft_task_def_ctrl_jet(ftb);
- ft_task_def_backup_wcet(ftb, 7000);
-
-
-
- p3 = task_create("Hard_aster1b", hard_aster1b, &ftb,NULL);
- if (p3 == -1) {
- perror("testhd.c(main): Could not create task <aster1b> ...");
- sys_end();
- }
-
- ft_task_default_model(ftp);
- ft_task_def_usemath(ftp);
- ft_task_def_ctrl_jet(ftp);
- ft_task_def_group(ftp, 1);
- ft_task_def_period(ftp, 50000);
- ft_task_def_budget(ftp, 15000);
- ft_task_def_primary_exec(ftp, 7300);
- ft_task_def_primary(ftp);
- ft_task_def_backup_task(ftp, p3);
-
-
- p4 = task_create("Hard_aster1p", hard_aster1p, &ftp, NULL);
- if (p4 == -1) {
- perror("testhd.c(main): Could not create task <aster1p> ...");
- sys_end();
- }
-
-
- ft_task_def_backup_wcet(ftb, 6700);
-
-
- p5 = task_create("Hard_aster2b", hard_aster2b, &ftb, NULL);
- if (p5 == -1) {
- perror("testhd.c(main): Could not create task <aster2b> ...");
- sys_end();
- }
-
-
- ft_task_def_period(ftp, 100000);
- ft_task_def_budget(ftp, 8000);
- ft_task_def_primary_exec(ftp, 11000);
- ft_task_def_backup_task(ftp, p5);
-
-
- p6 = task_create("Hard_aster2p", hard_aster2p, &ftp, NULL);
- if (p6 == -1) {
- perror("testhd.c(main): Could not create task <aster2p> ...");
- sys_end();
- }
-
-
- printf_xy(0,STAT_Y + 15,WHITE,"Hard asteroide PID= %-3d ",p3);
- printf_xy(0,STAT_Y + 17,WHITE,"Clock PID= %-3d ",p1);
- printf_xy(0,STAT_Y + 18,WHITE,"JetControl PID= %-3d ",p2);
-
-
-
- task_nopreempt();
- fineprg.tv_sec = 10;
- fineprg.tv_nsec = 0;
- kern_event_post(&fineprg,fine,NULL);
- group_activate(1);
- return 0;
-}
-
Index: rel_1_21/cbs_ft/readme.txt
===================================================================
--- rel_1_21/cbs_ft/readme.txt (revision 1217)
+++ rel_1_21/cbs_ft/readme.txt (nonexistent)
@@ -1,6 +0,0 @@
-This Example has been made by Marco Caccamo.
-
-There is not a lot of documentation available, so if you have problems please
-send an e-mail to Marco ( http://gandalf.sssup.it/~caccamo/ )
-
-Paolo
Index: rel_1_21/cbs_ft/makefile
===================================================================
--- rel_1_21/cbs_ft/makefile (revision 1217)
+++ rel_1_21/cbs_ft/makefile (nonexistent)
@@ -1,17 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS= prova
-
-include $(BASE)/config/example.mk
-
-prova:
- make -f $(SUBMAKE) APP=prova INIT= OTHEROBJS="initfile.o cbs_ft.o" OTHERINCL= SHARKOPT="__OLDCHAR__ __GRX__"
-
-