Jump to content
Sign in to follow this  
Heaven/TQA

Local Vars in MADS

Recommended Posts

stll not get it...

 

why does this not work? the STA ?loop+1 and STA ?loop+2 are referenzed to the first "local" loop and not to the second one... what i am doing wrong?

 

tabinit: lda 756
	sta si+1
	lda #0
	sta si
	ldx #0
?loop	lda si
	sta fonttabl,x
	lda si+1
	sta fonttabh,x
	lda si
	add #8
	sta si
	bcc ?cont
	inc si+1
?cont	inx
	bpl ?loop
	
	mwa #vram si
	mwa #vram2 di
	ldy #31
	ldx #0
?loop2	lda si
	sta scrtabl,x
	lda si+1
	sta scrtabh,x
	lda di
	sta txttabl,x
	lda di+1
	sta txttabh,x+
	lda si
	add #20
	sta si
	bcc ?cont2
	inc si+1
?cont2	lda di
	add #20
	sta di
	bcc ?cont3
	inc di+1
?cont3	dey
	bpl ?loop2
	
wait_vbl: lda 20
	cmp 20
	beq *-2
	rts
;in y=pos on screen
;in x=xpos
;in a = char 
set_sprite: sta char
	sty temp
	stx hposp0
	mwa #p0 di
	lda #0
	ldy oldpy
	ldx #7
?loop	sta p0,y+
	dex
	bpl ?loop
	ldx char
	lda fonttabl,x
	sta ?loop2+1
	lda fonttabh,x
	sta ?loop2+2
	ldy temp
	sty oldpy
	ldx #0
?loop2	lda $ffff,x+
	sta (di),y+
	cpx #8
	bcc ?loop2
	rts

Share this post


Link to post
Share on other sites
stll not get it...

 

why does this not work? the STA ?loop+1 and STA ?loop+2 are referenzed to the first "local" loop and not to the second one... what i am doing wrong?

 

You forgot "opt ?+" at the beginning of your source.

Edited by drac030

Share this post


Link to post
Share on other sites

opt ?+ for MAE local vars

 

opt ?- (default):

.local namespaces1

.local namespaces2

.endl

.endl


.local namespaces1   ; additive namespaces1+namespaces1

.endl

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...