It is currently Sat Nov 18, 2017 5:22 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 109 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8  Next
Author Message
PostPosted: Mon Feb 06, 2017 11:28 am 
Offline

Joined: Sat Feb 21, 2009 12:45 pm
Posts: 8
Extremely excited for this. Demo works great for me. :)


Top
 Profile  
 
PostPosted: Mon Feb 06, 2017 11:59 am 
Offline
User avatar

Joined: Sat May 31, 2014 4:12 pm
Posts: 139
rainwarrior wrote:
That doesn't change anything for me, in any of the emulators I just mentioned.

It does seem to run in an older version of FCEUX though. (2.2.2)


That's the version I have. What would cause it not to run in the latest version but still run in 2.2.2? Maybe something involving initialization or MMC5 maybe...?


Top
 Profile  
 
PostPosted: Mon Feb 06, 2017 12:15 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5822
Location: Canada
It seems to run on 2.2.3 if I switch to "Old PPU".

The new PPU is supposed to be much more accurate, but I'm not sure specifically in what ways.

The default setting is old PPU, but I think it's mainly that way to provide support for legacy TAS etc. that relies on its behaviour. If you're trying to develop new software, you would probably want to use new PPU.


Top
 Profile  
 
PostPosted: Mon Feb 06, 2017 12:28 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6440
Location: UK (temporarily)
Briefly playing around with Mesen ....

You've somehow managed to spin, waiting for a sprite 0 hit in your NMI before you've successfully uploaded sprites the first time.

(Why are you using a sprite 0 hit on a mapper with IRQs?)


Top
 Profile  
 
PostPosted: Mon Feb 06, 2017 12:47 pm 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1010
Location: Gothenburg, Sweden
Did a random button mashing/holding stress test. Holding a or b means retrigging their corresponding actions. Checking for a previously recorded release in order to re-perform the action may help against these odd-looking movement patterns.

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
PostPosted: Mon Feb 06, 2017 4:38 pm 
Offline
User avatar

Joined: Sat May 31, 2014 4:12 pm
Posts: 139
lidnariq wrote:
Briefly playing around with Mesen ....

You've somehow managed to spin, waiting for a sprite 0 hit in your NMI before you've successfully uploaded sprites the first time.

(Why are you using a sprite 0 hit on a mapper with IRQs?)


I've never used IRQs before. I just looked up on Nerdy Nights how to get a horizontal banner that doesn't scroll with the background. Not sure how to implement IRQs. Sounds like I should switch. I bet it would be easier to do other effects too. Any thoughts?


Top
 Profile  
 
PostPosted: Mon Feb 06, 2017 4:50 pm 
Offline
User avatar

Joined: Sat May 31, 2014 4:12 pm
Posts: 139
FrankenGraphics wrote:
Did a random button mashing/holding stress test. Holding a or b means retrigging their corresponding actions. Checking for a previously recorded release in order to re-perform the action may help against these odd-looking movement patterns.


That's an easy fix. I also want to randomize the sprites selected during the spin move so spin moves look more realistic. Also, when a player jumps out of bounds, the ball needs to be placed where the ball was last in bounds, not where the player landed. I need to find a good football whistle sound so people know the play is dead. Should just use a quick tone for now. I have not implemented a ball yet so this is on the back burner for now. Each sprite will have an assumed placement of the ball at that moment so touchdowns are detected when the ball crosses the plain etc.

I've spent so much energy on field logos and helmets that I'm excited to get back to programming football physics.


Top
 Profile  
 
PostPosted: Mon Feb 06, 2017 6:34 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6440
Location: UK (temporarily)
raydempsey wrote:
I've never used IRQs before. [...] Not sure how to implement IRQs. Sounds like I should switch. I bet it would be easier to do other effects too. Any thoughts?
It's basically just like the NMI handler, but rather than only happening at the very top of the frame, in the MMC5's case, you instead tell it to start an IRQ at scanline N. I'm not certain what a programmed value of "0" means here. It could mean the prerender scanline ... or it could mean something else.

You also need to explicitly acknowledge the IRQ source in the IRQ handler (i.e. read $5204), whereas NMIs don't need to be.

(As contrast, the MMC3 starts an IRQ after N scanlines have passed)


Top
 Profile  
 
PostPosted: Tue Feb 07, 2017 8:54 am 
Offline
User avatar

Joined: Sat Mar 30, 2013 12:24 am
Posts: 258
It's looking good. I especially like the sprite animation. However, the text at the top would definitely be (at least partially) cropped on my old CRT.

_________________
www.mteegfx.com


Top
 Profile  
 
PostPosted: Tue Feb 07, 2017 11:19 am 
Offline

Joined: Sun May 03, 2015 8:19 pm
Posts: 89
If the wiki is right then

"
IRQ Counter ($5203) = All eight bits specify the scanline number to generate IRQ at

When the MMC5 detects a scanline, the following events occur:
if the In Frame signal is clear, set it, reset the IRQ counter to 0, and clear the IRQ Pending flag
otherwise, increment the IRQ counter. If it now equals the IRQ scanline ($5203), raise IRQ Pending flag

Note the above logic makes it impossible for an IRQ to occur when $5203 (IRQ counter) is set to $00"

I'm pretty sure when I did my MMC3 to MMC5 conversion I remember I had to change almost all the places where it was loading a 00 into the IRQ register into 01's.


Top
 Profile  
 
PostPosted: Wed Feb 08, 2017 2:22 pm 
Offline
User avatar

Joined: Sat May 31, 2014 4:12 pm
Posts: 139
hackfresh wrote:
If the wiki is right then

"
IRQ Counter ($5203) = All eight bits specify the scanline number to generate IRQ at

When the MMC5 detects a scanline, the following events occur:
if the In Frame signal is clear, set it, reset the IRQ counter to 0, and clear the IRQ Pending flag
otherwise, increment the IRQ counter. If it now equals the IRQ scanline ($5203), raise IRQ Pending flag

Note the above logic makes it impossible for an IRQ to occur when $5203 (IRQ counter) is set to $00"

I'm pretty sure when I did my MMC3 to MMC5 conversion I remember I had to change almost all the places where it was loading a 00 into the IRQ register into 01's.


I am not familiar at all with working with IRQ's. All I know is they are interrupt requests and I think it's related to creating a stationary banner. Does anyone have some sample code and a little on how it's used?


Top
 Profile  
 
PostPosted: Wed Feb 08, 2017 2:37 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6440
Location: UK (temporarily)
For your purposes, I think you should just be able to have an IRQ that does something like
Code:
PHA
TXA
PHA
LDA $5204 ; acknowledge IRQ
LDA #0
STA $5204 ; MAYBE UNNECESSARY - disable IRQ so that it won't happen later unless it was re-enabled every vblank in the NMI)
LDA shadow_nametable
STA $2006
LDA shadow_Y
STA $2005
(insert some specific delay here so that the scroll split will happen at the right place on-screen)
LDX shadow_X
LDA shadow_last
STX $2005
STA $2006
PLA
TAX
PLA
RTI


In your main thread, make sure you've disabled other sources of IRQs (APU frame counter and DMC completion), told the 6502 to listen to IRQs (CLI), and in your NMI, tell the MMC5 to start the IRQ at the right scanline (LDA #something / STA $5203) and tell the MMC5 to enable IRQs (LDA #$80 / STA $5204)


Top
 Profile  
 
PostPosted: Sat Jun 24, 2017 4:13 am 
Offline
User avatar

Joined: Sat May 31, 2014 4:12 pm
Posts: 139
I need to convert from a Sprite 0 hit banner to a banner created from an IRQ using the MMC5. I'd like the top part of the screen to be scrolled 0 pixels to the right, and I'd like the bottom part scrolled n pixels to the right. I've experimented with the code suggested by lidnariq but I'm not sure where to put it. Here is my init code:
Code:
RESET
   lda #3
   sta $5100
   lda #3
   sta $5101   ; CHR mode 8 separate 1K banks
   lda #1
   sta $5104   ; extended RAM mode 1
   lda #$F4
   sta $5105   ; nametable mapping
   lda #$80
   sta $5114   ; bank 0 to $8000
   lda #$81
   sta $5115   ; bank 1 to $A000
   lda #1
   sta $5130
   lda #$04
   sta $5120   ; Sprite 0
   lda #$00
   sta $5121   ; Sprite 1 blank
   sta $5122   ; Sprite 2 blank
   lda #$14
   sta $5123   ; Sprite 3
   lda #0
   sta $5130
   lda #$1
   sta $5203   ; IRQ counter
   sei         ; disable IRQs
   cld         ; disable decimal mode
   ldx #$40
   stx $4017   ; disable APU frame IRQ
   ldx #$FF
   txs         ; Set up stack
   inx
   stx $2000   ; disable NMI
   stx $2001   ; disable rendering
   stx $4010   ; disable DMC IRQs
   lda #%00011111
   sta $4015


Here is my last VBlank write:
Code:
   lda #0
   sta $2006
   sta $2006
   sta $2005
   sta $2005
   lda #%10010100
   sta $2000
   lda #%00011110
   sta $2001
     - lda $2002
      and #%01000000
      bne -
     - lda $2002
      and #%01000000
      beq -
   ldx #10
     - dex
      bne -
   lda screen
   clc
   and #%00000001
   adc #%10010100
   sta $2000
   lda scroll
   sta $2005
   lda #80
   sta $2005
   rts


I need to know EXACTLY what code needs to changed or be added here to make the banner happen. I guess it has something to do with writing a value to $5203 and waiting to detect something from $5204 but I don't know where it should happen.


Top
 Profile  
 
PostPosted: Sat Jun 24, 2017 11:57 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6440
Location: UK (temporarily)
raydempsey wrote:
I've experimented with the code suggested by lidnariq but I'm not sure where to put it.
Somewhere in your fixed bank, and the IRQ vector should point to it (next to the NMI and RESET vectors).

After than, setting up IRQs should be as simple as:

* In your main thread:
CLI

* In your NMI
lda #scanline_to_generate_IRQ_at
sta $5203
lda #$80
sta $5204


Top
 Profile  
 
PostPosted: Tue Jun 27, 2017 4:54 pm 
Offline
User avatar

Joined: Sat May 31, 2014 4:12 pm
Posts: 139
Code:
VBlankFieldEnd
   lda #31
   sta $5203
   lda #$80
   sta $5204
   lda screen
   clc
   and #%00000001
   adc #%10010100
   sta $2000
   lda #%00011110
   sta $2001
   lda #0  ;<-------------------- A
   sta $2005
   lda #0  ;<-------------------- B
   sta $2005
   rts

Above is my last-writes code for NMI.
Code:
IRQ
   pha
   txa
   pha
   tya
   pha
   lda $5204
   lda #0
   sta $5204
   lda #0  ;<--------------- C
   sta $2006
   lda #0  ;<--------------- D
   sta $2005
   ldy #10
   -   dey
      bne -
   lda #0  ;<--------------- E
   sta $2005
   lda #0  ;<--------------- F
   sta $2006
   pla
   tay
   pla
   tax
   pla
   rti

Above is my IRQ code.

I have been trying unsuccessfully to create a banner. I don't know what the values in A thru F mean. I tried experimenting and I still don't get it. What should I do to make it so I have a banner that starts 32 scanlines down where the top has no vert or horiz scroll while the last of the scanlines look shifted to the right n pixels. What do A thru F mean and what should I put where? What am I doing wrong?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 109 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 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:  
cron
Powered by phpBB® Forum Software © phpBB Group