From 36a5ca52124e0729239f09e0fad38a3a52b4419f Mon Sep 17 00:00:00 2001 From: d_m Date: Sun, 29 Oct 2023 00:27:19 -0400 Subject: [PATCH] Improve comments a bit. --- icn_to_bmp.tal | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/icn_to_bmp.tal b/icn_to_bmp.tal index efc4afb..646a0f4 100644 --- a/icn_to_bmp.tal +++ b/icn_to_bmp.tal @@ -137,16 +137,19 @@ STH2r STA JMP2r ( ; addr+2<-r ) @write-header ( -> ) + ( NOTE: you'll see some swaps just before stores ) + ( this is because the BMP header uses a little-endian byte order ) .adj-tile-w LDZ2 .tile-h LDZ2 MUL2 ( aw*h ) #30 SFT2 #0020 ADD2 ( 32+aw*h*8 ) - SWP ;bmp-header/total-size STA2 - .tile-h LDZ2 #30 SFT2 SWP ;bmp-header/pixel-h STA2 ( ) - .tile-w LDZ2 #30 SFT2 SWP ;bmp-header/pixel-w STA2 ( ) + SWP ;bmp-header/total-size STA2 ( ; write total-size ) + .tile-h LDZ2 #30 SFT2 SWP ;bmp-header/pixel-h STA2 ( ; write height ) + .tile-w LDZ2 #30 SFT2 SWP ;bmp-header/pixel-w STA2 ( ; write width ) ( these colors are specified in RGB order ) - #ff #ff #ff ;bmp-header/color0 write-color - #00 #00 #00 ;bmp-header/color1 write-color + #ff #ff #ff ;bmp-header/color0 write-color ( ; write color 0 ) + #00 #00 #00 ;bmp-header/color1 write-color ( ; write color 1 ) + ( actually write out the BMP header now ) .out-file LDZ2 .File2/name DEO2 #0020 .File2/len DEO2 ;bmp-header .File2/w DEO2 @@ -179,5 +182,5 @@ &color1 00 00 00 ( 29: color 1, blue/green/red MOD ) ( 32: start of pixel data MOD ) -@bmp-buf $7f8 -@icn-dat $c000 ( 48k ) +@bmp-buf $7f8 ( 2040 bytes: buffer for one BMP row ) +@icn-dat $c000 ( 49152 bytes: buffer for the entire ICN file )