0 Members and 1 Guest are viewing this topic.
#include "usgard.h" .org 0.DB "HUBY TI 0.1", 0#define db .byte#define dw .word;Huby beeper music engine by Shiru 04'11;Two channels of tone, no volume, global speed;One drum, replaces note on the first channel;The main feature of this engine is the size, just 100 bytes;Feel free to do whatever you want with the code, it is PD;modified for Z80 TI calcs by utz, Akareyon, and calc84maniac;well, unfortunately it's more than 100 bytes now :( di call &beginex ei ret begin ld hl,&musicData call &play ret play ld e,(hl) ;read speed word inc hl ld d,(hl) inc hl ld (&speed),de ;store it ld e,(hl) ;read patterns offset inc hl ld d,(hl) ;it will be always in DE, and HL is order list pointer nowreadPos inc hl ld a,(hl) ;read first byte of order list or a ret z ;if it is zero, it is end of the song inc hl push hl ;store order list pointer push de ;store patterns offset ld l,(hl) ;read second byte of order list ld bc,2*256 ;calculate addresses of two patternsread ld h,c ;pattern number*8 add hl,hl add hl,hl add hl,hl add hl,de ;add patterns offset push hl ;store pattern address ld l,a ;now second address djnz &read exx pop hl ;restore pattern addressed in alternative set pop de ld b,8 ;play 8 rowsreadRow ld a,(hl) ;read first note inc hl ;increase first pattern pointer ex af,af' ld a,(de) ;read second note inc de ;increase second pattern pointer exx ld h,a ex af,af' ld l,a cp $2c ;if first note is $2c, it is drum sound jr z,$+3 xor a ld (&slide),aspeed .EQU $+1 ld bc,0 ;disoundLoop xor a ;clear carry and set A to zero dec e ;counter of first channel jr nz,&l1 ld e,l ;reload if overflow sub l ;and set carry if note is not zero (mute)slide .EQU $ nop ;slide for druml1 dec d ;counter of second channel jr nz,&l2 ld d,h ;reload if overflow sub h ;and set carry if note is not zero (mute)l2 sbc a,a ;if carry, A=255, otherwise A=0 xor %11111100 ;+ a=$ff -> a=$c0, a=0 -> a=$fc and %00111100 add a,$c0 out (7),a ;11 27 out (7),a out (7),a out (7),a ;+ 4x to compensate higher cpu speed xor a ;+ new keyhandler out (1),a in a,(1) ;read keyboard cpl bit 6,a jr nz,&l3 ;if any key is pressed, exit loop dec bc ld a,b or c jr nz,&soundLoop ;113/123t + not anymorel3 exx jr nz,$+4 ;if any key was pressed, break loop djnz &readRow pop de pop hl jr z,&readPos ;if no key was pressed, continue retmusicData#include "ti1bit/huby/music.asm".end
Oh, thanks for the quick reply, guys.@Art_of_camelot: Haha, I have nearly all doc files from ticalc backed up on my computer, but unfortunately they don't seem to have an 85-ports.txt @JamesV: Ok, I'm just gonna dump the code here, it's not really a secret And actually the keyhandler barely qualifies as such. Not sure if it's actually the part causing problems. If I comment it out the program still doesn't run, but it doesn't give me the "ERROR 20 GRAPH RANGE".
WHOA, PEOPLE STILL CODE ON THAT THING?i do not own a ti85, but isn't it just like ti84 basic?
TI-85 BASIC is identical to TI-86 BASIC, but (almost) twice faster. It also has similarities with 84+ BASIC.