With Schema's method I successfully converted one of my games (TRON Light Cycles) into cartridge format. I had a leftover Personal Finance cartridge handy, onto which I crossed the lines A11 and A12, and then replaced the ROM chip with a programmed 2732 EPROM:
This method is a slightly unusual way to drive the EPROM: A12 drives CS, and that line is active low on the lower half of each 8K block. Oh well. And the BLK5 signal (which normally is tied to CS) drives OE instead. And A11 ends up at the right pin. It just happens to function.
Since EPROM burner (at work) and VIC-20 (at my parents home) are away at ~600 km distance, everything needed to be correct. At least I could test the cartridge image within VICE. As regards hardware, I had only one try. Surely enough, it works!
This is the code I use to start the BASIC program in the cartridge. Most of it is copied from the RESET routine, with some alterations, to make it insensitive to RAM expansions. Also STOP and STOP/RESTORE are disabled. It can be easily adjusted for programs up to 3.5K length.
Greetings,
Michael
Edit: Here's the EPROM image for download (link). To run it in VICE, attach it at $A000 and press Alt+R.
Code: Select all
>A000 10 A0 ; Reset Vector
>A002 09 A0 ; NMI Vector
>A004 41 30 C3 C2 CD ; A0CBM Signature
.A009 2C 11 91 BIT $9111 ; Acknowledge NMI
.A00C 4C 56 FF JMP $FF56 ; End NMI
.A00F EA NOP
.A010 20 8D FD JSR $FD8D ; RAMTAS
.A013 A9 10 LDA #$10 ; Force BASIC into
.A015 8D 82 02 STA $0282 ; unexpanded RAM
.A018 A9 1E LDA #$1E ; ...
.A01A 8D 84 02 STA $0284 ; ...
.A01D 8D 88 02 STA $0288 ; ...
.A020 20 52 FD JSR $FD52
.A023 A9 C2 LDA #$C2 ; Disable
.A025 8D 14 03 STA $0314 ; STOP key
.A028 20 F9 FD JSR $FDF9
.A02B 20 18 E5 JSR $E518
.A02E 58 CLI
.A02F 20 5B E4 JSR $E45B
.A032 20 A4 E3 JSR $E3A4
.A035 A2 FB LDX #$FB
.A037 9A TXS
.A038 A9 00 LDA #$00 ; *disable* OS messages
.A03A 20 90 FF JSR $FF90 ; (-> program mode)
.A03D A9 00 LDA #$00 ; Copy from ...
.A03F A8 TAY
.A040 85 FB STA $FB
.A042 85 FD STA $FD
.A044 A9 A8 LDA #$A8 ; &A800 to ...
.A046 85 FC STA $FC
.A048 A9 10 LDA #$10 ; &1000 ...
.A04A 85 FE STA $FE
.A04C A2 08 LDX #$08 ; ... 8 pages.
.A04E B1 FB LDA ($FB),Y
.A050 91 FD STA ($FD),Y
.A052 C8 INY
.A053 D0 F9 BNE $A04E
.A055 E6 FC INC $FC
.A057 E6 FE INC $FE
.A059 CA DEX
.A05A D0 F2 BNE $A04E
.A05C A9 B4 LDA #$B4 ; End of program a.k.a.
.A05E 85 2D STA $2D ; start of variables at
.A060 A9 17 LDA #$17 ; &17B4
.A062 85 2E STA $2E
.A064 20 59 C6 JSR $C659 ; CLR, reset TXTPTR
.A067 4C AE C7 JMP $C7AE ; Execute next statement
; ("RUN")