Skip to content

Commit 92e79dd

Browse files
authored
Merge pull request #107 from floooh/c64-cleanup
Some m6569.h (VIC-II) optimizations and improvements.
2 parents 0949766 + de1be66 commit 92e79dd

File tree

3 files changed

+206
-213
lines changed

3 files changed

+206
-213
lines changed

chips/m6502.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,14 @@ uint16_t m6502_pc(m6502_t* cpu);
402402
#define CHIPS_ASSERT(c) assert(c)
403403
#endif
404404

405+
#if defined(__GNUC__)
406+
#define _M6502_UNREACHABLE __builtin_unreachable()
407+
#elif defined(_MSC_VER)
408+
#define _M6502_UNREACHABLE __assume(0)
409+
#else
410+
#define _M6502_UNREACHABLE
411+
#endif
412+
405413
/* register access functions */
406414
void m6502_set_a(m6502_t* cpu, uint8_t v) { cpu->A = v; }
407415
void m6502_set_x(m6502_t* cpu, uint8_t v) { cpu->X = v; }
@@ -3074,6 +3082,7 @@ uint64_t m6502_tick(m6502_t* c, uint64_t pins) {
30743082
case (0xFF<<3)|6: _FETCH();break;
30753083
case (0xFF<<3)|7: assert(false);break;
30763084
// %>
3085+
default: _M6502_UNREACHABLE;
30773086
}
30783087
M6510_SET_PORT(pins, c->io_pins);
30793088
c->PINS = pins;

0 commit comments

Comments
 (0)