Anyways, here's roughly what I was thinking of for the Arbitrary Code, in WLA format:
Code: Select all
sep #$20 ;8 bit A
rep #$10 ;16 bit X / Y
lda.b #$00
pha
plb ;set bank to zero, in case it was in a bank without the hardware registers
stz.w $4200 ;disable all interrupts (and joypad reading)
lda.b #$80
sta.w $2100 ;turn screen off
lda.b #$04
sta.w $212C ;enable BG3, disable all others and sprites
lda.b #$41
sta.w $2105 ;set BG3 tile size to 16x16 and Mode 1
stz.w $2109 ;set BG3 TileMAP VRAM location to $0000 and map size to 32x32
lda.b #$02
sta.w $210C ;set BG3 TileSET VRAM location to $1000 (VRAM addresses are measured in WORDS not bytes)
stz.w $2111
stz.w $2112 ;set BG3 horiz and vertical scrolls to zero
;===== SET UP DMA TO CLEAR BG3 TILEMAP =====
lda.b #$80
sta.w $2115 ;set up VRAM port to accept the DMA properly
ldx.w #$0000
stx.w $2116 ;VRAM write address is $0000 for tilemap
lda.b #$11
sta.w $4300 ;Set DMA Control - should set to read from (I HOPE?) a fixed address.
lda.b #$18
sta.w $4301 ;set destination address to VRAM port - $2118
ldx.w #$???? ;address of a place in ROM that has a $0000
stx.w $4302
lda.b #$?? ;bank of said place in ROM
sta.w $4304
ldx.w #$0800
stx.w $4305 ;Number of bytes to transfer - $800 should cover a 32x32 tilemap
lda.b #$01
sta.w $420B ;initiate DMA to clear BG3 Tilemap.
;======= WRITE TILES TO VRAM MANUALLY ======
;$2115 should still be set up correctly
ldx.w #$1000
stx.w $2116 ;VRAM write address is $1000 for tileSET
ldx.w #$????
stx.w $2118
ldx.w #$????
stx.w $2118 ;write your tiles like so
[...]
ldx.w #$????
stx.w $2118
;====== WRITE TILEMAP TO VRAM MANUALLY =====
;same idea as writing the tile set, just reset $2116 to point to the right part of the tilemap
;======= WRITE SOME PALETTES TO CGRAM ======
lda.b #$01 ;Color zero is background colour, so unless it's bad, start at one.
sta.w #$2121 ;remember, for BG3 (2bpp), a palette is four colours.
;and color zero of each palette is always transparent.
lda.b #$??
sta.w $2122
lda.b #$??
sta.w $2122 ;write color data - format is 0BBBBBGG GGGRRRRR. Write lo byte then hi to same register
lda.b #$??
sta.w $2122
lda.b #$??
sta.w $2122 ;color 2...
lda.b #$??
sta.w $2122
lda.b #$??
sta.w $2122 ;color 3. So that gives you one full palette, do more if you want/have room
;============= DISPLAY RESULTS =============
stz.w $2100 ;turn screen on
STP ;halt processor. Done!Then, all you need to do is come up with some simple tiles for the logo and a colour palette, and it should work.
... I'm really not sure of how the process works now that I think about it. Can you just execute controller input directly? Does "open bus" have to get involved, like I hear was used in the SMW ACE TAS?93143 wrote:I don't suppose you could load a graphics loader and then upload a bunch of tiles through the controller ports...