6502 to java possible ?

Building your first 6502-based project? We'll help you get started here.
Post Reply
shivshankarq
Posts: 7
Joined: 18 Apr 2018

6502 to java possible ?

Post by shivshankarq »

I have old Game board which have 6502, i want some information from you, It can possible convert 6502 games in Java ? I have some game files of 6502 but i think so its in HEX, And Currently In Market No game boards of 6502 so you have any idea about how we develop new board ?
White Flame
Posts: 704
Joined: 24 Jul 2012

Re: 6502 to java possible ?

Post by White Flame »

I'm sure you could find some 6502 emulators in Java. That would be the easiest way to get started.

However, a major portion of games are the interface with the user, including keyboard/joystick, display, and sound. That would have to be custom development for your board, based on knowledge of what the 6502 program thinks the I/O should act like.
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: 6502 to java possible ?

Post by BigEd »

Welcome shivshankarq - do you have photos of your board?
shivshankarq
Posts: 7
Joined: 18 Apr 2018

Re: 6502 to java possible ?

Post by shivshankarq »

BigEd wrote:
Welcome shivshankarq - do you have photos of your board?
Attachments
IMG-20180409-WA0001.jpg
shivshankarq
Posts: 7
Joined: 18 Apr 2018

Re: 6502 to java possible ?

Post by shivshankarq »

Just tell me how easy way run games on PC ? see my attached game file, all code in HEX
Attachments
1.rar
(5.5 KiB) Downloaded 169 times
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: 6502 to java possible ?

Post by BigEd »

Thanks for sharing! I can confirm that it looks like 6502 code in the 32k ROM image, because the last few bytes look like vectors, and with the ROM placed at 0 the reset vector points to this very normal reset routine:

Code: Select all

6D36 A2FF       ldx #FF
6D38 9A         txs 
6D39 D8         cld 
6D3A 200060   ` jsr 6000
but beyond that, it's difficult. You'd need to find an emulator for the exact hardware, or to modify an existing emulator. Your PCB has the legend SC-PK01 and I can't find anything with that name.

The ROM image has about 20k of useful data (Edit: much less, just over 8k), so I guess the machine has 5 ROMs of 4k each, or something like that (Edit: no, much less according to the dump!). There's a 6845 which is a video output chip. I see a pair of 2k static RAMs: I'd expect one of those to be for video and the other for workspace.

Do you know the name of the product that contained the board, or the manufacturer?

From the strings in the ROM, it looks like a coin-op, and a card game of some kind:
Quote:
ONLY ACE PAIR
2 PAIR
3 OF A KIND
STRAIGHT
FLUSH
FULL HOUSE
4 OF A KIND
STR FLUSH
ROYAL FLUSH
INSERT COIN
CREDIT
COINS IN
8COINS OUT
7GAMES
PLAY 5TO100
PUSH HOLD TO
HOLD CARD...
PUSH CANCEL TO
CANCEL HOLDS...
PUSH DRAW
TO PROCEED.
PUSH DEAL
BET ON
:CARD IS 8 OR MORE
--PUSH BIG
9CARD IS 6 OR LESS
--PUSH SMALL
Sorry, but this is a very difficult puzzle.
Last edited by BigEd on Wed Apr 18, 2018 7:33 pm, edited 2 times in total.
shivshankarq
Posts: 7
Joined: 18 Apr 2018

Re: 6502 to java possible ?

Post by shivshankarq »

BigEd wrote:
Thanks for sharing! I can confirm that it looks like 6502 code in the 32k ROM image, because the last few bytes look like vectors, and with the ROM placed at 0 the reset vector points to this very normal reset routine:

Code: Select all

6D36 A2FF       ldx #FF
6D38 9A         txs 
6D39 D8         cld 
6D3A 200060   ` jsr 6000
but beyond that, it's difficult. You'd need to find an emulator for the exact hardware, or to modify an existing emulator. Your PCB has the legend SK-PC01 and I can't find anything with that name.

The ROM image has about 20k of useful data, so I guess the machine has 5 ROMs of 4k each, or something like that. There's a 6845 which is a video output chip. I see a pair of 2k static RAMs: I'd expect one of those to be for video and the other for workspace.

Do you know the name of the product that contained the board, or the manufacturer?

From the strings in the ROM, it looks like a coin-op, and a card game of some kind:
Quote:
ONLY ACE PAIR
2 PAIR
3 OF A KIND
STRAIGHT
FLUSH
FULL HOUSE
4 OF A KIND
STR FLUSH
ROYAL FLUSH
INSERT COIN
CREDIT
COINS IN
8COINS OUT
7GAMES
PLAY 5TO100
PUSH HOLD TO
HOLD CARD...
PUSH CANCEL TO
CANCEL HOLDS...
PUSH DRAW
TO PROCEED.
PUSH DEAL
BET ON
:CARD IS 8 OR MORE
--PUSH BIG
9CARD IS 6 OR LESS
--PUSH SMALL
Sorry, but this is a very difficult puzzle.


Yes, It is "2 PAIR" game, Its coin operated video poker game

I don't know who is manufacturer,

You have any idea, How i can run this type games in PC ? you know any proper emulator which is fit for this type game?
or Any schematic of this type board means i am made from my local manufacture/supplier ?
You are Really Helping me and provide best info, i really thank full for your support.
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: 6502 to java possible ?

Post by BigEd »

There are a few similar machines which are covered by MAME - that's a free program you can run on the PC, which emulates thousands of arcades and coin-ops. You just need to get the ROMs from somewhere, figure out how to use MAME, and choose the right model of machine. I can't help with that, but there will be plenty of MAME support forums.
http://mamedev.org/release.html

(If you don't care too much precisely what game you run then MAME is certainly the answer.)

The more chip numbers you can see, the better - is there sound in this game? Can you find the number or name of the sound chip?

Can you clean the crystal (the metal can, top right) and read off the frequency? Could be 16MHz, could be something else.

Two machines which might be similar, but might not be identical:

Fun World / TAB / Impera
Series 7000 hardware.
65C02 + 2x PIAs + M6845 CRTC + AY8910

and

American Poker II (see here)

Do be careful visiting web sites about poker machines and ROMs for them - there will be scams and there could be malicious popups and similar.

(About the 32k ROM dump: it's actually just 8k of ROM and about 64 extra bytes of code which is probably some kind of copy protection, perhaps in some kind of mini-ROM.

Code: Select all

5000 A545    E  lda 45
5002 297F   )   and #7F
5004 8545    E  sta 45
5006 A201       ldx #01
5008 B547    G  lda 47,X
500A C909       cmp #09
500C D013       bne 5021
500E AD0130   0 lda 3001
5011 4545   EE  eor 45
5013 2907   )   and #07
5015 A200       ldx #00
5017 A003       ldy #03
5019 18         clc 
501A 4A     J   lsra 
501B B005       bcs 5022
501D E8         inx 
501E 88         dey 
501F 10F8       bpl 5019
5021 60     `   rts 
5022 8A         txa 
5023 0A         asla 
5024 AA         tax 
5025 BD3350  3P lda 5033,X
5028 8530    0  sta 30
502A E8         inx 
502B BD3350  3P lda 5033,X
502E 8531    1  sta 31
5030 6C3000 l0  jmp (0030)
5033 8550    P  sta 50
5035 B150    P  lda (50),Y
5037 EB         ill 
5038 5015   P   bvc 504F
503A 51FF   Q   eor (FF),Y
)
Last edited by BigEd on Wed Apr 18, 2018 7:22 pm, edited 1 time in total.
shivshankarq
Posts: 7
Joined: 18 Apr 2018

Re: 6502 to java possible ?

Post by shivshankarq »

BigEd wrote:
There are a few similar machines which are covered by MAME - that's a free program you can run on the PC, which emulates thousands of arcades and coin-ops. You just need to get the ROMs from somewhere, figure out how to use MAME, and choose the right model of machine. I can't help with that, but there will be plenty of MAME support forums.
http://mamedev.org/release.html

(If you don't care too much precisely what game you run then MAME is certainly the answer.)

The more chip numbers you can see, the better - is there sound in this game? Can you find the number or name of the sound chip?

Can you clean the crystal (the metal can, top right) and read off the frequency? Could be 16MHz, could be something else.

Two machines which might be similar, but might not be identical:

Fun World / TAB / Impera
Series 7000 hardware.
65C02 + 2x PIAs + M6845 CRTC + AY8910

and

American Poker II (see here)

Do be careful visiting web sites about poker machines and ROMs for them - there will be scams and there could be malicious popups and similar.

(About the 32k ROM dump: it's actually 16k of ROM and a very tiny extra piece of code which is probably some kind of copy protection, perhaps in some kind of mini-ROM.)


Thanks for reply, I am Try "mame" but how to run Hex file on that ? because "mame" ROMs are come in bin file with zip format.
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: 6502 to java possible ?

Post by BigEd »

Sorry, I'm no MAME expert. You're going to need help, because of the peculiar layout of the data in the 32k ROM dump you shared: it's not one ROM, it's at least two, and I don't know how they split, or how MAME deals with ROMs. I'm not even sure I've ever used MAME.
shivshankarq
Posts: 7
Joined: 18 Apr 2018

Re: 6502 to java possible ?

Post by shivshankarq »

BigEd wrote:
Sorry, I'm no MAME expert. You're going to need help, because of the peculiar layout of the data in the 32k ROM dump you shared: it's not one ROM, it's at least two, and I don't know how they split, or how MAME deals with ROMs. I'm not even sure I've ever used MAME.
Ok thanks for help, I am try to find solution on MAME forum. :)
White Flame
Posts: 704
Joined: 24 Jul 2012

Re: 6502 to java possible ?

Post by White Flame »

Note that if what you have is a dump from an existing, standard arcade board ROM (I can't tell from the picture if that's what it is), then odds are that the game in question is already part of MAME. The interesting case would be if you believe you have some unique variant.

Is there any big reason why Java is part of the original question?
shivshankarq
Posts: 7
Joined: 18 Apr 2018

Re: 6502 to java possible ?

Post by shivshankarq »

White Flame wrote:
Note that if what you have is a dump from an existing, standard arcade board ROM (I can't tell from the picture if that's what it is), then odds are that the game in question is already part of MAME. The interesting case would be if you believe you have some unique variant.

Is there any big reason why Java is part of the original question?

Because i am see following links, so i think anyone know about how to run in java or convert in java
http://gotocon.com/chicago-2016/present ... Javascript

https://www.youtube.com/watch?v=7WuRq-Wmw5o
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: 6502 to java possible ?

Post by BigEd »

Be careful: Java and JavaScript are two totally different languages!

JSBeeb is certainly a marvellous emulation of a 6502 machine...

It's also true that many MAME emulations are online and runnable in a browser at The Internet Archive, but I think they will be video games rather than slot machines:
https://archive.org/details/internetarcade
(Again, this uses JavaScript technology, but in a more brute-force way which will demand more of your browser)

But, as White Flame noted in the very first reply, it's not the emulation of the 6502 which is the main obstacle, it's the precise emulation of the surrounding hardware and peripherals. Especially when the software is built to try to prevent being run on copied hardware.
White Flame
Posts: 704
Joined: 24 Jul 2012

Re: 6502 to java possible ?

Post by White Flame »

The MAME stuff that runs in web browsers have most likely been cross-compiled from C to JS via Emscripten, which includes support for SDL and a few other I/O library APIs by mapping them to browser functions, so the C program thinks it's running in a normal PC desktop environment.

Of course, old 6502 ROM game code isn't part of a "normal PC desktop environment", and isn't compatible with anything else. If the original board isn't part of a known already-emulated arcade platform, you're going to need actual software development to do anything with it. Even if it is, you're going to have to learn how to create MAME configuration files & break up the individual ROMs properly from the dump you have. There's no simple drop-in solution here.
Post Reply