Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sounds.asm - github.com/coolgirl-multicart/coolgirl-multirom-builder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 684bd3532f3b2567036ba8ee049cfa885d79cd8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
  ; cursor moving sound
bleep:
  ; enable channel
  lda #%00000001
  sta APUSTATUS
  ; square 1
  lda #%10000111
  sta SQ1VOL
  ; sweep
  lda #%10001001
  sta SQ1SWEEP
  lda #%11110000
  ; timer
  sta SQ1LO
  ; length counter and timer
  lda #%00001000
  sta SQ1HI
  rts

  ; beep sound
beep:
  ; enable channel
  lda #%00000100
  sta APUSTATUS
  ; triangle
  lda #%01000000
  sta TRILINEAR
  ; timer
  lda #%1000000
  sta TRILO
  ; length counter and timer
  lda #%00001000
  sta TRIHI
  rts

  ; error sound
error_sound:
  ; enable channel
  lda #%00000100
  sta APUSTATUS
  ; triangle
  lda #%01001111
  sta TRILINEAR
  ; timer
  lda #%00000000
  sta TRILO
  ; length counter and timer
  lda #%11110011
  sta TRIHI
  rts

  ; game start sound
start_sound:
  ;enable channel
  lda #%00000001
  sta APUSTATUS
  ;square 1
  lda #%00011111
  sta SQ1VOL
  ; sweep
  lda #%10011010
  sta SQ1SWEEP
  ; timer
  lda #%11111111
  sta SQ1LO
  ; length counter and timer
  lda #%10010000
  sta SQ1HI
  rts

  ; Konami Code sound
start_sound_alt:
  ; enable channel
  lda #%00000001
  sta APUSTATUS
  ; square 1
  lda #%10011111
  sta SQ1VOL
  ; sweep
  lda #%10000011
  sta SQ1SWEEP
  ; timer
  lda #%00100000
  sta SQ1LO
  ; length counter and timer
  lda #%11000000
  sta SQ1HI
  rts

wait_sound_end:
  lda APUSTATUS
  bne wait_sound_end
  rts

reset_sound:
  lda #0
  sta SQ1_VOL
  sta SQ1_SWEEP
  sta SQ1_LO
  sta SQ1_HI
  sta SQ2_VOL
  sta SQ2_SWEEP
  sta SQ2_LO
  sta SQ2_HI
  sta TRILINEAR
  sta TRI_LO
  sta TRI_HI
  sta NOISE_VOL
  sta NOISE_LO
  sta NOISE_HI
  sta DMC_FREQ
  sta DMC_RAW
  sta DMC_START
  sta DMC_LEN
  ldx #$40
  stx JOY2_FRAME ; disable APU frame IRQ
  rts