Dead Hackers Society
Other BBSes »
 
 
Demoscene  Coding  CT60  Buy/sell

Atari coding BBS
 
Re: Lance's 50 KHz playroutine
Posted by: ljbk Mar,01.2013-17:34 

i !

Here is the code change proposal.

Don't blame me if it does not work as i have not tried it. It should be pretty close to work if it does not.
Different assemblers may like or not the way i commented the code. Please have this in mind if you get a bunch of errors while assembling this.
Time for you to test it if you are interested.

The full text will be sent to Evil to be available for download if he thinks it is usefull to anyone.

Enjoy it,
Paulo.


; 5 Solution proposal to go down to 25 KHz (changes only)
; -------------------------------------------------------
;
; mt_frequency dc.w $0002 25 KHz replay
; mt_freqer_list ds.w 23*20
; mt_replay_buf0 ds.w 500
; mt_replay_buf1 ds.w 500
; mt_frame_freq ds.w 13775 also for the 50 KHz case instead of 27500
; mt_mix_chunk ds.w 60877 may have to be adapted for 25 KHz
;
; Now mt_make_freq
;
;

mt_make_freq
move.l mt_freq_list,a0
moveq #3,d0
.mt_maker
move.l d0,d1

moveq #0,d2 25 KHz => only 20 updates
cmp #20,d1 so result can be > 1
bcs.s freq_lab1
sub #20,d1
moveq #1,d2 store integer part in D2.l
freq_lab1
swap d2

swap d1

* divu.w #40,d1
divu #20,d1 25 KHz => only 20 updates

move.w d1,d2
swap d1

* cmp.w #20,d1
cmp.w #10,d1 25 KHz => only 20 updates

blt.s .mt_no_round
addq.w #1,d2
.mt_no_round
moveq #0,d1
moveq #0,d3
moveq #0,d4
moveq #0,d5

* moveq #39,d7
moveq #20-1,d7 25 KHz => only 20 updates

.mt_make_freq
add.w d2,d1
negx.w d4
neg.w d4
move.w d4,d5
move.w d1,d6
add.w d6,d6
negx.w d5
neg.w d5

swap d2 25 KHz => add integer part
add d2,d5 of division result to D5
swap d2

cmp.w d3,d5
ble.s .mt_set_zero

* move.w d5,d3
* moveq #1,d5
move d5,d6 save new value
sub d3,d5 difference: 1 or 2
move d6,d3 keep new old value

move.w d5,(a0)+
dbra d7,.mt_make_freq
addq.w #1,d0
cmp.w #26,d0
bne.s .mt_maker
rts

.mt_set_zero
moveq #0,d5
move.w d5,(a0)+
dbra d7,.mt_make_freq
addq.w #1,d0
cmp.w #26,d0
bne.s .mt_maker
rts

;
; And now mt_make_mixcode
;
;

mt_make_mixcode
move.l mt_mixcode_p,a0
move.l mt_mixer_chunk,a1
move.l mt_freq_list,a2
lea (a2),a4
moveq #22,d7
moveq #22,d6
.mt_maker
move.l a1,(a0)+
lea (a2),a3

* moveq #40-1,d5
moveq #20-1,d5 25 KHz => only 20 updates

.mt_make_it
move.w .mt_copy,(a1)+
move.w (a3)+,d0
move.w (a4)+,d1

* add.w d1,d1
add.w d1,d1
add.w d1,d1 2 bits instead of 1 to handle 0, 1 and 2

or.w d1,d0

dbne d5,.mt_make_it
tst.w d5
beq.s .mt_end_ops
bpl.s .mt_no_exit
.mt_make_end
move.w #$4ed6,(a1)+
dbra d6,.mt_maker
moveq #22,d6

* lea 80(a2),a2
lea 40(a2),a2 new table size

move.l mt_freq_list,a4
dbra d7,.mt_maker
rts
.mt_no_exit
move.l a3,-(sp)
move.l a4,-(sp)
move.w d5,d4
subq.w #1,d4
.mt_analyse
move.w (a3)+,d1
move.w (a4)+,d2

* add.w d2,d2
add.w d2,d2
add.w d2,d2 2 bits instead of 1 to handle 0, 1 and 2

or.w d2,d1
add.w d1,d1
add.w d1,d1
move.l .mt_ana_code(pc,d1.w),a6
jsr (a6)
dbra d4,.mt_analyse
move.l (sp)+,a4
move.l (sp)+,a3
tst.w d1
dbeq d5,.mt_make_it
bra.s .mt_end_ops
.mt_ana_code
dc.l .mt_ana_code0 0 and 0
dc.l .mt_ana_code1 0 and 1
dc.l .mt_ana_code0_2 0 and 2
dc.l .mt_ana_code0 not possible
dc.l .mt_ana_code2 1 and 0
dc.l .mt_ana_code3 1 and 1
dc.l .mt_ana_code1_2 1 and 2
dc.l .mt_ana_code0 not possible
dc.l .mt_ana_code2_0 2 and 0
dc.l .mt_ana_code2_1 2 and 1
dc.l .mt_ana_code2_2 2 and 2
dc.l .mt_ana_code0 not possible
dc.l .mt_ana_code0 not possible
dc.l .mt_ana_code0 not possible
dc.l .mt_ana_code0 not possible
dc.l .mt_ana_code0 not possible

.mt_end_ops

* cmp.w #3,d0
* beq.s .mt_ana_code03
* cmp.w #2,d0
* beq.s .mt_ana_code02
cmp.w #%1010,d0 2 2
beq.s .mt_ana_code02_2
cmp.w #%1001,d0 2 1
beq.s .mt_ana_code02_1
cmp.w #%1000,d0 2 0
beq.s .mt_ana_code02_0
cmp.w #%0110,d0 1 2
beq.s .mt_ana_code01_2
cmp.w #%0101,d0 1 1
beq.s .mt_ana_code03
cmp.w #%0100,d0 1 0
beq.s .mt_ana_code02
cmp.w #%0010,d0 0 2
beq.s .mt_ana_code00_2

.mt_ana_code01
lea .mt_copy,a6
move.w .mt_copy2,(a6)
move.w .mt_ch0_fetch,(a1)+
move.l .mt_add012,(a1)+
dbra d5,.mt_make_it
move.w #$4ed6,(a1)+
dbra d6,.mt_maker
moveq #22,d6

* lea 80(a2),a2
lea 40(a2),a2 new table size

move.l mt_freq_list,a4
dbra d7,.mt_maker
rts

.mt_ana_code00_2
lea .mt_copy,a6
move.w .mt_copy2,(a6)

move .mt_addq0,(a1)+

move.w .mt_ch0_fetch,(a1)+
move.l .mt_add012,(a1)+
dbra d5,.mt_make_it
move.w #$4ed6,(a1)+
dbra d6,.mt_maker
moveq #22,d6

* lea 80(a2),a2
lea 40(a2),a2 new table size

move.l mt_freq_list,a4
dbra d7,.mt_maker
rts

.mt_ana_code02
lea .mt_copy,a6
move.w .mt_copy2,(a6)
move.w .mt_ch1_fetch,(a1)+
move.l .mt_ch1_fetch+2,(a1)+
move.l .mt_add012,(a1)+
dbra d5,.mt_make_it
move.w #$4ed6,(a1)+
dbra d6,.mt_maker
moveq #22,d6

* lea 80(a2),a2
lea 40(a2),a2 new table size

move.l mt_freq_list,a4
dbra d7,.mt_maker
rts

.mt_ana_code02_0
lea .mt_copy,a6
move.w .mt_copy2,(a6)

move .mt_addq1,(a1)+

move.w .mt_ch1_fetch,(a1)+
move.l .mt_ch1_fetch+2,(a1)+
move.l .mt_add012,(a1)+
dbra d5,.mt_make_it
move.w #$4ed6,(a1)+
dbra d6,.mt_maker
moveq #22,d6

* lea 80(a2),a2
lea 40(a2),a2 new table size

move.l mt_freq_list,a4
dbra d7,.mt_maker
rts

.mt_ana_code03
lea .mt_copy,a6
move.w .mt_copy2,(a6)
move.l .mt_ch01fetadd1,(a1)+
move.l .mt_ch01fetadd1+4,(a1)+
move.l .mt_add012,(a1)+
dbra d5,.mt_make_it
move.w #$4ed6,(a1)+
dbra d6,.mt_maker
moveq #22,d6

* lea 80(a2),a2
lea 40(a2),a2 new table size

move.l mt_freq_list,a4
dbra d7,.mt_maker
rts

.mt_ana_code01_2
lea .mt_copy,a6
move.w .mt_copy2,(a6)

move .mt_addq0,(a1)+

move.l .mt_ch01fetadd1,(a1)+
move.l .mt_ch01fetadd1+4,(a1)+
move.l .mt_add012,(a1)+
dbra d5,.mt_make_it
move.w #$4ed6,(a1)+
dbra d6,.mt_maker
moveq #22,d6

* lea 80(a2),a2
lea 40(a2),a2 new table size

move.l mt_freq_list,a4
dbra d7,.mt_maker
rts

.mt_ana_code02_1
lea .mt_copy,a6
move.w .mt_copy2,(a6)

move .mt_addq1,(a1)+

move.l .mt_ch01fetadd1,(a1)+
move.l .mt_ch01fetadd1+4,(a1)+
move.l .mt_add012,(a1)+
dbra d5,.mt_make_it
move.w #$4ed6,(a1)+
dbra d6,.mt_maker
moveq #22,d6

* lea 80(a2),a2
lea 40(a2),a2 new table size

move.l mt_freq_list,a4
dbra d7,.mt_maker
rts

.mt_ana_code02_2
lea .mt_copy,a6
move.w .mt_copy2,(a6)

move .mt_addq0,(a1)+
move .mt_addq1,(a1)+

move.l .mt_ch01fetadd1,(a1)+
move.l .mt_ch01fetadd1+4,(a1)+
move.l .mt_add012,(a1)+
dbra d5,.mt_make_it
move.w #$4ed6,(a1)+
dbra d6,.mt_maker
moveq #22,d6

* lea 80(a2),a2
lea 40(a2),a2 new table size

move.l mt_freq_list,a4
dbra d7,.mt_maker
rts

.mt_ana_code0 rts


.mt_ana_code1
* cmp.w #3,d0
* beq.s .mt_ana_code13
* cmp.w #2,d0
* beq.s .mt_ana_code12
cmp.w #%1010,d0 2 2
beq.s .mt_ana_code12_2
cmp.w #%1001,d0 2 1
beq.s .mt_ana_code12_1
cmp.w #%1000,d0 2 0
beq.s .mt_ana_code12_0
cmp.w #%0110,d0 1 2
beq.s .mt_ana_code11_2
cmp.w #%0101,d0 1 1
beq.s .mt_ana_code13
cmp.w #%0100,d0 1 0
beq.s .mt_ana_code12
cmp.w #%0010,d0 0 2
beq.s .mt_ana_code10_2

.mt_ana_code11
moveq #0,d4
moveq #1,d1
lea .mt_copy,a6
move.w .mt_copy0,(a6)
move.w .mt_ch0_fetch,(a1)+
move.w .mt_add10,(a1)+
rts

.mt_ana_code10_2
moveq #0,d4
moveq #1,d1
lea .mt_copy,a6
move.w .mt_copy0,(a6)

move .mt_addq0,(a1)+

move.w .mt_ch0_fetch,(a1)+
move.w .mt_add10,(a1)+
rts

.mt_ana_code12
moveq #0,d4
moveq #1,d1
lea .mt_copy,a6
move.w .mt_copy0,(a6)
move.w .mt_ch1_fetch,(a1)+
move.l .mt_ch1_fetch+2,(a1)+
move.w .mt_add10,(a1)+
rts

.mt_ana_code12_0
moveq #0,d4
moveq #1,d1
lea .mt_copy,a6
mo[...]







[All messages in this thread]    [Start new thread]

Topic Posted by  Date 
Lance's 50khz playroutine Bod/STAX Feb,18.2013-17:35
  Re: Lance's 50khz playroutine gwEm Feb,18.2013-20:42
  Re: Lance's 50khz playroutine ggn Feb,18.2013-20:53
    Re: Lance's 50khz playroutine Bod/STAX Feb,18.2013-21:28
      Re: Lance's 50khz playroutine gwEm Feb,18.2013-23:05
        Re: Lance's 50khz playroutine gwEm Feb,18.2013-23:16
          Re: Lance's 50khz playroutine gwEm Feb,19.2013-02:21
            Re: Lance's 50khz playroutine Bod/STAX Feb,22.2013-17:08
              Re: Lance's 50khz playroutine gwEm Feb,25.2013-20:36
                Re: Lance's 50khz playroutine ljbk Feb,25.2013-23:54
                  Re: Lance's 50khz playroutine Bod/STAX Feb,26.2013-11:23
                    Re: Lance's 50khz playroutine evil Feb,26.2013-12:04
                      Re: Lance's 50khz playroutine ljbk Feb,26.2013-14:45
                        Re: Lance's 50khz playroutine ljbk Feb,26.2013-21:46
                          Re: Lance's 50khz playroutine evil Feb,27.2013-17:01
                            Re: Lance's 50khz playroutine ljbk Feb,28.2013-13:24
                              Re: Lance's 50khz playroutine ljbk Feb,28.2013-13:28
                                Re: Lance's 50khz playroutine gwEm Feb,28.2013-14:07
                                  Re: Lance's 50khz playroutine Bod/STAX Feb,28.2013-21:41
                                    Re: Lance's 50khz playroutine ljbk Feb,28.2013-22:42
                                      Sem assunto ljbk Mar,01.2013-13:27
                                        Lance's 50 KHz playroutine ljbk Mar,01.2013-15:49
                                          Re: Lance's 50 KHz playroutine ljbk Mar,01.2013-17:34
                                            Re: Lance's 50 KHz playroutine ljbk Mar,01.2013-17:36
                                              Re: Lance's 50 KHz playroutine evil Mar,01.2013-19:03
                                                Re: Lance's 50 KHz playroutine ljbk Mar,02.2013-00:18
                                                  Re: Lance's 50 KHz playroutine ljbk Mar,04.2013-17:39
                                                    Re: Lance's 50 KHz playroutine ljbk Mar,06.2013-02:21
                                                      Re: Lance's 50 KHz playroutine gwEm Mar,06.2013-13:23
                                                        Re: Lance's 50 KHz playroutine ljbk Mar,06.2013-15:57
                                                          Re: Lance's 50 KHz playroutine evil Mar,06.2013-16:48
                                                            Re: Lance's 50 KHz playroutine ggn Mar,06.2013-17:31
                                                              Re: Lance's 50 KHz playroutine evil Mar,06.2013-17:48
                                                                Re: Lance's 50 KHz playroutine ggn Mar,06.2013-23:54
                                                            Re: Lance's 50 KHz playroutine ljbk Mar,06.2013-18:18
                                                              Re: Lance's 50 KHz playroutine ljbk Mar,06.2013-21:51
                                                              Re: Lance's 50 KHz playroutine ggn Mar,06.2013-23:59
                                                                Re: Lance's 50 KHz playroutine ljbk Mar,07.2013-02:31
                                                                  Re: Lance's 50 KHz playroutine ggn Mar,07.2013-12:34
                                                                    Re: Lance's 50 KHz playroutine ljbk Mar,07.2013-14:00
                                                                      Re: Lance's 50 KHz playroutine gwEm Mar,07.2013-18:00
                                                                        Re: Lance's 50 KHz playroutine ljbk Mar,07.2013-18:51
                                                                          Re: Lance's 50 KHz playroutine ljbk Mar,08.2013-02:10
                                                                            Re: Lance's 50 KHz playroutine ljbk Mar,08.2013-13:12
                                                                              Re: Lance's 50 KHz playroutine ljbk Mar,09.2013-00:17
                                                            Re: Lance's 50 KHz playroutine ljbk Mar,06.2013-19:28
                              Re: Lance's 50khz playroutine ljbk Feb,28.2013-15:47
                                Re: Lance's 50khz playroutine ljbk Feb,28.2013-15:51
                                  Re: Lance's 50khz playroutine ljbk Feb,28.2013-18:56
                                    Re: Lance's 50khz playroutine nativ Mar,24.2013-00:07
                                      Re: Lance's 50khz playroutine ljbk Apr,13.2013-01:21
                                        Re: Lance's 50khz playroutine ljbk Apr,16.2013-16:12
                                          Re: Lance's 50khz playroutine ljbk Apr,19.2013-12:14
                                            Re: Lance's 50khz playroutine ljbk Apr,22.2013-14:54
                                              Re: Lance's 50khz playroutine ljbk Apr,25.2013-19:03
                                                Re: Lance's 50khz playroutine ggn Apr,25.2013-21:03
                                                  Re: Lance's 50khz playroutine ljbk Apr,26.2013-09:18
                                                    Re: Lance's 50khz playroutine ggn Apr,26.2013-11:28
                                                      Re: Lance's 50khz playroutine ljbk Apr,26.2013-12:13
  Re: Lance's 50khz playroutine ljbk May,01.2013-22:30
    Re: Lance's 50khz playroutine evil May,02.2013-14:46
      Re: Lance's 50khz playroutine gwEm May,02.2013-20:00
        Re: Lance's 50khz playroutine Damo May,02.2013-21:00
          Re: Lance's 50khz playroutine evil May,03.2013-13:00
      Re: Lance's 50khz playroutine ljbk May,08.2013-17:50
        Re: Lance's 50khz playroutine Cyprian May,10.2013-13:01
          Re: Lance's 50khz playroutine ljbk May,11.2013-00:22
          Re: Lance's 50khz playroutine ljbk May,11.2013-08:54
            Re: Lance's 50khz playroutine Cyprian May,11.2013-15:18
              Re: Lance's 50khz playroutine ljbk May,11.2013-15:35
                Re: Lance's 50khz playroutine Lance May,23.2013-00:02
                  Re: Lance's 50khz playroutine ljbk May,23.2013-14:44
  Re: Lance's 50khz playroutine Bod/STAX Jun,06.2013-20:32
    Re: Lance's 50khz playroutine Bod/STAX Jun,06.2013-20:39
      Re: Lance's 50khz playroutine ljbk Jun,07.2013-00:09
        Re: Lance's 50khz playroutine Bod/STAX Jun,07.2013-18:38
          Re: Lance's 50khz playroutine ljbk Jun,07.2013-21:46


Reply to this message
Name:
Topic:
Anti-troll code:

Message:

What's the anti-troll code?
That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
© 1994-2024 Dead Hackers Society Contact: Anders Eriksson