mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-12-29 00:31:52 +00:00
appleiibot: work on snow
This commit is contained in:
parent
8f60984bd3
commit
70735dcdeb
89
appleiibot/convert_vmw.c
Normal file
89
appleiibot/convert_vmw.c
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
/* code by qkumba */
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
int e = 0,filesize;
|
||||||
|
int val,pv;
|
||||||
|
unsigned char in[1024];
|
||||||
|
unsigned char enc[1024];
|
||||||
|
int third;
|
||||||
|
|
||||||
|
printf("1REM");
|
||||||
|
filesize=read(0,in,1024);
|
||||||
|
do {
|
||||||
|
third = ((in[i + 2] & 3) << 4) +
|
||||||
|
((in[i + 1] & 3) << 2) + (in[i + 0] & 3);
|
||||||
|
enc[e++]=third+32;
|
||||||
|
if (i<filesize) {
|
||||||
|
val=in[i+0];
|
||||||
|
pv=val;
|
||||||
|
val=val+0x100;
|
||||||
|
val-=third;
|
||||||
|
val&=0xff;
|
||||||
|
val=val>>2;
|
||||||
|
val=val+32;
|
||||||
|
fprintf(stderr,"%d: %x -> %x %x ==> %x\n",
|
||||||
|
i,pv,val,third,((val-32)<<2)+third);
|
||||||
|
if (val<0) fprintf(stderr,"error0, negative! in=%x e=%x val=%x\n",
|
||||||
|
in[i+0],third,val);
|
||||||
|
if (val<0x20) fprintf(stderr,"error0, unprintable! in=%x pv=%x e=%x val=%x\n",
|
||||||
|
in[i+0],pv,third,val);
|
||||||
|
if (val>0x7e) fprintf(stderr,"error0, too big! in=%x pv=%x e=%x val=%x\n",
|
||||||
|
in[i+0],pv,third,val);
|
||||||
|
printf("%c",val); //(in[i + 0] >> 2) + 32);
|
||||||
|
}
|
||||||
|
if (i + 1 < filesize) {
|
||||||
|
val=in[i+1];
|
||||||
|
pv=val;
|
||||||
|
val=val+0x100;
|
||||||
|
val-=(third>>2);
|
||||||
|
val&=0xff;
|
||||||
|
val=val>>2;
|
||||||
|
val=val+32;
|
||||||
|
|
||||||
|
fprintf(stderr,"%d: %x -> %x %x ==> %x\n",
|
||||||
|
i+1,pv,val,third>>2,((val-32)<<2)+(third>>2));
|
||||||
|
if (val<0) fprintf(stderr,"error1, negative! %x %x\n",
|
||||||
|
in[i+0]&0xfc,third);
|
||||||
|
if (val<0x20) fprintf(stderr,"error1, unprintable! %x %x\n",
|
||||||
|
in[i+0]&0xfc,third);
|
||||||
|
if (val>0x7e) fprintf(stderr,"error1, too big! in=%x pv=%x e=%x val=%x\n",
|
||||||
|
in[i+0],pv,third,val);
|
||||||
|
printf("%c",val); //(in[i + 1] >> 2) + 32);
|
||||||
|
}
|
||||||
|
if (i + 2 < filesize) {
|
||||||
|
val=in[i+2];
|
||||||
|
pv=val;
|
||||||
|
val=val+0x100;
|
||||||
|
val-=(third>>4);
|
||||||
|
val&=0xff;
|
||||||
|
val=val>>2;
|
||||||
|
val=val+32;
|
||||||
|
|
||||||
|
fprintf(stderr,"%d: %x -> %x %x ==> %x\n",
|
||||||
|
i+2,pv,val,third>>4,((val-32)<<2)+(third>>4));
|
||||||
|
|
||||||
|
if (val<0) fprintf(stderr,"error2, negative! %x %x\n",
|
||||||
|
in[i+0]&0xfc,third);
|
||||||
|
if (val<0x20) fprintf(stderr,"error2, unprintable! %x %x\n",
|
||||||
|
in[i+0]&0xfc,third);
|
||||||
|
if (val>0x7e) fprintf(stderr,"error2 too big! in=%x pv=%x e=%x val=%x\n",
|
||||||
|
in[i+0],pv,third,val);
|
||||||
|
printf("%c",val);//(in[i + 2] >> 2) + 32);
|
||||||
|
}
|
||||||
|
} while ((i += 3) < filesize);
|
||||||
|
enc[e]=0;
|
||||||
|
|
||||||
|
printf("%s\n",enc);
|
||||||
|
printf("2FORI=0TO%d:C=(PEEK(%d+I/3)-32)/4^(I-INT(I/3)*3):POKE768+I,C+4*(PEEK(2054+I)-32-INT(C/4)):NEXT:CALL768\n",
|
||||||
|
filesize,2054+filesize);
|
||||||
|
|
||||||
|
// note, peek/poke truncate?
|
||||||
|
//2FORI=1013TO1141:C=(PEEK(1843+I/3)-32)/4^(I-INT(I/3)*3):POKEI,C+4*(PEEK(1041+I)-32-INT(C/4)):NEXT:&
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
@ -1,2 +1,8 @@
|
|||||||
1REM(V\J A_)Y4!+5P1YT!+5P!Y(\\J%A_Y_I_A_RHD!J A_H H@I_($]I_O7 D)ZRF*"\]I_I_X#D!&:!T .Z!A_Y_Q_\JTS 0 #& <! 08 3& , <! 9,!0 ,!/!0 ,?0!,!< ?!,!<' &#># 80 P1A,A2 *>W:&!$)H!A5G !4.1D,9).P ! #P! !#C(A+A,2,RP -
|
1REM\S\F%AVG_#>AUW_A_HVF@I_(\[IZN=ZIO%_D)ZRP&T[Y_N_,L"W / #& <! /8 \2&T],T9!^9,]/ ^^/]/ *?0Y*!; ?Y*!9' ##># 8#] !"#$%^&)),.',,))(&%$#"! P1G=J!H!A7;?" ).B $ #'0PP(2X2(C$C,, T B(A("
|
||||||
2FORI=0TO165:C%=(PEEK(2219+I/3)-32)/4^(I-INT(I/3)*3):POKE768+I,C%+4*(PEEK(2054+I)-32-INT(C%/4)):NEXT:CALL768
|
2FORI=0TO142:Z%=(PEEK(2196+I/3)-32)/4^(I-INT(I/3)*3)+4*PEEK(2054+I)-128
|
||||||
|
4POKE768+I,Z%-256*Z%>255:NEXT:CALL768
|
||||||
|
'2FORI=0TO142:Z=INT((PEEK(2196+I/3)-32)/4^(I-INT(I/3)*3)+4*PEEK(2054+I)-128)
|
||||||
|
'4POKE768+I,Z-256*(Z>255):NEXT:CALL768
|
||||||
|
'2FORI=0TO47:FORJ=0TO2:Z%=(PEEK(2196+I)-32)/4^J+4*(PEEK(2054+I*3+J)-32)
|
||||||
|
'4POKE768+I*3+J,Z%-256*(Z%>255):NEXTJ,I:CALL768
|
||||||
|
' 301 is one to beat
|
||||||
|
64
hgr/snow2.s
64
hgr/snow2.s
@ -10,6 +10,8 @@
|
|||||||
; 167 -- remove YBASE ininitialization
|
; 167 -- remove YBASE ininitialization
|
||||||
; 161 -- only fall to 128 then recycle
|
; 161 -- only fall to 128 then recycle
|
||||||
; 156 -- use lookup table
|
; 156 -- use lookup table
|
||||||
|
; 145 -- drop page flipping
|
||||||
|
; 142 -- only need one row of zeros
|
||||||
|
|
||||||
GBASL = $26
|
GBASL = $26
|
||||||
GBASH = $27
|
GBASH = $27
|
||||||
@ -30,45 +32,46 @@ HPOSN = $F411
|
|||||||
|
|
||||||
|
|
||||||
snow:
|
snow:
|
||||||
|
; jsr HGR
|
||||||
jsr HGR2 ; 3
|
jsr HGR2 ; 3
|
||||||
|
|
||||||
move_snow:
|
move_snow:
|
||||||
; lda #0 ; 2
|
|
||||||
; sta XIDX ; 2
|
|
||||||
|
|
||||||
; 17 bytes to set page
|
; 17 bytes to set page
|
||||||
|
|
||||||
bit HGRPAGE ; V set if $40 ; 3
|
; bit HGRPAGE ; V set if $40 ; 3
|
||||||
bvc show_page1 ; 2
|
; bvc show_page1 ; 2
|
||||||
|
|
||||||
show_page2:
|
show_page2:
|
||||||
bit PAGE1 ; 3
|
; bit PAGE1 ; 3
|
||||||
lsr HGRPAGE ; 2
|
; lsr HGRPAGE ; 2
|
||||||
bne doit ; 2
|
; bne doit ; 2
|
||||||
|
|
||||||
show_page1:
|
show_page1:
|
||||||
bit PAGE0 ; 3
|
; bit PAGE0 ; 3
|
||||||
asl HGRPAGE ; 2
|
; asl HGRPAGE ; 2
|
||||||
|
|
||||||
doit:
|
doit:
|
||||||
jsr HCLR
|
; jsr HCLR
|
||||||
|
|
||||||
lda #22
|
lda #24
|
||||||
sta LINE
|
sta LINE
|
||||||
|
|
||||||
inc YBASE
|
lda YBASE ; be sure gets init at start
|
||||||
lda YBASE
|
and #$7f ; wrap at 128
|
||||||
sta YLO
|
|
||||||
and #$7f
|
|
||||||
sta YBASE
|
sta YBASE
|
||||||
|
inc YBASE
|
||||||
|
sta YLO
|
||||||
|
|
||||||
|
|
||||||
snow_loop:
|
snow_loop:
|
||||||
ldy #$0 ; xhi
|
ldy #$0 ; xhi
|
||||||
ldx #130 ; xlo -- (mult of 16)+2 for code to work
|
ldx #130 ; xlo -- (mult of 16)+2 for code to work
|
||||||
ylo_smc:
|
|
||||||
lda YLO ; ylo
|
lda YLO ; ylo
|
||||||
jsr HPOSN
|
jsr HPOSN
|
||||||
|
|
||||||
|
; y is xlo div 7
|
||||||
|
|
||||||
ldx LINE
|
ldx LINE
|
||||||
lda offsets,X
|
lda offsets,X
|
||||||
tax
|
tax
|
||||||
@ -79,11 +82,13 @@ line_loop:
|
|||||||
|
|
||||||
inx
|
inx
|
||||||
iny
|
iny
|
||||||
tya
|
cpy #$18
|
||||||
and #$8
|
; tya
|
||||||
beq line_loop
|
; and #$8
|
||||||
|
bne line_loop
|
||||||
|
|
||||||
inc YLO
|
inc YLO
|
||||||
|
inc_smc:
|
||||||
dec LINE
|
dec LINE
|
||||||
bmi move_snow
|
bmi move_snow
|
||||||
bpl snow_loop
|
bpl snow_loop
|
||||||
@ -105,22 +110,23 @@ line_loop:
|
|||||||
; .byte $00,$60,$40,$01,$03,$00
|
; .byte $00,$60,$40,$01,$03,$00
|
||||||
|
|
||||||
flake:
|
flake:
|
||||||
.byte $00,$00,$40,$01,$00,$00 ; 0, 4
|
.byte $00,$00,$00,$00 ; 0
|
||||||
|
.byte $00,$00,$40,$01,$00,$00 ; 4,8
|
||||||
.byte $0C,$18,$00,$00 ;
|
.byte $0C,$18,$00,$00 ;
|
||||||
.byte $70,$07,$00,$00 ;
|
.byte $70,$07,$00,$00 ;
|
||||||
.byte $43,$61,$00,$00 ;
|
.byte $43,$61,$00,$00 ;
|
||||||
.byte $4C,$19,$00,$00 ;
|
.byte $4C,$19,$00,$00 ;
|
||||||
.byte $33,$00,$70,$07,$00,$66 ; 22
|
.byte $33,$00,$70,$07,$00,$66 ; 26
|
||||||
.byte $30,$06,$40,$01,$30,$06 ; 28
|
.byte $30,$06,$40,$01,$30,$06 ; 32
|
||||||
.byte $3f,$06,$40,$01,$30,$7e ; 34
|
.byte $3f,$06,$40,$01,$30,$7e ; 38
|
||||||
.byte $40,$07,$30,$06,$70,$01 ; 40
|
.byte $40,$07,$30,$06,$70,$01 ; 44
|
||||||
.byte $7c,$07,$30,$06,$70,$1f ; 46
|
.byte $7c,$07,$30,$06,$70,$1f ; 50
|
||||||
.byte $00,$18,$0F,$78,$0C,$00 ; 52
|
.byte $00,$18,$0F,$78,$0C,$00 ; 56
|
||||||
.byte $60,$40,$01,$03
|
.byte $60,$40,$01,$03 ; 61
|
||||||
|
|
||||||
offsets:
|
offsets:
|
||||||
.byte 0,4,8,12,16,22,28,34,40,46,52,57
|
.byte 0,4,8,12,16,20,26,32,38,44,50,56,61
|
||||||
.byte 52,46,40,34,28,22,16,12,8,4,0
|
.byte 56,50,44,38,32,26,20,16,12,8,4,0
|
||||||
|
|
||||||
;floke:
|
;floke:
|
||||||
; .byte $0,$0,$1,$2,$0,$0
|
; .byte $0,$0,$1,$2,$0,$0
|
||||||
|
Loading…
Reference in New Issue
Block a user