|
Post by mirkosoft on Jan 13, 2015 17:59:21 GMT
Hi!
I created few ROMs to use with VICE, sometimes were not working but few of them yes. Now I need to test ROM before I burn it and VICE 2.4 and nightly builds later works not with: Routine in 32K ROM copies data to RAM and have to execute them, but copying is done and no action. Look at this code:
cold_start_vector:
nop nop
nop
warm_start_vector:
jmp start
id:
.byte $ff // autostart has to be 1, but I changed it by examining Servant ROM and leave $FF
sign:
.byte $c3, $c2, $cd // CBM - characters with bit 7 on
start: ldx #00
copy: lda program,x
sta $1300,x
inx
bne copy
fncopy: lda fnkeys,x
sta $1000,x
inx
bne fncopy
jmp $1300 <======= this is not executed all above works, but this not
Can anybody help me where I do mistake and execution of copied routine at $1300 is never executed? Really are data copied, but execution is not performed...
Thank you for all.
Miro
|
|
|
Post by hydrophilic on Jan 14, 2015 7:10:11 GMT
I do not understand... is this code for C128 EPROM (function ROM [empty C128 socket]) and/or C128 cartridge (external ROM) ? Looking at your code it seems designed for Cartridge... but I am not sure!
|
|
|
Post by cthulhu on Jan 14, 2015 10:45:57 GMT
I'm doing this a little differently (for an internal function ROM):
*= $8000 ; ; Function ROM Header ; jmp start ; Cold start entry point (3 bytes long) .byt $d2 ; Warm start (3 bytes long) .byt $d7 .byt $d7 .byt $b4 ; ROM ID .asc "cbm"
Routine at start prints a welcome message and binds a menu of options to the HELP key (basically it's a list of programs in ROM which are then copied to RAM and executed).
|
|
|
Post by mirkosoft on Jan 14, 2015 20:48:38 GMT
Hi!
Tried. Even more wrong - VICE hangs. I need to create internal or external function ROM - socket U36 or REU...
Miro
|
|
|
Post by mirkosoft on Jan 14, 2015 21:26:49 GMT
Sadly must to say that VICE works not. At least v2.4 and newer. I was directly following this (found in Megabit Adapter documentation):
During the power up or reset routine your computer will look for CBM at the beginning of Internal ROM $8000 or $C000. Here is what it will look like:
Bytes Description ----------------- x000-02 Cold start entry x003-05 Warm start entry x006 ID byte $00 for due nothing, anything else for auto-start x007-09 “CBM” string
Note: x = $8 (middle) or $C (high)
$8000 EA EA EA 4C 0A 80 FF 43 42 4D $8000 NOP ;COLD START $8001 NOP $8002 NOP $8003 JMP $800A ;WARM START $8006 FF ;ID, $00 OR $01 $8007 ‘CBM’ ;CBM STRING $800A ;START OF PGM
|
|
|
Post by cthulhu on Jan 15, 2015 8:38:11 GMT
Sadly must to say that VICE works not. At least v2.4 and newer. I'm using VICE 2.4.6 under linux / x86_64 and it works. If you will, post here youre ROM binary and I'll give it a try.
|
|
|
Post by mirkosoft on Jan 16, 2015 5:28:18 GMT
OK, D81 is for to be sure that works - it has BOOT.CFG file which starts attached PRG Attachments:booterrom.bin (32 KB)
bootdisk.d81 (800 KB)
|
|
|
Post by hydrophilic on Jan 16, 2015 6:25:04 GMT
I download your "booterrom.bin" file and attach to VICE as Function ROM (I do not have EPROM burner to test real hardware).
I used VICE debugger... set break point to $800a and reset emulated machine. Here is what happens: - KERNAL starts code at $800a
- Code is copied to $1300
- Data is copied to $1000
- CPU does JMP $1300
- Data (code?) is copied to $1500
- At $1313 attempt is made to JSR $F75C... but it crashes!
When the JSR at $1313 occurs, the MMU has value $16 for register $ff00... I don't know what BANK this corresponds with, but obviously the ROM you want is not available. I suggest you update your code to enable KERNAL (for example, LDA #0; STA $ff00). If you do that, JSR $F75C might work!
|
|
|
Post by cthulhu on Jan 16, 2015 10:00:37 GMT
I can confirm what hydrophilic said, it's probably only a MMU config issue.
|
|
|
Post by mirkosoft on Jan 16, 2015 21:07:52 GMT
Thank you boys! I used what Robert wrote and it works - it was only in MMU config!
Really thank you! Now I'm sure to burn it and use on real DCR.
Miro
|
|