inline PlusROM_functions.asm set kernel_options no_blank_lines set romsize 8kSC set smartbranching on const pfres=32 dim request_pending=a dim delay_counter=b dim rom_state=c dim xpos=d dim ypos=e dim set_type=f pfclear playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX............................XX X.X..........................X.X X..X........................X..X X...X......................X...X X....X....................X....X X.....X..................X.....X X......X................X......X X.......X..............X.......X X........X............X........X X.........X..........X.........X X..........X........X..........X X...........X......X...........X X............X....X............X X.............X..X.............X X..............XX..............X X.............X..X.............X X............X....X............X X...........X......X...........X X..........X........X..........X X.........X..........X.........X X........X............X........X X.......X..............X.......X X......X................X......X X.....X..................X.....X X....X....................X....X X...X......................X...X X..X........................X..X X.X..........................X.X XX............................XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end rem Writing to the send buffer and sending the buffer to rem the internet backend, the value sent is the our state: rem 0 = ROM is starting WriteSendBuffer=0 request_pending=1 COLUPF=$56 ; PAL green COLUBK=$B8 ; PAL blue gameloop if ReceiveBufferSize>126 then goto change_tile if request_pending=1 then goto check_end if delay_counter>0 then delay_counter=delay_counter-1:goto check_end if joy0left then WriteSendBuffer=1:request_pending=1:goto check_end if joy0up then WriteSendBuffer=2:request_pending=1:goto check_end if joy0right then WriteSendBuffer=3:request_pending=1:goto check_end if joy0down then WriteSendBuffer=4:request_pending=1:goto check_end check_end asm lda SWCHA ; for PlusCart exit function lda SWCHB ; for PlusCart exit function end begin_drawscreen drawscreen goto gameloop rem loading tile (128 bytes) from backend rem and write to playfield RAM (bB needs 3500cycles) change_tile_bB x=0 request_pending=0 delay_counter=2 tile_loop_bB w000[x]=ReceiveBuffer if ReceiveBufferSize=0 then goto begin_drawscreen x=x+1 goto tile_loop_bB rem loading tile (128 bytes) from backend rem and write to playfield RAM (bB needs 3500cycles) asm .change_tile LDA #0 STA request_pending TAX LDA #2 STA delay_counter .tile_loop LDA ReceiveBuffer ; 4 STA w000,x ; 5 @9 INX ; 2 @11 LDA ReceiveBufferSize ; 4 @15 BNE .tile_loop ; 2/3 @18 JMP .begin_drawscreen ; 3 end rem define PlusROM backend URL here rem don't let your program flow run into this code asm SET_PLUSROM_API "map.php", "bb-painter.firmaplus.de" end