/Whois Patrick "Pate" Aalto

Discussion in 'GBAtemp & Scene News' started by Another World, Nov 13, 2010.

  1. Another World

    Another World Emulate the Planet!

    Former Staff
    Jan 3, 2008
    From Where???
    [​IMG] /Whois Patrick "Pate" Aalto
    GBATemp Interview #1

    DSx86 is a first of its kind, full featured x86 emulator for the NDS. The emulator supports the 80186 CPU, VGA graphics, SoundBlaster soundcard, an 83-key US keyboard, mouse input, multiple view options, and more.

    Most users are familiar with the DSx86 blog and release threads. However, we do not know all that much about the developer, his history, or the upcoming DS2x86 port for the SuperCard DSTwo. I was very thankful to have the opportunity to interview Patrick and offer this brief glimpse into the life of a NDS Homebrew Developer.

    This interview marks the start of what I hope will become an on-again/off-again feature here at GBATemp. Please be sure to post your comments in the discussion thread and let us know if you enjoyed this interview.

    [​IMG] Interview
    [​IMG] DSx86 Homepage
    [​IMG] DSx86 Compatibility WIKI
  2. Another World

    Another World Emulate the Planet!

    Former Staff
    Jan 3, 2008
    From Where???
    <b>Coding History</b>:
    Q: What age did you get interested in computer programming?
    A: It was in the early 80's, so I think I was around 15 years old. My first computer was a VIC-20 that my dad got me as a Christmas present.

    Q: What was the first programming language you used?
    A: Basic. After I had learned that, I actually started programming also in 6502 byte code, as I did not have an assembler for VIC-20.

    Q: Are you a self taught computer programmer?
    A: I am self-taught, but I also have a degree in Computer Science. The bulk of my knowledge I have certainly learned myself.

    Q: What was the first application or game you programmed?
    A: The absolute first game I programmed I just typed in from the VIC-20 manual, but the first game I was proud of was a sort of “Lunar Lander” game for VIC-20, which used a zone of high-resolution graphics on an otherwise text-mode screen and was coded mostly in 6502 byte code, with only a little Basic code to "poke" the byte code into the vast 3.5KB of RAM it had. :-)

    Q: What currently is your favorite programming language?
    A: I am most fond of Assembler, and have been that way ever since the VIC-20 times. I like to know exactly what the CPU does when it runs my code, and I am also a performance freak, shaving a few cycles off from a code that already works is very satisfying for me. Coding in Assembly is more time-consuming than coding in higher-level languages, so I usually fall back to C for less time-critical routines, though. However, I hate the C++ syntax. :-)

    <b>DS Coding</b>:
    Q: How long have you been coding for the Nintendo DS?
    A: I started by porting my LineWars II game, I think it was in May 2009. So, almost a year and a half now.

    Q: What got you interested in NDS Coding?
    A: A friend of mine showed me his new Nintendo DSi, and said that there is a homebrew community for it, and suggested (half-jokingly) that I should port my old LineWars II game for it. I did not have any other hobby project going on at that time, so I got interested in the idea of coding for a handheld device, and having again to think about CPU and RAM constraints. I find it quite boring coding in these modern managed languages where you (supposedly) don't need to worry about performance or memory consumption at all. What fun is that?

    Q: What Web sites would you recommend for up-and-coming NDS Homebrew developers?
    A:<ul><li><a href="http://libnds.devkitpro.org" target="_blank">http://libnds.devkitpro.org</a></li><li><a href="http://nocash.emubase.de/gbatek.htm" target="_blank">http://nocash.emubase.de/gbatek.htm</a></li><li><a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0100i/index.html" target="_blank">http://infocenter.arm.com/help/index.jsp?t...100i/index.html</a></li></ul>Q: Do you find the NDS to be limited in anyways, if so what are they?
    A: Screen resolution and CPU power. Those limit the possibilities quite severely, especially on the emulation front.

    Q: What programming experience do you recommend to up-and-coming NDS Homebrew developers?
    A: Without any experience in C language programming you will have a hard time getting started.

    Q: What programming language(s) does the DS support?
    A: At least C, C++ and ARM ASM. Probably others as well, but those have been enough for my needs.

    Q: What tools are required for DS programming?
    A: DevkitARM and libNDS, at least. I have been using Programmer's Notepad 2 which comes with the libNDS distribution, but any text editor will work.

    Q: Do you find the small amount of RAM on the DS to be problematic and require a work-around?
    A: What small amount of RAM?! :-) DS has 4MB of RAM, that is plenty of RAM! I still remember working on VIC-20 with 3.5KB of RAM, and later on PCs with 640KB of RAM, so 4MB is a lot!

    Q: Do you find the CPU of the DS to be problematic and require a work-around?
    A: No, I think the ARM processor that DS has is a very nice architecture to work with. It is simpler than x86, but still has sufficient features to do rather complex operations in a few ASM commands.

    Q: Why did you decide to begin working on DSx86? How did DSx86 begin? What prompted your desire to code it?
    A: After I had finished LineWarsDS (or actually even before it was completely finished) I decided I wanted to code something for NDS with the ARM assembly language. I had coded in x86 (which is a CISC processor) ASM, so I was interested in learning how the ASM of a RISC CPU differs from it. I also had never coded an emulator but have always been intrigued by emulators, so I began looking for emulators that nobody had yet coded for NDS. Somewhat to my surprise NDS still lacked an x86 emulator, and the general consensus seemed to be that an x86 emulator would not run fast enough to be useable on NDS. I thought this provided a sufficient challenge to keep me interested in it, and if all went well, to prove the general consensus wrong. :-)

    Q: What are the ultimate goals of DSx86 as a project?
    A: For me personally, the ultimate goal is to learn exactly how an x86 PC system works, and how to create an emulator for it on a different architecture. I also want to learn why some design decisions work and others don't when making an emulator.

    Q: Will DSx86 ever be "complete"?
    A: Probably not. :-)

    Q: Does DSx86 surprise or disappoint you at times? If so will you provide an example?
    A: It frustrates me quite often, when I think some things should work but they don't. The debugging tools, especially for the SCDS2, are also next to non-existing, so it sometimes takes days to find a simple bug in my code.

    Q: How often do you take some time to enjoy your emulator?
    A: I enjoy coding it, not so much actually using it. :-) I suck at games in general, I don't have the reflexes needed. I always feel I could spend my time more productively than playing games, so I don't spend a lot of time playing games on DSx86.

    Q: What are your favorite DSx86 supported DOS games/applications?
    A: I like how my AdLib emulation sounds on DSx86, so I guess my favorite applications are games that make the most out of the AdLib sounds. I sometimes just let the game play music while I daydream about new features to add or things like that. :-) For example GODS, Silpheed and many Sierra games have nice music.

    <b>DSx86 Specific</b>:
    Q: What exactly is DSx86 doing, what does it support, what does it emulate, etc?
    A: Currently DSx86 emulates a 80186 processor (which is almost like a 286 processor, except that it does not have the protected mode features), VGA graphics card, SoundBlaster 2.0 sound card (with both digital audio and FM audio). Also keyboard and mouse input is supported.

    Q: What are the OP codes we hear so much about in relation to DSx86?
    A: As Wikipedia says <a href="http://en.wikipedia.org/wiki/Opcode" target="_blank">opcode</a> (short for "operation code") is part of the (possibly) multi-byte machine language instruction of a processor. The x86 architecture, being a CISC processor, has varied machine instruction lengths. The byte that actually determines the operation to be performed is the opcode, although in my blog posts I have sometimes used the word opcode to mean also some of the other bytes in the instructions. In any case when an opcode is not supported by DSx86, it means that I have not yet coded the handling for this specific machine instruction into DSx86.

    Q: What type of sound cards are supported?
    A: The main sound card that DSx86 supports is Sound Blaster 2.0. That means that only mono digital sounds are supported, and also the FM audio part is mono (although I fake it to sound stereo by panning the different audio channels somewhat off-center). The CPU power needed for the one digital audio and 9 FM audio channels is pretty close to what the secondary ARM7 processor in NDS is capable of, so I can not easily add support for more advanced sound cards. DSx86 has an experimental support for Covox/Disney Sound Source audio device, but it does not sound very good and should only be used if the game does not support Sound Blaster.

    Q: What resolutions are supported?
    A: The text modes 40x25 and 80x25, graphics modes 320x200, 640x200, 640x350 and 640x480, plus some tweaked modes like 320x240 and 320x480 are supported. Some rarely used graphics modes are still unsupported, but the supported modes cover all the normally encountered resolutions.

    Q: How long do you spend tracing down bugs and working on DSx86 per week, in general?
    A: Mostly I work on DSx86 on the weekends, and I sometimes spend up to 8 hours per day both on Saturday and Sunday. Usually only about 5 or 6 hours, though. On weekdays (when I am not on vacation) I can only spend about an hour or (rarely) up to 2 hours on it. So, perhaps around 20 hours per week.

    Q: What are the limitations of DSx86 on the DS?
    A: The emulation speed is equivalent to about 12MHz 80286, and no protected mode or 386 and higher processors are supported, so only the older DOS-based games will run. Windows 3.00a can be run, but as it runs only in real mode, it is not all that useful. Windows 3.11 and later will need protected mode, so they won't run in DSx86.

    <b>DSx86 SCDS2/SCDS2 SDK</b>:
    Q: What is the official name of this project?
    A: I call it DS2x86.

    Q: What is the future of DSx86 when ported to the SCDS2?
    A: I plan to keep updating both DSx86 and DS2x86.

    Q: What additions will be added to the emulator? (sound, video modes, CPU, etc)
    A: DS2x86 will support at least a 386 processor, including protected mode. It could have access to up to 28MB of RAM. If I can get DS2x86 to support Windows 95, then I would like to add a 640x480 Hi-Color (16-bit colors) video mode. On the sound side it looks like I will need to re-code all the sound routines, so it would be more interesting to add some new sound cards instead of coding the same Sound Blaster support again. My test program uses Gravis Ultrasound, so I might add support to that first. Then of course it would be very cool to add Roland MT-32 support, but that might take more CPU power than I can afford. Also, the needed ROM sound banks are not publicly available so that would be problematic.

    Q: What are the benefits of coding for the SCDS2's on-board CPU and RAM?
    A: SCDS2 has a much more powerful CPU. The MIPS processor it has can run in various speeds between 120MHz and 396MHz. Based on my first speed tests, at the fastest speed DS2x86 would run at about the speed of a 386/33 machine. Also, 32MB of onboard RAM is sufficient for pretty much all software that can reasonably be assumed to run. Even Windows 98 only needs 16MB of RAM!

    Q: How is the SCDS2 SDK? Is it easy to use, easy to understand, well organized, etc?
    A: I think the SDK is somewhat limited, and it has had some annoying and frustrating bugs. It keeps getting better, though, and the bugs we testers find are getting fixed. It is not especially difficult to use, but I think it goes a bit too far in trying to abstract the underlying hardware away.

    Q: What would you do to better the SCDS2 SDK?
    A: I would like some lower level access and functions in addition to the current very high level functions for graphics and audio data sending to the NDS side. I also especially would like the possibility to code something for the ARM processors as well as the MIPS processor.

    Q: What limits does the SCDS2's on-board CPU/RAM have in regards to DSx86?
    A: I think the biggest drawback in the SCDS2 architecture is the limited graphics and audio support. You can only have 16-bit graphics, and 16-bit stereo audio (originally only 44.1kHz, but in the latest SDK beta you can use also 22kHz and 11kHz audio formats). I would prefer a 256-color palletized graphics and mono 8-bit audio, as those would be closer to the hardware I am trying to emulate.

    Q: What benefits does the SCDS2's on-board CPU/RAM have in regards to DSx86?
    A: The biggest benefit is the added CPU power, which allows me to support 386 processor, and the large amount of RAM it has.

    Q: Is it possible to incorporate more DSx86 "zoomed" resolutions with the use of the SCDS2's onboard CPU? Thus allowing for graphics which fit the screen with fonts that can be more easily read?
    A: Yes, this should be possible. The 16-bit color graphics should allow smoother scaling with proper linear interpolation of the pixels.

    Q: When will DSx86 for SCDS2 be released?
    A: Who knows? :-) I would like to get an alpha version released this year, but I think it should have some notable improvements over the current DSx86, else there is not much point in releasing it. I think the first version will still be in many ways more limited (probably no AdLib audio, for example) than the current DSx86, but if it could run some 386 or protected mode programs, that might be a good enough reason for releasing it.

    <b>General Questions</b>:
    A: What do you like to do in your down time?
    Q: When I am not coding? Just the usual, I like to watch movies (I have a home theater system with Blu-Ray capability), read books (though I have rarely had time for this since starting DSx86), and I also play volleyball (which is my only physical activity).

    A: What coding plans do you have after DSx86?
    Q: Before I learned about SCDS2, I wanted to study the possibility of porting DSx86 to Symbian OS for mobile phones. I currently have no specific plans, but I would also like to be able to code something for Nintendo 3DS. I hope it will have a homebrew capability at some point.

    A: What is the official homepage of your projects?
    Q: <a href="http://dsx86.patrickaalto.com/" target="_blank">http://dsx86.patrickaalto.com</a>, see also <a href="http://linewars.patrickaalto.com/" target="_blank">http://linewars.patrickaalto.com</a>

    A: Is there anyway users can get involved and help?
    Q: I would appreciate if the DSx86 users would take a look at the <a href="http://dsx86compatibility.pbworks.com/Compatibility-List" target="_blank">Compatibility List</a> and update it with the games and other applications that they have tested on DSx86. There are quite a few games there that have only been tested in very old versions, so if you happen to test the games on the most recent versions, feel free to update the status! I have decided not to update that list myself, as I am busy with coding DS2x86 and I think the list will be more objective if I let you the users decide whether some game or application works well enough.

    Q: Do you accept donations, how can users help?
    A: Yes, there is a Donate button on my pages at <a href="http://dsx86.patrickaalto.com/" target="_blank">http://dsx86.patrickaalto.com/</a>. However, donating is not required or necessary, as this is just my hobby project and not a money-making project.

    Thanks for your interest in DSx86!

    Patrick "Pate" Aalto
  3. Infinite Zero

    Infinite Zero Almost!

    Apr 25, 2010
    United States
    good interview! will finish reading for a while
  4. Costello

    Costello Headmaster

    Oct 24, 2002
    very interesting interview, thanks Patrick and AW!
    I learned a lot in this interview, I'm really looking forward to the SCSDTWO version which should come with improved compatibility [​IMG]
    fantastic homebrew/emulator!
  5. Sephxus

    Sephxus GBAtemp Fan

    May 27, 2010
    United States
    Pomona, CA
    Great interview. Looking forward DS2x86.
  6. deathking

    deathking GBAtemp Advanced Fan

    Mar 15, 2009
    United States
    great interview
    really interesting read and i cant wait for the supercard version to see what boundaries Patrick can push with the ds .
  7. mercluke

    mercluke ‮҉

    Dec 2, 2007
    very interesting read, looking forward to more of these in the future [​IMG]
  8. deathking

    deathking GBAtemp Advanced Fan

    Mar 15, 2009
    United States
    just read the compatibility list and it has my fave pc game - home alone working on it
    damn reading this interview and and then clicking the link made my day
  9. wii_go

    wii_go Member

    Jul 14, 2008
    Paris FRANCE
    a while to have DS-2-x86 on my SCDStwo but GODS on my ds (there's a snes one no !!!) or sierra games on my DS or my next 3DS will be awesome... thx dude
    Patrick "Pate" Aalto for president
    ...in assembler... wahou, i'm learning it a little bit, i was so confusing with this kind of language, hard... very hard to understand what you do... very impresse by this guy...
  10. phoenixclaws

    phoenixclaws GBAtemp Fan

    Oct 10, 2007
    United States
    Great to see Pate get the recognition that he deserves. Good interview. I've been following DSx86 since the first release. Keep it up man. I can't wait for DS2x86.

    And I agree that Adlib audio rocks. Took a while for it to get it fixed in a couple games I kept bugging him about. (hehe)
  11. SylvWolf

    SylvWolf Ave Dominus Nox

    Jul 30, 2007
    United States
    East Coast, USA
    As others have said, quite an interesting read. I'll look forward to more of these interviews.
  12. Killermech

    Killermech Cookie Monster

    Mar 5, 2004
    Patrick is easily one of my favorite homebrew devs. I follow his blog every week [​IMG]
  13. Rydian

    Rydian Resident Furvert™

    Feb 4, 2010
    United States
    Cave Entrance, Watching Cyan Write Letters
    Yar, I'm glad he's got a little spotlight here.
  14. VatoLoco

    VatoLoco Don't crush that dwarf, hand me the pliers.

    Jan 29, 2008
    United States
    Ya Cant Get There From Here
    Nice interview, thanks AW and Pate =)

    i also check up on Pates blog on a regular basis, its interesting to see how the ds2x86 progressing along, even though i dont understand some/most/any of the technical aspects.

    Cant wait to see what kind of stuff we can get running on the DS2 version =D
  15. iFish

    iFish Slower than a 90s modem

    Jul 11, 2009
    Montreal, QC
    This was a very interesting read.

    Thanks Patrick and AnotherWorld!
  16. MarkDarkness

    MarkDarkness Deliverator

    GBAtemp Patron
    MarkDarkness is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Dec 17, 2009
    Fine interview with a great coder. DSx86 is sincerely the most impressive DS homebrew I have ever seen, so it's great to know it will continue to march forward.
  17. toguro_max

    toguro_max GBAtemp Fan

    Feb 24, 2007
    São Vicente, Brazil
    I found it amazing the amount of time he dispends to code this nice app :-O
    Great interview!
  18. Kitanode

    Kitanode Advanced Member

    Nov 30, 2009
    Irvine, Scotland
    I've been following this emulator since nearly the beginning and i'd like to thank Patrick Aalto for releasing it and the continued work he's put into it.

    The DS has probably been my fav console ever (certainly my most played) and the fact that i can now revisit the games of my youth on it occasionaly and show it off to people is great. Some people think i'm playing a trick on them when i show them windows 3.0 running on it as well.

    Anyway, what i want to know is if Patrick has any plans for the forthcoming 3DS?
  19. Swifty1992

    Swifty1992 Member

    Apr 13, 2009
    I'm fairly sure he said he was looking forward to seeing the possibilities with 3DS homebrew.