<?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=Psenough</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=Psenough"/>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/wiki/Special:Contributions/Psenough"/>
		<updated>2026-09-26T02:25:32Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.0</generator>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Resources&amp;diff=1903</id>
		<title>Resources</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Resources&amp;diff=1903"/>
				<updated>2026-09-22T00:23:07Z</updated>
		
		<summary type="html">&lt;p&gt;Psenough: working invite&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;
We also have an active discord server dedicated to sizecoding at: https://discord.gg/Ju28ZmuPxS&lt;br /&gt;
&lt;br /&gt;
== Seminars ==&lt;br /&gt;
&lt;br /&gt;
Seminars on various sizecoding topics have been presented at the Lovebyte demoparty, and can be watched here: [https://www.youtube.com/playlist?list=PLr4JCYhdWe8mq3aDvAtL0ooO7hAC9gU2s Lovebyte seminars on YouTube]&lt;br /&gt;
&lt;br /&gt;
In recent years 256b intro coding has been covered in presentation sessions at other demo parties. 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/usbdos/ dev tools page] and his [https://www.abaddon.hu/256b/ SizeCoding Blog] with lots of optimization ideas.&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;
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 [https://web.archive.org/web/20170418182707/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;
[https://www.felixcloutier.com/x86/ Yet another reference] by Félix Cloutier.&lt;br /&gt;
&lt;br /&gt;
[http://www.techhelpmanual.com/2-main_menu.html Tech Help Manual] includes a dense reference of DOS interrupts and x86 instructions.&lt;br /&gt;
&lt;br /&gt;
[http://c9x.me/x86/ c9x.me]: A x86 instruction reference&lt;br /&gt;
&lt;br /&gt;
[https://kernfunny.org/x86/ 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://web.archive.org/web/20201023110452/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://baseconvert.com/ieee-754-floating-point Base Convert IEEE 754] : Alternative tool for optimizing/reusing FPU constants with live update&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;
[https://marqueedesign.demoscene.com/blog Superogue's sizecoding microblog]: Collection of demoscene and sizecoding related articles and development writeups up [https://marqueedesign.demoscene.com various Marquee Design tiny intros]&lt;br /&gt;
&lt;br /&gt;
[https://www.xtof.info/Timing-on-PC-familly-under-DOS.html Timing-on-PC-familly-under-DOS] A complete and very detailed guide about timing, timers, callbacks, interrupts in conjunction with MSDOS&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;
* [https://files.scene.org/get/demos/compilations/hardcode/hardcode.zip Scene.org link] to this archive&lt;br /&gt;
&lt;br /&gt;
* [https://files.scene.org/get/demos/compilations/hardcode/hc_update.zip Scene.org link] to an archive update from 2017 to 2025&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>Psenough</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=X68000&amp;diff=1886</id>
		<title>X68000</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=X68000&amp;diff=1886"/>
				<updated>2026-01-30T00:31:12Z</updated>
		
		<summary type="html">&lt;p&gt;Psenough: &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, https://mijet.eludevisibility.org/XM6%20Pro-68k/XM6%20Pro-68k.html&lt;br /&gt;
* Hardware: Original X68000 or the new X68000Z emulation systems.&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 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;
&lt;br /&gt;
=== Setting up the Disk Image ===&lt;br /&gt;
To get up and running, you need to create a Human68k OS XDF disk image, which is a similar system to MS-DOS.&lt;br /&gt;
&lt;br /&gt;
Add the following files to the disk image:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
COMMAND.X&lt;br /&gt;
HUMAN.SYS&lt;br /&gt;
INTRO.R  (This is the flat binary output for your intro)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Optionally, like in DOS, you can add a AUTOEXEC.BAT that just launches your INTRO.R for auto-startup.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Supervisor ===&lt;br /&gt;
Like all 68000 systems, if you want to access registers, you need to set the supervisor mode first before doing anything else:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
clr.l -(a7)&lt;br /&gt;
dc.w $ff20&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Video display ===&lt;br /&gt;
To get your video mode up and running, there are two call you need to make in a specific order&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
; Set CRT mode. Clears plane 0/1 on the text screen to set display mode.&lt;br /&gt;
; The graphics screen and sprite screen are put into silent mode without being cleared.&lt;br /&gt;
; The text palette is initialized.&lt;br /&gt;
moveq #10,d1    &lt;br /&gt;
moveq #$10,d0&lt;br /&gt;
trap #15 &lt;br /&gt;
  &lt;br /&gt;
; Enable graphics mode &lt;br /&gt;
; _G_CLR_ON Initializes the graphic screen and sets the display mode&lt;br /&gt;
; Clears the graphics screen and displays the palette. The page is set to 0.&lt;br /&gt;
move.w #$90,d0&lt;br /&gt;
trap #15   &lt;br /&gt;
&lt;br /&gt;
; Disable Text Cursor&lt;br /&gt;
moveq #$1f,d0&lt;br /&gt;
trap #15&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a full list of all available graphics modes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
d1.w	p.width  resolution     colors  screens khz&lt;br /&gt;
=================================================== &lt;br /&gt;
0	1024	 512 x 512	16	1	31&lt;br /&gt;
1	V		V	V	V	15&lt;br /&gt;
2	V	 256 x 256	V	V	31&lt;br /&gt;
3	V		V	V	V	15&lt;br /&gt;
4	512	 512 x 512	16	4	31&lt;br /&gt;
5	V		V	V	V	15&lt;br /&gt;
6	V	 256 x 256	V	V	31&lt;br /&gt;
7	V		V	V	V	15&lt;br /&gt;
8	V	 512 x 512	256	2	31&lt;br /&gt;
9	V		V	V	V	15&lt;br /&gt;
10	V	 256 x 256	V	V	31&lt;br /&gt;
11	V		V	V	V	15&lt;br /&gt;
12	V	 512 x 512	65536	1	31&lt;br /&gt;
13	V		V	V	V	15&lt;br /&gt;
14	V	 256 x 256	V	V	31&lt;br /&gt;
15	V		V	V	V	15&lt;br /&gt;
16	1024	 768 x 512	16	1	31&lt;br /&gt;
17	V	1024 x 424	V	V	24&lt;br /&gt;
18	V	1024 x 848	V	V	24&lt;br /&gt;
19	V	 640 x 480	V	V	24&lt;br /&gt;
20	V	 768 x 512	256	2	31&lt;br /&gt;
21	V	1024 x 848	V	V	24&lt;br /&gt;
22	V	1024 x 424	V	V	24&lt;br /&gt;
23	V	 640 x 480	V	V	24&lt;br /&gt;
24	V	 768 x 512	65536	1	31&lt;br /&gt;
25	V	1024 x 848	V	V	24&lt;br /&gt;
26	V	1024 x 424	V	V	24&lt;br /&gt;
27	V	 640 x 480	V	V	24&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Vsync ====&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;
==== Double buffering ====&lt;br /&gt;
You can use the following IOCS routines to set the active drawing and screenpages for double buffering.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
; APAGE: Graphic drawing page settings&lt;br /&gt;
move.w #$b1,d0&lt;br /&gt;
moveq #0,d1  ; set page 0..3&lt;br /&gt;
trap #15&lt;br /&gt;
&lt;br /&gt;
; VPAGE: Graphic screen display page setting&lt;br /&gt;
move.w #$b2,d0&lt;br /&gt;
moveq #0,d1  ; set page 0..3&lt;br /&gt;
trap #15&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Clearing the screen ====&lt;br /&gt;
You can clear the active page using the WIPE IOCS routine ($b5)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
move.w #$b5,d0&lt;br /&gt;
trap #15&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Plotting to screen ====&lt;br /&gt;
When accessing using GRAM directly, you can fill the GVRAM directly in word (64k colors), byte (8 bit palette) or 4-bit 16 color mode.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
lea GVRAM,a0&lt;br /&gt;
move.w #256,d7&lt;br /&gt;
drawloop:&lt;br /&gt;
move.w (a0)+,d0&lt;br /&gt;
dbra d7,drawloop&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Since GVRAM buffer widths can differ from the resolution you are using, make sure to skip enough words at the end of each line to make up for the difference.&lt;br /&gt;
&lt;br /&gt;
==== IOCS Drawing routines ====&lt;br /&gt;
Alternatively you could make use of the IOCS functions for drawing primitives using TRAP #15.&lt;br /&gt;
These are slow tom routines, compatible with all kinds of modes,&lt;br /&gt;
All these make use of a parameter buffer in A1 that you need to fill yourself with the correct information, for example for _PSET this would contain X,Y,COLOR like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
lea params,a1&lt;br /&gt;
move.w d2,(a1)    ; x-coord&lt;br /&gt;
move.w d3,2(a1)   ; y-coord &lt;br /&gt;
move.w #255,4(a1) ; color&lt;br /&gt;
move.l #_PSET,d0&lt;br /&gt;
trap #15&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a full list of other IOCS drawing routines you are able to use.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
_PSET               equ     $b6&lt;br /&gt;
_POINT              equ     $b7&lt;br /&gt;
_LINE               equ     $b8&lt;br /&gt;
_BOX                equ     $b9&lt;br /&gt;
_FILL               equ     $ba&lt;br /&gt;
_CIRCLE             equ     $bb&lt;br /&gt;
_PAINT              equ     $bc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&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. There are a total of 32 slots that can be turned on or off when the sound is triggered. For more information, check out the YM2151 specs at [https://msxpro.com/datasheet.html]&lt;br /&gt;
&lt;br /&gt;
Alternatively, there is also an option to output digital PCM sound.&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/?platform=100 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;br /&gt;
* [https://github.com/hitchhikr/x68000stuff X68000 stuff for assembly programmers]&lt;/div&gt;</summary>
		<author><name>Psenough</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=X68000&amp;diff=1885</id>
		<title>X68000</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=X68000&amp;diff=1885"/>
				<updated>2026-01-30T00:30:13Z</updated>
		
		<summary type="html">&lt;p&gt;Psenough: add in a link&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, https://mijet.eludevisibility.org/XM6%20Pro-68k/XM6%20Pro-68k.html&lt;br /&gt;
* Hardware: Original X68000 or the new X68000Z emulation systems.&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 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;
&lt;br /&gt;
=== Setting up the Disk Image ===&lt;br /&gt;
To get up and running, you need to create a Human68k OS XDF disk image, which is a similar system to MS-DOS.&lt;br /&gt;
&lt;br /&gt;
Add the following files to the disk image:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
COMMAND.X&lt;br /&gt;
HUMAN.SYS&lt;br /&gt;
INTRO.R  (This is the flat binary output for your intro)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Optionally, like in DOS, you can add a AUTOEXEC.BAT that just launches your INTRO.R for auto-startup.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Supervisor ===&lt;br /&gt;
Like all 68000 systems, if you want to access registers, you need to set the supervisor mode first before doing anything else:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
clr.l -(a7)&lt;br /&gt;
dc.w $ff20&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Video display ===&lt;br /&gt;
To get your video mode up and running, there are two call you need to make in a specific order&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
; Set CRT mode. Clears plane 0/1 on the text screen to set display mode.&lt;br /&gt;
; The graphics screen and sprite screen are put into silent mode without being cleared.&lt;br /&gt;
; The text palette is initialized.&lt;br /&gt;
moveq #10,d1    &lt;br /&gt;
moveq #$10,d0&lt;br /&gt;
trap #15 &lt;br /&gt;
  &lt;br /&gt;
; Enable graphics mode &lt;br /&gt;
; _G_CLR_ON Initializes the graphic screen and sets the display mode&lt;br /&gt;
; Clears the graphics screen and displays the palette. The page is set to 0.&lt;br /&gt;
move.w #$90,d0&lt;br /&gt;
trap #15   &lt;br /&gt;
&lt;br /&gt;
; Disable Text Cursor&lt;br /&gt;
moveq #$1f,d0&lt;br /&gt;
trap #15&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a full list of all available graphics modes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
d1.w	p.width  resolution     colors  screens khz&lt;br /&gt;
=================================================== &lt;br /&gt;
0	1024	 512 x 512	16	1	31&lt;br /&gt;
1	V		V	V	V	15&lt;br /&gt;
2	V	 256 x 256	V	V	31&lt;br /&gt;
3	V		V	V	V	15&lt;br /&gt;
4	512	 512 x 512	16	4	31&lt;br /&gt;
5	V		V	V	V	15&lt;br /&gt;
6	V	 256 x 256	V	V	31&lt;br /&gt;
7	V		V	V	V	15&lt;br /&gt;
8	V	 512 x 512	256	2	31&lt;br /&gt;
9	V		V	V	V	15&lt;br /&gt;
10	V	 256 x 256	V	V	31&lt;br /&gt;
11	V		V	V	V	15&lt;br /&gt;
12	V	 512 x 512	65536	1	31&lt;br /&gt;
13	V		V	V	V	15&lt;br /&gt;
14	V	 256 x 256	V	V	31&lt;br /&gt;
15	V		V	V	V	15&lt;br /&gt;
16	1024	 768 x 512	16	1	31&lt;br /&gt;
17	V	1024 x 424	V	V	24&lt;br /&gt;
18	V	1024 x 848	V	V	24&lt;br /&gt;
19	V	 640 x 480	V	V	24&lt;br /&gt;
20	V	 768 x 512	256	2	31&lt;br /&gt;
21	V	1024 x 848	V	V	24&lt;br /&gt;
22	V	1024 x 424	V	V	24&lt;br /&gt;
23	V	 640 x 480	V	V	24&lt;br /&gt;
24	V	 768 x 512	65536	1	31&lt;br /&gt;
25	V	1024 x 848	V	V	24&lt;br /&gt;
26	V	1024 x 424	V	V	24&lt;br /&gt;
27	V	 640 x 480	V	V	24&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Vsync ====&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;
==== Double buffering ====&lt;br /&gt;
You can use the following IOCS routines to set the active drawing and screenpages for double buffering.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
; APAGE: Graphic drawing page settings&lt;br /&gt;
move.w #$b1,d0&lt;br /&gt;
moveq #0,d1  ; set page 0..3&lt;br /&gt;
trap #15&lt;br /&gt;
&lt;br /&gt;
; VPAGE: Graphic screen display page setting&lt;br /&gt;
move.w #$b2,d0&lt;br /&gt;
moveq #0,d1  ; set page 0..3&lt;br /&gt;
trap #15&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Clearing the screen ====&lt;br /&gt;
You can clear the active page using the WIPE IOCS routine ($b5)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
move.w #$b5,d0&lt;br /&gt;
trap #15&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Plotting to screen ====&lt;br /&gt;
When accessing using GRAM directly, you can fill the GVRAM directly in word (64k colors), byte (8 bit palette) or 4-bit 16 color mode.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
lea GVRAM,a0&lt;br /&gt;
move.w #256,d7&lt;br /&gt;
drawloop:&lt;br /&gt;
move.w (a0)+,d0&lt;br /&gt;
dbra d7,drawloop&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Since GVRAM buffer widths can differ from the resolution you are using, make sure to skip enough words at the end of each line to make up for the difference.&lt;br /&gt;
&lt;br /&gt;
==== IOCS Drawing routines ====&lt;br /&gt;
Alternatively you could make use of the IOCS functions for drawing primitives using TRAP #15.&lt;br /&gt;
These are slow tom routines, compatible with all kinds of modes,&lt;br /&gt;
All these make use of a parameter buffer in A1 that you need to fill yourself with the correct information, for example for _PSET this would contain X,Y,COLOR like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
lea params,a1&lt;br /&gt;
move.w d2,(a1)    ; x-coord&lt;br /&gt;
move.w d3,2(a1)   ; y-coord &lt;br /&gt;
move.w #255,4(a1) ; color&lt;br /&gt;
move.l #_PSET,d0&lt;br /&gt;
trap #15&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a full list of other IOCS drawing routines you are able to use.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
_PSET               equ     $b6&lt;br /&gt;
_POINT              equ     $b7&lt;br /&gt;
_LINE               equ     $b8&lt;br /&gt;
_BOX                equ     $b9&lt;br /&gt;
_FILL               equ     $ba&lt;br /&gt;
_CIRCLE             equ     $bb&lt;br /&gt;
_PAINT              equ     $bc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&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. There are a total of 32 slots that can be turned on or off when the sound is triggered. For more information, check out the YM2151 specs at [https://msxpro.com/datasheet.html]&lt;br /&gt;
&lt;br /&gt;
Alternatively, there is also an option to output digital PCM sound.&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/?platform=100 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;br /&gt;
* [https://github.com/hitchhikr/x68000stuff] X68000 stuff for assembly programmers&lt;/div&gt;</summary>
		<author><name>Psenough</name></author>	</entry>

	</feed>