headkaze · 11065
.arm.text.global mainmain: mov r0, #0x4000000 mov r1, #0x400 add r1, r1, #3 str r1, [r0] mov r0, #0x6000000 mov r1, #0xFF mov r2, #0x9600loop1: strh r1, [r0], #2 subs r2, r2, #1 bne loop1infin: b infin
.arm.text.global mainmain: mov r0, #0x4000000 mov r1, #0x400 add r1, r1, #3 str r1, [r0] mov r0, #0x6000000 ldr r1,=picBitmap mov r3, #0x4B00loop: ldr r2,[r1],#4 str r2,[r0],#4 subs r3,r3,#1 bne loopinfin: b infin
#include "sound.h".arm.text.global mainmain: SoundOn @ Step 1: My macro that turns the sound circut on in REG_SOUNDCNT_X @ note no 'x' for sound channel number. REG_SOUNDCNT_X controls entire circut. S1_Enable @ Step 2: My macro to enable Sound Channel 1. S2_Enable is channel 2... to 4. ldr r1,=REG_SOUND1CNT_L @ in these two lines I do steps 3&4 at once. since these ldr r0,=0xf7800056 @ registers are 16bit, we can do both at once. str r0,[r1] @ store data for steps 3&4. ldr r1,=REG_SOUND1CNT_X @ Step 5: Load the register. ldr r0,=0x8400 @ This register has something to do with choosing str r0,[r1] @ between the different stuff a channel can do such as Square wave orloop: b loop