68000 Assembly Programming for the Sega Genesis (Mega Drive)

The Genesis is Sega's 16 bit sucessor to the Master System... With some backwards compatibility at a hardware level, and much more powerful graphics and the CPU... the Genesis was a huge step up from the 8 bit generation

While the 68K CPU was massivly superior to that of the Super nintendo, unfortunately the Mode 7 capabilities of the SNES hardware more than made up for it, and the FX chip pretty much doomed the Genesis... but for the programmer, the Genesis is a great system giving the ease and power of the 68000, and a more conventional graphics system than the ROM based NeoGeo!

Specs:

Sega Genesis
Cpu 8mhz 68000
Ram 64K
Vram 64K
Resolution 320x224
Bitmap planes 2 x 16 color
Max Sprites 80 sprites 16 color  (8x8 px 20 per line)
Sound chip Z80 (8K Ram) + YM2612 FM + PSG
Power Adaptor Genesis 1 (large version) 9V Center Negative (10V Famicom adaptor works fine)
Genesis 2 (smaller model) 10V Center Positive


ChibiAkumas Tutorials
Lesson P5 - Bitmap Functions on the Genesis

Lesson P11 - Joystick Reading on the Genesis

Lesson P16 - Palette Definitions on the Genesis

Lesson P20 - FM Sound on the Genesis via the Z80

Lesson P21 - FM Sound on the Genesis via the 68000
Lesson P27 - Hardware Sprites on the Genesis / Megadrive

Genesis Links

Genesis_Technical_Overview_v1.00_1991_Sega_US PDF
MegaDrive Development Wiki
PlutieDev - Genesis Documentation and Tutorials


68000 Memory Map
Start address End address Description
$000000 $3FFFFF Cartridge ROM/RAM
$400000 $7FFFFF Reserved (used by the Sega CD and 32x)
$800000 $9FFFFF Reserved (used by the 32x?)
$A00000 $A0FFFF Z80 addressing space
$A10000 $A10001 Version register (read-only word-long)
$A10002 $A10003 Controller 1 data
$A10004 $A10005 Controller 2 data
$A10006 $A10007 Expansion port data
$A10008 $A10009 Controller 1 control
$A1000A $A1000B Controller 2 control
$A1000C $A1000D Expansion port control
$A1000E $A1000F Controller 1 serial transmit
$A10010 $A10011 Controller 1 serial receive
$A10012 $A10013 Controller 1 serial control
$A10014 $A10015 Controller 2 serial transmit
$A10016 $A10017 Controller 2 serial receive
$A10018 $A10019 Controller 2 serial control
$A1001A $A1001B Expansion port serial transmit
$A1001C $A1001D Expansion port serial receive
$A1001E $A1001F Expansion port serial control
$A10020 $A10FFF Reserved
$A11000
Memory mode register
$A11002 $A110FF Reserved
$A11100 $A11101 Z80 bus request
$A11102 $A111FF Reserved
$A11200 $A11201 Z80 reset
$A11202 $A13FFF Reserved
$A14000 $A14003 TMSS register
$A14004 $BFFFFF Reserved
$C00000
VDP Data Port
$C00002
VDP Data Port (Mirror)
$C00004
VDP Control Port
$C00006
VDP Control Port (Mirror)
$C00008
H/V Counter
$C0000A
H/V Counter (Mirror)
$C0000C
H/V Counter (Mirror)
$C0000E
H/V Counter (Mirror)
$C00011
SN76489 PSG
$C00013
SN76489 PSG (Mirror)
$C00015
SN76489 PSG (Mirror)
$C00017
SN76489 PSG (Mirror)
$C0001C
Disable/Debug register
$C0001E
Disable/Debug register (Mirror)
$C0001E $FEFFFF Reserved
$FF0000 $FFFFFF 68000 RAM
Z80 Memory Map
From To Meaning
$0000 $1FFF Sound Ram
$2000 $3FFF Reserved
$4000
YM2612 A0
$4001
YM2612 D0
$4002
YM2612 A1
$4003
YM2612 D1
$4000 $5FFF Sound Chip
$6000
Bank Register
$6000 $7F10 Misc
$7F11
PSG 76489
$7F12 $7FFF Misc
$8000 $FFFF 68000 Bank

There are no Ports (accessible with Z80 OUT/IN)
We have to access the sound chip and 68000 cpu from these memory mapped addresses.

VDP Registers
RegNum Meaning

Sample Result
0 mode register 1 ---H-1M-
$04 no H interrupt
1 mode register 2 -D-V-D-P1--
$14 blanked, no V interrupt, DMA enable
2 name table base for scroll A (A=top 3 bits) --AAA---
$30 $C000
3 name table base for window (A=top 4 bits / 5 in H40 Mode) --AAAAA-
$3C $F000
4 name table base for scroll B (A=top 3 bits) -----AAA
$07 $E000
5 sprite attribute table base (A=top 7 bits / 6 in H40) -AAAAAAA
$6C $D800
6 unused register

$00 $00
7 background color (P=Palette C=Color) --PPCCCC
$00 $00
8 unused register

$00 $00
9 unused register

$00 $00
10 H interrupt register (L=Number of lines) LLLLLLLL
$FF $FF (esentially off)
11 mode register 3 ----IVHL
$00 disable ext int, full H/V scroll
12 mode register 4 (C bits both1 = H40 Cell) C---SIIC
$81 40 cell horizontal mode, no interlace
13 H scroll table base (A=Top 6 bits) --AAAAAA
$37 $FC00
14 unused register

$00 $00
15 auto increment (After each Read/Write) NNNNNNNN
$01 $01
16 scroll size (Horiz & Vert size of ScrollA & B) --VV-HH
$01 V 32 cell, H 64 cell
17 window H position (D=Direction C=Cells) D—CCCCC
$00 $00
18 window V position (D=Direction C=Cells) D—CCCCC
$00 $00
19 DMA length count low LLLLLLLL
$FF $00FF
20 DMA length count high HHHHHHHH
$FF $Ffxx
21 DMA source address low LLLLLLLL
$00 $xxxx00
22 DMA source address mid MMMMMMMM
$00 $xx00xx
23 DMA source address high (C=CMD) CCHHHHHH
$80 VRAM fill, addr $00xxxx
l
Color Ram addresses
Palette ColorNum Address Palette ColorNum Address Palette ColorNum Address Palette ColorNum Address
Palette 0 Color 0 $C0000000 Palette 1 Color 0 $C0200000 Palette 2 Color 0 $C0400000 Palette 3 Color 0 $C0600000

Color 1 $C0020000
Color 1 $C0220000
Color 1 $C0420000
Color 1 $C0620000

Color 2 $C0040000
Color 2 $C0240000
Color 2 $C0440000
Color 2 $C0640000

Color 3 $C0060000
Color 3 $C0260000
Color 3 $C0460000
Color 3 $C0660000

Color 4 $C0080000
Color 4 $C0280000
Color 4 $C0480000
Color 4 $C0680000

Color 5 $C00A0000
Color 5 $C02A0000
Color 5 $C04A0000
Color 5 $C06A0000

Color 6 $C00C0000
Color 6 $C02C0000
Color 6 $C04C0000
Color 6 $C06C0000

Color 7 $C00E0000
Color 7 $C02E0000
Color 7 $C04E0000
Color 7 $C06E0000

Color 8 $C0100000
Color 8 $C0300000
Color 8 $C0500000
Color 8 $C0700000

Color 9 $C0120000
Color 9 $C0320000
Color 9 $C0520000
Color 9 $C0720000

Color 10 $C0140000
Color 10 $C0340000
Color 10 $C0540000
Color 10 $C0740000

Color 11 $C0160000
Color 11 $C0360000
Color 11 $C0560000
Color 11 $C0760000

Color 12 $C0180000
Color 12 $C0380000
Color 12 $C0580000
Color 12 $C0780000

Color 13 $C01A0000
Color 13 $C03A0000
Color 13 $C05A0000
Color 13 $C07A0000

Color 14 $C01C0000
Color 14 $C03C0000
Color 14 $C05C0000
Color 14 $C07C0000

Color 15 $C01E0000
Color 15 $C03E0000
Color 15 $C05E0000
Color 15 $C07E0000

Colors are defined by 16 bits in the following format

  F    E    D    C    B    A    9    8      7    6    5    4    3    2     1     0  
- - - - B2 B1 B0 -
G2 G1 G0 - R2 R1 R0 -

Vram Addressing
The Genesis has 64k Vram - the purpose of each memory position is configurable, but a suggested memory map is shown to the right.

Selecting a memory address is performed by sending 4 bytes...  to the Control port, however the structiure of these bytes - and their relation to the address selected is slightly odd.. this is possibly due the "Backwards compatibility" with the SMS

Genesis tiles are 8x8, and 4 bits per pixel, so 32 bytes per tile

Memory Address Byte Command
$0000 $40000000
$1000 $50000000
$2000 $60000000
$3000 $70000000
$4000 $40000001
$5000 $50000001
$6000 $60000001
$7000 $70000001
$8000 $40000002
$9000 $50000002
$A000 $60000002
$B000 $70000002
$C000 $40000003
$D000 $50000003
$E000 $60000003
$F000 $70000003
$FFFF $7FFF0003
Vram Address Possible Use
$0000 Pattern definitions
$C000 Scroll A – Tilemap
$D800 Sprite Attrib table
$E000 Scroll B – Tilemap
$F000 Window Map
$FC00 Hscroll Table

Sound
The Genesis has backwards compatibility with the SMS/GG SN76489

If we're getting the Genesis Z80 to control the SN76489, we can just send data to port &7F again!
Unlike the NeoGeo, we can access the sound chip from the 68000 - which is probably easier!... we do this by writing to port &C00011

The data uses the format below


Bits
Command Bit Details  7  6  5  4  3  2  1  0
Format Template L=Latch C=Channel T=Type XXXX=Data L C C T D D D D










Tone - Command 1/2 C=Channel L=tone Low data 1 C C 0 L L L L
Tone - Command 2/2 H= High tone data (Higher numbers = lower tone) 0 - H H H H H H
Volume C=Channel (0-2)  V=Volume (15=silent 0=max) 1 C C 1 V V V V
Noise Channel (Channel 3)  M=Noise mode (1=white) R=Rate (3=use tone 2) 1 1 1 0 - M R R

Selecting Patterns in the Tilemap

Tilemap A is defined by addresses &C000 onwards - each tile is defined by 2 bytes

The tilemap is 64 tiles wide and 32 tile stall

F E D C B A 9 8
7 6 5 4 3 2 1 0
L P P V H T T T
T T T T T T T T    T=Tille number  H=Hflip  V=vflip  P=palette number   L=Layer (in front of /behind sprites)

Sprites

In H40 mode (the mode used in these tutorials), we can have up to 80 sprites onscreen...  (H32 mode can do only 64)
Each sprite can be 8x8 to 32x32
The position (and other settings) are defined by 8 by (4 Words) per sprite.tes

Address Sprite Num Details
$D800 1 Ypos
$D802 1 Size,Link
$D804 1 Palette,Flip,Pattern
$D806 1 Xpos
$D808 2 Ypos
$D80A 2 Size,Link
$D80C 2 Palette,Flip,Pattern
$D80E 2 Xpos
$D810 3 Ypos


$D9FF 64 Xpos – Last Sprite of H32


$DA7F 80 Xpos – Last Sprite of H80

As we can see, Each sprite has 4 words, they use the same pattern data as the background...

Address   F   E   D   C   B   A   9   8   
 7   6   5   4    3   2   1   0   Details
$D800 - - - - - - Y Y
Y Y Y Y Y Y Y Y  Y-Pos
$D802 - - - - W W H H
- L L L L L L L  Width (8,16,24,32), Height (8,16,24,32), Link (to next sprite)
$D804 P C C V H N N N
N N N N N N N N  Priority, Color palette , Vflip, Hflip, tile Number
$D806 - - - - - - - X
X X X X X X X X  X-pos

The 'Link' Connects the sprites together, each sprite should point to the next (starting from Sprite 0) and the last sprite should point back to sprite 0, this is not like neogeo chaining,it doesn't make the sprites move together it doesn't make the sprites move together - it defines the 'draw order' of the active sprites.

Multi pattern Sprites
A basic sprite is 8x8, but sprites can be enlarged up to 32x32... however this sprite will still be made up of 8x8 pattern data...

If we want a larger sprite, we need to break up the sprite into 8x8 blocks, and save those in VRAM in the correct order - the tiles go down first, and across second, as shown below:

1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16


Sound on the Genesis via SN76489

The Genesis still supports the Master System & Gamegear sound chip, and we can use it in the same way as those systems if we wish... the data we send is in the format below


Bits
Command Bit Details  7  6  5  4  3  2  1  0
Format Template L=Latch C=Channel T=Type XXXX=Data L C C T D D D D










Tone - Command 1/2 C=Channel L=tone Low data 1 C C 0 L L L L
Tone - Command 2/2 H= High tone data (Higher numbers = lower tone) 0 - H H H H H H
Volume C=Channel (0-2)  V=Volume (15=silent 0=max) 1 C C 1 V V V V
Noise Channel (Channel 3)  M=Noise mode (1=white) R=Rate (3=use tone 2) 1 1 1 0 - M R R

We looked at using the SN76489 on the Genesis in the Z80 Tutorials here!



FM Sound on the Genesis via YM2612
The Genesis uses 2 pairs of Address and Data ports to access ALL the sound registers - these can be accessed by the Z80, or 68000, but we must disable the Z80 if we want to use the 68000,
We can do this with the commands shown the right

Learn more about the registers with the YM2608 manual   (Japanese Original) Note... The YM2612 only has the FM part, and does not have the SSG of the 2608
    move.w  #$100,$a11100    ;Z80 Bus REQ
    move.w  #$100,$a11200    ;Z80 Reset


Each channel runs an 'Algorithm made up of multiple 'Operators', these all combine to make a particular type of sound.

Algorithms:
Alg1: Four serial connection mode 
Alg2: Three double modulation serial connection mode
Alg3: Double modulation mode
Alg4: Two serial connection and two parallel modes
Alg5: Common modulation 3 parallel mode
Alg6: Two serial connection + two sine mode
Alg7: Four parallel sine synthesis mode
The sound changes over time depending on various Operator registers...

Sound Terminology:

Attack: Increase in volume to max after Key down (Reg $50-$5E)
Decay: Short term Sound Fade rate over time while key down (Reg $60-$6E)
Sustain:
Long term Sound Fade rate (Reg $70-$7E)
Release:
Sound Fade rate after key released (Reg $80-$8E)

Total Level: Effective volume - the loudest the tone ever gets ($40-$4E)
Sustain Level: Volume level at which Decay ends, and Sustain starts ($80-$8E)

YM2612 Registers

  Reg 
Purpose A0/D0 $4000/1 A1/D1 $4002/3 Bits Details
$22 LFO ALL - ----EFFF E=enable F=frequency
$24 Timer A low ALL - TTTTTTTT Timer bits 10-2
$25 Timer A high ALL - ------TT Timer bits 1-0
$26 Timer B ALL - TTTTTTTT Timer B
$27 Ch3 CSM Mode & Ch3 Multi-Mode & Enable Timers ALL - 33RROOSS 3= Chn 3 mode / R=timer resets / O= Timer overflows / S = Timer StartStop
$28 Individual Operator Key On/Off ALL - OOOO-CCC O=operator / C=Channel (0=chn 1)
$29 SCH, IRQ Enable ALL - S--IIIII S=Sixchannel / I=IRQ Enable
$2A DAC Write ALL - DDDDDDDD D=Data
$2B DAC Enable ALL - E------- E=enable
$30 Multiplier & Detune Ch1 Op1 Ch4 Op1 -DDDMMMM D=Detune / M=Multiplier
$31 Multiplier & Detune Ch2 Op1 Ch5 Op1 -DDDMMMM D=Detune / M=Multiplier
$32 Multiplier & Detune Ch3 Op1 Ch6 Op1 -DDDMMMM D=Detune / M=Multiplier
$34 Multiplier & Detune Ch1 Op2 Ch4 Op2 -DDDMMMM D=Detune / M=Multiplier
$35 Multiplier & Detune Ch2 Op2 Ch5 Op2 -DDDMMMM D=Detune / M=Multiplier
$36 Multiplier & Detune Ch3 Op2 Ch6 Op2 -DDDMMMM D=Detune / M=Multiplier
$38 Multiplier & Detune Ch1 Op3 Ch4 Op3 -DDDMMMM D=Detune / M=Multiplier
$39 Multiplier & Detune Ch2 Op3 Ch5 Op3 -DDDMMMM D=Detune / M=Multiplier
$3A Multiplier & Detune Ch3 Op3 Ch6 Op3 -DDDMMMM D=Detune / M=Multiplier
$3C Multiplier & Detune Ch1 Op4 Ch4 Op4 -DDDMMMM D=Detune / M=Multiplier
$3D Multiplier & Detune Ch2 Op4 Ch5 Op4 -DDDMMMM D=Detune / M=Multiplier
$3E Multiplier & Detune Ch3 Op4 Ch6 Op4 -DDDMMMM D=Detune / M=Multiplier
$40 Total Level Ch1 Op1 Ch4 Op1 -TTTTTTT T=Total Level (0=largest)
$41 Total Level Ch2 Op1 Ch5 Op1 -TTTTTTT T=Total Level (0=largest)
$42 Total Level Ch3 Op1 Ch6 Op1 -TTTTTTT T=Total Level (0=largest)
$44 Total Level Ch1 Op2 Ch4 Op2 -TTTTTTT T=Total Level (0=largest)
$45 Total Level Ch2 Op2 Ch5 Op2 -TTTTTTT T=Total Level (0=largest)
$46 Total Level Ch3 Op2 Ch6 Op2 -TTTTTTT T=Total Level (0=largest)
$48 Total Level Ch1 Op3 Ch4 Op3 -TTTTTTT T=Total Level (0=largest)
$49 Total Level Ch2 Op3 Ch5 Op3 -TTTTTTT T=Total Level (0=largest)
$4A Total Level Ch3 Op3 Ch6 Op3 -TTTTTTT T=Total Level (0=largest)
$4C Total Level Ch1 Op4 Ch4 Op4 -TTTTTTT T=Total Level (0=largest)
$4D Total Level Ch2 Op4 Ch5 Op4 -TTTTTTT T=Total Level (0=largest)
$4E Total Level Ch3 Op4 Ch6 Op4 -TTTTTTT T=Total Level (0=largest)
$50 Attack Rate & Rate Key Scaling Ch1 Op1 Ch4 Op1 RR-AAAAA R=Rate Scaling / A = Attack rate
$51 Attack Rate & Rate Key Scaling Ch2 Op1 Ch5 Op1 RR-AAAAA R=Rate Scaling / A = Attack rate
$52 Attack Rate & Rate Key Scaling Ch3 Op1 Ch6 Op1 RR-AAAAA R=Rate Scaling / A = Attack rate
$54 Attack Rate & Rate Key Scaling Ch1 Op2 Ch4 Op2 RR-AAAAA R=Rate Scaling / A = Attack rate
$55 Attack Rate & Rate Key Scaling Ch2 Op2 Ch5 Op2 RR-AAAAA R=Rate Scaling / A = Attack rate
$56 Attack Rate & Rate Key Scaling Ch3 Op2 Ch6 Op2 RR-AAAAA R=Rate Scaling / A = Attack rate
$58 Attack Rate & Rate Key Scaling Ch1 Op3 Ch4 Op3 RR-AAAAA R=Rate Scaling / A = Attack rate
$59 Attack Rate & Rate Key Scaling Ch2 Op3 Ch5 Op3 RR-AAAAA R=Rate Scaling / A = Attack rate
$5A Attack Rate & Rate Key Scaling Ch3 Op3 Ch6 Op3 RR-AAAAA R=Rate Scaling / A = Attack rate
$5C Attack Rate & Rate Key Scaling Ch1 Op4 Ch4 Op4 RR-AAAAA R=Rate Scaling / A = Attack rate
$5D Attack Rate & Rate Key Scaling Ch2 Op4 Ch5 Op4 RR-AAAAA R=Rate Scaling / A = Attack rate
$5E Attack Rate & Rate Key Scaling Ch3 Op4 Ch6 Op4 RR-AAAAA R=Rate Scaling / A = Attack rate
$60 Decay Rate & AM Enable Ch1 Op1 Ch4 Op1 A--DDDDD A=Amplitude Mod Enable / D= Decay rate
$61 Decay Rate & AM Enable Ch2 Op1 Ch5 Op1 A--DDDDD A=Amplitude Mod Enable / D= Decay rate
$62 Decay Rate & AM Enable Ch3 Op1 Ch6 Op1 A--DDDDD A=Amplitude Mod Enable / D= Decay rate
$64 Decay Rate & AM Enable Ch1 Op2 Ch4 Op2 A--DDDDD A=Amplitude Mod Enable / D= Decay rate
$65 Decay Rate & AM Enable Ch2 Op2 Ch5 Op2 A--DDDDD A=Amplitude Mod Enable / D= Decay rate
$66 Decay Rate & AM Enable Ch3 Op2 Ch6 Op2 A--DDDDD A=Amplitude Mod Enable / D= Decay rate
$68 Decay Rate & AM Enable Ch1 Op3 Ch4 Op3 A--DDDDD A=Amplitude Mod Enable / D= Decay rate
$69 Decay Rate & AM Enable Ch2 Op3 Ch5 Op3 A--DDDDD A=Amplitude Mod Enable / D= Decay rate
$6A Decay Rate & AM Enable Ch3 Op3 Ch6 Op3 A--DDDDD A=Amplitude Mod Enable / D= Decay rate
$6C Decay Rate & AM Enable Ch1 Op4 Ch4 Op4 A--DDDDD A=Amplitude Mod Enable / D= Decay rate
$6D Decay Rate & AM Enable Ch2 Op4 Ch5 Op4 A--DDDDD A=Amplitude Mod Enable / D= Decay rate
$6E Decay Rate & AM Enable Ch3 Op4 Ch6 Op4 A--DDDDD A=Amplitude Mod Enable / D= Decay rate
$70 Sustain Rate Ch1 Op1 Ch4 Op1 ---SSSSS S=Sustain Rate
$71 Sustain Rate Ch2 Op1 Ch5 Op1 ---SSSSS S=Sustain Rate
$72 Sustain Rate Ch3 Op1 Ch6 Op1 ---SSSSS S=Sustain Rate
$74 Sustain Rate Ch1 Op2 Ch4 Op2 ---SSSSS S=Sustain Rate
$75 Sustain Rate Ch2 Op2 Ch5 Op2 ---SSSSS S=Sustain Rate
$76 Sustain Rate Ch3 Op2 Ch6 Op2 ---SSSSS S=Sustain Rate
$78 Sustain Rate Ch1 Op3 Ch4 Op3 ---SSSSS S=Sustain Rate
$79 Sustain Rate Ch2 Op3 Ch5 Op3 ---SSSSS S=Sustain Rate
$7A Sustain Rate Ch3 Op3 Ch6 Op3 ---SSSSS S=Sustain Rate
$7C Sustain Rate Ch1 Op4 Ch4 Op4 ---SSSSS S=Sustain Rate
$7D Sustain Rate Ch2 Op4 Ch5 Op4 ---SSSSS S=Sustain Rate
$7E Sustain Rate Ch3 Op4 Ch6 Op4 ---SSSSS S=Sustain Rate
$80 Release Rate & Sustain Level Ch1 Op1 Ch4 Op1 SSSSRRRR S=Sustain Level / Release Rate
$81 Release Rate & Sustain Level Ch2 Op1 Ch5 Op1 SSSSRRRR S=Sustain Level / Release Rate
$82 Release Rate & Sustain Level Ch3 Op1 Ch6 Op1 SSSSRRRR S=Sustain Level / Release Rate
$84 Release Rate & Sustain Level Ch1 Op2 Ch4 Op2 SSSSRRRR S=Sustain Level / Release Rate
$85 Release Rate & Sustain Level Ch2 Op2 Ch5 Op2 SSSSRRRR S=Sustain Level / Release Rate
$86 Release Rate & Sustain Level Ch3 Op2 Ch6 Op2 SSSSRRRR S=Sustain Level / Release Rate
$88 Release Rate & Sustain Level Ch1 Op3 Ch4 Op3 SSSSRRRR S=Sustain Level / Release Rate
$89 Release Rate & Sustain Level Ch2 Op3 Ch5 Op3 SSSSRRRR S=Sustain Level / Release Rate
$8A Release Rate & Sustain Level Ch3 Op3 Ch6 Op3 SSSSRRRR S=Sustain Level / Release Rate
$8C Release Rate & Sustain Level Ch1 Op4 Ch4 Op4 SSSSRRRR S=Sustain Level / Release Rate
$8D Release Rate & Sustain Level Ch2 Op4 Ch5 Op4 SSSSRRRR S=Sustain Level / Release Rate
$8E Release Rate & Sustain Level Ch3 Op4 Ch6 Op4 SSSSRRRR S=Sustain Level / Release Rate
$90 SSG-Envelope Generator Ch1 Op1 Ch4 Op1 ----EEEE E=Envelope Gen
$91 SSG-Envelope Generator Ch2 Op1 Ch5 Op1 ----EEEE E=Envelope Gen
$92 SSG-Envelope Generator Ch3 Op1 Ch6 Op1 ----EEEE E=Envelope Gen
$94 SSG-Envelope Generator Ch1 Op2 Ch4 Op2 ----EEEE E=Envelope Gen
$95 SSG-Envelope Generator Ch2 Op2 Ch5 Op2 ----EEEE E=Envelope Gen
$96 SSG-Envelope Generator Ch3 Op2 Ch6 Op2 ----EEEE E=Envelope Gen
$98 SSG-Envelope Generator Ch1 Op3 Ch4 Op3 ----EEEE E=Envelope Gen
$99 SSG-Envelope Generator Ch2 Op3 Ch5 Op3 ----EEEE E=Envelope Gen
$9A SSG-Envelope Generator Ch3 Op3 Ch6 Op3 ----EEEE E=Envelope Gen
$9C SSG-Envelope Generator Ch1 Op4 Ch4 Op4 ----EEEE E=Envelope Gen
$9D SSG-Envelope Generator Ch2 Op4 Ch5 Op4 ----EEEE E=Envelope Gen
$9E SSG-Envelope Generator Ch3 Op4 Ch6 Op4 ----EEEE E=Envelope Gen
$A0 Frequency low (Write Second) Ch1 Ch4 PPPPPPPP P=Frequency Position L
$A1 Frequency low (Write Second) Ch2 Ch5 PPPPPPPP P=Frequency Position L
$A2 Frequency low (Write Second) Ch3 Ch6 PPPPPPPP P=Frequency Position L
$A4 Frequency high & Octave (Write first) Ch1 Ch4 --OOOPPP O=Octive / P=Position H
$A5 Frequency high & Octave (Write first) Ch2 Ch5 --OOOPPP O=Octive / P=Position H
$A6 Frequency high & Octave (Write first) Ch3 Ch6 --OOOPPP O=Octive / P=Position H
$A8 Frequency low during Multi-Mode Ch3 Op2 - PPPPPPPP P=Frequency Position L
$A9 Frequency low during Multi-Mode Ch3 Op3 - PPPPPPPP P=Frequency Position L
$AA Frequency low during Multi-Mode Ch3 Op4 - PPPPPPPP P=Frequency Position L
$AC Frequency high & Octave during Multi-Mode Ch3 Op2 - --OOOPPP O=Octive / P=Position H
$AD Frequency high & Octave during Multi-Mode Ch3 Op3 - --OOOPPP O=Octive / P=Position H
$AE Frequency high & Octave during Multi-Mode Ch3 Op4 - --OOOPPP O=Octive / P=Position H
$B0 Algorithm & Feedback Ch1 Ch4 --FFFAAA F=Feedback / A=Algorithm
$B1 Algorithm & Feedback Ch2 Ch5 --FFFAAA F=Feedback / A=Algorithm
$B2 Algorithm & Feedback Ch3 Ch6 --FFFAAA F=Feedback / A=Algorithm
$B4 FMS & AMS & Stereo Ch1 Ch4 LRAA-FFF Left / Right (1=on) / A=Amplitude Mod Sensitivity / F=Frequency Mod Sensitivity
$B5 FMS & AMS & Stereo Ch2 Ch5 LRAA-FFF Left / Right (1=on) / A=Amplitude Mod Sensitivity / F=Frequency Mod Sensitivity
$B6 FMS & AMS & Stereo Ch3 Ch6 LRAA-FFF Left / Right (1=on) / A=Amplitude Mod Sensitivity / F=Frequency Mod Sensitivity


 

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

Top Menu
***Main Menu***
Youtube channel
ASM Programming Forums
GitHub
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
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
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 (Quantum Leap)
X68000 (Sharp x68k)

8086 Content
Learn 8086 Assembly
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
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

My Game projects
Chibi Aliens
Chibi Akumas

Work in Progress
Learn 6809 Assembly
Learn 65816 Assembly
Learn 6809 Assembly
Learn TMS9900 Assembly
Dragon 32/Tandy Coco
Fujitsu FM7
Ti 99

Misc bits
Ruby programming








































































Buy Chibi Akuma(s) from PolyPlay
Buy ChibiAkuma(s) games now!


























































































































































































































Buy Chibi Akuma(s) from PolyPlay
Buy ChibiAkuma(s) games now!


























































































































































































































Buy Chibi Akuma(s) from PolyPlay
Buy ChibiAkuma(s) games now!