Multi-Part Loader - Yes or No
Moderator: Moderators
- Mike
- Herr VC
- Posts: 5134
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
I doubt it's a problem in VICE. After all, the BASIC and KERNAL ROM blankly don't know they're running on VICE.
If there is anything else executed between POKE 824,PEEK(186), and PEEK(824), I'd put that under extra scrutiny.
Furthermore, the NEW is not executed before PEEK(186) in my example, it's just PRINTed beforehand.
Michael
If there is anything else executed between POKE 824,PEEK(186), and PEEK(824), I'd put that under extra scrutiny.
Furthermore, the NEW is not executed before PEEK(186) in my example, it's just PRINTed beforehand.
Michael
Mike,
On looking at my code a little closer I found that I had actually entered the following in which the "PEEK(186)" appears within the LOAD statement that is printed on the screen.
Your code in which the PEEK is executed before the NEW works fine. But as the above does not (I get the PRESS PLAY ON TAPE message) then it would seem to suggest that the NEW (or something) does indeed alter location 186?. I am testing on Vice1.22 if that makes any difference?
On looking at my code a little closer I found that I had actually entered the following in which the "PEEK(186)" appears within the LOAD statement that is printed on the screen.
Code: Select all
100 PRINT"{CLR}POKE44,26:POKE6656,0:NEW"
110 PRINT"{2 DOWN}LOAD"CHR$(34)"PART2"CHR$(34)",PEEK(186)"
120 POKE631,19:POKE632,13:POKE633,131:POKE198,3
I was having problems getting the second part to load and adding the NEW seemed to be the only way to get it to load correctly. Having said that I have just removed the NEW and it now looks like I don't actually need it.
However, the following program which now doesn't have the NEW also exhibits the same "problem" with location 186.
However, the following program which now doesn't have the NEW also exhibits the same "problem" with location 186.
Code: Select all
100 PRINT"{CLR}POKE44,26:POKE6656,0"
110 PRINT"{2 DOWN}LOAD"CHR$(34)"PART2"CHR$(34)",PEEK(186)"
120 POKE631,19:POKE632,13:POKE633,131:POKE198,3
why you don't change row 110 to:
Code: Select all
110 PRINT"{2 DOWN}LOAD"CHR$(34)"PART2"CHR$(34)","PEEK(186)
Mega-Cart: the cartridge you plug in once and for all.
Thanks - your code matches the code that Mike originally provided and does work. What happened was that I mis-typed it. But you are right the reason why the code below doesn't work is purely academic.nbla000 wrote:why you don't change row 110 to:Code: Select all
110 PRINT"{2 DOWN}LOAD"CHR$(34)"PART2"CHR$(34)","PEEK(186)
Code: Select all
110 PRINT"{2 DOWN}LOAD"CHR$(34)"PART2"CHR$(34)",PEEK(186)"
- Mike
- Herr VC
- Posts: 5134
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Quite simple: While the parameters of LOAD are scanned, BASIC initialises address 186 with the default value of 1:Vic40 wrote:Thanks - your code matches the code that Mike originally provided and does work. What happened was that I mis-typed it. But you are right the reason why the code below doesn't work is purely academic.Code: Select all
110 PRINT"{2 DOWN}LOAD"CHR$(34)"PART2"CHR$(34)",PEEK(186)"
The relevant part of the ROM reads:
Code: Select all
.C:e1d1 A9 00 LDA #$00
.C:e1d3 20 BD FF JSR $FFBD
.C:e1d6 A2 01 LDX #$01 ; 1 = tape
.C:e1d8 A0 00 LDY #$00
.C:e1da 20 BA FF JSR $FFBA ; set default value for LFN and device
.C:e1dd 20 03 E2 JSR $E203
.C:e1e0 20 54 E2 JSR $E254 ; (try to) read filename
Michael
-
- Vic 20 Devotee
- Posts: 270
- Joined: Mon Feb 04, 2008 6:06 am
That reads asVic40 wrote:What happened was that I mis-typed it. But you are right the reason why the code below doesn't work is purely academic.
Code: Select all
110 PRINT"{2 DOWN}LOAD"CHR$(34)"PART2"CHR$(34)",PEEK(186)"
Code: Select all
PRINT "{2 DOWN}LOAD"
PRINT CHR$(34)
PRINT "PART2"
PRINT CHR$(34)
PRINT ",PEEK(186)"
The difference between
Code: Select all
10 PRINT "HELLO"
20 PRINT "NEW"
Code: Select all
10 PRINT "HELLO"
20 NEW
- Mike
- Herr VC
- Posts: 5134
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Here you removed two commands to save for space, which clearly are not worth the trouble (also @Jeff:)Vic40 wrote:Code: Select all
100 PRINT"{CLR}POKE44,26:POKE6656,0"
I would keep NEW, as it correctly initialises the start of variables (45/46) before the LOAD commences.
Second, the Right Thing(TM) to do is also keep 'POKE 43,0'. If you leave it out, and the low-byte of BASIC start has any other value before your loader is started, chances are that the loader again won't work.
Michael
Mike, I will re-instate both the POKE43,0 and the NEW - I was just removing things to work out what was causing the PEEK(186) "problem". Thanks for all of your help on this one.Mike wrote:Here you removed two commands to save for space, which clearly are not worth the trouble (also @Jeff:)Vic40 wrote:Code: Select all
100 PRINT"{CLR}POKE44,26:POKE6656,0"
I would keep NEW, as it correctly initialises the start of variables (45/46) before the LOAD commences.
Second, the Right Thing(TM) to do is also keep 'POKE 43,0'. If you leave it out, and the low-byte of BASIC start has any other value before your loader is started, chances are that the loader again won't work.
Michael