[cc65] CC65, lcc & 65816?

From: <cdoty1rastersoft.net>
Date: 2006-03-22 05:34:03
I've recently became interested in using the lcc 65816 (and ca65/ld65) 
backend posted in the archives (by Groepez)..

I've been able to get it to the point that it will compile and successfully 
run a roms for the SNES, but it has a problem with passing parameters into a 
function. Here's a link to the rom I got working: 
http://www.rastersoft.net/SNESFrog.zip (A selects an option. up and down 
move.)
Once 1 or 2 player is selected, any movement of the frog causes it to jump 
to the upper left. This is the first function called with a parameter.

This seems to be related to the PRO macro and RZ/LZ.  I would like to fully 
implement the enclosed macros under ca65. Any ideas on this?

This is pretty close to functioning, minus the above issue. It does limit 
the code size to 32k (on the SNES), but that can be worked (hacked) around 
fairly easily in lcc5ca65/ja2ca65.

Here's the macro:
 .mac PRO
 .(
 phd
-stack = \1
 .while !(stack & 1) && stack<5 && stack
 pha
stack = stack - 2
 .wend
 tsc
 .if stack
 sec
 sbc #stack
 tcs
 .endif
 tcd
 .)
 .mend

 .mac POST
 !POP \1
 pld
 .mend

Here's the other macro:
 .macro POP arg1
 .scope
;-stack = arg1
; .while !(stack & 1) && stack<9 && stack
; pla
;stack = stack - 2
; .wend

; .if (arg1 != 0)
 tsc
 clc
 adc #arg1
 tcs
; .endif

 .endscope
 .endmacro




----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Wed Mar 22 05:34:12 2006

This archive was generated by hypermail 2.1.8 : 2006-03-22 05:34:15 CET