diff options
| -rw-r--r-- | draw_lorcha.s | 19 | ||||
| -rw-r--r-- | taipan.c | 11 | 
2 files changed, 21 insertions, 9 deletions
| diff --git a/draw_lorcha.s b/draw_lorcha.s index c3a5c38..07c4afe 100644 --- a/draw_lorcha.s +++ b/draw_lorcha.s @@ -3,6 +3,8 @@  ; Lorcha (boat), a type of sailing vessel having a Chinese  ; junk rig on a Portuguese or European style hull. + .include "atari.inc" +   .import _jsleep   .export _draw_lorcha, _sink_lorcha, _damage_lorcha, _clear_lorcha, _flash_lorcha @@ -19,9 +21,6 @@ lorcha_pos_hi:   .byte >320, >328, >336, >344, >352   .byte >640, >648, >656, >664, >672 -; Atari OS's pointer to start of screen RAM - SAVMSC = $58 -  ; ZP working variables start at $d4, aka FR0 (floating point reg 0).   temp = $d4   andmask = temp @@ -29,6 +28,7 @@ lorcha_pos_hi:   destptr = $d6   lcount = $d8   which = $d9 + sinkdelay = $da  ; clrtobot.s needs these:   .exportzp destptr @@ -113,6 +113,15 @@ _sink_lorcha:   lda #6   sta lcount + ; set sinkdelay to 3, 5, or 7 jiffies +@rnd: + lda RANDOM + eor RTCLOK+2 + and #$06 + beq @rnd + ora #1 + sta sinkdelay +  sinkloop:   ldx which   jsr setup_destptr @@ -124,9 +133,9 @@ sinkloop:   adc #0   sta destptr+1 - ; delay for several jiffies + ; delay for sinkdelay jiffies   ldx #0 - lda #7 + lda sinkdelay   jsr _jsleep   ldx #6 ; line loop counter @@ -3406,11 +3406,14 @@ int main(void) {  	POKE(559, 34);        // turn on the screen (normal playfield)  #ifdef LORCHA_TEST -	for(choice = 0; choice < 10; choice++) -		draw_lorcha(choice);  	while(1) { -		for(choice = 1; choice < 10; choice++) { -			damage_lorcha(choice); +		gotox0y(0); +		clrtoeol(); +		for(choice = 0; choice < 10; choice++) { +			draw_lorcha(choice); +			sink_lorcha(choice); +			cprintuint(PEEK(0xda)); +			cspace();  		}  		agetc();  	} | 
