which assembler to use?
Moderator: Moderators
-
Celius
- Posts: 2159
- Joined: Sun Jun 05, 2005 2:04 pm
- Location: Minneapolis, Minnesota, United States
- Contact:
I really think Wla-Dx is a great thing to use. It takes a while to get used to (Or at least it did for me), but once you really know how to use it, it's SO much better than NESASM. I at first didn't understand why everyone hated NESASM so much, but as soon as I actually started making something that wasn't just displaying a sprite on screen, I noticed TONS of things that really sucked. I recall not being able to do nameless lables and things like that, but I also couldn't figure out its banking system. I couldn't really make a game that wasn't NROM. I found the little features that Wla-Dx offered to be quite handy.
Does anyone know how to output a .nes on the ASM6. It says that can only output a .bin file. very simlar to the x816.
Code: Select all
Usage:
asm6 [-options] sourcefile[.asm|.s] [outputfile] [listfile]
Options:
-? Show some help
-l Create listing
-L Create verbose listing (expand REPT, MACRO)
-d<name>: Define a symbol and make it equal to 1
Default output is <sourcefile>.bin
Default listing is <sourcefile>.lst" If I have seen further it is by standing on the shoulders of giants" - Issac Newton, in a letter to Robert Hooke.
A .bin file is all you need. Just slap on a header and the chr and give it an .nes extension. You can do that in a batch file. Put this in a text file and rename it to whatever.bat:
(you can remove that pause if you want -- but i usually leave it so I can see any assembler errors).
Of course you'll need to make header.bin and yourchr.chr by hand (chr can be made with a tile editor like YY-CHR or something -- header.bin is just the $10 byte header which you can throw together with a hex editor pretty easily)
Code: Select all
asm6 yoursourcefile.asm output.bin
copy /B header.bin+output.bin+yourchr.chr yourrom.nes
pause
Of course you'll need to make header.bin and yourchr.chr by hand (chr can be made with a tile editor like YY-CHR or something -- header.bin is just the $10 byte header which you can throw together with a hex editor pretty easily)
do i define the .chr file in the .asm file like in NESASM
ie:
or do i just include it? thanks for the fast reply
ie:
Code: Select all
.bank 2 ; switch to bank 2
.org $0000 ; start at $0000
.incbin "demo.chr" ; empty background first
" If I have seen further it is by standing on the shoulders of giants" - Issac Newton, in a letter to Robert Hooke.
its complies with no flaws it just dosent open in FCEUXD. i figure its my header. im putting all 00 in a 16 bit notepad edited in a hex editor. either that or its my .asm file.
Code: Select all
it starts with:
.org $8000
::
::
::
::
ends with:
.pad $FFFA
.dw nmi,reset,reset
.end
" If I have seen further it is by standing on the shoulders of giants" - Issac Newton, in a letter to Robert Hooke.
yeah those docs do explain alot.
so if i use:
.db "NES",$1a
.db 2 ;prgsize
.db 1 ;chrsize
.db 0 ;mapper#, etc
.db 0,0,0,0,0,0,0,0,0 ;filler
then i dont have to combine the header with the output.bin? or do i just put this in a seperate file and then combine them.
so if i use:
.db "NES",$1a
.db 2 ;prgsize
.db 1 ;chrsize
.db 0 ;mapper#, etc
.db 0,0,0,0,0,0,0,0,0 ;filler
then i dont have to combine the header with the output.bin? or do i just put this in a seperate file and then combine them.
" If I have seen further it is by standing on the shoulders of giants" - Issac Newton, in a letter to Robert Hooke.
In ASM6, I start like this:
Then follow all the ROM banks that get mapped to $8000. Each of them looks like this:
Then comes the last bank, the one that gets mapped to $c000:
This is a CHR-RAM project, so I do not have any CHR banks, but i'm sure there would be no problems in including the binary data at the end.
I also have all my variables defined before the header, like this:
When you assemble the code, you can even specify the name of the output file, which can have a .nes extension, resulting in a ROM ready to be used in emulators.
Code: Select all
.org $7ff0
.db "NES", $1a ;ID
.db $10 ;16 PRG-ROM pages
.db $00 ;No CHR-ROM present
.db $21 ;Mapper 2 with vertical mirroring
.dsb $09, $00 ;Clear the restCode: Select all
.base $8000
;WHATEVER GOES IN THE BANK
.org $c000Code: Select all
.org $c000
;WHATEVER GOES IN THE BANK
.org $fffa
.dw NMI
.dw Reset
.dw IRQI also have all my variables defined before the header, like this:
Code: Select all
.enum $0000
Character ;Index of the character being used
.dsb 1
LevelIndex ;Index of the level being played
.dsb 1
(...)
.endei can seem to output my demo normally. at first i couldnt even open it in FCEUXD when i tried to merge a header, output.bin and .chr file. so then i just pasted the header into the .asm file and it all compiled without any errors but i just get a grey screen. if figured it was the .incbin(ed) .pal file. but still nothing i used db statements. i wondering if maybe it has to do with the fact that used this demo on NESASM. what kind of things do i look out for when switching compilers?
heres the code that complied without errors but just show up grey:
heres the code that complied without errors but just show up grey:
Code: Select all
.db "NES",$1a
.db 1 ;prgsize
.db 1 ;chrsize
.db 0 ;mapper#, etc
.db 0,0,0,0,0,0,0,0,0 ;filler
.org $8000
vbtrip = $01
SP_yp = $0300
SP_tn = $0301
SP_at = $0302
SP_xp = $0303
Start:
sei
cld
vb1: lda $2002
bne vb1
vb2: lda $2002
bne vb2
lda #$00
sta $2000
sta $2001
jsr ldpal
jsr ldnmt
lda #%10000000
sta $2000
lda #%00011110
sta $2001
loop
jmp loop
ldpal
ldx #$00
lda #$3F
sta $2006
lda #$00
sta $2006
loadpal:
lda tilepal, x
sta $2007
inx
cpx #32
bne loadpal
rts
ldnmt
lda #$20
sta $2006
lda #$20
sta $2006
ldx #$00
loadNames1:
lda ourMap, X
sta $2007
inx
bne loadNames1
loadNames2:
lda ourMap+$100, X
sta $2007
inx
bne loadNames2
loadNames3:
lda ourMap+$200, X
sta $2007
inx
bne loadNames3
loadNames4:
lda ourMap+$300, X
sta $2007
inx
cpx #$80
bne loadNames4
lda #$2c
sta $2006
lda #$20
sta $2006
ldx #$00
loadNames5:
lda ourMap2, X
sta $2007
inx
bne loadNames5
loadNames6:
lda ourMap2+$100, X
sta $2007
inx
bne loadNames6
loadNames7:
lda ourMap2+$200, X
sta $2007
inx
bne loadNames7
loadNames8:
lda ourMap2+$300, X
sta $2007
inx
cpx #$80
bne loadNames8
rts
lda #$80
sta vbtrip
nmi
pha
txa
pha
tya
pha
dec vbtrip
lda #$03
sta $0301
lda #$20
sta $0300
LDA $0303
ADC #$01
sta $0303
lda #$03
sta $4014
lda #$00
Sta $2005
Sta $2005
pla
tay
pla
tax
pla
RTI
irq:
rti
tilepal:
.incbin "basictst.nam"
ourMap:
.incbin "basictst.nam"
ourMap2:
.incbin "basictst2.nam"
.org $FFFA
.dw nmi
.dw Start
.dw irq" If I have seen further it is by standing on the shoulders of giants" - Issac Newton, in a letter to Robert Hooke.
-
atari2600a
- Posts: 324
- Joined: Fri Jun 29, 2007 10:25 pm
- Location: Earth, Milkyway Galaxy, The Universe, M-Theory
- Contact:
I had the grey screen for a while once...turns out I was just starting at the wrong address, lol! (PRG set to 1 on N-ROM at $7000 by mistake)
Code: Select all
*=$0000
loop JMP loop
.eof