Jump to content

EricBall

Members
  • Content Count

    2,361
  • Joined

  • Last visited

Blog Entries posted by EricBall

  1. EricBall
    Last night I posted my sprite video driver to the Prop forum, complete with demo (a bouncing beanie which explodes into individual sprites). Screen capture in MPEG2 of first 20 seconds: ntsc240h.zip
     
    So far, I've had two comments - one attaboy & one not-very-useful. (The latter obviously can't see the videogame potential.) But like the circus bugs in "A Bug's Life" I crave applause. I want that feedback!
     
    Sigh... other Prop projects I'm considering:

    PWM based waveform generator
    single pin NTSC text display driver
    IF_NEVER timing tests
    Extend NTSC240H to have background tiles too

     
     
    I also have Leprechaun & SpaceWar! 7800 to finish. Getting back to these means relearning my own coding, a daunting task.
     
    I also need to get the "new" PC for my Tempest cabinet working, and one of these days (maybe this summer when my Dad is in town) make some progress on my MAME cocktail cabinet. Oh, and how can I forget - I need to build a wideband Grey Hoverman antenna and mount it outside for better OTA HDTV reception. (I get 6 US networks and 6 Canadian networks all in full HD with my quick and dirty GH antenna in a 2nd floor window!)
  2. EricBall
    On the Prop front, I now have 2 to 5 COGs happily working together, alternating lines to produce a stable static screen. This is very, very cool (for me).
     
    Next steps:
    1. (Easy) fold the blank line code into the active line code. Every bit is sacred!
    2. Put back in the sprite -> lineRAM code.
    3. Create a demo to show it all off.
     
    And... that'll be about it, just ready for release. Which brings me to my topic question - Software licenses.
     
    What I want to do is release the code in such a way that others may use it or modify it, but give me credit. Is there a well known license which accomplishes this?
  3. EricBall
    After a long hiatus, I'm tackling my Propeller video driver. I think I figured out why my previous attempts didn't work. First, there were some technical issues with synchronization of the cogs which I now think I understand. (Plus Chip, the head honcho, has given the step-by-step instructions on what needs to be done.) But the bigger problem is I tried to do everything at once. I was trying to achieve too many new ideas at the same time. So when it didn't work, I didn't have
     
    So this time I'm starting with producing video using a single cog. I've stripped down my old driver, removing as much complexity as possible, i.e. static data in the lineRAM, static startup, etc. Just the minimum required to feed the video driver.
     
    And it works . . . sorta. The screen is stable on my TV, but there's no color - just a wierd dot pattern. Hrmm.... maybe my frequency calculations are off - that would explain it. Nope, or at least it doesn't seem wrong. So I changed the static data to just product vertical lines. And it produces vertical lines, but the wrong number. Either my TV has some wicked overscan, or I've messed up some calculations somewhere.
  4. EricBall
    My home PC is old (Athlon XP) and yet I'm not craving an upgrade.
     
    It wasn't that long ago (ie when I bought my home PC) when I would spend time reading about the latest hardware and coming up with a wishlist. But now I look at the PC market and wonder when (or maybe if) I'll bother upgrading.
     
    Sure, if I was to buy a new PC some tasks (video encoding) would take less time - but I can live without (let it run overnight). And I'd be able to play the latest and greatest games - but I don't have copious amounts of free time to spend playing games, and if I want to play games it would be cheaper to buy a console. New apps? Nope, the ones I have work just fine. Vista? Don't make me cry. Umm.... and why do I need a new PC?
     
    On the other hand, I could see spending money getting a 40" LCD HDTV and Blu-Ray player.
  5. EricBall
    Winter makes me glad to have a garage to park in. No scraping ice & snow in the morning. And I've learned to back in so I don't have to change direction if the laneway hasn't been plowed.
     
    And there's the rub. In my old car, a Plymouth Acclaim, I could see the rear corners but I'm having a devil of a time with my new Corolla. Although I can use the side mirrors to make sure I don't scrape the sides, it takes me several tries to get squared up.
     
    So I was wondering if I could rig some kind of laser guidance system. There are some on the market, but they all seem to be downward pointing, putting a spot on your hood or dash so you know when you've pulled in far enough (but not too far). I'm thinking more of something which shoots straight down the middle of the garage so I can line up the car along the centerline. Maybe wave the beam up and down so it's not just a single line, but kinda draws a line of light through the vehicle. Maybe something like what they use for power saws.
  6. EricBall
    The head honcho of my department has decided he no longer wants to fund the public area meeting room he inheritted. In the room are a pair of 15 year old ceiling mounted Electrohome ECP-4101 front projection CRTs. There's a high probability that I could take them myself if I asked nicely. (Otherwise they will probably be scrapped.)
     
    Now, in spite of their age, they probably have been used very little. So I doubt the 7" tubes have been used up. They were also high-end data projectors for their day with 1280x1024 resolution, which translates into (almost) full HDTV capabilites.
     
    So why haven't I jumped at the chance?
    1. The dang things are big, heavy & ceiling mounted. So I'd need to somehow rope in 2-3 other people to unbolt them from their ceiling mounts and get them out to the car.
    2. They only have RGB BNC inputs which will make it more difficult to interface with source equipment. (Although it should be possible to connect a PC via a VGA to BNC cable.)
    3. Although I've found the service manual online, and having two means I might be able to swap out failed parts, I'm not sure I have the time or ability to do my own repairs.
    4. Did I mention they are big & heavy? And it's not like I have the space to put them in the house.
     
    But dang, free HDTV displays!
  7. EricBall
    Last night I replaced the hard drive (which had died) & battery in my wife's iPod color. So now she's happy again. Plus I upgraded the drive from 20GB to 30GB and replaced the faceplate with a brand new glossy black one (from the U2 model).
     
    The only difficulties were finding a Torx T6 screwdriver (well, not that hard, but I think only one multibit at Home Depot had it) and prying open the case. (It looked much easier in the how-to video.)
     
    Oh, and I did manage to install Win2K onto the TP760ED and it's been quietly (heck, it's silent except when it's actually working) running for almost a month. My only mistake was partitioning the drive rather than sticking with a single 4GB partition, which made installing the SP tricky. (I had to partition to try to avoid some bad blocks on the drive.) When the drive dies I'm going to put in a CF adapter and a 4GB CF card.
  8. EricBall
    I love eBay. Where else can you easily buy something like a 25' headphone extension cord dirt cheap? Yeah, there might be a local supplier but I have no idea how to find them. And places like Radio Shack will charge you the item's weight in gold. It's the long tail idea.
     
    And why did I want a 25' headphone extension cord? To connect my old TiVo on the first floor to a computer in the basement via it's serial port to retrieve guide data. So now I can use the TiVo's far superior search & record capabilities to record stuff off digital cable. Previously I had to use the STB's clunky & clumsy interface to select shows to record (then set up manual recording on the TiVo side).
     
    My next trick is to install Win2K on an old Thinkpad 760ED. Hopefully it will be more stable than the MediaGX PC which I'm currently using as a PPP gateway.
  9. EricBall
    After much procrastination, I now have potatohead's Propeller Demo Board working. Of course my super-duper display driver doesn't work yet, but now I can do my own debugging.
     
    I am now the proud owner of a Dell 1320c color laser printer. I got tired of the ink drying out in my inkjet ('cause I don't do that much printing at home) and the Dell had the lowest consumable cost. So although I could have gotten the HP 1600 for $100 less, I save that much on the first set of toner cartridges.
     
    It also appears SchedulesDirect is now down to $20/year and the code gurus have figured out how to get a TiVo gateway working with it. So now I'm trying to figure out how to get a serial connection from my family room to the basement so I can hook up my old TiVo. (My new S2DT is about to get very busy with the fall season. I think both tuners will be going full blast between 8 & 10 PM most weeknights.) The idea solution would be some kind of wireless RS-232 transceiver, but I haven't found anything really cheap. (Then again, $50 versus drilling holes or pulling cables, hmm...)
     
    I also need to figure out how to relay the IR remote to the TiVo which is above & behind the TV. (So you have to put your arm up when sitting on the couch.) Maybe I can jury-rig something with some fibre optic cable. I found a website where I guy used it to turn an IR camera remote into a cable release.
  10. EricBall
    I shoulda posted here earlier (since the first episode was shown this past weekend) but it's never too late to get started.
     
    Anyway, if anyone is into anime / cartoons / animation then you really should watch Skyland (Weekends @ 7:30 on Teletoon in Canada, also on one of the Nick stations, and probably also some over in Europe). The quality of the animation (particularly the backgrounds) is equivalent to the big screen anime of Studio Ghibli (Howls Moving Castle; Spirited Away) or Akira. Note: the wallpapers on the official websites don't do the backgrounds justice, but there are some screen captures if you go hunting. The character animation is done in a pseudo CGI / cell / flat shaded which works surprisingly well. The story, so far, is interesting. I'm hoping they can go deeper than the simple good guy / bad guy.
     
    My wife (who enjoys anime, but isn't a fan) complains that the shows are only 30 minutes. She wants more. Watching B5 was like that, we hated seeing the credits roll; knowing that we'd have to wait another week for the next episode.
  11. EricBall
    I have a love / hate relationship with some games. I love playing them, but I hate how much time I spend on them. Time which I could be spending working on other projects or, in some cases, sleeping.
     
    This summer I played HalfLife into the wee hours of the morning the night before I needed to leave for the airport at 4 AM.
     
    This past Friday I played Civ3 past midnight even though I started the day at 4:30 AM and had a 9 AM meeting the next day. Last night it was only through a great force of will that I stopped playing Civ3 last night at 9:30.
     
    Tonight I can't wait to get home to complete my conquest of the Roman empire.
  12. EricBall
    I played Wolf3D when it first came out. I played DOOM and DOOM II when they first came out. But when Quake came out my home PC no longer had the necessary horsepower. Thus I was pushed off the FPS bandwagon (except for Goldeneye). I also no longer had the time and desire to dedicate to playing games. And online has little appeal to me. But then I saw Half Life athology in the bargain bin at the grocery store. I resisted for a long while, but I finally couldn't say no to $10. At one time I played a Half Life demo (although it wasn't part of the full game) and I remember my surprise and panic as I saw a couple OpFor grenades arcing towards me. That simply wasn't something I'd seen before in an FPS. A lot of Half Life is like that - surprise and panic. You hardly ever feel safe, danger is always lurking around the corner. Sound plays a big part - you hear those enemies plotting as they lie in wait. (You can even identify what enemy and where as the sounds are in stereo.)Those pesky grenades are another source of panic. You think you're sneaking up under cover when you hear “Fire in the hole!”Finally there are the scripted encounters which can drop a monster on your head or the floor from beneath your feet. It also means enemies can appear in areas you previously completed. So you're seldom safe. The enemy AI is also reasonably smart - running away and taking cover instead of just blindly charging into your line of fire. They do occasionally misthrow their grenades. Of course the great thing about Half Life is the storyline. This isn't just a simple run & gun. You have a destiny and your enemies are there for a reason. There are also friends along the way to assist you and for you to protect. And unlike previous FPSs, there are no distinct levels (although your path is generally linear), instead the game gives the illusion of one giant level with very short auto-load points. You can also save your game at any time. (Save early, save often.)Your arsenal grows over the game, although there seldom is enough ammo. (Or power for your armor.). About the only stinker is the OpFor rifle which is inaccurate and doesn't do much damage per hit. The pistol is more accurate and the shotgun does more damage.One other item about ammo. Not only do you have to watch you ammo, but also how many shots you have left in the clip. Reloading also takes time. And if you change weapons with a partial clip, that's the way it comes back. In addition to various enemies, there are various puzzles which must be solved along the way. Most are easy to figure out. Otherwise there's gamefaqs. There are also a few jumping puzzles - thank goodness for quicksave. Well worth the $10 and the hours.
  13. EricBall
    If I'm not careful, my wife is going to kill me. My original idea was to create some favorite eBay searches for the top-rated kid-friendly N64 & GCN games which I didn't already have. My price point is C$10, including shipping (which typically doesn't leave much for the game). I've picked up: Blast Corps, Rayman 2, Rocket: Robot on Wheels, and Star Wars: Shadows of the Empire (not kid friendly, but one I've wanted since I rented it a long, long time ago).
     
    Unfortunately, it looks like I was outbid on Castlevania: Legacy. Oh, well... I guess I'll just have to wait a while longer. That's one thing I've learned about eBay - if you're cheap, you also need patience.
  14. EricBall
    Monday my wife declared my son's piggybank to be finally full and started sorting and rolling. In all, it was over 40lbs and C$800 (those $1 & $2 coins add up quick) which will be added to his university account. But there was also over C$200 in paper money, which he has earmarked for buying a Wii. Unfortunately, the cost of the system plus one game (and tax) will cost C$400. So I guess he still has some saving to do. (Which he will probably accomplish in a year or so as he rarely spends his allowance.)
  15. EricBall
    One of the things I did while visiting my in-laws was to do some cleanup of their computer. In spite of having the McAfee suite, they'd managed to pick up a bunch of malware. I suspect it started with some kind of "free" download which installed a toolbar or taskbar tool, which then installed something else . . . and next thing you know they're getting random pop-ups and error messages.
     
    Anyway, I'm wondering if anyone has ever found a sensible guide to safe computing? Not just "install anti-virus*, anti-spyway, system updates", but behaviour rules of thumb. And websites with solid info on anti-spyware software, not just regurgitated press releases and links to malware in disguise?
     
     
     
     
    * I firmly believe that true viruses are virtually extinct 'cause they don't spread fast enough and generate $$ for anyone except the anti-virus sellers. My home PC has run without anything more than my NAT router/firewall and MS utilities for almost a year.
  16. EricBall
    Have you ever played a game and wondered whether you bought the same game as reviewers? Super Monkey Ball 2 is like that for me.
     
    Another one of my cheap bastard eBay purchases. I don't have Super Monkey Ball 1 yet, so I can't compare the two. But I'm glad I only paid $10 for it.
     
    Maybe it's because I'm playing the single player story mode instead of the multiplayer games. Or maybe the reviewers only played the first ten maps and cribbed the rest from Super Monkey Ball 1. Who knows?
     
    The problem I have with Super Monkey Ball 2 (story mode) is the level of difficulty. We're talking having to play a map dozens of times before catching that lucky bounce. And the way story mode is structured, you have to finish all ten maps in a level before you get the next cut-scene and onto the next level of ten maps. And more often than not, it's luck, not skill, which is the difference between success & failure. The only saving grace (or is it a curse?) is you have infinite lives to attempt each map. (There's another single player mode where you have a finite number of lives to play through the same maps (plus some bonus maps) in a set order and without the cutscenes.)
     
    Two examples:
    The main feature of the map is a tall cyndrical tower with a flared base. The finish line is on lying on top of a small platform circling near the top of the tower. At the bottom of the tower are four kicker blocks. So the idea is to position your Monkey Ball in front of one of the kicker blocks, which will then shoot you up the side of the tower. The problem is you have virtually no control once that kicker block fires. Just landing on top of the tower ('cause you can't even to the finish line on the way up) is maddingly difficult and a stroke of luck. Bit then you have to time your roll off the edge so you fall through the finish line.
    More than one level puts a web of holes to fall through between the start and finish. If Super Monkey Ball 2 was a game of skill, you'd have to pick your route and carefully manuver yourself between the gaping holes. But the timer is far too short and the pathways too narrow (believe me, I've tried). The alternative is to send your Monkey Ball careening at top speed to fly off either a bump or the far edge of a hole then catch a lucky bounce that doesn't send you plunging through a hole or off the edge of the map. And forget about trying to stop and maneuver your way through the finish gate, you've got too much speed - that's another lucky bounce you need.

    Other complaints:
    no way to jump, so even the smallest bump or edge becomes a major obstacle
    after you have completed a map in stroy mode there's no way to go back to try to improve your time or pick up more bannanas (which typically get ignored to reach the finish)
    multiplayer games are opened by accumulating "play points"

    Now, the multiplayer games may be heaps of fun, and Super Monkey Ball 1's story mode might be actually fun to play. But, at this point, I've given up on the story mode of Super Monkey Ball 2 - it's just too hard to be any kind of fun.
  17. EricBall
    Although it's no Zelda OoT, I'm quite enjoying ripping through Star Fox Adventures.
     
    the bads:
    #1 Exit doesn't save, or give the option to save! (I lost an entire stage discovering this.)
    #2 Very linear. There's one path through the game and very few (and very short) side stories. In most cases it's pretty obvious where to go & what to do.
    #3 Although the manual seems to suggest a complex attack system, it really comes down to A-button mashing while wiggling the control stick. (Although it's far easier to freeze the biggest SharpClaws than to find that first hole in their defense.) Plus, there's no combat tutorial.
     
    the goods:
    #1 Save anywhere, anytime - although the restore brings you back to an earlier point.
    #2 Hints from Slippy & Peppy for when that path isn't obvious. (Although this does make the game even easier.)
    #3 Fox's expressions
     
    I was able to pick it up for $10 (including shipping) on eBay. Definitely worth it at that price.
  18. EricBall
    My Propeller video driver is almost done, but I've run into a snag. The following is a snippet from the pixel byte to long lookup routine.
     

    SHR sprgfx1, #8 ' shift byte into position MOV sprbyte, sprgfx1 AND sprbyte, #$0FF wz MOVS :byte6, sprbyte ' update source pointer MOVD :byte6, sprdata ' update destination pointer ADD sprdata, #1 :byte6 IF_NZ MOV sprdata, sprbyte ' copy color lookup table entry to lineRAM SHR sprgfx1, #8 wz MOVS :byte7, sprgfx1 MOVD :byte7, sprdata :byte7 IF_NZ MOV sprdata, sprbyte ' won't work due to pipeline DJNZ count2, #:nxtspr ' decrement active sprite counter JMP #doblank ' max number of active sprites reached :nxtspr ADD sprptr, #4 DJNZ count1, #:loop ' 48+16+223 = 287 (288) max cycles / sprite doblank
    What's going on here is some self-modifying code 'cause the Propeller doesn't have any indirect addressing. My problem is the propeller is moderately pipelined, so the next instruction is fetched before the current instruction has been executed. So :byte7 MOV won't reflect the MOVD as it currently stands. For all of the other cases I've been able to slip the ADD instruction back before the MOV, but I don't have that option for :byte7. I could just put a NOP in there, but that adds 4 cycles to the loop, which effectively adds 16 cycles due to external memory timing. (ick!) Other options:
     
    1. Slide back the DJNZ. But then I need to copy :byte7 so it gets executed before the JMP. That's 3 opcodes (again due to the pipeline) and I'd like to only add max 2 for other reasons.
    2. Roll up the byte to long translation. Code space efficient, but more cycles.
     
    Any other suggestions?
     
     
    (The wz / IF_NZ are to make color 0 transparent. The condition codes are under application control and every instruction may be optionally executed. So wz sets/clears the Zero condition code and IF_NZ executes the MOV only if the Zero condition code is cleared, i.e. the value of sprbyte is non-zero.)
  19. EricBall
    I've been doing a bunch of think-coding over on potatohead's Blog trying to work though making Propeller code capable of generating a 240x240 resolution sprite display.
     
    For those not familiar with the Propeller, it's an 8-way SMP processor in a very low cost ($13 each) package. Each processor (or cog) has 496x32 bits of RAM which functions as registers and code & data storage (self modifying code is almost required), with 32K of shared RAM accessed in round-robin fashion (very deterministic once it gets going). Code is either written in a high-level interpretted language called Spin, or in native cog assembly. Guess which one I'm using...
     
    Each cog also has a video generator, which leads to some interesting possibilities. The concept I'm working on is to use 240 entries of cog RAM as line RAM which gets written out in a very tight loop. Then once the line is displayed, the cog fetches sprite graphics for the next line while another cog is busy displaying the current line. The big advantage is each pixel is stored as a long and has the capability of covering the entire NTSC color gamut. The downside is I'm discovering how few sprites the system can actually display.
     
    The last straw was clearing the line RAM:

    LineRAM EQU $100 D1 LONG 0000_0000_0000_000000001_000000000 Black LONG $01010101 * 7.5IRE MOV count1, #240 MOVD ZeroLR, #LineRAM ZeroLR MOV LineRAM, Black ADD ZeroLR, D1 DJNZ count1, #ZeroLR
    This simple bit of code chews up 2892 cycles, or over half of the time per line. Ugh!
     
    The solution is obvious - use 3 cogs for video. That doubles the number of cycles available for the write Line RAM routines.
     
    I'm hoping is also will even out the overall output timing. The plan is for the output routine to finish after writing a set of synch pulse pixels. This should set the output bits to 0 so it won't interfere with the output of active cog. But I'm guessing the video generator is still running, even though the cog isn't feeding it any new pixel data. Which means when the code goes back to writing, it's going to resynch back to the video generator clock. So because the pixel clock is 4.77MHz, that means there will be 303 pixels per line, which is 1/3 of a pixel short versus the spec. (Not a huge crime, but it's better to be in spec if possible.)
     
    But since I'm using 3 cogs for video, then I can accumulate that extra 1/3 pixel across the 3 lines sequence. So the cog generates 303 pixels of output, and then spends 607 pixels of time generating the next line of output. And we're back in spec.
     
    I'm also hoping I can figure out how to synch the 3 cogs together so they are all starting together. Then I can use the round-robin access delay to start each cog 1/3 pixel from each other.
  20. EricBall
    I've done some cycle counting of the display list builder for SpaceWar! 7800 and the results aren't pretty:
     
    103 cycles per display list (25 NTSC, 30 PAL)
    403 cycles per player sprite, +191 for horizontal wrap around
    248 cycles per non-player sprite, +82 for horizontal wrap around
    50 cycles per sprite header vertical wrap around
    200+ cycles of overhead
     
    At 114 cycles per raster, just the display list builder is going to chew through all 62 lines of VBLANK.
     
    So, what to do?
    1. Optimize where possible, but otherwise ignore it and risk having the display stutter.
    2. Alternate frames building display lists and game processing. I'd need to recalculate (or fudge) all of the gravity & velocity tables since it would be effectively 30fps instead of 60fps.
     
    #2 sounds feasible, just need to add the DLI wait routine after the display list builder.
     
    Note: SpaceWar! 7800 doesn't do itself any favors when it comes to the display list builder:
    1. 4 way scrolling tiled background
    2. 4 way wrap around
    3. player sprites are double height versus the zones
  21. EricBall
    I did a quick merge of the rest of the 4K SpaceWar! 7800 code so now the ships move & fire again. Of course there were problems - the main one being top-to-bottom wrap around. Turns out there was a bug in the 4K version, it didn't handle it properly either. Although the code wrapped around the display list pointers correctly, it didn't handle the end of display list index correctly. Thus, it tried to add the sprite to display list 0 using index 25, wiping out the display list. Ick!
     
    I still want to do some cycle counting and see if there's any possible optimization of the display list builder. I should also zero out the display lists at startup to prevent MARIA from going runaway if the active screen starts up before the display lists are built.
     
    Then I need to make a list of features to add to make the "game" itself. One of the ideas I'm toying with is an energy counter. Rotation/Thrust/Fire would deplete your energy (which would slowly replenish, but maybe make that an option). Hmm... how to handle regeneration? Would you come back with a full tank?
     
    Of course, kill counters & SFX are on the list. I don't think a one player mode is in the cards unless someone can come up with a reasonable AI. I'd also like to do some kind of title screen, but that's low priority.
     
    Oh, I'll also slow down the starfield so it's more of a slow drift.
     
    I'm also working on some sample code skeletons for other budding 7800 homebrewers. Watch AA and the mailing list.
  22. EricBall
    After much banging my head against the wall, I finally got the background scrolling smoothly. A lot of the problem was I couldn't keep straight which way was up. The next challenge is to integrate the code from 4K SpaceWar! 7800 and revising the display list builder to compensate for the moving background.
  23. EricBall
    That was both easier & harder than I expected. The hard part was the usual lack of debugging tools on the 7800. The easy was more a reflection of how my 6502 coding skills have improved over time.
     
    Next challenge is to put in the Y & SINE routines. I also need to do some cycle counting and figure out how much CPU time the background starfield will eat. I'd really like to be able to recalculate everything every frame, but I have a sneaking suspicion I might need to interleave background & foreground processing.
  24. EricBall
    Since I can't find my Leprechaun round tuit, I've told myself I have to work on SpaceWar! 7800 some more. One of the features I really want to add to SW78 is the starfield background (Expensive Planetarium). But the tile map is much larger than the screen, thus it needs to move in some way to show the whole thing. My original idea was to make the movement based on the spaceships wrapping around; they'd kinda drag the starfield with them. The disadvantage with this idea is there are two ships (though "fighting" to controll the starfield might be amusing) and the starfield wraps side to side but not top to bottom.
     
    Then I had a thought - why not make the starfield drift model what it does in real life? Have the center of the screen follow a sine wave around the tile map. Even have the period of the sine wave be different than the width of the tile map so it wouldn't be a simple repeat. Nifty! Okay, but how to implement? The cheap & easy way out would be a lookup table. The main disadvantages is it would be limitted to 256 values (compared to the 1888 pixel width of the tile map) unless I went to a 16 bit pointer and used more ROM. Hopefully it could be done programatically in less space.
     
    Of course there's this little problem - it has to run on a 6502. No FPU with built-in transecendental functions. No floating point registers. Heck, no hardware multiply or divide even. Just an 8 bit ALU with add and subtract with carry. Furthermore, I don't want to be burning up huge amounts of cycles in some fixed-point multiply function. I must be dreaming to even consider the possibility that such a thing could exits. (To be fair, I'll set my accuracy requirements low.)
     
    To my surprise - it is that easy. The Second Order Oscillator from http://www.ied.com/~petr/Oscillators.html meets my requirements exactly.
    The series y[n] = sin(n * a) can be calculated using y[n+1] = 2 * cos(a) * y[n] - y[n-1]
     
    Wow! Perfect! 2 * cos(a) is a constant, and thus I can make it something (trivially) easy to calculate using simple adds and multi-byte fixed point arithmetic. What's more, if you scale y[n] and y[n-1] that scaling flows through to y[n+1] and all other values. So I don't even need to multiply by the height of the tile map; just set the initial values correctly.
     
    I've done some testing using a spreadsheet and figured out that I need to use 8+16 bit fixed point with 2*cos(a) = 2 - 1/64K, so no shifts will be required, just subtract the integer portion (with sign extend) from the least significant byte. This gives a period of around 1609 pixels. I need to do some more thinking & testing to make sure the values don't overflow or decay. But it's definitely workable!
  25. EricBall
    Okay, I'm part way through Wind Waker; the pirate has become Zelda and I need to ride the waterspout to get my fire & ice arrows. Of course, I don't know how many side plots I need to follow up on, so there's probably a bunch of random sailing left.
     
    Which brings up two points. First, a lot of the reviews really focused on how tedious they found the sailing & wind changing. I disagree. Yes, you're going to spend a lot of time sailing around (often criss-crossing the entire map), but the programmers have tried to throw in stuff to keep it interesting. Lots of little islands to visit, treasure chests to winch up (with or without maps), and enemies to battle. My advice is to swing the camera around and do more than speed to the next encounter. As to the wind changing animation, IMHO it's not half as annoying as some of the other repettive dialogs.
     
    However, I wish the game had a built-in "ship's log" to track everything that you're told. You really need to take notes as there are lots & lots of things which you will find & learn before you can do anything about them. (My other advice is to visit the Northern Fairy shown on Tingle's map as soon as possible; I winched up a 200 rupee chest before I got the bigger wallet; sigh.)
     
    As expected, the cell-shaded style graphics simply aren't an issue (though watch where his eyes look); the storyline is engaging enough. (Oh, the shadows are 3D.) The story itself is a little clunky; I think they had to make the story fit the sailing concept. Occarina is still tops in the story department; Majora was also pretty good although more complex than Occarina.
     
    I'm still having fun, thus playing more than I should.
×
×
  • Create New...