English Amiga Board


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

 
 
Thread Tools
Old 12 February 2018, 08:05   #41
LaBodilsen
Registered User
 
Join Date: Dec 2017
Location: Denmark
Posts: 179
Quote:
Originally Posted by bloodline View Post
I hope people aren't getting a bit fed up with all my failures!
Don't worry about that. Personally i love to follow projects, where the post-update rate is as high as this one, as you get a much better understanding of all the struggles and pitfalls that you went trough, instead of just updates stating "this and that is now implementet". it gives me some hope, that i'm not the only one who struggles with my projects, and have fun while doing so.

Quote:
I was able to fix the shifting section and now we have what appears to be a fully working boot of KS1.2!
Sweet.
LaBodilsen is offline  
Old 12 February 2018, 11:08   #42
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
Quote:
Originally Posted by bloodline View Post
On Topic: Can the blitter access address that are not word aligned? The C and D channels seem regularly loaded with odd addresses by the kickstart... Which doesn't seem right to me (I'm currently ignoring the least significant bit).
No, it can't..
hooverphonique is offline  
Old 12 February 2018, 13:32   #43
kamelito
Zone Friend
 
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,801
@Bloodline
http://aminet.net/package/dev/misc/BlitLab
kamelito is offline  
Old 12 February 2018, 14:28   #44
bloodline
Registered User
 
bloodline's Avatar
 
Join Date: Jan 2017
Location: London, UK
Posts: 433
Quote:
Originally Posted by kamelito View Post
Lol! Now you show me this!
bloodline is offline  
Old 12 February 2018, 14:31   #45
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
Don't follow it blindly, it isn't exactly same as real blitter, if I remember correctly, for example DAT registers are not simulated correctly.
Toni Wilen is offline  
Old 12 February 2018, 16:39   #46
bloodline
Registered User
 
bloodline's Avatar
 
Join Date: Jan 2017
Location: London, UK
Posts: 433
Quote:
Originally Posted by Toni Wilen View Post
Don't follow it blindly, it isn't exactly same as real blitter, if I remember correctly, for example DAT registers are not simulated correctly.
Cheers Toni, as you can see, I have managed to get my blitter implementation good enough to convince KS1.2 to bootstrap. It's clear my line mode isn't perfect, when I compare the image with a real A500 the hand isn't quite drawn the same (probably due to a bug somewhere, that will be easier to find with more real world tests), but I've taken that as far as I can for now. KS3 does several read and writes to the Gayle IDE address space... then does nothing... So I'll have to put part 2 of this project (getting KS3 booting to the insert disk screen) on hold for the time being.

I'm moving on trying to get floppy emulation working, as this will allow be to run more software to test what parts on my emulator really don't work.

Can you suggest a sensible way to generate an EClock? I'm currently counting 8 pixels per scaline, then decrementing the CIA timers, this seems to approximate just under 1Mhz...

Last edited by bloodline; 13 February 2018 at 10:03. Reason: Typos
bloodline is offline  
Old 12 February 2018, 19:22   #47
nogginthenog
Amigan
 
Join Date: Feb 2012
Location: London
Posts: 1,309
Great work
Out of interest Bloodline what 68000 CPU emulator are you using? Self written or an existing emulation?
nogginthenog is offline  
Old 12 February 2018, 20:58   #48
bloodline
Registered User
 
bloodline's Avatar
 
Join Date: Jan 2017
Location: London, UK
Posts: 433
Quote:
Originally Posted by nogginthenog View Post
Great work
Out of interest Bloodline what 68000 CPU emulator are you using? Self written or an existing emulation?
Currently just using Musashi, which I was using for another Amiga related project, so I was able to fit it in without any code modifications from my other project.

Once I get the emulation working as well as I need, I will see about using a JIT.
bloodline is offline  
Old 13 February 2018, 12:45   #49
bloodline
Registered User
 
bloodline's Avatar
 
Join Date: Jan 2017
Location: London, UK
Posts: 433
For fun here is a Debian x86-64 build (you'll need SDL2.0 installed - that's the only dependancy), so those at home can join in the fun.

I will post a raspbian build at some point too

I'll see about putting up a windows build, but I don't have Windows machine here...

-Edit- All pre v0.1 builds have been removed as they serve no function anymore

Last edited by bloodline; 01 March 2018 at 15:54.
bloodline is offline  
Old 14 February 2018, 16:12   #50
bloodline
Registered User
 
bloodline's Avatar
 
Join Date: Jan 2017
Location: London, UK
Posts: 433
My emulator is now able to emulate floppy drives, and will accept an adf file as the second command line parameter:

zorro kick12.rom workbench.adf

Pressing F1, will simulate inserting the disk into the floppy drive 0.

For some reason, even though I have tried to emulate 4 floppy drives, only the internal drive has it's drive head stepped from track 0 to 1 and then back again (about every 10 seconds, how do the other drives signal to the amiga they are present on the system?), this appears to be based on an interrupt generated by CIAA. Full Debugging output is provided via command line.

The problem I have now is turning the ADF data structure into an MFM data structure.

My current idea is to convert the adf during load time, so only the MFM data is stored in memory and used by my emulator.

Now the structure of an MFM track seems quite complicated

From what I've read, a disk is made up of 80 tracks, each track is made up of 11 sectors, and there is one data block (512bytes) per sector. An ADF is just the data blocks, so I need to build the sectors to populate my MFM tracks.

Sectors appear to have synchronisation bytes, headers and checksums all before the data... which itself appears to be divided into odd and even bytes... this is going to be a serious headache

Frustratingly the Hardware reference manual says the MFM synchronisation word is 0x4489, but that contains an illegal transition, it states this is the mfm encoding of 0xA1... which I make to be 0x44A9... who is right? Me or the HRM?

Last edited by bloodline; 14 February 2018 at 17:13.
bloodline is offline  
Old 14 February 2018, 19:00   #51
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by bloodline View Post
Frustratingly the Hardware reference manual says the MFM synchronisation word is 0x4489, but that contains an illegal transition, it states this is the mfm encoding of 0xA1... which I make to be 0x44A9... who is right? Me or the HRM?
0x4489 is used for synchronisation, so it would not be useful when it has the same encoding as 0xA1. The synchronisation word should not appear in a normal data stream.
phx is offline  
Old 14 February 2018, 23:07   #52
bloodline
Registered User
 
bloodline's Avatar
 
Join Date: Jan 2017
Location: London, UK
Posts: 433
Quote:
Originally Posted by phx View Post
0x4489 is used for synchronisation, so it would not be useful when it has the same encoding as 0xA1. The synchronisation word should not appear in a normal data stream.
Thanks for replying!

I didn't make my problem very clear.

I have to turn the ADF data blocks into MFM data that the operating system expects to be read in from a real floppy disk.

My guess is that means I will need to take 512bytes of data from the ADF, then prefix it with the synchronising long 0x0,0x0,0xA1,0xA1, then I need to add a header with the sector info, then the checksum and finally the data. Then all of this need to be encoded as MFM... currently my MFM encoding algorithm is producing garbage.

-edit-
Found this thread which is helping me understand what I'm doing wrong http://www.amiga.org/forums/showthread.php?p=834189

It also looks like Toni Wilen has come to the rescue again! I think I can just use rawread to make an mfm image and carry on working on my Emulator for the time being http://aminet.net/package/disk/bakup/rawread

Last edited by bloodline; 15 February 2018 at 12:05.
bloodline is offline  
Old 15 February 2018, 16:13   #53
bloodline
Registered User
 
bloodline's Avatar
 
Join Date: Jan 2017
Location: London, UK
Posts: 433
So rawread doesn't appear to capture the mlm data so I am pressing ahead with my own ADF -> MFM encoder.

I have attached my first pass. This is an ADF with the low level disk format sector data added to each data block. This increases each block size from 512bytes to 544bytes.

I haven't calculated the low level sector header or data check sum fields yet, I'm hoping someone here will be able to verify what I have done so far first, particularly my track number calculation.

The plan is to take this data and then run it through an MFM encoder to produce the final data structure (I am aware that the various parts of each sector need to be mfm encoded as odd/even sections... but one step at a time.)
Attached Files
File Type: zip test.llf.zip (357.4 KB, 186 views)
bloodline is offline  
Old 15 February 2018, 16:17   #54
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
Quote:
Originally Posted by bloodline View Post
So rawread doesn't appear to capture the mlm data so I am pressing ahead with my own ADF -> MFM encoder.
Of course it does. Use required parameter (should be mentioned in help output) to force MFM even when track format is normal AmigaDOS.

EDIT: not that it helps much because stored data is not aligned, it is just 1:1 bit stream.
Toni Wilen is offline  
Old 16 February 2018, 00:36   #55
bloodline
Registered User
 
bloodline's Avatar
 
Join Date: Jan 2017
Location: London, UK
Posts: 433
Quote:
Originally Posted by Toni Wilen View Post
Of course it does. Use required parameter (should be mentioned in help output) to force MFM even when track format is normal AmigaDOS.

EDIT: not that it helps much because stored data is not aligned, it is just 1:1 bit stream.
Apologies Toni, using options -x -1 I definitely get mfm data! But the first sync word is at 370,076 bytes into the file!! That can't be track 0, can it??
bloodline is offline  
Old 16 February 2018, 09:04   #56
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
rawread won't care about sync words, it simply stores all bits from index to index (with some ugly guessing where to put the track splice position)
Toni Wilen is offline  
Old 16 February 2018, 09:15   #57
bloodline
Registered User
 
bloodline's Avatar
 
Join Date: Jan 2017
Location: London, UK
Posts: 433
Quote:
Originally Posted by Toni Wilen View Post
rawread won't care about sync words, it simply stores all bits from index to index (with some ugly guessing where to put the track splice position)
I'm guessing I can't just feed this data into my disk DMA and hope the trackdisk device running on my Emulator will figure out what is going on?
bloodline is offline  
Old 16 February 2018, 09:57   #58
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
Quote:
Originally Posted by bloodline View Post
I'm guessing I can't just feed this data into my disk DMA and hope the trackdisk device running on my Emulator will figure out what is going on?
Yes, it should work under KS 1.x trackdisk.device because it does not use word sync mode. (AFAIK because code was made before word sync hardware existed/worked, it was rewritten for KS 2.x)
Toni Wilen is offline  
Old 16 February 2018, 10:19   #59
bloodline
Registered User
 
bloodline's Avatar
 
Join Date: Jan 2017
Location: London, UK
Posts: 433
Quote:
Originally Posted by Toni Wilen View Post
Yes, it should work under KS 1.x trackdisk.device because it does not use word sync mode. (AFAIK because code was made before word sync hardware existed/worked, it was rewritten for KS 2.x)
Ok! Cheers Toni, I'll give that a go and see what happens
bloodline is offline  
Old 16 February 2018, 10:45   #60
kolla
Banned
 
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 1,893
Quote:
Originally Posted by bloodline View Post
I hope people aren't getting a bit fed up with all my failures!
Are you kidding, this is mighty entertaining and fun!

Just a silly idea I've had, throwing it out there... UAE as an EFI loadable, taking over the system at boot time.
kolla 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
Amiga emulator for iOS steviebwoy support.OtherUAE 35 15 November 2014 10:14
Amiga emulator for a PSP? Vars191 support.OtherUAE 1 09 May 2010 02:08
Frederic's Emulator inside and Emulator thread Fred the Fop Retrogaming General Discussion 22 09 March 2006 07:31
ADF Files -> Amiga(amiga with dos Emulator) Schattenmeister support.Hardware 8 14 October 2003 00:10
Which Amiga emulator is best? Tim Janssen Amiga scene 45 15 February 2002 19:52

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 12:49.

Top

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