Hacking Working ScummVM DS build for 3DS!

uomoartificiale

Member
OP
Newcomer
Joined
Jan 22, 2012
Messages
13
Trophies
0
XP
78
Country
Italy
update: I added a build of 1.2.1 and 1.4.1 with MAD support (MP3 and talkie support) plus instructions about libmad
update: now I have a DSTwo. I added a package with the DSTwo plugins in the download section.

First post here. ;)

Here's two builds of scummVM DS especially compiled for 3DS users who can't get the touchscreen to work on their devices.
These builds are merely "hacks" of the original source code and the changes I introduced are not particularly elegant. It's just a quick hack to get scummVM DS work on 3ds devices (should work fine on standard DS too). I suppose that the bug responsible for the broken touchscreen on the 3ds is still there deeply in the libnds library.

Downloads:
Download scummVM DS 1.2.1 (all the engines - MAD support) (reccomended)
Download scummVM DS 1.4.1 (all the engines - MAD support)

DSTWO Plugins:

scummvmk.png
ScummVMDS Plugins


older versions:
Download scummVM DS 1.2.1 (all the engines no MAD support)
Download scummVM DS 1.4.1 (all the engines no MAD support)

I compiled both the last stable sources 1.4.1 and the 1.2.1 version which is the binary version most commonly used by end-users (so you should download this if you want to keep your existing compatibility).
I didn't have a compiled version of libmad so I commented out USE_MAD = 1 as suggested, but if someone is willing to provide a compiled ARM version of the library (or provide a win32 devkitpro makefile for it) I'm more than happy to rebuild everything with MAD support.

Boring stuff (and possibly gibberish...)
Here's a quick explanation of what I changed and where I think the problem lied. Also, I'm not a professional programmer, so take my words with a grain of salt.

The touchscreen code of scummvm is not broken on the 3ds, or at least not completely. The problem is in dsmain.cpp where most of the stuff happens. The main issue is that IPC->touchZ1 always returns 0. I suppose IPC->touchZ1 reads the Z axis (so to speak) of the stylus, that is it reads pressure and perpendicular touch (correct me if I'm wrong).
The good news is that IPC->touchXpx and IPC->touchYpx still read the stylus coordinates just fine so all I did was to comment out occurrences of IPC->touchZ1 and in one instance replace it with a conjunct read of IPC->touchXpx and IPC->touchYpx both > 0 instead.
I never used scummvm on a standard DS so I don't know if the touchscreen feels actually any different here. I suppose it doesn't, but let me know if that's the case.
btw to really solve the issue, it could be necessary to track down the problem in the libnds library itself.

Here are the source files I changed:
http://www.mediafire...3ds_schanges.7z

Instructions on building libmad for nds-arm are here: http://gbatemp.net/t...ost__p__4100204

What is ScummVM DS?
------------------------------------------------------------------------
ScummVM DS is a part of the ScummVM project. The ScummVM project is an
attempt to re-engineer many classic point and click adventure games of the
80s and 90s to run on modern computer hardware. Technology has changed a
lot since these games were written, and so ScummVM attempts to replicate the
gameplay of the original games in exacting details, without any of the original
code that the game ran on. ScummVM needs a copy of the original game, in order
to take the graphics, sound, and scripts that made the game work.
ScummVM is written in such a way that it can be 'ported' from one type of
machine to another, and ScummVM DS is a port of ScummVM to the Nintendo DS
handheld games console.

Features
------------------------------------------------------------------------
* Runs nearly all of Lucasarts' SCUMM games up to and including Sam
& Max Hit the Road
* Runs many non-Lucasarts point-and-click adventures too
* Supports sound
* Provides a GUI to change settings and choose games
* Supports using the DS touch screen for controls
* Suports saving games to compatible flash cards
* All games run at pretty much full speed
Which games are compatible with ScummVM DS?
------------------------------------------------------------------------
I'm glad you asked. Here is a list of the compatible games in version
1.2.1. Demo versions of the games listed should work too.
Flight of the Amazon Queen, Beneath a Steel Sky, and Lure of the
Temptress have generously been released as freeware by the original
authors, Revolution Software . This is a
great thing and we should support Revolution for being so kind to us.
You can download the game data from the official ScummVM download page
.
The other games on this list are commercial, and still under copyright,
which means downloading them without paying for it is illegal. You can
probably find a second-hand copy on eBay. Please don't email me to ask
for a copy, as I am unable to send it to you.
Game Build Notes
Manic Mansion A
Zak McKracken and the Alien Mindbenders A
Indiana Jones and the Last Crusade A
Loom A
Passport to Adventure A
The Secret of Monkey Island A
Monkey Island 2: LeChuck's Revenge A
Indiana Jones and the Fate of Atlantis A
Day of the Tentacle A
Sam & Max Hit the Road A Some slowdown in a few scenes
when MP3 audio is enabled
Bear Stormin' (DOS) A
Fatty Bear's Birthday Surprise (DOS) A
Fatty Bear's Fun Pack (DOS) A
Putt-Putt's Fun Pack (DOS) A
Putt-Putt Goes to the Moon (DOS) A
Putt-Putt Joins the Parade (DOS) A Can sometimes crash due to low memory
Beneath a Steel Sky B
Flight of the Amazon Queen B
Simon the Sorcerer 1 C Zoomed view does not follow the
speaking character
Simon the Sorcerer 2 C Zoomed view does not follow the
speaking character
Elvira 1 C
Elvira 2 C
Waxworks (Amiga version) C
Gobliiins D
Gobliins 2 D
Goblins 3 D
Fascination D This game is untested on the DS
Ween: The Prophecy D
Bargon Attack D
Lost in Time D
Future Wars D
All Sierra AGI games.
For a complete list, see this page
D
Inherit the Earth E
The Legend of Kyrandia F Zoomed view does not follow the
speaking character
Lure of the Temptress G
Nippon Safes G
Return to Zork I
Leather Goddess of Phobos 2 I
Manhole I
Rodney's Funscreen I
Cruise for a Corpse K
 

Foxi4

Endless Trash
Global Moderator
Joined
Sep 13, 2009
Messages
30,824
Trophies
3
Location
Gaming Grotto
XP
29,819
Country
Poland
The touchscreen code of scummvm is not broken on the 3ds, or at least not completely. The problem is in dsmain.cpp where most of the stuff happens. The main issue is that IPC->touchZ1 always returns 0. I suppose IPC->touchZ1 reads the Z axis (so to speak) of the stylus, that is it reads pressure and perpendicular touch (correct me if I'm wrong).
The DS has a resistive screen, it doesn't register pressure and isn't Multitouch - it only registers the "overall press point" as two values - on the Y and X axis. I really have no clue what touchZ1 could be, but still, good job on fixing the issue! (I'm saying overall press point because if you, for example, use two styluses to press the screen in two places, the final computed value will be situated exactly in the middle between those two points on both axises)
 
  • Like
Reactions: 1 person

totalnoob617

Banned!
Banned
Joined
Sep 27, 2010
Messages
785
Trophies
0
XP
123
Country
United States
nice .noe it would be nice if there was a fix for ned ds touch screen, or is there? i havent got the latest version, but yea i know its not 3ds specic issue
 

Another World

Emulate the Planet!
Former Staff
Joined
Jan 3, 2008
Messages
10,579
Trophies
2
Age
48
Location
From Where???
Website
wiki.gbatemp.net
XP
5,535
Country
Colombia
the last optimized build for the ds was v1.2.1, a bug fix release. was your v1.4.1 build was compiled from the official scummvm source? so it has support for engines and games that won't run on the ds? or did you do more than just fix the touch screen code?

cheers,
-another world
 

uomoartificiale

Member
OP
Newcomer
Joined
Jan 22, 2012
Messages
13
Trophies
0
XP
78
Country
Italy
the last optimized build for the ds was v1.2.1, a bug fix release. was your v1.4.1 build was compiled from the official scummvm source? so it has support for engines and games that won't run on the ds? or did you do more than just fix the touch screen code?

cheers,
-another world

I initially thought that a more recent revision of the source could have fixed the issue (why re-invent the wheel?). So I went on and checked out the last svn and compiled. the issue was still there and the build was messy and unstable. So I rolled back to the official 1.4.1 sources from the scumvm download page. Fixed the issue, compiled, touched nothing else.

I didn't know if there were any changes from 1.4.1 to 1.2.1 in the ds backends, so I compiled the official 1.2.1 sources from the scummvm sourceforge reposiitory. There's probably no difference whatsoever between the two builds, I just didn't want to break compatibility for anyone.
 

uomoartificiale

Member
OP
Newcomer
Joined
Jan 22, 2012
Messages
13
Trophies
0
XP
78
Country
Italy
The touchscreen code of scummvm is not broken on the 3ds, or at least not completely. The problem is in dsmain.cpp where most of the stuff happens. The main issue is that IPC->touchZ1 always returns 0. I suppose IPC->touchZ1 reads the Z axis (so to speak) of the stylus, that is it reads pressure and perpendicular touch (correct me if I'm wrong).
The DS has a resistive screen, it doesn't register pressure and isn't Multitouch - it only registers the "overall press point" as two values - on the Y and X axis. I really have no clue what touchZ1 could be, but still, good job on fixing the issue! (I'm saying overall press point because if you, for example, use two styluses to press the screen in two places, the final computed value will be situated exactly in the middle between those two points on both axises)

That's what I tought too. On the emulator touchZ1 returns 256 while clicking on the screen. I don't have a ds to check what values are registered on real hardware. At least for scummvm games, any information other than the screen coordinates seems superfluous. As I said, I actually don't know if this version feels any different compared to the original build.
 

jceggbert5

Check out my hack, New Retro Mario Bros.
Member
Joined
Dec 1, 2008
Messages
1,002
Trophies
1
Age
28
Location
USA, Earth, MilkyWay
Website
romhaxor.bplaced.net
XP
747
Country
United States
The DS has a resistive screen, it doesn't register pressure and isn't Multitouch - it only registers the "overall press point" as two values - on the Y and X axis...
You are incorrect about your pressure statement. The DS and DS Lite can register pressure input, Animanitee is the only one that I know of that fully utilizes that feature. No official software uses it, so they did not include the feature in the DSi(XL) or 3DS.
 

spinal_cord

Knows his stuff
Member
Joined
Jul 21, 2007
Messages
3,224
Trophies
1
Age
43
Location
somewhere
Website
spinalcode.co.uk
XP
3,366
Country
The DS has a resistive screen, it doesn't register pressure and isn't Multitouch - it only registers the "overall press point" as two values - on the Y and X axis...
You are incorrect about your pressure statement. The DS and DS Lite can register pressure input, Animanitee is the only one that I know of that fully utilizes that feature. No official software uses it, so they did not include the feature in the DSi(XL) or 3DS.
I'm fairly sure Colors! has pressure sensing also :)
 

jceggbert5

Check out my hack, New Retro Mario Bros.
Member
Joined
Dec 1, 2008
Messages
1,002
Trophies
1
Age
28
Location
USA, Earth, MilkyWay
Website
romhaxor.bplaced.net
XP
747
Country
United States
The DS has a resistive screen, it doesn't register pressure and isn't Multitouch - it only registers the "overall press point" as two values - on the Y and X axis...
You are incorrect about your pressure statement. The DS and DS Lite can register pressure input, Animanitee is the only one that I know of that fully utilizes that feature. No official software uses it, so they did not include the feature in the DSi(XL) or 3DS.
I'm fairly sure Colors! has pressure sensing also :)
Never used it, so I had no idea.
 

uomoartificiale

Member
OP
Newcomer
Joined
Jan 22, 2012
Messages
13
Trophies
0
XP
78
Country
Italy
back on topic... ;) does anyone has a libmad.a library compiled for nds? I'm really struggling to have it compile under devkitPro.

@anotherworld. Did you compile the scummVM 1.2.1 binaries posted on the download section with MAD support? could you provide some info on how the hell did you manage to build it?
 

Another World

Emulate the Planet!
Former Staff
Joined
Jan 3, 2008
Messages
10,579
Trophies
2
Age
48
Location
From Where???
Website
wiki.gbatemp.net
XP
5,535
Country
Colombia
hm, i actually don't recall where i grabbed those files from. perhaps they were on nintendomax. i wonder if that site compiled it. agentq apparently did not release anything past 1.2.0 beta 1 for the nds.

edit::

i did a few seconds of digging on google and it looks like 1.2.1 did hit the sourceforge page but he never released it to the scummvmds homepage or the scummvm forum.

http://sourceforge.net/projects/scummvm/files/scummvm/1.2.1/scummvm-1.2.1-ds.zip/download
http://wiki.scummvm.org/index.php/Nintendo_DS

-another world
 

Foxi4

Endless Trash
Global Moderator
Joined
Sep 13, 2009
Messages
30,824
Trophies
3
Location
Gaming Grotto
XP
29,819
Country
Poland
The DS has a resistive screen, it doesn't register pressure and isn't Multitouch - it only registers the "overall press point" as two values - on the Y and X axis...
You are incorrect about your pressure statement. The DS and DS Lite can register pressure input, Animanitee is the only one that I know of that fully utilizes that feature. No official software uses it, so they did not include the feature in the DSi(XL) or 3DS.
I'm fairly sure Colors! has pressure sensing also :)
Never used it, so I had no idea.
Okay, I've read a little bit more on the subject and it appears that indeed there is a degree of pressure-sensing, however Nintendo does not recommend using that feature due to manufacturing differences between the screen. It would require some hardcore calibration to get the same results on two DS'es (hence the calibration mode in Colours!) that's why Ninty Boys "rejected it" as a feature, focusing on X and Y variables instead.

So "Is the screen pressure sensitive?" should be answered "Yes and No" as it is physically possible, however not recommended (because the screens are crap at it) I suppose. Bizzare, I was convinced it's not possible at all. Good find, Spinal & jceggbert5. ;)
 

uomoartificiale

Member
OP
Newcomer
Joined
Jan 22, 2012
Messages
13
Trophies
0
XP
78
Country
Italy
hm, i actually don't recall where i grabbed those files from. perhaps they were on nintendomax. i wonder if that site compiled it. agentq apparently did not release anything past 1.2.0 beta 1 for the nds.

edit::

i did a few seconds of digging on google and it looks like 1.2.1 did hit the sourceforge page but he never released it to the scummvmds homepage or the scummvm forum.

http://sourceforge.n...ds.zip/download
http://wiki.scummvm....php/Nintendo_DS

-another world

yep, I saw that. Then I suppose the 1.2.1 we see around is built on the official 1.2.1 sources from sourceforge.

Also, the scummvm buildbot compiles a nightly build: http://buildbot.scummvm.org/builds.html which is totally broken.

I'll try to find that library inside nintendomax, thanks for the heads up. ;)
 

uomoartificiale

Member
OP
Newcomer
Joined
Jan 22, 2012
Messages
13
Trophies
0
XP
78
Country
Italy
I managed to build libmad using the latest devitARM. I'm currently compiling 1.2.1, I will post it in a couple of hours. Could anyone confirm that the touchscreen is working correctly? is there any difference with the standard DS version?

For the one in need of a prebuilt libmad library here's libmad.a and the mad.h header:
http://www.mediafire.com/file/5c2f3a3q73aaxij/libmad_prebuilt_armeabi5.7z

for future reference:
In order to build it, you need to install the latest devkitARM (win) then after setup, go to the msys directory. and launch msys.bat. a shell should appear.

download the latest libmad from sourceforge and unpack it inside /home/username within the msys folder. Now in the msys shell navigate to the unpacked libmad folder and configure it using:

Code:
PATH=$DEVKITARM/bin:$PATH
configure --host=arm-eabi --disable-shared --enable-static
it will now generate the Makefile
then launch:
Code:
make

it will probably return an error saying that it doesn't understand the -fforce-mem parameter. Now open the Makefile with a text editor search and delete '-fforce-mem'

launch make again. This time it will compile correctly and it will output a libmad.a in the .libs folder. Copy the library into the backend/platform/ds/arm9/libs folder for scummvm to find it. Copy also the mad.h header into backend/platform/ds/arm9/source/mad/
 

uomoartificiale

Member
OP
Newcomer
Joined
Jan 22, 2012
Messages
13
Trophies
0
XP
78
Country
Italy
I updated the first post with new builds with libMAD support. Again, you should be OK downloading the 1.2.1 version (I reccomend that), but I compiled a 1.4.1 build just because it can turn out to be useful if someone is stuck with a bug in a game. Judging from the official scummvm compatibility table for both versions, if you're not playing backyard baseball, then you shouldn't even bother downloading 1.4.1.

I tested mad support using the talkie version of Flight of the Amazon Queen and a compressed mp3 version of the Day of The Tentacle CD. As far as I can see, it works..
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • ZeroT21 @ ZeroT21:
    supermarket pizza is ass
  • K3Nv2 @ K3Nv2:
    x65 would just yell at me
  • ZeroT21 @ ZeroT21:
    sounds ok, he didn't pull a gun out ,so...
  • K3Nv2 @ K3Nv2:
    $12 large any style pizza deal
  • K3Nv2 @ K3Nv2:
    Each bite is a $1 well spent
  • SylverReZ @ SylverReZ:
    @ZeroT21, Agreed. I hate oven pizza, only from pizza place.
    +1
  • K3Nv2 @ K3Nv2:
    Nah I can still go for totinos
  • RedColoredStars @ RedColoredStars:
    i like totinos party pizzas. lol.
  • RedColoredStars @ RedColoredStars:
    the cracker-like crust is great on those
  • RedColoredStars @ RedColoredStars:
    My neighbor and I are going to make this next month....
  • SylverReZ @ SylverReZ:
    Tiger crust is great.
  • K3Nv2 @ K3Nv2:
    I'm beefing with a neighbor currently each time I ask him for help with something he makes bs excuses then ignores my calls text but seems to randomly speak when I'm done with the project after doing things to help him
  • RedColoredStars @ RedColoredStars:
    DiGiorno Crispy Pan Pizza tasted pretty dang close to Pizza hut pan pizza, but Im not sure if theyve been discontinued or not. Havent seen them locally for a couple of months now.
  • RedColoredStars @ RedColoredStars:
    The croissant crust is still available though, but not quite as good imo.
  • RedColoredStars @ RedColoredStars:
    @SylverReZ Never heard of tiger crust. What is it?
  • SylverReZ @ SylverReZ:
    @RedColoredStars, Its known as tiger bread, also known as dutch crust.
  • Maximumbeans @ Maximumbeans:
    It's fuggin gooooood
    +1
  • RedColoredStars @ RedColoredStars:
    I mean. Whats different about it?
  • RedColoredStars @ RedColoredStars:
    Never even seen a tiger crust pizza in any stores around here. Walmart, Cub, or otherwise.
  • RedColoredStars @ RedColoredStars:
    Must be a regional thing.
  • RedColoredStars @ RedColoredStars:
    Gonna smoke this bowl then go get kitties ashes. <3
  • RedColoredStars @ RedColoredStars:
    Last thing I told her is how much I love her, and that Im not leaving her there forever and I promise to come back and take her back home with me.
  • Bunjolio @ Bunjolio:
    halllo
    RedColoredStars @ RedColoredStars: hello