[Maintenance] Move twobyte_t into its own header file

And hope that there won't be any more generic utility types like it…

Part of P0133, funded by [Anonymous].
This commit is contained in:
nmlgc 2021-01-12 21:09:19 +01:00
parent 7b409a086a
commit d1f1b7d405
8 changed files with 28 additions and 15 deletions

View File

@ -53,12 +53,4 @@
#define RES_PARASIZE ((sizeof(resident_t) + 0xF) >> 4)
// ------
typedef union {
struct {
int8_t lo, hi;
} byte;
uint8_t u[2];
int16_t v;
} twobyte_t;
#endif /* REC98_H */

View File

@ -29,6 +29,7 @@ include libs/master.lib/pf.inc
include libs/master.lib/clip.inc
include libs/master.lib/macros.inc
include libs/kaja/kaja.inc
include twobyte.inc
include pc98.inc
include th01/hardware/egc.inc
include th02/formats/pi_slots.inc
@ -47,11 +48,6 @@ setfarfp macro farfp, func
mov word ptr farfp, offset func
endm
twobyte_t struc
lo db ?
hi db ?
twobyte_t ends
; master.lib extensions
; ---------------------
; super_roll_put_1plane() plane_put constants

View File

@ -10,6 +10,7 @@ extern "C" {
#include <stdio.h>
#include "ReC98.h"
#include "pc98kbd.h"
#include "twobyte.h"
#include "th01/ranks.h"
#include "th01/hardware/graph.h"
#include "th01/hardware/input.hpp"

View File

@ -1,4 +1,9 @@
#include "ReC98.h"
#include <stdlib.h>
#include "platform.h"
#include "pc98.h"
#include "planar.h"
#include "master.hpp"
#include "twobyte.h"
#include "th01/math/area.hpp"
#include "th01/math/wave.hpp"
#include "th01/hardware/egc.h"

View File

@ -9,6 +9,7 @@ extern "C" {
#include <io.h>
#include <stdio.h>
#include "ReC98.h"
#include "twobyte.h"
#include "th01/ranks.h"
#include "th01/formats/grp.h"
#include "th01/hardware/palette.h"

View File

@ -1,5 +1,10 @@
#include "ReC98.h"
#include <dos.h>
#include "platform.h"
#include "pc98.h"
#include "planar.h"
#include "decomp.h"
#include "twobyte.h"
#include "master.hpp"
// Note that this does not correspond to the tiled area painted into TH05's
// EDBK?.PI images.

9
twobyte.h Normal file
View File

@ -0,0 +1,9 @@
// Used by various (dumb) pieces of code that require byte-wise access to
// 16-bit values.
typedef union {
struct {
int8_t lo, hi;
} byte;
uint8_t u[2];
int16_t v;
} twobyte_t;

4
twobyte.inc Normal file
View File

@ -0,0 +1,4 @@
twobyte_t struc
lo db ?
hi db ?
twobyte_t ends