Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > MMC Replay Plugin Coding with CC65
2008-06-28 12:46
Monte Carlos

Registered: Jun 2004
Posts: 359
MMC Replay Plugin Coding with CC65

I finally got an MMC Replay with V0.54 Bios and wanted to try out plug in coding. I got some sources by "The-Dreams" with which i can open and receive the file, the plugin is executed on.
They are working so far and i started to convert the sources to CC65 by Ullrich Bassewitz.
I wrote a c header file to wrap the assembler routines written by "The-Dreams" so that i can call these from a c routine.
When i tested out my xxxplgin.bin, which contained just an empty main routine (void main(void)), on a *.xxx file i recognized that the code crashes right inside the init code of the compiled c program (inside crt0.s).
Further experiments showed the "jsr CLRCH" inside "crt0.s" to be responsible for the crashing of the plugin.
When i change the jsr by hand to a bit instruction, the plugin
returns properly to the file browser.
Can anybody with a little experience in MMC Replay plugin programming give me a hint, why the CLRCH routine is not compatible to the MMC Bios although routines like CHROUT work?
Of course i search a way to come around modifying the CC65 startup code.

Thank you

Monte Carlos

2008-06-28 13:55
d0c

Registered: Apr 2006
Posts: 186
go here -> http://retrohackers.com/ all the mmc replay gurus are there....
2008-06-28 15:11
TNT
Account closed

Registered: Oct 2004
Posts: 189
If MMC Replay BIOS is like MMC64 one then it doesn't init kernal before calling plugins. Try doing it yourself, something like this:
Init
	sei

	ldx	#0
.1	lda	0,x
	sta	ZPbuf,x
	inx
	bne	.1

	lda	#$2f
	sta	0
	lda	#$36
	sta	1

	txa
.2	sta.xw	2,x
	sta	$0200,x
	sta	$0300,x
	inx
	bne	.2

	jsr	$fda3			; init I/O
	lda	#$ff			; keyboard flag
	sta	$91
	ldy	#$a0
	jsr	$fd8c			; top of memory, start of basic, screen position
	jsr	$fd15			; $0314..$0333
	jsr	$ff5b			; rest of kernal init

2008-06-28 20:11
Monte Carlos

Registered: Jun 2004
Posts: 359
Ok, thank you for the answer. I copied your assembler code into my one and tried it out.
I got the same result. The plugin gets started by the filebrowser (i added an inc $d020 before any other code is executed), but as long i haven't disabled the jsr $ffcc with a bit $ffcc instruction the code crashes and does not return.
When i compile my program and modify the jsr $ffcc to bit $ffcc using a hex editor, everything works fine.
Meanwhile i looked into the code of "The-Dreams" a little deeper and found, that they use a jsr $ffcc, too.
So this by itself can't be the reason for the malfunction.
Sorry, that i'm insisting on this so much, but i found it better to have all the c library together with the mmc functions avaiable not only for me, but to all CC65 users.
So i decided to try porting the code of Doc Bacardi / The Dreams to c instead of using only assembler.

Greetings Monte Carlos
2008-06-29 22:41
AlexC

Registered: Jan 2008
Posts: 299
You might come across many different and strange issues using C compiler. I remember people having some problems with IO for example. I would stick to plain assembly language.
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Alakran_64
Mike
TheRyk/MYD!
Mibri/ATL^MSL^PRX
MWR/Visdom
DanPhillips
Rub_0201
LKP/CFN
megasoftargentina
Kakka/Extend, Damone..
Francois Prijt/Audia..
Guests online: 116
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 Tim  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.051 sec.