Difference between revisions of "X68000"

From SizeCoding
Jump to: navigation, search
(Created page with "== Sharp X68000 == The Sharp X68000 is a home computer created by Sharp Corporation. It was first released in 1987 and sold only in Japan. The initial model has a 10 MHz Moto...")
 
Line 518: Line 518:
 
* [https://archive.org/details/X68000_488] X68000 Technical data book
 
* [https://archive.org/details/X68000_488] X68000 Technical data book
 
* [https://msxpro.com/datasheet.html] YM2151 Datasheet
 
* [https://msxpro.com/datasheet.html] YM2151 Datasheet
* [https://demozoo.org/productions/?platform=95 X68000 demoscene productions]
+
* [https://demozoo.org/productions/tagged/x68000/ X68000 demoscene productions]

Revision as of 06:55, 26 May 2025

Sharp X68000

The Sharp X68000 is a home computer created by Sharp Corporation. It was first released in 1987 and sold only in Japan.

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.

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.

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;

Setting up

Memory map

address 	vector 	
	Function 	
$000000 	$00 	
	SSP after reset 	
$000004 	$01 	
	PC after reset 	
$000008 	$02 	
	Bus error 	
$00000c 	$03 	
	Address error 	
$000010 	$04 	
	Unknown instruction 	
$000014 	$05 	
	Division by 0 	
$000018 	$06 	
	CHK instruction 	
$00001c 	$07 	
	TRAPV instruction, FTRAPcc instruction 	
$000020 	$08 	
	Privilege violation 	
$000024 	$09 	
	Trace exception 	
$000028 	$0a 	
	Unsupported instruction line 1010 emulator (SX call) 	
$00002c 	$0b 	
	? line 1111 emulator (DOS call, floating point operation) 	
$000030 	$0c 	
	Unused 	
$000034 	$0d 	
	FPU ????????????????? 	
$000038 	$0e 	
	? ????????????? 	
$000034 	$0d 	
	FPU Protocol violation exception handling 	
$000038 	$0e '' 	
	Formatting error exception handling 	
$00003c 	$0f 	
	Uninitialized Interrupt 	
$000040 	$10 	
	Unused 	
$000044 	$11 	
	? 	
$000048 	$12 	
	? 	
$00004c 	$13 	
	? 	
$000050 	$14 	
	? 	
$000054 	$15 	
	? 	
$000058 	$16 	
	? 	
$00005c 	$17 	
	? 	
$000060 	$18 	
	Spurious Interrupt 	
$000064 	$19 	
	Level 1 Interrupt (auto vector) 	
$000068 	$1a 	
	? 	
$00006c 	$1b 	
	? 	
$000070 	$1c 	
	? 	
$000074 	$1d 	
	? 	
$000078 	$1e 	
	? 	
$00007c 	$1f 	
	? 	
$000080 	$20 	
	trap #0 	
$000084 	$21 	
	? #1 	
$000088 	$22 	
	? #2 	
$00008c 	$23 	
	? #3 	
$000090 	$24 	
	? #4 	
$000094 	$25 	
	? #5 	
$000098 	$26 	
	? #6 	
$00009c 	$27 	
	? #7 	
$0000a0 	$28 	
	? #8 (reserved for system) 	
$0000a4 	$29 	
	? #9 (OS debugger) 	
$0000a8 	$2a 	
	? #10 (reset & power off) 	
$0000ac 	$2b 	
	? #11 (BREAK key) 	
$0000b0 	$2c 	
	? #12 (COPY key) 	
$0000b4 	$2d 	
	? #13 (CTRL+C) 	
$0000b8 	$2e 	
	? #14 (error processing) 	
$0000bc 	$2f 	
	? #15 (IOCS call) 	
$0000c0 	$30 	
	FPU BSUN 	
$0000c0 	$30 	
	FPU BSUN 	
$0000c4 	$31 	
	? INEX1,INEX2 	
$0000c8 	$32 	
	? DZ 	
$0000cc 	$33 	
	? UNFL 	
$0000d0 	$34 	
	? OPERR 	
$0000d4 	$35 	
	? OVFL 	
$0000d8 	$36 	
	? SNAN 	
$0000dc 	$37 	
	??? 	
$0000dc 	$37 	
	Unused 	
$0000e0 	$38 	
	MMU 	
$0000e4 	$39 	
	? 	
$0000e8 	$3a 	
	? 	
$0000ec 	$3b 	
	Unused 	
$0000fc 	$3f 	
	Unused 	
$000100 	$40 	
	MFP RTC Alarm/1Hz 	
$000104 	$41 	
	MFP External power OFF 	
$000118 	$42 	
	MFP Front switch OFF 	
$00010c 	$43 	
	MFP FM Audio source 	
$000110 	$44 	
	MFP Timer-D (Used with BG processing) 	
$000114 	$45 	
	MFP Timer-C (Mouse/cursor/FDD control, etc.) 	
$000118 	$46 	
	MFP V-DISP 	
$00011c 	$47 	
	MFP RTC Clock 	
$000120 	$48 	
	MFP Timer-B 	
$000124 	$49 	
	MFP Key serial output error 	
$000128 	$4a 	
	MFP Key serial output empty 	
$00012c 	$4b 	
	MFP Key serial input error 	
$000130 	$4c 	
	MFP Key serial input 	
$000134 	$4d 	
	MFP Timer-A 	
$000138 	$4e 	
	MFP CRTC*IRQ 	
$00013c 	$4f 	
	MFP H-SYNC 	
$000140 	$50 	
	SCC(B) Transmission buffer empty 	
$000144 	$51 	
	SCC(B) '' 	
$000148 	$52 	
	SCC(B) External/status changes 	
$00014c 	$53 	
	SCC(B) '' 	
$000150 	$54 	
	SCC(B) Incoming character validity (Mouse 1 byte input) 	
$000154 	$55 	
	SCC(B) '' 	
$000158 	$56 	
	SCC(B) Special Rx condition 	
$00015c 	$57 	
	SCC(B) '' 	
$000160 	$58 	
	SCC(A) Transmission buffer empty 	
$000164 	$59 	
	SCC(A) '' 	
$000168 	$5a 	
	SCC(A) External status changes 	
$00016c 	$5b 	
	SCC(A) '' 	
$000170 	$5c 	
	SCC(A) Incoming character validity (RS-232C 1 byte input) 	
$000174 	$5d 	
	SCC(A) '' 	
$000178 	$5e 	
	SCC(A) Special Rx Condition 	
$00017c 	$5f 	
	SCC(A) '' 	
$000180 	$60 	
	I/O FDC status interruption 	
$000184 	$61 	
	I/O FDC insertion/discharge interruption 	
$000188 	$62 	
	I/O HDC status interruption 	
$00018c 	$63 	
	I/O Printer ready interruption 	
$000190 	$64 	
	DMAC #0 End (FDD) 	
$000194 	$65 	
	DMAC #0 Error ('') 	
$000198 	$66 	
	DMAC #1 End (SASI) 	
$00019c 	$67 	
	DMAC #1 Error ('') 	
$0001a0 	$68 	
	DMAC #2 End (IOCS _DMAMOVE,_DMAMOV_A,_DMAMOV_L) 	
$0001a4 	$69 	
	DMAC #2 Error ('') 	
$0001a8 	$6a 	
	DMAC #3 End (ADPCM) 	
$0001ac 	$6b 	
	DMAC #3 Error ('') 	
$000200 	$6c 	
	SPC SCSI interruption (Internal SCSI) 	
$000204 	$6d 	
	Unused 	
$0003d4 	$f5 	
	Unused 	
$0003d8 	$f6 	
	SPC SCSI interruption (SCSI board) 	
$0003dc 	$f7 	
	Unused 	
$0003fc 	$ff 	
	Unused 	
0x000000 	
	
	RAM area 	
$c00000 	
	
	Graphics Vram � Page 0 	
$c80000 	
	
	Graphics Vram � Page 1 (256/16 color only) 	
$d00000 	
	
	Graphics Vram � Page 2 (16 color only)
	
$d80000 	
	
	Graphics Vram � Page 3 (16 color only) 	
$e00000 	
	
	Text Vram � Bitplane 0 	
$e20000 	
	
	Text Vram � Bitplane 1
	
$e40000 	
	
	Text Vram � Bitplane 2
	
$e60000 	
	
	Text Vram � Bitplane 3
	
$e80000 	1.w 	
	R00 Horizontal total 	
$e80002 	1.w 	
	R01 Horizontal synchronization end position timing 	
$e80004 	1.w 	
	R02 Horizontal display start position 	
$e80006 	1.w 	
	R03 Horizontal display end position 	
$e80008 	1.w 	
	R04 Vertical total 	
$e8000a 	1.w 	
	R05 Vertical synchronization end position timing 	
$e8000c 	1.w 	
	R06 Vertical display start position 	
$e8000e 	1.w 	
	R07 Vertical display end position 	
$e80010 	1.w 	
	R08 External synchronization horizontal adjust: Horizontal position tuning 	
$e80012 	1.w 	
	R09 Raster number: Used for raster interruption 	
$e80014 	1.w 	
	R10 Text Screen X coordinate 	
$e80016 	1.w 	
	R11 Text Screen Y coordinate 	
$e80018 	1.w 	
	R12 Graphics screen Scroll X0 	
$e8001a 	1.w 	
	R13 Graphics screen Scroll Y0 	
$e8001c 	1.w 	
	R14 Graphics screen Scroll X1 	
$e8001e 	1.w 	
	R15 Graphics screen Scroll Y1 	
$e80020 	1.w 	
	R16 Graphics screen Scroll X2 	
$e80022 	1.w 	
	R17 Graphics screen Scroll Y2 	
$e80024 	1.w 	
	R18 Graphics screen Scroll X3 	
$e80026 	1.w 	
	R19 Graphics screen Scroll Y3 	
$e80028 	1.w 	
	R20 Memory mode/Display mode control 	
$e8002a 	1.w 	
	R21 Simultaneous access/Raster copy/Quick clear plane select 	
$e8002c 	1.w 	
	R22 Raster copy action: Raster number 	
$e8002e 	1.w 	
	R23 Text screen access mask pattern 	
$e80481 	1.b 	
	Active Image capture/Quick clear/Raster copy control 	
$e82000 	256.w 	
	Graphics palette 	
$e82200 	16.w 	
	Text palette (Palette block 0) 	
$e82220 	240.w 	
	Sprite palette ('' 1-15) 	
$e82400 	1.w 	
	R0 (Screen mode initialization) 	
$e82500 	1.w 	
	R1 (Priority control) 	
$e82600 	1.w 	
	R2 (Special priority/screen display) - Layers On/Off
	
$e84000 	
	
	DMAC (HD63450) 	
$e86000 	
	
	Memory controller privileged access settings (OHM/ASA) 	
$e88000 	
	
	MFP (MC68901) 	
$e8a000 	
	
	RTC (RP5C15) 	
$e8c000 	
	
	Printer port 	
$e8e001 	
	
	#1 Contrast 	
$e8e003 	
	
	#2 Display/3D Shutter Glasses (Bit 0=Right Eye / Bit 1 = Left Eye)
	
$e8e005 	
	
	#3 Color image unit (bit 4-0) 	
$e8e007 	
	
	#4 Keyboard/NMI/dot clock 	
$e8e009 	
	
	#5 ROM/DRAM Wait 	
$e8e00b 	
	
	#6 MPU Classification/Operation clock 	
$e8e00d 	
	
	#7 SRAM Write 	
$e8e00f 	
	
	#8 Unit power OFF 	
$E90001 	
	
	FM Synthesizer (YM2151) - Register Address Write port 	
$E90003 	
	
	FM Synthesizer (YM2151) - Data R/W port 	
$E92000 	
	
	ADPCM (MSM6258V) 	
$E94000 	
	
	Floppy disk controller (FDC) (uPD72065) 	
$E94005 	
	
	Floppy drive monitor (IOSC) 	
$E96000 	
	
	SASI 	
$E98000 	
	
	ESCC (Z8530) 	
$E9A000 	
	
	PPI (82C55) 	
$E9C000 	
	
	I/O selector (IOSC) 	
$E9E000 	
	
	I/O expansion area (Sharp reserved) 	
$EB0000 	
	
	Sprite register (CYNTHIA) 	
$EB8000 	
	
	Sprite VRAM 	
$EC0000 	
	
	I/O expansion area (User) 	
$ed0072 	2.b 	
	SX-Window environment flag (While in use with "SX") 	
$ed0074 	1.b 	
	Standard double-click time / 10 	
$ed0075 	1.b 	
	Mouse speed / 2 	
$ed0076 	1.b 	
	Text palette hue (HSV) 	
$ed0077 	1.b 	
	
	
$ed0078 	1.b 	
	Brightness palette 0-3 5bit??? 	
$ed007b 	1.b 	
	Printer drive (PRTD) ID 	
$ed007c 	1.b 	
	SRAM info version#, screen status storage, start screen storage 	
$ed007d 	1.b 	
	Desktop background (PICT) ID 	
$ed007e 	1.b 	
	Screen mode 	
$ed007f 	17.b 	
	Reserved for system use (X68030) 	
$ed0090 	1.b 	
	Standard cache status (bit=0: off 1:on) 	
$ed0091 	1.b 	
	OPM music during startup (0: OFF -1: ON) 	
$ed0092 	1.b 	
	10MHz Proper wait value 	
$ed0093 	1.b 	
	16MHz '' 	
$ed0094 	108.b 	
	Reserved for system use 	
$ed0100 	768.b 	
	Head SRAM program address 	
$ed0400 	15KB 	
	Head SRAMDISK address 	
$ed3fff 	
	
	End of SRAM 	
$ed4000 	
	
	Backup (64KB) 	
$ee0000 	
	
	Unused (128KB) 	
$f00000 	
	
	CGROM(768KB) 	
$fc0000 	
	
	SCSI IOCS / IPL(8KB) 	
$fe0000 	
	
	ROM Debugger 	
$ff0000 	
	
	IPL / ROM IOCS

Video display

To be added


Vsync

Port $18021 bit 3 will go high (1) when Vsync starts, then we need to write a 1 to that same bit at the same port to clear the Vsync event. Therefore, in effect we can write 255 to port $18021, then read from $18021 until it's nonzero to get the Vsync event.

waitVBlank:
    move.w $e88000,d0
    and.w #%00010000,d0            ;Wait for vblank to start
    beq waitVBlank
waitVBlank2:   
    move.w $e88000,d0
    and.w #%00010000,d0            ;Wait for Vblank to end
    bne waitVBlank2
    rts

Plotting to screen

To be added

Sound

The X68000 has a YM2151 FM Soundchip on board with 8 channels. 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

For more information, check out the YM2151 specs at [1]

Additional Resources