[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
MLB Crack: Yer Outta Here - Deleting Teams
On Thursday, October 18, 2012 6:56:07 PM UTC-5, Hot Rod wrote:
> Hi,
>
> I'm going to be adding a series of posts here describing my most recent retro computing project - a crack of the Micro League Baseball Box Score/Stat Compiler disk.
>
>
>
> ]HR
Yer Outta Here – or Delete Teams
As can be seen from the earlier look at the RWTS, there are no write routines in the RWTS residing at $900-$BFF. Yet the Box Score program allows team deletion as an option. And so does the General Manager/Owner program. So I knew they were around somewhere. I already had a clue where to look though, as I had seen disk routines in the $B900-$BF00 range from converting the disk. My thinking was that since the GM disk appeared to have the exact same function, I ought to be able to wire in the same write routines from it the same way. But there aren’t any write routines in the replacement RWTS in $900-$AFF either.
It turns out that for both the MLB programs and the cracks, that there is a separate set of routines used only for writing. Between the GM program and the Box Score program, they are pretty much the same, but located in memory differently. As a result, the cracked version of the GM disk had them located where the GM program had them. I needed to relocate them to where the Box Score program had its original write routines instead.
So rather than deeply studying the original write routines, I focused instead on lifting the ones from the GM disk crack and wiring them into the Box Score crack. But the original routines are fairly straightforward, and are pretty much spaced apart on page boundaries in memory, making it easier to decipher.
For the Box Score program, the “write out new teams roster” starts at $B020. The track/sector is stored in $2C/$2E, starting ($34/$35) and ending ($37/$38) buffer addresses (lo/hi), and then the write routine entry is called, $B068. This then falls through to $B04E to write again. The actual entry to write buffers is at $B9E0. It is only called from $B068, so the 'D'elete routine is the only use. If you look at the code from $B9E0 to $BEBE, you’ll see that it contains the routines to write out the 4+4 encoded sectors, given a starting track/sector (at $2C/$2E), starting and ending buffers.
The RWTS write routine for MLB GM crack has its entry at $21EB, but uses $2000-$23FF, although code is only within $2100-23FF. So the replacement routine was smaller than the original code footprint, making it easy to patch in. All I had to do was to relocate the addressing, and layer it over the sectors loaded by what the Box Score was already loading there:
$2000 -> $BA00
$2100 -> $BB00 (t13, s4)
$2200 -> $BC00 (t13, s5)
$2300 -> $BD00 (t13, s6)
Then I needed to match the modifications made to use the replacement write routines. Instead of passing in track/sector/start/end, it passes in just an index to lookup the info from another table. Since the delete is only limited to teams, and they are on fixed locations on all the disks, there are only two entries, so only two possible values are used. The only change to the table for use on the Box Score disk was a buffer address (which was different than the one used by the GM program).
The resulting quick notes are:
Patch calls at $B020+, which is on t12,s9
store #$02 at $37 and #$00 at $38 for first call (buffer was $3C00-$3DFF)
store #$02 at $37 and #$01 at $38 for second call (buffer was $3800-$3BD9)
NOP the rest of the setup code.
With all this in place, now the Delete function works.
]HR