2020-12-06 17:07:35 +00:00
|
|
|
// vim: filetype=kickass
|
2020-12-06 17:19:02 +00:00
|
|
|
|
2020-12-06 17:07:35 +00:00
|
|
|
#import "math.inc"
|
|
|
|
|
2020-12-08 23:48:29 +00:00
|
|
|
BasicUpstart2(main)
|
2020-12-06 17:07:35 +00:00
|
|
|
|
2020-12-09 08:01:02 +00:00
|
|
|
* = $0900 "Main program"
|
2020-12-06 17:07:35 +00:00
|
|
|
.const SCREEN_RAM = $0400
|
|
|
|
.const COLOR_RAM = $d800
|
|
|
|
|
|
|
|
.const kernal_scinit = $ff81
|
|
|
|
.const kernal_chrout = $ffd2
|
|
|
|
.const kernal_write_byte = $e716
|
|
|
|
|
|
|
|
.const zp_temp = $02
|
|
|
|
.const cursor_pointer_lo = $05
|
|
|
|
.const cursor_pointer_hi = $06
|
|
|
|
|
2020-12-09 02:13:51 +00:00
|
|
|
.macro move_16_imm(dst, imm) {
|
|
|
|
lda #<imm
|
|
|
|
sta dst
|
|
|
|
lda #>imm
|
|
|
|
sta dst + 1
|
2020-12-06 17:19:02 +00:00
|
|
|
}
|
|
|
|
|
2020-12-06 17:07:35 +00:00
|
|
|
//
|
|
|
|
// main
|
|
|
|
//
|
|
|
|
main:
|
|
|
|
jsr clear_screen
|
|
|
|
|
2020-12-08 23:48:29 +00:00
|
|
|
// Swap out BASIC and kernal
|
|
|
|
sei
|
|
|
|
lda %00110000
|
|
|
|
sta $01
|
|
|
|
|
|
|
|
jsr generate_multiplication_tables
|
|
|
|
|
2020-12-09 01:08:57 +00:00
|
|
|
jsr day01
|
|
|
|
|
2020-12-06 17:07:35 +00:00
|
|
|
|
|
|
|
!loop:
|
|
|
|
jmp !loop-
|
|
|
|
|
|
|
|
|
|
|
|
buffer:
|
2020-12-08 23:48:29 +00:00
|
|
|
.fill $0400, 0
|
2020-12-06 17:07:35 +00:00
|
|
|
|
|
|
|
|
2020-12-06 17:19:02 +00:00
|
|
|
#import "day01.asm"
|
2020-12-06 17:07:35 +00:00
|
|
|
#import "screen.asm"
|
2020-12-08 23:48:29 +00:00
|
|
|
#import "math.asm"
|
2020-12-09 08:01:02 +00:00
|
|
|
|
|
|
|
* = * "Day 01 Input"
|
|
|
|
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
|
|
|
|
|