Previous Thread
Next Thread
Print Thread
Page 3 of 3 1 2 3
Carbon #122649 08/19/23 05:05 PM
Joined: Feb 2014
Posts: 1,031
Likes: 115
G
Very Senior Member
Offline
Very Senior Member
G
Joined: Feb 2014
Posts: 1,031
Likes: 115
ok, let's try SpaceZap


download from https://github.com/FrankRizzo890/SpaceZapBot

extract the sz.lua and make a few changes:

--local cpu = manager:machine().devices[":maincpu"]
local cpu = manager.machine.devices[":maincpu"]
local mem = cpu.spaces["program"]
--local ioport = manager:machine():ioport()
local ioport = manager.machine.ioport
local in0 = ioport.ports[":P1HANDLE"]
local in1 = ioport.ports[":P3HANDLE"]


then just put the file in your mame directory and dofile("sz.lua") from the lua console.

[MAME]> dofile("sz.lua")
[MAME]>
[LUA ERROR] in execute_function: sz.lua:194: number (global 'test') has no integer representation
[LUA ERROR] in execute_function: sz.lua:163: number (global 'test') has no integer representation


It shows a bunch of errors, but it seems to work despite them.

It seems to have something to do with reading u64 and then getting a really big number and not being able to convert to an integer possibly?


test = mem:read_u64(0x5ECE + (i * 8))
if test ~= 0 then
if (test & 0xFF) ~= 0 then


just as a test of numerical precision:
[MAME]> a=1e15+1 print(a&0x3)
1
[MAME]> a=1e20+1 print(a&0x3)
error: [string "..."]:2: number (global 'a') has no integer representation
[MAME]> print(a)
1e+20

crazyc #122650 08/19/23 05:12 PM
Joined: May 1999
Posts: 613
Likes: 1
Senior Member
Offline
Senior Member
Joined: May 1999
Posts: 613
Likes: 1
Yeah, working now. Thanks Golden Child.

crazyc #122652 08/19/23 06:01 PM
Joined: Apr 2006
Posts: 807
Likes: 3
D
Senior Member
Offline
Senior Member
D
Joined: Apr 2006
Posts: 807
Likes: 3
I would like some more AI's. smile


W11 Home 64-bit + Nobara OS / AMD Radeon RX 5700 XT / AMD Ryzen 7 3700X 8-Core 3.59 GHz / RAM 64 GB
crazyc #122653 08/19/23 08:37 PM
Joined: May 1999
Posts: 613
Likes: 1
Senior Member
Offline
Senior Member
Joined: May 1999
Posts: 613
Likes: 1
It's mesmerising, especially Robotron.

crazyc #122657 08/20/23 01:03 PM
Joined: Jun 2001
Posts: 519
Likes: 32
O
Senior Member
Offline
Senior Member
O
Joined: Jun 2001
Posts: 519
Likes: 32
You're missing the r = require "robotron"

Joined: May 1999
Posts: 613
Likes: 1
Senior Member
Offline
Senior Member
Joined: May 1999
Posts: 613
Likes: 1
Originally Posted by Olivier Galibert
You're missing the r = require "robotron"

<deNiro>Are you talkin' to me?</deNiro>

I'm asking because like I posted above, everything works now, even SpaceZap that was giving me problems. My error was putting the script into the plugins folder instead of the MAME folder itself.

Last edited by Carbon; 08/20/23 06:04 PM.
Dullaron #122659 08/21/23 02:35 AM
Joined: May 2009
Posts: 2,189
Likes: 286
J
Very Senior Member
Offline
Very Senior Member
J
Joined: May 2009
Posts: 2,189
Likes: 286
Originally Posted by Dullaron
I would like some more AI's. smile

This is not a request thread. It's for people to either post cool scripts, or get help with specific problems.

crazyc #122661 08/21/23 04:27 AM
Joined: Apr 2006
Posts: 807
Likes: 3
D
Senior Member
Offline
Senior Member
D
Joined: Apr 2006
Posts: 807
Likes: 3
Yeah I know this isn't a request thread. Sorry. lol


W11 Home 64-bit + Nobara OS / AMD Radeon RX 5700 XT / AMD Ryzen 7 3700X 8-Core 3.59 GHz / RAM 64 GB
Page 3 of 3 1 2 3

Link Copied to Clipboard
Who's Online Now
0 members (), 139 guests, and 0 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,285
Posts121,451
Members5,064
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com