Author Topic: Strange behaviour between cpc464 & cpc6128  (Read 254 times)

0 Members and 1 Guest are viewing this topic.

Offline Joseman

  • 6128 Plus
  • ******
  • Posts: 653
  • Country: es
  • Liked: 479
Strange behaviour between cpc464 & cpc6128
« on: 01:07, 17 July 17 »
Hi

Today Kukulcan warned me about a bug on my version of 'ninja grannies', it didn't work on a CPC464 with ram expansion and DDI.

I looked to the source code and saw a extrange behaviour on the CPC464.

With my firmware routine, i save the stack pointer direction (#00F7), put it on #C000 to be firmware friendly, do the 'restore highjumpblock' and all the things... at the end i restore the sp to his original position (#00F7)... on the cpc6128 it returns correctly to the #00F7 - Bank 0... BUT!!!! on the CPC464 it returns to the lower rom (#00F7) direction!!!! sending the program to hell!!

It's obvious that the problem is that the lower rom must be disabled, but why on the CPC6128 it works (no returning to the lower rom) and on the CPC464 not? ??? ?

Some Guru Coder to shed some light on this?

Thankyou!!

Offline Nich

  • Supporter
  • 6128 Plus
  • *
  • Posts: 532
  • Country: gb
  • CPC Game Reviews webmaster
    • CPC Game Reviews
  • Liked: 306
Re: Strange behaviour between cpc464 & cpc6128
« Reply #1 on: 16:48, 22 July 17 »
Today Kukulcan warned me about a bug on my version of 'ninja grannies', it didn't work on a CPC464 with ram expansion and DDI.

It's obvious that the problem is that the lower rom must be disabled, but why on the CPC6128 it works (no returning to the lower rom) and on the CPC464 not? ??? ?

Some Guru Coder to shed some light on this?

The CALL to reinitialise the firmware differs between CPC machines. You are using CALL &08BD to reinitialise the firmware in your patch, but this doesn't work on CPC464 and CPC664 machines.

To detect the address to CALL, use the following code in your loader (not the patch!):

Code: [Select]
LD HL,(&BD38)
RES 7,H
LD (call_init_firmware+1),HL

where call_init_firmware is the address in your patch where the CALL which reinitialises the firmware is located. In other words, you need to modify your patch before you set it up.

Offline Joseman

  • 6128 Plus
  • ******
  • Posts: 653
  • Country: es
  • Liked: 479
Re: Strange behaviour between cpc464 & cpc6128
« Reply #2 on: 23:07, 22 July 17 »
The CALL to reinitialise the firmware differs between CPC machines. You are using CALL &08BD to reinitialise the firmware in your patch, but this doesn't work on CPC464 and CPC664 machines.

To detect the address to CALL, use the following code in your loader (not the patch!):

Code: [Select]
LD HL,(&BD38)
RES 7,H
LD (call_init_firmware+1),HL

where call_init_firmware is the address in your patch where the CALL which reinitialises the firmware is located. In other words, you need to modify your patch before you set it up.

Thankyou for the help @Nich!!

The funny thing is that the load of the files is made correctly by the 464 with my routine (apparently the firmware & amsdos seems to work ok), only the lower rom disable thing is preventing  the game to run...

when i have time i will try to disable only the the lower rom, just to try if it works correctly.

BUT, i will implement your code to make 100% compatible!

thanks again!!