mist_hgr: add animation for linking book

This commit is contained in:
Vince Weaver 2021-07-14 14:57:52 -04:00
parent 4f5f75a4b7
commit 4285ac2ce0
17 changed files with 280 additions and 67 deletions

View File

@ -0,0 +1,34 @@
#include ../Makefile.inc
CC = gcc
CFLAGS = -O2 -Wall
B2D = ../../../utils/bmp2dhr/b2d
PNG2HGR = ../../../../utils/hgr-utils/png2hgr
LZSA = ~/research/lzsa/lzsa/lzsa
MAKE_VGI = ../../../graphics/hgr/vgi/make_vgi_asm
all: dump_sprite \
myst_dock_anim1.hgr myst_dock_anim2.hgr myst_dock_anim3.hgr \
myst_dock_anim4.hgr myst_dock_anim5.hgr myst_dock_anim6.hgr \
myst_dock_anim7.hgr myst_dock_anim8.hgr myst_dock_anim9.hgr \
myst_dock_anim10.hgr myst_dock_anim11.hgr myst_dock_anim12.hgr \
myst_dock_anim13.hgr
####
dump_sprite: dump_sprite.o
$(CC) $(LFLAGS) -o dump_sprite dump_sprite.o
dump_sprite.o: dump_sprite.c
$(CC) $(CFLAGS) -c dump_sprite.c
####
%.hgr: %.png
$(PNG2HGR) $< > $@
####
clean:
rm -f *~ *.o *.lst *.hgr dump_sprite

View File

@ -0,0 +1,63 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
/* y addresses for 40..88, step 4 */
unsigned short addresses[12]={
0x2280, // 40
0x3280, // 44
0x2300, // 48
0x3300, // 52
0x2380, // 56
0x3380, // 60
0x2028, // 64
0x3028, // 68
0x20A8, // 72
0x30A8, // 76
0x2128, // 80
0x3128, // 84
};
int main(int argc, char **argv) {
int fd,result,x,y;
unsigned char hgr[8192];
if (argc<2) {
printf("Usage: %s file.hgr\n\n",argv[0]);
exit(1);
}
fd=open(argv[1],O_RDONLY);
if (fd<0) {
fprintf(stderr,"ERROR opening %s, %s\n",argv[1],
strerror(errno));
exit(1);
}
result=read(fd,hgr,8192);
if (result!=8192) {
fprintf(stderr,"Error reading!\n");
exit(1);
}
printf("\n");
for(y=0;y<12;y++) {
printf(".byte ");
for(x=0;x<9;x++) {
printf("$%02X",hgr[addresses[y]-8192+x+23]);
if (x!=8) printf(",");
}
printf("\n");
}
close(fd);
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 856 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 880 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 860 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 849 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 762 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 802 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 869 B

View File

@ -52,91 +52,207 @@ dock_animation_sprites:
.word dock_animate_sprite6 ; 29
.word dock_animate_sprite7 ; 30
.word dock_animate_sprite8 ; 31
.word dock_animate_sprite9 ; 32
.word dock_animate_sprite10 ; 33
.word dock_animate_sprite11 ; 34
.word dock_animate_sprite12 ; 35
.word dock_animate_sprite13 ; 36
; water1
dock_animate_sprite1:
.byte 9,6
.byte $22,$22,$22,$22,$22,$66,$66,$22,$22
.byte $26,$62,$26,$62,$26,$62,$66,$26,$62
.byte $26,$62,$26,$62,$26,$62,$66,$26,$62
.byte $26,$62,$26,$62,$26,$62,$66,$26,$62
.byte $26,$62,$26,$62,$26,$62,$66,$26,$62
.byte $26,$62,$26,$62,$26,$62,$66,$26,$22
.byte $00,$00,$00,$00,$00,$D5,$AA,$00,$00
.byte $00,$00,$00,$00,$00,$D5,$AA,$00,$00
.byte $AA,$00,$AA,$00,$AA,$00,$AA,$D5,$00
.byte $00,$D5,$00,$D5,$00,$D5,$AA,$00,$AA
.byte $AA,$00,$AA,$00,$AA,$00,$AA,$D5,$00
.byte $00,$D5,$00,$D5,$00,$D5,$AA,$00,$AA
.byte $AA,$00,$AA,$00,$AA,$00,$AA,$D5,$00
.byte $00,$D5,$00,$D5,$00,$D5,$AA,$00,$AA
.byte $AA,$00,$AA,$00,$AA,$00,$AA,$D5,$00
.byte $00,$D5,$00,$D5,$00,$D5,$AA,$00,$AA
.byte $AA,$00,$AA,$00,$AA,$00,$AA,$D5,$00
.byte $00,$D5,$00,$D5,$00,$D5,$AA,$00,$00
; water2
dock_animate_sprite2:
.byte 9,6
.byte $22,$22,$22,$22,$22,$66,$66,$22,$22
.byte $62,$26,$62,$26,$62,$26,$66,$62,$26
.byte $62,$26,$62,$26,$62,$26,$66,$62,$26
.byte $62,$26,$62,$26,$62,$26,$66,$62,$26
.byte $62,$26,$62,$26,$62,$26,$66,$62,$26
.byte $62,$26,$62,$26,$62,$26,$66,$22,$22
.byte $80,$80,$80,$80,$80,$D5,$AA,$80,$80
.byte $80,$80,$80,$80,$80,$D5,$AA,$80,$80
.byte $80,$D5,$80,$D5,$80,$D5,$AA,$80,$AA
.byte $AA,$80,$AA,$80,$AA,$80,$AA,$D5,$80
.byte $80,$D5,$80,$D5,$80,$D5,$AA,$80,$AA
.byte $AA,$80,$AA,$80,$AA,$80,$AA,$D5,$80
.byte $80,$D5,$80,$D5,$80,$D5,$AA,$80,$AA
.byte $AA,$80,$AA,$80,$AA,$80,$AA,$D5,$80
.byte $80,$D5,$80,$D5,$80,$D5,$AA,$80,$AA
.byte $AA,$80,$AA,$80,$AA,$80,$AA,$D5,$80
.byte $80,$D5,$80,$D5,$80,$D5,$AA,$80,$80
.byte $AA,$80,$AA,$80,$AA,$80,$AA,$80,$80
; water tilt
; water tilt_high
dock_animate_sprite3:
.byte 9,6
.byte $77,$77,$77,$77,$77,$77,$77,$77,$77
.byte $77,$77,$77,$77,$77,$77,$77,$77,$77
.byte $22,$22,$22,$27,$27,$77,$77,$77,$77
.byte $22,$22,$22,$22,$22,$22,$22,$22,$22
.byte $22,$22,$22,$22,$22,$22,$22,$22,$22
.byte $22,$22,$22,$22,$22,$22,$22,$22,$22
.byte $AA,$FD,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $AA,$D5,$AA,$D5,$FA,$FF,$FF,$FF,$FF
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$F5,$FF
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
; water tilt_low
dock_animate_sprite4:
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $AA,$FD,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $AA,$D5,$AA,$D5,$FA,$FF,$FF,$FF,$FF
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$F5,$FF
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
; water level
dock_animate_sprite5:
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
; water tilt_island
dock_animate_sprite4:
.byte 9,6
.byte $77,$77,$77,$77,$77,$77,$77,$77,$77
.byte $77,$77,$77,$77,$77,$77,$77,$77,$77
.byte $77,$77,$57,$55,$77,$77,$77,$77,$27
.byte $77,$57,$55,$55,$25,$2f,$22,$22,$22
.byte $77,$25,$22,$22,$22,$22,$22,$22,$22
.byte $22,$22,$22,$22,$22,$22,$22,$22,$22
dock_animate_sprite6:
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$BF,$FC,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$F1,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$80,$80,$F8,$FF,$FF,$D5,$AA
.byte $FF,$80,$80,$80,$A0,$D5,$AA,$D5,$AA
.byte $9F,$80,$A8,$D5,$AA,$D5,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
; island1
dock_animate_sprite5:
.byte 9,6
.byte $66,$66,$66,$66,$44,$66,$66,$66,$66
.byte $66,$66,$46,$66,$44,$46,$55,$66,$56
.byte $66,$44,$44,$44,$44,$44,$75,$77,$99
.byte $44,$44,$44,$44,$44,$44,$d7,$2d,$29
.byte $54,$44,$55,$55,$55,$55,$55,$22,$22
.byte $25,$22,$22,$22,$25,$25,$22,$22,$22
dock_animate_sprite7:
.byte $FF,$FF,$FF,$FF,$FD,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$75,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$55,$FF,$2A,$FF,$FF
.byte $FF,$FF,$5D,$FF,$55,$2A,$2A,$FF,$2A
.byte $FF,$2E,$55,$2E,$55,$2A,$2A,$80,$D5
.byte $FF,$2A,$55,$2A,$55,$2A,$80,$80,$D5
.byte $55,$2A,$55,$2A,$55,$2A,$80,$FF,$D5
.byte $55,$2A,$55,$2A,$55,$2A,$FF,$D5,$AA
.byte $55,$2A,$D5,$AA,$D5,$AA,$D5,$D5,$AA
.byte $D5,$2A,$D5,$AA,$D5,$AA,$D5,$D5,$AA
.byte $D5,$D5,$AA,$D5,$D5,$AA,$AA,$D5,$AA
.byte $AA,$D5,$AA,$D5,$AA,$D5,$AA,$D5,$AA
; island2
dock_animate_sprite6:
.byte 9,6
.byte $44,$66,$44,$66,$44,$99,$99,$66,$66
.byte $44,$44,$54,$55,$44,$5e,$89,$56,$56
.byte $44,$44,$44,$55,$44,$55,$58,$85,$88
.byte $54,$45,$44,$44,$44,$54,$55,$88,$88
.byte $44,$44,$44,$44,$44,$45,$dd,$28,$88
.byte $44,$44,$44,$44,$44,$22,$22,$22,$22
dock_animate_sprite8:
.byte $F7,$7F,$F7,$7F,$55,$AB,$FF,$7F,$7F
.byte $55,$7F,$55,$7F,$55,$AA,$F5,$7F,$7F
.byte $55,$3A,$55,$35,$55,$D5,$D5,$7F,$7F
.byte $55,$2A,$2A,$2D,$55,$5D,$C0,$7F,$2A
.byte $55,$2A,$55,$2D,$55,$7F,$80,$AA,$D5
.byte $55,$2A,$55,$2D,$55,$55,$2A,$7F,$D5
.byte $55,$AA,$55,$2A,$55,$2A,$2A,$AA,$D5
.byte $D5,$2A,$55,$2A,$55,$55,$2A,$AA,$D5
.byte $55,$2A,$55,$2A,$55,$55,$FF,$AA,$D5
.byte $55,$2A,$55,$2A,$55,$6A,$BF,$D5,$D2
.byte $55,$2A,$55,$2A,$55,$D5,$DA,$D5,$AA
.byte $55,$2A,$55,$2A,$55,$D5,$AA,$D5,$AA
; island3
dock_animate_sprite7:
.byte 9,6
.byte $22,$42,$42,$72,$55,$77,$99,$66,$66
.byte $22,$44,$44,$d7,$77,$e9,$99,$86,$55
.byte $44,$44,$5d,$44,$77,$7e,$77,$58,$55
.byte $44,$d4,$45,$44,$88,$57,$45,$85,$88
.byte $dd,$44,$44,$44,$55,$45,$dd,$22,$28
.byte $44,$dd,$d4,$44,$88,$2d,$82,$22,$22
dock_animate_sprite9:
.byte $FF,$FF,$FF,$FF,$03,$55,$D5,$7F,$7F
.byte $FF,$3A,$5D,$55,$00,$55,$D5,$7F,$7F
.byte $FF,$2A,$55,$55,$2A,$AA,$D5,$7F,$2A
.byte $DF,$2A,$55,$FF,$55,$D5,$D5,$AA,$00
.byte $55,$2A,$FF,$2A,$2A,$D5,$2A,$AA,$00
.byte $55,$2A,$2A,$2A,$0A,$11,$2A,$00,$00
.byte $55,$2A,$2A,$2A,$55,$55,$00,$00,$D5
.byte $55,$FF,$55,$2A,$55,$00,$55,$AA,$D5
.byte $FF,$2A,$55,$2A,$00,$00,$FF,$D5,$D5
.byte $55,$AA,$55,$2A,$00,$2A,$FF,$D5,$AA
.byte $D5,$2A,$55,$2A,$D5,$FF,$AA,$D5,$AA
.byte $55,$2A,$55,$2A,$D5,$D5,$D5,$D5,$AA
; island4
dock_animate_sprite8:
.byte 9,6
.byte $55,$88,$e8,$66,$56,$55,$56,$66,$66
.byte $55,$77,$5e,$77,$d8,$8d,$88,$22,$26
.byte $cc,$77,$55,$77,$dd,$88,$88,$22,$22
.byte $44,$45,$c7,$55,$d5,$22,$22,$22,$22
.byte $44,$44,$4c,$55,$dd,$22,$22,$22,$22
.byte $44,$44,$44,$55,$dd,$22,$28,$22,$22
dock_animate_sprite10:
.byte $80,$AA,$D5,$7F,$7F,$55,$7F,$7F,$7F
.byte $F5,$AA,$AA,$7F,$2F,$55,$FA,$7F,$7F
.byte $80,$55,$AA,$55,$D5,$FF,$B5,$D5,$7F
.byte $8C,$15,$22,$54,$FD,$AA,$B5,$D5,$AA
.byte $55,$15,$22,$54,$FD,$AA,$D5,$D5,$AA
.byte $55,$55,$22,$55,$FD,$AA,$D5,$D5,$AA
.byte $55,$AA,$2A,$FE,$FF,$D5,$AA,$D5,$AA
.byte $D5,$2A,$55,$3E,$FF,$D5,$AA,$D5,$AA
.byte $55,$AA,$55,$3E,$FF,$D5,$AA,$D5,$AA
.byte $55,$2A,$F5,$EB,$BF,$D5,$AA,$D5,$AA
.byte $55,$2A,$75,$EB,$BF,$AD,$A5,$D5,$AA
.byte $55,$2A,$55,$6A,$BF,$D5,$AA,$D5,$AA
; island5
dock_animate_sprite11:
.byte $B5,$F5,$FF,$D7,$2F,$75,$FF,$FF,$FF
.byte $AA,$D5,$6A,$AA,$F5,$AB,$FF,$FF,$FF
.byte $2A,$55,$2A,$8A,$F5,$AB,$FD,$FF,$FF
.byte $22,$80,$22,$8A,$7F,$A2,$AD,$D5,$FD
.byte $22,$80,$22,$A2,$DF,$8A,$B5,$B5,$AA
.byte $2A,$80,$2A,$7F,$D7,$8A,$B5,$ED,$AA
.byte $2D,$55,$2A,$AF,$FF,$D5,$AA,$ED,$AA
.byte $55,$2A,$75,$AF,$FF,$D5,$AA,$D2,$AA
.byte $D5,$2A,$FD,$FB,$FF,$D5,$DA,$D5,$AA
.byte $D5,$FF,$FF,$FB,$FF,$D5,$DA,$D5,$AA
.byte $55,$FA,$FF,$7A,$FF,$B5,$D5,$D6,$AA
.byte $55,$2A,$DF,$7A,$FF,$D5,$AD,$D5,$AA
; island6
dock_animate_sprite12:
.byte $80,$80,$FF,$FF,$AF,$FF,$FF,$FF,$FF
.byte $A0,$84,$FF,$FA,$2A,$55,$FF,$FF,$FF
.byte $A0,$84,$DF,$AA,$F5,$A8,$F4,$FF,$FF
.byte $A0,$84,$D4,$FF,$FF,$AA,$F4,$FF,$FF
.byte $80,$D0,$94,$FA,$80,$AA,$A4,$D5,$AA
.byte $2A,$15,$F8,$FF,$D5,$88,$D5,$DA,$AA
.byte $80,$80,$F8,$FF,$D5,$88,$D5,$DA,$AA
.byte $55,$2A,$FF,$2A,$D7,$88,$D4,$D5,$AA
.byte $55,$FF,$57,$FA,$FF,$D5,$AA,$D5,$AA
.byte $75,$FF,$57,$FA,$D5,$A5,$AA,$D5,$AA
.byte $FD,$FF,$55,$AA,$D5,$A5,$D5,$D5,$D2
.byte $FF,$AF,$55,$AA,$D5,$D5,$AA,$D5,$AD
; island7
dock_animate_sprite13:
.byte $2A,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $2E,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $2A,$FF,$FF,$FF,$7A,$FF,$FF,$FF,$FF
.byte $80,$FC,$AF,$DF,$2A,$94,$FF,$FF,$FF
.byte $80,$E0,$97,$8A,$F0,$8A,$F1,$FF,$FF
.byte $80,$80,$97,$8F,$80,$8A,$F1,$FF,$FF
.byte $80,$80,$80,$FA,$C5,$AA,$94,$AA,$FF
.byte $FF,$2A,$55,$FF,$D7,$AA,$94,$8A,$AA
.byte $55,$2A,$55,$AA,$97,$88,$D4,$D5,$A8
.byte $55,$2A,$55,$FF,$FF,$BF,$A9,$AA,$85
.byte $55,$2A,$FD,$FF,$FF,$FF,$A9,$D5,$8A
.byte $55,$2A,$FF,$FF,$FF,$FF,$85,$D5,$AA

View File

@ -513,7 +513,7 @@ game_loop:
bne nothing_special
lda ANIMATE_FRAME
cmp #32 ; if done animating, skip
cmp #37 ; if done animating, skip
bcs nothing_special
animate_ocean: