(1 replies, posted in Nintendo Consoles)

Update: Solution found, please ignore.


(1 replies, posted in Nintendo Consoles)

Hey All, me again!

So, in my last post I was trying to achieve a fade effect manually, but i found that simply changing bits 5 and 6 on the value written to $4000 would do that just fine for my needs AND I can modify the length using the highest 5 bits written to register $4003. Awesome.
Now my issue seems to be an inability to trigger a sequence of more than one note.
I know that once the counter reaches 0 on the note length, the flag for the note length at register $4015 will set to 0.
My code looks like this:

    .inesprg 1
    .ineschr 0
    .inesmap 1
    .inesmir 0

    .bank 1
    .org $FFFA
    .dw 0 ;vbank
    .dw Main
    .dw 0

    .bank 0
    .org $C000

    ;period/frequ and also set length
    JSR D3

    ldx $4015
    cpx #%00000000
    beq Two

    jmp Infiniteloop

    JSR D4

    jmp Infiniteloop

    ;D3, eighth note
    lda #%00000001
    sta $4015
    lda #%10011111
    sta $4000
    lda #%11111001
    sta $4002
    lda #%01001010
    sta $4003


    lda #%00000001
    sta $4015
    lda #%10011111
    sta $4000
    lda #%01111100
    sta $4002
    lda #%01001001
    sta $4003


In my head, the code should.
1. From main, jump to my subroutine D3, where I
    a. enable PU1 by writing 1 to the first bit of register $4015
    b. write the duty cycle/volume/period/length data to registers $4000, $4002, and $4003
    c. return to main
2. Load the value stored at $4015 to the x register
3. test the value against a correct zero-d out $4015, meaning that the timer on PU1 had counted to zero
4. Jump to D4, where i would do the same process as in step one.

On paper, i feel like my code checks out, but clearly i am missing something here, so if anyone could help me (again) that would be extremely cool.


(4 replies, posted in Nintendo Consoles)

Hello Everyone! I'm back with another NES sound related question.
Having scrapped getting sound from the NES via a .nsf file, I have been trying to hard-code some little ditties into the chip in assembly.
My current process is this: I am making separate sub-routines for each note/note length and then calling them in an order, to form a sort of song.
Right now, my code for the note D, with a fade out looks like this:

    ;pitch D3
    lda #%11111001
    sta $4002
    lda #%10000010
    sta $4003

    ;volume & pulse width
    ;fade out
    lda #%00111111
    sta $4000
    sta $4000
    sta $4000
    sta $4000
    sta $4000
    sta $4000
    lda #%00111101
    sta $4000
    lda #%00111011
    sta $4000
    lda #%00111001
    sta $4000
    lda #%00110111
    sta $4000
    lda #%00110101
    sta $4000
    lda #%00110011
    sta $4000
    lda #%00110010
    sta $4000
    lda #%00110001
    sta $4000


and to an extent, this works! the NES generating a D3 pitch. HOWEVER: the fade is not working as expected. What I expect to happen is for the note to hold at maximum volume for a moment, before going down in volume. what happens in actuality, is that the APU only seems to be reading (from what i can hear) the last write to $4000, meaning that i have a steady tone at volume 1, rather than a tone that decreases in volume. If anyone can help me troubleshoot this, that would be very helpful.

Note: I understand that the length can be changed via the highest 5 bits written to $4003, but I still would like to experiment with this method and get it to work.

kvee wrote:

Don't worry about $70-$77, just check it's all zeroes (that means no bankswitching). If it's not all zeroes however, you're not gonna be able to use the simple playback method from the nerdtracker example.

Thank you for all the info! It looks like i will need to do some bank switching since bytes $75-$77 are non-zero values (thanks deflemask). I appreciate all the help, and I will use this information in order to (hopefully) get something working in the near future.


kvee wrote:

NSF files can (and do!) have different load/init/play addresses. Take a look here: https://wiki.nesdev.com/w/index.php/NSF.
Download a hex editor if you don't have one, it's invaluable for quickly looking inside .NSFs (I use XVI32 personally). Definitely check you're not playing a bankswitched NSF, that's way more complicated that this example you've posted can handle (to the point of requiring custom hardware).

For non-bankswitched NSFs, this should work. If the load address is not $8000, change the

.org $8000



Also modify the init and play constants and you should be set!
(I dunno why the code defines the load address and then just hardcodes it, oh well)

Good luck! :]
EDIT: Don't forget to strip the header from the .NSF before including it!

Hey, thank you for the information, but i still have a few questions (I am very new to this). First, how do I determine that the load address is not $8000? Do I simply look for where the bulk of the hex data (song data) is? In my case, the largest chunk of the data IS located at address $8080 (with $8000 being the beginning of the file). In a similar fashion, i am unsure how to modify the init and play registers accordingly.

I tried to manually copy the data stored at $070-$077 into the registers denoted by the table on the NESDEV wiki but other than turning my emulator screen white (?), there was no change in audio playback.

Any more pointers would be very helpful, thank you.

Hey Everyone!

For my Senior Independent Project in college, I have decided to try my hand at writing code for the NES in 6502 Assembly. Having graphic rendering more or less handled, i am now moving on to audio playback. I found some code for nerdtracker .nsf playback here:

https://wiki.nesdev.com/w/index.php/Ner … _in_NESASM

I assumed it would work with all .nsf files.  However, after exporting my .nsf from deflemask and running the code, I was able to create a NES rom but without any audio playback. Is there a difference in .nsf files generated by different pieces of software? Am I missing something? Any help on this issue would be very helpful.


cTrix wrote:
Crooked Sidewalks wrote:

I still feel like pressing play on the trackers isn't right... What options do I have?

Well, if you are in a situation where you are just going to "press play" on a PC tracker, then why not break it into parts and drop it into something like Ableton Live or (better still) Maschine and use a cool surface to control your sequencing with the laptop shut?  It seems a bit silly when you have all that computing power to just hit play in a tracker and jump around.  Especially if you've already rendered the Famitracker waveforms. 

If you do keep it running in the tracker, you could potentially add "loop" points and choose when to break the loops or switch channels / parts on and off on the fly (which is what I do on the Amiga).  I also channel split and put (in my case) CH 1&4 and 2&3 on separate channels of a Pioneer DJM800 which has mappible effects processor and dedicated pass filters.   Or I use a couple of Kaos pads if I can't take the 800.  Sometimes, due to the sound system, instruments need turning up and down to sit better in the mix on the fly too so it's worth keeping a listen to the track.  :-)

This is a great idea! You could also use a device like an SP404 or other performance oriented sampler so that you have access to effect and whatever other sounds you want. combining the two would be something like splitting the lead from the rest of the track and putting them on separate pads. you could also midi sync to a device like this, if you so desire.

The MOUKI link sends me to an adult dating site? Anyone else coming across this?

What is the slot in the top of the ongaku cart for?


(1 replies, posted in Trading Post)

I saw this video of Tanikugu performing with a wonderswan and tenori-on and came to discover that there was a version of the classic sequencer for the handheld, and thus the hunt has begun. If you have a copy, or find links to some for sale please post below!

video in question: https://www.youtube.com/watch?v=C6mCPqJgfAo


Diode told me to make a post.
If a mod wants to kill this thread go for it.

Chicago Chiptune Festival


April 17th-18th


Tri Angles
8 Bit Jin
Diode Milliampere
Storm Blooper
Shoujo Kiss


Visuals By:

Sam Rolfes

+vending by Toasty Co+

For more info and tickets:




(14 replies, posted in Trading Post)

herr_prof wrote:

Raspberry PI can also run all the required software you are looking for.

If I wanted to use a computer, I would just run resolume on my mac (which I already do)

A lot of the appeal of it to me is the fact that it's a handheld games console.


(14 replies, posted in Trading Post)

e.s.c. wrote:
arfink wrote:

They are pretty darn rare, and people who own them usually don't sell them used unless something on them breaks.

yeah, im about to sell a gp2x f200 for parts since the sd card slot died on it sad
selling my a/v cable and piggy->midi too

Is there another way to load games onto it? and how much would you be willing to sell it for as is?


(14 replies, posted in Trading Post)

If anyone has one that they feel is reasonably priced, they should let me know.


(14 replies, posted in Trading Post)

Looking for something to run LSDJ, Piggy, and the Pikilipita VJ software. Needs to have the A/V cables. would like to keep the price <100 usd.