XBoard Memory Init - 8BitDev.org - Atari 7800 Development Wiki XBoard Memory Init From 8BitDev.org - Atari 7800 Development Wiki Jump to: navigation , search ; X-Board Description ; The X-board (iet7830) is an internal expansion board for the ATARI 7800 which ; gives the system 128 Kbyte of SRAM and one POKEY chip. ; ; The expansion SRAM is located from $4000 up to $7fff and is divided into 8 banks ; of 16Kbyte each. The SRAM is by default disabled when the system starts up and ; has to be enabled by the application. This is so that existing games and software ; will function properly. To enable the SRAM write a "1" to Bit 3 of the XCTRL ; register. ; ; The POKEY is located in the high section of the available memory area at $0400 ; of the 7800. It is selected from $0460 - $046f when Bit 4 of the XCTRL register ; is set to "1" if Bit 4 = "0" the POKEY is disabled. ; XCTRL = $0470  ; Note Write only ; Bit 4 = Enable POKEY chip ; Bit 3 = Enable Banked 128Kbyte SRAM ; Bit 2 = Bit 2 of SRAM bank select ; Bit 1 = Bit 1 of SRAM bank select ; Bit 0 = Bit 0 of SRAM bank select ; ; Bit patterns for enabling/disabling XBoard features. XENABLEMEM =  %00001000 XENABLEPOKEY =  %00010000 XPOKEYBASE1 = $0450 XPOKEYBASE2 = $0460 MEMTESTCOUNT = 10  ; Number of iterations when testing the XBoard Memory XMEMORYSTART = $4000  ; This is where the memory of the XBoard starts ;************************************************************************ ;* ;* Function: SetXCtrl ;* ;* Description: This function sets the XCTRL register to the value in ;* acc and updates the shadow ;* ;************************************************************************ SetXCtrl: sta XCTRL sta XCTRL_SHDW rts ;************************************************************************ ;* ;* Here's the code for checking and enabling the XBoard SRAM ;* ;* This test fills the entire 16K memory bank with a known pattern ;* and then compares it with the same pattern. If any byte is unequal ;* the memory test aborts and reports no memory. ;* ;* For this test to be effective the length of the test pattern must ;* not be equal to a power of 2 base. So it has been chosen to just ;* repeat all strings used into memory. ;* ;************************************************************************ ; First we load the memory with a known test string...... lda #XENABLEMEM jsr SetXCtrl  ; Enable XBOARD SRAM and set to bank zero lda # XMEMORYSTART sta MemTest+1  ; Loads the memory address lda #MEMTESTCOUNT  ; Number of iterations to test in memory ( XMEMORYSTART sta MemTest+1  ; Loads the memory address lda #MEMTESTCOUNT  ; Number of iterations to test in memory ( Retrieved from " https://7800.8bitdev.org/index.php?title=XBoard_Memory_Init&oldid=90 " Navigation menu Views Page Discussion View source History Personal tools Log in Navigation Main page Recent changes Random page Help Search Tools What links here Related changes Special pages Printable version Permanent link Page information This page was last modified on 7 November 2015, at 18:44. Privacy policy About 8BitDev.org - Atari 7800 Development Wiki Disclaimers