engine-psx/include/util.h

24 lines
666 B
C
Raw Normal View History

2024-07-12 20:48:23 -03:00
#ifndef UTIL_H
#define UTIL_H
2024-07-15 03:37:57 -03:00
#include <psxgpu.h>
2024-07-12 20:48:23 -03:00
#include <psxgte.h>
#define BCD_TO_DEC(x) (((x & 0xF0) >> 4) * 10 + (x & 0x0F))
2024-07-16 18:25:18 -03:00
int RotTransPers(SVECTOR *v, uint32_t *xy0);
2024-07-12 20:48:23 -03:00
int RotAverageNclip4(SVECTOR *a, SVECTOR *b, SVECTOR *c, SVECTOR *d,
2024-07-16 18:25:18 -03:00
uint32_t *xy0, uint32_t *xy1, uint32_t *xy2, uint32_t *xy3,
2024-07-12 20:48:23 -03:00
int *otz);
2024-07-15 17:53:40 -03:00
uint8_t *file_read(const char *filename, uint32_t *length);
void load_texture(uint8_t *data, TIM_IMAGE *tim);
2024-07-15 03:37:57 -03:00
2024-07-15 17:53:40 -03:00
uint8_t get_byte(uint8_t *bytes, uint32_t *b);
uint16_t get_short_be(uint8_t *bytes, uint32_t *b);
uint16_t get_short_le(uint8_t *bytes, uint32_t *b);
2024-07-15 03:37:57 -03:00
2024-07-21 19:43:49 -03:00
uint32_t adler32(const char *s);
2024-07-12 20:48:23 -03:00
#endif