a few problems

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
vixo
Posts: 7
Joined: Wed Apr 04, 2007 1:56 pm

a few problems

Post by vixo »

when I try and compile anything with nesasm through DOS, it just crashes and gives this message -

Image

- although I can get it to work if I drag and drop the code file onto nesasm. I'm trying to get the code from joker21's guide to work -

Code: Select all

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

	.org $8000
	.bank 0

Start:


	;this sets up the PPU
	lda #%00001000     
	sta $2000          
	lda #%00011110 
	sta $2001

        lda #$3F        ;set ppu to start of palette
        sta $2006       
        lda #$00        
        sta $2006 
	ldx #$00

loadpal:
	lda titlepal, x  ;loads a 32 byte palette
	sta $2007
	inx
	cpx #$20      ;gotta be one extra b/c of inx
	bne loadpal

Loop:
	jmp Loop


titlepal: .incbin "test.pal"	;palette data


    	.bank 1
	.org	$FFFA
	.dw		0 ;(NMI_Routine)
	.dw		Start ;(Reset_Routine)
	.dw		0 ;(IRQ_Routine)

    .bank 2
    .org    $0000
    .incbin "test.chr"  ;gotta be 8192 bytes long
The guide states that I HAVE to have a 4kb test.chr, but I can't figure out how to get anything less than an 8kb CHR file (I am using YY-CHR)

If I try dragging and dropping onto nesasm with this code, nothing happens. But if I erase both .incbin lines from the code, it assembles.

Can anyone help me to a) get nesasm to work through DOS
b) get the .incbin command to work
c) get a 4kb CHR file

- I would be very grateful :(
User avatar
Memblers
Site Admin
Posts: 3902
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

See if you have the newest nesasm.exe (v2.51).. I remember having trouble with an older version. I don't know what else the problem could be.
c) get a 4kb CHR file
Get a hex editor. It's like a swiss army knife of binary file hacking. Frhed is the one I use: http://www.kibria.de/frhed.html. Then just cut it in half at 4096 (or 0x1000).
User avatar
commodorejohn
Posts: 193
Joined: Mon Sep 11, 2006 6:48 pm
Location: Moose Lake, Minnesota

Post by commodorejohn »

Yeah, I had that problem with an older version as well.
[size=0]"There is only one basic human right, the right to do as you damn well please. And with it comes the only basic human duty, the duty to take the consequences."
- P.J. O'Rourke[/size]
vixo
Posts: 7
Joined: Wed Apr 04, 2007 1:56 pm

Post by vixo »

I've got v2.51 now, but it still crashes when I use it through DOS. :?

any other ideas?
Roth
Posts: 400
Joined: Wed Aug 03, 2005 3:15 pm
Contact:

Post by Roth »

I had written a small prog called makebin to make blank binary files for use in NES Dev.

http://robertlbryant.com/programs/download/makebin.7z

You can make 4kb files with that easily.
Post Reply