Atari ST Music on Crazy Climber PCB

ajhippel

Newbie
Feedback
1 (100%)
Credits
9CR
As some of you may know, i came from the Atari-ST Demoscene...

while making a highscoresavekit for crazy climber, i could not restist to include some of my old tunes into the main menu.

on crazy climber, the main CPU controlles the AY-3-8910 Soundchip (the same as the Atari ST YM2149) - which gave me the opportunity to include my soundroutine in a standard savekit :)

and here it is:

 

Hurray Banana

Moderator
Staff member
vacBacker
Feedback
8 (100%)
Credits
2,721CR
That is epic Jochen, pure class
smiley32.gif


Loving the sine wave
Hurray Banana2016-05-04 13:34:33
 

cmonkey

Active member
vacBacker
Feedback
4 (100%)
Credits
1,658CR
Nice work! I was intrigued how you'd done the sine wave effect. At first I thought the Crazy Climber hardware must have a pixel addressable frame buffer but it turns out that it's got 32 x 8 pixel wide individual vertical scrolling columns. Now I can see how you did it.
smiley2.gif
 

ajhippel

Newbie
Feedback
1 (100%)
Credits
9CR
i used the decrypted code and added all the things for the savekit / freeplay etc..

as i wrote in the first post, crazy climber is one of the pcb's where the main cpu controlles the soundchip, which is the same like on the atari st..
only the clock for the soundchip is a bit lower, but i transposed the song a bit higher...

it's just a z80 player instead of the 68000 play-routine i used the old days...
unfortunately there is only one interrupt (about 60hz) and no timer...with a timer i could add sid-voice and everything...

the sine is indeed VERY simple...
crazy climber has 32 scroll-registers for each column...wow i never had that on an atari st :)
thats why the code is VERY short:

initialisation:

ld hl,sineoffsets ;pointer in the ram
ld b,32 ;32 columns
initsineoffsets:
ld a,b ;get b (32-1) as startdely
dec a ;make it 31-0)
ld (hl),a ;store delay
inc hl ;next column
djnz initsineoffsets

and this is the sine-program:

dosine:
ld hl,sineoffsets ;points to 32 bytes free ram
ld de,#9800 ;pointer to the 32 scroll-registers
ld b,32 ;32 columns
dosinelp:
ld a,(hl) ;get offset in the sinetable
and a ;
jp m,sinewave ;when minus, then do the sine
dec a ;when positive, count down delay
ld (hl),a ;store it again
inc hl ;next column (ram)
inc de ;next column (scrollregister)
djnz dosinelp
ret
sinewave:
inc a ;increment offset
or #80 ;always make it negative (positive would be the initial delay)
ld (hl),a ;store offset
and #7f ;only 0-127
push hl ;store the pointer
ld h,HI sinetable ;get the high-byte of the sinetable-address
ld l,a ;offset = lowbyte of the address
ld a,(hl) ;get value from table
pop hl ;get the pointer again
inc hl ;increase the pointer
ld (de),a ;store value in the scroll-register
inc de ;increase pointer
djnz dosinelp ;next column
ret

just make sure that the 128 bytes sinetable does not cross a 256 bytes border

Thats it....
 
Top