diff options
Diffstat (limited to 'ldmicro')
38 files changed, 95 insertions, 139 deletions
diff --git a/ldmicro/RCa02300 b/ldmicro/RCa02300 Binary files differdeleted file mode 100644 index fd5b9e5..0000000 --- a/ldmicro/RCa02300 +++ /dev/null diff --git a/ldmicro/ansic.cpp b/ldmicro/ansic.cpp index d0fe240..ca13836 100644 --- a/ldmicro/ansic.cpp +++ b/ldmicro/ansic.cpp @@ -22,7 +22,7 @@ // responsible for calling us with appropriate timing. // Jonathan Westhues, Oct 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include "linuxUI.h" #include <stdio.h> #include <setjmp.h> #include <stdlib.h> diff --git a/ldmicro/arduino.cpp b/ldmicro/arduino.cpp index 0e1db36..af8090b 100644 --- a/ldmicro/arduino.cpp +++ b/ldmicro/arduino.cpp @@ -4,7 +4,7 @@ // runtime needed to schedule the cycles. // Jonathan Westhues, Oct 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include <linuxUI.h> #include <stdio.h> #include <setjmp.h> #include <stdlib.h> diff --git a/ldmicro/avr.cpp b/ldmicro/avr.cpp index e4e2bc9..848426d 100644 --- a/ldmicro/avr.cpp +++ b/ldmicro/avr.cpp @@ -22,7 +22,7 @@ // runtime needed to schedule the cycles. // Jonathan Westhues, Oct 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include <linuxUI.h> #include <stdio.h> #include <setjmp.h> #include <stdlib.h> diff --git a/ldmicro/circuit.cpp b/ldmicro/circuit.cpp index 82d8414..1d9d3d7 100644 --- a/ldmicro/circuit.cpp +++ b/ldmicro/circuit.cpp @@ -21,7 +21,7 @@ // particular point, delete the selected element, etc. // Jonathan Westhues, Oct 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include <linuxUI.h> #include <stdio.h> #include <stdlib.h> diff --git a/ldmicro/coildialog.cpp b/ldmicro/coildialog.cpp index fa4228c..070dd42 100644 --- a/ldmicro/coildialog.cpp +++ b/ldmicro/coildialog.cpp @@ -21,9 +21,9 @@ // plus the name, plus set-only or reset-only // Jonathan Westhues, Oct 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include <linuxUI.h> #include <stdio.h> -#include <commctrl.h> +//#include <commctrl.h> #include "ldmicro.h" diff --git a/ldmicro/commentdialog.cpp b/ldmicro/commentdialog.cpp index a1f1e06..4cfe13b 100644 --- a/ldmicro/commentdialog.cpp +++ b/ldmicro/commentdialog.cpp @@ -21,9 +21,9 @@ // encourage people to write it the way it will look on the diagram. // Jonathan Westhues, Jun 2005 //----------------------------------------------------------------------------- -#include <windows.h> +#include <linuxUI.h> #include <stdio.h> -#include <commctrl.h> +//#include <commctrl.h> #include "ldmicro.h" diff --git a/ldmicro/compilecommon.cpp b/ldmicro/compilecommon.cpp index f9f1206..a25d742 100644 --- a/ldmicro/compilecommon.cpp +++ b/ldmicro/compilecommon.cpp @@ -20,7 +20,7 @@ // Routines common to the code generators for all processor architectures. // Jonathan Westhues, Nov 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include <linuxUI.h> #include <stdio.h> #include <stdlib.h> diff --git a/ldmicro/componentimages.cpp b/ldmicro/componentimages.cpp index 2026c7f..063bdbb 100644 --- a/ldmicro/componentimages.cpp +++ b/ldmicro/componentimages.cpp @@ -1,6 +1,6 @@ -#include <windows.h> -#include <commctrl.h> +#include <linuxUI.h> +//#include <commctrl.h> #include <stdio.h> #include <stdlib.h> #include <wincodec.h> diff --git a/ldmicro/componentlist.cpp b/ldmicro/componentlist.cpp index fce0315..56a243e 100644 --- a/ldmicro/componentlist.cpp +++ b/ldmicro/componentlist.cpp @@ -1,4 +1,4 @@ -#include <windows.h> +#include <linuxUI.h> //#include <commctrl.h> #include <stdio.h> #include <stdlib.h> diff --git a/ldmicro/confdialog.cpp b/ldmicro/confdialog.cpp index 066a91c..1b77fd0 100644 --- a/ldmicro/confdialog.cpp +++ b/ldmicro/confdialog.cpp @@ -22,7 +22,7 @@ // which is configurable, plus the MCU clock (i.e. crystal frequency). // Jonathan Westhues, Nov 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include <linuxUI.h> #include <stdio.h> #include <stdlib.h> //#include <commctrl.h> diff --git a/ldmicro/contactsdialog.cpp b/ldmicro/contactsdialog.cpp index a6788fc..fe2922c 100644 --- a/ldmicro/contactsdialog.cpp +++ b/ldmicro/contactsdialog.cpp @@ -21,9 +21,9 @@ // plus the name // Jonathan Westhues, Oct 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include <linuxUI.h> #include <stdio.h> -#include <commctrl.h> +//#include <commctrl.h> #include "ldmicro.h" diff --git a/ldmicro/draw.cpp b/ldmicro/draw.cpp index 83ab7b3..75fcf54 100644 --- a/ldmicro/draw.cpp +++ b/ldmicro/draw.cpp @@ -23,7 +23,7 @@ // with wires. // Jonathan Westhues, Oct 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include "linuxUI.h" #include <stdio.h> #include <stdlib.h> diff --git a/ldmicro/draw_outputdev.cpp b/ldmicro/draw_outputdev.cpp index dce0516..5b05db5 100644 --- a/ldmicro/draw_outputdev.cpp +++ b/ldmicro/draw_outputdev.cpp @@ -25,7 +25,7 @@ // Ported to linus by: R Ramana, 2018 //----------------------------------------------------------------------------- -#include "windows.h" +#include "linuxUI.h" #include <stdio.h> #include <stdlib.h> diff --git a/ldmicro/helpdialog.cpp b/ldmicro/helpdialog.cpp index 9ac82af..cf23caa 100644 --- a/ldmicro/helpdialog.cpp +++ b/ldmicro/helpdialog.cpp @@ -23,10 +23,10 @@ // colours. // Jonathan Westhues, Dec 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include "linuxUI.h" #include <stdio.h> #include <stdlib.h> -#include <commctrl.h> +//#include <commctrl.h> #include <richedit.h> #include "ldmicro.h" diff --git a/ldmicro/includes/windows.h b/ldmicro/includes/windows.h deleted file mode 100644 index 2e0621d..0000000 --- a/ldmicro/includes/windows.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef __windows_h_ -#define __windoew_h_ -#include "linuxUI.h" -#include <ctype.h> -typedef void* HFONT; -typedef void* HMODULE; -typedef void* HHOOK; -typedef void* HBRUSH; -typedef void* HFONT; - -#if defined(__UNIX64) - typedef __int64_t LONG_PTR; -#else - typedef long LONG_PTR; -#endif - -typedef UINT_PTR WPARAM; -typedef LONG_PTR LPARAM; -typedef LONG_PTR LRESULT; - -typedef struct tagSCROLLINFO { - UINT cbSize; - UINT fMask; - int nMin; - int nMax; - UINT nPage; - int nPos; - int nTrackPos; -} SCROLLINFO, *LPCSCROLLINFO; - -typedef struct tagNMHDR { - HWND hwndFrom; - UINT_PTR idFrom; - UINT code; -} NMHDR; - -void OutputDebugString(char*); -double GetTickCount(void); - -#endif
\ No newline at end of file diff --git a/ldmicro/intcode.cpp b/ldmicro/intcode.cpp index 6f1cf15..a577759 100644 --- a/ldmicro/intcode.cpp +++ b/ldmicro/intcode.cpp @@ -22,7 +22,7 @@ // AVR or PIC16 code. // Jonathan Westhues, Nov 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include "linuxUI.h" #include <stdio.h> #include <setjmp.h> #include <stdlib.h> diff --git a/ldmicro/interpreted.cpp b/ldmicro/interpreted.cpp index 721086a..2295f90 100644 --- a/ldmicro/interpreted.cpp +++ b/ldmicro/interpreted.cpp @@ -22,7 +22,7 @@ // for interpretation. // Jonathan Westhues, Aug 2005 //----------------------------------------------------------------------------- -#include <windows.h> +#include "linuxUI.h" #include <stdio.h> #include <setjmp.h> #include <stdlib.h> diff --git a/ldmicro/iolist.cpp b/ldmicro/iolist.cpp index cb15d5f..e2fc032 100644 --- a/ldmicro/iolist.cpp +++ b/ldmicro/iolist.cpp @@ -25,7 +25,7 @@ // will not be forgotten. Also the dialog box for assigning I/O pins. // Jonathan Westhues, Oct 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include "linuxUI.h" //#include <commctrl.h> #include <stdio.h> #include <stdlib.h> diff --git a/ldmicro/lang.cpp b/ldmicro/lang.cpp index a4f1532..67952bc 100644 --- a/ldmicro/lang.cpp +++ b/ldmicro/lang.cpp @@ -24,7 +24,7 @@ // table. If it fails then it just returns the English. // Jonathan Westhues, Apr 2007 //----------------------------------------------------------------------------- -#include <windows.h> +#include "linuxUI.h" #include <stdio.h> #include <stdlib.h> diff --git a/ldmicro/ldinterpret.c b/ldmicro/ldinterpret.c index ce20dbc..6f18d44 100644 --- a/ldmicro/ldinterpret.c +++ b/ldmicro/ldinterpret.c @@ -36,7 +36,7 @@ //----------------------------------------------------------------------------- #include <stdio.h> #include <ctype.h> -#include <windows.h> +#include "linuxUI.h" #define INTCODE_H_CONSTANTS_ONLY #include "intcode.h" diff --git a/ldmicro/ldmicro.cpp b/ldmicro/ldmicro.cpp index 6195e77..67d9718 100644 --- a/ldmicro/ldmicro.cpp +++ b/ldmicro/ldmicro.cpp @@ -24,7 +24,7 @@ // most of the UI logic relating to the main window. // Jonathan Westhues, Oct 2004 //----------------------------------------------------------------------------- -#include "windows.h" +#include "linuxUI.h" #include <stdio.h> #include <stdlib.h> @@ -1102,7 +1102,7 @@ int main(int argc, char** argv) free(source); exit(-1); } - + if(!LoadProjectFromFile(source)) { Error("Couldn't open '%s', running non-interactively.\n", source); free(source); diff --git a/ldmicro/ldmicro.exe.manifest b/ldmicro/ldmicro.exe.manifest deleted file mode 100644 index ee71fe3..0000000 --- a/ldmicro/ldmicro.exe.manifest +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> -<assemblyIdentity - version="1.0.0.0" - processorArchitecture="X86" - name="JonathanWesthues.LadderLogic.LDMicro" - type="win32" -/> -<description>Ladder logic editor/compiler for PIC and AVR micros.</description> -<dependency> - <dependentAssembly> - <assemblyIdentity - type="win32" - name="Microsoft.Windows.Common-Controls" - version="6.0.0.0" - processorArchitecture="X86" - publicKeyToken="6595b64144ccf1df" - language="*" - /> - </dependentAssembly> -</dependency> -</assembly> diff --git a/ldmicro/ldmicro.rc b/ldmicro/ldmicro.rc deleted file mode 100644 index 952b087..0000000 --- a/ldmicro/ldmicro.rc +++ /dev/null @@ -1,19 +0,0 @@ - -// we need a manifest if we want visual styles; put in numbers since somethings a bit screwy -// with my SDK install (I don't think I've got *.rh right) - -#include "components/componentimages.h" - -1 24 "ldmicro.exe.manifest" - -4000 ICON "ldmicro.ico" -RELAY_NC PNG "img\\relay_nc.png" -RELAY_NO PNG "img\\relay_no.png" -SWITCH_CONNECTED PNG "img\\switch_connected.png" -SWITCH_DISCONNECTED PNG "img\\switch_disconnected.png" -SPDT_1 PNG "img\\spdt_1.png" -SPDT_2 PNG "img\\spdt_2.png" -DPST_1 PNG "img\\dpst_1.png" -DPST_2 PNG "img\\dpst_2.png" -DPDT_1 PNG "img\\dpdt_1.png" -DPDT_2 PNG "img\\dpdt_2.png" diff --git a/ldmicro/lib/linuxUI/linuxLD.cpp b/ldmicro/lib/linuxUI/linuxLD.cpp index 0b9ed9a..e4fd018 100644 --- a/ldmicro/lib/linuxUI/linuxLD.cpp +++ b/ldmicro/lib/linuxUI/linuxLD.cpp @@ -99,3 +99,16 @@ BOOL HeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem) } +void OutputDebugString(char* str) +{ + +} + +double GetTickCount(void) +{ +// timespec now; +// clock_gettime() +// if (clock_gettime(CLOCK_MONOTONIC, &now)) +// return 0; + return 10.2;//now.tv_sec * 1000.0 + now.tv_nsec / 1000000.0; +}
\ No newline at end of file diff --git a/ldmicro/lib/linuxUI/linuxLD.h b/ldmicro/lib/linuxUI/linuxLD.h index 4955361..c7ce92e 100644 --- a/ldmicro/lib/linuxUI/linuxLD.h +++ b/ldmicro/lib/linuxUI/linuxLD.h @@ -2,6 +2,7 @@ #define __LINUX_LD__ #include "linuxUI.h" +#include <ctype.h> #include <vector> #include <algorithm> #include <sys/mman.h> @@ -16,16 +17,18 @@ #define HEAP_ZERO_MEMORY 0x00000008 -/// typedefs +/// Typedefs //typedef int64_t __int64; typedef bool BOOL; typedef unsigned char BYTE; typedef unsigned short WORD; typedef unsigned int DWORD; +typedef unsigned int UINT; typedef size_t SIZE_T; typedef long LONG; typedef wchar_t WCHAR; typedef char CHAR; + typedef CONST WCHAR *LPCWSTR; typedef CONST CHAR *LPCSTR; /// should be __nullterminated @@ -44,9 +47,13 @@ typedef CHAR *LPSTR; typedef LPSTR LPTSTR; #endif -/// all handles will hold a GtkWindow* type typedef void *PVOID; typedef void *LPVOID; +typedef PVOID HFONT; +typedef PVOID HMODULE; +typedef PVOID HHOOK; +typedef PVOID HBRUSH; +typedef PVOID HFONT; typedef PVOID HANDLE; typedef HANDLE HINSTANCE; typedef HANDLE HDC; @@ -64,9 +71,17 @@ typedef unsigned int UINT_PTR; #endif typedef UINT_PTR WPARAM; -typedef unsigned int UINT; -/// custom classes +#if defined(__UNIX64) + typedef __int64_t LONG_PTR; +#else + typedef long LONG_PTR; +#endif + +typedef LONG_PTR LPARAM; +typedef LONG_PTR LRESULT; + +/// Custom classes class COLORREF : public GdkRGBA{ public: COLORREF() @@ -90,6 +105,7 @@ typedef struct HeapRecordChunckTag{ PVOID Chunck; SIZE_T dwSize; } HEAPCHUNCK; + typedef struct HeapRecordTag{ PVOID hHeap; DWORD HeapID; @@ -98,10 +114,27 @@ typedef struct HeapRecordTag{ SIZE_T dwSize; SIZE_T dwAllocatedSizeOffset; } HEAPRECORD; + +typedef struct tagSCROLLINFO { + UINT cbSize; + UINT fMask; + int nMin; + int nMax; + UINT nPage; + int nPos; + int nTrackPos; +} SCROLLINFO, *LPCSCROLLINFO; + +typedef struct tagNMHDR { + HWND hwndFrom; + UINT_PTR idFrom; + UINT code; +} NMHDR; + /// Variables extern std::vector<HEAPRECORD> HeapRecord; -/// functions +/// Functions HANDLE HeapCreate( DWORD flOptions, SIZE_T dwInitialSize, @@ -117,4 +150,8 @@ BOOL HeapFree( DWORD dwFlags, LPVOID lpMem); +/// functions to be ported +void OutputDebugString(char*); +double GetTickCount(void); + #endif diff --git a/ldmicro/loadsave.cpp b/ldmicro/loadsave.cpp index 736d54b..a1895a5 100644 --- a/ldmicro/loadsave.cpp +++ b/ldmicro/loadsave.cpp @@ -20,7 +20,7 @@ // Load/save the circuit from/to a file in a nice ASCII format. // Jonathan Westhues, Nov 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include "linuxUI.h" #include <stdio.h> #include <stdlib.h> diff --git a/ldmicro/lutdialog.cpp b/ldmicro/lutdialog.cpp index 8aa32b5..fde3156 100644 --- a/ldmicro/lutdialog.cpp +++ b/ldmicro/lutdialog.cpp @@ -23,7 +23,7 @@ // in between the points. // Jonathan Westhues, Dec 2005 //----------------------------------------------------------------------------- -#include <windows.h> +#include "linuxUI.h" #include <stdio.h> #include <stdlib.h> //#include <commctrl.h> diff --git a/ldmicro/maincontrols.cpp b/ldmicro/maincontrols.cpp index d2c67bb..d001858 100644 --- a/ldmicro/maincontrols.cpp +++ b/ldmicro/maincontrols.cpp @@ -22,7 +22,7 @@ // scrolling, I/O list, menus. // Jonathan Westhues, Nov 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include "linuxUI.h" //#include <commctrl.h> //#include <commdlg.h> #include <stdio.h> diff --git a/ldmicro/miscutil.cpp b/ldmicro/miscutil.cpp index 2e0ad54..4fddcf4 100644 --- a/ldmicro/miscutil.cpp +++ b/ldmicro/miscutil.cpp @@ -20,7 +20,7 @@ // Miscellaneous utility functions that don't fit anywhere else. IHEX writing, // verified memory allocator, other junk. //----------------------------------------------------------------------------- -#include <windows.h> +#include "linuxUI.h" #include <stdio.h> #include <stdlib.h> diff --git a/ldmicro/naminglist.cpp b/ldmicro/naminglist.cpp index 5c6f6ed..d6a7159 100644 --- a/ldmicro/naminglist.cpp +++ b/ldmicro/naminglist.cpp @@ -1,5 +1,5 @@ -#include <windows.h> -#include <commctrl.h> +#include "linuxUI.h" +//#include <commctrl.h> #include <stdio.h> #include <stdlib.h> #include <wincodec.h> diff --git a/ldmicro/pic16.cpp b/ldmicro/pic16.cpp index ae815fe..a813420 100644 --- a/ldmicro/pic16.cpp +++ b/ldmicro/pic16.cpp @@ -22,7 +22,7 @@ // runtime needed to schedule the cycles. // Jonathan Westhues, Oct 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include "linuxUI.h" #include <math.h> #include <stdio.h> #include <setjmp.h> diff --git a/ldmicro/resetdialog.cpp b/ldmicro/resetdialog.cpp index 00421d5..b83cd42 100644 --- a/ldmicro/resetdialog.cpp +++ b/ldmicro/resetdialog.cpp @@ -21,9 +21,9 @@ // which can be that of either a timer or a counter. // Jonathan Westhues, Nov 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include "linuxUI.h" #include <stdio.h> -#include <commctrl.h> +//#include <commctrl.h> #include "ldmicro.h" diff --git a/ldmicro/schematic.cpp b/ldmicro/schematic.cpp index 79738e4..849093e 100644 --- a/ldmicro/schematic.cpp +++ b/ldmicro/schematic.cpp @@ -21,7 +21,7 @@ // Actual manipulation of circuit elements happens in circuit.cpp, though. // Jonathan Westhues, Oct 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include "linuxUI.h" #include <stdio.h> #include <stdlib.h> diff --git a/ldmicro/simpledialog.cpp b/ldmicro/simpledialog.cpp index 3e88adc..7edfc5c 100644 --- a/ldmicro/simpledialog.cpp +++ b/ldmicro/simpledialog.cpp @@ -22,8 +22,8 @@ // operands. Try to reuse code a bit. // Jonathan Westhues, Nov 2004 //----------------------------------------------------------------------------- -#include <windows.h> -#include <commctrl.h> +#include "linuxUI.h" +//#include <commctrl.h> #include <stdio.h> #include <stdlib.h> diff --git a/ldmicro/simulate.cpp b/ldmicro/simulate.cpp index 5146183..57da046 100644 --- a/ldmicro/simulate.cpp +++ b/ldmicro/simulate.cpp @@ -24,7 +24,7 @@ // timers, etc. // Jonathan Westhues, Nov 2004 //----------------------------------------------------------------------------- -#include <windows.h> +#include "linuxUI.h" //#include <commctrl.h> #include <stdio.h> #include <stdlib.h> diff --git a/ldmicro/undoredo.cpp b/ldmicro/undoredo.cpp index 986cb00..69831d8 100644 --- a/ldmicro/undoredo.cpp +++ b/ldmicro/undoredo.cpp @@ -22,7 +22,7 @@ // the entire program at all times. // Jonathan Westhues, split May 2005 //----------------------------------------------------------------------------- -#include <windows.h> +#include "linuxUI.h" #include <stdio.h> #include <stdlib.h> diff --git a/ldmicro/windows.cpp b/ldmicro/windows.cpp deleted file mode 100644 index 286aa7c..0000000 --- a/ldmicro/windows.cpp +++ /dev/null @@ -1,13 +0,0 @@ -void OutputDebugString(char* str) -{ - -} - -double GetTickCount(void) -{ -// timespec now; -// clock_gettime() -// if (clock_gettime(CLOCK_MONOTONIC, &now)) -// return 0; - return 10.2;//now.tv_sec * 1000.0 + now.tv_nsec / 1000000.0; -}
\ No newline at end of file |