English Amiga Board


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

 
 
Thread Tools
Old 11 August 2020, 13:14   #1
Brick Nash
Prototron
 
Brick Nash's Avatar
 
Join Date: Mar 2015
Location: Glasgow, Scotland
Posts: 411
** LineF Emulator ** Raised at $00020152

Hi folks. I've been working my way through Photon Of Scoopex ASM course on YouTube, and I'm really enjoying it, but I've hit a snag.

I'm on lesson 7, and I keep getting this error message whenever I try to run the program. As you can see there's some graphical corruption as well.

I've been through the entire code line by line about three times, and I can't see anything wrong. I even downloaded the sources from the Coppershade site and again went through line by line, but it's Identical, yet I keep getting this error.

I'm kind of stuck here as I can't go any further, so I'd appreciate some help.

I'm using the latest WinUAE buid on 64-Bit Windows 7 PC.

Brick Nash is offline  
Old 11 August 2020, 14:01   #2
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 9,004
Quote:
Originally Posted by Brick Nash View Post
Hi folks. I've been working my way through Photon Of Scoopex ASM course on YouTube, and I'm really enjoying it, but I've hit a snag.

I'm on lesson 7, and I keep getting this error message whenever I try to run the program. As you can see there's some graphical corruption as well.

I've been through the entire code line by line about three times, and I can't see anything wrong. I even downloaded the sources from the Coppershade site and again went through line by line, but it's Identical, yet I keep getting this error.

I'm kind of stuck here as I can't go any further, so I'd appreciate some help.

I'm using the latest WinUAE buid on 64-Bit Windows 7 PC.

chuck the example code up, but it looks to me like its jumping to a memory address it shouldn't.
Galahad/FLT is offline  
Old 11 August 2020, 14:15   #3
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Yes, upload the source somewhere as otherwise it's hard to say what causes your problem, can be uninitialised pointers/interrupts or something completely different.
StingRay is offline  
Old 11 August 2020, 14:15   #4
Brick Nash
Prototron
 
Brick Nash's Avatar
 
Join Date: Mar 2015
Location: Glasgow, Scotland
Posts: 411
Quote:
Originally Posted by Galahad/FLT View Post
chuck the example code up, but it looks to me like its jumping to a memory address it shouldn't.
Thanks for the reply. Here's what I have:

Code:
	ORG $20000
	LOAD $20000
	JUMPPTR init

init:
	move.l 4.w,a6		;execbase
	clr.l d0
	move.l #gfxname,a1
	jsr -408(a6)		;oldopenlibrary()
	move.l d0,a1
	move.l 38(a1),d4	;original copper ptr

	jsr -414(a6)		;closelibrary()

	move.w #$ac,d7		;start y position
	moveq #1,d6		;y add
	move.w $dff01c,d5           ; Read bits and store in d5
	move.w #$7fff,$dff09a	; disable interrupts (disable all bits in INTENA)

	move.l #copper,$dff080   : Call copperlist to cppr first register

**************************
mainloop:
wframe:
	btst #0,$dff005
	bne.b wframe
	cmp.b #$2a,$dff006
	bne.b wframe
wframe2:
	cmp.b #$2a,$dff006
	beq.b wframe2

;-----frame loop start-----;

	add d6,d7		;add "1" to y position

	cmp #$f0,d7		;bottom check
	blo.b ok1
	neg d6			;change direction
ok1:

	cmp.b #$40,d7
	bhi.b ok2
	neg d6			;change direction
ok2:

	move.b d7,#waitras1
	move d7,d0
        add #9,d0
	move.b d0,waitras2

;-----frame loop end-----;

	btst #6,$bfe001
	bne.b mainloop
**************************
exit:
	move.l d4,$dff080
	or #$c000,d5
	move d5,$dff09a
	rts

gfxname:
	dc.b "graphics.library",0

	EVEN
Copper:
	dc.w $1fc,0			;slow fetch mode, AGA compatibility
	dc.w $100,$0200
	dc.w $180,$349
	dc.w $2b07,$fffe
	dc.w $180,$56c
	dc.w $2c07,$fffe
	dc.w $180,$113

waitras1:
	dc.w $8007,$fffe
	dc.w $180,$fff
waitras2:
	dc.w $8107,$fffe
	dc.w $180,$113

	dc.w $ffdf,$fffe
	dc.w $2c07,$fffe
	dc.w $180,$56c
	dc.w $2d07,$fffe
	dc.w $180,$349

	dc.w $ffff,$fffe
Brick Nash is offline  
Old 11 August 2020, 14:26   #5
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 9,004
Quote:
Originally Posted by Brick Nash View Post
Thanks for the reply. Here's what I have:

Code:
	ORG $20000
	LOAD $20000
	JUMPPTR init

init:
	move.l 4.w,a6		;execbase
	clr.l d0
	move.l #gfxname,a1
	jsr -408(a6)		;oldopenlibrary()
	move.l d0,a1
	move.l 38(a1),d4	;original copper ptr

	jsr -414(a6)		;closelibrary()

	move.w #$ac,d7		;start y position
	moveq #1,d6		;y add
	move.w $dff01c,d5           ; Read bits and store in d5
	move.w #$7fff,$dff09a	; disable interrupts (disable all bits in INTENA)

	move.l #copper,$dff080   : Call copperlist to cppr first register

**************************
mainloop:
wframe:
	btst #0,$dff005
	bne.b wframe
	cmp.b #$2a,$dff006
	bne.b wframe
wframe2:
	cmp.b #$2a,$dff006
	beq.b wframe2

;-----frame loop start-----;

	add d6,d7		;add "1" to y position

	cmp #$f0,d7		;bottom check
	blo.b ok1
	neg d6			;change direction
ok1:

	cmp.b #$40,d7
	bhi.b ok2
	neg d6			;change direction
ok2:

	move.b d7,#waitras1
	move d7,d0
        add #9,d0
	move.b d0,waitras2

;-----frame loop end-----;

	btst #6,$bfe001
	bne.b mainloop
**************************
exit:
	move.l d4,$dff080
	or #$c000,d5
	move d5,$dff09a
	rts

gfxname:
	dc.b "graphics.library",0

	EVEN
Copper:
	dc.w $1fc,0			;slow fetch mode, AGA compatibility
	dc.w $100,$0200
	dc.w $180,$349
	dc.w $2b07,$fffe
	dc.w $180,$56c
	dc.w $2c07,$fffe
	dc.w $180,$113

waitras1:
	dc.w $8007,$fffe
	dc.w $180,$fff
waitras2:
	dc.w $8107,$fffe
	dc.w $180,$113

	dc.w $ffdf,$fffe
	dc.w $2c07,$fffe
	dc.w $180,$56c
	dc.w $2d07,$fffe
	dc.w $180,$349

	dc.w $ffff,$fffe
Well, firstly, as your code it kinda system friendly in parts, i'd be doing away with that ORG stuff at the top.

what that does is relocate your code to address $20000, and make it so that the code executes from that memory address.

Typically this is too low for system friendly stuff.

So I would remove the ORG statement, remove the LOAD statement, remove the JMPPTR statement.

In their place put SECTION Brick,CODE_c

This tells ASMONE to only load and relocate the code in chip mem, see how you get on with that.
Galahad/FLT is offline  
Old 11 August 2020, 14:51   #6
Brick Nash
Prototron
 
Brick Nash's Avatar
 
Join Date: Mar 2015
Location: Glasgow, Scotland
Posts: 411
Quote:
Originally Posted by Galahad/FLT View Post
Well, firstly, as your code it kinda system friendly in parts, i'd be doing away with that ORG stuff at the top.

what that does is relocate your code to address $20000, and make it so that the code executes from that memory address.

Typically this is too low for system friendly stuff.

So I would remove the ORG statement, remove the LOAD statement, remove the JMPPTR statement.

In their place put SECTION Brick,CODE_c

This tells ASMONE to only load and relocate the code in chip mem, see how you get on with that.
Thanks for the advice.

It's not really my code, I'm just following what's in the YouTube tutorials, and this particular lesson was about using ORG/LOAD/JUMPPTR etc. I followed the code to the letter, and this error stuff started to happen for me.

Using the SECTION does fix it, but I'm curious as to why it worked ok in the tutorial video and not on my system?

EDIT: I just tried with the ORG and LOAD again but with a higher address and it worked. There must be stuff at that address on the configuration that I am using.
Brick Nash is offline  
Old 11 August 2020, 14:56   #7
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Using the SECTION does fix it, but I'm curious as to why it worked ok in the tutorial video and not on my system?
Because, by coincidence, this memory was not used for system stuff on the machine used for the tutorial. It is VERY bad practice to use absolute code on Amiga when it isn't necessary and you should not start using such code as you already experienced what problems it can cause.
StingRay is offline  
Old 11 August 2020, 14:56   #8
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 9,004
Quote:
Originally Posted by Brick Nash View Post
Thanks for the advice.

It's not really my code, I'm just following what's in the YouTube tutorials, and this particular lesson was about using ORG/LOAD/JUMPPTR etc. I followed the code to the letter, and this error stuff started to happen for me.

Using the SECTION does fix it, but I'm curious as to why it worked ok in the tutorial video and not on my system?
it could be that the emulated system/Real Amiga in the video had different configuration, i.e. more memory of a certain type which places some of the important system variables in a different place so corruption of the system doesn't occur.

Using those ORG/LOAD/JMPPTR statements/methods is only really any good if the code you're writing has no intention of returning back to AmigaDOS afterwards.

So if you were writing game code for instance, or a demo, then that would be OK, but typically, and especially as you want the program to exit and return, using those statements is really not the done thing.

Always let the system sort it for you, and it'll correctly return used resources when you exit.

If you were desperate to use those functions, then changing the value from $20000 to $50000 would probably be enough to experiment with, but again, its simply not advisable for stuff you want to exit and return from cleanly.

Galahad/FLT is offline  
Old 11 August 2020, 15:28   #9
Brick Nash
Prototron
 
Brick Nash's Avatar
 
Join Date: Mar 2015
Location: Glasgow, Scotland
Posts: 411
Thanks for all the great advice everyone!

I changed it to £30000 and it works fine now. No graphical corruption either. TBH I'm only keeping it this way to follow the tutorial as the lesson is about memory management, so I think it's just to show what's available.

I'm just learning at the moment, but a demo is really the goal (well, I have an idea for an EP as a demo, but we'll see). Regardless, it's really good to get this kind of advice early on, so I'll definitely keep it in mind.

Anyway, I'm super enjoying learning 68k. It always seemed a bit beyond reach, but I'm really getting into it!
Brick Nash is offline  
Old 11 August 2020, 15:46   #10
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by Brick Nash View Post
I changed it to £30000 and it works fine now.
On your machine/config but it can and will happily crash on someone else's machine.

Quote:
as the lesson is about memory management, so I think it's just to show what's available.
I don't know the tutorial but this code is not any good lesson about memory management at all.


Quote:
Anyway, I'm super enjoying learning 68k. It always seemed a bit beyond reach, but I'm really getting into it!
68k asm is a lot of fun to code so have fun learning it. =)
StingRay 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
Gotek floppy emulator vs. HxC SD floppy emulator c0dehunter support.Hardware 50 05 July 2016 09:49
USB HxC Floppy emulator and SD HxC Floppy Emulator by Lotharek on ext FDD dirkies Amiga scene 1 03 April 2012 00:08
THE Emulator (BBC emulator) xc8 Retrogaming General Discussion 2 27 April 2010 03:49
Frederic's Emulator inside and Emulator thread Fred the Fop Retrogaming General Discussion 22 09 March 2006 07:31
Need Emulator Unregistered New to Emulation or Amiga scene 9 21 August 2002 19:24

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 00:09.

Top

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