It is currently Thu Nov 23, 2017 5:44 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Tue May 17, 2016 8:09 pm 
Offline

Joined: Thu Aug 20, 2015 3:09 am
Posts: 288
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)



Top
 Profile  
 
PostPosted: Tue May 17, 2016 8:27 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19251
Location: NE Indiana, USA (NTSC)
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


Top
 Profile  
 
PostPosted: Tue May 17, 2016 8:40 pm 
Offline

Joined: Thu Aug 20, 2015 3:09 am
Posts: 288
I knew I had to be overcomplicating things. :roll:


Top
 Profile  
 
PostPosted: Sun May 29, 2016 10:42 am 
Offline
User avatar

Joined: Thu Mar 31, 2016 11:15 am
Posts: 211
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.


Top
 Profile  
 
PostPosted: Wed Oct 05, 2016 5:35 am 
Offline

Joined: Thu Nov 24, 2011 7:16 am
Posts: 163
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.


Top
 Profile  
 
PostPosted: Wed Oct 05, 2016 7:06 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1832
Location: DIGDUG
Sent you a PM.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Wed Dec 21, 2016 3:11 am 
Offline

Joined: Mon May 27, 2013 9:40 am
Posts: 356
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.

_________________
http://www.mojontwins.com


Top
 Profile  
 
PostPosted: Sun Jan 15, 2017 11:26 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1832
Location: DIGDUG
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

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Mon Jan 16, 2017 11:35 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1832
Location: DIGDUG
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


Top
 Profile  
 
PostPosted: Sat Jan 28, 2017 10:20 am 
Offline

Joined: Sat Oct 15, 2016 8:52 am
Posts: 79
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!


Top
 Profile  
 
PostPosted: Mon Jan 30, 2017 5:30 am 
Offline

Joined: Mon May 27, 2013 9:40 am
Posts: 356
You're welcome. Glad somebody found it useful.

_________________
http://www.mojontwins.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2

All times are UTC - 7 hours


Who is online

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