SNES Splatoon (How do I shot HiROM?)
Posted: Sun Feb 21, 2016 9:56 am
I just thought I'd include that in the title as not to mislead anyone. Anyway, thanks to darryl.revok (me misreading the logo
) and psychopathicteen (the bullet rendering) for the idea.
Anyway, what the plan is that it'll be top down, and there'll be a layer solely devoted to the ink colors. Whenever there's a change in it, (a splat that appears) the tiles where the change occurred are uploaded to vram, but only if it's onscreen. Whenever the screen scrolls, it'll load extra tiles like any other game. The buffer is to be a lot bigger than the screen, and I'd probably need extra ram on the cartridge if I get that far.
This is really pretty incomplete, (I kind of need to know how to code 8x16 multiplication for multiplying the y position with the buffer width at two parts) but I'm not sure how I should do everything. In the process of writing this, I just realized that my idea of having the code look through the whole splat horizontally won't really work, because in the actual thing, it would need to check collisions... I think I'll recode it to where it draws the thing 8x8 block by block. The splat graphics will just have to have a blank tile at the top and bottom. (I'll be drawing blank areas, but whatever. Probably faster to do that than check every 8x1 pixel sliver.) I'll also reorder where the data for the pixels are in them, but I'll keep how I had the mask and the actual pattern the same, where the bytes for both are intertwined. Actually, additionally, if I'm drawing it by every tile, it should be a lot easier to see what tiles I need to upload if the splat appeared onscreen. (Also, I won't need different code for every width of the splat.) I haven't done anything with checking the edges of the buffer when drawing the graphic, and I really kind of wonder how I'll handle the graphic if it starts off the buffer. (If only parts of the splat are visible from the top and left.)
Anyway, it isn't commented right now because I'm feeling lazy (I have to fix it anyway, so I can do it then.) I find it to be pretty easy to follow, but then again, I wrote it, so...
Anyway, what the plan is that it'll be top down, and there'll be a layer solely devoted to the ink colors. Whenever there's a change in it, (a splat that appears) the tiles where the change occurred are uploaded to vram, but only if it's onscreen. Whenever the screen scrolls, it'll load extra tiles like any other game. The buffer is to be a lot bigger than the screen, and I'd probably need extra ram on the cartridge if I get that far.
This is really pretty incomplete, (I kind of need to know how to code 8x16 multiplication for multiplying the y position with the buffer width at two parts) but I'm not sure how I should do everything. In the process of writing this, I just realized that my idea of having the code look through the whole splat horizontally won't really work, because in the actual thing, it would need to check collisions... I think I'll recode it to where it draws the thing 8x8 block by block. The splat graphics will just have to have a blank tile at the top and bottom. (I'll be drawing blank areas, but whatever. Probably faster to do that than check every 8x1 pixel sliver.) I'll also reorder where the data for the pixels are in them, but I'll keep how I had the mask and the actual pattern the same, where the bytes for both are intertwined. Actually, additionally, if I'm drawing it by every tile, it should be a lot easier to see what tiles I need to upload if the splat appeared onscreen. (Also, I won't need different code for every width of the splat.) I haven't done anything with checking the edges of the buffer when drawing the graphic, and I really kind of wonder how I'll handle the graphic if it starts off the buffer. (If only parts of the splat are visible from the top and left.)
Anyway, it isn't commented right now because I'm feeling lazy (I have to fix it anyway, so I can do it then.) I find it to be pretty easy to follow, but then again, I wrote it, so...
Code: Select all
lda SplatRequestTable+YPosition,x
(Multiply by data per line in buffer. I don't know how.)
sta SplatPosition
lda SplatRequestTable+XPosition,x
ror
ror
and #%0011111111111111
clc
adc SplatPosition
sta SplatPosition
lda SplatRequestTable+XPosition,x
and #%0000000000000111
bne continue_calculating_offset
lda #$0001
sta SplatBetweenTilesWidth
continue_calculating_offset:
tay
lda SplatGraphicOffsetPositionTable,y
clc SplatRequestTable+GraphicOffset,x
sta SplatGraphicOffset
lda SplatRequestTable+Height,x
(Multiply by data per line in buffer. I don't know how.)
clc
adc SplatPosition
sta EndOfSplat
lda SplatRequestTable+Width,x
ror
ror
and #%0011111111111111
sta SplatDataWidth
lda SplatRequestTable+Width,x
clc
adc SplatBetweenTilesWidth
tay
jsr (VaryingWidthCodeAddressTable,y)
;======================================================================
start_draw_splat_8_tile:
ldx SplatPosition
ldy SplatGraphicOffset
draw_splat_8_tile_loop:
lda Buffer,x
and #$0000,y
ora #$0002,y
sta Buffer,x
lda Buffer+16,x
and #$0004,y
ora #$0006,y
sta Buffer+16,x
lda Buffer+32,x
and #$0008,y
ora #$000A,y
sta Buffer+32,x
lda Buffer+48,x
and #$000C,y
ora #$000E,y
sta Buffer+48,x
lda Buffer+64,x
and #$0010,y
ora #$0012,y
sta Buffer+64,x
lda Buffer+80,x
and #$0014,y
ora #$0016,y
sta Buffer+80,x
lda Buffer+96,x
and #$0018,y
ora #$001A,y
sta Buffer+96,x
lda Buffer+112,x
and #$001C,y
ora #$001E,y
sta Buffer+112,x
cpy EndOfSplat
bcs continue_draw_splat_8_tile_loop
(Whatever to get ready for looking at the next splat)
continue_draw_splat_8_tile_loop:
inx
inx
tya
clc
adc SplatDataWidth
tay
bra draw_splat_8_tile_loop

