Assets for the Nesdev Compo 2016

A place where you can keep others updated about your NES-related projects through screenshots, videos or information in general.

Moderator: Moderators

Rahsennor
Posts: 475
Joined: Thu Aug 20, 2015 3:09 am

Re: Assets for the Nesdev Compo 2016

Post by Rahsennor » Tue May 17, 2016 8:09 pm

This is silly I know, but will it work as intended for a UNROM game?

Code: Select all

	ldx #$FF
	stx $8000 ; select last PRG bank
	inx
	stx $5000 ; mapper 028 address $00 (CHR register)
	stx $8000 ; PRG bank 0 on UNROM, CHR bank 0 on 028
	inx
	stx $5000 ; restore mapper 028 address $01 (PRG register)
	ldx $BFFF ; 0 in bank 0, high byte of IRQ vector (>$C0) in last bank

	bmi ShowQuitOptionOnTitleScreen
To save others searching through the old threads:
tepples wrote:
thefox wrote:Just let me know what code to execute to reset to the multicart menu.
If a game is running in UNROM or 32K NROM mode, all it has to do is change the outer bank to the last bank. This can be done with the following code copied to RAM:

Code: Select all

  ldx #$81  ; Set outer bank
  stx $5000
  ldx #$FF  ; to the last bank in the cart
  stx $8000
  jmp ($FFFC)

tepples
Posts: 22014
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Assets for the Nesdev Compo 2016

Post by tepples » Tue May 17, 2016 8:27 pm

The easiest way to determine whether the game has been included in one of my multicarts is to compare $FFFC (the reset vector's low byte) to the expected value of the reset vector's low byte.

Code: Select all

  lda $FFFC
  cmp #<reset
  bne ShowQuitOptionOnTitleScreen

Rahsennor
Posts: 475
Joined: Thu Aug 20, 2015 3:09 am

Re: Assets for the Nesdev Compo 2016

Post by Rahsennor » Tue May 17, 2016 8:40 pm

I knew I had to be overcomplicating things. :roll:

User avatar
pubby
Posts: 553
Joined: Thu Mar 31, 2016 11:15 am

Re: Assets for the Nesdev Compo 2016

Post by pubby » Sun May 29, 2016 10:42 am

I got a PM requesting the source to that animation-to-assembly program so here it is:

animate.cpp: http://pastebin.com/raw/7m5QnWtp
color.hpp: http://pastebin.com/raw/a9EP7KFp
runs.s: http://pastebin.com/raw/febfK0nh

I didn't bother cleaning it up, so user beware.

Here's an example frame to use as input:

Image

It's intended to be used for the type of animations found in Mario 3.

User avatar
Diskover
Posts: 213
Joined: Thu Nov 24, 2011 7:16 am
Contact:

Re: Assets for the Nesdev Compo 2016

Post by Diskover » Wed Oct 05, 2016 5:35 am

I need help.

Through this neslib-unrom I'm making a game. I managed to play music, but I can not play sound SFX.

Does anyone know how you should do? For more examples and tutorials I've seen, some of Shiru itself, not seem to work the sound.

No that's wrong.

User avatar
dougeff
Posts: 2707
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: Assets for the Nesdev Compo 2016

Post by dougeff » Wed Oct 05, 2016 7:06 am

Sent you a PM.
nesdoug.com -- blog/tutorial on programming for the NES

na_th_an
Posts: 554
Joined: Mon May 27, 2013 9:40 am

Re: Assets for the Nesdev Compo 2016

Post by na_th_an » Wed Dec 21, 2016 3:11 am

I've updated the original post with a new revision of my tiny "Neslib for UNROM" package. I've used it successfully to produce the UNROM version of one of my compo entries (Lala the Magical).

Hope you find it useful.

User avatar
dougeff
Posts: 2707
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: Assets for the Nesdev Compo 2016

Post by dougeff » Sun Jan 15, 2017 11:26 pm

I know this is late, but maybe somebody can still use it for the Compo, or for any NES project.

This is a scanline counter sub-routine...

(Note: one scanline = 113.667 CPU cycles)

Code: Select all

;load x with amount of scanlines to wait, should not be zero

Scanline_counter:

	ldy #11	;2 (not included in cycle count till end)
-
	nop ; 2
	nop ; 2
	dey	; 2
;branch not taken requires two machine cycles. Add one if the branch is taken
	bne -	;3 (2 on last loop) =9*11-1...98

	txa ; 2 = 100
	lsr a ; 2 = 102 (set carry half of the time)
	bcc + ;2 or 3 (depending if branch taken) = 104/5
+
	nop ; 2 = 106/7
	dex	; 2 = 108/9
	bne Scanline_counter ;3 (2 on last loop) = 111/12
		; +2 (ldy at the top)=113/114 (as stated, one less on last loop) 
		
	rts ; overhead, not counted...6
	
; short about 1 cycle every 6 lines, not counting the overhead (113.5 vs 113.667)
; examples
;ldx #6 = 5.98 scanlines
;ldx #60 = 59.90 scanlines
;ldx #240 = 239.64 scanlines
nesdoug.com -- blog/tutorial on programming for the NES

User avatar
dougeff
Posts: 2707
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: Assets for the Nesdev Compo 2016

Post by dougeff » Mon Jan 16, 2017 11:35 am

I forgot to mention... this code absolutely can not cross a page boundary. It would be best to place it exactly at the start ($8000) of the ROM, so that any expansion won't accidrntally throw off the cycle count. (By putting half of the code in one page, and the other half in another, causing branches to take an extra cycle).
nesdoug.com -- blog/tutorial on programming for the NES

team_disposable
Posts: 118
Joined: Sat Oct 15, 2016 8:52 am

Re: Assets for the Nesdev Compo 2016

Post by team_disposable » Sat Jan 28, 2017 10:20 am

Hi Nathan,

Thanks for posting this - I used it last night to figure out how to implement tokumaru's LZSS routine. It's a really nicely designed layout.

Really useful, thanks!

na_th_an
Posts: 554
Joined: Mon May 27, 2013 9:40 am

Re: Assets for the Nesdev Compo 2016

Post by na_th_an » Mon Jan 30, 2017 5:30 am

You're welcome. Glad somebody found it useful.

User avatar
OscarRichard
Posts: 24
Joined: Sun Jul 29, 2012 9:58 am
Location: Mexico
Contact:

Re: Assets for the Nesdev Compo 2016

Post by OscarRichard » Sat Jul 11, 2020 5:01 pm

Hi, I know it's too late but in fact I passed my game to Unrom mapping in order to have more data space for levels and other stuff and it was useful.

However I'm actually having the same problem above. I can play music but can't play sfx sounds.
Does someone know what's wrong? What did you do guys?

Greetings.

User avatar
dougeff
Posts: 2707
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: Assets for the Nesdev Compo 2016

Post by dougeff » Sat Jul 11, 2020 6:33 pm

See your other thread.
nesdoug.com -- blog/tutorial on programming for the NES

Post Reply