diff --git a/Source/SPC/TASM.EXE b/Source/SPC/TASM.EXE deleted file mode 100755 index f7c733c..0000000 Binary files a/Source/SPC/TASM.EXE and /dev/null differ diff --git a/Source/SPC/spx_core.LST b/Source/SPC/spx_core.LST deleted file mode 100644 index d99926c..0000000 --- a/Source/SPC/spx_core.LST +++ /dev/null @@ -1,5611 +0,0 @@ -0001 0000 ;------------------------------------------------------------------------------------------------------------------------ -0002 0000 ; Copyright (c) 2007, Mukunda Johnson -0003 0000 ; -0004 0000 ; All rights reserved. -0005 0000 ; -0006 0000 ; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -0007 0000 ; -0008 0000 ; * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -0009 0000 ; * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -0010 0000 ; * Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -0011 0000 ; -0012 0000 ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -0013 0000 ; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -0014 0000 ; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -0015 0000 ; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -0016 0000 ; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -0017 0000 ; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -0018 0000 ; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -0019 0000 ; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -0020 0000 ; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -0021 0000 ; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -0022 0000 ; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -0023 0000 ;----------------------------------------------------------------------------------- -0024 0000 -0025 0000 ;----------------------- -0026 0000 ; XMSNES SPC DRIVER / -0027 0000 ; by eKid / -0028 0000 ;-- - - - - - - - -- -0029 0000 -0030 0000 ; tabstop = 4 -0031 0000 -0032 0000 ; UNCOMMENT FOR XM-SPC CONVERSION IMAGE -0033 0000 #define xmspc_mode -0034 0000 -0035 0000 ; UNCOMMENT FOR SAMPLE START FIX -0036 0000 #define xms_ssfix -0037 0000 -0038 0000 ; EFFECT DEFINITIONS (comment to exclude) -0039 0000 #define FX_INCLUDE_TREMOR -0040 0000 #define FX_INCLUDE_TREMOLO -0041 0000 #define FX_INCLUDE_ENVPOS -0042 0000 #define VFX_INCLUDE_EXTENDED -0043 0000 -0044 0000 -0045 0000 ; SOME DEFINITIONS -0046 0000 c_xmsoffseth =$21 -0047 0000 c_xmsoffset =$2100 -0048 0000 -0049 0000 ramp_size =10 ; tweak with noise level -0050 0000 -0051 0000 plimitl_lo =1600 -0052 0000 plimitl_hi =7728 ;7744 -0053 0000 -0054 0000 plimita_lo =112 -0055 0000 plimita_hi =8190 ;7744 -0056 0000 -0057 0000 c_inst_nsamps =0 -0058 0000 c_inst_noise =1 -0059 0000 c_inst_nvpoints =2 -0060 0000 c_inst_nppoints =3 -0061 0000 c_inst_envflags =4 -0062 0000 c_inst_volsus =5 -0063 0000 c_inst_volloopsx =6 -0064 0000 c_inst_volloopsp =7 -0065 0000 c_inst_volloopsv =8 -0066 0000 c_inst_volloopsy =9 -0067 0000 c_inst_volloope =10 -0068 0000 c_inst_pansus =11 -0069 0000 c_inst_panloopsx =12 -0070 0000 c_inst_panloopsp =13 -0071 0000 c_inst_panloopsv =14 -0072 0000 c_inst_panloopsy =15 -0073 0000 c_inst_panloope =16 -0074 0000 c_inst_fadeout =17 -0075 0000 c_inst_vibtype =19 -0076 0000 c_inst_vibsweep =20 -0077 0000 c_inst_vibdepth =22 -0078 0000 c_inst_vibrate =23 -0079 0000 c_inst_volenv =24 -0080 0000 c_inst_panenv =48 -0081 0000 c_inst_sampmap =72 -0082 0000 -0083 0000 xmso_flen =$0 -0084 0000 xmso_len =$2 -0085 0000 xmso_chn =$3 -0086 0000 xmso_ins =$4 -0087 0000 xmso_smp =$5 -0088 0000 xmso_pat =$6 -0089 0000 xmso_spd =$7 -0090 0000 xmso_bpm =$8 -0091 0000 -0092 0000 xmso_foff =$A -0093 0000 -0094 0000 xmso_pn =$D -0095 0000 xmso_freqmode =$9 -0096 0000 xmso_restart =$C -0097 0000 xmso_orders =$1E -0098 0000 -0099 0000 xmso_patto =$16 -0100 0000 xmso_insto =$18 -0101 0000 xmso_sampo =$1A -0102 0000 xmso_loopo =$1C -0103 0000 -0104 0000 -0105 0000 .include "dsp.inc" -0001+ 0000 DSP_VOL =$00 -0002+ 0000 DSP_P =$02 -0003+ 0000 DSP_SRCN =$04 -0004+ 0000 DSP_ADSR =$05 -0005+ 0000 DSP_GAIN =$07 -0006+ 0000 DSP_ENVX =$08 -0007+ 0000 DSP_OUTX =$09 -0008+ 0000 DSP_MVOLL =$0C -0009+ 0000 DSP_MVOLR =$1C -0010+ 0000 DSP_EVOLL =$2C -0011+ 0000 DSP_EVOLR =$3C -0012+ 0000 DSP_KON =$4C -0013+ 0000 DSP_KOF =$5C -0014+ 0000 DSP_FLG =$6C -0015+ 0000 DSP_ENDX =$7C -0016+ 0000 DSP_EFB =$0D -0017+ 0000 DSP_PMON =$2D -0018+ 0000 DSP_NON =$3D -0019+ 0000 DSP_EON =$4D -0020+ 0000 DSP_DIR =$5D -0021+ 0000 DSP_ESA =$6D -0022+ 0000 DSP_EDL =$7D -0023+ 0000 DSP_C0 =$0F -0024+ 0000 DSP_C1 =$1F -0025+ 0000 DSP_C2 =$2F -0026+ 0000 DSP_C3 =$3F -0027+ 0000 DSP_C4 =$4F -0028+ 0000 DSP_C5 =$5F -0029+ 0000 DSP_C6 =$6F -0030+ 0000 DSP_C7 =$7F -0106 0000 -0107 0000 .org $0000 ; VARIABLES IN DIRECT PAGE 0 -0108 0000 -0109 0000 comm_write: ; writing position for transfers -0110 0000 00 00 .word -0111 0002 comm_write2: ; writing position for transfers -0112 0002 00 00 .word -0113 0004 comm_buffer: -0114 0004 00 00 .word -0115 0006 data_length: ; length of transfer -0116 0006 00 00 .word -0117 0008 comm_mode: ; current mode -0118 0008 00 00 .word ; 0 = ready, 1 = getting samples -0119 000A -0120 000A int1: ; General purpose -0121 000A 00 00 .word -0122 000C int2: ; General purpose -0123 000C 00 00 .word -0124 000E int3: ; General purpose -0125 000E 00 00 .word -0126 0010 int4: ; General purpose -0127 0010 00 00 .word -0128 0012 int6: ; General purpose -0129 0012 00 00 .word -0130 0014 int7: ; General purpose -0131 0014 00 00 .word -0132 0016 byte1: ; General purpose -0133 0016 00 .byte -0134 0017 -0135 0017 channel_bit: ; Contains channel bit for the channel currently being updated -0136 0017 00 .byte -0137 0018 fx_return: ; Holds return address -0138 0018 00 00 .word -0139 001A -0140 001A cur_inst: ; Instrument of current channel being updated -0141 001A 00 00 .word -0142 001C -0143 001C ; channel struct: -0144 001C ; MAIN byte[7] -0145 001C ; 0 period word 16 bytes per channel -0146 001C ; 2 instrument byte -0147 001C ; 3 volume fx byte -0148 001C ; 4 effect byte -0149 001C ; 5 param byte -0150 001C ; 6 volume byte -0151 001C ; SUB byte[9] -0152 001C ; 7 note byte ; used for glissando aswell -0153 001C ; 8 AV_SWEEP_H byte -- auto-vibrato sweep -0154 001C ; 9 PANNING! byte -0155 001C ; 10 sample byte -0156 001C ; 11 counter byte ; used for various effects -0157 001C ; 12 porta_speed byte ; FOR PORTAMENTO -0158 001C ; 13 AV_SINEPOS byte -0159 001C ; 14 sine_pos byte ; FOR VIBRATO -0160 001C ; 15 retrig/trem data byte ; OMG RETRIGGER & TREMOR COUNTERS -0161 001C ; etc -0162 001C -0163 001C ; channel struct offsets: -0164 001C cso_period =0 -0165 001C cso_inst =2 -0166 001C cso_volfx =3 -0167 001C cso_fx =4 -0168 001C cso_fxparam =5 -0169 001C cso_vol =6 -0170 001C cso_note =7 -0171 001C cso_avsweep =8 -0172 001C cso_panning =9 -0173 001C cso_sample =10 -0174 001C cso_counter =11 -0175 001C cso_portaspd =12 -0176 001C cso_avsine =13 -0177 001C cso_sinepos =14 -0178 001C cso_rtdata =15 -0179 001C -0180 001C ; channel other info ( secondary channel buffer ) -0181 001C ; 0 FADEOUT word -0182 001C ; 2 ENV VOL word ; hi 7 bits = y, lo bits = x WORD -0183 001C ; 4 ENV PAN word ; hi 7 bits = y, lo bits = x WORD -0184 001C ; 6 FLAGS byte ; kxttxvvg -0185 001C ; g = glissando control -0186 001C ; v = vibrato table -0187 001C ; t = tremolo table -0188 001C ; k = key on -0189 001C ; 7 AV_SWEEP_L -0190 001C -0191 001C ; 8 perioda_lo used for vibrato -0192 001C ; 9 perioda_hi used for vibrato -0193 001C ; A envelope point PAN used for envelopes, duh -0194 001C ; B envelope point VOL used for envelopes, duh -0195 001C ; C envelope opt var -0196 001C ; D envelope opt var -0197 001C ; E volume addition -0198 001C ; F note delay -0199 001C coso_pa =$8 ; for vibrato, period addition -0200 001C coso_epv =$A ; envelope optimization memory -0201 001C coso_epp =$B ; -0202 001C coso_eyv =$C ; -0203 001C coso_eyp =$D ; -0204 001C coso_vadd =$E ; volume addition -0205 001C coso_ndelay =$F ; -0206 001C -0207 001C ; oh and some notes about the counter on RETRIGGER NOTE -0208 001C ; lo 4 bits keeps the speed -0209 001C ; hi 4 bits are the ticker -0210 001C -0211 001C xms_channels: ; Main channel buffer -0212 001C .block 128 -0213 009C -0214 009C xms_tremor_flags: -0215 009C 00 .byte ; 1 bit per channel -0216 009D -0217 009D xms_fxfirst: -0218 009D 00 .byte -0219 009E -0220 009E ; channels are edited AFTER ticks -0221 009E ; variables to set data: -0222 009E xms_cc_flags: -0223 009E 00 .byte ; bits: 76543210 -0224 009F ; 0: start note -0225 009F ; 1: set pitch -0226 009F ; 2: set volume -0227 009F ; 3: set panning -0228 009F ; 4: set source -0229 009F ; 5: start note with offset (FOR 9xx) -0230 009F ; 6: reset all volumes (for global things) (will overwrite bit 2) -0231 009F ; 7: perioda +/- -0232 009F -0233 009F ccflag_keyon =%1 -0234 009F ccflag_pitch =%10 -0235 009F ccflag_volume =%100 -0236 009F ccflag_panning =%1000 -0237 009F ccflag_source =%10000 -0238 009F ccflag_offset =%100000 -0239 009F ccflag_volumereset =%1000000 -0240 009F -0241 009F row_flags: -0242 009F 00 00 .word -0243 00A1 -0244 00A1 xms_cc_period: ; permanent period -0245 00A1 00 00 .word -0246 00A3 xms_cc_perioda: ; USED FOR AUTO VIBRATO. UPDATED *EVERY* TICK -0247 00A3 00 00 .word -0248 00A5 xms_cc_volume: ; volume for DSP -0249 00A5 00 .byte -0250 00A6 xms_cc_panning: ; panning for DSP -0251 00A6 00 .byte -0252 00A7 xms_cc_source: ; source for DSP -0253 00A7 00 .byte -0254 00A8 xms_cc_sampoff: ; sample offset for DSP -0255 00A8 00 .byte -0256 00A9 -0257 00A9 xms_samp_head: ; current sample header -0258 00A9 00 .byte -0259 00AA 00 .byte -0260 00AB 00 .byte -0261 00AC 00 .byte -0262 00AD 00 .byte -0263 00AE -0264 00AE xsh_vol =0 ; volume -0265 00AE xsh_ft =1 ; finetune ( word ) -0266 00AE xsh_pan =3 ; panning -0267 00AE xsh_note =4 ; relative note -0268 00AE -0269 00AE xms_volume: ; XMS playback volume -0270 00AE 00 .byte -0271 00AF xms_speed: ; XMS speed -0272 00AF 00 .byte -0273 00B0 xms_bpm: ; XMS bpm -0274 00B0 00 .byte -0275 00B1 xms_position: ; XMS order table position -0276 00B1 00 .byte -0277 00B2 xms_row: ; Current row being decoded -0278 00B2 00 .byte -0279 00B3 xms_tick: ; Current tick -0280 00B3 00 .byte -0281 00B4 xms_pattern_length: ; Length of pattern -0282 00B4 00 .byte -0283 00B5 xms_playing: ; If player is running -0284 00B5 00 .byte -0285 00B6 xms_pattern_read: ; Current XMS pattern read address -0286 00B6 00 00 .word -0287 00B8 xms_pattern_plus: ; pattern secondary read offset -0288 00B8 00 .byte -0289 00B9 xms_pattern_repeat: ; pattern repetition variables -0290 00B9 00 .byte -0291 00BA 00 .byte -0292 00BB 00 .byte -0293 00BC 00 .byte -0294 00BD 00 .byte -0295 00BE 00 .byte -0296 00BF 00 .byte -0297 00C0 00 .byte -0298 00C1 xms_patt_delay: ; set to zero at startup -0299 00C1 00 .byte ; pattern delay -0300 00C2 -0301 00C2 xms_patt_jump: ; pattern jump position -0302 00C2 00 00 .word -0303 00C4 xms_patt_jump_enable: ; pattern jump enable -0304 00C4 00 .byte ; boolean -0305 00C5 xms_patt_jump_offset: ; orderlist entry -0306 00C5 00 00 .word -0307 00C7 -0308 00C7 xms_global_vol: ; global volume -0309 00C7 00 .byte -0310 00C8 xms_patt_loop_pos: -0311 00C8 00 00 .word ; IF NOT ZERO, JUMP TO THIS ADDRESS WITH XMS_PATTERN_READ AND RESET -0312 00CA xms_patt_loop: -0313 00CA 00 .byte ; lo-4 bits = counter, hi 4-bits = jump boolean -0314 00CB xms_patt_loop_row: -0315 00CB 00 .byte ; set row to this -0316 00CC -0317 00CC xms_peek: ; peek ahead data -0318 00CC 00 .byte -0319 00CD -0320 00CD xms_clock: ; timer tick accumulator -0321 00CD 00 .byte -0322 00CE xms_clock_ticks: ; number of ticks required by timer to equal BPM -0323 00CE 00 .byte -0324 00CF -0325 00CF xms_pclock: ; accumulator for pre-timer -0326 00CF 00 .byte -0327 00D0 xms_pclock_ticks: -0328 00D0 00 .byte -0329 00D1 -0330 00D1 xms_final_volume: ; final volume( for ramping ) -0331 00D1 .block 8 -0332 00D9 -0333 00D9 dvar: -0334 00D9 00 00 .word -0335 00DB -0336 00DB xms_last_message: -0337 00DB 00 .byte -0338 00DC -0339 00DC ; SNES->SPC -0340 00DC comm_validate: ; validation byte -0341 00DC 00 .byte -0342 00DD -0343 00DD comm_samplewrite: ; for getting song samples -0344 00DD 00 .byte -0345 00DE -0346 00DE ; Sample playback -0347 00DE samp_playing: -0348 00DE 00 .byte -0349 00DF 00 .byte -0350 00E0 00 .byte -0351 00E1 00 .byte -0352 00E2 00 .byte -0353 00E3 00 .byte -0354 00E4 00 .byte -0355 00E5 00 .byte -0356 00E6 -0357 00E6 samp_dirty: -0358 00E6 00 .byte -0359 00E7 -0360 00E7 samp_usage: -0361 00E7 00 .byte -0362 00E8 -0363 00E8 samp_play_next: -0364 00E8 00 .byte -0365 00E9 -0366 00E9 ;--------------------------------------------------------------------------------------------------------------------------------------------------------------------- -0367 00E9 ; XMSNES PROGRAM CODE -0368 00E9 ;--------------------------------------------------------------------------------------------------------------------------------------------------------------------- -0369 00E9 -0370 0600 .org $0600 ; CODE AREA $600, continues to XMS offset -0371 0600 -0372 0600 ;------------------------------------------------------------------------------------------ -0373 0600 ; MAIN ROUTINE -0374 0600 ;------------------------------------------------------------------------------------------ -0375 0600 -0376 0600 spx_main: -0377 0600 8F 30 F1 mov ($F1), #%00110000 ; clear input ports -0378 0603 8F ED F4 mov $F4, #$ED ; send ready signal -0379 0606 8F FE F5 mov $F5, #$FE ; -0380 0609 -0381 0609 8F 00 DC mov (comm_validate), #0 ; reset validation counter -0382 060C -0383 060C 3F 3E 06 call SOUND_RESET ; reset sound -0384 060F 3F 51 06 call SOUND_ON ; turn on sound -0385 0612 E8 32 mov a, #50 ; default volume -0386 0614 FD mov y, a ; -0387 0615 3F 6B 06 call SOUND_VOLUME ; -0388 0618 8F FF AE mov (xms_volume), #255 ; max xms playback vol -0389 061B -0390 061B ;---- XM-SPC CONVERSION ROUTINE --------. -0391 061B #ifdef xmspc_mode ; -0392 061B E5 09 21 mov a, (c_xmsoffset+xmso_freqmode) ; -0393 061E D0 03 bne _xmsspc_rout_notamiga ; -0394 0620 3F 34 08 call cmsfm_amiga ; -0395 0623 _xmsspc_rout_notamiga: ; -0396 0623 3F 2A 09 call XMS_BuildDirectory ; -0397 0626 3F 9E 0A call XMS_Play ; -0398 0629 #endif ; -0399 0629 ;---------------------------------------' -0400 0629 -0401 0629 8F 21 01 mov (comm_write+1), #c_xmsoffseth -0402 062C 8F 00 00 mov (comm_write), #$00 -0403 062F -0404 062F _program_loop: ; main program loop -0405 062F 3F 94 06 call comm_routine ; ? Communications Routine -0406 0632 3F F1 0B call XMS_Player ; ? XMS Player Routine -0407 0635 3F 4F 20 call XMS_VOLUMERAMP -0408 0638 3F 82 20 call XMS_CHECKSFX -0409 063B 5F 2F 06 jmp _program_loop ; 3 -0410 063E -0411 063E ;------------------------------------------------------------------------------------------- -0412 063E ; MAIN DSP FUNCTIONS -0413 063E ;------------------------------------------------------------------------------------------- -0414 063E SOUND_RESET: -0415 063E ; Soft Reset -0416 063E 8F 6C F2 mov ($F2), #DSP_FLG -0417 0641 FA 41 F3 mov ($F3), $%01100000 -0418 0644 ; Reset other DSP registers -0419 0644 3F 65 0A call RESET_DSP_FILTER -0420 0647 3F 8A 0A call RESET_DSP_VOICES -0421 064A 8F 2D F2 mov ($F2), #DSP_PMON -0422 064D 8F 00 F3 mov ($F3), #0 -0423 0650 6F ret -0424 0651 SOUND_ON: -0425 0651 8F 6C F2 mov ($F2), #DSP_FLG ; 5 Turn off MUTE { 35 cycles -0426 0654 8F 20 F3 mov ($F3), #$20 ; 5 ------------- -0427 0657 8F 3D F2 mov ($F2), #DSP_NON ; 5 Turn off NOISE -0428 065A 8F 00 F3 mov ($F3), #$00 ; 5 -------------- -0429 065D 8F 5D F2 mov ($F2), #DSP_DIR ; 5 Setup Directory -0430 0660 8F 02 F3 mov ($F3), #$02 ; 5 --------------- -0431 0663 6F ret ; 5 return } -0432 0664 SOUND_OFF: -0433 0664 8F 6C F2 mov ($F2), #DSP_FLG ; 5 Turn on MUTE { 15 cycles -0434 0667 18 40 F3 or ($F3), #%01000000 ; 5 ------------ -0435 066A 6F ret ; 5 return } -0436 066B SOUND_VOLUME: -0437 066B ; a = left -0438 066B ; y = right -0439 066B 8F 0C F2 mov ($F2), #DSP_MVOLL ; 5 Set VOL(L) { 23 cycles -0440 066E C4 F3 movz ($F3), a ; 4 -0441 0670 8F 1C F2 mov ($F2), #DSP_MVOLR ; 5 Set VOL(R) -0442 0673 CB F3 movz ($F3), y ; 4 -0443 0675 6F ret ; 5 } -0444 0676 -0445 0676 ;------------------------------------------------------------------------------------------- -0446 0676 ; COMMUNICATIONS -0447 0676 ;------------------------------------------------------------------------------------------- -0448 0676 -0449 0676 COMM_MESSAGE_TABLE: ; COMMUNCIATION CODE -0450 0676 FD 06 .word COMM_MSG_TRANSFERSAMP ; 14 -0451 0678 03 08 .word COMM_MSG_TRANSFERB ; 15 -0452 067A -0453 067A 61 07 .word COMM_MSG_REGISTER_SAMP ; 16 -0454 067C 64 07 .word COMM_MSG_SENDSAMPLES ; 17 -0455 067E -0456 067E 72 08 .word COMM_MSG_XMS_VOLUME ; 18 -0457 0680 79 08 .word COMM_MSG_MAIN_VOLUME ; 19 -0458 0682 -0459 0682 FD 07 .word COMM_MSG_TRANSFER ; 1A -0460 0684 06 08 .word COMM_MSG_BUILDDIR ; 1B -0461 0686 0C 08 .word COMM_MSG_SETFREQMODE ; 1C -0462 0688 63 08 .word COMM_MSG_XMS_RESET ; 1D -0463 068A 69 08 .word COMM_MSG_XMS_PLAY ; 1E -0464 068C 6F 08 .word COMM_MSG_XMS_PAUSE ; 1F -0465 068E -0466 068E 88 08 .word COMM_MSG_PLAYSAMPLE ; 20 -0467 0690 1A 09 .word COMM_MSG_SETSFXPARAM ; 21 -0468 0692 -0469 0692 COMM_MODES: -0470 0692 A7 06 .word COMM_MODE0 -0471 0694 ;.word COMM_MODE2 -0472 0694 -0473 0694 ;TRANSFER_EXITS: -0474 0694 ;.word _comm_exit2 -0475 0694 -0476 0694 comm_routine: -0477 0694 ; routine to handle data transfers -0478 0694 E4 F7 movz a, ($F7) ; 3 Check if SNES sent message -0479 0696 64 DC cmpz a, (comm_validate) ; 3 -0480 0698 D0 01 bne _comm_getmessage ; 2/4 -0481 069A -0482 069A 6F ret -0483 069B -0484 069B _comm_getmessage: -0485 069B 00 nop ; extra delay :) -0486 069C 00 nop -0487 069D E4 F7 movz a, ($F7) ; re-fetch value (incase old value was corrupted) -0488 069F C4 DC movz (comm_validate), a ; 4 save validation -0489 06A1 -0490 06A1 E4 08 movz a, (comm_mode) -0491 06A3 5D mov x, a -0492 06A4 1F 92 06 jmp [COMM_MODES+x] -0493 06A7 -0494 06A7 COMM_MODE0: -0495 06A7 -0496 06A7 E4 F6 movz a, ($F6) ; 3 fetch message # -0497 06A9 -0498 06A9 80 setc -0499 06AA A8 14 sbc a, #$14 -0500 06AC 1C asl a -0501 06AD 5D mov x, a -0502 06AE -0503 06AE 1F 76 06 jmp [COMM_MESSAGE_TABLE+x] -0504 06B1 -0505 06B1 _comm_exit: -0506 06B1 FA DC F7 mov ($F7), (comm_validate) -0507 06B4 6F ret ; return from subroutine -0508 06B5 -0509 06B5 -0510 06B5 _cmt_begin_transfer: -0511 06B5 -0512 06B5 FA 00 02 mov (comm_write2), (comm_write) -0513 06B8 FA 01 03 mov (comm_write2+1), (comm_write+1) -0514 06BB 1A 00 decw (comm_write) ; 6 prepare transfer 14 cycles -0515 06BD E4 DC movz a, (comm_validate) ; 3 -0516 06BF C4 F7 movz ($F7), a ; 4 validate message -0517 06C1 5D mov x, a ; 2 -0518 06C2 8D 01 mov y, #1 ; 2 -0519 06C4 -0520 06C4 ; jmp _comm_transfer ; x start transfer -0521 06C4 -0522 06C4 _comm_transfer: -0523 06C4 3E F7 cmpz x, ($F7) ; 3 check for data } 5 cycles -0524 06C6 F0 FC beq _comm_transfer ; 2/4 } -0525 06C8 E9 F7 00 mov x, ($F7) ; 3 ... -0526 06CB ; -0527 06CB E4 F4 movz a, ($F4) ; 3 fetch data 51 cycles... -0528 06CD D7 00 mov [comm_write]+y, a ; 7 store.. -0529 06CF -0530 06CF E4 F5 movz a, ($F5) ; 3 fetch more data( hurry before snes overwrites ) -0531 06D1 D7 02 mov [comm_write2]+y, a ; 7 -0532 06D3 -0533 06D3 E4 F6 movz a, ($F6) ; 3 -0534 06D5 C9 F7 00 mov ($F7), x ; 4 snes is now active -0535 06D8 FC inc y -0536 06D9 FC inc y -0537 06DA D7 00 mov [comm_write]+y, a ; 7 -0538 06DC FC inc y -0539 06DD F0 12 beq _cmt_y_eq3 ; 2/4 -0540 06DF _cmt_y_ret3: -0541 06DF -0542 06DF C8 00 cmp x, #0 ; 2 -0543 06E1 D0 E1 bne _comm_transfer ; 2/4 jump is taken -0544 06E3 -0545 06E3 _comm_transfer_finish: -0546 06E3 DD mov a, y -0547 06E4 60 clrc -0548 06E5 84 00 adcz a, (comm_write) -0549 06E7 C4 00 movz (comm_write), a -0550 06E9 98 00 01 adc (comm_write+1), #0 -0551 06EC D8 DC movz (comm_validate), x ; 4 save validation -0552 06EE 5F B1 06 jmp _comm_exit ; 3 -0553 06F1 -0554 06F1 _cmt_y_eq3: -0555 06F1 8D 01 mov y, #1 ; 2 reset Y -0556 06F3 AB 01 incz (comm_write+1) ; 4 increment writepos -0557 06F5 1A 00 decw (comm_write) ; 6 -0558 06F7 AB 03 incz (comm_write2+1) -0559 06F9 1A 02 decw (comm_write2) -0560 06FB 2F E2 b _cmt_y_ret3 ; 4 -0561 06FD -0562 06FD ;---------------------------------------------------------------------------------------------- -0563 06FD ; COMMUNICATION MESSAGES -0564 06FD ;---------------------------------------------------------------------------------------------- -0565 06FD ; a = message -0566 06FD -0567 06FD COMM_MSG_TRANSFERSAMP: -0568 06FD E8 00 mov a, #0 -0569 06FF 8D 00 mov y, #0 -0570 0701 5A F4 cmpw ya, $F4 -0571 0703 F0 04 beq COMM_MSG_TRANSFERSAMP_REL -0572 0705 BA F4 movw ya, ($F4) -0573 0707 DA 00 movw (comm_write), ya -0574 0709 COMM_MSG_TRANSFERSAMP_REL: -0575 0709 -0576 0709 8F 00 0A mov (int1+0), #$00 -0577 070C 8F 02 0B mov (int1+1), #$02 -0578 070F -0579 070F E4 DD movz a, (comm_samplewrite) ; get next sample# -0580 0711 1C asl a ; *4 -0581 0712 1C asl a -0582 0713 FD mov y, a ; set index -0583 0714 6D push y ; save value -0584 0715 60 clrc ; -0585 0716 E4 00 movz a, (comm_write) ; preserve comm_write and set directory pointer to comm_write+6 (skipping sample header): -0586 0718 C4 14 movz (int7), a ; comm_write preservation -0587 071A 88 06 adc a, #6 ; +6 -0588 071C D7 0A mov [int1]+y, a ; directory setting -0589 071E E4 01 movz a, (comm_write+1) ; do hi byte -0590 0720 C4 15 movz (int7+1), a -0591 0722 88 00 adc a, #0 -0592 0724 FC inc y -0593 0725 D7 0A mov [int1]+y, a ; done -0594 0727 -0595 0727 3F 03 08 call COMM_MSG_TRANSFERB ; transfer data -0596 072A -0597 072A ; setup loop start -0598 072A 8D 03 mov y, #3 ; 3 = XMB.LOOP, hi byte -0599 072C F7 14 mov a, [int7]+y ; load byte -0600 072E 68 FF cmp a, #255 -0601 0730 F0 15 beq _ts_noloop -0602 0732 5D mov x, a ; preserve byte -0603 0733 DC dec y ; next value -0604 0734 F7 14 mov a, [int7]+y ; load byte -0605 0736 EE pop y ; restore directory index -0606 0737 97 0A adci a, [int1]+y ; add loop start to directory offset -0607 0739 FC inc y ; edit pointer -0608 073A FC inc y -0609 073B D7 0A mov [int1]+y, a ; save value -0610 073D DC dec y ; get hi byte -0611 073E 7D mov a, x -0612 073F 97 0A adci a, [int1]+y ; add hi bytes -0613 0741 FC inc y -0614 0742 FC inc y -0615 0743 D7 0A mov [int1]+y, a ; save value -0616 0745 2F 08 b _ts_hasloop -0617 0747 _ts_noloop: -0618 0747 EE pop y -0619 0748 FC inc y -0620 0749 FC inc y -0621 074A D7 0A mov [int1]+y, a -0622 074C FC inc y -0623 074D D7 0A mov [int1]+y, a -0624 074F _ts_hasloop: -0625 074F -0626 074F -0627 074F -0628 074F -0629 074F E4 DC movz a, (comm_validate) -0630 0751 _cmts_wl: -0631 0751 64 F7 cmpz a, ($F7) -0632 0753 F0 FC beq _cmts_wl -0633 0755 FA F7 DC mov (comm_validate), ($F7) -0634 0758 FA DD F4 mov ($F4), (comm_samplewrite) -0635 075B FA DC F7 mov ($F7), (comm_validate) -0636 075E -0637 075E AB DD incz (comm_samplewrite) -0638 0760 -0639 0760 6F ret -0640 0761 -0641 0761 COMM_MSG_REGISTER_SAMP: -0642 0761 5F B1 06 jmp _comm_exit -0643 0764 -0644 0764 COMM_MSG_SENDSAMPLES: -0645 0764 8F 9B F6 mov ($F6), #$9B -0646 0767 ;mov ($F7), (comm_validate) -0647 0767 -0648 0767 8F 00 DD mov (comm_samplewrite), #0 -0649 076A -0650 076A 8F 02 0B mov (int1+1), #$02 ; int1 = $0200 -0651 076D 8F 00 0A mov (int1), #$00 -0652 0770 -0653 0770 60 clrc -0654 0771 -0655 0771 E5 1C 21 mov a, (c_xmsoffset+xmso_loopo) ; int2 = sample# directory -0656 0774 EC 1D 21 mov y, (c_xmsoffset+xmso_loopo+1) -0657 0777 DA 0C movw (int2), ya -0658 0779 DA 0E movw (int3), ya -0659 077B 3A 0E incw (int3) -0660 077D -0661 077D E8 00 mov a, #0 -0662 077F -0663 077F cmss_samploop: -0664 077F -0665 077F C4 10 movz (int4), a -0666 0781 1C asl a -0667 0782 FD mov y, a -0668 0783 -0669 0783 F7 0E mov a, [int3]+y ; get sample# -0670 0785 C4 11 movz (int4+1), a -0671 0787 F7 0C mov a, [int2]+y ; -0672 0789 C4 12 movz (int6), a -0673 078B -0674 078B -0675 078B cmss_loopto0: -0676 078B DC dec y ; search back to 0 -0677 078C DC dec y -0678 078D -0679 078D 30 07 bmi cmss_dloope ; -0680 078F cmss_dloop: ; -0681 078F 77 0C cmpi a, [int2]+y ; see if sample exists -0682 0791 F0 33 beq cmss_match1 ; -0683 0793 -0684 0793 5F 8B 07 jmp cmss_loopto0 -0685 0796 -0686 0796 cmss_dloope: -0687 0796 -0688 0796 E4 12 movz a, (int6) -0689 0798 C4 F4 movz ($F4), a -0690 079A E4 11 movz a, (int4+1) -0691 079C C4 F5 movz ($F5), a -0692 079E E4 DC movz a, (comm_validate) -0693 07A0 -0694 07A0 C4 F7 movz ($F7), a -0695 07A2 C4 DC movz (comm_validate), a -0696 07A4 ; receive transfer message -0697 07A4 -0698 07A4 cmss_dloopwm: -0699 07A4 64 F7 cmpz a, ($F7) -0700 07A6 F0 FC beq cmss_dloopwm -0701 07A8 FA F7 DC mov (comm_validate), ($F7) -0702 07AB -0703 07AB 3F 09 07 call COMM_MSG_TRANSFERSAMP_REL -0704 07AE -0705 07AE E4 DC movz a, (comm_validate) ; sync with snes -0706 07B0 cmss_dloopwm2: -0707 07B0 64 F7 cmpz a, ($F7) -0708 07B2 F0 FC beq cmss_dloopwm2 -0709 07B4 FA F7 DC mov (comm_validate), ($F7) -0710 07B7 -0711 07B7 cmss_next: -0712 07B7 E4 10 movz a, (int4) -0713 07B9 BC inc a -0714 07BA 65 05 21 cmp a, (c_xmsoffset+xmso_smp) -0715 07BD D0 C0 bne cmss_samploop -0716 07BF cmss_exit: -0717 07BF 8F 9C F6 mov $F6, #$9C -0718 07C2 FA DC F7 mov $F7, (comm_validate) -0719 07C5 6F ret -0720 07C6 -0721 07C6 cmss_match1: ; check hi byte -0722 07C6 E4 11 movz a, (int4+1) -0723 07C8 77 0E cmpi a, [int3]+y ; -0724 07CA F0 05 beq cmss_match2 ; -0725 07CC E4 12 movz a, (int6) -0726 07CE 5F 8B 07 jmp cmss_loopto0 -0727 07D1 -0728 07D1 cmss_match2: -0729 07D1 -0730 07D1 DD mov a, y -0731 07D2 1C asl a -0732 07D3 FD mov y, a -0733 07D4 -0734 07D4 F7 0A mov a, [int1]+y -0735 07D6 2D push a -0736 07D7 FC inc y -0737 07D8 F7 0A mov a, [int1]+y -0738 07DA 2D push a -0739 07DB FC inc y -0740 07DC F7 0A mov a, [int1]+y -0741 07DE 2D push a -0742 07DF FC inc y -0743 07E0 F7 0A mov a, [int1]+y -0744 07E2 2D push a -0745 07E3 -0746 07E3 E5 10 00 mov a, (int4) -0747 07E6 1C asl a -0748 07E7 1C asl a -0749 07E8 88 03 adc a, #3 -0750 07EA FD mov y, a -0751 07EB AE pop a -0752 07EC D7 0A mov [int1]+y, a -0753 07EE AE pop a -0754 07EF DC dec y -0755 07F0 D7 0A mov [int1]+y, a -0756 07F2 AE pop a -0757 07F3 DC dec y -0758 07F4 D7 0A mov [int1]+y, a -0759 07F6 AE pop a -0760 07F7 DC dec y -0761 07F8 D7 0A mov [int1]+y, a -0762 07FA -0763 07FA 5F B7 07 jmp cmss_next -0764 07FD -0765 07FD -0766 07FD COMM_MSG_TRANSFER: -0767 07FD FA F4 00 mov (comm_write), $F4 ; 5 set write offset -0768 0800 FA F5 01 mov (comm_write+1), $F5 ; 5 -0769 0803 COMM_MSG_TRANSFERB: -0770 0803 5F B5 06 jmp _cmt_begin_transfer ; 3 jump to transfer routine -0771 0806 -0772 0806 COMM_MSG_BUILDDIR: -0773 0806 3F 2A 09 call XMS_BuildDirectory -0774 0809 5F B1 06 jmp _comm_exit -0775 080C COMM_MSG_SETFREQMODE: -0776 080C -0777 080C 78 01 F5 cmp ($F5), #1 -0778 080F F0 23 beq cmsfm_amiga -0779 0811 cmsfm_linear: -0780 0811 -0781 0811 8F 00 AB mov (xms_samp_head+xsh_ft+1), #0 -0782 0814 ; reset mods -0783 0814 E8 00 mov a, #0 -0784 0816 C5 BE 09 mov XMS_PERIOD2FREQ, a -0785 0819 C5 BF 09 mov XMS_PERIOD2FREQ+1, a -0786 081C C5 C0 09 mov XMS_PERIOD2FREQ+2, a -0787 081F -0788 081F C5 04 1D mov XMS_PeriodClip, a -0789 0822 C5 05 1D mov XMS_PeriodClip+1, a -0790 0825 -0791 0825 C5 13 0F mov XMS_GetPeriod, a -0792 0828 C5 14 0F mov XMS_GetPeriod+1, a -0793 082B -0794 082B C5 20 13 mov _xmsfxa_modspace, a -0795 082E C5 21 13 mov _xmsfxa_modspace+1, a -0796 0831 5F B1 06 jmp _comm_exit -0797 0834 -0798 0834 cmsfm_amiga: -0799 0834 -0800 0834 8F 03 AB mov (xms_samp_head+xsh_ft+1), #$03 -0801 0837 -0802 0837 ; modify code -0803 0837 E8 5F mov a, #$5F -0804 0839 C5 BE 09 mov (XMS_PERIOD2FREQ+0), a -0805 083C E8 46 mov a, #(XMS_PERIOD2FREQ_AMIGA & 255) -0806 083E C5 BF 09 mov (XMS_PERIOD2FREQ+1), a -0807 0841 E8 0A mov a, #(XMS_PERIOD2FREQ_AMIGA >> 8) -0808 0843 C5 C0 09 mov (XMS_PERIOD2FREQ+2), a -0809 0846 -0810 0846 E8 2F mov a, #$2F -0811 0848 C5 04 1D mov (XMS_PeriodClip), a -0812 084B C5 13 0F mov (XMS_GetPeriod), a -0813 084E C5 20 13 mov (_xmsfxa_modspace), a -0814 0851 -0815 0851 E8 21 mov a, #(XMS_GetAmigaPeriod-(XMS_GetPeriod+2)) -0816 0853 C5 14 0F mov (XMS_GetPeriod+1), a -0817 0856 -0818 0856 E8 1A mov a, #(XMS_PeriodClipA-(XMS_PeriodClip+2)) -0819 0858 C5 05 1D mov (XMS_PeriodClip+1), a -0820 085B -0821 085B E8 1F mov a, #(_xmsfxa_amiga-(_xmsfxa_modspace+2)) -0822 085D C5 21 13 mov (_xmsfxa_modspace+1), a -0823 0860 -0824 0860 5F B1 06 jmp _comm_exit -0825 0863 -0826 0863 COMM_MSG_XMS_RESET: -0827 0863 3F DA 0A call XMS_Stop -0828 0866 5F B1 06 jmp _comm_exit -0829 0869 COMM_MSG_XMS_PLAY: -0830 0869 3F 9E 0A call XMS_Play -0831 086C 5F B1 06 jmp _comm_exit -0832 086F COMM_MSG_XMS_PAUSE: -0833 086F ; not implemented -0834 086F 5F B1 06 jmp _comm_exit -0835 0872 COMM_MSG_XMS_VOLUME: -0836 0872 E4 F4 movz a, ($F4) -0837 0874 C4 AE movz (xms_volume), a -0838 0876 5F B1 06 jmp _comm_exit -0839 0879 COMM_MSG_MAIN_VOLUME: -0840 0879 BA F4 movw ya, ($F4) -0841 087B 8F 0C F2 mov $F2, #DSP_MVOLL -0842 087E C4 F3 movz $F3, a -0843 0880 8F 1C F2 mov $F2, #DSP_MVOLR -0844 0883 CB F3 movz $F3, y -0845 0885 5F B1 06 jmp _comm_exit -0846 0888 -0847 0888 COMM_MSG_PLAYSAMPLE: -0848 0888 ; find free channel -0849 0888 8F 80 0A mov (int1), #128 -0850 088B 8F 07 0B mov (int1+1), #7 -0851 088E E5 F7 00 mov a, $F7 ; load 'zz' (see protocolsX.txt) -0852 0891 9F xcn a ; xCCxxxxx - xxxxxCCx mask priority -0853 0892 4C 00 00 lsr ; xxxxxCCx - xxxxxxCC -0854 0895 28 03 and a, #3 ; xxxxxxCC - 000000CC -0855 0897 BC inc a -0856 0898 8D 08 mov y, #8 ; loop through channels -0857 089A _cmps_findchannel: -0858 089A DC dec y -0859 089B 7E E7 cmpz y, (samp_usage) ; check if the following channels are reserved -0860 089D F0 73 beq _cmps_exit ; exit if so -0861 089F 76 DE 00 cmp a, (samp_playing)+y ; check if priority is higher -0862 08A2 B0 03 bcs _cmps_foundchan ; exit loop or continue search -0863 08A4 DC dec y -0864 08A5 2F F3 b _cmps_findchannel -0865 08A7 -0866 08A7 _cmps_foundchan: -0867 08A7 ; y = channel# -0868 08A7 F9 DE mov x, (samp_playing)+y -0869 08A9 F0 0B beq _cmps_found0 -0870 08AB 1E 0A 00 cmp x, (int1) -0871 08AE B0 EA bcs _cmps_findchannel -0872 08B0 D8 0A movz (int1), x -0873 08B2 CB 0B movz (int1+1), y -0874 08B4 2F E4 b _cmps_findchannel -0875 08B6 _cmps_found0: -0876 08B6 CB 0B movz (int1+1), y -0877 08B8 _cmps_searchcomplete: -0878 08B8 ; a = prio -0879 08B8 EB 0B movz y, (int1+1) -0880 08BA D6 DE 00 mov (samp_playing)+y, a -0881 08BD ; movz a, (int1+1) ; get channel# -0882 08BD DD mov a, y -0883 08BE 9F xcn a -0884 08BF 5D mov x, a -0885 08C0 -0886 08C0 3F 0E 1B call XMS_CHANNEL_INTERRUPT -0887 08C3 -0888 08C3 ; play sample.... -0889 08C3 08 07 or a, #$07 ; turn off volume -0890 08C5 8D 00 mov y, #0 -0891 08C7 DA F2 movw ($F2), ya -0892 08C9 -0893 08C9 -0894 08C9 E4 F4 movz a, ($F4) ; set volume (left) -0895 08CB 28 F0 and a, #$F0 -0896 08CD 10 01 bpl _cmps_vl_good -0897 08CF 9C dec a -0898 08D0 _cmps_vl_good: -0899 08D0 D8 F2 movz ($F2), x -0900 08D2 C4 F3 movz ($F3), a -0901 08D4 AB F2 incz ($F2) -0902 08D6 -0903 08D6 E4 F4 movz a, ($F4) ; set volume (right) -0904 08D8 28 0F and a, #$0F -0905 08DA 9F xcn a -0906 08DB 10 01 bpl _cmps_vr_good -0907 08DD 9C dec a -0908 08DE _cmps_vr_good: -0909 08DE C4 F3 movz ($F3), a -0910 08E0 AB F2 incz ($F2) ; set period lo -0911 08E2 -0912 08E2 8F 00 F3 mov ($F3), #0 -0913 08E5 AB F2 incz ($F2) -0914 08E7 -0915 08E7 E4 F7 movz a, $F7 ; set period hi -0916 08E9 28 1F and a, #%00011111 -0917 08EB 1C asl a -0918 08EC C4 F3 movz ($F3), a -0919 08EE -0920 08EE AB F2 incz ($F2) ; set source# -0921 08F0 E4 F5 movz a, ($F5) -0922 08F2 C4 F3 movz ($F3), a -0923 08F4 7D mov a, x ; set adsr/gain -0924 08F5 08 06 or a, #$06 -0925 08F7 8D E0 mov y, #%11100000 -0926 08F9 DA F2 movw $F2, ya -0927 08FB 9C dec a -0928 08FC 8D 8F mov y, #%10001111 -0929 08FE DA F2 movw $F2, ya -0930 0900 ; or a, #$06 -0931 0900 ; mov y, #0 -0932 0900 ; movw ($F2), ya -0933 0900 ; inc a -0934 0900 ; mov y, #127 -0935 0900 ; movw ($F2), ya -0936 0900 -0937 0900 EB 0B movz y, (int1+1) ; get channel# -0938 0902 F6 9B 20 mov a, (XMS_TABLE_BITS)+y ; translate to bit array -0939 0905 FD mov y, a -0940 0906 E8 4C mov a, #$4C -0941 0908 DA F2 movw ($F2), ya ; key on -0942 090A DD mov a, y -0943 090B 04 E6 orz a, (samp_dirty) -0944 090D C4 E6 movz (samp_dirty), a -0945 090F -0946 090F _cmps_realexit: -0947 090F -0948 090F 5F B1 06 jmp _comm_exit -0949 0912 -0950 0912 _cmps_exit: -0951 0912 E5 0A 00 mov a, (int1) -0952 0915 30 F8 bmi _cmps_realexit -0953 0917 2F 9F b _cmps_searchcomplete -0954 0919 -0955 0919 _cmsfxp_params: -0956 0919 E7 .byte samp_usage -0957 091A -0958 091A COMM_MSG_SETSFXPARAM: -0959 091A EB F4 movz y, ($F4) -0960 091C F6 19 09 mov a, (_cmsfxp_params)+y -0961 091F 5D mov x, a -0962 0920 E4 F5 movz a, ($F5) -0963 0922 D4 00 movz ($00)+x, a -0964 0924 -0965 0924 5F B1 06 jmp _comm_exit -0966 0927 -0967 0927 COMM_MSG_UNDEFINED: -0968 0927 5F B1 06 jmp _comm_exit -0969 092A -0970 092A ;----------------------------------------------------------------------------------------------- -0971 092A ; XMS Initialization -0972 092A ;----------------------------------------------------------------------------------------------- -0973 092A XMS_BuildDirectory: -0974 092A -0975 092A E5 1C 21 mov a, c_xmsoffset+xmso_loopo -0976 092D EC 1D 21 mov y, c_xmsoffset+xmso_loopo+1 -0977 0930 DA 0E movw (int3), ya -0978 0932 -0979 0932 E5 1A 21 mov a, c_xmsoffset+xmso_sampo -0980 0935 EC 1B 21 mov y, c_xmsoffset+xmso_sampo+1 -0981 0938 DA 10 movw (int4), ya -0982 093A ; -0983 093A 8D 00 mov y, #0 ; 2 prepare to build directory -0984 093C ; -0985 093C E9 05 21 mov x, (c_xmsoffset+xmso_smp) ; 4 -0986 093F ; -0987 093F 8F 00 0A mov (int1), #$00 ; 5 -0988 0942 8F 02 0B mov (int1+1), #$02 ; 5 -0989 0945 ; -0990 0945 1A 0E decw (int3) ; 6 -0991 0947 1A 0E decw (int3) ; 6 -0992 0949 ; -0993 0949 60 clrc ; 2 just in case :\ } -0994 094A -0995 094A ; SKIP IN XMR MODE: -0996 094A -0997 094A _bd_convert_loop: -0998 094A -0999 094A F7 10 mov a, [int4]+y ; 6 $200+y = samp_offsets[y] + 5 { 47 cycles { 96 cycles * nsamples -1000 094C 88 05 adc a, #5 ; 2 -1001 094E D7 0A mov [int1]+y, a ; 7 -1002 0950 ; -1003 0950 FC inc y ; 2 -1004 0951 ; -1005 0951 F7 10 mov a, [int4]+y ; 6 -1006 0953 88 00 adc a, #0 -1007 0955 D7 0A mov [int1]+y, a ; 7 -1008 0957 ; -1009 0957 FC inc y ; 2 -1010 0958 ; -1011 0958 F7 0E mov a, [int3]+y ; 6 $202+y = sampl_offsets[y] -1012 095A D7 0A mov [int1]+y, a ; 7 } -1013 095C ; -1014 095C FC inc y ; 2 { 49 cycles -1015 095D ; -1016 095D F7 0E mov a, [int3]+y ; 6 -1017 095F D7 0A mov [int1]+y, a ; 7 -1018 0961 ; -1019 0961 FC inc y ; 2 -1020 0962 ; -1021 0962 1A 10 decw (int4) ; 6 -1022 0964 1A 10 decw (int4) ; 6 -1023 0966 1A 0E decw (int3) ; 6 -1024 0968 1A 0E decw (int3) ; 6 -1025 096A ; -1026 096A 1D dec x ; 2 -1027 096B ; -1028 096B D0 DD bne _bd_convert_loop ; 2/4 } } -1029 096D -1030 096D E5 1A 21 mov a, c_xmsoffset+xmso_sampo ;; EDITED!!!! --------------------------------------------------------------------- -1031 0970 EC 1B 21 mov y, c_xmsoffset+xmso_sampo+1 -1032 0973 DA 0E movw (int3), ya -1033 0975 -1034 0975 E8 00 mov a, #0 ; 2 } 4 cycles -1035 0977 CD 00 mov x, #0 ; 2 } -1036 0979 _bd_duplicate_check: ; check for sample copies -1037 0979 -1038 0979 2D push a ; 4 preserve sample number { 59 cycles -1039 097A 1C asl a ; 2 fetch sample address -1040 097B 84 0E adcz a, (int3) ; 3 ; EDITED------------ -1041 097D C4 0A movz (int1), a ; 4 -1042 097F FA 0F 0B mov (int1+1), (int3+1) ; 5 ; EDITED------------ -1043 0982 98 00 0B adc (int1+1), #0 ; 5 -1044 0985 8D 01 mov y, #1 ; 2 -1045 0987 F7 0A mov a, [int1]+y ; 6 -1046 0989 C4 11 movz (int4+1), a ; 4 -1047 098B DC dec y ; 2 -1048 098C F7 0A mov a, [int1]+y ; 6 -1049 098E C4 10 movz (int4), a ; 4 -1050 0990 -1051 0990 8D 04 mov y, #4 ; 2 fetch 'duplicate' byte -1052 0992 F7 10 mov a, [int4]+y ; 6 check and branch if original sample -1053 0994 F0 1C beq _bd_original ; 2/4 } -1054 0996 -1055 0996 9C dec a ; 2 Get offset address of original } 8 cycles -1056 0997 1C asl a ; 2 } -1057 0998 1C asl a ; 2 } -1058 0999 FD mov y, a ; 2 } -1059 099A -1060 099A -1061 099A F6 00 02 mov a, $200+y ; 4 Copy { 36 cycles -1062 099D D5 00 02 mov $200+x, a ; 5 -1063 09A0 F6 01 02 mov a, $201+y ; 4 -1064 09A3 D5 01 02 mov $201+x, a ; 5 -1065 09A6 F6 02 02 mov a, $202+y ; 4 -1066 09A9 D5 02 02 mov $202+x, a ; 5 -1067 09AC F6 03 02 mov a, $203+y ; 4 -1068 09AF D5 03 02 mov $203+x, a ; 5 } -1069 09B2 _bd_original: -1070 09B2 -1071 09B2 _bd_modified: -1072 09B2 3D inc x ; 2 } 8 cycles -1073 09B3 3D inc x ; 2 } -1074 09B4 3D inc x ; 2 } -1075 09B5 3D inc x ; 2 } -1076 09B6 -1077 09B6 AE pop a ; 4 restore sample number } 14 cycles -1078 09B7 ; } -1079 09B7 BC inc a ; 2 } -1080 09B8 65 05 21 cmp a, (c_xmsoffset+xmso_smp) ; 4 } -1081 09BB 90 BC bcc _bd_duplicate_check ; 2/4 } -1082 09BD -1083 09BD 6F ret ; 5 -1084 09BE ;-------------------------------------------------------------------------------------------------------------------------------------------------------- -1085 09BE ; XMS PLAYBACK CODE FOLLOWS -1086 09BE ;-------------------------------------------------------------------------------------------------------------------------------------------------------- -1087 09BE XMS_PERIOD2FREQ: -1088 09BE 00 nop -1089 09BF 00 nop ; <----------- RESERVED FOR MODIFICATION (LONG) -1090 09C0 00 nop -1091 09C1 -1092 09C1 XMS_PERIOD2FREQ_LINEAR: ; | -1093 09C1 ; parameter: ; | Optimization Priority: High -1094 09C1 ; int1 = xm period - 1600 ; | Optimization Level: Medium/High -1095 09C1 ; return: ; | HEAVY LOAD -1096 09C1 ; int3 = dsp frequency ; | -1097 09C1 -1098 09C1 80 setc -1099 09C2 B8 40 0A sbc (int1), #$40 ; 5 -1100 09C5 B8 06 0B sbc (int1+1), #$06 ; 5 -1101 09C8 ; -1102 09C8 ; formula = ((freqtable[period >> 4] * (16 - (period & 15))) >> 4) + ((freqtable[(period >> 4) + 1] * (period & 15)) >> 4) -1103 09C8 ; freqtable = $0300 -1104 09C8 -1105 09C8 8F 02 0C mov (int2), #$02 ; int2 = $0300 5 } 12 cycles { 84 cycles -1106 09CB 8F 03 0D mov (int2+1), #$03 ; 5 } -1107 09CE -1108 09CE E4 0A movz a, int1 ; 3 ya = (period >> 4) * 2 } 26 cycles -1109 09D0 4B 0B lsrz int1+1 ; 4 } -1110 09D2 7C ror a ; 2 } -1111 09D3 4B 0B lsrz int1+1 ; 4 } -1112 09D5 7C ror a ; 2 } -1113 09D6 4B 0B lsrz int1+1 ; 4 } -1114 09D8 7C ror a ; 2 } -1115 09D9 EB 0B movz y, (int1+1) ; 3 } -1116 09DB 28 FE and a, #254 ; 2 } -1117 09DD -1118 09DD 7A 0C addw ya, (int2) ; int2 += (period>>4) * 2 5 } 14 cycles -1119 09DF DA 0C movw (int2), ya ; 4 } -1120 09E1 ; } -1121 09E1 E4 0A movz a, (int1) ; 3 } -1122 09E3 28 0F and a, #15 ; 2 } -1123 09E5 ; -1124 09E5 ; a = period & 15 ; -1125 09E5 CD 00 mov x, #0 ; 2 } 6 cycles -1126 09E7 ; } -1127 09E7 68 00 cmp a, #0 ; 2 } -1128 09E9 D0 15 bne _p2f_irregular ; 4 } } -1129 09EB -1130 09EB 1A 0C decw int2 -1131 09ED 1A 0C decw int2 -1132 09EF -1133 09EF E7 0C mov a, [int2+x] ; SHORTCUT 6 } 43 cycles -1134 09F1 C4 0E movz (int3), a ; 4 } -1135 09F3 3A 0C incw (int2) ; 6 } -1136 09F5 E7 0C mov a, [int2+x] ; 6 } -1137 09F7 5C lsr a ; 2 } -1138 09F8 6B 0E rorz (int3) ; 4 } -1139 09FA 5C lsr a ; 2 } -1140 09FB 6B 0E rorz (int3) ; 4 } -1141 09FD C4 0F movz (int3+1), a ; 4 } -1142 09FF ; } -1143 09FF -1144 09FF 6F ret ; 5 -- 115 cycles regular } -1145 0A00 _p2f_irregular: -1146 0A00 -1147 0A00 ; a = interpolation -1148 0A00 ; int2 = table address -1149 0A00 ; get initial freq and subtract next freq -1150 0A00 48 0F eor a, #15 ; 2 { 57 cycles -1151 0A02 BC inc a ; 2 -1152 0A03 C4 16 movz (byte1), a ; 4 -1153 0A05 ; -1154 0A05 8D 03 mov y, #3 ; 2 -1155 0A07 F7 0C mov a, [int2]+y ; get freq2 6 -1156 0A09 C4 0F movz (int3+1), a ; 4 -1157 0A0B DC dec y ; 2 -1158 0A0C F7 0C mov a, [int2]+y ; 6 -1159 0A0E C4 0E movz (int3), a ; 4 -1160 0A10 DC dec y ; 2 -1161 0A11 F7 0C mov a, [int2]+y ; get freq1 6 -1162 0A13 FD mov y, a ; 2 -1163 0A14 E7 0C mov a, [int2+x] ; 6 -1164 0A16 DA 0A movw (int1), ya ; 4 -1165 0A18 9A 0E subw ya, (int3) ; subtract freq2 5 } -1166 0A1A -1167 0A1A ;------------------------------------------------------ -1168 0A1A 6D push y ; 4 mul freqa * interpol { 45 cycles -1169 0A1B EB 16 movz y, (byte1) ; 3 -1170 0A1D CF mul ya ; 9 -1171 0A1E DA 0C movw (int2), ya ; 4 -1172 0A20 AE pop a ; 4 -1173 0A21 EB 16 movz y, (byte1) ; 3 -1174 0A23 CF mul ya ; 9 -1175 0A24 FD mov y, a ; 2 -1176 0A25 E8 00 mov a, #0 ; 2 -1177 0A27 7A 0C addw ya, (int2) ; 5 } -1178 0A29 -1179 0A29 9F xcn a ; 5 freqb >> 4 { 35 cycles -1180 0A2A 28 0F and a, #15 ; 2 -1181 0A2C C4 0C movz (int2), a ; 4 -1182 0A2E DD mov a, y ; 2 -1183 0A2F 9F xcn a ; 5 -1184 0A30 2D push a ; 4 -1185 0A31 28 0F and a, #$F ; 2 -1186 0A33 FD mov y, a ; 2 -1187 0A34 AE pop a ; 4 -1188 0A35 28 F0 and a, #$F0 ; 2 -1189 0A37 04 0C orz a, (int2) ; 3 } -1190 0A39 -1191 0A39 7A 0A addw ya, (int1) ; 5 add initial and >> 2 { 25 cycles -1192 0A3B CB 0F movz (int3+1), y ; 4 -1193 0A3D 4B 0F lsrz (int3+1) ; 4 -1194 0A3F 7C ror a ; 2 -1195 0A40 4B 0F lsrz (int3+1) ; 4 -1196 0A42 7C ror a ; 2 -1197 0A43 C4 0E movz (int3), a ; 4 } -1198 0A45 -1199 0A45 6F ret ; 5 251 cycles total -1200 0A46 -1201 0A46 XMS_PERIOD2FREQ_AMIGA: -1202 0A46 ; AMIGA period->snes frequency -1203 0A46 ; calculate 1832634/period -1204 0A46 ; int1 = period -1205 0A46 ; $F000 = amiga freq table -1206 0A46 -1207 0A46 E4 0B movz a, (int1+1) ; 3 { ? cycles -1208 0A48 80 setc -1209 0A49 B8 70 0A sbc (int1), #112 ; 5 -1210 0A4C A8 00 sbc a, #0 -1211 0A4E -1212 0A4E 5C lsr a ; 2 -1213 0A4F 6B 0A rorz (int1) ; 4 -1214 0A51 38 FE 0A and (int1), #$FE -1215 0A54 -1216 0A54 60 clrc ; 2 -1217 0A55 88 F0 adc a, #$F0 ; 2 -1218 0A57 C4 0B movz (int1+1), a ; 4 -1219 0A59 8D 00 mov y, #0 ; 2 -1220 0A5B F7 0A mov a, [int1]+y ; 6 -1221 0A5D C4 0E movz (int3), a ; 4 -1222 0A5F FC inc y ; 2 -1223 0A60 F7 0A mov a, [int1]+y ; 6 -1224 0A62 C4 0F movz (int3+1),a ; 4 -1225 0A64 -1226 0A64 6F ret ; 5 } -1227 0A65 -1228 0A65 ;--------------------------------------------------------------------------------------------------- -1229 0A65 -1230 0A65 RESET_DSP_FILTER: -1231 0A65 8F 2C F2 mov $F2, #DSP_EVOLL ; 5 Reset Volume { 65 cycles -1232 0A68 8F 00 F3 mov $F3, #0 ; 5 -1233 0A6B 8F 3C F2 mov $F2, #DSP_EVOLR ; 5 -1234 0A6E 8F 00 F3 mov $F3, #0 ; 5 -1235 0A71 8F 2C F2 mov $F2, #DSP_EVOLL ; 5 -1236 0A74 8F 00 F3 mov $F3, #0 ; 5 -1237 0A77 -1238 0A77 8F 7D F2 mov $F2, #DSP_EDL ; 5 -1239 0A7A 8F 00 F3 mov $F3, #0 ; 5 -1240 0A7D -1241 0A7D 8F 6D F2 mov $F2, #DSP_ESA ; 5 -1242 0A80 8F FF F3 mov $F3, #$FF ; 5 -1243 0A83 -1244 0A83 8F 4D F2 mov $F2, #DSP_EON ; 5 -1245 0A86 8F 00 F3 mov $F3, #0 ; 5 -1246 0A89 -1247 0A89 6F ret ; 5 } -1248 0A8A -1249 0A8A RESET_DSP_VOICES: -1250 0A8A -1251 0A8A 8F 75 F2 mov $F2, #($70 | DSP_ADSR) -1252 0A8D 80 setc -1253 0A8E rdv_loop: -1254 0A8E 8F 00 F3 mov $F3, #0 -1255 0A91 AB F2 incz $F2 -1256 0A93 AB F2 incz $F2 -1257 0A95 8F 00 F3 mov $F3, #0 -1258 0A98 B8 12 F2 sbc $F2, #$12 -1259 0A9B 10 F1 bpl rdv_loop -1260 0A9D 6F ret -1261 0A9E -1262 0A9E XMS_Play: -1263 0A9E 78 01 B5 cmp (xms_playing), #1 -1264 0AA1 D0 03 bne _xmsp_notplaying -1265 0AA3 3F DA 0A call XMS_Stop -1266 0AA6 _xmsp_notplaying: -1267 0AA6 E5 07 21 mov a, (c_xmsoffset+xmso_spd); 4 -1268 0AA9 C4 AF movz (xms_speed), a ; 4 -1269 0AAB 8F 00 B1 mov (xms_position), #0 ; 5 -1270 0AAE -1271 0AAE ; setup initial panning & reset repeat bytes -1272 0AAE 8D 08 mov y, #8 -1273 0AB0 CD 70 mov x, #112 -1274 0AB2 _xmsp_ip_loop: -1275 0AB2 F6 0C 21 mov a, (c_xmsoffset+xmso_pn-1)+y -1276 0AB5 5C lsr a -1277 0AB6 5C lsr a -1278 0AB7 D4 25 movz (xms_channels+cso_panning)+x, a -1279 0AB9 7D mov a, x -1280 0ABA 80 setc -1281 0ABB A8 10 sbc a, #16 -1282 0ABD 5D mov x, a -1283 0ABE DC dec y -1284 0ABF D0 F1 bne _xmsp_ip_loop -1285 0AC1 -1286 0AC1 ; setup first pattern ; -1287 0AC1 E5 1E 21 mov a, (c_xmsoffset + xmso_orders) ; 4 -1288 0AC4 ; -1289 0AC4 3F 6B 0B call XMS_SetPattern ; ? -1290 0AC7 ; -1291 0AC7 E5 08 21 mov a, (c_xmsoffset+xmso_bpm) ; 4 -1292 0ACA 3F 11 0B call XMS_SetBPM ; 135 cycles -1293 0ACD ; -1294 0ACD 8F 40 C7 mov (xms_global_vol), #64 ; 5 -1295 0AD0 ; -1296 0AD0 8F 00 9E mov (xms_cc_flags), #0 ; 5 -1297 0AD3 ; -1298 0AD3 8F 01 B5 mov (xms_playing), #1 ; 5 -1299 0AD6 -1300 0AD6 3F 04 0B call XMS_ResetSamps -1301 0AD9 -1302 0AD9 6F ret ; 5 -1303 0ADA -1304 0ADA XMS_Stop: -1305 0ADA 3F 8A 0A call RESET_DSP_VOICES -1306 0ADD 8F 00 B5 mov (xms_playing), #0 -1307 0AE0 E8 77 mov a, #$77 -1308 0AE2 8D 00 mov y, #$00 -1309 0AE4 80 setc -1310 0AE5 _xmss_loop: -1311 0AE5 DA F2 movw ($F2), ya -1312 0AE7 A8 10 sbc a, #$10 -1313 0AE9 B0 FA bcs _xmss_loop -1314 0AEB 3F EF 0A call XMS_ClearChannels -1315 0AEE 6F ret -1316 0AEF -1317 0AEF XMS_ClearChannels: -1318 0AEF CD 7F mov x, #127 -1319 0AF1 E8 00 mov a, #0 -1320 0AF3 _xmscc_loop: -1321 0AF3 D5 1C 00 mov (xms_channels)+x, a -1322 0AF6 1D dec x -1323 0AF7 10 FA bpl _xmscc_loop -1324 0AF9 -1325 0AF9 CD 07 mov x, #7 -1326 0AFB E8 00 mov a, #0 -1327 0AFD _xmscc_vloop: -1328 0AFD D5 D1 00 mov (xms_final_volume)+x, a -1329 0B00 1D dec x -1330 0B01 10 FA bpl _xmscc_vloop -1331 0B03 -1332 0B03 6F ret -1333 0B04 -1334 0B04 XMS_ResetSamps: -1335 0B04 E8 7A mov a, #$70 + cso_sample -1336 0B06 8D FF mov y, #255 -1337 0B08 80 setc -1338 0B09 _xmscc_loop2: -1339 0B09 5D mov x, a -1340 0B0A DB 1C movz (xms_channels)+x, y -1341 0B0C A8 10 sbc a, #$10 -1342 0B0E B0 F9 bcs _xmscc_loop2 -1343 0B10 6F ret -1344 0B11 -1345 0B11 XMS_SetBPM: ;[124 cycles] -1346 0B11 ; a = bpm ; -1347 0B11 ; 32 = minimum ; -1348 0B11 C4 B0 movz (xms_bpm), a ; 4 { 42 cycles -1349 0B13 ; setup timer ; -1350 0B13 -1351 0B13 -1352 0B13 8F 00 F1 mov $F1, #%00000000 -1353 0B16 ; r-ba-210 -1354 0B16 -1355 0B16 ; compute 20000/bpm ; -1356 0B16 2D push a ; 4 -1357 0B17 FD mov y, a ; 2 -1358 0B18 E8 00 mov a, #0 ; 2 -1359 0B1A ; -1360 0B1A DA 0A movw (int1), ya ; 4 -1361 0B1C E8 20 mov a, #(20000 & 255) ; 2 -1362 0B1E 8D 4E mov y, #(20000 >> 8) ; 2 -1363 0B20 8F 00 16 mov (byte1), #0 ; 5 -1364 0B23 _xms_sbpm_divprep: ; -1365 0B23 5A 0A cmpw ya, (int1) ; 4 -1366 0B25 90 06 bcc _xms_sbpm_divready ; 2/4 -1367 0B27 9A 0A subw ya, (int1) ; 5 -1368 0B29 AB 16 incz (byte1) ; 4 -1369 0B2B 2F F6 b _xms_sbpm_divprep ; 4 } -1370 0B2D _xms_sbpm_divready: -1371 0B2D -1372 0B2D CE pop x ; 4 { 82 cycles -1373 0B2E 9E div ya, x ; 12 -1374 0B2F EB 16 movz y, (byte1) ; 3 -1375 0B31 ; ya = 20000/bpm -1376 0B31 DA 0C movw (int2), ya -1377 0B33 -1378 0B33 3F 53 0B call SPC_GetTimerValues01 -1379 0B36 C4 FA movz ($FA), a -1380 0B38 8F 00 CD mov (xms_clock), #0 -1381 0B3B CB CE movz (xms_clock_ticks), y -1382 0B3D -1383 0B3D BA 0C movw ya, (int2) -1384 0B3F 80 setc -1385 0B40 A8 0A sbc a, #ramp_size -1386 0B42 B0 01 bcs _xmssb_mr_good -1387 0B44 DC dec y -1388 0B45 _xmssb_mr_good: -1389 0B45 3F 53 0B call SPC_GetTimerValues01 -1390 0B48 C4 FB movz ($FB), a -1391 0B4A 8F 00 CF mov (xms_pclock), #0 -1392 0B4D CB D0 movz (xms_pclock_ticks), y -1393 0B4F -1394 0B4F 8F 03 F1 mov $F1, #%00000011 -1395 0B52 ; r-ba-210 -1396 0B52 -1397 0B52 6F ret ; 5 } -1398 0B53 -1399 0B53 SPC_GetTimerValues01: ;[51 cycles] -1400 0B53 ; ya = milliseconds*8 ; -1401 0B53 ;returns: ; -1402 0B53 ; y = countup ; -1403 0B53 ; a = timer value ; -1404 0B53 8F 01 0B mov (int1+1), #1 ; 5 reset counter { 13 cycles -1405 0B56 AD 00 cmp y, #0 ; 2 check if 8-bit value -1406 0B58 F0 0E beq _spcst_exit ; 2/4 nojump -1407 0B5A _spcst_slow: ; ---------------------- -1408 0B5A CB 0A movz (int1), y ; 4 move HI byte to ram } -1409 0B5C _spcst_inc_loop: ; -1410 0B5C 4B 0A lsrz (int1) ; 4 shift { 30 cycles (1 loop) -1411 0B5E F0 05 beq _spcst_no_inc ; 2/4 check -1412 0B60 7C ror a ; 2 timer/2 -1413 0B61 0B 0B aslz (int1+1) ; 4 counter*2 -1414 0B63 2F F7 b _spcst_inc_loop ; 4 loop -1415 0B65 _spcst_no_inc: ; -1416 0B65 7C ror a ; 2 timer/2 -1417 0B66 0B 0B aslz (int1+1) ; 4 counter*2 } -1418 0B68 _spcst_exit: ; -1419 0B68 EB 0B movz y, (int1+1) ; 3 load countup { 8 cycles -1420 0B6A 6F ret ; 5 return } -1421 0B6B -1422 0B6B XMS_SetPattern: -1423 0B6B ; a = pattern -1424 0B6B EC 16 21 mov y, c_xmsoffset+xmso_patto -1425 0B6E CB 0A movz (int1), y -1426 0B70 EC 17 21 mov y, c_xmsoffset+xmso_patto+1 -1427 0B73 CB 0B movz (int1+1), y -1428 0B75 -1429 0B75 ; mov (int1), (pattern_offsets) ; 5 { 90 cycles -1430 0B75 ; mov (int1+1), (pattern_offsets+1) ; 5 -1431 0B75 ; -1432 0B75 1C asl a ; 2 -1433 0B76 98 00 0B adc (int1+1), #0 ; 5 -1434 0B79 84 0A adcz a, (int1) ; 3 -1435 0B7B 98 00 0B adc (int1+1), #0 ; 5 -1436 0B7E C4 0A movz (int1), a ; 4 -1437 0B80 ; -1438 0B80 8D 00 mov y, #0 ; 2 -1439 0B82 ; -1440 0B82 F7 0A mov a, [int1]+y ; 6 -1441 0B84 C4 B6 movz (xms_pattern_read), a ; 4 -1442 0B86 FC inc y ; 2 -1443 0B87 F7 0A mov a, [int1]+y ; 6 -1444 0B89 C4 B7 movz (xms_pattern_read+1), a ; 4 -1445 0B8B ; -1446 0B8B 8D 00 mov y, #0 ; 2 -1447 0B8D F7 B6 mov a, [xms_pattern_read]+y ; 6 -1448 0B8F C4 B4 movz (xms_pattern_length), a ; 4 -1449 0B91 ; -1450 0B91 3A B6 incw (xms_pattern_read) -1451 0B93 ; -1452 0B93 8F 00 B2 mov (xms_row), #0 ; 5 -1453 0B96 8F 00 B3 mov (xms_tick), #0 ; 5 -1454 0B99 ; -1455 0B99 8F 00 CA mov (xms_patt_loop), #0 ; 5 -1456 0B9C 8F 00 CB mov (xms_patt_loop_row), #0 -1457 0B9F -1458 0B9F BA B6 movw ya, (xms_pattern_read) -1459 0BA1 DA C8 movw (xms_patt_loop_pos), ya -1460 0BA3 -1461 0BA3 ; clear REPEAT data -1462 0BA3 E8 00 mov a, #0 -1463 0BA5 8D 04 mov y, #4 -1464 0BA7 _xmssp_clearrep: -1465 0BA7 D6 B8 00 mov (xms_pattern_repeat-1)+y, a -1466 0BAA D6 BC 00 mov (xms_pattern_repeat+3)+y, a -1467 0BAD DC dec y -1468 0BAE D0 F7 bne _xmssp_clearrep -1469 0BB0 ; -1470 0BB0 6F ret ; 5 } -1471 0BB1 -1472 0BB1 XMS_VRamp: ;[100 cycles] -1473 0BB1 8D 9F mov y, #%10011111 ; 2 { 2 cycles } -1474 0BB3 13 CC 04 bbc0 (xms_peek), _xmsvr_1 ; 5/7 { 88 cycles -1475 0BB6 E8 07 mov a, #$07 ; 2 -1476 0BB8 DA F2 movw ($F2), ya ; 4 -1477 0BBA _xmsvr_1: ; -1478 0BBA 33 CC 04 bbc1 (xms_peek), _xmsvr_2 ; 5/7 -1479 0BBD E8 17 mov a, #$17 ; 2 -1480 0BBF DA F2 movw ($F2), ya ; 4` -1481 0BC1 _xmsvr_2: ; -1482 0BC1 53 CC 04 bbc2 (xms_peek), _xmsvr_3 ; 5/7 -1483 0BC4 E8 27 mov a, #$27 ; 2 -1484 0BC6 DA F2 movw ($F2), ya ; 4 -1485 0BC8 _xmsvr_3: ; -1486 0BC8 73 CC 04 bbc3 (xms_peek), _xmsvr_4 ; 5/7 -1487 0BCB E8 37 mov a, #$37 ; 2 -1488 0BCD DA F2 movw ($F2), ya ; 4 -1489 0BCF _xmsvr_4: ; -1490 0BCF 93 CC 04 bbc4 (xms_peek), _xmsvr_5 ; 5/7 -1491 0BD2 E8 47 mov a, #$47 ; 2 -1492 0BD4 DA F2 movw ($F2), ya ; 4 -1493 0BD6 _xmsvr_5: ; -1494 0BD6 B3 CC 04 bbc5 (xms_peek), _xmsvr_6 ; 5/7 -1495 0BD9 E8 57 mov a, #$57 ; 2 -1496 0BDB DA F2 movw ($F2), ya ; 4 -1497 0BDD _xmsvr_6: ; -1498 0BDD D3 CC 04 bbc6 (xms_peek), _xmsvr_7 ; 5/7 -1499 0BE0 E8 67 mov a, #$67 ; 2 -1500 0BE2 DA F2 movw ($F2), ya ; 4 -1501 0BE4 _xmsvr_7: ; -1502 0BE4 F3 CC 04 bbc7 (xms_peek), _xmsvr_8 ; 5/7 -1503 0BE7 E8 77 mov a, #$77 ; 2 -1504 0BE9 DA F2 movw ($F2), ya ; 4 -1505 0BEB _xmsvr_8: ; -1506 0BEB 8F 00 CC mov (xms_peek), #0 ; 5 { 10 cycles -1507 0BEE 5F 0C 0C jmp _VR_return ; 5 } -1508 0BF1 -1509 0BF1 ;------------------------------------------------------------------------------------------------------ -1510 0BF1 ; ACTIVE ROUTINES -1511 0BF1 ;------------------------------------------------------------------------------------------------------ -1512 0BF1 XMS_Player: ; [ first/other] -1513 0BF1 78 01 B5 cmp (xms_playing), #1 ; 5 check if XMS is playing { 33 cycles -1514 0BF4 F0 01 beq _xmsp_continue ; 2/4 -1515 0BF6 6F ret ; 5 return if not -1516 0BF7 _xmsp_continue: ; -1517 0BF7 -1518 0BF7 60 clrc -1519 0BF8 E4 FE movz a, ($FE) -1520 0BFA 84 CF adcz a, (xms_pclock) -1521 0BFC -1522 0BFC 64 D0 cmpz a, (xms_pclock_ticks) -1523 0BFE 90 0A bcc _xmsp_pcontinue -1524 0C00 8F 00 CF mov (xms_pclock), #0 -1525 0C03 E4 CC movz a, (xms_peek) -1526 0C05 F0 05 beq _xmsp_pskipr -1527 0C07 5F B1 0B jmp XMS_VRamp -1528 0C0A _xmsp_pcontinue: -1529 0C0A C4 CF movz (xms_pclock), a -1530 0C0C _xmsp_pskipr: -1531 0C0C _VR_return: -1532 0C0C -1533 0C0C 60 clrc ; 2 check timer -1534 0C0D E4 FD movz a, ($FD) ; 3 -1535 0C0F 84 CD adcz a, (xms_clock) ; 3 -1536 0C11 64 CE cmpz a, (xms_clock_ticks) ; 3 -1537 0C13 B0 03 bcs _xmsp_continue2 ; 2/4 -1538 0C15 C4 CD movz (xms_clock), a ; 4 -1539 0C17 6F ret ; 5 return if a tick hasn't passed -1540 0C18 _xmsp_continue2: -1541 0C18 -1542 0C18 8F 01 F1 mov $F1, #%00000001 ; reset -1543 0C1B ; r-ba-210 -1544 0C1B 8F 03 F1 mov $F1, #%00000011 ; set timers -1545 0C1E ; r-ba-210 -1546 0C1E -1547 0C1E 80 setc ; 2 edit timer values -1548 0C1F A4 CE sbcz a, (xms_clock_ticks) ; 3 -1549 0C21 C4 CD movz (xms_clock), a ; 4 } -1550 0C23 ; a tick has passed -1551 0C23 ; mov ($F4), xms_tick ; DEBUG, DELETE THIS -1552 0C23 ; mov ($F5), xms_row ; DEBUG, DELETE THIS -1553 0C23 ; mov $F5, xms_pattern_read -1554 0C23 ; mov $F4, xms_pattern_read+1 -1555 0C23 -1556 0C23 78 00 B3 cmp (xms_tick), #0 ; 5 { 9 cycles (first tick) -1557 0C26 F0 03 beq _xmsp_tick_first ; 2/4 -1558 0C28 5F EE 0D jmp _xmsp_tick_between ; 3 LONG JUMP } -1559 0C2B _xmsp_tick_first: -1560 0C2B -1561 0C2B ; tick is zero, get new data -1562 0C2B -1563 0C2B ; PATTERN DELAY HACK -1564 0C2B 78 00 C1 cmp (xms_patt_delay), #0 ; 5 { 14 cycles -1565 0C2E 8F 00 9D mov (xms_fxfirst), #0 -1566 0C31 F0 05 beq _xmsp_no_delay ; 2/4 -1567 0C33 8B C1 decz (xms_patt_delay) ; 4 pattern delay != 0, repeat other ticks -1568 0C35 5F EE 0D jmp _xmsp_tick_between ; 3 } -1569 0C38 _xmsp_no_delay: -1570 0C38 -1571 0C38 CD 00 mov x, #0 ; 2 reset channel index { 12 cycles -1572 0C3A 8D 01 mov y, #1 ; 2 reset pattern read offset, skipping peek byte -1573 0C3C -1574 0C3C ; loop through channels -1575 0C3C 8F 01 17 mov (channel_bit), #1 ; 5 reset -1576 0C3F E5 03 21 mov a, (c_xmsoffset+xmso_chn) ; 3 } -1577 0C42 -1578 0C42 _xmsp_channel_loop: ; ENTERING LOOP (8x) [2498 cycle peak] -1579 0C42 2D push a ; 4 { 37 cycles -1580 0C43 -1581 0C43 ; check repeat byte -1582 0C43 4D push x -1583 0C44 7D mov a, x -1584 0C45 9F xcn a -1585 0C46 5D mov x, a -1586 0C47 F4 B9 movz a, (xms_pattern_repeat)+x -1587 0C49 F0 2A beq _xmsp_read_normal -1588 0C4B 30 0D bmi _xmsp_repeat_empty -1589 0C4D _xmsp_repeat_norm: -1590 0C4D -1591 0C4D 8F 00 A0 mov (row_flags+1), #0 ; 5 -1592 0C50 38 02 9D and (xms_fxfirst), #%10 ; 5 -1593 0C53 -1594 0C53 9C dec a -1595 0C54 -1596 0C54 D4 B9 movz (xms_pattern_repeat)+x, a -1597 0C56 CE pop x -1598 0C57 -1599 0C57 ; repeat stuff... DOESN'T APPLY FOR NOTE/INST -1600 0C57 -1601 0C57 5F 22 0D jmp _xmsp_patt_repeated -1602 0C5A _xmsp_repeat_empty: -1603 0C5A 9C dec a -1604 0C5B 68 80 cmp a, #$80 -1605 0C5D D0 02 bne _xmsp_repeate_normally -1606 0C5F E8 00 mov a, #0 -1607 0C61 _xmsp_repeate_normally: -1608 0C61 -1609 0C61 8F 00 A0 mov (row_flags+1), #0 ; 5 -1610 0C64 38 02 9D and (xms_fxfirst), #%10 ; 5 -1611 0C67 -1612 0C67 D4 B9 movz (xms_pattern_repeat)+x, a -1613 0C69 CE pop x -1614 0C6A ; empty things... -1615 0C6A E8 00 mov a, #0 -1616 0C6C D4 1F movz (xms_channels+cso_volfx)+x, a -1617 0C6E D4 20 movz (xms_channels+cso_fx)+x, a -1618 0C70 D4 21 movz (xms_channels+cso_fxparam)+x, a -1619 0C72 5F 22 0D jmp _xmsp_patt_repeated -1620 0C75 -1621 0C75 _xmsp_read_normal: -1622 0C75 CE pop x -1623 0C76 -1624 0C76 F7 B6 mov a, [xms_pattern_read]+y ; 6 -1625 0C78 _xmsp_channel_continue: -1626 0C78 ; -1627 0C78 FC inc y ; 2 -1628 0C79 68 00 cmp a, #0 ; 2 check if MSB is set -1629 0C7B 30 06 bmi _xmsp_row_small ; 2/4 -1630 0C7D 8F AD 9F mov (row_flags), #%10101101 ; all follow -1631 0C80 DC dec y ; 2 -1632 0C81 2F 02 b _xmsp_row_large ; 4 skip -1633 0C83 _xmsp_row_small: -1634 0C83 C4 9F movz (row_flags), a ; 4 row is compressed -1635 0C85 _xmsp_row_large: ; -1636 0C85 -1637 0C85 ; row_flags hi-flags: ; -1638 0C85 ; 1 = set pitch ; -1639 0C85 ; 2 = set sample ; -1640 0C85 ; 3 = set volume ; -1641 0C85 8F 00 A0 mov (row_flags+1), #0 ; 5 -1642 0C88 38 02 9D and (xms_fxfirst), #%10 ; 5 } -1643 0C8B -1644 0C8B 33 9F 0C bbc1 (row_flags), _xmsp_no_instr -1645 0C8E _xmsp_yes_instr: -1646 0C8E 43 9F 3B bbs2 (row_flags), _xmsp_noter -1647 0C91 18 06 A0 or (row_flags+1), #%110 -1648 0C94 3F B4 0C call _xmsp_notecheck -1649 0C97 5F E0 0C jmp _xmsp_noteinst_finish -1650 0C9A -1651 0C9A _xmsp_no_instr: -1652 0C9A 3F B4 0C call _xmsp_notecheck -1653 0C9D 53 9F 11 bbc2 (row_flags), _xmsp_no_instrument -1654 0CA0 F7 B6 mov a, [xms_pattern_read]+y -1655 0CA2 FC inc y -1656 0CA3 9C dec a -1657 0CA4 65 04 21 cmp a, (c_xmsoffset+xmso_ins) -1658 0CA7 90 02 bcc _xmsp_inst_valid -1659 0CA9 E8 FF mov a, #255 -1660 0CAB _xmsp_inst_valid: -1661 0CAB BC inc a -1662 0CAC D4 1E movz (xms_channels+cso_inst)+x, a -1663 0CAE 18 06 A0 or (row_flags+1), #%110 -1664 0CB1 _xmsp_no_instrument: -1665 0CB1 -1666 0CB1 5F E0 0C jmp _xmsp_noteinst_finish -1667 0CB4 -1668 0CB4 _xmsp_notecheck: -1669 0CB4 13 9F 14 bbc0 (row_flags), _xmsp_notecheck_exit -1670 0CB7 F7 B6 mov a, [xms_pattern_read]+y -1671 0CB9 FC inc y -1672 0CBA 9C dec a -1673 0CBB 68 60 cmp a, #96 -1674 0CBD D0 04 bne _xmsp_note_NOTKEYOFF -1675 0CBF 3F 7F 1D call XMS_CHANNEL_ENV_KEYOFF -1676 0CC2 6F ret -1677 0CC3 _xmsp_note_NOTKEYOFF: -1678 0CC3 D4 23 movz (xms_channels+cso_note)+x, a -1679 0CC5 18 09 A0 or (row_flags+1), #%1001 -1680 0CC8 18 03 9D or (xms_fxfirst), #%11 -1681 0CCB _xmsp_notecheck_exit: -1682 0CCB 6F ret -1683 0CCC -1684 0CCC _xmsp_noter: -1685 0CCC 13 9F 0E bbc0 (row_flags), _xmsp_noter_i -1686 0CCF -1687 0CCF F7 B6 mov a, [xms_pattern_read]+y ; WASTE -1688 0CD1 FC inc y ; WASTE -1689 0CD2 9C dec a ; WASTE -1690 0CD3 65 04 21 cmp a, (c_xmsoffset+xmso_ins) ; WASTE -1691 0CD6 90 02 bcc _xmsp_inst_valid2 ; WASTE -1692 0CD8 E8 FF mov a, #255 ; WASTE -1693 0CDA _xmsp_inst_valid2: ; WASTE -1694 0CDA BC inc a ; WASTE -1695 0CDB D4 1E movz (xms_channels+cso_inst)+x, a ; WASTE -1696 0CDD -1697 0CDD _xmsp_noter_i: -1698 0CDD 18 0F A0 or (row_flags+1), #%1111 -1699 0CE0 -1700 0CE0 _xmsp_noteinst_finish: -1701 0CE0 -1702 0CE0 73 9F 0A bbc3 (row_flags), _xmsp_no_volume ; 5/7 check for volume fx { 27 cycles -1703 0CE3 F7 B6 mov a, [xms_pattern_read]+y ; 6 read -1704 0CE5 FC inc y ; 2 -1705 0CE6 D4 1F movz (xms_channels+3)+x, a ; 5 store -1706 0CE8 18 04 A0 or (row_flags+1), #%100 ; 5 -1707 0CEB 2F 04 b _xmsp_is_volume ; 4 -1708 0CED _xmsp_no_volume: ; -1709 0CED E8 00 mov a, #0 ; 2 store zero -1710 0CEF D4 1F movz (xms_channels+3)+x, a ; 5 } -1711 0CF1 _xmsp_is_volume: ; -1712 0CF1 -1713 0CF1 -1714 0CF1 93 9F 05 bbc4 (row_flags), _xmsp_fx_00 -1715 0CF4 _xmsp_fx_01: -1716 0CF4 A3 9F 19 bbs5 (row_flags), _xmsp_fx_11 -1717 0CF7 2F 1C b _xmsp_fx_exit -1718 0CF9 _xmsp_fx_00: -1719 0CF9 A3 9F 08 bbs5 (row_flags), _xmsp_fx_10 -1720 0CFC E8 00 mov a, #0 -1721 0CFE D4 20 movz (xms_channels+cso_fx)+x, a -1722 0D00 D4 21 movz (xms_channels+cso_fxparam)+x, a -1723 0D02 2F 11 b _xmsp_fx_exit -1724 0D04 _xmsp_fx_10: -1725 0D04 F7 B6 mov a, [xms_pattern_read]+y -1726 0D06 -1727 0D06 FC inc y -1728 0D07 D4 20 movz (xms_channels+cso_fx)+x, a -1729 0D09 F7 B6 mov a, [xms_pattern_read]+y -1730 0D0B FC inc y -1731 0D0C D4 21 movz (xms_channels+cso_fxparam)+x, a -1732 0D0E 2F 05 b _xmsp_fx_exit -1733 0D10 _xmsp_fx_11: -1734 0D10 F7 B6 mov a, [xms_pattern_read]+y -1735 0D12 FC inc y -1736 0D13 D4 21 movz (xms_channels+cso_fxparam)+x, a -1737 0D15 _xmsp_fx_exit: -1738 0D15 -1739 0D15 ; repeat stuff...? -1740 0D15 -1741 0D15 D3 9F 0A bbc6 (row_flags), _xmsp_norepeat -1742 0D18 ; a = repeat byte, store somewhere -1743 0D18 4D push x -1744 0D19 7D mov a, x -1745 0D1A 9F xcn a -1746 0D1B 5D mov x, a -1747 0D1C -1748 0D1C F7 B6 mov a, [xms_pattern_read]+y -1749 0D1E FC inc y -1750 0D1F -1751 0D1F D4 B9 movz (xms_pattern_repeat)+x, a -1752 0D21 CE pop x -1753 0D22 _xmsp_norepeat: -1754 0D22 -1755 0D22 _xmsp_patt_repeated: -1756 0D22 -1757 0D22 CB B8 movz (xms_pattern_plus), y ; 4 preserve read offset 4 cycles -1758 0D24 -1759 0D24 13 9F 15 bbc0 (row_flags), _xmsp_nonotecheckthingy ; 5/7 GLISSANDO HACK { 27 cycles -- only happens with glissando -1760 0D27 F4 20 movz a, (xms_channels+4)+x ; 4 -1761 0D29 68 03 cmp a, #3 ; 2 -1762 0D2B F0 0C beq _xmsp_omgdontsetnote ; 2/4 -1763 0D2D 68 05 cmp a, #5 ; 2 -1764 0D2F F0 08 beq _xmsp_omgdontsetnote ; 2/4 -1765 0D31 F4 1F movz a, (xms_channels+3)+x ; 4 -1766 0D33 28 F0 and a, #$F0 ; 2 -1767 0D35 68 F0 cmp a, #$F0 ; 2 -1768 0D37 D0 03 bne _xmsp_nonotecheckthingy ; 2/4 negated branch -1769 0D39 _xmsp_omgdontsetnote: ; -1770 0D39 38 06 A0 and (row_flags+1), #%0110 ; 5 overwrites note flag } -1771 0D3C _xmsp_nonotecheckthingy: ; -1772 0D3C -1773 0D3C 7D mov a, x ; dont change instrument settings while a sample is playing -1774 0D3D 9F xcn a -1775 0D3E FD mov y, a -1776 0D3F F6 DE 00 mov a, (samp_playing)+y -1777 0D42 D0 54 bne _xmsp_no_inst ;--------------- -1778 0D44 -1779 0D44 F4 1E movz a, (xms_channels+cso_inst)+x ; 4 { 16 cycles -1780 0D46 68 00 cmp a, #0 ; 2 -1781 0D48 D0 02 bne _xmsp_valid_instrument ; 2/4 -1782 0D4A E8 01 mov a, #1 ; 2 -1783 0D4C _xmsp_valid_instrument: ; -1784 0D4C 3F C0 0E call XMS_GetInstOffset ; 8+49 -1785 0D4F ; -1786 0D4F AA A0 20 mov1 c, (row_flags+1+(1<<13)) ; 4 -1787 0D52 90 44 bcc _xmsp_no_inst ; 2/4 } -1788 0D54 -1789 0D54 ; instrument value was set, get new sample -1790 0D54 -1791 0D54 8D 00 mov y, #c_inst_nsamps ; 2 get n_samples { 30 cycles -1792 0D56 F7 1A mov a, [cur_inst]+y ; 6 -1793 0D58 68 01 cmp a, #1 ; 2 -1794 0D5A -1795 0D5A D0 06 bne _xmsp_inst_samples_g1 ; 2/4 -1796 0D5C 8D 48 mov y, #c_inst_sampmap ; 2 monosampled instrument -1797 0D5E F7 1A mov a, [cur_inst]+y ; 6 -1798 0D60 ; -1799 0D60 2F 08 b _xmsp_inst_samples_e1 ; skip -1800 0D62 _xmsp_inst_samples_g1: -1801 0D62 F4 23 movz a, (xms_channels+7)+x ; 4 multisampled instrument -1802 0D64 60 clrc ; 2 -1803 0D65 88 48 adc a, #c_inst_sampmap ; 2 -1804 0D67 FD mov y, a ; 2 -1805 0D68 F7 1A mov a, [cur_inst]+y ; 6 } -1806 0D6A -1807 0D6A _xmsp_inst_samples_e1: -1808 0D6A -1809 0D6A ; a = samp number -1810 0D6A -1811 0D6A -1812 0D6A 74 26 cmpz a, (xms_channels+cso_sample)+x ; 4 check for sample change { 159 cycles -1813 0D6C F0 07 beq _xmsp_inst_nochange ; 2/4 -1814 0D6E D4 26 movz (xms_channels+cso_sample)+x, a ; 5 store -1815 0D70 C4 A7 movz (xms_cc_source), a ; 4 change source -1816 0D72 18 10 9E or (xms_cc_flags), #ccflag_source ; 5 set flag -1817 0D75 _xmsp_inst_nochange: ; -1818 0D75 -1819 0D75 3F E2 0E call XMS_GetSampleHeader ; 8+102 read sample header -1820 0D78 E4 A9 movz a, (xms_samp_head+xsh_vol) ; 3 get volume -1821 0D7A D4 22 movz (xms_channels+6)+x, a ; 5 -1822 0D7C C4 A5 movz (xms_cc_volume), a ; 4 store -1823 0D7E -1824 0D7E E4 AC movz a, (xms_samp_head+xsh_pan) ; 3 get panning -1825 0D80 10 02 bpl _xmsp_setpan_off -1826 0D82 D4 25 movz (xms_channels+9)+x, a ; 5 store -1827 0D84 _xmsp_setpan_off: -1828 0D84 -1829 0D84 18 0C 9E or (xms_cc_flags), #( ccflag_volume | ccflag_panning ) ; 5 } -1830 0D87 -1831 0D87 E8 FF mov a, #$FF ; 2 Reset Fadeout { 81 cycles -1832 0D89 D5 C4 10 mov (xms_channels_other+0)+x, a ; 6 -1833 0D8C D5 C5 10 mov (xms_channels_other+1)+x, a ; 6 -1834 0D8F 3F 64 1D call XMS_CHANNEL_ENV_RESET ; 8+48 -1835 0D92 -1836 0D92 E8 00 mov a, #0 ; 2 reset auto-vibrato sweep -1837 0D94 D4 24 movz (xms_channels+cso_avsweep)+x, a ; 5 -1838 0D96 -1839 0D96 2F 03 b _xmsp_is_inst ; 4 skip } -1840 0D98 _xmsp_no_inst: -1841 0D98 -1842 0D98 3F E2 0E call XMS_GetSampleHeader ; 8+102 read sample header { x cycles } (skipped) -1843 0D9B _xmsp_is_inst: -1844 0D9B -1845 0D9B 13 A0 0C bbc0 (row_flags+1), _xmsp_no_note_entry ; 5/7 Check for note { 85 cycles -1846 0D9E F4 23 movz a, (xms_channels+cso_note)+x -1847 0DA0 3F 13 0F call XMS_GetPeriod ; 8+57 get period -1848 0DA3 D4 1C movz (xms_channels+0)+x, a ; 5 store -1849 0DA5 DB 1D movz (xms_channels+1)+x, y ; 5 -1850 0DA7 18 03 9E or (xms_cc_flags), #(ccflag_pitch | ccflag_keyon) ; 5 set flag } -1851 0DAA -1852 0DAA _xmsp_no_note_entry: -1853 0DAA -1854 0DAA ; get channel information -1855 0DAA F4 1C movz a, (xms_channels+0)+x ; 4 period { 28 cycles -1856 0DAC FB 1D movz y, (xms_channels+1)+x ; 4 -1857 0DAE DA A1 movw (xms_cc_period), ya ; 4 -1858 0DB0 F4 22 movz a, (xms_channels+cso_vol)+x ; 4 volume -1859 0DB2 C4 A5 movz (xms_cc_volume), a ; 4 -1860 0DB4 F4 25 movz a, (xms_channels+9)+x ; 4 panning -1861 0DB6 C4 A6 movz (xms_cc_panning), a ; 4 -1862 0DB8 -1863 0DB8 18 02 9E or (xms_cc_flags), #ccflag_pitch -1864 0DBB ; } -1865 0DBB F5 D3 10 mov a, (xms_channels_other+coso_ndelay)+x -1866 0DBE D0 06 bne _xmsp_nd1 -1867 0DC0 3F 8E 1F call XMS_AV_UPDATE ; 8+213 { 1848 cycles -1868 0DC3 ; -1869 0DC3 3F AA 0F call XMS_ProcessVolumeEffect ; 8+112 -1870 0DC6 ; -1871 0DC6 _xmsp_nd1: -1872 0DC6 3F D4 12 call XMS_ProcessMainEffect ; 8+217 -1873 0DC9 ; -1874 0DC9 F5 D3 10 mov a, (xms_channels_other+coso_ndelay)+x -1875 0DCC D0 06 bne _xmsp_nd2 -1876 0DCE 3F A9 1D call XMS_CHANNEL_ENV_ROUTINE ; 8+628 -1877 0DD1 ; -1878 0DD1 3F 27 1B call XMS_CHANNEL_UPDATEDSP ; 8+638 } -1879 0DD4 -1880 0DD4 -1881 0DD4 _xmsp_nd2: -1882 0DD4 -1883 0DD4 0B 17 aslz (channel_bit) ; 4 shift channel bit { 8 cycles -1884 0DD6 -1885 0DD6 EB B8 movz y, (xms_pattern_plus) ; 4 restore pattern reader } -1886 0DD8 _xmsp_channel_next: ; -1887 0DD8 60 clrc ; 2 increment channel offset { 21 cycles -1888 0DD9 7D mov a, x ; 2 -1889 0DDA 88 10 adc a, #16 ; 2 -1890 0DDC 5D mov x, a ; 2 -1891 0DDD AE pop a ; 4 restore loop counter -1892 0DDE 9C dec a ; 4 -1893 0DDF -1894 0DDF F0 03 beq _xmsp_channel_exit ; 2/4 long cbranch -1895 0DE1 5F 42 0C jmp _xmsp_channel_loop ; 3 } -1896 0DE4 _xmsp_channel_exit: ;------------------------------------------------------------ -1897 0DE4 -1898 0DE4 DD mov a, y ; 2 add y to pattern read offset { 18 cycles -1899 0DE5 84 B6 adcz a, (xms_pattern_read) ; 3 -1900 0DE7 98 00 B7 adc (xms_pattern_read+1), #0 ; 5 -1901 0DEA C4 B6 movz (xms_pattern_read), a ; 4 -1902 0DEC -1903 0DEC 2F 45 b _xmsp_tick_notbetween ; 4 skip } -1904 0DEE -1905 0DEE _xmsp_tick_between: ; ON OTHER TICKS... -1906 0DEE -1907 0DEE CD 00 mov x, #0 ; 2 reset channel offset { 11 cycles -1908 0DF0 E5 03 21 mov a, (c_xmsoffset+xmso_chn) ; 4 -1909 0DF3 8F 01 17 mov (channel_bit), #1 ; 5 reset channel bit } -1910 0DF6 _xmsptb_loop: ; [2347 cycles other :O] -1911 0DF6 2D push a ; 4 preserve loop counter { 171 cycles -1912 0DF7 -1913 0DF7 F4 1E movz a, (xms_channels+cso_inst)+x ; 4 -1914 0DF9 3F C0 0E call XMS_GetInstOffset ; 8+49 Get Inst Offset -1915 0DFC 3F E2 0E call XMS_GetSampleHeader ; 8+98 Get Samp Header } -1916 0DFF -1917 0DFF ; get channel information -1918 0DFF F4 1C movz a, (xms_channels+0)+x ; 4 ..... { 28 cycles -1919 0E01 FB 1D movz y, (xms_channels+1)+x ; 4 -1920 0E03 DA A1 movw (xms_cc_period), ya ; 4 -1921 0E05 F4 22 movz a, (xms_channels+cso_vol)+x ; 4 -1922 0E07 C4 A5 movz (xms_cc_volume), a ; 4 -1923 0E09 F4 25 movz a, (xms_channels+9)+x ; 4 -1924 0E0B C4 A6 movz (xms_cc_panning), a ; 4 } -1925 0E0D -1926 0E0D F5 D3 10 mov a, (xms_channels_other+coso_ndelay)+x -1927 0E10 D0 06 bne _xmsp_ndo1 -1928 0E12 3F 8E 1F call XMS_AV_UPDATE ; 8+213 { 2130 cycles -1929 0E15 ; -1930 0E15 3F AA 0F call XMS_ProcessVolumeEffect ; 8+237 -1931 0E18 _xmsp_ndo1: -1932 0E18 E8 00 mov a, #0 ; 2 -1933 0E1A 3F D4 12 call XMS_ProcessMainEffect ; 8+256 -1934 0E1D ; -1935 0E1D F5 D3 10 mov a, (xms_channels_other+coso_ndelay)+x -1936 0E20 D0 06 bne _xmsp_ndo2 -1937 0E22 3F A9 1D call XMS_CHANNEL_ENV_ROUTINE ; 8+628 -1938 0E25 ; -1939 0E25 3F 27 1B call XMS_CHANNEL_UPDATEDSP ; 8+752 -1940 0E28 ; -1941 0E28 _xmsp_ndo2: -1942 0E28 0B 17 aslz (channel_bit) ; 4 shift channel bit } -1943 0E2A -1944 0E2A 60 clrc ; 2 Update counters { 18 cycles -1945 0E2B 7D mov a, x ; 2 -1946 0E2C 88 10 adc a, #16 ; 2 -1947 0E2E 5D mov x, a ; 2 -1948 0E2F AE pop a ; 4 -1949 0E30 9C dec a ; 2 -1950 0E31 D0 C3 bne _xmsptb_loop ; 2/4 loop } -1951 0E33 -1952 0E33 _xmsp_tick_notbetween: ;------------------------------------------------------ -1953 0E33 -1954 0E33 AB B3 incz (xms_tick) ; 4 increment tick { 28 (if pattern delay) -1955 0E35 69 AF B3 cmp (xms_tick), (xms_speed) ; 6 -1956 0E38 F0 03 beq _xmsp_tick_norestartj1 ; 2/4 ; REVERSE -1957 0E3A 5F BF 0E jmp _xmsp_tick_norestart -1958 0E3D _xmsp_tick_norestartj1 -1959 0E3D -1960 0E3D 8F 00 B3 mov (xms_tick), #0 ; 5 -1961 0E40 78 00 C1 cmp (xms_patt_delay), #0 ; 5 check pattern delay -1962 0E43 F0 02 beq _xmsp_no_delay2 ; 2/4 pattern delay long branch } -1963 0E45 -1964 0E45 2F 78 b _xmsp_tick_norestart ; 4 { 4 cycles } -1965 0E47 _xmsp_no_delay2: -1966 0E47 E5 CA 00 mov a, (xms_patt_loop) ; 3 get pattern loop var { 7/9 cycles -1967 0E4A 28 F0 and a, #$F0 ; 2 check pattern loop -1968 0E4C F0 1A beq _xmsp_pattern_loop_no ; 2/4 } -1969 0E4E -1970 0E4E FA CB B2 mov (xms_row), (xms_patt_loop_row) ; 5 rewind row { 24 cycles -1971 0E51 FA C8 B6 mov (xms_pattern_read), (xms_patt_loop_pos) ; 5 -1972 0E54 FA C9 B7 mov (xms_pattern_read+1), (xms_patt_loop_pos+1) ; 5 -1973 0E57 E8 00 mov a, #0 -1974 0E59 8D 00 mov y, #0 -1975 0E5B DA B9 movw (xms_pattern_repeat+0), ya -1976 0E5D DA BB movw (xms_pattern_repeat+2), ya -1977 0E5F DA BD movw (xms_pattern_repeat+4), ya -1978 0E61 DA BF movw (xms_pattern_repeat+6), ya -1979 0E63 38 0F CA and (xms_patt_loop), #$0F ; 5 -1980 0E66 2F 57 b _xmsp_tick_norestart ; 4 } -1981 0E68 -1982 0E68 _xmsp_pattern_loop_no: -1983 0E68 78 01 C4 cmp (xms_patt_jump_enable), #1 ; 5 check patt jump { 22 cycles -1984 0E6B D0 29 bne _xmsp_noPjump ; 2/4 -1985 0E6D 8F 00 C4 mov (xms_patt_jump_enable), #0 ; 5 disable -1986 0E70 E5 C2 00 mov a, (xms_patt_jump) ; 3 get jump index -1987 0E73 65 02 21 cmp a, (c_xmsoffset+xmso_len) ; 3 -1988 0E76 90 02 bcc _xmsp_pattjump_valid ; 2/4 -1989 0E78 E8 00 mov a, #0 ; 2 } -1990 0E7A _xmsp_pattjump_valid: ; -1991 0E7A C4 B1 movz (xms_position), a ; 4 set position { 134 cycles -1992 0E7C FD mov y, a ; 2 -1993 0E7D F6 1E 21 mov a, (c_xmsoffset + xmso_orders)+y ; 5 -1994 0E80 3F 6B 0B call XMS_SetPattern ; 8+90 set pattern -1995 0E83 60 clrc ; 2 -1996 0E84 E4 C3 movz a, (xms_patt_jump+1) ; 3 add offset... -1997 0E86 C4 B2 movz (xms_row), a ; 4 -1998 0E88 89 C5 B6 adc (xms_pattern_read), (xms_patt_jump_offset) ; 6 -1999 0E8B 89 C6 B7 adc (xms_pattern_read+1), (xms_patt_jump_offset+1) ; 6 -2000 0E8E E8 00 mov a, #0 -2001 0E90 C4 C5 movz (xms_patt_jump_offset), a -2002 0E92 C4 C6 movz (xms_patt_jump_offset+1), a -2003 0E94 2F 21 b _xmsp_tick_restarted ; 4 } -2004 0E96 _xmsp_noPjump: -2005 0E96 AB B2 incz (xms_row) ; 4 increment row { 16 cycles -2006 0E98 F0 07 beq _xmsp_tick_restart ; 2/4 branch if zero -2007 0E9A 69 B4 B2 cmp (xms_row), (xms_pattern_length) ; 6 compare w/ patt length -2008 0E9D 90 18 bcc _xmsp_tick_restarted ; 2/4 branch if <= -2009 0E9F F0 16 beq _xmsp_tick_restarted ; 2/4 } -2010 0EA1 _xmsp_tick_restart: -2011 0EA1 -2012 0EA1 AB B1 incz (xms_position) ; 4 increment position index { 119 cycles -2013 0EA3 E4 B1 movz a, (xms_position) ; 3 -2014 0EA5 65 02 21 cmp a, (c_xmsoffset+xmso_len) ; 4 compare with length of song -2015 0EA8 90 06 bcc _xmsp_notendofsong ; 2/4 -2016 0EAA E5 0C 21 mov a, (c_xmsoffset+xmso_restart) -2017 0EAD C5 B1 00 mov (xms_position), a -2018 0EB0 _xmsp_notendofsong: ; -2019 0EB0 FD mov y, a ; 2 -2020 0EB1 F6 1E 21 mov a, (c_xmsoffset + xmso_orders)+y ; 4 read order table -2021 0EB4 3F 6B 0B call XMS_SetPattern ; 8+90 set pattern } -2022 0EB7 _xmsp_tick_restarted: -2023 0EB7 -2024 0EB7 XMS_NotePeek: ;[15 cycles] (inline) -2025 0EB7 8D 00 mov y, #0 ; 2 -2026 0EB9 F7 B6 mov a, [xms_pattern_read]+y ; 6 -2027 0EBB 04 CC orz a, (xms_peek) ; 3 -2028 0EBD C4 CC movz (xms_peek), a ; 4 -2029 0EBF -2030 0EBF _xmsp_tick_norestart: -2031 0EBF -2032 0EBF 6F ret ; 5 return!! { 5 cycles } -2033 0EC0 -2034 0EC0 ;---------------------------------------------------------------------------------------------------- -2035 0EC0 XMS_GetInstOffset: ;[49 cycles] -2036 0EC0 ; a = inst ; -2037 0EC0 9C dec a ; 2 int3 = inst_offset in table.... { 20 cycles -2038 0EC1 1C asl a ; 2 -2039 0EC2 EC 18 21 mov y, c_xmsoffset+xmso_insto -2040 0EC5 CB 0E movz (int3), y -2041 0EC7 EC 19 21 mov y, c_xmsoffset+xmso_insto+1 -2042 0ECA CB 0F movz (int3+1), y ; EDITED AREA -2043 0ECC -2044 0ECC 84 0E adcz a, (int3) -2045 0ECE -2046 0ECE ; adcz a, (inst_offsets) ; 3 -2047 0ECE C4 0E movz (int3), a ; 4 -2048 0ED0 E8 00 mov a, #0 ; 2 -2049 0ED2 -2050 0ED2 84 0F adcz a, (int3+1) -2051 0ED4 ; adcz a, (inst_offsets+1) ; 3 -2052 0ED4 C4 0F movz (int3+1), a ; 4 } -2053 0ED6 -2054 0ED6 8D 01 mov y, #1 ; 2 cur_inst = inst_offset... { 29 cycles -2055 0ED8 F7 0E mov a, [int3]+y ; 6 -2056 0EDA C4 1B movz (cur_inst+1), a ; 4 -2057 0EDC DC dec y ; 2 -2058 0EDD F7 0E mov a, [int3]+y ; 6 -2059 0EDF C4 1A movz (cur_inst), a ; 4 -2060 0EE1 6F ret ; 5 } -2061 0EE2 -2062 0EE2 XMS_GetSampleHeader: ;[102 cycles] -2063 0EE2 ; x = channel buffer offset ; -2064 0EE2 F4 26 movz a, (xms_channels+10)+x ; 4 get offset { 47 cycles -2065 0EE4 ; -2066 0EE4 1C asl a ; 2 -2067 0EE5 -2068 0EE5 EC 1B 21 mov y, c_xmsoffset+xmso_sampo+1 -2069 0EE8 CC 0B 00 mov (int1+1), y ; EDITED AREA -2070 0EEB -2071 0EEB 85 1A 21 adc a, c_xmsoffset+xmso_sampo -2072 0EEE -2073 0EEE ; adcz a, (samp_offsets) ; 3 -2074 0EEE C4 0A movz (int1), a ; 4 -2075 0EF0 ; mov (int1+1), (samp_offsets+1) ; 5 -2076 0EF0 98 00 0B adc (int1+1), #0 ; 5 -2077 0EF3 8D 01 mov y, #1 ; 2 -2078 0EF5 F7 0A mov a, [int1]+y ; 6 -2079 0EF7 C4 11 movz (int4+1), a ; 4 -2080 0EF9 DC dec y ; 2 -2081 0EFA F7 0A mov a, [int1]+y ; 6 -2082 0EFC C4 10 movz (int4), a ; 4 } -2083 0EFE ; -2084 0EFE F7 10 mov a, [int4]+y ; 6 { 55 cycles -2085 0F00 C4 AA movz (xms_samp_head+xsh_ft), a -2086 0F02 -2087 0F02 8D 01 mov y, #1 ; 2 -2088 0F04 F7 10 mov a, [int4]+y ; 6 -2089 0F06 C4 A9 movz (xms_samp_head+xsh_vol), a ; 4 -2090 0F08 FC inc y ; 2 -2091 0F09 F7 10 mov a, [int4]+y ; 6 -2092 0F0B C4 AC movz (xms_samp_head+xsh_pan), a ; 4 -2093 0F0D FC inc y ; 2 -2094 0F0E F7 10 mov a, [int4]+y ; 6 -2095 0F10 C4 AD movz (xms_samp_head+xsh_note), a ; 4 -2096 0F12 6F ret ; 5 } -2097 0F13 -2098 0F13 XMS_GetPeriod: -2099 0F13 00 nop ; <-- MODIFICATION SPACE (BRANCH) -2100 0F14 00 nop ; -2101 0F15 -2102 0F15 XMS_GetLinearPeriod: ; [57 cycles] / -2103 0F15 ; period = 7680 - realnote*64 - finetune/2 ; ____________/ -2104 0F15 ; x = channel buffer offset ;/ -2105 0F15 ; return: ; -2106 0F15 ; ya = period ; -2107 0F15 ; x is preserved ; -2108 0F15 60 clrc ; 2 { 23 cycles -2109 0F16 F4 23 movz a, (xms_channels+7)+x ; 4 get note -2110 0F18 84 AD adcz a, (xms_samp_head+xsh_note) ; 3 add rel note -2111 0F1A ; -2112 0F1A 90 06 bcc _xmsgp_nc ; 2/4 clamp to range -2113 0F1C 68 00 cmp a, #0 ; 2 -2114 0F1E 10 02 bpl _xmsgp_nc ; 2/4 -2115 0F20 E8 00 mov a, #0 ; 2 -2116 0F22 _xmsgp_nc: ; -2117 0F22 68 60 cmp a, #96 ; 2 -2118 0F24 90 02 bcc _xmsgp_a_96 ; 2/4 -2119 0F26 E8 5F mov a, #95 ; 2 } -2120 0F28 _xmsgp_a_96: ; -2121 0F28 ; -2122 0F28 8D 40 mov y, #64 ; 2 get note*64 { 24 cycles -2123 0F2A CF mul ya ; 9 -2124 0F2B DA 0A movw (int1), ya ; 4 -2125 0F2D E8 00 mov a, #$00 ; 2 get 7680-note*64 -2126 0F2F 8D 1E mov y, #$1E ; 2 -2127 0F31 9A 0A subw ya, (int1) ; 5 } -2128 0F33 -2129 0F33 9A AA subw ya, (xms_samp_head+xsh_ft) ; 5 subtract finetune { 10 cycles -2130 0F35 6F ret ; 5 } -2131 0F36 -2132 0F36 XMS_GetAmigaPeriod: -2133 0F36 ; period = AFT[ (note % 12)*32 + finetune ] >> note \ 12 -2134 0F36 -2135 0F36 60 clrc ; 2 { 23 cycles get note -2136 0F37 84 AD adcz a, (xms_samp_head+xsh_note) ; 3 -2137 0F39 -2138 0F39 90 06 bcc _xmsgap_nc ; 2/4 -2139 0F3B 68 00 cmp a, #0 ; 2 -2140 0F3D 10 02 bpl _xmsgap_nc ; 2/4 -2141 0F3F E8 00 mov a, #0 ; 2 -2142 0F41 _xmsgap_nc: ; -2143 0F41 68 60 cmp a, #96 ; 2 -2144 0F43 90 02 bcc _xmsgap_a_96 ; 2/4 -2145 0F45 E8 5F mov a, #95 ; 2 -2146 0F47 _xmsgap_a_96: ; } -2147 0F47 -2148 0F47 8D 00 mov y, #0 ; 2 { 28 cycles divide -2149 0F49 4D push x ; 4 -2150 0F4A CD 0C mov x, #12 ; 2 -2151 0F4C 9E div ya, x ; 12 -2152 0F4D CE pop x ; 4 -2153 0F4E ; a = note\12 ; -2154 0F4E ; y = note%12 (0-11) ; -2155 0F4E ; -2156 0F4E 2D push a ; 4 } -2157 0F4F -2158 0F4F E8 40 mov a, #64 ; "ya = y << 6" ; 2 { 48 cycles fetch value -2159 0F51 CF mul ya ; ; 9 -2160 0F52 -2161 0F52 -2162 0F52 7A AA addw ya, (xms_samp_head+xsh_ft) ; ADD $0300 TO FINETUNE!; 5 -2163 0F54 -2164 0F54 -2165 0F54 DA 0A movw (int1), ya ; 4 -2166 0F56 8D 00 mov y, #0 ; 2 -2167 0F58 F7 0A mov a, [int1]+y ; 6 -2168 0F5A C4 0E movz (int3), a ; 4 -2169 0F5C FC inc y ; 2 -2170 0F5D F7 0A mov a, [int1]+y ; 6 -2171 0F5F EE pop y ; 4 } -2172 0F60 -2173 0F60 _xmsgap_shift: -2174 0F60 5C lsr a ; 2 { 12 cycles shift { VARIABLE LOOP, 84 cycles max } -2175 0F61 6B 0E rorz (int3) ; 4 -2176 0F63 DC dec y ; 2 -2177 0F64 D0 FA bne _xmsgap_shift ; 2/4 } -2178 0F66 FD mov y, a ; 2 { 10 cycles return -2179 0F67 E4 0E movz a, (int3) ; 3 -2180 0F69 -2181 0F69 6F ret ; 5 } -2182 0F6A -2183 0F6A ;-------------------------------------------------------------------------------------- -2184 0F6A ; Volume Effect Table -2185 0F6A table_veffect_first: -2186 0F6A C4 0F .word XMS_VFX_UNUSED ; 0 Do Nothing -2187 0F6C C6 0F .word XMS_VFX_VOLUMEf ; 1 Set Volume 0-15 -2188 0F6E C6 0F .word XMS_VFX_VOLUMEf ; 2 Set Volume 16-31 -2189 0F70 C6 0F .word XMS_VFX_VOLUMEf ; 3 Set Volume 32-47 -2190 0F72 C6 0F .word XMS_VFX_VOLUMEf ; 4 Set Volume 48-63 -2191 0F74 C6 0F .word XMS_VFX_VOLUMEf ; 5 Set Volume 64 -2192 0F76 C4 0F .word XMS_VFX_UNUSED ; 6 Volume Slide Down -2193 0F78 C4 0F .word XMS_VFX_UNUSED ; 7 Volume Slide Up -2194 0F7A EC 0F .word XMS_VFX_FINEVOLDf ; 8 Fine Volume Slide Down -2195 0F7C F7 0F .word XMS_VFX_FINEVOLUf ; 9 Fine Volume Slide Up -2196 0F7E 02 10 .word XMS_VFX_VIBSPEEDf ; A Vibrato (set speed) -2197 0F80 40 10 .word XMS_VFX_VIBDEPTHf ; B Vibrato (set depth) -2198 0F82 54 10 .word XMS_VFX_PANNINGf ; C Set Panning -2199 0F84 C4 0F .word XMS_VFX_UNUSED ; D Panning Slide Left -2200 0F86 C4 0F .word XMS_VFX_UNUSED ; E Panning Slide Right -2201 0F88 A4 10 .word XMS_VFX_GLISSANDOf ; F Glissando -2202 0F8A -2203 0F8A table_veffect_other: -2204 0F8A C4 0F .word XMS_VFX_UNUSED -2205 0F8C D4 0F .word XMS_VFX_VOLUMEo -2206 0F8E D4 0F .word XMS_VFX_VOLUMEo -2207 0F90 D4 0F .word XMS_VFX_VOLUMEo -2208 0F92 D4 0F .word XMS_VFX_VOLUMEo -2209 0F94 D4 0F .word XMS_VFX_VOLUMEo -2210 0F96 D6 0F .word XMS_VFX_VOLSLIDEDo -2211 0F98 E1 0F .word XMS_VFX_VOLSLIDEUo -2212 0F9A C4 0F .word XMS_VFX_UNUSED -2213 0F9C C4 0F .word XMS_VFX_UNUSED -2214 0F9E 2C 10 .word XMS_VFX_VIBSPEEDo -2215 0FA0 2C 10 .word XMS_VFX_VIBSPEEDo -2216 0FA2 69 10 .word XMS_VFX_PANNINGo -2217 0FA4 6C 10 .word XMS_VFX_PANSLIDELo -2218 0FA6 87 10 .word XMS_VFX_PANSLIDERo -2219 0FA8 B0 10 .word XMS_VFX_GLISSANDOo -2220 0FAA -2221 0FAA XMS_ProcessVolumeEffect: ;[112/240 first/other] -2222 0FAA ; x = channel * 16 ; -2223 0FAA ; return: ; -2224 0FAA ; x = preserved ; -2225 0FAA 4D push x ; 4 preserve x { 11/13 cycles -2226 0FAB 78 00 B3 cmp (xms_tick), #0 ; 5 check tick -2227 0FAE D0 0A bne _xmspve_other_ticks ; 2/4 } -2228 0FB0 _xmspve_first_tick: ; -2229 0FB0 F4 1F movz a, (xms_channels+3)+x ; 4 jump to effect routine (first) { 92 cycles -2230 0FB2 9F xcn a ; 5 -2231 0FB3 28 0F and a, #15 ; 2 -2232 0FB5 1C asl a ; 2 -2233 0FB6 5D mov x, a ; 2 -2234 0FB7 1F 6A 0F jmp [table_veffect_first+x] ; 6+71 (get maximum cycle effect) } -2235 0FBA _xmspve_other_ticks: ; -2236 0FBA F4 1F movz a, (xms_channels+3)+x ; 4 jump to effect routine (other) { 220 cycles -2237 0FBC 9F xcn a ; 5 -2238 0FBD 28 0F and a, #15 ; 2 -2239 0FBF 1C asl a ; 2 -2240 0FC0 5D mov x, a ; 2 -2241 0FC1 1F 8A 0F jmp [table_veffect_other+x] ; 6+199 (maximum cycle effect [vibrato]) } -2242 0FC4 _xmspve_exit: ; -2243 0FC4 CE pop x ; 4 { 9 cycles -2244 0FC5 6F ret ; 5 } -2245 0FC6 -2246 0FC6 XMS_VFX_UNUSED =_xmspve_exit -2247 0FC6 -2248 0FC6 ; VOLUME EFFECT 1-5 : SET VOLUME -------------------------------------------------------------------------------------- -2249 0FC6 XMS_VFX_VOLUMEf: ; [34 cycles] -2250 0FC6 CE pop x ; 4 -2251 0FC7 4D push x ; 4 -2252 0FC8 F4 1F movz a, (xms_channels+3)+x ; 4 read value -2253 0FCA 80 setc ; 2 -2254 0FCB A8 10 sbc a, #$10 ; 2 get $10-value -2255 0FCD D4 22 movz (xms_channels+6)+x, a ; 5 store -2256 0FCF C4 A5 movz (xms_cc_volume), a ; 4 store -2257 0FD1 18 04 9E or (xms_cc_flags), #ccflag_volume ; 5 set flag -2258 0FD4 -2259 0FD4 XMS_VFX_VOLUMEo: ; -2260 0FD4 2F EE b _xmspve_exit ; 4 -2261 0FD6 -2262 0FD6 #ifdef VFX_INCLUDE_EXTENDED -2263 0FD6 -2264 0FD6 ; VOLUME EFFECT 6 : VOLUME SLIDE DOWN ----------------------------------------------------------------------------------- -2265 0FD6 ;XMS_VFX_VOLSLIDEDf: -2266 0FD6 ; b _xmspve_exit -2267 0FD6 XMS_VFX_VOLSLIDEDo: ;[59 cycles] -2268 0FD6 CE pop x ; 4 get chan -2269 0FD7 4D push x ; 4 -2270 0FD8 F4 1F movz a, (xms_channels+3)+x ; 4 read value -2271 0FDA 28 0F and a, #15 ; 2 and -2272 0FDC 3F F2 1C call XMS_CHANNEL_VOLSLIDEd ; 8+33 slide -2273 0FDF 2F E3 b _xmspve_exit ; 4 -2274 0FE1 -2275 0FE1 ; VOLUME EFFECT 7 : VOLUME SLIDE UP ----------------------------------------------------------------------------------- -2276 0FE1 ;XMS_VFX_VOLSLIDEUf: -2277 0FE1 ; b _xmspve_exit -2278 0FE1 XMS_VFX_VOLSLIDEUo: ;[57 cycles] -2279 0FE1 CE pop x ; 4 get chan -2280 0FE2 4D push x ; 4 -2281 0FE3 F4 1F movz a, (xms_channels+3)+x ; 4 read value -2282 0FE5 28 0F and a, #15 ; 2 and -2283 0FE7 3F E1 1C call XMS_CHANNEL_VOLSLIDEu ; 8+31 slide -2284 0FEA 2F D8 b _xmspve_exit ; 4 -2285 0FEC -2286 0FEC ; VOLUME EFFECT 8 : FINE VOLUME SLIDE DOWN ----------------------------------------------------------------------------------- -2287 0FEC XMS_VFX_FINEVOLDf: ;[59 cycles] -2288 0FEC CE pop x ; 4 get chan -2289 0FED 4D push x ; 4 -2290 0FEE F4 1F movz a, (xms_channels+3)+x ; 4 read value -2291 0FF0 28 0F and a, #15 ; 2 and -2292 0FF2 3F F2 1C call XMS_CHANNEL_VOLSLIDEd ; 8+33 slide -2293 0FF5 XMS_VFX_FINEVOLDo: ; -2294 0FF5 2F CD b _xmspve_exit ; 4 -2295 0FF7 -2296 0FF7 ; VOLUME EFFECT 9 : FINE VOLUME SLIDE UP ----------------------------------------------------------------------------------- -2297 0FF7 XMS_VFX_FINEVOLUf: ;[53 cycles] -2298 0FF7 CE pop x ; 4 get chan -2299 0FF8 4D push x ; 4 -2300 0FF9 F4 1F movz a, (xms_channels+3)+x ; 4 read value -2301 0FFB 28 0F and a, #15 ; 2 and -2302 0FFD 3F E1 1C call XMS_CHANNEL_VOLSLIDEu ; 8+31 slide -2303 1000 XMS_VFX_FINEVOLUo: ; -2304 1000 2F C2 b _xmspve_exit ; 4 -2305 1002 -2306 1002 ; VOLUME EFFECT A : VIBRATO SPEED ----------------------------------------------------------------------------------- -2307 1002 XMS_VFX_VIBSPEEDf: ;[71 cycles] -2308 1002 CE pop x ; 4 get chan -2309 1003 4D push x ; 4 -2310 1004 F4 1F movz a, (xms_channels+3)+x ; 4 read value -2311 1006 28 0F and a, #15 ; 2 -2312 1008 9F xcn a ; 5 -2313 1009 C4 0A movz (int1), a ; 4 -2314 100B F5 47 11 mov a, (XMS_FXP_PREVIOUS+3)+x ; 5 set prev value -2315 100E 28 0F and a, #15 ; 2 -2316 1010 04 0A orz a, (int1) ; 3 -2317 1012 D5 47 11 mov (XMS_FXP_PREVIOUS+3)+x, a ; 6 -2318 1015 -2319 1015 _xmsvfx_vs_entry2: ;[32 cycles] -2320 1015 E4 9D movz a, (xms_fxfirst) ; 3 -2321 1017 28 01 and a, #1 ; 2 -2322 1019 D0 22 bne _xmsvfx_vs_exit ; 2/4 -2323 101B F4 20 movz a, (xms_channels+4)+x ; 4 -2324 101D 68 04 cmp a, #4 ; 2 -2325 101F F0 1C beq _xmsvfx_vs_exit ; 2/4 skip if main effect is vibrato also -2326 1021 -2327 1021 F5 CD 10 mov a, (xms_channels_other+coso_pa+1)+x ; 5 COPIED FROM VIBRATOf ROUTINE -2328 1024 08 01 or a, #1 ; 2 -2329 1026 D5 CD 10 mov (xms_channels_other+coso_pa+1)+x, a ; 6 -2330 1029 5F C4 0F jmp _xmspve_exit ; 4 -2331 102C XMS_VFX_VIBSPEEDo: ;[195 cycles] -2332 102C CE pop x ; 4 -2333 102D 4D push x ; 4 -2334 102E F4 20 movz a, (xms_channels+4)+x ; 4 -2335 1030 68 04 cmp a, #4 ; 2 -2336 1032 F0 09 beq _xmsvfx_vs_exit ; 2/4 skip if main effect is vibrato also -2337 1034 8F C4 18 mov (fx_return), #(_xmspve_exit & 255) ; 5 -2338 1037 8F 0F 19 mov (fx_return+1), #((_xmspve_exit >> 8) & 255) ; 5 -2339 103A 5F 64 14 jmp XMS_FX_VIBRATOo ; 3+166 -2340 103D _xmsvfx_vs_exit: -2341 103D 5F C4 0F jmp _xmspve_exit -2342 1040 -2343 1040 ; VOLUME EFFECT B : VIBRATO DEPTH ----------------------------------------------------------------------------------- -2344 1040 XMS_VFX_VIBDEPTHf: ;[70 cycles] -2345 1040 CE pop x ; 4 -2346 1041 4D push x ; 4 -2347 1042 F4 1F movz a, (xms_channels+3)+x ; 4 -2348 1044 28 0F and a, #15 ; 2 -2349 1046 C4 0A movz (int1), a ; 4 -2350 1048 F5 47 11 mov a, (XMS_FXP_PREVIOUS+3)+x ; 5 -2351 104B 28 F0 and a, #$F0 ; 2 -2352 104D 04 0A orz a, (int1) ; 3 -2353 104F D5 47 11 mov (XMS_FXP_PREVIOUS+3)+x, a ; 6 -2354 1052 2F C1 b _xmsvfx_vs_entry2 ; 4+32 -2355 1054 ;XMS_VFX_VIBDEPTHo: ;[199 cycles] -2356 1054 ; b XMS_VFX_VIBSPEEDo ; 4+195 -2357 1054 -2358 1054 ; VOLUME EFFECT C : SET PANNING ----------------------------------------------------------------------------------- -2359 1054 XMS_VFX_PANNINGf: ;[39 cycles] -2360 1054 CE pop x ; 4 get channel -2361 1055 4D push x ; 4 -2362 1056 F4 1F movz a, (xms_channels+3)+x ; 4 read value -2363 1058 28 0F and a, #15 ; 2 and.. -2364 105A ; a = pan (0-15) ; -2365 105A ; expand to 0-60 ; -2366 105A 1C asl a ; 2 -2367 105B 1C asl a ; 2 -2368 105C 68 21 cmp a, #33 ; 2 -2369 105E 90 02 bcc _xms_vfxp_nofix ; 2/4 -2370 1060 88 03 adc a, #3 ; 2 -2371 1062 _xms_vfxp_nofix: ; -2372 1062 D4 25 movz (xms_channels+9)+x, a ; 5 store.. -2373 1064 C4 A6 movz (xms_cc_panning), a ; 4 -2374 1066 18 08 9E or (xms_cc_flags), #ccflag_panning ; 5 -2375 1069 XMS_VFX_PANNINGo: ; -2376 1069 5F C4 0F jmp _xmspve_exit ; 3 -2377 106C -2378 106C ; VOLUME EFFECT D : PANNING SLIDE LEFT ----------------------------------------------------------------------------------- -2379 106C ;XMS_VFX_PANSLIDELf: ; -2380 106C ; jmp _xmspve_exit ; -2381 106C XMS_VFX_PANSLIDELo: ;[48 cycles] -2382 106C CE pop x ; 4 get channel -2383 106D 4D push x ; 4 -2384 106E F4 1F movz a, (xms_channels+3)+x ; 4 read value -2385 1070 28 0F and a, #15 ; 2 and.. -2386 1072 C4 0A movz (int1), a ; 4 save.. -2387 1074 F4 25 movz a, (xms_channels+9)+x ; 4 get panning -2388 1076 80 setc ; 2 -2389 1077 A4 0A sbcz a, (int1) ; 3 subtract -2390 1079 10 02 bpl _xmsvfxpsl_noclamp ; 2/4 -2391 107B E8 00 mov a, #0 ; 2 clamp -2392 107D _xmsvfxpsl_noclamp: ; -2393 107D D4 25 movz (xms_channels+9)+x, a ; 5 store -2394 107F C4 A6 movz (xms_cc_panning), a ; 4 -2395 1081 18 08 9E or (xms_cc_flags), #ccflag_panning ; 5 -2396 1084 5F C4 0F jmp _xmspve_exit ; 3 -2397 1087 -2398 1087 ; VOLUME EFFECT E : PANNING SLIDE RIGHT ----------------------------------------------------------------------------------- -2399 1087 ;XMS_VFX_PANSLIDERf: -2400 1087 ; jmp _xmspve_exit -2401 1087 XMS_VFX_PANSLIDERo: ;[50 cycles] -2402 1087 CE pop x ; 4 almost the same operation as slide left -2403 1088 4D push x ; 4 -2404 1089 F4 1F movz a, (xms_channels+3)+x ; 4 -2405 108B 28 0F and a, #15 ; 2 -2406 108D C4 0A movz (int1), a ; 4 -2407 108F F4 25 movz a, (xms_channels+9)+x ; 4 -2408 1091 60 clrc ; 2 -2409 1092 84 0A adcz a, (int1) ; 3 -2410 1094 68 41 cmp a, #65 ; 2 -2411 1096 90 02 bcc _xmsvfxpsr_noclamp ; 2/4 -2412 1098 E8 40 mov a, #64 ; 2 -2413 109A _xmsvfxpsr_noclamp: ; -2414 109A D4 25 movz (xms_channels+9)+x, a ; 5 -2415 109C C4 A6 movz (xms_cc_panning), a ; 4 -2416 109E 18 08 9E or (xms_cc_flags), #ccflag_panning ; 5 -2417 10A1 5F C4 0F jmp _xmspve_exit ; 3 -2418 10A4 -2419 10A4 ; VOLUME EFFECT F : GLISSANDO --------------------------------------------------------------------------------------------- -2420 10A4 XMS_VFX_GLISSANDOf: ;[27 cycles] -2421 10A4 CE pop x ; 4 get chan -2422 10A5 4D push x ; 4 -2423 10A6 F4 1F movz a, (xms_channels+3)+x ; 4 get value -2424 10A8 28 0F and a, #15 ; 2 -2425 10AA 9F xcn a ; 5 -2426 10AB D4 28 movz (xms_channels+12)+x, a ; 5 store for later -2427 10AD 5F C4 0F jmp _xmspve_exit ; 3 -2428 10B0 XMS_VFX_GLISSANDOo: ;[?? cycles] -2429 10B0 CE pop x ; 4 get chan -2430 10B1 4D push x ; 4 -2431 10B2 F4 20 movz a, (xms_channels+4)+x ; 4 check main effect -2432 10B4 68 03 cmp a, #3 ; 2 -2433 10B6 F0 09 beq _xmsvfx_g_exit ; 2/4 skip if main effect is glissando also -2434 10B8 8F C4 18 mov (fx_return), #(_xmspve_exit & 255) ; 5 -2435 10BB 8F 0F 19 mov (fx_return+1), #((_xmspve_exit >> 8) & 255) ; 5 -2436 10BE 5F AB 13 jmp (XMS_FX_PORTA2NOTEo) ; 3+?? (add 2 to skip the push/pop x) -2437 10C1 _xmsvfx_g_exit: ; -2438 10C1 5F C4 0F jmp _xmspve_exit ; 3 -2439 10C4 -2440 10C4~ #else -2441 10C4~ -2442 10C4~ XMS_VFX_VOLSLIDEDo: -2443 10C4~ XMS_VFX_VOLSLIDEUo: -2444 10C4~ XMS_VFX_FINEVOLDf: -2445 10C4~ XMS_VFX_FINEVOLDo: -2446 10C4~ XMS_VFX_FINEVOLUf: -2447 10C4~ XMS_VFX_FINEVOLUo: -2448 10C4~ XMS_VFX_VIBSPEEDf: -2449 10C4~ XMS_VFX_VIBSPEEDo: -2450 10C4~ XMS_VFX_VIBDEPTHf: -2451 10C4~ XMS_VFX_PANNINGf: -2452 10C4~ XMS_VFX_PANNINGo: -2453 10C4~ XMS_VFX_PANSLIDELo: -2454 10C4~ XMS_VFX_PANSLIDERo: -2455 10C4~ XMS_VFX_GLISSANDOf: -2456 10C4~ XMS_VFX_GLISSANDOo: -2457 10C4~ jmp _xmspve_exit -2458 10C4~ -2459 10C4 #endif -2460 10C4 -2461 10C4 ;XMS_VFX_UNUSED: -2462 10C4 ; jmp _xmspve_exit -2463 10C4 ;--------------------------------------------------------------------------------------------------------------------------------------- -2464 10C4 ; OMG XM MAIN EFFECTS -2465 10C4 -2466 10C4 ;----------------------------------------------------------------------------------------------------------- -2467 10C4 ; OTHER CHANNEL BUFFER, 256 bytes -2468 10C4 ;----------------------------------------------------------------------------------------------------------- -2469 10C4 xms_channels_other: -2470 10C4 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2470 10C8 00 00 00 00 -2470 10CC 00 00 00 00 -2470 10D0 00 00 00 00 -2471 10D4 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2471 10D8 00 00 00 00 -2471 10DC 00 00 00 00 -2471 10E0 00 00 00 00 -2472 10E4 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2472 10E8 00 00 00 00 -2472 10EC 00 00 00 00 -2472 10F0 00 00 00 00 -2473 10F4 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2473 10F8 00 00 00 00 -2473 10FC 00 00 00 00 -2473 1100 00 00 00 00 -2474 1104 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2474 1108 00 00 00 00 -2474 110C 00 00 00 00 -2474 1110 00 00 00 00 -2475 1114 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2475 1118 00 00 00 00 -2475 111C 00 00 00 00 -2475 1120 00 00 00 00 -2476 1124 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2476 1128 00 00 00 00 -2476 112C 00 00 00 00 -2476 1130 00 00 00 00 -2477 1134 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2477 1138 00 00 00 00 -2477 113C 00 00 00 00 -2477 1140 00 00 00 00 -2478 1144 -2479 1144 ;------------------------------------------------------------------------------------------------------------ -2480 1144 ;; PREVIOUS EFFECT PARAMETERS -2481 1144 ;-------------------------------- -2482 1144 XMS_FXP_PREVIOUS: -2483 1144 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2483 1148 00 00 00 00 -2483 114C 00 00 00 00 -2483 1150 00 00 00 00 -2484 1154 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2484 1158 00 00 00 00 -2484 115C 00 00 00 00 -2484 1160 00 00 00 00 -2485 1164 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2485 1168 00 00 00 00 -2485 116C 00 00 00 00 -2485 1170 00 00 00 00 -2486 1174 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2486 1178 00 00 00 00 -2486 117C 00 00 00 00 -2486 1180 00 00 00 00 -2487 1184 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2487 1188 00 00 00 00 -2487 118C 00 00 00 00 -2487 1190 00 00 00 00 -2488 1194 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2488 1198 00 00 00 00 -2488 119C 00 00 00 00 -2488 11A0 00 00 00 00 -2489 11A4 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2489 11A8 00 00 00 00 -2489 11AC 00 00 00 00 -2489 11B0 00 00 00 00 -2490 11B4 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2490 11B8 00 00 00 00 -2490 11BC 00 00 00 00 -2490 11C0 00 00 00 00 -2491 11C4 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2491 11C8 00 00 00 00 -2491 11CC 00 00 00 00 -2491 11D0 00 00 00 00 -2492 11D4 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2492 11D8 00 00 00 00 -2492 11DC 00 00 00 00 -2492 11E0 00 00 00 00 -2493 11E4 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2493 11E8 00 00 00 00 -2493 11EC 00 00 00 00 -2493 11F0 00 00 00 00 -2494 11F4 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2494 11F8 00 00 00 00 -2494 11FC 00 00 00 00 -2494 1200 00 00 00 00 -2495 1204 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2495 1208 00 00 00 00 -2495 120C 00 00 00 00 -2495 1210 00 00 00 00 -2496 1214 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2496 1218 00 00 00 00 -2496 121C 00 00 00 00 -2496 1220 00 00 00 00 -2497 1224 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2497 1228 00 00 00 00 -2497 122C 00 00 00 00 -2497 1230 00 00 00 00 -2498 1234 00 00 00 00 .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -2498 1238 00 00 00 00 -2498 123C 00 00 00 00 -2498 1240 00 00 00 00 -2499 1244 -2500 1244 ;--------------------------------- -2501 1244 -2502 1244 table_effect_first: -2503 1244 F2 12 .word XMS_FX_ARPEGGIOf ; 0xy Arpeggio -2504 1246 4F 13 .word XMS_FX_PORTAUPf ; 1xy Portamento Up -2505 1248 72 13 .word XMS_FX_PORTADOWNf ; 2xy Portamento Down -2506 124A 96 13 .word XMS_FX_PORTA2NOTEf ; 3xy Portamento to Note -2507 124C 2A 14 .word XMS_FX_VIBRATOf ; 4xy Vibrato -2508 124E 9A 14 .word XMS_FX_PORTASLIDEf ; 5xy Portamento + Volume Slide -2509 1250 BD 14 .word XMS_FX_VIBSLIDEf ; 6xy Vibrato + Volume Slide -2510 1252 E0 14 .word XMS_FX_TREMOLOf ; 7xy Tremolo -2511 1254 5C 15 .word XMS_FX_PANf ; 8xy Set Panning -2512 1256 6C 15 .word XMS_FX_SAMPOFFf ; 9xx Sample Offset -2513 1258 78 15 .word XMS_FX_VOLUMESLIDEf ; Axy Volume Slide -2514 125A BC 15 .word XMS_FX_PATTERNJUMPf ; Bxy Pattern Jump -2515 125C C8 15 .word XMS_FX_SETVOLUMEf ; Cxy Set Volume -2516 125E DE 15 .word XMS_FX_PATTERNBREAKf ; Dxy Pattern Break -2517 1260 89 16 .word XMS_FX_EXTENDEDf ; Exy Extended Effects -2518 1262 36 16 .word XMS_FX_SETSPEEDf ; Fxy Set Speed -2519 1264 CC 18 .word XMS_FX_SETGLOBALVOLf ; Gxy Set Global Volume -2520 1266 DB 18 .word XMS_FX_GLOBALVOLSLIDEf ; Hxy Global Volume Slide -2521 1268 EF 12 .word XMS_FX_UNUSED ; Ixy Unused -2522 126A EF 12 .word XMS_FX_UNUSED ; Jxy Unused -2523 126C 10 19 .word XMS_FX_KEYOFFf ; Kxy Keyoff -2524 126E 35 19 .word XMS_FX_ENVELOPEPOSf ; Lxy Envelope Position -2525 1270 EF 12 .word XMS_FX_UNUSED ; Mxy Unused -2526 1272 EF 12 .word XMS_FX_UNUSED ; Nxy Unused -2527 1274 EF 12 .word XMS_FX_UNUSED ; Oxy Unused -2528 1276 41 19 .word XMS_FX_PANSLIDEf ; Pxy Panning Slide -2529 1278 EF 12 .word XMS_FX_UNUSED ; Qxy Unused -2530 127A A1 19 .word XMS_FX_RETRIGGERf ; Rxy Retrigger Note -2531 127C EF 12 .word XMS_FX_UNUSED ; Sxy Unused -2532 127E 7F 1A .word XMS_FX_TREMORf ; Txy Tremor -2533 1280 EF 12 .word XMS_FX_UNUSED ; Uxy Unused -2534 1282 EF 12 .word XMS_FX_UNUSED ; Vxy Unused -2535 1284 EF 12 .word XMS_FX_UNUSED ; Wxy Unused -2536 1286 E1 1A .word XMS_FX_XFINEPORTAf ; Xxy Extra Fine Portamento -2537 1288 EF 12 .word XMS_FX_UNUSED ; Yxy Unused -2538 128A EF 12 .word XMS_FX_UNUSED ; Zxy Unused -2539 128C -2540 128C table_effect_other: -2541 128C FD 12 .word XMS_FX_ARPEGGIOo -2542 128E 5F 13 .word XMS_FX_PORTAUPo -2543 1290 83 13 .word XMS_FX_PORTADOWNo -2544 1292 AB 13 .word XMS_FX_PORTA2NOTEo -2545 1294 64 14 .word XMS_FX_VIBRATOo -2546 1296 AB 14 .word XMS_FX_PORTASLIDEo -2547 1298 CE 14 .word XMS_FX_VIBSLIDEo -2548 129A 15 15 .word XMS_FX_TREMOLOo -2549 129C EF 12 .word XMS_FX_UNUSED -2550 129E EF 12 .word XMS_FX_UNUSED -2551 12A0 8B 15 .word XMS_FX_VOLUMESLIDEo -2552 12A2 EF 12 .word XMS_FX_UNUSED -2553 12A4 EF 12 .word XMS_FX_UNUSED -2554 12A6 EF 12 .word XMS_FX_UNUSED -2555 12A8 95 16 .word XMS_FX_EXTENDEDo -2556 12AA EF 12 .word XMS_FX_UNUSED -2557 12AC EF 12 .word XMS_FX_UNUSED -2558 12AE EC 18 .word XMS_FX_GLOBALVOLSLIDEo -2559 12B0 EF 12 .word XMS_FX_UNUSED -2560 12B2 EF 12 .word XMS_FX_UNUSED -2561 12B4 1D 19 .word XMS_FX_KEYOFFo -2562 12B6 EF 12 .word XMS_FX_UNUSED -2563 12B8 EF 12 .word XMS_FX_UNUSED -2564 12BA EF 12 .word XMS_FX_UNUSED -2565 12BC EF 12 .word XMS_FX_UNUSED -2566 12BE 52 19 .word XMS_FX_PANSLIDEo -2567 12C0 EF 12 .word XMS_FX_UNUSED -2568 12C2 DC 19 .word XMS_FX_RETRIGGERo -2569 12C4 EF 12 .word XMS_FX_UNUSED -2570 12C6 9B 1A .word XMS_FX_TREMORo -2571 12C8 EF 12 .word XMS_FX_UNUSED -2572 12CA EF 12 .word XMS_FX_UNUSED -2573 12CC EF 12 .word XMS_FX_UNUSED -2574 12CE EF 12 .word XMS_FX_UNUSED -2575 12D0 EF 12 .word XMS_FX_UNUSED -2576 12D2 EF 12 .word XMS_FX_UNUSED -2577 12D4 -2578 12D4 XMS_ProcessMainEffect: ;[217/256 first/other] -2579 12D4 ; x = channel * 16 ; -2580 12D4 ; a = beginning of effect (first effect number or new note) -2581 12D4 ; return -2582 12D4 ; x = preserved -2583 12D4 ; a = note enable, 0 if cancelled (by noteporta, fineporta, etc..) -2584 12D4 ; ints0-4 clobbered -2585 12D4 2D push a ; 4 { 21/23 cycles -2586 12D5 4D push x ; 4 -2587 12D6 8F EF 18 mov (fx_return), #(_xmspme_exit & 255) ; 5 -2588 12D9 8F 12 19 mov (fx_return+1), #((_xmspme_exit >> 8) & 255) ; 5 -2589 12DC 78 00 B3 cmp (xms_tick), #0 ; 5 -2590 12DF D0 07 bne _xmspme_other_ticks ; 2/4 } -2591 12E1 _xmspme_first_tick: ; -2592 12E1 F4 20 movz a, (xms_channels+4)+x ; 4 { 14+? cycles -2593 12E3 1C asl a ; 2 -2594 12E4 5D mov x, a ; 2 -2595 12E5 1F 44 12 jmp [table_effect_first+x] ; 6+169 } <-- fineporta up -2596 12E8 _xmspme_other_ticks: ; -2597 12E8 F4 20 movz a, (xms_channels+4)+x ; 4 { 14+? cycles -2598 12EA 1C asl a ; 2 -2599 12EB 5D mov x, a ; 2 -2600 12EC 1F 8C 12 jmp [table_effect_other+x] ; 6+206 } -2601 12EF _xmspme_exit: ; -2602 12EF CE pop x ; 4 { 13 cycles -2603 12F0 AE pop a ; 4 -2604 12F1 ; -2605 12F1 6F ret ; 5 } -2606 12F2 -2607 12F2 ; must restore X in effect functions. -2608 12F2 -2609 12F2 ; -------------------------------------------------------------------------------------------------------------------- -2610 12F2 ; MOD EFFECTS -2611 12F2 ; -------------------------------------------------------------------------------------------------------------------- -2612 12F2 -2613 12F2 ; EFFECT 0xy ARPEGGIO ------------------------------------------------------------------------------------------------ -2614 12F2 XMS_FX_ARPEGGIOf: ;[24 cycles] -2615 12F2 CE pop x ; 4 get chan -2616 12F3 4D push x ; 4 -2617 12F4 E8 01 mov a, #1 ; 2 reset counter -2618 12F6 D4 27 movz (xms_channels+11)+x, a ; 5 -2619 12F8 18 02 9E or (xms_cc_flags), #ccflag_pitch ; 5 set pitch flag -2620 12FB 2F F2 b _xmspme_exit ; 4 -2621 12FD XMS_FX_ARPEGGIOo: ;[103 cycles] -2622 12FD CE pop x ; 4 get chan { 8 cycles -2623 12FE 4D push x ; 4 } -2624 12FF ; -2625 12FF F4 27 movz a, (xms_channels+11)+x ; 4 check counter } 30 cycles -2626 1301 68 00 cmp a, #0 ; 2 do actions.. } -2627 1303 F0 0E beq _xmsfxa_0 ; 2/4 } -2628 1305 68 01 cmp a, #1 ; 2 } -2629 1307 F0 10 beq _xmsfxa_1 ; 2/4 } jump -2630 1309 E8 00 mov a, #0 ; 2 x | -2631 130B D4 27 movz (xms_channels+11)+x, a ; 5 x | -2632 130D F4 21 movz a, (xms_channels+5)+x ; 4 x | -2633 130F 28 0F and a, #15 ; 2 x | -2634 1311 2F 0D b _xmsfxa_2 ; 4 x | -2635 1313 _xmsfxa_0: ; x | -2636 1313 BB 27 inc (xms_channels+11), x ; 5 x | -2637 1315 E8 00 mov a, #0 ; 2 x | -2638 1317 2F 07 b _xmsfxa_2 ; 4 x / -2639 1319 _xmsfxa_1: ; }_/ -2640 1319 BB 27 inc (xms_channels+11), x ; 5 } -2641 131B F4 21 movz a, (xms_channels+5)+x ; 4 } -2642 131D 9F xcn a ; 5 } -2643 131E 28 0F and a, #15 ; 2 } -2644 1320 _xmsfxa_2: ; } -2645 1320 ; -2646 1320 -2647 1320 _xmsfxa_modspace: -2648 1320 00 nop ; <--- modspace -2649 1321 00 nop ; -2650 1322 9F xcn a ; 5 multiply, 64 { 26 cycles -2651 1323 8F 00 0B mov (int1+1), #0 ; 5 -2652 1326 1C asl a ; 2 -2653 1327 2B 0B rolz (int1+1) ; 4 -2654 1329 1C asl a ; 2 -2655 132A 2B 0B rolz (int1+1) ; 4 -2656 132C C4 0A movz (int1), a ; 4 } -2657 132E -2658 132E 80 setc ; 2 subtract from period { 39 cycles -2659 132F E4 A1 movz a, (xms_cc_period) ; 4 -2660 1331 A4 0A sbcz a, (int1) ; 3 -2661 1333 2D push a ; 4 -2662 1334 E4 A2 movz a, (xms_cc_period+1) ; 4 -2663 1336 A4 0B sbcz a, (int1+1) ; 3 -2664 1338 FD mov y, a ; 2 -2665 1339 AE pop a ; 4 -2666 133A ; -2667 133A DA A1 movw (xms_cc_period), ya ; 4 set pitch -2668 133C 18 02 9E or (xms_cc_flags), #ccflag_pitch ; 5 set flag -2669 133F 2F AE b _xmspme_exit ; 4 exit } -2670 1341 -2671 1341 _xmsfxa_amiga: -2672 1341 60 clrc -2673 1342 95 23 00 adc a, (xms_channels+cso_note)+x -2674 1345 3F 13 0F call XMS_GetPeriod -2675 1348 DA A1 movw (xms_cc_period), ya -2676 134A 18 02 9E or (xms_cc_flags), #ccflag_pitch -2677 134D 2F A0 b _xmspme_exit -2678 134F -2679 134F ; EFFECT 1xy PORTAMENTO UP ------------------------------------------------------------------------------------------------ -2680 134F XMS_FX_PORTAUPf: ;[34 cycles] -2681 134F CE pop x ; 4 get chan -2682 1350 4D push x ; 4 -2683 1351 F4 21 movz a, (xms_channels+5)+x ; 4 check parameter -2684 1353 D0 05 bne _xmsfxpu_isparam ; 2/4 -2685 1355 F5 44 11 mov a, (XMS_FXP_PREVIOUS+0)+x ; 5 -2686 1358 D4 21 movz (xms_channels+5)+x, a ; 5 -2687 135A _xmsfxpu_isparam: ; -2688 135A D5 44 11 mov (XMS_FXP_PREVIOUS+0)+x, a ; 6 -2689 135D 2F 90 b _xmspme_exit ; 4 -2690 135F XMS_FX_PORTAUPo: ;[159 cycles] -2691 135F CE pop x ; 4 get chan -2692 1360 4D push x ; 4 -2693 1361 _xmsfxpu_entry2: ; -2694 1361 F4 21 movz a, (xms_channels+5)+x ; 4 get slide value -2695 1363 8F 00 0C mov (int2), #0 ; 5 -2696 1366 1C asl a ; 2 -2697 1367 2B 0C rolz (int2) ; 4 -2698 1369 1C asl a ; 2 -2699 136A 2B 0C rolz (int2) ; 4 -2700 136C ; -2701 136C 3F C2 1C call XMS_CHANNEL_PITCH_SLIDEUP ; 8+118 -2702 136F ; -2703 136F 5F EF 12 jmp _xmspme_exit ; 4 -2704 1372 -2705 1372 ; EFFECT 2xy PORTAMENTO DOWN ------------------------------------------------------------------------------------------------ -2706 1372 XMS_FX_PORTADOWNf: ;[33 cycles] -2707 1372 CE pop x ; 4 get chan -2708 1373 4D push x ; 4 -2709 1374 F4 21 movz a, (xms_channels+5)+x ; 4 check parameter -2710 1376 D0 05 bne _xmsfxpd_isparam ; 2/4 -2711 1378 F5 45 11 mov a, (XMS_FXP_PREVIOUS+1)+x ; 5 -2712 137B D4 21 movz (xms_channels+5)+x, a ; 5 -2713 137D _xmsfxpd_isparam: ; -2714 137D D5 45 11 mov (XMS_FXP_PREVIOUS+1)+x, a ; 6 -2715 1380 5F EF 12 jmp _xmspme_exit ; 3 -2716 1383 XMS_FX_PORTADOWNo: ;[120 cycles] -2717 1383 CE pop x ; 4 get chan -2718 1384 4D push x ; 4 -2719 1385 _xmsfxpd_entry2: ; -2720 1385 F4 21 movz a, (xms_channels+5)+x ; 4 get slide value -2721 1387 8F 00 0C mov (int2), #0 ; 5 -2722 138A 1C asl a ; 2 -2723 138B 2B 0C rolz (int2) ; 4 -2724 138D 1C asl a ; 2 -2725 138E 2B 0C rolz (int2) ; 4 -2726 1390 ; -2727 1390 3F CC 1C call XMS_CHANNEL_PITCH_SLIDEDOWN ; 8+80 -2728 1393 ; -2729 1393 5F EF 12 jmp _xmspme_exit ; 3 -2730 1396 -2731 1396 ; EFFECT 3xy PORTAMENTO TO NOTE ------------------------------------------------------------------------------------------------ -2732 1396 XMS_FX_PORTA2NOTEf: ;[43 cycles] -2733 1396 CE pop x ; 4 get chan -2734 1397 4D push x ; 4 -2735 1398 F4 21 movz a, (xms_channels+5)+x ; 4 check parameter -2736 139A D0 05 bne _xmsfxpn_isparam ; 2/4 -2737 139C F5 46 11 mov a, (XMS_FXP_PREVIOUS+2)+x ; 5 -2738 139F D4 21 movz (xms_channels+5)+x, a ; 5 -2739 13A1 _xmsfxpn_isparam: ; -2740 13A1 D5 46 11 mov (XMS_FXP_PREVIOUS+2)+x, a ; 6 -2741 13A4 D4 28 movz (xms_channels+12)+x, a ; 5 -2742 13A6 CD 00 mov x, #0 ; 2 -2743 13A8 1F 18 00 jmp [fx_return+x] ; 6 -2744 13AB XMS_FX_PORTA2NOTEo: ;[] -2745 13AB CE pop x ; 4 get chan -2746 13AC 4D push x ; 4 -2747 13AD _xmsfxpn_entry2: ; -2748 13AD ; -2749 13AD FA A1 0C mov (int2), (xms_cc_period) ; 5 copy xms_cc_period -2750 13B0 FA A2 0D mov (int2+1), (xms_cc_period+1) ; 5 -2751 13B3 ; -2752 13B3 F4 23 movz a, (xms_channels+cso_note)+x ; 4 -2753 13B5 ; -2754 13B5 3F 13 0F call XMS_GetPeriod ; 8+57 -2755 13B8 ; ya = wanted period ; -2756 13B8 ; int2 = current period ; -2757 13B8 ; -2758 13B8 2D push a ; 4 preserve period -2759 13B9 6D push y ; 4 -2760 13BA 5A 0C cmpw ya, (int2) ; 4 compare with new period -2761 13BC D0 07 bne _xmsfxpn_notequal ; 2/4 -2762 13BE EE pop y ; 4 old period=new period -2763 13BF AE pop a ; 4 -2764 13C0 CD 00 mov x, #0 ; 2 exit -2765 13C2 1F 18 00 jmp [fx_return+x] ; 6 -2766 13C5 _xmsfxpn_notequal: ; -2767 13C5 B0 02 bcs _xmsfxpn_less ; 2/4 jump to more/less routine -2768 13C7 2F 2B b _xmsfxpn_more ; 4 -2769 13C9 -2770 13C9 _xmsfxpn_less: ; -2771 13C9 ; subtract from pitch (add to period) ; -2772 13C9 F4 28 movz a, (xms_channels+12)+x ; 4 get porta speed { 90 cycles -2773 13CB 8F 00 0C mov (int2), #0 ; 5 -2774 13CE 1C asl a ; 2 shift -2775 13CF 2B 0C rolz (int2) ; 4 -2776 13D1 1C asl a ; 2 -2777 13D2 2B 0C rolz (int2) ; 4 -2778 13D4 ; -2779 13D4 60 clrc ; 2 add to period -2780 13D5 C4 0A movz (int1), a ; 4 -2781 13D7 E4 A1 movz a, (xms_cc_period) ; 3 -2782 13D9 84 0A adcz a, (int1) ; 3 -2783 13DB 2D push a ; 4 -2784 13DC E4 A2 movz a, (xms_cc_period+1) ; 3 -2785 13DE 84 0C adcz a, (int2) ; 3 -2786 13E0 FD mov y, a ; 2 -2787 13E1 AE pop a ; 4 -2788 13E2 ; -2789 13E2 DA 0C movw (int2), ya ; 4 store -2790 13E4 ; -2791 13E4 EE pop y ; 4 restore old period -2792 13E5 AE pop a ; 4 -2793 13E6 ; -2794 13E6 ; check if it slid past wanted note ; -2795 13E6 5A 0C cmpw ya, (int2) ; wanted - current ; 4 compare -2796 13E8 B0 02 bcs _xmsfxpn_less_continue ; 2/4 -2797 13EA DA 0C movw (int2), ya ; 4 -2798 13EC _xmsfxpn_less_continue: ; -2799 13EC ; -2800 13EC BA 0C movw ya, (int2) ; 5 save -2801 13EE D4 1C movz (xms_channels+0)+x, a ; 5 -2802 13F0 DB 1D movz (xms_channels+1)+x, y ; 5 -2803 13F2 ; -2804 13F2 2F 2E b _xmsfxpn_edited ; 4 skip } -2805 13F4 -2806 13F4 _xmsfxpn_more: -2807 13F4 -2808 13F4 ; add to pitch (subtract from period) ; -2809 13F4 F4 28 movz a, (xms_channels+12)+x ; 4 get porta speed { 78 cycles -2810 13F6 8F 00 0C mov (int2), #0 ; 5 -2811 13F9 1C asl a ; 2 -2812 13FA 2B 0C rolz (int2) ; 4 -2813 13FC 1C asl a ; 2 -2814 13FD 2B 0C rolz (int2) ; 4 -2815 13FF ; -2816 13FF 80 setc ; 2 subtract from period -2817 1400 C4 0A movz (int1), a ; 4 -2818 1402 E4 A1 movz a, (xms_cc_period) ; 3 -2819 1404 A4 0A sbcz a, (int1) ; 3 -2820 1406 2D push a ; 4 -2821 1407 E4 A2 movz a, (xms_cc_period+1) ; 3 -2822 1409 A4 0C sbcz a, (int2) ; 3 -2823 140B FD mov y, a ; 2 -2824 140C AE pop a ; 4 -2825 140D ; -2826 140D DA 0C movw (int2), ya ; 4 store -2827 140F ; -2828 140F EE pop y ; 4 restore old period -2829 1410 AE pop a ; 4 -2830 1411 ; -2831 1411 ; check if it slid past wanted note ; -2832 1411 78 00 0D cmp int2+1, #0 -2833 1414 30 04 bmi _xmsfxpn_more_stop -2834 1416 5A 0C cmpw ya, (int2) ; wanted - current ; 4 compare -2835 1418 90 02 bcc _xmsfxpn_more_continue ; 2/4 -2836 141A _xmsfxpn_more_stop: -2837 141A DA 0C movw (int2), ya ; 4 -2838 141C _xmsfxpn_more_continue: ; -2839 141C BA 0C movw ya, (int2) ; 5 save -2840 141E D4 1C movz (xms_channels+0)+x, a ; 5 -2841 1420 DB 1D movz (xms_channels+1)+x, y ; 5 } -2842 1422 -2843 1422 _xmsfxpn_edited: ; -2844 1422 ; set frequency ; -2845 1422 ; -2846 1422 3F D4 1C call XMS_CHANNEL_SETPITCH ; 8+59 -2847 1425 -2848 1425 _xmsfxpn_equal: ; -2849 1425 ; -2850 1425 CD 00 mov x, #0 ; 2 { 8 cycles -2851 1427 1F 18 00 jmp [fx_return+x] ; 6 } -2852 142A -2853 142A ; EFFECT 4xy VIBRATO ------------------------------------------------------------------------------------------------ -2854 142A XMS_FX_VIBRATOf: ;[89 cycles] -2855 142A CE pop x ; 4 -2856 142B 4D push x ; 4 get channel -2857 142C F5 47 11 mov a, (XMS_FXP_PREVIOUS+3)+x ; 5 check/get previous parameter -2858 142F C4 0A movz (int1), a ; 4 -2859 1431 FB 21 movz y, (xms_channels+5)+x ; 4 -2860 1433 DD mov a, y ; 2 -2861 1434 28 0F and a, #$0F ; 2 -2862 1436 F0 03 beq _xmsfxv_noparam2 ; 2/4 -2863 1438 38 F0 0A and (int1), #$F0 ; 5 -2864 143B _xmsfxv_noparam2: ; -2865 143B DD mov a, y ; 2 -2866 143C 28 F0 and a, #$F0 ; 2 -2867 143E F0 03 beq _xmsfxv_noparam1 ; 2/4 -2868 1440 38 0F 0A and (int1), #$0F ; 5 -2869 1443 _xmsfxv_noparam1: ; -2870 1443 DD mov a, y ; 2 -2871 1444 04 0A orz a, (int1) ; 3 -2872 1446 D5 47 11 mov (XMS_FXP_PREVIOUS+3)+x, a ; 6 -2873 1449 D4 21 movz (xms_channels+5)+x, a ; 5 -2874 144B ; -2875 144B E4 9D movz a, (xms_fxfirst) ; 3 -2876 144D 28 01 and a, #1 ; 2 -2877 144F F0 06 beq _xmsfxv_entry2 ; 2/4 -2878 1451 E8 00 mov a, #0 ; 2 -2879 1453 D4 2A movz (xms_channels+14)+x, a ; 5 -2880 1455 ; -2881 1455 2F 08 b _xmsfxv_firstrun ; 4 -2882 1457 _xmsfxv_entry2: ;[21 cycles] -2883 1457 F5 CD 10 mov a, (xms_channels_other+coso_pa+1)+x ; 5 -2884 145A 08 01 or a, #1 ; 2 -2885 145C D5 CD 10 mov (xms_channels_other+coso_pa+1)+x, a ; 6 -2886 145F _xmsfxv_firstrun: ; -2887 145F CD 00 mov x, #0 ; 2 -2888 1461 1F 18 00 jmp [fx_return+x] ; 6 -2889 1464 XMS_FX_VIBRATOo: ;[147 cycles] -2890 1464 CE pop x ; 4 get chan { 32 cycles -2891 1465 4D push x ; 4 -2892 1466 F5 CA 10 mov a, (xms_channels_other+6)+x ; 5 get param -2893 1469 5C lsr a ; 2 -2894 146A 28 03 and a, #3 ; 2 -2895 146C 2D push a ; 4 -2896 146D ; -2897 146D F5 47 11 mov a, (XMS_FXP_PREVIOUS+3)+x ; 5 get prev data -2898 1470 28 F0 and a, #%11110000 -2899 1472 5C lsr a ; 2 -2900 1473 5C lsr a ; 2 } -2901 1474 ;---------------------------------------- -2902 1474 ; clrc ; 2 { 84 cycles -2903 1474 94 2A adcz a, (xms_channels+14)+x ; 4 add sine pos -2904 1476 D4 2A movz (xms_channels+14)+x, a ; 5 -2905 1478 _xmsfxv_getvalue: ;[115 cycles] -2906 1478 ; a = 0 to 255 ; -2907 1478 EE pop y ; 4 get table entry -2908 1479 3F 14 20 call XMS_GETVIBTABLE ; 46 -2909 147C FD mov y, a ; 2 -2910 147D ; -2911 147D F5 47 11 mov a, (XMS_FXP_PREVIOUS+3)+x ; 4 -2912 1480 28 0F and a, #15 ; 2 -2913 1482 ; -2914 1482 1C asl a ; 2 -2915 1483 1C asl a ; 2 -2916 1484 1C asl a ; 2 -2917 1485 ; -2918 1485 CF mul ya ; 9 mul by depth -2919 1486 ; ya = vibrato value ; } -2920 1486 ;---------------------------------------- -2921 1486 DD mov a, y ; 2 store ya >> 8 { 33 cycles -2922 1487 D5 CC 10 mov (xms_channels_other+coso_pa)+x, a ; 6 -2923 148A E4 9E movz a, (xms_cc_flags) ; 3 -2924 148C 28 80 and a, #%10000000 ; 2 -2925 148E 08 01 or a, #1 ; 2 -2926 1490 D5 CD 10 mov (xms_channels_other+coso_pa+1)+x, a ; 6 -2927 1493 ; -2928 1493 22 9E set1 (xms_cc_flags) ; 4 set flag -2929 1495 CD 00 mov x, #0 ; 2 -2930 1497 1F 18 00 jmp [fx_return+x] ; 6 } -2931 149A -2932 149A ; * change to bit operation -2933 149A -2934 149A ; EFFECT 5xy NOTEPORTA+VOLSLIDE ------------------------------------------------------------------------------------------------ -2935 149A XMS_FX_PORTASLIDEf: ;[30 cycles] -2936 149A CE pop x ; 4 get chan -2937 149B 4D push x ; 4 -2938 149C F4 21 movz a, (xms_channels+5)+x ; 4 check&get prev param -2939 149E D0 05 bne _xmsfxps_isparam ; 2/4 -2940 14A0 F5 48 11 mov a, (XMS_FXP_PREVIOUS+4)+x ; 5 -2941 14A3 D4 21 movz (xms_channels+5)+x, a ; 5 -2942 14A5 _xmsfxps_isparam: ; -2943 14A5 D5 48 11 mov (XMS_FXP_PREVIOUS+4)+x, a ; 6 -2944 14A8 5F EF 12 jmp _xmspme_exit ; 3 --------------- -2945 14AB XMS_FX_PORTASLIDEo: ;[26+? cycles] -2946 14AB 8F B4 18 mov fx_return, #(_xmsfxps_ret1 & 255) ; 5 set return -2947 14AE 8F 14 19 mov fx_return+1, #((_xmsfxps_ret1 >> 8) & 255) ; 5 -2948 14B1 5F AB 13 jmp XMS_FX_PORTA2NOTEo ; 3+? call -2949 14B4 _xmsfxps_ret1: ; -2950 14B4 8F EF 18 mov fx_return, #(_xmspme_exit & 255) ; 5 set return -2951 14B7 8F 12 19 mov fx_return+1, #((_xmspme_exit >> 8) & 255) ; 5 -2952 14BA 5F 8B 15 jmp XMS_FX_VOLUMESLIDEo ; 3+? call -2953 14BD ; -2954 14BD ; EFFECT 6xy VIBRATO+VOLSLIDE ------------------------------------------------------------------------------------------------ -2955 14BD XMS_FX_VIBSLIDEf: ;[30 cycles] -2956 14BD CE pop x ; 4 get chan -2957 14BE 4D push x ; 4 -2958 14BF F4 21 movz a, (xms_channels+5)+x ; 4 check&get prev param -2959 14C1 D0 05 bne _xmsfxvs_isparam ; 2/4 -2960 14C3 F5 49 11 mov a, (XMS_FXP_PREVIOUS+5)+x ; 5 -2961 14C6 D4 21 movz (xms_channels+5)+x, a ; 5 -2962 14C8 _xmsfxvs_isparam: ; -2963 14C8 D5 49 11 mov (XMS_FXP_PREVIOUS+5)+x, a ; 6 -2964 14CB 5F EF 12 jmp _xmspme_exit ; 3 -------------- -2965 14CE XMS_FX_VIBSLIDEo: ;[26+? cycles] -2966 14CE 8F D7 18 mov fx_return, #(_xmsfxvs_ret1 & 255) ; 5 set return -2967 14D1 8F 14 19 mov fx_return+1, #((_xmsfxvs_ret1 >> 8) & 255) ; 5 -2968 14D4 5F 64 14 jmp XMS_FX_VIBRATOo ; 3+? call -2969 14D7 _xmsfxvs_ret1: ; -2970 14D7 8F EF 18 mov fx_return, #(_xmspme_exit & 255) ; 5 set return -2971 14DA 8F 12 19 mov fx_return+1, #((_xmspme_exit >> 8) & 255) ; 5 -2972 14DD 5F 8B 15 jmp XMS_FX_VOLUMESLIDEo ; 3+? call -2973 14E0 ; -2974 14E0 ; EFFECT 7xy TREMOLO ------------------------------------------------------------------------------------------------ -2975 14E0 -2976 14E0 #ifdef FX_INCLUDE_TREMOLO -2977 14E0 XMS_FX_TREMOLOf: ;[118 cycles] -2978 14E0 CE pop x ; 4 get chan { 28 cycles -2979 14E1 4D push x ; 4 -2980 14E2 E4 9D movz a, (xms_fxfirst) ; 3 check.. -2981 14E4 28 01 and a, #1 ; 2 -2982 14E6 F0 07 beq _xmsfxt_exit ; 2/4 -2983 14E8 E8 00 mov a, #0 ; 2 reset counter on first time -2984 14EA D4 27 movz (xms_channels+11)+x, a ; 5 -2985 14EC D5 D2 10 mov (xms_channels_other+coso_vadd)+x, a ; 6 } -2986 14EF _xmsfxt_exit: ; -2987 14EF F5 4A 11 mov a, (XMS_FXP_PREVIOUS+6)+x ; 5 check prev data { 51 cycles -2988 14F2 C4 0A movz (int1), a ; 4 -2989 14F4 FB 21 movz y, (xms_channels+5)+x ; 4 -2990 14F6 DD mov a, y ; 2 -2991 14F7 28 0F and a, #$0F ; 2 -2992 14F9 F0 03 beq _xmsfxt_noparam2 ; 2/4 -2993 14FB 38 F0 0A and (int1), #$F0 ; 5 -2994 14FE _xmsfxt_noparam2: ; -2995 14FE DD mov a, y ; 2 -2996 14FF 28 F0 and a, #$F0 ; 2 -2997 1501 F0 03 beq _xmsfxt_noparam1 ; 2/4 -2998 1503 38 0F 0A and (int1), #$0F ; 5 -2999 1506 _xmsfxt_noparam1: ; -3000 1506 DD mov a, y ; 2 -3001 1507 04 0A orz a, (int1) ; 3 -3002 1509 D5 4A 11 mov (XMS_FXP_PREVIOUS+6)+x, a ; 6 -3003 150C D4 21 movz (xms_channels+5)+x, a ; 5 } -3004 150E ; -3005 150E -3006 150E F5 D2 10 mov a, (xms_channels_other+coso_vadd)+x ; 5 { 39 cycles -3007 1511 94 22 adcz a, (xms_channels+6)+x ; 4 -3008 1513 2F 31 b _xmsfxt_setvalue ; 4+26 } -3009 1515 XMS_FX_TREMOLOo: ;[180 cycles] -3010 1515 CE pop x ; 4 { 44 cycles -3011 1516 4D push x ; 4 -3012 1517 ; -3013 1517 F5 CA 10 mov a, (xms_channels_other+6)+x ; 5 -3014 151A 9F xcn a ; 5 -3015 151B 28 03 and a, #3 ; 2 -3016 151D 2D push a ; 4 -3017 151E ; -3018 151E F4 21 movz a, (xms_channels+5)+x ; 4 -3019 1520 5C lsr a ; 2 -3020 1521 5C lsr a ; 2 -3021 1522 28 3C and a, #%00111100 ; 2 -3022 1524 ; -3023 1524 60 clrc ; 2 -3024 1525 94 27 adcz a, (xms_channels+11)+x ; 4 -3025 1527 D4 27 movz (xms_channels+11)+x, a ; 4 } -3026 1529 _xmsfxt_getvalue: ;[136 cycles] -3027 1529 -3028 1529 EE pop y ; 4 get table entry { 110 cycles -3029 152A 3F 14 20 call XMS_GETVIBTABLE ; 46 -3030 152D -3031 152D FD mov y, a ; 2 -3032 152E F4 21 movz a, (xms_channels+5)+x ; 4 -3033 1530 28 0F and a, #15 ; 2 -3034 1532 CF mul ya ; 9 -3035 1533 ; ya = tremolo value ; -3036 1533 4D push x ; 4 -3037 1534 CD 40 mov x, #64 ; 2 -3038 1536 9E div ya, x ; 12 -3039 1537 CE pop x ; 4 -3040 1538 ; -3041 1538 AA 9E E0 mov1 c, (xms_cc_flags+(7<<13)) ; 4 -3042 153B B0 03 bcs _xmsfxt_add_val ; 2/4 -3043 153D 48 FF eor a, #255 ; 2 -3044 153F BC inc a ; 2 -3045 1540 _xmsfxt_add_val: ; -3046 1540 60 clrc ; 2 -3047 1541 D5 D2 10 mov (xms_channels_other+coso_vadd)+x, a ; 6 -3048 1544 94 22 adcz a, (xms_channels+6)+x ; 3 } -3049 1546 _xmsfxt_setvalue: ;[26 cycles] -3050 1546 -3051 1546 68 41 cmp a, #65 ; 2 clamp to 0-64 { 26 cycles -3052 1548 90 0A bcc _xmsfxt_clip_good ; 2/4 -3053 154A 68 80 cmp a, #128 ; 2 -3054 154C B0 04 bcs _xmsfxt_gt ; 2/4 -3055 154E E8 40 mov a, #64 ; 2 -3056 1550 2F 02 b _xmsfxt_clip_good ; 4 -3057 1552 _xmsfxt_gt: ; -3058 1552 E8 00 mov a, #0 ; 2 -3059 1554 _xmsfxt_clip_good: ; -3060 1554 ; a = channel volume ; -3061 1554 C4 A5 movz (xms_cc_volume), a ; 4 set volume -3062 1556 18 04 9E or (xms_cc_flags), #ccflag_volume ; 5 set flag -3063 1559 ; -3064 1559 5F EF 12 jmp _xmspme_exit ; 3 } -3065 155C~ #else -3066 155C~ -3067 155C~ XMS_FX_TREMOLOf: -3068 155C~ XMS_FX_TREMOLOo: -3069 155C~ jmp _xmspme_exit -3070 155C~ -3071 155C #endif -3072 155C -3073 155C ; EFFECT 8xy SET PANNING ------------------------------------------------------------------------------------------------ -3074 155C XMS_FX_PANf: ;[33 cycles] -3075 155C ; set pan! ; -3076 155C CE pop x ; 4 get chan -3077 155D 4D push x ; 4 -3078 155E F4 21 movz a, (xms_channels+5)+x ; 4 get param -3079 1560 5C lsr a ; 2 shift -3080 1561 5C lsr a ; 2 -3081 1562 D4 25 movz (xms_channels+9)+x, a ; 5 set -3082 1564 C4 A6 movz (xms_cc_panning), a ; 4 -3083 1566 18 08 9E or (xms_cc_flags), #ccflag_panning ; 5 -3084 1569 5F EF 12 jmp _xmspme_exit ; 3 ret -3085 156C ;XMS_FX_PANo: ; -3086 156C ; ; do nothing ; -3087 156C ; jmp _xmspme_exit ; -3088 156C -3089 156C ; EFFECT 9xx SAMPLE OFFSET ------------------------------------------------------------------------------------------------ -3090 156C XMS_FX_SAMPOFFf: ;[24 cycles] -3091 156C CE pop x ; 4 get chan -3092 156D 4D push x ; 4 -3093 156E F4 21 movz a, (xms_channels+5)+x ; 4 get param -3094 1570 C4 A8 movz (xms_cc_sampoff), a ; 4 store -3095 1572 18 20 9E or (xms_cc_flags), #ccflag_offset ; 5 set flag -3096 1575 XMS_FX_SAMPOFFo: ; -3097 1575 5F EF 12 jmp _xmspme_exit ; 3 -3098 1578 ; -3099 1578 ; EFFECT Axy VOLUME SLIDE ------------------------------------------------------------------------------------------------ -3100 1578 XMS_FX_VOLUMESLIDEf: ;[38 cycles] -3101 1578 CE pop x ; 4 get chan -3102 1579 4D push x ; 4 -3103 157A F4 21 movz a, (xms_channels+5)+x ; 4 check prev data -3104 157C D0 05 bne _xmsfxvols_isparam ; 2/4 -3105 157E F5 4B 11 mov a, (XMS_FXP_PREVIOUS+7)+x ; 5 -3106 1581 D4 21 movz (xms_channels+5)+x, a ; 5 -3107 1583 _xmsfxvols_isparam: ; -3108 1583 D5 4B 11 mov (XMS_FXP_PREVIOUS+7)+x, a ; 6 -3109 1586 CD 00 mov x, #0 ; 2 -3110 1588 1F 18 00 jmp [fx_return+x] ; 6 ------------- -3111 158B XMS_FX_VOLUMESLIDEo: ;[61 cycles] -3112 158B CE pop x ; 4 get chan { 14 cycles -3113 158C 4D push x ; 4 -3114 158D F4 21 movz a, (xms_channels+5)+x ; 4 get param -3115 158F 68 10 cmp a, #16 ; 2 check slide direction } -3116 1591 B0 11 bcs _xmsfxvs_hiparam ; 2/4 -3117 1593 ; loparam ; -3118 1593 28 0F and a, #$0F ; 2 { 28 cycles + nojump(2) -3119 1595 ; subtract from volume ; -3120 1595 80 setc ; 2 -3121 1596 C4 0A movz (int1), a ; 4 -3122 1598 F4 22 movz a, (xms_channels+6)+x ; 4 get volume -3123 159A A4 0A sbcz a, (int1) ; 3 slide -3124 159C B0 02 bcs _xmsfxvs_lo_over ; 2/4 -3125 159E E8 00 mov a, #0 ; 2 clip -3126 15A0 _xmsfxvs_lo_over: ; -3127 15A0 D4 22 movz (xms_channels+6)+x, a ; 5 store -3128 15A2 2F 0E b _xmsfxvs_finish ; 4 } -3129 15A4 _xmsfxvs_hiparam: ; -3130 15A4 28 F0 and a, #$F0 ; 2 { 24 cycles + jump(4) -3131 15A6 9F xcn a ; 5 -3132 15A7 ; add to volume ; -3133 15A7 60 clrc ; 2 -3134 15A8 94 22 adcz a, (xms_channels+6)+x ; 4 slide volume -3135 15AA 68 40 cmp a, #64 ; 2 clip -3136 15AC 90 02 bcc _xmsfxvs_hi_over ; 2/4 -3137 15AE E8 40 mov a, #64 ; 2 -3138 15B0 _xmsfxvs_hi_over: ; -3139 15B0 D4 22 movz (xms_channels+6)+x, a ; 5 store } -3140 15B2 _xmsfxvs_finish: ; -3141 15B2 ; -3142 15B2 C4 A5 movz (xms_cc_volume), a ; 4 { 17 cycles -3143 15B4 18 04 9E or (xms_cc_flags), #ccflag_volume ; 5 -3144 15B7 ; -3145 15B7 CD 00 mov x, #0 ; 2 -3146 15B9 1F 18 00 jmp [fx_return+x] ; 6 } -3147 15BC -3148 15BC ; EFFECT Bxy PATTERN JUMP ------------------------------------------------------------------------------------------------ -3149 15BC XMS_FX_PATTERNJUMPf: ;[24 cycles] -3150 15BC CE pop x ; 4 get chan -3151 15BD 4D push x ; 4 -3152 15BE F4 21 movz a, (xms_channels+5)+x ; 4 get param -3153 15C0 C4 C2 movz (xms_patt_jump), a ; 4 set patt jump params -3154 15C2 8F 01 C4 mov (xms_patt_jump_enable), #1 ; 5 -3155 15C5 XMS_FX_PATTERNJUMPo: ; -3156 15C5 5F EF 12 jmp _xmspme_exit ; 3 -3157 15C8 -3158 15C8 ; EFFECT Cxy SET VOLUME --------------------------------------------------------------------------------------------------- -3159 15C8 XMS_FX_SETVOLUMEf: ;[40 cycles] -3160 15C8 CE pop x ; 4 get chan -3161 15C9 4D push x ; 4 -3162 15CA F4 21 movz a, (xms_channels+5)+x ; 4 get param -3163 15CC 68 40 cmp a, #64 ; 2 check -3164 15CE 90 02 bcc _xmsfxsv_lt_64 ; 2/4 -3165 15D0 E8 40 mov a, #64 ; 2 set to 64 if greater than -3166 15D2 _xmsfxsv_lt_64: -3167 15D2 D4 22 movz (xms_channels+6)+x, a ; 5 set volume -3168 15D4 C4 A5 movz (xms_cc_volume), a ; 4 -3169 15D6 18 04 9E or (xms_cc_flags), #%ccflag_volume ; 5 &flag -3170 15D9 XMS_FX_SETVOLUMEo: -3171 15D9 CD 00 mov x, #0 ; 2 return -3172 15DB 1F 18 00 jmp [fx_return+x] ; 6 -3173 15DE -3174 15DE ; EFFECT Dxy PATTERN BREAK ------------------------------------------------------------------------------------------------ -3175 15DE XMS_FX_PATTERNBREAKf: ;[193 cycles] (5 loops) -3176 15DE E4 B1 movz a, (xms_position) ; 4 { 33 cycles -3177 15E0 BC inc a ; 2 -3178 15E1 ; this function WILL crash if the xms does not have a proper table -3179 15E1 -3180 15E1 C4 C2 movz (xms_patt_jump), a ; 4 omg, will break on pattern 255 -3181 15E3 8F 01 C4 mov (xms_patt_jump_enable), #1 ; 5 enable jump -3182 15E6 -3183 15E6 CE pop x ; 4 get chan -3184 15E7 4D push x ; 4 -3185 15E8 F4 21 movz a, (xms_channels+cso_fxparam)+x ; 4 -3186 15EA -3187 15EA C4 C3 movz (xms_patt_jump+1), a ; 4 -3188 15EC -3189 15EC ; cmp a, #0 ; 2 } -3190 15EC D0 06 bne _xmsfx_pb_notzero ; 2/4 { 14 cycles -3191 15EE ; mov a, #0 ; 2 break to zero is much faster -3192 15EE FD mov y, a ; 2 -3193 15EF DA C5 movw (xms_patt_jump_offset), ya ; 4 -3194 15F1 5F EF 12 jmp _xmspme_exit ; 3 -3195 15F4 _xmsfx_pb_notzero: ; -3196 15F4 -3197 15F4 EB B8 movz y, (xms_pattern_plus) -3198 15F6 F7 B6 mov a, [xms_pattern_read]+y -3199 15F8 -3200 15F8 D0 02 bne _xmsfx_pb_startsearch -3201 15FA 2F 0C b _xmsfx_pb_instant -3202 15FC _xmsfx_pb_startsearch: -3203 15FC ; -3204 15FC EB C2 movz y, (xms_patt_jump) ; 3 -3205 15FE F6 1E 21 mov a, (c_xmsoffset+xmso_orders)+y ; 5 JUMP WILL NOT BE 3, FIX PLEASE -3206 1601 EB B8 movz y, (xms_pattern_plus) ; ? } -3207 1603 FC inc y -3208 1604 -3209 1604 _xmsfx_pb_search: -3210 1604 77 B6 cmpi a, [xms_pattern_read]+y ; 6 compare index { 5 misses, 146 cycles -3211 1606 D0 28 bne _xmsfx_pb_next ; 2/4 branch to next if not match -3212 1608 _xmsfx_pb_instant: -3213 1608 FC inc y ; 2 { 46 cycles -3214 1609 F7 B6 mov a, [xms_pattern_read]+y ; 6 -3215 160B -3216 160B C4 C5 movz (xms_patt_jump_offset), a ; 4 -3217 160D FC inc y ; 2 -3218 160E F7 B6 mov a, [xms_pattern_read]+y ; 6 -3219 1610 C4 C6 movz (xms_patt_jump_offset+1), a ; 4 -3220 1612 -3221 1612 EB B8 movz y, (xms_pattern_plus) ; 2 -3222 1614 F7 B6 mov a, [xms_pattern_read]+y ; 6 -3223 1616 F0 0B beq _xmsfx_pb_fexit -3224 1618 60 clrc ; 2 -3225 1619 84 B6 adcz a, (xms_pattern_read) ; 3 -3226 161B C4 B6 movz (xms_pattern_read), a ; 4 -3227 161D 98 00 B7 adc (xms_pattern_read+1), #0 ; 5 } -3228 1620 5F EF 12 jmp _xmspme_exit -3229 1623 _xmsfx_pb_fexit: -3230 1623 60 clrc -3231 1624 E8 03 mov a, #3 -3232 1626 84 B6 adcz a, (xms_pattern_read) -3233 1628 C4 B6 movz (xms_pattern_read), a -3234 162A 98 00 B7 adc (xms_pattern_read+1), #0 -3235 162D 5F EF 12 jmp _xmspme_exit -3236 1630 -3237 1630 _xmsfx_pb_next: -3238 1630 FC inc y ; 2 { 9 cycles -3239 1631 FC inc y ; 2 -3240 1632 FC inc y ; 2 -3241 1633 5F 04 16 jmp _xmsfx_pb_search ; 3 } } -3242 1636 _xmsfx_pb_match: -3243 1636 ;XMS_FX_PATTERNBREAKo: -3244 1636 ; jmp _xmspme_exit -3245 1636 -3246 1636 ; EFFECT Fxy SET SPEED ---------------------------------------------------------------------------------------------------- -3247 1636 XMS_FX_SETSPEEDf: ;[150 cycles] -3248 1636 CE pop x ; 4 get chan -3249 1637 4D push x ; 4 -3250 1638 F4 21 movz a, (xms_channels+5)+x ; 4 read param -3251 163A 68 20 cmp a, #32 ; 2 check speed/bpm -3252 163C B0 05 bcs _xmsfxss_bpm ; 2/4 -3253 163E ; set speed ; -3254 163E C4 AF movz (xms_speed), a ; 4 set speed -3255 1640 5F EF 12 jmp _xmspme_exit ; 3 -3256 1643 _xmsfxss_bpm: ; or.. -3257 1643 ; set bpm ; -3258 1643 3F 11 0B call XMS_SetBPM ; 8+124 set bpm -3259 1646 ; -3260 1646 ; uses jump from other ticks! ; -3261 1646 XMS_FX_SETSPEEDo: ; -3262 1646 5F EF 12 jmp _xmspme_exit ; 3 -3263 1649 ; ------------------------------------------------------------------------------------------------------------------------- -3264 1649 ; EFFECT Exy EXTENDED EFFECTS --------------------------------------------------------------------------------------------- -3265 1649 ; ------------------------------------------------------------------------------------------------------------------------- -3266 1649 -3267 1649 ; Extended Effect Table -3268 1649 table_effect_ex_first: -3269 1649 A1 16 .word XMS_FX_EX_SETFILTERf ; E0y Set Filter ( XMSNES EXCLUSIVE ) -3270 164B 3B 17 .word XMS_FX_EX_FINEPORTAUPf ; E1y Fine Porta Up -3271 164D 58 17 .word XMS_FX_EX_FINEPORTADOWNf ; E2y Fine Porta Down -3272 164F 75 17 .word XMS_FX_EX_GLISSANDOCTRLf ; E3y Glissando Control ( NOT IMPLEMENTED ) -3273 1651 7C 17 .word XMS_FX_EX_VIBRATOFORMf ; E4y Vibrato Waveform -3274 1653 96 17 .word XMS_FX_EX_SETFINETUNEf ; E5y Set Finetune ( NOT IMPLEMENTED ) -3275 1655 99 17 .word XMS_FX_EX_PATTERNLOOPf ; E6y Pattern Loop -3276 1657 BE 17 .word XMS_FX_EX_TREMOLOFORMf ; E7y Tremolo Waveform -3277 1659 D8 17 .word XMS_FX_EX_SETPANNINGf ; E8y Set Panning -3278 165B ED 17 .word XMS_FX_EX_RETRIGGERf ; E9y Retrigger Note -3279 165D 1B 18 .word XMS_FX_EX_FINEVOLUPf ; EAy Fine Volume Slide Up -3280 165F 33 18 .word XMS_FX_EX_FINEVOLDOWNf ; EBy Fine Volume Slide Down -3281 1661 4B 18 .word XMS_FX_EX_NOTECUTf ; ECy Note Cut -3282 1663 71 18 .word XMS_FX_EX_NOTEDELAYf ; EDy Note Delay -3283 1665 A4 18 .word XMS_FX_EX_PATTERNDELAYf ; EEy Pattern Delay -3284 1667 B5 18 .word XMS_FX_EX_SENDMESSAGEf ; EFy Send Message ( XMSNES EXCLUSIVE ) -3285 1669 -3286 1669 table_effect_ex_other: -3287 1669 38 17 .word XMS_FX_EX_SETFILTERo -3288 166B 55 17 .word XMS_FX_EX_FINEPORTAUPo -3289 166D 72 17 .word XMS_FX_EX_FINEPORTADOWNo -3290 166F 75 17 .word XMS_FX_EX_GLISSANDOCTRLo -3291 1671 93 17 .word XMS_FX_EX_VIBRATOFORMo -3292 1673 96 17 .word XMS_FX_EX_SETFINETUNEo -3293 1675 BB 17 .word XMS_FX_EX_PATTERNLOOPo -3294 1677 D5 17 .word XMS_FX_EX_TREMOLOFORMo -3295 1679 EA 17 .word XMS_FX_EX_SETPANNINGo -3296 167B F8 17 .word XMS_FX_EX_RETRIGGERo -3297 167D 30 18 .word XMS_FX_EX_FINEVOLUPo -3298 167F 48 18 .word XMS_FX_EX_FINEVOLDOWNo -3299 1681 58 18 .word XMS_FX_EX_NOTECUTo -3300 1683 7E 18 .word XMS_FX_EX_NOTEDELAYo -3301 1685 B2 18 .word XMS_FX_EX_PATTERNDELAYo -3302 1687 C9 18 .word XMS_FX_EX_SENDMESSAGEo -3303 1689 -3304 1689 XMS_FX_EXTENDEDf: ;[29+? cycles] -3305 1689 CE pop x ; 4 get chan -3306 168A 4D push x ; 4 -3307 168B F4 21 movz a, (xms_channels+5)+x ; 4 get param -3308 168D 9F xcn a ; 5 swap -3309 168E 28 0F and a, #15 ; 2 a = (param & hi) >> 4 -3310 1690 1C asl a ; 2 *2 -3311 1691 5D mov x, a ; 2 move -3312 1692 1F 49 16 jmp [table_effect_ex_first+x] ; 6+? jump to routine -3313 1695 XMS_FX_EXTENDEDo: ;[29+? cycles] -3314 1695 CE pop x ; 4 -3315 1696 4D push x ; 4 -3316 1697 F4 21 movz a, (xms_channels+5)+x ; 4 -3317 1699 9F xcn a ; 5 -3318 169A 28 0F and a, #15 ; 2 -3319 169C 1C asl a ; 2 -3320 169D 5D mov x, a ; 2 -3321 169E 1F 69 16 jmp [table_effect_ex_other+x] ; 6+? -3322 16A1 -3323 16A1 ; EFFECT E0y SET FILTER ------------------------------------------------------------------------ -3324 16A1 XMS_FX_EX_SETFILTERf: ;[349 cycles] -3325 16A1 CE pop x ; 4 get chan { 24 cycles -3326 16A2 4D push x ; 4 -3327 16A3 F4 21 movz a, (xms_channels+5)+x ; 4 -3328 16A5 68 01 cmp a, #1 ; 2 -3329 16A7 F0 09 beq _xmsfxxsf_on ; 2/4 -3330 16A9 68 02 cmp a, #2 ; 2 -3331 16AB F0 0D beq _xmsfxxsf_off ; 2/4 -3332 16AD B0 18 bcs _xmsfxxsf_set ; 2/4 } jump.. -3333 16AF 5F EF 12 jmp _xmspme_exit ; 3 -3334 16B2 _xmsfxxsf_on: ; -3335 16B2 8F 4D F2 mov ($F2), #DSP_EON ; 5 enable echo -3336 16B5 09 17 F3 or ($F3), (channel_bit) ; 6 -3337 16B8 2F 7E b XMS_FX_EX_SETFILTERo ; 4+3 -3338 16BA _xmsfxxsf_off: ; -3339 16BA 8F 4D F2 mov ($F2), #DSP_EON ; 5 disable echo -3340 16BD E4 17 movz a, (channel_bit) ; 3 -3341 16BF 48 FF eor a, #255 ; 2 -3342 16C1 24 F3 andz a, ($F3) ; 3 -3343 16C3 C4 F3 movz ($F3), a ; 4 -3344 16C5 2F 71 b XMS_FX_EX_SETFILTERo ; 4+3 -3345 16C7 _xmsfxxsf_set: -3346 16C7 ; a = filter + 3 ; -3347 16C7 -3348 16C7 8F 7D F2 mov ($F2), #DSP_EDL ; RESET EDL -3349 16CA 8F 00 F3 mov ($F3), #0 ; -3350 16CD 8F 6C F2 mov $F2, #DSP_FLG ; DISABLE ECHO WRITE -3351 16D0 18 20 F3 or $F3, #%00100000 ; -3352 16D3 -3353 16D3 A8 03 sbc a, #3 ; 2 carry was set with cmp earlier { 47 cycles -3354 16D5 8D 0C mov y, #12 ; 2 -3355 16D7 CF mul ya ; 9 mul (filter*12) -3356 16D8 C4 0C movz (int2), a ; 4 -3357 16DA E5 0B 21 mov a, (c_xmsoffset + xmso_foff+1) ; 4 add filter table offset -3358 16DD 60 clrc ; 2 ... -3359 16DE 88 21 adc a, #c_xmsoffseth ; 2 ... -3360 16E0 C4 0B movz (int1+1), a ; 4 ... -3361 16E2 E5 0A 21 mov a, (c_xmsoffset + xmso_foff) ; 4 ... -3362 16E5 84 0C adcz a, (int2) ; 3 ... -3363 16E7 98 00 0B adc (int1+1), #0 ; 5 ... -3364 16EA C4 0A movz (int1), a ; 4 ... -3365 16EC 8D 00 mov y, #0 ; 2 ... } -3366 16EE -3367 16EE F7 0A mov a, [int1]+y ; 6 volume L { 17 cycles -3368 16F0 FC inc y ; 2 -3369 16F1 8F 2C F2 mov ($F2), #DSP_EVOLL ; 5 -3370 16F4 C4 F3 movz ($F3), a ; 4 } -3371 16F6 -3372 16F6 F7 0A mov a, [int1]+y ; 6 volume R { 17 cycles -3373 16F8 FC inc y ; 2 -3374 16F9 8F 3C F2 mov ($F2), #DSP_EVOLR ; 5 -3375 16FC C4 F3 movz ($F3), a ; 4 } -3376 16FE ; -3377 16FE 8F 0F F2 mov ($F2), #DSP_C0 ; 5 set filter coefficients... { 187 cycles -3378 1701 _xmsfxxsf_set_loop: ; -3379 1701 F7 0A mov a, [int1]+y ; 6 -3380 1703 FC inc y ; 2 -3381 1704 C4 F3 movz ($F3), a ; 4 -3382 1706 98 10 F2 adc ($F2), #$10 ; 5 carry was cleared above -3383 1709 AD 0A cmp y, #$A ; 2 -3384 170B D0 F4 bne _xmsfxxsf_set_loop ; 2/4 } -3385 170D ; -3386 170D F7 0A mov a, [int1]+y ; 6 fetch EDL { 17 cycles -3387 170F FC inc y ; 2 -3388 1710 2D push a -3389 1711 -3390 1711 1C asl a ; 2 -3391 1712 1C asl a ; 2 -3392 1713 1C asl a ; 2 -3393 1714 8F 6D F2 mov ($F2), #DSP_ESA ; 5 -3394 1717 48 FF eor a, #255 ; 2 -3395 1719 -3396 1719 C4 F3 movz ($F3), a ; 4 -3397 171B E5 09 21 mov a, (c_xmsoffset+xmso_freqmode) -3398 171E D0 04 bne _xmsfxxsf_notamiga -3399 1720 ; make space for amiga table -3400 1720 80 setc -3401 1721 B8 10 F3 sbc ($F3), #16 -3402 1724 _xmsfxxsf_notamiga: -3403 1724 8F 0D F2 mov ($F2), #DSP_EFB ; 5 -3404 1727 F7 0A mov a, [int1]+y -3405 1729 C4 F3 movz ($F3), a ; 4 -3406 172B -3407 172B AE pop a -3408 172C -3409 172C 8F 7D F2 mov $F2, #DSP_EDL -3410 172F C5 F3 00 mov ($F3), a -3411 1732 -3412 1732 8F 6C F2 mov ($F2), #DSP_FLG ; enable echo -3413 1735 8F 00 F3 mov ($F3), #%00000000 ; ----------------------------------------------------- WILL MESS UP NOISE... -3414 1738 ; -3415 1738 XMS_FX_EX_SETFILTERo: ; -3416 1738 5F EF 12 jmp _xmspme_exit ; 3 } -3417 173B -3418 173B ; EFFECT E1y FINE PORTA UP ----------------------------------------------------------------------- -3419 173B XMS_FX_EX_FINEPORTAUPf: ;[140 cycles] -3420 173B CE pop x ; 4 get chan -3421 173C 4D push x ; 4 -3422 173D F4 21 movz a, (xms_channels+5)+x ; 4 get param -3423 173F 28 0F and a, #15 ; 2 -3424 1741 D0 05 bne _xmsfxxfpu_isparam ; 2/4 if zero, get previous -3425 1743 F5 4C 11 mov a, (XMS_FXP_PREVIOUS+8)+x ; 5 -3426 1746 D4 21 movz (xms_channels+5)+x, a ; 5 -3427 1748 _xmsfxxfpu_isparam: ; -3428 1748 D5 4C 11 mov (XMS_FXP_PREVIOUS+8)+x, a ; 6 -3429 174B 28 0F and a, #15 ; 2 -3430 174D 1C asl a ; 2 -3431 174E 1C asl a ; 2 -3432 174F 8F 00 0C mov (int2), #0 ; 5 -3433 1752 3F C2 1C call XMS_CHANNEL_PITCH_SLIDEUP ; 8+86 slide.. -3434 1755 ; -3435 1755 ; uses jump from other ticks! ; -3436 1755 XMS_FX_EX_FINEPORTAUPo: ; -3437 1755 5F EF 12 jmp _xmspme_exit ; 3 -3438 1758 -3439 1758 ; EFFECT E2y FINE PORTA DOWN ----------------------------------------------------------------------------------------------- -3440 1758 XMS_FX_EX_FINEPORTADOWNf: ;[134 cycles] -3441 1758 CE pop x ; 4 get chan -3442 1759 4D push x ; 4 -3443 175A F4 21 movz a, (xms_channels+5)+x ; 4 get param -3444 175C 28 0F and a, #15 ; 2 -3445 175E D0 05 bne _xmsfxxfpd_isparam ; 2/4 -3446 1760 F5 4D 11 mov a, (XMS_FXP_PREVIOUS+9)+x ; 5 -3447 1763 D4 21 movz (xms_channels+5)+x, a ; 5 -3448 1765 _xmsfxxfpd_isparam: ; -3449 1765 D5 4D 11 mov (XMS_FXP_PREVIOUS+9)+x, a ; 6 -3450 1768 28 0F and a, #15 ; 2 -3451 176A 1C asl a ; 2 -3452 176B 1C asl a ; 2 -3453 176C 8F 00 0C mov (int2), #0 ; 5 -3454 176F 3F CC 1C call XMS_CHANNEL_PITCH_SLIDEDOWN ; 8+80 slide -3455 1772 ; -3456 1772 ; uses jump from other ticks! ; -3457 1772 XMS_FX_EX_FINEPORTADOWNo: ; -3458 1772 5F EF 12 jmp _xmspme_exit ; 3 -3459 1775 -3460 1775 ; EFFECT E3y GLISSANDO CONTROL ----------------------------------------------------------------------------------------------- -3461 1775 XMS_FX_EX_GLISSANDOCTRLf: ;[3 cycles] -3462 1775 ; uses jump from other ticks! ; -3463 1775 XMS_FX_EX_GLISSANDOCTRLo: ; -3464 1775 5F EF 12 jmp _xmspme_exit ; 3 -3465 1778 -3466 1778 table_vib_conv: -3467 1778 00 03 01 00 .byte 0, 3, 1, 0 -3468 177C -3469 177C ; EFFECT E4y VIBRATO WAVEFORM ----------------------------------------------------------------------------------------------- -3470 177C XMS_FX_EX_VIBRATOFORMf: ;[46 cycles] -3471 177C CE pop x ; 4 get chan -3472 177D 4D push x ; 4 -3473 177E F4 21 movz a, (xms_channels+5)+x ; 4 get param -3474 1780 28 03 and a, #3 ; 2 -3475 1782 5D mov x, a ; 2 -3476 1783 F5 78 17 mov a, (table_vib_conv)+x ; 5 convert param -3477 1786 ; -3478 1786 1C asl a ; 2 -3479 1787 C4 0A movz (int1), a ; 4 -3480 1789 ; -3481 1789 F5 CA 10 mov a, (xms_channels_other+6)+x ; 5 store -3482 178C 28 F9 and a, #%11111001 ; 2 edit flags -3483 178E 04 0A orz a, (int1) ; 3 -3484 1790 D5 CA 10 mov (xms_channels_other+6)+x, a ; 6 -3485 1793 ; -3486 1793 XMS_FX_EX_VIBRATOFORMo: ; -3487 1793 5F EF 12 jmp _xmspme_exit ; 3 -3488 1796 -3489 1796 ; EFFECT E5y SET FINETUNE ----------------------------------------------------------------------------------------------- -3490 1796 XMS_FX_EX_SETFINETUNEf: ;[3 cycles] -3491 1796 ; uses jump from other ticks! ; -3492 1796 XMS_FX_EX_SETFINETUNEo: ; -3493 1796 5F EF 12 jmp _xmspme_exit ; -3494 1799 -3495 1799 ; EFFECT E6y PATTERN LOOP ----------------------------------------------------------------------------------------------- -3496 1799 XMS_FX_EX_PATTERNLOOPf: ;[35 cycles] -3497 1799 CE pop x ; 4 get chan -3498 179A 4D push x ; 4 -3499 179B F4 21 movz a, (xms_channels+5)+x ; 4 get param -3500 179D 28 0F and a, #$0F ; 2 -3501 179F F0 13 beq _xmsfxxpl_set ; 2/4 set jump pos if zero -3502 17A1 78 00 CA cmp (xms_patt_loop), #0 ; 5 check loop count -3503 17A4 D0 04 bne _xmsfxxpl_hasloop ; 2/4 -3504 17A6 C4 CA movz (xms_patt_loop), a ; 4 -3505 17A8 2F 04 b _xmsfxxpl_gotloop ; 4 -3506 17AA _xmsfxxpl_hasloop: ; -3507 17AA 8B CA decz (xms_patt_loop) ; 4 -3508 17AC F0 0D beq XMS_FX_EX_PATTERNLOOPo ; 2/4 -3509 17AE _xmsfxxpl_gotloop: ; -3510 17AE 18 10 CA or (xms_patt_loop), #$10 ; 5 stuff.. -3511 17B1 5F EF 12 jmp _xmspme_exit ; 3 -3512 17B4 _xmsfxxpl_set: ; -3513 17B4 BA B6 movw ya, (xms_pattern_read) ; 5 -3514 17B6 DA C8 movw (xms_patt_loop_pos), ya ; 4 -3515 17B8 FA B2 CB mov (xms_patt_loop_row), (xms_row) ; 5 -3516 17BB XMS_FX_EX_PATTERNLOOPo: ; -3517 17BB 5F EF 12 jmp _xmspme_exit ; 3 -3518 17BE -3519 17BE ; EFFECT E7y TREMOLO WAVEFORM ----------------------------------------------------------------------------------------------- -3520 17BE XMS_FX_EX_TREMOLOFORMf: ;[46 cycles] -3521 17BE AE pop a ; 4 get chan -3522 17BF 2D push a ; 4 -3523 17C0 F4 21 movz a, (xms_channels+5)+x ; 4 get param -3524 17C2 28 03 and a, #3 ; 2 -3525 17C4 5D mov x, a ; 2 -3526 17C5 F5 78 17 mov a, (table_vib_conv)+x ; 5 convert param -3527 17C8 ; -3528 17C8 9F xcn a ; 5 -3529 17C9 C4 0A movz (int1), a ; 4 -3530 17CB ; -3531 17CB F5 CA 10 mov a, (xms_channels_other+6)+x ; 5 store -3532 17CE 28 CF and a, #%11001111 ; 2 edit flags -3533 17D0 04 0A orz a, (int1) ; 3 -3534 17D2 D5 CA 10 mov (xms_channels_other+6)+x, a ; 6 -3535 17D5 ; -3536 17D5 XMS_FX_EX_TREMOLOFORMo: ; -3537 17D5 5F EF 12 jmp _xmspme_exit ; 3 -3538 17D8 -3539 17D8 ; EFFECT E8y Set Panning (old) ----------------------------------------------------------------------------------------------- -3540 17D8 XMS_FX_EX_SETPANNINGf: ;[35 cycles] -3541 17D8 CE pop x ; 4 get chan -3542 17D9 4D push x ; 4 -3543 17DA F4 21 movz a, (xms_channels+5)+x ; 4 get param -3544 17DC 28 0F and a, #15 ; 2 parse -3545 17DE 1C asl a ; 2 -3546 17DF 1C asl a ; 2 -3547 17E0 D4 25 movz (xms_channels+9)+x, a ; 5 store -3548 17E2 C4 A6 movz (xms_cc_panning), a ; 4 store -3549 17E4 18 08 9E or (xms_cc_flags), #ccflag_panning ; 5 set flag -3550 17E7 5F EF 12 jmp _xmspme_exit ; 3 exit -3551 17EA XMS_FX_EX_SETPANNINGo: ; -3552 17EA 5F EF 12 jmp _xmspme_exit ; 3 -3553 17ED -3554 17ED ; EFFECT E9y Retrigger Note (old) ----------------------------------------------------------------------------------------------- -3555 17ED XMS_FX_EX_RETRIGGERf: ;[22 cycles] -3556 17ED CE pop x ; 4 get chan -3557 17EE 4D push x ; 4 -3558 17EF F4 21 movz a, (xms_channels+5)+x ; 4 get param -3559 17F1 28 0F and a, #15 ; 2 parse -3560 17F3 D4 27 movz (xms_channels+11)+x, a ; 5 set counter -3561 17F5 5F EF 12 jmp _xmspme_exit ; 3 -3562 17F8 XMS_FX_EX_RETRIGGERo: ;[45 cycles] -3563 17F8 CE pop x ; 4 get chan -3564 17F9 4D push x ; 4 -3565 17FA F4 21 movz a, (xms_channels+5)+x ; 4 get param -3566 17FC D0 03 bne _xmsfxxr_skip ; 2/4 exit if zero (??? this is an extended effect) -3567 17FE 5F EF 12 jmp _xmspme_exit ; 3 -3568 1801 _xmsfxxr_skip: ; -3569 1801 F4 27 movz a, (xms_channels+11)+x ; 4 get counter -3570 1803 9C dec a ; 2 decrement -3571 1804 68 00 cmp a, #0 ; 2 -3572 1806 D0 07 bne _xmsfxxr_wait ; 2/4 check if zero -3573 1808 ; -3574 1808 18 01 9E or (xms_cc_flags), #ccflag_keyon ; 5 retrigger note -3575 180B ; -3576 180B F4 21 movz a, (xms_channels+5)+x ; 4 get param -3577 180D 28 0F and a, #15 ; 2 parse -3578 180F ; -3579 180F _xmsfxxr_wait: ; -3580 180F D4 27 movz (xms_channels+11)+x, a ; 5 save -3581 1811 68 01 cmp a, #1 -3582 1813 D0 03 bne _xmsfxxr_exit -3583 1815 09 17 CC or (xms_peek), (channel_bit) -3584 1818 _xmsfxxr_exit: -3585 1818 5F EF 12 jmp _xmspme_exit ; 3 exit -3586 181B -3587 181B ; EFFECT EAy FINE VOLUME SLIDE UP ----------------------------------------------------------------------------------------------- -3588 181B XMS_FX_EX_FINEVOLUPf: ;[76 cycles] -3589 181B CE pop x ; 4 get chan -3590 181C 4D push x ; 4 -3591 181D F4 21 movz a, (xms_channels+5)+x ; 4 get param -3592 181F 28 0F and a, #15 ; 2 parse -3593 1821 D0 05 bne _xmsfxxfvu_isparam ; 2/4 check zero -3594 1823 F5 4E 11 mov a, (XMS_FXP_PREVIOUS+10)+x ; 5 get prev param -3595 1826 D4 21 movz (xms_channels+5)+x, a ; 5 -3596 1828 _xmsfxxfvu_isparam: ; -3597 1828 D5 4E 11 mov (XMS_FXP_PREVIOUS+10)+x, a ; 6 save -3598 182B 28 0F and a, #15 ; 2 -3599 182D ; -3600 182D 3F E1 1C call XMS_CHANNEL_VOLSLIDEu ; 8+31 slide volume -3601 1830 ; uses other jump ; -3602 1830 XMS_FX_EX_FINEVOLUPo: ; -3603 1830 5F EF 12 jmp _xmspme_exit ; 3 -3604 1833 -3605 1833 ; EFFECT EBy FINE VOLUME SLIDE DOWN ----------------------------------------------------------------------------------------------- -3606 1833 XMS_FX_EX_FINEVOLDOWNf: ;[75 cycles] -3607 1833 CE pop x ; 4 get chan -3608 1834 4D push x ; 4 -3609 1835 F4 21 movz a, (xms_channels+5)+x ; 4 get param -3610 1837 28 0F and a, #15 ; 2 parse -3611 1839 D0 05 bne _xmsfxxfvd_isparam ; 2/4 -3612 183B F5 4F 11 mov a, (XMS_FXP_PREVIOUS+11)+x ; 5 -3613 183E D4 21 movz (xms_channels+5)+x, a ; 5 -3614 1840 _xmsfxxfvd_isparam: ; -3615 1840 D5 4F 11 mov (XMS_FXP_PREVIOUS+11)+x, a ; 6 -3616 1843 28 0F and a, #15 ; 2 -3617 1845 ; -3618 1845 3F F2 1C call XMS_CHANNEL_VOLSLIDEd ; 8+33 slide volume -3619 1848 ; uses other jump ; -3620 1848 XMS_FX_EX_FINEVOLDOWNo: ; -3621 1848 5F EF 12 jmp _xmspme_exit ; 3 -3622 184B -3623 184B ; EFFECT ECy NOTE CUT ----------------------------------------------------------------------------------------------- -3624 184B XMS_FX_EX_NOTECUTf: ;[39 cycles] -3625 184B CE pop x ; 4 get chan -3626 184C 4D push x ; 4 -3627 184D F4 21 movz a, (xms_channels+5)+x ; 4 get param -3628 184F 28 0F and a, #15 ; 2 parse -3629 1851 68 00 cmp a, #0 ; 2 cut immediately if zero... -3630 1853 F0 10 beq _xmsfxxnc_cut_imm ; 2/4+19 -3631 1855 5F EF 12 jmp _xmspme_exit ; 3 -3632 1858 XMS_FX_EX_NOTECUTo: ;[40 cycles] -3633 1858 CE pop x ; 4 get chan -3634 1859 4D push x ; 4 -3635 185A F4 21 movz a, (xms_channels+5)+x ; 4 get param -3636 185C 28 0F and a, #15 ; 2 parse -3637 185E 64 B3 cmpz a, (xms_tick) ; 3 compare with tick count -3638 1860 F0 03 beq _xmsfxxnc_cut_imm ; 2/4 -3639 1862 5F EF 12 jmp _xmspme_exit ; 3 -3640 1865 _xmsfxxnc_cut_imm: ; -3641 1865 E8 00 mov a, #0 ; 2 cut volume { 19 cycles -3642 1867 D4 22 movz (xms_channels+6)+x, a ; 5 -3643 1869 C4 A5 movz (xms_cc_volume), a ; 4 -3644 186B 18 04 A5 or (xms_cc_volume), #ccflag_volume ; 5 -3645 186E 5F EF 12 jmp _xmspme_exit ; 3 } -3646 1871 -3647 1871 ; EFFECT EDy NOTE DELAY ----------------------------------------------------------------------------------------------- -3648 1871 XMS_FX_EX_NOTEDELAYf: ;[8 cycles] -3649 1871 CE pop x -3650 1872 4D push x -3651 1873 38 E0 9E and (xms_cc_flags), #( $FF - (ccflag_pitch | ccflag_volume | ccflag_keyon | ccflag_panning | ccflag_source) ) ; 5 prevent keyon -3652 1876 E8 01 mov a, #1 -3653 1878 D5 D3 10 mov (xms_channels_other+coso_ndelay)+x, a -3654 187B 5F EF 12 jmp _xmspme_exit ; 3 -3655 187E XMS_FX_EX_NOTEDELAYo: ;[27 cycles] -3656 187E CE pop x ; 4 get chan -3657 187F 4D push x ; 4 -3658 1880 F4 21 movz a, (xms_channels+5)+x ; 4 get param -3659 1882 28 0F and a, #15 ; 2 -3660 1884 80 setc -3661 1885 A4 B3 sbcz a, (xms_tick) ; 3 compare with tick count -3662 1887 D0 11 bne _xmsfxxnd_wait ; 2/4 -3663 1889 ; -3664 1889 18 1F 9E or (xms_cc_flags), #( ccflag_pitch | ccflag_volume | ccflag_keyon | ccflag_panning | ccflag_source ) ; 5 keyon -3665 188C E8 00 mov a, #0 -3666 188E D5 D3 10 mov (xms_channels_other+coso_ndelay)+x, a -3667 1891 D4 21 movz (xms_channels+cso_fxparam)+x, a -3668 1893 F4 26 movz a, (xms_channels+cso_sample)+x -3669 1895 C4 A7 movz (xms_cc_source), a -3670 1897 -3671 1897 5F EF 12 jmp _xmspme_exit ; 3 -3672 189A _xmsfxxnd_wait: ; -3673 189A 68 01 cmp a, #1 -3674 189C D0 03 bne _xmsfxxnd_exit -3675 189E 09 17 CC or (xms_peek), (channel_bit) -3676 18A1 _xmsfxxnd_exit: ; -3677 18A1 5F EF 12 jmp _xmspme_exit ; 3 -3678 18A4 -3679 18A4 ; EFFECT EEy PATTERN DELAY ----------------------------------------------------------------------------------------------- -3680 18A4 XMS_FX_EX_PATTERNDELAYf: ;[27 cycles] -3681 18A4 CE pop x ; 4 get chan -3682 18A5 4D push x ; 4 -3683 18A6 E4 9D movz a, (xms_fxfirst) ; 3 skip if first trigger... -3684 18A8 28 01 and a, #1 ; 2 -3685 18AA F0 06 beq XMS_FX_EX_PATTERNDELAYo ; 2/4 -3686 18AC ; -3687 18AC F4 21 movz a, (xms_channels+5)+x ; 3 -3688 18AE 28 0F and a, #15 ; 2 -3689 18B0 C4 C1 movz (xms_patt_delay), a ; 4 -3690 18B2 XMS_FX_EX_PATTERNDELAYo: ; -3691 18B2 5F EF 12 jmp _xmspme_exit ; 3 -3692 18B5 -3693 18B5 ; EFFECT EFy SEND MESSAGE ----------------------------------------------------------------------------------------------- -3694 18B5 XMS_FX_EX_SENDMESSAGEf: -3695 18B5 CE pop x -3696 18B6 4D push x -3697 18B7 F4 21 movz a, (xms_channels+cso_fxparam)+x -3698 18B9 28 0F and a, #15 -3699 18BB C4 0A movz (int1), a -3700 18BD E4 DB movz a, (xms_last_message) -3701 18BF 28 80 and a, #128 -3702 18C1 04 0A orz a, (int1) -3703 18C3 48 80 eor a, #128 -3704 18C5 C4 DB movz (xms_last_message), a -3705 18C7 C4 F4 movz ($F4), a -3706 18C9 XMS_FX_EX_SENDMESSAGEo: -3707 18C9 5F EF 12 jmp _xmspme_exit -3708 18CC -3709 18CC ; ---------------------------------------------------------------------------------------------------- -3710 18CC ; XM EFFECTS -3711 18CC ; ---------------------------------------------------------------------------------------------------- -3712 18CC ; EFFECT Gxy SET GLOBAL VOLUME ----------------------------------------------------------------------------------------------- -3713 18CC XMS_FX_SETGLOBALVOLf: ;[25 cycles] -3714 18CC CE pop x ; 4 blah blah -3715 18CD 4D push x ; 4 -3716 18CE F4 21 movz a, (xms_channels+5)+x ; 4 blah -3717 18D0 68 41 cmp a, #65 ; 2 clip -3718 18D2 90 02 bcc _xmsfxsgv_vol_good ; 2/4 -3719 18D4 E8 40 mov a, #64 ; 2 -3720 18D6 _xmsfxsgv_vol_good: ; -3721 18D6 C4 C7 movz (xms_global_vol), a ; 4 set global vol -3722 18D8 XMS_FX_SETGLOBALVOLo: ; -3723 18D8 5F EF 12 jmp _xmspme_exit ; 3 exit -3724 18DB -3725 18DB ; EFFECT Hxy GLOBAL VOLUME SLIDE ----------------------------------------------------------------------------------------------- -3726 18DB XMS_FX_GLOBALVOLSLIDEf: ;[33 cycles] -3727 18DB CE pop x ; 4 get chan -3728 18DC 4D push x ; 4 -3729 18DD F4 21 movz a, (xms_channels+5)+x ; 4 check/get prev data -3730 18DF D0 05 bne _xmsfxgvs_isparam ; 2/4 -3731 18E1 F5 50 11 mov a, (XMS_FXP_PREVIOUS+12)+x ; 5 -3732 18E4 D4 21 movz (xms_channels+5)+x, a ; 5 -3733 18E6 _xmsfxgvs_isparam: ; -3734 18E6 D5 50 11 mov (XMS_FXP_PREVIOUS+12)+x, a ; 6 -3735 18E9 xmsfxgvs_isparam: ; -3736 18E9 ; -3737 18E9 5F EF 12 jmp _xmspme_exit ; 3 -3738 18EC XMS_FX_GLOBALVOLSLIDEo: ;[46 cycles] -3739 18EC CE pop x ; 4 get chan -3740 18ED 4D push x ; 4 -3741 18EE F4 21 movz a, (xms_channels+5)+x ; 5 get param -3742 18F0 68 10 cmp a, #16 ; 2 -3743 18F2 90 0E bcc _xmsfxgvs_down ; 2/4 -3744 18F4 9F xcn a ; 5 slide volume up: -3745 18F5 28 0F and a, #15 ; 2 -3746 18F7 60 clrc ; 2 -3747 18F8 84 C7 adcz a, (xms_global_vol) ; 3 -3748 18FA 68 40 cmp a, #64 ; 2 -3749 18FC 90 0D bcc _xmsfxgvs_finish ; 2/4 -3750 18FE E8 40 mov a, #64 ; 2 clip -3751 1900 2F 09 b _xmsfxgvs_finish ; 4 -3752 1902 _xmsfxgvs_down: ; slide volume down: -3753 1902 80 setc ; 2 -3754 1903 E4 C7 movz a, (xms_global_vol) ; 4 -3755 1905 B4 21 sbcz a, (xms_channels+5)+x ; 4 -3756 1907 10 02 bpl _xmsfxgvs_finish ; 2/4 -3757 1909 E8 00 mov a, #0 ; 2 clip -3758 190B _xmsfxgvs_finish: ; -3759 190B C4 C7 movz (xms_global_vol), a ; 4 store -3760 190D 5F EF 12 jmp _xmspme_exit ; 3 -3761 1910 -3762 1910 ; EFFECT Kxy KEY OFF ----------------------------------------------------------------------------------------------- -3763 1910 XMS_FX_KEYOFFf: ;[42 cycles] -3764 1910 CE pop x ; 4 get chan -3765 1911 4D push x ; 4 -3766 1912 F4 21 movz a, (xms_channels+5)+x ; 4 get param -3767 1914 28 0F and a, #15 ; 2 parse -3768 1916 68 00 cmp a, #0 ; 2 check zero, immediate cut -3769 1918 F0 10 beq _xmsfxko_imm ; 2/4 -3770 191A 5F EF 12 jmp _xmspme_exit ; 3 -3771 191D XMS_FX_KEYOFFo: ;[37 cycles] -3772 191D CE pop x ; 4 get chan -3773 191E 4D push x ; 4 -3774 191F F4 21 movz a, (xms_channels+5)+x ; 4 get param -3775 1921 28 0F and a, #15 ; 2 parse -3776 1923 64 B3 cmpz a, (xms_tick) ; 3 -3777 1925 F0 03 beq _xmsfxko_imm ; 2/4 -3778 1927 5F EF 12 jmp _xmspme_exit ; 3 -3779 192A _xmsfxko_imm: ; -3780 192A ; -3781 192A F5 CA 10 mov a, (xms_channels_other+6)+x ; 5 read -3782 192D 28 7F and a, #%01111111 ; 2 keyoff -3783 192F D5 CA 10 mov (xms_channels_other+6)+x, a ; 6 store -3784 1932 5F EF 12 jmp _xmspme_exit ; 3 exit -3785 1935 -3786 1935 ; EFFECT Lxy ENVELOPE POSITION ----------------------------------------------------------------------------------------------- -3787 1935 #ifdef FX_INCLUDE_ENVPOS -3788 1935 XMS_FX_ENVELOPEPOSf: ;[23+? cycles] -3789 1935 CE pop x ; 4 get chan -3790 1936 4D push x ; 4 -3791 1937 F4 21 movz a, (xms_channels+cso_fxparam)+x ; 4 get param -3792 1939 C4 0A movz (int1), a -3793 193B 3F 42 1D call XMS_CHANNEL_ENV_SETPOSITION ; 8+39 -3794 193E ; uses other jump ; -3795 193E XMS_FX_ENVELOPEPOSo: ; -3796 193E 5F EF 12 jmp _xmspme_exit ; 3 -3797 1941 -3798 1941~ #else -3799 1941~ XMS_FX_ENVELOPEPOSf: -3800 1941~ XMS_FX_ENVELOPEPOSo: -3801 1941~ jmp _xmspme_exit -3802 1941 #endif -3803 1941 -3804 1941 ; EFFECT Pxy PANNING SLIDE ----------------------------------------------------------------------------------------------- -3805 1941 XMS_FX_PANSLIDEf: ;[33 cycles] -3806 1941 CE pop x ; 4 get chan -3807 1942 4D push x ; 4 -3808 1943 F4 21 movz a, (xms_channels+5)+x ; 4 check/get prev data -3809 1945 D0 05 bne _xmsfxpans_isparam ; 2/4 -3810 1947 F5 51 11 mov a, (XMS_FXP_PREVIOUS+13)+x ; 5 -3811 194A D4 21 movz (xms_channels+5)+x, a ; 5 -3812 194C _xmsfxpans_isparam: ; -3813 194C D5 51 11 mov (XMS_FXP_PREVIOUS+13)+x, a ; 6 -3814 194F 5F EF 12 jmp _xmspme_exit ; 3 -3815 1952 XMS_FX_PANSLIDEo: ;[56 cycles] -3816 1952 CE pop x ; 4 get chan -3817 1953 4D push x ; 4 -3818 1954 F4 21 movz a, (xms_channels+5)+x ; 4 get param -3819 1956 68 10 cmp a, #16 ; 2 check direction -3820 1958 B0 11 bcs _xmsfxps_hiparam ; 2/4 -3821 195A ; loparam ; -3822 195A 28 0F and a, #$0F ; 2 -3823 195C 80 setc ; 2 subtract from volume... -3824 195D C4 0A movz (int1), a ; 4 -3825 195F F4 25 movz a, (xms_channels+9)+x ; 4 -3826 1961 A4 0A sbcz a, (int1) ; 3 -3827 1963 B0 02 bcs _xmsfxps_lo_over ; 2/4 -3828 1965 E8 00 mov a, #0 ; 2 clip -3829 1967 _xmsfxps_lo_over: ; -3830 1967 D4 25 movz (xms_channels+9)+x, a ; 5 store -3831 1969 2F 0E b _xmsfxps_finish ; 4 -3832 196B _xmsfxps_hiparam: ; -3833 196B 28 F0 and a, #$F0 ; 2 -3834 196D 9F xcn a ; 5 -3835 196E 60 clrc ; 2 add to volume... -3836 196F 94 25 adcz a, (xms_channels+9)+x ; 3 -3837 1971 68 40 cmp a, #64 ; 2 -3838 1973 90 02 bcc _xmsfxps_hi_over ; 2/4 -3839 1975 E8 40 mov a, #64 ; 2 clip -3840 1977 _xmsfxps_hi_over: ; -3841 1977 D4 25 movz (xms_channels+9)+x, a ; 5 store -3842 1979 _xmsfxps_finish: ; -3843 1979 ; -3844 1979 C4 A6 movz (xms_cc_panning), a ; 4 set panning -3845 197B 18 08 9E or (xms_cc_flags), #ccflag_panning ; 5 set flag -3846 197E ; -3847 197E 5F EF 12 jmp _xmspme_exit ; 3 exit -3848 1981 -3849 1981 ; EFFECT Rxy RETRIGGER NOTE (extended) ----------------------------------------------------------------------------------------------- -3850 1981 -3851 1981 table_xms_retrig_jumps: -3852 1981 05 1A .word _xmsfxr_0 -3853 1983 08 1A .word _xmsfxr_1 -3854 1985 08 1A .word _xmsfxr_1 -3855 1987 08 1A .word _xmsfxr_1 -3856 1989 08 1A .word _xmsfxr_1 -3857 198B 08 1A .word _xmsfxr_1 -3858 198D 23 1A .word _xmsfxr_6 -3859 198F 2B 1A .word _xmsfxr_7 -3860 1991 30 1A .word _xmsfxr_8 -3861 1993 34 1A .word _xmsfxr_9 -3862 1995 34 1A .word _xmsfxr_9 -3863 1997 34 1A .word _xmsfxr_9 -3864 1999 34 1A .word _xmsfxr_9 -3865 199B 34 1A .word _xmsfxr_9 -3866 199D 4C 1A .word _xmsfxr_E -3867 199F 56 1A .word _xmsfxr_F -3868 19A1 -3869 19A1 XMS_FX_RETRIGGERf: ;[68+? cycles] -3870 19A1 CE pop x ; 4 get chan -3871 19A2 4D push x ; 4 -3872 19A3 F5 52 11 mov a, (XMS_FXP_PREVIOUS+14)+x ; 5 get prev data -3873 19A6 C4 0A movz (int1), a ; 4 -3874 19A8 FB 21 movz y, (xms_channels+5)+x ; 4 get param -3875 19AA DD mov a, y ; 2 save -3876 19AB 28 0F and a, #$0F ; 2 mask -3877 19AD F0 03 beq _xmsfxr_noparam2 ; 2/4 lo param != 0? -3878 19AF 38 F0 0A and (int1), #$F0 ; 5 mask out lo param -3879 19B2 _xmsfxr_noparam2: ; -3880 19B2 DD mov a, y ; 2 load -3881 19B3 28 F0 and a, #$F0 ; 2 mask -3882 19B5 F0 03 beq _xmsfxr_noparam1 ; 2/4 hi param != 0? -3883 19B7 38 0F 0A and (int1), #$0F ; 5 mask out hi param -3884 19BA _xmsfxr_noparam1: ; -3885 19BA DD mov a, y ; 2 load -3886 19BB 04 0A orz a, (int1) ; 3 or masked prev data -3887 19BD D5 52 11 mov (XMS_FXP_PREVIOUS+14)+x, a ; 6 save -3888 19C0 D4 21 movz (xms_channels+5)+x, a ; 5 save (?) -3889 19C2 ; -3890 19C2 E4 9D movz a, (xms_fxfirst) ; 3 check first time -3891 19C4 28 02 and a, #%10 ; 2 -3892 19C6 F0 14 beq XMS_FX_RETRIGGERo ; 2/4 branch if not -3893 19C8 38 FD 9D and (xms_fxfirst), #%11111101 ; 5 reset counters on first time -3894 19CB F4 21 movz a, (xms_channels+5)+x ; 4 -3895 19CD 28 0F and a, #15 ; 2 -3896 19CF C4 0A movz (int1), a ; 4 -3897 19D1 F4 2B movz a, (xms_channels+15)+x ; 4 -3898 19D3 28 F0 and a, #$F0 ; 2 -3899 19D5 04 0A orz a, (int1) ; 3 -3900 19D7 D4 2B movz (xms_channels+15)+x, a ; 4 -3901 19D9 ; -3902 19D9 5F EF 12 jmp _xmspme_exit ; 3 -3903 19DC XMS_FX_RETRIGGERo: ;[174 cycles] -3904 19DC CE pop x ; 4 get chan { 20 cycles -3905 19DD 4D push x ; 4 -3906 19DE ; -3907 19DE F4 2B movz a, (xms_channels+15)+x ; 4 get counter -3908 19E0 28 0F and a, #15 ; 2 -3909 19E2 9C dec a ; 2 -3910 19E3 F0 03 beq _xmsfxr_no_retrig_NOT ; 2/4 -3911 19E5 5F 6B 1A jmp _xmsfxr_no_retrig ; 3 } -3912 19E8 _xmsfxr_no_retrig_NOT: ; -3913 19E8 ; -3914 19E8 F4 21 movz a, (xms_channels+5)+x ; 4 read param { 58 cycles -3915 19EA 28 0F and a, #15 ; 2 mask -3916 19EC C4 0A movz (int1), a ; 4 store -3917 19EE F4 2B movz a, (xms_channels+15)+x ; 4 read counter var -3918 19F0 28 F0 and a, #$F0 ; 2 mask -3919 19F2 04 0A orz a, (int1) ; 3 mix -3920 19F4 D4 2B movz (xms_channels+15)+x, a ; 4 store -3921 19F6 ; -3922 19F6 ; edit volume ; -3923 19F6 F4 21 movz a, (xms_channels+5)+x ; 4 get param -3924 19F8 9F xcn a ; 5 parse -3925 19F9 28 0F and a, #15 ; 2 -3926 19FB 1C asl a ; 2 -3927 19FC 2D push a ; 4 preserve jump offset -3928 19FD F4 22 movz a, (xms_channels+6)+x ; 4 get volume -3929 19FF C4 0A movz (int1), a ; 4 store -3930 1A01 CE pop x ; 4 retrieve -3931 1A02 ; -3932 1A02 1F 81 19 jmp [table_xms_retrig_jumps+x] ; 6 jump } -3933 1A05 _xmsfxr_0: ; ----------------------------------------------- -3934 1A05 ; shouldn't equal zero USES LAST VALUE -3935 1A05 5F 30 1A jmp _xmsfxr_8 ; 3 jump to 8 if user didn't specify any previous -3936 1A08 _xmsfxr_1: ; ----------------------------------------------- -3937 1A08 7D mov a, x ; 2 x == mode*2 { 70 cycles -3938 1A09 8F 01 0B mov (int1+1), #1 ; 5 default: 1 -3939 1A0C 5C lsr a ; 2 -3940 1A0D 9C dec a ; 2 -3941 1A0E F0 05 beq _xmsfxr_1_exit ; 2/4 -3942 1A10 _xmsfxr_1_loop: ; { 38 cycles (4x) -3943 1A10 0B 0B aslz (int1+1) ; 4 shift value -3944 1A12 9C dec a ; 2 dec&loop -3945 1A13 D0 FB bne _xmsfxr_1_loop ; 2/4 } -3946 1A15 _xmsfxr_1_exit: ; -3947 1A15 80 setc ; 2 -3948 1A16 A9 0B 0A sbc (int1), (int1+1) ; 6 subtract value -3949 1A19 10 04 bpl _xmsfxr_1_pl ; 2/4 -3950 1A1B E8 00 mov a, #0 ; 2 clip -3951 1A1D 2F 3A b _xmsfxr_setvol ; 4 break -3952 1A1F _xmsfxr_1_pl: ; -3953 1A1F E4 0A movz a, (int1) ; 3 fetch -3954 1A21 2F 36 b _xmsfxr_setvol ; 4 break } -3955 1A23 _xmsfxr_6: ; ----------------------------------------------- -3956 1A23 E4 0A movz a, (int1) ; 3 { 20 cycles -3957 1A25 8D AB mov y, #171 ; 2 -3958 1A27 CF mul ya ; 9 compute (volume*171)>>8 -3959 1A28 DD mov a, y ; 2 ... -3960 1A29 2F 2E b _xmsfxr_setvol ; 4 break } -3961 1A2B _xmsfxr_7: ; ----------------------------------------------- -3962 1A2B E4 0A movz a, (int1) ; 3 get volume { 9 cycles -3963 1A2D 5C lsr a ; 2 /2 -3964 1A2E 2F 29 b _xmsfxr_setvol ; 4 break } -3965 1A30 _xmsfxr_8: ; ----------------------------------------------- -3966 1A30 E4 0A movz a, (int1) ; 3 no change { 7 cycles -3967 1A32 2F 25 b _xmsfxr_setvol ; 4 break } -3968 1A34 _xmsfxr_9: ; ----------------------------------------------- -3969 1A34 7D mov a, x ; 2 a = mode*2 { 71 cycles -3970 1A35 5C lsr a ; 2 a = mode -3971 1A36 80 setc ; 2 -3972 1A37 8F 01 0B mov (int1+1), #1 ; 5 default=1 -3973 1A3A A8 09 sbc a, #9 ; 2 -3974 1A3C F0 05 beq _xmsfxr_9_exit ; 2/4 -3975 1A3E _xmsfxr_9_loop: ; { 38 cycles -3976 1A3E 0B 0B aslz (int1+1) ; 4 shift value -3977 1A40 9C dec a ; 2 dec&loop -3978 1A41 D0 FB bne _xmsfxr_9_loop ; 2/4 } -3979 1A43 _xmsfxr_9_exit: ; -3980 1A43 60 clrc ; 2 -3981 1A44 E4 0A movz a, (int1) ; 3 add value -3982 1A46 84 0B adcz a, (int1+1) ; 3 -3983 1A48 68 40 cmp a, #64 ; 2 -3984 1A4A ; bcc _xmsfxr_9_cc ; 2/4 -3985 1A4A ; mov a, #64 ; 2 clip -3986 1A4A ; b _xmsfxr_setvol ; 4 -3987 1A4A ;_xmsfxr_9_cc: ; -3988 1A4A ; movz a, (int1) ; X BUG??? -3989 1A4A 2F 0D b _xmsfxr_setvol ; 4 return } -3990 1A4C _xmsfxr_E: ; ----------------------------------------------- -3991 1A4C E4 0A movz a, (int1) ; 3 read { 24 cycles -3992 1A4E 8D C0 mov y, #192 ; 2 -3993 1A50 CF mul ya ; 9 compute (vol*192)>>7 (?) :) -3994 1A51 3C rol a ; 2 -3995 1A52 DD mov a, y ; 2 -3996 1A53 3C rol a ; 2 -3997 1A54 2F 03 b _xmsfxr_setvol ; 4 } -3998 1A56 _xmsfxr_F: ; ----------------------------------------------- -3999 1A56 E4 0A movz a, (int1) ; 3 vol*2 { 5 cycles -4000 1A58 1C asl a ; 2 } -4001 1A59 _xmsfxr_setvol: ; -4002 1A59 CE pop x ; 4 get chan { 25 cycles -4003 1A5A 4D push x ; 4 -4004 1A5B 68 40 cmp a, #64 -4005 1A5D 90 02 bcc _xmsfxr_volclip -4006 1A5F E8 40 mov a, #64 -4007 1A61 _xmsfxr_volclip: -4008 1A61 D4 22 movz (xms_channels+6)+x, a ; 5 save volume -4009 1A63 C4 A5 movz (xms_cc_volume), a ; 4 save volume -4010 1A65 18 05 9E or (xms_cc_flags), #(ccflag_volume| ccflag_keyon) ; 5 set flag -4011 1A68 ; -4012 1A68 5F 7C 1A jmp _xmsfxr_exit ; 3 return } -4013 1A6B _xmsfxr_no_retrig: ; -4014 1A6B 68 01 cmp a, #1 -4015 1A6D D0 03 bne _xmsfxr_no_ramp -4016 1A6F 09 17 CC or (xms_peek), (channel_bit) -4017 1A72 _xmsfxr_no_ramp: -4018 1A72 C4 0A movz (int1), a ; 4 do some things { 21 cycles -4019 1A74 F4 2B movz a, (xms_channels+15)+x ; 4 -4020 1A76 28 F0 and a, #$F0 ; 2 -4021 1A78 04 0A orz a, (int1) ; 3 -4022 1A7A D4 2B movz (xms_channels+15)+x, a ; 5 -4023 1A7C _xmsfxr_exit: ; -4024 1A7C 5F EF 12 jmp _xmspme_exit ; 3 } -4025 1A7F -4026 1A7F ; EFFECT Txy TREMOR ----------------------------------------------------------------------------------------------- -4027 1A7F #ifdef FX_INCLUDE_TREMOR -4028 1A7F -4029 1A7F XMS_FX_TREMORf: ;[44 cycles] -4030 1A7F CE pop x ; 4 get chan -4031 1A80 4D push x ; 4 -4032 1A81 E4 9D movz a, (xms_fxfirst) ; 3 check fx_first -4033 1A83 28 04 and a, #%100 ; 2 -4034 1A85 D0 02 bne _xmsfxtr_first ; 2/4 -4035 1A87 2F 0F b _xmsfxtr_exit ; 4 -4036 1A89 _xmsfxtr_first: ; -4037 1A89 E4 17 movz a, (channel_bit) ; 3 reset flags -4038 1A8B 48 FF eor a, #255 ; 2 -4039 1A8D 24 9C andz a, (xms_tremor_flags) ; 3 -4040 1A8F F4 2B movz a, (xms_channels+15)+x ; 4 -4041 1A91 28 0F and a, #15 ; 2 -4042 1A93 D4 2B movz (xms_channels+15)+x, a ; 5 -4043 1A95 38 FB 9D and (xms_fxfirst), #%11111011 ; 5 -4044 1A98 _xmsfxtr_exit: ; -4045 1A98 5F EF 12 jmp _xmspme_exit ; 3 -4046 1A9B XMS_FX_TREMORo: ;[73 cycles] -4047 1A9B CE pop x ; 4 get chan { 24 cycles -4048 1A9C 4D push x ; 4 -4049 1A9D F4 2B movz a, (xms_channels+15)+x ; 4 -4050 1A9F 28 F0 and a, #$F0 ; 2 -4051 1AA1 D0 36 bne _xmsfxtr_next ; 2/4 -4052 1AA3 ; DO SOME TREMOR ; -4053 1AA3 E4 17 movz a, (channel_bit) ; 3 -4054 1AA5 24 9C andz a, (xms_tremor_flags) ; 3 -4055 1AA7 -4056 1AA7 F0 18 beq _xmsfxtr_on ; 2/4 } -4057 1AA9 _xmsfxtr_off: -4058 1AA9 ; get OFF ticks -4059 1AA9 49 17 9C eor (xms_tremor_flags), (channel_bit) ; 5 set off flag { 49 cycles -4060 1AAC F4 21 movz a, (xms_channels+5)+x ; 4 set counter.. -4061 1AAE 28 0F and a, #15 ; 2 -4062 1AB0 9F xcn a ; 5 -4063 1AB1 C4 0A movz (int1), a ; 4 -4064 1AB3 F4 2B movz a, (xms_channels+15)+x ; 4 -4065 1AB5 04 0A orz a, (int1) ; 3 -4066 1AB7 D4 2B movz (xms_channels+15)+x, a ; 5 -4067 1AB9 ; -4068 1AB9 8F 00 A5 mov (xms_cc_volume), #0 ; 5 -4069 1ABC 18 04 9E or (xms_cc_flags), #ccflag_volume ; 5 -4070 1ABF 2F D7 b _xmsfxtr_exit ; 4+3 } -4071 1AC1 _xmsfxtr_on: ; -4072 1AC1 ; get ON ticks ; -4073 1AC1 49 17 9C eor (xms_tremor_flags), (channel_bit) ; 5 set on flag { 47 cycles -4074 1AC4 F4 21 movz a, (xms_channels+5)+x ; 4 set counter... -4075 1AC6 28 F0 and a, #$F0 ; 2 -4076 1AC8 C4 0A movz (int1), a ; 4 -4077 1ACA F4 2B movz a, (xms_channels+15)+x ; 4 -4078 1ACC 04 0A orz a, (int1) ; 3 -4079 1ACE D4 2B movz (xms_channels+15)+x, a ; 5 -4080 1AD0 F4 22 movz a, (xms_channels+6)+x ; 4 -4081 1AD2 C4 A5 movz (xms_cc_volume), a ; 4 -4082 1AD4 18 04 9E or (xms_cc_flags), #ccflag_volume ; 5 -4083 1AD7 2F BF b _xmsfxtr_exit ; 4+3 } -4084 1AD9 ; -4085 1AD9 _xmsfxtr_next: ; -4086 1AD9 80 setc ; 2 decrement counter { 12 cycles -4087 1ADA A8 10 sbc a, #$10 ; 2 -4088 1ADC D4 2B movz (xms_channels+15)+x, a ; 5 -4089 1ADE ; -4090 1ADE 5F EF 12 jmp _xmspme_exit ; 3 return } -4091 1AE1 -4092 1AE1~ #else -4093 1AE1~ XMS_FX_TREMORf: -4094 1AE1~ XMS_FX_TREMORo: -4095 1AE1~ jmp _xmspme_exit -4096 1AE1~ -4097 1AE1 #endif -4098 1AE1 -4099 1AE1 ; EFFECT Xxy EXTRA FINE PORTA ------------------------------------------------------------------------------------------ -4100 1AE1 XMS_FX_XFINEPORTAf: ;[148 cycles] -4101 1AE1 CE pop x ; 4 get chan -4102 1AE2 4D push x ; 4 -4103 1AE3 8F 00 0C mov (int2), #0 ; 5 -4104 1AE6 F4 21 movz a, (xms_channels+5)+x ; 4 get param -4105 1AE8 28 0F and a, #15 ; 2 check zero -4106 1AEA D0 05 bne _xmsfxxfp_isparam ; 2/4 -4107 1AEC F5 53 11 mov a, (XMS_FXP_PREVIOUS+15)+x ; 5 get last -4108 1AEF D4 21 movz (xms_channels+5)+x, a ; 5 -4109 1AF1 _xmsfxxfp_isparam: ; -4110 1AF1 D5 53 11 mov (XMS_FXP_PREVIOUS+15)+x, a ; 6 save -4111 1AF4 28 F0 and a, #$F0 ; 2 mask -4112 1AF6 68 10 cmp a, #$10 ; 2 -4113 1AF8 F0 09 beq _xmsfxefp_up ; 2/4 check direction -4114 1AFA ; PORTA DOWN ; -4115 1AFA F4 21 movz a, (xms_channels+5)+x ; 4 slide down -4116 1AFC 28 0F and a, #$0F ; 2 -4117 1AFE 3F CC 1C call XMS_CHANNEL_PITCH_SLIDEDOWN ; 8+80 -4118 1B01 2F 08 b XMS_FX_XFINEPORTAo ; 4 -4119 1B03 _xmsfxefp_up: ; -4120 1B03 ; PORTA UP ; slide up.. -4121 1B03 F5 21 00 mov a, (xms_channels+5)+x ; 4 -4122 1B06 28 0F and a, #$0F ; 2 -4123 1B08 3F C2 1C call XMS_CHANNEL_PITCH_SLIDEUP ; 8+86 -4124 1B0B XMS_FX_XFINEPORTAo: ; -4125 1B0B 5F EF 12 jmp _xmspme_exit ; 3 return -4126 1B0E -4127 1B0E ; UNUSED EFFECTS ----------------------------------------------------------------------------------------------- -4128 1B0E XMS_FX_UNUSED =_xmspme_exit -4129 1B0E -4130 1B0E ; ----------------------------------------------------------------------------------------------------- -4131 1B0E ; XMS CHANNEL ROUTINES -4132 1B0E ; ----------------------------------------------------------------------------------------------------- -4133 1B0E -4134 1B0E XMS_CHANNEL_INTERRUPT: -4135 1B0E ; cut channel -4136 1B0E 2D push a -4137 1B0F E8 00 mov a, #0 -4138 1B11 F5 CA 10 mov a, (xms_channels_other+6)+x -4139 1B14 28 FE and a, #$Fe -4140 1B16 D5 CA 10 mov (xms_channels_other+6)+x, a -4141 1B19 E8 00 mov a, #0 -4142 1B1B D5 C4 10 mov (xms_channels_other+0)+x, a -4143 1B1E D5 C5 10 mov (xms_channels_other+1)+x, a -4144 1B21 E8 FF mov a, #255 -4145 1B23 D4 26 movZ (xms_channels+cso_sample)+x, a -4146 1B25 AE pop a -4147 1B26 6F ret -4148 1B27 -4149 1B27 XMS_CHANNEL_RESTORE: -4150 1B27 -4151 1B27 -4152 1B27 XMS_CHANNEL_UPDATEDSP: ;[638 cycles] | BIG ROUTINE -4153 1B27 ; x = channel * 16 | OPTIMIZATION: MEDIUM -4154 1B27 ; updates channel with xms_cc parameters | -4155 1B27 ; and it goes kinda like this... -4156 1B27 ; 0. RESET GAIN if or -4157 1B27 ; 1. set source ; small -4158 1B27 ; 2. set pitch ; 357 cycles -4159 1B27 ; 3. set volume ; 82 cycles -4160 1B27 ; 4. set offset ; 120 cycles -4161 1B27 ; 5. start note ; small -4162 1B27 ; 6. reset offset ; 32 -4163 1B27 ; 6. set panning ; 114 cycles -4164 1B27 -4165 1B27 ; dont update over sound effects -4166 1B27 7D mov a, x -4167 1B28 9F xcn a -4168 1B29 FD mov y, a -4169 1B2A F6 DE 00 mov a, (samp_playing)+y -4170 1B2D F0 04 beq _xcu_ok -4171 1B2F 8F 00 9E mov (xms_cc_flags), #0 ; 5 reset flags -4172 1B32 6F ret -4173 1B33 _xcu_ok: -4174 1B33 -4175 1B33 F6 9B 20 mov a, (XMS_TABLE_BITS)+y -4176 1B36 24 E6 andz a, (samp_dirty) -4177 1B38 F0 0E beq _xcu_ok2 -4178 1B3A ; fix channel -4179 1B3A -4180 1B3A F6 9B 20 mov a, (XMS_TABLE_BITS)+y -4181 1B3D 44 E6 eorz a, (samp_dirty) -4182 1B3F C4 E6 movz (samp_dirty), a -4183 1B41 -4184 1B41 ; reset adsr -4185 1B41 7D mov a, x -4186 1B42 08 05 or a, #DSP_ADSR -4187 1B44 8D 00 mov y, #0 -4188 1B46 DA F2 movw ($F2), ya -4189 1B48 -4190 1B48 ; reset source -4191 1B48 ; movz a, (xms_channels+cso_sample)+x -4192 1B48 ; movz (xms_cc_source), a -4193 1B48 ; or (xms_cc_flags), #ccflag_source -4194 1B48 -4195 1B48 _xcu_ok2: -4196 1B48 -4197 1B48 -4198 1B48 -4199 1B48 E4 9E movz a, (xms_cc_flags) ; 3 get flags { 5 cycles -4200 1B4A 28 11 and a, #%10001 ; 2 check for start } -4201 1B4C -4202 1B4C -4203 1B4C -4204 1B4C F0 07 beq _xmscu_nostarting ; 2/4 { 12 cycles -4205 1B4E 7D mov a, x ; 2 reset gain -4206 1B4F 08 07 or a, #DSP_GAIN ; 2 -4207 1B51 8D 00 mov y, #0 ; 2 <------------------------------------ -4208 1B53 DA F2 movw ($F2), ya ; 4 -4209 1B55 _xmscu_nostarting: ; } -4210 1B55 -4211 1B55 93 9E 07 bbc4 (xms_cc_flags), _xmscu_nosource ; 5/7 check source { 16 cycles -4212 1B58 7D mov a, x ; 2 set source number -4213 1B59 08 04 or a, #4 ; 2 -4214 1B5B EB A7 movz y, (xms_cc_source) ; 3 -4215 1B5D ; movz y, (xms_channels+cso_sample)+x -4216 1B5D DA F2 movw ($F2), ya ; 4 -4217 1B5F _xmscu_nosource: ; } -4218 1B5F -4219 1B5F 23 9E 03 bbs1 (xms_cc_flags), _xmscu_nopitchN ; 5/7 check pitch { ??? -4220 1B62 5F E5 1B jmp _xmscu_nopitch -4221 1B65 _xmscu_nopitchN: -4222 1B65 8D 01 mov y, #c_inst_noise -4223 1B67 F7 1A mov a, [cur_inst]+y -4224 1B69 D0 50 bne _xmscu_noisepitch -4225 1B6B 7D mov a, x ; 2 set dsp access -4226 1B6C 08 02 or a, #2 ; 2 -4227 1B6E C4 F2 movz ($F2), a ; 4 -4228 1B70 F5 CD 10 mov a, (xms_channels_other+coso_pa+1)+x ; 5 ya = period + vibrato -4229 1B73 -4230 1B73 5C lsr a ; 2 -4231 1B74 90 1B bcc _xmscu_novib ; 2/4 -4232 1B76 1C asl a ; 2 -4233 1B77 D5 CD 10 mov (xms_channels_other+coso_pa+1)+x, a ; 6 -4234 1B7A -4235 1B7A 30 07 bmi _xmscu_vsub ; 2/4 -4236 1B7C _xmscu_vadd: -4237 1B7C F5 CC 10 mov a, (xms_channels_other+coso_pa)+x ; 5 -4238 1B7F 8D 00 mov y, #0 ; 2 -4239 1B81 2F 12 b _xmscu_isvib ; 4 -4240 1B83 _xmscu_vsub: -4241 1B83 -4242 1B83 F5 CC 10 mov a, (xms_channels_other+coso_pa)+x ; 5 -4243 1B86 F0 09 beq _xmscu_novib -4244 1B88 48 FF eor a, #255 ; 2 -4245 1B8A BC inc a ; 2 -4246 1B8B F0 04 beq _xmscu_novib ; 2/4 -4247 1B8D 8D FF mov y, #255 ; 2 -4248 1B8F 2F 04 b _xmscu_isvib ; 4 -4249 1B91 -4250 1B91 _xmscu_novib: -4251 1B91 E8 00 mov a, #0 ; 2 -4252 1B93 8D 00 mov y, #0 ; 2 -4253 1B95 _xmscu_isvib: -4254 1B95 7A A1 addw ya, (xms_cc_period) ; 5 -4255 1B97 7A A3 addw ya, (xms_cc_perioda) ; 5 -4256 1B99 -4257 1B99 ;call period_clip ; 8+25 clip period -4258 1B99 3F 04 1D call XMS_PeriodClip -4259 1B9C DA 0A movw (int1), ya ; 4 -4260 1B9E ; -4261 1B9E 4D push x ; 4 -4262 1B9F 3F BE 09 call XMS_PERIOD2FREQ -4263 1BA2 CE pop x ; 4 -4264 1BA3 -4265 1BA3 AB F2 incz ($F2) -4266 1BA5 FA 0F F3 mov ($F3), (int3+1) -4267 1BA8 8B F2 decz ($F2) -4268 1BAA FA 0E F3 mov ($F3), (int3) -4269 1BAD -4270 1BAD 8F 3D F2 mov ($F2), #DSP_NON -4271 1BB0 E4 17 movz a, (channel_bit) -4272 1BB2 48 FF eor a, #255 -4273 1BB4 25 F3 00 and a, ($F3) -4274 1BB7 C4 F3 movz ($F3), a -4275 1BB9 2F 2A b _xmscu_nopitch -4276 1BBB _xmscu_noisepitch: -4277 1BBB 13 9E 27 bbc0 (xms_cc_flags), _xmscu_nopitch -4278 1BBE F4 23 movz a, (xms_channels+cso_note)+x -4279 1BC0 80 setc -4280 1BC1 A8 30 sbc a, #48 ; sub middle C -4281 1BC3 28 1F and a, #31 ; mask for stupid people -4282 1BC5 C4 0A movz (int1), a -4283 1BC7 8F 6C F2 mov ($F2), #DSP_FLG -4284 1BCA E4 F3 movz a, ($F3) -4285 1BCC 28 E0 and a, #%11100000 -4286 1BCE 04 0A orz a, (int1) -4287 1BD0 -4288 1BD0 C5 F3 00 mov ($F3), a -4289 1BD3 -4290 1BD3 8F 3D F2 mov ($F2), #DSP_NON -4291 1BD6 09 17 F3 or ($F3), (channel_bit) -4292 1BD9 -4293 1BD9 7D mov a, x -4294 1BDA 08 02 or a, #2 -4295 1BDC 8D 00 mov y, #$00 -4296 1BDE DA F2 movw ($F2), ya -4297 1BE0 BC inc a -4298 1BE1 8D 10 mov y, #$10 -4299 1BE3 DA F2 movw ($F2), ya -4300 1BE5 _xmscu_nopitch: ; } -4301 1BE5 -4302 1BE5 AA 9E A0 mov1 c, (xms_cc_flags+(5<<13)) ; 4 check sample offset { 98 cycles/8 cycles : ONLY GETS APPLIED WITH EFFECT 9xx! (on first tick) -4303 1BE8 90 28 bcc _xmscu_nooffset ; 2/4 -4304 1BEA ; so = xms_cc_sampoff ; -4305 1BEA ; sampoff = source_offset + so*144 ; -4306 1BEA ; -4307 1BEA F4 26 movz a, (xms_channels+10)+x ; 4 get sample -4308 1BEC 1C asl a ; 2 *4 -4309 1BED 1C asl a ; 2 -4310 1BEE C4 0C movz (int2), a ; 4 save -4311 1BF0 8F 02 0D mov (int2+1), #$02 ; 5 -4312 1BF3 ; -4313 1BF3 E4 A8 movz a, (xms_cc_sampoff) ; 3 get sample offset -4314 1BF5 8D 90 mov y, #144 ; 2 multiply -4315 1BF7 CF mul ya ; 9 -4316 1BF8 DA 0A movw (int1), ya ; 4 -4317 1BFA ; -4318 1BFA 8D 00 mov y, #0 ; 2 read source offset -4319 1BFC F7 0C mov a, [int2]+y ; 6 -4320 1BFE 2D push a ; 4 -4321 1BFF ; -4322 1BFF 84 0A adcz a, (int1) ; 3 add sample offset.... -4323 1C01 C4 0A movz (int1), a ; 4 -4324 1C03 FC inc y ; 2 -4325 1C04 F7 0C mov a, [int2]+y ; 6 -4326 1C06 2D push a ; 4 -4327 1C07 84 0B adcz a, (int1+1) ; 3 -4328 1C09 C4 0B movz (int1+1), a ; 4 -4329 1C0B ; -4330 1C0B ; int1 = new offset ; -4331 1C0B D7 0C mov [int2]+y, a ; 7 overwrite -4332 1C0D E4 0A movz a, (int1) ; 3 -4333 1C0F DC dec y ; 2 -4334 1C10 D7 0C mov [int2]+y, a ; 7 -4335 1C12 _xmscu_nooffset: ; } -4336 1C12 -4337 1C12 E4 A6 movz a, (xms_cc_panning) ; 3 get panning { 109 cycles -4338 1C14 1C asl a ; 2 shift -4339 1C15 1C asl a ; 2 -4340 1C16 ED notc ; 2 trick -4341 1C17 A8 00 sbc a, #0 ; 2 -4342 1C19 -4343 1C19 XMS_CHANNEL_SETPAN: ;[98 cycles] | INLINE COMMON ROUTINE -4344 1C19 ; a=pan ; | OPTIMIZATION: MEDIUM HIGH -4345 1C19 C4 0A movz (int1), a ; 4 save pan { 23 cycles -4346 1C1B -4347 1C1B A8 80 sbc a, #128 ; 2 compute 128-abs(128-pan) -4348 1C1D 10 04 bpl _xmscev_plus1 ; 2 -4349 1C1F 48 FF eor a, #255 ; 2 -4350 1C21 BC inc a ; 2 -4351 1C22 80 setc ; 2 -4352 1C23 _xmscev_plus1: -4353 1C23 A8 80 sbc a, #128 ; 2 -4354 1C25 48 FF eor a, #255 ; 2 -4355 1C27 BC inc a ; 2 -4356 1C28 2D push a ; 4 save result } -4357 1C29 F5 C9 10 mov a, (xms_channels_other+5)+x ; 5 read pan envelope { 15/17 cycles negative/positive -4358 1C2C EE pop y ; 4 restore value -4359 1C2D 80 setc ; 2 -4360 1C2E A8 20 sbc a, #32 ; 2 epan-32 -4361 1C30 10 13 bpl _xmscev_eplus ; 2/4 } -4362 1C32 _xmscev_eminus: -4363 1C32 48 FF eor a, #255 ; 2 compute pan+((epan-32)*8*128-abs(pan-128))\256 { 35 cycles -4364 1C34 BC inc a ; 2 some values were calculated already -4365 1C35 1C asl a ; 2 -4366 1C36 1C asl a ; 2 -4367 1C37 1C asl a ; 2 -4368 1C38 ED notc ; 2 -4369 1C39 A8 00 sbc a, #0 ; 2 -4370 1C3B CF mul ya ; 9 -4371 1C3C DD mov a, y ; 2 -4372 1C3D A4 0A sbcz a, (int1) ; 3 -4373 1C3F 48 FF eor a, #255 ; 2 -4374 1C41 BC inc a ; 2 -4375 1C42 5F 50 1C jmp _xmscev_setvol ; 3 } -4376 1C45 _xmscev_eplus: -4377 1C45 1C asl a ; 2 compute pan+((epan-32)*8*128-abs(pan-128))\256 { 26 cycles -4378 1C46 1C asl a ; 2 some values were calculated already -4379 1C47 1C asl a ; 2 -4380 1C48 ED notc ; 2 -4381 1C49 A8 00 sbc a, #0 ; 2 -4382 1C4B CF mul ya ; 9 -4383 1C4C DD mov a, y ; 2 -4384 1C4D 60 clrc ; 2 -4385 1C4E 84 0A adcz a, (int1) ; 3 } -4386 1C50 _xmscev_setvol: -4387 1C50 -4388 1C50 5C lsr a ; 2 set dsp volumes { 25 cycles -4389 1C51 -4390 1C51 FD mov y, a ; 2 -4391 1C52 3D inc x ; 2 -4392 1C53 D8 F2 movz ($F2), x ; 4 -4393 1C55 1D dec x ; 2 -4394 1C56 48 7F eor a, #127 ; 2 -4395 1C58 CB F3 movz ($F3), y ; 4 -4396 1C5A FD mov y, a ; 2 -4397 1C5B 7D mov a, x ; 2 -4398 1C5C DA F2 movw ($F2), ya ; 4 } -4399 1C5E ;------------------------------------------------------------------------------------------- -4400 1C5E _xmscu_nopan: ; } -4401 1C5E -4402 1C5E -4403 1C5E 13 9E 0E bbc0 (xms_cc_flags), _xmscu_nostart -4404 1C61 -4405 1C61 -4406 1C61 #ifdef xms_ssfix -4407 1C61 7D mov a, x ; make sure GAIN is in direct mode -4408 1C62 08 07 or a, #DSP_GAIN ; and zero volume -4409 1C64 8D 00 mov y, #0 ; -4410 1C66 DA F2 movw ($F2), ya -4411 1C68 #endif -4412 1C68 -4413 1C68 8F 4C F2 mov ($F2), #DSP_KON ; 5 set dsp access -4414 1C6B E4 17 movz a, (channel_bit) ; 3 load channel_bit -4415 1C6D C4 F3 movz ($F3), a ; 4 store, keyon } -4416 1C6F -4417 1C6F _xmscu_nostart: -4418 1C6F -4419 1C6F ;------------------------------------------------------------------------------------------------------------------------- -4420 1C6F E4 A5 movz a, (xms_cc_volume) ; 4 set volume... { 72 cycles -4421 1C71 1C asl a -4422 1C72 FD mov y, a -4423 1C73 ; y=0-127 -4424 1C73 XMS_CHANNEL_SETVOLUME: ;[68 cycles] ; INLINE COMMON ROUTINE -4425 1C73 ; a = volume ; ; OPTIMIZATION: MEDIUM/HIGH -4426 1C73 ; x = channel * 16 ; -4427 1C73 ; formula = ((((((fadeout*envelope)/65536)*global)/64)*channel)/64) -4428 1C73 E4 C7 movz a, (xms_global_vol) ; 3 global*volume { 20 cycles -4429 1C75 1C asl a ; 2 -4430 1C76 1C asl a ; 2 -4431 1C77 ED notc ; 2 -4432 1C78 A8 00 sbc a, #0 ; 2 -4433 1C7A CF mul ya ; 9 } -4434 1C7B F5 C7 10 mov a, (xms_channels_other+3)+x ; 5 *envelope { 22 cycles -4435 1C7E 1C asl a ; 2 -4436 1C7F 1C asl a ; 2 -4437 1C80 ED notc ; 2 -4438 1C81 A8 00 sbc a, #0 ; 2 -4439 1C83 CF mul ya ; 9 } -4440 1C84 F5 C5 10 mov a, (xms_channels_other+1)+x ; 5 *fadeout { 14 cycles -4441 1C87 CF mul ya ; 9 } -4442 1C88~ #ifndef xmspc_mode -4443 1C88~ movz a, (xms_volume) ; skip if its for an SPC image -4444 1C88~ mul ya ; -4445 1C88 #endif -4446 1C88 F0 13 beq _xmscu_zvolume ; <---------------------------------------------- PROBLEM... -4447 1C8A _xmscu_zvol_set: -4448 1C8A 7D mov a, x -4449 1C8B 9F xcn a -4450 1C8C 5D mov x, a -4451 1C8D DB D1 movz (xms_final_volume)+x, y -4452 1C8F 5B D1 lsr (xms_final_volume), x -4453 1C91 9F xcn a -4454 1C92 5D mov x, a -4455 1C93 ; bbc4 (xms_cc_flags), _xmscu_rvolume -4456 1C93 13 9E 11 bbc0 (xms_cc_flags), _xmscu_rvolume -4457 1C96 _xmscu_isvolume: -4458 1C96 ; mov a, x ; 2 { 8 cycles -4459 1C96 08 07 or a, #DSP_GAIN ; 2 set dsp volume -4460 1C98 DA F2 movw ($F2), ya ; 4 } -4461 1C9A 5F B0 1C jmp _xmscu_novolume -4462 1C9D _xmscu_zvolume: -4463 1C9D ; bbs0 (xms_cc_flags), _xmscu_zvol_set ; ??? IS THIS NECESSARY ANYMORE? -4464 1C9D 8D 9E mov y, #(%10000000 | $1E) ; 4ms -4465 1C9F 7D mov a, x -4466 1CA0 08 07 or a, #DSP_GAIN -4467 1CA2 DA F2 movw ($F2), ya -4468 1CA4 5F B0 1C jmp _xmscu_novolume -4469 1CA7 _xmscu_rvolume: -4470 1CA7 08 08 or a, #8 -4471 1CA9 C4 F2 movz ($F2), a -4472 1CAB EB F3 movz y, ($F3) -4473 1CAD 9C dec a -4474 1CAE DA F2 movw ($F2), ya -4475 1CB0 _xmscu_novolume: ; } -4476 1CB0 ;--------------------------------------------------------------------------------------------------------------------------- -4477 1CB0 -4478 1CB0 AA 9E A0 mov1 c, (xms_cc_flags+(5<<13)) ; 4 check sample offset (restore) { 32 cycles/8 cycles -4479 1CB3 90 09 bcc _xmscu_nooffset2 ; 2/4 -4480 1CB5 ; so = xms_cc_sampoff ; -4481 1CB5 ; sampoff = source_offset + so*144 ; -4482 1CB5 AE pop a ; 4 pop hi -4483 1CB6 8D 01 mov y, #1 ; 2 -4484 1CB8 D7 0C mov [int2]+y, a ; 7 restore -4485 1CBA AE pop a ; 4 pop lo -4486 1CBB DC dec y ; 2 -4487 1CBC D7 0C mov [int2]+y, a ; 7 restore -4488 1CBE _xmscu_nooffset2: ; } -4489 1CBE -4490 1CBE 8F 00 9E mov (xms_cc_flags), #0 ; 5 reset flags { 10 cycles -4491 1CC1 6F ret ; 5 return } -4492 1CC2 -4493 1CC2 XMS_CHANNEL_PITCH_SLIDEUP: ;[86 cycles] -4494 1CC2 ; a = amount - lo byte ; -4495 1CC2 ; (int2) = hi byte ; -4496 1CC2 ; x = channel * 16 ; -4497 1CC2 C4 0B movz (int1+1), a ; 4 save lo -4498 1CC4 BA A1 movw ya, (xms_cc_period) ; 5 read period -4499 1CC6 9A 0B subw ya, (int1+1) ; 5 subtract -4500 1CC8 3F D4 1C call XMS_CHANNEL_SETPITCH ; 8+59 set pitch -4501 1CCB 6F ret ; 5 -4502 1CCC -4503 1CCC XMS_CHANNEL_PITCH_SLIDEDOWN: ;[80 cycles] -4504 1CCC ; a = amount - lo byte ; -4505 1CCC ; (int2) = hi byte ; -4506 1CCC ; x = channel * 16 ; -4507 1CCC EB 0C movz y, (int2) ; 3 -4508 1CCE 7A A1 addw ya, (xms_cc_period) ; 5 -4509 1CD0 3F D4 1C call XMS_CHANNEL_SETPITCH ; 8+59 set pitch -4510 1CD3 6F ret ; 5 -4511 1CD4 -4512 1CD4 XMS_CHANNEL_SETPITCH: ;[? cycles] -4513 1CD4 ; ya = pitch ; -4514 1CD4 3F 04 1D call XMS_PeriodClip -4515 1CD7 DA A1 movw (xms_cc_period), ya ; 4 save period -4516 1CD9 18 02 9E or (xms_cc_flags), #ccflag_pitch ; 5 set flag -4517 1CDC ; -4518 1CDC D4 1C movz (xms_channels+0)+x, a ; 5 store -4519 1CDE DB 1D movz (xms_channels+1)+x, y ; 5 -4520 1CE0 ; -4521 1CE0 6F ret ; 5 -4522 1CE1 -4523 1CE1 XMS_CHANNEL_VOLSLIDEu: ;[31 cycles] -4524 1CE1 ; a = amount ; -4525 1CE1 ; x = channel * 16 ; -4526 1CE1 60 clrc ; 2 -4527 1CE2 94 22 adcz a, (xms_channels+6)+x ; 4 add amount -4528 1CE4 68 40 cmp a, #64 ; 2 clip -4529 1CE6 90 02 bcc _xmscvsu_good ; 2/4 -4530 1CE8 E8 40 mov a, #64 ; 2 -4531 1CEA _xmscvsu_good: ; -4532 1CEA D4 22 movz (xms_channels+6)+x, a ; 5 save -4533 1CEC C4 A5 movz (xms_cc_volume), a ; 4 save -4534 1CEE 18 04 9E or (xms_cc_flags), #ccflag_volume ; 5 set flag -4535 1CF1 6F ret ; 5 -4536 1CF2 -4537 1CF2 XMS_CHANNEL_VOLSLIDEd: ;[33 cycles] -4538 1CF2 ; a = amount ; -4539 1CF2 ; x = channel * 16 ; -4540 1CF2 80 setc ; 2 -4541 1CF3 B4 22 sbcz a, (xms_channels+6)+x ; 4 reverse subtract -4542 1CF5 48 FF eor a, #255 ; 2 -4543 1CF7 BC inc a ; 2 -4544 1CF8 10 02 bpl _xmscvsd_good ; 2/4 -4545 1CFA E8 00 mov a, #0 ; 2 clip -4546 1CFC _xmscvsd_good: ; -4547 1CFC D4 22 movz (xms_channels+6)+x, a ; 5 save -4548 1CFE C4 A5 movz (xms_cc_volume), a ; 4 save -4549 1D00 18 04 9E or (xms_cc_flags), #ccflag_volume ; 5 set flag -4550 1D03 6F ret ; 5 -4551 1D04 -4552 1D04 XMS_PeriodClip: -4553 1D04 00 nop ; <------- MODIFICATION SPACE (branch) -4554 1D05 00 nop ; -4555 1D06 -4556 1D06 XMS_PeriodClipL: ;[25 cycles] -4557 1D06 ; ya = period ; -4558 1D06 ; returns clamped period ; -4559 1D06 -4560 1D06 AD 07 cmp y, #((plimitl_lo>>8)+1) ; 2 -4561 1D08 B0 04 bcs _pc_pge_1600 ; 2/4 -4562 1D0A 68 40 cmp a, #((plimitl_lo&255) ; 2 -4563 1D0C 90 0D bcc _pc_plt_1600 ; 2/4 -4564 1D0E _pc_pge_1600: -4565 1D0E AD 1E cmp y, #(plimitl_hi>>8) ; 2 -4566 1D10 90 08 bcc _pc_p_good ; 2/4 -4567 1D12 68 31 cmp a, #((plimitl_hi&255)+1); 2 -4568 1D14 90 04 bcc _pc_p_good ; 2/4 -4569 1D16 E8 30 mov a, #(plimitl_hi&255) ; 2 -4570 1D18 8D 1E mov y, #(plimitl_hi>>8) ; 2 -4571 1D1A _pc_p_good: ; -4572 1D1A 6F ret ; 5 -4573 1D1B -4574 1D1B _pc_plt_1600: ; -4575 1D1B E8 40 mov a, #(plimitl_lo&255) ; 2 -4576 1D1D 8D 06 mov y, #(plimitl_lo>>8) ; 2 -4577 1D1F 6F ret ; 5 -4578 1D20 -4579 1D20 -4580 1D20 XMS_PeriodClipA: -4581 1D20 ; ya = period ; -4582 1D20 ; returns clamped period ; -4583 1D20 AD 00 cmp y, #0 -4584 1D22 30 19 bmi _pca_plt_1600 -4585 1D24 -4586 1D24 8F 70 0A mov (int1), #(plimita_lo&255) -4587 1D27 8F 00 0B mov (int1+1), #(plimita_lo>>8) -4588 1D2A 5A 0A cmpw ya, (int1) -4589 1D2C B0 00 bcs _pca_pge_1600 -4590 1D2E _pca_pge_1600: -4591 1D2E 8F FE 0A mov (int1), #(plimita_hi&255) -4592 1D31 8F 1F 0B mov (int1+1), #(plimita_hi>>8) -4593 1D34 5A 0A cmpw ya, (int1) -4594 1D36 90 04 bcc _pca_p_good -4595 1D38 E8 FE mov a, #(plimita_hi&255) ; 2 -4596 1D3A 8D 1F mov y, #(plimita_hi>>8) ; 2 -4597 1D3C _pca_p_good: ; -4598 1D3C 6F ret ; 5 -4599 1D3D -4600 1D3D _pca_plt_1600: ; -4601 1D3D E8 70 mov a, #(plimita_lo&255) ; 2 -4602 1D3F 8D 00 mov y, #(plimita_lo>>8) ; 2 -4603 1D41 6F ret ; 5 -4604 1D42 -4605 1D42 ;============================================================================================ -4606 1D42 ; ENVELOPE CONTROLLERS! -4607 1D42 ; ------------------------------------------------------------------ -4608 1D42 #ifdef FX_INCLUDE_ENVPOS -4609 1D42 XMS_CHANNEL_ENV_SETPOSITION: ;[119 cycles] -4610 1D42 ; int1 = position ; -4611 1D42 ; x = channel * 16 ; -4612 1D42 ; return ; -4613 1D42 ; x = preserved ; -4614 1D42 ; position = 0-324 ; -4615 1D42 ; routine: ; -4616 1D42 ; set position ; -4617 1D42 ; DO NOT READ! ; -4618 1D42 -4619 1D42 ; scan envelopes & save -4620 1D42 E8 18 mov a, #c_inst_volenv ; 2 { 114 cycles -4621 1D44 8D 00 mov y, #0 ; 2 -4622 1D46 7A 1A addw ya, (cur_inst) ; 5 -4623 1D48 DA 10 movw (int4), ya ; 4 -4624 1D4A E4 0A movz a, (int1) ; 3 save positions -4625 1D4C D5 C6 10 mov (xms_channels_other+2)+x, a ; 6 -4626 1D4F 3F 4A 1F call XMS_CHANNEL_ENVSCAN ; 8+52 -4627 1D52 ; y = point -4628 1D52 -4629 1D52 DD mov a, y ; 2 -4630 1D53 60 clrc -4631 1D54 88 18 adc a, #c_inst_volenv -4632 1D56 D5 CE 10 mov (xms_channels_other+coso_epv)+x, a ; 6 -4633 1D59 FC inc y ; 2 -4634 1D5A F7 10 mov a, [int4]+y ; 6 -4635 1D5C DC dec y ; 2 -4636 1D5D 80 setc ; 2 -4637 1D5E B7 10 sbci a, [int4]+y ; 6 -4638 1D60 D5 D0 10 mov (xms_channels_other+coso_eyv)+x, a ; 6 } -4639 1D63 -4640 1D63 6F ret ; 5 +5 return -4641 1D64 #endif -4642 1D64 -4643 1D64 ;------------------------------------------------------------------ -4644 1D64 XMS_CHANNEL_ENV_RESET: ;[48 cycles] -4645 1D64 ; no parameters -4646 1D64 ;-------------- -4647 1D64 ; x is preserved -4648 1D64 E8 80 mov a, #%10000000 ; 2 set keyon -4649 1D66 15 CA 10 or a, (xms_channels_other+6)+x ; 5 -4650 1D69 D5 CA 10 mov (xms_channels_other+6)+x, a ; 6 -4651 1D6C E8 00 mov a, #0 ; 2 a = 0 -4652 1D6E D5 C6 10 mov (xms_channels_other+2)+x, a ; 6 reset envelope X (volume) -4653 1D71 D5 C8 10 mov (xms_channels_other+4)+x, a ; 6 reset envelope X (pan) -4654 1D74 E8 18 mov a, #c_inst_volenv ; 2 set envelope variables -4655 1D76 D5 CE 10 mov (xms_channels_other+coso_epv)+x, a ; 6 -4656 1D79 E8 30 mov a, #c_inst_panenv ; 2 -4657 1D7B D5 CF 10 mov (xms_channels_other+coso_epp)+x, a ; 6 -4658 1D7E 6F ret ; 5 return -4659 1D7F -4660 1D7F ;==================================================================\ -4661 1D7F XMS_CHANNEL_ENV_KEYOFF: ;[18 cycles] \ -4662 1D7F ; x = channel * 16 ; \ -4663 1D7F ; x is preserved ; \ -4664 1D7F F5 CA 10 mov a, (xms_channels_other+6)+x ; 5 read flags \ -4665 1D82 28 7F and a, #%01111111 ; 2 reset keyon \ -4666 1D84 D5 CA 10 mov (xms_channels_other+6)+x, a ; 6 save \ -4667 1D87 6F ret ; 5 \ -4668 1D88 ;==================================================================\ -4669 1D88 -4670 1D88 ;-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -4671 1D88 ; MAIN ENVELOPE ROUTINE -4672 1D88 ;-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -4673 1D88 -4674 1D88 _xms_channel_env_dis: -4675 1D88 E8 00 mov a, #0 ; 2 set null values -4676 1D8A D5 C6 10 mov (xms_channels_other+2)+x, a ; 6 -4677 1D8D D5 C7 10 mov (xms_channels_other+3)+x, a ; 6 -4678 1D90 D5 C8 10 mov (xms_channels_other+4)+x, a ; 6 -4679 1D93 E8 20 mov a, #32 ; 2 -4680 1D95 D5 C9 10 mov (xms_channels_other+5)+x, a ; 6 -4681 1D98 18 04 9E or (xms_cc_flags), #ccflag_volume ; 5 -4682 1D9B 6F ret ; 5 -4683 1D9C -4684 1D9C _xmscev_envelope_dis: -4685 1D9C E8 00 mov a, #0 ; 2 store default volume values (if disabled) -4686 1D9E D5 C6 10 mov (xms_channels_other+2)+x, a ; 6 -4687 1DA1 E8 40 mov a, #64 ; 2 -4688 1DA3 D5 C7 10 mov (xms_channels_other+3)+x, a ; 6 -4689 1DA6 5F 14 1E jmp _xmscev_skipvol ; 3 skip -4690 1DA9 -4691 1DA9 XMS_CHANNEL_ENV_ROUTINE: ;[628 cycles] :OO <------------ ENTRY POINT | HEAVY CPU ROUTINE -4692 1DA9 ; x = channel * 16 ; | OPTIMIZATION: HIGH -4693 1DA9 ; x is preserved ; | -4694 1DA9 ; this routine reads values in envelope, and then increases the counters -4695 1DA9 ; -4696 1DA9 F4 1E movz a, (xms_channels+cso_inst)+x ; 4 check for valid instrument { 8 cycles -4697 1DAB 68 00 cmp a, #0 ; 2 -4698 1DAD ; -4699 1DAD F0 D9 beq _xms_channel_env_dis ; 2/4 -4700 1DAF ; } -4701 1DAF ; volume envelope & fadeout ;----------------------------------------------------------------- -4702 1DAF -4703 1DAF 8D 04 mov y, #c_inst_envflags ; 2 read envelope flags { 23 cycles -4704 1DB1 F7 1A mov a, [cur_inst]+y ; 6 -4705 1DB3 C4 0C movz (int2), a ; 4 save for later -4706 1DB5 -4707 1DB5 28 01 and a, #1 ; 2 check envelope_enable -4708 1DB7 F0 E3 beq _xmscev_envelope_dis ; 2/4 -4709 1DB9 -4710 1DB9 F5 C6 10 mov a, (xms_channels_other+2)+x ; 5 get volume x -4711 1DBC C4 0A movz (int1), a ; 4 int1 = volume x } -4712 1DBE -4713 1DBE 8D 02 mov y, #c_inst_nvpoints ; 2 compute y = env_offset+npoints-1 { 12 cycles -4714 1DC0 F7 1A mov a, [cur_inst]+y ; 6 -4715 1DC2 -4716 1DC2 2D push a ; 4 } -4717 1DC3 -4718 1DC3 8F 00 14 mov (int7), #0 ; 5 { 194 cycles -4719 1DC6 F5 D0 10 mov a, (xms_channels_other+coso_eyv)+x ; 5 -4720 1DC9 C5 15 00 mov (int7+1), a ; 4 -4721 1DCC F5 CE 10 mov a, (xms_channels_other+coso_epv)+x ; 5 -4722 1DCF BC inc a ; 2 -4723 1DD0 FD mov y, a ; 2 -4724 1DD1 E4 0A movz a, (int1) ; 3 -4725 1DD3 77 1A cmpi a, [cur_inst]+y ; 6 -4726 1DD5 D0 01 bne _xmscev_readvol ; 2/4 -4727 1DD7 FC inc y ; 2 -4728 1DD8 _xmscev_readvol: ; -4729 1DD8 DC dec y ; 2 -4730 1DD9 DD mov a, y ; 2 -4731 1DDA D5 CE 10 mov (xms_channels_other+coso_epv)+x, a ; 6 -4732 1DDD -4733 1DDD EE pop y ; 4 -4734 1DDE C4 16 movz (byte1), a ; 4 -4735 1DE0 7E 16 cmpz y, (byte1) ; 3 -4736 1DE2 -4737 1DE2 F0 26 beq _xmscev_quickvol ; 2/4 -4738 1DE4 3F AE 1E call XMS_CHANNEL_ENV_READ ; 8+108 -4739 1DE7 -4740 1DE7 D5 C6 10 mov (xms_channels_other+2)+x, a ; 6 -4741 1DEA DD mov a, y ; 2 -4742 1DEB D5 C7 10 mov (xms_channels_other+3)+x, a ; 6 -4743 1DEE F5 CA 10 mov a, (xms_channels_other+6)+x ; 5 } -4744 1DF1 -4745 1DF1 10 0E bpl _xmscev_vol_nosustain ; 2/4 CHECK IF KEY IS ON (keyon bit is msb) { 34 cycles -4746 1DF3 -4747 1DF3 33 0C 0B bbc1 (int2), _xmscev_vol_nosustain ; 5/7 check & branch if bit2 cleared -4748 1DF6 -4749 1DF6 F5 C6 10 mov a, (xms_channels_other+2)+x ; 5 compare x with sustain point -4750 1DF9 8D 05 mov y, #c_inst_volsus ; 2 -4751 1DFB 77 1A cmpi a, [cur_inst]+y ; 6 -4752 1DFD F0 15 beq _xmscev_skipvol ; 2/4 -4753 1DFF 2F 03 b _xmscev_vol_inc ; 4 -4754 1E01 _xmscev_vol_nosustain: ; -4755 1E01 F5 C6 10 mov a, (xms_channels_other+2)+x ; 5 load old value -4756 1E04 _xmscev_vol_inc: ; -4757 1E04 BC inc a ; 2 increment position -4758 1E05 D5 C6 10 mov (xms_channels_other+2)+x, a ; 6 -4759 1E08 2F 0A b _xmscev_skipvol -4760 1E0A _xmscev_quickvol: -4761 1E0A 3F AE 1E call XMS_CHANNEL_ENV_READ -4762 1E0D -4763 1E0D D5 C6 10 mov (xms_channels_other+2)+x, a ; save values -4764 1E10 DD mov a, y ; -4765 1E11 D5 C7 10 mov (xms_channels_other+3)+x, a ; -4766 1E14 _xmscev_skipvol: ; } -4767 1E14 -4768 1E14 F5 CA 10 mov a, (xms_channels_other+6)+x ; 5 { 62 cycles -4769 1E17 -4770 1E17 30 27 bmi _xmscev_nofadeout ; 2/4 CHECK IF KEY IS OFF -4771 1E19 13 0C 12 bbc0 (int2), _xmscev_fadeout_isover ; 5/7 check & branch if bit1 cleared -4772 1E1C -4773 1E1C ;----------------- ; do some fadeout here -4774 1E1C 80 setc ; 2 subtract fadeout value -4775 1E1D 8D 11 mov y, #c_inst_fadeout ; 2 -4776 1E1F F5 C4 10 mov a, (xms_channels_other+0)+x ; 5 -4777 1E22 B7 1A sbci a, [cur_inst]+y ; 6 -4778 1E24 2D push a ; 4 -4779 1E25 FC inc y ; 2 -4780 1E26 F5 C5 10 mov a, (xms_channels_other+1)+x ; 5 -4781 1E29 B7 1A sbci a, [cur_inst]+y ; 6 -4782 1E2B B0 0C bcs _xmscev_fadeout_noOver ; 2/4 -4783 1E2D EE pop y ; 4 -4784 1E2E _xmscev_fadeout_isover: -4785 1E2E -4786 1E2E E8 00 mov a, #0 ; 2 clip -4787 1E30 D5 C4 10 mov (xms_channels_other+0)+x, a ; 6 -4788 1E33 D5 C5 10 mov (xms_channels_other+1)+x, a ; 6 -4789 1E36 5F 40 1E jmp _xmscev_nofadeout ; 3 -4790 1E39 _xmscev_fadeout_noOver: -4791 1E39 D5 C5 10 mov (xms_channels_other+1)+x, a ; 6 store -4792 1E3C AE pop a ; 4 -4793 1E3D D5 C4 10 mov (xms_channels_other+0)+x, a ; 6 -4794 1E40 _xmscev_nofadeout: ; } -4795 1E40 -4796 1E40 ; Panning envelope --------------------------------------------------------------------- -4797 1E40 -4798 1E40 63 0C 0C bbs3 (int2), _xmscev_pan_enabled ; 5/7 check & branch if bit4 set { 33 cycles -4799 1E43 E8 00 mov a, #0 ; 2 default values -4800 1E45 D5 C8 10 mov (xms_channels_other+4)+x, a ; 6 -4801 1E48 E8 20 mov a, #32 ; 2 -4802 1E4A D5 C9 10 mov (xms_channels_other+5)+x, a ; 6 -4803 1E4D 2F 5E b _xmscev_skippan ; 4 skip -4804 1E4F _xmscev_pan_enabled: -4805 1E4F -4806 1E4F 18 08 9E or (xms_cc_flags), #ccflag_panning ; 5 panning changes, set flag -4807 1E52 -4808 1E52 8D 03 mov y, #c_inst_nppoints ; 2 compute y = env_offset+nppoints-1 -4809 1E54 F7 1A mov a, [cur_inst]+y ; 6 -4810 1E56 2D push a ; 4 -4811 1E57 -4812 1E57 F5 C8 10 mov a, (xms_channels_other+4)+x ; 5 -4813 1E5A C4 0A movz (int1), a ; 4 } -4814 1E5C -4815 1E5C 8F 01 14 mov (int7), #1 ; 5 panning mode { 190 cycles -4816 1E5F F5 D1 10 mov a, (xms_channels_other+coso_eyp)+x ; 5 -4817 1E62 C5 15 00 mov (int7+1), a ; 4 -4818 1E65 F5 CF 10 mov a, (xms_channels_other+coso_epp)+x ; 5 -4819 1E68 BC inc a ; 2 -4820 1E69 FD mov y, a ; 2 -4821 1E6A E4 0A movz a, (int1) ; 4 -4822 1E6C 77 1A cmpi a, [cur_inst]+y ; 6 -4823 1E6E D0 01 bne _xmscer_readpan ; 2/4 -4824 1E70 FC inc y ; 2 -4825 1E71 _xmscer_readpan: ; -4826 1E71 DC dec y ; 2 -4827 1E72 DD mov a, y ; 2 -4828 1E73 D5 CF 10 mov (xms_channels_other+coso_epp)+x, a ; 6 -4829 1E76 EE pop y ; 4 -4830 1E77 C4 16 movz (byte1), a ; 4 -4831 1E79 7E 16 cmpz y, (byte1) ; 3 -4832 1E7B F0 26 beq _xmscev_quickpan ; 2/4 -4833 1E7D 3F AE 1E call XMS_CHANNEL_ENV_READ ; 8+108 -4834 1E80 -4835 1E80 -4836 1E80 D5 C8 10 mov (xms_channels_other+4)+x, a ; 6 save values -4837 1E83 DD mov a, y ; 2 -4838 1E84 D5 C9 10 mov (xms_channels_other+5)+x, a ; 6 -4839 1E87 ; ------------------------------------ } -4840 1E87 F5 CA 10 mov a, (xms_channels_other+6)+x ; 5 { 39 cycles -4841 1E8A 10 0E bpl _xmscev_pan_nosustain ; 2/4 CHECK IF KEY IS ON -4842 1E8C ; -4843 1E8C 93 0C 0B bbc4 (int2), _xmscev_pan_nosustain ; 5/7 check & branch if bit5 set -4844 1E8F -4845 1E8F F5 C8 10 mov a, (xms_channels_other+4)+x ; 5 read panning envelope position -4846 1E92 8D 0B mov y, #c_inst_pansus ; 2 -4847 1E94 77 1A cmpi a, [cur_inst]+y ; 6 compare with sustain -4848 1E96 -4849 1E96 F0 15 beq _xmscev_skippan ; 2/4 skip -4850 1E98 2F 03 b _xmscev_pan_inc ; 4 -4851 1E9A _xmscev_pan_nosustain: ; -4852 1E9A -4853 1E9A F5 C8 10 mov a, (xms_channels_other+4)+x ; 5 read panning envelope position -4854 1E9D _xmscev_pan_inc: ; -4855 1E9D -4856 1E9D BC inc a ; 2 increment -4857 1E9E D5 C8 10 mov (xms_channels_other+4)+x, a ; 6 save -4858 1EA1 2F 0A b _xmscev_skippan -4859 1EA3 _xmscev_quickpan: -4860 1EA3 3F AE 1E call XMS_CHANNEL_ENV_READ -4861 1EA6 D5 C8 10 mov (xms_channels_other+4)+x, a ; save values -4862 1EA9 DD mov a, y ; -4863 1EAA D5 C9 10 mov (xms_channels_other+5)+x, a ; -4864 1EAD _xmscev_skippan: ; } -4865 1EAD -4866 1EAD 6F ret ; 5 } 5 cycles -4867 1EAE -4868 1EAE ;=======================================================================================, -4869 1EAE XMS_CHANNEL_ENV_READ: ;[108 cycles] -4870 1EAE ; x = channel * 8 -4871 1EAE ; int1 = x pos -4872 1EAE ; int7+1 = special optimization -4873 1EAE ; cur_inst = inst_offset -4874 1EAE ; int7 = PANNING mode -4875 1EAE ; a = env_offset + point -4876 1EAE ;---------------------------- -4877 1EAE ; ya = envelope value -4878 1EAE ; this function updates values in channel other info -4879 1EAE -4880 1EAE 60 clrc ; 2 { 25 cycles -4881 1EAF FD mov y, a ; 2 -4882 1EB0 88 0C adc a, #12 ; 2 -4883 1EB2 C4 16 movz (byte1), a ; 4 -4884 1EB4 E4 0A movz a, (int1) ; 3 -4885 1EB6 80 setc ; 2 -4886 1EB7 B7 1A sbci a, [cur_inst]+y ; 6 -4887 1EB9 -4888 1EB9 ; a = cx = x-point.x ; -4889 1EB9 D0 63 bne _xmscer_cxnot0 ; 2/4 } branches -4890 1EBB _xmscer_zero: -4891 1EBB ; cx is zero, no interpolation needed -4892 1EBB 03 14 21 bbs0 (int7), _xmscer_panningl ; 5/7 { 82 cycles -4893 1EBE _xmscer_volumel: -4894 1EBE E4 0A movz a, (int1) ; 3 { 70 cycles -4895 1EC0 8D 0A mov y, #c_inst_volloope ; 2 -4896 1EC2 77 1A cmpi a, [cur_inst]+y ; 6 -4897 1EC4 D0 3A bne _xmscer_noloop ; 2/4 -4898 1EC6 -4899 1EC6 8D 07 mov y, #c_inst_volloopsp ; 2 -4900 1EC8 F7 1A mov a, [cur_inst]+y ; 6 -4901 1ECA D5 CE 10 mov (xms_channels_other+coso_epv)+x, a ; 6 -4902 1ECD 8D 09 mov y, #c_inst_volloopsy ; 2 -4903 1ECF F7 1A mov a, [cur_inst]+y ; 6 -4904 1ED1 D5 D0 10 mov (xms_channels_other+coso_eyv)+x, a ; 6 -4905 1ED4 8D 08 mov y, #c_inst_volloopsv ; 2 -4906 1ED6 F7 1A mov a, [cur_inst]+y ; 6 -4907 1ED8 2D push a ; 4 -4908 1ED9 8D 06 mov y, #c_inst_volloopsx ; 2 -4909 1EDB F7 1A mov a, [cur_inst]+y ; 6 -4910 1EDD -4911 1EDD EE pop y ; 4 -4912 1EDE 6F ret ; 5 } -4913 1EDF ;--------------------------------------------------------------------------------------------------------------------------------------- -4914 1EDF _xmscer_panningl: -4915 1EDF E4 0A movz a, (int1) ; 3 { 70 cycles -4916 1EE1 8D 10 mov y, #c_inst_panloope ; 2 -4917 1EE3 77 1A cmpi a, [cur_inst]+y ; 6 -4918 1EE5 D0 19 bne _xmscer_noloop ; 2/4 -4919 1EE7 -4920 1EE7 8D 0D mov y, #c_inst_panloopsp ; 2 -4921 1EE9 F7 1A mov a, [cur_inst]+y ; 6 -4922 1EEB D5 CF 10 mov (xms_channels_other+coso_epp)+x, a ; 6 -4923 1EEE 8D 09 mov y, #c_inst_volloopsy ; 2 -4924 1EF0 F7 1A mov a, [cur_inst]+y ; 6 -4925 1EF2 D5 D1 10 mov (xms_channels_other+coso_eyp)+x, a ; 6 -4926 1EF5 8D 0E mov y, #c_inst_panloopsv ; 2 -4927 1EF7 F7 1A mov a, [cur_inst]+y ; 6 -4928 1EF9 2D push a ; 4 -4929 1EFA 8D 0C mov y, #c_inst_panloopsx ; 2 -4930 1EFC F7 1A mov a, [cur_inst]+y ; 6 -4931 1EFE -4932 1EFE EE pop y ; 4 -4933 1EFF 6F ret ; 5 } } -4934 1F00 _xmscer_noloop: -4935 1F00 80 setc ; 2 { 58 cycles -4936 1F01 E4 16 movz a, (byte1) ; 3 -4937 1F03 A8 0B sbc a, #11 ; 2 -4938 1F05 FD mov y, a ; 2 -4939 1F06 F7 1A mov a, [cur_inst]+y ; 6 -4940 1F08 DC dec y ; 2 -4941 1F09 B7 1A sbci a, [cur_inst]+y ; 6 -4942 1F0B 03 14 05 bbs0 (int7), _xmscer_panning3 ; 5/7 -4943 1F0E D5 D0 10 mov (xms_channels_other+coso_eyv)+x, a ; 6 -4944 1F11 2F 03 b _xmscer_volume3 ; 4 -4945 1F13 _xmscer_panning3: ; -4946 1F13 D5 D1 10 mov (xms_channels_other+coso_eyp)+x, a ; 6 -4947 1F16 _xmscer_volume3: ;---- -4948 1F16 -4949 1F16 EB 16 movz y, (byte1) ; 2 -4950 1F18 F7 1A mov a, [cur_inst]+y ; 6 -4951 1F1A FD mov y, a ; 4 restore -4952 1F1B E4 0A movz a, (int1) ; 3 load -4953 1F1D 6F ret ; 5 exit } -4954 1F1E _xmscer_cxnot0: -4955 1F1E ; cx isn't zero ; newsflash: current point is NOT LAST -4956 1F1E ; interpolation is needed ; current position is NOT zero difference from point -4957 1F1E ; int3 = point1 x -4958 1F1E -4959 1F1E C4 0B movz (int1+1), a ; 4 { 31 cycles { 83 cycles -4960 1F20 4D push x ; 4 -4961 1F21 -4962 1F21 EB 16 movz y, (byte1) ; 3 p1.y - p2.y -4963 1F23 F7 1A mov a, [cur_inst]+y ; 6 -4964 1F25 -4965 1F25 C4 16 movz (byte1), a ; 4 -4966 1F27 FC inc y ; 2 -4967 1F28 B7 1A sbci a, [cur_inst]+y ; 6 -4968 1F2A -4969 1F2A 10 0E bpl _xmscer_iplus ; 2/4 } minus -4970 1F2C _xmscer_ineg: -4971 1F2C 48 FF eor a, #255 ; 2 { 38 cycles -4972 1F2E BC inc a ; 2 -4973 1F2F EB 0B movz y, (int1+1) ; 3 -4974 1F31 CF mul ya ; 9 -4975 1F32 F8 15 movz x, (int7+1) ; 3 -4976 1F34 9E div ya, x ; 12 -4977 1F35 84 16 adcz a, (byte1) ; 3 -4978 1F37 5F 45 1F jmp _xmscer_exit ; 4 } -4979 1F3A _xmscer_iplus: -4980 1F3A EB 0B movz y, (int1+1) ; 3 { 34 cycles -4981 1F3C CF mul ya ; 9 -4982 1F3D F8 15 movz x, (int7+1) ; 3 -4983 1F3F 9E div ya, x ; 12 -4984 1F40 A4 16 sbcz a, (byte1) ; 3 -4985 1F42 48 FF eor a, #255 ; 2 -4986 1F44 BC inc a ; 2 } -4987 1F45 _xmscer_exit: -4988 1F45 -4989 1F45 CE pop x ; 4 { 14 cycles -4990 1F46 FD mov y, a ; 2 -4991 1F47 E4 0A movz a, (int1) ; 3 -4992 1F49 -4993 1F49 6F ret ; 5 } } -4994 1F4A -4995 1F4A #ifdef FX_INCLUDE_ENVPOS -4996 1F4A ;===================================================================================================, -4997 1F4A XMS_CHANNEL_ENVSCAN: ; [52 cycles] ; -4998 1F4A ; a = x position ; ;// -4999 1F4A ; (int4) = env offset ; ;// -5000 1F4A ; clobbering: ; ;// -5001 1F4A ; returns: ; ;// -5002 1F4A ; y = result (point) ; ;// -5003 1F4A ; '===========================, -5004 1F4A _xmscev_start: ; ; -5005 1F4A 8D 06 mov y, #6 ; 2 check >= 6 ;// -5006 1F4C 77 10 cmpi a, [int4]+y ; 6 ;// -5007 1F4E B0 1F bcs _xmscev_g6 ; 2/4 ;// -5008 1F50 _xmscev_l6: ; ( < 6 ) ;// -5009 1F50 8D 03 mov y, #3 ; 2 ;// -5010 1F52 77 10 cmpi a, [int4]+y ; 6 check >= 3 ;// -5011 1F54 B0 0C bcs _xmscev_g3 ; 2/4 ;// -5012 1F56 DC dec y ; 2 ( < 3 ) ;// -5013 1F57 77 10 cmpi a, [int4]+y ; 6 check == 2 ;// -5014 1F59 B0 32 bcs _xmscev_ret ; 2/4 ;// -5015 1F5B DC dec y ; 2 ;// -5016 1F5C 77 10 cmpi a, [int4]+y ; 6 check == 1 ;// -5017 1F5E B0 2D bcs _xmscev_ret ; 2/4 ;// -5018 1F60 DC dec y ; 2 answer = 0 ;// -5019 1F61 6F ret ; ;// -5020 1F62 _xmscev_g3: ; ;// -5021 1F62 8D 05 mov y, #5 ; 2 ( >= 3 ) ;// -5022 1F64 77 10 cmpi a, [int4]+y ; 6 check == 5 ;// -5023 1F66 B0 25 bcs _xmscev_ret ; 2/4 ;// -5024 1F68 DC dec y ; 2 ;// -5025 1F69 77 10 cmpi a, [int4]+y ; 6 check == 4 ;// -5026 1F6B B0 20 bcs _xmscev_ret ; 2/4 ;// -5027 1F6D DC dec y ; 2 answer = 3 ;// -5028 1F6E 6F ret ; ;// -5029 1F6F _xmscev_g6: ; ;// -5030 1F6F 8D 09 mov y, #9 ; 2 ( >= 6 ) ;// -5031 1F71 77 10 cmpi a, [int4]+y ; 6 check >= 9 ;// -5032 1F73 B0 0C bcs _xmscev_g9 ; 2/4 ;// -5033 1F75 DC dec y ; 2 ( < 9 ) ;// -5034 1F76 77 10 cmpi a, [int4]+y ; 6 check == 8 ;// -5035 1F78 B0 13 bcs _xmscev_ret ; 2/4 ;// -5036 1F7A DC dec y ; 2 ;// -5037 1F7B 77 10 cmpi a, [int4]+y ; 6 check == 7 ;// -5038 1F7D B0 0E bcs _xmscev_ret ; 2/4 ;// -5039 1F7F DC dec y ; 2 answer = 5 ;// -5040 1F80 6F ret ; ;// -5041 1F81 _xmscev_g9: ; ;// -5042 1F81 8D 0B mov y, #11 ; 2 ( >= 9 ) ;// -5043 1F83 77 10 cmpi a, [int4]+y ; 6 check == 11 ;// -5044 1F85 B0 06 bcs _xmscev_ret ; 2/4 ;// -5045 1F87 DC dec y ; 2 ;// -5046 1F88 77 10 cmpi a, [int4]+y ; 6 check == 10 ;// -5047 1F8A B0 01 bcs _xmscev_ret ; 2/4 ;// -5048 1F8C DC dec y ; 2 answer = 9 ;// -5049 1F8D _xmscev_ret: ; ;// -5050 1F8D 6F ret ; 5 ;// -5051 1F8E ;// -5052 1F8E ;==============================================================================================================================='// -5053 1F8E ;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -5054 1F8E ;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -5055 1F8E #endif -5056 1F8E -5057 1F8E ;-------------------------------------------------------------------------------------------------------- -5058 1F8E ; VIBRATO ROUTINES! -5059 1F8E ;-------------------------------------------------------------------------------------------------------- -5060 1F8E XMS_AV_UPDATE: ;[213 cycles] | -5061 1F8E 60 clrc ; 2 { 43 cycles | COMMON ROUTINE -5062 1F8F F5 CB 10 mov a, (xms_channels_other+7)+x ; 5 | OPTIMIZATION: MED/LOW -5063 1F92 8D 14 mov y, #c_inst_vibsweep ; 2 | -5064 1F94 97 1A adci a, [cur_inst]+y ; 6 -5065 1F96 D5 CB 10 mov (xms_channels_other+7)+x, a ; 6 -5066 1F99 FC inc y ; 2 -5067 1F9A F7 1A mov a, [cur_inst]+y ; 6 -5068 1F9C 94 24 adcz a, (xms_channels+cso_avsweep)+x ; 5 -5069 1F9E 90 02 bcc _xmsavu_noover ; 2/4 -5070 1FA0 _xmsavu_nosweep: ; -5071 1FA0 E8 FF mov a, #255 ; 2 clip -5072 1FA2 _xmsavu_noover: ; -5073 1FA2 D4 24 movz (xms_channels+cso_avsweep)+x, a ; 5 save } -5074 1FA4 -5075 1FA4 _xmsavu_skip_sweep: -5076 1FA4 -5077 1FA4 8D 13 mov y, #c_inst_vibtype ; 2 type... { 63 cycles -5078 1FA6 F7 1A mov a, [cur_inst]+y ; 6 -5079 1FA8 2D push a ; 4 save -5080 1FA9 ; -5081 1FA9 8D 17 mov y, #c_inst_vibrate ; 2 rate... -5082 1FAB F7 1A mov a, [cur_inst]+y ; 6 -5083 1FAD C4 0B movz (int1+1), a ; 4 -5084 1FAF ; -5085 1FAF DC dec y ; 2 depth -- dont change instrument structure between depth&rate -5086 1FB0 F7 1A mov a, [cur_inst]+y ; 6 -5087 1FB2 68 00 cmp a, #0 ; 2 exit if depth=0 -5088 1FB4 F0 36 beq _xmsav_exit ; 2/4 -5089 1FB6 FD mov y, a ; depth ; 2 -5090 1FB7 ; -5091 1FB7 F4 24 movz a, (xms_channels+cso_avsweep)+x ; 4 -5092 1FB9 68 FF cmp a, #255 ; 2 -5093 1FBB F0 05 beq _xmsfxv_fullav ; 2/4 ---------------------------------------- -5094 1FBD CF mul ya ; 9 -5095 1FBE CB 0A movz (int1), y ; 4 -5096 1FC0 ; -5097 1FC0 2F 02 b _xmsfxv_hasavd ; 4 -5098 1FC2 _xmsfxv_fullav: ;---------------------------------------------- -5099 1FC2 CB 0A movz (int1), y ; 4 -5100 1FC4 _xmsfxv_hasavd: ;---------------------------------------------- } -5101 1FC4 -5102 1FC4 E4 0B movz a, (int1+1) ; 3 { 107 cycles -5103 1FC6 -5104 1FC6 60 clrc ; 2 -5105 1FC7 94 29 adcz a, (xms_channels+cso_avsine)+x ; 4 increment sine pos -5106 1FC9 D4 29 movz (xms_channels+cso_avsine)+x, a ; 5 -5107 1FCB -5108 1FCB EE pop y ; 4 -5109 1FCC 3F 14 20 call XMS_GETVIBTABLE ; 8+38 get table value -5110 1FCF -5111 1FCF FD mov y, a ; 2 multiply depth * "sine" -5112 1FD0 E4 0A movz a, (int1) ; 3 -5113 1FD2 CF mul ya ; 9 -5114 1FD3 -5115 1FD3 AA 9E E0 mov1 c, (xms_cc_flags+(7<<13)) ; 4 read sign { 20 cycles -5116 1FD6 -5117 1FD6 B0 07 bcs _xmsav_set_neg ; 2/4 -5118 1FD8 DD mov a, y ; 2 -5119 1FD9 _xmsav_0fix: -5120 1FD9 8D 00 mov y, #0 ; 2 -5121 1FDB DA A3 movw (xms_cc_perioda), ya ; 4 set perioda.... -5122 1FDD 2F 0A b _xmsav_set_pos ; 4 -5123 1FDF _xmsav_set_neg: -5124 1FDF -5125 1FDF DD mov a, y ; 2 -5126 1FE0 48 FF eor a, #255 ; 2 -5127 1FE2 BC inc a ; 2 -5128 1FE3 F0 F4 beq _xmsav_0fix ; 2/4 -5129 1FE5 8D FF mov y, #255 ; 2 -5130 1FE7 DA A3 movw (xms_cc_perioda), ya ; 4 -5131 1FE9 _xmsav_set_pos: ; } -5132 1FE9 -5133 1FE9 22 9E set1 (xms_cc_flags) ; 4 set flag -5134 1FEB 6F ret ; 5 exit } -5135 1FEC -5136 1FEC _xmsav_exit: -5137 1FEC 8F 00 A3 mov (xms_cc_perioda), #0 ; 5 -5138 1FEF 8F 00 A4 mov (xms_cc_perioda+1), #0 ; 5 -5139 1FF2 AE pop a ; 4 restore -5140 1FF3 6F ret ; 5 exit -5141 1FF4 -5142 1FF4 table_mod_sine: -5143 1FF4 00 18 31 4A .byte 0, 24, 49, 74, 97,120,141,161, -5143 1FF8 61 78 8D A1 -5144 1FFC B4 C5 D4 E0 .byte 180,197,212,224,235,244,250,253, -5144 2000 EB F4 FA FD -5145 2004 FF FD FA F4 .byte 255,253,250,244,235,224,212,197, -5145 2008 EB E0 D4 C5 -5146 200C B4 A1 8D 78 .byte 180,161,141,120, 97, 74, 49, 24 -5146 2010 61 4A 31 18 -5147 2014 -5148 2014 ;-------------------------------------------------------------------------------------------- -5149 2014 XMS_GETVIBTABLE: ; ; 38 cycles maximum ; -5150 2014 ; a = position (0-255) ; ;-------------------- -5151 2014 ; y = table (0-3) ; ; optimization: med/high -5152 2014 ; return: ; ; -5153 2014 ; a = value ; ; -5154 2014 ; sets xms_cc_flags +/- PA bit ; ; -5155 2014 AD 03 cmp y, #3 ; 2 12 cycles ; -5156 2016 F0 2D beq _xmsgvt_T3 ; 2/4 ; -5157 2018 AD 02 cmp y, #2 ; 2 ; -5158 201A F0 1A beq _xmsgvt_T2 ; 2/4 ; -5159 201C AD 01 cmp y, #1 ; 2 ; -5160 201E F0 0E beq _xmsgvt_T1 ; 2/4 ; -5161 2020 ;-------------------------------- -5162 2020 _xmsgvt_T0: ; sine ; ; -5163 2020 68 80 cmp a, #128 ; 2 26 cycles ; -5164 2022 CA 9E E0 mov1 (xms_cc_flags+(7<<13)), c ; 6 ; -5165 2025 5C lsr a ; 2 ; -5166 2026 5C lsr a ; 2 ; -5167 2027 28 1F and a, #31 ; 2 ; -5168 2029 FD mov y, a ; 2 ; -5169 202A F6 F4 1F mov a, (table_mod_sine)+y ; 5 ; -5170 202D ; ; -5171 202D 6F ret ; 5 ; -5172 202E _xmsgvt_T1: ; square ;-------------------------------- -5173 202E 68 80 cmp a, #128 ; 2 15 cycles ; -5174 2030 CA 9E E0 mov1 (xms_cc_flags+(7<<13)), c ; 6 ; -5175 2033 E8 FF mov a, #255 ; 2 ; -5176 2035 6F ret ; 5 ; -5177 2036 _xmsgvt_T2: ; ramp down ;-------------------------------- -5178 2036 68 80 cmp a, #128 ; 2 8 cycles (28) ; -5179 2038 CA 9E E0 mov1 (xms_cc_flags+(7<<13)), c ; 6 ; -5180 203B ; ; -5181 203B _xmsgvt_rd_hack: ; ; -5182 203B ; ; -5183 203B B0 04 bcs _xmsgvt_rd_128 ;---- 2/4 11 cycles ; -5184 203D ; ; -5185 203D 1C asl a ; clears carry... ; 2 ; -5186 203E 48 FF eor a, #255 ; 2 ; -5187 2040 6F ret ; 5 ; -5188 2041 _xmsgvt_rd_128: ;--------- ; -5189 2041 ; ; -5190 2041 ; ...carry is set ; ; -5191 2041 A8 80 sbc a, #128 ; a = 0 to 127 ; 2 9 cycles (+2 jump) ; -5192 2043 1C asl a ; a = 0 to 254 ; 2 ; -5193 2044 6F ret ; 5 ; -5194 2045 ; ; -5195 2045 _xmsgvt_T3: ; ramp up ;---------------------------- -5196 2045 68 80 cmp a, #128 ; 2 26 cycles ; -5197 2047 ED notc ; 2 ; -5198 2048 CA 9E E0 mov1 (xms_cc_flags+(7<<13)), c ; 6 ; -5199 204B ED notc ; 2 ; -5200 204C 5F 3B 20 jmp _xmsgvt_rd_hack ; 3+11 ; -5201 204F ; ; -5202 204F ;------------------------------------------------------------------------ -5203 204F -5204 204F ; draft 2 -5205 204F XMS_VOLUMERAMP: ;[269 cycles] -5206 204F E4 B5 movz a, xms_playing -5207 2051 D0 01 bne _xms_vrok -5208 2053 6F ret -5209 2054 _xms_vrok: -5210 2054 CD 08 mov x, #8 ; 2 { 7 cycles -5211 2056 8F 77 F2 mov ($F2), #$77 ; 5 } -5212 2059 _xms_vrloop: ; -5213 2059 E4 F3 movz a, ($F3) ; 3 { 15 cycles { 257 cycles -5214 205B 30 1D bmi _xms_vrnone ; 2/4 -5215 205D 5C lsr a -5216 205E 74 D0 cmpz a, (xms_final_volume-1)+x ; 4 -5217 2060 F0 19 beq _xms_vrnoneC ; 2/4 -5218 2062 B0 0B bcs _xms_vrgreat ; 2/4 } -5219 2064 _xms_vrless: ; -5220 2064 BC inc a ; 2 { 17 cycles -5221 2065 1C asl a -5222 2066 C4 F3 movz ($F3), a ; 4 -5223 2068 B8 0F F2 sbc ($F2), #$0F ; 5 <-- carry was cleared -5224 206B 1D dec x ; 2 -5225 206C D0 EB bne _xms_vrloop ; 2/4 -5226 206E 6F ret ; } -5227 206F _xms_vrgreat: ; -5228 206F 9C dec a ; 2 { 17 cycles -5229 2070 1C asl a -5230 2071 C4 F3 movz ($F3), a ; 4 -5231 2073 B8 0F F2 sbc ($F2), #$0F ; 5 <-- carry was cleared -5232 2076 1D dec x ; 2 -5233 2077 D0 E0 bne _xms_vrloop ; 2/4 } } -5234 2079 _xms_vrbreak: -5235 2079 6F ret ; 5 -5236 207A -5237 207A _xms_vrnone: -5238 207A 80 setc -5239 207B _xms_vrnoneC: -5240 207B B8 10 F2 sbc ($F2), #$10 -5241 207E 1D dec x -5242 207F D0 D8 bne _xms_vrloop -5243 2081 6F ret -5244 2082 -5245 2082 XMS_CHECKSFX: -5246 2082 CD 07 mov x, #7 ; setup loop -5247 2084 8F 7C F2 mov ($F2), #$7C ; read from ENDX -5248 2087 _xmsfxc_loop: -5249 2087 F4 DE movz a, (samp_playing)+x ; load sfx value -5250 2089 F0 0C beq _xmsfxc_zero ; skip if already 0 -5251 208B F5 9B 20 mov a, (XMS_TABLE_BITS)+x ; translate to bit -5252 208E 24 F3 andz a, ($F3) ; mask with ENDX -5253 2090 F0 05 beq _xmsfxc_zero ; skip if zero -5254 2092 E8 00 mov a, #0 ; clear sfx value -5255 2094 D5 DE 00 mov (samp_playing)+x, a ; ... -5256 2097 _xmsfxc_zero: -5257 2097 1D dec x ; loop -5258 2098 10 ED bpl _xmsfxc_loop -5259 209A -5260 209A 6F ret -5261 209B -5262 209B XMS_TABLE_BITS: -5263 209B 01 02 04 08 .byte %1, %10, %100, %1000, %10000, %100000, %1000000, %10000000 -5263 209F 10 20 40 80 -5264 20A3 -5265 20A3 .END -5266 20A3 -5267 20A3 EOF - - - -Label Value Label Value Label Value ------------------- ------------------ ------------------ -COMM_MESSAGE_TABLE 0676 COMM_MODES 0692 COMM_MODE0 06A7 -COMM_MSG_TRANSFERSAMP 06FD COMM_MSG_TRANSFERSAMP_REL 0709 COMM_MSG_REGISTER_SAMP 0761 -COMM_MSG_SENDSAMPLES 0764 COMM_MSG_TRANSFER 07FD COMM_MSG_TRANSFERB 0803 -COMM_MSG_BUILDDIR 0806 COMM_MSG_SETFREQMODE 080C COMM_MSG_XMS_RESET 0863 -COMM_MSG_XMS_PLAY 0869 COMM_MSG_XMS_PAUSE 086F COMM_MSG_XMS_VOLUME 0872 -COMM_MSG_MAIN_VOLUME 0879 COMM_MSG_PLAYSAMPLE 0888 COMM_MSG_SETSFXPARAM 091A -COMM_MSG_UNDEFINED 0927 DSP_VOL 0000 DSP_P 0002 -DSP_SRCN 0004 DSP_ADSR 0005 DSP_GAIN 0007 -DSP_ENVX 0008 DSP_OUTX 0009 DSP_MVOLL 000C -DSP_MVOLR 001C DSP_EVOLL 002C DSP_EVOLR 003C -DSP_KON 004C DSP_KOF 005C DSP_FLG 006C -DSP_ENDX 007C DSP_EFB 000D DSP_PMON 002D -DSP_NON 003D DSP_EON 004D DSP_DIR 005D -DSP_ESA 006D DSP_EDL 007D DSP_C0 000F -DSP_C1 001F DSP_C2 002F DSP_C3 003F -DSP_C4 004F DSP_C5 005F DSP_C6 006F -DSP_C7 007F EOF 20A3 RESET_DSP_FILTER 0A65 -RESET_DSP_VOICES 0A8A SOUND_RESET 063E SOUND_ON 0651 -SOUND_OFF 0664 SOUND_VOLUME 066B SPC_GetTimerValues01 0B53 -XMS_BuildDirectory 092A XMS_PERIOD2FREQ 09BE XMS_PERIOD2FREQ_LINEAR 09C1 -XMS_PERIOD2FREQ_AMIGA 0A46 XMS_Play 0A9E XMS_Stop 0ADA -XMS_ClearChannels 0AEF XMS_ResetSamps 0B04 XMS_SetBPM 0B11 -XMS_SetPattern 0B6B XMS_VRamp 0BB1 XMS_Player 0BF1 -XMS_NotePeek 0EB7 XMS_GetInstOffset 0EC0 XMS_GetSampleHeader 0EE2 -XMS_GetPeriod 0F13 XMS_GetLinearPeriod 0F15 XMS_GetAmigaPeriod 0F36 -XMS_ProcessVolumeEffect 0FAA XMS_VFX_UNUSED 0FC4 XMS_VFX_VOLUMEf 0FC6 -XMS_VFX_VOLUMEo 0FD4 XMS_VFX_VOLSLIDEDo 0FD6 XMS_VFX_VOLSLIDEUo 0FE1 -XMS_VFX_FINEVOLDf 0FEC XMS_VFX_FINEVOLDo 0FF5 XMS_VFX_FINEVOLUf 0FF7 -XMS_VFX_FINEVOLUo 1000 XMS_VFX_VIBSPEEDf 1002 XMS_VFX_VIBSPEEDo 102C -XMS_VFX_VIBDEPTHf 1040 XMS_VFX_PANNINGf 1054 XMS_VFX_PANNINGo 1069 -XMS_VFX_PANSLIDELo 106C XMS_VFX_PANSLIDERo 1087 XMS_VFX_GLISSANDOf 10A4 -XMS_VFX_GLISSANDOo 10B0 XMS_FXP_PREVIOUS 1144 XMS_ProcessMainEffect 12D4 -XMS_FX_ARPEGGIOf 12F2 XMS_FX_ARPEGGIOo 12FD XMS_FX_PORTAUPf 134F -XMS_FX_PORTAUPo 135F XMS_FX_PORTADOWNf 1372 XMS_FX_PORTADOWNo 1383 -XMS_FX_PORTA2NOTEf 1396 XMS_FX_PORTA2NOTEo 13AB XMS_FX_VIBRATOf 142A -XMS_FX_VIBRATOo 1464 XMS_FX_PORTASLIDEf 149A XMS_FX_PORTASLIDEo 14AB -XMS_FX_VIBSLIDEf 14BD XMS_FX_VIBSLIDEo 14CE XMS_FX_TREMOLOf 14E0 -XMS_FX_TREMOLOo 1515 XMS_FX_PANf 155C XMS_FX_SAMPOFFf 156C -XMS_FX_SAMPOFFo 1575 XMS_FX_VOLUMESLIDEf 1578 XMS_FX_VOLUMESLIDEo 158B -XMS_FX_PATTERNJUMPf 15BC XMS_FX_PATTERNJUMPo 15C5 XMS_FX_SETVOLUMEf 15C8 -XMS_FX_SETVOLUMEo 15D9 XMS_FX_PATTERNBREAKf 15DE XMS_FX_SETSPEEDf 1636 -XMS_FX_SETSPEEDo 1646 XMS_FX_EXTENDEDf 1689 XMS_FX_EXTENDEDo 1695 -XMS_FX_EX_SETFILTERf 16A1 XMS_FX_EX_SETFILTERo 1738 XMS_FX_EX_FINEPORTAUPf 173B -XMS_FX_EX_FINEPORTAUPo 1755 XMS_FX_EX_FINEPORTADOWNf 1758 XMS_FX_EX_FINEPORTADOWNo 1772 -XMS_FX_EX_GLISSANDOCTRLf 1775 XMS_FX_EX_GLISSANDOCTRLo 1775 XMS_FX_EX_VIBRATOFORMf 177C -XMS_FX_EX_VIBRATOFORMo 1793 XMS_FX_EX_SETFINETUNEf 1796 XMS_FX_EX_SETFINETUNEo 1796 -XMS_FX_EX_PATTERNLOOPf 1799 XMS_FX_EX_PATTERNLOOPo 17BB XMS_FX_EX_TREMOLOFORMf 17BE -XMS_FX_EX_TREMOLOFORMo 17D5 XMS_FX_EX_SETPANNINGf 17D8 XMS_FX_EX_SETPANNINGo 17EA -XMS_FX_EX_RETRIGGERf 17ED XMS_FX_EX_RETRIGGERo 17F8 XMS_FX_EX_FINEVOLUPf 181B -XMS_FX_EX_FINEVOLUPo 1830 XMS_FX_EX_FINEVOLDOWNf 1833 XMS_FX_EX_FINEVOLDOWNo 1848 -XMS_FX_EX_NOTECUTf 184B XMS_FX_EX_NOTECUTo 1858 XMS_FX_EX_NOTEDELAYf 1871 -XMS_FX_EX_NOTEDELAYo 187E XMS_FX_EX_PATTERNDELAYf 18A4 XMS_FX_EX_PATTERNDELAYo 18B2 -XMS_FX_EX_SENDMESSAGEf 18B5 XMS_FX_EX_SENDMESSAGEo 18C9 XMS_FX_SETGLOBALVOLf 18CC -XMS_FX_SETGLOBALVOLo 18D8 XMS_FX_GLOBALVOLSLIDEf 18DB XMS_FX_GLOBALVOLSLIDEo 18EC -XMS_FX_KEYOFFf 1910 XMS_FX_KEYOFFo 191D XMS_FX_ENVELOPEPOSf 1935 -XMS_FX_ENVELOPEPOSo 193E XMS_FX_PANSLIDEf 1941 XMS_FX_PANSLIDEo 1952 -XMS_FX_RETRIGGERf 19A1 XMS_FX_RETRIGGERo 19DC XMS_FX_TREMORf 1A7F -XMS_FX_TREMORo 1A9B XMS_FX_XFINEPORTAf 1AE1 XMS_FX_XFINEPORTAo 1B0B -XMS_FX_UNUSED 12EF XMS_CHANNEL_INTERRUPT 1B0E XMS_CHANNEL_RESTORE 1B27 -XMS_CHANNEL_UPDATEDSP 1B27 XMS_CHANNEL_SETPAN 1C19 XMS_CHANNEL_SETVOLUME 1C73 -XMS_CHANNEL_PITCH_SLIDEUP 1CC2 XMS_CHANNEL_PITCH_SLIDEDOWN 1CCC XMS_CHANNEL_SETPITCH 1CD4 -XMS_CHANNEL_VOLSLIDEu 1CE1 XMS_CHANNEL_VOLSLIDEd 1CF2 XMS_PeriodClip 1D04 -XMS_PeriodClipL 1D06 XMS_PeriodClipA 1D20 XMS_CHANNEL_ENV_SETPOSITION 1D42 -XMS_CHANNEL_ENV_RESET 1D64 XMS_CHANNEL_ENV_KEYOFF 1D7F XMS_CHANNEL_ENV_ROUTINE 1DA9 -XMS_CHANNEL_ENV_READ 1EAE XMS_CHANNEL_ENVSCAN 1F4A XMS_AV_UPDATE 1F8E -XMS_GETVIBTABLE 2014 XMS_VOLUMERAMP 204F XMS_CHECKSFX 2082 -XMS_TABLE_BITS 209B byte1 0016 c_xmsoffseth 0021 -c_xmsoffset 2100 c_inst_nsamps 0000 c_inst_noise 0001 -c_inst_nvpoints 0002 c_inst_nppoints 0003 c_inst_envflags 0004 -c_inst_volsus 0005 c_inst_volloopsx 0006 c_inst_volloopsp 0007 -c_inst_volloopsv 0008 c_inst_volloopsy 0009 c_inst_volloope 000A -c_inst_pansus 000B c_inst_panloopsx 000C c_inst_panloopsp 000D -c_inst_panloopsv 000E c_inst_panloopsy 000F c_inst_panloope 0010 -c_inst_fadeout 0011 c_inst_vibtype 0013 c_inst_vibsweep 0014 -c_inst_vibdepth 0016 c_inst_vibrate 0017 c_inst_volenv 0018 -c_inst_panenv 0030 c_inst_sampmap 0048 comm_write 0000 -comm_write2 0002 comm_buffer 0004 comm_mode 0008 -channel_bit 0017 cur_inst 001A cso_period 0000 -cso_inst 0002 cso_volfx 0003 cso_fx 0004 -cso_fxparam 0005 cso_vol 0006 cso_note 0007 -cso_avsweep 0008 cso_panning 0009 cso_sample 000A -cso_counter 000B cso_portaspd 000C cso_avsine 000D -cso_sinepos 000E cso_rtdata 000F coso_pa 0008 -coso_epv 000A coso_epp 000B coso_eyv 000C -coso_eyp 000D coso_vadd 000E coso_ndelay 000F -ccflag_keyon 0001 ccflag_pitch 0002 ccflag_volume 0004 -ccflag_panning 0008 ccflag_source 0010 ccflag_offset 0020 -ccflag_volumereset 0040 comm_validate 00DC comm_samplewrite 00DD -comm_routine 0694 cmss_samploop 077F cmss_loopto0 078B -cmss_dloop 078F cmss_dloope 0796 cmss_dloopwm 07A4 -cmss_dloopwm2 07B0 cmss_next 07B7 cmss_exit 07BF -cmss_match1 07C6 cmss_match2 07D1 cmsfm_linear 0811 -cmsfm_amiga 0834 data_length 0006 dvar 00D9 -fx_return 0018 int1 000A int2 000C -int3 000E int4 0010 int6 0012 -int7 0014 noname._xmsspc_rout_notamiga 0623 noname._program_loop 062F -noname._comm_getmessage 069B noname._comm_exit 06B1 noname._cmt_begin_transfer 06B5 -noname._comm_transfer 06C4 noname._cmt_y_ret3 06DF noname._comm_transfer_finish 06E3 -noname._cmt_y_eq3 06F1 noname._ts_noloop 0747 noname._ts_hasloop 074F -noname._cmts_wl 0751 noname._cmps_findchannel 089A noname._cmps_foundchan 08A7 -noname._cmps_found0 08B6 noname._cmps_searchcomplete 08B8 noname._cmps_vl_good 08D0 -noname._cmps_vr_good 08DE noname._cmps_realexit 090F noname._cmps_exit 0912 -noname._cmsfxp_params 0919 noname._bd_convert_loop 094A noname._bd_duplicate_check 0979 -noname._bd_original 09B2 noname._bd_modified 09B2 noname._p2f_irregular 0A00 -noname._xmsp_notplaying 0AA6 noname._xmsp_ip_loop 0AB2 noname._xmss_loop 0AE5 -noname._xmscc_loop 0AF3 noname._xmscc_vloop 0AFD noname._xmscc_loop2 0B09 -noname._xms_sbpm_divprep 0B23 noname._xms_sbpm_divready 0B2D noname._xmssb_mr_good 0B45 -noname._spcst_slow 0B5A noname._spcst_inc_loop 0B5C noname._spcst_no_inc 0B65 -noname._spcst_exit 0B68 noname._xmssp_clearrep 0BA7 noname._xmsvr_1 0BBA -noname._xmsvr_2 0BC1 noname._xmsvr_3 0BC8 noname._xmsvr_4 0BCF -noname._xmsvr_5 0BD6 noname._xmsvr_6 0BDD noname._xmsvr_7 0BE4 -noname._xmsvr_8 0BEB noname._xmsp_continue 0BF7 noname._xmsp_pcontinue 0C0A -noname._xmsp_pskipr 0C0C noname._VR_return 0C0C noname._xmsp_continue2 0C18 -noname._xmsp_tick_first 0C2B noname._xmsp_no_delay 0C38 noname._xmsp_channel_loop 0C42 -noname._xmsp_repeat_norm 0C4D noname._xmsp_repeat_empty 0C5A noname._xmsp_repeate_normally 0C61 -noname._xmsp_read_normal 0C75 noname._xmsp_channel_continue 0C78 noname._xmsp_row_small 0C83 -noname._xmsp_row_large 0C85 noname._xmsp_yes_instr 0C8E noname._xmsp_no_instr 0C9A -noname._xmsp_inst_valid 0CAB noname._xmsp_no_instrument 0CB1 noname._xmsp_notecheck 0CB4 -noname._xmsp_note_NOTKEYOFF 0CC3 noname._xmsp_notecheck_exit 0CCB noname._xmsp_noter 0CCC -noname._xmsp_inst_valid2 0CDA noname._xmsp_noter_i 0CDD noname._xmsp_noteinst_finish 0CE0 -noname._xmsp_no_volume 0CED noname._xmsp_is_volume 0CF1 noname._xmsp_fx_01 0CF4 -noname._xmsp_fx_00 0CF9 noname._xmsp_fx_10 0D04 noname._xmsp_fx_11 0D10 -noname._xmsp_fx_exit 0D15 noname._xmsp_norepeat 0D22 noname._xmsp_patt_repeated 0D22 -noname._xmsp_omgdontsetnote 0D39 noname._xmsp_nonotecheckthingy 0D3C noname._xmsp_valid_instrument 0D4C -noname._xmsp_inst_samples_g1 0D62 noname._xmsp_inst_samples_e1 0D6A noname._xmsp_inst_nochange 0D75 -noname._xmsp_setpan_off 0D84 noname._xmsp_no_inst 0D98 noname._xmsp_is_inst 0D9B -noname._xmsp_no_note_entry 0DAA noname._xmsp_nd1 0DC6 noname._xmsp_nd2 0DD4 -noname._xmsp_channel_next 0DD8 noname._xmsp_channel_exit 0DE4 noname._xmsp_tick_between 0DEE -noname._xmsptb_loop 0DF6 noname._xmsp_ndo1 0E18 noname._xmsp_ndo2 0E28 -noname._xmsp_tick_notbetween 0E33 noname._xmsp_tick_norestartj1 0E3D noname._xmsp_no_delay2 0E47 -noname._xmsp_pattern_loop_no 0E68 noname._xmsp_pattjump_valid 0E7A noname._xmsp_noPjump 0E96 -noname._xmsp_tick_restart 0EA1 noname._xmsp_notendofsong 0EB0 noname._xmsp_tick_restarted 0EB7 -noname._xmsp_tick_norestart 0EBF noname._xmsgp_nc 0F22 noname._xmsgp_a_96 0F28 -noname._xmsgap_nc 0F41 noname._xmsgap_a_96 0F47 noname._xmsgap_shift 0F60 -noname._xmspve_first_tick 0FB0 noname._xmspve_other_ticks 0FBA noname._xmspve_exit 0FC4 -noname._xmsvfx_vs_entry2 1015 noname._xmsvfx_vs_exit 103D noname._xms_vfxp_nofix 1062 -noname._xmsvfxpsl_noclamp 107D noname._xmsvfxpsr_noclamp 109A noname._xmsvfx_g_exit 10C1 -noname._xmspme_first_tick 12E1 noname._xmspme_other_ticks 12E8 noname._xmspme_exit 12EF -noname._xmsfxa_0 1313 noname._xmsfxa_1 1319 noname._xmsfxa_2 1320 -noname._xmsfxa_modspace 1320 noname._xmsfxa_amiga 1341 noname._xmsfxpu_isparam 135A -noname._xmsfxpu_entry2 1361 noname._xmsfxpd_isparam 137D noname._xmsfxpd_entry2 1385 -noname._xmsfxpn_isparam 13A1 noname._xmsfxpn_entry2 13AD noname._xmsfxpn_notequal 13C5 -noname._xmsfxpn_less 13C9 noname._xmsfxpn_less_continue 13EC noname._xmsfxpn_more 13F4 -noname._xmsfxpn_more_stop 141A noname._xmsfxpn_more_continue 141C noname._xmsfxpn_edited 1422 -noname._xmsfxpn_equal 1425 noname._xmsfxv_noparam2 143B noname._xmsfxv_noparam1 1443 -noname._xmsfxv_entry2 1457 noname._xmsfxv_firstrun 145F noname._xmsfxv_getvalue 1478 -noname._xmsfxps_isparam 14A5 noname._xmsfxps_ret1 14B4 noname._xmsfxvs_isparam 14C8 -noname._xmsfxvs_ret1 14D7 noname._xmsfxt_exit 14EF noname._xmsfxt_noparam2 14FE -noname._xmsfxt_noparam1 1506 noname._xmsfxt_getvalue 1529 noname._xmsfxt_add_val 1540 -noname._xmsfxt_setvalue 1546 noname._xmsfxt_gt 1552 noname._xmsfxt_clip_good 1554 -noname._xmsfxvols_isparam 1583 noname._xmsfxvs_lo_over 15A0 noname._xmsfxvs_hiparam 15A4 -noname._xmsfxvs_hi_over 15B0 noname._xmsfxvs_finish 15B2 noname._xmsfxsv_lt_64 15D2 -noname._xmsfx_pb_notzero 15F4 noname._xmsfx_pb_startsearch 15FC noname._xmsfx_pb_search 1604 -noname._xmsfx_pb_instant 1608 noname._xmsfx_pb_fexit 1623 noname._xmsfx_pb_next 1630 -noname._xmsfx_pb_match 1636 noname._xmsfxss_bpm 1643 noname._xmsfxxsf_on 16B2 -noname._xmsfxxsf_off 16BA noname._xmsfxxsf_set 16C7 noname._xmsfxxsf_set_loop 1701 -noname._xmsfxxsf_notamiga 1724 noname._xmsfxxfpu_isparam 1748 noname._xmsfxxfpd_isparam 1765 -noname._xmsfxxpl_hasloop 17AA noname._xmsfxxpl_gotloop 17AE noname._xmsfxxpl_set 17B4 -noname._xmsfxxr_skip 1801 noname._xmsfxxr_wait 180F noname._xmsfxxr_exit 1818 -noname._xmsfxxfvu_isparam 1828 noname._xmsfxxfvd_isparam 1840 noname._xmsfxxnc_cut_imm 1865 -noname._xmsfxxnd_wait 189A noname._xmsfxxnd_exit 18A1 noname._xmsfxsgv_vol_good 18D6 -noname._xmsfxgvs_isparam 18E6 noname._xmsfxgvs_down 1902 noname._xmsfxgvs_finish 190B -noname._xmsfxko_imm 192A noname._xmsfxpans_isparam 194C noname._xmsfxps_lo_over 1967 -noname._xmsfxps_hiparam 196B noname._xmsfxps_hi_over 1977 noname._xmsfxps_finish 1979 -noname._xmsfxr_noparam2 19B2 noname._xmsfxr_noparam1 19BA noname._xmsfxr_no_retrig_NOT 19E8 -noname._xmsfxr_0 1A05 noname._xmsfxr_1 1A08 noname._xmsfxr_1_loop 1A10 -noname._xmsfxr_1_exit 1A15 noname._xmsfxr_1_pl 1A1F noname._xmsfxr_6 1A23 -noname._xmsfxr_7 1A2B noname._xmsfxr_8 1A30 noname._xmsfxr_9 1A34 -noname._xmsfxr_9_loop 1A3E noname._xmsfxr_9_exit 1A43 noname._xmsfxr_E 1A4C -noname._xmsfxr_F 1A56 noname._xmsfxr_setvol 1A59 noname._xmsfxr_volclip 1A61 -noname._xmsfxr_no_retrig 1A6B noname._xmsfxr_no_ramp 1A72 noname._xmsfxr_exit 1A7C -noname._xmsfxtr_first 1A89 noname._xmsfxtr_exit 1A98 noname._xmsfxtr_off 1AA9 -noname._xmsfxtr_on 1AC1 noname._xmsfxtr_next 1AD9 noname._xmsfxxfp_isparam 1AF1 -noname._xmsfxefp_up 1B03 noname._xcu_ok 1B33 noname._xcu_ok2 1B48 -noname._xmscu_nostarting 1B55 noname._xmscu_nosource 1B5F noname._xmscu_nopitchN 1B65 -noname._xmscu_vadd 1B7C noname._xmscu_vsub 1B83 noname._xmscu_novib 1B91 -noname._xmscu_isvib 1B95 noname._xmscu_noisepitch 1BBB noname._xmscu_nopitch 1BE5 -noname._xmscu_nooffset 1C12 noname._xmscev_plus1 1C23 noname._xmscev_eminus 1C32 -noname._xmscev_eplus 1C45 noname._xmscev_setvol 1C50 noname._xmscu_nopan 1C5E -noname._xmscu_nostart 1C6F noname._xmscu_zvol_set 1C8A noname._xmscu_isvolume 1C96 -noname._xmscu_zvolume 1C9D noname._xmscu_rvolume 1CA7 noname._xmscu_novolume 1CB0 -noname._xmscu_nooffset2 1CBE noname._xmscvsu_good 1CEA noname._xmscvsd_good 1CFC -noname._pc_pge_1600 1D0E noname._pc_p_good 1D1A noname._pc_plt_1600 1D1B -noname._pca_pge_1600 1D2E noname._pca_p_good 1D3C noname._pca_plt_1600 1D3D -noname._xms_channel_env_dis 1D88 noname._xmscev_envelope_dis 1D9C noname._xmscev_readvol 1DD8 -noname._xmscev_vol_nosustain 1E01 noname._xmscev_vol_inc 1E04 noname._xmscev_quickvol 1E0A -noname._xmscev_skipvol 1E14 noname._xmscev_fadeout_isover 1E2E noname._xmscev_fadeout_noOver 1E39 -noname._xmscev_nofadeout 1E40 noname._xmscev_pan_enabled 1E4F noname._xmscer_readpan 1E71 -noname._xmscev_pan_nosustain 1E9A noname._xmscev_pan_inc 1E9D noname._xmscev_quickpan 1EA3 -noname._xmscev_skippan 1EAD noname._xmscer_zero 1EBB noname._xmscer_volumel 1EBE -noname._xmscer_panningl 1EDF noname._xmscer_noloop 1F00 noname._xmscer_panning3 1F13 -noname._xmscer_volume3 1F16 noname._xmscer_cxnot0 1F1E noname._xmscer_ineg 1F2C -noname._xmscer_iplus 1F3A noname._xmscer_exit 1F45 noname._xmscev_start 1F4A -noname._xmscev_l6 1F50 noname._xmscev_g3 1F62 noname._xmscev_g6 1F6F -noname._xmscev_g9 1F81 noname._xmscev_ret 1F8D noname._xmsavu_nosweep 1FA0 -noname._xmsavu_noover 1FA2 noname._xmsavu_skip_sweep 1FA4 noname._xmsfxv_fullav 1FC2 -noname._xmsfxv_hasavd 1FC4 noname._xmsav_0fix 1FD9 noname._xmsav_set_neg 1FDF -noname._xmsav_set_pos 1FE9 noname._xmsav_exit 1FEC noname._xmsgvt_T0 2020 -noname._xmsgvt_T1 202E noname._xmsgvt_T2 2036 noname._xmsgvt_rd_hack 203B -noname._xmsgvt_rd_128 2041 noname._xmsgvt_T3 2045 noname._xms_vrok 2054 -noname._xms_vrloop 2059 noname._xms_vrless 2064 noname._xms_vrgreat 206F -noname._xms_vrbreak 2079 noname._xms_vrnone 207A noname._xms_vrnoneC 207B -noname._xmsfxc_loop 2087 noname._xmsfxc_zero 2097 plimitl_lo 0640 -plimitl_hi 1E30 plimita_lo 0070 plimita_hi 1FFE -ramp_size 000A row_flags 009F rdv_loop 0A8E -samp_playing 00DE samp_dirty 00E6 samp_usage 00E7 -samp_play_next 00E8 spx_main 0600 table_veffect_first 0F6A -table_veffect_other 0F8A table_effect_first 1244 table_effect_other 128C -table_effect_ex_first 1649 table_effect_ex_other 1669 table_vib_conv 1778 -table_xms_retrig_jumps 1981 table_mod_sine 1FF4 xmso_flen 0000 -xmso_len 0002 xmso_chn 0003 xmso_ins 0004 -xmso_smp 0005 xmso_pat 0006 xmso_spd 0007 -xmso_bpm 0008 xmso_foff 000A xmso_pn 000D -xmso_freqmode 0009 xmso_restart 000C xmso_orders 001E -xmso_patto 0016 xmso_insto 0018 xmso_sampo 001A -xmso_loopo 001C xms_channels 001C xms_tremor_flags 009C -xms_fxfirst 009D xms_cc_flags 009E xms_cc_period 00A1 -xms_cc_perioda 00A3 xms_cc_volume 00A5 xms_cc_panning 00A6 -xms_cc_source 00A7 xms_cc_sampoff 00A8 xms_samp_head 00A9 -xsh_vol 0000 xsh_ft 0001 xsh_pan 0003 -xsh_note 0004 xms_volume 00AE xms_speed 00AF -xms_bpm 00B0 xms_position 00B1 xms_row 00B2 -xms_tick 00B3 xms_pattern_length 00B4 xms_playing 00B5 -xms_pattern_read 00B6 xms_pattern_plus 00B8 xms_pattern_repeat 00B9 -xms_patt_delay 00C1 xms_patt_jump 00C2 xms_patt_jump_enable 00C4 -xms_patt_jump_offset 00C5 xms_global_vol 00C7 xms_patt_loop_pos 00C8 -xms_patt_loop 00CA xms_patt_loop_row 00CB xms_peek 00CC -xms_clock 00CD xms_clock_ticks 00CE xms_pclock 00CF -xms_pclock_ticks 00D0 xms_final_volume 00D1 xms_last_message 00DB -xms_channels_other 10C4 xmsfxgvs_isparam 18E9 - -tasm: Number of errors = 0