11 March 2016 - Forum Rules
Started by lytron, October 16, 2013, 12:06:53 PM
Quote from: Bregalad on October 16, 2013, 03:20:44 PMPM me you mail address and I'll send you my SOM partially commented disassembly.
Quote from: Nightcrawler on October 16, 2013, 06:20:18 PMThat commented SOM dis-assembly sounds like something useful to add to the Documents section on the site. There's not too much in the way of commented SPC code there.
QuoteThat commented SOM dis-assembly sounds like something useful to add to the Documents section on the site
Quote from: lytron on October 17, 2013, 12:51:01 AMSo you might be interested in the Sound Engine of Ihatovo Monogatari as well? I already planned nontheless to offer my stuff here when I finish my Ihatovo Monogatari disassemble.
Quote from: Bregalad on October 17, 2013, 04:39:24 PMIt is extremely incomplete, definitely not worth adding to the Doccuments. But pehaps lytron will complete it ^^
Quote from: Nightcrawler on October 17, 2013, 05:51:50 PMOf course. There are similar such dis-assemblies in the Documents section under the Source Code category.
Quote from: RetroHelix on October 19, 2013, 05:16:58 AMYou could also ask Mop over at somedit.blogspot.com for his notes on the soundengine. This is what's got him started on doing a SoM editor as far as i know.
1307: E4 DF MOV A, $DF ; ly: New Echo Value gets loaded from $DF (Gets first set in $0251)1309: 3F 1B 06 CALL $061B ;Change echo delay ; ly: A --> (Y), Value from $DF gets stored in DSP-reg $7D (Y-value set in Line 12FD)130C: FD MOV Y, A130D: D0 01 BNE $1310130F: BC INC A ;Compute start adress of echo buffer1310: 1C ASL A1311: 1C ASL A1312: 1C ASL A ; ly: A * 8; if A was = 0, than A = 81313: 48 FF EOR A, #$FF1315: BC INC A1316: 60 CLRC1317: 88 FA ADC A, #$FA1319: 8D 6D MOV Y, #$6D131B: 3F 1B 06 CALL $061B ; ly: DSP-reg $6D: Echo Buffer Start Offset (value * $100)
; ly: This transfers four bytes back to the 5A22 ; ly: Depending on bit 2 of $B1, the values of DSP OUTX-registers for channel 0-3 or 4-7 are... ; ly: ... multiplicated and transfered back. Here is an overview what it does: ; ly: Transfered byte: abbb.0ccc ; ly: a = is set if channels 4 to 7 are transfered, else clear ; ly: b = Bits 4-6 of the result of OUTX-register of channel x (DSP register $x9)... ; ly: ... multiplicated with the value of ($CD + x * 2) ; ly: c = Bits 4-6 of the result of OUTX-register of channel x (DSP register $x9)... ; ly: ... multiplicated with the value of ($CE + x * 2)138E: E8 34 MOV A, #$341390: C4 39 MOV $39, A1392: E8 CD MOV A, #$CD1394: 8F 00 03 MOV $03, #$001397: 43 B1 05 BBS B2 $B1, $139F ; ly: Bit 2 of $B1 decide if in the upper or lower half of the DSP -OUTX reg gets stored139A: 8F 09 B2 MOV $B2, #$09 ; ly: $B2's value is a DSP address (see line $13B0/2): $09 = OUTX for Channel 0139D: 2F 08 BRA $13A7139F: 8F 49 B2 MOV $B2, #$49 ; ly: $B2's value is a DSP address (see line $13B0/2): $49 = OUTX for Channel 413A2: 60 CLRC13A3: 88 08 ADC A, #$0813A5: E2 03 SET1 $03, 713A7: C4 3A MOV $3A, A ; ly: $3A = #$CD if $B2 = #$09, else $3A = #$D5 (if $B2 = #$49)13A9: 60 CLRC13AA: 88 08 ADC A, #$0813AC: C4 02 MOV $02, A ; ly: Set up compare value for leaving the loop that follows13AE: F8 3A MOV X, $3A ; ly: Load Load-register (will be between $CD and $DB)13B0: EB B2 MOV Y, $B213B2: CB F2 MOV $F2, Y ; ly: Set DSP address to the -OUTX-register ($x9) for Channel x13B4: EB F3 MOV Y, $F313B6: 6D PUSH Y ; ly: Load old value and push it on the stack13B7: BF MOV A, (X)+ ; ly: Load from the address that is in X into A and increment X13B8: CF MUL YA ; ly: Multiply old value with loaded value13B9: DD MOV A, Y ; ly: Only bits 12 to 14 of the result are important13BA: 28 70 AND A, #$70 ; ly: AND #%0111.000013BC: C4 38 MOV $38, A ; ly: Temp-store the result13BE: EE POP Y ; ly: Load old value back in Y13BF: BF MOV A, (X)+ ; ly: Load value from next address into A13C0: CF MUL YA ; ly: Multiply old value with the second loaded byte13C1: DD MOV A, Y13C2: D8 3A MOV $3A, X ; ly: Store back load-register-address13C4: F8 39 MOV X, $39 ; ly: $39 contains an register address. Starts at $34 at the beginning of this subroutine (see line $138E)13C6: 9F XCN A ; ly: Changes high and low nybble, so the order of the bits is now 3210765413C7: 28 07 AND A, #$07 ; ly: so just bits 6,5 and 4 of the original multiplication result are important13C9: 04 38 OR A, $38 ; ly: Adds bits 6,5 and 4 of the first multiplication result to it (into the bits 6, 5 and 4)13CB: 04 03 OR A, $03 ; ly: if the higher registers are done, bit 7 gets set through this13CD: AF MOV (X)+, A ; ly: Store value in $34-7 and increment that register address13CE: D8 39 MOV $39, X ; ly: Store the address back into $3913D0: 60 CLRC13D1: 98 10 B2 ADC $B2, #$10 ; ly: Changes the address to the OUTX-register for the next channel ($x9, this does an x=x+1)13D4: 69 02 3A CMP $02, $3A ; ly: Look up if all channels are done ($3A is the counter, for incremented see lines $13AE, $13B7, $13BF and $13C2)13D7: D0 D5 BNE $13AE13D9: BA 34 MOVW YA, $3413DB: DA F4 MOVW $F4, YA ; ly: This echoes back the values in $34 to $37, so the 5A22 can read them out of reg. $2140-313DD: BA 36 MOVW YA, $3613DF: DA F6 MOVW $F6, YA13E1: 58 04 B1 EOR $B1, #$04 ; ly: Flip around bit 3 of $B1 (ready signal?)13E4: 6F RET
Quote from: Bregalad on November 17, 2013, 12:05:24 PMDSP registers $x9 contains the "output wave" value of each channel.The only purpose I'd see to send them to the main CPU would be to display some kind of oscilloscope for debugging purposes, however the bandwidth would never allow a full oscilloscope so I don't know.
Page created in 0.075 seconds with 20 queries.