-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathspud.asm
More file actions
165 lines (148 loc) · 3.76 KB
/
Copy pathspud.asm
File metadata and controls
165 lines (148 loc) · 3.76 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;< Spudster's Revenge - a Play in 3 acts <
;> by Brian Mastrobuono (gauze@dropdead.org) >
;< copyright 2002-2014 GNU GPL licensed, use as you wish as long as <
;> your changes in source form are made public >
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; best viewed with vim :set ts=4 (www.vim.org)
title "Spudster's Revenge"
; BIOS ROUTINES and other crap
include "vectrex.i"
; include "vecvox.i"
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; VARIABLES
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
current_song equ music8 ; junk.
; data
; org $C880
;;; player (Spud) values
score equ $C880 ;7 bytes as defined in BIOS routine Add_Score_?
level equ score+7
spuds_left equ level+1
spud_ypos equ spuds_left+1 ; y
spud_xpos equ spud_ypos+1 ; x
spud_coor equ spud_ypos ; for Obj_Hit routine load into Y-reg
spudstate equ spud_xpos+1
mollystate equ spudstate+1
spud_start equ mollystate+1
; missle
arrow_y equ spud_start+2 ; y
arrow_x equ arrow_y+1 ; x
arrow_coor equ arrow_y ; for Obj_Hit routines load into X
; this routine take 2 bytes args
intlevel equ arrow_x+1
brightdir equ intlevel+1
coord equ brightdir+1
count equ coord+2
dec_score equ count+1
highscore equ dec_score+7
SpudRot equ highscore+7
sfx_pointer equ SpudRot+1
sfx_status equ sfx_pointer+1
vox_addr equ sfx_status+1
currentframe equ vox_addr+2
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;@ CONSTANTS
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
MINBRIGHT equ 20
MAXBRIGHT equ 100
;]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
;| SETTING UP AND MAIN BLOCK |
;[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
;; *** Init block
code
org 0
fcc "g GCE 1982"
fcb $80
fdb current_song
fdb $f850
fcb $30 ; X
fcb -$70 ; Y
fcc "SPUDSTER'S REVENGE"
fcb $80
fcb $0
;;# end of magic init block.
end
jsr setup ; sets up what hardware to use and stuff
restart
jsr start
jsr titlescreen ; wait for button press here before start
jsr arrow_create ; create an arrow
;
main
jsr Wait_Recal
jsr Intensity_3F
lda #127
jsr set_scale
lda #0
jsr guys_left
jsr show_score
;
; jsr sound_update
jsr joystick_crap
jsr button_push
;
;
; SEE IF IT'S POSSIBLE TO 'SCORE'
lda spud_xpos
cmpa #53 ; right next 2 molly
blt cantscore
jsr check_if_score
cantscore
jsr draw_post
jsr draw_molly
jsr draw_mollysface ; TODO
jsr draw_mollyslegs
jsr draw_spud
jsr draw_spudslegs ; TODO
jsr Reset0Int
jsr draw_arrow
; collision
lda #127
jsr set_scale
ldx arrow_coor
ldy spud_coor
lda #17 ; MUST fix ; spud h+arrow h/2
ldb #10 ; MUST fix ; spud w+arrow h/2
jsr Obj_Hit
blo yer_hit
bra yer_ok
yer_hit
jsr got_hit
jsr arrow_create
yer_ok
; move the arrow for next frame (or not)
lda currentframe ; check frame countdown
cmpa #0
bne arrow_done ; still counting frames if false
lda level ; reseting frame counter
ldx #time_frames
lda a,x
sta currentframe ; ^^
lda level
ldx #speed_distance
lda a,x
arrow_speed
jsr move_arrow
deca
bne arrow_speed
jsr arrow_in_bounds ; check if it's at legal pos
arrow_done
dec currentframe
; checking for game over condition...
lda spuds_left
lbne main ; jump to top
jmp gameoverloop
; *** end of main ***
;
;#######################################################
; SUBROUTINES/FUNCTIONS
;#######################################################
include "functions.i"
include "sfx.asm"
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
; DATA SECTION
;********************************************************
include "data.i"
include "sound2.asm"
end