[Decompilation] Define generic function pointer types

Going with the classic pointer-in-typedef approach here, because the
syntax you'd otherwise have to use is terribly inconsistent. It'd be

	 farfunc_t *near near_ptr_to_far_func;

but

	nearfunc_t near *near_ptr_to_near_func;

And that'd hopefully be the last change to ReC98.h for a long time!
Those glacial compile times if every .c file is affected… Really
stands out if your build system is otherwise perfect.

Part of P0030, funded by zorg.
This commit is contained in:
nmlgc 2019-09-15 16:09:08 +02:00
parent c7fc4ca41d
commit ac2117040c
1 changed files with 11 additions and 0 deletions

11
ReC98.h
View File

@ -45,6 +45,17 @@
#define RES_PARASIZE ((sizeof(resident_t) + 0xF) >> 4) #define RES_PARASIZE ((sizeof(resident_t) + 0xF) >> 4)
// ------ // ------
/// Typedefs
/// --------
// Generic callback function types. Note the difference between function
// distance (nearfunc / farfunc) and pointer variable distance
// (t_near / t_far).
typedef void (near pascal *near nearfunc_t_near)(void);
typedef void ( far pascal *near farfunc_t_near)(void);
typedef void (near pascal * far nearfunc_t_far)(void);
typedef void ( far pascal * far farfunc_t_far)(void);
/// --------
#define RES_X 640 #define RES_X 640
#define RES_Y 400 #define RES_Y 400