Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Paperboy (SMS) builds difference

Reply to topic
Author Message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8651
  • Location: Paris, France
Reply with quote
Paperboy (SMS) builds difference
Post Posted: Sat Aug 09, 2008 5:16 pm
I don't have time to continue that right now, so I'll post the info, maybe resume work later or someone can do it.

There's 2 different ROM for Paperboy:

USA/BR version:
# d 3138
 3138: CB 46        BIT 0,(HL)
 313A: CC 15 4B     CALL Z,4B15h
 313D: C9           RET


European version:
# d 3138
 3138: CD 13 4B     CALL 4B13h
 313B: C9           RET


Other differences in the code are due to this change, which offset all the later code and references.

This looks very much like a bug fix. However I don't know which version is the original and which is the 'fixed' one. If I had to guess I would say that the USA/BR with the added test is the fixed version, but we can't be sure without analyzing the purpose of this test and associated data.

I could break execution at 3138h by playing a few seconds on the first level, so it should be easily reachable code.

Anyone?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14744
  • Location: London
Reply with quote
Post Posted: Sat Aug 09, 2008 9:19 pm
The breakpoint is hit when newspapers hit the houses, it seems. (I hate this game.) HL has various values in the D4D1+ range, suggesting maybe this is an array of houses, and the flags in the byte are telling us something.

Looking at the intro screen, we see that D4BB-D4CE are 0 for non-customers and 1 for customers (20 total). D4D1+ has a copy of these at the start of the round, but it changes to 41, 81 or C1 when I hit it (perhaps depending on how I hit it). This is also where the breakpoint is hit.

So it's calling the routine on every house in one version, and only for those where the house is a newspaper subscriber in the other. So one of them presumably has buggy behaviour, I'd guess it's in the scoring. But I can't test it any more now, so someone else can take the baton :)
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14744
  • Location: London
Reply with quote
Post Posted: Sun Aug 10, 2008 8:46 am
The routine being called is adding the 4-digit BCD number in BCDE (0010) to the value in memory at $d4fd (which is the current score divided by 10). So this is score-related.

The breakpoint seems to be hit when you throw your newspaper into a window (and break it). In one version of the game, you get 100 points for breaking any window. In the other, you only get those points for breaking the window of a non-subscriber.

Points for targeted crime? What we have here is a clear precursor to GTA.
  View user's profile Send private message Visit poster's website
  • Joined: 25 Jul 2007
  • Posts: 731
  • Location: Melbourne, Australia
Reply with quote
Post Posted: Sun Aug 10, 2008 9:19 am
Lol I'll vouch for that. I love paperboy, it was one of the games I used to play loads on my C64 prior to getting the SMS.

I never took much notice of the scoring system though, or even realised there were subscribers/non subscribers. I just always thought if you land it on their door/postbox you get points, if you brake things you lose points. Learn something new every day.
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8651
  • Location: Paris, France
Reply with quote
Post Posted: Sun Aug 10, 2008 10:12 am
Thanks Maxim, that's awesome.
I have just played the arcade version: you get 100 points by breaking a non-customer window, and 0 for a customer window.

So European build is version 0 and US/BR build is the fixed version 1.
One case solved.
  View user's profile Send private message Visit poster's website
  • Joined: 20 Dec 2004
  • Posts: 187
Reply with quote
Post Posted: Sun Aug 10, 2008 4:48 pm
Thanks a lot guys, really interesting stuff. So in the Euro version you can break any window for points? I think this was actually how the game was designed on the NES, so that if you accidentally hit a customer's window you still got something for it and then could bash out a bunch for points. I'll check, but probably not.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8651
  • Location: Paris, France
Reply with quote
Post Posted: Sun Aug 10, 2008 8:48 pm
You always get points for breaking non-customers windows.
The change is with subscribed customers windows: in the European version you get points, in the US/Brasilian one you don't.
  View user's profile Send private message Visit poster's website
  • Joined: 29 Jun 1999
  • Posts: 383
  • Location: Brazil
Reply with quote
Post Posted: Mon Aug 11, 2008 11:16 pm
Nice find, I love to read about version changes.
  View user's profile Send private message Visit poster's website
  • Joined: 08 Dec 2005
  • Posts: 488
  • Location: Melbourne, Australia
Reply with quote
Post Posted: Mon Aug 09, 2010 11:48 pm
I've added this information to the wiki here.

Do we know if this is the only difference between the two ROMs?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8651
  • Location: Paris, France
Reply with quote
Post Posted: Tue Aug 10, 2010 4:01 am
Paul Baker wrote
I've added this information to the wiki here.

Do we know if this is the only difference between the two ROMs?

Thanks! It should the only change, as suggested by the original post.
  View user's profile Send private message Visit poster's website
  • Joined: 08 Dec 2005
  • Posts: 488
  • Location: Melbourne, Australia
Reply with quote
Post Posted: Tue Aug 10, 2010 9:57 pm
I've spotted another difference between the ROMs: a small section of code present in v1 but not in v0. I've added the information to the wiki page.

I don't know much about the purpose of the additional code, although it seems to be related to sprite processing.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14744
  • Location: London
Reply with quote
Post Posted: Wed Aug 11, 2010 9:06 am
Well, it seems to get hit just before sprites appear, so it could be related to "entities" in general. However, I couldn't get it to do anything other than take the first branch. Maybe a more enthusiastic player could play through with a breakpoint set (at 599b) and then pass on a savestate when it gets hit?
  View user's profile Send private message Visit poster's website
  • Joined: 08 Dec 2005
  • Posts: 488
  • Location: Melbourne, Australia
Reply with quote
Post Posted: Wed Aug 11, 2010 12:38 pm
Quote
"entities"


That's a good word! And in this case, probably more accurate than "sprites".

I can't get the game to hit a breakpoint at $599b either. However I have had another look at the disassembly:

Immediately before the new code is "CALL 59E9h":


 59E9: FD 21 78 CA  LD IY,CA78h
 59ED: 11 18 00     LD DE,0018h
 59F0: 06 12        LD B,12h
 59F2: 3A 11 D5     LD A,(D511h)
 59F5: A7           AND A
 59F6: 20 02        JR NZ,+02h (59FAh)
 59F8: 06 0C        LD B,0Ch
 59FA: AF           XOR A
 59FB: FD 19        ADD IY,DE
 59FD: FD BE 0A     CP (IY+0Ah)
 5A00: C8           RET Z
 5A01: 10 F8        DJNZ -08h (59FBh)
 5A03: FD 21 80 D0  LD IY,D080h
 5A07: C9           RET


Firstly, the byte at $d511 seems to have the value 0 during the normal level and 1 during the 'bonus' part at the end.

This code seems to be searching (starting at $ca78) either $0c or $12 blocks, each of size $18 bytes, for a block in which the 10th byte is zero. If it succeeds, it returns with B != 0 and the base of the block in IY. If it fails, it returns B = 0, IY = $d080.


 5994: CD E9 59     CALL 59E9h
 5997: 78           LD A,B
 5998: A7           AND A
 5999: 20 0F        JR NZ,+0Fh (59AAh)
 599B: FD 21 18 CA  LD IY,CA18h
 599F: FD 7E 0A     LD A,(IY+0Ah)
 59A2: FE 0C        CP 0Ch
 59A4: 20 04        JR NZ,+04h (59AAh)
 59A6: FD 21 80 D0  LD IY,D080h
 59AA: ...


So, the first thing that the new code does is check whether the search succeeded - our breakpoints at $599b will only be hit if the search fails. When this happens, the new code overwrites $d080 (the failure value from the function) with $CA18 - unless the 10th byte of the block at $CA18 is $0c.

If we assume that the function at $59e9 is searching for a "slot" in which to store information about an "entity", it seems that the new code is doing something along the lines of providing another slot - one which will only be used as a last resort.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!