Ok Thread resurrection!
Seeing as what I'm about to post is
a.) in line with this topic and starting another one when there was this one seems wrong
b.) features a lot of IS bashing which is what I'm going to be posting
c.) we are not suppose to post large reams of code, but this post is about large reams of code..
I think it is valid...
Panel De Pon/ Tetris Attack
OH DEAR, somebody had ROM to burn and was not afraid to do it...
Some highlights include
_noOverflow rep #$20 ;a 16 bit
asl
asl
asl
sep #$20 ;a 8 bit
lsr
lsr
lsr
xba
pha
Or this, which I put down to being a macro but they could have done better than this
ldy #$A952
jsr addVRAMtoDMATable
plb
bra _skipCode
.long $7E2800
.word $06C0,$0080
.byte $78
_skipCode bra j80A971
Most of the time the bra jumps to an RTS. Clearly written by a different programmer than the Decompress routine as that is master class.
One calls it like so
jsr decompress_src_dest ;will make pc+6 for return
.long $94AF3B,$7F5D00
phb
And then the start of the function is as such
decompress_src_dest php
rep #$30 ;a,x,y 16 bit
phb
phx
phy
sep #$20 ;a 8 bit
lda $09,s ;read calling bank
pha
plb ;set to be data bank r
rep #$20 ;a 16 bit
lda $07,s ;read calling address
tax
clc
adc #$0006 ;skip 6 src,dest bytes
sta $07,s ;save back into stack to fix return address
July 27, 2015, 12:07:58 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Due to post char limits ...
Lets plot the blocks shall we?
pltBlock_ABlock_YMapIndex phx
phy
rep #$30 ;a,x,y 16 bit
phb
phk
plb
ldx CurrentRowToVRAMLUTPtr
stx jl7E0024
and #$00FF
asl
tax
lda Player1_Tile_Map_00_0,y
bit #tileType.bounceMode2
bne _rock
bit #tileType.solidBlock
bne _isSolidBlock
bit #tileType.darkPallete
bne _isDarkPallete
bit #tileType.shockFace
bne _isShockFace
bit #invalid
bne _isBounceMode
bit #tileType.bounceMode
bne _isBounceMode
tya
and #$FEFF
tay
lda (jl7E0024),y
tay
jsr (plotNormalLUT,x)
jmp _exit
_isDarkPallete tya
and #$FEFF
tay
lda (jl7E0024),y
tay
jsr (plotDarkLUT,x)
jmp _exit
_isShockFace tya
and #$FEFF
tay
lda (jl7E0024),y
tay
jsr (plotWinceLUT,x)
jmp _exit
_flash tya
and #$FEFF
tay
lda (jl7E0024),y
tay
jsr (plotFlashLUT,x)
jmp _exit
_isBounceMode tya
and #$FEFF
tay
lda (jl7E0024),y
tay
jsr (PlotBounceLUT,x)
jmp _exit
_rock tya
and #$FEFF
tay
lda (jl7E0024),y
a85859C tay
a85859D jsr (plotRockLUT,x)
jmp _exit
_isSolidBlock tya
and #$FEFF
a8585A7 tay
a8585A8 lda (jl7E0024),y
tay
lda a7E0354
bne b8585B6
jsr (jp858EAB,x)
jmp _exit
b8585B6 jsr (jp858EF5,x)
jmp _exit
_exit plb
ply
plx
rtl
.snip.
plotNormalLUT .word <>clearTile ,<>plotHeart ,<>plotCircle ,<>plotUpTriangle
.word <>plotStar ,<>plotDiamond ,<>plotDownTriangle ,<>plotExclamationBlock
plotDarkLUT .word <>clearTile ,<>plotDarkHeart ,<>plotDarkCircle ,<>plotDarkTriangle
.word <>plotDarkStar ,<>plotDarkDiamond ,<>plotDarkDownTriangle ,<>plotDarkExclamationBlock
plotWinceLUT .word <>clearTile ,<>plotWinceHeart ,<>plotWinceCircle ,<>plotWinceUpTriangle
.word <>plotWinceStar ,<>plotWinceDiamond ,<>plotWinceDownTriangle ,<>plotFlashExclamationBlock
plotFlashLUT .word <>clearTile ,<>plotFlashHeart ,<>plotFlashCircle ,<>plotFlashUpTriangle
.word <>plotFlashStar ,<>plotFlashDiamond ,<>plotFlashDownTriangle ,<>plotSolidBlock
PlotBounceLUT .word <>clearTile ,<>plotFullyRaisedHeart ,<>plotFullyRaisedCircle ,<>plotFullyRaisedTriangle
.word <>plotFullyRaisedStar ,<>plotFullyRaisedDiamond ,<>plotFullyRaisedDownTriangle ,<>plotFullyRaiseExclamationBlock
.word <>plotRaisedHeart ,<>plotRaisedCircle ,<>plotRaisedTriangle ,<>plotRaisedStar
.word <>plotRaisedDiamond ,<>plotRaisedDownTriangle ,<>plotRaisedExclamationBlock ,<>plotHeart2
.word <>plotCircle2 ,<>plotUpTriangle2 ,<>plotStar2 ,<>plotDiamond2
.word <>plotDownTriangle ,<>plotExclamationBlock2 ,<>plotSquishedHeart ,<>plotSquishedCircle
.word <>plotSquishedTriangle ,<>plotSquishedStar ,<>plotSquishedDiamond ,<>plotSquishedDownTriangle
.word <>plotSquishedExclamationBlock ,<>plotHeart ,<>plotCircle ,<>plotUpTriangle
.word <>plotStar ,<>plotDiamond ,<>plotDownTriangle ,<>plotExclamationBlock
plotRockLUT .word <>plotSingleRockBlock ,<>plotLeftEdgeRockBlock ,<>plotMiddleRockBlock ,<>plotEndRockBlock
plotSolidLUT .word <>plotSolidBlock
And then there is the actual plot code - brace yourself I have left the HEX in so you can see the patterns as well
85/87AC BB clearTile tyx
85/87AD A9 00 00 lda #$0000
85/87B0 9F 00 20 7E sta BG1_VRAM_TMAP_MIRROR_0_0,x
85/87B4 9F 02 20 7E sta BG1_VRAM_TMAP_MIRROR_0_1,x
85/87B8 9F 40 20 7E sta BG1_VRAM_TMAP_MIRROR_1_0,x
85/87BC 9F 42 20 7E sta BG1_VRAM_TMAP_MIRROR_1_1,x
85/87C0 60 rts
85/87C1 BB plotHeart tyx
85/87C2 A9 A0 04 lda #blockTileMap.heart_TL
85/87C5 9F 00 20 7E sta BG1_VRAM_TMAP_MIRROR_0_0,x
85/87C9 A9 A1 04 lda #blockTileMap.heart_TR
85/87CC 9F 02 20 7E sta BG1_VRAM_TMAP_MIRROR_0_1,x
85/87D0 A9 A2 04 lda #blockTileMap.heart_BL
85/87D3 9F 40 20 7E sta BG1_VRAM_TMAP_MIRROR_1_0,x
85/87D7 A9 A3 04 lda #blockTileMap.heart_BR
85/87DA 9F 42 20 7E sta BG1_VRAM_TMAP_MIRROR_1_1,x
85/87DE 60 rts
85/87DF BB plotCircle tyx
85/87E0 A9 A4 04 lda #blockTileMap.circle_TL
85/87E3 9F 00 20 7E sta BG1_VRAM_TMAP_MIRROR_0_0,x
85/87E7 A9 A5 04 lda #blockTileMap.circle_TR
85/87EA 9F 02 20 7E sta BG1_VRAM_TMAP_MIRROR_0_1,x
85/87EE A9 A6 04 lda #blockTileMap.circle_BL
85/87F1 9F 40 20 7E sta BG1_VRAM_TMAP_MIRROR_1_0,x
85/87F5 A9 A7 04 lda #blockTileMap.circle_BR
85/87F8 9F 42 20 7E sta BG1_VRAM_TMAP_MIRROR_1_1,x
85/87FC 60 rts
85/87FD BB plotUpTriangle tyx
85/87FE A9 A8 04 lda #blockTileMap.upTriangle_TL
85/8801 9F 00 20 7E sta BG1_VRAM_TMAP_MIRROR_0_0,x
85/8805 A9 A9 04 lda #blockTileMap.upTriangle_TR
85/8808 9F 02 20 7E sta BG1_VRAM_TMAP_MIRROR_0_1,x
85/880C A9 AA 04 lda #blockTileMap.upTriangle_BL
85/880F 9F 40 20 7E sta BG1_VRAM_TMAP_MIRROR_1_0,x
85/8813 A9 AB 04 lda #blockTileMap.upTriangle_BR
85/8816 9F 42 20 7E sta BG1_VRAM_TMAP_MIRROR_1_1,x
85/881A 60 rts
85/881B BB plotStar tyx
85/881C A9 AC 04 lda #blockTileMap.star_TL
85/881F 9F 00 20 7E sta BG1_VRAM_TMAP_MIRROR_0_0,x
85/8823 A9 AD 04 lda #blockTileMap.star_TR
85/8826 9F 02 20 7E sta BG1_VRAM_TMAP_MIRROR_0_1,x
85/882A A9 AE 04 lda #blockTileMap.star_BL
85/882D 9F 40 20 7E sta BG1_VRAM_TMAP_MIRROR_1_0,x
85/8831 A9 AF 04 lda #blockTileMap.star_BR
85/8834 9F 42 20 7E sta BG1_VRAM_TMAP_MIRROR_1_1,x
85/8838 60 rts
85/8839 BB plotDiamond tyx
85/883A A9 B0 08 lda #blockTileMap.diamond_TL
85/883D 9F 00 20 7E sta BG1_VRAM_TMAP_MIRROR_0_0,x
85/8841 A9 B1 08 lda #blockTileMap.diamond_TR
85/8844 9F 02 20 7E sta BG1_VRAM_TMAP_MIRROR_0_1,x
85/8848 A9 B2 08 lda #blockTileMap.diamond_BL
85/884B 9F 40 20 7E sta BG1_VRAM_TMAP_MIRROR_1_0,x
85/884F A9 B3 08 lda #blockTileMap.diamond_BR
85/8852 9F 42 20 7E sta BG1_VRAM_TMAP_MIRROR_1_1,x
85/8856 60 rts
85/8857 BB plotDownTriangle tyx
85/8858 A9 B4 08 lda #blockTileMap.downTriangle_TL
85/885B 9F 00 20 7E sta BG1_VRAM_TMAP_MIRROR_0_0,x
85/885F A9 B5 08 lda #blockTileMap.downTriangle_TR
85/8862 9F 02 20 7E sta BG1_VRAM_TMAP_MIRROR_0_1,x
85/8866 A9 B6 08 lda #blockTileMap.downTriangle_BL
85/8869 9F 40 20 7E sta BG1_VRAM_TMAP_MIRROR_1_0,x
85/886D A9 B7 08 lda #blockTileMap.downTriangle_BR
85/8870 9F 42 20 7E sta BG1_VRAM_TMAP_MIRROR_1_1,x
85/8874 60 rts