Jump to content
IGNORED

POKEY MSX+DIGI while loading...


Heaven/TQA

Recommended Posts

I stumped over our Taquart disc mag "Energy zine #1" which uses custom SIO loader... but interesting that it uses 2 sound channels (ok...nothing special...) combined with digi-beat while loading from disc...

 

the issue here is that the sources and tools are available since 1995 but how many productions (demos/games) use such a loader? i do not know another...

 

in other scene people are pushing each other to next level and (re)use techniques... but in Atari scene some some are left over...

 

check it out:

 

http://ftp.pigwa.net/stuff/mirror/ftp.taqu...gy/energy1a.dcm

 

you can boot the .DCM in Atari800win...

 

btw... it's just side 1 of 4...but should give you an idea...

 

on Jaskier's side you find the source code for the sid-loader if you are interested... http://jaskier.atari8.info/#

 

ps. press 1-9 in the main menu to hear some of the best pokey tunes made in MPT... i guess i can recongnise which are made by Xray... ;)

Edited by Heaven/TQA
Link to comment
Share on other sites

Checked it on the emulator - it's kinda hard to get an idea of when stuff's loading (even with the visual indicators).

 

Not many games used sound during loads - Alternate Reality/Dungeon, 7 Cities of Gold, and some of the Lucasfilm games are few which come to mind.

 

I'm thinking of doing a project with a custom SIO loader, just to explore the possibilities.

I don't know if it's been done, but with the standard I/O rate, you should be able to play 2-bit sound samples in realtime while they load, and not get underrun problems.

 

Of course, the other (more exciting) prospect is that with a more efficient SIO, to be able to have lots of onscreen DLI action for better loading screens.

Link to comment
Share on other sites

hmmm, sounds interesting.

 

I took a look, but it looks like there are even TWO digi-voices running simultaneously while loading.

 

I still need to find out how a loader can play music (& eventually some gfx effects)

 

Reminds me of "total daze" loader (from TIGHT). This is though not loader with digi-tune, but it is using 3 voices. I still wonder how to reproduce such an effect.

 

You say there's a source. Where can I find it?

Link to comment
Share on other sites

Pretty sure both AR's do - been years since I've played it on the real machine.

 

Another thought - read the SIO input bit directly, although the timing headaches would probably outweigh the benefits of gaining a voice or two. And you have to "output" even when you're doing input.

Link to comment
Share on other sites

The funny thing....

 

Almost all A8 Games could take usage of some "background" digitized music , while playing a game.

 

What do you guys think, how much cpu (percentage) a game like "Warhawk" actually uses?

 

Possibly 20-30%.

 

How much does it use of the A8's memory?

 

Possibly 20-30%

 

 

as almost 90% of the A8 games do...

 

 

This results in 70% in CPU and memory for a player routine in the background... playing some instruments...

 

And together with Hardsynth programming you would have a "new" machine then...

 

 

I bet... the PAL version of Rescue on Fractalus also could have used digi sounds without getting slower.

Edited by emkay
Link to comment
Share on other sites

Emkay... you are really bet that Fractalus has free CPU time??? come on... Carpenter & Co. squeezed out everything they could. What I could imagine would be using the OS-RAM for samples f.e. when Alien is hitting the door or screams when hitting the front window. but not while flying...

Link to comment
Share on other sites

My theory on RoF would be that it probably works like modern FPS games, ie - do the game mechanics and physics in real-time. Then, the rendering engine works seperately, displaying new frames at whatever rate it happens to be capable of, given the amount of scenery and objects to be displayed.

 

You can easily tell such games as the movement takes place in big graduated steps when things get busy, but is quick and along smaller steps when the rendering is easy.

Link to comment
Share on other sites

Emkay... you are really bet that Fractalus has free CPU time??? come on... Carpenter & Co. squeezed out everything they could. What I could imagine would be using the OS-RAM for samples f.e. when Alien is hitting the door or screams when hitting the front window. but not while flying...

 

Heaven. You might have forgotten 2 facts:

 

1) the PAL version is slower due to the lower refresh speed

2) on PAL machines you have more cycles per frame available

Link to comment
Share on other sites

Hard's Joyride, Overmind by Slight and Tight's Total Daze are the only demos i can remember having msx and or gfx effects while loading...

 

Games Eidolon... Seven Cities of Gold (streaming the map) but does AR really have msx while loading???

 

It comes even better... It's not even that "Eidolon" plays music while loading. It rather "loads while playing music". The funny part is that the Lucasarts

loader is completely interrupt driven. You fire it off, and it does the complete disk I/O in background.

 

So long,

 

Thomas

Link to comment
Share on other sites

but one thing still not discussed...

 

while in C64 scene a lot of games & demos have custom track loaders and on Atari not...

 

this was maybe because the standard c64-1541 os i/o was so unacceptable slow that it was more obvious (auf der hand) to write custom code.

 

grtx,

\twh

Link to comment
Share on other sites

With the C-64, it became par for the course for software producers to have custom tape and disk I/O. I think I even have the Novaload tape mastering system here somewhere on floppy.

 

Also, the C-64 has the "advantage" that the sound hardware isn't involved in disk/tape I/O, so you're free to do what you want with it.

 

Finally, the C-64 (as I saw it) was the first system where groups/crackers bothered to do fancy intros and/or loading screens, where with the Atari stuff it was either nothing or just some brief text.

Link to comment
Share on other sites

can someone help me understand the following source and to rewrite the sio-loader plus digi drums? i get interested in this miracle... ;) as i am now into c64 coding there are IRQs all the time... ;) so I want to solve this last Atari thing ;)

 

Rybags and me?

 

*--------*
* Player *
*--------*

opt 5+32
org $a00

bufor equ $980

*--- strona 0

addr   equ $00 ,$01
word   equ $02 ,$03
audzer equ $04 ,$05 ,$06 ,$07
licslp equ $08 ,$09 ,$0a ,$0b
lensmp equ $0c
lsbmsb equ $0d
adrs1  equ $0e ,$0f
adrs2  equ $10 ,$11
adrsmp equ $12 ,$13

typ    equ $14
dcb    equ $14 ,$15 ,$16 ,$17
cksum  equ $18
xdone  equ $19
lindex equ $1a
stcnt  equ $1b
adr    equ $1c ,$1d
end    equ $1e ,$1f
wsk    equ $20
gdzie  equ $21

*--- program

jmp init

play lda czygrc
bne *+3
rts
lda #0
sta oraaud
inc licz
lda pozptr
cmp maxptr
bcc r1
dec zegar
beq p1
jmp r5
p1 ldx #0
stx pozptr
p2 lda #0
sta ptrwsk,x
sta licspc,x
lda adrtrl,x
sta addr
lda adrtrh,x
sta addr+1
ldy pozsng
p3 lda (addr),y
iny
cmp #$ff
beq p5
cmp #$fe
bne p6
p4 jmp inic2
p5 lda (addr),y
bmi p4
asl @
tay
sty pozsng
jmp p3
p6 sta numptr,x
lda (addr),y
sta poddzw,x
p7 inx
cpx #4
bne p2
iny
sty pozsng
jmp r5
r1 dec zegar
bpl r5
lda tempo
sta zegar
ldx #3
r2 dec licspc,x
bpl r4
lda numptr,x
asl @
tay
aptrlz lda $ffff,y
sta addr
iny
aptrhz lda $ffff,y
sta addr+1
ora addr
beq r4
lda ptrwsk,x
sta licptr
jsr newdzw
ldy licptr
iny
tya
sta ptrwsk,x
lda ilespc,x
sta licspc,x
cpx #2
bne r4
lda adcvol,x
eor #$f
asl @
asl @
asl @
asl @
adc <volstb
sta volsmp+1
lda >volstb
adc #0
sta volsmp+2
r4 dex
bpl r2
inc pozptr
r5 ldx #1
lda typsmp
cmp #2
beq r6
ldx #3
r6 lda typsmp
cmp #2
bne r7
cpx kansmp
beq r8
r7 jmp dzwiek
r8 lda audzer,x
and filtry,x
beq r9
ldy #$28
lda (addr),y
clc
adc numdzw,x
jsr czest
sec
adc p1pom,x
sta freq+2,x
r9 dex
bpl r6
jump jmp *+3
lda #3
sta $d20f
lda audzer+1
and #$10
beq w1
ldy numdzw+1
lda bsfrql,y
sta freq
lda bsfrqh,y
sta freq+1
w1 lda freq
sta $d200
lda freq+1
sta $d202
lda freq+2
sta $d204
lda freq+3
sta $d206
lda volume
ldx #$ff
ldy typsmp
cpy #1
bne w2
ldx kansmp
beq w3
w2 sta $d201
w3 lda volume+1
cpx #1
beq w4
sta $d203
w4 cpy #2
beq w6
lda volume+2
cpx #2
beq w5
sta $d205
w5 lda volume+3
cpx #3
beq w6
sta $d207
w6 lda audzer
ora audzer+1
ora audzer+2
ora audzer+3
ora oraaud
sta $d208
rts
filtry dta b(4),b(2),b(0),b(0)

jamp lda freq
sta $d200
lda freq+1
sta $d202
lda volume
sta $d201
lda volume+1
sta $d203
ldx #1
cpx $d40b
bcs *-3
rts

dzwiek lda adrinl,x
sta addr
lda adrinh,x
sta addr+1
ora addr
bne d0
sta volume,x
sta audzer,x
jmp r9
d0 ldy licslp,x
cpy #$20
beq d3
lda (addr),y
sec
sbc adcvol,x
bit sprvol
beq d1
and #$f0
d1 sta volume,x
iny
lda (addr),y
sta przech
iny
sty licslp,x
and #7
beq d4
tay
lda akcadl-1,y
sta akjmpz+1
lda akcadh-1,y
sta akjmpz+2
lda przech
lsr @
lsr @
lsr @
lsr @
lsr @
ora #$28
tay
lda (addr),y
clc
akjmpz jsr $ffff
d2 lda #0
sta audzer,x
jmp r9
d3 lda p3max,x
beq d4
dec p3lic,x
bne d4
sta p3lic,x
lda volume,x
and #15
beq d4
dec volume,x
d4 ldy #$23
lda (addr),y
sta audzer,x
lda trnlic,x
clc
adc #$25
tay
and #3
sta trnlic,x
dey
lda (addr),y
adc adcdzw,x
sta numdzw,x
jsr czest+2
sta freq,x
lda p2lic,x
beq d5
dec p2lic,x
jmp r8
d5 lda branch,x
sta p1jmpz+1
p1jmpz bpl *
jmp typ0dz
brk
jmp typ1dz
brk
jmp typ2dz
brk
jmp typ3dz
czygrc dta b(0)
jmp typ4dz
zapisx dta b(0)
jmp typ5dz
zapisy dta b(0)
jmp typ6dz
sprvol dta b($10)
jmp typ7dz

newdzw lda #0
sta adcvol,x
ldy licptr
dey
new iny
lda (addr),y
cmp #$fe
bne q0
sty licptr
rts
q0 cmp #$e0
bcc q1
lda maxptr
sta pozptr
bne new
q1 cmp #$d0
bcc q2
and #15
sta tempo
sta zegar
bpl new
q2 cmp #$c0
bcc q3
and #15
eor #15
sta adcvol,x
bpl new
q3 cmp #$80
bcc q4
and #$3f
sta ilespc,x
bpl new
q4 cmp #$40
bcc q5
iny
sty licptr
and #$1f
sta numsmp,x
asl @
tay
ainslz lda $ffff,y
sta adrinl,x
iny
ainshz lda $ffff,y
sta adrinh,x
jmp newdzw

q5 sty licptr
sta przech
clc
adc poddzw,x
sta adcdzw,x
lda typsmp
beq n9
cmp #2
beq n8
lda numsmp,x
cmp #$1f
bne n9
lda przech
sec
sbc #1
n6 and #15
tay
lda (adrsmp),y
sta adrs2+1
tya
ora #$10
tay
lda (adrsmp),y
sta lensmp
ldy #1
ora adrs2+1
bne n7
ldy #0
n7 sty czysmp
lda #0
sta adrs2
sta adrinl,x
sta adrinh,x
txa
asl @
sta wsksmp
stx kansmp
rts
n8 cpx #2
bcs nb
n9 lda adrinl,x
sta word
lda adrinh,x
sta word+1
ora word
beq na-1
ldy #$20
lda (word),y
and #15
sta p1lsb,x
lda (word),y
and #$70
lsr @
lsr @
sta branch,x
iny
lda (word),y
asl @
asl @
pha
and #$3f
sta p2lic,x
pla
and #$c0
sta frqwsk,x
iny
lda (word),y
sta p3max,x
sta p3lic,x
lda #0
sta licslp,x
sta trnlic,x
sta p1lic,x
sta p1pom,x
lda adcdzw,x
sta numdzw,x
jsr czest
sta freq,x
cpx kansmp
beq na
rts
na ldy #$ff
sty kansmp
iny
sty czysmp
rts
nb cpx #2
bne nd
ldy adcdzw+2
lda frsmpl,y
sta smpl1z+1
lda frsmph,y
sta smpl2z+1
lda #0
sta lsbmsb
sta adrs1
lda numsmp+2
and #15
tay
lda (adrsmp),y
sta adrs1+1
tya
ora #$10
tay
lda (adrsmp),y
sta smpl3z+1
ora adrs1+1
bne nc
sta smpl1z+1
sta smpl2z+1
nc rts
nd lda numsmp+3
and #15
tay
lda (adrsmp),y
sta adrs2+1
tya
ora #$10
tay
lda (adrsmp),y
ora adrs2+1
beq ne
lda (adrsmp),y
sec
sbc adrs2+1
sta lensmp
lda #0
sta adrs2
lda #$8d
bne nf
ne lda #$ad
nf sta drum1z
sta drum2z
sta drum3z
sta drum4z
lda #$18
sta $d207
rts

typ0dz lda licz
and #7
lsr @
lsr @
bcc t2
bne typ1dz
lda p1lsb,x
t1 clc
sta p1pom,x
adc freq,x
sta freq,x
jmp r8
t2 lda #0
sta p1pom,x
jmp r8
typ1dz lda freq,x
sec
sbc p1lsb,x
sta freq,x
sec
lda #0
sbc p1lsb,x
sta p1pom,x
jmp r8
typ2dz lda p1lic,x
clc
sta p1pom,x
adc freq,x
t3 sta freq,x
clc
lda p1lic,x
adc p1lsb,x
sta p1lic,x
jmp r8
typ3dz lda numdzw,x
sec
sbc p1lic,x
t4 sta numdzw,x
jsr czest
jmp t3
typ4dz lda #0
sec
sbc p1lic,x
sta p1pom,x
lda freq,x
sec
sbc p1lic,x
jmp t3
typ5dz lda numdzw,x
clc
adc p1lic,x
jmp t4
typ6dz jsr t5
jmp t1
typ7dz jsr t5
clc
adc numdzw,x
jsr a3
jmp r8
t5 ldy p1lic,x
lda p1lsb,x
bmi t6
iny
iny
t6 dey
tya
sta p1lic,x
cmp p1lsb,x
bne t7
lda p1lsb,x
eor #$ff
sta p1lsb,x
t7 lda p1lic,x
rts
czest and #$3f
ora frqwsk,x
tay
t1frqz lda $ffff,y
rts

akcadl dta l(a1),l(a0),l(a2)
dta l(a4),l(a5),l(a6),l(a8)
akcadh dta h(a1),h(a0),h(a2)
dta h(a4),h(a5),h(a6),h(a8)
audora dta b($40),b(0),b($20),b(0)

a0 adc freq,x
a1 sta freq,x
rts
a2 adc adcdzw,x
a3 sta numdzw,x
jsr czest
sta freq,x
rts
a4 sta freq,x
lda audora,x
bpl a7
a5 sta freq,x
lda #$80
bne a7
a6 sta freq,x
lda #1
a7 ora oraaud
sta oraaud
rts
a8 and $d20a
sta freq,x
a9 rts

bsfrql equ *-1
dta b($f2),b($33),b($96)
dta b($e2),b($38),b($8c),b(0)
dta b($6a),b($e8),b($6a),b($ef)
dta b($80),b(,b($ae),b($46)
dta b($e6),b($95),b($41),b($f6)
dta b($b0),b($6e),b($30),b($f6)
dta b($bb),b($84),b($52),b($22)
dta b($f4),b($c8),b($a0),b($7a)
dta b($55),b($34),b($14),b($f5)
dta b($d8),b($bd),b($a4),b($8d)
dta b($77),b($60),b($4e),b($38)
dta b($27),b($15),b(6),b($f7)
dta b($e8),b($db),b($cf),b($c3)
dta b($b8),b($ac),b($a2),b($9a)
dta b($90),b($88),b($7f),b($78)
dta b($70),b($6a),b($64),b($5e)

bsfrqh equ *-1
dta $0d,$0d,$0c,$0b,$0b,$0a,$0a,$09,$08,$08,$07,$07,$07,$06,$06
dta $05,$05,$05,$04,$04,$04,$04,$03,$03,$03,$03,$03,$02,$02,$02,$02
dta $02,$02,$02,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00
dta $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

volstb dta d'8888888888888888'
dta d'667777888889999:'
dta d'556667788899:::;'
dta d'455667788899::;;'
dta d'44556677899::;;<'
dta d'34456677899::;<<'
dta d'33455677899:;;<='
dta d'23445677899:;<<='
dta d'2334566789::;<=='
dta d'2234566789::;<=>'
dta d'1234566789::;<=>'
dta d'1234556789:;;<=>'
dta d'1234456789:;<<=>'
dta d'1233456789:;<==>'
dta d'1223456789:;<=>>'
dta d'0123456789:;<=>?'

frsmpl dta b($20),b($22),b($24),b($26),b($29)
dta b($2b),b($2e),b($30),b($33),b($37)
dta b($3a),b($3d),b($41),b($45),b($49)
dta b($4d),b($52),b($57),b($5c),b($61)
dta b($67),b($6e),b($74),b($7b),b($82)
dta b($8a),b($92),b($9b),b($a4),b($ae)
dta b($b8),b($c3),b($cf),b($dc),b($e9)
dta b($f6),b(5),b($15),b($25),b($37)
dta b($49),b($5d),b($71),b($87),b($9f)
dta b($b8),b($d2),b($ed),b($b),b($2a)
dta b($4b),b($6e),b($93),b($ba),b($e3)
dta b($f),b($3e),b($70),b($a4),b($db)

frsmph dta d'               '
dta d'               '
dta d'      !!!!!!!!!'
dta d'!!!"""""""#####'

*--- inicjacja

iniadl dta l(inic0),l(inic2)
dta l(inic4),l(inic5)
dta l(inic6),l(inic7)
dta l(inic8),l(inic9)
iniadh dta h(inic0),h(inic2)
dta h(inic4),h(inic5)
dta h(inic6),h(inic7)
dta h(inic8),h(inic9)

init stx zapisx
sty zapisy
and #7
tay
lda iniadl,y
sta inic1+1
lda iniadh,y
sta inic1+2
inic1 jmp $ffff

inic0 lda zapisy
ldx zapisx
sta ainslz+1
sta ainshz+1
stx ainslz+2
stx ainshz+2
clc
adc #$40
sta aptrlz+1
sta aptrhz+1
bcc i2
inx
i2 stx aptrlz+2
stx aptrhz+2
clc
adc #$80
sta t1frqz+1
bcc i4
inx
i4 stx t1frqz+2
inx
sta j4+1
stx j4+2
ldx #9
j4 lda $ffff,x
sta adrtrl,x
dex
bpl j4
dec tempo

inic2 lda #0
sta czygrc
ldx <licptr-branch
i9 sta branch,x
dex
bpl i9
ldx #8
k9 sta $d200,x
dex
bpl k9
rts

inic4 jsr inic2
lda zapisx
asl @
sta pozsng
lda maxptr
sta pozptr
lda #1
sta zegar
sta czygrc
rts

inic5 lda zapisy
sta adrsmp
lda zapisx
sta adrsmp+1
j5 rts

inic6 lda zapisy
and #3
tax
lda zapisx
jsr n6
lda czysmp
beq j5
asl  zapisy
j6 jsr nopy
lda #1
sta typsmp
j7 lda czysmp
beq j5
cmp #1
bne j9
ldy #0
inc czysmp
j9 lda (adrs2),y
ldx wsksmp
lsr @
lsr @
lsr @
lsr @
ora #$10
k15h1z sta $d40a
sta $d40a
sta $d201,x
lda (adrs2),y
ora #$10
k15h2z sta $d40a
sta $d40a
sta $d201,x
iny
bne j7
inc adrs2+1
lda adrs2+1
cmp lensmp
bne j7
sty czysmp
rts

nopy bcc j8
lda #$ea
sta k15h1z
sta k15h1z+1
sta k15h1z+2
sta k15h2z
sta k15h2z+1
sta k15h2z+2
rts
j8 lda #$8d
sta k15h1z
sta k15h2z
lda #$a
sta k15h1z+1
sta k15h2z+1
lda #$d4
sta k15h1z+2
sta k15h2z+2
rts

inic7 lda #0
sta czysmp
lda zapisx
lsr @
jsr nopy
lda #1
sta typsmp
k1 jsr j7
lda typsmp
bne k1
rts

inic9 ldy #0
sty typsmp
sty czysmp
dey
sty kansmp
rts

k6 clc
lda lsbmsb
smpl1z adc #0
sta lsbmsb
lda adrs1
smpl2z adc #0
sta adrs1
bcc k7
inc adrs1+1
lda adrs1+1
smpl3z cmp #0
bne k7
sty smpl1z+1
sty smpl2z+1
rts
k7 lda (adrs1),y
bit lsbmsb
bmi k8
lsr @
lsr @
lsr @
lsr @
k8 and #15
tay
volsmp lda volstb,y
ldy #0
rts

y1 lda typ
beq y3
lda xdone
cmp #$ff
beq y5
y6 jsr play
ldy #0
rts
y3 lda pozsng
cmp #4
bcc y6
inc typ
ldx #1
stx dcb+2
dex
stx dcb+3
y5 lda #$34
sta $d303
jsr play
set ldy #0
sty xdone
sty lindex
lda #$23
sta $d20f
lda #$10
sta $d20e
lda #$31
sta $d20d
sta cksum
cli
rts

irq2 cmp #$20
bne irq3
lsr @
sta $d20e
inc lindex
ldx lindex
cpx #4
bcs oi1
lda dcb,x
sta $d20d
clc
adc cksum
adc #0
sta cksum
pla
tax
pla
rti
oi1 bne oi2
lda cksum
sta $d20d
pla
tax
pla
rti
oi2 lsr @
sta $d20e
pla
tax
pla
rti

irq3 lda #$13
sta $d20f
sta $d20a
lda #$20
sta $d20e
lda #$3c
sta $d303
lda #$fe
sta stcnt
lda #0
sta cksum
pla
tax
pla
rti

irq pha
txa
pha
ldx #0
lda $d20e
stx $d20e
and #$30
cmp #$10
bne irq2

asl @
sta $d20e
lda $d20f
sta $d20a
bpl error
and #$20
beq error
ldx stcnt
bmi getsum
lda $d20d
sta bufor,x
clc
adc cksum
adc #0
sta cksum
inc stcnt
pla
tax
pla
rti
getsum cpx #$80
beq ii1
inc stcnt
lda $d20d
cmp #$41
beq endirq
cmp #$43
beq endirq
error dec xdone
lda #0
sta $d20e
endirq pla
tax
pla
rti
ii1 lda $d20d
sbc cksum
bne error
sta $d20e
inc xdone
pla
tax
pla
rti

*--- zmienne

adrtrl org *+4
adrtrh org *+4
maxptr org *+1
tempo  org *+1

branch org *+4
volume org *+4
adcvol org *+4
freq   org *+4
frqwsk org *+4
adcdzw org *+4
poddzw org *+4
adrinl org *+4
adrinh org *+4
numdzw org *+4
numsmp org *+4
numptr org *+4
ptrwsk org *+4
ilespc org *+4
licspc org *+4
p1lsb  org *+4
p1lic  org *+4
p1pom  org *+4
p2lic  org *+4
p3max  org *+4
p3lic  org *+4
trnlic org *+4
zegar  org *+1
pozsng org *+1
pozptr org *+1
wsksmp org *+1
kansmp org *+1
czysmp org *+1
typsmp org *+1
oraaud org *+1
licz   org *+1
przech org *+1
licptr org *+1

*--- loader

org $480

inic8 sei
cld
lda #$fe
sta $d301
lda <irq
sta $fffe
lda >irq
sta $ffff
lda <jamp
sta jump+1
lda >jamp
sta jump+2

lda #2
sta typsmp
sta kansmp
ressmp lda #$18
sta $d207
lda <ressmp+1
sta adrs1
lda >ressmp+1
sta adrs1+1
lda #$ad
sta drum1z
sta drum2z
sta drum3z
sta drum4z
ldy #1
sty gdzie
dey
sty smpl1z+1
sty smpl2z+1
sty typ
sty xdone
sty $d206
lda #$28
sta $d204
sta $d208
lda #$52
sta dcb+1

k2 ldx $d40b
cpx #2
bcs y2
jsr y1
y2 lda (adrs2),y
lsr @
lsr @
lsr @
lsr @
ora #$10
drum1z sta $d207
jsr k6
k3 cpx $d40b
beq k3
sta $d205
ldx $d40b
cpx #2
bcs y4
jsr y1
y4 lda (adrs2),y
inc adrs2
bne k4
inc adrs2+1
dec lensmp
bne k4
lda #$ad
sta drum1z
sta drum2z
sta drum3z
sta drum4z
lda #8
k4 ora #$10
drum2z sta $d207
jsr k6
k5 cpx $d40b
beq k5
sta $d205
lda xdone
cmp #1
bne k2

sei
ldy typ
bmi x0
lda bufor+4
sta dcb+2
lda bufor+5
sta dcb+3
lda #$ff
sta typ
sta xdone
bne k2

x0 iny
sty lindex
sty wsk
lda bufor+$7e
sta dcb+2
lda bufor+$7d
and #3
sta dcb+3
ora dcb+2
beq l7
lda #$34
sta $d303
l7 sta l8+1

l1 ldx wsk
cpx bufor+$7f
bcc l5
l8 lda #$34
beq l9
jsr set
jmp k2
l9 lda #1
jsr init
jmp ($2e0)

l5 lda bufor,x
ldy gdzie
beq l6
sta adr-1,y
inc gdzie
bne l0
l6 sta (adr),y

l0 ldx $d40b
cpx #2
bcs y7
jsr play
y7 ldy #0
lda (adrs2),y
lsr @
lsr @
lsr @
lsr @
ora #$10
drum3z sta $d207
jsr k6
l2 cpx $d40b
beq l2
sta $d205

ldy gdzie
bne x2
lda adr
cmp end
lda adr+1
sbc end+1
bcs x1
inc adr
bne x3
inc adr+1
bne x3
x1 inc gdzie
bne x3
x4 cpy #5
bne x3
lda #0
beq x5
x2 cpy #3
bne x4
lda adr
and adr+1
eor #$ff
bne x3
lda #1
x5 sta gdzie

x3 ldx $d40b
cpx #2
bcs y8
jsr play
y8 ldy #0
lda (adrs2),y
inc adrs2
bne l3
inc adrs2+1
dec lensmp
bne l3
lda #$ad
sta drum1z
sta drum2z
sta drum3z
sta drum4z
lda #8
l3 ora #$10
drum4z sta $d207
jsr k6
l4 cpx $d40b
beq l4
sta $d205
inc wsk
jmp l1

end

Link to comment
Share on other sites

I've got the next 4 days kinda free(ish), and I'd be very interested.

 

Been wanting for ages to do a digi-player, using a kind of wrap-around "chase" buffer where it continuously loads and plays without interruption of either process.

 

As I said elsewhere, 2 bit samples should be possible in realtime almost indefinately.

But I guess the real-world application for all this would be game loaders with tunes + digi drums, cymbals, whatever. 2 voices + 1 or both of the remainders doing samples should be doable.

Link to comment
Share on other sites

Rybags...first step would be to to rewrite and comment the irq-loader... but this should be not so hard. as it reads the $d20d (serin), reads 128 bytes, checks if errors and writes that back to the buffer ("bufor")...but first i would like to have a potential loader, MADS compatible and then exchanging the msx with another MPT digi track... ;)

 

http://en.wikipedia.org/wiki/Atari_POKEY

Link to comment
Share on other sites

Just starting on my own SIO routine here...

 

Probably not the best way to go about things, but this is how I'll be doing it:

 

- Custom Imm IRQ routine. For now, just to ensure top speed. As such, all other IRQs get disabled. Routine simply does I/O to RAM in the same fashion as the OS, bumps buffer pointer, sets appropriate flags etc at expected end of block.

- VBlank Imm routine. It just sits there for the most part. But, it watches flags kicks off I/O when required (ie sends the initial byte of a cmd or data frame). Will also have to handle stuff like timeout detection.

- "Get Sector" routine. Sets appropriate flags to get I/O started.

 

Mainline code: SIO happens in the background, so the main program can prettywell do what it wants (within limits). It just has to periodically check a flag to see if an I/O operation is complete (ie, a "complete" operation in the sense of an entire sector of data has been transferred).

As such, should leave processor totally free to do such things as play music, draw graphics, whatever. So long as it doesn't disable IRQs for any extended period of time.

Link to comment
Share on other sites

ah. ok. seems you are right... the sample player in the energy loader is running as well while loading... (aehm... what a sentence... ;)) so the PC is staying at $580ff. and $10,$11 is the pointer to the samples... but how do you make sure that the sio 19200 bauds are not interrupting the player in an unwanded time?

 

or is 4khz samples and 19200 baud perfect match? I am not good in maths so i do not know...

Edited by Heaven/TQA
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...