NES ASM SCREEN

A place for your artistic side. Discuss techniques and tools for pixel art on the NES, GBC, or similar platforms.

Moderator: Moderators

Post Reply
tales
Posts: 3
Joined: Mon Jun 08, 2015 12:33 pm

NES ASM SCREEN

Post by tales »

Hi guys, I'm new here, and I'm new in NES ASM program too, I really had many dificult to unsderstand how I draw a background into a toll and put it in my code, than I create a simple screen toll, when we enter with a bitmap (create from yy chr), and draw your screen beside, after than, you click in CREATE CODE and open a window with your map code, just copy and past in your code..

Before you create a code you can choose Vertical or Horizontal (if you use %00000000 or %00000100 in your $2000)


https://dl.dropboxusercontent.com/u/821 ... SCREEN.rar
Attachments
NES ASM SCREEN.rar
(178.5 KiB) Downloaded 355 times
Last edited by tales on Mon Jun 08, 2015 6:41 pm, edited 1 time in total.
nIghtorius
Posts: 61
Joined: Tue Apr 29, 2014 1:31 pm

Re: NES ASM SCREEN

Post by nIghtorius »

You should implement a compression scheme too. Which takes less space in your ROM.
I'll dig up my simple compression/decompression algorithm ( probably can be written better, but it suits my needs )

decompression code (ASM):

Code: Select all

LoadCompressedScene:
	;	Nametable Data.
		clc
		lda		$02
		sta		$2006
		lda		$03
		sta		$2006
		ldy		#0	
-		lda		($00), y		; load repeat value (1--255, 0=EOP)
		beq		+++
		tax						; store this in X
		iny						; increment Y
		beq 	+				; increase page.
---		lda		($00), y		; load tile
--		sta		$2007
		dex
		bne 	--				; loop until X = 0!
		iny
		beq		++				; increase page
----	bne		-				; start over again.
+		inc		$01
		bcc		---
++		inc		$01
		bcc		----
+++		rts

	; Macro definition
	MACRO	LoadRLEScene	TableAddr, Graphic
		lda		#<Graphic
		sta		$00
		lda		#>Graphic
		sta		$01
		lda		#<TableAddr
		sta		$03
		lda		#>TableAddr
		sta		$02
		jsr		LoadCompressedScene
	ENDM
Compress the nametables (w/ attr-data) with RAWRLE (Commandline tool)
use the LoadCompressedScene function or LoadRLEScene macro to decompress.

for example: LoadRLEScene $2000, Titlescreen which will decompress the data @ pointer Titlescreen to PPU address 0x2000 ($2000)
warning: it destroys memory located at ZP [0x00-0x03]
Attachments
simplerle.zip
(253.54 KiB) Downloaded 267 times
tales
Posts: 3
Joined: Mon Jun 08, 2015 12:33 pm

Re: NES ASM SCREEN

Post by tales »

Nice... but this toll is just to help me draw a screen with my tiles and create a .db ... maybe I improve this to create a attribute (but first I need to undestand how it works in ASM).
Post Reply