Search found 528 matches

by Movax12
Tue Jul 24, 2012 6:48 am
Forum: NESdev
Topic: Duff's Device.
Replies: 12
Views: 3692

I guess so. .proc duff_copy ; reg.a has count .segment "RODATA" jump_in_table: .word jump_in,jump_in-4,jump_in-8,jump_in-12,jump_in-16,jump_in-20,jump_in-24,jump_in-28,jump_in-32 .word jump_in-36,jump_in-40,jump_in-44,jump_in-48,jump_in-52,jump_in-56,jump_in-60 .segment "CODE" ; ...
by Movax12
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;...
by Movax12
Thu Jul 12, 2012 3:42 pm
Forum: NESdev
Topic: Organizing and processing objects.
Replies: 18
Views: 6575

That's pretty good. I guess that's better than playing with bits.

You would simply have to initialize each NextFreeSlot at the beginning of a game/level which I suppose is trivial.
by Movax12
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...
by Movax12
Sat Jul 07, 2012 6:02 pm
Forum: NESdev
Topic: 6502 ASM trick
Replies: 100
Views: 50394

3gengames wrote:Maybe on a personal computer of the 80's where there's around 8KB+ of system RAM and around 32KBish for programs. But not NES.
I'm hardly any kind of authority, but looking over the source of SMB and Metroid I see lots of 1 byte flags.
by Movax12
Sat Jul 07, 2012 12:01 pm
Forum: NESdev
Topic: 6502 ASM trick
Replies: 100
Views: 50394

Yeah, speed/convenience vs space are always an issue, but many games use one byte for some flags. You do save rom space.
by Movax12
Sat Jul 07, 2012 8:24 am
Forum: General Stuff
Topic: Making of Solstice
Replies: 12
Views: 5715

Making of Solstice

Quick search, I didn't find this posted anywhere on the forum.

www.youtube.com/watch?v=894_PNqBkx4
by Movax12
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...
by Movax12
Fri Jul 06, 2012 8:40 pm
Forum: NESdev
Topic: Organizing and processing objects.
Replies: 18
Views: 6575

I only meant I would have pick one of those - for all objects.. 8 bytes, maybe 16.. so I could use shifts to quickly calculate the address. Variable sizes isn't going to happen. I'm going to go with interleaved and indexed with x anyway.
by Movax12
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...
by Movax12
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...
by Movax12
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...
by Movax12
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 ...
by Movax12
Fri Jun 29, 2012 7:13 pm
Forum: NESdev
Topic: Nikkei Electronics 'How the Famicom was Born' Translations
Replies: 3
Views: 2300

Odd..

Image


It looks kinda like...

http://www.youtube.com/watch?v=YDGR2MiCyYs
by Movax12
Wed Jun 27, 2012 6:03 pm
Forum: NESdev
Topic: Error checking
Replies: 13
Views: 3420

Very nice! I'll give that a try. Thanks for explaining.