Jump to content
IGNORED

Two Bruce Lee sequels


Philsan

Recommended Posts

The lamps could be tied to unlocking something special or a hidden door in some other room as well. Currently the game is pretty straight forward and I normally play it such that I just get or complete everything to get to the end. As a difficulty selection it would be interesting to have some Lee inspired puzzles...

 

“Empty your mind. Be Formless. Shapeless. Like water.
Put water into a cup, it becomes the cup.
Put water into a teapot, it becomes the teapot.
Now water can flow, or drip, or creep, or CRASH.
Be water my friend.”

 

perhaps some water scenes puzzles reflections sort of thing. he seemed to really like nature. No need to go overboard just some touches flourishes, fill a cup, or bucket etc.

Just some inspiration for the game.

  • Like 2
Link to comment
Share on other sites

Hi there. Thanks for your interest in Bruce Lee - Return of Fury

 

I wrote a little "post-partum" about it on my site: https://rebelandroid.com/games/bruce-rof

 

Anyway. The first thing to do is to make the code relocatable - all the tables (map data, map properties, text lookup table, colours, map init, exec routines) and self-modifying code + irqs

must be "labeled" properly so that you can move stuff around at will without side-effects. That's a given.

 

The graphics are mostly the same as the C64 version - but the C64 screens are stored as 40x11 rows, where every odd line is the even char | 0x80 - I didn't quite see that on the

atari version, but I may be mistaken.

 

Ron J. Fortier said to Retro Gamer Magazine (issue 145) that the C64 version was sort of an atari "emulation". That's why I think you should base your code on the original, not

the "inferior" port :) - and, true enough, the Atari version plays much smoother. I think this is due to the "emulated" port - instead of using multicolour sprites, he opted for

TWO double sized single colour sprites for each character, except the Ninja. Additionally, an extra sprite is used whenever Bruce kicks or gets "hurt bad".

Edit: AND that's not all, he ran out of sprite pointers/memory, so the sprite frames are doublebuffered and copied in using CPU on every frame. Phew.

Needless to say, this can be quite inefficient, and so the C64 can't really keep it at 50 (60) hz, so he's forced to skip a frame or two to get enough time.

 

However, it's still the version I grew up with and love, so I lean towards it - no offense. :)

 

I'll be happy to be of assistance should you need it.

 

Best regards,

dmx

Edited by dmx
  • Like 13
Link to comment
Share on other sites

Very interesting!

 

As participation, I propose a somewhat technical explanation to extract the levels (rooms) of the source code.

 

Each of the twenty rooms is rle encoded. The table is here:

org $3F2B

room_rle_table_low
dta <room_0,<room_1,<room_2,<room_3,<room_4,<room_5,<room_6,<room_7, <room_8,<room_9,<room_10,<room_11,<room_12,<room_13,<room_14,<room_15, <room_16,<room_17,<room_18,<room_19,<room_20
org $3F40
room_rle_table_high
dta >room_0,>room_1,>room_2,>room_3,>room_4,>room_5,>room_6,>room_7,dta >room_8,>room_9,>room_10,>room_11,>room_12,>room_13,>room_14,>room_15,>room_16,>room_17,>room_18,>room_19,>room_20

 

Three fonts are used (font_0: $6800-$6BFF,font_1: $6C00-$6FFF and font_2 $7000-$73FF), and a table indicates the font used for each room:

org $3F17
dta >font_0,>font_0,>font_0,>font_0 >font_0,>font_0,>font_0,>font_0, >font_0,>font_0,>font_1,>font_1 >font_1,>font_1,>font_1,>font_1,>font_1,>font_1,>font_2,>font_1
Colors are stored for each room here
org $3E8B
dta a($3EB3),a($3EB3),a($3EB3),a($3EB3),a($3EC7),a($3EC7),a($3EC7),a($3ECC) ;
dta a($3ECC),a($3ECC),a($3ED1),a($3EE0),a($3ED1),a($3EE5),a($3ED1),a($3EEF) ;
dta a($3ED1),a($3EFE),a($3F08),a($3F0D)
Example of detailed colors for a room ( 5 initial colors + 3 DLIs Max per room*5 colors= 20 bytes maximum )
org $3EB3
dta $04,$00,$06,$88,$0E; INIT: COLBK COLPF3 COLPF2 COLPF1 COLPF0
dta $04,$00,$0A,$0E,$34; DLI0: COLBK COLPF3 COLPF2 COLPF1 COLPF0
dta $06,$00,$0A,$0E,$34; DLI1: COLBK COLPF3 COLPF2 COLPF1 COLPF0
dta $04,$00,$0A,$0E,$34; DLI2: COLBK COLPF3 COLPF2 COLPF1 COLPF0
and finaly, DLIs for each rooms are here:
$0F38
dta l(MKINT_ROOM00),l(MKINT_ROOM01),l(MKINT_ROOM02),l(MKINT_ROOM03),....
$0F4C
dta h(MKINT_ROOM00),h(MKINT_ROOM01),...

with

; line number A9876543210
MKINT_ROOM00 equ %000001000010100 ; I at line 2 / 4 / 9
MKINT_ROOM01 equ %000001000010100 ; I at line 2 / 4 / 9
MKINT_ROOM02 equ %000001000010100 ; I at line 2 / 4 / 9
MKINT_ROOM03 equ %000001000010010 ; I at line 1 / 4 / 9
MKINT_ROOM04 equ %000000000000000 ;
MKINT_ROOM05 equ %000000000000000 ;
MKINT_ROOM06 equ %000000000000000 ;
MKINT_ROOM07 equ %000000000000000 ;
MKINT_ROOM08 equ %000000000000000 ;
MKINT_ROOM09 equ %000000000000000 ;
MKINT_ROOM10 equ %000000000000001 ; I at line 0
MKINT_ROOM11 equ %000000000000000 ;
MKINT_ROOM12 equ %000000000000001 ; I at line 0
MKINT_ROOM13 equ %000000000100000 ; I at line 5
MKINT_ROOM14 equ %000000000000001 ; I at line 0
MKINT_ROOM15 equ %000001011000000 ; I at line 6 / 7 / 9
MKINT_ROOM16 equ %000000001000001 ; I at line 0 / 6
MKINT_ROOM17 equ %000000000000001 ; I at line 0
MKINT_ROOM18 equ %000000000000000 ;
MKINT_ROOM19 equ %000000001000000 ; I at line 6
From this information, I wrote a small program that extracts the levels to the 2D level editor Tiled (src code included)
The 20 Rooms in Tiled format are provided in attachement.
post-40786-0-70398400-1552341878_thumb.png

 

brucelee-tiled.zip

extract-rooms-src.zip

Edited by fantômas
  • Like 12
Link to comment
Share on other sites

Hi Ute,

 

This is all sounding rather positive and I'm very grateful for your work in this.

 

I'll chat with dmx (he does read the thread though) and see if I can get the tiles for you to look at.

 

Oh, don't forget that we already have Omnivore as a PC util to edit levels but if you want as a personal like to do one then amazing.

 

Thank you to you and to all for the interest in this idea..

 

Omnivore is a great tool. I was hoping for something more specifically geared towards the game itself.

 

It looks like Fantomas already has an editor we might be able to tweak for our purposes.

 

The lamps could be tied to unlocking something special or a hidden door in some other room as well. Currently the game is pretty straight forward and I normally play it such that I just get or complete everything to get to the end. As a difficulty selection it would be interesting to have some Lee inspired puzzles...

 

“Empty your mind. Be Formless. Shapeless. Like water.

Put water into a cup, it becomes the cup.

Put water into a teapot, it becomes the teapot.

Now water can flow, or drip, or creep, or CRASH.

Be water my friend.”

 

perhaps some water scenes puzzles reflections sort of thing. he seemed to really like nature. No need to go overboard just some touches flourishes, fill a cup, or bucket etc.

Just some inspiration for the game.

 

Yeah, some kind of tribute would be cool.

 

We could even include that quote above in the initial screen or maybe even the title screen.

 

Hi there. Thanks for your interest in Bruce Lee - Return of Fury

 

I wrote a little "post-partum" about it on my site: https://rebelandroid.com/games/bruce-rof

 

Anyway. The first thing to do is to make the code relocatable - all the tables (map data, map properties, text lookup table, colours, map init, exec routines) and self-modifying code + irqs

must be "labeled" properly so that you can move stuff around at will without side-effects. That's a given.

 

The graphics are mostly the same as the C64 version - but the C64 screens are stored as 40x11 rows, where every odd line is the even char | 0x80 - I didn't quite see that on the

atari version, but I may be mistaken.

 

Ron J. Fortier said to Retro Gamer Magazine (issue 145) that the C64 version was sort of an atari "emulation". That's why I think you should base your code on the original, not

the "inferior" port :) - and, true enough, the Atari version plays much smoother. I think this is due to the "emulated" port - instead of using multicolour sprites, he opted for

TWO double sized single colour sprites for each character, except the Ninja. Additionally, an extra sprite is used whenever Bruce kicks or gets "hurt bad".

Edit: AND that's not all, he ran out of sprite pointers/memory, so the sprite frames are doublebuffered and copied in using CPU on every frame. Phew.

Needless to say, this can be quite inefficient, and so the C64 can't really keep it at 50 (60) hz, so he's forced to skip a frame or two to get enough time.

 

However, it's still the version I grew up with and love, so I lean towards it - no offense. :)

 

I'll be happy to be of assistance should you need it.

 

Best regards,

dmx

 

DMX, thanks for your help!

 

Your comments are saving us countless hours of disassembly! Very grateful for everything you have shared, and very grateful for your willingness to help.

 

You're very gracious. :) :) :)

 

 

Very interesting!

 

As participation, I propose a somewhat technical explanation to extract the levels (rooms) of the source code.

 

Each of the twenty rooms is rle encoded. The table is here:

org $3F2B

room_rle_table_low
dta <room_0,<room_1,<room_2,<room_3,<room_4,<room_5,<room_6,<room_7, <room_8,<room_9,<room_10,<room_11,<room_12,<room_13,<room_14,<room_15, <room_16,<room_17,<room_18,<room_19,<room_20
org $3F40
room_rle_table_high
dta >room_0,>room_1,>room_2,>room_3,>room_4,>room_5,>room_6,>room_7,dta >room_8,>room_9,>room_10,>room_11,>room_12,>room_13,>room_14,>room_15,>room_16,>room_17,>room_18,>room_19,>room_20

 

Three fonts are used (font_0: $6800-$6BFF,font_1: $6C00-$6FFF and font_2 $7000-$73FF), and a table indicates the font used for each room:

org $3F17
dta >font_0,>font_0,>font_0,>font_0 >font_0,>font_0,>font_0,>font_0, >font_0,>font_0,>font_1,>font_1 >font_1,>font_1,>font_1,>font_1,>font_1,>font_1,>font_2,>font_1
Colors are stored for each room here
org $3E8B
dta a($3EB3),a($3EB3),a($3EB3),a($3EB3),a($3EC7),a($3EC7),a($3EC7),a($3ECC) ;
dta a($3ECC),a($3ECC),a($3ED1),a($3EE0),a($3ED1),a($3EE5),a($3ED1),a($3EEF) ;
dta a($3ED1),a($3EFE),a($3F08),a($3F0D)
Example of detailed colors for a room ( 5 initial colors + 3 DLIs Max per room*5 colors= 20 bytes maximum )
org $3EB3
dta $04,$00,$06,$88,$0E; INIT: COLBK COLPF3 COLPF2 COLPF1 COLPF0
dta $04,$00,$0A,$0E,$34; DLI0: COLBK COLPF3 COLPF2 COLPF1 COLPF0
dta $06,$00,$0A,$0E,$34; DLI1: COLBK COLPF3 COLPF2 COLPF1 COLPF0
dta $04,$00,$0A,$0E,$34; DLI2: COLBK COLPF3 COLPF2 COLPF1 COLPF0
and finaly, DLIs for each rooms are here:
$0F38
dta l(MKINT_ROOM00),l(MKINT_ROOM01),l(MKINT_ROOM02),l(MKINT_ROOM03),....
$0F4C
dta h(MKINT_ROOM00),h(MKINT_ROOM01),...

with

; line number A9876543210
MKINT_ROOM00 equ %000001000010100 ; I at line 2 / 4 / 9
MKINT_ROOM01 equ %000001000010100 ; I at line 2 / 4 / 9
MKINT_ROOM02 equ %000001000010100 ; I at line 2 / 4 / 9
MKINT_ROOM03 equ %000001000010010 ; I at line 1 / 4 / 9
MKINT_ROOM04 equ %000000000000000 ;
MKINT_ROOM05 equ %000000000000000 ;
MKINT_ROOM06 equ %000000000000000 ;
MKINT_ROOM07 equ %000000000000000 ;
MKINT_ROOM08 equ %000000000000000 ;
MKINT_ROOM09 equ %000000000000000 ;
MKINT_ROOM10 equ %000000000000001 ; I at line 0
MKINT_ROOM11 equ %000000000000000 ;
MKINT_ROOM12 equ %000000000000001 ; I at line 0
MKINT_ROOM13 equ %000000000100000 ; I at line 5
MKINT_ROOM14 equ %000000000000001 ; I at line 0
MKINT_ROOM15 equ %000001011000000 ; I at line 6 / 7 / 9
MKINT_ROOM16 equ %000000001000001 ; I at line 0 / 6
MKINT_ROOM17 equ %000000000000001 ; I at line 0
MKINT_ROOM18 equ %000000000000000 ;
MKINT_ROOM19 equ %000000001000000 ; I at line 6
From this information, I wrote a small program that extracts the levels to the 2D level editor Tiled (src code included)
The 20 Rooms in Tiled format are provided in attachement.

 

 

Fantomas, this is excellent!!! Thanks so much! That is huge!! :)

 

Would you mind if I ported your code to C#? And maybe throw in a few tweaks to be geared more specifically to Bruce Lee itself?

  • Like 2
Link to comment
Share on other sites

My pleasure to be of help!

 

 

Fantomas, That's excellent stuff.

 

Now someone can write a RLE to that converts the Tiled output back into game data, and you're on the way!

 

I used the object layer in Tiled to mark where to place "fires" and those "floor lights" (aka rats), then put the co-ordinates and sizes into code. Another option could be to automatically generate asm for this.

  • Like 3
Link to comment
Share on other sites

RLE procedure..

rle_depacker    sta inputPointer+1
loop        jsr getByte
        beq stop
        lsr @
        tay
lp0        jsr getByte
lp1        sta $ffff
outputPointer    equ *-2
        inw outputPointer
        dey
_bpl        bmi loop
        bcs lp0
        bcc lp1
getByte        inx
        sne
        inc inputPointer+1
        lda $ff00,x
inputPointer    equ *-2
stop    rts

set your destination address @ outputPointer

load acc with high addresses of your rle packed data -1
load xreg with low addresses of your rle packed data -1
call rle_depacker

  • Like 4
Link to comment
Share on other sites

Hi!

 

The graphics are mostly the same as the C64 version - but the C64 screens are stored as 40x11 rows, where every odd line is the even char | 0x80 - I didn't quite see that on the

atari version, but I may be mistaken.

This is because in the Atari, the font is double height, so you have 40x11 characters, with only 128 possibilities.

 

To convert to the C64, each original char was replaced by two, using the fact that the C64 has 256 characters in the font. So, the Atari char "$03" is replaced by the char "$03" over the char "$83" in the C64.

  • Like 2
Link to comment
Share on other sites

Ute or dmx:

 

How did you guys determine that the InitZeroPage and the code at $7C00 were not required ?

 

Could you post a binary of the file from which the disassembly was derived ? I want to make sure my translation produces a mirror image; I don't use MADS.

 

There's an oddity with at least one, maybe more of the map tables. There will be something like:

 

TXTDATAPTRLO .BYTE $F7

TXTDATPTRHI 50 bytes after this

 

Where you think if it was a split table, there would be an even number of bytes in each. I'm assuming stuff like this is just a result of the disassembler guessing where to break things into sections. At least that post by fantomas will really help sorting out the tables.

 

Needs some kind of loader too, can't just binload from DOS. For me, I'm just going to use a little Action! pgm to write it as sectors 4-whatever and have it boot and just jump to $8000. I guess you're using some Altirra trick to get it to bootload the .xex.

Link to comment
Share on other sites

Hi!

 

 

This is because in the Atari, the font is double height, so you have 40x11 characters, with only 128 possibilities.

 

To convert to the C64, each original char was replaced by two, using the fact that the C64 has 256 characters in the font. So, the Atari char "$03" is replaced by the char "$03" over the char "$83" in the C64.

 

Very interesting, I had no idea, but that explains a lot!

Link to comment
Share on other sites

Ute or dmx:

 

How did you guys determine that the InitZeroPage and the code at $7C00 were not required ?

 

Could you post a binary of the file from which the disassembly was derived ? I want to make sure my translation produces a mirror image; I don't use MADS.

 

There's an oddity with at least one, maybe more of the map tables. There will be something like:

 

TXTDATAPTRLO .BYTE $F7

TXTDATPTRHI 50 bytes after this

 

Where you think if it was a split table, there would be an even number of bytes in each. I'm assuming stuff like this is just a result of the disassembler guessing where to break things into sections. At least that post by fantomas will really help sorting out the tables.

 

Needs some kind of loader too, can't just binload from DOS. For me, I'm just going to use a little Action! pgm to write it as sectors 4-whatever and have it boot and just jump to $8000. I guess you're using some Altirra trick to get it to bootload the .xex.

 

Some tables are "word" tables, while some are split into hi/lo

 

e.g.

 

Table

TableH = * + 1

!word something

!word something

 

While others:

 

TableL

!byte <something

!byte <something

 

TableH

!byte >something

!byte >something

 

And so on

 

 

And yes, I do recommend to build a "good" binary first, then when reversing, do a file compare (windows: fc \b myre.bin good.bin) to confirm they match. Often one gets a tiny bit wrong, and have to hunt for it maybe for days!

Edited by dmx
Link to comment
Share on other sites

 

 

Would you mind if I ported your code to C#? And maybe throw in a few tweaks to be geared more specifically to Bruce Lee itself?

 

Do what you want. It is just a POC. The export to Tiled shows that the explanation is correct, but to be honest, i'm not sure that Tiled is the best level editor for A8. Thanks to DLIs, a blue and / or green tile in line 2 can be red and / or yellow in line 7. For a correct display in Tiled, this makes it necessary to create two different tiles ... But that makes the creation of new level more difficult ..... A specific editor would be better... Perhaps....

 

Is there any progress in the reversing? Should not we centralize all these efforts?

  • Like 2
Link to comment
Share on other sites

By the way, I've made a refactoring of some part of the src to visualize the "118 PMs".

 

Guess who is the first ;) :

 

org $3D67
spr_1
dta 000 ;........
dta 000 ;........
dta 000 ;........
dta 128 ;.......#
dta 140 ;..##...#
dta 156 ;..###..#
dta 144 ;....#..#
dta 156 ;..###..#
dta 156 ;..###..#
dta 152 ;...##..#
dta 188 ;..####.#
dta 190 ;.#####.#
dta 254 ;.#######
dta 254 ;.#######
dta 189 ;#.####.#
dta 153 ;#..##..#
dta 188 ;..####.#
dta 060 ;..####..
dta 038 ;.##..#..
dta 098 ;.#...##.
dta 066 ;.#....#.
dta 195 ;##....##

sprites.asm

  • Like 6
Link to comment
Share on other sites

Ute or dmx:

 

How did you guys determine that the InitZeroPage and the code at $7C00 were not required ?

 

Could you post a binary of the file from which the disassembly was derived ? I want to make sure my translation produces a mirror image; I don't use MADS.

 

The zero page init was something I had added because I was looking at another hacked version that was setting zero page locations. Initially I thought I needed to do this too, but once I realized the ATX version was not doing this I commented it out.

BruceLeeXEX.xex

  • Like 2
Link to comment
Share on other sites

 

Do what you want. It is just a POC. The export to Tiled shows that the explanation is correct, but to be honest, i'm not sure that Tiled is the best level editor for A8. Thanks to DLIs, a blue and / or green tile in line 2 can be red and / or yellow in line 7. For a correct display in Tiled, this makes it necessary to create two different tiles ... But that makes the creation of new level more difficult ..... A specific editor would be better... Perhaps....

 

Is there any progress in the reversing? Should not we centralize all these efforts?

 

Yes a repository or some kind of version control would be a good idea. Github or something like that?

Link to comment
Share on other sites

 

 

 

Yes a repository or some kind of version control would be a good idea. Github or something like that?

 

Is there any progress in the reversing? Should not we centralize all these efforts?

 

Don't mind me, I'm just tagging along on the Atari; you guys are using Windows tools, so I'm no help there.

 

Thanks for the xex, Ute, I've almost got the code to assemble on the Atari. The FrameData file is 70K of source, lol, takes almost two minutes to assemble, but that's ok. Just need to fix-up some zero-page stuff and then with any luck I'll have a mirror binary.

Edited by Alfred
  • Like 2
Link to comment
Share on other sites

 

By the way, I've made a refactoring of some part of the src to visualize the "118 PMs".

 

 

Most of the sprites align with the one following, but the first few, and a few in the middle, there's a gap of 1-3 bytes between sprites. Is that gap supposed to be there ?

 

For example, SPRX0 ($3D50) ends with a 195 ($C3) in your code, but in the xex there's a second 195.

 

Just wondering.

Link to comment
Share on other sites

I think you're brave doing it on real hardware. :)

 

Well, I wouldn't try this with a stock machine, that would be brutal. With an XE or better though, it's really not too bad. The 8-bit can do a lot, with a little patience and some good tools. If I have to write something like Tiled for the Atari though, that'll really make me fall behind you guys.

 

Anyway, I split out the boot sequence and built that as a separate test binary, both to check the code and also to check my tools, since I'm also having to debug my assembler simultaneously, since I had to do some upgrades to it to handle the volume of MADS source. It really doesn't like that you can do ASL A in MADS as just ASL. Anyway, my test binary seems to skip right over the text screen, which I'm guessing is because there's no delay for booting, but there's a problem with the Bruce Lee picture. It's mostly there, but there's no face and there's no title part. Is that stuff part of the pic or is it some PMG trickery like that other fellow who made a new screen in that other thread did ?

 

The music plays fine though, so at least that's progress.

Link to comment
Share on other sites

 

 

Is that stuff part of the pic or is it some PMG trickery like that other fellow who made a new screen in that other thread did ?

I'm sure there isn't any PMGs on the loading screen, at least on the original version is a Bitmap mode GR.15 with just 4colours.

Edited by José Pereira
Link to comment
Share on other sites

I'm sure there isn't any PMGs on the loading screen, at least on the original version is a Bitmap mode GR.15 with just 4colours.

 

yeah, I figured it out. The problem is that I normally run a VBI intercept that keeps the screen black, left margin to zero and does some custom keypress stuff. When I just boot with plain DOS and run my test, the pic displays fine. Doh!

Link to comment
Share on other sites

 

yeah, I figured it out. The problem is that I normally run a VBI intercept that keeps the screen black, left margin to zero and does some custom keypress stuff. When I just boot with plain DOS and run my test, the pic displays fine. Doh!

Maybe or not, because I'm not a coder but if I understand you're set to black what?

On Loading screen if you set BAK colour register to black you shouldn't. There BAK is the borders like always but here, as you can see, is the dark blue.

So, lets say you set BAK to black you then have 2blacks (BAK and the other that is one of PFs: 0 or 1 or 2).

This I'm saying I'm sure is or isn't this I'm saying you're problem...

Edited by José Pereira
Link to comment
Share on other sites

Maybe or not, because I'm not a coder but if I understand you're set to black what?

On Loading screen if you set BAK colour register to black you shouldn't. There BAK is the borders like always but here, as you can see, is the dark blue.

So, lets say you set BAK to black you then have 2blacks (BAK and the other that is one of PFs 0, 1 or 2).

This I'm saying I'm sure is or isn't this I'm saying you're problem...

 

Yeah, I'm not sure how it played out. IIRC the intercept just forces the background color to black, leaves the foreground as the normal white. So just looking at it now, what happens is only the blue and the white parts of the title screen show, everything else is just black. I just need to remember to reboot to remove the intercept before I test things; it's just such a habit now to install it after DOS loads, "K" and Enter.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...