Author Topic: The original Doom is coming to the N64...  (Read 204587 times)

0 Members and 1 Guest are viewing this topic.

Offline jnmartin84

  • Sr. Member
  • ****
  • Posts: 443
  • Karma: +10/-1
    • View Profile
Re: The original Doom is coming to the N64...
« Reply #630 on: November 11, 2014, 04:18 AM »
I dont get it. Can someone plz explain how to do this step by step?

If you read the page I linked to, https://code.google.com/p/64doom/wiki/Building64DoomROM, you will notice that it is step-by-step directions.

It outlines what to do when you unpack the zip file: where to copy the WAD files, what to name the WAD files (if you get the filenames wrong, it might possibly finish building but it will crash when you try to play the ROM), how to run the tool script, how the tool will work (menu-driven, type a number to pick a game version, it is all explained on-screen when you run the tool script).
« Last Edit: November 11, 2014, 04:25 AM by jnmartin84 »

Offline jnmartin84

  • Sr. Member
  • ****
  • Posts: 443
  • Karma: +10/-1
    • View Profile
Re: The original Doom is coming to the N64...
« Reply #631 on: November 11, 2014, 04:37 AM »
There's a slight potential problem with the ROM creator toolkit. I downloaded it and gave it a shot to make sure the directions on the wiki page are adequate.

I then ran into a build failure.

IMPORTANT INFORMATION FOR 64DOOM ROM CREATOR TOOLKIT USERS:
If you already have Cygwin installed, before you try to run the script, you need to make sure that you remove all of the EXEs (EXCEPT FOR CHKSUM64.EXE AND N64TOOL.EXE) and DLLs from the 64DOOM_BUILDER directory that gets created when you unzip the toolkit zip file, or it will fail in a couple of different ways.
« Last Edit: November 11, 2014, 04:45 AM by jnmartin84 »

Offline jnmartin84

  • Sr. Member
  • ****
  • Posts: 443
  • Karma: +10/-1
    • View Profile
« Last Edit: November 11, 2014, 05:46 AM by jnmartin84 »

Offline BolinCaker

  • Full Member
  • ***
  • Posts: 136
  • Karma: +4/-0
    • View Profile
    • CakerBaby
Re: The original Doom is coming to the N64...
« Reply #633 on: November 11, 2014, 07:28 AM »
I dont get it. Can someone plz explain how to do this step by step?

If you read the page I linked to, https://code.google.com/p/64doom/wiki/Building64DoomROM, you will notice that it is step-by-step directions.

It outlines what to do when you unpack the zip file: where to copy the WAD files, what to name the WAD files (if you get the filenames wrong, it might possibly finish building but it will crash when you try to play the ROM), how to run the tool script, how the tool will work (menu-driven, type a number to pick a game version, it is all explained on-screen when you run the tool script).

That just says "In order to build a working 64DOOM Z64 file, you
will need at least one WAD file from the various
versions of Doom. Make sure the WAD file is named
as described in the following section, and located
under the "wadfiles" sub-directory under the directory
that you unpacked "64DOOM_BUILDER.ZIP"
into."

But I don't know how to get the WAD files.

Offline Chilly Willy

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 505
  • Karma: +32/-3
    • View Profile
Re: The original Doom is coming to the N64...
« Reply #634 on: November 11, 2014, 10:36 AM »
I read through the entire thread last night. I found an important detail to note for building Doom from source code. I changed the sound code in libdragon and the sound/music will not work correctly without making the change.

You can't use the old libdragon audio functions - they are designed to make the buffer the closest size as possible for the playback rate you selected to fill at a 25Hz (fixed) interval. Until you change the code to the "new" style I added, you could change the exist libdragon.

Code: [Select]
#define CALC_BUFFER(x)  ( ( ( ( x ) / 25 ) >> 3 ) << 3 )
See that 25 in there? That's the update rate. You want 35 for that. That code rounds to the closest multiple of 8.

Hmm - I think I'll alter the audio to use the "new" method. The new method means less copying the audio data around, which means more free time for other things. Not a lot more... audio isn't THAT big an overhead. :)

Offline Kerr Avon

  • Hero Member
  • *****
  • Posts: 1310
  • Karma: +107/-3
    • View Profile
Re: The original Doom is coming to the N64...
« Reply #635 on: November 11, 2014, 07:31 PM »
Are you jerking me? You get WAD files by buying the games.

He might just genuinely be new to the whole ported games thing, where you have to provide the game data to go with the freely available game engine. We all start off as total beginners who know nothing about a given subject, of course.

Offline Chilly Willy

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 505
  • Karma: +32/-3
    • View Profile
Re: The original Doom is coming to the N64...
« Reply #636 on: November 11, 2014, 10:13 PM »
Are you jerking me? You get WAD files by buying the games.

He might just genuinely be new to the whole ported games thing, where you have to provide the game data to go with the freely available game engine. We all start off as total beginners who know nothing about a given subject, of course.

Very true.

Let's say you have the Doom/Doom2/Final Doom CDROMs... you put the CD into your pc and look at them using a browser/file manager. On the CD somewhere will be those WAD files - it won't take long to find them as there is very little on the disc. If you got Doom off Steam, it will be in the steam app data directory somewhere. If you got the old original floppies, you'll need to run the Doom installer (on the PC under DOS) and then get the wad file from the directory the installer created.

Offline jnmartin84

  • Sr. Member
  • ****
  • Posts: 443
  • Karma: +10/-1
    • View Profile
Re: The original Doom is coming to the N64...
« Reply #637 on: November 11, 2014, 11:10 PM »
Are you jerking me? You get WAD files by buying the games.

He might just genuinely be new to the whole ported games thing, where you have to provide the game data to go with the freely available game engine. We all start off as total beginners who know nothing about a given subject, of course.

Sorry, this is certainly true. I thought maybe I was having a game played on me, my apologies.  :-[

Offline jnmartin84

  • Sr. Member
  • ****
  • Posts: 443
  • Karma: +10/-1
    • View Profile
Re: The original Doom is coming to the N64...
« Reply #638 on: November 11, 2014, 11:12 PM »
I read through the entire thread last night. I found an important detail to note for building Doom from source code. I changed the sound code in libdragon and the sound/music will not work correctly without making the change.

You can't use the old libdragon audio functions - they are designed to make the buffer the closest size as possible for the playback rate you selected to fill at a 25Hz (fixed) interval. Until you change the code to the "new" style I added, you could change the exist libdragon.

Code: [Select]
#define CALC_BUFFER(x)  ( ( ( ( x ) / 25 ) >> 3 ) << 3 )
See that 25 in there? That's the update rate. You want 35 for that. That code rounds to the closest multiple of 8.

Hmm - I think I'll alter the audio to use the "new" method. The new method means less copying the audio data around, which means more free time for other things. Not a lot more... audio isn't THAT big an overhead. :)

I wouldn't underestimate the effect of calling a C memcpy routine 35 times a second. It might not be a LOT of overhead but it might well lead to a more consistent frame-rate.

Offline Chilly Willy

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 505
  • Karma: +32/-3
    • View Profile
Re: The original Doom is coming to the N64...
« Reply #639 on: November 12, 2014, 09:44 AM »
Hmm - I think I'll alter the audio to use the "new" method. The new method means less copying the audio data around, which means more free time for other things. Not a lot more... audio isn't THAT big an overhead. :)

I wouldn't underestimate the effect of calling a C memcpy routine 35 times a second. It might not be a LOT of overhead but it might well lead to a more consistent frame-rate.

Which is why I want to convert it. Changing to interrupt-driven audio updates also tends to lower the latency between actions and sounds, which can make a game SEEM faster since it responds quicker.

Offline jnmartin84

  • Sr. Member
  • ****
  • Posts: 443
  • Karma: +10/-1
    • View Profile
Re: The original Doom is coming to the N64...
« Reply #640 on: November 13, 2014, 01:14 AM »
Hmm - I think I'll alter the audio to use the "new" method. The new method means less copying the audio data around, which means more free time for other things. Not a lot more... audio isn't THAT big an overhead. :)

I wouldn't underestimate the effect of calling a C memcpy routine 35 times a second. It might not be a LOT of overhead but it might well lead to a more consistent frame-rate.

Which is why I want to convert it. Changing to interrupt-driven audio updates also tends to lower the latency between actions and sounds, which can make a game SEEM faster since it responds quicker.

Which interrupt are we talking about? The sound handler is being called by an AI handler

Offline Chilly Willy

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 505
  • Karma: +32/-3
    • View Profile
Re: The original Doom is coming to the N64...
« Reply #641 on: November 13, 2014, 07:43 AM »
Which interrupt are we talking about? The sound handler is being called by an AI handler

I noticed. I was going through your audio code and noticed you override the default callback for the old style audio so that you call audio_write() from the int state rather than polling. So you were doing it half old style, and half new style.  :D

Anywho, I just updated my branch. I converted it completely to new style audio. No more copying buffers. I was wondering if I ought to try changing from floating point indexing to fixed point. Not too sure how fast the MIPS VR4300 FPU is. I also made a change I mentioned quite some time back. Your function to get the game ticks was using the kernel time and converting it to 35 Hz ticks. I update a variable in the audio callback (which is 35 Hz) and just return that when you get the game ticks.

You also had WAY too many voices defined. MUS is a simplified form of MIDI Type 0, which can only have a max of 24 voices, so I chopped the music voices in half (you had 48).

I took the audio code out of d_main.c - it's all in n64_i_sound.c now.

I also changed render() just slightly... you were always clearing the top 20 lines of the display. I changed it so the first two frames always clears the entire frame buffer, then no longer clears at all. So after frame 2, we save time in not clearing lines that are already clear. :)

I removed all the custom libdragon stuff, like the custom text drawing routines. I did have to make two changes to libdragon, one for Doom, and one for the latest gcc/newlib. The change for Doom was to make the font global instead of local. That should have been the case all along. The change for gcc/newlib has to do with exit() - that was added to libc/libnosys by a recent update, so the exit() function in libdragonsys needed to be disabled or you had two exit() functions. Here's my latest libdragon:

http://www.mediafire.com/download/2f0mkbob47z6mgi/libdragon-20141112.7z

Here's my makefile to build the N64 toolchain. It builds gcc 4.8.3, binutils 2.24, and newlib 2.1.0.

http://www.mediafire.com/download/sl3vyf4q38446lt/make-n64-gcc.zip

The 64DOOM_BUILDER.zip archive in my branch has my new doom.bin. I also changed the shell script and n64_rom_fs.c slightly. You had the WAD file 2 bytes offset from the obvious alignment for some odd reason (0x4FFFFE instead of 0x500000).

I added support for the mouse. If the mouse is plugged into any port, the game uses it, and changes left/right from turning to strafing. If you unplug the mouse, the controller goes back to left/right turning. If someone else has a mouse, please test it. On my N64, the mouse has trouble going forward and right (positive Y and X values). I don't know if it's Doom, or my mouse.

Offline Paulweeze

  • Video Game Connoisseur
  • Hero Member
  • *****
  • Posts: 1028
  • Karma: +41/-0
  • Music and Games are good for the soul.
    • View Profile
Re: The original Doom is coming to the N64...
« Reply #642 on: November 13, 2014, 07:50 AM »
I added support for the mouse. If the mouse is plugged into any port, the game uses it, and changes left/right from turning to strafing. If you unplug the mouse, the controller goes back to left/right turning. If someone else has a mouse, please test it. On my N64, the mouse has trouble going forward and right (positive Y and X values). I don't know if it's Doom, or my mouse.
I do have the mouse (just got the randnet starter kit with most of the games) but dont own the wads to compile doom yet. Would like to obtain them legally :).
Everdrives I own: ED64, Mega Everdrive, EDGB, EDGG, N8, Master Everdrive

Other Flashcarts: SD2SNES

Offline Chilly Willy

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 505
  • Karma: +32/-3
    • View Profile
Re: The original Doom is coming to the N64...
« Reply #643 on: November 13, 2014, 09:06 AM »
You can get the shareware wad off the internet legally. All the older binaries posted in this thread were all the shareware version. If you have trouble making a shareware binary, I can put mine on mediafire.

Offline Chilly Willy

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 505
  • Karma: +32/-3
    • View Profile
Re: The original Doom is coming to the N64...
« Reply #644 on: November 13, 2014, 09:59 AM »
Fixed the mouse problem. Now it's silky smooth! 8)

The issue was that there are four ways to read the controller data in libdragon to help the programmer... the controller code was using three of those ways... and the mouse needed the fourth. :/

Anyway, the branch is updated, and I made a shareware binary for those poor folks that don't have Doom, or can't get it working for some reason.

http://www.mediafire.com/download/slbwl72lzqp7hc6/64dsw-cw1.7z