Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - fromwithin

Pages: [1] 2
FOR SALE / WANTED / Re: Commodore SX64
« on: June 24, 2010, 09:22:06 PM »
Sigh. I've wanted one of those since I was about 8.

But it would never get used.

« on: June 24, 2010, 07:32:26 PM »
A couple of little logic errors:

while (YPos > WINDOW_HEIGHT) {
  YPos = 0;

The while here acts only like if statement. As soon as YPos = 0, the while condition is satisfied, so it will never actually loop.

while (pressAPosition > WINDOW_WIDTH+256) {  // This is for if the frame rate becomes so slow that
  pressAPosition = -256;                     // it moves more than one window width in a single frame

This is the same as above. As soon as pressAPosition = -256, the while condition is satisfied. In my original example, instead of setting pressAPosition to a specific value, it subtracted the screen width until it was in range again. This is to be properly frame rate independent. It's a bit hard to describe in just text.  :-\

« on: June 24, 2010, 06:23:33 PM »

for (<execute once at start of loop>; <loop while this condition is true>; <execute at end of every loop>) {
  // do stuff here


for (unsigned int myCounter = 0; myCounter < 10; ++myCounter) {
  std::cout << myCounter << std::endl;

  • 1. Create a new unsigned integer called myCounter and set it zero (With the Sdl stuff, you can use Uint32 instead of unsigned int).
  • 2. Test the condition. If myCounter is less than 10, then execute code between { and }, which in the example would print myCounter's value followed by a end-of-line. Otherwise execute the code beyond }
  • 3. Add one to myCounter.
  • Jump back to 2

In the above example, myCounter is not available outside of the loop. It goes out of scope and disappears.
If you wanted to make it available outside of the loop, you would need to declare it outside like this:

unsigned int myCounter = 0;
for (; myCounter < 10; ++myCounter) {
  std::cout << myCounter << std::endl;
std::count << "Final value = " << myCounter << std::endl;

Notice how the first section of the for clause is now empty. It does no special operation at the very start of the loop.

« on: June 23, 2010, 08:49:14 PM »

I couldn't install VC2010 as the installation failed.

This is created in VC2008 and hopefully VC2010 will convert the project properly.

You should just be able to unzip this into your projects folder and open SdlTest.sln from inside the SdlTest folder. This contains the framework and small sample main loop.

As it contains all of the SDL libraries, it's 8MB so I can't attach it to this message, but I've uploaded it to my server.

It's written in very strict C++, as is my way, and I hope that you continue your learning in such a tradition.

No doubt you will have loads of questions. Feel free to ask away.

« on: June 23, 2010, 05:36:00 PM »

It's nearly ready.

It turned into rather a larger thing than I intended, but it's now stupidly simple. And I've written you a starfield as you seem to like them so much. ;)

I'll just do a few more tests and things then zip it up in an hour or so.

« on: June 21, 2010, 05:21:02 PM »
What are you trying to compile?

I know what the problem is, but it's likely the code's fault.

Somewhere there should is probably be a:

which doesn't match one of the DLLs (like DirectX or SDL) that is compiled with __declspec(dllexport).

I'm installing VS2010 now. I'll create an SDL framework for you that shouldn't have such problems.

« on: June 21, 2010, 04:30:16 PM »
fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory.
where do i get this file from and where do I put it - is it part of the DX SDK library?

Correct. SDL is probably trying to access the DirectX SDK. Install it and restart Visual Studio and it should pick it up automatically.

DirectX SDK download

« on: June 21, 2010, 04:28:12 PM »
Being picky about correctness, I noticed the W3C buttons down in the bottom left corner and both Html and CSS fail validation:

XHTML failure
CSS failure

« on: June 21, 2010, 03:32:57 PM »
VC++ is largely self-contained.

If you post the errors here, I can tell you what they mean and how to fix them.

« on: June 21, 2010, 01:59:14 PM »
If you want to get yourself setup:

Just download Visual C++ and install it. Don't bother with installing the SQL server during the install if it asks.

« on: June 21, 2010, 01:44:47 PM »
Just don't go selling that SNES devkit:


But then again:

BTW, that kit was the one which I used to do the music for SNES Lemmings 2, SNES Bill's Tomato Game (was never finished) and SNES Mega Apocalypse 2 (finished but never released, available on the net) there is probably software for it in the ridiculously large box(es) of Psygnosis disks that you can take.

I just want to thank you guys for being there over the wekend.

If it wasn't for you, I think it would have been Acorn overload. :)

« on: June 21, 2010, 12:44:48 PM »
A hell of a lot more than 5 lines, but it depends on what framework you use; there are many available.

Modern systems with a GPU simply don't like to do things like parallax starfields in a way that you are probably comfortable with. Everything is polys, textures and shaders. But that gives great flexibility and there are many ways that you could achieve it. Ideally, each star would be two polys of the right size to match the screen resolution that you just throw around the screen while keeping them facing the camera. It's certainly a lot more complex than doing it in basic, but once it's running, it's ridiculously fast and flexible. For example, it would take almost no code to move the viewer into the starfield in 3D or turn the camera so that the stars are coming at you or going away from you.

You can, however, draw "directly" into what you would consider to be the screen by writing into a texture, binding that texture (so that the GPU has access to it), then drawing two triangles that cover the whole screen that use that texture. You have to do that every frame.

I would suspect that for your purposes, SDL would be the best thing to get into. You can treat it like a big framebuffer where you just write a colour directly into the pixels. All of the nasty stuff will be handled transparently so that you don't have to bother with any of it. It also takes care of window/screen creation and all that nonsense.

Your basic code to write into the screen then becomes:
Uint32 myColourPixel = 0xFF2010FF;
screen->(pixels  + y + x) = myColourPixel;

It can also be used in conjunction with OpenGl.

It's a pretty big jump to start doing C++, there's no doubt about it, but once you're there it opens up a whole new world of possibilities.

Take one step at a time and you'll get there in no time.

If I get the chance, I'll setup a simple SDL framework for use with Visual Studio Express. That should get you up and running straight away.

« on: June 21, 2010, 11:34:21 AM »
Just wanted to say that I'm around to answer questions about C++ and pretty much any aspect of game programming should anyone wish to make the jump. :)

« on: June 21, 2010, 01:56:19 AM »
So on my way back home from Bletchley Park, I went into my Mum and Dad's house and went into the loft. I even surprised myself by how much there is.

Here's the list of stuff that I have for you, should you wish to take it:
Some Spectrum games, including some big-box Sinclair ones.
Loads of C64 games, including some really old stuff (e.g. Ring Of Power by Quiksilva, Pedro by Imagine) and really obscure stuff that I'd never even heard of.
A bunch of manuals (C64, Spectrum, applications, hardware).
And the meat...
C64 boxed (Playful Intelligence Pack).
C64 boxed (original plain Commodore box).
C64c boxed.
(the above may have had their sound chips "donated" to my HardSID soundcard).
C128 (with PSU).
Various C64 power supplies.
2 x C64 datassette.
1 x C16 datassette.
Commodore SFX music keyboard overlay with manual and tape; most of the black keys had snapped off, but I have eight of them loose).
1541 disc drive.
Spectrum+ with PSU.
N64 (no PSU or cables).
NES boxed.
Psy-Q SNES development kit (no software or manuals).
Rowtron console + 8 games.
Philips Cdi.
CD32 boxed (Spectacular Voyage pack).
A4000 EC/030.
A500 (with 1.2 ROM).
Amiga Videomaster digitizer for A500.
Amiga ProGrab RT24 digitizer for A500.
Moonraker 1 joystick.

In the office, I have:
Atari Lynx 2 with around 80 games, large carry case, small carry case.
Lynx Battery Pack boxed.
Somewhere I have another 3 Lynxes and various other offical Atari accessories. I'll dig them out.

Let me know when you want to come and get it all. :)

And if you have any questions, fire away.

Pages: [1] 2