We're using cookies to ensure you get the best experience on our website. More info
Understood
@dasiRegistered August 8, 2007Active 4 months, 2 weeks ago
188 Replies made

The vucc compiler has an option that sets the value of the global pointer, gp (r4), so that the bss and data sections can be accessed by gp offset.

-msda=n “[puts] static or global variables whose size is n bytes or less into the small data area that register gp points to”, but vb.ld would need fixing up to get it working.

  • This reply was modified 15 years, 11 months ago by dasi.
  • This reply was modified 15 years, 11 months ago by dasi.

Okay, here’s a quick demo showing > 4 brightness levels simultaneously.

Edit: I think this needs a bit more work. Stay tuned.

  • This reply was modified 16 years ago by dasi.

DogP wrote:
The column table thing doesn’t seem to do anything, but I haven’t looked into it at all, so it could just be a stupid mistake on addressing or something, or I may not be understanding how it works (maybe needs LOCK first?).

This will work, but the column table is read from the start address down, not up, so you’re writing to the table in the wrong direction.

Also, make sure that (REPEAT + 1) x (BRTA + BRTB + BRTC + REST + 5) x 50 ns is less than the column period. Note that the shortest column period setting in the standard column table is 12.2 µs, and 255 + 5 x 50 ns = 13 µs.

  • This reply was modified 16 years ago by dasi.

In vb.ld:

v = .;

/* Ram memory */

__data_lma = .;
.data __data_vma : AT(__data_lma) {
*(.data)
*(.data.*)
*(.gnu.linkonce.d*)
/* CONSTRUCTORS */
} >ram = 0xFF
__data_end = .;

/* prevent overlaps with vbvectors */
v += SIZEOF(.data);

I think this should fix the problem. However, copying vb.ld to /usr/local/v810/lib/ like it says in build.txt doesn’t override the default script.

  • This reply was modified 16 years, 1 month ago by dasi.

I’ve made a few timings and it looks like copying data from ROM to VRM is roughly 20% quicker with waits set to 1.

  • This reply was modified 15 years ago by dasi.

Nice work, Dan.

The affine 3D track effect is very impressive. Nice work.

  • This reply was modified 16 years, 1 month ago by dasi.

The frequency should probably be a bit higher, maybe 0x05A0.

Here’s a bit of code that plays Mario’s jump effect from SMB. Boing!

Has anyone had a look to see if there are any NES/Game Boy/GBA sound tools we could convert?

// SOUND 5
#define REG_S5INT		*(vu8*)(0x01000500)
#define REG_S5LRV		*(vu8*)(0x01000504)
#define REG_S5FQL		*(vu8*)(0x01000508)
#define REG_S5FQH		*(vu8*)(0x0100050C)
#define REG_S5EV0		*(vu8*)(0x01000510)
#define REG_S5EV1		*(vu8*)(0x01000514)
#define REG_S5RAM		*(vu8*)(0x01000518)
#define REG_S5SWP		*(vu8*)(0x0100051C)

#define WAVE_RAM1		((vu8*)0x01000000)	// array

const u8 sqrwave[]=
{	
    0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,
    0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
}

void play()
{
        REG_S5EV0= 0xF1;
        REG_S5EV1= 0x41;
        REG_S5SWP= 0xAF;

        REG_S5FQL= 0x40;
        REG_S5FQH= 0x05; 

        REG_S5INT= 0x80; // play
}

void main()
{
    int ii;

    for(ii=0; ii<32; ii++)
        WAVE_RAM1[ii*4]= sqrwave[ii];

    REG_S5LRV= 0xFF;
    REG_S5RAM= 0; 

    while(1)
    {
        vbWaitFrame(1); // wait for end of drawing
        key_poll();
        
        if(key_hit(K_A))
            play();
    }
}

Refs
Virtual Boy Dev Manual Section 6 - Sound Processor
http://belogic.com/gba/
http://www.coranac.com/tonc/text/sndsqr.htm

> I get this every now and then…

That must be it. Thanks guys!

I’m getting the same error. My rom is only 8 K, all my arrays are const. How did you fix this?

Edit: See section 3.3, General notes on GBA programming. It’s nearly all applicable to the VB.

  • This reply was modified 16 years, 2 months ago by dasi.
  • This reply was modified 16 years, 1 month ago by dasi.
  • This reply was modified 16 years, 1 month ago by dasi.

jorgeche wrote:
I use exactly 20 chars for each animation frame, and only one bgmap definition, so on each change of frame I write the char memory not bgmap, so the bgmap still points to the same chars in char memory.

Why not just make an image with all your frames (like zub_frames_vb.gif), convert to a BG map and chars, and control which frame is displayed by simply changing the offset into the BG?

And yes, use grit.

It looks like the forum resizes images larger than 500 pixels. Could this limit be increase to 512 to allow a segment to be displayed without being resized?

I think the forum would probably be okay.

Zub sprite
Description: 24×32 pixels, 19 frames
Credit: Ste Pickford, http://www.zee-3.com/pickfordbros/archive/zub.php

  • This reply was modified 16 years, 2 months ago by dasi.
  • This reply was modified 16 years, 2 months ago by dasi.
  • This reply was modified 16 years, 2 months ago by dasi.
Attachments:

sys8 font
Description: 8×8 pixel, 96 characters.

  • This reply was modified 16 years, 2 months ago by dasi.
Attachments:

Works for me, maybe you have a bad ROM?

RunnerPack wrote:
I was just browsing the source and noticed you commented out that option.

Oh yeah, -mRa is one of the tile reduction combo options, equivalent to -mRt. I commented it out because the GBA doesn’t allow tile flipping in affine BGs whereas the VB does; on the VB we always want -mRtf, which is the default.

Edit: can we have HTML on, please?

  • This reply was modified 16 years, 2 months ago by dasi.
  • This reply was modified 16 years, 2 months ago by dasi.
  • This reply was modified 16 years, 2 months ago by dasi.
  • This reply was modified 16 years, 2 months ago by dasi.
  • This reply was modified 16 years, 2 months ago by dasi.
  • This reply was modified 16 years, 2 months ago by dasi.
  • This reply was modified 16 years, 2 months ago by dasi.
  • This reply was modified 16 years, 2 months ago by dasi.
  • This reply was modified 16 years, 2 months ago by dasi.