diff --git a/asm/link.s b/asm/link.s index d00d8c4..89a150a 100644 --- a/asm/link.s +++ b/asm/link.s @@ -14,12 +14,12 @@ lna play ; load name sna start ; segment name *---------------------------------------------- -; asm dbgfnt.s -; ds 0 ; padding -; knd #$1100 ; kind -; ali None ; alignment -; lna fun2gs ; load name -; sna start ; segment name, doesn't work to try and merge segments here + asm play.s + ds 0 ; padding + knd #$1100 ; kind + ali None ; alignment + lna play ; load name + sna start ; segment name, doesn't work to try and merge segments here *---------------------------------------------- ; asm lz4.s ; ds 0 ; padding diff --git a/asm/play.s b/asm/play.s index 51490c9..aac1864 100644 --- a/asm/play.s +++ b/asm/play.s @@ -1,75 +1,78 @@ -// -// New Animated File Format -// +* +* New Animated File Format +* +* +* xxx_xxxx_xxxx_xxx is the number of bytes 1-16384 to follow (0 == 1 byte) +* +* %0xxx_xxxx_xxxx_xxx1 - Copy Bytes - straight copy bytes +* %1xxx_xxxx_xxxx_xxx1 - Skip Bytes - skip bytes / move the cursor +* %1xxx_xxxx_xxxx_xxx0 - Dictionary Copy Bytes from frame buffer to frame buffer +* +* %0000_0000_0000_0000- Source Skip -> Source pointer skips to next bank of data +* %0000_0000_0000_0010- End of Frame - end of frame +* %0000_0000_0000_0110- End of Animation / End of File / no more frames +* +* other remaining codes, are reserved for future expansion +* +* +* 16 bit opcode +* +* %1 xxx xxxx xxxx xxx 0 +* %0 xxx xxxx xxxx xxx 0 +* +* X = SRC +* Y = DST +* +* Source Data Stream Copy +* Dictionary Copy +* xx xxxx xxxx xxxx // up to 16384 length of copy (0 is a copy length of 1 byte, so it's length-1) +* +* Copy this code to your direct page, please make sure it's aligned to a page +* The buffer is hardcoded to be at $012000, to take advantage of fast reads +* +* pass in a pointer to the start of the compressed stream +* ldx #offset in source bank +* lda #source bank +* we assume all next bank data is sequential from this first bank, but it +* wouldn't be hard to work from a list of banks, to make the player more +* friendly -// xxx_xxxx_xxxx_xxx is the number of bytes 1-16384 to follow (0 == 1 byte) +*--- this code sits at location $0 in the DP register +*--- DP may be anywhere in bank 0, but make sure it's PAGE aligned +*---- for performance reasons -%0xxx_xxxx_xxxx_xxx1 - Copy Bytes - straight copy bytes -%1xxx_xxxx_xxxx_xxx1 - Skip Bytes - skip bytes / move the cursor -%1xxx_xxxx_xxxx_xxx0 - Dictionary Copy Bytes from frame buffer to frame buffer - -%0000_0000_0000_0000- Source Skip -> Source pointer skips to next bank of data -%0000_0000_0000_0010- End of Frame - end of frame -%0000_0000_0000_0110- End of Animation / End of File / no more frames - -// other remaining codes, are reserved for future expansion - - -16 bit opcode - -%1 xxx xxxx xxxx xxx 0 -%0 xxx xxxx xxxx xxx 0 - -// X = SRC -// Y = DST - -// Source Data Stream Copy -// Dictionary Copy -// xx xxxx xxxx xxxx // up to 16384 length of copy (0 is a copy length of 1 byte, so it's length-1) - -// Copy this code to your direct page, please make sure it's aligned to a page -// The buffer is hardcoded to be at $012000, to take advantage of fast reads - -// pass in a pointer to the start of the compressed stream -// ldx #offset in source bank -// lda #source bank -// we assume all next bank data is sequential from this first bank, but it -// wouldn't be hard to work from a list of banks, to make the player more -// friendly - -//--- this code sits at location $0 in the DP register -//--- DP may be anywhere in bank 0, but make sure it's PAGE aligned -//---- for performance reasons +; rel + dsk play.l +player ent org $0 mx %00 phb sep #$30 - sta