Duke Nukem 3D for ODROID-GO (with sound)

Post Reply
User avatar
Gadget Workbench
Posts: 31
Joined: Wed Nov 21, 2018 4:03 pm
languages_spoken: english
ODROIDs: ODROID-GO
Location: Zurich, Switzerland
Contact:

Duke Nukem 3D for ODROID-GO (with sound)

Unread post by Gadget Workbench » Wed Nov 21, 2018 4:12 pm

Here is my first port of a game to ODROID-GO:


You can get the firmware file here:
https://github.com/jkirsons/Duke3D/tree/master/release

You'll need the Duke Nukem 3D Atomic Edition (v1.5) or lower files on the SD Card in a folder called "duke3d".
I haven't tried a later version that this - let me know if you get it working.

All the source code is here:
https://github.com/jkirsons/Duke3D
Last edited by Gadget Workbench on Mon Dec 17, 2018 4:19 pm, edited 1 time in total.

User avatar
mad_ady
Posts: 5227
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1
Location: Bucharest, Romania
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by mad_ady » Wed Nov 21, 2018 5:06 pm

Awesome work!

jutleys
Posts: 76
Joined: Fri Jul 20, 2018 1:06 am
languages_spoken: english
ODROIDs: Odroid Go
Odroid X4U N64 case
Location: UK
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by jutleys » Thu Nov 22, 2018 7:35 pm

HEADER MATCH ERROR

crashoverride
Posts: 4223
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by crashoverride » Thu Nov 22, 2018 7:37 pm

jutleys wrote:HEADER MATCH ERROR
This can happen if you have older device firmware. Try using the latest release from here:
viewtopic.php?f=158&t=31513

raystream
Posts: 4
Joined: Mon Oct 15, 2018 7:29 pm
languages_spoken: english
ODROIDs: go
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by raystream » Thu Nov 22, 2018 8:26 pm

really great work.
but i have a problem.
it starts and i can choose the level and difficulty but then it stops.

i only have the duke nukem demo files. could this be the error?

jutleys
Posts: 76
Joined: Fri Jul 20, 2018 1:06 am
languages_spoken: english
ODROIDs: Odroid Go
Odroid X4U N64 case
Location: UK
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by jutleys » Thu Nov 22, 2018 9:13 pm

Okay thanks i got it working now with the full version v1.5 needs some work to optimise it to speed it up but great work. I hope you can do a port of wolfeinstein3d for us all we would love it if you could do a port :)

User avatar
Gadget Workbench
Posts: 31
Joined: Wed Nov 21, 2018 4:03 pm
languages_spoken: english
ODROIDs: ODROID-GO
Location: Zurich, Switzerland
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by Gadget Workbench » Fri Nov 23, 2018 1:33 am

raystream wrote:really great work.
but i have a problem.
it starts and i can choose the level and difficulty but then it stops.

i only have the duke nukem demo files. could this be the error?
Ahh, my fault.
There was some code on startup that does a CRC check of the DUKE3D.GRP (43MB).
Which as you can imagine took quite some time - reading from a 1-wire SD card.

So I removed it. But now it can't tell that you're running the shareware version (which it determines from the CRC).
Maybe I'll just get it to check the file size of the .GRP file as a quick check.

For now, probably only v1.5 full version will work...

User avatar
lix-alpha
Posts: 76
Joined: Fri Jul 27, 2018 9:41 pm
languages_spoken: english
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by lix-alpha » Fri Nov 23, 2018 6:45 am

Seems that it need Firmware 20181114 to work...
Where is this firmware exactly?

crashoverride
Posts: 4223
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by crashoverride » Fri Nov 23, 2018 9:05 am

lix-alpha wrote:Seems that it need Firmware 20181114 to work...
At the time of this post, the current device firmware is 20181001. The version shown in the video is compiled by the author and not an official release.
https://github.com/OtherCrashOverride/o ... e/releases

User avatar
Gadget Workbench
Posts: 31
Joined: Wed Nov 21, 2018 4:03 pm
languages_spoken: english
ODROIDs: ODROID-GO
Location: Zurich, Switzerland
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by Gadget Workbench » Fri Nov 23, 2018 6:05 pm

I've added "Duke3D-20181001.fw" to the release folder:
https://github.com/jkirsons/Duke3D/tree/master/release
Please use this for the 20181001 firmware release.

It should work with the v1.3d shareware files now. You can get them here:
http://legacy.3drealms.com/duke3d/
Although the shareware version seems to be stuck in run mode?

Also I fixed an issue where the shoot button would get stuck.

Nemo1984
Posts: 71
Joined: Thu Aug 23, 2018 7:58 pm
languages_spoken: english, french
ODROIDs: Odroid-Go
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by Nemo1984 » Fri Nov 23, 2018 10:34 pm

I am on 20181001 firmware and have no issue with the original fw release.

Thanks!

User avatar
Gadget Workbench
Posts: 31
Joined: Wed Nov 21, 2018 4:03 pm
languages_spoken: english
ODROIDs: ODROID-GO
Location: Zurich, Switzerland
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by Gadget Workbench » Sat Nov 24, 2018 6:02 am

So I was wondering why OtherCrashOverride used HSPI for LCD and SD Card when the native pins were VSPI.
Which led me to discovering 80Mhz PSRAM!

I've updated the firmware to use this - the framerate is nearly doubled now.
Around 15fps on the first level.

Nemo1984
Posts: 71
Joined: Thu Aug 23, 2018 7:58 pm
languages_spoken: english, french
ODROIDs: Odroid-Go
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by Nemo1984 » Sat Nov 24, 2018 7:09 am

Functionally, what is the difference between the duke3d and 20181001 one? They work the same on my odroid.
Last edited by Nemo1984 on Sat Nov 24, 2018 8:14 am, edited 1 time in total.

User avatar
Gadget Workbench
Posts: 31
Joined: Wed Nov 21, 2018 4:03 pm
languages_spoken: english
ODROIDs: ODROID-GO
Location: Zurich, Switzerland
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by Gadget Workbench » Sat Nov 24, 2018 7:29 am

Nemo1984 wrote:Functionally, what is the difference between the duke3d and 20181001 one? They worm the same on my odroid.
Code wise - they're the same. 20181001 is converted from image to firmware with the mkfw from the 20181001 release. I'm not sure if this makes a difference.

Nemo1984
Posts: 71
Joined: Thu Aug 23, 2018 7:58 pm
languages_spoken: english, french
ODROIDs: Odroid-Go
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by Nemo1984 » Sat Nov 24, 2018 8:43 am

It works really great!

Can I make a suggestion regarding the controls? Maybe Start as Strafe and Select as Jump?

Thanks, this is great work!

JasonB32
Posts: 43
Joined: Sat Aug 04, 2018 11:33 pm
languages_spoken: english
ODROIDs: oDroid GO
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by JasonB32 » Sat Nov 24, 2018 2:12 pm

Awesome job!

Is there any way you could make a Commander Keen port? It's also from Apogee.

User avatar
lix-alpha
Posts: 76
Joined: Fri Jul 27, 2018 9:41 pm
languages_spoken: english
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by lix-alpha » Sat Nov 24, 2018 11:19 pm

Weird, even when using the 20181001 version I get HEADER MATCH ERROR.

crashoverride
Posts: 4223
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by crashoverride » Sun Nov 25, 2018 9:57 am

lix-alpha wrote:Weird, even when using the 20181001 version I get HEADER MATCH ERROR.
Turn the ODROID-GO off. Hold the "B" button. Turn the ODROID-GO on. Wait 10 seconds until a menu appears. What is the version number reported at the bottom of the screen?

User avatar
lix-alpha
Posts: 76
Joined: Fri Jul 27, 2018 9:41 pm
languages_spoken: english
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by lix-alpha » Sun Nov 25, 2018 10:43 am

crashoverride wrote:Turn the ODROID-GO off. Hold the "B" button. Turn the ODROID-GO on. Wait 10 seconds until a menu appears. What is the version number reported at the bottom of the screen?
Ver: 20181001-ba31df7503

crashoverride
Posts: 4223
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by crashoverride » Sun Nov 25, 2018 11:00 am

The version appears to be correct. Try deleting the Duke3D firmware file (.fw) from both the computer and ODROID-GO SD card. Then re-download it and re-copy it to the SD card.

[edit]
The above is to test whether the downloaded file is corrupt or old.

jutleys
Posts: 76
Joined: Fri Jul 20, 2018 1:06 am
languages_spoken: english
ODROIDs: Odroid Go
Odroid X4U N64 case
Location: UK
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by jutleys » Sun Nov 25, 2018 9:09 pm

crashoverride wrote:The version appears to be correct. Try deleting the Duke3D firmware file (.fw) from both the computer and ODROID-GO SD card. Then re-download it and re-copy it to the SD card.

[edit]
The above is to test whether the downloaded file is corrupt or old.
I had the same problem first and i did the above then it worked great.

User avatar
lix-alpha
Posts: 76
Joined: Fri Jul 27, 2018 9:41 pm
languages_spoken: english
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by lix-alpha » Sun Nov 25, 2018 11:23 pm

Thanks Crash it work great now! :)

User avatar
Gadget Workbench
Posts: 31
Joined: Wed Nov 21, 2018 4:03 pm
languages_spoken: english
ODROIDs: ODROID-GO
Location: Zurich, Switzerland
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by Gadget Workbench » Tue Dec 04, 2018 4:17 am

Nemo1984 wrote: Can I make a suggestion regarding the controls? Maybe Start as Strafe and Select as Jump?
The button mapping has been updated now - as you have suggested:
https://github.com/jkirsons/Duke3D/tree/master/release

Nemo1984
Posts: 71
Joined: Thu Aug 23, 2018 7:58 pm
languages_spoken: english, french
ODROIDs: Odroid-Go
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by Nemo1984 » Tue Dec 04, 2018 7:39 am

Gadget Workbench wrote:
Nemo1984 wrote: Can I make a suggestion regarding the controls? Maybe Start as Strafe and Select as Jump?
The button mapping has been updated now - as you have suggested:
https://github.com/jkirsons/Duke3D/tree/master/release
Thank you so much! Now I can get the rocket launcher and blast my way into the cinema!

Niknice
Posts: 5
Joined: Sun Sep 23, 2018 9:18 am
languages_spoken: english
ODROIDs: Odroid Go
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by Niknice » Tue Dec 04, 2018 6:53 pm

Great update, thanks. Would it be possible to change the controls so strafe is B and USE is Select. Similar to Dooms. Seems more natural when playing. Also is sound implemented? I've selected sound ON in the setting but the game still plays silently.

User avatar
Gadget Workbench
Posts: 31
Joined: Wed Nov 21, 2018 4:03 pm
languages_spoken: english
ODROIDs: ODROID-GO
Location: Zurich, Switzerland
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by Gadget Workbench » Fri Dec 07, 2018 9:01 pm

Alright, I've started on adding sound.
https://github.com/jkirsons/Duke3D/tree/master/release
Look for the "-snd" firmware files.

It has some looping problems when you shoot an enemy, but it's getting there...

I probably won't have too much time to do more until next year.

User avatar
Gadget Workbench
Posts: 31
Joined: Wed Nov 21, 2018 4:03 pm
languages_spoken: english
ODROIDs: ODROID-GO
Location: Zurich, Switzerland
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by Gadget Workbench » Mon Dec 17, 2018 4:18 pm

Sound is working now!

https://github.com/jkirsons/Duke3D/tree/master/release
(Look for the "-snd" firmware files)

Enjoy

Paspartout
Posts: 7
Joined: Fri Dec 28, 2018 2:13 am
languages_spoken: english
ODROIDs: Odroid go
Contact:

Re: Duke Nukem 3D for ODROID-GO

Unread post by Paspartout » Sun Dec 30, 2018 7:58 am

Nice work!

I like the SDL Port you've done for the odroid-go. It makes porting existing games much easier(I am currently trying to port nxengine for cave story, not sure if it'll work out yet). Thanks!
Maybe it would be worth polishing it a bit and setting up a separate repository for it?
I might want to extend it by SDL_BlitSurface() for nxengine. I saw in OpenTyrian you've done the blitting using custom functions like blit_sprite() and blit_sprite_blend() and I assume there were performance reasons for that(SDL_BlitSurface() e.g. does clipping).

I also wonder if it would be much harder to do a SDL2 Port since SDL2 seems a bit larger than SDL1.2. Not sure it would be worth it since the main addition of SDL2 is hardware acceleration support which the odroid doesn't have anyway.

User avatar
Gadget Workbench
Posts: 31
Joined: Wed Nov 21, 2018 4:03 pm
languages_spoken: english
ODROIDs: ODROID-GO
Location: Zurich, Switzerland
Contact:

Re: Duke Nukem 3D for ODROID-GO (with sound)

Unread post by Gadget Workbench » Sun Dec 30, 2018 2:41 pm

Thanks!
Maybe it would be worth polishing it a bit and setting up a separate repository for it?
Yes, definitely - I'll try to do this with my next project.
I saw in OpenTyrian you've done the blitting using custom functions like blit_sprite() and blit_sprite_blend()
The games I have been porting are early DOS games written before SDL was around. They originally used frame buffers and their own blitting functions.
I then take someone's port to SDL and use this as the base as my port to ESP32.
The ports to SDL have used SDL's functions to various degrees - some just using the SDL surface as a framebuffer.
In my "SDL" library, I've just implemented the functions required by these games. It's not a full port.
the main addition of SDL2 is hardware acceleration
Yeah - if the game expects hardware acceleration, it's probably not going to run very well.

User avatar
Gadget Workbench
Posts: 31
Joined: Wed Nov 21, 2018 4:03 pm
languages_spoken: english
ODROIDs: ODROID-GO
Location: Zurich, Switzerland
Contact:

Re: Duke Nukem 3D for ODROID-GO (with sound)

Unread post by Gadget Workbench » Thu Jan 03, 2019 1:51 am

Here's a video of development so far:


Paspartout
Posts: 7
Joined: Fri Dec 28, 2018 2:13 am
languages_spoken: english
ODROIDs: Odroid go
Contact:

Re: Duke Nukem 3D for ODROID-GO (with sound)

Unread post by Paspartout » Thu Jan 03, 2019 6:41 am

Nice!

I like how all these old games look so great for the constraints(memory and cpu) they run on.
Developers back then really squeezed everything out of the hardware.
How much memory(heap) does Duke3D need btw?

The port of nxengine(cavestory) I am working on is harder than I thought. First big issue seems that using a 16bit framebuffer with software blitting is quite resource intensive, so I had to switch to 8bits and palettes. (EDIT: Memory Leak was dumb error in my SDL Port.)
But still the game looks so nice on the odroids screen that I have to keep working: Image

What is your approach to profiling your ports? Seems like logging the current time, or using the timestamp from log messages is the best option. For memory there fortunately is a heap tracing api.

User avatar
Gadget Workbench
Posts: 31
Joined: Wed Nov 21, 2018 4:03 pm
languages_spoken: english
ODROIDs: ODROID-GO
Location: Zurich, Switzerland
Contact:

Re: Duke Nukem 3D for ODROID-GO (with sound)

Unread post by Gadget Workbench » Thu Jan 03, 2019 4:31 pm

Great work, looks like you've come a long way already!
Paspartout wrote:
Thu Jan 03, 2019 6:41 am
How much memory(heap) does Duke3D need btw?
At build time DRAM is 61k.
After this I'll probably have another 40k or so in DMA buffers. Everything else (heap) goes to PSRAM.

Code: Select all

Jason@Jason MINGW32 ~/esp/Duke3D
$ make size
Toolchain path: /opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
Toolchain version: crosstool-ng-1.22.0-80-g6c4433a5
Compiler version: 5.2.0
Python requirements from C:/msys32/home/Jason/esp/esp-idf/requirements.txt are satisfied.
Total sizes:
 DRAM .data size:   14092 bytes
 DRAM .bss  size:   47584 bytes
Used static DRAM:   61676 bytes ( 119060 available, 34.1% used)
Used static IRAM:  129364 bytes (   1708 available, 98.7% used)
      Flash code:  727819 bytes
    Flash rodata:  120516 bytes
Total image size:~ 991791 bytes (.bin may be padded larger)
I really don't have much in the way of profiling.
It would be nice if it had a Unity like profiler :)

I just put functions that need to be run a lot and fast into IRAM. You can fit quite a bit into IRAM before you run out.

zztfoxdev
Posts: 1
Joined: Sat Jan 19, 2019 8:36 am
languages_spoken: english
ODROIDs: Odroid Go
Contact:

Re: Duke Nukem 3D for ODROID-GO (with sound)

Unread post by zztfoxdev » Sat Jan 19, 2019 8:54 am

Paspartout wrote:
Thu Jan 03, 2019 6:41 am
Nice!

I like how all these old games look so great for the constraints(memory and cpu) they run on.
Developers back then really squeezed everything out of the hardware.
How much memory(heap) does Duke3D need btw?

The port of nxengine(cavestory) I am working on is harder than I thought. First big issue seems that using a 16bit framebuffer with software blitting is quite resource intensive, so I had to switch to 8bits and palettes. (EDIT: Memory Leak was dumb error in my SDL Port.)
But still the game looks so nice on the odroids screen that I have to keep working: Image

What is your approach to profiling your ports? Seems like logging the current time, or using the timestamp from log messages is the best option. For memory there fortunately is a heap tracing api.
What would the possibilties of getting other SDL games running if you can get Cave Story running?

Super Mario War says it uses SDL, and there was a port to Wii using an Wii version of SDL.

I know I am dreaming here, but image local multiplayer (like fMSX has done over wifi) with multiple ODROID GO's...

Anyway, here are the source codes I could find, wonder if they would be within ODROID GO constraints.

Developers GITHUB page:

https://github.com/bjorn/super-mario-war

Wii SDL port GITHUB page:

https://github.com/dborth/smw-wii

GldRush98
Posts: 17
Joined: Wed Aug 08, 2018 12:58 am
languages_spoken: English
ODROIDs: ODROID-Go
Contact:

Re: Duke Nukem 3D for ODROID-GO (with sound)

Unread post by GldRush98 » Tue Jan 29, 2019 1:32 pm

Duke Nukem runs surprisingly decently, I'm impressed. Nice work man :)
Is there a way to change weapons or no?

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 2 guests