News: 11 March 2016 - Forum Rules

Author Topic: Help with WLA 65816 craps  (Read 1562 times)

yugisokubodai

  • Full Member
  • ***
  • Posts: 156
    • View Profile
    • Assembly
Help with WLA 65816 craps
« on: April 30, 2016, 04:10:36 am »
I'm digging some wla source codes and convert it to xkas compatible format.
I encoutered these craps in wla, and have no idea what the hell they are.

ldx #32*\1 + \2
.DB \1, 0
lda \1

What are that \1, \2 things? Wla uses a lot of these nonsense and it's annoying.

Thank you for reading.

Disch

  • Hero Member
  • *****
  • Posts: 2814
  • NES Junkie
    • View Profile
Re: Help with WLA 65816 craps
« Reply #1 on: April 30, 2016, 12:42:38 pm »
macro parameters?  Is that in a macro definition?

</guess>

yugisokubodai

  • Full Member
  • ***
  • Posts: 156
    • View Profile
    • Assembly
Re: Help with WLA 65816 craps
« Reply #2 on: April 30, 2016, 12:57:02 pm »
Yes, it's macro

Code: [Select]
;============================================================================
; LoadPalette -- Macro that simplifies calling DMAPalette to load a palette
;----------------------------------------------------------------------------
; In: SRC_ADDR -- 24 bit address of source data
;----------------------------------------------------------------------------
; Out: None
;----------------------------------------------------------------------------
; Modifies: A, X
;----------------------------------------------------------------------------

;LoadPalette SRC_ADDRESS
;   requires:  mem/A = 8 bit, X/Y = 16 bit
.MACRO LoadPalette
lda #:\1
ldx #\1
jsr DMAPalette
.ENDM



;============================================================================
; LoadBlockToVRAM -- Macro that simplifies calling LoadVRAM to copy data to VRAM
;----------------------------------------------------------------------------
; In: SRC_ADDR -- 24 bit address of source data
;     DEST -- VRAM address to write to (WORD address!!)
;     SIZE -- number of BYTEs to copy
;----------------------------------------------------------------------------
; Out: None
;----------------------------------------------------------------------------
; Modifies: A, X, Y
;----------------------------------------------------------------------------

;LoadBlockToVRAM SRC_ADDRESS, DEST, SIZE
;   requires:  mem/A = 8 bit, X/Y = 16 bit
.MACRO LoadBlockToVRAM
ldx #\2 ; DEST
stx $2116
lda #:\1 ; SRCBANK
ldx #\1 ; SRCOFFSET
ldy #\3 ; SIZE
jsr LoadVRAM
.ENDM


But I don't understand this macro things.

In Xkas, we have this

!sample = #$40

then

lda !sample
is
lda #$40

Xkas is very easy to understand. But I can't get it with wla definition.