Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > ML Load routine makes program crashes
2014-06-05 21:24
Lux

Registered: Apr 2011
Posts: 15
ML Load routine makes program crashes

Hi guys,

I'm doing a simple noter. In program, I use simple load routine from codebase64 (Richard Bayliss routine, http://codebase64.org/doku.php?id=base:disk_loader_with_flashin..). I'm loading font files on address $0800. Noter starting at $4000 in memory so there is no overlaping with ML code of noter. Every font file I'am using for loading are saved from $0800 to $1000. Noter working ok (editing, using menus etc.), but after loading font file, main program start to behaves strangely and in some cases crashes (yes!). There is no way that font file overlap ML code, I check it. So my question is .. is there something to do after using load routine (to do kernel cals, to reset something or ..?).
Perhaps some of you have had a similar problem so please help.

Lux :)
 
... 5 posts hidden. Click here to view all posts....
 
2014-06-05 21:54
Lux

Registered: Apr 2011
Posts: 15
Guys, this is link:
Simple Writer V0.8
2014-06-05 21:58
Lux

Registered: Apr 2011
Posts: 15
Oswald, thanks for reply. Yes, I also used that simple load routine, same problem happens, very strange. I tested yesterday with almsot 20 font files. Some file loaded ok, but some not. I saved files from same memory location.
2014-06-05 22:02
Oswald

Registered: Apr 2002
Posts: 5034
try to enter monitor while your program is running and simply fill the font memory with various values and see if your code still survives. if doesnt then your code is accidentally relying on a value in font space. if it still works, then possibly you have a zeropage conflict with kernal.

edit: maybe some vice monitor gurus can tell you how to create a breakpoint to see if your code reads into font memory.
2014-06-05 22:12
Lux

Registered: Apr 2011
Posts: 15
Oswald, thanks for the advice, it seems to me that I could use to find the cause.
2014-06-05 22:13
chatGPZ

Registered: Dec 2001
Posts: 11164
> break load 800 fff (or even "load exec")
2014-06-05 22:19
Lux

Registered: Apr 2011
Posts: 15
Yes, monitor echoed ...

WATCH: 1 C:$0800-$0fff (Stop on load)

Thanx Groepaz!
2014-06-06 10:13
tlr

Registered: Sep 2003
Posts: 1736
.C:4af3  78          SEI
.C:4af4  A9 37       LDA #$37
.C:4af6  85 01       STA $01
.C:4af8  20 81 FF    JSR $FF81
.C:4afb  20 84 FF    JSR $FF84
.C:4afe  20 8A FF    JSR $FF8A
.C:4b01  A9 00       LDA #$00
.C:4b03  8D 20 D0    STA $D020
.C:4b06  8D 21 D0    STA $D021
.C:4b09  A9 BF       LDA #$BF
.C:4b0b  A2 4B       LDX #$4B
.C:4b0d  8D 28 03    STA $0328
.C:4b10  8E 29 03    STX $0329
.C:4b13  58          CLI
.C:4b14  A9 08       LDA #$08
.C:4b16  A6 BA       LDX $BA
.C:4b18  A0 00       LDY #$00
.C:4b1a  20 BA FF    JSR $FFBA
.C:4b1d  AD CE 50    LDA $50CE
.C:4b20  A2 AF       LDX #$AF
.C:4b22  A0 4B       LDY #$4B
.C:4b24  20 BD FF    JSR $FFBD
.C:4b27  A2 00       LDX #$00
.C:4b29  A0 08       LDY #$08
.C:4b2b  A9 00       LDA #$00
.C:4b2d  20 D5 FF    JSR $FFD5
.C:4b30  B0 2A       BCS $4B5C
.C:4b32  A2 08       LDX #$08
.C:4b34  20 C3 FF    JSR $FFC3
.C:4b37  20 CC FF    JSR $FFCC
.C:4b3a  20 81 FF    JSR $FF81
.C:4b3d  AD D8 11    LDA $11D8
.C:4b40  8D 86 02    STA $0286
.C:4b43  20 44 E5    JSR $E544
.C:4b46  AD D5 11    LDA $11D5
.C:4b49  8D 20 D0    STA $D020
.C:4b4c  8D 21 D0    STA $D021

The problem is that you leave the break vector in a crappy state after loading. If you run the program, load a font, then pop into the monitor you'll see that $0328 points to $4bed. Change that to the usual $f6ed and the program works normally.

Also in the routine there are some redundant stuff. The $ffc3 (CLOSE) and $ffcc (CLRCHN) calls are completely redundant and the $ff81 (CINT) is sort of redundant.

If you change the CINT call to $ff8a (RESTOR) it will probably work, although it will corrupt a small amount of memory at $fd30.

Q: why can't I enter an asterisk in the file load dialog?
2014-06-06 17:47
Lux

Registered: Apr 2011
Posts: 15
tlr, thank you very much, I'll make changes and test the program as you suggested.
Routine input file name allows you to enter only these characters .. ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 -+.()#!, coz' when loading (or saving) the file (from the VICE emulator) then only these characters are properly interpreted on pc.
I will implement character (*) when this load routine begins work. Once again thank you for your generous help.
I'll remove very soon link on csdb coz' this program is still in the making (it is not release).

This is simple-writer download link from dropbox ( https://dl.dropboxusercontent.com/s/7u6m4ms9mke1mi4/simple-writ.. //
I hope that I can set the download link on this forum, if it is banned I will remove it.).
2014-06-06 19:56
Hein

Registered: Apr 2004
Posts: 933
All your load crashes are belong to us!
2014-06-07 19:06
Lux

Registered: Apr 2011
Posts: 15
Guys, I've found a bug in the program. Load routine was fine. But part of the code is doing a mistake. Based on your suggestions I found a mistake. When I finish writer (very soon) I will credited you. Thanks again for your support.

Regards, Lux :))
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Chriszx/UNITRAX
Guests online: 77
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Aliens in Wonderland  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Dawnfall V1.1  (9.5)
8 Birth of a Flower  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Offence  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.043 sec.