mirror of
https://github.com/pret/pokeheartgold.git
synced 2026-04-24 14:58:34 -05:00
- all local vars to camelcase - header include guards with lib name - comments for preprocessor directives - asm defs back to respective .inc files - /lib/dsprot/tools/ merged to /tools/ - unprefixed globals prefixed - sdk defs consolidated to sdk include - lsf lib split to objects
25 lines
594 B
C
25 lines
594 B
C
#ifndef INSTRUCTION_H
|
|
#define INSTRUCTION_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
|
|
typedef struct {
|
|
unsigned int operands : 24;
|
|
unsigned int opcode : 8;
|
|
} Instruction;
|
|
|
|
void Instructions_Read(Instruction *dst, unsigned int count, FILE *src);
|
|
void Instructions_Write(Instruction *src, unsigned int count, FILE *dst);
|
|
|
|
static inline uint32_t Instruction_GetFull(Instruction *dst) {
|
|
return (dst->opcode << 24) | dst->operands;
|
|
}
|
|
|
|
static inline void Instruction_SetFull(Instruction *dst, uint32_t full) {
|
|
dst->opcode = full >> 24;
|
|
dst->operands = full & 0x00FFFFFF;
|
|
}
|
|
|
|
#endif
|