mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-09-29 08:55:10 +00:00
peasant: boat mostly working
This commit is contained in:
parent
a76c2d49d9
commit
f8ff9ce708
@ -181,7 +181,7 @@ ending.o: ending.s zp.inc \
|
|||||||
sprites/ending_sprites.inc \
|
sprites/ending_sprites.inc \
|
||||||
draw_box.s hgr_rectangle.s hgr_font.s hgr_input.s \
|
draw_box.s hgr_rectangle.s hgr_font.s hgr_input.s \
|
||||||
hgr_14x14_sprite_mask.s hgr_1x5_sprite.s \
|
hgr_14x14_sprite_mask.s hgr_1x5_sprite.s \
|
||||||
hgr_42x31_sprite.s hgr_save_restore.s \
|
hgr_sprite.s hgr_save_restore.s \
|
||||||
wait_a_bit.s draw_peasant.s hgr_text_box.s \
|
wait_a_bit.s draw_peasant.s hgr_text_box.s \
|
||||||
keyboard.s parse_input.s new_map_location.s \
|
keyboard.s parse_input.s new_map_location.s \
|
||||||
peasant_move.s score.s inventory.s
|
peasant_move.s score.s inventory.s
|
||||||
|
@ -10,8 +10,6 @@
|
|||||||
.include "qload.inc"
|
.include "qload.inc"
|
||||||
|
|
||||||
ending:
|
ending:
|
||||||
; lda #0
|
|
||||||
; sta GAME_OVER
|
|
||||||
|
|
||||||
jsr hgr_make_tables
|
jsr hgr_make_tables
|
||||||
|
|
||||||
@ -64,7 +62,7 @@ boat:
|
|||||||
|
|
||||||
lda #12
|
lda #12
|
||||||
sta VGI_RX1
|
sta VGI_RX1
|
||||||
lda #38
|
lda #98
|
||||||
sta VGI_RY1
|
sta VGI_RY1
|
||||||
lda #202
|
lda #202
|
||||||
sta VGI_RXRUN
|
sta VGI_RXRUN
|
||||||
@ -74,7 +72,7 @@ boat:
|
|||||||
|
|
||||||
lda #214
|
lda #214
|
||||||
sta VGI_RX1
|
sta VGI_RX1
|
||||||
lda #38
|
lda #98
|
||||||
sta VGI_RY1
|
sta VGI_RY1
|
||||||
lda #45
|
lda #45
|
||||||
sta VGI_RXRUN
|
sta VGI_RXRUN
|
||||||
@ -95,8 +93,31 @@ boat:
|
|||||||
; animate catching fish
|
; animate catching fish
|
||||||
|
|
||||||
|
|
||||||
jsr wait_until_keypress
|
lda #1
|
||||||
|
sta CURSOR_X
|
||||||
|
lda #52
|
||||||
|
sta CURSOR_Y
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
sta BABY_COUNT
|
||||||
|
boat_loop:
|
||||||
|
ldy BABY_COUNT
|
||||||
|
lda boat_progress_l,Y
|
||||||
|
sta INL
|
||||||
|
lda boat_progress_h,Y
|
||||||
|
sta INH
|
||||||
|
|
||||||
|
jsr hgr_draw_sprite
|
||||||
|
|
||||||
|
lda #4
|
||||||
|
jsr wait_a_bit
|
||||||
|
|
||||||
|
; jsr wait_until_keypress
|
||||||
|
|
||||||
|
inc BABY_COUNT
|
||||||
|
lda BABY_COUNT
|
||||||
|
cmp #14
|
||||||
|
bne boat_loop
|
||||||
|
|
||||||
;=======================
|
;=======================
|
||||||
;=======================
|
;=======================
|
||||||
@ -262,11 +283,16 @@ jhonka:
|
|||||||
;=================
|
;=================
|
||||||
; animate jhonka
|
; animate jhonka
|
||||||
|
|
||||||
|
; repeats 12 times
|
||||||
|
|
||||||
lda #19
|
lda #19
|
||||||
sta CURSOR_X
|
sta CURSOR_X
|
||||||
lda #83
|
lda #83
|
||||||
sta CURSOR_Y
|
sta CURSOR_Y
|
||||||
|
|
||||||
|
lda #13
|
||||||
|
sta BABY_COUNT
|
||||||
|
|
||||||
animation_loop:
|
animation_loop:
|
||||||
|
|
||||||
lda #<jhonka1
|
lda #<jhonka1
|
||||||
@ -274,20 +300,25 @@ animation_loop:
|
|||||||
lda #>jhonka1
|
lda #>jhonka1
|
||||||
sta INH
|
sta INH
|
||||||
|
|
||||||
jsr hgr_draw_sprite_42x31
|
jsr hgr_draw_sprite
|
||||||
|
|
||||||
jsr wait_until_keypress
|
lda #2
|
||||||
|
jsr wait_a_bit
|
||||||
|
|
||||||
lda #<jhonka2
|
lda #<jhonka2
|
||||||
sta INL
|
sta INL
|
||||||
lda #>jhonka2
|
lda #>jhonka2
|
||||||
sta INH
|
sta INH
|
||||||
|
|
||||||
jsr hgr_draw_sprite_42x31
|
jsr hgr_draw_sprite
|
||||||
|
|
||||||
jsr wait_until_keypress
|
lda #2
|
||||||
|
jsr wait_a_bit
|
||||||
|
|
||||||
jmp animation_loop
|
|
||||||
|
dec BABY_COUNT
|
||||||
|
|
||||||
|
bne animation_loop
|
||||||
|
|
||||||
;========================
|
;========================
|
||||||
;========================
|
;========================
|
||||||
@ -420,7 +451,7 @@ peasant_text:
|
|||||||
;.include "version.inc"
|
;.include "version.inc"
|
||||||
|
|
||||||
.include "hgr_14x14_sprite_mask.s"
|
.include "hgr_14x14_sprite_mask.s"
|
||||||
.include "hgr_42x31_sprite.s"
|
.include "hgr_sprite.s"
|
||||||
|
|
||||||
.include "score.s"
|
.include "score.s"
|
||||||
|
|
||||||
@ -431,7 +462,7 @@ peasant_text:
|
|||||||
.include "sprites/ending_sprites.inc"
|
.include "sprites/ending_sprites.inc"
|
||||||
|
|
||||||
boat_string:
|
boat_string:
|
||||||
.byte 2,40
|
.byte 2,100
|
||||||
.byte " Peasant's Quest",13
|
.byte " Peasant's Quest",13
|
||||||
.byte "Written by Matt, Jonathan, and Mike",0
|
.byte "Written by Matt, Jonathan, and Mike",0
|
||||||
|
|
||||||
@ -518,6 +549,21 @@ baby_progress:
|
|||||||
.byte $FF,$FF,0,0
|
.byte $FF,$FF,0,0
|
||||||
|
|
||||||
|
|
||||||
|
boat_progress_l:
|
||||||
|
.byte <boat0,<boat1
|
||||||
|
.byte <boat0,<boat1
|
||||||
|
.byte <boat0,<boat1
|
||||||
|
.byte <boat2,<boat3,<boat3
|
||||||
|
.byte <boat4,<boat5,<boat6,<boat7,<boat7
|
||||||
|
|
||||||
|
boat_progress_h:
|
||||||
|
.byte >boat0,>boat1
|
||||||
|
.byte >boat0,>boat1
|
||||||
|
.byte >boat0,>boat1
|
||||||
|
.byte >boat2,>boat3,>boat3
|
||||||
|
.byte >boat4,>boat5,>boat6,>boat7,>boat7
|
||||||
|
|
||||||
|
|
||||||
update_top:
|
update_top:
|
||||||
; put peasant text
|
; put peasant text
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 20 KiB |
@ -1,17 +1,31 @@
|
|||||||
;===============================
|
;===========================================
|
||||||
; hgr 42x31 draw sprite
|
; hgr draw sprite (only at 7-bit boundaries)
|
||||||
;===============================
|
;===========================================
|
||||||
; SPRITE in INL/INH
|
; SPRITE in INL/INH
|
||||||
; Location at CURSOR_X CURSOR_Y
|
; Location at CURSOR_X CURSOR_Y
|
||||||
|
|
||||||
|
; xsize, ysize in first two bytes
|
||||||
|
|
||||||
; sprite AT INL/INH
|
; sprite AT INL/INH
|
||||||
|
|
||||||
hgr_draw_sprite_42x31:
|
hgr_draw_sprite:
|
||||||
|
ldy #0
|
||||||
|
lda (INL),Y
|
||||||
|
clc
|
||||||
|
adc CURSOR_X
|
||||||
|
sta h4231_width_end_smc+1 ; self modify for end of output
|
||||||
|
|
||||||
|
iny
|
||||||
|
lda (INL),Y
|
||||||
|
sta h4231_ysize_smc+1
|
||||||
|
|
||||||
; set up sprite pointers
|
; set up sprite pointers
|
||||||
|
clc
|
||||||
lda INL
|
lda INL
|
||||||
|
adc #2
|
||||||
sta h4231_smc1+1
|
sta h4231_smc1+1
|
||||||
lda INH
|
lda INH
|
||||||
|
adc #0
|
||||||
sta h4231_smc1+2
|
sta h4231_smc1+2
|
||||||
|
|
||||||
ldx #0 ; X is pointer offset
|
ldx #0 ; X is pointer offset
|
||||||
@ -34,21 +48,24 @@ hgr_42x31_sprite_yloop:
|
|||||||
sta GBASH
|
sta GBASH
|
||||||
|
|
||||||
ldy CURSOR_X
|
ldy CURSOR_X
|
||||||
tya
|
|
||||||
clc
|
|
||||||
adc #6
|
|
||||||
sta h4231_width_smc+1
|
|
||||||
|
|
||||||
h3231_inner_loop:
|
h3231_inner_loop:
|
||||||
|
|
||||||
h4231_smc1:
|
h4231_smc1:
|
||||||
lda $d000,X ; or in sprite
|
lda $d000 ; get sprite pattern
|
||||||
sta (GBASL),Y ; store out
|
sta (GBASL),Y ; store out
|
||||||
|
|
||||||
inx
|
inx
|
||||||
iny
|
iny
|
||||||
|
|
||||||
h4231_width_smc:
|
|
||||||
|
inc h4231_smc1+1
|
||||||
|
bne h4231_noflo
|
||||||
|
inc h4231_smc1+2
|
||||||
|
|
||||||
|
h4231_noflo:
|
||||||
|
|
||||||
|
h4231_width_end_smc:
|
||||||
cpy #6
|
cpy #6
|
||||||
bne h3231_inner_loop
|
bne h3231_inner_loop
|
||||||
|
|
||||||
@ -56,6 +73,7 @@ h4231_width_smc:
|
|||||||
inc MASK ; row
|
inc MASK ; row
|
||||||
lda MASK ; row
|
lda MASK ; row
|
||||||
|
|
||||||
|
h4231_ysize_smc:
|
||||||
cmp #31
|
cmp #31
|
||||||
bne hgr_42x31_sprite_yloop
|
bne hgr_42x31_sprite_yloop
|
||||||
|
|
@ -23,7 +23,7 @@ inventory_sprites.inc: inventory.png
|
|||||||
$(HGR_SPRITE) -l tshirt_sprite inventory.png 42 139 55 155 >> inventory_sprites.inc
|
$(HGR_SPRITE) -l tshirt_sprite inventory.png 42 139 55 155 >> inventory_sprites.inc
|
||||||
|
|
||||||
|
|
||||||
ending_sprites.inc: end_sprites.png
|
ending_sprites.inc: end_sprites.png boat_sprites.png
|
||||||
$(HGR_SPRITE) -l baby0_sprite end_sprites.png 14 3 27 17 > ending_sprites.inc
|
$(HGR_SPRITE) -l baby0_sprite end_sprites.png 14 3 27 17 > ending_sprites.inc
|
||||||
$(HGR_SPRITE) -l baby0_mask end_sprites.png 42 3 55 17 >> ending_sprites.inc
|
$(HGR_SPRITE) -l baby0_mask end_sprites.png 42 3 55 17 >> ending_sprites.inc
|
||||||
$(HGR_SPRITE) -l baby1_sprite end_sprites.png 14 20 27 34 >> ending_sprites.inc
|
$(HGR_SPRITE) -l baby1_sprite end_sprites.png 14 20 27 34 >> ending_sprites.inc
|
||||||
@ -46,8 +46,17 @@ ending_sprites.inc: end_sprites.png
|
|||||||
$(HGR_SPRITE) -l baby9_mask end_sprites.png 42 156 55 170 >> ending_sprites.inc
|
$(HGR_SPRITE) -l baby9_mask end_sprites.png 42 156 55 170 >> ending_sprites.inc
|
||||||
$(HGR_SPRITE) -l baby10_sprite end_sprites.png 14 173 27 187 >> ending_sprites.inc
|
$(HGR_SPRITE) -l baby10_sprite end_sprites.png 14 173 27 187 >> ending_sprites.inc
|
||||||
$(HGR_SPRITE) -l baby10_mask end_sprites.png 42 173 55 187 >> ending_sprites.inc
|
$(HGR_SPRITE) -l baby10_mask end_sprites.png 42 173 55 187 >> ending_sprites.inc
|
||||||
$(HGR_SPRITE) -l jhonka1 end_sprites.png 105 84 145 115 >> ending_sprites.inc
|
$(HGR_SPRITE) -s -l jhonka1 end_sprites.png 105 84 145 115 >> ending_sprites.inc
|
||||||
$(HGR_SPRITE) -l jhonka2 end_sprites.png 105 121 145 152 >> ending_sprites.inc
|
$(HGR_SPRITE) -s -l jhonka2 end_sprites.png 105 121 145 152 >> ending_sprites.inc
|
||||||
|
$(HGR_SPRITE) -s -l boat0 boat_sprites.png 7 1 81 45 >> ending_sprites.inc
|
||||||
|
$(HGR_SPRITE) -s -l boat1 boat_sprites.png 7 47 81 91 >> ending_sprites.inc
|
||||||
|
$(HGR_SPRITE) -s -l boat2 boat_sprites.png 7 93 81 137 >> ending_sprites.inc
|
||||||
|
$(HGR_SPRITE) -s -l boat3 boat_sprites.png 7 139 81 183 >> ending_sprites.inc
|
||||||
|
$(HGR_SPRITE) -s -l boat4 boat_sprites.png 91 1 165 45 >> ending_sprites.inc
|
||||||
|
$(HGR_SPRITE) -s -l boat5 boat_sprites.png 91 47 165 91 >> ending_sprites.inc
|
||||||
|
$(HGR_SPRITE) -s -l boat6 boat_sprites.png 91 93 165 137 >> ending_sprites.inc
|
||||||
|
$(HGR_SPRITE) -s -l boat7 boat_sprites.png 91 139 165 183 >> ending_sprites.inc
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *~ inventory_sprites.inc ending_sprites.inc
|
rm -f *~ inventory_sprites.inc ending_sprites.inc
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 23 KiB |
@ -380,6 +380,7 @@ static unsigned char apple2_image[8192];
|
|||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
int xsize=0,ysize=0,error;
|
int xsize=0,ysize=0,error;
|
||||||
|
int printsize=0;
|
||||||
int c,x,y,z,color1;
|
int c,x,y,z,color1;
|
||||||
unsigned char *image;
|
unsigned char *image;
|
||||||
unsigned char byte1,byte2,colors[14];
|
unsigned char byte1,byte2,colors[14];
|
||||||
@ -387,13 +388,15 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
int x1,y1,x2,y2;
|
int x1,y1,x2,y2;
|
||||||
|
|
||||||
|
int xs;
|
||||||
|
|
||||||
char *filename;
|
char *filename;
|
||||||
|
|
||||||
strncpy(label_string,"sprite",BUFSIZ);
|
strncpy(label_string,"sprite",BUFSIZ);
|
||||||
|
|
||||||
/* Parse command line arguments */
|
/* Parse command line arguments */
|
||||||
|
|
||||||
while ( (c=getopt(argc, argv, "hvdl:") ) != -1) {
|
while ( (c=getopt(argc, argv, "hvdsl:") ) != -1) {
|
||||||
|
|
||||||
switch(c) {
|
switch(c) {
|
||||||
|
|
||||||
@ -403,9 +406,12 @@ int main(int argc, char **argv) {
|
|||||||
case 'v':
|
case 'v':
|
||||||
print_help(argv[0],1);
|
print_help(argv[0],1);
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
debug=1;
|
debug=1;
|
||||||
break;
|
break;
|
||||||
|
case 's':
|
||||||
|
printsize=1;
|
||||||
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
strncpy(label_string,optarg,BUFSIZ-1);
|
strncpy(label_string,optarg,BUFSIZ-1);
|
||||||
break;
|
break;
|
||||||
@ -468,6 +474,13 @@ int main(int argc, char **argv) {
|
|||||||
printf("; %d %d %d %d\n",x1,y1,x2,y2);
|
printf("; %d %d %d %d\n",x1,y1,x2,y2);
|
||||||
printf("%s:\n",label_string);
|
printf("%s:\n",label_string);
|
||||||
|
|
||||||
|
if (printsize) {
|
||||||
|
xs=(x2/7-x1/7);
|
||||||
|
if (!((x2%7==0)&&(x1%7==0))) xs++;
|
||||||
|
printf("\t.byte $%02X,$%02X\n",
|
||||||
|
xs,y2-y1);
|
||||||
|
}
|
||||||
|
|
||||||
for(y=y1;y<y2;y++) {
|
for(y=y1;y<y2;y++) {
|
||||||
printf("\t.byte ");
|
printf("\t.byte ");
|
||||||
for(x=x1/7;x<=x2/7;x++) {
|
for(x=x1/7;x<=x2/7;x++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user