semiversus / jeg

NES emulator with focus at hardware abstraction, testability and performance
MIT License
9 stars 2 forks source link

improper structure definition causing compilation error #1

Closed GorgonMeducer closed 6 years ago

GorgonMeducer commented 6 years ago

In cpu6502_opcodes.h, the structure opcode_tbl_entry is defined improperly:

struct opcode_tbl_entry { char *mnemonic; operation_enum_t operation; address_mode_enum_t address_mode; int bytes; int cycles; int page_cross_cycles; }opcode_tbl_entry ;

As this header file is included by multiple source files, linker ends up throw following errors:

.\Out\msp2_file_io_template.axf: Error: L6200E: Symbol opcode_tbl_entry multiply defined (by cpu6502_debug.o and cpu6502.o). .\Out\msp2_file_io_template.axf: Error: L6200E: Symbol opcode_tbl_entry multiply defined (by cpu6502_opcodes.o and cpu6502.o).

It's safe to change it to:

struct opcode_tbl_entry { char *mnemonic; operation_enum_t operation; address_mode_enum_t address_mode; int bytes; int cycles; int page_cross_cycles; };

semiversus commented 6 years ago

@GorgonMeducer Thx!