-
Notifications
You must be signed in to change notification settings - Fork 1
/
start.asm
106 lines (95 loc) · 2.74 KB
/
start.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
BasicUpstart2(main)
*=$1000 "music"
.label music_init =*
.label music_play =*+3
.import binary "./assets/sound/music_v15.bin"
SOUND_TICK:
.import binary "./assets/sound/sfx/SOUND_TICK"
SOUND_MOVE:
.import binary "./assets/sound/sfx/SOUND_MOVE"
SOUND_CRUNCH:
.import binary "./assets/sound/sfx/SOUND_FALL"
SOUND_FALL:
.import binary "./assets/sound/sfx/SOUND_FALL"
SOUND_SCORE:
.import binary "./assets/sound/sfx/SOUND_SCORE"
* = * "KoalaImage"
.const KOALA_TEMPLATE = "C64FILE, Bitmap=$0000, ScreenRam=$1f40, ColorRam=$2328, BackgroundColor=$2710"
.var picture = LoadBinary("./assets/maps/titles.kla", KOALA_TEMPLATE)
* = * "End of KoalaImage"
* = * "CODE"
#import "./game/sounds.asm"
#import "./lib/title-screen.asm"
#import "./lib/options-screen.asm"
#import "./lib/credits-screen.asm"
#import "./lib/scores-screen.asm"
#import "./states/titles.asm"
#import "./states/game.asm"
#import "./lib/zeropage.asm"
#import "./lib/labels.asm"
#import "./lib/vic.asm"
#import "./lib/map.asm"
#import "./lib/irq.asm"
#import "./actors/mixers.asm"
*=* "*game over"
#import "./states/gameover.asm"
#import "./lib/game-over-screen.asm"
*=* "*end of game over"
/*
Sprite Map - IN GAME
----------
00000001 - 0 Player Main
00000010 - 1 Cement Crate 1
00000100 - 2 Cement Crate 2
00001000 - 3 Poured Cement
00010000 - 4 Poured Cement
00100000 - 5 Player Crushed
01000000 - 6 Poured Cement
10000000 - 7 Poured Cement
*/
* = * "Main"
main:
//bank out BASIC and Kernal
lda $01
and #%11111000
ora #%000101
sta $01
//RNG Seed
jsr Game.Random.init
//Restore Key Fix
!stateLoop:
jsr Titles.entry
jsr Game.entry
jsr GameOver.entry
jmp !stateLoop-
*=* "End main"
*=$4c00 "bitmap screen ram"; .fill picture.getScreenRamSize(), picture.getScreenRam(i)
*=$5000 "Menu Sprites";
.import binary "./assets/sprites/titles.bin"
*=$5c00 "colour ram"; colorRam: .fill picture.getColorRamSize(), picture.getColorRam(i)
*=$6000 "bitmap"; .fill picture.getBitmapSize(), picture.getBitmap(i)
*=$8000 "modules"
#import "./game/constants.asm"
#import "./game/score.asm"
#import "./game/lives.asm"
#import "./game/options.asm"
#import "./lib/keyboard.asm"
#import "./actors/poured-cement.asm"
#import "./actors/player.asm"
#import "./actors/cement-crates.asm"
#import "./actors/elevators.asm"
#import "./lib/easing.asm"
*=* "end of modules"
* = $d000 "Sprites"
.import binary "./assets/sprites/sprites.bin"
* = $b000 "Map data"
MAP_TILES:
.import binary "./assets/maps/mcf-bg - Tiles.bin"
CHAR_COLORS:
.import binary "./assets/maps/mcf-bg - CharAttribs.bin"
MAP:
.import binary "./assets/maps/mcf-bg - Map (20x12).bin"
* = $f000 "Game-Charset"
.import binary "./assets/maps/mcf-bg - Chars.bin"
* = $f800 "Titles-Charset"
.import binary "./assets/maps/thereyabloodygo.bin"