ASM6 templates

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

mikaelmoizt
Posts: 120
Joined: Sat Apr 12, 2014 12:11 pm
Location: Gothenburg, Sweden

Re: ASM6 templates

Post by mikaelmoizt »

Deemar wrote:I'm super new to Assembly, what are these templates for exactly? If it's a template for making a NES game, why is there more than one? Thanks.
A template is just something to help getting started with a project.

So, for example, let's say you want to make a small game, without any mapper:
Use nrom (the size of Super Mario Bros, Kung Fu, etc)

nrom is 32k (2x16) of code, 8k of chr rom. <-- start here :)

unrom allows you to add additional (in this case 8x16k) program memory and switch whenever you need to.

cnrom allows you to switch between 4 different chr rom banks in 8k sections.
I´ve got %01100011 problems but the BITs aint one.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: ASM6 templates

Post by tokumaru »

Yeah, these are just "skeletons" you can use to get started. They already generate .nes files in the correct format to be used with NES emulators. They don't have any code though, you have to write that part.

There are different templates because there are different types of NES cartridges, with different hardware configurations. These templates cover the most common configurations used by beginners.
User avatar
FARID
Posts: 499
Joined: Wed Apr 07, 2010 1:14 am
Location: Iran
Contact:

Re: ASM6 templates

Post by FARID »

According to this topic I used .pad instead of .org
Is it ok?

TNROM Template :

Code: Select all

; ASM6 TNROM Template (512KB PRG + 8KB VRAM + 8KB WRAM + Battery)
; Use Notepad++ for best view
;-----------------------------------------------------------------------------------
;iNES Header
  .db $4E, $45, $53, $1A, $20, $00, $42, $00, $00, $00, $00, $00, $00, $00, $00, $00
;-----------------------------------------------------------------------------------
;PRG Bank0 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank1 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank2 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank3 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank4 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank5 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank6 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank7 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank8 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank9 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank10 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank11 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank12 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank13 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank14 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank15 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank16 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank17 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank18 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank19 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank20 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank21 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank22 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank23 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank24 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank25 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank26 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank27 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank28 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank29 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank30 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank31 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank32 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank33 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank34 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank35 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank36 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank37 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank38 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank39 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank40 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank41 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank42 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank43 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank44 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank45 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank46 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank47 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank48 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank49 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank50 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank51 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank52 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank53 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank54 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank55 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank56 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank57 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank58 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank59 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank60 $8000 ~ $9FFF
  .base $8000
  ;User Codes
  .pad $A000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank61 $A000 ~ $BFFF
  .base $A000
  ;User Codes
  .pad $C000,$FF  
;-----------------------------------------------------------------------------------
;PRG Bank62 $C000 ~ $DFFF
  .base $C000
  ;User Codes
  .pad $E000,$FF
;-----------------------------------------------------------------------------------
;PRG Bank63 $E000 ~ $FFFF
  .base $E000
  ;User Codes

RESET:
	;Init Code

NMI:
	RTI
  
IRQ:
	RTI
  
;Vectors
  .pad $FFFA,$FF
  .dw NMI
  .dw RESET
  .dw IRQ
Last edited by FARID on Fri Mar 20, 2020 6:59 am, edited 1 time in total.
User avatar
caramelpuffpuff
Posts: 64
Joined: Sat Feb 23, 2013 4:16 pm

Re: ASM6 templates

Post by caramelpuffpuff »

unrom allows you to add additional (in this case 8x16k) program memory and switch whenever you need to.
How much and how limit program memory can you put? As big as Dragon Quest [Around 1MB] or 10000000000000 times bigger than that? Or it's purely limited, to the point where you can't put like 6502KB anymore? I forgot which templates is the infinite memories and infinite sprites, graphics, and backgrounds.
I am thinking of requesting a tutor [free] to learn NES programming in 6502 Assembly, as I am still baffled on the Bunnyboy 6504 lessons. If anyone want to help, I'm happy.
Bear in mind I may act silly or have trouble understanding, so please bear with me.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: ASM6 templates

Post by tepples »

The PowerPak is limited to 512 KiB PRG ROM and 512 KiB CHR ROM/RAM. So are 8-bit parallel flash ROMs designed for 5.0 V PCBs.

Going beyond that depends on whether or not you want to keep the execute-in-place (XIP) architecture. If you're willing to change it so that most of the program is loaded from NAND flash memory into RAM, with only a small "boot sector" stored in a ROM, you can go into the gigabytes.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: ASM6 templates

Post by dougeff »

caramelpuffpuff wrote:
unrom allows you to add additional (in this case 8x16k) program memory and switch whenever you need to.
How much and how limit program memory can you put? As big as Dragon Quest [Around 1MB] or 10000000000000 times bigger than that? Or it's purely limited, to the point where you can't put like 6502KB anymore? I forgot which templates is the infinite memories and infinite sprites, graphics, and backgrounds.

Dragon Quest 4 is 512k PRG ROM (and 8k CHR RAM, and 8k SRAM)

http://bootgod.dyndns.org:7777/profile.php?id=1276
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: ASM6 templates

Post by tokumaru »

Isn't Kirby's Adventure considered the largest licensed NES game?
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: ASM6 templates

Post by dougeff »

Bootgod says...

http://bootgod.dyndns.org:7777/profile.php?id=170

Kirbys Adventure
512 k PRG
256 k CHR

http://bootgod.dyndns.org:7777/profile.php?id=4733

Metal Slader Glory
512 k prg
512 k chr

http://bootgod.dyndns.org:7777/profile.php?id=1409

Just Breed
512 k prg
256 k chr

http://bootgod.dyndns.org:7777/profile.php?id=1161

Action 52
512 k prg x 3 !
512 k chr

Edit, added links.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: ASM6 templates

Post by tokumaru »

I guess Kirby gets the reputation of being the largest *NES* game because the others are Famicom only, and Action 52 is not even licensed.
puppydrum64
Posts: 160
Joined: Sat Apr 24, 2021 7:25 am

Re: ASM6 templates

Post by puppydrum64 »

Does ASM6 support Mapper 24 (Japanese Castlevania 3)?

Edit: It does, I just had to slightly alter tokumaru's template to allow for two-digit mapper IDs. I'll edit this again later with the correct header
Last edited by puppydrum64 on Wed May 19, 2021 9:35 am, edited 1 time in total.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: ASM6 templates

Post by dougeff »

asm6 can do anything you want. It isn't even NES specific, you can make C64 or Apple II code with it.
nesdoug.com -- blog/tutorial on programming for the NES
puppydrum64
Posts: 160
Joined: Sat Apr 24, 2021 7:25 am

Re: ASM6 templates

Post by puppydrum64 »

Good to know
Post Reply