xrip / pico-megadrive

Raspberry Pi Pico Sega Megadrive / Sega Genesis emulator for MURMULATOR devboard
https://murmulator.ru
GNU Affero General Public License v3.0
14 stars 3 forks source link

Building from source fails #2

Open fhoedemakers opened 1 month ago

fhoedemakers commented 1 month ago

Hi,

I was trying to build the project from source using Pico SDK 1.5.1, gcc 13.2.0 on Ubuntu Ubuntu 24.04 LTS (WSL) , but it fails these errors:

[ 26%] Building C object CMakeFiles/genesis.dir/src/gwenesis/cpus/Z80/Z80.c.obj
In file included from /home/frank/projects/public/pico-megadrive/src/gwenesis/bus/gwenesis_bus.c:25:
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:293:3: error: unknown type name 'uint'
  293 |   uint pc;
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:294:3: error: unknown type name 'uint'
  294 |   uint cycle;
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:295:3: error: unknown type name 'uint'
  295 |   uint detected;
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:304:3: error: unknown type name 'uint'
  304 |   uint cycles;          /* current master cycle count */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:305:3: error: unknown type name 'uint'
  305 |   uint cycle_end;       /* aimed master cycle count for current execution frame */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:307:3: error: unknown type name 'uint'
  307 |   uint dar[16];         /* Data and Address Registers */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:308:3: error: unknown type name 'uint'
  308 |   uint pc;              /* Program Counter */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:309:3: error: unknown type name 'uint'
  309 |   uint sp[5];           /* User and Interrupt Stack Pointers */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:310:3: error: unknown type name 'uint'
  310 |   uint ir;              /* Instruction Register */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:311:3: error: unknown type name 'uint'
  311 |   uint t1_flag;         /* Trace 1 */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:312:3: error: unknown type name 'uint'
  312 |   uint s_flag;          /* Supervisor */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:313:3: error: unknown type name 'uint'
  313 |   uint x_flag;          /* Extend */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:314:3: error: unknown type name 'uint'
  314 |   uint n_flag;          /* Negative */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:315:3: error: unknown type name 'uint'
  315 |   uint not_z_flag;      /* Zero, inverted for speedups */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:316:3: error: unknown type name 'uint'
  316 |   uint v_flag;          /* Overflow */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:317:3: error: unknown type name 'uint'
  317 |   uint c_flag;          /* Carry */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:318:3: error: unknown type name 'uint'
  318 |   uint int_mask;        /* I0-I2 */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:319:3: error: unknown type name 'uint'
  319 |   uint int_level;       /* State of interrupt pins IPL0-IPL2 -- ASG: changed from ints_pending */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:320:3: error: unknown type name 'uint'
  320 |   uint stopped;         /* Stopped state */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:322:3: error: unknown type name 'uint'
  322 |   uint pref_addr;       /* Last prefetch address */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:323:3: error: unknown type name 'uint'
  323 |   uint pref_data;       /* Data in the prefetch queue */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:325:3: error: unknown type name 'uint'
  325 |   uint instr_mode;      /* Stores whether we are in instruction mode or group 0/1 exception mode */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:326:3: error: unknown type name 'uint'
  326 |   uint run_mode;        /* Stores whether we are processing a reset, bus error, address error, or something else */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:327:3: error: unknown type name 'uint'
  327 |   uint aerr_enabled;    /* Enables/deisables address error checks at runtime */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:329:3: error: unknown type name 'uint'
  329 |   uint aerr_address;    /* Address error location */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:330:3: error: unknown type name 'uint'
  330 |   uint aerr_write_mode; /* Address error write mode */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:331:3: error: unknown type name 'uint'
  331 |   uint aerr_fc;         /* Address error FC code */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:333:3: error: unknown type name 'uint'
  333 |   uint tracing;         /* Tracing enable flag */
      |   ^~~~
/home/frank/projects/public/pico-megadrive/src/gwenesis/bus/../cpus/M68K/m68k.h:335:3: error: unknown type name 'uint'
  335 |   uint address_space;   /* Current FC code */
      |   ^~~~
make[2]: *** [CMakeFiles/genesis.dir/build.make:76: CMakeFiles/genesis.dir/src/gwenesis/bus/gwenesis_bus.c.obj] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:1714: CMakeFiles/genesis.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Then i saw this line commented out in m68k,h:

image

So i removed the comment, but then i get these errors:

[build] [ 14%] Building C object CMakeFiles/genesis.dir/src/gwenesis/vdp/gwenesis_vdp_mem.c.obj
[build] In file included from /home/frank/projects/public/pico-megadrive/src/gwenesis/vdp/gwenesis_vdp_mem.c:24:
[build] /home/frank/projects/public/pico-megadrive/src/gwenesis/vdp/../cpus/M68K/m68k.h:83:16: error: duplicate 'unsigned'
[build]    83 | #define uint   unsigned int
[build]       |                ^~~~~~~~
[build] /home/frank/projects/public/pico-megadrive/src/gwenesis/vdp/../cpus/M68K/m68k.h:83:25: error: two or more data types in declaration specifiers
[build]    83 | #define uint   unsigned int
[build]       |                         ^~~
[build] gmake[2]: *** [CMakeFiles/genesis.dir/build.make:230: CMakeFiles/genesis.dir/src/gwenesis/vdp/gwenesis_vdp_mem.c.obj] Error 1
[build] gmake[1]: *** [CMakeFiles/Makefile2:1950: CMakeFiles/genesis.dir/all] Error 2
[build] gmake: *** [Makefile:91: all] Error 2

I cannot see where uint is declared elsewhere.

DnCraptor commented 1 month ago

Lets try to replace uint by uint32_t by global find and replace over whole project. In case this type is also not found, let include stdint.h

xrip commented 3 weeks ago

Looks like there is other issues with gcc 13. Gcc 10 compiles and runs okay, but gcc 13 have issues

fhoedemakers commented 3 weeks ago

I was looking into this project to investigate if i could use parts of it for a project similar to my Pico-InfoNesPlus Nes emulator for the Raspberry Pi Pico. Stumbled on these compile errors. Did not spend much time to see what it caused however.

xrip commented 3 weeks ago

It's compiles and runs with GCC 10.x without any issues, so you can use it as temporrary solution :)