$ErrorActionPreference='Stop' Add-Type -AssemblyName System.Drawing $src=[Drawing.Image]::FromFile('C:\Users\tilar\.codex\generated_images\01a18c54-cbcf-72e0-985c-3c5d721eb505\exec-8c844b57-8586-4f14-9cd4-3035f1ad4f34.png') $dst=[Drawing.Bitmap]::new(1280,1024) $g=[Drawing.Graphics]::FromImage($dst) $g.InterpolationMode=[Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic $g.DrawImage($src,0,0,1280,1024) $png='C:\Amiga\HD0\Prefs\Presets\Amiga-Amber-1280x1024.png' $dst.Save($png,[Drawing.Imaging.ImageFormat]::Png) $g.Dispose();$dst.Dispose();$src.Dispose() Copy-Item $png 'C:\Users\tilar\Documents\Codex\2026-10-30\c\outputs\Amiga-Amber-1280x1024.png' Add-Type -ReferencedAssemblies System.Drawing -TypeDefinition @' using System;using System.IO;using System.Drawing; public class ThemeIFF{ static void U16(BinaryWriter w,int x){w.Write((byte)(x>>8));w.Write((byte)x);} static void U32(BinaryWriter w,int x){w.Write((byte)(x>>24));w.Write((byte)(x>>16));w.Write((byte)(x>>8));w.Write((byte)x);} static void Tag(BinaryWriter w,string s){w.Write(System.Text.Encoding.ASCII.GetBytes(s));} public static void Save(string input,string output){using(var b=new Bitmap(input))using(var f=File.Create(output))using(var w=new BinaryWriter(f)){int row=((b.Width+15)/16)*2,size=row*b.Height*24;Tag(w,"FORM");U32(w,4+28+8+size);Tag(w,"ILBM");Tag(w,"BMHD");U32(w,20);U16(w,b.Width);U16(w,b.Height);U16(w,0);U16(w,0);w.Write(new byte[]{24,0,0,0});U16(w,0);w.Write(new byte[]{1,1});U16(w,b.Width);U16(w,b.Height);Tag(w,"BODY");U32(w,size);for(int y=0;y>(x%8));}w.Write(data);}}}} } '@ [ThemeIFF]::Save($png,'C:\Amiga\HD0\Prefs\Presets\Amiga-Amber-1280x1024.iff') function Put16($b,$o,$v){$b[$o]=[byte](($v-shr 8)-band 255);$b[$o+1]=[byte]($v-band 255)} function Put32($b,$o,$v){$b[$o]=[byte](($v-shr 24)-band 255);$b[$o+1]=[byte](($v-shr 16)-band 255);$b[$o+2]=[byte](($v-shr 8)-band 255);$b[$o+3]=[byte]($v-band 255)} function U32($b,$o){return [long]$b[$o]*16777216+[long]$b[$o+1]*65536+[long]$b[$o+2]*256+$b[$o+3]} # Keep the existing pattern behavior, replace only the pathname and chunk lengths. $p='C:\Amiga\HD0\Prefs\Env-Archive\Sys\WBPattern.prefs';$old=[IO.File]::ReadAllBytes($p) $name=[Text.Encoding]::ASCII.GetBytes('HD0:Prefs/Presets/Amiga-Amber-1280x1024.iff'+[char]0) $len=58+$name.Length;$b=[byte[]]::new($len+($len%2));[Array]::Copy($old,$b,58);[Array]::Copy($name,0,$b,58,$name.Length) Put32 $b 4 ($b.Length-8);Put32 $b 30 ($len-34);Put16 $b 56 $name.Length [IO.File]::WriteAllBytes($p,$b) # PalettePrefs PALT: 16 reserved bytes, 32 four-color pens, 32 eight-color pens, ColorSpec table. $b=[IO.File]::ReadAllBytes('C:\Users\Public\Documents\Amiga Files\Shared\dir\System\Prefs\Env-Archive\Sys\palette.prefs') $colors=@('34322C','E4D5B5','8B8170','68431C','151410','FFBC55','B88A49','C0B29A') for($i=0;$i-lt 8;$i++){for($c=0;$c-lt 3;$c++){$v=[Convert]::ToInt32($colors[$i].Substring($c*2,2),16)*257;Put16 $b (178+$i*8+2+$c*2) $v}} $pens=@(4,1,1,2,4,3,1,0,5,1,0,4) for($i=0;$i-lt $pens.Count;$i++){Put16 $b (114+$i*2) $pens[$i]} [IO.File]::WriteAllBytes('C:\Amiga\HD0\Prefs\Env-Archive\Sys\Palette.prefs',$b) function Position($path,$x,$y){$b=[IO.File]::ReadAllBytes($path);Put32 $b 58 $x;Put32 $b 62 $y;[IO.File]::WriteAllBytes($path,$b)} Position 'C:\Amiga\HD0\Disk.info' 20 24 Position 'C:\Amiga\Share\Disk.info' 20 132 Position 'C:\Amiga\WHDLoad\Disk.info' 20 240 Position 'C:\Amiga\HD0\WookieChat_OS3.info' 150 24 Position 'C:\Amiga\HD0\Utilities\Clock.info' 150 132 Position 'C:\Amiga\HD0\Utilities\HippoPlayer\HiP.info' 150 240 # Update Clock's native tooltypes while retaining its icon graphics and extended data. $p='C:\Amiga\HD0\Utilities\Clock.info';$b=[IO.File]::ReadAllBytes($p);$o=78 if((U32 $b 66)-ne 0){$o+=56} foreach($ptr in @(22,26)){if((U32 $b $ptr)-ne 0){do{$w=$b[$o+4]*256+$b[$o+5];$h=$b[$o+6]*256+$b[$o+7];$d=$b[$o+8]*256+$b[$o+9];$next=(U32 $b ($o+16))-ne 0;$o+=20+([int][Math]::Ceiling($w/16))*2*$h*$d}while($next)}} if((U32 $b 50)-ne 0){$o+=4+(U32 $b $o)} $start=$o;$types=@() if((U32 $b 54)-ne 0){$count=(U32 $b $o)/4-1;$o+=4;for($i=0;$i-lt $count;$i++){$l=U32 $b $o;$o+=4;$types+=[Text.Encoding]::GetEncoding(28591).GetString($b,$o,$l).TrimEnd([char]0);$o+=$l}} $types=@($types|Where-Object {$_ -notmatch '^\(?(DIGITAL|ANALOG|24HOUR|SECONDS|DATE|LEFT|TOP|WIDTH|HEIGHT)(=|\)|$)'})+@('DIGITAL','24HOUR','SECONDS','LEFT=1040','TOP=28','WIDTH=220','HEIGHT=56') $ms=[IO.MemoryStream]::new();$ms.Write($b,0,$start) $tmp=[byte[]]::new(4);Put32 $tmp 0 (($types.Count+1)*4);$ms.Write($tmp,0,4) foreach($type in $types){$s=[Text.Encoding]::GetEncoding(28591).GetBytes($type+[char]0);Put32 $tmp 0 $s.Length;$ms.Write($tmp,0,4);$ms.Write($s,0,$s.Length)} $ms.Write($b,$o,$b.Length-$o);$out=$ms.ToArray();$ms.Dispose();Put32 $out 54 1;[IO.File]::WriteAllBytes($p,$out) # A single desktop widget, delayed until IPrefs has completed the screen setup. [IO.File]::WriteAllText('C:\Amiga\HD0\S\Amber-Desktop',"Wait 6 SECS`nRun >NIL: SYS:Utilities/Clock DIGITAL 24HOUR SECONDS LEFT=1040 TOP=28 WIDTH=220 HEIGHT=56`n",[Text.Encoding]::ASCII) $p='C:\Amiga\HD0\S\Startup-Sequence';$s=[IO.File]::ReadAllText($p) if($s-notmatch 'Execute S:Amber-Desktop'){$s=$s.Replace('C:LoadWB',"C:LoadWB`nRun >NIL: Execute S:Amber-Desktop")} [IO.File]::WriteAllText($p,$s,[Text.Encoding]::ASCII) Write-Output 'Wallpaper IFF/PNG, palette, desktop positions and digital clock configured.'