Advertisement
Iso_Kilo

SEGA Mega Drive - SRAM Initialization

Feb 22nd, 2020
2,967
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. InitSRAM:
  2.         move.b  #1,($A130F1).l    ; Enable SRAM writing
  3.         lea ($200001).l,a1      ; Load SRAM memory into a1
  4.         movep.l 0(a1),d0        ; Get the existing string at the start of SRAM
  5.         move.l  #$5352414D,d1        ; Write the string "SRAM" to d1
  6.         cmp.l   d0,d1            ; Was it already in SRAM?
  7.         beq.s   @Continue           ; If so, skip
  8.         movep.l d1,0(a1)        ; Write string "SRAM"
  9.         ; Insert your values to be initialized, start with 8(a1).
  10.  
  11. @Continue:
  12.         move.b    #0,($A130F1).l    ; Disable SRAM writing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement