Well I did almost the same.
I had the Z80 source code of the AGD engine, luckily well documented by Jonathan Cauldwell, and wrote a kind of script file which replaced the Z80 code with 6502 code.
This wasn't optimal but in theory it should work, the converted code looked like this:
Code: Select all
; 29.03.05 ld l, 0
lda #0
sta z80_l
; 29.03.05 ld b, 64
lda #64
sta z80_b
; 29.03.05 ld c, 6
lda #6
sta z80_c
; 29.04.00 ld ix, spritemenu
lda #<(spritemenu)
sta z80_x
lda #>(spritemenu)
sta z80_i
; 04.00.xx call largeSprite
jsr largeSprite
The next step was, like you did, step the code line by line check and try to optimize it.
When that was done, the AGD compiler had to be upgraded because it was Z80 code based.
This was relative easy because the AGD compiler reads a command from the AGD file and outputs assembler code.
All you have to do is replace a few lines of Z80 code with 6502 code per command.
And then ....... the debugging starts.
This takes a long time but it's nice to see the progress until .... a game starts running.
That's a very nice feeling.
I don't have any knowledge of the 6809 assembler but hopefully there's someone willing to take the above steps to get AGD ported to the Dragon.
I'm willing to help where I can.
As I said, there are 150 games written for AGD and the number is growing so a lot of games will become available.
Greetings
Kees