We're using cookies to ensure you get the best experience on our website. More info
Understood
@imaspidermanRegistered August 5, 2012Active 6 years, 6 months ago
107 Replies made

Does it also occur in an emulator or just the hardware?

I agree with thunderstruck as well. Lets just celebrate. Id love to see artwork, 3d models, music, demos, tutorials whatever. Probably because I have little to no talent in most of those areas so I’m easily impressed by those things.

There are some simple tricks for getting a random number. Using the timer combined with user input works pretty well. Since user input is really the only truly random aspect of gaming it works pretty well. So a combination of the timer and when for example somebody hits the start button could be a random seed for setting up enemies before a level starts. It’s pretty unlikely that a person will hit the start button at the exact same microsecond everytime they begin playing a game. Also updating a random number depending on each button push helps to. So for a simple example if the player presses up you increment the number by 1 if they push left increment by 2 if they push A increment by 5 etc… That usually gives a nice randomness to a number that can then be used anytime throughout the game. Of course you don’t need to just add, you can shift the values left and right or whatever you like.

This sounds like fun. I’ve been wanting to try to develop an emulator but the project always seems to overwhelming for what little time I have. I wouldn’t mind pitching in a little. My C skills are probably average but I’m a quick learner and an expert Googler 🙂

That looks awesome! After you publish that maybe some of artists out there can put some sprites out for the artistically challenged programmers and we can stop stealing err umm borrowing graphics from existing games 🙂

I started out just going through the Games->Homebrew->Demos->Beginner Samples to get started. There are a bunch of examples in there most of which have the source code with them. For the compiler i use the VBDE VBDE. Kr155e may have a newer version of this somewhere but this is the one I’ve been using. Although I just found out that the precompiled version of gccVB V2.95 currently gives much better performance if you’re looking to optimize but isn’t nicely bundled with an editor and other utilities like VBDE. You’ll also want the VB Sacred Tech Scroll from the documents section of the development area of this site. I actually got started on all this by helping out my brother hacking in some translation patches for a few commercial roms. From there went to the homebrew code, started compiling and tweaking that code and then built the wireframe library from there. I have to admit it’s a lot of fun being able to code for an obsolete system and although the community here is relatively small you can always get help when you need it.

I have to admit there is a lot of code posted in the homebrew section that was compiled on older versions of gccVB and may have some syntax issues when trying to compile on the current VBDE but if you’re familiar with troubleshooting compile errors you shouldn’t have any issues fixing the few bugs you may come across.

Good luck.

  • This reply was modified 10 years, 7 months ago by Greg Stevens.
  • This reply was modified 10 years, 7 months ago by Greg Stevens.

Here are two test roms to show the difference in performance. It’s 4 rotating spheres and I use an interrupt timer. I can only run in mednafen and I know that mednafen timings aren’t accurate to real hardware but it should be accurate to the number of instructions being executed. VBDE.vb is the current compiler and has a timer count around 10,000. V295.vb is the same code with the old compiler and it runs around 2-3000. Also Ben tested my Star Fox demo compiled on the old compiler and said it ran much better on the actual hardware.

I can post this test code as well if anybody thinks it’ll help.

Attachments:

Tried the version Kr155e sent and it didn’t work. The errors show up as soon as you try and add the -O to the compiler options in the make file. The functions it can’t find are in the lib1funcs.asm so I’m guessing this file is missing from a patch somewhere since the definitions can’t be found.

KR155E just sent me an updated version of VBDE with all patches so I’m going to give it a try and see if it works.

I’ll post after I’ve tested a bit.

I just moved my project folder and manually compiled it. I didn’t try to add it to vbde. Ill be messing with it more this week at some point.

For all of us using VBDE I think we need to revisit the optimization errors received when adding -O to the gcc compiler options. This last coding competition taught me something extremely important. The old compiler (Which at least DanB is still using) works with the -O compiler option. IT MAKES A HUGE DIFFERENCE in code performance. The options I found and added in this post don’t even begin to touch the performance of the old compiler with -O. I compiled my wireframe library using the old compiler (v2.95) and my code instantly ran 4-5 TIMES faster than running my code using the assembly versions of my functions on the compiler packaged with VBDE.

Unfortunately I’m a linux geek and compiling on my system isn’t going to benefit too many people other than myself.

I tried once to compile gcc using patches that I found on this site from other posts but have never been successful. There’s always something that comes up that I have no idea how to fix. (Of course I’m a total amateur at C and C++ so that’s not really saying much).

Thanks to Thunderstruck for compiling DanB’s zpace racers and pointing out on the forum that it ran much slower than DanB’s demo. That little nugget directed me to try my code on the old compiler which I had never tried before.

For now, I’ll be switching back to the old compiler version because I can basically eliminate all of my assembly routines and code directly in C since the performance difference is not noticable when using the -O or compiling with my assembly version functions.

Congrats. Im still speechless 🙂

So Thunderstruck just pointed out to me something I forgot to mention to anybody attempting to use the Library. By default the C code versions of the functions are compiled. You will see that this works but is slow compared to my demo. Inside the functions are #ifndef __ASM_CODE statements so I toggled the compiling of the assembly version by using a defined variable. To define the variable you just need to add -D__ASM_CODE to your gcc command inside your makefile. This will define __ASM_CODE and cause the ifndef statements to compile the assembly versions of the functions instead. I did this for two reasons. 1 to prove that the assembly versions of the functions were indeed faster and 2 I find it easier to write a new function in C and then convert it to assembly after I’m sure the function works.

Also, and this one is a little embarassing, I used a global camera variable for most of the functions. I mistakenly left the define of that variable inside my GameFunctions.h instead of putting it inside the G3d.h. So if you’re going to start a new project from scratch just add
camera cam;
to G3d.h somewhere and you should be good to go.

Thanks for trying it out and catching that Thunderstruck 🙂

I’m posting my makefile as well along with the ObjFileParser I wrote in java to import 3d Wavefront OBJ files.

The syntax to use the ObjFileParser is (from a command prompt)
java -jar ObjFileParser 50 3 filename.obj > output.h
The 50 is a scaling factor and can be anything > 0.
The 3 is the fixed point scale factor and should be 3 if your using my library as is.
This writes to standard out so > output.h will put the output into a file.

  • This reply was modified 10 years, 8 months ago by Greg Stevens.
  • This reply was modified 10 years, 8 months ago by Greg Stevens.

I ran it in mednafen with zelda and it seems to be working fine. I’m still speechless.
It seemed to run fine using the following command.
rominjector.exe gbemu.vb LegendOfZelda.gb
It seemed to pad it to 1024k automatically. I can’t try it on actual hardware though so I won’t be much help for that.

I’m freaken speechless……

This is really cool. My first attempt I died shortly after starting level two. 🙂 Apparently I’ve spent too much time coding and not enough time playing. Nice work guys.

Nice job. Very clever. I like the 3D words idea as well. I don’t think I would have thought of that.

Seriously nice work. Music is great, sound effects great, graphics great. I just beat it on mednafen. I can’t wait to play it on actual hardware.

$&^#% I can’t make it past 12. Apparently I suck at these types of games. Very cool game.

Very cool. Great work.