banner logo
Updates Blog Support Contact Links
Programming JdiWeb JdiMOO JdiBoy JdiMail JdiMOOpp NetCheck Tutorials
Gaming AVR Othello

Archive for the ‘REALbasic’ Category

End of Summer Update

Tuesday, September 1st, 2009

Believe it or not, the lack of updates is a good thing. It means I graduated and got a good job and I’m working hard. Ok, well, not good for the site or any of you people out there in Internet land, but good for me.

Anyway, I wanted to let people know some updates on what I’ve been working on in my own time. Remember all those AI post a few months back? Well, it’s not completely dead. I’ve been working through some AI tutorials that are rather practical, at least for games. The concepts are all there. I might post the project files if people are interested. (more…)

Preparing to annouce JdiBoy

Saturday, July 12th, 2008

I am preparing to publicly announce JdiBoy to the world. It hasn’t been secrete, but I am  fairly pleased with the progress thus far, and would like to release a simi-stable version in part to generate interest and feedback.The latest version will be available like always, but, periodically, a simi-stable version will be wrapped out and released.

In preparation for this, I’m probably going to update some site information, reorganize the project page, and possibly redo it from scratch (keeping content). I would like feedback on what you would like to see for this, like if you think it needs a blog, forums, CMS, bug tracking or something, or if the single page works just fine. I might break it off into separate about, news, and download pages, too.

Also, I would like to know what you think of a name for the project. Vote for your favorate in the comments: 1) JdiBoy 2) RealBoy 3) GreenBoy 4) Pinocchio, or something else.

Along those lines, icon suggestions would help. Or even complete icons if you are so inclined. With a new page, a new name (or an old one), and a new icon, I can push out this release.

IT WORKS!

Sunday, June 22nd, 2008

First off, I apologize for the outages. I upgraded the OS on my server, and it took a few days to put things back in order. It took a few more days to get this database back up. But everything is restored, and it seems that nothing was lost, thankfully. The last time I messed with my OS like that, I lost everything. But I took precautions this time.

While I’m still off topic, I’d also like to say that I’m enjoying my new job, learning a lot about systems administration, and how much things really cost for IT. I had a project where I audited all the backup tapes to find out how old they really are, and ended up making up orders for $10,000 worth of new tapes O_O.

Now onto the topic. The emulator works. I updated the project page when it happened and several people now know about it. But I thought I’d take the time to explain where the project is in full. I started with the C++ source code, and ported it to RB. That turned out to be the easy part, but it caused most of the errors. Stupid copy/paste errors. Stupid errors from not reading the original correctly. Then the hard errors where the original code was so complicated, and mine was so complicated, it just made it hard. But I tracked down many many many errors with that and got it to the point where it will run.

Now, bear in mind that it runs slowly. Even though the Gameboy only ran at 4MHz, what I wrote is probably terribly inefficient. I don’t know what all I can do to help it at this point, though. I did fix one thing a while back with the video. The original code wrote the image data to basically a memoryblock, then passed it out to an outside library for the video handling. Well, that’s not an option here, so I took that memoryblock and turned it into a picture. But that two step process proved very *very* inefficient. But now, I need to find more places like that in my code. I found a profiling utility from TrueNorthSoftware that should help me analyses my  code to find bottlenecks. Hopefully that will help a lot. I probably need to rework some of the dispatching code in the CPU class, and I might need to disable some background things in some functions. But I have a feeling that most of the problems lies with my code.

There are still glitches in at least the video portion of my code. I could try and track this down first, but it’s a pain to do so. Everything is so slow that it would take me hours to just get to where I needed to be in code to watch it go, then I might accidentally miss it.  So I plan on pausing real debugging while I remove the “slugs” as an article on wiki called them.

I also don’t have sound yet. I haven’t managed to figure out how the original sound code works. It seems to write some sound data to a memoryblock and pass it out to that external library. If I can figure out what format that sound is in, I can do something with it, I think. I have suspicions that it is WAV data. So I could possibly do something with that and play it, but I don’t quite know. It might also be possible to use declares to generate the sound directly, but that is also iffy.

So that’s where I stand on the emulator: Need to speed it up, then fix the minor glitches, then add sound. As this is an open source project, feel free to take a peak. Any assistance would be greatly appreciated. I’m trying to keep a list of who all has helped me so I can put it to be distributed with this.

Oh, before I forget: I still need a name. JdiBoy sounds kinda strange. I’ve heard REALboy (but I think that RS wouldn’t like that), Pinchioco (get it? ;) , and Greenboy (again, RS might have qualms, but it sounds interesting). Suggestions in the name/icon department would help greatly for you nonprogramming people, or those that don’t want to touch other people’s code.

EDIT: I had to repost this after things going nuts with my server. It’s the only thing that was lost except for comments that may or may not have existed. Please repost any missing comments.

Emulation part 2

Tuesday, May 27th, 2008

Many of you have probably been shown the page I setup for my gameboy emulator project. If not, click here. Anyway, I thought I’d post an update for the rest of you. The emulator now works…. mostly. It reads the ROM data for a game and it displays things on the screen. Past that, it’s dicey. Sound doesn’t work, yet. I need to find a way to have better control over the sound output., more than what I can easily find in RB. There is no good way to play a specific frequency, and I am not even sure what format the sound tables I already create are in. The video displays, but it is incredibly slow. It takes several minutes to display the first logo. But most of that is coming from the many many loops it goes through to convert a picture into a memoryblock and back. I think I will see about taking the memoryblock out of the picture (no pun intended). If I can eliminate the approximate 6 million loops iterations (2 conversions, 160×140 px images, looking up 256 colors in a loop (avg 128))  I have to do in the conversions two and from a memoryblock each time a line gets drawn, that would speed things up a lot. Everything posted up there is up to date as of this posting. If anyone has any idea on how to get sound going, that would be awesome.

Emulation

Thursday, May 15th, 2008

You all probably know that I like low level things in programming. I’ve covered compilers extensively. I’ve dealt with some embedded systems work which was fun. I’ve learned a lot though this, but, in the process, I stopped using Realbasic, using C, C++, and assembly instead, depending on what the task required.

Realbasic, as a language, just seem intuitive to understand to me. You don’t have strange things like the ternary operator in C, or strange macros, or pointer craziness. I know from experience, that going through that is helpful and sometimes you have to, but RB seems to be really good about some things.

Because RB is so nice about some things, yet so different than some other languages,  I occasionally will translate a piece of code to RB, from, say, C. This proves challenging enough that it requires both good knowledge of C and RB, and it also forces me to understand the code that I’m writing more than just reading it.

One thing that I had been looking at was how to play video game music, specifically on a small embedded system I have. But that was proving overwhelming. I didn’t know how the sound systems worked or how to emulate them. So I took a step back. I thought about how emulators worked. This got really interesting, and I figured, hey, maybe I can do this.

So I went out and found some an open source Gameboy emulator written in C++. I chose a gameboy emulator for several reasons. First, the system is old and slow, so speed issues would be reduced, even maybe to the point where I’d need to slow down. Newer systems might run to fast for mine to keep up. Hey, it’s my first time out. Second, the gameboy has a builtin screen, so video output gets written in specific ways to display directly to a screen. An NES might have to have additional layers to convert it from an analog TV signal to something to draw. Finally, I was told that the almighty SNES had some crazy special modes that hurt people’s heads to manage. Again, it’s my first time out.

I found a nice emulator (I haven’t actually run it) written in object oriented C++. This makes it easy to understand and translate into RB. There’s a GameBoy class that has a Cartridge, a CPU, and buttons, the CPU has some memory, a ROM, some timers, and such. It just breaks down really well. Probably not optimized like other emulators would have to be, but this is how I would probably make an emulator starting out, replicating the real thing in code.

I’m in the process of porting the CPU code to RB right now, and let me tell you, it’s a lot to it. Just because there is one “add” keyword in the assembly doesn’t mean there is one “add” opcode. Depending on where the data for the add operation is coming from, the opcode changes. So then you have 16 different add functions, which then call another function that actually does the adding.

I think I’ll post sections of the code as I finish them on a new project page. The project that I’m basing mine on can be found here. It’s called Mario there. I’m open to suggestions for a name for this project, though.