DEMO -> Other
© _Public_Domain_ (2014)
Reset 18 - Growth

Last Update : Wednesday 19 November 2014 at 17 h 18

Manual n° 1

org &9000 ;ABCDabcd ;Aa=10-yellow ;Bb=01-cyan ;CC=11-red bits db %10001000;;red db %01000100 db %00100010 db %00010001 db %10000000;;yellow db %01000000 db %00100000 db %00010000 db %10001000;;red db %01000100 db %00100010 db %00010001 db %00001000;;cyan db %00000100 db %00000010 db %00000001 ;write direct ;run start start: ld a,1 ld (var_d+1),a call #bc0e di ;---------clear memory ; xor a ; ld h,a ; ld l,a ld hl,#4000 ld a,l cl ld (hl),a inc l jr nz,cl inc h bit 7,h jr z,cl wwhile: new_r call random;x=random(x-1)+1 ld l,a call random ld h,a find_r push hl ld de,319 or a sbc hl,de pop hl jr c,got_r or a sbc hl,de jr find_r got_r ex de,hl skpy ld hl,#6000 inc de ld b,d;f=x ld c,e push hl push hl pop ix pop iy ; IF s(f) < s(x - 1) THEN f = x - 1;?optimize? ;ld a,1 ;or a ;cp 2;C=1 A<2 ;ld a,3 ;or a ;cp 1;C=0,A<3 add ix,bc;s(f), de=x add iy,de;s(x) ld a,(ix) cp (iy-1) jr nc,endif1 ld b,d ld c,e dec bc;f=x-1 endif1 push hl pop ix add ix,bc;s(f) ;IF s(f) < s(x + 1) THEN f = x + 1 ld a,(ix);s(f) cp (iy+1);s(x+1) jr nc,endif2 ld b,d ld c,e inc bc;x+1 endif2 ;IF INT(RND * 2) = 1 AND s(f) = s(x + 1) THEN f = x + 1 call random rra;and 1 jr nc,endif3;nz push hl pop ix add ix,bc;s(f) ;s(f)=s(x+1)? ld a,(ix) cp (iy+1) jr nz,endif3 ld b,d;f=x+1 ld c,e inc bc endif3 ;s(x)=s(f) push hl pop ix add ix,bc;s(f) ld a,(ix) ld (iy),a;s(x) sub 199 neg ld l,a ;c(x) = c(f) ; push af push iy inc ixh inc ixh inc iyh inc iyh ld a,(ix);c(f) or a jr nz,put_c ld a,e and 3 put_c ld (iy),a;c(x) ;; ld (cv+1),a pop iy ; pop af push af ; sub 199 ; neg ; ld l,a ld h,0 ;de=x ;PSET (x, s(x)), c(x) ;Input DE = X (0..319), HL = Y (0..199) LD A, L ;A = Lowbyte Y AND %00000111 ;isolate Bit 0..2 LD H, A ;= y MOD 8 to H XOR L ;A = Bit 3..7 of Y LD L, A ;= (Y\8)*8 to L LD C, A ;store in C LD B, &60 ;B = &C0\2 = Highbyte Screenstart\2 ADD HL, HL ;HL * 2 ADD HL, HL ;HL * 4 ADD HL, BC ;+ BC = Startaddress ADD HL, HL ;of the raster line LD A, E ;Lowbyte X to A SRL D ;calculate X\4, because RR E ;4 pixel per byte SRL E ADD HL, DE ;+ HL = Screenaddress ld d,bits/256 and 3 ld e,a pop af ;;cv ld a,0 add a,a add a,a add a,e ld e,a ld a,(de) or (hl) ld (hl),a ;s(x) = s(x) + 1 inc (iy) ;IF s(x) = d THEN d = d + 1 var_d: ld a,1 cp (iy) jr nz,noinc_d inc a noinc_d ld (var_d+1),a cp 199 jp nz,wwhile call #BB06 ; ld a,1 ; ld (var_d+1),a jp start;jr $ random: push bc R1: LD C,#18 R2: LD A,#70 ADD A,C LD C,A LD (R1+1),A R3: LD A,#FD SUB C LD C,A LD(R2+1),A RRCA LD (R3+1),A pop bc RET

Goto Top
CPC-POWER/CPCSOFTS, programming by Kukulcan © 2007-2021 all rights reserved.
Reproduction forbidden without any express authorization. All the game titles used belong to their respective owners.
Hébergement Web, Mail et serveurs de jeux haute performance