cr1901 wrote:
Just wondering- has anyone attempted to compile and link against the github-host libgccvb using GCC 2.95 or another version besides GCC 4.4?
It compiles and links fine with GCC 2.95.2 (or at least it seems to in the simple test I used). However, it complains with “video.c:26: warning: `/*’ within comment”.
In particular, the SOUNDREG and WA structs quite possibly will not work as is. Since compilers tend to add padding to speed memory accesses up, and both the listed structs depend on having no padding whatsoever, I’m a little surprised that they work at all.
SOUNDREG contains explicit padding, and everything is byte-sized. Everything in WA (WORLD, actually) is halfword-sized, and it’s a power of 2 in size, so what’s the problem?
Additionally, there are a few GCC extensions used in the code, particularly inline, asm- these can be conditionally defined depending on the compiler used. I do not know what extensions to ANSI C that VUCC supports, but I highly doubt it supports all of GCC’s extensions.
I don’t see the inline keyword being used anywhere.
As for inline assembly in VUCC, if you search for “asm” in CGRIND.EXE with a hex editor, it seems to support it, as well as literally implement Greenspun’s tenth rule. 😛
The signature of main() also differs between VUCC (void main) and GCC (int main). Since they’re both freestanding, neither of them are wrong (ANSI says it’s compiler-defined), but perhaps a macro could be defined which uses one signature or the other depending on the detected compiler?
Does VUCC not accept int main?
cr1901 wrote:
Is a Unix or source release possible for those who do not use Windows?
What OS do you use?
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.
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.
cr1901 wrote:
(including up to 7 pixels off the left of the screen- not sure if this applies to the right of the screen, can someone confirm this?)
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.
This means that to create larger sprites, objects need to be combined together at offsets of 8 and moved simultaneously when movement should occur. Animations can also occur by swapping the character index field of the object attribute memory, of the relevant characters at each frame. Do I understand this correct?
Yes.
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.
Animations can be accomplished by swapping out character memory each frame.
Or changing the world’s MX/MY/MP properties, which is much faster. You just put a sprite sheet on a BGMap.
In practice, is there any reason to draw sprites using objects instead of reserving backgrounds, which should be faster, when a limited number of foreground sprites should be displayed?
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.
Will drawing 1024 objects set the “draw time exceeded” VIP status?
I don’t know, test it. 😛
Lastly, the official development manual has the following to say about object control registers (page 5-9-2):
I can’t help you there, but the official manual is full of little errors like that, so that might be an error too.
Seriously, I’m almost comfortable with the hardware. It only took me about 1.5 weeks too! 🙂
That’s great! It took me much longer (and there are still things I haven’t explored yet).
I received it yesterday. Great quality and a lot of attention was paid to details.
Guy Perfect wrote:
It’s far simpler to use pre-allocated static memory and use the stack by declaring struct variables in high-order functions.
Sure, unless you don’t know and can’t predict how much memory you’re going to need, or you need variable-sized structures, which is probably cr1901’s situation.
Virtual Boy has 64KB of on-board memory. If you’re considering setting up a paging system, be careful you don’t wind up using it all just trying to keep track of where it is.
Wouldn’t you need extra hardware to do paging?
My programs have two “threads”, if you will, that run side-by-side to present the user experience: there’s the audio thread, and the video/game thread.
So basically, they work the same way commercial games do.
Well, actually, Red Alarm’s gameplay runs at the same speed regardless of the frame rate (look at the final stage where it gets really low), so that’s an approach to take if you can’t guarantee that your frames will always render in the same time.
Insmouse also updates objects on the VIP interrupt, but I think all other video stuff is done in the same “thread” as gameplay.
Other programmers have other approaches: I know for a fact that the GBA Pokémon games process all of the audio through interrupts, since whenever you crash the game by putting a hacked mon in the PC, the music keeps playing…
So does Galactic Pinball. Try getting more than 100 million on UFO. 🙂
cr1901 wrote:
Does anyone familiar with disassembling commercial games know whether any commercial games implemented a small heap manager in the VB RAM for maintaining data structures like event queues and possibly alternative stacks for interrupt processing and the like?
I don’t know, but I guess Red Alarm uses one because of its complexity (huge levels with moving parts and tons of enemies). Maybe Golf does too, although I’m not sure whether a renderer like that requires dynamic memory allocation.
As a follow up, does anyone have any experience writing a small heap manager for VB RAM?
Yes.
(Edit: you’re probably better off writing your own for your specific requirements, e.g. whether you need one that uses handles and can defragment the heap, like the classic Mac OS, or you want one that’s really fast but uses pointers directly, like DOS.)
If anyone has alternative ways of handling hardware events that don’t just resort to polling each time a hardware request is made, and are a bit more controlled than “worrying if a received interrupt will interfere with speed-critical game-logic processing or other fun race conditions” I’d love to hear your feedback.
Can you give some examples? You can often get away with polling, but yes, the code might be more elegant with interrupts.
And one last q: Is VB music typically controlled by the timer interrupt (i.e. wait until timer interrupt to change the playing sample)?
Yes, I think that’s how all commercial games do it. As usual, you can get away with calling a “do sounds” function in a VIP-synchronized loop, but if you want more precise timing, interrupts are the way to go, and you usually don’t have to worry about race conditions.
-
This reply was modified 11 years, 10 months ago by
HorvatM.
cr1901 wrote:
Guy Perfect wrote:
I don’t use GCCVB for my Virtual Boy development…Just out of curiosity, what DO you use then?
He uses “devkitv810”, which is also based on GCC, so I’m not sure how it is better than gccVB. When he’s too cool for C and assembly, he writes instructions manually with a hex editor.
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.
VUCC is actually quite good, I think it’s better than GCC in some situations. It’s also very flexible. But unless you have a really fast computer, it would be probably too slow in DOSBox. There’s also the question of how legal it is to use it.
I think I used Dillo. I use Links, Arachne, or Dillo, depending on the purpose. Links is great all-around (with text and graphics modes), Arachne supports animated GIFs and the mouse wheel, and Dillo has tabs and the best CSS support. No DOS browser supports JavaScript, but PVB doesn’t really require it.
BTW, Mednafen is also being ported to DOS, but I don’t know when it will be available (I’m not involved in its development).
By silence, do you mean SSTOP? Is it any different if you just set the volume of each channel to 0?
Thanks for the rip!
BTW, the title screen music is also played on the “take a break” screen (the one with the cup of tea, after hole 9 in the tournament), where it’s slightly longer and it loops. You also missed two other tracks, so here they are.
Attachments:
The note looks like “本体上部のVBカセットスロットの止め具です。” to me, but I’m no expert.
Very cool. Have you tested any existing homebrew code with it?
No, I’m not actually developing anything, just playing/testing more homebrew ROMs recently, and most are well below 2 MB.
That would be ideal, but I got the impression that it’s not possible.
http://www.planetvb.com/modules/newbb/viewtopic.php?topic_id=3673&post_id=8666#forumpost8666
If it will be, there’s still the question of what to do with old FlashBoys that may not support this.
MineStorm wrote:
I can’t test them because I don’t have a stand for my VB.
Then what are you waiting for? Print one!
Seriously though, would that be possible? The prices of stand-alone (pun not intended) stands and stand components on eBay are ridiculous.
I agree with thunderstruck. At least for me, competitions are stressful, and even if everyone started making something now, it would take more than a year to make a professional-quality finished game.
Instead, if we had a general celebration, everyone could help. For example, we could get recordings of music from hardware for those games that haven’t been recorded yet, new reviews (of both commercial and homebrew games), new ROM hacks (OK, this generally requires programming knowledge, but for Insmouse there’s InsmEdit :P), and I’m sure Protoman and VectrexRoli will shoot some videos for the occasion.
Additionally, two other historically important assemblers diverge on the matter.
ISAS, Intelligent Systems’ assembler for Virtual Boy development, which was used for commercial games, only recognizes the form “SETF 10, r1”.
FXAS, Hudson’s assembler for PC-FX development, only recognizes “SETFNZ r1”.
Regarding CLI and SEI, do we even know how long the stock V810 methods take? Specifically:
; CLI
movea 0xEFFF, $0, $10
stsr $PSW, $11
and $10, $11
ldsr $11, $PSW
; SEI
stsr $PSW, $10
ori 0x1000, $10, $10
ldsr $10, $PSW
I can’t find the duration of LDSR and STSR in the V810 manual.