Skip to content

Commit 7ae6af5

Browse files
authored
Merge pull request #55 from boriel-basic/features/mame
2 parents 2eae385 + fef1ca5 commit 7ae6af5

33 files changed

Lines changed: 1852 additions & 152 deletions

MAME-plugin/Version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.1-beta1

MAME-plugin/init.lua

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
local exports = {}
2+
3+
local cpu = nil
4+
local paused = false
5+
6+
local breakpointaddr = nil --0x8000
7+
local breakpoint_hit = false
8+
9+
function exports.startplugin()
10+
print("Plugin ZXBS loaded!")
11+
12+
--emu.register_start(function()
13+
emu.add_machine_reset_notifier(function()
14+
cpu = manager.machine.devices[":maincpu"]
15+
print("")
16+
print("CPU detected")
17+
18+
if breakpointaddr then
19+
if cpu.debug then
20+
local id=cpu.debug:bpset(breakpointaddr, "", "")
21+
print("Breakpoint set " .. id)
22+
else
23+
print("DEBUG NO AVAILABLE")
24+
end
25+
end
26+
27+
emu.register_periodic(timer)
28+
end)
29+
end
30+
31+
32+
function timer()
33+
if not cpu or not cpu.debug then
34+
return
35+
end
36+
37+
local current_pc = cpu.state["PC"].value
38+
if current_pc == breakpointaddr and breakpoint_hit == false then
39+
emu.pause()
40+
breakpoint_hit = true
41+
show_registers()
42+
end
43+
44+
--if breakpoint_hit == true and current_pc != breakpointaddr then
45+
-- breakpoint_hit = false
46+
--end
47+
end
48+
49+
50+
function timer2()
51+
local cmd = get_command()
52+
53+
if cmd == "PAUSE" then
54+
emu.pause()
55+
show_registers()
56+
else
57+
if cmd == nil then
58+
return
59+
end
60+
print("UNKNOW COMMAD")
61+
print(cmd)
62+
end
63+
end
64+
65+
66+
function get_command()
67+
local f = io.open("zxbs.tmp","r")
68+
if not f then
69+
return nil
70+
end
71+
local content = f:read("*a")
72+
f:close()
73+
os.remove("zxbs.tmp")
74+
return content
75+
end
76+
77+
78+
function show_registers()
79+
local pc = cpu.state["PC"].value
80+
local af = cpu.state["AF"].value
81+
local bc = cpu.state["BC"].value
82+
local de = cpu.state["DE"].value
83+
local hl = cpu.state["HL"].value
84+
print(string.format("BREAKPOINT PC:%04X AF:%04X BC:%04X DE:%04X HL:%04X",pc, af, bc, de, hl))
85+
end
86+
87+
return exports

MAME-plugin/plugin.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"plugin": {
3+
"name": "zxbs",
4+
"description": "ZX Basic Studio debugger plugin",
5+
"version": "0.1",
6+
"author": "DuefectuCorp",
7+
"type": "plugin",
8+
"start": "start"
9+
}
10+
}

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,17 @@ This solution contains several projects that work together to provide the ZX Bas
3737
- AdolFITO
3838
- HashIron
3939
- SirRickster
40-
41-
42-
### Testers:
43-
40+
- Yoruguaman
41+
- Testers:
4442
- AbenZaX
4543
- Pedro Tomás (Pere)
4644
- Jose Daniel Fernandez Santos (Fenix)
47-
- Yoruguaman
45+
- Super@ado
4846

4947
## Credits
5048
- Icons from [SVG REPO](https://www.svgrepo.com/):
5149
- <a href="https://github.com/blivesta/flexicon?ref=svgrepo.com" target="_blank">Blivesta</a> in MIT License
52-
- <a href="https://dazzleui.gumroad.com/l/dazzleiconsfree?ref=svgrepo.com" target="_blank">Dazzle Ui</a> in CC Attribution License
50+
- <a href="https://dazzleui.gumroad.com/l/dazzleiconsfree?ref=svgrepo.com" target="_blank">Dazzle Ui</a> in CC Attribution License
5351
- <a href="https://github.com/KDE/krita?ref=svgrepo.com" target="_blank">Kde</a> in GPL License
5452
- <a href="https://www.figma.com/@thinkcly?ref=svgrepo.com" target="_blank">Konstantin Filatov</a> in CC Attribution
5553
- <a href="https://dribbble.com/Mohamed_Raouf?ref=svgrepo.com" target="_blank">Mohamed Raouf</a> in CC Attribution License
@@ -66,5 +64,5 @@ This solution contains several projects that work together to provide the ZX Bas
6664
- <a href="https://github.com/siemens/ix-icons?ref=svgrepo.com" target="_blank">Siemens</a> in MIT License
6765
- <a href="https://github.com/32pixelsCo/zest-icons/blob/master/packages/zest-free/LICENSE.md?ref=svgrepo.com" target="_blank">Zest</a> in MIT License
6866
- <a href="https://www.figma.com/community/file/1071678557813409125?ref=svgrepo.com" target="_blank">Ananthanath A X Kalaiism</a> in PD License
69-
70-
67+
- <a href="https://github.com/siemens/ix-icons?ref=svgrepo.com" target="_blank">Siemens</a> in MIT License
68+
- <a href="https://www.svgrepo.com" target="_blank">SVG Repo</a> CC0 License
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
[
2+
{
3+
"Id": "zxbsinstaller",
4+
"Enabled": true,
5+
"Name": "ZX Basic Studio Installer",
6+
"Author": "Duefectu",
7+
"Description": "This program, and it is used to download, install and keep all external tools and ZX Basic Studio itself up to date.",
8+
"SupportedOperatingSystems": [
9+
1,
10+
2,
11+
3
12+
],
13+
"SiteUrl": "https://github.com/boriel-basic/ZXBasicStudio",
14+
"LicenseType": "MIT License",
15+
"LicenceUrl": "https://raw.githubusercontent.com/boriel-basic/ZXBasicStudio/refs/heads/master/LICENSE.txt",
16+
"VersionsUrl": "https://github.com/boriel-basic/ZXBasicStudio/releases/",
17+
"LocalPath": "",
18+
"Unzip": true,
19+
"CreateVerFile": false,
20+
"FullLocalPath": null,
21+
"DirectUpdate": true,
22+
"Group": "ZX Basic Studio",
23+
"Order": 0
24+
},
25+
{
26+
"Id": "zxbasic",
27+
"Enabled": true,
28+
"Name": "Boriel ZX Basic Compiler",
29+
"Author": "Boriel",
30+
"Description": "ZXBCompiler is a BORIEL BASIC cross compiler tool. It's a required tool.'",
31+
"SupportedOperatingSystems": [
32+
1,
33+
2,
34+
3
35+
],
36+
"SiteUrl": "https://boriel-basic.net",
37+
"LicenseType": "GNU Affero General Public License v3.0",
38+
"LicenceUrl": "https://raw.githubusercontent.com/boriel-basic/zxbasic/refs/heads/main/LICENSE.txt",
39+
"VersionsUrl": "https://boriel.com/files/zxb/",
40+
"LocalPath": "",
41+
"Unzip": true,
42+
"CreateVerFile": false,
43+
"FullLocalPath": "C:\\ZXNext\\zxbasic\\zxbc.exe",
44+
"DirectUpdate": true,
45+
"Group": "ZX Basic Studio",
46+
"Order": 1
47+
},
48+
{
49+
"Id": "zxbs",
50+
"Enabled": true,
51+
"Name": "ZX Basic Studio",
52+
"Author": "Dr.Gusman, Boriel, Duefectu, AdolFITO, Hash6Iron and SirRickster",
53+
"Description": "IDE (Integrated Development Environment) with code editor, Assembler, UDGs, fonts, sprites, .tap editor, debugger, emulator, etc.",
54+
"SupportedOperatingSystems": [
55+
1,
56+
2,
57+
3
58+
],
59+
"SiteUrl": "https://github.com/boriel-basic/ZXBasicStudio",
60+
"LicenseType": "MIT License",
61+
"LicenceUrl": "https://raw.githubusercontent.com/boriel-basic/ZXBasicStudio/refs/heads/master/LICENSE.txt",
62+
"VersionsUrl": "https://github.com/boriel-basic/ZXBasicStudio/releases/",
63+
"LocalPath": "",
64+
"Unzip": true,
65+
"CreateVerFile": false,
66+
"FullLocalPath": null,
67+
"DirectUpdate": true,
68+
"Group": "ZX Basic Studio",
69+
"Order": 2
70+
},
71+
{
72+
"Id": "mame",
73+
"Enabled": true,
74+
"Name": "M.A.M.E.",
75+
"Author": "MAME Development Team",
76+
"Description": "MAME (Multi Arcade Machione Emulator) is a multi-purpose emulation framework.\nLinux version AppImage by @Samueru-sama from https://github.com/pkgforge-dev/MAME-AppImage",
77+
"SupportedOperatingSystems": [
78+
1,
79+
2,
80+
3
81+
],
82+
"SiteUrl": "https://github.com/mamedev/mame",
83+
"LicenseType": "GPL-2.0 / BSD-3-Clause License",
84+
"LicenceUrl": "https://github.com/mamedev/mame?tab=License-1-ov-file",
85+
"VersionsUrl": "https://github.com/mamedev/mame/releases",
86+
"LocalPath": "",
87+
"Unzip": true,
88+
"CreateVerFile": true,
89+
"FullLocalPath": null,
90+
"DirectUpdate": true,
91+
"Group": "ZX Spectrum Next",
92+
"Order": 3
93+
},
94+
{
95+
"Id": "tbbluemame",
96+
"Enabled": true,
97+
"Name": "Next boot ROM",
98+
"Author": "SpectNext Ltd",
99+
"Description": "ZX Basic Studio plugin for MAME. Allows you to debug programmes from ZX Basic Studio.",
100+
"SupportedOperatingSystems": [
101+
1,
102+
2,
103+
3
104+
],
105+
"SiteUrl": "https://gitlab.com/SpectrumNext/ZX_Spectrum_Next_FPGA",
106+
"LicenseType": "GNU GPLv3",
107+
"LicenceUrl": "https://gitlab.com/SpectrumNext/ZX_Spectrum_Next_FPGA/-/raw/master/LICENSE?ref_type=heads",
108+
"VersionsUrl": "",
109+
"LocalPath": "mame\\roms\\tbblue.zip",
110+
"Unzip": false,
111+
"CreateVerFile": true,
112+
"FullLocalPath": null,
113+
"DirectUpdate": true,
114+
"Group": "ZX Spectrum Next",
115+
"Order": 4
116+
},
117+
{
118+
"Id": "zxbsmame",
119+
"Enabled": true,
120+
"Name": "ZXBS MAME plugin",
121+
"Author": "Duefectu Corp",
122+
"Description": "ZX Basic Studio plugin for MAME. Allows you to debug programmes from ZX Basic Studio.",
123+
"SupportedOperatingSystems": [
124+
1,
125+
2,
126+
3
127+
],
128+
"SiteUrl": "https://github.com/boriel-basic/ZXBasicStudio",
129+
"LicenseType": "MIT License",
130+
"LicenceUrl": "https://raw.githubusercontent.com/boriel-basic/ZXBasicStudio/refs/heads/master/LICENSE.txt",
131+
"VersionsUrl": "https://www.duefectucorp.com/descargas/zxbsmame/Versions.txt",
132+
"LocalPath": "mame\\plugins\\zxbs",
133+
"Unzip": true,
134+
"CreateVerFile": false,
135+
"FullLocalPath": null,
136+
"DirectUpdate": true,
137+
"Group": "ZX Spectrum Next",
138+
"Order": 5
139+
},
140+
{
141+
"Id": "nextsdimage",
142+
"Enabled": true,
143+
"Name": "ZX Spectrum Next SD image",
144+
"Author": "SpectNext Ltd",
145+
"Description": "ZX Basic Studio plugin for MAME. Allows you to debug programmes from ZX Basic Studio.",
146+
"SupportedOperatingSystems": [
147+
1,
148+
2,
149+
3
150+
],
151+
"SiteUrl": "https://zxnext.uk/hosted/",
152+
"LicenseType": "MIT License",
153+
"LicenceUrl": "https://zxnext.uk/hosted/",
154+
"VersionsUrl": "",
155+
"LocalPath": "",
156+
"Unzip": true,
157+
"CreateVerFile": false,
158+
"FullLocalPath": null,
159+
"DirectUpdate": true,
160+
"Group": "ZX Spectrum Next",
161+
"Order": 5
162+
},
163+
{
164+
"Id": "hdfmonkey",
165+
"Enabled": true,
166+
"Name": "hdfmonkey - jjjs build",
167+
"Author": "jjjs, gasman, ChaN",
168+
"Description": "A tool for editing the contents of disk images used by ZX Spectrum Next.",
169+
"SupportedOperatingSystems": [
170+
1,
171+
2,
172+
3
173+
],
174+
"SiteUrl": "https://www.specnext.com/forum/viewtopic.php?t=2604",
175+
"LicenseType": "GPL-3.0",
176+
"LicenceUrl": "https://codeberg.org/chwe/hdfmonkey/src/branch/dev-v05x",
177+
"VersionsUrl": "https://www.duefectucorp.com/descargas/hdfmonkey/Versions.txt",
178+
"LocalPath": "",
179+
"Unzip": true,
180+
"CreateVerFile": false,
181+
"FullLocalPath": null,
182+
"DirectUpdate": true,
183+
"Group": "ZX Spectrum Next",
184+
"Order": 6
185+
}
186+
]

ZXBSInstaller.Log/Neg/ExternalTool.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class ExternalTool
5353
/// </summary>
5454
public string VersionsUrl { get; set; }
5555
/// <summary>
56-
/// Local path where the tool will be installed without file name
56+
/// If exists Local path where the tool will be installed without file name
5757
/// </summary>
5858
public string LocalPath { get; set; }
5959
/// <summary>
@@ -65,14 +65,25 @@ public class ExternalTool
6565
/// </summary>
6666
public bool DirectUpdate { get; set; }
6767
/// <summary>
68+
/// If true, tool will be downloaded as a zip file and unzipped in the local path, otherwise it will be downloaded as is
69+
/// </summary>
70+
public bool Unzip { get; set; }
71+
/// <summary>
72+
/// True, creates a version.txt file in the installation folder
73+
/// </summary>
74+
public bool CreateVerFile { get; set; }
75+
/// <summary>
6876
/// Order in the list
6977
/// </summary>
7078
public int Order { get; set; }
7179
/// <summary>
7280
/// Recommended
7381
/// </summary>
7482
public bool Recommended { get; set; }
75-
83+
/// <summary>
84+
/// Tools group
85+
/// </summary>
86+
public string Group { get; set; }
7687
/// <summary>
7788
/// Versions of the tool
7889
/// </summary>

ZXBSInstaller.Log/Neg/ExternalTools_Version.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ public class ExternalTools_Version
1212
/// <summary>
1313
/// Numer of the Beta version, 0 if not a beta
1414
/// </summary>
15-
public int BetaNumber { get; set; }
15+
public decimal BetaNumber { get; set; }
1616
/// <summary>
1717
/// Internal version number to order versions
1818
/// </summary>
19-
public int VersionNumber { get; set; }
19+
public decimal VersionNumber { get; set; }
2020
/// <summary>
2121
/// Download url for this version
2222
/// </summary>

0 commit comments

Comments
 (0)