2015-05-22 18:08:57 +00:00
|
|
|
.INCLUDE "header.asm"
|
2015-05-23 19:42:47 +00:00
|
|
|
.INCLUDE "init.asm"
|
2015-05-22 23:39:43 +00:00
|
|
|
.INCLUDE "registers.asm"
|
2015-05-22 17:34:37 +00:00
|
|
|
|
2015-05-23 18:00:43 +00:00
|
|
|
|
|
|
|
|
2015-05-25 18:28:00 +00:00
|
|
|
; Memory layout:
|
|
|
|
; 0000-000F: scratch space for functions.
|
|
|
|
; 0010-0011: controller state of joypad #1.
|
|
|
|
; 0012-0013: controller state of joypad #2.
|
|
|
|
; 0014-0016: 24-bit counter of vblanks.
|
|
|
|
; 0017-0019: RGB color values to use for background color, from [0-31].
|
|
|
|
; 001A-001B: 16-bit pointer to next random byte.
|
|
|
|
; [gap]
|
|
|
|
; 0020-0021: (x, y) coordinates of player.
|
|
|
|
; 0022: shot cooldown timer.
|
2015-05-31 15:31:18 +00:00
|
|
|
; 0023: next-shot state.
|
2015-05-25 19:35:22 +00:00
|
|
|
; [gap]
|
2015-05-31 02:43:27 +00:00
|
|
|
; 0030-008F: {sprite, x, y, x-velocity, y-velocity, unused} per shot.
|
|
|
|
; If sprite is 0, the shot is disabled.
|
2015-05-30 14:53:31 +00:00
|
|
|
; [gap]
|
2015-05-25 18:28:00 +00:00
|
|
|
; Sprite table buffers -- copied each frame to OAM during VBlank, using DMA.
|
2015-05-31 16:27:30 +00:00
|
|
|
; 1000-11FF: table 1 (4 bytes each: x/y coord, tile #, flip/priority/palette)
|
|
|
|
; 1200-121F: table 2 (2 bits each: high x-coord bit, size)
|
|
|
|
; 1220-12A0: scratch table. One byte per sprite for high x-coord & size.
|
2015-05-25 18:28:00 +00:00
|
|
|
.define joy1 $10
|
|
|
|
.define joy2 $12
|
|
|
|
.define vBlankCounter $14
|
|
|
|
.define backgroundRed $17
|
|
|
|
.define backgroundGreen $18
|
|
|
|
.define backgroundBlue $19
|
|
|
|
.define randomBytePtr $1A
|
2015-05-25 18:32:07 +00:00
|
|
|
.define playerX $20
|
|
|
|
.define playerY $21
|
|
|
|
.define shotCooldown $22
|
2015-05-31 15:31:18 +00:00
|
|
|
.define nextShotState $23
|
2015-05-27 11:51:51 +00:00
|
|
|
.define shotArray $30
|
2015-05-30 14:53:31 +00:00
|
|
|
.define shotArrayLength 16
|
2015-05-31 02:43:27 +00:00
|
|
|
.define shotSize 6
|
2015-05-25 18:28:00 +00:00
|
|
|
|
2015-05-29 12:03:20 +00:00
|
|
|
.define numSprites 128
|
2015-05-31 16:27:30 +00:00
|
|
|
.define spriteTableStart $1000
|
2015-05-25 18:28:00 +00:00
|
|
|
.define spriteTable1Size $200
|
2015-05-31 16:27:30 +00:00
|
|
|
.define spriteTable2Start $1200
|
2015-05-25 18:28:00 +00:00
|
|
|
.define spriteTableSize $220
|
2015-05-31 16:27:30 +00:00
|
|
|
.define spriteTableScratchStart $1220
|
2015-05-25 18:28:00 +00:00
|
|
|
|
2015-05-30 13:03:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
; Sets A to 8-bit (& enables 8-bit "B" register).
|
|
|
|
.MACRO SetA8Bit
|
|
|
|
sep #%00100000 ; 8-bit A/B.
|
|
|
|
.ENDM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; Sets A to 16-bit.
|
|
|
|
.MACRO SetA16Bit
|
|
|
|
rep #%00100000 ; 16-bit A.
|
|
|
|
.ENDM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; Sets X/Y to 16-bit.
|
|
|
|
.MACRO SetXY16Bit
|
|
|
|
rep #%00010000 ; 16-bit X/Y.
|
|
|
|
.ENDM
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-25 12:04:15 +00:00
|
|
|
; Stores result to A.
|
2015-05-25 18:28:00 +00:00
|
|
|
; Assumes 16-bit X & 8-bit A.
|
2015-05-25 12:04:15 +00:00
|
|
|
; Modifies X.
|
2015-05-25 18:28:00 +00:00
|
|
|
; Updates randomBytePtr.
|
2015-05-25 12:04:15 +00:00
|
|
|
.MACRO GetRandomByte
|
2015-05-25 18:28:00 +00:00
|
|
|
ldx randomBytePtr
|
2015-05-25 12:04:15 +00:00
|
|
|
lda $028000, X ; $028000: beginning of ROM bank 2.
|
|
|
|
inx
|
|
|
|
cpx #$8000 ; This is the size of the entire ROM bank.
|
2015-05-31 14:45:29 +00:00
|
|
|
bne +++
|
2015-05-25 12:04:15 +00:00
|
|
|
ldx #0
|
2015-05-31 14:45:29 +00:00
|
|
|
+++
|
2015-05-25 18:28:00 +00:00
|
|
|
stx randomBytePtr
|
2015-05-25 12:04:15 +00:00
|
|
|
.ENDM
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-22 17:34:37 +00:00
|
|
|
.BANK 0 SLOT 0
|
|
|
|
.ORG 0
|
|
|
|
.SECTION "MainCode"
|
|
|
|
|
|
|
|
|
2015-05-22 16:49:40 +00:00
|
|
|
|
|
|
|
Start:
|
2015-05-23 18:00:43 +00:00
|
|
|
InitializeSNES
|
|
|
|
|
2015-05-25 18:28:00 +00:00
|
|
|
; By default we assume 16-bit X/Y and 8-bit A.
|
|
|
|
; If any code wants to change this, it's expected to do so itself,
|
|
|
|
; and to change them back to the defaults before returning.
|
2015-05-30 13:03:55 +00:00
|
|
|
SetXY16Bit
|
|
|
|
SetA8Bit
|
2015-05-25 18:28:00 +00:00
|
|
|
|
2015-05-23 18:00:43 +00:00
|
|
|
jsr LoadPaletteAndTileData
|
2015-05-24 14:43:25 +00:00
|
|
|
jsr InitializeSpriteTables
|
2015-05-25 16:52:38 +00:00
|
|
|
jsr InitializeWorld
|
2015-05-24 14:43:25 +00:00
|
|
|
|
2015-05-24 23:50:10 +00:00
|
|
|
; Set screen mode: 16x16 tiles for backgrounds, mode 1.
|
|
|
|
lda #%11000001
|
2015-05-30 15:04:22 +00:00
|
|
|
sta BGMODE
|
2015-05-24 17:22:42 +00:00
|
|
|
|
2015-05-24 14:43:25 +00:00
|
|
|
; Set sprite size to 16x16 (small) and 32x32 (large).
|
|
|
|
lda #%01100000
|
|
|
|
sta OAMSIZE
|
|
|
|
|
2015-05-24 23:50:10 +00:00
|
|
|
; Main screen: enable sprites & BG3.
|
|
|
|
lda #%00010100
|
2015-05-24 14:43:25 +00:00
|
|
|
sta MSENABLE
|
|
|
|
|
2015-05-27 11:09:44 +00:00
|
|
|
; Turn on the screen.
|
|
|
|
; Format: x000bbbb
|
2015-05-22 16:49:40 +00:00
|
|
|
; x: 0 = screen on, 1 = screen off, bbbb: Brightness ($0-$F)
|
|
|
|
lda #%00001111
|
2015-05-22 23:39:43 +00:00
|
|
|
sta INIDISP
|
2015-05-22 16:49:40 +00:00
|
|
|
|
2015-05-22 17:34:37 +00:00
|
|
|
jmp MainLoop
|
|
|
|
|
2015-05-22 16:49:40 +00:00
|
|
|
|
|
|
|
|
2015-05-23 18:00:43 +00:00
|
|
|
LoadPaletteAndTileData:
|
2015-05-23 19:38:27 +00:00
|
|
|
; For more details on DMA, see:
|
|
|
|
; http://wiki.superfamicom.org/snes/show/Grog%27s+Guide+to+DMA+and+HDMA+on+the+SNES
|
|
|
|
; http://wiki.superfamicom.org/snes/show/Making+a+Small+Game+-+Tic-Tac-Toe
|
|
|
|
;
|
|
|
|
; A lot of the graphics-related registers are explained in Qwertie's doc:
|
|
|
|
; http://emu-docs.org/Super%20NES/General/snesdoc.html
|
|
|
|
; ... but be careful, because there are some errors in this doc.
|
|
|
|
;
|
|
|
|
; bazz's tutorial (available from http://wiki.superfamicom.org/snes/) is
|
|
|
|
; quite helpful with palette / sprites / DMA, especially starting at
|
|
|
|
; http://wiki.superfamicom.org/snes/show/Working+with+VRAM+-+Loading+the+Palette
|
|
|
|
|
2015-05-23 21:17:39 +00:00
|
|
|
; Initialize the palette memory in a loop.
|
2015-05-23 18:00:43 +00:00
|
|
|
; We could also do this with a DMA transfer (like we do with the tile data
|
2015-05-23 21:17:39 +00:00
|
|
|
; below), but it seems overkill for just a few bytes. :)
|
2015-05-24 17:22:42 +00:00
|
|
|
; TODO(mcmillen): do it with a DMA transfer.
|
|
|
|
|
|
|
|
; First, sprite palette data:
|
2015-05-23 21:17:39 +00:00
|
|
|
ldx #0
|
2015-05-24 14:43:25 +00:00
|
|
|
lda #128 ; Palette entries for sprites start at 128.
|
2015-05-23 18:00:43 +00:00
|
|
|
sta CGADDR
|
2015-05-27 11:09:44 +00:00
|
|
|
-
|
2015-05-24 14:43:25 +00:00
|
|
|
lda.l SpritePalette, X
|
2015-05-23 18:00:43 +00:00
|
|
|
sta CGDATA
|
2015-05-23 21:17:39 +00:00
|
|
|
inx
|
2015-05-24 14:43:25 +00:00
|
|
|
cpx #32 ; 32 bytes of palette data.
|
2015-05-23 21:17:39 +00:00
|
|
|
bne -
|
2015-05-23 18:00:43 +00:00
|
|
|
|
2015-05-24 23:50:10 +00:00
|
|
|
; Now, BG3 palette data.
|
|
|
|
; Palette entries for BG3 start at 0.
|
2015-05-24 17:22:42 +00:00
|
|
|
ldx #0
|
2015-05-24 23:50:10 +00:00
|
|
|
lda #0
|
2015-05-24 17:22:42 +00:00
|
|
|
sta CGADDR
|
|
|
|
-
|
|
|
|
lda.l TilePalette, X
|
|
|
|
sta CGDATA
|
|
|
|
inx
|
|
|
|
cpx #8 ; 8 bytes of palette data.
|
|
|
|
bne -
|
|
|
|
|
|
|
|
; TODO(mcmillen): make the "DMA stuff into VRAM" a macro or function.
|
|
|
|
; Set VMADDR to where we want the DMA to start. We'll store sprite data
|
|
|
|
; at the beginning of VRAM.
|
|
|
|
ldx #$0000
|
|
|
|
stx VMADDR
|
2015-05-23 18:00:43 +00:00
|
|
|
; DMA 0 source address & bank.
|
2015-05-24 14:43:25 +00:00
|
|
|
ldx #SpriteData
|
2015-05-23 18:00:43 +00:00
|
|
|
stx DMA0SRC
|
2015-05-24 14:43:25 +00:00
|
|
|
lda #:SpriteData
|
2015-05-23 18:00:43 +00:00
|
|
|
sta DMA0SRCBANK
|
2015-05-25 13:42:54 +00:00
|
|
|
; DMA 0 transfer size. Equal to the size of sprites32.pic.
|
|
|
|
ldx #2048
|
2015-05-24 14:43:25 +00:00
|
|
|
stx DMA0SIZE
|
2015-05-23 18:00:43 +00:00
|
|
|
; DMA 0 control register.
|
|
|
|
; Transfer type 001 = 2 addresses, LH.
|
|
|
|
lda #%00000001
|
|
|
|
sta DMA0CTRL
|
|
|
|
; DMA 0 destination.
|
2015-05-24 17:22:42 +00:00
|
|
|
lda #$18 ; The upper byte is assumed to be $21, so this is $2118 & $2119.
|
2015-05-23 18:00:43 +00:00
|
|
|
sta DMA0DST
|
2015-05-24 17:22:42 +00:00
|
|
|
; Enable DMA channel 0.
|
|
|
|
lda #%00000001
|
|
|
|
sta DMAENABLE
|
|
|
|
|
|
|
|
; Store background tile data at byte $2000 of VRAM.
|
|
|
|
; (VMADDR is a word address, so multiply by 2 to get the byte address.)
|
|
|
|
ldx #$1000
|
2015-05-24 14:43:25 +00:00
|
|
|
stx VMADDR
|
2015-05-24 17:22:42 +00:00
|
|
|
; DMA 0 source address & bank.
|
|
|
|
ldx #TileData
|
|
|
|
stx DMA0SRC
|
|
|
|
lda #:TileData
|
|
|
|
sta DMA0SRCBANK
|
2015-05-25 13:42:54 +00:00
|
|
|
; DMA 0 transfer size. Equal to the size of tiles.pic.
|
|
|
|
ldx #512
|
2015-05-24 17:22:42 +00:00
|
|
|
stx DMA0SIZE
|
|
|
|
; DMA 0 control register.
|
|
|
|
; Transfer type 001 = 2 addresses, LH.
|
|
|
|
lda #%00000001
|
|
|
|
sta DMA0CTRL
|
|
|
|
; DMA 0 destination.
|
|
|
|
lda #$18 ; The upper byte is assumed to be $21, so this is $2118 & $2119.
|
|
|
|
sta DMA0DST
|
2015-05-23 18:00:43 +00:00
|
|
|
; Enable DMA channel 0.
|
|
|
|
lda #%00000001
|
|
|
|
sta DMAENABLE
|
|
|
|
|
2015-05-24 23:50:10 +00:00
|
|
|
; Tell the system that the BG3 tilemap starts at $4000.
|
2015-05-24 18:44:26 +00:00
|
|
|
lda #%00100000
|
2015-05-24 23:50:10 +00:00
|
|
|
sta BG3TILEMAP
|
|
|
|
; ... and that the background tile data for BG3 starts at $2000.
|
|
|
|
lda #%00000001
|
|
|
|
sta BG34NBA
|
2015-05-24 18:44:26 +00:00
|
|
|
|
2015-05-24 23:50:10 +00:00
|
|
|
; Set up the BG3 tilemap.
|
2015-05-24 17:22:42 +00:00
|
|
|
; VRAM write mode: increments the address every time we write a word.
|
2015-05-23 18:00:43 +00:00
|
|
|
lda #%10000000
|
|
|
|
sta VMAIN
|
2015-05-24 17:22:42 +00:00
|
|
|
; Set word address for accessing VRAM.
|
2015-05-24 23:50:10 +00:00
|
|
|
ldx #$2000 ; BG 3 tilemap starts here. (Byte address $4000.)
|
2015-05-23 18:00:43 +00:00
|
|
|
stx VMADDR
|
2015-05-24 17:22:42 +00:00
|
|
|
; Now write entries into the tile map.
|
|
|
|
ldy #0
|
|
|
|
-
|
2015-05-25 12:04:15 +00:00
|
|
|
GetRandomByte
|
|
|
|
sta $00
|
|
|
|
ldx #$0000 ; This is a blank tile.
|
|
|
|
; 1 in 8 chance that we choose a non-blank tile.
|
2015-05-28 11:17:09 +00:00
|
|
|
bit #%00000111
|
2015-05-25 12:04:15 +00:00
|
|
|
bne +
|
2015-05-24 23:50:10 +00:00
|
|
|
ldx #$0002
|
2015-05-28 11:17:09 +00:00
|
|
|
bit #%10000000
|
2015-05-25 12:04:15 +00:00
|
|
|
bne +
|
|
|
|
ldx #$8002 ; Flip vertically.
|
|
|
|
+
|
2015-05-24 18:44:26 +00:00
|
|
|
stx VMDATA
|
|
|
|
iny
|
|
|
|
; The tile map is 32x32 (1024 entries).
|
2015-05-25 12:04:15 +00:00
|
|
|
cpy #1024
|
2015-05-24 17:22:42 +00:00
|
|
|
bne -
|
2015-05-23 18:00:43 +00:00
|
|
|
|
2015-05-24 14:43:25 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
InitializeSpriteTables:
|
|
|
|
; This page is a good reference on SNES sprite formats:
|
|
|
|
; http://wiki.superfamicom.org/snes/show/SNES+Sprites
|
|
|
|
; It uses the same approach we're using, in which we keep a buffer of the
|
|
|
|
; sprite tables in RAM, and DMA the sprite tables to the system's OAM
|
|
|
|
; during VBlank.
|
2015-05-30 13:03:55 +00:00
|
|
|
SetA16Bit
|
2015-05-24 14:43:25 +00:00
|
|
|
|
|
|
|
ldx #$0000
|
|
|
|
; Fill sprite table 1. 4 bytes per sprite, laid out as follows:
|
|
|
|
; Byte 1: xxxxxxxx x: X coordinate
|
|
|
|
; Byte 2: yyyyyyyy y: Y coordinate
|
|
|
|
; Byte 3: cccccccc c: Starting tile #
|
|
|
|
; Byte 4: vhoopppc v: vertical flip h: horizontal flip o: priority bits
|
|
|
|
; p: palette #
|
|
|
|
lda #$01
|
|
|
|
-
|
2015-05-25 18:28:00 +00:00
|
|
|
sta spriteTableStart, X
|
2015-05-25 19:35:22 +00:00
|
|
|
.rept 4
|
|
|
|
inx
|
|
|
|
.endr
|
2015-05-25 18:28:00 +00:00
|
|
|
cpx #spriteTable1Size
|
2015-05-24 14:43:25 +00:00
|
|
|
bne -
|
|
|
|
|
|
|
|
; Fill sprite table 2. 2 bits per sprite, like so:
|
2015-05-24 17:22:42 +00:00
|
|
|
; bits 0,2,4,6 - High bit of the sprite's x-coordinate.
|
2015-05-24 14:43:25 +00:00
|
|
|
; bits 1,3,5,7 - Toggle Sprite size: 0 - small size 1 - large size
|
2015-05-24 17:22:42 +00:00
|
|
|
; Setting all the high bits keeps the sprites offscreen.
|
2015-05-29 12:03:20 +00:00
|
|
|
lda #$FFFF
|
2015-05-24 14:43:25 +00:00
|
|
|
-
|
2015-05-25 18:28:00 +00:00
|
|
|
sta spriteTableStart, X
|
2015-05-24 14:43:25 +00:00
|
|
|
inx
|
|
|
|
inx
|
2015-05-25 18:28:00 +00:00
|
|
|
cpx #spriteTableSize
|
2015-05-24 14:43:25 +00:00
|
|
|
bne -
|
2015-05-23 18:00:43 +00:00
|
|
|
|
2015-05-30 13:03:55 +00:00
|
|
|
SetA8Bit
|
2015-05-23 18:00:43 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-25 16:52:38 +00:00
|
|
|
InitializeWorld:
|
|
|
|
; Start the background color as a dark blue.
|
|
|
|
lda #4
|
2015-05-27 10:56:42 +00:00
|
|
|
sta backgroundBlue
|
2015-05-22 16:49:40 +00:00
|
|
|
|
2015-05-25 16:52:38 +00:00
|
|
|
; Player's initial starting location.
|
|
|
|
lda #(256 / 4)
|
2015-05-25 18:28:00 +00:00
|
|
|
sta playerX
|
2015-05-25 16:52:38 +00:00
|
|
|
lda #((224 - 32) / 2)
|
2015-05-25 18:28:00 +00:00
|
|
|
sta playerY
|
2015-05-25 19:35:22 +00:00
|
|
|
|
2015-05-25 16:52:38 +00:00
|
|
|
rts
|
2015-05-22 16:49:40 +00:00
|
|
|
|
2015-05-22 17:34:37 +00:00
|
|
|
|
2015-05-25 16:52:38 +00:00
|
|
|
|
|
|
|
MainLoop:
|
2015-05-30 13:03:55 +00:00
|
|
|
lda #%10000001 ; Enable NMI interrupt & auto joypad read.
|
|
|
|
sta NMITIMEN
|
2015-05-25 16:52:38 +00:00
|
|
|
wai ; Wait for interrupt.
|
2015-05-30 13:03:55 +00:00
|
|
|
lda #%00000001 ; Disable NMI interrupt while processing.
|
|
|
|
sta NMITIMEN
|
|
|
|
|
2015-05-30 13:28:07 +00:00
|
|
|
jsr JoypadRead
|
2015-05-25 16:52:38 +00:00
|
|
|
jsr JoypadHandler
|
|
|
|
jsr UpdateWorld
|
2015-05-31 02:43:27 +00:00
|
|
|
jsr UpdateSprites
|
2015-05-29 12:03:20 +00:00
|
|
|
jsr FillSecondarySpriteTable
|
2015-05-25 16:52:38 +00:00
|
|
|
jsr SetBackgroundColor
|
|
|
|
jmp MainLoop
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-30 13:28:07 +00:00
|
|
|
JoypadRead:
|
|
|
|
; Load joypad registers into RAM for easy inspection & manipulation.
|
|
|
|
-
|
|
|
|
lda HVBJOY
|
|
|
|
bit #$01 ; If auto-joypad read is happening, loop.
|
|
|
|
bne -
|
2015-05-25 18:28:00 +00:00
|
|
|
ldx JOY1L
|
|
|
|
stx joy1
|
|
|
|
ldx JOY2L
|
|
|
|
stx joy2
|
2015-05-22 16:49:40 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
|
2015-05-22 17:34:37 +00:00
|
|
|
|
2015-05-22 16:49:40 +00:00
|
|
|
JoypadHandler:
|
|
|
|
JoypadUp:
|
2015-05-30 13:03:55 +00:00
|
|
|
lda joy1 + 1
|
2015-05-28 11:17:09 +00:00
|
|
|
bit #$08 ; Up
|
|
|
|
beq JoypadDown ; Button not pressed.
|
2015-05-25 18:28:00 +00:00
|
|
|
lda playerY
|
2015-05-23 18:00:43 +00:00
|
|
|
cmp #0
|
2015-05-22 16:49:40 +00:00
|
|
|
beq JoypadDown ; Value saturated.
|
2015-05-25 18:28:00 +00:00
|
|
|
dec playerY
|
|
|
|
dec playerY
|
2015-05-22 16:49:40 +00:00
|
|
|
|
|
|
|
JoypadDown:
|
2015-05-30 13:03:55 +00:00
|
|
|
lda joy1 + 1
|
2015-05-28 11:17:09 +00:00
|
|
|
bit #$04 ; Down
|
|
|
|
beq JoypadLeft ; Button not pressed.
|
2015-05-25 18:28:00 +00:00
|
|
|
lda playerY
|
2015-05-25 13:42:54 +00:00
|
|
|
cmp #(224 - 32)
|
2015-05-22 16:49:40 +00:00
|
|
|
beq JoypadLeft ; Value saturated.
|
2015-05-25 18:28:00 +00:00
|
|
|
inc playerY
|
|
|
|
inc playerY
|
2015-05-22 16:49:40 +00:00
|
|
|
|
|
|
|
JoypadLeft:
|
2015-05-30 13:03:55 +00:00
|
|
|
lda joy1 + 1
|
2015-05-28 11:17:09 +00:00
|
|
|
bit #$02 ; Left
|
|
|
|
beq JoypadRight ; Button not pressed.
|
2015-05-25 18:28:00 +00:00
|
|
|
lda playerX
|
2015-05-22 16:49:40 +00:00
|
|
|
cmp #0
|
|
|
|
beq JoypadRight ; Value saturated.
|
2015-05-25 18:28:00 +00:00
|
|
|
dec playerX
|
|
|
|
dec playerX
|
2015-05-22 16:49:40 +00:00
|
|
|
|
|
|
|
JoypadRight:
|
2015-05-30 13:03:55 +00:00
|
|
|
lda joy1 + 1
|
2015-05-28 11:17:09 +00:00
|
|
|
bit #$01 ; Right
|
|
|
|
beq JoypadStart ; Button not pressed.
|
2015-05-25 18:28:00 +00:00
|
|
|
lda playerX
|
2015-05-25 13:42:54 +00:00
|
|
|
cmp #(256 - 32)
|
2015-05-25 16:07:08 +00:00
|
|
|
beq JoypadStart ; Value saturated.
|
2015-05-25 18:28:00 +00:00
|
|
|
inc playerX
|
|
|
|
inc playerX
|
2015-05-22 16:49:40 +00:00
|
|
|
|
2015-05-25 16:07:08 +00:00
|
|
|
JoypadStart:
|
2015-05-30 13:03:55 +00:00
|
|
|
lda joy1 + 1
|
2015-05-28 11:17:09 +00:00
|
|
|
bit #$10 ; Start
|
|
|
|
beq JoypadSelect ; Button not pressed.
|
2015-05-25 18:28:00 +00:00
|
|
|
lda backgroundRed
|
2015-05-28 11:17:09 +00:00
|
|
|
cmp #31
|
2015-05-25 16:07:08 +00:00
|
|
|
beq JoypadSelect ; Value saturated.
|
2015-05-28 11:17:09 +00:00
|
|
|
inc backgroundRed
|
2015-05-23 18:00:43 +00:00
|
|
|
|
2015-05-25 16:07:08 +00:00
|
|
|
JoypadSelect:
|
2015-05-30 13:03:55 +00:00
|
|
|
lda joy1 + 1
|
2015-05-28 11:17:09 +00:00
|
|
|
bit #$20 ; Select
|
|
|
|
beq JoypadY ; Button not pressed.
|
2015-05-25 18:28:00 +00:00
|
|
|
lda backgroundRed
|
2015-05-28 11:17:09 +00:00
|
|
|
cmp #0
|
2015-05-22 16:49:40 +00:00
|
|
|
beq JoypadY ; Value saturated.
|
2015-05-28 11:17:09 +00:00
|
|
|
dec backgroundRed
|
2015-05-22 16:49:40 +00:00
|
|
|
|
|
|
|
JoypadY:
|
2015-05-30 13:03:55 +00:00
|
|
|
lda joy1 + 1
|
2015-05-28 11:17:09 +00:00
|
|
|
bit #$40 ; Y
|
|
|
|
beq JoypadX ; Button not pressed.
|
2015-05-25 18:28:00 +00:00
|
|
|
lda backgroundGreen
|
2015-05-23 18:00:43 +00:00
|
|
|
cmp #0
|
|
|
|
beq JoypadX ; Value saturated.
|
2015-05-25 18:28:00 +00:00
|
|
|
dec backgroundGreen
|
2015-05-23 18:00:43 +00:00
|
|
|
|
|
|
|
JoypadX:
|
2015-05-30 13:03:55 +00:00
|
|
|
lda joy1
|
2015-05-28 11:17:09 +00:00
|
|
|
bit #$40 ; X
|
|
|
|
beq JoypadL ; Button not pressed.
|
2015-05-25 18:28:00 +00:00
|
|
|
lda backgroundGreen
|
2015-05-23 18:00:43 +00:00
|
|
|
cmp #31
|
|
|
|
beq JoypadL ; Value saturated.
|
2015-05-25 18:28:00 +00:00
|
|
|
inc backgroundGreen
|
2015-05-23 18:00:43 +00:00
|
|
|
|
|
|
|
JoypadL:
|
2015-05-30 13:03:55 +00:00
|
|
|
lda joy1
|
2015-05-28 11:17:09 +00:00
|
|
|
bit #$20 ; L
|
|
|
|
beq JoypadR ; Button not pressed.
|
2015-05-25 18:28:00 +00:00
|
|
|
lda backgroundBlue
|
2015-05-22 16:49:40 +00:00
|
|
|
cmp #0
|
2015-05-23 18:00:43 +00:00
|
|
|
beq JoypadR ; Value saturated.
|
2015-05-25 18:28:00 +00:00
|
|
|
dec backgroundBlue
|
2015-05-23 18:00:43 +00:00
|
|
|
|
|
|
|
JoypadR:
|
2015-05-30 13:03:55 +00:00
|
|
|
lda joy1
|
2015-05-28 11:17:09 +00:00
|
|
|
bit #$10 ; R
|
|
|
|
beq JoypadB ; Button not pressed.
|
2015-05-25 18:28:00 +00:00
|
|
|
lda backgroundBlue
|
2015-05-23 18:00:43 +00:00
|
|
|
cmp #31
|
2015-05-25 16:07:08 +00:00
|
|
|
beq JoypadB ; Value saturated.
|
2015-05-25 18:28:00 +00:00
|
|
|
inc backgroundBlue
|
2015-05-23 18:00:43 +00:00
|
|
|
|
2015-05-25 16:07:08 +00:00
|
|
|
JoypadB:
|
2015-05-30 13:03:55 +00:00
|
|
|
lda joy1 + 1
|
2015-05-28 11:17:09 +00:00
|
|
|
bit #$80 ; B
|
|
|
|
beq JoypadDone
|
2015-05-25 16:07:08 +00:00
|
|
|
jsr MaybeShoot
|
2015-05-22 16:49:40 +00:00
|
|
|
|
|
|
|
JoypadDone:
|
2015-05-25 16:07:08 +00:00
|
|
|
rts
|
2015-05-22 16:49:40 +00:00
|
|
|
|
|
|
|
|
2015-05-22 17:34:37 +00:00
|
|
|
|
2015-05-25 16:07:08 +00:00
|
|
|
MaybeShoot:
|
|
|
|
; If the cooldown timer is non-zero, don't shoot.
|
2015-05-25 18:28:00 +00:00
|
|
|
lda shotCooldown
|
2015-05-25 16:07:08 +00:00
|
|
|
cmp #0
|
2015-05-31 15:05:04 +00:00
|
|
|
bne MaybeShootDone
|
2015-05-31 15:31:18 +00:00
|
|
|
; Find the first empty spot in the shots array.
|
|
|
|
ldx #shotArray
|
|
|
|
-
|
|
|
|
lda 0, X
|
|
|
|
cmp #0
|
|
|
|
beq +
|
|
|
|
.rept shotSize
|
|
|
|
inx
|
|
|
|
.endr
|
|
|
|
; If we went all the way to the end, bail out.
|
|
|
|
cpx #(shotArray + shotArrayLength * shotSize)
|
|
|
|
beq MaybeShootDone
|
|
|
|
jmp -
|
|
|
|
+
|
2015-05-25 16:07:08 +00:00
|
|
|
; Enable shot; set its position to player position.
|
2015-05-31 02:43:27 +00:00
|
|
|
; TODO(mcmillen): it might be easier/faster to keep N arrays: one for each
|
|
|
|
; field of shot (shotSpriteArray, shotXArray, shotYArray, ...)
|
|
|
|
lda #8 ; Sprite number.
|
2015-05-25 19:35:22 +00:00
|
|
|
sta 0, X
|
2015-05-25 18:28:00 +00:00
|
|
|
lda playerX
|
2015-05-25 19:35:22 +00:00
|
|
|
sta 1, X
|
2015-05-25 18:28:00 +00:00
|
|
|
lda playerY
|
2015-05-25 19:35:22 +00:00
|
|
|
sta 2, X
|
2015-05-31 15:36:14 +00:00
|
|
|
lda #6 ; x-velocity.
|
2015-05-30 14:53:31 +00:00
|
|
|
sta 3, X
|
2015-05-31 15:05:04 +00:00
|
|
|
lda nextShotState
|
|
|
|
cmp #1
|
|
|
|
beq +
|
2015-05-31 15:36:14 +00:00
|
|
|
lda #3
|
2015-05-31 15:05:04 +00:00
|
|
|
sta 4, X
|
|
|
|
inc nextShotState
|
|
|
|
jmp ++
|
|
|
|
+
|
2015-05-31 15:36:14 +00:00
|
|
|
lda #-3
|
2015-05-31 02:43:27 +00:00
|
|
|
sta 4, X
|
2015-05-31 15:05:04 +00:00
|
|
|
dec nextShotState
|
|
|
|
++
|
2015-05-25 19:35:22 +00:00
|
|
|
|
2015-05-25 16:07:08 +00:00
|
|
|
; Set cooldown timer.
|
2015-05-30 15:08:26 +00:00
|
|
|
lda #10
|
2015-05-25 18:28:00 +00:00
|
|
|
sta shotCooldown
|
2015-05-31 15:05:04 +00:00
|
|
|
MaybeShootDone:
|
2015-05-25 16:07:08 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-25 16:52:38 +00:00
|
|
|
UpdateWorld:
|
2015-05-25 16:07:08 +00:00
|
|
|
; Update shot cooldown.
|
2015-05-25 18:28:00 +00:00
|
|
|
lda shotCooldown
|
2015-05-25 16:07:08 +00:00
|
|
|
cmp #0
|
|
|
|
beq +
|
2015-05-31 02:43:27 +00:00
|
|
|
dec A
|
2015-05-25 18:28:00 +00:00
|
|
|
sta shotCooldown
|
2015-05-25 16:07:08 +00:00
|
|
|
+
|
|
|
|
|
2015-05-31 02:43:27 +00:00
|
|
|
ldx #0
|
|
|
|
; Update shot position.
|
2015-05-25 19:35:22 +00:00
|
|
|
UpdateShot:
|
2015-05-27 11:51:51 +00:00
|
|
|
lda shotArray, X
|
2015-05-31 02:43:27 +00:00
|
|
|
cmp #0
|
|
|
|
beq ShotDone
|
2015-05-25 19:35:22 +00:00
|
|
|
; Add to the x-coordinate. If the carry bit is set, we went off the edge
|
|
|
|
; of the screen, so disable the shot.
|
2015-05-30 14:53:31 +00:00
|
|
|
lda shotArray + 3, X ; x-velocity.
|
2015-05-31 02:43:27 +00:00
|
|
|
sta $00
|
2015-05-27 11:51:51 +00:00
|
|
|
lda shotArray + 1, X
|
2015-05-25 19:35:22 +00:00
|
|
|
clc
|
2015-05-31 02:43:27 +00:00
|
|
|
adc $00
|
2015-05-25 19:35:22 +00:00
|
|
|
bcs DisableShot
|
2015-05-27 11:51:51 +00:00
|
|
|
sta shotArray + 1, X ; Store new x-coord.
|
2015-05-25 19:35:22 +00:00
|
|
|
|
2015-05-31 14:45:29 +00:00
|
|
|
UpdateShotY:
|
2015-05-31 02:43:27 +00:00
|
|
|
; Add to the y-coordinate.
|
|
|
|
lda shotArray + 4, X ; y-velocity.
|
|
|
|
sta $00
|
2015-05-31 14:45:29 +00:00
|
|
|
bit #%10000000 ; Check whether the velocity is negative.
|
|
|
|
bne UpdateShotWithNegativeYVelocity
|
|
|
|
|
2015-05-31 02:43:27 +00:00
|
|
|
lda shotArray + 2, X
|
|
|
|
adc $00
|
|
|
|
cmp #224
|
|
|
|
bcs DisableShot
|
|
|
|
sta shotArray + 2, X ; Store new y-coord.
|
2015-05-31 14:45:29 +00:00
|
|
|
jmp ShotDone
|
2015-05-25 16:07:08 +00:00
|
|
|
|
2015-05-31 14:45:29 +00:00
|
|
|
UpdateShotWithNegativeYVelocity:
|
|
|
|
lda shotArray + 2, X ; Current Y.
|
|
|
|
cmp #224
|
|
|
|
bcs + ; If the shot was "off the top" before moving, maybe we'll reap it.
|
|
|
|
adc $00 ; Otherwise, just update it,
|
|
|
|
sta shotArray + 2, X ; save the result,
|
|
|
|
jmp ShotDone ; and we know it shouldn't be reaped.
|
|
|
|
+
|
|
|
|
adc $00
|
2015-05-31 15:36:14 +00:00
|
|
|
dec A ; Two's complement means that we need to -1 again in this case.
|
2015-05-31 14:45:29 +00:00
|
|
|
cmp #224
|
|
|
|
bcc DisableShot ; If it's now wrapped around, reap it.
|
|
|
|
sta shotArray + 2, X
|
2015-05-25 16:07:08 +00:00
|
|
|
jmp ShotDone
|
|
|
|
|
|
|
|
DisableShot:
|
2015-05-31 02:43:27 +00:00
|
|
|
stz shotArray, X
|
2015-05-25 16:07:08 +00:00
|
|
|
|
|
|
|
ShotDone:
|
2015-05-25 19:35:22 +00:00
|
|
|
; TODO(mcmillen): in places where we .rept inx (etc), is it faster to use
|
|
|
|
; actual addition?
|
2015-05-30 14:53:31 +00:00
|
|
|
.rept shotSize
|
2015-05-25 19:35:22 +00:00
|
|
|
inx
|
|
|
|
.endr
|
2015-05-30 14:53:31 +00:00
|
|
|
cpx #(shotArrayLength * shotSize)
|
2015-05-25 19:35:22 +00:00
|
|
|
bne UpdateShot
|
|
|
|
|
2015-05-24 18:44:26 +00:00
|
|
|
; Make the background scroll. Horizontal over time; vertical depending on
|
|
|
|
; player's y-coordinate.
|
2015-05-25 18:28:00 +00:00
|
|
|
lda vBlankCounter
|
2015-05-24 23:50:10 +00:00
|
|
|
sta BG3HOFS
|
2015-05-25 18:28:00 +00:00
|
|
|
lda vBlankCounter + 1
|
2015-05-24 23:50:10 +00:00
|
|
|
sta BG3HOFS
|
2015-05-25 18:28:00 +00:00
|
|
|
lda playerY
|
2015-05-24 18:44:26 +00:00
|
|
|
.rept 3
|
|
|
|
lsr
|
|
|
|
.endr
|
2015-05-24 23:50:10 +00:00
|
|
|
sta BG3VOFS
|
|
|
|
stz BG3VOFS
|
2015-05-24 17:22:42 +00:00
|
|
|
|
2015-05-24 14:43:25 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-31 02:43:27 +00:00
|
|
|
UpdateSprites:
|
|
|
|
; Zero out the scratch space for the secondary sprite table.
|
|
|
|
ldx #0
|
|
|
|
-
|
|
|
|
stz spriteTableScratchStart, X
|
|
|
|
inx
|
|
|
|
cpx #numSprites
|
|
|
|
bne -
|
|
|
|
|
|
|
|
ldx #0 ; Index into sprite table 1.
|
|
|
|
ldy #0 ; Index into sprite table 2.
|
|
|
|
|
|
|
|
; Copy player coords into sprite table.
|
|
|
|
lda playerX
|
|
|
|
sta spriteTableStart, X
|
|
|
|
lda playerY
|
|
|
|
sta spriteTableStart + 1, X
|
|
|
|
lda #0
|
|
|
|
sta spriteTableStart + 2, X
|
|
|
|
; Set priority bits so that the sprite is drawn in front.
|
|
|
|
lda #%00110000
|
|
|
|
sta spriteTableStart + 3, X
|
|
|
|
lda #%11000000 ; Enable large sprite.
|
|
|
|
sta spriteTableScratchStart, Y
|
|
|
|
|
|
|
|
.rept 4
|
|
|
|
inx
|
|
|
|
.endr
|
|
|
|
iny
|
|
|
|
|
|
|
|
; Now add shots.
|
|
|
|
sty $00 ; Save sprite table 2 index.
|
|
|
|
ldy #0 ; Index into shotArray.
|
|
|
|
-
|
|
|
|
lda shotArray, Y
|
|
|
|
cmp #0
|
|
|
|
beq + ; If not enabled, skip to next shot.
|
|
|
|
; Update sprite table 1.
|
|
|
|
sta spriteTableStart + 2, X ; sprite number
|
|
|
|
lda shotArray + 1, Y
|
|
|
|
sta spriteTableStart, X ; x
|
|
|
|
lda shotArray + 2, Y
|
|
|
|
sta spriteTableStart + 1, X ; y
|
|
|
|
; Update secondary sprite table.
|
|
|
|
phy ; Save shotArray index.
|
|
|
|
ldy $00
|
|
|
|
lda #%11000000
|
|
|
|
sta spriteTableScratchStart, Y
|
|
|
|
iny
|
|
|
|
sty $00
|
|
|
|
ply ; Restore shotArrayIndex.
|
|
|
|
|
|
|
|
.rept 4
|
|
|
|
inx
|
|
|
|
.endr
|
|
|
|
+
|
|
|
|
.rept shotSize
|
|
|
|
iny
|
|
|
|
.endr
|
|
|
|
cpy #(shotArrayLength * shotSize)
|
|
|
|
bne -
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-29 12:03:20 +00:00
|
|
|
FillSecondarySpriteTable:
|
|
|
|
; The secondary sprite table wants 2 bits for each sprite: one to set the
|
|
|
|
; sprite's size, and one that's the high bit of the sprite's x-coordinate.
|
|
|
|
; It's annoying to deal with bitfields when thinking about business logic,
|
|
|
|
; so the spriteTableScratch array contains one byte for each sprite, in
|
|
|
|
; which the two most significant bits are the "size" and "upper x" bits.
|
|
|
|
; This function is meant to be called after UpdateWorld, and packs those
|
|
|
|
; bytes into the actual bitfield that the OAM wants for the secondary
|
|
|
|
; sprite table.
|
2015-05-30 16:02:25 +00:00
|
|
|
;
|
|
|
|
; The expected format of every byte in the scratch sprite table is:
|
|
|
|
; sx------ s = size (0 = small, 1 = large)
|
|
|
|
; x = flipped high x-coordinate (so 1 behaves like "enable").
|
2015-05-29 12:03:20 +00:00
|
|
|
ldx #0 ; Index into input table.
|
|
|
|
ldy #0 ; Index into output table.
|
|
|
|
-
|
|
|
|
stz $00 ; Current byte; filled out by a set of 4 input table entries.
|
|
|
|
.rept 4
|
|
|
|
; For each byte, the lower-order bits correspond to the lower-numbered
|
|
|
|
; sprites; therefore we insert the current sprite's bits "at the top"
|
|
|
|
; and shift them right for each successive sprite.
|
|
|
|
lsr $00
|
|
|
|
lsr $00
|
|
|
|
lda spriteTableScratchStart, X
|
|
|
|
ora $00
|
|
|
|
sta $00
|
|
|
|
inx
|
|
|
|
.endr
|
|
|
|
lda $00
|
2015-05-30 16:02:25 +00:00
|
|
|
eor #%01010101
|
2015-05-29 12:03:20 +00:00
|
|
|
sta spriteTable2Start, Y
|
|
|
|
iny
|
|
|
|
cpx #numSprites
|
|
|
|
bne -
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-25 16:52:38 +00:00
|
|
|
SetBackgroundColor:
|
2015-05-25 18:28:00 +00:00
|
|
|
; The background-color bytes are (R, G, B), each ranging from [0-31].
|
2015-05-25 16:52:38 +00:00
|
|
|
; The palette color format is 15-bit: [0bbbbbgg][gggrrrrr]
|
2015-05-27 10:56:42 +00:00
|
|
|
|
2015-05-25 16:52:38 +00:00
|
|
|
; Set the background color.
|
|
|
|
; Entry 0 corresponds to the SNES background color.
|
|
|
|
stz CGADDR
|
|
|
|
|
|
|
|
; Compute and the low-order byte and store it in CGDATA.
|
2015-05-25 18:28:00 +00:00
|
|
|
lda backgroundGreen
|
2015-05-25 16:52:38 +00:00
|
|
|
.rept 5
|
|
|
|
asl
|
|
|
|
.endr
|
2015-05-25 18:28:00 +00:00
|
|
|
ora backgroundRed
|
2015-05-25 16:52:38 +00:00
|
|
|
sta CGDATA
|
|
|
|
|
|
|
|
; Compute the high-order byte and store it in CGDATA.
|
2015-05-25 18:28:00 +00:00
|
|
|
lda backgroundBlue
|
2015-05-25 16:52:38 +00:00
|
|
|
.rept 2
|
|
|
|
asl
|
|
|
|
.endr
|
|
|
|
sta $00
|
2015-05-25 18:28:00 +00:00
|
|
|
lda backgroundGreen
|
2015-05-25 16:52:38 +00:00
|
|
|
.rept 3
|
|
|
|
lsr
|
|
|
|
.endr
|
|
|
|
ora $00
|
|
|
|
sta CGDATA
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VBlankHandler:
|
|
|
|
jsr VBlankCounter
|
|
|
|
jsr DMASpriteTables
|
|
|
|
rti
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VBlankCounter:
|
|
|
|
; Increment a counter of how many VBlanks we've done.
|
2015-05-25 18:28:00 +00:00
|
|
|
; This is a 24-bit counter. At 60 vblanks/second, this will take
|
2015-05-25 16:52:38 +00:00
|
|
|
; 77 hours to wrap around; that's good enough for me :)
|
2015-05-25 18:28:00 +00:00
|
|
|
inc vBlankCounter
|
2015-05-28 12:44:38 +00:00
|
|
|
bne +
|
2015-05-25 18:28:00 +00:00
|
|
|
inc vBlankCounter + 1
|
2015-05-28 12:44:38 +00:00
|
|
|
bne +
|
2015-05-25 18:28:00 +00:00
|
|
|
inc vBlankCounter + 2
|
2015-05-28 12:44:38 +00:00
|
|
|
+
|
2015-05-25 16:52:38 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-24 14:43:25 +00:00
|
|
|
DMASpriteTables:
|
|
|
|
; Store at the base OAM address.
|
|
|
|
ldx #$0000
|
|
|
|
stx OAMADDR
|
|
|
|
; Default DMA control; destination $2104 (OAM data register).
|
|
|
|
stz DMA0CTRL
|
|
|
|
lda #$04
|
|
|
|
sta DMA0DST
|
|
|
|
; Our sprites start at $0100 in bank 0 and are #$220 bytes long.
|
2015-05-25 18:28:00 +00:00
|
|
|
ldx #spriteTableStart
|
2015-05-24 14:43:25 +00:00
|
|
|
stx DMA0SRC
|
|
|
|
stz DMA0SRCBANK
|
2015-05-25 18:28:00 +00:00
|
|
|
ldx #spriteTableSize
|
2015-05-24 14:43:25 +00:00
|
|
|
stx DMA0SIZE
|
|
|
|
; Kick off the DMA transfer.
|
|
|
|
lda #%00000001
|
|
|
|
sta DMAENABLE
|
2015-05-22 16:49:40 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
|
2015-05-22 17:34:37 +00:00
|
|
|
|
2015-05-22 16:49:40 +00:00
|
|
|
.ENDS
|
2015-05-23 18:00:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-25 12:04:15 +00:00
|
|
|
; Bank 1 is used for our graphics assets.
|
2015-05-23 18:00:43 +00:00
|
|
|
.BANK 1 SLOT 0
|
|
|
|
.ORG 0
|
2015-05-25 12:04:15 +00:00
|
|
|
.SECTION "GraphicsData"
|
2015-05-25 13:42:54 +00:00
|
|
|
|
|
|
|
SpriteData:
|
|
|
|
.INCBIN "sprites32.pic"
|
|
|
|
SpritePalette:
|
|
|
|
.INCBIN "sprites32.clr"
|
|
|
|
|
|
|
|
TileData:
|
|
|
|
.INCBIN "tiles.pic"
|
|
|
|
TilePalette:
|
|
|
|
.INCBIN "tiles.clr"
|
|
|
|
|
2015-05-23 19:38:27 +00:00
|
|
|
.ENDS
|
2015-05-24 17:22:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-25 12:04:15 +00:00
|
|
|
; Fill an entire bank with random numbers.
|
|
|
|
.SEED 1
|
2015-05-24 17:22:42 +00:00
|
|
|
.BANK 2 SLOT 0
|
|
|
|
.ORG 0
|
2015-05-25 12:04:15 +00:00
|
|
|
.SECTION "RandomBytes"
|
|
|
|
.DBRND 32 * 1024, 0, 255
|
2015-05-27 11:09:44 +00:00
|
|
|
.ENDS
|