Users browsing this thread: 1 Guest(s)
Random battle theme
12-14-2018, 02:41 PM
(12-11-2018, 06:23 PM)madsiur Wrote: You have to do something like this:
I'm getting a bunch of errors when I compile (I still have almost no understanding of ASM code, so forgive me if these problems are obvious):
This is the code I have so far:
Code:
hirom
header
org $C2BDB7
JSR free_space
NOP
org $C264C9 ; change to free space
free_space:
TDC
LDA $C2BF3B,X ; load formation song
CMP #$24 ; check if battle song
BNE .exit ; branch if not
LDA $11E2 ; load battle background byte
AND #$3F ; isolate battle background
REP #$20
TAX ; set BG as index
SEP #$20
LDA table,X ; load BG song ID
.exit:
RTS
; your $37 song IDs
; this table can be anywhere in the ROM:
org $F15550 ;(uncomment and change to move table elsewhere)
table:
56 ; W O B Grass
57 ; WOR Forest
66 ; W O B Desert
00 ; song ID for 4th background
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
« Next Oldest | Next Newest »
|
||||
Users browsing this thread: 1 Guest(s)