Hi!
I'm here new and really didn't knew where to place this topic.
I'm 128er and for VICE emulator I created internal ROM for C128 and tried to create C64 cartridge for Commodore 64 emulator.
In menu attach cartridge is possible to attach Generic, but only Game or Max cartridge, so my knowledge is lost.
So, later I tried to convert generic cartridge (created by instructions in C128 manual) to CRT by cartconv of VICE, conversion was succesfull.
But now again C64 cartridge works not, C128 internal works.
So, where I do the mistake? Cartridge hangs computer. Cartridge purpose is for execute Z80 code without writting handler, simply call POKE780,LO:POKE781,HI:SYS40000
Code
- *=$8000
- .byte $09, $80 ; Cold start vector
- .byte $09, $80 ; Warm start vector
- .byte $C3, $C2, $CD, $38, $30 ; C64ID
- begin: sei
- jmp start
- start: nop
- nop
- rts ; @ $8009
- *=$9c40 ; SYS40000,lo,hi
- z8064:
- sta lo ; store LO-byte for Z80 routine call
- txa
- sec
- sbc #$10 ; convert HI byte to Z8064 addressing
- sta hi ; store HI-byte for Z80 routine call
- ldx #00
- loop:
- lda z8064start,x
- sta $1000,x ; copy Z8064 start routine to x65 $1000 / x80 $0000
- inx
- cmp #$ff
- bne loop
- lda lo
- ldx hi
- sta $1002 ; place LO-byte to copied Z8064 code
- stx $1003 ; place HI-byte to copied Z8064 code
- lda 53432 ; get current SCPU speed
- sta speed
- lda #00 ; slow down
- sta 53370 ; to 1MHz
- lda #00 ; switch
- sta $de00 ; to Z80
- nop
- lda speed
- cmp #1
- bne exit
- lda #00 ; speed up
- sta 53371 ; to 20MHz
- exit:
- rts
- speed:
- .byte 0
- lo:
- .byte 0
- hi:
- .byte 0
- z8064start:
- .byte $00, $cd, $00, $00, $3e, $01, $32, $00, $ce, $00, $c3, $00, $00, $ff
- ;Z8064CALL
- ; CALL $0000 ; JSR subroutine
- ; LD A, 1 ; switch to
- ; LD ($ce00),A ; switch to X65K
- ; NOP
- ; JP $0000 ; after CPU switch pointer is here, so jump to execute subroutine again
- *=$9fff ; 8K Cartridge
- .byte 0
And I attached CRT image.
I hope anybody helps.
Miro