News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Joseman

U.N.Squadron - Joseman version (the history of)

Started by Joseman, 23:39, 15 January 17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joseman

Hi pals!!

The last days we were talking about the mass storages and my crack version of U.N.Squadron. the last time i've tried it didn't work on Bonny Dos / AcmeDos / M4...

but today i tried again on the M4... and it works!!! all the levels (as i played to the end). No lower mod needed!.

@Duke your hardware and your AMSDOS compatibility is astonishing!!

If you like, i will tell you how this version was made (i don't remember all as it was some time ago).

I've made this crack version about 1-2 years ago. U.N.Squadron is one of my favourite games on our machine, the cracks were bad (screen corruption, trainers...), and i was learning about Tape loaders and ASM at the time.

The game use 128k on the 6128 because it retains the presentation, and don't need to reload it when you die (in the 464 there is 1 extra load on level 1)

The levels are encrypted and they are decripted before every load. I don't remember well, i think that they are decompressed too.

I'd two problems: the 128k use for the game (i think that it used bank 0, 1 and 2?) and that all the loads didn't fit in one side of a floppy.

Display text on a comercial game is not easy, although i knew what routine was used to display text and how it worked on U.N.Squadron, i could display a text with "flip the disc please" or something like this... but i didn't like this way.

Every level take up 32k's, and i was like 'mmmm there must be some kind of similarity on all the levels...', i loaded the levels on a hex editor and compared level by level searching identical parts of code... bingo! all the levels shared 1 identical part... i trim  this part, put on a file and then cut this part on all the levels..

Now the levels take up less memory... but still they didn't fit one side!! time for aplib!!

I compressed all the (cut) levels and now the game fitted on one side of a floppy.

The other problem was that i didn't want to corrupt the screen on every level load (like all the cracks did), i could change all the colors to black... but i didn't like the idea... some games hide some code on the screen and i didn't know 100% the code of the game... the other option was to load the level on the second bank... but the game used the second bank... I'd to investigate what banks used the game... Ok the bank 3 was not used...

But the Ram management didn't offer (or i didnt see) a solution for loading the level on bank 3 and then move it to the cpc memory with the original level loader... solution: make some code on bank 3 (of the expanded memory) to move the loaded level to its location and when it finished return to the original loader... the identical part of the levels was loaded in the first load of the game itself, and it's retained on the expanded memory all the time... it worked! and now the levels where loaded without corrupt the screen!.

To make A, B and mass storage compatible (i believed) i stored the floppy letter on the second bank too... when the game is going to load a level it restore the floppy letter and the game worked in A & B...

At that time only Bonny Dos was avaliable but, one big mistake of Bonny Dos is that use the bank 3 of the expanded memory to buffer data, this was totally incompatible with my level loader!!... I knew that and i held my version of U.N.Squadron for better times...

Then, it came ACMEDos, it didn't use the second bank!! but my version still didn't work... the game restored the HD letter, but the directory was lost... i learned how ACMEDos worked with directories, and i've made a special version of the loader that restored all this memory... but it never worked... the thing is that the code alone worked with ACMEDos but within the game no! I suspect that the game makes a lot of changes not only on memory and that prevented to work on ACMEDos too... My version of U.N.Squadron was held again...

Some time after it came this miracle called M4 board... but my version of U.N.Squadron didn't work too!!!!! I didn't mind that, i was tired of modifying the code again and again...

The last week we talk about it here, and today as Duke released the 2.0.0 version of the ROM... i was like... i don't believe that my game don't work now with the M4, i've spent months trying (and modifying) games to work with the M4... I know the M4 and i know my loader... I tried again and it works!!!!

I want to share this version of U.N.Squadron, i'm satisfied now that it work from floppy and the M4... i would like that it worked in ACMEDos, but i can't achieve that!

If anyone mind to try it on ACMEDos and report, we can see what is the problem with this ROM...

http://s000.tinyupload.com/index.php?file_id=13034265844258020101

Please, Don't upload this version to any webpage before we find an ACMEDos solution!



Duke

Good job!

Some observertations:

If I have Maxam rom enabled aswell, the game resets when picking a level. Probably you should not do a KL_ROM_WALK, but only init amsdos and mass storage rom or some himem area is expected to be cleared?

The files need to be extracted from the dsk image, if run directly from .dsk image it blackscreens. Something for me to debug :/

Joseman

#2
Quote from: Duke on 00:09, 16 January 17
If I have Maxam rom enabled aswell, the game resets when picking a level. Probably you should not do a KL_ROM_WALK, but only init amsdos and mass storage rom or some himem area is expected to be cleared?

I forgot the ins and outs of the game (it was about 2 years when i did this). I believe that the levels use the entire himem memory... (the stack is on #40), i think that the level itself clears and overwrite the himem...

The problem with only init amsdos and the mass storage rom is... how we now what mass storage rom is used and what number is his rom?

About some himem area expected to be cleared (ala ghost n goblins), i doubt that, the game is very well programmed (from my point of view), but... who knows?



Duke

Quote from: Joseman on 00:16, 16 January 17
The problem with only init amsdos and the mass storage rom is... how we now what mass storage rom is used and what number is his rom?

As I wrote in our last discussion, below code should do just that.

; on init, get rom number in control of cas_functions

ld hl,(&bc78)
inc hl
inc hl
ld a,(hl)
ld (disc_start_rom+1),a

; on re-init of firmware

....

ld c,7            ; init amsdos
ld de&40
ld hl,&b0ff
call &BCCE
ld    a,7
disc_start_rom:
ld    c,6       ; overwritten by init
cp    c         ; is it rom 7?
call nz,&BCCE     ; init 2nd rom

Joseman

Quote from: Joseman on 00:16, 16 January 17
(...)I believe that the levels use the entire himem memory... (the stack is on #40), i think that the level itself clears and overwrite the himem...


Joseman

Quote from: Duke on 00:21, 16 January 17
As I wrote in our last discussion, below code should do just that.

...


Are you sure that with this approach, the AcmeDos ROM (or other mass storage rom) will be correctly identified? i mean... with the M4 works... but... what happen with other roms? what if the result is rom 7 too because the roms don't change this?

perhaps anyone with the acmedos rom can test the CNGSoft version of Ghouls N Ghosts?

Duke

Quote from: Joseman on 00:42, 16 January 17
Are you sure that with this approach, the AcmeDos ROM (or other mass storage rom) will be correctly identified? i mean... with the M4 works... but... what happen with other roms? what if the result is rom 7 too because the roms don't change this?
I am quite sure it works, if ACMEDOS can use basic commands like load,save,run,cat etc. they will need to hook those functions too, so it should work with any mass storage that provides native support.
If the result is 7, it was launched from AMSDOS or the mass storage has rom 7 and wouldnt need amsdos (ie. m4).

Carnivius

I don't understand much about this topic other than I love CPC UN Squadron. :P
Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

Joseman

Hi

I just updated my U.N.Squadron version to my new (not bugged) firmware loader. Frankly it's a miracle that the previous version worked, because my old firmware loader was not quite right and some other code was somehow wrong.

Please don't use the old version of my U.N.Squadron, use this instead:

http://s000.tinyupload.com/index.php?file_id=13034265844258020101

@Duke can you confirm that this version works with your roms configurations?


Duke

It works fine here with roms enabled, but only if the files are extracted to a folder, not from the .dsk image... Maybe I need to investigate why that happens?

Powered by SMFPacks Menu Editor Mod