1. Function does not work SDL_thread () in conjunction with machine code?

constant dato=allocate(8) atom key, t, arg

arg=allocate(8)

dummy = SDL_Init(SDL_INIT_TIMER)

key=SDL_GetKeyState(NULL)

function Thread(atom dato) while peek(dato)=0 do SDL_PumpEvents() end while return 0 end function

t = call_back({'+',routine_id("Thread")})

constant main_bucle=get_asm( "pushad "& "l1: "& "mov al,[key+27] "& "or al,al "& "jz l1 "& "mov [dato],al "& "popad "& "ret") resolve_param("dato",dato) resolve_param("key",key)

poke(dato,0)

dummy=SDL_CreateThread(t,arg) call(main_bucle)

SDL_Quit()

new topic     » topic index » view message » categorize

2. Re: Function does not work SDL_thread () in conjunction with machine code?

javier07b9 said...

constant dato=allocate(8) atom key, t, arg

arg=allocate(8)

dummy = SDL_Init(SDL_INIT_TIMER)

key=SDL_GetKeyState(NULL)

function Thread(atom dato) while peek(dato)=0 do SDL_PumpEvents() end while return 0 end function

t = call_back({'+',routine_id("Thread")})

constant main_bucle=get_asm( "pushad "& "l1: "& "mov al,[key+27] "& "or al,al "& "jz l1 "& "mov [dato],al "& "popad "& "ret") resolve_param("dato",dato) resolve_param("key",key)

poke(dato,0)

dummy=SDL_CreateThread(t,arg) call(main_bucle)

SDL_Quit()

Euphoria is not compatible with SDL_CreateThread().

new topic     » goto parent     » topic index » view message » categorize

3. Re: Function does not work SDL_thread () in conjunction with machine code?

Thank you very much

new topic     » goto parent     » topic index » view message » categorize

4. Re: Function does not work SDL_thread () in conjunction with machine code?

jimcbrown said...
javier07b9 said...

dummy=SDL_CreateThread(t,arg)

Euphoria is not compatible with SDL_CreateThread().

jim, can it be made compatible?

new topic     » goto parent     » topic index » view message » categorize

5. Re: Function does not work SDL_thread () in conjunction with machine code?

euphoric said...
jimcbrown said...
javier07b9 said...

dummy=SDL_CreateThread(t,arg)

Euphoria is not compatible with SDL_CreateThread().

jim, can it be made compatible?

The only (semi-)easy method that I'm aware of, which is highly platform-specific, would be to rebuild eu.a as a shared library and have SDL_CreateThread() call a C or machine code function that reloaded eu.so via dlmopen() specifying to load (or reload) the library in its own namespace.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Function does not work SDL_thread () in conjunction with machine code?

In the end the most practical solution is to use and compile it with WATCOM ECW.exe. Works 100% error-free

new topic     » goto parent     » topic index » view message » categorize

7. Re: Function does not work SDL_thread () in conjunction with machine code?

javier07b9 said...

In the end the most practical solution is to use and compile it with WATCOM ECW.exe. Works 100% error-free

It might work by chance for a very small program, but make it larger - or simply have both threads run for a long period of time - and you'll get the same sort of crash.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu