Fixed some minor issues: (1) needed to turn off drive motor and

(2) needed to clear the keyboard (otherwise the keypress was still
valid when the next disk was booted). Also needed to reduce program
by a few more bytes. By changing the rotate routine and changing
the wording in the message, this code is now only 254 bytes. Also added
more comments.
This commit is contained in:
Robert Greene 2002-12-09 04:34:20 +00:00
parent 9bfb149930
commit 44da9f8133
1 changed files with 1 additions and 1 deletions

View File

@ -1 +1 @@
********************************************************** * * * APPLECOMMANDER boot code. * * Copyright (c) 2002, Rob Greene * * * * This code is published under the GPL license. See the * * AppleCommander site for license information. * * * ********************************************************** ORG $800 XEND = $2C ADDR = $26 LINENO = $25 KEYBOARD = $C000 TEXT = $FB2F HOME = $FC58 GR = $FB40 COLOR = $F864 HLIN = $F819 PRINT = $FDED REBOOT = $FAA6 CALCADDR = $F847 DELAY = $FCA8 XOFFSET = 14 YOFFSET = 13 HOME = $FC58 GR = $FB40 JSR TEXT JSR HOME JSR GR * * Draw the AppleCommander logo (well, sorta) * LDX #DATA2-DATA1 :LOGO LDA DATA1-1,X LSR LSR LSR LSR JSR COLOR LDA DATA2-1,X LSR LSR LSR LSR STA XEND LDA DATA1-1,X AND #$F TAY LDA DATA2-1,X AND #$F CLC ADC #YOFFSET JSR HLIN DEX BNE :LOGO * * Display AppleCommander text * :TEXT LDA MESSAGE,X BEQ :WAIT JSR PRINT INX BNE :TEXT * * Check for a keypress * :WAIT LDA KEYBOARD BPL :SETUP JMP REBOOT * * Rotate the screen (isn't that retro!) * :SETUP LDA #19 STA LINENO KEYBOARD = $C000 LDY #0 LDA (ADDR),Y PHA :SHIFT INY LDA (ADDR),Y DEY STA (ADDR),Y INY CPY #39 BNE :SHIFT PLA STA (ADDR),Y TEXT = $FB2F XEND = $2C LDA LINENO BPL :ROTATE * TEXT = $FB2F KEYBOARD = $C000 * :KEYLOOP LDA #$08 JSR DELAY DEX BNE :KEYLOOP BEQ :WAIT TEXT = $FB2F COLOR = $F864 DATA1 HEX C8C7C6C3C8C2 ; green HEX D1D1 ; yellow HEX 9090 ; orange HEX 1010 ; red HEX 3131 ; purple HEX 626368 ; blue * DATA2 consists of x2 (end) and y position. DATA2 HEX 90817253B3C4 HEX D5D6 HEX C7B8 HEX B9CA HEX DBDC HEX CD5EBE MESSAGE ASC "THIS DISK CREATED WITH APPLECOMMANDER"8D GR = $FB40 LINENO = $25 ASC " "8D ASC "INSERT ANOTHER DISK AND PRESS ANY KEY"00
********************************************************** * * * APPLECOMMANDER boot code. * * Copyright (c) 2002, Rob Greene * * * * This code is published under the GPL license. See the * * AppleCommander site for license information. * * * ********************************************************** ORG $800 * * Zero page variables. Used by Apple ][ ROM routines * as well as this code. * XEND = $2C ADDR = $26 * * Keyboard switches * KEYBOARD = $C000 KEYCLEAR = $C010 * COLOR = $F864 * MOTOROFF = $C088 * * General Apple ][ ROM locations * TEXT = $FB2F HOME = $FC58 GR = $FB40 COLOR = $F864 HLIN = $F819 PRINT = $FDED REBOOT = $FAA6 CALCADDR = $F847 DELAY = $FCA8 * * Image offset locations (from upper-left). * Note that, due to space, the XOFFSET isn't * currently used - but, because of the rotating * image, it doesn't really matter! * XOFFSET = 14 YOFFSET = 13 * * The boot rom (probably $C600) uses the first byte * to indicate the number of sectors to load. Normally * XEND = $2C * * General setup. * LDA MOTOROFF,X JSR TEXT JSR HOME JSR GR * * Draw the AppleCommander logo (well, sorta). * DATA1 and DATA2 contain 4 values - the color value, * the xstart (start of line), xend (end of line), as * well as the Y position. * LDX #DATA2-DATA1 :LOGO LDA DATA1-1,X LSR LSR LSR LSR JSR COLOR LDA DATA2-1,X LSR LSR LSR LSR STA XEND LDA DATA1-1,X AND #$F TAY LDA DATA2-1,X AND #$F CLC ADC #YOFFSET JSR HLIN DEX BNE :LOGO * * Display AppleCommander message. * :TEXT LDA MESSAGE,X BEQ :WAIT JSR PRINT INX BNE :TEXT * * Check for a keypress * :WAIT LDA KEYBOARD BPL :SETUP STA KEYCLEAR JMP REBOOT * * Rotate the screen (isn't that retro)! * :SETUP LDX #19 :ROTATE TXA LINENO = $25 LDY #0 LDA (ADDR),Y PHA :SHIFT INY LDA (ADDR),Y DEY STA (ADDR),Y INY CPY #39 BNE :SHIFT PLA STA (ADDR),Y ADDR = $26 TEXT = $FB2F BPL :ROTATE * PRINT = $FDED KEYBOARD = $C000 * :KEYLOOP LDA #$08 JSR DELAY DEX BNE :KEYLOOP BEQ :WAIT * PRINT = $FDED TEXT = $FB2F * value and the lower nybble with the second value * in an effort to conserve space. Thus, 17 HLINs PRINT = $FDED COLOR = $F864 * * DATA1 consists of color and x1 (start) position. * DATA1 HEX C8C7C6C3C8C2 ; green HEX D1D1 ; yellow HEX 9090 ; orange HEX 1010 ; red HEX 3131 ; purple HEX 626368 ; blue * * DATA2 consists of x2 (end) and y position. * DATA2 HEX 90817253B3C4 HEX D5D6 HEX C7B8 HEX B9CA HEX DBDC HEX CD5EBE * * Draw the AppleCommander logo (well, sorta) * MESSAGE ASC "THIS DISK CREATED WITH APPLECOMMANDER"8D REBOOT = $FAA6 LINENO = $25 ASC " "8D ASC "INSERT ANOTHER DISK AND PRESS ANY KEY"00