<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.sizecoding.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dresdenboy</id>
		<title>SizeCoding - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://www.sizecoding.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dresdenboy"/>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/wiki/Special:Contributions/Dresdenboy"/>
		<updated>2026-05-02T01:27:35Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.0</generator>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=X68000&amp;diff=1692</id>
		<title>X68000</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=X68000&amp;diff=1692"/>
				<updated>2025-06-04T09:48:32Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: additional book resource&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Sharp X68000 ==&lt;br /&gt;
The Sharp X68000 is a home computer created by Sharp Corporation. It was first released in 1987 and sold only in Japan.&lt;br /&gt;
&lt;br /&gt;
The initial model has a 10 MHz Motorola 68000 CPU, 1 MB of RAM, and lacks a hard drive. The final model was released in 1993 with a 25 MHz Motorola 68030 CPU, 4 MB of RAM, and optional 80 MB SCSI hard drive. RAM in these systems is expandable to 12 MB, though most games and applications do not require more than 2 MB.&lt;br /&gt;
&lt;br /&gt;
The X68000 has graphics hardware similar to arcade video games of the late-1980s, with custom coprocessors supporting scrolling, tiled backgrounds, and large numbers of sprites. Sound is supplied through multiple sound chips supporting 8 channels of FM synthesis and one channel of adaptive differential pulse-code modulation audio, which are mixed down to 2 analog stereo channels via a DAC chip. As such, video gaming was a major use of the X68000. &lt;br /&gt;
&lt;br /&gt;
The X68000 runs an operating system called Human68k which was developed for Sharp by Hudson Soft. An MS-DOS-workalike, Human68k features English-based commands very similar to those in MS-DOS;&lt;br /&gt;
&lt;br /&gt;
=== Setting up ===&lt;br /&gt;
* Assembler: VASM&lt;br /&gt;
* Tools: NDC to create an XDF Disk Image containing the production&lt;br /&gt;
* Emulator(s): http://retropc.net/pi/xm6/index.html , https://www.retrostic.com/emulators/sharp-x68000/winx68030&lt;br /&gt;
&lt;br /&gt;
=== Memory map ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
address 	vector 	Function 	&lt;br /&gt;
$000000 	$00 	SSP after reset 	&lt;br /&gt;
$000004 	$01 	PC after reset 	&lt;br /&gt;
$000008 	$02 	Bus error 	&lt;br /&gt;
$00000c 	$03 	Address error 	&lt;br /&gt;
$000010 	$04 	Unknown instruction 	&lt;br /&gt;
$000014 	$05 	Division by 0 	&lt;br /&gt;
$000018 	$06 	CHK instruction 	&lt;br /&gt;
$00001c 	$07 	TRAPV instruction, FTRAPcc instruction 	&lt;br /&gt;
$000020 	$08 	Privilege violation 	&lt;br /&gt;
$000024 	$09 	Trace exception 	&lt;br /&gt;
$000028 	$0a 	Unsupported instruction line 1010 emulator (SX call) 	&lt;br /&gt;
$00002c 	$0b 	? line 1111 emulator (DOS call, floating point operation) 	&lt;br /&gt;
$000030 	$0c 	Unused 	&lt;br /&gt;
$000034 	$0d 	FPU ????????????????? 	&lt;br /&gt;
$000038 	$0e 	? ????????????? 	&lt;br /&gt;
$000034 	$0d 	FPU Protocol violation exception handling 	&lt;br /&gt;
$000038 	$0e   	Formatting error exception handling 	&lt;br /&gt;
$00003c 	$0f 	Uninitialized Interrupt 	&lt;br /&gt;
$000040 	$10 	Unused 	&lt;br /&gt;
$000044 	$11 	? 	&lt;br /&gt;
$000048 	$12 	? 	&lt;br /&gt;
$00004c 	$13 	? 	&lt;br /&gt;
$000050 	$14 	? 	&lt;br /&gt;
$000054 	$15 	? 	&lt;br /&gt;
$000058 	$16 	? 	&lt;br /&gt;
$00005c 	$17 	? 	&lt;br /&gt;
$000060 	$18 	Spurious Interrupt 	&lt;br /&gt;
$000064 	$19 	Level 1 Interrupt (auto vector) 	&lt;br /&gt;
$000068 	$1a 	? 	&lt;br /&gt;
$00006c 	$1b 	? 	&lt;br /&gt;
$000070 	$1c 	? 	&lt;br /&gt;
$000074 	$1d 	? 	&lt;br /&gt;
$000078 	$1e 	? 	&lt;br /&gt;
$00007c 	$1f 	? 	&lt;br /&gt;
$000080 	$20 	trap #0 	&lt;br /&gt;
$000084 	$21 	? #1 	&lt;br /&gt;
$000088 	$22 	? #2 	&lt;br /&gt;
$00008c 	$23 	? #3 	&lt;br /&gt;
$000090 	$24 	? #4 	&lt;br /&gt;
$000094 	$25 	? #5 	&lt;br /&gt;
$000098 	$26 	? #6 	&lt;br /&gt;
$00009c 	$27 	? #7 	&lt;br /&gt;
$0000a0 	$28 	? #8 (reserved for system) 	&lt;br /&gt;
$0000a4 	$29 	? #9 (OS debugger) 	&lt;br /&gt;
$0000a8 	$2a 	? #10 (reset &amp;amp; power off) 	&lt;br /&gt;
$0000ac 	$2b 	? #11 (BREAK key) 	&lt;br /&gt;
$0000b0 	$2c 	? #12 (COPY key) 	&lt;br /&gt;
$0000b4 	$2d 	? #13 (CTRL+C) 	&lt;br /&gt;
$0000b8 	$2e 	? #14 (error processing) 	&lt;br /&gt;
$0000bc 	$2f 	? #15 (IOCS call) 	&lt;br /&gt;
$0000c0 	$30 	FPU BSUN 	&lt;br /&gt;
$0000c0 	$30 	FPU BSUN 	&lt;br /&gt;
$0000c4 	$31 	? INEX1,INEX2 	&lt;br /&gt;
$0000c8 	$32 	? DZ 	&lt;br /&gt;
$0000cc 	$33 	? UNFL 	&lt;br /&gt;
$0000d0 	$34 	? OPERR 	&lt;br /&gt;
$0000d4 	$35 	? OVFL 	&lt;br /&gt;
$0000d8 	$36 	? SNAN 	&lt;br /&gt;
$0000dc 	$37 	??? 	&lt;br /&gt;
$0000dc 	$37 	Unused 	&lt;br /&gt;
$0000e0 	$38 	MMU 	&lt;br /&gt;
$0000e4 	$39 	? 	&lt;br /&gt;
$0000e8 	$3a 	? 	&lt;br /&gt;
$0000ec 	$3b 	Unused 	&lt;br /&gt;
$0000fc 	$3f 	Unused 	&lt;br /&gt;
$000100 	$40 	MFP RTC Alarm/1Hz 	&lt;br /&gt;
$000104 	$41 	MFP External power OFF 	&lt;br /&gt;
$000118 	$42 	MFP Front switch OFF 	&lt;br /&gt;
$00010c 	$43 	MFP FM Audio source 	&lt;br /&gt;
$000110 	$44 	MFP Timer-D (Used with BG processing) 	&lt;br /&gt;
$000114 	$45 	MFP Timer-C (Mouse/cursor/FDD control, etc.) 	&lt;br /&gt;
$000118 	$46 	MFP V-DISP 	&lt;br /&gt;
$00011c 	$47 	MFP RTC Clock 	&lt;br /&gt;
$000120 	$48 	MFP Timer-B 	&lt;br /&gt;
$000124 	$49 	MFP Key serial output error 	&lt;br /&gt;
$000128 	$4a 	MFP Key serial output empty 	&lt;br /&gt;
$00012c 	$4b 	MFP Key serial input error 	&lt;br /&gt;
$000130 	$4c 	MFP Key serial input 	&lt;br /&gt;
$000134 	$4d 	MFP Timer-A 	&lt;br /&gt;
$000138 	$4e 	MFP CRTC*IRQ 	&lt;br /&gt;
$00013c 	$4f 	MFP H-SYNC 	&lt;br /&gt;
$000140 	$50 	SCC(B) Transmission buffer empty 	&lt;br /&gt;
$000144 	$51 	SCC(B) '' 	&lt;br /&gt;
$000148 	$52 	SCC(B) External/status changes 	&lt;br /&gt;
$00014c 	$53 	SCC(B) '' 	&lt;br /&gt;
$000150 	$54 	SCC(B) Incoming character validity (Mouse 1 byte input) 	&lt;br /&gt;
$000154 	$55 	SCC(B) '' 	&lt;br /&gt;
$000158 	$56 	SCC(B) Special Rx condition 	&lt;br /&gt;
$00015c 	$57 	SCC(B) '' 	&lt;br /&gt;
$000160 	$58 	SCC(A) Transmission buffer empty 	&lt;br /&gt;
$000164 	$59 	SCC(A) '' 	&lt;br /&gt;
$000168 	$5a 	SCC(A) External status changes 	&lt;br /&gt;
$00016c 	$5b 	SCC(A) '' 	&lt;br /&gt;
$000170 	$5c 	SCC(A) Incoming character validity (RS-232C 1 byte input) 	&lt;br /&gt;
$000174 	$5d 	SCC(A) '' 	&lt;br /&gt;
$000178 	$5e 	SCC(A) Special Rx Condition 	&lt;br /&gt;
$00017c 	$5f 	SCC(A) '' 	&lt;br /&gt;
$000180 	$60 	I/O FDC status interruption 	&lt;br /&gt;
$000184 	$61 	I/O FDC insertion/discharge interruption 	&lt;br /&gt;
$000188 	$62 	I/O HDC status interruption 	&lt;br /&gt;
$00018c 	$63 	I/O Printer ready interruption 	&lt;br /&gt;
$000190 	$64 	DMAC #0 End (FDD) 	&lt;br /&gt;
$000194 	$65 	DMAC #0 Error ('') 	&lt;br /&gt;
$000198 	$66 	DMAC #1 End (SASI) 	&lt;br /&gt;
$00019c 	$67 	DMAC #1 Error ('') 	&lt;br /&gt;
$0001a0 	$68 	DMAC #2 End (IOCS _DMAMOVE,_DMAMOV_A,_DMAMOV_L) 	&lt;br /&gt;
$0001a4 	$69 	DMAC #2 Error ('') 	&lt;br /&gt;
$0001a8 	$6a 	DMAC #3 End (ADPCM) 	&lt;br /&gt;
$0001ac 	$6b 	DMAC #3 Error ('') 	&lt;br /&gt;
$000200 	$6c 	SPC SCSI interruption (Internal SCSI) 	&lt;br /&gt;
$000204 	$6d 	Unused 	&lt;br /&gt;
$0003d4 	$f5 	Unused 	&lt;br /&gt;
$0003d8 	$f6 	SPC SCSI interruption (SCSI board) 	&lt;br /&gt;
$0003dc 	$f7 	Unused 	&lt;br /&gt;
$0003fc 	$ff 	Unused 	&lt;br /&gt;
0x000000 	RAM area 	&lt;br /&gt;
$c00000 	Graphics Vram � Page 0 	&lt;br /&gt;
$c80000 	Graphics Vram � Page 1 (256/16 color only) 	&lt;br /&gt;
$d00000 	Graphics Vram � Page 2 (16 color only)&lt;br /&gt;
$d80000 	Graphics Vram � Page 3 (16 color only) 	&lt;br /&gt;
$e00000 	Text Vram � Bitplane 0 	&lt;br /&gt;
$e20000 	Text Vram � Bitplane 1&lt;br /&gt;
$e40000 	Text Vram � Bitplane 2&lt;br /&gt;
$e60000 	Text Vram � Bitplane 3&lt;br /&gt;
$e80000 	1.w 	R00 Horizontal total 	&lt;br /&gt;
$e80002 	1.w 	R01 Horizontal synchronization end position timing 	&lt;br /&gt;
$e80004 	1.w 	R02 Horizontal display start position 	&lt;br /&gt;
$e80006 	1.w 	R03 Horizontal display end position 	&lt;br /&gt;
$e80008 	1.w 	R04 Vertical total 	&lt;br /&gt;
$e8000a 	1.w 	R05 Vertical synchronization end position timing 	&lt;br /&gt;
$e8000c 	1.w 	R06 Vertical display start position 	&lt;br /&gt;
$e8000e 	1.w 	R07 Vertical display end position 	&lt;br /&gt;
$e80010 	1.w 	R08 External synchronization horizontal adjust: Horizontal position tuning 	&lt;br /&gt;
$e80012 	1.w 	R09 Raster number: Used for raster interruption 	&lt;br /&gt;
$e80014 	1.w 	R10 Text Screen X coordinate 	&lt;br /&gt;
$e80016 	1.w 	R11 Text Screen Y coordinate 	&lt;br /&gt;
$e80018 	1.w 	R12 Graphics screen Scroll X0 	&lt;br /&gt;
$e8001a 	1.w 	R13 Graphics screen Scroll Y0 	&lt;br /&gt;
$e8001c 	1.w 	R14 Graphics screen Scroll X1 	&lt;br /&gt;
$e8001e 	1.w 	R15 Graphics screen Scroll Y1 	&lt;br /&gt;
$e80020 	1.w 	R16 Graphics screen Scroll X2 	&lt;br /&gt;
$e80022 	1.w 	R17 Graphics screen Scroll Y2 	&lt;br /&gt;
$e80024 	1.w 	R18 Graphics screen Scroll X3 	&lt;br /&gt;
$e80026 	1.w 	R19 Graphics screen Scroll Y3 	&lt;br /&gt;
$e80028 	1.w 	R20 Memory mode/Display mode control 	&lt;br /&gt;
$e8002a 	1.w 	R21 Simultaneous access/Raster copy/Quick clear plane select 	&lt;br /&gt;
$e8002c 	1.w 	R22 Raster copy action: Raster number 	&lt;br /&gt;
$e8002e 	1.w 	R23 Text screen access mask pattern 	&lt;br /&gt;
$e80481 	1.b 	Active Image capture/Quick clear/Raster copy control 	&lt;br /&gt;
$e82000 	256.w 	Graphics palette 	&lt;br /&gt;
$e82200 	16.w 	Text palette (Palette block 0) 	&lt;br /&gt;
$e82220 	240.w 	Sprite palette ('' 1-15) 	&lt;br /&gt;
$e82400 	1.w 	R0 (Screen mode initialization) 	&lt;br /&gt;
$e82500 	1.w 	R1 (Priority control) 	&lt;br /&gt;
$e82600 	1.w 	R2 (Special priority/screen display) - Layers On/Off&lt;br /&gt;
$e84000 	DMAC (HD63450) 	&lt;br /&gt;
$e86000 	Memory controller privileged access settings (OHM/ASA) 	&lt;br /&gt;
$e88000 	MFP (MC68901) 	&lt;br /&gt;
$e8a000 	RTC (RP5C15) 	&lt;br /&gt;
$e8c000 	Printer port 	&lt;br /&gt;
$e8e001 	#1 Contrast 	&lt;br /&gt;
$e8e003 	#2 Display/3D Shutter Glasses (Bit 0=Right Eye / Bit 1 = Left Eye)&lt;br /&gt;
$e8e005 	#3 Color image unit (bit 4-0) 	&lt;br /&gt;
$e8e007 	#4 Keyboard/NMI/dot clock 	&lt;br /&gt;
$e8e009 	#5 ROM/DRAM Wait 	&lt;br /&gt;
$e8e00b 	#6 MPU Classification/Operation clock 	&lt;br /&gt;
$e8e00d 	#7 SRAM Write 	&lt;br /&gt;
$e8e00f 	#8 Unit power OFF 	&lt;br /&gt;
$E90001 	FM Synthesizer (YM2151) - Register Address Write port 	&lt;br /&gt;
$E90003 	FM Synthesizer (YM2151) - Data R/W port 	&lt;br /&gt;
$E92000 	ADPCM (MSM6258V) 	&lt;br /&gt;
$E94000 	Floppy disk controller (FDC) (uPD72065) 	&lt;br /&gt;
$E94005 	Floppy drive monitor (IOSC) 	&lt;br /&gt;
$E96000 	SASI 	&lt;br /&gt;
$E98000 	ESCC (Z8530) 	&lt;br /&gt;
$E9A000 	PPI (82C55) 	&lt;br /&gt;
$E9C000 	I/O selector (IOSC) 	&lt;br /&gt;
$E9E000 	I/O expansion area (Sharp reserved) 	&lt;br /&gt;
$EB0000 	Sprite register (CYNTHIA) 	&lt;br /&gt;
$EB8000 	Sprite VRAM 	&lt;br /&gt;
$EC0000 	I/O expansion area (User) 	&lt;br /&gt;
$ed0072 	2.b 	SX-Window environment flag (While in use with &amp;quot;SX&amp;quot;) 	&lt;br /&gt;
$ed0074 	1.b 	Standard double-click time / 10 	&lt;br /&gt;
$ed0075 	1.b 	Mouse speed / 2 	&lt;br /&gt;
$ed0076 	1.b 	Text palette hue (HSV) 	&lt;br /&gt;
$ed0077 	1.b 	&lt;br /&gt;
$ed0078 	1.b 	Brightness palette 0-3 5bit??? 	&lt;br /&gt;
$ed007b 	1.b 	Printer drive (PRTD) ID 	&lt;br /&gt;
$ed007c 	1.b 	SRAM info version#, screen status storage, start screen storage 	&lt;br /&gt;
$ed007d 	1.b 	Desktop background (PICT) ID 	&lt;br /&gt;
$ed007e 	1.b 	Screen mode 	&lt;br /&gt;
$ed007f 	17.b 	Reserved for system use (X68030) 	&lt;br /&gt;
$ed0090 	1.b 	Standard cache status (bit=0: off 1:on) 	&lt;br /&gt;
$ed0091 	1.b 	OPM music during startup (0: OFF -1: ON) 	&lt;br /&gt;
$ed0092 	1.b 	10MHz Proper wait value 	&lt;br /&gt;
$ed0093 	1.b 	16MHz '' 	&lt;br /&gt;
$ed0094 	108.b 	Reserved for system use 	&lt;br /&gt;
$ed0100 	768.b 	Head SRAM program address 	&lt;br /&gt;
$ed0400 	15KB 	Head SRAMDISK address 	&lt;br /&gt;
$ed3fff 	End of SRAM 	&lt;br /&gt;
$ed4000 	Backup (64KB) 	&lt;br /&gt;
$ee0000 	Unused (128KB) 	&lt;br /&gt;
$f00000 	CGROM(768KB) 	&lt;br /&gt;
$fc0000 	SCSI IOCS / IPL(8KB) 	&lt;br /&gt;
$fe0000 	ROM Debugger 	&lt;br /&gt;
$ff0000 	IPL / ROM IOCS&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Video display ===&lt;br /&gt;
To be added&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Vsync ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
waitVBlank:&lt;br /&gt;
    move.w $e88000,d0&lt;br /&gt;
    and.w #%00010000,d0            ;Wait for vblank to start&lt;br /&gt;
    beq waitVBlank&lt;br /&gt;
waitVBlank2:   &lt;br /&gt;
    move.w $e88000,d0&lt;br /&gt;
    and.w #%00010000,d0            ;Wait for Vblank to end&lt;br /&gt;
    bne waitVBlank2&lt;br /&gt;
    rts&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Plotting to screen ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
To be added&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&lt;br /&gt;
&lt;br /&gt;
The X68000 has a YM2151 FM Soundchip on board with 8 channels.&lt;br /&gt;
Each channel's sound can be built up with 4 different 'slots'... meaning there are a total of 32 slots... these slots are turned on or off when the sound is triggered&lt;br /&gt;
&lt;br /&gt;
For more information, check out the YM2151 specs at [https://msxpro.com/datasheet.html]&lt;br /&gt;
&lt;br /&gt;
=== Additional Resources ===&lt;br /&gt;
* [https://www.chibiakumas.com/68000/x68000.php Assembly programming for the X68000]&lt;br /&gt;
* [https://archive.org/details/X68000_488] X68000 Technical data book&lt;br /&gt;
* [https://msxpro.com/datasheet.html] YM2151 Datasheet&lt;br /&gt;
* [https://demozoo.org/productions/tagged/x68000/ X68000 demoscene productions]&lt;br /&gt;
* [https://archive.org/details/cpsystem/page/202/mode/2up X68000 chapter in the book &amp;quot;The Book of CP-System&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Compression&amp;diff=1352</id>
		<title>Compression</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Compression&amp;diff=1352"/>
				<updated>2024-03-13T07:19:25Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: /* Available tools */ corrected description of pakettic features&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page covers compression related topics. This involves information about available tools on different platforms, platforms with compression support, compression algorithms and related decompression routines suited for the use in sizecoding, and ways to adapt code for better compression on different platform.&lt;br /&gt;
&lt;br /&gt;
==Available tools==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Platform !! Features !! Link&lt;br /&gt;
|-&lt;br /&gt;
| '''Pakettic''' || '''[[TIC-80]]''' || &lt;br /&gt;
* metaheuristics based optimization of source code (e.g. names, operands, independent lines based on hints)&lt;br /&gt;
* applies known shorter code variants (e.g. function TIC -&amp;gt; TIC=load&amp;quot;...&amp;quot;)&lt;br /&gt;
* optimization hints&lt;br /&gt;
* Zopfli based Deflate compression optimization&lt;br /&gt;
 || https://github.com/vsariola/pakettic/&lt;br /&gt;
|-&lt;br /&gt;
| '''tic-tool''' || '''[[TIC-80]]''' ||&lt;br /&gt;
* variable name optimization&lt;br /&gt;
* live heatmap of compressed source code to help identifying code parts, where changing the code might help&lt;br /&gt;
 || https://github.com/exoticorn/tic-tool&lt;br /&gt;
|-&lt;br /&gt;
| '''pactic''' || '''[[TIC-80]]''' || TBD || https://github.com/phlubby/pactic&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Platforms with compression==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==Compression algorithms suited for sizecoded productions==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==Decompression routines and related resources==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==Code optimization for better compression==&lt;br /&gt;
TBD&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Compression&amp;diff=1350</id>
		<title>Compression</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Compression&amp;diff=1350"/>
				<updated>2024-03-10T16:09:07Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: Initial page on compression&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page covers compression related topics. This involves information about available tools on different platforms, platforms with compression support, compression algorithms and related decompression routines suited for the use in sizecoding, and ways to adapt code for better compression on different platform.&lt;br /&gt;
&lt;br /&gt;
==Available tools==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Platform !! Features !! Link&lt;br /&gt;
|-&lt;br /&gt;
| '''Pakettic''' || '''[[TIC-80]]''' || &lt;br /&gt;
* ML based optimization of source code&lt;br /&gt;
* optimization hints&lt;br /&gt;
* Zopfli based&lt;br /&gt;
 || https://github.com/vsariola/pakettic/&lt;br /&gt;
|-&lt;br /&gt;
| '''tic-tool''' || '''[[TIC-80]]''' ||&lt;br /&gt;
* variable name optimization&lt;br /&gt;
* live heatmap of compressed source code to help identifying code parts, where changing the code might help&lt;br /&gt;
 || https://github.com/exoticorn/tic-tool&lt;br /&gt;
|-&lt;br /&gt;
| '''pactic''' || '''[[TIC-80]]''' || TBD || https://github.com/phlubby/pactic&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Platforms with compression==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==Compression algorithms suited for sizecoded productions==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==Decompression routines and related ressources==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==Code optimization for better compression==&lt;br /&gt;
TBD&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Compression&amp;diff=1349</id>
		<title>Compression</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Compression&amp;diff=1349"/>
				<updated>2024-03-10T15:51:57Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: Initial page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page covers compression related topics. This involves information about available tools on different platforms, platforms with compression support, compression algorithms and related decompression routines suited for the use in sizecoding, and ways to adapt code for better compression on different platform.&lt;br /&gt;
&lt;br /&gt;
==Available tools==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==Platforms with compression==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==Compression algorithms suited for sizecoded productions==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==Decompression routines and related ressources==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==Code optimization for better compression==&lt;br /&gt;
TBD&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=MicroW8&amp;diff=1286</id>
		<title>MicroW8</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=MicroW8&amp;diff=1286"/>
				<updated>2024-01-28T16:53:15Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: /* Sound */ Fixed a mistake&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MicroW8 is a WebAssembly based fantasy console inspired by the likes of TIC-80, WASM-4 and PICO-8.&lt;br /&gt;
&lt;br /&gt;
At the time of writing it currently is the most powerful fantasy console out there in terms of performance, code density, graphics and audio capabilities.&lt;br /&gt;
&lt;br /&gt;
The initial motivation behind MicroW8 was to explore whether there was a way to make WebAssembly viable for size-coding. However the author also made sure that all design decisions make sense from the point of view of bigger projects as well.&lt;br /&gt;
&lt;br /&gt;
=== Setting Up ===&lt;br /&gt;
MicroW8 is pretty lightweight and easy to setup. Just download the latest version of MicroW8 for you favorite platform at:&lt;br /&gt;
https://exoticorn.github.io/microw8/&lt;br /&gt;
&lt;br /&gt;
After which you can open up your favorite editor and either open an existing example or create your own program.&lt;br /&gt;
The MicroW8 supports the following languages: CurlyWas, WASM (wat), C, Rust and Zig. &lt;br /&gt;
&lt;br /&gt;
Then open up your console and type the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
uw8 run -w -p -l 9 myintro.cwa -o myintro.uw8&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will compile, pack and start your intro in the microW8 environment and will watch the original sourcefile for any changes, so that upon saving the latest changes in your favorite editor, it will automatically compile, pack and relaunch your intro.&lt;br /&gt;
&lt;br /&gt;
=== Graphics ===&lt;br /&gt;
The MicroW8 has a resolution of 320x240 pixels with 256 colors, accessable via framebuffer (located at memory address 120) or via primitive functions like setPixel, line, circle, rectangle.&lt;br /&gt;
&lt;br /&gt;
The palette consists of 12 hues of 16 shades each, followed by a shiftable version of the sweetie16 palette in 1,2,4,8,16 and 32 color variants in the last 64 color indices.&lt;br /&gt;
[[File:Microw8pal.png|thumb|left|MicroW8 Default Palette]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For full documentation on the graphics capabilities, check out https://exoticorn.github.io/microw8/docs/#graphics&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&lt;br /&gt;
The MicroW8 support sound via a custom soundchip (registers located at location 80 in memory) or via a dedicated soundcall for bytebeat.&lt;br /&gt;
Expect Sound capabilities somewhere in between the AY/YM chipset and a SID chip.&lt;br /&gt;
&lt;br /&gt;
For full documentation on the sound capabilities, check out https://exoticorn.github.io/microw8/docs/#sound&lt;br /&gt;
&lt;br /&gt;
=== Additional Resources ===&lt;br /&gt;
* [https://exoticorn.github.io/microw8/] MicroW8 website&lt;br /&gt;
* [https://exoticorn.github.io/microw8/docs/] MicroW8 Documentation&lt;br /&gt;
* [https://github.com/exoticorn/curlywas] CurlyWas Documentation&lt;br /&gt;
* [https://www.youtube.com/watch?v=u-OvsbDqLAY] MicroW8 Seminar&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=TIC-80&amp;diff=1285</id>
		<title>TIC-80</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=TIC-80&amp;diff=1285"/>
				<updated>2024-01-03T18:35:14Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: /* Optimizing with a packer */ Moved the part about hiding the mouse cursor here&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Setting up ===&lt;br /&gt;
The TIC-80 fantasy computer is an all-in-one creation and execution platform.&lt;br /&gt;
&lt;br /&gt;
Setup is easy, simply download an executable from the [https://github.com/nesbox/TIC-80/releases releases] page for your platform of choice (Windows, OSX, Linux and even Raspberry Pi).&lt;br /&gt;
&lt;br /&gt;
Or if you are just curious you can just start doodling online at http://tic80.com/&lt;br /&gt;
&lt;br /&gt;
=== Getting started ===&lt;br /&gt;
Most TIC-80 programs are coded using the [https://www.lua.org/ Lua] scripting language. However it is possible to use different scripting languages at the cost of a couple of bytes/characters as shown below (respectively for JavaScript, MoonScript, Wren, Fennel, Squirrel)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;//script: js&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;-- script: moon&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;// script: wren&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fennel&amp;quot;&amp;gt;;; script: fennel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;// script: squirrel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main function used for updating the screen (called 60 times a second) is the TIC() function, and is a requirement for animated graphics. Additionally you can also create a SCN() function that is called once per scanline at the cost of more bytes/characters. &lt;br /&gt;
&lt;br /&gt;
Most animated effects will also need to use some kind of a timer, so you are likely to also use the built-in time() function or keep track of your time yourself.  A minimal setup would look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function TIC()t=time()&lt;br /&gt;
-- your effect code&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://github.com/nesbox/TIC-80/wiki/tic See here] to learn how TIC() is called in the different languages supported by TIC-80.&lt;br /&gt;
&lt;br /&gt;
A full overview of the TIC-80 memory map and most commonly used functions is available in this [https://zenithsal.com/assets/documents/tic-80_cheatsheet.pdf TIC-80 cheatsheet], as well as the [https://github.com/nesbox/TIC-80/wiki TIC-80 wiki page].&lt;br /&gt;
&lt;br /&gt;
=== Video display ===&lt;br /&gt;
The TIC-80 has a 240x136 pixel display with 16 colors which can be accessed via a wide range of graphics functions or by writing directly to VRAM at memory address 0x0000 using the &amp;lt;code&amp;gt;poke4&amp;lt;/code&amp;gt; instruction, setting four bits that represent a pixel's color. Note that the addresses have to be doubled when using poke4 because the memory is 4-bit addressable. Memory address 0x1000 would become 0x02000 (high nibble) and 0x02001 (low nibble).&lt;br /&gt;
&lt;br /&gt;
==== Draw functions ====&lt;br /&gt;
There are a couple of built-in drawing functions you can use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cls(color=0)&lt;br /&gt;
pix(x,y[color]) [-&amp;gt; color]&lt;br /&gt;
circ(x,y,r,color) -- filled circle&lt;br /&gt;
circb(x,y,r,color) -- border circle&lt;br /&gt;
rect(x,y,w,h,color) -- filled rect&lt;br /&gt;
rectb(x,y,w,h,color) -- border rect&lt;br /&gt;
line(x0,y0,x1,y1,color)&lt;br /&gt;
tri(x1,y1,x2,y2,x3,y3,color)&lt;br /&gt;
textri(x1,y1,x2,y2,x3,y3,u1,v1,u2,v2,u3,v3,use_map=false,colorkey=-1)&lt;br /&gt;
print(text,x=0,y=0,color=15,fixed=false,scale=1,smallfont=false) -&amp;gt; width&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Getting something on screen ====&lt;br /&gt;
Here is a bit of code to get you started:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function TIC() &lt;br /&gt;
t=time()/99&lt;br /&gt;
for y=0,136 do for x=0,240 do&lt;br /&gt;
pix(x,y,(x&amp;gt;&amp;gt;3~y&amp;gt;&amp;gt;3)+t)&lt;br /&gt;
end;end;end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which will display an animated XOR pattern.&lt;br /&gt;
&lt;br /&gt;
==== Color Palette ====&lt;br /&gt;
The best way to start is to use the default [https://lospec.com/palette-list/sweetie-16 sweetie16 palette] as this palette offers a nice selection of 16 colors arranged in such a way that they are easily accessible.&lt;br /&gt;
From version 0.9b onward you can initialize the new default sweetie16 palette at startup by adding a 0x11 Chunk to your TIC-80 cartridge. &lt;br /&gt;
&lt;br /&gt;
Normally a chunk would contain 4 bytes of header + data, but as this chunk has no data, it is possible to omit the extra 3 bytes of chunk-header if you place it at the end of your TIC cartridge. Some packers linked below have the option to do this.&lt;br /&gt;
&lt;br /&gt;
==== Setting your own color palette ====&lt;br /&gt;
Alternatively you can setup your own palette by writing to the palette area located at 0x3fc0 like so:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
for i=0,47 do poke(0x3fc0+i,i*5)end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This produces a nice grayscale palette of 16 shades to work with.&lt;br /&gt;
&lt;br /&gt;
==== Color index shuffling ====&lt;br /&gt;
If you don't want to use the sweetie16 palette you can revert back to the pre-0.8 db16 palette by simply not including a 0x11 chunk in you cartridge. Although the arrangement of color-indices is not as ideal as sweetie16, you can shuffle your color indices a bit to get 'somewhat workable' colors.&lt;br /&gt;
&lt;br /&gt;
A couple of examples for this are&lt;br /&gt;
* (color)&amp;amp;10 - Some grey/blue shade&lt;br /&gt;
* ((color)&amp;amp;6)-3 - A Nice shade of Dark-cyan-white color&lt;br /&gt;
* (color)^2 - A shade of brown/yellowish colors&lt;br /&gt;
&lt;br /&gt;
But feel free to experiment yourself as well and let us know on discord if you find something cool.&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&lt;br /&gt;
The TIC-80 has sound registers and 32 byte waveforms to access which are located at address 0x0FF9C in memory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
0FF9C SOUND REGS 72 18 byte x 4 ch&lt;br /&gt;
0FFE4 WAVEFORMS 256 16 wave/ 32x4b each&lt;br /&gt;
100E4 SFX 4224 64 sounds&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Make some noise ====&lt;br /&gt;
The easiest way to get 'some' sound going is to bitbang the sound-registers and hope for the best, for example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
TIC=function()for i=0,71 do poke(65436+i,(time()/7.2)%64)end end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A more the &amp;quot;proper&amp;quot; way involves something like : define the waveform yourself (f.e. sawtooth) repeatedly, then write low part of the frequency to one byte, and the high nibble combined with the volume to another.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
TIC=function()&lt;br /&gt;
for i=0,31 do poke4(2*65438+i,i/2) end -- setup waveform&lt;br /&gt;
t=time()/10 &lt;br /&gt;
-- write frequencies&lt;br /&gt;
poke(65436+0,t%256) &lt;br /&gt;
poke(65437+0,(t/65536)%16+240)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
But as you can see this costs considerably more bytes to setup.&lt;br /&gt;
&lt;br /&gt;
=== Final Optimizations ===&lt;br /&gt;
==== Optimizing with a packer ====&lt;br /&gt;
Packers will shorten variable names, remove excess whitespace, and reorder operators and statements to make the code short and highly-compressible.&lt;br /&gt;
It is therefore more important to write code that a packer can compress effectively as opposed to simply aiming for the smallest uncompressed code.&lt;br /&gt;
&lt;br /&gt;
Repeating patterns within source code will typically be compressed very well.&lt;br /&gt;
Thus, it is best to use the same literals and reserved keywords as often as possible, while avoiding introducing new ones.&lt;br /&gt;
Additionally, if a variable or short function is used in multiple places, replacing each occurrence of the variable or function call with the calculation used to obtain their value will typically reduce cartridge size by a few bytes.&lt;br /&gt;
&lt;br /&gt;
Tic-Tool provides an option for a live compression heatmap (in gzthermal style) to show, how well different parts of the code could be compressed.&lt;br /&gt;
&lt;br /&gt;
With the appearance of a mouse cursor in version 1.0 one common question was, how it could be disabled efficiently. The clean way would be a poke(16379,0), but taking into account code compression, a shorter version might be possible by reusing similar code. Here is an example from &amp;quot;Danger Inbound&amp;quot; of reusing palette setup code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- set grey palette&lt;br /&gt;
for i=0,47 do&lt;br /&gt;
    poke(16320+i,i*5)&lt;br /&gt;
end&lt;br /&gt;
-- switch off mouse cursor&lt;br /&gt;
-- (looks big, but due to compression and reusing palette code, this is just 5-6 bytes)&lt;br /&gt;
i=59 poke(16320+i,i*5) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Optimizing without a packer====&lt;br /&gt;
When you are happy with your intro and want to get it ready for release, it becomes time to look at squeezing those last bytes.&lt;br /&gt;
As a goal-post, you should always aim to have your uncompressed effect around the target size, and work from there.&lt;br /&gt;
&lt;br /&gt;
Final optimization can be done by stringing as much code together on single lines and removing any extra spaces and newlines.&lt;br /&gt;
A rule of thumb for this is that of the first or last character of a variable or function isn't a valid hex number (i.e. A-F) you can omit whitespace (so that: x=0 y=0 z=0 can become x=0y=0z=0)&lt;br /&gt;
&lt;br /&gt;
Check the [[Byte Battle]] article for more optimization ideas.&lt;br /&gt;
&lt;br /&gt;
=== Release ===&lt;br /&gt;
For releasing an intro at a demoscene event, a raw TIC cartridge file without any additional graphics/sound/metadata is needed.&lt;br /&gt;
&lt;br /&gt;
Creating a TIC cartridge file adds a 4 byte header + 1 extra byte for a 0x11 sweetie16 chunk. &lt;br /&gt;
There are various packers that help you convert your (LUA) Script to a empty TIC Cartridge with a single ZLIB compressed code block and optional 0x11 (sweetie16) palette chunk. See the additional links for links to these packers.&lt;br /&gt;
 &lt;br /&gt;
==== Exporting Video as Animated GIF ====&lt;br /&gt;
The TIC-80 environment has a neat feature that lets you export your intro directly as an animated GIF file to converted to video later, by pressing the F9 key to start and stop recording. However, there is a default recording limit capped to a fixed number of frames or seconds. You can change this in the tic80 config to a bigger number to match your recording-size. &lt;br /&gt;
&lt;br /&gt;
If your intro is taking up too many resources and starts chugging a bit on your machine, it can be wise to make a version that steps through time linearly by adding a number to your t variable yourself instead of using the time() function.&lt;br /&gt;
&lt;br /&gt;
==== Online version: Metadata and Thumbnail image ====&lt;br /&gt;
When uploading the intro to the TIC-80 website for a playable online version, you will need to build a new TIC file with some added some meta-data and Thumbnail image (You can take this screenshot using the F7 key during the demo playback) and use this as you online version. The screenshot can also be imported from a 240×136 PNG (other size will throw an error) using inside TIC-80 console &amp;lt;code&amp;gt;import screen file[.png]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The Meta data is added at the top of your source code as follows&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- title: My intro&lt;br /&gt;
-- author: scener&lt;br /&gt;
-- desc: my first sizecoded TIC-80 intro&lt;br /&gt;
-- script: lua (or moon/wren/js/fennel)&lt;br /&gt;
-- license: MIT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As of version 0.9b the http://tic80.com website now also allows you to upload a separate TIC file with the metadata and keep the uploaded binary TIC file as code only.&lt;br /&gt;
&lt;br /&gt;
=== Additional Resources ===&lt;br /&gt;
Sizecoding on the TIC-80 is still in its infancy, but luckily there is already plenty of information to get you started!&lt;br /&gt;
&lt;br /&gt;
* TIC-80 Wiki page https://github.com/nesbox/TIC-80/wiki&lt;br /&gt;
* TIC-80 One page cheat sheet (PDF) https://zenithsal.com/assets/documents/tic-80_cheatsheet.pdf&lt;br /&gt;
* TIC-80 Intros and demos on Pouet (Press F1 for code): https://www.pouet.net/prodlist.php?platform%5B%5D=TIC-80&lt;br /&gt;
* TIC-80 TIC Cartridge File Format (from TIC-80 Wiki) https://github.com/nesbox/TIC-80/wiki/tic-File-Format&lt;br /&gt;
* TIC-80 Packer https://bitbucket.org/WaterEnVuur/tic80-packer/src/master/&lt;br /&gt;
* Pactic, fork de TIC-80 Packer https://github.com/phlubby/pactic&lt;br /&gt;
* TIC-Tool https://github.com/exoticorn/tic-tool&lt;br /&gt;
* pakettic, https://github.com/vsariola/pakettic&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=TIC-80&amp;diff=1284</id>
		<title>TIC-80</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=TIC-80&amp;diff=1284"/>
				<updated>2024-01-03T18:34:23Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: /* Optimizing without a packer */  moved the mouse cursor code to the section about optimizing with a packer&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Setting up ===&lt;br /&gt;
The TIC-80 fantasy computer is an all-in-one creation and execution platform.&lt;br /&gt;
&lt;br /&gt;
Setup is easy, simply download an executable from the [https://github.com/nesbox/TIC-80/releases releases] page for your platform of choice (Windows, OSX, Linux and even Raspberry Pi).&lt;br /&gt;
&lt;br /&gt;
Or if you are just curious you can just start doodling online at http://tic80.com/&lt;br /&gt;
&lt;br /&gt;
=== Getting started ===&lt;br /&gt;
Most TIC-80 programs are coded using the [https://www.lua.org/ Lua] scripting language. However it is possible to use different scripting languages at the cost of a couple of bytes/characters as shown below (respectively for JavaScript, MoonScript, Wren, Fennel, Squirrel)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;//script: js&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;-- script: moon&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;// script: wren&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fennel&amp;quot;&amp;gt;;; script: fennel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;// script: squirrel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main function used for updating the screen (called 60 times a second) is the TIC() function, and is a requirement for animated graphics. Additionally you can also create a SCN() function that is called once per scanline at the cost of more bytes/characters. &lt;br /&gt;
&lt;br /&gt;
Most animated effects will also need to use some kind of a timer, so you are likely to also use the built-in time() function or keep track of your time yourself.  A minimal setup would look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function TIC()t=time()&lt;br /&gt;
-- your effect code&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://github.com/nesbox/TIC-80/wiki/tic See here] to learn how TIC() is called in the different languages supported by TIC-80.&lt;br /&gt;
&lt;br /&gt;
A full overview of the TIC-80 memory map and most commonly used functions is available in this [https://zenithsal.com/assets/documents/tic-80_cheatsheet.pdf TIC-80 cheatsheet], as well as the [https://github.com/nesbox/TIC-80/wiki TIC-80 wiki page].&lt;br /&gt;
&lt;br /&gt;
=== Video display ===&lt;br /&gt;
The TIC-80 has a 240x136 pixel display with 16 colors which can be accessed via a wide range of graphics functions or by writing directly to VRAM at memory address 0x0000 using the &amp;lt;code&amp;gt;poke4&amp;lt;/code&amp;gt; instruction, setting four bits that represent a pixel's color. Note that the addresses have to be doubled when using poke4 because the memory is 4-bit addressable. Memory address 0x1000 would become 0x02000 (high nibble) and 0x02001 (low nibble).&lt;br /&gt;
&lt;br /&gt;
==== Draw functions ====&lt;br /&gt;
There are a couple of built-in drawing functions you can use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cls(color=0)&lt;br /&gt;
pix(x,y[color]) [-&amp;gt; color]&lt;br /&gt;
circ(x,y,r,color) -- filled circle&lt;br /&gt;
circb(x,y,r,color) -- border circle&lt;br /&gt;
rect(x,y,w,h,color) -- filled rect&lt;br /&gt;
rectb(x,y,w,h,color) -- border rect&lt;br /&gt;
line(x0,y0,x1,y1,color)&lt;br /&gt;
tri(x1,y1,x2,y2,x3,y3,color)&lt;br /&gt;
textri(x1,y1,x2,y2,x3,y3,u1,v1,u2,v2,u3,v3,use_map=false,colorkey=-1)&lt;br /&gt;
print(text,x=0,y=0,color=15,fixed=false,scale=1,smallfont=false) -&amp;gt; width&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Getting something on screen ====&lt;br /&gt;
Here is a bit of code to get you started:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function TIC() &lt;br /&gt;
t=time()/99&lt;br /&gt;
for y=0,136 do for x=0,240 do&lt;br /&gt;
pix(x,y,(x&amp;gt;&amp;gt;3~y&amp;gt;&amp;gt;3)+t)&lt;br /&gt;
end;end;end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which will display an animated XOR pattern.&lt;br /&gt;
&lt;br /&gt;
==== Color Palette ====&lt;br /&gt;
The best way to start is to use the default [https://lospec.com/palette-list/sweetie-16 sweetie16 palette] as this palette offers a nice selection of 16 colors arranged in such a way that they are easily accessible.&lt;br /&gt;
From version 0.9b onward you can initialize the new default sweetie16 palette at startup by adding a 0x11 Chunk to your TIC-80 cartridge. &lt;br /&gt;
&lt;br /&gt;
Normally a chunk would contain 4 bytes of header + data, but as this chunk has no data, it is possible to omit the extra 3 bytes of chunk-header if you place it at the end of your TIC cartridge. Some packers linked below have the option to do this.&lt;br /&gt;
&lt;br /&gt;
==== Setting your own color palette ====&lt;br /&gt;
Alternatively you can setup your own palette by writing to the palette area located at 0x3fc0 like so:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
for i=0,47 do poke(0x3fc0+i,i*5)end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This produces a nice grayscale palette of 16 shades to work with.&lt;br /&gt;
&lt;br /&gt;
==== Color index shuffling ====&lt;br /&gt;
If you don't want to use the sweetie16 palette you can revert back to the pre-0.8 db16 palette by simply not including a 0x11 chunk in you cartridge. Although the arrangement of color-indices is not as ideal as sweetie16, you can shuffle your color indices a bit to get 'somewhat workable' colors.&lt;br /&gt;
&lt;br /&gt;
A couple of examples for this are&lt;br /&gt;
* (color)&amp;amp;10 - Some grey/blue shade&lt;br /&gt;
* ((color)&amp;amp;6)-3 - A Nice shade of Dark-cyan-white color&lt;br /&gt;
* (color)^2 - A shade of brown/yellowish colors&lt;br /&gt;
&lt;br /&gt;
But feel free to experiment yourself as well and let us know on discord if you find something cool.&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&lt;br /&gt;
The TIC-80 has sound registers and 32 byte waveforms to access which are located at address 0x0FF9C in memory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
0FF9C SOUND REGS 72 18 byte x 4 ch&lt;br /&gt;
0FFE4 WAVEFORMS 256 16 wave/ 32x4b each&lt;br /&gt;
100E4 SFX 4224 64 sounds&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Make some noise ====&lt;br /&gt;
The easiest way to get 'some' sound going is to bitbang the sound-registers and hope for the best, for example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
TIC=function()for i=0,71 do poke(65436+i,(time()/7.2)%64)end end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A more the &amp;quot;proper&amp;quot; way involves something like : define the waveform yourself (f.e. sawtooth) repeatedly, then write low part of the frequency to one byte, and the high nibble combined with the volume to another.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
TIC=function()&lt;br /&gt;
for i=0,31 do poke4(2*65438+i,i/2) end -- setup waveform&lt;br /&gt;
t=time()/10 &lt;br /&gt;
-- write frequencies&lt;br /&gt;
poke(65436+0,t%256) &lt;br /&gt;
poke(65437+0,(t/65536)%16+240)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
But as you can see this costs considerably more bytes to setup.&lt;br /&gt;
&lt;br /&gt;
=== Final Optimizations ===&lt;br /&gt;
==== Optimizing with a packer ====&lt;br /&gt;
Packers will shorten variable names, remove excess whitespace, and reorder operators and statements to make the code short and highly-compressible.&lt;br /&gt;
It is therefore more important to write code that a packer can compress effectively as opposed to simply aiming for the smallest uncompressed code.&lt;br /&gt;
&lt;br /&gt;
Repeating patterns within source code will typically be compressed very well.&lt;br /&gt;
Thus, it is best to use the same literals and reserved keywords as often as possible, while avoiding introducing new ones.&lt;br /&gt;
Additionally, if a variable or short function is used in multiple places, replacing each occurrence of the variable or function call with the calculation used to obtain their value will typically reduce cartridge size by a few bytes.&lt;br /&gt;
&lt;br /&gt;
Tic-Tool provides an option for a live compression heatmap (in gzthermal style) to show, how well different parts of the code could be compressed.&lt;br /&gt;
&lt;br /&gt;
==== Optimizing without a packer====&lt;br /&gt;
When you are happy with your intro and want to get it ready for release, it becomes time to look at squeezing those last bytes.&lt;br /&gt;
As a goal-post, you should always aim to have your uncompressed effect around the target size, and work from there.&lt;br /&gt;
&lt;br /&gt;
Final optimization can be done by stringing as much code together on single lines and removing any extra spaces and newlines.&lt;br /&gt;
A rule of thumb for this is that of the first or last character of a variable or function isn't a valid hex number (i.e. A-F) you can omit whitespace (so that: x=0 y=0 z=0 can become x=0y=0z=0)&lt;br /&gt;
&lt;br /&gt;
Check the [[Byte Battle]] article for more optimization ideas.&lt;br /&gt;
&lt;br /&gt;
=== Release ===&lt;br /&gt;
For releasing an intro at a demoscene event, a raw TIC cartridge file without any additional graphics/sound/metadata is needed.&lt;br /&gt;
&lt;br /&gt;
Creating a TIC cartridge file adds a 4 byte header + 1 extra byte for a 0x11 sweetie16 chunk. &lt;br /&gt;
There are various packers that help you convert your (LUA) Script to a empty TIC Cartridge with a single ZLIB compressed code block and optional 0x11 (sweetie16) palette chunk. See the additional links for links to these packers.&lt;br /&gt;
 &lt;br /&gt;
==== Exporting Video as Animated GIF ====&lt;br /&gt;
The TIC-80 environment has a neat feature that lets you export your intro directly as an animated GIF file to converted to video later, by pressing the F9 key to start and stop recording. However, there is a default recording limit capped to a fixed number of frames or seconds. You can change this in the tic80 config to a bigger number to match your recording-size. &lt;br /&gt;
&lt;br /&gt;
If your intro is taking up too many resources and starts chugging a bit on your machine, it can be wise to make a version that steps through time linearly by adding a number to your t variable yourself instead of using the time() function.&lt;br /&gt;
&lt;br /&gt;
==== Online version: Metadata and Thumbnail image ====&lt;br /&gt;
When uploading the intro to the TIC-80 website for a playable online version, you will need to build a new TIC file with some added some meta-data and Thumbnail image (You can take this screenshot using the F7 key during the demo playback) and use this as you online version. The screenshot can also be imported from a 240×136 PNG (other size will throw an error) using inside TIC-80 console &amp;lt;code&amp;gt;import screen file[.png]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The Meta data is added at the top of your source code as follows&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- title: My intro&lt;br /&gt;
-- author: scener&lt;br /&gt;
-- desc: my first sizecoded TIC-80 intro&lt;br /&gt;
-- script: lua (or moon/wren/js/fennel)&lt;br /&gt;
-- license: MIT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As of version 0.9b the http://tic80.com website now also allows you to upload a separate TIC file with the metadata and keep the uploaded binary TIC file as code only.&lt;br /&gt;
&lt;br /&gt;
=== Additional Resources ===&lt;br /&gt;
Sizecoding on the TIC-80 is still in its infancy, but luckily there is already plenty of information to get you started!&lt;br /&gt;
&lt;br /&gt;
* TIC-80 Wiki page https://github.com/nesbox/TIC-80/wiki&lt;br /&gt;
* TIC-80 One page cheat sheet (PDF) https://zenithsal.com/assets/documents/tic-80_cheatsheet.pdf&lt;br /&gt;
* TIC-80 Intros and demos on Pouet (Press F1 for code): https://www.pouet.net/prodlist.php?platform%5B%5D=TIC-80&lt;br /&gt;
* TIC-80 TIC Cartridge File Format (from TIC-80 Wiki) https://github.com/nesbox/TIC-80/wiki/tic-File-Format&lt;br /&gt;
* TIC-80 Packer https://bitbucket.org/WaterEnVuur/tic80-packer/src/master/&lt;br /&gt;
* Pactic, fork de TIC-80 Packer https://github.com/phlubby/pactic&lt;br /&gt;
* TIC-Tool https://github.com/exoticorn/tic-tool&lt;br /&gt;
* pakettic, https://github.com/vsariola/pakettic&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=TIC-80&amp;diff=1283</id>
		<title>TIC-80</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=TIC-80&amp;diff=1283"/>
				<updated>2024-01-03T18:33:22Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: /* Optimizing without a packer */  adding a paragraph about hiding the mouse cursor and a reference to the Byte Battle optimizations&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Setting up ===&lt;br /&gt;
The TIC-80 fantasy computer is an all-in-one creation and execution platform.&lt;br /&gt;
&lt;br /&gt;
Setup is easy, simply download an executable from the [https://github.com/nesbox/TIC-80/releases releases] page for your platform of choice (Windows, OSX, Linux and even Raspberry Pi).&lt;br /&gt;
&lt;br /&gt;
Or if you are just curious you can just start doodling online at http://tic80.com/&lt;br /&gt;
&lt;br /&gt;
=== Getting started ===&lt;br /&gt;
Most TIC-80 programs are coded using the [https://www.lua.org/ Lua] scripting language. However it is possible to use different scripting languages at the cost of a couple of bytes/characters as shown below (respectively for JavaScript, MoonScript, Wren, Fennel, Squirrel)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;//script: js&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;-- script: moon&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;// script: wren&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fennel&amp;quot;&amp;gt;;; script: fennel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;// script: squirrel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main function used for updating the screen (called 60 times a second) is the TIC() function, and is a requirement for animated graphics. Additionally you can also create a SCN() function that is called once per scanline at the cost of more bytes/characters. &lt;br /&gt;
&lt;br /&gt;
Most animated effects will also need to use some kind of a timer, so you are likely to also use the built-in time() function or keep track of your time yourself.  A minimal setup would look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function TIC()t=time()&lt;br /&gt;
-- your effect code&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://github.com/nesbox/TIC-80/wiki/tic See here] to learn how TIC() is called in the different languages supported by TIC-80.&lt;br /&gt;
&lt;br /&gt;
A full overview of the TIC-80 memory map and most commonly used functions is available in this [https://zenithsal.com/assets/documents/tic-80_cheatsheet.pdf TIC-80 cheatsheet], as well as the [https://github.com/nesbox/TIC-80/wiki TIC-80 wiki page].&lt;br /&gt;
&lt;br /&gt;
=== Video display ===&lt;br /&gt;
The TIC-80 has a 240x136 pixel display with 16 colors which can be accessed via a wide range of graphics functions or by writing directly to VRAM at memory address 0x0000 using the &amp;lt;code&amp;gt;poke4&amp;lt;/code&amp;gt; instruction, setting four bits that represent a pixel's color. Note that the addresses have to be doubled when using poke4 because the memory is 4-bit addressable. Memory address 0x1000 would become 0x02000 (high nibble) and 0x02001 (low nibble).&lt;br /&gt;
&lt;br /&gt;
==== Draw functions ====&lt;br /&gt;
There are a couple of built-in drawing functions you can use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cls(color=0)&lt;br /&gt;
pix(x,y[color]) [-&amp;gt; color]&lt;br /&gt;
circ(x,y,r,color) -- filled circle&lt;br /&gt;
circb(x,y,r,color) -- border circle&lt;br /&gt;
rect(x,y,w,h,color) -- filled rect&lt;br /&gt;
rectb(x,y,w,h,color) -- border rect&lt;br /&gt;
line(x0,y0,x1,y1,color)&lt;br /&gt;
tri(x1,y1,x2,y2,x3,y3,color)&lt;br /&gt;
textri(x1,y1,x2,y2,x3,y3,u1,v1,u2,v2,u3,v3,use_map=false,colorkey=-1)&lt;br /&gt;
print(text,x=0,y=0,color=15,fixed=false,scale=1,smallfont=false) -&amp;gt; width&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Getting something on screen ====&lt;br /&gt;
Here is a bit of code to get you started:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function TIC() &lt;br /&gt;
t=time()/99&lt;br /&gt;
for y=0,136 do for x=0,240 do&lt;br /&gt;
pix(x,y,(x&amp;gt;&amp;gt;3~y&amp;gt;&amp;gt;3)+t)&lt;br /&gt;
end;end;end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which will display an animated XOR pattern.&lt;br /&gt;
&lt;br /&gt;
==== Color Palette ====&lt;br /&gt;
The best way to start is to use the default [https://lospec.com/palette-list/sweetie-16 sweetie16 palette] as this palette offers a nice selection of 16 colors arranged in such a way that they are easily accessible.&lt;br /&gt;
From version 0.9b onward you can initialize the new default sweetie16 palette at startup by adding a 0x11 Chunk to your TIC-80 cartridge. &lt;br /&gt;
&lt;br /&gt;
Normally a chunk would contain 4 bytes of header + data, but as this chunk has no data, it is possible to omit the extra 3 bytes of chunk-header if you place it at the end of your TIC cartridge. Some packers linked below have the option to do this.&lt;br /&gt;
&lt;br /&gt;
==== Setting your own color palette ====&lt;br /&gt;
Alternatively you can setup your own palette by writing to the palette area located at 0x3fc0 like so:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
for i=0,47 do poke(0x3fc0+i,i*5)end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This produces a nice grayscale palette of 16 shades to work with.&lt;br /&gt;
&lt;br /&gt;
==== Color index shuffling ====&lt;br /&gt;
If you don't want to use the sweetie16 palette you can revert back to the pre-0.8 db16 palette by simply not including a 0x11 chunk in you cartridge. Although the arrangement of color-indices is not as ideal as sweetie16, you can shuffle your color indices a bit to get 'somewhat workable' colors.&lt;br /&gt;
&lt;br /&gt;
A couple of examples for this are&lt;br /&gt;
* (color)&amp;amp;10 - Some grey/blue shade&lt;br /&gt;
* ((color)&amp;amp;6)-3 - A Nice shade of Dark-cyan-white color&lt;br /&gt;
* (color)^2 - A shade of brown/yellowish colors&lt;br /&gt;
&lt;br /&gt;
But feel free to experiment yourself as well and let us know on discord if you find something cool.&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&lt;br /&gt;
The TIC-80 has sound registers and 32 byte waveforms to access which are located at address 0x0FF9C in memory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
0FF9C SOUND REGS 72 18 byte x 4 ch&lt;br /&gt;
0FFE4 WAVEFORMS 256 16 wave/ 32x4b each&lt;br /&gt;
100E4 SFX 4224 64 sounds&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Make some noise ====&lt;br /&gt;
The easiest way to get 'some' sound going is to bitbang the sound-registers and hope for the best, for example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
TIC=function()for i=0,71 do poke(65436+i,(time()/7.2)%64)end end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A more the &amp;quot;proper&amp;quot; way involves something like : define the waveform yourself (f.e. sawtooth) repeatedly, then write low part of the frequency to one byte, and the high nibble combined with the volume to another.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
TIC=function()&lt;br /&gt;
for i=0,31 do poke4(2*65438+i,i/2) end -- setup waveform&lt;br /&gt;
t=time()/10 &lt;br /&gt;
-- write frequencies&lt;br /&gt;
poke(65436+0,t%256) &lt;br /&gt;
poke(65437+0,(t/65536)%16+240)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
But as you can see this costs considerably more bytes to setup.&lt;br /&gt;
&lt;br /&gt;
=== Final Optimizations ===&lt;br /&gt;
==== Optimizing with a packer ====&lt;br /&gt;
Packers will shorten variable names, remove excess whitespace, and reorder operators and statements to make the code short and highly-compressible.&lt;br /&gt;
It is therefore more important to write code that a packer can compress effectively as opposed to simply aiming for the smallest uncompressed code.&lt;br /&gt;
&lt;br /&gt;
Repeating patterns within source code will typically be compressed very well.&lt;br /&gt;
Thus, it is best to use the same literals and reserved keywords as often as possible, while avoiding introducing new ones.&lt;br /&gt;
Additionally, if a variable or short function is used in multiple places, replacing each occurrence of the variable or function call with the calculation used to obtain their value will typically reduce cartridge size by a few bytes.&lt;br /&gt;
&lt;br /&gt;
Tic-Tool provides an option for a live compression heatmap (in gzthermal style) to show, how well different parts of the code could be compressed.&lt;br /&gt;
&lt;br /&gt;
==== Optimizing without a packer====&lt;br /&gt;
When you are happy with your intro and want to get it ready for release, it becomes time to look at squeezing those last bytes.&lt;br /&gt;
As a goal-post, you should always aim to have your uncompressed effect around the target size, and work from there.&lt;br /&gt;
&lt;br /&gt;
Final optimization can be done by stringing as much code together on single lines and removing any extra spaces and newlines.&lt;br /&gt;
A rule of thumb for this is that of the first or last character of a variable or function isn't a valid hex number (i.e. A-F) you can omit whitespace (so that: x=0 y=0 z=0 can become x=0y=0z=0)&lt;br /&gt;
&lt;br /&gt;
With the appearance of a mouse cursor in version 1.0 one common question was, how it could be disabled efficiently. The clean way would be a poke(16379,0), but taking into account code compression, a shorter version might be possible by reusing similar code. Here is an example from &amp;quot;Danger Inbound&amp;quot; of reusing palette setup code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- set grey palette&lt;br /&gt;
for i=0,47 do&lt;br /&gt;
    poke(16320+i,i*5)&lt;br /&gt;
end&lt;br /&gt;
-- switch off mouse cursor&lt;br /&gt;
-- (looks big, but due to compression and reusing palette code, this is just 5-6 bytes)&lt;br /&gt;
i=59 poke(16320+i,i*5) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the [[Byte Battle]] article for more optimization ideas.&lt;br /&gt;
&lt;br /&gt;
=== Release ===&lt;br /&gt;
For releasing an intro at a demoscene event, a raw TIC cartridge file without any additional graphics/sound/metadata is needed.&lt;br /&gt;
&lt;br /&gt;
Creating a TIC cartridge file adds a 4 byte header + 1 extra byte for a 0x11 sweetie16 chunk. &lt;br /&gt;
There are various packers that help you convert your (LUA) Script to a empty TIC Cartridge with a single ZLIB compressed code block and optional 0x11 (sweetie16) palette chunk. See the additional links for links to these packers.&lt;br /&gt;
 &lt;br /&gt;
==== Exporting Video as Animated GIF ====&lt;br /&gt;
The TIC-80 environment has a neat feature that lets you export your intro directly as an animated GIF file to converted to video later, by pressing the F9 key to start and stop recording. However, there is a default recording limit capped to a fixed number of frames or seconds. You can change this in the tic80 config to a bigger number to match your recording-size. &lt;br /&gt;
&lt;br /&gt;
If your intro is taking up too many resources and starts chugging a bit on your machine, it can be wise to make a version that steps through time linearly by adding a number to your t variable yourself instead of using the time() function.&lt;br /&gt;
&lt;br /&gt;
==== Online version: Metadata and Thumbnail image ====&lt;br /&gt;
When uploading the intro to the TIC-80 website for a playable online version, you will need to build a new TIC file with some added some meta-data and Thumbnail image (You can take this screenshot using the F7 key during the demo playback) and use this as you online version. The screenshot can also be imported from a 240×136 PNG (other size will throw an error) using inside TIC-80 console &amp;lt;code&amp;gt;import screen file[.png]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The Meta data is added at the top of your source code as follows&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- title: My intro&lt;br /&gt;
-- author: scener&lt;br /&gt;
-- desc: my first sizecoded TIC-80 intro&lt;br /&gt;
-- script: lua (or moon/wren/js/fennel)&lt;br /&gt;
-- license: MIT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As of version 0.9b the http://tic80.com website now also allows you to upload a separate TIC file with the metadata and keep the uploaded binary TIC file as code only.&lt;br /&gt;
&lt;br /&gt;
=== Additional Resources ===&lt;br /&gt;
Sizecoding on the TIC-80 is still in its infancy, but luckily there is already plenty of information to get you started!&lt;br /&gt;
&lt;br /&gt;
* TIC-80 Wiki page https://github.com/nesbox/TIC-80/wiki&lt;br /&gt;
* TIC-80 One page cheat sheet (PDF) https://zenithsal.com/assets/documents/tic-80_cheatsheet.pdf&lt;br /&gt;
* TIC-80 Intros and demos on Pouet (Press F1 for code): https://www.pouet.net/prodlist.php?platform%5B%5D=TIC-80&lt;br /&gt;
* TIC-80 TIC Cartridge File Format (from TIC-80 Wiki) https://github.com/nesbox/TIC-80/wiki/tic-File-Format&lt;br /&gt;
* TIC-80 Packer https://bitbucket.org/WaterEnVuur/tic80-packer/src/master/&lt;br /&gt;
* Pactic, fork de TIC-80 Packer https://github.com/phlubby/pactic&lt;br /&gt;
* TIC-Tool https://github.com/exoticorn/tic-tool&lt;br /&gt;
* pakettic, https://github.com/vsariola/pakettic&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=TIC-80&amp;diff=1282</id>
		<title>TIC-80</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=TIC-80&amp;diff=1282"/>
				<updated>2024-01-03T18:18:51Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: /* Optimizing with a packer */ - added a remark to use compression heatmaps with tic-tool&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Setting up ===&lt;br /&gt;
The TIC-80 fantasy computer is an all-in-one creation and execution platform.&lt;br /&gt;
&lt;br /&gt;
Setup is easy, simply download an executable from the [https://github.com/nesbox/TIC-80/releases releases] page for your platform of choice (Windows, OSX, Linux and even Raspberry Pi).&lt;br /&gt;
&lt;br /&gt;
Or if you are just curious you can just start doodling online at http://tic80.com/&lt;br /&gt;
&lt;br /&gt;
=== Getting started ===&lt;br /&gt;
Most TIC-80 programs are coded using the [https://www.lua.org/ Lua] scripting language. However it is possible to use different scripting languages at the cost of a couple of bytes/characters as shown below (respectively for JavaScript, MoonScript, Wren, Fennel, Squirrel)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;//script: js&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;-- script: moon&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;// script: wren&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fennel&amp;quot;&amp;gt;;; script: fennel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;// script: squirrel&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main function used for updating the screen (called 60 times a second) is the TIC() function, and is a requirement for animated graphics. Additionally you can also create a SCN() function that is called once per scanline at the cost of more bytes/characters. &lt;br /&gt;
&lt;br /&gt;
Most animated effects will also need to use some kind of a timer, so you are likely to also use the built-in time() function or keep track of your time yourself.  A minimal setup would look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function TIC()t=time()&lt;br /&gt;
-- your effect code&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://github.com/nesbox/TIC-80/wiki/tic See here] to learn how TIC() is called in the different languages supported by TIC-80.&lt;br /&gt;
&lt;br /&gt;
A full overview of the TIC-80 memory map and most commonly used functions is available in this [https://zenithsal.com/assets/documents/tic-80_cheatsheet.pdf TIC-80 cheatsheet], as well as the [https://github.com/nesbox/TIC-80/wiki TIC-80 wiki page].&lt;br /&gt;
&lt;br /&gt;
=== Video display ===&lt;br /&gt;
The TIC-80 has a 240x136 pixel display with 16 colors which can be accessed via a wide range of graphics functions or by writing directly to VRAM at memory address 0x0000 using the &amp;lt;code&amp;gt;poke4&amp;lt;/code&amp;gt; instruction, setting four bits that represent a pixel's color. Note that the addresses have to be doubled when using poke4 because the memory is 4-bit addressable. Memory address 0x1000 would become 0x02000 (high nibble) and 0x02001 (low nibble).&lt;br /&gt;
&lt;br /&gt;
==== Draw functions ====&lt;br /&gt;
There are a couple of built-in drawing functions you can use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
cls(color=0)&lt;br /&gt;
pix(x,y[color]) [-&amp;gt; color]&lt;br /&gt;
circ(x,y,r,color) -- filled circle&lt;br /&gt;
circb(x,y,r,color) -- border circle&lt;br /&gt;
rect(x,y,w,h,color) -- filled rect&lt;br /&gt;
rectb(x,y,w,h,color) -- border rect&lt;br /&gt;
line(x0,y0,x1,y1,color)&lt;br /&gt;
tri(x1,y1,x2,y2,x3,y3,color)&lt;br /&gt;
textri(x1,y1,x2,y2,x3,y3,u1,v1,u2,v2,u3,v3,use_map=false,colorkey=-1)&lt;br /&gt;
print(text,x=0,y=0,color=15,fixed=false,scale=1,smallfont=false) -&amp;gt; width&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Getting something on screen ====&lt;br /&gt;
Here is a bit of code to get you started:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function TIC() &lt;br /&gt;
t=time()/99&lt;br /&gt;
for y=0,136 do for x=0,240 do&lt;br /&gt;
pix(x,y,(x&amp;gt;&amp;gt;3~y&amp;gt;&amp;gt;3)+t)&lt;br /&gt;
end;end;end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which will display an animated XOR pattern.&lt;br /&gt;
&lt;br /&gt;
==== Color Palette ====&lt;br /&gt;
The best way to start is to use the default [https://lospec.com/palette-list/sweetie-16 sweetie16 palette] as this palette offers a nice selection of 16 colors arranged in such a way that they are easily accessible.&lt;br /&gt;
From version 0.9b onward you can initialize the new default sweetie16 palette at startup by adding a 0x11 Chunk to your TIC-80 cartridge. &lt;br /&gt;
&lt;br /&gt;
Normally a chunk would contain 4 bytes of header + data, but as this chunk has no data, it is possible to omit the extra 3 bytes of chunk-header if you place it at the end of your TIC cartridge. Some packers linked below have the option to do this.&lt;br /&gt;
&lt;br /&gt;
==== Setting your own color palette ====&lt;br /&gt;
Alternatively you can setup your own palette by writing to the palette area located at 0x3fc0 like so:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
for i=0,47 do poke(0x3fc0+i,i*5)end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This produces a nice grayscale palette of 16 shades to work with.&lt;br /&gt;
&lt;br /&gt;
==== Color index shuffling ====&lt;br /&gt;
If you don't want to use the sweetie16 palette you can revert back to the pre-0.8 db16 palette by simply not including a 0x11 chunk in you cartridge. Although the arrangement of color-indices is not as ideal as sweetie16, you can shuffle your color indices a bit to get 'somewhat workable' colors.&lt;br /&gt;
&lt;br /&gt;
A couple of examples for this are&lt;br /&gt;
* (color)&amp;amp;10 - Some grey/blue shade&lt;br /&gt;
* ((color)&amp;amp;6)-3 - A Nice shade of Dark-cyan-white color&lt;br /&gt;
* (color)^2 - A shade of brown/yellowish colors&lt;br /&gt;
&lt;br /&gt;
But feel free to experiment yourself as well and let us know on discord if you find something cool.&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&lt;br /&gt;
The TIC-80 has sound registers and 32 byte waveforms to access which are located at address 0x0FF9C in memory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
0FF9C SOUND REGS 72 18 byte x 4 ch&lt;br /&gt;
0FFE4 WAVEFORMS 256 16 wave/ 32x4b each&lt;br /&gt;
100E4 SFX 4224 64 sounds&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Make some noise ====&lt;br /&gt;
The easiest way to get 'some' sound going is to bitbang the sound-registers and hope for the best, for example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
TIC=function()for i=0,71 do poke(65436+i,(time()/7.2)%64)end end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A more the &amp;quot;proper&amp;quot; way involves something like : define the waveform yourself (f.e. sawtooth) repeatedly, then write low part of the frequency to one byte, and the high nibble combined with the volume to another.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
TIC=function()&lt;br /&gt;
for i=0,31 do poke4(2*65438+i,i/2) end -- setup waveform&lt;br /&gt;
t=time()/10 &lt;br /&gt;
-- write frequencies&lt;br /&gt;
poke(65436+0,t%256) &lt;br /&gt;
poke(65437+0,(t/65536)%16+240)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
But as you can see this costs considerably more bytes to setup.&lt;br /&gt;
&lt;br /&gt;
=== Final Optimizations ===&lt;br /&gt;
==== Optimizing with a packer ====&lt;br /&gt;
Packers will shorten variable names, remove excess whitespace, and reorder operators and statements to make the code short and highly-compressible.&lt;br /&gt;
It is therefore more important to write code that a packer can compress effectively as opposed to simply aiming for the smallest uncompressed code.&lt;br /&gt;
&lt;br /&gt;
Repeating patterns within source code will typically be compressed very well.&lt;br /&gt;
Thus, it is best to use the same literals and reserved keywords as often as possible, while avoiding introducing new ones.&lt;br /&gt;
Additionally, if a variable or short function is used in multiple places, replacing each occurrence of the variable or function call with the calculation used to obtain their value will typically reduce cartridge size by a few bytes.&lt;br /&gt;
&lt;br /&gt;
Tic-Tool provides an option for a live compression heatmap (in gzthermal style) to show, how well different parts of the code could be compressed.&lt;br /&gt;
&lt;br /&gt;
==== Optimizing without a packer====&lt;br /&gt;
When you are happy with your intro and want to get it ready for release, it becomes time to look at squeezing those last bytes.&lt;br /&gt;
As a goal-post, you should always aim to have your uncompressed effect around the target size, and work from there.&lt;br /&gt;
&lt;br /&gt;
Final optimization can be done by stringing as much code together on single lines and removing any extra spaces and newlines.&lt;br /&gt;
A rule of thumb for this is that of the first or last character of a variable or function isn't a valid hex number (i.e. A-F) you can omit whitespace (so that: x=0 y=0 z=0 can become x=0y=0z=0)&lt;br /&gt;
&lt;br /&gt;
=== Release ===&lt;br /&gt;
For releasing an intro at a demoscene event, a raw TIC cartridge file without any additional graphics/sound/metadata is needed.&lt;br /&gt;
&lt;br /&gt;
Creating a TIC cartridge file adds a 4 byte header + 1 extra byte for a 0x11 sweetie16 chunk. &lt;br /&gt;
There are various packers that help you convert your (LUA) Script to a empty TIC Cartridge with a single ZLIB compressed code block and optional 0x11 (sweetie16) palette chunk. See the additional links for links to these packers.&lt;br /&gt;
 &lt;br /&gt;
==== Exporting Video as Animated GIF ====&lt;br /&gt;
The TIC-80 environment has a neat feature that lets you export your intro directly as an animated GIF file to converted to video later, by pressing the F9 key to start and stop recording. However, there is a default recording limit capped to a fixed number of frames or seconds. You can change this in the tic80 config to a bigger number to match your recording-size. &lt;br /&gt;
&lt;br /&gt;
If your intro is taking up too many resources and starts chugging a bit on your machine, it can be wise to make a version that steps through time linearly by adding a number to your t variable yourself instead of using the time() function.&lt;br /&gt;
&lt;br /&gt;
==== Online version: Metadata and Thumbnail image ====&lt;br /&gt;
When uploading the intro to the TIC-80 website for a playable online version, you will need to build a new TIC file with some added some meta-data and Thumbnail image (You can take this screenshot using the F7 key during the demo playback) and use this as you online version. The screenshot can also be imported from a 240×136 PNG (other size will throw an error) using inside TIC-80 console &amp;lt;code&amp;gt;import screen file[.png]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The Meta data is added at the top of your source code as follows&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- title: My intro&lt;br /&gt;
-- author: scener&lt;br /&gt;
-- desc: my first sizecoded TIC-80 intro&lt;br /&gt;
-- script: lua (or moon/wren/js/fennel)&lt;br /&gt;
-- license: MIT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As of version 0.9b the http://tic80.com website now also allows you to upload a separate TIC file with the metadata and keep the uploaded binary TIC file as code only.&lt;br /&gt;
&lt;br /&gt;
=== Additional Resources ===&lt;br /&gt;
Sizecoding on the TIC-80 is still in its infancy, but luckily there is already plenty of information to get you started!&lt;br /&gt;
&lt;br /&gt;
* TIC-80 Wiki page https://github.com/nesbox/TIC-80/wiki&lt;br /&gt;
* TIC-80 One page cheat sheet (PDF) https://zenithsal.com/assets/documents/tic-80_cheatsheet.pdf&lt;br /&gt;
* TIC-80 Intros and demos on Pouet (Press F1 for code): https://www.pouet.net/prodlist.php?platform%5B%5D=TIC-80&lt;br /&gt;
* TIC-80 TIC Cartridge File Format (from TIC-80 Wiki) https://github.com/nesbox/TIC-80/wiki/tic-File-Format&lt;br /&gt;
* TIC-80 Packer https://bitbucket.org/WaterEnVuur/tic80-packer/src/master/&lt;br /&gt;
* Pactic, fork de TIC-80 Packer https://github.com/phlubby/pactic&lt;br /&gt;
* TIC-Tool https://github.com/exoticorn/tic-tool&lt;br /&gt;
* pakettic, https://github.com/vsariola/pakettic&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Platform_comparison&amp;diff=1280</id>
		<title>Platform comparison</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Platform_comparison&amp;diff=1280"/>
				<updated>2023-02-19T13:12:54Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: Added useful Wikipedia links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Platform !! CPU !! Size efficiency (rough) !! Graphics !! Sound !! Memory !! Special hardware !! Special features&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Commodore Amiga]]''' OCS/ECS || '''[[Motorola 68000]]'''@7.14MHz || medium || 320x256 - 640x512&amp;lt;br /&amp;gt;up to 32 colors in 1-5 bitplanes (OCS)&amp;lt;br /&amp;gt;up to 64 colors in 6 bitplanes (ECS) || 4 PCM channels || 512 kB (OCS)&amp;lt;br /&amp;gt;1024 kB (ECS) || Blitter with&amp;lt;br /&amp;gt;line drawing and fill&amp;lt;br /&amp;gt;Copper || OS Libs&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Commodore Amiga]]''' AGA || 68020@14MHz -&amp;lt;br /&amp;gt;68060@66+MHz&amp;lt;br /&amp;gt;FPU on higher models || medium || 320x256 - 1280x512&amp;lt;br /&amp;gt;up to 256 colors in 1-8 bitplanes|| 4 PCM channels || 2048 kB || Blitter with&amp;lt;br /&amp;gt;line drawing and fill&amp;lt;br /&amp;gt;Copper || OS Libs&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Atari ST]]'''/STE || '''[[Motorola 68000]]'''@8MHz || TBD || TBD || TBD || TBD || TBD || TBD&lt;br /&gt;
|-&lt;br /&gt;
| Atari Falcon 030 || CPU 68030@16MHz&amp;lt;br /&amp;gt;FPU 68882@16MHz&amp;lt;br /&amp;gt;DSP56001@32MHz || TBD || TBD || TBD || TBD || TBD || TBD&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Atari Jaguar]]''' || '''[[Motorola 68000]]'''@13.3MHz || TBD || TBD || TBD || TBD || TBD || Gaming Console&amp;lt;br /&amp;gt;RISC graphics coprocessor&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example || Example || Example || Example || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| '''[[TIC-80]]''' || -&amp;lt;br /&amp;gt;(Lua interpreter on host system CPU) || high || 240x136, 16 colors || 4ch wavetables || 80 kB &amp;quot;chip&amp;quot;&amp;lt;br /&amp;gt;64 kB Lua code&amp;lt;br /&amp;gt;unlimited amount of allocateable memory || - || fast graphics primitives&lt;br /&gt;
|-&lt;br /&gt;
| '''[[PICO-8]]''' || 32b fictional@8MHz &amp;lt;br /&amp;gt;(modified Lua interpreter on host system CPU with made-up cycle counts for Lua opcodes) || high || 128x128, 16 colors || 4ch synth + 5.5 kHz PCM || 64 kB &amp;quot;chip&amp;quot;&amp;lt;br /&amp;gt;min(64 kB Lua code, 15kB compressed size, 8k tokens)&amp;lt;br /&amp;gt;2 MB Lua memory || - || fast graphics primitives&amp;lt;br /&amp;gt;powerful print()&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example || Example || Example || Example || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| '''[[ZX Spectrum]]''' || '''[[Z80]]'''@3.5MHz || high || 256×192 with&amp;lt;br /&amp;gt;color attributes per 8x8 block || 1b sound&amp;lt;br /&amp;gt;or 3ch AY-3-8912 soundchip || 16-128 kB || - || Helpful ROM routines&amp;lt;br /&amp;gt;incl. FP calculator engine&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Additional Ressources =====&lt;br /&gt;
&lt;br /&gt;
https://en.wikipedia.org/wiki/List_of_home_computers&amp;lt;br /&amp;gt;&lt;br /&gt;
https://en.wikipedia.org/wiki/List_of_home_computers_by_video_hardware&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Platform_comparison&amp;diff=1279</id>
		<title>Platform comparison</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Platform_comparison&amp;diff=1279"/>
				<updated>2023-02-18T13:58:39Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: Atari Jaguar updated, Atari Falcon added, minor edits&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Platform !! CPU !! Size efficiency (rough) !! Graphics !! Sound !! Memory !! Special hardware !! Special features&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Commodore Amiga]]''' OCS/ECS || '''[[Motorola 68000]]'''@7.14MHz || medium || 320x256 - 640x512&amp;lt;br /&amp;gt;up to 32 colors in 1-5 bitplanes (OCS)&amp;lt;br /&amp;gt;up to 64 colors in 6 bitplanes (ECS) || 4 PCM channels || 512 kB (OCS)&amp;lt;br /&amp;gt;1024 kB (ECS) || Blitter with&amp;lt;br /&amp;gt;line drawing and fill&amp;lt;br /&amp;gt;Copper || OS Libs&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Commodore Amiga]]''' AGA || 68020@14MHz -&amp;lt;br /&amp;gt;68060@66+MHz&amp;lt;br /&amp;gt;FPU on higher models || medium || 320x256 - 1280x512&amp;lt;br /&amp;gt;up to 256 colors in 1-8 bitplanes|| 4 PCM channels || 2048 kB || Blitter with&amp;lt;br /&amp;gt;line drawing and fill&amp;lt;br /&amp;gt;Copper || OS Libs&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Atari ST]]'''/STE || '''[[Motorola 68000]]'''@8MHz || TBD || TBD || TBD || TBD || TBD || TBD&lt;br /&gt;
|-&lt;br /&gt;
| Atari Falcon 030 || CPU 68030@16MHz&amp;lt;br /&amp;gt;FPU 68882@16MHz&amp;lt;br /&amp;gt;DSP56001@32MHz || TBD || TBD || TBD || TBD || TBD || TBD&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Atari Jaguar]]''' || '''[[Motorola 68000]]'''@13.3MHz || TBD || TBD || TBD || TBD || TBD || Gaming Console&amp;lt;br /&amp;gt;RISC graphics coprocessor&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example || Example || Example || Example || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| '''[[TIC-80]]''' || -&amp;lt;br /&amp;gt;(Lua interpreter on host system CPU) || high || 240x136, 16 colors || 4ch wavetables || 80 kB &amp;quot;chip&amp;quot;&amp;lt;br /&amp;gt;64 kB Lua code&amp;lt;br /&amp;gt;unlimited amount of allocateable memory || - || fast graphics primitives&lt;br /&gt;
|-&lt;br /&gt;
| '''[[PICO-8]]''' || 32b fictional@8MHz &amp;lt;br /&amp;gt;(modified Lua interpreter on host system CPU with made-up cycle counts for Lua opcodes) || high || 128x128, 16 colors || 4ch synth + 5.5 kHz PCM || 64 kB &amp;quot;chip&amp;quot;&amp;lt;br /&amp;gt;min(64 kB Lua code, 15kB compressed size, 8k tokens)&amp;lt;br /&amp;gt;2 MB Lua memory || - || fast graphics primitives&amp;lt;br /&amp;gt;powerful print()&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example || Example || Example || Example || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| '''[[ZX Spectrum]]''' || '''[[Z80]]'''@3.5MHz || high || 256×192 with&amp;lt;br /&amp;gt;color attributes per 8x8 block || 1b sound&amp;lt;br /&amp;gt;or 3ch AY-3-8912 soundchip || 16-128 kB || - || Helpful ROM routines&amp;lt;br /&amp;gt;incl. FP calculator engine&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Platform_comparison&amp;diff=1278</id>
		<title>Platform comparison</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Platform_comparison&amp;diff=1278"/>
				<updated>2023-02-18T13:32:09Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: added more Amiga details, some first Wiki links, minor edits&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Platform !! CPU !! Size efficiency (rough) !! Graphics !! Sound !! Memory !! Special hardware !! Special features&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Commodore Amiga]]''' OCS/ECS || '''[[Motorola 68000]]'''@7.14MHz || medium || 320x256 - 640x512&amp;lt;br /&amp;gt;up to 32 colors in 1-5 bitplanes (OCS)&amp;lt;br /&amp;gt;up to 64 colors in 6 bitplanes (ECS) || 4 PCM channels || 512 kB (OCS)&amp;lt;br /&amp;gt;1024 kB (ECS) || Blitter with&amp;lt;br /&amp;gt;line drawing and fill&amp;lt;br /&amp;gt;Copper || OS Libs&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Commodore Amiga]]''' AGA || 68020@14MHz -&amp;lt;br /&amp;gt;68060@66+MHz&amp;lt;br /&amp;gt;FPU on higher models || medium || 320x256 - 1280x512&amp;lt;br /&amp;gt;up to 256 colors in 1-8 bitplanes|| 4 PCM channels || 2048 kB || Blitter with&amp;lt;br /&amp;gt;line drawing and fill&amp;lt;br /&amp;gt;Copper || OS Libs&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Atari ST]]'''/STE || '''[[Motorola 68000]]'''@8MHz || Example || Example || Example || Example || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Atari Jaguar]]''' || Example || Example || Example || Example || Example || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example || Example || Example || Example || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| '''[[TIC-80]]''' || -&amp;lt;br /&amp;gt;(Lua interpreter on host system CPU) || high || 240x136, 16 colors || 4ch wavetables || 80 kB &amp;quot;chip&amp;quot;&amp;lt;br /&amp;gt;64 kB Lua code&amp;lt;br /&amp;gt;unlimited amount of allocateable memory || - || fast graphics primitives&lt;br /&gt;
|-&lt;br /&gt;
| '''[[PICO-8]]''' || 32b fictional@8MHz &amp;lt;br /&amp;gt;(modified Lua interpreter on host system CPU with made-up cycle counts for Lua opcodes) || high || 128x128, 16 colors || 4ch synth + 5.5 kHz PCM || 64 kB &amp;quot;chip&amp;quot;&amp;lt;br /&amp;gt;min(64 kB Lua code, 15kB compressed size, 8k tokens)&amp;lt;br /&amp;gt;2 MB Lua memory || - || fast graphics primitives&amp;lt;br /&amp;gt;powerful print()&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example || Example || Example || Example || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| '''[[ZX Spectrum]]''' || '''[[Z80]]'''@3.5MHz || high || 256×192 with&amp;lt;br /&amp;gt;color attributes per 8x8 block || 1b sound&amp;lt;br /&amp;gt;or 3ch AY-3-8912 soundchip || 16-128 kB || - || Helpful ROM routines&amp;lt;br /&amp;gt;incl. FP calculator engine&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Platform_comparison&amp;diff=1275</id>
		<title>Platform comparison</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Platform_comparison&amp;diff=1275"/>
				<updated>2023-02-17T17:33:27Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: Initial table with some first entries&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Platform !! CPU !! Size efficiency (rough) !! Graphics !! Sound !! Memory !! Special hardware !! Special features&lt;br /&gt;
|-&lt;br /&gt;
| Amiga OCS || 16b/32b 68000@7.14MHz || medium || 320x256 1-5 bitplanes || 4 PCM channels || 512 kB || Blitter&amp;lt;br /&amp;gt;Copper || Libs&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example || Example || Example || Example || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| TIC-80|| -&amp;lt;br /&amp;gt;(Lua interpreter on host system CPU) || high || 240x136, 16 colors || 4ch wavetables || 80 kB &amp;quot;chip&amp;quot;&amp;lt;br /&amp;gt;64 kB Lua code&amp;lt;br /&amp;gt;unlimited amount of allocateable memory || - || fast graphics primitives&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example || Example || Example || Example || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| ZX Spectrium || 8b Z80@3.5MHz || high || 256×192 with&amp;lt;br /&amp;gt;color attributes per 8x8 block || 1b sound&amp;lt;br /&amp;gt;or 3ch AY-3-8912 soundchip || 16-128 kB || - || Helpful ROM routines&amp;lt;br /&amp;gt;incl. FP calculator engine&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Motorola_68000&amp;diff=1271</id>
		<title>Motorola 68000</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Motorola_68000&amp;diff=1271"/>
				<updated>2023-02-06T21:24:31Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: Added 2 resource links related to Easy68k&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Wanting to start sizecoding on a Motorola 68k platform in this day and age can be tough. &lt;br /&gt;
&lt;br /&gt;
So here is a bit of help to get you started:&lt;br /&gt;
&lt;br /&gt;
=== The Motorola 68k processor  ===&lt;br /&gt;
The Motorola 68k processor is a 16-bit Big-Endian format processor, using 32-bit register and addresses.&lt;br /&gt;
&lt;br /&gt;
This means that instruction sizes on average are either 2 or 4 bytes each, and 6 bytes for longword / 32-bit instructions.&lt;br /&gt;
&lt;br /&gt;
Note: The assigment direction is source,dest instead of dest,source !!!&lt;br /&gt;
&lt;br /&gt;
==== Registers ====&lt;br /&gt;
&lt;br /&gt;
* D0..D7 - 8 x 32 bit General Purpose Registers&lt;br /&gt;
&lt;br /&gt;
* A0..A6 - 7 x 32 bit Address Registers&lt;br /&gt;
&lt;br /&gt;
* A7 - 32-bit Stack-Address Register&lt;br /&gt;
&lt;br /&gt;
==== Instructions timing ====&lt;br /&gt;
The number of cycles for each instruction is different depending of processor model in M68K family.&lt;br /&gt;
: http://oldwww.nvg.ntnu.no/amiga/MC680x0_Sections/mc68000timing.HTML&lt;br /&gt;
&lt;br /&gt;
== Size considerations ==&lt;br /&gt;
Here are some general rule of thumbs when it comes to size consideration when programming the M68000&lt;br /&gt;
&lt;br /&gt;
* Moving/Calculating Register from/to registers - 2 bytes&lt;br /&gt;
* Moving/Calculating with byte or word values - 4 bytes&lt;br /&gt;
* Moving/Calculating with long values - 6 bytes&lt;br /&gt;
&lt;br /&gt;
Shorter variants:&lt;br /&gt;
* moveq #value, reg : 2 bytes - Moves a values -128...127 to a register&lt;br /&gt;
* addq #value, reg : 2 bytes - Adds a values 0..8 to a register&lt;br /&gt;
* subq #value, reg : 2 bytes - Subtracts a values 0..8 from a register&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* [http://www.beycan.net/eklenen/M68000_Instruction_Set.pdf M68000 Instruction Set]&lt;br /&gt;
* [http://www.easy68k.com/ EASy68K Editor/Assembler/Simulator for the 68000]&lt;br /&gt;
* [http://www.easy68k.com/paulrsm/index.html Various Motorola 68k resources]&lt;br /&gt;
&lt;br /&gt;
== Motorola M68K Platforms ==&lt;br /&gt;
*'''[[Atari ST]]''' - Atari ST Sizecoding information&lt;br /&gt;
*'''[[Atari Jaguar]]''' - Atari Jaguar Sizecoding information&lt;br /&gt;
*'''[[Commodore Amiga]]''' - Commodore Amiga Sizecoding information&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Z80&amp;diff=848</id>
		<title>Z80</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Z80&amp;diff=848"/>
				<updated>2021-05-02T22:23:55Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: /* Make some noise - AY */ fixed a typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Wanting to start sizecoding on a Z80 platform in this day and age can be tough. &lt;br /&gt;
&lt;br /&gt;
So here is a bit of help to get you started:&lt;br /&gt;
&lt;br /&gt;
=== Registers ===&lt;br /&gt;
The Z80 can be seen as the little 8-bit brother of X86 chipsets, with many similarities.&lt;br /&gt;
If you are coming from a X86 background, this might help you get a bit more grip on the Z80.&lt;br /&gt;
These are the register pairs of the Z80, as seen from a X86 programmers perspective.&lt;br /&gt;
&lt;br /&gt;
* AF = AL + Flags&lt;br /&gt;
* HL = Can be seen as BX (H=BH,L=BL) or SI in a (HL) setting, like BX also used for addressing.&lt;br /&gt;
* BC = Can be seen as CX (B=CH,C=CL), often used for loops &lt;br /&gt;
* DE = Can be seen as DX (D=DH,E=DL) or DI in a (DE) setting&lt;br /&gt;
* IX = 16 bit Index Register X, can also be accessed with IXH,IXL &lt;br /&gt;
* IY = 16 bit Index Register Y, can also be accessed with IYH,IYL&lt;br /&gt;
&lt;br /&gt;
For each of the main registers there also exists a shadow register. These cannot be accessed directly, but must be swapped in and out with the main register set. The shadow registers are usually denoted by the ' symbol. They can be swapped with the following commands:&lt;br /&gt;
* EX AF,AF' = Swaps AF with AF'&lt;br /&gt;
* EXX = Swaps BC, DE and HL with BC', DE' and HL' &lt;br /&gt;
There are no shadow registers for the index registers.&lt;br /&gt;
&lt;br /&gt;
Note: For a lot of operations, you can only use the A(8bit) and HL(16bit) registers. &lt;br /&gt;
The Sjasmplus assembler doesn't really do proper syntax checking for this so beware.&lt;br /&gt;
&lt;br /&gt;
=== Instructions ===&lt;br /&gt;
Here is a rough translation for some of the Z80 instructions:&lt;br /&gt;
&lt;br /&gt;
* BIT = TEST&lt;br /&gt;
* CP = CMP  (although the Z80 has many other handy compare functionality)&lt;br /&gt;
* DJNZ = LOOP (decreases B and checks not zero)&lt;br /&gt;
* EXE = Exchange all registers with Shadow registers, can be used a bit like PUSHA/POPA&lt;br /&gt;
* EX = XCHG&lt;br /&gt;
* HALT = HLT&lt;br /&gt;
* JP = JMP&lt;br /&gt;
* JR = JMP NEAR (Jump Relative)&lt;br /&gt;
* LD = MOV&lt;br /&gt;
* LDI = MOVSB   (tmp=(HL),(DE)=tmp, DE++, HL++)&lt;br /&gt;
* LDIR = REP MOVSB   (tmp=(HL),(DE)=tmp, DE++, HL++, BC--)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Learning Z80 Assembler ===&lt;br /&gt;
There are many Z80 tutorials available online, but one i found very simple and clear is at this 1996 styled webpage ;-)  &lt;br /&gt;
&lt;br /&gt;
* http://www.z80.info/lesson1.htm&lt;br /&gt;
* http://www.z80.info/lesson2.htm&lt;br /&gt;
* http://www.z80.info/lesson3.htm&lt;br /&gt;
* http://www.z80.info/lesson4.htm&lt;br /&gt;
* http://www.z80.info/lesson5.htm&lt;br /&gt;
&lt;br /&gt;
There is no proper index-page for this, which is why i linked all the lessons above, but you can continue to the next lesson by clicking at the next lesson at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
Also, here is a compact 'cheat sheet' with some basics for various Z80 systems:&lt;br /&gt;
https://www.chibiakumas.com/z80/CheatSheet.pdf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ZX Spectrum  ==&lt;br /&gt;
The ZX Spectrum consists of a Z80A @ 3.5 MHz CPU with either 16k, 48k or 128K of RAM. Most demos are targeted at the Spectrum 128 because it includes more memory, a shadow screen buffer and an AY soundchip. The different models have slightly different timings - this will cause issues if you are doing cycle-exact effects like multi-color.&lt;br /&gt;
&lt;br /&gt;
=== Setting up ===&lt;br /&gt;
Setting up your development platform for the ZX Spectrum is quite easy, first get the following tools:&lt;br /&gt;
&lt;br /&gt;
* Assembler: SJASMPLUS -This assembler has nice macros for creating Binaries and SNA snapshot files out of the box. You can download it at https://sourceforge.net/projects/sjasmplus/&lt;br /&gt;
* Pasmo - for the .TAP create. Available at : http://pasmo.speccy.org&lt;br /&gt;
* Emulator(s): I Found [https://www.zophar.net/sinclair/zx-spin.html ZX Sping], [https://sourceforge.net/projects/fuse-emulator/ FUSE], [https://sourceforge.net/projects/unrealspeccyp/ UnrealSpeccy] and [https://www.aptanet.org/eightyone/ EightyOne] to work best for my usecase. Most emulators can read TAP, SNA and TRD files out of the box.&lt;br /&gt;
&lt;br /&gt;
=== Start values ===&lt;br /&gt;
Upon startup (when called from basic), the following values can assumed:&lt;br /&gt;
&lt;br /&gt;
* The alternate HL register is set to 0x2758&lt;br /&gt;
* BC = start address&lt;br /&gt;
* A = C&lt;br /&gt;
&lt;br /&gt;
=== Video display ===&lt;br /&gt;
Video display on the ZX Spectrum is mostly CPU based with little hardware features. No hardware sprites, no specific text or video modes, only a 256x192 byte screenbuffer with 1bit pixeldata located at $4000 in memory. &lt;br /&gt;
It is ordened a bit strange in 3 sections of 256x64 pixels, then character rows, then subrows.&lt;br /&gt;
&lt;br /&gt;
Address = 010RRLLL RRRCCCCC &lt;br /&gt;
&lt;br /&gt;
* where RRRRR is the row number (0..23)&lt;br /&gt;
* CCCCC is the column number (0..31)&lt;br /&gt;
* LLL is the line number within the cell (0..7)&lt;br /&gt;
&lt;br /&gt;
Calculating a screen address from XY coordinates is complicated due to the weird screen layout. In a larger demo you would generate a lookup table - it's usually best to avoid such calculations in small demos, but it can be done in under 30 bytes, eg: http://www.breakintoprogram.co.uk/computers/zx-spectrum/screen-memory-layout&lt;br /&gt;
&lt;br /&gt;
==== Adding Color ====&lt;br /&gt;
The ZX Spectrum has a 32x24 colormap located at $5800 where you can write color information for each 8x8 tile. &lt;br /&gt;
It has has 8 colors (INK and PAPER) with 2 brightness settings that can be set like this.&lt;br /&gt;
&lt;br /&gt;
color = brightness(64) | (PAPER&amp;lt;&amp;lt;3) | INK&lt;br /&gt;
&lt;br /&gt;
Because updating pixel memory can be slow, especially when you are grasping for bytes, some of the tiny intros on the zx spectrum prefer to use the colorram for the effect, sometimes in combination with an overlaying pattern.&lt;br /&gt;
&lt;br /&gt;
==== Border Color ====&lt;br /&gt;
You can set the border color to any of the 8 colors with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
ld a,0 ; bottom three bits of a contain the color&lt;br /&gt;
out (254),a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Memory Configuration ===&lt;br /&gt;
128K separated to 8 pages (16384 bytes size)&lt;br /&gt;
Default configuration is:&lt;br /&gt;
&lt;br /&gt;
: page 5: $4000-$7fff&lt;br /&gt;
: page 2: $8000-$Bfff&lt;br /&gt;
: page 0: $C000-$Ffff&lt;br /&gt;
&lt;br /&gt;
There are two screens - page 7 and page 5.&lt;br /&gt;
port $7FFD allow to control memory and screens:&lt;br /&gt;
: bits 0-2 - page number mapped to memory at $C0000&lt;br /&gt;
: bit 3 - Select page 5(0) or page 7(1) to be displayed.&lt;br /&gt;
: bit 4 - ROM Select. 0-128K,1-48K&lt;br /&gt;
&lt;br /&gt;
Example of use&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
loop: ei&lt;br /&gt;
 halt&lt;br /&gt;
pg: ld a,$17&lt;br /&gt;
 ld bc,$7ffd&lt;br /&gt;
 out (c),a&lt;br /&gt;
 xor $0A&lt;br /&gt;
 ld (pg+1),a&lt;br /&gt;
... do something with $C000-$DB00&lt;br /&gt;
 jp loop&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$17 is use 48K, map page 7&lt;br /&gt;
After xor $0A we'll get value $1D(use 48K ROM, display screen at page 7 and map page5 at $C000).This is so-called &amp;quot;double buffering&amp;quot;.&lt;br /&gt;
See also : https://worldofspectrum.org/faq/reference/128kreference.htm&lt;br /&gt;
&lt;br /&gt;
==== Getting something on screen ====&lt;br /&gt;
Now to get something on screen, lets fill our colorram with a simple AND pattern, like so:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
 ld de,5800h&lt;br /&gt;
 ld b,24&lt;br /&gt;
yloop:&lt;br /&gt;
   ld c,32&lt;br /&gt;
xloop:&lt;br /&gt;
   ld a,c&lt;br /&gt;
   and b&lt;br /&gt;
   and 7    ; make sure range is 0..7&lt;br /&gt;
   ld (de),a&lt;br /&gt;
   inc de&lt;br /&gt;
   dec c&lt;br /&gt;
   jr nz,xloop&lt;br /&gt;
djnz yloop&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using a Backbuffer ====&lt;br /&gt;
While the above code will run fine, you might want to consider using a backbuffer for more complex stuff. You can then simply write to another adress define by BACKBUFFER (for example A000) and copy the buffer to colorram like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
halt               ; synchronize &lt;br /&gt;
ld hl,BACKBUFFER   &lt;br /&gt;
ld de,5800h&lt;br /&gt;
ld bc,768&lt;br /&gt;
ldir&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another alternative method is to use the 128's memory paging, which provides a second screen buffer. This buffer is located at a different memeory location, but otherwise it is the same:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
	; main loop starts here&lt;br /&gt;
	ld	a,00010111b	; set up memory banks and screen here&lt;br /&gt;
mainloop&lt;br /&gt;
	halt			; sync&lt;br /&gt;
	xor	00001010b	; flip screens&lt;br /&gt;
	out	($fd),a&lt;br /&gt;
	push	af&lt;br /&gt;
&lt;br /&gt;
	; render code goes here&lt;br /&gt;
	; screen buffer is location at 0xC000 instead of 0x4000&lt;br /&gt;
&lt;br /&gt;
	pop	af&lt;br /&gt;
	jr	mainloop&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Overlaying simple graphics ====&lt;br /&gt;
If you don't want to use a solid color/tile for. &lt;br /&gt;
You could copy a single tile across the screen at startup for some flair.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
   ld a,0x55   ; 01010101 pattern&lt;br /&gt;
   ld bc,0x1800&lt;br /&gt;
copyloop:&lt;br /&gt;
   ld (de),a&lt;br /&gt;
   inc de&lt;br /&gt;
   dec c&lt;br /&gt;
jr nz,copyloop&lt;br /&gt;
djnz copyloop&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you could generate a pattern using logic operations or random noise/data.&lt;br /&gt;
==== Useful routines ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
;calculate address of next line,HL=address&lt;br /&gt;
down_hl:&lt;br /&gt;
 INC h&lt;br /&gt;
 LD A,h&lt;br /&gt;
 AND 7&lt;br /&gt;
 RET NZ&lt;br /&gt;
 LD A,L&lt;br /&gt;
 ADD A,#20&lt;br /&gt;
 LD L,A&lt;br /&gt;
 RET C&lt;br /&gt;
 LD A,H&lt;br /&gt;
 SUB 8&lt;br /&gt;
 LD H,A&lt;br /&gt;
 RET&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
;move up at screen, HL=address&lt;br /&gt;
up_hl&lt;br /&gt;
     LD A,H&lt;br /&gt;
     DEC H&lt;br /&gt;
     AND 7&lt;br /&gt;
     ret nz&lt;br /&gt;
     LD A,L&lt;br /&gt;
     SUB 32&lt;br /&gt;
     LD L,A&lt;br /&gt;
     ret c&lt;br /&gt;
     LD A,H&lt;br /&gt;
     ADD A,8&lt;br /&gt;
     LD H,A&lt;br /&gt;
 ret&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
;write pixel&lt;br /&gt;
 CALL  8933 ; C=X(0..255),B=Y(0..175),5C7D=COORDS&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
;Calculate vertical line screen Address, IN : A=Y coordinate, OUT : HL=address&lt;br /&gt;
py2saddr:&lt;br /&gt;
        ld l,a&lt;br /&gt;
;	ld a,l&lt;br /&gt;
	and $07&lt;br /&gt;
	ld h,a&lt;br /&gt;
	ld a,l&lt;br /&gt;
	and $c0&lt;br /&gt;
	rra&lt;br /&gt;
	inc a&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	or h&lt;br /&gt;
	ld h,a&lt;br /&gt;
	ld a,l&lt;br /&gt;
	add a&lt;br /&gt;
	add a&lt;br /&gt;
	and $e0&lt;br /&gt;
	ld l,a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
;Calculate Attribute address, IB: reg D=Y,reg E=X, OUT: HL=address, destroys DE&lt;br /&gt;
 ld l,d&lt;br /&gt;
 add hl,hl&lt;br /&gt;
 add hl,hl&lt;br /&gt;
 ld h,$11&lt;br /&gt;
 add hl,hl&lt;br /&gt;
 add hl,hl&lt;br /&gt;
 add hl,hl&lt;br /&gt;
 ld d,0&lt;br /&gt;
 add hl,de&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or alter version&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
;H=Y coordinate,L=X coordinate&lt;br /&gt;
	ld a,h&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	rrca&lt;br /&gt;
	push af&lt;br /&gt;
	and 3&lt;br /&gt;
	add a,$58&lt;br /&gt;
	ld h,a&lt;br /&gt;
	pop af&lt;br /&gt;
	and %11100000&lt;br /&gt;
	add a,l&lt;br /&gt;
	ld l,a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
calculate Pixel coordinate&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
;IN: A=X coordinate,C=L=Y coordinate&lt;br /&gt;
;OUT: HL=screen address,A=bit value&lt;br /&gt;
call #22B0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&lt;br /&gt;
The original Spectrum has only a 1 bit sound capability (BEEP) through its internal speaker.&lt;br /&gt;
Later models included the AY-3-8910 Soundchip which provides 3 channels of PSG sound.&lt;br /&gt;
&lt;br /&gt;
==== Make some noise - Beeper ====&lt;br /&gt;
Setting/toggling bit 4 of port 254 will enable the beeper speaker.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
		ld a,$10	;Bit 4 set&lt;br /&gt;
beeploop:	xor $10		;toggle Bit 4&lt;br /&gt;
		out (254),a&lt;br /&gt;
		ld b,90		;wait&lt;br /&gt;
		djnz $&lt;br /&gt;
		jp beeploop&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note that the bottom three bits of port 254 also set the border color (see above).&lt;br /&gt;
&lt;br /&gt;
==== Make some noise - AY ====&lt;br /&gt;
You can access the AY soundchip by outputting to the following ports:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;z80&amp;quot;&amp;gt;&lt;br /&gt;
ld bc,0xfffd&lt;br /&gt;
ld a, ay register number&lt;br /&gt;
out (c),a&lt;br /&gt;
ld b,0xbf	&lt;br /&gt;
ld a, data byte&lt;br /&gt;
out (c),a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more information about the soundchip, check out:&lt;br /&gt;
https://www.atarimagazines.com/v4n7/stsound.html&lt;br /&gt;
&lt;br /&gt;
=== Small demos with documented source code ===&lt;br /&gt;
* Ceci N'est Pas Un Cube by Ate Bit https://www.pouet.net/prod.php?which=29691&lt;br /&gt;
* Zxwister by Ate Bit https://www.pouet.net/prod.php?which=44123&lt;br /&gt;
* Muse by Ate Bit https://www.pouet.net/prod.php?which=62880&lt;br /&gt;
* Starlet Guitarlet by HOOY-PROGRAM https://www.pouet.net/prod.php?which=52553&lt;br /&gt;
* Clangers On The Dancefloor by HOOY-PROGRAM https://www.pouet.net/prod.php?which=29696&lt;br /&gt;
* Chessington World Of Adventure by HOOY-PROGRAM https://www.pouet.net/prod.php?which=76074&lt;br /&gt;
* Roll Me Gently by Joker https://www.pouet.net/prod.php?which=86338&lt;br /&gt;
&lt;br /&gt;
=== Additional Resources ===&lt;br /&gt;
I found resources on ZX Spectrum sizecoding to be sparse.&lt;br /&gt;
* All kinds of Z80 Information http://www.z80.info/index.htm&lt;br /&gt;
* Another source for good Z80 Information http://z80-heaven.wikidot.com&lt;br /&gt;
* Assembler subforum on world of spectrum https://worldofspectrum.org/forums/categories/assembler&lt;br /&gt;
* Development subforum on Spectrum Computing https://spectrumcomputing.co.uk/forums/viewforum.php?f=6&lt;br /&gt;
* Blogpost on ZX Spectrum coding from a X86 coder's perspective on superogue's sizecdoing blog http://marquee.revival-studios.com/blog/blog_fluxus.html&lt;br /&gt;
* 128byte/256 byte zx spectrum productions by goblinish https://www.pouet.net/groups.php?which=11696&amp;amp;order=type&lt;br /&gt;
* 128byte/256 byte zx spectrum productions by gasman https://www.pouet.net/groups.php?which=1218&amp;amp;order=type&lt;br /&gt;
* Easy to read list of all Z80 instructions (including undocumented ones) with size and timing information https://clrhome.org/table/&lt;br /&gt;
* Detailed information on the screen layout http://www.overtakenbyevents.com/lets-talk-about-the-zx-specrum-screen-layout/ http://www.overtakenbyevents.com/lets-talk-about-the-zx-specrum-screen-layout-part-two/ and http://www.overtakenbyevents.com/lets-talk-about-the-zx-specrum-screen-layout-part-three/&lt;br /&gt;
&lt;br /&gt;
== Amstrad CPC ==&lt;br /&gt;
The Amstrad consists of a Z80A @ 3.5 MHz CPU &lt;br /&gt;
&lt;br /&gt;
=== Setting up ===&lt;br /&gt;
Setting up..&lt;br /&gt;
&lt;br /&gt;
* Assembler: -&lt;br /&gt;
* Emulator(s): -&lt;br /&gt;
&lt;br /&gt;
=== Video Display ===&lt;br /&gt;
No information yet&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&lt;br /&gt;
No information yet&lt;br /&gt;
&lt;br /&gt;
=== Additional Resources ===&lt;br /&gt;
* 64 NOPs Amstrad CPC Tech Blog - https://64nops.wordpress.com/&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Compos&amp;diff=373</id>
		<title>Compos</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Compos&amp;diff=373"/>
				<updated>2020-04-09T07:30:28Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: Initial Compo page with table template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Sizecoding Compos at various Demo Parties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Party !! Date !! Location !! Sizes !! Deadline !! Compo Machine !! Remote Entries !! Rules&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example || Example || Example || Example || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example || Example || Example || Example || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example || Example || Example || Example || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example || Example || Example || Example || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example || Example || Example || Example || Example || Example&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Resources&amp;diff=371</id>
		<title>Resources</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Resources&amp;diff=371"/>
				<updated>2019-11-07T11:35:20Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Discussions ==&lt;br /&gt;
&lt;br /&gt;
Pouet's [http://www.pouet.net/topic.php?which=8791&amp;amp;page=1 Tiny Intro Toolbox Thread] was one of sizecoding.org's main inspirations.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
The Hugi demoscene diskmag has been kind to the sizecoding movement.  They included [http://www.hugi.scene.org/online/coding/hugi%20se%204%20-%20index%20sorted%20by%20topic.htm many programming articles] since it started in 1996.  Additionally, the [http://www.hugi.scene.org/compo/compoold.htm Hugi Size Coding Competition Series] is the gold standard for learning how to sizecode:  Each competition was given a specific task, then participants submitted their results.  ([http://retrolandia.net/hugi/showthread.php?tid=7&amp;amp;pid=13#pid13 All of the entries with their source code] are available, as are [http://retrolandia.net/hugi/showthread.php?tid=7&amp;amp;pid=396#pid396 the rules for each challenge].)  Hugi #35 also provided a [http://hugi.scene.org/online/hugi35/hugi%2035%20-%20demoscene%20forum%20adok%20256b%20intros%20round-table.htm 256b intros round-table] between Baze, Digimind, &amp;amp;#344;r&amp;amp;#345;ola, Pirx, Optimus, and Seven.&lt;br /&gt;
&lt;br /&gt;
During the last years 256b intro coding was also a topic in some demo party presentation sessions. The recordings are available on YouTube. There are &lt;br /&gt;
[https://www.youtube.com/watch?v=WbWYBE9vjdk part 1] and [https://www.youtube.com/watch?v=51BOp5Pi4mU part 2] of Řrřola's talk &amp;quot;Magic of 256-byte x86 intros&amp;quot; held at Demobit 2017 and 2018 respectively. A similar talk [https://www.youtube.com/watch?v=V_ntnQKemWA &amp;quot;256 byte intros on modern PCs&amp;quot;] was held by TomCat/Abaddon at the Function 2017 party. Supplemental files can be downloaded from [http://www.pouet.net/prod.php?which=72454 Pouet.net]. The presentations cover everything from setting up the coding environment to all kinds of code optimization, constant reuse, flag tricks, palette generation, and how to get from an idea to the final intro. TomCat also provides a [https://www.abaddon.hu/256b/ dev tools page] and his [https://www.abaddon.hu/256b/ SizeCoding Blog] with lots of optimization ideas.&lt;br /&gt;
&lt;br /&gt;
fysnet.net has an extensive [http://www.fysnet.net/yourhelp.htm list of DOS .COM register starting values].  If your environment isn't listed, [http://www.fysnet.net/yourhelp.com a program] is also available that can print out all of the register starting values.  See also [http://pferrie.host22.com/misc/lowlevel12.htm DOS Register Starting Values] to understand why the register starting values for .COM files are set the way that they are.&lt;br /&gt;
&lt;br /&gt;
The [http://sparksandflames.com/files/x86InstructionChart.html Sparks And Flames x86 Instruction Chart] is awesome, once you can &amp;quot;read&amp;quot; it. Find out what the bright green (1-byte) commands do, and use them. For the extreme sizecoding (&amp;lt;=32 bytes) it's also very useful to have the HEX value in sight.&lt;br /&gt;
&lt;br /&gt;
The [http://ref.x86asm.net/geek.html Geek Edition x86asm-ref] is comprehensive and dense.  It might be the only reference you'll need.  The [http://ref.x86asm.net/geek.html#modrm_byte_16 last part] covers modr/m bytes, which is useful.&lt;br /&gt;
&lt;br /&gt;
[http://x86.renejeschke.de/ Rene Jeschke's preservation of siyobik.com's x86 Documentation] is one of the most compact and understandable references to the x86 instruction set you'll ever see.&lt;br /&gt;
&lt;br /&gt;
Intel IA-32 Software Developer's Manual Instruction Set Reference [http://www.jaist.ac.jp/iscenter-new/mpc/altix/altixdata/opt/intel/vtune/doc/users_guide/mergedProjects/analyzer_ec/mergedProjects/reference_olh/mergedProjects/instructions/whgdata/whlstt2.htm hypertext version].&lt;br /&gt;
&lt;br /&gt;
[http://www.rcollins.org/secrets/OpCodes.html Robert Collins' Undocumented Opcodes] page has some gems you can exploit depending on your target environment.&lt;br /&gt;
&lt;br /&gt;
[http://wiki.osdev.org/PC_Speaker PC Speaker Basics] For everything from simple bleeps to sophisticated synthesizers.&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Program_Segment_Prefix Program Segment Prefix] : what's in front of our .COM code, and why.&lt;br /&gt;
&lt;br /&gt;
Never underestimate [http://www.hugi.scene.org/online/coding/hugi%2017%20-%20coaax.htm The Hidden Power of BCD Instructions].&lt;br /&gt;
&lt;br /&gt;
[http://www.agner.org/optimize/optimizing_assembly.pdf An optimization guide for x86 platforms By Agner Fog] Chapter 10: Optimizing for size.&lt;br /&gt;
&lt;br /&gt;
[http://home.sch.bme.hu/~ervin/codegems.html Code Gems by Ervin/AbaddoN] Nice collection based on the Imphobia diskmagazine article.&lt;br /&gt;
&lt;br /&gt;
[http://wiki.osdev.org/Programmable_Interval_Timer Programmable Interval Timer]: Timing is everything, if you're targeting a slow system. Very old but good text [http://www.phatcode.net/res/246/files/pctim003.txt PCTIM003.TXT]&lt;br /&gt;
&lt;br /&gt;
[http://stanislavs.org/helppc/bios_data_area.html BIOS data area]: Direct system communication overview.  There are environment values here you may be able to utilize.&lt;br /&gt;
&lt;br /&gt;
[https://www.midi.org/specifications/item/table-1-summary-of-midi-message Summary of MIDI messages] : Summary of all basic MIDI messages.&lt;br /&gt;
&lt;br /&gt;
[http://www.voidaudio.net/percussion.html Roland GS/GM2 Drum Set List and Note Map] : Detailed Description of all MIDI drumkits.&lt;br /&gt;
&lt;br /&gt;
[http://www.h-schmidt.net/FloatConverter/IEEE754.html Online IEEE 754 Converter] : Excellent tool for optimizing/reusing FPU constants&lt;br /&gt;
&lt;br /&gt;
[https://www.reddit.com/r/tinycode Tinycode on Reddit]: Collection of many different size coding productions incl. x86 based ones with discussion (mostly provided by [https://www.reddit.com/user/Hell__Mood/ HellMood] himself)&lt;br /&gt;
&lt;br /&gt;
== Repositories ==&lt;br /&gt;
&lt;br /&gt;
Tinyprogs are so small that you sometimes don't need the source code to understand them:  Just pop them into a disassembler (like IDA) or a debugger and look at them.  If you want to grab specimens for study, here are some places to start.&lt;br /&gt;
&lt;br /&gt;
Pouet can be searched for the latest tinyprogs:  [http://www.pouet.net/prodlist.php?type%5B%5D=256b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 256b], [http://www.pouet.net/prodlist.php?type%5B%5D=128b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 128b], [http://www.pouet.net/prodlist.php?type%5B%5D=64b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 64b], and even [http://www.pouet.net/prodlist.php?type%5B%5D=32b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 32b and smaller].&lt;br /&gt;
&lt;br /&gt;
[http://hardcode.untergrund.net/ HardCode] is a repository of 7800 64KB and smaller intros.&lt;br /&gt;
&lt;br /&gt;
[http://256bytes.untergrund.net 256b.com] is a website dedicated primarily to 256b and smaller releases.&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Resources&amp;diff=370</id>
		<title>Resources</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Resources&amp;diff=370"/>
				<updated>2019-11-07T11:33:50Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: /* References */ Added more resources from TomCat and the Tinycode Reddit.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Discussions ==&lt;br /&gt;
&lt;br /&gt;
Pouet's [http://www.pouet.net/topic.php?which=8791&amp;amp;page=1 Tiny Intro Toolbox Thread] was one of sizecoding.org's main inspirations.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
The Hugi demoscene diskmag has been kind to the sizecoding movement.  They included [http://www.hugi.scene.org/online/coding/hugi%20se%204%20-%20index%20sorted%20by%20topic.htm many programming articles] since it started in 1996.  Additionally, the [http://www.hugi.scene.org/compo/compoold.htm Hugi Size Coding Competition Series] is the gold standard for learning how to sizecode:  Each competition was given a specific task, then participants submitted their results.  ([http://retrolandia.net/hugi/showthread.php?tid=7&amp;amp;pid=13#pid13 All of the entries with their source code] are available, as are [http://retrolandia.net/hugi/showthread.php?tid=7&amp;amp;pid=396#pid396 the rules for each challenge].)  Hugi #35 also provided a [http://hugi.scene.org/online/hugi35/hugi%2035%20-%20demoscene%20forum%20adok%20256b%20intros%20round-table.htm 256b intros round-table] between Baze, Digimind, &amp;amp;#344;r&amp;amp;#345;ola, Pirx, Optimus, and Seven.&lt;br /&gt;
&lt;br /&gt;
During the last years 256b intro coding was also a topic in some demo party presentation sessions. The recordings are available on YouTube. There are &lt;br /&gt;
[https://www.youtube.com/watch?v=WbWYBE9vjdk part 1] and [https://www.youtube.com/watch?v=51BOp5Pi4mU part 2] of Řrřola's talk &amp;quot;Magic of 256-byte x86 intros&amp;quot; held at Demobit 2017 and 2018 respectively. A similar talk [https://www.youtube.com/watch?v=V_ntnQKemWA &amp;quot;256 byte intros on modern PCs&amp;quot;] was held by TomCat/Abaddon at the Function 2017 party. Supplemental files can be downloaded from [http://www.pouet.net/prod.php?which=72454 Pouet.net]. The presentations cover everything from setting up the coding environment to all kinds of code optimization, constant reuse, flag tricks, palette generation, and how to get from an idea to the final intro. TomCat also provides a [https://www.abaddon.hu/256b/ dev tools page] and his [https://www.abaddon.hu/256b/ SizeCoding Blog] with lots of optimization ideas.&lt;br /&gt;
&lt;br /&gt;
fysnet.net has an extensive [http://www.fysnet.net/yourhelp.htm list of DOS .COM register starting values].  If your environment isn't listed, [http://www.fysnet.net/yourhelp.com a program] is also available that can print out all of the register starting values.  See also [http://pferrie.host22.com/misc/lowlevel12.htm DOS Register Starting Values] to understand why the register starting values for .COM files are set the way that they are.&lt;br /&gt;
&lt;br /&gt;
The [http://sparksandflames.com/files/x86InstructionChart.html Sparks And Flames x86 Instruction Chart] is awesome, once you can &amp;quot;read&amp;quot; it. Find out what the bright green (1-byte) commands do, and use them. For the extreme sizecoding (&amp;lt;=32 bytes) it's also very useful to have the HEX value in sight.&lt;br /&gt;
&lt;br /&gt;
The [http://ref.x86asm.net/geek.html Geek Edition x86asm-ref] is comprehensive and dense.  It might be the only reference you'll need.  The [http://ref.x86asm.net/geek.html#modrm_byte_16 last part] covers modr/m bytes, which is useful.&lt;br /&gt;
&lt;br /&gt;
[http://x86.renejeschke.de/ Rene Jeschke's preservation of siyobik.com's x86 Documentation] is one of the most compact and understandable references to the x86 instruction set you'll ever see.&lt;br /&gt;
&lt;br /&gt;
Intel IA-32 Software Developer's Manual Instruction Set Reference [http://www.jaist.ac.jp/iscenter-new/mpc/altix/altixdata/opt/intel/vtune/doc/users_guide/mergedProjects/analyzer_ec/mergedProjects/reference_olh/mergedProjects/instructions/whgdata/whlstt2.htm hypertext version].&lt;br /&gt;
&lt;br /&gt;
[http://www.rcollins.org/secrets/OpCodes.html Robert Collins' Undocumented Opcodes] page has some gems you can exploit depending on your target environment.&lt;br /&gt;
&lt;br /&gt;
[http://wiki.osdev.org/PC_Speaker PC Speaker Basics] For everything from simple bleeps to sophisticated synthesizers.&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Program_Segment_Prefix Program Segment Prefix] : what's in front of our .COM code, and why.&lt;br /&gt;
&lt;br /&gt;
Never underestimate [http://www.hugi.scene.org/online/coding/hugi%2017%20-%20coaax.htm The Hidden Power of BCD Instructions].&lt;br /&gt;
&lt;br /&gt;
[http://www.agner.org/optimize/optimizing_assembly.pdf An optimization guide for x86 platforms By Agner Fog] Chapter 10: Optimizing for size.&lt;br /&gt;
&lt;br /&gt;
[http://home.sch.bme.hu/~ervin/codegems.html Code Gems by Ervin/AbaddoN] Nice collection based on the Imphobia diskmagazine article.&lt;br /&gt;
&lt;br /&gt;
[http://wiki.osdev.org/Programmable_Interval_Timer Programmable Interval Timer]: Timing is everything, if you're targeting a slow system. Very old but good text [http://www.phatcode.net/res/246/files/pctim003.txt PCTIM003.TXT]&lt;br /&gt;
&lt;br /&gt;
[http://stanislavs.org/helppc/bios_data_area.html BIOS data area]: Direct system communication overview.  There are environment values here you may be able to utilize.&lt;br /&gt;
&lt;br /&gt;
[https://www.midi.org/specifications/item/table-1-summary-of-midi-message Summary of MIDI messages] : Summary of all basic MIDI messages.&lt;br /&gt;
&lt;br /&gt;
[http://www.voidaudio.net/percussion.html Roland GS/GM2 Drum Set List and Note Map] : Detailed Description of all MIDI drumkits.&lt;br /&gt;
&lt;br /&gt;
[http://www.h-schmidt.net/FloatConverter/IEEE754.html Online IEEE 754 Converter] : Excellent tool for optimizing/reusing FPU constants&lt;br /&gt;
&lt;br /&gt;
[https://www.reddit.com/r/tinycode Tinycode on Reddit]: Collection of many different size coding productions incl. x86 based ones with discussion (mostly provided by [https://www.reddit.com/user/Hell__Mood/ Hell_Mood himself])&lt;br /&gt;
&lt;br /&gt;
== Repositories ==&lt;br /&gt;
&lt;br /&gt;
Tinyprogs are so small that you sometimes don't need the source code to understand them:  Just pop them into a disassembler (like IDA) or a debugger and look at them.  If you want to grab specimens for study, here are some places to start.&lt;br /&gt;
&lt;br /&gt;
Pouet can be searched for the latest tinyprogs:  [http://www.pouet.net/prodlist.php?type%5B%5D=256b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 256b], [http://www.pouet.net/prodlist.php?type%5B%5D=128b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 128b], [http://www.pouet.net/prodlist.php?type%5B%5D=64b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 64b], and even [http://www.pouet.net/prodlist.php?type%5B%5D=32b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 32b and smaller].&lt;br /&gt;
&lt;br /&gt;
[http://hardcode.untergrund.net/ HardCode] is a repository of 7800 64KB and smaller intros.&lt;br /&gt;
&lt;br /&gt;
[http://256bytes.untergrund.net 256b.com] is a website dedicated primarily to 256b and smaller releases.&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Resources&amp;diff=363</id>
		<title>Resources</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Resources&amp;diff=363"/>
				<updated>2019-04-26T08:21:27Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: Added a Linux sizecoding seminar held at Revision 2019&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Discussions ==&lt;br /&gt;
&lt;br /&gt;
Pouet's [http://www.pouet.net/topic.php?which=8791&amp;amp;page=1 Tiny Intro Toolbox Thread] was one of sizecoding.org's main inspirations.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
The Hugi demoscene diskmag has been kind to the sizecoding movement.  They included [http://www.hugi.scene.org/online/coding/hugi%20se%204%20-%20index%20sorted%20by%20topic.htm many programming articles] since it started in 1996.  Additionally, the [http://www.hugi.scene.org/compo/compoold.htm Hugi Size Coding Competition Series] is the gold standard for learning how to sizecode:  Each competition was given a specific task, then participants submitted their results.  ([http://retrolandia.net/hugi/showthread.php?tid=7&amp;amp;pid=13#pid13 All of the entries with their source code] are available, as are [http://retrolandia.net/hugi/showthread.php?tid=7&amp;amp;pid=396#pid396 the rules for each challenge].)  Hugi #35 also provided a [http://hugi.scene.org/online/hugi35/hugi%2035%20-%20demoscene%20forum%20adok%20256b%20intros%20round-table.htm 256b intros round-table] between Baze, Digimind, &amp;amp;#344;r&amp;amp;#345;ola, Pirx, Optimus, and Seven.&lt;br /&gt;
&lt;br /&gt;
During the last years 256b intro coding was also a topic in some demo party presentation sessions. The recordings are available on YouTube. There are &lt;br /&gt;
[https://www.youtube.com/watch?v=WbWYBE9vjdk part 1] and [https://www.youtube.com/watch?v=51BOp5Pi4mU part 2] of Řrřola's talk &amp;quot;Magic of 256-byte x86 intros&amp;quot; held at Demobit 2017 and 2018 respectively. A similar talk [https://www.youtube.com/watch?v=V_ntnQKemWA &amp;quot;256 byte intros on modern PCs&amp;quot;] was held by TomCat/Abaddon at the Function 2017 party. Supplemental files can be downloaded from [http://www.pouet.net/prod.php?which=72454 Pouet.net]. The presentations cover everything from setting up the coding environment to all kinds of code optimization, constant reuse, flag tricks, palette generation, and how to get from an idea to the final intro.&lt;br /&gt;
&lt;br /&gt;
fysnet.net has an extensive [http://www.fysnet.net/yourhelp.htm list of DOS .COM register starting values].  If your environment isn't listed, [http://www.fysnet.net/yourhelp.com a program] is also available that can print out all of the register starting values.  See also [http://pferrie.host22.com/misc/lowlevel12.htm DOS Register Starting Values] to understand why the register starting values for .COM files are set the way that they are.&lt;br /&gt;
&lt;br /&gt;
The [http://sparksandflames.com/files/x86InstructionChart.html Sparks And Flames x86 Instruction Chart] is awesome, once you can &amp;quot;read&amp;quot; it. Find out what the bright green (1-byte) commands do, and use them. For the extreme sizecoding (&amp;lt;=32 bytes) it's also very useful to have the HEX value in sight.&lt;br /&gt;
&lt;br /&gt;
The [http://ref.x86asm.net/geek.html Geek Edition x86asm-ref] is comprehensive and dense.  It might be the only reference you'll need.  The [http://ref.x86asm.net/geek.html#modrm_byte_16 last part] covers modr/m bytes, which is useful.&lt;br /&gt;
&lt;br /&gt;
[http://x86.renejeschke.de/ Rene Jeschke's preservation of siyobik.com's x86 Documentation] is one of the most compact and understandable references to the x86 instruction set you'll ever see.&lt;br /&gt;
&lt;br /&gt;
Intel IA-32 Software Developer's Manual Instruction Set Reference [http://www.jaist.ac.jp/iscenter-new/mpc/altix/altixdata/opt/intel/vtune/doc/users_guide/mergedProjects/analyzer_ec/mergedProjects/reference_olh/mergedProjects/instructions/whgdata/whlstt2.htm hypertext version].&lt;br /&gt;
&lt;br /&gt;
[http://www.rcollins.org/secrets/OpCodes.html Robert Collins' Undocumented Opcodes] page has some gems you can exploit depending on your target environment.&lt;br /&gt;
&lt;br /&gt;
[http://wiki.osdev.org/PC_Speaker PC Speaker Basics] For everything from simple bleeps to sophisticated synthesizers.&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Program_Segment_Prefix Program Segment Prefix] : what's in front of our .COM code, and why.&lt;br /&gt;
&lt;br /&gt;
Never underestimate [http://www.hugi.scene.org/online/coding/hugi%2017%20-%20coaax.htm The Hidden Power of BCD Instructions].&lt;br /&gt;
&lt;br /&gt;
[http://www.agner.org/optimize/optimizing_assembly.pdf An optimization guide for x86 platforms By Agner Fog] Chapter 10: Optimizing for size.&lt;br /&gt;
&lt;br /&gt;
[http://home.sch.bme.hu/~ervin/codegems.html Code Gems by Ervin/AbaddoN] Nice collection based on the Imphobia diskmagazine article.&lt;br /&gt;
&lt;br /&gt;
[http://wiki.osdev.org/Programmable_Interval_Timer Programmable Interval Timer]: Timing is everything, if you're targeting a slow system. Very old but good text [http://www.phatcode.net/res/246/files/pctim003.txt PCTIM003.TXT]&lt;br /&gt;
&lt;br /&gt;
[http://stanislavs.org/helppc/bios_data_area.html BIOS data area]: Direct system communication overview.  There are environment values here you may be able to utilize.&lt;br /&gt;
&lt;br /&gt;
[https://www.midi.org/specifications/item/table-1-summary-of-midi-message Summary of MIDI messages] : Summary of all basic MIDI messages.&lt;br /&gt;
&lt;br /&gt;
[http://www.voidaudio.net/percussion.html Roland GS/GM2 Drum Set List and Note Map] : Detailed Description of all MIDI drumkits.&lt;br /&gt;
&lt;br /&gt;
[http://www.h-schmidt.net/FloatConverter/IEEE754.html Online IEEE 754 Converter] : Excellent tool for optimizing/reusing FPU constants&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=a03HXo8a_Io Intricacies of sizecoding on Linux] : A Revision 2019 Seminar about sizecoding on Linux&lt;br /&gt;
&lt;br /&gt;
== Repositories ==&lt;br /&gt;
&lt;br /&gt;
Tinyprogs are so small that you sometimes don't need the source code to understand them:  Just pop them into a disassembler (like IDA) or a debugger and look at them.  If you want to grab specimens for study, here are some places to start.&lt;br /&gt;
&lt;br /&gt;
Pouet can be searched for the latest tinyprogs:  [http://www.pouet.net/prodlist.php?type%5B%5D=256b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 256b], [http://www.pouet.net/prodlist.php?type%5B%5D=128b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 128b], [http://www.pouet.net/prodlist.php?type%5B%5D=64b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 64b], and even [http://www.pouet.net/prodlist.php?type%5B%5D=32b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 32b and smaller].&lt;br /&gt;
&lt;br /&gt;
[http://hardcode.untergrund.net/ HardCode] is a repository of 7800 64KB and smaller intros.&lt;br /&gt;
&lt;br /&gt;
[http://256bytes.untergrund.net 256b.com] is a website dedicated primarily to 256b and smaller releases.&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Resources&amp;diff=349</id>
		<title>Resources</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Resources&amp;diff=349"/>
				<updated>2018-04-17T14:04:12Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: /* References */ Added a download link and did minor text edits.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Discussions ==&lt;br /&gt;
&lt;br /&gt;
Pouet's [http://www.pouet.net/topic.php?which=8791&amp;amp;page=1 Tiny Intro Toolbox Thread] was one of sizecoding.org's main inspirations.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
The Hugi demoscene diskmag has been kind to the sizecoding movement.  They included [http://www.hugi.scene.org/online/coding/hugi%20se%204%20-%20index%20sorted%20by%20topic.htm many programming articles] since it started in 1996.  Additionally, the [http://www.hugi.scene.org/compo/compoold.htm Hugi Size Coding Competition Series] is the gold standard for learning how to sizecode:  Each competition was given a specific task, then participants submitted their results.  ([http://retrolandia.net/hugi/showthread.php?tid=7&amp;amp;pid=13#pid13 All of the entries with their source code] are available, as are [http://retrolandia.net/hugi/showthread.php?tid=7&amp;amp;pid=396#pid396 the rules for each challenge].)  Hugi #35 also provided a [http://hugi.scene.org/online/hugi35/hugi%2035%20-%20demoscene%20forum%20adok%20256b%20intros%20round-table.htm 256b intros round-table] between Baze, Digimind, &amp;amp;#344;r&amp;amp;#345;ola, Pirx, Optimus, and Seven.&lt;br /&gt;
&lt;br /&gt;
During the last years 256b intro coding was also a topic in some demo party presentation sessions. The recordings are available on YouTube. There are &lt;br /&gt;
[https://www.youtube.com/watch?v=WbWYBE9vjdk part 1] and [https://www.youtube.com/watch?v=51BOp5Pi4mU part 2] of Řrřola's talk &amp;quot;Magic of 256-byte x86 intros&amp;quot; held at Demobit 2017 and 2018 respectively. A similar talk [https://www.youtube.com/watch?v=V_ntnQKemWA &amp;quot;256 byte intros on modern PCs&amp;quot;] was held by TomCat/Abaddon at the Function 2017 party. Supplemental files can be downloaded from [http://www.pouet.net/prod.php?which=72454 Pouet.net]. The presentations cover everything from setting up the coding environment to all kinds of code optimization, constant reuse, flag tricks, palette generation, and how to get from an idea to the final intro.&lt;br /&gt;
&lt;br /&gt;
fysnet.net has an extensive [http://www.fysnet.net/yourhelp.htm list of DOS .COM register starting values].  If your environment isn't listed, [http://www.fysnet.net/yourhelp.com a program] is also available that can print out all of the register starting values.  See also [http://pferrie.host22.com/misc/lowlevel12.htm DOS Register Starting Values] to understand why the register starting values for .COM files are set the way that they are.&lt;br /&gt;
&lt;br /&gt;
The [http://sparksandflames.com/files/x86InstructionChart.html Sparks And Flames x86 Instruction Chart] is awesome, once you can &amp;quot;read&amp;quot; it. Find out what the bright green (1-byte) commands do, and use them. For the extreme sizecoding (&amp;lt;=32 bytes) it's also very useful to have the HEX value in sight.&lt;br /&gt;
&lt;br /&gt;
The [http://ref.x86asm.net/geek.html Geek Edition x86asm-ref] is comprehensive and dense.  It might be the only reference you'll need.  The [http://ref.x86asm.net/geek.html#modrm_byte_16 last part] covers modr/m bytes, which is useful.&lt;br /&gt;
&lt;br /&gt;
[http://x86.renejeschke.de/ Rene Jeschke's preservation of siyobik.com's x86 Documentation] is one of the most compact and understandable references to the x86 instruction set you'll ever see.&lt;br /&gt;
&lt;br /&gt;
Intel IA-32 Software Developer's Manual Instruction Set Reference [http://www.jaist.ac.jp/iscenter-new/mpc/altix/altixdata/opt/intel/vtune/doc/users_guide/mergedProjects/analyzer_ec/mergedProjects/reference_olh/mergedProjects/instructions/whgdata/whlstt2.htm hypertext version].&lt;br /&gt;
&lt;br /&gt;
[http://www.rcollins.org/secrets/OpCodes.html Robert Collins' Undocumented Opcodes] page has some gems you can exploit depending on your target environment.&lt;br /&gt;
&lt;br /&gt;
[http://wiki.osdev.org/PC_Speaker PC Speaker Basics] For everything from simple bleeps to sophisticated synthesizers.&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Program_Segment_Prefix Program Segment Prefix] : what's in front of our .COM code, and why.&lt;br /&gt;
&lt;br /&gt;
Never underestimate [http://www.hugi.scene.org/online/coding/hugi%2017%20-%20coaax.htm The Hidden Power of BCD Instructions].&lt;br /&gt;
&lt;br /&gt;
[http://www.agner.org/optimize/optimizing_assembly.pdf An optimization guide for x86 platforms By Agner Fog] Chapter 10: Optimizing for size.&lt;br /&gt;
&lt;br /&gt;
[http://home.sch.bme.hu/~ervin/codegems.html Code Gems by Ervin/AbaddoN] Nice collection based on the Imphobia diskmagazine article.&lt;br /&gt;
&lt;br /&gt;
[http://wiki.osdev.org/Programmable_Interval_Timer Programmable Interval Timer]: Timing is everything, if you're targeting a slow system. Very old but good text [http://www.phatcode.net/res/246/files/pctim003.txt PCTIM003.TXT]&lt;br /&gt;
&lt;br /&gt;
[http://stanislavs.org/helppc/bios_data_area.html BIOS data area]: Direct system communication overview.  There are environment values here you may be able to utilize.&lt;br /&gt;
&lt;br /&gt;
[https://www.midi.org/specifications/item/table-1-summary-of-midi-message Summary of MIDI messages] : Summary of all basic MIDI messages.&lt;br /&gt;
&lt;br /&gt;
[http://www.voidaudio.net/percussion.html Roland GS/GM2 Drum Set List and Note Map] : Detailed Description of all MIDI drumkits.&lt;br /&gt;
&lt;br /&gt;
[http://www.h-schmidt.net/FloatConverter/IEEE754.html Online IEEE 754 Converter] Excellent tool for optimizing/reusing FPU constants&lt;br /&gt;
&lt;br /&gt;
== Repositories ==&lt;br /&gt;
&lt;br /&gt;
Tinyprogs are so small that you sometimes don't need the source code to understand them:  Just pop them into a disassembler (like IDA) or a debugger and look at them.  If you want to grab specimens for study, here are some places to start.&lt;br /&gt;
&lt;br /&gt;
Pouet can be searched for the latest tinyprogs:  [http://www.pouet.net/prodlist.php?type%5B%5D=256b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 256b], [http://www.pouet.net/prodlist.php?type%5B%5D=128b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 128b], [http://www.pouet.net/prodlist.php?type%5B%5D=64b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 64b], and even [http://www.pouet.net/prodlist.php?type%5B%5D=32b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 32b and smaller].&lt;br /&gt;
&lt;br /&gt;
[http://hardcode.untergrund.net/ HardCode] is a repository of 7800 64KB and smaller intros.&lt;br /&gt;
&lt;br /&gt;
[http://256bytes.untergrund.net 256b.com] is a website dedicated primarily to 256b and smaller releases.&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Resources&amp;diff=348</id>
		<title>Resources</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Resources&amp;diff=348"/>
				<updated>2018-04-17T08:12:35Z</updated>
		
		<summary type="html">&lt;p&gt;Dresdenboy: Added 256b intro coding talks by Řrřola and TomCat&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Discussions ==&lt;br /&gt;
&lt;br /&gt;
Pouet's [http://www.pouet.net/topic.php?which=8791&amp;amp;page=1 Tiny Intro Toolbox Thread] was one of sizecoding.org's main inspirations.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
The Hugi demoscene diskmag has been kind to the sizecoding movement.  They included [http://www.hugi.scene.org/online/coding/hugi%20se%204%20-%20index%20sorted%20by%20topic.htm many programming articles] since it started in 1996.  Additionally, the [http://www.hugi.scene.org/compo/compoold.htm Hugi Size Coding Competition Series] is the gold standard for learning how to sizecode:  Each competition was given a specific task, then participants submitted their results.  ([http://retrolandia.net/hugi/showthread.php?tid=7&amp;amp;pid=13#pid13 All of the entries with their source code] are available, as are [http://retrolandia.net/hugi/showthread.php?tid=7&amp;amp;pid=396#pid396 the rules for each challenge].)  Hugi #35 also provided a [http://hugi.scene.org/online/hugi35/hugi%2035%20-%20demoscene%20forum%20adok%20256b%20intros%20round-table.htm 256b intros round-table] between Baze, Digimind, &amp;amp;#344;r&amp;amp;#345;ola, Pirx, Optimus, and Seven.&lt;br /&gt;
&lt;br /&gt;
During the last years 256b intro coding was also a topic in some demo party presentation sessions. The recordings are available on YouTube. There are &lt;br /&gt;
[https://www.youtube.com/watch?v=WbWYBE9vjdk part 1] and [https://www.youtube.com/watch?v=51BOp5Pi4mU part 2] of Řrřola's talk &amp;quot;Magic of 256-byte x86 intros&amp;quot; held at Demobit 2017 and 2018 respectively. A similar talk [https://www.youtube.com/watch?v=V_ntnQKemWA &amp;quot;256 byte intros on modern PCs&amp;quot;] was held by TomCat/Abaddon at the Function 2017 party (mostly in English with parts spoken in Hungarian). Those presentations cover everything from setting up the coding environment to all kinds of code optimization, constant reuse, flag tricks, palette generation, and how to get from an idea to the final intro.&lt;br /&gt;
&lt;br /&gt;
fysnet.net has an extensive [http://www.fysnet.net/yourhelp.htm list of DOS .COM register starting values].  If your environment isn't listed, [http://www.fysnet.net/yourhelp.com a program] is also available that can print out all of the register starting values.  See also [http://pferrie.host22.com/misc/lowlevel12.htm DOS Register Starting Values] to understand why the register starting values for .COM files are set the way that they are.&lt;br /&gt;
&lt;br /&gt;
The [http://sparksandflames.com/files/x86InstructionChart.html Sparks And Flames x86 Instruction Chart] is awesome, once you can &amp;quot;read&amp;quot; it. Find out what the bright green (1-byte) commands do, and use them. For the extreme sizecoding (&amp;lt;=32 bytes) it's also very useful to have the HEX value in sight.&lt;br /&gt;
&lt;br /&gt;
The [http://ref.x86asm.net/geek.html Geek Edition x86asm-ref] is comprehensive and dense.  It might be the only reference you'll need.  The [http://ref.x86asm.net/geek.html#modrm_byte_16 last part] covers modr/m bytes, which is useful.&lt;br /&gt;
&lt;br /&gt;
[http://x86.renejeschke.de/ Rene Jeschke's preservation of siyobik.com's x86 Documentation] is one of the most compact and understandable references to the x86 instruction set you'll ever see.&lt;br /&gt;
&lt;br /&gt;
Intel IA-32 Software Developer's Manual Instruction Set Reference [http://www.jaist.ac.jp/iscenter-new/mpc/altix/altixdata/opt/intel/vtune/doc/users_guide/mergedProjects/analyzer_ec/mergedProjects/reference_olh/mergedProjects/instructions/whgdata/whlstt2.htm hypertext version].&lt;br /&gt;
&lt;br /&gt;
[http://www.rcollins.org/secrets/OpCodes.html Robert Collins' Undocumented Opcodes] page has some gems you can exploit depending on your target environment.&lt;br /&gt;
&lt;br /&gt;
[http://wiki.osdev.org/PC_Speaker PC Speaker Basics] For everything from simple bleeps to sophisticated synthesizers.&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Program_Segment_Prefix Program Segment Prefix] : what's in front of our .COM code, and why.&lt;br /&gt;
&lt;br /&gt;
Never underestimate [http://www.hugi.scene.org/online/coding/hugi%2017%20-%20coaax.htm The Hidden Power of BCD Instructions].&lt;br /&gt;
&lt;br /&gt;
[http://www.agner.org/optimize/optimizing_assembly.pdf An optimization guide for x86 platforms By Agner Fog] Chapter 10: Optimizing for size.&lt;br /&gt;
&lt;br /&gt;
[http://home.sch.bme.hu/~ervin/codegems.html Code Gems by Ervin/AbaddoN] Nice collection based on the Imphobia diskmagazine article.&lt;br /&gt;
&lt;br /&gt;
[http://wiki.osdev.org/Programmable_Interval_Timer Programmable Interval Timer]: Timing is everything, if you're targeting a slow system. Very old but good text [http://www.phatcode.net/res/246/files/pctim003.txt PCTIM003.TXT]&lt;br /&gt;
&lt;br /&gt;
[http://stanislavs.org/helppc/bios_data_area.html BIOS data area]: Direct system communication overview.  There are environment values here you may be able to utilize.&lt;br /&gt;
&lt;br /&gt;
[https://www.midi.org/specifications/item/table-1-summary-of-midi-message Summary of MIDI messages] : Summary of all basic MIDI messages.&lt;br /&gt;
&lt;br /&gt;
[http://www.voidaudio.net/percussion.html Roland GS/GM2 Drum Set List and Note Map] : Detailed Description of all MIDI drumkits.&lt;br /&gt;
&lt;br /&gt;
[http://www.h-schmidt.net/FloatConverter/IEEE754.html Online IEEE 754 Converter] Excellent tool for optimizing/reusing FPU constants&lt;br /&gt;
&lt;br /&gt;
== Repositories ==&lt;br /&gt;
&lt;br /&gt;
Tinyprogs are so small that you sometimes don't need the source code to understand them:  Just pop them into a disassembler (like IDA) or a debugger and look at them.  If you want to grab specimens for study, here are some places to start.&lt;br /&gt;
&lt;br /&gt;
Pouet can be searched for the latest tinyprogs:  [http://www.pouet.net/prodlist.php?type%5B%5D=256b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 256b], [http://www.pouet.net/prodlist.php?type%5B%5D=128b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 128b], [http://www.pouet.net/prodlist.php?type%5B%5D=64b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 64b], and even [http://www.pouet.net/prodlist.php?type%5B%5D=32b&amp;amp;platform%5B%5D=MS-Dos&amp;amp;page=1 32b and smaller].&lt;br /&gt;
&lt;br /&gt;
[http://hardcode.untergrund.net/ HardCode] is a repository of 7800 64KB and smaller intros.&lt;br /&gt;
&lt;br /&gt;
[http://256bytes.untergrund.net 256b.com] is a website dedicated primarily to 256b and smaller releases.&lt;/div&gt;</summary>
		<author><name>Dresdenboy</name></author>	</entry>

	</feed>