We're using cookies to ensure you get the best experience on our website. More info
Understood
66 Replies made

*Signs*. So… I beat BOTH Normal and Hard (all treasures) in under 2 hours, but I didn’t get the controversial ending; The first time, I got a magic carpet with nothing, and the second time, I got Demon Head to pilot the magic carpet :D.

HorvatM wrote:
What OS do you use?

Actually, Windows :P, but chances are by the end of this year, I’ll switch to Linux or BSD full time. Just looking out for those who use a Unix besides OSX. Additionally, since other users use a Cygwin version of gccVB, and my build system (SCons) can run on Cygwin, a cygwin version I’m sure would be useful so that the build system can run to completion (I’m not sure if Windows exes can be called directly from Cygwin).

The more I think about it, the more I think including the raw assets and generating the source files makes sense.

I’m open to suggestions. In particular, if you mean the listing file idea discussed a few posts ago, suggestions would be really welcome, because I’m not entirely sure myself how it should be implemented.

If you refer to the ASM output, I have a tool on github (disasm-utils) which can take your binary output and convert it to an ASM file.

HorvatM wrote:
Maybe there should be an option to use a file that contains a list of files to process and how to name the resulting arrays? This way, it would also be possible to specify different settings for each image and different output filenames.

This. This would be a very useful feature for me. I’m running into the same issues as thunderstruck, since my build system never leaves the top level directory. My “real” source files expect a specific format for the char and bg array names, and path qualification with screw the expected names up.

Search appears to be busted right now, only returning results on the last page.

Are “sporadic horizontal lines that are at max red brightness” indicative of a faulty LED cable? If so, looks like I’m buying a longer security bit XD.

I honestly can’t tell if it’s an issue with some games drawing objects at the wrong time, reading “incorrect” data the cartridge/FlashBoy (particularly acute with Jack Bros sometimes), or a bad ribbon cable.

The lines range from sporadic lines of various lengths at various y-positions, to a nice even horizontal stripes every 8 pixels or so.

Actually, I’m not sure if I’m precise enough to do this soldering without screwing it up… :/

But the LEDs are interchangeable? Meaning if I broke it, I could buy another broken VB and scrap it for the LEDs inside?

A bigger concern of mine is why do I care XD?

In actuality, I just want to understand the hardware’s timing so that I can write code that modifies framebuffers/registers with confidence that it will work on real hardware. I don’t want to get into the situation where I write something, expecting it to work 100%, and then I stumble upon an edge case, and struggle to figure out what went wrong.

At that stage, most likely I will have missed a minor edge case timing detail, and my code finishes JUST at the right time to screw up. Or worse: it’s a race condition that triggers seemingly at random :/.

HorvatM wrote:
Yes, and in fact at least 32 pixels off-screen in any direction. The X and Y coordinates are 16-bit anyway, so even larger numbers shouldn’t be a problem.

Probably the VIP just culls the object from further processing at that point.

This is what confuses me: Compared to drawing backgrounds, drawing objects is slower and requires more ROM space.

Why would it require more ROM space? The character format is the same and the last halfword of an object is the same as a BGMap tile. So you can store a sprite as a BGMap and (manually) convert it to objects when displaying it.

Because I don’t read technical manuals carefully :P.

Or changing the world’s MX/MY/MP properties, which is much faster. You just put a sprite sheet on a BGMap.

MUCH better idea :P. Also, swapping chars out probably isn’t a good idea period now that I think about it.

Yes, if you need many small sprites, like bullets in a shoot-em-up, or in any situation where you need more sprites than worlds and BGMaps allow.

Something I wanted to add to this: Objects also have the desirable property that parallax can be added on an object-by-object basis, as opposed to BGs, where all chars get the same parallax value. So OBJs and BGs can also be combined to create sprites. At least VB Wario Land MUST use this technique, because his hands do not have the same parallax value as his body. Unless of course each hand is dedicated to using a single world :P.

Will drawing 1024 objects set the “draw time exceeded” VIP status?

I don’t know, test it. 😛

I’ll report back with some results. Right now, I really could only check whether the “draw time is exceeded”. I’m not at the point yet where I’m comfortable using the VB’s timer to benchmark. I’d also have to predict the time each ISR invocation takes and subtract that from the final time.

I can’t help you there, but the official manual is full of little errors like that, so that might be an error too.

Would not surprise me. On a related note, the GY, MY, and MP value ranges on page 5-13-2 also don’t seem correct (Figure 5-13-1). Why is MP bounded by the value of SCY? And why can GY/MY only take on positive value? I think Nintendo swapped some table entries by accident.

That’s great! It took me much longer (and there are still things I haven’t explored yet).

It’s been going fairly well. This isn’t the first system I’ve attempt to program for. That would go to the Genesis back in late 2012. It went horribly- no thanks in part to that the official Genesis technical manual is VERY terse and full of errors. I then tried the SNES in May 2013 and that took about a month to get up to speed. Also, there are things I’m certainly not comfortable with yet on VB, such as VIP interrupts, LED control registers, and a majority of VSU registers. I’m also having difficulty generating my own music samples and may fall back to classics such as the sine/square/tri/saw for the time being.

TLDR: Each system I learn gets easier, but NOT by much…

Is a Unix or source release possible for those who do not use Windows? I’ve been batting this around, but at least for my project, it may be beneficial to include the raw assets, and have the build system convert them to tilemaps as a “preprocessing” step before compilation, but I’m not sure.

Reminds me of a story I have trying to repair a Compaq Portable I (I collect old PC clones as well and am active on the Vintage Computer Forums). For those who do not know, the Portable I, while a rugged machine, is notorious for keyboard problems that have developed as the machine aged due to the foam pads inside each keycap degrading. I am one of those unfortunate souls with a Portable I whose keyboard met that fate.

I will not name names (In general, I really don’t enjoy causing conflict), but I paid a decent price for a one-man business who owns (?!) a CNC milling machine to create a new 101-pad set, so that I can refurbish the keyboard to it’s previous condition. This was in January… I have still not received it. Every month or so however, I will email him to get a status report, and he’s has at least respond to acknowledge that he still knows that I need the kit. The Portable I is the only vintage computer purchase that I regret since I started collecting 4+ years ago.

That said, my advice is to be patient, keep reaching out to them, and coerce them into finishing the job they started (and are financially obligated to finish).

Well, I got my FlashBoy today- works like a charm as long as you have a good cable (Surprisingly enough, the USB port on my laptop can power the entire Virtual Boy; this was before I found out that you’re NOT supposed to keep the cartridge in while flashing XD- shame).

I’ve run into my first issue with my (poorly coded) demo which just shows the warning and focus screens; immediately reapplying power after switching the console off is NOT enough time for all RAM contents to go invalid (not sure which regions exactly yet, but at least the BGMaps don’t lose their contents). When I turned the VB on again, I have a superposition of two screens worth of data- the message and the focus screen using the PC BIOS font tiles XD.

It’s amusing to look at (pics if I can find a good camera), but it is a bug that needs to be fixed. To be fair, that’s not really something I’d expect an emulator to emulate, however. Not even higan (cycle accurate SNES emulator), to my knowledge, emulates RAM decay on hard reset (it uses a RNG to fill RAM).

EDIT: Have some photos. Relevant git commit: https://github.com/cr1901/vbdemo/commit/dc36b26c3f999eab4fc6c88160d55e04de475f6d

EDIT 2: Added a reset after the Focus screen fades away. Curiously on soft reset, the VIP may or may not (mostly does) shine all the LEDs (for any non-transparent pixels in a character) at max brightness. Hmmm…

  • This reply was modified 9 years, 8 months ago by cr1901.

blitter wrote:
I almost never use dev mode– most of my development happens against Mednafen, and my game consumes nearly 100% of the 16Mb of the FlashBoy anyway, so dev mode isn’t too effective for me. Why do you need to test against hardware so often? Is there a bug in Mednafen requiring hardware for accurate results?

According to GuyPerfect, Mednafen does not implement the repeat values of the column table properly for shadow or variable-brightness effects.

I’m not sure if all timings of the VB are known with 100% accuracy either (but perhaps it’s close), so there are likely other problems that someone trying to use the system to its full potential will run across.

On a third note, using the keyboard is a PITA :P. I’ll need to create an adapter at some point for the Retrode that lets me use the VB controller in the Genesis port.

Guy Perfect wrote:

I’ll be watching this thread, so if you need more assistance, I’m here to help. (-:

Source tree is available here. Not much substance right now, but at least I’ve got a project tree that I like. Sadly, there’s a number of “single function headers”- haven’t decided if I’ll keep them or just declare them as extern in the source files which use them. */

Compilation requires SCons, which in turn requires Python (either the Windows, Cygwin, or POSIX version should work fine). Most people I’ve seen on this board have been using a Cygwin version of GCC 2.95 for gccVB, but I’ve been using Runnerpack’s MinGW version of GCC 4.4. Both should work, but if they do not (especially Cygwin’s), let me know. A generic Makefile is not out of the question in the future, especially if I decide to make the source VUCC-compatible as well (which requires rewriting interrupt logic).

The source tree expects to see the Github-hosted version of libgccvb in “#/external/libgccvb”, where “#” is the project root. To get it with git, simply run: git submodule update in “#/external/libgccvb”, or download a zip and extract it to that directory.

First stage- Not much to say. Very easy to stun him.

Second stage- Jab (right on left D-pad, left on right D-pad) his face when it switches from top to bottom.

Third stage- you can duck or use your fists to block his drill. Otherwise, just anticipate his attacks since he’s rather slow.

Fourth stage- finish him off in 50 seconds in the first round by using your specials. Down D-pad is most powerful IIRC.

Fifth stage- Not much to say honestly.

Sixth stage- Jab the Joey to distract your opponent 😀 (the robot is a kangaroo).

Seventh stage- Relentlessly jab his center. He will dodge most of them, but will spend ALL his time dodging and will get hit by a few. I think this was an AI oversight.

Last stage- Get to this stage by beating all previous opponents without losing. Losing here does not carry a penalty (you can retry as many times as you want), but his armor, speed, and attack power are top notch. Spend most time dodging and blocking and use side attacks (left on left D-pad, right on right D-pad) when there’s an opening. I personally cannot beat the final stage typically without losing at least twice.

Small steps…

I’m at the point where I now need to implement my first interrupt handler- even on the Warning/Focus screen, I want to play a small piece of music and make sure that input is ignored for the two seconds required by the development manual for an official game.

Additionally, I’ve read that games running on a real console aren’t supposed to initialize the screen until the VIP status says that the servo and drawing circuitry is in sync.

I think for the sake of having only one main thread, I’ll do interrupt-driven music that is based on the timer interrupt. However, I want the main game loop to be able to set timers as well, and be notified in some manner when the timer expires. So I need a small timer-manager of some sort to deal with multiple timing events.

Such code would probably look like this:

void game_mode_loop()
{
  void * timer_handle;
/* Unconditional processing goes here */

  if(condition_to_set_timerA_met) /* Condition is irrelevant. */
  {
    timer_handle = add_a_timer_source(1000); /* Set timerA_event_in_progress.
    timerA_has_elapsed will be set when the number of ticks since
    timer started == 1000. The timer interrupt will run a routine
    FOR EACH TIMER REGISTERED to compare the ticks elapsed to the 
    number of ticks desired, before setting a variable. */
  }

  if(timerA_event_in_progress)
  {
    if(timerA_has_elapsed)
    {
      give_bonus_score = 0; /* Lame example. */
      remove_timer_source(timer_handle); /* Unset timerA_event_in_progress. */
    }
  }

/* More conditional processing. */
}

The “variable-sized structures” HorvatM mentions comes into play because I don’t know how many simultaneous timer compares need to be kept track of at compile time.

In addition to monitoring the various elapsed times, the timer interrupt will unconditionally call the music driver.

Thoughts? 😀

When I get the Focus Screen/Timer Interrupt fully working, I’ll use that time to push my (admittedly complicated) source tree to a public repo.

In the example on Slide 7 of the programming seminar, the memory location being stored to does not depend on the address from which a value should be loaded. That’s why it confuses me- unless the v810 can’t detect that r10 != r11 ahead of time.

HorvatM wrote:
So does Galactic Pinball. Try getting more than 100 million on UFO. 🙂

There is no chance in hell of me getting that type of score in Galactic Pinball, so go ahead and spoil it for me… what happens?

I’ll actually contribute something productive to this thread tomorrow- I am tired and mulling over something I read in the V810 seminar slides…

Something I didn’t realize about F-Zero until about 2 minutes ago- the camera is slightly angled downward. This permits the perspective projection to take up more than 50% of the screen.

Something I forgot until tonight: If my camera is looking straight down the negative z-axis (or just looking directly down any axis, for that matter), and I place two parallel lines within my camera’s point of view, those parallel lines will converge toward the middle of the screen, such as the attached image of a long rectangle with a camera looking down the z-axis. That means, unless I tilt my camera, a mathematically-sound perspective effect can only take up to 50% of the screen (likely less, since 50% is the limiting case).

In F-Zero, the perspective projection (Mode 7 effects), takes up 75% of the screen!

Contrast to Star Fox, from Mode 2 horizon boundary maxes out at looks like 50% of the screen (i.e. the bottom of the camera’s field-of-view IS crashing into the solid ground :P)!

Therefore, my perspective transform as is (horizon is at 66% of the screen, camera looking straight down negative z-axis), is not possible XD. I’ll rework it and see if I can come up with a better one. Tilting my camera downwards slightly was not something I really had in mind (I’d rather the camera strictly follow the backside of my main 3d object, but that might not be a good idea either).

Attachments:

Thank you GuyPerfect, I appreciate the interest.

The goal is to render sprites/fg objects in 3d, while having the VIP render the background using precalculated tables, and cycling tiles/offsets to give the impression of a moving background.

This way, the CPU does not have to worry about doing matrix calculations and rendering the background/ground- the VIP will do it for me, and I can add 3D objects on top of the BG. Space is cheap compared to processing power (even light calculations could be stored with the ground).

This has been a good resource for getting back up to speed- it’s been a while since I had to deal with the gfx pipeline.

After I play around with some images/polygons, and texture mapping in MATLAB, I’ll see if I can’t find the equivalent operations that the VIP should perform on a scanline-by-scanline basis.

I wish to revive this topic… https://github.com/cr1901/libgccvb

I’ve taken the time to make libgccvb safe to include in multiple source files by separating declarations of variables and functions from definitions to avoid redefinition errors when including libgccvb in multiple places. A user will need to link in a static libgccvb binary when compiling, but it should work with any version of gccVB. To compile, make sure gccVB is on the path, and then use GNU/MinGW make to compile.

Supplying binaries probably isn’t a good idea unless I can get a single library to play nice with both GCC 2.95 and GCC 4.x (unlikely).

I am not sure whether Nintendo’s compiler comes with a static librarian, but the workaround is to just compile each object file separately :P.

A few minor things have changed compared to what libgccvb was provided with the demos:
itoa is no longer static
asm functions are no longer inline

I have not yet tested this new library, but I will be making modifications as necessary if I run into problems. I would appreciate anyone who could compile this library and tell me about any issues, and whether it’s a suitable drop-in replacement for other libgccvb versions.

If there’s interest, I would also like some feedback on additions, gripes, and potential deletions from my copy of the library hosted on Github. Perhaps it can become a central repository :P.

One deletion I can think of: remove stdarg.h. All ANSI C compilers, hosted or freestanding, are supposed to provide their own, and unless gccVB’s is broken, I do not see the point of keeping a potentially conflicting copy.

Additionally, if __GNUC__ is not defined, the interrupt header shouldn’t be included, since as far as I can gather, those external declarations are embedded into the C runtime provided with gccVB.

Unfortunately, it appears the version of libgccvb that the demos provide is not idempotent, despite having include guards: I cannot include it in multiple source files and successfully compile a working program. I get multiple definition errors for all functions and typedef’ed structs :P.

The solution presumably is to take each variable declaration and make them extern, defining them in various C files, or using an approach like TI does for their MSP430 microcontroller registers.

I know there’s a thread for libgccvb committee around here. Has there been any interest in reviving that, taking the best routines from the various versions, and creating a static library which can be linked against?

v810-gcc -o vbmain.o -c -Wall -nodefaultlibs -mv810 -xc -Ilibgccvb vbmain.c
libgccvb/misc.h:14: warning: 'itoa' defined but not used
v810-gcc -o mainloop.o -c -Wall -nodefaultlibs -mv810 -xc -Ilibgccvb mainloop.c
v810-gcc -o vbdemo.elf vbmain.o mainloop.o
v810-objcopy -S -O binary vbdemo.elf vbdemo.vb

So, it appears I used everything EXCEPT the correct command line. Something I tend to forget about ELF is that it specifies both an object and executable format.

All the demos in the six simple demos zip file use one single source file. However, what I didn’t notice is that each Makefile does both compiling and linking in one command (i.e. the “-c” switch is absent). This means that the output from the compiler from each demo is an ELF executable, and objcopy just removes the ELF relocation and header.

I did not realize this and was attempting to use ld combine ELF object (contrast with executable) files into one large object file, and attempting to run that non-executable ELF object file through objcopy instead. Problem solved!… I think.

If I really wanted to know what GCC was doing behind the scenes (not recommended if you value your sanity), I could always dump the specs file or use the -### option.

Guy Perfect wrote:
I don’t use GCCVB for my Virtual Boy development…

Just out of curiosity, what DO you use then? I’ve found links to the official C compiler (Virtual Utopia C Compiler) that Intelligent Systems sent developers on this site… I’m considering running a DOSBOX session and using that to compile instead, even if the optimization wouldn’t be as good as GCC.

The ability to separate source files is rather important to me. But of course, it’s also cool to be able to use the same tools that real VB developers used back in the day :P.

… Seriously, that’s an insane find!