G2F (format pliku)

From Atariki

(Różnice między wersjami)
Jump to: navigation, search
Wersja z dnia 15:47, 7 mar 2011
Tebe (Dyskusja | wkład)

← Previous diff
Wersja z dnia 21:01, 7 mar 2011
Tebe (Dyskusja | wkład)

Next diff →
Linia 7: Linia 7:
--------------- ---------------
-offset type desc+length type desc
------- ---- ----+------ ---- ----
-0 BYTE SCRW Screen Width (32, 40, 48)+1 BYTE SCRW Screen Width (32, 40, 48)
-1 BYTE bit 0-2 Pixel (1,2,4)+1 BYTE bit 0-2 Pixel (1,2,4)
- bit 3-7 Charset Compress ($80-Normal, $40-Optymizing, $20-Original, $10-JGP, $08-JGP2)+ bit 3-7 Charset Compress ($80-Normal, $40-Optymizing, $20-Original, $10-JGP, $08-JGP2)
-2 BYTE CHRC Charset Count+1 BYTE bit 0-6 CHRC Charset Count
-3 BYTE Screen and Invers Data (30*SCRW)+ bit 7 (0=old raster program, 1=new raster program)
-3+(30*SCRW) BYTE Charsets Data (CHRC+1)*1024+SCRW*30 BYTE Screen and Invers Data
-3+(30*SCRW)+(CHRC+1)*1024 BYTE bit 0-6 Charsets Table+(CHRC+1)*1024 BYTE Charsets Data
- bit 7 newFnt+
-33+(30*SCRW)+(CHRC+1)*1024 BYTE Bitmap Colors - Background+30 BYTE bit 0-6 Charsets Table
-33+(30*SCRW)+(CHRC+1)*1024+$100 BYTE Bitmap Colors - Color 0+ bit 7 newFnt
-33+(30*SCRW)+(CHRC+1)*1024+$200 BYTE Bitmap Colors - Color 1+
-33+(30*SCRW)+(CHRC+1)*1024+$300 BYTE Bitmap Colors - Color 2+
-33+(30*SCRW)+(CHRC+1)*1024+$400 BYTE Bitmap Colors - Color 3+
-33+(30*SCRW)+(CHRC+1)*1024+$500 BYTE PMG Colors - Player Missile 0+256 BYTE Bitmap Colors - Background
-33+(30*SCRW)+(CHRC+1)*1024+$600 BYTE PMG Colors - Player Missile 1+256 BYTE Bitmap Colors - Color 0
-33+(30*SCRW)+(CHRC+1)*1024+$700 BYTE PMG Colors - Player Missile 2+256 BYTE Bitmap Colors - Color 1
-33+(30*SCRW)+(CHRC+1)*1024+$800 BYTE PMG Colors - Player Missile 3+256 BYTE Bitmap Colors - Color 2
 +256 BYTE Bitmap Colors - Color 3
-33+(30*SCRW)+(CHRC+1)*1024+$900 WORD PMG DATA - Player 0+256 BYTE PMG Colors - Player Missile 0
- bit12-15 - PMG Priority+256 BYTE PMG Colors - Player Missile 1
 +256 BYTE PMG Colors - Player Missile 2
 +256 BYTE PMG Colors - Player Missile 3
-33+(30*SCRW)+(CHRC+1)*1024+$B00 WORD PMG DATA - Missile 0+256 WORD PMG_INFO - Player 0
 + bit 12-15 PMG Priority
-33+(30*SCRW)+(CHRC+1)*1024+$D00 WORD PMG DATA - Player 1+256 WORD PMG_INFO - Missile 0
- bit12 - 5th Player (0=disabled, 1=enabled)+
- bit13 - Multicolor PMG (0=disabled, 1=enabled)+
-33+(30*SCRW)+(CHRC+1)*1024+$F00 WORD PMG DATA - Missile 1+256 WORD PMG_INFO - Player 1
 + bit 12 - 5th Player (0=disabled, 1=enabled)
 + bit 13 - Multicolor PMG (0=disabled, 1=enabled)
-33+(30*SCRW)+(CHRC+1)*1024+$1100 WORD PMG DATA - Player 2+256 WORD PMG_INFO - Missile 1
-33+(30*SCRW)+(CHRC+1)*1024+$1300 WORD PMG DATA - Missile 2+
-33+(30*SCRW)+(CHRC+1)*1024+$1500 WORD PMG DATA - Player 3+256 WORD PMG_INFO - Player 2
-33+(30*SCRW)+(CHRC+1)*1024+$1700 WORD PMG DATA - Missile 3+256 WORD PMG_INFO - Missile 2
-33+(30*SCRW)+(CHRC+1)*1024+$1900 BYTE Smask ($800)+256 WORD PMG_INFO - Player 3
 +256 WORD PMG_INFO - Missile 3
-33+(30*SCRW)+(CHRC+1)*1024+$2100 BYTE Sprajt (240*290)+256 BYTE Player0 DATA
 +256 BYTE Missile0 DATA
-33+(30*SCRW)+(CHRC+1)*1024+$130E0 BYTE SprajtX (240*290)+256 BYTE Player1 DATA
 +256 BYTE Missile1 DATA
-33+(30*SCRW)+(CHRC+1)*1024+$240C0 BYTE 5th Player [0..255]+256 BYTE Player2 DATA
- 5th_Player[1] bit 0-2 = g2f_mode (1,2,3)+256 BYTE Missile2 DATA
- bit6 = 0 - DLI MODE+
- 1 - DLI+ MODE+
- bit7 = 0 - GED+ MODE+256 BYTE Player3 DATA
- 1 - GED+ disabled badlines MODE+256 BYTE Missile3 DATA
-33+(30*SCRW)+(CHRC+1)*1024+$241C0 WORD Raster program (240*12*2)+1 BYTE unused
-33+(30*SCRW)+(CHRC+1)*1024+$25840 BYTE Graphics Mode (1,2,4,255)+240*290 BYTE Sprajt
 + bit 0 - Player0
 + bit 1 - Missile0
 + bit 2 - Player1
 + bit 3 - Missile1
 + bit 4 - Player2
 + bit 5 - Missile2
 + bit 6 - Player3
 + bit 7 - Missile3
-63+(30*SCRW)+(CHRC+1)*1024+$25840 BYTE unused (210)+240*290 BYTE SprajtX
 + bit 0 - Player0
 + bit 1 - Missile0
 + bit 2 - Player1
 + bit 3 - Missile1
 + bit 4 - Player2
 + bit 5 - Missile2
 + bit 6 - Player3
 + bit 7 - Missile3
-63+(30*SCRW)+(CHRC+1)*1024+$25912 BYTE raster [0..15]+256 BYTE BUFF [0..255]
- raster_ofset = raster[0]-8+ BUFF [1] bit 0-2 (1=GED+, 2=DLI, 3=GED-)
 + bit 6 (0=DLI, 1=DLI+)
 + bit 7 (0=GED+, 1=GED+ disabled badlines)
-63+(30*SCRW)+(CHRC+1)*1024+$25922 BYTE CHARSET LIMITATIONS - LAST CHAR+240*12*2 WORD RASTER_PROGRAM
-64+(30*SCRW)+(CHRC+1)*1024+$25922 BYTE Lock Colors - Background+30 BYTE Graphics Mode (1,2,4,255)
-64+(30*SCRW)+(CHRC+1)*1024+$25A22 BYTE Lock Colors - Color 0+
-64+(30*SCRW)+(CHRC+1)*1024+$25B22 BYTE Lock Colors - Color 1+
-64+(30*SCRW)+(CHRC+1)*1024+$25C22 BYTE Lock Colors - Color 2+
-64+(30*SCRW)+(CHRC+1)*1024+$25D22 BYTE Lock Colors - Color 3+
-64+(30*SCRW)+(CHRC+1)*1024+$25E22 BYTE unused+210 BYTE unused
-65+(30*SCRW)+(CHRC+1)*1024+$25D22 BYTE Video Chipset [0..2]+16 BYTE BUFF [0..15]
- [0] = 0 - ANTIC+GTIA, 1 - ANTIC+VBXE+ raster_ofset = BUFF[0]-8
- [1] = color map cell width+
- [2] = color map cell height+
-68+(30*SCRW)+(CHRC+1)*1024+$25D22 BYTE VBXE Colors Map (48*240)+1 BYTE CHARSET LIMITATIONS - LAST CHAR
-68+(30*SCRW)+(CHRC+1)*1024+$28A22 BYTE CHARSET LIMITATIONS - FIRST CHAR+256 BYTE Lock Colors - Background
 +256 BYTE Lock Colors - Color 0
 +256 BYTE Lock Colors - Color 1
 +256 BYTE Lock Colors - Color 2
 +256 BYTE Lock Colors - Color 3
-69+(30*SCRW)+(CHRC+1)*1024+$28A22 BYTE Invers2 Data (DLI+ mode)+1 BYTE unused
-69+(60*SCRW)+(CHRC+1)*1024+$28A22 BYTE Table2 Data+1 BYTE Video Chipset [0..2]
 + [0] = 0 - ANTIC+GTIA, 1 - ANTIC+VBXE
 + [1] = color map cell width
 + [2] = color map cell height
-99+(60*SCRW)+(CHRC+1)*1024+$28A22 BYTE Charset limitations (128)+48*240 BYTE VBXE Colors Map
-99+(60*SCRW)+(CHRC+1)*1024+$28AA2 WORD Raster program - line offset (240*2)+1 BYTE CHARSET LIMITATIONS - FIRST CHAR
-99+(60*SCRW)+(CHRC+1)*1024+$28C82 BYTE unused (1)+SCRW*30 BYTE Invers2 Data (DLI+)
 +30 BYTE Table2 Data (DLI+)
 +128 BYTE Charset limitations
-PMG Data+240 WORD RASTER_PROGRAM (line offset)
 + 
 +1 BYTE unused (1)
 + 
 + 
 + 
 +PMG_INFO
-------- --------
Linia 112: Linia 139:
-Raster program+RASTER_PROGRAM
-------------- --------------
bit 0-7 Code: bit 0-7 Code:

Wersja z dnia 21:01, 7 mar 2011

Format pliku G2F jest przeznaczony dla programu Graph2Font. Autor z lenistwa uprościł go maksymalnie, przez co objętość plików G2F jest dosyć spora, średnio 160 kB. Duża objętość i podatność na kompresję wynika głównie z tego, że jest to zrzut pamięci zarezerwowanej na tablice używane przez G2F. W ostatnich wersjach programu umożliwiona została kompresja plików G2F.

Pliki kompresowane są przy pomocy ogólnie dostępnej biblioteki ZLIB, posiadają wówczas nagłówek G2FZLIB.

G2F file format
---------------

length		type	desc
------		----	----
1		BYTE	SCRW Screen Width (32, 40, 48)
1		BYTE	bit 0-2	Pixel (1,2,4)
			bit 3-7	Charset Compress ($80-Normal, $40-Optymizing, $20-Original, $10-JGP, $08-JGP2)

1		BYTE	bit 0-6	CHRC Charset Count
			bit 7	(0=old raster program, 1=new raster program)

SCRW*30		BYTE	Screen and Invers Data

(CHRC+1)*1024	BYTE	Charsets Data

30		BYTE	bit 0-6	Charsets Table
			bit 7	newFnt

256		BYTE	Bitmap Colors - Background
256		BYTE	Bitmap Colors - Color 0
256		BYTE	Bitmap Colors - Color 1
256		BYTE	Bitmap Colors - Color 2
256		BYTE	Bitmap Colors - Color 3

256		BYTE	PMG Colors - Player Missile 0
256		BYTE	PMG Colors - Player Missile 1
256		BYTE	PMG Colors - Player Missile 2
256		BYTE	PMG Colors - Player Missile 3

256		WORD	PMG_INFO - Player 0
			bit 12-15  PMG Priority

256		WORD	PMG_INFO - Missile 0

256		WORD	PMG_INFO - Player 1
			bit 12	 - 5th Player (0=disabled, 1=enabled)
			bit 13	 - Multicolor PMG (0=disabled, 1=enabled)

256		WORD	PMG_INFO - Missile 1

256		WORD	PMG_INFO - Player 2
256		WORD	PMG_INFO - Missile 2

256		WORD	PMG_INFO - Player 3
256		WORD	PMG_INFO - Missile 3

256		BYTE	Player0	DATA
256		BYTE	Missile0 DATA

256		BYTE	Player1	DATA
256		BYTE	Missile1 DATA

256		BYTE	Player2	DATA
256		BYTE	Missile2 DATA

256		BYTE	Player3	DATA
256		BYTE	Missile3 DATA

1		BYTE	unused

240*290		BYTE	Sprajt
			bit 0 - Player0
			bit 1 - Missile0
			bit 2 - Player1
			bit 3 - Missile1
			bit 4 - Player2
			bit 5 - Missile2
			bit 6 - Player3
			bit 7 - Missile3

240*290		BYTE	SprajtX
			bit 0 - Player0
			bit 1 - Missile0
			bit 2 - Player1
			bit 3 - Missile1
			bit 4 - Player2
			bit 5 - Missile2
			bit 6 - Player3
			bit 7 - Missile3

256		BYTE	BUFF [0..255]
			BUFF [1]	bit 0-2 (1=GED+, 2=DLI, 3=GED-)
					bit 6 (0=DLI, 1=DLI+)
					bit 7 (0=GED+, 1=GED+ disabled badlines)

240*12*2	WORD	RASTER_PROGRAM

30		BYTE	Graphics Mode (1,2,4,255)

210		BYTE	unused

16		BYTE	BUFF [0..15]
			raster_ofset = BUFF[0]-8

1		BYTE	CHARSET LIMITATIONS - LAST CHAR

256		BYTE	Lock Colors - Background
256		BYTE	Lock Colors - Color 0
256		BYTE	Lock Colors - Color 1
256		BYTE	Lock Colors - Color 2
256		BYTE	Lock Colors - Color 3

1		BYTE	unused

1		BYTE	Video Chipset [0..2]
			[0] = 0 - ANTIC+GTIA, 1 - ANTIC+VBXE
			[1] = color map cell width
			[2] = color map cell height

48*240		BYTE	VBXE Colors Map

1		BYTE	CHARSET LIMITATIONS - FIRST CHAR

SCRW*30		BYTE	Invers2 Data (DLI+)

30		BYTE	Table2 Data (DLI+)

128		BYTE	Charset limitations

240		WORD	RASTER_PROGRAM (line offset)

1		BYTE	unused (1)



PMG_INFO
--------

bit 0-6		Horizontal Position
bit7		(0-enabled PMG, 1-disabled PMG)

bit 8-11	PMG Size


RASTER_PROGRAM
--------------
bit 0-7		Code:

		$00-NOP				(0,2,3,4..36 cycle)
		$01-LDA#, $02-LDX#, $03-LDY#	(2 cycle)
		$41-LDA0, $42-LDX0, $43-LDY0	(3 cycle)
		$61-LDA, $62-LDX, $63-LDY	(4 cycle)
		$81-STA, $82-STX, $83-STY)	(4 cycle)

bit 8-15	Value (0..255)
Personal tools