gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS Misc > HexenDS v0.1 released

#50493 - MrAdults - Wed Aug 10, 2005 6:08 am

I've got sound working, touchscreen support, a bunch of other stuff. Source code is also included:

http://www.telefragged.com/thefatal/index.php?content=inc_si_ds.htm

Here are the more important bits from the readme:
Quote:
What you need:
-The wad from the full version of Hexen (shareware not supported natively by code
released by Raven, may be integrated in later versions).
-A flashcart big enough to hold the binary with wad (well over 128mbit).
-gbfs by Damian Yerrick for appending the wad to the HexenDS binary. You can obtain
it here: http://www.pineight.com/gba/
-A way of getting your DS to boot off of said flash cart, which also allows the arm9
code to access the cart's rom. I personally use wmb and a F2A 256mbit cart.

How to use:
-Place your full version Hexen wad in the bin directory where makewadgbfs.bat is,
along with the ds and ds.gba files. Also make sure you have gbfs, lsgbfs, padbin,
and cat somewhere on your path.
-After fulfilling the above requirements run makewadgbfs.bat, if all goes well you
will end up with hexends_wad.nds and hexends_wad.nds.gba files.
-Flash the .gba file to your flash cart, use the method of your choice to get your
DS to run arm9 code off of the cart. This method must support access of the flash
cart's rom section or HexenDS will not run.

What is broken:
-Saves. Hexen save data is huge and needs work to be cut down. For the time being,
a warp menu has been added under the "ds" section of the main menu for playing
around.
-Memory. Occasionally the zone may get too fragmented and the game may run out of
memory. This is indicated by the game freezing in place in a while loop. I have
added more cache swapping for asset types and have not seen this occuring lately,
but it's still possible.
-Speed. It's generally playable but does not run at full speed. More routines are
already being converted to ARM assembly and optimized so this will continue to
improve.

The two most expensive rendering functions (column/span drawing) have been ARM-ified and are significantly faster than the C versions (but I'm sure there's still room for improvement, I don't claim to be an arm master). May be useful in Heretic since I don't think they changed much if anything in there, though I haven't looked at the Heretic code so I don't know for sure.

-Rich

#50494 - Dwedit - Wed Aug 10, 2005 6:16 am

Any chance of making this work with the movie player? Then saves could be as large as the disk could hold them.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#50498 - MrAdults - Wed Aug 10, 2005 6:24 am

Quote:
Any chance of making this work with the movie player? Then saves could be as large as the disk could hold them.

Sadly, I do not have a movie player. But the code is included, so if someone made it work with that and got saves working that would be pretty awesome.

-Rich

#50502 - czc - Wed Aug 10, 2005 6:48 am

Works perfectly with flashme, it's fast and sound works great.

#50512 - Mithos - Wed Aug 10, 2005 8:47 am

Impressive... Most Impressive.

Runs very well on FlashME + EZF Advance 256Mbit gba-cart.

#50516 - kickinz1 - Wed Aug 10, 2005 9:31 am

If you don't have cat on your system, you can try:

makewadgbfs.bat:

gbfs hexenwad.gbfs hexen.wad
lsgbfs hexenwad.gbfs
padbin 256 hexends.nds
copy /B hexends.nds + hexenwad.gbfs hexends_wad.nds
padbin 256 hexends.nds.gba
copy /B hexends.nds.gba + hexenwad.gbfs hexends_wad.nds.gba

#50518 - kickinz1 - Wed Aug 10, 2005 9:36 am

Just wanted to say that I agree with Mithos:

Very impressive port!

#50520 - revo - Wed Aug 10, 2005 10:31 am

omfg, it's amazing ;) Tried on EFA512 + FlashMe

You can change jumping to the same as Metroid Prime: Hunters (double touch instead of L)
_________________
[ sorry for all mistakes, but my english isn't as good as I wish it to be ]

#50521 - El Hobito - Wed Aug 10, 2005 11:44 am

darn it why cant the m3 be out now! any chance of someone making a video of it working?

#50524 - emumaniac - Wed Aug 10, 2005 12:25 pm

awesome release Mr Adults, ive mirrored the file and release here --> http://nintendo-ds.dcemu.co.uk/hexends.shtml


Great release for the DS scene ;)

#50527 - inthearmsofsleep - Wed Aug 10, 2005 12:33 pm

it can't work with the shareware wad...but i can't find the retail wad anywhere........: (
no hexen for inthearmsofsleep.

#50530 - BlazerRazor - Wed Aug 10, 2005 1:22 pm

if you look at the readme, I quote:

Quote:
The wad from the full version of Hexen (shareware not supported natively by code
released by Raven, may be integrated in later versions).

#50532 - inthearmsofsleep - Wed Aug 10, 2005 1:26 pm

BlazerRazor wrote:
if you look at the readme, I quote:

Quote:
The wad from the full version of Hexen (shareware not supported natively by code
released by Raven, may be integrated in later versions).

NM, looks like i won't have to wait. Got the WAD.

#50535 - Lynx - Wed Aug 10, 2005 2:34 pm

Wow.. Let me guess? You have the wad now, because you went to the store and bought the game?

#50538 - Elrinth - Wed Aug 10, 2005 3:25 pm

I wonder if there's anyway to emulate the serial port link via the ds?
would be smashing awesome :D

tried it now!! and WOW, it ROX!!! Keep up the good work.
To everyone who's trying to play it, I recommend bending the ds screen back so you get perfect lighting... Else, it's like playing Castlevania: COTM all over again. ;)


Last edited by Elrinth on Wed Aug 10, 2005 6:35 pm; edited 1 time in total

#50541 - amiga - Wed Aug 10, 2005 4:09 pm

The game doesn?t work on my ds, but heretic worked properly.
I think my problem is that the file is bigger than 16MB and it doesn?t work on my xg2 512.
It is the same with the darkain multiloader and snesds.
I think the problem is the gbfs.
It would be great if someone could fix it.

#50542 - jmva16 - Wed Aug 10, 2005 4:21 pm

Great job. I have not had a chance to look at it yet, but what a great thing for DS homebrewing and this community! Such exciting things happening around here!

#50545 - hoagie - Wed Aug 10, 2005 5:09 pm

as soon as i tried to load the game into my flash software. Not sure if its your game or the fact that i just upgraded to the newest version fo teh ez flash client

#50548 - look - Wed Aug 10, 2005 6:17 pm

Really nice work

I couldnt get heretic working via my SC but this works like a charm.

Could do with a few more gamma settings normal is too dark but the next one up is too bright.

my DS battery is flat now :(

#50568 - look - Wed Aug 10, 2005 8:15 pm

Just had a lockup on my DS + SC level 2 I killed all the nasties and threw the 1st switch.

The whole thing froze.

Do you have anywhere for bug reports?

#50570 - The 9th Sage - Wed Aug 10, 2005 8:20 pm

This looks like good stuff...I have fond memories of playing Hexen on the N64. Now I just gotta wait for my PC copy of Hexen to arrive so I can try this baby out.
_________________
Now with 20% More Old Man from Zelda 1 than ever before!

#50573 - MrAdults - Wed Aug 10, 2005 8:36 pm

Quote:
Do you have anywhere for bug reports?

You can just put them here and I'll see them, or you can post on my web site's forum if that's more appropriate. That lockup is probably the memory allocation error I mentioned in the readme, I'll put it in console mode and print out an error message in the next version when it happens so it's more obvious what's going wrong.

-Rich

#50584 - jmva16 - Wed Aug 10, 2005 9:33 pm

In Heretic, I stripped out most of the Z_Malloc stuff. When it does a W_CacheLump, I just return the location of the lump on the gba cart so I do not have to copy and use it out of internal mem. I only use Z_Malloc for stuff that gets created or manipulated in memory. Maybe you could do the same. It is not a lengthy change. (Probably still have to cache sound lumps however, because of the signed/unsigned issue)

#50587 - MrAdults - Wed Aug 10, 2005 10:30 pm

Quote:
In Heretic, I stripped out most of the Z_Malloc stuff. When it does a W_CacheLump, I just return the location of the lump on the gba cart so I do not have to copy and use it out of internal mem.

Don't you incur a significant penalty in access speed because of this? Isn't cart rom approximately 2/3 the speed of ewram?

-Rich

#50607 - inthearmsofsleep - Thu Aug 11, 2005 1:47 am

Lynx wrote:
Wow.. Let me guess? You have the wad now, because you went to the store and bought the game?

um....bingo.
oh, btw....thanks revo for showing me where to buy the game.

#50609 - jmva16 - Thu Aug 11, 2005 1:59 am

This is true, I was told the cart runs at 4.2 MHz random, 8.4 MHz sequential, assuming 3/1 wait state settings. But, then there are no memory problems. Every wad thing is cached all the time. Like all things, it is a trade off. If the memory space is availabe, this would be the way to go.

#50610 - MrAdults - Thu Aug 11, 2005 2:20 am

Quote:
This is true, I was told the cart runs at 4.2 MHz random, 8.4 MHz sequential, assuming 3/1 wait state settings. But, then there are no memory problems. Every wad thing is cached all the time. Like all things, it is a trade off. If the memory space is availabe, this would be the way to go.


Hexen (assuming Heretic too) has a pretty robust system of swapping out certain types of lumps based on the tag on the zone allocation, which was intended for this very situation, so I do recommend making it work. It's just a matter of making sure lump types are able to handle being removed at any given time using the "user" pointer system. The biggest savings I've gotten so far was when I added some code to change zone tags on sound lumps after they finish playing. A bit of a pain with the back and forth with the arm7, but it was well worth the hassle. I also still have some rather large static allocations on the zone which may not be helping with fragmentation and can probably be eliminated.

It is worth noting that I still haven't been able to reproduce any memory allocation errors myself (since after I released v0.1), so if that is the cause of the crash in question in HexenDS it's hovering right around the limit. There's still plenty of savings to be done on the zone in my codebase, so that's probably the best solution here. I imagine you have even less assets and such in memory in Heretic than Hexen at most times, so the zone approach may work well for you as well. Did you decide to get rid of it because you were running out of memory, or was it just a decision from the get-go?

-Rich

#50621 - jmva16 - Thu Aug 11, 2005 4:20 am

I do not really believe I had run into a memory problem, and I agree that the structure for swapping into and out pertinent data is done well in these games. The reason I threw it out (early on) was because I was having some odd operations with it. Sometimes, when I would allocate a new block with Z_malloc, it would bungle up the pointers in the linklist. It would set the next pointer to something like 0x63454708 instead of 0x08634567 (notice the rotation of bits). This is just an example off the top of my head, not actual number I read out. Anyway, it would mess up the whole idea and lock up. This is my first GBA/DS project and I just chalked it up to not understanding the memory architecture, so I drastically simplified it and went on. But it was really weird.

#50624 - tepples - Thu Aug 11, 2005 6:12 am

jmva16 wrote:
Sometimes, when I would allocate a new block with Z_malloc, it would bungle up the pointers in the linklist. It would set the next pointer to something like 0x63454708 instead of 0x08634567 (notice the rotation of bits).

If you're getting bytewise rotation on an ARM CPU, then it's likely that you're getting unaligned buffers.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#50627 - MrAdults - Thu Aug 11, 2005 6:55 am

Yeah, try 4-byte-aligning your zone allocations with something along the lines of

Code:
size = (size+3)&~3;

-Rich

#50637 - Saotome22 - Thu Aug 11, 2005 8:31 am

hello, um
a noob here...
I tried following the instructions in the readme
I got a hexenwad.gbfs, have I got it wrong or am I supposed to do something with it?
I've never used GbFS before, so any help is good...

#50668 - MrAdults - Thu Aug 11, 2005 4:41 pm

Quote:
I got a hexenwad.gbfs, have I got it wrong or am I supposed to do something with it?

My friend pointed out the other night that I forgot to strip off the wad/ in the batch file when I was pasting it together. The contents of makewadgbfs.bat should actually be
Code:
gbfs hexenwad.gbfs hexen.wad
lsgbfs hexenwad.gbfs
padbin 256 hexends.nds
cat hexends.nds hexenwad.gbfs >hexends_wad.nds
padbin 256 hexends.nds.gba
cat hexends.nds.gba hexenwad.gbfs >hexends_wad.nds.gba

So that's probably why you aren't ending up with hexends_wad.* as the readme says you should.

-Rich

#50672 - Saotome22 - Thu Aug 11, 2005 5:12 pm

got it working now
thanks

great release by the way :)

#50720 - jmva16 - Fri Aug 12, 2005 3:04 am

Quote:
Yeah, try 4-byte-aligning your zone allocations with something along the lines of

I did try something similar tp this. Here is the code I tried (from Z_Malloc):
Code:
do{   // there will be a free fragment after the allocated block
  newblock = (memblock_t *) ((byte *)base + size + offset);
  newblock->size = extra - offset;
  newblock->user = NULL;      // free block
  newblock->tag = 0;
  newblock->prev = base;
  newblock->next = base->next;
  newblock->next->prev = newblock;
  base->next = newblock;
  base->size = size + offset;
  offset++;
}while((newblock->prev != base || newblock->next != base->next) && offset < 16);

The problem was showing up when newblock->prev was != to base or newblock->next was != to base->next. So, I would just start moving the new block and increasing the size of the previous block up to 16 times. If this dropped out and offset was >=16, I would catch the error and freeze. This worked better, but sometime it still dropped through in error.

#50721 - MrAdults - Fri Aug 12, 2005 3:27 am

Your initial symptom is the same thing I ran into, as I recall. I figured it was a buffer alignment issue and padded the allocation size to be aligned, after that it worked fine.

-Rich

#50722 - jojjy - Fri Aug 12, 2005 5:28 am

I don't understand why gbfs lsgbfs padbin and cat couldn't be included in the zip. As it is, this is unplayable. I already have gbfs from the multiloader but not sure about the others.

#50723 - MrAdults - Fri Aug 12, 2005 7:23 am

Quote:
I don't understand why gbfs lsgbfs padbin and cat couldn't be included in the zip. As it is, this is unplayable. I already have gbfs from the multiloader but not sure about the others.

padbin is included in the gbfs archive. If you have a seperate distribution that does not include it, you should be getting it from tepples's site as mentioned in the readme.txt. As for cat, you might try Google, or you can just use copy as kickinz1 has already mentioned.
Quote:
gbfs hexenwad.gbfs hexen.wad
lsgbfs hexenwad.gbfs
padbin 256 hexends.nds
copy /B hexends.nds + hexenwad.gbfs hexends_wad.nds
padbin 256 hexends.nds.gba
copy /B hexends.nds.gba + hexenwad.gbfs hexends_wad.nds.gba

-Rich

#50724 - jojjy - Fri Aug 12, 2005 8:11 am

Thanks. Sorry if I sounded rude, but it does seem incomplete not to have it in the zip to me, since it's required. If people already have the programs, they could just not extract them from the zip, but for the rest of us its easier.

#50733 - SolidSnake - Fri Aug 12, 2005 2:15 pm

does it support saving?

#50737 - Mithos - Fri Aug 12, 2005 2:57 pm

SolidSnake wrote:
does it support saving?


Copied from readme.txt (people should always read that file in all released software packages) of hexends_01.zip

What is broken:
-Saves. Hexen save data is huge and needs work to be cut down. For the time being, a warp menu has been added under the "ds" section of the main menu for playing around.

#50742 - Dirge - Fri Aug 12, 2005 3:29 pm

Freaking awesome Rich! Great job! Nothing like some good old nostalgia to bring you back.

Game worked flawlessly but to append the wad into the .gba I had to edit the batch file to use the bin path and not bin/wad (not sure if the readme was explicit about where the wad should go other than in the bin dir). Speed was pretty good except in just a few places. Overall a great solid port!

#50743 - SolidSnake - Fri Aug 12, 2005 3:45 pm

Mithos wrote:
SolidSnake wrote:
does it support saving?


Copied from readme.txt (people should always read that file in all released software packages) of hexends_01.zip

What is broken:
-Saves. Hexen save data is huge and needs work to be cut down. For the time being, a warp menu has been added under the "ds" section of the main menu for playing around.


i didnt download the port yet, that?s why asked :P
i really like to read readmes, before posting, but of course, when you have the readme :D

#50744 - Mithos - Fri Aug 12, 2005 4:02 pm

SolidSnake wrote:
i didnt download the port yet, that?s why asked :P
i really like to read readmes, before posting, but of course, when you have the readme :D


Yeah could be a problem knowing that if you dont have the readme... ;P

#50780 - tepples - Fri Aug 12, 2005 11:33 pm

MrAdults wrote:
padbin is included in the gbfs archive. If you have a seperate distribution that does not include it, you should be getting it from tepples's site as mentioned in the readme.txt. As for cat, you might try Google, or you can just use copy as kickinz1 has already mentioned.

That's why I include 'catbin' in the GBFS distribution. Different versions of 'make' that I've encountered (old mingw32-make, new mingw32-make, MSYS make, Cygwin make) have different restrictions on running 'copy' and other command.com/cmd.exe internal commands, and 'cat' isn't guaranteed to be available.

jojjy wrote:
it does seem incomplete not to have it in the zip to me, since it's required.

Some of the GBFS programs are included with recent devkitARM. Or think of an analogy to apps for GNU/Linux, which usually depend on other installed libraries.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#51458 - nintyjim - Fri Aug 19, 2005 9:18 pm

Hi,
Could you please get Hexen DS working with the shareware WAD before version 0.2.

Thankyou.

#51798 - kripes - Tue Aug 23, 2005 4:31 pm

How can I invert the Y axis? I can't play like this...

#51827 - MrAdults - Tue Aug 23, 2005 8:16 pm

Quote:
How can I invert the Y axis? I can't play like this...

There is no option. If/when the next version is released it will have one (I'm currently spending my home coding time on fun with Q3).

-Rich

#51927 - nintyjim - Wed Aug 24, 2005 7:37 pm

Please make a second version with inverted look and support of the shareware WAD. 0.1 was too good a start to be forgoten.

#51960 - deltro - Thu Aug 25, 2005 2:30 am

nintyjim wrote:
Please make a second version with inverted look and support of the shareware WAD. 0.1 was too good a start to be forgoten.
There are bigger problems then that that need fixing, chill, and let the proggy take it's course.. we don't need another Hyper DS.