From 9993f22dfededfbe314cb748516f2573f53804b7 Mon Sep 17 00:00:00 2001 From: g012 Date: Mon, 25 Sep 2017 13:20:04 +0200 Subject: [PATCH] Added more VCS mappers. --- vcs.l65 | 45 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/vcs.l65 b/vcs.l65 index 7d54074..f4161c3 100644 --- a/vcs.l65 +++ b/vcs.l65 @@ -97,13 +97,13 @@ mappers['4K'] = function() section{"vectors", org=0xfffc} word(main,main) end -local bank_stubs = function(count, hotspot) +local bank_stubs = function(count, hotspot, entry) function switchrom(i) assert(i>=0 and i=0 and i=0 and i=0 and i<128) lda#i sta 0x3c+i end + _ENV['switchram'..i] = function(i) assert(i>=0 and i<128) lda#i+0x80 sta 0x3c+i end + end + for bi=0,rom_count-1 do + local o = bi*0x400 + 0x1000 + _ENV["rom"..(count-1-bi)] = location{o, 0x3ff+o, rorg=0xf000+(o&0xfff)} + end + local start=section("entry") switchrom3(0) jmp main + section{"vectors", org=0xfffc} word(start,start) +end + +mappers.X07 = function() + function switchrom(i) assert(i>=0 and i<16) bit 0x80b+(i<<4) end + -- map TIA also to 0x40-0x7F: use VSYNC for bank 14, and VSYNC2 for bank 15 + vcs.VSYNC2=0x40 cpu.symbols.VSYNC2=0x40 + for bi=0,count-1 do + local o = bi*0x1000 + 0x1000 + _ENV['rom' .. bi] = location{o, o+0xfff, rorg=0xf000} + local start=section{"entry"..bi, org=o+0xffc-6} switchrom(0) if bi==0 then jmp main end + section{"vectors"..bi, org=o+0xffc} word(start,start) + end +end