CSB potential update

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

Forum rules
Please read the Forum rules and policies before posting.
User avatar
Sphenx
Lo Master
Posts: 401
Joined: 9-Sep-01 09:23
Contact:

Re: CSB potential update

Post by Sphenx » 23-Aug-17 04:52

Same for XP, strange for Win 7 : I get "CSBWin has stopped working" right from the start (Debugger's stack tells it fails on NTDLL)

User avatar
Ryan
beip Master
Posts: 6
Joined: 22-Jul-17 06:27

Re: CSB potential update

Post by Ryan » 23-Aug-17 07:32

I used Visual Studio 2017 with the Windows 10 SDK to build it. It definitely won't run in XP. There's no Direct2D in XP, plus need to set Visual Studio to the XP version of the platform tools.

d2d1_1.h is the Direct2D header. Direct2D is available in Windows 7 with the platform update (it was released four years ago).

What version of Visual Studio did you try to build it with?

User avatar
cowsmanaut
Moo Master
Posts: 4343
Joined: 29-Jun-00 22:53
Location: canada

Re: CSB potential update

Post by cowsmanaut » 24-Aug-17 08:33

Just in case anyone is confused.. I haven't been doing the code. Ryan has.. I was just posting for him, because it was more convenient for him at the time.

User avatar
Sphenx
Lo Master
Posts: 401
Joined: 9-Sep-01 09:23
Contact:

Re: CSB potential update

Post by Sphenx » 24-Aug-17 22:35

Hello Ryan and welcome.
I started with the basis version for CSBWin : MSVC++6. Then tried with VS 2008 and VS 2015 but can't open the solution/project.
Then ... I am now facing again the insanely ridiculous VS 2017 installer :( Took 99% CPU and 10 minutes to reckon I need 6+ GiB to get the C++ environment. I shall try that this week-end.

User avatar
Ryan
beip Master
Posts: 6
Joined: 22-Jul-17 06:27

Re: CSB potential update

Post by Ryan » 24-Aug-17 23:33

Haha, the welcome sounds funny as I've been here for ages. After the server move Cowsmo deleted my account while trying to fix it, so my post count was reset. I also don't post much and usually just indirectly post through Cowsmo :)

Yea, the VS 2017 install isn't trivial. The 2015 and 2013 ones were monsters also, but at least now you can complain to them on Reddit and they actually listen and answer back right away! You only need the 'Desktop development with C++' component and the Windows 10 SDK. Just be glad you don't need to install 'Universal Windows Platform development' as that'll install all of the C# and .Net stuff as they haven't separated out C++ yet (they say they will by the end of the year with C++\WinRT).

At least you can download it for free! The other nice part is that with VS 2017 you can use the latest C++ features.

User avatar
Sophia
Concise and Honest
Posts: 4002
Joined: 12-Sep-02 19:50
Location: Nowhere in particular
Contact:

Re: CSB potential update

Post by Sophia » 24-Aug-17 23:47

Welcome back Ryan. :mrgreen:

(At least, back to posting directly... or whatever!)

User avatar
Sphenx
Lo Master
Posts: 401
Joined: 9-Sep-01 09:23
Contact:

Re: CSB potential update

Post by Sphenx » 25-Aug-17 05:17

After the server move Cowsmo deleted my account while trying to fix it, so my post count was reset.
Just in case anyone is confused..
Yes I have been :D :lol:

Now, as Cowsmanaut mentioned the Surface 3 (Win RT ?), I don't actually know what is the minimal requirement IDE for compiling an exe for it ?
Is VS 2017 necessary for that ? Is there a way to make the project buildable under an older version of the IDE ?
I guess that we can also adapt for making the VC++6 project to compile without Direct2D thus still able to build the legacy Win version.

User avatar
Ryan
beip Master
Posts: 6
Joined: 22-Jul-17 06:27

Re: CSB potential update

Post by Ryan » 25-Aug-17 06:19

WinRT is the API for UWP (Universal Windows Platform) apps (like the ones that are in the Windows store, and run on XBox and Windows Phone). It's totally separate from regular win32 desktop apps. It wouldn't be too difficult to make CSBWin into a UWP app, but that wasn't something I planned on doing. There are no HWNDs in UWP, or GDI. Is that what you meant?

The Direct2D changes I made are easy to revert, but then you're stuck with the slow GDI functions. The old versions of CSBWin will stay XP compatible, I thought it'd be nice to make it run nicer on Windows 7+. XP is closer in time to the original Dungeon Master release than it is to today!

User avatar
Sphenx
Lo Master
Posts: 401
Joined: 9-Sep-01 09:23
Contact:

Re: CSB potential update

Post by Sphenx » 25-Aug-17 18:12

I understand you then built a Win 10 version that can also work on Surface 3, and on older Win 7, is that right ? -- except it doesn't work on Win 7 for me; this is one reason I want to build it myself to check.

Additions are nice and I am certainly not against, quite the contrary. I would rather take the opportunity you've put code on git to leverage the different possibilities we've seen in the past : integrate into one place the modern version, the legacy version, the linux one, maybe Rasmus 3D version ... and similarly do the same for skwin (dm2), why not ?

User avatar
Ryan
beip Master
Posts: 6
Joined: 22-Jul-17 06:27

Re: CSB potential update

Post by Ryan » 25-Aug-17 18:43

Did you install all of the platform updates on your Windows 7? (https://www.microsoft.com/en-us/downloa ... x?id=36805) I can't remember if it was an automatic update but you can always just do a search to see if 'd2d1.dll' is somewhere in your windows directory. That's my first guess as to why it won't run on yours.

I think GitHub is great for making branches of code, so you can always keep the Windows 9x compatible one as a separate branch and backport any changes that work on all systems.

Another issue is what compiler it'll compile on, VC 2017 supports C++14/C++17. I've locally put in some constexpr changes that won't compile on older compilers. I don't really have a need to submit those changes, but things can be simplified a lot with the newer C++ features.

User avatar
Sphenx
Lo Master
Posts: 401
Joined: 9-Sep-01 09:23
Contact:

Re: CSB potential update

Post by Sphenx » 26-Aug-17 13:48

I've found d2d1.dll on my Win 7 system.

At least I've made some progress.
I rebuilt the solution from VS 2017 running on Win 7 (64 bit), switching back Win SDK to 10.0.15063.0 (was 8.1 by default), specifically using C++17 as you told, and also setting back predefines _MSVC_INTEL and RGB555 (or RGB655) for the x64 build. I needed all these changes to compile and build properly.
I've built x86 and x64 versions, none of them work on my Win 7 system; only the x86 one works on my Win 10 system.
I don't know yet where is the problem.

User avatar
cowsmanaut
Moo Master
Posts: 4343
Joined: 29-Jun-00 22:53
Location: canada

Re: CSB potential update

Post by cowsmanaut » 26-Aug-17 18:40

I'm using win7 home premium which has been updated within the last several months (I'm a bit behind but certainly not more than a year)
DX11 is installed and the "d2d1.dll" file is located on my drive deep within the windows folder.
I have installed games and 3D apps which may have updated other things.. (maya, zbrush, steam games.. )

Not sure if that helps.. but that's my system and it runs his last build without issue. Perhaps Ryan has some other insights..

User avatar
Ryan
beip Master
Posts: 6
Joined: 22-Jul-17 06:27

Re: CSB potential update

Post by Ryan » 26-Aug-17 21:52

Oops, I didn't notice I left the 'Windows SDK Version' at 8.1. That must have been what it defaulted to. I have three versions of Visual Studio installed, so that might have been the cause of that.

It won't run on x64, since the DM code does int->pointer conversions. It will compile, but it'll crash in the DM code pretty fast. Looks like I didn't setup any of the preprocessor defines for it. We'd need to ask Paul if he has any thoughts on that, since he knows the assumptions made in the code.

To figure out why it doesn't run, did you look in the event logs? In the 'Windows Logs->Application' you should see an 'Application Error' with more details. It's the same info that older OS's used to show, but hidden now to be less scary I guess. Just saying in case you didn't know.

User avatar
Paul Stevens
CSBwin Guru
Posts: 4100
Joined: 8-Apr-01 16:00
Location: Madison, Wisconsin, USA

Re: CSB potential update

Post by Paul Stevens » 27-Aug-17 03:18

It won't run on x64
Just to be clear. I think it will run fine on
an X64 system so long as it is compiled
as a 32-bit program. But you cannot compile it as
an x64 application and expect it to run because
the code relies on pointers being 32 bits.

User avatar
Ryan
beip Master
Posts: 6
Joined: 22-Jul-17 06:27

Re: CSB potential update

Post by Ryan » 27-Aug-17 03:29

Yeah, I was replying to Sphenx having compiled it as x64 and it not working. I should have said an 'x64 compiled version won't work'.

Paul, do you think it's possible to change the pointer types from int32_t to a pointer type?

User avatar
Paul Stevens
CSBwin Guru
Posts: 4100
Joined: 8-Apr-01 16:00
Location: Madison, Wisconsin, USA

Re: CSB potential update

Post by Paul Stevens » 27-Aug-17 04:17

Ryan wrote:possible to change the pointer types
Yes. I think you are capable of it. Good luck and
let us know when you have it well tested.

What a tremendous amount of work for trivial
gain.

Wouldn't you be better off starting with DSB?
You are working with code written for a 8 MHz
68000 with 512K (K !) bytes of memory.

User avatar
Sphenx
Lo Master
Posts: 401
Joined: 9-Sep-01 09:23
Contact:

Re: CSB potential update

Post by Sphenx » 27-Aug-17 07:53

I can't find anything interesting in the logs.

Could you please have a try with that build ? and run it either on Win 7 and Win 10 ?
http://dmbuilder.sphenxmusics.fr/extern ... 26_spx.zip

It it works well for you, that would mean I have something different on my Win 7 system that prevents it to work.

Note:
The exe I've produced is 765 952 bytes against yours of 773 632 bytes.

User avatar
cowsmanaut
Moo Master
Posts: 4343
Joined: 29-Jun-00 22:53
Location: canada

Re: CSB potential update

Post by cowsmanaut » 27-Aug-17 08:08

Works on my win7 desktop just fine.

User avatar
Paul Stevens
CSBwin Guru
Posts: 4100
Joined: 8-Apr-01 16:00
Location: Madison, Wisconsin, USA

Re: CSB potential update

Post by Paul Stevens » 28-Aug-17 03:25

That executable works fine for me on Win 10 - 64bit.

User avatar
cowsmanaut
Moo Master
Posts: 4343
Joined: 29-Jun-00 22:53
Location: canada

Re: CSB potential update

Post by cowsmanaut » 29-Aug-17 20:20

Any luck getting it to run yet Sphenx?

User avatar
Sphenx
Lo Master
Posts: 401
Joined: 9-Sep-01 09:23
Contact:

Re: CSB potential update

Post by Sphenx » 30-Aug-17 05:33

I am still at the same point : I can't run it on Win 7, but it runs correctly on Win 10. Definitively something on my system, it might take me some time to find out what is the cause.
At least I'm statisfied I can build a working exe as Ryan did.

zeech
Novice
Posts: 21
Joined: 19-Mar-18 04:49

Re: CSB potential update

Post by zeech » 28-Mar-18 13:29

Hello, how is this project going? I was excited to see it, as I wanted something with window scaling and faster mouse updates! Thanks so much for doing this :D
Is this version the latest exe?

https://drive.google.com/file/d/0B0aV40 ... sp=sharing

Post Reply