Die Routine ist ja in Assembler...
Ich such dir grad mal die Ausschnitte aus, die du brauchst...
Einige Sachen, wie Bankswitching, habe ich hier nicht berücksichtigt, das wirst du bestimmt selber wissen, das musst du hier also abändern
Falls dein Compiler "repeat" und "rend" nicht kennt: Du benötigst hier 80x LDI
;
; SCRCOPY - Copy the Screen line by Line for Re-Rendering
;
ScreenCopy:
or a ; Has any Parameter Been Passed?
jp z,BankOutOfRange ; Check we are in Range of Memory Banks Available
call bank ; Switch in the Selected bank.
ld de,#4000
call PreCalculateScreenAddress; Ensuire not corrupted
DI ; Disable Interrupts
ScreenCopy1:
ld (RestoreSP1),sp ; Save Stack Pointer
ld sp,scrAddrTable+2 ; Point to the Bottom of the Pre-Calculated Stack
ld a,200 ; 200 Lines of Screen
ScreenCopyLoop:
pop HL
;
; LDI Stack - Quicker at loading memory at fixed 16 T-States per insturction
;
LDI80
repeat 80
LDI
rend
dec a ; decrease counter
jp nz,ScreenCopyLoop
ld sp,0000 ; Restore Stack Pointer
RestoreSP1 equ $-2
EI ; Enable interrupts again.
ret
;
; Paste the Screen with data from the buffer at #4000
;
ScreenPaste:
or a ; Has any Parameter Been Passed?
jp z,BankOutOfRange
ld hl,ScreenPasteLoop
cp 1 ; One Paramater Passed?
jr z,ScreenPaste1 ; Increment IX
ld hl,ScreenPasteLoopSync ; Which Routine?
inc ix
inc ix
ScreenPaste1
ld (PasteWithFlyback),hl ; Set Proper Routine
call Bank ; Set the correct bank to paste from
call PreCalculateScreenAddress ; Gets Corrupts
DI
ld HL,#4000
ld (RestoreSP2),sp ; Save Stack Pointer
ld sp,scrAddrTable+2 ; Point to the Bottom of the Pre-Calculated Stack
ld a,200 ; 200 Lines of Screen
ScreenPasteLoopSync:
PUSH AF
call frameFly
pop AF
ScreenPasteLoop:
pop DE
;
; LDI Stack - Quicker at loading memory at fixed 16 T-States per insturction
;
LDI80b
repeat 80
LDI
rend
dec a ; decrease counter
jp nz,ScreenPasteLoop
PasteWithFlyback equ $-2
ld sp,0000 ; Restore Stack Pointer
RestoreSP2 equ $-2
EI ; Enable interrupts again.
ret