nesdev.com
https://forums.nesdev.com/

8x16 and whatever else unreg wants to know
https://forums.nesdev.com/viewtopic.php?f=10&t=7451
Page 16 of 93

Author:  tokumaru [ Tue Aug 16, 2011 12:36 pm ]
Post subject: 

tepples wrote:
Quote:
I don't know why so many games does terrible things at enemies respawning (Ninja Gaiden, Mega Man, ....)

RAM limits, I guess.

It might be more difficult without the extra RAM, but definitely not impossible.

Author:  unregistered [ Tue Aug 16, 2011 7:29 pm ]
Post subject: 

tokumaru wrote:
Well, if you can understand the basic concept and are feeling confident about implementing this, then go for it! =)

Thank you so much! The positivity is very good! It helped me to decide to try my best... then I read through the rest of you and Shiru talking and it made me realise that this will be an incredible journey. :)

tokumaru wrote:
Bregalad wrote:
Trust me, even if you're not scrolling, use 16-bits by all means !

I second this. Even in single-screen games you may need to scroll in and out of the screen, and smooth acceleration and deceleration.

Ok, thanks Bregalad and tokumaru. I remember hearing that from yall during my first nes game attempt... I think I was username "aaable" on yall's old forum. I dont remember much from then. :oops:

Author:  unregistered [ Thu Aug 18, 2011 11:30 pm ]
Post subject: 

In my lst file I just found out that $D0D1 skips down through a lot of famitone code. There are instructions on the right but the address never changes from $D0D1 for quite a while. Why..what..how? :?

edit: Maybe it's because that part of the code isn't used or is disabled; i remember telling famitone to not include DPCM code. Maybe that is correct! :)

Author:  unregistered [ Mon Aug 22, 2011 1:46 pm ]
Post subject: 

Code:
enum $000   ;asm6's way of declaring vars in ram

  ;a is for A register
  ;x is for X register
  ;y is for Y register


currControllerButtons .dsb 1,0
lastControllerButtons .dsb 1
newControllerButtons .dsb 1
read .db #31
oX .db #$8b  ;($0004 is X)
oY .db #$8b  ;($0005 is Y)


ok, I would like the X and Y coordinates to be equal to #$8B. It never makes it to #$8B.... the sprite just stays at #$00... unless, I press up down left or right then it incrementsORdecrements oXORoY by 1; the sprite then responds accordingly! :D ...Do I have to set oX and oY manually? :? Why? :?

Author:  3gengames [ Mon Aug 22, 2011 2:01 pm ]
Post subject: 

You can't make RAM anything on start up, you have to store it with your program there if you want it to start at a value.

Author:  unregistered [ Mon Aug 22, 2011 2:24 pm ]
Post subject: 

Why? In asm6 there's .dsb

asm6's README.TXT wrote:
DSB, DSW (also DS.B/DS.W)

Define storage (bytes or words). The size argument may be followed
by a fill value (default filler is 0).

DSB 4 ;equivalent to DB 0,0,0,0
DSB 8,1 ;equivalent to DB 1,1,1,1,1,1,1,1
DSW 4,$ABCD ;equivalent to DW $ABCD,$ABCD,$ABCD,$ABCD


Why did they make this... changed my code to oX .dsb 1,$8b and it still started the sprite at 0, 0. :( :?

Author:  3gengames [ Mon Aug 22, 2011 2:28 pm ]
Post subject: 

Your program you put in the ROM isn't RAM.When the system boots up, it has garbage in it. Usually it's cleared on boot up, you have to store the variables you need in it at the spot you want them. Before your program starts, do a LDA #$NUMBER STA Label to put it there, there's no way around it, you have to.

Author:  unregistered [ Mon Aug 22, 2011 3:13 pm ]
Post subject: 

Thank you 3gengames for your help. :) ...Why would loopy add a pointless way of declaring a storage fill value in his assembler? :? dsb :? :?:

Author:  tokumaru [ Mon Aug 22, 2011 3:21 pm ]
Post subject: 

unregistered wrote:
Why would loopy add a pointless way of declaring a storage fill value in his assembler? :? dsb :? :?:

Because .dsb can also be used in ROM, where you can actually fill values.

Author:  unregistered [ Mon Aug 22, 2011 3:43 pm ]
Post subject: 

tokumaru wrote:
unregistered wrote:
Why would loopy add a pointless way of declaring a storage fill value in his assembler? :? dsb :? :?:

Because .dsb can also be used in ROM, where you can actually fill values.


Ah, that's great tokumaru, thank you. :D So, when using a mapper you could specify RAM; right?

Author:  3gengames [ Mon Aug 22, 2011 3:47 pm ]
Post subject: 

No, nothing in the world can put what you compile in RAM at startup except a Boot ROM which is wasteful and not going to happen because it's not even in the ROM for it to know what to put there.

Author:  tepples [ Mon Aug 22, 2011 3:49 pm ]
Post subject: 

If you want something to be in RAM when your program starts, copy it from ROM to RAM in the init code. This is exactly how the cc65 runtime library handles .segment "DATA".

Author:  unregistered [ Mon Aug 22, 2011 4:15 pm ]
Post subject: 

tepples wrote:
If you want something to be in RAM when your program starts, copy it from ROM to RAM in the init code.


:shock: How would I do that? :)

Author:  3gengames [ Mon Aug 22, 2011 4:24 pm ]
Post subject: 

No offense....but you know how computers work right? You should maybe read up more on programming and more 6502. This something really, really..REALLY basic.

It'd go something like this for a small chunk of data to copy to RAM:

Code:
;Somewhere in RAM:
MoveToRAM: .rs $100

;Somewhere in ROM, put:
SomeLabel: incbin "Data256bytes.bin"

LDX #$00
Loop:
LDA SomeLabel,X
STA MoveToRAM,X
DEX
BNE Loop
;Done.


It's the most straightforward a program can be.

Author:  unregistered [ Mon Aug 22, 2011 4:46 pm ]
Post subject: 

3gengames wrote:
No offense....but you know how computers work right? You should maybe read up more on programming and more 6502. This something really, really..REALLY basic.

:oops:
3gengames wrote:
It'd go something like this for a small chunk of data to copy to RAM:

Code:
;Somewhere in RAM:
MoveToRAM: .rs $100

;Somewhere in ROM, put:
SomeLabel: incbin "Data256bytes.bin"

LDX #$00
Loop:
LDA SomeLabel,X
STA MoveToRAM,X
DEX
BNE Loop
;Done.


It's the most straightforward a program can be.


:oops: 3gengames, thank you for that explaination! :) How can I choose RAM instead of ROM?

Page 16 of 93 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/