Re: [cc65] Supervision support

Date view Thread view Subject view

From: Groepaz (groepaz_at_gmx.net)
Date: 2003-09-22 16:04:15


On Monday 22 September 2003 12:05, Peter Trauner wrote:

> a few weeks ago I started to use ca65 for a few simple test programs
> for the supervision handheld.

care to explain what it is? never heard of that one :o)

> I looked a little bit on the compiler and started to add supervision c
> support.
>
> Since this is a console and the program is in ROM, how do I
> initialize/handle
> non const global variables?

write a linker config that puts everything into rom, except the .bss and .data 
sections (which should be in ram) (if you dont have any ram at all - you have 
problems :=P)

you may want to look at the NES port (which is available in the development 
version) - looking at the code/linkerconfig might solve some of your 
questions.

> Is it possible to prevent read only accesses from write only io ports?

no - just don't read them :)

> Is it safe to call c functions from irq, nmi?

no - (not entire true, its very "hard" and features lot of overhead)... the 
general rule is to write that stuff in assembler.

if you really think you want to do this in C (you dont, believe me :=)), look 
at the code of the debug library....somewhere in there is a brk-handler that 
calls a C function.

> I have 4 linker configuration files for 16, 32, 64, 128kbyte cartridges
> (64, 128kbyte are bankswitched).

its almost the same with the NES.... in that case i decided to supply a 
linkerconfig for the smallest possible (or - the most commonly used, which 
happens to be the same ;=P) config, the user may then edit the linkerconfig 
for his needs (maybe put some variations in comments)

> Is it allowed to support several supervision targets?

maybe you also want to look at the atari stuff and see how they support 
several different targets with just one config? having several configs for 
the same target (ie, computer) would probably be kinda overkill... (offhand, 
i could probably come up with 10+ configs just for the c64 :=))

> PS: I attached my work files
> (how must I deliver/integrate supervision support in cc65?)

just bring it to useable state and then get in touch with UZ....worked for me 
so far :o) 

> (some remarks about my first cc65 usage?)

after a quick look.... seems to be ok overall... some tips though

- have a look at the conio-interface and design your screen i/o stuff like 
that... might make some things easier in the future
- use seperate files for each function, that will reduce the overhead when 
linking a larger library 


gpz


----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-09-22 16:08:59 CEST