Jump to content
  • entries
    306
  • comments
    862
  • views
    244,732

About this blog

Geeky things I'm up to

Entries in this blog

 

FAST! DHT

I've finally finished (and debugged) my Fast Discrete Hartley Transform for the Propeller. It takes 2^N signed 32 bit input samples and produces the output in the same array. I've measured the following: 16 samples in 12,496 clock cycles 64 samples in 87,648 clock cycles 256 samples in 534,656 clock cycles 1024 samples in 2,899,504 clock cycles 4096 samples in 14,668,112 clock cycles   At 80MHz that's 27.5 1024 sample DHTs per second!

EricBall

EricBall

 

Hartley Transform

Sample code (unoptimized). Comment if you want more details. L = log2(N)for i = 0 to N-1 j = bitreverse( i, L ) if j > i then t = x[i] x[i] = x[j] x[j] = t endifnext ifor i = 0 to N-1 step 4 t0 = x[i] t2 = x[i+1] t1 = x[i+2] t3 = x[i+3] x[i+0]=(t0+t1+t2+t3)/2 x[i+1]=(t0+t1-t2-t3)/2 x[i+2]=(t0-t1+t2-t3)/2 x[i+3]=(t0-t1-t2+t3)/2next ifor o = 3 to L s = 1 << o h = s / 2 q = s / 4 for i = 0 to N-1 step s t0 = x[i] t1 = x[i+q] t2 = x[i+h] t2 = x[i+h+q]

EricBall

EricBall

 

'nother review of an old(er) game

This weekend while my wife was in Miami and my son was at school or asleep I played far too much Half Life 2. I got the game as part of the Orange Box for the PS3, which I bought to play Portal. But HL2 is an FPS and thus is verbotten in my wife's opinion. But what she doesn't know. . . Based on the walkthrough, I've played through over half of the game (maybe even two thirds). And although I had fun, it wasn't quite as satisfying as the original. I will say that I thought many of the envir

EricBall

EricBall

 

Propeller breaks the space time continuum

Most developers understand it is possible to trade off space for speed, e.g. unrolling loops or using table lookups instead of complex calculations. This is particularly true for low level programming where you are often trying to squeeze out the maximum speed in the minimum space. But I've recently discovered Propeller Assembly (PASM) it's possible to maximize speed and minimize space simultaneously.The Propeller is different from most processors in there are no dedicated ALU registers. Inst

EricBall

EricBall

 

Hartley Transform

If you do any kind of signal processing, you've probably heard of an "FFT" or Fast Fourier Transform. An FFT is an algorithm (and there are several) which calculates a Discrete Fourier Transform in less operations, typically O(N*log2(N)), where N is the number of samples. The Fourier Transform changes a time based function into a frequency based function. (The reverse is also possible.) The Discrete Fourier Transform is the same thing except it handles time and frequency samples rather than

EricBall

EricBall

 

Video is BIG part 2

I've enhanced my workflow, so I'll share it for others who may want to do something similar.Step 1 - using a simple video capture program and an analog capture card, I capture the video at 720x480 (YUV2 compressed with HuffYUV), and 48KHz 16bit audio to NTFS formated disk.Step 2 - use AVCutty to detect scene changes. I created a custom scene index to simplify the next step.Step 3 - compress the scenes to DV format using ffmpeg -ss hh:mm:ss.00 -t hh:mm:ss.00 -i capture.avi -target ntsc-dv "clip-

EricBall

EricBall

 

Propeller 6502 emulator

Why is it people think that because the 2600 is "simple" (at least in terms of what level of graphics it can produce) that it will be easy to emulate?   The reason it isn't is because the 6507 and the TIA are "tightly coupled" - each can do things which have an immediate impact on the other. The 7800 and NES are loosely coupled unless interrupts are used. But In the 2600 the 6507 & TIA could almost be regarded as a single entity.   Anyway, occasionally people suggest creating a 2600 em

EricBall

EricBall

 

Scribblenauts

Last friday was my son's 9th birthday, so I got him Scribblenauts for the DS. After playing through the first world (11 "puzzle" levels and 11 "action" levels), I have to say I'm fairly impressed. The game manages to squeeze a mind boggling number of items onto the cartridge. And there's another nine worlds to be played through (each with 11 puzzle & 11 action levels). I also like how it makes you think - and the spelling is a good "edutainment" angle.And yet, I have a few complaints:

EricBall

EricBall

 

Video is BIG

A decade or so ago I bought a Hi8 camcorder. With it my wife and I have shot the usual assortment of home movies. Now my wife wants to use iMovie to change those tapes into DVDs. (Probably not a bad idea - before those tapes start dying.). These days we use the movie capability of my wife's Canon S3 instead of the camcorder. Of course, getting from point A to B isn't a simple process. The first step is to use the capture card in my old PC to make an AVI using HuffYUV lossless compression. This g

EricBall

EricBall

 

You can't always get what you want...

My wife saw Beatles Rock Band in the store the other day and made some "wanna have it" noises. Now, although when RB2 & GHWT we talked about buying one of them, we never did. My main problem with them (and B:RB) is they are, at heart, rhythm games. You aren't just rockin' along to some tunes you know. Nope, the game want you to do the right thing at the right time, or no cookie for you. I downloaded an Aerosmith demo and played through it using my controller. (Yes, not ideal, but enoug

EricBall

EricBall

 

iPod Nano 5G

Today Apple announced the 5th generation Nano, including features not available on any other iPod models: video camera & microphone, speaker, and FM receiver. (I think the other features are 90% software, i.e. the pedometer uses the existing accelerometer.) Okay, so the iPhone has the camera and microphone, but the iPod Touch and Classic don't. (And both the Touch & iPhone have a speaker)My question is why the Nano got the goodies instead of the Touch. Maybe it's the price point. Ap

EricBall

EricBall

 

Lord of the Rings - BD

WB has pushed back the release of Lord of the Rings on Blu-Ray to next year. And although I'd love to have LotR on bluray, I don't care - cause this is the theatrical release, not the extended version. Annoyingly, WB hasn't mentioned anything about the extended version yet. But I can wait, I have patience.

EricBall

EricBall

 

expensive toys

Last year I bought my wife a MacBook, which she loves. One of the cool tools provided with OS X is Time Machine, which will automatically back up any changes to an external hard drive. She has an external USB hard drive for this which she connects about once a week, but you're only as safe as your most recent backup.   Apple also makes the Time Capsule, which is a WiFi router with a built in 1TB hard drive. With one of these, Time Machine would automatically back up her MacBook any time she

EricBall

EricBall

 

Slippery slope

My son recently bought himself Pokemon Platinum so I retired the SNES & Gameboys which were only used to play Pokemon Blue. But those weren't the only SNES & Gameboy games we had. So I downloaded the entire GoodSNES collection via BitTorrent (dang that was easy, although I don't see the need for all of the bad dumps, hacks etc.) and put an SNES emulator on the Wii along with the ROMs for just the SNES titles I owned. I'll probably do the same for the Gameboy titles. And I'd like to g

EricBall

EricBall

 

Propeller updates

So I posted my OnePinTVText driver. That's right, a text display on a TV using only 1 pin. Actually, there's no reason it can't do any other monochrome display with an 8x8 font. Anyone for a nice game of chess? Not much feedback yet. Sniff. I'd like to try to get it to work with the internal RC ~12MHz clock, but my first try didn't work. So I'll put that idea on the back burner for the moment.   My next project is to add SD support to my Z-machine interpretter so it can play the Infocom

EricBall

EricBall

 

My name is Eric and I'm a packrat

Yesterday I tidied up the corner of the basement where I store all my computer (and other tech) junk. I have no idea how I ended up with a dozen (or more) IEC power cords. I should keep enough of the best looking ones for the working PCs and monitors I currently have and toss the rest. Or figure out how to make them into a modern art exhibit and sell 'em to some gallery.   I also have a whack of serial cables which I'm trying to justify keeping. I don't think I have an external modem hidin

EricBall

EricBall

 

CivRev

I have been playing Civilization since version 1 although I haven't played version IV or any of the version III expansions. Nor did I play on deity level. So I guess I'm not a hard-core Civ player.   But that's a good thing, 'cause Civilization Revolutions isn't for the hard-core Civ players. Unlike the rest of the Civ seies which added complexity with each version increase, Civ Rev tries to make the game more fun by removing complexity. This isn't to say the game is easy (although experience

EricBall

EricBall

 

Z3.C - debugged

z3c.zip It works! I found the bug in the parsing routine (dumb error on my part). I'm going to call this chapter complete.   The next chapter is to create z3.spin based on this code. I/O will probably be based on a serial terminal interface. And it will run catseye.z3, which is small enough to fit in HUB RAM (hopefully), so no SD I/O. The objective is to do as little as possible other than porting the code from C to SPIN.

EricBall

EricBall

 

Z3 continues

Z3.C is functional, but I'm still bug hunting. It now gets to the first input in HitchHiker's, but doesn't grok the input. MiniZork starts, but misfires printing out the detailed location info. (Which probably means a bug is in the object/property/attribute code somewhere.)   What I really want is a PC trace from a known good interpretter, which I could then use to narrow down my bug hunt. Unfortunately, none of the Z-Machine interpretters I've found has this option. I could look at their

EricBall

EricBall

 

Z3 compiler frustration

What do you think the following C should do?   unsigned byte zmem[128*1024]; int read_word( int a, x ) { a = zmem[a++]<<8 + zmem[a]; ... } There are three (!) errors in the above code: precedence error : addition is done before shift order of operations : is a incremented before the second array reference? compiler bug : a contains a++ after the operation All three can be worked around by using a temporary variable. Here's another gotcha I ran into: int PC; vo

EricBall

EricBall

 

Z3

Zork! HitchHikers! Ahh, the memories of glowing green text and the frustration a text adventure can bring.   Interestingly, Infocom had the forsight to create their games as a program for a virtual computer. That way they didn't have to create separate versions of each for each home computer. The same game file could run on multiple home computers using the existing interpretters. And when a new home computer reached the market, the whole library of games would be available by just writing

EricBall

EricBall

 

My free time is doomed!

This weekend my wife spotted Civilization Revolution for the PS3 at Walmart. She (and I) loved playing Civ (1,2&3) so she was immediately interested. I thought I remembered seeing a downloadable demo, but I couldn't find it. Silly me it's "Sid Meier's Civilization" so it's under S. Anyway, I downloaded it and starting playing Monday morning.   They are cruel. This ain't no demo, it's the first third of the game in all it's glory. More than enough to make me remember why I spent so ma

EricBall

EricBall

 

Propeller project status update

The Propeller projects I listed in a previous blog:   PWM based waveform generator Done, but I'm not going to release it as the limitations outweigh the results. Since the waveform is hardcoded, there's no way to dynamically change volume. There's also no way to internally mix voices onto one channel. And, finally, the sound isn't that impressive. (I was hoping to get something which really sounded like a cello or trumpet.)   single pin NTSC text display driver Functionally working 100

EricBall

EricBall

 

Wanna be a pinhead

Who wouldn't want to have their own pinball machine? You too can be a pinhead, all you need is the space and the cash.   I have the space . . . in theory. I have an unfinished basement but it has accumulated a lot of stuff & junk over the past decade of residence so there's not a lot of empty floor space. Getting stuff down to the basement is also a challenge as the stairs make a 180 degree turn halfway down. But ultimately no show stoppers.   The cash is kinda sorta there too. The

EricBall

EricBall

 

NTSC240H driver complete, now with video

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

EricBall

EricBall

×
×
  • Create New...