Replace .fills with consts wherever possible
Reduces filesize from 8kB to 5kB
This commit is contained in:
parent
4959a34dcb
commit
6ba6c568df
3 changed files with 25 additions and 23 deletions
|
@ -1,8 +1,21 @@
|
|||
// vim: filetype=kickass
|
||||
|
||||
tree_clear:
|
||||
lda #0
|
||||
tay
|
||||
|
||||
!loop:
|
||||
sta tree_values_lo, y
|
||||
sta tree_values_hi, y
|
||||
sta tree_left, y
|
||||
sta tree_right, y
|
||||
iny
|
||||
bne !loop-
|
||||
|
||||
rts
|
||||
|
||||
.const next_index = $02
|
||||
.const input = $03
|
||||
// NOTE Assumes the tree is zeroed
|
||||
tree_insert:
|
||||
ldx #0
|
||||
|
||||
|
@ -93,14 +106,3 @@ tree_contains:
|
|||
rts
|
||||
|
||||
brk
|
||||
|
||||
|
||||
.align $100
|
||||
tree_values_lo:
|
||||
.fill 256, 0
|
||||
tree_values_hi:
|
||||
.fill 256, 0
|
||||
tree_left:
|
||||
.fill 256, 0
|
||||
tree_right:
|
||||
.fill 256, 0
|
||||
|
|
12
c64/main.asm
12
c64/main.asm
|
@ -126,6 +126,7 @@ main:
|
|||
sta $01
|
||||
|
||||
jsr generate_multiplication_tables
|
||||
jsr tree_clear
|
||||
//jsr test_tree
|
||||
|
||||
|
||||
|
@ -145,14 +146,3 @@ day01_input:
|
|||
.import text "../rust/inputs/day01"
|
||||
.byte 0
|
||||
|
||||
.align $100
|
||||
* = * "Square table"
|
||||
square1_lo:
|
||||
.fill 512, 0
|
||||
square1_hi:
|
||||
.fill 512, 0
|
||||
square2_lo:
|
||||
.fill 512, 0
|
||||
square2_hi:
|
||||
.fill 512, 0
|
||||
|
||||
|
|
10
c64/math.inc
10
c64/math.inc
|
@ -1,4 +1,14 @@
|
|||
// vim: filetype=kickass
|
||||
.const square1_lo = $c000
|
||||
.const square1_hi = $c200
|
||||
.const square2_lo = $c400
|
||||
.const square2_hi = $c600
|
||||
|
||||
.const tree_values_lo = $c900
|
||||
.const tree_values_hi = $ca00
|
||||
.const tree_left = $cb00
|
||||
.const tree_right = $cc00
|
||||
|
||||
.const udivmod32_dividend = $10 // 11,12,13
|
||||
.const udivmod32_divisor = $14 // 15,16,17
|
||||
.const udivmod32_result = $18 // 19,1a,1b
|
||||
|
|
Loading…
Reference in a new issue