Skip to content

Commit

Permalink
Fix opcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
BlockoS committed Oct 13, 2024
1 parent dfbf35e commit 4032bdd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions opcodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static char* pce_opstring[PCE_TYPE_COUNT][PCE_ARG_COUNT] = {
};

// PC engine opcodes
static opcode_t pce_opcode[256] = {
static Opcode pce_opcode[256] = {
/* 00 */ { "brk ", 1 , 0 }, // BRK
/* 01 */ { "ora ", 2 , 11 }, // ORA (ZZ, X)
/* 02 */ { "sxy ", 1 , 0 }, // SXY
Expand Down Expand Up @@ -326,12 +326,12 @@ static opcode_t pce_opcode[256] = {
};

// Get opcode description.
const opcode_t* opcode_get(uint8_t op) {
const Opcode* opcode_get(uint8_t op) {
return &pce_opcode[op];
}

// Get opcode description
const char* opcode_format(const opcode_t *op, int i) {
const char* opcode_format(const Opcode *op, int i) {
if((i < 0) || (i >= PCE_ARG_COUNT)) {
return NULL;
}
Expand Down
4 changes: 2 additions & 2 deletions opcodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ typedef struct {
/// Get opcode description
/// \param [in] op Opcode id
/// \return Pointer to opcode description
const opcode_t* opcode_get(uint8_t op);
const Opcode* opcode_get(uint8_t op);

/// Get opcode format string
/// \param [in] op Pointer to opcode description
/// \param [in] i Opcode argument id
/// \return Argument format string
/// \return NULL if the argument id is out of opcode argument count
const char* opcode_format(const opcode_t *op, int i);
const char* opcode_format(const Opcode *op, int i);

/// Is the instruction a local jump ?
bool opcode_is_local_jump(uint8_t op);
Expand Down

0 comments on commit 4032bdd

Please sign in to comment.