<?xml version="1.0" encoding="utf-8"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>PACEDev Forums - Blogs</title>
		<link>http://pacedev.net/forums/blog.php</link>
		<description>Programmable arcade circuit emulation FPGA-based games</description>
		<language>en</language>
		<lastBuildDate>Fri, 30 Jul 2010 05:44:12 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://pacedev.net/forums/images/misc/rss.jpg</url>
			<title>PACEDev Forums - Blogs</title>
			<link>http://pacedev.net/forums/blog.php</link>
		</image>
		<item>
			<title>Another year...</title>
			<link>http://pacedev.net/forums/blog.php?b=17</link>
			<pubDate>Fri, 12 Feb 2010 00:32:07 GMT</pubDate>
			<description><![CDATA[PACE and related activities have survived another year, and still limping along. I've taken a bit of a break from FPGA development since the...]]></description>
			<content:encoded><![CDATA[<div>PACE and related activities have survived another year, and still limping along. I've taken a bit of a break from FPGA development since the Christmas break - needed to work on something less frustrating and requiring a little less mental power.<br />
<br />
The result of which has been my <a href="http://members.iinet.net.au/~msmcdoug/lrmsxtrs/index.html" target="_blank">MSX Lode Runner Bootleg Project</a>, which involved porting the MSX Lode Runner cartridge to the TRS-80 Model 4/4P with MicroLabs Grafyx Solution hires board. A welcome diversion from hardware... :)<br />
<br />
So what's ahead... still have the video converter board in the pipeline, need to get Coco3FPGA running on the DE1, want to tackle the TRS-80 Model II emulation in both software and FPGA. The latter will involve the more complete development of WD17XX implementation via SD card, for example. And I need to complete more ports to the CarteBlanche.<br />
<br />
And probably another few projects that will pop into my head in the mean-time, and disrupt everything that I've currently got planned! :eek:</div>

]]></content:encoded>
			<dc:creator>tcdev</dc:creator>
			<guid isPermaLink="true">http://pacedev.net/forums/blog.php?b=17</guid>
		</item>
		<item>
			<title>House of Ginger</title>
			<link>http://pacedev.net/forums/blog.php?b=16</link>
			<pubDate>Tue, 22 Dec 2009 12:37:35 GMT</pubDate>
			<description>So Mark (tcdev) and his wife decided to assault my low-carb diet with aggressive christmas cheer:

Image:...</description>
			<content:encoded><![CDATA[<div>So Mark (tcdev) and his wife decided to assault my low-carb diet with aggressive christmas cheer:<br />
<br />
<img src="http://pacedev.net/chris/pics/ginger/DSC_2621.JPG" border="0" alt="" /><br />
<br />
Loaded with sugar, butter and artery clogging goodness.  I think the little man is laughing at my resolve.<br />
<br />
<img src="http://pacedev.net/chris/pics/ginger/DSC_2614.JPG" border="0" alt="" /><br />
<br />
It's like a sparkly church of carbohydrate!<br />
<br />
<img src="http://pacedev.net/chris/pics/ginger/DSC_2638.JPG" border="0" alt="" /><br />
<br />
Santa looks happy.  Or is that just the buzz from a massive sugar high?<br />
<br />
<img src="http://pacedev.net/chris/pics/ginger/DSC_2617.JPG" border="0" alt="" /><br />
<br />
Sooo many lollies!<br />
<br />
<img src="http://pacedev.net/chris/pics/ginger/DSC_2644.JPG" border="0" alt="" /><br />
<br />
Kitty is not impressed:<br />
<br />
<img src="http://pacedev.net/chris/pics/ginger/DSC_2643.JPG" border="0" alt="" /><br />
<img src="http://pacedev.net/chris/pics/ginger/DSC_2651.JPG" border="0" alt="" /><br />
<br />
Seriously, how can I resist?!?!  It's like a giant lolly, piece of art and engineering toy all rolled into one!<br />
<br />
<img src="http://pacedev.net/chris/pics/ginger/DSC_2657.JPG" border="0" alt="" /><br />
<br />
Flat packed for transport to .. my stomach.<br />
<br />
<img src="http://pacedev.net/chris/pics/ginger/DSC_2664.JPG" border="0" alt="" /><br />
<br />
Seriously, thanks guys.  We think it's awesome.</div>

]]></content:encoded>
			<dc:creator>Chris</dc:creator>
			<guid isPermaLink="true">http://pacedev.net/forums/blog.php?b=16</guid>
		</item>
		<item>
			<title>Routers</title>
			<link>http://pacedev.net/forums/blog.php?b=15</link>
			<pubDate>Tue, 19 Aug 2008 00:19:47 GMT</pubDate>
			<description>_Almost_ fired up the DE1 last night, but decided that it was time to see if I could solve my router/torrent problem once and for all. :(

My router...</description>
			<content:encoded><![CDATA[<div>_Almost_ fired up the DE1 last night, but decided that it was time to see if I could solve my router/torrent problem once and for all. :(<br />
<br />
My router lasts about 24 hours once I start uTorrent. Then the net slowly grinds to a halt as the router (reportedly) runs out of connections. Even after I disabled uPnP in uTorrent. It's a well-known problem. :mad:<br />
<br />
Anyway, since I've been meaning to upgrade my router with new firmware for about 4 years now, I thought it was high time as my better half has been complaining about &quot;the bloody internet&quot; every night recently.<br />
<br />
DD-WRT it is. Looks nice! Seems to work. Time will tell.</div>

]]></content:encoded>
			<dc:creator>tcdev</dc:creator>
			<guid isPermaLink="true">http://pacedev.net/forums/blog.php?b=15</guid>
		</item>
		<item>
			<title>PACE still awaits</title>
			<link>http://pacedev.net/forums/blog.php?b=14</link>
			<pubDate>Wed, 06 Aug 2008 16:12:06 GMT</pubDate>
			<description><![CDATA[I thought by now I'd have the chance to get back into the swing of PACE, but as it happens it hasn't turned out that way quite yet.

Rest assured I'm...]]></description>
			<content:encoded><![CDATA[<div>I thought by now I'd have the chance to get back into the swing of PACE, but as it happens it hasn't turned out that way quite yet.<br />
<br />
Rest assured I'm still keen to get back into it - just a few other things on my plate atm which have conspired to delay my return - not the least of which is work hassles. :(<br />
<br />
I'm still keeping one eye on the recent developments in the &quot;scene&quot;, which has seen the release of the Nanoboard 2 complete with Apple II I/O board, and MikeJ's &quot;imminent&quot; release of his hardware (target) platform. Both interesting developments indeed!<br />
<br />
Once work settles down and the novelty of a new TV and PS3 wears off, I'll look at getting back into PACEDEV on a regular basis.<br />
<br />
Top of my list is to port as many of the projects to the DE1 as possible - should be a relatively easy task in most cases.<br />
<br />
After that, I'm not sure. I should probably update all the projects to Quartus v8 and see if I can finally track down this @#$%^ sprite bug that crept in. In the process I should re-do the VGA controller (again) to eliminate once-and-for-all the glitchy 1:1 scaling mode (e.g. TRS-80) and provide integrated support for both analogue VGA and TFT displays. Ideally I should also re-write the tilemap and sprite engines from scratch - they remain legacies of a very, very old project.<br />
<br />
I need to visit a few projects that are incomplete as well. I'd like to add secondary storage emulation to a few of the microcomputer projects (most notably the TRS-80) - I started on the OSD for this very purpose earlier in the year. I also need to finish the NES sprite controller so a few games are at least playable, and try to convince Chris to finish off the NES sound core. Then there's the Coco 1 implementation, followed by Coco 2/3.<br />
<br />
I should also do some work on the Minimig port and try to debug the dodgy SD card routines - if that's the problem I'm facing. Then there's getting Cabal to work with either of the two available 68000 cores... I did have a very ambitious project for those cores as well! :rolleyes:<br />
<br />
On the hardware side, there's also plenty to do. The PACE hardware platform for one. There's also the DE2-68k daughter board that Chris did. Not to mention the various console controller cores... and I won't mention the Segway... ;)<br />
<br />
Hopefully you'll see some progress here soon!</div>

]]></content:encoded>
			<dc:creator>tcdev</dc:creator>
			<guid isPermaLink="true">http://pacedev.net/forums/blog.php?b=14</guid>
		</item>
		<item>
			<title>Still getting back into the swing of Real Life...</title>
			<link>http://pacedev.net/forums/blog.php?b=13</link>
			<pubDate>Wed, 09 Jul 2008 03:36:23 GMT</pubDate>
			<description><![CDATA[In the 3 or so weeks since my return from OS I still haven't had the chance to sit down and fire up the PACE-related neurons in my brain - hell we...]]></description>
			<content:encoded><![CDATA[<div>In the 3 or so weeks since my return from OS I still haven't had the chance to sit down and fire up the PACE-related neurons in my brain - hell we still have souvenirs from our suitcases sitting on the loungeroom floor! :eek:<br />
<br />
I've even carted the DE1 back and forth between work and home a few times now with the intention of working on it, but it's yet to happen.<br />
<br />
Still working our way through holiday photos, waiting on wedding photos, yet to send out thankyou cards, deciding what to do about a TV, deciding what to do about my gym membership, deciding what to do about the car before it keels over completely etc etc whilst battling !@#$ faulty 500GB hard drives.... arrgghh!!<br />
<br />
Meanwhile I see at least three (3!) retro products go out in the last few weeks - some of which have production runs in the hundreds - and make a note that other people *ARE* actually making some pocket money out of this hobby...<br />
<br />
I won't even mention homebrew segways... (oops - I did!)<br />
<br />
Anyway, I still have an active interest in PACE and hardware emulation of all things retro, so at some stage in the near future I'll get the chance to bring myself up to speed on it all again and continue plodding along...</div>

]]></content:encoded>
			<dc:creator>tcdev</dc:creator>
			<guid isPermaLink="true">http://pacedev.net/forums/blog.php?b=13</guid>
		</item>
		<item>
			<title>PACE repository online, platform/target matrix updated</title>
			<link>http://pacedev.net/forums/blog.php?b=12</link>
			<pubDate>Wed, 16 Jan 2008 14:01:01 GMT</pubDate>
			<description><![CDATA[After a short break from everything computer-related over xmas, I'm starting to get back into the PACE groove.

The repository is (finally) now...]]></description>
			<content:encoded><![CDATA[<div>After a short break from everything computer-related over xmas, I'm starting to get back into the PACE groove.<br />
<br />
The repository is (finally) now online!<br />
<br />
I've spent the last few weeks building *every* project in the repository, so I can tabulate a series of platform vs target statuses. Unfortunately, pretty much everything is/was broken and it took quite some time to get it to a state where more then half of the projects actually ran, and all but a few build OK.<br />
<br />
The biggest problem is the sudden failure of the sprite logic in every project except Pacman/Pengo. This is a real mystery atm, and I've yet to track it down. As a result, a handful of 'pace' (my) projects won't display sprites.<br />
<br />
A few more mysteries - Donkey Kong sprites are corrupt, and the VIC-20 &amp; Videopac projects won't sync the video. Also Quartus v7.2 refuses to build MSX2 &amp; System09 due to inout port 'miuse' in those projects. Not hard to fix, just haven't dug into them yet.<br />
<br />
Some of the 'pace' (my) projects have really crappy video - the current VGA controller works fine for 2x scaled output, but not 1x. I really need to fix that properly some time.<br />
<br />
Various projects remain WIP, like Centipede, ports of fpgaarcade's Frogger/Scramble and the NES.<br />
<br />
A few ports don't work as expected, such as Gary Becker's Apple IIe &amp; Coco 3, and more recently, Minimig. I suspect there are subtle problems in the original designs in these cases.<br />
<br />
As an aside, I'm currently reading 'Masters Of DOOM' by David Kushner. In case it's not obvious, it's about John Romero &amp; John Carmack and the early days of ID Software. Interesting reading, I'd recommend it if you're into that sort of thing.<br />
<br />
Anyway, enjoy and please get porting!</div>

]]></content:encoded>
			<dc:creator>tcdev</dc:creator>
			<guid isPermaLink="true">http://pacedev.net/forums/blog.php?b=12</guid>
		</item>
		<item>
			<title>Minimig on the DLB</title>
			<link>http://pacedev.net/forums/blog.php?b=11</link>
			<pubDate>Wed, 19 Dec 2007 12:40:46 GMT</pubDate>
			<description>Have spent the last few days wiring up extra connectors to get Minimig running on the DLB.

First up was the SD card connector. After miscalculating...</description>
			<content:encoded><![CDATA[<div>Have spent the last few days wiring up extra connectors to get Minimig running on the DLB.<br />
<br />
First up was the SD card connector. After miscalculating the physical constraints and putting together a makeshift &quot;board on a string&quot; I was utterly amazed to see the Amiga Kickstart screen - especially considering I still can't successfully build the native DE2 project from Tobias! :eek:<br />
<br />
No PS/2 input - which turned out to be the extra 'key' inputs hard-wired to all active, so I couldn't bring up the on-screen-display. Discovered this after &lt;CTRL&gt;&lt;LALT&gt;&lt;RALT&gt; actually rebooted the Amiga...<br />
<br />
After fixing that I could insert a floppy disk image - but the Amiga refuses to recognise a disk in the drive... a problem I am yet to solve. :mad:<br />
<br />
I re-did the Minimig add-on board - this time it interfaces via an empty 42-pin IC socket which gives me more options and physically more room on the board.<br />
<br />
Next attachment is the 2nd PS/2 connector for the mouse. It's working in Space Invaders but am yet to see it in Minimig...<br />
<br />
Finally I added a (redundant as I soon realised) gamecube connector to act as the joystick input. It's redundant because I can still use the other header! Doh! However the up-side is that by re-soldering 1 wire I now have a 2nd gamecube controller input! I'm waiting for another build to complete (~40mins) so I can press the joystick 'fire' button during booting to bring up the Kickstart config screen which should also let me test the mouse input...<br />
<br />
UPDATE: the mouse works! :cool:</div>

]]></content:encoded>
			<dc:creator>tcdev</dc:creator>
			<guid isPermaLink="true">http://pacedev.net/forums/blog.php?b=11</guid>
		</item>
		<item>
			<title>Minimig porting...</title>
			<link>http://pacedev.net/forums/blog.php?b=10</link>
			<pubDate>Sat, 15 Dec 2007 00:41:43 GMT</pubDate>
			<description>Tobias has released the source for his DE1/DE2 Minimig project. I cracked it open to see what was involved in porting it to my PACE-P2 hardware....</description>
			<content:encoded><![CDATA[<div>Tobias has released the source for his DE1/DE2 Minimig project. I cracked it open to see what was involved in porting it to my PACE-P2 hardware. :eek:<br />
<br />
Not having an SD/MMC connector on my hardware, I was considering modifying the design to use CF. Not an option - at least not without a lot of work, including both FPGA firmware changes and Z80 assembler for the bootloader. Much easier to add an SD/MMC connector to my hardware - which only requires 4 signals. So I order a few which should arrive Monday...<br />
<br />
Aside from that, I translated the top-level DE1 schematic into VHDL. Because the DE2 design actually instantiates the DE1 top-level, I can test my translation on Chris' DE2 board.<br />
<br />
All that is left - assuming the above works out OK - is to add the SD/MMC connector and modify the SDRAM controller for my SDRAM. I'm assuming that won't be a big deal either.<br />
<br />
Finally I can move my top-level DE1 VHDL code into the top level entity for my hardware, connect the ports, and cross my fingers.<br />
<br />
Then I can play Hybris with a Nintendo Wavebird! :cool:</div>

]]></content:encoded>
			<dc:creator>tcdev</dc:creator>
			<guid isPermaLink="true">http://pacedev.net/forums/blog.php?b=10</guid>
		</item>
		<item>
			<title>Building woes, portable MAME and PACE-P2 sound</title>
			<link>http://pacedev.net/forums/blog.php?b=9</link>
			<pubDate>Wed, 12 Dec 2007 05:45:30 GMT</pubDate>
			<description><![CDATA[Still struggling through getting all the current PACE projects to build. I've broken the sprites in a bunch of games, and others simply won't build...]]></description>
			<content:encoded><![CDATA[<div>Still struggling through getting all the current PACE projects to build. I've broken the sprites in a bunch of games, and others simply won't build under Quartus v7.2. :confused:<br />
<br />
One thing distracting me from the task (aside from  its tedious nature) is the fact that I finally now have a phone capable of running MAME! Impressive? Yes! Playable? No, not really, though that's more to do with the phone buttons than the emulation itself. Now to work out how to interface my X-Arcade stick to my Nokia 6120... :cool:<br />
<br />
*FINALLY* I've added (stereo) sound to my PACE-P2 hardware. All that was lacking was a couple of resistors and capacitors (the latter of which I didn't have in the right footprint), a stereo jack and a half-dozen lines of VHDL for PWM output. :)</div>

]]></content:encoded>
			<dc:creator>tcdev</dc:creator>
			<guid isPermaLink="true">http://pacedev.net/forums/blog.php?b=9</guid>
		</item>
		<item>
			<title>Robotic Foot Massagers</title>
			<link>http://pacedev.net/forums/blog.php?b=8</link>
			<pubDate>Mon, 10 Dec 2007 00:51:31 GMT</pubDate>
			<description>Whilst Chris has been dreaming of robotic foot massagers that can also teach him Japanese, and working out how to attach both his laptop and his...</description>
			<content:encoded><![CDATA[<div>Whilst Chris has been dreaming of robotic foot massagers that can also teach him Japanese, and working out how to attach both his laptop and his mobile phone to his surfboard, I've been doing the grunge work required to release this project to the masses! :p<br />
<br />
The dirty work requires me to go through every project and confirm that it at least builds on one of the platforms - a tedious and time-consuming process since I broke pretty much every platform since I &quot;bent&quot; the PACE framework around the humble NES a few months ago. That's how I spent last Friday night (as you do) - not only sitting in the office, but also sans alcohol! :eek:<br />
<br />
Anyway, I managed to get most of the platforms compiling at least - Quartus v7.2 has chucked a wobbly in a few builds which I am yet to delve into. Some of the stuff it's complaining about ain't mine, which is a little disconcerting. But it shouldn't be long before the repository is in a reasonably sane state for impending release.<br />
<br />
Chris will be heartened to hear that, whilst doing the code clean-up on Friday night, I did stumble across a couple of mostly-complete modules - such as foot_massage.vhd and teach_japanese.vhd. As far as I can tell, they look OK under simulation, but don't quite work in silicon... :D</div>

]]></content:encoded>
			<dc:creator>tcdev</dc:creator>
			<guid isPermaLink="true">http://pacedev.net/forums/blog.php?b=8</guid>
		</item>
		<item>
			<title>Phones! Laptops! Internets! Oh my !!</title>
			<link>http://pacedev.net/forums/blog.php?b=7</link>
			<pubDate>Fri, 07 Dec 2007 13:30:12 GMT</pubDate>
			<description>For years I have been anxiously waiting for the truly monumental advances in technology to sweep me off my feet and make my life super fun (if not...</description>
			<content:encoded><![CDATA[<div>For years I have been anxiously waiting for the truly monumental advances in technology to sweep me off my feet and make my life super fun (if not obsolete!).  But where are the talking robots, the jet packs and the flying cars?  Where is our moon base, mind readers and pocket ray guns?<br />
<br />
To say I have been disappointed to date is an understatement.  Sure over the last few decades we have managed to find yet more ways to distribute the mindless dribble that poses as popular culture, music and tv, and sure we have managed to finally abuse the humble web browser into being a laggy, buggy, memory leaking hog of an application platform (even slower than Windows !?!?!), but flying robots that massage my feet and teach me Japanese without me having to think are nowhere to be seen.<br />
<br />
Well today I have joined the ranks of the technical elite.  I am drunk with power.  Thanks to the generosity of my boss, I am now control of this gadget:<br />
<br />
<img src="http://pacedev.net/chris/pics/20071207/DSC_0242.JPG" border="0" alt="" /><br />
<br />
Yes!  A phone!  But not just any phone, one of those new fangled smart phones that runs layers and layers of Java, and where clicking on the wrong icon can end up costing many dollars per click, but where everything (so far) just <u>works</u>.  And it supports 3G internet access.<br />
<br />
Finally I can connect wirelessly (bluetooth) from my laptop to this shiny miniature data pimp, and then onwards through the bowels of the gigantic telecoms company to the frantic jumble of pipes and sweaty porn spam that is the interwebs.  Via which I am currently writing this blog entry.<br />
<br />
All this technical magicamajiggery is battery-powered and totally wire free.  Which means I can make use of it wherever I want to do whatever I want.  I can walk around reading my emails (on my 17&quot; laptop screen), or take my it out surfing and check the weather report while catching a wave.  Or whatever.  I can even roam outside the 3G zone into the &quot;twilight&quot; 2G zone where data costs $1.65 per <u>megabyte</u>.<br />
<br />
Thankfully the usual data rates are only slightly obscene.<br />
<br />
From now on, whenever you read this blog, know I will have been sitting at the beach lounging and idly tapping away my most intimate thoughts.  Sipping something cool and refreshing.  In my underwear.</div>

]]></content:encoded>
			<dc:creator>Chris</dc:creator>
			<guid isPermaLink="true">http://pacedev.net/forums/blog.php?b=7</guid>
		</item>
		<item>
			<title>Motion blur</title>
			<link>http://pacedev.net/forums/blog.php?b=6</link>
			<pubDate>Wed, 05 Dec 2007 15:11:58 GMT</pubDate>
			<description>Did I mention my new SLR is fun?  This fellow seems to agree!

Image: http://pacedev.net/chris/pics/20071206/DSC_0231.JPG 

Now fast cars.

Image:...</description>
			<content:encoded><![CDATA[<div>Did I mention my new SLR is fun?  This fellow seems to agree!<br />
<br />
<img src="http://pacedev.net/chris/pics/20071206/DSC_0231.JPG" border="0" alt="" /><br />
<br />
Now fast cars.<br />
<br />
<img src="http://pacedev.net/chris/pics/20071206/DSC_0236.JPG" border="0" alt="" /><br />
<br />
And of course the gratuitous pussy shot.<br />
<br />
<img src="http://pacedev.net/chris/pics/20071206/DSC_0466.JPG" border="0" alt="" /></div>

]]></content:encoded>
			<dc:creator>Chris</dc:creator>
			<guid isPermaLink="true">http://pacedev.net/forums/blog.php?b=6</guid>
		</item>
		<item>
			<title><![CDATA[Coco "Flash2" cartridge]]></title>
			<link>http://pacedev.net/forums/blog.php?b=5</link>
			<pubDate>Wed, 05 Dec 2007 14:56:27 GMT</pubDate>
			<description><![CDATA[The Coco "Flash2" cartridge is my version of an in-system-programmable flash-based cartridge for the TRS-80 Coco.

You can read a bit more about it...]]></description>
			<content:encoded><![CDATA[<div>The Coco &quot;Flash2&quot; cartridge is my version of an in-system-programmable flash-based cartridge for the TRS-80 Coco.<br />
<br />
You can read a bit more about it here...<br />
<a href="http://members.iinet.net.au/~msmcdoug/coco/coco.htm" target="_blank">http://members.iinet.net.au/~msmcdoug/coco/coco.htm</a><br />
<br />
Tonight I finally got to build a board as we have been waiting on Altera CPLDs for months now.<br />
<br />
<font color="Red"><b>1st problem</b></font> I found with the board was the pinout on the 'reset' pushbutton was wrong - so I left it off at this point.<br />
<br />
Assembled the board and tried to scan the JTAG chain - no CPLD! Decided to check the 3V3 rail - nothing...<br />
<br />
<font color="Red"><b>2nd problem</b></font> was the pinout for the LDO voltage regulator was wrong!<br />
<br />
Quick patch - still nothing. Found bad solder connections on the JTAG pull-ups - a ridiculously small resistor array. By fixing that I ended up shorting 3V3 &amp; GND... :(<br />
<br />
2 junked resistor packs (thanks for getting the 3rd one right for me Chris!) and about 2.5 hrs after starting a final touch-up on the CPLD pads and it finally appeared on the JTAG chain - yah!!! :)<br />
<br />
Managed to get the registers and 'stealth' mode working... next step is to read the flash device info...</div>

]]></content:encoded>
			<dc:creator>tcdev</dc:creator>
			<guid isPermaLink="true">http://pacedev.net/forums/blog.php?b=5</guid>
		</item>
		<item>
			<title>C: sizeof(array-1)</title>
			<link>http://pacedev.net/forums/blog.php?b=4</link>
			<pubDate>Wed, 05 Dec 2007 12:44:14 GMT</pubDate>
			<description><![CDATA[Wonder what happens when you try to take sizeof on a fixed length array with an offset?  Me too!


---Quote---
int foo[12];
printf("sizeof(foo):...]]></description>
			<content:encoded><![CDATA[<div>Wonder what happens when you try to take sizeof on a fixed length array with an offset?  Me too!<br />
<br />
<div style="margin:20px; margin-top:5px; ">
	<div class="smallfont" style="margin-bottom:2px">Quote:</div>
	<table cellpadding="6" cellspacing="0" border="0" width="100%">
	<tr>
		<td class="alt2" style="border:1px inset">
			
				int foo[12];<br />
printf(&quot;sizeof(foo): %d\n&quot;, sizeof(foo));<br />
printf(&quot;sizeof(foo-1): %d\n&quot;, sizeof(foo-1));
			
		</td>
	</tr>
	</table>
</div>Returns:<br />
<div style="margin:20px; margin-top:5px; ">
	<div class="smallfont" style="margin-bottom:2px">Quote:</div>
	<table cellpadding="6" cellspacing="0" border="0" width="100%">
	<tr>
		<td class="alt2" style="border:1px inset">
			
				sizeof(foo): 48<br />
sizeof(foo-1): 4
			
		</td>
	</tr>
	</table>
</div>Peculiar!<br />
<br />
When we try:<br />
<div style="margin:20px; margin-top:5px; ">
	<div class="smallfont" style="margin-bottom:2px">Quote:</div>
	<table cellpadding="6" cellspacing="0" border="0" width="100%">
	<tr>
		<td class="alt2" style="border:1px inset">
			
				printf(&quot;&amp;foo: %p\n&quot;, &amp;foo);<br />
printf(&quot;&amp;(foo-1): %p\n&quot;, &amp;(foo-1));
			
		</td>
	</tr>
	</table>
</div>We get:<br />
<div style="margin:20px; margin-top:5px; ">
	<div class="smallfont" style="margin-bottom:2px">Quote:</div>
	<table cellpadding="6" cellspacing="0" border="0" width="100%">
	<tr>
		<td class="alt2" style="border:1px inset">
			
				&amp;foo: 0022FF40<br />
&amp;(foo-1): 0022FF3C
			
		</td>
	</tr>
	</table>
</div>So clearly the compiler (GCC) is pre(de?)moting the array to a pointer, which seems to be backed up by the general behaviour noted in <a href="http://c-faq.com/aryptr/" target="_blank">comp.lang.c FAQ - Arrays and Pointers</a><br />
<br />
As it notes, technically foo[-1] isn't legal because pointer arithmetic is only valid within the allocated array space or so, but my guess would be finding an architecture where this is a real issue (apart from the occasional whacked-out embedded system) is probably about the same odds of finding a working system where byte length != 8 bits!<br />
<br />
So now you know.<br />
<br />
<a href="http://8-Þ.com" target="_blank">8-Þ</a></div>

]]></content:encoded>
			<dc:creator>Chris</dc:creator>
			<guid isPermaLink="true">http://pacedev.net/forums/blog.php?b=4</guid>
		</item>
		<item>
			<title>Rainy day</title>
			<link>http://pacedev.net/forums/blog.php?b=3</link>
			<pubDate>Wed, 05 Dec 2007 12:05:48 GMT</pubDate>
			<description>What do you know, Sydney smog still allows rainbows.

Image: http://pacedev.net/chris/pics/20071205/DSC_0223.JPG 

Funky weather.

Image:...</description>
			<content:encoded><![CDATA[<div>What do you know, Sydney smog still allows rainbows.<br />
<br />
<img src="http://pacedev.net/chris/pics/20071205/DSC_0223.JPG" border="0" alt="" /><br />
<br />
Funky weather.<br />
<br />
<img src="http://pacedev.net/chris/pics/20071205/DSC_0231.JPG" border="0" alt="" /><br />
<br />
Note the &quot;robust&quot; shade of (smog?) orange :)<br />
<br />
Hope Picasa didn't munch the colours too much.</div>

]]></content:encoded>
			<dc:creator>Chris</dc:creator>
			<guid isPermaLink="true">http://pacedev.net/forums/blog.php?b=3</guid>
		</item>
	</channel>
</rss>
