InGameRoutines for NESRGB

Discussion in 'Modding and Hacking - Consoles and Electronics' started by borti4938, Oct 14, 2014.

  1. Helder

    Helder Site Supporter 2014,2015

    Joined:
    Apr 6, 2013
    Messages:
    981
    Likes Received:
    54
    Anyway you could also release the schematic file?
     
  2. vvv

    vvv Member

    Joined:
    Sep 25, 2014
    Messages:
    13
    Likes Received:
    0
  3. BuffaloWing

    BuffaloWing Robust Member

    Joined:
    Jul 31, 2012
    Messages:
    277
    Likes Received:
    26
    Does the PIC microcontroller saves the palette selection when the console is turned off or does the user needs to cycle through the palette choices every time the system is turn on?
     
  4. borti4938

    borti4938 Robust Member

    Joined:
    May 8, 2014
    Messages:
    204
    Likes Received:
    61
    Of course, it does save the selection. This small feature is at least needed if you turn on and off RGB because you can not switch on/off RGB in runtime without causing issues.

    However, I uploaded the NES-I/O on GitHub but still need to create a part list (or a shopping cart on digikey) and an installation manual in English.
     
  5. TriState294

    TriState294 Site supporter 2016

    Joined:
    Feb 20, 2012
    Messages:
    269
    Likes Received:
    47
  6. borti4938

    borti4938 Robust Member

    Joined:
    May 8, 2014
    Messages:
    204
    Likes Received:
    61
    Thanks for the feedback :D
     
  7. leonk

    leonk Rising Member

    Joined:
    Mar 22, 2014
    Messages:
    51
    Likes Received:
    3
    I just installed this into my NES Top Loader and love it. I did notice a small issue, and was wondering if anyone has a solution. On the NES Front Loader (I guess what Borti developed on), the /RST lines of the CPU (pin 3) and PPU (pin 22) are tied together. But on the top loader, pin 22 is tied to Vcc! So when someone resets the console, there's screen corruption (CPU cycles) and then the reset occurs. This does not happen with stock unmodified systems - reset is correct. Any idea what can be done to correct this? I know it's a tiny details .. but prefer to get it right. :)
     
  8. borti4938

    borti4938 Robust Member

    Joined:
    May 8, 2014
    Messages:
    204
    Likes Received:
    61
    I don't have a NES Top Loader. But if pin 22 of the PPU is staticly connected with Vcc, I would try to disconnect pin 22 (lift) and connect it to CPU pin 3. This could help.
     
  9. leonk

    leonk Rising Member

    Joined:
    Mar 22, 2014
    Messages:
    51
    Likes Received:
    3
  10. borti4938

    borti4938 Robust Member

    Joined:
    May 8, 2014
    Messages:
    204
    Likes Received:
    61
    The schematic says that pin 22 (/rst) of the PPU is statically connected to Vcc. So the PPU does not reset. Again: I would disconnect Vcc there (connection between NESRGB and mainboard) and solder a wire between pin 3 of the CPU and PPU pin 22.
     
  11. leonk

    leonk Rising Member

    Joined:
    Mar 22, 2014
    Messages:
    51
    Likes Received:
    3
    Hi. Spoke to Tim, he said that the NESRGB does use the /RST pin. He suggested breaking the connection between the socket and Vcc and not socket and NESRGB. You have to be careful, the wire to Vcc is very thick, and has 2 very thin traces on either side. Very easy to get one of them cut. Then, I ran a wire from CPU /RST to PPU /RST. Now the system resets correctly!!! No more frozen corrupt video on the screen!

    I think you might want to document this somewhere for NES toploader / AV Famicom users.
     
  12. TriState294

    TriState294 Site supporter 2016

    Joined:
    Feb 20, 2012
    Messages:
    269
    Likes Received:
    47
    Does any of this put more or less strain on the PPU or NESRGB? If so, I want to look into it. If not, I don't think it's worth the time...simply because I don't care if the console is essentially crashing on reset...it still resets.
     
  13. leonk

    leonk Rising Member

    Joined:
    Mar 22, 2014
    Messages:
    51
    Likes Received:
    3
    TriState: I think it's worst than that. Without the fix, the system takes about 3 seconds to reset. With the fix, the reset is less than 1s.

    According to http://wiki.nesdev.com/w/index.php/PPU_pin_out_and_signal_description :

    "/RST resets certain parts of the chip to their initial power-on state: the clock divider, video phase generator, scanline/pixel counters, and the even/odd frame toggle. It also keeps several registers zeroed out for a full frame .. and the VRAM read buffer. It is used in the NES to clear the screen when the console is reset either by the button or the CIC"

    So resetting the CPU, but not resetting the PPU does not return the system to the same state as initial startup!

    The NES Front Loader has /RST of PPU and CPU tied together. This "mod" corrects it for the top loader / Famicom AV. Not doing it seems silly for me, when the fix is so simple.
     
  14. Marmotta

    Marmotta Dauntless Member

    Joined:
    Apr 14, 2009
    Messages:
    752
    Likes Received:
    46
    I've just installed the IGR in my AV Famicom and it seems to work great. One thing I'm not sure about is the RGB blanking - I've only been using component with Viletim's add-on board so far and the picture seems fine, but should I be tying the RGB point to a high signal or is it only relevant for SCART leads to differentiate between composite and RGB?

    Also, I was considering using the Start button on the controller for a different purpose (latching power button for a wireless controller) and was wondering what code would need altering in the Github .asm file in order to compile it so that only Select needed to be used in combination with other buttons? Is it a case of deleting any instances of "Button_St"?
     
  15. borti4938

    borti4938 Robust Member

    Joined:
    May 8, 2014
    Messages:
    204
    Likes Received:
    61
    No - it has nothing to do with the Button_St ;)
    You only have to touch the few lines after checkkeys

    Here you have three lines begin with "M_belf". This command has three arguments: a 8bit number, a register and a branch. If you want to change the button combination for accessing a certain feature, you have to change the number!

    The NES reads the controller in the order: A, B, Sl, St, Up, Dw, Le, Ri
    Each bit in the byte represents a button in the same order from MSB to LSB. A '1' is button not pressed, a '0' is button pressed.
    This means as an example: if you want to do a reset with A+B+Sl the byte is 0001 1111 or in hex 0x1f. Line 422 hence has to be "M_belf 0x1f, reg_ctrl_data, ctrl_reset"

    I hope the explanation is good enough to do your changes ;)

    Best
     
    Marmotta likes this.
  16. Marmotta

    Marmotta Dauntless Member

    Joined:
    Apr 14, 2009
    Messages:
    752
    Likes Received:
    46
    Code:
    checkkeys
        clrf    INTCON
        M_belf  0x1f, reg_ctrl_data, ctrl_reset  
        btfsc   reg_ctrl_reset, bit_ctrl_reset_flag
        goto    doreset                       
        M_belf  0xdd, reg_ctrl_data, domode_prev
        M_belf  0xde, reg_ctrl_data, domode_next
        goto    idle_prepare
    Thanks for the instructions - I'm guessing the code above would work fine then. I'll try and compile it and give it a go this weekend.

    Another thing (which I've also been wondering about with SNES IGR for a while now) - is there a way of setting it up for both controllers? I'm guessing palette and reset would just go to the same points and Data, Latch and Clock would be soldered to the P2 connections. How about the LED?
     
  17. Bad_Ad84

    Bad_Ad84 The Tick

    Joined:
    May 26, 2011
    Messages:
    8,236
    Likes Received:
    1,052
    If you wanted to use both controllers at once, you will need to use some diodes.
     
  18. TriState294

    TriState294 Site supporter 2016

    Joined:
    Feb 20, 2012
    Messages:
    269
    Likes Received:
    47
    Diodes on just P2 lines merged into the board input or is there a reason for diodes on everything?
     
  19. Bad_Ad84

    Bad_Ad84 The Tick

    Joined:
    May 26, 2011
    Messages:
    8,236
    Likes Received:
    1,052
    Because controller 2 will end up controlling player one as well as player 2 and vice versa.
     
  20. Marmotta

    Marmotta Dauntless Member

    Joined:
    Apr 14, 2009
    Messages:
    752
    Likes Received:
    46
    Obviously diodes on just P2 would mean that there would be nothing stopping an input from P2 interfering with P1.

    I'm just going to throw six 1N4148 diodes on the input lines for both pads and see if it works.
     

Share This Page