177

(33 replies, posted in Nintendo Consoles)

It's because the NMI never gets triggered. You need to enable NMIs through the PPU Control Register 1 ($2000). To enable the NMI you just set bit 7. Put this somewhere before the LOOP;

lda #$80
sta $2000

The PPU control registers do a lot more so you should be familiar with the various functions they provide;

http://nesdev.parodius.com/NinTech.txt

(near the bottom of the page is a table listing what each bit of PPU 1/2 Control and PPU Status does)

It's also common practice to 'acknowledge' the NMI in your NMI code by 'reading' the PPU Status Register ($2002)

bit $2002

at the start of the NMI.

Something else you should do in the NMI is save the contexts of the A, X and Y registers - this is because the NMI can occur at any point in your background loop and once the NMI has finished, the register contents could have been changed. You use the stack instructions PHA and PLA.

NMI:
    pha                ;push A onto stack
    txa                ;transfer X to A
    pha                ;push A onto stack
    tya                ;transfer Y to A
    pha                ;push A onto stack

    bit $2000                ;acknowledge interrupt
   
    ;do other stuff

    pla                ;pull top of stack to A
    tay                ;transfer A to Y
    pla                ;pull next by off stack to A
    tax                ;transfer A to X
    pla                ;pull A off stack
    rti

The stack is a LIFO buffer (last in, first out) so you restore the registers in the reverse order to what you saved them. Because you can only push (PHA) and pull (PLA) a value to/from the A register, in order to save the content of X and Y you transfer them to the accumulaor (A) first when saving, and then reverse the procedure for restoring.

Edited to add:

In fact, most people clear the two PPU Control registers at the start of the reset code too:

PPU0 EQU $2000
PPU1 EQU $2001

RESET:
    sei
    lda #$00
    sta PPU0
    sta PPU1
    ldx #$FF
    txs
    
    etc.

178

(33 replies, posted in Nintendo Consoles)

LOL just spotted a schoolboy error - I'd wrote 'sta WRAM,y' instead of 'sta WRAM,x'

Fixed now smile

179

(33 replies, posted in Nintendo Consoles)

I realised afterwards that some of that might be confusing (or that your code for the Chords program is set up a little differently) - I wanted to give you something that would compile and work in ASM6 (I guessed that was what you used?)

Really, the only parts you need that can be transplanted in your own code is setting bit 1 of the 6th header byte and then knowing you just read/write addresses $6000-$7FFF to access the battery RAM. The rest of my example is just reset code and the necessary layout to make a working ROM.

180

(33 replies, posted in Nintendo Consoles)

Actually, turns out you don't even need MMC1 (in Nestopia at least). Here's some bare-bones code that will write 00-FF in the first 256 bytes of a .sav file. The key part is setting bit 1 of the 6th byte of the iNES header (http://wiki.nesdev.com/w/index.php/INES)

                ;NES Header
                DB "NES",$1A
                DB 2            ;number of PRG ROMs
                DB 0            ;number of CHR ROMs
                DB %00000010    ; BIT 1 = enable(1)/disable(0) battery RAM
                DB %00000000
                DB 0,0,0,0,0,0,0,0

WRAM            EQU $6000
                
                .ORG $8000
RESET           sei
                ldx #$FF
                txs

                ldx #$00
@a              txa
                sta WRAM,x
                inx
                bne @a

LOOP            jmp LOOP

NMI             RTI

IRQ             RTI

                ORG $FFFA
                DW NMI,RESET,IRQ
                

181

(33 replies, posted in Nintendo Consoles)

nickmaynard wrote:

hey neil, i want to make a nintendo program that has a sav file, are there any good tutorials or resources online that you can point me to that will help me figure this out?

It's fairly straightforward - you need to change your ROM configuration to use MMC1 mapper (I think that's the minimum you need mapper-wise) and you'll need to change the ROM header. After that, NVRAM (battery-backed RAM) is mapped at $6000-$7FFF and you can just read and write to it like normal RAM.

I'll send you some code.

182

(14 replies, posted in Nintendo Consoles)

It all centres around the 32KB battery file requirement;

http://blog.ntrq.net/?p=428

Originally PowerPak didn't work either but Brian went out of his way to look into the issue and provide me with a mapper update (which I currently supply with Pulsar until it's officially released via Retrousb).

I was in contact with the FCEUX authors who said they'd look into it but I'm not aware of an update.

I feel pretty helpless. We need to spread the word and get emulators updated. The SXROM+32KB NVRAM configuration is a legitimate one (it was even used on a Japanese game) so really emulators should support it. I realise I'm being simplistic there though.

neutral

183

(14 replies, posted in Nintendo Consoles)

akira^8GB wrote:

Caanoo is the latest Gamepark "open-source" console.
Now, if Pulsar would run on this emu... smile As long as PR8 does, I don't care big_smile

Quick way to test if PR8 will run on it: try running Pulsar.

184

(14 replies, posted in Nintendo Consoles)

Whoa! That's super nice big_smile

What's a canoo?

185

(70 replies, posted in Nintendo Consoles)

akira^8GB wrote:
tacticalbread wrote:

Whatever emulator you're using, it's not supported. tongue

OK yep, I ran into this problem on FCE, now, is this gonna be like this forever? I'd like to use Pulsar on my Caanoo.
Otherwise, I just hope PR8 does run on this emulator tongue

I hate to be the bearer of bad news but Pulsar and PR8 are constructed on the same setup - whatever emulator you want to use needs to support the NES2.0 format, SXROM and 32KB of NVRAM. Currently, as has been said, that only leaves you with PowerPak or Nestopia. It's an extremely frustrating situation.

Petition the emulator creators - there's absolutely nothing I can do about it sad

186

(0 replies, posted in Nintendo Consoles)

Not sure if anyone here uses it but a mini update is on the site now plus the source files to create the 'Cleptoplank' track I put out last year.

http://blog.ntrq.net/?p=452

187

(28 replies, posted in Commodore Computers)

goonzy wrote:
neilbaldwin wrote:

Yes OSX driver for HardSID would rule but I don't think it's going to happen. sad

The guy doing the devices refuses to for some reasons.. but there could be some hacker somewhere able to sniff the USB comms on a PC and recreate a driver on OSX... (I wish I had the time and knowledge to do it... smile)

To be fair, I did have an email conversation with him about this last year and he did explain the reasons why, which I remember as being reasonable (though don't ask me to remember!). Still doesn't stop me sulking about it though. smile

188

(28 replies, posted in Commodore Computers)

goonzy wrote:
neilbaldwin wrote:

Yes OSX driver for HardSID would rule but I don't think it's going to happen. sad

The guy doing the devices refuses to for some reasons.. but there could be some hacker somewhere able to sniff the USB comms on a PC and recreate a driver on OSX... (I wish I had the time and knowledge to do it... smile)

To be fair, I did have an email conversation with him about this last year and he did explain the reasons why, which I remember as being reasonable (though don't ask me to remember!). Still doesn't stop me sulking about it though. smile

189

(4 replies, posted in General Discussion)

Oh the irony....the first two places I looked to download it from are both .ISO files of the same disc I have LOL

190

(4 replies, posted in General Discussion)

plgDavid wrote:

Hi

Unless you have a DSD hardware stream replayer, any conversion you do will involve loss anyway. (2.8224 MHz (1 bit times 64 times 44.1 kHz).)

Imho, the DSD benefits are clearly marketting hype with regards to 24/96

Thanks David,

Yes, SACD is a ridiculous marketing-driven format. No wonder it's pretty much dead.

Seems that downloading the album is the only way I'll get it in the format I need.

*sigh*

191

(4 replies, posted in General Discussion)

I got Edgar Winter's "They Only Come Out At Night" on SACD (it was a Christmas present - SACD is not something I normally buy) and am having great trouble ripping it (on my Mac). iTunes doesn't seem to like it and while there seems to be several programs that claim to rip these and DVD-Audio discs, I can't find any that work or allow a demo version (I'm not really willing to pay full price anyway just to rip one album but I would if it was reasonable).

Anyone got any suggestions before I just go ahead and download the album instead?

192

(28 replies, posted in Commodore Computers)

Yes OSX driver for HardSID would rule but I don't think it's going to happen. sad

Someone needs to make some kind of cross-platform port of SDI because that is THE greatest C64 music tracker ever.