retrodeluxe / rlengine-msx

RetroDeluxe Game Engine for MSX computers
GNU General Public License v2.0
51 stars 3 forks source link

Add prebuilts for Raspberry Pi #13

Open plattysoft opened 3 years ago

plattysoft commented 3 years ago

I was trying to get rlengine up and running on a Raspberry Pi using Raspbian. The problem is that the current makefile detects it as an x86, which is wrong. I have make a prebuilt version of sdcc 3.8.0 and tweaked main.mk to account for arm architecture (https://github.com/plattysoft/rlengine-msx/commit/76bee55fe976d18fe514d78af6cbe49179533de1)

As of today, it does compile, and the hello world rom works, but the more complex examples that use sprites got into an endless loop.

I suspect I need to patch something in the sdcc built after compiling, but there is no documentation about it.

If you point me to what those changes are, I can make this work and open a PR from my fork.

Cheers.

retrodeluxe commented 3 years ago

Hi @plattysoft,

the prebuilt sdcc indeed contains patches, the binaries come from this repo:

https://github.com/retrodeluxe/sdcc-msx

you can see the changes in the history.

If you build from that repo for arm you should get an equivalent to the x86 and darwin prebuilts.

Let me know if that works... some of the bigger examples indeed need a patched sdcc, but the sprites one I think it should work fine without it, so maybe there is another problem.

plattysoft commented 3 years ago

ah, I have to try that. Most of the examples work, but for example the physic one is giving me this error:

/home/pi/code/rlengine-msx/build//..//build/build_ascii8_rom.mk:41: recipe for target '/home/pi/code/rlengine-msx/test/phys_test/out/bin/phys_test.ihx' failed
make: *** [/home/pi/code/rlengine-msx/test/phys_test/out/bin/phys_test.ihx] Error 2
retrodeluxe commented 3 years ago

yup, if the Makefile uses

CONFIG_BANKED_CALLS := enabled

it requires the changes included in the customized sdcc-msx repo. The build should be fixed after updating the prebuilt.

plattysoft commented 3 years ago

I got an error building the sources, but the configure did not gave any warning and I was also able to build the version 3.8.0 of sdcc, so not sure if I am missing some tool / lib that needs to be installed in the Pi

retrodeluxe commented 3 years ago

I think if you build sdcc for all the targets it requires some tools that may not be available on your linux, and it doesn' t complain during the configure. Best is to disable those targets when doing the configure:

--disable-mcs51-port Excludes the Intel mcs51 port --disable-z80-port Excludes the Z80 port --disable-z180-port Excludes the Z180 port --disable-r2k-port Excludes the Rabbit 2000 port --disable-r3ka-port Excludes the Rabbit 3000A port --disable-gbz80-port Excludes the Gameboy gbz80 port --disable-tlcs90-port Excludes the TLCS-90 port --disable-ez80_z80-port Excludes the EZ80-Z80 port --disable-ds390-port Excludes the DS390 port --disable-ds400-port Excludes the DS400 port --disable-pic14-port Excludes the PIC14 port --disable-pic16-port Excludes the PIC16 port --disable-hc08-port Excludes the HC08 port --disable-s08-port Excludes the S08 port --disable-stm8-port Excludes the STM8 port --disable-ucsim Disables configuring and building of ucsim --disable-device-lib Disables building device libraries --disable-packihx Disables building packihx --disable-sdcpp Disables building sdcpp --disable-sdcdb Disables building sdcdb --disable-sdbinutils Disables configuring and building of sdbinutils --disable-non-free Disables non-free runtime library parts

maybe the error gives you a hint on which ones to disable.

plattysoft commented 3 years ago

I was just re-running it.

Makefile:472: recipe for target 'bfd.info' failed
make[4]: *** [bfd.info] Error 127

I realized that my current version of Raspberry OS is about 2 years old and can't be updated, so I am going to re-flash it and go again from scratch.

I will let you know. Thanks!

retrodeluxe commented 3 years ago

yep, that relates to: --disable-sdbinutils

plattysoft commented 3 years ago

Well, I already started flashing a newer version of the Raspberry OS on the Pi, so I won't be able to try again until later. I will reconfigure all that and see how it goes. Thanks!

plattysoft commented 3 years ago

Now, with an updated tool system, and disabling all the targets, I am getting a completely different error. It is interesting because sdbinutils is disabled.

make[1]: Entering directory '/home/pi/code/sdcc-msx/sdcc/support/sdbinutils'
make[1]: *** No targets specified and no makefile found.  Stop.
make[1]: Leaving directory '/home/pi/code/sdcc-msx/sdcc/support/sdbinutils'
make: *** [Makefile:147: sdcc-sdbinutils] Error 2
plattysoft commented 3 years ago

This is strange, I complied sdcc without errors on the previous version of the OS. I will try to build the standard 3.8 version and see if the issue is with this branch or with the current dev environment

plattysoft commented 3 years ago

Does it need a specific version of gcc to compile? I downloaded sdcc 3.8.0, which I previously compiled without problems, and it is failing too. The compiler version is the only thing that I can think of.

I am using gcc 8.3

retrodeluxe commented 3 years ago

I am not sure, I usually don't have problems with the sdcc build, neither in MacOS nor in Linux. Probably there is something different on the build for ARM.

Can you post here the build error? maybe I can guess something.

retrodeluxe commented 3 years ago

@plattysoft did you figure out the problem?

plattysoft commented 3 years ago

I haven't tried in a few days, both sdcc from the main branch and the one from this repo gave an error compiling, and it wasn't really informative, so given that I can use the engine on my Mac, I decided to swap to it.