This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Scroll glitches after binding it with button

Scroll glitches after binding it with button
by on (#202678)
After i use binding the increment of scroll wen character on some position right and right button pressed for all time i see normal scrolling like on screenshot1. But when i release button and press it again i see that some glitches with columns happens. Please help me to solve this problem.
Re: Scroll glitches after binding it with button
by on (#202679)
Without seeing the actual code, we can only pretend to speculate what's really going on...
Re: Scroll glitches after binding it with button
by on (#202685)
Quietust wrote:
Without seeing the actual code, we can only pretend to speculate what's really going on...


oh yeh, ok)
here)
Re: Scroll glitches after binding it with button
by on (#202686)
I could to take some parts of code but it's most of it. Don't think that i am so lazy pig:)
Re: Scroll glitches after binding it with button
by on (#202701)
I don't have time to have a look at your whole program and understand it at the moment, but I'm not liking how busy your NMI routine is. One better approach would be to use NMI to set a flag, and in your Forever loop, have it repeatedly check for this flag. If that flag is set, clear it, run a frame of logic, and then go back to waiting for the NMI flag.

Code:
NMI:
    php
    pha

    lda #1
    sta vbl_flag
   
    pla
    plp
    rti


Code:
Forever:
    jsr main_logic
wait_nmi:
    lda vbl_flag
    beq wait_nmi
    lda #0
    sta vbl_flag
    jsr ppu_updates
    jmp Forever


This is just a suggestion for structure, not a singular way to do it.
Re: Scroll glitches after binding it with button
by on (#202702)
mikejmoffitt wrote:
I don't have time to have a look at your whole program and understand it at the moment, but I'm not liking how busy your NMI routine is. One better approach would be to use NMI to set a flag, and in your Forever loop, have it repeatedly check for this flag. If that flag is set, clear it, run a frame of logic, and then go back to waiting for the NMI flag.

Code:
NMI:
    php
    pha

    lda #1
    sta vbl_flag
   
    pla
    plp
    rti


Code:
Forever:
    jsr main_logic
wait_nmi:
    lda vbl_flag
    beq wait_nmi
    lda #0
    sta vbl_flag
    jsr ppu_updates
    jmp Forever


This is just a suggestion for structure, not a singular way to do it.


Thank you so much man, I realy think that it could be much of work for NMI. Ofcource I don't wanna to waste your time at my begining and I just wanna to have some resourses where i can lern NESASM better. Can you please tell me some of this resourses where you lern NESASM? And other grate resourses like books may be?
My studing was only from lessons by bunnyboy and some web pages of 6502 ASM and they don't cover every needetble information.
I want to know more details of NESASM.
Re: Scroll glitches after binding it with button
by on (#202704)
There isn't a wealth of NESASM examples and tutorials relatively to other/the total amount of aterial, but the machine language is the same regardless if you use NESASM, nesicide, asm6, ophis, ca65 and so on, so any nes-specific resource will do. you just need to convert the syntax to NESASM style when trying out and modifying example snippets.

http://wiki.nesdev.com/w/index.php/Programming_guide
Re: Scroll glitches after binding it with button
by on (#202708)
mikejmoffitt wrote:
I don't have time to have a look at your whole program and understand it at the moment, but I'm not liking how busy your NMI routine is. One better approach would be to use NMI to set a flag, and in your Forever loop, have it repeatedly check for this flag. If that flag is set, clear it, run a frame of logic, and then go back to waiting for the NMI flag.

[...]

This is just a suggestion for structure, not a singular way to do it.

There is absolutely no requitement NOT having a busy NMI (if you know what you're doing) and your example is poor because you don't have to use php/plp in interrupts, the 6502 does it automatically. It could also do a "inc vbl_flag" so you wouldn't need to have a lda/sta pair here, nor a pha/pla pair.

The 3 approach exists - everything in NMI (as early Nintendo and Konami liked to do it), everything in main (what you're advocating and what Squaresoft liked to do it) and work split between main and NMI threads (what most NES games does, for example Capcom games does that but also later Nintendo games). I do not think any approach is inherently supperior to eachother. So this guy have a problem and you're telling him "you should go with everything in main". However you're not pointing to his problem at all - and invent an entierely new "problem" which isn't even one.

As for the original question, it looks like you are uploading a column of tiles at the wrong place. Be sure to log your VRAM updates.
Re: Scroll glitches after binding it with button
by on (#202709)
Bregalad wrote:
So this guy have a problem and you're telling him "you should go with everything in main". However you're not pointing to his problem at all - and invent an entierely new "problem" which isn't even one.


mikejmoffitt wrote:
This is just a suggestion for structure, not a singular way to do it.
Re: Scroll glitches after binding it with button
by on (#202775)
FrankenGraphics wrote:
There isn't a wealth of NESASM examples and tutorials relatively to other/the total amount of material.

Actually, there's more than enough NESASM examples. The real problem is that none of it's particularly well-known, or even in English!

...and when it *is* in English-- Pong. Huh. :?
Re: Scroll glitches after binding it with button
by on (#202778)
Logic and algorithms shouldn't change much from assembler to assembler, what varies greatly is the ROM organization, the way multiple banks are setup, variable declarations... but even in code written for the same assembler, a lot of that structural stuff can change depending on the coder's style.

One thing that can have a big impact on how assembly code looks is the heavy use of macros. I don't normally use macros for logic and algorithms, just for structuring things (e.g. variable management) and for hardware interactions (e.g. bankswitching), so except for the occasional syntax difference (label scopes, indirection, etc.), the logic I write should be easy to follow.
Re: Scroll glitches after binding it with button
by on (#202864)
Alp wrote:
FrankenGraphics wrote:
There isn't a wealth of NESASM examples and tutorials relatively to other/the total amount of material.

Actually, there's more than enough NESASM examples. The real problem is that none of it's particularly well-known, or even in English!

...and when it *is* in English-- Pong. Huh. :?

You know, Pong is not side scroller and it don't descripted well enough. For example, i think i perfectly read nerdy nights, but nowere i see how to turn of screen when you must to switch the game state from title screen to game screen. And in the sample of code bannyboy write that you must to do that. May be i am so stuped but i don't see any logical way/poionter in his lessons how to do that. I don't think that it's bad lessons, i thanks him so mutch, but this part realy missed((
Re: Scroll glitches after binding it with button
by on (#202866)
tokumaru wrote:
Logic and algorithms shouldn't change much from assembler to assembler, what varies greatly is the ROM organization, the way multiple banks are setup, variable declarations... but even in code written for the same assembler, a lot of that structural stuff can change depending on the coder's style.

One thing that can have a big impact on how assembly code looks is the heavy use of macros. I don't normally use macros for logic and algorithms, just for structuring things (e.g. variable management) and for hardware interactions (e.g. bankswitching), so except for the occasional syntax difference (label scopes, indirection, etc.), the logic I write should be easy to follow.

You mean that my code hard to read?
Re: Scroll glitches after binding it with button
by on (#202868)
No, I'm saying that you can still learn from code written for assemblers other than the one you use, as long as you're looking for actual game logic ideas and not ROM organization tips.
Re: Scroll glitches after binding it with button
by on (#202875)
tokumaru wrote:
No, I'm saying that you can still learn from code written for assemblers other than the one you use, as long as you're looking for actual game logic ideas and not ROM organization tips.

Yeah, it's grate) I just must to discover forum. But may be someone of you have a .asm file with opensource with full NES sidescrolling game?
Re: Scroll glitches after binding it with button
by on (#202885)
My cousin is making Nova the Squirrel and has put its source code on GitHub.
Re: Scroll glitches after binding it with button
by on (#202913)
tepples wrote:
My cousin is making Nova the Squirrel and has put its source code on GitHub.

Damn man! Its awesome! You know, this night i exactly look at his game, but i don't see source code in this forum. Realy cool side scroll, thank you and your cousin!))
Re: Scroll glitches after binding it with button
by on (#202915)
tepples wrote:
My cousin is making Nova the Squirrel and has put its source code on GitHub.

Oh, I saw that it's C language. I know this language but I wanna to make it in assembler((
Re: Scroll glitches after binding it with button
by on (#202916)
I'll give you .nes file of my game to better understending for you what happens with my game
Re: Scroll glitches after binding it with button
by on (#202927)
TeMaToS wrote:
tepples wrote:
My cousin is making Nova the Squirrel and has put its source code on GitHub.

Oh, I saw that it's C language. I know this language but I wanna to make it in assembler((

Which files are in C? The entire src folder (the game itself) is in assembly language, though some of the processes to convert things like images or audio to a format usable by the engine use tools written in C or Python that run on the PC when the game is built.
Re: Scroll glitches after binding it with button
by on (#202945)
tepples wrote:
TeMaToS wrote:
tepples wrote:
My cousin is making Nova the Squirrel and has put its source code on GitHub.

Oh, I saw that it's C language. I know this language but I wanna to make it in assembler((

Which files are in C? The entire src folder (the game itself) is in assembly language, though some of the processes to convert things like images or audio to a format usable by the engine use tools written in C or Python that run on the PC when the game is built.

Oh, grate. But how to compile this game? Can you tell me that please?

I believe that there is a side scrolling system writed by hends, without allready created programs.
Re: Scroll glitches after binding it with button
by on (#202956)
TeMaToS wrote:
Oh, grate. But how to compile this game? Can you tell me that please?

With ca65 and ld65 on the path, run mk.bat. I think the only C parts are the level editor, dialog compiler and table creator.
Re: Scroll glitches after binding it with button
by on (#202984)
NovaSquirrel wrote:
TeMaToS wrote:
Oh, grate. But how to compile this game? Can you tell me that please?

With ca65 and ld65 on the path, run mk.bat. I think the only C parts are the level editor, dialog compiler and table creator.

Hey!) I'ts you make Nova The Squirrel?)
Yes, I try to open this file, but in the window i see writes: "ca65" is not internal/external command. It's mean that I need to install ca65?
Re: Scroll glitches after binding it with button
by on (#202985)
NovaSquirrel wrote:
TeMaToS wrote:
Oh, grate. But how to compile this game? Can you tell me that please?

With ca65 and ld65 on the path, run mk.bat. I think the only C parts are the level editor, dialog compiler and table creator.

Looking at your game and manual in nesdev i think that I understand my problem. It's could consist in column drawing, i drow only one column when it's devide by 8, and I need to make two columns becose it better to align tiles with atributes. Ma be it's help to someone)
Re: Scroll glitches after binding it with button
by on (#203052)
HEY ALL GUYS!
I SOLVE MY PROBLEM!!
AMA MAZA-FAZA GENIOUS!!!

Ok, believe that my reply help to someone. The problem existed in deviding scroll by 8. In bunnyboy tutorial, the sample code has side scrolling system only when character always go right. So I sink that only removing increment of scroll to move button will gives a needeble effect. But it was wrong thing. Becouse you need to do increment in two places:
1) when the scroll get the 0 positions, becouse it makes always switching between NT.
2) Is when scroll divide by 8 to check new column, you must to increment scroll to or to disable infinity column drawings.

Thats all:)
Thanks for all you guys, who try to help me))))
It's realy awesome to speak with like-mind people!))