mark working
----------- Digital Equipment Corporation VT240 [Carl] vt240: fix scroll and complement (nw) plugins/cheat: add simple cheat file format (nw)
This commit is contained in:
parent
24d749545c
commit
62f2777ce2
@ -71,7 +71,6 @@ function cheat.startplugin()
|
|||||||
|
|
||||||
local function load_cheats()
|
local function load_cheats()
|
||||||
local filename = emu.romname()
|
local filename = emu.romname()
|
||||||
local json = require("json")
|
|
||||||
local newcheats = {}
|
local newcheats = {}
|
||||||
local file = emu.file(manager:machine():options().entries.cheatpath:value():gsub("([^;]+)", "%1;%1/cheat") , 1)
|
local file = emu.file(manager:machine():options().entries.cheatpath:value():gsub("([^;]+)", "%1;%1/cheat") , 1)
|
||||||
if emu.softname() ~= "" then
|
if emu.softname() ~= "" then
|
||||||
@ -81,7 +80,7 @@ function cheat.startplugin()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function add(addcheats)
|
local function add(addcheats)
|
||||||
if not next(newcheats) then
|
if not next(newcheats) then
|
||||||
newcheats = addcheats
|
newcheats = addcheats
|
||||||
else
|
else
|
||||||
@ -90,6 +89,7 @@ function cheat.startplugin()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
local json = require("json")
|
||||||
local ret = file:open(filename .. ".json")
|
local ret = file:open(filename .. ".json")
|
||||||
while not ret do
|
while not ret do
|
||||||
add(json.parse(file:read(file:size())))
|
add(json.parse(file:read(file:size())))
|
||||||
@ -101,6 +101,12 @@ function cheat.startplugin()
|
|||||||
add(xml.conv_cheat(file:read(file:size())))
|
add(xml.conv_cheat(file:read(file:size())))
|
||||||
ret = file:open_next()
|
ret = file:open_next()
|
||||||
end
|
end
|
||||||
|
local simp = require("cheat/simple_conv")
|
||||||
|
ret = file:open("cheat.simple")
|
||||||
|
while not ret do
|
||||||
|
add(simp.conv_cheat(filename, file:read(file:size())))
|
||||||
|
ret = file:open_next()
|
||||||
|
end
|
||||||
return newcheats
|
return newcheats
|
||||||
end
|
end
|
||||||
|
|
||||||
|
23
plugins/cheat/simple_conv.lua
Normal file
23
plugins/cheat/simple_conv.lua
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
local simple = {}
|
||||||
|
|
||||||
|
-- converter for simple cheats
|
||||||
|
-- simple cheats are single address every frame ram cheats in one file called cheat.simple
|
||||||
|
-- format: <set name>,<cputag>,<hex offset>,<hex value>,<desc>
|
||||||
|
-- only program address space is supported, comments are prepended with ;
|
||||||
|
function simple.conv_cheat(romset, data)
|
||||||
|
local cheats = {}
|
||||||
|
for line in data:gmatch('([^\n;]+)') do
|
||||||
|
local set, cputag, offset, val, name = line:match('([^,]+),([^,]+),([^,]+),([^,]+),(.+)')
|
||||||
|
if set == romset then
|
||||||
|
local cheat = {}
|
||||||
|
cheat.desc = name
|
||||||
|
cheat.space = { cpup = { tag = cputag, type = "program" } }
|
||||||
|
cheat.script = { run = "cpup:write_u8(0x" .. offset .. ",0x" .. val .. ", true)" }
|
||||||
|
cheats[#cheats + 1] = cheat
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return cheats
|
||||||
|
end
|
||||||
|
|
||||||
|
return simple
|
||||||
|
|
@ -20,7 +20,7 @@
|
|||||||
#include "machine/x2212.h"
|
#include "machine/x2212.h"
|
||||||
#include "video/upd7220.h"
|
#include "video/upd7220.h"
|
||||||
|
|
||||||
#define VERBOSE_DBG 1 /* general debug messages */
|
#define VERBOSE_DBG 0 /* general debug messages */
|
||||||
|
|
||||||
#define DBG_LOG(N,M,A) \
|
#define DBG_LOG(N,M,A) \
|
||||||
do { \
|
do { \
|
||||||
@ -386,45 +386,46 @@ WRITE16_MEMBER(vt240_state::vram_w)
|
|||||||
if(ps == 0)
|
if(ps == 0)
|
||||||
i++;
|
i++;
|
||||||
UINT8 mem = video_ram[(offset & 0x7fff) + (0x8000 * i)];
|
UINT8 mem = video_ram[(offset & 0x7fff) + (0x8000 * i)];
|
||||||
|
UINT8 out = 0, ifore = BIT(m_lu, (i ? 5 : 4)), iback = BIT(m_lu, (i ? 3 : 2));
|
||||||
|
for(int j = 0; j < 8; j++)
|
||||||
|
out |= BIT(chr, j) ? (ifore << j) : (iback << j);
|
||||||
switch(m_lu >> 6)
|
switch(m_lu >> 6)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
chr |= mem;
|
out |= mem;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
logerror("invalid logic unit mode 2\n");
|
logerror("invalid logic unit mode 2\n");
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
chr ^= mem;
|
out ^= ~mem;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
UINT8 out = 0, ifore = BIT(m_lu, (i ? 5 : 4)), iback = BIT(m_lu, (i ? 3 : 2));
|
|
||||||
for(int j = 0; j < 8; j++)
|
|
||||||
out |= BIT(chr, j) ? (ifore << j) : (iback << j);
|
|
||||||
if(!BIT(m_reg0, 3))
|
if(!BIT(m_reg0, 3))
|
||||||
out = (out & ~m_mask) | (mem & m_mask);
|
out = (out & ~m_mask) | (mem & m_mask);
|
||||||
else
|
else
|
||||||
out = (out & data) | (mem & ~data);
|
out = (out & data) | (mem & ~data);
|
||||||
if(BIT(m_reg1, 3))
|
if(BIT(m_reg1, 3))
|
||||||
{
|
{
|
||||||
|
UINT8 out2 = out;
|
||||||
if(BIT(m_reg1, 2))
|
if(BIT(m_reg1, 2))
|
||||||
{
|
{
|
||||||
out = mem;
|
out = video_ram[((offset & 0x7ffe) | 0) + (0x8000 * i)];
|
||||||
video_ram[((m_scrl << 1) | (offset & 1)) + (0x8000 * i)] = out;
|
out2 = video_ram[((offset & 0x7ffe) | 1) + (0x8000 * i)];
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
video_ram[((m_scrl << 1) | 0) + (0x8000 * i)] = out;
|
video_ram[((m_scrl << 1) | 0) + (0x8000 * i)] = out;
|
||||||
video_ram[((m_scrl << 1) | 1) + (0x8000 * i)] = out;
|
video_ram[((m_scrl << 1) | 1) + (0x8000 * i)] = out2;
|
||||||
}
|
|
||||||
m_scrl += BIT(m_reg1, 1) ? -1 : 1;
|
|
||||||
m_scrl &= 0x3fff;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
video_ram[(offset & 0x7fff) + (0x8000 * i)] = out;
|
video_ram[(offset & 0x7fff) + (0x8000 * i)] = out;
|
||||||
}
|
}
|
||||||
|
if(BIT(m_reg1, 3))
|
||||||
|
{
|
||||||
|
m_scrl += BIT(m_reg1, 1) ? -1 : 1;
|
||||||
|
m_scrl &= 0x3fff;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!BIT(m_reg0, 3))
|
if(!BIT(m_reg0, 3))
|
||||||
@ -433,16 +434,14 @@ WRITE16_MEMBER(vt240_state::vram_w)
|
|||||||
data = (chr & data) | (video_ram[offset] & ~data);
|
data = (chr & data) | (video_ram[offset] & ~data);
|
||||||
if(BIT(m_reg1, 3))
|
if(BIT(m_reg1, 3))
|
||||||
{
|
{
|
||||||
|
UINT8 data2 = data;
|
||||||
if(BIT(m_reg1, 2))
|
if(BIT(m_reg1, 2))
|
||||||
{
|
{
|
||||||
data = video_ram[offset];
|
data = video_ram[(offset & ~1) | 0];
|
||||||
video_ram[(m_scrl << 1) | (offset & 1)] = data;
|
data2 = video_ram[(offset & ~1) | 1];
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
video_ram[(m_scrl << 1) | 0] = data;
|
|
||||||
video_ram[(m_scrl << 1) | 1] = data;
|
|
||||||
}
|
}
|
||||||
|
video_ram[(offset & 0x8000) | (m_scrl << 1) | 0] = data;
|
||||||
|
video_ram[(offset & 0x8000) | (m_scrl << 1) | 1] = data2;
|
||||||
m_scrl += BIT(m_reg1, 1) ? -1 : 1;
|
m_scrl += BIT(m_reg1, 1) ? -1 : 1;
|
||||||
m_scrl &= 0x3fff;
|
m_scrl &= 0x3fff;
|
||||||
}
|
}
|
||||||
@ -731,7 +730,7 @@ ROM_START( vt240 )
|
|||||||
ROM_END
|
ROM_END
|
||||||
|
|
||||||
/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */
|
/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */
|
||||||
COMP( 1983, vt240, 0, 0, vt240, vt240, driver_device, 0, "Digital Equipment Corporation", "VT240", MACHINE_NOT_WORKING )
|
COMP( 1983, vt240, 0, 0, vt240, vt240, driver_device, 0, "Digital Equipment Corporation", "VT240", MACHINE_IMPERFECT_GRAPHICS )
|
||||||
//COMP( 1983, vt241, 0, 0, vt220, vt220, driver_device, 0, "Digital Equipment Corporation", "VT241", MACHINE_NOT_WORKING | MACHINE_NO_SOUND)
|
//COMP( 1983, vt241, 0, 0, vt220, vt220, driver_device, 0, "Digital Equipment Corporation", "VT241", MACHINE_NOT_WORKING | MACHINE_NO_SOUND)
|
||||||
// NOTE: the only difference between VT240 and VT241 is the latter comes with a VR241 Color monitor, while the former comes with a mono display; the ROMs and operation are identical.
|
// NOTE: the only difference between VT240 and VT241 is the latter comes with a VR241 Color monitor, while the former comes with a mono display; the ROMs and operation are identical.
|
||||||
COMP( 1983, mc7105, 0, 0, mc7105, vt240, driver_device, 0, "Elektronika", "MC7105", MACHINE_NOT_WORKING )
|
COMP( 1983, mc7105, 0, 0, mc7105, vt240, driver_device, 0, "Elektronika", "MC7105", MACHINE_NOT_WORKING )
|
||||||
|
Loading…
Reference in New Issue
Block a user