It is currently Wed Nov 22, 2017 1:28 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Thu Aug 17, 2017 2:21 am 
Offline
User avatar

Joined: Tue Aug 08, 2017 1:25 pm
Posts: 20
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
2scroll.png [ 3.16 KiB | Viewed 890 times ]
1scroll.png
1scroll.png [ 2.7 KiB | Viewed 890 times ]
Top
 Profile  
 
PostPosted: Thu Aug 17, 2017 4:58 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1392
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.


Top
 Profile  
 
PostPosted: Thu Aug 17, 2017 8:09 am 
Offline
User avatar

Joined: Tue Aug 08, 2017 1:25 pm
Posts: 20
Quietust wrote:
Without seeing the actual code, we can only pretend to speculate what's really going on...


oh yeh, ok)
here)


Attachments:
controller.asm [54.7 KiB]
Downloaded 24 times
Top
 Profile  
 
PostPosted: Thu Aug 17, 2017 8:12 am 
Offline
User avatar

Joined: Tue Aug 08, 2017 1:25 pm
Posts: 20
I could to take some parts of code but it's most of it. Don't think that i am so lazy pig:)


Top
 Profile  
 
PostPosted: Thu Aug 17, 2017 2:39 pm 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1311
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.


Top
 Profile  
 
PostPosted: Thu Aug 17, 2017 2:50 pm 
Offline
User avatar

Joined: Tue Aug 08, 2017 1:25 pm
Posts: 20
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.


Top
 Profile  
 
PostPosted: Thu Aug 17, 2017 3:11 pm 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1017
Location: Gothenburg, Sweden
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://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
PostPosted: Thu Aug 17, 2017 11:32 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7272
Location: Chexbres, VD, Switzerland
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.


Top
 Profile  
 
PostPosted: Fri Aug 18, 2017 12:43 am 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1311
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.


Top
 Profile  
 
PostPosted: Sat Aug 19, 2017 6:25 am 
Offline
User avatar

Joined: Mon Oct 06, 2014 12:37 am
Posts: 186
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. :?


Top
 Profile  
 
PostPosted: Sat Aug 19, 2017 7:09 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10117
Location: Rio de Janeiro - Brazil
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.


Top
 Profile  
 
PostPosted: Sun Aug 20, 2017 3:25 pm 
Offline
User avatar

Joined: Tue Aug 08, 2017 1:25 pm
Posts: 20
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((


Top
 Profile  
 
PostPosted: Sun Aug 20, 2017 3:31 pm 
Offline
User avatar

Joined: Tue Aug 08, 2017 1:25 pm
Posts: 20
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?


Top
 Profile  
 
PostPosted: Sun Aug 20, 2017 3:40 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10117
Location: Rio de Janeiro - Brazil
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.


Top
 Profile  
 
PostPosted: Sun Aug 20, 2017 4:34 pm 
Offline
User avatar

Joined: Tue Aug 08, 2017 1:25 pm
Posts: 20
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group