Devpac 3 - How to create sound?

All 680x0 related coding posts in this section please.

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
WireLord55
Atari freak
Atari freak
Posts: 52
Joined: Sun Apr 22, 2018 9:48 am

Devpac 3 - How to create sound?

Postby WireLord55 » Mon Apr 23, 2018 8:20 am

Hi,

How do you create sounds in Devpac 3?

Are there any tutorials on making sound?

Any suggestions are welcome

Thanks,

WireLord55
"Do...or do not. There is no try" - Yoda, Episode V

jury
Captain Atari
Captain Atari
Posts: 298
Joined: Tue Sep 21, 2004 11:11 am
Location: Poland

Re: Devpac 3 - How to create sound?

Postby jury » Mon Apr 23, 2018 9:56 am

Yes, there are tutorials on playing sounds 'in Devpac' ( chip and sampled ones ):
viewtopic.php?f=68&t=4330
or
viewtopic.php?f=1&t=33508&p=343043

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: Devpac 3 - How to create sound?

Postby Foxie » Mon Apr 23, 2018 4:55 pm

WireLord55 wrote:Hi,

How do you create sounds in Devpac 3?

Are there any tutorials on making sound?

Any suggestions are welcome

Thanks,

WireLord55


This is the YM hardware interface for FOXIE_YM:

Code: Select all

   ; Foxie's MROS YM driver.
   ; YM2149 hardware interface.


   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ; Starts the YM driver up.
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ym_hw_start:
   move.l   d0,-(a7)
   move.w   sr,-(a7)
   move.w   #$2700,sr

   move.b   conterm.w,keyclick_save         ; Disable system keyclick/bell.
   and.b   #$fa,conterm.w

   move.l   #$08000000,ym_base.w         ; Silence all three channels.
   move.l   #$09000000,ym_base.w
   move.l   #$10000000,ym_base.w
   move.b   #7,ym_base.w
   move.b   ym_base.w,d0            ; Turn mixer tone/noise off for all channels.
   or.b   #$3f,d0
   move.b   d0,ym_base+2.w

   move.l   timer_d_vector.w,timer_d_save      ; Save timer D vector.
   move.l   #timer_d_isr,timer_d_vector.w      ; Set vector.
   move.b   mfp_timer_cd_control.w,d0      ; Stop timer.
   and.b   #$f8,d0
   move.b   d0,mfp_timer_cd_control.w
   bset.b   #4,mfp_int_enable.w         ; Enable interrupt.
   bset.b   #4,mfp_int_mask.w
   move.b   #$ef,mfp_int_in_service.w      ; Clear interrupt.
   move.b   #$ef,mfp_int_pending.w

   bsr.w   detect_machine
   btst.b   #2,machine_type(pc)
   beq.b   .skip
   move.b   #14,ym_base.w            ; Internal speaker off for TT/Falcon.
   move.b   ym_base.w,d0
   move.b   d0,speaker_save
   bset.l   #6,d0
   move.b   d0,ym_base+2.w
.skip:

   bsr.w   reset_lmc

   move.w   (a7)+,sr
   move.l   (a7)+,d0
   rts


   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ; Shuts the YM driver down.
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ym_hw_stop:
   move.w   sr,-(a7)
   move.l   d0,-(a7)
   move.w   #$2700,sr

   move.b   keyclick_save(pc),d0
   and.b   #5,d0               ; Restore system keyclick/bell.
   or.b   d0,conterm.w

   move.l   #$08000000,ym_base.w         ; Silence all three channels.
   move.l   #$09000000,ym_base.w
   move.l   #$10000000,ym_base.w
   move.b   #7,ym_base.w
   move.b   ym_base.w,d0            ; Turn mixer tone/noise off for all channels.
   or.b   #$3f,d0
   move.b   d0,ym_base+2.w

   move.l   timer_d_save(pc),timer_d_vector.w   ; Restore vector.
   move.b   mfp_timer_cd_control.w,d0      ; Stop timer.
   and.b   #$f8,d0
   move.b   d0,mfp_timer_cd_control.w
   bclr.b   #4,mfp_int_enable.w         ; Disable interrupt.
   bclr.b   #4,mfp_int_mask.w
   move.b   #$ef,mfp_int_in_service.w      ; Clear interrupt.
   move.b   #$ef,mfp_int_pending.w

   btst.b   #2,machine_type(pc)         ; Restore internal speaker TT/Falcon.
   beq.b   .skip
   btst.b   #6,speaker_save(pc)
   bne.b   .skip
   move.b   #14,ym_base.w
   move.b   ym_base.w,d0
   bclr.l   #6,d0
   move.b   d0,ym_base.w
.skip:

   bsr.w   reset_lmc

   move.l   (a7)+,d0
   move.w   (a7)+,sr
   rts


   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ; Get cookie specified in d0.l.
   ; Returns value in d0.l.
   ; If found Z is set, otherwise clear.
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
get_cookie:
   move.l   a0,-(sp)
   move.l   d1,-(sp)

   move.l   cookiejar.w,a0
   move.l   a0,d1            ; Test a0, if zero no cookie jar.
   beq.b   .fail

.loop:
   move.l   (a0)+,d1         ; Get cookie name.
   beq.b   .fail            ; Null terminated list.
   cmp.l   d0,d1            ; Name equal?
   beq.b   .found
   addq.l   #4,a0            ; Skip data.
   bra.b   .loop
.found:

   move.l   (a0)+,d0
   move.l   (sp)+,d1
   move.l   (sp)+,a0
   cmp.w   d0,d0            ; Return zero.
   rts

.fail:
   move.l   (sp)+,d1
   move.l   (sp)+,a0
   moveq.l   #1,d0            ; Return nonzero.
   rts



   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ; Detect machine type and CPU.
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
detect_machine:
   move.l   d0,-(sp)

   clr.b   machine_type

   move.l   #'_CPU',d0
   bsr.w   get_cookie
   bne.b   .nocpu
   cmp.w   #20,d0
   blt.b   .nocpu
   bset.b   #0,machine_type
.nocpu:

   move.l   #'_MCH',d0
   bsr.w   get_cookie
   bne.b   .done
   swap   d0
   tst.w   d0
   beq.b   .done            ; ST.
   subq.w   #1,d0
   beq.b   .ste            ; STE/MegaSTE.
   subq.w   #1,d0
   beq.b   .tt
   subq.w   #1,d0
   beq.b   .falcon
   bra.b   .done

.ste:
   bset.b   #1,machine_type
   bra.b   .done
.tt:
   bset.b   #1,machine_type
   bset.b   #2,machine_type
   bra.b   .done
.falcon:
   bset.b   #2,machine_type
.done:

   move.l   (sp)+,d0
   rts


   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ; Set LMC1992 parameter.
   ; d0.w: parameter and data.
   ; Parameters:
   ; $4c0 Volume ($00-$28, $28 is maximum volume $00 is -80dB).
   ; $540 Left channel volume ($00-$14, $14 is maximum volume $00 is -40dB).
   ; $500 Right channel volume (see above).
   ; $480 Treble ($00=-12dB, $06=0dB, $0c=+12dB)
   ; $440 Bass (see above).
   ; $400 Mixer ($01=DMA+YM, $02=DMA only).
   ; Data = ORed with parameter into low bits.
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
set_lmc:
   btst.b   #1,machine_type(pc)      ; Test if LMC1992 present.
   beq.b   .exit

   move.w   sr,-(sp)
   move.w   #$2700,sr

   move.w   #$7fff,lmc_mask.w
   move.w   d0,lmc_data.w

.loop:   cmp.w   #$7fff,lmc_mask.w      ; Wait for start.
   beq.b   .loop

   move.w   (sp)+,sr

.loop2:   cmp.w   #$7fff,lmc_mask.w      ; Wait for stop.
   bne.b   .loop2

.exit:
   rts


   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ; Reset LMC1992 to default settings.
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
reset_lmc:
   move.w   d0,-(sp)

   move.w   #$04c0,d0         ; Maximum volume.
   or.w   #$28,d0
   bsr.w   set_lmc

   move.w   #$0540,d0         ; Maximum left channel.
   or.w   #$14,d0
   bsr.w   set_lmc

   move.w   #$0500,d0         ; Maximum right channel.
   or.w   #$14,d0
   bsr.w   set_lmc

   move.w   #$0480,d0         ; Treble flat.
   or.w   #$06,d0
   bsr.w   set_lmc

   move.w   #$0440,d0         ; Bass flat.
   or.w   #$06,d0
   bsr.w   set_lmc

   move.w   #$0400,d0         ; DMA+YM.
   or.w   #$01,d0
   bsr.w   set_lmc

   move.w   (sp)+,d0
   rts


   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ; Set a YM hardware channel.
   ; d0.b = channel
   ; d1.w = pitch (1/16th semitone steps, 0=MIDI note 0).
   ; d2.b = volume $0-$f, or $10.
   ; d3.b = tone/noise (bit0:tone, bit1:noise, 0=enabled).
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ym_hw_set_channel:
   movem.w   d0/d2/d4-d6,-(sp)
   move.l   a0,-(sp)
   move.w   sr,-(sp)
   move.w   #$2700,sr

   and.w   #3,d0
   and.w   #$1f,d2

   lea   ym_pitch_table,a0      ; Lookup pitch.
   move.w   d1,d4
   and.w   #$7ff,d4
   add.w   d4,d4
   lea   0(a0,d4.w),a0
   move.b   (a0)+,d6
   move.b   (a0),d5

   move.b   d0,d4
   add.b   d4,d4

   move.b   d4,ym_base.w         ; Set pitch.
   move.b   d5,ym_base+2.w
   addq.b   #1,d4
   move.b   d4,ym_base.w
   move.b   d6,ym_base+2.w

   move.b   d0,d4            ; Set volume.
   addq.b   #8,d4
   move.b   d4,ym_base.w
   move.b   d2,ym_base+2.w

   move.b   #7,ym_base.w         ; Set tone/noise.
   move.b   ym_base.w,d4
   bclr.l   d0,d4
   btst.l   #0,d3
   beq.b   .skip2
   bset.l   d0,d4
.skip2:   addq.b   #3,d0
   bclr.l   d0,d4
   btst.l   #1,d3
   beq.b   .skip3
   bset.l   d0,d4
.skip3:
   move.b   d4,ym_base+2.w

   move.w   (sp)+,sr
   move.l   (sp)+,a0
   movem.w   (sp)+,d0/d2/d4-d6
   rts




   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ; Timer D ISR.
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
timer_d_isr:
   move.l   a0,-(sp)
   move.l   ym_hw_wave_ptr(pc),a0

   move.b   #8,ym_base.w            ; Set volume channel 1.
   move.b   (a0)+,ym_base+2.w

   cmp.l   ym_hw_wave_stop(pc),a0
   beq.b   .looppoint

   move.l   a0,ym_hw_wave_ptr

   move.l   (sp)+,a0
   move.b   #$ef,mfp_int_in_service.w      ; Clear interrupt.
   rte

.looppoint:
   move.l   ym_hw_wave_start(pc),ym_hw_wave_ptr

   move.l   (sp)+,a0
   move.b   #$ef,mfp_int_in_service.w      ; Clear interrupt.
   rte




   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ; Variables.
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


machine_type      ds.w   1         ; Byte, bitfield: 0=cached CPU, 1=LMC1992 present, 2=internal speaker present.

keyclick_save      ds.w   1         ; Byte, saved value of conterm.
timer_d_save      ds.l   1         ; Longword, saved interrupt vector for timer D.
speaker_save      ds.w   1         ; Byte, saved value of port A.

ym_hw_wave_start   ds.l   1         ; Points to start of timer D waveform (4 bit data stored as bytes).
ym_hw_wave_stop      ds.l   1         ; Points to end of timer D waveform (this address is never reached).
ym_hw_wave_ptr      ds.l   1         ; Points to the current play position of the timer D waveform.


   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ; ST register definitions.
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

timer_d_vector         equ   $110
conterm            equ   $484
cookiejar         equ   $5a0
ym_base            equ   $ffff8800
lmc_data         equ   $ffff8922
lmc_mask         equ   $ffff8924
mfp_int_enable         equ   $fffffa09
mfp_int_pending         equ   $fffffa0d
mfp_int_in_service      equ   $fffffa11
mfp_int_mask         equ   $fffffa15
mfp_timer_cd_control      equ   $fffffa1d
mfp_timer_d         equ   $fffffa25


Call ym_hw_start when your program starts and ym_hw_stop when it finishes. You can set the channels of the YM2149 by calling ym_hw_set_channel. Of course it needs supervisor.

You also need ym_ptbl.s included:

Code: Select all

ym_pitch_table:
        dc.w $eee,$ee0,$ed2,$ec5,$eb7,$eaa,$e9c,$e8e
        dc.w $e81,$e74,$e66,$e59,$e4c,$e3f,$e31,$e24
        dc.w $e17,$e0a,$dfd,$df0,$de4,$dd7,$dca,$dbd
        dc.w $db1,$da4,$d97,$d8b,$d7e,$d72,$d66,$d59
        dc.w $d4d,$d41,$d34,$d28,$d1c,$d10,$d04,$cf8
        dc.w $cec,$ce0,$cd4,$cc8,$cbc,$cb1,$ca5,$c99
        dc.w $c8e,$c82,$c77,$c6b,$c60,$c54,$c49,$c3e
        dc.w $c32,$c27,$c1c,$c11,$c05,$bfa,$bef,$be4
        dc.w $bd9,$bce,$bc4,$bb9,$bae,$ba3,$b98,$b8e
        dc.w $b83,$b78,$b6e,$b63,$b59,$b4e,$b44,$b39
        dc.w $b2f,$b25,$b1a,$b10,$b06,$afc,$af2,$ae8
        dc.w $ade,$ad4,$aca,$ac0,$ab6,$aac,$aa2,$a98
        dc.w $a8e,$a85,$a7b,$a71,$a68,$a5e,$a54,$a4b
        dc.w $a41,$a38,$a2f,$a25,$a1c,$a12,$a09,$a00
        dc.w $9f7,$9ed,$9e4,$9db,$9d2,$9c9,$9c0,$9b7
        dc.w $9ae,$9a5,$99c,$993,$98b,$982,$979,$970
        dc.w $967,$95f,$956,$94e,$945,$93c,$934,$92b
        dc.w $923,$91b,$912,$90a,$901,$8f9,$8f1,$8e9
        dc.w $8e0,$8d8,$8d0,$8c8,$8c0,$8b8,$8b0,$8a8
        dc.w $8a0,$898,$890,$888,$880,$878,$870,$869
        dc.w $861,$859,$851,$84a,$842,$83a,$833,$82b
        dc.w $824,$81c,$815,$80d,$806,$ffd,$fef,$fe0
        dc.w $fd1,$fc3,$fb4,$fa6,$f97,$f89,$f7b,$f6c
        dc.w $f5e,$f50,$f42,$f34,$f26,$f18,$f0a,$efc
        dc.w $eee,$ee0,$ed3,$ec5,$eb7,$eaa,$e9c,$e8f
        dc.w $e81,$e74,$e66,$e59,$e4c,$e3f,$e32,$e25
        dc.w $e17,$e0a,$dfe,$df1,$de4,$dd7,$dca,$dbd
        dc.w $db1,$da4,$d98,$d8b,$d7f,$d72,$d66,$d59
        dc.w $d4d,$d41,$d34,$d28,$d1c,$d10,$d04,$cf8
        dc.w $cec,$ce0,$cd4,$cc8,$cbd,$cb1,$ca5,$c99
        dc.w $c8e,$c82,$c77,$c6b,$c60,$c54,$c49,$c3e
        dc.w $c32,$c27,$c1c,$c11,$c06,$bfb,$bef,$be4
        dc.w $bd9,$bcf,$bc4,$bb9,$bae,$ba3,$b98,$b8e
        dc.w $b83,$b78,$b6e,$b63,$b59,$b4e,$b44,$b3a
        dc.w $b2f,$b25,$b1b,$b10,$b06,$afc,$af2,$ae8
        dc.w $ade,$ad4,$aca,$ac0,$ab6,$aac,$aa2,$a98
        dc.w $a8e,$a85,$a7b,$a71,$a68,$a5e,$a55,$a4b
        dc.w $a42,$a38,$a2f,$a25,$a1c,$a13,$a09,$a00
        dc.w $9f7,$9ee,$9e4,$9db,$9d2,$9c9,$9c0,$9b7
        dc.w $9ae,$9a5,$99c,$993,$98b,$982,$979,$970
        dc.w $968,$95f,$956,$94e,$945,$93d,$934,$92c
        dc.w $923,$91b,$912,$90a,$902,$8f9,$8f1,$8e9
        dc.w $8e0,$8d8,$8d0,$8c8,$8c0,$8b8,$8b0,$8a8
        dc.w $8a0,$898,$890,$888,$880,$878,$870,$869
        dc.w $861,$859,$851,$84a,$842,$83b,$833,$82b
        dc.w $824,$81c,$815,$80d,$806,$ffe,$fef,$fe0
        dc.w $fd2,$fc3,$fb4,$fa6,$f97,$f89,$f7b,$f6c
        dc.w $f5e,$f50,$f42,$f34,$f26,$f18,$f0a,$efc
        dc.w $eee,$ee0,$ed3,$ec5,$eb7,$eaa,$e9c,$e8f
        dc.w $e81,$e74,$e67,$e59,$e4c,$e3f,$e32,$e25
        dc.w $e18,$e0b,$dfe,$df1,$de4,$dd7,$dca,$dbe
        dc.w $db1,$da4,$d98,$d8b,$d7f,$d72,$d66,$d5a
        dc.w $d4d,$d41,$d35,$d29,$d1c,$d10,$d04,$cf8
        dc.w $cec,$ce0,$cd5,$cc9,$cbd,$cb1,$ca5,$c9a
        dc.w $c8e,$c83,$c77,$c6b,$c60,$c55,$c49,$c3e
        dc.w $c33,$c27,$c1c,$c11,$c06,$bfb,$bf0,$be5
        dc.w $bda,$bcf,$bc4,$bb9,$bae,$ba3,$b99,$b8e
        dc.w $b83,$b79,$b6e,$b64,$b59,$b4f,$b44,$b3a
        dc.w $b2f,$b25,$b1b,$b11,$b06,$afc,$af2,$ae8
        dc.w $ade,$ad4,$aca,$ac0,$ab6,$aac,$aa2,$a99
        dc.w $a8f,$a85,$a7b,$a72,$a68,$a5e,$a55,$a4b
        dc.w $a42,$a38,$a2f,$a26,$a1c,$a13,$a0a,$a00
        dc.w $9f7,$9ee,$9e5,$9dc,$9d2,$9c9,$9c0,$9b7
        dc.w $9ae,$9a5,$99d,$994,$98b,$982,$979,$971
        dc.w $968,$95f,$957,$94e,$945,$93d,$934,$92c
        dc.w $923,$91b,$912,$90a,$902,$8f9,$8f1,$8e9
        dc.w $8e1,$8d9,$8d0,$8c8,$8c0,$8b8,$8b0,$8a8
        dc.w $8a0,$898,$890,$888,$880,$879,$871,$869
        dc.w $861,$859,$852,$84a,$842,$83b,$833,$82c
        dc.w $824,$81d,$815,$80e,$806,$7ff,$7f7,$7f0
        dc.w $7e9,$7e1,$7da,$7d3,$7cc,$7c5,$7bd,$7b6
        dc.w $7af,$7a8,$7a1,$79a,$793,$78c,$785,$77e
        dc.w $777,$770,$769,$763,$75c,$755,$74e,$747
        dc.w $741,$73a,$733,$72d,$726,$720,$719,$712
        dc.w $70c,$705,$6ff,$6f8,$6f2,$6ec,$6e5,$6df
        dc.w $6d9,$6d2,$6cc,$6c6,$6bf,$6b9,$6b3,$6ad
        dc.w $6a7,$6a0,$69a,$694,$68e,$688,$682,$67c
        dc.w $676,$670,$66a,$664,$65e,$659,$653,$64d
        dc.w $647,$641,$63b,$636,$630,$62a,$625,$61f
        dc.w $619,$614,$60e,$608,$603,$5fd,$5f8,$5f2
        dc.w $5ed,$5e7,$5e2,$5dd,$5d7,$5d2,$5cc,$5c7
        dc.w $5c2,$5bc,$5b7,$5b2,$5ad,$5a7,$5a2,$59d
        dc.w $598,$593,$58d,$588,$583,$57e,$579,$574
        dc.w $56f,$56a,$565,$560,$55b,$556,$551,$54c
        dc.w $547,$543,$53e,$539,$534,$52f,$52a,$526
        dc.w $521,$51c,$517,$513,$50e,$509,$505,$500
        dc.w $4fc,$4f7,$4f2,$4ee,$4e9,$4e5,$4e0,$4dc
        dc.w $4d7,$4d3,$4ce,$4ca,$4c5,$4c1,$4bd,$4b8
        dc.w $4b4,$4b0,$4ab,$4a7,$4a3,$49e,$49a,$496
        dc.w $492,$48d,$489,$485,$481,$47d,$479,$474
        dc.w $470,$46c,$468,$464,$460,$45c,$458,$454
        dc.w $450,$44c,$448,$444,$440,$43c,$438,$434
        dc.w $431,$42d,$429,$425,$421,$41d,$41a,$416
        dc.w $412,$40e,$40b,$407,$403,$3ff,$3fc,$3f8
        dc.w $3f4,$3f1,$3ed,$3e9,$3e6,$3e2,$3df,$3db
        dc.w $3d8,$3d4,$3d0,$3cd,$3c9,$3c6,$3c2,$3bf
        dc.w $3bc,$3b8,$3b5,$3b1,$3ae,$3aa,$3a7,$3a4
        dc.w $3a0,$39d,$39a,$396,$393,$390,$38c,$389
        dc.w $386,$383,$37f,$37c,$379,$376,$373,$36f
        dc.w $36c,$369,$366,$363,$360,$35d,$359,$356
        dc.w $353,$350,$34d,$34a,$347,$344,$341,$33e
        dc.w $33b,$338,$335,$332,$32f,$32c,$329,$326
        dc.w $324,$321,$31e,$31b,$318,$315,$312,$30f
        dc.w $30d,$30a,$307,$304,$301,$2ff,$2fc,$2f9
        dc.w $2f6,$2f4,$2f1,$2ee,$2ec,$2e9,$2e6,$2e4
        dc.w $2e1,$2de,$2dc,$2d9,$2d6,$2d4,$2d1,$2ce
        dc.w $2cc,$2c9,$2c7,$2c4,$2c2,$2bf,$2bd,$2ba
        dc.w $2b7,$2b5,$2b2,$2b0,$2ae,$2ab,$2a9,$2a6
        dc.w $2a4,$2a1,$29f,$29c,$29a,$298,$295,$293
        dc.w $290,$28e,$28c,$289,$287,$285,$282,$280
        dc.w $27e,$27b,$279,$277,$275,$272,$270,$26e
        dc.w $26c,$269,$267,$265,$263,$261,$25e,$25c
        dc.w $25a,$258,$256,$253,$251,$24f,$24d,$24b
        dc.w $249,$247,$245,$243,$240,$23e,$23c,$23a
        dc.w $238,$236,$234,$232,$230,$22e,$22c,$22a
        dc.w $228,$226,$224,$222,$220,$21e,$21c,$21a
        dc.w $218,$216,$214,$213,$211,$20f,$20d,$20b
        dc.w $209,$207,$205,$203,$202,$200,$1fe,$1fc
        dc.w $1fa,$1f8,$1f7,$1f5,$1f3,$1f1,$1ef,$1ee
        dc.w $1ec,$1ea,$1e8,$1e6,$1e5,$1e3,$1e1,$1e0
        dc.w $1de,$1dc,$1da,$1d9,$1d7,$1d5,$1d4,$1d2
        dc.w $1d0,$1cf,$1cd,$1cb,$1ca,$1c8,$1c6,$1c5
        dc.w $1c3,$1c1,$1c0,$1be,$1bd,$1bb,$1b9,$1b8
        dc.w $1b6,$1b5,$1b3,$1b1,$1b0,$1ae,$1ad,$1ab
        dc.w $1aa,$1a8,$1a7,$1a5,$1a4,$1a2,$1a1,$19f
        dc.w $19e,$19c,$19b,$199,$198,$196,$195,$193
        dc.w $192,$190,$18f,$18d,$18c,$18b,$189,$188
        dc.w $186,$185,$184,$182,$181,$17f,$17e,$17d
        dc.w $17b,$17a,$178,$177,$176,$174,$173,$172
        dc.w $170,$16f,$16e,$16c,$16b,$16a,$169,$167
        dc.w $166,$165,$163,$162,$161,$160,$15e,$15d
        dc.w $15c,$15a,$159,$158,$157,$156,$154,$153
        dc.w $152,$151,$14f,$14e,$14d,$14c,$14b,$149
        dc.w $148,$147,$146,$145,$144,$142,$141,$140
        dc.w $13f,$13e,$13d,$13b,$13a,$139,$138,$137
        dc.w $136,$135,$134,$132,$131,$130,$12f,$12e
        dc.w $12d,$12c,$12b,$12a,$129,$128,$127,$125
        dc.w $124,$123,$122,$121,$120,$11f,$11e,$11d
        dc.w $11c,$11b,$11a,$119,$118,$117,$116,$115
        dc.w $114,$113,$112,$111,$110,$10f,$10e,$10d
        dc.w $10c,$10b,$10a,$109,$108,$107,$106,$105
        dc.w $105,$104,$103,$102,$101,$100,$0ff,$0fe
        dc.w $0fd,$0fc,$0fb,$0fa,$0f9,$0f9,$0f8,$0f7
        dc.w $0f6,$0f5,$0f4,$0f3,$0f2,$0f1,$0f1,$0f0
        dc.w $0ef,$0ee,$0ed,$0ec,$0eb,$0eb,$0ea,$0e9
        dc.w $0e8,$0e7,$0e6,$0e6,$0e5,$0e4,$0e3,$0e2
        dc.w $0e1,$0e1,$0e0,$0df,$0de,$0dd,$0dd,$0dc
        dc.w $0db,$0da,$0d9,$0d9,$0d8,$0d7,$0d6,$0d6
        dc.w $0d5,$0d4,$0d3,$0d3,$0d2,$0d1,$0d0,$0d0
        dc.w $0cf,$0ce,$0cd,$0cd,$0cc,$0cb,$0ca,$0ca
        dc.w $0c9,$0c8,$0c7,$0c7,$0c6,$0c5,$0c5,$0c4
        dc.w $0c3,$0c2,$0c2,$0c1,$0c0,$0c0,$0bf,$0be
        dc.w $0be,$0bd,$0bc,$0bc,$0bb,$0ba,$0ba,$0b9
        dc.w $0b8,$0b8,$0b7,$0b6,$0b6,$0b5,$0b4,$0b4
        dc.w $0b3,$0b2,$0b2,$0b1,$0b0,$0b0,$0af,$0af
        dc.w $0ae,$0ad,$0ad,$0ac,$0ab,$0ab,$0aa,$0aa
        dc.w $0a9,$0a8,$0a8,$0a7,$0a6,$0a6,$0a5,$0a5
        dc.w $0a4,$0a4,$0a3,$0a2,$0a2,$0a1,$0a1,$0a0
        dc.w $09f,$09f,$09e,$09e,$09d,$09d,$09c,$09b
        dc.w $09b,$09a,$09a,$099,$099,$098,$098,$097
        dc.w $096,$096,$095,$095,$094,$094,$093,$093
        dc.w $092,$092,$091,$091,$090,$090,$08f,$08f
        dc.w $08e,$08e,$08d,$08d,$08c,$08c,$08b,$08b
        dc.w $08a,$08a,$089,$089,$088,$088,$087,$087
        dc.w $086,$086,$085,$085,$084,$084,$083,$083
        dc.w $082,$082,$081,$081,$080,$080,$07f,$07f
        dc.w $07f,$07e,$07e,$07d,$07d,$07c,$07c,$07b
        dc.w $07b,$07b,$07a,$07a,$079,$079,$078,$078
        dc.w $077,$077,$077,$076,$076,$075,$075,$074
        dc.w $074,$074,$073,$073,$072,$072,$072,$071
        dc.w $071,$070,$070,$070,$06f,$06f,$06e,$06e
        dc.w $06e,$06d,$06d,$06c,$06c,$06c,$06b,$06b
        dc.w $06a,$06a,$06a,$069,$069,$069,$068,$068
        dc.w $067,$067,$067,$066,$066,$066,$065,$065
        dc.w $064,$064,$064,$063,$063,$063,$062,$062
        dc.w $062,$061,$061,$061,$060,$060,$05f,$05f
        dc.w $05f,$05e,$05e,$05e,$05d,$05d,$05d,$05c
        dc.w $05c,$05c,$05b,$05b,$05b,$05a,$05a,$05a
        dc.w $059,$059,$059,$059,$058,$058,$058,$057
        dc.w $057,$057,$056,$056,$056,$055,$055,$055
        dc.w $054,$054,$054,$054,$053,$053,$053,$052
        dc.w $052,$052,$051,$051,$051,$051,$050,$050
        dc.w $050,$04f,$04f,$04f,$04f,$04e,$04e,$04e
        dc.w $04d,$04d,$04d,$04d,$04c,$04c,$04c,$04c
        dc.w $04b,$04b,$04b,$04a,$04a,$04a,$04a,$049
        dc.w $049,$049,$049,$048,$048,$048,$048,$047
        dc.w $047,$047,$047,$046,$046,$046,$046,$045
        dc.w $045,$045,$045,$044,$044,$044,$044,$043
        dc.w $043,$043,$043,$042,$042,$042,$042,$041
        dc.w $041,$041,$041,$040,$040,$040,$040,$040
        dc.w $03f,$03f,$03f,$03f,$03e,$03e,$03e,$03e
        dc.w $03d,$03d,$03d,$03d,$03d,$03c,$03c,$03c
        dc.w $03c,$03c,$03b,$03b,$03b,$03b,$03a,$03a
        dc.w $03a,$03a,$03a,$039,$039,$039,$039,$039
        dc.w $038,$038,$038,$038,$038,$037,$037,$037
        dc.w $037,$037,$036,$036,$036,$036,$036,$035
        dc.w $035,$035,$035,$035,$034,$034,$034,$034
        dc.w $034,$034,$033,$033,$033,$033,$033,$032
        dc.w $032,$032,$032,$032,$032,$031,$031,$031
        dc.w $031,$031,$030,$030,$030,$030,$030,$030
        dc.w $02f,$02f,$02f,$02f,$02f,$02f,$02e,$02e
        dc.w $02e,$02e,$02e,$02e,$02d,$02d,$02d,$02d
        dc.w $02d,$02d,$02c,$02c,$02c,$02c,$02c,$02c
        dc.w $02b,$02b,$02b,$02b,$02b,$02b,$02b,$02a
        dc.w $02a,$02a,$02a,$02a,$02a,$029,$029,$029
        dc.w $029,$029,$029,$029,$028,$028,$028,$028
        dc.w $028,$028,$028,$027,$027,$027,$027,$027
        dc.w $027,$027,$026,$026,$026,$026,$026,$026
        dc.w $026,$025,$025,$025,$025,$025,$025,$025
        dc.w $025,$024,$024,$024,$024,$024,$024,$024
        dc.w $024,$023,$023,$023,$023,$023,$023,$023
        dc.w $023,$022,$022,$022,$022,$022,$022,$022
        dc.w $022,$021,$021,$021,$021,$021,$021,$021
        dc.w $021,$020,$020,$020,$020,$020,$020,$020
        dc.w $020,$020,$01f,$01f,$01f,$01f,$01f,$01f
        dc.w $01f,$01f,$01f,$01e,$01e,$01e,$01e,$01e
        dc.w $01e,$01e,$01e,$01e,$01d,$01d,$01d,$01d
        dc.w $01d,$01d,$01d,$01d,$01d,$01c,$01c,$01c
        dc.w $01c,$01c,$01c,$01c,$01c,$01c,$01c,$01b
        dc.w $01b,$01b,$01b,$01b,$01b,$01b,$01b,$01b
        dc.w $01b,$01b,$01a,$01a,$01a,$01a,$01a,$01a
        dc.w $01a,$01a,$01a,$01a,$019,$019,$019,$019
        dc.w $019,$019,$019,$019,$019,$019,$019,$018
        dc.w $018,$018,$018,$018,$018,$018,$018,$018
        dc.w $018,$018,$018,$017,$017,$017,$017,$017
        dc.w $017,$017,$017,$017,$017,$017,$017,$016
        dc.w $016,$016,$016,$016,$016,$016,$016,$016
        dc.w $016,$016,$016,$015,$015,$015,$015,$015
        dc.w $015,$015,$015,$015,$015,$015,$015,$015
        dc.w $015,$014,$014,$014,$014,$014,$014,$014
        dc.w $014,$014,$014,$014,$014,$014,$014,$013
        dc.w $013,$013,$013,$013,$013,$013,$013,$013
        dc.w $013,$013,$013,$013,$013,$012,$012,$012
        dc.w $012,$012,$012,$012,$012,$012,$012,$012
        dc.w $012,$012,$012,$012,$012,$011,$011,$011
        dc.w $011,$011,$011,$011,$011,$011,$011,$011
        dc.w $011,$011,$011,$011,$011,$010,$010,$010
        dc.w $010,$010,$010,$010,$010,$010,$010,$010
        dc.w $010,$010,$010,$010,$010,$010,$00f,$00f
        dc.w $00f,$00f,$00f,$00f,$00f,$00f,$00f,$00f
        dc.w $00f,$00f,$00f,$00f,$00f,$00f,$00f,$00f
        dc.w $00f,$00e,$00e,$00e,$00e,$00e,$00e,$00e
        dc.w $00e,$00e,$00e,$00e,$00e,$00e,$00e,$00e
        dc.w $00e,$00e,$00e,$00e,$00d,$00d,$00d,$00d
        dc.w $00d,$00d,$00d,$00d,$00d,$00d,$00d,$00d
        dc.w $00d,$00d,$00d,$00d,$00d,$00d,$00d,$00d
        dc.w $00d,$00d,$00c,$00c,$00c,$00c,$00c,$00c
        dc.w $00c,$00c,$00c,$00c,$00c,$00c,$00c,$00c
        dc.w $00c,$00c,$00c,$00c,$00c,$00c,$00c,$00c
        dc.w $00c,$00b,$00b,$00b,$00b,$00b,$00b,$00b
        dc.w $00b,$00b,$00b,$00b,$00b,$00b,$00b,$00b
        dc.w $00b,$00b,$00b,$00b,$00b,$00b,$00b,$00b
        dc.w $00b,$00b,$00a,$00a,$00a,$00a,$00a,$00a
        dc.w $00a,$00a,$00a,$00a,$00a,$00a,$00a,$00a
        dc.w $00a,$00a,$00a,$00a,$00a,$00a,$00a,$00a
        dc.w $00a,$00a,$00a,$00a,$00a,$00a,$009,$009

mfp_pitch_table:
        dc.w $7bc,$7bb,$7bb,$7ba,$7b9,$7b9,$7b8,$7b7
        dc.w $7b7,$7b6,$7b5,$7b5,$7b4,$7b3,$7b3,$7b2
        dc.w $7b1,$7b1,$7b0,$7af,$7af,$7ae,$7ae,$7ad
        dc.w $7ac,$7ac,$7ab,$7aa,$7aa,$7a9,$7a9,$7a8
        dc.w $7a7,$7a7,$7a6,$7a6,$7a5,$7a4,$7a4,$7a3
        dc.w $7a3,$7a2,$7a1,$7a1,$7a0,$7a0,$79f,$79f
        dc.w $79e,$79d,$79d,$79c,$79c,$79b,$79b,$79a
        dc.w $799,$799,$798,$798,$797,$797,$796,$796
        dc.w $795,$795,$794,$794,$793,$792,$792,$791
        dc.w $791,$790,$790,$78f,$78f,$78e,$78e,$78d
        dc.w $78d,$78c,$78c,$78b,$78b,$78a,$78a,$789
        dc.w $789,$788,$788,$787,$787,$786,$786,$785
        dc.w $785,$784,$784,$783,$783,$782,$782,$782
        dc.w $781,$781,$780,$6ff,$6fe,$6fe,$6fd,$6fc
        dc.w $6fb,$6fa,$6f9,$6f8,$6f7,$6f6,$6f5,$6f5
        dc.w $6f4,$6f3,$6f2,$6f1,$6f0,$6ef,$6ee,$6ee
        dc.w $6ed,$6ec,$6eb,$6ea,$6e9,$6e8,$6e8,$6e7
        dc.w $6e6,$6e5,$6e4,$6e3,$6e3,$6e2,$6e1,$6e0
        dc.w $6df,$6df,$6de,$6dd,$6dc,$6db,$6db,$6da
        dc.w $6d9,$6d8,$6d7,$6d7,$6d6,$6d5,$6d4,$6d4
        dc.w $6d3,$6d2,$6d1,$6d1,$6d0,$6cf,$6ce,$6ce
        dc.w $6cd,$6cc,$6cb,$6cb,$6ca,$6c9,$6c8,$6c8
        dc.w $6c7,$6c6,$6c6,$6c5,$6c4,$6c3,$6c3,$6c2
        dc.w $6c1,$6c1,$6c0,$6bf,$6bf,$6be,$6bd,$6bd
        dc.w $6bc,$6bb,$6bb,$6ba,$6b9,$6b9,$6b8,$6b7
        dc.w $6b7,$6b6,$6b5,$6b5,$6b4,$6b3,$6b3,$6b2
        dc.w $6b1,$6b1,$6b0,$6af,$6af,$6ae,$6ae,$6ad
        dc.w $6ac,$6ac,$6ab,$6aa,$6aa,$6a9,$6a9,$6a8
        dc.w $6a7,$6a7,$6a6,$6a6,$6a5,$6a4,$6a4,$5ff
        dc.w $5fe,$5fd,$5fc,$5fb,$5fa,$5fa,$5f9,$5f8
        dc.w $5f7,$5f6,$5f5,$5f4,$5f3,$5f2,$5f2,$5f1
        dc.w $5f0,$5ef,$5ee,$5ed,$5ec,$5ec,$5eb,$5ea
        dc.w $5e9,$5e8,$5e7,$5e6,$5e6,$5e5,$5e4,$5e3
        dc.w $5e2,$5e2,$5e1,$5e0,$5df,$5de,$5de,$5dd
        dc.w $5dc,$5db,$5da,$5da,$5d9,$5d8,$5d7,$5d6
        dc.w $5d6,$5d5,$5d4,$5d3,$5d3,$5d2,$5d1,$5d0
        dc.w $5d0,$5cf,$5ce,$5cd,$5cd,$5cc,$5cb,$5ca
        dc.w $5ca,$5c9,$5c8,$4ff,$4fe,$4fe,$4fd,$4fc
        dc.w $4fb,$4fa,$4f9,$4f8,$4f7,$4f6,$4f5,$4f5
        dc.w $4f4,$4f3,$4f2,$4f1,$4f0,$4ef,$4ee,$4ee
        dc.w $4ed,$4ec,$4eb,$4ea,$4e9,$4e8,$4e8,$4e7
        dc.w $4e6,$4e5,$4e4,$4e3,$4e3,$4e2,$4e1,$4e0
        dc.w $4df,$4df,$4de,$4dd,$4dc,$4db,$4db,$4da
        dc.w $4d9,$4d8,$4d7,$4d7,$4d6,$4d5,$4d4,$4d4
        dc.w $4d3,$4d2,$4d1,$4d1,$4d0,$4cf,$4ce,$4ce
        dc.w $4cd,$4cc,$4cb,$4cb,$4ca,$4c9,$4c8,$4c8
        dc.w $4c7,$4c6,$4c6,$4c5,$4c4,$4c3,$4c3,$4c2
        dc.w $4c1,$4c1,$4c0,$4bf,$4bf,$4be,$4bd,$4bd
        dc.w $4bc,$4bb,$4bb,$4ba,$4b9,$4b9,$4b8,$4b7
        dc.w $4b7,$4b6,$4b5,$4b5,$4b4,$4b3,$4b3,$4b2
        dc.w $4b1,$4b1,$4b0,$4af,$4af,$4ae,$4ae,$4ad
        dc.w $4ac,$4ac,$4ab,$4aa,$4aa,$4a9,$4a9,$4a8
        dc.w $4a7,$4a7,$4a6,$4a6,$4a5,$4a4,$4a4,$4a3
        dc.w $4a3,$4a2,$4a1,$4a1,$4a0,$4a0,$49f,$49f
        dc.w $49e,$49d,$49d,$49c,$49c,$49b,$49b,$49a
        dc.w $499,$499,$498,$498,$497,$497,$496,$496
        dc.w $495,$495,$494,$494,$493,$492,$492,$491
        dc.w $491,$490,$490,$48f,$48f,$48e,$48e,$48d
        dc.w $48d,$48c,$48c,$48b,$48b,$48a,$48a,$489
        dc.w $489,$488,$488,$487,$487,$486,$486,$485
        dc.w $485,$484,$484,$483,$483,$482,$482,$482
        dc.w $481,$481,$480,$480,$47f,$47f,$47e,$47e
        dc.w $47d,$47d,$47c,$47c,$47c,$47b,$47b,$47a
        dc.w $47a,$479,$479,$479,$478,$478,$477,$477
        dc.w $476,$476,$476,$475,$475,$474,$474,$473
        dc.w $473,$473,$472,$472,$471,$471,$471,$470
        dc.w $470,$46f,$46f,$46f,$46e,$46e,$46d,$46d
        dc.w $46d,$46c,$46c,$46b,$46b,$46b,$46a,$46a
        dc.w $469,$469,$469,$468,$468,$468,$467,$467
        dc.w $466,$466,$466,$465,$465,$465,$464,$464
        dc.w $464,$463,$463,$462,$462,$462,$461,$461
        dc.w $461,$460,$460,$460,$45f,$45f,$45f,$45e
        dc.w $45e,$45e,$45d,$45d,$45d,$45c,$45c,$45c
        dc.w $45b,$45b,$45b,$45a,$45a,$45a,$459,$459
        dc.w $459,$458,$458,$458,$457,$457,$457,$456
        dc.w $456,$456,$456,$455,$455,$455,$454,$454
        dc.w $454,$453,$453,$453,$452,$452,$452,$3ff
        dc.w $3fe,$3fd,$3fc,$3fb,$3fa,$3fa,$3f9,$3f8
        dc.w $3f7,$3f6,$3f5,$3f4,$3f3,$3f2,$3f2,$3f1
        dc.w $3f0,$3ef,$3ee,$3ed,$3ec,$3ec,$3eb,$3ea
        dc.w $3e9,$3e8,$3e7,$3e6,$3e6,$3e5,$3e4,$3e3
        dc.w $3e2,$3e2,$3e1,$3e0,$3df,$3de,$3de,$3dd
        dc.w $3dc,$3db,$3da,$3da,$3d9,$3d8,$3d7,$3d6
        dc.w $3d6,$3d5,$3d4,$3d3,$3d3,$3d2,$3d1,$3d0
        dc.w $3d0,$3cf,$3ce,$3cd,$3cd,$3cc,$3cb,$3ca
        dc.w $3ca,$3c9,$3c8,$3c7,$3c7,$3c6,$3c5,$3c5
        dc.w $3c4,$3c3,$3c3,$3c2,$3c1,$3c0,$3c0,$3bf
        dc.w $3be,$3be,$3bd,$3bc,$3bc,$3bb,$3ba,$3ba
        dc.w $3b9,$3b8,$3b8,$3b7,$3b6,$3b6,$3b5,$3b4
        dc.w $3b4,$3b3,$3b2,$3b2,$3b1,$3b0,$3b0,$3af
        dc.w $3af,$3ae,$3ad,$3ad,$3ac,$3ab,$3ab,$3aa
        dc.w $3aa,$3a9,$3a8,$3a8,$3a7,$3a7,$3a6,$3a5
        dc.w $3a5,$3a4,$3a4,$3a3,$3a2,$3a2,$3a1,$3a1
        dc.w $3a0,$2ff,$2fe,$2fd,$2fc,$2fc,$2fb,$2fa
        dc.w $2f9,$2f8,$2f7,$2f6,$2f5,$2f4,$2f3,$2f3
        dc.w $2f2,$2f1,$2f0,$2ef,$2ee,$2ed,$2ed,$2ec
        dc.w $2eb,$2ea,$2e9,$2e8,$2e7,$2e7,$2e6,$2e5
        dc.w $2e4,$2e3,$2e3,$2e2,$2e1,$2e0,$2df,$2de
        dc.w $2de,$2dd,$2dc,$2db,$2da,$2da,$2d9,$2d8
        dc.w $2d7,$2d7,$2d6,$2d5,$2d4,$2d3,$2d3,$2d2
        dc.w $2d1,$2d0,$2d0,$2cf,$2ce,$2cd,$2cd,$2cc
        dc.w $2cb,$2cb,$2ca,$2c9,$2c8,$2c8,$2c7,$2c6
        dc.w $2c5,$2c5,$2c4,$2c3,$2c3,$2c2,$2c1,$2c1
        dc.w $2c0,$2bf,$2be,$2be,$2bd,$2bc,$2bc,$2bb
        dc.w $2ba,$2ba,$2b9,$2b8,$2b8,$2b7,$2b6,$2b6
        dc.w $2b5,$2b4,$2b4,$2b3,$2b2,$2b2,$2b1,$2b1
        dc.w $2b0,$2af,$2af,$2ae,$2ad,$2ad,$2ac,$2ac
        dc.w $2ab,$2aa,$2aa,$2a9,$2a8,$2a8,$2a7,$2a7
        dc.w $2a6,$2a5,$2a5,$2a4,$2a4,$2a3,$2a2,$2a2
        dc.w $2a1,$2a1,$2a0,$2a0,$29f,$29e,$29e,$29d
        dc.w $29d,$29c,$29c,$29b,$29a,$29a,$299,$299
        dc.w $298,$298,$297,$297,$296,$296,$295,$294
        dc.w $294,$293,$293,$292,$292,$291,$291,$290
        dc.w $290,$28f,$28f,$28e,$28e,$28d,$28d,$28c
        dc.w $28c,$28b,$28b,$28a,$28a,$289,$289,$288
        dc.w $288,$287,$287,$286,$286,$285,$285,$284
        dc.w $284,$283,$283,$282,$282,$281,$281,$281
        dc.w $280,$280,$27f,$27f,$27e,$27e,$27d,$27d
        dc.w $27c,$27c,$27c,$27b,$27b,$27a,$27a,$279
        dc.w $279,$278,$278,$278,$277,$277,$276,$276
        dc.w $275,$275,$275,$274,$274,$273,$273,$272
        dc.w $272,$272,$271,$271,$270,$270,$270,$26f
        dc.w $26f,$26e,$26e,$26e,$26d,$26d,$26c,$26c
        dc.w $26c,$26b,$26b,$26b,$26a,$26a,$269,$269
        dc.w $269,$268,$268,$267,$267,$267,$266,$1ff
        dc.w $1fe,$1fd,$1fc,$1fb,$1fa,$1fa,$1f9,$1f8
        dc.w $1f7,$1f6,$1f5,$1f4,$1f3,$1f2,$1f2,$1f1
        dc.w $1f0,$1ef,$1ee,$1ed,$1ec,$1ec,$1eb,$1ea
        dc.w $1e9,$1e8,$1e7,$1e6,$1e6,$1e5,$1e4,$1e3
        dc.w $1e2,$1e2,$1e1,$1e0,$1df,$1de,$1de,$1dd
        dc.w $1dc,$1db,$1da,$1da,$1d9,$1d8,$1d7,$1d6
        dc.w $1d6,$1d5,$1d4,$1d3,$1d3,$1d2,$1d1,$1d0
        dc.w $1d0,$1cf,$1ce,$1cd,$1cd,$1cc,$1cb,$1ca
        dc.w $1ca,$1c9,$1c8,$1c7,$1c7,$1c6,$1c5,$1c5
        dc.w $1c4,$1c3,$1c3,$1c2,$1c1,$1c0,$1c0,$1bf
        dc.w $1be,$1be,$1bd,$1bc,$1bc,$1bb,$1ba,$1ba
        dc.w $1b9,$1b8,$1b8,$1b7,$1b6,$1b6,$1b5,$1b4
        dc.w $1b4,$1b3,$1b2,$1b2,$1b1,$1b0,$1b0,$1af
        dc.w $1af,$1ae,$1ad,$1ad,$1ac,$1ab,$1ab,$1aa
        dc.w $1aa,$1a9,$1a8,$1a8,$1a7,$1a7,$1a6,$1a5
        dc.w $1a5,$1a4,$1a4,$1a3,$1a2,$1a2,$1a1,$1a1
        dc.w $1a0,$19f,$19f,$19e,$19e,$19d,$19d,$19c
        dc.w $19c,$19b,$19a,$19a,$199,$199,$198,$198
        dc.w $197,$197,$196,$195,$195,$194,$194,$193
        dc.w $193,$192,$192,$191,$191,$190,$190,$18f
        dc.w $18f,$18e,$18e,$18d,$18d,$18c,$18c,$18b
        dc.w $18b,$18a,$18a,$189,$189,$188,$188,$187
        dc.w $187,$186,$186,$185,$185,$184,$184,$183
        dc.w $183,$182,$182,$181,$181,$180,$180,$17f
        dc.w $17f,$17f,$17e,$17e,$17d,$17d,$17c,$17c
        dc.w $17b,$17b,$17b,$17a,$17a,$179,$179,$178
        dc.w $178,$177,$177,$177,$176,$176,$175,$175
        dc.w $174,$174,$174,$173,$173,$172,$172,$172
        dc.w $171,$171,$170,$170,$170,$16f,$16f,$16e
        dc.w $16e,$16e,$16d,$16d,$16c,$16c,$16c,$16b
        dc.w $16b,$16a,$16a,$16a,$169,$169,$169,$168
        dc.w $168,$167,$167,$167,$166,$166,$166,$165
        dc.w $165,$164,$164,$164,$163,$163,$163,$162
        dc.w $162,$162,$161,$161,$161,$160,$160,$160
        dc.w $15f,$15f,$15e,$15e,$15e,$15d,$15d,$15d
        dc.w $15c,$15c,$15c,$15b,$15b,$15b,$15a,$15a
        dc.w $15a,$15a,$159,$159,$159,$158,$158,$158
        dc.w $157,$157,$157,$156,$156,$156,$155,$155
        dc.w $155,$154,$154,$154,$154,$153,$153,$153
        dc.w $152,$152,$152,$151,$151,$151,$151,$150
        dc.w $150,$150,$14f,$14f,$14f,$14f,$14e,$14e
        dc.w $14e,$14d,$14d,$14d,$14d,$14c,$14c,$14c
        dc.w $14c,$14b,$14b,$14b,$14a,$14a,$14a,$14a
        dc.w $149,$149,$149,$149,$148,$148,$148,$148
        dc.w $147,$147,$147,$147,$146,$146,$146,$146
        dc.w $145,$145,$145,$145,$144,$144,$144,$144
        dc.w $143,$143,$143,$143,$142,$142,$142,$142
        dc.w $141,$141,$141,$141,$140,$140,$140,$140
        dc.w $140,$13f,$13f,$13f,$13f,$13e,$13e,$13e
        dc.w $13e,$13d,$13d,$13d,$13d,$13d,$13c,$13c
        dc.w $13c,$13c,$13c,$13b,$13b,$13b,$13b,$13a
        dc.w $13a,$13a,$13a,$13a,$139,$139,$139,$139
        dc.w $139,$138,$138,$138,$138,$138,$137,$137
        dc.w $137,$137,$137,$136,$136,$136,$136,$136
        dc.w $135,$135,$135,$135,$135,$134,$134,$134
        dc.w $134,$134,$134,$133,$166,$166,$166,$165
        dc.w $165,$164,$164,$164,$163,$163,$163,$162
        dc.w $162,$162,$161,$161,$161,$160,$160,$160
        dc.w $15f,$15f,$15e,$15e,$15e,$15d,$15d,$15d
        dc.w $15c,$15c,$15c,$15b,$15b,$15b,$15a,$15a
        dc.w $15a,$15a,$159,$159,$159,$158,$158,$158
        dc.w $157,$157,$157,$156,$156,$156,$155,$155
        dc.w $155,$154,$154,$154,$154,$153,$153,$153
        dc.w $152,$152,$152,$151,$151,$151,$151,$150
        dc.w $150,$150,$14f,$14f,$14f,$14f,$14e,$14e
        dc.w $14e,$14d,$14d,$14d,$14d,$14c,$14c,$14c
        dc.w $14c,$14b,$14b,$14b,$14a,$14a,$14a,$14a
        dc.w $149,$149,$149,$149,$148,$148,$148,$148
        dc.w $147,$147,$147,$147,$146,$146,$146,$146
        dc.w $145,$145,$145,$145,$144,$144,$144,$144
        dc.w $143,$143,$143,$143,$142,$142,$142,$142
        dc.w $141,$141,$141,$141,$140,$140,$140,$140
        dc.w $140,$13f,$13f,$13f,$13f,$13e,$13e,$13e
        dc.w $13e,$13d,$13d,$13d,$13d,$13d,$13c,$13c
        dc.w $13c,$13c,$13c,$13b,$13b,$13b,$13b,$13a
        dc.w $13a,$13a,$13a,$13a,$139,$139,$139,$139
        dc.w $139,$138,$138,$138,$138,$138,$137,$137
        dc.w $137,$137,$137,$136,$136,$136,$136,$136
        dc.w $135,$135,$135,$135,$135,$134,$134,$134
        dc.w $134,$134,$134,$133,$166,$166,$166,$165
        dc.w $165,$164,$164,$164,$163,$163,$163,$162
        dc.w $162,$162,$161,$161,$161,$160,$160,$160
        dc.w $15f,$15f,$15e,$15e,$15e,$15d,$15d,$15d
        dc.w $15c,$15c,$15c,$15b,$15b,$15b,$15a,$15a
        dc.w $15a,$15a,$159,$159,$159,$158,$158,$158
        dc.w $157,$157,$157,$156,$156,$156,$155,$155
        dc.w $155,$154,$154,$154,$154,$153,$153,$153
        dc.w $152,$152,$152,$151,$151,$151,$151,$150
        dc.w $150,$150,$14f,$14f,$14f,$14f,$14e,$14e
        dc.w $14e,$14d,$14d,$14d,$14d,$14c,$14c,$14c
        dc.w $14c,$14b,$14b,$14b,$14a,$14a,$14a,$14a
        dc.w $149,$149,$149,$149,$148,$148,$148,$148
        dc.w $147,$147,$147,$147,$146,$146,$146,$146
        dc.w $145,$145,$145,$145,$144,$144,$144,$144
        dc.w $143,$143,$143,$143,$142,$142,$142,$142
        dc.w $141,$141,$141,$141,$140,$140,$140,$140
        dc.w $140,$13f,$13f,$13f,$13f,$13e,$13e,$13e
        dc.w $13e,$13d,$13d,$13d,$13d,$13d,$13c,$13c
        dc.w $13c,$13c,$13c,$13b,$13b,$13b,$13b,$13a
        dc.w $13a,$13a,$13a,$13a,$139,$139,$139,$139
        dc.w $139,$138,$138,$138,$138,$138,$137,$137
        dc.w $137,$137,$137,$136,$136,$136,$136,$136
        dc.w $135,$135,$135,$135,$135,$134,$134,$134
        dc.w $134,$134,$134,$133,$166,$166,$166,$165
        dc.w $165,$164,$164,$164,$163,$163,$163,$162
        dc.w $162,$162,$161,$161,$161,$160,$160,$160
        dc.w $15f,$15f,$15e,$15e,$15e,$15d,$15d,$15d
        dc.w $15c,$15c,$15c,$15b,$15b,$15b,$15a,$15a
        dc.w $15a,$15a,$159,$159,$159,$158,$158,$158
        dc.w $157,$157,$157,$156,$156,$156,$155,$155
        dc.w $155,$154,$154,$154,$154,$153,$153,$153
        dc.w $152,$152,$152,$151,$151,$151,$151,$150
        dc.w $150,$150,$14f,$14f,$14f,$14f,$14e,$14e
        dc.w $14e,$14d,$14d,$14d,$14d,$14c,$14c,$14c
        dc.w $14c,$14b,$14b,$14b,$14a,$14a,$14a,$14a
        dc.w $149,$149,$149,$149,$148,$148,$148,$148
        dc.w $147,$147,$147,$147,$146,$146,$146,$146
        dc.w $145,$145,$145,$145,$144,$144,$144,$144
        dc.w $143,$143,$143,$143,$142,$142,$142,$142
        dc.w $141,$141,$141,$141,$140,$140,$140,$140
        dc.w $140,$13f,$13f,$13f,$13f,$13e,$13e,$13e
        dc.w $13e,$13d,$13d,$13d,$13d,$13d,$13c,$13c
        dc.w $13c,$13c,$13c,$13b,$13b,$13b,$13b,$13a
        dc.w $13a,$13a,$13a,$13a,$139,$139,$139,$139
        dc.w $139,$138,$138,$138,$138,$138,$137,$137
        dc.w $137,$137,$137,$136,$136,$136,$136,$136
        dc.w $135,$135,$135,$135,$135,$134,$134,$134
        dc.w $134,$134,$134,$133,$166,$166,$166,$165
        dc.w $165,$164,$164,$164,$163,$163,$163,$162
        dc.w $162,$162,$161,$161,$161,$160,$160,$160
        dc.w $15f,$15f,$15e,$15e,$15e,$15d,$15d,$15d


Here is a test program:

Code: Select all

   ; Test YM effects.

   SECTION TEXT
   COMMENT HEAD=1



main:

   ; Go into supervisor mode.
   clr.l   -(sp)
   move.w   #$20,-(sp)
   trap   #1
   addq.l   #6,sp

   bsr.w   ym_hw_start

   moveq.l   #$f,d2      ; Maximum volume.
   moveq.l   #$fe,d3      ; Tone enabled, noise disabled.
.loop:   move.w   #2032,d1   ; Start from pitch 2032.
.loop2:   moveq.l   #0,d0      ; Channel 1.
   bsr.w   ym_hw_set_channel
   moveq.l   #1,d0      ; Wait 2 ticks (200Hz).
   bsr.w   waitticks
   dbf   d1,.loop2
   bra.b   .loop


waitticks:
   move.w   d0,-(sp)
   move.l   d1,-(sp)

.loop:   move.l   $4ba.w,d1
.loop2:   cmp.l   $4ba.w,d1
   beq.b   .loop2
   dbf   d0,.loop

   move.l   (sp)+,d1
   move.w   (sp)+,d0
   rts


   include   ym_hw.s
   include ym_ptbl.s

User avatar
WireLord55
Atari freak
Atari freak
Posts: 52
Joined: Sun Apr 22, 2018 9:48 am

Re: Devpac 3 - How to create sound?

Postby WireLord55 » Mon Apr 23, 2018 10:35 pm

Thanks Foxie,
"Do...or do not. There is no try" - Yoda, Episode V


Social Media

     

Return to “680x0”

Who is online

Users browsing this forum: No registered users and 3 guests