Scroll glitches after binding it with button
Moderator: Moderators
Scroll glitches after binding it with button
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.
- Attachments
-
- 2scroll.png (3.16 KiB) Viewed 4767 times
-
- 1scroll.png (2.7 KiB) Viewed 4767 times
Re: Scroll glitches after binding it with button
Without seeing the actual code, we can only pretend to speculate what's really going on...
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
P.S. If you don't get this note, let me know and I'll write you another.
Re: Scroll glitches after binding it with button
oh yeh, ok)Quietust wrote:Without seeing the actual code, we can only pretend to speculate what's really going on...
here)
- Attachments
-
- controller.asm
- (54.7 KiB) Downloaded 123 times
Re: Scroll glitches after binding it with button
I could to take some parts of code but it's most of it. Don't think that i am so lazy pig:)
- mikejmoffitt
- Posts: 1353
- Joined: Sun May 27, 2012 8:43 pm
Re: Scroll glitches after binding it with button
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.
Code: Select all
NMI:
php
pha
lda #1
sta vbl_flag
pla
plp
rti
Code: Select all
Forever:
jsr main_logic
wait_nmi:
lda vbl_flag
beq wait_nmi
lda #0
sta vbl_flag
jsr ppu_updates
jmp Forever
Re: Scroll glitches after binding it with button
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?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: Select all
NMI: php pha lda #1 sta vbl_flag pla plp rti
This is just a suggestion for structure, not a singular way to do it.Code: Select all
Forever: jsr main_logic wait_nmi: lda vbl_flag beq wait_nmi lda #0 sta vbl_flag jsr ppu_updates jmp Forever
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.
- FrankenGraphics
- Formerly WheelInventor
- Posts: 2064
- Joined: Thu Apr 14, 2016 2:55 am
- Location: Gothenburg, Sweden
- Contact:
Re: Scroll glitches after binding it with button
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
http://wiki.nesdev.com/w/index.php/Programming_guide
Re: Scroll glitches after binding it with button
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.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.
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.
- mikejmoffitt
- Posts: 1353
- Joined: Sun May 27, 2012 8:43 pm
Re: Scroll glitches after binding it with button
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
Actually, there's more than enough NESASM examples. The real problem is that none of it's particularly well-known, or even in English!FrankenGraphics wrote:There isn't a wealth of NESASM examples and tutorials relatively to other/the total amount of material.
...and when it *is* in English-- Pong. Huh.
Re: Scroll glitches after binding it with button
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.
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
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((Alp wrote:Actually, there's more than enough NESASM examples. The real problem is that none of it's particularly well-known, or even in English!FrankenGraphics wrote:There isn't a wealth of NESASM examples and tutorials relatively to other/the total amount of material.
...and when it *is* in English-- Pong. Huh.
Re: Scroll glitches after binding it with button
You mean that my code hard to read?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.
Re: Scroll glitches after binding it with button
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
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?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.