lepix-checkins Mailing List for Lepix
Status: Beta
Brought to you by:
e-r00
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
(14) |
May
(27) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2010 |
Jan
(12) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Marcin Z. <e-...@us...> - 2010-07-28 21:36:08
|
Update of /cvsroot/lepix/lepix/lepicon In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15123 Modified Files: mod_hr2.c Log Message: - add a less-flickering color map Index: mod_hr2.c =================================================================== RCS file: /cvsroot/lepix/lepix/lepicon/mod_hr2.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- mod_hr2.c 24 Jan 2010 12:43:56 -0000 1.4 +++ mod_hr2.c 28 Jul 2010 21:36:00 -0000 1.5 @@ -17,6 +17,8 @@ 4, 8, 0, 4, 8, 12, } ; +static int color_map_id = 0; + static void usage() { printf( @@ -34,6 +36,9 @@ "\t\t1 - chessboard\n" "\t\t2 - progressive (experimental)\n" "\t\t3 - Floyd-Steinberg\n" + "\t-M - id of map of colors:\n" + "\t\t0 - more precise, higher flickering on 4 color combinations [default]\n" + "\t\t1 - less precise, less flickering on 4 color combinations\n" ); } @@ -86,7 +91,16 @@ } CM_dither_algo=val; break ; - + case 'M': + if (argc<i+1) { + ERROR("Not enough parameters for -D\n"); + } + sscanf(argv[i++],"%d", &val); + if (val<0 || val>1) { + ERROR("Possible map ids are 0,1\n"); + } + color_map_id = val; + break ; default: i=0; } @@ -99,14 +113,23 @@ char *s0,*s1; memset(scr0, 0, PICSIZE8); memset(scr1, 0, PICSIZE8); - int colors[] = { + // Notation, from left + // - double pixel in gr15 + // - left pixel in gr8 + // - right pixel in gr8 + // - XX - expected pixels in gr8 + // - how close we are + // - XX ! - XX representation is perfect + // - XX !* - XX representation is perfect but flickers more + // - XX . == YY - XX not perfect, equal to one for YY + int colors_moreprecise[] = { // col15 col8a col8b 0, 0, 0, // 00 ! - 0, 0, 1, // 01 ! + 0, 0, 1, // 01 !* 1, 0, 0, // 02 . == 11 1, 0, 1, // 03 . == 12 1, 1, 1, // 04 . == 22 - 0, 1, 0, // 10 ! + 0, 1, 0, // 10 !* 1, 0, 0, // 11 ! 1, 0, 1, // 12 ! 1, 1, 1, // 13 . == 22 @@ -120,13 +143,45 @@ 1, 1, 1, // 31 . == 22 2, 1, 0, // 32 ! 2, 1, 1, // 33 ! - 3, 0, 1, // 34 ! + 3, 0, 1, // 34 !* 1, 1, 1, // 40 . == 22 2, 1, 0, // 41 . == 32 2, 1, 1, // 42 . == 33 - 3, 1, 0, // 43 ! + 3, 1, 0, // 43 !* 3, 1, 1, // 44 ! }; + int colors_lessflicker[] = { + // ? - change VS above to lose precision but avoid flickering + // col15 col8a col8b + 0, 0, 0, // 00 ! + 0, 0, 0, // 01 ? + 1, 0, 0, // 02 . == 11 + 1, 0, 1, // 03 . == 12 + 1, 1, 1, // 04 . == 22 + 0, 0, 0, // 10 ? + 1, 0, 0, // 11 ! + 1, 0, 1, // 12 ! + 1, 1, 1, // 13 . == 22 + 2, 0, 1, // 14 . == 23 + 1, 0, 0, // 20 . == 11 + 1, 1, 0, // 21 ! + 1, 1, 1, // 22 ! or 2 0 0 + 2, 0, 1, // 23 ! + 2, 1, 1, // 24 . == 33 + 1, 1, 0, // 30 . == 21 + 1, 1, 1, // 31 . == 22 + 2, 1, 0, // 32 ! + 2, 1, 1, // 33 ! + 3, 1, 1, // 34 ? + 1, 1, 1, // 40 . == 22 + 2, 1, 0, // 41 . == 32 + 2, 1, 1, // 42 . == 33 + 3, 1, 1, // 43 ? + 3, 1, 1, // 44 ! + }; + int *colors; + + colors = (color_map_id == 0) ? colors_moreprecise : colors_lessflicker; CM_initialize(5); |
|
From: Marcin Z. <e-...@us...> - 2010-07-28 21:35:50
|
Update of /cvsroot/lepix/lepix/lepicon In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15077 Modified Files: mod_hr2.asx Log Message: - make the backround black after finished with the picture Index: mod_hr2.asx =================================================================== RCS file: /cvsroot/lepix/lepix/lepicon/mod_hr2.asx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- mod_hr2.asx 24 Jan 2010 12:43:56 -0000 1.3 +++ mod_hr2.asx 28 Jul 2010 21:35:42 -0000 1.4 @@ -88,6 +88,11 @@ dey bne dli_loop + + lda #0 + sta $d40a + sta $d01a + lda $88 ldx $8a |
|
From: Marcin Z. <e-...@us...> - 2010-02-02 22:23:36
|
Update of /cvsroot/lepix/lepix In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16391 Modified Files: mod_hr2.asx Log Message: - making it easier to change the included file name Index: mod_hr2.asx =================================================================== RCS file: /cvsroot/lepix/lepix/mod_hr2.asx,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- mod_hr2.asx 1 Feb 2010 21:05:37 -0000 1.6 +++ mod_hr2.asx 2 Feb 2010 22:23:27 -0000 1.7 @@ -1028,19 +1028,21 @@ * **************************************************************************** HR2_return equ * +.macro inss +; ins 'hr2/ryjek5c.hr2',:1,:2 +; ins 'hr2/ryj.hr2',:1,:2 +; ins 'hr2/replay.hr2',:1,:2 + ins 'hr2/boris9901.hr2',:1,:2 +.endm + + ift INCLUDE_PICTURE org scrF -; ins 'hr2/ryj.hr2',0,8000 -; ins 'hr2/replay.hr2',0,8000 - ins 'hr2/boris9901.hr2',0,8000 + inss 0,8000 org scrE -; ins 'hr2/ryj.hr2',8000,8000 -; ins 'hr2/replay.hr2',8000,8000 - ins 'hr2/boris9901.hr2',8000,8000 + inss 8000,8000 org palette -; ins 'hr2/ryj.hr2',16000,6 -; ins 'hr2/replay.hr2',16000,6 - ins 'hr2/boris9901.hr2',16000,6 + inss 16000,6 eif org pline |
|
From: Marcin Z. <e-...@us...> - 2010-02-01 21:05:48
|
Update of /cvsroot/lepix/lepix In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv8176 Modified Files: mod_hr2.asx Log Message: - fixing palette IO length - minor comments Index: mod_hr2.asx =================================================================== RCS file: /cvsroot/lepix/lepix/mod_hr2.asx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- mod_hr2.asx 30 Jan 2010 16:20:38 -0000 1.5 +++ mod_hr2.asx 1 Feb 2010 21:05:37 -0000 1.6 @@ -655,7 +655,7 @@ put_pixel_table // first modeE (one pixel), then modeF (two pixels) dta 0,%00 ; 00 ! - dta 0,%01 ; 01 ! + dta 0,%01 ; 01 !* dta 0,%01 ; 02 => 01 dta 0,%01 ; 03 => 01 dta 0,%01 ; 04 => 01 @@ -673,7 +673,7 @@ dta 2,%10 ; 31 => 32 dta 2,%10 ; 32 ! dta 2,%11 ; 33 ! - dta 3,%01 ; 34 => 33 + dta 3,%01 ; 34 !* dta 3,%10 ; 40 => 43 dta 3,%10 ; 41 => 43 dta 3,%10 ; 42 => 43 @@ -986,7 +986,7 @@ bmi ex mwa #palette IO.adr - mwa #2 io.len + mwa #6 io.len jsr IO.do bmi ex @@ -1030,12 +1030,15 @@ ift INCLUDE_PICTURE org scrF +; ins 'hr2/ryj.hr2',0,8000 ; ins 'hr2/replay.hr2',0,8000 ins 'hr2/boris9901.hr2',0,8000 org scrE +; ins 'hr2/ryj.hr2',8000,8000 ; ins 'hr2/replay.hr2',8000,8000 ins 'hr2/boris9901.hr2',8000,8000 org palette +; ins 'hr2/ryj.hr2',16000,6 ; ins 'hr2/replay.hr2',16000,6 ins 'hr2/boris9901.hr2',16000,6 eif |
|
From: Marcin Z. <e-...@us...> - 2010-01-30 16:20:46
|
Update of /cvsroot/lepix/lepix In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv5315 Modified Files: mod_hr2.asx Log Message: - more zoom lines, why not Index: mod_hr2.asx =================================================================== RCS file: /cvsroot/lepix/lepix/mod_hr2.asx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- mod_hr2.asx 30 Jan 2010 16:14:46 -0000 1.4 +++ mod_hr2.asx 30 Jan 2010 16:20:38 -0000 1.5 @@ -49,7 +49,7 @@ * Internal HR2 .LOCAL -zoomlines equ 22 +zoomlines equ 28 pline equ $8000 scrF equ $8060 |
|
From: Marcin Z. <e-...@us...> - 2010-01-30 16:14:57
|
Update of /cvsroot/lepix/lepix In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4704 Modified Files: mod_hr2.asx Log Message: - fixing zoom, should work ok now Index: mod_hr2.asx =================================================================== RCS file: /cvsroot/lepix/lepix/mod_hr2.asx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- mod_hr2.asx 30 Jan 2010 15:54:05 -0000 1.3 +++ mod_hr2.asx 30 Jan 2010 16:14:46 -0000 1.4 @@ -157,6 +157,7 @@ ldx #100-2*zoomlines-2 sta $d40a lda VBL.frame + eor zoom.zoom_top_Y and #1 beq *+5 sta $d40a @@ -203,7 +204,7 @@ mva palette+4 $d017 mva palette+5 $d018 - ldy #zoomlines/2-3 + ldy #zoomlines/2 dz_loop lda dz_cols,x sta $d01a lda dz_cols+1,x @@ -217,6 +218,7 @@ dey bne dz_loop + mwa #0 $d01a mwa DLI.down_vec $200 ; switch DLI plaxy rti @@ -761,7 +763,7 @@ :3 lsr @ pha asl @ - adc #64 + adc #63 tay pla ldx ZOOM.zoom_Y |
|
From: Marcin Z. <e-...@us...> - 2010-01-30 15:59:27
|
Update of /cvsroot/lepix/lepix In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv2621 Modified Files: dli.asx Log Message: - disabling highlighting in menu, it breaks stuff Index: dli.asx =================================================================== RCS file: /cvsroot/lepix/lepix/dli.asx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- dli.asx 23 Jan 2010 23:48:36 -0000 1.3 +++ dli.asx 30 Jan 2010 15:59:19 -0000 1.4 @@ -10,6 +10,8 @@ * DLI Interrupts +WITH_HIGHLIGHT equ 0 + init equ * ; mwa top_vec $200 rts @@ -34,13 +36,14 @@ DLI_down2 pha - mva #3 SIZEP0 ; mva #0 $d01b lda #$80 sta $d40a sta $d018 + ift WITH_HIGHLIGHT + mva #3 SIZEP0 mva hl_l1_x HPOSP0 mva hl_l1_color $d012 ldy #7 @@ -58,8 +61,8 @@ mva hl_l2_mask PLR0_BASE+240,y dey bne _ddl2 + eif - ; mwa #DLI_down $200 ; switch DLI pla |
|
From: Marcin Z. <e-...@us...> - 2010-01-30 15:54:14
|
Update of /cvsroot/lepix/lepix In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv2036 Modified Files: mod_hr2.asx Log Message: - better zoom, sprites still broken Index: mod_hr2.asx =================================================================== RCS file: /cvsroot/lepix/lepix/mod_hr2.asx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mod_hr2.asx 24 Jan 2010 18:44:24 -0000 1.2 +++ mod_hr2.asx 30 Jan 2010 15:54:05 -0000 1.3 @@ -186,10 +186,41 @@ rti dli_zoom - pha + phaxy + lda VBL.frame + and #1 + eor #1 + asl @ + tax + mva palette+0 dz_cols+2 + mva palette+1 dz_cols+3 + mva palette+2 $d01a + sta dz_cols + sta dz_cols+4 + mva palette+3 $d016 + sta dz_cols+1 + sta dz_cols+5 + mva palette+4 $d017 + mva palette+5 $d018 + + ldy #zoomlines/2-3 +dz_loop lda dz_cols,x + sta $d01a + lda dz_cols+1,x + sta $d016 + lda dz_cols+2,x +:4 sta $d40a + sta $d01a + lda dz_cols+3,x + sta $d016 +:4 sta $d40a + dey + bne dz_loop + mwa DLI.down_vec $200 ; switch DLI - pla + plaxy rti +dz_cols dta 0,0,0,0,0,0 create_DL mwa #scrF zer1 @@ -320,13 +351,9 @@ mwa #DL1_zoom+3 zer1 mwa #DL2_zoom+3 zer2 hloop ;) - txa - lsr @ - bcs no_lda lda #{lda zoom_lineadr,X} jsr wr txa - lsr @ jsr wr lda >zoom_lineadr jsr wr @@ -391,6 +418,19 @@ clc adc palette,x sta palette,x + cpx #2 + bpl ccv_cont + ; for colors 0/1, make sure they share highest nibble + and #$f0 + sta zerHlp + txa + eor #1 + tax + lda palette,x + and #$0f + ora zerHlp + sta palette,x +ccv_cont jmp update_status set_kolor sta cur_color @@ -720,7 +760,8 @@ pla :3 lsr @ pha - adc #40 + asl @ + adc #64 tay pla ldx ZOOM.zoom_Y @@ -773,8 +814,7 @@ dst1 sta $c000+1,x src2 lda scrE,x sta org_byte - - lda org_byte + and #$c0 sta cur_byte :2 lsr @ @@ -788,7 +828,7 @@ :2 lsr @ ora cur_byte ora dst_byte -dst2 sta $c000+1+40,y +dst2 sta $c000+1+64,y lda org_byte and #$03 @@ -804,7 +844,7 @@ :2 asl @ ora cur_byte ora dst_byte -dst3 sta $c000+1+41,y +dst3 sta $c000+1+65,y dey dey |
|
From: Marcin Z. <e-...@us...> - 2010-01-24 18:44:32
|
Update of /cvsroot/lepix/lepix In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16127 Modified Files: mod_hr2.asx Log Message: - working towards zoom, slowly getting there Index: mod_hr2.asx =================================================================== RCS file: /cvsroot/lepix/lepix/mod_hr2.asx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mod_hr2.asx 23 Jan 2010 23:46:36 -0000 1.1 +++ mod_hr2.asx 24 Jan 2010 18:44:24 -0000 1.2 @@ -49,7 +49,7 @@ * Internal HR2 .LOCAL -zoomlines equ 23 +zoomlines equ 22 pline equ $8000 scrF equ $8060 @@ -151,12 +151,15 @@ dli_core phaxy + ldx #100 + lda zoom.state + beq *+4 + ldx #100-2*zoomlines-2 sta $d40a lda VBL.frame and #1 beq *+5 sta $d40a - ldx #100 _dc lda palette+0 ldy palette+1 @@ -172,9 +175,21 @@ dex bne _dc + lda zoom.state + bne goto_dli_zoom mwa DLI.down_vec $200 ; switch DLI plaxy rti +goto_dli_zoom + mwa #dli_zoom $200 ; switch DLI + plaxy + rti + +dli_zoom + pha + mwa DLI.down_vec $200 ; switch DLI + pla + rti create_DL mwa #scrF zer1 @@ -235,10 +250,19 @@ mwa #dl2_zoom _mcd2+1 lda #$20+$80 jsr _mcd - ldy #[2*zoomlines] + ldy #[zoomlines/2] cdl1 - lda #$5f+$00 + lda #$59+$00 ; mode9 - 4x4x1 + jsr _mcd1 + lda #$5a+$00 ; modeA - 4x4x4 + jsr _mcd2 + lda #0 jsr _mcd + jsr _mcd + lda #$59+$00 ; mode9 - 4x4x1 + jsr _mcd2 + lda #$5a+$00 ; modeA - 4x4x4 + jsr _mcd1 lda #0 jsr _mcd jsr _mcd @@ -263,7 +287,7 @@ prp_dlzoom_fill .LOCAL mwa #dlzoom_fill wr+1 -; first, fill lo byte +; first, fill lo bytes for modeF ldx #[zoomlines] mwa #DL1_zoom+2 zer1 lo1 @@ -277,12 +301,12 @@ lda #DLZOOM_EOR eor zer1+1 jsr wr - addtozer zer1 3 - lda #{sta DL1_zoom+2} + lda #{sty DL1_zoom+2} jsr wr lda zer1 jsr wr txa + eor #1 and #1 beq *+4 lda #DLZOOM_EOR @@ -291,36 +315,6 @@ addtozer zer1 3 dex bne lo1 - lda #{eor #$80} - jsr wr - lda #$80 - jsr wr - ldx #[zoomlines] - mwa #DL2_zoom+2 zer1 -lo2 lda #{sta DL1_zoom+2} - jsr wr - lda zer1 - jsr wr - txa - and #1 - beq *+4 - lda #DLZOOM_EOR - eor zer1+1 - jsr wr - addtozer zer1 3 - lda #{sta DL2_zoom+2} - jsr wr - lda zer1 - jsr wr - txa - and #1 - beq *+4 - lda #DLZOOM_EOR - eor zer1+1 - jsr wr - addtozer zer1 3 - dex - bne lo2 ; then, fill hi byte ldx #0 mwa #DL1_zoom+3 zer1 @@ -337,14 +331,14 @@ lda >zoom_lineadr jsr wr no_lda - lda #{sta DL1_zoom} + lda #{sta DL1_zoom+3} jsr wr lda zer1 jsr wr lda zer1+1 jsr wr addtozer zer1 3 - lda #{sta DL2_zoom} + lda #{sta DL2_zoom+3} jsr wr lda zer2 jsr wr @@ -353,7 +347,7 @@ addtozer zer2 3 inc zerHlp inx - cpx #[2*zoomlines] + cpx #[zoomlines] bne hloop ; and exit lda #{rts} @@ -725,6 +719,10 @@ sta mic_hscrol pla :3 lsr @ + pha + adc #40 + tay + pla ldx ZOOM.zoom_Y jmp dlzoom_fill ;) .ENDL @@ -758,18 +756,64 @@ ; Y - lineno zoom_update_line .LOCAL lda zoom_lineadr,y - sta dst+2 + sta dst1+2 + sta dst2+2 + sta dst3+2 lda loline,y - sta src+1 + sta src1+1 + sta src2+1 lda hiline,y - sta src+2 + sta src1+2 + eor #SCR_EOR + sta src2+2 ldx #39 + ldy #78 loop -src lda scrF,x -dst sta $c000+1,x +src1 lda scrF,x +dst1 sta $c000+1,x +src2 lda scrE,x + sta org_byte + + lda org_byte + and #$c0 + sta cur_byte +:2 lsr @ + ora cur_byte + sta dst_byte + + lda org_byte + and #$30 +:2 lsr @ + sta cur_byte +:2 lsr @ + ora cur_byte + ora dst_byte +dst2 sta $c000+1+40,y + + lda org_byte + and #$03 + sta cur_byte +:2 asl @ + ora cur_byte + sta dst_byte + + lda org_byte + and #$0c +:2 asl @ + sta cur_byte +:2 asl @ + ora cur_byte + ora dst_byte +dst3 sta $c000+1+41,y + + dey + dey dex bpl loop rts +org_byte dta 0 +cur_byte dta 0 +dst_byte dta 0 .ENDL zoom_update_top @@ -834,24 +878,22 @@ eor #DL_EOR sta zer1+1 - ldx zoom_lastY ldy #0 + ldx zoom_lastY txa and #1 - bne *+4 - lda #$01 - eor #$4f + eor #$4f ; $4f for even, $4e for odd sta (zer0),y + eor #1 sta (zer1),y+ lda loline,x sta (zer0),y sta (zer1),y+ txa and #1 - eor #1 beq *+4 lda #SCR_EOR - eor hiline,x + eor hiline,x ; hiline for even, ^SCR_EOR for odd sta (zer0),y eor #SCR_EOR sta (zer1),y |
|
From: Marcin Z. <e-...@us...> - 2010-01-24 12:44:04
|
Update of /cvsroot/lepix/lepix/lepicon In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv27351 Modified Files: bin2c.c common.c lepicon.c mod_gr8.asx mod_gr8.c mod_hr0.asx mod_hr0.c mod_hr1.asx mod_hr1.c mod_hr2.asx mod_hr2.c Log Message: - syncing many changes - inluding change of format for HR2 Index: mod_hr0.c =================================================================== RCS file: /cvsroot/lepix/lepix/lepicon/mod_hr0.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mod_hr0.c 22 May 2005 23:07:08 -0000 1.2 +++ mod_hr0.c 24 Jan 2010 12:43:56 -0000 1.3 @@ -1,223 +1,223 @@ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "mod_hr0.h" - -static unsigned char xlbin[]={ -#include "mod_hr0.xlc" -}; - -static int dithering=0; -static int with_scr=0; -static int automode=0; - -static unsigned char scr0[PICSIZE/8]; -static unsigned char scr1[PICSIZE/8]; -static unsigned char scr0hdr[] = {0xff, 0xff, 0x60, 0x40, 0x9f, 0x5f}; -static unsigned char scr1hdr[] = {0xff, 0xff, 0x60, 0x60, 0x9f, 0x7f}; - -static int CB[]={0x20,0x40,0x60,0x80,0xa0,0xc0,0x100}; - -static int lin0_cols[]={ - 0x00,0x55,0xff,0x00,0x00,0x55,0xff, - 0x00,0xaa,0xff,0x00,0x00,0xaa,0xff, - }; -static int lin1_cols[]={ - 0x00,0x00,0x00,0x55,0xff,0xff,0xff, - 0x00,0x00,0x00,0xaa,0xff,0xff,0xff, - }; - -static void usage() -{ - printf( - "HR0 options:\n" - "\t-a <mode> color borders:\n" - "\t\t0 - fixed\n" - "\t\t1 - choose by color values\n" - "\t\t2 - choose by color frequencies\n" - "\t-c <#color> <hex value> - set atari colour\n" - "\t-d <mode> use dithering:\n" - "\t\t0 - no dithering\n" - "\t\t1 - 'chessboard' dithering\n" - "\t-S generate .sc0 and .sc1\n" - ); -} - -static int parse_arg(int argc, char **argv) -{ - int i=0,nr,val; - char *opt=argv[i++]; - - switch(opt[1]) { - case 'a': - if (argc<i+1) { - ERROR("Not enough parameters for -a\n"); - } - sscanf(argv[i++],"%d", &val); - if (val<0 || val>2) { - ERROR("Possible automode values: 0,1,2\n"); - } - automode=val; - break ; - case 'c': - if (argc<i+2) { - ERROR("Not enough parameters for -c\n"); - } - sscanf(argv[i++],"%d", &nr); - sscanf(argv[i++],"%x", &val); - if (nr<0 || nr>3) { - ERROR("Possible colors are 0..3\n"); - } - xlbin[6+nr]=val; - break; - case 'd': - if (argc<i+1) { - ERROR("Not enough parameters for -d\n"); - } - sscanf(argv[i++],"%d", &val); - if (val<0 || val>1) { - ERROR("Possible dithering values: 0,1\n"); - } - dithering=val; - break; - case 'S': - with_scr=1; - break; - default: - i=0; - } - return i ; -} - -static void gen_borders() -{ - int minc=256,maxc=0,i; - int buckets[256]; - - if (automode==0) { - return ; - } - - memset(buckets,0,sizeof(int)*256); - for(i=0;i<PICSIZE;i++) { - if (bmap[i]<minc) { - minc=bmap[i]; - } - if (bmap[i]>maxc) { - maxc=bmap[i]; - } - buckets[bmap[i]]++; - } - INFO("Found color range: %2x..%2x\n", minc, maxc); - if (automode==1) { - // by color - INFO("Generating borders by color\n"); - for(i=0;i<6;i++) { - float step=((float)maxc-minc)/7; - float val=minc+(step*(i+1)); - CB[i]=val; - } - } else { - // by frequency - INFO("Generating borders by frequency\n"); - int col=0,step=PICSIZE/7,border=step,sum=0; - for(i=minc;i<=maxc;i++) { - sum+=buckets[i]; - if (sum>=border) { - CB[col++]=i; - border+=step; - } - } - } - CB[i]=maxc; -} - -static void convert() -{ - int x,y; - memset(scr0, 0, PICSIZE8); - memset(scr1, 0, PICSIZE8); - - gen_borders(); - - INFO("hr0: Converting %s %s dithering\n", fname, dithering?"with":"without"); - INFO("Using color borders: "); - for(x=0;x<7;x++) { - INFO("%2x ",CB[x]); - } - INFO("\n"); - - for(y=0;y<nlines;y++) { - - for(x=0;x<HSIZE;x++) { - int c=bmap[y*HSIZE+x]; - int ac,c0,c1; // atari colour - for(ac=0; c>CB[ac]; ac++) ; - if (dithering) { - ac += 7*(y&1); - } else { - ac &= ~1; - } - if (y&1) {//even lines - c0=lin0_cols[ac]; - c1=lin1_cols[ac]; - } else { - c0=lin1_cols[ac]; - c1=lin0_cols[ac]; - } -// printf("c=%2x ac=%d c0=%2x c1=%2x\n", c, ac, c0, c1); - scr0[(y*HSIZE+x)/8] |= c0 & (1<<(7-(x&7))); - scr1[(y*HSIZE+x)/8] |= c1 & (1<<(7-(x&7))); - } - } -} - -static void write_files() -{ - FILE *fd; - char fn[1000]; - int i; - - if (with_scr) { - sprintf(fn, "%s.sc0", fname_base); - INFO("Writing %s\n", fn); - fd=fopen(fn,"wb"); - fwrite(scr0, 1, PICSIZE8, fd); - fclose(fd); - - sprintf(fn, "%s.sc1", fname_base); - INFO("Writing %s\n", fn); - fd=fopen(fn,"wb"); - fwrite(scr1, 1, PICSIZE8, fd); - fclose(fd); - } - - sprintf(fn, "%s.xex", fname_base); - INFO("Writing %s\n", fn); - fd=fopen(fn,"wb"); - fwrite(scr0hdr, 1, sizeof(scr0hdr), fd); - fwrite(scr0, 1, PICSIZE8, fd); - fwrite(scr1hdr, 1, sizeof(scr1hdr), fd); - fwrite(scr1, 1, PICSIZE8, fd); - fwrite(xlbin, 1, sizeof(xlbin), fd); - fclose(fd); - INFO("Atari colors used: "); - for(i=0;i<4;i++) { - INFO("%02x ", xlbin[6+i]); - } - INFO("\n"); -} - -modt mod_hr0 = { - "hr0", - "320x200, 4 shades of gray (by Vidol)", - parse_arg, - usage, - convert, - write_files -}; - -modt* init_mod_hr0() -{ - return &mod_hr0; -} +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "mod_hr0.h" + +static unsigned char xlbin[]={ +#include "mod_hr0.xlc" +}; + +static int dithering=0; +static int with_scr=0; +static int automode=0; + +static unsigned char scr0[PICSIZE/8]; +static unsigned char scr1[PICSIZE/8]; +static unsigned char scr0hdr[] = {0xff, 0xff, 0x60, 0x40, 0x9f, 0x5f}; +static unsigned char scr1hdr[] = {0xff, 0xff, 0x60, 0x60, 0x9f, 0x7f}; + +static int CB[]={0x20,0x40,0x60,0x80,0xa0,0xc0,0x100}; + +static int lin0_cols[]={ + 0x00,0x55,0xff,0x00,0x00,0x55,0xff, + 0x00,0xaa,0xff,0x00,0x00,0xaa,0xff, + }; +static int lin1_cols[]={ + 0x00,0x00,0x00,0x55,0xff,0xff,0xff, + 0x00,0x00,0x00,0xaa,0xff,0xff,0xff, + }; + +static void usage() +{ + printf( + "HR0 options:\n" + "\t-a <mode> color borders:\n" + "\t\t0 - fixed\n" + "\t\t1 - choose by color values\n" + "\t\t2 - choose by color frequencies\n" + "\t-c <#color> <hex value> - set atari colour\n" + "\t-d <mode> use dithering:\n" + "\t\t0 - no dithering\n" + "\t\t1 - 'chessboard' dithering\n" + "\t-S generate .sc0 and .sc1\n" + ); +} + +static int parse_arg(int argc, char **argv) +{ + int i=0,nr,val; + char *opt=argv[i++]; + + switch(opt[1]) { + case 'a': + if (argc<i+1) { + ERROR("Not enough parameters for -a\n"); + } + sscanf(argv[i++],"%d", &val); + if (val<0 || val>2) { + ERROR("Possible automode values: 0,1,2\n"); + } + automode=val; + break ; + case 'c': + if (argc<i+2) { + ERROR("Not enough parameters for -c\n"); + } + sscanf(argv[i++],"%d", &nr); + sscanf(argv[i++],"%x", &val); + if (nr<0 || nr>3) { + ERROR("Possible colors are 0..3\n"); + } + xlbin[6+nr]=val; + break; + case 'd': + if (argc<i+1) { + ERROR("Not enough parameters for -d\n"); + } + sscanf(argv[i++],"%d", &val); + if (val<0 || val>1) { + ERROR("Possible dithering values: 0,1\n"); + } + dithering=val; + break; + case 'S': + with_scr=1; + break; + default: + i=0; + } + return i ; +} + +static void gen_borders() +{ + int minc=256,maxc=0,i; + int buckets[256]; + + if (automode==0) { + return ; + } + + memset(buckets,0,sizeof(int)*256); + for(i=0;i<PICSIZE;i++) { + if (bmap[i]<minc) { + minc=bmap[i]; + } + if (bmap[i]>maxc) { + maxc=bmap[i]; + } + buckets[bmap[i]]++; + } + INFO("Found color range: %2x..%2x\n", minc, maxc); + if (automode==1) { + // by color + INFO("Generating borders by color\n"); + for(i=0;i<6;i++) { + float step=((float)maxc-minc)/7; + float val=minc+(step*(i+1)); + CB[i]=val; + } + } else { + // by frequency + INFO("Generating borders by frequency\n"); + int col=0,step=PICSIZE/7,border=step,sum=0; + for(i=minc;i<=maxc;i++) { + sum+=buckets[i]; + if (sum>=border) { + CB[col++]=i; + border+=step; + } + } + } + CB[i]=maxc; +} + +static void convert() +{ + int x,y; + memset(scr0, 0, PICSIZE8); + memset(scr1, 0, PICSIZE8); + + gen_borders(); + + INFO("hr0: Converting %s %s dithering\n", fname, dithering?"with":"without"); + INFO("Using color borders: "); + for(x=0;x<7;x++) { + INFO("%2x ",CB[x]); + } + INFO("\n"); + + for(y=0;y<nlines;y++) { + + for(x=0;x<HSIZE;x++) { + int c=bmap[y*HSIZE+x]; + int ac,c0,c1; // atari colour + for(ac=0; c>CB[ac]; ac++) ; + if (dithering) { + ac += 7*(y&1); + } else { + ac &= ~1; + } + if (y&1) {//even lines + c0=lin0_cols[ac]; + c1=lin1_cols[ac]; + } else { + c0=lin1_cols[ac]; + c1=lin0_cols[ac]; + } +// printf("c=%2x ac=%d c0=%2x c1=%2x\n", c, ac, c0, c1); + scr0[(y*HSIZE+x)/8] |= c0 & (1<<(7-(x&7))); + scr1[(y*HSIZE+x)/8] |= c1 & (1<<(7-(x&7))); + } + } +} + +static void write_files() +{ + FILE *fd; + char fn[1000]; + int i; + + if (with_scr) { + sprintf(fn, "%s.sc0", fname_base); + INFO("Writing %s\n", fn); + fd=fopen(fn,"wb"); + fwrite(scr0, 1, PICSIZE8, fd); + fclose(fd); + + sprintf(fn, "%s.sc1", fname_base); + INFO("Writing %s\n", fn); + fd=fopen(fn,"wb"); + fwrite(scr1, 1, PICSIZE8, fd); + fclose(fd); + } + + sprintf(fn, "%s.xex", fname_base); + INFO("Writing %s\n", fn); + fd=fopen(fn,"wb"); + fwrite(scr0hdr, 1, sizeof(scr0hdr), fd); + fwrite(scr0, 1, PICSIZE8, fd); + fwrite(scr1hdr, 1, sizeof(scr1hdr), fd); + fwrite(scr1, 1, PICSIZE8, fd); + fwrite(xlbin, 1, sizeof(xlbin), fd); + fclose(fd); + INFO("Atari colors used: "); + for(i=0;i<4;i++) { + INFO("%02x ", xlbin[6+i]); + } + INFO("\n"); +} + +modt mod_hr0 = { + "hr0", + "320x200, 4 shades of gray (by Vidol)", + parse_arg, + usage, + convert, + write_files +}; + +modt* init_mod_hr0() +{ + return &mod_hr0; +} Index: mod_hr2.asx =================================================================== RCS file: /cvsroot/lepix/lepix/lepicon/mod_hr2.asx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mod_hr2.asx 25 May 2005 22:34:28 -0000 1.2 +++ mod_hr2.asx 24 Jan 2010 12:43:56 -0000 1.3 @@ -1,116 +1,110 @@ - opt h+ - -scr1 equ $4060 -scr2 equ $6060 - -colors equ $a000 - -dl1 equ $b000 -dl2 equ $b400 - - org colors -colF0 dta 2 -colF1 dta 4 -colE0 dta 0 -colE1 dta 2 -colE2 dta 4 -colE3 dta 6 - -start - lda <dl1 - sta $230 - lda >dl1 - sta $231 - lda #0 - sta $2c8 - ldx <dli - ldy >dli - stx $200 - sty $201 - lda #$c0 - sta $d40e - - ift 1 - lda #$04 - sta $2c4 - lda #$08 - sta $2c5 - lda #$0 - sta $2c6 - els - lda colE0 - sta $2c8 - lda colE1 - sta $2c4 - lda colE2 - sta $2c5 - lda colE3 - sta $2c6 - eif - -l1 equ * - lda 20 - cmp 20 - beq *-2 - - and #1 -:2 asl @ - ora >dl1 - sta $231 - - jmp l1 - -dli - sta $88 - sty $89 - stx $8a - lda colE0 - sta $d01a - lda colE1 - sta $d016 - lda colE2 - sta $d017 - lda colE3 - sta $d018 - ldy #101 -dli_loop - lda colF1 - ldx colF0 - sta $d40a - sta $d017 - stx $d018 - - lda colE2 - ldx colE3 - sta $d40a - sta $d017 - stx $d018 - - dey - bne dli_loop - - lda $88 - ldx $8a - ldy $89 - rti - - org dl1 - dta $70,$70 - dta $80,$00,0 - dta $4f,a(scr1),$0e -:49 dta $0f,$0e - dta $4f,a(scr1+$0fa0),$0e -:49 dta $0f,$0e - dta $41,a(dl2) - - org dl2 - dta $70,$70 - dta $00,$80,0 - dta $4e,a(scr2),$0f -:49 dta $0e,$0f - dta $4e,a(scr2+$0fa0),$0f -:49 dta $0e,$0f - dta $41,a(dl1) - - org $2e0 - dta a(start) + opt h+ + +scrF equ $4060 +scrE equ $6060 + +colors equ $a000 + +dl1 equ $b000 +dl2 equ $b400 + + org colors +colF0 dta 2 +colF1 dta 4 +colE0 dta 0 +colE1 dta 2 +colE2 dta 4 +colE3 dta 6 + +start + lda <dl1 + sta $230 + lda >dl1 + sta $231 + lda #0 + sta $2c8 + ldx <dli + ldy >dli + stx $200 + sty $201 + lda #$c0 + sta $d40e + + ift 1 + lda #$04 + sta $2c4 + lda #$08 + sta $2c5 + lda #$0 + sta $2c6 + els + lda colE0 + sta $2c8 + lda colE1 + sta $2c4 + lda colE2 + sta $2c5 + lda colE3 + sta $2c6 + eif + +l1 equ * + lda 20 + cmp 20 + beq *-2 + + and #1 +:2 asl @ + ora >dl1 + sta $231 + + jmp l1 + +dli + sta $88 + sty $89 + stx $8a + lda colE0 + sta $d01a + lda colE1 + sta $d016 + lda colE2 + sta $d017 + lda colE3 + sta $d018 + ldy #101 +dli_loop + lda colF1 + ldx colF0 + sta $d40a + sta $d017 + stx $d018 + + lda colE2 + ldx colE3 + sta $d40a + sta $d017 + stx $d018 + + dey + bne dli_loop + + lda $88 + ldx $8a + ldy $89 + rti + + org dl1 + dta $70,$70 + dta $80,$00,0 +:100 dta $4f,a(scrF+80*#),$4e,a(scrE+40+80*#) + dta $41,a(dl2) + + org dl2 + dta $70,$70 + dta $00,$80,0 +:100 dta $4e,a(scrE+80*#),$4f,a(scrF+40+80*#) + dta $41,a(dl1) + + org $2e0 + dta a(start) Index: bin2c.c =================================================================== RCS file: /cvsroot/lepix/lepix/lepicon/bin2c.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- bin2c.c 22 May 2005 21:48:56 -0000 1.1 +++ bin2c.c 24 Jan 2010 12:43:56 -0000 1.2 @@ -1,36 +1,36 @@ -#include <stdio.h> -#include <stdlib.h> - -int main(int argc, char **argv) -{ - FILE *fdin, *fdout; - unsigned char c; - int i; - - if (argc!=3) { - printf("usage: %s <infile> <outfile>\n", argv[0]); - exit(-1); - } - - fdin=fopen(argv[1],"rb"); - if (!fdin) { - printf("Can't open %s for reading\n", argv[1]); - exit(-1); - } - - fdout=fopen(argv[2],"wb"); - if (!fdin) { - printf("Can't open %s for writing\n", argv[2]); - exit(-1); - } - - while(fread(&c,1,1,fdin)) { - fprintf(fdout, "0x%02x, ",c); - if ((i&7)==7) { - fprintf(fdout,"\n"); - } - i++; - } - fprintf(fdout,"\n"); - return 0; -} +#include <stdio.h> +#include <stdlib.h> + +int main(int argc, char **argv) +{ + FILE *fdin, *fdout; + unsigned char c; + int i; + + if (argc!=3) { + printf("usage: %s <infile> <outfile>\n", argv[0]); + exit(-1); + } + + fdin=fopen(argv[1],"rb"); + if (!fdin) { + printf("Can't open %s for reading\n", argv[1]); + exit(-1); + } + + fdout=fopen(argv[2],"wb"); + if (!fdin) { + printf("Can't open %s for writing\n", argv[2]); + exit(-1); + } + + while(fread(&c,1,1,fdin)) { + fprintf(fdout, "0x%02x, ",c); + if ((i&7)==7) { + fprintf(fdout,"\n"); + } + i++; + } + fprintf(fdout,"\n"); + return 0; +} Index: mod_gr8.asx =================================================================== RCS file: /cvsroot/lepix/lepix/lepicon/mod_gr8.asx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mod_gr8.asx 25 May 2005 22:25:34 -0000 1.1 +++ mod_gr8.asx 24 Jan 2010 12:43:56 -0000 1.2 @@ -1,38 +1,38 @@ - opt h+ - -scr1 equ $4060 - -colors equ $a000 - -dl1 equ $b000 - - org colors -colF0 dta $00 -colF1 dta $0e - -start - lda <dl1 - sta $230 - lda >dl1 - sta $231 - - lda #0 - sta $2c8 - lda colF0 - sta $2c6 - lda colF1 - sta $2c5 - -l1 equ * - jmp l1 - - org dl1 - dta $70,$70,$30 - dta $4f,a(scr1) -:99 dta $0f - dta $4f,a(scr1+$0fa0) -:99 dta $0f - dta $41,a(dl1) - - org $2e0 - dta a(start) + opt h+ + +scr1 equ $4060 + +colors equ $a000 + +dl1 equ $b000 + + org colors +colF0 dta $00 +colF1 dta $0e + +start + lda <dl1 + sta $230 + lda >dl1 + sta $231 + + lda #0 + sta $2c8 + lda colF0 + sta $2c6 + lda colF1 + sta $2c5 + +l1 equ * + jmp l1 + + org dl1 + dta $70,$70,$30 + dta $4f,a(scr1) +:99 dta $0f + dta $4f,a(scr1+$0fa0) +:99 dta $0f + dta $41,a(dl1) + + org $2e0 + dta a(start) Index: common.c =================================================================== RCS file: /cvsroot/lepix/lepix/lepicon/common.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- common.c 13 Nov 2007 22:05:07 -0000 1.4 +++ common.c 24 Jan 2010 12:43:56 -0000 1.5 @@ -1,172 +1,172 @@ -#include <stdio.h> -#include <stdarg.h> -#include <stdlib.h> -#include "common.h" -#include <string.h> - -int is_silent=0; - -int CM_border_algo=0; -int CM_dither_algo=0; - -static int *color_borders=NULL; -static int num_colors=0; - -static int diffusion[PICSIZE]; - -void CM_initialize(int _num_colors) -{ - int i; - int buckets[256]; - int minc=255,maxc=0; - - if (color_borders) { - free(color_borders); - } - num_colors=_num_colors; - color_borders = (int*) malloc(sizeof(int)*(num_colors+1)); - color_borders[0]=0; - - /* clear error diffusion */ - memset(diffusion, 0, sizeof(int)*PICSIZE); - - /* clear color histogram */ - memset(buckets, 0, sizeof(int)*256); - - for(i=0;i<PICSIZE;i++) { - if (bmap[i]<minc) { - minc=bmap[i]; - } - if (bmap[i]>maxc) { - maxc=bmap[i]; - } - buckets[bmap[i]]++; - } - INFO("Found color range: %2x..%2x\n", minc, maxc); - switch(CM_border_algo) { - case 0: - INFO("Generating fixed palette\n"); - for(i=1;i<=num_colors;i++) { - color_borders[i]=(i)*256/num_colors; - } - break ; - case 1: - INFO("Generating borders by color range\n"); - for(i=1;i<=num_colors;i++) { - color_borders[i]=(i)*(maxc-minc+1)/num_colors + minc ; - } - break ; - case 2: - INFO("Generating borders by frequency\n"); - int col=1,step=PICSIZE/7,border=step,sum=0; - for(i=minc;i<=maxc;i++) { - sum+=buckets[i]; - if (sum>=border) { - color_borders[col++]=i; - border+=step; - } - } - break; - - default: - ERROR("color_borders_generate: Unknown algo\n"); - } - color_borders[num_colors]=256; - - INFO("Color borders: "); - for(i=0;i<=num_colors;i++) { - INFO("%2x ",color_borders[i]); - } - INFO("\n"); -} - -static int reminder=0; - -int CM_get_color(int x, int y, int value) -{ - int ret; - if (x==0) { - reminder=0; - } - switch(CM_dither_algo) { - case 0: - /* no dithering */ - for(ret=1; value>color_borders[ret]; ret++); - ret--; - break ; - case 1: - /* chessboard */ - for(ret=1; value>color_borders[ret]; ret++); - if (ret!=num_colors && - value > (color_borders[ret]+color_borders[ret-1])/2) { - // dithering - ret += (x+y)&1; - } - ret--; - break ; - case 2: - /* eru - progressive */ - value+=reminder; - value=MIN(value,255); - for(ret=1; value>color_borders[ret]; ret++); - if (ret!=num_colors && - value > (color_borders[ret]+color_borders[ret-1])/2) { - // dithering - reminder=value-((color_borders[ret]+color_borders[ret-1])/2); - ret += (x+y)&1; - } else { - reminder=value-color_borders[ret-1]; - } - if (reminder<0) { - ERROR("value=%d ret=%d cb[ret-1]=%d reminder=%d < 0", - value, ret, color_borders[ret-1], reminder); - } - ret--; - break ; - case 3: - /* floyd-steinberg */ - value += diffusion[y * HSIZE + x] / 16; - value = MIN(value, 255); - value = MAX(value, 0); - for(ret=1; value>color_borders[ret]; ret++); - reminder = value - - (color_borders[ret - 1] + color_borders[ret]) / 2; - if (x<HSIZE-1) { - diffusion[(y+0)*HSIZE+x+1] += reminder * 7; - } - if (y<VSIZE-1) { - if (x>0) { - diffusion[(y+1)*HSIZE+x-1] += reminder * 3; - } - diffusion[(y+1)*HSIZE+x-0] += reminder * 5; - if (x<HSIZE-1) { - diffusion[(y+1)*HSIZE+x+1] += reminder * 1; - } - } - ret--; - break; - default: - ERROR("find_color: unknown dithering\n"); - } - return ret ; -} - -void INFO(char *format, ...) -{ - if (!is_silent) { - va_list ap; - va_start(ap, format); - vprintf(format, ap); - va_end(ap); - } -} - -void ERROR(char *format, ...) -{ - va_list ap; - va_start(ap, format); - fprintf(stderr,"ERROR:"); - vfprintf(stderr, format, ap); - va_end(ap); - exit(-1); -} +#include <stdio.h> +#include <stdarg.h> +#include <stdlib.h> +#include "common.h" +#include <string.h> + +int is_silent=0; + +int CM_border_algo=0; +int CM_dither_algo=0; + +static int *color_borders=NULL; +static int num_colors=0; + +static int diffusion[PICSIZE]; + +void CM_initialize(int _num_colors) +{ + int i; + int buckets[256]; + int minc=255,maxc=0; + + if (color_borders) { + free(color_borders); + } + num_colors=_num_colors; + color_borders = (int*) malloc(sizeof(int)*(num_colors+1)); + color_borders[0]=0; + + /* clear error diffusion */ + memset(diffusion, 0, sizeof(int)*PICSIZE); + + /* clear color histogram */ + memset(buckets, 0, sizeof(int)*256); + + for(i=0;i<PICSIZE;i++) { + if (bmap[i]<minc) { + minc=bmap[i]; + } + if (bmap[i]>maxc) { + maxc=bmap[i]; + } + buckets[bmap[i]]++; + } + INFO("Found color range: %2x..%2x\n", minc, maxc); + switch(CM_border_algo) { + case 0: + INFO("Generating fixed palette\n"); + for(i=1;i<=num_colors;i++) { + color_borders[i]=(i)*256/num_colors; + } + break ; + case 1: + INFO("Generating borders by color range\n"); + for(i=1;i<=num_colors;i++) { + color_borders[i]=(i)*(maxc-minc+1)/num_colors + minc ; + } + break ; + case 2: + INFO("Generating borders by frequency\n"); + int col=1,step=PICSIZE/7,border=step,sum=0; + for(i=minc;i<=maxc;i++) { + sum+=buckets[i]; + if (sum>=border) { + color_borders[col++]=i; + border+=step; + } + } + break; + + default: + ERROR("color_borders_generate: Unknown algo\n"); + } + color_borders[num_colors]=256; + + INFO("Color borders: "); + for(i=0;i<=num_colors;i++) { + INFO("%2x ",color_borders[i]); + } + INFO("\n"); +} + +static int reminder=0; + +int CM_get_color(int x, int y, int value) +{ + int ret; + if (x==0) { + reminder=0; + } + switch(CM_dither_algo) { + case 0: + /* no dithering */ + for(ret=1; value>color_borders[ret]; ret++); + ret--; + break ; + case 1: + /* chessboard */ + for(ret=1; value>color_borders[ret]; ret++); + if (ret!=num_colors && + value > (color_borders[ret]+color_borders[ret-1])/2) { + // dithering + ret += (x+y)&1; + } + ret--; + break ; + case 2: + /* eru - progressive */ + value+=reminder; + value=MIN(value,255); + for(ret=1; value>color_borders[ret]; ret++); + if (ret!=num_colors && + value > (color_borders[ret]+color_borders[ret-1])/2) { + // dithering + reminder=value-((color_borders[ret]+color_borders[ret-1])/2); + ret += (x+y)&1; + } else { + reminder=value-color_borders[ret-1]; + } + if (reminder<0) { + ERROR("value=%d ret=%d cb[ret-1]=%d reminder=%d < 0", + value, ret, color_borders[ret-1], reminder); + } + ret--; + break ; + case 3: + /* floyd-steinberg */ + value += diffusion[y * HSIZE + x] / 16; + value = MIN(value, 255); + value = MAX(value, 0); + for(ret=1; value>color_borders[ret]; ret++); + reminder = value - + (color_borders[ret - 1] + color_borders[ret]) / 2; + if (x<HSIZE-1) { + diffusion[(y+0)*HSIZE+x+1] += reminder * 7; + } + if (y<VSIZE-1) { + if (x>0) { + diffusion[(y+1)*HSIZE+x-1] += reminder * 3; + } + diffusion[(y+1)*HSIZE+x-0] += reminder * 5; + if (x<HSIZE-1) { + diffusion[(y+1)*HSIZE+x+1] += reminder * 1; + } + } + ret--; + break; + default: + ERROR("find_color: unknown dithering\n"); + } + return ret ; +} + +void INFO(char *format, ...) +{ + if (!is_silent) { + va_list ap; + va_start(ap, format); + vprintf(format, ap); + va_end(ap); + } +} + +void ERROR(char *format, ...) +{ + va_list ap; + va_start(ap, format); + fprintf(stderr,"ERROR:"); + vfprintf(stderr, format, ap); + va_end(ap); + exit(-1); +} Index: mod_hr1.asx =================================================================== RCS file: /cvsroot/lepix/lepix/lepicon/mod_hr1.asx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mod_hr1.asx 22 May 2005 21:48:56 -0000 1.1 +++ mod_hr1.asx 24 Jan 2010 12:43:56 -0000 1.2 @@ -1,116 +1,116 @@ - opt h+ - -scr1 equ $4060 -scr2 equ $6060 - -colors equ $a000 - -dl1 equ $b000 -dl2 equ $b400 - - org colors -colF0 dta 0 -colF1 dta 8 -colE0 dta 0 -colE1 dta 2 -colE2 dta 4 -colE3 dta 6 - -start - lda <dl1 - sta $230 - lda >dl1 - sta $231 - lda #0 - sta $2c8 - ldx <dli - ldy >dli - stx $200 - sty $201 - lda #$c0 - sta $d40e - - ift 1 - lda #$04 - sta $2c4 - lda #$08 - sta $2c5 - lda #$0 - sta $2c6 - els - lda colE0 - sta $2c8 - lda colE1 - sta $2c4 - lda colE2 - sta $2c5 - lda colE3 - sta $2c6 - eif - -l1 equ * - lda 20 - cmp 20 - beq *-2 - - and #1 -:2 asl @ - ora >dl1 - sta $231 - - jmp l1 - -dli - sta $88 - sty $89 - stx $8a - lda colE0 - sta $d01a - lda colE1 - sta $d016 - lda colE2 - sta $d017 - lda colE3 - sta $d018 - ldy #101 -dli_loop - lda colF1 - ldx colF0 - sta $d40a - sta $d017 - stx $d018 - - lda colE2 - ldx colE3 - sta $d40a - sta $d017 - stx $d018 - - dey - bne dli_loop - - lda $88 - ldx $8a - ldy $89 - rti - - org dl1 - dta $70,$70,$70 - dta $80,$00,0 - dta $4f,a(scr1),$0e -:49 dta $0f,$0e - dta $4f,a(scr1+$0fa0),$0e -:49 dta $0f,$0e - dta $41,a(dl2) - - org dl2 - dta $70,$70,$70 - dta $00,$80,0 - dta $4e,a(scr2),$0f -:49 dta $0e,$0f - dta $4e,a(scr2+$0fa0),$0f -:49 dta $0e,$0f - dta $41,a(dl1) - - org $2e0 - dta a(start) + opt h+ + +scr1 equ $4060 +scr2 equ $6060 + +colors equ $a000 + +dl1 equ $b000 +dl2 equ $b400 + + org colors +colF0 dta 0 +colF1 dta 8 +colE0 dta 0 +colE1 dta 2 +colE2 dta 4 +colE3 dta 6 + +start + lda <dl1 + sta $230 + lda >dl1 + sta $231 + lda #0 + sta $2c8 + ldx <dli + ldy >dli + stx $200 + sty $201 + lda #$c0 + sta $d40e + + ift 1 + lda #$04 + sta $2c4 + lda #$08 + sta $2c5 + lda #$0 + sta $2c6 + els + lda colE0 + sta $2c8 + lda colE1 + sta $2c4 + lda colE2 + sta $2c5 + lda colE3 + sta $2c6 + eif + +l1 equ * + lda 20 + cmp 20 + beq *-2 + + and #1 +:2 asl @ + ora >dl1 + sta $231 + + jmp l1 + +dli + sta $88 + sty $89 + stx $8a + lda colE0 + sta $d01a + lda colE1 + sta $d016 + lda colE2 + sta $d017 + lda colE3 + sta $d018 + ldy #101 +dli_loop + lda colF1 + ldx colF0 + sta $d40a + sta $d017 + stx $d018 + + lda colE2 + ldx colE3 + sta $d40a + sta $d017 + stx $d018 + + dey + bne dli_loop + + lda $88 + ldx $8a + ldy $89 + rti + + org dl1 + dta $70,$70,$70 + dta $80,$00,0 + dta $4f,a(scr1),$0e +:49 dta $0f,$0e + dta $4f,a(scr1+$0fa0),$0e +:49 dta $0f,$0e + dta $41,a(dl2) + + org dl2 + dta $70,$70,$70 + dta $00,$80,0 + dta $4e,a(scr2),$0f +:49 dta $0e,$0f + dta $4e,a(scr2+$0fa0),$0f +:49 dta $0e,$0f + dta $41,a(dl1) + + org $2e0 + dta a(start) Index: lepicon.c =================================================================== RCS file: /cvsroot/lepix/lepix/lepicon/lepicon.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- lepicon.c 12 May 2007 20:43:03 -0000 1.4 +++ lepicon.c 24 Jan 2010 12:43:56 -0000 1.5 @@ -1,197 +1,197 @@ -#include <stdlib.h> -#include <stdio.h> -#include <string.h> - -#include "common.h" -#include "mod_hr0.h" -#include "mod_hr1.h" -#include "mod_hr2.h" -#include "mod_gr8.h" - -char* -#include "VERSION" -; - -char *fname = NULL ; -char *fname_base = NULL ; -int is_gray=0; -int is_test=0; - -unsigned char bmap[PICSIZE]; -int nlines=VSIZE; - -int argc=0; -char **argv=NULL; - -/* mod management */ -typedef modt* (mod_init)(); -mod_init* mod_inits[] = { - init_mod_hr0, - init_mod_hr1, - init_mod_hr2, - init_mod_gr8, -} ; -int mod_nr = 2 ; - -modt** mods = NULL ; -int mod_cnt = sizeof(mod_inits)/sizeof(mod_init*); - -static void -init_modules() -{ - int i; - mods = (modt**) malloc(mod_cnt*sizeof(modt*)); - for(i=0;i<mod_cnt;i++) { - mods[i]=mod_inits[i](); - } -} - -void info() -{ - INFO("lepicon v.%s (c) 2005 eru/tqa\n", VERSION); -} - -void usage() -{ - int i; - info(); - printf("Usage: %s [options] <file.bmp>\n", argv[0]); - printf( - "file.bmp needs to be 320x200, 256 shades of gray BMP file\n" - "optionally, you can use 64000b gray file with -g switch\n" - "Options:\n" - "\t-g assume file is GRAY (no BMP header)\n" - "\t-s be silent\n" - "\t-t generate a test picture\n" - "\t-h help\n" - "\t-m <mod> choose a module, availabe modules:\n"); - for(i=0;i<mod_cnt;i++) { - printf("\t\t%s - %s %s\n", mods[i]->id, mods[i]->info, - (i==mod_nr)?"[current]":"" ); - } - mods[mod_nr]->usage(); -} - -void parse_options() -{ - int i=1,j ; - while(i<argc) { - char *opt = argv[i++]; - if (opt[0]=='-') { - /* options */ - switch(opt[1]) { - case 'g': - is_gray=1; - break; - case 'h': - usage(); - exit(0); - break; - case 'm': - for(j=0;j<mod_cnt;j++) { - if (strcasecmp(mods[j]->id, argv[i])==0) { - mod_nr=j; - break ; - } - } - if(j==mod_cnt) { - ERROR("Unknown mode: %s\n", argv[i]); - } - i++; - break; - case 's': - is_silent=1; - break; - case 't': { - int x,y; - for(y=0;y<200;y++){ - for(x=0;x<320;x++){ - bmap[y*320+x]=(x+y)&0xff; - } - } - fname_base="test"; - is_test=1; - } - break ; - default: - j = mods[mod_nr]->parse_arg(argc-i+1,argv+i-1); - if (!j) { - ERROR("Unknown option: %s, try -h\n",opt); - } - i+=j-1; - } - } else { - /* argument */ - fname = opt; - } - } - if (!fname && !is_test) { - printf("Filename missing\n"); - exit(-1); - } -} - -void read_file() -{ - int rd,i; - FILE *fd ; - unsigned char buf[HSIZE]; - - memset(bmap, 0, PICSIZE); - - fd=fopen(fname,"rb"); - if (!fd) { - ERROR("Can't open file %s\n", fname); - } - if (!is_gray) { - rd=fread(bmap, 1, 1078, fd); - if (rd!=1078 || strncmp(bmap,"BM",2)) { - ERROR("Not a proper BMP file\n"); - } - } - rd=fread(bmap, 1, PICSIZE, fd); - nlines=rd/HSIZE; - if (rd-nlines*HSIZE) { - ERROR("Incorrect file, read %d bytes",rd); - } - INFO("Read %d lines\n", nlines); - fclose(fd); - - /* if a bitmap, rotate upside down */ - if (!is_gray) { - for(i=0;i<VSIZE/2;i++) { - char *ad0=bmap+i*HSIZE; - char *ad1=bmap+(VSIZE-1-i)*HSIZE; - memcpy(buf, ad0, HSIZE); - memcpy(ad0, ad1, HSIZE); - memcpy(ad1, buf, HSIZE); - } - } - - /* prepare file name */ - fname_base = strdup(fname); - for(i=0;fname_base[i] && fname[i]!='.';i++) ; - fname_base[i]=0 ; -} - -int main(int _argc, char **_argv) -{ - argc = _argc ; - argv = _argv ; - - init_modules(); - - parse_options(); - - info(); - - if (!is_test) { - read_file(); - } - - mods[mod_nr]->convert(); - - mods[mod_nr]->write_files(); - - return 0 ; -} +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + +#include "common.h" +#include "mod_hr0.h" +#include "mod_hr1.h" +#include "mod_hr2.h" +#include "mod_gr8.h" + +char* +#include "VERSION" +; + +char *fname = NULL ; +char *fname_base = NULL ; +int is_gray=0; +int is_test=0; + +unsigned char bmap[PICSIZE]; +int nlines=VSIZE; + +int argc=0; +char **argv=NULL; + +/* mod management */ +typedef modt* (mod_init)(); +mod_init* mod_inits[] = { + init_mod_hr0, + init_mod_hr1, + init_mod_hr2, + init_mod_gr8, +} ; +int mod_nr = 2 ; + +modt** mods = NULL ; +int mod_cnt = sizeof(mod_inits)/sizeof(mod_init*); + +static void +init_modules() +{ + int i; + mods = (modt**) malloc(mod_cnt*sizeof(modt*)); + for(i=0;i<mod_cnt;i++) { + mods[i]=mod_inits[i](); + } +} + +void info() +{ + INFO("lepicon v.%s (c) 2005 eru/tqa\n", VERSION); +} + +void usage() +{ + int i; + info(); + printf("Usage: %s [options] <file.bmp>\n", argv[0]); + printf( + "file.bmp needs to be 320x200, 256 shades of gray BMP file\n" + "optionally, you can use 64000b gray file with -g switch\n" + "Options:\n" + "\t-g assume file is GRAY (no BMP header)\n" + "\t-s be silent\n" + "\t-t generate a test picture\n" + "\t-h help\n" + "\t-m <mod> choose a module, availabe modules:\n"); + for(i=0;i<mod_cnt;i++) { + printf("\t\t%s - %s %s\n", mods[i]->id, mods[i]->info, + (i==mod_nr)?"[current]":"" ); + } + mods[mod_nr]->usage(); +} + +void parse_options() +{ + int i=1,j ; + while(i<argc) { + char *opt = argv[i++]; + if (opt[0]=='-') { + /* options */ + switch(opt[1]) { + case 'g': + is_gray=1; + break; + case 'h': + usage(); + exit(0); + break; + case 'm': + for(j=0;j<mod_cnt;j++) { + if (strcasecmp(mods[j]->id, argv[i])==0) { + mod_nr=j; + break ; + } + } + if(j==mod_cnt) { + ERROR("Unknown mode: %s\n", argv[i]); + } + i++; + break; + case 's': + is_silent=1; + break; + case 't': { + int x,y; + for(y=0;y<200;y++){ + for(x=0;x<320;x++){ + bmap[y*320+x]=(x+y)&0xff; + } + } + fname_base="test"; + is_test=1; + } + break ; + default: + j = mods[mod_nr]->parse_arg(argc-i+1,argv+i-1); + if (!j) { + ERROR("Unknown option: %s, try -h\n",opt); + } + i+=j-1; + } + } else { + /* argument */ + fname = opt; + } + } + if (!fname && !is_test) { + printf("Filename missing\n"); + exit(-1); + } +} + +void read_file() +{ + int rd,i; + FILE *fd ; + unsigned char buf[HSIZE]; + + memset(bmap, 0, PICSIZE); + + fd=fopen(fname,"rb"); + if (!fd) { + ERROR("Can't open file %s\n", fname); + } + if (!is_gray) { + rd=fread(bmap, 1, 1078, fd); + if (rd!=1078 || strncmp(bmap,"BM",2)) { + ERROR("Not a proper BMP file\n"); + } + } + rd=fread(bmap, 1, PICSIZE, fd); + nlines=rd/HSIZE; + if (rd-nlines*HSIZE) { + ERROR("Incorrect file, read %d bytes",rd); + } + INFO("Read %d lines\n", nlines); + fclose(fd); + + /* if a bitmap, rotate upside down */ + if (!is_gray) { + for(i=0;i<VSIZE/2;i++) { + char *ad0=bmap+i*HSIZE; + char *ad1=bmap+(VSIZE-1-i)*HSIZE; + memcpy(buf, ad0, HSIZE); + memcpy(ad0, ad1, HSIZE); + memcpy(ad1, buf, HSIZE); + } + } + + /* prepare file name */ + fname_base = strdup(fname); + for(i=0;fname_base[i] && fname[i]!='.';i++) ; + fname_base[i]=0 ; +} + +int main(int _argc, char **_argv) +{ + argc = _argc ; + argv = _argv ; + + init_modules(); + + parse_options(); + + info(); + + if (!is_test) { + read_file(); + } + + mods[mod_nr]->convert(); + + mods[mod_nr]->write_files(); + + return 0 ; +} Index: mod_hr2.c =================================================================== RCS file: /cvsroot/lepix/lepix/lepicon/mod_hr2.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- mod_hr2.c 13 Nov 2007 22:02:35 -0000 1.3 +++ mod_hr2.c 24 Jan 2010 12:43:56 -0000 1.4 @@ -1,202 +1,213 @@ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "mod_hr2.h" - -static unsigned char xlbin[]={ -#include "mod_hr2.xlc" -}; - -static unsigned char scr0[PICSIZE/8]; -static unsigned char scr1[PICSIZE/8]; -static unsigned char scr0hdr[] = {0xff, 0xff, 0x60, 0x40, 0x9f, 0x5f}; -static unsigned char scr1hdr[] = {0xff, 0xff, 0x60, 0x60, 0x9f, 0x7f}; - -static unsigned char colorsets[] = { - 2, 4, 0, 2, 4, 6, - 4, 8, 0, 4, 8, 12, -} ; - -static void usage() -{ - printf( - "HR2 options:\n" - "\t-B <algorithm> - border generation algorithm:\n" - "\t\t0 - fixed [default]\n" - "\t\t1 - by value range\n" - "\t\t2 - by value frequency\n" - "\t-c <#color> <hex value> - set atari colour\n" - "\t-C <#colorset> - atari colorset:\n" - "\t\t0 - darker, less flickering [default]\n" - "\t\t1 - brighter, more flickering\n" - "\t-D <algorithm> - use dithering algorithm:\n" - "\t\t0 - none [default]\n" - "\t\t1 - chessboard\n" - "\t\t2 - progressive (experimental)\n" - "\t\t3 - Floyd-Steinberg\n" - ); -} - -static int parse_arg(int argc, char **argv) -{ - int i=0,nr,val; - char *opt=argv[i++]; - - switch(opt[1]) { - case 'B': - if (argc<i+1) { - ERROR("Not enough parameters for -B\n"); - } - sscanf(argv[i++],"%d", &val); - if (val<0 || val>2) { - ERROR("Possible border generation algorithms are 0,1,2\n"); - } - CM_border_algo=val; - break ; - case 'c': - if (argc<i+2) { - ERROR("Not enough parameters for -c\n"); - } - sscanf(argv[i++],"%d", &nr); - sscanf(argv[i++],"%x", &val); - if (nr<0 || nr>5) { - ERROR("Possible colors are 0..5\n"); - } - xlbin[6+nr]=val; - break; - case 'C': - if (argc<i+1) { - ERROR("Not enough parameters for -C\n"); - } - sscanf(argv[i++],"%d", &val); - if (val<0 || val>1) { - ERROR("Possible colorsets are 0,1\n"); - } - for(nr=0;nr<6;nr++) { - xlbin[6+nr]=colorsets[6*val+nr]; - } - break ; - case 'D': - if (argc<i+1) { - ERROR("Not enough parameters for -D\n"); - } - sscanf(argv[i++],"%d", &val); - if (val<0 || val>3) { - ERROR("Possible dithering algorithms are 0,1,2,3\n"); - } - CM_dither_algo=val; - break ; - - default: - i=0; - } - return i ; -} - -static void convert() -{ - int x,y; - char *s0,*s1; - memset(scr0, 0, PICSIZE8); - memset(scr1, 0, PICSIZE8); - int colors[] = { - // col15 col8a col8b - 0, 0, 0, // 00 ! - 0, 0, 1, // 01 ! - 1, 0, 0, // 02 . == 11 - 1, 0, 1, // 03 . == 12 - 1, 1, 1, // 04 . == 22 - 0, 1, 0, // 10 ! - 1, 0, 0, // 11 ! - 1, 0, 1, // 12 ! - 1, 1, 1, // 13 . == 22 - 2, 0, 1, // 14 . == 23 - 1, 0, 0, // 20 . == 11 - 1, 1, 0, // 21 ! - 1, 1, 1, // 22 ! or 2 0 0 - 2, 0, 1, // 23 ! - 2, 1, 1, // 24 . == 33 - 1, 1, 0, // 30 . == 21 - 1, 1, 1, // 31 . == 22 - 2, 1, 0, // 32 ! - 2, 1, 1, // 33 ! - 3, 0, 1, // 34 ! - 1, 1, 1, // 40 . == 22 - 2, 1, 0, // 41 . == 32 - 2, 1, 1, // 42 . == 33 - 3, 1, 0, // 43 ! - 3, 1, 1, // 44 ! - }; - - CM_initialize(5); - - INFO("hr2: Converting %s\n", fname); - - for(y=0;y<nlines;y++) { - for(x=0;x<HSIZE;x+=2) { - int b0=bmap[y*HSIZE+x]; - int b1=bmap[y*HSIZE+x+1]; - int c0,c1; - int ac0,ac1,ac2; - int ind; - - c0 = CM_get_color(x,y,b0); - c1 = CM_get_color(x+1,y,b1); - -// for(c0=0; b0>color_borders[c0]; c0++); -// for(c1=0; b1>color_borders[c1]; c1++); - ind=5*c0+c1; - - if (y&1) { // odd lines - s1=scr0+(y*HSIZE+x)/8; - s0=scr1+(y*HSIZE+x)/8; - } else { // even lines - s0=scr0+(y*HSIZE+x)/8; - s1=scr1+(y*HSIZE+x)/8; - } - - ac0=colors[3*ind+0]; - ac1=colors[3*ind+1]; - ac2=colors[3*ind+2]; - - *s1 |= ac0 << (6-(x&6)); //gr 15 - *s0 |= ac1 << (7-(x&7)) | ac2<< (7-(x&7)-1); - } - } -} - -static void write_files() -{ - FILE *fd; - char fn[1000]; - int i; - - sprintf(fn, "%s.xex", fname_base); - INFO("Writing %s\n", fn); - fd=fopen(fn,"wb"); - fwrite(scr0hdr, 1, sizeof(scr0hdr), fd); - fwrite(scr0, 1, PICSIZE8, fd); - fwrite(scr1hdr, 1, sizeof(scr1hdr), fd); - fwrite(scr1, 1, PICSIZE8, fd); - fwrite(xlbin, 1, sizeof(xlbin), fd); - fclose(fd); - INFO("Atari colors used: "); - for(i=0;i<6;i++) { - INFO("%02x ", xlbin[6+i]); - } - INFO("\n"); -} - -modt mod_hr2 = { - "hr2", - "320x200, 5 shades of gray", - parse_arg, - usage, - convert, - write_files -}; - -modt* init_mod_hr2() -{ - return &mod_hr2; -} +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "mod_hr2.h" + +static unsigned char xlbin[]={ +#include "mod_hr2.xlc" +}; + +static unsigned char scr0[PICSIZE/8]; +static unsigned char scr1[PICSIZE/8]; +static unsigned char scr0hdr[] = {0xff, 0xff, 0x60, 0x40, 0x9f, 0x5f}; +static unsigned char scr1hdr[] = {0xff, 0xff, 0x60, 0x60, 0x9f, 0x7f}; + +static unsigned char colorsets[] = { + 2, 4, 0, 2, 4, 6, + 4, 8, 0, 4, 8, 12, +} ; + +static void usage() +{ + printf( + "HR2 options:\n" + "\t-B <algorithm> - border generation algorithm:\n" + "\t\t0 - fixed [default]\n" + "\t\t1 - by value range\n" + "\t\t2 - by value frequency\n" + "\t-c <#color> <hex value> - set atari colour\n" + "\t-C <#colorset> - atari colorset:\n" + "\t\t0 - darker, less flickering [default]\n" + "\t\t1 - brighter, more flickering\n" + "\t-D <algorithm> - use dithering algorithm:\n" + "\t\t0 - none [default]\n" + "\t\t1 - chessboard\n" + "\t\t2 - progressive (experimental)\n" + "\t\t3 - Floyd-Steinberg\n" + ); +} + +static int parse_arg(int argc, char **argv) +{ + int i=0,nr,val; + char *opt=argv[i++]; + + switch(opt[1]) { + case 'B': + if (argc<i+1) { + ERROR("Not enough parameters for -B\n"); + } + sscanf(argv[i++],"%d", &val); + if (val<0 || val>2) { + ERROR("Possible border generation algorithms are 0,1,2\n"); + } + CM_border_algo=val; + break ; + case 'c': + if (argc<i+2) { + ERROR("Not enough parameters for -c\n"); + } + sscanf(argv[i++],"%d", &nr); + sscanf(argv[i++],"%x", &val); + if (nr<0 || nr>5) { + ERROR("Possible colors are 0..5\n"); + } + xlbin[6+nr]=val; + break; + case 'C': + if (argc<i+1) { + ERROR("Not enough parameters for -C\n"); + } + sscanf(argv[i++],"%d", &val); + if (val<0 || val>1) { + ERROR("Possible colorsets are 0,1\n"); + } + for(nr=0;nr<6;nr++) { + xlbin[6+nr]=colorsets[6*val+nr]; + } + break ; + case 'D': + if (argc<i+1) { + ERROR("Not enough parameters for -D\n"); + } + sscanf(argv[i++],"%d", &val); + if (val<0 || val>3) { + ERROR("Possible dithering algorithms are 0,1,2,3\n"); + } + CM_dither_algo=val; + break ; + + default: + i=0; + } + return i ; +} + +static void convert() +{ + int x,y; + char *s0,*s1; + memset(scr0, 0, PICSIZE8); + memset(scr1, 0, PICSIZE8); + int colors[] = { + // col15 col8a col8b + 0, 0, 0, // 00 ! + 0, 0, 1, // 01 ! + 1, 0, 0, // 02 . == 11 + 1, 0, 1, // 03 . == 12 + 1, 1, 1, // 04 . == 22 + 0, 1, 0, // 10 ! + 1, 0, 0, // 11 ! + 1, 0, 1, // 12 ! + 1, 1, 1, // 13 . == 22 + 2, 0, 1, // 14 . == 23 + 1, 0, 0, // 20 . == 11 + 1, 1, 0, // 21 ! + 1, 1, 1, // 22 ! or 2 0 0 + 2, 0, 1, // 23 ! + 2, 1, 1, // 24 . == 33 + 1, 1, 0, // 30 . == 21 + 1, 1, 1, // 31 . == 22 + 2, 1, 0, // 32 ! + 2, 1, 1, // 33 ! + 3, 0, 1, // 34 ! + 1, 1, 1, // 40 . == 22 + 2, 1, 0, // 41 . == 32 + 2, 1, 1, // 42 . == 33 + 3, 1, 0, // 43 ! + 3, 1, 1, // 44 ! + }; + + CM_initialize(5); + + INFO("hr2: Converting %s\n", fname); + + for(y=0;y<nlines;y++) { + for(x=0;x<HSIZE;x+=2) { + int b0=bmap[y*HSIZE+x]; + int b1=bmap[y*HSIZE+x+1]; + int c0,c1; + int ac0,ac1,ac2; + int ind; + + c0 = CM_get_color(x,y,b0); + c1 = CM_get_color(x+1,y,b1); + +// for(c0=0; b0>color_borders[c0]; c0++); +// for(c1=0; b1>color_borders[c1]; c1++); + ind=5*c0+c1; +/* + if (y&1) { // odd lines + s1=scr0+(y*HSIZE+x)/8; + s0=scr1+(y*HSIZE+x)/8; + } else { // even lines + s0=scr0+(y*HSIZE+x)/8; + s1=scr1+(y*HSIZE+x)/8; + } +*/ + s0=scr0+(y*HSIZE+x)/8; + s1=scr1+(y*HSIZE+x)/8; + + + ac0=colors[3*ind+0]; + ac1=colors[3*ind+1]; + ac2=colors[3*ind+2]; + + *s1 |= ac0 << (6-(x&6)); //gr 15 + *s0 |= ac1 << (7-(x&7)) | ac2<< (7-(x&7)-1); + } + } +} + +static void write_files() +{ + FILE *fd; + char fn[1000]; + int i; + + sprintf(fn, "%s.xex", fname_base); + INFO("Writing %s\n", fn); + fd=fopen(fn,"wb"); + fwrite(scr0hdr, 1, sizeof(scr0hdr), fd); + fwrite(scr0, 1, PICSIZE8, fd); + fwrite(scr1hdr, 1, sizeof(scr1hdr), fd); + fwrite(scr1, 1, PICSIZE8, fd); + fwrite(xlbin, 1, sizeof(xlbin), fd); + fclose(fd); + sprintf(fn, "%s.hr2", fname_base); + INFO("Writing %s\n", fn); + fd=fopen(fn,"wb"); + fwrite(scr0, 1, PICSIZE8, fd); + fwrite(scr1, 1, PICSIZE8, fd); + fwrite(xlbin+6, 1, 6, fd); + fclose(fd); + INFO("Atari colors used: "); + for(i=0;i<6;i++) { + INFO("%02x ", xlbin[6+i]); + } + INFO("\n"); +} + +modt mod_hr2 = { + "hr2", + "320x200, 5 shades of gray", + parse_arg, + usage, + convert, + write_files +}; + +modt* init_mod_hr2() +{ + return &mod_hr2; +} Index: mod_hr0.asx =================================================================== RCS file: /cvsroot/lepix/lepix/lepicon/mod_hr0.asx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mod_hr0.asx 22 May 2005 21:48:56 -0000 1.1 +++ mod_hr0.asx 24 Jan 2010 12:43:56 -0000 1.2 @@ -1,134 +1,134 @@ - opt h+ - -JUSTBIN equ 1 - - ift !JUSTBIN - org $4060 -; ins 'face.int' -; ins 'alien.int' -; ins 'obraz.int' -; ins 'p2.hri' - ins 'pix/r1.sc0' - - org $6060 -; ins 'p1.hri' - ins 'pix/r1.sc1' - eif - -colors equ $a000 -prog equ $a004 - - org colors -kol11 dta $04 -kol12 dta $06 -kol22 dta $00 -kol21 dta $00 - - org prog - -start - lda <dl - sta $230 - lda >dl - sta $231 - lda #0 - sta $2c8 - ldx <pr1 - ldy >pr1 - stx $200 - sty $201 - lda #$c0 - sta $d40e - lda #$04 - sta $2c4 - lda #$08 - sta $2c5 - lda #$0 - sta $2c6 - -l1 equ * - lda 20 - cmp 20 - beq *-2 - - lda d1+1 - eor #$20 - - sta d1+1 - lda d2+1 - eor #$20 - sta d2+1 - jmp l1 - -pr1 - sta $88 - sty $89 - stx $8a - ldy #100 -p1 - lda kol11 - ldx kol21 - sta $d40a - sta $d017 - stx $d018 - - lda kol12 - ldx kol22 - sta $d40a - sta $d017 - stx $d018 - - dey - bne p1 - - lda <pr2 - sta $200 - lda >pr2 - sta $201 - lda $88 - ldx $8a - ldy $89 - rti - -pr2 - sta $88 - sty $89 - stx $8a - ldy #100 -p2 - - lda kol12 - ldx kol22 - sta $d40a - sta $d017 - stx $d018 - - lda kol11 - ldx kol21 - sta $d40a - sta $d017 - stx $d018 - - dey - bne p2 - lda <pr1 - sta $200 - lda >pr1 - sta $201 - lda $88 - ldy $89 - ldx $8a - rti - -dl dta b($70),b($70),b($80),b($4f) - -d1 dta a($4060) -:99 dta $0f - dta b($4f) -d2 dta a($5000) -:99 dta $0f - dta b($41),a(dl) - - - org $2e0 - dta a(start) + opt h+ + +JUSTBIN equ 1 + + ift !JUSTBIN + org $4060 +; ins 'face.int' +; ins 'alien.int' +; ins 'obraz.int' +; ins 'p2.hri' + ins 'pix/r1.sc0' + + org $6060 +; ins 'p1.hri' + ins 'pix/r1.sc1' + eif + +colors equ $a000 +prog equ $a004 + + org colors +kol11 dta $04 +kol12 dta $06 +kol22 dta $00 +kol21 dta $00 + + org prog + +start + lda <dl + sta $230 + lda >dl + sta $231 + lda #0 + sta $2c8 + ldx <pr1 + ldy >pr1 + stx $200 + sty $201 + lda #$c0 + sta $d40e + lda #$04 + sta $2c4 + lda #$08 + sta $2c5 + lda #$0 + sta $2c6 + +l1 equ * + lda 20 + cmp 20 + beq *-2 + + lda d1+1 + eor #$20 + + sta d1+1 + lda d2+1 + eor #$20 + sta d2+1 + jmp l1 + +pr1 + sta $88 + sty $89 + stx $8a + ldy #100 +p1 + lda kol11 + ldx kol21 + sta $d40a + sta $d017 + stx $d018 + + lda kol12 + ldx kol22 + sta $d40a + sta $d017 + stx $d018 + + dey + bne p1 + + lda <pr2 + sta $200 + lda >pr2 + sta $201 + lda $88 + ldx $8a + ldy $89 + rti + +pr2 + sta $88 + sty $89 + stx $8a + ldy #100 +p2 + + lda kol12 + ldx kol22 + sta $d40a + sta $d017 + stx $d018 + + lda kol11 + ldx kol21 + sta $d40a + sta $d017 + stx $d018 + + dey + bne p2 + lda <pr1 + sta $200 + lda >pr1 + sta $201 + lda $88 + ldy $89 + ldx $8a + rti + +dl dta b($70),b($70),b($80),b($4f) + +d1 dta a($4060) +:99 dta $0f + dta b($4f) +d2 dta a($5000) +:99 dta $0f + dta b($41),a(dl) + + + org $2e0 + dta a(start) Index: mod_gr8.c =================================================================== RCS file: /cvsroot/lepix/lepix/lepicon/mod_gr8.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mod_gr8.c 25 May 2005 22:25:34 -0000 1.1 +++ mod_gr8.c 24 Jan 2010 12:43:56 -0000 1.2 @@ -1,130 +1,130 @@ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "mod_gr8.h" - -static unsigned char xlbin[]={ -#include "mod_gr8.xlc" -}; - -static unsigned char scr0[PICSIZE/8]; -static unsigned char scr0hdr[] = {0xff, 0xff, 0x60, 0x40, 0x9f, 0x5f}; - - -static void usage() -{ - printf( - "HR2 options:\n" - "\t-B <algorithm> - border generation algorithm:\n" - "\t\t0 - fixed [default]\n" - "\t\t1 - by value range\n" - "\t\t2 - by value frequency\n" - "\t-c <#color> <hex value> - set atari colour\n" - "\t-D <algorithm> - use dithering algorithm:\n" - "\t\t0 - none [default]\n" - "\t\t1 - chessboard\n" - "\t\t2 - progressive (experimental)\n" - "\t\t3 - Floyd-Steinberg\n" - ); -} - -static int parse_arg(int argc, char **argv) -{ - int i=0,nr,val; - char *opt=argv[i++]; - - switch(opt[1]) { - case 'B': - if (argc<i+1) { - ERROR("Not enough parameters for -B\n"); - } - sscanf(argv[i++],"%d", &val); - if (val<0 || val>2) { - ERROR("Possible border generation algorithms are 0,1,2\n"); - } - CM_border_algo=val; - break ; - case 'c': - if (argc<i+2) { - ERROR("Not enough parameters for -c\n"); - } - sscanf(argv[i++],"%d", &nr); - sscanf(argv[i++],"%x", &val); - if (nr<0 || nr>1) { - ERROR("Possible colors are 0..1\n"); - } - xlbin[6+nr]=val; - break; - case 'D': - if (argc<i+1) { - ERROR("Not enough parameters for -D\n"); - } - sscanf(argv[i++],"%d", &val); - if (val<0 || val>3) { - ERROR("Possible dithering algorithms are 0,1,2,3\n"); - } - CM_dither_algo=val; - break ; - default: - i=0; - } - return i ; -} - -static void convert() -{ - int x,y; - char *s0; - memset(scr0, 0, PICSIZE8); - - CM_initialize(2); - - INFO("hr1: Converting %s\n", fname); - - for(y=0;y<nlines;y++) { - for(x=0;x<HSIZE;x++) { - int b0=bmap[y*HSIZE+x]; - int c0; - - c0 = CM_get_color(x,y,b0); - - s0 = scr0+(y*HSIZE+x)/8; - - *s0 |= c0 << (7-(x&7)) ; - } - } -} - -static void write_files() -{ - FILE *fd; - char fn[1000]; - int i; - - sprintf(fn, "%s.xex", fname_base); - INFO("Writing %s\n", fn); - fd=fopen(fn,"wb"); - fwrite(scr0hdr, 1, sizeof(scr0hdr), fd); - fwrite(scr0, 1, PICSIZE8, fd); - fwrite(xlbin, 1, sizeof(xlbin), fd); - fclose(fd); - INFO("Atari colors used: "); - for(i=0;i<2;i++) { - INFO("%02x ", xlbin[6+i]); - } - INFO("\n"); -} - -modt mod_gr8 = { - "gr8", - "320x200, 2 shades of gray", - parse_arg, - usage, - convert, - write_files -}; - -modt* init_mod_gr8() -{ - return &mod_gr8; -} +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "mod_gr8.h" + +static unsigned char xlbin[]={ +#include "mod_gr8.xlc" +}; + +static unsigned char scr0[PICSIZE/8]; +static unsigned char scr0hdr[] = {0xff, 0xff, 0x60, 0x40, 0x9f, 0x5f}; + + +static void usage() +{ + printf( + "HR2 options:\n" + "\t-B <algorithm> - border generation algorithm:\n" + "\t\t0 - fixed [default]\n" + "\t\t1 - by value range\n" + "\t\t2 - by value frequency\n" + "\t-c <#color> <hex value> - set atari colour\n" + "\t-D <algorithm> - use dithering algorithm:\n" + "\t\t0 - none [default]\n" + "\t\t1 - chessboard\n" + "\t\t2 - progressive (experimental)\n" + "\t\t3 - Floyd-Steinberg\n" + ); +} + +static int parse_arg(int argc, char **argv) +{ + int i=0,nr,val; + char *opt=argv[i++]; + + switch(opt[1]) { + case 'B': + if (argc<i+1) { + ERROR("Not enough parameters for -B\n"); + } + sscanf(argv[i++],"%d", &val); + if (val<0 || val>2) { + ERROR("Possible border generation algorithms are 0,1,2\n"); + } + CM_border_algo=val; + break ; + case 'c': + if (argc<i+2) { + ERROR("Not enough parameters for -c\n"); + } + sscanf(argv[i++],"%d", &nr); + sscanf(argv[i++],"%x", &val); + if (nr<0 || nr>1) { + ERROR("Possible colors are 0..1\n"); + } + xlbin[6+nr]=val; + break; + case 'D': + if (argc<i+1) { + ERROR("Not enough parameters for -D\n"); + } + sscanf(argv[i++],"%d", &val); + if (val<0 || val>3) { + ERROR("Possible dithering algorithms are 0,1,2,3\n"); + } + CM_dither_algo=val; + break ; + default: + i=0; + } + return i ; +} + +static void convert() +{ + int x,y; + char *s0; + memset(scr0, 0, PICSIZE8); + + CM_initialize(2); + + INFO("hr1: Converting %s\n", fname); + + for(y=0;y<nlines;y++) { + for(x=0;x<HSIZE;x++) { + int b0=bmap[y*HSIZE+x]; + int c0; + + c0 = CM_get_color(x,y,b0); + + s0 = scr0+(y*HSIZE+x)/8; + + *s0 |= c0 << (7-(x&7)) ; + } + } +} + +static void write_files() +{ + FILE *fd; + char fn[1000]; + int i; + + sprintf(fn, "%s.xex", fname_base); + INFO("Writing %s\n", fn); + fd=fopen(fn,"wb"); + fwrite(scr0hdr, 1, sizeof(scr0hdr), fd); + fwrite(scr0, 1, PICSIZE8, fd); + fwrite(xlbin, 1, sizeof(xlbin), fd); + fclose(fd); + INFO("Atari colors used: "); + for(i=0;i<2;i++) { + INFO("%02x ", xlbin[6+i]); + } + INFO("\n"); +} + +modt mod_gr8 = { + "gr8", + "320x200, 2 shades of gray", + parse_arg, + usage, + convert, + write_files +}; + +modt* init_mod_gr8() +{ + return &mod_gr8; +} Index: mod_hr1.c =================================================================== RCS file: /cvsroot/lepix/lepix/lepicon/mod_hr1.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mod_hr1.c 22 May 2005 23:10:34 -0000 1.2 +++ mod_hr1.c 24 Jan 2010 12:43:56 -0000 1.3 @@ -1,162 +1,162 @@ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "mod_hr1.h" - -static unsigned char xlbin[]={ -#include "mod_hr1.xlc" -}; - -static int algo=0 ; - -static unsigned char scr0[PICSIZE/8]; -static unsigned char scr1[PICSIZE/8]; -static unsigned char scr0hdr[] = {0xff, 0xff, 0x60, 0x40, 0x9f, 0x5f}; -static unsigned char scr1hdr[] = {0xff, 0xff, 0x60, 0x60, 0x9f, 0x7f}; - -static int colour_border[]={0x20,0x40,0x60,0x80,0xa0,0xc0,0xe0,0x100}; -static int colour_modeF[] ={ 0, 0, 0, 0, 1, 1, 1, 1}; -static int colour_modeE[] ={ 0, 1, 2, 3, 0, 1, 2, 3}; - -static void usage() -{ - printf( - "HR1 options:\n" - "\t-a <algorithm> - conversion algorithm:\n" - "\t\t0 - 4-colour mode\n" - "\t\t1 - 8-colour mode\n" - "\t-c <#color> <hex value> - set atari colour\n" - ); -} - -static int parse_arg(int argc, char **argv) -{ - int i=0,nr,val; - char *opt=argv[i++]; - - switch(opt[1]) { - case 'a': - if (argc<i+1) { - ERROR("Not enough parameters for -a\n"); - } - sscanf(argv[i++],"%d", &val); - if (val<0 || val>1) { - ERROR("Possible algorithm values: 0,1\n"); - } - algo=val; - break ; - case 'c': - if (argc<i+2) { - ERROR("Not enough parameters for -c\n"); - } - sscanf(argv[i++],"%d", &nr); - sscanf(argv[i++],"%x", &val); - if (nr<0 || nr>3) { - ERROR("Possible colors are 0..5\n"); - } - xlbin[6+nr]=val; - break; - default: - i=0; - } - return i ; -} - - -static void convert() -{ - int x,y; - int dualsum=0 ; - char *s0,*s1; - memset(scr0, 0, PICSIZE8); - memset(scr1, 0, PICSIZE8); - - INFO("hr1: Converting %s\n", fname); - - for(y=0;y<nlines;y++) { - for(x=0;x<HSIZE;x++) { - int c=bmap[y*HSIZE+x]; - int c0,c1; // atari colour - - if (y&1) { // odd lines - s1=scr0+(y*HSIZE+x)/8; - s0=scr1+(y*HSIZE+x)/8; - } else { // even lines - s0=scr0+(y*HSIZE+x)/8; - s1=scr1+(y*HSIZE+x)/8; - } - dualsum+=c ; - if (algo==0){ - // gr 8 - c0 = (c > 0x80) ; - // gr 15 - if (x&1) { - dualsum/=2; - if (dualsum > 0x80) { - if (dualsum > 0xc0) - c1=3; - else - c1=2; - } else { - if (dualsum > 0x40) - c1=1; - else - c1=0; - } - dualsum=0; - } else { - c1 = 0 ; - } - } else { - for(c0=0; c>colour_border[c0]; c0++) ; - c0=colour_modeF[c0]; - if (x&1) { - dualsum/=2; - for(c1=0; dualsum>colour_border[c1]; c1++); - c1=colour_modeE[c1]; - dualsum=0; - } else { - c1 = 0; - } - } - *s0 |= c0 << (7-(x&7)); - *s1 |= c1 << (6-(x&6)); - } - } -} - -static void write_files() -{ - FILE *fd; - char fn[1000]; - int i; - - sprintf(fn, "%s.xex", fname_base); - INFO("Writing %s\n", fn); - fd=fopen(fn,"wb"); - fwrite(scr0hdr, 1, sizeof(scr0hdr), fd); - fwrite(scr0, 1, PICSIZE8, fd); - fwrite(scr1hdr, 1, sizeof(scr1hdr), fd); - fwrite(scr1, 1, PICSIZE8, fd); - fwrite(xlbin, 1, sizeof(xlbin), fd); - fclose(fd); - INFO("Atari colors used: "); - for(i=0;i<6;i++) { - INFO("%02x ", xlbin[6+i]); - } - INFO("\n"); -} - -modt mod_hr1 = { - "hr1", - "320x200, 4/8 shades of gray", - parse_arg, - usage, - convert, - write_files -}; - -modt* init_mod_hr1() -{ - return &mod_hr1; -} +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "mod_hr1.h" + +static unsigned char xlbin[]={ +#include "mod_hr1.xlc" +}; + +static int algo=0 ; + +static unsigned char scr0[PICSIZE/8]; +static unsigned char scr1[PICSIZE/8]; +static unsigned char scr0hdr[] = {0xff, 0xff, 0x60, 0x40, 0x9f, 0x5f}; +static unsigned char scr1hdr[] = {0xff, 0xff, 0x60, 0x60, 0x9f, 0x7f}; + +static int colour_border[]={0x20,0x40,0x60,0x80,0xa0,0xc0,0xe0,0x100}; +static int colour_modeF[] ={ 0, 0, 0, 0, 1, 1, 1, 1}; +static int colour_modeE[] ={ 0, 1, 2, 3, 0, 1, 2, 3}; + +static void usage() +{ + printf( + "HR1 options:\n" + "\t-a <algorithm> - conversion algorithm:\n" + "\t\t0 - 4-colour mode\n" + "\t\t1 - 8-colour mode\n" + "\t-c <#color> <hex value> - set atari colour\n" + ); +} + +static int parse_arg(int argc, char **argv) +{ + int i=0,nr,val; + char *opt=argv[i++]; + + switch(opt[1]) { + case 'a': + if (argc<i+1) { + ERROR("Not enough parameters for -a\n"); + } + sscanf(argv[i++],"%d", &val); + if (val<0 || val>1) { + ERROR("Possible algorithm values: 0,1\n"); + } + algo=val; + break ; + case 'c': + if (argc<i+2) { + ERROR("Not enough parameters for -c\n"); + } + sscanf(argv[i++],"%d", &nr); + sscanf(argv[i++],"%x", &val); + if (nr<0 || nr>3) { + ERROR("Possible colors are 0..5\n"); + } + xlbin[6+nr]=val; + break; + default: + i=0; + } + return i ; +} + + +static void convert() +{ + int x,y; + int dualsum=0 ; + char *s0,*s1; + memset(scr0, 0, PICSIZE8); + memset(scr1, 0, PICSIZE8); + + INFO("hr1: Converting %s\n", fname); + + for(y=0;y<nlines;y++) { + for(x=0;x<HSIZE;x++) { + int c=bmap[y*HSIZE+x]; + int c0,c1; // atari colour + + if (y&1) { // odd lines + s1=scr0+(y*HSIZE+x)/8; + s0=scr1+(y*HSIZE+x)/8; + } else { // even lines + s0=scr0+(y*HSIZE+x)/8; + s1=scr1+(y*HSIZE+x)/8; + } + dualsum+=c ; + if (algo==0){ + // gr 8 + c0 = (c > 0x80) ; + // gr 15 + if (x&1) { + dualsum/=2; + if (dualsum > 0x80) { + if (dualsum > 0xc0) + c1=3; + else + c1=2; + } else { + if (dualsum > 0x40) + c1=1; + else + c1=0; + } + dualsum=0; + } else { + c1 = 0 ; + } + } else { + for(c0=0; c>colour_border[c0]; c0++) ; + c0=colour_modeF[c0]; + if (x&1) { + dualsum/=2; + for(c1=0; dualsum>colour_border[c1]; c1++); + c1=colour_modeE[c1]; + dualsum=0; + } else { + c1 = 0; + } + } + *s0 |= c0 << (7-(x&7)); + *s1 |= c1 << (6-(x&6)); + } + } +} + +static void write_files() +{ + FILE *fd; + char fn[1000]; + int i; + + sprintf(fn, "%s.xex", fname_base); + INFO("Writing %s\n", fn); + fd=fopen(fn,"wb"); + fwrite(scr0hdr, 1, sizeof(scr0hdr), fd); + fwrite(scr0, 1, PICSIZE8, fd); + fwrite(scr1hdr, 1, sizeof(scr1hdr), fd); + fwrite(scr1, 1, PICSIZE8, fd); + fwrite(xlbin, 1, sizeof(xlbin), fd); + fclose(fd); + INFO("Atari colors used: "); + for(i=0;i<6;i++) { + INFO("%02x ", xlbin[6+i]); + } + INFO("\n"); +} + +modt mod_hr1 = { + "hr1", + "320x200, 4/8 shades of gray", + parse_arg, + usage, + convert, + write_files +}; + +modt* init_mod_hr1() +{ + return &mod_hr1; +} |
|
From: Marcin Z. <e-...@us...> - 2010-01-24 10:28:48
|
Update of /cvsroot/lepix/lepix/hr2 In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv12301 Added Files: boris9901.hr2 Log Message: - adding an example file --- NEW FILE: boris9901.hr2 --- (This appears to be a binary file; contents omitted.) |
|
From: Marcin Z. <e-...@us...> - 2010-01-24 10:28:17
|
Update of /cvsroot/lepix/lepix/hr2 In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv12283/hr2 Log Message: Directory /cvsroot/lepix/lepix/hr2 added to the repository |
|
From: Marcin Z. <e-...@us...> - 2010-01-23 23:48:44
|
Update of /cvsroot/lepix/lepix In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv25123 Modified Files: dli.asx lepix.asx Makefile Log Message: - enabling HR2 - adding text-highlighting possibility to DLI Index: dli.asx =================================================================== RCS file: /cvsroot/lepix/lepix/dli.asx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- dli.asx 12 May 2007 20:43:02 -0000 1.2 +++ dli.asx 23 Jan 2010 23:48:36 -0000 1.3 @@ -1,4 +1,13 @@ DLI .LOCAL + +/* text highlighting */ +hl_l1_x dta $00 +hl_l1_color dta $40 +hl_l1_mask dta %00000000 +hl_l2_x dta $00 +hl_l2_color dta $f0 +hl_l2_mask dta %00000000 + * DLI Interrupts init equ * @@ -25,12 +34,31 @@ DLI_down2 pha + mva #3 SIZEP0 ; mva #0 $d01b lda #$80 sta $d40a sta $d018 -; sta $d01a + + mva hl_l1_x HPOSP0 + mva hl_l1_color $d012 + ldy #7 +_ddl1 + sta $d40a + mva hl_l1_mask PLR0_BASE+232,y + dey + bne _ddl1 + + mva hl_l2_x HPOSP0 + mva hl_l2_color $d012 + ldy #7 +_ddl2 + sta $d40a + mva hl_l2_mask PLR0_BASE+240,y + dey + bne _ddl2 + ; mwa #DLI_down $200 ; switch DLI Index: Makefile =================================================================== RCS file: /cvsroot/lepix/lepix/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 3 Jan 2010 17:55:18 -0000 1.5 +++ Makefile 23 Jan 2010 23:48:36 -0000 1.6 @@ -5,7 +5,7 @@ joy.asx keyboard.asx mouse.asx \ io.asx menu.asx undo.asx \ mod_cin.asx mod_mic.asx mod_inp.asx mod_hip.asx mod_tip.asx \ - mod_gr8.asx + mod_gr8.asx mod_hr2.asx TABS=$(SRCS:%.asx=%.tab) LSTS=$(SRCS:%.asx=%.lst) Index: lepix.asx =================================================================== RCS file: /cvsroot/lepix/lepix/lepix.asx,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- lepix.asx 3 Jan 2010 17:55:19 -0000 1.7 +++ lepix.asx 23 Jan 2010 23:48:36 -0000 1.8 @@ -177,15 +177,17 @@ icl 'menu.asx' icl 'undo.asx' -INCLUDE_PICTURE equ 0 +INCLUDE_PICTURE equ 1 .ifndef GFX_MODE -;GFX_MODE equ 1 ; MIC -;GFX_MODE equ 2 ; INP -;GFX_MODE equ 3 ; CIN -;GFX_MODE equ 4 ; HIP -;GFX_MODE equ 5 ; TIP -GFX_MODE equ 6 ; GR8 +; 1 : MIC +; 2 : INP +; 3 : CIN +; 4 : HIP +; 5 : TIP +; 6 : GR8 +; 7 : HR2 +GFX_MODE equ 7 .endif ift GFX_MODE=1 @@ -200,6 +202,8 @@ icl 'mod_tip.asx' eli GFX_MODE=6 icl 'mod_gr8.asx' + eli GFX_MODE=7 + icl 'mod_hr2.asx' els .PRINT 'Unspecified mode' ert 1; |
|
From: Marcin Z. <e-...@us...> - 2010-01-23 23:46:45
|
Update of /cvsroot/lepix/lepix In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv24896 Added Files: mod_hr2.asx Log Message: First version of HR2 - drawing/picking/colors works - zoom broken --- NEW FILE: mod_hr2.asx --- ******************************************************************************* * External MOD_MOD equ * MOD_init jmp HR2.init MOD_vbl jmp HR2.vbl MOD_pick_color jmp HR2.pick_color MOD_put_pixel jmp HR2.put_pixel MOD_enable_zoom jmp HR2.enable_zoom MOD_disable_zoom jmp HR2.disable_zoom MOD_zoom_update jmp HR2.zoom_update ; updates a single zoomed line. Y=line number MOD_zoom_update_line jmp HR2.zoom_update_line ; updates upper part MOD_zoom_update_top jmp HR2.zoom_update_top MOD_pmY dta 20 ; in scanlines, Y position of the first line MOD_pixel_w dta 1 ; hi-res (GR8), can be 1,2,4,8 MOD_pixel_h dta 1 ; - anything [...962 lines suppressed...] dl1_core equ * org dl2 dta $80,$00 :3 dta $4e,a(pline2),$4f,a(pline1) dta $00,$00,$80 DL2_jsr equ *+1 dta $01,a(dl2_core) DL2_return dta $00 dta $81,a(DL.down) dl2_core equ * org HR2_return HR2.MOD_LEN equ *-HR2 .ENDL ; HR2 |
|
From: Marcin Z. <e-...@us...> - 2010-01-03 17:55:33
|
Update of /cvsroot/lepix/lepix In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9054 Modified Files: Makefile cursor.asx lepix.asx mod_cin.asx mod_hip.asx mod_inp.asx mod_mic.asx mod_tip.asx undo.asx utils.asx zoom.asx Added Files: mod_gr8.asx Log Message: first steps towards hi-res modes - mod_gr8 implemented - undo doesn't work properly - large cursors display incorrectly in hi-res modes - besides, things seem to work Index: mod_mic.asx =================================================================== RCS file: /cvsroot/lepix/lepix/mod_mic.asx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- mod_mic.asx 12 May 2007 20:43:02 -0000 1.3 +++ mod_mic.asx 3 Jan 2010 17:55:19 -0000 1.4 @@ -15,10 +15,10 @@ MOD_zoom_update_top jmp MIC.zoom_update_top MOD_pmY dta 20 ; in scanlines, Y position of the first line -MOD_pixel_w dta 1 ; can be 1,2 or 4 +MOD_pixel_w dta 2 ; hi-res (GR8), can be 1,2,4,8 MOD_pixel_h dta 1 ; - anything -MOD_max_x dta 160 +MOD_max_x dta a(160) MOD_max_y dta 200 MOD_max_cursor_w dta 4 ; for performance @@ -27,7 +27,7 @@ MOD_zoom_w dta 80 ; in mode pixels MOD_zoom_h dta MIC.zoomlines ; in mode pixels, MAX: 47 MOD_zoom_pmY dta 220-[2*MIC.zoomlines] ; in scanlines, Y position of a first line -MOD_zoom_pixel_w dta 2 ; in 15 pixels +MOD_zoom_pixel_w dta 2 ; in GR15 pixels MOD_zoom_pixel_h dta 2 ; in scanlines MOD_zoom_top_h dta 200-4-[2*MIC.zoomlines] ; lines from main panel visible @@ -214,7 +214,7 @@ sta zerHlp lda hiline,y sta zerHlp+1 - ldx cursor_x + ldx cursor_X ldy div4,x lda (zerHlp),y and ands,x @@ -244,7 +244,7 @@ mpp_loopY mva #0 mpp_cntX mpp_loopx - lda cursor_x + lda cursor_X clc adc mpp_cntX tax Index: mod_tip.asx =================================================================== RCS file: /cvsroot/lepix/lepix/mod_tip.asx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- mod_tip.asx 12 May 2007 20:43:02 -0000 1.4 +++ mod_tip.asx 3 Jan 2010 17:55:19 -0000 1.5 @@ -15,10 +15,10 @@ MOD_zoom_update_top jmp TIP.zoom_update_top MOD_pmY dta 19 ; in scanlines, Y position of the first line -MOD_pixel_w dta 1 ; can be 1,2 or 4 +MOD_pixel_w dta 2 ; hi-res (GR8), can be 1,2,4,8 MOD_pixel_h dta 2 ; - anything -MOD_max_x dta 160 +MOD_max_x dta a(160) MOD_max_y dta 100 MOD_max_cursor_w dta 4 ; for performance @@ -479,7 +479,7 @@ eor #SCR_40_C0_EOR sta zer2+1 - ldx cursor_x + ldx cursor_X lda cur_mode and #MODE_BRI @@ -591,7 +591,7 @@ loopx mva #0 UNDO.pos_x - lda cursor_x + lda cursor_X clc adc pp_cntX ldx pp_do_bri @@ -1040,9 +1040,9 @@ lda cur_mode cmp #MODE_TONE bne um1 - lda cursor_x + lda cursor_X asl @ - sta cursor_x + sta cursor_X um1 ldx cur_mode dex @@ -1057,7 +1057,7 @@ beq um_tone um_bri mva #160 MOD_max_x - mva #1 MOD_pixel_w + mva #2 MOD_pixel_w mva #2 MOD_zoom_pixel_w mva #80 MOD_zoom_w rts @@ -1066,7 +1066,7 @@ lsr @ sta cursor_X mva #80 MOD_max_x - mva #2 MOD_pixel_w + mva #4 MOD_pixel_w mva #4 MOD_zoom_pixel_w mva #40 MOD_zoom_w rts Index: Makefile =================================================================== RCS file: /cvsroot/lepix/lepix/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile 12 May 2007 21:49:44 -0000 1.4 +++ Makefile 3 Jan 2010 17:55:18 -0000 1.5 @@ -4,7 +4,8 @@ dl.asx dli.asx vbl.asx cursor.asx font.asx utils.asx zoom.asx \ joy.asx keyboard.asx mouse.asx \ io.asx menu.asx undo.asx \ - mod_cin.asx mod_mic.asx mod_inp.asx mod_hip.asx mod_tip.asx + mod_cin.asx mod_mic.asx mod_inp.asx mod_hip.asx mod_tip.asx \ + mod_gr8.asx TABS=$(SRCS:%.asx=%.tab) LSTS=$(SRCS:%.asx=%.lst) Index: undo.asx =================================================================== RCS file: /cvsroot/lepix/lepix/undo.asx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- undo.asx 12 May 2007 20:43:02 -0000 1.1 +++ undo.asx 3 Jan 2010 17:55:19 -0000 1.2 @@ -222,7 +222,7 @@ decZer zer ; skip old color lda (zer),y sta pos_x - sta cursor_x + sta cursor_X jsr update_pixel @@ -276,7 +276,7 @@ ldy #0 lda (zer),y sta pos_x - sta cursor_x + sta cursor_X incZer zer ; skip pos x incZer zer ; skip old color lda (zer),y @@ -328,7 +328,7 @@ save_old_values - mva cursor_x cx + mva cursor_X cx mva cursor_y cy mva cursor_h ch mva cursor_w cw @@ -343,7 +343,7 @@ restore_old_values mva #0 ignore - mva cx cursor_x + mva cx cursor_X mva cy cursor_y mva ch cursor_h mva cw cursor_w Index: mod_hip.asx =================================================================== RCS file: /cvsroot/lepix/lepix/mod_hip.asx,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- mod_hip.asx 12 May 2007 20:43:02 -0000 1.6 +++ mod_hip.asx 3 Jan 2010 17:55:19 -0000 1.7 @@ -15,10 +15,10 @@ MOD_zoom_update_top jmp HIP.zoom_update_top MOD_pmY dta 19 ; in scanlines, Y position of the first line -MOD_pixel_w dta 1 ; can be 1,2 or 4 +MOD_pixel_w dta 2 ; hi-res (GR8), can be 1,2,4,8 MOD_pixel_h dta 1 ; - anything -MOD_max_x dta 160 +MOD_max_x dta a(160) MOD_max_y dta 200 MOD_max_cursor_w dta 4 ; for performance @@ -427,7 +427,7 @@ mva loline,y zer1 mva hiline,y zer1+1 - lda cursor_x + lda cursor_X lsr @ tay bcc GR9 @@ -481,7 +481,7 @@ loopY mva #0 pp_cntX loopx - lda cursor_x + lda cursor_X clc adc pp_cntX tax Index: lepix.asx =================================================================== RCS file: /cvsroot/lepix/lepix/lepix.asx,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- lepix.asx 1 Jan 2010 23:04:43 -0000 1.6 +++ lepix.asx 3 Jan 2010 17:55:19 -0000 1.7 @@ -27,7 +27,7 @@ zer2 equ $e6 zer3 equ $e8 zer4 equ $ea -zerHlp equ $f0 +zerHlp equ $f0 ; 16 reserved org prog start @@ -93,18 +93,20 @@ lda cursor_pressed sta last_pressed beq dont_draw - txa - ldx cursor_X - ldy cursor_Y - cmp #0 + cpx #0 beq draw - cpx last_X + lda cursor_X + cmp last_X bne draw - cpy last_Y + lda cursor_X+1 + cmp last_X+1 + bne draw + lda cursor_Y + cmp last_Y beq dont_draw draw - stx last_X - sty last_Y + mwa cursor_X last_X + mva cursor_Y last_Y jsr MOD_put_pixel lda ZOOM.state beq dont_draw @@ -114,7 +116,7 @@ rts last_pressed dta 0 -last_X dta 0 +last_X dta 0,0 // lo,hi last_Y dta 0 .ENDL ; put_pixel_if_new @@ -182,7 +184,8 @@ ;GFX_MODE equ 2 ; INP ;GFX_MODE equ 3 ; CIN ;GFX_MODE equ 4 ; HIP -GFX_MODE equ 5 ; TIP +;GFX_MODE equ 5 ; TIP +GFX_MODE equ 6 ; GR8 .endif ift GFX_MODE=1 @@ -195,6 +198,8 @@ icl 'mod_hip.asx' eli GFX_MODE=5 icl 'mod_tip.asx' + eli GFX_MODE=6 + icl 'mod_gr8.asx' els .PRINT 'Unspecified mode' ert 1; @@ -209,4 +214,4 @@ ert [*>prog_max] run start -; INI start +; INI start \ No newline at end of file Index: zoom.asx =================================================================== RCS file: /cvsroot/lepix/lepix/zoom.asx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- zoom.asx 12 May 2007 20:43:03 -0000 1.3 +++ zoom.asx 3 Jan 2010 17:55:19 -0000 1.4 @@ -32,39 +32,63 @@ rts .ENDL ; rts -; A - window size, X - max size, Y - cur value -_zoom_magic +; finds the start position of a zoom window in a given dimension +; A - window size, max_size - max size, X/Y - cur value lo/hi +_zoom_magic .LOCAL sta zoomHlp+1 lsr @ sta zoomHlp - txa - sec - sbc zoomHlp+1 - sta zoomHlp+1 + lda max_size + sub zoomHlp+1 + sta max_edge + lda max_size+1 + sbc #0 + sta max_edge+1 + txa + sub zoomHlp + sta std_edge tya - sec - sbc zoomHlp - bcs *+4 + sbc #0 + sta std_edge+1 + bcs not_left_edge +left_edge lda #0 - cmp zoomHlp+1 - bcc *+5 - lda zoomHlp+1 rts +not_left_edge + cmp max_edge+1 + bcc not_right_edge + bne right_edge + lda std_edge + cmp max_edge + bcc not_right_edge +right_edge + lda max_edge + rts +not_right_edge + lda std_edge + rts +max_size dta a(0) +max_edge dta a(0) +std_edge dta a(0) + .ENDL ; zoom_magic update .LOCAL lda state - beq ex + jeq ex + mwa mod_max_x _zoom_magic.max_size lda :mod_zoom_w - ldx :mod_max_x - ldy :cursor_x + ldx :cursor_X + ldy :cursor_X+1 jsr _zoom_magic sta zoom_x + mva mod_max_y _zoom_magic.max_size + mva #0 _zoom_magic.max_size+1 lda :mod_zoom_h - ldx :mod_max_y - ldy :cursor_y + ldx :cursor_y + ldy #0 jsr _zoom_magic sta zoom_y @@ -97,9 +121,11 @@ mva zoom_x zoom_old_x mva zoom_y zoom_old_y + mva mod_max_y _zoom_magic.max_size + mva #0 _zoom_magic.max_size+1 lda :mod_zoom_top_h - ldx :mod_max_y - ldy :cursor_y + ldx :cursor_y + ldy #0 jsr _zoom_magic sta zoom_top_y cmp zoom_old_top_y Index: cursor.asx =================================================================== RCS file: /cvsroot/lepix/lepix/cursor.asx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- cursor.asx 12 May 2007 20:43:02 -0000 1.5 +++ cursor.asx 3 Jan 2010 17:55:19 -0000 1.6 @@ -14,12 +14,13 @@ ZFR_ENABLED equ 1 ; enable zoom frame -cursor_X dta 0 +cursor_X dta 0,0 // standard lo, hi cursor_Y dta 0 cursor_H dta 1 cursor_W dta 1 cursor_PRESSED dta 0 -player_sizes dta 0,1,0,3 +player_sizes dta 0,0,0,1,0,0,0,3 +player_width dta 8,8,8,16,8,8,8,32 ; in pm pixels cursor_masks dta $80,$c0,$e0,$f0,$f8,$fc,$fe,$ff cursor_lastVBL dta 0 @@ -79,15 +80,22 @@ rts * returns absolute X position -_cursor_get_X - lda #$30 +_cursor_get_X .LOCAL + mwa #0 tmp ldx MOD_pixel_w -_cgx - clc - adc cursor_x +_cgx lda cursor_X + add:sta tmp + lda cursor_X+1 + adc:sta tmp+1 dex bne _cgx + lsr tmp+1 + lda tmp + ror @ + add #$30 rts +tmp dta 0,0 + .ENDL * returns absolute height _cursor_get_H @@ -101,45 +109,45 @@ rts cs1 - dta %00010000 - dta %00010000 + dta %00001000 + dta %00001000 dta %00000000 - dta %11000110 + dta %01100011 dta %00000000 - dta %00010000 - dta %00010000 + dta %00001000 + dta %00001000 cs2 - dta %11000110 - dta %10000010 + dta %01100011 + dta %01000001 dta %00000000 dta %00000000 dta %00000000 - dta %10000010 - dta %11000110 + dta %01000001 + dta %01100011 cs3 - dta %10000001 + dta %01000001 dta %00000000 dta %00000000 dta %00000000 dta %00000000 dta %00000000 - dta %10000001 + dta %01000001 cs4 dta %00000000 dta %00000000 - dta %00010000 - dta %00101000 - dta %00010000 + dta %00001000 + dta %00010100 + dta %00001000 dta %00000000 dta %00000000 cs5 - dta %10000010 - dta %01000100 + dta %01000001 + dta %00100010 dta %00000000 dta %00000000 dta %00000000 - dta %01000100 - dta %10000010 + dta %00100010 + dta %01000001 cursor_shapes dta a(0),a(cs1),a(cs2),a(cs3),a(cs4),a(cs5) @@ -184,13 +192,13 @@ ora #"0" sta DL.status+26 ; print cursor position + mwa #DL.status+2 write_dec.dst lda cursor_X - ldx <DL.status+2 - ldy >DL.status+2 + ldy cursor_X+1 jsr write_dec + mwa #DL.status+8 write_dec.dst lda cursor_Y - ldx <DL.status+8 - ldy >DL.status+8 + ldy #0 jsr write_dec ; and width/height lda cursor_W @@ -251,10 +259,15 @@ inx cpx #7 bne _cus + + ldx MOD_pixel_w + lda player_width-1,x + lsr @ + sta zerHlp jsr _cursor_get_X - ldy cursor_lastVBL sec -:3 sbc MOD_pixel_w + sbc zerHlp + ldy cursor_lastVBL sta $d000,y _cu_done ; and width @@ -306,28 +319,34 @@ ******************************************************************************* * Cursor X/Y/W/H manipulation -cursor_inc_X +cursor_inc_X .LOCAL lda cursor_X - clc - adc cursor_W + add cursor_W + sta zerHlp + lda cursor_X+1 + adc #0 + + cmp MOD_max_X+1 + bne _do + lda zerHlp cmp MOD_max_X - beq *+5 - inc cursor_X - rts + beq _ex +_do inw cursor_X +_ex rts + .ENDL cursor_inc_Y lda cursor_Y clc adc cursor_H cmp MOD_max_Y - beq *+5 - inc cursor_Y + seq:inc cursor_Y rts cursor_dec_X lda cursor_X - beq *+5 - dec cursor_X + ora cursor_X+1 + seq:dew cursor_X rts cursor_dec_Y @@ -339,17 +358,28 @@ cursor_inc_W .LOCAL lda ZOOM.state bne ex - ldy :cursor_W - cpy :MOD_max_cursor_w + ldy cursor_W + cpy MOD_max_cursor_w beq ex - tya - clc - adc :cursor_X - cmp :MOD_max_X - bne *+5 - dec :cursor_X iny - sty :cursor_W + sty cursor_W + ; check if we crossed the screen size + tya + add cursor_X + sta zerHlp + lda cursor_X+1 + cmp MOD_max_X+1 + bne ex + lda zerHlp + cmp MOD_max_X + bcc ex + ; we did + lda MOD_max_X + sub cursor_W + sta cursor_X + lda MOD_max_X+1 + sbc #0 + sta cursor_X+1 ex mva #0 cursor_shape rts .ENDL @@ -405,7 +435,6 @@ zfr_H dta 0 zfr_W dta 0 - zfr_init .LOCAL lda MOD_zoom_h ldx MOD_pixel_h @@ -420,8 +449,8 @@ sec sbc #6 sta zfr_H - lda MOD_zoom_w ldx MOD_pixel_w + lda MOD_zoom_w dex beq _ok2 clc @@ -430,6 +459,7 @@ dex bne _ml2 _ok2 + lsr @ clc adc #1 sta zfr_W @@ -540,6 +570,7 @@ adc zoom.zoom_X dey bne _add + lsr @ clc adc #$30-4 ldy zfr_last1 @@ -557,7 +588,6 @@ zcur_lastY dta 0 zcur_lastSize dta 0 - zcur_clear .LOCAL lda :zcur_lastVBL ora >:PLR0_BASE @@ -621,12 +651,17 @@ bne dst ; calc X - lda :cursor_X - sec - sbc ZOOM.zoom_x - bcs *+4 + lda cursor_X + sub ZOOM.zoom_x + sta zerHlp + lda cursor_X+1 + sbc #0 + sta zerHlp+1 + bcs _no_zero_X lda #0 - sta :zerHlp + sta zerHlp + sta zerHlp+1 +_no_zero_X lda #0 ldx :MOD_zoom_pixel_w Index: utils.asx =================================================================== RCS file: /cvsroot/lepix/lepix/utils.asx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- utils.asx 12 May 2007 20:43:02 -0000 1.3 +++ utils.asx 3 Jan 2010 17:55:19 -0000 1.4 @@ -55,35 +55,40 @@ -* expects value in A and lo/hi dest in X/Y +* Prints a 3-digit decimal number +* expects value lo/hi in A/Y, and destination address set in write_dec.dst _wddata dta d'000' _wdsubs dta 100,10,1 -write_dec - stx _wdsave+1 - sty _wdsave+2 +write_dec .LOCAL ldx #0 -_wd0 - tay +digit_start + pha lda #$10 ; '0' sta _wddata,x - tya -_wd1 + pla +digit_loop + cpy #0 + bne digit_inc cmp _wdsubs,x - bcc _wd2 - sbc _wdsubs,x + bcc digit_next +digit_inc + sub _wdsubs,x + scs:dey inc _wddata,x - bne _wd1 ;! -_wd2 + bne digit_loop ;! +digit_next inx cpx #3 - bne _wd0 + bne digit_start - ldy #2 -_wd3 lda _wddata,y -_wdsave sta 0000,y - dey - bpl _wd3 + ldx #2 +print_loop lda _wddata,x +dst equ *+1 + sta 12345,x + dex + bpl print_loop rts + .ENDL * expects value in A and lo/hi dest in X/Y write_hex Index: mod_inp.asx =================================================================== RCS file: /cvsroot/lepix/lepix/mod_inp.asx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- mod_inp.asx 12 May 2007 20:43:02 -0000 1.3 +++ mod_inp.asx 3 Jan 2010 17:55:19 -0000 1.4 @@ -15,10 +15,10 @@ MOD_zoom_update_top jmp INP.zoom_update_top MOD_pmY dta 20 ; in scanlines, Y position of the first line -MOD_pixel_w dta 1 ; can be 1,2 or 4 +MOD_pixel_w dta 2 ; hi-res (GR8), can be 1,2,4,8 MOD_pixel_h dta 1 ; - anything -MOD_max_x dta 160 +MOD_max_x dta a(160) MOD_max_y dta 200 MOD_max_cursor_w dta 4 ; for performance @@ -267,7 +267,7 @@ * **************************************************************************** ipc_sub - ldx cursor_x + ldx cursor_X ldy div4,x lda (zer0),y and ands,x @@ -350,7 +350,7 @@ mva #0 mpp_cntX mpp_loopx mva #0 UNDO.old_c - lda cursor_x + lda cursor_X clc adc mpp_cntX tax --- NEW FILE: mod_gr8.asx --- ******************************************************************************* * External MOD_MOD equ * MOD_init jmp GR8.init MOD_vbl jmp GR8.vbl MOD_pick_color jmp GR8.pick_color MOD_put_pixel jmp GR8.put_pixel MOD_enable_zoom jmp GR8.enable_zoom MOD_disable_zoom jmp GR8.disable_zoom MOD_zoom_update jmp GR8.zoom_update ; updates a single zoomed line. Y=line number MOD_zoom_update_line jmp GR8.zoom_update_line ; updates upper part MOD_zoom_update_top jmp GR8.zoom_update_top MOD_pmY dta 20 ; in scanlines, Y position of the first line MOD_pixel_w dta 1 ; hi-res (GR8), can be 1,2,4,8 MOD_pixel_h dta 1 ; - anything MOD_max_x dta a(320) MOD_max_y dta 200 MOD_max_cursor_w dta 8 ; for performance MOD_max_cursor_h dta 8 MOD_zoom_w dta 80 ; in mode pixels MOD_zoom_h dta GR8.zoomlines ; in mode pixels, MAX: 47 MOD_zoom_pmY dta 220-[4*GR8.zoomlines] ; in scanlines, Y position of a first line MOD_zoom_pixel_w dta 2 ; in GR15 pixels MOD_zoom_pixel_h dta 4 ; in scanlines MOD_zoom_top_h dta 200-4-[4*GR8.zoomlines] ; lines from main panel visible MOD_screen equ * dta d'C0:.. C1:.. ::GR8' dta d'keys:QW ASDF 0123 JLIK PCZ UY ' MOD_curcolor_X dta 0 ; in 15 pixels, from 0 MOD_curcolor_W dta 80 ; in 15 pixels ; returns the mode color as a byte (used in UNDO) MOD_get_color jmp GR8.get_color ; sets the mode colors as a byte (used in UNDO) MOD_set_color jmp GR8.set_color MOD_MOD_LEN equ *-MOD_MOD ******************************************************************************* * Internal GR8 .LOCAL zoomlines equ 23 pline equ $8000 scrF equ $8060 gr8_dl equ $ac00 loline equ $b000 hiline equ $b100 div8 equ $b200 ands equ $b300 lsrs equ $b400 dlzoom_fill equ $b800 ; zoomlines*15 ******************************************************************************* palette dta $00,$0f cur_color dta 0 mic_hscrol dta 12 set_color sta cur_color rts get_color lda cur_color rts vbl mwa #gr8_dl $d402 mwa #dli_palette $200 rts init jsr create_DL jsr create_tabs jsr update_status ldxy GR8_KEYTABLE jsr KB.extend_keytable ldxy GR8_MENUTABLE jsr MENU.extend_menutable jsr prp_dlzoom_fill rts dli_palette pha sta $d40a mva palette+0 $d018 mva palette+1 $d017 mva palette+1 $d016 mva mic_hscrol :HSCROL mwa DLI.down_vec $200 ; switch DLI pla rti create_DL mwa #scrF zerHlp mwa #core_dl _mcd+1 ldy #200 _mcd0 lda #$4f jsr _mcd lda zerHlp jsr _mcd lda zerHlp+1 jsr _mcd lda zerHlp clc adc #40 sta zerHlp bcc *+4 inc zerHlp+1 dey bne _mcd0 ; return to DL_return lda #$01 jsr _mcd lda <DL_return jsr _mcd lda >DL_return ; jsr _mcd _mcd sta core_dl inw _mcd+1 rts prp_dlzoom_fill .LOCAL mwa #dlzoom_fill wr+1 mwa #DL_zoom+2 zer0 ; first, fill lo byte ldx #[zoomlines] lp lda #{sta DL_zoom+2} jsr wr lda zer0 jsr wr lda zer0+1 jsr wr addtozer zer0 3 dex bne lp ; then, fill hi byte mwa #DL_zoom+3 zer0 mwa #0 zerHlp ldx #[zoomlines] hloop ;) lda #{lda zoom_lineadr,X} jsr wr lda zerHlp jsr wr lda >zoom_lineadr jsr wr lda #{sta DL_zoom} jsr wr lda zer0 jsr wr lda zer0+1 jsr wr addtozer zer0 3 inc zerHlp dex bne hloop ; and exit lda #{rts} wr sta dlzoom_fill inw wr+1 rts .ENDL * **************************************************************************** * Palette management colorpos dta 0,80 chg_color clc adc cur_color and #1 sta cur_color upd_color ldy cur_color lda colorpos,y sta MOD_curcolor_x rts chg_col_val ldx cur_color clc adc palette,x sta palette,x jmp update_status set_kolor sta cur_color jmp upd_color * **************************************************************************** pick_color ldy cursor_y lda loline,y sta zerHlp lda hiline,y sta zerHlp+1 lda cursor_X+1 :5 asl @ ldx cursor_X ora div8,x tay lda (zerHlp),y and ands,x ldy lsrs,x beq mpc_cont mpc lsr @ dey bne mpc mpc_cont sta cur_color jmp upd_color ; rts * **************************************************************************** mpp_cntY dta 0 mpp_cntX dta 0 put_pixel .LOCAL zer_scr equ zerHlp zer_effX equ zerHlp+2 zer_tmp equ zerHlp+4 jsr UNDO.put_pixel_prelude mva cursor_h mpp_cntY ldy cursor_y sty UNDO.pos_y lda loline,y sta zer_scr lda hiline,y sta zer_scr+1 mpp_loopY mva #0 mpp_cntX mpp_loopx lda cursor_X clc adc mpp_cntX sta zer_effX tax stx UNDO.pos_x lda cursor_X+1 adc #0 sta zer_effX+1 ; sta UNDO.pos_x+1 :5 asl @ ora div8,x pha tay ; save old color lda (zer_scr),y ldy lsrs,x beq pick_end pick lsr @ dey bne pick pick_end and #1 sta UNDO.old_c ; put pixel lda cur_color ldy lsrs,x beq mpp_cont mpp asl @ dey bne mpp mpp_cont sta zer_tmp pla tay lda ands,x eor #$ff and (zer_scr),y ora zer_tmp sta (zer_scr),y lda cur_color sta UNDO.new_c jsr UNDO.put_pixel_save inc mpp_cntX lda mpp_cntX cmp cursor_W bne mpp_loopX lda zer_scr clc adc #40 sta zer_scr bcc *+4 inc zer_scr+1 inc UNDO.pos_Y dec mpp_cntY bne mpp_loopY jsr UNDO.put_pixel_epilogue rts .ENDL ; put_pixel * **************************************************************************** mct_ands dta $80,$40,$20,$10,$08,$04,$02,$01 mct_lsrs dta 7,6,5,4,3,2,1,0 create_tabs mwa #scrF zer0 ldy #0 _mct0 tya lsr @ lsr @ lsr @ sta div8,y tya and #7 tax lda mct_ands,x sta ands,y lda mct_lsrs,x sta lsrs,y lda zer0 sta loline,y clc adc #40 sta zer0 lda zer0+1 sta hiline,y adc #0 sta zer0+1 iny bne _mct0 rts * **************************************************************************** update_status lda palette ldxy MOD_SCREEN+3 jsr write_hex lda palette+1 ldxy MOD_SCREEN+9 jsr write_hex lda palette+2 ldxy MOD_SCREEN+15 jsr write_hex lda palette+3 ldxy MOD_SCREEN+21 jmp write_hex * **************************************************************************** * zoom handling * **************************************************************************** zoom_lastY dta 0 zoom_update .LOCAL ; mwa #DL_zoom+2 zer0 lda ZOOM.zoom_X clc adc #7 pha and #7 eor #7 asl @ sta HSCROL sta mic_hscrol pla :3 lsr @ ldx ZOOM.zoom_Y jmp dlzoom_fill ;) .ENDL enable_zoom rts disable_zoom jsr fix_lastY ; fix last line mwa #[core_dl+600] zer0 ldy #0 lda #$01 sta (zer0),y+ lda <DL_return sta (zer0),y+ lda >DL_return sta (zer0),y ; restore main DL mwa #core_dl DL_jsr rts ; Y - lineno zoom_update_line .LOCAL lda zoom_lineadr,y sta dst+2 lda loline,y sta src+1 lda hiline,y sta src+2 ldx #39 loop src lda scrF,x dst sta $c000+1,x dex bpl loop rts .ENDL zoom_update_top ;fix previous last line jsr fix_lasty ;set new first line ldy ZOOM.zoom_top_y jsr calc_dl_pos lda zer0 sta DL_jsr lda zer0+1 sta DL_jsr+1 ;set new last line lda ZOOM.zoom_top_y clc adc MOD_zoom_top_h sta zoom_lastY tay jsr calc_dl_pos ldy #0 lda #$01 sta (zer0),y+ lda <DL_zoom sta (zer0),y+ lda >DL_zoom sta (zer0),y rts ; Y - lineno, sets zer0 calc_dl_pos mwa #core_dl zer0 sty cdp_add+1 ldx #3 cdp lda zer0 clc cdp_add adc #0 sta zer0 bcc *+4 inc zer0+1 dex bne cdp rts fix_lasty ldy zoom_lastY jsr calc_dl_pos ldy #0 lda #$4f sta (zer0),y+ ldx zoom_lastY lda loline,x sta (zer0),y+ lda hiline,x sta (zer0),y+ rts * **************************************************************************** GR8_KEYTABLE dta KEYCODE_Q,7,a(chg_color),$ff dta KEYCODE_W,7,a(chg_color),$01 dta KEYCODE_A,15,a(chg_col_val),$fe dta KEYCODE_S,15,a(chg_col_val),$02 dta KEYCODE_D,15,a(chg_col_val),$f0 dta KEYCODE_F,15,a(chg_col_val),$10 dta KEYCODE_1,7,a(set_kolor),1 dta KEYCODE_2,7,a(set_kolor),0 dta KEYCODE_0,7,a(set_kolor),0 dta $ff * **************************************************************************** * I/O routines GR8_ext dta c'GR8' load_gr8 ldxy GR8_ext jsr IO.open_read bpl transfer_mic rts save_gr8 ldxy GR8_ext jsr IO.open_write bpl transfer_mic rts transfer_mic .LOCAL mwa #scrF IO.adr mwa #8000 IO.len jsr IO.do bmi ex mwa #palette IO.adr mwa #2 io.len jsr IO.do bmi ex jsr IO.close ex rts .ENDL ; transfer_mic clear .LOCAL jsr IO.confirm beq ex mwa #scrF zer1 mwa #8000 zer2 lda #0 jsr memset ex rts .ENDL * **************************************************************************** GR8_MENUTABLE dta '1',a(load_gr8),a(load_gr8_msg) dta '2',a(save_gr8),a(save_gr8_msg) dta 'C',a(clear),a(clear_msg) dta $ff load_gr8_msg dta c'1 - Load *.GR8',eol save_gr8_msg dta c'2 - Save *.GR8',eol clear_msg dta c'C - Clear picture',eol * **************************************************************************** GR8_return equ * ift INCLUDE_PICTURE org scrF ; ins 'mic/fight.mic' ; ins 'mic/tqatrees.mic' ; ins 'mic/rpl-a.mic' ins 'gr8/vw.gr8' eif org pline :20 dta 0 :20 dta $ff org GR8_DL dta $80 :8 dta $4f,a(pline) dta 0,0 DL_jsr equ *+1 dta $01,a(core_dl) DL_return dta $81,a(DL.down) DL_zoom dta $20 :zoomlines dta $59,0,0 dta $01,a(DL_return) core_dl equ * org GR8_return GR8.MOD_LEN equ *-GR8 .ENDL ; GR8 Index: mod_cin.asx =================================================================== RCS file: /cvsroot/lepix/lepix/mod_cin.asx,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- mod_cin.asx 12 May 2007 20:43:02 -0000 1.7 +++ mod_cin.asx 3 Jan 2010 17:55:19 -0000 1.8 @@ -15,10 +15,10 @@ MOD_zoom_update_top jmp CIN.zoom_update_top MOD_pmY dta 19 ; in scanlines, Y position of the first line -MOD_pixel_w dta 1 ; can be 1,2 or 4 +MOD_pixel_w dta 2 ; hi-res (GR8), can be 1,2,4,8 MOD_pixel_h dta 1 ; - anything -MOD_max_x dta 160 +MOD_max_x dta a(160) MOD_max_y dta 200 MOD_max_cursor_w dta 4 ; for performance @@ -397,7 +397,7 @@ eor #[>scrE^>scrF] sta zer2+1 - ldx cursor_x + ldx cursor_X lda cur_mode and #MODE_BRI @@ -480,7 +480,7 @@ mva #0 mpp_cntX mpp_loopx - lda cursor_x + lda cursor_X clc adc mpp_cntX ldx pp_do_bri @@ -912,13 +912,13 @@ * **************************************************************************** ; Same code in mod_cin and mod_tip chg_mode - ; multiply cursor_X by 2 if only tone + ; multiply cursor_oldX by 2 if only tone lda cur_mode cmp #MODE_TONE bne um1 - lda cursor_x + lda cursor_X asl @ - sta cursor_x + sta cursor_X um1 ldx cur_mode dex @@ -933,7 +933,7 @@ beq um_tone um_bri mva #160 MOD_max_x - mva #1 MOD_pixel_w + mva #2 MOD_pixel_w mva #2 MOD_zoom_pixel_w mva #80 MOD_zoom_w rts @@ -942,7 +942,7 @@ lsr @ sta cursor_X mva #80 MOD_max_x - mva #2 MOD_pixel_w + mva #4 MOD_pixel_w mva #4 MOD_zoom_pixel_w mva #40 MOD_zoom_w rts |
|
From: Marcin Z. <e-...@us...> - 2010-01-01 23:05:08
|
Update of /cvsroot/lepix/lepix In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16791 Modified Files: lepix.asx Log Message: - make it compile again Index: lepix.asx =================================================================== RCS file: /cvsroot/lepix/lepix/lepix.asx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- lepix.asx 12 May 2007 20:43:02 -0000 1.5 +++ lepix.asx 1 Jan 2010 23:04:43 -0000 1.6 @@ -177,13 +177,13 @@ INCLUDE_PICTURE equ 0 - ift !GFX_MODE + .ifndef GFX_MODE ;GFX_MODE equ 1 ; MIC ;GFX_MODE equ 2 ; INP ;GFX_MODE equ 3 ; CIN ;GFX_MODE equ 4 ; HIP GFX_MODE equ 5 ; TIP - eif + .endif ift GFX_MODE=1 icl 'mod_mic.asx' |
|
From: Marcin Z. <e-...@us...> - 2007-11-13 22:05:10
|
Update of /cvsroot/lepix/lepix/lepicon In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10271 Modified Files: common.c Log Message: - fixed Floyd-Steinberg diffusion Index: common.c =================================================================== RCS file: /cvsroot/lepix/lepix/lepicon/common.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- common.c 12 May 2007 20:43:03 -0000 1.3 +++ common.c 13 Nov 2007 22:05:07 -0000 1.4 @@ -125,32 +125,26 @@ break ; case 3: /* floyd-steinberg */ - value += diffusion[y*HSIZE+x] / 16; - value=MIN(value,255); + value += diffusion[y * HSIZE + x] / 16; + value = MIN(value, 255); + value = MAX(value, 0); for(ret=1; value>color_borders[ret]; ret++); - reminder = value-color_borders[ret-1]; -// reminder = value-(color_borders[ret-1]+color_borders[ret])/2; -// if (ret==1 && reminder > 0) { -// reminder = 0; -// } -// if (reminder<0) { -// ERROR("value=%d ret=%d cb[ret-1]=%d reminder=%d < 0", -// value, ret, color_borders[ret-1], reminder); -// } + reminder = value - + (color_borders[ret - 1] + color_borders[ret]) / 2; if (x<HSIZE-1) { - diffusion[(y+0)*HSIZE+x+1] += reminder * 7 ; + diffusion[(y+0)*HSIZE+x+1] += reminder * 7; } if (y<VSIZE-1) { if (x>0) { - diffusion[(y+1)*HSIZE+x-1] += reminder * 3 ; + diffusion[(y+1)*HSIZE+x-1] += reminder * 3; } - diffusion[(y+1)*HSIZE+x-0] += reminder * 5 ; + diffusion[(y+1)*HSIZE+x-0] += reminder * 5; if (x<HSIZE-1) { - diffusion[(y+1)*HSIZE+x+1] += reminder * 1 ; + diffusion[(y+1)*HSIZE+x+1] += reminder * 1; } } ret--; - break ; + break; default: ERROR("find_color: unknown dithering\n"); } |
|
From: Marcin Z. <e-...@us...> - 2007-11-13 22:03:01
|
Update of /cvsroot/lepix/lepix/lepicon In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9448 Modified Files: Makefile Log Message: - adding an explicit rule for bin2c, as it somehow wasn't generated Index: Makefile =================================================================== RCS file: /cvsroot/lepix/lepix/lepicon/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile 12 May 2007 20:43:03 -0000 1.4 +++ Makefile 13 Nov 2007 22:02:58 -0000 1.5 @@ -1,5 +1,4 @@ MADS=mads - CFLAGS=-Wall -g all: lepicon @@ -10,7 +9,10 @@ %.obx: %.asx $(MADS) $< -s - + +bin2c: bin2c.c + $(CC) $(CFLAGS) $^ -o $@ + %.xlc: %.obx bin2c ./bin2c $< $@ @@ -22,7 +24,7 @@ lepicon: lepicon.o common.o $(MODS_O) clean: - rm -f \ + rm -f *~ \ lepicon lepicon.exe \ bin2c bin2c.exe \ *.xlc *.obx *.o *.LST *.TAB |
|
From: Marcin Z. <e-...@us...> - 2007-11-13 22:02:38
|
Update of /cvsroot/lepix/lepix/lepicon In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9436 Modified Files: mod_hr2.c Log Message: - fixing incorrect message Index: mod_hr2.c =================================================================== RCS file: /cvsroot/lepix/lepix/lepicon/mod_hr2.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mod_hr2.c 25 May 2005 22:34:49 -0000 1.2 +++ mod_hr2.c 13 Nov 2007 22:02:35 -0000 1.3 @@ -130,7 +130,7 @@ CM_initialize(5); - INFO("hr1: Converting %s\n", fname); + INFO("hr2: Converting %s\n", fname); for(y=0;y<nlines;y++) { for(x=0;x<HSIZE;x+=2) { |
|
From: Marcin Z. <e-...@us...> - 2007-05-13 17:38:15
|
Update of /cvsroot/lepix/lepix/www In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17881/www Modified Files: index.html Log Message: - oops, it's BeWu, not X-Ray :) Index: index.html =================================================================== RCS file: /cvsroot/lepix/lepix/www/index.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- index.html 13 May 2007 17:36:33 -0000 1.6 +++ index.html 13 May 2007 17:38:12 -0000 1.7 @@ -218,7 +218,7 @@ </td></tr> <tr align=center><td> <img src="gfx/tip-resting.png"/> - <p>"Resting by X-Ray/Grayscale" + <p>"Resting by BeWu/Grayscale" </td><td> <img src="gfx/tip-resting-z.png"/> <p>"Resting" in zoom mode |
|
From: Marcin Z. <e-...@us...> - 2007-05-13 17:38:14
|
Update of /cvsroot/lepix/lepix/tip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17881/tip Modified Files: README Log Message: - oops, it's BeWu, not X-Ray :) Index: README =================================================================== RCS file: /cvsroot/lepix/lepix/tip/README,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- README 13 May 2007 17:36:33 -0000 1.2 +++ README 13 May 2007 17:38:11 -0000 1.3 @@ -1,3 +1,3 @@ -resting.tip - RESTING by X-Ray/Grayscale +resting.tip - RESTING by BeWu/Grayscale |
|
From: Marcin Z. <e-...@us...> - 2007-05-13 17:36:37
|
Update of /cvsroot/lepix/lepix/www In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17039/www Modified Files: index.html Log Message: - added author info Index: index.html =================================================================== RCS file: /cvsroot/lepix/lepix/www/index.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- index.html 13 May 2007 11:41:21 -0000 1.5 +++ index.html 13 May 2007 17:36:33 -0000 1.6 @@ -218,7 +218,7 @@ </td></tr> <tr align=center><td> <img src="gfx/tip-resting.png"/> - <p>"Resting" + <p>"Resting by X-Ray/Grayscale" </td><td> <img src="gfx/tip-resting-z.png"/> <p>"Resting" in zoom mode |
|
From: Marcin Z. <e-...@us...> - 2007-05-13 17:36:37
|
Update of /cvsroot/lepix/lepix/tip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17039/tip Modified Files: README Log Message: - added author info Index: README =================================================================== RCS file: /cvsroot/lepix/lepix/tip/README,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- README 12 May 2007 21:50:10 -0000 1.1 +++ README 13 May 2007 17:36:33 -0000 1.2 @@ -1,2 +1,3 @@ -resting.tip - RESTING by ??? +resting.tip - RESTING by X-Ray/Grayscale + |
|
From: Marcin Z. <e-...@us...> - 2007-05-13 11:41:26
|
Update of /cvsroot/lepix/lepix/www In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv31036 Modified Files: index.html Log Message: - added links to gfx modes Index: index.html =================================================================== RCS file: /cvsroot/lepix/lepix/www/index.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- index.html 13 May 2007 10:15:26 -0000 1.4 +++ index.html 13 May 2007 11:41:21 -0000 1.5 @@ -45,7 +45,7 @@ Changelog: <pre> Major changes: -- added TIP module +- added <a href="#tip">TIP</a> module - added undo (U) and redo (R) options Minor changes: - fixed color picking in HIP @@ -109,11 +109,11 @@ <p> <b>Q: What graphic modes does Lepix currently support?</b><br/> <b>A:</b> -<b>MIC</b> (Graphics 15, 160x200. 4 colors), -<b>INP</b> (160x200, 7 colors), -<b>CIN</b> (160x200, 16 tones * 4 brightnesses), -<b>HIP</b> (160x200, 16 brightnesses), -<b>TIP</b> (160x100, 16 tones * 16 brightnesses), +<a href="#mic"><b>MIC</b></a> (Graphics 15, 160x200. 4 colors), +<a href="#inp"><b>INP</b></a> (160x200, 7 colors), +<a href="#cin"><b>CIN</b></a> (160x200, 16 tones * 4 brightnesses), +<a href="#hip"><b>HIP</b></a> (160x200, 16 brightnesses), +<a href="#tip"><b>TIP</b></a> (160x100, 16 tones * 16 brightnesses), <p> <b>Q: What graphic modes are considered for the future?</b><br/> <b>A:</b> @@ -168,7 +168,10 @@ <a name="sshots"></a><h3>Screenshots</h3> <table width="100%" cellpadding="3" > -<tr align="center"><td colspan="2"><h4>MIC pictures</h4></td></tr> +<tr align="center"><td colspan="2"> + <a name="mic"/> + <h4>MIC pictures</h4> +</td></tr> <tr align=center><td> <img src="gfx/mic-fight.png"/> <p>"Fight" by Dracon/Taquart @@ -176,7 +179,10 @@ <img src="gfx/mic-fight-z.png"/> <p>"Fight" in zoom mode </td></tr> -<tr align="center"><td colspan="2"><h4>INP pictures</h4></td></tr> +<tr align="center"><td colspan="2"> + <a name="inp"/> + <h4>INP pictures</h4> +</td></tr> <tr align=center><td> <img src="gfx/inp-replay.png"/> <p>"Lodos" by Replay/BitBusters @@ -184,7 +190,10 @@ <img src="gfx/inp-replay-z.png"/> <p>"Lodos" in zoom mode </td></tr> -<tr align="center"><td colspan="2"><h4>CIN pictures</h4></td></tr> +<tr align="center"><td colspan="2"> + <a name="cin"/> + <h4>CIN pictures</h4> +</td></tr> <tr align=center><td> <img src="gfx/cin-dedykacja.png"/> <p>"Dedykacja" by Anj/Tristesse @@ -192,7 +201,10 @@ <img src="gfx/cin-dedykacja-z.png"/> <p>"Dedykacja" in zoom mode </td></tr> -<tr align="center"><td colspan="2"><h4>HIP pictures</h4></td></tr> +<tr align="center"><td colspan="2"> + <a name="hip"/> + <h4>HIP pictures</h4> +</td></tr> <tr align=center><td> <img src="gfx/hip-imagine.png"/> <p>"Imagine" by BeWu/Grayscale @@ -200,7 +212,10 @@ <img src="gfx/hip-imagine-z.png"/> <p>"Imagine" in zoom mode </td></tr> -<tr align="center"><td colspan="2"><h4>TIP pictures</h4></td></tr> +<tr align="center"><td colspan="2"> + <a name="tip"/> + <h4>TIP pictures</h4> +</td></tr> <tr align=center><td> <img src="gfx/tip-resting.png"/> <p>"Resting" |
|
From: Marcin Z. <e-...@us...> - 2007-05-13 10:15:32
|
Update of /cvsroot/lepix/lepix/www In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29896 Modified Files: index.html Log Message: - unix-style EOLs consistently Index: index.html =================================================================== RCS file: /cvsroot/lepix/lepix/www/index.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- index.html 13 May 2007 00:07:55 -0000 1.3 +++ index.html 13 May 2007 10:15:26 -0000 1.4 @@ -1,230 +1,230 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<HTML> -<HEAD> - <TITLE>Lepix</TITLE> - <META http-equiv="Content-Type" content="text/html; charset=iso-8859-2"> - <LINK REL="stylesheet" HREF="index.css" TYPE="text/css"> -</HEAD> -<BODY> -<a name="top"></a> -<center> -<h1>LEPIX</h1> - -<a href="#about">About</a> . -<a href="#news">News</a> . -<a href="#faq">FAQ</a> . -<a href="#sf">Sourceforge</a> . -<a href="#sshots">Screenshots</a> . -<a href="#contact">Contact</a> -<p> -(c) 2004-2007 Marcin 'Eru' ¯ukowski -</center> - -<!-- ===================================================================== --> -<hr> -<a name="about"></a><h3>About Lepix</h3> - -<b>Lepix</b> is a painting program for Atari XL/XE.<br/> - -Its main task is to provide a common infrastructure and user interface for -various graphic modes.<br/> - -Lepix project additionally includes <b>Lepicon</b>, a program for PC that - allows convertion of .bmp files into Atari formats.<br/> - -<p class="varia" align="right"><a href="#top">back to the top</a></p> -<!-- ===================================================================== --> -<hr> -<a name="news"></a><h3>News</h3> - -<p> -<b>2007.05.12 - Lepix 0.2.0 released!</b><br/> -After a looong silence, a new version is -<a href="http://sourceforge.net/project/showfiles.php?group_id=126366&package_id=138262&release_id=507950">available here</a>! -<br/> -Changelog: -<pre> -Major changes: -- added TIP module -- added undo (U) and redo (R) options -Minor changes: -- fixed color picking in HIP -- fixed 'ghost cursor' and zoomed-cursor problems -- fixed the first line display in HIP and CIN -- experimental mouse support (both Amiga and AtariST), - doesn't really work -- added new cursor shapes -- README Atari-readable in .atr -</pre> - -<p> -<b>2005.05.23 - Lepicon is born!</b><br/> -I developed a small tool to experiment with new graphic modes. -It allows automatic generation of .xex files from .bmp files. -You can download it from the <a href="https://sourceforge.net/project/showfiles.php?group_id=126366">lepix sourceforge page</a> - -<p> -<b>2005.01.03 - MADS has its own website</b><br/> -MADS assembler is now available at -<a href="http://g2f.atari8.info/mads">http://g2f.atari8.info/mads</a> (polish only). -<br/>Note, that due to lack of time Lepix wasn't tested with the most recent version. - -<p> -<b>2004.12.18 - Lepix 0.1.0 released!</b><br/> -First Sourceforge release of Lepix is here! -You can download it from the project's -<a href="http://sourceforge.net/project/showfiles.php?group_id=126366"> -files section</a> -<p> -Changelog: -<pre> -- added HIP module -- project hosted on sourceforge.net -- multiple changes to increase speed and stability -- name changed from LEPIX to LePix :) -- zoom mode: displays markers around the zoomed area -- wider 'chosen-color' marker -- added various cursor shapes, changed with 'C' -- displays version number in menu -- uses memory under ROM -> larger ZOOM :) -- reset doesn't destroy image content -- some minor changes and fixes -</pre> - -<p> -<b>2004.12.12 - Lepix becomes open-source</b><br/> -Today Lepix has been released under GPL license and became Sourceforge project. -More details in the <a href="#sf">Sourceforge section</a> - -<p class="varia" align="right"><a href="#top">back to the top</a></p> -<!-- ===================================================================== --> -<hr> -<a name="faq"></a><h3>FAQ</h3> - -<p> -<b>Q: What do I need to compile Lepix?</b><br/> -<b>A:</b> Lepix is written using MADS assembler by Tomasz 'TeBe' Biela. -MADS is available <a href="http://mads.atari8.info/">here</a>. - -<p> -<b>Q: What graphic modes does Lepix currently support?</b><br/> -<b>A:</b> -<b>MIC</b> (Graphics 15, 160x200. 4 colors), -<b>INP</b> (160x200, 7 colors), -<b>CIN</b> (160x200, 16 tones * 4 brightnesses), -<b>HIP</b> (160x200, 16 brightnesses), -<b>TIP</b> (160x100, 16 tones * 16 brightnesses), -<p> -<b>Q: What graphic modes are considered for the future?</b><br/> -<b>A:</b> -<b>RIP</b> (160x200, colors hard to describe), -<b>GR8</b> (320x200, 2 colors), -<b>IN8</b> (320x200, 3 colors), -<b>HR2</b> (320x200, 5 colors), -and possibly some new modes :). - The hi-res (320x200) modes would require some serious changes to the Lepix infrastructure - (e.g. cursor couldn't be just sprite-based anymore). - That means, I will do it only if there is enough users demand. - -<p> -<b>Q: Will there be mouse support?</b><br/> -<b>A:</b> The experimental support is here. -However, it is far from perfect. -Problem is, the Amiga and Atari ST mouses have very (very!) small -resolution, resulting in a need for frequent checks. -It is hard to do with some graphic modes, as they leave very little CPU time. -If you know a nice way to read mouse e.g. once every frame, please let me know. - -<p> -<b>Q: Can I modify Lepix sources</b><br/> -<b>A:</b> Lepix is released under GPL. -That means you can modify the sources but the project has to stay GPL. -More details in LICENSE file in the CVS repository and releases. - -<p> -<b>Q: How can I help Lepix project</b><br/> -<b>A:</b> You may submit patches for the sources, send me more example pictures, -and simply use it. If you want to become official Lepix developer, contact me. - -<p class="varia" align="right"><a href="#top">back to the top</a></p> -<!-- ===================================================================== --> -<hr> -<A style="float:right;" href="http://sourceforge.net"> <IMG src="http://sourceforge.net/sflogo.php?group_id=126366&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A> -<a name="sf"></a><h3>Sourceforge</h3> - -<p> -Lepix is hosted at the Sourceforge -(<a href="http://www.sourceforge.net">www.sourceforge.net</a>).<br/> -<p> -The link to main project's website is -<a href="http://sourceforge.net/projects/lepix/">http://sourceforge.net/projects/lepix</a> -<p> -On that website you can download both sources and binary releases, access CVS, -submit bugs, patches and feature requests and so on. - -<p class="varia" align="right"><a href="#top">back to the top</a></p> -<!-- ===================================================================== --> -<hr> -<a name="sshots"></a><h3>Screenshots</h3> - -<table width="100%" cellpadding="3" > -<tr align="center"><td colspan="2"><h4>MIC pictures</h4></td></tr> -<tr align=center><td> - <img src="gfx/mic-fight.png"/> - <p>"Fight" by Dracon/Taquart - </td><td> - <img src="gfx/mic-fight-z.png"/> - <p>"Fight" in zoom mode -</td></tr> -<tr align="center"><td colspan="2"><h4>INP pictures</h4></td></tr> -<tr align=center><td> - <img src="gfx/inp-replay.png"/> - <p>"Lodos" by Replay/BitBusters - </td><td> - <img src="gfx/inp-replay-z.png"/> - <p>"Lodos" in zoom mode -</td></tr> -<tr align="center"><td colspan="2"><h4>CIN pictures</h4></td></tr> -<tr align=center><td> - <img src="gfx/cin-dedykacja.png"/> - <p>"Dedykacja" by Anj/Tristesse - </td><td> - <img src="gfx/cin-dedykacja-z.png"/> - <p>"Dedykacja" in zoom mode -</td></tr> -<tr align="center"><td colspan="2"><h4>HIP pictures</h4></td></tr> -<tr align=center><td> - <img src="gfx/hip-imagine.png"/> - <p>"Imagine" by BeWu/Grayscale - </td><td> - <img src="gfx/hip-imagine-z.png"/> - <p>"Imagine" in zoom mode -</td></tr> -<tr align="center"><td colspan="2"><h4>TIP pictures</h4></td></tr> -<tr align=center><td> - <img src="gfx/tip-resting.png"/> - <p>"Resting" - </td><td> - <img src="gfx/tip-resting-z.png"/> - <p>"Resting" in zoom mode -</td></tr> - -</table> - -<p class="varia" align="right"><a href="#top">back to the top</a></p> -<!-- ===================================================================== --> -<hr> -<a name="contact"></a><h3>Contact</h3> - -To contact me, write to eru at scene dot pl - -<p class="varia" align="right"><a href="#top">back to the top</a></p> - -<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> -</script> -<script type="text/javascript"> -_uacct = "UA-1276188-2"; -urchinTracker(); -</script> - -</BODY> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<HEAD> + <TITLE>Lepix</TITLE> + <META http-equiv="Content-Type" content="text/html; charset=iso-8859-2"> + <LINK REL="stylesheet" HREF="index.css" TYPE="text/css"> +</HEAD> +<BODY> +<a name="top"></a> +<center> +<h1>LEPIX</h1> + +<a href="#about">About</a> . +<a href="#news">News</a> . +<a href="#faq">FAQ</a> . +<a href="#sf">Sourceforge</a> . +<a href="#sshots">Screenshots</a> . +<a href="#contact">Contact</a> +<p> +(c) 2004-2007 Marcin 'Eru' ¯ukowski +</center> + +<!-- ===================================================================== --> +<hr> +<a name="about"></a><h3>About Lepix</h3> + +<b>Lepix</b> is a painting program for Atari XL/XE.<br/> + +Its main task is to provide a common infrastructure and user interface for +various graphic modes.<br/> + +Lepix project additionally includes <b>Lepicon</b>, a program for PC that + allows convertion of .bmp files into Atari formats.<br/> + +<p class="varia" align="right"><a href="#top">back to the top</a></p> +<!-- ===================================================================== --> +<hr> +<a name="news"></a><h3>News</h3> + +<p> +<b>2007.05.12 - Lepix 0.2.0 released!</b><br/> +After a looong silence, a new version is +<a href="http://sourceforge.net/project/showfiles.php?group_id=126366&package_id=138262&release_id=507950">available here</a>! +<br/> +Changelog: +<pre> +Major changes: +- added TIP module +- added undo (U) and redo (R) options +Minor changes: +- fixed color picking in HIP +- fixed 'ghost cursor' and zoomed-cursor problems +- fixed the first line display in HIP and CIN +- experimental mouse support (both Amiga and AtariST), + doesn't really work +- added new cursor shapes +- README Atari-readable in .atr +</pre> + +<p> +<b>2005.05.23 - Lepicon is born!</b><br/> +I developed a small tool to experiment with new graphic modes. +It allows automatic generation of .xex files from .bmp files. +You can download it from the <a href="https://sourceforge.net/project/showfiles.php?group_id=126366">lepix sourceforge page</a> + +<p> +<b>2005.01.03 - MADS has its own website</b><br/> +MADS assembler is now available at +<a href="http://g2f.atari8.info/mads">http://g2f.atari8.info/mads</a> (polish only). +<br/>Note, that due to lack of time Lepix wasn't tested with the most recent version. + +<p> +<b>2004.12.18 - Lepix 0.1.0 released!</b><br/> +First Sourceforge release of Lepix is here! +You can download it from the project's +<a href="http://sourceforge.net/project/showfiles.php?group_id=126366"> +files section</a> +<p> +Changelog: +<pre> +- added HIP module +- project hosted on sourceforge.net +- multiple changes to increase speed and stability +- name changed from LEPIX to LePix :) +- zoom mode: displays markers around the zoomed area +- wider 'chosen-color' marker +- added various cursor shapes, changed with 'C' +- displays version number in menu +- uses memory under ROM -> larger ZOOM :) +- reset doesn't destroy image content +- some minor changes and fixes +</pre> + +<p> +<b>2004.12.12 - Lepix becomes open-source</b><br/> +Today Lepix has been released under GPL license and became Sourceforge project. +More details in the <a href="#sf">Sourceforge section</a> + +<p class="varia" align="right"><a href="#top">back to the top</a></p> +<!-- ===================================================================== --> +<hr> +<a name="faq"></a><h3>FAQ</h3> + +<p> +<b>Q: What do I need to compile Lepix?</b><br/> +<b>A:</b> Lepix is written using MADS assembler by Tomasz 'TeBe' Biela. +MADS is available <a href="http://mads.atari8.info/">here</a>. + +<p> +<b>Q: What graphic modes does Lepix currently support?</b><br/> +<b>A:</b> +<b>MIC</b> (Graphics 15, 160x200. 4 colors), +<b>INP</b> (160x200, 7 colors), +<b>CIN</b> (160x200, 16 tones * 4 brightnesses), +<b>HIP</b> (160x200, 16 brightnesses), +<b>TIP</b> (160x100, 16 tones * 16 brightnesses), +<p> +<b>Q: What graphic modes are considered for the future?</b><br/> +<b>A:</b> +<b>RIP</b> (160x200, colors hard to describe), +<b>GR8</b> (320x200, 2 colors), +<b>IN8</b> (320x200, 3 colors), +<b>HR2</b> (320x200, 5 colors), +and possibly some new modes :). + The hi-res (320x200) modes would require some serious changes to the Lepix infrastructure + (e.g. cursor couldn't be just sprite-based anymore). + That means, I will do it only if there is enough users demand. + +<p> +<b>Q: Will there be mouse support?</b><br/> +<b>A:</b> The experimental support is here. +However, it is far from perfect. +Problem is, the Amiga and Atari ST mouses have very (very!) small +resolution, resulting in a need for frequent checks. +It is hard to do with some graphic modes, as they leave very little CPU time. +If you know a nice way to read mouse e.g. once every frame, please let me know. + +<p> +<b>Q: Can I modify Lepix sources</b><br/> +<b>A:</b> Lepix is released under GPL. +That means you can modify the sources but the project has to stay GPL. +More details in LICENSE file in the CVS repository and releases. + +<p> +<b>Q: How can I help Lepix project</b><br/> +<b>A:</b> You may submit patches for the sources, send me more example pictures, +and simply use it. If you want to become official Lepix developer, contact me. + +<p class="varia" align="right"><a href="#top">back to the top</a></p> +<!-- ===================================================================== --> +<hr> +<A style="float:right;" href="http://sourceforge.net"> <IMG src="http://sourceforge.net/sflogo.php?group_id=126366&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A> +<a name="sf"></a><h3>Sourceforge</h3> + +<p> +Lepix is hosted at the Sourceforge +(<a href="http://www.sourceforge.net">www.sourceforge.net</a>).<br/> +<p> +The link to main project's website is +<a href="http://sourceforge.net/projects/lepix/">http://sourceforge.net/projects/lepix</a> +<p> +On that website you can download both sources and binary releases, access CVS, +submit bugs, patches and feature requests and so on. + +<p class="varia" align="right"><a href="#top">back to the top</a></p> +<!-- ===================================================================== --> +<hr> +<a name="sshots"></a><h3>Screenshots</h3> + +<table width="100%" cellpadding="3" > +<tr align="center"><td colspan="2"><h4>MIC pictures</h4></td></tr> +<tr align=center><td> + <img src="gfx/mic-fight.png"/> + <p>"Fight" by Dracon/Taquart + </td><td> + <img src="gfx/mic-fight-z.png"/> + <p>"Fight" in zoom mode +</td></tr> +<tr align="center"><td colspan="2"><h4>INP pictures</h4></td></tr> +<tr align=center><td> + <img src="gfx/inp-replay.png"/> + <p>"Lodos" by Replay/BitBusters + </td><td> + <img src="gfx/inp-replay-z.png"/> + <p>"Lodos" in zoom mode +</td></tr> +<tr align="center"><td colspan="2"><h4>CIN pictures</h4></td></tr> +<tr align=center><td> + <img src="gfx/cin-dedykacja.png"/> + <p>"Dedykacja" by Anj/Tristesse + </td><td> + <img src="gfx/cin-dedykacja-z.png"/> + <p>"Dedykacja" in zoom mode +</td></tr> +<tr align="center"><td colspan="2"><h4>HIP pictures</h4></td></tr> +<tr align=center><td> + <img src="gfx/hip-imagine.png"/> + <p>"Imagine" by BeWu/Grayscale + </td><td> + <img src="gfx/hip-imagine-z.png"/> + <p>"Imagine" in zoom mode +</td></tr> +<tr align="center"><td colspan="2"><h4>TIP pictures</h4></td></tr> +<tr align=center><td> + <img src="gfx/tip-resting.png"/> + <p>"Resting" + </td><td> + <img src="gfx/tip-resting-z.png"/> + <p>"Resting" in zoom mode +</td></tr> + +</table> + +<p class="varia" align="right"><a href="#top">back to the top</a></p> +<!-- ===================================================================== --> +<hr> +<a name="contact"></a><h3>Contact</h3> + +To contact me, write to eru at scene dot pl + +<p class="varia" align="right"><a href="#top">back to the top</a></p> + +<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> +</script> +<script type="text/javascript"> +_uacct = "UA-1276188-2"; +urchinTracker(); +</script> + +</BODY> |