Commit ab61b4b0 authored by kollo's avatar kollo

version 1.22

parent c006b46c
This diff is collapsed.
This diff is collapsed.
......@@ -10,13 +10,13 @@
VERSION 1.20
VERSION 1.22
(C) 1997-2013 by Markus Hoffmann
(C) 1997-2014 by Markus Hoffmann
(kollo@users.sourceforge.net)
Name : X11Basic
Version : 1.20 Vendor: Markus Hoffmann
Version : 1.22 Vendor: Markus Hoffmann
Group : Development/Languages License: GPL
Packager : Markus Hoffmann <kollo@users.sourceforge.net>
URL : http://x11-basic.sourceforge.net/
......@@ -52,14 +52,14 @@ Description :
X11-Basic programs can also be compiled into a bytecode (see xbbc). This
bytecode can be interpreted by a virtual machine (see xbvm). Finally, the
bytecode can be converted to C sourcefiles (see xb2c) which can be compiled
with the gnu C compiler (or the tiny c compiler) to native excecutables.
with the gnu C compiler (or the tiny C compiler) to native excecutables.
Ancient ANSI-Basic programs (with line numbers) can be converted to X11-Basic
with the bas2x11basic program (see the man page bas2x11basic(1) ).
You will find the compiler sourcecode and some other sample programs in
/usr/share/doc/packages/X11Basic/examples. A variety of other sample programs
can be found in X11-Basic-examples-1.20.zip, which you can download from the
can be found in X11-Basic-examples-1.22.zip, which you can download from the
homepage (http://x11-basic.sourceforge.net/). Also an up-to-date pdf-version
of the manual can be found there.
......@@ -116,9 +116,6 @@ If you want to use the compilers included in this package, you have to
make both the static and dynamic libraries.
cd ./src
If you do not have the file mathematics.c please do
cp mathemat_dummy.c mathematics.c
then:
make lib will generate libx11basic.so
make x11basic.a will generate x11basic.a
......
Release notes for Version 1.20 (Dez 2012-Mar 2013)
Release notes for Version 1.22 (Dec 2013-Mar 2014)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- New command: SHELL (also for Android)
- bugfix: strcpy().
- Improved: Editor excecution in Android version
- Fixed bug with desktop shortcuts under Android
- Bugfix in virtual machine (AND)
- included va_copy patch for 64 bit version by Matthias Vogl
- fixed bugs in compiler (ARRAY constants)
- fixed bugs in VARPTR() and ARRPTR()
- fixed bug in local variable handling
- fixed memory leak LOCAL/RETURN
- fixed bug/crash with MERGE
- new function: call android intents with EXEC
- fixed bug/crash in LIST command
- fixed bug in SWAP command
- fixed bug/crash in CALL command
- new commands: MKDIR, RMDIR, KILL, HIDEM, SHOWM
- new functions: LEFTOF$(), RIGHTOF$(), ENCLOSE$(), DECLOSE$(), TALLY()
- new functions: COLOR_RGB(), BYTE(), CARD(), WORD(), SWAP(), CINT(), VARIAT()
- new Commands: RENAME, CHMOD, TOUCH
- improved crash reports (Android)
- Bugfix ARRAY (create, init)
- new: ABSOLUTE command
- new: VAR statement allows parameters "by reference"
- added UTF-8 (unicode) support for LTEXT
- added UTF-8 (unicode) support for console/terminal (Android)
- added unicode bitmap font for greek/kyrillic for console/terminal (Android)
- MENUDEF now compiles without error
- AFTER/EVERY works in bytecode now
- new functions: FSFIRST$(), FSNEXT$()
- new example program: stepdir.bas
- fixed bug in MOUSEK, MOUSE (Windows version)
- small bugfixes in CASE,PAUSE,INSTR(), SORT, USING$(), PRINT USING
- fixed bug in VAL?(), DET(), and GPRINT
- fixed bug in ON ERROR, ON BREAK and ON MENU
- fixed bug in String compare
- fixed bug in HEX constants "0x" (Android)
- new string function RADIX$()
- fixed bug in framebuffer version (linux)
- fixed bugs in parser
- new statement: ENDPROCEDURE (optional)
- improved speed of bytecode
- bugfix in compiler, improved error messages
- fixed bug in DIM, VAL?(), PLIST
This diff is collapsed.
......@@ -331,7 +331,7 @@ typedef struct rshdrv3
LONG rsh_rssize; /* total bytes in resource */
}RSHDRV3;
typedef struct { unsigned short r,g,b;} AESRGBCOLOR;
typedef struct { unsigned char r,g,b;} AESRGBCOLOR;
/* Prototypes */
......@@ -341,7 +341,6 @@ extern unsigned int chw,chh,baseline,depth;
extern int gem_colors[];
extern ARECT sbox;
extern const AESRGBCOLOR gem_colordefs[];
void gem_init();
void load_GEMFONT(int n);
......@@ -363,7 +362,6 @@ int objc_find(OBJECT *tree,int x,int y);
int finded(OBJECT *tree,int start, int r);
void draw_edcursor(OBJECT *tree,int ndx);
int rootob(OBJECT *tree,int onr);
void WSWAP(char *adr);
void relobxy(OBJECT *tree,int ndx,int *x, int *y);
int rsrc_load(char *filename);
......
......@@ -23,7 +23,7 @@
static ARRAY f_smula(PARAMETER *plist, int e) {
ARRAY ergeb;
ergeb.typ=plist->typ;
ergeb.typ=((ARRAY *)&(plist->integer))->typ;
ergeb.dimension=plist->integer;
ergeb.pointer=plist->pointer;
ergeb=double_array(&ergeb);
......@@ -39,14 +39,22 @@ static ARRAY f_einsmat(PARAMETER *plist, int e) {
return(einheitsmatrix(FLOATTYP,2,dimlist));
}
/*Determinante berechnen*/
double f_det(PARAMETER *plist, int e) {
ARRAY *arr=(ARRAY *)&(plist->integer);
return array_det(arr);
}
/* Gleichungssystem loesen d=Mx x()=SOLVE(m(),d())*/
static ARRAY f_solvea(PARAMETER *plist, int e) {
ARRAY ergeb;
int anzzeilen,anzspalten;
ergeb.typ=plist[0].typ;
ergeb.typ=((ARRAY *)&(plist->integer))->typ;
ergeb.dimension=1;
if(plist[0].integer!=2) xberror(81,""); /* "Matrizen haben nicht die gleiche Ordnung" */
if(plist[0].integer>2) xberror(80,""); /* Matrizenoperationen nur fr ein- oder zweidimensionale Felder*/
else if(plist[0].integer!=2) xberror(81,""); /* "Matrizen haben nicht die gleiche Ordnung" */
if(plist[1].integer!=1) xberror(81,""); /* "Matrizen haben nicht die gleiche Ordnung" */
anzspalten=*((int *)(plist[0].pointer+sizeof(int)));
anzzeilen=*((int *)(plist[0].pointer));
......@@ -55,9 +63,46 @@ static ARRAY f_solvea(PARAMETER *plist, int e) {
ergeb.pointer=malloc(INTSIZE+anzspalten*sizeof(double));
*((int *)ergeb.pointer)=anzspalten;
makeSVD2((double *)(plist[1].pointer+plist[1].integer*INTSIZE),(double *)(plist[0].pointer+plist[0].integer*INTSIZE),anzzeilen,anzspalten, (double *)(ergeb.pointer+INTSIZE));
solve((double *)(plist[1].pointer+plist[1].integer*INTSIZE),(double *)(plist[0].pointer+plist[0].integer*INTSIZE),anzzeilen,anzspalten, (double *)(ergeb.pointer+INTSIZE));
return(ergeb);
}
/* Diskrete Faltung x()=CONVOLUT(A(),h())*/
static ARRAY f_convolut(PARAMETER *plist, int e) {
ARRAY *arr=(ARRAY *)&(plist->integer);
ARRAY ergeb=double_array(arr);
int n=anz_eintraege(&ergeb);
ARRAY *h=(ARRAY *)&(plist[1].integer);
int n2=anz_eintraege(h);
double *varptr=(double *)(ergeb.pointer+ergeb.dimension*INTSIZE);
double *varptr1=(double *)(arr->pointer+arr->dimension*INTSIZE);
double *varptr2=(double *)(h->pointer+h->dimension*INTSIZE);
int i,j;
int o=n2/2;
double a;
for(i=0;i<n;i++) {
a=0;
for(j=0;j<n2;j++) {
if(i+j-o>=0 && i+j-o<n) a+=varptr1[i+j-o]*varptr2[j];
}
varptr[i]=a;
}
return(ergeb);
}
/* Fast Fourier Transform */
static ARRAY f_fft(PARAMETER *plist, int e) {
int isign=0;
ARRAY ergeb=double_array((ARRAY *)&(plist->integer));
int n=anz_eintraege(&ergeb);
double *varptr=(double *)(ergeb.pointer+ergeb.dimension*INTSIZE);
if(e>1) isign=plist[1].integer;
realft(varptr,n,isign);
return(ergeb);
}
#ifdef CONTROL
static ARRAY f_csvgeta(char *pos) {
int o=0,nn=0;
......@@ -96,6 +141,7 @@ const AFUNCTION pafuncs[]= { /* alphabetisch !!! */
{ F_CONST|F_ARGUMENT, "!nulldummy", (afunc) f_nop ,0,0 ,{0}},
{ F_CONST|F_PLISTE, "0" , f_nullmat ,2,2 ,{PL_INT,PL_INT}},
{ F_CONST|F_PLISTE, "1" , f_einsmat ,1,1 ,{PL_INT}},
{ F_CONST|F_PLISTE, "CONVOLUT" , f_convolut ,2,2 ,{PL_FARRAY,PL_FARRAY}},
#ifdef CONTROL
{ F_PLISTE, "CSGET" , f_csvgeta ,1,3 ,{PL_STRING,PL_INT,PL_INT}},
{ F_PLISTE, "CSVGET" , f_csvgeta ,1,3 ,{PL_STRING,PL_INT,PL_INT}},
......@@ -106,10 +152,11 @@ const AFUNCTION pafuncs[]= { /* alphabetisch !!! */
{ F_PLISTE, "DOOCSNAMES" , f_doocsnames ,1,1 ,{PL_STRING}},
{ F_PLISTE, "DOOCSVGET" , f_doocsgeta ,1,3 ,{PL_STRING,PL_INT,PL_INT}},
#endif
{ F_CONST|F_PLISTE, "FFT" , f_fft ,1,2 ,{PL_FARRAY,PL_INT}},
{ F_CONST|F_AQUICK, "INV" , inv_array ,1,1 ,{PL_NARRAY}},
{ F_CONST|F_PLISTE, "SMUL" , f_smula ,2,2 ,{PL_ARRAY,PL_FLOAT}},
{ F_CONST|F_PLISTE, "SOLVE" , f_solvea ,2,2 ,{PL_ARRAY,PL_ARRAY}},
{ F_CONST|F_PLISTE, "SOLVE" , f_solvea ,2,2 ,{PL_FARRAY,PL_FARRAY}},
#ifdef TINE
{ F_PLISTE, "TINEGET" , f_tinegeta ,1,3 ,{PL_STRING,PL_INT,PL_INT}},
......
......@@ -7,3 +7,4 @@
*/
double f_det(PARAMETER *plist, int e);
This diff is collapsed.
......@@ -7,23 +7,23 @@
*/
ARRAY create_array(int , int ,int *);
ARRAY create_int_array(int dimension, int *dimlist,int value);
ARRAY create_float_array(int dimension, int *dimlist,double value);
ARRAY create_string_array(int dimension, int *dimlist,STRING *value);
ARRAY create_array(const int , const int ,const int *);
ARRAY recreate_array(const int , const int ,const int *, const ARRAY *);
ARRAY create_int_array(const int dimension,const int *dimlist,const int value);
ARRAY create_float_array(const int dimension, const int *dimlist,const double value);
ARRAY create_string_array(const int dimension, const int *dimlist,const STRING *value);
ARRAY einheitsmatrix(int , int ,int *);
ARRAY einheitsmatrix(const int ,const int ,const int *);
ARRAY array_const(const char *);
ARRAY double_array(ARRAY *);
ARRAY einheitsmatrix(int, int, int *);
ARRAY double_array(const ARRAY *);
ARRAY einheitsmatrix(const int, const int, const int *);
ARRAY mul_array(ARRAY, ARRAY);
ARRAY trans_array(ARRAY);
ARRAY inv_array(ARRAY);
ARRAY convert_to_floatarray(ARRAY *a);
ARRAY convert_to_intarray(ARRAY *a);
ARRAY convert_to_floatarray(const ARRAY *a);
ARRAY convert_to_intarray(const ARRAY *a);
ARRAY get_subarray(ARRAY *arr,int *indexliste);
void array_add(ARRAY a1, ARRAY a2);
......@@ -34,32 +34,44 @@ void free_array(ARRAY *arr);
/* Operieren auf Variablen */
void fill_string_array (ARRAY *,STRING );
void fill_int_array (ARRAY *,int);
void fill_float_array (ARRAY *,double);
void fill_string_array (const ARRAY *,const STRING );
void fill_int_array (const ARRAY *,const int);
void fill_float_array (const ARRAY *,const double);
STRING array_to_string(ARRAY inhalt);
ARRAY string_to_array(STRING in);
int make_indexliste(int dim, char *pos, int *index);
int check_indexliste(const ARRAY *a, const int *idx);
void anz2idx(int anz,const ARRAY *a,int *idx);
int int_array_element (const ARRAY *a, int *idx);
double float_array_element (const ARRAY *a, int *idx);
STRING string_array_element(const ARRAY *a, int *idx);
ARRAY array_array_element (const ARRAY *a, int *idx);
double array_det(const ARRAY *a);
/* Kleinere Hilfsfunktionen als inline Makro*/
static inline int anz_eintraege(ARRAY *a) {/* liefert Anzahl der Elemente in einem ARRAY */
static inline int anz_eintraege(const ARRAY *a) {/* liefert Anzahl der Elemente in einem ARRAY */
int anz=1,j;
for(j=0;j<a->dimension;j++) anz=anz*((int *)a->pointer)[j];
if(a->dimension>0 && a->pointer) {
for(j=0;j<a->dimension;j++) anz=anz*((int *)a->pointer)[j];
}
return(anz);
}
static inline int do_dimension(VARIABLE *v) { /* liefert Anzahl der Elemente in einem ARRAY */
static inline int do_dimension(const VARIABLE *v) { /* liefert Anzahl der Elemente in einem ARRAY */
/* printf("DODIM?: vnr=%d \n",vnr); */
if(v->typ & ARRAYTYP) return(anz_eintraege(v->pointer.a));
else return(1);
}
static inline ARRAY nullmatrix(int typ, int dimension, int *dimlist) {
static inline ARRAY nullmatrix(const int typ, const int dimension, const int *dimlist) {
ARRAY ergebnis;
if(typ & INTTYP) ergebnis=create_int_array(dimension,dimlist,0);
else if(typ & FLOATTYP) ergebnis=create_float_array(dimension,dimlist,0);
......
......@@ -16,13 +16,21 @@
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#ifdef HAVE_PNG_H
#include <png.h>
#endif
#ifdef HAVE_JPEGLIB_H
#include <jpeglib.h>
#endif
#include "defs.h"
#include "x11basic.h"
#include "graphics.h"
#ifdef USE_X11
#include <X11/XWDFile.h>
#endif
#ifdef WINDOWS
#include <windows.h>
#include "Windows.extension/fnmatch.h"
#else
#include <fnmatch.h>
......@@ -41,12 +49,13 @@ void memdump(unsigned char *adr,int l);
/*-------------------------------------------------------------------*/
#ifdef USE_X11
/* swap some long ints. (n is number of BYTES, not number of longs) */
static void swapdws (char *bp, unsigned int n) {
register char c;
register char *ep = bp + n;
register char *sp;
static void swapdws (unsigned char *bp, unsigned int n) {
register unsigned char c;
register unsigned char *ep = bp + n;
register unsigned char *sp;
while (bp<ep) {
sp=bp+3;
......@@ -55,8 +64,7 @@ static void swapdws (char *bp, unsigned int n) {
}
}
#ifdef USE_X11
char *imagetoxwd(XImage *image,Visual *visual,XColor *pixc, int *len) {
unsigned char *imagetoxwd(XImage *image,Visual *visual,XColor *pixc, int *len) {
XWDFileHeader *data;
unsigned long swaptest = 1;
char image_name[]="X11-BASIC Grafik";
......@@ -108,8 +116,8 @@ char *imagetoxwd(XImage *image,Visual *visual,XColor *pixc, int *len) {
color[i].pad = (CARD8)0;
}
}
if (*(char *) &swaptest) swapdws((char *)data, sizeof(XWDFileHeader));
return((char *)data);
if (*(char *) &swaptest) swapdws((unsigned char *)data, sizeof(XWDFileHeader));
return((unsigned char *)data);
}
#endif
......@@ -117,12 +125,12 @@ char *imagetoxwd(XImage *image,Visual *visual,XColor *pixc, int *len) {
0 on normal success and
<0 for errors */
int bmp2bitmap(char *data,char *fbp,int x, int bw,int bh,int depth, char *mask) {
int bmp2bitmap(const unsigned char *data,unsigned char *fbp,int x, unsigned int bw,unsigned int bh,unsigned int depth, unsigned char *mask) {
unsigned short *ptr1 = (unsigned short*)fbp;
int r=0,g=0,b=0,a,i,j,w,h,offset,d,ib=0,ic=0;
int usealpha=0;
unsigned int compression,ncol;
char *buf2,*buf3;
const unsigned char *buf2,*buf3;
if(data==NULL) return(0);
ptr1+=x;
......@@ -253,12 +261,13 @@ int bmp2bitmap(char *data,char *fbp,int x, int bw,int bh,int depth, char *mask)
((char *)ptr1)[j*4+3+i*bw*4]=a;
}
}
buf2=(char *)(((((long)buf2-(long)buf3)+3)&0xfffffffc)+(long)buf3); /* align to 4 */
buf2=(unsigned char *)(((((long)buf2-(long)buf3)+3)&0xfffffffc)+(long)buf3); /* align to 4 */
}
return(usealpha);
}
static void bitmap_scale(char *oadr,int depth,int ow,int oh,char *adr,int w,int h) {
void bitmap_scale(const unsigned char *oadr,unsigned int depth,unsigned int ow,unsigned int oh,unsigned char *adr,unsigned int w,unsigned int h) {
int rl=depth/8;
int x,y;
int sx,sy;
......@@ -277,8 +286,8 @@ static void bitmap_scale(char *oadr,int depth,int ow,int oh,char *adr,int w,int
}
}
static void extend_mask(char *a, char *b, int n, unsigned char thres) {
#ifdef USE_X11
static void extend_mask(const unsigned char *a, unsigned char *b, int n, unsigned char thres) {
int i=0;
for(i=0;i<n;i++) {
if(((*a++)&0xff)>=thres) {
......@@ -294,7 +303,7 @@ static void extend_mask(char *a, char *b, int n, unsigned char thres) {
}
}
}
static void extend_mask16(char *a, char *b, int n, unsigned char thres) {
static void extend_mask16(const unsigned char *a, unsigned char *b, int n, unsigned char thres) {
int i=0;
for(i=0;i<n;i++) {
if(((*a++)&0xff)>=thres) {
......@@ -306,35 +315,32 @@ static void extend_mask16(char *a, char *b, int n, unsigned char thres) {
}
}
}
#ifdef USE_X11
XImage *xwdtoximage(char *data,Visual *visual, int depth, XImage **XMask, int tres, double scale) {
char *adr;
char *mask;
char *mask2;
XImage *xwdtoximage(unsigned char *data,Visual *visual, int depth, XImage **XMask, int tres, double scale) {
unsigned char *adr;
unsigned char *mask;
unsigned char *mask2;
int usemask=0;
// memdump(data,32);
/* Pruefen, ob es sich um eine BMP Datei handelt. */
if(*((unsigned short int *)data)==BF_TYPE) {
#if DEBUG
#if DEBUG
printf("BMP-File!\n");
#endif
int dd,w,o,h,bpl,ncol;
int bpl;
// BITMAPFILEHEADER *header=(BITMAPFILEHEADER *)data;
BITMAPINFOHEADER *iheader=(BITMAPINFOHEADER *)(data+BITMAPFILEHEADERLEN);
ncol=iheader->biClrUsed;
// int ncol=iheader->biClrUsed;
// RGBQUAD *coltable=(RGBQUAD *)(data+BITMAPFILEHEADERLEN+BITMAPINFOHEADERLEN);
w=iheader->biWidth;
h=iheader->biHeight;
dd=iheader->biBitCount;
int w=iheader->biWidth;
int h=iheader->biHeight;
// int dd=iheader->biBitCount;
if(iheader->biCompression!=BI_RGB && iheader->biCompression!=BI_BITFIELDS) {
printf("Put-Image: Compressed Bitmaps are not supported! compression=%d\n",iheader->biCompression);
}
o=*((int *)(data+10));
// int o=*((int *)(data+10));
if(depth==24) bpl=w*4;
else bpl=w*depth/8;
#if DEBUG
......@@ -353,8 +359,8 @@ XImage *xwdtoximage(char *data,Visual *visual, int depth, XImage **XMask, int tr
if(usemask) {
if(scale!=1.0) {
char *omask=mask;
char *oadr=adr;
unsigned char *omask=mask;
unsigned char *oadr=adr;
int oh=h;
int ow=w;
h=(int)((double)h*scale);
......@@ -375,14 +381,14 @@ XImage *xwdtoximage(char *data,Visual *visual, int depth, XImage **XMask, int tr
if(depth==24 || depth==32) extend_mask(mask,mask2,h*w,32);
else extend_mask16(mask,mask2,h*w,32);
free(mask);
*XMask=XCreateImage(display[usewindow],visual,depth,ZPixmap,0,mask2,w,h,8,bpl);
*XMask=XCreateImage(display[usewindow],visual,depth,ZPixmap,0,(char *)mask2,w,h,8,bpl);
} else {
free(mask);
*XMask=NULL;
if(XMask) *XMask=NULL;
if(scale!=1.0) {
int oh=h;
int ow=w;
char *oadr=adr;
unsigned char *oadr=adr;
h=(int)((double)h*scale);
w=(int)((double)w*scale);
if(depth==24) bpl=w*4;
......@@ -392,12 +398,12 @@ XImage *xwdtoximage(char *data,Visual *visual, int depth, XImage **XMask, int tr
free(oadr);
}
}
return(XCreateImage(display[usewindow],visual,depth,ZPixmap,0,adr,w,h,8,bpl));
return(XCreateImage(display[usewindow],visual,depth,ZPixmap,0,(char *)adr,w,h,8,bpl));
} else {
unsigned long swaptest = 1;
*XMask=NULL;
if(XMask) *XMask=NULL;
if (*(char *) &swaptest) swapdws(data, sizeof(XWDFileHeader));
#if DEBUG
#if DEBUG
printf("xwd-Name: %s\n",data+sizeof(XWDFileHeader));
printf("Version: %d\n",((XWDFileHeader *)data)->file_version);
printf("pixmap_format: %d\n",((XWDFileHeader *)data)->pixmap_format);
......@@ -412,7 +418,7 @@ XImage *xwdtoximage(char *data,Visual *visual, int depth, XImage **XMask, int tr
if(((XWDFileHeader *)data)->file_version!=(CARD32)XWD_FILE_VERSION) {
printf("Achtung: Falsche XWD Version: %d\n",(int)((XWDFileHeader *)data)->file_version);
adr=malloc(32*32*depth/8);
return(XCreateImage(display[usewindow],visual,depth,ZPixmap,0,adr,32,32,8,32*depth/8));
return(XCreateImage(display[usewindow],visual,depth,ZPixmap,0,(char *)adr,32,32,8,32*depth/8));
} else {
adr=malloc(((XWDFileHeader *)data)->pixmap_height*((XWDFileHeader *)data)->bytes_per_line);
memcpy(adr,data+((XWDFileHeader *)data)->header_size+((XWDFileHeader *)data)->ncolors*sizeof(XWDColor),((XWDFileHeader *)data)->pixmap_height*((XWDFileHeader *)data)->bytes_per_line);
......@@ -421,7 +427,7 @@ XImage *xwdtoximage(char *data,Visual *visual, int depth, XImage **XMask, int tr
((XWDFileHeader *)data)->pixmap_depth,
((XWDFileHeader *)data)->pixmap_format,
((XWDFileHeader *)data)->xoffset,
adr,
(char *)adr,
((XWDFileHeader *)data)->pixmap_width,
((XWDFileHeader *)data)->pixmap_height,
((XWDFileHeader *)data)->bitmap_pad,
......@@ -429,17 +435,17 @@ XImage *xwdtoximage(char *data,Visual *visual, int depth, XImage **XMask, int tr
}
}
#endif
#ifdef USE_SDL
SDL_Surface *bpmtosurface(char *data, double scale) {
#if 0
SDL_Surface *bpmtosurface(const char *data, double scale) {
SDL_Surface *ret;
/* Pruefen, ob es sich um eine BMP Datei handelt. */
if(*((unsigned short int *)data)==BF_TYPE) {
int dd,w,o,h,bpl,ncol;
int dd,w,o,h,bpl;
char *adr;
BITMAPFILEHEADER *header=(BITMAPFILEHEADER *)data;
BITMAPINFOHEADER *iheader=(BITMAPINFOHEADER *)(data+BITMAPFILEHEADERLEN);
ncol=iheader->biClrUsed;
// ncol=iheader->biClrUsed;
RGBQUAD *coltable=(RGBQUAD *)(data+BITMAPFILEHEADERLEN+BITMAPINFOHEADERLEN);
w=iheader->biWidth;
h=iheader->biHeight;
......
......@@ -6,7 +6,7 @@
* COPYING for details
*/
#ifndef WINDOWS_NATIVE
#ifndef WINDOWS
/* Wegen alignment (auf 4 !) */
typedef struct { /**** BMP file header structure ****/
......@@ -25,7 +25,7 @@ typedef struct { /**** BMP file header structure ****/
#define BF_TYPE 0x4D42 /* "MB" */
#define BITMAPFILEHEADERLEN 14
#ifndef WINDOWS_NATIVE
#ifndef WINDOWS
typedef struct { /**** BMP file info structure ****/
unsigned int biSize; /*14 Size of info header */
int biWidth; /*18 Width of image */
......@@ -51,7 +51,7 @@ typedef struct { /**** BMP file info structure ****/
# define BI_RLE4 2 /* 4-bit run-length compression */
# define BI_BITFIELDS 3 /* RGB bitmap with RGB masks */
#ifndef WINDOWS_NATIVEs
#ifndef WINDOWS
typedef struct { /**** Colormap entry structure ****/
unsigned char rgbBlue; /* Blue value */
unsigned char rgbGreen; /* Green value */
......@@ -60,7 +60,10 @@ typedef struct { /**** Colormap entry structure ****/
} RGBQUAD;
#endif
int bmp2bitmap(char *data,char *fbp,int x, int bw,int bh,int depth, char *mask);
int bmp2bitmap(const unsigned char *data,unsigned char *fbp,int x, unsigned int bw,unsigned int bh,unsigned int depth, unsigned char *mask);
#ifdef USE_X11
XImage *xwdtoximage(char *data,Visual *visual, int depth, XImage **XMask, int tres, double scale);
XImage *xwdtoximage(unsigned char *data,Visual *visual, int depth, XImage **XMask, int tres, double scale);
unsigned char *imagetoxwd(XImage *image,Visual *visual,XColor *pixc, int *len);
#endif
void bitmap_scale(const unsigned char *oadr,unsigned int depth,unsigned int ow,unsigned int oh,unsigned char *adr,unsigned int w,unsigned int h);
......@@ -10,19 +10,6 @@
#define bombe_mask_width 16
#define bombe_mask_height 16
static const unsigned char bombe_mask_bits[] = {
0x60, 0x00,
0x94, 0x00,
0x00, 0x01,
0x12, 0x02,
0x88, 0x0f,
0x80, 0x0f,
0xe0, 0x3f,
0xf0, 0x7f,
0xf0, 0x7f,
0xf8, 0xff,
0xf8, 0xff,
0xf0, 0x7f,
0xf0, 0x7f,
0xe0, 0x3f,
0xc0, 0x1f,
0x80, 0x0f};
0xf0, 0x00, 0xfc, 0x01, 0x9e, 0x03, 0x1e, 0x07, 0xcc, 0x1f, 0xc0, 0x1f,
0xf0, 0x7f, 0xf8, 0xff, 0xf8, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xf8, 0xff,
0xf8, 0xff, 0xf0, 0x7f, 0xe0, 0x3f, 0xc0, 0x1f};
/* This file is part of X11BASIC, the basic interpreter for Unix/X
* ============================================================
* X11BASIC is free software and comes with NO WARRANTY - read the file
* COPYING for details
*/
#define bombe_mask_width 16
#define bombe_mask_height 16
static const unsigned char bombe_mask_bits[] = {
0x60, 0x00,
0x94, 0x00,
0x00, 0x01,
0x12, 0x02,
0x88, 0x0f,
0x80, 0x0f,
0xe0, 0x3f,
0xf0, 0x7f,
0xf0, 0x7f,
0xf8, 0xff,
0xf8, 0xff,
0xf0, 0x7f,
0xf0, 0x7f,
0xe0, 0x3f,
0xc0, 0x1f,
0x80, 0x0f};
#define mauspfeil_width 16
#define mauspfeil_height 16
static unsigned char mauspfeil_bits[] = {
0x00, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0e, 0x00, 0x1e, 0x00, 0x3e, 0x00,
0x7e, 0x00, 0xfe, 0x00, 0x1e, 0x00, 0x1e, 0x00, 0x36, 0x00, 0x62, 0x00,
0xc0, 0x00, 0x80, 0x01, 0x00, 0x01, 0x00, 0x00};
#define mauspfeil_mask_width 16
#define mauspfeil_mask_height 16
static unsigned char mauspfeil_mask_bits[] = {
0x03, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x1f, 0x00, 0x3f, 0x00, 0x7f, 0x00,
0xff, 0x00, 0xff, 0x01, 0xff, 0x01, 0x3f, 0x00, 0x7f, 0x00, 0xf7, 0x00,
0xe3, 0x01, 0xc1, 0x03, 0x80, 0x03, 0x00, 0x03};
This diff is collapsed.
......@@ -8,7 +8,7 @@
#define BC_STACKLEN 256
#define BC_VERSION 0x1203 /* Version 1.20 release 1*/
#define BC_VERSION 0x1227 /* Version 1.22 release 7*/
typedef struct {
unsigned char BRAs; /* DC_BRAs */
......@@ -91,11 +91,11 @@ typedef struct {