[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 
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
-stack = \1
 .while !(stack & 1) && stack<5 && stack
stack = stack - 2
 .if stack
 sbc #stack

 .mac POST
 !POP \1

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

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


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