home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Der Mediaplex Sampler - Die 6 von Plex
/
6_v_plex.zip
/
6_v_plex
/
DISK3
/
DFUE_100
/
FAMISRC.ZIP
/
PCX2SOPT.ZIP
/
TEST.SRC
< prev
Wrap
Text File
|
1993-11-18
|
6KB
|
188 lines
; assemble at $8000
org $8000
; program start
start
sei ; disable interrupts
phk ; push current bank on stack
plb ; pop it off the stack and make it the current programming bank
clc
xce ; native 16-bit mode
; initialise SNES
sep #$30 ; make X, Y, A all 8-bits
lda #$80 ; screen off, no brightness
sta $2100 ; brightness & screen enable register
lda #$00
sta $2101 ; sprite register (size & address in VRAM)
sta $2102 ; sprite registers (address of sprite memory [OAM])
sta $2103 ; sprite registers (address of sprite memory [OAM])
sta $2105 ; graphic mode register
sta $2106 ; mosaic register
sta $2107 ; plane 0 map VRAM location
sta $2108 ; plane 1 map VRAM location
sta $2109 ; plane 2 map VRAM location
sta $210A ; plane 3 map VRAM location
sta $210B ; plane 0 & 1 Tile data location
sta $210C ; plane 2 & 3 Tile data location
sta $210D ; plane 0 scroll x (first 8 bits)
sta $210D ; plane 0 scroll x (last 3 bits)
sta $210E ; plane 0 scroll y (first 8 bits)
sta $210E ; plane 0 scroll y (last 3 bits)
sta $210F ; plane 1 scroll x (first 8 bits)
sta $210F ; plane 1 scroll x (last 3 bits)
sta $2110 ; plane 1 scroll y (first 8 bits)
sta $2110 ; plane 1 scroll y (last 3 bits)
sta $2111 ; plane 2 scroll x (first 8 bits)
sta $2111 ; plane 2 scroll x (last 3 bits)
sta $2112 ; plane 2 scroll y (first 8 bits)
sta $2112 ; plane 2 scroll y (last 3 bits)
sta $2113 ; plane 3 scroll x (first 8 bits)
sta $2113 ; plane 3 scroll x (last 3 bits)
sta $2114 ; plane 3 scroll y (first 8 bits)
sta $2114 ; plane 3 scroll y (last 3 bits)
lda #$80 ; increase VRAM address after writing to $2119
sta $2115 ; VRAM address increment register
lda #$00
sta $2116 ; VRAM address low
sta $2117 ; VRAM address high
sta $211A ; initial mode 7 setting register
sta $211B ; mode 7 matrix parameter A register (low)
lda #$01
sta $211B ; mode 7 matrix parameter A register (high)
lda #$00
sta $211C ; mode 7 matrix parameter B register (low)
sta $211C ; mode 7 matrix parameter B register (high)
sta $211D ; mode 7 matrix parameter C register (low)
sta $211D ; mode 7 matrix parameter C register (high)
sta $211E ; mode 7 matrix parameter D register (low)
lda #$01
sta $211E ; mode 7 matrix parameter D register (high)
lda #$00
sta $211F ; mode 7 center position X register (low)
sta $211F ; mode 7 center position X register (high)
sta $2120 ; mode 7 center position Y register (low)
sta $2120 ; mode 7 center position Y register (high)
sta $2121 ; color number register ($00-$ff)
sta $2123 ; bg1 & bg2 window mask setting register
sta $2124 ; bg3 & bg4 window mask setting register
sta $2125 ; obj & color window mask setting register
sta $2126 ; window 1 left position register
sta $2127 ; window 2 left position register
sta $2128 ; window 3 left position register
sta $2129 ; window 4 left position register
sta $212A ; bg1, bg2, bg3, bg4 window logic register
sta $212B ; obj, color window logic register (or, and, xor, xnor)
lda #$01
sta $212C ; main screen designation (planes, sprites enable)
lda #$00
sta $212D ; sub screen designation
sta $212E ; window mask for main screen
sta $212F ; window mask for sub screen
lda #$30
sta $2130 ; color addition & screen addition init setting
lda #$00
sta $2131 ; add/sub sub designation for screen, sprite, color
lda #$E0
sta $2132 ; color data for addition/subtraction
lda #$00
sta $2133 ; screen setting (interlace x,y/enable SFX data)
sta $4200 ; enable v-blank, interrupt, joypad register
lda #$FF
sta $4201 ; programmable I/O port
lda #$00
sta $4202 ; multiplicand A
sta $4203 ; multiplier B
sta $4204 ; multiplier C
sta $4205 ; multiplicand C
sta $4206 ; divisor B
sta $4207 ; horizontal count timer
sta $4208 ; horizontal count timer MSB
sta $4209 ; vertical count timer
sta $420A ; vertical count timer MSB
sta $420B ; general DMA enable (bits 0-7)
sta $420C ; horizontal DMA (HDMA) enable (bits 0-7)
sta $420D ; access cycle designation (slow/fast rom)
; set register modes
rep #$10 ; make X & Y 16-bits
sep #$20 ; make A 8-bits
; initialise graphics hardware
lda #$01 ; graphics mode 1
sta $2105
lda #$01 ; enable plane 0
sta $212c
lda #$00 ; set plane 0 memory to $0000, 32x32 chars
sta $2107
lda #$01 ; set plane 0 character set to $1000
sta $210b
; copy screen map data
ldx.w #$0000 ; set VRAM pointer to plane 0 memory location
stx $2116
ldx.w #$1801 ; dma to $2118
stx $4300
ldx.w #mapData&$FFFF ; source offset
stx $4302
lda #mapData/$10000 ; source bank
sta $4304
ldx.w #2048 ; number of bytes
stx $4305
lda #$01 ; do dma
sta $420B
; set colour registers
lda #$00 ; select colour register 0
sta $2121
ldx.w #$2200 ; dma to $2122
stx $4300
ldx.w #colData&$FFFF ; source offset
stx $4302
lda #colData/$10000 ; source bank
sta $4304
ldx.w #32 ; number of bytes
stx $4305
lda #$01 ; do dma
sta $420B
; set tile data
ldx.w #$1000 ; set VRAM pointer to character set location
stx $2116
ldx.w #$1801 ; dma to $2118
stx $4300
ldx.w #tileData&$FFFF ; source offset
stx $4302
lda #tileData/$10000 ; source bank
sta $4304
ldx.w #14656 ; number of bytes
stx $4305
lda #$01 ; do dma
sta $420B
lda #$0F ; enable screen, full brightness
sta $2100
; loop forever while picture displayed
forever
bra forever
; screen map data
mapData
incbin "mypic.map"
; colour register data
colData
incbin "mypic.col"
; run/reset vector
pad $FFFC
dc.w start
pad
; tile set data
tileData
incbin "mypic.set"