![]() |
![]() |
SRAM
Nintendo 64 software can reserve SRAM for saving data. Unlike the EEPROM and Controller Pak, SRAM can be handled by EPI in the same way as ordinary MASKROM, although the addressing is different. Currently, the available SRAM has a capacity of 256Kbits. The start address is a physical address from 0x8000000. Each parameter is defined below.
/* definition for SRAM */
#define SRAM_START_ADDR 0x08000000
#define SRAM_SIZE 0x8000
#define SRAM_latency 0x5
#define SRAM_pulse 0x0c
#define SRAM_pageSize 0xd
#define SRAM_relDuration 0x2
The following are examples of the handler obtaining a function for SRAM, osSramInit uses these definitions for the examples.
#include "rcp.h" #include "os.h" /* definition for SRAM */ #define SRAM_START_ADDR 0x08000000 #define SRAM_SIZE 0x8000 #define SRAM_latency 0x5 #define SRAM_pulse 0x0c #define SRAM_pageSize 0xd #define SRAM_relDuration 0x2 OSPiHandle SramHandle; /* * Name: osSramInit * * Description: * Initialize SRAM. * */ OSPiHandle * osSramInit(void) { 32 saveMask; if (SramHandle.baseAddress == PHYS_TO_K1(SRAM_START_ADDR)) return(&SramHandle); /* Fill basic information */ SramHandle.type = 3; SramHandle.baseAddress = PHYS_TO_K1(SRAM_START_ADDR); /* Get Domain parameters */ SramHandle.latency = (u8)SRAM_latency; SramHandle.pulse = (u8)SRAM_pulse; SramHandle.pageSize = (u8)SRAM_pageSize; SramHandle.relDuration = (u8)SRAM_relDuration; SramHandle.domain=1; /* TODO SramHandle.speed = */ bzero(&(SramHandle.transferInfo), sizeof(SramHandle.transferInfo)); /* * Put the SramHandle onto PiTable */ saveMask = __osDisableInt(); SramHandle.next = __osPiTable; __osPiTable = &SramHandle; __osRestoreInt(saveMask); return(&SramHandle); } /* osSramInit */
If SRAM is connected to the AD16bus, it can be used when developing software. For example, if Partner-N64 is used, SRAM can be used by inserting the SRAM board into the slot located in the upper part of Emulator ROM. If used on an N64 Control Deck, either flash ROM software, which has built-in SRAM, or a DCC-Board must be used.
Copyright © 1999 Nintendo of America Inc. All Rights Reserved Nintendo and N64 are registered trademarks of Nintendo Last Updated January, 1999 |