Jump to content
IGNORED

Mid scanline changes not working


Stephen

Recommended Posts

Guys, I cannot for the life of me figure this out. I have 24 mode lines of ANTIC 2 each with DLI enabled. I have set NMIEN to $C0 to enable them. I know the DLI code is firing. However, I cannot get anything to split the scanline. Whether I try to set colour register or re-position a player, only the last STA command seems to do anything.

 

Any help would be greatly appreciated.

 

; 02-13-2017
; PMG Repositioning

; MEMORY MAP
;$2000-$27FF is PMG RAM
;$2800-$28FF is space for display list
;$2900-$2FFF space for various interrupt code
;$3000-$3FFF is screen RAM

; Equates
sm_ptr	= $58	; 88, SAVMSC
VDSLST  = $200	; Vector for NMI Display List Interrupt
SDMCTL	= $22F	; ANTIC DMA shadow register
COLOR0	= $2C4  ; 
COLOR1	= $2C5  ; 
COLOR2	= $2C6  ; 
COLOR3	= $2C7  ; 
GPRIOR	= $26F
DMCTL	= $D400	; ANTIC DMA Control
GRACTL	= $D01D	; 1 = enable missiles, 2 = enable players
COLPF0 	= $D016 ; (R) = 
COLPF1 	= $D017 ; (R) = 
COLPF2 	= $D018 ; (R) = 
COLPF3 	= $D019 ; (R) = 
COLBAK	= $D01A ; (R) = 
PRIOR	= $D01B ; (R) = 
NMIEN	= $D40E	; NMI Enable ($C0 = enable DLI)
WSYNC	= $D40A

	org $2800
	.byte $70,$70,$60	;8 blank, 8 blank, 6 blank
	.byte $90		;1 blank + DLI
	.byte $C2,$00,$30       ;MODE 2, LMS $3000, DLI
:23	.byte $82               ;MODE 2, DLI
	.byte $41,$00,$28       ;JVB $2800
	
	org $2900	; Display List Interrupt 1 Code
	; Start by pushing registers
	; Write to hardware registers
	; Write value into $200 for start of next DLI code chunk
	pha
	sta WSYNC
	lda #$02
	sta COLPF2
	nop
	nop
	lda #$06
	sta COLPF2
	pla
	rti	; End with an RTI

	org $3000
:12	.byte "               Even Line                ","                Odd Line                "	

	org $4000		; Start of code block

start	lda #0
	sta SDMCTL		; Turn off DMA
	mwa #$2800 $230		; Set Display List Pointer ($230, $231)
	mwa #$2900 VDSLST	; Set Display List Interrupt Pointer ($200, $201)

	lda #$C0
	sta NMIEN		; Enable Display List Interrupts	
	
	lda #$22		; Normal Playfield, no player+missile DMA
	sta SDMCTL

	lda #1
	sta GPRIOR

	; Set Playfield Colours
	lda #$62
	sta COLOR2		; Dark purple background
	
loop	jmp loop
        
	run start		; Define run address
Reposition.xex
Link to comment
Share on other sites

You'd need to be changing COLBAK with that code to see anything. The changes are occurring offscreen.

 

Using Altirra with the horizontal size set to full can help debugging.

Of course with Graphics 0 you have the badline problem too, so even if you put enough NOPs to get you into the text window, the DMA steals would delay the changes until offscreen again.

Disregarding DMA and Refresh cycles lost, there's a 34 cycle gap between the end of a standard screen and start of the next one. A colour change preloaded and stored immediately after WSYNC will usually take effect about 2 character cells to the right of the screen window.

 

All that aside, it's way easier to do this sort of thing in bitmap modes but even then you need to consider that DList DMA patterns can be different, ie the first LMS and in 8K hires modes the second LMS partway down the screen.

  • Like 1
Link to comment
Share on other sites

Thanks guys - I messed around a bit last night with an all ANTIC C screen. I was able to change positions of 3 players before running out of time. I don't have anything particular in mind, just wanting to play around with some of the more advanced stuff.

  • Like 1
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...