-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.asm
49 lines (38 loc) · 1.33 KB
/
main.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#import "src/config_symbols.asm"
:BasicUpstart2(main)
main:
lib_screen_set_colors(BLACK, GREY, BLACK, BLACK, BLACK)
lib_sprite_set_multicolors(LIGHT_RED, BROWN)
lib_screen_clear_screen(screen_ram, ' ')
lib_screen_draw_text(title.position.x, title.position.y, title.text, WHITE)
jsr player_init
sei
ldy #$7f // $7f = %01111111
sty $dc0d // Turn off CIAs Timer interrupts ($7f = %01111111)
sty $dd0d // Turn off CIAs Timer interrupts ($7f = %01111111)
lda $dc0d // by reading $dc0d and $dd0d we cancel all CIA-IRQs in queue/unprocessed
lda $dd0d // by reading $dc0d and $dd0d we cancel all CIA-IRQs in queue/unprocessed
lda #$01 // Set Interrupt Request Mask...
sta $d01a // ...we want IRQ by Rasterbeam (%00000001)
lda #<irq // point IRQ Vector to our custom irq routine
ldx #>irq
sta $0314 // store in $314/$315
stx $0315
lda #$00 // trigger interrupt at row zero
sta $d012
cli
jmp *
rts
irq:
dec $d019 // acknowledge IRQ / clear register for next interrupt
jsr check_keyboard // check keyboard controls
jsr lib_sprites_update
jsr player_update
jmp $ea31
#import "src/lib_math.asm"
#import "src/lib_screen.asm"
#import "src/lib_sprite.asm"
#import "src/check_keyboard.asm"
#import "src/game_data.asm"
#import "src/player.asm"
#import "src/config_resources.asm"