ASM6 already assembles but the ROM stays with the black screen (MMC3)

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

Post Reply
arcangeldemerida
Posts: 21
Joined: Wed Jun 22, 2022 7:00 am

ASM6 already assembles but the ROM stays with the black screen (MMC3)

Post by arcangeldemerida »

I have been trying to assemble a disassembled game (With Mapper MMC3), after several errors that the assembler gave me, I got these and I have not been able to solve them:

Code: Select all

pass 1..
project.asm(17): Can't open file.
project.asm(21): Can't open file.
project.asm(25): Can't open file.
project.asm(29): Can't open file.
project.asm(33): Can't open file.
project.asm(37): Can't open file.
project.asm(41): Can't open file.
project.asm(45): Can't open file.
project.asm(49): Can't open file.
project.asm(53): Can't open file.
This is how I have my "project.asm" file sorted:

Code: Select all

; Main project file for all includes.


;RAM/WRAM variables
	 .include "variables.asm"
;iNES Header
	;------------------------------------------------;
	 .db "NES", $1A	;NES Header
	 .db 16			;16 x 16k PRG banks
	 .db 32			;32 x 8k CHR banks
	 .db $42		;Mapper 04, Mirroring horizontal
	 .dsb 9, $00	;Header Tail
	;------------------------------------------------;
;PRG Banks
     ;Bank 0
	 .base $8000
	 .include "bank0.asm"
	 .pad $A000
     ;Bank 1
	 .base $A000
	 .include "bank1.asm"
	 .pad $C000
     ;Bank 2
	 .base $A000
	 .include "bank2.asm"
	 .pad $C000
     ;Bank 3
	 .base $A000
	 .include "bank3.asm"
	 .pad $C000
     ;Bank 4
	 .base $A000
	 .include "bank4.asm"
	 .pad $C000
     ;Bank 5
	 .base $A000
	 .include "bank5.asm"
	 .pad $C000
     ;Bank 6
	 .base $A000
	 .include "bank6.asm"
	 .pad $C000
     ;Bank 7
	 .base $A000
	 .include "bank7.asm"
	 .pad $C000
     ;Bank 8
	 .base $A000
	 .include "bank8.asm"
	 .pad $C000
     ;Bank 9
	 .base $A000
	 .include "bank9.asm"
	 .pad $C000
     ;Bank 10
	 .base $A000
	 .include "bank10.asm"
	 .pad $C000
     ;Bank 11
	 .base $A000
	 .include "bank11.asm"
	 .pad $C000
     ;Bank 12
	 .base $A000
	 .include "bank12.asm"
	 .pad $C000
     ;Bank 13
	 .base $A000
	 .include "bank13.asm"
	 .pad $C000
     ;Bank 14
	 .base $A000
	 .include "bank14.asm"
	 .pad $C000
     ;Bank 15
	 .base $A000
	 .include "bank15.asm"
	 .pad $C000
     ;Bank 16
	 .base $8000
	 .include "bank16.asm"
	 .pad $A000
     ;Bank 17
	 .base $8000
	 .include "bank17.asm"
     .pad $A000
	 ;Bank 18
	 .base $8000
	 .include "bank18.asm"
     .pad $A000
	 ;Bank 19
	 .base $A000
	 .include "bank19.asm"
     .pad $C000
	 ;Bank 20
	 .base $8000
	 .include "bank20.asm"
     .pad $A000
	 ;Bank 21
	 .base $A000 ;?
	 .include "bank21.asm"
     .pad $C000
	 ;Bank 22
	 .base $8000
	 .include "bank22.asm"
     .pad $A000
	 ;Bank 23
	 .base $A000
	 .include "bank23.asm"
     .pad $C000
	 ;Bank 24
	 .base $8000 ;?
	 .include "bank24.asm"
     .pad $A000
	 ;Bank 25
	 .base $A000 ;?
	 .include "bank25.asm"
     .pad $C000
	 ;Bank 26
	 .base $A000 ;?
	 .include "bank26.asm"
     .pad $C000
	 ;Bank 27
	 .base $8000
	 .include "bank27.asm"
     .pad $A000
	 ;Bank 28
	 .base $8000
	 .include "bank28.asm"
     .pad $A000
	 ;Bank 29
	 .base $A000
	 .include "bank29.asm"
     .pad $C000
	 ;Bank 30
	 .base $C000
	 .include "bank30.asm"
     ;Bank 31
	 .org $E000
	 .include "bank31.asm"
	 .pad $FFFA
     .db <(VECTOR_NMI)
     .db >(VECTOR_NMI)
     .db <(VECTOR_RESET)
     .db >(VECTOR_RESET)
     .db <(VECTOR_IRQ)
     .db >(VECTOR_IRQ)
	 
	 ;CHR Backs
	 .incbin "CHR_ROM.chr"
	 
I have been trying to change include to incbin in files that were giving the error but still the same.
Last edited by arcangeldemerida on Thu Dec 29, 2022 5:41 pm, edited 1 time in total.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Failed to assemble with ASM6 (Can't open file)

Post by dougeff »

is bank0.asm (etc) in a folder or in another directory?
nesdoug.com -- blog/tutorial on programming for the NES
arcangeldemerida
Posts: 21
Joined: Wed Jun 22, 2022 7:00 am

Re: Failed to assemble with ASM6 (Can't open file)

Post by arcangeldemerida »

dougeff wrote: Thu Dec 29, 2022 2:08 pm is bank0.asm (etc) in a folder or in another directory?
I was able to solve it, it was that the name of the files was misspelled. It already assembles the ROM but it stays with the black screen.
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: Failed to assemble with ASM6 (Can't open file)

Post by Memblers »

arcangeldemerida wrote: Thu Dec 29, 2022 5:42 pm
dougeff wrote: Thu Dec 29, 2022 2:08 pm is bank0.asm (etc) in a folder or in another directory?
I was able to solve it, it was that the name of the files was misspelled. It already assembles the ROM but it stays with the black screen.


Since you have an assembled ROM, the next step can be a file comparison. In Windows command prompt you can use "fc /b file1.nes file2.nes". Then look at the first address where a difference appears, fix that, then redo the comparison until it hopefully works.
arcangeldemerida
Posts: 21
Joined: Wed Jun 22, 2022 7:00 am

Re: Failed to assemble with ASM6 (Can't open file)

Post by arcangeldemerida »

Memblers wrote: Fri Dec 30, 2022 7:04 am Since you have an assembled ROM, the next step can be a file comparison. In Windows command prompt you can use "fc /b file1.nes file2.nes". Then look at the first address where a difference appears, fix that, then redo the comparison until it hopefully works.
I did the file comparison and this is what I got:

Code: Select all

Comparing files file0.nes and FILE1.NES
000261B4: E9 EA
000261B6: 0E 0F
000261B8: 61 62
000261BA: 04 05
000261BC: 37 38
000261BE: B9 BA
000262CC: C5 C6
000262CE: 7C 7D
000262D0: 14 15
000262D2: 8F 90
000262D4: A8 A9
000263DB: 42 43
000263DD: 50 51
000263DF: 42 43
000263E1: 42 43
000263E3: 42 43
000263E5: 99 9A
000263E7: CE CF
000263E9: 50 51
000263EB: 64 65
000263ED: 42 43
000263EF: EA EB
000263F1: EF F0
000263F3: F4 F5
000263F5: F9 FA
000263F7: FE FF
000263F9: 03 04
000263FB: 0B 0C
000263FD: 4C 4D
000263FF: 55 56
00026401: 5E 5F
00026403: 99 9A
00026405: A6 A7
00026407: B3 B4
00026409: BA BB
0002640B: C1 C2
0002640D: C8 C9
0002640F: CF D0
00026411: 10 11
00026413: 42 43
00026415: 42 43
00026417: D6 D7
00026419: 77 78
0002641B: 06 07
0002641D: 0B 0C
0002641F: 24 25
00026421: 15 16
00026423: 3D 3E
00026425: 26 27
00026427: 11 12
00026429: DA DB
0002642B: DF E0
0002642D: E4 E5
0002642F: 3E 3F
00026431: 3D 3E
00026433: 37 38
00026435: 45 46
00026AA2: 03 04
00026AA6: 06 07
00026ADA: 06 07
00026AE6: 06 07
00026B79: 2F 30
00026B7B: 87 88
00026B7D: 8C 8D
00026B7F: B6 B7
00026B81: B9 BA
00026B83: 53 54
00026B85: 53 54
00026B87: 40 41
00026B89: 0C 0D
00026B8B: A1 A2
00026B8D: 70 71
00026B8F: 70 71
00026B91: 60 61
00026B93: 69 6A
00026B95: 40 41
00026B97: 4A 4B
00026B99: 22 23
00026B9B: 34 35
00026B9D: 49 4A
00026B9F: 6B 6C
00026BA1: 5D 5E
00026BA3: 79 7A
00026BA5: 89 8A
00026BA7: 8C 8D
00026BA9: AC AD
00026BAB: 96 97
00026BAD: BC BD
00026BAF: 04 05
00026BB1: E3 E4
00026BB3: 9D 9E
00026BB5: C4 C5
00026BB7: 83 84
00026BB9: 95 96
00026BBB: 71 72
00026BBD: 83 84
00026BBF: AB AC
00026BC1: B7 B8
00026BC3: B5 B6
00026BC5: D2 D3
00026BC7: 8D 8E
00026BC9: DA DB
00026BCB: ED EE
00026BCD: 14 15
00026BCF: 2E 2F
00026BD1: DB DC
00026BD3: D0 D1
00026BD5: E9 EA
00026BD7: F4 F5
00026BD9: 0B 0C
00026BDB: 3B 3C
00026BDD: 5D 5E
00026BDF: 27 28
00026BE1: 70 71
00026BE3: 70 71
00026BE5: D7 D8
00026BE7: F9 FA
00026BE9: BC BD
00026BEB: D7 D8
00026BED: D0 D1
00026BEF: 34 35
00026BF1: 2A 2B
00026BF3: 1F 20
00026BF5: 45 46
00026BF7: 56 57
00026BF9: 70 71
00026BFB: EA EB
00026BFD: 3F 40
00026BFF: 58 59
00026C01: 71 72
00026C03: 10 11
00026C05: 8F 90
00026C07: FB FC
00026C09: 22 23
00026C0B: 38 39
00026C0D: 49 4A
00026C0F: A7 A8
00026C11: B4 B5
00026C13: 16 17
00026C15: 31 32
00026C17: E7 E8
00026C19: A8 A9
00026C1B: 49 4A
00026C1D: E1 E2
00026C1F: FF 00
00026C20: B5 B6
00026C21: F0 F1
00026C23: 45 46
00026C25: 9F A0
00026C27: A8 A9
00026C29: A9 AA
00026C2B: 28 29
00026C2D: 94 95
00026C2F: AB AC
00026C31: B3 B4
00026C33: BB BC
00026C35: 40 41
00026C37: C3 C4
00026C39: C8 C9
00026C3B: 3F 40
00026C3D: FC FD
00026C3F: 22 23
00026C41: DA DB
00026C43: E9 EA
00026C45: 0B 0C
00026C47: 24 25
00026C49: 2C 2D
00026C4B: 34 35
00026C4D: 3E 3F
00026C4F: 50 51
00034078: 59 5A
0003407A: 8F 90
0003407C: 9F A0
0003407E: B0 B1
00034080: CC CD
00034082: F2 F3
00034084: EE EF
00034086: 51 52
00034088: 05 06
0003408A: 89 8A
0003408C: C3 C4
0003408E: EF F0
00034090: E4 E5
00034092: BC BD
00034094: F7 F8
00034096: FE FF
00034098: 14 15
0003409A: 25 26
0003409C: 99 9A
0003409E: BC BD
0003C8BE: E1 E2
0003C8C0: E1 E2
0003C8C2: E1 E2
0003C8C4: E1 E2
0003C8C6: 08 09
0003C8C8: D3 D4
0003C8CA: 2E 2F
0003C8CC: 4F 50
0003C8CE: C1 C2
0003C8D0: D1 D2
0003E115: BC BD
0003E119: 80 81
0003E11D: 80 81
0003E121: CE CF
0003E125: 77 78
0003E129: BC BD
0003E12D: BC BD
0003E131: 3E 3F
0003E135: 6B 6C
0003E139: 39 3A
0003E13D: 91 92
0003E141: DD DE
0003E145: 04 05
0003E149: 37 38
0003E14D: C4 C5
0003E151: C9 CA
0003E155: F4 F5
0003E159: CC CD
0003E15D: BD BE
0003E161: 13 14
0003E165: 07 08
0003E169: C6 C7
0003E16D: B7 B8
0003E171: 0D 0E
0003E175: 1F 20
0003E179: 1F 20
0003E17D: 1F 20
0003E181: 1F 20
0003E185: 19 1A
0003E189: 19 1A
0003E18D: 19 1A
0003E191: 19 1A
0003E195: 55 56
0003E199: F0 F1
0003E19D: BD BE
0003E1A1: 1F 20
0003E1A5: 1F 20
0003E1A9: 1F 20
0003E1AD: 87 88
0003E1B1: D8 D9
0003E1B5: D1 D2
0003E1B9: 60 61
0003E1BD: 68 69
0003E1C1: F4 F5
0003E1C5: E7 E8
0003E1C9: 19 1A
0003E3DC: 27 28
0003E3DE: 3B 3C
0003E3E0: DD DE
0003E3E2: B1 B2
0003E3E4: 9D 9E
0003E3E6: DB DC
0003E3E8: 02 03
0003E3EA: 65 66
0003E3EC: 8F 90
0003E552: 12 02
0003ED02: 21 22
0003ED04: 61 62
0003ED06: 21 22
0003ED08: 9A 9B
0003F8D1: C9 CA
0003F8D3: D6 D7
0003F8D5: DA DB
0003F8D7: E4 E5
0003F8D9: EC ED
0003F8DB: 15 16
0003F8DD: 22 23
0003F8DF: 3B 3C
0003F8E1: 5B 5C
0003F8E3: 7B 7C
0003F8E5: 9E 9F
File0.nes is the original ROM, file1.nes is the ROM I assembled.
User avatar
never-obsolete
Posts: 411
Joined: Wed Sep 07, 2005 9:55 am
Location: Phoenix, AZ
Contact:

Re: ASM6 already assembles but the ROM stays with the black screen (MMC3)

Post by never-obsolete »

I had off by one errors when reassembling with asm6, and the issue was that the original used absolute addressing to access the zero page.

If that turns out to be the case, IIRC, I think I used symbol EQU $00nn to bypass the reduction. That was ugly and error prone so I eventually added a "force absolute addressing" operator to asm6n.
. That's just like, your opinion, man .
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: ASM6 already assembles but the ROM stays with the black screen (MMC3)

Post by tokumaru »

never-obsolete wrote: Fri Dec 30, 2022 9:12 amIf that turns out to be the case, IIRC, I think I used symbol EQU $00nn to bypass the reduction.
I think most assemblers will still optimize ZP accesses even if you define the addresses with leading zeros.

In ASM6, I usually just put the opcodes as data whenever I needed to access ZP using absolute addressing, but having a proper operator for this definitely helps.
arcangeldemerida
Posts: 21
Joined: Wed Jun 22, 2022 7:00 am

Re: ASM6 already assembles but the ROM stays with the black screen (MMC3)

Post by arcangeldemerida »

With what @Memblers said, I was able to solve the problem, it already assembles and works normally.

Thanks for the help. :D
Post Reply