Post by jmpff3d on Oct 29, 2018 1:15:27 GMT
Ice.128 v0.1 (ROM modifications) by XmikeX - 28 October 2018
csdb.dk/release/?id=170697
Using your C128 as a Poor Man's 64mode Freezer Cartridge!
--
* Requirements: replace basiclo and kernal ROMS (emu or real 128) with filedata provided in Ice.128.v01.zip
Use the new ICE Command in BASIC, type "Y" or "YES" at GO ICE64? prompt.
In 64mode, load up your 64-side stuff then use reset button to return to 128 mode.
Use C128 and its ML Monitor to inspect 64-side now residing in the second 64k ram block (block1).
--
Changes to 1986 AD stock roms, as follows:
I believe The Servant ROM also has this mmu 'freezer' configuration for 64mode. Mind you, a ROM modification is not necessary for C128 to dive into 64mode with the mmu config as listed above. Those functional mmu portions can be re-done from anywhere in ram, as follows.
Also, under normal conditions @ C128, bank1 mmu config should not be assumed to make available all of ramblock 1 (the 'alternate' 64k ramblock). .. in fact, a quicker way to do this 'freezer' is to ignore stuff under $0400 - it's less code then, as follows:
The original source behind the MMU 64mode Freezer Configuration idea is unknown to me. I am aware of this idea coming about several times in the past, most notably in The Servant ROM from 1992 (for C128's extra rom socket).
The rest of the ROM modifcation was an exercise in hunting / pecking through descriptions of the C128 basic/kernal map, and then of course seeing what was actually there in hexbytes !
Cheers !
csdb.dk/release/?id=170697
Using your C128 as a Poor Man's 64mode Freezer Cartridge!
--
* Requirements: replace basiclo and kernal ROMS (emu or real 128) with filedata provided in Ice.128.v01.zip
Use the new ICE Command in BASIC, type "Y" or "YES" at GO ICE64? prompt.
In 64mode, load up your 64-side stuff then use reset button to return to 128 mode.
Use C128 and its ML Monitor to inspect 64-side now residing in the second 64k ram block (block1).
--
Changes to 1986 AD stock roms, as follows:
; basiclo ROM modications
>f46b9 53 57 41 d0 49 43 c5 46:swaPicEf ; replace ofF with icE .. this means OFF command no longer exists in this mod.
; unimplemented OFF and QUIT commands vector here at $4846, so in this mod ICE and QUIT will activate freezer, and OFF no longer exists.
. f4846 a2 28 ldx #$28 ; this ldx becomes useless in this modification but we leave it alone.
. f4848 4c 19 cf jmp $cf19 ; point to "GO ICE64?" and MMU config code, instead of $4d3c as before.
-- ; in original basiclo ROM, $4d3c leads to ?UNIMPLEMENTED COMMAND ERROR
; kernal ROM modifications - in 1986 kernal rom, a fair amount of unused empty bytes start at $cf19
; setup code for "GO ICE64?" option, MMU config, and switch to 64mode.
. fcf19 78 sei ; disable IRQs
. fcf1a a2 00 ldx #$00 ; we could have ldx #$00 at $4846 but we didn't, too bad.
. fcf1c bd 4d cf lda $cf4d,x ; collect data at $cf4d for printout by $ffd2 kernal routine
. fcf1f f0 06 beq $cf27
. fcf21 20 d2 ff jsr $ffd2 ; kernal routine which prints out the data from $cf4d onwards
. fcf24 e8 inx
. fcf25 d0 f5 bne $cf1c
. fcf27 58 cli ; re-enable IRQs - needed for keyboard input @ BASIN routine ($ffcf)
. fcf28 20 cf ff jsr $ffcf ; BASIN routine for input, it waits for keyboard input and returns value in accumulator
. fcf2b c9 59 cmp #$59 ; "y" from keyboard .. BASIN will accept "y" followed by other chars.. so "yes" will work
. fcf2d f0 03 beq $cf32
. fcf2f 60 rts ; return from subroutine if user-input is anything but "y"...etc
. fcf30 ea nop ; nops left behind during testing, in case bytes needed to be refilled in a hurry
. fcf31 ea nop ;
; please consult with the MMU BitSwitch Guide for the segment below
; MMU BitSwitch Guide - https://pastebin.com/Wh2EKdwt
. fcf32 78 sei ; prepare 64mode with new MMU rambank freezer configuration
. fcf33 a9 40 lda #$40
. fcf35 8d 00 ff sta $ff00
. fcf38 a2 01 ldx #$01
. fcf3a 8e 0a d5 stx $d50a
. fcf3d 8e 09 d5 stx $d509
. fcf40 8e 08 d5 stx $d508
. fcf43 ca dex
. fcf44 8e 07 d5 stx $d507
. fcf47 8d 06 d5 sta $d506
. fcf4a 4c 4d ff jmp $ff4d ; jump to 64mode !
; data displayed by $ffd2 kernal routine
>fcf4d 0d 43 31 32 38 20 41 53:.c128 as
>fcf55 20 46 52 45 45 5a 45 52: freezer
>fcf5d 20 43 41 52 54 0d 47 4f: cart.go
>fcf65 20 49 43 45 36 34 3f 00: ice64?.
I believe The Servant ROM also has this mmu 'freezer' configuration for 64mode. Mind you, a ROM modification is not necessary for C128 to dive into 64mode with the mmu config as listed above. Those functional mmu portions can be re-done from anywhere in ram, as follows.
. f2f32 78 sei
. f2f33 a9 40 lda #$40
. f2f35 8d 00 ff sta $ff00
. f2f38 a2 01 ldx #$01
. f2f3a 8e 0a d5 stx $d50a
. f2f3d 8e 09 d5 stx $d509
. f2f40 8e 08 d5 stx $d508
. f2f43 ca dex
. f2f44 8e 07 d5 stx $d507
. f2f47 8d 06 d5 sta $d506
. f2f4a 4c 4d ff jmp $ff4d
g f2f32
Also, under normal conditions @ C128, bank1 mmu config should not be assumed to make available all of ramblock 1 (the 'alternate' 64k ramblock). .. in fact, a quicker way to do this 'freezer' is to ignore stuff under $0400 - it's less code then, as follows:
LDA #$40
STA $FF00 :bank 15 with RAM Blocl 1
ORA $D506 :VIC/REU use RAM Block 1
STA $D506 :keep 1kb Common RAM at bottom
JMP $FF4D :KERNAL go 64
The original source behind the MMU 64mode Freezer Configuration idea is unknown to me. I am aware of this idea coming about several times in the past, most notably in The Servant ROM from 1992 (for C128's extra rom socket).
The rest of the ROM modifcation was an exercise in hunting / pecking through descriptions of the C128 basic/kernal map, and then of course seeing what was actually there in hexbytes !
Cheers !