SPEEDY ====== Speeding up a C128 in C64 mode This code turns C128 into 2MHz when VIC is in the border rasters. You can invoke it by jumping to the $c000, and to turn into normal mode you have to jump to $c003. That is: sys49152 : speedy is in charge sys49155 : speedy is terminated You have to terminate speedy, whenever you want to access disk drives or serial printers and such timing critical sections. You can use this utility within your programs with a c128 detection. Your program decides whether it is running on a stock c64 or a c64 mode of a c128 and if it's c128 the code calls speedy when necessary. Speedy increases the performance by 40% approximately. The measurements with MIPS program shows that: speedy is off : 0.365 mips speedy is on : 0.511 mips 0.511 / 0.365 - 1.0 = 0.4 = 40% Here is the disassembled code of Speedy ;; ;; jump table: ;; c000 : speedy is on ;; c003 : speedy is off ;; . ., C000 4C 06 C0 JMP $C006 ., C003 4C 58 C0 JMP $C058 ., C006 78 SEI ., C007 A9 28 LDA #$28 ., C009 8D 14 03 STA $0314 ., C00C A9 C0 LDA #$C0 ., C00E 8D 15 03 STA $0315 ., C011 A9 01 LDA #$01 ., C013 8D 1A D0 STA $D01A ., C016 8D 0D DC STA $DC0D ., C019 A9 FA LDA #$FA ., C01B 8D 12 D0 STA $D012 ., C01E AD 11 D0 LDA $D011 ., C021 29 7F AND #$7F ., C023 8D 11 D0 STA $D011 ., C026 58 CLI ., C027 60 RTS ;; ;; interrupt vector #1 (beginning of the border) ., C028 A9 01 LDA #$01 ., C02A 8D 30 D0 STA $D030 ., C02D A9 32 LDA #$32 ., C02F 8D 12 D0 STA $D012 ., C032 A9 3D LDA #$3D ., C034 8D 14 03 STA $0314 ., C037 EE 19 D0 INC $D019 ., C03A 4C 31 EA JMP $EA31 ;; ;; interrupt vector #2 (beginning of the visible screen) ., C03D A9 00 LDA #$00 ., C03F 8D 30 D0 STA $D030 ., C042 A9 FA LDA #$FA ., C044 8D 12 D0 STA $D012 ., C047 A9 28 LDA #$28 ., C049 8D 14 03 STA $0314 ., C04C EE 19 D0 INC $D019 ., C04F 4C 81 EA JMP $EA81 ., C052 00 BRK ., C053 00 BRK ., C054 00 BRK ., C055 00 BRK ., C056 00 BRK ., C057 00 BRK ;; ;; turning into normal speed, and tidying up the timing ;; you have to call this routine if you want to access serial port. ., C058 78 SEI ., C059 A9 31 LDA #$31 ., C05B 8D 14 03 STA $0314 ., C05E A9 EA LDA #$EA ., C060 8D 15 03 STA $0315 ., C063 A9 00 LDA #$00 ., C065 8D 1A D0 STA $D01A ., C068 A9 00 LDA #$00 ., C06A 8D 0D DC STA $DC0D ., C06D 8D 0E DC STA $DC0E ., C070 8D 0F DC STA $DC0F ., C073 A9 1A LDA #$1A ., C075 8D 04 DC STA $DC04 ., C078 A9 41 LDA #$41 ., C07A 8D 05 DC STA $DC05 ., C07D A9 01 LDA #$01 ., C07F 8D 0E DC STA $DC0E ., C082 A9 81 LDA #$81 ., C084 8D 0D DC STA $DC0D ., C087 58 CLI ., C088 60 RTS ., C089 00 BRK ., C08A 00 BRK ., C08B 00 BRK . Ilker Ficicilar filker@newton.physics.metu.edu.tr e068214@orca.cc.metu.edu.tr ---