amd64 multiplayer now works. Here is a diff for the git version as of
July 19, 2019 from this commit
(https://github.com/diasurgical/devilutionX/commit/72f65d577124d24ab9f459ef164e31c9ab225b3e).
I added __LP64__ for amd64 specific bits, allowing it to compile on both
amd64 and i386. Bryan suggested, "You could probably do #ifdef __i386__
or __amd64__ or more generally, #ifdef __LP64__ I suspect there may be a
way to fix it so the code works on both 32-bit and 64-bit platforms,
however."
To test I connected to a game hosted by Bryan, and we played the first
several rooms in the first dungeon. Also, I was able to build and play
from i386 and amd64 in the same game.
Brian Callahan writes:
> We'll sync with releases starting with the next release (presumable
> 0.5).
I have communicated my findings with upstream
(https://github.com/diasurgical/devilutionX/issues/191). Multiplayer
testing is a priority for the next release.
This diff is pasted for consideration in ports, in case multiplayer is
desired before the next release. Tests and feedback are welcome. Thank
you to all involved in this port.
Bryan Steele writes:
> On Fri, Jul 19, 2019 at 10:37:59AM -0400, Bryan Steele wrote:
>> On Thu, Jul 18, 2019 at 07:49:51PM -0400, Brian Callahan wrote:
>> > Hi ports --
>> >
>> > Attached is a new port, games/devilutionx. DevilutionX is an open source
>> > engine recreation for the original Diablo I game.
>> >
>> > ---
>> > pkg/DESCR:
>> > DevilutionX is an open source recreation of the game engine used in
>> > Diablo I, an action role-playing game by Blizzard Entertainment.
>> >
>> > While this package and the game engine are open source, one still needs
>> > to provide the original game assets from Diablo I, which is not open
>> > source. You will need to purchase the original game to use this package.
>> > ---
>> >
>> > This port is a multi-person effort between myself, thfr@, and brynet@. The
>> > game works very well on amd64--the underlying engine is claimed to be nearly
>> > 100% binary identical to the original game. Sadly, multiplayer doesn't work
>> > on 64-bit platforms, but this is known and hopefully will be fixed at some
>> > point.
>> >
>> > OK?
>> >
>> > ~Brian
>>
>> I'm obviously ok with this going in, w/ the pkg/README fix from Nam. :-)
>>
>> It's unfortunate that we will initially miss out on multiplayer support,
>> but good that someone is working on the problem, and upstream is aware.
>>
>> Hopefully some of these changes can be sent upstream.
>>
>> -Bryan.
>
> To those of you following along, this is the port that thfr@ used when
> streaming Diablo last month on OpenBSD.
>
> https://www.youtube.com/watch?v=5sBKaqkFev8
Index: Makefile
===================================================================
RCS file: /cvs/ports/games/devilutionx/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -u -p -r1.1.1.1 Makefile
--- Makefile 19 Jul 2019 13:42:33 -0000 1.1.1.1
+++ Makefile 24 Jul 2019 01:53:09 -0000
@@ -1,12 +1,12 @@
# $OpenBSD: Makefile,v 1.1.1.1 2019/07/19 13:42:33 bcallah Exp $
COMMENT = open source engine recreation for Diablo 1 game
-DISTNAME = devilutionx-0.4.0pl20190715
+DISTNAME = devilutionx-0.4.0pl20190723
CATEGORIES = games x11
GH_ACCOUNT = diasurgical
GH_PROJECT = devilutionX
-GH_COMMIT = 10ebca4efd422bbf46bad6d12ea4cdade9038b01
+GH_COMMIT = 72f65d577124d24ab9f459ef164e31c9ab225b3e
MAINTAINER = Brian Callahan <bcallah@openbsd.org>
Index: distinfo
===================================================================
RCS file: /cvs/ports/games/devilutionx/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -u -p -r1.1.1.1 distinfo
--- distinfo 19 Jul 2019 13:42:33 -0000 1.1.1.1
+++ distinfo 24 Jul 2019 01:53:09 -0000
@@ -1,2 +1,2 @@
-SHA256 (devilutionx-0.4.0pl20190715-10ebca4e.tar.gz) = 6WOyN6WpRoYuKpe1P24YgQ8OaYEtShyt8p1R8JrZT4U=
-SIZE (devilutionx-0.4.0pl20190715-10ebca4e.tar.gz) = 1350054
+SHA256 (devilutionx-0.4.0pl20190723-72f65d57.tar.gz) = 13YESHQhAY4y15I8OKjjoyf6pxMEJSCeot84/Qs3Cxg=
+SIZE (devilutionx-0.4.0pl20190723-72f65d57.tar.gz) = 1354368
Index: patches/patch-CMakeLists_txt
===================================================================
RCS file: /cvs/ports/games/devilutionx/patches/patch-CMakeLists_txt,v
retrieving revision 1.1.1.1
diff -u -p -u -p -r1.1.1.1 patch-CMakeLists_txt
--- patches/patch-CMakeLists_txt 19 Jul 2019 13:42:33 -0000 1.1.1.1
+++ patches/patch-CMakeLists_txt 24 Jul 2019 01:53:09 -0000
@@ -14,7 +14,7 @@ Index: CMakeLists.txt
set(ASAN OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DO_LARGEFILE=0 -Dstat64=stat -Dlstat64=lstat -Dlseek64=lseek -Doff64_t=off_t -Dfstat64=fstat -Dftruncate64=ftruncate")
endif()
-@@ -289,7 +289,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+@@ -290,7 +290,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Silence warnings about __int64 alignment hack not always being applicable
target_compile_options(devilutionx PRIVATE -Wno-ignored-attributes)
# Fix: error: cast from pointer to smaller type 'unsigned char' loses information
Index: patches/patch-SourceX_dvlnet_frame_queue_cpp
===================================================================
RCS file: patches/patch-SourceX_dvlnet_frame_queue_cpp
diff -N patches/patch-SourceX_dvlnet_frame_queue_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-SourceX_dvlnet_frame_queue_cpp 24 Jul 2019 01:53:09 -0000
@@ -0,0 +1,24 @@
+$OpenBSD$
+
+nextsize is 8 bytes. framesize_t is 4 bytes. Copy framesize_t to
+nextsize then shift 32 bits to zero out the most significant 32
+bits. This fixes packet_ready().
+
+Remove this patch when building for i386 (32-bit).
+
+Index: SourceX/dvlnet/frame_queue.cpp
+--- SourceX/dvlnet/frame_queue.cpp.orig
++++ SourceX/dvlnet/frame_queue.cpp
+@@ -48,7 +48,12 @@ bool frame_queue::packet_ready()
+ if(size() < sizeof(framesize_t))
+ return false;
+ auto szbuf = read(sizeof(framesize_t));
++ #ifdef __LP64__
++ std::memcpy(&nextsize, &szbuf[0], sizeof(framesize_t));
++ nextsize >> 32;
++ #else
+ std::memcpy(&nextsize, &szbuf[0], sizeof(nextsize));
++
No comments:
Post a Comment