VOGONS


PowerPC Dynamic Recompiler (patch)

Topic actions

Reply 20 of 137, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

I have to try again, there was something else going wrong after I had exchanged these with decimals...

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 21 of 137, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

ok, had another go.
First I found that my "illegal instruction" crash I experienced last time was due to adding the wrong decimal value to one of the binaries.
But I'm not much further now 🙁
When I switch to dynamic core it just freezes. Eventually I just have to force kill it.
A non-debug build gives this information via gdb:

#0  0x0021f024 in PIC_RunQueue ()
#1 0x0000eb98 in _ZL11Normal_Loopv ()
#2 0x000070dc in DOSBOX_RunMachine ()
#3 0x00015154 in CALLBACK_RunRealInt ()
#4 0x004a7b10 in DOS_Shell::Execute ()
#5 0x004a25f4 in DOS_Shell::DoCommand ()
#6 0x004a21f8 in DOS_Shell::CheckConfig ()
#7 0x004a2614 in DOS_Shell::DoCommand ()
#8 0x00494aa0 in DOS_Shell::ParseLine ()
#9 0x00495150 in DOS_Shell::Run ()
#10 0x00497220 in SHELL_Init ()
#11 0x0048457c in Config::StartUp ()
#12 0x00275724 in SDL_main ()
#13 0x004c6658 in -[SDLMain applicationDidFinishLaunching:] ()
#14 0x92bf5e1c in _nsnote_callback ()
#15 0x90805ec0 in __CFXNotificationPost ()
#16 0x907fdf20 in _CFXNotificationPostNotification ()
#17 0x92be0224 in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
#18 0x937a3be8 in -[NSApplication _postDidFinishNotification] ()
#19 0x937a3ad4 in -[NSApplication _sendFinishLaunchingNotification] ()
#20 0x937a361c in -[NSApplication(NSAppleEventHandling) _handleAEOpen:] ()
#21 0x937a31c4 in -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] ()
#22 0x92bf6e28 in -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] ()
#23 0x92bf6c88 in _NSAppleEventManagerGenericHandler ()
#24 0x91500960 in aeDispatchAppleEvent ()
#25 0x915007fc in dispatchEventAndSendReply ()
#26 0x91500654 in aeProcessAppleEvent ()
#27 0x932bf2e0 in AEProcessAppleEvent ()
#28 0x937a190c in _DPSNextEvent ()
#29 0x937a13f8 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()

I have no debug build at hand because I don't have curses built. Another task for another day.

jmarsh, anything else you want me to do? add some printouts?

Things I changed so far in the code to make it compile:
- binaries to decimal in risc_ppc.h
- commented "#define USE_SDA_BASE" in risc_ppc.h (as per your instructions)
- changed config.h after ./configure with #define C_DYNREC 1

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 22 of 137, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie

Good news from PowerMac G4 land; both the dynrec and drive sector-size patches are working well. The dynamic core lets DOSBox operate at roughly 4600 cycles before this machine's CPU maxes out and starts dropping audio chunks, where as the normal core only allows up to 2400 cycles.

Very nice work on this patch jmarsh!

This is on a PowerPC-7400 400Mhz machine running an up-to-date Ubuntu Linux. It was a pleasure to see DOS games running at fast 386 speeds, given this machine came out in 1999 when Microsoft still supported DOS 7.0! 🤣

Some notable system-configurations needed to get a usable and accelerated X display:

  • kernel boot arguments in /etc/yaboot.conf: video=aty128fb:800x600-15@60 offb=off (and optionally apparmor=off audit=off)
  • kernel module additions in /etc/modules: r128 and atyfb, which in turn pull in the northbridge (uninorth_agp) and direct rendering (drm) modules
  • The xorg stack needs to be switched to the more up-to-date hardware-enablement equivalents to detect the Rage128 AGP card (xserver-xorg-core-hwe-16.04, xserver-xorg-hwe-16.04, xserver-xorg-input-evdev-hwe-16.04, xserver-xorg-video-r128-hwe-16.04)

And the usual gang of linux details..
kernel (uname -a)

Linux pillow 4.4.0-164-powerpc-smp #192-Ubuntu SMP Fri Sep 13 12:02:52 UTC 2019 ppc ppc ppc GNU/Linux

cat /proc/cpuinfo

processor	: 0
cpu : 7400, altivec supported
temperature : 27-29 C (uncalibrated)
clock : 400.000000MHz
revision : 2.9 (pvr 000c 0209)
bogomips : 49.81
timebase : 24908750
platform : PowerMac
machine : PowerMac3,1
motherboard : PowerMac3,1 MacRISC Power Macintosh
detected as : 65 (PowerMac G4 AGP Graphics)
pmac flags : 00000004
L2 cache : 1024K unified
pmac-generation : NewWorld
Memory : 1280 MB

lspci

0000:10:0b.0 Host bridge: Apple Inc. UniNorth PCI
0000:10:0d.0 PCI bridge: Digital Equipment Corporation DECchip 21154 (rev 05)
0000:11:07.0 Unassigned class [ff00]: Apple Inc. KeyLargo Mac I/O (rev 02)
0000:11:08.0 USB controller: Apple Inc. KeyLargo USB
0000:11:09.0 USB controller: Apple Inc. KeyLargo USB
0000:11:0a.0 FireWire (IEEE 1394): Texas Instruments TSB12LV23 IEEE-1394 Controller
0001:21:0b.0 Host bridge: Apple Inc. UniNorth Internal PCI
0001:21:0f.0 Ethernet controller: Apple Inc. UniNorth GMAC (Sun GEM) (rev 01)
5f08:00:0b.0 Host bridge: Apple Inc. UniNorth AGP
5f08:00:10.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Rage 4 [Rage 128 PRO AGP 4X TMDS]

cat /proc/asound/cards

 0 [Screamer       ]: PMac Screamer - PowerMac Screamer
PowerMac Screamer Rev 0

(44,100 Hz native sampling rate with 1024 blocks)

lsb_release -drc

Description:	Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial

xorg.conf settings needed to get an accelerated XV overlay with a reasonable VGA window-size (1440x1040)

Section "Module"
Load "dri"
Disable "dri2"
Load "extmod"
Load "freetype"
Disable "glx"
Disable "dbe"
Load "i2c"
Load "bitmap"
Load "ddc"
Disable "int10"
Load "type1"
Load "vbe"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
HorizSync 28-70
VertRefresh 43-60
EndSection

Section "Device"
Option "DMAForXv" "True"
Option "VGAAccess" "True"
Option "RenderAccel" "True"
Option "AGPMode" "4"
Option "Accel" "True"
Option "EnablePageFlip""True"
Option "UseFBDev" "False"
Identifier "Card0"
Driver "r128"
EndSection

Section "DRI"
Mode 0066
EndSection

Section "ServerFlags"
Option "AIGLX" "False"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 16
SubSection "Display"
Depth 16
EndSubSection
EndSection

gcc -v

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/powerpc-linux-gnu/5/lto-wrapper
Target: powerpc-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.11' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-powerpc/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-powerpc --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-powerpc --with-arch-directory=ppc --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-secureplt --disable-softfloat --with-cpu=default32 --disable-softfloat --enable-targets=powerpc-linux,powerpc64-linux --enable-multiarch --disable-werror --with-long-double-128 --enable-multilib --enable-checking=release --build=powerpc-linux-gnu --host=powerpc-linux-gnu --target=powerpc-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11)

CFLAGS, CXXFLAGS:

-mcpu=7400 -Ofast -ffast-math -maltivec -mabi=altivec -fstrict-aliasing -mpowerpc-gfxopt -fomit-frame-pointer -pipe

Reply 24 of 137, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie
jmarsh wrote:

Were you able to build with "#define USE_SDA_BASE" left uncommented (active) in risc_ppc.h?

Yes, the only change I made was defining C_DYNREC 1 in config.h after ./configuring.
Left everything else as-is. Here's a copy and from risk_ppc.h:

// disable if your toolchain doesn't provide a _SDA_BASE_ symbol (r13 constant value)
#define USE_SDA_BASE

Reply 29 of 137, by dr.zeissler

User metadata
Rank l33t
Rank
l33t

I need this patch for 10.3.9 PPC G4, but have no experiences on how to compile dosbox binary, but I have installed the development-tools.
Is there a simple howto for a newbee ?

Thx
Doc

Retro-Gamer 😀 ...on different machines

Reply 31 of 137, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

https://www.dropbox.com/s/kvhujmw1crygmow/dos … vn.app.zip?dl=0 <- that's my build. Run it with output opengl. Remember to use the correct preference file. It might fail on a 10.3 system though. Some stuff needs 10.4 I think. Never tried below 10.4

Ich würde lieber nicht mit einem fremden Gerät rumhantieren und gerade bin ich ehrlich gesagt zu kaputt um eine Anleitung hervor zu zaubern. Aber 10.3 kann echt eine Hürde sein. Now back to English, please 😀

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 33 of 137, by dr.zeissler

User metadata
Rank l33t
Rank
l33t

No problem for me, take that machine as a gift. A have several ones 😉
All I need is your adress and I will sent a ready to go package.
I don't think that I can do that by myself.

First I will test your app on my setup.

Retro-Gamer 😀 ...on different machines

Reply 35 of 137, by ClassicHasClass

User metadata
Rank Newbie
Rank
Newbie
Dominus wrote:

https://www.dropbox.com/s/kvhujmw1crygmow/dos … vn.app.zip?dl=0 <- that's my build. Run it with output opengl. Remember to use the correct preference file. It might fail on a 10.3 system though. Some stuff needs 10.4 I think. Never tried below 10.4

Is this build still available? This link 404s.

Failing that, I can reconstruct it on my G5, but I'm not sure which revision it was done against (though I guess the patch should still work against tip?).

Reply 37 of 137, by ClassicHasClass

User metadata
Rank Newbie
Rank
Newbie

Okay, I've reconstructed it against trunk. Nice work! I built it with gcc 4.0.1, the default with Xcode 2.5. It didn't like one of the inline asm blocks and using sys_icache_invalidate() in the commpage is probably better anyway (less likely to have side effects), so I tweaked risc_ppc.h with some __APPLE__ ifdefs. Otherwise it "just worked" without changes. Death Rally is now playable on the G5 without having to run the cores in Maximum Space Heater mode.

I think I'll see about porting this to ppc64le next. Much of it should work, though the ABI is a bit different.

Attachments

  • Filename
    risc_ppc.h
    File size
    28.87 KiB
    Downloads
    98 downloads
    File comment
    modified for 10.4 Xcode 2.5
    File license
    Fair use/fair dealing exception