mirror of
https://github.com/safiire/n65.git
synced 2024-12-12 15:29:12 +00:00
Accidentally had the opcode for TXA be NOP, don't know how that happened. I ported background.asm from NESASM format to my format, it is veeeery similar so not much needed changing, and the resulting ROM worked fine :)
This commit is contained in:
parent
ac46228b9f
commit
07ae7812ed
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@
|
||||
Desktop.ini
|
||||
Thumbs.db
|
||||
*.deb
|
||||
*.swp
|
||||
|
@ -710,7 +710,7 @@
|
||||
- :s
|
||||
- :z
|
||||
:implied:
|
||||
:hex: 0xEA
|
||||
:hex: 0xE8
|
||||
:len: 1
|
||||
:cycles: 2
|
||||
:boundry_add: false
|
||||
|
@ -153,7 +153,7 @@ module Assembler6502
|
||||
end
|
||||
|
||||
## We just don't recognize this line of asm, it must be a Syntax Error
|
||||
fail(SyntaxError, sprintf("%.4X: #{asm_line}", address))
|
||||
fail(SyntaxError, sprintf("%.4X: ", address) + asm_line)
|
||||
end
|
||||
|
||||
|
||||
|
55
my_background.asm
Normal file
55
my_background.asm
Normal file
@ -0,0 +1,55 @@
|
||||
; Create an iNES header
|
||||
.ines {"prog": 1, "char": 1, "mapper": 0, "mirror": 1}
|
||||
|
||||
|
||||
; Main code segment
|
||||
.org $C000
|
||||
RESET:
|
||||
SEI ; disable IRQs
|
||||
CLD ; disable decimal mode
|
||||
LDX #$40
|
||||
STX $4017 ; disable APU frame IRQ
|
||||
LDX #$FF
|
||||
TXS ; Set up stack
|
||||
INX ; now X = 0
|
||||
STX $2000 ; disable NMI
|
||||
STX $2001 ; disable rendering
|
||||
STX $4010 ; disable DMC IRQs
|
||||
|
||||
vblankwait1: ; First wait for vblank to make sure PPU is ready
|
||||
BIT $2002
|
||||
BPL vblankwait1
|
||||
|
||||
clrmem:
|
||||
LDA #$00
|
||||
STA $0000, X
|
||||
STA $0100, X
|
||||
STA $0200, X
|
||||
STA $0400, X
|
||||
STA $0500, X
|
||||
STA $0600, X
|
||||
STA $0700, X
|
||||
LDA #$FE
|
||||
STA $0300, X
|
||||
INX
|
||||
BNE clrmem
|
||||
|
||||
vblankwait2: ; Second wait for vblank, PPU is ready after this
|
||||
BIT $2002
|
||||
BPL vblankwait2
|
||||
|
||||
|
||||
LDA #$60 ;intensify blues
|
||||
STA $2001
|
||||
|
||||
Forever:
|
||||
JMP Forever ;jump back to Forever, infinite loop
|
||||
|
||||
NMI:
|
||||
RTI
|
||||
|
||||
|
||||
.org $FFFA ;first of the three vectors starts here
|
||||
.dw NMI ;when an NMI happens (once per frame if enabled) the processor will jump to the label NMI:
|
||||
.dw RESET ;when the processor first turns on or is reset, it will jump to the label RESET:
|
||||
.dw $0 ;external interrupt IRQ is not used in this tutorial
|
Loading…
Reference in New Issue
Block a user