mirror of https://github.com/datajerk/c2d.git
new loader that does not load splash screen directly to 0x400, but to 0x800 and then moves it to 0x400 to avoid overwriting scratchpad ram
This commit is contained in:
parent
4c9315f2ef
commit
a191c5cd81
26
asm/loader.s
26
asm/loader.s
|
@ -18,7 +18,7 @@ rwts = $B7B5 ; rwts jsr
|
|||
|
||||
; vars
|
||||
|
||||
stage1 = $800
|
||||
stage1 = $C00
|
||||
;stage2 = $B600 ; overwrite track 0/sector 0, not needed any more?
|
||||
stage2 = $300 ; $300 looks open
|
||||
;;;run time
|
||||
|
@ -34,10 +34,32 @@ start:
|
|||
|
||||
grcheck:
|
||||
lda *+(gr-loader)+(moved-grcheck)
|
||||
beq init
|
||||
beq movetext
|
||||
lda #0 ; GR mode
|
||||
sta $C050
|
||||
sta $C053
|
||||
movetext:
|
||||
ldx #0
|
||||
movetx:
|
||||
lda $800,x
|
||||
sta $400,x
|
||||
lda $880,x
|
||||
sta $480,x
|
||||
lda $900,x
|
||||
sta $500,x
|
||||
lda $980,x
|
||||
sta $580,x
|
||||
lda $A00,x
|
||||
sta $600,x
|
||||
lda $A80,x
|
||||
sta $680,x
|
||||
lda $B00,x
|
||||
sta $700,x
|
||||
lda $B80,x
|
||||
sta $780,x
|
||||
inx
|
||||
cpx #120
|
||||
bne movetx ; move 120 bytes
|
||||
init:
|
||||
lda #1 ; read(1)/write(2) command
|
||||
ldy #$0C ; offset in RWTS
|
||||
|
|
BIN
bin/c2d.exe
BIN
bin/c2d.exe
Binary file not shown.
Binary file not shown.
Binary file not shown.
13
c2d.c
13
c2d.c
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
|
||||
c2d, Code to Disk, Version 0.56
|
||||
c2d, Code to Disk, Version 0.57
|
||||
|
||||
(c) 2012,2017 All Rights Reserved, Egan Ford (egan@sense.net)
|
||||
|
||||
|
@ -43,7 +43,7 @@ Bugs:
|
|||
#include "c2d.h"
|
||||
#include "holes.h"
|
||||
|
||||
#define VERSION "Version 0.56"
|
||||
#define VERSION "Version 0.57"
|
||||
#define INFILE argv[argc-2]
|
||||
#define OUTFILE argv[argc-1]
|
||||
#define BINARY 0
|
||||
|
@ -302,7 +302,11 @@ int main(int argc, char **argv)
|
|||
blank.track[1].sector[4].byte[loadersize + 8 + i] = i * num_sectors / bar_length;
|
||||
}
|
||||
|
||||
loaderstart = 0x400;
|
||||
// this version loads text page right into place, however can cause
|
||||
// issues with scratchpad RAM
|
||||
// loaderstart = 0x400;
|
||||
// load here and move to 0x400 just the text data
|
||||
loaderstart = 0x800;
|
||||
|
||||
// temp hack to effect the sound of the drive, i.e. to make consistent
|
||||
// longer term put binary payload at end of loader
|
||||
|
@ -320,7 +324,8 @@ int main(int argc, char **argv)
|
|||
fprintf(stderr, "Binary Number of sectors: %d\n", (int) ceil((filesize + (loadaddress & 0xFF)) / 256.0));
|
||||
fprintf(stderr, "Binary Memory page range: $%02X - $%02X\n", loadaddress >> 8, (loadaddress + filesize - 1) >> 8);
|
||||
|
||||
loaderstart = 0x800;
|
||||
//loaderstart = 0x800;
|
||||
loaderstart = 0xC00;
|
||||
|
||||
blank.track[0].sector[1].byte[0x3B] = 0x4C;
|
||||
blank.track[0].sector[1].byte[0x3C] = loaderstart & 0xFF;
|
||||
|
|
67
c2d.h
67
c2d.h
|
@ -9031,7 +9031,7 @@ rwts = $B7B5 ; rwts jsr
|
|||
|
||||
; vars
|
||||
|
||||
stage1 = $800
|
||||
stage1 = $C00
|
||||
;stage2 = $B600 ; overwrite track 0/sector 0, not needed any more?
|
||||
stage2 = $300 ; $300 looks open
|
||||
;;;run time
|
||||
|
@ -9047,10 +9047,32 @@ start:
|
|||
|
||||
grcheck:
|
||||
lda *+(gr-loader)+(moved-grcheck)
|
||||
beq init
|
||||
beq movetext
|
||||
lda #0 ; GR mode
|
||||
sta $C050
|
||||
sta $C053
|
||||
movetext:
|
||||
ldx #0
|
||||
movetx:
|
||||
lda $800,x
|
||||
sta $400,x
|
||||
lda $880,x
|
||||
sta $480,x
|
||||
lda $900,x
|
||||
sta $500,x
|
||||
lda $980,x
|
||||
sta $580,x
|
||||
lda $A00,x
|
||||
sta $600,x
|
||||
lda $A80,x
|
||||
sta $680,x
|
||||
lda $B00,x
|
||||
sta $700,x
|
||||
lda $B80,x
|
||||
sta $780,x
|
||||
inx
|
||||
cpx #120
|
||||
bne movetx ; move 120 bytes
|
||||
init:
|
||||
lda #1 ; read(1)/write(2) command
|
||||
ldy #$0C ; offset in RWTS
|
||||
|
@ -9150,23 +9172,30 @@ gr:
|
|||
end:
|
||||
*/
|
||||
unsigned char loadercode[] = {
|
||||
0xAD,0x87,0x08,0xF0,0x08,0xA9,0x00,0x8D,
|
||||
0x50,0xC0,0x8D,0x53,0xC0,0xA9,0x01,0xA0,
|
||||
0x0C,0x99,0xE8,0xB7,0xA9,0x00,0xA0,0x08,
|
||||
0x99,0xE8,0xB7,0xA9,0x02,0x85,0x04,0xA2,
|
||||
0x00,0xBD,0x2D,0x08,0x9D,0x00,0x03,0xE8,
|
||||
0x10,0xF7,0x4C,0x00,0x03,0xAD,0x57,0x03,
|
||||
0x85,0x02,0xAE,0x55,0x03,0xCA,0xCA,0x86,
|
||||
0x00,0xA5,0x04,0xA0,0x04,0x99,0xE8,0xB7,
|
||||
0xA5,0x00,0xD0,0x05,0xAD,0x56,0x03,0x10,
|
||||
0x02,0xA9,0x0F,0x85,0x03,0xA5,0x03,0xA0,
|
||||
0x05,0x99,0xE8,0xB7,0xA5,0x02,0x18,0x65,
|
||||
0x03,0xA0,0x09,0x99,0xE8,0xB7,0xA0,0xE8,
|
||||
0xA9,0xB7,0x20,0xB5,0xB7,0xB0,0x18,0xA9,
|
||||
0x00,0x85,0x48,0xC6,0x03,0x10,0xDE,0xA5,
|
||||
0x02,0x18,0x69,0x10,0x85,0x02,0xE6,0x04,
|
||||
0xC6,0x00,0x10,0xBD,0x6C,0x58,0x03,0x4C,
|
||||
0x69,0xFF
|
||||
0xAD,0xBE,0x0C,0xF0,0x08,0xA9,0x00,0x8D,
|
||||
0x50,0xC0,0x8D,0x53,0xC0,0xA2,0x00,0xBD,
|
||||
0x00,0x08,0x9D,0x00,0x04,0xBD,0x80,0x08,
|
||||
0x9D,0x80,0x04,0xBD,0x00,0x09,0x9D,0x00,
|
||||
0x05,0xBD,0x80,0x09,0x9D,0x80,0x05,0xBD,
|
||||
0x00,0x0A,0x9D,0x00,0x06,0xBD,0x80,0x0A,
|
||||
0x9D,0x80,0x06,0xBD,0x00,0x0B,0x9D,0x00,
|
||||
0x07,0xBD,0x80,0x0B,0x9D,0x80,0x07,0xE8,
|
||||
0xE0,0x78,0xD0,0xCB,0xA9,0x01,0xA0,0x0C,
|
||||
0x99,0xE8,0xB7,0xA9,0x00,0xA0,0x08,0x99,
|
||||
0xE8,0xB7,0xA9,0x02,0x85,0x04,0xA2,0x00,
|
||||
0xBD,0x64,0x0C,0x9D,0x00,0x03,0xE8,0x10,
|
||||
0xF7,0x4C,0x00,0x03,0xAD,0x57,0x03,0x85,
|
||||
0x02,0xAE,0x55,0x03,0xCA,0xCA,0x86,0x00,
|
||||
0xA5,0x04,0xA0,0x04,0x99,0xE8,0xB7,0xA5,
|
||||
0x00,0xD0,0x05,0xAD,0x56,0x03,0x10,0x02,
|
||||
0xA9,0x0F,0x85,0x03,0xA5,0x03,0xA0,0x05,
|
||||
0x99,0xE8,0xB7,0xA5,0x02,0x18,0x65,0x03,
|
||||
0xA0,0x09,0x99,0xE8,0xB7,0xA0,0xE8,0xA9,
|
||||
0xB7,0x20,0xB5,0xB7,0xB0,0x18,0xA9,0x00,
|
||||
0x85,0x48,0xC6,0x03,0x10,0xDE,0xA5,0x02,
|
||||
0x18,0x69,0x10,0x85,0x02,0xE6,0x04,0xC6,
|
||||
0x00,0x10,0xBD,0x6C,0x58,0x03,0x4C,0x69,
|
||||
0xFF
|
||||
};
|
||||
/*
|
||||
;bar.s
|
||||
|
|
Loading…
Reference in New Issue