I could use your entry point to read the header, and then load the data block with a second call.....this also keeps the filename off of the screen.
Back to the text editor.
Last file name string.
Re: Last file name string.
This is a treble post (hat-trick?)
[mention]Ast A. Moore[/mention] You sexy Bas**rd!
Final code, and problem solved!!
[mention]Ast A. Moore[/mention] You sexy Bas**rd!
Final code, and problem solved!!
Code: Select all
org 60000
ld ix,dummy_header ;set IX to point to dummy header location
ld de,17 ;load header bytes
xor a ;zero A for header
scf ;set carry for LOAD not VERIFY
call 1366 ;call load ROM routine
ld ix,(dummy_header+13) ;set IX to data block destination from header
ld de,(dummy_header+11) ;set DE to data block length from header
ld a,255 ;set A to FF for data block
scf ;set CF for LOAD
call 1366 ;call ROM routine
ret
dummy_header:
- Ast A. Moore
- Rick Dangerous
- Posts: 2641
- Joined: Mon Nov 13, 2017 3:16 pm
Re: Last file name string.
By the way, the following will save you one byte.
Instead of
Code: Select all
ld a,255 ;set A to FF for data block
scf ;set CF for LOAD
Code: Select all
scf ;set CF for LOAD
sbc a,a ;set A to FF for data block
Every man should plant a tree, build a house, and write a ZX Spectrum game.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Re: Last file name string.
The following BASIC program provides a replacement for the LOAD "" CODE command. Simply substitute LOAD "" CODE with RANDOMIZE USR 60000. The data will be loaded without any on-screen text and the filename is stored in memory (60027-60036).
Example BASIC usage
Code: Select all
5 REM Reserve some RAM for the loader
10 CLEAR 59999
20 GO SUB 9500
30 REM Your code would go here
9400 STOP
9499 REM This POKE's the loader machine code.
9500 RESTORE 9600
9510 FOR a=0 TO 25
9520 READ b
9530 POKE 60000+a,b
9540 NEXT a
9550 RETURN
9600 DATA 221,33,122,234,17,17,0,175
9610 DATA 55,205,86,5,221,42,135,234
9620 DATA 237,91,133,234,55,159,205,86
9630 DATA 5,201
Code: Select all
400 RANDOMIZE USR 60000
520 PRINT AT 1,1;" Filename : ";
530 FOR a=60027 TO 60036
540 LET b=PEEK a
550 PRINT CHR$(b);
560 NEXT a