Search found 528 matches
- Tue Jul 24, 2012 6:48 am
- Forum: NESdev
- Topic: Duff's Device.
- Replies: 12
- Views: 3692
- Tue Jul 24, 2012 12:14 am
- Forum: NESdev
- Topic: Duff's Device.
- Replies: 12
- Views: 3692
Duff's Device.
Dunno if it the best code, more just wanted to practice some 6502, but here is a Duff's Device solution for loading PPU data. It expects that the address has been set and A holds the number of values to be copied from the (fake) stack. .proc duff_copy ; reg.a has count tsx stx $E; save stack ldx $F;...
- Thu Jul 12, 2012 3:42 pm
- Forum: NESdev
- Topic: Organizing and processing objects.
- Replies: 18
- Views: 6575
- Wed Jul 11, 2012 6:31 pm
- Forum: NESdev
- Topic: Organizing and processing objects.
- Replies: 18
- Views: 6575
Rather than linked lists, wouldn't it be easier/faster to use a few bytes and use one bit per object to indicate if it is available or not. Maybe not faster to find the first free object, but much easier to remove one from the list. You could use 8 bytes to indicate which OAM slot is free as well. I...
- Sat Jul 07, 2012 6:02 pm
- Forum: NESdev
- Topic: 6502 ASM trick
- Replies: 100
- Views: 50394
- Sat Jul 07, 2012 12:01 pm
- Forum: NESdev
- Topic: 6502 ASM trick
- Replies: 100
- Views: 50394
- Sat Jul 07, 2012 8:24 am
- Forum: General Stuff
- Topic: Making of Solstice
- Replies: 12
- Views: 5715
- Sat Jul 07, 2012 8:11 am
- Forum: NESdev
- Topic: 6502 ASM trick
- Replies: 100
- Views: 50394
I'm going to use this one: Normally, you would do this (“flag” is a byte in the zero page): function code bytes cycles set lda #1 sta flag 4 5 clear lda #0 sta flag 4 5 test lda flag beq clear 4 5/6 Woz did it like this: function code bytes cycles set lda #$80 sta flag 4 5 clear lsr flag 2 5 test bi...
- Fri Jul 06, 2012 8:40 pm
- Forum: NESdev
- Topic: Organizing and processing objects.
- Replies: 18
- Views: 6575
- Fri Jul 06, 2012 7:25 pm
- Forum: NESdev
- Topic: Organizing and processing objects.
- Replies: 18
- Views: 6575
I was actually thinking of making the objects powers of two - so an object has to use 2,4,8,16, or 32 bytes. Then you could lda an object number, asl a a few times and add to that to the base address, then index it with x. I think I really like the interleaved method though, it works well with the 6...
- Fri Jul 06, 2012 1:30 pm
- Forum: NESdev
- Topic: Organizing and processing objects.
- Replies: 18
- Views: 6575
Thanks for your input. I have one other question: All my object memory is a series of arrays, which I access using the X register. That way, routines that manipulate the objects using the base addresses of the arrays and the index of the object in X. For example, ldx #$04; dec ObjectHealth, x; would...
- Fri Jul 06, 2012 12:09 pm
- Forum: NESdev
- Topic: Organizing and processing objects.
- Replies: 18
- Views: 6575
Re: Organizing and processing objects.
Instead of using codes for status and jump tables (or God forbids, long chains of IFs), I prefer to store the PC of the object's AI, so that it can resume from where it stopped last frame. I am not sure if understand exactly how you are using that technique. Rather than checking the state and jumpi...
- Fri Jul 06, 2012 8:50 am
- Forum: NESdev
- Topic: Organizing and processing objects.
- Replies: 18
- Views: 6575
Organizing and processing objects.
I have been thinking over more and more, without much actual coding, on how to handle cycling through objects, collision detection, sprite frames, etc. I'm looking for discussion of ideas or solutions for these problems. My goal is a good balance of flexibility and speed. So far I've figured I want ...
- Fri Jun 29, 2012 7:13 pm
- Forum: NESdev
- Topic: Nikkei Electronics 'How the Famicom was Born' Translations
- Replies: 3
- Views: 2300
- Wed Jun 27, 2012 6:03 pm
- Forum: NESdev
- Topic: Error checking
- Replies: 13
- Views: 3420
