Jump to content
IGNORED

Spire of the Ancients (WIP)


SmittyB

Recommended Posts

I've cracked it and it's all working now. It just took a copious amount of irn bru and Iron Maiden to get through.

It's funny, it almost doesn't feel different because I'm familiar with the maps but at the same time it feels a lot better to play. I've already found one spot where being able to see further made a map transition visible so I'll need to watch out for that going forward.

0049.png.6c2f04b813e04b22fc8a7df5827fc731.png0048.png.7ba525f6d514ad3a5972e1e58a9f886d.png

 

In case anyone is curious, here's the hefty chunk of code that resulted. I'll tidy up the parts where I'm making checks and then clearing the same bits of tilemap either side of the branch for the sake of saving some ROM, but I think it's about as efficient as it can be which is nice.

Spoiler

drawWalls
	asm
.draw0
	lda viewM1
	beq draw0SkipWallM1
	ldx #12
draw0M1Loop
	lda #0
	sta wallsTileMapLine0-1+4,x
	sta wallsTileMapLine1-1+4,x
	sta wallsTileMapLine8-1+4,x
	sta wallsTileMapLine9-1+4,x
	
	lda M1-1,x
	sta wallsTileMapLine2-1+4,x
	lda M1-1+12,x
	sta wallsTileMapLine3-1+4,x
	lda M1-1+24,x
	sta wallsTileMapLine4-1+4,x
	lda M1-1+36,x
	sta wallsTileMapLine5-1+4,x
	lda M1-1+48,x
	sta wallsTileMapLine6-1+4,x
	lda M1-1+60,x
	sta wallsTileMapLine7-1+4,x	
	dex
	bne draw0M1Loop
draw0SkipWallM1

	lda viewL0
	beq draw0SkipWallL0
	ldx #4
draw0WallL0Loop
	lda L0-1,x
	sta wallsTileMapLine0-1,x
	lda L0-1+4,x
	sta wallsTileMapLine1-1,x
	lda L0-1+8,x
	sta wallsTileMapLine2-1,x
	lda L0-1+12,x
	sta wallsTileMapLine3-1,x
	lda L0-1+16,x
	sta wallsTileMapLine4-1,x
	lda L0-1+20,x
	sta wallsTileMapLine5-1,x
	lda L0-1+24,x
	sta wallsTileMapLine6-1,x
	lda L0-1+28,x
	sta wallsTileMapLine7-1,x
	lda L0-1+32,x
	sta wallsTileMapLine8-1,x
	lda L0-1+36,x
	sta wallsTileMapLine9-1,x
	dex
	bne draw0WallL0Loop
	jmp draw0WallsLSkip
draw0SkipWallL0

	;viewL0=0
	lda viewL1
	beq draw0SkipWallL1
	ldx #4
draw0WallsL1Loop
	lda #0
	sta wallsTileMapLine0-1,x
	sta wallsTileMapLine1-1,x
	sta wallsTileMapLine8-1,x
	sta wallsTileMapLine9-1,x
	
	lda M1-1+8,x
	sta wallsTileMapLine2-1,x
	lda M1-1+20,x
	sta wallsTileMapLine3-1,x
	lda M1-1+32,x
	sta wallsTileMapLine4-1,x
	lda M1-1+44,x
	sta wallsTileMapLine5-1,x
	lda M1-1+56,x
	sta wallsTileMapLine6-1,x
	lda M1-1+68,x
	sta wallsTileMapLine7-1,x
	dex
	bne draw0WallsL1Loop
	jmp draw0WallsLSkip
draw0SkipWallL1

	;viewL0=0 / viewL1=0
	;Checking LL1
	lda viewLL1
	beq draw0SkipWallLL1
draw0WallLL1Loop
	lda #0
	sta wallsTileMapLine0
	sta wallsTileMapLine1
	sta wallsTileMapLine2
	sta wallsTileMapLine7
	sta wallsTileMapLine8
	sta wallsTileMapLine9
	
	lda L1+5
	sta wallsTileMapLine3
	lda L1+8
	sta wallsTileMapLine4
	lda L1+11
	sta wallsTileMapLine5
	lda L1+14
	sta wallsTileMapLine6
	;jmp draw0SkipGapLL1
	jmp draw0SkipBlankLL1
draw0SkipWallLL1

	;viewL0=0 / viewL1=0 / viewLL1=0
	;draw LL1 gap
	;check LL2
	lda viewLL2
	beq draw0SkipGapLL1
draw0GapLL1Loop
	lda #0
	sta wallsTileMapLine0
	sta wallsTileMapLine1
	sta wallsTileMapLine2
	sta wallsTileMapLine7
	sta wallsTileMapLine8
	sta wallsTileMapLine9
	lda M2+5
	sta wallsTileMapLine3
	lda M2+11
	sta wallsTileMapLine4
	lda M2+17
	sta wallsTileMapLine5
	lda M2+23
	sta wallsTileMapLine6
	jmp draw0SkipBlankLL1
draw0SkipGapLL1

	;viewL0=0 / viewL1=0 / viewLL1=0 / viewLL2=0
	;check viewLL3
	lda viewLL3
	beq draw0SkipWallLL3
	lda #0
	sta wallsTileMapLine0
	sta wallsTileMapLine1
	sta wallsTileMapLine2
	sta wallsTileMapLine3
	sta wallsTileMapLine6
	sta wallsTileMapLine7
	sta wallsTileMapLine8
	sta wallsTileMapLine9
	lda M3+0
	sta wallsTileMapLine4
	lda M3+4
	sta wallsTileMapLine5
	jmp draw0SkipBlankLL1
draw0SkipWallLL3	
	
	sta wallsTileMapLine0
	sta wallsTileMapLine1
	sta wallsTileMapLine2
	sta wallsTileMapLine3
	sta wallsTileMapLine4
	sta wallsTileMapLine5
	sta wallsTileMapLine6
	sta wallsTileMapLine7
	sta wallsTileMapLine8
	sta wallsTileMapLine9
draw0SkipBlankLL1

	;viewL0=0 / viewL1=0
	;Checking L2
	lda viewL2
	beq draw0SkipWallL2
	ldx #3
draw0WallsL2Loop
	lda #0
	sta wallsTileMapLine0-1+1,x
	sta wallsTileMapLine1-1+1,x
	sta wallsTileMapLine2-1+1,x
	sta wallsTileMapLine7-1+1,x
	sta wallsTileMapLine8-1+1,x
	sta wallsTileMapLine9-1+1,x
	
	lda M2-1+0,x
	sta wallsTileMapLine3-1+1,x
	lda M2-1+6,x
	sta wallsTileMapLine4-1+1,x
	lda M2-1+12,x
	sta wallsTileMapLine5-1+1,x
	lda M2-1+18,x
	sta wallsTileMapLine6-1+1,x
	dex
	bne draw0WallsL2Loop
	jmp draw0WallsLSkip
draw0SkipWallL2

	;viewL0=0 / viewL1=0 / viewL2=0
	;check LL2
	lda viewLL2
	beq draw0SkipWallLL2
draw0WallLL2Loop
	lda #0
	sta wallsTileMapLine0+1
	sta wallsTileMapLine1+1
	sta wallsTileMapLine2+1
	sta wallsTileMapLine7+1
	sta wallsTileMapLine8+1
	sta wallsTileMapLine9+1
	
	lda L2
	sta wallsTileMapLine3+1
	lda L2+1
	sta wallsTileMapLine4+1
	lda L2+2
	sta wallsTileMapLine5+1
	lda L2+3
	sta wallsTileMapLine6+1
	jmp draw0SkipBlankLL2
draw0SkipWallLL2

	;viewL0=0 / viewL1=0 / viewL2=0 / viewLL2=0
	;check LL3
	lda viewLL3
	beq draw0SkipGapLL2
	lda #0
	sta wallsTileMapLine0+1
	sta wallsTileMapLine1+1
	sta wallsTileMapLine2+1
	sta wallsTileMapLine3+1
	sta wallsTileMapLine6+1
	sta wallsTileMapLine7+1
	sta wallsTileMapLine8+1
	sta wallsTileMapLine9+1
	
	lda M3+3
	sta wallsTileMapLine4+1
	lda M3+7
	sta wallsTileMapLine5+1
	
	;lda M2+6
	;sta wallsTileMapLine3+1
	;lda M2+12
	;sta wallsTileMapLine4+1
	;lda M2+18
	;sta wallsTileMapLine5+1
	;lda M2+24
	;sta wallsTileMapLine6+1
	jmp draw0SkipBlankLL2
draw0SkipGapLL2

	;viewL0=0 / viewL1=0 / viewL2=0 / viewLL2=0 / viewLL3=0
	;Blank LL2
draw0BlankLL2
	lda #0
	sta wallsTileMapLine0+1
	sta wallsTileMapLine1+1
	sta wallsTileMapLine2+1
	sta wallsTileMapLine3+1
	sta wallsTileMapLine4+1
	sta wallsTileMapLine5+1
	sta wallsTileMapLine6+1
	sta wallsTileMapLine7+1
	sta wallsTileMapLine8+1
	sta wallsTileMapLine9+1
draw0SkipBlankLL2

	;viewL0=0 / viewL1=0 / viewL2=0
	;Check L3
	lda viewL3
	beq draw0SkipWallL3
	ldx #2
draw0WallL3Loop
	lda #0
	sta wallsTileMapLine0-1+2,x
	sta wallsTileMapLine1-1+2,x
	sta wallsTileMapLine2-1+2,x
	sta wallsTileMapLine3-1+2,x
	sta wallsTileMapLine6-1+2,x
	sta wallsTileMapLine7-1+2,x
	sta wallsTileMapLine8-1+2,x
	sta wallsTileMapLine9-1+2,x	
	lda M3-1,x
	sta wallsTileMapLine4-1+2,x
	lda M3-1+4,x
	sta wallsTileMapLine5-1+2,x	
	dex
	bne draw0WallL3Loop
	jmp draw0WallsLSkip
draw0SkipWallL3

	;viewL0=0 / viewL1=0 / viewL2=0 / viewL3=0
	;Blank L3
	ldx #2
draw0BlankL3Loop
	lda #0
	sta wallsTileMapLine0-1+2,x
	sta wallsTileMapLine1-1+2,x
	sta wallsTileMapLine2-1+2,x
	sta wallsTileMapLine3-1+2,x
	sta wallsTileMapLine4-1+2,x
	sta wallsTileMapLine5-1+2,x
	sta wallsTileMapLine6-1+2,x
	sta wallsTileMapLine7-1+2,x
	sta wallsTileMapLine8-1+2,x
	sta wallsTileMapLine9-1+2,x
	dex
	bne draw0BlankL3Loop
draw0WallsLSkip

	lda viewR0
	beq draw0SkipWallR0
	ldx #4
draw0WallR0Loop
	lda R0-1,x
	sta wallsTileMapLine0-1+16,x
	lda R0-1+4,x
	sta wallsTileMapLine1-1+16,x
	lda R0-1+8,x
	sta wallsTileMapLine2-1+16,x
	lda R0-1+12,x
	sta wallsTileMapLine3-1+16,x
	lda R0-1+16,x
	sta wallsTileMapLine4-1+16,x
	lda R0-1+20,x
	sta wallsTileMapLine5-1+16,x
	lda R0-1+24,x
	sta wallsTileMapLine6-1+16,x
	lda R0-1+28,x
	sta wallsTileMapLine7-1+16,x
	lda R0-1+32,x
	sta wallsTileMapLine8-1+16,x
	lda R0-1+36,x
	sta wallsTileMapLine9-1+16,x
	dex
	bne draw0WallR0Loop
	jmp draw0WallsRSkip
draw0SkipWallR0

	;viewR0=0
	lda viewR1
	beq draw0SkipWallR1
	ldx #4
draw0WallsR1Loop
	lda #0
	sta wallsTileMapLine0-1+16,x
	sta wallsTileMapLine1-1+16,x
	sta wallsTileMapLine8-1+16,x
	sta wallsTileMapLine9-1+16,x	
	lda M1-1,x
	sta wallsTileMapLine2-1+16,x
	lda M1-1+12,x
	sta wallsTileMapLine3-1+16,x
	lda M1-1+24,x
	sta wallsTileMapLine4-1+16,x
	lda M1-1+36,x
	sta wallsTileMapLine5-1+16,x
	lda M1-1+48,x
	sta wallsTileMapLine6-1+16,x
	lda M1-1+60,x
	sta wallsTileMapLine7-1+16,x	
	dex
	bne draw0WallsR1Loop
	jmp draw0WallsRSkip
draw0SkipWallR1

	;viewR0=0 / viewR1=0
	;Checking RR1
	lda viewRR1
	beq draw0SkipWallRR1
draw0WallRR1Loop
	lda #0
	sta wallsTileMapLine0+19
	sta wallsTileMapLine1+19
	sta wallsTileMapLine2+19
	sta wallsTileMapLine7+19
	sta wallsTileMapLine8+19
	sta wallsTileMapLine9+19
	
	lda R1+3
	sta wallsTileMapLine3+19
	lda R1+6
	sta wallsTileMapLine4+19
	lda R1+9
	sta wallsTileMapLine5+19
	lda R1+12
	sta wallsTileMapLine6+19
	;jmp draw0SkipGapRR1
	jmp draw0SkipBlankRR1
draw0SkipWallRR1

	;viewR0=0 / viewR1=0 / viewRR1=0
	;draw RR1 gap
	;Check RR2
	lda viewRR2
	beq draw0SkipGapRR1
draw0GapRR1Loop
	lda #0
	sta wallsTileMapLine0+19
	sta wallsTileMapLine1+19
	sta wallsTileMapLine2+19
	sta wallsTileMapLine7+19
	sta wallsTileMapLine8+19
	sta wallsTileMapLine9+19
	lda M2
	sta wallsTileMapLine3+19
	lda M2+6
	sta wallsTileMapLine4+19
	lda M2+12
	sta wallsTileMapLine5+19
	lda M2+18
	sta wallsTileMapLine6+19
	jmp draw0SkipBlankRR1
draw0SkipGapRR1

	;viewR0=0 / viewR1=0 / viewRR1=0 / viewRR2=0
	;check viewRR3
	lda viewRR3
	beq draw0SkipWallRR3
	lda #0
	sta wallsTileMapLine0+19
	sta wallsTileMapLine1+19
	sta wallsTileMapLine2+19
	sta wallsTileMapLine3+19
	sta wallsTileMapLine6+19
	sta wallsTileMapLine7+19
	sta wallsTileMapLine8+19
	sta wallsTileMapLine9+19
	lda M3+3
	sta wallsTileMapLine4+19
	lda M3+7
	sta wallsTileMapLine5+19
	jmp draw0SkipBlankRR1
draw0SkipWallRR3	
	
	sta wallsTileMapLine0+19
	sta wallsTileMapLine1+19
	sta wallsTileMapLine2+19
	sta wallsTileMapLine3+19
	sta wallsTileMapLine4+19
	sta wallsTileMapLine5+19
	sta wallsTileMapLine6+19
	sta wallsTileMapLine7+19
	sta wallsTileMapLine8+19
	sta wallsTileMapLine9+19
draw0SkipBlankRR1

	;viewR0=0 / viewR1=0
	;Checking R2
	lda viewR2
	beq draw0SkipWallR2
	ldx #3
draw0WallsR2Loop
	lda #0
	sta wallsTileMapLine0-1+16,x
	sta wallsTileMapLine1-1+16,x
	sta wallsTileMapLine2-1+16,x
	sta wallsTileMapLine7-1+16,x
	sta wallsTileMapLine8-1+16,x
	sta wallsTileMapLine9-1+16,x
	
	lda M2-1+3,x
	sta wallsTileMapLine3-1+16,x
	lda M2-1+9,x
	sta wallsTileMapLine4-1+16,x
	lda M2-1+15,x
	sta wallsTileMapLine5-1+16,x
	lda M2-1+21,x
	sta wallsTileMapLine6-1+16,x
	dex
	bne draw0WallsR2Loop
	jmp draw0WallsRSkip
draw0SkipWallR2	
	
	;viewR0=0 / viewR1=0 / viewR2=0
	;check RR2
	lda viewRR2
	beq draw0SkipWallRR2
draw0WallRR2Loop
	lda #0
	sta wallsTileMapLine0+18
	sta wallsTileMapLine1+18
	sta wallsTileMapLine2+18
	sta wallsTileMapLine7+18
	sta wallsTileMapLine8+18
	sta wallsTileMapLine9+18
	
	lda R2
	sta wallsTileMapLine3+18
	lda R2+1
	sta wallsTileMapLine4+18
	lda R2+2
	sta wallsTileMapLine5+18
	lda R2+3
	sta wallsTileMapLine6+18
	jmp draw0SkipBlankRR2
draw0SkipWallRR2

	;viewR0=0 / viewR1=0 / viewR2=0 / viewRR2=0
	;check RR3
	lda viewRR3
	beq draw0SkipGapRR2
	lda #0
	sta wallsTileMapLine0+18
	sta wallsTileMapLine1+18
	sta wallsTileMapLine2+18
	sta wallsTileMapLine7+18
	sta wallsTileMapLine8+18
	sta wallsTileMapLine9+18
	
	sta wallsTileMapLine3+18
	sta wallsTileMapLine6+18
	lda M3
	sta wallsTileMapLine4+18
	lda M3+4
	sta wallsTileMapLine5+18
	
	;lda M2+6
	;sta wallsTileMapLine3+18
	;lda M2+12
	;sta wallsTileMapLine4+18
	;lda M2+18
	;sta wallsTileMapLine5+18
	;lda M2+24
	;sta wallsTileMapLine6+18
	jmp draw0SkipBlankRR2
draw0SkipGapRR2

	;viewR0=0 / viewR1=0 / viewR2=0 / viewRR2=0 / viewRR3=0
	;Blank RR2
draw0BlankRR2
	lda #0
	sta wallsTileMapLine0+18
	sta wallsTileMapLine1+18
	sta wallsTileMapLine2+18
	sta wallsTileMapLine3+18
	sta wallsTileMapLine4+18
	sta wallsTileMapLine5+18
	sta wallsTileMapLine6+18
	sta wallsTileMapLine7+18
	sta wallsTileMapLine8+18
	sta wallsTileMapLine9+18
draw0SkipBlankRR2

	;viewR0=0 / viewR1=0 / viewR2=0
	;Check R3
	lda viewR3
	beq draw0SkipWallR3
	ldx #2
draw0WallR3Loop
	lda #0
	sta wallsTileMapLine0-1+16,x
	sta wallsTileMapLine1-1+16,x
	sta wallsTileMapLine2-1+16,x
	sta wallsTileMapLine3-1+16,x
	sta wallsTileMapLine6-1+16,x
	sta wallsTileMapLine7-1+16,x
	sta wallsTileMapLine8-1+16,x
	sta wallsTileMapLine9-1+16,x	
	lda M3-1+2,x
	sta wallsTileMapLine4-1+16,x
	lda M3-1+6,x
	sta wallsTileMapLine5-1+16,x
	dex
	bne draw0WallR3Loop
	jmp draw0WallsRSkip
draw0SkipWallR3

	ldx #2
draw0BlankR3Loop
	lda #0
	sta wallsTileMapLine0-1+16,x
	sta wallsTileMapLine1-1+16,x
	sta wallsTileMapLine2-1+16,x
	sta wallsTileMapLine3-1+16,x
	sta wallsTileMapLine4-1+16,x
	sta wallsTileMapLine5-1+16,x
	sta wallsTileMapLine6-1+16,x
	sta wallsTileMapLine7-1+16,x
	sta wallsTileMapLine8-1+16,x
	sta wallsTileMapLine9-1+16,x
	dex
	bne draw0BlankR3Loop
	
draw0WallsRSkip
	rts
	
.draw1
	lda viewM2
	beq draw1SkipWallM2
	ldx #6
draw1M2Loop
	lda #0
	sta wallsTileMapLine0-1+7,x
	sta wallsTileMapLine1-1+7,x
	sta wallsTileMapLine2-1+7,x
	sta wallsTileMapLine7-1+7,x
	sta wallsTileMapLine8-1+7,x
	sta wallsTileMapLine9-1+7,x	
	lda M2-1,x
	sta wallsTileMapLine3-1+7,x
	lda M2-1+6,x
	sta wallsTileMapLine4-1+7,x
	lda M2-1+12,x
	sta wallsTileMapLine5-1+7,x
	lda M2-1+18,x
	sta wallsTileMapLine6-1+7,x	
	dex
	bne draw1M2Loop
draw1SkipWallM2

	lda viewL1
	beq draw1SkipWallL1
	ldx #3
draw1WallL1Loop
	lda #0
	sta wallsTileMapLine0-1+4,x
	sta wallsTileMapLine1-1+4,x
	sta wallsTileMapLine8-1+4,x
	sta wallsTileMapLine9-1+4,x
	lda L1-1,x
	sta wallsTileMapLine2-1+4,x
	lda L1-1+3,x
	sta wallsTileMapLine3-1+4,x
	lda L1-1+6,x
	sta wallsTileMapLine4-1+4,x
	lda L1-1+9,x
	sta wallsTileMapLine5-1+4,x
	lda L1-1+12,x
	sta wallsTileMapLine6-1+4,x
	lda L1-1+15,x
	sta wallsTileMapLine7-1+4,x
	dex
	bne draw1WallL1Loop
	jmp draw1WallsLSkip
draw1SkipWallL1

	;viewL1=0
	;Check L2 for gap
	lda viewL2
	beq draw1SkipGapL1
	ldx #3
draw1GapL1Loop
	lda #0
	sta wallsTileMapLine0-1+4,x
	sta wallsTileMapLine1-1+4,x
	sta wallsTileMapLine2-1+4,x
	sta wallsTileMapLine7-1+4,x
	sta wallsTileMapLine8-1+4,x
	sta wallsTileMapLine9-1+4,x
	
	lda M2-1+3,x
	sta wallsTileMapLine3-1+4,x
	lda M2-1+9,x
	sta wallsTileMapLine4-1+4,x
	lda M2-1+15,x
	sta wallsTileMapLine5-1+4,x
	lda M2-1+21,x
	sta wallsTileMapLine6-1+4,x
	dex
	bne draw1GapL1Loop
	jmp draw1WallsLSkip
draw1SkipGapL1

	;viewL1=0 / viewL2=0
	;CheckLL2 for side wall
	lda viewLL2
	beq draw1SkipWallL2
	ldx #3
draw1WallLL2Loop
	lda #0
	sta wallsTileMapLine0+4
	sta wallsTileMapLine1+4
	sta wallsTileMapLine2+4
	sta wallsTileMapLine7+4
	sta wallsTileMapLine8+4
	sta wallsTileMapLine9+4
	
	lda L2
	sta wallsTileMapLine3+4
	lda L2+1
	sta wallsTileMapLine4+4
	lda L2+2
	sta wallsTileMapLine5+4
	lda L2+3
	sta wallsTileMapLine6+4
	jmp draw1SkipBlankLL2
draw1SkipWallL2

	;viewL1=0 / viewL2=0 / viewLL2=0
	;check for LL2 gap
	lda viewLL3
	beq draw1SkipGapLL2
	lda #0
	sta wallsTileMapLine0+4
	sta wallsTileMapLine1+4
	sta wallsTileMapLine2+4
	sta wallsTileMapLine3+4
	sta wallsTileMapLine6+4
	sta wallsTileMapLine7+4
	sta wallsTileMapLine8+4
	sta wallsTileMapLine9+4
	
	lda M3+3
	sta wallsTileMapLine4+4
	lda M3+7
	sta wallsTileMapLine5+4
	jmp draw1SkipBlankLL2
draw1SkipGapLL2

	;viewL1=0 / viewL2=0 / viewLL2=0 / viewLL3=0
	;blank LL2
	lda #0
	sta wallsTileMapLine0+4
	sta wallsTileMapLine1+4
	sta wallsTileMapLine2+4
	sta wallsTileMapLine3+4
	sta wallsTileMapLine4+4
	sta wallsTileMapLine5+4
	sta wallsTileMapLine6+4
	sta wallsTileMapLine7+4
	sta wallsTileMapLine8+4
	sta wallsTileMapLine9+4
draw1SkipBlankLL2
	
	;viewL1=0 / viewL2=0
	;Check L3
	lda viewL3
	beq draw1SkipWallL3
	ldx #2
draw1WallL3Loop
	lda #0
	sta wallsTileMapLine0-1+5,x
	sta wallsTileMapLine1-1+5,x
	sta wallsTileMapLine2-1+5,x
	sta wallsTileMapLine3-1+5,x
	sta wallsTileMapLine6-1+5,x
	sta wallsTileMapLine7-1+5,x
	sta wallsTileMapLine8-1+5,x
	sta wallsTileMapLine9-1+5,x	
	lda M3-1+0,x
	sta wallsTileMapLine4-1+5,x
	lda M3-1+4,x
	sta wallsTileMapLine5-1+5,x	
	dex
	bne draw1WallL3Loop
	jmp draw1WallsLSkip
draw1SkipWallL3

	;viewL1=0 / viewL2=0 / viewL3=0
	;Blank L3
	ldx #2
draw1BlankL3Loop
	lda #0
	sta wallsTileMapLine0-1+5,x
	sta wallsTileMapLine1-1+5,x
	sta wallsTileMapLine2-1+5,x
	sta wallsTileMapLine3-1+5,x
	sta wallsTileMapLine4-1+5,x
	sta wallsTileMapLine5-1+5,x
	sta wallsTileMapLine6-1+5,x
	sta wallsTileMapLine7-1+5,x
	sta wallsTileMapLine8-1+5,x
	sta wallsTileMapLine9-1+5,x
	dex
	bne draw1BlankL3Loop
draw1WallsLSkip
	
	lda viewR1
	beq draw1SkipWallR1
	ldx #3
draw1WallR1Loop
	lda #0
	sta wallsTileMapLine0-1+13,x
	sta wallsTileMapLine1-1+13,x
	sta wallsTileMapLine8-1+13,x
	sta wallsTileMapLine9-1+13,x
	lda R1-1,x
	sta wallsTileMapLine2-1+13,x
	lda R1-1+3,x
	sta wallsTileMapLine3-1+13,x
	lda R1-1+6,x
	sta wallsTileMapLine4-1+13,x
	lda R1-1+9,x
	sta wallsTileMapLine5-1+13,x
	lda R1-1+12,x
	sta wallsTileMapLine6-1+13,x
	lda R1-1+15,x
	sta wallsTileMapLine7-1+13,x
	dex
	bne draw1WallR1Loop
	jmp draw1WallsRSkip
draw1SkipWallR1

	;viewR1=0
	;CheckR2 for gap
	lda viewR2
	beq draw1SkipGapR1
	ldx #3
draw1GapR1Loop
	lda #0
	sta wallsTileMapLine0-1+13,x
	sta wallsTileMapLine1-1+13,x
	sta wallsTileMapLine2-1+13,x
	sta wallsTileMapLine7-1+13,x
	sta wallsTileMapLine8-1+13,x
	sta wallsTileMapLine9-1+13,x	
	lda M2-1,x
	sta wallsTileMapLine3-1+13,x
	lda M2-1+6,x
	sta wallsTileMapLine4-1+13,x
	lda M2-1+12,x
	sta wallsTileMapLine5-1+13,x
	lda M2-1+18,x
	sta wallsTileMapLine6-1+13,x
	dex
	bne draw1GapR1Loop
	jmp draw1WallsRSkip
draw1SkipGapR1
	
	;viewR1=0 / viewR2=0
	;CheckRR2 for side wall
	lda viewRR2
	beq draw1SkipWallR2
	;ldx #3
draw1WallRR2Loop
	lda #0
	sta wallsTileMapLine0+15
	sta wallsTileMapLine1+15
	sta wallsTileMapLine2+15
	sta wallsTileMapLine7+15
	sta wallsTileMapLine8+15
	sta wallsTileMapLine9+15
	lda R2
	sta wallsTileMapLine3+15
	lda R2+1
	sta wallsTileMapLine4+15
	lda R2+2
	sta wallsTileMapLine5+15
	lda R2+3
	sta wallsTileMapLine6+15
	jmp draw1SkipBlankRR2
draw1SkipWallR2
	
	;viewR1=0 / viewR2=0 / viewRR2=0
	;check for RR2 gap
	lda viewRR3
	beq draw1SkipGapRR2
	lda #0
	sta wallsTileMapLine0+15
	sta wallsTileMapLine1+15
	sta wallsTileMapLine2+15
	sta wallsTileMapLine3+15
	sta wallsTileMapLine6+15
	sta wallsTileMapLine7+15
	sta wallsTileMapLine8+15
	sta wallsTileMapLine9+15
	
	lda M3+0
	sta wallsTileMapLine4+15
	lda M3+4
	sta wallsTileMapLine5+15
	jmp draw1SkipBlankRR2
draw1SkipGapRR2

	;viewR1=0 / viewR2=0 / viewRR2=0 / viewRR3=0
	;blank RR3
	lda #0
	sta wallsTileMapLine0+15
	sta wallsTileMapLine1+15
	sta wallsTileMapLine2+15
	sta wallsTileMapLine3+15
	sta wallsTileMapLine4+15
	sta wallsTileMapLine5+15
	sta wallsTileMapLine6+15
	sta wallsTileMapLine7+15
	sta wallsTileMapLine8+15
	sta wallsTileMapLine9+15
draw1SkipBlankRR2
	
	;viewR1=0 / viewR2=0
	;Check R3
	lda viewR3
	beq draw1SkipWallR3
	ldx #2
draw1WallR3Loop
	lda #0
	sta wallsTileMapLine0-1+13,x
	sta wallsTileMapLine1-1+13,x
	sta wallsTileMapLine2-1+13,x
	sta wallsTileMapLine3-1+13,x
	sta wallsTileMapLine6-1+13,x
	sta wallsTileMapLine7-1+13,x
	sta wallsTileMapLine8-1+13,x
	sta wallsTileMapLine9-1+13,x	
	lda M3-1+2,x
	sta wallsTileMapLine4-1+13,x
	lda M3-1+6,x
	sta wallsTileMapLine5-1+13,x	
	dex
	bne draw1WallR3Loop
	jmp draw1WallsRSkip
draw1SkipWallR3

	;viewR1=0 / viewR2=0 / viewR3=0
	;Blank R3
	ldx #2
draw1BlankR3Loop
	lda #0
	sta wallsTileMapLine0-1+13,x
	sta wallsTileMapLine1-1+13,x
	sta wallsTileMapLine2-1+13,x
	sta wallsTileMapLine3-1+13,x
	sta wallsTileMapLine4-1+13,x
	sta wallsTileMapLine5-1+13,x
	sta wallsTileMapLine6-1+13,x
	sta wallsTileMapLine7-1+13,x
	sta wallsTileMapLine8-1+13,x
	sta wallsTileMapLine9-1+13,x
	dex
	bne draw1BlankR3Loop
draw1WallsRSkip
	rts
	
.draw2
	lda viewM3
	beq draw2SkipWallM3
	ldx #4
draw2WallM3Loop
	lda #0
	sta wallsTileMapLine0-1+8,x
	sta wallsTileMapLine1-1+8,x
	sta wallsTileMapLine2-1+8,x
	sta wallsTileMapLine3-1+8,x
	sta wallsTileMapLine6-1+8,x
	sta wallsTileMapLine7-1+8,x
	sta wallsTileMapLine8-1+8,x
	sta wallsTileMapLine9-1+8,x
	lda M3-1,x
	sta wallsTileMapLine4-1+8,x
	lda M3-1+4,x
	sta wallsTileMapLine5-1+8,x
	dex
	bne draw2WallM3Loop
	jmp draw2SkipBlankM3
draw2SkipWallM3

	ldx #4
draw2BlankM3Loop
	lda #0
	sta wallsTileMapLine0-1+8,x
	sta wallsTileMapLine1-1+8,x
	sta wallsTileMapLine2-1+8,x
	sta wallsTileMapLine3-1+8,x
	sta wallsTileMapLine4-1+8,x
	sta wallsTileMapLine5-1+8,x
	sta wallsTileMapLine6-1+8,x
	sta wallsTileMapLine7-1+8,x
	sta wallsTileMapLine8-1+8,x
	sta wallsTileMapLine9-1+8,x
	dex
	bne draw2BlankM3Loop
draw2SkipBlankM3

	lda viewL2
	beq draw2SkipWallL2
	lda #0
	sta wallsTileMapLine0+7
	sta wallsTileMapLine1+7
	sta wallsTileMapLine2+7
	sta wallsTileMapLine7+7
	sta wallsTileMapLine8+7
	sta wallsTileMapLine9+7
	lda L2
	sta wallsTileMapLine3+7
	lda L2+1
	sta wallsTileMapLine4+7
	lda L2+2
	sta wallsTileMapLine5+7
	lda L2+3
	sta wallsTileMapLine6+7
	jmp draw2WallsLSkip
draw2SkipWallL2
	
	;viewL2=0
	;check viewL3
	lda viewL3
	beq draw2SkipWallL3
	lda #0
	sta wallsTileMapLine0+7
	sta wallsTileMapLine1+7
	sta wallsTileMapLine2+7
	sta wallsTileMapLine3+7
	sta wallsTileMapLine6+7
	sta wallsTileMapLine7+7
	sta wallsTileMapLine8+7
	sta wallsTileMapLine9+7
	lda M3+3,x
	sta wallsTileMapLine4+7,x
	lda M3+7,x
	sta wallsTileMapLine5+7,x
	jmp draw2WallsLSkip
draw2SkipWallL3
	
	;viewL2=0 / viewL3=0
	;Blank L3
	lda #0
	sta wallsTileMapLine0+7
	sta wallsTileMapLine1+7
	sta wallsTileMapLine2+7
	sta wallsTileMapLine3+7
	sta wallsTileMapLine4+7
	sta wallsTileMapLine5+7
	sta wallsTileMapLine6+7
	sta wallsTileMapLine7+7
	sta wallsTileMapLine8+7
	sta wallsTileMapLine9+7
draw2WallsLSkip

	lda viewR2
	beq draw2SkipWallR2
	lda #0
	sta wallsTileMapLine0+12
	sta wallsTileMapLine1+12
	sta wallsTileMapLine2+12
	sta wallsTileMapLine7+12
	sta wallsTileMapLine8+12
	sta wallsTileMapLine9+12
	lda R2
	sta wallsTileMapLine3+12
	lda R2+1
	sta wallsTileMapLine4+12
	lda R2+2
	sta wallsTileMapLine5+12
	lda R2+3
	sta wallsTileMapLine6+12
	jmp draw2WallsRSkip
draw2SkipWallR2
	
	;viewR2=0
	;check viewR3
	lda viewR3
	beq draw2SkipWallR3
	lda #0
	sta wallsTileMapLine0+12
	sta wallsTileMapLine1+12
	sta wallsTileMapLine2+12
	sta wallsTileMapLine3+12
	sta wallsTileMapLine6+12
	sta wallsTileMapLine7+12
	sta wallsTileMapLine8+12
	sta wallsTileMapLine9+12
	lda M3+0,x
	sta wallsTileMapLine4+12,x
	lda M3+4,x
	sta wallsTileMapLine5+12,x
	jmp draw2WallsRSkip
draw2SkipWallR3
	
	;viewR2=0 / viewR3=0
	;Blank R3
	lda #0
	sta wallsTileMapLine0+12
	sta wallsTileMapLine1+12
	sta wallsTileMapLine2+12
	sta wallsTileMapLine3+12
	sta wallsTileMapLine4+12
	sta wallsTileMapLine5+12
	sta wallsTileMapLine6+12
	sta wallsTileMapLine7+12
	sta wallsTileMapLine8+12
	sta wallsTileMapLine9+12
draw2WallsRSkip
	rts
end

 

 

  • Like 8
Link to comment
Share on other sites

1 hour ago, SlidellMan said:

Will there be deep parts of the flooded tunnels?

Not in the sense of full of water. I wanted to but dropped the idea very early due to various constraints. Catacomb 3D has a couple of water levels that were what I was going for. I think I could still do it but it'll be more hassle than it's worth.

 

I probably won't add any lower levels to the flooded tunnels as they're mainly a path back to the underground area which will be the third main area after the graveyard and garden labyrinth and that will have more verticality in its layout.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Hey, it looks very nice!!! :-D 

1 hour ago, SmittyB said:

I've already found one spot where being able to see further made a map transition visible so I'll need to watch out for that going forward.

1 hour ago, SmittyB said:

In case anyone is curious, here's the hefty chunk of code that resulted. I'll tidy up the parts where I'm making checks and then clearing the same bits of tilemap either side of the branch for the sake of saving some ROM, but I think it's about as efficient as it can be which is nice.

I'm curious enough and tried to figure out which part of the code should be reviewed, but I got lost because I couldn't identify exactly which block represented each label (L0, L1, LL1, etc). I was following the left side and I'm almost sure that there is a wrong check or some portion is being drawn twice with different tiles (unless I missassigned the labels and I'm looking at the wrong place).

 

Could you put the labels into your checking matrix?

On 8/30/2020 at 8:19 AM, SmittyB said:

image.png.1d5776ff7dd5fa28b7ea571cc8d54d59.png

Thanks!

 

Link to comment
Share on other sites

3 minutes ago, vitoco said:

Could you put the labels into your checking matrix?

image.png.7ede2dc368e92e8aa535f666cb7639d9.png

 

Nothing is drawn twice that shouldn't be in practice, but there are several branches of code that will reference and draw things in the same spots based on different results from previous checks. Some of the labels / comments are probably inconsistent depending on how I was thinking about the map at the time.

Link to comment
Share on other sites

7 hours ago, SmittyB said:

image.png.7ede2dc368e92e8aa535f666cb7639d9.png

 

Nothing is drawn twice that shouldn't be in practice, but there are several branches of code that will reference and draw things in the same spots based on different results from previous checks. Some of the labels / comments are probably inconsistent depending on how I was thinking about the map at the time.

I reviewed your code and found the following:

 

- draw0 section is OK with minor issues (missing comment and unsorted data assignment in right side).

 

- I shouldn't include LL2, LL3, RR2 and RR3 checks in draw1 section, because those are exactly the same from draw0, i.e. those left tiles would be at column/tile 1 and 4 at the same time if L0, L1 L2 and M0 were clear at the same time (which is not posible in your engine, but you get the idea). Instead, I'd use X=3 in draw1WallL3Loop, just like draw1WallL2Loop, because both L2 and L3 walls are wider than the visible path in columns/tiles 4 to 6 (I'll bet they are columns 1 to 6 and 2 to 7 (*), respectively, just to match what it's on draw0), and that section will be faster to draw.

 

- There is a useless LDX in draw1WallLL2Loop, because data in that section is not indexed (no DEX/BNE there).

 

- There are a couple of indexed access to data in draw2 section without LDX. Fourtunately, X=0 at those points.

 

(*) It seems insane that L3 be wider than M3, but it is the effect of making all the diagonals being parallel, and it is not as relevant as it could be... you need to reuse bitmaps and save bytes ;-)

 

5 hours ago, SmittyB said:

I'll get there eventually, 4 years on and still technically my first 7800 project.

Well, you've made a big imprevement in just a week!!!  Congrats...

 

9 hours ago, Karl G said:

There are a lot of times when rewriting code can be beneficial to a game (or, really, any programming project).

I've lost pieces of code many times, and the rewitten code had been far better than the original!

 

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
On 8/30/2020 at 2:23 PM, RevEng said:

Is a bit-field record of keys and doors possible? 32 bytes would give you 256 possible keys to track, and another 32 bytes would give you 256 possible door locks.

I've rearranged my RAM, found plenty free, and have done exactly this. Now when you collect a key or unlock a door it stays collected or unlocked until you die or otherwise go back to the title screen.

There's no way to save it because I'm already using all 25 bytes allowed for HSC/SaveKey and the passwords are already 50 characters long, anything more would be far too much.

  • Like 2
Link to comment
Share on other sites

That's a good idea but I'll have to see how much space I have left once I've got all the sound effects, music, and voice that I want. As each door is actually 2 objects some are already unlocked to allow backtracking, but of course as it stands you'd then have to unlocked the door to go the other way.

 

I've also colour-coded doors and portcullises that are permanently locked so it's more obvious when a path is a way forward or just decoration.

  • Like 5
Link to comment
Share on other sites

The keypad support is back in. Might have broken the AtariVox support in the process but I guess I'll find out when I next test on hardware.

 

Now that more of the mechanics are nailed down I've revised the layout to prioritise items that have utility and that you might want to switch to frequently. I'm not using 7800BASICs keypad support so nothing is mapped to the centre-lowest key as a bodge fix to the fact that if a keypad isn't plugged in, say if you have a second joystick instead, it will constantly trigger. This way I can assume that if a SaveKey / AtariVox isn't plugged in it's safe to run the keypad code. The right difficulty switch then controls whether the item is put in the left or right hand (but doubles up as enabling/disabling AtariVox speech when a SaveKey is plugged in instead).

Left Item + Right Item + Pause
Left Item - Left Item - Key
Fireball Grapnel Hammer
Lantern   Hag Stone

 

To help with planning I also decided to figure out how many non-unique pickups of each type to scatter around the game given that I can keep track of 86. Strangely when taking into account a couple of other stat bonuses they come out to some pretty convenient values, so much so that I'm not going to bother properly implementing a hidden experience system a la Dungeon Master that I had prototyped in an earlier version. 12 revives also feels like a good number as that'll mean there's about 2 per major area (Ruins / Courtyard, Graveyard, Garden Labyrinth, Underground, Gatehouse, Spire Proper) so anyone should be able to muddle through providing they can find them.

 

  Pickups Total
HP 17 95
Strength 18 95
Armour 10 75
Focus 19 95
Luck 10 75
Revives 12 12

 

  • Like 6
Link to comment
Share on other sites

  • 2 months later...

Back from the Plink. (See what I did there?)

 

Having finished Plink I'm back at this with fresh eyes and renewed enthusiasm. I'm not sure how much time I'll be able to spend on this before the end of the year so I've finished up what I was working on before I stopped and decided I'd better release this build as a snapshot of where things are.

I've included what I've written of a manual so far because there's a few things that I've mentioned in previous posts that others might not see. Having said that I still haven't added any sound effect when gaining new abilities so be sure to check when you hit 10 focus because it's required to proceed.

 

I've tested it on hardware and fortunately I haven't broken the AtariVox support by adding the keypad support back in, however I've not fully tested the keypad support because it turns out manually entered passwords might not work properly. The AtariVox opening phrase "Ride forth to the Spire of the Ancients" is still buggy but the rest are mostly sound.

 

 

From testing it takes about 30 in game minutes for me to play through what's there at the moment and collect all 15 items (keys and revival potions don't count towards this). I'd like to hear from people what the stats screen at the end shows for them or if they're not able to make it as far as the end of the demo for any reason.

 

 

Changes since last released build are:

  • The updated perspective that gives a much better view of the surrounding area.
  • Doors remain unlocked for a given session.
  • Keys remain collected for a given session. They along with doors will reset if the player returns to the title screen via winning, dying, manually soft-resetting, or obviously hard-resetting.
  • Pickups that are not key items now have their unique IDs so will remain collected. Unlike doors and keys these are saved as part of the password.
  • Simplified a few parts of the map to aid navigation.
  • A couple of very minor sound effect changes
  • Small changes to the terrain on the title screen
  • I've opened up the 'Cast of characters' screen that I've repurposed as an animation test. I originally wanted a version of this to be a reward for completion but I've decided to try and have it available from the start but unlock more as the game progresses. It's not at all polished as I just use it for testing, and I have deliberately kept some of the bosses hidden, but it does have AtariVox speech for each enemy name though they're placeholders using the default monotone settings.

 

When it comes to the final game I also really want the title screen to show off the 3D effect which I don't think it's doing very well with the current map data. I've improved how the shadows are added on my terrain generator, but I think I also need to just throw in some extreme changes in height to make it stand out. I've tried to improve the voxel renderer in SotA but touching anything makes it break catastrophically, and it was written during a period of sleep deprivation so I have no idea what madness was going through my head at the time (but it certainly wasn't that I should comment what any of the improperly named variables do).

264017989_SotATitles.thumb.png.d69fa7f2bad6fb944e080023f142f336.png

1506983250_SotATitlesUpdated.thumb.png.0cdadca715f4be1677e4c96112a6306d.png

SotA Manual - 20201223.txt SotA_20201223_NTSC.a78 SotA_20201223_PAL.a78

  • Like 8
  • Thanks 1
Link to comment
Share on other sites

4 hours ago, SlidellMan said:

The only problem I ran into is the left hand getting stuck in a loop. (I was playing it in A7800, by the way.)

I've had this a couple of times in the past, but I've never been able to replicate it and have no idea what could cause it so I've been assuming it's an emulator oddity of some kind for the time being.

 

7 hours ago, gambler172 said:

posting an actual map would be great.

I do have a slightly outdated map that I use for lining up different parts, but I don't want to make it public as the game should be perfectly playable without and if it's not then that's something I'd need to work on. There's a map on a recent previous post that has the general layout but things have changed since that.

  • Thanks 1
Link to comment
Share on other sites

For those wanting a map, here it is so far albeit in 2 dimensions which won't help much where there's a lot of overlap.

Note that I consider this cheating and I really do need to know if people are actually able to get through what's in place so far without the map. If this bit is too difficult for some reason then the rest of it will be too and then what's the point if nobody enjoys it?

 

 

Spoiler

SotA Map 20201217.png

  • Like 4
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...