Page 2 of 9
Re: Flagon Bird
Posted: Tue Jul 01, 2014 1:01 am
by CaptainNemo
I'm back to report!
Played Flagon Bird for almost an hour on a real Dragon 64 and it's even more addictive...
Animation is smooth and the game is very responsive.
Rank names are awesome -- nice thinking! How many are there?
My new high score is 15!!!
Re: Flagon Bird
Posted: Tue Jul 01, 2014 8:45 am
by Bosco
Great to hear you're enjoying the game.
Ranking players with dragon names was my wife's idea so I can't take all the credit.
There are 96 ranks in all, if you include `faffy' for zero points. Initially each point earns you a new rank, then increases to two points, five points and ten points.
To reach the top rank you'd need a score of 250 or higher, although I'm not sure how achievable this is.
15 is a promising score!
Re: Flagon Bird
Posted: Tue Jul 01, 2014 10:21 pm
by zephyr
robcfg wrote:I tried creating a rom file with a small loader to copy the game code to the right location and jumping to it, but it seems I need to initialize tha machine first.
Code: Select all
org 49152
ldd #3766
ldx #49178
ldy #16384
loop
pshs d
ldd ,x+
std ,y+
puls d
subd #1
bne loop
jmp 16384
INCLUDEBIN ./flagon.bin
Maybe @Zephyr could help us a bit here.
You need to enable the 50Hz IRQ before jumping to the game start address.
Code: Select all
LOOP
LDU ,X++
STU ,Y++
SUBD #1
BNE LOOP
LDA $FF03
ORA #$01
STA $FF03
ANDCC #$EF
JMP $4000
INCLUDEBIN ./flagon.bin
Re: Flagon Bird
Posted: Tue Jul 01, 2014 10:51 pm
by robcfg
Awesome! Thanks!
Here you have the Rom version for your favorite multi-cartridge
![Wink ;)](./images/smilies/icon_e_wink.gif)
Re: Flagon Bird
Posted: Wed Jul 02, 2014 1:02 am
by Bosco
Nice work!
BTW. I decided to post a video on YouTube.
https://www.youtube.com/watch?v=HiTOYig ... e=youtu.be
Not sure if it was a good idea? YouTube trolls can be harsh!
Re: Flagon Bird
Posted: Wed Jul 02, 2014 12:10 pm
by Rolo
Hi Rob,
you were faster than me
![Smile :)](./images/smilies/icon_e_smile.gif)
(which is not very hard, I have to admit
![Embarrassed :oops:](./images/smilies/icon_redface.gif)
)
Since I’m always interested in new roms (smaller 16K), I was investigating the same thing yesterday and saw the endless loop:
Code: Select all
4120| 7d4762 TST $4762 cc=40 a=00 b=02 dp=00 x=1d20 y=5555 u=ffff s=7f30
4123| 26fb BNE $4120 cc=40 a=00 b=02 dp=00 x=1d20 y=5555 u=ffff s=7f30
And the diverted IRQ-vector pointing to:
pshs a
lda >$ff03
tst >$4762
beq L_C097
lbsr L_C3D9
clr >$4762
L_C097 lda >$ff02
puls a
rti
but the Xroar-trace showed no IRQ or FIRQ was happening.
I wanted to fix that today. Thanks!
@Bosco: Congratulations, great work! More to come?
-Rolo
Re: Flagon Bird
Posted: Wed Jul 02, 2014 3:28 pm
by zephyr
Code: Select all
406A 3402 PSHS A
406C B6FF03 LDA $FF03
406F 7D4762 TST $4762
4072 2706 BEQ $407A
4074 170345 LBSR $43BC
4077 7F4762 CLR $4762
407A B6FF02 LDA $FF02
407D 3502 PULS A
407F 3B RTI
Code: Select all
43BC 3450 PSHS X,U
43BE BE4753 LDX $4753
43C1 FE4755 LDU $4755
43C4 1E13 EXG X,U
43C6 BF4753 STX $4753
43C9 FF4755 STU $4755
43CC 8C0600 CMPX #$0600
43CF 270E BEQ $43DF
43D1 B7FFC7 STA $FFC7
43D4 B7FFC8 STA $FFC8
43D7 B7FFCA STA $FFCA
43DA B7FFCD STA $FFCD
43DD 200C BRA $43EB
43DF B7FFC7 STA $FFC7
43E2 B7FFC9 STA $FFC9
43E5 B7FFCA STA $FFCA
43E8 B7FFCC STA $FFCC
43EB 35D0 PULS X,U,PC
@Bosco: You don't need the PUSH/PUL code in your IRQ handler routine. The entire machine state is always saved on the hardware stack during processing of an IRQ input.
You can also remove the LDA $FF03 and replace the TST $4762 with LDA $4762.
Also, I suggest using the following code rather than have the extra EXG slowing things down.
Code: Select all
LDU $4753
LDX $4755
STX $4753
STU $4755
CMPX #$0600
Re: Flagon Bird
Posted: Wed Jul 02, 2014 9:20 pm
by Bosco
@Rolo: Yeah, definitely more new stuff to come.
@zephyr: Thanks for the code tips.
At the end of my IRQ service routine I read address $FF02. Does this clear the interrupt mask?
Re: Flagon Bird
Posted: Wed Jul 02, 2014 9:40 pm
by zephyr
Bosco wrote:Does this clear the interrupt mask?
No. The interrupt mask (I) is cleared by the RTI instruction. Inside the Dragon describes the reading of $FF02 as "Clearing the interrupt condition".
Re: Flagon Bird
Posted: Wed Jul 02, 2014 9:58 pm
by Bosco
Thanks for clearing that up. Lots still to learn.
![Smile :)](./images/smilies/icon_e_smile.gif)