Re: [cc65] bank switching/retro replay?

From: Groepaz <groepaz1gmx.net>
Date: 2009-11-10 20:31:56
On Dienstag 10 November 2009, Ullrich von Bassewitz wrote:
> On Tue, Nov 10, 2009 at 02:22:51PM +0100, Groepaz wrote:
> > 	.word f1,.banked(f1) ; evaluates to $11
> > 	.word f2,.banked(f2) ; evaluates to $12
> >
> > this approach seems simpler and cleaner to me, and it should cover most
> > practical uses...
>
> How would you switch banks given above table? Search through the table
> until the function is found?

no, typically in cartridges the banked function api is called like this:

	ldy #API_FUNC
	jsr banked_call

the function that handles the banked call simply gets the function adress and 
banking value from the table, depending on the function number passed in Y.

-- 

http://www.hitmen-console.org    http://magicdisk.untergrund.net
http://www.pokefinder.org        http://ftp.pokefinder.org

...the best way to prepare [to be a programmer] is to write programs, and to 
study great programs that other people have written. In my case, I went to 
the garbage cans at the Computer Science Center and fished out listings of 
their operating system. 
<Bill Gates>

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Nov 10 20:32:45 2009

This archive was generated by hypermail 2.1.8 : 2009-11-10 20:32:47 CET