nesdev.com
http://forums.nesdev.com/

Assets for the Nesdev Compo 2016
http://forums.nesdev.com/viewtopic.php?f=22&t=14144
Page 2 of 2

Author:  Rahsennor [ Tue May 17, 2016 8:09 pm ]
Post subject:  Re: Assets for the Nesdev Compo 2016

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

Code:
   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:
  ldx #$81  ; Set outer bank
  stx $5000
  ldx #$FF  ; to the last bank in the cart
  stx $8000
  jmp ($FFFC)


Author:  tepples [ Tue May 17, 2016 8:27 pm ]
Post subject:  Re: Assets for the Nesdev Compo 2016

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:
  lda $FFFC
  cmp #<reset
  bne ShowQuitOptionOnTitleScreen

Author:  Rahsennor [ Tue May 17, 2016 8:40 pm ]
Post subject:  Re: Assets for the Nesdev Compo 2016

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

Author:  pubby [ Sun May 29, 2016 10:42 am ]
Post subject:  Re: Assets for the Nesdev Compo 2016

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.

Author:  Diskover [ Wed Oct 05, 2016 5:35 am ]
Post subject:  Re: Assets for the Nesdev Compo 2016

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.

Author:  dougeff [ Wed Oct 05, 2016 7:06 am ]
Post subject:  Re: Assets for the Nesdev Compo 2016

Sent you a PM.

Author:  na_th_an [ Wed Dec 21, 2016 3:11 am ]
Post subject:  Re: Assets for the Nesdev Compo 2016

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.

Author:  dougeff [ Sun Jan 15, 2017 11:26 pm ]
Post subject:  Re: Assets for the Nesdev Compo 2016

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:
;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

Author:  dougeff [ Mon Jan 16, 2017 11:35 am ]
Post subject:  Re: Assets for the Nesdev Compo 2016

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).

Author:  team_disposable [ Sat Jan 28, 2017 10:20 am ]
Post subject:  Re: Assets for the Nesdev Compo 2016

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!

Author:  na_th_an [ Mon Jan 30, 2017 5:30 am ]
Post subject:  Re: Assets for the Nesdev Compo 2016

You're welcome. Glad somebody found it useful.

Page 2 of 2 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/