Search found 85 matches

by Drakim
Tue Oct 30, 2018 5:04 am
Forum: NESdev
Topic: Techniques for better multi-directional scrolling
Replies: 10
Views: 5306

Re: Techniques for better multi-directional scrolling

That's a nice list, but which technique did you end up going with? I'm curious. One nametable mirrored in both directions, left column hidden with PPUMASK ($2001), bottom row hidden with IRQ interrupt, limit nametable updates to once per column/row updated exactly underneath the hidden column/row, ...
by Drakim
Sun Oct 28, 2018 6:07 am
Forum: NESdev
Topic: "Super Mario Bros." hack with a two-player simulatenous mode
Replies: 38
Views: 25799

Re: "Super Mario Bros." hack with a two-player simulatenous

You could theoretically also convert SMB1 to the MMC5 mapper which gives you double the sprite pages to work with (in 8x16 sprite mode), thus giving room for Luigi. You'd have to rewrite a pretty big part of the game at this point though, it might be easier to just faithfully recreate most of it fro...
by Drakim
Sat Oct 27, 2018 4:59 am
Forum: NESdev
Topic: Techniques for better multi-directional scrolling
Replies: 10
Views: 5306

Techniques for better multi-directional scrolling

I've been busy creating my own multi-directional scrolling code. It's hard work, but I've finally gotten it to work! I'm using single-screen mirroring (I want to use the other nametables for cool effects), and naturally there are a few challenges. Although there are great articles like this that giv...
by Drakim
Mon Oct 22, 2018 6:58 am
Forum: NESdev
Topic: My recent experience with ca65, asm6, nesasm, and wla-dx
Replies: 28
Views: 19834

Re: My recent experience with ca65, asm6, nesasm, and wla-dx

tokumaru wrote:Another extremely annoying thing in ASM6 is how its anonymous labels break the scope of local labels, effectively making it impossible to use both in the same subroutine.
I always found this extremely strange and bizarre, to the point of seeing it as a bug.
by Drakim
Mon Oct 22, 2018 6:38 am
Forum: NESdev
Topic: Best practices for instancing?
Replies: 24
Views: 11268

Re: Best practices for instancing?

You wouldn't happen to know if asm6 has any functionality to warn you if a labeled variable is crossing a page? That would be helpful in this case. I don't think so, but it shouldn't be too hard to write an ASM6 macro that does this for you, something like this maybe: MACRO CHECKSAMEPAGE InputLabel...
by Drakim
Mon Oct 22, 2018 5:45 am
Forum: NESdev
Topic: Best practices for instancing?
Replies: 24
Views: 11268

Re: Best practices for instancing?

One trick that's quite common is to store your entities live values in "parallel" rather than as blobs. So instead of having projectile 1's state, x_hi, x_lo, y_hi, y_lo.... and then projectile 2's state x_hi, x_lo, y_hi, y_lo.... instead you store it like this: proj_state: DSB 30 proj_x_hi: DSB 30 ...
by Drakim
Fri Oct 12, 2018 3:48 pm
Forum: NESdev
Topic: Writing my own assembler
Replies: 73
Views: 25377

Re: Writing my own assembler

What would be less ideal about an opposite branch over RTS right there (maybe hide it in a macro)? I'll write an example to demonstrate how things become less verbose: DoTheMario: LDA DancerId CMP #MarioId BNE @Return ; Lots of dancing code here @Return: RTS Turns into... DoTheMario: LDA DancerId C...
by Drakim
Fri Oct 12, 2018 3:37 pm
Forum: NESdev
Topic: Writing my own assembler
Replies: 73
Views: 25377

Re: Writing my own assembler

tokumaru wrote:Why would you JMP to an RTS and waste 3 bytes and 3 cycles if you can RTS on the spot with 1 byte?
Haha, good point! I was only thinking in terms of cpow's idea for a global RTS, which is possible for a JMP, but as you say, utterly pointless.
by Drakim
Fri Oct 12, 2018 3:14 pm
Forum: NESdev
Topic: Writing my own assembler
Replies: 73
Views: 25377

Re: Writing my own assembler

Wouldn't one label anywhere in your code suffice? Relative branches can only jump a certain distance in your code. -126 to +129 bytes worth of opcodes I believe? You definitely won't be able to have one "global" RTS that you reuse all the time. That's why different branches all need to find their o...
by Drakim
Fri Oct 12, 2018 2:49 pm
Forum: NESdev
Topic: Writing my own assembler
Replies: 73
Views: 25377

Re: Writing my own assembler

Darn, this thread is just making me itch to take a stab at making my assembler as well. I just might give it a go. :D I've had some ideas floating around for a long time, so I figure I might share them here if you are interested. I'm not sure if all of these ideas are realistic, I haven't tried to i...
by Drakim
Tue Oct 02, 2018 7:11 am
Forum: NESdev
Topic: How to spawn enemies with multi-directional scroll?
Replies: 12
Views: 5172

Re: How to spawn enemies with multi-directional scroll?

Alright, thanks for all the input. I've been going back and forth between different techniques, but this is what I settled on: My game only allows for up to 30 full "screens" in each level, and I've decided to have a max of 8 enemies waiting on each screen. This means that by splitting the different...
by Drakim
Mon Oct 01, 2018 11:42 am
Forum: NESdev
Topic: How to spawn enemies with multi-directional scroll?
Replies: 12
Views: 5172

Re: How to spawn enemies with multi-directional scroll?

Brute forcing 5 object spawns at once where each spawn takes 50 cycles is only 250 cycles total. Doesn't sound like a big deal to me. I suppose not, and I could avoid checking unless there has been some scroll movement. I guess I could also do some loop unrolling if I'm constantly checking 5 object...
by Drakim
Mon Oct 01, 2018 10:52 am
Forum: NESdev
Topic: Strategies for dealing with the four sprite palette limit?
Replies: 37
Views: 12460

Re: Strategies for dealing with the four sprite palette limi

For despawning long-lived enemies who follow you, one technique can be to have a flag on enemies that can mark them as "expendable". If some new enemy wants to spawn and there is a lack of resources (palettes, CHR banks, object slots, etc) then the game does sweep over the active enemy list and dele...
by Drakim
Mon Oct 01, 2018 10:45 am
Forum: NESdev
Topic: How to spawn enemies with multi-directional scroll?
Replies: 12
Views: 5172

Re: How to spawn enemies with multi-directional scroll?

I took the lazy route, and I think it works fine. But there are probably people with better ideas. What I do is initially similar to the Super Mario Bros 3 route - i sort the object spawns according to their X coordinate (in my case they are 16x16 grid coordinates, not pixel coordinates), and every...
by Drakim
Mon Oct 01, 2018 10:41 am
Forum: NESdev
Topic: How to spawn enemies with multi-directional scroll?
Replies: 12
Views: 5172

Re: How to spawn enemies with multi-directional scroll?

Group objects into a grid. Determine which grid cells are visible, then iterate each object contained to see if it spawns. That definitely works, but I was hoping there was some less brute-forcey way to do things. One idea might be to do this while maintaining two lists for each grid cell, one sort...