Skip to content

Commit

Permalink
Merge pull request #107 from floooh/c64-cleanup
Browse files Browse the repository at this point in the history
Some m6569.h (VIC-II) optimizations and improvements.
  • Loading branch information
floooh authored Jan 6, 2025
2 parents 0949766 + de1be66 commit 92e79dd
Show file tree
Hide file tree
Showing 3 changed files with 206 additions and 213 deletions.
9 changes: 9 additions & 0 deletions chips/m6502.h
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,14 @@ uint16_t m6502_pc(m6502_t* cpu);
#define CHIPS_ASSERT(c) assert(c)
#endif

#if defined(__GNUC__)
#define _M6502_UNREACHABLE __builtin_unreachable()
#elif defined(_MSC_VER)
#define _M6502_UNREACHABLE __assume(0)
#else
#define _M6502_UNREACHABLE
#endif

/* register access functions */
void m6502_set_a(m6502_t* cpu, uint8_t v) { cpu->A = v; }
void m6502_set_x(m6502_t* cpu, uint8_t v) { cpu->X = v; }
Expand Down Expand Up @@ -3074,6 +3082,7 @@ uint64_t m6502_tick(m6502_t* c, uint64_t pins) {
case (0xFF<<3)|6: _FETCH();break;
case (0xFF<<3)|7: assert(false);break;
// %>
default: _M6502_UNREACHABLE;
}
M6510_SET_PORT(pins, c->io_pins);
c->PINS = pins;
Expand Down
Loading

0 comments on commit 92e79dd

Please sign in to comment.