It is currently Fri Oct 20, 2017 8:13 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 60 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject:
PostPosted: Mon Nov 21, 2005 4:59 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
Celius wrote:
FCEUXD ultra


I know I'm being picky here, but I've been noticing this for a while, and I must speak up. The name of the emu is "FCEUXD". The 'U' in that acronym is what stands for Ultra... so you don't need to put another 'ultra' at the end ;P

It's not working in Nintendulator because you have both the sprite and BG using the left pattern table ($2000 is always 00 or 80). For MMC3 IRQs to work normally, sprites must use the right pattern table and the BG must use the left ($2000.4 must be clear... and $2000.3 must be set)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 21, 2005 8:24 pm 
Offline
User avatar

Joined: Sun Jun 05, 2005 2:04 pm
Posts: 2131
Location: Minneapolis, Minnesota, United States
I'm sorry, you should have spoke up earlier, I didn't realize that, oops... But yeah, I flipped bit 3 on, and yes! it scrolls in Nintendulator! But! Still one more problem. Why isn't it waiting for as many scanlines as I'm telling it to? It's just doing a regular scroll, why isn't it waiting? I know it's really dumb to debug someone elses code, but do know that I really do appreciate it, and I really don't want to plop on my problems with the NES on you guys, so thank you guys so much! Really helful! :D


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 21, 2005 8:53 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3470
Location: Indianapolis
Are you writing the scroll only once per frame? Do the scroll write for the upper part of the screen in the NMI, and the lower part of the screen in the IRQ.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 21, 2005 10:27 pm 
Offline
User avatar

Joined: Sun Jun 05, 2005 2:04 pm
Posts: 2131
Location: Minneapolis, Minnesota, United States
Thank you! Oh it worked! Thanks! I don't have any problems now, but I'll come back if I do! This was so helpful! Thanks Tokumaru, Disch, Quietust, and all those people who posted here! You're awesome! Thanks! Bye!
:D :D :D :D !!!!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 22, 2005 4:15 pm 
Offline
User avatar

Joined: Sun Jun 05, 2005 2:04 pm
Posts: 2131
Location: Minneapolis, Minnesota, United States
Okay, I really didn't want to come back here, and post, but I must. How can you use scanline counters to do like a scroll for the upper 3rd of the screen, have it stopped in the middle 3rd, and scroll another way for the bottom half. I was trying to do this by resetting the counter in my IRQ, but that has no effect. Any ideas? Don't have to go too in to detail, I just want the general idea. Okay? Thanks! I really appreciate it! :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 22, 2005 5:42 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 22, 2005 7:43 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10065
Location: Rio de Janeiro - Brazil
You'll have to set up the counter, exactly as you did in the NMI, in the first IRQ too.

But remember there is only one IRQ routine, that will be called once for the first split and once more for the second split. So you'll have to make up a way to tell them apart. I suggest using indirect jumping.

You can set up 2 routines in addition to the IRQ one:
Code:
IRQ:
   STA $E000   ;acknowledge the interrupt
   JMP (SPLIT)   ;jump to the desired split routine
SPLIT1:
   ;here you do the FIRST change to the scroll registers
   ;AND set up the second IRQ, as you did with the first in the NMI
   ;AND update SPLIT to point to SPLIT2, like this:
   LDA #<SPLIT2
   STA SPLIT+0
   LDA #>SPLIT2
   STA SPLIT+1
   ;don't forget to push and pull A if you use it in an IRQ
   RTI   ;return from the interrupt
SPLIT2:
   ;here you do the SECOND change to the scroll registers
   ;if you want, you can set the jump address back to SPLIT1 or you can do it in the NMI, when you first set the counter, wich I think is best
   RTI   ;return from the interrupt


Oh, in the example, SPLIT is an address in RAM, working as a pointer.

I guess this is it...

EDIT:
Here I wrote something stupid about beeing able to use the same IRQ routine for both splits... but then I realized I was wrong and wrote the following:

Actually... you're not doing the exact same thing... you don't want to set up the counter the second time. Well, you may need to split your code after all....


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 23, 2005 4:45 pm 
Offline
User avatar

Joined: Sun Jun 05, 2005 2:04 pm
Posts: 2131
Location: Minneapolis, Minnesota, United States
Oh man! Thank you so much once more! Okay, this question does not have to be answered right now, this isn't why I posted. I was wondering how you could wait half a scanline, and keep half of a row still, and have the other side scroll over it. Do you know? Well, that's not the main reason I posted, I want you to see my parralax demo on my site! I was so proud when I made it. I know you guys will think "Gee, he could have just used the "adc" instruction to do this" when you see that I do things like: inc <30 inc <30 inc <30 or something, but I really wanted to have nothing to do with the carry flag. I really hate the carry flag. But I just wanted to show you guys I understand, and you've been very helpful, and thanks for everything! I hope you like it! Perhaps you could give it a rating from 0 to 10. I really won't be offended if you think it sucks. Just tell me what you think! I really like it, it's cool! to me at least. Okay, well, thanks again! Bye! :D


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 23, 2005 5:31 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
Celius wrote:
I was wondering how you could wait half a scanline, and keep half of a row still, and have the other side scroll over it. Do you know?


If you mean split the screen vertically.. the short answer is: you can't.

The only practical way to do it is to use MMC5's split screen feature... and even that is extremely limited in what it can do.

Now... I'm going to get a little mean...but don't take it the wrong way:

Quote:
I know you guys will think "Gee, he could have just used the "adc" instruction to do this" when you see that I do things like: inc <30 inc <30 inc <30 or something, but I really wanted to have nothing to do with the carry flag. I really hate the carry flag.


I really think you should focus more on these basic areas before diving into the more advanced areas you're going in. You're trying to cover too much ground in one swoop. You really need to slow down.

You're asking questions about how to do these things... and when they're answered, you don't understand so you need us to go more in depth. But I don't think the reason you don't understand is because we didn't go in enough depth the first time... it's because you don't have the fundamentals down.

For example... this thread started simple enough -- "how do you do split-screen effects". A reasonable question... and not such a horribly complex topic to go over -- but the thread has expanded to 4 pages and over 50 replies because in order to tell you how to split the screen we've had to go over everything from interrupts, frame layout, CPU cycles, CPU/PPU interaction, RTI vs. RTS, and a dozen other topics... most of which you should probably already have been familiar with.

I know I'm being harsh... and I know you don't like to hear this... but it's true. You really need to slow it down. Touching a little bit of everything and making a demo that looks nifty doesn't mean a thing unless you understand what it is you're doing... and I get the distinct impression that you don't completely understand it.

Seeing you here talking about how your simple "hello world" demos are randomly locking on bad opcodes.. and how you still have trouble with performing simple addition... and then seeing you asking all these questions about such advanced topics... it's no wonder you're having such a hard time with it. You're trying to run before you've learned to crawl.

So yeah... hold off on these tricks. Make some simple games. I know I've said it before.. but I really feel it's what will help you the most.

I really don't mind helping... but if answering a question is going to involve a complete lecture/tutorial on NES workings... even I'm going to get worn out.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 23, 2005 6:45 pm 
Offline
User avatar

Joined: Sun Jun 05, 2005 2:04 pm
Posts: 2131
Location: Minneapolis, Minnesota, United States
Okay, I know I'm going too fast. And just for the record, RTS was a typo, I did not intend for RTS, I know RTI vs. RTS. And in real life I need things to be explained really well. I don't pick up on things REALLY easy. Like if something is slightly vague when explained to me, I will gather the completely wrong information about what was explained to me . Or I'm afraid I will. And what I meant for half the ROW scrolling over the other half of the row, is like those moving wooden platforms on mario 3, you know? But I don't need to learn how to do that yet. I need to do simpler things. I do know how to do simple addition, it's just like the whole CLC thing and SEC thing really get on my nerves. And it just turns out that the C flag is set even if I do a CLC, and I don't know what's happening. So I'm really not as dumb as I seem. Or maybe I am. I don't know. Okay, I'm going to go now.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 23, 2005 7:57 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19112
Location: NE Indiana, USA (NTSC)
Celius wrote:
And what I meant for half the ROW scrolling over the other half of the row, is like those moving wooden platforms on mario 3, you know?

Moving platforms in SMB1, flying carpets in SMB2, and moving wooden platforms in SMB3 are sprites.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 23, 2005 8:23 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10065
Location: Rio de Janeiro - Brazil
Celius wrote:
And it just turns out that the C flag is set even if I do a CLC

Now that is just impossible. There is no way that will ever happen. You must be doing something that affects the carry after the CLC. A shift maybe... there is something *seriously* wrong here! Maybe you're changing it in your NMI, something IS happening.

Take some time to study the carry flag. Use a simulator, there is no need to build a whole ROM for that. Play with the simulator and with the instructions that affect the carry for about 15 minutes and you'll understand it all. Trust me.

You absolutelly need to learn these things. You keep dodging from simple stuff just to get to the goooooood part soon. Just learn about the carry flag already. We'll gladly answer any questions you have.

There is no dumb question. Anyone here will be more than glad to answer the most basic of the questions. In fact, I believe it is much more pleasant than going forever with these huge threads.

ps: I'l check your demo soon, I'm in the middle of a major reconfiguration of my system!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 23, 2005 9:11 pm 
Offline
User avatar

Joined: Sun Jun 05, 2005 2:04 pm
Posts: 2131
Location: Minneapolis, Minnesota, United States
Well, thank you tokumaru. I will go play with the simulator! I have a simulator you reccomended, but I'm not to familiar with it. Don't you have to type in a whole bunch of code anyways just to get it to run? I don't know. But yeah, I can't beleive I didn't think about them being sprites on mario 1, 2, and 3! Okay, I'm really not that dumb, I just don't know why I didn't think of that! That is so dumb! Yeah, well, I'm going to go now. I think I'll start on my simplest "big" project now. It's a really simple game I've been putting off. It's like pacman, but a little different. Okay, bye.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 24, 2005 3:58 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10065
Location: Rio de Janeiro - Brazil
Celius wrote:
Don't you have to type in a whole bunch of code anyways just to get it to run?

Not at all. The only thing needed before any code is a ".ORG" followed by an address, so the simulator can have any idea of where to start running the code from.

It is in fact really easy to use. You don't have to set the vectors, or any of these things... just ".ORG" some address and start coding. Of course it supports more advanced and detailed stuff, but they are not required. I use it as an assembler, I do all my dev'ing there, since it can output binary data.

Anyway, it has a nice status window that shows all registers, flags, etc, has a memory window, a step by step option when running the code... I learned a LOT whith it. When I first started I also didn't get the carry and other flags very well, but after playing with the simulator a bit it was all very clear to me.

After you type the code, look for 2 buttons in the toolbar that are next to each other: one assembles the code, and the other debugs it. If there were no assembling errors, the debug button will become active, and you then can press it and see all the debugging windows I told you about, and there is a button in the toolbar that will run the code instruction by instruction so you can really see what's happening.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 24, 2005 8:12 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10065
Location: Rio de Janeiro - Brazil
Hi Celius
I'm writing to tell you I saw your demo. It looks pretty cool, with the many scroll layers it looks pretty 3D. Is the thing by the bottom (I don't know if it's a sidewalk, or maybe rails?) supposed to split in half? It does add some 3D, but also looks a bit weird.

I just got a little scared when I looked at the source code. I remember some time ago, when you used to ask about the "reliable" way of doing things, you seemed to be pretty worried about writing "reliable" (you used that word a LOT! hehe) code. But your demos seem to have a lot of unreliable details in them.

For example, someone in this thread told you to push/pull the registers you modify in the NMI and IRQ routines (as both fire off at unexpected times during code execution, and simply changing these registers may screw up the logic when the routine ends). You did this in the NMI right, you saved all 3 registers and restored them at the end. But in the IRQ you saved only register A and right after that you destroyed X. Couldn't you just have done the compares using only the A register?

In your demo this will not create big problems, since your NMI code is small and the IRQ will hardly fire off while other code is running besides your infinite loop. However, when projects get bigger, code will be interrupted in favour of IRQ's, you'll destroy registers you were using, the thing will screw up and you'll not know why. And you'll get very frustrated, kicking your PC 'cause you don't know what's going on.

You understand the concept of NMI's and IRQ's, right? You understand that other code is interrupted for them to run? And that when you exit these routines you must leave everything as it was when the routine started, so that the code that was interrupted can continue to run normally?

Well, I got a bit offtrack here, but, back to the subject, the demo looks cool. I hope to see more nice effects using split screens comming from you. Keep it going.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 60 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC - 7 hours


Who is online

Users browsing this forum: AWJ and 6 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