Search found 115 matches

by kikutano
Thu Jul 05, 2018 12:13 am
Forum: NESdev
Topic: Modify a tile from background
Replies: 14
Views: 5045

Re: Modify a tile from background

Hello again! Some progress here, now I can destroy my bricks without problem. But only until the 255 tile :P. Here is my problem. I've stored on RAM a 1:1 map of the background for now, I compute the Tile number where the collision occurs and I store it on BALL_POS_X_ON_TILE. But BALL_POS_X_ON_TILE ...
by kikutano
Sat Jun 30, 2018 7:46 am
Forum: NESdev
Topic: Modify a tile from background
Replies: 14
Views: 5045

Re: Modify a tile from background

UpdateBGScreen: LDA TILE_COLLISION_NUM CMP #$00 BEQ _NoCollision LDA $2000 STA VRAM_ADDRESS_COLLISION LDA VRAM_ADDRESS_COLLISION CLC ADC TILE_COLLISION_NUM STA VRAM_ADDRESS_COLLISION LDA LOW( VRAM_ADDRESS_COLLISION ) STA ADDR_LOW LDA HIGH( VRAM_ADDRESS_COLLISION ) STA ADDR_HIGH LDA $2002 LDA ADDR_H...
by kikutano
Sat Jun 30, 2018 6:36 am
Forum: NESdev
Topic: Modify a tile from background
Replies: 14
Views: 5045

Re: Modify a tile from background

STA $0400, y can only reach from $400-4ff. 256 bytes. So, on the second pass of the larger loop, you're overwriting $400-4ff multiple times. You seem to be moving 4x256=1024 bytes. You need a second pointer to sta. LDA #0 STA ADDR_LOW2 LDa #4 STA ADDR_HIGH2 ; ptr now points to $400 ... ... LDA [ADD...
by kikutano
Sat Jun 30, 2018 3:24 am
Forum: NESdev
Topic: Modify a tile from background
Replies: 14
Views: 5045

Re: Modify a tile from background

Ok thanks, I can change the background without problem now. But now I've another couple of questions :oops: . And that's about the collision test. Now I've the entire background on VRAM, theoretically I can access to any position on VRAM by LDA $2002 LDA #$20 STA $2006 LDA #$01 STA $2006 LDX $2007 L...
by kikutano
Fri Jun 29, 2018 10:51 am
Forum: NESdev
Topic: Modify a tile from background
Replies: 14
Views: 5045

Re: Modify a tile from background

1. Calculate at what address to draw it: $2000 plus 32 times the vertical position of the tile (in 8-pixel units) plus the horizontal position of the tile (in 8-pixel units) 2. Calculate what tile to draw, in your case the empty background tile 3. Wait for vertical blanking 4. Write the high byte o...
by kikutano
Fri Jun 29, 2018 9:44 am
Forum: NESdev
Topic: Modify a tile from background
Replies: 14
Views: 5045

Modify a tile from background

https://thumbs.gfycat.com/LazyRipeGrayfox-max-1mb.gif Hello! I'm working on an Arkanoid Clone for NES. I need to understand what's the best way to change the bricks tile on the background after a collision. For now I'm loading the background on the screen in this way: LoadPlayScreen: ;load playfiel...
by kikutano
Wed Jun 27, 2018 12:33 am
Forum: NESdev
Topic: Collision detection problem with my project.
Replies: 46
Views: 17507

Re: Collision detection problem with my project.

Thanks a lot! :)
by kikutano
Tue Jun 26, 2018 9:38 am
Forum: NESdev
Topic: Collision detection problem with my project.
Replies: 46
Views: 17507

Re: Collision detection problem with my project.

This is my variables declarations: BALL_POS_X .rs 1 ;$0000 BALL_POS_Y .rs 1 ;$0001 BALL_DIRECTION_X .rs 1 BALL_DIRECTION_Y .rs 1 BALL_IS_DIR_X_POSITIVE .rs 1 BALL_IS_DIR_Y_POSITIVE .rs 1 PADDLE_RIGHT_X_POSITION .rs 1 PADDLE_LEFT_X_POSITION .rs 1 BRICK_Y_MAX .rs 1 BALL_IS_COLL_WITH_BRICK .rs 1 BALL_P...
by kikutano
Tue Jun 26, 2018 9:15 am
Forum: NESdev
Topic: Collision detection problem with my project.
Replies: 46
Views: 17507

Re: Collision detection problem with my project.

Even though I made an example routine that reads individual tiles from the level maps in RAM, I don't think you'll be doing that in the game, right? I mean, since the blocks are breakable, it makes no sense to read the original state of the map from ROM. I don't know yet, probably I will copy the l...
by kikutano
Mon Jun 25, 2018 11:47 pm
Forum: NESdev
Topic: Collision detection problem with my project.
Replies: 46
Views: 17507

Re: Collision detection problem with my project.

Thanks a lot! I will try now! :beer:
by kikutano
Mon Jun 25, 2018 10:02 am
Forum: NESdev
Topic: Collision detection problem with my project.
Replies: 46
Views: 17507

Re: Collision detection problem with my project.

So your problem it's basically that you don't know how to have dynamic access to more than 256 bytes,is that it? What you need to do is use a pointer. A pointer is a pair of consecutive memory positions in ZP, that together form a 16-bit address, which's able to point anywhere in the 6502's 16-bit ...
by kikutano
Mon Jun 25, 2018 12:14 am
Forum: NESdev
Topic: Collision detection problem with my project.
Replies: 46
Views: 17507

Re: Collision detection problem with my project.

https://thumbs.gfycat.com/LazyRipeGrayfox-max-1mb.gif Hello! Some progress here and new doubts! The collision detection works great with background. But I've a couple of question about the way to address the nametables where I want to compute the collision. I load the background in this way: LDX #$...
by kikutano
Sat Jun 16, 2018 7:54 am
Forum: NESdev
Topic: Collision detection problem with my project.
Replies: 46
Views: 17507

Re: Collision detection problem with my project.

I'm working on collision, and it start to works finally :D. All bricks are on background, the next step is to compute the bouncing and update the background. Programming for Nes is a pain in the ass, but hey, it's so funny! :D I will post here the collision detection code, I hope to upload on Github...
by kikutano
Sat Jun 09, 2018 7:08 am
Forum: NESdev
Topic: Collision detection problem with my project.
Replies: 46
Views: 17507

Re: Collision detection problem with my project.

LDA BALL_POS_X SEC SBC #$0F ; subtrack 16 pixel to put x in the same x space of the tiles LSR A LSR A LSR A LSR A ; Divide by 16 STA BALL_POS_X_ON_TILE LDA BALL_POS_Y SEC SBC #$0F LSR A LSR A LSR A LSR A ; Divide by 16 STA BALL_POX_Y_ON_TILE Now I've the position ( x, y ) of the ball on Tile. Now I...
by kikutano
Sat Jun 09, 2018 6:42 am
Forum: NESdev
Topic: Collision detection problem with my project.
Replies: 46
Views: 17507

Re: Collision detection problem with my project.

There are 8x8 bit multiplication and 0.8/0.8 bit division routines in math.s of Thwaite . This is targeted mostly at calculating slopes as part of an arctangent routine. There are 16x16 bit multiplication and 32/16 bit division routines in muldiv.s of 240p Test Suite , used in the Overclock activit...