|
Joined: Sep 2013
Posts: 14
Member
|
Member
Joined: Sep 2013
Posts: 14 |
Yes those are the same horizontal lines I'm seeing. I don't see them on static 'no-motion' screens, but in my case, I do see them when there's horizontal scrolling or motion like in Rescue Raiders or Wings of Fury. They are present during both game-play and the intros. So will they eventually go away when the machine warms up a little?
|
|
|
|
Joined: Feb 2014
Posts: 1,102 Likes: 173
Very Senior Member
|
Very Senior Member
Joined: Feb 2014
Posts: 1,102 Likes: 173 |
I wanted to see if my Sirius Joyport hack would work with the apple2 driver and it seems to be a bit simpler: Yes, it's hacky but it works. I'm having a blast beating Stellar 7 again, this time with the Atari Joystick. ./mame64 apple2p stellar7 -speed 1.5 (it's a bit better a little faster I think, you may have to do -frameskip 4 to get it to actually go faster)
$ cat diff_apple2sirius.cpp
114a115,116
> m_djoy_0_1(*this, "djoy_0_1"),
> m_djoy_b(*this, "djoy_b"),
136a139
> required_ioport m_djoy_0_1, m_djoy_b;
640a644
> if (!(m_sysconfig->read() & 0x80)) // if not Sirius Joyport enabled
641a646,650
> else {
> // Sirius Joyport return joystick button, active low so read is inverted before &,
> // return 0x0 if pressed, 0x80 if not pressed
> return (~(m_djoy_b->read()) & 0x01) ? 0x0 : 0x80;
> }
644c653,659
< return (m_joybuttons->read() & 0x20) ? 0x80 : 0;
---
> if (!(m_sysconfig->read() & 0x80)) // if not Sirius Joyport enabled
> return (m_joybuttons->read() & 0x20) ? 0x80 : 0;
> else {
> // Sirius Joyport return Up (0x01) or Left (0x04) depending on Annunciator #1,
> // active low so read is inverted before &, return 0x0 if pressed, 0x80 if not pressed
> return ((~(m_djoy_0_1->read())) & ((m_an1) ? 0x01 : 0x04)) ? 0x0 : 0x80;
> }
646a662
> if (!(m_sysconfig->read() & 0x80)) { // if not Sirius Joyport enabled
652a669,675
> }
>
> else {
> // Sirius Joyport return status of Down (0x02) or Right (0x08) depending on Annunciator #1,
> // active low so read is inverted before &, return 0x0 if pressed, 0x80 if not pressed
> return ((~(m_djoy_0_1->read())) & ((m_an1) ? 0x02 : 0x08)) ? 0x0 : 0x80;
> }
1146a1170,1191
> static INPUT_PORTS_START( apple2_sirius_joyport )
> PORT_START("djoy_0_1")
> PORT_BIT(0x01, 0x01, IPT_JOYSTICK_UP) PORT_CODE(KEYCODE_8_PAD) PORT_CODE(JOYCODE_Y_UP_SWITCH) PORT_PLAYER(1)
> PORT_BIT(0x02, 0x02, IPT_JOYSTICK_DOWN) PORT_CODE(KEYCODE_2_PAD) PORT_CODE(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(1)
> PORT_BIT(0x04, 0x04, IPT_JOYSTICK_LEFT) PORT_CODE(KEYCODE_4_PAD) PORT_CODE(JOYCODE_X_LEFT_SWITCH) PORT_PLAYER(1)
> PORT_BIT(0x08, 0x08, IPT_JOYSTICK_RIGHT) PORT_CODE(KEYCODE_6_PAD) PORT_CODE(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1)
> PORT_BIT(0x10, 0x10, IPT_JOYSTICK_UP) PORT_CODE(KEYCODE_8_PAD) PORT_CODE(JOYCODE_Y_UP_SWITCH) PORT_PLAYER(2)
> PORT_BIT(0x20, 0x20, IPT_JOYSTICK_DOWN) PORT_CODE(KEYCODE_2_PAD) PORT_CODE(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(2)
> PORT_BIT(0x40, 0x40, IPT_JOYSTICK_LEFT) PORT_CODE(KEYCODE_4_PAD) PORT_CODE(JOYCODE_X_LEFT_SWITCH) PORT_PLAYER(2)
> PORT_BIT(0x80, 0x80, IPT_JOYSTICK_RIGHT) PORT_CODE(KEYCODE_6_PAD) PORT_CODE(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2)
>
> PORT_START("djoy_b")
> PORT_BIT(0x01, 0x01, IPT_BUTTON1) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(JOYCODE_BUTTON1) PORT_PLAYER(1)
> PORT_BIT(0x02, 0x02, IPT_BUTTON1) PORT_CODE(JOYCODE_BUTTON1) PORT_PLAYER(2)
> PORT_BIT(0x04, 0x04, IPT_UNUSED)
> PORT_BIT(0x08, 0x08, IPT_UNUSED)
> PORT_BIT(0x10, 0x10, IPT_BUTTON2) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_PLAYER(1)
> PORT_BIT(0x20, 0x20, IPT_BUTTON2) PORT_CODE(JOYCODE_BUTTON2) PORT_PLAYER(2)
> PORT_BIT(0x40, 0x40, IPT_UNUSED)
> PORT_BIT(0x80, 0x80, IPT_UNUSED)
> INPUT_PORTS_END
>
1147a1193
> PORT_INCLUDE( apple2_sirius_joyport )
1161a1208,1212
>
> PORT_CONFNAME(0x80, 0x00, "Gameport type")
> PORT_CONFSETTING(0x00, "Normal")
> PORT_CONFSETTING(0X80, "Sirius Joyport (Atari Digital)")
>
|
|
|
|
Joined: Oct 2015
Posts: 24
Member
|
Member
Joined: Oct 2015
Posts: 24 |
I had a question regarding how MAME chooses the floppy format. I am using the apple3 emulation and trying to load a Prodos ordered disk image, but having issues. The disk is a modified atomic-defense disk but now in po format, so its not a prodos/sos disk as such.
Does MAME used the file extension or does it detect the sector ordering some other way? Is there a way to force using po ordering?
|
|
|
|
Joined: Dec 2015
Posts: 173 Likes: 11
Senior Member
|
Senior Member
Joined: Dec 2015
Posts: 173 Likes: 11 |
The MAME code the Apple .DSK formats supports both sector orders, but the algorithm it uses to identify images in this case doesn't look at sector orders. It seems that only a file having the .po extension will be detected as ProDOS format.
|
|
|
|
Joined: Mar 2001
Posts: 17,217 Likes: 234
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 17,217 Likes: 234 |
Depends on the disk controller. wozfdc attempts to algorithmically identify the sector order by matching known boot sectors, and that's what the apple3 driver uses. On apple2/2p/2e the same applies. On the IIgs, and on earlier IIs if you use "-sl6 diskii", it does use the file extension to determine the sector order.
robj: is that disc image available someplace? I can add it to the heuristics.
|
|
|
|
Joined: Feb 2014
Posts: 1,102 Likes: 173
Very Senior Member
|
Very Senior Member
Joined: Feb 2014
Posts: 1,102 Likes: 173 |
More stupid fun, I wanted to be able to click on the apple graphics screen and find out the x,y coordinates and the memory location. It got tiring to save a screenshot, then load into gimp to figure out what the coordinates were. So why not have mame help me out. If I execute this routine, it will give me the coordinates, draw a line and a box around it where I click on the screen. Once I know the address then I can just set a watchpoint in the debugger. which allowed me to set a watchpoint "wp 3106,1,w" and then once it hit that, do a "history" which led me to a routine around 7E46 and disassembling at 7E00 points me to the memory addresses at 81F8 to 81FA where the player score is stored.
function rem(a) print(a) end
function remp(a,b,c,d) print(a,b,c,d) end
function rem(a) end
function float(f) return string.format("%6.2f",f) end
function hex(a) return string.format("0x%02x",a) end
function calc(line) return line % 8 * 1024 + math.floor(line / 64) * 40 + math.floor((line%64) / 8) * 128 +8192 end
emu.unpause()
function findmouse()
print("BEGIN")
for i=1,50 do
emu.wait(0.25)
rem(manager:machine():uiinput():find_mouse())
x,y,button,target=manager:machine():uiinput():find_mouse()
if target==nil then print ("TARGET=nil") return
else
if button then
print("\nBUTTON PRESSED")
manager:machine().screens[":screen"]:draw_line(0,0,x/target:width()*559,y/target:height()*191,0xffffffff)
boxsize=4
manager:machine().screens[":screen"]:draw_box(x/target:width()*559-boxsize*2,y/target:height()*191-boxsize,x/target:width()*559+boxsize*2,y/target:height()*191+boxsize,0x22ffffff,0xffff0000)
xsize=target:width()
ysize=target:height()
textx=math.min(math.floor(x/xsize*560+10),400)
texty=math.min(math.floor(y/ysize*192+10),160)
manager:machine().screens[":screen"]:draw_text(textx,texty,"x="..float(x/xsize*280).." y="..float(y/ysize*192).."\n addr="..hex(calc(math.floor(y/ysize*192))+math.floor(x/xsize*279/7)),0xffffffff,0xffff0000)
emu.pause()
return
end
xsize=target:width() ysize=target:height()
io.write("\rx="..float(x/xsize*279) ..", y="..float(y/ysize*191) .." address="..hex(calc(math.floor(y/ysize*191))+math.floor(x/xsize*279/7)).." ")
rem("Should it be *191 or *192?")
end
end
end
findmouseco=coroutine.create(findmouse) coroutine.resume(findmouseco)
A couple of notes, if you have the debugger paused, it won't work because the emu.wait() won't get fired. If the target is nil, just click on a couple of windows and try it again. And you have to emu.unpause() to get everything moving again. Now to figure out where the shield gauge routine is:
Last edited by Golden Child; 01/30/19 07:32 PM.
|
|
|
|
Joined: Jun 2014
Posts: 95 Likes: 3
Member
|
Member
Joined: Jun 2014
Posts: 95 Likes: 3 |
You want to cheat in Stellar 7? That's a cool script. Normally, I just set individual watch-points on the screen lines ($2000-2027, $2400-2427, $2800-2827, etc) to know when things are hit. I don't think that I've needed pixel-level breakpoints so far.
|
|
|
|
Joined: Mar 2001
Posts: 17,217 Likes: 234
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 17,217 Likes: 234 |
That's a very cool script!
|
|
|
|
Joined: Feb 2014
Posts: 1,102 Likes: 173
Very Senior Member
|
Very Senior Member
Joined: Feb 2014
Posts: 1,102 Likes: 173 |
Hi Peter,
I don't really want to cheat so much as fully understand the code. Cheating in Stellar 7 would totally spoil the whole experience. 8-) I like the sense of panic when your shield is running out, and then you've got to go into stealth mode.
I've got a project where I want to completely disassemble Stellar 7's code and figure out what everything does. I'd like to try and rewrite it with better graphics, but playing exactly like the original.
It's such a work of art that I'm amazed to this day that such a great game could be done on the Apple 2.
Thanks for your compliment!
|
|
|
|
Joined: Feb 2014
Posts: 1,102 Likes: 173
Very Senior Member
|
Very Senior Member
Joined: Feb 2014
Posts: 1,102 Likes: 173 |
Thanks, RB! If you like that one, here's a "better version" that gets called by emu.register_frame_done() so it runs after every frame as an overlay.
function rem(a) print(a) end
function remp(a,b,c,d) print(a,b,c,d) end
function rem(a) end
function float(f) return string.format("%6.2f",f) end
function hex(a) return string.format("0x%02x",a) end
function calc(line) return line % 8 * 1024 + math.floor(line / 64) * 40 + math.floor((line%64) / 8) * 128 +8192 end
function myframedispatcher() if myframedispatchlist ~= nil then for i,j in pairs(myframedispatchlist) do j() end end end
function draw_crosshairs()
x,y,button,target=manager:machine():uiinput():find_mouse()
if target==nil then print ("TARGET=nil") return end
manager:machine().screens[":screen"]:draw_line(0,0,x/target:width()*559,y/target:height()*191,0xffffffff)
boxsize=4
manager:machine().screens[":screen"]:draw_box(x/target:width()*559-boxsize*2,y/target:height()*191-boxsize,x/target:width()*559+boxsize*2,y/target:height()*191+boxsize,0x22ffffff,0xffff0000)
xsize=target:width()
ysize=target:height()
textx=math.min(math.floor(x/xsize*560+10),400)
texty=math.min(math.floor(y/ysize*192+10),160)
manager:machine().screens[":screen"]:draw_text(textx,texty,"x="..float(x/xsize*280).." y="..float(y/ysize*192).."\n addr="..hex(calc(math.floor(y/ysize*192))+math.floor(x/xsize*279/7)),0xffffffff,0xffff0000)
if button then
myframedispatchlist={}
end
end
myframedispatchlist={} table.insert(myframedispatchlist,draw_crosshairs)
if alreadyregisteredmyframedispatcher==nil then
emu.register_frame_done(myframedispatcher)
alreadyregisteredmyframedispatcher=true
end
function clrd() myframedispatchlist={} end
If you press the button, it will clear the dispatcher and won't draw the target anymore. If it goes runaway, you can type "clrd()" and hit return to stop the function calls.
Last edited by Golden Child; 01/31/19 03:17 AM.
|
|
|
1 members (Dodg),
319
guests, and
4
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
Forums9
Topics9,320
Posts121,944
Members5,074
|
Most Online1,283 Dec 21st, 2022
|
|
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!
|
|
|
|