├── CNAME ├── circles.png ├── README.md ├── LICENSE ├── css └── AmigaFontEditor.css ├── number_interpreter.html ├── deltas.html ├── sqrt.html ├── register_conversion.html ├── projection.html ├── rawdiff.html ├── diwstartstop.html ├── trigonometry.html ├── copperlist_translator.html ├── index.html ├── rgbcolors.html ├── index_sprite_position.html ├── js └── UPNG.js ├── raw2planar.html └── index_sprite.html /CNAME: -------------------------------------------------------------------------------- 1 | amigafonteditor.ozzyboshi.com 2 | -------------------------------------------------------------------------------- /circles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ozzyboshi/AmigaFontEditor/HEAD/circles.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AmigaFontEditor 2 | AmigaFontEditor is a very basic font editor intended for Amiga's assembler programmers. 3 | 4 | The goal of AmigaFontEditor is to let you draw for each grid a character ranging from ascii 32 up to 128 and get merge all of them in a single binary file ready to be included in your Amiga assembler program with the instruction `incbin'. 5 | 6 | You can also inspect the binary content using the show binary and show hex buttons and restore a previously saved binary file with the `Import From Raw File' button. 7 | 8 | AmigaFontEditor has not dependencies, entirely written in pure javascript and can run offline. 9 | You can try it live now at http://amigafonteditor.ozzyboshi.com 10 | 11 | Pull requests are welcome!!! 12 | 13 | Amiga forever 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Alessio Garzi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /css/AmigaFontEditor.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0px; 3 | padding: 0px; 4 | background:#607d8b; 5 | } 6 | li { 7 | border: solid 1px; 8 | background-color:#9e9e9e; 9 | padding: 5px; 10 | list-style: none; 11 | font-family: trebuchet ms; 12 | text-align: justify; 13 | word-wrap:break-word; 14 | } 15 | #colorslist > li {float: left;} 16 | #colorslist { list-style-type: none; 17 | margin: 0; 18 | padding: 0; 19 | overflow: hidden; 20 | background-color: #333333; 21 | } 22 | 23 | #colorslistnew > li {float: left;} 24 | #colorslistnew { list-style-type: none; 25 | margin: 0; 26 | padding: 0; 27 | overflow: hidden; 28 | background-color: #333333; 29 | } 30 | 31 | ul { 32 | margin:0px; 33 | padding:0px; 34 | padding-left: 0px; 35 | } 36 | 37 | input {margin:10px;} 38 | input[type=button] {margin:1px;} 39 | input[type=color] {width: 20px;margin: 1px;} 40 | pre {border: solid 1px;margin: 0px;} 41 | #resultpre{ width:587px; height: 545px; } 42 | #resultpre2{display:block;overflow: auto;background-color: #eeeeee;word-break: normal !important;word-wrap: normal !important;white-space: pre !important;max-height:545px;margin-top: 12px;} 43 | #result{position:fixed;right:50px;width:593px;height:600px;background:white;top:150px;border: solid 10px;} 44 | #colorpalette{position:fixed;right:680px;width:290px;height:600px;background:white;top:150px;border: solid 10px;} 45 | #colorpalettenew{position:fixed;right:680px;width:290px;height:600px;background:white;top:150px;border: solid 10px;} 46 | 47 | #fontnavigator{position:fixed;right:1000px;width:50px;height:600px;background:white;top:150px;border: solid 10px;overflow: auto;} 48 | #fontnavigator ul {margin: 0px;} 49 | #fontnavigator li {cursor:pointer;} 50 | #coppernavigator{position:fixed;right:0px;height:600px;background:white;top:150px;border: solid 10px;overflow: auto;width:50%;float:right;} 51 | 52 | 53 | canvas {cursor:pointer;} 54 | #colorslist > li:nth-child(2) {background-color: red;} 55 | #colorslist > li {cursor:pointer;} 56 | 57 | .MOVE {background-color: #e2e29c;} 58 | 59 | .resizable { 60 | overflow: scroll; 61 | resize: both; 62 | max-width: 300px; 63 | max-height: 460px; 64 | } 65 | 66 | /* Add a black background color to the top navigation */ 67 | .topnav { 68 | background-color: #333; 69 | overflow: hidden; 70 | } 71 | 72 | /* Style the links inside the navigation bar */ 73 | .topnav a { 74 | float: left; 75 | color: #f2f2f2; 76 | text-align: center; 77 | padding: 14px 16px; 78 | text-decoration: none; 79 | font-size: 17px; 80 | } 81 | 82 | /* Change the color of links on hover */ 83 | .topnav a:hover { 84 | background-color: #ddd; 85 | color: black; 86 | } 87 | 88 | /* Add a color to the active/current link */ 89 | .topnav a.active { 90 | background-color: #4CAF50; 91 | color: white; 92 | } 93 | -------------------------------------------------------------------------------- /number_interpreter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Fork me on GitHub 23 |
24 | Fonts 25 | Sprite 26 | Sprite position 27 | Register conversion 28 | Copperlist translator 29 | Diwstart/stop 30 | Point Projection 31 | Trigonometric tables 32 | Raw 2 planar viewer 33 | RGB Colors 34 | Square root tables 35 | Deltas table calculator 36 | Number interpreter 37 | Raw diff 38 |
39 |
40 |

Amiga number interpreter

41 |

Put a word in hex format inside the hex input area and click generate.
42 | The number will be interpreted in various different formats. 43 |

44 | 45 |
46 | 47 | 69 |
70 | 71 | 72 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /deltas.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Fork me on GitHub 23 |
24 | Fonts 25 | Sprite 26 | Sprite position 27 | Register conversion 28 | Copperlist translator 29 | Diwstart/stop 30 | Point Projection 31 | Trigonometric tables 32 | Raw 2 planar viewer 33 | RGB Colors 34 | Square root tables 35 | Deltas table calculator 36 | Number interpreter 37 | Raw diff 38 |
39 |
40 |

Amiga delta table calculator

41 |

This little tool helps you to recalculate tables according to the difference between each entry.
42 | This is useful to help compressors to shrink data since we assume deltas are more redundant than single entryes of the table.
43 |
44 | Fill the upper textarea with the table entries for example: 45 | 46 | 47 | dc.b %10000000 ; X:1 Y:1 InputValue: 0.250000 48 | dc.b %11001011 ; X:1 Y:3 InputValue: 0.397584 49 | ... 50 | 51 | 52 | Then press the "Generate" button.
53 | On the bottom textarea you will see the difference between the current entry and the previous, ready to be copied/pasted into your program. 54 |
The following is a little m68k ASM snippet/example that can reconstruct the original table. 55 | 56 | lea DATASRC,a0 57 | lea DATADST,a1 58 | moveq #0,d1 59 | move.w #4096-1,d7 60 | loop: 61 | move.w (a0)+,d0 62 | add.w d1,d0 63 | move.w d0,(a1)+ 64 | move.w d0,d1 65 | dbra d7,loop 66 | ... 67 | DATADST: 68 | dcb.w 4096,0 69 | DATASRC: 70 | dc.w 128 ; X:1 Y:1 InputValue: 0.250000 71 | ... 72 | 73 |

74 | 75 |
76 | 77 | 78 |
    79 |
  • 80 |
81 | 82 |
    83 |
  • 84 |
85 | 86 |
87 | 88 | 89 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /sqrt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Fork me on GitHub 23 | 39 |
40 |

Amiga SQRT tables generator

41 |

Build your ASM sqrt tables

42 | 43 |
44 | 45 |   Fixed point format: 63 | 64 | 65 | 66 | 67 |
    68 |
  • 69 |
  • 70 |
71 |
72 | 73 | 74 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /register_conversion.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Fork me on GitHub 11 | 27 |

Amiga register reader

28 |
29 |

Hex value 30 |

32 | 33 |

34 | 35 |

    36 |
  • Bit 15
  • 37 |
  • Bit 14
  • 38 |
  • Bit 13
  • 39 |
  • Bit 12
  • 40 |
  • Bit 11
  • 41 |
  • Bit 10
  • 42 |
  • Bit 9
  • 43 |
  • Bit 8
  • 44 |
  • Bit 7
  • 45 |
  • Bit 6
  • 46 |
  • Bit 5
  • 47 |
  • Bit 4
  • 48 |
  • Bit 3
  • 49 |
  • Bit 2
  • 50 |
  • Bit 1
  • 51 |
  • Bit 0
  • 52 | 53 |
54 | 55 |

Note :
56 |
57 | 188 | 189 | 190 | -------------------------------------------------------------------------------- /projection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Fork me on GitHub 23 | 39 |
40 |

Amiga projection tester

41 |

Test 3d points projection on the screen with the folliwing formula

42 | 43 |
44 | Point generator 45 | 46 | 47 | 48 |
    49 |
  • 50 |
  • 51 |
  • 52 |
53 |
54 | 55 |
 56 |       
 57 | var Xs = 160 + (Xe * Zu * -1) / (Ze - Zu);
 58 | var Ys = 128 + (Ye * Zu * -1) / (Ze - Zu);
 59 | 
 60 | Xe Ye Ze = coords of the point in a 3d space
 61 | Zu = distance of the viewer
 62 | 
 63 | Xs and Ys = projected points on the display monitor
 64 |       
 65 |     
66 |
    67 |
  • Xe
  • 68 |
  • Ye
  • 69 |
  • Ze
  • 70 |
  • Zu
  • 71 |
72 | 73 | 74 |

75 |

Xs: 0

76 |

Ys: 0

77 |

78 |

79 | 3d Point tester 80 |

81 |

82 | 83 |

84 |

85 | 86 |

87 | 235 | 236 | 237 | -------------------------------------------------------------------------------- /rawdiff.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | 14 | 15 | Fork me on GitHub 16 | 32 | 33 |
34 |

Raw diff

35 |

Display difference between 2 raw files - each byte on both tables will get color from the list on the right according to how much difference between the 2 files

36 | 37 | 38 |
39 |
40 | 41 | 42 | 43 | 44 |
45 | 46 | 47 |
0
48 |
49 |
50 |
51 | 52 | 53 | 54 | 55 |
56 | 57 | 58 |
0
59 |
60 |
61 |
62 | 63 |
    64 |
  • 65 |
  • 66 |
67 | 68 |
69 |
70 |
71 | 235 | 236 | 237 | -------------------------------------------------------------------------------- /diwstartstop.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Fork me on GitHub 16 | 32 |

Amiga diwstart/stop simulation

33 |
34 | 35 | 36 | 37 |
38 |

DiwXstart:

39 | 40 | 41 |

DiwXstop:

42 | 43 | 44 |

DiwYstart:

45 | 46 | 47 |

DiwYstop:

48 | 49 |
50 | 51 |

DFF08E (DIWSTRT): 52 | 0000 53 |

54 | 55 |

DFF090 (DIWSTOP): 56 | 0000 57 |

58 | 59 |

New image (must be a 320X256 png url): 60 | 61 |

62 | 63 |
64 | 65 | 66 | 283 | 284 | 285 | 286 | -------------------------------------------------------------------------------- /trigonometry.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Fork me on GitHub 23 | 39 |
40 |

Amiga Trigonometric tables generator

41 |

Build your ASM trigonometric functions

42 | 43 |
44 | Multiplier 45 | 46 | 47 | Multiplier helper: 66 |   Function: 73 | 74 | 75 | 76 |   Fixed point format: 82 | 83 |   Add offset: 84 | 85 | 86 | 87 |
    88 |
  • 89 |
  • 90 |
  • 91 |
92 |
93 | 94 | 95 | 283 | 284 | 285 | -------------------------------------------------------------------------------- /copperlist_translator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 15 | 16 | 17 | Fork me on GitHub 18 | 34 |

Copperlist translator

35 |
36 | 37 | 38 |
39 | 40 |
50 | 000BEF50 0001 FFFF 0120 0000 0122 0770 0124 000B ..... ...".p.$.. 51 | 000BEF60 0126 EC50 0128 000B 012A EC98 012C 000B .&.P.(...*...,.. 52 | 000BEF70 012E ECE0 0130 000B 0132 ED28 0134 000B .....0...2.(.4.. 53 | 000BEF80 0136 EDB0 0138 0000 013A 0770 013C 0000 .6...8...:.p.<.. 54 | 000BEF90 013E 0770 2BC7 FFFE 0094 00D0 0092 0030 .>.p+..........0 55 | 000BEFA0 0108 0116 010A 0116 0102 0044 00E0 0006 ...........D.... 56 | 000BEFB0 00E2 4536 00E4 0006 00E6 1D36 00E8 0005 ..E6.......6.... 57 | 000BEFC0 00EA F536 00EC 0005 00EE CD36 00F0 0005 ...6.......6.... 58 | 000BEFD0 00F2 A536 4BC7 FFFE 0094 00D0 0092 0030 ...6K..........0 59 | 000BEFE0 0108 0116 010A 0116 0102 0088 00E0 000A ................ 60 | 000BEFF0 00E2 CD34 00E4 0009 00E6 B534 00E8 0008 ...4.......4.... 61 | 000BF000 00EA 9D34 00EC 0007 00EE 8534 00F0 0006 ...4.......4.... 62 | 000BF010 00F2 6D34 4C01 FFFE 0182 0FD8 0184 0FB7 ..m4L........... 63 | 000BF020 0186 0F96 0188 0F74 018A 0F07 018C 0B43 .......t.......C 64 | 000BF030 018E 0056 0190 0234 0192 0500 0194 0005 ...V...4........ 65 | 000BF040 0196 0001 0198 0FE9 019A 0111 019C 0644 ...............D 66 | 000BF050 019E 0C11 FFDF FFFE 2C01 FFFE 0182 0888 ........,....... 67 | 000BF060 0184 0800 0186 0008 FFFF FFFE 68 |
69 |

70 |

71 | 72 |
73 |
    74 |
75 |
76 | 77 | 268 | 269 | 270 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Fork me on GitHub 11 | 28 |
29 |

Amiga font editor

30 |

Draw your fonts on the left grids and get the binary raw data to load into the Amiga copperlist

31 |
32 |
    33 |
34 |
35 |
36 | 37 | Bitplanes :5 38 |
    39 |
  • Color 00
  • 40 |
  • Color 01
  • 41 |
  • Color 02
  • 42 |
  • Color 03
  • 43 |
  • Color 04
  • 44 |
  • Color 05
  • 45 |
  • Color 06
  • 46 |
  • Color 07
  • 47 |
  • Color 08
  • 48 |
  • Color 09
  • 49 |
  • Color 10
  • 50 |
  • Color 11
  • 51 |
  • Color 12
  • 52 |
  • Color 13
  • 53 |
  • Color 14
  • 54 |
  • Color 15
  • 55 |
  • Color 16
  • 56 |
  • Color 17
  • 57 |
  • Color 18
  • 58 |
  • Color 19
  • 59 |
  • Color 20
  • 60 |
  • Color 21
  • 61 |
  • Color 22
  • 62 |
  • Color 23
  • 63 |
  • Color 24
  • 64 |
  • Color 25
  • 65 |
  • Color 26
  • 66 |
  • Color 27
  • 67 |
  • Color 28
  • 68 |
  • Color 29
  • 69 |
  • Color 30
  • 70 |
  • Color 31
  • 71 |
72 | X resolution :8 73 | Y resolution :8 74 |
75 |
76 |
77 | 78 | 79 | 80 |
81 | 82 | 83 | 84 | 85 |
86 |
    87 |
    88 | 302 | 303 | 304 | -------------------------------------------------------------------------------- /rgbcolors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Fork me on GitHub 11 | 27 | 28 |
    29 |

    Rgb Color handling

    30 |

    Select a color and try to darken/lighten it according to a percentage

    31 | 35 |
    36 | Darken factor :0 37 |
    Tint factor :0 38 |
      39 |
    • Color 00
    • 40 |
    • Color 01
    • 41 |
    • Color 02
    • 42 |
    • Color 03
    • 43 |
    • Color 04
    • 44 |
    • Color 05
    • 45 |
    • Color 06
    • 46 |
    • Color 07
    • 47 |
    • Color 08
    • 48 |
    • Color 09
    • 49 |
    • Color 10
    • 50 |
    • Color 11
    • 51 |
    • Color 12
    • 52 |
    • Color 13
    • 53 |
    • Color 14
    • 54 |
    • Color 15
    • 55 |
    • Color 16
    • 56 |
    • Color 17
    • 57 |
    • Color 18
    • 58 |
    • Color 19
    • 59 |
    • Color 20
    • 60 |
    • Color 21
    • 61 |
    • Color 22
    • 62 |
    • Color 23
    • 63 |
    • Color 24
    • 64 |
    • Color 25
    • 65 |
    • Color 26
    • 66 |
    • Color 27
    • 67 |
    • Color 28
    • 68 |
    • Color 29
    • 69 |
    • Color 30
    • 70 |
    • Color 31
    • 71 | 72 |
    73 | 74 | 75 |
    76 |
    77 |
      78 |
    • Color 00
    • 79 |
    • Color 01
    • 80 |
    • Color 02
    • 81 |
    • Color 03
    • 82 |
    • Color 04
    • 83 |
    • Color 05
    • 84 |
    • Color 06
    • 85 |
    • Color 07
    • 86 |
    • Color 08
    • 87 |
    • Color 09
    • 88 |
    • Color 10
    • 89 |
    • Color 11
    • 90 |
    • Color 12
    • 91 |
    • Color 13
    • 92 |
    • Color 14
    • 93 |
    • Color 15
    • 94 |
    • Color 16
    • 95 |
    • Color 17
    • 96 |
    • Color 18
    • 97 |
    • Color 19
    • 98 |
    • Color 20
    • 99 |
    • Color 21
    • 100 |
    • Color 22
    • 101 |
    • Color 23
    • 102 |
    • Color 24
    • 103 |
    • Color 25
    • 104 |
    • Color 26
    • 105 |
    • Color 27
    • 106 |
    • Color 28
    • 107 |
    • Color 29
    • 108 |
    • Color 30
    • 109 |
    • Color 31
    • 110 | 111 |
    112 |
    113 |
    114 |
    115 | 116 | 117 |
    118 | 119 |
    120 |
    121 | 231 | 232 | 233 | -------------------------------------------------------------------------------- /index_sprite_position.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Fork me on GitHub 12 | 13 | 29 | 30 |
    31 |

    Amiga sprite position editor

    32 |

    Draw your sprites position on the left grid and get the binary raw data to load into the Amiga copperlist

    33 | 34 | 35 | 36 | 37 |
    38 | 39 |
      40 |
    • Color 00
    • 41 |
    • Color 01
    • 42 |
    • Color 02
    • 43 |
    • Color 03
    • 44 |
    • Color 04
    • 45 |
    • Color 05
    • 46 |
    • Color 06
    • 47 |
    • Color 07
    • 48 |
    • Color 08
    • 49 |
    • Color 09
    • 50 |
    • Color 10
    • 51 |
    • Color 11
    • 52 |
    • Color 12
    • 53 |
    • Color 13
    • 54 |
    • Color 14
    • 55 |
    • Color 15
    • 56 |
    • Color 16
    • 57 |
    • Color 17
    • 58 |
    • Color 18
    • 59 |
    • Color 19
    • 60 |
    • Color 20
    • 61 |
    • Color 21
    • 62 |
    • Color 22
    • 63 |
    • Color 23
    • 64 |
    • Color 24
    • 65 |
    • Color 25
    • 66 |
    • Color 26
    • 67 |
    • Color 27
    • 68 |
    • Color 28
    • 69 |
    • Color 29
    • 70 |
    • Color 30
    • 71 |
    • Color 31
    • 72 |
    73 |
     74 | 			X: 0
     75 | 			Y: 0
     76 | 			
    77 |
    78 |
    79 |
    80 | 81 | 82 | 83 | 84 |
    85 | 86 | 87 | 88 | 89 | 90 | 91 |
    92 |
      93 |
      94 | 380 | 381 | 382 | -------------------------------------------------------------------------------- /js/UPNG.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var UPNG = {}; 4 | 5 | UPNG.toRGBA8 = function(out) 6 | { 7 | //console.log(out.ctype, out.depth); 8 | var w = out.width, h = out.height, area = w*h, bpp = UPNG.decode._getBPP(out); 9 | var bpl = Math.ceil(w*bpp/8); // bytes per line 10 | 11 | var bf = new Uint8Array(area*4), bf32 = new Uint32Array(bf.buffer); 12 | var data = out.data, ctype = out.ctype, depth = out.depth; 13 | var rs = UPNG._bin.readUshort; 14 | 15 | if (ctype==6) { // RGB + alpha 16 | var qarea = area<<2; 17 | if(depth== 8) for(var i=0; i>3)]>>(7-((i&7)<<0)))& 1), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j>2)]>>(6-((i&3)<<1)))& 3), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j>1)]>>(4-((i&1)<<2)))&15), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j>3]>>(7 -((i&7) )))& 1), al=(gr==tr*255)?0:255; bf32[i]=(al<<24)|(gr<<16)|(gr<<8)|gr; } 48 | if(depth== 2) for(var i=0; i>2]>>(6 -((i&3)<<1)))& 3), al=(gr==tr* 85)?0:255; bf32[i]=(al<<24)|(gr<<16)|(gr<<8)|gr; } 49 | if(depth== 4) for(var i=0; i>1]>>(4 -((i&1)<<2)))&15), al=(gr==tr* 17)?0:255; bf32[i]=(al<<24)|(gr<<16)|(gr<<8)|gr; } 50 | if(depth== 8) for(var i=0; i>8)&255, b=(c>>16)&255; 86 | data[offset+ti+0]=r; data[offset+ti+1]=g; data[offset+ti+2]=b; 87 | } 88 | offset+=dl*3; 89 | bin.writeUint (data,offset,crc(data,offset-dl*3-4,dl*3+4)); offset+=4; // crc 90 | 91 | if(nimg.gotAlpha) { 92 | bin.writeUint (data,offset, dl); offset+=4; 93 | bin.writeASCII(data,offset,"tRNS"); offset+=4; 94 | for(var i=0; i>24)&255; 95 | offset+=dl; 96 | bin.writeUint (data,offset,crc(data,offset-dl-4,dl+4)); offset+=4; // crc 97 | } 98 | } 99 | 100 | var dl = nimg.data.length; 101 | bin.writeUint (data,offset, dl); offset+=4; 102 | bin.writeASCII(data,offset,"IDAT"); offset+=4; 103 | for(var i=0; i>2]; if(plte.length<600 && cmap[c]==null) { cmap[c]=plte.length; plte.push(c); } 123 | if(img[i+3]!=255) gotAlpha = true; 124 | } 125 | var cc=plte.length; 126 | if(cc<=256) { 127 | if(cc<= 2) depth=1; else if(cc<= 4) depth=2; else if(cc<=16) depth=4; else depth=8; 128 | bpl = Math.ceil(depth*w/8), nimg = new Uint8Array(bpl*h); 129 | for(var y=0; y>3)] |= (cmap[img32[ii+x]]<<(7-(x&7) )); 131 | if(depth==2) for(var x=0; x>2)] |= (cmap[img32[ii+x]]<<(6-(x&3)*2)); 132 | if(depth==4) for(var x=0; x>1)] |= (cmap[img32[ii+x]]<<(4-(x&1)*4)); 133 | if(depth==8) for(var x=0; x500000 && (t==2 || t==3 || t==4)) continue; 151 | for(var y=0; y>1) +256)&255; 174 | if(type==4) for(var x=bpp; x>1))&255; 179 | for(var x=bpp; x>1))&255; } 180 | if(type==4) { for(var x= 0; x>> 1); 192 | else c = c >>> 1; 193 | } 194 | tab[n] = c; } 195 | return tab; })(), 196 | update : function(c, buf, off, len) { 197 | for (var i=0; i>> 8); 198 | return c; 199 | }, 200 | crc : function(b,o,l) { return UPNG.crc.update(0xffffffff,b,o,l) ^ 0xffffffff; } 201 | } 202 | 203 | UPNG.quantize = function(img, w, h, ps) 204 | { 205 | var nimg = new Uint8Array(img.length), pind = new Uint16Array(w*h), area=w*h, edist=UPNG.quantize.dist; 206 | for(var i=0; i>1; 214 | for(var i=0; iplim) break; 219 | } 220 | if(plte.length>plim) { pr++; continue; } 221 | break; 222 | } 223 | if(pr==0 && plte.length<=ps) return img; 224 | plte.sort(function(a,b) {return b.occ-a.occ;}); 225 | 226 | ps = Math.min(ps, plte.length); 227 | var nplte = new Uint8Array(ps*4); 228 | for(var i=0; i>1)) {} else 249 | for(var j=0; j>1)) break; 253 | var dst = edist(r,g,b,a,plte,nind[j]<<2); 254 | if(dst<=(ndst[ci]>>1)) { ci=nind[j]; break; } 255 | } 256 | } 257 | pind[i]=ci; hist[ci]++; var qci=ci<<2; 258 | nplt[qci]+=r; nplt[qci+1]+=g; nplt[qci+2]+=b; nplt[qci+3]+=a; 259 | } 260 | for(var i=0; i>3, bpl = Math.ceil(w*bpp/8); 392 | var img = new Uint8Array( h * bpl ); 393 | var di = 0; 394 | 395 | var starting_row = [ 0, 0, 4, 0, 2, 0, 1 ]; 396 | var starting_col = [ 0, 4, 0, 2, 0, 1, 0 ]; 397 | var row_increment = [ 8, 8, 8, 4, 4, 2, 2 ]; 398 | var col_increment = [ 8, 8, 4, 4, 2, 2, 1 ]; 399 | 400 | var pass=0; 401 | while(pass<7) 402 | { 403 | var ri = row_increment[pass], ci = col_increment[pass]; 404 | var sw = 0, sh = 0; 405 | var cr = starting_row[pass]; while(cr>3]; val = (val>>(7-(cdi&7)))&1; 420 | img[row*bpl + (col>>3)] |= (val << (7-((col&3)<<0))); 421 | } 422 | if(bpp==2) { 423 | var val = data[cdi>>3]; val = (val>>(6-(cdi&7)))&3; 424 | img[row*bpl + (col>>2)] |= (val << (6-((col&3)<<1))); 425 | } 426 | if(bpp==4) { 427 | var val = data[cdi>>3]; val = (val>>(4-(cdi&7)))&15; 428 | img[row*bpl + (col>>1)] |= (val << (4-((col&1)<<2))); 429 | } 430 | if(bpp>=8) { 431 | var ii = row*bpl+col*cbpp; 432 | for(var j=0; j>3)+j]; 433 | } 434 | cdi+=bpp; col+=ci; 435 | } 436 | y++; row += ri; 437 | } 438 | if(sw*sh!=0) di += sh * (1 + bpll); 439 | pass = pass + 1; 440 | } 441 | return img; 442 | } 443 | 444 | UPNG.decode._getBPP = function(out) { 445 | var noc = [1,null,3,1,2,null,4][out.ctype]; 446 | if(noc==null) console.log("unsupported color type", ctype); 447 | return noc * out.depth; 448 | } 449 | 450 | UPNG.decode._filterZero = function(data, out, off, w, h) 451 | { 452 | var bpp = UPNG.decode._getBPP(out), bpl = Math.ceil(w*bpp/8), paeth = UPNG.decode._paeth; 453 | bpp = Math.ceil(bpp/8); 454 | 455 | for(var y=0; y>1) )&255; 468 | if(type==4) for(var x=bpp; x>1))&255; 474 | for(var x=bpp; x>1) )&255; } 475 | 476 | if(type==4) { for(var x= 0; x>8)&255; buff[p+1] = n&255; }, 507 | readUint : function(buff,p) { return (buff[p]*(256*256*256)) + ((buff[p+1]<<16) | (buff[p+2]<< 8) | buff[p+3]); }, 508 | writeUint : function(buff,p,n){ buff[p]=(n>>24)&255; buff[p+1]=(n>>16)&255; buff[p+2]=(n>>8)&255; buff[p+3]=n&255; }, 509 | readASCII : function(buff,p,l){ var s = ""; for(var i=0; i 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Fork me on GitHub 12 | 13 | 29 | 30 |
      31 |

      Raw 2 planar viewer

      32 |

      Upload here your raw file containing bitplanes data. 33 | Each bitplane must be not interleaved. 34 | After loading you should see which pixel are turned on into the Amiga planar screen

      35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 |
      43 | 44 | 45 | Bitplanes :2 46 |
        47 |
      • Color 00
      • 48 |
      • Color 01
      • 49 |
      • Color 02
      • 50 |
      • Color 03
      • 51 |
      • Color 04
      • 52 |
      • Color 05
      • 53 |
      • Color 06
      • 54 |
      • Color 07
      • 55 |
      • Color 08
      • 56 |
      • Color 09
      • 57 |
      • Color 10
      • 58 |
      • Color 11
      • 59 |
      • Color 12
      • 60 |
      • Color 13
      • 61 |
      • Color 14
      • 62 |
      • Color 15
      • 63 |
      • Color 16
      • 64 |
      • Color 17
      • 65 |
      • Color 18
      • 66 |
      • Color 19
      • 67 |
      • Color 20
      • 68 |
      • Color 21
      • 69 |
      • Color 22
      • 70 |
      • Color 23
      • 71 |
      • Color 24
      • 72 |
      • Color 25
      • 73 |
      • Color 26
      • 74 |
      • Color 27
      • 75 |
      • Color 28
      • 76 |
      • Color 29
      • 77 |
      • Color 30
      • 78 |
      • Color 31
      • 79 |
      80 |
       81 | 			X: 0
       82 | 			Y: 0
       83 | 			
      84 | 85 |
      86 | Color 1: 96 |
      Color 2: 106 |
      107 |
      Swap palette colors also 108 | X RES : 109 | Y RES : 110 | 111 |
      112 |
      113 |
      114 |
      115 | 120 |
        121 |
        122 | 534 | 535 | 536 | -------------------------------------------------------------------------------- /index_sprite.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Fork me on GitHub 11 | 27 | 28 |
        29 |

        Amiga sprite editor

        30 |

        Draw your sprite on the left grid and get the binary raw data to load into the Amiga copperlist

        31 | 32 | 33 | 34 | 35 | 39 |
        40 | 41 | 42 | 43 | 44 | Bitplanes :5 45 |
          46 |
        • Color 16
        • 47 |
        • Color 17
        • 48 |
        • Color 18
        • 49 |
        • Color 19
        • 50 |
        • Color 20
        • 51 |
        • Color 21
        • 52 |
        • Color 22
        • 53 |
        • Color 23
        • 54 |
        • Color 24
        • 55 |
        • Color 25
        • 56 |
        • Color 26
        • 57 |
        • Color 27
        • 58 |
        • Color 28
        • 59 |
        • Color 29
        • 60 |
        • Color 30
        • 61 |
        • Color 31
        • 62 |
        63 | X resolution :8 64 | Y resolution :8 65 |
        66 | Color 1: 72 |
        Color 2: 78 |
        79 |
        Swap palette colors also 80 |
        81 |
        82 |
        83 |
        84 | 85 | 86 | 87 | 88 |
        89 | 90 | 91 | 92 | 93 |
        94 |
          95 |
          96 | 687 | 688 | 689 | --------------------------------------------------------------------------------