zero padding to output files

This commit is contained in:
Charles Mangin 2019-01-09 14:11:03 -05:00 committed by GitHub
parent f1a470f03d
commit 0bfe04dc66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 31 deletions

View File

@ -107,7 +107,7 @@ CLOSECMD EQU $CC ; CLOSE command index
JSR EMULATORCHECK ; check for Virtual II JSR EMULATORCHECK ; check for Virtual II
JMP MAIN ; running in VII, go ahead. JMP STARTANIMATION ; running in VII, go ahead.
JSR COLORSWAP ; otherwise, swap the color table JSR COLORSWAP ; otherwise, swap the color table
*** to do *** to do
@ -117,38 +117,32 @@ CLOSECMD EQU $CC ; CLOSE command index
* MAIN LOOP * MAIN LOOP
************************************************** **************************************************
MAIN STARTANIMATION
LDA DATAHI ; image data starts at end of code. LDA DATAHI ; image data starts at end of code.
STA IMGHI STA IMGHI
LDA DATALO LDA DATALO
STA IMGLO STA IMGLO
LDA #$0 LDA FRAMES
STA FRAMENUM ; frame #0 STA FRAMENUM ; frame #0
NEXTFRAME LDA #$00 EACHFRAME LDX #$00
STA PLOTROW STX PLOTROW
LDY #$27 ; Y IS PLOTCOLUMN LDY #$27 ; Y IS PLOTCOLUMN
MAINLOOP
LDA (IMGLO),Y ; load byte at IMGLO,IMGHI + COLUMN
; look up color from lookup table
TAX
LDA COLORTABLE,X
STA CHAR ; put that converted BYTE into CHAR
PLOTCHAR EACHROW LDA LoLineTableL,X
LDX PLOTROW
LDA LoLineTableL,X
STA $0 STA $0
LDA LoLineTableH,X LDA LoLineTableH,X
STA $1 ; now word/pointer at $0+$1 points to screen line STA $1 ; now word/pointer at $0+$1 points to screen line
LOADQUICK
LDA CHAR EACHPIXEL LDA (IMGLO),Y ; load byte at IMGLO,IMGHI + COLUMN
TAX ; look up color from lookup table
LDA COLORTABLE,X
STA ($0),Y ; store byte at LINE + COLUMN STA ($0),Y ; store byte at LINE + COLUMN
INCCOLUMN ; next column of 2 pixels DECCOLUMN DEY ; next column of 2 pixels
DEY ; Y IS PLOTCOLUMN BPL EACHPIXEL ; Y IS PLOTCOLUMN
BPL MAINLOOP
LDY #$27 ; reset to col 0 LDY #$27 ; reset to col 0
INCROW INC PLOTROW INCROW INC PLOTROW
LDA IMGLO LDA IMGLO
CLC CLC
@ -156,15 +150,13 @@ INCROW INC PLOTROW
STA IMGLO STA IMGLO
BCS INCHI BCS INCHI
CMPROW LDA PLOTROW CMPROW LDX PLOTROW
CMP #$18 CPX #$18
BNE MAINLOOP BNE EACHROW
LOOPTY INC FRAMENUM LOOPTY DEC FRAMENUM
LDA FRAMENUM BNE EACHFRAME ; next frame in sequence
CMP FRAMES ; *** how many frames? *** BEQ STARTANIMATION ; start over at frame 1
BEQ MAIN ; start over at frame 1
JMP NEXTFRAME ; next frame in sequence
INCHI INC IMGHI INCHI INC IMGHI
BCS CMPROW BCS CMPROW

View File

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
convert animation.gif frame%05d.gif convert animation.gif frame%02d.gif
convert frame*.gif -compress none -scale 56x100% -scale 40x48\! -colorspace Gray -colors 16 -depth 8 -auto-level -evaluate divide 17 %d.gray convert frame*.gif -compress none -scale 56x100% -scale 40x48\! -colorspace Gray -colors 16 -depth 8 -auto-level -evaluate divide 17 %02d.gray
for file in *.gray for file in *.gray
do do