pattern ver 01

Talk about development tools here

Moderator: BigEvilCorporation

Post Reply
koilazka
Interested
Posts: 30
Joined: Mon Nov 30, 2009 1:51 am

pattern ver 01

Post by koilazka » Wed Mar 24, 2010 9:10 am

pattern ver 01 - Converts 24bit bitmaps into snasm68k assembly or binary data.

Code: Select all

koilazka - pattern ver 01

option: 0: pattern data format    
      : 1:     bbb data format    8 colour compression: 0-7
      : 2: pattern data format    bin output
      : 3:     bbb data format    bin output

option: 0
bitmap: sprite.bmp
You'll need a 1x16 pal.bmp pallet bitmap in the same directory.
The program uses this to decode the colours.

The sprite/pattern bitmap attribute should be a multiple of 8: 8x8, 8x32, 128x64, etcetra.
The program will dump pattern data into txt or bin files.
Cell/Pattern order from left to right, then jump down repeat.
The program will converts 24bit colours into Mega Drive 9bit colours for the pal.txt file.

Bitmap size limit about 250x250.. c++ runtime stack size limit.
No error checkers, doing some wrong will just crash the program.
example: Typo when declaring the sritep.bmp
example: Not having a pal.bmp
example: Attribute that wont divide by 4 (This will dump pad bytes)

zip includes bbb_decom.txt, the bbb pattern decompressor, snasm assembly code:

Code: Select all

;// koilazka - bbb pattern line decompressor
;// VRAM write bbb pattern example
;// pattern_bbb, pallet_A
sendspace.com - patten ver 01: pattern.zip
> pattern.exe
> pal.bmp
> sprite.bmp
> bbb_decom.txt
> read.txt


Tested on winxp & 7. Ask if you want me to add some compression format.

Code: Select all

;////////////////////////////////////////////////////////////////////////
;// VRAM write bbb pattern example

		move.l	#$40000000,($c00004)	;// VRAM write $0000

		moveq	#0,d0			;// zero
		move.b	#7,d0			;// repeator: 1 pattern (8-1)
pattern_clear:
		move.l	#0,($c00000)		;// zero 32bit
		dbf	d0,pattern_clear	;// repeat


		lea	pattern_bbb,a0		;// set a0 to pattern_bbb
		moveq	#0,d5			;// zero
		move.b	#$1f,d5			;// repeator: 4 patterns ((8*4)-1)
pattern_fill:
		bsr	bbb_decom		;// decompress pattern_bbb line to d4
		move.l	d4,($c00000)		;// write pattern line to vdata
		dbf	d5,pattern_fill		;// repeat

;////////////////////////////////////////////////////////////////////////
Last edited by koilazka on Mon Aug 09, 2010 12:49 am, edited 6 times in total.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Wed Mar 24, 2010 9:21 am

it is more efficient to have just binary data, so you INCBIN or BINCLUDE it...
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

koilazka
Interested
Posts: 30
Joined: Mon Nov 30, 2009 1:51 am

Post by koilazka » Wed Mar 24, 2010 9:56 am

Like.. Just pure acsii binary bytes in a file?.. I can add that if so.

Im not sure how to link binary files with snasm.

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Wed Mar 24, 2010 10:16 am

Binary is binary, it just a bytes of data, and has nothing to do with ASCII or other text encoding standart.

koilazka
Interested
Posts: 30
Joined: Mon Nov 30, 2009 1:51 am

Post by koilazka » Wed Mar 24, 2010 10:30 am

Your right.. Im not sure why i call it acsii binary, i probably wont from now on :/
INCBIN <filename> worked with snasm, ill add the option to the next version.

// Edit
New version with bin output.
Ill have to rewrite it next time, program code is a bit linear, not good for adding new code.

// Edit
Files been uploaded to sendspace.

Post Reply