80186 programming for the Wonderswan and Wonderswan Color
This page is Under Construction.... 'Learn 8086 is planned for 2020'

The Wonderswan was never released outside of Japan, released in 1999, it was released to compete with the Gameboy Color and NeoGeo...

It was upgraded just one year later with an upgraded color model, there was also a Wonderswan Crystal, however this was technically the same as the Wonderswan Color, just with a better screen...

Despite being a commercial failure, the Wonderswan was a powerful system, and impressively, it's V30MZ CPU is x86 compatible! (80186)... this means we can write games and programs for it with UASM!




Specs:

Wonderswan Wonderswan color
Cpu 3.072mhz 186 compatible 3.072mhz 186 compatible
Ram 16k 64k
Resolution 224x144 (28x18 tiles) 224x144 (28x18 tiles)
Colors 16 Greyscale 4096  (256 onscreen)
Tile Layers 2 tilemaps (32x32) 2bpp planar
2 tilemaps (32x32) 4bpp / 2bpp... planar / linear
Sprites 128 (8x8 px 32 per line) 2bpp planar 128 (8x8 px 32 per line) 4bpp/2bpp... planar / linear
Sound 4 x 4 bit PCM 4 x 4 bit PCM


WonderSwan, Wonderswan Color, Womderswan Crystal


If you want to learn 8086 get the Cheatsheet! it has all the 8086 commands, It will help you get started with ASM programming, and let you quickly look up commands when you get confused!


Resources
WSMAN - The only real documentation on the wonderswan out there

Memory Map

Address Size Purpose Bits Details
$00000
IVT Interrupt Table

$00100
Wonderwan RAM

$00E00 $200 Sprite settings XXXXXXXX YYYYYYYY VHPWpppn nnnnnnnn N=tile Number V=Vflip H=Hflip P=Priority W=Window p=Palette(8+) Y=(-8 to 144) X=(-8 to 224)
$01000 $800 Tilemap 1 (SCR1) VHBPPPPT TTTTTTT Tile / Palette / wsc Bank / Hflip / Vflip
$01800 $800 Tilemap 2 (SCR2) VHBPPPPT TTTTTTT Tile / Palette / wsc Bank / Hflip / Vflip
$02000 $2000 2bpp tiles / Sprites

$04000 $4000/2000 4bpp Sprites / WSC extra 2bpp tiles)

$08000 $4000 4bpp tiles

$0FE00 $100 Palettes 0-7 -RGB
$0FF00 $100 Palettes 8-15 -RGB
$10000 $10000 Cartridge SRAM

$20000
ROM 0

$30000
ROM 1

$40000
ROM 2

Note: Address of Tilemap 1,2 set by port 07h (value for these settings 32h) and Sprites set by port 04h (value for these settings 07h)

Ports

Port    
RW  
Purpose Bits Details
000h RW REG_DISP_CTRL --EMWS21 1=Scr 1 2=Scr2 S=Sprite on / W=SprWin on / M=Scr2 Win Mode / E=Scr2 Win Enable
001h RW REG_BACK_COLOR CCCCCCCC
C=Color
002h R REG_LINE_CUR YYYYYYYY Y=Current Y line being drawn
003h RW REG_LINE_CMP YYYYYYYY Interrupt Ypos
004h RW REG_SPR_BASE --AAAAAA A=Sprite Address>>9 (04h=0E00h)
005h RW REG_SPR_FIRST SSSSSSSS First Sprite to show (128 total)
006h RW REG_SPR_COUNT SSSSSSSS Sprite Count to show (128 total)
007h RW REG_MAP_BASE 22221111 Tilemap Bases>>11 (32h= 1000h / 1800h)
008h RW REG_SCR2_WIN_X0 XXXXXXXX Window - Min X
009h RW REG_SCR2_WIN_Y0 YYYYYYYY Window - Min Y
00Ah RW REG_SCR2_WIN_X1 XXXXXXXX Window - Max X
00Bh RW REG_SCR2_WIN_Y1 YYYYYYYY Window - Max Y
00Ch RW REG_SPR_WIN_X0 XXXXXXXX Sprite Window - Min X
00Dh RW REG_SPR_WIN_Y0 YYYYYYYY Sprite Window - Min Y
00Eh RW REG_SPR_WIN_X1 XXXXXXXX Sprite Window - Max X
00Fh RW REG_SPR_WIN_Y1 YYYYYYYY Sprite Window - Max Y
010h RW REG_SCR1_X XXXXXXXX
011h RW REG_SCR1_Y YYYYYYYY
012h RW REG_SCR2_X XXXXXXXX
013h RW REG_SCR2_Y YYYYYYYY
014h RW REG_LCD_CTRL -------C
1=WSC High Contrast
015h RW REG_LCD_ICON DDDDDDDD

016h RW REG_LCD_VTOTAL DDDDDDDD
017h RW REG_LCD_VSYNC DDDDDDDD
01Ch RW REG_PALMONO_POOL_0 11110000
01Dh RW REG_PALMONO_POOL_1 33332222
01Eh RW REG_PALMONO_POOL_2 55554444
01Fh RW REG_PALMONO_POOL_3 77776666
020h RW REG_PALMONO_0 L 11110000 Tilemap Palette 0
021h RW REG_PALMONO_0 H 33332222
022h RW REG_PALMONO_1 L 11110000 Tilemap Palette 1
023h RW REG_PALMONO_1 H 33332222
024h RW REG_PALMONO_2 L 11110000 Tilemap Palette 2
025h RW REG_PALMONO_2 H 33332222
026h RW REG_PALMONO_3 L 11110000 Tilemap Palette 3
027h RW REG_PALMONO_3 H 33332222
028h RW REG_PALMONO_4 L 11110000 Tilemap Palette 4
029h RW REG_PALMONO_4 H 33332222
02Ah RW REG_PALMONO_5 L 11110000 Tilemap Palette 5
02Bh RW REG_PALMONO_5 H 33332222
02Ch RW REG_PALMONO_6 L 11110000 Tilemap Palette 6
02Dh RW REG_PALMONO_6 H 33332222
02Eh RW REG_PALMONO_7 L 11110000 Tilemap Palette 7
02Fh RW REG_PALMONO_7 H 33332222
030h RW REG_PALMONO_8 L 11110000 Sprite Palette 1
031h RW REG_PALMONO_8 H 33332222
032h RW REG_PALMONO_9 L 11110000 Sprite Palette 2
033h RW REG_PALMONO_9 H 33332222
034h RW REG_PALMONO_A L 11110000 Sprite Palette 3
035h RW REG_PALMONO_A H 33332222
036h RW REG_PALMONO_B L 11110000 Sprite Palette 4
037h RW REG_PALMONO_B H 33332222
038h RW REG_PALMONO_C L 11110000 Sprite Palette 5
039h RW REG_PALMONO_C H 33332222
03Ah RW REG_PALMONO_D L 11110000 Sprite Palette 6
03Bh RW REG_PALMONO_D H 33332222
03Ch RW REG_PALMONO_E L 11110000 Sprite Palette 7
03Dh RW REG_PALMONO_E H 33332222
03Eh RW REG_PALMONO_F L 11110000 Sprite Palette 8
03Fh RW REG_PALMONO_F H 33332222

Sprites

Sprites are controlled by a set of registers, and 4 bytes per entry in the table at address defined by port 04h. There are 128 in total.

Each sprite uses 4 bytes in the format: %XXXXXXXXYYYYYYYYVHPWpppnnnnnnnnn    N=tile Number V=Vflip H=Hflip P=Priority W=Window p=Palette(8+) Y=(-8 to 144) X=(-8 to 224)

The window can be enabled or disabled by port 00h, and how the window affects the sprites is defined by bit 12 of the sprite definitions in ram.




Learn Assembly for the Greatest Classic Processors:  Z80 - 6502 - 68000 - 8086 - ARM
Visit www.ChibiAkumas.com and www.ChibiAliens.com to get my games and their source code! | Support me on patreon

 

View Options
Default Dark
Simple (Hide this menu)
Print Mode (white background)

Top Menu
***Main Menu***
Youtube channel
Forum
AkuSprite Editor
Dec/Bin/Hex/Oct/Ascii Table

Z80 Content
***Z80 Tutorial List***
Learn Z80 Assembly
Hello World
Advanced Series
Multiplatform Series
Platform Specific Series
ChibiAkumas Series
Grime Z80
Z80 Downloads
Z80 Cheatsheet
Sources.7z
DevTools kit
Z80 Platforms
Amstrad CPC
Elan Enterprise
Gameboy & Gameboy Color
Master System & GameGear
MSX & MSX2
Sam Coupe
TI-83
ZX Spectrum
Spectrum NEXT
Camputers Lynx

6502 Content
***6502 Tutorial List***
Learn 6502 Assembly
Advanced Series
Platform Specific Series
Hello World Series
Grime 6502
6502 Downloads
6502 Cheatsheet
Sources.7z
DevTools kit
6502 Platforms
Apple IIe
Atari 800 and 5200
Atari Lynx
BBC Micro
Commodore 64
Commander x16
Super Nintendo (SNES)
Nintendo NES / Famicom
PC Engine (Turbografx-16)
Vic 20

68000 Content
***68000 Tutorial List***
Learn 68000 Assembly
Hello World Series
Platform Specific Series
Grime 68000
68000 Downloads
68000 Cheatsheet
Sources.7z
DevTools kit
68000 Platforms
Amiga 500
Atari ST
Neo Geo
Sega Genesis / Mega Drive
Sinclair QL
X68000 (Sharp x68k)

8086 Content
Learn 8086 Assembly
Platform Specific Series
Hello World Series
8086 Downloads
8086 Cheatsheet
Sources.7z
DevTools kit
8086 Platforms
Wonderswan
MsDos

ARM Content
Learn ARM Assembly
ARM Downloads
ARM Cheatsheet
Sources.7z
DevTools kit
ARM Platforms
Gameboy Advance
Nintendo DS
Risc Os

Risc-V Content
Learn Risc-V Assembly
Risc-V Downloads
Risc-V Cheatsheet
Sources.7z
DevTools kit

PDP-11 Content
Learn PDP-11 Assembly
PDP-11 Downloads
PDP-11 Cheatsheet
Sources.7z
DevTools kit

TMS9900 Content
Learn TMS9900 Assembly
TMS9900 Downloads
TMS9900 Cheatsheet
Sources.7z
DevTools kit
TMS9900 Platforms
Ti 99

6809 Content
Learn 6809 Assembly
6809 Downloads
6809/6309 Cheatsheet
Sources.7z
DevTools kit
6809 Platforms
Dragon 32/Tandy Coco
Fujitsu FM7
TRS-80 Coco 3
Vectrex

My Game projects
Chibi Aliens
Chibi Akumas

Work in Progress
Learn 65816 Assembly
Learn eZ80 Assembly

Misc bits
Ruby programming









Buy my Assembly programming book
on Amazon in Print or Kindle!


Buy my Assembly programming book

Available worldwide!
Search 'ChibiAkumas' on
your local Amazon website!
Click here for more info!












































Recent New Content
* Lesson YQuest4 - Amiga Specific code
* Joystick and Key Reading on the TI-99 with the CRU
* Sinclair QL Specific code - 68000 ASM YQuest3
* Nintendo DS Bitmap graphics (16 bit) Arm ASM






















































Buy my Assembly programming book
on Amazon in Print or Kindle!


Buy my Assembly programming book

Available worldwide!
Search 'ChibiAkumas' on
your local Amazon website!
Click here for more info!












































Recent New Content
* Lesson YQuest4 - Amiga Specific code
* Joystick and Key Reading on the TI-99 with the CRU
* Sinclair QL Specific code - 68000 ASM YQuest3
* Nintendo DS Bitmap graphics (16 bit) Arm ASM






















































Buy my Assembly programming book
on Amazon in Print or Kindle!


Buy my Assembly programming book

Available worldwide!
Search 'ChibiAkumas' on
your local Amazon website!
Click here for more info!












































Recent New Content
* Lesson YQuest4 - Amiga Specific code
* Joystick and Key Reading on the TI-99 with the CRU
* Sinclair QL Specific code - 68000 ASM YQuest3
* Nintendo DS Bitmap graphics (16 bit) Arm ASM