Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Digital Archaeology » Computer Arcana » Apple » Apple II » Lode Runner (partial) original assembly source
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Lode Runner (partial) original assembly source [message #366548] Sat, 21 April 2018 10:02 Go to next message
Michael AppleWin Debu is currently offline  Michael AppleWin Debu
Messages: 1262
Registered: March 2013
Karma: 0
Senior Member
Another Br0derbund product with a snippet of the original assembly source!

Memory: $9E00

- - - 8< - - -
QU $1C35
ytable EQU $1C51
bytable EQU $1C62
bitable EQU $1C7E
xbytable EQU $1C9A
xbitable EQU $1D26
boot EQU $1DB2
scorebuff EQU $1F00
chardata EQU $AD00
rwtsparm EQU $B7E8
rwtsvolm EQU $B7EB
rwtstrck EQU $B7EC
rwtssect EQU $B7ED
rwtsbuff EQU $B7F0
rwtscmn
- - - 8< - - -

NOTE: The entire Data Disk Boot Sector is located at Mem $1DB2.

DSK: broderbund_loderunner_4play_revA.dsk
T11,SE

DSK: LodeRunner Corrupt Computing Crack.dsk
T18,SE

DSK: lode_runner1.po
T0D,S9,@07 - T0D,S8,@00
NOTE: Disk is non-original DOS 3.3 game collection


I'll provide a proper "Apple Games Disassembly Project" for Lode Runner
at some point but here are some interesting memory locations in the mean time:

zPlayerX EQU $00 ; Read @ GetPlayerFrame = 6B85
zPlayerY EQU $01 ; Read @ GetPlayerFrame = 6B85
zPlayerH EQU $02 ; Read @ GetPlayerFrame = 6B85, INC Horizontal Frame @ 6681
zPlayerV EQU $03 ; Read @ GetPlayerFrame = 6B85, DEC Vertical Frame @ 672D
zPlayerState EQU $04 ; Inc @ 6BF4
zEnemyX EQU $12 ; Read @ 74DF
zEnemyY EQU $13 ; Read @ 74DF
zEnemyState EQU $14
zEnemyH EQU $17 ; Read @ 74DF Horizontal Frame
zEnemyV EQU $18 ; Read @ 74DF Vertical Frame
zGoldLeft EQU $93 ; Amount of gold left in level
zDemoState EQU $A7 ; 0=Title, 1=Demo, 2=HighScore/Playing
zTempSprite EQU $DF ; 3 byte (cols) x 12 rows = 36 bytes ($21)

DemoStart EQU $609F ; Start of next demo level
DemoMain EQU $60E4 ; Main loop when demo active
MapNoGold EQU $60F2 ; Player has picked up all gold $93
ErasePlayer EQU $6600 ; See DrawPlayer @ 6C02
PickUpGold EQU $6BBD ; Player picked up gold

DrawPlayer EQU $6C02 ; See ErasePlayer @ 6600
GetPlayerFrame EQU $6B85 ; Similiar to GetEnemyFrame @ 74DF
GetEnemyFrame EQU $74DF ; Similiar to GetPlayerFrame @ 6B85
EnemyGotGold EQU $7538 ; Bungling picked up gold

EraseSprite EQU $8336 ; Erase TempSprite at $DF
DrawSprite1 EQU $8376
DrawSprite2 EQU $83A7 ; Draw TempSprite at $DF


P.S.
I guess someone should add "Lode Runner" to: The Cutting Room Floor
https://tcrf.net/

And make sure it is added to the Category: Lode Runner
https://tcrf.net/Category:Lode_Runner_series
Re: Lode Runner (partial) original assembly source [message #366551 is a reply to message #366548] Sat, 21 April 2018 11:55 Go to previous messageGo to next message
Antoine Vignau is currently offline  Antoine Vignau
Messages: 1860
Registered: October 2012
Karma: 0
Senior Member
I once disassembled Lode Runner, I'll try to find my "source code" and upload it,
av
Re: Lode Runner (partial) original assembly source [message #366556 is a reply to message #366551] Sat, 21 April 2018 12:01 Go to previous messageGo to next message
Antoine Vignau is currently offline  Antoine Vignau
Messages: 1860
Registered: October 2012
Karma: 0
Senior Member
On Saturday, April 21, 2018 at 5:55:27 PM UTC+2, Antoine Vignau wrote:
> I once disassembled Lode Runner, I'll try to find my "source code" and upload it,
> av

Available at http://www.brutaldeluxe.fr/public/

av
Re: Lode Runner (partial) original assembly source [message #366557 is a reply to message #366556] Sat, 21 April 2018 13:34 Go to previous messageGo to next message
Michael AppleWin Debu is currently offline  Michael AppleWin Debu
Messages: 1262
Registered: March 2013
Karma: 0
Senior Member
WOW! Thanks Antoine!! This will definitely speed things up!!!

On one hand this kind of takes the "fun" out of it, but on the other side it DOES free me up to work on other games! ;-)

How did you generate the disassembly by the way?


I see you don't have the two cheat codes documented -- you'll want to update your notes:

File: LR.CODE.S

L6B67 DA L6A56-1 ; 9E CTRL-^ / Cheat Next Level
DA L6A61-1 ; 80 CTRL-@ / Cheat Extra Life


*--- CTRL-^ / Cheat Next Level
*--- CTRL-@ / Cheat Extra Life


Here is some additional info. that you will probably be of interest:

Lode Runner's sprite render is over-engineered, IMHO, because it re-uses sprite data in order to save memory. (I still need to work out what the total number of bytes would be for the uncompressed sprite data would be.)

The data at $A900 is the raw tile (sprite) data -- your DW should be replaced with DB because the data is accessed via *over-lapping* bytes and stored into the TempSprite (3x12 -- yes three!?) at $DF with the CopySprite function at $8438.

The data at $AD00 is in SoA (Structure of arrays) format where each array has $68 elements (i.e. 847C and 84AF: ADC #$68). It should be converted from HEX format to DB format.

#define NUM_SPRITES 104

struct SpriteScanlineIndex
{
char sprite_0a[ NUM_SPRITES ]; // $AD00
char sprite_0b[ NUM_SPRITES ]; // $AD68

char sprite_1a[ NUM_SPRITES ]; // $ADD0
char sprite_1b[ NUM_SPRITES ]; // $AE38

char sprite_2a[ NUM_SPRITES ]; // $AEA0
char sprite_2b[ NUM_SPRITES ]; // $AF08

char sprite_3a[ NUM_SPRITES ]; // $AF70
char sprite_3b[ NUM_SPRITES ]; // $AFD8

char sprite_4a[ NUM_SPRITES ]; // $B040
char sprite_4b[ NUM_SPRITES ]; // $B0A8

char sprite_5a[ NUM_SPRITES ]; // $B110
char sprite_5b[ NUM_SPRITES ]; // $B178

char sprite_6a[ NUM_SPRITES ]; // $B1E0
char sprite_6b[ NUM_SPRITES ]; // $B248

char sprite_7a[ NUM_SPRITES ]; // $B2B0
char sprite_7b[ NUM_SPRITES ]; // $B318

char sprite_8a[ NUM_SPRITES ]; // $B380
char sprite_8b[ NUM_SPRITES ]; // $B3E8

char sprite_9a[ NUM_SPRITES ]; // $B450
char sprite_9b[ NUM_SPRITES ]; // $B4B8

char sprite_Aa[ NUM_SPRITES ]; // $B520
char sprite_Ab[ NUM_SPRITES ]; // $B588
} // $B5EF end


i.e.

1. Boot the game, wait for title to appear
2. AppleWin: F7
3. BPM A900
4. MD1 DF
5. The copy sprite code is self-modifying.

i.e.
846D: LDA $A900 ; SELF-MODIFIED @ 8469,
8474: LDA $A901 ; SELF-MODIFIED @ 846C

$A900 -> $DF ; Read @ 846F ($0A = $AD00)
$A901 -> $E0 ; Read @ 8474
$A900 OR $E0 -> $E0 ; Read @ 84A0
$A901 -> $E1 ; Read @ 84A7

$A900 -> $E2 ; Read @ 846F ($0A = $AD68)
$A901 -> $E3 ; Read @ 8474
$A900 OR $E0 -> $E3 ; Read @ 84A0
$A901 -> $E4 ; Read @ 84A7

* Do you mind if I use this as a base to build off and replace all the L#### pseudo-symbols with descriptive function names? :-)
* Do you mind if I throw this up on GitHub?

Cheers
Michael
Re: Lode Runner (partial) original assembly source [message #366565 is a reply to message #366557] Sat, 21 April 2018 14:37 Go to previous messageGo to next message
Antoine Vignau is currently offline  Antoine Vignau
Messages: 1860
Registered: October 2012
Karma: 0
Senior Member
Great info, Michael!
Do whatever you want with that :-)
I did the disassembly with The Flaming Bird Disassembler after I cracked the game.

Antoine
Re: Lode Runner (partial) original assembly source [message #395252 is a reply to message #366565] Tue, 02 June 2020 07:17 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: dowobeha

Did this ever get posted to Github? I would be very interested in looking through the code.
Re: Lode Runner (partial) original assembly source [message #395312 is a reply to message #395252] Wed, 03 June 2020 14:04 Go to previous messageGo to next message
Michael AppleWin Debu is currently offline  Michael AppleWin Debu
Messages: 1262
Registered: March 2013
Karma: 0
Senior Member
Sadly, not yet. I'll add it to my "projects queue".
Re: Lode Runner (partial) original assembly source [message #420505 is a reply to message #395312] Wed, 05 July 2023 23:51 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: John Faulkenbury

On Wednesday, June 3, 2020 at 1:04:35 PM UTC-5, Michael 'AppleWin Debugger Dev' wrote:
> Sadly, not yet. I'll add it to my "projects queue".

Bump for adding it to github! Also Antoine's source is gone from the Brutal Deluxe directory as well.
Re: Lode Runner (partial) original assembly source [message #420517 is a reply to message #420505] Sat, 08 July 2023 12:36 Go to previous messageGo to next message
Antoine Vignau is currently offline  Antoine Vignau
Messages: 1860
Registered: October 2012
Karma: 0
Senior Member
On Thursday, July 6, 2023 at 5:51:31 AM UTC+2, John Faulkenbury wrote:
> On Wednesday, June 3, 2020 at 1:04:35 PM UTC-5, Michael 'AppleWin Debugger Dev' wrote:
>> Sadly, not yet. I'll add it to my "projects queue".
> Bump for adding it to github! Also Antoine's source is gone from the Brutal Deluxe directory as well.

Oops, here it is on github @ https://github.com/antoinevignau/source/tree/main/loderunner

Antoine
Re: Lode Runner (partial) original assembly source [message #420519 is a reply to message #420517] Sat, 08 July 2023 17:26 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: John Faulkenbury

On Saturday, July 8, 2023 at 11:36:16 AM UTC-5, Antoine Vignau wrote:
> On Thursday, July 6, 2023 at 5:51:31 AM UTC+2, John Faulkenbury wrote:
>> On Wednesday, June 3, 2020 at 1:04:35 PM UTC-5, Michael 'AppleWin Debugger Dev' wrote:
>>> Sadly, not yet. I'll add it to my "projects queue".
>> Bump for adding it to github! Also Antoine's source is gone from the Brutal Deluxe directory as well.
> Oops, here it is on github @ https://github.com/antoinevignau/source/tree/main/loderunner
>
> Antoine

Thank you!
Re: Lode Runner (partial) original assembly source [message #420521 is a reply to message #420517] Sat, 08 July 2023 20:50 Go to previous message
Anonymous
Karma:
Originally posted by: ant

Antoine Vignau <ntn.vignau@gmail.com> wrote:
> On Thursday, July 6, 2023 at 5:51:31???AM UTC+2, John Faulkenbury wrote:
>> On Wednesday, June 3, 2020 at 1:04:35???PM UTC-5, Michael 'AppleWin Debugger Dev' wrote:
>>> Sadly, not yet. I'll add it to my "projects queue".
>> Bump for adding it to github! Also Antoine's source is gone from the Brutal Deluxe directory as well.

> Oops, here it is on github @ https://github.com/antoinevignau/source/tree/main/loderunner

> Antoine

Wow, was this leaked or was it legally released?
--
"'Woe to me!' [Isaiah] cried. 'I am ruined! For I am a man of unclean lips, and I live among a people of unclean lips, and my eyes have seen the King, the Lord Almighty.'" --Isaiah 6:5. Quieter days after crazy days, but 2 much Z & pooping! :/
Note: A fixed width font (Courier, Monospace, etc.) is required to see this signature correctly.
/\___/\ Ant(Dude) @ http://aqfl.net & http://antfarm.home.dhs.org.
/ /\ /\ \ Please nuke ANT if replying by e-mail.
| |o o| |
\ _ /
( )
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: NEWPRINT/Multi card
Next Topic: Legend RAM S' Card - Logic Troubleshooting
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Mar 29 03:29:21 EDT 2024

Total time taken to generate the page: 0.05112 seconds