English Amiga Board


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

 
 
Thread Tools
Old 12 December 2022, 11:58   #1
Brick Nash
Prototron
 
Brick Nash's Avatar
 
Join Date: Mar 2015
Location: Glasgow, Scotland
Posts: 411
Help understanding the RNC loader

I downloaded the RNC sector loader from the Flashtro site and have been trying to study it a bit.

I must admit, it's all a little over my head, but as long as it works I'll be happy.

I have a few questions about how to use it though:

Most of the registers' uses I somewhat understand, but it says that D4 is for the "Serial Key," but I don't recall that every being mentioned in the books that I have? Can anyone explain what that is, or is it another term for something more familiar?

Also, can someone give some example values that need to go in the registers for reading from disk and writing to disk? It doesn't really matter specifically what they are, but just for context and etiquette.

Many thanks!

Code:
;====================================================================
;
; N.O.M.A.D. FAIRLIGHT SHORTENED RNC SECTOR LOADER FROM MORTAL KOMBAT
;
;====================================================================
;
; D0 	= Drive number to read (on Entry)
; D0 	= Error code (on Exit)
; D1 	= Sector start
; D2 	= Number of Sectors to read
; D3 	= Drive motor on or off after read
; D4 	= Serial key
;
;--------------------------------------------------------------------
;
; A0 	= Load address
; A1 	= Track buffer decode address
;
;====================================================================
Brick Nash is offline  
Old 12 December 2022, 12:44   #2
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
This is from official version (I don't know if it's the latest, but probably):

Code:
*------------------------------------------------------------------------------
* Low Level Read/Write/Format Disk Code for AmigaDos Disks
*
* Copyright (c) 1988-95 Rob Northen Computing, U.K. All Rights Reserved.
*
* File: DISKIO.S
*
* Date: 16.01.95
*------------------------------------------------------------------------------
*
*------------------------------------------------------------------------------
* Low Level Read/Write/Format Disk Code for AmigaDos Disks
* on entry,
*	d0.w = drive number
*		0 = DF0
*		1 = DF1
*		2 = DF2
*		3 = DF3
*		4 = DF0, side 0 only
*		5 = DF1, side 0 only
*		6 = DF2, side 0 only
*		7 = DF3, side 0 only
*	d1.w = start sector no.
*		(0-879 for single sided disk, 0-1759 for double sided disk)
*	d2.w = number of sectors to read/write
*		0 = turn motor off (bit 15 of d3 must be set)
*	d3.w = function
*		0 = read sectors
*		1 = write sectors
*		2 = format track
*			a0.l = address of sector data or $0
*			a1.l = address of $3300 byte buffer
*			d1.w = sector no. of track to format
*			       ie. 0=track 0, side 0
*			          11=track 0, side 1 or track 1, side 0
*				  depending upon d0.w
*			d2.w = sectors to format
*			       ie.11=1 track
*			          22=2 tracks
*		3 = find which drive(s) attached, result returned in d0.b 
*			bit 0 : 0 = no DF0:, 1 = DF0: present
*			bit 1 : 0 = no DF1:, 1 = DF1: present
*			bit 2 : 0 = no DF2:, 1 = DF2: present
*			bit 3 : 0 = no DF3:, 1 = DF3: present
*	bit 15 of d3.w controls whether the drive motor is turned off
*	after use. If bit 15 is clear the drive motor is left on. If
*	bit 15 is set the drive motor is turned off. Leave the drive
*	motor on if another disk operation is to be made soon after
*	the current one.
*
*	a0.l = disk buffer address for transfer
*	a1.l = workspace buffer, ($3300 bytes of CHIPMEM required)
* on exit,
*	d0.l = error no., if d0.l <> 0 then d1.l = sector offset in error
*		00 = no error
*		21 = No Sector Header
*		22 = Bad Sector Preamble
*		23 = Bad Sector ID
*		24 = Bad Sector Header Checksum
*		25 = Bad Sector Sum
*		26 = Too Few Sectors
*		27 = Bad Sector Header
*		28 = Write Protected
*		29 = No Disk in Drive
*		30 = Seek Error
*		34 = Drive In Use
*		-1 = DMA timeout
*
* Note: The disk code uses Timer A of CIA B. The blitter is not used
*------------------------------------------------------------------------------
EDIT: Maybe D4 in your case is for copylock? (I didn't check NOMAD's code)

Last edited by ross; 12 December 2022 at 12:52.
ross is offline  
Old 12 December 2022, 17:24   #3
Brick Nash
Prototron
 
Brick Nash's Avatar
 
Join Date: Mar 2015
Location: Glasgow, Scotland
Posts: 411
Quote:
Originally Posted by ross View Post
This is from official version (I don't know if it's the latest, but probably):

Code:
*------------------------------------------------------------------------------
* Low Level Read/Write/Format Disk Code for AmigaDos Disks
*
* Copyright (c) 1988-95 Rob Northen Computing, U.K. All Rights Reserved.
*
* File: DISKIO.S
*
* Date: 16.01.95
*------------------------------------------------------------------------------
*
*------------------------------------------------------------------------------
* Low Level Read/Write/Format Disk Code for AmigaDos Disks
* on entry,
*	d0.w = drive number
*		0 = DF0
*		1 = DF1
*		2 = DF2
*		3 = DF3
*		4 = DF0, side 0 only
*		5 = DF1, side 0 only
*		6 = DF2, side 0 only
*		7 = DF3, side 0 only
*	d1.w = start sector no.
*		(0-879 for single sided disk, 0-1759 for double sided disk)
*	d2.w = number of sectors to read/write
*		0 = turn motor off (bit 15 of d3 must be set)
*	d3.w = function
*		0 = read sectors
*		1 = write sectors
*		2 = format track
*			a0.l = address of sector data or $0
*			a1.l = address of $3300 byte buffer
*			d1.w = sector no. of track to format
*			       ie. 0=track 0, side 0
*			          11=track 0, side 1 or track 1, side 0
*				  depending upon d0.w
*			d2.w = sectors to format
*			       ie.11=1 track
*			          22=2 tracks
*		3 = find which drive(s) attached, result returned in d0.b 
*			bit 0 : 0 = no DF0:, 1 = DF0: present
*			bit 1 : 0 = no DF1:, 1 = DF1: present
*			bit 2 : 0 = no DF2:, 1 = DF2: present
*			bit 3 : 0 = no DF3:, 1 = DF3: present
*	bit 15 of d3.w controls whether the drive motor is turned off
*	after use. If bit 15 is clear the drive motor is left on. If
*	bit 15 is set the drive motor is turned off. Leave the drive
*	motor on if another disk operation is to be made soon after
*	the current one.
*
*	a0.l = disk buffer address for transfer
*	a1.l = workspace buffer, ($3300 bytes of CHIPMEM required)
* on exit,
*	d0.l = error no., if d0.l <> 0 then d1.l = sector offset in error
*		00 = no error
*		21 = No Sector Header
*		22 = Bad Sector Preamble
*		23 = Bad Sector ID
*		24 = Bad Sector Header Checksum
*		25 = Bad Sector Sum
*		26 = Too Few Sectors
*		27 = Bad Sector Header
*		28 = Write Protected
*		29 = No Disk in Drive
*		30 = Seek Error
*		34 = Drive In Use
*		-1 = DMA timeout
*
* Note: The disk code uses Timer A of CIA B. The blitter is not used
*------------------------------------------------------------------------------
EDIT: Maybe D4 in your case is for copylock? (I didn't check NOMAD's code)
Thank you. That looks a bit easier to understand. Copying stuff to and from disks has been somewhat of a mystery to me so far.

Where can I find the whole official version? I don't mind paying if it's not free.
Brick Nash is offline  
Old 12 December 2022, 17:51   #4
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
D4 is used for serial key for PDOS format disks

The only difference between normal sector size AmigaDOS disks and PDOS for the end user is available total sectors.

Max on AmigaDOS format is $6e0 which when multiplied by sector size of $200 = $dc000 i.e. 901120 bytes

Max on PDOS is $780 which when multiplied by sector size of $200 = $f0000

PDOS = ProtectionDOS, Rob Northens MFM longtrack format

Last edited by Galahad/FLT; 12 December 2022 at 17:56.
Galahad/FLT is offline  
Old 12 December 2022, 17:56   #5
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
I uploaded it to the Zone!

Contains a patch by me on Write code (the original has a small bug that makes it very slow).

Usage:

Code:
; 	set parameters
	bsr diskio
--

diskio 	incbin	diskio
EDIT:
Quote:
Originally Posted by Galahad/FLT View Post
PDOS = ProtectionDOS, Rob Northens MFM longtrack format
That's right, although tracks can be 'normal length' too
In fact I remember that 'back in the days' I had "tricked" Mortal Kombat loader by simply shortening the tracks (removing the long gap) and using the original 12 sectors/track format [PDOS].

Of course not a real crack but it took me a few minutes for a 'backup'

Last edited by ross; 12 December 2022 at 18:18.
ross is offline  
Old 12 December 2022, 18:07   #6
Brick Nash
Prototron
 
Brick Nash's Avatar
 
Join Date: Mar 2015
Location: Glasgow, Scotland
Posts: 411
Excellent! Thanks for the info folks. There's no direct tutorials that I can find anywhere on this subject, so your help is invaluable.
Brick Nash is offline  
Old 12 December 2022, 18:43   #7
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
Quote:
Originally Posted by ross View Post
I uploaded it to the Zone!

Contains a patch by me on Write code (the original has a small bug that makes it very slow).

Usage:

Code:
; 	set parameters
	bsr diskio
--

diskio 	incbin	diskio
EDIT:

That's right, although tracks can be 'normal length' too
In fact I remember that 'back in the days' I had "tricked" Mortal Kombat loader by simply shortening the tracks (removing the long gap) and using the original 12 sectors/track format [PDOS].

Of course not a real crack but it took me a few minutes for a 'backup'
Well technically it isn't longtrack until duplication
Galahad/FLT is offline  
Old 12 December 2022, 20:24   #8
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by Galahad/FLT View Post
Well technically it isn't longtrack until duplication
Yeah, right.

For those interested and to expand on Galahad's answer: to make a batch of 'originals' a special box was used (usually a UNIX machine with dedicated hardware) which accepted a 'scripting' language with the definition of the layout of the tracks.
You can imagine IPF files as something similar (but IPF is much more 'complete' and flexible).
ross is offline  
Old 12 December 2022, 21:09   #9
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,161
There's a "RNCopy" program which allows to create 12-track Rob Northen format that you can write back, shortening the tracks but keeping the data intact and fooling the original loader.
jotd is online now  
Old 12 December 2022, 21:17   #10
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by jotd View Post
There's a "RNCopy" program which allows to create 12-track Rob Northen format that you can write back, shortening the tracks but keeping the data intact and fooling the original loader.
Well it wasn't there when I did the same thing, or at least I didn't know about its existence (I only found out now)
(not that it was difficult in any case )
ross is offline  
Old 12 December 2022, 21:20   #11
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,161
annoying when 2 people do the same work. I loved that program that allowed to "warp" & backup originals. Even today you can repair damaged RN tracks without kryoflux or GW, just by converting IPFs using this.

Note that wwarp (from whdload) is also able to read & write that format to floppy without extra hardware.
jotd is online now  
Old 12 December 2022, 21:35   #12
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by jotd View Post
annoying when 2 people do the same work
*cough* old jst *cough* whdload *cough*

ross is offline  
Old 12 December 2022, 22:17   #13
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,161
yes, that was pretty much non constructive too (specially the slaves being developped twice in some cases), but ended up providing an alternative to whdload & a CD32 loader that is able to run whdload slaves on a bare CD32 machine.
jotd is online now  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot RNC/propack a given file jotd support.Apps 3 27 December 2019 23:25
Ripping the RNC sector loader... h0ffman Coders. General 13 07 September 2011 23:00
Need help compiling RNC MC68000 source MethodGit Coders. General 5 31 January 2011 11:26
RNC IDE CD32 loader Galahad/FLT support.WinUAE 19 24 June 2006 10:05
RNC Data File Depacker v2.1 Nico New to Emulation or Amiga scene 8 05 May 2002 18:05

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 14:34.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09065 seconds with 15 queries