It is currently Fri Dec 15, 2017 4:19 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: NES ASM SCREEN
PostPosted: Mon Jun 08, 2015 12:45 pm 
Offline

Joined: Mon Jun 08, 2015 12:33 pm
Posts: 3
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 126 times


Last edited by tales on Mon Jun 08, 2015 6:41 pm, edited 1 time in total.
Top
 Profile  
 
 Post subject: Re: NES ASM SCREEN
PostPosted: Mon Jun 08, 2015 1:50 pm 
Offline

Joined: Tue Apr 29, 2014 1:31 pm
Posts: 47
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:
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 65 times
Top
 Profile  
 
 Post subject: Re: NES ASM SCREEN
PostPosted: Mon Jun 08, 2015 6:40 pm 
Offline

Joined: Mon Jun 08, 2015 12:33 pm
Posts: 3
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).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group