Skip to content

Commit

Permalink
planety
Browse files Browse the repository at this point in the history
  • Loading branch information
slesinger committed Nov 19, 2024
1 parent cd27756 commit 4c78c46
Show file tree
Hide file tree
Showing 9 changed files with 774 additions and 117 deletions.
11 changes: 11 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Released under MIT License

Copyright (c) 2013 Mark Otto.

Copyright (c) 2017 Andrew Fong.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ video:

scroller:
$(KICKASS) scroller.asm
$(KICKASS) planety_bmpdata.asm

prgs: keyb fontm video scroller

Expand All @@ -40,6 +41,8 @@ disk: clean prgs
c1541 -attach $(D64_FILE) -write data/ucieczka.music music
c1541 -attach $(D64_FILE) -write video.prg video
c1541 -attach $(D64_FILE) -write scroller.prg scrll
c1541 -attach $(D64_FILE) -write planet_bitmap.prg pbtmp
c1541 -attach $(D64_FILE) -write planet_color.prg pcolr
c1541 -attach $(D64_FILE) -write data/video_font.bin vfont
c1541 -attach $(D64_FILE) -write data/search-font.bin rfont
c1541 -attach $(D64_FILE) -write data/results-text.bin restx
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- pozdezreni, ze end_of_video: skonci driv nez dojede posledni frame robota

## Issues
- 3d scroller
- 3d scroller zobrazit obrazek, zmenit barvy
- napojit na video 3d scroller
- video blika - nestiha ladovat, je na spatncyh sektorech? pomuze tscrunch?
- results ikony
Expand Down
Binary file modified docs/memory.ods
Binary file not shown.
573 changes: 573 additions & 0 deletions planety_bmpdata.asm

Large diffs are not rendered by default.

279 changes: 164 additions & 115 deletions scroller.asm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

.namespace PART5_ns {
#import "fm_const.asm"
#import "loadersymbols-c64.inc"
//--------
.const countlines = 8 //8 lines in char
.const countchar = 16 //16 chars to shift
Expand Down Expand Up @@ -44,82 +45,130 @@
// Started as whole compilation of parts
#else
// This has to happen only when starting separately
.var music = LoadSid("Ucieczka_z_Tropiku.sid") // music is loaded in previous part. Separately is disabled
*=music.location "Part2_music"
.fill music.size, music.getData(i)
BasicUpstart2(start)

// .var music = LoadSid("Ucieczka_z_Tropiku.sid") // music is loaded in previous part. Separately is disabled
// *=music.location "Part2_music"
// .fill music.size, music.getData(i)

*= install "loader_install" // same as install jsr
.var installer_c64 = LoadBinary("tools/krill194/loader/build/install-c64.prg", BF_C64FILE)
installer_ptr: .fill installer_c64.getSize(), installer_c64.get(i)

*= loadraw "loader_resident" // same as loader code block address
.var loader_c64 = LoadBinary("tools/krill194/loader/build/loader-c64.prg", BF_C64FILE)
loader_ptr: .fill loader_c64.getSize(), loader_c64.get(i)

// .var planet_bitmap = LoadBinary("planet_bitmap.prg", BF_C64FILE) // is loaded during this part
// *=$2000 "Part5_bitmap_data"
// .fill planet_bitmap.getSize(), planet_bitmap.get(i)

// .var planet_color = LoadBinary("planet_color.prg", BF_C64FILE) // is loaded during this part
// *=$0400 "Part5_bitmap_color"
// .fill planet_color.getSize(), planet_color.get(i)

BasicUpstart2(start)
#endif
//---
*= $9800 "Part5_code"
start:
#if RUNNING_COMPLETE
#else
// start music
ldx #0
ldy #0
lda #0
jsr $1000
jsr install
bcs load_error
clc
ldx #<pbtmp // Vector pointing to a string containing loaded file name
ldy #>pbtmp
jsr loadraw
bcs load_error
clc
ldx #<pcolr // Vector pointing to a string containing loaded file name
ldy #>pcolr
jsr loadraw
bcs load_error
clc
ldx #<file_music // Vector pointing to a string containing loaded file name
ldy #>file_music
jsr loadraw
bcs load_error
jmp cont1
file_music:.text "MUSIC" //filename on diskette
.byte $00
pbtmp: .text "PBTMP" //filename on diskette
.byte $00
pcolr: .text "PCOLR" //filename on diskette
.byte $00
load_error:
sta $0400 // display error screen code
lda #$04
sta $d020
sta $d021
jmp *
cont1:
// start music
ldx #0
ldy #0
lda #0
jsr $1000
#endif
lda #$36
sta $01
// init irq
sei
cld
ldx #$fb
txs
lda #$37
sta $01
jsr $fda3
jsr $fd15
jsr $e3bf
jsr $ff5b
sei
lda #<draw
sta $0318
sta $fffa
sta $fffe
lda #>draw
sta $0319
sta $fffb
sta $ffff

// set colors
lda #BLACK // black large empty space
sta $d020
lda #WHITE // TODO tohle nema vliv // white pixels
sta $d021
lda $d011
and #%11101111 // disable screen
sta $d011
// jsr fillchar //fill char
jsr settbadr //help proc. for prepare data
jsr makespeedcode //make long and borning code for dotscroll
//and setting plots for wait look
// jsr speedcode //now plots will be clear
// jsr clearchar //now char be clear
jsr makespeedclear //like before for clear plots and set plots
// jsr speedclear //ok now clear plots

jsr initgraph //enable hires etc.
lda $d011
ora #%00010000 // enable screen
sta $d011
lda #$36
sta $01
// init irq
sei
cld
ldx #$fb
txs
lda #$37
sta $01
// jsr $fda3
// jsr $fd15
// jsr $e3bf
// jsr $ff5b
// jmp *
sei
lda #<draw
sta $0318
sta $fffa
sta $fffe
lda #>draw
sta $0319
sta $fffb
sta $ffff

// set colors
lda #BLACK // black large empty space
sta $d020
sta $d021 // does not have real effect due to 0400 color memory
lda $d011
and #%11101111 // disable screen
sta $d011
// jsr fillchar //fill char
jsr settbadr //help proc. for prepare data
jsr makespeedcode //make long and borning code for dotscroll
//and setting plots for wait look
// jsr speedcode //now plots will be clear
// jsr clearchar //now char be clear
jsr makespeedclear //like before for clear plots and set plots
// jsr speedclear //ok now clear plots

jsr initgraph //enable hires etc.
lda $d011
ora #%00010000 // enable screen
sta $d011

//==========
//here is irq nmi and brk for neverending loop
//in this sample we don't work in the irq
//==========
draw:

sei
cld
ldx #$fb //stack init
txs
lda #$38 //show all 64 ram (in this sample not necessary)
sta $01
jsr clearchar
jsr speedclear //clear plots
sta posscroll //start scrol from zero pos.
sei
cld
ldx #$fb //stack init
txs
lda #$38 //show all 64 ram (in this sample not necessary)
sta $01
jsr clearchar
jsr speedclear //clear plots
sta posscroll //start scrol from zero pos.


//after init and make speedcode here is mainlop
Expand All @@ -129,36 +178,36 @@ draw:
//of course speedcode from $4000 to $7d03 still over here

mainloop:
jsr rolchar //shift data for dot scroll
lda #$35 //show i/o
sta $01
ldx #$c8
cpx $d012
bne *-3

// inc $d020
lda #$38 //show all ram
sta $01
jsr speedclear //clear plots on the bitmap
jsr speedcode //display plots of chars on 3d trajectory
lda #$35 //show i/o vic etc.
sta $01
// dec $d020
// play music
jsr rolchar //shift data for dot scroll
lda #$35 //show i/o
sta $01

ldx #$c8
cpx $d012
bne *-3

// inc $d020
lda #$38 //show all ram
sta $01
jsr speedclear //clear plots on the bitmap
jsr speedcode //display plots of chars on 3d trajectory
lda #$35 //show i/o vic etc.
sta $01
// dec $d020

// play music
#if RUNNING_COMPLETE
#else
jsr $1003
jsr $1003
#endif
lda #$ef
cmp $dc01 //space?
bne mainloop
cmp $dc01
beq *-3
lda #$38
sta $01
brk //go to draw of course
lda #$ef
cmp $dc01 //space?
bne mainloop
cmp $dc01
beq *-3
lda #$38
sta $01
brk //go to draw of course

//==============
//clear or fill char data
Expand Down Expand Up @@ -409,32 +458,32 @@ initgraph:
sta $d011


ldx #$00
lda #(BLACK<<4)+LIGHT_GREY
// ldx #$00
// lda #(WHITE<<4)+BLACK
!:
sta $0400,x
sta $0500,x
sta $0600,x
sta $06f8,x
inx
bne !-
stx posscroll

ldx #>screen
stx vectr1+1
ldy #$00
sty vectr1


lda #$00
!:
sta (vectr1),y
iny
bne !-
inc vectr1+1
dex
bne !-
// !:
// sta $0400,x
// sta $0500,x
// sta $0600,x
// sta $06f8,x
// inx
// bne !-
// stx posscroll

// ldx #>screen
// stx vectr1+1
// ldy #$00
// sty vectr1


// lda #$00
// !:
// sta (vectr1),y
// iny
// bne !-
// inc vectr1+1
// dex
// bne !-
rts
//===========
//calculate tb row address in the bitmap
Expand Down
23 changes: 22 additions & 1 deletion tools/c64fy/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
# Convert RGB PNG files

Save as RGB PNG file in Gimp and convert to `planety_bmpdata.a`
```
./c64fy.py -hires 1 planety-rich.png
./c64fy.py -hires 1 planety.png
```

Then, rename `planety_bmpdata.a` to <project root folder, next to scroller.asm>/planety_bmpdata.asm`

Edit the file to get such structure:
```asm
.segment PLANET_BITMAP []
*=$2000
planety_bitmapdata:
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
...
.segment PLANET_COLOR []
*=$0400
planety_chardata:
.byte $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
...
.file [name="planet_bitmap.prg", segments="PLANET_BITMAP"]
.file [name="planet_color.prg", segments="PLANET_COLOR"]
```


C64fy python script comes from: https://github.com/thojor79/bacillus_c64/tree/master/convert
Expand Down
Binary file added tools/c64fy/planety.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tools/c64fy/planety_c64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4c78c46

Please sign in to comment.