<?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=Hitchhikr</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=Hitchhikr"/>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/wiki/Special:Contributions/Hitchhikr"/>
		<updated>2026-04-22T23:22:13Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.0</generator>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Commodore_Amiga&amp;diff=1895</id>
		<title>Commodore Amiga</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Commodore_Amiga&amp;diff=1895"/>
				<updated>2026-03-03T15:00:00Z</updated>
		
		<summary type="html">&lt;p&gt;Hitchhikr: /* Getting something on screen */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Commodore Amiga ==&lt;br /&gt;
The Commodore Amiga system consists of the M68k system with custom hardware for graphics and sound.&lt;br /&gt;
&lt;br /&gt;
=== Setting up ===&lt;br /&gt;
&lt;br /&gt;
* Assembler: VASM&lt;br /&gt;
* Emulator(s): Linux: fs-uae, Windows: WinUAE&lt;br /&gt;
&lt;br /&gt;
Compile source to Amiga Kickstart1.x executable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
vasm -kick1hunks -Fhunkexe -o example -nosym &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Amiga executable format ===&lt;br /&gt;
Commodore Amiga executables consist of a 32 byte header, as well as a 4 byte footer. Here's an example where deadc0de is the only code data. 0000 03f2 marks the end of the block. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
00000000: 0000 03f3 0000 0000 0000 0001 0000 0000  &lt;br /&gt;
00000010: 0000 0000 0000 0001 0000 03e9 0000 0001  &lt;br /&gt;
00000020: dead c0de 0000 03f2 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Memory Map ===&lt;br /&gt;
Here is the amiga memory map&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Amiga_memorymap.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Video display ===&lt;br /&gt;
The Amiga OCS uses an interleaved planar memory layout to represent its various paletted display modes. &lt;br /&gt;
&lt;br /&gt;
==== Getting something on screen ====&lt;br /&gt;
One of the shortest ways to get you started with getting anything on screen at all, is to initialize and use the intuition graphics library routines. &lt;br /&gt;
These are relatively easy to setup and allow you to plot pixels, circles, rects and even polygons. &lt;br /&gt;
However, as can be expected these routines are extremely slow in execution.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
        incdir  &amp;quot;include&amp;quot;&lt;br /&gt;
        include &amp;quot;graphics/graphics_lib.i&amp;quot;&lt;br /&gt;
        include &amp;quot;intuition/screens.i&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        move.l  $170(a2),a6     ; intuitionbase from globvec&lt;br /&gt;
        move.l  ib_ActiveScreen(a6),a5  ; a5 = activeScreen (640x256 on most systems)&lt;br /&gt;
        move.l  $4.w,a6         ; execbase&lt;br /&gt;
        move.l  156(a6),a6      ; graphics.library&lt;br /&gt;
&lt;br /&gt;
        ; clear screen&lt;br /&gt;
        lea sc_RastPort(a5),a1&lt;br /&gt;
        jsr _LVOClearScreen(a6)&lt;br /&gt;
&lt;br /&gt;
frameloop:&lt;br /&gt;
	move.w	#240-1,d7		; y&lt;br /&gt;
yLoop:	&lt;br /&gt;
	move.w	#640-1,d6		; x&lt;br /&gt;
xLoop:&lt;br /&gt;
	; Set Pixel/Pen Color (d0 = color)&lt;br /&gt;
	move d6,d0		; d0=x&lt;br /&gt;
	eor d7,d0	        ; d0=x^y&lt;br /&gt;
	lsr #3,d0		; d0&amp;gt;&amp;gt;=3&lt;br /&gt;
    jsr _LVOSetAPen(a6)&lt;br /&gt;
&lt;br /&gt;
	; Write Pixel (d0=x, d1=y)&lt;br /&gt;
	move d6,d0&lt;br /&gt;
	move d7,d1&lt;br /&gt;
    jsr _LVOWritePixel(a6)&lt;br /&gt;
	dbra d6,xLoop	&lt;br /&gt;
    dbra d7,yLoop&lt;br /&gt;
&lt;br /&gt;
   bra frameloop&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Copperlist ====&lt;br /&gt;
Another way to start drawing things on screen is to setup a (minimal) copperlist with commands for one or more planes, which can be manipulated indiviually&lt;br /&gt;
&lt;br /&gt;
Copper list format: &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;
As it happens, you can also insert color definition into the copperlist.&lt;br /&gt;
&lt;br /&gt;
==== Planes ====&lt;br /&gt;
Every plane contains one bit of a pixel's colour index value. The bits of the binary representation of a colour index like %1010 (% Bit3,Bit2,Bit1,Bit0) will end up in 6 different planes (bits most significant to least significant aka left to right): Plane4 Plane3 Plane2 Plane1. &lt;br /&gt;
&lt;br /&gt;
So basicly Plane1 contains all of the Bit0s of all pixels, Plane2 all Bit1s, Plane3 all Bit2s and Plane4 all Bit3s.&lt;br /&gt;
&lt;br /&gt;
The first pixel on a plane is described by the leftmost (aka most significant) bit in a word, the second one by the second-leftmost etc. - just like this %0123456789abcdef with 0-f=pixels 1-16. %1000000000000000=$8000=pixel 1 in a plane word set. The 16th pixel will use the leftmost bit of the next word in this plane. etc.&lt;br /&gt;
&lt;br /&gt;
==== Drawing pixels ====&lt;br /&gt;
Here are some examples for drawing pixels in 1 or more bitplanes:&lt;br /&gt;
&lt;br /&gt;
1-bpp pixel plot&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;
2-bpp pixel plot&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;
&lt;br /&gt;
&lt;br /&gt;
==== Setting a palette====&lt;br /&gt;
The Amiga OCS uses index values into a palette of colours.  Palette format is a word per index with 3 nibbles for 4-bit RGB (e.g. $00f for blue).  Here is some code that will help you setup an entire palette at once using the intuition graphics routine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
lea sc_ViewPort(a5),a0&lt;br /&gt;
lea paldata(pc),a1&lt;br /&gt;
moveq #16,d0&lt;br /&gt;
jsr _LVOLoadRGB4(a6)&lt;br /&gt;
&lt;br /&gt;
; Palette data&lt;br /&gt;
paldata:	&lt;br /&gt;
	dc.w	$000,$100,$200,$311,$422,$533,$644,$755&lt;br /&gt;
	dc.w	$575,$464,$353,$242,$131,$020,$010,$000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can set individual palette entries either by using a graphics function or using the copperlist for setting initial colors&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&lt;br /&gt;
To Paula chip (registers $DFF0A0-$DFF0DA) is able to output 8-bit PCM through a maximum of 4 channels.&lt;br /&gt;
Since the chip's dma is fed every horizontal scanline, you need to share cycles between the soundchip and other processes, impacting the maximum frequency or channels you can use at any given time.&lt;br /&gt;
&lt;br /&gt;
The maximum audio buffer length is 65535 words (or about 128k of samples) &lt;br /&gt;
&lt;br /&gt;
==== Make some noise ====&lt;br /&gt;
So, here is a bit of sound code that outputs a single channel sound.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
    move.l  #pcmdata,$dff0a0         ; data to play (must be located in chipmem)&lt;br /&gt;
    move.l  #32&amp;lt;&amp;lt;16+(252*8),$dff0a4  ; length, period&lt;br /&gt;
    move.w  #64,$dff0a8              ; set volume&lt;br /&gt;
    move.w  #$8001,$dff096           ; enable audio channel 0	&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Additional Resources ===&lt;br /&gt;
* [https://amycoders.org/ AmyCoders]&lt;br /&gt;
* [https://archive.org/details/Amiga_Hardware_Reference_Manual_1985_Commodore Amiga Harware Reference Manual from Commodore (scans on Archive.org)]&lt;br /&gt;
* [http://amigadev.elowar.com/read/ADCD_2.1/Hardware_Manual_guide/node0000.html Hardware Manual Guide]&lt;br /&gt;
* [https://wiki.amigaos.net/wiki/Graphics_Primitives/ Overview of Graphics primitives drawing]&lt;br /&gt;
* [https://www.markwrobel.dk/project/amigamachinecode/ Learning Amiga machine code]&lt;br /&gt;
* [https://heckmeck.de/demoscene/ Amiga coding Blogposts by Losso]&lt;br /&gt;
* [http://www.coppershade.org/articles/Code/Articles/ Coppershade articles]&lt;br /&gt;
* [http://amiga-dev.wikidot.com/file-format:hunk#toc7 Amiga Header information]&lt;br /&gt;
* [http://amiga-dev.wikidot.com/information:hardware Amiga Hardware registers overview]&lt;br /&gt;
* [https://github-wiki-see.page/m/echolevel/open-amiga-sampler/wiki/Appendix-A%3A-Sample-rates-deep-dive Paula Sample rates]&lt;/div&gt;</summary>
		<author><name>Hitchhikr</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=X68000&amp;diff=1894</id>
		<title>X68000</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=X68000&amp;diff=1894"/>
				<updated>2026-02-12T07:26:52Z</updated>
		
		<summary type="html">&lt;p&gt;Hitchhikr: /* Video display */&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 calls 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;
moveq #-($100-$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;
        Mode    Frequency   Screen size Number of colors    Actual screen size  Number of pages&lt;br /&gt;
&lt;br /&gt;
        $0000   31          512x512     16                  1024x1024           1&lt;br /&gt;
        $0001   15          512x512     16                  1024x1024           1&lt;br /&gt;
        $0002   31          256x256     16                  1024x1024           1&lt;br /&gt;
        $0003   15          256x256     16                  1024x1024           1&lt;br /&gt;
        $0004   31          512x512     16                  512x512             4&lt;br /&gt;
        $0005   15          512x512     16                  512x512             4&lt;br /&gt;
        $0006   31          256x256     16                  512x512             4&lt;br /&gt;
        $0007   15          256x256     16                  512x512             4&lt;br /&gt;
        $0008   31          512x512     256                 512x512             2&lt;br /&gt;
        $0009   15          512x512     256                 512x512             2&lt;br /&gt;
        $000A   31          256x256     256                 512x512             2&lt;br /&gt;
        $000B   15          256x256     256                 512x512             2&lt;br /&gt;
        $000C   31          512x512     65536               512x512             1&lt;br /&gt;
        $000D   15          512x512     65536               512x512             1&lt;br /&gt;
        $000E   31          256x256     65536               512x512             1&lt;br /&gt;
        $000F   15          256x256     65536               512x512             1&lt;br /&gt;
        $0010   31          768x512     16                  1024x1024           1&lt;br /&gt;
        $0011   24          1024x424    16                  1024x1024           1&lt;br /&gt;
        $0012   24          1024x848    16                  1024x1024           1&lt;br /&gt;
        $0013   24          640x480     16                  1024x1024           1&lt;br /&gt;
        $0014   31          768x512     256                 512x512             2&lt;br /&gt;
        $0015   24          1024x424    256                 512x512             2&lt;br /&gt;
        $0016   24          1024x848    256                 512x512             2&lt;br /&gt;
        $0017   24          640x480     256                 512x512             2&lt;br /&gt;
        $0018   31          768x512     65536               512x512             1&lt;br /&gt;
        $0019   24          1024x424    65536               512x512             1&lt;br /&gt;
        $001A   24          1024x848    65536               512x512             1&lt;br /&gt;
        $001B   24          640x480     65536               512x512             1&lt;br /&gt;
&lt;br /&gt;
        $0100 to $0113 Settings only, do not initialize&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;
moveq #-($100-$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;
moveq #-($100-$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;
moveq #-($100-$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-1,d7&lt;br /&gt;
moveq #1,d0&lt;br /&gt;
drawloop:&lt;br /&gt;
move.w d0,(a0)+&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;
moveq #-($100-_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/xsdk X68000 Software Development Kit]&lt;/div&gt;</summary>
		<author><name>Hitchhikr</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=X68000&amp;diff=1893</id>
		<title>X68000</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=X68000&amp;diff=1893"/>
				<updated>2026-02-12T07:21:23Z</updated>
		
		<summary type="html">&lt;p&gt;Hitchhikr: /* Double buffering */&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;
moveq #-($100-$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;
moveq #-($100-$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;
moveq #-($100-$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-1,d7&lt;br /&gt;
moveq #1,d0&lt;br /&gt;
drawloop:&lt;br /&gt;
move.w d0,(a0)+&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;
moveq #-($100-_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/xsdk X68000 Software Development Kit]&lt;/div&gt;</summary>
		<author><name>Hitchhikr</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=X68000&amp;diff=1892</id>
		<title>X68000</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=X68000&amp;diff=1892"/>
				<updated>2026-02-12T07:20:57Z</updated>
		
		<summary type="html">&lt;p&gt;Hitchhikr: /* Clearing the screen */&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;
moveq #-($100-$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-1,d7&lt;br /&gt;
moveq #1,d0&lt;br /&gt;
drawloop:&lt;br /&gt;
move.w d0,(a0)+&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;
moveq #-($100-_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/xsdk X68000 Software Development Kit]&lt;/div&gt;</summary>
		<author><name>Hitchhikr</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=X68000&amp;diff=1891</id>
		<title>X68000</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=X68000&amp;diff=1891"/>
				<updated>2026-02-12T07:20:36Z</updated>
		
		<summary type="html">&lt;p&gt;Hitchhikr: /* Plotting to screen */&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-1,d7&lt;br /&gt;
moveq #1,d0&lt;br /&gt;
drawloop:&lt;br /&gt;
move.w d0,(a0)+&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;
moveq #-($100-_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/xsdk X68000 Software Development Kit]&lt;/div&gt;</summary>
		<author><name>Hitchhikr</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=X68000&amp;diff=1890</id>
		<title>X68000</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=X68000&amp;diff=1890"/>
				<updated>2026-02-12T07:19:40Z</updated>
		
		<summary type="html">&lt;p&gt;Hitchhikr: /* IOCS Drawing routines */&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;
moveq #-($100-_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/xsdk X68000 Software Development Kit]&lt;/div&gt;</summary>
		<author><name>Hitchhikr</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=X68000&amp;diff=1889</id>
		<title>X68000</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=X68000&amp;diff=1889"/>
				<updated>2026-02-12T07:19:03Z</updated>
		
		<summary type="html">&lt;p&gt;Hitchhikr: fixed sdk 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/xsdk X68000 Software Development Kit]&lt;/div&gt;</summary>
		<author><name>Hitchhikr</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Commodore_Amiga&amp;diff=1888</id>
		<title>Commodore Amiga</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Commodore_Amiga&amp;diff=1888"/>
				<updated>2026-02-12T06:56:37Z</updated>
		
		<summary type="html">&lt;p&gt;Hitchhikr: /* Sound */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Commodore Amiga ==&lt;br /&gt;
The Commodore Amiga system consists of the M68k system with custom hardware for graphics and sound.&lt;br /&gt;
&lt;br /&gt;
=== Setting up ===&lt;br /&gt;
&lt;br /&gt;
* Assembler: VASM&lt;br /&gt;
* Emulator(s): Linux: fs-uae, Windows: WinUAE&lt;br /&gt;
&lt;br /&gt;
Compile source to Amiga Kickstart1.x executable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
vasm -kick1hunks -Fhunkexe -o example -nosym &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Amiga executable format ===&lt;br /&gt;
Commodore Amiga executables consist of a 32 byte header, as well as a 4 byte footer. Here's an example where deadc0de is the only code data. 0000 03f2 marks the end of the block. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
00000000: 0000 03f3 0000 0000 0000 0001 0000 0000  &lt;br /&gt;
00000010: 0000 0000 0000 0001 0000 03e9 0000 0001  &lt;br /&gt;
00000020: dead c0de 0000 03f2 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Memory Map ===&lt;br /&gt;
Here is the amiga memory map&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Amiga_memorymap.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Video display ===&lt;br /&gt;
The Amiga OCS uses an interleaved planar memory layout to represent its various paletted display modes. &lt;br /&gt;
&lt;br /&gt;
==== Getting something on screen ====&lt;br /&gt;
One of the shortest ways to get you started with getting anything on screen at all, is to initialize and use the intuition graphics library routines. &lt;br /&gt;
These are relatively easy to setup and allow you to plot pixels, circles, rects and even polygons. &lt;br /&gt;
However, as can be expected these routines are extremely slow in execution.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
        incdir  &amp;quot;include&amp;quot;&lt;br /&gt;
        include &amp;quot;graphics/graphics_lib.i&amp;quot;&lt;br /&gt;
        include &amp;quot;intuition/screens.i&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        move.l  $170(a2),a6     ; intuitionbase from globvec&lt;br /&gt;
        move.l  ib_ActiveScreen(a6),a5  ; a5 = activeScreen (640x240 on most systems)&lt;br /&gt;
        move.l  $4.w,a6         ; execbase&lt;br /&gt;
        move.l  156(a6),a6      ; graphics.library&lt;br /&gt;
&lt;br /&gt;
        ; clear screen&lt;br /&gt;
        lea sc_RastPort(a5),a1&lt;br /&gt;
        jsr _LVOClearScreen(a6)&lt;br /&gt;
&lt;br /&gt;
frameloop:&lt;br /&gt;
	move.w	#240-1,d7		; y&lt;br /&gt;
yLoop:	&lt;br /&gt;
	move.w	#640-1,d6		; x&lt;br /&gt;
xLoop:&lt;br /&gt;
	; Set Pixel/Pen Color (d0 = color)&lt;br /&gt;
	move d6,d0		; d0=x&lt;br /&gt;
	eor d7,d0	        ; d0=x^y&lt;br /&gt;
	lsr #3,d0		; d0&amp;gt;&amp;gt;=3&lt;br /&gt;
    jsr _LVOSetAPen(a6)&lt;br /&gt;
&lt;br /&gt;
	; Write Pixel (d0=x, d1=y)&lt;br /&gt;
	move d6,d0&lt;br /&gt;
	move d7,d1&lt;br /&gt;
    jsr _LVOWritePixel(a6)&lt;br /&gt;
	dbra d6,xLoop	&lt;br /&gt;
    dbra d7,yLoop&lt;br /&gt;
&lt;br /&gt;
   bra frameloop&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Copperlist ====&lt;br /&gt;
Another way to start drawing things on screen is to setup a (minimal) copperlist with commands for one or more planes, which can be manipulated indiviually&lt;br /&gt;
&lt;br /&gt;
Copper list format: &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;
As it happens, you can also insert color definition into the copperlist.&lt;br /&gt;
&lt;br /&gt;
==== Planes ====&lt;br /&gt;
Every plane contains one bit of a pixel's colour index value. The bits of the binary representation of a colour index like %1010 (% Bit3,Bit2,Bit1,Bit0) will end up in 6 different planes (bits most significant to least significant aka left to right): Plane4 Plane3 Plane2 Plane1. &lt;br /&gt;
&lt;br /&gt;
So basicly Plane1 contains all of the Bit0s of all pixels, Plane2 all Bit1s, Plane3 all Bit2s and Plane4 all Bit3s.&lt;br /&gt;
&lt;br /&gt;
The first pixel on a plane is described by the leftmost (aka most significant) bit in a word, the second one by the second-leftmost etc. - just like this %0123456789abcdef with 0-f=pixels 1-16. %1000000000000000=$8000=pixel 1 in a plane word set. The 16th pixel will use the leftmost bit of the next word in this plane. etc.&lt;br /&gt;
&lt;br /&gt;
==== Drawing pixels ====&lt;br /&gt;
Here are some examples for drawing pixels in 1 or more bitplanes:&lt;br /&gt;
&lt;br /&gt;
1-bpp pixel plot&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;
2-bpp pixel plot&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;
&lt;br /&gt;
&lt;br /&gt;
==== Setting a palette====&lt;br /&gt;
The Amiga OCS uses index values into a palette of colours.  Palette format is a word per index with 3 nibbles for 4-bit RGB (e.g. $00f for blue).  Here is some code that will help you setup an entire palette at once using the intuition graphics routine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
lea sc_ViewPort(a5),a0&lt;br /&gt;
lea paldata(pc),a1&lt;br /&gt;
moveq #16,d0&lt;br /&gt;
jsr _LVOLoadRGB4(a6)&lt;br /&gt;
&lt;br /&gt;
; Palette data&lt;br /&gt;
paldata:	&lt;br /&gt;
	dc.w	$000,$100,$200,$311,$422,$533,$644,$755&lt;br /&gt;
	dc.w	$575,$464,$353,$242,$131,$020,$010,$000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can set individual palette entries either by using a graphics function or using the copperlist for setting initial colors&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&lt;br /&gt;
To Paula chip (registers $DFF0A0-$DFF0DA) is able to output 8-bit PCM through a maximum of 4 channels.&lt;br /&gt;
Since the chip's dma is fed every horizontal scanline, you need to share cycles between the soundchip and other processes, impacting the maximum frequency or channels you can use at any given time.&lt;br /&gt;
&lt;br /&gt;
The maximum audio buffer length is 65535 words (or about 128k of samples) &lt;br /&gt;
&lt;br /&gt;
==== Make some noise ====&lt;br /&gt;
So, here is a bit of sound code that outputs a single channel sound.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
    move.l  #pcmdata,$dff0a0         ; data to play (must be located in chipmem)&lt;br /&gt;
    move.l  #32&amp;lt;&amp;lt;16+(252*8),$dff0a4  ; length, period&lt;br /&gt;
    move.w  #64,$dff0a8              ; set volume&lt;br /&gt;
    move.w  #$8001,$dff096           ; enable audio channel 0	&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Additional Resources ===&lt;br /&gt;
* [https://amycoders.org/ AmyCoders]&lt;br /&gt;
* [https://archive.org/details/Amiga_Hardware_Reference_Manual_1985_Commodore Amiga Harware Reference Manual from Commodore (scans on Archive.org)]&lt;br /&gt;
* [http://amigadev.elowar.com/read/ADCD_2.1/Hardware_Manual_guide/node0000.html Hardware Manual Guide]&lt;br /&gt;
* [https://wiki.amigaos.net/wiki/Graphics_Primitives/ Overview of Graphics primitives drawing]&lt;br /&gt;
* [https://www.markwrobel.dk/project/amigamachinecode/ Learning Amiga machine code]&lt;br /&gt;
* [https://heckmeck.de/demoscene/ Amiga coding Blogposts by Losso]&lt;br /&gt;
* [http://www.coppershade.org/articles/Code/Articles/ Coppershade articles]&lt;br /&gt;
* [http://amiga-dev.wikidot.com/file-format:hunk#toc7 Amiga Header information]&lt;br /&gt;
* [http://amiga-dev.wikidot.com/information:hardware Amiga Hardware registers overview]&lt;br /&gt;
* [https://github-wiki-see.page/m/echolevel/open-amiga-sampler/wiki/Appendix-A%3A-Sample-rates-deep-dive Paula Sample rates]&lt;/div&gt;</summary>
		<author><name>Hitchhikr</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Commodore_Amiga&amp;diff=1887</id>
		<title>Commodore Amiga</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Commodore_Amiga&amp;diff=1887"/>
				<updated>2026-02-12T06:56:15Z</updated>
		
		<summary type="html">&lt;p&gt;Hitchhikr: /* Sound */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Commodore Amiga ==&lt;br /&gt;
The Commodore Amiga system consists of the M68k system with custom hardware for graphics and sound.&lt;br /&gt;
&lt;br /&gt;
=== Setting up ===&lt;br /&gt;
&lt;br /&gt;
* Assembler: VASM&lt;br /&gt;
* Emulator(s): Linux: fs-uae, Windows: WinUAE&lt;br /&gt;
&lt;br /&gt;
Compile source to Amiga Kickstart1.x executable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
vasm -kick1hunks -Fhunkexe -o example -nosym &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Amiga executable format ===&lt;br /&gt;
Commodore Amiga executables consist of a 32 byte header, as well as a 4 byte footer. Here's an example where deadc0de is the only code data. 0000 03f2 marks the end of the block. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
00000000: 0000 03f3 0000 0000 0000 0001 0000 0000  &lt;br /&gt;
00000010: 0000 0000 0000 0001 0000 03e9 0000 0001  &lt;br /&gt;
00000020: dead c0de 0000 03f2 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Memory Map ===&lt;br /&gt;
Here is the amiga memory map&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Amiga_memorymap.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Video display ===&lt;br /&gt;
The Amiga OCS uses an interleaved planar memory layout to represent its various paletted display modes. &lt;br /&gt;
&lt;br /&gt;
==== Getting something on screen ====&lt;br /&gt;
One of the shortest ways to get you started with getting anything on screen at all, is to initialize and use the intuition graphics library routines. &lt;br /&gt;
These are relatively easy to setup and allow you to plot pixels, circles, rects and even polygons. &lt;br /&gt;
However, as can be expected these routines are extremely slow in execution.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
        incdir  &amp;quot;include&amp;quot;&lt;br /&gt;
        include &amp;quot;graphics/graphics_lib.i&amp;quot;&lt;br /&gt;
        include &amp;quot;intuition/screens.i&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        move.l  $170(a2),a6     ; intuitionbase from globvec&lt;br /&gt;
        move.l  ib_ActiveScreen(a6),a5  ; a5 = activeScreen (640x240 on most systems)&lt;br /&gt;
        move.l  $4.w,a6         ; execbase&lt;br /&gt;
        move.l  156(a6),a6      ; graphics.library&lt;br /&gt;
&lt;br /&gt;
        ; clear screen&lt;br /&gt;
        lea sc_RastPort(a5),a1&lt;br /&gt;
        jsr _LVOClearScreen(a6)&lt;br /&gt;
&lt;br /&gt;
frameloop:&lt;br /&gt;
	move.w	#240-1,d7		; y&lt;br /&gt;
yLoop:	&lt;br /&gt;
	move.w	#640-1,d6		; x&lt;br /&gt;
xLoop:&lt;br /&gt;
	; Set Pixel/Pen Color (d0 = color)&lt;br /&gt;
	move d6,d0		; d0=x&lt;br /&gt;
	eor d7,d0	        ; d0=x^y&lt;br /&gt;
	lsr #3,d0		; d0&amp;gt;&amp;gt;=3&lt;br /&gt;
    jsr _LVOSetAPen(a6)&lt;br /&gt;
&lt;br /&gt;
	; Write Pixel (d0=x, d1=y)&lt;br /&gt;
	move d6,d0&lt;br /&gt;
	move d7,d1&lt;br /&gt;
    jsr _LVOWritePixel(a6)&lt;br /&gt;
	dbra d6,xLoop	&lt;br /&gt;
    dbra d7,yLoop&lt;br /&gt;
&lt;br /&gt;
   bra frameloop&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Copperlist ====&lt;br /&gt;
Another way to start drawing things on screen is to setup a (minimal) copperlist with commands for one or more planes, which can be manipulated indiviually&lt;br /&gt;
&lt;br /&gt;
Copper list format: &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;
As it happens, you can also insert color definition into the copperlist.&lt;br /&gt;
&lt;br /&gt;
==== Planes ====&lt;br /&gt;
Every plane contains one bit of a pixel's colour index value. The bits of the binary representation of a colour index like %1010 (% Bit3,Bit2,Bit1,Bit0) will end up in 6 different planes (bits most significant to least significant aka left to right): Plane4 Plane3 Plane2 Plane1. &lt;br /&gt;
&lt;br /&gt;
So basicly Plane1 contains all of the Bit0s of all pixels, Plane2 all Bit1s, Plane3 all Bit2s and Plane4 all Bit3s.&lt;br /&gt;
&lt;br /&gt;
The first pixel on a plane is described by the leftmost (aka most significant) bit in a word, the second one by the second-leftmost etc. - just like this %0123456789abcdef with 0-f=pixels 1-16. %1000000000000000=$8000=pixel 1 in a plane word set. The 16th pixel will use the leftmost bit of the next word in this plane. etc.&lt;br /&gt;
&lt;br /&gt;
==== Drawing pixels ====&lt;br /&gt;
Here are some examples for drawing pixels in 1 or more bitplanes:&lt;br /&gt;
&lt;br /&gt;
1-bpp pixel plot&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;
2-bpp pixel plot&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;
&lt;br /&gt;
&lt;br /&gt;
==== Setting a palette====&lt;br /&gt;
The Amiga OCS uses index values into a palette of colours.  Palette format is a word per index with 3 nibbles for 4-bit RGB (e.g. $00f for blue).  Here is some code that will help you setup an entire palette at once using the intuition graphics routine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
lea sc_ViewPort(a5),a0&lt;br /&gt;
lea paldata(pc),a1&lt;br /&gt;
moveq #16,d0&lt;br /&gt;
jsr _LVOLoadRGB4(a6)&lt;br /&gt;
&lt;br /&gt;
; Palette data&lt;br /&gt;
paldata:	&lt;br /&gt;
	dc.w	$000,$100,$200,$311,$422,$533,$644,$755&lt;br /&gt;
	dc.w	$575,$464,$353,$242,$131,$020,$010,$000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can set individual palette entries either by using a graphics function or using the copperlist for setting initial colors&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&lt;br /&gt;
To Paula chip (registers DFF0A0-DFF0DA) is able to output 8-bit PCM through a maximum of 4 channels.&lt;br /&gt;
Since the chip's dma is fed every horizontal scanline, you need to share cycles between the soundchip and other processes, impacting the maximum frequency or channels you can use at any given time.&lt;br /&gt;
&lt;br /&gt;
The maximum audio buffer length is 65535 words (or about 128k of samples) &lt;br /&gt;
&lt;br /&gt;
==== Make some noise ====&lt;br /&gt;
So, here is a bit of sound code that outputs a single channel sound.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
    move.l  #pcmdata,$dff0a0         ; data to play (must be located in chipmem)&lt;br /&gt;
    move.l  #32&amp;lt;&amp;lt;16+(252*8),$dff0a4  ; length, period&lt;br /&gt;
    move.w  #64,$dff0a8              ; set volume&lt;br /&gt;
    move.w  #$8001,$dff096           ; enable audio channel 0	&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Additional Resources ===&lt;br /&gt;
* [https://amycoders.org/ AmyCoders]&lt;br /&gt;
* [https://archive.org/details/Amiga_Hardware_Reference_Manual_1985_Commodore Amiga Harware Reference Manual from Commodore (scans on Archive.org)]&lt;br /&gt;
* [http://amigadev.elowar.com/read/ADCD_2.1/Hardware_Manual_guide/node0000.html Hardware Manual Guide]&lt;br /&gt;
* [https://wiki.amigaos.net/wiki/Graphics_Primitives/ Overview of Graphics primitives drawing]&lt;br /&gt;
* [https://www.markwrobel.dk/project/amigamachinecode/ Learning Amiga machine code]&lt;br /&gt;
* [https://heckmeck.de/demoscene/ Amiga coding Blogposts by Losso]&lt;br /&gt;
* [http://www.coppershade.org/articles/Code/Articles/ Coppershade articles]&lt;br /&gt;
* [http://amiga-dev.wikidot.com/file-format:hunk#toc7 Amiga Header information]&lt;br /&gt;
* [http://amiga-dev.wikidot.com/information:hardware Amiga Hardware registers overview]&lt;br /&gt;
* [https://github-wiki-see.page/m/echolevel/open-amiga-sampler/wiki/Appendix-A%3A-Sample-rates-deep-dive Paula Sample rates]&lt;/div&gt;</summary>
		<author><name>Hitchhikr</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=X68000&amp;diff=1769</id>
		<title>X68000</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=X68000&amp;diff=1769"/>
				<updated>2025-06-09T17:27:45Z</updated>
		
		<summary type="html">&lt;p&gt;Hitchhikr: Added link to XM6 PRO emulator&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;
&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;
=== 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/?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;/div&gt;</summary>
		<author><name>Hitchhikr</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=X68000&amp;diff=1768</id>
		<title>X68000</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=X68000&amp;diff=1768"/>
				<updated>2025-06-09T17:18:15Z</updated>
		
		<summary type="html">&lt;p&gt;Hitchhikr: &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 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/?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;/div&gt;</summary>
		<author><name>Hitchhikr</name></author>	</entry>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=X68000&amp;diff=1767</id>
		<title>X68000</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=X68000&amp;diff=1767"/>
				<updated>2025-06-09T17:17:08Z</updated>
		
		<summary type="html">&lt;p&gt;Hitchhikr: fixed demozoo 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&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/?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;/div&gt;</summary>
		<author><name>Hitchhikr</name></author>	</entry>

	</feed>