Sign in to follow this  
Noegddgeon

Atari and/or NES Quality Allegro w/ Scaling

Recommended Posts

Hello, everybody. I'm learning how to program in C++ and use Allegro to make games. What I want to do for my first big milestone is make something along the quality standards of the Atari 2600. Following this, I want to get into making something along the lines of the NES. Now, I realize with Allegro that I don't have to get into the nitty-gritty Assembly that the original hardware for those platforms required. I can use C++ to do the job with way too much power, surely. Here's my theory: on a pixel-by-pixel level, I can make a game like that for the Atari 2600 or NES using Allegro within small dimensions (say, 120 x 120 pixels for NES). This will be very small on my computer, which is running at a resolution of 1280 x 800. Clearly, this is terrible for playing purposes. Surely it's possible, but undesirable. What I would like to do is be able to scale the game, once it's been implemented, so that it grows to be several times its size and is thus much easier to play. One can see how this looks if one downloads an emulator for the NES and plays it on their computer at the size where pixels from the NES are the same as his or her computer. With emulators, one usually has the option to scale the game to their liking. Can anyone point me in the right direction as to where I can go to learn how to scale a game in such a manner as just previously described? I don't know how simple or how difficult it is, really, as I don't have much experience thus far. At best, I know the basics of C++ and some of the Allegro library's functions and features, but I'm about 3% of the way toward efficiency with either of them. Haha. Help would be greatly appreciated. Thank you all for your time :] Colton

Share this post


Link to post
Share on other sites
Sorry to bump, but if anyone doesn't know how to do this with Allegro, does anyone at least know how to do it with SDL or OpenGL? I'm making the switch over to those two right now and help with those instead would actually be more beneficial to more (though the theory, independent of which library I choose, is what I'm after the most). Thank you.

Colton

Share this post


Link to post
Share on other sites
NES = 256x240

Just draw your game onto a bitmap with Allegero. You are always doing this anyways. You blit with your back buffer as a targer. Instead, blit to a different target, and then do a stretch_blit() onto your back buffer, and flip it.

1) Make a 256x240 BITMAP object
2) Blit your sprites to it
3) stretch_blit() to the back buffer
4) swap your buffers

Share this post


Link to post
Share on other sites
Quote:
Original post by Noegddgeon
Oh wow, that actually makes sense.... and as a result of this, the sprites will be scaled, as well, not just the screen itself?Colton
Yes. The bitmap you drew your game on will be made to fit any size window.

However, it will start to look bad once you go out of it's original aspect ratio.

Share this post


Link to post
Share on other sites
If the aspect ratio is proportional to its original, however, will it still look good? At three times size, for example, at 768 x 720, will it look to be of a similar quality? I appreciate your help.

Colton

Share this post


Link to post
Share on other sites
What scaling like that won't do, though, is offer the same type of quality in the scaling that you get in an emulator, which typically use something like hqnx or 2xSal rather than nearest-neighbour. They aren't as simple to implement, but can deliver much better results with pixel art.

Share this post


Link to post
Share on other sites
DeathRay2K,

I don't mind learning more advanced methods of doing anything to produce optimal results and to learn. In fact, things like that interest me greatly. I see them as challenges. When I get to the point where I may need scaling and better quality, I'll probably end up trying to learn one of those two scaling methods. Thank you for your input.

Colton

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this