English Amiga Board


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

 
 
Thread Tools
Old 10 December 2014, 20:06   #1
jimmy2x2x
Beyond Mutton
jimmy2x2x's Avatar
 
Join Date: Mar 2011
Location: North West, UK
Age: 48
Posts: 347
SOLID GOLD source code

I've been having a look through the source code, it's very well written and consistently formatted and documented. Thanks for that frank. I am trying to use the keyboard handler from input.asm

Could you please confirm if any special conditions are need for calling initkeyboard and exitkeyboard?

Also when calling getkey, how do you ensure that no keyboard interrupt occurs?

Sorry for being a bit thick with this, and I'm sure the answers are in the solid gold source somewhere, but I 2 hoping for a quick reply here so I can get in with finishing my game, rather than digging through the source!

Thanks
jimmy2x2x is offline  
Old 11 December 2014, 00:16   #2
Adrian Browne
Jackie Chan
 
Join Date: Mar 2012
Location: Ireland
Age: 42
Posts: 691
what game are you making?
Adrian Browne is offline  
Old 11 December 2014, 00:50   #3
jimmy2x2x
Beyond Mutton
jimmy2x2x's Avatar
 
Join Date: Mar 2011
Location: North West, UK
Age: 48
Posts: 347
Bruce Lee is my main game, an update of the old c64 game, and also a smaller spin off game love dungeon, both test versions are in the zone, just finishing ld.
jimmy2x2x is offline  
Old 11 December 2014, 10:37   #4
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,600
Quote:
Originally Posted by jimmy2x2x View Post
Could you please confirm if any special conditions are need for calling initkeyboard and exitkeyboard?
Unless otherwise documented, all functions in Solid Gold expect:
- a6 = custom chips base pointer $dff000
- a4 = small data base pointer (to access data in __MERGED sections)
- d0-d1/a0-a1 are scratch registers

The small data mode may be a problem for you, when you don't use it. In this case you have to remove "(a4)" from the input.asm source, to use absolute 32-bit addressing.


Quote:
Also when calling getkey, how do you ensure that no keyboard interrupt occurs?
Solid Gold is running completely during VERTB interrupt, as it has a constant 50 fps frame rate. VERTB has a higher priority than a PORTS interrupt, so I am safe. When calling getkey from outside an interrupt, you have to do this:
Code:
        move.w  #$4000,INTENA(a6)
        bsr     getkey   
        move.w  #$c000,INTENA(a6)
Or when this is the usual case for you, you can include the temporary interrupt disable into your getkey function.
phx is offline  
Old 11 December 2014, 15:41   #5
jimmy2x2x
Beyond Mutton
jimmy2x2x's Avatar
 
Join Date: Mar 2011
Location: North West, UK
Age: 48
Posts: 347
Thanks, seems pretty straight forward. I will have another look tonight.
jimmy2x2x is offline  
Old 12 December 2014, 16:33   #6
jimmy2x2x
Beyond Mutton
jimmy2x2x's Avatar
 
Join Date: Mar 2011
Location: North West, UK
Age: 48
Posts: 347
I think I have it working now, however I am relying on winuae at the moment and the strange thing is, I have to lose focus from winuae window before keys will be detected! I've got a test version in the zone and it would be a great help if someone could confirm that it works on a real Amiga. Just start a new game and space bar should quit back to title screen.

Solid Gold looks like an amazing resource, I will try and understand the program flow and learn from it, thanks again

Last edited by jimmy2x2x; 12 December 2014 at 17:40.
jimmy2x2x is offline  
Old 12 December 2014, 17:52   #7
spud
Registered User

 
Join Date: May 2010
Location: London, UK
Posts: 256
This may be a really obvious thing you've already thought of but you don't have the arrow keys mapped to a joystick in WinUAE do you ?
spud is offline  
Old 12 December 2014, 18:10   #8
jimmy2x2x
Beyond Mutton
jimmy2x2x's Avatar
 
Join Date: Mar 2011
Location: North West, UK
Age: 48
Posts: 347
I will check! Would that cause it to behave this way (no keys detected until you ALT tab out and back into winuae) ?
jimmy2x2x is offline  
Old 12 December 2014, 21:56   #9
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,600
Quote:
Originally Posted by jimmy2x2x View Post
it would be a great help if someone could confirm that it works on a real Amiga. Just start a new game and space bar should quit back to title screen.
Confirmed. Works fine! (A3000/060)

Quote:
Solid Gold looks like an amazing resource, I will try and understand the program flow and learn from it, thanks again
That was my intention. To see more homebrew games like yours.

BTW, technically LoveDungeon already looks very well done. It is not the first Amiga game you wrote, isn't it? Please keep working on it.

It is also a smart choice to start with a mini game first, so you have the chance to finish something and keep the motivation for the next project.
phx is offline  
Old 13 December 2014, 08:43   #10
jimmy2x2x
Beyond Mutton
jimmy2x2x's Avatar
 
Join Date: Mar 2011
Location: North West, UK
Age: 48
Posts: 347
Great news, glad the keyboard is working. I've written a few commercial games about 20 odd years ago, nothing for a while.. I'm getting cautious about feature creep with love dungeon, I'm almost ready to distribute, a couple of technical issues, level design and loads more testing, I'm really happy with it for what it is. Got a couple more surprises for the final version ☺
jimmy2x2x is offline  
Old 13 December 2014, 18:53   #11
Lonewolf10
AMOS Extensions Developer
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 40
Posts: 1,923
Quote:
Originally Posted by jimmy2x2x View Post
Great news, glad the keyboard is working. I've written a few commercial games about 20 odd years ago, nothing for a while..
Would you be so kind as to name them?
Lonewolf10 is offline  
Old 06 April 2015, 01:26   #12
RetroRich
 
Posts: n/a
Hi I'm trying to use the input.s from Solid Gold so that I can detect key presses in my simple programs, but I'm using AsmOne and struggling to get the code to Assemble.

It doesn't like line 40 - "near a4" I've tried to remove this (by commenting out), but errors on all lines that use a4, I'm not sure where a4 is even set? I don't even know if I can use just input.s or if it needs more files? (I've got custom.i and cia.i which link fine) or if it needs to be re-written slightly to work with AsmOne?

I'm very new to 68k asm, so really struggling to work out how to move forwards, and help or pointing in the right direction would be much apreciated.
 
Old 06 April 2015, 14:39   #13
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,600
Quote:
Originally Posted by RetroRich View Post
It doesn't like line 40 - "near a4"
That's a vasm/PhxAss-only directive to declare a4 as the small data base pointer. This makes sure the assembler treats all "label(a4)" operands as small data accesses.

Quote:
I've tried to remove this (by commenting out), but errors on all lines that use a4,
AsmOne doesn't know about small data, so it is confused about labels in d16(An) addressing modes.
Just remove "(a4)" in all places. This makes the code bigger and slower, but it will assemble and work.
The closest you can get with AsmOne is using the BASEREG directive, but it requires to assemble everything in a single huge source file. You may want to experiment with it.

Quote:
I'm not sure where a4 is even set?
In the startup function (startup.asm). I'm using _LinkerDB to initialise a4, which is a symbol provided by the linker. Only the linker can know where the small data base points to, after having merged all small data sections from all object files.

Quote:
I don't even know if I can use just input.s or if it needs more files?
That's easy. Just look out for XREF directives. They define the external symbol references of the source text.
input.asm has two external references:
- AutoVecBase: This location holds a pointer to the interrupt auto vector base address (0 for 68000, read from VBR register for 68010+).
- debug is a function from my game-internal debugging module. You don't need that. It is only used with defining the DEBUG symbol.

Quote:
I'm very new to 68k asm, so really struggling to work out how to move forwards, and help or pointing in the right direction would be much apreciated.
Just ask. Here are many experienced 68k coders who are happy to help.
phx is offline  
Old 07 April 2015, 14:38   #14
wXR
Registered User
 
Join Date: Mar 2009
Location: New York
Posts: 552
Jimmy, would you mind pointing me to the source code that inspired this?

I'm going to start compiling a list of source releases that led to useful further developments here, to make a point:

http://eab.abime.net/showthread.php?t=77722

(Feel free to contribute if you want to)
wXR is offline  
Old 07 April 2015, 15:47   #15
Korodny
Zone Friend
 
Join Date: Sep 2001
Location: Germany
Posts: 703
Quote:
Originally Posted by wXR View Post
Jimmy, would you mind pointing me to the source code that inspired this?
http://aminet.net/search.php?query=solid+gold

Quote:
I'm going to start compiling a list of source releases that led to useful further developments here, to make a point:

http://eab.abime.net/showthread.php?t=77722
I just updated that thread with the info I collected so far.
Korodny is offline  
Old 07 April 2015, 18:09   #16
wXR
Registered User
 
Join Date: Mar 2009
Location: New York
Posts: 552
Brilliant, thank you!!
wXR 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
Solid Gold released! phx News 160 26 September 2017 17:11
EAB/Lemon Super League 2014: Round 4 - Solid Gold Graham Humphrey EAB's competition 23 13 April 2014 01:08
Solid Gold source released phx News 32 02 February 2014 19:45
Solid Gold to be released December/January phx News 73 09 January 2014 21:37
Solid Gold Original Music phx News 2 04 January 2014 23:02

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 06:08.


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