Skip to content

Commit

Permalink
revert to stable sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
pmp-p committed Dec 6, 2023
1 parent c13bee6 commit 6740138
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build:
runs-on: ubuntu-22.04
env:
SDK_VERSION: 3.1.51.0bi
SDK_VERSION: 3.1.50.2bi
SYS_PYTHON: /usr/bin/python3
PACKAGES: emsdk hpy _ctypes pygame
BUILD_STATIC: emsdk _ctypes hpy
Expand Down
9 changes: 5 additions & 4 deletions pygbag/support/cross/aio/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ def make_src_dst(base_url, base_path, path, target):
return preload_list


async def preload(chroot=None, chdir=True, silent=FS_SILENT, debug=FS_DEBUG, standalone=False):
async def preload(chroot=None, chdir=True, silent=FS_SILENT, debug=FS_DEBUG, isolated=False):
global preload_list, preloaded

# if not using FS, do not change directory
if not len(preload_list):
if standalone:
if isolated:
return []
# return all previous filesets
return preloaded.copy()
Expand Down Expand Up @@ -173,12 +173,13 @@ async def preload(chroot=None, chdir=True, silent=FS_SILENT, debug=FS_DEBUG, sta
if not silent:
print("FS:174:", filename)

preloaded.extend(fileset)
if not isolated:
preloaded.extend(fileset)

if chdir:
os.chdir(chroot)

if standalone:
if isolated:
return fileset

await asyncio.sleep(0)
Expand Down
64 changes: 30 additions & 34 deletions pygbag/support/pygbag_app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
this = __import__(__name__)
import sys

if sys.platform not in ('emscripten','wasi') or aio.cross.simulator:
sleep_delay = 0
else:
sleep_delay = 0.0155



from pygbag_ui import Tui, TTY
import pygbag_ui as ui
Expand All @@ -7,41 +14,30 @@
ux_dim(1280 // 2 , 720 // 2)


if 1:

import pygame
class vpad:
X = 0
Z = 1
Y = 2
evx = []
evy = []
evz = []
axis = [evx, evz, evy]
class vpad:
X = 0
Z = 1
Y = 2
evx = []
evy = []
evz = []
axis = [evx, evz, evy]

LZ = 0.5
LZ = 0.5

@classmethod
def get_axis(self, n):
if len(self.axis[n]):
return self.axis[n].pop(0)
return 0.0
@classmethod
def get_axis(self, n):
if len(self.axis[n]):
return self.axis[n].pop(0)
return 0.0

@classmethod
def emit(self, axis, value):
self.axis[axis].append(float(value))
ev = pygame.event.Event(pygame.JOYAXISMOTION)
pygame.event.post(ev)
return False




import sys
if sys.platform not in ('emscripten','wasi') or aio.cross.simulator:
sleep_delay = 0
else:
sleep_delay = 0.0155
@classmethod
def emit(self, axis, value):
import pygame
self.axis[axis].append(float(value))
ev = pygame.event.Event(pygame.JOYAXISMOTION)
pygame.event.post(ev)
return False



Expand All @@ -62,7 +58,7 @@ def console():
if sys.platform not in ('emscripten','wasi') or aio.cross.simulator:
LINES = LINES - CONSOLE

TTY.set_raw(1)
ui.TTY.set_raw(1)
import select,os,platform

platform.shell.is_interactive = False
Expand Down
15 changes: 15 additions & 0 deletions scripts/build-loader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,21 @@ emcc \\
-o ${DIST_DIR}/python${PYMAJOR}${PYMINOR}/${MODE}.js build/${MODE}.o \\
$LDFLAGS -lembind -sERROR_ON_UNDEFINED_SYMBOLS=0
echo "
error: undefined symbol: _emval_decref (referenced by root reference (e.g. compiled C/C++ code))
error: undefined symbol: _emval_delete (referenced by root reference (e.g. compiled C/C++ code))
error: undefined symbol: _emval_greater_than (referenced by root reference (e.g. compiled C/C++ code))
error: undefined symbol: _emval_incref (referenced by root reference (e.g. compiled C/C++ code))
error: undefined symbol: _emval_less_than (referenced by root reference (e.g. compiled C/C++ code))
error: undefined symbol: _emval_new_cstring (referenced by root reference (e.g. compiled C/C++ code))
error: undefined symbol: _emval_set_property (referenced by root reference (e.g. compiled C/C++ code))
error: undefined symbol: _emval_strictly_equals (referenced by root reference (e.g. compiled C/C++ code))
"
#
# --bind -fno-rtti
Expand Down

0 comments on commit 6740138

Please sign in to comment.