Previous Thread
Next Thread
Print Thread
Page 1 of 4 1 2 3 4
Joined: Feb 2014
Posts: 1,220
Likes: 223
G
Very Senior Member
Very Senior Member
G Offline
Joined: Feb 2014
Posts: 1,220
Likes: 223
I was browsing around and noticed that there was a driver for the atari 2600 POP.

The Sears version was pretty much the same thing, only it had 3 more games. Reading the field service manual says that there's a DIP switch where you can set the number of free rom slots, so why not hook it up so you can set the number of games available.

Also, why not make a lua script layout that gives you the game list.

[Linked Image from i.imgur.com]

Code
gamelist = [[Adventure
Target Fun
Asteroids
Backgammon
Basketball
Bowling
Breakaway
Canyon Bomber
Poker Plus
Circus
Tank Plus
Dodger Cars
Football
Golf
Hangman
Baseball
Cannonman
Maze Mania
Missile Command
Night Driver
Othello
Gunslinger
Soccer
Darediver
Maze
Space Invaders
Speedway II
Superman
Tic-Tac-Toe
Checkers
Chess
Pong Sports
Pinball
Warlords
Berzerk
Haunted House
Math Grand Prix
Defender
Yar's Revenge
Pac-Man
Super Breakout
Demons To Diamonds
Submarine Commander
Stellar Track
Steeple Chase]]

linecount=0
for line in gamelist:gmatch("([^\n]*)\n?") do
  linecount=linecount+1
  print(line,linecount)
end


function opentag(t,i) return "<"..t.." "..i..">" end
function closetag(t) return "</"..t..">" end
function tag(t,i) return '<'..t.." "..i.."/>" end
function attr(a,v) return a.."="..'"'..v..'" ' end


function colorrgb(r,g,b) return tag("color",(attr("red",r)..attr("green",g)..attr("blue",b))) end

color = {}
color[2] = colorrgb(.839,.408,.275)
color[3] = colorrgb(.659,.384,.290)
color[0] = colorrgb(.875,.557,.315)
color[1] = colorrgb(.906,.510,.278)


print()
print([[<?xml version="1.0"?>
<!--
license:CC0-1.0
copyright-holders:
-->]])

print(opentag("mamelayout",attr("version",2)))

for i=0,3 do 
print (opentag("element",attr("name","rectcolor"..i)..attr("defstate","0")))
print (opentag("rect",attr("state","0"))..color[i]..closetag("rect"))
print (closetag("element"))
end

function textelement(n,s) return opentag("element",attr("name",n))..opentag("text",attr("string",s))..colorrgb(1.0,1.0,1.0)..closetag("text")..closetag("element") end

linecount=0
for line in gamelist:gmatch("([^\n]*)\n?") do
  linecount=linecount+1
--  print(line,linecount)
  game=line
  gamecount=linecount
  print(textelement("textgame"..gamecount,game.."  "..gamecount))
end

function elementxywh(r,x,y,w,h) return opentag("element",attr("ref",r))..tag("bounds",attr("x",x)..attr("y",y)..attr("width",w)..attr("height",h))..closetag("element") end

print(opentag("view",attr("name","Game List Panel")))

--<screen index="0"><bounds x="0" y="-500" width="625" height="500" /></screen>

print(opentag("screen",attr("index",0))..tag("bounds",attr("x",0)..attr("y",-500)..attr("width",625)..attr("height",500))..closetag("screen"))


x0 = 0
xwidth = 65
xgap = 5
y0 = 0
yheight=20
ygap = 2
ymax = (yheight+ygap) * (5-1)

x=x0
y=y0

for g=1,gamecount do
print((elementxywh("rectcolor"..g%4,x,y,xwidth,yheight)))
print((elementxywh("textgame"..g,x,y,xwidth,yheight)))
y=y+yheight+ygap
if y>ymax then
  y=y0
  x=x+xwidth+xgap
end
end

print(closetag("view"))
print(closetag("mamelayout"))

Joined: Feb 2014
Posts: 1,220
Likes: 223
G
Very Senior Member
Very Senior Member
G Offline
Joined: Feb 2014
Posts: 1,220
Likes: 223
I was also trying a layout with the game list on the sides:

[Linked Image from i.imgur.com]

1 member likes this: Guru
Joined: Feb 2014
Posts: 1,220
Likes: 223
G
Very Senior Member
Very Senior Member
G Offline
Joined: Feb 2014
Posts: 1,220
Likes: 223
It also got me interested in the Basic Programming cartridge (which is terrible by the standards of today, but quite an achievement to make something that could work on a limited system)

I put an image in my layout, and wanted to overlay some buttons, so I made a little lua script so that I could find the coordinates:


Code
function mypointercb(type,id,devid,hpos,vpos,mask,clickcount) 
cvb=manager.machine.render.targets:at(1).current_view.bounds 
if clickcount > 0 then print(hpos,vpos,"COORDS "..(cvb.x1-cvb.x0) * hpos + cvb.x0..","..(cvb.y1-cvb.y0)*vpos+cvb.y0) end end

manager.machine.render.targets:at(1).current_view:set_pointer_updated_callback(mypointercb)

0.49349498748779 0.39370077848434 COORDS 343.65199375153,-287.40157961845
0.0026611471548676 0.0068897637538612 COORDS -97.607628707774,-496.27952757291


Entering a program on the keypad really makes you appreciate a real computer keyboard.

[Linked Image from i.imgur.com]

1 member likes this: robcfg
Joined: Feb 2014
Posts: 1,220
Likes: 223
G
Very Senior Member
Very Senior Member
G Offline
Joined: Feb 2014
Posts: 1,220
Likes: 223
So can we display the mouse pointer coordinates in real time?


[Linked Image from i.imgur.com]


Code
function drawframe() 
x=x or 0 y = y or 0 
manager.machine.render.ui_container:draw_box(0,0,.3,.1,0xffffffff,0x80ff0000)
manager.machine.render.ui_container:draw_text(0,0,"Coords = "..string.format("%3.2f",x)..","..string.format("%3.2f",y))
end

emu.register_frame_done(drawframe)



function mypointercb(type,id,devid,hpos,vpos,mask,clickcount)
 cvb=manager.machine.render.targets:at(1).current_view.bounds
 x,y=(cvb.x1-cvb.x0) * hpos + cvb.x0,(cvb.y1-cvb.y0)*vpos+cvb.y0 
end

manager.machine.render.targets:at(1).current_view:set_pointer_updated_callback(mypointercb)

Joined: Jan 2021
Posts: 193
Likes: 10
=
Senior Member
Senior Member
= Offline
Joined: Jan 2021
Posts: 193
Likes: 10
Originally Posted by Golden Child
It also got me interested in the Basic Programming cartridge (which is terrible by the standards of today, but quite an achievement to make something that could work on a limited system)
...
Entering a program on the keypad really makes you appreciate a real computer keyboard.
MAME should emulate the Spectravideo CompuMate (I own one).

https://en.wikipedia.org/wiki/CompuMate

This was an actual "homecomputer" addon for Atari 2600, containing a rather basic BASIC, a simple music sequencer with melodies, a paint program etc. Although it was still more like a toy laptop, this technical marvel deserves to be supported. It even could save data on cassette. Likely the address bus was routed through cables in both joystick ports, because it immediately crashes when unplugging.


MAY THE SOFTWARE BE WITH YOU!

{weltenschule.de}
Joined: Feb 2014
Posts: 1,220
Likes: 223
G
Very Senior Member
Very Senior Member
G Offline
Joined: Feb 2014
Posts: 1,220
Likes: 223
The compumate looks interesting.


From the source of the z26 emulator, it controls its banking through the controller ports.

Code
/*
	10 -- Compumate [CM]

	there are 4 4K banks selectable at $1000 - $1FFFF
	bankswitching is done though the controller ports
	INPT0: D7 = CTRL key input (0 on startup / 1 = key pressed)
	INPT1: D7 = always HIGH input (tested at startup)
	INPT2: D7 = always HIGH input (tested at startup)
	INPT3: D7 = SHIFT key input (0 on startup / 1 = key pressed)
	INPT4: D7 = keyboard row 1 input (0 = key pressed)
	INPT5: D7 = keyboard row 3 input (0 = key pressed)
	SWCHA: D7 = tape recorder I/O ?
	       D6 = 1 -> increase key collumn (0 to 9)
	       D5 = 1 -> reset key collumn to 0 (if D4 = 0)
	       D5 = 0 -> enable RAM writing (if D4 = 1)
	       D4 = 1 -> map 2K of RAM at $1800 - $1fff
	       D3 = keyboard row 4 input (0 = key pressed)
	       D2 = keyboard row 2 input (0 = key pressed)
	       D1 = bank select high bit
	       D0 = bank select low bit
	
	keyboard collumn numbering:
	collumn 0 = 7 U J M
	collumn 1 = 6 Y H N
	collumn 2 = 8 I K ,
	collumn 3 = 2 W S X
	collumn 4 = 3 E D C
	collumn 5 = 0 P ENTER SPACE
	collumn 6 = 9 O L .
	collumn 7 = 5 T G B
	collumn 8 = 1 Q A Z
	collumn 9 = 4 R F V
*/


Joined: Feb 2014
Posts: 1,220
Likes: 223
G
Very Senior Member
Very Senior Member
G Offline
Joined: Feb 2014
Posts: 1,220
Likes: 223
Working with the Basic Programming is an exercise in frustration due to how hard it is to enter a program.

I want to make an onscreen keyboard that will allow you to avoid all of the mode switching.

The idea is to look at the COLUPF register. The different colors are white (0xe), red(0x36), blue (0x86) and green (0xc8).


[Linked Image from i.imgur.com]


Code
[MAME]> print(string.format("%x",emu.item(manager.machine.devices[":tia_video"].items["0/COLUPF"]):read()))
e
[MAME]> print(string.format("%x",emu.item(manager.machine.devices[":tia_video"].items["0/COLUPF"]):read()))
36
[MAME]> print(string.format("%x",emu.item(manager.machine.devices[":tia_video"].items["0/COLUPF"]):read()))
86
[MAME]> print(string.format("%x",emu.item(manager.machine.devices[":tia_video"].items["0/COLUPF"]):read()))
c8

Joined: Jan 2006
Posts: 3,694
Very Senior Member
Very Senior Member
Joined: Jan 2006
Posts: 3,694
Compumate controller plugs into both joy ports at once, and this was not possible to be done (maybe it still isn't) in MAME :-(

Joined: Jan 2021
Posts: 193
Likes: 10
=
Senior Member
Senior Member
= Offline
Joined: Jan 2021
Posts: 193
Likes: 10
Is the problem the menu structure to assign controllers to emulators? The Compumate can never make use of different game controllers anyway. So it should be easy to simply make the a2600 emulator ignore things plugged into joyports when the rom mapper is of the type "Compumate", and instead route the additional signals internally. So despite within the menu something else stays formally plugged into joyports, Compumate just won't see it but send its address signals to the chip.


MAY THE SOFTWARE BE WITH YOU!

{weltenschule.de}
Joined: Feb 2014
Posts: 1,220
Likes: 223
G
Very Senior Member
Very Senior Member
G Offline
Joined: Feb 2014
Posts: 1,220
Likes: 223
[Linked Image from i.imgur.com]

I figured that maybe it'd be a little easier to create a subclass of a2600 and watch the writes to the controller ports to do the bank switching.

The compumate basic is super quirky and really limited, but is interesting as a curiosity.

You don't type RUN, that won't work, you have to use the keycodes like CTRL+R. This makes the special Run token. It helps you out by treating the first character that you type as if you were holding CTRL.

Line numbers can go from 1 to 99.

1 member likes this: =CO=Windler
Page 1 of 4 1 2 3 4

Link Copied to Clipboard
Who's Online Now
1 members (AJR), 156 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,373
Posts122,615
Members5,085
Most Online1,529
Jun 7th, 2025
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Powered by UBB.threads™ PHP Forum Software 8.0.0