mirror of
https://github.com/a2-4am/million-perfect-letters.git
synced 2024-06-12 13:29:29 +00:00
music and sound changes WIP
This commit is contained in:
parent
d4ee6b3a62
commit
0d520a415a
BIN
res/M.CEMBALO
BIN
res/M.CEMBALO
Binary file not shown.
BIN
res/M.SICILIENNE
Normal file
BIN
res/M.SICILIENNE
Normal file
Binary file not shown.
|
@ -15,6 +15,34 @@ gMockingboardSlot
|
|||
gSoundPref
|
||||
!byte 1 ; 0 = no sound, 1 = sound
|
||||
|
||||
progressionIndex ; [byte][private]
|
||||
!byte 0
|
||||
|
||||
kProgressionsByWorld ; chord progression to use on each world (index=world)
|
||||
!word k251Progression
|
||||
!word k251Progression
|
||||
!word k251Progression
|
||||
!word k251Progression
|
||||
!word k6251Progression
|
||||
!word k6251Progression
|
||||
!word k6251Progression
|
||||
!word k6251Progression
|
||||
!word 0
|
||||
!word 0
|
||||
!word 0
|
||||
!word 0
|
||||
k251Progression
|
||||
!byte 3
|
||||
!word M2
|
||||
!word M5
|
||||
!word M1
|
||||
k6251Progression
|
||||
!byte 4
|
||||
!word M6
|
||||
!word M2
|
||||
!word M5
|
||||
!word M1
|
||||
|
||||
ReinitSoundAfterPrefChange
|
||||
ldx gMockingboardSlot
|
||||
InitSound
|
||||
|
@ -53,6 +81,35 @@ SoundLibraryDispatch=*+1
|
|||
+ lda KBD
|
||||
Silence rts
|
||||
|
||||
InitPuzzleSound
|
||||
lda #$FF
|
||||
sta progressionIndex
|
||||
rts
|
||||
|
||||
PlayNextChord
|
||||
; TODO
|
||||
rts
|
||||
inc progressionIndex
|
||||
lda gWorldID
|
||||
asl
|
||||
tax
|
||||
lda kProgressionsByWorld, x
|
||||
sta $FE
|
||||
inx
|
||||
lda kProgressionsByWorld, x
|
||||
sta $FF
|
||||
lda progressionIndex
|
||||
asl
|
||||
tay
|
||||
iny
|
||||
lda ($FE), y
|
||||
pha
|
||||
iny
|
||||
lda ($FE), y
|
||||
tay
|
||||
pla
|
||||
jmp PlaySound
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; SoftBell
|
||||
;
|
||||
|
|
|
@ -42,6 +42,7 @@ Start
|
|||
sta GlobalLeftMargin
|
||||
lda kPuzzleWidths, x
|
||||
jsr InitPuzzleStorage
|
||||
jsr InitPuzzleSound
|
||||
ldx gPuzzleID
|
||||
jsr LoadPuzzleFromMemory
|
||||
lda #0
|
||||
|
@ -85,6 +86,15 @@ Start
|
|||
!source "src/electric.duet.a"
|
||||
!source "src/mockingduet.a"
|
||||
MainMenuMusic
|
||||
!bin "res/M.CEMBALO"
|
||||
!bin "res/M.SICILIENNE"
|
||||
; !bin "res/M.CEMBALO"
|
||||
M2
|
||||
!bin "res/M.2"
|
||||
M5
|
||||
!bin "res/M.5"
|
||||
M1
|
||||
!bin "res/M.1"
|
||||
M6
|
||||
!bin "res/M.6"
|
||||
}
|
||||
LastMover
|
||||
|
|
|
@ -42,28 +42,40 @@ FMDEST sta $4000, x
|
|||
beq +
|
||||
; set up MockingDuet routine with the Mockingboard slot number
|
||||
; so it works in any slot and not just slot 4
|
||||
stx MBSLOT1
|
||||
stx MBSLOT2
|
||||
stx MBSLOT3
|
||||
stx MBSLOT4
|
||||
stx MBSLOT5
|
||||
stx MBSLOT6
|
||||
stx MBSLOT7
|
||||
stx MBSLOT8
|
||||
stx MBSLOT9
|
||||
stx MBSLOT10
|
||||
stx MBSLOT11
|
||||
stx MBSLOT12
|
||||
stx MBSLOT13
|
||||
stx MBSLOT14
|
||||
stx MBSLOT15
|
||||
stx MBSLOT16
|
||||
stx MBSLOT17
|
||||
stx MBSLOT18
|
||||
stx MBSLOT19
|
||||
stx MBSLOT20
|
||||
stx MBSLOT21
|
||||
stx MBSLOT22
|
||||
stx MBSLOT01+2
|
||||
stx MBSLOT02+2
|
||||
stx MBSLOT03+2
|
||||
stx MBSLOT04+2
|
||||
stx MBSLOT05+2
|
||||
stx MBSLOT06+2
|
||||
stx MBSLOT07+2
|
||||
stx MBSLOT08+2
|
||||
stx MBSLOT09+2
|
||||
stx MBSLOT10+2
|
||||
stx MBSLOT11+2
|
||||
stx MBSLOT12+2
|
||||
stx MBSLOT13+2
|
||||
stx MBSLOT14+2
|
||||
stx MBSLOT15+2
|
||||
stx MBSLOT16+2
|
||||
stx MBSLOT17+2
|
||||
stx MBSLOT18+2
|
||||
stx MBSLOT19+2
|
||||
stx MBSLOT20+2
|
||||
stx MBSLOT21+2
|
||||
stx MBSLOT22+2
|
||||
stx MBSLOT23+2
|
||||
stx MBSLOT24+2
|
||||
stx MBSLOT25+2
|
||||
stx MBSLOT26+2
|
||||
stx MBSLOT27+2
|
||||
stx MBSLOT28+2
|
||||
stx MBSLOT29+2
|
||||
stx MBSLOT30+2
|
||||
stx MBSLOT31+2
|
||||
stx MBSLOT32+2
|
||||
stx MBSLOT33+2
|
||||
stx MBSLOT34+2
|
||||
+ jmp Start
|
||||
|
||||
InitScrollUp
|
||||
|
|
|
@ -15,6 +15,12 @@
|
|||
; along with this program; if not, write to the
|
||||
; Free Software Foundation, Inc.,
|
||||
; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
;
|
||||
; -----------------------------------------------------------------------------
|
||||
;
|
||||
; changes to original (by 4am):
|
||||
; - fixes for stereo output
|
||||
; - labels for slot independence (see million.init.a)
|
||||
|
||||
!zone {
|
||||
|
||||
|
@ -54,25 +60,25 @@ END JSR RESET
|
|||
SETNOTE STA DURATION
|
||||
LDA #LEFTCHN
|
||||
SEND STA CHN
|
||||
MBSLOT1=*+2
|
||||
STA $C401
|
||||
MBSLOT01 STA $C401
|
||||
MBSLOT02 STA $C481
|
||||
JSR SETREG1
|
||||
INY
|
||||
LDA (SONG),Y
|
||||
BEQ SKIP ;IF 0 KEEP LTTSA
|
||||
JSR CONVFREQ
|
||||
SKIP LDA TONE
|
||||
MBSLOT2=*+2
|
||||
STA $C401
|
||||
MBSLOT03 STA $C401
|
||||
MBSLOT04 STA $C481
|
||||
JSR WRDATA1
|
||||
INC CHN
|
||||
LDA CHN
|
||||
MBSLOT3=*+2
|
||||
STA $C401
|
||||
MBSLOT05 STA $C401
|
||||
MBSLOT06 STA $C481
|
||||
JSR SETREG1
|
||||
LDA TONE+1
|
||||
MBSLOT4=*+2
|
||||
STA $C401
|
||||
MBSLOT07 STA $C401
|
||||
MBSLOT08 STA $C481
|
||||
JSR WRDATA1
|
||||
LDA #RIGHTCHN
|
||||
STA CHN
|
||||
|
@ -106,68 +112,60 @@ LOBYTE STA TONE
|
|||
|
||||
|
||||
RESET LDA #$00
|
||||
MBSLOT5=*+2
|
||||
STA $C400
|
||||
MBSLOT6=*+2
|
||||
STA $C480
|
||||
MBSLOT09 STA $C400
|
||||
MBSLOT10 STA $C480
|
||||
LDA #$04
|
||||
MBSLOT7=*+2
|
||||
STA $C400
|
||||
MBSLOT8=*+2
|
||||
STA $C480
|
||||
MBSLOT11 STA $C400
|
||||
MBSLOT12 STA $C480
|
||||
RTS
|
||||
|
||||
INIT LDA #$FF
|
||||
MBSLOT9=*+2
|
||||
STA $C403
|
||||
MBSLOT10=*+2
|
||||
STA $C483
|
||||
MBSLOT13 STA $C403
|
||||
MBSLOT14 STA $C483
|
||||
LDA #$07
|
||||
MBSLOT11=*+2
|
||||
STA $C402
|
||||
MBSLOT12=*+2
|
||||
STA $C482
|
||||
MBSLOT15 STA $C402
|
||||
MBSLOT16 STA $C482
|
||||
RTS
|
||||
|
||||
SETREG1 LDA #$07
|
||||
MBSLOT13=*+2
|
||||
STA $C400
|
||||
MBSLOT17 STA $C400
|
||||
MBSLOT18 STA $C480
|
||||
LDA #$04
|
||||
MBSLOT14=*+2
|
||||
STA $C400
|
||||
MBSLOT19 STA $C400
|
||||
MBSLOT20 STA $C480
|
||||
RTS
|
||||
|
||||
WRDATA1 LDA #$06
|
||||
MBSLOT15=*+2
|
||||
STA $C400
|
||||
MBSLOT21 STA $C400
|
||||
MBSLOT22 STA $C480
|
||||
LDA #$04
|
||||
MBSLOT16=*+2
|
||||
STA $C400
|
||||
MBSLOT23 STA $C400
|
||||
MBSLOT24 STA $C480
|
||||
RTS
|
||||
|
||||
ENACHN LDA #ENAREG
|
||||
MBSLOT17=*+2
|
||||
STA $C401
|
||||
MBSLOT25 STA $C401
|
||||
MBSLOT26 STA $C481
|
||||
JSR SETREG1
|
||||
LDA #%00111100
|
||||
MBSLOT18=*+2
|
||||
STA $C401
|
||||
MBSLOT27 STA $C401
|
||||
MBSLOT28 STA $C481
|
||||
JSR WRDATA1
|
||||
LDA #VOL_A
|
||||
MBSLOT19=*+2
|
||||
STA $C401
|
||||
MBSLOT29 STA $C401
|
||||
MBSLOT30 STA $C481
|
||||
JSR SETREG1
|
||||
LDA #$0F
|
||||
MBSLOT20=*+2
|
||||
STA $C401
|
||||
MBSLOT31 STA $C401
|
||||
MBSLOT32 STA $C481
|
||||
JSR WRDATA1
|
||||
LDA #VOL_B
|
||||
MBSLOT21=*+2
|
||||
STA $C401
|
||||
MBSLOT33 STA $C401
|
||||
MBSLOT34 STA $C481
|
||||
JSR SETREG1
|
||||
LDA #$0F
|
||||
MBSLOT22=*+2
|
||||
STA $C401
|
||||
MBSLOT35 STA $C401
|
||||
MBSLOT36 STA $C481
|
||||
JSR WRDATA1
|
||||
RTS
|
||||
|
||||
|
|
12
src/puzzle.a
12
src/puzzle.a
|
@ -87,10 +87,14 @@ AddTargetWordToPuzzle
|
|||
inc puzzle_word_count
|
||||
rts
|
||||
|
||||
unused_counter=$FD
|
||||
CheckForTargetWord
|
||||
; in: none
|
||||
; out: C clear if a target word was found on row 4
|
||||
; C set if no target word found
|
||||
; note: will return C=set if target word was found but all letters were
|
||||
; already used (i.e. word had already been found before but player
|
||||
; shifted letters out and back)
|
||||
+LDADDR puzzle_words
|
||||
+ST16 $FE
|
||||
ldx #0 ; word index
|
||||
|
@ -106,12 +110,17 @@ CheckForTargetWord
|
|||
; found matching word
|
||||
; set high bit on all letters in row 4
|
||||
ldy #0
|
||||
sty unused_counter ; to see if all letters were already used (i.e. this word was already found)
|
||||
- lda puzzle_data4, y
|
||||
bmi +
|
||||
inc unused_counter
|
||||
ora #$80
|
||||
sta puzzle_data4, y
|
||||
iny
|
||||
+ iny
|
||||
cpy puzzle_logical_width
|
||||
bne -
|
||||
lda unused_counter
|
||||
beq @notfound
|
||||
clc
|
||||
rts
|
||||
@nextword
|
||||
|
@ -124,6 +133,7 @@ CheckForTargetWord
|
|||
+ inx
|
||||
cpx puzzle_word_count
|
||||
bne @checkword
|
||||
@notfound
|
||||
sec
|
||||
rts
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@ gWorldID ; a world is a group of 100 similar puzzles
|
|||
gPuzzleID ; ID of current puzzle within the current world (100 puzzles per world, 0-based)
|
||||
!byte $FD ; 0x00..0x63
|
||||
|
||||
kPuzzleWidths ; width in letters of the puzzles in each world
|
||||
!byte 4,5,6,7 ; (every puzzle in a world is the same width)
|
||||
kPuzzleWidths ; width in letters of the puzzles in each world (index=world)
|
||||
!byte 4,5,6,7 ; note: every puzzle in a world is the same width
|
||||
!byte 4,5,6,7
|
||||
!byte 4,5,6,7
|
||||
|
||||
|
|
|
@ -199,6 +199,8 @@ PlayEventLetter
|
|||
rts ; puzzle is complete, return to caller with A = kCompletedPuzzle
|
||||
|
||||
MarkTargetWord
|
||||
; in: none
|
||||
; out: all registers & flags clobbered
|
||||
ldx #4
|
||||
ldy #0
|
||||
- lda puzzle_data4, y
|
||||
|
@ -218,10 +220,11 @@ MarkTargetWord
|
|||
iny
|
||||
cpy puzzle_logical_width
|
||||
bne -
|
||||
; TODO sound here?
|
||||
rts
|
||||
jmp PlayNextChord
|
||||
|
||||
CheckForPuzzleComplete
|
||||
; in: none
|
||||
; out: A = play event loop code
|
||||
jsr IsPuzzleComplete
|
||||
bcs +
|
||||
lda #kCompletedPuzzle
|
||||
|
|
Loading…
Reference in New Issue
Block a user