Skip to content

Commit 734eb2a

Browse files
committed
[git] add missing files
1 parent d900eee commit 734eb2a

File tree

5 files changed

+144
-0
lines changed

5 files changed

+144
-0
lines changed

emscripten/Plugin.mk

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
EMCC=$(EMSDK_PREFIX) emcc
2+
BUILD=Build
3+
4+
OPTS=$(POPTS) -O2
5+
ifneq ($(DEBUG),)
6+
OPTS+=-g4 -s ASSERTIONS=1
7+
endif
8+
9+
OBJS=$(addprefix $(BUILD)/,$(addsuffix .em.o,$(SRCS)))
10+
CINCS=$(addprefix -I../,$(INCS))
11+
CFLGS=-DFT2_BUILD_LIBRARY -DDARWIN_NO_CARBON -DHAVE_UNISTD_H \
12+
-DOPT_GENERIC -DREAL_IS_FLOAT \
13+
$(OPTS)
14+
15+
all: path $(OBJS)
16+
@echo "EMLINK" $(TARGET)
17+
$(EMCC) $(OBJS) -s SIDE_MODULE=1 -s DISABLE_EXCEPTION_CATCHING=0 $(OPTS) -o $(BUILD)/$(TARGET).js
18+
@if [ "$(BUILD_WASM)" ]; then @$(EMCC) $(OBJS) -s SIDE_MODULE=1 -s WASM=1 -s DISABLE_EXCEPTION_CATCHING=0 $(OPTS) -o $(BUILD)/$(TARGET).js; fi
19+
20+
path:
21+
mkdir -p $(sort $(dir $(OBJS)))
22+
23+
clean:
24+
rm -rf $(BUILD)
25+
26+
$(BUILD)/%.em.o: ../%.cpp
27+
@echo "EMCC $<"
28+
@$(EMCC) $(CINCS) $(CFLGS) -std=c++11 -c $< --default-obj-ext .em.o -o $@
29+
30+
$(BUILD)/%.em.o: ../%.c
31+
@echo "EMCC $<"
32+
@$(EMCC) $(CINCS) $(CFLGS) -c $< --default-obj-ext .em.o -o $@

emscripten/gideros.ldr.asm.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
JPZLoad("gideros.asm.js.png",eval);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item>
4+
<color android:color="#123456"/>
5+
</item>
6+
<item>
7+
<bitmap
8+
android:src="@drawable/splash"
9+
android:tileMode="disabled"
10+
android:gravity="center"/>
11+
</item>
12+
</layer-list>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<resources>
2+
<!-- Base application theme is the default theme. -->
3+
<style name="Theme" parent="android:style/Theme.NoTitleBar.Fullscreen" />
4+
5+
<style name="Theme.Splash" parent="Theme">
6+
<item name="android:windowNoTitle">true</item>
7+
<item name="android:windowContentOverlay">@null</item>
8+
<item name="android:windowBackground">@drawable/splash_bg</item>
9+
</style>
10+
</resources>

win32_example/netendian.h

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#ifdef __BIG_ENDIAN__
2+
#define BIGENDIAN
3+
#else /* __BIG_ENDIAN__ */
4+
#ifdef __LITTLE_ENDIAN__
5+
#else
6+
#ifdef BSD
7+
#include <sys/endian.h>
8+
#elif WIN32
9+
//Little endian
10+
#else
11+
#include <endian.h>
12+
#endif
13+
#if __BYTE_ORDER == __BIG_ENDIAN
14+
#define BIGENDIAN
15+
#endif
16+
#endif /* __LITTLE_ENDIAN__ */
17+
#endif /* __BIG_ENDIAN__ */
18+
19+
#include <stdint.h>
20+
21+
#define PACKED __attribute__((packed))
22+
#define WEAK __attribute__((weak))
23+
24+
#define PULONG(p) ((union unal *)(p))->l
25+
#define PUSHORT(p) ((union unal *)(p))->s
26+
#define PLONG(p) ((union unal *)(p))->li
27+
#define PSHORT(p) ((union unal *)(p))->si
28+
#define PUCHAR(p) ((union unal *)(p))->b
29+
#define PCHAR(p) ((union unal *)(p))->bi
30+
#define PULONGLONG(p) ((union unal *)(p))->ll
31+
#define PLONGLONG(p) ((union unal *)(p))->lli
32+
#define PFLOAT(p) ((union unal *)(p))->f
33+
#define PDOUBLE(p) ((union unal *)(p))->d
34+
35+
#define STRINGIFY(x) #x
36+
#define TOSTRING(x) STRINGIFY(x)
37+
38+
// Endianness
39+
#define endian_swap2(a) ((((a)&0xFF)<<8)|(((a)>>8)&0xFF))
40+
#define endian_swap4(a) (((endian_swap2(a))<<16)|(endian_swap2((a)>>16)))
41+
#define endian_swap8(a) ((((uquad)(endian_swap4(a)))<<32)|(endian_swap4((a)>>32)))
42+
43+
#ifndef BIGENDIAN
44+
#ifndef LITTLEENDIAN
45+
#define LITTLEENDIAN
46+
#endif
47+
#define BIGENDIAN2(a) endian_swap2(a)
48+
#define LITTLEENDIAN2(a) (a)
49+
#define BIGENDIAN4(a) endian_swap4(a)
50+
#define LITTLEENDIAN4(a) (a)
51+
#define BIGENDIAN8(a) endian_swap8(a)
52+
#define LITTLEENDIAN8(a) (a)
53+
#else
54+
#define BIGENDIAN2(a) (a)
55+
#define LITTLEENDIAN2(a) endian_swap2(a)
56+
#define BIGENDIAN4(a) (a)
57+
#define LITTLEENDIAN4(a) endian_swap4(a)
58+
#define BIGENDIAN8(a) (a)
59+
#define LITTLEENDIAN8(a) endian_swap8(a)
60+
#endif
61+
62+
#define PLULONG(p) LITTLEENDIAN4(PULONG(p))
63+
#define PLUSHORT(p) LITTLEENDIAN2(PUSHORT(p))
64+
#define PLLONG(p) ((long)(LITTLEENDIAN4(PULONG(p))))
65+
#define PLSHORT(p) ((short)(LITTLEENDIAN2(PSHORT(p))))
66+
#define PLULONGLONG(p) LITTLEENDIAN8(PULONGLONG(p))
67+
#define PLLONGLONG(p) ((long long)(LITTLEENDIAN8(PLONGLONG(p))))
68+
69+
#define PBULONG(p) BIGENDIAN4(PULONG(p))
70+
#define PBUSHORT(p) BIGENDIAN2(PUSHORT(p))
71+
#define PBLONG(p) ((long)(BIGENDIAN4(PLONG(p))))
72+
#define PBSHORT(p) ((short)(BIGENDIAN2(PSHORT(p))))
73+
#define PBULONGLONG(p) BIGENDIAN8(PULONGLONG(p))
74+
#define PBLONGLONG(p) ((long long)(BIGENDIAN8(PLONGLONG(p))))
75+
76+
union unal
77+
{
78+
uint8_t b;
79+
uint16_t s;
80+
uint32_t l;
81+
int8_t bi;
82+
int16_t si;
83+
int32_t li;
84+
uint64_t ll;
85+
int64_t lli;
86+
float f;
87+
double d;
88+
} PACKED;
89+

0 commit comments

Comments
 (0)