Post by hydrophilic on Mar 9, 2015 6:37:02 GMT
So I tried your latest BIN (ROM) image in VICE 2.2 as an internal function ROM.
First I tried 40-column (because you said OK)....
well it works, and scans disks...
Next, I set VICE break-point at $8003 and did reset...
Monitor (VICE Monitor... not C128 MONITOR) popped up...
I examined MMU main config ($ff00) and it was $16.
Upon examining my source code for MMU, I discovered error by me!
My source code has (or did have) same binary values for both "mid rom" ($8000~$bfff) and "high rom" ($c000~$ffff)
After seeing how Miro's internal ROM works, I consulted my C128_RPG (to verify) and then corrected my source code:
MMU.src (3.78 KB)
Anyway, now I can say that MMU_CR ($FF00) value $16 is this:
- $10 (%0001_0000) = function ROM high ($c000~$ffff)
- $04 (%0000_0100) = function ROM mid ($8000~$bfff)
- $02 (%0000_0010) = no ROM low (no BASIC $4000~7fff)
Also important is that bit 0 (value $01) is *not* set (if it were set, MMU_CR would be $17)... this means I/O registers appear $d000~$dfff.
So, non-standard MMU_CR of $16 means this:
$0000 ~ $7FFF = RAM Bank 0
$8000 ~ $CFFF = function ROM
$D000 ~ $DFFF = I/O
$E000 ~ $FFFF = function ROM
I followed CPU execution through copy of ROM to $1300~15FF region... all good
(remember all above was my 40-column test which Mirkosoft said is good)
(oh yeah, "function ROM" means internal socket of C128 [not external cartridge])
Next I set VICE to "80-column mode" (press 40/80 key [F7 on PC]) and did reset...
Once again, when ROM code starts at $8003, VICE Monitor opens. I see that once again, MMU_CR ($ff00) has value $16.
So far, the same... next code is copied from ROM to $1300 RAM.
So far, the same... next verified 80-column text
PRESS SPACE FOR OPTIONS
ESC TO CANCEL SCAN
is displayed...
Next I traced CPU through test of drives $08 through $1f... okay...
After all drives, code at $13a3 executes...
Call to ROM $F75C (stores .A = $c0 into $90)
Zero keyboard buffer
Call $1550 (reset $fb and $fd to #8, reset $fc to #0)
Load A with $30 ("0") and jumps to "BOOT" ($ff53)
After that, 80-column VICE starts with BASIC.
In summary, my testing of VICE shows your ROM/BIN works fine as internal (function) ROM in both 40 and 80 column screens!
No problem!
Please note, in my setup, I only had 1 disk drive (emulated 1571 as drive 8).
Maybe you have different configuration? Please describe!
Finally... not a bug, but an optimization...
At the end of your code, you do JMP _BOOT_... if no bootable disk is in the drive, then BASIC will start... first thing BASIC does (after initialize) is call _BOOT_... in other words, if no bootable disk, then _BOOT_ is called twice (very slow... especially with a "flippy" disk in 1571 drive). I humbly suggest you simply RTS at the end... BASIC will automatically call _BOOT_ for you!