tag:blogger.com,1999:blog-5659669362849485952024-02-07T05:28:14.766-08:00Nerdy Nerdy!Let out that nerd in you!Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.comBlogger37125tag:blogger.com,1999:blog-565966936284948595.post-45847962531216773722010-03-10T20:08:00.000-08:002010-03-11T18:34:46.847-08:00Chome and XSLT<div style="text-align: left;">I've built a web portal for my own use that integrates search engines, categorized favorite links and custom styled RSS feeds into a single page. It's a hodgepodge of ASP, VBScript and JavaScript with an XML as the backend and jQuery/UI to liven things up.</div><div><br /></div><div>Initially working with FireFox as my default browser, everything was working fine until I decided to install Chrome. That when I got the error message: Extra content at end of document. </div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 238);"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT_D4fCgcO0_D6c51Gmw96YIWMe7VdAzM0-jUW4wRrjWpIsjEfDG8zochKJO-HisF-1ihDymLsRYPuSgoWD77J8I9Q9ar8Liq3B4No_mzVZKOpvWzMhWte2gbbXITjM0EYVR6Cp3zoiHg/s912/chrome-error.PNG" alt="" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 589px; height: 329px;" border="0" /></span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 238);"><br /></span></div><div>This gave me quite a headache until I traced it to the XSL processing in my JavaScript. I didn't quite understand what was causing the problem until I realized that Chrome didn't like what I was doing inside my {xsl:template}<xsl:template>. </xsl:template></div><div><br /></div><div>It turns out Chrome expects a only single child node (or document if you like) inside an xsl template and was complaining about anything coming after it. So you can't have this: (sorry about the curly braces, it seems blogger doesn't play nicely with code tags) </div><div><br /></div><div><span class="Apple-style-span" style="font-family:'courier new';">{xsl:template match="/rdf:RDF|/rss"}</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> {img src="...."}{/img}</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> {div}</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> ...</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> {/div}</span></div><div><span class="Apple-style-span" style="font-family:'courier new';">{xsl:template}</span></div><div><br /></div><div><div>To fix this problem, all I did was wrap everything in another div.</div><div><br /></div></div><div><div><span class="Apple-style-span" style="font-family:'courier new';">{xsl:template match="/rdf:RDF|/rss"}</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> {div}</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> {img src="...."}</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> {div}</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> ...</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> {/div}</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> {/div}</span></div><div><span class="Apple-style-span" style="font-family:'courier new';">{xsl:template}</span></div><div><br /></div><div>... et voila ...</div><div><br /></div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 238);"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFH6j49qqUOUWK1bXjo_pUvVo_I-nTQymAfad-FM9OeR_Hfxe8xq7aYi6W4gTs43KTsH9THBMChmoIFCGJuXXint0ZwsyoBWKwaiiNkywcXbrRoDfo1itotXHiLyHqjDKT9PuL0OboHnQ/s800/chrome-fixed.PNG" alt="" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 588px; height: 370px;" border="0" /></span></div><div><br /><br /></div></div>Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com11tag:blogger.com,1999:blog-565966936284948595.post-74546551537436792962010-01-21T19:13:00.000-08:002010-03-08T19:14:05.603-08:00HackintoshingI installed OSX on my PC last year, and I thought I'd document what I did and what I went through to get it up and running, in case a future me decides to reinstall all over again, or install in another PC.<br /><br />OSX is visually appealing, and although it's interface might take some getting used to when coming from a Windows background, its responsiveness and intuitiveness wins you over easily.<br /><br />OSX is based off Darwin, which is a UNIX variant, and while there are many tools to help you setting up, sometimes you might have to go through a command line and sudo your way into the system, so it helps to brush up on unix commands.<br /><br />Installing OSX on an x86 platform is possible now due to the fact that Apple switched from a PPC architecture to the x86, with Intel as its target. There are subtle differences between PC hardware and a Mac, and OSX is specifically designed for Mac hardware.<br /><br />iDeneb contains many patches to get OSX running on your system, however as Hackintoshing is a very much experimental field, and with the variety of PC hardware out there, you might have a rig that is not 100% compatible with the distro and you will need to go hunting for drivers for your specific hardware.<br /><br />Installer: iDeneb v1.1 10.5.4<br /><br />System:<br />Intel Core 2 Duo E4500<br />ASUS P5B-MX WiFi MoBo<br />3GB RAM<br />Inno3D GeForce 8500 GT 512MB<br />Windows XP SP2 on C:\<br /><br />First off, my DVD-ROM is broken, so I had to resort to using Leopard HD install helper. This tool will dump your ISO into a hard disk and make it bootable.<br /><br />I partitioned my 2nd hard disk into<br /><br />8GB - format as FAT32 (through command prompt in XP)<br />20GB - leave unformatted<br />The rest - data partition<br /><br />Using the helper I installed the iDeneb ISO to the 8GB. The default options make the HDD bootable and add a "Mac OS X System" option to your windows XP boot menu.<br /><br />Rebooting, I chose the second option in the boot menu and it booted into the Mac OSX installer.<br /><br />Using Tools > Disk Utility I "erased" (formatted in OSX lingo) the 20GB with the Mac OSX Journaled partition type. Close the Disk Utility and select the 20GB from the choice of target HDDs.<br /><br />Before continuing the installation I clicked the Customize button and set the following:<br /><br />AMD patch: Not needed (Intel CPU)<br />Audio: AC97 (from mobo's built-in audio)<br />Fix: AppleSMBIOS: 800 (an article suggested ASUS mobos need this)<br />Video: None for now<br />Network: none for now:<br />Chipset: ICHx and JMicron<br />Other: OSX86Tools<br /><br />I found out that the version of Firefox included was Italian, so I wouldn't recommend installing that right now.<br /><br />Installer took 10-15 minutes then rebooted.<br /><br />The chipset is important and should match your chipset, otherwise your OS will hang when booting.<br /><br />Booting successfully into the OS you are greeted with the Mac "Welcome" video, after which you go through a wizard to adjust settings.<br /><br />However (for me), when prompted whether to restore data from another Mac or from Time Machine, I of course chose not to do so, and the disk whirred and the busy icon came up and I was thrown all the way back to the Welcome video.<br /><br />Some people say that you can get past this by re-enabling the serial and parallel ports and legacy usb in the BIOS.<br /><br />If that doesn't work, you can bypass the first time setup by doing this:<br /><br />When booting into OSX, you have 5 seconds to press any key to get the boot options command line. At the boot prompt, enter the option for single-user mode (with command line) and press enter.<br /><br />> -s<br /><br />At the root commandline, enter the following, waiting for the prompt to appear again before typing the next line:<br /><br />> sbin/fsck -fy<br />> sbin/mount -uw /<br />> passwd root<br /><br />Now enter the new root password and the confirmation. You won't see the password being typed.<br /><br />This ensures the password is set so that we can login later. Now we create the file that notifies OSX that setup is complete:<br /><br />> touch /var/db/.AppleSetupDone<br /><br />Now reboot with the command:<br /><br />> reboot<br /><br />Instead of the welcome screen we get the login prompt for root. Go ahead and enter your password to login as Administrator. Since we skipped the user account creation in setup make sure to create your own Admin account in System Prefs > Accounts.<br /><br />Now I have a working OSX installation, all I need to do is install the correct drivers. A bit of googling got me the drivers for my AttansicL1 ethernet. Drivers come in the form of Kernel Extensions (kext) which you can install using Applications > iDeneb tools > OSX86Tools.<br /><br />I downloaded FireFox and Adobe Flash and got that working seamlessly, and I was browsing, facebooking and even playing FarmVille in no time, and with no problems.Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com0tag:blogger.com,1999:blog-565966936284948595.post-23067254671902978472009-04-07T07:46:00.000-07:002009-04-07T08:11:05.563-07:00Excel Office 2003 Documents opening as read-only in SharePoint<span style="font-size:+0;">Recently I've been getting issues with users complaining that their old Excel files are now opening as Read-Only, and that in order to update the document they have to Save-As to their desktop then re-upload - which kind of defeats the purpose of SharePoint.</span><br /><br />I've tried some of the recommended fixes from various sites, including <a href="http://support.microsoft.com/kb/870853">the one from Microsoft</a> which says that it won't work for Sharepoint (but other users say it does), and they just don't work on my machine. I don't want to try to do those fixes manually on the user's machines either.<br /><br />In desperation I tried to find out exactly what was going on, using RegMon from Sysinternals.<br /><br />What I found is that when a user clicks on a Document URL from the web, IE launches Excel using the OpenAsReadOnly shell command (by default).<br /><br />By modifying the registry so that the command to Open as Read Only would essentially do the same thing as the regular Open command, I was able to workaround the situation, although for some users this was temporary - the next day something restored the settings back, and they had to run the registry hack again.<br /><br />I don't know when Microsoft decided to change this policy of how documents are opened from the web, or how it was distributed to our network or our users. There are sites that say that this is by design, which begs the question, why did it work the way it did before?<br /><br />I do agree that it should be fixed by using the Edit in Microsoft <application>link, which incidentally launches an ActiveX object to open the document in Read/Write mode, but it just doesn't satisfy my curiosity as to how things were before they started working "as they should".<br /><br />For anyone interested, I am on WinXP SP3, MS Office 2003 Standard Edition, with Compatibility Pack for the 2007 Office system (<a href="http://support.microsoft.com/kb/923505">KB923505</a>) installed.<br /><br />Copy and paste the below into a text file and save as .REG:<br /><span style="font-family:courier new;font-size:85%;"></span><br /><span style="font-family:courier new;font-size:85%;">Windows Registry Editor Version 5.00<br /><br />[HKEY_CLASSES_ROOT\Excel.Sheet.8\shell\OpenAsReadOnly\command]@="\"C:\\Program Files\\Microsoft Office\\OFFICE11\\EXCEL.EXE\" /e"</span><br /><span style="font-family:Courier New;font-size:85%;"></span><br /><span style="font-family:Courier New;font-size:85%;"></span><br /><span style="font-family:Courier New;font-size:85%;"></span><br /><span style="font-family:Courier New;font-size:85%;"></span>Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com1tag:blogger.com,1999:blog-565966936284948595.post-44223005283845402792009-03-23T02:14:00.000-07:002009-03-23T03:18:02.555-07:00HiatusI haven't done any programming in a while now. It's probably because the PSP plugin I was trying to make was totally pwned by another person's plugin. <br /><br />The plugin is another attempt to allow a user to organize games and applications into folders on the PSP, and it does the job in a much better way both interactively and programatically, and I wave the white flag and now use it myself.<br /><br />It's also because I can seem to find the time I need to really get into programming. I really don't want to break my time down for you in order to illustrate, but four hours of programming sometimes just doesn't seem to cut it in order to learn or make something useful.<br /><br />Perhaps it's just that I don't have a focus right now.<br /><br />So I've dropped programming for a while and now I'm going back to playing games.<br /><br />Recently I've started playing <strong>Final Fantasy VIII </strong>again. It's one of the RPGs I've already finished, but more or less enjoyed enough the first time around to warrant a second playthrough.<br /><br />The first time I played it, I was in college, and I only rented to play the game, so I didn't have much time to really get into it, nor did I finish it.<br /><br />The savegame slept on my memory card until the day PSX emulation became feasible, and following instructions, I made a memory card reader out of a floppy disk connector and some instructions on the web.<br /><br />The second time I played it, I between jobs and had so many games to play that I didn't really bother to spend the time to get to know the game that well.<br /><br />I'm playing it on my PSP nowadays, more or less for nostalgia than the need to finish it. I could be spending more time on Patapon 2, but I've grown a bit tired of killing bosses over and over again in order to level up my army so I can go back to killing bosses over and over again.<br /><br />Maybe it's my video card, but <strong>Resident Evil 4 </strong>gets me motion sick after a few minutes of play. Then again I was never really a fan of first-person-shooters.<br /><br />I haven't touched <strong>Final Fantasy X </strong>in a while. I'm using PCSX2 to emulate it (I don't own a PS2), and fortunately my video card can crank enough polygons per second to make it playable.<br /><br />It'd be nice to own a PS2 and play all those great games, but I can't bring myself to shell out some money to buy a second hand unit and some games with scratched or second-rate DVDs.<br /><br />Maybe if someone sold me one for Php 4,000, I'd bite. But that's almost a new Inno3D GForce 9600 GTS DDR3.<br /><br />Thing is, I'm not even much of an avid PC gamer.<br /><br />*sigh*Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com1tag:blogger.com,1999:blog-565966936284948595.post-70676619136851074272009-03-10T06:50:00.001-07:002009-03-10T08:05:32.654-07:00Hitched!After five years, we finally got married!<br /><br />My dear Fransly and I tied the knot on February 28, 2009 at the Hearts of Jesus and Mary Parish Church, at West Triangle subdivision in Quezon City.<br /><br />My father decided to come late to the church, but I didn't let that ruin the day for me. The road leading to the front of the church was torn up for repairs/renewal, but I didn't let that ruin the day for me.<br /><br />The cloudless day brought a heat wave but also gave perfect lighting for picture-taking. Hats off to the <a href="http://www.arieljavelosa.ph/">Ariel Javelosa</a> team for grabbing such lovely pictures. Thank you Max!<br /><br />Reception was held at the <a href="http://www.gazeboroyale.com/">Gazebo Royale's</a> <a href="http://www.gazeboroyale.com/spg/photogallery/venue-details.asp?vid=11">Champagne hall</a>, where we surprised everyone (photographers especially) by running down the red carpet to the front of the pavillion where we had our first dance that rocked the crowd and really set the mood. I have Donna to thank for coreographing, and Tina and Onchit for joining us in the dance.<br /><br />Dinner was quickly served. We didn't get to eat much with all the photos being taken, but everyone seemed to enjoy the food served by <a href="http://www.eloquentecatering.com/">Eloquente</a>, while <a href="http://serene8.multiply.com/">Seren8</a> played our choice of music.<br /><br />After the AVPs, the games, and everything to everyone's surprise I sang "Beautiful in My Eyes" and though I botched it a bit at the second stanza, nobody seemed to notice. <br /><br />The deal was, Fransly wanted me to sing either that or "Danny's Song" (I really didn't want to sing the part "I think I'm gonna have a son" because then <em>people</em> might interpret it <em>literally</em>), but wanted it to be a "surprise", so she didn't know <em>when </em>I was going to sing. <br /><br />I would have wanted to sing "The Way You Look Tonight" using Steve Tyrell's version, which IMO is more jaunty than the original or Buble's, since I know the lyrics better, I might not have botched it. Oh well.<br /><br /><a href="http://www.hitchedweddings.com/main2.html">Hitched!</a> provided us with on-the-day wedding coordination and lots of help hooking us up with the wedding band and other details we missed. We couldn't have done it without you.<br /><br /><a href="http://www.partypicslive.com/">Partypics</a> provided the <a href="http://www.partypicslive.com/pictures?name=20090228_David_Fransly">photobooth</a> which doubled as our souvenirs.<br /><br />Overall, it was the best wedding I could have wished for.<br /><br />To cap it off, we spent another day at the Linden suites, which I didn't really get to enjoy all that much as I had a really bad cough.<br /><br />Finally, I must thank my dear wifey for rubbing her nose against mine and stealing that kiss (I know it was you!) If not for that fateful day, none of this would have happened, and I wouldn't be as happy as I am now.Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com0tag:blogger.com,1999:blog-565966936284948595.post-2764464862204389232008-12-30T00:47:00.000-08:002008-12-30T01:04:35.704-08:00Plugins for the PSP - 2My efforts to ask for any help of the QJ.Net forums on hacking the PSP to add something similar to folders in the GAME menu created a rather lengthy thread that was filled with a lot of critiscm.<br /><br />Eventually I posted some information that more or less showed that I knew what I was doing, and then the tides turned. Those who were telling me that what I was doing (disassembling the game_plugin module) was next to impossible, was silly, and was clearly the wrong approach, now nodded and said that what I had found was correct, and that they knew that information all along, and even offered me to join a group they were building devoted to hacking the VSH modules.<br /><br />I don't really see why they are so uptight about sharing that information, when all the stuff they can actually do to hack the PSP was made possible by the sharing of information.<br /><br />Anyway, I'm once again on my own. I've been a bit busy and I haven't had time to work on this. I shouldn't be spending so much time working on this project, as I'm about to get married in 2 months and there's a still lot of things that need planning and preparation.<br /><br />With the slightest bit of help I have found the code that executes when the user selects a game, so I'm that much closer to realizing my goal. All I need to find know is how the code passes around the information containing the selected game, but finding this is a bit harder than I expected.Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com1tag:blogger.com,1999:blog-565966936284948595.post-63195514640655534912008-12-10T06:35:00.000-08:002008-12-10T08:17:03.869-08:00Plugins for the PSPI've been working on a pet project of mine that I thought would be fun to do. I've been able to write and compile code for running on custom firmware on the PSP for a while now, but I haven't decided on what to do.<br /><br />I've wanted to make a decent game, perhaps a bike-physics game clone of the one on teagames that I enjoyed so much playing during dull hours at the office, or a tower defense game with nice graphics and interesting weapons.<br /><br />I've finally got more or less of a hang on the use of makefiles, enough that tweaking them a bit doesn't faze me like it used to. I don't exactly bother to write one from scratch though, as there are still some things I don't fully understand.<br /><br />I've also enjoyed using plugins, which are really fantastic as it really lets you do so many more things with the PSP than what it can out-of-the-box.<br /><br />So now I've tried to write my own plugin, based on an existing one, but with different features. It's been considered by some extremely difficult to put folders for games in the XMB. And I wholly agree.<br /><br />But I've come up with an idea that might work. <br /><br />When you place a folder in your /PSP/GAME folder that doesn't contain an EBOOT.PBP (the executable) , the XMB will display it as "Corrupted Data". This is just the way it's designed, zero levels deep.<br /><br />There are plugins that allow you to categorize your games, and by placing them in different folders, you can select which category is currently active, and it displays only those games in the xmb.<br /><br />These plugins use a button combination or a menu to select the category.<br /><br />I thought of a way to let a folder show up in GAME, by spoofing an EBOOT when the firmware is trying to read the name and icon for the EBOOT.<br /><br />The firmware tries to load an EBOOT for each folder it sees in /PSP/GAME. In the empty folder, it tries to load an EBOOT.PBP and as there is none, it fails and tells the firmware that the game is probably corrupt.<br /><br />With my plugin in place, the code fails, but the plugin catches it and instead generates a fake EBOOT on the fly using the name of the folder and a default icon stored somewhere accessible, and tells the firmware <em>everything is OK, don't worry, there is an EBOOT here</em>.<br /><br />Right now this is all the plugin does - it just allows folders to be displayed as EBOOTs in the XMB.<br /><br /><div align="center">[screenshot goes here]</div><br />Now comes the hard part - intercepting when the user tries to open my fake EBOOT.<br /><br />Normally the firmware tries to load the game, displaying the gameboot intro before launching the game.<br /><br />What I need to do is catch the keypress before the firmware does, figure out what EBOOT the user is pointed at, check if it is one of mine, and if so, cancel loading the EBOOT and switch "categories" - folders really - and flush the memory stick cache.<br /><br />This is where it gets interesting.<br /><br />The PSP firmware is made up of several modules that load other modules as needed. The vshmain module (?) is the module that displays the top-level menu, the XMB.<br /><br />When you select a top level item, vshmain (?) loads the approriate module - game_plugin in my case.<br /><br />game_plugin is now responsible for reading the memory stick, drawing the icons, handling the menu. I'm not sure if it is entirely responsible though, it probably makes calls to other existing modules.<br /><br />I makes sense that the game_plugin module contains a subroutine for checking if the user has pressed a button, or acting on button presses. What I need to do is patch the module to jump to my own code for checking button presses, before I call the original code.<br /><br />As of now, I only have a fleeting understanding of how this can be done. With my previous knowlege of patching ROM code, I have some idea, but this is a 32-bit RISC platform with relocatable code, making things much more difficult for someone from a 8/16-bit fixed code background. There is probably some mechanism to locate the module's base entry point, and offset from there to some function.<br /><br />I don't know how to find that function yet. But I have some ideas.<br /><br />Learn MIPS assembly.<br /><br />The module loads gameboot.pmf prior to launching the game. Look for the string gameboot.pmf, and to the code that references it and backtrack until you can find where the button presses are. Hopefully button polling/testing can be easily identified in assembly. (HAH!) NOPping out code is a time-honored method of isolating code.<br /><br />Patch the code somewhere appropriate to jump to a function in my plugin.<br /><br />This function needs to know what EBOOT the game_plugin module is currently "looking" at. Even after finding the right place to patch and patching the code, this is much more difficult to do. Perhaps the module's memory space contains an array of paths, and an index to the current entry.<br /><br />Or perhaps there is a function that does this. With the caching that the XMB implements, this makes things much more difficult. Perhaps recoding a game_plugin <em>is</em> easier in the long run.<br /><br />One thing fir sure, I would have learned a lot more by the time I'm done with this project, whether it is complete or not.Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com0tag:blogger.com,1999:blog-565966936284948595.post-18796117657583025342008-10-14T07:20:00.000-07:002008-10-14T08:33:16.790-07:00Dead and AliveFew things that I can really count as strange happen to me.<br /><br />I would have ignored the fact that my PSP inexplicably died on me, only to have it suddenly return to life, then intermittently work, and finally start working again. I would have relegated it to <a href="http://vidicon.dandello.net/vidicon.htm">the perversity of the inanimate</a>.<br /><br />So it only served to raise the event to even higher levels of mystery when the same thing <a href="http://forums.qj.net/showthread.php?t=144913">happened to someone else</a>, at around the same time, and stranger still, to someone sharing my first name.<br /><br />I'm just glad that my PSP is back and better (except for that piece of tape holding the LCD backlight flex cable to the connector)Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com0tag:blogger.com,1999:blog-565966936284948595.post-42094315051447109842008-10-02T21:16:00.000-07:002008-10-02T21:25:40.164-07:00WiiMote in ActionAs you know I got a WiiMote a few months a go for my birthday, but I haven't been using it lately. The lack of buttons makes it difficult to play Final Fantasy X, which is what I'm spending my gaming time on nowadays.<br /><br />Well, here's a couple of videos of my WiiMote setup in action. <br /><br />I hadn't setup the Wii "sensor" bar I DIY'd when I made these videos, so there's no point n' click action here yet.<br /><br /><center><br /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/tR00pRBR4Gw&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/tR00pRBR4Gw&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object><br /><i>TrackMania Sunrise</i><br /><br /><br /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/-RDwWVkepUU&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/-RDwWVkepUU&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object><br /><i>Portal</i><br /><br /></center>Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com0tag:blogger.com,1999:blog-565966936284948595.post-33466642943742368032008-10-01T04:26:00.000-07:002008-10-03T04:00:14.910-07:00Doh!Fans of Point-and-click games would do well to be aware that <a href="http://www.brokensword25.com/news/news.htm">Broken Sword 2.5 is out!</a> And it's totally free!<br /><br />I love point-and-click games (and their precursor, the click-and-type games?) Never mind that I probably haven't solved one yet without the help of a walkthrough.<br /><br />In fact, I can't wait to have kids, have them grow up a bit and so I can install a PC-based media center with a 42-inch LCD, (or will OLED be the display of choice in the far future?) WiiMotes and ScummVM installed, and introduce them to Those Games Their Father Played Back In Those Days, encouraging them to play them as they will be the only games installed on the PC, and declaring lazy Saturday afternoons as Family Point-and-Click Time.<br /><br />Oh they will hate me.<br /><br />When I heard Broken Sword 2.5 even existed, my first thought was -<em> is it ScummVM compatible? Does it use the same engine even?</em><br /><br />My second thought was - <em>if it did, maybe I could play it on my...<br /></em><br /><a href="http://endersoft.blogspot.com/2008/09/woe-is-me-part-deux.html">PSP...</a><br /><br /><strong>Doh!</strong><br /><br />(<em>The happy music playing in my head slowed to a stop like an audio tape stuck in the mechanism. Audio tapes? How archaic...</em>)Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com0tag:blogger.com,1999:blog-565966936284948595.post-77807845832987103502008-10-01T03:27:00.000-07:002008-10-03T04:02:05.005-07:00Returning Strings from WinAPI in VB.NetI know this has been covered a lot in other places, but the things is, all their examples have failed to work for me. Here I offer another method, one that worked for me.<br /><br /><span style="font-family:courier new;font-size:85%;">Declare Auto Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Integer, ByVal lpString As String, ByVal cch As Integer) As Integer</span><br /><br />This is the usual declaration of the API function GetWindowText. As we know <strong>lpString</strong> should be marshalled as a LPCSTR, but according to <a href="http://www.devx.com/tips/Tip/15264">this article</a>, VB.Net doesn't allow you to specify the marshaling attribute on parameters, and purportedly the above declaration works just fine.<br /><br />When I tried this version of the API call, using GetWindowTextLength to determine the length of the string to be filled with spaces before passing to GetWindowText, I ended up with a bunch of non-ASCII characters. When I tried using the MarshalAs attribute, all I got was an empty string of the "correct" length.<br /><br />After some exasperation I decided that since the API was expecting a pointer to a string, I might as well give one, or the closest to one, a byte array. The declaration was then:<br /><span style="font-family:Courier New;font-size:85%;"></span><br /><span style="font-family:courier new;font-size:85%;">Declare Auto Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Integer, ByVal lpByteArray As Byte(), ByVal cch As Integer) As Integer</span><br /><span style="font-family:Courier New;font-size:85%;"></span><br /><span style="font-family:lucida grande;">Then:</span><br /><span style="font-family:Courier New;font-size:85%;"></span><br /><span style="font-family:Courier New;font-size:85%;">...</span><br /><span style="font-family:Courier New;font-size:85%;">Dim Ret As Integer</span>, <span style="font-family:Courier New;font-size:85%;">sByte As Byte() </span><br /><span style="font-family:Courier New;font-size:85%;">Ret = GetWindowTextLength(hwnd) </span><br /><span style="font-family:Courier New;font-size:85%;">If Ret > 0 Then </span><br /><span style="font-family:Courier New;font-size:85%;">ReDim sByte(Ret + 1) </span><br /><span style="font-family:Courier New;font-size:85%;">lret = GetWindowText(hwnd, sByte, Ret + 1)</span><br /><span style="font-family:Courier New;font-size:85%;">Return System.Text.Encoding.ASCII.GetString(sByte)</span><br /><span style="font-family:Courier New;font-size:85%;">End if</span><br /><span style="font-family:Courier New;font-size:85%;">...</span><br /><span style="font-family:Courier New;font-size:85%;"></span><br /><span style="font-family:lucida grande;">Just as a sanity check (and before I found the Encoding.ASCII.GetString function), I stepped through the function to see what was being stored in sByte. They looked to be ASCII-flavored bytes (mmmm) so I looked for a function to convert them to a string, <em>e</em></span><span style="font-family:lucida grande;"><em>t voila!</em></span><br /><em></em><br />I was actually expecting to be required to pass the first member of the byte array as a parameter to GetWindowText, but apparently .Net did the math and converted the byte array into a pointer of sorts.<br /><br />I must admit I'm a bit new to .Net (two years of actual usage) and newer to managed and unmanaged code mixing, so I can't tell you that this is the right way to do it, but this method worked where others failed.<br /><br />I'm on .NET 2003, in case you were wondering.Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com1tag:blogger.com,1999:blog-565966936284948595.post-7723500100392678812008-09-30T00:36:00.001-07:002008-10-01T06:26:42.109-07:00Woe is me - part deuxIt's official - my PSP is really bricked.<br /><br />I tried reviving it with Despertar del Cementerio, and initially it looked fine - the DC7 menu booted up, I selected the option to install firmware 4.01 M33, it went through the motions of formatting flash rom and installing the firmware.<br /><br />But when it was all done I rebooted with a normal battery and it was still dead. Even trying to boot into the firmware off the memory stick (Test M33 option) produced the same results.<br /><br />I have repartitioned, regen'ed the IDStorage, restored the NAND from corly's "clean" flashdump, all to no avail.<br /><br />I have a brain-dead PSP. The heart works, but the head is empty. I'm still thinking of an explanation why it quit on me like that, all of a sudden.<br /><br />I guess now I have to decide to give it a new lease on life, or let it go.<br /><br />There is the third option to gut it and make a crude display adapter for it, or turn it into a digital frame. Good luck with thatEnderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com1tag:blogger.com,1999:blog-565966936284948595.post-50435533293369359322008-09-29T05:11:00.000-07:002008-09-29T06:27:31.367-07:00Woe is meYesterday my girlfriend was towing me around while looking for a new pair of shoes, and while we were in one store, I plopped down on a sofa and whipped out my almost 1-year old PSP.<br /><br />I was playing N+, and all of a sudden the unit just... died.<br /><br />I thought, <em>ok, it's just the battery, but I just charged it, so maybe its that RemoteJoyLite plugin -- it's always crashing --, I'll just do cold boot</em>.<br /><br />So I tried pulling the power switch up for ten seconds. The power LED turns green for a few seconds, then dies. I try it again. The same thing. I have never seen a bricked PSP before, but I hope that that is all it is - a corrupt firmware.<br /><br />When I got home I try to plug in the AC adapter, to no avail. I went as far as disassembling my PSP. I got as far as removing the LCD frame, but it was almost morning and my girlfriend has work early, so after a few tries I finally got the PSP back together.<br /><br />Right now I have my PSP with me, at the office. I was hoping to borrow somebody's PSP and make a Pandora battery.<br /><br />I already have the magic memstick, so unbricking is my last course of action before having the unit fixed (which will cost me the half price of second-hand PSP phat, at least, that's what replacing the motherboard will cost me)<br /><br />But in my rush not to get to work late, it seems I left the magic memstick at home, bugger that.<br /><br />The thing is, I haved dropped my PSP (from about 1 foot), and it did fall a bit hard -- hard enough to somehow get the battery cover lock out, but still leave the whole PSP <em>and </em>battery cover lock mechanism intact.<br /><br />I really wouldn't want to lose my PSP. It's almost a part of me, and 1 year isn't good enough for me to say goodbye to it yet. If I ever resurrect it I promise never to drop it, ever again.<br /><br />I feel guilty for shelling out some money to fix it after my girlfriend has repeatedly told me how badly I treat it, I almost feel like I <em>don't </em>deserve to have it fixed.<br /><br />But leaving it broken just doesn't feel right... and if it could never be fixed, I would at least like to scrap the LCD and build a driver for it, turn it into a digital frame or a mini monitor. Good luck with that though - Alexan doesn't even stock up on PICs, much less FPGAs.<br /><br />If anyone has a phat compatible motherboard to sell (for cheap), let me know?Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com0tag:blogger.com,1999:blog-565966936284948595.post-49837760969956974652008-07-15T07:02:00.000-07:002008-10-03T03:53:07.841-07:00My new toyMy girlfriend got me an early gift for my birthday.<br /><br /><img src="http://www.cise.ufl.edu/~brossen/ve/images/wiimote.jpg" /><br /><br />Yeah. No. Not a Wii, just the Wiimote.<br /><br />I've been pining for one for the past few months, comparing everything to the price of a Wiimote, and she finally caved in and decided to get me one.<br /><br />She probably didn't see the point in getting a Wiimote without the console, but I've been watching those videos and drooling with envy at the all geeky things you can do with a Wiimote and a PC with a Bluetooth adapter.<br /><br /><b>Installing the damn thing</b><br /><br />My Bluetooth adapter is the cheapo Billionton BT-dongle that seems to do the job well enough.<br /><br />It comes with IVT BlueSoleil drivers. My first try with this set of drivers kept me awake for most of the morning. The Wiimote was being detected, but GlovePIE and Wiinmote refused to detect it.<br /><br />I got a copy of the BlueSoleil drivers v1.6.2.1, and these worked fine, but since my dongle was detected as an unlicensed device, I was only limited to 5MB data transfer before needing to restart BlueTooth.<br /><br />GlovePIE and Wiinmote worked perfectly here, and before long I was playing TrackMania Sunrise with the Wiimote as a steering wheel,<br />and Portal with some difficulty.<br /><br />Before long I exceeded the 5MB limit and my game of Portal was abruptly halted due to lack of control. This wouldn't do.<br /><br />I finally tried going back to a newly downloaded copy of v1.6.1.4, and now BlueSoleil is not complaining about about an unlicensed device, while GlovePIE continue to work happily.<br /><br />To get everything working you will need:<br /><br /><ul><br /><li>A BlueTooth dongle (BillionTon was used here)</li><br /><li>Bluetooth drivers (BlueSoleil v1.6.1.4 was used here)</li><br /><li>GlovePIE v???</li><br /><li>PPPJoy</li><br /><li>Some patience</li><br /></ul><br /><br />I'll not post complete instuctions on how to set things up here. Google can help you find that.Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com0tag:blogger.com,1999:blog-565966936284948595.post-26992100288543643492008-06-10T18:26:00.000-07:002008-10-03T03:54:16.982-07:00Nostalgia Hack - Super UFO<div style="TEXT-ALIGN: center"><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVixRJxhxKHh2MoAmub3UlslWMyfzaEnT9T3FxouX1pLHPPQSl71HZzGcOrTC0lm-HRnoCeq_5jpKwn36NFdY7Wa5f8QjIRyRXDMM5M3AOJskxWMNYDZqu_VXRLxijaeuse268YI4DRVo/s1600-h/ufo1.JPG"><img id="BLOGGER_PHOTO_ID_5210430135677437810" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: pointer; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVixRJxhxKHh2MoAmub3UlslWMyfzaEnT9T3FxouX1pLHPPQSl71HZzGcOrTC0lm-HRnoCeq_5jpKwn36NFdY7Wa5f8QjIRyRXDMM5M3AOJskxWMNYDZqu_VXRLxijaeuse268YI4DRVo/s320/ufo1.JPG" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI28sj5dJ9t9yhl9Bl8nqQgL7mq-1L_-0xTVS16aru-Hb7iiiUxQls3v6k4yuGEeXjG3cNa0fFWzXBrRbIaitXZMJ0BI1q8ROy3wM36f3HWVDmv4eDVK16TUiZ2THbvg4iPCZucniGM5c/s1600-h/ufo2.JPG"><img id="BLOGGER_PHOTO_ID_5210430297457401858" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: pointer; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI28sj5dJ9t9yhl9Bl8nqQgL7mq-1L_-0xTVS16aru-Hb7iiiUxQls3v6k4yuGEeXjG3cNa0fFWzXBrRbIaitXZMJ0BI1q8ROy3wM36f3HWVDmv4eDVK16TUiZ2THbvg4iPCZucniGM5c/s320/ufo2.JPG" border="0" /></a><br /></div>This is a fairly useless hack - it simply makes the copier ROM playable on an emulator.<br /><br />I did it for the nostalgia - the SNES unit my brother bought had a Super UFO. Needless to say, many summer nights were spent loading up games from this copier's menu.<br /><br />What I did was basically NOP out instructions that were causing infinite loops, these were most likely disk access checks. I was also having trouble getting the sound to work until I discovered a routine that for some reason was copying the sound init code to non-existant memory (probably on-board custom RAM)<br /><br />Strangely enough the code wasn't exactly self-modifying and could have been called from ROM instead, which is what I did.<br /><br />The patched ROM doesn't play music initially for some reason - I might have NOPped out a bit more than needed - but the music can be set through the menu.<br /><br />As I said, this is a fairly useless hack. If you never owned the Super UFO you probably won't appreciate this.<br /><br />You nostalgic nerds can <a href="http://www.sendspace.com/file/afn08e"></a><a href="http://www.sendspace.com/file/afn08e">download the patch and ROM</a> here.<br /><br />UPDATE:<br /><br />Found the problem why it wasn't working on Snes9xTYL for the PSP. Looks like there was a difference in what value was returned when reading from an undefined port in the different emulator versions.Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com5tag:blogger.com,1999:blog-565966936284948595.post-69859326059061629212008-03-20T10:41:00.000-07:002008-10-01T06:30:05.514-07:00LCD Monitor TroublesRemember my 19" Hanspree LCD monitor I got last Christmas?<br /><br />Just today I noticed that it was developing horizontal streaks across the screen towards the right especially during sharp brightness level changes.<br /><br />I was at work when Frans told me it was getting really bad, so I Googled and found an article that said frame rates above 60Hz weren't good for LCDs, so I had her reset it from 75 to 60. It seemed to fix it a little bit, but the streaks were still there.<br /><br />In desperation I asked her to secure the monitor cable at the back of the LCD and the PC. She did so for the back of the LCD, and the problem went away.<br /><br />Or so I thought...<br /><br /><strong>UPDATE:</strong><br /><br />The source of the problem was a loose AC power cord. Some arcing was probably messing up the timing circuits and causing the streaks. After securing the power cord, the screen was back to normal.<br /><br />PhewEnderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com0tag:blogger.com,1999:blog-565966936284948595.post-45906330925533418272008-03-20T06:41:00.000-07:002008-03-20T06:50:39.277-07:00Steampunk CalculatorThis isn't technically steampunk, nor was it invented in Victorian-era England, but with a few brass trimmings, it would fit right in. And...<br /><br /><br /><br /><br /><a href="http://www.vcalc.net/images2/curta.gif"><img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://www.vcalc.net/images2/curta.gif" border="0" /></a><br /><br /><div></div><br /><div>...It could fit right in your pocket!</div><br /><div></div><br /><a href="http://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Curta01.JPG/250px-Curta01.JPG"><img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Curta01.JPG/250px-Curta01.JPG" border="0" /></a><br /><div></div><br /><div></div>Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com0tag:blogger.com,1999:blog-565966936284948595.post-69647295882571215252008-03-14T23:03:00.001-07:002008-10-03T03:55:41.833-07:00Willow Hack - Almost ThereThe main part of this hack - setting aside some SRAM to save to and load from, the actual routines for accomplishing this, and the basic interface to select from 3 slots where to save or load - is complete.<br /><br />I still need to write a routine that displays Willow's stats for each save game, and do something better than SELECT+B in order to access the save menu. There is also a bug where the background music isn't restored after leaving the save menu.<br /><br />I also did a few kludges to make things work, such as shamelessly copy/pasting some code from other parts of the code without knowing exactly what the function calls did. Seems to work fine though.<br /><br />I also need to check if I've overwritten any code that shouldn't be. Fortunately (I noticed) the assembler does export symbols from the source. This means that any labels I've used in the source code are noted down along with their memory locations in the ROM. By placing labels at the end of functions and data tables, I can compare with the original disassembly and find out if I've overrun any code.<br /><br />I also noticed and rooted out a little bug where the stack head kept moving up after selecting continue. Turns out the original code forced a stack reset which I failed to include (yes, copy/paste). Although there seemed to be no ill effects right off, it might have caused problems after the player continued 20 or so times.<br /><br />However aside from the savegame text and a few bugs, there are a few things I want to add before I call this patch finished and release it into the world.<br /><br />I want to add the name of the area into the save game, just so the player knows more-or-less where he left off, and a percent complete value would be nice. I suppose the calculation for percent completed would be computed from the items Willow has acquired. Then there's a minor hack to the saver/loader routines which should use a checksum to verify if the savegame is valid or corrupt.<br /><br />One last thing, I'd like to add my name into the credits on the PRESS START screen, but the data is tightly packed with no free memory right after it, so my last hack will entail either moving that bit of data into some place more agreeable, or add and extend the "string" writing code to allow jumping to another location in memory. Right now I've just shamelessly replaced the TM & © "LUCASFILM" with "ENDERSOFT".<br /><br />For now, here's what the selection screen will look like. The data is actually a mock-up - no values are read from SRAM - but the screen is actually running off the emulator (i.e. no Photoshop tricks)<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjoPCO5jZNGo7CmngbGm_JX5pveU-4EVVXcgwc2cYvYM-8ZImWc_4Ut8ijn5kNdO2BZZbkHyhApOFymqbvy-1i_kv-Gg7K6IWz3TbjTx34-_iPFMFn_RYtiotUUHYjkOY8S9fEVYO2WxQ/s1600-h/loadscreen1.JPG"><img id="BLOGGER_PHOTO_ID_5177845339763085794" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: pointer; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjoPCO5jZNGo7CmngbGm_JX5pveU-4EVVXcgwc2cYvYM-8ZImWc_4Ut8ijn5kNdO2BZZbkHyhApOFymqbvy-1i_kv-Gg7K6IWz3TbjTx34-_iPFMFn_RYtiotUUHYjkOY8S9fEVYO2WxQ/s320/loadscreen1.JPG" border="0" /></a>Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com2tag:blogger.com,1999:blog-565966936284948595.post-44181536284651831882008-03-10T01:19:00.000-07:002008-10-03T03:56:07.621-07:00Willow Hack NewsI'm in the middle of unraveling the code to draw the backgrounds used for the START and PASSWORD screens.<br /><br />Interestingly, it uses the same routines for drawing the in-game backgrounds. This is the background you see when walking through the game as Willow.<br /><br />Now this routine uses two variables to specify what background is loaded to be scrolled into the screen while Willow walks to the edge of the visible screen.<br /><br /><ul><li>Each variable seems to change independent of each other</li><li>One variable changes if Willow walks out the top/bottom of the screen, I designate this as mapY.</li><li>The other variable changes if Willow walks out left/right of the screen, I designate this as mapX.</li><li>The variables don't seem to be a direct index, as useful values seem to be in the 1A-1F range.</li></ul><br />The "coordinates" for the START screen is (1A,1E). I'm not sure where the password screen is stored yet. When switching to the password screen, no backgrounds are drawn (i.e. the code for drawing backgrounds is not called). Instead, the code merely switches the active nametable implying that the password screen is already drawn into memory.<br /><br />So far I've determined that these values decode into a memory address where the code picks up another byte that decodes into <em>another </em>address, which is where the char which will be copied to the nametable is stored. I still haven't fully decoded the routine, but it's another step towards finalization.<br /><br />I think it uses some form of compression in order to save space, as the routine seems to read from certain locations multiple times, instead of simple packed data. It is probably RLE, which would be ideal given the repetative nature of the backgrounds.<br /><br />Meanwhile, I think I should focus on what can be done, which is implementing the load/save screens - sans backgrounds - and adding support for multiple saves.<br /><br />I just feel so close to understanding how it works that I don't want to let it by.Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com0tag:blogger.com,1999:blog-565966936284948595.post-50611292960666049482008-03-05T05:23:00.000-08:002008-03-05T05:36:43.042-08:00Willow Hack: UpdateRemember how I said I wanted a feature to "skip" the dialog in WIllow? I really meant, make it print faster. Well, I was looking through the code today, trying to make sense of it all when I came upon some code that seemed to be reading the joystick in the dialog routine.<br /><br /><em>Aha! </em>I thought, and noticed that the bit being tested was the one for the up button. That's when I "remembered" that in order to speed up the dialog you had to hold Up on the D-Pad. I thought this "Up" business to skip dialog was a bit silly when it's almost universally held that the B button was for "cancelling". So I remapped it to B.<br /><br />I also stumbled upon how it draws text to the screen, and isolated a function call that seems to draw the background.<br /><br />A little more work will be needed disassembling all this twisting code before I can figure out how it does the backgrounds. When that's done, I can be on my way to writing the Load / Save screens, and making this Proof-of-concept a full working patch!Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com0tag:blogger.com,1999:blog-565966936284948595.post-31730458959854550962008-02-29T01:38:00.000-08:002008-10-03T03:55:30.573-07:00Willow Hack PoC complete!My Proof-of-concept hack is done, and I now have a Willow ROM that allows saving current progress by pressing SELECT-B and resuming the saved game by selecting PASS WORD in the opening screen or CONTINUE after losing all your HP.<br /><br />So far the hack works well on FCEUltra. I tried on NesterJ for the PSP but it crashed every time I tried to save my progress. Maybe it doesn't have support for battery backed RAM?<br /><br />On a side note I called in sick, because I'm feeling really lousy, but apparently not enough to stop me from sitting in front of my PC for 6 hours straight.<br /><br />Right now I'd like to change the intro screen text to "CONTINUE" instead of "PASS WORD", but I really should be getting some rest.<br /><br />Once I figure out how the screens are set up and how text is drawn I'd like to put int a real save game selection screen, with allowance for 3 save games, showing info about each save game.<br /><br />UPDATE: Just tested it on NesterJ version 1.20 beta, and it works perfectly! The version that the hack wasn't working with was 1.1 RM.<br /><br />Download the patch and source <a href="http://rapidshare.com/files/96100577/WillowPatch.zip.html">here</a>Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com1tag:blogger.com,1999:blog-565966936284948595.post-34745395584137934832008-02-28T02:26:00.000-08:002008-10-03T03:51:52.419-07:00Willow Hack NewsI'm using a cross assembler for the SNES, but since the 65816 processor mostly extends the 6502, getting it to work for this project was easy.<br /><br />Well, mostly.<br /><br />I spent most of the morning trying to get the assembler to produce a valid IPS file, but I'm glad I did.<br /><br />The samples I downloaded for compiling SNES patches from asm files had scripts for checking addresses when creating patch files.<br /><br />I was getting symbol not found errors when trying to subtract a hex address from a variable, but had no problems adding (or any other operation, I suppose).<br /><br />The error went away when I decided to use base 10 to represent the value I was trying to subtract.<br /><br />So, instead of<br /><br /><br /><center><br /><span style="font-family:courier new;font-size:85%;">@STEP2 = @STEP1 - $C000</span><br /></center><br /><br />It was<br /><br /><br /><center><br /><span style="font-family:courier new;font-size:85%;">@STEP2 = @STEP1 - 49152</span><br /></center><br /><br />I decided to hijack the password routine and copy a bit of code from the "new game" routine. For now I just loaded up the SRAM with some default values.<br /><br />It almost worked.<br /><br />I had a black screen with Willow in it. Switching to inventory and back brought the screen colors to life but the palette seems messed up, though I think I have some idea of how to fix this.<br /><br />With the code analysis practically complete and most critical variables identified, I can now focus on writing code. The assembler/patcher toolchain makes things much easier as all I have to do is edit the assembly code and re-run my compiler script.<br /><br />Already I'm halfway to my goal of a Proof-of-concept hack, with a full hack not too far off.<br /><br />Although state-saves have all but made this hack useless, it's been a fun ride. Maybe I'll put a little how-to together, for the sake of posterity.Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com0tag:blogger.com,1999:blog-565966936284948595.post-3681156061668814202008-02-26T06:44:00.000-08:002008-10-03T03:55:16.427-07:00Useless Hacks UpdateI have managed to isolate most of the code that takes up the password entry, testing and stats loading for the NES game Willow. I've also identified where stats are saved in memory, how Willow's map and screen position is stored, and the all-important events and inventory flags.<br /><br />Coding a replacement function that will load data from SRAM should be pretty easy, and free up a lot of ROM space in the process.<br /><br />I have yet to figure out how the screens are loaded, so I can load my own custom save game screen, but that's not really part of the Proof of Concept hack.<br /><br />Just to make things interesting I'll change the PASS WORD text into LOAD GAME.<br /><br />That's the easy part.<br /><br />Saving for my PoC requires me to tap into the main game joystick routine and save everything to RAM once a combinaion (SELECT+B) is pressed. However in a real hack it'd be nice to have save points.<br /><br />Adding code to a NES ROM is a bit more problematic because of it's memory restrictions and the memory mappers designed to handle this.<br /><br />You can't just add code to another bank if the original bank doesn't have any space to give up. Since only one bank is mapped at any time, you'd have to push some registers or save in RAM and switch banks to run code from another bank.<br /><br />I hope to do the loading code tomorrow, that is, if Patapon doesn't distract me long enough.Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com0tag:blogger.com,1999:blog-565966936284948595.post-70191524167470929802008-02-26T06:20:00.000-08:002008-10-03T03:54:36.902-07:00Last farewellA faint sensation, not altogether unpleasant, a feeling of coldness deep inside, while bathed in the warmth of a setting sun, while looking out upon a tower white cliff to a golden orange horizon, with feathery clouds lost in the distance.<br /><br />A sadness that resembled a deep yearning for something that would, now, be forever out of reach, threatening to drown me in a torrent of tears. I was borne aloft only by the unending beauty of all that I had seen and experienced in just my two visits to this world, and yes, this beauty also brought tears to my eyes.<br /><br />I felt Aslan's hot breath upon my back as I gazed for one last time upon my beloved Narnia.<br /><br />It was bittersweet... yet somehow... perfect.<br /><br /><span style="font-size:78%;">The last sentence was paraphrased from an interview with Anna Popplewell, regarding the film Prince Caspian being her last for The Chronicles of Narnia, and was the inspiration for this entry.</span>Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com0tag:blogger.com,1999:blog-565966936284948595.post-75463307674031603102008-02-06T09:23:00.000-08:002008-10-03T04:19:01.996-07:00NES Hacks: Coin TricksHere in the Philippines, we had the Japanese version of the Nintendo console, known as the Family Computer (aka Famicon), instead of the dull-grey clunky unit with excessively large cartridges known as the Nintendo Entertainment System.<br /><br /><br /><br /><br /><p><a href="http://upload.wikimedia.org/wikipedia/commons/5/54/Famicom.jpg"><img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://upload.wikimedia.org/wikipedia/commons/5/54/Famicom.jpg" border="0" /></a><br /><br />The Famicon design featured joysticks that were permanently connected to the console and had a port at the front which was used for the optional light gun. This port was usually covered by a red plastic cap when not in use.<br /><br />There was something mysterious about that port. It has little pins in it, and wat I remember is that my uncles and cousins would take a 10 centavo coin and run it across the ports pins with Contra plugged into the game slot and the unit turned on. After a few tries they would get a level select screen.<br /><br />It's a wonder how anybody figured out how to do this trick, let alone that it worked at all. The regular way to do this utilizes a variation of the Konami Code.</p><p align="left">It would be real nice if someone could come up with a solid explanation of why it works. Unless someone already has, and I haven't found the right keywords to google it.</p>Enderhttp://www.blogger.com/profile/13050783166384547480noreply@blogger.com1