prog8/examples/test.p8

32 lines
727 B
Plaintext
Raw Normal View History

%import textio
%zeropage basicsafe
%option no_sysinit
2021-10-27 21:48:02 +00:00
2021-10-30 13:15:11 +00:00
main {
sub start() {
ubyte num_banks = cx16.numbanks()
txt.print("number of ram banks ")
txt.print_ub(num_banks)
txt.print(" = ")
txt.print_uw($0008*num_banks)
txt.print("kb\n")
print_banks()
cx16.rambank(55)
cx16.rombank(3)
print_banks()
}
2021-12-01 21:26:36 +00:00
sub print_banks() {
ubyte rambank = cx16.getrambank()
ubyte rombank = cx16.getrombank()
cx16.rombank(0) ; enable kernal
txt.print("ram bank ")
txt.print_ub(rambank)
txt.nl()
txt.print("rom bank ")
txt.print_ub(rombank)
txt.nl()
cx16.rombank(rombank)
}
}