diff --git a/src/4cade.branding.a b/src/4cade.branding.a index 6e06320..f8a666d 100644 --- a/src/4cade.branding.a +++ b/src/4cade.branding.a @@ -3,41 +3,22 @@ ; PrintBranding - ldy #14 -- lda II,y - ora #$80 - +FORCE_UPPERCASE_IF_REQUIRED - sta $070C,y +; in: text screen is showing +; out: Y = 0 (important! some callers rely on this!) + ldy #15 +- lda II-1, y + sta $070C-1, y + lda INSTANT-1, y + sta $04B4-1, y + lda REPLAY-1, y + sta $0534-1, y dey - bpl - - ldy #12 -- lda INSTANT,y - ora #$80 - sta $04B5,y - dey - bpl - - ldy #10 -- lda REPLAY,y - ora #$80 - sta $0536,y - dey - bpl - + bne - rts II - !text "Total Replay II" + !scrxor $80,"TOTAL REPLAY II" INSTANT - !text "I N S T A N T" + !scrxor $80," I N S T A N T " REPLAY - !text "R E P L A Y" -!ifndef RELEASE { -LoadingVersion - !byte 9 - !text " build 0" -LoadingBuild - !word BUILDNUMBER -} else { -LoadingVersion - !byte 12 - !text "v1.0-alpha.3" -} + !scrxor $80," R E P L A Y " diff --git a/src/4cade.init.a b/src/4cade.init.a index 0f6543f..7fa150d 100644 --- a/src/4cade.init.a +++ b/src/4cade.init.a @@ -7,28 +7,8 @@ ; .SYSTEM file is loaded ; - +READ_ROM_NO_WRITE - sta PRIMARYCHARSET - sta CLR80VID - sta STOREOFF - sta READMAINMEM - sta WRITEMAINMEM - jsr ROM_TEXT - jsr ROM_HOME - jsr ROM_NORMAL - jsr ROM_IN0 - jsr ROM_PR0 - - ; accommodate uppercase-only machines (64K ][ and ][+ are supported) - lda ROM_MACHINEID - cmp #$A0 - beq + ; Spectrum ED - cmp #$06 - beq + - lda #$DF - +HIDE_NEXT_2_BYTES -+ lda #$FF - sta zpCharMask + !src "src/4cade.init.machine.a" + !src "src/4cade.init.screen.a" ; print text title in same place as graphical title will appear jsr PrintBranding @@ -36,6 +16,9 @@ ; proboothd duplicates the above code and jumps here, ; so if you make any changes before this comment, you ; MUST adjust the final JMP in src/proboothd/proboothd.a + !if (* != ProBootEntry) { + !serious "ProBootEntry is wrong, should be ", * + } jsr Has64K ; check for 64K (required) bcc + @@ -99,6 +82,17 @@ sta MONOCOLOR ; bit 7=1 disables color + + ; accommodate uppercase-only machines (64K ][ and ][+ are supported) + lda ROM_MACHINEID + cmp #$A0 + beq + ; Spectrum ED + cmp #$06 + beq + + lda #$DF + +HIDE_NEXT_2_BYTES ++ lda #$FF + sta zpCharMask + ; increase text window width so we can print to the edge of the screen without scrolling inc $21 ; print version or build number in lower right corner @@ -288,6 +282,7 @@ FoundMockingboardCallback jmp ROM_COUT !src "src/4cade.branding.a" + !src "src/4cade.version.a" Loading64K !byte 3 diff --git a/src/4cade.init.machine.a b/src/4cade.init.machine.a new file mode 100644 index 0000000..d45ab0f --- /dev/null +++ b/src/4cade.init.machine.a @@ -0,0 +1,15 @@ +;license:MIT +;(c) 2023 by 4am +; +; initialize machine from a cold boot +; assumes absolutely nothing about machine state +; +; note: this file is included by both the launcher and proboothd + + cld + +READ_ROM_NO_WRITE + sta PRIMARYCHARSET + sta CLR80VID + sta STOREOFF + sta READMAINMEM + sta WRITEMAINMEM diff --git a/src/4cade.init.screen.a b/src/4cade.init.screen.a new file mode 100644 index 0000000..9309cf6 --- /dev/null +++ b/src/4cade.init.screen.a @@ -0,0 +1,14 @@ +;license:MIT +;(c) 2023 by 4am +; +; initialize and clear screen +; assumes zero page is completely trashed other than |zpCharMask| +; assumes ROM is banked in on entry +; +; note: this file is included by both the launcher and proboothd + + jsr ROM_TEXT + jsr ROM_HOME + jsr ROM_NORMAL + jsr ROM_IN0 + jsr ROM_PR0 diff --git a/src/4cade.version.a b/src/4cade.version.a new file mode 100644 index 0000000..d1bd26f --- /dev/null +++ b/src/4cade.version.a @@ -0,0 +1,15 @@ +;license:MIT +;(c) 2023 by 4am +; + +!ifndef RELEASE { +LoadingVersion + !byte 9 + !text " build 0" +LoadingBuild + !word BUILDNUMBER +} else { +LoadingVersion + !byte 12 + !text "v1.0-alpha.3" +} diff --git a/src/constants.a b/src/constants.a index 02346d0..46a6e81 100644 --- a/src/constants.a +++ b/src/constants.a @@ -161,6 +161,7 @@ gKey = $1F01 UILine1 = $1FB0 UILine2 = $1FD8 UI_ToPlay = $1FF7 +ProBootEntry = $2025 gValLen = $1F80 gVal = $1F81 diff --git a/src/proboothd/proboothd.a b/src/proboothd/proboothd.a index 6dd2c48..e3202f7 100644 --- a/src/proboothd/proboothd.a +++ b/src/proboothd/proboothd.a @@ -5,6 +5,8 @@ !to "build/proboothd",plain *=$800 + !src "src/macros.a" + ;zpage usage, arbitrary selection except for the "ProDOS constant" ones command = $42 ;ProDOS constant unit = $43 ;ProDOS constant @@ -25,46 +27,20 @@ txa pha - ; put machine in a known state, clear screen + !src "src/4cade.init.machine.a" - cld - bit $c082 - sta $c00e - sta $c00c - sta $c000 - sta $c002 - sta $c004 - jsr $fb2f - jsr $fc58 - jsr $fe84 - jsr $fe89 - jsr $fe93 + lda KBD + cmp #$D3 ; 'S' + beq @s + cmp #$F3 ; 's' + bne + +@s + jsr seasons ++ + !src "src/4cade.init.screen.a" - ; print title - lda $fbb3 - cmp #$A0 - beq + ; Spectrum ED - cmp #$06 - beq + - lda #$DF - !byte $2C -+ lda #$FF - sta $F1 - ldy #15 -- lda II-1,y - cmp #$E1 - bcc + - and $F1 -+ sta $070C-1,y - dey - bne - - ldy #13 -- lda INSTANT-1,y - sta $04B5-1,y - lda REPLAY-1,y - sta $0535-1,y - dey - bne - + ; print text title in same place as graphical title will appear + jsr PrintBranding pla sta unit @@ -164,7 +140,7 @@ blockind ldy $ff txa bne readfile -readdone jmp $2036 +readdone jmp ProBootEntry seekread stx bloklo sty blokhi @@ -193,17 +169,201 @@ retcall pla - rts fakeMLI_e +; Interactive Seasons demo +; based on Apple II Seasons -=DESiRE=- 128B Demo for Outline 2020 +; based on the code in Hellmood's 64B x86 demo 'Autumn' +; by deater (Vince Weaver) +; adapted by 4am for use within this bootloader +; /!\ While demo is running, press 1-4 to change color palettes +; or Esc to quit demo and continue the boot + +HGR2 = $F3D8 ; Set full-screen hi-res mode using page 2 ($4000) +HPLOT0 = $F457 ; Plot point, (Y,X) = Horizontal, (A=Vertical) +HCOLOR = $F6EC ; Set color in X, must be 0..7 + +seasons: + bit $c010 + jsr HGR2 + ldx #(copy_seasons_e-copy_seasons) +- lda copy_seasons-1, x + sta $30, x + dex + bne - + jmp seasons_forever + +copy_seasons: +; HGR ROM routines use +; $1C mask for color +; $26/$27 address for plot +; $30 color value * 17 +; $E0/$E1 X coord of last hplot +; so code starts at $31 and must end before $E0 +!pseudopc $31 { +EBP1 !byte 0 +EBP2 !byte 0 +EBP3 !byte 0 +EBP4 !byte 0 + +color_lookup_lookup: + !byte $9f7) { + !serious "Bootloader is too large" +} *=$9f8 !byte $D3,$C1,$CE,$A0,$C9,$CE,$C3,$AE