mirror of
https://github.com/option8/greenscale.git
synced 2024-12-27 19:30:02 +00:00
commit
8adc738e77
146
BADAPPLE.s
146
BADAPPLE.s
@ -35,6 +35,36 @@ TABLEOFFSET EQU $23
|
|||||||
AUTOPLAYTIMER EQU $EB ; how many loops has the animation played?
|
AUTOPLAYTIMER EQU $EB ; how many loops has the animation played?
|
||||||
AUTOPLAY EQU $EC ; Autoplay mode or not
|
AUTOPLAY EQU $EC ; Autoplay mode or not
|
||||||
|
|
||||||
|
;from ProRWTS2
|
||||||
|
;subdirectory support
|
||||||
|
bloklo EQU $46
|
||||||
|
blokhi EQU $47
|
||||||
|
|
||||||
|
;to detect file not found
|
||||||
|
status EQU $50
|
||||||
|
|
||||||
|
;file read support
|
||||||
|
sizelo EQU $52
|
||||||
|
sizehi EQU $53
|
||||||
|
ldrlo EQU $55
|
||||||
|
ldrhi EQU $56
|
||||||
|
|
||||||
|
;file open support
|
||||||
|
namlo EQU $57
|
||||||
|
namhi EQU $58
|
||||||
|
|
||||||
|
;rewind support
|
||||||
|
blkidx EQU $5e
|
||||||
|
bleftlo EQU $60
|
||||||
|
blefthi EQU $61
|
||||||
|
|
||||||
|
;API
|
||||||
|
hddopendir EQU $BD03
|
||||||
|
hddrdwrpart EQU $BD00
|
||||||
|
hddblockhi EQU $BD06
|
||||||
|
hddblocklo EQU $BD04
|
||||||
|
|
||||||
|
|
||||||
**************************************************
|
**************************************************
|
||||||
* Apple Standard Memory Locations
|
* Apple Standard Memory Locations
|
||||||
**************************************************
|
**************************************************
|
||||||
@ -93,6 +123,16 @@ CLOSECMD EQU $CC ; CLOSE command index
|
|||||||
|
|
||||||
ORG $0800 ; PROGRAM DATA STARTS AT $0C00 NOW
|
ORG $0800 ; PROGRAM DATA STARTS AT $0C00 NOW
|
||||||
|
|
||||||
|
LDA #>SUBDIRNAME
|
||||||
|
STA namhi
|
||||||
|
LDA #<SUBDIRNAME
|
||||||
|
STA namlo
|
||||||
|
JSR hddopendir ;open subdirectory
|
||||||
|
LDA blokhi
|
||||||
|
STA hddblockhi
|
||||||
|
LDA bloklo
|
||||||
|
STA hddblocklo ;make it permanent
|
||||||
|
|
||||||
JSR BLOAD ; BLOAD DATA
|
JSR BLOAD ; BLOAD DATA
|
||||||
|
|
||||||
JSR HOWMANYFRAMES ; how big is the animation data?
|
JSR HOWMANYFRAMES ; how big is the animation data?
|
||||||
@ -144,14 +184,26 @@ NOTGS LDA #$30
|
|||||||
**************************************************
|
**************************************************
|
||||||
|
|
||||||
STARTANIMATION
|
STARTANIMATION
|
||||||
|
LDA FRAMES
|
||||||
|
STA FRAMENUM ; frame #0
|
||||||
|
|
||||||
|
EACHFRAME
|
||||||
LDA DATAHI ; image data starts at end of code.
|
LDA DATAHI ; image data starts at end of code.
|
||||||
STA IMGHI
|
STA IMGHI
|
||||||
LDA DATALO
|
LDA DATALO
|
||||||
STA IMGLO
|
STA IMGLO
|
||||||
LDA FRAMES
|
|
||||||
STA FRAMENUM ; frame #0
|
|
||||||
|
|
||||||
EACHFRAME JSR INTERFRAMEDELAY
|
LDA #3
|
||||||
|
STA sizehi
|
||||||
|
LDA #$C0
|
||||||
|
STA sizelo
|
||||||
|
LDA #>BEGINDATA
|
||||||
|
STA ldrhi
|
||||||
|
LDA #<BEGINDATA
|
||||||
|
STA ldrlo
|
||||||
|
JSR hddrdwrpart ;read a frame of data
|
||||||
|
|
||||||
|
JSR INTERFRAMEDELAY
|
||||||
LDX #$00
|
LDX #$00
|
||||||
STX PLOTROW
|
STX PLOTROW
|
||||||
LDY #$27 ; Y IS PLOTCOLUMN
|
LDY #$27 ; Y IS PLOTCOLUMN
|
||||||
@ -328,76 +380,48 @@ FOUNDM8 ADC #$80 ; add over 128 = set OVerflow
|
|||||||
**************************************************
|
**************************************************
|
||||||
|
|
||||||
|
|
||||||
BLOAD JSR OPEN ;open "DATA"
|
BLOAD
|
||||||
JSR READ
|
LDA #>FILENAME
|
||||||
JSR CLOSE
|
STA namhi
|
||||||
RTS ;Otherwise done
|
LDA #<FILENAME
|
||||||
|
STA namlo
|
||||||
OPEN JSR MLI ;Perform call
|
LDA #0
|
||||||
DB OPENCMD ;CREATE command number
|
STA sizehi
|
||||||
DW OPENLIST ;Pointer to parameter list
|
STA sizelo ;no pre-read needed
|
||||||
BNE ERROR ;If error, display it
|
JSR hddopendir ;open "data"
|
||||||
LDA REFERENCE
|
LDA status
|
||||||
STA READLIST+1
|
STA blkidx
|
||||||
STA CLOSELIST+1
|
BEQ GOODOPEN
|
||||||
RTS
|
|
||||||
|
|
||||||
READ JSR MLI
|
|
||||||
DB READCMD
|
|
||||||
DW READLIST
|
|
||||||
BNE ERROR
|
|
||||||
RTS
|
|
||||||
|
|
||||||
CLOSE JSR MLI
|
|
||||||
DB CLOSECMD
|
|
||||||
DW CLOSELIST
|
|
||||||
BNE ERROR
|
|
||||||
RTS
|
|
||||||
|
|
||||||
ERROR CMP #$46 ; file not found during OPEN? reset to "DATA00"
|
|
||||||
BNE PRINTERROR
|
|
||||||
LDA #$30
|
LDA #$30
|
||||||
STA ENDNAME-1
|
STA ENDNAME-1
|
||||||
STA ENDNAME-2
|
STA ENDNAME-2
|
||||||
STA ENDNAME-3
|
STA ENDNAME-3
|
||||||
JMP OPEN
|
BNE BLOAD
|
||||||
PRINTERROR JSR PRBYTE ;Print error code
|
GOODOPEN RTS
|
||||||
JSR BELL ;Ring the bell
|
|
||||||
JSR CROUT ;Print a carriage return
|
|
||||||
RTS
|
|
||||||
|
|
||||||
OPENLIST DB $03 ; parameter list for OPEN command
|
SUBDIRNAME DB ENDSUB-SUBNAME ;Length of name
|
||||||
DW FILENAME
|
SUBNAME ASC 'DATA' ;followed by the name
|
||||||
DA MLI-$400 ; buffer snuggled up tight with PRODOS
|
ENDSUB EQU *
|
||||||
REFERENCE DB $00 ; reference to opened file
|
|
||||||
|
|
||||||
READLIST DB $04
|
|
||||||
DB $00 ; REFERENCE written here after OPEN
|
|
||||||
DB <BEGINDATA,>BEGINDATA ; write to end of code
|
|
||||||
DB $FF,$FF ; read as much as $FFFF - should error out with EOF before that.
|
|
||||||
TRANSFERRED DB $00,$00
|
|
||||||
|
|
||||||
CLOSELIST DB $01
|
|
||||||
DB $00
|
|
||||||
|
|
||||||
FILENAME DB ENDNAME-NAME ;Length of name
|
FILENAME DB ENDNAME-NAME ;Length of name
|
||||||
NAME ASC '/GREENSCALE/DATA/DATA000' ;followed by the name
|
NAME ASC 'DATA000' ;followed by the name
|
||||||
ENDNAME EQU *
|
ENDNAME EQU *
|
||||||
|
|
||||||
|
|
||||||
**************************************************
|
**************************************************
|
||||||
* How many frames have transferred?
|
* How many frames in the file?
|
||||||
* up to 32 ($20) based on TRANSFERRED+1
|
|
||||||
**************************************************
|
**************************************************
|
||||||
HOWMANYFRAMES LDX #$00 ; X=0
|
HOWMANYFRAMES LDX #0
|
||||||
LDA TRANSFERRED+1 ; LDA TRANSFERRED amt hi byte
|
COUNTFRAMES INX
|
||||||
HOWMANYLOOP CMP FRAMESTABLE,X ; compare A to FRAMESTABLE,X
|
SEC
|
||||||
BEQ HOWMANYSET ; if equal, X frames loaded.
|
LDA bleftlo
|
||||||
INX
|
SBC #$C0
|
||||||
CPX $30 ; out of memory around 41 frames.
|
STA bleftlo
|
||||||
BEQ HOWMANYSET ; max 32 frames
|
LDA blefthi
|
||||||
JMP HOWMANYLOOP ; otherwise, INX, Loop
|
SBC #3
|
||||||
HOWMANYSET INX
|
STA blefthi
|
||||||
|
ORA bleftlo
|
||||||
|
BNE COUNTFRAMES
|
||||||
STX FRAMES
|
STX FRAMES
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
|
144
GREENSCALE.s
144
GREENSCALE.s
@ -36,6 +36,36 @@ PAUSED EQU $20 ; paused state - stop animation
|
|||||||
COLORMODE EQU $22 ; which color mode are we in? which table to draw from
|
COLORMODE EQU $22 ; which color mode are we in? which table to draw from
|
||||||
TABLEOFFSET EQU $23
|
TABLEOFFSET EQU $23
|
||||||
|
|
||||||
|
;from ProRWTS2
|
||||||
|
;subdirectory support
|
||||||
|
bloklo EQU $46
|
||||||
|
blokhi EQU $47
|
||||||
|
|
||||||
|
;to detect file not found
|
||||||
|
status EQU $50
|
||||||
|
|
||||||
|
;file read support
|
||||||
|
sizelo EQU $52
|
||||||
|
sizehi EQU $53
|
||||||
|
ldrlo EQU $55
|
||||||
|
ldrhi EQU $56
|
||||||
|
|
||||||
|
;file open support
|
||||||
|
namlo EQU $57
|
||||||
|
namhi EQU $58
|
||||||
|
|
||||||
|
;rewind support
|
||||||
|
blkidx EQU $5e
|
||||||
|
bleftlo EQU $60
|
||||||
|
blefthi EQU $61
|
||||||
|
|
||||||
|
;API
|
||||||
|
hddopendir EQU $BD03
|
||||||
|
hddrdwrpart EQU $BD00
|
||||||
|
hddblockhi EQU $BD06
|
||||||
|
hddblocklo EQU $BD04
|
||||||
|
|
||||||
|
|
||||||
**************************************************
|
**************************************************
|
||||||
* Apple Standard Memory Locations
|
* Apple Standard Memory Locations
|
||||||
**************************************************
|
**************************************************
|
||||||
@ -94,6 +124,16 @@ CLOSECMD EQU $CC ; CLOSE command index
|
|||||||
|
|
||||||
ORG $0800 ; PROGRAM DATA STARTS AT $0C00 NOW
|
ORG $0800 ; PROGRAM DATA STARTS AT $0C00 NOW
|
||||||
|
|
||||||
|
LDA #>SUBDIRNAME
|
||||||
|
STA namhi
|
||||||
|
LDA #<SUBDIRNAME
|
||||||
|
STA namlo
|
||||||
|
JSR hddopendir ;open subdirectory
|
||||||
|
LDA blokhi
|
||||||
|
STA hddblockhi
|
||||||
|
LDA bloklo
|
||||||
|
STA hddblocklo ;make it permanent
|
||||||
|
|
||||||
JSR BLOAD ; BLOAD DATA
|
JSR BLOAD ; BLOAD DATA
|
||||||
|
|
||||||
JSR HOWMANYFRAMES ; how big is the animation data?
|
JSR HOWMANYFRAMES ; how big is the animation data?
|
||||||
@ -144,14 +184,26 @@ NOTGS LDA #$30
|
|||||||
**************************************************
|
**************************************************
|
||||||
|
|
||||||
STARTANIMATION
|
STARTANIMATION
|
||||||
|
LDA FRAMES
|
||||||
|
STA FRAMENUM ; frame #0
|
||||||
|
|
||||||
|
EACHFRAME
|
||||||
LDA DATAHI ; image data starts at end of code.
|
LDA DATAHI ; image data starts at end of code.
|
||||||
STA IMGHI
|
STA IMGHI
|
||||||
LDA DATALO
|
LDA DATALO
|
||||||
STA IMGLO
|
STA IMGLO
|
||||||
LDA FRAMES
|
|
||||||
STA FRAMENUM ; frame #0
|
|
||||||
|
|
||||||
EACHFRAME JSR INTERFRAMEDELAY
|
LDA #3
|
||||||
|
STA sizehi
|
||||||
|
LDA #$C0
|
||||||
|
STA sizelo
|
||||||
|
LDA #>BEGINDATA
|
||||||
|
STA ldrhi
|
||||||
|
LDA #<BEGINDATA
|
||||||
|
STA ldrlo
|
||||||
|
JSR hddrdwrpart ;read a frame of data
|
||||||
|
|
||||||
|
JSR INTERFRAMEDELAY
|
||||||
LDX #$00
|
LDX #$00
|
||||||
STX PLOTROW
|
STX PLOTROW
|
||||||
LDY #$27 ; Y IS PLOTCOLUMN
|
LDY #$27 ; Y IS PLOTCOLUMN
|
||||||
@ -307,75 +359,47 @@ FOUNDM8 ADC #$80 ; add over 128 = set OVerflow
|
|||||||
**************************************************
|
**************************************************
|
||||||
|
|
||||||
|
|
||||||
BLOAD JSR OPEN ;open "DATA"
|
BLOAD
|
||||||
JSR READ
|
LDA #>FILENAME
|
||||||
JSR CLOSE
|
STA namhi
|
||||||
RTS ;Otherwise done
|
LDA #<FILENAME
|
||||||
|
STA namlo
|
||||||
OPEN JSR MLI ;Perform call
|
LDA #0
|
||||||
DB OPENCMD ;CREATE command number
|
STA sizehi
|
||||||
DW OPENLIST ;Pointer to parameter list
|
STA sizelo ;no pre-read needed
|
||||||
BNE ERROR ;If error, display it
|
JSR hddopendir ;open "data"
|
||||||
LDA REFERENCE
|
LDA status
|
||||||
STA READLIST+1
|
BEQ GOODOPEN
|
||||||
STA CLOSELIST+1
|
|
||||||
RTS
|
|
||||||
|
|
||||||
READ JSR MLI
|
|
||||||
DB READCMD
|
|
||||||
DW READLIST
|
|
||||||
BNE ERROR
|
|
||||||
RTS
|
|
||||||
|
|
||||||
CLOSE JSR MLI
|
|
||||||
DB CLOSECMD
|
|
||||||
DW CLOSELIST
|
|
||||||
BNE ERROR
|
|
||||||
RTS
|
|
||||||
|
|
||||||
ERROR CMP #$46 ; file not found during OPEN? reset to "DATA00"
|
|
||||||
BNE PRINTERROR
|
|
||||||
LDA #$30
|
LDA #$30
|
||||||
STA ENDNAME-1
|
STA ENDNAME-1
|
||||||
STA ENDNAME-2
|
STA ENDNAME-2
|
||||||
JMP OPEN
|
STA ENDNAME-3
|
||||||
PRINTERROR JSR PRBYTE ;Print error code
|
BNE BLOAD
|
||||||
JSR BELL ;Ring the bell
|
GOODOPEN RTS
|
||||||
JSR CROUT ;Print a carriage return
|
|
||||||
RTS
|
|
||||||
|
|
||||||
OPENLIST DB $03 ; parameter list for OPEN command
|
SUBDIRNAME DB ENDSUB-SUBNAME ;Length of name
|
||||||
DW FILENAME
|
SUBNAME ASC 'DATA' ;followed by the name
|
||||||
DA MLI-$400 ; buffer snuggled up tight with PRODOS
|
ENDSUB EQU *
|
||||||
REFERENCE DB $00 ; reference to opened file
|
|
||||||
|
|
||||||
READLIST DB $04
|
|
||||||
DB $00 ; REFERENCE written here after OPEN
|
|
||||||
DB <BEGINDATA,>BEGINDATA ; write to end of code
|
|
||||||
DB $FF,$FF ; read as much as $FFFF - should error out with EOF before that.
|
|
||||||
TRANSFERRED DB $00,$00
|
|
||||||
|
|
||||||
CLOSELIST DB $01
|
|
||||||
DB $00
|
|
||||||
|
|
||||||
FILENAME DB ENDNAME-NAME ;Length of name
|
FILENAME DB ENDNAME-NAME ;Length of name
|
||||||
NAME ASC '/GREENSCALE/DATA00' ;followed by the name
|
NAME ASC 'DATA000' ;followed by the name
|
||||||
ENDNAME EQU *
|
ENDNAME EQU *
|
||||||
|
|
||||||
|
|
||||||
**************************************************
|
**************************************************
|
||||||
* How many frames have transferred?
|
* How many frames have transferred?
|
||||||
* up to 32 ($20) based on TRANSFERRED+1
|
|
||||||
**************************************************
|
**************************************************
|
||||||
HOWMANYFRAMES LDX #$00 ; X=0
|
HOWMANYFRAMES LDX #0
|
||||||
LDA TRANSFERRED+1 ; LDA TRANSFERRED amt hi byte
|
COUNTFRAMES INX
|
||||||
HOWMANYLOOP CMP FRAMESTABLE,X ; compare A to FRAMESTABLE,X
|
SEC
|
||||||
BEQ HOWMANYSET ; if equal, X frames loaded.
|
LDA bleftlo
|
||||||
INX
|
SBC #$C0
|
||||||
CPX $30 ; out of memory around 41 frames.
|
STA bleftlo
|
||||||
BEQ HOWMANYSET ; max 32 frames
|
LDA blefthi
|
||||||
JMP HOWMANYLOOP ; otherwise, INX, Loop
|
SBC #3
|
||||||
HOWMANYSET INX
|
STA blefthi
|
||||||
|
ORA bleftlo
|
||||||
|
BNE COUNTFRAMES
|
||||||
STX FRAMES
|
STX FRAMES
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
|
29
LOADER.s
29
LOADER.s
@ -74,7 +74,17 @@ CLOSECMD EQU $CC ; CLOSE command index
|
|||||||
**************************************************
|
**************************************************
|
||||||
|
|
||||||
|
|
||||||
BLOAD JSR OPEN ;open "DATA"
|
BLOAD JSR OPEN ;open "PRORWTS2"
|
||||||
|
JSR READ
|
||||||
|
JSR ERROR
|
||||||
|
JSR CLOSE
|
||||||
|
JSR ERROR
|
||||||
|
JSR $800 ;init ProRWTS2
|
||||||
|
LDA #>FILENAME2
|
||||||
|
STA OPENLIST+2
|
||||||
|
LDA #<FILENAME2
|
||||||
|
STA OPENLIST+1
|
||||||
|
JSR OPEN ;open "DATA"
|
||||||
JSR READ
|
JSR READ
|
||||||
JSR ERROR
|
JSR ERROR
|
||||||
JSR CLOSE
|
JSR CLOSE
|
||||||
@ -106,21 +116,26 @@ ERROR JSR PRBYTE ;Print error code
|
|||||||
RTS
|
RTS
|
||||||
|
|
||||||
OPENLIST DB $03 ; parameter list for OPEN command
|
OPENLIST DB $03 ; parameter list for OPEN command
|
||||||
DW FILENAME
|
DW FILENAME1
|
||||||
DA MLI-$400 ; buffer snuggled up tight with PRODOS
|
DA $6000 ; not near me
|
||||||
REFERENCE DB $00 ; reference to opened file
|
REFERENCE DB $00 ; reference to opened file
|
||||||
|
|
||||||
READLIST DB $04
|
READLIST DB $04
|
||||||
DB $00 ; REFERENCE written here after OPEN
|
DB $00 ; REFERENCE written here after OPEN
|
||||||
DB $00,$08 ; write to $0C00
|
DB $00,$08 ; write to $0800
|
||||||
DB $FF,$FF ; read as much as $FFFF - should error out with EOF before that.
|
DB $FF,$FF ; read as much as $FFFF - should error out with EOF before that.
|
||||||
TRANSFERRED DB $00,$00
|
TRANSFERRED DB $00,$00
|
||||||
|
|
||||||
CLOSELIST DB $01
|
CLOSELIST DB $01
|
||||||
DB $00
|
DB $00
|
||||||
|
|
||||||
FILENAME DB ENDNAME-NAME ;Length of name
|
FILENAME1 DB ENDNAME1-NAME1 ;Length of name
|
||||||
NAME ASC '/GREENSCALE/GREENSCALE' ;followed by the name
|
NAME1 ASC 'PRORWTS2' ;followed by the name
|
||||||
ENDNAME EQU *
|
ENDNAME1 EQU *
|
||||||
|
|
||||||
|
FILENAME2 DB ENDNAME2-NAME2 ;Length of name
|
||||||
|
NAME2 ASC '/GREENSCALE/GREENSCALE' ;followed by the name
|
||||||
|
ENDNAME2 EQU *
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
3278
PRORWTS2.S
Normal file
3278
PRORWTS2.S
Normal file
File diff suppressed because it is too large
Load Diff
BIN
prorwts2#060800
Normal file
BIN
prorwts2#060800
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user