Homebrew Homebrew game [HELP] Convert DsHeretic from slot2 (.ds.gba) to slot1 (.nds)

Nikokaro

Lost philosopher... searching for a way out...
OP
Member
Joined
Feb 3, 2020
Messages
2,181
Trophies
1
Location
Nautilus (under) Lake Como, Italy 🇮🇹
XP
6,734
Country
Italy
Turning off the high detail level is a cpu optimization not a memory optimization
Hi:)
You were right to specify that.
I tried to improvise an explanation, which turned out to be inadequate.:sad:

I seem to have sensed some annoyance in your comment, but I hope I am wrong, as I have always behaved in a courteous, welcoming and appreciative manner.:unsure:

However, I can only bow to your technical knowledge.
Then maybe, time permitting, you could take a look and fix Dual Hexen as well and make our @Indy13 happy.:D
 
  • Like
Reactions: Tarmfot and Indy13

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,030
Country
United States
Hi:)
You were right to specify that.
I tried to improvise an explanation, which turned out to be inadequate.:sad:

I seem to have sensed some annoyance in your comment, but I hope I am wrong, as I have always behaved in a courteous, welcoming and appreciative manner.:unsure:

However, I can only bow to your technical knowledge.
Then maybe, time permitting, you could take a look and fix Dual Hexen as well and make our @Indy13 happy.:D
I was going for informative - not annoyed. Sorry if it came across that way.
The memory issue with dual hexen is likely cause by memory fragmentation. Assets are loaded in the cache as needed and things are dropped from the cache when they are not needed to make room for new things. As you can imagine things are loaded in a random order and removed in a random order. This can cause lots of small spaces to be cleared from the cache. When everything that can be removed from the cache has been removed but there is no sequential space big enough to fit the new asset then you get zmalloc errors. Hexen has an 8mb minimum memory requirement for the pc so this is not super surprising.
 

Indy13

Well-Known Member
Member
Joined
Jan 26, 2017
Messages
596
Trophies
0
Age
45
XP
1,262
Country
France
Hi.
How are you?
Hi, I'm fine thanks :) I hope you're well too ;)

and make our @Indy13 happy.
:lol:
Fortunately, I found a substitute solution with HHexen and DS2Linux ;)

Hexen has an 8mb minimum memory requirement for the pc so this is not super surprising.
Indeed, I am not surprised too, not to mention the technical aspect because I am unfortunately not sufficiently knowledgeable in this area, Hexen is part of the next generation of fps, a bit like Duke Nukem these are games that technically and chronologically seem to be between Doom 2 / Heretic and Quake, it's not surprising that the small DS has trouble running these games without help, the ideal would have been a version of dual Hexen allowing to use a ram expansion pak like ez flash 3in1.

It's sad that this expansion device isn't used more than that in general (after not being a developer, I maybe idealize the thing a little too much and finally I imagine that it must be anyway quite complicated because it must be a whole code that must be rethought and rewrite to include this kind of device and option) but I am convinced that ports like Dual Hexen, Duke3DS or even emulators like RaceDSFixed or FrodoDS would obtain clear improvements with the use of a ram expansion pak.
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,030
Country
United States
Hi, I'm fine thanks :) I hope you're well too ;)


:lol:
Fortunately, I found a substitute solution with HHexen and DS2Linux ;)


Indeed, I am not surprised too, not to mention the technical aspect because I am unfortunately not sufficiently knowledgeable in this area, Hexen is part of the next generation of fps, a bit like Duke Nukem these are games that technically and chronologically seem to be between Doom 2 / Heretic and Quake, it's not surprising that the small DS has trouble running these games without help, the ideal would have been a version of dual Hexen allowing to use a ram expansion pak like ez flash 3in1.

It's sad that this expansion device isn't used more than that in general (after not being a developer, I maybe idealize the thing a little too much and finally I imagine that it must be anyway quite complicated because it must be a whole code that must be rethought and rewrite to include this kind of device and option) but I am convinced that ports like Dual Hexen, Duke3DS or even emulators like RaceDSFixed or FrodoDS would obtain clear improvements with the use of a ram expansion pak.
The ram expansion devices are a pain to use. They do not support 8bit writes. So any time the compiler generates an 8bit write then you are looking at corrupt data at best but more likely a crash. This means you can’t use things like memset, memcpy, strcpy - and sometimes the compiler will generate these calls for you. So you have search generated asm for byte instructions and change the code to prevent it. Plus the ram expansion uses the cart bus and so does the file access through the sd card - only one can be used at a time. And the ram is super slow and not many people have the devices either.
Ds2linux - that must play like a slideshow…
 
  • Like
Reactions: Tarmfot and Indy13

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
23,243
Trophies
4
Location
Space
XP
13,793
Country
Norway
I believe .ds.gba can be renamed to .nds as they are simply .nds files with GBA header data added at the beginning to an area normally unused in NDS games. The data otherwise is the same. Worth noting for the future if you (or other people who find this thread) run into other .ds.gba homebrew. Someone feel free to correct me if I'm wrong but that is what I seem to remember. Old homebrew like the one mentioned which relies on libfat to load external files from SD won't work though as you already know. Everything else should.
 

Nikokaro

Lost philosopher... searching for a way out...
OP
Member
Joined
Feb 3, 2020
Messages
2,181
Trophies
1
Location
Nautilus (under) Lake Como, Italy 🇮🇹
XP
6,734
Country
Italy
I believe .ds.gba can be renamed to .nds as they are simply .nds files with GBA header data added at the beginning to an area normally unused in NDS games
Hello and welcome.:)

Maybe you just read the title and nothing else, but this thread is no longer about DSHeretic, but about @elhobbs old project cHeretic for slot1 cart, which he kindly resumed developing and brought almost to perfection.
I may later decide to have the title of this thread changed, because it is actually misleading. But out of habit and fondness I think I won't.:)

Changing the file extension was the first, and most obvious thing I had tried, but it didn't work in any way; I don't know if it could depend on the model of my r4.

It even didn't work if I started it from my slot2 SD SuperCard and left it in the original ds.gba format.
In any case, thanks to the intervention of our benefactor @elhobbs I have now lost any interest in DSHeretic.:P
 
Last edited by Nikokaro,
  • Like
Reactions: Tarmfot

Indy13

Well-Known Member
Member
Joined
Jan 26, 2017
Messages
596
Trophies
0
Age
45
XP
1,262
Country
France
The ram expansion devices are a pain to use. They do not support 8bit writes. So any time the compiler generates an 8bit write then you are looking at corrupt data at best but more likely a crash. This means you can’t use things like memset, memcpy, strcpy - and sometimes the compiler will generate these calls for you. So you have search generated asm for byte instructions and change the code to prevent it. Plus the ram expansion uses the cart bus and so does the file access through the sd card - only one can be used at a time. And the ram is super slow and not many people have the devices either.
I never imagined that coding a homebrew using a RAM device would be so complicated, indeed, reading you, I understand a little better why this device is not used as much.

Ds2linux - that must play like a slideshow…

In fact the name "DS2Linux" is misleading because it is quite simply an emulator of Dingoo which exploits the processor of the supercard DSTwo but in fact HHexen is just an open source Hexen engine for Dingoo which has no direct relation with the system Linux operating system.

We can find the source code here if you're interested ;)

https://dl.openhandhelds.org/cgi-bin/dingoo.cgi?0,0,0,0,30,509
 

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
23,243
Trophies
4
Location
Space
XP
13,793
Country
Norway
Hello and welcome.:)

Maybe you just read the title and nothing else, but this thread is no longer about DSHeretic, but about @elhobbs old project cHeretic for slot1 cart, which he kindly resumed developing and brought almost to perfection.
I may later decide to have the title of this thread changed, because it is actually misleading. But out of habit and fondness I think I won't.:)

Changing the file extension was the first, and most obvious thing I had tried, but it didn't work in any way; I don't know if it could depend on the model of my r4.

It even didn't work if I started it from my slot2 SD SuperCard and left it in the original ds.gba format.
In any case, thanks to the intervention of our benefactor @elhobbs I have now lost any interest in DSHeretic.:P
I'm simply mentioning it in case someone with a similar question comes along and sees this thread, or in case you run into any other .ds.gba homebrew you want to use.
 

Nikokaro

Lost philosopher... searching for a way out...
OP
Member
Joined
Feb 3, 2020
Messages
2,181
Trophies
1
Location
Nautilus (under) Lake Como, Italy 🇮🇹
XP
6,734
Country
Italy
I'm simply mentioning it in case someone with a similar question comes along and sees this thread
Sure, I understood that. But as I just wrote, renaming .ds.gba to .nds doesn't work, at least in this case, or maybe in any case:
this is what has written a few years ago a user of Gbatemp (@DanTheManMS) ,who knows this topic more than me:
"Anything using GBFS, or PAFS (used in PAlib), will require being run on a slot-2 device in DS mode. You need something like a slot-2 Supercard (not Supercard Rumble series), or M3 Perfect (mayyyybe M3 Pro, not sure on that one), a slot-2 G6, or a regular old NOR-based flash cart run in DS mode via a NoPass device or a FlashMe'd DS".
In light of this, simply changing the name to the file and having it start from slot1 cart, even to a beginner like me, seems like a naive, simplistic and unscientific solution, in any case.:unsure:
 
Last edited by Nikokaro,

Nikokaro

Lost philosopher... searching for a way out...
OP
Member
Joined
Feb 3, 2020
Messages
2,181
Trophies
1
Location
Nautilus (under) Lake Como, Italy 🇮🇹
XP
6,734
Country
Italy
Main episodes final report

I finally finished testing the last level (e5m8) without any problems: I had to use the "godmode" despite myself, because 3 Maulotaurs at the same time, even at the easiest skill level, are impossible to deal with.

Instead, strange enough, in the previous level e5m7, unlike the others of the same episode, from the beginning to the end ninety percent of the enemy sprites are covered by the already mentioned white rectangles, and the screen is perpetually haunted by the infamous black horizontal lines.
Only our author will be able to explain and certainly solve this mystery.

Now I can enjoy, body and soul, the H!ZONE episodes, although I can not, for now and with this version, appreciate their custom bgms: but I am anxiously awaiting (I know I have already said this several times) that this inconvenience, perhaps with the next update, will be resolved.:)
 
  • Like
Reactions: Tarmfot and Indy13

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
23,243
Trophies
4
Location
Space
XP
13,793
Country
Norway
Sure, I understood that. But as I just wrote, renaming .ds.gba to .nds doesn't work, at least in this case, or maybe in any case:
this is what has written a few years ago a user of Gbatemp (@DanTheManMS) ,who knows this topic more than me:
"Anything using GBFS, or PAFS (used in PAlib), will require being run on a slot-2 device in DS mode. You need something like a slot-2 Supercard (not Supercard Rumble series), or M3 Perfect (mayyyybe M3 Pro, not sure on that one), a slot-2 G6, or a regular old NOR-based flash cart run in DS mode via a NoPass device or a FlashMe'd DS".
In light of this, simply changing the name to the file and having it start from slot1 cart, even to a beginner like me, seems like a naive, simplistic and unscientific solution, in any case.:unsure:
It's more general advice not specific to this homebrew, and I did also mention the reason why it doesn't work and why some other things might not work as well, it's just that users tend to post for help in any thread even remotely related to their question, so I'm just trying to preempt them :P

I think GBFS/PAFS are different from libfat, I did not even consider those. The data is actually embedded into the ROM with those, meaning it's read only, and the code is hardcoded to read the GBA slot. libfat on the other hand uses the SD card, it's not specifically hardcoded for the GBA slot but support never extended past a few different GBA carts (not even all of the big ones, I think it was just M3, Supercard and maybe the G6) as it stopped being updated.
 

Nikokaro

Lost philosopher... searching for a way out...
OP
Member
Joined
Feb 3, 2020
Messages
2,181
Trophies
1
Location
Nautilus (under) Lake Como, Italy 🇮🇹
XP
6,734
Country
Italy
At a first, quick test, the music seems to work just fine in the original episodes.
But, I must admit, lately I've been concentrating mainly on user episodes and megawads.:)

As for the 6 megawads contained in the Ultimate/Final/New compilation (combining old SP maps to make up 5 whole episodes):
https://www.moddb.com/games/heretic/addons/ultimate-hereticnew-heretic
here the bgms seem to work without problems, being these the original ones.

Instead, with the 9 H!zone episodes, which contain custom music (in .mus format, so theoretically supported by cheretic) the game crashes immediately, during the data loading, often with the "guru meditation" error.
I think the cause is the insufficient ram memory, since these episodes also contain custom textures and enemies.
In this case I recommend using the previous (no-music) cHeretic, which has always worked without a hitch.:wink:

If anyone would like to communicate their experiences with this cheretic version, they would be welcome...:)
 
  • Like
Reactions: Tarmfot and Indy13

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,030
Country
United States
At a first, quick test, the music seems to work just fine in the original episodes.
But, I must admit, lately I've been concentrating mainly on user episodes and megawads.:)

As for the 6 megawads contained in the Ultimate/Final/New compilation (combining old SP maps to make up 5 whole episodes):
https://www.moddb.com/games/heretic/addons/ultimate-hereticnew-heretic
here the bgms seem to work without problems, being these the original ones.

Instead, with the 9 H!zone episodes, which contain custom music (in .mus format, so theoretically supported by cheretic) the game crashes immediately, during the data loading, often with the "guru meditation" error.
I think the cause is the insufficient ram memory, since these episodes also contain custom textures and enemies.
In this case I recommend using the previous (no-music) cHeretic, which has always worked without a hitch.:wink:

If anyone would like to communicate their experiences with this cheretic version, they would be welcome...:)
I tried the following wads without issue. I used nds-hb-menu with argv files to launch. I was able to start episode 3 with all of them. I must admit I did not play long in each.

Can you confirm that you used the version in the opl7 branch and not the version in the master branch? I did need to rename the files and remove the spaces in the file names to get the argv files to work correctly, but I was not able to cause a crash. Can you let me know the steps you took where you had an issue?

Caves&Castles.WAD
Desperations.WAD
Destiny Children.WAD
Dreamworlds.WAD
Dwarven Mines.WAD
From here to Hell.WAD
Outworld Assault.WAD
Road to Aragon.WAD
Worlds of Sin.WAD
 
  • Like
Reactions: Indy13

Nikokaro

Lost philosopher... searching for a way out...
OP
Member
Joined
Feb 3, 2020
Messages
2,181
Trophies
1
Location
Nautilus (under) Lake Como, Italy 🇮🇹
XP
6,734
Country
Italy
Can you confirm that you used the version in the opl7 branch and not the version in the master branch?
Hi.:)
I've tried only 3 H!zone episodes, which didn't work, with the usual procedure already described ( most recent HBMenu + "-file episode.wad" line within an .argv file). I already tried all of them with the previous no-music version of cHeretic and they worked perfectly.

If you tell me that they work for you, it means that I downloaded the wrong version. I'm very happy if the error is mine. I'll take the blame.

Actually I don't remember which one I downloaded. I saw only one .nds file among other files.
What is the right version?
Not to be mistaken, could you maybe attach below the right version of cheretic to use, so I'll try it again?
 
Last edited by Nikokaro,
  • Like
Reactions: Indy13

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,030
Country
United States
Hi.:)
I've tried only 3 H!zone episodes, which didn't work, with the usual procedure already described ( most recent HBMenu + "-file episode.wad" line within an .argv file). I already tried all of them with the previous no-music version of cHeretic and they worked perfectly.

If you tell me that they work for you, it means that I downloaded the wrong version. I'm very happy if the error is mine. I'll take the blame.

Actually I don't remember which one I downloaded. I saw only one .nds file among other files.
What is the right version?
Not to be mistaken, could you maybe attach below the right version of cheretic to use, so I'll try it again?
the nds file in the opl7 branch - https://github.com/elhobbs/cheretic/tree/opl7

I need actual specifics. which wad did you try? where did you put the wad files and the content of the argv file.

edit: I upload a new nds file. I did a full rebuild. The last file may have been dldi patched for mpcf to work with desmume. I was having problem launching on a 3ds with the old build. There are no code changes, but it works now on my 3ds.
 
Last edited by elhobbs,
  • Like
Reactions: Indy13

Nikokaro

Lost philosopher... searching for a way out...
OP
Member
Joined
Feb 3, 2020
Messages
2,181
Trophies
1
Location
Nautilus (under) Lake Como, Italy 🇮🇹
XP
6,734
Country
Italy
Yes, the one that is there.

which wad did you try?
CavesCastles.wad, HeretoHell.wad, DreamWorlds.wad.

where did you put the wad files and the content of the argv file.
I put cHeretic.nds and Heretic.wad in the microSD root, and the custom episodes in the Heretic folder. MicroSD inserted in the r4 Gold Pro, inserted in the DS Lite pink...
I repeat that previously I have always used custom wads and I know very well how to use them.

I was having problem launching on a 3ds with the old build. There are no code changes, but it works now on my 3ds
So you were using an emulator to test the file, Desmume? And now you've tested it on 3DS, I assume from SD slot, and not via flashcart.

I upload a new nds file. I did a full rebuild
I will try it out as soon as possible, then report back to you with the result.
 
  • Like
Reactions: Indy13

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,030
Country
United States
Yes, the one that is there.


CavesCastles.wad, HeretoHell.wad, DreamWorlds.wad.


I put cHeretic.nds and Heretic.wad in the microSD root, and the custom episodes in the Heretic folder. MicroSD inserted in the r4 Gold Pro, inserted in the DS Lite pink...
I repeat that previously I have always used custom wads and I know very well how to use them.


So you were using an emulator to test the file, Desmume? And now you've tested it on 3DS, I assume from SD slot, and not via flashcart.


I will try it out as soon as possible, then report back to you with the result.
it was not a matter of you doing something wrong. I wanted to do the same exact steps.

I did just upload a new version to the opl7 branch that may have fewer occurrences of the annoying sound issues. It is not completely gone, but it does seem to be reduced to me ...
 
  • Like
Reactions: Indy13

Nikokaro

Lost philosopher... searching for a way out...
OP
Member
Joined
Feb 3, 2020
Messages
2,181
Trophies
1
Location
Nautilus (under) Lake Como, Italy 🇮🇹
XP
6,734
Country
Italy
I did just upload a new version to the opl7 branch that may have fewer occurrences of the annoying sound issues. It is not completely gone, but it does seem to be reduced to me ...
As soon as I can, after dinner, I'll try all 9 episodes with the new build, and I'll report back much more accurately on the results.
And sorry if I sometimes misunderstand what you're asking: it's what they call a language barrier and it's hard for me to explain myself well.

I was expecting you to upload the single cHeretic.nds below, not the link, since with Android Chrome on smartphone I have difficulties on Github.
Anyway I will try the file with the description: "move sound cache cleanup to end of frame". I hope it's the right one.:P
 
Last edited by Nikokaro,
  • Like
Reactions: Indy13

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Sonic Angel Knight @ Sonic Angel Knight: :ninja: