|
|
|
|
| 5 | LET start=50000: REM You may select any address |
| 10 | FOR f=start TO start+19: READ a: POKE f,a: NEXT f |
| 20 | DATA 167, 237, 0, 56, 48, 56, 54, 48, 7, 48, 7, 137, 225, 205, 250, 201, 1, 0, 0, 201 |
| 30 | PRINT USR start |
| 13788: | Release 2.51, 48K |
| 14556: | Release 2.51, 128K |
| 16700: | Release 2.51, TS2068 |
| 13756: | Release 2.5, 48K |
| 14524: | Release 2.5, 128K |
| 16684: | Release 2.5, TS2068 |
| 13532: | Release 2.0, 48K |
| 14284: | Release 2.0, 128K |
| 11868: | Release 1.5, 48K |
| 12316: | Release 1.5, 128K |
|
|
| 10 | LET start=30000: REM You may select any address |
| 20 | RESTORE : FOR f=start TO start+47: READ a: POKE f,a: NEXT f |
| 30 | DATA 237, 0, 56, 48, 56, 54, 6, 185, 255, 255, 51, 255, 22, 7, 184, 154, 0, 175, 117, 7, 38, 129, 61, 100, 0, 116, 6, 79, 226, 243, 235, 12, 144, 38, 199, 69, 254, 154, 0, 38, 199, 5, 100, 0, 7, 205, 250, 201 |
| 40 | INPUT "Speed in % : ";speed |
| 50 | LET factor=2*(1+INT (7636/speed+0.5)) |
| 60 | POKE start+37,factor-256*INT (factor/256): POKE start+38,INT (factor/256) |
| 70 | POKE start+42,speed-256*INT (speed/256): POKE start+43,INT (speed/256) |
| 80 | RANDOMIZE USR start |
| 90 | POKE start+15,PEEK (start+37): POKE start+16,PEEK (start+38) |
| 100 | POKE start+23,PEEK (start+42): POKE start+24,PEEK (start+43) |
| 110 | BEEP 1,0: REM This is an example... |
| 120 | GO TO 40 |
push es
mov cx,-1
xor di,di
push ss
pop es
mov ax,OldFactor
SRCH: scasw
jne CONT
cmp word ptr es:[di],OldPercent
jz FOUND
CONT: dec di
loop SRCH
jmp END
FOUND: mov word ptr es:[di-2],NewFactor
mov word ptr es:[di],NewPercent
END: pop es
int 250
Line 50 in the BASIC program calculates time constant named "factor", which is
needed for speed compensation loop, and lines 60 and 70 patches constants
"NewFactor" and "NewPercent" into the machine code.
After calling the machine
code, lines 90 and 100 patches constants "OldFactor"
and "OldPercent" with
"NewFactor" and "NewPercent", else next running of the
machine code will not
success to locate necessary variables. If you want to change speed only once,
these POKE's may be omitted. At last, line 110 is simple demo to see that the
execution speed is really changed.
|
|
var f1,f2:text;
i:word;
c:char;
s:string;
begin
write('Filename: '); readln(s);
assign(f1,s+'.rom'); reset(f1);
assign(f2,s+'.z80'); rewrite(f2);
write(f2,#0#0#0#0#0#0#1#0#0#0#0#0);
write(f2,#32#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0);
for i:=1 to 192 do
write(f2,#237#237#255#0);
write(f2,#237#237#192#0);
for i:=1 to 16384 do begin
read(f1,c); write(f2,c)
end;
close(f1); close(f2)
end.
We will not explain how it works. Look the description of the Z80 file format, and try
to understand how by yourself!
|
|
|
|
|
|
|
|
di ld a,7 ; Enable Derby ROM i RAM 7 ld bc,32765 out (c),a ld (23388),a ld de,23296 ; Restore paging subroutines ld hl,107 ld bc,88 ldir ld a,207 ; Restore RAMRST ld (23389),a ld a,16 ; b4=1 in 23611 => 128K mode ld (23611),a jp 519 ; Jump into the main 128K entry point
|
|