Nintendo 64 RSP Microcode Adventure - Wonky Triangles

Discussion in 'Nintendo Game Development' started by LuigiThirty, Feb 14, 2019.

  1. LuigiThirty

    LuigiThirty Newly Registered

    Joined:
    Jan 6, 2013
    Messages:
    2
    Likes Received:
    8
    I'm working on writing an RSP microcode to free myself from the tyranny of F3DEX. I'm having some trouble with RDP triangle fills - specifically I have them working in CEN64, but not on my real N64. I'm hoping someone here knows enough about the RDP to tell me what's going on.

    I have a triangle (3, 2, -5), (2, -1, -5), (0, 0, -5) that I'm perspective projecting. From it, I'm producing this RDP command (0x08, non-shaded triangle)
    Code:
    8800028D
    01E00189
    00A000A1
    00017FB8
    00CB2283
    00005552
    00CC018E
    FFFE0003
    
    For clarity's sake, here's my program's debugging output:

    Code:
    *** N64 Boot ***
    Initializing MVP matrices
    Initializing interrupts.
    VBL handler installed
    Initializing display: 320x240, 32bpp.
    Initializing RDP.
    Initializing RSP.
    Initializing timers.
    Initializing controllers.
    Acquiring a framebuffer and clearing it.
    Loading boot microcode...
    
    vN x y z w
    v1 00CB4260 00625F98 00005E9C 00000000
    v2 00A000A1 00780078 00005E9C 00000000
    v3 00E0E2A0 00A34238 00005E9C 00000000
    Expected flip bit: 0
    Xh: X0 + (scanlineY - Y0) * DXhDY = 00CB2283 (expected 00CB2284)
    Xm: X0 + (scanlineY - Y0) * DXmDY = 00CC018E (expected 00CC0190)
    Xh 00CB2283 Yh 00000189
    Xm 00CC018E Ym 000001E0
    Xl 00A000A1 Yl 0000028D
    dxhdy: 00005552 (expected: 00005553)
    dxmdy: FFFE0003 (expected: FFFE0000)
    dxldy: 00017FB8 (expected: 00017FFC)
    
    This draws fine in CEN64. However, on my real N64, I get garbage as shown here: ENmSist.jpg

    This seems to happen for any triangle where the flip bit is 0 - triangles with flip bit 1 draw correctly. I'm thinking I have some numbers switched around somewhere but I haven't been able to figure it out so far. I'm hoping someone knows more about the RDP than I do and could help point me in the right direction!
     
    Marteicos, jollyroger, gwald and 2 others like this.
  2. LuigiThirty

    LuigiThirty Newly Registered

    Joined:
    Jan 6, 2013
    Messages:
    2
    Likes Received:
    8
    I figured it out - I had the RDP in Fill mode instead of 1cycle mode.
     
    Mrneo240, Marteicos and jollyroger like this.
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page