Jump to content



Avram's Photo

Avram

Member Since 11 Jan 2002
OFFLINE Last Active May 24 2012 8:57 PM

Topics I've Started

DLI timing

Fri Jan 20, 2012 7:42 AM

How much can I do in a DLI on an antic #4 screen? Currently I have an interrupt on every line where I use a lookup table to change two playfield colors (the table counter also increments each line).

I'd like to animate 2-4 bytes of the same character on each line, in addition to the color changes. Is that possible? Oh, and I'm also planning on using all the pm graphics too.

Thanks!

Mediator music

Wed Aug 3, 2011 9:42 PM

Can anyone list the songs played in English Software's Mediator? I'd like to listen to the original classical recordings. Thanks!

character graphics programming help

Mon Jul 11, 2011 3:11 PM

Yet again, I hope someone can look at my code suggest a fix.

This piece of my game checks every character on the antic #4 screen, looking for any instances of slime. Slime is made up as characters 1-4. Chars 1 and 4 are the edges, chars 2-3 are the two center parts of the slime.

When the code below sees either character 1 or character 4, it expands the slime, provided there's a plaform underneath.

So, the following characters on screen (dots are spaces):
.........1234....
.....ABCABCABCABC


should eventually become:

.....123232323234
.....ABCABCABCABC


But, for some reason, the slime doesn't reach all the way to the left of the platform.

Any ideas?

Thanks!


s_start
	lda #0
	sta slime_x
	sta slime_y
s_wait
	lda $14
wait5	cmp $14
	bne wait5
slime0
	lda slime_x	;xpos
        sta temp
        lda slime_y	;ypos
        tax
        lda sclo,x
        sta p1
        lda schi,x
        sta p1+1
        lda p1
        clc
        adc temp
        sta p1
        bcc s_skip0
        inc p1+1
s_skip0
	lda slime_x
	tay
s_skip
	lda (p1),y	
	cmp #03		; left-slime character?
	beq l_slime
	cmp #6		; right-slime character?
	beq r_slime
s_next			; next slime
	inc slime_x
	lda slime_x
	tay
	cmp #37		; too far right?
	bne s_skip0
	ldy #0		; yes.
	sty slime_x	; reset x
	inc slime_y	; move down a line
	lda slime_y
	cmp #23		; bottom of screen?
	bne s_wait;s_skip ;no
test	jmp test

l_slime
	jsr plat_see
	cmp #0		; no platform so return
	beq s_next;s_skip0	
	; expand slime to left
	lda slime_x
	tay
	dey		; move back one
	lda #03		; and add left-slime character
	sta (p1),y
	iny		; move forward one
	lda #04		; paint middle slime
	sta (p1),y
	jmp s_next
	
r_slime 	
	jsr plat_see
	cmp #0		; no platform so return
	beq s_next	
	; expand slime to right
	lda slime_x
	tay
	lda #5		; yes! expand slime to the right
	sta (p1),y
	iny
	lda #6		
	sta (p1),y	; and draw new slime end point
	jmp s_next	

	
;platform check subroutine	
plat_see
	lda #0		;reset platform flag
	sta platform
	lda slime_x	; get current xpos
	adc #40		; ... and move down to line below
	tay		; move it to y-register
	lda (p1),y
	cmp #33		;A
	beq plat_yes
	cmp #34		;B
	beq plat_yes
	cmp #35		;C
	beq plat_yes
	lda #0		;no
	sta platform
	ldy slime_x	; get back current y register
	rts
plat_yes		
	;TURN ON SLIME FLAG. IF NOT ON, THEN NO SLIME LEFT!
	ldy slime_x	; get back current y register
	lda #1
	sta platform
	lda platform
	rts

Scrolling in GTIA modes

Sun Jul 3, 2011 10:18 AM

Is it possible to horizontally scroll horizontally in the GTIA modes? What I've tried so far only moves one chunky pixel at a time.

Thanks!

VBI doesn't quite work

Tue Jun 28, 2011 4:46 PM

Does this code look as if it should work during the vertical blank interrupt? I want to use the VBI time to cycle through some character animation and right now the x-register works but the y-register doesn't. The strange part is that if I separate the code and run it as it's own program then it works fine.

I don't think it's necessary (though correct me if I'm wrong) to save the x, y, and accumulator on the stack, but I did to be safe. I also have some DLIs running too.

My feeling is that somewhere in the main body of the code is a bug but, just in case I'm missing something obvious, I've posted it below.

Thanks!

Avram

;vbi routine
*=$9000	
	pha
	txa
	pha
	tay
	pha
	
	dec vbi_timr	; vbi timer
	lda vbi_timr
	bne vbi_exit
	lda #10		
	sta vbi_timr	; reset timer

; begin main VBI routine
	ldy #16		; number of chars to change, x8
	ldx vbi_char 
	cpx #80
	bne char_anim
;character animate reset
	lda #0
	sta vbi_char
char_anim 	
	lda $7000,x	;read frame
	sta $6020,x	;copy to character set
	inx		
	dey
	bne char_anim	

	clc
	lda vbi_char
	adc #16
	sta vbi_char
vbi_exit
	pla
	tay
	pla
	tax
	pla
	jmp $E462	;exit VBI

;vbi set-up
vbi_test
	ldy #$0		; lo-byte of vbi routine
	ldx #$90	; hi-byte of vbi routine
	lda #7		; deferred vector
	jsr $E45C	; go to SETVBV
	rts