Showing posts with label AsmOne. Show all posts
Showing posts with label AsmOne. Show all posts

Saturday, 4 April 2015

68k Part 1 - Easy now, raster lines and mouse buttons

Starting really simple now, lets change the colour of the raster lines and check the mouse buttons...

Changing the default colours on the Amiga

Yes there will be a heavy influence from the ScoopexUs 'Amiga Hardware Programming' tutorials on YouTube for the next few blog posts for sure. How can there not be? they are just so good!

I'm only learning, just a 68k noob!

I'm just trying to mess around with my own sections of code, for my own sanity, checking that I do sort of understand and hopefully will stick in my head for a while!  I will try to comment my code the best I can so that it explains itself.  Please PLEASE suggest better ways to do stuff, my samples sure wont be perfect.

My first snippet

Create a new file in Asm-One and copy paste the following code (or download source here).

This simple sample changes the default background and foreground colours, if the right mouse button is pressed down, it will change the colours whilst it's being pressed.  If the left mouse button is pressed the program is ended.

loop:
 
 btst #10, $dff016 ; test RIGHT mouse click
 bne default

; colours when right click is pressed
 
 move.w #$0f0, $dff180 ; moving colour in to background colour
 move.w #$0ff, $dff182 ; moving colour in to foreground colour

 bra  checkExit
 
default:

; default colours

 move.w #$f00, $dff180 ; moving colour in to background colour
 move.w #$ff0, $dff182 ; moving colour in to foreground colour 
 
checkExit:

 btst #6, $bfe001  ; test LEFT mouse click
 bne loop

 rts 

So I'm updating the colours every frame, I probably only need to do it at the start of the first raster line for each frame, but just as a sample I think it's ok.

Comment here or get involved on twitter: @rich_lloyd

Back with Amiga 68k Assembler, with ASM-ONE! C'MON!

OK so I started learning 68k assembler a while back now (2013!!) and it's tough, really tough.  I think it's more a case of just needing the time and focus to concentrate so that it absorbs in my brain.  Life and work gets in the way!!

I've been coding higher level languages for many many years now so it's not like I'm starting from scratch.  The hardest part for me is understanding the hardware, and how all the different code integrates to build the bigger picture.

Long story short - I've had a break away from the assembler world, and now I'm back and determined to get SOMEWHERE in 68k for the Amiga!  C'MON!

Comment here or get involved on twitter: @rich_lloyd

New goals!

Here's a list of things I would LOVE to achieve, once I've got a small library of techniques, hopefully I can start working towards the bigger goal of creating an Intro / Demo / Game.

  • Understanding  68k basics.  Moving stuff around in memory and program flow
  • Get a grip of the Copper, custom backgrounds
  • Draw a sprite!
  • Move a sprite!!
  • Mouse Input
  • Keyboard Input
  • Joystick Input
  • Play a music track / audio
  • Display Text
  • Create a simple Intro / Demo / Game
The ultimate goal would be to have made something awesome that fits on a floppy disc and runs on a regular Amiga machine.  I'll be happy with it running on the Amiga 1200, but if I can get it working on the Amiga 500 and upwards that really would be an achievement.

My new setup - AsmOne, lets get coding!

To achieve my goals, coding directly on my Amiga 1200 through my whole learning journey will be well... a very slow experience.  Lets get real, I'll be coding on my Windows laptops, then transferring the files to my Amiga now and then to check it works on real hardware.

My Windows setup with WinUAE, AsmOne and Notepad++
My Windows setup with WinUAE, AsmOne and Notepad++

Depending on the time of day, I'll be switching between 2 laptops (Windows 7 and Windows 8), but both will have identical set-ups.

Naturally I use WinUAE which is an amazing Amiga Emulator, you can download it here:

WinUAE Downloadhttp://www.winuae.net/frames/download.html

I've created a folder on my machine and set up as a hard drive (DH0:) when I launch WinUAE.  This means I can view files in BOTH the emulated Amiga and in Windows.  Makes it so easy to copy files about, especially when looking through examples online, I can just drop in to that folder and my emulated Amiga can see them straight away.  Happy days!

The assembler I will now be using to learn 68k will be AsmOne, mainly because there are plenty of examples out there that use it, and also off the back of Photon's truly amazing tutorials on YouTube which I have linked before, but will link again further down.

AsmOne Downloadhttp://www.theflamearrows.info/documents/ftp.html

Now I 'could' use the AsmOne text editor through the Amiga emulator, but in all honesty, it's slow.  Here's a better idea, as my files can be seen in Windows, I can use a modern text editor!!  Save the changes, and the Amiga will get updated.

For now I use Notepad++ , you can even import the 68k Assembly language definition for syntax highlighting etc...

Notepad++ Download here:
http://notepad-plus-plus.org/

Get the language definition here:
http://notepad-plus.sourceforge.net/commun/userDefinedLang/68K_Assembly.xml

So the last bit of setup I have, is that the folder I have on my Windows drive is actually part of my OneDrive (it could easily be a DropBox or GoogleDrive, etc... ).  As I work on multiple machines, my files instantly get synchronised so it makes it so much easier for me to pick up where I left when I get a spare moment.

68k references

Sure thing Google is your friend here, as well as the usual Amiga websites.  I have found it harder than I thought to hunt down things when I've had issues, so I'm just sharing some links here that might help out:
Make sure you subscribe to Photon's YouTube channel, includes excellent tutorials for Amiga Hardware Programming as well as other great Amgia stuff like demos.

ScoopexUs YouTube channel here - https://www.youtube.com/user/ScoopexUs

If you find a goldmine of reference then please let me know!

Here's a couple of books I find REALLY helpful when trying to get my head in the zone!


Comment here or get involved on twitter: @rich_lloyd

Wednesday, 11 September 2013

Amiga assembler tutorials - the wonders of YouTube

I wish I had these sorts of resources back in the 90's...

After some tweets back and forth with a few cool people, I have been shown further resources on the internet for learning about assembler for the Amiga.  I just wanted to share with you a cool YouTube channel Jonas pointed out to me that has several tutorials for Amiga assembler.

If I could embed a whole YouTube channel I would, but here's a link to the channel itself by ScoopexUs: http://www.youtube.com/user/ScoopexUs?feature=g-high-cen

My time at the moment is so limited I haven't had a chance to view all the videos, but I can see there are 9 Amiga programming tutorials, as well as some demo scene stuff.  Check out the channel or here's a couple of snippets...

It starts off really simple with this:



and continues to get more in depth up to this:



Thank you to ScoopexUs for the awesome tutorials, I really hope there are more to come, and thanks to Jonas for pointing these videos out to me, as well as proper reference books.

OK SO... I need to continue being a sponge and learn about the Amiga hardware and soon hopefully I will be able to put together my first proper experience.

Comment here or get involved on twitter: @rich_lloyd

Monday, 24 June 2013

Starting to learn assembly language - the journey begins... where do I start?!

Final goal?

Write a game for the Amiga 500.  Bonus goal would be for the same game to run on the Sega Mega Drive (Genesis), but I'll work that out once the first goal is achieved.

Lets start!

I have an Amiga 500, and as mentioned before I'll be following the Amiga Format Bullfrog tutorials for writing a game in assembly language (I'll be writing separate blog posts for each tutorial).  OK so tutorial 1 was pretty straight forward, very basic beginnings pretty much incrementing a register to move a sprite position and understanding some basics.  I've had a quick flick through ahead of the future tutorials and it's pretty obvious that I'm going to have to do some extra research!

OK after some quick googling, I've come across the following websites:

Through those links I was able to download numerous pdf documents, text file tutorials and lots of other people discussing assembler. Great!

A few people had mentioned particular books that they recommended, which then put me on a mission to hit ebay for real world BOOKS! Ebay books for 68000 processor

Real world books I've ended up with, should keep me going for a while!

"Lets get real"

OK so coding on the Amiga 500 is great, I have DevPac 2 and I can run simple examples.  However, this is going to take forever!  Not only is assembly language slow to code (especially when I'm learning), but one of the biggest draw backs is the lack of resources on the machine. As in, I can't just Google something and try it out.  My Amiga 500 is on my desk and sits next to my laptop so yes I can Google stuff, but I have no way to transfer files across other than typing out line by line. What do I do?

Ebay to the rescue again... I've purchased an Amiga 1200 (with a broken floppy drive - hopefully I will blog to explain how I will fix it).  The great thing about the Amiga 1200 is that you can connect it to the internet, and also use a compact flash card as a hard drive!! 4Gb!!  It's still in the post, but I expect I will try and code on the A1200 and once I'm up to speed I'll try and create boot disks with my tests and trials for the A500.  Remember my goal is to write a game for the Amiga 500 not Amiga 1200!


What next?

I've read through most of 2 68000 books, and I think it's becoming clear that I'm learning vanilla 68k assembly language.  I need some Amiga specific references.  I'm using DevPac 2, but maybe I need to get my hands of DevPac 3, AsmOne or some other assembler package?  And then find a reference + tutorials for that package?

I have stumbled upon Easy68k, this is an Editor, Assembler and Simulator for the 68000 that runs in Windows.  Again this looks like just vanilla 68k, but looks like a great way to learn the basics without crashing my Amiga ever time!

Do you still code in Assembler?!

Would love to hear from anyone who still codes in assembler, especially for the Amiga machines.  Or maybe if you used to?  Any hints or tips you could recommend?

Comment here or get involved on twitter: @rich_lloyd