We're using cookies to ensure you get the best experience on our website. More info
Understood
@mbuchmanRegistered August 11, 2009Active 5 years, 3 months ago
103 Replies made

You fill rand_num_table with a lot of random numbers. That’s how you get a random number out of my code. Then the only other trick is to try to keep changing the index value, which you would have to do with human input and timing stuff.

You gotta really take the time to learn c better so that all this stuff makes sense. Copying code you don’t understand is bad practice, and can lead to many problems. Then after you go through a lot of lessons and learn C (yes, this will take time), you can copy source code, but if you dont understand why something does what it does, ask on here so that you understand it. That way you can adapt the sample code based on your needs, and it further helps you learn the language. The best way I would reccommend learning C is with a good book, but you could probably find something fine online.

Keep in mind, a lot of us have had college level courses in programming which most likely included everything from assembly, basic, c, and c++ or java. And the difference between lower level languages (assembly and basic) and higher level languages (c, c++, java) is huge. Once you learn to use a higher level language, you can much more quickly create useful stuff.

The thing is, a cart that has been converted can still play the original game exactly as it was. The only thing I don’t like is the use of brand new games, I would prefer the games with the torn labels and beat up cases get used. I guess the question would be, would people still buy a FlashBoy if it was in a well used case? And the other problem would be the cnnector could be wore out (but most likely not).

you would do something like this…

int main() {
  int randNum;
  //... other code here...

  while(something) {
    e=e+1;
    if (e>60) {
      e = 0;
      randNum = getRandom(5);
    }
    // at this point, use randNum to refer to the
    // random number you just got
  }

I have to use the number 5 to get a value 0 to 4. 5 means 5 unique numbers (which would be 0, 1, 2, 3, 4). This makes more sense when you consider bases (binary is base 2, has 0 and 1. The one we use for everyday math which is decimal or base 10 has 0 to 9, which is 10 different numbers. Hex is base 16, which has 0 to f, which is 16 different numbers.)

I dont know if you are just testing or what, but with your random array of 1,2,3,4 it will not seem random at all (the first time you call the random function you will get 1, the next 2, and so on).

Oh, and the random numbers in the array should extend the whole range allowed for the type of variable you are using (so u8 would range from 0 to 255, unsigned int would range from 0 to 65535). The % operator will make sure it is within the range you want. The advantage of doing it this way is you can reuse the random array next time when you want a value between 0 and 9 without having to make a new array.

VirtualChris,

This random number method will not work for your application. The only way this random number generation will work is when you rely on user input as well.

Another way to generate “random numbers” is with random number tables. Basically, you make a large array, and fill it with “random” numbers. You could generate the numbers yourself by rolling dice. Here is a quick example…

static int rand_num_table[12] = {57, 2372, 572, 1217, 32131, 121, 21178, 7278, 3027, 182, 10979, 99};
int randomPointer = 0;

int getRandom(int range) {
  randomPointer++;
  if (randomPointer >= 12) randomPointer = 0;
  return rand_num_table[randomPointer]%range;
}

Now whenever you want a random number, you would just call getRandom() with the range (so if you wanted a number between 0 and 9, it would be getRandom(10))

Now this would be pretty boring because each game would be the same. So one method is to pick a new starting point by using the title screen, like with this code…

//display warning graphic
while (vbReadPad()==0) {
  randomPointer++;
}
  randomPointer %= 12;

You can get even more “random” by changing the randomPointer whenever a button is pressed. Basically, have a counter in your main loop, and any time it sees a button is pressed, add the counter to randomPointer, then clear the counter (and of course make sure randomPointer is in range).

You would want more than 12 random numbers in your table too, maybe use excel to generate a lot, or find random tables online. And you may only want to use u8 rather than int being you will probably not need a range greater than 255 and negative numbers are generally not used for random numbers. And of course you would need to change the number 12 in the above examples to the actual size of the array you use (use the sizeof feature if the compiler supports it, I didn’t check)

So what you should have learned by now is random numbers do not exist, but you can get “random enough” by incorporating tables, timers, and user input. All the above is from the top of my head, so use it as more of an explanation rather than actual code.

I have used Firefox and Opera.

Opera was cool, but several websites I wanted to go to did not display very good.

Firefox just seems clunky to me. I of course use it whenever on a linux box, but that is about it. Plus, any page that wants traffic will be made to work with IE, so may as well conform in my oppinion.

As far as cosmetics, I think IE8 looks better than Firefox. The top bar takes up less space, it loosk more modern, and I just like the layout better.

I decided to install Firefox on my main machine to see the differences, and yeah, I can see how the site works better in Firefox. But I still prefer to use IE for now.

I assume what doesnt work in Internet Explorer is the dropdown menu part? I don’t have anything else but IE right now. I actually really like IE8, and never saw the point to get any other browser. Basically, Microsoft stole most of the good features of other browsers and used it on their own browser, so IE8 is actually pretty good in my oppinion.

Anyway, if you made a Features, Community, and Extra page (like you have for News/Games/Hardware), then the dropdown menu would not even be needed. So if you don’t fix the dropdown for IE, at least add those pages.

I guess the best part about the new look is it looks like a modern website, which shows that the community is still alive. But I do miss the 32 bit look!

Gotta set a world first.

#include "libgccvb.h"
#include "font.h"

int main ()
{
	copymem ((void*)CharSeg3, (void*)FONT, 8192);

	vbDisplayOn();
	vbDisplayShow();

	
	vbTextOut(0, 1, 2, "AAAAAAAA");
	vbTextOut(0, 1, 3, "BBBBBBBB");
	vbTextOut(0, 1, 4, "CCCCCCCC");

	vbSetWorld(31, WRLD_ON|0, 0, 0, 0, 0, 0, 0, 384,224);
	vbSetWorld(30, WRLD_END,0, 0, 0, 0, 0, 0, 0,0);

	while(1) {}
}

Make sure the number after WRLD_ON| is the same as the first parameter you have for vbTextOut (in this case, 0). It is the bgmap that you are storing the text to.

For the first example, I don’t know which would be better to do, really probably just a personal preference, but I would wager the first way is easier to read and would execute quicker, and may even execute slightly faster (not that you would notice). So the example you gave takes up less space in C, but really it is just a matter of personal preference.

Second example, you could replace with a for loop, but I don’t know if I would.

What I would really do is have an image that I moved rather than redraw text. That would probably be the best. Then you would not need to do any clearing. But this is not my project, so I didnt do that.

And for the last comment, yes I messed up. But it should be

while(!(vbReadPad()&K_STA)

because if you used

while(vbReadPad() & !K_STA)

it would no longer care about the start button, and would end as soon as no button was pressed

I made a lot of changes to the code, tried to add useful comments.

I think you are going about this the wrong way. You should work on the core things first, in my oppinion.

For example, design and program the fight function, or the walking around function, something like that.

The idea is you build a component, test the component by giving it a good range of inputs, then go on to the next. Then when you are going along in the game, you can call the functions and you will know they should work.

Anyway, you are sort of doing it backwards by doing all the finishing work first (like the menu and story).

Good luck

Oops, I guess I did make an error there. Glad you got it working (well I assume you did)

You really should set up Programmers Notepad to be developer friendly. I decided to add how to do this in the dev wiki…

http://www.vr32.de/modules/dokuwiki/doku.php?id=setting_up_programmers_notepad_as_gccvb_frontend

Let me know if anything needs to be changed, it is my first addition to the dev wiki!

Ok, I made lots of changes. I notice you like to use {} to group things a lot. this makes it somewhat confusing, because you expect a loop or something in that area. So I commented out all that stuff, along with other stuff I didn’t find necessary. I only commented it out so you can clearly see what I changed. So delete all those parts.

I didn’t compile or test, but here are some changes that should get it to do what you want.

Hope this helps!

And if you have questions, just say “why did you do xx at lines y thru z?” Hopefully you have a text editor with numbered lines, otherwise get one (I have been using “Programmers Notepad 2,” it is free)

I agree with DogP… this thing just looks crazy.

As per your price example, take this into consideration…

I want to play NES, SNES, N64. So I buy…
RetroZone = 19+19+22=40
You = 55

Now a bit later I decide to get into Sega
RetroZone = 40 + 21 = 61
You = 55 + 35 = 90

Now lets say you make a generic box with 4 generic plugs, and you make adapters for each system. You sell the generic box for eh, say 40, and with that you throw in 1 free adapter. And you sell additional adapters for $5 each (because all it is is molded plastic and wires)

With the above example…
RetroZone still is 40 for the first part
You are now 50, a little more competitive.

For the second part…
RetroZone is still 61
You are now only 55, already a savings!

Or better yet, just break even with the hub (say maybe $20 or $25) and sell the adapters for $10 to make your money.

But if you are doing good with custom solutions, then stick with those I guess, but that box is pretty ugly and expensive.

Best of luck!

Is it easy to interact with a mouse? I had a project where I used a mouse with an FPGA, and it seemed pretty easy. I was probably planning on using a cheap PIC for mine.

Funny we are working on basically the same thing. I figure nobody will ever play my game being you will need external hardware (well, except you might being you have a mouse already working). I have no desire to make my game work with a regular controller because it just wouldn’t be as fun. I was thinking of maybe having a turbo button, or having it so you could use both d-pads to control your paddle (so if you pushed left twice, you would go twice as fast), but it just seems like it would not work well.

Having said that, maybe we need somewhere to put standards for new hardware. It would be a bummer if both our games used the mouse, but each mouse only worked with one game. It would be like if I couldn’t use the Guitar Hero guitar with Rock Band!

Wow, that sounds really good! I have been watching threads like this, but have not downloaded stuff or commented being I am not ready to use things like this (I am focusing on different things right now). But I promise, I, and probably a lot of other people, are interested, we just have nothing to say!

I am sort of working one one. I just started a few days ago. It’s my first VB program, so it probably will not be done in time, especially being it will require a custom controller

I want to make an air hockey game, and use a mouse rather than d-pads.

Oh, and I want to be able to use the link port and have sound, so basically nothing worthwhile will be released in time!

Also, I have other projects that have higher importance, so don’t know when this one will get done.

RunnerPack,

I used everything from Alumilite.com. I have no idea how much resin you would need, but you can get 2 gallons of the plastic resin for $94, shipping would be maybe $15 or so (I don’t know), and if you alredy have the molds then you would be all set. If you are doing it as 1 solid piece (rather than 2 halfs) then you may want to look into using a filler in order to save money on the resin. And if you don’t already have the molds, that will be another $30 to $60 for the silicone. If you are making the players as two halves that you glue together later then you would not have to worry about air bubbles, but if you do it as just one piece, you would probably have to use a pressure chamber or something. Alumilite seems to be geared at the hobbyist market, so I am sure they could alswer any quesitons. But that sounds like a pretty sweet idea!

As far as the dye goes, how could you dye plastic that already has a color? But really the whole point of the project was for a starter project in plastic molding.

Unfortunately I have misplaced the inside cardboard for my Virtual Boy. But all is not lost, the Virtual Boy game boxes fit perfectly inside the system box, so I store all of my boxes in the system box.

I would like to find something to hold my game carts, that would be ideal. Right now they are just loose. I may make a case based off of the Blockbuster case that would also hold game carts.

Attachments:

Unfortunately my scanner cannot fit the whole thing! But I see no problem becasue you can just mirror the one side. If a jpg or something would be better I could upload that as well, but if you give that to a taylor, they should be able to make you your piece.

Here is a PDF. Hopefully this will work for you!

I set the PDF to A4 paper, because if you use mm, then I don’t think you use letter sized paper in your country!.

Print it, make a few measurements based off of HorvatMs measurements to make sure it is good, then give it to the taylor 🙂

Attachments:

You are better off just getting games with good labels. It won’t be too much more money. And if the label is in that bad of condition, the cartridge may be too, or it could have been in a flood or something.