ADVERTISEMENT

atanua081116_pe.zip

Jak połączyć licznik mod 10 i mod 6 w EWB do wyświetlania sekund?

Próbowałeś przetestować na jakimś emulatorze bramki logiczne. Nie wiem co to jest EWB.


Download file - link to post
  • atanua081116_pe.zip
    • msvcr71.dll
    • Atanua.exe
    • libtiff.dll
    • zlib1.dll
    • msvcp71.dll
    • tests
      • 74193.atanua
      • 7485.atanua
      • 74192.atanua
      • synch_sr.atanua
      • 7473.atanua
      • 74151.atanua
      • dx.atanua
      • 74191.atanua
      • 74245.atanua
      • 7408.atanua
      • 7400.atanua
      • 74139.atanua
      • t_flipflop.atanua
      • rotated_chips.atanua
      • 2051.atanua
      • baselogic.atanua
      • stepper.atanua
      • d_flipflop.atanua
      • 7486.atanua
      • sr_flipflop.atanua
      • 7447.atanua
      • jk_latch.atanua
      • clocks.atanua
      • 74163.atanua
      • sr_nand.atanua
      • 7420.atanua
      • contrib
        • jk_nand.atanua
        • parallel-to-serial_register.atanua
        • xor.atanua
        • serial-to-parallel_register.atanua
      • 74164.atanua
      • 27xx.atanua
      • 74244.atanua
      • d_latch.atanua
      • 7404.atanua
      • 7432.atanua
      • 74240.atanua
      • 7474.atanua
      • 74138.atanua
      • 74154.atanua
      • 3_input_logic.atanua
      • 74283.atanua
      • sr_nor.atanua
      • jk_flipflop.atanua
      • 74574.atanua
      • 7490.atanua
      • plugin
        • plugintest.atanua
        • k8055.atanua
      • mux.atanua
      • 7410.atanua
      • 7402.atanua
      • logicprobe.atanua
      • audio.atanua
      • 309.atanua
      • 74195.atanua
      • t_latch.atanua
      • 74241.atanua
      • 74181.atanua
      • 74165.atanua
    • license.txt
    • jpeg.dll
    • SDL.dll
    • SDL_image.dll
    • libpng12.dll
    • plugin
      • readme.txt
      • atanua_dll_interface.h
      • example.zip
    • atanua.xml
    • data
      • xor_fi.png
      • xor_us.png
      • or3_fi.png
      • jk_flipflop.png
      • t.png
      • sedr.png
      • jk.png
      • vera31.fnt
      • audio.png
      • vera_copyright.txt
      • nor3_fi.png
      • and3_fi.png
      • 309_f.png
      • sr_flipflop.png
      • vera14_00.png
      • 7seg_f.png
      • d_flipflop.png
      • cursor_drag.png
      • nor_us.png
      • nand_us.png
      • 7seg_b.png
      • lcd.png
      • chip_24pin.png
      • or3_us.png
      • vera31_00.png
      • 309_b.png
      • 7seg_d.png
      • and3_us.png
      • nand3_fi.png
      • button.png
      • d.png
      • nor_fi.png
      • not_us.png
      • dx.png
      • 309.png
      • 309_h.png
      • vcc.png
      • nand_fi.png
      • not_fi.png
      • or_us.png
      • 309_e.png
      • 7seg_c.png
      • sr_neg.png
      • 7seg_h.png
      • and_us.png
      • 309_g.png
      • icon.png
      • 7seg_base.png
      • ser.png
      • gnd.png
      • stepper.png
      • clock.png
      • sed.png
      • and_fi.png
      • nor3_us.png
      • 309_d.png
      • vera14.fnt
      • mux.png
      • cursor_ptr.png
      • 7seg_e.png
      • chip_14pin.png
      • flare.png
      • 7seg_g.png
      • chip_16pin.png
      • 7seg_a.png
      • 309_a.png
      • 309_c.png
      • sr.png
      • t_flipflop.png
      • or_fi.png
      • led.png
      • cursor_scissors.png
      • chip_20pin.png
      • nand3_us.png


atanua081116_pe.zip > readme.txt

Atanua finds plugins through the atanua.xml file.

In order to use the example plugin, copy the .dll
to the same directory as the atanua.exe. Then
edit the atanua.xml, adding the following line:

& lt; Plugin dll= " plugintest.dll " / & gt;

somewhere between the & lt; AtanuaConfig.. & gt; and
& lt; /AtanuaConfig & gt; tags.


atanua081116_pe.zip > atanua_dll_interface.h

#ifndef ATANUADLL_H
#define ATANUADLL_H

#ifdef _MSC_VER
#ifdef __cplusplus
#define ATANUADLLEXPORT extern " C " __declspec(dllexport)
#else
#define ATANUADLLEXPORT __declspec(dllexport)
#endif
#define ATANUACALL __cdecl
#else
#define ATANUACALL
#endif

#define ATANUA_PLUGIN_DLL_VERSION 1

#ifndef NO_ATANUA_ENUMS
enum pinmodes
{
PINSTATE_HIGHZ,
PINSTATE_READ,
PINSTATE_WRITE_HIGH,
PINSTATE_WRITE_LOW,
PINSTATE_READ_OR_WRITE_HIGH,
PINSTATE_READ_OR_WRITE_LOW,
PINSTATE_PROPAGATE_INVALID
};

enum netstates
{
NETSTATE_NC, /* not connected - zero inputs */
NETSTATE_INVALID, /* invalid state - mode than one input */
NETSTATE_HIGH,
NETSTATE_LOW
};
#endif

enum ATANUA_ASYNC_CALL
{
ATANUA_ASYNC_CALL_NONE = 0, /* No call active */
ATANUA_ASYNC_CALL_OKCANCEL = 1, /* Show message box with ok/cancel, return as ok = nonzeo */
ATANUA_ASYNC_CALL_OPENFILE = 2, /* Show open file dialog. Returns FILE pointer. Plugin must close the file handle. */
ATANUA_ASYNC_CALL_SAVEFILE = 3, /* Show save file dialog. Returns FILE pointer. Plugin must close the file handle. */
ATANUA_ASYNC_CALL_STORE_UNDO = 4, /* Causes Atanua to store a undo point */
};

typedef struct chipinfostruct_
{
int mPinCount; /* Number of pins for the structure */
int *mPinOutput; /* Pin output data states. See pinmodes enum. */
int *mPinInput; /* Pin input data states. See netstates enum. */
float mWidth; /* Chip width */
float mHeight; /* Chip height */
float *mPinCoordinates; /* Pin coordinates in relation to the chip. Two floats per pin. */
const char *mTextureFilename; /* Texture filename. Can be NULL. */
const char *mChipName; /* Chip name rendered at the center of the chip */
const char *mTooltip; /* Chip tooltip. Can be NULL. */
const char **mPinTooltips; /* Tooltips for the pins. Can be NULL. */
int mPersistentDataCount; /* Number of bytes in persistent data store. Can be 0. */
char *mPersistentDataPtr; /* Pointer to the persistent data store. Can be NULL. */
void *mUserPtr; /* User pointer for storing other chip-related data. */

/* Set to a ATANUA_ASYNC_CALL value to perform an asynchronous call */
/* If zero, normal operation continues. If non-zero, the requested operation is */
/* performed and the same function is called again */
/* mAsyncCall is reset to zero by Atanua before the new call. */
int mAsyncCall;
void *mAsyncCallParam; /* Async call parameter to Atanua */
void *mAsyncCallReturn; /* Async call return value from Atanua */
}
chipinfostruct;

typedef struct atanuadllinfo_
{
int mDllVersion; /* DLL interface version. Set to 0. Set to -1 if in error. */
int mChipCount; /* Number of chips provided by this DLL */
const char **mChipName; /* Pointers to chip names. These may not point to stack! */
int *mChipCategory; /* Category numbers for chips. May be NULL. Categories are 0=dont care, 1=base, 2=chip, 3=I/O */
}
atanuadllinfo;

#ifndef NO_ATANUA_DLL_PROTOTYPES

/* Get the number of chips this DLL/interface supports. */
ATANUADLLEXPORT void ATANUACALL getatanuadllinfo(atanuadllinfo *aDllInfo);

/* create a chip. Return 0 if unable. */
ATANUADLLEXPORT int ATANUACALL create(chipinfostruct *aChipInfo, const char *aChipname);

/* Update a chip */
ATANUADLLEXPORT void ATANUACALL update(chipinfostruct *aChipInfo, float aTick);

/* Render and/or handle key input. Return 0 to let Atanua render the chip. */
ATANUADLLEXPORT int ATANUACALL render(chipinfostruct *aChipInfo, int aKey);

/* Called when chip is being destroyed. */
ATANUADLLEXPORT void ATANUACALL cleanup(chipinfostruct *aChipInfo);
#endif

#endif


atanua081116_pe.zip > license.txt

Atanua is free for personal use.
For corporate, government, educational or commercial use,
please contact http://iki.fi/sol/email.html


Atanua, real-time logic simulator
Copyright © 2008 Jari Komppa
All rights reserved.

The copyright holder hereby grants You a world-wide, royalty-free, non-exclusive,
non-transferrable license to use the Software for personal, non-commercial use.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



Plug-ins

The provided plug-ins and their sources are freely modifiable and redistributable.
They are provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from
the use of the plug-ins. Permission is granted to anyone to use the plug-ins
for any purpose, including commercial applications, and to alter it and
redistribute it freely, as long as any altered source versions are plainly
marked as such, and must not be misrepresented as being the original software.



atanua081116_pe.zip > vera_copyright.txt

Bitstream Vera Fonts Copyright

The fonts have a generous copyright, allowing derivative works (as
long as " Bitstream " or " Vera " are not in the names), and full
redistribution (so long as they are not *sold* by themselves). They
can be be bundled, redistributed and sold with any software.

The fonts are distributed under the following copyright:

Copyright
=========

Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream
Vera is a trademark of Bitstream, Inc.

Permission is hereby granted, free of charge, to any person obtaining
a copy of the fonts accompanying this license ( " Fonts " ) and associated
documentation files (the " Font Software " ), to reproduce and distribute
the Font Software, including without limitation the rights to use,
copy, merge, publish, distribute, and/or sell copies of the Font
Software, and to permit persons to whom the Font Software is furnished
to do so, subject to the following conditions:

The above copyright and trademark notices and this permission notice
shall be included in all copies of one or more of the Font Software
typefaces.

The Font Software may be modified, altered, or added to, and in
particular the designs of glyphs or characters in the Fonts may be
modified and additional glyphs or characters may be added to the
Fonts, only if the fonts are renamed to names not containing either
the words " Bitstream " or the word " Vera " .

This License becomes null and void to the extent applicable to Fonts
or Font Software that has been modified and is distributed under the
" Bitstream Vera " names.

The Font Software may be sold as part of a larger software package but
no copy of one or more of the Font Software typefaces may be sold by
itself.

THE FONT SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT
SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.

Except as contained in this notice, the names of Gnome, the Gnome
Foundation, and Bitstream Inc., shall not be used in advertising or
otherwise to promote the sale, use or other dealings in this Font
Software without prior written authorization from the Gnome Foundation
or Bitstream Inc., respectively. For further information, contact:
fonts at gnome dot org.

Copyright FAQ
=============

1. I don't understand the resale restriction... What gives?

Bitstream is giving away these fonts, but wishes to ensure its
competitors can't just drop the fonts as is into a font sale system
and sell them as is. It seems fair that if Bitstream can't make money
from the Bitstream Vera fonts, their competitors should not be able to
do so either. You can sell the fonts as part of any software package,
however.

2. I want to package these fonts separately for distribution and
sale as part of a larger software package or system. Can I do so?

Yes. A RPM or Debian package is a " larger software package " to begin
with, and you aren't selling them independently by themselves.
See 1. above.

3. Are derivative works allowed?
Yes!

4. Can I change or add to the font(s)?
Yes, but you must change the name(s) of the font(s).

5. Under what terms are derivative works allowed?

You must change the name(s) of the fonts. This is to ensure the
quality of the fonts, both to protect Bitstream and Gnome. We want to
ensure that if an application has opened a font specifically of these
names, it gets what it expects (though of course, using fontconfig,
substitutions could still could have occurred during font
opening). You must include the Bitstream copyright. Additional
copyrights can be added, as per copyright law. Happy Font Hacking!

6. If I have improvements for Bitstream Vera, is it possible they might get
adopted in future versions?

Yes. The contract between the Gnome Foundation and Bitstream has
provisions for working with Bitstream to ensure quality additions to
the Bitstream Vera font family. Please contact us if you have such
additions. Note, that in general, we will want such additions for the
entire family, not just a single font, and that you'll have to keep
both Gnome and Jim Lyles, Vera's designer, happy! To make sense to add
glyphs to the font, they must be stylistically in keeping with Vera's
design. Vera cannot become a " ransom note " font. Jim Lyles will be
providing a document describing the design elements used in Vera, as a
guide and aid for people interested in contributing to Vera.

7. I want to sell a software package that uses these fonts: Can I do so?

Sure. Bundle the fonts with your software and sell your software
with the fonts. That is the intent of the copyright.

8. If applications have built the names " Bitstream Vera " into them,
can I override this somehow to use fonts of my choosing?

This depends on exact details of the software. Most open source
systems and software (e.g., Gnome, KDE, etc.) are now converting to
use fontconfig (see www.fontconfig.org) to handle font configuration,
selection and substitution; it has provisions for overriding font
names and subsituting alternatives. An example is provided by the
supplied local.conf file, which chooses the family Bitstream Vera for
" sans " , " serif " and " monospace " . Other software (e.g., the XFree86
core server) has other mechanisms for font substitution.


atanua081116_pe.zip > plugintest.cpp

#ifdef _WIN32
#include & lt; windows.h & gt;
#include & lt; GL/gl.h & gt;
#include & lt; GL/glu.h & gt;
#endif

#include & lt; stdio.h & gt;
#include & lt; math.h & gt;
#include & lt; stdlib.h & gt;
#include & lt; string.h & gt;
#include " ../plugin/atanua_dll_interface.h "

static const char plugin_name[]= " plugin test " ;
static const int chipcount = 1;

/* Get the number of chips this DLL/interface supports */
ATANUADLLEXPORT void ATANUACALL getatanuadllinfo(atanuadllinfo *aDllInfo)
{
/* DLL interface version. Set to ATANUA_PLUGIN_DLL_VERSION. Set to -1 if in error. */
aDllInfo- & gt; mDllVersion = ATANUA_PLUGIN_DLL_VERSION;
/* Number of chips provided by this DLL */
aDllInfo- & gt; mChipCount = chipcount;
/* Pointers to chip names. These may not point to stack! */
aDllInfo- & gt; mChipName = new const char*[chipcount];
/* Category numbers for chips. May be NULL. Categories are 0=dont care, 1=base, 2=chip, 3=I/O */
aDllInfo- & gt; mChipCategory = new int[chipcount];

aDllInfo- & gt; mChipName[0] = plugin_name;
aDllInfo- & gt; mChipCategory[0] = 2;
}

/* create a chip */
ATANUADLLEXPORT int ATANUACALL create(chipinfostruct *aChipInfo, const char *aChipname)
{
if (strcmp(aChipname, plugin_name) != 0)
return 0; // unknown chip

/* Number of pins for the structure */
aChipInfo- & gt; mPinCount = 3;

/* Pin output data states. See pinmodes enum. */
aChipInfo- & gt; mPinOutput = new int[3];
aChipInfo- & gt; mPinOutput[0] = PINSTATE_READ;
aChipInfo- & gt; mPinOutput[1] = PINSTATE_READ;
aChipInfo- & gt; mPinOutput[2] = PINSTATE_HIGHZ;

/* Pin input data states. See netstates enum. */
aChipInfo- & gt; mPinInput = new int[3];

aChipInfo- & gt; mWidth = 2; /* Chip width */
aChipInfo- & gt; mHeight = 2; /* Chip height */

/* Pin coordinates in relation to the chip. Two floats per pin. */
aChipInfo- & gt; mPinCoordinates = new float[3*2];
aChipInfo- & gt; mPinCoordinates[0*2+0] = 0.75f; // pin 1: top center
aChipInfo- & gt; mPinCoordinates[0*2+1] = 0.0f;
aChipInfo- & gt; mPinCoordinates[1*2+0] = 0.0f; // pin 2: left edge
aChipInfo- & gt; mPinCoordinates[1*2+1] = 1.0f;
aChipInfo- & gt; mPinCoordinates[2*2+0] = 1.5f; // pin 3: right edge
aChipInfo- & gt; mPinCoordinates[2*2+1] = 1.0f;

/* Texture filename. Can be NULL. */
aChipInfo- & gt; mTextureFilename = NULL;

/* Chip name rendered at the center of the chip */
aChipInfo- & gt; mChipName = " P " ;

/* Chip tooltip. Can be NULL. */
aChipInfo- & gt; mTooltip = " Simple Relay " ;

/* Tooltips for the pins. Can be NULL. */
aChipInfo- & gt; mPinTooltips = new const char*[3];
aChipInfo- & gt; mPinTooltips[0] = " Switch " ;
aChipInfo- & gt; mPinTooltips[1] = " Input " ;
aChipInfo- & gt; mPinTooltips[2] = " Output " ;

/* Number of bytes in persistent data store. Can be 0. */
aChipInfo- & gt; mPersistentDataCount = 0;

/* Pointer to the persistent data store. Can be NULL. */
aChipInfo- & gt; mPersistentDataPtr = NULL;

/* User pointer for storing other chip-related data. */
aChipInfo- & gt; mUserPtr = NULL;
return 1;
}

/* Update a chip */
ATANUADLLEXPORT void ATANUACALL update(chipinfostruct *aChipInfo, float aTick)
{
if (aChipInfo- & gt; mPinInput[0] != NETSTATE_HIGH)
{
aChipInfo- & gt; mPinOutput[2] = PINSTATE_HIGHZ;
return;
}
switch (aChipInfo- & gt; mPinInput[1])
{
case NETSTATE_LOW:
aChipInfo- & gt; mPinOutput[2] = PINSTATE_WRITE_LOW;
break;
case NETSTATE_HIGH:
aChipInfo- & gt; mPinOutput[2] = PINSTATE_WRITE_HIGH;
break;
default:
aChipInfo- & gt; mPinOutput[2] = PINSTATE_HIGHZ;
}
return;
}

/* Render and/or handle key input. Return 0 to let Atanua render the chip. */
ATANUADLLEXPORT int ATANUACALL render(chipinfostruct *aChipInfo, int aKey)
{
int i;
static int testcycle = 0;
static int rendermode = 0;
if (aKey == 'u')
{
if (testcycle == 0)
{
aChipInfo- & gt; mAsyncCall = ATANUA_ASYNC_CALL_STORE_UNDO;
testcycle = 1; // make sure we don't do this over and over again
}
return 0;
}
if (aKey == 'q')
{
if (testcycle == 0)
{
aChipInfo- & gt; mAsyncCall = ATANUA_ASYNC_CALL_OKCANCEL;
aChipInfo- & gt; mAsyncCallParam = " ok/cancel test " ;
testcycle = 1;
}
else
{
if (testcycle == 1)
{
if (aChipInfo- & gt; mAsyncCallReturn != NULL)
{
// do something
}
testcycle = 2; // make sure we don't do this over and over again
}
}
return 0;
}
if (aKey == 'o')
{
if (testcycle == 0)
{
aChipInfo- & gt; mAsyncCall = ATANUA_ASYNC_CALL_OPENFILE;
aChipInfo- & gt; mAsyncCallParam = " openfile test " ;
aKey = 0;
testcycle = 1;
}
else
{
if (testcycle == 1)
{
if (aChipInfo- & gt; mAsyncCallReturn != NULL)
{
fclose((FILE*)aChipInfo- & gt; mAsyncCallReturn);
}
testcycle = 2; // make sure we don't do this over and over again
}
}
return 0;
}
if (aKey == 's')
{
if (testcycle == 0)
{
aChipInfo- & gt; mAsyncCall = ATANUA_ASYNC_CALL_OPENFILE;
aChipInfo- & gt; mAsyncCallParam = " savefile test " ;
aKey = 0;
testcycle = 1;
}
else
{
if (testcycle == 1)
{
if (aChipInfo- & gt; mAsyncCallReturn != NULL)
{
fclose((FILE*)aChipInfo- & gt; mAsyncCallReturn);
}
testcycle = 2; // make sure we don't do this over and over again
}
}
return 0;
}
testcycle = 0;
#ifdef _WIN32
if (aKey == 'm')
{
rendermode = (rendermode + 1) % 2;
}

int tick = GetTickCount();
#endif

switch (rendermode)
{
#ifdef _WIN32
case 1:
glBegin(GL_TRIANGLE_STRIP);
glColor4f(1,0,0,1);
glVertex3f(-0.5,-0.5,0);
glVertex3f(-0.5,0.5,0);
glColor4f(0,1,1,1);
glVertex3f(0.5,-0.5,0);
glVertex3f(0.5,0.5,0);
glEnd();
glColor4f(0,0,0,0.6f);
glBegin(GL_TRIANGLE_STRIP);
for (i = 0; i & lt; 11; i++)
{
glVertex3f(-0.5f+(i/10.0f),-0.2f+sinf((i*100+tick) * 0.00329857f)*0.3f,0);
glVertex3f(-0.5f+(i/10.0f),0.2f+sinf((i*100+tick) * 0.00329857f)*0.3f,0);
}
glEnd();
return 1;
break;
#endif
default:
// Let Atanua handle rendering
return 0;
}
}

/* Called when chip is being destroyed. */
ATANUADLLEXPORT void ATANUACALL cleanup(chipinfostruct *aChipInfo)
{
// Free the bits that we allocated.
// Atanua has no idea how we allocated these - could be globals, for instance.
delete[] aChipInfo- & gt; mPinOutput;
delete[] aChipInfo- & gt; mPinInput;
delete[] aChipInfo- & gt; mPinCoordinates;
delete[] aChipInfo- & gt; mPinTooltips;
return;
}