@@ -430,10 +430,10 @@ pub extern "C" fn main(api: &'static bios::Api) -> ! {
430430 let config = Config :: load ( ) . unwrap_or_else ( |_| Config :: default ( ) ) ;
431431
432432 if config. has_vga_console ( ) {
433- // Try and set 80x50 mode for that authentic Windows NT bootloader feel
433+ // Try and set 80x30 mode for maximum compatibility
434434 ( api. video_set_mode ) ( bios:: video:: Mode :: new (
435- bios:: video:: Timing :: T640x400 ,
436- bios:: video:: Format :: Text8x8 ,
435+ bios:: video:: Timing :: T640x480 ,
436+ bios:: video:: Format :: Text8x16 ,
437437 ) ) ;
438438 // Work with whatever we get
439439 let mode = ( api. video_get_mode ) ( ) ;
@@ -465,28 +465,47 @@ pub extern "C" fn main(api: &'static bios::Api) -> ! {
465465 println ! ( "Welcome to {}!" , OS_VERSION ) ;
466466 println ! ( "Copyright © Jonathan 'theJPster' Pallant and the Neotron Developers, 2022" ) ;
467467
468+ let mut found;
469+
470+ println ! ( "Memory Regions:" ) ;
471+ found = false ;
468472 for region_idx in 0 ..=255 {
469- match ( api. memory_get_region ) ( region_idx) {
470- bios:: Result :: Ok ( region) => {
471- println ! ( "Region {}: {}" , region_idx, region) ;
472- }
473- _ => {
474- // Ran out of regions (we assume they are consecutive)
475- break ;
476- }
473+ if let bios:: Option :: Some ( region) = ( api. memory_get_region ) ( region_idx) {
474+ println ! ( "Region {}: {}" , region_idx, region) ;
475+ found = true ;
476+ } else {
477+ // Ran out of regions (we assume they are consecutive)
478+ break ;
477479 }
478480 }
481+ if !found {
482+ println ! ( "None." ) ;
483+ }
479484
480- // Some text, to force the console to scroll.
481- for i in 0 ..50 {
482- for _x in 0 ..50 - i {
483- print ! ( "." ) ;
485+ println ! ( "Serial Ports:" ) ;
486+ found = false ;
487+ for device_idx in 0 ..=255 {
488+ if let bios:: Option :: Some ( serial) = ( api. serial_get_info ) ( device_idx) {
489+ println ! ( "Serial Device {}: {:?}" , device_idx, serial) ;
490+ found = true ;
491+ } else {
492+ // Ran out of serial devices (we assume they are consecutive)
493+ break ;
484494 }
485- println ! ( "{}" , i) ;
486- ( api. delay ) ( neotron_common_bios:: Timeout :: new_ms ( 250 ) ) ;
495+ }
496+ if !found {
497+ println ! ( "None." ) ;
487498 }
488499
489- panic ! ( "Testing a panic..." ) ;
500+ loop {
501+ if let neotron_common_bios:: Result :: Ok ( neotron_common_bios:: Option :: Some ( ev) ) =
502+ ( api. hid_get_event ) ( )
503+ {
504+ let ticks = ( api. time_ticks_get ) ( ) ;
505+ println ! ( "HID Ev: {:?} @ {}" , ev, ticks. 0 ) ;
506+ }
507+ ( api. power_idle ) ( ) ;
508+ }
490509}
491510
492511/// Called when we have a panic.
@@ -495,11 +514,8 @@ pub extern "C" fn main(api: &'static bios::Api) -> ! {
495514fn panic ( info : & core:: panic:: PanicInfo ) -> ! {
496515 println ! ( "PANIC!\n {:#?}" , info) ;
497516 loop {
498- for ch in "|/-\\ " . chars ( ) {
499- print ! ( "\r {}" , ch) ;
500- if let Some ( api) = unsafe { API } {
501- ( api. delay ) ( neotron_common_bios:: Timeout :: new_ms ( 100 ) ) ;
502- }
517+ if let Some ( api) = unsafe { API } {
518+ ( api. power_idle ) ( ) ;
503519 }
504520 }
505521}
0 commit comments