which assembler to use?

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

User avatar
nineTENdo
Posts: 223
Joined: Sun Mar 19, 2006 12:37 am
Location: San ANto, TX
Contact:

Post by nineTENdo »

ok it worked. but its all messed up. does anyone know how to upload a file so can show you the difference.
" If I have seen further it is by standing on the shoulders of giants" - Issac Newton, in a letter to Robert Hooke.
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

If I can make a suggestion, I would actually stay away from that method of loading information onto the Name Table. It looks kind of like how the GBA Guy showed in his tutorials. And it doesn't look like you reset your scroll after your routine either. If you want a whole screen filled with different tile data, I'd suggest Tepple's name table editor. That way, you can have one file that's 1k, and you can load it directly on from $2000-$23FF (It comes with the attributes attached). But yeah, stick this on the end of the routine:

lda #$20
sta $2006
lda #$00
sta $2006
sta $2005
sta $2005

That's at least a step closer to solving the problem.

EDIT: Oh, and if you want to upload files, you should open a freewebs account. Just go to www.freewebs.com and make an account. Select HTML mode, not the easy freewebs builder. You don't have to make anything of your website, but you can upload files onto your site, and allow us to download them. So if your user name was "Chicken", and your uploaded file was "Sample.NES", you'd tell us to go to www.freewebs.com/chicken/sample.nes.
User avatar
nineTENdo
Posts: 223
Joined: Sun Mar 19, 2006 12:37 am
Location: San ANto, TX
Contact:

Post by nineTENdo »

Still the same. Funny thing now FCE is acting funny. it keeps gliching. meaning a sprite would move- stop- move again.

well heres the demo.

http://www.freewebs.com/ninetendo/NESASM.rar

http://www.freewebs.com/ninetendo/asm6.rar
" If I have seen further it is by standing on the shoulders of giants" - Issac Newton, in a letter to Robert Hooke.
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

I haven't looked at the whole thing yet and found the problem but just for future reference, this is the common way to load a .nam file:

Code: Select all

loadnam:

	lda #<NameFile
	sta $0
	lda #>NameFile
	sta $1
	lda #$20
	sta $2006
	lda #$00
	sta $2006
	ldx #4
	ldy #0
-
	lda ($0),y
	sta $2007
	iny
	bne -
	inc $1
	dex
	bne -

If I find your problem, I will edit this post, but it will show up as a new post.
User avatar
nineTENdo
Posts: 223
Joined: Sun Mar 19, 2006 12:37 am
Location: San ANto, TX
Contact:

Post by nineTENdo »

also whats with the "not enough memory" error in x816. looking at the ines format documents, could i use the same header i use with asm6 with x816. it looks to be a universal thing
" If I have seen further it is by standing on the shoulders of giants" - Issac Newton, in a letter to Robert Hooke.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

nineTENdo wrote:could i use the same header i use with asm6 with x816.
Of course. The assembler does not care about the header, the emulator does. And the emulator does not care about which assembler produced the ROM. :D
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

May I ask what the demo's supposed to look like?

EDIT: You shouldn't go up to #$80 in the last part. You should let to routine go until it reaches $2400, that way it'll also store the attributes. So just delete the CPX #$80 out of there.

Code: Select all

loadNames4:
      	lda ourMap+$300, X
      	sta $2007
      	inx
      	bne loadNames4
The above code is proper. And I see you do this:

Code: Select all

	lda #$03
   	sta $0301


	lda #$20
	sta $0300

	LDA $0303
   	ADC #$01
   	sta $0303
in the NMI routine. You only need to store those variables into $300/$301 one time, so just stick that outside of the NMI routine before the NMI init. Also, if you do an Add with Carry, you want to put a CLC before it. Unless you're doing 16-bit addition. But if you're only increasing it by one, I'd reccomend the INC instruction.
User avatar
nineTENdo
Posts: 223
Joined: Sun Mar 19, 2006 12:37 am
Location: San ANto, TX
Contact:

Post by nineTENdo »

clearing out that last cpx #$80 did fill in the last row on NESASM. i tried it on asm6 but still nothing. what im thinking is maybe i need to clear all my registers on restart. i did it on NESASM. it worked but i actually had to slip in a

lda #$00
sta $0303

to get the the sprite moving right to reset on reset. for some reason it wont clear it out the sprite DMA with my code. i even used the ol Duck Hunt Rip with nothing. im probrably going to try another emulator on the asm6 rom
" If I have seen further it is by standing on the shoulders of giants" - Issac Newton, in a letter to Robert Hooke.
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

You can clear all registers in RAM very easily at the beggining of the reset routine:

Code: Select all

 ldx #0
 txa
-
 sta $0,x
 sta $100,x
 sta $200,x
 sta $300,x
 sta $400,x
 sta $500,x
 sta $600,x
 sta $700,x
 inx
 bne -
I do that on reset. That's a very easy way to clear RAM. So your demo is working when compiled with NESASM?
User avatar
nineTENdo
Posts: 223
Joined: Sun Mar 19, 2006 12:37 am
Location: San ANto, TX
Contact:

Post by nineTENdo »

oh yeah it works on NESASM.
http://www.freewebs.com/ninetendo/NT1.NES

same code. i get this on asm6
http://www.freewebs.com/ninetendo/tst.NES
" If I have seen further it is by standing on the shoulders of giants" - Issac Newton, in a letter to Robert Hooke.
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

Well, it looks like the code works, it's just your CHR file that's not successfully becoming a part of the ROM. Something's wrong with the way you're including the CHR file, I think. I don't know anything about asm6, so I can't be of much help solving the problem. But I'm pretty sure that's the problem.
User avatar
nineTENdo
Posts: 223
Joined: Sun Mar 19, 2006 12:37 am
Location: San ANto, TX
Contact:

Post by nineTENdo »

i tried the .incbin loopy mentioned
and
the merging them together without .incbin.

asm6 tst.asm tst.bin
copy /B tst.bin +tst.chr tst.nes
pause

but yeah i figured it was something with .chr
" If I have seen further it is by standing on the shoulders of giants" - Issac Newton, in a letter to Robert Hooke.
Post Reply