Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GAMEHUT.S
- TIMING EQU 0
- ;----------------------------------------------------------
- ; GAMEHUT SHELL
- ; BY JON BURTON - AUG 2018
- ;----------------------------------------------------------
- INCLUDE SYSTEM.S ;INCLUDES LOTS OF SYSTEM CODE TO MAKE ALL THIS POSSIBLE
- INCLUDE RINGS.S
- INCLUDE FLAME.S
- INCLUDE SRAM.S
- USERRAM: EQU FLAMEEND
- ;----------------------------------------------------------
- ; VRAM MEMORY MAP IN HEXADECIMAL
- ; (NOTE: CHARACTERS ARE 8 X 8 PIXEL BLOCKS)
- ;----------------------------------------------------------
- ; $0000-$0020 BLANK CHARACTER
- ; $0020-$8000 CHARACTERS FOR PLAYFIELDS AND SPRITES
- ; $C000-$D000 CHARACTER MAP FOR PLAYFIELD 1 (4096 BYTES)
- ; $E000-$F000 CHARACTER MAP FOR PLAYFIELD 2 (4096 BYTES)
- ; $F800 SPRITE TABLE (960 BYTES)
- ;----------------------------------------------------------
- ; USER VARIABLES
- ; - PUT ANY VARIABLES YOU NEED HERE
- ;----------------------------------------------------------
- RSSET USERRAM
- PLAYX: RS.L 0
- PLAY1X: RS.W 1 ;X POSITION OF PLAYFIELD 1
- PLAY2X: RS.W 1 ;X POSITION OF PLAYFIELD 2
- PLAYY: RS.L 0
- PLAY1Y: RS.W 1 ;Y POSITION OF PLAYFIELD 1
- PLAY2Y: RS.W 1 ;Y POSITION OF PLAYFIELD 2
- SONICX: RS.W 1 ;SONIC'S X POSITION
- SONICY: RS.W 1 ;SONIC'S Y POSITION
- SONICD: RS.W 1 ;SONIC'S DIRECTION
- TEMPSCREEN: RS.B 4096 ;RAM TO BUILD TEMPORARY SCREEN MAP
- ENDVARS: RS.B 0
- ;----------------------------------------------------------
- ; INITIALISE USER STUFF
- ; - THIS IS WHERE YOU SET UP STUFF BEFORE YOU BEGIN
- ;----------------------------------------------------------
- USERINIT: MOVE.W #0,PLAY1X ;SET START PLAYFIELD 1 X POSITION TO ZERO
- MOVE.W #0,PLAY1Y ;SET START PLAYFIELD 1 Y POSITION TO ZERO
- DMADUMP MAPGFX,4*32,$820 ;DUMP 4 CHARACTERS (SIZE 32 BYTES EACH) TO VRAM LOCATION $820 (MAP GRAPHICS)
- DMADUMP SPRITEGFX,8*32,$1000 ;DUMP 8 CHARACTERS (SIZE 32 BYTES EACH) TO VRAM LOCATION $1000 (SPRITE GRAPHICS)
- DMADUMP RINGGFX,4*32,$1000+$100 ;DUMP 8 CHARACTERS (SIZE 32 BYTES EACH) TO VRAM LOCATION $1100 (SPRITE GRAPHICS, AFTER SONIC)
- LEA.L TEMPSCREEN,A0 ;POINT A0 TO TEMPORARY BUFFER IN RAM TO BUILD MAP BEFORE WE COPY TO VRAM
- MOVE.W #8-1,D3 ;WE'LL MAKE 8 COPIES OF THIS PATTERN
- @L4: LEA.L CHARGFX,A1 ;POINT A1 TO CHARGFX, WHICH IS THE 8 CHARACTER X 4 CHARACTER PATTERN WE'LL COPY MULITPLE TIMES
- MOVE.W #4-1,D1 ;4 ROWS
- @L3: MOVE.W #8-1,D0 ;COPY EACH ROW REPEATED ACROSS THE SCREEN 8 TIMES HORIZONTALLY
- @L2: MOVE.W #4-1,D2 ;4 LONG-WORDS = 8 CHARACTERS WIDE
- @L1: MOVE.L (A1)+,(A0)+ ;COPY FROM CHARGFX TO THE TEMPSCREEN. THE + MEANS INCREMENT THE POINTERS
- DBRA D2,@L1 ;LOOP BACK TO @L1
- SUB.L #16,A1 ;POINT BACK TO THE START OF THE CURRENT CHARGFX ROW
- DBRA D0,@L2 ;LOOP BACK TO @L2
- ADD.L #16,A1 ;MOVE ONTO THE NEXT CHARGFX ROW
- DBRA D1,@L3 ;LOOP BACK TO @L3
- DBRA D3,@L4 ;LOOP BACK TO @L4
- DMADUMP TEMPSCREEN,4096,$C000 ;COPY TEMPSCREEN WHICH IS 4096 BYTES IN SIZE TO VRAM ADDRESS $C000
- LEA.L PALETTE1,A0 ;DOWNLOAD A PALETTE FOR THE MAP TO USE
- BSR SETPAL1 ;OVERRIGHT FIRST PALETTE
- LEA.L PALETTE2,A0 ;DOWNLOAD A PALETTE FOR THE SPRITES TO USE
- BSR SETPAL2 ;OVERRIGHT SECOND PALETTE
- MOVE.W #$80+160-8,SONICX ;SONIC'S X START POSITION
- MOVE.W #$80+112-13,SONICY ;SONIC'S Y START POSITION
- MOVE.W #0,SONICD ;SONIC'S START DIRECTION
- JSR INITFLAME
- JSR RINGINIT
- JSR DUMPCOLS ;COPY ALL PALETTES TO CRAM (COLOUR RAM)
- RTS
- ;------------------------------
- ; MAIN GAME LOOP
- ;------------------------------
- MAIN: WAITVBI ;WAITS FOR THE START OF THE NEXT FRAME
- IF TIMING
- WDEST CRAMW,$0000 ;COLOUR TIMING BAR
- MOVE.W #$000F,VDP_DATA ;IN RED
- ENDC
- JSR DRAWFLAME
- ADD.W #1,PLAY1X ;SCROLL PLAYFIELD 1 RIGHT BY ONE PIXEL
- ADD.W #1,PLAY1Y ;SCROLL PLAYFIELD 1 UP BY ONE PIXEL
- ;ADD SPRITES
- LEA.L SPRITETEMP,A1 ;POINT TO TEMPORARY MEMORY TO BUILD SPRITE LIST
- MOVE.W #1,D7 ;SPRITE NUMBER
- ;FIRST SONIC
- MOVE.W SONICY,(A1)+ ;Y POSITION ($80 IS TOP OF SCREEN)
- MOVE.W #S_2X4,D0 ;SIZE 2X4 CHARACTERS
- ADD.W D7,D0 ;ADD CURRENT SPRITE NUMBER
- MOVE.W D0,(A1)+ ;WRITE TO SPRITE TABLE
- MOVE.W #S_PAL2+$1000/32,D0 ;PALETTE NUMBER+GRAPHIC VRAM LOCATION/32
- ADD.W SONICD,D0 ;ADD SONIC'S DIRECTION
- MOVE.W D0,(A1)+ ;WRITE TO SPRITE TABLE
- MOVE.W SONICX,(A1)+ ;X POSITION ($80 IS LEFT OF SCREEN)
- ADDQ.W #1,D7 ;MOVE ON TO NEXT SPRITE NUMBER
- JSR PROCRING ;ADD ANY RINGS TO SPRITELIST
- ;A1=POINTER TO NEXT SPRITE ENTRY
- ;D7=NEXT SPRITE NUMBER
- ;FINISHED ADDING SPRITES
- MOVE.L #$10000,(A1)+ ;TERMINATE SPRITE LIST
- MOVE.L #1,(A1)+ ; " "
- JSR CONVFLAME
- ;MOVE SONIC
- BTST #J_RIGHT,JOYPAD0
- BNE.S @MOVE1
- ADD.W #1,SONICX
- MOVE.W #0,SONICD
- @MOVE1:
- BTST #J_LEFT,JOYPAD0
- BNE.S @MOVE2
- SUB.W #1,SONICX
- MOVE.W #$800,SONICD
- @MOVE2:
- BTST #J_DOWN,JOYPAD0
- BNE.S @MOVE3
- ADD.W #1,SONICY
- @MOVE3:
- BTST #J_UP,JOYPAD0
- BNE.S @MOVE4
- SUB.W #1,SONICY
- @MOVE4:
- BTST #J_BUT_A,JOYPAD0
- BNE.S @NORING
- ;ADD A RING
- MOVE.W SONICX,D3 ;X POS
- MOVE.W SONICY,D4 ;Y POS
- JSR GETRANDOM ;RETURNS A RANDOM NUMBER FROM 0-255 IN REGISTER D0
- MOVE.L D0,D5
- EXT.W D5 ;NUMBER FROM -126 TO +127
- SWAP D5 ;ADDS PRECISION
- ASR.L #6,D5 ;REMOVE A BIT OF PRECISION - X MOMENTUM
- JSR GETRANDOM ;RETURNS A RANDOM NUMBER FROM 0-255 IN REGISTER D0
- MOVE.L D0,D6
- EXT.W D6 ;NUMBER FROM -126 TO +127
- SWAP D6 ;ADDS PRECISION
- ASR.L #6,D6 ;REMOVE A BIT OF PRECISION
- ADD.L #-$30000,D6 ;Y MOMENTUM
- MOVE.L #$1000,D7 ;GRAVITY
- JSR ADDRING
- @NORING:
- IF TIMING
- WDEST CRAMW,$0000
- MOVE.W #$0000,VDP_DATA
- ENDC
- BRA MAIN ;LOOP BACK TO WAIT FOR NEXT FRAME
- ;----------------------------------------------------------
- ; USER VBI ROUTINES
- ; - PUT TIME CRITICAL CODE THAT MUST CALLED DURING THE VERTICAL BLANK HERE
- ;----------------------------------------------------------
- USERVBI: LEA.L VDP_DATA,A1
- LEA.L VDP_CONTROL,A2
- ;SET HORIZONTAL OFFSETS
- MOVE.L #$7C000003,(A2)
- MOVE.L PLAYX,(A1) ;THIS TELLS THE VDP (VISUAL DISPLAY PROCESSOR) WHAT X POSITION THE PLAYFIELDS SHOULD BE AT
- ;SET VERTICAL OFFSETS
- MOVE.L #$40000010,(A2) ;THIS TELLS THE VDP WHAT Y POSITION THE PLAYFIELDS SHOULD BE AT
- MOVE.L PLAYY,(A1)
- ;COPY SPRITE TABLE TO VRAM
- JSR SPRITEDUMP
- ;READ JOYPAD
- BSR READJOY ;READ THE JOYPAD
- RTS
- ;----------------------------------------------------------
- ; PUT DATA BELOW HERE
- ;----------------------------------------------------------
- ;----------------------------------------------------------
- ; CHARACTER CODES TO BUILD OUR PATTERN
- ;
- ; THE CODE IS IN THE FORMAT $NNNN
- ;
- ; THE LAST TWO NUMBERS ($00NN) REFER TO THE CHARACTER NUMBER IN VRAM TO USE
- ; (THE CHARACTER NUMBER IS THE VRAM ADDRESS DIVIDED BY 32 (OR DIVIDED BY $20 HEXADECIMAL))
- ;
- ; IF THE FIRST NUMBER ($N000) IS '1' IT MEANS MIRROR THE CHARACTER VERTICALLY
- ; IF THE SECOND NUMBER ($0N00) IS '8' IT MEANS MIRROR THE CHARACTER HORIZONTALLY
- ;
- ; SO WHEN WE HAVE A DIAGONAL CHARACTER LINE THIS - / WE CAN MIRROR IT TO GET THIS \
- ; SO WE CAN BUILD THIS - /\
- ; \/ USING ONE DIAGONAL AND MIRRORING
- ;----------------------------------------------------------
- CHARGFX incbin Uncompressed\Mapunc_CHARGFX.bin
- ;----------------------------------------------------------
- ; MAP GRAPHICS
- ;----------------------------------------------------------
- MAPGFX incbin Uncompressed\Artunc_MAPGFX.smd
- ;----------------------------------------------------------
- ; SPRITE GRAPHICS
- ; 2 X 4 CHARACTERS ARRANGED AS FOLLOWS -
- ;
- ; 1 5
- ; 2 6
- ; 3 7
- ; 4 8
- ;----------------------------------------------------------
- SPRITEGFX incbin Uncompressed\Artunc_SPRITEGFX.smd
- ;----------------------------------------------------------
- RINGGFX incbin Uncompressed\Artunc_RINGGFX.smd
- ;----------------------------------------------------------
- ; USER PALETTES
- ;----------------------------------------------------------
- PALETTE1 incbin Palettes\pallet1.bin
- PALETTE2 incbin Palettes\pallet2.bin
- PALETTE3 incbin Palettes\pallet3.bin
- RINGS.S
- ;----------------------------------------------------------
- ; RING CODE
- ;----------------------------------------------------------
- ;RING STRUCTURE STUFF
- RSSET 0
- RING_X: RS.L 1
- RING_Y: RS.L 1
- RING_MX: RS.L 1
- RING_MY: RS.L 1
- RING_GRAV: RS.L 1
- RING_LIFE: RS.W 1
- RING_SIZE: RS.B 0
- RINGS: EQU 64 ;TOTAL NUMBER OF RINGS
- RSSET SYSTEMEND
- RINGDATA: RS.B RINGS*RING_SIZE ;RING SYSTEM
- RINGEND: RS.B 0
- ;-------------------------
- ; INITIALISE RINGS
- ;-------------------------
- RINGINIT: LEA.L RINGDATA,A0
- MOVE.W #RINGS-1,D0 ;NUMBER OF RINGS TO PROCESS
- MOVE.W #0,D1
- @L1: MOVE.W D1,RING_LIFE(A0) ;SET LIFE SPAN TO 0
- ADD.L #RING_SIZE,A0
- DBRA D0,@L1
- RTS
- ;-------------------------
- ; PROCESS RINGS
- ;-------------------------
- PROCRING: LEA.L RINGDATA,A0
- MOVE.W #RINGS-1,D0
- AND.W #$FF,D7 ;CLEAR AWAY ANY PREVIOUS SIZE INFO FROM SPRITE COUNT
- ADD.W #S_2X2,D7 ;ALL THESE RINGS WILL BE 2X2 IN SIZE
- MOVE.W #S_PAL2+$1100/32,D6 ;ALL RINGS WILL USE THIS PALETTE AND VRAM LOCATION
- @L1: TST.W RING_LIFE(A0)
- BEQ.S @SKIP
- ;ADD SPRITE TO TABLE
- MOVE.W RING_Y(A0),(A1)+ ;Y POSITION
- MOVE.W D7,(A1)+ ;SIZE 2X2 CHARACTERS AND SPRITE NUM
- MOVE.W D6,(A1)+ ;PALETTE NUMBER+GRAPHIC VRAM LOCATION/32
- MOVE.W RING_X(A0),(A1)+ ;X POSITION ($80 IS LEFT OF SCREEN)
- ADD.W #1,D7 ;INCREMENT SPRITE COUNT
- ;PROCESS PHYSICS
- MOVE.L RING_MX(A0),D1
- ADD.L D1,RING_X(A0)
- MOVE.L RING_MY(A0),D1
- ADD.L D1,RING_Y(A0)
- MOVE.L RING_GRAV(A0),D1
- ADD.L D1,RING_MY(A0)
- SUB.W #1,RING_LIFE(A0)
- ;CLIP
- MOVE.W RING_Y(A0),D1 ;Y CLIP
- SUB.W #$80-16,D1
- CMP.W #224+16,D1
- BHI.S @CLIP
- MOVE.W RING_X(A0),D1 ;X CLIP
- SUB.W #$80-16,D1
- CMP.W #320+16,D1
- BLS.S @SKIP
- @CLIP:
- CLR.W RING_LIFE(A0)
- @SKIP: ADD.L #RING_SIZE,A0
- DBRA D0,@L1
- RTS
- ;-------------------------
- ; ADD A RING
- ;-------------------------
- ADDRING: LEA.L RINGDATA,A0
- MOVE.W #RINGS-1,D0
- MOVE.W #10000,D2 ;STORE SHORTEST REMAINING RING LIFE HERE
- MOVE.L A0,A1 ;SHORTEST LIFE RING POSITION
- @L1: MOVE.W RING_LIFE(A0),D1
- BEQ.S @ADD ;RING WITH ZERO LIFE, SO FREE SLOT FOUND
- CMP.W D1,D2 ;SHORTER LIFE THAN CURRENT SHORTEST?
- BLE.S @SKIP
- MOVE.W D1,D2 ;NEW SHORTEST
- MOVE.L A0,A1 ;NEW SHORTEST POSITION
- @SKIP: ADD.L #RING_SIZE,A0
- DBRA D0,@L1
- MOVE.L A1,A0 ;REPLACE RING WITH SHORTEST LIFE LEFT IF ZERO NOT FOUND
- @ADD: SWAP.W D3
- CLR.W D3
- SWAP.W D4
- CLR.W D4
- MOVE.L D3,RING_X(A0)
- MOVE.L D4,RING_Y(A0)
- MOVE.L D5,RING_MX(A0)
- MOVE.L D6,RING_MY(A0)
- MOVE.L D7,RING_GRAV(A0)
- MOVE.W #120,RING_LIFE(A0)
- RTS
- FLAME.S
- ;----------------------------------------------------------
- ; FLAME CODE
- ;----------------------------------------------------------
- RSSET 0
- FLAME_X: RS.W 1
- FLAME_DIR: RS.W 1
- FLAME_TIME: RS.W 1
- FLAME_SIZE: RS.B 0
- RSSET RINGEND
- ;FLAME STUFF
- FBUFFER: RS.W 1 ;BUFFER FOR FLAME
- XPOS: RS.W 1 ;XPOS FOR FLAME
- FLAMES: EQU 12 ;TOTAL NUMBER OF FLAMES
- FLAMEDATA: RS.B FLAMES*FLAME_SIZE
- FLAMEEND: RS.B 0
- FLAMETABLE: EQU DECRUNCH+4096+1160*2
- FLAMEBUF1: EQU DECRUNCH+4096
- FLAMEBUF2: EQU DECRUNCH+4096+1160
- ;----------------------------------------------------------
- ; INIT FLAME
- ;----------------------------------------------------------
- INITFLAME:
- LEA.L PALETTE3,A0 ;FLAME PALETTE
- JSR SETPAL3
- LEA.L DECRUNCH,A0 ;SET UP MASK FOR FLAME PLAYFIELD
- MOVE.W #$8000+S_PAL3,D0
- MOVE.W #(4096/2)-1,D1
- @L1: MOVE.W D0,(A0)+
- DBRA D1,@L1
- LEA.L DECRUNCH+4096,A0 ;CLEAR FLAME BUFFERS
- MOVEQ.L #0,D0
- MOVE.W #((1160*2)/4)-1,D1
- @L3: MOVE.L D0,(A0)+
- DBRA D1,@L3
- ;INIT FLAME CREATORS
- LEA.L FLAMEDATA,A1
- MOVE.W #FLAMES-1,D1
- @L2: MOVE.W #-10000,(A1)+ ;START
- MOVE.W #1,(A1)+ ;SPEED
- MOVE.W #0,(A1)+ ;LIFE
- DBRA D1,@L2
- MOVE.W #0,FBUFFER
- DMADUMP FLAMEGFX1,32*32,$0 ;DUMP 4 CHARACTERS (SIZE 32 BYTES EACH) TO VRAM LOCATION $20 (MAP GRAPHICS)
- BSR CALCFLAME ;CREATE A TABLE USED TO SPEED UP ANTI-ALIAS MATHS
- RTS
- ;----------------------------------------------------------
- ; CALC FLAME TABLE - TO SPEED UP MATHS
- ;----------------------------------------------------------
- CALCFLAME: LEA.L FLAMETABLE,A0
- MOVEQ.L #0,D0
- MOVEQ.L #0,D2
- MOVE.W #255-1,D1
- MOVE.B #0,(A0)+
- @L1: MOVE.B D0,D2
- ASR.W #2,D2
- MOVE.B D2,(A0)+
- ADD.B #1,D0
- DBRA D1,@L1
- RTS
- ;----------------------------------------------------------
- ; CONVERT FLAME - COPY FLAME TO PLAYFIELD
- ;----------------------------------------------------------
- CONVFLAME: LEA.L DECRUNCH+1,A0
- LEA.L FLAMEBUF2,A1
- SUB.W FBUFFER,A1
- MOVE.W #$8000+S_PAL3,D1
- MOVE.W #28-1,D2
- @L2:
- REPT 9
- MOVE.L (A1)+,D1
- MOVEP.L D1,(0,A0) ;VERY SNEAKY
- LEA.L 8(A0),A0
- ENDR
- MOVE.L (A1)+,D1
- MOVEP.L D1,(0,A0)
- LEA.L -72+128(A0),A0
- DBRA D2,@L2
- RTS
- ;----------------------------------------------------------
- ; MAIN FLAME CODE
- ;----------------------------------------------------------
- DRAWFLAME:
- ;DUMP FLAME TO VRAM
- DMADUMP DECRUNCH,4096,$E000
- ;TOGGLE BUFFERS
- CMP.W #0,FBUFFER
- BEQ.S @B1
- MOVE.W #0,FBUFFER
- BRA.S @B2
- @B1: MOVE.W #1160,FBUFFER
- @B2:
- ;ADD AND MOVE FLAME CREATION OBJECTS
- LEA.L FLAMEBUF2+40*28,A0
- SUB.W FBUFFER,A0
- MOVEQ.L #0,D0 ;CLEAR BOTTOM LINE OF FLAME TO AVOID OVER SATURATION
- REPT 10
- MOVE.L D0,(A0)+
- ENDR
- LEA.L FLAMEBUF2+40*28+2,A0
- SUB.W FBUFFER,A0
- LEA.L FLAMEDATA,A1
- MOVE.W #FLAMES-1,D2
- MOVE.W #$1F,D1
- @J1: MOVE.W (A1)+,D0 ;POSITION
- ADD.W (A1)+,D0 ;SPEED/DIR
- BLT.S @D1
- CMP.W #38*8,D0
- BLT.S @D2
- @D1: LEA.L 2(A1),A1
- BRA.S @D3
- @D2: MOVE.W D0,-4(A1)
- ASR.W #3,D0
- LEA.L (A0,D0.W),A2
- MOVE.B D1,-2(A2) ;DRAW CROSS AT RANDOM POSITION
- MOVE.B D1,-1(A2)
- MOVE.B D1,-(40+1)(A2)
- MOVE.B D1,(A2)
- SUB.W #1,(A1)+
- BGE.S @T1
- @D3:
- BTST #5,JOYPAD0
- BNE @SKIP
- MOVE.L A0,A3
- JSR GETRANDOM
- ADD.W #32,D0
- MOVE.W D0,-6(A1) ;POSITION
- JSR GETRANDOM
- AND.W #$1F,D0
- MOVE.W D0,-2(A1) ;TIME
- JSR GETRANDOM
- AND.W #$7,D0
- SUB.W #3,D0
- MOVE.W D0,-4(A1) ;SPEED
- MOVE.L A3,A0
- BRA.S @T1
- @SKIP: MOVE.W #-10000,-6(A1)
- @T1:
- DBRA D2,@J1
- ;NOW ANTI ALIAS TO BUFFER 1
- MOVE.W FBUFFER,D0
- BEQ.S @PP1
- LEA.L FLAMEBUF1+40,A0
- LEA.L FLAMEBUF2+1,A1
- BRA.S @PP2
- @PP1: LEA.L FLAMEBUF2+40-1,A0
- LEA.L FLAMEBUF1,A1
- @PP2:
- LEA.L FLAMETABLE,A2 ;FLAME TABLE
- LEA.L -39(A0),A3
- LEA.L 2(A0),A4
- MOVEQ.L #0,D0
- MOVE.W #(28*40)-1,D5
- @LL1: MOVE.B (A0)+,D0
- ADD.B (A0),D0
- ADD.B (A4)+,D0
- ADD.B (A3)+,D0
- ; ASR.W #2,D0
- ; MOVE.B D0,(A1)+
- MOVE.B (A2,D0.W),(A1)+
- DBRA D5,@LL1
- RTS
- ;----------------------------------------------------------
- ; FLAME GFX
- ;----------------------------------------------------------
- FLAMEGFX1 incbin Uncompressed\Artunc_FLAMEGFX1.smd
- FLAMEGFX2 incbin Uncompressed\Artunc_FLAMEGFX2.smd
- SRAM.S
- ; https://pastebin.com/EEgPAspc
- InitSRAM:
- move.b #1,($A130F1).l ; Enable SRAM writing
- lea ($200001).l,a1 ; Load SRAM memory into a1
- movep.l 0(a1),d0 ; Get the existing string at the start of SRAM
- move.l #$5352414D,d1 ; Write the string "SRAM" to d1
- cmp.l d0,d1 ; Was it already in SRAM?
- beq.s @Continue ; If so, skip
- movep.l d1,0(a1) ; Write string "SRAM"
- ; Insert your values to be initialized, start with 8(a1).
- @Continue:
- move.b #0,($A130F1).l ; Disable SRAM writing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement