New Sprite Engine

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
Lerc
Posts: 64
Joined: Sat Aug 30, 2008 11:13 pm

Re: New Sprite Engine

Post by Lerc » Sun Sep 07, 2008 12:59 pm

I suspect this is going to be a recurring trend, and it isn't necessarily a bad thing.

People are going to want different things, The Uzebox can't satisfy everyone but neither should it be a reason to dismiss other ideas.

When I get around to doing something like this I'll be taking a different path. I think I even mentioned in another thread using a couple of 74157s just like 6845 did. For me the problem with the Uzebox is that it is too simple. By that I mean It looks too easy to explore the UzeBox to its limit, although I'd happily be proven wrong on that count.

That breadboard monster does seem a bit much, but there's some middle ground to be had there.

CompMan
Posts: 91
Joined: Mon Aug 25, 2008 3:48 am
Location: Kent, WA

Re: New Sprite Engine

Post by CompMan » Sun Sep 07, 2008 4:36 pm

Lerc wrote:People are going to want different things, The Uzebox can't satisfy everyone but neither should it be a reason to dismiss other ideas.
We are not dismissing other peoples ideas we are saying that we are not doing the development.

Compman

User avatar
uze6666
Site Admin
Posts: 4487
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: New Sprite Engine

Post by uze6666 » Sun Sep 07, 2008 9:07 pm

For me the problem with the Uzebox is that it is too simple.
Stated again, the goal of this project was to build a simple and cheap hardware game console, easy to learn and code for. You will never run AfterBurner or Mario 64 on this, but it's still a terrific learning tool for many IMHO. And with the stamp core designed by Clay, it can serve as the hearth of many kinds of projects, not only a game console.

I knew it would come to this at one point. I never promised SNES or even NES quality graphics or performance, only tile based stuff, with potential for more. Nothing personal here, but if you think the Uzebox is too underpowered, well, why not start your own project and build your own "LercBox"? ;)

Oh, and you know, the "kernel" code is my vision of things. There could be ways of recoding the tile+sprite functions in other ways that could yield a better resolution. Anybody's free to find out!

Uze

Lerc
Posts: 64
Joined: Sat Aug 30, 2008 11:13 pm

Re: New Sprite Engine

Post by Lerc » Sun Sep 07, 2008 10:49 pm

Yeah, I do understand your point of view. Sorry if I come off as criticizing because that not my intent.

I'm probably going to have a go at something Like a LercBox. That doesn't mean I'm not going to stick around and chat.

Right now I'm arm deep in docs on composite to see how hard it would be to replace the AD725 with another ATMega. Also looking at the cpld solution from http://www.innovativedevice.com/gamestation.htm

I also rather like the look of the dual 16 colours out pa0-7 that this one has
Image

Once again that's more chips though, unless it's all one cpld replacing the ad725.

anyhoo just to be clear. I'm just talking ideas to the ether, not requesting you do it.

havok1919
Posts: 474
Joined: Thu Aug 28, 2008 9:44 pm
Location: Vancouver, WA
Contact:

Re: New Sprite Engine

Post by havok1919 » Sun Sep 07, 2008 11:43 pm

Lerc wrote:Right now I'm arm deep in docs on composite to see how hard it would be to replace the AD725 with another ATMega. Also looking at the cpld solution from http://www.innovativedevice.com/gamestation.htm
That CPLD is about the same technique that Atari used in the TIA (the Atari 2600/VCS audio/video chip). The 'gotcha' is that you're relying on gate propagation delay in the CPLD to adjust the phase of the colorburst... So it's got a lot of dependencies. Voltage on the CPLD affects the speed, batches/datecodes can vary, die shrink/process changes will alter things, and god forbid if the toolchain decides it's going to optimize out some of those inverters. ;-)

It's not particularly hard to get a lot of good colors out of NTSC... Just hard to get them the same on multiple units over a longer period of time.

A safer method might be some kind of multi-tap R/C delay line to provide the phase shift so that you're not relying on the process of the CPLD to remain the same.

What a lot of the lower cost stuff does is just not use RGB colorspace (like the example above). If you go to something like YUV or YC you still get nice colors, they're just not necessarily RGB type colors. (ie, that's how all the old Atari stuff and NES worked, hence why Atari's never could really get a good fully saturated red, and why the NES palette is somewhat 'unique'.)

But if you think of the NTSC colorbust as just being one cycle at 3.579545MHz, if you were to 'slice' it into sixteen pieces you have essentially 15/16 different chroma components. That works out to needing to adjust the position of the burst by about ~17.4ns or so in each increment. That's pretty fast for a software solution (you'd need to be able to execute in the ~58MHz range unless you're being clever). You could do interesting things like only setting the chroma every other pixel and still adjust the luma every pixel and be able to reduce some of that overhead.

It's all interesting stuff. My only lingering regret is that it's all going the way of the dinosaur now with component and HDMI inputs on everything...

-Clay

Lerc
Posts: 64
Joined: Sat Aug 30, 2008 11:13 pm

Re: New Sprite Engine

Post by Lerc » Mon Sep 08, 2008 5:46 am

I have found a bit of stuff regarding composite colour out of an avr
At its most simple there is

http://www.serasidis.gr/circuits/colour ... ar_gen.htm

Getting a bit more fancy there's

http://trznadel.info/kuba/avr/index.php

Outputting a limited known palette would get it into the doable range. A second AVR at the same level of overclock as the first can probably do NTSC rates with enough cycles left to be a bit clever, PAL is a bit trickier, but I think quite a lot of PAL TVs can manage NTSC rates with alternating phase nowdays (mine mostly does)

havok1919
Posts: 474
Joined: Thu Aug 28, 2008 9:44 pm
Location: Vancouver, WA
Contact:

Re: New Sprite Engine

Post by havok1919 » Sat Sep 20, 2008 5:55 am

Any ETA on a starter sprite/tile engine, Uze?

I've got a couple things to try with the tile engine only, but sprites are a big bonus. ;-)

-Clay

User avatar
uze6666
Site Admin
Posts: 4487
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: New Sprite Engine

Post by uze6666 » Sat Sep 20, 2008 6:30 am

Eeeh, I dont have enough hours in a day to tackle everything I want! And that SD stuff it taking hours and it doesn't even work perfectly! Right now I'm looking at writing a sector writer with a dead simple file system to put our stuff on the card, gonna take time but not too tough. :)

For the sprite engine, as it is, I had a version that I was about to publish, but some started to mention scrolling and It bothered me a bit that it could not do it. So I put that on the backburner until it could find a way to cram that in the engine. Also, nobody had a working Uzebox so I wasn't in a hurry...until now it seems ;) ! That said, If you don't mind something a bit rough (but that works just fine), I can wrap it up and make that a "beta" version :P . For static background games like pong/arkanoid and the likes that should be just fine. Note that it could easily support vertical scrolling, so that would allow some River Raid kind of games.

The specs are: Up to 32 simultaneous 6x8 sprites with a maximum of four per scanline. Since it takes more cycles to do the transparency evaluation, resolution unfortunately downgrades to 22x26 tiles (132x208). Yeah I know, sounds like a Vic 20 resolution but I can always say its 256 colors and fits in the palm of my hand :D ! Also they could be other ways to do it than my approach.

In other news, to save memory, cycles and prog space (and money too?), I was thinking about ditching the MIDI interface all together. I think that modifying an open source tracker (like modplug) to play just like my engine would be much better and easier to compose music in the end (for musician of course :) ). I compose music myself (song from the first vid was mine) and MIDI always sucked for me for that kind of music. The only good thing about it is its stream format, efficient and compact. So compose and produce a MOD and convert to a simili MIDI stream seems a win-win proposition.

Let me know,

Uze

havok1919
Posts: 474
Joined: Thu Aug 28, 2008 9:44 pm
Location: Vancouver, WA
Contact:

Re: New Sprite Engine

Post by havok1919 » Sat Sep 20, 2008 11:16 pm

(Dammit... I wrote a reponse to this yesterday-- must have forgot to hit 'submit'!)
uze6666 wrote:Eeeh, I dont have enough hours in a day to tackle everything I want! And that SD stuff it taking hours and it doesn't even work perfectly! Right now I'm looking at writing a sector writer with a dead simple file system to put our stuff on the card, gonna take time but not too tough. :)
:lol: I hear you there. I have a whiteboard with projects I want to do "someday" with items still on it from 1994...
For the sprite engine, as it is, I had a version that I was about to publish, but some started to mention scrolling and It bothered me a bit that it could not do it. So I put that on the backburner until it could find a way to cram that in the engine. Also, nobody had a working Uzebox so I wasn't in a hurry...until now it seems ;) ! That said, If you don't mind something a bit rough (but that works just fine), I can wrap it up and make that a "beta" version :P . For static background games like pong/arkanoid and the likes that should be just fine.
I'd be all over that! Lots and lots of games can be done without scrolling of any sort.
The specs are: Up to 32 simultaneous 6x8 sprites with a maximum of four per scanline. Since it takes more cycles to do the transparency evaluation, resolution unfortunately downgrades to 22x26 tiles (132x208). Yeah I know, sounds like a Vic 20 resolution but I can always say its 256 colors and fits in the palm of my hand :D ! Also they could be other ways to do it than my approach.
Exactly. Having a nice kernel all ready to "just work" is great-- if people want to tweak it, more power to them. It seems like it'd be pretty easy to do Atari-style "display list" stuff too. (ie, run 10 rows of 40 tile "no sprite" area, then run the rest with sprites just by changing that unrolled inner loop in the render_tile_line.)

I'm curious to see how you did sprites. The only thing I could come up with was to render the current scanline of sprites into a line buffer, then load the sprite pixel and if non-zero output that, but if it's zero lpm the background tile pixel and output that instead. I haven't counted cycles, but it sorta seems like you could do half resolution one and full resolution of the other that way... (Either low res tiles and high res sprites or vice versa...)
In other news, to save memory, cycles and prog space (and money too?), I was thinking about ditching the MIDI interface all together. I think that modifying an open source tracker (like modplug) to play just like my engine would be much better and easier to compose music in the end (for musician of course :) ). I compose music myself (song from the first vid was mine) and MIDI always sucked for me for that kind of music. The only good thing about it is its stream format, efficient and compact. So compose and produce a MOD and convert to a simili MIDI stream seems a win-win proposition.
That sounds cool to me. Honestly my composing abilities are pretty weak, so I'd probably just use notes for sound FX and maybe make a little hblank sample player for other sounds. Not like there's a LOT of Flash for samples, but a couple K set aside for some ~4KHz samples wouldn't be too bad.
Let me know
I'd love to play with the work in progress. ;-)

-Clay

User avatar
uze6666
Site Admin
Posts: 4487
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: New Sprite Engine

Post by uze6666 » Mon Sep 22, 2008 2:42 pm

Fair enough then. I'll do my best to wrap it up by end of week. :)

Cheers,

Uze

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests