omarandlorraine / solid65

compare emulators against eachother

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Usage instructions

mre opened this issue Β· comments

Great idea to make MOS 6502 emulators comparable. πŸ‘

I wanted to run the project, but I ran into some rookie issues:

> make                                                                                                                                                               ✘
cc     generate_test_case.c solid65.h opcodes.h   -o generate_test_case
clang: error: cannot specify -o when generating multiple output files
make: *** [generate_test_case] Error 1

then I tried

./run_test
cc     generate_test_case.c solid65.h opcodes.h   -o generate_test_case
clang: error: cannot specify -o when generating multiple output files
make: *** [generate_test_case] Error 1
./run_test: line 6: ./generate_test_case: No such file or directory

cc     generate_test_case.c solid65.h opcodes.h   -o generate_test_case
clang: error: cannot specify -o when generating multiple output files
make: *** [generate_test_case] Error 1
gcc -c -g -Wall -Wextra -pedantic -o build/test.o test.c
test.c:15:6: warning: incompatible redeclaration of library function 'log' [-Wincompatible-library-redeclaration]
void log(char rw, uint16_t addr, uint8_t val) {
     ^
test.c:15:6: note: 'log' is a builtin with type 'double (double)'
test.c:57:23: error: implicitly declaring library function 'strtoul' with type 'unsigned long (const char *, char **, int)' [-Werror,-Wimplicit-function-declaration]
        testcase[i] = strtoul(argv[i], NULL, 16);
                      ^
test.c:57:23: note: include the header <stdlib.h> or explicitly provide a declaration for 'strtoul'
test.c:60:5: error: implicit declaration of function 'reset6502' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    reset6502();
    ^
test.c:60:5: note: did you mean 'read6502'?
test.c:33:9: note: 'read6502' declared here
uint8_t read6502(uint16_t addr) {
        ^
test.c:67:2: error: implicit declaration of function 'step6502' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        step6502();
        ^
test.c:54:11: warning: unused variable 'cycles' [-Wunused-variable]
        uint64_t cycles;
                 ^
test.c:53:14: warning: unused parameter 'argc' [-Wunused-parameter]
int main(int argc, char *argv[]) {
             ^
3 warnings and 3 errors generated.
make: *** [build/test.o] Error 1
g++ -c -g -Wall -Wextra -pedantic -o build/test.o test.cpp
test.cpp:2:10: fatal error: 'mos6502/mos6502.h' file not found
#include "mos6502/mos6502.h"
         ^~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [build/test.o] Error 1
./rerun: line 14: ./test: No such file or directory
./rerun: line 14: ./test: No such file or directory
    Finished dev [unoptimized + debuginfo] target(s) in 0.03s
     Running `target/debug/mre_mos6502`
thread 'main' panicked at 'range start index 7 out of range for slice of length 0', src/main.rs:39:30
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I'm on macOS Ventura.

cc --version                                                                                                                                                       ✘
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
make --version                                                                                                                                                     ✘
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

I'm very aware, that the issues are because of my lack of knowledge and not with the project itself.
Nevertheless, would it be possible to add some usage instructions to the README.md?
It would greatly help me to get started. 😊

That's weird. That same command works just fine for me.

cc     generate_test_case.c solid65.h opcodes.h   -o generate_test_case

But I have a different compiler

$ cc --version
cc (Gentoo 12.2.1_p20230121-r1 p10) 12.2.1 20230121
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

It's probably a GCC derivative. It's weird that clang can't take the same command line argument.

Can you try this:

cc     generate_test_case.c -o generate_test_case

and amend the Makefile if you find it works for you?

Sure! I created a PR. Works on my machine. Can you double-check?

I think you are right, that this could use (at least some basic) usage instructions. So I reopened the issue.

I've put some simple instructions in the README; does it seem like the kind of thing you had in mind?

Much better. Good job!

Looks like this is done now. Thanks. 😊