import sdl, some tests, nothing work yet

This commit is contained in:
Ondřej Novák 2025-01-26 15:03:44 +01:00
parent a7278bac40
commit 378b5586ab
37 changed files with 721 additions and 167 deletions

View file

@ -16,16 +16,41 @@ extern MS_EVENT win_mouseEvent;
TMS_BASIC_INFO ms_basic_info={0};
static char ms_keys;
/*
void get_ms_event(MS_EVENT *event)
{
CheckMessageQueue();
*event=win_mouseEvent;
win_mouseEvent.event=0;
}
char cz_table_1[]=" 1!3457<35>908+,-./<2F>+<2B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\"<EFBFBD>?=:_2ABCDEFGHIJKLMNOPQRSTUVWXYZ<59>\\)6=;abcdefghijklmnopqrstuvwxyz/|(; ";
char cz_table_2[]=" !\"#$%&'()*+,-./0123456789:;<=>?@<40>BCD<43>FGH<47>JK<4A>MN<4D>PQ<50>ST<53>VWX<57>Z[\\]^_`<60>bcd<63>fgh<67>jk<6A>mn<6D>pq<70>st<73>vwx<77>z{|}~ ";
char cz_table_3[]=" !\"#$%&'()*+,-./0123456789:;<=>?@AB<41><42><EFBFBD>FGHIJK<4A>M<EFBFBD><4D>PQ<50><51><EFBFBD><EFBFBD>VWXY<58>[\\]^_`ab<61><62><EFBFBD>fghijk<6A>m<EFBFBD><6D>pq<70><71><EFBFBD><EFBFBD>vwxy<78>{|}~ ";
*/
char cz_table_1[] = { 0x20, 0x31, 0x21, 0x33, 0x34, 0x35, 0x37, 0xad, 0x39,
0x30, 0x38, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x82, 0x2b, 0x88, 0xa8, 0x87,
0xa9, 0x91, 0x98, 0xa0, 0xa1, 0x5c, 0x22, 0x96, 0x3f, 0x3d, 0x3a, 0x5f,
0x32, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
0x58, 0x59, 0x5a, 0xa3, 0x5c, 0x5c, 0x29, 0x36, 0x3d, 0x3b, 0x61, 0x62,
0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e,
0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a,
0x2f, 0x7c, 0x28, 0x3b, 0x20 };
char cz_table_2[] = { 0x20, 0x21, 0x5c, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33,
0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
0x40, 0x8f, 0x42, 0x43, 0x44, 0x90, 0x46, 0x47, 0x48, 0x8b, 0x4a, 0x4b,
0x8a, 0x4d, 0x4e, 0x95, 0x50, 0x51, 0xab, 0x53, 0x54, 0x97, 0x56, 0x57,
0x58, 0x9d, 0x5a, 0x5b, 0x5c, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0xa0, 0x62,
0x63, 0x64, 0x82, 0x66, 0x67, 0x68, 0xa1, 0x6a, 0x6b, 0x8d, 0x6d, 0x6e,
0xa2, 0x70, 0x71, 0xaa, 0x73, 0x74, 0xa3, 0x76, 0x77, 0x78, 0x98, 0x7a,
0x7b, 0x7c, 0x7d, 0x7e, 0x20 };
char cz_table_3[] = { 0x20, 0x21, 0x5c, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33,
0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
0x40, 0x41, 0x42, 0x80, 0x85, 0x89, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
0x9c, 0x4d, 0xa5, 0xa7, 0x50, 0x51, 0x9e, 0x9b, 0x86, 0xa6, 0x56, 0x57,
0x58, 0x59, 0x92, 0x5b, 0x5c, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62,
0x87, 0x83, 0x88, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x8c, 0x6d, 0xa4,
0x93, 0x70, 0x71, 0xa9, 0xa8, 0x9f, 0x96, 0x76, 0x77, 0x78, 0x79, 0x91,
0x7b, 0x7c, 0x7d, 0x7e, 0x20 };
char *cz_key_tabs[]={cz_table_1,cz_table_2,cz_table_3};
void keyboard(EVENT_MSG *msg,void *user_data)

View file

@ -430,11 +430,10 @@ void timer(EVENT_MSG *msg)
}
}
void tasker(EVENT_MSG *msg,void **data)
void tasker(EVENT_MSG *msg,void **)
{
data;
switch (msg->msg)
{
case E_INIT:
@ -449,22 +448,22 @@ void tasker(EVENT_MSG *msg,void **data)
case E_IDLE:
default:
if (q_any_task()>=1)
task_sleep(NULL);
task_sleep();
break;
case E_DONE:
{
int i;
/* int i;
memset(task_info,1,taskcount);
do
{
for (i=1;i<taskcount;i++)
if (tasklist_sp[i]!=NULL) break;
if (i!=taskcount) task_sleep(NULL);
if (i!=taskcount) task_sleep();
}
while (i<taskcount);
free(tasklist_sp);
free(tasklist_low);
free(task_info);
free(task_info);*/
}
break;
}
@ -505,7 +504,7 @@ static char do_events_called=0;
void do_events()
{
do_events_called=1;
if (!q_is_mastertask()) task_sleep(NULL);
if (!q_is_mastertask()) task_sleep();
else
{
send_message(E_WATCH);
@ -662,6 +661,6 @@ void shut_down_task(int id_num)
{
if (!curtask) return NULL;
suspend_task(curtask,event_number);
return task_sleep(NULL);
return task_sleep();
}
*/

View file

@ -124,7 +124,7 @@ static __inline void shift_message(EVENT_MSG *msg) {
void do_events();
void escape();
#include <FCS_Tasker.h>
#include <legacy_coroutines.h>
/*
void *task_sleep(void *param);
//#pragma aux task_sleep parm [eax] value [eax]
@ -142,18 +142,6 @@ char is_running(int id_num);
*/
void timer(EVENT_MSG *msg);
#define EVENT_PROC(name) void name(EVENT_MSG *msg,void **user_ptr)
#define WHEN_MSG(msg_num) if (msg->msg==msg_num)
#define UNTIL_MSG(msg_num) if (msg->msg!=msg_num)
#define GET_DATA(data_type) (va_arg(msg->data, data_type))
#define GET_DATA_PTR(data_type) (va_arg(msg->data, data_type *))
#define GET_USER(data_type) (*(data_type *)user_ptr)
#define SAVE_USER_PTR(p) (*user_ptr=p)
#define GET_USER_PTR() user_ptr
#define EVENT_RETURN(value) msg->msg=value
#define GET_MSG_VAR() msg
#define GET_MSG() msg->msg
#define TASK_GET_TERMINATE() ((task_info[cur_task] & TASK_TERMINATING)!=0)
#define EVENT_HALT -1
#define EVENT_DONE -2

30
libs/event_macros.h Normal file
View file

@ -0,0 +1,30 @@
/*
* event_macros.h
*
* Created on: 26. 1. 2025
* Author: ondra
*/
#ifndef LIBS_EVENT_MACROS_H_
#define LIBS_EVENT_MACROS_H_
#include "event.h"
#define EVENT_PROC(name) void name(EVENT_MSG *msg,void **user_ptr)
#define WHEN_MSG(msg_num) if (msg->msg==msg_num)
#define UNTIL_MSG(msg_num) if (msg->msg!=msg_num)
#define GET_DATA(data_type) (va_arg(msg->data, data_type))
#define GET_DATA_PTR(data_type) (va_arg(msg->data, data_type *))
#define GET_USER(data_type) (*(data_type *)user_ptr)
#define SAVE_USER_PTR(p) (*user_ptr=p)
#define GET_USER_PTR() user_ptr
#define EVENT_RETURN(value) msg->msg=value
#define GET_MSG_VAR() msg
#define GET_MSG() msg->msg
#define TASK_GET_TERMINATE() ((task_info[cur_task] & TASK_TERMINATING)!=0)
#endif /* LIBS_EVENT_MACROS_H_ */

View file

@ -19,7 +19,7 @@ extern "C" {
#define DEV_DIRECTSOUND 9 //only valid device for this module
extern int bvolume;
extern void (*konec_skladby)(char **jmeno);
int sound_detect(int *dev,int *port,int *dma, int *irq);
void set_mixing_device(int mix_dev,int mix_freq,...);
@ -28,6 +28,7 @@ void stop_mixing();
void play_sample(int channel,void *sample,int32_t size,int32_t lstart,int32_t sfreq,int type);
void set_channel_volume(int channel,int left,int right);
void init_winamp_plugins(const char *path);
void set_end_of_song_callback(const char * (*cb)(void *), void *ctx);
void fade_music();
int mix_back_sound(int synchro);