Search found 152 matches

by FinalZero
Fri Dec 02, 2011 5:08 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61216

Linker File: MEMORY { # Header HEADER: start = $0000, size = $0010, fill = yes, fillval = $00; # General Ram # ZEROPAGE: start = $0000, size = $0100; # STACK: start = $0100, size = $0100; RAM: start = $0200, size = $0600, fill = yes; EXTRA_RAM: start = $6000, size = $2000, fill = yes; # Prog Rom LOW...
by FinalZero
Fri Dec 02, 2011 4:56 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61216

The first thing that's wrong is that the CHR ROM data isn't last in the file, as it MUST be. Can you paste your revised linker script that fixes this problem? I am confused. Why must it be last? Looking at http://wiki.nesdev.com/w/index.php/MMC1 , it isn't listed last there. Edit: Okay, wait. I'm n...
by FinalZero
Fri Dec 02, 2011 1:43 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61216

Yeah, the 8KB is the only stuff that's backed up. And to use the back up function what you have to do is program your game/program to boot up and not clear the memory, but format it if need be and put someting in there to know it's been formatted and then use all the other data in the RAM as the st...
by FinalZero
Thu Dec 01, 2011 9:48 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61216

If you have only 16 or 32 KiB of PRG ROM and only 8 KiB of CHR, why are you using MMC1 and not just NROM? Is it just for the switchable nametable mirroring? I want to practice/try mirroring, yes. It's used for whatever programmers dissatisfied with the stock 2KB of RAM want. Many games put things l...
by FinalZero
Thu Dec 01, 2011 1:27 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61216

If you don't want to spend a lot of time fixing your linker script, I recommend just using the NROM project template that I linked, which has a known working linker script. I want to know why though. I don't want to just be cargo-cult programming. And your PRG ROM is in fact 16 KiB, as seen next: C...
by FinalZero
Wed Nov 30, 2011 6:56 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61216

Which assembler are you using again? If ca65, I have a project template that sets most of this up for you. ca65, yes. Also, I'm trying to use MMC1. To prevent IRQs from happening during the init code. True, the CPU already sets the interrupt priority bit to 1 (NMIs only) when coming out of reset, b...
by FinalZero
Wed Nov 30, 2011 3:23 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61216

2) Do not depend on the flags at the time of reset. You'll usually end up clearing X, S, and half of P in the first six instructions anyway. All you can be sure of is that PC points where $FFFC-$FFFD says. What do you mean "where $FFFC-$FFFD says."? How do I set where? Why are you setting...
by FinalZero
Wed Nov 30, 2011 12:53 am
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61216

Questions: 1) When linking, the ines header goes at $0000. To play the game on an emulator, does that mean that all the other segments must be offset by $10? That is, the zero page starts at $10 and ends at $110 instead of it's normal range? 2) On starting up, what's the status of all the flags? Is ...
by FinalZero
Mon Nov 28, 2011 8:08 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61216

It can't cross more than 1 page. "Crossing a page" means when you add an 8-bit value to a 16-bit value, it needs to change the high byte of the 16-bit value. The only time you see crossing a page penalties is in the instructions that add X or Y to an address, or the branch instructions. O...
by FinalZero
Mon Nov 28, 2011 7:54 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61216

The CPU doesn't know anything about "banks", so no. Pages are sections of 256 bytes. $8000 is the start of one page, $8100 is the start of the following page, for example. Some instructions take longer to execute when pages are crossed because the CPU needs more time in order to update th...
by FinalZero
Mon Nov 28, 2011 6:32 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61216

The carry flag and the overflow flag are entirely different things. In a way, the C flag can be used to detect unsigned overflow, while the V flag is used to detect signed overflows. If an addition causes a number to go past 255 and wrap back to 0 and up, that‘s an unsigned overflow, and the C flag...
by FinalZero
Mon Nov 28, 2011 12:22 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61216

ADC and SBC touch all flags NVZC. I mean, what is the condition that causes the overflow to be set for those instructions? Pretty much all NES games (except for a few obscure ones that almost nobody in my country probably has) use the NMI to detect the start of vertical blanking. Okay. What would S...
by FinalZero
Mon Nov 28, 2011 12:37 am
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61216

A couple more questions: 1) How does the overflow flag work with ADC and SBC? 2) If overflow occurs the carry bit is set What does this mean exactly? What if overflow does *not* occur, is the carry bit cleared then? or simply left untouched? 3) On the NES, interrupts are used to indicate the beginni...
by FinalZero
Sun Nov 27, 2011 5:35 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61216

I was watching http://www.youtube.com/watch?v=bBE4KHKzhKc . Can someone explain what he's explaining at 9:10? I don't understand what he's saying.
by FinalZero
Sat Nov 26, 2011 4:42 pm
Forum: Newbie Help Center
Topic: Hello World
Replies: 267
Views: 61216

That just means don't use the Indirect Jump instruction "JMP (nnnn)" with a value of nnnn that ends with FF. Your target address can still be anything with no problem. And the regular jump instruction "JMP nnnn" can have any jump target with no problem. But who programs with the...