vector-ataricolor: fixed examples for new cc65

This commit is contained in:
Steven Hugg 2022-12-04 12:51:50 -06:00
parent 4b88223d04
commit 3671054b16
3 changed files with 9 additions and 9 deletions

View File

@ -187,7 +187,7 @@ void draw_actor_rect(Actor* a) {
}
word get_distance_squared(byte dx, byte dy) {
return cc65_imul8x8r16(dx,dx) + cc65_imul8x8r16(dy,dy);
return imul8x8r16(dx,dx) + imul8x8r16(dy,dy);
}
typedef void ActorCollisionFn(struct Actor*, struct Actor*);
@ -248,16 +248,16 @@ void explosion_update_fn(struct Actor* a) {
}
const Actor ship_actor = {
ship_shapes, NULL, 3, 0xb0, WHITE, 7, 0x1,
ship_shapes, NULL, 3, 0xb0, WHITE, 7, 0x1
};
const Actor tetra_actor = {
tetra_shapes, obstacle_update_fn, 3, 0x80, CYAN, 7, 0x2,
tetra_shapes, obstacle_update_fn, 3, 0x80, CYAN, 7, 0x2
};
const Actor torpedo_actor = {
torpedo_shapes, torpedo_update_fn, 4, 0xe0, YELLOW, 15, 0x4,
torpedo_shapes, torpedo_update_fn, 4, 0xe0, YELLOW, 15, 0x4
};
const Actor explosion_actor = {
explosion_shape, explosion_update_fn, 8, 0xa0, WHITE, 15, 0,
explosion_shape, explosion_update_fn, 8, 0xa0, WHITE, 15, 0
};
void create_obstacle() {

View File

@ -15,9 +15,9 @@ void vec_mat_transform(Vector16* dest, const Vector8* v, const Matrix* m) {
int* result = &dest->x;
const sbyte* mval = &m->m[0][0];
for (i=0; i<3; i++) {
*result++ = cc65_imul8x8r16(*mval++, v->x)
+ cc65_imul8x8r16(*mval++, v->y)
+ cc65_imul8x8r16(*mval++, v->z);
*result++ = imul8x8r16(*mval++, v->x)
+ imul8x8r16(*mval++, v->y)
+ imul8x8r16(*mval++, v->z);
}
}

View File

@ -4,7 +4,7 @@
#include "vecops.h"
const word* const VECFONT[];
extern const word* const VECFONT[];
void draw_char(char ch);
void draw_string(const char* str, byte spacing);