User Tools

Site Tools


mspacman:pi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
mspacman:pi [2013/10/02 11:38]
ben
mspacman:pi [2013/10/06 08:38]
ben
Line 571: Line 571:
 That validity.c at the end looks like maybe commenting out drivers I don't want may be easier. ​ Took a long break, then tried my own tiny.mak (mspacman.c w/mame.mak) and in the process of that found out that the way I was commenting things out in mame.mak is BROKEN, and I'm an idiot. ​ That said, my tiny file looks like it should work but I still get a bunch of undefined references. ​ Dug around, found out I had commented out generic.o as an emulator machine type.  Argh.  That validity.c at the end looks like maybe commenting out drivers I don't want may be easier. ​ Took a long break, then tried my own tiny.mak (mspacman.c w/mame.mak) and in the process of that found out that the way I was commenting things out in mame.mak is BROKEN, and I'm an idiot. ​ That said, my tiny file looks like it should work but I still get a bunch of undefined references. ​ Dug around, found out I had commented out generic.o as an emulator machine type.  Argh. 
  
 +Commenting in the .mak files is a big deal.  After fixing comments:
 +<​code>​
 +pi@pi ~/​src/​sdlmame0136 $ make
 +Compiling src/​mame/​mspacman.c...
 +Compiling src/​version.c...
 +Linking mame...
 +obj/​sdl/​mame/​libemu.a(ui.o):​ In function `slider_overyoffset':​
 +ui.c:​(.text+0x11c):​ undefined reference to `laserdisc_get_config'​
 +ui.c:​(.text+0x148):​ undefined reference to `laserdisc_set_config'​
 +obj/​sdl/​mame/​libemu.a(ui.o):​ In function `slider_overyscale':​
 +ui.c:​(.text+0x1cc):​ undefined reference to `laserdisc_get_config'​
 +ui.c:​(.text+0x1f8):​ undefined reference to `laserdisc_set_config'​
 +obj/​sdl/​mame/​libemu.a(ui.o):​ In function `slider_overxoffset':​
 +ui.c:​(.text+0x27c):​ undefined reference to `laserdisc_get_config'​
 +ui.c:​(.text+0x2a8):​ undefined reference to `laserdisc_set_config'​
 +obj/​sdl/​mame/​libemu.a(ui.o):​ In function `slider_overxscale':​
 +ui.c:​(.text+0x32c):​ undefined reference to `laserdisc_get_config'​
 +ui.c:​(.text+0x358):​ undefined reference to `laserdisc_set_config'​
 +obj/​sdl/​mame/​libemu.a(ui.o):​ In function `ui_display_startup_screens':​
 +ui.c:​(.text+0x33a8):​ undefined reference to `device_get_info_laserdisc'​
 +ui.c:​(.text+0x3e3c):​ undefined reference to `device_get_info_laserdisc'​
 +obj/​sdl/​mame/​libsound.a(ay8910.o):​ In function `ay8910_start_ym':​
 +ay8910.c:​(.text+0xa3c):​ undefined reference to `devcb_resolve_read8'​
 +ay8910.c:​(.text+0xa4c):​ undefined reference to `devcb_resolve_read8'​
 +ay8910.c:​(.text+0xa5c):​ undefined reference to `devcb_resolve_write8'​
 +ay8910.c:​(.text+0xa6c):​ undefined reference to `devcb_resolve_write8'​
 +collect2: ld returned 1 exit status
 +make: *** [mame] Error 1
 +
 +</​code>​
 +
 +Uncommented ldcore from emu.mak and get:
 +<​code>​
 +pi@pi ~/​src/​sdlmame0136 $ make
 +Compiling src/​emu/​machine/​ldcore.c...
 +Archiving obj/​sdl/​mame/​libemu.a...
 +Compiling src/​version.c...
 +Linking mame...
 +obj/​sdl/​mame/​libemu.a(ldcore.o):​ In function `device_get_info_laserdisc':​
 +ldcore.c:​(.text+0x3d0):​ undefined reference to `pr8210_interface'​
 +ldcore.c:​(.text+0x3d4):​ undefined reference to `simutrek_interface'​
 +ldcore.c:​(.text+0x3d8):​ undefined reference to `ldv1000_interface'​
 +ldcore.c:​(.text+0x3dc):​ undefined reference to `vp931_interface'​
 +obj/​sdl/​mame/​libemu.a(ldcore.o):​ In function `device_reset_laserdisc':​
 +ldcore.c:​(.text+0x510):​ undefined reference to `pr8210_interface'​
 +ldcore.c:​(.text+0x514):​ undefined reference to `simutrek_interface'​
 +ldcore.c:​(.text+0x518):​ undefined reference to `ldv1000_interface'​
 +ldcore.c:​(.text+0x51c):​ undefined reference to `vp931_interface'​
 +obj/​sdl/​mame/​libemu.a(ldcore.o):​ In function `device_start_laserdisc':​
 +ldcore.c:​(.text+0x182c):​ undefined reference to `pr8210_interface'​
 +ldcore.c:​(.text+0x1830):​ undefined reference to `simutrek_interface'​
 +ldcore.c:​(.text+0x1834):​ undefined reference to `vp931_interface'​
 +ldcore.c:​(.text+0x1838):​ undefined reference to `ldv1000_interface'​
 +obj/​sdl/​mame/​libsound.a(ay8910.o):​ In function `ay8910_start_ym':​
 +ay8910.c:​(.text+0xa3c):​ undefined reference to `devcb_resolve_read8'​
 +ay8910.c:​(.text+0xa4c):​ undefined reference to `devcb_resolve_read8'​
 +ay8910.c:​(.text+0xa5c):​ undefined reference to `devcb_resolve_write8'​
 +ay8910.c:​(.text+0xa6c):​ undefined reference to `devcb_resolve_write8'​
 +collect2: ld returned 1 exit status
 +make: *** [mame] Error 1
 +</​code>​
 +
 +That to me looks like adding ldcore will only mean adding more stuff we don't need- which means I need to figure out what needs laserdisc support and disable that.  Surely pacman games don't need laserdisc support. ​ Duh: 
 +<​code>​
 +pi@pi ~/​src/​sdlmame0136 $ find ./ -name *.mak
 +./​src/​osd/​windows/​windows.mak
 +./​src/​osd/​sdl/​build.mak
 +./​src/​osd/​sdl/​sdl.mak
 +./​src/​osd/​osdmini/​osdmini.mak
 +**./​src/​ldplayer/​ldplayer.mak**
 +./​src/​lib/​lib.mak
 +./​src/​emu/​sound/​sound.mak
 +./​src/​emu/​cpu/​mips/​dismips.mak
 +./​src/​emu/​cpu/​cpu.mak
 +./​src/​emu/​emu.mak
 +./​src/​tools/​tools.mak
 +./​src/​mame/​mame.mak
 +./​src/​mame/​bak/​mame.mak
 +./​src/​mame/​bak/​tiny.mak
 +./​src/​build/​build.mak
 +
 +</​code>​
 +
 +From src/​ldplayer/​ldplayer.mak:​
 +<​code>​
 +###########################################################################​
 +#
 +#   ​ldplayer.mak
 +#
 +#   Small makefile to build a standalone laserdisc player
 +#
 +#   ​Copyright Nicola Salmoria and the MAME Team.
 +#   Visit http://​mamedev.org for licensing and usage restrictions.
 +#
 +###########################################################################​
 +</​code>​
 +
 +Commented out the DRVLIBS entries in ldplayer.mak.
 +<​code>​
 +pi@pi ~/​src/​sdlmame0136 $ find obj/ -name ld*
 +obj/​sdl/​mame/​emu/​machine/​ldcore.o
 +pi@pi ~/​src/​sdlmame0136 $ rm obj/​sdl/​mame/​emu/​machine/​ldcore.o
 +pi@pi ~/​src/​sdlmame0136 $ make
 +Linking mame...
 +[same ld errors]
 +pi@pi ~/​src/​sdlmame0136 $ rm obj/​sdl/​mame/​libemu.a
 +pi@pi ~/​src/​sdlmame0136 $ make
 +Linking mame...
 +obj/​sdl/​mame/​libemu.a(ui.o):​ In function `slider_overyoffset':​
 +ui.c:​(.text+0x11c):​ undefined reference to `laserdisc_get_config'​
 +ui.c:​(.text+0x148):​ undefined reference to `laserdisc_set_config'​
 +obj/​sdl/​mame/​libemu.a(ui.o):​ In function `slider_overyscale':​
 +ui.c:​(.text+0x1cc):​ undefined reference to `laserdisc_get_config'​
 +ui.c:​(.text+0x1f8):​ undefined reference to `laserdisc_set_config'​
 +obj/​sdl/​mame/​libemu.a(ui.o):​ In function `slider_overxoffset':​
 +ui.c:​(.text+0x27c):​ undefined reference to `laserdisc_get_config'​
 +ui.c:​(.text+0x2a8):​ undefined reference to `laserdisc_set_config'​
 +obj/​sdl/​mame/​libemu.a(ui.o):​ In function `slider_overxscale':​
 +ui.c:​(.text+0x32c):​ undefined reference to `laserdisc_get_config'​
 +ui.c:​(.text+0x358):​ undefined reference to `laserdisc_set_config'​
 +obj/​sdl/​mame/​libemu.a(ui.o):​ In function `ui_display_startup_screens':​
 +ui.c:​(.text+0x33a8):​ undefined reference to `device_get_info_laserdisc'​
 +ui.c:​(.text+0x3e3c):​ undefined reference to `device_get_info_laserdisc'​
 +obj/​sdl/​mame/​libsound.a(ay8910.o):​ In function `ay8910_start_ym':​
 +ay8910.c:​(.text+0xa3c):​ undefined reference to `devcb_resolve_read8'​
 +ay8910.c:​(.text+0xa4c):​ undefined reference to `devcb_resolve_read8'​
 +ay8910.c:​(.text+0xa5c):​ undefined reference to `devcb_resolve_write8'​
 +ay8910.c:​(.text+0xa6c):​ undefined reference to `devcb_resolve_write8'​
 +collect2: ld returned 1 exit status
 +make: *** [mame] Error 1
 +
 +pi@pi ~/​src/​sdlmame0136 $ find obj/ -name \*ui\*
 +obj/​sdl/​mame/​emu/​ui.o
 +obj/​sdl/​mame/​emu/​uigfx.o
 +obj/​sdl/​mame/​emu/​uismall.fh
 +obj/​sdl/​mame/​emu/​uimenu.o
 +obj/​sdl/​mame/​emu/​uiinput.o
 +obj/​sdl/​mame/​build
 +
 +pi@pi ~/​src/​sdlmame0136 $ rm obj/​sdl/​mame/​emu/​ui*.o
 +
 +</​code>​
 +
 +Same result. ​ Tired of guessing, make clean, build again knowing ldplayer.mak has nothing in it.
 +
 +The issue with undefined references in ay8910 should be in devcb.o, which IS getting built. ​ Strange. ​ Also the longest build part is "​voodoo.c"​ which is some 3dfx card that I don't need, so commenting it out of emu.mak for the future. ​
 +
 +Ldcore.o still causing problems, uncommented it in emu.mak:
 +<​code>​
 +ldcore.c:​(.text+0x3d0):​ undefined reference to `pr8210_interface'​
 +ldcore.c:​(.text+0x3d4):​ undefined reference to `simutrek_interface'​
 +ldcore.c:​(.text+0x3d8):​ undefined reference to `ldv1000_interface'​
 +ldcore.c:​(.text+0x3dc):​ undefined reference to `vp931_interface'​
 +</​code>​
 +
 +Uncommented the laserdisc stuff in emu.mak:
 +<​code>​
 +pi@pi ~/​src/​sdlmame0136 $ make
 +Compiling src/​emu/​machine/​ldpr8210.c...
 +Compiling src/​emu/​machine/​ldv1000.c...
 +Compiling src/​emu/​machine/​ldvp931.c...
 +Archiving obj/​sdl/​mame/​libemu.a...
 +Compiling src/​version.c...
 +Linking mame...
 +obj/​sdl/​mame/​libemu.a(ldpr8210.o):​(.rodata+0x2c8):​ undefined reference to `cpu_get_info_i8748'​
 +obj/​sdl/​mame/​libemu.a(ldpr8210.o):​(.rodata+0x330):​ undefined reference to `cpu_get_info_i8049'​
 +obj/​sdl/​mame/​libemu.a(ldv1000.o):​(.rodata+0xd4):​ undefined reference to `device_get_info_ppi8255'​
 +obj/​sdl/​mame/​libemu.a(ldv1000.o):​(.rodata+0xec):​ undefined reference to `device_get_info_ppi8255'​
 +obj/​sdl/​mame/​libemu.a(ldv1000.o):​(.rodata+0x174):​ undefined reference to `ppi8255_r'​
 +obj/​sdl/​mame/​libemu.a(ldv1000.o):​(.rodata+0x17c):​ undefined reference to `ppi8255_w'​
 +obj/​sdl/​mame/​libemu.a(ldv1000.o):​(.rodata+0x1a0):​ undefined reference to `ppi8255_r'​
 +obj/​sdl/​mame/​libemu.a(ldv1000.o):​(.rodata+0x1a8):​ undefined reference to `ppi8255_w'​
 +obj/​sdl/​mame/​libemu.a(ldvp931.o):​(.rodata+0x98):​ undefined reference to `cpu_get_info_i8049'​
 +collect2: ld returned 1 exit status
 +make: *** [mame] Error 1
 +</​code>​
 +
 +Instead of adding more CPUs etc to likely get more failed dependencies,​ commenting out all laser disc related stuff in ui.c, hopefully we won't need that.
 +
 +<​code>​
 +pi@pi ~/​src/​sdlmame0136 $ make
 +Compiling src/​emu/​ui.c...
 +src/​emu/​ui.c:​114:​14:​ warning: ‘slider_overxscale’ declared ‘static’ but never defined [-Wunused-function]
 +src/​emu/​ui.c:​115:​14:​ warning: ‘slider_overyscale’ declared ‘static’ but never defined [-Wunused-function]
 +src/​emu/​ui.c:​116:​14:​ warning: ‘slider_overxoffset’ declared ‘static’ but never defined [-Wunused-function]
 +src/​emu/​ui.c:​117:​14:​ warning: ‘slider_overyoffset’ declared ‘static’ but never defined [-Wunused-function]
 +Archiving obj/​sdl/​mame/​libemu.a...
 +Compiling src/​version.c...
 +Linking mame...
 +obj/​sdl/​mame/​libsound.a(ay8910.o):​ In function `ay8910_start_ym':​
 +ay8910.c:​(.text+0xa3c):​ undefined reference to `devcb_resolve_read8'​
 +ay8910.c:​(.text+0xa4c):​ undefined reference to `devcb_resolve_read8'​
 +ay8910.c:​(.text+0xa5c):​ undefined reference to `devcb_resolve_write8'​
 +ay8910.c:​(.text+0xa6c):​ undefined reference to `devcb_resolve_write8'​
 +collect2: ld returned 1 exit status
 +make: *** [mame] Error 1
 +</​code>​
 +
 +Checked and the includes look good for devcb.h, added it explicitly anyway to ay8910.c, no change.
 +
 +Commented out the four lines, which will likely mean something very important is broken.
 +
 +Commened out unidasm.o from tools.mak, since that has tons of references to various CPUs.
 +
 +And finally a binary is born:
 +<​code>​
 +obj/​sdl/​mame/​tools/​unidasm.o:​(.rodata+0x75c):​ undefined reference to `cpu_disassemble_z180'​
 +obj/​sdl/​mame/​tools/​unidasm.o:​(.rodata+0x77c):​ undefined reference to `cpu_disassemble_z8'​
 +collect2: ld returned 1 exit status
 +make: *** [unidasm] Error 1
 +pi@pi ~/​src/​sdlmame0136 $ vi src/tools/
 +chdcd.c ​      ​chdman.c ​     ldresample.c ​ regrep.c ​     runtest.cmd ​  ​src2html.c ​   tools.mak ​    
 +chdcd.h ​      ​jedutil.c ​    ​ldverify.c ​   romcmp.c ​     split.c ​      ​srcclean.c ​   unidasm.c ​    
 +pi@pi ~/​src/​sdlmame0136 $ vi src/​tools/​tools.mak ​
 +pi@pi ~/​src/​sdlmame0136 $ make
 +Compiling src/​tools/​ldresample.c...
 +Linking ldresample...
 +Compiling src/​tools/​ldverify.c...
 +Linking ldverify...
 +Compiling src/​tools/​regrep.c...
 +Linking regrep...
 +Compiling src/​tools/​srcclean.c...
 +Linking srcclean...
 +Compiling src/​tools/​src2html.c...
 +Linking src2html...
 +Compiling src/​tools/​split.c...
 +src/​tools/​split.c:​ In function ‘split_file’:​
 +src/​tools/​split.c:​101:​9:​ warning: variable ‘totalparts’ set but not used [-Wunused-but-set-variable]
 +src/​tools/​split.c:​ In function ‘main’:
 +src/​tools/​split.c:​421:​6:​ warning: variable ‘result’ set but not used [-Wunused-but-set-variable]
 +Linking split...
 +pi@pi ~/​src/​sdlmame0136 $ ls
 +artwork ​ chdman ​   diff  ini      keymaps ​    ​ldverify ​ mame   ​obj ​    ​romcmp ​ runtest ​     split  src2html ​ testkeys
 +cfg      comments ​ docs  jedutil ​ ldresample ​ makefile ​ nvram  regrep ​ roms    SDLMAME.txt ​ src    srcclean ​ ui.bdf
 +pi@pi ~/​src/​sdlmame0136 $ ./​mame ​
 +Loading BDF font... (256 characters loaded)
 +Loading BDF font... (512 characters loaded)
 +Loading BDF font... (768 characters loaded)
 +Loading BDF font... (1024 characters loaded)
 +Loading BDF font... (1280 characters loaded)
 +Loading BDF font... (1536 characters loaded)
 +Generating cached BDF font...
 +Could not initialize SDL Unable to open a console terminal
 +
 +</​code>​
 +
 +Went looking to see if there might be a compiler issue with the undefined references, running "gcc version 4.6.3 (Debian 4.6.3-14+rpi1)",​ there'​s a 4.7 version available, installing it via ''​sudo apt-get install gcc-4.7''​.
 +
 +Re-instated the devcb_read lines in ay8910.c, make clean, make.
 +
 +No difference, and everything I try to do gets a "Bus error"​. ​ Boo.
 +
 +Gave up, looked around, realized I also had a version of xmame someone distributed that's new enough to support mspacmnf. ​ Compiled it over the course of two days, all set.
 +
 +Added user: mspacman
 +
 +Edited /​etc/​X11/​xinit/​xinitrc to be:
 +<​code>​
 +#. /​etc/​X11/​Xsession
 +/​mame/​xmame.SDL
 +</​code>​
 +
 +Edited /​etc/​inittab:​
 +<​code>​
 +#​1:​2345:​respawn:/​sbin/​getty --noclear 38400 tty1 
 +1:​2345:​respawn:/​bin/​login -f mspacman tty1 </​dev/​tty1 >/​dev/​tty1 2>&1
 +2:​2345:​respawn:/​bin/​login -f mspacman tty2 </​dev/​tty2 >/​dev/​tty2 2>&1
 +3:​2345:​respawn:/​bin/​login -f mspacman tty3 </​dev/​tty3 >/​dev/​tty3 2>&1
 +</​code>​
 +
 +Edited /​etc/​rc.local:​
 +<​code>​
 +su -l mspacman -c startx ​
 +initctl start tty TTY=/​dev/​tty2 &
 +initctl start tty TTY=/​dev/​tty3 &
 +</​code>​
 +
 +Spent last night trying to get sound working- for some reason it works running via VNC, but not running as mspacman. ​ This morning realized maybe it was permissions,​ ran the prog as user pi and sound exists. ​ Checked group memberships,​ matched them (things like "​audio"​ and "​video"​ were missing!), and finally- sound.
 +
 +Upped the clock to 800Mhz, set xinitrc to use volume -3.  Rebooted, boat work time.  ​
 +
 +
 +**TO-DO: get a proper shutdown routine working from GPIO pins or investigate ACPI.** ​
mspacman/pi.txt · Last modified: 2013/10/06 08:40 by ben