somewhere between today and the end of the world this page should get sorted ... in the meantime if you're REALLY looking to get going, SOMETHING here should help you
quickly put this here, sort later : https://www.lemon64.com/forum/viewtopic.php?t=60662 (2023 07 03)
perspective-wise : i try to avoid windows where possible, not just b/c i had some serious mess with miCrotter (watch Eagle Talon!) as they just closed onedrive and other accounts "for no reasons given" and then when i got someone to reply after 20 years the guy literally said "we dont have to give you a reason" ... thats america for ya ... more b/c microsoft is reall bad for the economy and from a pc-o-file perspective the OS is like a mastodont sitting on your pc crushing it with bloatware in the back which you cant even turn off, AND about 200 processes which i dont actually need but also just are there always. Its always been a bit of a riddle to me why the l33t , who tend to be slightly above average coders cling to a piece of shyte like windows but ofcourse, its also my opinion that you should "go with what works for you", im just puzzled when i compare working on a cinnamon desktop flavour versus DOS10 ... bmwell, ttz for most stuff i use geany tho sublime (the weapon of choice for fairlight(-TV)'s Bacchus is probably more potent as its a great hex editor too, its not totally free and as much as we would like to maecenas all indies on the planet to make sure Crotter sinks into the ocean we dont have the money for that (the royal plural sticks as the others go to sleep and its just me now) and for actual c64 programming so far its been cbmprgstudio. Read a lot about how "you should use a real assembler" and all that but the same thing to us as to others : "just go with what works for you, ITS NOT A FUCKING JOB TO PLEASE THE BOSS" ... des yo ? blender has been shelved since v3 as it basically kills the pc just by booting, the modelling tools work like they're in a different timezone and i dont have the money for a $15k ryzen pc just to be able to use brush-modelling, but thats not much of a problem64, the rest is GIMP, Aseprite and some other stuff, if its relevant ill try to add sections over time , no deadline ofcourse, no obligations
should check this page one of these days for sorting i know i know
yea, some day it'l get sorted but this page is more like a fridge for sticky notes as the whole site is more like an aggregator where we can find it all in one place, tho its open to the public and cookie-free , and you can always mail but we dont buy stuff at the door.
https://retrogamecoders.com/introduction-to-trse-programming/
expanded borders 1 :
handy bits
Delete a file:
OPEN1,8,15,"I":CLOSE1
OPEN1,8,15,"S:FILENAME":CLOSE1
Replace a file:
SAVE "@0:FILENAME",8
---
A$="FILENAME"
SAVE "@0:" + A$, 8.
these should be made available when applicable as basic on handybits.d64 disks in the files section
bear with the cat we just trying to get the feel of the old machine back - its been ... longer than yo momma :)
busy with #stuff so just dumping stuff here until it gets shaped and sorted
- there i was, thinking all we can get is 4gentes avantgarde and artsy takes but here comes the guy who kills disk drives and, i wont pretend to understand the explanation after reading it one time but i didnt even know about using the side borders to display actual imagery, thats pretty impressive id say, in 4K nonetheless, not that i'll ever need this level of tek for a game but if this is possible maybe the screen to be used can be expanded even more than just the top and bottom borders to display status and maps ... tho from a first scan of the article full bitmaps to the right seem to be a bit harder than sprites in the bottom border. 40 years and counting, the ghost in the machine (writing : 2023 06 04) certainly gonna keep this link and check out the site too if it has writ like this there should be more.
- - -
suppose you cant go without these if you wanna 64 anything at all today
Messy is the word ? since we succeed in intros that work there must be something orderly somewhere though here it works mostly like the universe ... BANG! boom ... primordial soup and from the strands of chaos it coagulates over time.
Aint nobody round here fly.
We found these so far the ones we used the most in our endeavours of "surpassing the scene after 40 years delay"
mind : we cut basic programming short once we got into asm b/c even at 61 people in one body there's 2 arms, 10 digits, a foobar brain with a few popping synapses left and 24 hours in a day, of which most are spent on stuff besos pays other people to do
(we also have nothing to prove)
mixing basic and ml - also how do i save a program thats x lines of basic and the rest "in memory"? need to know
commodore ML saver (basic) assuming with a monitor you can do that from the monitor but thats not the point here
'2264 : https://kodiak64.com/blog/wild-wood-deconstructed
ADC : https://digitalerr0r.net/2011/03/21/commodore-64-programming-3-6502-arithmetics/ (mmh wel yea its gotta come from somewhere, now BEQ as a subroutine ? dazalni zeker?)
-https://www.c64-wiki.com/wiki/Graphics_Modes
-https://www.c64-wiki.com/wiki/Standard_Bitmap_Mode
-https://www.c64-wiki.com/wiki/Multicolor_Bitmap_Mode
for instance a slime or an orc graphic w as many color as possible using basic sounds already like math to barbie for now - 8 hires sprites + 1 background color + 1 character set (you need letters too) is missing bits of the palette - 8 lores sprites have to use the higher colors and multicol characters the lower so that could be 16 (i hope no ones reading im just thinking) since its basic to start dumping a 16color bitmap in the corner of the screen probably isnt an option - also i should be sleeping and its not 64day anyway
-
https://www.c64brain.com/graphics/commodore-64-sprites/
https://www.atarimagazines.com/compute/issue70/088_1_Loading_And_Linking_Commodore_Programs.php
https://www.cosmigo.com/promotion/docs/onlinehelp/gfxHardware-c64.htm#:~:text=The%20C64%20Multi%20Color%20Character,a%20size%20ratio%20of%202x1.
(https://vice-emu.pokefinder.org/index.php/VICEKB) keyboard map - - ... not compliant at all
https://retro64.altervista.org/blog/very-basic-basic-plotting-characters-screen-c64-and-vic-20/
or maybe its the emulator - it prints like nothing
its not ...
https://stackoverflow.com/questions/28597139/change-color-of-text-without-color-memory-in-c64-assembly
https://archive.org/details/1986-03-computegazette/page/n75/mode/2up (hardcore)
-
well : https://bumbershootsoft.wordpress.com/2020/11/09/building-a-faster-c64-bitmap-library/ - - even with rasterline interrupts just having 25% of the / 1/4th of the screen in pixelmode ... thats still 2500 and can you even split horizontally ?
https://www.lemon64.com/forum/viewtopic.php?t=52591&sid=e23377d250f6f209bbea51b22c5dc8f5
https://codebase64.org/doku.php?id=base:timerinterrupts
https://codebase64.org/doku.php?id=base:double_irq_explained
https://www.lemon64.com/forum/viewtopic.php?t=45328&start=15
https://www.c64-wiki.com/wiki/Interrupt
https://medium.com/developer-rants/interrupts-on-the-commodore-64-a-very-simple-example-cf1be764715e
https://www.c64-wiki.com/wiki/Raster_interrupt
http://www.c64os.com/post/commandandcontrol
http://www.c64os.com/post/rasterinterruptsplitscreen
https://books.google.be/books?id=UhpsEAAAQBAJ&pg=PT95&lpg=PT95&dq=c64+using+interrupts+combined+basic&source=bl&ots=rAvYksSF_A&sig=ACfU3U2ZoFZFDtAZv8uzxmwbF77qQncPuA&hl=nl&sa=X&ved=2ahUKEwj8nu6hua33AhVnhf0HHW36CTEQ6AF6BAghEAM#v=onepage&q=c64%20using%20interrupts%20combined%20basic&f=false
https://dustlayer.com/c64-coding-tutorials/2013/4/8/episode-2-3-did-i-interrupt-you
-
ye stuff while stuffing
-
https://codebase64.org/doku.php?id=base:demo_coding_introduction - but some colourcycling petsci probably comes first - ... NOP takes two cycles - screen gets drawn 50 times a second, theres 380 rasterlines - math is hard - im gonna have to learn to read again, i was hoping for youtube vids to put on while gaming ah ha
-
http://6502.org/ (it says "check out the list of opcodes" so they're probably there somewhere hahah) - - will sort while sorting when sorting
http://www.fairlight.to/tools/pc.html (!!!)
(https://vice-emu.pokefinder.org/index.php/VICEKB) keyboard map - - ... not compliant at all
-
https://ilesj.wordpress.com/2016/04/09/graphics-for-old-c64-colors-and-how-to-view-it/ (!!!)
-
https://www.c64-wiki.com/wiki/Screen_RAM
https://retro64.altervista.org/blog/very-basic-basic-plotting-characters-screen-c64-and-vic-20/
or maybe its the emulator - it prints like nothing
its not ...
-
https://www.lemon64.com/forum/viewtopic.php?t=23355
-
https://digitalerr0r.net/2011/05/01/commodore-64-programming-8-text-and-custom-charsets/
https://www.c64-wiki.com/wiki/Character_set#Programming
;
; OPEN TOP and BOTTOM BORDER
; 10 SYS (2080)
*=$0801
BYTE $0E, $08, $0A, $00, $9E, $20, $28, $32, $30, $38, $30, $29, $00, $00, $00
*=$820
sprdata = $3000 ; within 16K address of vic's range based on bank
S = 1024 ; screen location based on bank used
LB = 1
HB = 2
Init SEI ; set bit, make the CPU ignore interrupt
LDA #%01111111 ; switch off interrupt signals from CIA-1
STA $DC0D
LDA $DC0D ; acknowledge pending interrupts from CIA-1
LDA $DD0D ; acknowledge pending interrupts from CIA-2
LDX #IRQ249
STX $0315
LDX #IRQsync
STX $FFFF
LDX #NMI
STX $FFFB
LDX #sprdata/64 ; sprite data at $3000 (192 x 64)
STX S+1016
INX
STX S+1017
INX
STX S+1018
INX
STX S+1019
INX
STX S+1020
INX
STX S+1021
INX
STX S+1022
INX
STX S+1023
LDA #0
STA slicer ; in case user re-run
STA sprindex ; in case user re-run
STA gettext+LB ; in case user re-run
STA S+$3BFF ; clear garbage under border $3FFF
TAX ; make x a zero too
clearloop STA sprdata,x
STA sprdata+256,x ; sprite spans 512bytes
INX
BNE clearloop ; rolled past 255 to zero
LDA $02a6 ; kernal sets this flag
BEQ isntsc ; it is ntsc
LDA #240 ; is equal -1 under PAL system
STA _D000 ; set sprite0 x-pos table
LDA #$49 ; change it to EOR #$EA
STA PALfix1 ; change two nops to a EOR
LDA #$EA ; change it to NOP
STA PALfix2 ; change two nops to a EOR
LDA #$24 ; change it to BIT
STA PALfix3 ; change two nops to a EOR
LDA #' ' ; change it to BIT
STA mytext ; change two nops to a EOR
LDA #'P' ; change it to BIT
STA mytext+1 ; change two nops to a EOR
LDA #'A' ; change it to BIT
STA mytext+2 ; change two nops to a EOR
LDA #'L' ; change it to BIT
STA mytext+3 ; change two nops to a EOR
isntsc
LDX #$2e ; preset all vic registers
loop LDA _D000,x ; the label name
STA $D000,x ; the registers
DEX
BPL loop ; until less than zero
CLI ; clear interrupt flag
RTS
;---------------------- The Interupt Service Routines --------------------------
NMI RTI ; just exit it if kernal is banked out
Align ; if we add code above don't change page boyndry
IRQ249 ASL $D019 ; acknowledge the interrupt by clearing flag
LDX #$13 ; set 24 rows, has to be be done on line 249
STX $D011 ; scrolly trick for no border
line1 LDA #36 ; next top ratser line
STA $D012
LDX #IRQtop
STX $0315
JMP $EA31 ; exit to keyboard scan
IRQtop INC $D012 ; we only have as little a 18 cycles left... 6
LDX #$35 ; ...as kernal delay is 38-45 cycles 2
STX $01 ; turn off kernal so ram is now our vector 3
STX $D019 ; acknowledge the interrupt by clearing flag 4
CLI ; enable IRQ 2
NOP ; only 2 cycle instructions untill IRQ hits
NOP ; so no longer 1-7 jitter but 1-2
NOP
NOP
NOP
NOP
NOP
IRQsync LDX #$37 ; turn on kernal so rom is now our vector
STX $1 ; do some real work instead of dummy loop
PLA ; wait exactly 1 lines worth of cycles
PLA ; restore stack pointer as no rti here
PLA ; and we did not have time to use TSX
LDX #249 ; line 50 is just 8 rows below start of sprites
STX $D012 ; set 249 for next
LDX #IRQ249
STX $0315
LDX #$1B
STX $D011 ; undo scroll regisyer on any other line
NOP ; just a dummy 2cycle for alignment
BIT $EA ; just a dummy 3cycle for alignment
PALfix1 NOP ; remove 2 cycle delay for PAL
NOP
line3 LDX #37 ; RASTER line number change yet?
CPX $d012
BEQ *+2 ; 1 more cycle by branching to next instruction
ASL $D019 ; acknowledge the interrupt by clearing flag
PALfix2 BIT $EA ; add 1 cycle delay on PAL
LDX #$ff ; waiting to turn on sprite until now
STX $D015 ; still on at this line though
LDY #10 ; open up 9 line sides
openloop NOP ; in this loop all 8 sprite are on
NOP ; you can put 26cyles of work here
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
PALfix3 NOP ; remove 1 cycle delay on PAL
NOP
DEC $d016 ; Set 38-chars width remove sideborder
INC $d016 ; Set back to 40-chars OPEN SIDE BORDRER !
DEY
BNE openloop
STY $D015 ; turn them all off but it still runs 21 lines
;--------------------------Main Program-----------------------------------------
runalways LDX #3*7 ; copy 7 lines
shift ASL font,x ; shift carry out from one char buffer
ROL sprdata+450,x
ROL sprdata+449,x
ROL sprdata+448,x
ROL sprdata+386,x
ROL sprdata+385,x
ROL sprdata+384,x
ROL sprdata+322,x
ROL sprdata+321,x
ROL sprdata+320,x
ROL sprdata+258,x
ROL sprdata+257,x
ROL sprdata+256,x
ROL sprdata+194,x
ROL sprdata+193,x
ROL sprdata+192,x
ROL sprdata+130,x
ROL sprdata+129,x
ROL sprdata+128,x
ROL sprdata+66,x
ROL sprdata+65,x
ROL sprdata+64,x
ROL sprdata+2,x
ROL sprdata+1,x
ROL sprdata+0,x
dex
dex
dex
bne shift ; line0 is not done to leave space
sinepnt LDA #0-0
CLC
sinepatch ADC #0-0
AND #15
STA sinepnt+LB
TAX
LDA sinetable,x
TAX
STX line1+LB
INX
STX line3+LB
INX
STX $d001
STX $d003
STX $d005
STX $d007
STX $d009
STX $d00b
STX $d00d
STX $d00f
;----------------------Main Program Slicer Scheduler----------------------------
skip = $EA81 ; no keyboard scan
taskexit = $EA81 ; no keyboard scan
LDA slicer ; goes from 0-7
TAX ; move it to x
INX ; our index counting up
STX slicer ; set next return
ASL A ; double it as table are words
TAX ; move it to x
LDA jumptable,x
STA thejump+LB
LDA jumptable+1,x
STA thejump+HB
thejump JMP $1234-0 ; selfmod
slicer byte 0
sprindex byte 0
counter byte 0 ; increases every full slicer
jumptable
WORD skip, skip, color, skip ; 1-4
WORD color, gettext, color, copyfont ; 5-8
sinetable
BYTE 36,37,38,38,38,37,36,34 ; sine table
BYTE 32,31,30,30,30,31,32,34
;-------------------------------------------------------------------------------
color LDX #0-0 ; 0 to 7
INX
CPX #8
BNE _notendcol
LDX #0
_notendcol STX color+LB
LDY #7
_colloop LDA colortable,x
STA $D027,y ; sprite0 color + y
INX
DEY
BPL _colloop
JMP taskexit
colortable BYTE 9,8,5,13,1,1,13,5, 8,9,9,8,5,13,5 ;repeat 7 bytes
;-------------------------------------------------------------------------------
gettext LDY #0-0 ; char pointer
LDA mytext,y ; get char
LDX #1 ; we run sliver numally 7pixels
CMP #'9'
BPL isMW ; all graphic char is 8 pixels
CMP #'M'
BEQ isMW
CMP #'W'
BNE notMW
isMW DEX ; change it 0 for 8 pixels
notMW CMP #'I'
BNE notI
INX
INX ; change it 3 for 5 pixels
notI STX restart+LB
CMP #$ff ; end of text so can use 0-to-254 petscii
BNE _noendtxt ; replace these two lines w/ BPL for cbm style
LDA #32 ; replace w/ space, use AND #127 for cbm style
LDY #-1 ; iny below makes it 0 max 256 charters for now
_noendtxt INY
STY gettext+LB ; next char for next time
TAY ; 87654321
ASL A ; 76543210 = x2
ASL A ; 65432100 = x4
ASL A ; 54321000 = x8
STA source+LB ; store it in copyfonts 1 to 3
TYA ; 87654321
LSR A ; 08765432
LSR A ; 00876543
LSR A ; 00087654
LSR A ; 00008765
LSR A ; 00000876
ORA #$D0 ; char rom block start at $D000
STA source+HB ; store it in copyfonts
JMP taskexit
;-------------------------------------------------------------------------------
copyfont LDA #$33 ; make the CPU see the Character Generator ROM
STA $01 ; at $D000
LDX #7 ; rom alphabet are 7 lines
LDY #8*3 ; out font buffer have 2 waste bytes each row
source LDA $d000,x
STA font,y
DEY ; fisrt dey
DEY ; second dey
DEY ; third dey
DEX ; one dex
BPL source ; if less than zero stop
LDA #$37 ; switch in I/O mapped registers again
STA $01 ; so vic can see them
LDX counter ; let's wait to sinejump for fun
INX
STX counter
CPX #100
BNE restart
LDA #1 ; change it to D016
STA sinepatch+LB
restart LDA #0-0
CMP #3 ; it is a I
BNE noIshift
ASL font+3
ASL font+6
ASL font+9
ASL font+12
ASL font+15
ASL font+18
ASL font+21
noIshift STA slicer
JMP taskexit
font BYTES 24
;-------------------------------------------------------------------------------
_D000 BYTE 248,38 ; X and Y sprite 1 247 = -1 in pal
_D002 BYTE 40,38 ; X and Y sprite 2
_D004 BYTE 88,38 ; X and Y sprite 3
_D006 BYTE 136,38 ; X and Y sprite 4
_D008 BYTE 184,38 ; X and Y sprite 5
_D00A BYTE 232,38 ; X and Y sprite 6
_D00C BYTE 24,38 ; X and Y sprite 7
_D00E BYTE 72,38 ; X and Y sprite 8
_D010 BYTE %11000001 ; MSBs of X coordinates
_D011 BYTE $1B ; Control register 1
_D012 BYTE 249 ; Raster counter
_D013 BYTE 0 ; Light Pen X
_D014 BYTE 0 ; Light Pen Y
_D015 BYTE 255 ; Sprite enabled
_D016 BYTE $C8 ; Control register 2
_D017 BYTE 0 ; Sprite Y expansion
_D018 BYTE $14 ; Memory pointers
_D019 BYTE $ff ; Interrupt register ACK all
_D01A BYTE 1 ; interrupts enabled
_D01B BYTE 0 ; Sprite data priority
_D01C BYTE 0 ; Sprite multicolor
_D01D BYTE 255 ; Sprite X expansion
_D01E BYTE 0 ; Sprite-sprite collision
_D01F BYTE 0 ; Sprite-data collision
_D020 BYTE 14 ; Border color
_D021 BYTE 6 ; Background color 0
_D022 BYTE 0 ; Background color 1
_D023 BYTE 0 ; Background color 2
_D024 BYTE 0 ; Background color 3
_D025 BYTE 0 ; Sprite multicolor 0
_D026 BYTE 0 ; Sprite multicolor 1
_D027 BYTE 1 ; Color sprite 0
_D028 BYTE 1 ; Color sprite 1
_D029 BYTE 1 ; Color sprite 2
_D02A BYTE 1 ; Color sprite 3
_D02B BYTE 1 ; Color sprite 4
_D02C BYTE 1 ; Color sprite 5
_D02D BYTE 1 ; Color sprite 6
_D02E BYTE 1 ; Color sprite 7
mytext TEXT 'NTSC DETECTED '
BYTE 78,86,77
TEXT ' SCROLLER USES PROPORTIONAL FONT M W ARE WIDER I IS SHRUNK '
BYTE 83
TEXT 'COED SCHOOL'
BYTE 83
TEXT ' : HYOYOUNG * TAEWOON * SUNGMIN * JUNG-WOO KIM * SOOMI LEE * HYEWON * CHANMI * KANGHO *'
TEXT ' KWANGHAENG * NOORI * EUNKYO * NAYEON * JONGKOOK * SEJOON '
BYTE 32,32,32,32,32, $FF
; 10 SYS (2080)
*=$0801
BYTE $0E, $08, $0A, $00, $9E, $20, $28, $32, $30, $38, $30, $29, $00, $00, $00
*=$820
sprdata = $3000 ; within 16K address of vic's range based on bank
S = 1024 ; screen location based on bank used
LB = 1
HB = 2
Init SEI ; set bit, make the CPU ignore interrupt
LDA #%01111111 ; switch off interrupt signals from CIA-1
STA $DC0D
LDA $DC0D ; acknowledge pending interrupts from CIA-1
LDA $DD0D ; acknowledge pending interrupts from CIA-2
LDX #IRQ
STX $0315
LDX #sprdata/64 ; sprite data at $3000 (192 x 64)
STX S+1016
INX
STX S+1017
INX
STX S+1018
INX
STX S+1019
INX
STX S+1020
INX
STX S+1021
INX
STX S+1022
INX
STX S+1023
LDA #0
STA slicer ; in case user re-run
STA sprindex ; in case user re-run
STA _thechar+LB ; in case user re-run
STA S+$3BFF ; clear garbage under border $3FFF
TAX ; make x a zero too
clearloop STA sprdata,x
STA sprdata+256,x ; sprite spans 512bytes
INX
BNE clearloop ; rolled past 255 to zero
LDX #$2e ; preset all vic registers
loop LDA _D000,x ; the label name
STA $D000,x ; the registers
DEX
BPL loop ; until less than zero
LDA $02a6 ; kernal sets this flag
BEQ isntsc ; it is ntsc
LDA #$f7 ; is equal -1 under PAL system
STA _palfix+LB
isntsc
CLI ; clear interrupt flag
RTS
;---------------------The Interupt Service Routine------------------------------
IRQ ASL $D019 ; acknowledge the interrupt by clearing flag
_nextline LDX #0-0 ; 249 or 27
STX $D012 ; set next rasterline where interrupt occur
BMI restore25 ; branch if bit 7 set
LDX #249 ; value over 128 is a 'minus'
STX _nextline+LB
LDX #$13 ; set 24 rows, has to be be done on line 249
STX $D011 ; scrolly trick for no border
JMP $EA31 ; exit to keyboard scan
restore25 LDX #$1B
STX $D011 ; undo scroll on any other line
LDX #50 ; line 50 is just 8 rows below start of sprites
STX _nextline+LB ; set rasterline where interrupt shall occu
;--------------------------Main Program-----------------------------------------
runalways DEC $D000 ; sprite 1
DEC $D002 ; sprite 2
DEC $D004 ; sprite 3
DEC $D006 ; sprite 4
DEC $D008 ; sprite 5
DEC $D00A ; sprite 6
DEC $D00C ; sprite 7
DEC $D00E ; sprite 8
;----------------------Main Program Slicer Scheduler----------------------------
skip = $EA81 ; no keyboard scan
taskexit = $EA81 ; no keyboard scan
LDA slicer ; goes from 0-47
TAX ; move it to x
INX ; our index counting up
CPX #48 ; end of list
BNE notend
INC counter ; master counter if a task needs it
LDX #0
notend STX slicer ; set next return
ASL A ; double it as table are words
TAX ; move it to x
LDA jumptable,x
STA thejump+LB
LDA jumptable+1,x
STA thejump+HB
thejump JMP $1234-0 ; selfmod
;-------------------------------------------------------------------------------
sprsetup LDA sprindex ; first entry 321
LSR A ; 00000032 (1)
ROR A ; 10000003 (2)
ROR A ; 21000000 (3) the 3 is used in HB
STA dest1+LB ; 0, 64, 128 or 192
STA dest2+LB
STA dest3+LB
LDA #>sprdata ; get HB of sprite data loc
ADC #0 ; use (if) carry from the 3
STA dest1+HB ; 0, 64, 128 or 192
STA dest2+HB
STA dest3+HB
JMP taskexit
;-------------------------------------------------------------------------------
color LDX #0-0 ; 0 to 7
INX
CPX #8
BNE _notendcol
LDX #0
_notendcol STX color+LB
LDY #7
_colloop LDA colortable,x
STA $D027,y ; sprite0 color + y
INX
DEY
BPL _colloop
JMP taskexit
colortable BYTE 1,15,12,11,11,12,15,1 , 1,15,12,11,11,12,15 ;repeat 7 bytes
;-------------------------------------------------------------------------------
gettext1 LDX #source1-source3 ; sprite is filled in from bottom right..
BYTE $2C ; the BIT opcode skip trick
gettext2 LDX #source2-source3 ; ...to top left so source3 is first
BYTE $2C
gettext3 LDX #source3-source3 ; yes it would be zero
_thechar LDY #0-0 ; char pointer
LDA mytext,y ; get char
CMP #$ff ; end of text so can use 0-to-254 petscii
BNE _noendtxt ; replace these two lines w/ BPL for cbm style
LDA #32 ; replace w/ space, use AND #127 for cbm style
LDY #-1 ; iny below makes it 0 max 256 charters for now
_noendtxt INY
STY _thechar+LB ; next char on return
TAY ; 87654321
ASL A ; 76543210 = x2
ASL A ; 65432100 = x4
ASL A ; 54321000 = x8
STA source3+LB,x ; store it in copyfonts 1 to 3
TYA ; 87654321
LSR A ; 08765432
LSR A ; 00876543
LSR A ; 00087654
LSR A ; 00008765
LSR A ; 00000876
ORA #$D0 ; char rom block start at $D000
STA source3+HB,x ; store it in copyfonts 1 to 3
JMP taskexit
;-------------------------------------------------------------------------------
copyfonts LDA #$33 ; make the CPU see the Character Generator ROM
STA $01 ; at $D000
LDX #7 ; copy chars to sprite in one swoop
LDY #23 ; 3rd column 8th row in a sprite
source3 LDA $d018,x ; do this while sprite is all under border
dest3 STA $3080,y
DEY
source2 LDA $d010,x
dest2 STA $3080,y
DEY
source1 LDA $d008,x
dest1 STA $3080,y
DEY ; third dey
DEX ; one dex
BPL source3 ; if less than zero stop
LDA #$37 ; switch in I/O mapped registers again
STA $01 ; so vic can see them
JMP taskexit
;-------------------------------------------------------------------------------
removmsb LDA sprindex ; after 32 scrolls a sprite crosses below msb
TAY
ASL A ; double it
TAX
LDA #95 ; also move most left sprite
STA $D000,x ; to the right side as all under border
LDA $D010
AND remtable,y
STA $D010
JMP taskexit
remtable BYTE %10111111, %01111111, %11111110, %11111101
BYTE %11111011, %11110111, %11101111, %11011111
;-------------------------------------------------------------------------------
addmsb LDA sprindex
CLC
ADC #1
AND #7 ; so increse sprite index 0-7
STA sprindex
TAY ; backit up to y
ASL A ; double it
TAX ; move it to x
_palfix LDA #$ff ; $f7 is equal -1 under PAL system
STA $D000,x ; x-pos was a $ff value
LDA $D010 ; so under ntsc nothing change
ORA addtable,y ; now move the sprite to the negative range
STA $D010 ; that is all the way to the left
TXA
JMP taskexit
addtable BYTE %00000001, %00000010, %00000100, %00001000
BYTE %00010000, %00100000, %01000000, %10000000
;-------------------------------------------------------------------------------
slicer byte 0
sprindex byte 0
counter byte 0 ; increases every full slicer
jumptable
WORD sprsetup, color, skip, skip ; 1-4
WORD skip, color, skip, skip ; 5-8
WORD gettext1, color, skip, skip ; 9-12
WORD gettext2, color, skip, skip ; 13-16
WORD gettext3, color, skip, skip ; 17-20
WORD copyfonts, color, skip, skip ; 21-24
WORD skip, color, skip, skip ; 25-28
WORD skip, color, skip, removmsb ; 29-32
WORD skip, color, skip, skip ; 33-36
WORD skip, color, skip, skip ; 37-40
WORD skip, color, skip, skip ; 41-44
WORD skip, color, skip, addmsb ; 45-48
_D000 BYTE 247,42 ; X and Y sprite 1 247 = -1 in pal
_D002 BYTE 47,42 ; X and Y sprite 2
_D004 BYTE 95,42 ; X and Y sprite 3
_D006 BYTE 143,42 ; X and Y sprite 4
_D008 BYTE 191,42 ; X and Y sprite 5
_D00A BYTE 239,42 ; X and Y sprite 6
_D00C BYTE 31,42 ; X and Y sprite 7
_D00E BYTE 79,42 ; X and Y sprite 8
_D010 BYTE %11000001 ; MSBs of X coordinates
_D011 BYTE $1B ; Control register 1
_D012 BYTE 249 ; Raster counter
_D013 BYTE 0 ; Light Pen X
_D014 BYTE 0 ; Light Pen Y
_D015 BYTE 255 ; Sprite enabled
_D016 BYTE $C8 ; Control register 2
_D017 BYTE 0 ; Sprite Y expansion
_D018 BYTE $14 ; Memory pointers
_D019 BYTE $ff ; Interrupt register ACK all
_D01A BYTE 1 ; interrupts enabled
_D01B BYTE 0 ; Sprite data priority
_D01C BYTE 0 ; Sprite multicolor
_D01D BYTE 255 ; Sprite X expansion
_D01E BYTE 0 ; Sprite-sprite collision
_D01F BYTE 0 ; Sprite-data collision
_D020 BYTE 14 ; Border color
_D021 BYTE 6 ; Background color 0
_D022 BYTE 0 ; Background color 1
_D023 BYTE 0 ; Background color 2
_D024 BYTE 0 ; Background color 3
_D025 BYTE 0 ; Sprite multicolor 0
_D026 BYTE 0 ; Sprite multicolor 1
_D027 BYTE 1 ; Color sprite 0
_D028 BYTE 1 ; Color sprite 1
_D029 BYTE 1 ; Color sprite 2
_D02A BYTE 1 ; Color sprite 3
_D02B BYTE 1 ; Color sprite 4
_D02C BYTE 1 ; Color sprite 5
_D02D BYTE 1 ; Color sprite 6
_D02E BYTE 1 ; Color sprite 7
mytext TEXT 'HELLO THERE '
BYTE 78,86,77
TEXT' THIS IS A SPRITE SCROLLER IN THE BORDER GO TO LEMON64.COM/FORUM SCENE '
TEXT' USES 8 X-EXPANDED SPRITES, A 48 SLICE SCHEDULER RUNS SNIPPETS DURING RASTER IRQ '
BYTE 159,32,32,32,32,32, $FF
creating a .crt image (the quest to figure out how they put 1mb and address it i suppose Making a C64 cartridge
above my braingrade but it might have clues:
c64 64k carts?
tho after seeing SJA Neutron as the result of a 16kb cart compo i assume starting there cant hurt but i doubt theres gonna be much difference since it doesnt need to switch banks and thats banks-on-cart (i suppose ?) which will have to have some pointer somewhere at some point somewhere to be set inside the box or through a pin on the output from the box
well im reinstalling (2023 07 24) and need to doc for the yellow ooze coming from my head with extra pain as cherry on top so i might just google while its all moving bits across cables and
this page is obviously unsorted, if that offends you, find a shrink, or send a mail, if your level is lower than mine i will try to explain ...:)
this looks like it might contain what im looking for
128 banks of 8kb ... not 16kb then, but fine if switching is fast i suppose (havent tried briley or EOB yet past the intro ... little clarity, house-stuff, pain and janesondergrond is not a doompatrol metafor, physical ailments, gat and vermassen-op-een-moped-gnome still yanking make it really hard to focus on anything that keeps me quiet and stable
set by a single memory address ? well that seems straightforward enough ...
boot
copy the main engine to the machine
switch content banks as needed
?
yea its gonna require more nops in between im sure
but for now i'll assume thats the giste of it
im too weird to suffer from illusions by crawling into a very small space and pretend im the only one on the internet who knows
thats why i dont have friends
https://www.lemon64.com/forum/viewtopic.php?p=953296#953296
; 10 SYS (2080)
*=$0801
BYTE $0E, $08, $0A, $00, $9E, $20, $28, $32, $30, $38, $30, $29, $00, $00, $00
*=$820
sprdata = $3000 ; within 16K address of vic's range based on bank
S = 1024 ; screen location based on bank used
LB = 1
HB = 2
Init SEI ; set bit, make the CPU ignore interrupt
LDA #%01111111 ; switch off interrupt signals from CIA-1
STA $DC0D
LDA $DC0D ; acknowledge pending interrupts from CIA-1
LDA $DD0D ; acknowledge pending interrupts from CIA-2
LDX #IRQ
STX $0315
LDX #sprdata/64 ; sprite data at $3000 (192 x 64)
STX S+1016
INX
STX S+1017
INX
STX S+1018
INX
STX S+1019
INX
STX S+1020
INX
STX S+1021
INX
STX S+1022
INX
STX S+1023
LDA #0
STA slicer ; in case user re-run
STA sprindex ; in case user re-run
STA _thechar+LB ; in case user re-run
STA S+$3BFF ; clear garbage under border $3FFF
TAX ; make x a zero too
clearloop STA sprdata,x
STA sprdata+256,x ; sprite spans 512bytes
INX
BNE clearloop ; rolled past 255 to zero
LDX #$2e ; preset all vic registers
loop LDA _D000,x ; the label name
STA $D000,x ; the registers
DEX
BPL loop ; until less than zero
LDA $02a6 ; kernal sets this flag
BEQ isntsc ; it is ntsc
LDA #$f7 ; is equal -1 under PAL system
STA _palfix+LB
isntsc
CLI ; clear interrupt flag
RTS
;---------------------The Interupt Service Routine------------------------------
IRQ ASL $D019 ; acknowledge the interrupt by clearing flag
_nextline LDX #0-0 ; 249 or 27
STX $D012 ; set next rasterline where interrupt occur
BMI restore25 ; branch if bit 7 set
LDX #249 ; value over 128 is a 'minus'
STX _nextline+LB
LDX #$13 ; set 24 rows, has to be be done on line 249
STX $D011 ; scrolly trick for no border
JMP $EA31 ; exit to keyboard scan
restore25 LDX #$1B
STX $D011 ; undo scroll on any other line
LDX #50 ; line 50 is just 8 rows below start of sprites
STX _nextline+LB ; set rasterline where interrupt shall occu
;--------------------------Main Program-----------------------------------------
runalways DEC $D000 ; sprite 1
DEC $D002 ; sprite 2
DEC $D004 ; sprite 3
DEC $D006 ; sprite 4
DEC $D008 ; sprite 5
DEC $D00A ; sprite 6
DEC $D00C ; sprite 7
DEC $D00E ; sprite 8
;----------------------Main Program Slicer Scheduler----------------------------
skip = $EA81 ; no keyboard scan
taskexit = $EA81 ; no keyboard scan
LDA slicer ; goes from 0-47
TAX ; move it to x
INX ; our index counting up
CPX #48 ; end of list
BNE notend
INC counter ; master counter if a task needs it
LDX #0
notend STX slicer ; set next return
ASL A ; double it as table are words
TAX ; move it to x
LDA jumptable,x
STA thejump+LB
LDA jumptable+1,x
STA thejump+HB
thejump JMP $1234-0 ; selfmod
;-------------------------------------------------------------------------------
sprsetup LDA sprindex ; first entry 321
LSR A ; 00000032 (1)
ROR A ; 10000003 (2)
ROR A ; 21000000 (3) the 3 is used in HB
STA dest1+LB ; 0, 64, 128 or 192
STA dest2+LB
STA dest3+LB
LDA #>sprdata ; get HB of sprite data loc
ADC #0 ; use (if) carry from the 3
STA dest1+HB ; 0, 64, 128 or 192
STA dest2+HB
STA dest3+HB
JMP taskexit
;-------------------------------------------------------------------------------
color LDX #0-0 ; 0 to 7
INX
CPX #8
BNE _notendcol
LDX #0
_notendcol STX color+LB
LDY #7
_colloop LDA colortable,x
STA $D027,y ; sprite0 color + y
INX
DEY
BPL _colloop
JMP taskexit
colortable BYTE 1,15,12,11,11,12,15,1 , 1,15,12,11,11,12,15 ;repeat 7 bytes
;-------------------------------------------------------------------------------
gettext1 LDX #source1-source3 ; sprite is filled in from bottom right..
BYTE $2C ; the BIT opcode skip trick
gettext2 LDX #source2-source3 ; ...to top left so source3 is first
BYTE $2C
gettext3 LDX #source3-source3 ; yes it would be zero
_thechar LDY #0-0 ; char pointer
LDA mytext,y ; get char
CMP #$ff ; end of text so can use 0-to-254 petscii
BNE _noendtxt ; replace these two lines w/ BPL for cbm style
LDA #32 ; replace w/ space, use AND #127 for cbm style
LDY #-1 ; iny below makes it 0 max 256 charters for now
_noendtxt INY
STY _thechar+LB ; next char on return
TAY ; 87654321
ASL A ; 76543210 = x2
ASL A ; 65432100 = x4
ASL A ; 54321000 = x8
STA source3+LB,x ; store it in copyfonts 1 to 3
TYA ; 87654321
LSR A ; 08765432
LSR A ; 00876543
LSR A ; 00087654
LSR A ; 00008765
LSR A ; 00000876
ORA #$D0 ; char rom block start at $D000
STA source3+HB,x ; store it in copyfonts 1 to 3
JMP taskexit
;-------------------------------------------------------------------------------
copyfonts LDA #$33 ; make the CPU see the Character Generator ROM
STA $01 ; at $D000
LDX #7 ; copy chars to sprite in one swoop
LDY #23 ; 3rd column 8th row in a sprite
source3 LDA $d018,x ; do this while sprite is all under border
dest3 STA $3080,y
DEY
source2 LDA $d010,x
dest2 STA $3080,y
DEY
source1 LDA $d008,x
dest1 STA $3080,y
DEY ; third dey
DEX ; one dex
BPL source3 ; if less than zero stop
LDA #$37 ; switch in I/O mapped registers again
STA $01 ; so vic can see them
JMP taskexit
;-------------------------------------------------------------------------------
removmsb LDA sprindex ; after 32 scrolls a sprite crosses below msb
TAY
ASL A ; double it
TAX
LDA #95 ; also move most left sprite
STA $D000,x ; to the right side as all under border
LDA $D010
AND remtable,y
STA $D010
JMP taskexit
remtable BYTE %10111111, %01111111, %11111110, %11111101
BYTE %11111011, %11110111, %11101111, %11011111
;-------------------------------------------------------------------------------
addmsb LDA sprindex
CLC
ADC #1
AND #7 ; so increse sprite index 0-7
STA sprindex
TAY ; backit up to y
ASL A ; double it
TAX ; move it to x
_palfix LDA #$ff ; $f7 is equal -1 under PAL system
STA $D000,x ; x-pos was a $ff value
LDA $D010 ; so under ntsc nothing change
ORA addtable,y ; now move the sprite to the negative range
STA $D010 ; that is all the way to the left
TXA
JMP taskexit
addtable BYTE %00000001, %00000010, %00000100, %00001000
BYTE %00010000, %00100000, %01000000, %10000000
;-------------------------------------------------------------------------------
slicer byte 0
sprindex byte 0
counter byte 0 ; increases every full slicer
jumptable
WORD sprsetup, color, skip, skip ; 1-4
WORD skip, color, skip, skip ; 5-8
WORD gettext1, color, skip, skip ; 9-12
WORD gettext2, color, skip, skip ; 13-16
WORD gettext3, color, skip, skip ; 17-20
WORD copyfonts, color, skip, skip ; 21-24
WORD skip, color, skip, skip ; 25-28
WORD skip, color, skip, removmsb ; 29-32
WORD skip, color, skip, skip ; 33-36
WORD skip, color, skip, skip ; 37-40
WORD skip, color, skip, skip ; 41-44
WORD skip, color, skip, addmsb ; 45-48
_D000 BYTE 247,42 ; X and Y sprite 1 247 = -1 in pal
_D002 BYTE 47,42 ; X and Y sprite 2
_D004 BYTE 95,42 ; X and Y sprite 3
_D006 BYTE 143,42 ; X and Y sprite 4
_D008 BYTE 191,42 ; X and Y sprite 5
_D00A BYTE 239,42 ; X and Y sprite 6
_D00C BYTE 31,42 ; X and Y sprite 7
_D00E BYTE 79,42 ; X and Y sprite 8
_D010 BYTE %11000001 ; MSBs of X coordinates
_D011 BYTE $1B ; Control register 1
_D012 BYTE 249 ; Raster counter
_D013 BYTE 0 ; Light Pen X
_D014 BYTE 0 ; Light Pen Y
_D015 BYTE 255 ; Sprite enabled
_D016 BYTE $C8 ; Control register 2
_D017 BYTE 0 ; Sprite Y expansion
_D018 BYTE $14 ; Memory pointers
_D019 BYTE $ff ; Interrupt register ACK all
_D01A BYTE 1 ; interrupts enabled
_D01B BYTE 0 ; Sprite data priority
_D01C BYTE 0 ; Sprite multicolor
_D01D BYTE 255 ; Sprite X expansion
_D01E BYTE 0 ; Sprite-sprite collision
_D01F BYTE 0 ; Sprite-data collision
_D020 BYTE 14 ; Border color
_D021 BYTE 6 ; Background color 0
_D022 BYTE 0 ; Background color 1
_D023 BYTE 0 ; Background color 2
_D024 BYTE 0 ; Background color 3
_D025 BYTE 0 ; Sprite multicolor 0
_D026 BYTE 0 ; Sprite multicolor 1
_D027 BYTE 1 ; Color sprite 0
_D028 BYTE 1 ; Color sprite 1
_D029 BYTE 1 ; Color sprite 2
_D02A BYTE 1 ; Color sprite 3
_D02B BYTE 1 ; Color sprite 4
_D02C BYTE 1 ; Color sprite 5
_D02D BYTE 1 ; Color sprite 6
_D02E BYTE 1 ; Color sprite 7
mytext TEXT 'HELLO THERE '
BYTE 78,86,77
TEXT' THIS IS A SPRITE SCROLLER IN THE BORDER GO TO LEMON64.COM/FORUM SCENE '
TEXT' USES 8 X-EXPANDED SPRITES, A 48 SLICE SCHEDULER RUNS SNIPPETS DURING RASTER IRQ '
BYTE 159,32,32,32,32,32, $FF
and more
https://codebase64.org/doku.php?id=base:opening_up_the_borders_-_a_further_explanation
https://www.c64-wiki.com/wiki/Extended_color_mode