This page will include WIP screenshots and other fun stuff for MAME™, M1, and whatever else I'm working on.

8/17/2020

Compatibility is a tricky business

One of the major exclusive games for the Apple IIgs was Alien Mind, by programmer Robin Kar and artist Matt Crysdale. The game originally came on 2 protected 3.5″ disks using a non-standard format which fit 920K on a disk (Apple’s standard format fit 800K). There’s a common crack by a French group called the F.U.C.K. on 3 normally formatted disks which uses the standard SmartPort firmware interface to the 3.5″ drive. In theory, this should be able to work with a lot of mass storage devices for the IIgs, most of which implemented at least some version of the SmartPort API in their on-card firmware.

In practice, this didn’t work out so well, so someone who goes by ballmerpeak decided to fix some issues with the crack. First up, they made it work on ROM 03 machines, but it was still only the first disk and hardcoded slot 5. In part 2 they concatenated the 3 disks of the crack plus a 4th save game disk into a single .2MG image and made it all work that way. Unfortunately, that version doesn’t boot on any of the 3 available emulated mass storage cards in MAME that should otherwise work. The CFFA2 and CMS SCSI II Card (with the 3-1-1990 ROM revision) support SmartPort as originally defined, with 16-bit buffer and block addresses. The IIgs introduced an extension called “extended SmartPort” which made the buffer and block addresses both 32 bits if the command number has bit 6 set. And the F.U.C.K. crack as modified by ballmerpeak relies heavily on extended SmartPort, so those two cards are out without extensive patching.

However, MAME also supports the Apple Rev C. SCSI Card, which does support extended SmartPort. So it should work, right? Nope, trying to boot it there results in loading for a second and then the tell-tale Monitor beep of a BRK crash. (Alien Mind has set the text and background colors both to black at this point, so you can’t actually see what’s going on). Investigation with the MAME debugger showed that the SCSI Card firmware was actually doing the crashing, and it’s because Alien Mind was making SmartPort calls with the 65816 direct page register set to $AF00, when the card firmware assumed it would be at the classic 6502-compatible location of $0000. Fortunately, ballmerpeak included their disassembly of the boot loader and “DOS” code. I noticed some nice empty space at $B1C6 where a patch could go, and used MAME’s debugger to patch the code in RAM before it executed accordingly. That was successful!

The patch looks like this:
$B2D0 became JMP $B1C6. At $B1C6 we did SEC / XCE / PHY / PHX, imitating the original code at $B2D0. Next the patch did PHD / PEA $0000 / PLD (which saves the existing direct page and sets it to the $0000 the SCSI Card firmware is looking for) and then JMP $B2D5 to resume the code at the actual SmartPort call. (We couldn’t easily relocate the call itself because it’s patched by several places in the code). At $B2DD there was a BCS instruction checking for errors in the SmartPort call; we needed that space and since we’re targeting emulators primarily we can safely assume the reads will never fail. So at $B2DD we changed it to PLD / NOP to restore the original direct page, and the NOP simply takes out what was the second byte of the BCS.

Unfortunately, all of this code is compressed on disk, so we couldn’t easily modify it there. Fortunately, there’s lots of space in the initial boot loader after ballmerpeak disabled the F.U.C.K.’s original crack screen. There’s a routine at $0A3C that originally waited for a key or mouse press in the crack screen; we repurposed it to patch the freshly decompressed code with the patch above. We changed $091B to jump to our new patch code at $0A3C immediately after decompressing the next stage instead of actually running the decompressed code. The patch at $0A3C consists of JSR $0962 / LDX #$000c / $0A42: LDA $0A60,X / STA $22A2,X / DEX / DEX / BPL $0A42 / LDA #$EA2B / STA $23B9 / LDA #$C64C / STA $23AC / LDA #$B1B1 / STA $21AE / BRA $0AB0. The loop creates the main body of the patch at $B1C6, and the 3 LDA/STA pairs insert the JMP at $B2D0 and change the BCS to the PLD / NOP sequence.

With all of this fun out of the way, the game works fine on MAME with the Rev. C SCSI Card emulation:

And here is the patched .2MG image, renamed “alienmind2016b” from “alienmind2016a”, because I was too lazy to edit the title screen like ballmerpeak did. Sometime I might try and figure out why the SCSI Card’s firmware is failing and see if it can be fixed, but this works for now.

Posted by Arbee in General @ 9:30 pm -

8/2/2020

Dreaming in color

Some new Apple II progress that just went in includes support for a new Monitor Type: “Video-7 RGB”. RGB cards for the Apple II existed before the //e, but the Video-7 card, designed by //e designer Walt Broedner, added some Apple /// like capabilities to the mix. (The Video-7 card was also sold by Apple under their own branding, and cloned by the French “Le Chat Mauve” card, among others).

These new capabilities included the ability to force monochrome double-hi-res (560×192), which was supported by Apple II DeskTop:

The ability to change the foreground and background colors of individual text characters in 40-column mode:

A 160×192 double-hi-res mode with a much more straightforward memory layout than normal double-hi-res:

(It’s a little squished because there’s no great way to fit a 160-wide mode onto a 560-wide screen; in real life the analog properties of CRTs make it scale seamlessly but in emulation we have no such luck).

And the ability to mix color 140×192 and monochrome 560×192 double-hi-res on the same screen. Sierra games used this to make the text not have color fringing on RGB monitors, as seen here:

Posted by Arbee in General @ 8:33 am -

3/28/2019

An Apple II emulation first!

MAME just became the first Apple IIgs emulator capable of emulating an Apple II with a SCSI CD-ROM drive attached. This means the IIgs driver can boot from and use the Golden Orchard CD-ROM, and it can browse other CD-ROMs.

Here we are after booting from the Golden Orchard 1.2 CD-ROM:

And here’s the IIgs Finder browsing a PlayStation game disc:

Posted by Arbee in General @ 10:59 pm -

3/27/2019

MAME 0.208 Apple II and /// updates

In addition to adding more 4am preserved software to our Software List functionality, 0.208 has the following things of interest to pre-Mac Apple fans:

-As a side effect of UNIX workstation work in MAME, a nasty SCSI bug that had been plaguing the Apple II SCSI Card (Rev. C) emulation was squashed. It’s now possible to partition, format, and use emulated SCSI hard drives with no problems, including using the System 6.0.x drivers.
-qkumba fixed the default state of the language card on the II/II Plus. This solved compatibility with some games.
-I fixed the TransWarp card emulation to slow down to 1 MHz when reading the joysticks/paddles. This allows playing the IIe version of Tomahawk and any other 8-bit accelerator-aware games.
-I also added a ton of NiftyList-style annotations to the IIgs disassembler, including Toolbox calls, all the I/O locations, and all of the bank $E0 and $E1 system globals mentioned in the System 6 source code.
-I re-added Vulcan and Vulcan Gold support for the IIgs. Unfortunately the boot ROMs we currently have are for the IIgs version of the drive and have 65C816 instructions. If someone has one of these drives that works on a //e, reading the ROM out would be very helpful.
-I saw David Schmidt’s Apple /// SOS drivers for the Focus Drive card, obtained a copy of the card’s ROM and software, and added support. It works on the IIe, IIgs, and /// emulation.

As always, if you’d like to see MAME support more Apple II cards, we need dumps of any and all ROMs on them and any supporting software/drivers. Hit us up with what you’ve got by emailing messdrivers at gmail dot com, and II Infinitum!

Posted by Arbee in General @ 10:46 pm -
Translate
German Flag Spanish Flag French Flag Italian Flag Portuguese Flag Japanese Flag Korean Flag Chinese Flag British Flag
Plugin by Simple Thoughts

Content
Home
SDLMAME/MESS/HazeMD home
NEStopia Linux home
AO .PSF2 status
AO SDK (source)
My music rips
M1 home
WIP driver downloads
Links
2A03 (NES music)
Aaron’s WIP
AMIKAI Japanese/English translator
Arcademania.eu
Audio Overload forum
Audio Overload home
BizLingo Japanese/English translator
Bobby Tribble's Unemulated Games
Dave Widel's page
David Haywood (Haze)'s WIP
Discrete Logistics
Dox's WIP
FPGA Arcade
Frank Palazzolo's WIP
Kale's MAME WIP
Kohina (Great VGM stream!)
KSS Kingdom (MSX music)
Luca Elia's WIP
MAME E2J, home of BridgeM1
MAME Testers
MAMEdev.org
MAMEWorld
Nicola's WIP
Project 2612 (Genesis VGM rips)
Reip's WIP
Robiza's WIP
ROP Music Laboratory
Slick's NSFE downloads
SMF's blog
SNESMusic
System 16, the Arcade Museum
The Guru's WIP
The MOD Archive
Tourniquet's WIP
Ville's Development Log
Zophar's music archive

Categories



Archives

March 2021
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
293031  


Meta
RSS 2.0
Comments RSS 2.0
WordPress

Powered by WordPress