Search found 16 matches
- Mon Mar 25, 2019 7:14 pm
- Forum: NESdev
- Topic: Setting inesprg to 2 makes game stop running
- Replies: 35
- Views: 17143
Re: Setting inesprg to 2 makes game stop running
When you boot up, you write $80 to $8000, resetting the MMC1. That sets the bank at $C000 to bank 15, and leaves the bank at $8000 undefined. Shortly afterwards, you write %110MM (M=mirroring) to the MMC1 at $8000, which sets the bank at $8000 to bank 0, and leaves the bank at $C000 undefined. At t...
- Mon Mar 25, 2019 2:11 pm
- Forum: NESdev
- Topic: Setting inesprg to 2 makes game stop running
- Replies: 35
- Views: 17143
Re: Setting inesprg to 2 makes game stop running
Fix bank at $8000 (for now) in prg and switch 4 kb at a time in chrlidnariq wrote:And what value do you want for the other bits that are set at the same time?
- Mon Mar 25, 2019 1:51 pm
- Forum: NESdev
- Topic: Setting inesprg to 2 makes game stop running
- Replies: 35
- Views: 17143
Re: Setting inesprg to 2 makes game stop running
Change the mirroring.lidnariq wrote:What are you trying to get the MMC1 to do? The behavior you're seeing is correct for the value you're writing...
- Mon Mar 25, 2019 1:42 pm
- Forum: NESdev
- Topic: Setting inesprg to 2 makes game stop running
- Replies: 35
- Views: 17143
Re: Setting inesprg to 2 makes game stop running
Done it it's when it reaches the last "sta $8000".tokumaru wrote:Step trough the code to see when exactly it changes to this.Jay John wrote:But after a frame it's like this
Code: Select all
ldhormir:
lda #%00011011
sta $8000
lsr a
sta $8000
lsr a
sta $8000
lsr a
sta $8000
lsr a
sta $8000
rts- Mon Mar 25, 2019 1:25 pm
- Forum: NESdev
- Topic: Setting inesprg to 2 makes game stop running
- Replies: 35
- Views: 17143
Re: Setting inesprg to 2 makes game stop running
Mesen's debugger literally tells you what banks are mapped to CPU and PPU memory. You should really pay attention to that and find where it ceases to be what you believe it should be. Already checked it, it's like this at the beginning: https://i.imgur.com/8M6uzSc.png But after a frame it's like th...
- Mon Mar 25, 2019 12:23 pm
- Forum: NESdev
- Topic: Setting inesprg to 2 makes game stop running
- Replies: 35
- Views: 17143
Re: Setting inesprg to 2 makes game stop running
This may be what's going wrong... The effect of writing to the MMC1 with the $80s bit set is to set both "P" bits , which sets a fixed bank at $C000-$FFFF equal to the last bank. You then immediately switch that to the fixed $8000-$BFFF configuration... so your code is probably going hayw...
- Sun Mar 24, 2019 7:42 pm
- Forum: NESdev
- Topic: Setting inesprg to 2 makes game stop running
- Replies: 35
- Views: 17143
Re: Setting inesprg to 2 makes game stop running
That's correct for 16 bytes + 2x 16KB + 4x 8KB, so it doesn't look like there's any big discrepancy between what you're trying to make and what the assembler is actually outputting. The best thing to do IMO would be to trace through your program in FCEUX or Mesen... Open the debugger, pause executi...
- Sun Mar 24, 2019 4:36 pm
- Forum: NESdev
- Topic: Setting inesprg to 2 makes game stop running
- Replies: 35
- Views: 17143
Re: Setting inesprg to 2 makes game stop running
65552 bytestokumaru wrote:How big is the final .NES file, in bytes?
- Sun Mar 24, 2019 11:12 am
- Forum: NESdev
- Topic: Setting inesprg to 2 makes game stop running
- Replies: 35
- Views: 17143
Re: Setting inesprg to 2 makes game stop running
I'm not an expert in NESASM, but I think you're supposed to use .rsset and .rs for declaring variables... I suspect that having .org $0000 and then .org $8000 in bank 0 is generating a lot of blank ROM data, which gets output to the final ROM, throwing bank sizes and addresses off. So, instead of d...
- Sun Mar 24, 2019 10:25 am
- Forum: NESdev
- Topic: Setting inesprg to 2 makes game stop running
- Replies: 35
- Views: 17143
Re: Setting inesprg to 2 makes game stop running
Can you show the complete structure of your source code? You can omit unrelated logic/data, but I'd like to see everything from the iNES directives, going through all the .banks and .orgs, mapper writes, reset stubs and interrupt vectors. It's hard to tell what's happening when looking at just bits...
- Sun Mar 24, 2019 9:19 am
- Forum: NESdev
- Topic: Setting inesprg to 2 makes game stop running
- Replies: 35
- Views: 17143
- Sat Mar 23, 2019 1:58 pm
- Forum: NESdev
- Topic: Setting inesprg to 2 makes game stop running
- Replies: 35
- Views: 17143
Re: Setting inesprg to 2 makes game stop running
Kinda, but not exactly... directives and general code organization change from assembler to assembler (e.g. most assemblers don't have a ".bank" directive). My main point is that, unlike NESASM, assemblers don't usually force the programmer to use a specific bank size, which is a good thi...
- Sat Mar 23, 2019 11:55 am
- Forum: NESdev
- Topic: Setting inesprg to 2 makes game stop running
- Replies: 35
- Views: 17143
Re: Setting inesprg to 2 makes game stop running
Let's get something out of the way: NESASM requires everything to be formatted with these stupid 8KB banks, but the NES itself has no concept of banks whatsoever, and MMC1 banks are 16KB, so the numbering you use for NESASM is not the same you'll use with the MMC1. NESASM banks 0 and 1 will be MMC1...
- Sat Mar 23, 2019 10:59 am
- Forum: NESdev
- Topic: Setting inesprg to 2 makes game stop running
- Replies: 35
- Views: 17143
Re: Setting inesprg to 2 makes game stop running
Have you already written to the register at $8000? If not, you should do that first. If yes, what did you write there? Last time I've written there is when I changed mirroring ldvermir: lda #$80 sta $8000 lda #%00011010 sta $8000 lsr a sta $8000 lsr a sta $8000 lsr a sta $8000 lsr a sta $8000 rts
- Sat Mar 23, 2019 10:38 am
- Forum: NESdev
- Topic: Setting inesprg to 2 makes game stop running
- Replies: 35
- Views: 17143
Re: Setting inesprg to 2 makes game stop running
You forgot to mention which assembler you're using, but from the above I guess it's NESASM?. Yes, that's correct. So, I added this in every bank and it now seems to be working. resetstub_entry: sei ldx #$FF txs stx $FFF2 jmp reset_handler .addr nmi_handler, resetstub_entry, irq_handler But I can't ...