Jump to content
IGNORED

Need kernel help (fighting with HMOVE)


TROGDOR

Recommended Posts

Calling all Atari Gurus,

 

I've been fighting with my kernel for the past 2 hours. Right now we're not on speaking terms. :x

 

I'm working on the Kenjutsu kernel, trying to remove the unsightly HMOVE bars from the left side of the screen. I've done extensive forum research. My conclusion is that placing the HMOVE at cycle 74 should prevent the bars. I've sync'ed up my kernel so that all paths are 76 cycles, and removed the WSYNC. I then carefully timed the entry to the kernel so that it starts at cycle 74, with the first command being an HMOVE.

 

The synchronization must be correct, because my player graphic and the sword are displaying correctly. Very Bad Things would happen otherwise.

 

I've also used the nifty debugger info in Stella to verify the HMOVE is happening on cycle 74 for each scanline. But, the resulting game still shows the bars. I've run out of ideas. Can anyone offer advice on what I'm missing here?

 

Below is the code for my kernel, and I've attatched a zip with the full .asm and .bin.

 

TIA

 

TheKernel

	STA WSYNC
	LDX #192			  ;2

	LDY Sword0Dir		 ;3
	LDA SwordHeightTable,Y;4
	STA Temp1			 ;3 Temp1 holds the sword height.

	LDA SwordWidthTable,Y ;4
	STA NUSIZ0			;3

	LDA SwordHmoveLookup,Y;4
	STA Sword0HmoveLo	 ;3

	LDA #0				;2
	STA HMCLR			 ;3 31 cycles

	JSR Wait12
	JSR Wait12
	JSR Wait12			;36 cycles

	NOP
	NOP

	JMP KernelLoop		;3 Ends on cycle 74

	align 256

SkipSwordDraw
	LDA Temp1			 ;3 (+1 from previous branch.)
	LDA #0				;2
	STA HMM0			  ;3
	BEQ ContinueKernel0;3 Block = 12

SkipDraw
	LDA #0				;2 (+1)
	BEQ ContinueKernel1;3 Block = 6

KernelLoop
	STA HMOVE			 ;3 This runs at cycle 74.
	STA GRP0			  ;3

	LDA Temp2			 ;3
	STA ENAM0			 ;3 Block = 9

; Check for the sword.
	SEC				;2
	TXA				;2 A now holds scanline.
	SBC Sword0Y		;3
	ADC Temp1			 ;3 Sword Height.
	BCC SkipSwordDraw	 ;2 or 3 Block = 12

	TAY				;2

	LDA (Sword0HmoveLo),Y ;5
	STA HMM0			  ;3

	LDA #$FF			  ;2 

ContinueKernel0
	STA Temp2			 ;3 Block = 15

	SEC				;2
	TXA				;2 A now holds scanline.
	SBC Player0Y		  ;3
	ADC #8				;2 Player height.
	BCC SkipDraw		  ;2 or 3 Block = 11

	TAY				;2
	LDA PlayerGfx,Y	;4 Block = 6
ContinueKernel1

	NOP				;2
	NOP				;2
	NOP				;2
	NOP				;2
	NOP				;2
	NOP				;2
	LDY Temp1			 ;3 Block = 15
	
	DEX				;2
	BNE KernelLoop		;2 or 3 Block = 5

Kenjutsu_Debug.zip

Edited by TROGDOR
Link to comment
Share on other sites

I've also used the nifty debugger info in Stella to verify the HMOVE is happening on cycle 74 for each scanline. But, the resulting game still shows the bars. I've run out of ideas. Can anyone offer advice on what I'm missing here?

"Cycle 74 HMOVE" refers to when the actual write to HMOVE occurs. To use cycle 74 HMOVEs, make sure Stella shows them beginning at cycle 71.

 

However, I don't know if cycle 74 HMOVEs will work for your game, because all movement is shifted to the left by 8 pixels (you move -15 to 0 pixels instead of -7 to 8.) In other words, it is impossible to move to the right!

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...