diff --git a/src/data/mult.asm b/src/data/mult.asm deleted file mode 100644 index 82e4f9b6..00000000 --- a/src/data/mult.asm +++ /dev/null @@ -1,9 +0,0 @@ -multBy10Table: - .byte $00,$0A,$14,$1E,$28,$32,$3C,$46 - .byte $50,$5A,$64,$6E,$78,$82,$8C,$96 - .byte $A0,$AA,$B4,$BE -multBy32Table: - .byte 0,32,64,96,128,160,192,224 -multBy100Table: - .byte $0, $64, $c8, $2c, $90 - .byte $f4, $58, $bc, $20, $84 diff --git a/src/data/mult_orient.asm b/src/data/mult_orient.asm new file mode 100644 index 00000000..a1bcd73f --- /dev/null +++ b/src/data/mult_orient.asm @@ -0,0 +1,105 @@ +; multiplication and orientation tables +; Combined to share a common page. Crossing page boundaries in table lookups +; costs an extra cycle and causes timing variance that can add up. One advantage +; of these tables taking nearly a full page is being able to use the end of the +; page for lookups to the multBy10Table. The game logic multiplies tetriminoY (or +; offsets determined by the orientation table) by 10 frequently. During these +; calculations, this value is never less than -2 and never greater than 20. A 256 +; byte lookup table would be mostly wasteful except the first 20 and last 2 bytes. +; The repeated calls to isPositionValid used for harddrop and 0 arr see a massive +; impact from these optimisations. + +; mult10Tail at end of this page allows table lookup for all possible values of tetriminoY (-2..=20) +multOrientBegin: +.assert