{"id":22895487,"url":"https://github.com/jeromelesaux/martine","last_synced_at":"2025-05-07T20:05:46.081Z","repository":{"id":39545972,"uuid":"172541421","full_name":"jeromelesaux/martine","owner":"jeromelesaux","description":"martine converts image (jpg png) to Overscan, Screen or window for Amstrad CPC (and Plus series)","archived":false,"fork":false,"pushed_at":"2025-04-16T22:25:06.000Z","size":52225,"stargazers_count":28,"open_issues_count":2,"forks_count":5,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-07T20:03:37.328Z","etag":null,"topics":["amstrad","amstrad-cpc","cpc-screen","egx-screen","fyne","gfx","golang","graphics","overscan-screen","png","sprite"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeromelesaux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-02-25T16:23:42.000Z","updated_at":"2025-01-25T10:32:19.000Z","dependencies_parsed_at":"2023-02-18T06:45:54.763Z","dependency_job_id":"d5fa3dea-f219-4e37-bf6e-5b27ba474366","html_url":"https://github.com/jeromelesaux/martine","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeromelesaux%2Fmartine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeromelesaux%2Fmartine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeromelesaux%2Fmartine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeromelesaux%2Fmartine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeromelesaux","download_url":"https://codeload.github.com/jeromelesaux/martine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252949272,"owners_count":21830151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amstrad","amstrad-cpc","cpc-screen","egx-screen","fyne","gfx","golang","graphics","overscan-screen","png","sprite"],"created_at":"2024-12-13T23:29:48.667Z","updated_at":"2025-05-07T20:05:46.054Z","avatar_url":"https://github.com/jeromelesaux.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# martine\n\nAfter Claudia from Eliot a long time ago, here is coming Martine.\nA cli which converts JPEG or PNG image file into  SCR/PAL or Overscan  Amstrad CPC file screen.\nMulti os, you can convert any pictures to Amstrad CPC Screen.\nThe files generated (.win, .scr, .ink) are compatible with [OCP art studio](http://www.cpc-power.com/index.php?page=detail\u0026num=4963) and Impdraw V2 [i2](http://amstradplus.forumforever.com/t462-iMPdraw-v2-0.htm)\n\n# Contents :\n * [Introduction](#Introduction)\n * [Output files](#Output_files)\n * [Options](#Options)\n * [Installation](#Installation)\n * [Usage](#Usage)\n * [Technics](#Technics)\n\t* [Screen Conversion](#Screen_conversion)\n\t* [Roll sprite](#Roll)\n\t* [Tiles](#Tiles)\n\t* [Rotation Sprite](#Rotation)\n\t* [3D Rotation](#3D_rotation)\n\t* [Tilemap](#Tilemap)\n\t* [Flash](#flash)\n\t* [Egx](#Egx)\n\t* [Deltapacking](#Deltapacking)\n\n## Introduction \nMartine tries to accelerate your game, demo animation development by organize and conversion of your graphical data.\nAll screens data are associated with basic programs launchers to quick display the output on real machines.\nYou can follow the development here [Cpcwiki in english](https://www.cpcwiki.eu/forum/applications/martine-a-cpc-old-plus-tool-to-handle-your-images/) or here [Amstrad plus forum in french](https://amstradplus.forumforever.com/t513-martine-fait-du-dessin.htm) \u003cbr\u003e\nA Gui was developed for windows users by Tronic you can get it [here](https://index.amstrad.info/wp-content/uploads/martine/)\n\n\n\n## Output_files\nOutput:\nMartine generates a lot of differents files, which allow you to find the format and the data you will use.\n\n### files generated :  \n * .win or .scr sprite or screen files\n * .pal or .ink palette file (.ink will be generated if the -plus option is set)\n * .txt ascii file with palettes values (firmware values and basic values), and screen byte values\n *  c.txt ascii file with palettes values (firmware values and basic values), and screen byte values by column\n * .json json file with palettes values (firmware values and basic values), and screen byte values\n * .bas launch to test the screen load on classic .scr 17ko \n * _resized.png images files to ensure the resize action\n * _downgraded.png images files to ensure the downgraded palette action\n * _paletteink.png palette image describing the CPC old colors used\n * _palettepal.png palette image describing the CPC old colors used\n * _palettekit.png palette image describing the CPC plus colors used\n\n## Options \n### additionnals options available : \n* -dsk will generate a dsk file and add all amsdos files will be added.\n* -noheader will remove amsdos headers from the amsdos files\n* -fullscreen will generate overscan screen amsdos file\n* -plus will generate a CPC plus screen amsdos file\n* -height will generate sprite of x pixel high\n* -width will generate sprite of x pixel wide\n* -statement to define the byte token will be replace the byte token in the ascii files\n* -algo to set the algorithm to downsize the image\n* -mode  to define the screen mode 0,1,2\n* -out to set the output directory (is not exists, martine will create the folder).\n* -z compress the image .scr / .win (not overscan) using the algorithm.\n* -zigzag will generate data output as zigzag.\n* -scanlinesequence will generate the lines following the input sequence such as 0,7,1,2,3,4,5,6 for instance.\n* -sla will rotate x column pixels from the left, those columns will be discarded  \n* -sra will rotate x column pixels from the right, those columns will be discarded  \n* -rra will rotate x column pixels from the right\n* -rla will rotate x column pixels from the left\n* -keephigh will rotate x line pixels to the top\n* -keeplow will rotate x line pixels to the bottom\n* -losthigh will rotate x line pixels to the top, those lines will be discarded \n* -lostlow will rotate x line pixels to the bottom, those lines will be discarded\n* -sna copy output files in a new CPC image Sna.\n* -reducer reducing color filter (3 gradients are available)\n* -mask string\n    \tMask to apply on each bit of the sprite (to apply an and operation on each pixel with the value #AA [in hexdecimal: #AA or 0xAA, in decimal: 170] ex: martine -in myimage.png -width 40 -height 80 -mask #AA -mode  0 -maskand)\n* -maskand \tWill apply an AND operation on each byte with the mask\n* -maskor Will apply an OR operation on each byte with the mask\n* -tilemap\n    \tAnalyse the input image and generate the tiles, the tile map and gloabl schema.\n* -spritehard will generate 16x16 bits sprite hard for CPC plus.\n* -splitrasters will generate a rastered screen \n* -reverse create a png image from your .scr .win file\n\n### hardware options (if you owns a M4 Card, you can transfert your results by Wifi to your CPC using those options) : \n* -host ip or dns name of your M4.\n* -autoexec will execute the launcher or sna file on your remote CPC.\n\n\n## Installation\n\nTo Install and compile\n```\ngo get github.com/jeromelesaux/martine\ncd $GOPATH/src/github.com/jeromelesaux/martine\ngo get \ngo build\n```\n\nTo get binary : \n[https://github.com/jeromelesaux/martine/releases](https://github.com/jeromelesaux/martine/releases)\n\u003cbr\u003eOS avaible : Linux, Macos X and Windows  \n\n\n## Usage\nUsage and options : \n\n```\n./martine\nmartine convert (jpeg, png format) image to Amstrad cpc screen (even overscan)\nBy Impact Sid (Version:0.29)\nSpecial thanks to @Ast (for his support), @Siko and @Tronic for ideas\nusage :\n\n  -address string\n        Starting address to display sprite in delta packing (default \"0xC000\")\n  -algo int\n        Algorithm to resize the image (available : \n                1: NearestNeighbor (default)\n                2: CatmullRom\n                3: Lanczos\n                4: Linear\n                5: Box\n                6: Hermite\n                7: BSpline\n                8: Hamming\n                9: Hann\n                10: Gaussian\n                11: Blackman\n                12: Bartlett\n                13: Welch\n                14: Cosine\n                15: MitchellNetravali\n                 (default 1)\n  -animate\n        Will produce an full screen with all sprite on the same image (add -in image.gif or -in *.png)\n  -autoexec\n        Execute on your remote CPC the screen file or basic file.\n  -brightness int\n        apply brightness on the color of the palette on amstrad plus screen. (max value 100 and only on CPC PLUS).\n  -contrast int\n        apply contrast on the color of the palette on amstrad plus screen. (max value 100 and only on CPC PLUS).\n  -delta\n        Delta mode: compute delta between two files (prefixed by the argument -df)\n                (ex: -delta -df file1.SCR -df file2.SCR -df file3.SCR).\n                (ex with wildcard: -delta -df file\\?.SCR or -delta file\\*.SCR\n  -deltapacking\n        Will generate all the animation code from the followed gif file.\n  -df value\n        scr file path to add in delta mode comparison. (wildcard accepted such as ? or * file filename.) \n  -dithering int\n        Dithering algorithm to apply on input image\n        Algorithms available:\n                0: FloydSteinberg\n                1: JarvisJudiceNinke\n                2: Stucki\n                3: Atkinson\n                4: Sierra\n                5: SierraLite\n                6: Sierra3\n                7: Bayer2\n                8: Bayer3\n                9: Bayer4\n                10: Bayer8\n         (default -1)\n  -dsk\n        Copy files in a new CPC image Dsk.\n  -egx1\n        Create egx 1 output cpc image overscan (option -fullscreen) or classical (mix mode 0 / 1).\n                (ex before generate two images one in mode 1 et one in mode 0\n                for instance : martine -in myimage.jpg -mode 0 and martine -in myimage.jpg -mode 1\n                : -egx1 -in 1.SCR -mode 0 -pal 1.PAL -in2 2.SCR -out test -mode2 1 -dsk)\n                or\n                (ex automatic egx from image file : -egx1 -in input.png -mode 0 -out test -dsk)\n  -egx2\n        Create egx 2 output cpc image overscan (option -fullscreen) or classical (mix mode 1 / 2).\n                (ex before generate two images one in mode 1 et one in mode 2\n                for instance : martine -in myimage.jpg -mode 0 and martine -in myimage.jpg -mode 1\n                : -egx2 -in 1.SCR -mode 0 -pal 1.PAL -in2 2.SCR -out test -mode2 1 -dsk)\n                or\n                (ex automatic egx from image file : -egx2 -in input.png -mode 0 -out test -dsk)\n  -extendeddsk\n        Export in a Extended DSK 80 tracks, 10 sectors 400 ko per face\n  -fillout\n        Fill out the gif frames needed some case with deltapacking\n  -flash\n        generate flash animation with two ocp screens.\n                (ex: -mode 1 -flash -in input.png -out test -dsk)\n                or\n                (ex: -mode 1 -flash -i input1.scr -pal input1.pal -mode2 0 -iin2 input2.scr -pal2 input2.pal -out test -dsk )\n  -fullscreen\n        Overscan mode (default no overscan)\n  -height int\n        Custom output height in pixels. (Will produce a sprite file .win) (default -1)\n  -help\n        Display help message\n  -host string\n        Set the ip of your M4.\n  -imp\n        Will generate sprites as IMP-Catcher format (Impdraw V2).\n  -in string\n        Picture path of the input file.\n  -in2 string\n        Picture path of the second input file (flash mode)\n  -info\n        Return the information of the file, associated with -pal and -win options\n  -initprocess string\n        Create a new empty process file.\n  -ink string\n        Path of the palette Cpc ink file. (Apply the input ink palette on the image)\n  -inkswap string\n        Swap ink:\n                for instance mode 4 (4 inks) : 0=3,1=0,2=1,3=2\n                will swap in output image index 0 by 3 and 1 by 0 and so on.\n  -iter int\n        Iterations number to walk in roll mode, or number of images to generate in rotation mode. (default -1)\n  -iterx int\n        Number of tiles on a row in the input image. (default 1)\n  -itery int\n        Number of tiles on a column in the input image. (default 1)\n  -json\n        Generate json format output.\n  -keephigh int\n        Bit rotation on the top and keep pixels (default -1)\n  -keeplow int\n        Bit rotation on the bottom and keep pixels (default -1)\n  -kit string\n        Path of the palette Cpc plus Kit file. (Apply the input kit palette on the image)\n  -linewidth string\n        Line width in hexadecimal to compute the screen address in delta mode. (default \"#50\")\n  -losthigh int\n        Bit rotation on the top and lost pixels (default -1)\n  -lostlow int\n        Bit rotation on the bottom and lost pixels (default -1)\n  -mask string\n        Mask to apply on each bit of the sprite (to apply an and operation on each pixel with the value #AA [in hexdecimal: #AA or 0xAA, in decimal: 170] ex: martine -in myimage.png -width 40 -height 80 -mask #AA -mode 0 -maskand)\n  -maskand\n        Will apply an AND operation on each byte with the mask\n  -maskor\n        Will apply an OR operation on each byte with the mask\n  -mode int\n        Output mode to use :\n                0 for mode0\n                1 for mode1\n                2 for mode2\n                and add -fullscreen option for overscan export.\n                 (default -1)\n  -mode2 int\n        Output mode to use :\n                0 for mode0\n                1 for mode1\n                2 for mode2\n                mode of the second input file (flash mode) (default -1)\n  -multiplier float\n        Error dithering multiplier. (default 1.18)\n  -noheader\n        No amsdos header for all files (default amsdos header added).\n  -oneline\n        Display every other line.\n  -onerow\n        Display  every other row.\n  -out string\n        Output directory\n  -pal string\n        Apply the input palette to the image\n  -pal2 string\n        Apply the input palette to the second image (flash mode)\n  -plus\n        Plus mode (means generate an image for CPC Plus Screen)\n  -processfile string\n        Process file path to apply.\n  -quantization\n        Use additionnal quantization for dithering.\n  -reducer int\n        Reducer mask will reduce original image colors. Available : \n                1 : lower\n                2 : medium\n                3 : strong\n         (default -1)\n  -remotepath string\n        Remote path on your M4 where you want to copy your files.\n  -reverse\n        Transform .scr (overscan or not) file with palette (pal or kit file) into png file\n  -rla int\n        Bit rotation on the left and keep pixels (default -1)\n  -roll\n        Roll mode allow to walk and walk into the input file, associated with rla,rra,sra,sla, keephigh, keeplow, losthigh or lostlow options.\n  -rotate\n        Allow rotation on the input image, the input image must be a square (width equals height)\n  -rotate3d\n        Allow 3d rotation on the input image, the input image must be a square (width equals height)\n  -rotate3dtype int\n        Rotation type :\n                1 rotate on X axis\n                2 rotate on Y axis\n                3 rotate reverse X axis\n                4 rotate left to right on Y axis\n                5 diagonal rotation on X axis\n                6 diagonal rotation on Y axis\n    \n  -rotate3dx0 int\n        X0 coordinate to apply in 3d rotation (default width of the image/2) (default -1)\n  -rotate3dy0 int\n        Y0 coordinate to apply in 3d rotation (default height of the image/2) (default -1)\n  -rra int\n        Bit rotation on the right and keep pixels (default -1)\n  -scanlinesequence string\n        Scanline sequence to apply on sprite. for instance : \n                martine -in myimage.jpg -width 4 -height 4 -scanlinesequence 0,2,1,3 \n                will generate a sprite stored with lines order 0 2 1 and 3.\n    \n  -sla int\n        Bit rotation on the left and lost pixels (default -1)\n  -sna\n        Copy files in a new CPC image Sna.\n  -splitrasters\n        Create Split rastered image. (Will produce Overscan output file and .SPL with split rasters file)\n  -spritehard\n        Generate sprite hard for cpc plus.\n  -sra int\n        Bit rotation on the right and lost pixels (default -1)\n  -statement string\n        Byte statement to replace in ascii export (default is db), you can replace or instance by defb or byte\n  -tile\n        Tile mode to create multiples sprites from a same image.\n  -tilemap\n        Analyse the input image and generate the tiles, the tile map and global schema.\n                 for instance: martine -in board.png -mode 0 -width 8 -height 8 -out folder -dsk\n    \n  -txt\n        Generate text format output.\n  -version\n        print martine's version\n  -width int\n        Custom output width in pixels. (Will produce a sprite file .win) (default -1)\n  -win string\n        Filepath of the ocp win file\n  -z int\n        Compression algorithm : \n                1: rle (default)\n                2: rle 16bits\n                3: Lz4 Classic\n                4: Lz4 Raw\n                5: zx0 crunch\n         (default -1)\n  -zigzag\n        generate data in zigzag order (inc first line and dec next line for tiles)\n```\n## Technics\nPrinciples : \nMartine can be used in several modes : \n * first mode : conversion of an input image into sprite (file .win), cpc screen (file .scr) and overscan screen (larger file .scr)\n * second mode : rotate line or column pixels of an input image (option -roll)\n * bulk conversion of a tiles page : each sprites of the same width and height will be converted to sprites (files .win, option -tile)\n * rotate an existing image, will produce images rotated\n * 3d rotate an existing image on an axis.\n * egx mode screen generation (screen which alternates 2 modes (0,1,2) each line).\n * delta packing, allows you to create your own animation using the less memory as possible, keeping the maximum of speed.\n * tilemap generate the map of tiles and sprites of the input map.\n * split raster to generate a rastered screen\n * flash to generate a flash screen\n\nexamples :\n### Screen_conversion \n* convert samples/Batman-Neal-Adams.jpg \n\n  * in mode 0 \n```martine -in samples/Batman-Neal-Adams.jpg -mode  0```\n  * in mode 1 \n```martine -in samples/Batman-Neal-Adams.jpg -mode  1```\n  * in mode 2 \n```martine -in samples/Batman-Neal-Adams.jpg -mode  2```\n  * in mode 0 in overscan : \n```martine -in samples/Batman-Neal-Adams.jpg -mode  0 -f```\n  * in mode 0 overscan for Plus series :\n```martine -in samples/Batman-Neal-Adams.jpg -mode  0 -fullscreen -p```\n  * to get sprites (40 pixels wide)\n```martine -in samples/Batman-Neal-Adams.jpg -mode  0 -width 40```\n  * roll mode to do an rra operation on the image (will create 16 sprites with a rra operation on the first pixels on the left)\n\t```martine -in samples/Batman-Neal-Adams.jpg -mode  0 -width 40 -roll -rra 1 -iter 16```\t\n\nSamples : \n```martine -in samples/Batman-Neal-Adams.jpg -mode  0 -f```\n\ninput ![samples/Batman-Neal-Adams.jpg](samples/Batman-Neal-Adams.jpg)      \n \n will resize the image and save it \n\n ![resized](samples/batman_mode0_resized.png)\n\n after downgrade the colors palette : \n\n ![downgrade colors](samples/batman_mode0_down.png)\n\n results on a CPC emulator : \n\n ![result](samples/overscan-batman.png)\n\n \n\n\n### Roll : \n\n```martine -in samples/rotate.png -mode  0 -width 16 -height 16 -roll -rra 1 -iter 16```\n\ninput ![samples/rotate.png](samples/rotate.png)\n\nsames phasis reduce size and downgrade colors palette to CPC palette. \n\nafter rotate the first pixels' column in 16 differents images : \n\n ![0rotate.png](samples/0rotate.png)\n ![1rotate.png](samples/1rotate.png)\n ![2rotate.png](samples/2rotate.png)\n ![3rotate.png](samples/3rotate.png)\n ![4rotate.png](samples/4rotate.png)\n ![5rotate.png](samples/5rotate.png)\n ![6rotate.png](samples/6rotate.png)\n ![7rotate.png](samples/7rotate.png)\n ![8rotate.png](samples/8rotate.png)\n ![9rotate.png](samples/9rotate.png)\n ![10rotate.png](samples/10rotate.png)\n ![11rotate.png](samples/11rotate.png)\n ![12rotate.png](samples/12rotate.png)\n ![13rotate.png](samples/13rotate.png)\n ![14rotate.png](samples/14rotate.png)\n ![15rotate.png](samples/15rotate.png)\n\n with the same image, to rotate the pixels line : \n\n ```martine -in samples/rotate.png -mode  0 -width 16 -height 16 -roll -keephigh 2 -iter 16 ```\n\n will produce images : \n\n ![0rotate.png](samples/0rotate_keephigh.png)\n ![1rotate.png](samples/1rotate_keephigh.png)\n ![2rotate.png](samples/2rotate_keephigh.png)\n ![3rotate.png](samples/3rotate_keephigh.png)\n ![4rotate.png](samples/4rotate_keephigh.png)\n ![5rotate.png](samples/5rotate_keephigh.png)\n ![6rotate.png](samples/6rotate_keephigh.png)\n ![7rotate.png](samples/7rotate_keephigh.png)\n ![8rotate.png](samples/8rotate_keephigh.png)\n ![9rotate.png](samples/9rotate_keephigh.png)\n ![10rotate.png](samples/10rotate_keephigh.png)\n ![11rotate.png](samples/11rotate_keephigh.png)\n ![12rotate.png](samples/12rotate_keephigh.png)\n ![13rotate.png](samples/13rotate_keephigh.png)\n ![14rotate.png](samples/14rotate_keephigh.png)\n ![15rotate.png](samples/15rotate_keephigh.png)\n\n \n\n### Tiles :\n\nthis option will extract all the tiles from an image and generate the sprites files. \nsample usage : \n```martine -in samples/tiles.png -tile -width 64 -iterx 14 -itery 7 -mode  0 ```\n\ninput ![samples/rotate.png](samples/tiles.png)\n\nThis command will generate 14*7 sprites of 64 pixels large.\nWarn, all sprite must have the same size.\n\n ![0rotate.png](samples/TILES_resized_0.png)\n ![1rotate.png](samples/TILES_resized_1.png)\n ![2rotate.png](samples/TILES_resized_2.png)\n ![3rotate.png](samples/TILES_resized_3.png)\n ![4rotate.png](samples/TILES_resized_4.png)\n ![5rotate.png](samples/TILES_resized_5.png)\n ![6rotate.png](samples/TILES_resized_6.png)\n ![7rotate.png](samples/TILES_resized_7.png)\n ![8rotate.png](samples/TILES_resized_8.png)\n ![9rotate.png](samples/TILES_resized_9.png)\n ![10rotate.png](samples/TILES_resized_10.png)\n ![11rotate.png](samples/TILES_resized_11.png)\n ![12rotate.png](samples/TILES_resized_12.png)\n ![13rotate.png](samples/TILES_resized_13.png)\n ![14rotate.png](samples/TILES_resized_14.png)\n ![15rotate.png](samples/TILES_resized_15.png)\n ![10rotate.png](samples/TILES_resized_16.png)\n ![11rotate.png](samples/TILES_resized_17.png)\n ![12rotate.png](samples/TILES_resized_18.png)\n ![13rotate.png](samples/TILES_resized_19.png)\n ![14rotate.png](samples/TILES_resized_20.png)\n\n\n### Rotation : \nThis option able to rotate the input image, iter will generate the number of images.\n```martine -in images/coke.jpg -rotate -iter 16 -out test  -mode  1 -width 32 -height 32```\n\nInput : ![samples/coke.jpg](samples/coke.jpg)\n\nresults : ![samples/coke.igf](samples/coke.gif)\n\n\n### 3D_rotation\nThis option able to rotate the input image on an axis (X or Y and even on a diagonal), iter will generate the number of images. \n```./martine -mode  0 -width 64 -height 64 -rotate3d -rotate3dtype 2 -out test/ -in images/sonic.png  -iter 12```\n\nInput : ![samples/sonic.png](samples/sonic.png)\n\nResults: ![samples/sonic_rotate.png](samples/sonic_rotate.gif)\n\n### flash \n\n### tilemap\nThis option allows to create allow tiles and tile map from the input image. If for instance you use the mario level 1 like this : \n![samples/mario-level1.png](samples/mario-level1.png)\n```martine -in mario-level1.png -width 16 -height 16 -tilemap -out Mario-level1```\n\nBy this command line, martine will analyse the image to find all tiles 16 pixels high and 16 pixels wide. It will keep in memory the tile position to produce the tile map.\n![samples/mario-level1/tilesmap_schema.png](samples/mario-level1/tilesmap_schema.png)\nA csv ot the same tile map is also created (tilesmap.asm).\nMartine will also generate all tiles found.\n- ![samples/mario-level1/00.png](samples/mario-level1/00.png) tile 00 \n- ![samples/mario-level1/01.png](samples/mario-level1/01.png) tile 01\n- ![samples/mario-level1/02.png](samples/mario-level1/02.png) tile 02\n- ![samples/mario-level1/03.png](samples/mario-level1/03.png) tile 03\n- ![samples/mario-level1/04.png](samples/mario-level1/04.png) tile 04\n- ![samples/mario-level1/05.png](samples/mario-level1/05.png) tile 05 \n- ![samples/mario-level1/06.png](samples/mario-level1/06.png) tile 06\n- ![samples/mario-level1/07.png](samples/mario-level1/07.png) tile 07\n- ![samples/mario-level1/08.png](samples/mario-level1/08.png) tile 08\n- ![samples/mario-level1/09.png](samples/mario-level1/09.png) tile 09\n- ![samples/mario-level1/10.png](samples/mario-level1/10.png) tile 10 \n- ![samples/mario-level1/01.png](samples/mario-level1/11.png) tile 11\n- ![samples/mario-level1/02.png](samples/mario-level1/12.png) tile 12\n- ![samples/mario-level1/03.png](samples/mario-level1/13.png) tile 13\n- ![samples/mario-level1/04.png](samples/mario-level1/14.png) tile 14\n- ![samples/mario-level1/05.png](samples/mario-level1/15.png) tile 15 \n- ![samples/mario-level1/06.png](samples/mario-level1/16.png) tile 16\n- ![samples/mario-level1/07.png](samples/mario-level1/17.png) tile 17\n- ![samples/mario-level1/08.png](samples/mario-level1/18.png) tile 18\n- ![samples/mario-level1/09.png](samples/mario-level1/19.png) tile 19\n- ![samples/mario-level1/10.png](samples/mario-level1/20.png) tile 20 \n- ![samples/mario-level1/01.png](samples/mario-level1/21.png) tile 21\n- ![samples/mario-level1/02.png](samples/mario-level1/22.png) tile 22\n- ![samples/mario-level1/03.png](samples/mario-level1/23.png) tile 23\n- ![samples/mario-level1/04.png](samples/mario-level1/24.png) tile 24\n- ![samples/mario-level1/05.png](samples/mario-level1/25.png) tile 25 \n- ![samples/mario-level1/06.png](samples/mario-level1/26.png) tile 26\n- ![samples/mario-level1/07.png](samples/mario-level1/27.png) tile 27\n- ![samples/mario-level1/08.png](samples/mario-level1/28.png) tile 28\n- ![samples/mario-level1/09.png](samples/mario-level1/29.png) tile 29\n- ![samples/mario-level1/10.png](samples/mario-level1/30.png) tile 30 \n- ![samples/mario-level1/10.png](samples/mario-level1/31.png) tile 31\n\nand the palette for each tile for instance : ![samples/mario-level1/31_palettepal.png](samples/mario-level1/31_palettepal.png)\n### Egx\nThe egx mode was introduced by Targhan in his game Ishido. \nThis mode alternate differents screen mode. First line in mode 1, second line mode in mode 0, third in mode 1 etc ...\n\nTwo differents formats are available egx1 and egx2 : \n* egx1 alternates mode 0 and mode 1\n* egx2 alternates mode 1 and mode 2\n\nMartine lets the user to choose the input images. Like this you can combine dithering in the image mode 1, to get a better render.\n\nIn this example I will use this image : \n![bwind.jpg](samples/bwind.jpg)\n\nSo you need to generate two images in differents modes such as follow : \n```\nmartine -in images/bwind.jpg -mode  0 -out egx_bwind/mode0 -f\nmartine -in images/bwind.jpg -mode  1 -dithering 10 -out egx_bwind/mode1 -f\n```\nresults : \n* mode 0 ![mode 0](samples/egx_bwind/mode0/bwind.jpg_down.png)\n* mode 1 ![mode 1](samples/egx_bwind/mode1/bwind.jpg_down.png)\n\nIt's important to generate in differents folders, martine will erase the files generated by the first command.\n\nNow create the egx file by the command : \n```\nmartine -egx1 -mode  0 -in egx_bwind/mode0/BWINND.SCR -m2 1 -i2 egx_bwind/mode1/BWINND.SCR -out egx_bwind/ -pal egx_bwind/mode0/BWINND.PAL -fullscreen -dsk\n```\nwill produce ![](samples/bwind_egx.png)\n\nSome explanations : \u003cbr\u003e\nI choose here to be in full screen (option -f).\nmartine needs to know the two modes of each input images (here -mode  0 mode 0 for the first image, -m2 1 mode 1 for the second image).\u003cbr\u003e\n-in and -i2 for the .scr images.\u003cbr\u003e\nAnd the palette path option -pal.\u003cbr\u003e\nYou can note that martine allows you to choose you own palette. You can modify your palette to have a different rendering.\u003cbr\u003e\nIf you want to iterate and gets the results quickly on your own machine, I advise you to add the M4 option and use the sna output. \u003cbr\u003e\nComplete your command line with for instance ```-sna -host 192.168.1.100 -autoexec ``` \n\n### deltapacking\n\nThis technic allows you to display animation on your CPC easily.\u003cbr\u003e\nFor this technic you will need to script a little, even martine facilitates the data transformation.\u003cbr\u003e\nThe steps are :\n1. images traitment (if your starting image is gif for instance)\n2. create a reference palette (this palette will be applied on all sprite conversion)\n3. conversion of the sprite\n4. differential computing on each sprite\n5. parsing results \n\nFor instance here, I will start with this gif image : \n![megaman](samples/deltapacking-megaman/megaman.gif)\n\nYou may not know, but the gif format allows pixel delta between sequence.\nTo avoid to get part of image, you need to traite the image before. \nI use here convert from ImageMagick : \u003cbr\u003e\n\n\n```convert megaman.gif -coalesce -scale 528x528 output.gif ```\n\nYou obtain this \n![megaman](samples/deltapacking-megaman/output.gif)\n\nNo visual changes, but now you can extract and get the whole image by sequence. \n\u003cbr\u003e\nExtract image from gif  (same convert binary): \u003cbr\u003e\n\n```convert output.gif images/m%02d.png```\n\nNow create your reference palette :\u003cbr\u003e\n\n```martine -mode  0 -in images/m00.png -out reference -dsk```\n\nIterate on all png to create sprite for each images : \u003cbr\u003e\n\n```for i in images/m*.png; do martine -in \"$i\" -mode  0 -width 50 -height 50 -out sprites -pal reference/M000.PAL ; done ``` \n\nYou will obtain in the sprites folder all sprites.\n\nCompute the difference between images and ouput screen address (here the sprite will start at the address #D005): \n\n```martine -delta -df sprites/\\*.WIN -out delta -address \"#D005\" -json```\n\nFormat your data : \n\n```prepare_delta -sprite sprites/m00.json -mode  0 -delta delta/\\*.json -out data.asm ```\n\nThe assembly code can be compiled with Rasm from Roudoudou : \n```\n;--- dimensions du sprite ----\nlarge equ 100 / 2 \nhaut equ 100\n;-----------------------------\n\norg #1000\nrun $\n\nstart\n\n    ; gestion du mode \n    ;ld bc,#7f8c\n    ;out (c),c \n;--- selection du mode ---------\n    ld a,0\n    call #BC0E\n;-------------------------------\n  \n\n;--- gestion de la palette ---- \n    call palettefirmware\n;------------------------------\n\ncall xvbl\n\n;--- affichage du sprite initiale --  \n    ; affichage du premier sprite\n    ld de,#C000 ; adresse de l'ecran \n    ld hl,sprite ; pointeur sur l'image en memoire \n    ld b, haut ; hauteur de l'image \n    loop \n    push bc ; sauve le compteur hauteur dans la pile \n    push de ; sauvegarde de l'adresse ecran dans la pile\n    ld bc, large ; largeur de l'image a afficher\n    ldir ; remplissage de n * largeur octets a l'adresse dans de \n    pop de ; recuperation de l'adresse d'origine \n    ex de,hl ; echange des valeurs des adresses\n    call bc26 ; calcul de l'adresse de la ligne suivante\n    ex de,hl ; echange des valeurs des adresses\n    pop bc ; retabli le compteur \n    djnz loop\n;------------------------------------\n   \n\nmainloop    ; routine pour afficher les deltas provenant de martine \n\n;call #bb06\ncall xvbl\nld hl,delta00\ncall delta\n\n;call #bb06\n\ncall xvbl\nld hl,delta01\ncall delta\n\n;call #bb06\ncall xvbl\nld hl,delta02\ncall delta\n\n;call #bb06\ncall xvbl\nld hl,delta03\ncall delta\n\n;call #bb06\ncall xvbl\nld hl,delta04\ncall delta\n\n;call #bb06\ncall xvbl\nld hl,delta05\ncall delta\n\n;call #bb06\ncall xvbl\nld hl,delta06\ncall delta\n\n;call #bb06\ncall xvbl\nld hl,delta07\ncall delta\n\n;call #bb06\ncall xvbl\nld hl,delta08\ncall delta\n\n;call #bb06\ncall xvbl\nld hl,delta09\ncall delta\n\n\n\njp mainloop \n\n\n;--- routine de deltapacking --------------------------\n\ndelta\n ld a,(hl) ; nombre de byte a poker\n ld (nbbytepoked),a ; stockage en mémoire\n inc hl\ninit\n ld a,(hl) ; octet a poker\n ld (pixel),a\n inc hl\n ld c,(hl) ; nbfois\n inc hl \n ld b,(hl)\n inc hl\n;\npoke_octet\n ld e,(hl)\n inc hl\n ld d,(hl) ; de=adresse\n inc hl\n ld a,(pixel)\n ld (de),a ; poke a l'adresse dans de\n dec bc\n ld a,b ; test a t'on poke toutes les adresses compteur bc\n or a \n jr nz, poke_octet\n ld a,c \n or a\n jr nz, poke_octet\n\n ld a,(nbbytepoked) ; reste t'il d'autres bytes a poker ? \n dec a \n ld (nbbytepoked),a\n jr nz,init\n ret\n\n\n\n;---------------------------------------------------------------\n;\n; attente de plusieurs vbl\n;\nxvbl ld e,30\n\tcall waitvbl\n\tdec e\n\tjr nz,xvbl+2\n\tret\n;-----------------------------------\n\n;---- attente vbl ----------\nwaitvbl\n    ld b,#f5 ; attente vbl\nvbl     \n    in a,(c)\n    rra\n    jp nc,vbl\n    ret\n;---------------------------\n\n;--- application palette firmware -------------\npalettefirmware ; hl pointe sur les valeurs de la palette\nld a,0\nld b,0\nld c,0\ncall #bc32\n\nld a,1\nld b,15\nld c,15\ncall #bc32\n\nld a,2\nld b,1\nld c,1\ncall #bc32\n\nld a,3\nld b,10\nld c,10\ncall #bc32\n\nld a,4\nld b,11\nld c,11\ncall #bc32\n\nld a,5\nld b,12\nld c,12\ncall #bc32\n\nld a,6\nld b,13\nld c,13\ncall #bc32\n\nld a,7\nld b,14\nld c,14\ncall #bc32\n\nld a,8\nld b,23\nld c,23\ncall #bc32\n\nld a,9\nld b,16\nld c,16\ncall #bc32\n\nld a,10\nld b,26\nld c,26\ncall #bc32\n\n\nret\n;---------------------------------------------\n\n;---- recuperation de l'adresse de la ligne en dessous ------------\nbc26 \nld a,h\nadd a,8 \nld h,a ; \u003c---- le fameux que tu as oublié !\nret nc \nld bc,#c050 ; on passe en 96 colonnes\nadd hl,bc\nres 3,h\nret\n;-----------------------------------------------------------------\n\n\n;--- variables memoires -----\npixel db 0 \nnbbytepoked db 0\n;----------------------------\n\n\n;------- data ---------------------------\n\ninclude 'data.asm'\n\n\n\nend\n\nsave'delta.bin',#1000,end-start,DSK,'bomberman.dsk'\n\n```\n\nNow you can get the result here : [sna](samples/deltapacking-megaman/megaman.sna) or [dsk](samples/deltapacking-megaman/megaman.dsk)\n\nYou will obtain this : \n![video emu](samples/deltapacking-megaman/megaman-emulator.gif)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeromelesaux%2Fmartine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeromelesaux%2Fmartine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeromelesaux%2Fmartine/lists"}