Seamless All-direction Scrolling

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

User avatar
dougeff
Posts: 2616
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: Seamless All-direction Scrolling

Post by dougeff » Wed Aug 16, 2017 8:21 pm

[Re, 1 direction scrolling]

Maybe next time. I'm very busy these days.

Also, you can use the all-direction engine to just go horizontally (keep Y at zero, or in the 2 nametable tall range)...or vertically (keep X zero, ot in the 2 nametable wide range)...with slight modification.

And stop calling the "fill the ppu buffer" for the opposite direction, and change the mirroring in the .cfg file, if you want.
nesdoug.com -- blog/tutorial on programming for the NES

Diskover
Posts: 213
Joined: Thu Nov 24, 2011 7:16 am
Contact:

Re: Seamless All-direction Scrolling

Post by Diskover » Wed Aug 16, 2017 10:54 pm

Yes, I was testing things yesterday.

I managed to run from left to right and from right to left by setting the mirror to horizontal in.cgf, and in lesson28.h the MAX_SCROLLING_Y to 0. This enabled the screen to lock up and down.

However, when I move, there comes a moment on the screen number 4-5 that begin to appear glicht graphics and gives problems.
In addition, it really seems that the nametables are loaded two by two vertically, and although BGTABLE only left, for example, 9 nametables, these were loaded from top to bottom.

I do not know if I understand the last one I've written. I am sorry

User avatar
dougeff
Posts: 2616
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: Seamless All-direction Scrolling

Post by dougeff » Thu Aug 17, 2017 5:00 am

Hmm, maybe there's some bugs in the code.

I will look at it ...some day.


EDIT - I didn't have any problems, when I changed #define ROOMS_HIGH 1
(essentially the same as MAX_SCROLL_Y 0)

I didn't change the .cfg mirroring. I don't think that should be the problem either. Or, maybe that is the problem...yes...it does load 2 rooms tall worth of tiles when you scroll left and right... You would need to go to DrawBG.s and in _CSV2NT_COL_FILL: at line 280 it should just do...

lda #$ff
sta _Col_Buffer+62
jmp Col_Ready

to skip the second half of the 'Draw a column' function.

And, shouldn't it be vertical mirroring? To do horizontal scrolling? It's too early in the morning, I need some coffee.


EDIT 2 - still see some graphic errors. Looks like there is bugs in the code.


EDIT 3 - I think the problem then, is the CSV2NT_ROW_FILL function is being called, and it shouldn't be. I commented out refereces in lesson28.c on lines 292 and 301, and edited CSV2NT_FULL to do 1 fewer row. Seems to work.
nesdoug.com -- blog/tutorial on programming for the NES

Diskover
Posts: 213
Joined: Thu Nov 24, 2011 7:16 am
Contact:

Re: Seamless All-direction Scrolling

Post by Diskover » Thu Aug 17, 2017 9:52 am

dougeff wrote:Hmm, maybe there's some bugs in the code.

I will look at it ...some day.


EDIT - I didn't have any problems, when I changed #define ROOMS_HIGH 1
(essentially the same as MAX_SCROLL_Y 0)

I didn't change the .cfg mirroring. I don't think that should be the problem either. Or, maybe that is the problem...yes...it does load 2 rooms tall worth of tiles when you scroll left and right... You would need to go to DrawBG.s and in _CSV2NT_COL_FILL: at line 280 it should just do...

lda #$ff
sta _Col_Buffer+62
jmp Col_Ready

to skip the second half of the 'Draw a column' function.

And, shouldn't it be vertical mirroring? To do horizontal scrolling? It's too early in the morning, I need some coffee.


EDIT 2 - still see some graphic errors. Looks like there is bugs in the code.


EDIT 3 - I think the problem then, is the CSV2NT_ROW_FILL function is being called, and it shouldn't be. I commented out refereces in lesson28.c on lines 292 and 301, and edited CSV2NT_FULL to do 1 fewer row. Seems to work.
Mmm, a little hard

My config:

lesson28.h
#define ROOMS_HIGH 1
#define MAX_SCROLL_Y 0

.cgf
NES_MIRRORING: type = weak, value = 1;

lesson28.c
Commented lines and remains so, but this is not whether it is right, because then nothing moves.

Code: Select all

/*
		if (direction == GoRight){
			tempX = masterX + 0x100;
			tempY = masterY;
			CSV2NT_COL_FILL();
		}
		else {
			tempX = masterX - 0x10;
			tempY = masterY;
			CSV2NT_COL_FILL();
		}
*/
DrawBG.s
Add these lines at position 280

Code: Select all

	;62
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;next column, nametable down one
	inc _tempY+1
	lda #$ff
	sta _Col_Buffer+62
	jmp Col_Ready
This still does not work correctly what is supposed to be corrected in CSV2NT_FULL?

EDIT:
In addition, change the BGtable to make a single row and I think that is where there really a problem. As they have nothing to load down errors occur.

Code: Select all

const unsigned char * const BG_TABLE[] = {
BG00, BG01, BG02, BG03, BG04, BG05, BG06, BG07
};
EDIT 2:
It seems that there is a limit when creating METATILES for BACKGROUND

How can increase?

Diskover
Posts: 213
Joined: Thu Nov 24, 2011 7:16 am
Contact:

Re: Seamless All-direction Scrolling

Post by Diskover » Sat Sep 02, 2017 7:18 am

I've been testing your scroll engine and good. . . can be reached has to make a Star Wars - The Return of the Jedi who never left hahaha :D

Image Image
Attachments
Star Wars - The Return of the Jedi (alpha 0.1).nes
(40.02 KiB) Downloaded 102 times

User avatar
dougeff
Posts: 2616
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: Seamless All-direction Scrolling

Post by dougeff » Sat Sep 02, 2017 1:09 pm

I'm glad someone can make sense of my code. I've been too busy to write a proper blog page. Or comment the code.

I'm definitely going to change the code, ...and make a H scroll only and a V scroll only version of the same.
nesdoug.com -- blog/tutorial on programming for the NES

Diskover
Posts: 213
Joined: Thu Nov 24, 2011 7:16 am
Contact:

Re: Seamless All-direction Scrolling

Post by Diskover » Sat Sep 02, 2017 2:22 pm

Great!

Diskover
Posts: 213
Joined: Thu Nov 24, 2011 7:16 am
Contact:

Re: Seamless All-direction Scrolling

Post by Diskover » Sat Sep 09, 2017 12:44 pm

I regret to report that the engine 4 nametable scroll does not work properly in PAL NES version.

https://www.youtube.com/watch?v=Qc0p-Gv7LzI

User avatar
dougeff
Posts: 2616
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: Seamless All-direction Scrolling

Post by dougeff » Sat Sep 09, 2017 5:06 pm

Ok.

I'm assuming you are testing on a cartridge that can do 4 screen mirroring?
nesdoug.com -- blog/tutorial on programming for the NES

Diskover
Posts: 213
Joined: Thu Nov 24, 2011 7:16 am
Contact:

Re: Seamless All-direction Scrolling

Post by Diskover » Sun Sep 10, 2017 12:16 am

dougeff wrote:Ok.

I'm assuming you are testing on a cartridge that can do 4 screen mirroring?
No. I'm testing on a flashcard but now that you mention it will test a PCB compatible with 4 nametable and I said something. :roll:

User avatar
thefox
Posts: 3141
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Re: Seamless All-direction Scrolling

Post by thefox » Sun Sep 10, 2017 1:32 am

FYI, I spotted some attribute problems (miscolored tiles) when trying that Star Wars demo.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi

Diskover
Posts: 213
Joined: Thu Nov 24, 2011 7:16 am
Contact:

Re: Seamless All-direction Scrolling

Post by Diskover » Sun Sep 10, 2017 3:50 am

Ok, I just made several attempts on different plates. A PCB Second Dimension is and the other is Retro-Stage.

Image

Image

Previously, I tried an ordinary rom to verify that both plates were functioning properly. In this case, I used the Super Mario Bros. rom and everything went well.

Then I tried SW-RotJ rom. I soldered V and H. In both cases the effects were the same. Can these plates are incompatible with 4 screen?

https://www.youtube.com/watch?v=Zj8wDVlfi3Y


As you can see, the result is different. Besides making a wrong scroll, blink several metatiles across the screen.

User avatar
tokumaru
Posts: 11466
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Seamless All-direction Scrolling

Post by tokumaru » Sun Sep 10, 2017 4:37 am

None of these boards support 4-screen name table layout. If you're soldering H and V tabs, that means you're using mirroring, and 4-screen is precisely the lack of mirroring.

Diskover
Posts: 213
Joined: Thu Nov 24, 2011 7:16 am
Contact:

Re: Seamless All-direction Scrolling

Post by Diskover » Sun Sep 10, 2017 4:46 am

tokumaru wrote:None of these boards support 4-screen name table layout. If you're soldering H and V tabs, that means you're using mirroring, and 4-screen is precisely the lack of mirroring.
Indeed, you're right. Even unsoldering H and V still did not work, therefore, these plates are not compatible with screen 4 mirror.

However, I tested with GTROM / Cheapocabras and if it works smoothly:

https://www.youtube.com/watch?v=MgiqSY10zzA

Post Reply