Taping the cables definitely doesn’t work… you may be able to use hot glue, which will melt the glue on the cable, but it’d probably be pretty messy. As long as you don’t turn the oven on too high, there’s no problem. I’ve also had good luck using a clamp to squeeze the cable to the board while in the oven, since you really need to apply pressure to the cable/board while the glue is still hot. I just happened to have a perfect size clamp, but if you don’t, you could probably use clothespins or something similar.
DogP
Yeah, the ROM isn’t available anywhere for download AFAIK. And although Nintendo doesn’t make money off the VB, the game creators (I believe Bandai in this case) still own the rights to the game and it is still illegal to pirate the game (although it is unlikely that they would file charges).
DogP
If you have the tools to open the system you can probably repair it yourself. I’ve got a page set up for display repair on my site: http://projectvb.vze.com .
DogP
Oh yeah… you’re right… since the local variables are on the stack, the size will grow down… or up, depending whether you’re talking CS or EE 😛 (some draw memory with higher addresses at the top of the drawing, others draw it at the bottom). So yeah, if you use too much memory, you’ll overwrite your static memory, and then go into the 04XXXXXX memory space (unless they start the stack at 05FFFFFF which would also work because memory only decodes the lower 16 bits). Maybe you should declare an initialized global variable and keep checking it to make sure it hasn’t been modified (either in your running program, or put a watch on that memory location in the emulator). Or you could just log all WRAM access in the emulator and check the log to make sure it looks right.
DogP
Cool, yeah… I’m not sure whether this is the cause of your problem, I just remember having a similar weird problem when one of my programs got too large and that ended up being the cause. I just remembered about something though… not sure if RB does it, but I know in RD you can put a watch on a memory range… maybe you can watch 5010000 to 5FFFFFF and run your program, then you’ll know whether it’s going out of bounds.
And I’m not sure what your recursion does, but if you’re not careful you can definitely eat up the stack REALLY quickly.
DogP
Yeah, it’s been a while since I’ve done compiler stuff, but IIRC all local variables will go onto the stack, including local variables of main. You can keep it from doing this by declaring them static (like: “static int variable[40];), or if you make them global they’ll automatically be static. You could also manually add up all declarations from your source and see how much you’re actually using.
You might want to try emailing Parasyte… I haven’t talked to him in a long time, but he used to be around a lot and definitely knows a lot more about this than I do. He may know of a better way to determine actual memory usage. You could also compile your own version of RB/RD that checks/logs any WRAM memory access.
DogP
Wait, that doesn’t sound right… I just read back and you said you’ve got a virtual heap of 8K (I assume you’ve just got it defined like char heap[8192];). You should at least see that amount being allocated.
DogP
Hmm… okay, well if it seems right that you’ve only got 430 bytes of memory allocated (both initialized and unitialized), then that’s probably not your problem. Of course without seeing what you’re doing I don’t know if that’s realistic. You could check it by adding an array and make sure that it goes up by the correct amount.
As far as the emulators go, no… at least last time I used too much memory RD didn’t seem to care… it’s still a valid memory address and I’m guessing either it overwrites memory somewhere else or just writes to nowhere, but I don’t believe that it wraps like it does in real hardware (when I was working on the Gameboy emulator for VB I used WAY too much memory… it still booted on RD, but wouldn’t do anything on the real VB).
Also, I’m not sure if you’re using objects or not, but if you are, you probably want to check out DanB’s OBJ Pointer Demo if you haven’t already. I remember him talking about how the emulation of OBJ’s isn’t correct which caused things not to appear when they should be.
DogP
Actually, that looks fine… 07XXXXXX is ROM space, which you have plenty of… 05XXXXXX is WRAM space, which is limited. But you don’t have a .comment section from when you entered the command I posted? It may be different for the new gccVB, but with mine I get a .comment section, which shows the last addresses of the WRAM space used. You can’t just look at the .data section since that’s only initialized data… you need to also know how large the .bss section is since that’s the unitialized data. And you should be able to add up the size of the allocated memory from each .o file.
Maybe this will work better: objdump –headers file.o > file.txt . That should tell you all the sections along with the size and stuff. Here’s one before I had any uninitialized data:
file.o: file format elf32-v810 Sections: Idx Name Size VMA LMA File off Algn 0 .text 00002000 07000000 07000000 00002000 2**1 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .rodata 00000028 07002000 07002000 00004000 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 2 .data 00000088 05000000 07002028 00005000 2**2 CONTENTS, ALLOC, LOAD, DATA 3 .bss 00000000 05000088 070020b0 00001088 2**0 ALLOC 4 .comment 00000026 05000088 05000088 00005088 2**0 CONTENTS, READONLY
and after I put in an “int test[4000];” global array:
file.o: file format elf32-v810 Sections: Idx Name Size VMA LMA File off Algn 0 .text 00002000 07000000 07000000 00002000 2**1 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .rodata 00000028 07002000 07002000 00004000 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 2 .data 00000088 05000000 07002028 00005000 2**2 CONTENTS, ALLOC, LOAD, DATA 3 .bss 00003e80 05000088 05000088 00001088 2**2 ALLOC 4 .comment 00000026 05003f08 05003f08 00005088 2**0 CONTENTS, READONLY
You can see that the size column of .data and .bss is the actual RAM usage (.bss being the new array of 4000*4bytes=16000=0x3e80). .comment is also in the RAM area, although I’m not sure why it’s there… which may be why it’s not showing up for you (David Tucker may have removed it in his build since it shouldn’t be necessary). So if you do that for all of your .o files and add up the size of all the .data and .bss sections, that should tell you the total RAM usage. The numbers are all in hex, and make sure it doesn’t exceed 0xFFFF.
Hope this helps.
DogP
Not sure if this will help, but what I usually do when I get a weird bug is put in VIP_REGS[BKCOL] = 3; to try to pinpoint where the execution goes wrong (make sure you have the display enabled first with vbDisplayOn() and vbDisplayShow()). If the background turns bright red, then execution is fine through that point.
If you haven’t already, you probably also want to check your memory usage… the VB only has 64KB of WRAM, and with a large program it’s not that hard to use it all if you’re not careful. I’m sure there’s a better way to check, but the way I know of is if you go to the command line and type “objdump -s –start-address=0x05000000 –stop-address=0x05FFFFFF filename.o > filename.txt”, then you should see at the end a .comment section with some junk about the GCC version, but on the left of each line will be an address. Make sure the last address used isn’t larger than 500FFFF. If it is, then you’re trying to use more memory than the VB has. Of course to do this you need to make sure that you’ve still got your .o file (some of the bat files automatically delete them when they’re done, so modify the bat file if it’s deleting the .o’s).
I hope this helps.
DogP
No… you need a special screen to use polarized glasses. If you got the proper equipment to be able to use polarized glasses, it wouldn’t be hard to add the functionality into the emulator, but the equipment isn’t cheap. If you’re wanting something that’s not Red/Blue, you could do shutter glasses… I don’t think any of the emus directly support them, but it wouldn’t be too hard to add the support (I started to work on using shutter glasses, but got busy on other projects). That basically requires a CRT and not LCD though. You could also do a HMD with a true stereo display.
DogP
Heheheheh… sorry :-P. I’m using the Parallax Propeller for all the processing and video output. I have all the data from the displays clocking into a FIFO, which the Propeller then reads into memory (the prop isn’t fast enough to get data directly from the displays without missing some data). The prop then outputs that to the TV using 3 outputs and some resistors. I’ve got a plan for adjusting the brightness like the real VB, but I haven’t implemented it yet since that’s not as important.
If I was using a VGA output (which the prop can do), I could sync 2 props and output one to the red signal and one to the blue signal using 2 different circuits, but for TV it’d be a lot more complicated since the RGB is mixed in the chroma signal.
BTW, I wasn’t able to find any datasheet for the AD714, are you sure that part number is right? And if you’re into this kinda stuff, you should pick up a Propeller proto board… comes with most of the stuff you need on a nice PCB for $20. You’ll just need to make yourself a serial cable or buy the $30 USB plug. It is a 3.3V device, so you have to use some resistors to interface w/ a 5V device, but it’s not a big deal.
DogP
Heh… sorry guys, that was my version of an april fools update 😉 (since Ferry didn’t do one this year). That is the real hardware shown, and that is an actual screenshot, but just converted from a BMP :D. I am actually getting video from the display, but only 2KB at a time (about 1/10th of the screen) since it’s just a high level test software… I still need to rewrite it in ASM (to keep up I need to take ~26 cycles or less). I should be able to get the data into memory, but I’ll probably need to rewrite the TV driver.
About 3D, the biggest problem is that there isn’t enough memory for 2 full framebuffers (one for each eye). I’m looking at using external memory, but the Propeller doesn’t really work like most uC’s for external memory (no address/data pins, just GPIO). If I do interlaced I can do 3D (half of the vertical resolution), but I think shutter glasses would be better (although red/blue should work too). Parallax is supposed to be coming out with another Propeller chip in about a year that should have more memory, so 3D may have to wait for that.
And the VB is 12:7 aspect ratio, so you should be able to get that on the 16:9 TV (VB would be 15.43:9).
DogP
*Yawn* Ugh, it’s 5AM and I’ve been working on the display all night, but I think it’s finally working 🙂 . Here’s a few pics.
It’s pretty funny seeing Wario that big 😉 .
DogP
Attachments:
I’ll document everything when I’m done, but basically the outputs of the video display go into a FIFO, which the microcontroller then reads and stores into memory. The display software reads the memory and outputs it to the TV.
The microcontroller is a Parallax Propeller, which is basically an 8 CPU microcontroller. This allows parallal processing like controlling a TV while reading data from the FIFO, and also filling up local memory with display data, and then when the local memory fills up, it transfers it to the public memory while another CPU starts getting the display data.
DogP
Uh… that’d be really dumb of them to design something remotely resembling the VB. Especially with the stand again… if they were to do something like it, I could see something designed more like the Sony Glasstron: http://cgi.ebay.com/Sony-Glasstron-Personal-LCD-Monitor-PLM-A35_W0QQitemZ190093952693QQcategoryZ39828QQssPageNameZWDVWQQrdZ1QQcmdZViewItem . My personal opinion is that they shouldn’t bother making another system, but instead make it as an add on to the Wii. I don’t believe it’d be very hard to make true 3D out of what they have now, since you can do true 3D on PC DirectX and OpenGL with just driver support, and the even N64 emulators are in true 3D.
I do see there being a problem with a wireless headset and a wiimote that is used for action though… there’d be so many people swinging their arms and breaking stuff/hitting people and walking into stuff. For that reason, shutter glasses would be good, but the low quality of the image, and not being able to support LCD and Plasma would probably be a huge marketing problem.
DogP
Yeah, I tried using webcams, and have recorded several videos like that, but the quality is bad and there’s a lot of flickering since they’re not synced (and there’s a diagonal roll since the camera scans vertically and the VB scans horizontally).
What I’m using is a microcontroller that grabs the frame from the VB display output (digital signals) and puts it in memory, and then draws that to the TV. I’ve still got plenty of work to do on it, but hopefully I’ll get some time this weekend to mess with it.
DogP
Heh… yeah, lots of matrix stuff w/ affine. You could try emailing David… he may be able to help out.
DogP
Looking at the name of the file, and what the file does, I’d assume it’s David Tucker ( http://www.goliathindustries.com/vb/ ). If you haven’t already seen it, he’s got a document about affine programming available in the programming section of his site.
DogP