Active Threads | Active Posts | Unanswered Today | Since Yesterday | This Week
Non-Windows MAME Support Jump to new posts
Re: plug out and in usb controller to get it working crumpetlump 03/27/20 10:09 PM
R.Belmont do you have any suggestions for me to try and fix this?, it was fine about a year ago , I have been doing make -j5 to compile but havent changed anything in makefile, i used to change a few options in the makefile like a year ago maybe this is part of the problem?
4 186 Read More
MAME Jump to new posts
Re: Battlezone fun Golden Child 03/27/20 05:29 PM
If we know where the locations for our position and direction are in memory, let's see if we can move things around under lua's control.

Moving the player under the control of a lua script:

[Linked Image from i.imgur.com]

Player position is stored at 2d/2e for x position and 31/32 for y position.
Tank position is stored at 2f/30 for x position and 33/34 for y position.
Tank direction is stored at 29/2c 29=lsb and 2c=msb.

The player's direction is stored at 27 = lsb and 2a = msb. When 27/2a are set to 0000 that precisely lines up on the right side of the moon with the target.

Interestingly, only the msb of the direction gets reset on the start of the game, when the game starts it will be very close to the edge of the moon.

[Linked Image from i.imgur.com]

This script will move the tank around, spin it, and move the player around also. It's kind of fun to "trap" the missile with the script and watch it rotate.

Code
mem=manager:machine().devices[":maincpu"].spaces["program"]
mem2=manager:machine():memory().regions[":maincpu"]
function hex(a,digits) digits = digits or 2 return string.format("%0"..digits.."x",a) end

function setlives(l) l=int(l) mem:write_u8(0xcc,l) end
function setscore(s) s=int(s) mem:write_u16(0xb8,s) end

function setmypos(x,y) mem:write_u16(0x2d,int(x)) mem:write_u16(0x31,int(y)) end
function setmydir(d) d=int(d) mem:write_u8(0x27,d&0xff) mem:write_u8(0x2a,(d&0xff00)>>8)  end

function settankposx(x) mem:write_u16(0x2f,int(x)) end
function settankposy(y) mem:write_u16(0x33,int(y)) end
function settankpos(x,y) settankposx(x) settankposy(y) end
function settankdir(d) d=int(d) mem:write_u8(0x29,d&0xff) mem:write_u8(0x2c,(d&0xff00)>>8)  end 

function delay(delaytime)  delaytime = delaytime or 4 emu.wait(delaytime * 1/60) end

function int(i) return math.floor(i) end

function movetank2()
-- move enemy tank in a triangle
movetable = { 10,0,  50,0,  50,10, 10,0, 50,-20, 10,0,}
for pos=1,#movetable-2,2 do
   x1=movetable[pos+0] y1=movetable[pos+1] 
   x2=movetable[pos+2] y2=movetable[pos+3]
   dist=math.sqrt((x2-x1)^2 + (y2-y1)^2)
   vel=20/60
   t=dist/vel
   frames=t
   --print(pos,x1,y1,x2,y2)
   for f=1,frames do
       x=(x2-x1)/frames * f + x1
       y=(y2-y1)/frames * f + y1
       settankpos(x*256,y*256)
       setmypos(0,0)
       setmydir(0)
       print(f,frames,x,y) 
       delay(1)
  end
end
-- spin the enemy tank or missile around 3 times
for i=1,3 do
for d=0,255 do
  setmypos(0,0)
  setmydir(0)
  settankdir(d*256)
  settankpos(0x600,0)
  setlives(4)
  setscore(d)
  delay(2)
end
end
-- move me and fix the enemy tank right in front of me
movetable = { 10,0,  50,0,  50,10, 10,0, 50,-20, 10,0,}
for pos=1,#movetable-2,2 do
   x1=movetable[pos+0] y1=movetable[pos+1] 
   x2=movetable[pos+2] y2=movetable[pos+3]
   dist=math.sqrt((x2-x1)^2 + (y2-y1)^2)
   vel=20/60
   t=dist/vel
   frames=t
   --print(pos,x1,y1,x2,y2)
   for f=1,frames do
       x=(x2-x1)/frames * f + x1
       y=(y2-y1)/frames * f + y1
       setmypos(x*256,y*256)
       settankpos(x*256+0x401,y*256)
       setmydir(0)
       setlives(4)
       setscore(f)
       print(f,frames,x,y) 
       delay(1)
    end
end
end

co1=coroutine.create(movetank2) coroutine.resume(co1)
13 1,301 Read More
MAME Jump to new posts
Re: Wonderswan driver update KanedaFr 03/27/20 09:34 AM
Just Desserts : sorry! I didn't realize the already point me to the right anwser frown I thought you were talking about using socket or not.

pmackinlay, Vas Crabb : I found the bitbanger solution while Googling, on TI82 related page but for some reason I didn't find it on command line... I thought it was since replaced by comm_localhost/comm_remotehost

so what the difference / benetifs of bitbanger vs comm_localhost/comm_remotehost ?
At this time, I successfully send data (TX), I have to fix some part of my receive code (RX) but should I move to bitbanger first ?

I'll try using device_slot after that, based on TI82 or NES example

thanks!!!!
8 460 Read More
MAME Jump to new posts
Re: Wonderswan driver update Vas Crabb 03/27/20 07:56 AM
The TI-82 and TI-85 calculators use non-RS232 communications and can talk between MAME instances over sockets. It’s implemented using device_slot_interface. Cooked and raw communication over the socket is supported. Try following that example?
8 460 Read More
MAME Jump to new posts
Re: Wonderswan driver update pmackinlay 03/27/20 06:52 AM
Yes, slot devices are the right way to do it, that's what Just Desserts mentioned above. But per R. Belmont's comment, MAME already has a way to do what you're asking, using the BITBANGER device and related support. You can look into how that's connected to the RS-232 null modem as an example, but in principle it allows you to transmit and receive arbitrary streams of data through sockets on the host, without having to implement your own network code (and the various operating system dependencies that entails).

To experiment, you can activate this function from the command line on any driver which implements an RS-232 port by adding arguments as follows:

Code
-<port_name> null_modem -bitbngr socket.<address>:<port>

where <port_name> is whatever the driver calls its serial port, and <address> and <port> are the IP address and port number of the socket you want to use.

In your case, if the link isn't RS-232, you can still follow the same approach to leverage BITBANGER for yourself.
8 460 Read More
MAME Jump to new posts
Re: Wonderswan driver update KanedaFr 03/27/20 01:38 AM
It seems I found a way to do it : using device_slot_interface
This way user could select device connected on serial port using MAME options

Is it the right way to do it ?
8 460 Read More
MAME Jump to new posts
Re: Wonderswan driver update KanedaFr 03/26/20 05:54 PM
Exactly, I'd like to be able to play at 2 players using 2 MAME, on same machine or not. It's why my code is based on socket.

I added

/bus/wswan/serial.cpp

with
Code
class ws_serial_device : public device_t
...
    required_device<ws_cable_link_device> m_cable_link;


class ws_cable_link_device : public device_t



it's required_device that's bug me

of course if comm_localhost/comm_remotehost aren't defined at commandLine, it won't work but I wonder how i could let the player choose to activate it or not...
I doubt adding an option on commandLine, specific to one driver is expected....
8 460 Read More
MAME Jump to new posts
Re: Wonderswan driver update R. Belmont 03/25/20 05:13 PM
I think they *do* want to communicate with the outside world. MAME has existing abstractions for that though.
8 460 Read More
MAME Jump to new posts
Re: Wonderswan driver update Just Desserts 03/25/20 03:09 PM
Please do not use sockets directly, those are for communicating with the outside world.

MAME uses "slot devices" for things that allow you to connect multiple things to a port. I would advise looking at the contents of src/devices/bus/rs232/ for inspiration.
8 460 Read More
MAME Jump to new posts
Re: The MAME Bot Thread crazyc 03/25/20 02:52 PM
There are a couple in https://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=109639#Post109639 too (although these are static bots while the ones in that thread are AIs).
1 188 Read More
MAME Jump to new posts
The MAME Bot Thread R. Belmont 03/25/20 02:16 PM
Here's videos of Frank Rizzo's latest MAME Lua bots. These play the games so you don't have to, or something smile

Track n Field: https://www.youtube.com/watch?v=fs-aIPMlcUo
Space Zap: https://www.youtube.com/watch?v=90yBznscFkk
Hyper Sports: https://www.youtube.com/watch?v=JWOLBkUp6dA

Source is on Github at https://github.com/frankrizzo890

1 188 Read More
QMC2 Jump to new posts
Re: QMC2 and QT5.11+ stablerom 03/25/20 11:55 AM
Using source files at https://svn.code.sf.net/p/qmc2/code/trunk.

In order to build in Ubuntu 17.10 the config file needs to be as follows (Ubuntu_17.10.cfg or Debian.cfg),

Code
QMAKE    = /usr/bin/qmake
LUPDATE  = /usr/bin/lupdate
LRELEASE = /usr/bin/lrelease


This will allow QMC2 Arcade to build and install.

QMC2 (non arcade version) does not build with the latest version of QT5.

Good to see you back, Rene.
2 343 Read More
MAME Jump to new posts
Re: Wonderswan driver update KanedaFr 03/25/20 10:48 AM
Serial:

On the Wonderswan, you can connect on serial port
- a cable link (2 player support)
- a wonderwave (IR)
- a digimon connector
- a gps
- a sonar
- a mobilegate
....

How MAME allows to select what is connected to a port ?


I'm currently adding cable link support (using socket, similar to Sega Model1/2/32 driver), and so I'd like to know how to activate it ....
8 460 Read More
MAME Jump to new posts
Wonderswan driver update KanedaFr 03/25/20 10:44 AM
Hi,

Introduction:
After several years on Megadrive side, I recently get hooked by the lil' Wonderswan.
I was looking for a way to homebrew develop on it and unfortunalty, no dedicated emulator include debug feature.
So I moved to MAME, since it include a full debugger and GFX Viewer.
Unfortunately, the GFX Viewer part isn't present, like most of the CONS system it seems.
And so began my journey on MAME driver update.
I must say, sorry, that it was VERY difficult to start and while I was about to stop, I finally was able to add GFX Viewer support.
and so I'm currently improve it step by step....


What is done
GFX Viewer for WS Classic
use of LOGMasked
(available on my MAME fork, wswan branch at https://github.com/KanedaFr/mame/tree/wswan)

What is in progress
Serial link support

My main reason to post of this forum is to be sure I do it the right way and, if interested, understand how to post my update to main branch, to allow any other people to use it.
I hope it's alright with the guidelines and that I will be able to at last give somethink back to MAME, after so many years using it for playing, hacking, etc....
8 460 Read More
MAME Jump to new posts
Re: SVN builds - new driver flood pmackinlay 03/24/20 10:44 AM
Work on the Sony NWS-3260 portable (similar to this: bignews) is progressing. We now have basic video and hle keyboard.

Interrupts, DMA and SCSI remain to be tackled, but since networking is already up, I'm going to see if I can get it to boot diskless first.

[Linked Image from i.imgur.com]
5,310 15,546,517 Read More
MAME Jump to new posts
Re: Battlezone fun Golden Child 03/24/20 01:15 AM
More silly fun, let's draw the start led on the screen (startled in the upper left corner)
[Linked Image from i.imgur.com]


Code
dispatch_list = { }

function frame_dispatcher()
for index,my_func in pairs(dispatch_list) do  my_func() end
end

function cld()
dispatch_list = {}
end

if not alreadyregisteredframedone then
emu.register_frame_done(frame_dispatcher)
alreadyregisteredframedone=true
end

function drawstartled() 
if manager:machine():outputs():get_value("startled")==1 then 
  manager:machine().screens[":screen"]:draw_text(5,5,"startled")  
end 
inp = manager:machine():input() if inp:code_pressed(inp:code_from_token("KEYCODE_S")) then dispatch_list={} end
end

table.insert(dispatch_list,drawstartled)



I tried the same thing with foodfight, it has them named "led0" and "led1".

Code
function drawled(ledname,x,y)
if manager:machine():outputs():get_value(ledname)==1 then 
 manager:machine().screens[":screen"]:draw_text(x,y,ledname)  
end
end

function drawstartled() 
drawled("led0",5,5)
drawled("led1",5,15)
inp = manager:machine():input() if inp:code_pressed(inp:code_from_token("KEYCODE_S")) then dispatch_list={} end
end

13 1,301 Read More
MAME Jump to new posts
Re: Battlezone fun Golden Child 03/24/20 01:01 AM
I've been reading about the highscore bug on a few forums.

According to biltronix at http://www.biltronix.com/battlezone.html
Quote

Hey, check out that wild high score eh? I know what you're thinking, it's a photoshop trick or something right? No, it's quite real alright. While it may not actually be an impossible score to achieve, I know I'll never even come close. I got the 4,537,000 score while playing but some sort of game program bug produced it. I took a shot at a saucer and while the shot was still in flight, a missile came at me. I kept clicking the fire button hoping it would shoot again before I got nailed. It did shoot again and I got the saucer and the missile so close to being at the same time that the sounds of the hits interfered with each other and suddenly the crazy high score appeared. I have a hi-score save module installed in my machine so it faithfully saved and restored it so I guess it's not going anywhere unless I decide to reset the scores. Nah.


(Scoring Millions of Points in Battlezone in Seconds)
https://forums.arcade-museum.com/showthread.php?t=244380

(Battlezone - 7 million points!)
http://www.classicarcadegaming.com/forums/index.php/topic,3302.0.html

(Scoring Millions in seconds in Upright Arcade BattleZone)
https://www.mameworld.info/ubbthreads/showflat.php?Cat=1&Number=292881


I've been looking at the screenshots of the high scores and it's interesting that none of them have the diagonally shifted high score screen of bzone (with the single tank icon for scores 100k+.)

https://forums.arcade-museum.com/showthread.php?t=244380&page=8


The player's score is at $b8 and $b9 so something must be stomping on them.



https://www.retroinjection.com/post...cade-courtesy-of-the-best-snowstorm-ever
Quote
Battlezone, a first-person perspective shooter, is one of my favorite vector games. How can you not love looking through that viewfinder? Kent's daughter managed to trigger a notoriously-difficult glitch in the game, awarding her this astronomical high score.
13 1,301 Read More
MAME Jump to new posts
Re: Battlezone fun Al Kossow 03/23/20 11:51 AM
There is a bug that gives you a lot of tanks. Maybe it is documented somewhere.
I saw someone do it in an arcade in the 80s, but I could never catch the guy using it (he always did it when no one was watching)
13 1,301 Read More
MAME Jump to new posts
Re: Battlezone fun Golden Child 03/23/20 04:06 AM
One of the things that's puzzled me is why the hi-score screen for bzone is diagonal and shifted down onto the words BONUS TANK.

It's odd because the hi-score screen for bzonea is perfectly aligned.

bzone
[Linked Image from i.imgur.com]

bzonea
[Linked Image from i.imgur.com]

Apparently, the only difference between bzone and bzonea is the rendering of the hi-score screen text and how many tank icons are displayed.

For bzone, the text is rendered each line as an offset of the line above it.

For bzonea, each line of text has a CNTR command followed by a move.

Any high score above 100K will draw a tank icon in bzone.

Bzonea will draw up to 10 tanks per 100K of hi score, going off the screen to do so. (6 1/2 are visible)
If you have too many hi scores and tanks onscreen it will clip the rendering of the BONUS TANK line as it overloads the AVG.

http://www.vectorlist.org/Vectorlist/2003/07/0046.html Re: bzone and bzone2 roms - whats the diff
http://www.vectorlist.org/Vectorlist/2003/07/0046.html Re: Bug: Battlezone high score rendering


I took a hexdump and diff'ed it and got this:

Code
diff bzone_orighex.txt bzonea_orighex.txt 
55c55
< 00005340  67 45 44 52 a2 00 86 d2  8e 3c 03 bc 00 03 c4 b8  |gEDR.....<......|
---
> 00005340  70 45 44 52 a2 00 86 d2  8e 3c 03 bc 00 03 c4 b8  |pEDR.....<......|
77,86c77,86
< 000054a0  20 98 6c 20 6a 7a a0 00  a9 e0 a2 1a 20 8e 7a a2  | .l jz...... .z.|
< 000054b0  00 8e 40 03 ae 40 03 bd  00 03 85 0a 1d 01 03 f0  |..@..@..........|
< 000054c0  7c bd 01 03 85 0b a9 0a  20 9e 7b a2 1c 20 98 6c  ||....... .{.. .l|
< 000054d0  ae 40 03 bd 1e 03 20 6a  55 ae 40 03 bd 1f 03 20  |.@.... jU.@.... |
< 000054e0  6a 55 ae 40 03 bd 20 03  20 6a 55 a0 00 ae 40 03  |jU.@.. . jU...@.|
< 000054f0  bd 01 03 f0 1a ad f0 33  91 02 c8 ad f1 33 91 02  |.......3.....3..|
< 00005500  c8 ad 90 35 91 02 c8 ad  91 35 91 02 20 76 7a ae  |...5.....5.. vz.|
< 00005510  40 03 e0 1b b0 27 e8 e8  e8 8e 40 03 a9 d8 85 06  |@....'....@.....|
< 00005520  a9 ff 85 07 a9 fe 85 05  98 f0 04 a9 a3 d0 02 a9  |................|
< 00005530  f4 85 04 a9 00 85 01 20  ab 7a 4c b4 54 ad 00 0a  |....... .zL.T...|
---
> 000054a0  20 98 6c 20 6a 7a a0 00  8c 40 03 a9 e0 a2 1e 8e  | .l jz...@......|
> 000054b0  71 03 20 8e 7a ae 40 03  bd 00 03 85 0a 1d 01 03  |q. .z.@.........|
> 000054c0  f0 7b bd 01 03 85 0b a9  0a 20 9e 7b a2 1c 20 98  |.{....... .{.. .|
> 000054d0  6c ae 40 03 bd 1e 03 20  6a 55 ae 40 03 bd 1f 03  |l.@.... jU.@....|
> 000054e0  20 6a 55 ae 40 03 bd 20  03 20 6a 55 a0 00 ae 40  | jU.@.. . jU...@|
> 000054f0  03 bd 01 03 f0 24 aa ad  f0 33 91 02 c8 ad f1 33  |.....$...3.....3|
> 00005500  91 02 e0 0a 90 02 a2 0a  c8 ad 90 35 91 02 c8 ad  |...........5....|
> 00005510  91 35 91 02 ca d0 f1 20  76 7a ae 40 03 e0 1b b0  |.5..... vz.@....|
> 00005520  1c e8 e8 e8 8e 40 03 20  6a 7a ad 71 03 38 e9 0a  |.....@. jz.q.8..|
> 00005530  8d 71 03 aa a9 e0 a0 00  4c b2 54 45 52 ad 00 0a  |.q......L.TER...|


Code
cat bzone_dasm_diff.txt 
54A0: 20 98 6C jsr $6c98					54A0: 20 98 6C jsr $6c98
54A3: 20 6A 7A jsr $7a6a					54A3: 20 6A 7A jsr $7a6a
54A6: A0 00    ldy #$00						54A6: A0 00    ldy #$00
54A8: A9 E0    lda #$e0					      |	54A8: 8C 40 03 sty $0340
54AA: A2 1A    ldx #$1a					      |	54AB: A9 E0    lda #$e0
54AC: 20 8E 7A jsr $7a8e				      |	54AD: A2 1E    ldx #$1e
54AF: A2 00    ldx #$00					      |	54AF: 8E 71 03 stx $0371
54B1: 8E 40 03 stx $0340				      |	54B2: 20 8E 7A jsr $7a8e
54B4: AE 40 03 ldx $0340				      |	54B5: AE 40 03 ldx $0340
54B7: BD 00 03 lda $0300, x				      |	54B8: BD 00 03 lda $0300, x
54BA: 85 0A    sta $0a					      |	54BB: 85 0A    sta $0a
54BC: 1D 01 03 ora $0301, x				      |	54BD: 1D 01 03 ora $0301, x
54BF: F0 7C    beq $553d				      |	54C0: F0 7B    beq $553d
54C1: BD 01 03 lda $0301, x				      |	54C2: BD 01 03 lda $0301, x
54C4: 85 0B    sta $0b					      |	54C5: 85 0B    sta $0b
54C6: A9 0A    lda #$0a					      |	54C7: A9 0A    lda #$0a
54C8: 20 9E 7B jsr $7b9e				      |	54C9: 20 9E 7B jsr $7b9e
54CB: A2 1C    ldx #$1c					      |	54CC: A2 1C    ldx #$1c
54CD: 20 98 6C jsr $6c98				      |	54CE: 20 98 6C jsr $6c98
54D0: AE 40 03 ldx $0340				      |	54D1: AE 40 03 ldx $0340
54D3: BD 1E 03 lda $031e, x				      |	54D4: BD 1E 03 lda $031e, x
54D6: 20 6A 55 jsr $556a				      |	54D7: 20 6A 55 jsr $556a
54D9: AE 40 03 ldx $0340				      |	54DA: AE 40 03 ldx $0340
54DC: BD 1F 03 lda $031f, x				      |	54DD: BD 1F 03 lda $031f, x
54DF: 20 6A 55 jsr $556a				      |	54E0: 20 6A 55 jsr $556a
54E2: AE 40 03 ldx $0340				      |	54E3: AE 40 03 ldx $0340
54E5: BD 20 03 lda $0320, x				      |	54E6: BD 20 03 lda $0320, x
54E8: 20 6A 55 jsr $556a				      |	54E9: 20 6A 55 jsr $556a
54EB: A0 00    ldy #$00					      |	54EC: A0 00    ldy #$00
54ED: AE 40 03 ldx $0340				      |	54EE: AE 40 03 ldx $0340
54F0: BD 01 03 lda $0301, x				      |	54F1: BD 01 03 lda $0301, x
54F3: F0 1A    beq $550f				      |	54F4: F0 24    beq $551a
54F5: AD F0 33 lda $33f0				      |	54F6: AA       tax
54F8: 91 02    sta ($02), y				      |	54F7: AD F0 33 lda $33f0
54FA: C8       iny					      |	54FA: 91 02    sta ($02), y
54FB: AD F1 33 lda $33f1				      |	54FC: C8       iny
54FE: 91 02    sta ($02), y				      |	54FD: AD F1 33 lda $33f1
5500: C8       iny					      |	5500: 91 02    sta ($02), y
5501: AD 90 35 lda $3590				      |	5502: E0 0A    cpx #$0a
5504: 91 02    sta ($02), y				      |	5504: 90 02    bcc $5508
5506: C8       iny					      |	5506: A2 0A    ldx #$0a
5507: AD 91 35 lda $3591				      |	5508: C8       iny
550A: 91 02    sta ($02), y				      |	5509: AD 90 35 lda $3590
550C: 20 76 7A jsr $7a76				      |	550C: 91 02    sta ($02), y
550F: AE 40 03 ldx $0340				      |	550E: C8       iny
5512: E0 1B    cpx #$1b					      |	550F: AD 91 35 lda $3591
5514: B0 27    bcs $553d				      |	5512: 91 02    sta ($02), y
5516: E8       inx					      |	5514: CA       dex
5517: E8       inx					      |	5515: D0 F1    bne $5508
5518: E8       inx					      |	5517: 20 76 7A jsr $7a76
5519: 8E 40 03 stx $0340				      |	551A: AE 40 03 ldx $0340
551C: A9 D8    lda #$d8					      |	551D: E0 1B    cpx #$1b
551E: 85 06    sta $06					      |	551F: B0 1C    bcs $553d
5520: A9 FF    lda #$ff					      |	5521: E8       inx
5522: 85 07    sta $07					      |	5522: E8       inx
5524: A9 FE    lda #$fe					      |	5523: E8       inx
5526: 85 05    sta $05					      |	5524: 8E 40 03 stx $0340
5528: 98       tya					      |	5527: 20 6A 7A jsr $7a6a
5529: F0 04    beq $552f				      |	552A: AD 71 03 lda $0371
552B: A9 A3    lda #$a3					      |	552D: 38       sec
552D: D0 02    bne $5531				      |	552E: E9 0A    sbc #$0a
552F: A9 F4    lda #$f4					      |	5530: 8D 71 03 sta $0371
5531: 85 04    sta $04					      |	5533: AA       tax
5533: A9 00    lda #$00					      |	5534: A9 E0    lda #$e0
5535: 85 01    sta $01					      |	5536: A0 00    ldy #$00
5537: 20 AB 7A jsr $7aab				      |	5538: 4C B2 54 jmp $54b2
553A: 4C B4 54 jmp $54b4				      |	553B: 45 52    eor $52
553D: AD 00 0A lda $0a00					553D: AD 00 0A lda $0a00
5540: 4A       lsr a						5540: 4A       lsr a
5541: 4A       lsr a						5541: 4A       lsr a
5542: 4A       lsr a						5542: 4A       lsr a
5543: 4A       lsr a						5543: 4A       lsr a
5544: 29 03    and #$03						5544: 29 03    and #$03
5546: F0 1C    beq $5564					5546: F0 1C    beq $5564
5548: AA       tax						5548: AA       tax
5549: BD 86 38 lda $3886, x					5549: BD 86 38 lda $3886, x
554C: 18       clc						554C: 18       clc
554D: F8       sed						554D: F8       sed
554E: 69 01    adc #$01						554E: 69 01    adc #$01




So if we change a few memory locations we can get the hiscore of bzone to perfectly match the output of bzonea but there will still be only one tank rendered.


Here's a little lua routine to mimic the self-test routine of bzone:

Code
function hex(a,digits) digits = digits or 2 return string.format("%0"..digits.."x",a) end

mem2=manager:machine():memory().regions[":maincpu"]
mem=mem2

function bzself()
-- self test initializes to 0xff and then xors every byte in each 0x800 block, after each block the value should be zero, skipping blocks 0x4000-0x47ff and 0x4800-0x4fff
for j=0x0,0x9 do o=0xff for i=0x3000+j*0x800,0x3000+j*0x800+0x7ff do o=o~mem:read_u8(i) end print(j,hex(0x3000+j*0x800),o) end -- self test at $7d01
bzmemlocs={0x5530,0x54a9,0x54ab,0x552c,0x5340}
bzmemlocsdesc={
"hiscore horiz move for next line",
"hiscore first line x pos",
"hiscore first line y pos",
"hiscore horiz move next line w/tank icon",
"self test eor checksum fixer"}
print("-------------")
for i=1,#bzmemlocs do print(hex(i),hex(bzmemlocs[i]),hex(mem2:read_u8(bzmemlocs[i])),bzmemlocsdesc[i]) end
end


On initial start we get:
Code
bzself()
0	3000	0
1	3800	0
2	4000	255
3	4800	255
4	5000	0
5	5800	0
6	6000	0
7	6800	0
8	7000	0
9	7800	0
-------------
01	5530	f4	hiscore horiz move for next line
02	54a9	e0	hiscore first line x pos
03	54ab	1a	hiscore first line y pos
04	552c	a3	hiscore horiz move next line w/tank icon
05	5340	67	self test eor checksum fixer



mem2:write_u8(0x5530,0xf8)   -- f4 to f8  0100 to 1000
mem2:write_u8(0x54ab,0x1e)   -- 1a to 1e  1010 to 1110
mem2:write_u8(0x552c,0xa7)   -- a3 to a7  0011 to 0111
mem2:write_u8(0x5340,0x6b)   -- fix the self test checksum


bzself()
0	3000	0
1	3800	0
2	4000	255
3	4800	255
4	5000	0
5	5800	0
6	6000	0
7	6800	0
8	7000	0
9	7800	0
-------------
01	5530	f8	hiscore horiz move for next line
02	54a9	e0	hiscore first line x pos
03	54ab	1e	hiscore first line y pos
04	552c	a7	hiscore horiz move next line w/tank icon
05	5340	6b	self test eor checksum fixer



If you didn't care about it matching bzonea exactly, you could probably find some values that don't change the eor checksum and look reasonable on screen.


Then we get a high score screen that matches:

Loaded the fixed bzone and the bzonea and overlaid it with gimp and modified the opacity to see how it lines up.

[Linked Image from i.imgur.com]
13 1,301 Read More
MAME Jump to new posts
Re: Battlezone fun Golden Child 03/22/20 03:42 PM
I was looking at the schematics and saw that there's a SLAM switch as well as a coin switch for left, center and right, so let's see if we can hook that IPT_COIN3 and IPT_TILT up:

[Linked Image from i.imgur.com]

Code
#define BZONEIN0\
        PORT_START("IN0")\
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )\
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )\
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )\
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT )\
        PORT_SERVICE( 0x10, IP_ACTIVE_LOW )\
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Diagnostic Step") \
        /* bit 6 is the VG HALT bit. We set it to "low" */\
        /* per default (busy vector processor). */\
        PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("avg", avg_bzone_device, done_r)\
        /* bit 7 is tied to a 3kHz clock */\
        PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(bzone_state, clock_r)


void bzone_state::bzone_coin_counter_w(offs_t offset, uint8_t data)
{
//      machine().bookkeeping().coin_counter_w(offset,data);
        for (int i=0; i<3; i++) machine().bookkeeping().coin_counter_w(i,BIT(data,i));
}


And now coin B and C will get incremented:

(if you want to see it increment, bring up the bookkeeping, take it off with TAB, then hit 567 and hit TAB again to bring back the bookkeeping. Do it fast enough and you'll see the number increment)

Interestingly, hitting 567 simultaneously doesn't register, but 567 quickly in sequence registers.

Hitting the T for TILT causes the game to screech and ignore the coin input. (No hitting the coinbox to get free plays!)

[Linked Image from i.imgur.com]
13 1,301 Read More
QMC2 Jump to new posts
Re: Hey, hey - here I am... Christina 03/21/20 04:07 AM
Welcome back!
17 788 Read More
Non-Windows MAME Support Jump to new posts
Re: Compiling SDLmame (0.219) on OSX PPC MacBox360 03/20/20 08:34 PM
Well, I have almost fixed all the compile errors but the linker fails miserably, here is the error:

Code
final section layout:
    __TEXT/__text addr=0x000024C4, size=0x017F6554, fileOffset=0x000014C4, type=1
    __TEXT/__text_cold addr=0x017F8A18, size=0x00020840, fileOffset=0x017F7A18, type=1
    __TEXT/__text_startup addr=0x01819258, size=0x0001BED4, fileOffset=0x01818258, type=1
    __TEXT/__text_cold_coal addr=0x0183512C, size=0x00000EE4, fileOffset=0x0183412C, type=1
    __TEXT/__symbol_stub1 addr=0x01836010, size=0x0004D1B0, fileOffset=0x01835010, type=27
    __TEXT/__cstring addr=0x018831C0, size=0x0006A8CE, fileOffset=0x018821C0, type=12
    __TEXT/__const addr=0x018EDA90, size=0x00158FB5, fileOffset=0x018ECA90, type=0
    __TEXT/__info_plist addr=0x01A46A45, size=0x00000223, fileOffset=0x01A45A45, type=0
    __TEXT/__eh_frame addr=0x01A46C68, size=0x0055A394, fileOffset=0x01A45C68, type=18
    __DATA/__dyld addr=0x01FA1000, size=0x0000001C, fileOffset=0x01FA0000, type=29
    __DATA/__nl_symbol_ptr addr=0x01FA101C, size=0x00008AB0, fileOffset=0x01FA001C, type=28
    __DATA/__la_symbol_ptr addr=0x01FA9ACC, size=0x0001346C, fileOffset=0x01FA8ACC, type=26
    __DATA/__mod_init_func addr=0x01FBCF38, size=0x0000047C, fileOffset=0x01FBBF38, type=32
    __DATA/__data addr=0x01FBD3B8, size=0x0001B128, fileOffset=0x01FBC3B8, type=0
    __DATA/__static_data addr=0x01FD84E0, size=0x0000010F, fileOffset=0x01FD74E0, type=0
    __DATA/__const addr=0x01FD85F0, size=0x000D2530, fileOffset=0x01FD75F0, type=0
    __DATA/__gcc_except_tab addr=0x020AAB20, size=0x000FC305, fileOffset=0x020A9B20, type=0
    __DATA/__cfstring addr=0x021A6E28, size=0x00000090, fileOffset=0x021A5E28, type=16
    __DATA/__bss0 addr=0x021A6EB8, size=0x000108F0, fileOffset=0x00000000, type=24
    __DATA/__pu_bss0 addr=0x021B77A8, size=0x00080000, fileOffset=0x00000000, type=24
    __DATA/__pu_bss4 addr=0x022377B0, size=0x00100014, fileOffset=0x00000000, type=24
    __DATA/__bss3 addr=0x023377C8, size=0x00000598, fileOffset=0x00000000, type=24
    __DATA/__bss4 addr=0x02337D60, size=0x0000A410, fileOffset=0x00000000, type=24
    __DATA/__pu_bss3 addr=0x02342170, size=0x00000020, fileOffset=0x00000000, type=24
    __DATA/__pu_bss2 addr=0x02342190, size=0x000012E8, fileOffset=0x00000000, type=24
    __DATA/__common addr=0x02343478, size=0x0000240C, fileOffset=0x00000000, type=24
    __DATA/__bss1 addr=0x02345884, size=0x000045A0, fileOffset=0x00000000, type=24
    __DATA/__bss2 addr=0x02349E24, size=0x00075650, fileOffset=0x00000000, type=24
    __OBJC/__module_info addr=0x023C0000, size=0x00000120, fileOffset=0x021A6000, type=0
    __OBJC/__message_refs addr=0x023C0120, size=0x00000048, fileOffset=0x021A6120, type=14
    __OBJC/__cls_refs addr=0x023C0168, size=0x00000014, fileOffset=0x021A6168, type=14
    __OBJC/__image_info addr=0x023C017C, size=0x00000008, fileOffset=0x021A617C, type=0
ld: bl PPC branch out of range (25310156 max is +/-16MB): from start (0x000024C4) to _main (0x018258D0) in start from /usr/lib/crt1.10.5.o for architecture ppc
collect2: error: ld returned 1 exit status
make[2]: *** [../../../../../mame] Error 1
make[1]: *** [mame] Error 2
make: *** [macosx_x86] Error 2


I must admit it was an interesting challenge, I have learned a lot looking inside the MAME sources and browsing a lot the web. Not everything is clear (I have no knowledge about this kind of language) but I start to see the structure and rules behind the build process and this was extremely useful in planning the modifications to try.
I will do more experiments in the next days... :-)
11 346 Read More
Non-Windows MAME Support Jump to new posts
Re: SDLMAME - configure to run on 2nd Display D M K 03/20/20 08:19 PM
Originally Posted by R. Belmont
Why don't newer 64-bit versions run? That would be the first problem, as 0.155 is very old.


I have tried some of the later 64bit versions from <here> but when the NAME binary is launched it loads 'in the background' so I have to switch to another application, then locate MAME in my dock before I can see it.

I seem to remember compiling a 64bit version myself using Terminal but it never produced a working version. SDLMAME 64bit last worked properly for me on my Mac around 0.152 (ish)
7 184 Read More
Non-Windows MAME Support Jump to new posts
Re: SDLMAME - configure to run on 2nd Display R. Belmont 03/20/20 07:40 PM
Why don't newer 64-bit versions run? That would be the first problem, as 0.155 is very old.
7 184 Read More
Non-Windows MAME Support Jump to new posts
Re: SDLMAME - configure to run on 2nd Display D M K 03/20/20 06:47 PM
Hey.

2nd Monitor active.
Mac OS 10.13.6
MAME 0.155 (32bit) yes I know this is old, but newer 64 bit versions fail to run now (:
I have SDL2 version 2.0.10

Thanks.
7 184 Read More
Page 1 of 6 1 2 3 4 5 6
Who's Online Now
0 registered members (), 35 guests, and 1 spider.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,762
Posts115,156
Members4,888
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.3