English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 18 February 2015, 22:08   #1
fuzzylogic
Registered User
 
Join Date: Jan 2010
Location: Germany
Posts: 59
"Classic" Fairlight intro question

Hi guys,

I always wondered about a piece of code which can be found in the "classic" FLT intro (the one with the blue AD logo):

Code:
  pea start
  move.l (a7)+,80.w
  trap #0
  rts

start:
  move #$2700,sr
  (...)
  rts
What does this and why? Also, this looks problematic regarding higher CPUs, right?

Edit: I guess this code goes into supervisor-mode. If yes, why would you do this in an intro/why is it needed?
fuzzylogic is offline  
Old 19 February 2015, 01:31   #2
lesta_smsc
Registered User

lesta_smsc's Avatar
 
Join Date: Feb 2012
Location: United Kingdom
Posts: 2,084
Waiting on Sir Galahad to enlighten us with a reason for this.

Another possible explanation is 'proof of concept' to demonstrate the crack?
lesta_smsc is offline  
Old 19 February 2015, 03:14   #3
Codetapper
2 contact me: email only!

Codetapper's Avatar
 
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,162
Traps are supposed to end with an rte to return to the program. Does the crack ever actually return? It might never reach that final rts if it's loading the main game and jumping into it.

The other alternative is the same as what the Ben Daglish music player does, it "emulates" an rte by playing around with the stack. Unfortunately he assumed a 6-byte stackframe (and it's 8 bytes on a 68020+) and thus it only works on a 68000 and crashes on a 68020+.
Codetapper is offline  
Old 19 February 2015, 12:50   #4
fuzzylogic
Registered User
 
Join Date: Jan 2010
Location: Germany
Posts: 59
I don't think it is crack-related since "every" intro has this plus this code is extracted out of an intro which is simply put infront of a startup-sequence.
fuzzylogic is offline  
Old 19 February 2015, 17:55   #5
Apollo
Registered User

Apollo's Avatar
 
Join Date: Sep 2008
Location: Germany
Age: 45
Posts: 127
Maybe its only for getting into supervisor mode?
Apollo is online now  
Old 14 September 2015, 01:51   #6
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 46
Posts: 7,402
Quote:
Originally Posted by fuzzylogic View Post
Hi guys,

I always wondered about a piece of code which can be found in the "classic" FLT intro (the one with the blue AD logo):

Code:
  pea start
  move.l (a7)+,80.w
  trap #0
  rts

start:
  move #$2700,sr
  (...)
  rts
What does this and why? Also, this looks problematic regarding higher CPUs, right?

Edit: I guess this code goes into supervisor-mode. If yes, why would you do this in an intro/why is it needed?
Would have answered this sooner had I seen it.

Its to kick the system into Supervisor mode for the intro to run.

However, this was only in Gastons version of the intro, and as all of his cracks for Fairlight were for the A500, it wasn't an issue, but for later iterations of the intro that myself and Renegade used, we changed it.

Same intro on Clockwiser, except I used a system friendly supervisor mode setup as the Vector Base Register can change which means that executing a TRAP #0 on machines with a processor greater than 68000 doesn't necessarily equate that the code at address $80 will be executed.

In all cases, code should be stored at an OFFSET of whatever is in the Vector Base Register.

So for instance, instead of moving that supervisor code into address $80, we would find out the VBR, and then move the code into an offset of $80 of the VBR to be correct.

But doing it via a system friendly way like I did is easier and safer and is guaranteed to work no matter what.
Galahad/FLT is offline  
Old 14 September 2015, 12:14   #7
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
as for the last part of the question, i would also like to know...

why would you want to go into Supervisor mode anyway?
Mrs Beanbag is offline  
Old 14 September 2015, 15:05   #8
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,265
Access to caches or other CPU resources required it, but no demos or intros back in those days needed that, they usually assumed they were running on a plain A500. It was just coder pompousness, doing it "proper", and taking after other coders without thinking about it.
Leffmann is offline  
Old 14 September 2015, 22:45   #9
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 46
Posts: 7,402
Quote:
Originally Posted by Mrs Beanbag View Post
as for the last part of the question, i would also like to know...

why would you want to go into Supervisor mode anyway?
You will find that most games, demos and the like went into supervisor mode, changing stack pointers when taking over the entire system, all instructions available for use.
Galahad/FLT is offline  
Old 11 October 2015, 17:03   #10
Photon
Moderator

Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 4,799
Just one of those habits that got used by others I think, perhaps to an extent by disassembling ripping others' code. It really isn't necessary, you can make any game or demo bang the hardware to the full without supervisor mode.
Photon is offline  
Old 11 October 2015, 23:11   #11
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 46
Posts: 7,402
Quote:
Originally Posted by Leffmann View Post
Access to caches or other CPU resources required it, but no demos or intros back in those days needed that, they usually assumed they were running on a plain A500. It was just coder pompousness, doing it "proper", and taking after other coders without thinking about it.
Ive heard it all now, im a 'Galahad Kitten' and pompous.

I dont know whether to cheer or cry
Galahad/FLT is offline  
Old 12 October 2015, 13:38   #12
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,265
I was just speaking generally about those older demos, it wasn't directed at you or anyone in particular And if I read your post right then you obviously did things differently.
Leffmann is offline  
Old 12 October 2015, 17:41   #13
ReadOnlyCat
Code Kitten

 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 48
Posts: 1,143
Quote:
Originally Posted by Galahad/FLT View Post
Ive heard it all now, im a 'Galahad Kitten' and pompous.

I dont know whether to cheer or cry
Being a kitten myself I tend to call other creatures "kittens" as well.
I have already christened a few people as such here (Phx for example) and this is usually meant as a token of appreciation.

^^
ReadOnlyCat is offline  
Old 27 October 2015, 12:28   #14
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 46
Posts: 3,639
Quote:
Originally Posted by Mrs Beanbag View Post
why would you want to go into Supervisor mode anyway?
Influence of the Atari ST maybe ?
There you HAD to be in supervisor mode to access the HW. I've seen some Amiga programs uselessly do the same.
meynaf is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Hollywood Poker Pro" intro out of synch with WHDLoad? arkpandora support.Games 10 03 December 2014 00:36
Amiga 500 1mb Intro "inside" Amiten project.Amiga Game Factory 2 12 February 2013 11:17
"Reminder "Lincs Amiga User Group aka "LAG" Meet Sat 5th of January 2013" rockape News 4 30 January 2013 01:06
WinUAE problem with 40k Intro StoneArts/"Bjarne" oRBIT support.WinUAE 10 11 April 2008 10:49

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 23:30.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.07946 seconds with 13 queries