Show us yer programming projects!

Coders forum. Discuss techniques, swap code snippets, ask for help etc. relating to all forms of software development.
Post Reply
User avatar
nyarla
Baaaaaa!
Baaaaaa!
Posts: 2820
Joined: Tue Jan 14, 2003 1:53 pm 0
Location: i said kiss me you're beautiful these are truly the last days
Contact:

Re: Show us yer programming projects!

Post by nyarla »

Naughty version would be horribly painful to watch :)
No, this is a family shaving game for family shaving people.
User avatar
super charlie
Baaaaa!
Baaaaa!
Posts: 1809
Joined: Wed Mar 31, 2004 7:53 pm 0
Location: Ipswich, suffolk
Contact:

Re: Show us yer programming projects!

Post by super charlie »

nyarla wrote:Naughty version would be horribly painful to watch :)
No, this is a family shaving game for family shaving people.
You don't fancy teaming up to make Magnetic Shaving Space Phallus then? ;)

Cheers
Charlie
Visit my website here to have a look at my game.
User avatar
nyarla
Baaaaaa!
Baaaaaa!
Posts: 2820
Joined: Tue Jan 14, 2003 1:53 pm 0
Location: i said kiss me you're beautiful these are truly the last days
Contact:

Re: Show us yer programming projects!

Post by nyarla »

haha :)
razors and cocks. a heady combination.
User avatar
piku
Sheepie Whore
Sheepie Whore
Posts: 20960
Joined: Wed Apr 24, 2002 10:44 am 0
Website: Http://Www.ncot.uk
Location: Wakefield
Contact:

Re: Show us yer programming projects!

Post by piku »

OK, so razors are a bit dangerous... So how about Magnetic Hot Wax Derby.
return (0);
User avatar
GoatFoam
Baaaaa!
Baaaaa!
Posts: 1255
Joined: Tue Dec 12, 2006 11:05 am 0
Location: Brizzle
Contact:

Re: Show us yer programming projects!

Post by GoatFoam »

I didn't know wax was magnetic.
User avatar
Barney
Baaaaaa!
Baaaaaa!
Posts: 2131
Joined: Tue Aug 23, 2005 7:59 pm 0
Location: UK, Broughton, Brigg

Re: Show us yer programming projects!

Post by Barney »

GoatFoam wrote:I didn't know wax was magnetic.
Could be Hot Wax with Iron Filings in it?
"Oh dear lord, I slightly soiled myself. Oxfam won’t be pleased."
User avatar
Barney
Baaaaaa!
Baaaaaa!
Posts: 2131
Joined: Tue Aug 23, 2005 7:59 pm 0
Location: UK, Broughton, Brigg

Re: Show us yer programming projects!

Post by Barney »

Added RPI filters (from Snakey's Kega emulator) to ZXSpin:

Image

But I have to say, Snakey's been a bit naughty with these - couldn't get certain plugins to work at all. Access violations up to the eyeballs, but only sometimes. Well, most of the time. But occasionally, I'd make a small change and it would work only to fail on the next run through....

Didn't help that the link to the scalers' source provided on Eidolon's Inn is a broken link, so I had to download the source to older scalers. After matching the source to delphi's disassembly of the compiled scaler, I found some downright nasty behaviour.

You start the filter by passing the source and destination surface pointers. In the case of 2xSAI, Snakey (Assuming it was him that wrote it, of course) is doing this:

Code: Select all

_2xSaILine:

         ; eax now points to colorE
         sub eax, ebx

; Main Loop

xLoop:	push ecx

         movq mm0, [eax+ebx+colorA]        ;mm0 and mm1 contain colorA
         movq mm2, [eax+ebx+colorB]        ;mm2 and mm3 contain colorB

         movq mm1, mm0
         movq mm3, mm2

         pcmpeqw mm0, [eax+(ebx*2)+colorD]
         pcmpeqw mm1, [eax+colorE]
         pcmpeqw mm2, [eax+(ebx*2)+colorL]
         pcmpeqw mm3, [eax+(ebx*2)+colorC]
Which means that the line "pcmpeqw mm1, [eax+colorE]", with ColorE being a constant 0, is causing the access violation. This is due to the earlier "sub eax,ebx" - eax points to the source pixel, and ebx contains the width of the source image. Sheesh. It's stepping up a line from the very first pixel in the surface where no line exists. Instant A/V :-(

It does it at the bottom of the image too - reads from pixels situated completely off the allocated surface memory.

I've fixed it by adding borders to the image to the top and bottom, and rendering the source bitmap at a vertical offset. The worst part is that there's no documentation about this at all - and it's very difficult to infer from the source of the filter. Took bloody ages to find that! Also undocumented is the scaling factor that the filter returns in the initialisation:

Code: Select all

#define	RPI_OUT_SCL1	0x000010000
#define	RPI_OUT_SCL2	0x000020000
#define	RPI_OUT_SCL3	0x000030000
#define	RPI_OUT_SCL4	0x000040000
Can you see the intentional error?

That's right - if a scaler declares to the calling app that it scales by 3x, it sets both RPI_OUT_SCL1 and RPI_OUT_SCL2 as well as RPI_OUT_SCL3 (which is a combination of 1 and 2!). It's such a small detail that I completely missed it and meant that my code, which tested for each scaling flag in turn with a bitwise AND, reported that 3x scalers were all requiring 1x destination images. Grr.

You could maybe forgive that last one (in asm, it would be trivial to shift right, mask off the top 5 bytes and read the low byte of the register as the scale), but reading from outside the surface is not something I'd expect from a coder of Snakey's calibre. He may not have written the scalers, but they seem to be the "official" scalers from Kega, so it's possible he did. If he maintains images deliberately larger than the internal screen then it's understandable that such a mistake may be missed - A little documentation mentioning this would have been nice though!

Mind you, it was worth it - they're only marginally slower than ZXSpin's own versions of the filters.
"Oh dear lord, I slightly soiled myself. Oxfam won’t be pleased."
User avatar
piku
Sheepie Whore
Sheepie Whore
Posts: 20960
Joined: Wed Apr 24, 2002 10:44 am 0
Website: Http://Www.ncot.uk
Location: Wakefield
Contact:

Re: Show us yer programming projects!

Post by piku »

Haha you've managed to emulate the shitness of my old TV :)

Can you now add a feature where randomly the 'TV' will detune itself. And simulate bad tapes too.
return (0);
User avatar
Barney
Baaaaaa!
Baaaaaa!
Posts: 2131
Joined: Tue Aug 23, 2005 7:59 pm 0
Location: UK, Broughton, Brigg

Re: Show us yer programming projects!

Post by Barney »

piku wrote:Haha you've managed to emulate the shitness of my old TV :)

Can you now add a feature where randomly the 'TV' will detune itself. And simulate bad tapes too.
Hmm. I already emulate bad tapes - turn off tape acceleration and emulate the hiss and wobble :)

I feel really bad for the VBA-M guys, who've implemented these scalers and got around the problems I found by just passing image info that's larger than their actual surface... The scalers will in some cases just go wandering around on other memory allocations which will almost certainly show up as a bug at some point! It'll be a bitch for them to find... Should I tell someone? :-)
"Oh dear lord, I slightly soiled myself. Oxfam won’t be pleased."
User avatar
The Caffeine Kid
Baaaaaaa!
Baaaaaaa!
Posts: 5691
Joined: Mon Mar 01, 2004 9:24 pm 0
XBL Gamertag: TheCaffeineKid
PSN: caffeinekid
Yahoo Messenger: caffeinekid
Location: Wakefield
Contact:

Re: Show us yer programming projects!

Post by The Caffeine Kid »

Maybe it shouldn't... but that image looks a lot "nicer" than a perfect crisp picture. :)

It takes me back... and feels more real somehow. :)
Life... Don't talk to me about life...

http://www.tcksoft.co.uk
http://www.retroremakes.com
User avatar
piku
Sheepie Whore
Sheepie Whore
Posts: 20960
Joined: Wed Apr 24, 2002 10:44 am 0
Website: Http://Www.ncot.uk
Location: Wakefield
Contact:

Re: Show us yer programming projects!

Post by piku »

My game engine now has sprites, some fancy Catmull-Rom spline paths and a nice bit of XML to glue it all together.

And a video, it seems important to make videos of our progress now, rather than screenshots.

http://www.vimeo.com/8015369

The jerky behaviour is partly due to screen capture software, and also due to unoptimised debug-compiled code. And 200 sprites.

:)
return (0);
User avatar
sack
Baaaaaaa!
Baaaaaaa!
Posts: 7077
Joined: Fri May 10, 2002 4:13 pm 0
XBL Gamertag: evilgopher
PSN: sixFiveOhTwo
Location: Rijswijk, The Netherlands
Contact:

Re: Show us yer programming projects!

Post by sack »

nice... but you are aware I can do *infinite* numbers of sprites like that on an 8MHz Amiga? :)
User avatar
Orangy Tang
Baaaaa!
Baaaaa!
Posts: 1794
Joined: Sun Apr 25, 2004 5:25 pm 0
Location: My secret lab
Contact:

Re: Show us yer programming projects!

Post by Orangy Tang »

I'm getting stuck into writing a little roguelike:

Image

You can only really walk around and hit things at the moment, getting the line of sight right has taken up most of my time.

Along the way I'm realising that roguealike's simple graphics mask some rather complicated goings on under the hood, especially when all the different elements have to interact in sane ways. Oh, and Unangaband's dungeon generation is complex and facinating.
[ Triangular Pixels.net - play Snowman Village, Rescue Squad, NiGHTS 4k and more ] [ Development Journal ]
User avatar
piku
Sheepie Whore
Sheepie Whore
Posts: 20960
Joined: Wed Apr 24, 2002 10:44 am 0
Website: Http://Www.ncot.uk
Location: Wakefield
Contact:

Re: Show us yer programming projects!

Post by piku »

sack wrote:nice... but you are aware I can do *infinite* numbers of sprites like that on an 8MHz Amiga? :)
Are they all real sprites that you can interact with? :)

(plus how's the infinite sprites thing work? I did once know, but I've forgotten)
return (0);
User avatar
GoatFoam
Baaaaa!
Baaaaa!
Posts: 1255
Joined: Tue Dec 12, 2006 11:05 am 0
Location: Brizzle
Contact:

Re: Show us yer programming projects!

Post by GoatFoam »

Well, first you need infinite memory and infinite time....

A tree based infinite memory architecture is best, as it makes it possible to access your infinite memory with a finite bus, although access time is on the order of log(infinity).

It helps if you also have an infinite resolution display, or the sprites just make a mess.
Post Reply