You are not logged in.
Lost Password?

All Posts (Greg Stevens)




#111
A little help with VB frame buffers
Posted on: 2012/11/12 2:02
Nintendoid!
Joined 2012/8/5
USA
117 Posts
CoderLong Time User (7 Years) PVBCC 2013 3rd
I've been messing around a little to get a better feel for how the VB does things. I've searched the forum for some examples and I found a few and tried every one that I found with no luck. I'm just playing around and trying to directly draw to the frame buffers. Currently this code just draws 5 objects that resemble cubes. That's it nothing else. It does work and shows up on the screen but I can't get rid of the "flicker". I'm sure I'm missing some fundamental piece of information as to how the VB handles the frame buffers but I just can't seem to get it. I attached my code to this post. Sorry for the mess... I'm just hacking away at stuff and I've never programmed in C before so keep that in mind before criticizing my code to hard :). I'm just hoping one of you experts can take a quick look and point me in the right direction. The screenControl() function is where I'm trying to handle the frame buffers and I basically took this code from the hunter game source from danB. I also compared it to some examples posted on this forum and it looks to me like I'm doing the same thing as everyone else but obviously I'm not.

Thanks.

Attach file:


c GameTest.c Size: 5.25 KB; Hits: 189
Top

Topic | Forum


#112
Re: English Version of Space Squash ROM
Posted on: 2012/11/1 3:54
Nintendoid!
Joined 2012/8/5
USA
117 Posts
CoderLong Time User (7 Years) PVBCC 2013 3rd
To give a quick answer to how I'm patching the roms right now I use 2 tools. A hex editor currently hexcurse (I'm a linux geek) and reality_boy compiled in debug mode. So to find characters (and I'm talking about the 8x8 pixel images used for all "characters" English and Japanese alike) reality boy will show all that information through the visual debugging screens. From there you just need to put breaks on the memory areas for CHARACTER RAM, BGMAPS, WORLDS, and OBJ's to find out what instruction is writing to it a given point in the game and from there just start editing the rom in hex to change whatever you need. In the case of the most of the dialog on Space Squash it was as simple as replacing the character index for a Japanese character with an English character index. Other spots (where they decided to store character indexes as bytes instead of words) I had to overwrite the data areas that stored the compressed Japanese Characters with the compressed English characters and then I was able to modify the character indexes. The more complicated stuff like the intro story which was an entire compressed BGMAP I just re-wrote from scratch using their compression routine and English character indexes to replace the original BGMAP.
Top

Topic | Forum


#113
Re: Space Squash translation
Posted on: 2012/11/1 3:06
Nintendoid!
Joined 2012/8/5
USA
117 Posts
CoderLong Time User (7 Years) PVBCC 2013 3rd
I've been away from the site for a while but I figured since my bro posted the patched ROM I'd add my two cents about everything I've found out about patching this Rom in case somebody much smarter than myself wants to take a crack at getting the final pieces into place for the translation. Space Squash was a bit of a challenge when compared to SD Gundam for example because of a couple of reasons. 1st It appears to me that this game was probably written in straight ASM by real ASM programmers (unlike myself who am just a hack). They maximized every ounce of space they could and one way the did that was using compression. It was very simple compression but compression non the less. This usually causes for example an entire BGMAP or CHARACTER RAM area to basically be a continuous stream of bytes that you can't just jump into anywhere. They used a simple compression routine which starts with a bitmask followed by bytes or words(2bytes) depending on the bitmask. So for example a bitmask of C0 (1100 0000) means that for the next bytes you'll read a word for each 1 and a byte for each 0. So the next string of bytes might look like (00FF)(00FF)(01)(02)(03)(04)(05)(06). I haven't been working on this in a while but if the bitmask is a 0 then the byte represents the CHARACTER INDEX in CHARACTER RAM. If it is a one then (and here's were I'm a little fuzzy right now) one byte of the word plus 1 nibble of the next byte tells you how many bytes back from current position to move in memory and the other nibble tells you how many times to loop starting from that byte going forward to copy bytes into the current position with a maximum of 13h (19 decimal) bytes and a minimum of 3 bytes copied at a given time. So using this simple compression 2bytes or 1 word can represent up to 19bytes of any sequence.
2nd The other thing they did commonly was store CHARACTER INDEXES as a single byte and use a constant offset to grab them from RAM. My other issue is that since the area of RAM that stores the offset is hit by like every single loop and function in the entire game I'm having a hard time tracking down the ASM code that is placing the offset into RAM for example to alter the in game character names and use English characters since the English characters are stored at a different offset in CHARACTER RAM. It would be fairly simple to change once the instruction(s) were tracked down but you can't just put a break or watch on the memory area because every it breaks every couple of instructions. I tried for about an hour to trace through the ASM code to try to find it and didn't get anywhere. At this point I'm not saying that I've completely given up but it's definitely not at the top of my priority list right now.
Top

Topic | Forum


#114
Re: Virtual Boy development on Linux.
Posted on: 2012/8/16 4:15
Nintendoid!
Joined 2012/8/5
USA
117 Posts
CoderLong Time User (7 Years) PVBCC 2013 3rd
I'll probably give that a try here next week. My first post here was simply to share my last couple days of trial and error and give a starting point for the other 3 or 4 people who use Linux exclusively and wander on to this site :). Also, since I don't have a lot of time to read through all the posts I didn't actually know about the VBDE. I saw it mentioned but didn't see it under the tools section of this site so I actually just thought it was a typo for VIDE. (Can you tell I'm still wet behind the ears with this whole VB Dev thing). I'll use your links and see if I can get it running on Linux.

Thanks.
Top

Topic | Forum


#115
Virtual Boy development on Linux.
Posted on: 2012/8/15 23:59
Nintendoid!
Joined 2012/8/5
USA
117 Posts
CoderLong Time User (7 Years) PVBCC 2013 3rd
The purpose of this post is to help any newbies out there (like myself) who would like to develop vb games/roms on Linux but don't want to have to deal with M$ Windows. I've messed around for a few days and have been able to compile a demo through Linux only apps and get it run on an actual Virtual Boy. Perhaps there is a post somewhere already explaining this but I couldn't find it. So here is a step by step on how to get to at least a good starting point for developing VB Games on Linux.

Again the purpose here is to not have to use M$ Windows for any reason so I'm obviously excluding the options of setting up dual boot or running virtual machines. Also I'm running Ubuntu (Debian based) although I believe this should work on any flavor of Linux.
I was unsuccessful in compiling the source for gccVB 2.95. I tried to fight through the errors but not being a C programmer they were beyond my limited nowledge of C so I tried something else.

1st. Download / Install all necessary software.
Install WINE (windows emulator) (open source and not technically windows)
From a command prompt:

sudo apt-get install wine

After wine installs (providing you used all default options) you should have a .wine folder under your home directory. Inside that folder should be a folder called drive_c
Make a new folder called gccVB in drive_c
From a command prompt:

mkdir ~/.wine/drive_c/gccVB

From the planet virtual boy site download gccVB ver 1.0 http://www.planetvb.com/content/downloads/tools/gccvb.zip
save the gccvb.zip file in ~/.wine/drive_c/gccVB/
unzip the file.
From a command prompt:

cd ~/.wine/drive_c/gccVB/
unzip gccvb.zip

From the planet virtual boy site download gccVB ver 2.95 (Source)
http://www.planetvb.com/content/downl ... ols/vb_v810_gcc_03.tar.gz

Make a temp directory somewhere and move the vb_v810_gcc_03.tar.gz file into that temp directory
cd to the temp directory
untar the file

From a command prompt:

tar zxvf vb_v810_gcc_03.tar.gz

We need two files from here to get roms to work on an actual virtual boy.
Inside your temp directory should be a folder called vb_810
cd into that folder
Copy the files to our gccVB ver 1.0 installation
From the command promt:

cp crt0.s ~/.wine/drive_c/gccVB/lib/src/
cp vb.ld ~/.wine/drive_c/gccVB/lib/

Now we need to compile the crt0.s so cd to the directory we just moved it too.
From a command prompt:

cd ~/.wine/drive_c/gccVB/lib/src/
wine cmd
make
exit

Now our goal is to compile the example that came with gccVB so with your favorite editor we'll need to make some changes to some of the files since there seem to be syntax errors right from the get go.

From a command prompt:

cd ~/.wine/drive_c/gccVB/examples/hello3/
nano hello3.c

inside int main...
uncomment the line that looks like
// vbSetColTable();
at the end of the source file are two macros called OBJ_YSET and OBJ_PSET.
Change these to OBJ_SET_Y and OBJ_SET_P
save your changes

now cd into the include folder
From a command prompt:

cd ~/.wine/drive_c/gccVB/include/vb/
nano object.h

The following macros are missing semicolons that need added Before the “} while(0)” in each case.
OBJ_SET_X
OBJ_SET_Y
OBJ_SET_P
OBJ_SET_PAL

save your changes.

Providing I didn't forget any steps you should now be ready to compile your first vb rom that will run on a real virtual boy using Linux without the need of M$.

From a command prompt:

cd ~/.wine/drive_c/gccVB/examples/hello3/
wine cmd
c:\gccVB\bin\make c:\gccVB\examples\hello3\ hello3

If you don't receive any messages then the source should have compiled and you should have a new .vb file. Again this is a starting point to get you going with Linux. From this point on you can customize until your hearts content.

You should also be able to run the rom inside of reality boy using wine as well.

From a command prompt:

cd ~/.wine/drive_c/gccVB/examples/hello3/
wine (directory of reality boy exe)/reality_boy.exe hello3.vb
Top

Topic | Forum


#116
Re: Classic Gaming Expo
Posted on: 2012/8/11 17:37
Nintendoid!
Joined 2012/8/5
USA
117 Posts
CoderLong Time User (7 Years) PVBCC 2013 3rd
I've noticed at the initial start up of the emulator there is a significant lag time before the controls start to register. It's about 30 seconds on my machine. After the 30 seconds are up if you're using the default controls either 'Q' [start] or 'Z' [A button] should get most games to start moving. If it's running slow after that you can increase/decrease frame skip using +/-. I know when I first started using the emulator I didn't think anything was working either but I just wasn't waiting long enough for everything to initialize. As for wine. To compile using the assembler program it should be as simple as
linuxprompt> wine /directoryToAssembly/VBASM.EXE hello.asm -o hello.vb

using the gccVB version 1.0 I actually run wine in cmd.exe mode in which case it would be
linuxprimpt> wine cmd.exe

windowsprompt> /pathTogccBinDir/make.bat /pathToSource/ sourcefile

notice there is a space between pathToSource/ and the sourcefile name. Also no extension is used as the make.bat file takes care of it. It's all in the readme for gccVB 1.0

hope this helps.
Top

Topic | Forum


#117
Re: Classic Gaming Expo
Posted on: 2012/8/10 23:15
Nintendoid!
Joined 2012/8/5
USA
117 Posts
CoderLong Time User (7 Years) PVBCC 2013 3rd
I use linux on all my machines. I'm able to run reality boy just fine with wine (although it's a little slow on my netbook... but it's a netbook). In fact I used the reality boy debug windows exe to create the SD Gundam english patch Ben and I just released. I'm not able to get the most recent version of gccVB working either. Some kind of bug with the version of GCC that gccVB was based on I think... But the VBASM (assembly) compiler works just fine through wine. I can also compile with the older version of gccVB through wine if you want to download that one. I haven't messed with it much but it will compile and run roms in the reality boy emulator just fine. If you try them on an actual VB though it doesn't display anything. I've only messed with it for about an hour so it's probably just something needing added to to the VB INIT function but I haven't tried to figure it out yet.
Edited by Greg Stevens on 2012/8/10 23:39
Edited by Greg Stevens on 2012/8/10 23:40
Top

Topic | Forum