picview.asm: improve documentation

This commit is contained in:
Thomas Bernard 2020-12-15 23:34:43 +01:00
parent d36cf2d14a
commit 15ba54eb77
No known key found for this signature in database
GPG Key ID: DB511043A31ACAAF
3 changed files with 70 additions and 33 deletions

View File

@ -1,31 +0,0 @@
XX format => text/bitmap color/multicolor / extended background mode
$D020, 15 octets :
BO BORDER
BA BACKGROUND
E1 Extra background color #1
E2 Extra background color #2
E3 Extra background color #3
SE1 sprite extra color #1
SE2 sprite extra color #2
S0 sprite #0
S1 sprite #1
S2 sprite #2
S3 sprite #3
S4 sprite #4
S5 sprite #5
S6 sprite #6
S7 sprite #7
TP
T = type
0 - end of file
1 - bitmap
2 - screen ram
3 - color ram
4 - border/background etc.
P = packing
0 - no packing
1 - RLE packing
2 - color ram RLE packing

49
misc/c64viewer/README.md Normal file
View File

@ -0,0 +1,49 @@
# picview.asm (c) 2019 Thomas Bernard
This is a C64 image depacker and viewer designed to build self-displaying
.prg pictures files.
One has to concatenate the data to the viewer machine code to build a .prg
file.
## Data format
- 1 byte for mode
- then one or several blocks, composed of :
1. 1 byte TP header :
- upper nibble T is type
- lower nibble P is packing
2. n bytes data load, depending of type and packing
### Mode byte
0EBM0000 E=Extended Background mode. B=Bitmap Mode. M=Multicolor.
### TP byte
- T = type
- 0 - end of file
- 1 - bitmap 8000 bytes
- 2 - screen ram 1000 bytes
- 3 - color ram 1000 bytes at $D800
- 4 - border/background etc. 15 bytes at $D020
- P = packing
- 0 - no packing
- 1 - RLE packing
- 2 - color ram RLE packing
All other values are reserved.
## border/backgrounds at $D020, 15 bytes
- BO BORDER
- BA BACKGROUND
- E1 Extra background color #1
- E2 Extra background color #2
- E3 Extra background color #3
- SE1 sprite extra color #1
- SE2 sprite extra color #2
- S0 sprite #0
- S1 sprite #1
- S2 sprite #2
- S3 sprite #3
- S4 sprite #4
- S5 sprite #5
- S6 sprite #6
- S7 sprite #7

View File

@ -1,14 +1,33 @@
; vim:ts=8 sw=8:
; Grafx2 - The Ultimate 256-color bitmap paint program
;
; Copyright owned by various GrafX2 authors, see COPYRIGHT.txt for details.
; Copyright owned by various GrafX2 authors, see COPYRIGHT.txt for details.
;
; This code is embedded in C64 images saved by GrafX2, it can be distributed
; and modified without any restrictions.
;
; Designed to be built with The Ophis Assembler :
; https://michaelcmartin.github.io/Ophis/
; C64 picture unpacker and viewer.
; - Supports all VIC-II modes, character or bitmap based.
; - Supports raw data, RLE packing and specific color RAM RLE packing
;
; Memory map :
; $0002 Low byte of count
; $00FC-$00FD Data pointer
; $0801-$080C Basic program : trampoline code
; $080D-$xxxx 6502 machine language code
; $xxxx-$xxxx (packed) picture data
; $C000-$C3E8 Screen RAM \
; $C3F0-$C3FF VIC-II $D020-$D02E backup )- Upper RAM area
; $C400-$C7FF Color RAM backup /
; $D000-$D02E VIC-II registers (writes from $D020 to $D02E)
; $D800-$DBFF Color RAM
; $E000-$FF40 Bitmap (behind KERNAL ROM)
.word $0801
.org $0801
.word next, 1911 ; next basic line and line number
.byte $9e,"2061",0 ; SYS2061
.byte $9e,"2061",0 ; SYS2061
next: .word 0 ; end of basic program
; $fb $fc $fd $fe => unused